You can also manually install peerDependencies for fixed versions
To create your first package, you may automate the required steps to define a new workspace using npm init.
npm init -w ./packages/a
When the package is ready, including the dependencies setup, run npm i in the project root directory to install all dependencies, including the workspaces.
Pack
Bundling your TypeScript and CSS packages with zero configuration.
Usually, it would be best to bundle CSS packages through a main index.css and output other CSS files so developers can import on demand instead of the whole package. For example @master/keyframes.css
Exclude external dependencies
aron pack automatically excludes external dependencies to be bundled by the .dependencies and peerDependencies of package.json
@master/css.webpack is bundled into dist/cjs/index.js, except for @master/css and @master/style-element.react.
So if there is an external package that needs to be bundled, you just install it to devDependencies via npm i <some-package> --save-dev, then aron pack will not exclude it.
Multiple outputs
aron pack defaults to pack multiple outputs with different formats and platforms according to exportsbin in package.json.
The command automatically bumps the version of all packages by scanning all workspaces and analyzing dependencies and peerDependencies of package.json
.
βββ package.json
βββ packages
ββββ a
| ββββ package.json
ββββ b
| ββββ package.json
ββββ c
ββββ package.json
This command scans all workspaces for dependencies with unspecified versions "" considered a project package, then replaces them with the next version.
Now bump all dependent and workspace packages to a specified version:
Typically, you would use Aron's semantic release with CI to automate the version and release commands.
Build system for monorepo
Most workspace packages will pre-set script commands, such as build, test, and lint. Since features depend on each other, builds will be executed sequentially.
You can now use Turborepo to easily build complex systems and run commands in one-linear.
{"scripts":{"dev":"turbo run dev","build":"turbo run build","test":"turbo run test --parallel","lint":"turbo run lint --parallel","type-check":"turbo run type-check --parallel"}}
In most cases, dev and build cannot add the --parallel flag, which breaks their dependencies.
Typical workspace scripts for authoring a package:
{"scripts":{"build":"aron pack","dev":"npm run build -- --watch","test":"jest","type-check":"tsc --noEmit","lint":"eslint src"}}
From now on, you only need to run the command in the project root after opening the project.
npm run dev
Build your application or package:
npm run build
Test your business logic or UI by running scripts:
npm run test
Find and fix problems in JavaScript code before building:
npm run lint
Improve reliability with TypeScript's type checking:
npm run type-check
Continuous Integration
With the well-configured build system, almost all commands can be automated through CI, taking GitHub Actions as an example:
Build automated tests on the beta, the main, and the pull request stream:
A monorepo ecosystem integrating first-class packages and build systems π¦
The npm package aronrepo receives a total of 11 weekly downloads. As such, aronrepo popularity was classified as not popular.
We found that aronrepo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.Β It has 1 open source maintainer collaborating on the project.
Package last updated on 27 Mar 2023
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.