@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
package/lib/types.js CHANGED
@@ -11,7 +11,7 @@ var CLI;
11
11
  (function (CLI) {
12
12
  CLI["SF"] = "sf";
13
13
  CLI["SFDX"] = "sfdx";
14
- })(CLI = exports.CLI || (exports.CLI = {}));
14
+ })(CLI || (exports.CLI = CLI = {}));
15
15
  var Channel;
16
16
  (function (Channel) {
17
17
  Channel["LEGACY"] = "legacy";
@@ -19,5 +19,5 @@ var Channel;
19
19
  Channel["STABLE_RC"] = "stable-rc";
20
20
  Channel["LATEST"] = "latest";
21
21
  Channel["LATEST_RC"] = "latest-rc";
22
- })(Channel = exports.Channel || (exports.Channel = {}));
22
+ })(Channel || (exports.Channel = Channel = {}));
23
23
  //# sourceMappingURL=types.js.map
package/lib/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,IAAY,GAGX;AAHD,WAAY,GAAG;IACb,gBAAS,CAAA;IACT,oBAAa,CAAA;AACf,CAAC,EAHW,GAAG,GAAH,WAAG,KAAH,WAAG,QAGd;AAED,IAAY,OAMX;AAND,WAAY,OAAO;IACjB,4BAAiB,CAAA;IACjB,4BAAiB,CAAA;IACjB,kCAAuB,CAAA;IACvB,4BAAiB,CAAA;IACjB,kCAAuB,CAAA;AACzB,CAAC,EANW,OAAO,GAAP,eAAO,KAAP,eAAO,QAMlB"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,IAAY,GAGX;AAHD,WAAY,GAAG;IACb,gBAAS,CAAA;IACT,oBAAa,CAAA;AACf,CAAC,EAHW,GAAG,mBAAH,GAAG,QAGd;AAED,IAAY,OAMX;AAND,WAAY,OAAO;IACjB,4BAAiB,CAAA;IACjB,4BAAiB,CAAA;IACjB,kCAAuB,CAAA;IACvB,4BAAiB,CAAA;IACjB,kCAAuB,CAAA;AACzB,CAAC,EANW,OAAO,uBAAP,OAAO,QAMlB"}
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.17.8",
2
+ "version": "4.0.5",
3
3
  "commands": {
4
4
  "channel:promote": {
5
5
  "id": "channel:promote",
@@ -274,100 +274,6 @@
274
274
  },
275
275
  "args": {}
276
276
  },
277
- "dependabot:consolidate": {
278
- "id": "dependabot:consolidate",
279
- "summary": "consolidate dependabot PRs into a single PR",
280
- "description": "consolidate dependabot PRs into a single PR",
281
- "strict": true,
282
- "pluginName": "@salesforce/plugin-release-management",
283
- "pluginAlias": "@salesforce/plugin-release-management",
284
- "pluginType": "core",
285
- "aliases": [],
286
- "examples": [
287
- "<%= config.bin %> <%= command.id %> --max-version-bump patch",
288
- "<%= config.bin %> <%= command.id %> --max-version-bump minor",
289
- "<%= config.bin %> <%= command.id %> --max-version-bump major"
290
- ],
291
- "flags": {
292
- "json": {
293
- "name": "json",
294
- "type": "boolean",
295
- "description": "Format output as json.",
296
- "helpGroup": "GLOBAL",
297
- "allowNo": false
298
- },
299
- "max-version-bump": {
300
- "name": "max-version-bump",
301
- "type": "option",
302
- "char": "m",
303
- "description": "the maximum version bump you want to be included",
304
- "required": true,
305
- "multiple": false,
306
- "options": [
307
- "major",
308
- "minor",
309
- "patch"
310
- ],
311
- "default": "minor"
312
- },
313
- "base-branch": {
314
- "name": "base-branch",
315
- "type": "option",
316
- "char": "b",
317
- "summary": "name of the base branch for merging",
318
- "required": true,
319
- "multiple": false,
320
- "default": "main"
321
- },
322
- "target-branch": {
323
- "name": "target-branch",
324
- "type": "option",
325
- "char": "t",
326
- "summary": "name of the target branch for merging",
327
- "required": true,
328
- "multiple": false,
329
- "default": "consolidate-dependabot"
330
- },
331
- "ignore": {
332
- "name": "ignore",
333
- "type": "option",
334
- "summary": "ignore any PRs with titles that include this value",
335
- "multiple": true,
336
- "delimiter": ","
337
- },
338
- "dryrun": {
339
- "name": "dryrun",
340
- "type": "boolean",
341
- "char": "d",
342
- "summary": "only show what would happen if you consolidated dependabot PRs",
343
- "allowNo": false
344
- },
345
- "no-pr": {
346
- "name": "no-pr",
347
- "type": "boolean",
348
- "summary": "do everything but create the PR",
349
- "allowNo": false
350
- },
351
- "owner": {
352
- "name": "owner",
353
- "type": "option",
354
- "char": "o",
355
- "summary": "the organization that the repository belongs to. This defaults to the owner specified in the package.json",
356
- "multiple": false
357
- },
358
- "repo": {
359
- "name": "repo",
360
- "type": "option",
361
- "char": "r",
362
- "summary": "the repository you want to consolidate PRs on. This defaults to the repository specified in the package.json",
363
- "multiple": false,
364
- "dependsOn": [
365
- "owner"
366
- ]
367
- }
368
- },
369
- "args": {}
370
- },
371
277
  "repositories": {
372
278
  "id": "repositories",
373
279
  "summary": "list repositories owned and supported by Salesforce CLI\nFor more information on the list of repositories, visit https://github.com/salesforcecli/status.",
@@ -465,42 +371,6 @@
465
371
  },
