oclif 4.0.2 → 4.0.4
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/lib/command-base.js +0 -2
- package/lib/commands/pack/win.d.ts +1 -0
- package/lib/commands/pack/win.js +20 -7
- package/oclif.manifest.json +30 -1
- package/package.json +6 -6
package/lib/command-base.js
CHANGED
|
@@ -6,8 +6,6 @@ class CommandBase extends core_1.Command {
|
|
|
6
6
|
async generate(type, generatorOptions = {}) {
|
|
7
7
|
const env = (0, yeoman_environment_1.createEnv)();
|
|
8
8
|
env.register(require.resolve(`./generators/${type}`), `oclif:${type}`);
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
10
|
-
// @ts-ignore
|
|
11
9
|
await env.run(`oclif:${type}`, generatorOptions);
|
|
12
10
|
}
|
|
13
11
|
}
|
|
@@ -3,6 +3,7 @@ export default class PackWin extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
5
|
'additional-cli': Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
|
|
6
|
+
'defender-exclusion': Interfaces.OptionFlag<"hidden" | "checked" | "unchecked", Interfaces.CustomOptions>;
|
|
6
7
|
root: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
7
8
|
tarball: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
|
|
8
9
|
targets: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
|
package/lib/commands/pack/win.js
CHANGED
|
@@ -12,8 +12,7 @@ const upload_util_1 = require("../../upload-util");
|
|
|
12
12
|
const exec = (0, node_util_1.promisify)(node_child_process_1.exec);
|
|
13
13
|
const scripts = {
|
|
14
14
|
/* eslint-disable no-useless-escape */
|
|
15
|
-
|
|
16
|
-
cmd: (config, additionalCLI = undefined) => `@echo off
|
|
15
|
+
cmd: (config, additionalCLI) => `@echo off
|
|
17
16
|
setlocal enableextensions
|
|
18
17
|
|
|
19
18
|
set ${additionalCLI ? `${additionalCLI.toUpperCase()}_BINPATH` : config.scopedEnvVarKey('BINPATH')}=%~dp0\\${additionalCLI ?? config.bin}.cmd
|
|
@@ -23,7 +22,7 @@ if exist "%LOCALAPPDATA%\\${config.dirname}\\client\\bin\\${additionalCLI ?? con
|
|
|
23
22
|
"%~dp0\\..\\client\\bin\\node.exe" "%~dp0\\..\\client\\${additionalCLI ? `${additionalCLI}\\bin\\run` : 'bin\\run'}" %*
|
|
24
23
|
)
|
|
25
24
|
`,
|
|
26
|
-
nsis: (config,
|
|
25
|
+
nsis: ({ arch, config, customization, defenderOptionDefault, hideDefenderOption, }) => `!include MUI2.nsh
|
|
27
26
|
|
|
28
27
|
!define Version '${config.version.split('-')[0]}'
|
|
29
28
|
Name "${config.name}"
|
|
@@ -76,7 +75,7 @@ Section "Set PATH to ${config.name}"
|
|
|
76
75
|
Call AddToPath
|
|
77
76
|
SectionEnd
|
|
78
77
|
|
|
79
|
-
Section "Add %LOCALAPPDATA%\\${config.dirname} to Windows Defender exclusions (highly recommended for performance!)"
|
|
78
|
+
Section ${defenderOptionDefault ? '' : '/o '}"${hideDefenderOption ? '-' : ''}Add %LOCALAPPDATA%\\${config.dirname} to Windows Defender exclusions (highly recommended for performance!)"
|
|
80
79
|
ExecShell "" '"$0"' "/C powershell -ExecutionPolicy Bypass -Command $\\"& {Add-MpPreference -ExclusionPath $\\"$LOCALAPPDATA\\${config.dirname}$\\"}$\\" -FFFeatureOff" SW_HIDE
|
|
81
80
|
SectionEnd
|
|
82
81
|
|
|
@@ -211,6 +210,13 @@ class PackWin extends core_1.Command {
|
|
|
211
210
|
the CLI should already exist in a directory named after the CLI that is the root of the tarball produced by "oclif pack:tarballs"`,
|
|
212
211
|
hidden: true,
|
|
213
212
|
}),
|
|
213
|
+
'defender-exclusion': core_1.Flags.option({
|
|
214
|
+
options: ['checked', 'unchecked', 'hidden'],
|
|
215
|
+
})({
|
|
216
|
+
default: 'checked',
|
|
217
|
+
description: 'there is no way to set a hidden checkbox with "true" as a default...the user can always allow full security',
|
|
218
|
+
summary: `set to "checked" or "unchecked" to set the default value for the checkbox. Set to "hidden" to hide the option (will let defender do its thing)`,
|
|
219
|
+
}),
|
|
214
220
|
root: core_1.Flags.string({
|
|
215
221
|
char: 'r',
|
|
216
222
|
default: '.',
|
|
@@ -231,9 +237,9 @@ the CLI should already exist in a directory named after the CLI that is the root
|
|
|
231
237
|
const { flags } = await this.parse(PackWin);
|
|
232
238
|
const buildConfig = await Tarballs.buildConfig(flags.root, { targets: flags?.targets?.split(',') });
|
|
233
239
|
const { config } = buildConfig;
|
|
234
|
-
await Tarballs.build(buildConfig, { pack: false, parallel: true, platform: 'win32', tarball: flags.tarball });
|
|
235
|
-
const arches = buildConfig.targets.filter((t) => t.platform === 'win32').map((t) => t.arch);
|
|
236
240
|
const nsisCustomization = config.nsisCustomization ? (0, node_fs_1.readFileSync)(config.nsisCustomization, 'utf8') : '';
|
|
241
|
+
const arches = buildConfig.targets.filter((t) => t.platform === 'win32').map((t) => t.arch);
|
|
242
|
+
await Tarballs.build(buildConfig, { pack: false, parallel: true, platform: 'win32', tarball: flags.tarball });
|
|
237
243
|
await Promise.all(arches.map(async (arch) => {
|
|
238
244
|
const installerBase = path.join(buildConfig.tmp, `windows-${arch}-installer`);
|
|
239
245
|
await (0, promises_1.rm)(installerBase, { force: true, recursive: true });
|
|
@@ -241,7 +247,14 @@ the CLI should already exist in a directory named after the CLI that is the root
|
|
|
241
247
|
await Promise.all([
|
|
242
248
|
(0, promises_1.writeFile)(path.join(installerBase, 'bin', `${config.bin}.cmd`), scripts.cmd(config)),
|
|
243
249
|
(0, promises_1.writeFile)(path.join(installerBase, 'bin', `${config.bin}`), scripts.sh(config)),
|
|
244
|
-
(0, promises_1.writeFile)(path.join(installerBase, `${config.bin}.nsi`), scripts.nsis(
|
|
250
|
+
(0, promises_1.writeFile)(path.join(installerBase, `${config.bin}.nsi`), scripts.nsis({
|
|
251
|
+
arch,
|
|
252
|
+
config,
|
|
253
|
+
customization: nsisCustomization,
|
|
254
|
+
// hiding it also unchecks it
|
|
255
|
+
defenderOptionDefault: flags['defender-exclusion'] === 'hidden' ? false : flags['default-defender-exclusion'],
|
|
256
|
+
hideDefenderOption: flags['hide-defender-option'] === 'hidden',
|
|
257
|
+
})),
|
|
245
258
|
...(config.binAliases
|
|
246
259
|
? config.binAliases.flatMap((alias) =>
|
|
247
260
|
// write duplicate files for windows aliases
|
package/oclif.manifest.json
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"hasDynamicHelp": false,
|
|
22
|
+
"hiddenAliases": [],
|
|
22
23
|
"id": "generate",
|
|
23
24
|
"pluginAlias": "oclif",
|
|
24
25
|
"pluginName": "oclif",
|
|
@@ -37,6 +38,7 @@
|
|
|
37
38
|
"description": "Using oclif.lock allows your plugins dependencies to be locked to the version specified in the lock file during plugin install.\nOnce the oclif.lock file is created you can include it your npm package by adding it to the files property of your package.json. We do not recommend committing the oclif.lock file to git.",
|
|
38
39
|
"flags": {},
|
|
39
40
|
"hasDynamicHelp": false,
|
|
41
|
+
"hiddenAliases": [],
|
|
40
42
|
"id": "lock",
|
|
41
43
|
"pluginAlias": "oclif",
|
|
42
44
|
"pluginName": "oclif",
|
|
@@ -70,6 +72,7 @@
|
|
|
70
72
|
}
|
|
71
73
|
},
|
|
72
74
|
"hasDynamicHelp": false,
|
|
75
|
+
"hiddenAliases": [],
|
|
73
76
|
"id": "manifest",
|
|
74
77
|
"pluginAlias": "oclif",
|
|
75
78
|
"pluginName": "oclif",
|
|
@@ -175,6 +178,7 @@
|
|
|
175
178
|
}
|
|
176
179
|
},
|
|
177
180
|
"hasDynamicHelp": false,
|
|
181
|
+
"hiddenAliases": [],
|
|
178
182
|
"id": "promote",
|
|
179
183
|
"pluginAlias": "oclif",
|
|
180
184
|
"pluginName": "oclif",
|
|
@@ -230,6 +234,7 @@
|
|
|
230
234
|
}
|
|
231
235
|
},
|
|
232
236
|
"hasDynamicHelp": false,
|
|
237
|
+
"hiddenAliases": [],
|
|
233
238
|
"id": "readme",
|
|
234
239
|
"pluginAlias": "oclif",
|
|
235
240
|
"pluginName": "oclif",
|
|
@@ -262,6 +267,7 @@
|
|
|
262
267
|
}
|
|
263
268
|
},
|
|
264
269
|
"hasDynamicHelp": false,
|
|
270
|
+
"hiddenAliases": [],
|
|
265
271
|
"id": "generate:command",
|
|
266
272
|
"pluginAlias": "oclif",
|
|
267
273
|
"pluginName": "oclif",
|
|
@@ -302,6 +308,7 @@
|
|
|
302
308
|
}
|
|
303
309
|
},
|
|
304
310
|
"hasDynamicHelp": false,
|
|
311
|
+
"hiddenAliases": [],
|
|
305
312
|
"id": "generate:hook",
|
|
306
313
|
"pluginAlias": "oclif",
|
|
307
314
|
"pluginName": "oclif",
|
|
@@ -341,6 +348,7 @@
|
|
|
341
348
|
}
|
|
342
349
|
},
|
|
343
350
|
"hasDynamicHelp": false,
|
|
351
|
+
"hiddenAliases": [],
|
|
344
352
|
"id": "pack:deb",
|
|
345
353
|
"pluginAlias": "oclif",
|
|
346
354
|
"pluginName": "oclif",
|
|
@@ -396,6 +404,7 @@
|
|
|
396
404
|
}
|
|
397
405
|
},
|
|
398
406
|
"hasDynamicHelp": false,
|
|
407
|
+
"hiddenAliases": [],
|
|
399
408
|
"id": "pack:macos",
|
|
400
409
|
"pluginAlias": "oclif",
|
|
401
410
|
"pluginName": "oclif",
|
|
@@ -456,6 +465,7 @@
|
|
|
456
465
|
}
|
|
457
466
|
},
|
|
458
467
|
"hasDynamicHelp": false,
|
|
468
|
+
"hiddenAliases": [],
|
|
459
469
|
"id": "pack:tarballs",
|
|
460
470
|
"pluginAlias": "oclif",
|
|
461
471
|
"pluginName": "oclif",
|
|
@@ -483,6 +493,20 @@
|
|
|
483
493
|
"multiple": false,
|
|
484
494
|
"type": "option"
|
|
485
495
|
},
|
|
496
|
+
"defender-exclusion": {
|
|
497
|
+
"description": "there is no way to set a hidden checkbox with \"true\" as a default...the user can always allow full security",
|
|
498
|
+
"name": "defender-exclusion",
|
|
499
|
+
"summary": "set to \"checked\" or \"unchecked\" to set the default value for the checkbox. Set to \"hidden\" to hide the option (will let defender do its thing)",
|
|
500
|
+
"default": "checked",
|
|
501
|
+
"hasDynamicHelp": false,
|
|
502
|
+
"multiple": false,
|
|
503
|
+
"options": [
|
|
504
|
+
"checked",
|
|
505
|
+
"unchecked",
|
|
506
|
+
"hidden"
|
|
507
|
+
],
|
|
508
|
+
"type": "option"
|
|
509
|
+
},
|
|
486
510
|
"root": {
|
|
487
511
|
"char": "r",
|
|
488
512
|
"description": "path to oclif CLI root",
|
|
@@ -511,6 +535,7 @@
|
|
|
511
535
|
}
|
|
512
536
|
},
|
|
513
537
|
"hasDynamicHelp": false,
|
|
538
|
+
"hiddenAliases": [],
|
|
514
539
|
"id": "pack:win",
|
|
515
540
|
"pluginAlias": "oclif",
|
|
516
541
|
"pluginName": "oclif",
|
|
@@ -542,6 +567,7 @@
|
|
|
542
567
|
}
|
|
543
568
|
},
|
|
544
569
|
"hasDynamicHelp": false,
|
|
570
|
+
"hiddenAliases": [],
|
|
545
571
|
"id": "upload:deb",
|
|
546
572
|
"pluginAlias": "oclif",
|
|
547
573
|
"pluginName": "oclif",
|
|
@@ -581,6 +607,7 @@
|
|
|
581
607
|
}
|
|
582
608
|
},
|
|
583
609
|
"hasDynamicHelp": false,
|
|
610
|
+
"hiddenAliases": [],
|
|
584
611
|
"id": "upload:macos",
|
|
585
612
|
"pluginAlias": "oclif",
|
|
586
613
|
"pluginName": "oclif",
|
|
@@ -626,6 +653,7 @@
|
|
|
626
653
|
}
|
|
627
654
|
},
|
|
628
655
|
"hasDynamicHelp": false,
|
|
656
|
+
"hiddenAliases": [],
|
|
629
657
|
"id": "upload:tarballs",
|
|
630
658
|
"pluginAlias": "oclif",
|
|
631
659
|
"pluginName": "oclif",
|
|
@@ -664,6 +692,7 @@
|
|
|
664
692
|
}
|
|
665
693
|
},
|
|
666
694
|
"hasDynamicHelp": false,
|
|
695
|
+
"hiddenAliases": [],
|
|
667
696
|
"id": "upload:win",
|
|
668
697
|
"pluginAlias": "oclif",
|
|
669
698
|
"pluginName": "oclif",
|
|
@@ -679,5 +708,5 @@
|
|
|
679
708
|
]
|
|
680
709
|
}
|
|
681
710
|
},
|
|
682
|
-
"version": "4.0.
|
|
711
|
+
"version": "4.0.4"
|
|
683
712
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oclif",
|
|
3
3
|
"description": "oclif: create your own CLI",
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.0.4",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bin": {
|
|
7
7
|
"oclif": "bin/run.js"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"@oclif/core": "^3.0.4",
|
|
12
12
|
"@oclif/plugin-help": "^5.2.14",
|
|
13
13
|
"@oclif/plugin-not-found": "^2.3.32",
|
|
14
|
-
"@oclif/plugin-warn-if-update-available": "^
|
|
14
|
+
"@oclif/plugin-warn-if-update-available": "^3.0.0",
|
|
15
15
|
"async-retry": "^1.3.3",
|
|
16
16
|
"aws-sdk": "^2.1231.0",
|
|
17
17
|
"change-case": "^4",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"@commitlint/config-conventional": "^17.7.0",
|
|
32
32
|
"@oclif/plugin-legacy": "^1.3.0",
|
|
33
33
|
"@oclif/prettier-config": "^0.2.1",
|
|
34
|
-
"@oclif/test": "^3.
|
|
34
|
+
"@oclif/test": "^3.1.2",
|
|
35
35
|
"@types/async-retry": "^1.4.5",
|
|
36
36
|
"@types/chai": "^4.3.4",
|
|
37
37
|
"@types/cli-progress": "^3.11.0",
|
|
38
38
|
"@types/fs-extra": "^9.0",
|
|
39
|
-
"@types/lodash.template": "^4.5.0",
|
|
40
39
|
"@types/lodash": "^4.14.191",
|
|
40
|
+
"@types/lodash.template": "^4.5.0",
|
|
41
41
|
"@types/mocha": "^10.0.2",
|
|
42
42
|
"@types/node": "^18",
|
|
43
43
|
"@types/semver": "^7.3.13",
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
"chai": "^4.3.7",
|
|
47
47
|
"commitlint": "^17.7.2",
|
|
48
48
|
"conventional-changelog-cli": "^2.2.2",
|
|
49
|
-
"eslint
|
|
49
|
+
"eslint": "^8.50.0",
|
|
50
50
|
"eslint-config-oclif": "^5.0.0",
|
|
51
|
+
"eslint-config-oclif-typescript": "^3.0.1",
|
|
51
52
|
"eslint-config-prettier": "^9.0.0",
|
|
52
|
-
"eslint": "^8.50.0",
|
|
53
53
|
"fancy-test": "^3.0.1",
|
|
54
54
|
"globby": "^11.1.0",
|
|
55
55
|
"husky": "^8.0.3",
|