oclif 3.13.1 → 3.15.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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.13.1",
2
+ "version": "3.15.0",
3
3
  "commands": {
4
4
  "generate": {
5
5
  "id": "generate",
@@ -18,6 +18,18 @@
18
18
  }
19
19
  }
20
20
  },
21
+ "lock": {
22
+ "id": "lock",
23
+ "summary": "Copy the yarn.lock to oclif.lock",
24
+ "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.",
25
+ "strict": true,
26
+ "pluginName": "oclif",
27
+ "pluginAlias": "oclif",
28
+ "pluginType": "core",
29
+ "aliases": [],
30
+ "flags": {},
31
+ "args": {}
32
+ },
21
33
  "manifest": {
22
34
  "id": "manifest",
23
35
  "description": "generates plugin manifest json",
@@ -371,6 +383,12 @@
371
383
  "description": "optionally specify a path to a tarball already generated by NPM",
372
384
  "required": false,
373
385
  "multiple": false
386
+ },
387
+ "targets": {
388
+ "name": "targets",
389
+ "type": "option",
390
+ "description": "comma-separated targets to pack (e.g.: win32-x64,win32-x86)",
391
+ "multiple": false
374
392
  }
375
393
  },
376
394
  "args": {}
@@ -475,6 +493,12 @@
475
493
  "required": true,
476
494
  "multiple": false,
477
495
  "default": "."
496
+ },
497
+ "targets": {
498
+ "name": "targets",
499
+ "type": "option",
500
+ "description": "comma-separated targets to pack (e.g.: win32-x64,win32-x86)",
501
+ "multiple": false
478
502
  }
479
503
  },
480
504
  "args": {}
@@ -0,0 +1,4 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class Lock extends Command {
3
+ run(): Promise<void>;
4
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const core_1 = require("@oclif/core");
5
+ const fs = require("node:fs/promises");
6
+ const fileExists = async (path) => {
7
+ try {
8
+ await fs.access(path);
9
+ return true;
10
+ }
11
+ catch (_b) {
12
+ return false;
13
+ }
14
+ };
15
+ class Lock extends core_1.Command {
16
+ async run() {
17
+ if (await fileExists('yarn.lock')) {
18
+ this.log('Copying yarn.lock to oclif.lock');
19
+ await fs.copyFile('yarn.lock', 'oclif.lock');
20
+ }
21
+ else {
22
+ throw this.error('yarn.lock does not exist');
23
+ }
24
+ }
25
+ }
26
+ exports.default = Lock;
27
+ _a = Lock;
28
+ (() => {
29
+ _a.summary = 'Copy the yarn.lock to oclif.lock';
30
+ _a.description = `Using oclif.lock allows your plugins dependencies to be locked to the version specified in the lock file during plugin install.
31
+ Once 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.`;
32
+ })();
@@ -5,6 +5,7 @@ export default class PackWin extends Command {
5
5
  root: Interfaces.OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
6
6
  'additional-cli': Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
7
7
  tarball: Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
+ targets: Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
9
  };
9
10
  run(): Promise<void>;
10
11
  private checkForNSIS;
@@ -201,9 +201,10 @@ FunctionEnd
201
201
  };
202
202
  class PackWin extends core_1.Command {
203
203
  async run() {
204
+ var _a;
204
205
  await this.checkForNSIS();
205
206
  const { flags } = await this.parse(PackWin);
206
- const buildConfig = await Tarballs.buildConfig(flags.root);
207
+ const buildConfig = await Tarballs.buildConfig(flags.root, { targets: (_a = flags === null || flags === void 0 ? void 0 : flags.targets) === null || _a === void 0 ? void 0 : _a.split(',') });
207
208
  const { config } = buildConfig;
208
209
  await Tarballs.build(buildConfig, { platform: 'win32', pack: false, tarball: flags.tarball, parallel: true });
209
210
  const arches = buildConfig.targets.filter(t => t.platform === 'win32').map(t => t.arch);
@@ -273,6 +274,9 @@ the CLI should already exist in a directory named after the CLI that is the root
273
274
  description: 'optionally specify a path to a tarball already generated by NPM',
274
275
  required: false,
275
276
  }),
277
+ targets: core_1.Flags.string({
278
+ description: 'comma-separated targets to pack (e.g.: win32-x64,win32-x86)',
279
+ }),
276
280
  };
277
281
  async function signWindows(o, arch, config, windows) {
278
282
  const buildLocationUnsigned = o.replace(`${arch}.exe`, `${arch}-unsigned.exe`);
@@ -3,6 +3,7 @@ export default class UploadWin extends Command {
3
3
  static description: string;
4
4
  static flags: {
5
5
  root: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
6
+ targets: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
6
7
  };
7
8
  run(): Promise<void>;
8
9
  }
@@ -8,8 +8,9 @@ const Tarballs = require("../../tarballs");
8
8
  const upload_util_1 = require("../../upload-util");
9
9
  class UploadWin extends core_1.Command {
10
10
  async run() {
11
+ var _a;
11
12
  const { flags } = await this.parse(UploadWin);
12
- const buildConfig = await Tarballs.buildConfig(flags.root);
13
+ const buildConfig = await Tarballs.buildConfig(flags.root, { targets: (_a = flags === null || flags === void 0 ? void 0 : flags.targets) === null || _a === void 0 ? void 0 : _a.split(',') });
13
14
  const { s3Config, config, dist } = buildConfig;
14
15
  const S3Options = {
15
16
  Bucket: s3Config.bucket,
@@ -40,4 +41,5 @@ exports.default = UploadWin;
40
41
  UploadWin.description = 'upload windows installers built with pack:win';
41
42
  UploadWin.flags = {
42
43
  root: core_1.Flags.string({ char: 'r', description: 'path to oclif CLI root', default: '.', required: true }),
44
+ targets: core_1.Flags.string({ description: 'comma-separated targets to pack (e.g.: win32-x64,win32-x86)' }),
43
45
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "oclif",
3
3
  "description": "oclif: create your own CLI",
4
- "version": "3.13.1",
4
+ "version": "3.15.0",
5
5
  "author": "Salesforce",
6
6
  "bin": {
7
7
  "oclif": "bin/run"