-
Notifications
You must be signed in to change notification settings - Fork 1
Description
-
init [directory name]Creates a basic alle monorepo structure in the current directory if no directory name is given.
A basic alle structure looks like this:package.json packages/ packages/node_modules -> packages (this is a symlink that points back to packages. Allows packages to reference each other with require and import). -
installRuns
npm iin each of the package directories (when dependencies are defined therein) and the repo directory. Creates the symlinkpackages/node_modules -> packages/to allow packages to reference each other. -
publish [...packages]Publish each of the packages given. If no packages are given, the
packagesdirectory would be scanned for packages and the user would be prompted in the terminal to choose which available packages they'd like to publish. The publishing process for each package would go like this:- If the repo has a
.gitdirectory, then it is checked for a clean working directory. If the working directory is not clean, then the program exits with an error message about the directory not being clean. - The package would be scanned for dependencies via require
andimportstatements used by the package. If a dependency is found that is not listed in thedependencies` section of either the package's package.json file or the repository package.json file, then an error is shown to the user and the program exits. - The package's package.json file would inherit from the repo package.json file. Dependencies listed in the package's package.json file would override dependencies listed in the repo's package.json file i.e.
packages/foo-package/package.json { "version": "1.0.3", "description": "A foo life in your terminal.", "dependencies": { "lodash": "*", "yargs": "6.9.x" } } package.json { "version": "0.0.0", "author": "Bob Hope", "dependencies": { "lodash": "3.4.1" } }This scenario would result in the following package.json being temporarily written to
packages/foo-package/package.json(assumingpatchwas chosen as the next version for the package):{ "version": "1.0.4", "description": "A foo life in your terminal.", "author": "Bob Hope", "dependencies": { "lodash": "*", "yargs": "6.9.x" } }npm puwould be run in each of the packages given in the command.- Each of the newly published packages would have their versions left but other changes would be reverted.
- If a
.gitdirectory was found in the repo then the updated package.json files would be committed.
- If the repo has a
-
run <...command>Runs the command in each of the packages.
-
t, testAlias for
alle run npm t.