@storm-software/workspace-tools 1.90.1 → 1.105.1
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 +141 -8
- package/README.md +1 -1
- package/config/nx.json +235 -94
- package/index.js +2638 -2012
- package/meta.json +1 -1
- package/package.json +2 -1
- package/packages/config/src/define-config.d.ts +7 -6
- package/packages/config/src/schema.d.ts +13 -10
- package/packages/config-tools/src/config-file/get-config-file.d.ts +1 -1
- package/packages/workspace-tools/src/executors/npm-publish/executor.d.ts +4 -1
- package/packages/workspace-tools/src/plugins/rust/cargo-toml.d.ts +1 -1
- package/src/base/index.js +2628 -2004
- package/src/executors/npm-publish/executor.js +66 -38
- package/src/executors/rolldown/executor.js +880 -787
- package/src/executors/tsup/executor.js +880 -787
- package/src/executors/tsup-browser/executor.js +880 -787
- package/src/executors/tsup-neutral/executor.js +880 -787
- package/src/executors/tsup-node/executor.js +880 -787
- package/src/executors/typia/executor.js +882 -789
- package/src/executors/unbuild/executor.js +880 -787
- package/src/generators/browser-library/generator.js +2625 -2003
- package/src/generators/config-schema/generator.js +877 -786
- package/src/generators/neutral-library/generator.js +2625 -2003
- package/src/generators/node-library/generator.js +2625 -2003
- package/src/generators/preset/generator.js +877 -786
- package/src/generators/release-version/generator.js +885 -794
- package/src/plugins/rust/index.js +47 -15
- package/src/plugins/typescript/index.js +71 -8
- package/src/utils/index.js +879 -788
|
@@ -19,6 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
// packages/workspace-tools/src/executors/npm-publish/executor.ts
|
|
20
20
|
var executor_exports = {};
|
|
21
21
|
__export(executor_exports, {
|
|
22
|
+
LARGE_BUFFER: () => LARGE_BUFFER,
|
|
22
23
|
default: () => npmPublishExecutorFn
|
|
23
24
|
});
|
|
24
25
|
module.exports = __toCommonJS(executor_exports);
|
|
@@ -51,13 +52,21 @@ async function npmPublishExecutorFn(options, context) {
|
|
|
51
52
|
console.warn(
|
|
52
53
|
`Skipped ${packageTxt}, because it has \`"private": true\` in ${packageJsonPath}`
|
|
53
54
|
);
|
|
54
|
-
return
|
|
55
|
+
return { success: true };
|
|
55
56
|
}
|
|
56
57
|
const npmPublishCommandSegments = ["npm publish --json"];
|
|
57
58
|
const npmViewCommandSegments = [
|
|
58
59
|
`npm view ${packageName} versions dist-tags --json`
|
|
59
60
|
];
|
|
60
|
-
const registry = options.registry ? options.registry : (0, import_node_child_process.execSync)("npm config get registry"
|
|
61
|
+
const registry = options.registry ? options.registry : (0, import_node_child_process.execSync)("npm config get registry", {
|
|
62
|
+
cwd: packageRoot,
|
|
63
|
+
env: {
|
|
64
|
+
...process.env,
|
|
65
|
+
FORCE_COLOR: "true"
|
|
66
|
+
},
|
|
67
|
+
maxBuffer: LARGE_BUFFER,
|
|
68
|
+
killSignal: "SIGTERM"
|
|
69
|
+
}).toString().trim();
|
|
61
70
|
if (registry) {
|
|
62
71
|
npmPublishCommandSegments.push(`--registry=${registry}`);
|
|
63
72
|
npmViewCommandSegments.push(`--registry=${registry}`);
|
|
@@ -72,18 +81,27 @@ async function npmPublishExecutorFn(options, context) {
|
|
|
72
81
|
npmPublishCommandSegments.push("--dry-run");
|
|
73
82
|
}
|
|
74
83
|
npmPublishCommandSegments.push("--provenance --access public");
|
|
75
|
-
const tag = options.tag ?? (0, import_node_child_process.execSync)("npm config get tag"
|
|
84
|
+
const tag = options.tag ?? (0, import_node_child_process.execSync)("npm config get tag", {
|
|
85
|
+
cwd: packageRoot,
|
|
86
|
+
env: {
|
|
87
|
+
...process.env,
|
|
88
|
+
FORCE_COLOR: "true"
|
|
89
|
+
},
|
|
90
|
+
maxBuffer: LARGE_BUFFER,
|
|
91
|
+
killSignal: "SIGTERM"
|
|
92
|
+
}).toString().trim();
|
|
76
93
|
if (!isDryRun) {
|
|
77
94
|
const currentVersion = projectPackageJson.version;
|
|
78
95
|
try {
|
|
79
96
|
try {
|
|
80
97
|
const result = (0, import_node_child_process.execSync)(npmViewCommandSegments.join(" "), {
|
|
98
|
+
cwd: packageRoot,
|
|
81
99
|
env: {
|
|
82
100
|
...process.env,
|
|
83
101
|
FORCE_COLOR: "true"
|
|
84
102
|
},
|
|
85
|
-
|
|
86
|
-
|
|
103
|
+
maxBuffer: LARGE_BUFFER,
|
|
104
|
+
killSignal: "SIGTERM"
|
|
87
105
|
});
|
|
88
106
|
const resultJson = JSON.parse(result.toString());
|
|
89
107
|
const distTags = resultJson["dist-tags"] || {};
|
|
@@ -91,54 +109,54 @@ async function npmPublishExecutorFn(options, context) {
|
|
|
91
109
|
console.warn(
|
|
92
110
|
`Skipped ${packageTxt} because v${currentVersion} already exists in ${registry} with tag "${tag}"`
|
|
93
111
|
);
|
|
94
|
-
return
|
|
112
|
+
return { success: true };
|
|
95
113
|
}
|
|
96
114
|
} catch (err) {
|
|
115
|
+
console.warn("\n ********************** \n");
|
|
97
116
|
console.warn(
|
|
98
117
|
`An error occurred while checking for existing dist-tags
|
|
99
|
-
${err}
|
|
118
|
+
${JSON.stringify(err)}
|
|
100
119
|
|
|
101
120
|
Note: If this is the first time this package has been published to NPM, this can be ignored.`
|
|
102
121
|
);
|
|
103
|
-
console.
|
|
122
|
+
console.info("");
|
|
104
123
|
}
|
|
105
124
|
try {
|
|
106
125
|
if (!isDryRun) {
|
|
107
126
|
(0, import_node_child_process.execSync)(
|
|
108
127
|
`npm dist-tag add ${packageName}@${currentVersion} ${tag} --registry=${registry}`,
|
|
109
128
|
{
|
|
129
|
+
cwd: packageRoot,
|
|
110
130
|
env: {
|
|
111
131
|
...process.env,
|
|
112
132
|
FORCE_COLOR: "true"
|
|
113
133
|
},
|
|
114
|
-
|
|
115
|
-
|
|
134
|
+
stdio: "inherit",
|
|
135
|
+
maxBuffer: LARGE_BUFFER,
|
|
136
|
+
killSignal: "SIGTERM"
|
|
116
137
|
}
|
|
117
138
|
);
|
|
118
139
|
console.info(
|
|
119
|
-
`Added the dist-tag ${tag} to v${currentVersion} for
|
|
140
|
+
`Added the dist-tag ${tag} to v${currentVersion} for registry "${registry}".
|
|
120
141
|
`
|
|
121
142
|
);
|
|
122
143
|
} else {
|
|
123
144
|
console.info(
|
|
124
|
-
`Would add the dist-tag ${tag} to v${currentVersion} for
|
|
145
|
+
`Would add the dist-tag ${tag} to v${currentVersion} for registry "${registry}", but [dry-run] was set.
|
|
125
146
|
`
|
|
126
147
|
);
|
|
127
148
|
}
|
|
128
|
-
return
|
|
149
|
+
return { success: true };
|
|
129
150
|
} catch (err) {
|
|
130
|
-
console.log("");
|
|
131
|
-
console.error("An error occured adding dist-tags.");
|
|
132
|
-
console.error(err);
|
|
133
|
-
console.log("");
|
|
134
151
|
try {
|
|
152
|
+
console.warn("\n ********************** \n");
|
|
135
153
|
console.warn(
|
|
136
154
|
`An error occurred while adding dist-tags
|
|
137
|
-
${err}
|
|
155
|
+
${JSON.stringify(err)}
|
|
138
156
|
|
|
139
157
|
Note: If this is the first time this package has been published to NPM, this can be ignored.`
|
|
140
158
|
);
|
|
141
|
-
console.
|
|
159
|
+
console.info("");
|
|
142
160
|
const stdoutData = JSON.parse(err.stdout?.toString() || "{}");
|
|
143
161
|
if (stdoutData?.error && !(stdoutData.error?.code?.includes("E404") && stdoutData.error?.summary?.includes("no such package available")) && !(err.stderr?.toString().includes("E404") && err.stderr?.toString().includes("no such package available"))) {
|
|
144
162
|
console.error(
|
|
@@ -155,42 +173,46 @@ Note: If this is the first time this package has been published to NPM, this can
|
|
|
155
173
|
`npm dist-tag add stdout: ${JSON.stringify(stdoutData, null, 2)}`
|
|
156
174
|
);
|
|
157
175
|
}
|
|
158
|
-
return
|
|
176
|
+
return { success: false };
|
|
159
177
|
}
|
|
160
178
|
} catch (err2) {
|
|
161
179
|
console.error(
|
|
162
180
|
`Something unexpected went wrong when processing the npm dist-tag add output
|
|
163
|
-
${err2}`
|
|
181
|
+
${JSON.stringify(err2)}`
|
|
164
182
|
);
|
|
165
|
-
return
|
|
183
|
+
return { success: false };
|
|
166
184
|
}
|
|
167
185
|
}
|
|
168
186
|
} catch (err) {
|
|
169
|
-
console.
|
|
187
|
+
console.error("\n ********************** \n");
|
|
188
|
+
console.info("");
|
|
170
189
|
console.error(
|
|
171
190
|
"An error occured trying to run the npm dist-tag add command."
|
|
172
191
|
);
|
|
173
192
|
console.error(err);
|
|
174
|
-
console.
|
|
193
|
+
console.info("");
|
|
175
194
|
const stdoutData = JSON.parse(err.stdout?.toString() || "{}");
|
|
176
195
|
if (!(stdoutData.error?.code?.includes("E404") && stdoutData.error?.summary?.toLowerCase().includes("not found")) && !(err.stderr?.toString().includes("E404") && err.stderr?.toString().toLowerCase().includes("not found"))) {
|
|
177
196
|
console.error(
|
|
178
197
|
`Something unexpected went wrong when checking for existing dist-tags.
|
|
179
|
-
${err}`
|
|
198
|
+
${JSON.stringify(err)}`
|
|
180
199
|
);
|
|
181
|
-
return
|
|
200
|
+
return { success: false };
|
|
182
201
|
}
|
|
183
202
|
}
|
|
184
203
|
}
|
|
185
204
|
try {
|
|
205
|
+
console.info(
|
|
206
|
+
`Running publish command ${npmPublishCommandSegments.join(" ")}`
|
|
207
|
+
);
|
|
186
208
|
const output = (0, import_node_child_process.execSync)(npmPublishCommandSegments.join(" "), {
|
|
187
|
-
|
|
209
|
+
cwd: packageRoot,
|
|
188
210
|
env: {
|
|
189
211
|
...process.env,
|
|
190
212
|
FORCE_COLOR: "true"
|
|
191
213
|
},
|
|
192
|
-
|
|
193
|
-
|
|
214
|
+
maxBuffer: LARGE_BUFFER,
|
|
215
|
+
killSignal: "SIGTERM"
|
|
194
216
|
});
|
|
195
217
|
console.info(output.toString());
|
|
196
218
|
if (isDryRun) {
|
|
@@ -200,15 +222,15 @@ ${err}`
|
|
|
200
222
|
} else {
|
|
201
223
|
console.info(`Published to ${registry} with tag "${tag}"`);
|
|
202
224
|
}
|
|
203
|
-
return
|
|
225
|
+
return { success: true };
|
|
204
226
|
} catch (err) {
|
|
205
|
-
console.log("");
|
|
206
|
-
console.error("An error occured running npm publish.");
|
|
207
|
-
console.error(err);
|
|
208
|
-
console.log("");
|
|
209
227
|
try {
|
|
228
|
+
console.error("\n ********************** \n");
|
|
229
|
+
console.info("");
|
|
230
|
+
console.error("An error occured running npm publish.");
|
|
231
|
+
console.error("Please see below for more information:");
|
|
232
|
+
console.info("");
|
|
210
233
|
const stdoutData = JSON.parse(err.stdout?.toString() || "{}");
|
|
211
|
-
console.error("npm publish error please see below for more information:");
|
|
212
234
|
if (stdoutData.error.summary) {
|
|
213
235
|
console.error(stdoutData.error.summary);
|
|
214
236
|
console.error(stdoutData.error.summary);
|
|
@@ -222,13 +244,19 @@ ${err}`
|
|
|
222
244
|
${JSON.stringify(stdoutData, null, 2)}`
|
|
223
245
|
);
|
|
224
246
|
}
|
|
225
|
-
|
|
247
|
+
console.error("\n ********************** \n");
|
|
248
|
+
return { success: false };
|
|
226
249
|
} catch (err2) {
|
|
227
250
|
console.error(
|
|
228
251
|
`Something unexpected went wrong when processing the npm publish output
|
|
229
|
-
${err2}`
|
|
252
|
+
${JSON.stringify(err2)}`
|
|
230
253
|
);
|
|
231
|
-
|
|
254
|
+
console.error("\n ********************** \n");
|
|
255
|
+
return { success: false };
|
|
232
256
|
}
|
|
233
257
|
}
|
|
234
258
|
}
|
|
259
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
260
|
+
0 && (module.exports = {
|
|
261
|
+
LARGE_BUFFER
|
|
262
|
+
});
|