@storm-software/workspace-tools 1.264.27 → 1.265.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 CHANGED
@@ -2,6 +2,27 @@
2
2
 
3
3
  # Changelog for Storm Ops - Workspace Tools
4
4
 
5
+ ## [1.265.1](https://github.com/storm-software/storm-ops/releases/tag/workspace-tools%401.265.1) (2025-04-08)
6
+
7
+ ### Miscellaneous
8
+
9
+ - **workspace-tools:** Upgrade storm-software/typescript plugin to use v2 types
10
+ ([de7832ff9](https://github.com/storm-software/storm-ops/commit/de7832ff9))
11
+ - **monorepo:** Regenerate README markdown files
12
+ ([9bb345e83](https://github.com/storm-software/storm-ops/commit/9bb345e83))
13
+
14
+ ## [1.265.0](https://github.com/storm-software/storm-ops/releases/tag/workspace-tools%401.265.0) (2025-04-08)
15
+
16
+ ### Features
17
+
18
+ - **unbuild:** Added the `buildOnly` option
19
+ ([6cac087b8](https://github.com/storm-software/storm-ops/commit/6cac087b8))
20
+
21
+ ### Miscellaneous
22
+
23
+ - **workspace-tools:** Regenerate untyped files
24
+ ([5fee9254f](https://github.com/storm-software/storm-ops/commit/5fee9254f))
25
+
5
26
  ## [1.264.27](https://github.com/storm-software/storm-ops/releases/tag/workspace-tools%401.264.27) (2025-04-08)
6
27
 
7
28
  ### Miscellaneous
package/README.md CHANGED
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
21
21
 
22
22
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
23
23
 
24
- [![Version](https://img.shields.io/badge/version-1.264.26-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
24
+ [![Version](https://img.shields.io/badge/version-1.265.0-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
25
25
 
26
26
  <!-- prettier-ignore-start -->
27
27
  <!-- markdownlint-disable -->
@@ -40,6 +40,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
40
40
 
41
41
  <!-- START doctoc -->
42
42
  <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
43
+
43
44
  ## Table of Contents
44
45
 
45
46
  - [Storm Workspace Tools](#storm-workspace-tools)
@@ -0,0 +1,468 @@
1
+ import {
2
+ getProjectPlatform
3
+ } from "./chunk-XBRJIYCS.mjs";
4
+ import {
5
+ ProjectTagConstants,
6
+ addProjectTag,
7
+ isEqualProjectTag,
8
+ setDefaultProjectTags
9
+ } from "./chunk-HUVBVDJ7.mjs";
10
+ import {
11
+ __name
12
+ } from "./chunk-2BPV2XV2.mjs";
13
+
14
+ // src/plugins/typescript/project-config.ts
15
+ import { createNodesFromFiles } from "@nx/devkit";
16
+ import { existsSync } from "node:fs";
17
+ import { dirname, join } from "node:path";
18
+ import { readNxJson } from "nx/src/config/nx-json.js";
19
+ import { readJsonFile } from "nx/src/utils/fileutils";
20
+ import { readTargetsFromPackageJson } from "nx/src/utils/package-json";
21
+ import { readTSConfig } from "pkg-types";
22
+ var name = "storm-software/typescript";
23
+ var createNodesV2 = [
24
+ "{project.json,**/project.json}",
25
+ async (configFiles, options = {
26
+ includeApps: true
27
+ }, context) => {
28
+ return await createNodesFromFiles(async (file, options2 = {
29
+ includeApps: true
30
+ }, context2) => {
31
+ try {
32
+ const packageJson = createPackageJson(file, context2.workspaceRoot);
33
+ if (!packageJson) {
34
+ return [];
35
+ }
36
+ const tsconfig = await createTsconfig(file, context2.workspaceRoot);
37
+ if (!tsconfig) {
38
+ return [];
39
+ }
40
+ const project = createProjectFromPackageJsonNextToProjectJson(file, packageJson);
41
+ if (options2?.includeApps === false && project.projectType === "application") {
42
+ return [];
43
+ }
44
+ let relativeRoot = project.root.replaceAll("\\", "/").replace(context2.workspaceRoot.replaceAll("\\", "/"), "");
45
+ if (relativeRoot.startsWith("/")) {
46
+ relativeRoot = relativeRoot.slice(1);
47
+ }
48
+ const enableMarkdownlint = options2?.enableMarkdownlint !== false;
49
+ const enableEslint = options2?.enableEslint !== false;
50
+ const nxJson = readNxJson(context2.workspaceRoot);
51
+ const targets = readTargetsFromPackageJson(packageJson, nxJson);
52
+ if (join(context2.workspaceRoot, project.root).startsWith(join(context2.workspaceRoot, "tools")) && options2?.lintInternalTools !== true) {
53
+ targets.lint = {
54
+ dependsOn: [
55
+ "^lint"
56
+ ],
57
+ executor: "nx:run-commands",
58
+ options: {
59
+ command: "echo 'Skipping linting of internal tools package \"{projectName}\". This can be changed by setting `lintInternalTools` to `true` in the Storm TypeScript plugin options.' "
60
+ }
61
+ };
62
+ } else {
63
+ if (!targets["lint-ls"]) {
64
+ targets["lint-ls"] = {
65
+ cache: true,
66
+ inputs: [
67
+ "linting",
68
+ "typescript",
69
+ "^production"
70
+ ],
71
+ dependsOn: [
72
+ "^lint-ls"
73
+ ],
74
+ executor: "nx:run-commands",
75
+ options: {
76
+ command: 'pnpm exec ls-lint --config="node_modules/@storm-software/linting-tools/ls-lint/.ls-lint.yml" '
77
+ }
78
+ };
79
+ }
80
+ if (!targets["lint-markdown"] && enableMarkdownlint) {
81
+ targets["lint-markdown"] = {
82
+ cache: true,
83
+ outputs: [
84
+ "{projectRoot}/**/*.md",
85
+ "{projectRoot}/**/*.mdx"
86
+ ],
87
+ inputs: [
88
+ "linting",
89
+ "{projectRoot}/**/*.md",
90
+ "{projectRoot}/**/*.mdx"
91
+ ],
92
+ dependsOn: [
93
+ "^lint-markdown"
94
+ ],
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
+ }
101
+ if (!targets.lint && enableEslint) {
102
+ let eslintConfig = checkEslintConfigAtPath(project.root);
103
+ if (!eslintConfig) {
104
+ eslintConfig = checkEslintConfigAtPath(context2.workspaceRoot);
105
+ }
106
+ if (eslintConfig) {
107
+ targets.lint = {
108
+ cache: true,
109
+ inputs: [
110
+ "linting",
111
+ "typescript",
112
+ "^production"
113
+ ],
114
+ outputs: [
115
+ "{projectRoot}/**/*.{ts,tsx,js,jsx,json,md,mdx,yaml,yml,html,css,scss,sass,less,graphql,gql}"
116
+ ],
117
+ dependsOn: [
118
+ "lint-markdown",
119
+ "lint-knip",
120
+ "^lint"
121
+ ],
122
+ executor: "@nx/eslint:lint",
123
+ options: {
124
+ format: "stylish",
125
+ fix: true,
126
+ errorOnUnmatchedPattern: false,
127
+ cache: true,
128
+ cacheLocation: "{workspaceRoot}/node_modules/.cache/eslint/{projectRoot}",
129
+ eslintConfig
130
+ }
131
+ };
132
+ }
133
+ }
134
+ }
135
+ if (!targets["format-toml"]) {
136
+ targets["format-toml"] = {
137
+ inputs: [
138
+ "linting",
139
+ "{projectRoot}/**/*.toml"
140
+ ],
141
+ outputs: [
142
+ "{projectRoot}/**/*.toml"
143
+ ],
144
+ dependsOn: [
145
+ "^format-toml"
146
+ ],
147
+ executor: "nx:run-commands",
148
+ options: {
149
+ 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" '
150
+ }
151
+ };
152
+ }
153
+ if (!targets["format-readme"]) {
154
+ targets["format-readme"] = {
155
+ inputs: [
156
+ "linting",
157
+ "documentation",
158
+ "{projectRoot}/{README.md,package.json,Cargo.toml,executors.json,generators.json}"
159
+ ],
160
+ outputs: [
161
+ "{projectRoot}/README.md"
162
+ ],
163
+ dependsOn: [
164
+ "^format-readme"
165
+ ],
166
+ executor: "nx:run-commands",
167
+ options: {
168
+ command: 'pnpm exec storm-git readme --templates="tools/readme-templates" --project="{projectName}"'
169
+ }
170
+ };
171
+ }
172
+ if (!targets["format-prettier"]) {
173
+ targets["format-prettier"] = {
174
+ inputs: [
175
+ "linting",
176
+ "typescript",
177
+ "^production"
178
+ ],
179
+ outputs: [
180
+ "{projectRoot}/**/*"
181
+ ],
182
+ dependsOn: [
183
+ "^format-prettier"
184
+ ],
185
+ executor: "nx:run-commands",
186
+ options: {
187
+ command: 'pnpm exec prettier "{projectRoot}/**/*" --write --ignore-unknown --no-error-on-unmatched-pattern --config="node_modules/@storm-software/prettier/config.json" --ignore-path="node_modules/@storm-software/prettier/.prettierignore" --cache --cache-location="node_modules/.cache/prettier/{projectRoot}" '
188
+ }
189
+ };
190
+ }
191
+ if (!targets.format) {
192
+ targets.format = {
193
+ dependsOn: [
194
+ "format-readme",
195
+ "format-toml",
196
+ "format-prettier",
197
+ "^format"
198
+ ],
199
+ executor: "nx:run-commands",
200
+ options: {
201
+ command: `echo 'Formatting the project files in "{projectRoot}"' `
202
+ }
203
+ };
204
+ }
205
+ if (!targets.clean) {
206
+ targets.clean = {
207
+ cache: true,
208
+ executor: "nx:run-commands",
209
+ inputs: [
210
+ "typescript",
211
+ "^production"
212
+ ],
213
+ outputs: [
214
+ "{workspaceRoot}/dist/{projectRoot}"
215
+ ],
216
+ options: {
217
+ command: "pnpm exec rimraf dist/{projectRoot}",
218
+ color: true,
219
+ cwd: "{workspaceRoot}"
220
+ }
221
+ };
222
+ }
223
+ if (!targets.rebuild) {
224
+ targets.rebuild = {
225
+ cache: false,
226
+ executor: "nx:run-commands",
227
+ dependsOn: [
228
+ "clean",
229
+ "^build"
230
+ ],
231
+ inputs: [
232
+ "typescript",
233
+ "default",
234
+ "^production"
235
+ ],
236
+ outputs: [
237
+ "{workspaceRoot}/dist/{projectRoot}"
238
+ ],
239
+ options: {
240
+ command: `pnpm exec nx run ${project.name}:build`
241
+ }
242
+ };
243
+ }
244
+ if (!targets.test && checkJestConfigAtPath(project.root)) {
245
+ targets.test = {
246
+ cache: true,
247
+ executor: "@nx/jest:jest",
248
+ inputs: [
249
+ "testing",
250
+ "typescript",
251
+ "^production"
252
+ ],
253
+ outputs: [
254
+ "{workspaceRoot}/coverage/{projectRoot}"
255
+ ],
256
+ defaultConfiguration: "development",
257
+ options: {
258
+ jestConfig: "{projectRoot}/jest.config.ts",
259
+ passWithNoTests: true
260
+ },
261
+ configurations: {
262
+ development: {
263
+ ci: false,
264
+ codeCoverage: true
265
+ },
266
+ production: {
267
+ ci: true,
268
+ codeCoverage: true
269
+ }
270
+ }
271
+ };
272
+ }
273
+ targets["size-limit"] = {
274
+ dependsOn: [
275
+ "build",
276
+ "^size-limit"
277
+ ],
278
+ options: {}
279
+ };
280
+ const isPrivate = packageJson.private ?? false;
281
+ if (!isPrivate) {
282
+ addProjectTag(project, ProjectTagConstants.Registry.TAG_ID, ProjectTagConstants.Registry.NPM, {
283
+ overwrite: true
284
+ });
285
+ targets["nx-release-publish"] = {
286
+ dependsOn: [
287
+ "build",
288
+ "size-limit",
289
+ "^nx-release-publish"
290
+ ],
291
+ executor: "@storm-software/workspace-tools:npm-publish",
292
+ options: {}
293
+ };
294
+ if (project.projectType === "application" || isEqualProjectTag(project, ProjectTagConstants.ProjectType.TAG_ID, ProjectTagConstants.ProjectType.APPLICATION) || isEqualProjectTag(project, ProjectTagConstants.DistStyle.TAG_ID, ProjectTagConstants.DistStyle.CLEAN)) {
295
+ targets["clean-package"] = {
296
+ cache: true,
297
+ dependsOn: [
298
+ "build"
299
+ ],
300
+ inputs: [
301
+ "linting",
302
+ "testing",
303
+ "documentation",
304
+ "default",
305
+ "^production"
306
+ ],
307
+ outputs: [
308
+ "{workspaceRoot}/dist/{projectRoot}"
309
+ ],
310
+ executor: "@storm-software/workspace-tools:clean-package",
311
+ options: {
312
+ cleanReadMe: true,
313
+ cleanComments: true
314
+ }
315
+ };
316
+ targets["nx-release-publish"].dependsOn?.push("clean-package");
317
+ targets["size-limit"].dependsOn?.push("clean-package");
318
+ }
319
+ }
320
+ addProjectTag(project, ProjectTagConstants.Language.TAG_ID, ProjectTagConstants.Language.TYPESCRIPT, {
321
+ overwrite: true
322
+ });
323
+ const platform = getProjectPlatform(project);
324
+ switch (platform) {
325
+ case "worker":
326
+ addProjectTag(project, ProjectTagConstants.Platform.TAG_ID, ProjectTagConstants.Platform.WORKER, {
327
+ overwrite: true
328
+ });
329
+ break;
330
+ case "node":
331
+ addProjectTag(project, ProjectTagConstants.Platform.TAG_ID, ProjectTagConstants.Platform.NODE, {
332
+ overwrite: true
333
+ });
334
+ break;
335
+ case "browser":
336
+ addProjectTag(project, ProjectTagConstants.Platform.TAG_ID, ProjectTagConstants.Platform.BROWSER, {
337
+ overwrite: true
338
+ });
339
+ break;
340
+ default:
341
+ addProjectTag(project, ProjectTagConstants.Platform.TAG_ID, ProjectTagConstants.Platform.NEUTRAL, {
342
+ overwrite: true
343
+ });
344
+ break;
345
+ }
346
+ setDefaultProjectTags(project, name);
347
+ const result = project?.name ? {
348
+ projects: {
349
+ [project.name]: {
350
+ ...project,
351
+ root: relativeRoot,
352
+ targets,
353
+ release: {
354
+ ...project?.release,
355
+ version: {
356
+ ...project?.release?.version,
357
+ generator: "@storm-software/workspace-tools:release-version"
358
+ }
359
+ }
360
+ }
361
+ }
362
+ } : {};
363
+ console.log(`Writing Results for ${project?.name ?? "missing name"}`);
364
+ console.log(result);
365
+ return result;
366
+ } catch (e) {
367
+ console.error(e);
368
+ return {};
369
+ }
370
+ }, configFiles, options, context);
371
+ }
372
+ ];
373
+ function createProjectFromPackageJsonNextToProjectJson(projectJsonPath, packageJson) {
374
+ const { nx, name: name2 } = packageJson;
375
+ const root = dirname(projectJsonPath);
376
+ return {
377
+ ...nx,
378
+ name: name2,
379
+ root,
380
+ targets: {}
381
+ };
382
+ }
383
+ __name(createProjectFromPackageJsonNextToProjectJson, "createProjectFromPackageJsonNextToProjectJson");
384
+ function createPackageJson(projectJsonPath, workspaceRoot) {
385
+ try {
386
+ const root = dirname(projectJsonPath);
387
+ const packageJsonPath = join(workspaceRoot, root, "package.json");
388
+ if (!existsSync(packageJsonPath)) {
389
+ return null;
390
+ }
391
+ return readJsonFile(packageJsonPath);
392
+ } catch (e) {
393
+ console.log(e);
394
+ return null;
395
+ }
396
+ }
397
+ __name(createPackageJson, "createPackageJson");
398
+ async function createTsconfig(projectJsonPath, workspaceRoot) {
399
+ try {
400
+ const root = dirname(projectJsonPath);
401
+ const tsconfigJsonPath = join(workspaceRoot, root, "tsconfig.json");
402
+ if (!existsSync(tsconfigJsonPath)) {
403
+ return null;
404
+ }
405
+ return readTSConfig(tsconfigJsonPath);
406
+ } catch (e) {
407
+ console.log(e);
408
+ return null;
409
+ }
410
+ }
411
+ __name(createTsconfig, "createTsconfig");
412
+ function checkEslintConfigAtPath(directory) {
413
+ const hasEslintConfigFile = /* @__PURE__ */ __name((fileName) => {
414
+ return existsSync(join(directory, fileName));
415
+ }, "hasEslintConfigFile");
416
+ if (hasEslintConfigFile(".eslintrc.js")) {
417
+ return ".eslintrc.js";
418
+ } else if (hasEslintConfigFile(".eslintrc.cjs")) {
419
+ return ".eslintrc.cjs";
420
+ } else if (hasEslintConfigFile(".eslintrc.yaml")) {
421
+ return ".eslintrc.yaml";
422
+ } else if (hasEslintConfigFile(".eslintrc.yml")) {
423
+ return ".eslintrc.yml";
424
+ } else if (hasEslintConfigFile(".eslintrc.json")) {
425
+ return ".eslintrc.json";
426
+ } else if (hasEslintConfigFile(".eslintrc")) {
427
+ return ".eslintrc";
428
+ } else if (hasEslintConfigFile("eslint.config.js")) {
429
+ return "eslint.config.js";
430
+ } else if (hasEslintConfigFile("eslint.config.cjs")) {
431
+ return "eslint.config.cjs";
432
+ } else if (hasEslintConfigFile("eslint.config.mjs")) {
433
+ return "eslint.config.mjs";
434
+ } else if (hasEslintConfigFile("eslint.config.ts")) {
435
+ return "eslint.config.ts";
436
+ } else if (hasEslintConfigFile("eslint.config.cts")) {
437
+ return "eslint.config.cts";
438
+ } else if (hasEslintConfigFile("eslint.config.mts")) {
439
+ return "eslint.config.mts";
440
+ }
441
+ return null;
442
+ }
443
+ __name(checkEslintConfigAtPath, "checkEslintConfigAtPath");
444
+ function checkJestConfigAtPath(directory) {
445
+ const hasJestConfigFile = /* @__PURE__ */ __name((fileName) => {
446
+ return existsSync(join(directory, fileName));
447
+ }, "hasJestConfigFile");
448
+ if (hasJestConfigFile("eslint.config.js")) {
449
+ return "jest.config.js";
450
+ } else if (hasJestConfigFile("eslint.config.cjs")) {
451
+ return "jest.config.cjs";
452
+ } else if (hasJestConfigFile("eslint.config.mjs")) {
453
+ return "jest.config.mjs";
454
+ } else if (hasJestConfigFile("eslint.config.ts")) {
455
+ return "jest.config.ts";
456
+ } else if (hasJestConfigFile("jest.config.cts")) {
457
+ return "jest.config.cts";
458
+ } else if (hasJestConfigFile("jest.config.mts")) {
459
+ return "jest.config.mts";
460
+ }
461
+ return null;
462
+ }
463
+ __name(checkJestConfigAtPath, "checkJestConfigAtPath");
464
+
465
+ export {
466
+ name,
467
+ createNodesV2
468
+ };