create-unisphere-project 2.7.1 → 2.9.0
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/README.md +176 -0
- package/dist/CHANGELOG.md +20 -0
- package/dist/README.md +176 -0
- package/dist/_templates/unisphere-project/package-lock.json +38705 -0
- package/dist/_templates/unisphere-project/package.json +1 -1
- package/dist/package.json +1 -1
- package/dist/src/lib/create-unisphere-repo-command.d.ts.map +1 -1
- package/dist/src/lib/create-unisphere-repo-command.js +32 -54
- package/package.json +1 -1
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@types/react-dom": "19.2.3",
|
|
43
43
|
"@typescript-eslint/eslint-plugin": "^7.3.0",
|
|
44
44
|
"@typescript-eslint/parser": "^7.3.0",
|
|
45
|
-
"@unisphere/nx": "3.
|
|
45
|
+
"@unisphere/nx": "3.24.0",
|
|
46
46
|
"@vitejs/plugin-react": "4.7.0",
|
|
47
47
|
"@vitest/coverage-v8": "^1.0.4",
|
|
48
48
|
"@vitest/ui": "^1.3.1",
|
package/dist/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-unisphere-repo-command.d.ts","sourceRoot":"","sources":["../../../src/lib/create-unisphere-repo-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"create-unisphere-repo-command.d.ts","sourceRoot":"","sources":["../../../src/lib/create-unisphere-repo-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAqC5C,eAAO,MAAM,gCAAgC,GAC3C,eAAe,OAAO,KACrB,OA+UF,CAAC"}
|
|
@@ -11,7 +11,6 @@ const path_1 = require("path");
|
|
|
11
11
|
const fs_1 = require("fs");
|
|
12
12
|
const fs_extra_1 = require("fs-extra");
|
|
13
13
|
const overwrite_placeholders_1 = require("./overwrite-placeholders");
|
|
14
|
-
const inquirer = require("inquirer");
|
|
15
14
|
const child_process_1 = require("child_process");
|
|
16
15
|
const debug = (0, debug_1.default)('unisphere:template:create-unisphere-repo');
|
|
17
16
|
// Path to the local template directory (copied to dist during build)
|
|
@@ -55,66 +54,27 @@ const createCreateUnisphereRepoCommand = (parentCommand) => {
|
|
|
55
54
|
.hook('preAction', utils_1.printVerboseHook)
|
|
56
55
|
.action(async (options) => {
|
|
57
56
|
const cwd = (0, path_1.resolve)(options.cwd || process.cwd());
|
|
58
|
-
//
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
let _isInternalProduct = options.isInternalProduct;
|
|
62
|
-
// Create prompt questions for missing values
|
|
63
|
-
const questions = [];
|
|
64
|
-
if (!_companyName) {
|
|
65
|
-
questions.push({
|
|
66
|
-
type: 'input',
|
|
67
|
-
name: 'companyName',
|
|
68
|
-
message: 'Enter company name:',
|
|
69
|
-
validate: (input) => {
|
|
70
|
-
if (!input || !input.trim()) {
|
|
71
|
-
return 'Company name is required';
|
|
72
|
-
}
|
|
73
|
-
if (!validateInput(input.trim())) {
|
|
74
|
-
return 'Company name can only contain letters, hyphens, and spaces';
|
|
75
|
-
}
|
|
76
|
-
return true;
|
|
77
|
-
},
|
|
78
|
-
});
|
|
57
|
+
// Validate required options
|
|
58
|
+
if (!options.companyName || !options.companyName.trim()) {
|
|
59
|
+
throw new Error('--company-name is required');
|
|
79
60
|
}
|
|
80
|
-
if (
|
|
81
|
-
|
|
82
|
-
type: 'confirm',
|
|
83
|
-
name: 'isInternalProduct',
|
|
84
|
-
message: 'Is this an internal product? (if you are not sure, select true)',
|
|
85
|
-
default: true,
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
if (!_experienceName) {
|
|
89
|
-
questions.push({
|
|
90
|
-
type: 'input',
|
|
91
|
-
name: 'experienceName',
|
|
92
|
-
message: 'Enter experience name (unique name to be used in the unisphere marketplace):',
|
|
93
|
-
validate: (input) => {
|
|
94
|
-
if (!input || !input.trim()) {
|
|
95
|
-
return 'Experience name is required';
|
|
96
|
-
}
|
|
97
|
-
if (!validateInput(input.trim())) {
|
|
98
|
-
return 'Experience name can only contain letters, hyphens, and spaces';
|
|
99
|
-
}
|
|
100
|
-
return true;
|
|
101
|
-
},
|
|
102
|
-
});
|
|
61
|
+
if (!options.experienceName || !options.experienceName.trim()) {
|
|
62
|
+
throw new Error('--experience-name is required');
|
|
103
63
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
const answers = await inquirer.prompt(questions);
|
|
107
|
-
_companyName = _companyName || answers.companyName;
|
|
108
|
-
_experienceName = _experienceName || answers.experienceName;
|
|
109
|
-
_isInternalProduct = _isInternalProduct || answers.isInternalProduct;
|
|
64
|
+
if (typeof options.isInternalProduct === 'undefined') {
|
|
65
|
+
throw new Error('--is-internal-product is required');
|
|
110
66
|
}
|
|
111
|
-
// Validate
|
|
112
|
-
if (
|
|
67
|
+
// Validate input formats
|
|
68
|
+
if (!validateInput(options.companyName.trim())) {
|
|
113
69
|
throw new Error('Company name can only contain letters, hyphens, and spaces');
|
|
114
70
|
}
|
|
115
|
-
if (
|
|
71
|
+
if (!validateInput(options.experienceName.trim())) {
|
|
116
72
|
throw new Error('Experience name can only contain letters, hyphens, and spaces');
|
|
117
73
|
}
|
|
74
|
+
// Assign validated values
|
|
75
|
+
const _companyName = options.companyName;
|
|
76
|
+
const _experienceName = options.experienceName;
|
|
77
|
+
const _isInternalProduct = options.isInternalProduct;
|
|
118
78
|
const originalCompanyNameValue = _companyName;
|
|
119
79
|
debug(`Company name: ${_companyName}`);
|
|
120
80
|
debug(`Experience name: ${_experienceName}`);
|
|
@@ -270,6 +230,24 @@ legacy-peer-deps=true`);
|
|
|
270
230
|
task.title = 'Types package created';
|
|
271
231
|
},
|
|
272
232
|
},
|
|
233
|
+
{
|
|
234
|
+
title: 'Create documentation site',
|
|
235
|
+
skip: () => options.skipPackagesCreation,
|
|
236
|
+
task: async (ctx, task) => {
|
|
237
|
+
const packageName = options.nxpluginPath || '@unisphere/nx';
|
|
238
|
+
const createDocumentationCommand = `npx nx g ${packageName}:add-documentation --isExperienceLevel --skipInstall --no-interactive`;
|
|
239
|
+
debug(`Running: ${createDocumentationCommand}`);
|
|
240
|
+
task.title = 'Creating documentation site';
|
|
241
|
+
(0, child_process_1.execSync)(createDocumentationCommand, {
|
|
242
|
+
cwd: newProjectPath,
|
|
243
|
+
stdio: 'inherit',
|
|
244
|
+
env: {
|
|
245
|
+
...process.env
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
task.title = 'Documentation site created';
|
|
249
|
+
},
|
|
250
|
+
},
|
|
273
251
|
{
|
|
274
252
|
title: 'Initialize git repository',
|
|
275
253
|
task: async (ctx, task) => {
|