@storm-software/workspace-tools 1.207.3 → 1.207.4

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,10 @@
1
+ ## 1.207.4 (2024-12-23)
2
+
3
+ ### Bug Fixes
4
+
5
+ - **workspace-tools:** Add wildcards to `tsup` plugin
6
+ ([dbcb6385](https://github.com/storm-software/storm-ops/commit/dbcb6385))
7
+
1
8
  ## 1.207.3 (2024-12-23)
2
9
 
3
10
  ### Bug Fixes
package/meta.json CHANGED
@@ -24797,7 +24797,7 @@
24797
24797
  "format": "esm"
24798
24798
  },
24799
24799
  "packages/workspace-tools/src/plugins/typescript/tsup.ts": {
24800
- "bytes": 3896,
24800
+ "bytes": 4668,
24801
24801
  "imports": [
24802
24802
  {
24803
24803
  "path": "@nx/devkit",
@@ -68548,13 +68548,13 @@
68548
68548
  "entryPoint": "packages/workspace-tools/src/plugins/typescript/tsup.ts",
68549
68549
  "inputs": {
68550
68550
  "packages/workspace-tools/src/plugins/typescript/tsup.ts": {
68551
- "bytesInOutput": 3863
68551
+ "bytesInOutput": 4402
68552
68552
  },
68553
68553
  "packages/workspace-tools/src/utils/project-tags.ts": {
68554
68554
  "bytesInOutput": 2559
68555
68555
  }
68556
68556
  },
68557
- "bytes": 7498
68557
+ "bytes": 8039
68558
68558
  },
68559
68559
  "dist/packages/workspace-tools/src/utils/index.js": {
68560
68560
  "imports": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/workspace-tools",
3
- "version": "1.207.3",
3
+ "version": "1.207.4",
4
4
  "type": "commonjs",
5
5
  "description": "Tools for managing a Storm workspace, including various Nx generators and executors for common development tasks.",
6
6
  "repository": {
@@ -1,3 +1,5 @@
1
- import { CreateNodes } from "@nx/devkit";
1
+ import { CreateNodesV2 } from "@nx/devkit";
2
2
  export declare const name = "storm-software/typescript/tsup";
3
- export declare const createNodes: CreateNodes<any>;
3
+ export interface TsupPluginOptions {
4
+ }
5
+ export declare const createNodesV2: CreateNodesV2<TsupPluginOptions>;
@@ -19,7 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  // packages/workspace-tools/src/plugins/typescript/tsup.ts
20
20
  var tsup_exports = {};
21
21
  __export(tsup_exports, {
22
- createNodes: () => createNodes,
22
+ createNodesV2: () => createNodesV2,
23
23
  name: () => name
24
24
  });
25
25
  module.exports = __toCommonJS(tsup_exports);
@@ -121,84 +121,92 @@ var setDefaultProjectTags = (project, plugin) => {
121
121
 
122
122
  // packages/workspace-tools/src/plugins/typescript/tsup.ts
123
123
  var name = "storm-software/typescript/tsup";
124
- var createNodes = [
124
+ var createNodesV2 = [
125
125
  "**/tsup.config.ts",
126
- (file, opts, ctx) => {
127
- const projectRoot = createProjectRoot(file, ctx.workspaceRoot);
128
- if (!projectRoot) {
129
- console.error(
130
- `tsup.config.ts file must be location in the project root directory: ${file}`
131
- );
132
- return {};
133
- }
134
- const packageJson = (0, import_devkit.readJsonFile)((0, import_node_path.join)(projectRoot, "package.json"));
135
- if (!packageJson) {
136
- console.error(`No package.json found in project root: ${projectRoot}`);
137
- return {};
138
- }
139
- if (!packageJson.devDependencies?.tsup && !packageJson.dependencies?.tsup) {
140
- console.warn(
141
- `No "tsup" dependency or devDependency found in package.json: ${file}
126
+ async (configFiles, options, context) => {
127
+ return await (0, import_devkit.createNodesFromFiles)(
128
+ (configFile, options2, context2) => {
129
+ console.log(`Processing tsup.config.ts file: ${configFile}`);
130
+ const projectRoot = createProjectRoot(
131
+ configFile,
132
+ context2.workspaceRoot
133
+ );
134
+ if (!projectRoot) {
135
+ console.error(
136
+ `tsup.config.ts file must be location in the project root directory: ${configFile}`
137
+ );
138
+ return {};
139
+ }
140
+ const packageJson = (0, import_devkit.readJsonFile)((0, import_node_path.join)(projectRoot, "package.json"));
141
+ if (!packageJson) {
142
+ console.error(
143
+ `No package.json found in project root: ${projectRoot}`
144
+ );
145
+ return {};
146
+ }
147
+ if (!packageJson.devDependencies?.tsup && !packageJson.dependencies?.tsup) {
148
+ console.warn(
149
+ `No "tsup" dependency or devDependency found in package.json: ${configFile}
142
150
  Please add it to your dependencies by running "pnpm add tsup -D --filter="${packageJson.name}"`
143
- );
144
- }
145
- const project = createProjectFromPackageJsonNextToProjectJson(
146
- (0, import_node_path.join)(projectRoot, "project.json"),
147
- packageJson
148
- );
149
- const nxJson = (0, import_nx_json.readNxJson)(ctx.workspaceRoot);
150
- const targets = (0, import_package_json.readTargetsFromPackageJson)(
151
- packageJson,
152
- nxJson
153
- );
154
- let relativeRoot = projectRoot.replace(ctx.workspaceRoot, "").replaceAll("\\", "/");
155
- if (relativeRoot.startsWith("/")) {
156
- relativeRoot = relativeRoot.slice(1);
157
- }
158
- targets["build-base"] = {
159
- cache: true,
160
- inputs: [file, "typescript", "^production"],
161
- outputs: [`${relativeRoot}/dist/**/*`],
162
- executor: "nx:run-commands",
163
- dependsOn: ["clean", "^build"],
164
- options: {
165
- command: `tsup --config="${file}"`,
166
- cwd: relativeRoot
167
- }
168
- };
169
- targets.build = {
170
- cache: true,
171
- inputs: [file, "typescript", "^production"],
172
- outputs: [`dist/${relativeRoot}/**/*`],
173
- executor: "nx:run-commands",
174
- dependsOn: ["build-base"],
175
- options: {
176
- commands: [
177
- `pnpm copyfiles LICENSE dist/${relativeRoot}`,
178
- `pnpm copyfiles --up=2 ./${relativeRoot}/README.md ./${relativeRoot}/package.json dist/${relativeRoot}`,
179
- `pnpm copyfiles --up=3 ./${relativeRoot}/dist/* dist/${relativeRoot}/dist`
180
- ]
181
- }
182
- };
183
- targets.clean = {
184
- executor: "nx:run-commands",
185
- inputs: [file, "typescript", "^production"],
186
- options: {
187
- commands: [
188
- `pnpm exec rimraf dist/${relativeRoot}`,
189
- `pnpm exec rimraf ${relativeRoot}/dist`
190
- ]
191
- }
192
- };
193
- setDefaultProjectTags(project, name);
194
- return project?.name ? {
195
- projects: {
196
- [project.name]: {
197
- ...project,
198
- targets
151
+ );
199
152
  }
200
- }
201
- } : {};
153
+ const project = createProjectFromPackageJsonNextToProjectJson(
154
+ (0, import_node_path.join)(projectRoot, "project.json"),
155
+ packageJson
156
+ );
157
+ const nxJson = (0, import_nx_json.readNxJson)(context2.workspaceRoot);
158
+ const targets = (0, import_package_json.readTargetsFromPackageJson)(packageJson, nxJson);
159
+ let relativeRoot = projectRoot.replace(context2.workspaceRoot, "").replaceAll("\\", "/");
160
+ if (relativeRoot.startsWith("/")) {
161
+ relativeRoot = relativeRoot.slice(1);
162
+ }
163
+ targets["build-base"] = {
164
+ cache: true,
165
+ inputs: [configFile, "typescript", "^production"],
166
+ executor: "nx:run-commands",
167
+ dependsOn: ["clean", "^build"],
168
+ options: {
169
+ command: `tsup --config="${configFile}"`,
170
+ cwd: relativeRoot
171
+ }
172
+ };
173
+ targets.build = {
174
+ cache: true,
175
+ inputs: [configFile, "typescript", "^production"],
176
+ executor: "nx:run-commands",
177
+ dependsOn: ["build-base"],
178
+ options: {
179
+ commands: [
180
+ `pnpm copyfiles LICENSE dist/${relativeRoot}`,
181
+ `pnpm copyfiles --up=2 ./${relativeRoot}/README.md ./${relativeRoot}/package.json dist/${relativeRoot}`,
182
+ `pnpm copyfiles --up=3 ./${relativeRoot}/dist/* dist/${relativeRoot}/dist`
183
+ ]
184
+ }
185
+ };
186
+ targets.clean = {
187
+ executor: "nx:run-commands",
188
+ inputs: [configFile, "typescript", "^production"],
189
+ options: {
190
+ commands: [
191
+ `pnpm exec rimraf dist/${relativeRoot}`,
192
+ `pnpm exec rimraf ${relativeRoot}/dist`
193
+ ]
194
+ }
195
+ };
196
+ setDefaultProjectTags(project, name);
197
+ return project?.name ? {
198
+ projects: {
199
+ [project.name]: {
200
+ ...project,
201
+ targets
202
+ }
203
+ }
204
+ } : {};
205
+ },
206
+ configFiles,
207
+ options,
208
+ context
209
+ );
202
210
  }
203
211
  ];
204
212
  function createProjectFromPackageJsonNextToProjectJson(projectJsonPath, packageJson) {
@@ -226,6 +234,6 @@ function createProjectRoot(configPath, workspaceRoot) {
226
234
  }
227
235
  // Annotate the CommonJS export names for ESM import in node:
228
236
  0 && (module.exports = {
229
- createNodes,
237
+ createNodesV2,
230
238
  name
231
239
  });