create-unisphere-project 2.8.0 → 2.10.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 ADDED
@@ -0,0 +1,176 @@
1
+ # create-unisphere-project
2
+
3
+ CLI tool to quickly create a new Unisphere workspace from a template.
4
+
5
+ ## Installation
6
+
7
+ No installation required. Use `npx` to run directly:
8
+
9
+ ```bash
10
+ npx @unisphere/create-unisphere-project --company-name=acme --experience-name=video --is-internal-product=false
11
+ ```
12
+
13
+ Or install globally:
14
+
15
+ ```bash
16
+ npm install -g @unisphere/create-unisphere-project
17
+ create-unisphere-project --company-name=acme --experience-name=video --is-internal-product=false
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ All flags are required. The CLI is non-interactive and will fail with a clear error message if any required flag is missing.
23
+
24
+ ### Required Flags
25
+
26
+ - `--company-name`: The company name (letters, hyphens, and spaces only)
27
+ - `--experience-name`: The experience name (letters, hyphens, and spaces only)
28
+ - `--is-internal-product`: Whether this is an internal product (`true` or `false`)
29
+
30
+ ### Optional Flags
31
+
32
+ - `--cwd`: The working directory where the project will be created (default: current directory)
33
+ - `--verbose`: Output debug logs
34
+
35
+ ## Examples
36
+
37
+ ### Create an external product workspace
38
+
39
+ ```bash
40
+ npx @unisphere/create-unisphere-project \
41
+ --company-name=acme \
42
+ --experience-name=video \
43
+ --is-internal-product=false
44
+ ```
45
+
46
+ This creates a directory named `unisphere-video` in the current directory.
47
+
48
+ ### Create an internal product workspace
49
+
50
+ ```bash
51
+ npx @unisphere/create-unisphere-project \
52
+ --company-name="My Company" \
53
+ --experience-name="analytics dashboard" \
54
+ --is-internal-product=true
55
+ ```
56
+
57
+ This creates a directory named `unisphere-analytics-dashboard` in the current directory.
58
+
59
+ ### Create in a specific directory
60
+
61
+ ```bash
62
+ npx @unisphere/create-unisphere-project \
63
+ --company-name=acme \
64
+ --experience-name=video \
65
+ --is-internal-product=false \
66
+ --cwd=/path/to/parent/directory
67
+ ```
68
+
69
+ ## What Gets Created
70
+
71
+ The CLI creates a complete Nx monorepo workspace with:
72
+
73
+ - **Pre-configured Nx workspace** with Unisphere plugin
74
+ - **Types packages** for shared TypeScript definitions
75
+ - **Example runtime and visual** (for external products)
76
+ - **Development application** for testing
77
+ - **Documentation site** with getting started guide
78
+ - **CI/CD workflows** for GitHub Actions
79
+ - **Pre-commit hooks** with linting and formatting
80
+ - **Dependency management** with npm workspaces
81
+
82
+ ## Project Structure
83
+
84
+ ```
85
+ unisphere-{experience-name}/
86
+ ├── packages/
87
+ │ ├── runtimes/ # Runtime packages
88
+ │ ├── applications/ # Development applications
89
+ │ ├── shared/ # Shared libraries
90
+ │ └── types/ # TypeScript type definitions
91
+ ├── unisphere/
92
+ │ └── documentation/ # Documentation sites
93
+ ├── .github/
94
+ │ └── workflows/ # CI/CD workflows
95
+ ├── nx.json # Nx workspace configuration
96
+ ├── package.json # Root package configuration
97
+ └── README.md # Project documentation
98
+ ```
99
+
100
+ ## Naming Conventions
101
+
102
+ ### Company Name
103
+ - Letters, hyphens, and spaces allowed
104
+ - Will be normalized to lowercase with hyphens
105
+ - Used for package scopes: `@{company-name}/package-name`
106
+
107
+ ### Experience Name
108
+ - Letters, hyphens, and spaces allowed
109
+ - Will be normalized to lowercase with hyphens
110
+ - "unisphere" prefix automatically added if missing
111
+ - Used for repository name: `unisphere-{experience-name}`
112
+
113
+ ### Examples
114
+
115
+ | Input | Normalized | Repository Name |
116
+ |-------|-----------|-----------------|
117
+ | `Video Player` | `video-player` | `unisphere-video-player` |
118
+ | `My Analytics` | `my-analytics` | `unisphere-my-analytics` |
119
+ | `Unisphere CRM` | `crm` | `unisphere-crm` |
120
+
121
+ ## Error Messages
122
+
123
+ The CLI provides clear error messages when required flags are missing:
124
+
125
+ ```bash
126
+ $ npx @unisphere/create-unisphere-project
127
+
128
+ Error: --company-name is required
129
+
130
+ $ npx @unisphere/create-unisphere-project --company-name=acme
131
+
132
+ Error: --experience-name is required
133
+
134
+ $ npx @unisphere/create-unisphere-project --company-name=acme --experience-name=video
135
+
136
+ Error: --is-internal-product is required
137
+ ```
138
+
139
+ ## Migration from Interactive CLI
140
+
141
+ If you're upgrading from an older version that had interactive prompts, you now need to provide all flags explicitly. See the [Migration Guide](../../docs/migration/non-interactive-generators.md) for details.
142
+
143
+ ## Development
144
+
145
+ ### Building
146
+
147
+ ```bash
148
+ npm run build -- create-unisphere-project
149
+ ```
150
+
151
+ ### Testing Locally
152
+
153
+ Use the hidden `--nxplugin-path` flag to test with a local plugin:
154
+
155
+ ```bash
156
+ npx @unisphere/create-unisphere-project \
157
+ --company-name=test \
158
+ --experience-name=test \
159
+ --is-internal-product=false \
160
+ --nxplugin-path=/path/to/local/plugin
161
+ ```
162
+
163
+ ## Requirements
164
+
165
+ - Node.js >= 18
166
+ - npm >= 9
167
+
168
+ ## Support
169
+
170
+ For issues and questions:
171
+ - GitHub Issues: https://github.com/kaltura/unisphere-nx/issues
172
+ - Documentation: See generated workspace README.md
173
+
174
+ ## License
175
+
176
+ See the root [LICENSE](../../LICENSE) file for details.
package/dist/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # create-unisphere-project
2
2
 
3
+ ## 2.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - improve communication of errors
8
+
9
+ ## 2.9.0
10
+
11
+ ### Minor Changes
12
+
13
+ - sync templates with @unisphere/nx@3.24.0 migrations
14
+ - pin @unisphere/nx to 3.24.0
15
+
3
16
  ## 2.8.0
4
17
 
5
18
  ### Minor Changes
package/dist/README.md ADDED
@@ -0,0 +1,176 @@
1
+ # create-unisphere-project
2
+
3
+ CLI tool to quickly create a new Unisphere workspace from a template.
4
+
5
+ ## Installation
6
+
7
+ No installation required. Use `npx` to run directly:
8
+
9
+ ```bash
10
+ npx @unisphere/create-unisphere-project --company-name=acme --experience-name=video --is-internal-product=false
11
+ ```
12
+
13
+ Or install globally:
14
+
15
+ ```bash
16
+ npm install -g @unisphere/create-unisphere-project
17
+ create-unisphere-project --company-name=acme --experience-name=video --is-internal-product=false
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ All flags are required. The CLI is non-interactive and will fail with a clear error message if any required flag is missing.
23
+
24
+ ### Required Flags
25
+
26
+ - `--company-name`: The company name (letters, hyphens, and spaces only)
27
+ - `--experience-name`: The experience name (letters, hyphens, and spaces only)
28
+ - `--is-internal-product`: Whether this is an internal product (`true` or `false`)
29
+
30
+ ### Optional Flags
31
+
32
+ - `--cwd`: The working directory where the project will be created (default: current directory)
33
+ - `--verbose`: Output debug logs
34
+
35
+ ## Examples
36
+
37
+ ### Create an external product workspace
38
+
39
+ ```bash
40
+ npx @unisphere/create-unisphere-project \
41
+ --company-name=acme \
42
+ --experience-name=video \
43
+ --is-internal-product=false
44
+ ```
45
+
46
+ This creates a directory named `unisphere-video` in the current directory.
47
+
48
+ ### Create an internal product workspace
49
+
50
+ ```bash
51
+ npx @unisphere/create-unisphere-project \
52
+ --company-name="My Company" \
53
+ --experience-name="analytics dashboard" \
54
+ --is-internal-product=true
55
+ ```
56
+
57
+ This creates a directory named `unisphere-analytics-dashboard` in the current directory.
58
+
59
+ ### Create in a specific directory
60
+
61
+ ```bash
62
+ npx @unisphere/create-unisphere-project \
63
+ --company-name=acme \
64
+ --experience-name=video \
65
+ --is-internal-product=false \
66
+ --cwd=/path/to/parent/directory
67
+ ```
68
+
69
+ ## What Gets Created
70
+
71
+ The CLI creates a complete Nx monorepo workspace with:
72
+
73
+ - **Pre-configured Nx workspace** with Unisphere plugin
74
+ - **Types packages** for shared TypeScript definitions
75
+ - **Example runtime and visual** (for external products)
76
+ - **Development application** for testing
77
+ - **Documentation site** with getting started guide
78
+ - **CI/CD workflows** for GitHub Actions
79
+ - **Pre-commit hooks** with linting and formatting
80
+ - **Dependency management** with npm workspaces
81
+
82
+ ## Project Structure
83
+
84
+ ```
85
+ unisphere-{experience-name}/
86
+ ├── packages/
87
+ │ ├── runtimes/ # Runtime packages
88
+ │ ├── applications/ # Development applications
89
+ │ ├── shared/ # Shared libraries
90
+ │ └── types/ # TypeScript type definitions
91
+ ├── unisphere/
92
+ │ └── documentation/ # Documentation sites
93
+ ├── .github/
94
+ │ └── workflows/ # CI/CD workflows
95
+ ├── nx.json # Nx workspace configuration
96
+ ├── package.json # Root package configuration
97
+ └── README.md # Project documentation
98
+ ```
99
+
100
+ ## Naming Conventions
101
+
102
+ ### Company Name
103
+ - Letters, hyphens, and spaces allowed
104
+ - Will be normalized to lowercase with hyphens
105
+ - Used for package scopes: `@{company-name}/package-name`
106
+
107
+ ### Experience Name
108
+ - Letters, hyphens, and spaces allowed
109
+ - Will be normalized to lowercase with hyphens
110
+ - "unisphere" prefix automatically added if missing
111
+ - Used for repository name: `unisphere-{experience-name}`
112
+
113
+ ### Examples
114
+
115
+ | Input | Normalized | Repository Name |
116
+ |-------|-----------|-----------------|
117
+ | `Video Player` | `video-player` | `unisphere-video-player` |
118
+ | `My Analytics` | `my-analytics` | `unisphere-my-analytics` |
119
+ | `Unisphere CRM` | `crm` | `unisphere-crm` |
120
+
121
+ ## Error Messages
122
+
123
+ The CLI provides clear error messages when required flags are missing:
124
+
125
+ ```bash
126
+ $ npx @unisphere/create-unisphere-project
127
+
128
+ Error: --company-name is required
129
+
130
+ $ npx @unisphere/create-unisphere-project --company-name=acme
131
+
132
+ Error: --experience-name is required
133
+
134
+ $ npx @unisphere/create-unisphere-project --company-name=acme --experience-name=video
135
+
136
+ Error: --is-internal-product is required
137
+ ```
138
+
139
+ ## Migration from Interactive CLI
140
+
141
+ If you're upgrading from an older version that had interactive prompts, you now need to provide all flags explicitly. See the [Migration Guide](../../docs/migration/non-interactive-generators.md) for details.
142
+
143
+ ## Development
144
+
145
+ ### Building
146
+
147
+ ```bash
148
+ npm run build -- create-unisphere-project
149
+ ```
150
+
151
+ ### Testing Locally
152
+
153
+ Use the hidden `--nxplugin-path` flag to test with a local plugin:
154
+
155
+ ```bash
156
+ npx @unisphere/create-unisphere-project \
157
+ --company-name=test \
158
+ --experience-name=test \
159
+ --is-internal-product=false \
160
+ --nxplugin-path=/path/to/local/plugin
161
+ ```
162
+
163
+ ## Requirements
164
+
165
+ - Node.js >= 18
166
+ - npm >= 9
167
+
168
+ ## Support
169
+
170
+ For issues and questions:
171
+ - GitHub Issues: https://github.com/kaltura/unisphere-nx/issues
172
+ - Documentation: See generated workspace README.md
173
+
174
+ ## License
175
+
176
+ See the root [LICENSE](../../LICENSE) file for details.