create-storm-workspace 1.5.15 → 1.5.17
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/CHANGELOG.md +14 -0
- package/bin/index.ts +53 -15
- package/index.js +34 -34
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.5.16](https://github.com/storm-software/storm-ops/compare/create-storm-workspace-v1.5.15...create-storm-workspace-v1.5.16) (2023-11-08)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **create-storm-workspace:** Update preset implementation and added back nxCloud and mode args to CLI ([35bab7e](https://github.com/storm-software/storm-ops/commit/35bab7e28ca2d7ca2430e0ec2d4c257d241adc53))
|
|
7
|
+
|
|
8
|
+
## [1.5.15](https://github.com/storm-software/storm-ops/compare/create-storm-workspace-v1.5.14...create-storm-workspace-v1.5.15) (2023-11-08)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **workspace-tools:** Resolved husky install error thrown in preset ([a24d783](https://github.com/storm-software/storm-ops/commit/a24d783a1402f3bc7232b8c9195a6ea01322533c))
|
|
14
|
+
|
|
1
15
|
## [1.5.14](https://github.com/storm-software/storm-ops/compare/create-storm-workspace-v1.5.13...create-storm-workspace-v1.5.14) (2023-11-08)
|
|
2
16
|
|
|
3
17
|
|
package/bin/index.ts
CHANGED
|
@@ -3,12 +3,17 @@
|
|
|
3
3
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
4
4
|
|
|
5
5
|
import { getNpmPackageVersion } from "@nx/workspace/src/generators/utils/get-npm-package-version";
|
|
6
|
-
import type {
|
|
6
|
+
import type {
|
|
7
|
+
NxClientMode,
|
|
8
|
+
PresetGeneratorSchema
|
|
9
|
+
} from "@storm-software/workspace-tools";
|
|
7
10
|
import { createWorkspace } from "create-nx-workspace";
|
|
8
11
|
import { prompt } from "enquirer";
|
|
9
12
|
|
|
10
13
|
async function main() {
|
|
11
14
|
try {
|
|
15
|
+
console.log(`⚡ Collecting required info to creating a Storm Workspace`);
|
|
16
|
+
|
|
12
17
|
let name = process.argv.length > 2 ? process.argv[2] : null;
|
|
13
18
|
if (!name) {
|
|
14
19
|
const response = await prompt<{ name: string }>({
|
|
@@ -83,23 +88,56 @@ async function main() {
|
|
|
83
88
|
repositoryUrl = response.repositoryUrl;
|
|
84
89
|
}
|
|
85
90
|
|
|
91
|
+
let nxCloud =
|
|
92
|
+
process.argv.length > 8 && process.argv[8]
|
|
93
|
+
? Boolean(process.argv[8])
|
|
94
|
+
: null;
|
|
95
|
+
if (!nxCloud && typeof nxCloud !== "boolean") {
|
|
96
|
+
const response = await prompt<{ nxCloud: boolean }>({
|
|
97
|
+
type: "confirm",
|
|
98
|
+
name: "nxCloud",
|
|
99
|
+
message:
|
|
100
|
+
"Should Nx Cloud be enabled for the workspace (allows for remote workspace caching)?",
|
|
101
|
+
initial: false
|
|
102
|
+
});
|
|
103
|
+
nxCloud = response.nxCloud;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
let mode: NxClientMode = (
|
|
107
|
+
process.argv.length > 9 ? process.argv[9] : null
|
|
108
|
+
) as NxClientMode;
|
|
109
|
+
if (!mode) {
|
|
110
|
+
mode = (
|
|
111
|
+
await prompt<{ mode: "light" | "dark" }>({
|
|
112
|
+
name: "mode",
|
|
113
|
+
message: "Which mode should be used?",
|
|
114
|
+
initial: "dark" as any,
|
|
115
|
+
type: "autocomplete",
|
|
116
|
+
choices: [
|
|
117
|
+
{ name: "light", message: "light" },
|
|
118
|
+
{ name: "dark", message: "dark" }
|
|
119
|
+
]
|
|
120
|
+
})
|
|
121
|
+
).mode;
|
|
122
|
+
}
|
|
123
|
+
|
|
86
124
|
console.log(`⚡ Creating the Storm Workspace: ${name}`);
|
|
87
125
|
|
|
88
126
|
const version = getNpmPackageVersion("@storm-software/workspace-tools");
|
|
89
|
-
const { directory } = await createWorkspace<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
);
|
|
127
|
+
const { directory } = await createWorkspace<
|
|
128
|
+
PresetGeneratorSchema & { interactive: boolean }
|
|
129
|
+
>(`@storm-software/workspace-tools@${version ? version : "latest"}`, {
|
|
130
|
+
name,
|
|
131
|
+
organization,
|
|
132
|
+
namespace,
|
|
133
|
+
description,
|
|
134
|
+
includeApps,
|
|
135
|
+
repositoryUrl,
|
|
136
|
+
packageManager: "pnpm",
|
|
137
|
+
nxCloud: false,
|
|
138
|
+
mode: "dark",
|
|
139
|
+
interactive: false
|
|
140
|
+
});
|
|
103
141
|
|
|
104
142
|
console.log(`⚡ Successfully created the workspace: ${directory}.`);
|
|
105
143
|
} catch (error) {
|