466
372
  "args": {}
467
373
  },
468
- "typescript:update": {
469
- "id": "typescript:update",
470
- "summary": "Runs tests with updated typescript version and ES target",
471
- "description": "Runs tests with updated typescript version and ES target",
472
- "strict": true,
473
- "pluginName": "@salesforce/plugin-release-management",
474
- "pluginAlias": "@salesforce/plugin-release-management",
475
- "pluginType": "core",
476
- "aliases": [],
477
- "flags": {
478
- "json": {
479
- "name": "json",
480
- "type": "boolean",
481
- "description": "Format output as json.",
482
- "helpGroup": "GLOBAL",
483
- "allowNo": false
484
- },
485
- "version": {
486
- "name": "version",
487
- "type": "option",
488
- "char": "v",
489
- "summary": "Specify the typescript version you'd like to update to. Defaults to latest if not specified",
490
- "multiple": false,
491
- "default": "latest"
492
- },
493
- "target": {
494
- "name": "target",
495
- "type": "option",
496
- "char": "t",
497
- "summary": "Specify the ES target you'd like to use. Defaults to ESNext if not specified",
498
- "multiple": false,
499
- "default": "ESNext"
500
- }
501
- },
502
- "args": {}
503
- },
504
374
  "cli:artifacts:compare": {
505
375
  "id": "cli:artifacts:compare",
506
376
  "summary": "Look for breaking changes in artifacts (schemas and snapshots) from plugins. Must be run in CLI directory.",
@@ -796,30 +666,6 @@
796
666
  },
797
667
  "args": {}
798
668
  },
799
- "cli:schemas:collect": {
800
- "id": "cli:schemas:collect",
801
- "summary": "collect schemas from installed plugins",
802
- "description": "collect schemas from installed plugins",
803
- "strict": true,
804
- "pluginName": "@salesforce/plugin-release-management",
805
- "pluginAlias": "@salesforce/plugin-release-management",
806
- "pluginType": "core",
807
- "state": "deprecated",
808
- "aliases": [],
809
- "examples": [
810
- "<%= config.bin %> <%= command.id %>"
811
- ],
812
- "flags": {
813
- "json": {
814
- "name": "json",
815
- "type": "boolean",
816
- "description": "Format output as json.",
817
- "helpGroup": "GLOBAL",
818
- "allowNo": false
819
- }
820
- },
821
- "args": {}
822
- },
823
669
  "cli:schemas:compare": {
824
670
  "id": "cli:schemas:compare",
825
671
  "summary": "compare schemas from installed plugins",
@@ -1134,52 +980,6 @@
1134
980
  },
1135
981
  "args": {}
1136
982
  },
1137
- "npm:package:promote": {
1138
- "id": "npm:package:promote",
1139
- "summary": "promote an npm package",
1140
- "description": "promote an npm package",
1141
- "strict": true,
1142
- "pluginName": "@salesforce/plugin-release-management",
1143
- "pluginAlias": "@salesforce/plugin-release-management",
1144
- "pluginType": "core",
1145
- "aliases": [],
1146
- "examples": [
1147
- "<%= config.bin %> <%= command.id %> --candidate latest-rc --target latest"
1148
- ],
1149
- "flags": {
1150
- "json": {
1151
- "name": "json",
1152
- "type": "boolean",
1153
- "description": "Format output as json.",
1154
- "helpGroup": "GLOBAL",
1155
- "allowNo": false
1156
- },
1157
- "dryrun": {
1158
- "name": "dryrun",
1159
- "type": "boolean",
1160
- "char": "d",
1161
- "summary": "If true, only show what would happen",
1162
- "allowNo": false
1163
- },
1164
- "target": {
1165
- "name": "target",
1166
- "type": "option",
1167
- "char": "t",
1168
- "summary": "the npm tag that you are promoting to",
1169
- "multiple": false,
1170
- "default": "latest"
1171
- },
1172
- "candidate": {
1173
- "name": "candidate",
1174
- "type": "option",
1175
- "char": "c",
1176
- "summary": "the npm tag that you want to promote",
1177
- "required": true,
1178
- "multiple": false
1179
- }
1180
- },
1181
- "args": {}
1182
- },
1183
983
  "npm:package:release": {
1184
984
  "id": "npm:package:release",
1185
985
  "summary": "publish npm package",
@@ -1253,32 +1053,6 @@
1253
1053
  }
1254
1054
  },
1255
1055
  "args": {}
1256
- },
1257
- "npm:release:validate": {
1258
- "id": "npm:release:validate",
1259
- "summary": "inspects the git commits to see if there are any commits that will warrant a new release",
1260
- "description": "inspects the git commits to see if there are any commits that will warrant a new release",
1261
- "strict": true,
1262
- "pluginName": "@salesforce/plugin-release-management",
1263
- "pluginAlias": "@salesforce/plugin-release-management",
1264
- "pluginType": "core",
1265
- "aliases": [],
1266
- "flags": {
1267
- "json": {
1268
- "name": "json",
1269
- "type": "boolean",
1270
- "description": "Format output as json.",
1271
- "helpGroup": "GLOBAL",
1272
- "allowNo": false
1273
- },
1274
- "verbose": {
1275
- "name": "verbose",
1276
- "type": "boolean",
1277
- "summary": "show all commits for all packages (only works with --json flag)",
1278
- "allowNo": false
1279
- }
1280
- },
1281
- "args": {}
1282
1056
  }
1283
1057
  }
1284
1058
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@salesforce/plugin-release-management",
3
3
  "description": "A plugin for preparing and publishing npm packages",
4
- "version": "3.17.8",
4
+ "version": "4.0.5",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/forcedotcom/cli/issues",
7
7
  "bin": {
@@ -11,19 +11,16 @@
11
11
  "@oclif/core": "^2.8.2",
12
12
  "@octokit/core": "^4.2.1",
13
13
  "@octokit/plugin-paginate-rest": "^6.1.2",
14
- "@octokit/plugin-throttling": "^5.1.1",
15
- "@salesforce/core": "^3.36.2",
16
- "@salesforce/kit": "^1.9.2",
17
- "@salesforce/plugin-command-reference": "^2.4.1",
14
+ "@octokit/plugin-throttling": "^5.2.3",
15
+ "@salesforce/cli-plugins-testkit": "^4.0.1",
16
+ "@salesforce/core": "^4.0.1",
17
+ "@salesforce/kit": "^3.0.2",
18
+ "@salesforce/plugin-command-reference": "^3.0.2",
18
19
  "@salesforce/plugin-trust": "^2.4.2",
19
- "@salesforce/sf-plugins-core": "^2.4.3",
20
- "@salesforce/ts-types": "^1.7.3",
21
- "agent-base": "^6.0.2",
22
- "aws-sdk": "^2.1377.0",
20
+ "@salesforce/sf-plugins-core": "^3.0.2",
21
+ "@salesforce/ts-types": "^2.0.2",
22
+ "aws-sdk": "^2.1390.0",
23
23
  "chalk": "^4.1.0",
24
- "conventional-changelog-conventionalcommits": "^4.6.1",
25
- "conventional-changelog-preset-loader": "^2.3.4",
26
- "conventional-commits-parser": "^3.2.2",
27
24
  "fast-glob": "^3.2.12",
28
25
  "got": "^11.8.6",
29
26
  "just-diff": "^5.2.0",
@@ -36,44 +33,43 @@
36
33
  "yarn-deduplicate": "^3.1.0"
37
34
  },
