@storm-software/workspace-tools 1.22.2 → 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 +7 -0
- package/index.js +54 -46
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/executors/tsup/executor.js +53 -45
- package/src/executors/tsup/get-config.js +27 -30
- package/src/executors/tsup/schema.d.ts +2 -0
- package/src/executors/tsup/schema.json +11 -1
- package/src/executors/tsup-neutral/executor.js +54 -46
- package/src/executors/tsup-node/executor.js +54 -46
- package/src/utils/index.js +1 -1
|
@@ -109110,7 +109110,7 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
109110
109110
|
// packages/workspace-tools/src/utils/get-file-banner.ts
|
|
109111
109111
|
var getFileBanner = (name, commentStart = "//") => {
|
|
109112
109112
|
let padding = "";
|
|
109113
|
-
while (name.length + padding.length <
|
|
109113
|
+
while (name.length + padding.length < 12) {
|
|
109114
109114
|
padding += " ";
|
|
109115
109115
|
}
|
|
109116
109116
|
return `
|
|
@@ -115388,6 +115388,8 @@ function modernConfig({
|
|
|
115388
115388
|
projectRoot,
|
|
115389
115389
|
workspaceRoot,
|
|
115390
115390
|
tsconfig = "tsconfig.json",
|
|
115391
|
+
splitting,
|
|
115392
|
+
treeshake,
|
|
115391
115393
|
debug = false,
|
|
115392
115394
|
external,
|
|
115393
115395
|
banner = {},
|
|
@@ -115416,6 +115418,10 @@ function modernConfig({
|
|
|
115416
115418
|
"esnext"
|
|
115417
115419
|
] : ["esnext", "node18"],
|
|
115418
115420
|
tsconfig,
|
|
115421
|
+
splitting,
|
|
115422
|
+
treeshake: treeshake ? {
|
|
115423
|
+
preset: "recommended"
|
|
115424
|
+
} : false,
|
|
115419
115425
|
projectRoot,
|
|
115420
115426
|
workspaceRoot,
|
|
115421
115427
|
outDir: outputPath,
|
|
@@ -115461,6 +115467,8 @@ function legacyConfig({
|
|
|
115461
115467
|
projectRoot,
|
|
115462
115468
|
workspaceRoot,
|
|
115463
115469
|
tsconfig = "tsconfig.json",
|
|
115470
|
+
splitting,
|
|
115471
|
+
treeshake,
|
|
115464
115472
|
debug = false,
|
|
115465
115473
|
external,
|
|
115466
115474
|
banner = {},
|
|
@@ -115478,6 +115486,10 @@ function legacyConfig({
|
|
|
115478
115486
|
format: platform !== "node" ? ["cjs", "esm", "iife"] : ["cjs", "esm"],
|
|
115479
115487
|
target: ["es2022", "node18"],
|
|
115480
115488
|
tsconfig,
|
|
115489
|
+
splitting,
|
|
115490
|
+
treeshake: treeshake ? {
|
|
115491
|
+
preset: "recommended"
|
|
115492
|
+
} : false,
|
|
115481
115493
|
projectRoot,
|
|
115482
115494
|
workspaceRoot,
|
|
115483
115495
|
outDir: outputPath,
|
|
@@ -115523,6 +115535,8 @@ function workerConfig({
|
|
|
115523
115535
|
projectRoot,
|
|
115524
115536
|
workspaceRoot,
|
|
115525
115537
|
tsconfig = "tsconfig.json",
|
|
115538
|
+
splitting,
|
|
115539
|
+
treeshake,
|
|
115526
115540
|
debug = false,
|
|
115527
115541
|
external,
|
|
115528
115542
|
banner = {},
|
|
@@ -115535,6 +115549,7 @@ function workerConfig({
|
|
|
115535
115549
|
plugins,
|
|
115536
115550
|
dtsTsConfig
|
|
115537
115551
|
}) {
|
|
115552
|
+
let outputPath = (0, import_path3.join)(outDir, "dist");
|
|
115538
115553
|
return {
|
|
115539
115554
|
name: "worker",
|
|
115540
115555
|
entry,
|
|
@@ -115542,9 +115557,13 @@ function workerConfig({
|
|
|
115542
115557
|
target: ["chrome95"],
|
|
115543
115558
|
bundle: true,
|
|
115544
115559
|
tsconfig,
|
|
115560
|
+
splitting,
|
|
115561
|
+
treeshake: treeshake ? {
|
|
115562
|
+
preset: "recommended"
|
|
115563
|
+
} : false,
|
|
115545
115564
|
projectRoot,
|
|
115546
115565
|
workspaceRoot,
|
|
115547
|
-
outDir:
|
|
115566
|
+
outDir: outputPath,
|
|
115548
115567
|
silent: !verbose,
|
|
115549
115568
|
metafile: true,
|
|
115550
115569
|
shims: false,
|
|
@@ -115560,7 +115579,7 @@ function workerConfig({
|
|
|
115560
115579
|
...dtsTsConfig,
|
|
115561
115580
|
options: {
|
|
115562
115581
|
...dtsTsConfig.options,
|
|
115563
|
-
outDir:
|
|
115582
|
+
outDir: outputPath
|
|
115564
115583
|
}
|
|
115565
115584
|
}
|
|
115566
115585
|
},
|
|
@@ -115584,20 +115603,8 @@ function workerConfig({
|
|
|
115584
115603
|
function getConfig(workspaceRoot, projectRoot, sourceRoot, {
|
|
115585
115604
|
outputPath,
|
|
115586
115605
|
tsConfig,
|
|
115587
|
-
debug,
|
|
115588
|
-
banner,
|
|
115589
|
-
platform,
|
|
115590
|
-
external,
|
|
115591
|
-
options,
|
|
115592
115606
|
additionalEntryPoints,
|
|
115593
|
-
|
|
115594
|
-
docModel,
|
|
115595
|
-
tsdocMetadata,
|
|
115596
|
-
define: define2,
|
|
115597
|
-
env,
|
|
115598
|
-
verbose,
|
|
115599
|
-
dtsTsConfig,
|
|
115600
|
-
plugins,
|
|
115607
|
+
platform,
|
|
115601
115608
|
...rest
|
|
115602
115609
|
}) {
|
|
115603
115610
|
const entry = globSync(
|
|
@@ -115621,24 +115628,14 @@ function getConfig(workspaceRoot, projectRoot, sourceRoot, {
|
|
|
115621
115628
|
return ret;
|
|
115622
115629
|
}, {});
|
|
115623
115630
|
const params = {
|
|
115631
|
+
...rest,
|
|
115624
115632
|
entry,
|
|
115625
115633
|
outDir: outputPath,
|
|
115626
|
-
projectRoot,
|
|
115627
|
-
workspaceRoot,
|
|
115628
115634
|
tsconfig: tsConfig,
|
|
115629
|
-
|
|
115630
|
-
|
|
115631
|
-
|
|
115632
|
-
|
|
115633
|
-
verbose,
|
|
115634
|
-
apiReport,
|
|
115635
|
-
docModel,
|
|
115636
|
-
tsdocMetadata,
|
|
115637
|
-
define: define2,
|
|
115638
|
-
env,
|
|
115639
|
-
options,
|
|
115640
|
-
plugins,
|
|
115641
|
-
dtsTsConfig
|
|
115635
|
+
workspaceRoot,
|
|
115636
|
+
projectRoot,
|
|
115637
|
+
sourceRoot,
|
|
115638
|
+
platform
|
|
115642
115639
|
};
|
|
115643
115640
|
if (platform === "worker") {
|
|
115644
115641
|
return (0, import_tsup.defineConfig)(workerConfig(params));
|
|
@@ -115842,22 +115839,25 @@ ${externalDependencies.map((dep) => {
|
|
|
115842
115839
|
"package.json"
|
|
115843
115840
|
);
|
|
115844
115841
|
console.log(`\u26A1 Writing package.json file to: ${packageJsonPath}`);
|
|
115842
|
+
const prettierOptions = {
|
|
115843
|
+
plugins: ["prettier-plugin-packagejson"],
|
|
115844
|
+
trailingComma: "none",
|
|
115845
|
+
tabWidth: 2,
|
|
115846
|
+
semi: true,
|
|
115847
|
+
singleQuote: false,
|
|
115848
|
+
quoteProps: "preserve",
|
|
115849
|
+
insertPragma: false,
|
|
115850
|
+
bracketSameLine: true,
|
|
115851
|
+
printWidth: 80,
|
|
115852
|
+
bracketSpacing: true,
|
|
115853
|
+
arrowParens: "avoid",
|
|
115854
|
+
endOfLine: "lf"
|
|
115855
|
+
};
|
|
115845
115856
|
(0, import_fs3.writeFileSync)(
|
|
115846
115857
|
packageJsonPath,
|
|
115847
115858
|
await (0, import_prettier.format)(JSON.stringify(packageJson), {
|
|
115848
|
-
|
|
115849
|
-
parser: "json"
|
|
115850
|
-
trailingComma: "none",
|
|
115851
|
-
tabWidth: 2,
|
|
115852
|
-
semi: true,
|
|
115853
|
-
singleQuote: false,
|
|
115854
|
-
quoteProps: "preserve",
|
|
115855
|
-
insertPragma: false,
|
|
115856
|
-
bracketSameLine: true,
|
|
115857
|
-
printWidth: 80,
|
|
115858
|
-
bracketSpacing: true,
|
|
115859
|
-
arrowParens: "avoid",
|
|
115860
|
-
endOfLine: "lf"
|
|
115859
|
+
...prettierOptions,
|
|
115860
|
+
parser: "json"
|
|
115861
115861
|
})
|
|
115862
115862
|
);
|
|
115863
115863
|
if (options.includeSrc !== false) {
|
|
@@ -115869,11 +115869,17 @@ ${externalDependencies.map((dep) => {
|
|
|
115869
115869
|
]);
|
|
115870
115870
|
await Promise.allSettled(
|
|
115871
115871
|
files.map(
|
|
115872
|
-
(file) => (0, import_promises2.writeFile)(
|
|
115872
|
+
async (file) => (0, import_promises2.writeFile)(
|
|
115873
115873
|
file,
|
|
115874
|
-
|
|
115874
|
+
await (0, import_prettier.format)(
|
|
115875
|
+
`${options.banner ? options.banner.startsWith("//") ? options.banner : `// ${options.banner}` : ""}
|
|
115875
115876
|
|
|
115876
115877
|
${(0, import_fs3.readFileSync)(file, "utf-8")}`,
|
|
115878
|
+
{
|
|
115879
|
+
...prettierOptions,
|
|
115880
|
+
parser: "typescript"
|
|
115881
|
+
}
|
|
115882
|
+
),
|
|
115877
115883
|
"utf-8"
|
|
115878
115884
|
)
|
|
115879
115885
|
)
|
|
@@ -115995,6 +116001,8 @@ var applyDefaultOptions = (options) => {
|
|
|
115995
116001
|
options.entry ??= "{sourceRoot}/index.ts";
|
|
115996
116002
|
options.outputPath ??= "dist/{projectRoot}";
|
|
115997
116003
|
options.tsConfig ??= "tsconfig.json";
|
|
116004
|
+
options.splitting ??= true;
|
|
116005
|
+
options.treeshake ??= true;
|
|
115998
116006
|
options.platform ??= "neutral";
|
|
115999
116007
|
options.verbose ??= false;
|
|
116000
116008
|
options.external ??= [];
|
package/src/utils/index.js
CHANGED
|
@@ -228,7 +228,7 @@ function findCacheDirectory({
|
|
|
228
228
|
// packages/workspace-tools/src/utils/get-file-banner.ts
|
|
229
229
|
var getFileBanner = (name, commentStart = "//") => {
|
|
230
230
|
let padding = "";
|
|
231
|
-
while (name.length + padding.length <
|
|
231
|
+
while (name.length + padding.length < 12) {
|
|
232
232
|
padding += " ";
|
|
233
233
|
}
|
|
234
234
|
return `
|