@xylabs/ts-scripts-yarn3 6.0.8 → 6.1.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 +2 -2
- package/dist/actions/build.mjs.map +1 -1
- package/dist/actions/index.mjs +16 -2
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/knip.mjs +112 -0
- package/dist/actions/knip.mjs.map +1 -0
- package/dist/actions/relint.mjs.map +1 -1
- package/dist/bin/xy.mjs +22 -2
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.mjs +23 -2
- package/dist/index.mjs.map +1 -1
- package/dist/types/actions/index.d.ts +1 -0
- package/dist/types/actions/index.d.ts.map +1 -1
- package/dist/types/actions/knip.d.ts +2 -0
- package/dist/types/actions/knip.d.ts.map +1 -0
- package/dist/types/actions/relint.d.ts.map +1 -1
- package/dist/types/xy/xyLintCommands.d.ts.map +1 -1
- package/dist/xy/index.mjs +22 -2
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/xy.mjs +22 -2
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyBuildCommands.mjs +2 -2
- package/dist/xy/xyBuildCommands.mjs.map +1 -1
- package/dist/xy/xyLintCommands.mjs +20 -0
- package/dist/xy/xyLintCommands.mjs.map +1 -1
- package/package.json +11 -5
- package/spec/yarn/workspace/tsconfig.json +0 -3
- package/src/actions/build.ts +0 -34
- package/src/actions/clean-docs.ts +0 -12
- package/src/actions/clean-eslint.ts +0 -15
- package/src/actions/clean-jest.ts +0 -7
- package/src/actions/clean.ts +0 -26
- package/src/actions/compile-types.ts +0 -67
- package/src/actions/compile.ts +0 -67
- package/src/actions/copy-assets.ts +0 -70
- package/src/actions/cycle.ts +0 -15
- package/src/actions/dead.ts +0 -5
- package/src/actions/deploy-major.ts +0 -11
- package/src/actions/deploy-minor.ts +0 -11
- package/src/actions/deploy-next.ts +0 -11
- package/src/actions/deploy.ts +0 -11
- package/src/actions/deps.ts +0 -43
- package/src/actions/dupdeps.ts +0 -12
- package/src/actions/fix.ts +0 -6
- package/src/actions/gen-docs.ts +0 -26
- package/src/actions/gitignore-gen.ts +0 -5
- package/src/actions/gitlint-fix.ts +0 -27
- package/src/actions/gitlint.ts +0 -46
- package/src/actions/index.ts +0 -37
- package/src/actions/license.ts +0 -81
- package/src/actions/lint.ts +0 -61
- package/src/actions/npmignore-gen.ts +0 -5
- package/src/actions/package/clean-outputs.ts +0 -18
- package/src/actions/package/clean-typescript.ts +0 -18
- package/src/actions/package/clean.ts +0 -6
- package/src/actions/package/compile/XyConfig.ts +0 -60
- package/src/actions/package/compile/buildEntries.ts +0 -22
- package/src/actions/package/compile/compile.ts +0 -21
- package/src/actions/package/compile/compileTypes.ts +0 -13
- package/src/actions/package/compile/copyTypeFiles.ts +0 -38
- package/src/actions/package/compile/deepMerge.ts +0 -33
- package/src/actions/package/compile/getCompilerOptions.ts +0 -30
- package/src/actions/package/compile/index.ts +0 -6
- package/src/actions/package/compile/inputs.ts +0 -6
- package/src/actions/package/compile/packageCompileTsc.ts +0 -67
- package/src/actions/package/compile/packageCompileTscTypes.ts +0 -68
- package/src/actions/package/compile/packageCompileTsup.ts +0 -154
- package/src/actions/package/copy-assets.ts +0 -46
- package/src/actions/package/deps.ts +0 -144
- package/src/actions/package/gen-docs.ts +0 -126
- package/src/actions/package/index.ts +0 -10
- package/src/actions/package/lint.ts +0 -86
- package/src/actions/package/publint.ts +0 -75
- package/src/actions/package/recompile.ts +0 -6
- package/src/actions/publint.ts +0 -26
- package/src/actions/rebuild.ts +0 -13
- package/src/actions/recompile.ts +0 -81
- package/src/actions/reinstall.ts +0 -29
- package/src/actions/relint.ts +0 -76
- package/src/actions/retest.ts +0 -8
- package/src/actions/sonar.ts +0 -5
- package/src/actions/statics.ts +0 -13
- package/src/actions/test.ts +0 -5
- package/src/actions/up.ts +0 -5
- package/src/actions/updo.ts +0 -9
- package/src/actions/upplug.ts +0 -10
- package/src/actions/upyarn.ts +0 -5
- package/src/actions/yarn3only.ts +0 -9
- package/src/bin/package/build-only.ts +0 -16
- package/src/bin/package/build.ts +0 -16
- package/src/bin/package/clean-outputs.ts +0 -5
- package/src/bin/package/clean-typescript.ts +0 -5
- package/src/bin/package/clean.ts +0 -12
- package/src/bin/package/compile-only.ts +0 -12
- package/src/bin/package/compile-tsup.ts +0 -12
- package/src/bin/package/compile-types.ts +0 -16
- package/src/bin/package/compile.ts +0 -16
- package/src/bin/package/copy-assets-cjs.ts +0 -12
- package/src/bin/package/copy-assets-esm.ts +0 -12
- package/src/bin/package/deps.ts +0 -12
- package/src/bin/package/fix.ts +0 -16
- package/src/bin/package/gen-docs.ts +0 -12
- package/src/bin/package/lint.ts +0 -16
- package/src/bin/package/publint.ts +0 -13
- package/src/bin/package/recompile.ts +0 -12
- package/src/bin/package/relint.ts +0 -16
- package/src/bin/xy.ts +0 -12
- package/src/index.ts +0 -4
- package/src/lib/checkResult.ts +0 -12
- package/src/lib/createBuildConfig.ts +0 -37
- package/src/lib/defaultBuildConfig.ts +0 -18
- package/src/lib/deleteGlob.ts +0 -13
- package/src/lib/dependencies/DuplicateDetector.ts +0 -97
- package/src/lib/dependencies/detectDuplicateDependencies.ts +0 -41
- package/src/lib/dependencies/index.ts +0 -2
- package/src/lib/file/ReadFileSyncOptions.ts +0 -6
- package/src/lib/file/constants.ts +0 -2
- package/src/lib/file/fileLines.ts +0 -25
- package/src/lib/file/index.ts +0 -4
- package/src/lib/file/tryReadFileSync.ts +0 -9
- package/src/lib/generateIgnoreFiles.ts +0 -31
- package/src/lib/index.ts +0 -20
- package/src/lib/jsonFormatters.ts +0 -6
- package/src/lib/loadConfig.ts +0 -19
- package/src/lib/parsedPackageJSON.ts +0 -7
- package/src/lib/processEx.ts +0 -27
- package/src/lib/runSteps.ts +0 -40
- package/src/lib/runStepsAsync.ts +0 -53
- package/src/lib/runXy.ts +0 -8
- package/src/lib/runXyWithWarning.ts +0 -9
- package/src/lib/safeExit.ts +0 -29
- package/src/lib/string/empty.ts +0 -2
- package/src/lib/string/index.ts +0 -2
- package/src/lib/string/union.ts +0 -1
- package/src/lib/withErrnoException.ts +0 -7
- package/src/lib/withError.ts +0 -8
- package/src/lib/yarn/index.ts +0 -3
- package/src/lib/yarn/isYarnVersionOrGreater.ts +0 -16
- package/src/lib/yarn/workspace/Workspace.ts +0 -4
- package/src/lib/yarn/workspace/index.ts +0 -3
- package/src/lib/yarn/workspace/yarnWorkspace.ts +0 -8
- package/src/lib/yarn/workspace/yarnWorkspaces.ts +0 -21
- package/src/lib/yarn/yarnInitCwd.ts +0 -4
- package/src/loadPackageConfig.ts +0 -13
- package/src/types.d.ts +0 -26
- package/src/xy/index.ts +0 -7
- package/src/xy/param.ts +0 -5
- package/src/xy/xy.ts +0 -20
- package/src/xy/xyBuildCommands.ts +0 -127
- package/src/xy/xyCommonCommands.ts +0 -167
- package/src/xy/xyDeployCommands.ts +0 -53
- package/src/xy/xyInstallCommands.ts +0 -80
- package/src/xy/xyLintCommands.ts +0 -92
- package/src/xy/xyParseOptions.ts +0 -58
- package/tsconfig.build.json +0 -29
- package/tsconfig.json +0 -4
- package/tsconfig.test.json +0 -4
- package/tsup.config.ts +0 -16
- package/types/node-cmd.d.ts +0 -1
- package/xy.config.ts +0 -3
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
4
|
+
// src/lib/checkResult.ts
|
|
5
|
+
import chalk from "chalk";
|
|
6
|
+
var checkResult = /* @__PURE__ */ __name((name, result, level = "error", exitOnFail = false) => {
|
|
7
|
+
if (result) {
|
|
8
|
+
const exiting = exitOnFail ? "[Exiting Process]" : "[Continuing]";
|
|
9
|
+
const chalkFunc = level === "error" ? chalk.red : chalk.yellow;
|
|
10
|
+
console[level](chalkFunc(`${name} had ${result} failures ${exiting}`));
|
|
11
|
+
if (exitOnFail) {
|
|
12
|
+
process.exit(result);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}, "checkResult");
|
|
16
|
+
|
|
17
|
+
// src/lib/processEx.ts
|
|
18
|
+
import chalk2 from "chalk";
|
|
19
|
+
|
|
20
|
+
// src/lib/withError.ts
|
|
21
|
+
var withError = /* @__PURE__ */ __name((ex, closure, predicate = (ex2) => !!ex2.name && !!ex2.message) => {
|
|
22
|
+
return predicate(ex) ? closure(ex) : void 0;
|
|
23
|
+
}, "withError");
|
|
24
|
+
|
|
25
|
+
// src/lib/withErrnoException.ts
|
|
26
|
+
var withErrnoException = /* @__PURE__ */ __name((ex, closure) => {
|
|
27
|
+
return withError(ex, closure, (ex2) => ex2.errno !== void 0);
|
|
28
|
+
}, "withErrnoException");
|
|
29
|
+
|
|
30
|
+
// src/lib/processEx.ts
|
|
31
|
+
var processEx = /* @__PURE__ */ __name((ex) => {
|
|
32
|
+
const error = typeof ex === "string" ? new Error(ex) : ex;
|
|
33
|
+
const exitCode = withErrnoException(error, (error2) => {
|
|
34
|
+
if (error2.code === "ENOENT") {
|
|
35
|
+
console.error(chalk2.red(`'${error2.path}' not found.`));
|
|
36
|
+
} else {
|
|
37
|
+
console.error(chalk2.red(`Errno: ${error2.code}`));
|
|
38
|
+
}
|
|
39
|
+
return error2.errno ?? -1;
|
|
40
|
+
}) ?? withError(error, (error2) => {
|
|
41
|
+
console.error(chalk2.red(`${error2.name}: ${error2.message}`));
|
|
42
|
+
return -1;
|
|
43
|
+
}) ?? (() => {
|
|
44
|
+
console.error(chalk2.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`));
|
|
45
|
+
return -1;
|
|
46
|
+
})();
|
|
47
|
+
process.exit(process.exitCode ?? exitCode);
|
|
48
|
+
}, "processEx");
|
|
49
|
+
|
|
50
|
+
// src/lib/safeExit.ts
|
|
51
|
+
var safeExit = /* @__PURE__ */ __name((func, exitOnFail = true) => {
|
|
52
|
+
try {
|
|
53
|
+
const result = func();
|
|
54
|
+
if (result && exitOnFail) {
|
|
55
|
+
process.exit(result);
|
|
56
|
+
}
|
|
57
|
+
return result;
|
|
58
|
+
} catch (ex) {
|
|
59
|
+
return processEx(ex);
|
|
60
|
+
}
|
|
61
|
+
}, "safeExit");
|
|
62
|
+
|
|
63
|
+
// src/lib/runSteps.ts
|
|
64
|
+
import { spawnSync } from "node:child_process";
|
|
65
|
+
import { existsSync } from "node:fs";
|
|
66
|
+
import chalk3 from "chalk";
|
|
67
|
+
var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages) => {
|
|
68
|
+
return safeExit(() => {
|
|
69
|
+
const pkgName = process.env.npm_package_name;
|
|
70
|
+
console.log(chalk3.green(`${name} [${pkgName}]`));
|
|
71
|
+
let totalStatus = 0;
|
|
72
|
+
for (const [i, [command, args, config]] of steps.entries()) {
|
|
73
|
+
if (messages?.[i]) {
|
|
74
|
+
console.log(chalk3.gray(messages?.[i]));
|
|
75
|
+
}
|
|
76
|
+
const argList = Array.isArray(args) ? args : args.split(" ");
|
|
77
|
+
if (command === "node" && !existsSync(argList[0])) {
|
|
78
|
+
throw new Error(`File not found [${argList[0]}]`);
|
|
79
|
+
}
|
|
80
|
+
const status = spawnSync(command, Array.isArray(args) ? args : args.split(" "), {
|
|
81
|
+
...config,
|
|
82
|
+
encoding: "utf8",
|
|
83
|
+
env: {
|
|
84
|
+
FORCE_COLOR: "3",
|
|
85
|
+
...process.env
|
|
86
|
+
},
|
|
87
|
+
shell: true,
|
|
88
|
+
stdio: "inherit"
|
|
89
|
+
}).status ?? 0;
|
|
90
|
+
checkResult(name, status, "error", exitOnFail);
|
|
91
|
+
totalStatus += status ?? 0;
|
|
92
|
+
}
|
|
93
|
+
return totalStatus;
|
|
94
|
+
}, !!exitOnFail);
|
|
95
|
+
}, "runSteps");
|
|
96
|
+
|
|
97
|
+
// src/actions/knip.ts
|
|
98
|
+
var knip = /* @__PURE__ */ __name(() => {
|
|
99
|
+
return runSteps("Knip", [
|
|
100
|
+
[
|
|
101
|
+
"yarn",
|
|
102
|
+
[
|
|
103
|
+
"knip",
|
|
104
|
+
"--dependencies"
|
|
105
|
+
]
|
|
106
|
+
]
|
|
107
|
+
]);
|
|
108
|
+
}, "knip");
|
|
109
|
+
export {
|
|
110
|
+
knip
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=knip.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/checkResult.ts","../../src/lib/processEx.ts","../../src/lib/withError.ts","../../src/lib/withErrnoException.ts","../../src/lib/safeExit.ts","../../src/lib/runSteps.ts","../../src/actions/knip.ts"],"sourcesContent":["import chalk from 'chalk'\n\nexport const checkResult = (name: string, result: number, level: 'error' | 'warn' = 'error', exitOnFail = false) => {\n if (result) {\n const exiting = exitOnFail ? '[Exiting Process]' : '[Continuing]'\n const chalkFunc = level === 'error' ? chalk.red : chalk.yellow\n console[level](chalkFunc(`${name} had ${result} failures ${exiting}`))\n if (exitOnFail) {\n process.exit(result)\n }\n }\n}\n","import chalk from 'chalk'\n\nimport { withErrnoException } from './withErrnoException.ts'\nimport { withError } from './withError.ts'\n\nexport const processEx = (ex: unknown) => {\n const error = typeof ex === 'string' ? new Error(ex) : ex\n const exitCode\n = withErrnoException(error, (error) => {\n if (error.code === 'ENOENT') {\n console.error(chalk.red(`'${error.path}' not found.`))\n } else {\n console.error(chalk.red(`Errno: ${error.code}`))\n }\n return error.errno ?? -1\n })\n ?? withError(error, (error) => {\n console.error(chalk.red(`${error.name}: ${error.message}`))\n return -1\n })\n ?? (() => {\n console.error(chalk.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`))\n return -1\n })()\n // This allows us to use a previously set exit code\n process.exit(process.exitCode ?? exitCode)\n}\n","export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => (!!ex.name && !!ex.message),\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n","import { withError } from './withError.ts'\n\nexport const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(\n ex: unknown, closure: (error: T) => number,\n) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n","/** Catch child process a crash and returns the code */\n\nimport { processEx } from './processEx.ts'\n\nconst safeExit = (func: () => number, exitOnFail = true): number => {\n try {\n const result = func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nconst safeExitAsync = async (func: () => Promise<number>, exitOnFail = true): Promise<number> => {\n try {\n const result = await func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nexport { safeExit, safeExitAsync }\n","import type { SpawnSyncOptionsWithBufferEncoding } from 'node:child_process'\nimport { spawnSync } from 'node:child_process'\nimport { existsSync } from 'node:fs'\n\nimport chalk from 'chalk'\n\nimport { checkResult } from './checkResult.ts'\nimport { safeExit } from './safeExit.ts'\n\nexport type ScriptStep =\n | [/* command */ 'yarn' | 'node' | 'ts-node-script' | 'tsc' | 'jest', /* arg */ string | string[]]\n | [/* command */ string, /* arg */ string | string[], /* config */ SpawnSyncOptionsWithBufferEncoding]\n\nexport const runSteps = (name: string, steps: ScriptStep[], exitOnFail = true, messages?: string[]): number => {\n return safeExit(() => {\n const pkgName = process.env.npm_package_name\n console.log(chalk.green(`${name} [${pkgName}]`))\n let totalStatus = 0\n for (const [i, [command, args, config]] of steps.entries()) {\n if (messages?.[i]) {\n console.log(chalk.gray(messages?.[i]))\n }\n const argList = Array.isArray(args) ? args : args.split(' ')\n if (command === 'node' && !existsSync(argList[0])) {\n throw new Error(`File not found [${argList[0]}]`)\n }\n const status\n = spawnSync(command, Array.isArray(args) ? args : args.split(' '), {\n ...config,\n encoding: 'utf8',\n env: { FORCE_COLOR: '3', ...process.env },\n shell: true,\n stdio: 'inherit',\n }).status ?? 0\n checkResult(name, status, 'error', exitOnFail)\n totalStatus += status ?? 0\n }\n return totalStatus\n }, !!exitOnFail)\n}\n","import { runSteps } from '../lib/index.ts'\n\nexport const knip = () => {\n return runSteps('Knip', [['yarn', ['knip', '--dependencies']]])\n}\n"],"mappings":";;;;AAAA,OAAOA,WAAW;AAEX,IAAMC,cAAc,wBAACC,MAAcC,QAAgBC,QAA0B,SAASC,aAAa,UAAK;AAC7G,MAAIF,QAAQ;AACV,UAAMG,UAAUD,aAAa,sBAAsB;AACnD,UAAME,YAAYH,UAAU,UAAUI,MAAMC,MAAMD,MAAME;AACxDC,YAAQP,KAAAA,EAAOG,UAAU,GAAGL,IAAAA,QAAYC,MAAAA,aAAmBG,OAAAA,EAAS,CAAA;AACpE,QAAID,YAAY;AACdO,cAAQC,KAAKV,MAAAA;IACf;EACF;AACF,GAT2B;;;ACF3B,OAAOW,YAAW;;;ACAX,IAAMC,YAAY,wBAEvBC,IACAC,SACAC,YAAY,CAACF,QAAW,CAAC,CAACA,IAAGG,QAAQ,CAAC,CAACH,IAAGI,YAAQ;AAElD,SAAOF,UAAUF,EAAAA,IAAWC,QAAQD,EAAAA,IAAWK;AACjD,GAPyB;;;ACElB,IAAMC,qBAAqB,wBAChCC,IAAaC,YAAAA;AAEb,SAAOC,UAAaF,IAAIC,SAAS,CAACD,QAAiBA,IAA6BG,UAAUC,MAAAA;AAC5F,GAJkC;;;AFG3B,IAAMC,YAAY,wBAACC,OAAAA;AACxB,QAAMC,QAAQ,OAAOD,OAAO,WAAW,IAAIE,MAAMF,EAAAA,IAAMA;AACvD,QAAMG,WACFC,mBAAmBH,OAAO,CAACA,WAAAA;AAC3B,QAAIA,OAAMI,SAAS,UAAU;AAC3BC,cAAQL,MAAMM,OAAMC,IAAI,IAAIP,OAAMQ,IAAI,cAAc,CAAA;IACtD,OAAO;AACLH,cAAQL,MAAMM,OAAMC,IAAI,UAAUP,OAAMI,IAAI,EAAE,CAAA;IAChD;AACA,WAAOJ,OAAMS,SAAS;E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AAG;MAClD;AACA,YAAMM,SACFC,UAAUZ,SAASM,MAAMC,QAAQN,IAAAA,IAAQA,OAAOA,KAAKO,MAAM,GAAA,GAAM;QACjE,GAAGN;QACHW,UAAU;QACVrB,KAAK;UAAEsB,aAAa;UAAK,GAAGvB,QAAQC;QAAI;QACxCuB,OAAO;QACPC,OAAO;MACT,CAAA,EAAGL,UAAU;AACfM,kBAAYhC,MAAM0B,QAAQ,SAASxB,UAAAA;AACnCW,qBAAea,UAAU;IAC3B;AACA,WAAOb;EACT,GAAG,CAAC,CAACX,UAAAA;AACP,GA1BwB;;;ACXjB,IAAM+B,OAAO,6BAAA;AAClB,SAAOC,SAAS,QAAQ;IAAC;MAAC;MAAQ;QAAC;QAAQ;;;GAAmB;AAChE,GAFoB;","names":["chalk","checkResult","name","result","level","exitOnFail","exiting","chalkFunc","chalk","red","yellow","console","process","exit","chalk","withError","ex","closure","predicate","name","message","undefined","withErrnoException","ex","closure","withError","errno","undefined","processEx","ex","error","Error","exitCode","withErrnoException","code","console","chalk","red","path","errno","withError","name","message","JSON","stringify","process","exit","safeExit","func","exitOnFail","result","process","exit","ex","processEx","spawnSync","existsSync","chalk","runSteps","name","steps","exitOnFail","messages","safeExit","pkgName","process","env","npm_package_name","console","log","chalk","green","totalStatus","i","command","args","config","entries","gray","argList","Array","isArray","split","existsSync","Error","status","spawnSync","encoding","FORCE_COLOR","shell","stdio","checkResult","knip","runSteps"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/actions/relint.ts","../../src/lib/checkResult.ts","../../src/lib/processEx.ts","../../src/lib/withError.ts","../../src/lib/withErrnoException.ts","../../src/lib/safeExit.ts","../../src/lib/runSteps.ts"],"sourcesContent":["import chalk from 'chalk'\nimport type { ESLint } from 'eslint'\n\nimport { runSteps, yarnWorkspaces } from '../lib/index.ts'\n\nexport interface RelintParams {\n incremental?: boolean\n pkg?: string\n verbose?: boolean\n}\n\nexport interface RelintPackageParams {\n pkg: string\n verbose?: boolean\n}\n\nconst dumpMessages = (lintResults: ESLint.LintResult[]) => {\n const colors: ('white' | 'red' | 'yellow')[] = ['white', 'yellow', 'red']\n const severity: string[] = ['none', 'warning', 'error']\n\n for (const lintResult of lintResults) {\n if (lintResult.messages.length > 0) {\n console.log(chalk.gray(`${lintResult.filePath}`))\n for (const message of lintResult.messages) {\n console.log(\n chalk.gray(`\\t${message.line}:${message.column}`),\n chalk[colors[message.severity]](`\\t${severity[message.severity]}`),\n chalk.white(`\\t${message.message}`),\n chalk.gray(`\\t${message.ruleId}`),\n )\n }\n }\n }\n}\n\nexport const relintPackage = ({ pkg }: RelintParams & Required<Pick<RelintParams, 'pkg'>>) => {\n console.log(chalk.gray(`${'Relint'} [All-Packages]`))\n const start = Date.now()\n\n const result = runSteps('Relint [All-Packages]', [\n ['yarn', ['workspace',\n pkg,\n 'run',\n 'package-relint',\n ]],\n ])\n console.log(chalk.gray(`${'Relinted in'} [${chalk.magenta(((Date.now() - start) / 1000).toFixed(2))}] ${chalk.gray('seconds')}`))\n return result\n}\n\nexport const relint = ({\n pkg, verbose, incremental,\n}: RelintParams = {}) => {\n return pkg\n ? relintPackage({ pkg })\n : relintAllPackages({ verbose, incremental })\n}\n\nexport const relintAllPackages = ({ verbose = true, incremental }: RelintParams = {}) => {\n console.log(chalk.gray(`${'Relint'} [All-Packages]`))\n const start = Date.now()\n const verboseOptions = verbose ? ['--verbose'] : ['--no-verbose']\n const incrementalOptions = incremental ? ['--since', '-Ap'] : ['--parallel', '-Ap']\n\n const result = runSteps(`${'Relint'} [All-Packages]`, [\n ['yarn', ['workspaces',\n 'foreach',\n ...verboseOptions,\n ...incrementalOptions,\n 'run',\n 'package-relint',\n ]],\n ])\n console.log(chalk.gray(`Relinted in [${chalk.magenta(((Date.now() - start) / 1000).toFixed(2))}] ${chalk.gray('seconds')}`))\n return result\n}\n","import chalk from 'chalk'\n\nexport const checkResult = (name: string, result: number, level: 'error' | 'warn' = 'error', exitOnFail = false) => {\n if (result) {\n const exiting = exitOnFail ? '[Exiting Process]' : '[Continuing]'\n const chalkFunc = level === 'error' ? chalk.red : chalk.yellow\n console[level](chalkFunc(`${name} had ${result} failures ${exiting}`))\n if (exitOnFail) {\n process.exit(result)\n }\n }\n}\n","import chalk from 'chalk'\n\nimport { withErrnoException } from './withErrnoException.ts'\nimport { withError } from './withError.ts'\n\nexport const processEx = (ex: unknown) => {\n const error = typeof ex === 'string' ? new Error(ex) : ex\n const exitCode\n = withErrnoException(error, (error) => {\n if (error.code === 'ENOENT') {\n console.error(chalk.red(`'${error.path}' not found.`))\n } else {\n console.error(chalk.red(`Errno: ${error.code}`))\n }\n return error.errno ?? -1\n })\n ?? withError(error, (error) => {\n console.error(chalk.red(`${error.name}: ${error.message}`))\n return -1\n })\n ?? (() => {\n console.error(chalk.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`))\n return -1\n })()\n // This allows us to use a previously set exit code\n process.exit(process.exitCode ?? exitCode)\n}\n","export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => (!!ex.name && !!ex.message),\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n","import { withError } from './withError.ts'\n\nexport const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(\n ex: unknown, closure: (error: T) => number,\n) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n","/** Catch child process a crash and returns the code */\n\nimport { processEx } from './processEx.ts'\n\nconst safeExit = (func: () => number, exitOnFail = true): number => {\n try {\n const result = func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nconst safeExitAsync = async (func: () => Promise<number>, exitOnFail = true): Promise<number> => {\n try {\n const result = await func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nexport { safeExit, safeExitAsync }\n","import type { SpawnSyncOptionsWithBufferEncoding } from 'node:child_process'\nimport { spawnSync } from 'node:child_process'\nimport { existsSync } from 'node:fs'\n\nimport chalk from 'chalk'\n\nimport { checkResult } from './checkResult.ts'\nimport { safeExit } from './safeExit.ts'\n\nexport type ScriptStep =\n | [/* command */ 'yarn' | 'node' | 'ts-node-script' | 'tsc' | 'jest', /* arg */ string | string[]]\n | [/* command */ string, /* arg */ string | string[], /* config */ SpawnSyncOptionsWithBufferEncoding]\n\nexport const runSteps = (name: string, steps: ScriptStep[], exitOnFail = true, messages?: string[]): number => {\n return safeExit(() => {\n const pkgName = process.env.npm_package_name\n console.log(chalk.green(`${name} [${pkgName}]`))\n let totalStatus = 0\n for (const [i, [command, args, config]] of steps.entries()) {\n if (messages?.[i]) {\n console.log(chalk.gray(messages?.[i]))\n }\n const argList = Array.isArray(args) ? args : args.split(' ')\n if (command === 'node' && !existsSync(argList[0])) {\n throw new Error(`File not found [${argList[0]}]`)\n }\n const status\n = spawnSync(command, Array.isArray(args) ? args : args.split(' '), {\n ...config,\n encoding: 'utf8',\n env: { FORCE_COLOR: '3', ...process.env },\n shell: true,\n stdio: 'inherit',\n }).status ?? 0\n checkResult(name, status, 'error', exitOnFail)\n totalStatus += status ?? 0\n }\n return totalStatus\n }, !!exitOnFail)\n}\n"],"mappings":";;;;AAAA,OAAOA,YAAW;;;ACAlB,OAAOC,WAAW;AAEX,IAAMC,cAAc,wBAACC,MAAcC,QAAgBC,QAA0B,SAASC,aAAa,UAAK;AAC7G,MAAIF,QAAQ;AACV,UAAMG,UAAUD,aAAa,sBAAsB;AACnD,UAAME,YAAYH,UAAU,UAAUI,MAAMC,MAAMD,MAAME;AACxDC,YAAQP,KAAAA,EAAOG,UAAU,GAAGL,IAAAA,QAAYC,MAAAA,aAAmBG,OAAAA,EAAS,CAAA;AACpE,QAAID,YAAY;AACdO,cAAQC,KAAKV,MAAAA;IACf;EACF;AACF,GAT2B;;;ACF3B,OAAOW,YAAW;;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B;IAC/C;MAAC;MAAQ;QAAC;QACRT;QACA;QACA;;;GAEH;AACDC,UAAQC,IAAIC,OAAMC,KAAK,GAAG,aAAA,KAAkBD,OAAMO,UAAUJ,KAAKC,IAAG,IAAKF,SAAS,KAAMM,QAAQ,CAAA,CAAA,CAAA,KAAQR,OAAMC,KAAK,SAAA,CAAA,EAAY,CAAA;AAC/H,SAAOI;AACT,GAb6B;AAetB,IAAMI,SAAS,wBAAC,EACrBZ,KAAKa,SAASC,YAAW,IACT,CAAC,MAAC;AAClB,SAAOd,MACHD,cAAc;IAAEC;EAAI,CAAA,IACpBe,kBAAkB;IAAEF;IAASC;EAAY,CAAA;AAC/C,GANsB;AAQf,IAAMC,oBAAoB,wBAAC,EAAEF,UAAU,MAAMC,YAAW,IAAmB,CAAC,MAAC;AAClFb,UAAQC,IAAIC,OAAMC,KAAK,GAAG,QAAA,iBAAyB,CAAA;AACnD,QAAMC,QAAQC,KAAKC,IAAG;AACtB,QAAMS,iBAAiBH,UAAU;IAAC;MAAe;IAAC;;AAClD,QAAMI,qBAAqBH,cAAc;IAAC;IAAW;MAAS;IAAC;IAAc;;AAE7E,QAAMN,SAASC,SAAS,GAAG,QAAA,oBAA4B;IACrD;MAAC;MAAQ;QAAC;QACR;WACGO;WACAC;QACH;QACA;;;GAEH;AACDhB,UAAQC,IAAIC,OAAMC,KAAK,gBAAgBD,OAAMO,UAAUJ,KAAKC,IAAG,IAAKF,SAAS,KAAMM,QAAQ,CAAA,CAAA,CAAA,KAAQR,OAAMC,KAAK,SAAA,CAAA,EAAY,CAAA;AAC1H,SAAOI;AACT,GAjBiC;","names":["chalk","chalk","checkResult","name","result","level","exitOnFail","exiting","chalkFunc","chalk","red","yellow","console","process","exit","chalk","withError","ex","closure","predicate","name","message","undefined","withErrnoException","ex","closure","withError","errno","undefined","processEx","ex","error","Error","exitCode","withErrnoException","code","console","chalk","red","path","errno","withError","name","message","JSON","stringify","process","exit","safeExit","func","exitOnFail","result","process","exit","ex","processEx","spawnSync","existsSync","chalk","runSteps","name","steps","exitOnFail","messages","safeExit","pkgName","process","env","npm_package_name","console","log","chalk","green","totalStatus","i","command","args","config","entries","gray","argList","Array","isArray","split","existsSync","Error","status","spawnSync","encoding","FORCE_COLOR","shell","stdio","checkResult","relintPackage","pkg","console","log","chalk","gray","start","Date","now","result","runSteps","magenta","toFixed","relint","verbose","incremental","relintAllPackages","verboseOptions","incrementalOptions"]}
|
|
1
|
+
{"version":3,"sources":["../../src/actions/relint.ts","../../src/lib/checkResult.ts","../../src/lib/processEx.ts","../../src/lib/withError.ts","../../src/lib/withErrnoException.ts","../../src/lib/safeExit.ts","../../src/lib/runSteps.ts"],"sourcesContent":["import chalk from 'chalk'\n\nimport { runSteps } from '../lib/index.ts'\n\nexport interface RelintParams {\n incremental?: boolean\n pkg?: string\n verbose?: boolean\n}\n\nexport interface RelintPackageParams {\n pkg: string\n verbose?: boolean\n}\n\nexport const relintPackage = ({ pkg }: RelintParams & Required<Pick<RelintParams, 'pkg'>>) => {\n console.log(chalk.gray(`${'Relint'} [All-Packages]`))\n const start = Date.now()\n\n const result = runSteps('Relint [All-Packages]', [\n ['yarn', ['workspace',\n pkg,\n 'run',\n 'package-relint',\n ]],\n ])\n console.log(chalk.gray(`${'Relinted in'} [${chalk.magenta(((Date.now() - start) / 1000).toFixed(2))}] ${chalk.gray('seconds')}`))\n return result\n}\n\nexport const relint = ({\n pkg, verbose, incremental,\n}: RelintParams = {}) => {\n return pkg\n ? relintPackage({ pkg })\n : relintAllPackages({ verbose, incremental })\n}\n\nexport const relintAllPackages = ({ verbose = true, incremental }: RelintParams = {}) => {\n console.log(chalk.gray(`${'Relint'} [All-Packages]`))\n const start = Date.now()\n const verboseOptions = verbose ? ['--verbose'] : ['--no-verbose']\n const incrementalOptions = incremental ? ['--since', '-Ap'] : ['--parallel', '-Ap']\n\n const result = runSteps(`${'Relint'} [All-Packages]`, [\n ['yarn', ['workspaces',\n 'foreach',\n ...verboseOptions,\n ...incrementalOptions,\n 'run',\n 'package-relint',\n ]],\n ])\n console.log(chalk.gray(`Relinted in [${chalk.magenta(((Date.now() - start) / 1000).toFixed(2))}] ${chalk.gray('seconds')}`))\n return result\n}\n","import chalk from 'chalk'\n\nexport const checkResult = (name: string, result: number, level: 'error' | 'warn' = 'error', exitOnFail = false) => {\n if (result) {\n const exiting = exitOnFail ? '[Exiting Process]' : '[Continuing]'\n const chalkFunc = level === 'error' ? chalk.red : chalk.yellow\n console[level](chalkFunc(`${name} had ${result} failures ${exiting}`))\n if (exitOnFail) {\n process.exit(result)\n }\n }\n}\n","import chalk from 'chalk'\n\nimport { withErrnoException } from './withErrnoException.ts'\nimport { withError } from './withError.ts'\n\nexport const processEx = (ex: unknown) => {\n const error = typeof ex === 'string' ? new Error(ex) : ex\n const exitCode\n = withErrnoException(error, (error) => {\n if (error.code === 'ENOENT') {\n console.error(chalk.red(`'${error.path}' not found.`))\n } else {\n console.error(chalk.red(`Errno: ${error.code}`))\n }\n return error.errno ?? -1\n })\n ?? withError(error, (error) => {\n console.error(chalk.red(`${error.name}: ${error.message}`))\n return -1\n })\n ?? (() => {\n console.error(chalk.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`))\n return -1\n })()\n // This allows us to use a previously set exit code\n process.exit(process.exitCode ?? exitCode)\n}\n","export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => (!!ex.name && !!ex.message),\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n","import { withError } from './withError.ts'\n\nexport const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(\n ex: unknown, closure: (error: T) => number,\n) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n","/** Catch child process a crash and returns the code */\n\nimport { processEx } from './processEx.ts'\n\nconst safeExit = (func: () => number, exitOnFail = true): number => {\n try {\n const result = func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nconst safeExitAsync = async (func: () => Promise<number>, exitOnFail = true): Promise<number> => {\n try {\n const result = await func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nexport { safeExit, safeExitAsync }\n","import type { SpawnSyncOptionsWithBufferEncoding } from 'node:child_process'\nimport { spawnSync } from 'node:child_process'\nimport { existsSync } from 'node:fs'\n\nimport chalk from 'chalk'\n\nimport { checkResult } from './checkResult.ts'\nimport { safeExit } from './safeExit.ts'\n\nexport type ScriptStep =\n | [/* command */ 'yarn' | 'node' | 'ts-node-script' | 'tsc' | 'jest', /* arg */ string | string[]]\n | [/* command */ string, /* arg */ string | string[], /* config */ SpawnSyncOptionsWithBufferEncoding]\n\nexport const runSteps = (name: string, steps: ScriptStep[], exitOnFail = true, messages?: string[]): number => {\n return safeExit(() => {\n const pkgName = process.env.npm_package_name\n console.log(chalk.green(`${name} [${pkgName}]`))\n let totalStatus = 0\n for (const [i, [command, args, config]] of steps.entries()) {\n if (messages?.[i]) {\n console.log(chalk.gray(messages?.[i]))\n }\n const argList = Array.isArray(args) ? args : args.split(' ')\n if (command === 'node' && !existsSync(argList[0])) {\n throw new Error(`File not found [${argList[0]}]`)\n }\n const status\n = spawnSync(command, Array.isArray(args) ? args : args.split(' '), {\n ...config,\n encoding: 'utf8',\n env: { FORCE_COLOR: '3', ...process.env },\n shell: true,\n stdio: 'inherit',\n }).status ?? 0\n checkResult(name, status, 'error', exitOnFail)\n totalStatus += status ?? 0\n }\n return totalStatus\n }, !!exitOnFail)\n}\n"],"mappings":";;;;AAAA,OAAOA,YAAW;;;ACAlB,OAAOC,WAAW;AAEX,IAAMC,cAAc,wBAACC,MAAcC,QAAgBC,QAA0B,SAASC,aAAa,UAAK;AAC7G,MAAIF,QAAQ;AACV,UAAMG,UAAUD,aAAa,sBAAsB;AACnD,UAAME,YAAYH,UAAU,UAAUI,M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Fail","exiting","chalkFunc","chalk","red","yellow","console","process","exit","chalk","withError","ex","closure","predicate","name","message","undefined","withErrnoException","ex","closure","withError","errno","undefined","processEx","ex","error","Error","exitCode","withErrnoException","code","console","chalk","red","path","errno","withError","name","message","JSON","stringify","process","exit","safeExit","func","exitOnFail","result","process","exit","ex","processEx","spawnSync","existsSync","chalk","runSteps","name","steps","exitOnFail","messages","safeExit","pkgName","process","env","npm_package_name","console","log","chalk","green","totalStatus","i","command","args","config","entries","gray","argList","Array","isArray","split","existsSync","Error","status","spawnSync","encoding","FORCE_COLOR","shell","stdio","checkResult","relintPackage","pkg","console","log","chalk","gray","start","Date","now","result","runSteps","magenta","toFixed","relint","verbose","incremental","relintAllPackages","verboseOptions","incrementalOptions"]}
|
package/dist/bin/xy.mjs
CHANGED
|
@@ -470,7 +470,7 @@ var build = /* @__PURE__ */ __name(async ({ incremental, jobs, target, verbose,
|
|
|
470
470
|
"yarn",
|
|
471
471
|
[
|
|
472
472
|
"xy",
|
|
473
|
-
"
|
|
473
|
+
"publint",
|
|
474
474
|
...pkgOptions,
|
|
475
475
|
...verboseOptions,
|
|
476
476
|
...jobsOptions,
|
|
@@ -481,7 +481,7 @@ var build = /* @__PURE__ */ __name(async ({ incremental, jobs, target, verbose,
|
|
|
481
481
|
"yarn",
|
|
482
482
|
[
|
|
483
483
|
"xy",
|
|
484
|
-
"
|
|
484
|
+
"knip",
|
|
485
485
|
...pkgOptions,
|
|
486
486
|
...verboseOptions,
|
|
487
487
|
...jobsOptions,
|
|
@@ -1175,6 +1175,19 @@ Gitlint Fix Start [${process.cwd()}]
|
|
|
1175
1175
|
return 1;
|
|
1176
1176
|
}, "gitlintFix");
|
|
1177
1177
|
|
|
1178
|
+
// src/actions/knip.ts
|
|
1179
|
+
var knip = /* @__PURE__ */ __name(() => {
|
|
1180
|
+
return runSteps("Knip", [
|
|
1181
|
+
[
|
|
1182
|
+
"yarn",
|
|
1183
|
+
[
|
|
1184
|
+
"knip",
|
|
1185
|
+
"--dependencies"
|
|
1186
|
+
]
|
|
1187
|
+
]
|
|
1188
|
+
]);
|
|
1189
|
+
}, "knip");
|
|
1190
|
+
|
|
1178
1191
|
// src/actions/license.ts
|
|
1179
1192
|
import chalk17 from "chalk";
|
|
1180
1193
|
import { init } from "license-checker";
|
|
@@ -1930,6 +1943,13 @@ var xyLintCommands = /* @__PURE__ */ __name((args) => {
|
|
|
1930
1943
|
verbose: !!argv.verbose
|
|
1931
1944
|
});
|
|
1932
1945
|
console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
|
|
1946
|
+
}).command("knip", "Knip - Run Knip", (yargs2) => {
|
|
1947
|
+
return packagePositionalParam(yargs2);
|
|
1948
|
+
}, (argv) => {
|
|
1949
|
+
if (argv.verbose) console.log("Knip");
|
|
1950
|
+
const start = Date.now();
|
|
1951
|
+
process.exitCode = knip();
|
|
1952
|
+
console.log(chalk21.blue(`Knip finished in ${Date.now() - start}ms`));
|
|
1933
1953
|
}).command("sonar", "Sonar - Run Sonar Check", (yargs2) => {
|
|
1934
1954
|
return packagePositionalParam(yargs2);
|
|
1935
1955
|
}, (argv) => {
|