@xylabs/ts-scripts-yarn3 4.0.0-rc.9 → 4.0.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/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 +213 -55
- 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 +151 -11
- 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 +151 -11
- 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 +3 -0
- 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 +205 -52
- 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 +192 -39
- 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 +151 -11
- package/dist/bin/package/compile-only.mjs.map +1 -1
- package/dist/bin/package/compile-tsup.mjs +3 -0
- package/dist/bin/package/compile-tsup.mjs.map +1 -1
- package/dist/bin/package/compile.mjs +151 -11
- 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 +170 -19
- 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 +216 -57
- 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 +6 -3
- 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/bin/xy.mjs
CHANGED
|
@@ -21,6 +21,19 @@ var checkResult = /* @__PURE__ */ __name((name, result, level = "error", exitOnF
|
|
|
21
21
|
}
|
|
22
22
|
}, "checkResult");
|
|
23
23
|
|
|
24
|
+
// src/lib/deleteGlob.ts
|
|
25
|
+
import fs from "node:fs";
|
|
26
|
+
import { glob } from "glob";
|
|
27
|
+
var deleteGlob = /* @__PURE__ */ __name((globPath) => {
|
|
28
|
+
const files = glob.sync(globPath);
|
|
29
|
+
for (const file of files) {
|
|
30
|
+
fs.rmSync(file, {
|
|
31
|
+
recursive: true,
|
|
32
|
+
force: true
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}, "deleteGlob");
|
|
36
|
+
|
|
24
37
|
// src/lib/dependencies/detectDuplicateDependencies.ts
|
|
25
38
|
import { execSync } from "node:child_process";
|
|
26
39
|
|
|
@@ -84,7 +97,6 @@ var safeExitAsync = /* @__PURE__ */ __name(async (func, exitOnFail = true) => {
|
|
|
84
97
|
// src/lib/dependencies/DuplicateDetector.ts
|
|
85
98
|
import { EOL } from "node:os";
|
|
86
99
|
import chalk3 from "chalk";
|
|
87
|
-
import uniq from "lodash/uniq.js";
|
|
88
100
|
|
|
89
101
|
// src/lib/jsonFormatters.ts
|
|
90
102
|
var multiLineToJSONArray = /* @__PURE__ */ __name((output) => {
|
|
@@ -155,7 +167,9 @@ var DuplicateDetector = class {
|
|
|
155
167
|
acc.duplicateVersions.push(acc.currentVersion);
|
|
156
168
|
}
|
|
157
169
|
acc.duplicateVersions.push(version);
|
|
158
|
-
acc.duplicateVersions =
|
|
170
|
+
acc.duplicateVersions = [
|
|
171
|
+
...new Set(acc.duplicateVersions)
|
|
172
|
+
];
|
|
159
173
|
}
|
|
160
174
|
return acc;
|
|
161
175
|
}
|
|
@@ -296,7 +310,7 @@ var mergeEntries = /* @__PURE__ */ __name((a, b) => [
|
|
|
296
310
|
].sort(), "mergeEntries");
|
|
297
311
|
var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
|
|
298
312
|
console.log(chalk4.green(`Generate ${filename3} Files`));
|
|
299
|
-
const
|
|
313
|
+
const cwd2 = INIT_CWD() ?? ".";
|
|
300
314
|
const workspaces = pkg ? [
|
|
301
315
|
yarnWorkspace(pkg)
|
|
302
316
|
] : yarnWorkspaces();
|
|
@@ -304,7 +318,7 @@ var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
|
|
|
304
318
|
const writeEntries = /* @__PURE__ */ __name((location, entries) => writeLines(`${location}/${filename3}`, entries), "writeEntries");
|
|
305
319
|
const results = workspaces.map(({ location, name }) => {
|
|
306
320
|
try {
|
|
307
|
-
writeEntries(location, mergeEntries(readEntries(
|
|
321
|
+
writeEntries(location, mergeEntries(readEntries(cwd2), readEntries(location)));
|
|
308
322
|
return 0;
|
|
309
323
|
} catch (ex) {
|
|
310
324
|
const error = ex;
|
|
@@ -511,19 +525,16 @@ var cleanAll = /* @__PURE__ */ __name(({ verbose }) => {
|
|
|
511
525
|
// src/actions/clean-docs.ts
|
|
512
526
|
import path from "node:path";
|
|
513
527
|
import chalk8 from "chalk";
|
|
514
|
-
import { rimrafSync } from "rimraf";
|
|
515
528
|
var cleanDocs = /* @__PURE__ */ __name(() => {
|
|
516
529
|
const pkgName = process.env.npm_package_name;
|
|
517
530
|
console.log(chalk8.green(`Cleaning Docs [${pkgName}]`));
|
|
518
|
-
for (const { location } of yarnWorkspaces())
|
|
519
|
-
glob: true
|
|
520
|
-
});
|
|
531
|
+
for (const { location } of yarnWorkspaces()) deleteGlob(path.join(location, "docs"));
|
|
521
532
|
return 0;
|
|
522
533
|
}, "cleanDocs");
|
|
523
534
|
|
|
524
535
|
// src/actions/compile.ts
|
|
525
536
|
import chalk9 from "chalk";
|
|
526
|
-
var compile = /* @__PURE__ */ __name(({ verbose, target, pkg, incremental, publint: publint2 }) => {
|
|
537
|
+
var compile = /* @__PURE__ */ __name(({ verbose, target, pkg, incremental, publint: publint2, jobs }) => {
|
|
527
538
|
return pkg ? compilePackage({
|
|
528
539
|
pkg,
|
|
529
540
|
publint: publint2,
|
|
@@ -533,7 +544,8 @@ var compile = /* @__PURE__ */ __name(({ verbose, target, pkg, incremental, publi
|
|
|
533
544
|
incremental,
|
|
534
545
|
publint: publint2,
|
|
535
546
|
target,
|
|
536
|
-
verbose
|
|
547
|
+
verbose,
|
|
548
|
+
jobs
|
|
537
549
|
});
|
|
538
550
|
}, "compile");
|
|
539
551
|
var compilePackage = /* @__PURE__ */ __name(({ target, pkg }) => {
|
|
@@ -661,25 +673,33 @@ var copyAssets = /* @__PURE__ */ __name(async ({ target, pkg }) => {
|
|
|
661
673
|
}, "copyAssets");
|
|
662
674
|
|
|
663
675
|
// src/actions/cycle.ts
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
676
|
+
import { cwd } from "node:process";
|
|
677
|
+
import { ESLint } from "eslint";
|
|
678
|
+
var cycle = /* @__PURE__ */ __name(async () => {
|
|
679
|
+
const eslint = new ESLint({
|
|
680
|
+
fix: false,
|
|
681
|
+
overrideConfig: {
|
|
682
|
+
rules: {
|
|
683
|
+
"import-x/no-cycle": [
|
|
684
|
+
"error",
|
|
685
|
+
{
|
|
686
|
+
maxDepth: 10
|
|
687
|
+
}
|
|
688
|
+
]
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
});
|
|
692
|
+
const results = await eslint.lintFiles([
|
|
693
|
+
"src/**/*.ts*",
|
|
694
|
+
"packages/**/src/**/*.ts*"
|
|
682
695
|
]);
|
|
696
|
+
const formatter = await eslint.loadFormatter("stylish");
|
|
697
|
+
const resultText = formatter.format(results, {
|
|
698
|
+
cwd: cwd(),
|
|
699
|
+
rulesMeta: {}
|
|
700
|
+
});
|
|
701
|
+
console.log(resultText);
|
|
702
|
+
return results.length;
|
|
683
703
|
}, "cycle");
|
|
684
704
|
|
|
685
705
|
// src/actions/dead.ts
|
|
@@ -1092,7 +1112,7 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
|
1092
1112
|
|
|
1093
1113
|
// src/actions/lint.ts
|
|
1094
1114
|
import chalk16 from "chalk";
|
|
1095
|
-
import { ESLint } from "eslint";
|
|
1115
|
+
import { ESLint as ESLint2 } from "eslint";
|
|
1096
1116
|
var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
|
|
1097
1117
|
const colors = [
|
|
1098
1118
|
"white",
|
|
@@ -1119,7 +1139,7 @@ var lintPackage = /* @__PURE__ */ __name(async ({ pkg }) => {
|
|
|
1119
1139
|
console.error(chalk16.red(`Unable to locate package [${chalk16.magenta(pkg)}]`));
|
|
1120
1140
|
process.exit(1);
|
|
1121
1141
|
}
|
|
1122
|
-
const engine = new
|
|
1142
|
+
const engine = new ESLint2({
|
|
1123
1143
|
cache: true
|
|
1124
1144
|
});
|
|
1125
1145
|
const lintResults = await engine.lintFiles(workspace.location);
|
|
@@ -1769,10 +1789,10 @@ import chalk19 from "chalk";
|
|
|
1769
1789
|
var xyLintCommands = /* @__PURE__ */ __name((args) => {
|
|
1770
1790
|
return args.command("cycle [package]", "Cycle - Check for dependency cycles", (yargs2) => {
|
|
1771
1791
|
return packagePositionalParam(yargs2);
|
|
1772
|
-
}, (argv) => {
|
|
1792
|
+
}, async (argv) => {
|
|
1773
1793
|
const start = Date.now();
|
|
1774
1794
|
if (argv.verbose) console.log("Cycle");
|
|
1775
|
-
process.exitCode = cycle();
|
|
1795
|
+
process.exitCode = await cycle();
|
|
1776
1796
|
console.log(chalk19.blue(`Finished in ${Date.now() - start}ms`));
|
|
1777
1797
|
}).command("lint [package]", "Lint - Run Eslint", (yargs2) => {
|
|
1778
1798
|
return packagePositionalParam(yargs2);
|