oclif 4.20.8 → 4.21.1

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.
@@ -5,6 +5,7 @@ export default class PackDeb extends Command {
5
5
  compression: Interfaces.OptionFlag<"xz" | "none" | "gzip" | "zstd" | undefined, Interfaces.CustomOptions>;
6
6
  'prune-lockfiles': Interfaces.BooleanFlag<boolean>;
7
7
  root: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
8
+ sha: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
8
9
  tarball: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
9
10
  };
10
11
  static summary: string;
@@ -95,6 +95,10 @@ class PackDeb extends core_1.Command {
95
95
  }),
96
96
  'prune-lockfiles': core_1.Flags.boolean({ description: 'remove lockfiles in the tarball.', exclusive: ['tarball'] }),
97
97
  root: core_1.Flags.string({ char: 'r', default: '.', description: 'Path to oclif CLI root.', required: true }),
98
+ sha: core_1.Flags.string({
99
+ description: '7-digit short git commit SHA (defaults to current checked out commit).',
100
+ required: false,
101
+ }),
98
102
  tarball: core_1.Flags.string({
99
103
  char: 't',
100
104
  description: 'Optionally specify a path to a tarball already generated by NPM.',
@@ -107,7 +111,7 @@ class PackDeb extends core_1.Command {
107
111
  if (process.platform !== 'linux')
108
112
  throw new Error('debian packing must be run on linux');
109
113
  const { flags } = await this.parse(PackDeb);
110
- const buildConfig = await Tarballs.buildConfig(flags.root);
114
+ const buildConfig = await Tarballs.buildConfig(flags.root, { sha: flags?.sha });
111
115
  const { config } = buildConfig;
112
116
  await Tarballs.build(buildConfig, {
113
117
  pack: false,
@@ -5,6 +5,7 @@ export default class PackMacos extends Command {
5
5
  'additional-cli': Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
6
6
  'prune-lockfiles': Interfaces.BooleanFlag<boolean>;
7
7
  root: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
8
+ sha: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
8
9
  tarball: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
9
10
  targets: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
10
11
  };
@@ -177,6 +177,10 @@ the CLI should already exist in a directory named after the CLI that is the root
177
177
  description: 'Path to oclif CLI root.',
178
178
  required: true,
179
179
  }),
180
+ sha: core_1.Flags.string({
181
+ description: '7-digit short git commit SHA (defaults to current checked out commit).',
182
+ required: false,
183
+ }),
180
184
  tarball: core_1.Flags.string({
181
185
  char: 't',
182
186
  description: 'Optionally specify a path to a tarball already generated by NPM.',
@@ -192,7 +196,7 @@ the CLI should already exist in a directory named after the CLI that is the root
192
196
  if (process.platform !== 'darwin')
193
197
  this.error('must be run from macos');
194
198
  const { flags } = await this.parse(PackMacos);
195
- const buildConfig = await Tarballs.buildConfig(flags.root, { targets: flags?.targets?.split(',') });
199
+ const buildConfig = await Tarballs.buildConfig(flags.root, { sha: flags?.sha, targets: flags?.targets?.split(',') });
196
200
  const { config } = buildConfig;
197
201
  const c = config.pjson.oclif;
198
202
  if (!c.macos)
@@ -5,6 +5,7 @@ export default class PackTarballs extends Command {
5
5
  parallel: import("@oclif/core/interfaces").BooleanFlag<boolean>;
6
6
  'prune-lockfiles': import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
7
  root: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
+ sha: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
9
  tarball: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
10
  targets: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
11
  xz: import("@oclif/core/interfaces").BooleanFlag<boolean>;
@@ -43,6 +43,10 @@ Add a pretarball script to your package.json if you need to run any scripts befo
43
43
  parallel: core_1.Flags.boolean({ description: 'Build tarballs in parallel.' }),
44
44
  'prune-lockfiles': core_1.Flags.boolean({ description: 'remove lockfiles in the tarball.' }),
45
45
  root: core_1.Flags.string({ char: 'r', default: '.', description: 'Path to oclif CLI root.', required: true }),
46
+ sha: core_1.Flags.string({
47
+ description: '7-digit short git commit SHA (defaults to current checked out commit).',
48
+ required: false,
49
+ }),
46
50
  tarball: core_1.Flags.string({
47
51
  char: 'l',
48
52
  description: 'Optionally specify a path to a tarball already generated by NPM.',
@@ -54,7 +58,11 @@ Add a pretarball script to your package.json if you need to run any scripts befo
54
58
  static summary = 'Package oclif CLI into tarballs.';
55
59
  async run() {
56
60
  const { flags } = await this.parse(PackTarballs);
57
- const buildConfig = await Tarballs.buildConfig(flags.root, { targets: flags?.targets?.split(','), xz: flags.xz });
61
+ const buildConfig = await Tarballs.buildConfig(flags.root, {
62
+ sha: flags?.sha,
63
+ targets: flags?.targets?.split(','),
64
+ xz: flags.xz,
65
+ });
58
66
  if (buildConfig.targets.length === 0) {
59
67
  throw new Error('Please specify one or more valid targets.');
60
68
  }
@@ -6,6 +6,7 @@ export default class PackWin extends Command {
6
6
  'defender-exclusion': Interfaces.OptionFlag<"hidden" | "checked" | "unchecked", Interfaces.CustomOptions>;
7
7
  'prune-lockfiles': Interfaces.BooleanFlag<boolean>;
8
8
  root: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
9
+ sha: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
9
10
  tarball: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
10
11
  targets: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
11
12
  };
@@ -262,6 +262,10 @@ the CLI should already exist in a directory named after the CLI that is the root
262
262
  description: 'Path to oclif CLI root.',
263
263
  required: true,
264
264
  }),
265
+ sha: core_1.Flags.string({
266
+ description: '7-digit short git commit SHA (defaults to current checked out commit).',
267
+ required: false,
268
+ }),
265
269
  tarball: core_1.Flags.string({
266
270
  char: 't',
267
271
  description: 'Optionally specify a path to a tarball already generated by NPM.',
@@ -276,7 +280,7 @@ the CLI should already exist in a directory named after the CLI that is the root
276
280
  async run() {
277
281
  await this.checkForNSIS();
278
282
  const { flags } = await this.parse(PackWin);
279
- const buildConfig = await Tarballs.buildConfig(flags.root, { targets: flags?.targets?.split(',') });
283
+ const buildConfig = await Tarballs.buildConfig(flags.root, { sha: flags?.sha, targets: flags?.targets?.split(',') });
280
284
  const { config } = buildConfig;
281
285
  const nsisCustomization = config.nsisCustomization ? (0, node_fs_1.readFileSync)(config.nsisCustomization, 'utf8') : '';
282
286
  const arches = buildConfig.targets.filter((t) => t.platform === 'win32').map((t) => t.arch);
@@ -4,6 +4,7 @@ export default class UploadDeb extends Command {
4
4
  static flags: {
5
5
  'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
6
6
  root: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
7
+ sha: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
8
  };
8
9
  run(): Promise<void>;
9
10
  }
@@ -48,10 +48,14 @@ class UploadDeb extends core_1.Command {
48
48
  static flags = {
49
49
  'dry-run': core_1.Flags.boolean({ description: 'Run the command without uploading to S3.' }),
50
50
  root: core_1.Flags.string({ char: 'r', default: '.', description: 'Path to oclif CLI root.', required: true }),
51
+ sha: core_1.Flags.string({
52
+ description: '7-digit short git commit SHA (defaults to current checked out commit).',
53
+ required: false,
54
+ }),
51
55
  };
52
56
  async run() {
53
57
  const { flags } = await this.parse(UploadDeb);
54
- const buildConfig = await Tarballs.buildConfig(flags.root);
58
+ const buildConfig = await Tarballs.buildConfig(flags.root, { sha: flags?.sha });
55
59
  const { config, s3Config } = buildConfig;
56
60
  const dist = (f) => buildConfig.dist(node_path_1.default.join('deb', f));
57
61
  const S3Options = {
@@ -4,6 +4,7 @@ export default class UploadMacos extends Command {
4
4
  static flags: {
5
5
  'dry-run': Interfaces.BooleanFlag<boolean>;
6
6
  root: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
7
+ sha: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
7
8
  targets: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
8
9
  };
9
10
  run(): Promise<void>;
@@ -48,6 +48,10 @@ class UploadMacos extends core_1.Command {
48
48
  static flags = {
49
49
  'dry-run': core_1.Flags.boolean({ description: 'Run the command without uploading to S3.' }),
50
50
  root: core_1.Flags.string({ char: 'r', default: '.', description: 'Path to oclif CLI root.', required: true }),
51
+ sha: core_1.Flags.string({
52
+ description: '7-digit short git commit SHA (defaults to current checked out commit).',
53
+ required: false,
54
+ }),
51
55
  targets: core_1.Flags.string({
52
56
  char: 't',
53
57
  description: 'Comma-separated targets to upload (e.g.: darwin-x64,darwin-arm64).',
@@ -55,7 +59,7 @@ class UploadMacos extends core_1.Command {
55
59
  };
56
60
  async run() {
57
61
  const { flags } = await this.parse(UploadMacos);
58
- const buildConfig = await Tarballs.buildConfig(flags.root, { targets: flags?.targets?.split(',') });
62
+ const buildConfig = await Tarballs.buildConfig(flags.root, { sha: flags?.sha, targets: flags?.targets?.split(',') });
59
63
  const { config, dist, s3Config } = buildConfig;
60
64
  const S3Options = {
61
65
  ACL: s3Config.acl || 'public-read',
@@ -4,6 +4,7 @@ export default class UploadTarballs extends Command {
4
4
  static flags: {
5
5
  'dry-run': Interfaces.BooleanFlag<boolean>;
6
6
  root: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
7
+ sha: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
7
8
  targets: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
8
9
  xz: Interfaces.BooleanFlag<boolean>;
9
10
  };
@@ -47,6 +47,10 @@ class UploadTarballs extends core_1.Command {
47
47
  static flags = {
48
48
  'dry-run': core_1.Flags.boolean({ description: 'Run the command without uploading to S3.' }),
49
49
  root: core_1.Flags.string({ char: 'r', default: '.', description: 'Path to oclif CLI root.', required: true }),
50
+ sha: core_1.Flags.string({
51
+ description: '7-digit short git commit SHA (defaults to current checked out commit).',
52
+ required: false,
53
+ }),
50
54
  targets: core_1.Flags.string({ char: 't', description: 'Comma-separated targets to upload (e.g.: linux-arm,win32-x64).' }),
51
55
  xz: core_1.Flags.boolean({ allowNo: true, description: 'Also upload xz.' }),
52
56
  };
@@ -54,7 +58,11 @@ class UploadTarballs extends core_1.Command {
54
58
  const { flags } = await this.parse(UploadTarballs);
55
59
  if (process.platform === 'win32')
56
60
  throw new Error('upload does not function on windows');
57
- const buildConfig = await Tarballs.buildConfig(flags.root, { targets: flags?.targets?.split(','), xz: flags.xz });
61
+ const buildConfig = await Tarballs.buildConfig(flags.root, {
62
+ sha: flags?.sha,
63
+ targets: flags?.targets?.split(','),
64
+ xz: flags.xz,
65
+ });
58
66
  const { config, dist, s3Config, xz } = buildConfig;
59
67
  // fail early if targets are not built
60
68
  for (const target of buildConfig.targets) {
@@ -4,6 +4,7 @@ export default class UploadWin extends Command {
4
4
  static flags: {
5
5
  'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
6
6
  root: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
7
+ sha: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
8
  targets: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
9
  };
9
10
  run(): Promise<void>;
@@ -47,11 +47,15 @@ class UploadWin extends core_1.Command {
47
47
  static flags = {
48
48
  'dry-run': core_1.Flags.boolean({ description: 'Run the command without uploading to S3.' }),
49
49
  root: core_1.Flags.string({ char: 'r', default: '.', description: 'Path to oclif CLI root.', required: true }),
50
+ sha: core_1.Flags.string({
51
+ description: '7-digit short git commit SHA (defaults to current checked out commit).',
52
+ required: false,
53
+ }),
50
54
  targets: core_1.Flags.string({ description: 'Comma-separated targets to pack (e.g.: win32-x64,win32-x86,win32-arm64).' }),
51
55
  };
52
56
  async run() {
53
57
  const { flags } = await this.parse(UploadWin);
54
- const buildConfig = await Tarballs.buildConfig(flags.root, { targets: flags?.targets?.split(',') });
58
+ const buildConfig = await Tarballs.buildConfig(flags.root, { sha: flags?.sha, targets: flags?.targets?.split(',') });
55
59
  const { config, dist, s3Config } = buildConfig;
56
60
  const S3Options = {
57
61
  ACL: s3Config.acl || 'public-read',
@@ -38,6 +38,7 @@ export declare function gitSha(cwd: string, options?: {
38
38
  short?: boolean;
39
39
  }): Promise<string>;
40
40
  export declare function buildConfig(root: string, options?: {
41
+ sha?: string;
41
42
  targets?: string[];
42
43
  xz?: boolean;
43
44
  }): Promise<BuildConfig>;
@@ -72,7 +72,7 @@ async function Tmp(config) {
72
72
  async function buildConfig(root, options = {}) {
73
73
  const config = await core_1.Config.load({ devPlugins: false, root: node_path_1.default.resolve(root), userPlugins: false });
74
74
  root = config.root;
75
- const _gitSha = await gitSha(root, { short: true });
75
+ const _gitSha = options.sha ?? (await gitSha(root, { short: true }));
76
76
  // eslint-disable-next-line new-cap
77
77
  const tmp = await Tmp(config);
78
78
  const updateConfig = (config.pjson.oclif.update || {});
@@ -699,6 +699,14 @@
699
699
  "multiple": false,
700
700
  "type": "option"
701
701
  },
702
+ "sha": {
703
+ "description": "7-digit short git commit SHA (defaults to current checked out commit).",
704
+ "name": "sha",
705
+ "required": false,
706
+ "hasDynamicHelp": false,
707
+ "multiple": false,
708
+ "type": "option"
709
+ },
702
710
  "tarball": {
703
711
  "char": "t",
704
712
  "description": "Optionally specify a path to a tarball already generated by NPM.",
@@ -761,6 +769,14 @@
761
769
  "multiple": false,
762
770
  "type": "option"
763
771
  },
772
+ "sha": {
773
+ "description": "7-digit short git commit SHA (defaults to current checked out commit).",
774
+ "name": "sha",
775
+ "required": false,
776
+ "hasDynamicHelp": false,
777
+ "multiple": false,
778
+ "type": "option"
779
+ },
764
780
  "tarball": {
765
781
  "char": "t",
766
782
  "description": "Optionally specify a path to a tarball already generated by NPM.",
@@ -825,6 +841,14 @@
825
841
  "multiple": false,
826
842
  "type": "option"
827
843
  },
844
+ "sha": {
845
+ "description": "7-digit short git commit SHA (defaults to current checked out commit).",
846
+ "name": "sha",
847
+ "required": false,
848
+ "hasDynamicHelp": false,
849
+ "multiple": false,
850
+ "type": "option"
851
+ },
828
852
  "tarball": {
829
853
  "char": "l",
830
854
  "description": "Optionally specify a path to a tarball already generated by NPM.",
@@ -912,6 +936,14 @@
912
936
  "multiple": false,
913
937
  "type": "option"
914
938
  },
939
+ "sha": {
940
+ "description": "7-digit short git commit SHA (defaults to current checked out commit).",
941
+ "name": "sha",
942
+ "required": false,
943
+ "hasDynamicHelp": false,
944
+ "multiple": false,
945
+ "type": "option"
946
+ },
915
947
  "tarball": {
916
948
  "char": "t",
917
949
  "description": "Optionally specify a path to a tarball already generated by NPM.",
@@ -969,6 +1001,14 @@
969
1001
  "hasDynamicHelp": false,
970
1002
  "multiple": false,
971
1003
  "type": "option"
1004
+ },
1005
+ "sha": {
1006
+ "description": "7-digit short git commit SHA (defaults to current checked out commit).",
1007
+ "name": "sha",
1008
+ "required": false,
1009
+ "hasDynamicHelp": false,
1010
+ "multiple": false,
1011
+ "type": "option"
972
1012
  }
973
1013
  },
974
1014
  "hasDynamicHelp": false,
@@ -1008,6 +1048,14 @@
1008
1048
  "multiple": false,
1009
1049
  "type": "option"
1010
1050
  },
1051
+ "sha": {
1052
+ "description": "7-digit short git commit SHA (defaults to current checked out commit).",
1053
+ "name": "sha",
1054
+ "required": false,
1055
+ "hasDynamicHelp": false,
1056
+ "multiple": false,
1057
+ "type": "option"
1058
+ },
1011
1059
  "targets": {
1012
1060
  "char": "t",
1013
1061
  "description": "Comma-separated targets to upload (e.g.: darwin-x64,darwin-arm64).",
@@ -1054,6 +1102,14 @@
1054
1102
  "multiple": false,
1055
1103
  "type": "option"
1056
1104
  },
1105
+ "sha": {
1106
+ "description": "7-digit short git commit SHA (defaults to current checked out commit).",
1107
+ "name": "sha",
1108
+ "required": false,
1109
+ "hasDynamicHelp": false,
1110
+ "multiple": false,
1111
+ "type": "option"
1112
+ },
1057
1113
  "targets": {
1058
1114
  "char": "t",
1059
1115
  "description": "Comma-separated targets to upload (e.g.: linux-arm,win32-x64).",
@@ -1106,6 +1162,14 @@
1106
1162
  "multiple": false,
1107
1163
  "type": "option"
1108
1164
  },
1165
+ "sha": {
1166
+ "description": "7-digit short git commit SHA (defaults to current checked out commit).",
1167
+ "name": "sha",
1168
+ "required": false,
1169
+ "hasDynamicHelp": false,
1170
+ "multiple": false,
1171
+ "type": "option"
1172
+ },
1109
1173
  "targets": {
1110
1174
  "description": "Comma-separated targets to pack (e.g.: win32-x64,win32-x86,win32-arm64).",
1111
1175
  "name": "targets",
@@ -1131,5 +1195,5 @@
1131
1195
  ]
1132
1196
  }
1133
1197
  },
1134
- "version": "4.20.8"
1198
+ "version": "4.21.1"
1135
1199
  }
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.20.8",
4
+ "version": "4.21.1",
5
5
  "author": "Salesforce",
6
6
  "bin": {
7
7
  "oclif": "bin/run.js"
@@ -16,7 +16,7 @@
16
16
  "@oclif/core": "^4.5.1",
17
17
  "@oclif/plugin-help": "^6.2.29",
18
18
  "@oclif/plugin-not-found": "^3.2.59",
19
- "@oclif/plugin-warn-if-update-available": "^3.1.42",
19
+ "@oclif/plugin-warn-if-update-available": "^3.1.44",
20
20
  "ansis": "^3.16.0",
21
21
  "async-retry": "^1.3.3",
22
22
  "change-case": "^4",