@neurodevs/ndx-cli 0.0.1 → 0.0.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.
- package/.vscode/tasks.json +18 -0
- package/build/__tests__/modules/CliCommandRunner.test.d.ts +1 -0
- package/build/__tests__/modules/CliCommandRunner.test.js +13 -2
- package/build/__tests__/modules/CliCommandRunner.test.js.map +1 -1
- package/build/modules/CliCommandRunner.d.ts +1 -0
- package/build/modules/CliCommandRunner.js +8 -2
- package/build/modules/CliCommandRunner.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/modules/CliCommandRunner.test.ts +18 -2
- package/src/modules/CliCommandRunner.ts +10 -2
package/.vscode/tasks.json
CHANGED
|
@@ -87,6 +87,18 @@
|
|
|
87
87
|
"panel": "new",
|
|
88
88
|
"clear": false
|
|
89
89
|
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"label": "ndx",
|
|
93
|
+
"type": "shell",
|
|
94
|
+
"command": "ndx ${input:ndxCommand}",
|
|
95
|
+
"problemMatcher": [],
|
|
96
|
+
"presentation": {
|
|
97
|
+
"reveal": "always",
|
|
98
|
+
"focus": true,
|
|
99
|
+
"panel": "new",
|
|
100
|
+
"clear": false
|
|
101
|
+
}
|
|
90
102
|
}
|
|
91
103
|
],
|
|
92
104
|
"inputs": [
|
|
@@ -107,6 +119,12 @@
|
|
|
107
119
|
"description": "optionsCommand",
|
|
108
120
|
"default": "add",
|
|
109
121
|
"type": "promptString"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"id": "ndxCommand",
|
|
125
|
+
"description": "ndx command",
|
|
126
|
+
"default": "create.module",
|
|
127
|
+
"type": "promptString"
|
|
110
128
|
}
|
|
111
129
|
]
|
|
112
130
|
}
|
|
@@ -7,6 +7,7 @@ export default class CliCommandRunnerTest extends AbstractSpruceTest {
|
|
|
7
7
|
protected static promptsUserForInput(): Promise<void>;
|
|
8
8
|
protected static createsNodeAutomodule(): Promise<void>;
|
|
9
9
|
protected static callsRunOnNodeAutomodule(): Promise<void>;
|
|
10
|
+
protected static doesNotContinueIfPromptsIsInterrupted(): Promise<void>;
|
|
10
11
|
private static run;
|
|
11
12
|
private static setFakeAutomodule;
|
|
12
13
|
private static setFakePrompts;
|
|
@@ -90,6 +90,14 @@ class CliCommandRunnerTest extends test_utils_1.default {
|
|
|
90
90
|
await this.run();
|
|
91
91
|
test_utils_1.assert.isEqual(meta_node_1.FakeAutomodule.numCallsToRun, 1, 'Did not call run on Automodule!');
|
|
92
92
|
}
|
|
93
|
+
static async doesNotContinueIfPromptsIsInterrupted() {
|
|
94
|
+
(0, fakePrompts_1.setFakePromptsResponses)({
|
|
95
|
+
interfaceName: '',
|
|
96
|
+
implName: '',
|
|
97
|
+
});
|
|
98
|
+
await this.run();
|
|
99
|
+
test_utils_1.assert.isEqual(meta_node_1.FakeAutomodule.numCallsToRun, 0, 'Should not have called run on Automodule!');
|
|
100
|
+
}
|
|
93
101
|
static run() {
|
|
94
102
|
return this.instance.run();
|
|
95
103
|
}
|
|
@@ -111,8 +119,8 @@ class CliCommandRunnerTest extends test_utils_1.default {
|
|
|
111
119
|
}
|
|
112
120
|
CliCommandRunnerTest.interfaceName = (0, test_utils_1.generateId)();
|
|
113
121
|
CliCommandRunnerTest.implName = (0, test_utils_1.generateId)();
|
|
114
|
-
CliCommandRunnerTest.interfaceNameMessage = 'What should the interface be called? Example:
|
|
115
|
-
CliCommandRunnerTest.implNameMessage = 'What should the implementation class be called? Example:
|
|
122
|
+
CliCommandRunnerTest.interfaceNameMessage = 'What should the interface be called? Example: YourInterface';
|
|
123
|
+
CliCommandRunnerTest.implNameMessage = 'What should the implementation class be called? Example: YourInterfaceImpl';
|
|
116
124
|
exports.default = CliCommandRunnerTest;
|
|
117
125
|
__decorate([
|
|
118
126
|
(0, test_utils_1.test)()
|
|
@@ -129,4 +137,7 @@ __decorate([
|
|
|
129
137
|
__decorate([
|
|
130
138
|
(0, test_utils_1.test)()
|
|
131
139
|
], CliCommandRunnerTest, "callsRunOnNodeAutomodule", null);
|
|
140
|
+
__decorate([
|
|
141
|
+
(0, test_utils_1.test)()
|
|
142
|
+
], CliCommandRunnerTest, "doesNotContinueIfPromptsIsInterrupted", null);
|
|
132
143
|
//# sourceMappingURL=CliCommandRunner.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CliCommandRunner.test.js","sourceRoot":"","sources":["../../../src/__tests__/modules/CliCommandRunner.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qEAI+B;AAC/B,oDAAqE;AACrE,sFAAgF;AAChF,uEAK8C;AAE9C,MAAqB,oBAAqB,SAAQ,oBAAkB;IAGtD,MAAM,CAAC,KAAK,CAAC,UAAU;QAC7B,MAAM,KAAK,CAAC,UAAU,EAAE,CAAA;QAExB,IAAI,CAAC,iBAAiB,EAAE,CAAA;QACxB,IAAI,CAAC,cAAc,EAAE,CAAA;QAErB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAA;IAC3C,CAAC;IAGsB,AAAb,MAAM,CAAC,KAAK,CAAC,eAAe;QAClC,mBAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,4BAA4B,CAAC,CAAA;IAChE,CAAC;IAGsB,AAAb,MAAM,CAAC,KAAK,CAAC,6BAA6B;QAChD,MAAM,UAAU,GAAG,IAAA,uBAAU,GAAE,CAAA;QAE/B,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,CAAC,UAAU,CAAC,CAAC,CAAA;QAEpD,MAAM,GAAG,GAAG,MAAM,mBAAM,CAAC,cAAc,CACnC,KAAK,IAAI,EAAE,CAAC,MAAM,QAAQ,CAAC,GAAG,EAAE,CACnC,CAAA;QAED,mBAAM,CAAC,OAAO,CACV,GAAG,CAAC,OAAO,EACX,gBAAgB,UAAU,qBAAqB,EAC/C,qCAAqC,C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class CliCommandRunner {
|
|
9
9
|
constructor(args) {
|
|
10
|
-
this.interfaceNameMessage = 'What should the interface be called? Example:
|
|
11
|
-
this.implNameMessage = 'What should the implementation class be called? Example:
|
|
10
|
+
this.interfaceNameMessage = 'What should the interface be called? Example: YourInterface';
|
|
11
|
+
this.implNameMessage = 'What should the implementation class be called? Example: YourInterfaceImpl';
|
|
12
12
|
this.args = args;
|
|
13
13
|
}
|
|
14
14
|
static Create(args) {
|
|
@@ -19,6 +19,9 @@ class CliCommandRunner {
|
|
|
19
19
|
const { interfaceName, implName } = await this.promptUserInput();
|
|
20
20
|
this.currentInterfaceName = interfaceName;
|
|
21
21
|
this.currentImplName = implName;
|
|
22
|
+
if (!this.userInputExists) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
22
25
|
await this.createModule();
|
|
23
26
|
}
|
|
24
27
|
throwIfCommandIsNotSupported() {
|
|
@@ -46,6 +49,9 @@ class CliCommandRunner {
|
|
|
46
49
|
get prompts() {
|
|
47
50
|
return CliCommandRunner.prompts;
|
|
48
51
|
}
|
|
52
|
+
get userInputExists() {
|
|
53
|
+
return this.currentInterfaceName && this.currentImplName;
|
|
54
|
+
}
|
|
49
55
|
async createModule() {
|
|
50
56
|
const automodule = this.NodeAutomodule();
|
|
51
57
|
await automodule.run();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CliCommandRunner.js","sourceRoot":"","sources":["../../src/modules/CliCommandRunner.ts"],"names":[],"mappings":";;;;;AAAA,oDAAqD;AACrD,sDAA6B;AAE7B,MAAqB,gBAAgB;IASjC,YAAsB,IAAc;
|
|
1
|
+
{"version":3,"file":"CliCommandRunner.js","sourceRoot":"","sources":["../../src/modules/CliCommandRunner.ts"],"names":[],"mappings":";;;;;AAAA,oDAAqD;AACrD,sDAA6B;AAE7B,MAAqB,gBAAgB;IASjC,YAAsB,IAAc;QAgDnB,yBAAoB,GACjC,6DAA6D,CAAA;QAEhD,oBAAe,GAC5B,4EAA4E,CAAA;Q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eAAe,CAAA;IAC5D,CAAC;IAEO,KAAK,CAAC,YAAY;QACtB,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,EAAE,CAAA;QACxC,MAAM,UAAU,CAAC,GAAG,EAAE,CAAA;IAC1B,CAAC;IAEO,cAAc;QAClB,OAAO,0BAAc,CAAC,MAAM,CAAC;YACzB,WAAW,EAAE,uBAAuB;YACpC,aAAa,EAAE,aAAa;YAC5B,aAAa,EAAE,IAAI,CAAC,oBAAoB;YACxC,QAAQ,EAAE,IAAI,CAAC,eAAe;SACjC,CAAC,CAAA;IACN,CAAC;;AAjFa,wBAAO,GAAG,iBAAO,AAAV,CAAU;kBAFd,gBAAgB"}
|
package/package.json
CHANGED
|
@@ -87,6 +87,22 @@ export default class CliCommandRunnerTest extends AbstractSpruceTest {
|
|
|
87
87
|
)
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
@test()
|
|
91
|
+
protected static async doesNotContinueIfPromptsIsInterrupted() {
|
|
92
|
+
setFakePromptsResponses({
|
|
93
|
+
interfaceName: '',
|
|
94
|
+
implName: '',
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
await this.run()
|
|
98
|
+
|
|
99
|
+
assert.isEqual(
|
|
100
|
+
FakeAutomodule.numCallsToRun,
|
|
101
|
+
0,
|
|
102
|
+
'Should not have called run on Automodule!'
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
|
|
90
106
|
private static run() {
|
|
91
107
|
return this.instance.run()
|
|
92
108
|
}
|
|
@@ -110,10 +126,10 @@ export default class CliCommandRunnerTest extends AbstractSpruceTest {
|
|
|
110
126
|
private static readonly implName = generateId()
|
|
111
127
|
|
|
112
128
|
private static readonly interfaceNameMessage =
|
|
113
|
-
'What should the interface be called? Example:
|
|
129
|
+
'What should the interface be called? Example: YourInterface'
|
|
114
130
|
|
|
115
131
|
private static readonly implNameMessage =
|
|
116
|
-
'What should the implementation class be called? Example:
|
|
132
|
+
'What should the implementation class be called? Example: YourInterfaceImpl'
|
|
117
133
|
|
|
118
134
|
private static CliCommandRunner(args?: string[]) {
|
|
119
135
|
return CliCommandRunner.Create(args ?? ['create.module'])
|
|
@@ -26,6 +26,10 @@ export default class CliCommandRunner implements CommandRunner {
|
|
|
26
26
|
this.currentInterfaceName = interfaceName
|
|
27
27
|
this.currentImplName = implName
|
|
28
28
|
|
|
29
|
+
if (!this.userInputExists) {
|
|
30
|
+
return
|
|
31
|
+
}
|
|
32
|
+
|
|
29
33
|
await this.createModule()
|
|
30
34
|
}
|
|
31
35
|
|
|
@@ -55,15 +59,19 @@ export default class CliCommandRunner implements CommandRunner {
|
|
|
55
59
|
}
|
|
56
60
|
|
|
57
61
|
private readonly interfaceNameMessage =
|
|
58
|
-
'What should the interface be called? Example:
|
|
62
|
+
'What should the interface be called? Example: YourInterface'
|
|
59
63
|
|
|
60
64
|
private readonly implNameMessage =
|
|
61
|
-
'What should the implementation class be called? Example:
|
|
65
|
+
'What should the implementation class be called? Example: YourInterfaceImpl'
|
|
62
66
|
|
|
63
67
|
private get prompts() {
|
|
64
68
|
return CliCommandRunner.prompts
|
|
65
69
|
}
|
|
66
70
|
|
|
71
|
+
private get userInputExists() {
|
|
72
|
+
return this.currentInterfaceName && this.currentImplName
|
|
73
|
+
}
|
|
74
|
+
|
|
67
75
|
private async createModule() {
|
|
68
76
|
const automodule = this.NodeAutomodule()
|
|
69
77
|
await automodule.run()
|