oclif 1.18.2-dev.3 → 2.0.0-dev.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 +59 -11
- package/README.md +223 -96
- package/bin/dev +19 -0
- package/bin/dev.cmd +3 -0
- package/bin/run +5 -2
- package/lib/aws.d.ts +5 -5
- package/lib/aws.js +5 -5
- package/lib/command-base.d.ts +1 -1
- package/lib/command-base.js +3 -3
- package/lib/commands/generate.d.ts +11 -0
- package/lib/commands/generate.js +19 -0
- package/lib/commands/manifest.d.ts +1 -2
- package/lib/commands/manifest.js +4 -7
- package/lib/commands/pack/deb.d.ts +3 -3
- package/lib/commands/pack/deb.js +7 -8
- package/lib/commands/pack/macos.d.ts +4 -4
- package/lib/commands/pack/macos.js +17 -18
- package/lib/commands/pack/tarballs.d.ts +4 -5
- package/lib/commands/pack/tarballs.js +6 -7
- package/lib/commands/pack/win.d.ts +4 -4
- package/lib/commands/pack/win.js +26 -20
- package/lib/commands/promote.d.ts +12 -13
- package/lib/commands/promote.js +27 -28
- package/lib/commands/readme.d.ts +11 -12
- package/lib/commands/readme.js +27 -28
- package/lib/commands/upload/deb.d.ts +2 -3
- package/lib/commands/upload/deb.js +7 -8
- package/lib/commands/upload/macos.d.ts +2 -3
- package/lib/commands/upload/macos.js +8 -9
- package/lib/commands/upload/tarballs.d.ts +5 -5
- package/lib/commands/upload/tarballs.js +15 -18
- package/lib/commands/upload/win.d.ts +2 -3
- package/lib/commands/upload/win.js +9 -10
- package/lib/generators/{app.d.ts → cli.d.ts} +1 -21
- package/lib/generators/cli.js +183 -0
- package/lib/help-compatibility.d.ts +4 -5
- package/lib/help-compatibility.js +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +3 -2
- package/lib/log.js +2 -1
- package/lib/tarballs/bin.d.ts +2 -2
- package/lib/tarballs/bin.js +1 -0
- package/lib/tarballs/build.js +15 -14
- package/lib/tarballs/config.d.ts +6 -7
- package/lib/tarballs/config.js +6 -7
- package/lib/tarballs/index.js +4 -4
- package/lib/tarballs/node.js +5 -4
- package/lib/upload-util.d.ts +3 -3
- package/lib/upload-util.js +2 -1
- package/lib/util.js +5 -2
- package/lib/version-indexes.d.ts +2 -4
- package/lib/version-indexes.js +3 -1
- package/package.json +6 -8
- package/lib/app-command.d.ts +0 -16
- package/lib/app-command.js +0 -26
- package/lib/commands/base.d.ts +0 -5
- package/lib/commands/base.js +0 -11
- package/lib/commands/command.d.ts +0 -19
- package/lib/commands/command.js +0 -23
- package/lib/commands/hook.d.ts +0 -22
- package/lib/commands/hook.js +0 -25
- package/lib/commands/multi.d.ts +0 -5
- package/lib/commands/multi.js +0 -11
- package/lib/commands/plugin.d.ts +0 -5
- package/lib/commands/plugin.js +0 -11
- package/lib/commands/single.d.ts +0 -5
- package/lib/commands/single.js +0 -11
- package/lib/generators/app.js +0 -470
- package/lib/generators/command.d.ts +0 -15
- package/lib/generators/command.js +0 -51
- package/lib/generators/hook.d.ts +0 -14
- package/lib/generators/hook.js +0 -51
- package/templates/LICENSE.mit +0 -21
- package/templates/README.md.ejs +0 -21
- package/templates/appveyor.yml.ejs +0 -33
- package/templates/base/src/index.js +0 -1
- package/templates/base/src/index.ts +0 -1
- package/templates/base/test/index.test.js +0 -8
- package/templates/base/test/index.test.ts +0 -9
- package/templates/bin/run +0 -5
- package/templates/bin/run.cmd +0 -3
- package/templates/circle.yml.ejs +0 -65
- package/templates/editorconfig +0 -11
- package/templates/eslintrc +0 -3
- package/templates/eslintrc.typescript +0 -12
- package/templates/multi/src/index.js +0 -1
- package/templates/multi/src/index.ts +0 -1
- package/templates/plugin/bin/run +0 -4
- package/templates/plugin/src/index.ts +0 -1
- package/templates/scripts/setup_git +0 -12
- package/templates/single/bin/run.js +0 -4
- package/templates/single/bin/run.ts +0 -13
- package/templates/src/command.js.ejs +0 -27
- package/templates/src/command.ts.ejs +0 -46
- package/templates/src/hook.js.ejs +0 -3
- package/templates/src/hook.ts.ejs +0 -7
- package/templates/test/command.test.js.ejs +0 -28
- package/templates/test/command.test.ts.ejs +0 -29
- package/templates/test/hook.test.js.ejs +0 -9
- package/templates/test/hook.test.ts.ejs +0 -9
- package/templates/test/mocha.opts +0 -4
- package/templates/test/tsconfig.json +0 -9
- package/templates/travis.yml.ejs +0 -14
- package/templates/tsconfig.json +0 -14
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
environment:
|
|
2
|
-
nodejs_version: "10"
|
|
3
|
-
cache:
|
|
4
|
-
<%_ if (yarn) { _%>
|
|
5
|
-
- '%LOCALAPPDATA%\Yarn -> appveyor.yml'
|
|
6
|
-
- node_modules -> yarn.lock
|
|
7
|
-
<%_ } else { _%>
|
|
8
|
-
- '%AppData%\npm-cache -> appveyor.yml'
|
|
9
|
-
- node_modules -> package-lock.json
|
|
10
|
-
<%_ } _%>
|
|
11
|
-
|
|
12
|
-
install:
|
|
13
|
-
- ps: Install-Product node $env:nodejs_version x64
|
|
14
|
-
<%_ if (yarn) { _%>
|
|
15
|
-
- yarn
|
|
16
|
-
<%_ } else { _%>
|
|
17
|
-
- npm install
|
|
18
|
-
<%_ } _%>
|
|
19
|
-
test_script:
|
|
20
|
-
<%_ if (type === 'single' || type === 'multi') { _%>
|
|
21
|
-
- .\bin\run --version
|
|
22
|
-
- .\bin\run --help
|
|
23
|
-
<%_ } else if (type === 'plugin') { _%>
|
|
24
|
-
- .\bin\run --help
|
|
25
|
-
<%_ } _%>
|
|
26
|
-
- <%- yarn ? 'yarn' : 'npm' %> test
|
|
27
|
-
<% if (mocha) { %>
|
|
28
|
-
after_test:
|
|
29
|
-
- .\node_modules\.bin\nyc report --reporter text-lcov > coverage.lcov
|
|
30
|
-
<% } %>
|
|
31
|
-
|
|
32
|
-
build: off
|
|
33
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
exports.add = (a, b) => a + b
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const add = (a: number, b: number) => a + b
|
package/templates/bin/run
DELETED
package/templates/bin/run.cmd
DELETED
package/templates/circle.yml.ejs
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
version: 2
|
|
3
|
-
jobs:
|
|
4
|
-
node-latest: &test
|
|
5
|
-
docker:
|
|
6
|
-
- image: node:latest
|
|
7
|
-
working_directory: ~/cli
|
|
8
|
-
steps:
|
|
9
|
-
- checkout
|
|
10
|
-
- restore_cache: &restore_cache
|
|
11
|
-
keys:
|
|
12
|
-
- v1-npm-{{checksum ".circleci/config.yml"}}-{{checksum "<%- yarn ? 'yarn.lock' : 'package-lock.json' %>"}}
|
|
13
|
-
- v1-npm-{{checksum ".circleci/config.yml"}}
|
|
14
|
-
- run:
|
|
15
|
-
name: Install dependencies
|
|
16
|
-
command: <%- yarn ? 'yarn' : 'npm ci' %>
|
|
17
|
-
<%_ if (['single', 'multi'].includes(type)) { _%>
|
|
18
|
-
- run: ./bin/run --version
|
|
19
|
-
<%_ } _%>
|
|
20
|
-
<%_ if (['single', 'multi', 'plugin'].includes(type)) { _%>
|
|
21
|
-
- run: ./bin/run --help
|
|
22
|
-
<%_ } _%>
|
|
23
|
-
- run:
|
|
24
|
-
name: Testing
|
|
25
|
-
command: <%- yarn ? 'yarn' : 'npm' %> test
|
|
26
|
-
node-12:
|
|
27
|
-
<<: *test
|
|
28
|
-
docker:
|
|
29
|
-
- image: node:12
|
|
30
|
-
node-10:
|
|
31
|
-
<<: *test
|
|
32
|
-
docker:
|
|
33
|
-
- image: node:10
|
|
34
|
-
cache:
|
|
35
|
-
<<: *test
|
|
36
|
-
steps:
|
|
37
|
-
- checkout
|
|
38
|
-
- run:
|
|
39
|
-
name: Install dependencies
|
|
40
|
-
command: <%- yarn ? 'yarn' : 'npm ci' %>
|
|
41
|
-
- save_cache:
|
|
42
|
-
key: v1-npm-{{checksum ".circleci/config.yml"}}-{{checksum "<%- yarn ? 'yarn.lock' : 'package-lock.json' %>"}}
|
|
43
|
-
paths:
|
|
44
|
-
- ~/cli/node_modules
|
|
45
|
-
<%_ if (yarn) { _%>
|
|
46
|
-
- /usr/local/share/.cache/yarn
|
|
47
|
-
- /usr/local/share/.config/yarn
|
|
48
|
-
<%_ } else { _%>
|
|
49
|
-
- ~/.npm
|
|
50
|
-
- /usr/local/lib/node_modules
|
|
51
|
-
<%_ } _%>
|
|
52
|
-
|
|
53
|
-
workflows:
|
|
54
|
-
version: 2
|
|
55
|
-
"<%= pjson.name %>":
|
|
56
|
-
jobs:
|
|
57
|
-
- node-latest
|
|
58
|
-
- node-12
|
|
59
|
-
- node-10
|
|
60
|
-
- cache:
|
|
61
|
-
filters:
|
|
62
|
-
tags:
|
|
63
|
-
only: /^v.*/
|
|
64
|
-
branches:
|
|
65
|
-
ignore: /.*/
|
package/templates/editorconfig
DELETED
package/templates/eslintrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('@oclif/command')
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {run} from '@oclif/command'
|
package/templates/plugin/bin/run
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default {}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
set -ex
|
|
4
|
-
|
|
5
|
-
if [[ ! -z "$GIT_EMAIL" ]] & [[ ! -z "$GIT_USERNAME" ]]; then
|
|
6
|
-
git config --global push.default simple
|
|
7
|
-
git config --global user.email "$GIT_EMAIL"
|
|
8
|
-
git config --global user.name "$GIT_USERNAME"
|
|
9
|
-
fi
|
|
10
|
-
|
|
11
|
-
git submodule sync
|
|
12
|
-
git submodule update --init --recursive
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const fs = require('fs')
|
|
4
|
-
const path = require('path')
|
|
5
|
-
const project = path.join(__dirname, '../tsconfig.json')
|
|
6
|
-
const dev = fs.existsSync(project)
|
|
7
|
-
|
|
8
|
-
if (dev) {
|
|
9
|
-
require('ts-node').register({project})
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
require(`../${dev ? 'src' : 'lib'}`).run()
|
|
13
|
-
.catch(require('@oclif/errors/handle'))
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const {Command, flags} = require('@oclif/command')
|
|
2
|
-
<%_ const klass = _.upperFirst(_.camelCase(name.split(':').slice(-1).join(':') + ':command')) _%>
|
|
3
|
-
|
|
4
|
-
class <%- klass %> extends Command {
|
|
5
|
-
async run() {
|
|
6
|
-
const {flags} = this.parse(<%- klass %>)
|
|
7
|
-
const name = flags.name || 'world'
|
|
8
|
-
this.log(`hello ${name} from <%- path.replace(/\\/g, '\\\\') %>`)
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
<%- klass %>.description = `Describe the command here
|
|
13
|
-
...
|
|
14
|
-
Extra documentation goes here
|
|
15
|
-
`
|
|
16
|
-
|
|
17
|
-
<%- klass %>.flags = {
|
|
18
|
-
<%_ if (type === 'single') { _%>
|
|
19
|
-
// add --version flag to show CLI version
|
|
20
|
-
version: flags.version({char: 'v'}),
|
|
21
|
-
// add --help flag to show CLI version
|
|
22
|
-
help: flags.help({char: 'h'}),
|
|
23
|
-
<%_ } _%>
|
|
24
|
-
name: flags.string({char: 'n', description: 'name to print'}),
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
module.exports = <%- klass %>
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import {Command, flags} from '@oclif/command'
|
|
2
|
-
<%_ const klass = _.upperFirst(_.camelCase(name)) _%>
|
|
3
|
-
|
|
4
|
-
<%_ if (type === 'single') { _%>
|
|
5
|
-
class <%- klass %> extends Command {
|
|
6
|
-
<%_ } else { _%>
|
|
7
|
-
export default class <%- klass %> extends Command {
|
|
8
|
-
<%_ } _%>
|
|
9
|
-
static description = 'describe the command here'
|
|
10
|
-
|
|
11
|
-
<%_ if (name === 'hello') { _%>
|
|
12
|
-
static examples = [
|
|
13
|
-
`$ <%- cmd %>
|
|
14
|
-
hello world from ./src/<%- name %>.ts!
|
|
15
|
-
`,
|
|
16
|
-
]
|
|
17
|
-
|
|
18
|
-
<%_ } _%>
|
|
19
|
-
static flags = {
|
|
20
|
-
<%_ if (type === 'single') { _%>
|
|
21
|
-
// add --version flag to show CLI version
|
|
22
|
-
version: flags.version({char: 'v'}),
|
|
23
|
-
<%_ } _%>
|
|
24
|
-
help: flags.help({char: 'h'}),
|
|
25
|
-
// flag with a value (-n, --name=VALUE)
|
|
26
|
-
name: flags.string({char: 'n', description: 'name to print'}),
|
|
27
|
-
// flag with no value (-f, --force)
|
|
28
|
-
force: flags.boolean({char: 'f'}),
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
static args = [{name: 'file'}]
|
|
32
|
-
|
|
33
|
-
async run() {
|
|
34
|
-
const {args, flags} = this.parse(<%- klass %>)
|
|
35
|
-
|
|
36
|
-
const name = flags.name ?? 'world'
|
|
37
|
-
this.log(`hello ${name} from <%- path.replace(/\\/g, '\\\\') %>`)
|
|
38
|
-
if (args.file && flags.force) {
|
|
39
|
-
this.log(`you input --force and --file: ${args.file}`)
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
<%_ if (type === 'single') { _%>
|
|
44
|
-
|
|
45
|
-
export = <%- klass %>
|
|
46
|
-
<%_ } _%>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
const {expect, test} = require('@oclif/test')
|
|
2
|
-
<%_ if (type === 'single') { _%>
|
|
3
|
-
const cmd = require('..')
|
|
4
|
-
<%_ } _%>
|
|
5
|
-
|
|
6
|
-
describe('<%- name %>', () => {
|
|
7
|
-
test
|
|
8
|
-
.stdout()
|
|
9
|
-
<%_ if (type === 'single') { _%>
|
|
10
|
-
.do(() => cmd.run([]))
|
|
11
|
-
<%_ } else { _%>
|
|
12
|
-
.command(['<%- name %>'])
|
|
13
|
-
<%_ } _%>
|
|
14
|
-
.it('runs hello', ctx => {
|
|
15
|
-
expect(ctx.stdout).to.contain('hello world')
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
test
|
|
19
|
-
.stdout()
|
|
20
|
-
<%_ if (type === 'single') { _%>
|
|
21
|
-
.do(() => cmd.run(['--name', 'jeff']))
|
|
22
|
-
<%_ } else { _%>
|
|
23
|
-
.command(['<%- name %>', '--name', 'jeff'])
|
|
24
|
-
<%_ } _%>
|
|
25
|
-
.it('runs hello --name jeff', ctx => {
|
|
26
|
-
expect(ctx.stdout).to.contain('hello jeff')
|
|
27
|
-
})
|
|
28
|
-
})
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {expect, test} from '@oclif/test'
|
|
2
|
-
<%_ if (type === 'single') { _%>
|
|
3
|
-
|
|
4
|
-
import cmd = require('../src')
|
|
5
|
-
<%_ } _%>
|
|
6
|
-
|
|
7
|
-
describe('<%- name %>', () => {
|
|
8
|
-
test
|
|
9
|
-
.stdout()
|
|
10
|
-
<%_ if (type === 'single') { _%>
|
|
11
|
-
.do(() => cmd.run([]))
|
|
12
|
-
<%_ } else { _%>
|
|
13
|
-
.command(['<%- name %>'])
|
|
14
|
-
<%_ } _%>
|
|
15
|
-
.it('runs hello', ctx => {
|
|
16
|
-
expect(ctx.stdout).to.contain('hello world')
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
test
|
|
20
|
-
.stdout()
|
|
21
|
-
<%_ if (type === 'single') { _%>
|
|
22
|
-
.do(() => cmd.run(['--name', 'jeff']))
|
|
23
|
-
<%_ } else { _%>
|
|
24
|
-
.command(['<%- name %>', '--name', 'jeff'])
|
|
25
|
-
<%_ } _%>
|
|
26
|
-
.it('runs hello --name jeff', ctx => {
|
|
27
|
-
expect(ctx.stdout).to.contain('hello jeff')
|
|
28
|
-
})
|
|
29
|
-
})
|
package/templates/travis.yml.ejs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
language: node_js
|
|
2
|
-
node_js:
|
|
3
|
-
- node
|
|
4
|
-
|
|
5
|
-
cache: <%- yarn ? 'yarn' : 'npm' %>
|
|
6
|
-
|
|
7
|
-
script:
|
|
8
|
-
<%_ if (type === 'single' || type === 'multi') { _%>
|
|
9
|
-
- ./bin/run --version
|
|
10
|
-
- ./bin/run --help
|
|
11
|
-
<%_ } else if (type === 'plugin') { _%>
|
|
12
|
-
- ./bin/run --help
|
|
13
|
-
<%_ } _%>
|
|
14
|
-
- <%- yarn ? 'yarn' : 'npm' %> run test
|
package/templates/tsconfig.json
DELETED