@anireact/zc
v1.3.1
Published
Zero-config monorepo toolchain.
Downloads
24
Readme
@anireact/zc
Zero-config monorepo toolchain.
yarn global add @anireact/zc
Usage
Create new project:
cd ~/Projects
zc init 'Project name' 'Project description.'
Create new package:
cd ~/Projects/project-name
yarn zc init 'package-a' 'Package description.'
Add local dependency to project root:
cd ~/Projects/project-name
yarn zc add package-a
Add local dependency to specific package:
cd ~/Projects/project-name/@example-scope/package-b
yarn zc add @example-scope/package-a
You can remove local dependencies as usual, but if required/requiring package uses TypeScript, it is recommended to use
yarn zc remove
.
Build everything:
cd ~/Projects/project-name
yarn zc build
You can lint/fix/clean everything using
lint
/lint --fix
/clean
commands.Also, you can use
build --watch
command to start incremental build; for packages built with webpack it will start WDS.
Build specific package:
cd ~/Projects/project-name/@example-scope/package-a
yarn zc build
Configuration
Global config:
// `~/.config/zc/index.js` on Linux.
//
// See https://github.com/kingjan1999/platform-folders `userData`
// for other operating systems.
module.exports = {
/**
* Projects location.
*/
root: '/home/john/Projects',
/**
* Available licenses.
*/
licenses: ['MIT'],
/**
* Default author info.
*/
author: 'John Doe <[email protected]> (https://example.com/john)',
/**
* Default scopes for new projects.
*/
scopes: ['example-scope'],
/**
* List of GitHub users/organizations.
*/
users: ['example-user', 'example-org'],
};
Project config:
// Root `package.json`.
{
// ...other fields
"zc": {
/**
* Available scopes.
*/
"scopes": ["example-scope"],
/**
* Prefer private packages in this project.
*/
"private": false
}
}
Package config:
// Package’s `package.json`.
{
"zc": {
/**
* Build system:
*
* - `rollup` — for libraries; doesn’t bundle any dependencies.
* - `webpack` — for applications; bundles all dependencies.
* - `babel` — for CLI tools; just transpiles sources with Babel.
*/
"build": "rollup",
/**
* Allows to customize `publicPath` in webpack builds.
*/
"publicPath": "/",
/**
* Allows to customize WDS port in webpack builds.
*/
"port": 1488
}
}
Configs
Dotfiles
.gitattributes
..gitignore
..npmignore
..eslintignore
..prettierignore
Build scripts
- rollup:
- webpack:
html
(usessrc/index.html
as template when available).compression
.
Roadmap
- [ ] Investigate prose linting for English, Russian, Japanese:
- LanguageTool (English, Russian, Japanese).
- Hunspell (English, Russian).
- Grammarly (English).
- Rousseau (English).
- Glvrd (Russian).
- A3RT (Japanese).
- [ ] ESLint spellchecker.
- Probably with prose linting for non-code comments.
- [ ] commitlint prose linter.
- [ ] IDE settings:
- Code.
- IntelliJ IDEA.
- [ ] GitHub settings.
- [ ] Investigate OS-specific trash to ignore.
- [ ] Keywords.
- [ ] Shields.
- [ ] Test on Windows.
- [ ] TypeDoc.
- [ ] Analyzer plugins for rollup and webpack.
- [ ] webpack compression with Brotli/Zopfli.
License
MIT