@storm-software/workspace-tools 1.277.30 → 1.277.32

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.
Files changed (59) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +1 -2
  3. package/dist/executors.js +15 -15
  4. package/dist/executors.mjs +22 -22
  5. package/dist/generators.js +10 -10
  6. package/dist/generators.mjs +9 -9
  7. package/dist/index.js +48 -48
  8. package/dist/index.mjs +62 -62
  9. package/dist/src/base/index.js +8 -8
  10. package/dist/src/base/index.mjs +11 -11
  11. package/dist/src/executors/cargo-build/executor.js +3 -3
  12. package/dist/src/executors/cargo-build/executor.mjs +2 -2
  13. package/dist/src/executors/cargo-check/executor.js +3 -3
  14. package/dist/src/executors/cargo-check/executor.mjs +2 -2
  15. package/dist/src/executors/cargo-clippy/executor.js +3 -3
  16. package/dist/src/executors/cargo-clippy/executor.mjs +2 -2
  17. package/dist/src/executors/cargo-doc/executor.js +3 -3
  18. package/dist/src/executors/cargo-doc/executor.mjs +2 -2
  19. package/dist/src/executors/cargo-format/executor.js +3 -3
  20. package/dist/src/executors/cargo-format/executor.mjs +2 -2
  21. package/dist/src/executors/npm-publish/executor.js +1 -1
  22. package/dist/src/executors/npm-publish/executor.mjs +1 -1
  23. package/dist/src/generators/browser-library/generator.js +2 -2
  24. package/dist/src/generators/browser-library/generator.mjs +2 -2
  25. package/dist/src/generators/neutral-library/generator.js +2 -2
  26. package/dist/src/generators/neutral-library/generator.mjs +2 -2
  27. package/dist/src/generators/node-library/generator.js +4 -4
  28. package/dist/src/generators/node-library/generator.mjs +3 -3
  29. package/dist/src/generators/preset/generator.js +3 -3
  30. package/dist/src/generators/preset/generator.mjs +2 -2
  31. package/dist/src/generators/release-version/generator.js +3 -3
  32. package/dist/src/generators/release-version/generator.mjs +2 -2
  33. package/dist/src/plugins/rust/cargo-toml.js +3 -3
  34. package/dist/src/plugins/rust/cargo-toml.mjs +2 -2
  35. package/dist/src/plugins/rust/index.js +3 -3
  36. package/dist/src/plugins/rust/index.mjs +2 -2
  37. package/dist/src/utils/index.js +10 -10
  38. package/dist/src/utils/index.mjs +22 -22
  39. package/dist/src/utils/package-helpers.js +1 -1
  40. package/dist/src/utils/package-helpers.mjs +1 -1
  41. package/package.json +5 -5
  42. package/dist/chunk-36NLUQF5.mjs +0 -41
  43. package/dist/chunk-3CLZGETU.js +0 -913
  44. package/dist/chunk-3EGPC5BZ.mjs +0 -32
  45. package/dist/chunk-7LBU537S.mjs +0 -253
  46. package/dist/chunk-AWQW74DN.mjs +0 -82
  47. package/dist/chunk-B3D27MSZ.mjs +0 -32
  48. package/dist/chunk-CI2X75PQ.js +0 -250
  49. package/dist/chunk-EFVRHTH3.js +0 -41
  50. package/dist/chunk-L5J57I6V.js +0 -32
  51. package/dist/chunk-OECJG4M5.js +0 -32
  52. package/dist/chunk-ONVPEM3D.mjs +0 -377
  53. package/dist/chunk-QHAPAO2Z.js +0 -377
  54. package/dist/chunk-R7Q3ZOQ6.mjs +0 -32
  55. package/dist/chunk-RC3EGPJE.js +0 -32
  56. package/dist/chunk-RKKY5ZGW.mjs +0 -31
  57. package/dist/chunk-SXGMKPF6.js +0 -31
  58. package/dist/chunk-SY2PSJNN.mjs +0 -913
  59. package/dist/chunk-TD6Z3Z72.js +0 -79
