@oclif/plugin-test-cjs-2 0.1.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/README.md +303 -0
- package/bin/dev +17 -0
- package/bin/dev.cmd +3 -0
- package/bin/run +5 -0
- package/bin/run.cmd +3 -0
- package/dist/commands/cjs2.d.ts +4 -0
- package/dist/commands/cjs2.js +9 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -0
- package/oclif.manifest.json +15 -0
- package/package.json +72 -0
package/README.md
ADDED
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
oclif-hello-world
|
|
2
|
+
=================
|
|
3
|
+
|
|
4
|
+
oclif example Hello World CLI
|
|
5
|
+
|
|
6
|
+
[](https://oclif.io)
|
|
7
|
+
[](https://circleci.com/gh/oclif/hello-world/tree/main)
|
|
8
|
+
[](https://github.com/oclif/hello-world/blob/main/LICENSE)
|
|
9
|
+
|
|
10
|
+
<!-- toc -->
|
|
11
|
+
* [Usage](#usage)
|
|
12
|
+
* [Commands](#commands)
|
|
13
|
+
<!-- tocstop -->
|
|
14
|
+
# Usage
|
|
15
|
+
<!-- usage -->
|
|
16
|
+
```sh-session
|
|
17
|
+
$ npm install -g @oclif/plugin-test-cjs-2
|
|
18
|
+
$ cjs2 COMMAND
|
|
19
|
+
running command...
|
|
20
|
+
$ cjs2 (--version)
|
|
21
|
+
@oclif/plugin-test-cjs-2/0.1.0 linux-x64 node-v18.17.0
|
|
22
|
+
$ cjs2 --help [COMMAND]
|
|
23
|
+
USAGE
|
|
24
|
+
$ cjs2 COMMAND
|
|
25
|
+
...
|
|
26
|
+
```
|
|
27
|
+
<!-- usagestop -->
|
|
28
|
+
# Commands
|
|
29
|
+
<!-- commands -->
|
|
30
|
+
* [`cjs2 cjs2`](#cjs2-cjs2)
|
|
31
|
+
* [`cjs2 help [COMMANDS]`](#cjs2-help-commands)
|
|
32
|
+
* [`cjs2 plugins`](#cjs2-plugins)
|
|
33
|
+
* [`cjs2 plugins:install PLUGIN...`](#cjs2-pluginsinstall-plugin)
|
|
34
|
+
* [`cjs2 plugins:inspect PLUGIN...`](#cjs2-pluginsinspect-plugin)
|
|
35
|
+
* [`cjs2 plugins:install PLUGIN...`](#cjs2-pluginsinstall-plugin-1)
|
|
36
|
+
* [`cjs2 plugins:link PLUGIN`](#cjs2-pluginslink-plugin)
|
|
37
|
+
* [`cjs2 plugins:uninstall PLUGIN...`](#cjs2-pluginsuninstall-plugin)
|
|
38
|
+
* [`cjs2 plugins:uninstall PLUGIN...`](#cjs2-pluginsuninstall-plugin-1)
|
|
39
|
+
* [`cjs2 plugins:uninstall PLUGIN...`](#cjs2-pluginsuninstall-plugin-2)
|
|
40
|
+
* [`cjs2 plugins update`](#cjs2-plugins-update)
|
|
41
|
+
|
|
42
|
+
## `cjs2 cjs2`
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
USAGE
|
|
46
|
+
$ cjs2 cjs2
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
_See code: [dist/commands/cjs2.ts](https://github.com/oclif/plugin-test-cjs-2/blob/v0.1.0/dist/commands/cjs2.ts)_
|
|
50
|
+
|
|
51
|
+
## `cjs2 help [COMMANDS]`
|
|
52
|
+
|
|
53
|
+
Display help for cjs2.
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
USAGE
|
|
57
|
+
$ cjs2 help [COMMANDS] [-n]
|
|
58
|
+
|
|
59
|
+
ARGUMENTS
|
|
60
|
+
COMMANDS Command to show help for.
|
|
61
|
+
|
|
62
|
+
FLAGS
|
|
63
|
+
-n, --nested-commands Include all nested commands in the output.
|
|
64
|
+
|
|
65
|
+
DESCRIPTION
|
|
66
|
+
Display help for cjs2.
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.14/src/commands/help.ts)_
|
|
70
|
+
|
|
71
|
+
## `cjs2 plugins`
|
|
72
|
+
|
|
73
|
+
List installed plugins.
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
USAGE
|
|
77
|
+
$ cjs2 plugins [--core]
|
|
78
|
+
|
|
79
|
+
FLAGS
|
|
80
|
+
--core Show core plugins.
|
|
81
|
+
|
|
82
|
+
DESCRIPTION
|
|
83
|
+
List installed plugins.
|
|
84
|
+
|
|
85
|
+
EXAMPLES
|
|
86
|
+
$ cjs2 plugins
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.4.7/src/commands/plugins/index.ts)_
|
|
90
|
+
|
|
91
|
+
## `cjs2 plugins:install PLUGIN...`
|
|
92
|
+
|
|
93
|
+
Installs a plugin into the CLI.
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
USAGE
|
|
97
|
+
$ cjs2 plugins:install PLUGIN...
|
|
98
|
+
|
|
99
|
+
ARGUMENTS
|
|
100
|
+
PLUGIN Plugin to install.
|
|
101
|
+
|
|
102
|
+
FLAGS
|
|
103
|
+
-f, --force Run yarn install with force flag.
|
|
104
|
+
-h, --help Show CLI help.
|
|
105
|
+
-v, --verbose
|
|
106
|
+
|
|
107
|
+
DESCRIPTION
|
|
108
|
+
Installs a plugin into the CLI.
|
|
109
|
+
Can be installed from npm or a git url.
|
|
110
|
+
|
|
111
|
+
Installation of a user-installed plugin will override a core plugin.
|
|
112
|
+
|
|
113
|
+
e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
|
|
114
|
+
will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
|
|
115
|
+
the CLI without the need to patch and update the whole CLI.
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
ALIASES
|
|
119
|
+
$ cjs2 plugins add
|
|
120
|
+
|
|
121
|
+
EXAMPLES
|
|
122
|
+
$ cjs2 plugins:install myplugin
|
|
123
|
+
|
|
124
|
+
$ cjs2 plugins:install https://github.com/someuser/someplugin
|
|
125
|
+
|
|
126
|
+
$ cjs2 plugins:install someuser/someplugin
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## `cjs2 plugins:inspect PLUGIN...`
|
|
130
|
+
|
|
131
|
+
Displays installation properties of a plugin.
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
USAGE
|
|
135
|
+
$ cjs2 plugins:inspect PLUGIN...
|
|
136
|
+
|
|
137
|
+
ARGUMENTS
|
|
138
|
+
PLUGIN [default: .] Plugin to inspect.
|
|
139
|
+
|
|
140
|
+
FLAGS
|
|
141
|
+
-h, --help Show CLI help.
|
|
142
|
+
-v, --verbose
|
|
143
|
+
|
|
144
|
+
GLOBAL FLAGS
|
|
145
|
+
--json Format output as json.
|
|
146
|
+
|
|
147
|
+
DESCRIPTION
|
|
148
|
+
Displays installation properties of a plugin.
|
|
149
|
+
|
|
150
|
+
EXAMPLES
|
|
151
|
+
$ cjs2 plugins:inspect myplugin
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## `cjs2 plugins:install PLUGIN...`
|
|
155
|
+
|
|
156
|
+
Installs a plugin into the CLI.
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
USAGE
|
|
160
|
+
$ cjs2 plugins:install PLUGIN...
|
|
161
|
+
|
|
162
|
+
ARGUMENTS
|
|
163
|
+
PLUGIN Plugin to install.
|
|
164
|
+
|
|
165
|
+
FLAGS
|
|
166
|
+
-f, --force Run yarn install with force flag.
|
|
167
|
+
-h, --help Show CLI help.
|
|
168
|
+
-v, --verbose
|
|
169
|
+
|
|
170
|
+
DESCRIPTION
|
|
171
|
+
Installs a plugin into the CLI.
|
|
172
|
+
Can be installed from npm or a git url.
|
|
173
|
+
|
|
174
|
+
Installation of a user-installed plugin will override a core plugin.
|
|
175
|
+
|
|
176
|
+
e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
|
|
177
|
+
will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
|
|
178
|
+
the CLI without the need to patch and update the whole CLI.
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
ALIASES
|
|
182
|
+
$ cjs2 plugins add
|
|
183
|
+
|
|
184
|
+
EXAMPLES
|
|
185
|
+
$ cjs2 plugins:install myplugin
|
|
186
|
+
|
|
187
|
+
$ cjs2 plugins:install https://github.com/someuser/someplugin
|
|
188
|
+
|
|
189
|
+
$ cjs2 plugins:install someuser/someplugin
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## `cjs2 plugins:link PLUGIN`
|
|
193
|
+
|
|
194
|
+
Links a plugin into the CLI for development.
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
USAGE
|
|
198
|
+
$ cjs2 plugins:link PLUGIN
|
|
199
|
+
|
|
200
|
+
ARGUMENTS
|
|
201
|
+
PATH [default: .] path to plugin
|
|
202
|
+
|
|
203
|
+
FLAGS
|
|
204
|
+
-h, --help Show CLI help.
|
|
205
|
+
-v, --verbose
|
|
206
|
+
|
|
207
|
+
DESCRIPTION
|
|
208
|
+
Links a plugin into the CLI for development.
|
|
209
|
+
Installation of a linked plugin will override a user-installed or core plugin.
|
|
210
|
+
|
|
211
|
+
e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
|
|
212
|
+
command will override the user-installed or core plugin implementation. This is useful for development work.
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
EXAMPLES
|
|
216
|
+
$ cjs2 plugins:link myplugin
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## `cjs2 plugins:uninstall PLUGIN...`
|
|
220
|
+
|
|
221
|
+
Removes a plugin from the CLI.
|
|
222
|
+
|
|
223
|
+
```
|
|
224
|
+
USAGE
|
|
225
|
+
$ cjs2 plugins:uninstall PLUGIN...
|
|
226
|
+
|
|
227
|
+
ARGUMENTS
|
|
228
|
+
PLUGIN plugin to uninstall
|
|
229
|
+
|
|
230
|
+
FLAGS
|
|
231
|
+
-h, --help Show CLI help.
|
|
232
|
+
-v, --verbose
|
|
233
|
+
|
|
234
|
+
DESCRIPTION
|
|
235
|
+
Removes a plugin from the CLI.
|
|
236
|
+
|
|
237
|
+
ALIASES
|
|
238
|
+
$ cjs2 plugins unlink
|
|
239
|
+
$ cjs2 plugins remove
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## `cjs2 plugins:uninstall PLUGIN...`
|
|
243
|
+
|
|
244
|
+
Removes a plugin from the CLI.
|
|
245
|
+
|
|
246
|
+
```
|
|
247
|
+
USAGE
|
|
248
|
+
$ cjs2 plugins:uninstall PLUGIN...
|
|
249
|
+
|
|
250
|
+
ARGUMENTS
|
|
251
|
+
PLUGIN plugin to uninstall
|
|
252
|
+
|
|
253
|
+
FLAGS
|
|
254
|
+
-h, --help Show CLI help.
|
|
255
|
+
-v, --verbose
|
|
256
|
+
|
|
257
|
+
DESCRIPTION
|
|
258
|
+
Removes a plugin from the CLI.
|
|
259
|
+
|
|
260
|
+
ALIASES
|
|
261
|
+
$ cjs2 plugins unlink
|
|
262
|
+
$ cjs2 plugins remove
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## `cjs2 plugins:uninstall PLUGIN...`
|
|
266
|
+
|
|
267
|
+
Removes a plugin from the CLI.
|
|
268
|
+
|
|
269
|
+
```
|
|
270
|
+
USAGE
|
|
271
|
+
$ cjs2 plugins:uninstall PLUGIN...
|
|
272
|
+
|
|
273
|
+
ARGUMENTS
|
|
274
|
+
PLUGIN plugin to uninstall
|
|
275
|
+
|
|
276
|
+
FLAGS
|
|
277
|
+
-h, --help Show CLI help.
|
|
278
|
+
-v, --verbose
|
|
279
|
+
|
|
280
|
+
DESCRIPTION
|
|
281
|
+
Removes a plugin from the CLI.
|
|
282
|
+
|
|
283
|
+
ALIASES
|
|
284
|
+
$ cjs2 plugins unlink
|
|
285
|
+
$ cjs2 plugins remove
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
## `cjs2 plugins update`
|
|
289
|
+
|
|
290
|
+
Update installed plugins.
|
|
291
|
+
|
|
292
|
+
```
|
|
293
|
+
USAGE
|
|
294
|
+
$ cjs2 plugins update [-h] [-v]
|
|
295
|
+
|
|
296
|
+
FLAGS
|
|
297
|
+
-h, --help Show CLI help.
|
|
298
|
+
-v, --verbose
|
|
299
|
+
|
|
300
|
+
DESCRIPTION
|
|
301
|
+
Update installed plugins.
|
|
302
|
+
```
|
|
303
|
+
<!-- commandsstop -->
|
package/bin/dev
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const oclif = require('@oclif/core')
|
|
4
|
+
|
|
5
|
+
const path = require('path')
|
|
6
|
+
const project = path.join(__dirname, '..', 'tsconfig.json')
|
|
7
|
+
|
|
8
|
+
// In dev mode -> use ts-node and dev plugins
|
|
9
|
+
process.env.NODE_ENV = 'development'
|
|
10
|
+
|
|
11
|
+
require('ts-node').register({project})
|
|
12
|
+
|
|
13
|
+
// In dev mode, always show stack traces
|
|
14
|
+
oclif.settings.debug = true;
|
|
15
|
+
|
|
16
|
+
// Start the CLI
|
|
17
|
+
oclif.run().then(oclif.flush).catch(oclif.Errors.handle)
|
package/bin/dev.cmd
ADDED
package/bin/run
ADDED
package/bin/run.cmd
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
class CJS2 extends core_1.Command {
|
|
5
|
+
async run() {
|
|
6
|
+
this.log(`hello I am a CJS plugin from ${this.config.root}!`);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.default = CJS2;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { run } from '@oclif/core';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.1.0",
|
|
3
|
+
"commands": {
|
|
4
|
+
"cjs2": {
|
|
5
|
+
"id": "cjs2",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"pluginName": "@oclif/plugin-test-cjs-2",
|
|
8
|
+
"pluginAlias": "@oclif/plugin-test-cjs-2",
|
|
9
|
+
"pluginType": "core",
|
|
10
|
+
"aliases": [],
|
|
11
|
+
"flags": {},
|
|
12
|
+
"args": {}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@oclif/plugin-test-cjs-2",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Test CJS plugin",
|
|
5
|
+
"author": "Salesforce",
|
|
6
|
+
"bin": {
|
|
7
|
+
"cjs2": "./bin/run"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/oclif/plugin-test-cjs-2",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"main": "dist/index.js",
|
|
12
|
+
"repository": "oclif/plugin-test-cjs-2",
|
|
13
|
+
"files": [
|
|
14
|
+
"/bin",
|
|
15
|
+
"/dist",
|
|
16
|
+
"/npm-shrinkwrap.json",
|
|
17
|
+
"/oclif.manifest.json"
|
|
18
|
+
],
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@oclif/core": "^2",
|
|
21
|
+
"@oclif/plugin-help": "^5",
|
|
22
|
+
"@oclif/plugin-plugins": "^2.4.7"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@oclif/test": "^2.4.0",
|
|
26
|
+
"@types/chai": "^4",
|
|
27
|
+
"@types/mocha": "^9.0.0",
|
|
28
|
+
"@types/node": "^16.18.39",
|
|
29
|
+
"chai": "^4",
|
|
30
|
+
"eslint": "^7.32.0",
|
|
31
|
+
"eslint-config-oclif": "^4",
|
|
32
|
+
"eslint-config-oclif-typescript": "^1.0.3",
|
|
33
|
+
"mocha": "^9",
|
|
34
|
+
"oclif": "^3.10.0",
|
|
35
|
+
"shx": "^0.3.3",
|
|
36
|
+
"ts-node": "^10.9.1",
|
|
37
|
+
"tslib": "^2.6.1",
|
|
38
|
+
"typescript": "^4.9.5"
|
|
39
|
+
},
|
|
40
|
+
"oclif": {
|
|
41
|
+
"bin": "cjs2",
|
|
42
|
+
"dirname": "cjs2",
|
|
43
|
+
"commands": "./dist/commands",
|
|
44
|
+
"plugins": [
|
|
45
|
+
"@oclif/plugin-help",
|
|
46
|
+
"@oclif/plugin-plugins"
|
|
47
|
+
],
|
|
48
|
+
"topicSeparator": " ",
|
|
49
|
+
"topics": {
|
|
50
|
+
"hello": {
|
|
51
|
+
"description": "Say hello to the world and others"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"scripts": {
|
|
56
|
+
"build": "shx rm -rf dist && tsc -b",
|
|
57
|
+
"lint": "eslint . --ext .ts --config .eslintrc",
|
|
58
|
+
"postpack": "shx rm -f oclif.manifest.json",
|
|
59
|
+
"posttest": "yarn lint",
|
|
60
|
+
"prepack": "yarn build && oclif manifest && oclif readme",
|
|
61
|
+
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
|
|
62
|
+
"version": "oclif readme && git add README.md"
|
|
63
|
+
},
|
|
64
|
+
"engines": {
|
|
65
|
+
"node": ">=12.0.0"
|
|
66
|
+
},
|
|
67
|
+
"bugs": "https://github.com/oclif/plugin-test-cjs-2/issues",
|
|
68
|
+
"keywords": [
|
|
69
|
+
"oclif"
|
|
70
|
+
],
|
|
71
|
+
"types": "dist/index.d.ts"
|
|
72
|
+
}
|