@jpp-toolkit/plugin-changesets 0.0.14 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -14,7 +14,7 @@ var ChangesetCommand = class extends Command {
14
14
  cwd: findProjectRoot(),
15
15
  stdio: "inherit",
16
16
  reject: false
17
- })).failed) process.exit(1);
17
+ })).failed) this.exit(1);
18
18
  }
19
19
  };
20
20
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["args: string[]","commandArgs: string[]","args: string[]","args: string[]","args: string[]"],"sources":["../src/changeset-command.ts","../src/add-changeset-command.ts","../src/init-changeset-command.ts","../src/pre-changeset-command.ts","../src/publish-changeset-command.ts","../src/status-changeset-command.ts","../src/tag-changeset-command.ts","../src/version-changeset-command.ts","../src/index.ts"],"sourcesContent":["import { createRequire } from 'node:module';\nimport path from 'node:path';\n\nimport { Command } from '@jpp-toolkit/core';\nimport { findProjectRoot } from '@jpp-toolkit/utils';\nimport { execa } from 'execa';\n\nconst require = createRequire(import.meta.url);\n\nconst CHANGESET_BIN = path.resolve(require.resolve('@changesets/cli/package.json'), '../bin.js');\n\nexport abstract class ChangesetCommand extends Command {\n protected async _execChangeset(args: string[] = []): Promise<void> {\n const cwd = findProjectRoot();\n const result = await execa(CHANGESET_BIN, args, { cwd, stdio: 'inherit', reject: false });\n\n if (result.failed) process.exit(1);\n }\n}\n","import { Flags } from '@oclif/core';\n\nimport { ChangesetCommand } from './changeset-command';\n\nexport class AddChangesetCommand extends ChangesetCommand {\n static override summary = 'Add a new changeset to the project.';\n\n static override description = `\nThis is the main command people use to interact with the changesets.\n\nThis command will ask you a series of questions, first about what packages you want to release,\nthen what semver bump type for each package, then it will ask for a summary of the entire changeset.\nThe final step will show the changeset it will generate and confirm that you want to add it.\n\nOnce confirmed, the changeset will be written a Markdown file that contains the summary and YAML\nfront matter which stores the packages that will be released and the semver bump types for them.\n`;\n\n static override flags = {\n empty: Flags.boolean({\n char: 'e',\n description: 'Create an empty changeset without prompts.',\n default: false,\n }),\n open: Flags.boolean({\n char: 'o',\n description: 'Open the changeset in the default editor after creating it.',\n default: false,\n }),\n };\n\n static override examples = [\n {\n description: 'Add a new changeset to the project.',\n command: '<%= config.bin %> <%= command.id %>',\n },\n {\n description: 'Add an empty changeset without any prompts.',\n command: '<%= config.bin %> <%= command.id %> --empty',\n },\n {\n description: 'Add a new changeset and open it in the default editor.',\n command: '<%= config.bin %> <%= command.id %> --open',\n },\n ];\n\n public async run(): Promise<void> {\n const { flags } = await this.parse(AddChangesetCommand);\n\n const args: string[] = ['add'];\n if (flags.empty) args.push('--empty');\n if (flags.open) args.push('--open');\n\n await this._execChangeset(args);\n }\n}\n","import { ChangesetCommand } from './changeset-command';\n\nexport class InitChangesetCommand extends ChangesetCommand {\n static override summary = 'Sets up the .changeset folder.';\n\n static override description = `\nThis command sets up the .changeset folder. It generates a readme and a config file.\nThe config file includes the default options and comments on what these options represent.\nYou should run this command once when you are setting up changesets.\n`;\n\n static override examples = [\n {\n description: 'Initialize changesets in your repository.',\n command: '<%= config.bin %> <%= command.id %>',\n },\n ];\n\n public async run(): Promise<void> {\n await this._execChangeset(['init']);\n }\n}\n","import { Args } from '@oclif/core';\n\nimport { ChangesetCommand } from './changeset-command';\n\nexport class PreChangesetCommand extends ChangesetCommand {\n static override summary = 'Enters and exits pre-release mode for packages.';\n\n static override description = `\nThe pre command enters and exits pre mode. The command does not do any actual versioning, when doing\na pre-release, you should run changeset pre enter next(or a different tag, the tag is what is in\nversions and is the npm dist tag) and then do the normal release process with changeset version and\nchangeset publish.\n`;\n\n static override args = {\n action: Args.string({\n name: 'action',\n required: true,\n description: 'The pre-release action to perform.',\n options: ['enter', 'exit'],\n }),\n tag: Args.string({\n name: 'tag',\n required: false,\n description: 'The pre-release tag to use when entering pre-release mode.',\n }),\n };\n\n static override examples = [\n {\n description: 'Enter pre-release mode with the \"next\" tag.',\n command: '<%= config.bin %> <%= command.id %> enter next',\n },\n {\n description: 'Exit pre-release mode.',\n command: '<%= config.bin %> <%= command.id %> exit',\n },\n ];\n\n public async run(): Promise<void> {\n const { args } = await this.parse(PreChangesetCommand);\n\n const commandArgs: string[] = ['pre', args.action];\n if (args.action === 'enter' && args.tag) commandArgs.push('--tag', args.tag);\n\n await this._execChangeset(commandArgs);\n }\n}\n","import { Flags } from '@oclif/core';\n\nimport { ChangesetCommand } from './changeset-command';\n\nexport class PublishChangesetCommand extends ChangesetCommand {\n static override summary = 'Publishes changes to npm, and creates git tags.';\n\n static override description = `\nThis publishes changes to npm, and creates git tags. This works by going into each package, checking\nif the version it has in its package.json is published on npm, and if it is not, running the npm\npublish. If you are using pnpm as a package manager, this automatically detects it and uses pnpm\npublish instead.\n`;\n\n static override flags = {\n 'otp': Flags.string({\n char: 'o',\n description: 'One-time password for publishing to npm.',\n required: false,\n }),\n 'tag': Flags.string({\n char: 't',\n description: 'Tag to publish the package under.',\n required: false,\n }),\n 'no-git-tag': Flags.boolean({\n description: 'Skip creating a git tag after publishing.',\n required: false,\n default: false,\n }),\n };\n\n static override examples = [\n {\n description: 'Publish packages to npm and create git tags.',\n command: '<%= config.bin %> <%= command.id %>',\n },\n {\n description: 'Publish packages with a one-time password.',\n command: '<%= config.bin %> <%= command.id %> --otp 123456',\n },\n {\n description: 'Publish packages under a specific tag.',\n command: '<%= config.bin %> <%= command.id %> --tag beta',\n },\n {\n description: 'Publish packages without creating git tags.',\n command: '<%= config.bin %> <%= command.id %> --no-git-tag',\n },\n ];\n\n public async run(): Promise<void> {\n const { flags } = await this.parse(PublishChangesetCommand);\n\n const args: string[] = ['publish'];\n if (flags.otp) args.push('--otp', flags.otp);\n if (flags.tag) args.push('--tag', flags.tag);\n if (flags['no-git-tag']) args.push('--no-git-tag');\n\n await this._execChangeset(args);\n }\n}\n","import { Flags } from '@oclif/core';\n\nimport { ChangesetCommand } from './changeset-command';\n\nexport class StatusChangesetCommand extends ChangesetCommand {\n static override summary = 'Provides information about the changesets that currently exist.';\n\n static override description = `\nThe status command provides information about the changesets that currently exist. If there are no\nchangesets present, it exits with an error status code.\n`;\n\n static override flags = {\n verbose: Flags.boolean({\n char: 'v',\n description:\n 'Use if you want to know the new versions, and get a link to the relevant changeset summary.',\n required: false,\n default: false,\n }),\n output: Flags.string({\n char: 'o',\n description:\n 'Allows you to write the JSON object of the status output for consumption by other tools, such as CI.',\n required: false,\n }),\n since: Flags.string({\n char: 's',\n description:\n 'Only display information about changesets since a specific branch or git tag (such as main, or the git hash of latest).',\n required: false,\n }),\n };\n\n static override examples = [\n {\n description: 'Get the status of changesets in the project.',\n command: '<%= config.bin %> <%= command.id %>',\n },\n {\n description:\n 'Get a verbose status of changesets, including new versions and links to summaries.',\n command: '<%= config.bin %> <%= command.id %> --verbose',\n },\n {\n description: 'Output the status of changesets as a JSON object.',\n command: '<%= config.bin %> <%= command.id %> --output status.json',\n },\n {\n description: 'Get the status of changesets since a specific branch or git tag.',\n command: '<%= config.bin %> <%= command.id %> --since main',\n },\n ];\n\n public async run(): Promise<void> {\n const { flags } = await this.parse(StatusChangesetCommand);\n\n const args: string[] = ['status'];\n if (flags.verbose) args.push('--verbose');\n if (flags.output) args.push('--output', flags.output);\n if (flags.since) args.push('--since', flags.since);\n\n await this._execChangeset(args);\n }\n}\n","import { ChangesetCommand } from './changeset-command';\n\nexport class TagChangesetCommand extends ChangesetCommand {\n static override summary = 'Creates git tags for the current version of all packages.';\n\n static override description = `\nThe tag command creates git tags for the current version of all packages. The tags created are\nequivalent to those created by changeset publish, but the tag command does not publish anything to\nnpm.\n\nThis is helpful in situations where a different tool, such as pnpm publish -r, is used to publish\npackages instead of changeset. For situations where changeset publish is executed, running changeset\ntag is not needed.\n\nThe git tags in monorepos are created in the format pkg-name@version-number and are based on the\ncurrent version number of the package.json for each package. Note that in single-package\nrepositories, the git tag will include v before the version number, for example, v1.0.0. It is\nexpected that changeset version is run before changeset tag, so the package.json versions are\nupdated before the git tags are created.\n`;\n\n public async run(): Promise<void> {\n await this._execChangeset(['tag']);\n }\n}\n","import { Flags } from '@oclif/core';\n\nimport { ChangesetCommand } from './changeset-command';\n\nexport class VersionChangesetCommand extends ChangesetCommand {\n static override summary =\n 'Takes changesets that have been made and updates versions and dependencies of packages, as well as writing changelogs.';\n\n static override description = `\nThis is one of two commands responsible for releasing packages. The version command takes changesets\nthat have been made and updates versions and dependencies of packages, as well as writing\nchangelogs. It is responsible for all file changes to versions before publishing to npm.\n`;\n\n static override flags = {\n ignore: Flags.string({\n char: 'i',\n description: 'Comma-separated list of packages to ignore when versioning.',\n required: false,\n }),\n snapshot: Flags.string({\n char: 's',\n description: 'Create snapshot versions with the given tag.',\n required: false,\n }),\n };\n\n static override examples = [\n {\n description: 'Version packages based on changesets.',\n command: '<%= config.bin %> <%= command.id %>',\n },\n {\n description: 'Version packages while ignoring specific packages.',\n command: '<%= config.bin %> <%= command.id %> --ignore package-a,package-b',\n },\n {\n description: 'Version packages with snapshot versions.',\n command: '<%= config.bin %> <%= command.id %> --snapshot beta',\n },\n ];\n\n public async run(): Promise<void> {\n const { flags } = await this.parse(VersionChangesetCommand);\n\n const args: string[] = ['version'];\n if (flags.ignore) args.push('--ignore', flags.ignore);\n if (flags.snapshot) args.push('--snapshot', flags.snapshot);\n\n await this._execChangeset(args);\n }\n}\n","import { AddChangesetCommand } from './add-changeset-command';\nimport { InitChangesetCommand } from './init-changeset-command';\nimport { PreChangesetCommand } from './pre-changeset-command';\nimport { PublishChangesetCommand } from './publish-changeset-command';\nimport { StatusChangesetCommand } from './status-changeset-command';\nimport { TagChangesetCommand } from './tag-changeset-command';\nimport { VersionChangesetCommand } from './version-changeset-command';\n\nexport const commands = {\n 'changeset:init': InitChangesetCommand,\n 'changeset:add': AddChangesetCommand,\n 'changeset:version': VersionChangesetCommand,\n 'changeset:publish': PublishChangesetCommand,\n 'changeset:status': StatusChangesetCommand,\n 'changeset:pre': PreChangesetCommand,\n 'changeset:tag': TagChangesetCommand,\n};\n"],"mappings":";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,UAAU;GACb,CAAC;EACL;CAED,OAAgB,WAAW;EACvB;GACI,aAAa;GACb,SAAS;GACZ;EACD;GACI,aAAa;GACb,SAAS;GACZ;EACD;GACI,aAAa;GACb,SAAS;GACZ;EACJ;CAED,MAAa,MAAqB;EAC9B,MAAM,EAAE,UAAU,MAAM,KAAK,MAAM,wBAAwB;EAE3D,MAAMC,OAAiB,CAAC,UAAU;AAClC,MAAI,MAAM,OAAQ,MAAK,KAAK,YAAY,MAAM,OAAO;AACrD,MAAI,MAAM,SAAU,MAAK,KAAK,cAAc,MAAM,SAAS;AAE3D,QAAM,KAAK,eAAe,KAAK;;;;;;ACzCvC,MAAa,WAAW;CACpB,kBAAkB;CAClB,iBAAiB;CACjB,qBAAqB;CACrB,qBAAqB;CACrB,oBAAoB;CACpB,iBAAiB;CACjB,iBAAiB;CACpB"}
1
+ {"version":3,"file":"index.mjs","names":["args: string[]","commandArgs: string[]","args: string[]","args: string[]","args: string[]"],"sources":["../src/changeset-command.ts","../src/add-changeset-command.ts","../src/init-changeset-command.ts","../src/pre-changeset-command.ts","../src/publish-changeset-command.ts","../src/status-changeset-command.ts","../src/tag-changeset-command.ts","../src/version-changeset-command.ts","../src/index.ts"],"sourcesContent":["import { createRequire } from 'node:module';\nimport path from 'node:path';\n\nimport { Command } from '@jpp-toolkit/core';\nimport { findProjectRoot } from '@jpp-toolkit/utils';\nimport { execa } from 'execa';\n\nconst require = createRequire(import.meta.url);\n\nconst CHANGESET_BIN = path.resolve(require.resolve('@changesets/cli/package.json'), '../bin.js');\n\nexport abstract class ChangesetCommand extends Command {\n protected async _execChangeset(args: string[] = []): Promise<void> {\n const cwd = findProjectRoot();\n const result = await execa(CHANGESET_BIN, args, { cwd, stdio: 'inherit', reject: false });\n\n if (result.failed) this.exit(1);\n }\n}\n","import { Flags } from '@oclif/core';\n\nimport { ChangesetCommand } from './changeset-command';\n\nexport class AddChangesetCommand extends ChangesetCommand {\n static override summary = 'Add a new changeset to the project.';\n\n static override description = `\nThis is the main command people use to interact with the changesets.\n\nThis command will ask you a series of questions, first about what packages you want to release,\nthen what semver bump type for each package, then it will ask for a summary of the entire changeset.\nThe final step will show the changeset it will generate and confirm that you want to add it.\n\nOnce confirmed, the changeset will be written a Markdown file that contains the summary and YAML\nfront matter which stores the packages that will be released and the semver bump types for them.\n`;\n\n static override flags = {\n empty: Flags.boolean({\n char: 'e',\n description: 'Create an empty changeset without prompts.',\n default: false,\n }),\n open: Flags.boolean({\n char: 'o',\n description: 'Open the changeset in the default editor after creating it.',\n default: false,\n }),\n };\n\n static override examples = [\n {\n description: 'Add a new changeset to the project.',\n command: '<%= config.bin %> <%= command.id %>',\n },\n {\n description: 'Add an empty changeset without any prompts.',\n command: '<%= config.bin %> <%= command.id %> --empty',\n },\n {\n description: 'Add a new changeset and open it in the default editor.',\n command: '<%= config.bin %> <%= command.id %> --open',\n },\n ];\n\n public async run(): Promise<void> {\n const { flags } = await this.parse(AddChangesetCommand);\n\n const args: string[] = ['add'];\n if (flags.empty) args.push('--empty');\n if (flags.open) args.push('--open');\n\n await this._execChangeset(args);\n }\n}\n","import { ChangesetCommand } from './changeset-command';\n\nexport class InitChangesetCommand extends ChangesetCommand {\n static override summary = 'Sets up the .changeset folder.';\n\n static override description = `\nThis command sets up the .changeset folder. It generates a readme and a config file.\nThe config file includes the default options and comments on what these options represent.\nYou should run this command once when you are setting up changesets.\n`;\n\n static override examples = [\n {\n description: 'Initialize changesets in your repository.',\n command: '<%= config.bin %> <%= command.id %>',\n },\n ];\n\n public async run(): Promise<void> {\n await this._execChangeset(['init']);\n }\n}\n","import { Args } from '@oclif/core';\n\nimport { ChangesetCommand } from './changeset-command';\n\nexport class PreChangesetCommand extends ChangesetCommand {\n static override summary = 'Enters and exits pre-release mode for packages.';\n\n static override description = `\nThe pre command enters and exits pre mode. The command does not do any actual versioning, when doing\na pre-release, you should run changeset pre enter next(or a different tag, the tag is what is in\nversions and is the npm dist tag) and then do the normal release process with changeset version and\nchangeset publish.\n`;\n\n static override args = {\n action: Args.string({\n name: 'action',\n required: true,\n description: 'The pre-release action to perform.',\n options: ['enter', 'exit'],\n }),\n tag: Args.string({\n name: 'tag',\n required: false,\n description: 'The pre-release tag to use when entering pre-release mode.',\n }),\n };\n\n static override examples = [\n {\n description: 'Enter pre-release mode with the \"next\" tag.',\n command: '<%= config.bin %> <%= command.id %> enter next',\n },\n {\n description: 'Exit pre-release mode.',\n command: '<%= config.bin %> <%= command.id %> exit',\n },\n ];\n\n public async run(): Promise<void> {\n const { args } = await this.parse(PreChangesetCommand);\n\n const commandArgs: string[] = ['pre', args.action];\n if (args.action === 'enter' && args.tag) commandArgs.push('--tag', args.tag);\n\n await this._execChangeset(commandArgs);\n }\n}\n","import { Flags } from '@oclif/core';\n\nimport { ChangesetCommand } from './changeset-command';\n\nexport class PublishChangesetCommand extends ChangesetCommand {\n static override summary = 'Publishes changes to npm, and creates git tags.';\n\n static override description = `\nThis publishes changes to npm, and creates git tags. This works by going into each package, checking\nif the version it has in its package.json is published on npm, and if it is not, running the npm\npublish. If you are using pnpm as a package manager, this automatically detects it and uses pnpm\npublish instead.\n`;\n\n static override flags = {\n 'otp': Flags.string({\n char: 'o',\n description: 'One-time password for publishing to npm.',\n required: false,\n }),\n 'tag': Flags.string({\n char: 't',\n description: 'Tag to publish the package under.',\n required: false,\n }),\n 'no-git-tag': Flags.boolean({\n description: 'Skip creating a git tag after publishing.',\n required: false,\n default: false,\n }),\n };\n\n static override examples = [\n {\n description: 'Publish packages to npm and create git tags.',\n command: '<%= config.bin %> <%= command.id %>',\n },\n {\n description: 'Publish packages with a one-time password.',\n command: '<%= config.bin %> <%= command.id %> --otp 123456',\n },\n {\n description: 'Publish packages under a specific tag.',\n command: '<%= config.bin %> <%= command.id %> --tag beta',\n },\n {\n description: 'Publish packages without creating git tags.',\n command: '<%= config.bin %> <%= command.id %> --no-git-tag',\n },\n ];\n\n public async run(): Promise<void> {\n const { flags } = await this.parse(PublishChangesetCommand);\n\n const args: string[] = ['publish'];\n if (flags.otp) args.push('--otp', flags.otp);\n if (flags.tag) args.push('--tag', flags.tag);\n if (flags['no-git-tag']) args.push('--no-git-tag');\n\n await this._execChangeset(args);\n }\n}\n","import { Flags } from '@oclif/core';\n\nimport { ChangesetCommand } from './changeset-command';\n\nexport class StatusChangesetCommand extends ChangesetCommand {\n static override summary = 'Provides information about the changesets that currently exist.';\n\n static override description = `\nThe status command provides information about the changesets that currently exist. If there are no\nchangesets present, it exits with an error status code.\n`;\n\n static override flags = {\n verbose: Flags.boolean({\n char: 'v',\n description:\n 'Use if you want to know the new versions, and get a link to the relevant changeset summary.',\n required: false,\n default: false,\n }),\n output: Flags.string({\n char: 'o',\n description:\n 'Allows you to write the JSON object of the status output for consumption by other tools, such as CI.',\n required: false,\n }),\n since: Flags.string({\n char: 's',\n description:\n 'Only display information about changesets since a specific branch or git tag (such as main, or the git hash of latest).',\n required: false,\n }),\n };\n\n static override examples = [\n {\n description: 'Get the status of changesets in the project.',\n command: '<%= config.bin %> <%= command.id %>',\n },\n {\n description:\n 'Get a verbose status of changesets, including new versions and links to summaries.',\n command: '<%= config.bin %> <%= command.id %> --verbose',\n },\n {\n description: 'Output the status of changesets as a JSON object.',\n command: '<%= config.bin %> <%= command.id %> --output status.json',\n },\n {\n description: 'Get the status of changesets since a specific branch or git tag.',\n command: '<%= config.bin %> <%= command.id %> --since main',\n },\n ];\n\n public async run(): Promise<void> {\n const { flags } = await this.parse(StatusChangesetCommand);\n\n const args: string[] = ['status'];\n if (flags.verbose) args.push('--verbose');\n if (flags.output) args.push('--output', flags.output);\n if (flags.since) args.push('--since', flags.since);\n\n await this._execChangeset(args);\n }\n}\n","import { ChangesetCommand } from './changeset-command';\n\nexport class TagChangesetCommand extends ChangesetCommand {\n static override summary = 'Creates git tags for the current version of all packages.';\n\n static override description = `\nThe tag command creates git tags for the current version of all packages. The tags created are\nequivalent to those created by changeset publish, but the tag command does not publish anything to\nnpm.\n\nThis is helpful in situations where a different tool, such as pnpm publish -r, is used to publish\npackages instead of changeset. For situations where changeset publish is executed, running changeset\ntag is not needed.\n\nThe git tags in monorepos are created in the format pkg-name@version-number and are based on the\ncurrent version number of the package.json for each package. Note that in single-package\nrepositories, the git tag will include v before the version number, for example, v1.0.0. It is\nexpected that changeset version is run before changeset tag, so the package.json versions are\nupdated before the git tags are created.\n`;\n\n public async run(): Promise<void> {\n await this._execChangeset(['tag']);\n }\n}\n","import { Flags } from '@oclif/core';\n\nimport { ChangesetCommand } from './changeset-command';\n\nexport class VersionChangesetCommand extends ChangesetCommand {\n static override summary =\n 'Takes changesets that have been made and updates versions and dependencies of packages, as well as writing changelogs.';\n\n static override description = `\nThis is one of two commands responsible for releasing packages. The version command takes changesets\nthat have been made and updates versions and dependencies of packages, as well as writing\nchangelogs. It is responsible for all file changes to versions before publishing to npm.\n`;\n\n static override flags = {\n ignore: Flags.string({\n char: 'i',\n description: 'Comma-separated list of packages to ignore when versioning.',\n required: false,\n }),\n snapshot: Flags.string({\n char: 's',\n description: 'Create snapshot versions with the given tag.',\n required: false,\n }),\n };\n\n static override examples = [\n {\n description: 'Version packages based on changesets.',\n command: '<%= config.bin %> <%= command.id %>',\n },\n {\n description: 'Version packages while ignoring specific packages.',\n command: '<%= config.bin %> <%= command.id %> --ignore package-a,package-b',\n },\n {\n description: 'Version packages with snapshot versions.',\n command: '<%= config.bin %> <%= command.id %> --snapshot beta',\n },\n ];\n\n public async run(): Promise<void> {\n const { flags } = await this.parse(VersionChangesetCommand);\n\n const args: string[] = ['version'];\n if (flags.ignore) args.push('--ignore', flags.ignore);\n if (flags.snapshot) args.push('--snapshot', flags.snapshot);\n\n await this._execChangeset(args);\n }\n}\n","import { AddChangesetCommand } from './add-changeset-command';\nimport { InitChangesetCommand } from './init-changeset-command';\nimport { PreChangesetCommand } from './pre-changeset-command';\nimport { PublishChangesetCommand } from './publish-changeset-command';\nimport { StatusChangesetCommand } from './status-changeset-command';\nimport { TagChangesetCommand } from './tag-changeset-command';\nimport { VersionChangesetCommand } from './version-changeset-command';\n\nexport const commands = {\n 'changeset:init': InitChangesetCommand,\n 'changeset:add': AddChangesetCommand,\n 'changeset:version': VersionChangesetCommand,\n 'changeset:publish': PublishChangesetCommand,\n 'changeset:status': StatusChangesetCommand,\n 'changeset:pre': PreChangesetCommand,\n 'changeset:tag': TagChangesetCommand,\n};\n"],"mappings":";;;;;;;;AAOA,MAAM,UAAU,cAAc,OAAO,KAAK,IAAI;AAE9C,MAAM,gBAAgB,KAAK,QAAQ,QAAQ,QAAQ,+BAA+B,EAAE,YAAY;AAEhG,IAAsB,mBAAtB,cAA+C,QAAQ;CACnD,MAAgB,eAAe,OAAiB,EAAE,EAAiB;AAI/D,OAFe,MAAM,MAAM,eAAe,MAAM;GAAE,KADtC,iBAAiB;GAC0B,OAAO;GAAW,QAAQ;GAAO,CAAC,EAE9E,OAAQ,MAAK,KAAK,EAAE;;;;;;ACZvC,IAAa,sBAAb,MAAa,4BAA4B,iBAAiB;CACtD,OAAgB,UAAU;CAE1B,OAAgB,cAAc;;;;;;;;;;CAW9B,OAAgB,QAAQ;EACpB,OAAO,MAAM,QAAQ;GACjB,MAAM;GACN,aAAa;GACb,SAAS;GACZ,CAAC;EACF,MAAM,MAAM,QAAQ;GAChB,MAAM;GACN,aAAa;GACb,SAAS;GACZ,CAAC;EACL;CAED,OAAgB,WAAW;EACvB;GACI,aAAa;GACb,SAAS;GACZ;EACD;GACI,aAAa;GACb,SAAS;GACZ;EACD;GACI,aAAa;GACb,SAAS;GACZ;EACJ;CAED,MAAa,MAAqB;EAC9B,MAAM,EAAE,UAAU,MAAM,KAAK,MAAM,oBAAoB;EAEvD,MAAMA,OAAiB,CAAC,MAAM;AAC9B,MAAI,MAAM,MAAO,MAAK,KAAK,UAAU;AACrC,MAAI,MAAM,KAAM,MAAK,KAAK,SAAS;AAEnC,QAAM,KAAK,eAAe,KAAK;;;;;;ACnDvC,IAAa,uBAAb,cAA0C,iBAAiB;CACvD,OAAgB,UAAU;CAE1B,OAAgB,cAA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Ab,MAAa,gCAAgC,iBAAiB;CAC1D,OAAgB,UACZ;CAEJ,OAAgB,cAAc;;;;;CAM9B,OAAgB,QAAQ;EACpB,QAAQ,MAAM,OAAO;GACjB,MAAM;GACN,aAAa;GACb,UAAU;GACb,CAAC;EACF,UAAU,MAAM,OAAO;GACnB,MAAM;GACN,aAAa;GACb,UAAU;GACb,CAAC;EACL;CAED,OAAgB,WAAW;EACvB;GACI,aAAa;GACb,SAAS;GACZ;EACD;GACI,aAAa;GACb,SAAS;GACZ;EACD;GACI,aAAa;GACb,SAAS;GACZ;EACJ;CAED,MAAa,MAAqB;EAC9B,MAAM,EAAE,UAAU,MAAM,KAAK,MAAM,wBAAwB;EAE3D,MAAMC,OAAiB,CAAC,UAAU;AAClC,MAAI,MAAM,OAAQ,MAAK,KAAK,YAAY,MAAM,OAAO;AACrD,MAAI,MAAM,SAAU,MAAK,KAAK,cAAc,MAAM,SAAS;AAE3D,QAAM,KAAK,eAAe,KAAK;;;;;;ACzCvC,MAAa,WAAW;CACpB,kBAAkB;CAClB,iBAAiB;CACjB,qBAAqB;CACrB,qBAAqB;CACrB,oBAAoB;CACpB,iBAAiB;CACjB,iBAAiB;CACpB"}
@@ -281,5 +281,5 @@
281
281
  "summary": "Creates git tags for the current version of all packages."
282
282
  }
283
283
  },
284
- "version": "0.0.14"
284
+ "version": "0.0.16"
285
285
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jpp-toolkit/plugin-changesets",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "description": "Plugin that add the changeset command to the jpp cli.",
5
5
  "keywords": [
6
6
  "jpp",
@@ -36,7 +36,7 @@
36
36
  "@changesets/cli": "2.29.8",
37
37
  "@oclif/core": "4.8.0",
38
38
  "execa": "9.6.1",
39
- "@jpp-toolkit/core": "0.0.14",
39
+ "@jpp-toolkit/core": "0.0.15",
40
40
  "@jpp-toolkit/utils": "0.0.14"
41
41
  },
42
42
  "devDependencies": {
@@ -14,6 +14,6 @@ export abstract class ChangesetCommand extends Command {
14
14
  const cwd = findProjectRoot();
15
15
  const result = await execa(CHANGESET_BIN, args, { cwd, stdio: 'inherit', reject: false });
16
16
 
17
- if (result.failed) process.exit(1);
17
+ if (result.failed) this.exit(1);
18
18
  }
19
19
  }