@@ -1,32 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunk6XYAQUU3js = require('./chunk-6XYAQUU3.js');
4
-
5
-
6
-
7
- var _chunkLJDV7HFTjs = require('./chunk-LJDV7HFT.js');
8
-
9
- // src/executors/cargo-build/executor.ts
10
- async function cargoBuildExecutor(options, context) {
11
- const command = _chunkLJDV7HFTjs.buildCargoCommand.call(void 0, "build", options, context);
12
- return await _chunkLJDV7HFTjs.cargoCommand.call(void 0, ...command);
13
- }
14
- var executor_default = _chunk6XYAQUU3js.withRunExecutor.call(void 0,
15
- "Cargo - Build",
16
- cargoBuildExecutor,
17
- {
18
- skipReadingConfig: false,
19
- hooks: {
20
- applyDefaultOptions: (options) => {
21
- options.outputPath ??= "dist/{projectRoot}/target";
22
- options.toolchain ??= "stable";
23
- return options;
24
- }
25
- }
26
- }
27
- );
28
-
29
-
30
-
31
-
32
- exports.cargoBuildExecutor = cargoBuildExecutor; exports.executor_default = executor_default;
@@ -1,32 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunk6XYAQUU3js = require('./chunk-6XYAQUU3.js');
4
-
5
-
6
-
7
- var _chunkLJDV7HFTjs = require('./chunk-LJDV7HFT.js');
8
-
9
- // src/executors/cargo-format/executor.ts
10
- async function cargoFormatExecutor(options, context) {
11
- const command = _chunkLJDV7HFTjs.buildCargoCommand.call(void 0, "fmt", options, context);
12
- return await _chunkLJDV7HFTjs.cargoCommand.call(void 0, ...command);
13
- }
14
- var executor_default = _chunk6XYAQUU3js.withRunExecutor.call(void 0,
15
- "Cargo - Format",
16
- cargoFormatExecutor,
17
- {
18
- skipReadingConfig: false,
19
- hooks: {
20
- applyDefaultOptions: (options) => {
21
- options.outputPath ??= "dist/{projectRoot}/target";
22
- options.toolchain ??= "stable";
23
- return options;
24
- }
25
- }
26
- }
27
- );
28
-
29
-
30
-
31
-
32
- exports.cargoFormatExecutor = cargoFormatExecutor; exports.executor_default = executor_default;
@@ -1,377 +0,0 @@
1
- import {
2
- ProjectTagConstants,
3
- addProjectTag,
4
- setDefaultProjectTags
5
- } from "./chunk-F66XEAID.mjs";
6
- import {
7
- cargoMetadata,
8
- isExternal
9
- } from "./chunk-6LP3KKXE.mjs";
10
-
11
- // src/plugins/rust/cargo-toml.ts
12
- import {
13
- createNodesFromFiles,
14
- joinPathFragments,
15
- readJsonFile,
16
- workspaceRoot
17
- } from "@nx/devkit";
18
- import { existsSync } from "node:fs";
19
- import { dirname } from "node:path";
20
- import {
21
- DependencyType
22
- } from "nx/src/config/project-graph";
23
- var name = "storm-software/rust";
24
- var description = "Plugin for parsing Cargo.toml files";
25
- var DefaultCargoPluginProfileMap = {
26
- development: "dev",
27
- production: "prod"
28
- };
29
- var DEFAULT_ERROR_MESSAGE = "An error occurred in the Storm Rust Nx plugin.";
30
- var createNodesV2 = [
31
- "*/**/Cargo.toml",
32
- async (configFiles, options, context) => {
33
- return await createNodesFromFiles(
34
- (configFile, options2, context2) => {
35
- try {
36
- const profiles = options2?.profiles ?? {};
37
- const includeApps = options2?.includeApps ?? true;
38
- const toolchain = options2?.toolchain;
39
- const skipDocs = options2?.skipDocs ?? false;
40
- const metadata = cargoMetadata();
41
- if (!metadata) {
42
- return {};
43
- }
44
- const { packages: cargoPackages } = metadata;
45
- const externalNodes = {};
46
- const projects = {};
47
- const profs = {
48
- ...DefaultCargoPluginProfileMap,
49
- ...profiles
50
- };
51
- const configurations = Object.keys(profs).reduce((ret, key) => {
52
- ret[key] = {
53
- profile: profs[key]
54
- };
55
- return ret;
56
- }, {});
57
- const cargoPackageMap = cargoPackages.reduce((acc, p) => {
58
- if (!acc.has(p.name)) {
59
- acc.set(p.name, p);
60
- }
61
- return acc;
62
- }, /* @__PURE__ */ new Map());
63
- for (const cargoPackage of cargoPackages) {
64
- if (!isExternal(cargoPackage, context2.workspaceRoot)) {
65
- const root = dirname(configFile);
66
- const project = {
67
- root,
68
- name: cargoPackage.name
69
- };
70
- if (existsSync(joinPathFragments(root, "project.json"))) {
71
- const projectJson = readJsonFile(
72
- joinPathFragments(root, "project.json")
73
- );
74
- if (projectJson) {
75
- Object.keys(projectJson).forEach((key) => {
76
- if (!project[key]) {
77
- project[key] = projectJson[key];
78
- }
79
- });
80
- }
81
- }
82
- if (includeApps === false && project.projectType === "application") {
83
- continue;
84
- }
85
- project.targets = {
86
- "lint-markdown": {
87
- cache: true,
88
- outputs: ["{projectRoot}/**/*.md", "{projectRoot}/**/*.mdx"],
89
- inputs: [
90
- "linting",
91
- "{projectRoot}/**/*.md",
92
- "{projectRoot}/**/*.mdx"
93
- ],
94
- dependsOn: ["^lint-markdown"],
95
- executor: "nx:run-commands",
96
- options: {
97
- command: 'pnpm exec markdownlint-cli2 "{projectRoot}/*.{md,mdx}" "{projectRoot}/**/*.{md,mdx}" --config "node_modules/@storm-software/markdownlint/config/base.markdownlint-cli2.jsonc" --fix'
98
- }
99
- },
100
- "lint-ls": {
101
- cache: true,
102
- inputs: ["linting", "rust", "^production"],
103
- dependsOn: ["^lint-ls"],
104
- options: {
105
- command: 'pnpm exec ls-lint --config="./node_modules/@storm-software/linting-tools/ls-lint/.ls-lint.yml" ',
106
- color: true
107
- }
108
- },
109
- lint: {
110
- cache: true,
111
- inputs: ["linting", "rust", "^production"],
112
- dependsOn: ["lint-ls", "lint-markdown", "^lint"],
113
- executor: "@storm-software/workspace-tools:cargo-clippy",
114
- options: {
115
- toolchain,
116
- fix: false
117
- },
118
- defaultConfiguration: "development",
119
- configurations
120
- },
121
- check: {
122
- cache: true,
123
- inputs: ["linting", "rust", "^production"],
124
- dependsOn: ["lint", "^check"],
125
- executor: "@storm-software/workspace-tools:cargo-check",
126
- options: {
127
- toolchain
128
- },
129
- defaultConfiguration: "development",
130
- configurations
131
- },
132
- "format-readme": {
133
- cache: true,
134
- inputs: [
135
- "linting",
136
- "documentation",
137
- "{projectRoot}/{README.md,package.json,Cargo.toml,executors.json,generators.json}"
138
- ],
139
- outputs: ["{projectRoot}/README.md"],
140
- dependsOn: ["^format-readme"],
141
- executor: "nx:run-commands",
142
- options: {
143
- command: 'pnpm exec storm-git readme --templates="tools/readme-templates" --project="{projectName}"'
144
- }
145
- },
146
- "format-toml": {
147
- cache: true,
148
- inputs: ["linting", "{projectRoot}/**/*.toml"],
149
- outputs: ["{projectRoot}/**/*.toml"],
150
- dependsOn: ["^format-toml"],
151
- executor: "nx:run-commands",
152
- options: {
153
- command: 'pnpm exec taplo format --config="node_modules/@storm-software/linting-tools/taplo/config.toml" --cache-path="node_modules/.cache/taplo/{projectRoot}" --colors="always" "{projectRoot}/*.toml" "{projectRoot}/**/*.toml" '
154
- }
155
- },
156
- "format-clippy": {
157
- cache: true,
158
- inputs: ["linting", "rust", "^production"],
159
- dependsOn: ["^format-clippy"],
160
- executor: "@storm-software/workspace-tools:cargo-clippy",
161
- options: {
162
- toolchain,
163
- fix: true
164
- },
165
- defaultConfiguration: "development",
166
- configurations
167
- },
168
- format: {
169
- cache: true,
170
- inputs: ["linting", "documentation", "rust", "^production"],
171
- dependsOn: [
172
- "format-readme",
173
- "format-clippy",
174
- "format-toml",
175
- "^format"
176
- ],
177
- executor: "@storm-software/workspace-tools:cargo-format",
178
- options: {
179
- toolchain,
180
- fix: true
181
- },
182
- defaultConfiguration: "development",
183
- configurations
184
- },
185
- clean: {
186
- cache: true,
187
- inputs: ["rust", "^production"],
188
- outputs: [`{workspaceRoot}/dist/{projectRoot}/target`],
189
- executor: "nx:run-commands",
190
- options: {
191
- command: `pnpm exec rimraf dist/{projectRoot}/target`,
192
- color: true,
193
- cwd: "{workspaceRoot}"
194
- }
195
- },
196
- build: {
197
- cache: true,
198
- inputs: ["rust", "^production"],
199
- dependsOn: ["build-base", "^build"],
200
- executor: "@storm-software/workspace-tools:cargo-build",
201
- outputs: [`{workspaceRoot}/dist/{projectRoot}/target`],
202
- options: {
203
- toolchain
204
- },
205
- defaultConfiguration: "development",
206
- configurations
207
- },
208
- rebuild: {
209
- cache: false,
210
- inputs: ["rust", "^production"],
211
- dependsOn: ["clean", "build-base", "^build"],
212
- executor: "@storm-software/workspace-tools:cargo-build",
213
- outputs: [`{workspaceRoot}/dist/{projectRoot}/target`],
214
- options: {
215
- toolchain
216
- },
217
- defaultConfiguration: "development",
218
- configurations
219
- },
220
- test: {
221
- cache: true,
222
- inputs: ["testing", "rust", "^production"],
223
- dependsOn: ["build", "^test"],
224
- executor: "@monodon/rust:test",
225
- outputs: ["{options.target-dir}"],
226
- options: {
227
- "target-dir": `{workspaceRoot}/dist/{projectRoot}/target`
228
- },
229
- defaultConfiguration: "development",
230
- configurations
231
- }
232
- };
233
- if (skipDocs != true) {
234
- project.targets.docs = {
235
- cache: true,
236
- inputs: [
237
- "linting",
238
- "documentation",
239
- "default",
240
- "^production"
241
- ],
242
- dependsOn: ["format-readme", "lint-docs", "^docs"],
243
- outputs: [`{workspaceRoot}/dist/{projectRoot}/docs`],
244
- executor: "@storm-software/workspace-tools:cargo-doc",
245
- options: {
246
- toolchain
247
- },
248
- defaultConfiguration: "production",
249
- configurations
250
- };
251
- }
252
- if (cargoPackage.publish === null || cargoPackage.publish === void 0 || cargoPackage.publish === true || Array.isArray(cargoPackage.publish) && cargoPackage.publish.length > 0) {
253
- addProjectTag(
254
- project,
255
- ProjectTagConstants.Registry.TAG_ID,
256
- ProjectTagConstants.Registry.CARGO,
257
- { overwrite: true }
258
- );
259
- project.targets["nx-release-publish"] = {
260
- cache: true,
261
- inputs: [
262
- "linting",
263
- "testing",
264
- "documentation",
265
- "rust",
266
- "^production"
267
- ],
268
- dependsOn: ["build", "^nx-release-publish"],
269
- executor: "@storm-software/workspace-tools:cargo-publish",
270
- options: {
271
- packageRoot: root
272
- },
273
- defaultConfiguration: "production",
274
- configurations
275
- };
276
- }
277
- addProjectTag(
278
- project,
279
- ProjectTagConstants.Language.TAG_ID,
280
- ProjectTagConstants.Language.RUST,
281
- { overwrite: true }
282
- );
283
- setDefaultProjectTags(project, name);
284
- projects[root] = {
285
- ...project,
286
- release: {
287
- ...project.release,
288
- version: {
289
- ...project.release?.version,
290
- generator: "@storm-software/workspace-tools:release-version"
291
- }
292
- }
293
- };
294
- }
295
- for (const dep of cargoPackage.dependencies) {
296
- if (isExternal(dep, context2.workspaceRoot)) {
297
- const externalDepName = `cargo:${dep.name}`;
298
- if (!externalNodes?.[externalDepName]) {
299
- externalNodes[externalDepName] = {
300
- type: "cargo",
301
- name: externalDepName,
302
- data: {
303
- packageName: dep.name,
304
- version: cargoPackageMap.get(dep.name)?.version ?? "0.0.0"
305
- }
306
- };
307
- }
308
- }
309
- }
310
- }
311
- return {
312
- projects,
313
- externalNodes
314
- };
315
- } catch (e) {
316
- console.error(DEFAULT_ERROR_MESSAGE);
317
- console.error(e);
318
- throw new Error(DEFAULT_ERROR_MESSAGE, { cause: e });
319
- }
320
- },
321
- configFiles,
322
- options,
323
- context
324
- );
325
- }
326
- ];
327
- var createDependencies = (_, context) => {
328
- const metadata = cargoMetadata();
329
- if (!metadata) {
330
- return [];
331
- }
332
- const { packages: cargoPackages } = metadata;
333
- const dependencies = [];
334
- for (const pkg of cargoPackages) {
335
- if (context.projects[pkg.name]) {
336
- for (const deps of pkg.dependencies) {
337
- if (!cargoPackages.find((p) => p.name === deps.name)) {
338
- console.debug(
339
- `[storm-software/rust]: Dependency ${deps.name} not found in the cargo metadata.`
340
- );
341
- continue;
342
- }
343
- if (context.projects[deps.name]) {
344
- dependencies.push(
345
- createDependency(pkg, deps.name, DependencyType.static)
346
- );
347
- } else {
348
- const externalDepName = `cargo:${deps.name}`;
349
- if (externalDepName in (context.externalNodes ?? {})) {
350
- dependencies.push(
351
- createDependency(pkg, externalDepName, DependencyType.static)
352
- );
353
- }
354
- }
355
- }
356
- }
357
- }
358
- return dependencies;
359
- };
360
- function createDependency(pkg, depName, type) {
361
- const target = pkg.manifest_path.replace(/\\/g, "/");
362
- return {
363
- type,
364
- source: pkg.name,
365
- target: depName,
366
- sourceFile: target.replace(`${workspaceRoot.replace(/\\/g, "/")}/`, "")
367
- };
368
- }
369
-
370
- export {
371
- name,
372
- description,
373
- DefaultCargoPluginProfileMap,
374
- DEFAULT_ERROR_MESSAGE,
375
- createNodesV2,
376
- createDependencies
377
- };