@xylabs/ts-scripts-yarn3 4.0.0-rc.9 → 4.0.1
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/dist/actions/build.mjs.map +1 -1
- package/dist/actions/clean-docs.mjs +14 -4
- package/dist/actions/clean-docs.mjs.map +1 -1
- package/dist/actions/clean-eslint.mjs +16 -4
- package/dist/actions/clean-eslint.mjs.map +1 -1
- package/dist/actions/clean-jest.mjs.map +1 -1
- package/dist/actions/clean.mjs.map +1 -1
- package/dist/actions/compile.mjs +3 -2
- package/dist/actions/compile.mjs.map +1 -1
- package/dist/actions/copy-assets.mjs.map +1 -1
- package/dist/actions/cycle.mjs +25 -110
- package/dist/actions/cycle.mjs.map +1 -1
- package/dist/actions/dead.mjs.map +1 -1
- package/dist/actions/deploy-major.mjs.map +1 -1
- package/dist/actions/deploy-minor.mjs.map +1 -1
- package/dist/actions/deploy-next.mjs.map +1 -1
- package/dist/actions/deploy.mjs.map +1 -1
- package/dist/actions/deps.mjs.map +1 -1
- package/dist/actions/dupdeps.mjs +3 -2
- package/dist/actions/dupdeps.mjs.map +1 -1
- package/dist/actions/fix.mjs.map +1 -1
- package/dist/actions/gen-docs.mjs.map +1 -1
- package/dist/actions/gitignore-gen.mjs.map +1 -1
- package/dist/actions/index.mjs +300 -77
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/license.mjs.map +1 -1
- package/dist/actions/lint-clean.mjs.map +1 -1
- package/dist/actions/lint-profile.mjs.map +1 -1
- package/dist/actions/lint.mjs.map +1 -1
- package/dist/actions/npmignore-gen.mjs.map +1 -1
- package/dist/actions/package/clean-outputs.mjs +16 -2
- package/dist/actions/package/clean-outputs.mjs.map +1 -1
- package/dist/actions/package/clean-typescript.mjs +16 -2
- package/dist/actions/package/clean-typescript.mjs.map +1 -1
- package/dist/actions/package/clean.mjs +17 -4
- package/dist/actions/package/clean.mjs.map +1 -1
- package/dist/actions/package/compile/buildEntries.mjs.map +1 -1
- package/dist/actions/package/compile/compile.mjs +221 -16
- package/dist/actions/package/compile/compile.mjs.map +1 -1
- package/dist/actions/package/compile/copyTypeFiles.mjs.map +1 -1
- package/dist/actions/package/compile/getCompilerOptions.mjs +145 -8
- package/dist/actions/package/compile/getCompilerOptions.mjs.map +1 -1
- package/dist/actions/package/compile/index.mjs +221 -16
- package/dist/actions/package/compile/index.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsc.mjs +148 -8
- package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTscTypes.mjs +145 -8
- package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsup.mjs +235 -3
- package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
- package/dist/actions/package/copy-assets.mjs.map +1 -1
- package/dist/actions/package/deps.mjs.map +1 -1
- package/dist/actions/package/gen-docs.mjs.map +1 -1
- package/dist/actions/package/index.mjs +289 -71
- package/dist/actions/package/index.mjs.map +1 -1
- package/dist/actions/package/publint.mjs +3 -0
- package/dist/actions/package/publint.mjs.map +1 -1
- package/dist/actions/package/recompile.mjs +262 -44
- package/dist/actions/package/recompile.mjs.map +1 -1
- package/dist/actions/publint.mjs.map +1 -1
- package/dist/actions/rebuild.mjs.map +1 -1
- package/dist/actions/recompile.mjs.map +1 -1
- package/dist/actions/reinstall.mjs.map +1 -1
- package/dist/actions/relint.mjs.map +1 -1
- package/dist/actions/retest.mjs.map +1 -1
- package/dist/actions/sonar.mjs.map +1 -1
- package/dist/actions/statics.mjs +3 -2
- package/dist/actions/statics.mjs.map +1 -1
- package/dist/actions/test.mjs.map +1 -1
- package/dist/actions/up.mjs.map +1 -1
- package/dist/actions/updo.mjs.map +1 -1
- package/dist/actions/upplug.mjs.map +1 -1
- package/dist/actions/upyarn.mjs.map +1 -1
- package/dist/actions/yarn3only.mjs.map +1 -1
- package/dist/bin/package/clean-outputs.mjs +14 -2
- package/dist/bin/package/clean-outputs.mjs.map +1 -1
- package/dist/bin/package/clean-typescript.mjs +14 -2
- package/dist/bin/package/clean-typescript.mjs.map +1 -1
- package/dist/bin/package/clean.mjs +15 -4
- package/dist/bin/package/clean.mjs.map +1 -1
- package/dist/bin/package/compile-only.mjs +223 -18
- package/dist/bin/package/compile-only.mjs.map +1 -1
- package/dist/bin/package/compile-tsup.mjs +235 -5
- package/dist/bin/package/compile-tsup.mjs.map +1 -1
- package/dist/bin/package/compile.mjs +223 -18
- package/dist/bin/package/compile.mjs.map +1 -1
- package/dist/bin/package/copy-assets-cjs.mjs.map +1 -1
- package/dist/bin/package/copy-assets-esm.mjs.map +1 -1
- package/dist/bin/package/deps.mjs.map +1 -1
- package/dist/bin/package/gen-docs.mjs.map +1 -1
- package/dist/bin/package/publint.mjs +3 -0
- package/dist/bin/package/publint.mjs.map +1 -1
- package/dist/bin/package/recompile.mjs +242 -26
- package/dist/bin/package/recompile.mjs.map +1 -1
- package/dist/bin/xy-ts.mjs +52 -32
- package/dist/bin/xy-ts.mjs.map +1 -1
- package/dist/bin/xy.mjs +52 -32
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +11 -9
- package/dist/index.mjs +313 -89
- package/dist/index.mjs.map +1 -1
- package/dist/lib/createBuildConfig.mjs.map +1 -1
- package/dist/lib/defaultBuildConfig.mjs.map +1 -1
- package/dist/lib/deleteGlob.mjs +19 -0
- package/dist/lib/deleteGlob.mjs.map +1 -0
- package/dist/lib/dependencies/DuplicateDetector.mjs +3 -2
- package/dist/lib/dependencies/DuplicateDetector.mjs.map +1 -1
- package/dist/lib/dependencies/detectDuplicateDependencies.mjs +3 -2
- package/dist/lib/dependencies/detectDuplicateDependencies.mjs.map +1 -1
- package/dist/lib/dependencies/index.mjs +3 -2
- package/dist/lib/dependencies/index.mjs.map +1 -1
- package/dist/lib/file/ReadFileSyncOptions.mjs.map +1 -1
- package/dist/lib/file/fileLines.mjs.map +1 -1
- package/dist/lib/file/index.mjs.map +1 -1
- package/dist/lib/file/tryReadFileSync.mjs.map +1 -1
- package/dist/lib/generateIgnoreFiles.mjs.map +1 -1
- package/dist/lib/index.mjs +160 -5
- package/dist/lib/index.mjs.map +1 -1
- package/dist/lib/loadConfig.mjs +143 -3
- package/dist/lib/loadConfig.mjs.map +1 -1
- package/dist/lib/processEx.mjs.map +1 -1
- package/dist/lib/runSteps.mjs.map +1 -1
- package/dist/lib/runStepsAsync.mjs.map +1 -1
- package/dist/lib/runXy.mjs.map +1 -1
- package/dist/lib/safeExit.mjs.map +1 -1
- package/dist/lib/withErrnoException.mjs.map +1 -1
- package/dist/lib/yarn/index.mjs.map +1 -1
- package/dist/lib/yarn/workspace/index.mjs.map +1 -1
- package/dist/lib/yarn/workspace/yarnWorkspace.mjs.map +1 -1
- package/dist/lib/yarn/workspace/yarnWorkspaces.mjs.map +1 -1
- package/dist/loadPackageConfig.mjs.map +1 -1
- package/dist/xy/index.mjs +52 -32
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/param.mjs.map +1 -1
- package/dist/xy/xy.mjs +52 -32
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyBuildCommands.mjs +3 -2
- package/dist/xy/xyBuildCommands.mjs.map +1 -1
- package/dist/xy/xyCommonCommands.mjs +14 -4
- package/dist/xy/xyCommonCommands.mjs.map +1 -1
- package/dist/xy/xyDeployCommands.mjs.map +1 -1
- package/dist/xy/xyInstallCommands.mjs +3 -2
- package/dist/xy/xyInstallCommands.mjs.map +1 -1
- package/dist/xy/xyLintCommands.mjs +30 -22
- package/dist/xy/xyLintCommands.mjs.map +1 -1
- package/dist/xy/xyParseOptions.mjs.map +1 -1
- package/package.json +53 -55
- package/src/actions/build.ts +3 -1
- package/src/actions/clean-docs.ts +2 -3
- package/src/actions/clean-eslint.ts +3 -2
- package/src/actions/clean.ts +3 -1
- package/src/actions/compile.ts +13 -3
- package/src/actions/cycle.ts +15 -4
- package/src/actions/deps.ts +6 -5
- package/src/actions/gen-docs.ts +3 -4
- package/src/actions/package/clean-outputs.ts +3 -2
- package/src/actions/package/clean-typescript.ts +3 -2
- package/src/actions/package/compile/XyConfig.ts +5 -13
- package/src/actions/package/compile/buildEntries.ts +1 -1
- package/src/actions/package/compile/compile.ts +3 -1
- package/src/actions/package/compile/copyTypeFiles.ts +1 -1
- package/src/actions/package/compile/getCompilerOptions.ts +10 -8
- package/src/actions/package/compile/packageCompileTsc.ts +11 -6
- package/src/actions/package/compile/packageCompileTscTypes.ts +5 -3
- package/src/actions/package/compile/packageCompileTsup.ts +10 -8
- package/src/actions/package/copy-assets.ts +1 -3
- package/src/actions/package/deps.ts +6 -2
- package/src/actions/package/gen-docs.ts +3 -1
- package/src/actions/package/publint.ts +8 -5
- package/src/actions/publint.ts +3 -1
- package/src/actions/recompile.ts +47 -9
- package/src/actions/reinstall.ts +3 -1
- package/src/lib/defaultBuildConfig.ts +11 -1
- package/src/lib/deleteGlob.ts +13 -0
- package/src/lib/dependencies/DuplicateDetector.ts +4 -4
- package/src/lib/file/ReadFileSyncOptions.ts +4 -1
- package/src/lib/file/fileLines.ts +9 -3
- package/src/lib/file/tryReadFileSync.ts +4 -2
- package/src/lib/generateIgnoreFiles.ts +3 -1
- package/src/lib/index.ts +1 -0
- package/src/lib/loadConfig.ts +3 -4
- package/src/lib/runSteps.ts +2 -1
- package/src/lib/runStepsAsync.ts +1 -1
- package/src/lib/runXy.ts +4 -1
- package/src/lib/withErrnoException.ts +3 -1
- package/src/lib/yarn/workspace/yarnWorkspace.ts +1 -1
- package/src/lib/yarn/workspace/yarnWorkspaces.ts +1 -1
- package/src/loadPackageConfig.ts +1 -1
- package/src/types.d.ts +23 -0
- package/src/xy/param.ts +2 -4
- package/src/xy/xyBuildCommands.ts +10 -20
- package/src/xy/xyCommonCommands.ts +4 -2
- package/src/xy/xyDeployCommands.ts +4 -2
- package/src/xy/xyInstallCommands.ts +5 -5
- package/src/xy/xyLintCommands.ts +6 -4
- package/src/xy/xyParseOptions.ts +3 -2
- package/tsup.config.ts +2 -6
- package/xy.config.ts +1 -5
package/dist/xy/xy.mjs
CHANGED
|
@@ -20,6 +20,19 @@ var checkResult = /* @__PURE__ */ __name((name, result, level = "error", exitOnF
|
|
|
20
20
|
}
|
|
21
21
|
}, "checkResult");
|
|
22
22
|
|
|
23
|
+
// src/lib/deleteGlob.ts
|
|
24
|
+
import fs from "node:fs";
|
|
25
|
+
import { glob } from "glob";
|
|
26
|
+
var deleteGlob = /* @__PURE__ */ __name((globPath) => {
|
|
27
|
+
const files = glob.sync(globPath);
|
|
28
|
+
for (const file of files) {
|
|
29
|
+
fs.rmSync(file, {
|
|
30
|
+
recursive: true,
|
|
31
|
+
force: true
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}, "deleteGlob");
|
|
35
|
+
|
|
23
36
|
// src/lib/dependencies/detectDuplicateDependencies.ts
|
|
24
37
|
import { execSync } from "node:child_process";
|
|
25
38
|
|
|
@@ -83,7 +96,6 @@ var safeExitAsync = /* @__PURE__ */ __name(async (func, exitOnFail = true) => {
|
|
|
83
96
|
// src/lib/dependencies/DuplicateDetector.ts
|
|
84
97
|
import { EOL } from "node:os";
|
|
85
98
|
import chalk3 from "chalk";
|
|
86
|
-
import uniq from "lodash/uniq.js";
|
|
87
99
|
|
|
88
100
|
// src/lib/jsonFormatters.ts
|
|
89
101
|
var multiLineToJSONArray = /* @__PURE__ */ __name((output) => {
|
|
@@ -154,7 +166,9 @@ var DuplicateDetector = class {
|
|
|
154
166
|
acc.duplicateVersions.push(acc.currentVersion);
|
|
155
167
|
}
|
|
156
168
|
acc.duplicateVersions.push(version);
|
|
157
|
-
acc.duplicateVersions =
|
|
169
|
+
acc.duplicateVersions = [
|
|
170
|
+
...new Set(acc.duplicateVersions)
|
|
171
|
+
];
|
|
158
172
|
}
|
|
159
173
|
return acc;
|
|
160
174
|
}
|
|
@@ -295,7 +309,7 @@ var mergeEntries = /* @__PURE__ */ __name((a, b) => [
|
|
|
295
309
|
].sort(), "mergeEntries");
|
|
296
310
|
var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
|
|
297
311
|
console.log(chalk4.green(`Generate ${filename3} Files`));
|
|
298
|
-
const
|
|
312
|
+
const cwd2 = INIT_CWD() ?? ".";
|
|
299
313
|
const workspaces = pkg ? [
|
|
300
314
|
yarnWorkspace(pkg)
|
|
301
315
|
] : yarnWorkspaces();
|
|
@@ -303,7 +317,7 @@ var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
|
|
|
303
317
|
const writeEntries = /* @__PURE__ */ __name((location, entries) => writeLines(`${location}/${filename3}`, entries), "writeEntries");
|
|
304
318
|
const results = workspaces.map(({ location, name }) => {
|
|
305
319
|
try {
|
|
306
|
-
writeEntries(location, mergeEntries(readEntries(
|
|
320
|
+
writeEntries(location, mergeEntries(readEntries(cwd2), readEntries(location)));
|
|
307
321
|
return 0;
|
|
308
322
|
} catch (ex) {
|
|
309
323
|
const error = ex;
|
|
@@ -510,19 +524,16 @@ var cleanAll = /* @__PURE__ */ __name(({ verbose }) => {
|
|
|
510
524
|
// src/actions/clean-docs.ts
|
|
511
525
|
import path from "node:path";
|
|
512
526
|
import chalk8 from "chalk";
|
|
513
|
-
import { rimrafSync } from "rimraf";
|
|
514
527
|
var cleanDocs = /* @__PURE__ */ __name(() => {
|
|
515
528
|
const pkgName = process.env.npm_package_name;
|
|
516
529
|
console.log(chalk8.green(`Cleaning Docs [${pkgName}]`));
|
|
517
|
-
for (const { location } of yarnWorkspaces())
|
|
518
|
-
glob: true
|
|
519
|
-
});
|
|
530
|
+
for (const { location } of yarnWorkspaces()) deleteGlob(path.join(location, "docs"));
|
|
520
531
|
return 0;
|
|
521
532
|
}, "cleanDocs");
|
|
522
533
|
|
|
523
534
|
// src/actions/compile.ts
|
|
524
535
|
import chalk9 from "chalk";
|
|
525
|
-
var compile = /* @__PURE__ */ __name(({ verbose, target, pkg, incremental, publint: publint2 }) => {
|
|
536
|
+
var compile = /* @__PURE__ */ __name(({ verbose, target, pkg, incremental, publint: publint2, jobs }) => {
|
|
526
537
|
return pkg ? compilePackage({
|
|
527
538
|
pkg,
|
|
528
539
|
publint: publint2,
|
|
@@ -532,7 +543,8 @@ var compile = /* @__PURE__ */ __name(({ verbose, target, pkg, incremental, publi
|
|
|
532
543
|
incremental,
|
|
533
544
|
publint: publint2,
|
|
534
545
|
target,
|
|
535
|
-
verbose
|
|
546
|
+
verbose,
|
|
547
|
+
jobs
|
|
536
548
|
});
|
|
537
549
|
}, "compile");
|
|
538
550
|
var compilePackage = /* @__PURE__ */ __name(({ target, pkg }) => {
|
|
@@ -660,25 +672,33 @@ var copyAssets = /* @__PURE__ */ __name(async ({ target, pkg }) => {
|
|
|
660
672
|
}, "copyAssets");
|
|
661
673
|
|
|
662
674
|
// src/actions/cycle.ts
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
675
|
+
import { cwd } from "node:process";
|
|
676
|
+
import { ESLint } from "eslint";
|
|
677
|
+
var cycle = /* @__PURE__ */ __name(async () => {
|
|
678
|
+
const eslint = new ESLint({
|
|
679
|
+
fix: false,
|
|
680
|
+
overrideConfig: {
|
|
681
|
+
rules: {
|
|
682
|
+
"import-x/no-cycle": [
|
|
683
|
+
"error",
|
|
684
|
+
{
|
|
685
|
+
maxDepth: 10
|
|
686
|
+
}
|
|
687
|
+
]
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
});
|
|
691
|
+
const results = await eslint.lintFiles([
|
|
692
|
+
"src/**/*.ts*",
|
|
693
|
+
"packages/**/src/**/*.ts*"
|
|
681
694
|
]);
|
|
695
|
+
const formatter = await eslint.loadFormatter("stylish");
|
|
696
|
+
const resultText = formatter.format(results, {
|
|
697
|
+
cwd: cwd(),
|
|
698
|
+
rulesMeta: {}
|
|
699
|
+
});
|
|
700
|
+
console.log(resultText);
|
|
701
|
+
return results.length;
|
|
682
702
|
}, "cycle");
|
|
683
703
|
|
|
684
704
|
// src/actions/dead.ts
|
|
@@ -1091,7 +1111,7 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
|
1091
1111
|
|
|
1092
1112
|
// src/actions/lint.ts
|
|
1093
1113
|
import chalk16 from "chalk";
|
|
1094
|
-
import { ESLint } from "eslint";
|
|
1114
|
+
import { ESLint as ESLint2 } from "eslint";
|
|
1095
1115
|
var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
|
|
1096
1116
|
const colors = [
|
|
1097
1117
|
"white",
|
|
@@ -1118,7 +1138,7 @@ var lintPackage = /* @__PURE__ */ __name(async ({ pkg }) => {
|
|
|
1118
1138
|
console.error(chalk16.red(`Unable to locate package [${chalk16.magenta(pkg)}]`));
|
|
1119
1139
|
process.exit(1);
|
|
1120
1140
|
}
|
|
1121
|
-
const engine = new
|
|
1141
|
+
const engine = new ESLint2({
|
|
1122
1142
|
cache: true
|
|
1123
1143
|
});
|
|
1124
1144
|
const lintResults = await engine.lintFiles(workspace.location);
|
|
@@ -1768,10 +1788,10 @@ import chalk19 from "chalk";
|
|
|
1768
1788
|
var xyLintCommands = /* @__PURE__ */ __name((args) => {
|
|
1769
1789
|
return args.command("cycle [package]", "Cycle - Check for dependency cycles", (yargs2) => {
|
|
1770
1790
|
return packagePositionalParam(yargs2);
|
|
1771
|
-
}, (argv) => {
|
|
1791
|
+
}, async (argv) => {
|
|
1772
1792
|
const start = Date.now();
|
|
1773
1793
|
if (argv.verbose) console.log("Cycle");
|
|
1774
|
-
process.exitCode = cycle();
|
|
1794
|
+
process.exitCode = await cycle();
|
|
1775
1795
|
console.log(chalk19.blue(`Finished in ${Date.now() - start}ms`));
|
|
1776
1796
|
}).command("lint [package]", "Lint - Run Eslint", (yargs2) => {
|
|
1777
1797
|
return packagePositionalParam(yargs2);
|