@onerepo/plugin-changesets v0.0.0-pre.00415f0
Installation
npm install --save-dev @onerepo/plugin-changesetsconst { changesets } = require('@onerepo/plugin-changesets');
setup({
plugins: [
changesets({
// ...options
}),
],
}).then(({ run }) => run());Publish config
In order to properly use source-level dependencies without requiring constant file watching and rebuilding across workspaces, all package.json files should reference a source file in its "main" field, eg, "main": "./src/index.ts".
This causes issues when publishing shared modules for use outside of the monorepo, because consumers will likely need to use a pre-compiled version of the module. In order to safely rewrite this, as well as some other related fields, we build upon NPM’s publishConfig to include other fields: bin, main, module, typings, and exports. The presence of any of these fields in your publishConfig will trigger this plugin’s commands to overwrite the initial values during the publish cycle:
{
"name": "my-package",
"main": "./src/index.ts",
"publishConfig": {
"access": "public",
"main": "./dist/index.js",
"typings": "./dist/src/index.d.ts"
}
}{
"name": "my-package",
"main": "./dist/index.js",
"typings": "./dist/src/index.d.ts"
}Workflow
For every change that should be documented in a changelog, add a changeset using the
addcommand. This command will walk you through itself, prompting for information for each modified workspace:one change addCommit any files that are added during this process. You can always go back and edit these files manually, as long as they exist.
When you have enough changes and you’re ready to publish, run the version command.
one change versionThis will also prompt you for the workspaces that you want to publish. You can restrict this to avoid publishing any workspaces that are not yet ready.
However, any dependency in the graph of the chosen workspace(s) that has changes will also be versioned and published at this time. This is an important step to ensure consumers external to your oneRepo have all of the latest changes.
This command will delete the consumed changesets, write changelogs, and update version numbers across all modified workspaces. Commit these changes and review them using a pull-request.
Once the pull-request is merged, you can safely run the publish command:
one change publish
This plugin will trigger the core tasks plugin build lifecycle for every workspace during pre-release and publish. There is no need to manually run a build before publishing.
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago