@salesforce/plugin-release-management 4.7.33 → 5.0.0
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/README.md +78 -71
- package/lib/amazonS3.js +5 -2
- package/lib/amazonS3.js.map +1 -1
- package/lib/codeSigning/packAndSign.js +17 -18
- package/lib/codeSigning/packAndSign.js.map +1 -1
- package/lib/commands/cli/tarballs/prepare.js +2 -3
- package/lib/commands/cli/tarballs/prepare.js.map +1 -1
- package/lib/repository.js +1 -14
- package/lib/repository.js.map +1 -1
- package/npm-shrinkwrap.json +10463 -14625
- package/oclif.lock +1192 -3081
- package/oclif.manifest.json +195 -67
- package/package.json +13 -14
- package/lib/codeSigning/NpmName.d.ts +0 -16
- package/lib/codeSigning/NpmName.js +0 -80
- package/lib/codeSigning/NpmName.js.map +0 -1
package/oclif.manifest.json
CHANGED
|
@@ -15,6 +15,14 @@
|
|
|
15
15
|
"allowNo": false,
|
|
16
16
|
"type": "boolean"
|
|
17
17
|
},
|
|
18
|
+
"flags-dir": {
|
|
19
|
+
"helpGroup": "GLOBAL",
|
|
20
|
+
"name": "flags-dir",
|
|
21
|
+
"summary": "Import flag values from a directory.",
|
|
22
|
+
"hasDynamicHelp": false,
|
|
23
|
+
"multiple": false,
|
|
24
|
+
"type": "option"
|
|
25
|
+
},
|
|
18
26
|
"dryrun": {
|
|
19
27
|
"char": "d",
|
|
20
28
|
"name": "dryrun",
|
|
@@ -152,72 +160,6 @@
|
|
|
152
160
|
"promote.js"
|
|
153
161
|
]
|
|
154
162
|
},
|
|
155
|
-
"cli:releasenotes": {
|
|
156
|
-
"aliases": [],
|
|
157
|
-
"args": {},
|
|
158
|
-
"description": "pull all relevant information for writing release notes.\nRequires the GH_TOKEN to be set in the environment.",
|
|
159
|
-
"examples": [
|
|
160
|
-
"<%= config.bin %> <%= command.id %> --cli sf",
|
|
161
|
-
"<%= config.bin %> <%= command.id %> --cli sfdx",
|
|
162
|
-
"<%= config.bin %> <%= command.id %> --cli sf --since 1.0.0",
|
|
163
|
-
"<%= config.bin %> <%= command.id %> --cli sfdx --since 7.19.0",
|
|
164
|
-
"<%= config.bin %> <%= command.id %> --cli sf > changes.txt",
|
|
165
|
-
"<%= config.bin %> <%= command.id %> --cli sf --markdown > changes.md"
|
|
166
|
-
],
|
|
167
|
-
"flags": {
|
|
168
|
-
"json": {
|
|
169
|
-
"description": "Format output as json.",
|
|
170
|
-
"helpGroup": "GLOBAL",
|
|
171
|
-
"name": "json",
|
|
172
|
-
"allowNo": false,
|
|
173
|
-
"type": "boolean"
|
|
174
|
-
},
|
|
175
|
-
"cli": {
|
|
176
|
-
"char": "c",
|
|
177
|
-
"name": "cli",
|
|
178
|
-
"required": true,
|
|
179
|
-
"summary": "the cli to pull information for",
|
|
180
|
-
"hasDynamicHelp": false,
|
|
181
|
-
"multiple": false,
|
|
182
|
-
"options": [
|
|
183
|
-
"sf",
|
|
184
|
-
"sfdx"
|
|
185
|
-
],
|
|
186
|
-
"type": "option"
|
|
187
|
-
},
|
|
188
|
-
"since": {
|
|
189
|
-
"char": "s",
|
|
190
|
-
"name": "since",
|
|
191
|
-
"summary": "the version number of the previous release. Defaults to the latest-rc version on npm",
|
|
192
|
-
"hasDynamicHelp": false,
|
|
193
|
-
"multiple": false,
|
|
194
|
-
"type": "option"
|
|
195
|
-
},
|
|
196
|
-
"markdown": {
|
|
197
|
-
"char": "m",
|
|
198
|
-
"name": "markdown",
|
|
199
|
-
"summary": "format the output in markdown",
|
|
200
|
-
"allowNo": false,
|
|
201
|
-
"type": "boolean"
|
|
202
|
-
}
|
|
203
|
-
},
|
|
204
|
-
"hasDynamicHelp": false,
|
|
205
|
-
"hiddenAliases": [],
|
|
206
|
-
"id": "cli:releasenotes",
|
|
207
|
-
"pluginAlias": "@salesforce/plugin-release-management",
|
|
208
|
-
"pluginName": "@salesforce/plugin-release-management",
|
|
209
|
-
"pluginType": "core",
|
|
210
|
-
"strict": true,
|
|
211
|
-
"summary": "pull all relevant information for writing release notes.\nRequires the GH_TOKEN to be set in the environment.",
|
|
212
|
-
"enableJsonFlag": true,
|
|
213
|
-
"isESM": true,
|
|
214
|
-
"relativePath": [
|
|
215
|
-
"lib",
|
|
216
|
-
"commands",
|
|
217
|
-
"cli",
|
|
218
|
-
"releasenotes.js"
|
|
219
|
-
]
|
|
220
|
-
},
|
|
221
163
|
"dependabot:automerge": {
|
|
222
164
|
"aliases": [],
|
|
223
165
|
"args": {},
|
|
@@ -235,6 +177,14 @@
|
|
|
235
177
|
"allowNo": false,
|
|
236
178
|
"type": "boolean"
|
|
237
179
|
},
|
|
180
|
+
"flags-dir": {
|
|
181
|
+
"helpGroup": "GLOBAL",
|
|
182
|
+
"name": "flags-dir",
|
|
183
|
+
"summary": "Import flag values from a directory.",
|
|
184
|
+
"hasDynamicHelp": false,
|
|
185
|
+
"multiple": false,
|
|
186
|
+
"type": "option"
|
|
187
|
+
},
|
|
238
188
|
"owner": {
|
|
239
189
|
"char": "o",
|
|
240
190
|
"dependsOn": [
|
|
@@ -317,6 +267,80 @@
|
|
|
317
267
|
"automerge.js"
|
|
318
268
|
]
|
|
319
269
|
},
|
|
270
|
+
"cli:releasenotes": {
|
|
271
|
+
"aliases": [],
|
|
272
|
+
"args": {},
|
|
273
|
+
"description": "pull all relevant information for writing release notes.\nRequires the GH_TOKEN to be set in the environment.",
|
|
274
|
+
"examples": [
|
|
275
|
+
"<%= config.bin %> <%= command.id %> --cli sf",
|
|
276
|
+
"<%= config.bin %> <%= command.id %> --cli sfdx",
|
|
277
|
+
"<%= config.bin %> <%= command.id %> --cli sf --since 1.0.0",
|
|
278
|
+
"<%= config.bin %> <%= command.id %> --cli sfdx --since 7.19.0",
|
|
279
|
+
"<%= config.bin %> <%= command.id %> --cli sf > changes.txt",
|
|
280
|
+
"<%= config.bin %> <%= command.id %> --cli sf --markdown > changes.md"
|
|
281
|
+
],
|
|
282
|
+
"flags": {
|
|
283
|
+
"json": {
|
|
284
|
+
"description": "Format output as json.",
|
|
285
|
+
"helpGroup": "GLOBAL",
|
|
286
|
+
"name": "json",
|
|
287
|
+
"allowNo": false,
|
|
288
|
+
"type": "boolean"
|
|
289
|
+
},
|
|
290
|
+
"flags-dir": {
|
|
291
|
+
"helpGroup": "GLOBAL",
|
|
292
|
+
"name": "flags-dir",
|
|
293
|
+
"summary": "Import flag values from a directory.",
|
|
294
|
+
"hasDynamicHelp": false,
|
|
295
|
+
"multiple": false,
|
|
296
|
+
"type": "option"
|
|
297
|
+
},
|
|
298
|
+
"cli": {
|
|
299
|
+
"char": "c",
|
|
300
|
+
"name": "cli",
|
|
301
|
+
"required": true,
|
|
302
|
+
"summary": "the cli to pull information for",
|
|
303
|
+
"hasDynamicHelp": false,
|
|
304
|
+
"multiple": false,
|
|
305
|
+
"options": [
|
|
306
|
+
"sf",
|
|
307
|
+
"sfdx"
|
|
308
|
+
],
|
|
309
|
+
"type": "option"
|
|
310
|
+
},
|
|
311
|
+
"since": {
|
|
312
|
+
"char": "s",
|
|
313
|
+
"name": "since",
|
|
314
|
+
"summary": "the version number of the previous release. Defaults to the latest-rc version on npm",
|
|
315
|
+
"hasDynamicHelp": false,
|
|
316
|
+
"multiple": false,
|
|
317
|
+
"type": "option"
|
|
318
|
+
},
|
|
319
|
+
"markdown": {
|
|
320
|
+
"char": "m",
|
|
321
|
+
"name": "markdown",
|
|
322
|
+
"summary": "format the output in markdown",
|
|
323
|
+
"allowNo": false,
|
|
324
|
+
"type": "boolean"
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
"hasDynamicHelp": false,
|
|
328
|
+
"hiddenAliases": [],
|
|
329
|
+
"id": "cli:releasenotes",
|
|
330
|
+
"pluginAlias": "@salesforce/plugin-release-management",
|
|
331
|
+
"pluginName": "@salesforce/plugin-release-management",
|
|
332
|
+
"pluginType": "core",
|
|
333
|
+
"strict": true,
|
|
334
|
+
"summary": "pull all relevant information for writing release notes.\nRequires the GH_TOKEN to be set in the environment.",
|
|
335
|
+
"enableJsonFlag": true,
|
|
336
|
+
"isESM": true,
|
|
337
|
+
"relativePath": [
|
|
338
|
+
"lib",
|
|
339
|
+
"commands",
|
|
340
|
+
"cli",
|
|
341
|
+
"releasenotes.js"
|
|
342
|
+
]
|
|
343
|
+
},
|
|
320
344
|
"repositories": {
|
|
321
345
|
"aliases": [],
|
|
322
346
|
"args": {},
|
|
@@ -333,6 +357,14 @@
|
|
|
333
357
|
"allowNo": false,
|
|
334
358
|
"type": "boolean"
|
|
335
359
|
},
|
|
360
|
+
"flags-dir": {
|
|
361
|
+
"helpGroup": "GLOBAL",
|
|
362
|
+
"name": "flags-dir",
|
|
363
|
+
"summary": "Import flag values from a directory.",
|
|
364
|
+
"hasDynamicHelp": false,
|
|
365
|
+
"multiple": false,
|
|
366
|
+
"type": "option"
|
|
367
|
+
},
|
|
336
368
|
"columns": {
|
|
337
369
|
"description": "only show provided columns (comma-separated)",
|
|
338
370
|
"exclusive": [
|
|
@@ -442,6 +474,14 @@
|
|
|
442
474
|
"allowNo": false,
|
|
443
475
|
"type": "boolean"
|
|
444
476
|
},
|
|
477
|
+
"flags-dir": {
|
|
478
|
+
"helpGroup": "GLOBAL",
|
|
479
|
+
"name": "flags-dir",
|
|
480
|
+
"summary": "Import flag values from a directory.",
|
|
481
|
+
"hasDynamicHelp": false,
|
|
482
|
+
"multiple": false,
|
|
483
|
+
"type": "option"
|
|
484
|
+
},
|
|
445
485
|
"plugin": {
|
|
446
486
|
"char": "p",
|
|
447
487
|
"name": "plugin",
|
|
@@ -504,6 +544,14 @@
|
|
|
504
544
|
"allowNo": false,
|
|
505
545
|
"type": "boolean"
|
|
506
546
|
},
|
|
547
|
+
"flags-dir": {
|
|
548
|
+
"helpGroup": "GLOBAL",
|
|
549
|
+
"name": "flags-dir",
|
|
550
|
+
"summary": "Import flag values from a directory.",
|
|
551
|
+
"hasDynamicHelp": false,
|
|
552
|
+
"multiple": false,
|
|
553
|
+
"type": "option"
|
|
554
|
+
},
|
|
507
555
|
"cli": {
|
|
508
556
|
"char": "c",
|
|
509
557
|
"name": "cli",
|
|
@@ -588,6 +636,14 @@
|
|
|
588
636
|
"allowNo": false,
|
|
589
637
|
"type": "boolean"
|
|
590
638
|
},
|
|
639
|
+
"flags-dir": {
|
|
640
|
+
"helpGroup": "GLOBAL",
|
|
641
|
+
"name": "flags-dir",
|
|
642
|
+
"summary": "Import flag values from a directory.",
|
|
643
|
+
"hasDynamicHelp": false,
|
|
644
|
+
"multiple": false,
|
|
645
|
+
"type": "option"
|
|
646
|
+
},
|
|
591
647
|
"owner": {
|
|
592
648
|
"aliases": [
|
|
593
649
|
"org"
|
|
@@ -678,6 +734,14 @@
|
|
|
678
734
|
"allowNo": false,
|
|
679
735
|
"type": "boolean"
|
|
680
736
|
},
|
|
737
|
+
"flags-dir": {
|
|
738
|
+
"helpGroup": "GLOBAL",
|
|
739
|
+
"name": "flags-dir",
|
|
740
|
+
"summary": "Import flag values from a directory.",
|
|
741
|
+
"hasDynamicHelp": false,
|
|
742
|
+
"multiple": false,
|
|
743
|
+
"type": "option"
|
|
744
|
+
},
|
|
681
745
|
"start-from-npm-dist-tag": {
|
|
682
746
|
"aliases": [
|
|
683
747
|
"rctag"
|
|
@@ -799,6 +863,14 @@
|
|
|
799
863
|
"allowNo": false,
|
|
800
864
|
"type": "boolean"
|
|
801
865
|
},
|
|
866
|
+
"flags-dir": {
|
|
867
|
+
"helpGroup": "GLOBAL",
|
|
868
|
+
"name": "flags-dir",
|
|
869
|
+
"summary": "Import flag values from a directory.",
|
|
870
|
+
"hasDynamicHelp": false,
|
|
871
|
+
"multiple": false,
|
|
872
|
+
"type": "option"
|
|
873
|
+
},
|
|
802
874
|
"dryrun": {
|
|
803
875
|
"char": "d",
|
|
804
876
|
"name": "dryrun",
|
|
@@ -854,6 +926,14 @@
|
|
|
854
926
|
"allowNo": false,
|
|
855
927
|
"type": "boolean"
|
|
856
928
|
},
|
|
929
|
+
"flags-dir": {
|
|
930
|
+
"helpGroup": "GLOBAL",
|
|
931
|
+
"name": "flags-dir",
|
|
932
|
+
"summary": "Import flag values from a directory.",
|
|
933
|
+
"hasDynamicHelp": false,
|
|
934
|
+
"multiple": false,
|
|
935
|
+
"type": "option"
|
|
936
|
+
},
|
|
857
937
|
"verbose": {
|
|
858
938
|
"name": "verbose",
|
|
859
939
|
"summary": "show the --help output for each command",
|
|
@@ -896,6 +976,14 @@
|
|
|
896
976
|
"allowNo": false,
|
|
897
977
|
"type": "boolean"
|
|
898
978
|
},
|
|
979
|
+
"flags-dir": {
|
|
980
|
+
"helpGroup": "GLOBAL",
|
|
981
|
+
"name": "flags-dir",
|
|
982
|
+
"summary": "Import flag values from a directory.",
|
|
983
|
+
"hasDynamicHelp": false,
|
|
984
|
+
"multiple": false,
|
|
985
|
+
"type": "option"
|
|
986
|
+
},
|
|
899
987
|
"cli": {
|
|
900
988
|
"char": "c",
|
|
901
989
|
"name": "cli",
|
|
@@ -961,6 +1049,14 @@
|
|
|
961
1049
|
"allowNo": false,
|
|
962
1050
|
"type": "boolean"
|
|
963
1051
|
},
|
|
1052
|
+
"flags-dir": {
|
|
1053
|
+
"helpGroup": "GLOBAL",
|
|
1054
|
+
"name": "flags-dir",
|
|
1055
|
+
"summary": "Import flag values from a directory.",
|
|
1056
|
+
"hasDynamicHelp": false,
|
|
1057
|
+
"multiple": false,
|
|
1058
|
+
"type": "option"
|
|
1059
|
+
},
|
|
964
1060
|
"dependencies": {
|
|
965
1061
|
"char": "d",
|
|
966
1062
|
"name": "dependencies",
|
|
@@ -1053,6 +1149,14 @@
|
|
|
1053
1149
|
"allowNo": false,
|
|
1054
1150
|
"type": "boolean"
|
|
1055
1151
|
},
|
|
1152
|
+
"flags-dir": {
|
|
1153
|
+
"helpGroup": "GLOBAL",
|
|
1154
|
+
"name": "flags-dir",
|
|
1155
|
+
"summary": "Import flag values from a directory.",
|
|
1156
|
+
"hasDynamicHelp": false,
|
|
1157
|
+
"multiple": false,
|
|
1158
|
+
"type": "option"
|
|
1159
|
+
},
|
|
1056
1160
|
"gus": {
|
|
1057
1161
|
"char": "o",
|
|
1058
1162
|
"name": "gus",
|
|
@@ -1103,6 +1207,14 @@
|
|
|
1103
1207
|
"allowNo": false,
|
|
1104
1208
|
"type": "boolean"
|
|
1105
1209
|
},
|
|
1210
|
+
"flags-dir": {
|
|
1211
|
+
"helpGroup": "GLOBAL",
|
|
1212
|
+
"name": "flags-dir",
|
|
1213
|
+
"summary": "Import flag values from a directory.",
|
|
1214
|
+
"hasDynamicHelp": false,
|
|
1215
|
+
"multiple": false,
|
|
1216
|
+
"type": "option"
|
|
1217
|
+
},
|
|
1106
1218
|
"dryrun": {
|
|
1107
1219
|
"char": "d",
|
|
1108
1220
|
"name": "dryrun",
|
|
@@ -1150,6 +1262,14 @@
|
|
|
1150
1262
|
"allowNo": false,
|
|
1151
1263
|
"type": "boolean"
|
|
1152
1264
|
},
|
|
1265
|
+
"flags-dir": {
|
|
1266
|
+
"helpGroup": "GLOBAL",
|
|
1267
|
+
"name": "flags-dir",
|
|
1268
|
+
"summary": "Import flag values from a directory.",
|
|
1269
|
+
"hasDynamicHelp": false,
|
|
1270
|
+
"multiple": false,
|
|
1271
|
+
"type": "option"
|
|
1272
|
+
},
|
|
1153
1273
|
"dryrun": {
|
|
1154
1274
|
"char": "d",
|
|
1155
1275
|
"name": "dryrun",
|
|
@@ -1241,6 +1361,14 @@
|
|
|
1241
1361
|
"allowNo": false,
|
|
1242
1362
|
"type": "boolean"
|
|
1243
1363
|
},
|
|
1364
|
+
"flags-dir": {
|
|
1365
|
+
"helpGroup": "GLOBAL",
|
|
1366
|
+
"name": "flags-dir",
|
|
1367
|
+
"summary": "Import flag values from a directory.",
|
|
1368
|
+
"hasDynamicHelp": false,
|
|
1369
|
+
"multiple": false,
|
|
1370
|
+
"type": "option"
|
|
1371
|
+
},
|
|
1244
1372
|
"jit-plugin": {
|
|
1245
1373
|
"char": "j",
|
|
1246
1374
|
"name": "jit-plugin",
|
|
@@ -1270,5 +1398,5 @@
|
|
|
1270
1398
|
]
|
|
1271
1399
|
}
|
|
1272
1400
|
},
|
|
1273
|
-
"version": "
|
|
1401
|
+
"version": "5.0.0"
|
|
1274
1402
|
}
|
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": "
|
|
4
|
+
"version": "5.0.0",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/forcedotcom/cli/issues",
|
|
7
7
|
"type": "module",
|
|
@@ -9,18 +9,18 @@
|
|
|
9
9
|
"sf-release": "bin/run.js"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@oclif/core": "^3.
|
|
12
|
+
"@oclif/core": "^3.26.0",
|
|
13
13
|
"@octokit/core": "^4.2.4",
|
|
14
14
|
"@octokit/plugin-paginate-rest": "^6.1.2",
|
|
15
15
|
"@octokit/plugin-throttling": "^5.2.3",
|
|
16
|
-
"@salesforce/cli-plugins-testkit": "^
|
|
17
|
-
"@salesforce/core": "^6.7.
|
|
16
|
+
"@salesforce/cli-plugins-testkit": "^5.1.13",
|
|
17
|
+
"@salesforce/core": "^6.7.6",
|
|
18
18
|
"@salesforce/kit": "^3.1.0",
|
|
19
|
-
"@salesforce/plugin-command-reference": "^3.0.
|
|
20
|
-
"@salesforce/plugin-trust": "^3.3
|
|
21
|
-
"@salesforce/sf-plugins-core": "^
|
|
19
|
+
"@salesforce/plugin-command-reference": "^3.0.74",
|
|
20
|
+
"@salesforce/plugin-trust": "^3.5.3",
|
|
21
|
+
"@salesforce/sf-plugins-core": "^8.0.3",
|
|
22
22
|
"@salesforce/ts-types": "^2.0.9",
|
|
23
|
-
"aws-sdk": "^2.
|
|
23
|
+
"aws-sdk": "^2.1593.0",
|
|
24
24
|
"chalk": "^5.3.0",
|
|
25
25
|
"fast-glob": "^3.3.2",
|
|
26
26
|
"got": "^13",
|
|
@@ -28,19 +28,18 @@
|
|
|
28
28
|
"proxy-agent": "^6.4.0",
|
|
29
29
|
"semver": "^7.6.0",
|
|
30
30
|
"shelljs": "^0.8.5",
|
|
31
|
-
"standard-version": "^9.0.0",
|
|
32
31
|
"strip-ansi": "^6",
|
|
33
|
-
"yarn-deduplicate": "^
|
|
32
|
+
"yarn-deduplicate": "^6.0.2"
|
|
34
33
|
},
|
|
35
34
|
"devDependencies": {
|
|
36
|
-
"@oclif/plugin-command-snapshot": "^
|
|
37
|
-
"@salesforce/dev-scripts": "^8.4.
|
|
35
|
+
"@oclif/plugin-command-snapshot": "^5.1.4",
|
|
36
|
+
"@salesforce/dev-scripts": "^8.4.3",
|
|
38
37
|
"@salesforce/ts-sinon": "1.4.19",
|
|
39
38
|
"@types/semver": "^7.5.8",
|
|
40
39
|
"@types/shelljs": "^0.8.15",
|
|
41
40
|
"aws-sdk-mock": "^5.9.0",
|
|
42
|
-
"eslint-plugin-sf-plugin": "^1.17.
|
|
43
|
-
"oclif": "^4.
|
|
41
|
+
"eslint-plugin-sf-plugin": "^1.17.5",
|
|
42
|
+
"oclif": "^4.7.6",
|
|
44
43
|
"ts-node": "^10.9.2",
|
|
45
44
|
"typescript": "^5.4.3"
|
|
46
45
|
},
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
interface NpmNameResponse {
|
|
2
|
-
scope?: string;
|
|
3
|
-
name: string;
|
|
4
|
-
tag: string;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Get the parsed components of an NpmName
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* const f = parseNpmName('@salesforce/jj@foo');
|
|
11
|
-
* console.log(f.tag === 'foo')
|
|
12
|
-
* console.log(f.name === 'jj')
|
|
13
|
-
* console.log(f.scope === 'salesforce')
|
|
14
|
-
*/
|
|
15
|
-
export declare const parseNpmName: (npmName: string) => NpmNameResponse;
|
|
16
|
-
export {};
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
* Licensed under the BSD 3-Clause license.
|
|
5
|
-
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
-
*/
|
|
7
|
-
import { NamedError } from '@salesforce/kit';
|
|
8
|
-
const DEFAULT_TAG = 'latest';
|
|
9
|
-
/**
|
|
10
|
-
* Get the parsed components of an NpmName
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* const f = parseNpmName('@salesforce/jj@foo');
|
|
14
|
-
* console.log(f.tag === 'foo')
|
|
15
|
-
* console.log(f.name === 'jj')
|
|
16
|
-
* console.log(f.scope === 'salesforce')
|
|
17
|
-
*/
|
|
18
|
-
export const parseNpmName = (npmName) => {
|
|
19
|
-
if (!npmName || npmName.length < 1) {
|
|
20
|
-
throw new NamedError('MissingOrInvalidNpmName', 'The npm name is missing or invalid.');
|
|
21
|
-
}
|
|
22
|
-
const components = npmName.split('@');
|
|
23
|
-
// salesforce/jj
|
|
24
|
-
if (components.length === 1) {
|
|
25
|
-
return setNameAndScope(components[0]);
|
|
26
|
-
}
|
|
27
|
-
if (components[0].includes('/')) {
|
|
28
|
-
// salesforce/jj@tag
|
|
29
|
-
return setNameAndScope(components[0], components.length > 2 ? components[2] : DEFAULT_TAG);
|
|
30
|
-
}
|
|
31
|
-
else if (components[1].includes('/')) {
|
|
32
|
-
// @salesforce/jj@tag
|
|
33
|
-
return setNameAndScope(components[1], components.length > 2 ? components[2] : DEFAULT_TAG);
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
// Allow something like salesforcedx/pre-release
|
|
37
|
-
return setNameAndScope(components[0], components[1]);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* Subroutine for getting name and scope
|
|
42
|
-
*
|
|
43
|
-
* @param {string} name - The string to parse.
|
|
44
|
-
*/
|
|
45
|
-
const setNameAndScope = (name, tag = DEFAULT_TAG) => {
|
|
46
|
-
// There are at least 2 components. So there is likely a scope.
|
|
47
|
-
const subComponents = name.split('/');
|
|
48
|
-
if (subComponents.length === 2 && subComponents[0].trim().length > 0 && subComponents[1].trim().length > 0) {
|
|
49
|
-
return {
|
|
50
|
-
tag,
|
|
51
|
-
scope: validateComponentString(subComponents[0]),
|
|
52
|
-
name: validateComponentString(subComponents[1]),
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
else if (subComponents.length === 1) {
|
|
56
|
-
return {
|
|
57
|
-
tag,
|
|
58
|
-
name: validateComponentString(subComponents[0]),
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
throw new NamedError('InvalidNpmName', 'The npm name is invalid.');
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* Validate a component part that it's not empty and return it trimmed.
|
|
67
|
-
*
|
|
68
|
-
* @param {string} name The component to validate.
|
|
69
|
-
* @return {string} A whitespace trimmed version of the component.
|
|
70
|
-
*/
|
|
71
|
-
const validateComponentString = (name) => {
|
|
72
|
-
const trimmedName = name.trim();
|
|
73
|
-
if (trimmedName && trimmedName.length > 0) {
|
|
74
|
-
return trimmedName;
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
throw new NamedError('MissingOrInvalidNpmName', 'The npm name is missing or invalid.');
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
//# sourceMappingURL=NpmName.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NpmName.js","sourceRoot":"","sources":["../../src/codeSigning/NpmName.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,WAAW,GAAG,QAAQ,CAAC;AAO7B;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAe,EAAmB,EAAE;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