@neurodevs/ndx-cli 0.0.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.
Files changed (47) hide show
  1. package/.nvmrc +1 -0
  2. package/.vscode/launch.json +58 -0
  3. package/.vscode/settings.json +67 -0
  4. package/.vscode/tasks.json +112 -0
  5. package/LICENSE +21 -0
  6. package/README.md +2 -0
  7. package/build/.spruce/settings.json +11 -0
  8. package/build/__tests__/modules/CliCommandRunner.test.d.ts +18 -0
  9. package/build/__tests__/modules/CliCommandRunner.test.js +132 -0
  10. package/build/__tests__/modules/CliCommandRunner.test.js.map +1 -0
  11. package/build/__tests__/modules/NeurodevsAutocloner.test.d.ts +14 -0
  12. package/build/__tests__/modules/NeurodevsAutocloner.test.js +122 -0
  13. package/build/__tests__/modules/NeurodevsAutocloner.test.js.map +1 -0
  14. package/build/cli.d.ts +2 -0
  15. package/build/cli.js +17 -0
  16. package/build/cli.js.map +1 -0
  17. package/build/index.d.ts +0 -0
  18. package/build/index.js +3 -0
  19. package/build/index.js.map +1 -0
  20. package/build/modules/CliCommandRunner.d.ts +23 -0
  21. package/build/modules/CliCommandRunner.js +64 -0
  22. package/build/modules/CliCommandRunner.js.map +1 -0
  23. package/build/modules/NeurodevsAutocloner.d.ts +18 -0
  24. package/build/modules/NeurodevsAutocloner.js +60 -0
  25. package/build/modules/NeurodevsAutocloner.js.map +1 -0
  26. package/build/scripts/runNeurodevsAutocloner.d.ts +1 -0
  27. package/build/scripts/runNeurodevsAutocloner.js +15 -0
  28. package/build/scripts/runNeurodevsAutocloner.js.map +1 -0
  29. package/build/testDoubles/PresetUrlsAutocloner/FakeNeurodevsAutocloner.d.ts +7 -0
  30. package/build/testDoubles/PresetUrlsAutocloner/FakeNeurodevsAutocloner.js +15 -0
  31. package/build/testDoubles/PresetUrlsAutocloner/FakeNeurodevsAutocloner.js.map +1 -0
  32. package/build/testDoubles/prompts/fakePrompts.d.ts +5 -0
  33. package/build/testDoubles/prompts/fakePrompts.js +19 -0
  34. package/build/testDoubles/prompts/fakePrompts.js.map +1 -0
  35. package/eslint.config.mjs +3 -0
  36. package/package.json +71 -0
  37. package/src/.spruce/settings.json +11 -0
  38. package/src/__tests__/modules/CliCommandRunner.test.ts +121 -0
  39. package/src/__tests__/modules/NeurodevsAutocloner.test.ts +94 -0
  40. package/src/cli.ts +15 -0
  41. package/src/index.ts +1 -0
  42. package/src/modules/CliCommandRunner.ts +86 -0
  43. package/src/modules/NeurodevsAutocloner.ts +77 -0
  44. package/src/scripts/runNeurodevsAutocloner.ts +11 -0
  45. package/src/testDoubles/PresetUrlsAutocloner/FakeNeurodevsAutocloner.ts +15 -0
  46. package/src/testDoubles/prompts/fakePrompts.ts +16 -0
  47. package/tsconfig.json +39 -0
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ lts/*
@@ -0,0 +1,58 @@
1
+ {
2
+ "version": "0.2.0",
3
+ "configurations": [
4
+ {
5
+ "type": "node",
6
+ "request": "attach",
7
+ "name": "attach.tests",
8
+ "port": 5200,
9
+ "restart": true,
10
+ "timeout": 10000
11
+ },
12
+ {
13
+ "type": "node",
14
+ "request": "launch",
15
+ "name": "test.file",
16
+ "runtimeExecutable": "node",
17
+ "runtimeArgs": [
18
+ "--inspect-brk",
19
+ "--trace-warnings",
20
+ "${workspaceFolder}/node_modules/.bin/jest",
21
+ "${fileBasenameNoExtension}",
22
+ "--detectOpenHandles"
23
+ ],
24
+ "cwd": "${workspaceFolder}",
25
+ "console": "integratedTerminal",
26
+ "internalConsoleOptions": "neverOpen"
27
+ },
28
+ {
29
+ "type": "node",
30
+ "request": "launch",
31
+ "name": "test.all",
32
+ "runtimeExecutable": "node",
33
+ "runtimeArgs": [
34
+ "--inspect-brk",
35
+ "--trace-warnings",
36
+ "${workspaceFolder}/node_modules/.bin/jest"
37
+ ],
38
+ "cwd": "${workspaceFolder}",
39
+ "console": "integratedTerminal",
40
+ "internalConsoleOptions": "neverOpen"
41
+ },
42
+ {
43
+ "type": "node",
44
+ "request": "launch",
45
+ "name": "boot",
46
+ "runtimeExecutable": "yarn",
47
+ "runtimeArgs": [
48
+ "run",
49
+ "--inspect-brk",
50
+ "--trace-warnings",
51
+ "boot"
52
+ ],
53
+ "cwd": "${workspaceFolder}",
54
+ "console": "integratedTerminal",
55
+ "internalConsoleOptions": "neverOpen"
56
+ }
57
+ ]
58
+ }
@@ -0,0 +1,67 @@
1
+ {
2
+ "debug.node.autoAttach": "on",
3
+ "git.ignoreLimitWarning": true,
4
+ "javascript.validate.enable": false,
5
+ "files.watcherExclude": {
6
+ "**/.git/objects/**": true,
7
+ "**/.git/subtree-cache/**": true,
8
+ "**/build/**": true,
9
+ "**/node_modules/**": true,
10
+ },
11
+ "search.exclude": {
12
+ "**/build/**": true,
13
+ "**/node_modules/**": true,
14
+ "**/.next/**": true
15
+ },
16
+ "editor.maxTokenizationLineLength": 20000000,
17
+ "[javascript]": {
18
+ "editor.formatOnSave": false
19
+ },
20
+ "[javascriptreact]": {
21
+ "editor.formatOnSave": false
22
+ },
23
+ "[typescript]": {
24
+ "editor.formatOnSave": false
25
+ },
26
+ "[typescriptreact]": {
27
+ "editor.formatOnSave": false
28
+ },
29
+ "[handlebars]": {
30
+ "editor.formatOnSave": false
31
+ },
32
+ "typescript.tsdk": "node_modules/typescript/lib",
33
+ "cSpell.ignorePaths": [
34
+ "**/package-lock.json",
35
+ "**/node_modules/**",
36
+ "**/build/**",
37
+ "**/vscode-extension/**",
38
+ "**/.git/objects/**",
39
+ ".vscode",
40
+ ".spruce"
41
+ ],
42
+ "cSpell.words": [
43
+ "arkit",
44
+ "autogenerated",
45
+ "scrollable",
46
+ "serializable"
47
+ ],
48
+ "debug.javascript.unmapMissingSources": true,
49
+ "javascript.preferences.importModuleSpecifier": "relative",
50
+ "typescript.preferences.importModuleSpecifier": "relative",
51
+ "eslint.useFlatConfig": true,
52
+ "eslint.enable": true,
53
+ "eslint.validate": [
54
+ "javascript",
55
+ "javascriptreact",
56
+ "typescript",
57
+ "typescriptreact"
58
+ ],
59
+ "eslint.workingDirectories": [
60
+ "./"
61
+ ],
62
+ "typescript.validate.enable": true,
63
+ "editor.formatOnSave": false,
64
+ "editor.codeActionsOnSave": {
65
+ "source.fixAll.eslint": "always"
66
+ }
67
+ }
@@ -0,0 +1,112 @@
1
+ {
2
+ "version": "2.0.0",
3
+ "tasks": [
4
+ {
5
+ "type": "npm",
6
+ "script": "watch.build.dev",
7
+ "group": "build",
8
+ "label": "watch.build.dev & problem.watcher",
9
+ "isBackground": true,
10
+ "runOptions": {
11
+ "runOn": "folderOpen"
12
+ },
13
+ "promptOnClose": false,
14
+ "presentation": {
15
+ "focus": false,
16
+ "reveal": "never"
17
+ },
18
+ "problemMatcher": {
19
+ "base": "$tsc-watch",
20
+ "applyTo": "allDocuments"
21
+ }
22
+ },
23
+ {
24
+ "label": "test.file",
25
+ "command": "spruce",
26
+ "args": [
27
+ "test",
28
+ "--inspect",
29
+ "5200",
30
+ "--pattern",
31
+ "${fileBasenameNoExtension}",
32
+ "--watchMode",
33
+ "standard"
34
+ ],
35
+ "promptOnClose": false,
36
+ "group": {
37
+ "kind": "test",
38
+ "isDefault": true
39
+ },
40
+ "presentation": {
41
+ "reveal": "always",
42
+ "panel": "dedicated",
43
+ },
44
+ "problemMatcher": []
45
+ },
46
+ {
47
+ "label": "test.reporter",
48
+ "command": "spruce",
49
+ "args": [
50
+ "test",
51
+ "--shouldHoldAtStart",
52
+ "true",
53
+ "--watchMode",
54
+ "smart"
55
+ ],
56
+ "promptOnClose": false,
57
+ "group": "test",
58
+ "runOptions": {
59
+ "runOn": "folderOpen"
60
+ },
61
+ "presentation": {
62
+ "panel": "shared",
63
+ "focus": true,
64
+ "reveal": "always"
65
+ }
66
+ },
67
+ {
68
+ "label": "spruce",
69
+ "type": "shell",
70
+ "command": "spruce ${input:spruceCommand}",
71
+ "problemMatcher": [],
72
+ "presentation": {
73
+ "reveal": "always",
74
+ "focus": true,
75
+ "panel": "new",
76
+ "clear": false
77
+ }
78
+ },
79
+ {
80
+ "label": "shell",
81
+ "type": "shell",
82
+ "command": "${input:command} ${input:optionsCommand}",
83
+ "problemMatcher": [],
84
+ "presentation": {
85
+ "reveal": "always",
86
+ "focus": true,
87
+ "panel": "new",
88
+ "clear": false
89
+ }
90
+ }
91
+ ],
92
+ "inputs": [
93
+ {
94
+ "id": "spruceCommand",
95
+ "description": "spruce command",
96
+ "default": "create.test",
97
+ "type": "promptString"
98
+ },
99
+ {
100
+ "id": "command",
101
+ "description": "command",
102
+ "default": "yarn",
103
+ "type": "promptString"
104
+ },
105
+ {
106
+ "id": "optionsCommand",
107
+ "description": "optionsCommand",
108
+ "default": "add",
109
+ "type": "promptString"
110
+ }
111
+ ]
112
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 neurodevs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # ndx-cli
2
+ Command-line interface for Neurodevs ndx tools and workflows.
@@ -0,0 +1,11 @@
1
+ {
2
+ "scriptUpdater": {
3
+ "skipped": []
4
+ },
5
+ "skipped": [
6
+ "skill"
7
+ ],
8
+ "installed": [
9
+ "test"
10
+ ]
11
+ }
@@ -0,0 +1,18 @@
1
+ import AbstractSpruceTest from '@sprucelabs/test-utils';
2
+ export default class CliCommandRunnerTest extends AbstractSpruceTest {
3
+ private static instance;
4
+ protected static beforeEach(): Promise<void>;
5
+ protected static createsInstance(): Promise<void>;
6
+ protected static throwsIfCommandIsNotSupported(): Promise<void>;
7
+ protected static promptsUserForInput(): Promise<void>;
8
+ protected static createsNodeAutomodule(): Promise<void>;
9
+ protected static callsRunOnNodeAutomodule(): Promise<void>;
10
+ private static run;
11
+ private static setFakeAutomodule;
12
+ private static setFakePrompts;
13
+ private static readonly interfaceName;
14
+ private static readonly implName;
15
+ private static readonly interfaceNameMessage;
16
+ private static readonly implNameMessage;
17
+ private static CliCommandRunner;
18
+ }
@@ -0,0 +1,132 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
19
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
22
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
23
+ };
24
+ var __importStar = (this && this.__importStar) || (function () {
25
+ var ownKeys = function(o) {
26
+ ownKeys = Object.getOwnPropertyNames || function (o) {
27
+ var ar = [];
28
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
29
+ return ar;
30
+ };
31
+ return ownKeys(o);
32
+ };
33
+ return function (mod) {
34
+ if (mod && mod.__esModule) return mod;
35
+ var result = {};
36
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
37
+ __setModuleDefault(result, mod);
38
+ return result;
39
+ };
40
+ })();
41
+ var __importDefault = (this && this.__importDefault) || function (mod) {
42
+ return (mod && mod.__esModule) ? mod : { "default": mod };
43
+ };
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ const test_utils_1 = __importStar(require("@sprucelabs/test-utils"));
46
+ const meta_node_1 = require("@neurodevs/meta-node");
47
+ const CliCommandRunner_1 = __importDefault(require("../../modules/CliCommandRunner"));
48
+ const fakePrompts_1 = require("../../testDoubles/prompts/fakePrompts");
49
+ class CliCommandRunnerTest extends test_utils_1.default {
50
+ static async beforeEach() {
51
+ await super.beforeEach();
52
+ this.setFakeAutomodule();
53
+ this.setFakePrompts();
54
+ this.instance = this.CliCommandRunner();
55
+ }
56
+ static async createsInstance() {
57
+ test_utils_1.assert.isTruthy(this.instance, 'Failed to create instance!');
58
+ }
59
+ static async throwsIfCommandIsNotSupported() {
60
+ const invalidArg = (0, test_utils_1.generateId)();
61
+ const instance = this.CliCommandRunner([invalidArg]);
62
+ const err = await test_utils_1.assert.doesThrowAsync(async () => await instance.run());
63
+ test_utils_1.assert.isEqual(err.message, `The command "${invalidArg}" is not supported!`, 'Did not receive the expected error!');
64
+ }
65
+ static async promptsUserForInput() {
66
+ await this.run();
67
+ test_utils_1.assert.isEqualDeep(fakePrompts_1.callsToFakePrompts[0], [
68
+ {
69
+ type: 'text',
70
+ name: 'interfaceName',
71
+ message: this.interfaceNameMessage,
72
+ },
73
+ {
74
+ type: 'text',
75
+ name: 'implName',
76
+ message: this.implNameMessage,
77
+ },
78
+ ]);
79
+ }
80
+ static async createsNodeAutomodule() {
81
+ await this.run();
82
+ test_utils_1.assert.isEqualDeep(meta_node_1.FakeAutomodule.callsToConstructor[0], {
83
+ testSaveDir: 'src/__tests__/modules',
84
+ moduleSaveDir: 'src/modules',
85
+ interfaceName: this.interfaceName,
86
+ implName: this.implName,
87
+ });
88
+ }
89
+ static async callsRunOnNodeAutomodule() {
90
+ await this.run();
91
+ test_utils_1.assert.isEqual(meta_node_1.FakeAutomodule.numCallsToRun, 1, 'Did not call run on Automodule!');
92
+ }
93
+ static run() {
94
+ return this.instance.run();
95
+ }
96
+ static setFakeAutomodule() {
97
+ meta_node_1.NodeAutomodule.Class = meta_node_1.FakeAutomodule;
98
+ meta_node_1.FakeAutomodule.resetTestDouble();
99
+ }
100
+ static setFakePrompts() {
101
+ CliCommandRunner_1.default.prompts = fakePrompts_1.fakePrompts;
102
+ (0, fakePrompts_1.resetCallsToFakePrompts)();
103
+ (0, fakePrompts_1.setFakePromptsResponses)({
104
+ interfaceName: this.interfaceName,
105
+ implName: this.implName,
106
+ });
107
+ }
108
+ static CliCommandRunner(args) {
109
+ return CliCommandRunner_1.default.Create(args ?? ['create.module']);
110
+ }
111
+ }
112
+ CliCommandRunnerTest.interfaceName = (0, test_utils_1.generateId)();
113
+ CliCommandRunnerTest.implName = (0, test_utils_1.generateId)();
114
+ CliCommandRunnerTest.interfaceNameMessage = 'What should the interface be called? Example: YourClass';
115
+ CliCommandRunnerTest.implNameMessage = 'What should the implementation class be called? Example: YourClassImpl';
116
+ exports.default = CliCommandRunnerTest;
117
+ __decorate([
118
+ (0, test_utils_1.test)()
119
+ ], CliCommandRunnerTest, "createsInstance", null);
120
+ __decorate([
121
+ (0, test_utils_1.test)()
122
+ ], CliCommandRunnerTest, "throwsIfCommandIsNotSupported", null);
123
+ __decorate([
124
+ (0, test_utils_1.test)()
125
+ ], CliCommandRunnerTest, "promptsUserForInput", null);
126
+ __decorate([
127
+ (0, test_utils_1.test)()
128
+ ], CliCommandRunnerTest, "createsNodeAutomodule", null);
129
+ __decorate([
130
+ (0, test_utils_1.test)()
131
+ ], CliCommandRunnerTest, "callsRunOnNodeAutomodule", null);
132
+ //# sourceMappingURL=CliCommandRunner.test.js.map
@@ -0,0 +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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,CAAC,iBAAiB;QAC5B,0BAAc,CAAC,KAAK,GAAG,0BAAc,CAAA;QACrC,0BAAc,CAAC,eAAe,EAAE,CAAA;IACpC,CAAC;IAEO,MAAM,CAAC,cAAc;QACzB,0BAAgB,CAAC,OAAO,GAAG,yBAAkB,CAAA;QAC7C,IAAA,qCAAuB,GAAE,CAAA;QAEzB,IAAA,qCAAuB,EAAC;YACpB,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,QAAQ,EAAE,IAAI,CAAC,QAAQ;SAC1B,CAAC,CAAA;IACN,CAAC;IAWO,MAAM,CAAC,gBAAgB,CAAC,IAAe;QAC3C,OAAO,0BAAgB,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,eAAe,CAAC,CAAC,CAAA;IAC7D,CAAC;;AAXuB,kCAAa,GAAG,IAAA,uBAAU,GAAE,CAAA;AAC5B,6BAAQ,GAAG,IAAA,uBAAU,GAAE,CAAA;AAEvB,yCAAoB,GACxC,yDAAyD,CAAA;AAErC,oCAAe,GACnC,wEAAwE,CAAA;kBArG3D,oBAAoB;AAad;IADtB,IAAA,iBAAI,GAAE;iDAGN;AAGsB;IADtB,IAAA,iBAAI,GAAE;+DAeN;AAGsB;IADtB,IAAA,iBAAI,GAAE;qDAgBN;AAGsB;IADtB,IAAA,iBAAI,GAAE;uDAUN;AAGsB;IADtB,IAAA,iBAAI,GAAE;0DASN"}
@@ -0,0 +1,14 @@
1
+ import AbstractSpruceTest from '@sprucelabs/test-utils';
2
+ export default class NeurodevsAutoclonerTest extends AbstractSpruceTest {
3
+ private static instance;
4
+ protected static beforeEach(): Promise<void>;
5
+ protected static canCreateNeurodevsAutocloner(): Promise<void>;
6
+ protected static createsGitAutocloner(): Promise<void>;
7
+ protected static callsGitAutoclonerWithExpectedOptions(): Promise<void>;
8
+ private static repoNames;
9
+ private static generateUrl;
10
+ private static repoUrls;
11
+ private static readonly dirPath;
12
+ private static setFakeAutocloner;
13
+ private static NeurodevsAutocloner;
14
+ }
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
19
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
22
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
23
+ };
24
+ var __importStar = (this && this.__importStar) || (function () {
25
+ var ownKeys = function(o) {
26
+ ownKeys = Object.getOwnPropertyNames || function (o) {
27
+ var ar = [];
28
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
29
+ return ar;
30
+ };
31
+ return ownKeys(o);
32
+ };
33
+ return function (mod) {
34
+ if (mod && mod.__esModule) return mod;
35
+ var result = {};
36
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
37
+ __setModuleDefault(result, mod);
38
+ return result;
39
+ };
40
+ })();
41
+ var __importDefault = (this && this.__importDefault) || function (mod) {
42
+ return (mod && mod.__esModule) ? mod : { "default": mod };
43
+ };
44
+ var _a;
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ const test_utils_1 = __importStar(require("@sprucelabs/test-utils"));
47
+ const meta_node_1 = require("@neurodevs/meta-node");
48
+ const NeurodevsAutocloner_1 = __importDefault(require("../../modules/NeurodevsAutocloner"));
49
+ class NeurodevsAutoclonerTest extends test_utils_1.default {
50
+ static async beforeEach() {
51
+ await super.beforeEach();
52
+ this.setFakeAutocloner();
53
+ this.instance = this.NeurodevsAutocloner();
54
+ }
55
+ static async canCreateNeurodevsAutocloner() {
56
+ test_utils_1.assert.isTruthy(this.instance, 'Should create a new instance!');
57
+ }
58
+ static async createsGitAutocloner() {
59
+ test_utils_1.assert.isEqual(meta_node_1.FakeAutocloner.numCallsToConstructor, 1, 'Should create a new instance of GitAutocloner!');
60
+ }
61
+ static async callsGitAutoclonerWithExpectedOptions() {
62
+ await this.instance.run(this.dirPath);
63
+ const options = meta_node_1.FakeAutocloner.callsToRun[0];
64
+ test_utils_1.assert.isEqualDeep(options, {
65
+ urls: this.repoUrls,
66
+ dirPath: this.dirPath,
67
+ });
68
+ }
69
+ static generateUrl(repoName) {
70
+ return `https://github.com/neurodevs/${repoName}.git`;
71
+ }
72
+ static setFakeAutocloner() {
73
+ meta_node_1.GitAutocloner.Class = meta_node_1.FakeAutocloner;
74
+ meta_node_1.FakeAutocloner.resetTestDouble();
75
+ }
76
+ static NeurodevsAutocloner() {
77
+ return NeurodevsAutocloner_1.default.Create();
78
+ }
79
+ }
80
+ _a = NeurodevsAutoclonerTest;
81
+ NeurodevsAutoclonerTest.repoNames = [
82
+ 'fili.js',
83
+ 'labrecorder',
84
+ 'liblsl',
85
+ 'libxdf',
86
+ 'node-autocloner',
87
+ 'node-autopackage',
88
+ 'node-autoupgrader',
89
+ 'node-biometrics',
90
+ 'node-biosensors',
91
+ 'node-biosignal-experiments',
92
+ 'node-ble',
93
+ 'node-csv',
94
+ 'node-eeg',
95
+ 'node-file-checker',
96
+ 'node-file-loader',
97
+ 'node-html-loader',
98
+ 'node-knowledge-graphs',
99
+ 'node-lsl',
100
+ 'node-mangled-names',
101
+ 'node-neuropype',
102
+ 'node-ppg',
103
+ 'node-server-plots',
104
+ 'node-signal-processing',
105
+ 'node-task-queue',
106
+ 'node-test-counter',
107
+ 'node-xdf',
108
+ 'personomic',
109
+ ];
110
+ NeurodevsAutoclonerTest.repoUrls = _a.repoNames.map(_a.generateUrl);
111
+ NeurodevsAutoclonerTest.dirPath = (0, test_utils_1.generateId)();
112
+ exports.default = NeurodevsAutoclonerTest;
113
+ __decorate([
114
+ (0, test_utils_1.test)()
115
+ ], NeurodevsAutoclonerTest, "canCreateNeurodevsAutocloner", null);
116
+ __decorate([
117
+ (0, test_utils_1.test)()
118
+ ], NeurodevsAutoclonerTest, "createsGitAutocloner", null);
119
+ __decorate([
120
+ (0, test_utils_1.test)()
121
+ ], NeurodevsAutoclonerTest, "callsGitAutoclonerWithExpectedOptions", null);
122
+ //# sourceMappingURL=NeurodevsAutocloner.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NeurodevsAutocloner.test.js","sourceRoot":"","sources":["../../../src/__tests__/modules/NeurodevsAutocloner.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qEAI+B;AAC/B,oDAAoE;AACpE,4FAE0C;AAE1C,MAAqB,uBAAwB,SAAQ,oBAAkB;IAGzD,MAAM,CAAC,KAAK,CAAC,UAAU;QAC7B,MAAM,KAAK,CAAC,UAAU,EAAE,CAAA;QAExB,IAAI,CAAC,iBAAiB,EAAE,CAAA;QAExB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAA;IAC9C,CAAC;IAGsB,AAAb,MAAM,CAAC,KAAK,CAAC,4BAA4B;QAC/C,mBAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,+BAA+B,CAAC,CAAA;IACnE,CAAC;IA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AC,EAAI,CAAC,WAAW,CAAC,AAAvC,CAAuC;AAEtC,+BAAO,GAAG,IAAA,uBAAU,GAAE,AAAf,CAAe;kBAzE7B,uBAAuB;AAYjB;IADtB,IAAA,iBAAI,GAAE;iEAGN;AAGsB;IADtB,IAAA,iBAAI,GAAE;yDAON;AAGsB;IADtB,IAAA,iBAAI,GAAE;0EAUN"}
package/build/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/build/cli.js ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const CliCommandRunner_1 = __importDefault(require("./modules/CliCommandRunner"));
8
+ async function main() {
9
+ const args = process.argv.slice(2);
10
+ const runner = CliCommandRunner_1.default.Create(args);
11
+ await runner.run();
12
+ }
13
+ main().catch((err) => {
14
+ console.error(err);
15
+ process.exit(1);
16
+ });
17
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;AAEA,kFAAyD;AAEzD,KAAK,UAAU,IAAI;IACf,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAElC,MAAM,MAAM,GAAG,0BAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAC5C,MAAM,MAAM,CAAC,GAAG,EAAE,CAAA;AACtB,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACnB,CAAC,CAAC,CAAA"}
File without changes
package/build/index.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ //exports go here
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,iBAAiB"}
@@ -0,0 +1,23 @@
1
+ import prompts from 'prompts';
2
+ export default class CliCommandRunner implements CommandRunner {
3
+ static Class?: CommandRunnerConstructor;
4
+ static prompts: typeof prompts;
5
+ private args;
6
+ private currentInterfaceName;
7
+ private currentImplName;
8
+ protected constructor(args: string[]);
9
+ static Create(args: string[]): CommandRunner;
10
+ run(): Promise<void>;
11
+ private throwIfCommandIsNotSupported;
12
+ private get command();
13
+ private promptUserInput;
14
+ private readonly interfaceNameMessage;
15
+ private readonly implNameMessage;
16
+ private get prompts();
17
+ private createModule;
18
+ private NodeAutomodule;
19
+ }
20
+ export interface CommandRunner {
21
+ run(): Promise<void>;
22
+ }
23
+ export type CommandRunnerConstructor = new (args: string[]) => CommandRunner;