create-unisphere-project 2.8.0 → 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.
@@ -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.23.0",
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,6 +1,6 @@
1
1
  {
2
2
  "name": "create-unisphere-project",
3
- "version": "2.8.0",
3
+ "version": "2.9.0",
4
4
  "private": false,
5
5
  "main": "./dist/src/index.js",
6
6
  "types": "./dist/src/index.d.ts",
@@ -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;AAsC5C,eAAO,MAAM,gCAAgC,GAC3C,eAAe,OAAO,KACrB,OA2XF,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
- // Get values from options or prompt for all of them
59
- let _companyName = options.companyName;
60
- let _experienceName = options.experienceName;
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
- });
79
- }
80
- if (typeof _isInternalProduct === 'undefined') {
81
- questions.push({
82
- type: 'confirm',
83
- name: 'isInternalProduct',
84
- message: 'Is this an internal product? (if you are not sure, select true)',
85
- default: true,
86
- });
57
+ // Validate required options
58
+ if (!options.companyName || !options.companyName.trim()) {
59
+ throw new Error('--company-name is required');
87
60
  }
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
- // Prompt for missing values
105
- if (questions.length > 0) {
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 company name if provided via options
112
- if (_companyName && !validateInput(_companyName)) {
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 (_experienceName && !validateInput(_experienceName)) {
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}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-unisphere-project",
3
- "version": "2.8.0",
3
+ "version": "2.9.0",
4
4
  "private": false,
5
5
  "main": "./dist/src/index.js",
6
6
  "types": "./dist/src/index.d.ts",