create-storm-workspace 1.56.14 → 1.56.15
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/bin/index.ts +25 -37
- package/index.js +32 -30
- package/package.json +3 -3
package/bin/index.ts
CHANGED
|
@@ -3,25 +3,22 @@
|
|
|
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 {
|
|
7
|
-
NxClientMode,
|
|
8
|
-
PresetGeneratorSchema
|
|
9
|
-
} from "@storm-software/workspace-tools";
|
|
6
|
+
import type { NxClientMode, PresetGeneratorSchema } from "@storm-software/workspace-tools";
|
|
10
7
|
import { createWorkspace } from "create-nx-workspace";
|
|
11
8
|
import { prompt } from "enquirer";
|
|
12
9
|
|
|
13
10
|
async function main() {
|
|
14
11
|
try {
|
|
15
|
-
console.log(
|
|
12
|
+
console.log("⚡ Collecting required info to creating a Storm Workspace");
|
|
16
13
|
|
|
17
|
-
["SIGTERM", "SIGINT", "SIGUSR2"].map(type => {
|
|
18
|
-
process.once(type,
|
|
14
|
+
["SIGTERM", "SIGINT", "SIGUSR2"].map((type) => {
|
|
15
|
+
process.once(type, () => {
|
|
19
16
|
try {
|
|
20
17
|
console.info(`process.on ${type}`);
|
|
21
|
-
console.info(
|
|
18
|
+
console.info("shutdown process done, exiting with code 0");
|
|
22
19
|
process.exit(0);
|
|
23
20
|
} catch (e) {
|
|
24
|
-
console.warn(
|
|
21
|
+
console.warn("shutdown process failed, exiting with code 1");
|
|
25
22
|
console.error(e);
|
|
26
23
|
process.exit(1);
|
|
27
24
|
}
|
|
@@ -60,10 +57,7 @@ async function main() {
|
|
|
60
57
|
namespace = response.namespace;
|
|
61
58
|
}
|
|
62
59
|
|
|
63
|
-
let includeApps =
|
|
64
|
-
process.argv.length > 5 && process.argv[5]
|
|
65
|
-
? Boolean(process.argv[5])
|
|
66
|
-
: null;
|
|
60
|
+
let includeApps = process.argv.length > 5 && process.argv[5] ? Boolean(process.argv[5]) : null;
|
|
67
61
|
if (!includeApps && typeof includeApps !== "boolean") {
|
|
68
62
|
const response = await prompt<{ includeApps: boolean }>({
|
|
69
63
|
type: "confirm",
|
|
@@ -95,17 +89,12 @@ async function main() {
|
|
|
95
89
|
type: "input",
|
|
96
90
|
name: "repositoryUrl",
|
|
97
91
|
message: "What is the workspace's Git repository's URL?",
|
|
98
|
-
initial: `https://github.com/${
|
|
99
|
-
organization ? organization : "storm-software"
|
|
100
|
-
}/${name}`
|
|
92
|
+
initial: `https://github.com/${organization ? organization : "storm-software"}/${name}`
|
|
101
93
|
});
|
|
102
94
|
repositoryUrl = response.repositoryUrl;
|
|
103
95
|
}
|
|
104
96
|
|
|
105
|
-
let nxCloud =
|
|
106
|
-
process.argv.length > 8 && process.argv[8]
|
|
107
|
-
? Boolean(process.argv[8])
|
|
108
|
-
: null;
|
|
97
|
+
let nxCloud = process.argv.length > 8 && process.argv[8] ? Boolean(process.argv[8]) : null;
|
|
109
98
|
if (!nxCloud && typeof nxCloud !== "boolean") {
|
|
110
99
|
const response = await prompt<{ nxCloud: boolean }>({
|
|
111
100
|
type: "confirm",
|
|
@@ -117,9 +106,7 @@ async function main() {
|
|
|
117
106
|
nxCloud = response.nxCloud;
|
|
118
107
|
}
|
|
119
108
|
|
|
120
|
-
let mode: NxClientMode = (
|
|
121
|
-
process.argv.length > 9 ? process.argv[9] : null
|
|
122
|
-
) as NxClientMode;
|
|
109
|
+
let mode: NxClientMode = (process.argv.length > 9 ? process.argv[9] : null) as NxClientMode;
|
|
123
110
|
if (!mode) {
|
|
124
111
|
mode = (
|
|
125
112
|
await prompt<{ mode: "light" | "dark" }>({
|
|
@@ -138,20 +125,21 @@ async function main() {
|
|
|
138
125
|
console.log(`⚡ Creating the Storm Workspace: ${name}`);
|
|
139
126
|
|
|
140
127
|
const version = getNpmPackageVersion("@storm-software/workspace-tools");
|
|
141
|
-
const { directory } = await createWorkspace<
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
128
|
+
const { directory } = await createWorkspace<PresetGeneratorSchema & { interactive: boolean }>(
|
|
129
|
+
`@storm-software/workspace-tools@${version ? version : "latest"}`,
|
|
130
|
+
{
|
|
131
|
+
name,
|
|
132
|
+
organization,
|
|
133
|
+
namespace,
|
|
134
|
+
description,
|
|
135
|
+
includeApps,
|
|
136
|
+
repositoryUrl,
|
|
137
|
+
nxCloud: "skip",
|
|
138
|
+
packageManager: "pnpm",
|
|
139
|
+
mode: "dark",
|
|
140
|
+
interactive: false
|
|
141
|
+
}
|
|
142
|
+
);
|
|
155
143
|
|
|
156
144
|
console.log(`⚡ Successfully created the workspace: ${directory}.`);
|
|
157
145
|
} catch (error) {
|