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 18, 2020
1 parent 6b0d7fb commit a0636e7
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 58 deletions.
64 changes: 53 additions & 11 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,7 @@

# 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.

# Highlights

Expand All @@ -36,15 +37,15 @@ 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 configurations for your requirements.

# Why?

Expand All @@ -56,6 +57,53 @@ Also, CRA is not extensible out of the box and ship everything even if you don't

# 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 activated 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.
Expand Down Expand Up @@ -226,12 +274,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 a0636e7

Please sign in to comment.