@storm-software/workspace-tools 1.30.2 → 1.30.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 +7 -0
- package/index.js +84 -78
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/executors/tsup/executor.js +48 -78
- package/src/executors/tsup/get-config.js +3 -2
- package/src/executors/tsup/schema.d.ts +1 -1
- package/src/executors/tsup/schema.json +2 -2
- package/src/executors/tsup-browser/executor.js +48 -78
- package/src/executors/tsup-neutral/executor.js +48 -78
- package/src/executors/tsup-node/executor.js +48 -78
- package/src/utils/index.js +60 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.30.2](https://github.com/storm-software/storm-ops/compare/workspace-tools-v1.30.1...workspace-tools-v1.30.2) (2023-12-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **workspace-tools:** Resolved issue where `includeSrc` option was incorrectly set ([a162001](https://github.com/storm-software/storm-ops/commit/a162001761a68900b5dc968f27cb70859bcfcc6a))
|
|
7
|
+
|
|
1
8
|
## [1.30.1](https://github.com/storm-software/storm-ops/compare/workspace-tools-v1.30.0...workspace-tools-v1.30.1) (2023-12-12)
|
|
2
9
|
|
|
3
10
|
|
package/index.js
CHANGED
|
@@ -26484,46 +26484,6 @@ var require_devkit = __commonJS({
|
|
|
26484
26484
|
}
|
|
26485
26485
|
});
|
|
26486
26486
|
|
|
26487
|
-
// node_modules/.pnpm/@nx+esbuild@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_esbuild@0.19._qd2wqrdgtfa7fy24o2frhwj6em/node_modules/@nx/esbuild/src/executors/esbuild/lib/get-extra-dependencies.js
|
|
26488
|
-
var require_get_extra_dependencies = __commonJS({
|
|
26489
|
-
"node_modules/.pnpm/@nx+esbuild@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_esbuild@0.19._qd2wqrdgtfa7fy24o2frhwj6em/node_modules/@nx/esbuild/src/executors/esbuild/lib/get-extra-dependencies.js"(exports) {
|
|
26490
|
-
"use strict";
|
|
26491
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26492
|
-
exports.getExtraDependencies = void 0;
|
|
26493
|
-
function getExtraDependencies2(projectName, graph) {
|
|
26494
|
-
const deps = /* @__PURE__ */ new Map();
|
|
26495
|
-
recur(projectName);
|
|
26496
|
-
function recur(currProjectName) {
|
|
26497
|
-
const allDeps = graph.dependencies[currProjectName];
|
|
26498
|
-
const externalDeps = allDeps.reduce((acc, node) => {
|
|
26499
|
-
const found = graph.externalNodes[node.target];
|
|
26500
|
-
if (found)
|
|
26501
|
-
acc.push(found);
|
|
26502
|
-
return acc;
|
|
26503
|
-
}, []);
|
|
26504
|
-
const internalDeps = allDeps.reduce((acc, node) => {
|
|
26505
|
-
const found = graph.nodes[node.target];
|
|
26506
|
-
if (found)
|
|
26507
|
-
acc.push(found);
|
|
26508
|
-
return acc;
|
|
26509
|
-
}, []);
|
|
26510
|
-
for (const externalDep of externalDeps) {
|
|
26511
|
-
deps.set(externalDep.name, {
|
|
26512
|
-
name: externalDep.name,
|
|
26513
|
-
outputs: [],
|
|
26514
|
-
node: externalDep
|
|
26515
|
-
});
|
|
26516
|
-
}
|
|
26517
|
-
for (const internalDep of internalDeps) {
|
|
26518
|
-
recur(internalDep.name);
|
|
26519
|
-
}
|
|
26520
|
-
}
|
|
26521
|
-
return Array.from(deps.values());
|
|
26522
|
-
}
|
|
26523
|
-
exports.getExtraDependencies = getExtraDependencies2;
|
|
26524
|
-
}
|
|
26525
|
-
});
|
|
26526
|
-
|
|
26527
26487
|
// node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/package.json
|
|
26528
26488
|
var require_package2 = __commonJS({
|
|
26529
26489
|
"node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/package.json"(exports, module2) {
|
|
@@ -106597,7 +106557,10 @@ __export(workspace_tools_exports, {
|
|
|
106597
106557
|
eslintVersion: () => eslintVersion,
|
|
106598
106558
|
findCacheDirectory: () => findCacheDirectory,
|
|
106599
106559
|
findFileName: () => findFileName,
|
|
106560
|
+
getExternalDependencies: () => getExternalDependencies,
|
|
106561
|
+
getExtraDependencies: () => getExtraDependencies,
|
|
106600
106562
|
getFileBanner: () => getFileBanner,
|
|
106563
|
+
getInternalDependencies: () => getInternalDependencies,
|
|
106601
106564
|
getProjectConfigurations: () => getProjectConfigurations,
|
|
106602
106565
|
getWorkspaceRoot: () => getWorkspaceRoot2,
|
|
106603
106566
|
lintStagedVersion: () => lintStagedVersion,
|
|
@@ -110928,7 +110891,6 @@ ${commentStart} ----------------------------------------------------------------
|
|
|
110928
110891
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
110929
110892
|
var import_esbuild_decorators = __toESM(require_src());
|
|
110930
110893
|
var import_devkit2 = __toESM(require_devkit());
|
|
110931
|
-
var import_get_extra_dependencies = __toESM(require_get_extra_dependencies());
|
|
110932
110894
|
var import_js = __toESM(require_src2());
|
|
110933
110895
|
var import_normalize_options = __toESM(require_normalize_options());
|
|
110934
110896
|
var import_tsc = __toESM(require_tsc_impl());
|
|
@@ -117172,6 +117134,60 @@ function findFileName(filePath) {
|
|
|
117172
117134
|
)?.pop() ?? "";
|
|
117173
117135
|
}
|
|
117174
117136
|
|
|
117137
|
+
// packages/workspace-tools/src/utils/get-project-deps.ts
|
|
117138
|
+
function getExtraDependencies(projectName, graph) {
|
|
117139
|
+
const deps = /* @__PURE__ */ new Map();
|
|
117140
|
+
recur(projectName);
|
|
117141
|
+
function recur(currProjectName) {
|
|
117142
|
+
const allDeps = graph.dependencies[currProjectName];
|
|
117143
|
+
const externalDeps = allDeps.reduce((acc, node) => {
|
|
117144
|
+
const found = graph.externalNodes[node.target];
|
|
117145
|
+
if (found)
|
|
117146
|
+
acc.push(found);
|
|
117147
|
+
return acc;
|
|
117148
|
+
}, []);
|
|
117149
|
+
const internalDeps = allDeps.reduce((acc, node) => {
|
|
117150
|
+
const found = graph.nodes[node.target];
|
|
117151
|
+
if (found)
|
|
117152
|
+
acc.push(found);
|
|
117153
|
+
return acc;
|
|
117154
|
+
}, []);
|
|
117155
|
+
for (const externalDep of externalDeps) {
|
|
117156
|
+
deps.set(externalDep.name, {
|
|
117157
|
+
name: externalDep.name,
|
|
117158
|
+
outputs: [],
|
|
117159
|
+
node: externalDep
|
|
117160
|
+
});
|
|
117161
|
+
}
|
|
117162
|
+
for (const internalDep of internalDeps) {
|
|
117163
|
+
recur(internalDep.name);
|
|
117164
|
+
}
|
|
117165
|
+
}
|
|
117166
|
+
return Array.from(deps.values());
|
|
117167
|
+
}
|
|
117168
|
+
function getInternalDependencies(projectName, graph) {
|
|
117169
|
+
const allDeps = graph.dependencies[projectName];
|
|
117170
|
+
return Array.from(
|
|
117171
|
+
allDeps.reduce((acc, node) => {
|
|
117172
|
+
const found = graph.nodes[node.target];
|
|
117173
|
+
if (found)
|
|
117174
|
+
acc.push(found);
|
|
117175
|
+
return acc;
|
|
117176
|
+
}, [])
|
|
117177
|
+
);
|
|
117178
|
+
}
|
|
117179
|
+
function getExternalDependencies(projectName, graph) {
|
|
117180
|
+
const allDeps = graph.dependencies[projectName];
|
|
117181
|
+
return Array.from(
|
|
117182
|
+
allDeps.reduce((acc, node) => {
|
|
117183
|
+
const found = graph.externalNodes[node.target];
|
|
117184
|
+
if (found)
|
|
117185
|
+
acc.push(found);
|
|
117186
|
+
return acc;
|
|
117187
|
+
}, [])
|
|
117188
|
+
);
|
|
117189
|
+
}
|
|
117190
|
+
|
|
117175
117191
|
// packages/workspace-tools/src/executors/tsup/get-config.ts
|
|
117176
117192
|
var import_devkit = __toESM(require_devkit());
|
|
117177
117193
|
var import_tsup = __toESM(require_dist6());
|
|
@@ -117407,13 +117423,14 @@ function getConfig(workspaceRoot, projectRoot, sourceRoot, {
|
|
|
117407
117423
|
tsConfig,
|
|
117408
117424
|
additionalEntryPoints,
|
|
117409
117425
|
platform,
|
|
117426
|
+
emitOnAll = true,
|
|
117410
117427
|
...rest
|
|
117411
117428
|
}) {
|
|
117412
117429
|
const entryPoints = [];
|
|
117413
117430
|
if (rest.entry) {
|
|
117414
117431
|
entryPoints.push(rest.entry);
|
|
117415
117432
|
}
|
|
117416
|
-
if (
|
|
117433
|
+
if (emitOnAll !== false) {
|
|
117417
117434
|
entryPoints.push((0, import_devkit.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"));
|
|
117418
117435
|
}
|
|
117419
117436
|
if (additionalEntryPoints) {
|
|
@@ -117425,7 +117442,7 @@ function getConfig(workspaceRoot, projectRoot, sourceRoot, {
|
|
|
117425
117442
|
let propertyKey = (0, import_devkit.joinPathFragments)(
|
|
117426
117443
|
filePath.path,
|
|
117427
117444
|
removeExtension(filePath.name)
|
|
117428
|
-
).replaceAll("\\", "/").replaceAll(workspaceRoot.substring(
|
|
117445
|
+
).replaceAll("\\", "/").replaceAll(workspaceRoot.substring(2).replaceAll("\\", "/"), "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
|
|
117429
117446
|
if (propertyKey) {
|
|
117430
117447
|
while (propertyKey.startsWith("/")) {
|
|
117431
117448
|
propertyKey = propertyKey.substring(1);
|
|
@@ -117547,28 +117564,6 @@ ${Object.keys(options).map(
|
|
|
117547
117564
|
options.external
|
|
117548
117565
|
);
|
|
117549
117566
|
}
|
|
117550
|
-
const implicitDependencies = context.projectsConfigurations.projects[context.projectName].implicitDependencies;
|
|
117551
|
-
if (implicitDependencies && implicitDependencies.length > 0) {
|
|
117552
|
-
options.external = implicitDependencies.reduce(
|
|
117553
|
-
(ret, key) => {
|
|
117554
|
-
if (Object.keys(context.projectsConfigurations.projects[key]?.targets).length > 0) {
|
|
117555
|
-
const buildTargetName = Object.keys(
|
|
117556
|
-
context.projectsConfigurations.projects[key].targets
|
|
117557
|
-
).find((name) => name.toLowerCase() === "build");
|
|
117558
|
-
if (buildTargetName && context.projectsConfigurations.projects[key].targets[buildTargetName]?.options?.project) {
|
|
117559
|
-
const packageJson = (0, import_devkit2.readJsonFile)(
|
|
117560
|
-
context.projectsConfigurations.projects[key].targets[buildTargetName].options.project
|
|
117561
|
-
);
|
|
117562
|
-
if (packageJson?.name && !options.external.includes(packageJson.name)) {
|
|
117563
|
-
ret.push(packageJson.name);
|
|
117564
|
-
}
|
|
117565
|
-
}
|
|
117566
|
-
}
|
|
117567
|
-
return ret;
|
|
117568
|
-
},
|
|
117569
|
-
options.external
|
|
117570
|
-
);
|
|
117571
|
-
}
|
|
117572
117567
|
let externalDependencies = options.external.reduce((acc, name) => {
|
|
117573
117568
|
const externalNode = context.projectGraph.externalNodes[`npm:${name}`];
|
|
117574
117569
|
if (externalNode) {
|
|
@@ -117580,19 +117575,19 @@ ${Object.keys(options).map(
|
|
|
117580
117575
|
}
|
|
117581
117576
|
return acc;
|
|
117582
117577
|
}, []);
|
|
117583
|
-
|
|
117584
|
-
|
|
117585
|
-
|
|
117586
|
-
|
|
117587
|
-
|
|
117588
|
-
|
|
117589
|
-
|
|
117590
|
-
|
|
117578
|
+
let internalDependencies = [];
|
|
117579
|
+
for (const internalDependency of getInternalDependencies(
|
|
117580
|
+
context.projectName,
|
|
117581
|
+
context.projectGraph
|
|
117582
|
+
)) {
|
|
117583
|
+
const packageConfig = internalDependency.node.data;
|
|
117584
|
+
if (packageConfig?.packageName) {
|
|
117585
|
+
options.external.push(packageConfig.packageName);
|
|
117586
|
+
internalDependencies.push(internalDependency);
|
|
117591
117587
|
}
|
|
117592
|
-
|
|
117593
|
-
}, externalDependencies);
|
|
117588
|
+
}
|
|
117594
117589
|
if (options.bundle === false) {
|
|
117595
|
-
for (const thirdPartyDependency of (
|
|
117590
|
+
for (const thirdPartyDependency of getExternalDependencies(
|
|
117596
117591
|
context.projectName,
|
|
117597
117592
|
context.projectGraph
|
|
117598
117593
|
)) {
|
|
@@ -117628,7 +117623,7 @@ ${Object.keys(options).map(
|
|
|
117628
117623
|
delete packageJson.dependencies;
|
|
117629
117624
|
externalDependencies.forEach((entry) => {
|
|
117630
117625
|
const packageConfig = entry.node.data;
|
|
117631
|
-
if (packageConfig?.packageName &&
|
|
117626
|
+
if (packageConfig?.packageName && !!(projectGraph.externalNodes[entry.node.name]?.type === "npm")) {
|
|
117632
117627
|
const { packageName, version } = packageConfig;
|
|
117633
117628
|
if (workspacePackageJson.dependencies?.[packageName] || workspacePackageJson.devDependencies?.[packageName]) {
|
|
117634
117629
|
return;
|
|
@@ -117637,6 +117632,14 @@ ${Object.keys(options).map(
|
|
|
117637
117632
|
packageJson.dependencies[packageName] = !!projectGraph.nodes[entry.node.name] ? "latest" : version;
|
|
117638
117633
|
}
|
|
117639
117634
|
});
|
|
117635
|
+
internalDependencies.forEach((entry) => {
|
|
117636
|
+
const packageConfig = entry.node.data;
|
|
117637
|
+
if (packageConfig?.packageName) {
|
|
117638
|
+
const { packageName, version } = packageConfig;
|
|
117639
|
+
packageJson.dependencies ??= {};
|
|
117640
|
+
packageJson.dependencies[packageName] = version ? version : "latest";
|
|
117641
|
+
}
|
|
117642
|
+
});
|
|
117640
117643
|
packageJson.type = "module";
|
|
117641
117644
|
packageJson.exports ??= {
|
|
117642
117645
|
".": {
|
|
@@ -117888,7 +117891,7 @@ var applyDefaultOptions = (options) => {
|
|
|
117888
117891
|
options.apiReport ??= true;
|
|
117889
117892
|
options.docModel ??= true;
|
|
117890
117893
|
options.tsdocMetadata ??= true;
|
|
117891
|
-
options.
|
|
117894
|
+
options.emitOnAll ??= true;
|
|
117892
117895
|
options.define ??= {};
|
|
117893
117896
|
options.env ??= {};
|
|
117894
117897
|
options.verbose ??= !!process.env.CI;
|
|
@@ -119857,7 +119860,10 @@ var WorkspaceStorage = class {
|
|
|
119857
119860
|
eslintVersion,
|
|
119858
119861
|
findCacheDirectory,
|
|
119859
119862
|
findFileName,
|
|
119863
|
+
getExternalDependencies,
|
|
119864
|
+
getExtraDependencies,
|
|
119860
119865
|
getFileBanner,
|
|
119866
|
+
getInternalDependencies,
|
|
119861
119867
|
getProjectConfigurations,
|
|
119862
119868
|
getWorkspaceRoot,
|
|
119863
119869
|
lintStagedVersion,
|