38
35
  "devDependencies": {
39
- "@oclif/plugin-command-snapshot": "^3.3.10",
40
- "@salesforce/dev-config": "^3.0.0",
41
- "@salesforce/dev-scripts": "^4.3.1",
42
- "@salesforce/prettier-config": "^0.0.2",
36
+ "@oclif/plugin-command-snapshot": "^4.0.2",
37
+ "@salesforce/dev-config": "^4.0.1",
38
+ "@salesforce/dev-scripts": "^5.4.2",
39
+ "@salesforce/prettier-config": "^0.0.3",
43
40
  "@salesforce/ts-sinon": "1.4.6",
44
41
  "@swc/core": "^1.3.37",
45
- "@types/conventional-changelog-preset-loader": "^2.3.2",
46
- "@types/conventional-commits-parser": "^3.0.3",
42
+ "@types/proxy-from-env": "^1.0.1",
47
43
  "@types/semver": "^7.5.0",
48
44
  "@types/shelljs": "^0.8.8",
49
45
  "@typescript-eslint/eslint-plugin": "^5.40.1",
50
46
  "@typescript-eslint/parser": "^5.54.1",
51
47
  "aws-sdk-mock": "^5.8.0",
52
48
  "chai": "^4.3.7",
53
- "eslint": "^8.39.0",
49
+ "eslint": "^8.41.0",
54
50
  "eslint-config-prettier": "^8.8.0",
55
- "eslint-config-salesforce": "^1.2.0",
51
+ "eslint-config-salesforce": "^2.0.1",
56
52
  "eslint-config-salesforce-license": "^0.2.0",
57
53
  "eslint-config-salesforce-typescript": "^1.1.1",
58
- "eslint-plugin-header": "^3.0.0",
54
+ "eslint-plugin-header": "^3.1.1",
59
55
  "eslint-plugin-import": "2.27.5",
60
- "eslint-plugin-jsdoc": "^39.9.1",
61
- "eslint-plugin-sf-plugin": "^1.8.1",
56
+ "eslint-plugin-jsdoc": "^44.2.4",
57
+ "eslint-plugin-sf-plugin": "^1.15.6",
62
58
  "husky": "^7.0.4",
63
59
  "mocha": "^9.1.3",
64
60
  "nyc": "^15.1.0",
65
- "oclif": "^3.7.0",
61
+ "oclif": "^3.9.0",
66
62
  "prettier": "^2.8.8",
67
63
  "pretty-quick": "^3.1.0",
68
64
  "shx": "0.3.4",
69
65
  "sinon": "10.0.0",
70
66
  "ts-node": "^10.0.0",
71
- "typescript": "^4.9.4",
67
+ "typescript": "^5.1.3",
72
68
  "wireit": "^0.9.5"
73
69
  },
74
70
  "config": {},
75
71
  "engines": {
76
- "node": ">=14.0.0"
72
+ "node": ">=16.0.0"
77
73
  },
78
74
  "files": [
79
75
  "bin",
@@ -290,7 +286,7 @@
290
286
  }
291
287
  },
292
288
  "sfdx": {
293
- "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-release-management/3.17.8.crt",
294
- "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-release-management/3.17.8.sig"
289
+ "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-release-management/4.0.5.crt",
290
+ "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-release-management/4.0.5.sig"
295
291
  }
296
292
  }
