@neurodevs/ndx-cli 0.1.5 → 0.1.6
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.
|
@@ -3,13 +3,13 @@ export default class CliCommandRunner implements CommandRunner {
|
|
|
3
3
|
static Class?: CommandRunnerConstructor;
|
|
4
4
|
static prompts: typeof prompts;
|
|
5
5
|
private args;
|
|
6
|
+
private readonly createModuleCommand;
|
|
6
7
|
private interfaceName;
|
|
7
8
|
private implName;
|
|
9
|
+
private readonly createPackageCommand;
|
|
8
10
|
private packageName;
|
|
9
11
|
private description;
|
|
10
12
|
private keywords;
|
|
11
|
-
private readonly createModuleCommand;
|
|
12
|
-
private readonly createPackageCommand;
|
|
13
13
|
private readonly supportedCommands;
|
|
14
14
|
protected constructor(args: string[]);
|
|
15
15
|
static Create(args: string[]): CommandRunner;
|
|
@@ -26,7 +26,8 @@ export default class CliCommandRunner implements CommandRunner {
|
|
|
26
26
|
private createPackage;
|
|
27
27
|
private promptForAutopackage;
|
|
28
28
|
private readonly packageNameMessage;
|
|
29
|
-
private readonly
|
|
29
|
+
private readonly descriptionMessage;
|
|
30
|
+
private readonly keywordsMessage;
|
|
30
31
|
private splitOnCommaOrWhitespace;
|
|
31
32
|
private get userInputExistsForCreatePackage();
|
|
32
33
|
private expandHomeDir;
|
|
@@ -18,7 +18,8 @@ class CliCommandRunner {
|
|
|
18
18
|
this.interfaceNameMessage = 'What should the interface be called? Example: YourInterface';
|
|
19
19
|
this.implNameMessage = 'What should the implementation class be called? Example: YourInterfaceImpl';
|
|
20
20
|
this.packageNameMessage = 'What should the package be called? Example: useful-package';
|
|
21
|
-
this.
|
|
21
|
+
this.descriptionMessage = 'What should the package description be? Example: A useful package.';
|
|
22
|
+
this.keywordsMessage = 'Enter keywords (comma or space separated, lowercase, optional):';
|
|
22
23
|
this.args = args;
|
|
23
24
|
}
|
|
24
25
|
static Create(args) {
|
|
@@ -95,12 +96,12 @@ class CliCommandRunner {
|
|
|
95
96
|
{
|
|
96
97
|
type: 'text',
|
|
97
98
|
name: 'description',
|
|
98
|
-
message: this.
|
|
99
|
+
message: this.descriptionMessage,
|
|
99
100
|
},
|
|
100
101
|
{
|
|
101
102
|
type: 'text',
|
|
102
103
|
name: 'keywords',
|
|
103
|
-
message:
|
|
104
|
+
message: this.keywordsMessage,
|
|
104
105
|
initial: '',
|
|
105
106
|
format: (value) => value ? this.splitOnCommaOrWhitespace(value) : [],
|
|
106
107
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CliCommandRunner.js","sourceRoot":"","sources":["../../src/modules/CliCommandRunner.ts"],"names":[],"mappings":";;;;;AAAA,4CAAmB;AACnB,gDAAuB;AACvB,oDAAqE;AACrE,sDAA6B;AAE7B,MAAqB,gBAAgB;
|
|
1
|
+
{"version":3,"file":"CliCommandRunner.js","sourceRoot":"","sources":["../../src/modules/CliCommandRunner.ts"],"names":[],"mappings":";;;;;AAAA,4CAAmB;AACnB,gDAAuB;AACvB,oDAAqE;AACrE,sDAA6B;AAE7B,MAAqB,gBAAgB;IAoBjC,YAAsB,IAAc;QAdnB,wBAAmB,GAAG,eAAe,CAAA;QAIrC,yBAAoB,GAAG,gBAAgB,CAAA;QAKvC,sBAAiB,GAAG;YACjC,IAAI,CAAC,mBAAmB;YACxB,IAAI,CAAC,oBAAoB;SAC5B,CAAA;QAkEgB,yBAAoB,GACjC,6DAA6D,CAAA;QAEhD,oBAAe,GAC5B,4EAA4E,CAAA;QA6C/D,uBAAkB,GAC/B,4DAA4D,CAAA;QAE/C,uBAAkB,GAC/B,oEAAoE,CAAA;QAEvD,oBAAe,GAC5B,iEAAiE,CAAA;QAvHjE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IACpB,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,IAAc;QAC/B,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,CAAA;IACzC,CAAC;IAE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C;;AArLa,wBAAO,GAAG,iBAAO,AAAV,CAAU;kBAFd,gBAAgB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neurodevs/ndx-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "CLI tools for the Neurodevs ecosystem.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nodejs",
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"tdd",
|
|
9
9
|
"cli",
|
|
10
10
|
"neurodevs",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
11
|
+
"packages",
|
|
12
|
+
"modules"
|
|
13
13
|
],
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"author": "Eric Yates <hello@ericthecurious.com>",
|
|
@@ -9,16 +9,15 @@ export default class CliCommandRunner implements CommandRunner {
|
|
|
9
9
|
|
|
10
10
|
private args: string[]
|
|
11
11
|
|
|
12
|
+
private readonly createModuleCommand = 'create.module'
|
|
12
13
|
private interfaceName!: string
|
|
13
14
|
private implName!: string
|
|
14
15
|
|
|
16
|
+
private readonly createPackageCommand = 'create.package'
|
|
15
17
|
private packageName!: string
|
|
16
18
|
private description!: string
|
|
17
19
|
private keywords!: string[]
|
|
18
20
|
|
|
19
|
-
private readonly createModuleCommand = 'create.module'
|
|
20
|
-
private readonly createPackageCommand = 'create.package'
|
|
21
|
-
|
|
22
21
|
private readonly supportedCommands = [
|
|
23
22
|
this.createModuleCommand,
|
|
24
23
|
this.createPackageCommand,
|
|
@@ -124,13 +123,12 @@ export default class CliCommandRunner implements CommandRunner {
|
|
|
124
123
|
{
|
|
125
124
|
type: 'text',
|
|
126
125
|
name: 'description',
|
|
127
|
-
message: this.
|
|
126
|
+
message: this.descriptionMessage,
|
|
128
127
|
},
|
|
129
128
|
{
|
|
130
129
|
type: 'text',
|
|
131
130
|
name: 'keywords',
|
|
132
|
-
message:
|
|
133
|
-
'Enter keywords (comma or space separated, lowercase, optional):',
|
|
131
|
+
message: this.keywordsMessage,
|
|
134
132
|
initial: '',
|
|
135
133
|
format: (value) =>
|
|
136
134
|
value ? this.splitOnCommaOrWhitespace(value) : [],
|
|
@@ -141,9 +139,12 @@ export default class CliCommandRunner implements CommandRunner {
|
|
|
141
139
|
private readonly packageNameMessage =
|
|
142
140
|
'What should the package be called? Example: useful-package'
|
|
143
141
|
|
|
144
|
-
private readonly
|
|
142
|
+
private readonly descriptionMessage =
|
|
145
143
|
'What should the package description be? Example: A useful package.'
|
|
146
144
|
|
|
145
|
+
private readonly keywordsMessage =
|
|
146
|
+
'Enter keywords (comma or space separated, lowercase, optional):'
|
|
147
|
+
|
|
147
148
|
private splitOnCommaOrWhitespace(value: string) {
|
|
148
149
|
return value
|
|
149
150
|
.split(/[\s,]+/)
|