@storm-software/workspace-tools 1.16.7 → 1.16.8
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 +113 -39
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/executors/tsup/executor.js +113 -39
- package/src/executors/tsup/get-config.js +94 -26
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.16.7](https://github.com/storm-software/storm-ops/compare/workspace-tools-v1.16.6...workspace-tools-v1.16.7) (2023-11-29)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **workspace-tools:** Reduce path length of `mainEntryPointFilePath` api-extractor option ([1e747d3](https://github.com/storm-software/storm-ops/commit/1e747d34c5c9c82e00884d140632f9e725950672))
|
|
7
|
+
|
|
1
8
|
## [1.16.6](https://github.com/storm-software/storm-ops/compare/workspace-tools-v1.16.5...workspace-tools-v1.16.6) (2023-11-29)
|
|
2
9
|
|
|
3
10
|
|
package/index.js
CHANGED
|
@@ -40019,9 +40019,9 @@ var require_brace_expansion2 = __commonJS({
|
|
|
40019
40019
|
}
|
|
40020
40020
|
});
|
|
40021
40021
|
|
|
40022
|
-
// node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
40022
|
+
// node_modules/.pnpm/tsup@8.0.0_patch_hash=mwafxokpvbjw3x2brcsxgpq25u_@microsoft+api-extractor@7.38.3_@swc+core@1._oivrduymnsbv3knduf2tb3tfgy/node_modules/tsup/dist/chunk-EPAEWGCP.js
|
|
40023
40023
|
var require_chunk_EPAEWGCP = __commonJS({
|
|
40024
|
-
"node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
40024
|
+
"node_modules/.pnpm/tsup@8.0.0_patch_hash=mwafxokpvbjw3x2brcsxgpq25u_@microsoft+api-extractor@7.38.3_@swc+core@1._oivrduymnsbv3knduf2tb3tfgy/node_modules/tsup/dist/chunk-EPAEWGCP.js"(exports) {
|
|
40025
40025
|
"use strict";
|
|
40026
40026
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40027
40027
|
var version = "8.0.0";
|
|
@@ -40481,9 +40481,9 @@ var require_resolve_from = __commonJS({
|
|
|
40481
40481
|
}
|
|
40482
40482
|
});
|
|
40483
40483
|
|
|
40484
|
-
// node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
40484
|
+
// node_modules/.pnpm/tsup@8.0.0_patch_hash=mwafxokpvbjw3x2brcsxgpq25u_@microsoft+api-extractor@7.38.3_@swc+core@1._oivrduymnsbv3knduf2tb3tfgy/node_modules/tsup/dist/chunk-GQ77QZBO.js
|
|
40485
40485
|
var require_chunk_GQ77QZBO = __commonJS({
|
|
40486
|
-
"node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
40486
|
+
"node_modules/.pnpm/tsup@8.0.0_patch_hash=mwafxokpvbjw3x2brcsxgpq25u_@microsoft+api-extractor@7.38.3_@swc+core@1._oivrduymnsbv3knduf2tb3tfgy/node_modules/tsup/dist/chunk-GQ77QZBO.js"(exports) {
|
|
40487
40487
|
"use strict";
|
|
40488
40488
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40489
40489
|
function _interopRequireDefault(obj) {
|
|
@@ -40761,9 +40761,9 @@ var require_chunk_GQ77QZBO = __commonJS({
|
|
|
40761
40761
|
}
|
|
40762
40762
|
});
|
|
40763
40763
|
|
|
40764
|
-
// node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
40764
|
+
// node_modules/.pnpm/tsup@8.0.0_patch_hash=mwafxokpvbjw3x2brcsxgpq25u_@microsoft+api-extractor@7.38.3_@swc+core@1._oivrduymnsbv3knduf2tb3tfgy/node_modules/tsup/dist/chunk-UIX4URMV.js
|
|
40765
40765
|
var require_chunk_UIX4URMV = __commonJS({
|
|
40766
|
-
"node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
40766
|
+
"node_modules/.pnpm/tsup@8.0.0_patch_hash=mwafxokpvbjw3x2brcsxgpq25u_@microsoft+api-extractor@7.38.3_@swc+core@1._oivrduymnsbv3knduf2tb3tfgy/node_modules/tsup/dist/chunk-UIX4URMV.js"(exports) {
|
|
40767
40767
|
"use strict";
|
|
40768
40768
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40769
40769
|
function _interopRequireWildcard(obj) {
|
|
@@ -41697,9 +41697,9 @@ var require_dist2 = __commonJS({
|
|
|
41697
41697
|
}
|
|
41698
41698
|
});
|
|
41699
41699
|
|
|
41700
|
-
// node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
41700
|
+
// node_modules/.pnpm/tsup@8.0.0_patch_hash=mwafxokpvbjw3x2brcsxgpq25u_@microsoft+api-extractor@7.38.3_@swc+core@1._oivrduymnsbv3knduf2tb3tfgy/node_modules/tsup/dist/chunk-7G76EW2R.js
|
|
41701
41701
|
var require_chunk_7G76EW2R = __commonJS({
|
|
41702
|
-
"node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
41702
|
+
"node_modules/.pnpm/tsup@8.0.0_patch_hash=mwafxokpvbjw3x2brcsxgpq25u_@microsoft+api-extractor@7.38.3_@swc+core@1._oivrduymnsbv3knduf2tb3tfgy/node_modules/tsup/dist/chunk-7G76EW2R.js"(exports) {
|
|
41703
41703
|
"use strict";
|
|
41704
41704
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41705
41705
|
function _interopRequireDefault(obj) {
|
|
@@ -95505,9 +95505,9 @@ var require_chokidar = __commonJS({
|
|
|
95505
95505
|
}
|
|
95506
95506
|
});
|
|
95507
95507
|
|
|
95508
|
-
// node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
95508
|
+
// node_modules/.pnpm/tsup@8.0.0_patch_hash=mwafxokpvbjw3x2brcsxgpq25u_@microsoft+api-extractor@7.38.3_@swc+core@1._oivrduymnsbv3knduf2tb3tfgy/node_modules/tsup/dist/index.js
|
|
95509
95509
|
var require_dist5 = __commonJS({
|
|
95510
|
-
"node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
95510
|
+
"node_modules/.pnpm/tsup@8.0.0_patch_hash=mwafxokpvbjw3x2brcsxgpq25u_@microsoft+api-extractor@7.38.3_@swc+core@1._oivrduymnsbv3knduf2tb3tfgy/node_modules/tsup/dist/index.js"(exports) {
|
|
95511
95511
|
"use strict";
|
|
95512
95512
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
95513
95513
|
function _interopRequireDefault(obj) {
|
|
@@ -97867,58 +97867,112 @@ var require_dist5 = __commonJS({
|
|
|
97867
97867
|
throw new Error("Unknown declaration");
|
|
97868
97868
|
}
|
|
97869
97869
|
}
|
|
97870
|
+
function formatDistributionExports(exports2, fromFilePath, toFilePath) {
|
|
97871
|
+
let importPath = _chunkGQ77QZBOjs.trimDtsExtension.call(
|
|
97872
|
+
void 0,
|
|
97873
|
+
_path2.default.posix.relative(
|
|
97874
|
+
_path2.default.posix.dirname(_path2.default.posix.normalize(_chunkGQ77QZBOjs.slash.call(void 0, fromFilePath))),
|
|
97875
|
+
_path2.default.posix.normalize(_chunkGQ77QZBOjs.slash.call(void 0, toFilePath))
|
|
97876
|
+
)
|
|
97877
|
+
);
|
|
97878
|
+
if (!importPath.match(/^\.+\//)) {
|
|
97879
|
+
importPath = "./" + importPath;
|
|
97880
|
+
}
|
|
97881
|
+
let seen = {
|
|
97882
|
+
named: /* @__PURE__ */ new Set(),
|
|
97883
|
+
module: /* @__PURE__ */ new Set()
|
|
97884
|
+
};
|
|
97885
|
+
const lines = exports2.filter((declaration) => {
|
|
97886
|
+
if (declaration.kind === "module") {
|
|
97887
|
+
if (seen.module.has(declaration.moduleName)) {
|
|
97888
|
+
return false;
|
|
97889
|
+
}
|
|
97890
|
+
seen.module.add(declaration.moduleName);
|
|
97891
|
+
return true;
|
|
97892
|
+
} else if (declaration.kind === "named") {
|
|
97893
|
+
if (seen.named.has(declaration.name)) {
|
|
97894
|
+
return false;
|
|
97895
|
+
}
|
|
97896
|
+
seen.named.add(declaration.name);
|
|
97897
|
+
return true;
|
|
97898
|
+
} else {
|
|
97899
|
+
return false;
|
|
97900
|
+
}
|
|
97901
|
+
}).map((declaration) => formatDistributionExport(declaration, importPath)).filter(_chunkGQ77QZBOjs.truthy);
|
|
97902
|
+
if (lines.length === 0) {
|
|
97903
|
+
lines.push("export {};");
|
|
97904
|
+
}
|
|
97905
|
+
return lines.join("\n") + "\n";
|
|
97906
|
+
}
|
|
97907
|
+
function formatDistributionExport(declaration, dest) {
|
|
97908
|
+
if (declaration.kind === "named") {
|
|
97909
|
+
return [
|
|
97910
|
+
"export",
|
|
97911
|
+
declaration.isTypeOnly ? "type" : "",
|
|
97912
|
+
"{",
|
|
97913
|
+
declaration.alias,
|
|
97914
|
+
declaration.name === declaration.alias ? "" : `as ${declaration.name}`,
|
|
97915
|
+
"} from",
|
|
97916
|
+
`'${dest}';`
|
|
97917
|
+
].filter(_chunkGQ77QZBOjs.truthy).join(" ");
|
|
97918
|
+
} else if (declaration.kind === "module") {
|
|
97919
|
+
return `export * from '${declaration.moduleName}';`;
|
|
97920
|
+
}
|
|
97921
|
+
return "";
|
|
97922
|
+
}
|
|
97870
97923
|
var logger2 = _chunk7G76EW2Rjs.createLogger.call(void 0);
|
|
97871
97924
|
function rollupDtsFile(options, inputFilePath, dtsExtension, tsconfigFilePath) {
|
|
97872
97925
|
let projectFolder = packageJsonSearch(options.outDir, options.silent, "dts", logger2);
|
|
97873
97926
|
!options.silent && logger2.info("dts", `\u26A1 Preparing to run API Extractor (DTS generate): ${projectFolder}`);
|
|
97874
|
-
const apiReferenceProjectDir = _path2.default.join(
|
|
97875
|
-
options.workspaceRoot,
|
|
97927
|
+
const apiReferenceProjectDir = `<projectFolder>/${_path2.default.join(
|
|
97876
97928
|
"docs",
|
|
97877
97929
|
"api-reports",
|
|
97878
97930
|
options.projectRoot
|
|
97879
|
-
).replaceAll("
|
|
97931
|
+
).replaceAll("\\", "/")}`;
|
|
97880
97932
|
let configObject = {
|
|
97881
|
-
mainEntryPointFilePath: inputFilePath
|
|
97933
|
+
mainEntryPointFilePath: inputFilePath,
|
|
97882
97934
|
apiReport: {
|
|
97883
97935
|
enabled: options.apiReport !== false,
|
|
97884
97936
|
reportFileName: "api-report.md",
|
|
97885
97937
|
reportFolder: apiReferenceProjectDir,
|
|
97886
|
-
reportTempFolder: _path2.default.join(
|
|
97887
|
-
options.workspaceRoot,
|
|
97938
|
+
reportTempFolder: `<projectFolder>/${_path2.default.join(
|
|
97888
97939
|
"tmp",
|
|
97889
97940
|
"api-reports"
|
|
97890
|
-
).replaceAll("
|
|
97941
|
+
).replaceAll("\\", "/")}`
|
|
97891
97942
|
},
|
|
97892
97943
|
docModel: {
|
|
97893
97944
|
enabled: options.docModel !== false,
|
|
97894
97945
|
apiJsonFilePath: _path2.default.join(
|
|
97895
97946
|
apiReferenceProjectDir,
|
|
97896
97947
|
"documents-model.api.json"
|
|
97897
|
-
).replaceAll("
|
|
97948
|
+
).replaceAll("\\", "/")
|
|
97898
97949
|
},
|
|
97899
97950
|
dtsRollup: {
|
|
97900
97951
|
enabled: true,
|
|
97901
97952
|
untrimmedFilePath: `<projectFolder>/${_path2.default.join(
|
|
97902
|
-
options.outDir
|
|
97953
|
+
options.outDir,
|
|
97903
97954
|
`index${dtsExtension}`
|
|
97904
97955
|
).replaceAll("\\", "/")}`,
|
|
97905
97956
|
betaTrimmedFilePath: `<projectFolder>/${_path2.default.join(
|
|
97906
|
-
options.outDir
|
|
97907
|
-
|
|
97957
|
+
options.outDir,
|
|
97958
|
+
`index-beta${dtsExtension}`
|
|
97908
97959
|
).replaceAll("\\", "/")}`,
|
|
97909
97960
|
publicTrimmedFilePath: `<projectFolder>/${_path2.default.join(
|
|
97910
|
-
options.outDir
|
|
97911
|
-
|
|
97961
|
+
options.outDir,
|
|
97962
|
+
`index-public${dtsExtension}`
|
|
97912
97963
|
).replaceAll("\\", "/")}`
|
|
97913
97964
|
},
|
|
97914
97965
|
tsdocMetadata: {
|
|
97915
97966
|
enabled: options.tsdocMetadata !== false,
|
|
97916
|
-
tsdocMetadataFilePath:
|
|
97967
|
+
tsdocMetadataFilePath: `<projectFolder>/${_path2.default.join(
|
|
97968
|
+
projectFolder,
|
|
97969
|
+
"tsdoc-metadata.api.json"
|
|
97970
|
+
).replaceAll("\\", "/")}`
|
|
97917
97971
|
},
|
|
97918
97972
|
compiler: {
|
|
97919
97973
|
tsconfigFilePath
|
|
97920
97974
|
},
|
|
97921
|
-
projectFolder:
|
|
97975
|
+
projectFolder: `./`
|
|
97922
97976
|
};
|
|
97923
97977
|
const prepareOptions = {
|
|
97924
97978
|
configObject,
|
|
@@ -97975,7 +98029,7 @@ var require_dist5 = __commonJS({
|
|
|
97975
98029
|
let dtsExtension = _chunkGQ77QZBOjs.defaultOutExtension.call(void 0, { format: format2, pkgType: pkg.type }).dts;
|
|
97976
98030
|
let dtsInputFilePath = _path2.default.join(
|
|
97977
98031
|
declarationDir,
|
|
97978
|
-
|
|
98032
|
+
pkgPath,
|
|
97979
98033
|
"_tsup-dts-aggregation" + dtsExtension
|
|
97980
98034
|
);
|
|
97981
98035
|
dtsInputFilePath = dtsInputFilePath.replace(/\.d\.mts$/, ".dmts.d.ts").replace(/\.d\.cts$/, ".dcts.d.ts");
|
|
@@ -97990,6 +98044,20 @@ var require_dist5 = __commonJS({
|
|
|
97990
98044
|
dtsExtension,
|
|
97991
98045
|
options.tsconfig || "tsconfig.json"
|
|
97992
98046
|
);
|
|
98047
|
+
for (let [out, sourceFileName] of Object.entries(
|
|
98048
|
+
options.experimentalDts.entry
|
|
98049
|
+
)) {
|
|
98050
|
+
sourceFileName = _chunkGQ77QZBOjs.toAbsolutePath.call(void 0, sourceFileName);
|
|
98051
|
+
const outFileName = _path2.default.join(outDir, out + dtsExtension);
|
|
98052
|
+
const currentExports = exports2.filter(
|
|
98053
|
+
(declaration) => declaration.sourceFileName === sourceFileName
|
|
98054
|
+
);
|
|
98055
|
+
_chunkGQ77QZBOjs.writeFileSync.call(
|
|
98056
|
+
void 0,
|
|
98057
|
+
outFileName,
|
|
98058
|
+
formatDistributionExports(currentExports, outFileName, outDir)
|
|
98059
|
+
);
|
|
98060
|
+
}
|
|
97993
98061
|
}
|
|
97994
98062
|
async function runDtsRollup(options, exports2) {
|
|
97995
98063
|
try {
|
|
@@ -105063,11 +105131,11 @@ ${Object.keys(options).map(
|
|
|
105063
105131
|
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
105064
105132
|
const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot;
|
|
105065
105133
|
const outputPath = applyWorkspaceTokens(
|
|
105066
|
-
options.outputPath ? options.outputPath :
|
|
105134
|
+
options.outputPath ? options.outputPath : "dist/{projectRoot}",
|
|
105067
105135
|
context
|
|
105068
105136
|
);
|
|
105069
105137
|
options.entry = applyWorkspaceTokens(
|
|
105070
|
-
options.entry ? options.entry :
|
|
105138
|
+
options.entry ? options.entry : "{sourceRoot}/index.ts",
|
|
105071
105139
|
context
|
|
105072
105140
|
);
|
|
105073
105141
|
if (options.clean !== false) {
|
|
@@ -105085,7 +105153,7 @@ ${Object.keys(options).map(
|
|
|
105085
105153
|
glob: "LICENSE",
|
|
105086
105154
|
output: "."
|
|
105087
105155
|
});
|
|
105088
|
-
if (options.includeSrc) {
|
|
105156
|
+
if (options.includeSrc !== false) {
|
|
105089
105157
|
assets.push({
|
|
105090
105158
|
input: sourceRoot,
|
|
105091
105159
|
glob: "**/{*.ts,*.tsx,*.js,*.jsx}",
|
|
@@ -105178,13 +105246,19 @@ ${externalDependencies.map((dep) => {
|
|
|
105178
105246
|
packageJson.main ??= "dist/legacy/index.cjs";
|
|
105179
105247
|
packageJson.module ??= "dist/legacy/index.js";
|
|
105180
105248
|
options.platform && options.platform !== "node" && (packageJson.browser ??= "dist/modern/index.global.js");
|
|
105181
|
-
options.includeSrc
|
|
105182
|
-
sourceRoot.replace(projectRoot, "")
|
|
105183
|
-
|
|
105184
|
-
|
|
105249
|
+
if (options.includeSrc !== false) {
|
|
105250
|
+
let distSrc = sourceRoot.replace(projectRoot, "");
|
|
105251
|
+
if (distSrc.startsWith("/")) {
|
|
105252
|
+
distSrc = distSrc.substring(1);
|
|
105253
|
+
}
|
|
105254
|
+
packageJson.source ??= `./${(0, import_path3.join)(distSrc, "index.ts").replaceAll(
|
|
105255
|
+
"\\",
|
|
105256
|
+
"/"
|
|
105257
|
+
)}`;
|
|
105258
|
+
}
|
|
105185
105259
|
packageJson.sideEffects ??= false;
|
|
105186
105260
|
packageJson.files ??= ["dist"];
|
|
105187
|
-
if (options.includeSrc && !packageJson.files.includes("src")) {
|
|
105261
|
+
if (options.includeSrc !== false && !packageJson.files.includes("src")) {
|
|
105188
105262
|
packageJson.files.push("src");
|
|
105189
105263
|
}
|
|
105190
105264
|
packageJson.publishConfig ??= {
|
|
@@ -105218,12 +105292,12 @@ ${externalDependencies.map((dep) => {
|
|
|
105218
105292
|
endOfLine: "lf"
|
|
105219
105293
|
})
|
|
105220
105294
|
);
|
|
105221
|
-
if (options.banner && options.includeSrc) {
|
|
105295
|
+
if (options.banner && options.includeSrc !== false) {
|
|
105222
105296
|
const files = globSync([
|
|
105223
|
-
(0,
|
|
105224
|
-
(0,
|
|
105225
|
-
(0,
|
|
105226
|
-
(0,
|
|
105297
|
+
(0, import_devkit.joinPathFragments)(context.root, outputPath, "src/**/*.ts"),
|
|
105298
|
+
(0, import_devkit.joinPathFragments)(context.root, outputPath, "src/**/*.tsx"),
|
|
105299
|
+
(0, import_devkit.joinPathFragments)(context.root, outputPath, "src/**/*.js"),
|
|
105300
|
+
(0, import_devkit.joinPathFragments)(context.root, outputPath, "src/**/*.jsx")
|
|
105227
105301
|
]);
|
|
105228
105302
|
await Promise.allSettled(
|
|
105229
105303
|
files.map(
|