oclif 2.2.0 → 2.4.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.
- package/.oclif.manifest.json +1 -1
- package/CHANGELOG.md +28 -0
- package/README.md +4 -4
- package/bin/run +0 -2
- package/lib/command-base.d.ts +1 -1
- package/lib/command-base.js +4 -9
- package/lib/commands/generate/command.js +1 -1
- package/lib/commands/generate/hook.js +1 -1
- package/lib/commands/generate.js +1 -1
- package/lib/commands/pack/deb.js +1 -1
- package/lib/commands/pack/macos.js +1 -1
- package/lib/commands/pack/tarballs.js +2 -2
- package/lib/commands/pack/win.js +1 -1
- package/lib/commands/promote.js +1 -2
- package/lib/commands/upload/deb.js +1 -1
- package/lib/commands/upload/macos.js +1 -1
- package/lib/commands/upload/win.js +1 -1
- package/lib/generators/cli.d.ts +1 -4
- package/lib/generators/cli.js +8 -21
- package/lib/log.js +2 -2
- package/lib/tarballs/config.js +1 -2
- package/package.json +8 -10
package/.oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"2.
|
|
1
|
+
{"version":"2.4.1","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.4.1](https://github.com/oclif/oclif/compare/v2.4.0...v2.4.1) (2022-01-31)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* update error messages ([#806](https://github.com/oclif/oclif/issues/806)) ([7a63b49](https://github.com/oclif/oclif/commit/7a63b4987bd8d6e4f2f3211a05248296e5f6d090))
|
|
11
|
+
|
|
12
|
+
## [2.4.0](https://github.com/oclif/oclif/compare/v2.3.1...v2.4.0) (2022-01-27)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* remove cli-ux ([#804](https://github.com/oclif/oclif/issues/804)) ([fd9d1fb](https://github.com/oclif/oclif/commit/fd9d1fb5672df197c559c6044d51797ad6fe7ffd))
|
|
18
|
+
|
|
19
|
+
### [2.3.1](https://github.com/oclif/oclif/compare/v2.3.0...v2.3.1) (2022-01-27)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* remove accidental dep ([8e5435f](https://github.com/oclif/oclif/commit/8e5435fb84febd950be387849f921a76a39f8eb0))
|
|
25
|
+
|
|
26
|
+
## [2.3.0](https://github.com/oclif/oclif/compare/v2.2.0...v2.3.0) (2022-01-20)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Features
|
|
30
|
+
|
|
31
|
+
* use yeoman-generator v5 ([#797](https://github.com/oclif/oclif/issues/797)) ([37827bf](https://github.com/oclif/oclif/commit/37827bf258ff8145c98a9c621b853ac6b1020fdb))
|
|
32
|
+
|
|
5
33
|
## [2.2.0](https://github.com/oclif/oclif/compare/v2.1.8...v2.2.0) (2022-01-13)
|
|
6
34
|
|
|
7
35
|
|
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.
|
|
149
|
+
_See code: [src/commands/generate.ts](https://github.com/oclif/oclif/blob/v2.4.0/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.
|
|
223
|
+
_See code: [src/commands/manifest.ts](https://github.com/oclif/oclif/blob/v2.4.0/src/commands/manifest.ts)_
|
|
224
224
|
|
|
225
225
|
## `oclif pack deb`
|
|
226
226
|
|
|
@@ -321,7 +321,7 @@ DESCRIPTION
|
|
|
321
321
|
promote CLI builds to a S3 release channel
|
|
322
322
|
```
|
|
323
323
|
|
|
324
|
-
_See code: [src/commands/promote.ts](https://github.com/oclif/oclif/blob/v2.
|
|
324
|
+
_See code: [src/commands/promote.ts](https://github.com/oclif/oclif/blob/v2.4.0/src/commands/promote.ts)_
|
|
325
325
|
|
|
326
326
|
## `oclif readme`
|
|
327
327
|
|
|
@@ -351,7 +351,7 @@ DESCRIPTION
|
|
|
351
351
|
Customize the code URL prefix by setting oclif.repositoryPrefix in package.json.
|
|
352
352
|
```
|
|
353
353
|
|
|
354
|
-
_See code: [src/commands/readme.ts](https://github.com/oclif/oclif/blob/v2.
|
|
354
|
+
_See code: [src/commands/readme.ts](https://github.com/oclif/oclif/blob/v2.4.0/src/commands/readme.ts)_
|
|
355
355
|
|
|
356
356
|
## `oclif upload deb`
|
|
357
357
|
|
package/bin/run
CHANGED
package/lib/command-base.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
export default abstract class CommandBase extends Command {
|
|
3
|
-
protected generate(type: string, generatorOptions?: Record<string, unknown>):
|
|
3
|
+
protected generate(type: string, generatorOptions?: Record<string, unknown>): void;
|
|
4
4
|
}
|
package/lib/command-base.js
CHANGED
|
@@ -3,17 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
4
|
const yeoman_environment_1 = require("yeoman-environment");
|
|
5
5
|
class CommandBase extends core_1.Command {
|
|
6
|
-
|
|
6
|
+
generate(type, generatorOptions = {}) {
|
|
7
7
|
const env = (0, yeoman_environment_1.createEnv)();
|
|
8
8
|
env.register(require.resolve(`./generators/${type}`), `oclif:${type}`);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
reject(err);
|
|
13
|
-
else
|
|
14
|
-
resolve(results);
|
|
15
|
-
}));
|
|
16
|
-
});
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
env.run(`oclif:${type}`, generatorOptions);
|
|
17
12
|
}
|
|
18
13
|
}
|
|
19
14
|
exports.default = CommandBase;
|
|
@@ -5,7 +5,7 @@ const core_1 = require("@oclif/core");
|
|
|
5
5
|
class GenerateCommand extends command_base_1.default {
|
|
6
6
|
async run() {
|
|
7
7
|
const { args, flags } = await this.parse(GenerateCommand);
|
|
8
|
-
|
|
8
|
+
super.generate('command', {
|
|
9
9
|
name: args.name,
|
|
10
10
|
force: flags.force,
|
|
11
11
|
});
|
|
@@ -5,7 +5,7 @@ const core_1 = require("@oclif/core");
|
|
|
5
5
|
class GenerateHook extends command_base_1.default {
|
|
6
6
|
async run() {
|
|
7
7
|
const { args, flags } = await this.parse(GenerateHook);
|
|
8
|
-
|
|
8
|
+
super.generate('hook', {
|
|
9
9
|
name: args.name,
|
|
10
10
|
event: flags.event,
|
|
11
11
|
force: flags.force,
|
package/lib/commands/generate.js
CHANGED
package/lib/commands/pack/deb.js
CHANGED
|
@@ -92,5 +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
|
+
tarball: core_1.Flags.string({ char: 't', description: 'optionally specify a path to a tarball already generated by NPM', required: false }),
|
|
96
96
|
};
|
|
@@ -147,5 +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
|
+
tarball: core_1.Flags.string({ char: 't', description: 'optionally specify a path to a tarball already generated by NPM', required: false }),
|
|
151
151
|
};
|
|
@@ -15,7 +15,7 @@ class PackTarballs extends core_1.Command {
|
|
|
15
15
|
throw new Error('Please specify one or more valid targets.');
|
|
16
16
|
}
|
|
17
17
|
await Tarballs.build(buildConfig, {
|
|
18
|
-
tarball: flags.tarball
|
|
18
|
+
tarball: flags.tarball,
|
|
19
19
|
});
|
|
20
20
|
qq.cd(prevCwd);
|
|
21
21
|
}
|
|
@@ -32,5 +32,5 @@ PackTarballs.flags = {
|
|
|
32
32
|
default: Tarballs.TARGETS.join(','),
|
|
33
33
|
}),
|
|
34
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 })
|
|
35
|
+
tarball: core_1.Flags.string({ char: 't', description: 'optionally specify a path to a tarball already generated by NPM', required: false }),
|
|
36
36
|
};
|
package/lib/commands/pack/win.js
CHANGED
|
@@ -270,5 +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
|
+
tarball: core_1.Flags.string({ char: 't', description: 'optionally specify a path to a tarball already generated by NPM', required: false }),
|
|
274
274
|
};
|
package/lib/commands/promote.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
|
-
const cli_ux_1 = require("cli-ux");
|
|
5
4
|
const path = require("path");
|
|
6
5
|
const aws_1 = require("../aws");
|
|
7
6
|
const Tarballs = require("../tarballs");
|
|
@@ -131,7 +130,7 @@ class Promote extends core_1.Command {
|
|
|
131
130
|
// eslint-disable-next-line no-await-in-loop
|
|
132
131
|
if (flags.indexes)
|
|
133
132
|
await (0, version_indexes_1.appendToIndex)(Object.assign(Object.assign({}, indexDefaults), { originalUrl: winCopySource, filename: unversionedExe }));
|
|
134
|
-
|
|
133
|
+
core_1.CliUx.ux.action.stop('successfully');
|
|
135
134
|
}
|
|
136
135
|
}
|
|
137
136
|
// copy debian artifacts
|
|
@@ -18,7 +18,7 @@ class UploadDeb extends core_1.Command {
|
|
|
18
18
|
};
|
|
19
19
|
if (!await qq.exists(dist('Release')))
|
|
20
20
|
this.error('Cannot find debian artifacts', {
|
|
21
|
-
suggestions: ['Run "oclif
|
|
21
|
+
suggestions: ['Run "oclif pack deb" before uploading'],
|
|
22
22
|
});
|
|
23
23
|
const cloudKeyBase = (0, upload_util_1.commitAWSDir)(config.pjson.version, buildConfig.gitSha, s3Config);
|
|
24
24
|
const upload = (file) => {
|
|
@@ -23,7 +23,7 @@ class UploadMacos extends core_1.Command {
|
|
|
23
23
|
await aws_1.default.s3.uploadFile(localPkg, Object.assign(Object.assign({}, S3Options), { CacheControl: 'max-age=86400', Key: cloudKey }));
|
|
24
24
|
else
|
|
25
25
|
this.error('Cannot find macOS pkg', {
|
|
26
|
-
suggestions: ['Run "oclif
|
|
26
|
+
suggestions: ['Run "oclif pack macos" before uploading'],
|
|
27
27
|
});
|
|
28
28
|
(0, log_1.log)(`done uploading macos pkg for v${config.version}-${buildConfig.gitSha}`);
|
|
29
29
|
}
|
|
@@ -22,7 +22,7 @@ class UploadWin extends core_1.Command {
|
|
|
22
22
|
// eslint-disable-next-line no-await-in-loop
|
|
23
23
|
if (!await qq.exists(localKey))
|
|
24
24
|
this.error(`Cannot find Windows exe for ${arch}`, {
|
|
25
|
-
suggestions: ['Run "oclif
|
|
25
|
+
suggestions: ['Run "oclif pack win" before uploading'],
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
const cloudKeyBase = (0, upload_util_1.commitAWSDir)(config.pjson.version, buildConfig.gitSha, s3Config);
|
package/lib/generators/cli.d.ts
CHANGED
|
@@ -2,11 +2,9 @@ import * as Generator from 'yeoman-generator';
|
|
|
2
2
|
export default class CLI extends Generator {
|
|
3
3
|
options: {
|
|
4
4
|
defaults?: boolean;
|
|
5
|
+
force: boolean;
|
|
5
6
|
yarn: boolean;
|
|
6
7
|
};
|
|
7
|
-
args: {
|
|
8
|
-
[k: string]: string;
|
|
9
|
-
};
|
|
10
8
|
name: string;
|
|
11
9
|
pjson: any;
|
|
12
10
|
githubUser: string | undefined;
|
|
@@ -37,7 +35,6 @@ export default class CLI extends Generator {
|
|
|
37
35
|
constructor(args: string | string[], opts: Generator.GeneratorOptions);
|
|
38
36
|
prompting(): Promise<void>;
|
|
39
37
|
writing(): void;
|
|
40
|
-
install(): Promise<void>;
|
|
41
38
|
end(): void;
|
|
42
39
|
private _gitignore;
|
|
43
40
|
}
|
package/lib/generators/cli.js
CHANGED
|
@@ -8,7 +8,6 @@ const Generator = require("yeoman-generator");
|
|
|
8
8
|
const yosay = require("yosay");
|
|
9
9
|
const debug = require('debug')('generator-oclif');
|
|
10
10
|
const { version } = require('../../package.json');
|
|
11
|
-
const isWindows = process.platform === 'win32';
|
|
12
11
|
let hasYarn = false;
|
|
13
12
|
try {
|
|
14
13
|
(0, child_process_1.execSync)('yarn -v', { stdio: 'ignore' });
|
|
@@ -21,6 +20,7 @@ class CLI extends Generator {
|
|
|
21
20
|
this.name = opts.name;
|
|
22
21
|
this.options = {
|
|
23
22
|
defaults: opts.defaults,
|
|
23
|
+
force: opts.force,
|
|
24
24
|
yarn: hasYarn,
|
|
25
25
|
};
|
|
26
26
|
}
|
|
@@ -30,10 +30,10 @@ class CLI extends Generator {
|
|
|
30
30
|
(0, child_process_1.execSync)(`git clone https://github.com/oclif/hello-world.git "${path.resolve(this.name)}"`);
|
|
31
31
|
fs.rmSync(`${path.resolve(this.name, '.git')}`, { recursive: true });
|
|
32
32
|
this.destinationRoot(path.resolve(this.name));
|
|
33
|
-
|
|
33
|
+
this.env.cwd = this.destinationPath();
|
|
34
34
|
this.githubUser = await this.user.github.username().catch(debug);
|
|
35
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', {}));
|
|
36
|
+
this.pjson = Object.assign({ name: '', version: '', description: '', author: '', bin: {}, homepage: '', license: '', main: '', repository: '', files: [], dependencies: {}, devDependencies: {}, oclif: {}, scripts: {}, engines: {} }, this.fs.readJSON(path.join(this.env.cwd, 'package.json'), {}));
|
|
37
37
|
let repository = this.destinationRoot().split(path.sep).slice(-2).join('/');
|
|
38
38
|
if (this.githubUser)
|
|
39
39
|
repository = `${this.githubUser}/${repository.split('/')[1]}`;
|
|
@@ -110,9 +110,10 @@ class CLI extends Generator {
|
|
|
110
110
|
}
|
|
111
111
|
debug(this.answers);
|
|
112
112
|
if (!this.options.defaults) {
|
|
113
|
-
this.options = Object.assign(Object.assign({}, this.answers.ci), { yarn: this.answers.pkg === 'yarn' });
|
|
113
|
+
this.options = Object.assign(Object.assign({}, this.answers.ci), { yarn: this.answers.pkg === 'yarn', force: true });
|
|
114
114
|
}
|
|
115
115
|
this.yarn = this.options.yarn;
|
|
116
|
+
this.env.options.nodePackageManager = this.yarn ? 'yarn' : 'npm';
|
|
116
117
|
this.pjson.name = this.answers.name || defaults.name;
|
|
117
118
|
this.pjson.description = this.answers.description || defaults.description;
|
|
118
119
|
this.pjson.version = this.answers.version || defaults.version;
|
|
@@ -125,6 +126,7 @@ class CLI extends Generator {
|
|
|
125
126
|
this.pjson.homepage = `https://github.com/${this.repository}`;
|
|
126
127
|
this.pjson.bugs = `https://github.com/${this.repository}/issues`;
|
|
127
128
|
this.pjson.oclif.bin = this.answers.bin;
|
|
129
|
+
this.pjson.oclif.dirname = this.answers.bin;
|
|
128
130
|
this.pjson.bin = {};
|
|
129
131
|
this.pjson.bin[this.pjson.oclif.bin] = './bin/run';
|
|
130
132
|
}
|
|
@@ -138,24 +140,9 @@ class CLI extends Generator {
|
|
|
138
140
|
this.fs.writeJSON(this.destinationPath('./package.json'), this.pjson);
|
|
139
141
|
this.fs.write(this.destinationPath('.gitignore'), this._gitignore());
|
|
140
142
|
}
|
|
141
|
-
async install() {
|
|
142
|
-
const dependencies = [];
|
|
143
|
-
const devDependencies = [];
|
|
144
|
-
if (isWindows)
|
|
145
|
-
devDependencies.push('rimraf');
|
|
146
|
-
const yarnOpts = {};
|
|
147
|
-
if (process.env.YARN_MUTEX)
|
|
148
|
-
yarnOpts.mutex = process.env.YARN_MUTEX;
|
|
149
|
-
const install = (deps, opts) => this.yarn ? this.yarnInstall(deps, opts) : this.npmInstall(deps, opts);
|
|
150
|
-
const dev = this.yarn ? { dev: true } : { 'save-dev': true };
|
|
151
|
-
const save = this.yarn ? {} : { save: true };
|
|
152
|
-
return Promise.all([
|
|
153
|
-
install(devDependencies, Object.assign(Object.assign(Object.assign({}, yarnOpts), dev), { ignoreScripts: true })),
|
|
154
|
-
install(dependencies, Object.assign(Object.assign({}, yarnOpts), save)),
|
|
155
|
-
]).then(() => { });
|
|
156
|
-
}
|
|
157
143
|
end() {
|
|
158
|
-
this.spawnCommandSync(
|
|
144
|
+
this.spawnCommandSync(this.env.options.nodePackageManager, ['run', 'build']);
|
|
145
|
+
this.spawnCommandSync(path.join(this.env.cwd, 'node_modules', '.bin', 'oclif'), ['readme'], { cwd: this.env.cwd });
|
|
159
146
|
console.log(`\nCreated ${this.pjson.name} in ${this.destinationRoot()}`);
|
|
160
147
|
}
|
|
161
148
|
_gitignore() {
|
package/lib/log.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.log = exports.debug = void 0;
|
|
4
|
-
const
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
5
|
const qq = require("qqjs");
|
|
6
6
|
const util = require("util");
|
|
7
7
|
exports.debug = require('debug')('oclif');
|
|
8
8
|
exports.debug.new = (name) => require('debug')(`oclif:${name}`);
|
|
9
9
|
function log(format, ...args) {
|
|
10
10
|
args = args.map((arg) => qq.prettifyPaths(arg));
|
|
11
|
-
exports.debug.enabled ? (0, exports.debug)(format, ...args) :
|
|
11
|
+
exports.debug.enabled ? (0, exports.debug)(format, ...args) : core_1.CliUx.ux.log(`oclif: ${util.format(format, ...args)}`);
|
|
12
12
|
}
|
|
13
13
|
exports.log = log;
|
package/lib/tarballs/config.js
CHANGED
|
@@ -7,7 +7,6 @@ const qq = require("qqjs");
|
|
|
7
7
|
const semver = require("semver");
|
|
8
8
|
const util_1 = require("../util");
|
|
9
9
|
const upload_util_1 = require("../upload-util");
|
|
10
|
-
const cli_ux_1 = require("cli-ux");
|
|
11
10
|
exports.TARGETS = [
|
|
12
11
|
'linux-x64',
|
|
13
12
|
'linux-arm',
|
|
@@ -38,7 +37,7 @@ async function buildConfig(root, options = {}) {
|
|
|
38
37
|
const targets = (0, util_1.compact)(options.targets || updateConfig.node.targets || exports.TARGETS)
|
|
39
38
|
.filter(t => {
|
|
40
39
|
if (t === 'darwin-arm64' && semver.lt(nodeVersion, '16.0.0')) {
|
|
41
|
-
|
|
40
|
+
core_1.CliUx.ux.warn('darwin-arm64 is only supported for node >=16.0.0. Skipping...');
|
|
42
41
|
return false;
|
|
43
42
|
}
|
|
44
43
|
return true;
|
package/package.json
CHANGED
|
@@ -1,31 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oclif",
|
|
3
3
|
"description": "oclif: create your own CLI",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.4.1",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bin": {
|
|
7
7
|
"oclif": "bin/run"
|
|
8
8
|
},
|
|
9
9
|
"bugs": "https://github.com/oclif/oclif/issues",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@oclif/core": "^1.0
|
|
11
|
+
"@oclif/core": "^1.2.0",
|
|
12
12
|
"@oclif/plugin-help": "^5.1.10",
|
|
13
13
|
"@oclif/plugin-not-found": "^2.2.3",
|
|
14
14
|
"@oclif/plugin-warn-if-update-available": "^2.0.3",
|
|
15
|
-
"cli-ux": "^6.0.8",
|
|
16
15
|
"debug": "^4.3.3",
|
|
17
16
|
"find-yarn-workspace-root": "^2.0.0",
|
|
18
17
|
"fs-extra": "^8.1",
|
|
19
18
|
"github-slugger": "^1.2.1",
|
|
20
|
-
"global": "^4.4.0",
|
|
21
19
|
"lodash": "^4.17.11",
|
|
22
20
|
"normalize-package-data": "^3.0.3",
|
|
23
21
|
"nps-utils": "^1.7.0",
|
|
24
22
|
"qqjs": "^0.3.10",
|
|
25
23
|
"semver": "^7.3.5",
|
|
26
24
|
"tslib": "^2.3.1",
|
|
27
|
-
"yeoman-environment": "^
|
|
28
|
-
"yeoman-generator": "
|
|
25
|
+
"yeoman-environment": "^3.5.1",
|
|
26
|
+
"yeoman-generator": "^5.5.2",
|
|
29
27
|
"yosay": "^2.0.2"
|
|
30
28
|
},
|
|
31
29
|
"devDependencies": {
|
|
@@ -40,11 +38,11 @@
|
|
|
40
38
|
"@types/node": "^14.18.4",
|
|
41
39
|
"@types/read-pkg": "^5.1.0",
|
|
42
40
|
"@types/semver": "^7.3.9",
|
|
43
|
-
"@types/shelljs": "^0.8.
|
|
41
|
+
"@types/shelljs": "^0.8.11",
|
|
44
42
|
"@types/supports-color": "^7.2.0",
|
|
45
43
|
"@types/write-json-file": "^3.2.1",
|
|
46
|
-
"@types/yeoman-
|
|
47
|
-
"@types/yosay": "^
|
|
44
|
+
"@types/yeoman-generator": "^5.2.8",
|
|
45
|
+
"@types/yosay": "^2.0.1",
|
|
48
46
|
"aws-sdk": "^2.1048.0",
|
|
49
47
|
"chai": "^4.2.0",
|
|
50
48
|
"conventional-changelog-cli": "^2.2.2",
|
|
@@ -57,7 +55,7 @@
|
|
|
57
55
|
"mocha": "^9.1.3",
|
|
58
56
|
"npm-run-path": "^4.0.1",
|
|
59
57
|
"nps": "^5.9.3",
|
|
60
|
-
"shelljs": "^0.8.
|
|
58
|
+
"shelljs": "^0.8.5",
|
|
61
59
|
"shx": "^0.3.3",
|
|
62
60
|
"tmp": "^0.2.1",
|
|
63
61
|
"ts-node": "^9.0.0",
|