@storm-software/workspace-tools 1.245.1 → 1.245.3

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
@@ -1,3 +1,19 @@
1
+ ## 1.245.3 (2025-01-28)
2
+
3
+ ### Bug Fixes
4
+
5
+ - **workspace-tools:** Resolved issue with `untyped` plugin name ([5f3706bc](https://github.com/storm-software/storm-ops/commit/5f3706bc))
6
+
7
+ ### Miscellaneous
8
+
9
+ - **monorepo:** Regenerate README markdown files ([d5aac4fd](https://github.com/storm-software/storm-ops/commit/d5aac4fd))
10
+
11
+ ## 1.245.2 (2025-01-28)
12
+
13
+ ### Miscellaneous
14
+
15
+ - **monorepo:** Regenerate README markdown files ([144ad8bf](https://github.com/storm-software/storm-ops/commit/144ad8bf))
16
+
1
17
  ## 1.245.1 (2025-01-28)
2
18
 
3
19
  ### 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.245.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)
24
+ [![Version](https://img.shields.io/badge/version-1.245.2-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 -->
@@ -58,6 +58,7 @@ Please add it to your dependencies by running "pnpm add tsdown -D --filter="${pa
58
58
  ],
59
59
  executor: "nx:run-commands",
60
60
  dependsOn: [
61
+ "build-untyped",
61
62
  "^build"
62
63
  ],
63
64
  options: {
@@ -78,7 +79,9 @@ Please add it to your dependencies by running "pnpm add tsdown -D --filter="${pa
78
79
  ],
79
80
  executor: "nx:run-commands",
80
81
  dependsOn: [
81
- "build-base"
82
+ "build-base",
83
+ "build-untyped",
84
+ "^build"
82
85
  ],
83
86
  options: {
84
87
  commands: [
@@ -58,6 +58,7 @@ Please add it to your dependencies by running "pnpm add tsdown -D --filter="${pa
58
58
  ],
59
59
  executor: "nx:run-commands",
60
60
  dependsOn: [
61
+ "build-untyped",
61
62
  "^build"
62
63
  ],
63
64
  options: {
@@ -78,7 +79,9 @@ Please add it to your dependencies by running "pnpm add tsdown -D --filter="${pa
78
79
  ],
79
80
  executor: "nx:run-commands",
80
81
  dependsOn: [
81
- "build-base"
82
+ "build-base",
83
+ "build-untyped",
84
+ "^build"
82
85
  ],
83
86
  options: {
84
87
  commands: [
@@ -58,7 +58,7 @@ Please add it to your dependencies by running "pnpm add tsup -D --filter="${pack
58
58
  ],
59
59
  executor: "nx:run-commands",
60
60
  dependsOn: [
61
- "clean",
61
+ "build-untyped",
62
62
  "^build"
63
63
  ],
64
64
  options: {
@@ -79,7 +79,9 @@ Please add it to your dependencies by running "pnpm add tsup -D --filter="${pack
79
79
  ],
80
80
  executor: "nx:run-commands",
81
81
  dependsOn: [
82
- "build-base"
82
+ "build-base",
83
+ "build-untyped",
84
+ "^build"
83
85
  ],
84
86
  options: {
85
87
  commands: [
@@ -58,7 +58,7 @@ Please add it to your dependencies by running "pnpm add tsup -D --filter="${pack
58
58
  ],
59
59
  executor: "nx:run-commands",
60
60
  dependsOn: [
61
- "clean",
61
+ "build-untyped",
62
62
  "^build"
63
63
  ],
64
64
  options: {
@@ -79,7 +79,9 @@ Please add it to your dependencies by running "pnpm add tsup -D --filter="${pack
79
79
  ],
80
80
  executor: "nx:run-commands",
81
81
  dependsOn: [
82
- "build-base"
82
+ "build-base",
83
+ "build-untyped",
84
+ "^build"
83
85
  ],
84
86
  options: {
85
87
  commands: [
@@ -0,0 +1,8 @@
1
+ import { CreateNodesV2 } from '@nx/devkit';
2
+
3
+ declare const name = "storm-software/typescript/untyped";
4
+ interface UntypedPluginOptions {
5
+ }
6
+ declare const createNodesV2: CreateNodesV2<UntypedPluginOptions>;
7
+
8
+ export { type UntypedPluginOptions, createNodesV2, name };
@@ -0,0 +1,8 @@
1
+ import { CreateNodesV2 } from '@nx/devkit';
2
+
3
+ declare const name = "storm-software/typescript/untyped";
4
+ interface UntypedPluginOptions {
5
+ }
6
+ declare const createNodesV2: CreateNodesV2<UntypedPluginOptions>;
7
+
8
+ export { type UntypedPluginOptions, createNodesV2, name };
@@ -6,13 +6,13 @@ var _chunk7YRW5HNXjs = require('../../../chunk-7YRW5HNX.js');
6
6
 
7
7
  var _chunk3GQAWCBQjs = require('../../../chunk-3GQAWCBQ.js');
8
8
 
9
- // src/plugins/typescript/untyped.ts
9
+ // src/plugins/typescript/untyped-schema.ts
10
10
  var _devkit = require('@nx/devkit');
11
11
  var _fs = require('fs');
12
12
  var _path = require('path');
13
13
  var _nxjsonjs = require('nx/src/config/nx-json.js');
14
14
  var _packagejson = require('nx/src/utils/package-json');
15
- var name = "storm-software/typescript/tsup";
15
+ var name = "storm-software/typescript/untyped";
16
16
  var createNodesV2 = [
17
17
  "**/*untyped.ts",
18
18
  async (configFiles, options, context) => {
@@ -6,13 +6,13 @@ import {
6
6
  __name
7
7
  } from "../../../chunk-XUV4U54K.mjs";
8
8
 
9
- // src/plugins/typescript/untyped.ts
9
+ // src/plugins/typescript/untyped-schema.ts
10
10
  import { createNodesFromFiles, readJsonFile } from "@nx/devkit";
11
11
  import { existsSync } from "node:fs";
12
12
  import { dirname, join } from "node:path";
13
13
  import { readNxJson } from "nx/src/config/nx-json.js";
14
14
  import { readTargetsFromPackageJson } from "nx/src/utils/package-json";
15
- var name = "storm-software/typescript/tsup";
15
+ var name = "storm-software/typescript/untyped";
16
16
  var createNodesV2 = [
17
17
  "**/*untyped.ts",
18
18
  async (configFiles, options, context) => {
@@ -0,0 +1,186 @@
1
+ import {
2
+ createNodesFromFiles,
3
+ CreateNodesResultV2,
4
+ CreateNodesV2,
5
+ readJsonFile
6
+ } from "@nx/devkit";
7
+ import { existsSync } from "node:fs";
8
+ import { dirname, join } from "node:path";
9
+ import { readNxJson } from "nx/src/config/nx-json.js";
10
+ import type { ProjectConfiguration } from "nx/src/config/workspace-json-project-json";
11
+ import {
12
+ readTargetsFromPackageJson,
13
+ type PackageJson
14
+ } from "nx/src/utils/package-json";
15
+ import { addProjectTag, ProjectTagConstants } from "../../utils/project-tags";
16
+
17
+ export const name = "storm-software/typescript/untyped";
18
+
19
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
20
+ export interface UntypedPluginOptions {}
21
+
22
+ export const createNodesV2: CreateNodesV2<UntypedPluginOptions> = [
23
+ "**/*untyped.ts",
24
+ async (configFiles, options, context): Promise<CreateNodesResultV2> => {
25
+ return await createNodesFromFiles(
26
+ (configFile, options, context) => {
27
+ try {
28
+ console.log(`Processing untyped schema file: ${configFile}`);
29
+
30
+ const projectRoot = createProjectRoot(
31
+ configFile,
32
+ context.workspaceRoot
33
+ );
34
+ if (!projectRoot) {
35
+ console.error(
36
+ "No project.json found in parent directories of Untyped schema file: ",
37
+ configFile
38
+ );
39
+
40
+ return {};
41
+ }
42
+
43
+ const packageJson = readJsonFile(join(projectRoot, "package.json"));
44
+ if (!packageJson) {
45
+ console.error(
46
+ `No package.json found in project root: ${projectRoot}`
47
+ );
48
+ return {};
49
+ }
50
+
51
+ if (
52
+ !packageJson.devDependencies?.untyped &&
53
+ !packageJson.dependencies?.untyped
54
+ ) {
55
+ console.warn(
56
+ `No "untyped" dependency or devDependency found in package.json: ${configFile}
57
+ Please add it to your dependencies by running "pnpm add untyped -D --filter="${packageJson.name}"`
58
+ );
59
+ }
60
+
61
+ const project = createProjectFromPackageJsonNextToProjectJson(
62
+ join(projectRoot, "project.json"),
63
+ packageJson
64
+ );
65
+
66
+ const nxJson = readNxJson(context.workspaceRoot);
67
+ const targets: ProjectConfiguration["targets"] =
68
+ readTargetsFromPackageJson(packageJson, nxJson);
69
+
70
+ let relativeRoot = projectRoot
71
+ .replaceAll("\\", "/")
72
+ .replace(context.workspaceRoot.replaceAll("\\", "/"), "");
73
+ if (relativeRoot.startsWith("/")) {
74
+ relativeRoot = relativeRoot.slice(1);
75
+ }
76
+
77
+ let relativeConfig = configFile.replaceAll(relativeRoot, "");
78
+ while (relativeConfig.startsWith(".")) {
79
+ relativeConfig = relativeConfig.slice(1);
80
+ }
81
+ while (relativeConfig.startsWith("/")) {
82
+ relativeConfig = relativeConfig.slice(1);
83
+ }
84
+
85
+ targets["build-untyped"] ??= {
86
+ cache: true,
87
+ executor: "nx:run-commands",
88
+ dependsOn: ["clean", "^build"],
89
+ inputs: [
90
+ "{projectRoot}/src/**/untyped.ts",
91
+ "{projectRoot}/src/**/*.untyped.ts"
92
+ ],
93
+ outputs: [
94
+ "{projectRoot}/src/**/schema.d.ts",
95
+ "{projectRoot}/src/**/*.schema.d.ts",
96
+ "{projectRoot}/src/**/schema.md",
97
+ "{projectRoot}/src/**/*.schema.md",
98
+ "{projectRoot}/src/**/schema.json",
99
+ "{projectRoot}/src/**/*.schema.json"
100
+ ],
101
+ options: {
102
+ commands: [
103
+ `storm-untyped generate --entry=\"${projectRoot}/**/{untyped.ts,*.untyped.ts}\" `
104
+ ]
105
+ }
106
+ };
107
+
108
+ addProjectTag(project, ProjectTagConstants.Plugin.TAG_ID, name);
109
+
110
+ const result = project?.name
111
+ ? {
112
+ projects: {
113
+ [project.name]: {
114
+ ...project,
115
+ root: relativeRoot,
116
+ targets
117
+ }
118
+ }
119
+ }
120
+ : {};
121
+ console.log(`Writing Results for ${project?.name ?? "missing name"}`);
122
+ console.log(result);
123
+
124
+ return result;
125
+ } catch (e) {
126
+ console.error(e);
127
+ return {};
128
+ }
129
+ },
130
+ configFiles,
131
+ options,
132
+ context
133
+ );
134
+ }
135
+ ];
136
+
137
+ function createProjectFromPackageJsonNextToProjectJson(
138
+ projectJsonPath: string,
139
+ packageJson: PackageJson
140
+ ): ProjectConfiguration {
141
+ const { nx, name } = packageJson;
142
+ const root = dirname(projectJsonPath);
143
+ const projectJson = readJsonFile(projectJsonPath);
144
+
145
+ return {
146
+ targets: {},
147
+ tags: [],
148
+ name,
149
+ ...nx,
150
+ ...projectJson,
151
+ root
152
+ } as ProjectConfiguration;
153
+ }
154
+
155
+ function createProjectRoot(
156
+ configPath: string,
157
+ workspaceRoot: string
158
+ ): string | null {
159
+ try {
160
+ let root = dirname(configPath);
161
+ while (
162
+ root &&
163
+ root !== "/" &&
164
+ root !== workspaceRoot &&
165
+ !existsSync(join(root, "project.json"))
166
+ ) {
167
+ root = join(root, "..");
168
+ }
169
+ if (!existsSync(join(root, "project.json"))) {
170
+ return null;
171
+ }
172
+
173
+ const projectRoot = join(workspaceRoot, root);
174
+ if (
175
+ !existsSync(join(projectRoot, "package.json")) &&
176
+ !existsSync(join(projectRoot, "project.json"))
177
+ ) {
178
+ return null;
179
+ }
180
+
181
+ return projectRoot;
182
+ } catch (e) {
183
+ console.error(e);
184
+ return null;
185
+ }
186
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/workspace-tools",
3
- "version": "1.245.1",
3
+ "version": "1.245.3",
4
4
  "description": "Tools for managing a Storm workspace, including various Nx generators and executors for common development tasks.",
5
5
  "repository": {
6
6
  "type": "github",
@@ -152,7 +152,8 @@
152
152
  "./plugins/typescript": "./dist/src/plugins/typescript/index.js",
153
153
  "./plugins/typescript/tsup": "./dist/src/plugins/typescript/tsup.js",
154
154
  "./plugins/typescript/tsdown": "./dist/src/plugins/typescript/tsdown.js",
155
- "./plugins/typescript/untyped": "./dist/src/plugins/typescript/untyped.js"
155
+ "./plugins/typescript/untyped": "./dist/src/plugins/typescript/untyped-schema.js",
156
+ "./plugins/typescript/untyped-schema": "./dist/src/plugins/typescript/untyped-schema.js"
156
157
  },
157
158
  "typings": "dist/index.d.ts",
158
159
  "keywords": [
@@ -1,12 +0,0 @@
1
- // Generated by @storm-software/untyped
2
- // Do not edit this file directly
3
-
4
- interface TypeSchema {
5
- /** @default ["**\/*untyped.ts",null] */
6
- createNodesV2?: Array<string|Function>,
7
-
8
- /** @default "storm-software/typescript/tsup" */
9
- name?: string,
10
- }
11
-
12
- export type { TypeSchema };
@@ -1,12 +0,0 @@
1
- // Generated by @storm-software/untyped
2
- // Do not edit this file directly
3
-
4
- interface TypeSchema {
5
- /** @default ["**\/*untyped.ts",null] */
6
- createNodesV2?: Array<string|Function>,
7
-
8
- /** @default "storm-software/typescript/tsup" */
9
- name?: string,
10
- }
11
-
12
- export type { TypeSchema };
@@ -1 +0,0 @@
1
- "use strict";
@@ -1 +0,0 @@
1
- import "../../../chunk-XUV4U54K.mjs";
@@ -1,12 +0,0 @@
1
-
2
- // Generated by @storm-software/untyped
3
- // Do not edit this file directly
4
-
5
- export interface TypeSchema {
6
- /** @default ["**\/*untyped.ts",null] */
7
- createNodesV2?: Array<string|Function>,
8
-
9
- /** @default "storm-software/typescript/tsup" */
10
- name?: string,
11
- }
12
-
@@ -1,32 +0,0 @@
1
- {
2
- "id": "#",
3
- "properties": {
4
- "createNodesV2": {
5
- "type": "array",
6
- "id": "#createNodesV2",
7
- "default": [
8
- "**/*untyped.ts",
9
- null
10
- ],
11
- "items": {
12
- "type": [
13
- "string",
14
- "function"
15
- ]
16
- }
17
- },
18
- "name": {
19
- "type": "string",
20
- "id": "#name",
21
- "default": "storm-software/typescript/tsup"
22
- }
23
- },
24
- "type": "object",
25
- "default": {
26
- "createNodesV2": [
27
- "**/*untyped.ts",
28
- null
29
- ],
30
- "name": "storm-software/typescript/tsup"
31
- }
32
- }
@@ -1,16 +0,0 @@
1
-
2
- <!-- Generated by @storm-software/untyped -->
3
- <!-- Do not edit this file directly -->
4
-
5
- #
6
-
7
- ## `createNodesV2`
8
- - **Type**: `array`
9
- - **Default**: `["**/*untyped.ts",null]`
10
-
11
-
12
- ## `name`
13
- - **Type**: `string`
14
- - **Default**: `"storm-software/typescript/tsup"`
15
-
16
-
@@ -1,8 +0,0 @@
1
- import { CreateNodesV2 } from '@nx/devkit';
2
-
3
- declare const name = "storm-software/typescript/tsup";
4
- interface TsupPluginOptions {
5
- }
6
- declare const createNodesV2: CreateNodesV2<TsupPluginOptions>;
7
-
8
- export { type TsupPluginOptions, createNodesV2, name };
@@ -1,8 +0,0 @@
1
- import { CreateNodesV2 } from '@nx/devkit';
2
-
3
- declare const name = "storm-software/typescript/tsup";
4
- interface TsupPluginOptions {
5
- }
6
- declare const createNodesV2: CreateNodesV2<TsupPluginOptions>;
7
-
8
- export { type TsupPluginOptions, createNodesV2, name };
@@ -1,16 +0,0 @@
1
-
2
- <!-- Generated by @storm-software/untyped -->
3
- <!-- Do not edit this file directly -->
4
-
5
- #
6
-
7
- ## `createNodesV2`
8
- - **Type**: `array`
9
- - **Default**: `["**/*untyped.ts",null]`
10
-
11
-
12
- ## `name`
13
- - **Type**: `string`
14
- - **Default**: `"storm-software/typescript/tsup"`
15
-
16
-