@@ -1,13 +0,0 @@
1
- import { SfCommand } from '@salesforce/sf-plugins-core';
2
- import { JsonMap } from '@salesforce/ts-types';
3
- export declare const getLatestSchemaFiles: () => Promise<string[]>;
4
- export declare const getExistingSchemaFiles: () => Promise<string[]>;
5
- export declare const deepEqual: (a: JsonMap, b: JsonMap) => boolean;
6
- export default class Collect extends SfCommand<void> {
7
- static readonly summary: string;
8
- static readonly description: string;
9
- static readonly examples: string[];
10
- static readonly flags: {};
11
- static readonly state = "deprecated";
12
- run(): Promise<void>;
13
- }
@@ -1,93 +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.deepEqual = exports.getExistingSchemaFiles = exports.getLatestSchemaFiles = void 0;
10
- const path = require("path");
11
- const fs = require("fs/promises");
12
- const assert = require("assert");
13
- const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
14
- const core_1 = require("@salesforce/core");
15
- const shelljs_1 = require("shelljs");
16
- const fg = require("fast-glob");
17
- const kit_1 = require("@salesforce/kit");
18
- core_1.Messages.importMessagesDirectory(__dirname);
19
- const messages = core_1.Messages.load('@salesforce/plugin-release-management', 'cli.schemas.collect', [
20
- 'description',
21
- 'examples',
22
- ]);
23
- const getLatestSchemaFiles = async () => {
24
- const fileData = await fs.readFile(path.join(process.cwd(), 'package.json'), 'utf-8');
25
- const pjson = (0, kit_1.parseJsonMap)(fileData, path.join(process.cwd(), 'package.json'));
26
- const globs = (pjson.oclif?.plugins || []).map((plugin) => {
27
- const normalized = plugin.replace(/\\/g, '/');
28
- return `node_modules/${normalized}/schemas/**/*.json`; // We need to use / for path sep since fg only works with Unix paths
29
- });
30
- const schemaFiles = (await fg(globs))
31
- .map((f) => path.normalize(f)) // normalize paths so this will work on Windows since fg only returns Unix paths
32
- .filter((f) => !f.includes(path.join('@salesforce', 'schemas')));
33
- return schemaFiles;
34
- };
35
- exports.getLatestSchemaFiles = getLatestSchemaFiles;
36
- const getExistingSchemaFiles = async () => {
37
- const globs = ['schemas/**/*.json'];
38
- const schemaFiles = await fg(globs);
39
- return schemaFiles;
40
- };
41
- exports.getExistingSchemaFiles = getExistingSchemaFiles;
42
- const deepEqual = (a, b) => {
43
- try {
44
- assert.deepEqual(a, b);
45
- return true;
46
- }
47
- catch {
48
- return false;
49
- }
50
- };
51
- exports.deepEqual = deepEqual;
52
- class Collect extends sf_plugins_core_1.SfCommand {
53
- // eslint-disable-next-line class-methods-use-this
54
- async run() {
55
- const schemaFiles = await (0, exports.getLatestSchemaFiles)();
56
- const schemaFilesByPlugin = new Map();
57
- for (const file of schemaFiles) {
58
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
59
- const [_, namespace, pluginName] = file.split(path.sep);
60
- const plugin = path.join(namespace, pluginName);
61
- if (schemaFilesByPlugin.has(plugin)) {
62
- const existing = schemaFilesByPlugin.get(plugin);
63
- schemaFilesByPlugin.set(plugin, [...existing, file]);
64
- }
65
- else {
66
- schemaFilesByPlugin.set(plugin, [file]);
67
- }
68
- }
69
- const outputDir = path.join(process.cwd(), 'schemas');
70
- await fs.mkdir(outputDir, { recursive: true });
71
- await Promise.all(Array.from(schemaFilesByPlugin.entries()).map(async ([plugin, files]) => {
72
- const pluginOutputDir = path.join(outputDir, plugin);
73
- await fs.mkdir(pluginOutputDir, { recursive: true });
74
- await Promise.all(files.map(async (file) => {
75
- if (file.split(path.sep).includes('hooks')) {
76
- const hooksOutputDir = path.join(pluginOutputDir, 'hooks');
77
- await fs.mkdir(hooksOutputDir, { recursive: true });
78
- (0, shelljs_1.cp)('-f', file, path.join(hooksOutputDir, path.basename(file)));
79
- }
80
- else {
81
- (0, shelljs_1.cp)('-f', file, path.join(pluginOutputDir, path.basename(file)));
82
- }
83
- }));
84
- }));
85
- }
86
- }
87
- exports.default = Collect;
88
- Collect.summary = messages.getMessage('description');
89
- Collect.description = messages.getMessage('description');
90
- Collect.examples = messages.getMessages('examples');
91
- Collect.flags = {};
92
- Collect.state = 'deprecated';
93
- //# sourceMappingURL=collect.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collect.js","sourceRoot":"","sources":["../../../../src/commands/cli/schemas/collect.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,6BAA6B;AAC7B,kCAAkC;AAClC,iCAAiC;AACjC,iEAAwD;AACxD,2CAA4C;AAC5C,qCAA6B;AAC7B,gCAAgC;AAEhC,yCAA+C;AAE/C,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,IAAI,CAAC,uCAAuC,EAAE,qBAAqB,EAAE;IAC7F,aAAa;IACb,UAAU;CACX,CAAC,CAAC;AAEI,MAAM,oBAAoB,GAAG,KAAK,IAAuB,EAAE;IAChE,MAAM,QAAQ,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC;IACtF,MAAM,KAAK,GAAqC,IAAA,kBAAY,EAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC;IAEjH,MAAM,KAAK,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QACxD,MAAM,UAAU,GAAG,MAAM,C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Ac,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;oBAC3D,MAAM,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;oBACpD,IAAA,YAAE,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;iBAChE;qBAAM;oBACL,IAAA,YAAE,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;iBACjE;YACH,CAAC,CAAC,CACH,CAAC;QACJ,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;;AA5CH,0BA6CC;AA5CwB,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,EAAE,CAAC;AAEX,aAAK,GAAG,YAAY,CAAC"}
@@ -1,18 +0,0 @@
1
- import { SfCommand } from '@salesforce/sf-plugins-core';
2
- export default class Consolidate extends SfCommand<void> {
3
- static readonly summary: string;
4
- static readonly description: string;
5
- static readonly examples: string[];
6
- static readonly flags: {
7
- 'max-version-bump': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
- 'base-branch': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
- 'target-branch': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
10
- ignore: import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces/parser").CustomOptions>;
11
- dryrun: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
- 'no-pr': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
- owner: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
14
- repo: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
15
- };
16
- run(): Promise<void>;
17
- private exec;
18
- }
@@ -1,124 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /*
4
- * Copyright (c) 2020, salesforce.com, inc.
5
- * All rights reserved.
6
- * Licensed under the BSD 3-Clause license.
7
- * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
8
- */
9
- const os = require("os");
10
- const core_1 = require("@salesforce/core");
11
- const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
12
- const core_2 = require("@octokit/core");
13
- const kit_1 = require("@salesforce/kit");
14
- const chalk_1 = require("chalk");
15
- const shelljs_1 = require("shelljs");
16
- const ts_types_1 = require("@salesforce/ts-types");
17
- const dependabot_1 = require("../../dependabot");
18
- core_1.Messages.importMessagesDirectory(__dirname);
19
- const messages = core_1.Messages.loadMessages('@salesforce/plugin-release-management', 'dependabot.consolidate');
20
- class Consolidate extends sf_plugins_core_1.SfCommand {
21
- async run() {
22
- const { flags } = await this.parse(Consolidate);
23
- const baseRepoObject = await (0, dependabot_1.getOwnerAndRepo)(flags.owner, flags.repo);
24
- const baseBranch = (0, ts_types_1.ensureString)(flags['base-branch']);
25
- const targetBranch = (0, ts_types_1.ensureString)(flags['target-branch']);
26
- const auth = (0, ts_types_1.ensureString)(new kit_1.Env().getString('GH_TOKEN'), 'GH_TOKEN is required to be set in the environment');
27
- const octokit = new core_2.Octokit({ auth });
28
- const pullRequests = await octokit.request('GET /repos/{owner}/{repo}/pulls', baseRepoObject);
29
- const dependabotPRs = pullRequests.data.filter((d) => d.state === 'open' &&
30
- d.user.login === 'dependabot[bot]' &&
31
- (0, dependabot_1.meetsVersionCriteria)(d.title, flags['max-version-bump']) &&
32
- !flags.ignore.some((i) => d.title.includes(i)));
33
- let prBody = `This PR consolidates all dependabot PRs that are less than or equal to a ${flags['max-version-bump']} version bump${os.EOL}${os.EOL}`;
34
- for (const pr of dependabotPRs) {
35
- prBody += `Closes #${pr.number}${os.EOL}`;
36
- }
37
- const prTitle = `Consolidate ${flags['max-version-bump']} dependabot PRs`;
38
- this.log((0, chalk_1.bold)('PR Title:'));
39
- this.log(prTitle);
40
- this.log((0, chalk_1.bold)('PR Body:'));
41
- this.log(prBody);
42
- this.log((0, chalk_1.bold)('Commits:'));
43
- for (const pr of dependabotPRs) {
44
- this.log(` ${(0, chalk_1.cyan)(pr.head.sha)} [#${pr.number} ${pr.title}]`);
45
- }
46
- if (!flags.dryrun) {
47
- try {
48
- this.exec('git fetch origin');
49
- this.exec('git fetch -p');
50
- this.exec(`git checkout ${baseBranch}`);
51
- this.exec('git pull');
52
- this.exec(`git checkout -b ${targetBranch}`);
53
- const shas = dependabotPRs.map((d) => d.head.sha);
54
- for (const sha of shas) {
55
- this.exec(`git cherry-pick ${sha} --strategy-option=theirs`);
56
- }
57
- if (!flags['no-pr']) {
58
- this.exec(`git push -u origin ${targetBranch} --no-verify`);
59
- const response = await octokit.request('POST /repos/{owner}/{repo}/pulls', {
60
- ...baseRepoObject,
61
- head: targetBranch,
62
- base: baseBranch,
63
- body: prBody,
64
- title: prTitle,
65
- });
66
- this.log();
67
- // eslint-disable-next-line no-underscore-dangle
68
- this.log(`${(0, chalk_1.green)('Created Pull Request:')} ${response.data._links.html.href}`);
69
- }
70
- }
71
- catch (err) {
72
- if (!(err instanceof Error) || typeof err !== 'string') {
73
- throw err;
74
- }
75
- this.error(err);
76
- }
77
- }
78
- }
79
- exec(cmd, silent = false) {
80
- this.log((0, chalk_1.bold)(cmd));
81
- (0, shelljs_1.exec)(cmd, { silent });
82
- }
83
- }
84
- exports.default = Consolidate;
85
- Consolidate.summary = messages.getMessage('description');
86
- Consolidate.description = messages.getMessage('description');
87
- Consolidate.examples = messages.getMessages('examples');
88
- Consolidate.flags = {
89
- 'max-version-bump': dependabot_1.maxVersionBumpFlag,
90
- 'base-branch': sf_plugins_core_1.Flags.string({
91
- summary: messages.getMessage('baseBranch'),
92
- char: 'b',
93
- default: 'main',
94
- required: true,
95
- }),
96
- 'target-branch': sf_plugins_core_1.Flags.string({
97
- summary: messages.getMessage('targetBranch'),
98
- char: 't',
99
- default: 'consolidate-dependabot',
100
- required: true,
101
- }),
102
- ignore: (0, sf_plugins_core_1.arrayWithDeprecation)({
103
- summary: messages.getMessage('ignore'),
104
- }),
105
- dryrun: sf_plugins_core_1.Flags.boolean({
106
- summary: messages.getMessage('dryrun'),
107
- char: 'd',
108
- default: false,
109
- }),
110
- 'no-pr': sf_plugins_core_1.Flags.boolean({
111
- summary: messages.getMessage('noPR'),
112
- default: false,
113
- }),
114
- owner: sf_plugins_core_1.Flags.string({
115
- summary: messages.getMessage('owner'),
116
- char: 'o',
117
- }),
118
- repo: sf_plugins_core_1.Flags.string({
119
- summary: messages.getMessage('repo'),
120
- char: 'r',
121
- dependsOn: ['owner'],
122
- }),
123
- };
124
- //# sourceMappingURL=consolidate.js.map