oclif 2.1.5 → 2.2.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/.oclif.manifest.json +1 -1
- package/CHANGELOG.md +28 -0
- package/README.md +15 -11
- package/lib/commands/pack/deb.d.ts +1 -0
- package/lib/commands/pack/deb.js +2 -1
- package/lib/commands/pack/macos.d.ts +1 -0
- package/lib/commands/pack/macos.js +2 -1
- package/lib/commands/pack/tarballs.d.ts +1 -0
- package/lib/commands/pack/tarballs.js +4 -1
- package/lib/commands/pack/win.d.ts +1 -0
- package/lib/commands/pack/win.js +2 -1
- package/lib/generators/cli.js +4 -8
- package/lib/tarballs/build.d.ts +1 -0
- package/lib/tarballs/build.js +1 -1
- package/package.json +1 -4
package/.oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"2.
|
|
1
|
+
{"version":"2.2.0","commands":{"generate":{"id":"generate","description":"generate a new CLI\nThis will clone the template repo 'oclif/hello-world' and update package properties","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"name","description":"directory name of new project","required":true}]},"manifest":{"id":"manifest","description":"generates plugin manifest json","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"path","description":"path to plugin","default":"."}]},"promote":{"id":"promote","description":"promote CLI builds to a S3 release channel","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to the oclif CLI project root","required":true,"multiple":false,"default":"."},"version":{"name":"version","type":"option","description":"semantic version of the CLI to promote","required":true,"multiple":false},"sha":{"name":"sha","type":"option","description":"7-digit short git commit SHA of the CLI to promote","required":true,"multiple":false},"channel":{"name":"channel","type":"option","description":"which channel to promote to","required":true,"multiple":false,"default":"stable"},"targets":{"name":"targets","type":"option","char":"t","description":"comma-separated targets to promote (e.g.: linux-arm,win32-x64)","multiple":false,"default":"linux-x64,linux-arm,win32-x64,win32-x86,darwin-x64,darwin-arm64"},"deb":{"name":"deb","type":"boolean","char":"d","description":"promote debian artifacts","allowNo":false},"macos":{"name":"macos","type":"boolean","char":"m","description":"promote macOS pkg","allowNo":false},"win":{"name":"win","type":"boolean","char":"w","description":"promote Windows exe","allowNo":false},"max-age":{"name":"max-age","type":"option","char":"a","description":"cache control max-age in seconds","multiple":false,"default":"86400"},"xz":{"name":"xz","type":"boolean","description":"also upload xz","allowNo":true},"indexes":{"name":"indexes","type":"boolean","description":"append the promoted urls into the index files","allowNo":false}},"args":[]},"readme":{"id":"readme","description":"adds commands to README.md in current directory\nThe readme must have any of the following tags inside of it for it to be replaced or else it will do nothing:\n# Usage\n<!-- usage -->\n# Commands\n<!-- commands -->\n\nCustomize the code URL prefix by setting oclif.repositoryPrefix in package.json.\n","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"dir":{"name":"dir","type":"option","description":"output directory for multi docs","required":true,"multiple":false,"default":"docs"},"multi":{"name":"multi","type":"boolean","description":"create a different markdown page for each topic","allowNo":false}},"args":[]},"generate:command":{"id":"generate:command","description":"add a command to an existing CLI or plugin","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"force":{"name":"force","type":"boolean","description":"overwrite existing files","allowNo":false}},"args":[{"name":"name","description":"name of command","required":true}]},"generate:hook":{"id":"generate:hook","description":"add a hook to an existing CLI or plugin","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"force":{"name":"force","type":"boolean","description":"overwrite existing files","allowNo":false},"event":{"name":"event","type":"option","description":"event to run hook on","multiple":false,"default":"init"}},"args":[{"name":"name","description":"name of hook (snake_case)","required":true}]},"pack:deb":{"id":"pack:deb","description":"pack CLI into debian package","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"multiple":false,"default":"."},"tarball":{"name":"tarball","type":"option","char":"t","description":"optionally specify a path to a tarball already generated by NPM","required":false,"multiple":false}},"args":[]},"pack:macos":{"id":"pack:macos","description":"pack CLI into macOS .pkg","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"multiple":false,"default":"."},"additional-cli":{"name":"additional-cli","type":"option","description":"an Oclif CLI other than the one listed in config.bin that should be made available to the user\nthe CLI should already exist in a directory named after the CLI that is the root of the tarball produced by \"oclif pack:tarballs\"","hidden":true,"multiple":false},"tarball":{"name":"tarball","type":"option","char":"t","description":"optionally specify a path to a tarball already generated by NPM","required":false,"multiple":false}},"args":[]},"pack:tarballs":{"id":"pack:tarballs","description":"packages oclif CLI into tarballs\n\nThis can be used to create oclif CLIs that use the system node or that come preloaded with a node binary.\n","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"multiple":false,"default":"."},"targets":{"name":"targets","type":"option","char":"t","description":"comma-separated targets to pack (e.g.: linux-arm,win32-x64)","multiple":false,"default":"linux-x64,linux-arm,win32-x64,win32-x86,darwin-x64,darwin-arm64"},"xz":{"name":"xz","type":"boolean","description":"also build xz","allowNo":true},"tarball":{"name":"tarball","type":"option","char":"t","description":"optionally specify a path to a tarball already generated by NPM","required":false,"multiple":false}},"args":[]},"pack:win":{"id":"pack:win","description":"create windows installer from oclif CLI\n\n This command requires WINDOWS_SIGNING (prefixed with the name of your executable, e.g. OCLIF_WINDOWS_SIGNING_PASS) to be set in the environment","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"multiple":false,"default":"."},"additional-cli":{"name":"additional-cli","type":"option","description":"an Oclif CLI other than the one listed in config.bin that should be made available to the user\nthe CLI should already exist in a directory named after the CLI that is the root of the tarball produced by \"oclif pack:tarballs\"","hidden":true,"multiple":false},"tarball":{"name":"tarball","type":"option","char":"t","description":"optionally specify a path to a tarball already generated by NPM","required":false,"multiple":false}},"args":[]},"upload:deb":{"id":"upload:deb","description":"upload deb package built with pack:deb","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"multiple":false,"default":"."}},"args":[]},"upload:macos":{"id":"upload:macos","description":"upload macos installers built with pack:macos","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"multiple":false,"default":"."}},"args":[]},"upload:tarballs":{"id":"upload:tarballs","description":"upload an oclif CLI to S3\n\n\"aws-sdk\" will need to be installed as a devDependency to upload.\n","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"multiple":false,"default":"."},"targets":{"name":"targets","type":"option","char":"t","description":"comma-separated targets to upload (e.g.: linux-arm,win32-x64)","multiple":false,"default":"linux-x64,linux-arm,win32-x64,win32-x86,darwin-x64,darwin-arm64"},"xz":{"name":"xz","type":"boolean","description":"also upload xz","allowNo":true}},"args":[]},"upload:win":{"id":"upload:win","description":"upload windows installers built with pack:win","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"multiple":false,"default":"."}},"args":[]}}}
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [2.2.0](https://github.com/oclif/oclif/compare/v2.1.8...v2.2.0) (2022-01-13)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* optionally include tarball path as input ([#764](https://github.com/oclif/oclif/issues/764)) ([#796](https://github.com/oclif/oclif/issues/796)) ([ee6ff99](https://github.com/oclif/oclif/commit/ee6ff99ad5e11cb1abe1de17791a8b987833e381))
|
|
11
|
+
|
|
12
|
+
### [2.1.8](https://github.com/oclif/oclif/compare/v2.1.7...v2.1.8) (2022-01-12)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* remove unnecessary dependency ([#794](https://github.com/oclif/oclif/issues/794)) ([f814f00](https://github.com/oclif/oclif/commit/f814f009b9b203c8917e265c16015a08af911537))
|
|
18
|
+
|
|
19
|
+
### [2.1.7](https://github.com/oclif/oclif/compare/v2.1.6...v2.1.7) (2022-01-11)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* correct package name ([#792](https://github.com/oclif/oclif/issues/792)) ([7197f98](https://github.com/oclif/oclif/commit/7197f98233d4391e4f322d16ff4a0cc92f7a4a6f))
|
|
25
|
+
|
|
26
|
+
### [2.1.6](https://github.com/oclif/oclif/compare/v2.1.5...v2.1.6) (2022-01-11)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Bug Fixes
|
|
30
|
+
|
|
31
|
+
* remove fixpack dependency ([#791](https://github.com/oclif/oclif/issues/791)) ([823300e](https://github.com/oclif/oclif/commit/823300e103bac560fd1e9e8748b33be59a80b066))
|
|
32
|
+
|
|
5
33
|
### [2.1.5](https://github.com/oclif/oclif/compare/v2.1.4...v2.1.5) (2022-01-10)
|
|
6
34
|
|
|
7
35
|
### [2.1.4](https://github.com/oclif/oclif/compare/v2.1.3...v2.1.4) (2022-01-10)
|
package/README.md
CHANGED
|
@@ -146,7 +146,7 @@ DESCRIPTION
|
|
|
146
146
|
This will clone the template repo 'oclif/hello-world' and update package properties
|
|
147
147
|
```
|
|
148
148
|
|
|
149
|
-
_See code: [src/commands/generate.ts](https://github.com/oclif/oclif/blob/v2.1.
|
|
149
|
+
_See code: [src/commands/generate.ts](https://github.com/oclif/oclif/blob/v2.1.8/src/commands/generate.ts)_
|
|
150
150
|
|
|
151
151
|
## `oclif generate command NAME`
|
|
152
152
|
|
|
@@ -220,7 +220,7 @@ DESCRIPTION
|
|
|
220
220
|
generates plugin manifest json
|
|
221
221
|
```
|
|
222
222
|
|
|
223
|
-
_See code: [src/commands/manifest.ts](https://github.com/oclif/oclif/blob/v2.1.
|
|
223
|
+
_See code: [src/commands/manifest.ts](https://github.com/oclif/oclif/blob/v2.1.8/src/commands/manifest.ts)_
|
|
224
224
|
|
|
225
225
|
## `oclif pack deb`
|
|
226
226
|
|
|
@@ -228,10 +228,11 @@ pack CLI into debian package
|
|
|
228
228
|
|
|
229
229
|
```
|
|
230
230
|
USAGE
|
|
231
|
-
$ oclif pack deb -r <value>
|
|
231
|
+
$ oclif pack deb -r <value> [-t <value>]
|
|
232
232
|
|
|
233
233
|
FLAGS
|
|
234
|
-
-r, --root=<value>
|
|
234
|
+
-r, --root=<value> (required) [default: .] path to oclif CLI root
|
|
235
|
+
-t, --tarball=<value> optionally specify a path to a tarball already generated by NPM
|
|
235
236
|
|
|
236
237
|
DESCRIPTION
|
|
237
238
|
pack CLI into debian package
|
|
@@ -243,10 +244,11 @@ pack CLI into macOS .pkg
|
|
|
243
244
|
|
|
244
245
|
```
|
|
245
246
|
USAGE
|
|
246
|
-
$ oclif pack macos -r <value>
|
|
247
|
+
$ oclif pack macos -r <value> [-t <value>]
|
|
247
248
|
|
|
248
249
|
FLAGS
|
|
249
|
-
-r, --root=<value>
|
|
250
|
+
-r, --root=<value> (required) [default: .] path to oclif CLI root
|
|
251
|
+
-t, --tarball=<value> optionally specify a path to a tarball already generated by NPM
|
|
250
252
|
|
|
251
253
|
DESCRIPTION
|
|
252
254
|
pack CLI into macOS .pkg
|
|
@@ -258,10 +260,11 @@ packages oclif CLI into tarballs
|
|
|
258
260
|
|
|
259
261
|
```
|
|
260
262
|
USAGE
|
|
261
|
-
$ oclif pack tarballs -r <value> [-t <value>] [--xz]
|
|
263
|
+
$ oclif pack tarballs -r <value> [-t <value>] [--xz] [-t <value>]
|
|
262
264
|
|
|
263
265
|
FLAGS
|
|
264
266
|
-r, --root=<value> (required) [default: .] path to oclif CLI root
|
|
267
|
+
-t, --tarball=<value> optionally specify a path to a tarball already generated by NPM
|
|
265
268
|
-t, --targets=<value> [default: linux-x64,linux-arm,win32-x64,win32-x86,darwin-x64,darwin-arm64] comma-separated
|
|
266
269
|
targets to pack (e.g.: linux-arm,win32-x64)
|
|
267
270
|
--[no-]xz also build xz
|
|
@@ -278,10 +281,11 @@ create windows installer from oclif CLI
|
|
|
278
281
|
|
|
279
282
|
```
|
|
280
283
|
USAGE
|
|
281
|
-
$ oclif pack win -r <value>
|
|
284
|
+
$ oclif pack win -r <value> [-t <value>]
|
|
282
285
|
|
|
283
286
|
FLAGS
|
|
284
|
-
-r, --root=<value>
|
|
287
|
+
-r, --root=<value> (required) [default: .] path to oclif CLI root
|
|
288
|
+
-t, --tarball=<value> optionally specify a path to a tarball already generated by NPM
|
|
285
289
|
|
|
286
290
|
DESCRIPTION
|
|
287
291
|
create windows installer from oclif CLI
|
|
@@ -317,7 +321,7 @@ DESCRIPTION
|
|
|
317
321
|
promote CLI builds to a S3 release channel
|
|
318
322
|
```
|
|
319
323
|
|
|
320
|
-
_See code: [src/commands/promote.ts](https://github.com/oclif/oclif/blob/v2.1.
|
|
324
|
+
_See code: [src/commands/promote.ts](https://github.com/oclif/oclif/blob/v2.1.8/src/commands/promote.ts)_
|
|
321
325
|
|
|
322
326
|
## `oclif readme`
|
|
323
327
|
|
|
@@ -347,7 +351,7 @@ DESCRIPTION
|
|
|
347
351
|
Customize the code URL prefix by setting oclif.repositoryPrefix in package.json.
|
|
348
352
|
```
|
|
349
353
|
|
|
350
|
-
_See code: [src/commands/readme.ts](https://github.com/oclif/oclif/blob/v2.1.
|
|
354
|
+
_See code: [src/commands/readme.ts](https://github.com/oclif/oclif/blob/v2.1.8/src/commands/readme.ts)_
|
|
351
355
|
|
|
352
356
|
## `oclif upload deb`
|
|
353
357
|
|
package/lib/commands/pack/deb.js
CHANGED
|
@@ -48,7 +48,7 @@ class PackDeb extends core_1.Command {
|
|
|
48
48
|
const { flags } = await this.parse(PackDeb);
|
|
49
49
|
const buildConfig = await Tarballs.buildConfig(flags.root);
|
|
50
50
|
const { config } = buildConfig;
|
|
51
|
-
await Tarballs.build(buildConfig, { platform: 'linux', pack: false });
|
|
51
|
+
await Tarballs.build(buildConfig, { platform: 'linux', pack: false, tarball: flags.tarball });
|
|
52
52
|
const dist = buildConfig.dist('deb');
|
|
53
53
|
await qq.emptyDir(dist);
|
|
54
54
|
const build = async (arch) => {
|
|
@@ -92,4 +92,5 @@ exports.default = PackDeb;
|
|
|
92
92
|
PackDeb.description = 'pack CLI into debian package';
|
|
93
93
|
PackDeb.flags = {
|
|
94
94
|
root: core_1.Flags.string({ char: 'r', description: 'path to oclif CLI root', default: '.', required: true }),
|
|
95
|
+
tarball: core_1.Flags.string({ char: 't', description: 'optionally specify a path to a tarball already generated by NPM', required: false })
|
|
95
96
|
};
|
|
@@ -106,7 +106,7 @@ class PackMacos extends core_1.Command {
|
|
|
106
106
|
this.error('package.json must have oclif.macos.identifier set');
|
|
107
107
|
const macos = c.macos;
|
|
108
108
|
const packageIdentifier = macos.identifier;
|
|
109
|
-
await Tarballs.build(buildConfig, { platform: 'darwin', pack: false });
|
|
109
|
+
await Tarballs.build(buildConfig, { platform: 'darwin', pack: false, tarball: flags.tarball });
|
|
110
110
|
const templateKey = (0, upload_util_1.templateShortKey)('macos', { bin: config.bin, version: config.version, sha: buildConfig.gitSha });
|
|
111
111
|
const dist = buildConfig.dist(`macos/${templateKey}`);
|
|
112
112
|
await qq.emptyDir(path.dirname(dist));
|
|
@@ -147,4 +147,5 @@ PackMacos.flags = {
|
|
|
147
147
|
root: core_1.Flags.string({ char: 'r', description: 'path to oclif CLI root', default: '.', required: true }),
|
|
148
148
|
'additional-cli': core_1.Flags.string({ description: `an Oclif CLI other than the one listed in config.bin that should be made available to the user
|
|
149
149
|
the CLI should already exist in a directory named after the CLI that is the root of the tarball produced by "oclif pack:tarballs"`, hidden: true }),
|
|
150
|
+
tarball: core_1.Flags.string({ char: 't', description: 'optionally specify a path to a tarball already generated by NPM', required: false })
|
|
150
151
|
};
|
|
@@ -5,6 +5,7 @@ export default class PackTarballs extends Command {
|
|
|
5
5
|
root: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
6
6
|
targets: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
7
7
|
xz: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
tarball: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
8
9
|
};
|
|
9
10
|
run(): Promise<void>;
|
|
10
11
|
}
|
|
@@ -14,7 +14,9 @@ class PackTarballs extends core_1.Command {
|
|
|
14
14
|
if (buildConfig.targets.length === 0) {
|
|
15
15
|
throw new Error('Please specify one or more valid targets.');
|
|
16
16
|
}
|
|
17
|
-
await Tarballs.build(buildConfig
|
|
17
|
+
await Tarballs.build(buildConfig, {
|
|
18
|
+
tarball: flags.tarball
|
|
19
|
+
});
|
|
18
20
|
qq.cd(prevCwd);
|
|
19
21
|
}
|
|
20
22
|
}
|
|
@@ -30,4 +32,5 @@ PackTarballs.flags = {
|
|
|
30
32
|
default: Tarballs.TARGETS.join(','),
|
|
31
33
|
}),
|
|
32
34
|
xz: core_1.Flags.boolean({ description: 'also build xz', allowNo: true, default: true }),
|
|
35
|
+
tarball: core_1.Flags.string({ char: 't', description: 'optionally specify a path to a tarball already generated by NPM', required: false })
|
|
33
36
|
};
|
|
@@ -5,6 +5,7 @@ export default class PackWin extends Command {
|
|
|
5
5
|
static flags: {
|
|
6
6
|
root: Interfaces.OptionFlag<string>;
|
|
7
7
|
'additional-cli': Interfaces.OptionFlag<string | undefined>;
|
|
8
|
+
tarball: Interfaces.OptionFlag<string | undefined>;
|
|
8
9
|
};
|
|
9
10
|
run(): Promise<void>;
|
|
10
11
|
private checkForNSIS;
|
package/lib/commands/pack/win.js
CHANGED
|
@@ -199,7 +199,7 @@ class PackWin extends core_1.Command {
|
|
|
199
199
|
const { flags } = await this.parse(PackWin);
|
|
200
200
|
const buildConfig = await Tarballs.buildConfig(flags.root);
|
|
201
201
|
const { config } = buildConfig;
|
|
202
|
-
await Tarballs.build(buildConfig, { platform: 'win32', pack: false });
|
|
202
|
+
await Tarballs.build(buildConfig, { platform: 'win32', pack: false, tarball: flags.tarball });
|
|
203
203
|
const arches = buildConfig.targets.filter(t => t.platform === 'win32').map(t => t.arch);
|
|
204
204
|
for (const arch of arches) {
|
|
205
205
|
const installerBase = qq.join(buildConfig.tmp, `windows-${arch}-installer`);
|
|
@@ -270,4 +270,5 @@ PackWin.flags = {
|
|
|
270
270
|
root: core_1.Flags.string({ char: 'r', description: 'path to oclif CLI root', default: '.', required: true }),
|
|
271
271
|
'additional-cli': core_1.Flags.string({ description: `an Oclif CLI other than the one listed in config.bin that should be made available to the user
|
|
272
272
|
the CLI should already exist in a directory named after the CLI that is the root of the tarball produced by "oclif pack:tarballs"`, hidden: true }),
|
|
273
|
+
tarball: core_1.Flags.string({ char: 't', description: 'optionally specify a path to a tarball already generated by NPM', required: false })
|
|
273
274
|
};
|
package/lib/generators/cli.js
CHANGED
|
@@ -6,8 +6,6 @@ const _ = require("lodash");
|
|
|
6
6
|
const path = require("path");
|
|
7
7
|
const Generator = require("yeoman-generator");
|
|
8
8
|
const yosay = require("yosay");
|
|
9
|
-
const sortPjson = require('sort-pjson');
|
|
10
|
-
const fixpack = require('@oclif/fixpack');
|
|
11
9
|
const debug = require('debug')('generator-oclif');
|
|
12
10
|
const { version } = require('../../package.json');
|
|
13
11
|
const isWindows = process.platform === 'win32';
|
|
@@ -34,11 +32,12 @@ class CLI extends Generator {
|
|
|
34
32
|
this.destinationRoot(path.resolve(this.name));
|
|
35
33
|
process.chdir(this.destinationRoot());
|
|
36
34
|
this.githubUser = await this.user.github.username().catch(debug);
|
|
37
|
-
|
|
35
|
+
// establish order of properties in the resulting package.json
|
|
36
|
+
this.pjson = Object.assign({ name: '', version: '', description: '', author: '', bin: {}, homepage: '', license: '', main: '', repository: '', files: [], dependencies: {}, devDependencies: {}, oclif: {}, scripts: {}, engines: {} }, this.fs.readJSON('package.json', {}));
|
|
38
37
|
let repository = this.destinationRoot().split(path.sep).slice(-2).join('/');
|
|
39
38
|
if (this.githubUser)
|
|
40
39
|
repository = `${this.githubUser}/${repository.split('/')[1]}`;
|
|
41
|
-
const defaults = Object.assign(Object.assign({ name: this.determineAppname().replace(/ /g, '-'), version: '0.0.0', license: 'MIT', author: this.githubUser ? `${this.user.git.name()} @${this.githubUser}` : this.user.git.name(), dependencies: {}, repository
|
|
40
|
+
const defaults = Object.assign(Object.assign({}, this.pjson), { name: this.name ? this.name.replace(/ /g, '-') : this.determineAppname().replace(/ /g, '-'), version: '0.0.0', license: 'MIT', author: this.githubUser ? `${this.user.git.name()} @${this.githubUser}` : this.user.git.name(), dependencies: {}, repository, engines: Object.assign({ node: '>=12.0.0' }, this.pjson.engines), options: this.options });
|
|
42
41
|
this.repository = defaults.repository;
|
|
43
42
|
if (this.repository && this.repository.url) {
|
|
44
43
|
this.repository = this.repository.url;
|
|
@@ -133,13 +132,10 @@ class CLI extends Generator {
|
|
|
133
132
|
if (this.pjson.oclif && Array.isArray(this.pjson.oclif.plugins)) {
|
|
134
133
|
this.pjson.oclif.plugins.sort();
|
|
135
134
|
}
|
|
136
|
-
if (this.fs.exists(this.destinationPath('./package.json'))) {
|
|
137
|
-
fixpack(this.destinationPath('./package.json'), require('@oclif/fixpack/config.json'));
|
|
138
|
-
}
|
|
139
135
|
if (_.isEmpty(this.pjson.oclif))
|
|
140
136
|
delete this.pjson.oclif;
|
|
141
137
|
this.pjson.files = _.uniq((this.pjson.files || []).sort());
|
|
142
|
-
this.fs.writeJSON(this.destinationPath('./package.json'),
|
|
138
|
+
this.fs.writeJSON(this.destinationPath('./package.json'), this.pjson);
|
|
143
139
|
this.fs.write(this.destinationPath('.gitignore'), this._gitignore());
|
|
144
140
|
}
|
|
145
141
|
async install() {
|
package/lib/tarballs/build.d.ts
CHANGED
package/lib/tarballs/build.js
CHANGED
|
@@ -136,7 +136,7 @@ async function build(c, options = {}) {
|
|
|
136
136
|
await qq.writeJSON(manifestFilepath, manifest);
|
|
137
137
|
};
|
|
138
138
|
(0, log_1.log)(`gathering workspace for ${config.bin} to ${c.workspace()}`);
|
|
139
|
-
await extractCLI(await packCLI());
|
|
139
|
+
await extractCLI(options.tarball ? options.tarball : await packCLI());
|
|
140
140
|
await updatePJSON();
|
|
141
141
|
await addDependencies();
|
|
142
142
|
await (0, bin_1.writeBinScripts)({ config, baseWorkspace: c.workspace(), nodeVersion: c.nodeVersion });
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oclif",
|
|
3
3
|
"description": "oclif: create your own CLI",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.0",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bin": {
|
|
7
7
|
"oclif": "bin/run"
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
"bugs": "https://github.com/oclif/oclif/issues",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@oclif/core": "^1.0.11",
|
|
12
|
-
"@oclif/fixpack": "^2.3.1",
|
|
13
12
|
"@oclif/plugin-help": "^5.1.10",
|
|
14
13
|
"@oclif/plugin-not-found": "^2.2.3",
|
|
15
14
|
"@oclif/plugin-warn-if-update-available": "^2.0.3",
|
|
@@ -22,10 +21,8 @@
|
|
|
22
21
|
"lodash": "^4.17.11",
|
|
23
22
|
"normalize-package-data": "^3.0.3",
|
|
24
23
|
"nps-utils": "^1.7.0",
|
|
25
|
-
"oclif": "^2.1.1",
|
|
26
24
|
"qqjs": "^0.3.10",
|
|
27
25
|
"semver": "^7.3.5",
|
|
28
|
-
"sort-pjson": "^1.0.3",
|
|
29
26
|
"tslib": "^2.3.1",
|
|
30
27
|
"yeoman-environment": "^2.3.4",
|
|
31
28
|
"yeoman-generator": "3",
|