oclif 3.11.1 → 3.11.3

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.11.1",
2
+ "version": "3.11.3",
3
3
  "commands": {
4
4
  "generate": {
5
5
  "id": "generate",
package/README.md CHANGED
@@ -99,8 +99,8 @@ COMMANDS
99
99
  hello
100
100
  help display help for mynewcli
101
101
 
102
- $ ./bin/run hello
103
- hello world from ./src/hello.js!
102
+ $ ./bin/run hello world
103
+ hello world! (./src/commands/hello/world.ts)
104
104
  ```
105
105
 
106
106
  # 📚 Examples
@@ -125,11 +125,14 @@ USAGE
125
125
  return usage ? `## \`${config.bin} ${usage}\`` : `## \`${config.bin}\``;
126
126
  };
127
127
  try {
128
+ // copy c to keep the command ID with colons, see:
129
+ // https://github.com/oclif/oclif/pull/1165#discussion_r1282305242
130
+ const command = Object.assign({}, c);
128
131
  return (0, util_1.compact)([
129
132
  header(),
130
133
  title,
131
134
  '```\n' + wrapper.formatCommand(c).trim() + '\n```',
132
- this.commandCode(config, c),
135
+ this.commandCode(config, command),
133
136
  ]).join('\n\n');
134
137
  }
135
138
  catch (error) {
@@ -23,10 +23,11 @@ class CLI extends Generator {
23
23
  yarn: hasYarn,
24
24
  };
25
25
  }
26
+ // eslint-disable-next-line complexity
26
27
  async prompting() {
27
28
  const msg = 'Time to build an oclif CLI!';
28
29
  this.log(`${msg} Version: ${version}`);
29
- const { moduleType } = await this.prompt([
30
+ const { moduleType } = process.env.OCLIF_ALLOW_ESM ? await this.prompt([
30
31
  {
31
32
  type: 'list',
32
33
  name: 'moduleType',
@@ -37,7 +38,7 @@ class CLI extends Generator {
37
38
  ],
38
39
  default: 'cjs',
39
40
  },
40
- ]);
41
+ ]) : 'cjs';
41
42
  const repo = moduleType === 'esm' ? 'hello-world-esm' : 'hello-world';
42
43
  (0, child_process_1.execSync)(`git clone https://github.com/oclif/${repo}.git "${path.resolve(this.name)}" --depth=1`);
43
44
  fs.rmSync(`${path.resolve(this.name, '.git')}`, { recursive: true });
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.11.1",
4
+ "version": "3.11.3",
5
5
  "author": "Salesforce",
6
6
  "bin": {
7
7
  "oclif": "bin/run"