@salesforce/plugin-release-management 3.17.8 → 4.0.5

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.
Files changed (87) hide show
  1. package/lib/amazonS3.d.ts +3 -3
  2. package/lib/amazonS3.js +8 -7
  3. package/lib/amazonS3.js.map +1 -1
  4. package/lib/codeSigning/NpmName.d.ts +11 -47
  5. package/lib/codeSigning/NpmName.js +63 -116
  6. package/lib/codeSigning/NpmName.js.map +1 -1
  7. package/lib/codeSigning/packAndSign.js +1 -2
  8. package/lib/codeSigning/packAndSign.js.map +1 -1
  9. package/lib/commands/channel/promote.d.ts +5 -5
  10. package/lib/commands/channel/promote.js +17 -8
  11. package/lib/commands/channel/promote.js.map +1 -1
  12. package/lib/commands/cli/artifacts/compare.d.ts +5 -5
  13. package/lib/commands/cli/artifacts/compare.js +14 -19
  14. package/lib/commands/cli/artifacts/compare.js.map +1 -1
  15. package/lib/commands/cli/install/test.js +2 -9
  16. package/lib/commands/cli/install/test.js.map +1 -1
  17. package/lib/commands/cli/release/automerge.js +14 -11
  18. package/lib/commands/cli/release/automerge.js.map +1 -1
  19. package/lib/commands/cli/release/build.d.ts +6 -6
  20. package/lib/commands/cli/release/build.js +11 -17
  21. package/lib/commands/cli/release/build.js.map +1 -1
  22. package/lib/commands/cli/releasenotes.d.ts +1 -1
  23. package/lib/commands/cli/releasenotes.js +54 -52
  24. package/lib/commands/cli/releasenotes.js.map +1 -1
  25. package/lib/commands/cli/schemas/compare.d.ts +4 -1
  26. package/lib/commands/cli/schemas/compare.js +36 -9
  27. package/lib/commands/cli/schemas/compare.js.map +1 -1
  28. package/lib/commands/cli/tarballs/prepare.js +2 -2
  29. package/lib/commands/cli/tarballs/prepare.js.map +1 -1
  30. package/lib/commands/cli/tarballs/smoke.js +8 -2
  31. package/lib/commands/cli/tarballs/smoke.js.map +1 -1
  32. package/lib/commands/cli/tarballs/verify.js +2 -7
  33. package/lib/commands/cli/tarballs/verify.js.map +1 -1
  34. package/lib/commands/cli/versions/inspect.d.ts +3 -3
  35. package/lib/commands/cli/versions/inspect.js +7 -14
  36. package/lib/commands/cli/versions/inspect.js.map +1 -1
  37. package/lib/commands/dependabot/automerge.d.ts +2 -2
  38. package/lib/commands/dependabot/automerge.js +10 -13
  39. package/lib/commands/dependabot/automerge.js.map +1 -1
  40. package/lib/commands/github/check/closed.js +7 -5
  41. package/lib/commands/github/check/closed.js.map +1 -1
  42. package/lib/commands/npm/dependencies/pin.js +1 -1
  43. package/lib/commands/npm/dependencies/pin.js.map +1 -1
  44. package/lib/commands/npm/package/release.d.ts +2 -2
  45. package/lib/commands/npm/package/release.js +10 -33
  46. package/lib/commands/npm/package/release.js.map +1 -1
  47. package/lib/commands/repositories/index.js +1 -1
  48. package/lib/commands/repositories/index.js.map +1 -1
  49. package/lib/dependabot.d.ts +1 -4
  50. package/lib/dependabot.js +2 -15
  51. package/lib/dependabot.js.map +1 -1
  52. package/lib/dependencies.d.ts +9 -2
  53. package/lib/dependencies.js +8 -1
  54. package/lib/dependencies.js.map +1 -1
  55. package/lib/package.d.ts +13 -11
  56. package/lib/package.js +47 -42
  57. package/lib/package.js.map +1 -1
  58. package/lib/registry.d.ts +3 -4
  59. package/lib/registry.js +8 -9
  60. package/lib/registry.js.map +1 -1
  61. package/lib/repositories.js +1 -1
  62. package/lib/repositories.js.map +1 -1
  63. package/lib/repository.d.ts +4 -18
  64. package/lib/repository.js +13 -28
  65. package/lib/repository.js.map +1 -1
  66. package/lib/types.js +2 -2
  67. package/lib/types.js.map +1 -1
  68. package/oclif.manifest.json +1 -227
  69. package/package.json +24 -28
  70. package/lib/commands/cli/schemas/collect.d.ts +0 -13
  71. package/lib/commands/cli/schemas/collect.js +0 -93
  72. package/lib/commands/cli/schemas/collect.js.map +0 -1
  73. package/lib/commands/dependabot/consolidate.d.ts +0 -18
  74. package/lib/commands/dependabot/consolidate.js +0 -124
  75. package/lib/commands/dependabot/consolidate.js.map +0 -1
  76. package/lib/commands/npm/package/promote.d.ts +0 -12
  77. package/lib/commands/npm/package/promote.js +0 -69
  78. package/lib/commands/npm/package/promote.js.map +0 -1
  79. package/lib/commands/npm/release/validate.d.ts +0 -20
  80. package/lib/commands/npm/release/validate.js +0 -39
  81. package/lib/commands/npm/release/validate.js.map +0 -1
  82. package/lib/commands/typescript/update.d.ts +0 -21
  83. package/lib/commands/typescript/update.js +0 -132
  84. package/lib/commands/typescript/update.js.map +0 -1
  85. package/lib/inspectCommits.d.ts +0 -24
  86. package/lib/inspectCommits.js +0 -84
  87. package/lib/inspectCommits.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"consolidate.js","sourceRoot":"","sources":["../../../src/commands/dependabot/consolidate.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,yBAAyB;AACzB,2CAA4C;AAC5C,iEAAqF;AACrF,wCAAwC;AACxC,yCAAsC;AACtC,iCAA0C;AAC1C,qCAA+B;AAC/B,mDAAoD;AACpD,iDAAuG;AAEvG,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,uCAAuC,EAAE,wBAAwB,CAAC,CAAC;AAE1G,MAAqB,WAAY,SAAQ,2BAAe;IA0C/C,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAChD,MAAM,cAAc,GAAG,MAAM,IAAA,4BAAe,EAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QACtE,MAAM,UAAU,GAAG,IAAA,uBAAY,EAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;QACtD,MAAM,YAAY,GAAG,IAAA,uBAAY,EAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;QAC1D,MAAM,IAAI,GAAG,IAAA,uBAAY,EAAC,IAAI,SAAG,EAAE,CAAC,SA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KACvC,CAAC;IACF,MAAM,EAAE,uBAAK,CAAC,OAAO,CAAC;QACpB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC;QACtC,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,KAAK;KACf,CAAC;IACF,OAAO,EAAE,uBAAK,CAAC,OAAO,CAAC;QACrB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC;QACpC,OAAO,EAAE,KAAK;KACf,CAAC;IACF,KAAK,EAAE,uBAAK,CAAC,MAAM,CAAC;QAClB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC;QACrC,IAAI,EAAE,GAAG;KACV,CAAC;IACF,IAAI,EAAE,uBAAK,CAAC,MAAM,CAAC;QACjB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC;QACpC,IAAI,EAAE,GAAG;QACT,SAAS,EAAE,CAAC,OAAO,CAAC;KACrB,CAAC;CACH,CAAC"}
