@storm-software/workspace-tools 1.22.1 → 1.23.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 +14 -0
- package/index.js +55 -47
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/executors/tsup/executor.js +54 -46
- package/src/executors/tsup/get-config.js +27 -30
- package/src/executors/tsup/schema.d.ts +2 -0
- package/src/executors/tsup/schema.json +10 -0
- package/src/executors/tsup-neutral/executor.js +55 -47
- package/src/executors/tsup-node/executor.js +55 -47
- package/src/utils/index.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.22.2](https://github.com/storm-software/storm-ops/compare/workspace-tools-v1.22.1...workspace-tools-v1.22.2) (2023-12-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **workspace-tools:** Update `includeSrc` default to `false` in tsup build executors ([ec6ac7c](https://github.com/storm-software/storm-ops/commit/ec6ac7cd84f3a4eb638d938bafb9cf495342bbb0))
|
|
7
|
+
|
|
8
|
+
## [1.22.1](https://github.com/storm-software/storm-ops/compare/workspace-tools-v1.22.0...workspace-tools-v1.22.1) (2023-12-06)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **workspace-tools:** Resolved issue with bad options passed into base TS library generator ([aeff286](https://github.com/storm-software/storm-ops/commit/aeff286fba411b47c205f3d13cefb425b2c1a977))
|
|
14
|
+
|
|
1
15
|
# [1.22.0](https://github.com/storm-software/storm-ops/compare/workspace-tools-v1.21.19...workspace-tools-v1.22.0) (2023-12-06)
|
|
2
16
|
|
|
3
17
|
|
package/index.js
CHANGED
|
@@ -109266,7 +109266,7 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
109266
109266
|
// packages/workspace-tools/src/utils/get-file-banner.ts
|
|
109267
109267
|
var getFileBanner = (name, commentStart = "//") => {
|
|
109268
109268
|
let padding = "";
|
|
109269
|
-
while (name.length + padding.length <
|
|
109269
|
+
while (name.length + padding.length < 12) {
|
|
109270
109270
|
padding += " ";
|
|
109271
109271
|
}
|
|
109272
109272
|
return `
|
|
@@ -115550,6 +115550,8 @@ function modernConfig({
|
|
|
115550
115550
|
projectRoot,
|
|
115551
115551
|
workspaceRoot,
|
|
115552
115552
|
tsconfig = "tsconfig.json",
|
|
115553
|
+
splitting,
|
|
115554
|
+
treeshake,
|
|
115553
115555
|
debug = false,
|
|
115554
115556
|
external,
|
|
115555
115557
|
banner = {},
|
|
@@ -115578,6 +115580,10 @@ function modernConfig({
|
|
|
115578
115580
|
"esnext"
|
|
115579
115581
|
] : ["esnext", "node18"],
|
|
115580
115582
|
tsconfig,
|
|
115583
|
+
splitting,
|
|
115584
|
+
treeshake: treeshake ? {
|
|
115585
|
+
preset: "recommended"
|
|
115586
|
+
} : false,
|
|
115581
115587
|
projectRoot,
|
|
115582
115588
|
workspaceRoot,
|
|
115583
115589
|
outDir: outputPath,
|
|
@@ -115623,6 +115629,8 @@ function legacyConfig({
|
|
|
115623
115629
|
projectRoot,
|
|
115624
115630
|
workspaceRoot,
|
|
115625
115631
|
tsconfig = "tsconfig.json",
|
|
115632
|
+
splitting,
|
|
115633
|
+
treeshake,
|
|
115626
115634
|
debug = false,
|
|
115627
115635
|
external,
|
|
115628
115636
|
banner = {},
|
|
@@ -115640,6 +115648,10 @@ function legacyConfig({
|
|
|
115640
115648
|
format: platform !== "node" ? ["cjs", "esm", "iife"] : ["cjs", "esm"],
|
|
115641
115649
|
target: ["es2022", "node18"],
|
|
115642
115650
|
tsconfig,
|
|
115651
|
+
splitting,
|
|
115652
|
+
treeshake: treeshake ? {
|
|
115653
|
+
preset: "recommended"
|
|
115654
|
+
} : false,
|
|
115643
115655
|
projectRoot,
|
|
115644
115656
|
workspaceRoot,
|
|
115645
115657
|
outDir: outputPath,
|
|
@@ -115685,6 +115697,8 @@ function workerConfig({
|
|
|
115685
115697
|
projectRoot,
|
|
115686
115698
|
workspaceRoot,
|
|
115687
115699
|
tsconfig = "tsconfig.json",
|
|
115700
|
+
splitting,
|
|
115701
|
+
treeshake,
|
|
115688
115702
|
debug = false,
|
|
115689
115703
|
external,
|
|
115690
115704
|
banner = {},
|
|
@@ -115697,6 +115711,7 @@ function workerConfig({
|
|
|
115697
115711
|
plugins,
|
|
115698
115712
|
dtsTsConfig
|
|
115699
115713
|
}) {
|
|
115714
|
+
let outputPath = (0, import_path3.join)(outDir, "dist");
|
|
115700
115715
|
return {
|
|
115701
115716
|
name: "worker",
|
|
115702
115717
|
entry,
|
|
@@ -115704,9 +115719,13 @@ function workerConfig({
|
|
|
115704
115719
|
target: ["chrome95"],
|
|
115705
115720
|
bundle: true,
|
|
115706
115721
|
tsconfig,
|
|
115722
|
+
splitting,
|
|
115723
|
+
treeshake: treeshake ? {
|
|
115724
|
+
preset: "recommended"
|
|
115725
|
+
} : false,
|
|
115707
115726
|
projectRoot,
|
|
115708
115727
|
workspaceRoot,
|
|
115709
|
-
outDir:
|
|
115728
|
+
outDir: outputPath,
|
|
115710
115729
|
silent: !verbose,
|
|
115711
115730
|
metafile: true,
|
|
115712
115731
|
shims: false,
|
|
@@ -115722,7 +115741,7 @@ function workerConfig({
|
|
|
115722
115741
|
...dtsTsConfig,
|
|
115723
115742
|
options: {
|
|
115724
115743
|
...dtsTsConfig.options,
|
|
115725
|
-
outDir:
|
|
115744
|
+
outDir: outputPath
|
|
115726
115745
|
}
|
|
115727
115746
|
}
|
|
115728
115747
|
},
|
|
@@ -115746,20 +115765,8 @@ function workerConfig({
|
|
|
115746
115765
|
function getConfig(workspaceRoot, projectRoot, sourceRoot, {
|
|
115747
115766
|
outputPath,
|
|
115748
115767
|
tsConfig,
|
|
115749
|
-
debug,
|
|
115750
|
-
banner,
|
|
115751
|
-
platform,
|
|
115752
|
-
external,
|
|
115753
|
-
options,
|
|
115754
115768
|
additionalEntryPoints,
|
|
115755
|
-
|
|
115756
|
-
docModel,
|
|
115757
|
-
tsdocMetadata,
|
|
115758
|
-
define: define2,
|
|
115759
|
-
env: env2,
|
|
115760
|
-
verbose,
|
|
115761
|
-
dtsTsConfig,
|
|
115762
|
-
plugins,
|
|
115769
|
+
platform,
|
|
115763
115770
|
...rest
|
|
115764
115771
|
}) {
|
|
115765
115772
|
const entry = globSync(
|
|
@@ -115783,24 +115790,14 @@ function getConfig(workspaceRoot, projectRoot, sourceRoot, {
|
|
|
115783
115790
|
return ret;
|
|
115784
115791
|
}, {});
|
|
115785
115792
|
const params = {
|
|
115793
|
+
...rest,
|
|
115786
115794
|
entry,
|
|
115787
115795
|
outDir: outputPath,
|
|
115788
|
-
projectRoot,
|
|
115789
|
-
workspaceRoot,
|
|
115790
115796
|
tsconfig: tsConfig,
|
|
115791
|
-
|
|
115792
|
-
|
|
115793
|
-
|
|
115794
|
-
|
|
115795
|
-
verbose,
|
|
115796
|
-
apiReport,
|
|
115797
|
-
docModel,
|
|
115798
|
-
tsdocMetadata,
|
|
115799
|
-
define: define2,
|
|
115800
|
-
env: env2,
|
|
115801
|
-
options,
|
|
115802
|
-
plugins,
|
|
115803
|
-
dtsTsConfig
|
|
115797
|
+
workspaceRoot,
|
|
115798
|
+
projectRoot,
|
|
115799
|
+
sourceRoot,
|
|
115800
|
+
platform
|
|
115804
115801
|
};
|
|
115805
115802
|
if (platform === "worker") {
|
|
115806
115803
|
return (0, import_tsup.defineConfig)(workerConfig(params));
|
|
@@ -116004,22 +116001,25 @@ ${externalDependencies.map((dep) => {
|
|
|
116004
116001
|
"package.json"
|
|
116005
116002
|
);
|
|
116006
116003
|
console.log(`\u26A1 Writing package.json file to: ${packageJsonPath}`);
|
|
116004
|
+
const prettierOptions = {
|
|
116005
|
+
plugins: ["prettier-plugin-packagejson"],
|
|
116006
|
+
trailingComma: "none",
|
|
116007
|
+
tabWidth: 2,
|
|
116008
|
+
semi: true,
|
|
116009
|
+
singleQuote: false,
|
|
116010
|
+
quoteProps: "preserve",
|
|
116011
|
+
insertPragma: false,
|
|
116012
|
+
bracketSameLine: true,
|
|
116013
|
+
printWidth: 80,
|
|
116014
|
+
bracketSpacing: true,
|
|
116015
|
+
arrowParens: "avoid",
|
|
116016
|
+
endOfLine: "lf"
|
|
116017
|
+
};
|
|
116007
116018
|
(0, import_fs3.writeFileSync)(
|
|
116008
116019
|
packageJsonPath,
|
|
116009
116020
|
await (0, import_prettier.format)(JSON.stringify(packageJson), {
|
|
116010
|
-
|
|
116011
|
-
parser: "json"
|
|
116012
|
-
trailingComma: "none",
|
|
116013
|
-
tabWidth: 2,
|
|
116014
|
-
semi: true,
|
|
116015
|
-
singleQuote: false,
|
|
116016
|
-
quoteProps: "preserve",
|
|
116017
|
-
insertPragma: false,
|
|
116018
|
-
bracketSameLine: true,
|
|
116019
|
-
printWidth: 80,
|
|
116020
|
-
bracketSpacing: true,
|
|
116021
|
-
arrowParens: "avoid",
|
|
116022
|
-
endOfLine: "lf"
|
|
116021
|
+
...prettierOptions,
|
|
116022
|
+
parser: "json"
|
|
116023
116023
|
})
|
|
116024
116024
|
);
|
|
116025
116025
|
if (options.includeSrc !== false) {
|
|
@@ -116031,11 +116031,17 @@ ${externalDependencies.map((dep) => {
|
|
|
116031
116031
|
]);
|
|
116032
116032
|
await Promise.allSettled(
|
|
116033
116033
|
files.map(
|
|
116034
|
-
(file) => (0, import_promises2.writeFile)(
|
|
116034
|
+
async (file) => (0, import_promises2.writeFile)(
|
|
116035
116035
|
file,
|
|
116036
|
-
|
|
116036
|
+
await (0, import_prettier.format)(
|
|
116037
|
+
`${options.banner ? options.banner.startsWith("//") ? options.banner : `// ${options.banner}` : ""}
|
|
116037
116038
|
|
|
116038
116039
|
${(0, import_fs3.readFileSync)(file, "utf-8")}`,
|
|
116040
|
+
{
|
|
116041
|
+
...prettierOptions,
|
|
116042
|
+
parser: "typescript"
|
|
116043
|
+
}
|
|
116044
|
+
),
|
|
116039
116045
|
"utf-8"
|
|
116040
116046
|
)
|
|
116041
116047
|
)
|
|
@@ -116157,13 +116163,15 @@ var applyDefaultOptions = (options) => {
|
|
|
116157
116163
|
options.entry ??= "{sourceRoot}/index.ts";
|
|
116158
116164
|
options.outputPath ??= "dist/{projectRoot}";
|
|
116159
116165
|
options.tsConfig ??= "tsconfig.json";
|
|
116166
|
+
options.splitting ??= true;
|
|
116167
|
+
options.treeshake ??= true;
|
|
116160
116168
|
options.platform ??= "neutral";
|
|
116161
116169
|
options.verbose ??= false;
|
|
116162
116170
|
options.external ??= [];
|
|
116163
116171
|
options.additionalEntryPoints ??= [];
|
|
116164
116172
|
options.assets ??= [];
|
|
116165
116173
|
options.plugins ??= [];
|
|
116166
|
-
options.includeSrc ??=
|
|
116174
|
+
options.includeSrc ??= false;
|
|
116167
116175
|
options.clean ??= true;
|
|
116168
116176
|
options.bundle ??= true;
|
|
116169
116177
|
options.debug ??= false;
|