Skip to content

Commit

Permalink
Move docs from @zero-scripts/core to main readme
Browse files Browse the repository at this point in the history
  • Loading branch information
artembatura committed Jun 30, 2020
1 parent 6b0d7fb commit d7db3d1
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 61 deletions.
72 changes: 58 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-green.svg)](https://github.com/artemirq/zero-scripts/pulls)

- [About](#about)
- [Why?](#why)
- [Highlights](#highlights)
- [Why?](#why)
- [How it works?](#how-it-works)
- [Guide](#guide)
- [Getting started with React](#getting-started-with-react)
- [Getting started with SPA](#getting-started-with-spa)
Expand All @@ -24,7 +25,9 @@

# About

This project is attempt to combine task manager, configuration management facilities and plugin system into one solution to simplify configuring development processes on building applications.
This project is attempt to combine task manager, configuration management facilities and extension system into one solution to simplify configuring development processes on building applications.

We provide an ecosystem of ready packages for development modern JavaScript projects (based on Webpack, but not limited to it).

# Highlights

Expand All @@ -36,33 +39,80 @@ Make things faster without worrying about configuration. We ship a reasonably go

- ### ⚡ Extensible & Modular

Package plugin system. Extensions is a ["pluggable"](packages/core#process-of-loading-extensions) packages. To add a feature you need only add package to `devDependencies`.
Extensions is a ["pluggable"](#process-of-loading-extensions) packages. To add a feature you need only add package to `devDependencies`.

_Most unused packages will not be installed, because you choose what you needed._
_Big part of unused packages will not be installed, because you choose what you needed._

---

- ### ⚙ Customizable

Extensions have a [set of options](packages/core#passing-options). It allows modifying configurations for your requirements.
Extensions and configurations have own [set of options](#passing-options). It's allow modifying everything for your requirements.

# Why?

**Most of popular bundlers doesn't ship configuration management facilities**. As result supporting and extending complex configurations it is a chore work in every project.

We know popular tools which solve this problem. For example CRA, Vue CLI and other. **These tools was created to simplify development only for specific projects and do not combine the best among themselves**.
We know popular tools which solve this problem: CRA, Vue CLI and other. **Projects like this was created to simplify development only for specific projects and do not combine the best among themselves**.

Also, CRA is not extensible out of the box and ship everything even if you don't need some features. You can eject CRA, but you will lose all advantages, and you will need to support configuration yourself.
CRA is not extensible out of the box and ship all features even if you don't need. You can eject CRA, but you will lose all advantages, and you will need to support configuration yourself.

# How it works?

**Preset** is a base package which contain scripts and [loads](#process-of-loading-extensions) extensions.

**Extension** is an additional package, which complements preset and can add more scripts or extend a bundler configuration.

## Process of loading extensions

Extensions will be all packages, which defined in `devDependencies` and match pattern `extension\\.[a-z]*`.

These packages will be automatically loaded and applied by preset.

### Example

Adding Babel

```diff
{
"devDependencies": {
"@zero-scripts/preset.webpack-spa": "^0.5.0",
+ "@zero-scripts/extension.webpack-babel": "^0.5.0"
}
}
```

## Passing options

You can pass options to config or extension in package.json file using `zero-scripts` field

### Example

Adding Linaria Babel preset

```diff
{
"devDependencies": {
"@zero-scripts/preset.webpack-spa": "^0.5.0",
"@zero-scripts/extension.webpack-babel": "^0.5.0"
},
+ "zero-scripts": {
+ "@zero-scripts/extension.webpack-babel": {
+ "presets": [
+ "linaria/babel"
+ ]
+ }
+ }
}
```

# Guide

At start, you need to choose basic preset, which contain necessary scripts. Then you can add extensions, which adds necessary functions for your project.

## Getting started with React

This preset includes all required features for most React projects.<br>
This preset includes all required features for the most React projects.<br>

This is the fastest way to get started with React, but you can go with more [flexible way](#getting-started-with-spa) and choose the necessary functions yourself.

Expand Down Expand Up @@ -226,12 +276,6 @@ yarn add @zero-scripts/preset.webpack-pwa
npm i @zero-scripts/preset.webpack-pwa
```

# What's next?

Currently, we have some plans to ship more presets and extensions for development server-side Node.js applications and Node.js/browser libraries.

If you like this project or you have some opinion, you can share it with us!

# Comparison with alternatives

| Project | Modular | Zero Configuration | Extensible | Universal | Customizable | Scaffold Applications |
Expand Down
47 changes: 0 additions & 47 deletions packages/core/README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,3 @@
# @zero-scripts/core

## Description

Framework for creating presets, configurations and extensions

## Process of loading extensions

Extensions will be all packages, which are in `devDependencies` and match pattern `extension\\.[a-z]*`

These packages will be automatically loaded and activated by preset

### Example

Suppose, we need adding processing JavaScript code transpilation by Babel to our `preset.webpack-spa`:

```
{
"devDependencies": {
"@zero-scripts/preset.webpack-spa": "latest",
"@zero-scripts/extension.webpack-babel": "latest"
}
}
```

## Passing options

You can pass options for config/extension in package.json file by `zero-scripts` field

### Example

Suppose, we need add additional preset for `@zero-scripts/extension.webpack-babel`

```
{
"zero-scripts": {
"@zero-scripts/extension.webpack-babel": {
"presets": [
"@babel/preset-*"
]
}
}
}
```

## [General Documentation](https://github.com/zero-scripts/zero-scripts#description)

## API

Not documented. We do not have stable version and API can change in any time. **Recommended learn API by examples**

0 comments on commit d7db3d1

Please sign in to comment.