@storm-software/workspace-tools 1.208.0 → 1.209.0
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 +7 -0
- package/meta.json +3 -3
- package/package.json +1 -1
- package/src/plugins/typescript/tsup.js +81 -73
package/CHANGELOG.md
CHANGED
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":
|
|
24800
|
+
"bytes": 5021,
|
|
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":
|
|
68551
|
+
"bytesInOutput": 4757
|
|
68552
68552
|
},
|
|
68553
68553
|
"packages/workspace-tools/src/utils/project-tags.ts": {
|
|
68554
68554
|
"bytesInOutput": 2559
|
|
68555
68555
|
}
|
|
68556
68556
|
},
|
|
68557
|
-
"bytes":
|
|
68557
|
+
"bytes": 8394
|
|
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.
|
|
3
|
+
"version": "1.209.0",
|
|
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": {
|
|
@@ -126,82 +126,87 @@ var createNodesV2 = [
|
|
|
126
126
|
async (configFiles, options, context) => {
|
|
127
127
|
return await (0, import_devkit.createNodesFromFiles)(
|
|
128
128
|
(configFile, options2, context2) => {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
if (!projectRoot) {
|
|
135
|
-
console.error(
|
|
136
|
-
`tsup.config.ts file must be location in the project root directory: ${configFile}`
|
|
129
|
+
try {
|
|
130
|
+
console.log(`Processing tsup.config.ts file: ${configFile}`);
|
|
131
|
+
const projectRoot = createProjectRoot(
|
|
132
|
+
configFile,
|
|
133
|
+
context2.workspaceRoot
|
|
137
134
|
);
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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}
|
|
150
|
-
Please add it to your dependencies by running "pnpm add tsup -D --filter="${packageJson.name}"`
|
|
151
|
-
);
|
|
152
|
-
}
|
|
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
|
|
135
|
+
if (!projectRoot) {
|
|
136
|
+
console.error(
|
|
137
|
+
`tsup.config.ts file must be location in the project root directory: ${configFile}`
|
|
138
|
+
);
|
|
139
|
+
return {};
|
|
171
140
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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
|
-
]
|
|
141
|
+
const packageJson = (0, import_devkit.readJsonFile)((0, import_node_path.join)(projectRoot, "package.json"));
|
|
142
|
+
if (!packageJson) {
|
|
143
|
+
console.error(
|
|
144
|
+
`No package.json found in project root: ${projectRoot}`
|
|
145
|
+
);
|
|
146
|
+
return {};
|
|
184
147
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
commands: [
|
|
191
|
-
`pnpm exec rimraf dist/${relativeRoot}`,
|
|
192
|
-
`pnpm exec rimraf ${relativeRoot}/dist`
|
|
193
|
-
]
|
|
148
|
+
if (!packageJson.devDependencies?.tsup && !packageJson.dependencies?.tsup) {
|
|
149
|
+
console.warn(
|
|
150
|
+
`No "tsup" dependency or devDependency found in package.json: ${configFile}
|
|
151
|
+
Please add it to your dependencies by running "pnpm add tsup -D --filter="${packageJson.name}"`
|
|
152
|
+
);
|
|
194
153
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
154
|
+
const project = createProjectFromPackageJsonNextToProjectJson(
|
|
155
|
+
(0, import_node_path.join)(projectRoot, "project.json"),
|
|
156
|
+
packageJson
|
|
157
|
+
);
|
|
158
|
+
const nxJson = (0, import_nx_json.readNxJson)(context2.workspaceRoot);
|
|
159
|
+
const targets = (0, import_package_json.readTargetsFromPackageJson)(packageJson, nxJson);
|
|
160
|
+
let relativeRoot = projectRoot.replace(context2.workspaceRoot, "").replaceAll("\\", "/");
|
|
161
|
+
if (relativeRoot.startsWith("/")) {
|
|
162
|
+
relativeRoot = relativeRoot.slice(1);
|
|
203
163
|
}
|
|
204
|
-
|
|
164
|
+
targets["build-base"] ??= {
|
|
165
|
+
cache: true,
|
|
166
|
+
inputs: [configFile, "typescript", "^production"],
|
|
167
|
+
executor: "nx:run-commands",
|
|
168
|
+
dependsOn: ["clean", "^build"],
|
|
169
|
+
options: {
|
|
170
|
+
command: `tsup --config="${configFile}"`,
|
|
171
|
+
cwd: relativeRoot
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
targets.build ??= {
|
|
175
|
+
cache: true,
|
|
176
|
+
inputs: [configFile, "typescript", "^production"],
|
|
177
|
+
executor: "nx:run-commands",
|
|
178
|
+
dependsOn: ["build-base"],
|
|
179
|
+
options: {
|
|
180
|
+
commands: [
|
|
181
|
+
`pnpm copyfiles LICENSE dist/${relativeRoot}`,
|
|
182
|
+
`pnpm copyfiles --up=2 ./${relativeRoot}/README.md ./${relativeRoot}/package.json dist/${relativeRoot}`,
|
|
183
|
+
`pnpm copyfiles --up=3 ./${relativeRoot}/dist/* dist/${relativeRoot}/dist`
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
targets.clean = {
|
|
188
|
+
executor: "nx:run-commands",
|
|
189
|
+
inputs: [configFile, "typescript", "^production"],
|
|
190
|
+
options: {
|
|
191
|
+
commands: [
|
|
192
|
+
`pnpm exec rimraf dist/${relativeRoot}`,
|
|
193
|
+
`pnpm exec rimraf ${relativeRoot}/dist`
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
setDefaultProjectTags(project, name);
|
|
198
|
+
return project?.name ? {
|
|
199
|
+
projects: {
|
|
200
|
+
[project.name]: {
|
|
201
|
+
...project,
|
|
202
|
+
targets
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
} : {};
|
|
206
|
+
} catch (e) {
|
|
207
|
+
console.error(e);
|
|
208
|
+
return {};
|
|
209
|
+
}
|
|
205
210
|
},
|
|
206
211
|
configFiles,
|
|
207
212
|
options,
|
|
@@ -212,11 +217,14 @@ Please add it to your dependencies by running "pnpm add tsup -D --filter="${pack
|
|
|
212
217
|
function createProjectFromPackageJsonNextToProjectJson(projectJsonPath, packageJson) {
|
|
213
218
|
const { nx, name: name2 } = packageJson;
|
|
214
219
|
const root = (0, import_node_path.dirname)(projectJsonPath);
|
|
220
|
+
const projectJson = (0, import_devkit.readJsonFile)(projectJsonPath);
|
|
215
221
|
return {
|
|
222
|
+
targets: {},
|
|
223
|
+
tags: [],
|
|
216
224
|
...nx,
|
|
225
|
+
...projectJson,
|
|
217
226
|
name: name2,
|
|
218
|
-
root
|
|
219
|
-
targets: {}
|
|
227
|
+
root
|
|
220
228
|
};
|
|
221
229
|
}
|
|
222
230
|
function createProjectRoot(configPath, workspaceRoot) {
|