@positronic/cli 0.0.2
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/dist/src/cli.js +739 -0
- package/dist/src/commands/backend.js +199 -0
- package/dist/src/commands/brain.js +446 -0
- package/dist/src/commands/brain.test.js +2936 -0
- package/dist/src/commands/helpers.js +1315 -0
- package/dist/src/commands/helpers.test.js +832 -0
- package/dist/src/commands/project-config-manager.js +197 -0
- package/dist/src/commands/project.js +130 -0
- package/dist/src/commands/project.test.js +1201 -0
- package/dist/src/commands/resources.js +272 -0
- package/dist/src/commands/resources.test.js +2511 -0
- package/dist/src/commands/schedule.js +73 -0
- package/dist/src/commands/schedule.test.js +1235 -0
- package/dist/src/commands/secret.js +87 -0
- package/dist/src/commands/secret.test.d.js +1 -0
- package/dist/src/commands/secret.test.js +761 -0
- package/dist/src/commands/server.js +816 -0
- package/dist/src/commands/server.test.js +1237 -0
- package/dist/src/commands/test-utils.js +737 -0
- package/dist/src/components/brain-history.js +169 -0
- package/dist/src/components/brain-list.js +108 -0
- package/dist/src/components/brain-rerun.js +313 -0
- package/dist/src/components/brain-show.js +65 -0
- package/dist/src/components/error.js +19 -0
- package/dist/src/components/project-add.js +95 -0
- package/dist/src/components/project-create.js +276 -0
- package/dist/src/components/project-list.js +88 -0
- package/dist/src/components/project-remove.js +91 -0
- package/dist/src/components/project-select.js +224 -0
- package/dist/src/components/project-show.js +41 -0
- package/dist/src/components/resource-clear.js +152 -0
- package/dist/src/components/resource-delete.js +189 -0
- package/dist/src/components/resource-list.js +174 -0
- package/dist/src/components/resource-sync.js +386 -0
- package/dist/src/components/resource-types.js +243 -0
- package/dist/src/components/resource-upload.js +366 -0
- package/dist/src/components/schedule-create.js +259 -0
- package/dist/src/components/schedule-delete.js +161 -0
- package/dist/src/components/schedule-list.js +176 -0
- package/dist/src/components/schedule-runs.js +103 -0
- package/dist/src/components/secret-bulk.js +262 -0
- package/dist/src/components/secret-create.js +199 -0
- package/dist/src/components/secret-delete.js +190 -0
- package/dist/src/components/secret-list.js +190 -0
- package/dist/src/components/secret-sync.js +303 -0
- package/dist/src/components/watch.js +184 -0
- package/dist/src/hooks/useApi.js +512 -0
- package/dist/src/positronic.js +33 -0
- package/dist/src/test/mock-api-client.js +371 -0
- package/dist/src/test/test-dev-server.js +1376 -0
- package/dist/types/cli.d.ts +9 -0
- package/dist/types/cli.d.ts.map +1 -0
- package/dist/types/commands/backend.d.ts +6 -0
- package/dist/types/commands/backend.d.ts.map +1 -0
- package/dist/types/commands/brain.d.ts +35 -0
- package/dist/types/commands/brain.d.ts.map +1 -0
- package/dist/types/commands/helpers.d.ts +55 -0
- package/dist/types/commands/helpers.d.ts.map +1 -0
- package/dist/types/commands/project-config-manager.d.ts +37 -0
- package/dist/types/commands/project-config-manager.d.ts.map +1 -0
- package/dist/types/commands/project.d.ts +55 -0
- package/dist/types/commands/project.d.ts.map +1 -0
- package/dist/types/commands/resources.d.ts +13 -0
- package/dist/types/commands/resources.d.ts.map +1 -0
- package/dist/types/commands/schedule.d.ts +27 -0
- package/dist/types/commands/schedule.d.ts.map +1 -0
- package/dist/types/commands/secret.d.ts +23 -0
- package/dist/types/commands/secret.d.ts.map +1 -0
- package/dist/types/commands/server.d.ts +12 -0
- package/dist/types/commands/server.d.ts.map +1 -0
- package/dist/types/commands/test-utils.d.ts +45 -0
- package/dist/types/commands/test-utils.d.ts.map +1 -0
- package/dist/types/components/brain-history.d.ts +7 -0
- package/dist/types/components/brain-history.d.ts.map +1 -0
- package/dist/types/components/brain-list.d.ts +2 -0
- package/dist/types/components/brain-list.d.ts.map +1 -0
- package/dist/types/components/brain-rerun.d.ts +9 -0
- package/dist/types/components/brain-rerun.d.ts.map +1 -0
- package/dist/types/components/brain-show.d.ts +6 -0
- package/dist/types/components/brain-show.d.ts.map +1 -0
- package/dist/types/components/error.d.ts +10 -0
- package/dist/types/components/error.d.ts.map +1 -0
- package/dist/types/components/project-add.d.ts +9 -0
- package/dist/types/components/project-add.d.ts.map +1 -0
- package/dist/types/components/project-create.d.ts +6 -0
- package/dist/types/components/project-create.d.ts.map +1 -0
- package/dist/types/components/project-list.d.ts +7 -0
- package/dist/types/components/project-list.d.ts.map +1 -0
- package/dist/types/components/project-remove.d.ts +8 -0
- package/dist/types/components/project-remove.d.ts.map +1 -0
- package/dist/types/components/project-select.d.ts +8 -0
- package/dist/types/components/project-select.d.ts.map +1 -0
- package/dist/types/components/project-show.d.ts +7 -0
- package/dist/types/components/project-show.d.ts.map +1 -0
- package/dist/types/components/resource-clear.d.ts +2 -0
- package/dist/types/components/resource-clear.d.ts.map +1 -0
- package/dist/types/components/resource-delete.d.ts +9 -0
- package/dist/types/components/resource-delete.d.ts.map +1 -0
- package/dist/types/components/resource-list.d.ts +2 -0
- package/dist/types/components/resource-list.d.ts.map +1 -0
- package/dist/types/components/resource-sync.d.ts +8 -0
- package/dist/types/components/resource-sync.d.ts.map +1 -0
- package/dist/types/components/resource-types.d.ts +7 -0
- package/dist/types/components/resource-types.d.ts.map +1 -0
- package/dist/types/components/resource-upload.d.ts +8 -0
- package/dist/types/components/resource-upload.d.ts.map +1 -0
- package/dist/types/components/schedule-create.d.ts +7 -0
- package/dist/types/components/schedule-create.d.ts.map +1 -0
- package/dist/types/components/schedule-delete.d.ts +7 -0
- package/dist/types/components/schedule-delete.d.ts.map +1 -0
- package/dist/types/components/schedule-list.d.ts +6 -0
- package/dist/types/components/schedule-list.d.ts.map +1 -0
- package/dist/types/components/schedule-runs.d.ts +8 -0
- package/dist/types/components/schedule-runs.d.ts.map +1 -0
- package/dist/types/components/secret-bulk.d.ts +8 -0
- package/dist/types/components/secret-bulk.d.ts.map +1 -0
- package/dist/types/components/secret-create.d.ts +9 -0
- package/dist/types/components/secret-create.d.ts.map +1 -0
- package/dist/types/components/secret-delete.d.ts +8 -0
- package/dist/types/components/secret-delete.d.ts.map +1 -0
- package/dist/types/components/secret-list.d.ts +7 -0
- package/dist/types/components/secret-list.d.ts.map +1 -0
- package/dist/types/components/secret-sync.d.ts +9 -0
- package/dist/types/components/secret-sync.d.ts.map +1 -0
- package/dist/types/components/watch.d.ts +7 -0
- package/dist/types/components/watch.d.ts.map +1 -0
- package/dist/types/hooks/useApi.d.ts +29 -0
- package/dist/types/hooks/useApi.d.ts.map +1 -0
- package/dist/types/positronic.d.ts +3 -0
- package/dist/types/positronic.d.ts.map +1 -0
- package/dist/types/test/mock-api-client.d.ts +25 -0
- package/dist/types/test/mock-api-client.d.ts.map +1 -0
- package/dist/types/test/test-dev-server.d.ts +129 -0
- package/dist/types/test/test-dev-server.d.ts.map +1 -0
- package/package.json +37 -0
- package/src/cli.ts +981 -0
- package/src/commands/backend.ts +63 -0
- package/src/commands/brain.test.ts +1004 -0
- package/src/commands/brain.ts +215 -0
- package/src/commands/helpers.test.ts +487 -0
- package/src/commands/helpers.ts +870 -0
- package/src/commands/project-config-manager.ts +152 -0
- package/src/commands/project.test.ts +502 -0
- package/src/commands/project.ts +109 -0
- package/src/commands/resources.test.ts +1052 -0
- package/src/commands/resources.ts +97 -0
- package/src/commands/schedule.test.ts +481 -0
- package/src/commands/schedule.ts +65 -0
- package/src/commands/secret.test.ts +210 -0
- package/src/commands/secret.ts +50 -0
- package/src/commands/server.test.ts +493 -0
- package/src/commands/server.ts +353 -0
- package/src/commands/test-utils.ts +324 -0
- package/src/components/brain-history.tsx +198 -0
- package/src/components/brain-list.tsx +105 -0
- package/src/components/brain-rerun.tsx +111 -0
- package/src/components/brain-show.tsx +92 -0
- package/src/components/error.tsx +24 -0
- package/src/components/project-add.tsx +59 -0
- package/src/components/project-create.tsx +83 -0
- package/src/components/project-list.tsx +83 -0
- package/src/components/project-remove.tsx +55 -0
- package/src/components/project-select.tsx +200 -0
- package/src/components/project-show.tsx +58 -0
- package/src/components/resource-clear.tsx +127 -0
- package/src/components/resource-delete.tsx +160 -0
- package/src/components/resource-list.tsx +177 -0
- package/src/components/resource-sync.tsx +170 -0
- package/src/components/resource-types.tsx +55 -0
- package/src/components/resource-upload.tsx +182 -0
- package/src/components/schedule-create.tsx +90 -0
- package/src/components/schedule-delete.tsx +116 -0
- package/src/components/schedule-list.tsx +186 -0
- package/src/components/schedule-runs.tsx +151 -0
- package/src/components/secret-bulk.tsx +79 -0
- package/src/components/secret-create.tsx +49 -0
- package/src/components/secret-delete.tsx +41 -0
- package/src/components/secret-list.tsx +41 -0
- package/src/components/watch.tsx +155 -0
- package/src/hooks/useApi.ts +183 -0
- package/src/positronic.ts +40 -0
- package/src/test/data/resources/config.json +1 -0
- package/src/test/data/resources/data/config.json +1 -0
- package/src/test/data/resources/data/logo.png +2 -0
- package/src/test/data/resources/docs/api.md +3 -0
- package/src/test/data/resources/docs/readme.md +3 -0
- package/src/test/data/resources/example.md +3 -0
- package/src/test/data/resources/file with spaces.txt +1 -0
- package/src/test/data/resources/readme.md +3 -0
- package/src/test/data/resources/test.txt +1 -0
- package/src/test/mock-api-client.ts +145 -0
- package/src/test/test-dev-server.ts +1003 -0
- package/tsconfig.json +11 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
function _class_call_check(instance, Constructor) {
|
|
2
|
+
if (!(instance instanceof Constructor)) {
|
|
3
|
+
throw new TypeError("Cannot call a class as a function");
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
function _defineProperties(target, props) {
|
|
7
|
+
for(var i = 0; i < props.length; i++){
|
|
8
|
+
var descriptor = props[i];
|
|
9
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
10
|
+
descriptor.configurable = true;
|
|
11
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
12
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
16
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
17
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
18
|
+
return Constructor;
|
|
19
|
+
}
|
|
20
|
+
function _define_property(obj, key, value) {
|
|
21
|
+
if (key in obj) {
|
|
22
|
+
Object.defineProperty(obj, key, {
|
|
23
|
+
value: value,
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true
|
|
27
|
+
});
|
|
28
|
+
} else {
|
|
29
|
+
obj[key] = value;
|
|
30
|
+
}
|
|
31
|
+
return obj;
|
|
32
|
+
}
|
|
33
|
+
import * as fs from 'fs';
|
|
34
|
+
import * as path from 'path';
|
|
35
|
+
import * as os from 'os';
|
|
36
|
+
export var ProjectConfigManager = /*#__PURE__*/ function() {
|
|
37
|
+
"use strict";
|
|
38
|
+
function ProjectConfigManager(customConfigDir) {
|
|
39
|
+
_class_call_check(this, ProjectConfigManager);
|
|
40
|
+
_define_property(this, "configPath", void 0);
|
|
41
|
+
_define_property(this, "configDir", void 0);
|
|
42
|
+
// Priority: customConfigDir > env variable > default home directory
|
|
43
|
+
this.configDir = customConfigDir || process.env.POSITRONIC_CONFIG_DIR || path.join(os.homedir(), '.positronic');
|
|
44
|
+
this.configPath = path.join(this.configDir, 'config.json');
|
|
45
|
+
}
|
|
46
|
+
_create_class(ProjectConfigManager, [
|
|
47
|
+
{
|
|
48
|
+
key: "ensureConfigDir",
|
|
49
|
+
value: function ensureConfigDir() {
|
|
50
|
+
if (!fs.existsSync(this.configDir)) {
|
|
51
|
+
fs.mkdirSync(this.configDir, {
|
|
52
|
+
recursive: true
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
key: "getDefaultConfig",
|
|
59
|
+
value: function getDefaultConfig() {
|
|
60
|
+
return {
|
|
61
|
+
version: '1',
|
|
62
|
+
currentProject: null,
|
|
63
|
+
projects: []
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
key: "read",
|
|
69
|
+
value: function read() {
|
|
70
|
+
this.ensureConfigDir();
|
|
71
|
+
if (!fs.existsSync(this.configPath)) {
|
|
72
|
+
var defaultConfig = this.getDefaultConfig();
|
|
73
|
+
this.write(defaultConfig);
|
|
74
|
+
return defaultConfig;
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
var content = fs.readFileSync(this.configPath, 'utf-8');
|
|
78
|
+
return JSON.parse(content);
|
|
79
|
+
} catch (error) {
|
|
80
|
+
console.error('Error reading config file:', error);
|
|
81
|
+
// Return default config if file is corrupted
|
|
82
|
+
return this.getDefaultConfig();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
key: "write",
|
|
88
|
+
value: function write(config) {
|
|
89
|
+
this.ensureConfigDir();
|
|
90
|
+
fs.writeFileSync(this.configPath, JSON.stringify(config, null, 2), 'utf-8');
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
key: "addProject",
|
|
95
|
+
value: function addProject(name, url) {
|
|
96
|
+
var config = this.read();
|
|
97
|
+
// Check for duplicate names
|
|
98
|
+
if (config.projects.some(function(p) {
|
|
99
|
+
return p.name === name;
|
|
100
|
+
})) {
|
|
101
|
+
return {
|
|
102
|
+
success: false,
|
|
103
|
+
error: 'A project named "'.concat(name, '" already exists')
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
// Validate URL
|
|
107
|
+
try {
|
|
108
|
+
new URL(url);
|
|
109
|
+
} catch (e) {
|
|
110
|
+
return {
|
|
111
|
+
success: false,
|
|
112
|
+
error: 'Invalid URL format'
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
var newProject = {
|
|
116
|
+
name: name,
|
|
117
|
+
url: url,
|
|
118
|
+
addedAt: new Date().toISOString()
|
|
119
|
+
};
|
|
120
|
+
config.projects.push(newProject);
|
|
121
|
+
// If this is the first project, make it current
|
|
122
|
+
if (config.projects.length === 1) {
|
|
123
|
+
config.currentProject = name;
|
|
124
|
+
}
|
|
125
|
+
this.write(config);
|
|
126
|
+
return {
|
|
127
|
+
success: true
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
key: "selectProject",
|
|
133
|
+
value: function selectProject(name) {
|
|
134
|
+
var config = this.read();
|
|
135
|
+
var project = config.projects.find(function(p) {
|
|
136
|
+
return p.name === name;
|
|
137
|
+
});
|
|
138
|
+
if (!project) {
|
|
139
|
+
return {
|
|
140
|
+
success: false,
|
|
141
|
+
error: 'Project "'.concat(name, '" not found')
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
config.currentProject = name;
|
|
145
|
+
this.write(config);
|
|
146
|
+
return {
|
|
147
|
+
success: true
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
key: "removeProject",
|
|
153
|
+
value: function removeProject(name) {
|
|
154
|
+
var config = this.read();
|
|
155
|
+
var projectIndex = config.projects.findIndex(function(p) {
|
|
156
|
+
return p.name === name;
|
|
157
|
+
});
|
|
158
|
+
if (projectIndex === -1) {
|
|
159
|
+
return {
|
|
160
|
+
success: false,
|
|
161
|
+
error: 'Project "'.concat(name, '" not found')
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
config.projects.splice(projectIndex, 1);
|
|
165
|
+
// If we removed the current project, clear it
|
|
166
|
+
if (config.currentProject === name) {
|
|
167
|
+
config.currentProject = config.projects.length > 0 ? config.projects[0].name : null;
|
|
168
|
+
}
|
|
169
|
+
this.write(config);
|
|
170
|
+
return {
|
|
171
|
+
success: true
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
key: "getCurrentProject",
|
|
177
|
+
value: function getCurrentProject() {
|
|
178
|
+
var config = this.read();
|
|
179
|
+
if (!config.currentProject) return null;
|
|
180
|
+
return config.projects.find(function(p) {
|
|
181
|
+
return p.name === config.currentProject;
|
|
182
|
+
}) || null;
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
key: "listProjects",
|
|
187
|
+
value: function listProjects() {
|
|
188
|
+
var config = this.read();
|
|
189
|
+
return {
|
|
190
|
+
projects: config.projects,
|
|
191
|
+
current: config.currentProject
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
]);
|
|
196
|
+
return ProjectConfigManager;
|
|
197
|
+
}();
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
function _class_call_check(instance, Constructor) {
|
|
2
|
+
if (!(instance instanceof Constructor)) {
|
|
3
|
+
throw new TypeError("Cannot call a class as a function");
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
function _defineProperties(target, props) {
|
|
7
|
+
for(var i = 0; i < props.length; i++){
|
|
8
|
+
var descriptor = props[i];
|
|
9
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
10
|
+
descriptor.configurable = true;
|
|
11
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
12
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
16
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
17
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
18
|
+
return Constructor;
|
|
19
|
+
}
|
|
20
|
+
function _define_property(obj, key, value) {
|
|
21
|
+
if (key in obj) {
|
|
22
|
+
Object.defineProperty(obj, key, {
|
|
23
|
+
value: value,
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true
|
|
27
|
+
});
|
|
28
|
+
} else {
|
|
29
|
+
obj[key] = value;
|
|
30
|
+
}
|
|
31
|
+
return obj;
|
|
32
|
+
}
|
|
33
|
+
import React from 'react';
|
|
34
|
+
import { ProjectAdd } from '../components/project-add.js';
|
|
35
|
+
import { ProjectList } from '../components/project-list.js';
|
|
36
|
+
import { ProjectSelect } from '../components/project-select.js';
|
|
37
|
+
import { ProjectShow } from '../components/project-show.js';
|
|
38
|
+
import { ProjectCreate } from '../components/project-create.js';
|
|
39
|
+
import { ProjectRemove } from '../components/project-remove.js';
|
|
40
|
+
// Import and re-export the class
|
|
41
|
+
import { ProjectConfigManager } from './project-config-manager.js';
|
|
42
|
+
export { ProjectConfigManager };
|
|
43
|
+
export var ProjectCommand = /*#__PURE__*/ function() {
|
|
44
|
+
"use strict";
|
|
45
|
+
function ProjectCommand() {
|
|
46
|
+
_class_call_check(this, ProjectCommand);
|
|
47
|
+
_define_property(this, "projectConfig", void 0);
|
|
48
|
+
// Instantiate ProjectConfigManager with default home directory
|
|
49
|
+
this.projectConfig = new ProjectConfigManager();
|
|
50
|
+
}
|
|
51
|
+
_create_class(ProjectCommand, [
|
|
52
|
+
{
|
|
53
|
+
/**
|
|
54
|
+
* Handles the 'positronic project add <name> --url <url>' command.
|
|
55
|
+
* Adds a project configuration to the global store.
|
|
56
|
+
*/ key: "add",
|
|
57
|
+
value: function add(param) {
|
|
58
|
+
var name = param.name, url = param.url;
|
|
59
|
+
return React.createElement(ProjectAdd, {
|
|
60
|
+
name: name,
|
|
61
|
+
url: url,
|
|
62
|
+
projectConfig: this.projectConfig
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
/**
|
|
68
|
+
* Handles the 'positronic project list' command.
|
|
69
|
+
* Lists configured remote projects (Global Mode) or shows current local project path (Local Dev Mode).
|
|
70
|
+
*/ key: "list",
|
|
71
|
+
value: function list() {
|
|
72
|
+
return React.createElement(ProjectList, {
|
|
73
|
+
projectConfig: this.projectConfig
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
/**
|
|
79
|
+
* Handles the 'positronic project select [name]' command.
|
|
80
|
+
* Selects the active remote project for subsequent commands.
|
|
81
|
+
* Only available in Global Mode.
|
|
82
|
+
*/ key: "select",
|
|
83
|
+
value: function select(param) {
|
|
84
|
+
var name = param.name;
|
|
85
|
+
return React.createElement(ProjectSelect, {
|
|
86
|
+
name: name,
|
|
87
|
+
projectConfig: this.projectConfig
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
/**
|
|
93
|
+
* Handles the 'positronic project show' command.
|
|
94
|
+
* Shows details of the active project (remote in Global Mode, local in Local Dev Mode).
|
|
95
|
+
*/ key: "show",
|
|
96
|
+
value: function show() {
|
|
97
|
+
return React.createElement(ProjectShow, {
|
|
98
|
+
projectConfig: this.projectConfig
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
/**
|
|
104
|
+
* Handles the 'positronic project rm <name>' command.
|
|
105
|
+
* Removes a project configuration from the global store.
|
|
106
|
+
*/ key: "remove",
|
|
107
|
+
value: function remove(param) {
|
|
108
|
+
var name = param.name;
|
|
109
|
+
return React.createElement(ProjectRemove, {
|
|
110
|
+
name: name,
|
|
111
|
+
projectConfig: this.projectConfig
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
/**
|
|
117
|
+
* Handles the 'positronic new <project-name>' command.
|
|
118
|
+
* Creates a new project directory structure and populates it with template files.
|
|
119
|
+
* Also sets up the .positronic server environment.
|
|
120
|
+
*/ key: "create",
|
|
121
|
+
value: function create(param) {
|
|
122
|
+
var projectPathArg = param.name;
|
|
123
|
+
return React.createElement(ProjectCreate, {
|
|
124
|
+
projectPathArg: projectPathArg
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
]);
|
|
129
|
+
return ProjectCommand;
|
|
130
|
+
}();
|