@@ -1,12 +0,0 @@
1
- import { SfCommand } from '@salesforce/sf-plugins-core';
2
- export default class Promote extends SfCommand<void> {
3
- static readonly summary: string;
4
- static readonly description: string;
5
- static readonly examples: string[];
6
- static readonly flags: {
7
- dryrun: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
- target: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
- candidate: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
10
- };
11
- run(): Promise<void>;
12
- }
@@ -1,69 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright (c) 2020, salesforce.com, inc.
4
- * All rights reserved.
5
- * Licensed under the BSD 3-Clause license.
6
- * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
10
- const core_1 = require("@salesforce/core");
11
- const kit_1 = require("@salesforce/kit");
12
- const ts_types_1 = require("@salesforce/ts-types");
13
- const shelljs_1 = require("shelljs");
14
- const chalk_1 = require("chalk");
15
- const repository_1 = require("../../../repository");
16
- core_1.Messages.importMessagesDirectory(__dirname);
17
- const messages = core_1.Messages.loadMessages('@salesforce/plugin-release-management', 'npm.package.promote');
18
- class Promote extends sf_plugins_core_1.SfCommand {
19
- async run() {
20
- const { flags } = await this.parse(Promote);
21
- const pkg = await repository_1.PackageRepo.create({ ux: new sf_plugins_core_1.Ux({ jsonEnabled: this.jsonEnabled() }) });
22
- await pkg.writeNpmToken();
23
- const token = (0, ts_types_1.ensureString)(new kit_1.Env().getString('NPM_TOKEN'), 'NPM_TOKEN must be set in the environment');
24
- const tokens = JSON.parse((0, shelljs_1.exec)('npm token list --json', { silent: true }).stdout);
25
- const publishTokens = tokens.filter((t) => t.readonly === false && t.automation === false);
26
- const match = publishTokens.find((t) => token.startsWith(t.token));
27
- if (!match) {
28
- const errType = 'InvalidToken';
29
- throw new core_1.SfError(messages.getMessage(errType), errType);
30
- }
31
- const tags = pkg.package.npmPackage['dist-tags'];
32
- const candidate = (0, ts_types_1.ensureString)(flags.candidate);
33
- const target = (0, ts_types_1.ensureString)(flags.target);
34
- if (!tags[candidate]) {
35
- const errType = 'InvalidTag';
36
- throw new core_1.SfError(messages.getMessage(errType, [candidate]), errType);
37
- }
38
- this.log(`Promoting ${pkg.name}@${tags[candidate]} from ${(0, chalk_1.bold)(candidate)} to ${(0, chalk_1.bold)(target)}`);
39
- if (target) {
40
- this.warn(`This will overwrite the existing ${target} version: ${tags[target]}`);
41
- this.log();
42
- }
43
- if (!flags.dryrun) {
44
- (0, shelljs_1.exec)(`npm dist-tag add ${pkg.name}@${tags[candidate]} ${target} --json`);
45
- }
46
- }
47
- }
48
- exports.default = Promote;
49
- Promote.summary = messages.getMessage('description');
50
- Promote.description = messages.getMessage('description');
51
- Promote.examples = messages.getMessages('examples');
52
- Promote.flags = {
53
- dryrun: sf_plugins_core_1.Flags.boolean({
54
- char: 'd',
55
- default: false,
56
- summary: messages.getMessage('dryrun'),
57
- }),
58
- target: sf_plugins_core_1.Flags.string({
59
- char: 't',
60
- default: 'latest',
61
- summary: messages.getMessage('target'),
62
- }),
63
- candidate: sf_plugins_core_1.Flags.string({
64
- char: 'c',
65
- summary: messages.getMessage('candidate'),
66
- required: true,
67
- }),
68
- };
69
- //# sourceMappingURL=promote.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"promote.js","sourceRoot":"","sources":["../../../../src/commands/npm/package/promote.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,iEAAmE;AACnE,2CAAqD;AACrD,yCAAsC;AACtC,mDAAoD;AACpD,qCAA+B;AAC/B,iCAA6B;AAC7B,oDAAkD;AAElD,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,uCAAuC,EAAE,qBAAqB,CAAC,CAAC;AASvG,MAAqB,OAAQ,SAAQ,2BAAe;IAuB3C,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC5C,MAAM,GAAG,GAAG,MAAM,wBAAW,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,oBAAE,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;QAC1F,MAAM,GAAG,CAAC,aAAa,EAAE,CAAC;QAE1B,MAAM,KAAK,GAAG,IAAA,uBAAY,EAAC,IAAI,SAAG,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,0CAA0C,CAAC,CAAC;QACzG,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,cAAI,EAAC,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,C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EAAE,CAAC;SACZ;QAED,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;YACjB,IAAA,cAAI,EAAC,oBAAoB,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,MAAM,SAAS,CAAC,CAAC;SAC1E;IACH,CAAC;;AAxDH,0BAyDC;AAxDwB,eAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAC7C,mBAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAEjD,gBAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AAC5C,aAAK,GAAG;IAC7B,MAAM,EAAE,uBAAK,CAAC,OAAO,CAAC;QACpB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC;KACvC,CAAC;IACF,MAAM,EAAE,uBAAK,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ;QACjB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC;KACvC,CAAC;IACF,SAAS,EAAE,uBAAK,CAAC,MAAM,CAAC;QACtB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC;QACzC,QAAQ,EAAE,IAAI;KACf,CAAC;CACH,CAAC"}
@@ -1,20 +0,0 @@
1
- import { SfCommand } from '@salesforce/sf-plugins-core';
2
- import { CommitInspection } from '../../../inspectCommits';
3
- type PackageCommits = CommitInspection & {
4
- name: string;
5
- currentVersion: string;
6
- };
7
- type Response = {
8
- shouldRelease: boolean;
9
- majorBump: boolean;
10
- packages?: PackageCommits[];
11
- };
12
- export default class Validate extends SfCommand<Response> {
13
- static readonly summary = "inspects the git commits to see if there are any commits that will warrant a new release";
14
- static readonly description = "inspects the git commits to see if there are any commits that will warrant a new release";
15
- static readonly flags: {
16
- verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
17
- };
18
- run(): Promise<Response>;
19
- }
20
- export {};
@@ -1,39 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright (c) 2020, salesforce.com, inc.
4
- * All rights reserved.
5
- * Licensed under the BSD 3-Clause license.
6
- * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
10
- const core_1 = require("@salesforce/core");
11
- const package_1 = require("../../../package");
12
- const inspectCommits_1 = require("../../../inspectCommits");
13
- class Validate extends sf_plugins_core_1.SfCommand {
14
- async run() {
15
- const { flags } = await this.parse(Validate);
16
- const packages = [await package_1.Package.create()];
17
- const responses = await Promise.all(packages.map(async (pkg) => ({
18
- ...(await (0, inspectCommits_1.inspectCommits)(pkg)),
19
- name: pkg.name,
20
- currentVersion: pkg.packageJson.version,
21
- })));
22
- const majorBump = responses.some((resp) => !!resp.isMajorBump);
23
- if (majorBump) {
24
- throw new core_1.SfError('Major version bump detected. You must manually update the version in the package.json to release a new major version.', 'MajorBumpDetected');
25
- }
26
- const shouldRelease = responses.some((resp) => !!resp.shouldRelease) && !majorBump;
27
- this.log(shouldRelease.toString());
28
- return flags.verbose ? { shouldRelease, majorBump, packages: responses } : { shouldRelease, majorBump };
29
- }
30
- }
31
- exports.default = Validate;
32
- Validate.summary = 'inspects the git commits to see if there are any commits that will warrant a new release';
33
- Validate.description = 'inspects the git commits to see if there are any commits that will warrant a new release';
34
- Validate.flags = {
35
- verbose: sf_plugins_core_1.Flags.boolean({
36
- summary: 'show all commits for all packages (only works with --json flag)',
37
- }),
38
- };
39
- //# sourceMappingURL=validate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../../src/commands/npm/release/validate.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,iEAA+D;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AA0F,CAAC;AAEtE,cAAK,GAAG;IAC7B,OAAO,EAAE,uBAAK,CAAC,OAAO,CAAC;QACrB,OAAO,EAAE,iEAAiE;KAC3E,CAAC;CACH,CAAC"}
@@ -1,21 +0,0 @@
1
- import { SfCommand } from '@salesforce/sf-plugins-core';
2
- import { Interfaces } from '@oclif/core';
3
- export default class Update extends SfCommand<void> {
4
- static readonly summary: string;
5
- static readonly description: string;
6
- static readonly flags: {
7
- version: Interfaces.OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
- target: Interfaces.OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
- };
10
- private typescriptPkg;
11
- private repo;
12
- private packages;
13
- private flags;
14
- run(): Promise<void>;
15
- private getPackages;
16
- private updateEsTargetConfig;
17
- private updateTsVersion;
18
- private determineNextTsVersion;
19
- private validateEsTarget;
20
- private validateTsVersion;
21
- }
@@ -1,132 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright (c) 2020, salesforce.com, inc.
4
- * All rights reserved.
5
- * Licensed under the BSD 3-Clause license.
6
- * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const path = require("path");
10
- const fs = require("fs/promises");
11
- const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
12
- const core_1 = require("@salesforce/core");
13
- const shelljs_1 = require("shelljs");
14
- const kit_1 = require("@salesforce/kit");
15
- const ts_types_1 = require("@salesforce/ts-types");
16
- const repository_1 = require("../../repository");
17
- core_1.Messages.importMessagesDirectory(__dirname);
18
- const messages = core_1.Messages.load('@salesforce/plugin-release-management', 'typescript.update', [
19
- 'description',
20
- 'typescriptVersion',
21
- 'esTarget',
22
- 'InvalidTargetVersion',
23
- 'InvalidTypescriptVersion',
24
- ]);
25
- class Update extends sf_plugins_core_1.SfCommand {
26
- async run() {
27
- const { flags } = await this.parse(Update);
28
- this.flags = flags;
29
- this.typescriptPkg = retrieveTsPackage();
30
- this.validateEsTarget();
31
- this.validateTsVersion();
32
- this.repo = await repository_1.PackageRepo.create({ ux: new sf_plugins_core_1.Ux({ jsonEnabled: this.jsonEnabled() }) });
33
- this.packages = this.getPackages();
34
- this.warn('This is for testing new versions only. To update the version you must go through dev-scripts.');
35
- this.updateTsVersion();
36
- for (const pkg of this.packages) {
37
- // this.packages is singular in a non-lerna world
38
- // eslint-disable-next-line no-await-in-loop
39
- await this.updateEsTargetConfig(pkg.location);
40
- }
41
- try {
42
- this.repo.install();
43
- this.repo.build();
44
- this.repo.test();
45
- }
46
- finally {
47
- this.log('Reverting unstaged stages');
48
- this.repo.revertUnstagedChanges();
49
- }
50
- }
51
- getPackages() {
52
- return [this.repo.package];
53
- }
54
- async updateEsTargetConfig(packagePath) {
55
- const tsConfigPath = path.join(packagePath, 'tsconfig.json');
56
- const tsConfigString = await fs.readFile(tsConfigPath, 'utf-8');
57
- // strip out any comments that might be in the tsconfig.json
58
- const commentRegex = new RegExp(/(\/\/.*)/, 'gi');
59
- const tsConfig = JSON.parse(tsConfigString.replace(commentRegex, ''));
60
- (0, kit_1.set)((0, ts_types_1.asObject)(tsConfig), 'compilerOptions.target', this.flags.target);
61
- this.log(`Updating tsconfig target at ${tsConfigPath} to:`, this.flags.target);
62
- const fileData = JSON.stringify(tsConfig, null, 2);
63
- await fs.writeFile(tsConfigPath, fileData, {
64
- encoding: 'utf8',
65
- mode: '600',
66
- });
67
- }
68
- updateTsVersion() {
69
- const newVersion = this.determineNextTsVersion();
70
- for (const pkg of this.packages) {
71
- if (pkg.packageJson.devDependencies['typescript']) {
72
- this.warn(`Updating typescript version to ${newVersion} in path ${pkg.location}`);
73
- pkg.packageJson.devDependencies['typescript'] = newVersion;
74
- pkg.packageJson.devDependencies['@typescript-eslint/eslint-plugin'] = 'latest';
75
- pkg.packageJson.devDependencies['@typescript-eslint/parser'] = 'latest';
76
- }
77
- // If the prepare script runs sf-install, the install will fail because the typescript version
78
- // won't match the expected version. So in that case, we delete the prepare script so that we
79
- // get a successful install
80
- if (pkg.packageJson.scripts['prepare'] === 'sf-install') {
81
- delete pkg.packageJson.scripts['prepare'];
82
- }
83
- pkg.writePackageJson(pkg.location);
84
- }
85
- }
86
- determineNextTsVersion() {
87
- return this.flags.version === 'latest' || !this.flags.version
88
- ? (0, ts_types_1.getString)(this.typescriptPkg, 'dist-tags.latest')
89
- : this.flags.version;
90
- }
91
- validateEsTarget() {
92
- if (this.flags.target === 'ESNext')
93
- return true;
94
- if (/ES[0-9]{4}/g.test(this.flags.target))
95
- return true;
96
- throw new core_1.SfError(messages.getMessage('InvalidTargetVersion', [this.flags.target]), 'InvalidTargetVersion');
97
- }
98
- validateTsVersion() {
99
- const version = this.flags.version;
100
- if (version === 'latest')
101
- return true;
102
- if (version && !this.typescriptPkg.versions.includes(version)) {
103
- throw new core_1.SfError(messages.getMessage('InvalidTypescriptVersion', [version]), 'InvalidTypescriptVersion');
104
- }
105
- return true;
106
- }
107
- }
108
- exports.default = Update;
109
- Update.summary = messages.getMessage('description');
110
- Update.description = messages.getMessage('description');
111
- Update.flags = {
112
- version: sf_plugins_core_1.Flags.string({
113
- char: 'v',
114
- summary: messages.getMessage('typescriptVersion'),
115
- default: 'latest',
116
- }),
117
- target: sf_plugins_core_1.Flags.string({
118
- char: 't',
119
- summary: messages.getMessage('esTarget'),
120
- default: 'ESNext',
121
- }),
122
- };
123
- const retrieveTsPackage = () => {
124
- const result = (0, shelljs_1.exec)('npm view typescript --json', { silent: true });
125
- if (result.code === 0) {
126
- return JSON.parse(result.stdout);
127
- }
128
- else {
129
- throw new core_1.SfError('Could not find typescript on the npm registry', 'TypescriptNotFound');
130
- }
131
- };
132
- //# sourceMappingURL=update.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/typescript/update.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,6BAA6B;AAC7B,kCAAkC;AAClC,iEAAmE;AACnE,2C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KAC1F;AACH,CAAC,CAAC"}
@@ -1,24 +0,0 @@
1
- import { Nullable } from '@salesforce/ts-types';
2
- import { Package } from './package';
3
- interface Commit {
4
- type: Nullable<string>;
5
- header: Nullable<string>;
6
- body: Nullable<string>;
7
- }
8
- export interface CommitInspection {
9
- releasableCommits: Commit[];
10
- unreleasableCommits: Commit[];
11
- nextVersionIsHardcoded: boolean;
12
- shouldRelease: boolean;
13
- isMajorBump?: boolean;
14
- }
15
- /**
16
- * If the commit type isn't fix (patch bump), feat (minor bump), or breaking (major bump),
17
- * then standard-version always defaults to a patch bump.
18
- * See https://github.com/conventional-changelog/standard-version/issues/577
19
- *
20
- * We, however, don't want to publish a new version for chore, docs, etc. So we analyze
21
- * the commits to see if any of them indicate that a new release should be published.
22
- */
23
- export declare function inspectCommits(pkg: Package): Promise<CommitInspection>;
24
- export {};
@@ -1,84 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright (c) 2020, salesforce.com, inc.
4
- * All rights reserved.
5
- * Licensed under the BSD 3-Clause license.
6
- * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.inspectCommits = void 0;
10
- const os = require("os");
11
- const stream_1 = require("stream");
12
- const shelljs_1 = require("shelljs");
13
- const conventionalCommitsParser = require("conventional-commits-parser");
14
- const conventionalChangelogPresetLoader = require("conventional-changelog-preset-loader");
15
- /**
16
- * If the commit type isn't fix (patch bump), feat (minor bump), or breaking (major bump),
17
- * then standard-version always defaults to a patch bump.
18
- * See https://github.com/conventional-changelog/standard-version/issues/577
19
- *
20
- * We, however, don't want to publish a new version for chore, docs, etc. So we analyze
21
- * the commits to see if any of them indicate that a new release should be published.
22
- */
23
- async function inspectCommits(pkg) {
24
- const skippableCommitTypes = ['chore', 'style', 'docs', 'ci', 'test'];
25
- // find the latest git tag so that we can get all the commits that have happened since
26
- const tags = (0, shelljs_1.exec)('git fetch --tags && git tag', { silent: true }).stdout.split(os.EOL);
27
- const latestTag = tags.find((tag) => tag.includes(pkg.npmPackage.version));
28
- // import the default commit parser configuration
29
- const defaultConfigPath = require.resolve('conventional-changelog-conventionalcommits');
30
- const configuration = await conventionalChangelogPresetLoader({ name: defaultConfigPath });
31
- const commits = await new Promise((resolve) => {
32
- const DELIMITER = 'SPLIT';
33
- const gitLogCommand = `git log --format=%B%n-hash-%n%H%n${DELIMITER} ${latestTag}..HEAD --no-merges`;
34
- const gitLog = (0, shelljs_1.exec)(gitLogCommand, { silent: true })
35
- .stdout.split(`${DELIMITER}${os.EOL}`)
36
- .filter((c) => !!c);
37
- const readable = stream_1.Readable.from(gitLog);
38
- /* eslint-disable */
39
- // @ts-ignore because the type exported from conventionalCommitsParser is wrong
40
- const parser = readable.pipe(conventionalCommitsParser(configuration.parserOpts));
41
- /* eslint-enable */
42
- const allCommits = [];
43
- parser.on('data', (commit) => allCommits.push(commit));
44
- parser.on('finish', () => resolve(allCommits));
45
- });
46
- const nextVersionIsHardcoded = pkg.nextVersionIsHardcoded();
47
- // All commits are releasable if the version hardcoded in the package.json
48
- // In this scenario, we want to publish regardless of the commit types
49
- if (nextVersionIsHardcoded) {
50
- return {
51
- releasableCommits: commits,
52
- unreleasableCommits: [],
53
- nextVersionIsHardcoded,
54
- shouldRelease: true,
55
- };
56
- }
57
- const releasableCommits = [];
58
- const unreleasableCommits = [];
59
- let majorBumpRequired = false;
60
- for (const commit of commits) {
61
- const headerIndicatesMajorChange = !!commit.header && commit.header.includes('!');
62
- const bodyIndicatesMajorChange = !!commit.body && commit.body.includes('BREAKING');
63
- const typeIsSkippable = skippableCommitTypes.includes(commit.type);
64
- const isBreakingChange = bodyIndicatesMajorChange || headerIndicatesMajorChange;
65
- const isReleasable = !typeIsSkippable || isBreakingChange;
66
- if (isReleasable) {
67
- releasableCommits.push(commit);
68
- }
69
- else {
70
- unreleasableCommits.push(commit);
71
- }
72
- if (isBreakingChange)
73
- majorBumpRequired = true;
74
- }
75
- return {
76
- releasableCommits,
77
- unreleasableCommits,
78
- nextVersionIsHardcoded,
79
- isMajorBump: majorBumpRequired,
80
- shouldRelease: nextVersionIsHardcoded || releasableCommits.length > 0,
81
- };
82
- }
83
- exports.inspectCommits = inspectCommits;
84
- //# sourceMappingURL=inspectCommits.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inspectCommits.js","sourceRoot":"","sources":["../src/inspectCommits.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,yBAAyB;AACzB,mCAAkC;AAClC,qCAA+B;AAC/B,yEAAyE;AACzE,0FAA0F;AAkB1F;;;;;;;GAOG;AACI,KAAK,UAAU,cAAc,CAAC,GAAY;IAC/C,MAAM,oBAAoB,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAEtE,sFAAsF;IACtF,MAAM,IAAI,GAAG,IAAA,cAAI,EAAC,6BAA6B,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACxF,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3E,iDAAiD;IACjD,MAAM,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,4CAA4C,CAAC,CAAC;IACxF,MAAM,aAAa,GAAG,MAAM,iCAAiC,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAE3F,MAAM,OAAO,GAAa,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QACtD,MAAM,SAAS,GAAG,OAAO,CAAC;QAC1B,MAAM,aAAa,GAAG,oCAAoC,SAAS,IAAI,SAAS,oBAAoB,CAAC;QACrG,MAAM,MAAM,GAAG,IAAA,cAAI,EAAC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