lucid-package 0.0.133 → 0.0.135
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/package.json +1 -1
- package/src/index.js +109 -39
- package/templates/dataconnector/package-lock.json +146 -229
- package/templates/dataconnector/pnpm-lock.yaml +55 -175
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -45,6 +45,35 @@ class LucidSuiteExtensionCLI {
|
|
|
45
45
|
help: 'Create a new Lucid extension package in a new directory',
|
|
46
46
|
});
|
|
47
47
|
createParser.add_argument('name', { nargs: '?', type: 'str' });
|
|
48
|
+
createParser.add_argument('--empty', {
|
|
49
|
+
default: false,
|
|
50
|
+
action: 'store_true',
|
|
51
|
+
help: 'Create an empty package with no components, skipping interactive prompts',
|
|
52
|
+
});
|
|
53
|
+
createParser.add_argument('--with-extension', {
|
|
54
|
+
action: 'append',
|
|
55
|
+
default: [],
|
|
56
|
+
metavar: 'NAME',
|
|
57
|
+
help: 'Add an editor extension to the package (repeatable, skips interactive prompts)',
|
|
58
|
+
});
|
|
59
|
+
createParser.add_argument('--with-shape-library', {
|
|
60
|
+
action: 'append',
|
|
61
|
+
default: [],
|
|
62
|
+
metavar: 'NAME',
|
|
63
|
+
help: 'Add a shape library to the package (repeatable, skips interactive prompts)',
|
|
64
|
+
});
|
|
65
|
+
createParser.add_argument('--with-data-connector', {
|
|
66
|
+
action: 'append',
|
|
67
|
+
default: [],
|
|
68
|
+
metavar: 'NAME',
|
|
69
|
+
help: 'Add a data connector to the package (repeatable, skips interactive prompts)',
|
|
70
|
+
});
|
|
71
|
+
createParser.add_argument('--framework', {
|
|
72
|
+
type: 'str',
|
|
73
|
+
choices: ['none', 'angular', 'react-js', 'react-ts'],
|
|
74
|
+
default: 'none',
|
|
75
|
+
help: 'Framework for editor extensions when using --with-extension. Choices: none, angular, react-js, react-ts',
|
|
76
|
+
});
|
|
48
77
|
const packageParser = subparsers.add_parser('bundle', {
|
|
49
78
|
help: 'Prepare the current package for upload to the developer dashboard',
|
|
50
79
|
});
|
|
@@ -191,47 +220,88 @@ class LucidSuiteExtensionCLI {
|
|
|
191
220
|
}
|
|
192
221
|
switch (parsed['command']) {
|
|
193
222
|
case 'create':
|
|
194
|
-
|
|
195
|
-
parsed['
|
|
223
|
+
const hasCliFlags = parsed['empty'] ||
|
|
224
|
+
parsed['with_extension'].length > 0 ||
|
|
225
|
+
parsed['with_shape_library'].length > 0 ||
|
|
226
|
+
parsed['with_data_connector'].length > 0;
|
|
227
|
+
if (hasCliFlags) {
|
|
228
|
+
if (parsed['name'] == null) {
|
|
229
|
+
console.error('Package name is required when using --empty or --with-* flags. Pass it as a positional argument.');
|
|
230
|
+
process.exitCode = 1;
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
await (0, package_1.createEmptyPackage)(parsed['name'], packageManagerOptions);
|
|
234
|
+
const cliPackagePath = path.join(process.cwd(), parsed['name']);
|
|
235
|
+
for (const extensionName of parsed['with_extension']) {
|
|
236
|
+
process.chdir(cliPackagePath);
|
|
237
|
+
const framework = parsed['framework'];
|
|
238
|
+
switch (framework) {
|
|
239
|
+
case 'angular':
|
|
240
|
+
await (0, angularframeworkutils_1.createAngularEditorExtension)(extensionName, isInternal, packageManagerOptions, false);
|
|
241
|
+
break;
|
|
242
|
+
case 'react-js':
|
|
243
|
+
await (0, reactframeworkutils_1.createReactEditorExtension)(extensionName, 'Javascript', isInternal, packageManagerOptions, false);
|
|
244
|
+
break;
|
|
245
|
+
case 'react-ts':
|
|
246
|
+
await (0, reactframeworkutils_1.createReactEditorExtension)(extensionName, 'Typescript', isInternal, packageManagerOptions, false);
|
|
247
|
+
break;
|
|
248
|
+
default:
|
|
249
|
+
await (0, editorextension_1.createEditorExtension)(extensionName, isInternal, packageManagerOptions, false);
|
|
250
|
+
break;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
for (const libraryName of parsed['with_shape_library']) {
|
|
254
|
+
process.chdir(cliPackagePath);
|
|
255
|
+
await (0, shapelibrary_1.createEmptyShapeLibrary)(libraryName);
|
|
256
|
+
}
|
|
257
|
+
for (const connectorName of parsed['with_data_connector']) {
|
|
258
|
+
process.chdir(cliPackagePath);
|
|
259
|
+
await (0, dataconnector_1.createDataConnector)(connectorName, isInternal, packageManagerOptions, false);
|
|
260
|
+
}
|
|
196
261
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
262
|
+
else {
|
|
263
|
+
if (parsed['name'] == null) {
|
|
264
|
+
parsed['name'] = await interactive.inputPrompt('Please enter the name of the Lucid Package');
|
|
265
|
+
}
|
|
266
|
+
await (0, package_1.createEmptyPackage)(parsed['name'], packageManagerOptions);
|
|
267
|
+
const options = ['Editor Extension', 'Shape Library', 'Data Connector'];
|
|
268
|
+
const choices = await interactive.multiSelect('Select components to add to package (can select none or more than one)', options);
|
|
269
|
+
const packagePath = path.join(process.cwd(), parsed['name']);
|
|
270
|
+
for (let choice of choices) {
|
|
271
|
+
switch (choice) {
|
|
272
|
+
case 0:
|
|
273
|
+
process.chdir(packagePath);
|
|
274
|
+
const editorExtensionName = await interactive.inputPrompt('Please enter the name of the editor extension');
|
|
275
|
+
const wantFramework = await interactive.confirmPrompt('Do you want to use a framework for custom UI?');
|
|
276
|
+
if (wantFramework) {
|
|
277
|
+
const options = ['Angular', 'React'];
|
|
278
|
+
const choice = await interactive.selectPrompt('Please select a framework', options);
|
|
279
|
+
switch (choice) {
|
|
280
|
+
case 0:
|
|
281
|
+
await (0, angularframeworkutils_1.createAngularEditorExtension)(editorExtensionName, isInternal, packageManagerOptions, false);
|
|
282
|
+
break;
|
|
283
|
+
case 1:
|
|
284
|
+
const options = ['Javascript', 'Typescript'];
|
|
285
|
+
const choice = await interactive.selectPrompt('Please select flavor', options);
|
|
286
|
+
await (0, reactframeworkutils_1.createReactEditorExtension)(editorExtensionName, options[choice], isInternal, packageManagerOptions, false);
|
|
287
|
+
break;
|
|
288
|
+
}
|
|
219
289
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
290
|
+
else {
|
|
291
|
+
await (0, editorextension_1.createEditorExtension)(editorExtensionName, isInternal, packageManagerOptions, false);
|
|
292
|
+
}
|
|
293
|
+
break;
|
|
294
|
+
case 1:
|
|
295
|
+
process.chdir(packagePath);
|
|
296
|
+
const shapeLibraryName = await interactive.inputPrompt('Please enter the name of the shape library');
|
|
297
|
+
await (0, shapelibrary_1.createEmptyShapeLibrary)(shapeLibraryName);
|
|
298
|
+
break;
|
|
299
|
+
case 2:
|
|
300
|
+
process.chdir(packagePath);
|
|
301
|
+
const dataConnectorName = await interactive.inputPrompt('Please enter the name of the data connector');
|
|
302
|
+
await (0, dataconnector_1.createDataConnector)(dataConnectorName, isInternal, packageManagerOptions, false);
|
|
303
|
+
break;
|
|
304
|
+
}
|
|
235
305
|
}
|
|
236
306
|
}
|
|
237
307
|
break;
|