@xylabs/ts-scripts-yarn3 4.0.0-rc.10 → 4.0.0-rc.12

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.
@@ -1,119 +1,34 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
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 !== void 0 && ex2.message !== void 0) => {
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]}]`);
4
+ // src/actions/cycle.ts
5
+ import { cwd } from "node:process";
6
+ import { ESLint } from "eslint";
7
+ var cycle = /* @__PURE__ */ __name(async () => {
8
+ const eslint = new ESLint({
9
+ fix: false,
10
+ overrideConfig: {
11
+ rules: {
12
+ "import/no-cycle": [
13
+ "error",
14
+ {
15
+ maxDepth: 10
16
+ }
17
+ ]
79
18
  }
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
19
  }
93
- return totalStatus;
94
- }, !!exitOnFail);
95
- }, "runSteps");
96
-
97
- // src/actions/cycle.ts
98
- var cycle = /* @__PURE__ */ __name(() => {
99
- const rules = [
100
- `"'import/no-cycle': [1, { maxDepth: 6 }]"`,
101
- `"'import/no-internal-modules': ['off']"`
102
- ];
103
- return runSteps("Cycle", [
104
- [
105
- "yarn",
106
- [
107
- "eslint",
108
- ...rules.flatMap((rule) => [
109
- "--rule",
110
- rule
111
- ]),
112
- "--cache",
113
- "."
114
- ]
115
- ]
20
+ });
21
+ const results = await eslint.lintFiles([
22
+ "src/**/*.ts*",
23
+ "packages/**/src/**/*.ts*"
116
24
  ]);
25
+ const formatter = await eslint.loadFormatter("stylish");
26
+ const resultText = formatter.format(results, {
27
+ cwd: cwd(),
28
+ rulesMeta: {}
29
+ });
30
+ console.log(resultText);
31
+ return results.length;
117
32
  }, "cycle");
118
33
  export {
119
34
  cycle
@@ -1 +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/cycle.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 !== undefined && ex.message !== undefined,\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>(ex: unknown, closure: (error: T) => number) => {\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 { spawnSync, SpawnSyncOptionsWithBufferEncoding } 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 cycle = () => {\n const rules = ['\"\\'import/no-cycle\\': [1, { maxDepth: 6 }]\"', \"\\\"'import/no-internal-modules': ['off']\\\"\"]\n return runSteps('Cycle', [['yarn', ['eslint', ...rules.flatMap(rule => ['--rule', rule]), '--cache', '.']]])\n}\n"],"mappings":"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","names":["chalk","checkResult","name","result","level","exitOnFail","exiting","chalkFunc","chalk","red","yellow","console","process","exit","chalk","withError","ex","closure","predicate","name","undefined","message","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","cycle","rules","runSteps","flatMap","rule"]}
1
+ {"version":3,"sources":["../../src/actions/cycle.ts"],"sourcesContent":["import { cwd } from 'node:process'\n\nimport { ESLint } from 'eslint'\n\nexport const cycle = async () => {\n const eslint = new ESLint({ fix: false, overrideConfig: {\n rules: {\n 'import/no-cycle': ['error', { maxDepth: 10 }],\n },\n } })\n const results = await eslint.lintFiles(['src/**/*.ts*', 'packages/**/src/**/*.ts*'])\n\n const formatter = await eslint.loadFormatter('stylish')\n const resultText = formatter.format(results, { cwd: cwd(), rulesMeta: {} })\n console.log(resultText)\n\n return results.length\n}\n"],"mappings":";;;;AAAA,SAASA,WAAW;AAEpB,SAASC,cAAc;AAEhB,IAAMC,QAAQ,mCAAA;AACnB,QAAMC,SAAS,IAAIC,OAAO;IAAEC,KAAK;IAAOC,gBAAgB;MACtDC,OAAO;QACL,mBAAmB;UAAC;UAAS;YAAEC,UAAU;UAAG;;MAC9C;IACF;EAAE,CAAA;AACF,QAAMC,UAAU,MAAMN,OAAOO,UAAU;IAAC;IAAgB;GAA2B;AAEnF,QAAMC,YAAY,MAAMR,OAAOS,cAAc,SAAA;AAC7C,QAAMC,aAAaF,UAAUG,OAAOL,SAAS;IAAEM,KAAKA,IAAAA;IAAOC,WAAW,CAAC;EAAE,CAAA;AACzEC,UAAQC,IAAIL,UAAAA;AAEZ,SAAOJ,QAAQU;AACjB,GAbqB;","names":["cwd","ESLint","cycle","eslint","ESLint","fix","overrideConfig","rules","maxDepth","results","lintFiles","formatter","loadFormatter","resultText","format","cwd","rulesMeta","console","log","length"]}
@@ -292,7 +292,7 @@ var mergeEntries = /* @__PURE__ */ __name((a, b) => [
292
292
  ].sort(), "mergeEntries");
293
293
  var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
294
294
  console.log(chalk4.green(`Generate ${filename3} Files`));
295
- const cwd3 = INIT_CWD() ?? ".";
295
+ const cwd4 = INIT_CWD() ?? ".";
296
296
  const workspaces = pkg ? [
297
297
  yarnWorkspace(pkg)
298
298
  ] : yarnWorkspaces();
@@ -300,7 +300,7 @@ var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
300
300
  const writeEntries = /* @__PURE__ */ __name((location, entries) => writeLines(`${location}/${filename3}`, entries), "writeEntries");
301
301
  const results = workspaces.map(({ location, name }) => {
302
302
  try {
303
- writeEntries(location, mergeEntries(readEntries(cwd3), readEntries(location)));
303
+ writeEntries(location, mergeEntries(readEntries(cwd4), readEntries(location)));
304
304
  return 0;
305
305
  } catch (ex) {
306
306
  const error = ex;
@@ -678,25 +678,33 @@ var copyAssets = /* @__PURE__ */ __name(async ({ target, pkg }) => {
678
678
  }, "copyAssets");
679
679
 
680
680
  // src/actions/cycle.ts
681
- var cycle = /* @__PURE__ */ __name(() => {
682
- const rules = [
683
- `"'import/no-cycle': [1, { maxDepth: 6 }]"`,
684
- `"'import/no-internal-modules': ['off']"`
685
- ];
686
- return runSteps("Cycle", [
687
- [
688
- "yarn",
689
- [
690
- "eslint",
691
- ...rules.flatMap((rule) => [
692
- "--rule",
693
- rule
694
- ]),
695
- "--cache",
696
- "."
697
- ]
698
- ]
681
+ import { cwd } from "node:process";
682
+ import { ESLint } from "eslint";
683
+ var cycle = /* @__PURE__ */ __name(async () => {
684
+ const eslint = new ESLint({
685
+ fix: false,
686
+ overrideConfig: {
687
+ rules: {
688
+ "import/no-cycle": [
689
+ "error",
690
+ {
691
+ maxDepth: 10
692
+ }
693
+ ]
694
+ }
695
+ }
696
+ });
697
+ const results = await eslint.lintFiles([
698
+ "src/**/*.ts*",
699
+ "packages/**/src/**/*.ts*"
699
700
  ]);
701
+ const formatter = await eslint.loadFormatter("stylish");
702
+ const resultText = formatter.format(results, {
703
+ cwd: cwd(),
704
+ rulesMeta: {}
705
+ });
706
+ console.log(resultText);
707
+ return results.length;
700
708
  }, "cycle");
701
709
 
702
710
  // src/actions/dead.ts
@@ -1109,7 +1117,7 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
1109
1117
 
1110
1118
  // src/actions/lint.ts
1111
1119
  import chalk17 from "chalk";
1112
- import { ESLint } from "eslint";
1120
+ import { ESLint as ESLint2 } from "eslint";
1113
1121
  var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
1114
1122
  const colors = [
1115
1123
  "white",
@@ -1136,7 +1144,7 @@ var lintPackage = /* @__PURE__ */ __name(async ({ pkg }) => {
1136
1144
  console.error(chalk17.red(`Unable to locate package [${chalk17.magenta(pkg)}]`));
1137
1145
  process.exit(1);
1138
1146
  }
1139
- const engine = new ESLint({
1147
+ const engine = new ESLint2({
1140
1148
  cache: true
1141
1149
  });
1142
1150
  const lintResults = await engine.lintFiles(workspace.location);
@@ -1144,7 +1152,7 @@ var lintPackage = /* @__PURE__ */ __name(async ({ pkg }) => {
1144
1152
  return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
1145
1153
  }, "lintPackage");
1146
1154
  var lintAll = /* @__PURE__ */ __name(async () => {
1147
- const engine = new ESLint({
1155
+ const engine = new ESLint2({
1148
1156
  cache: true
1149
1157
  });
1150
1158
  const lintResults = await engine.lintFiles("./**/*.*");
@@ -1298,7 +1306,7 @@ var packagePublint = /* @__PURE__ */ __name(async (params) => {
1298
1306
  }, "packagePublint");
1299
1307
 
1300
1308
  // src/actions/package/compile/packageCompileTsc.ts
1301
- import { cwd } from "node:process";
1309
+ import { cwd as cwd2 } from "node:process";
1302
1310
  import chalk21 from "chalk";
1303
1311
  import { createProgramFromConfig } from "tsc-prog";
1304
1312
  import { DiagnosticCategory, formatDiagnosticsWithColorAndContext, getLineAndCharacterOfPosition, getPreEmitDiagnostics } from "typescript";
@@ -1330,7 +1338,7 @@ var getCompilerOptions = /* @__PURE__ */ __name((options, tsconfig = "tsconfig.j
1330
1338
 
1331
1339
  // src/actions/package/compile/packageCompileTsc.ts
1332
1340
  var packageCompileTsc = /* @__PURE__ */ __name(async (noEmit, config2, compilerOptionsParam) => {
1333
- const pkg = process.env.INIT_CWD ?? cwd();
1341
+ const pkg = process.env.INIT_CWD ?? cwd2();
1334
1342
  const publint2 = config2?.publint ?? true;
1335
1343
  const verbose = config2?.verbose ?? false;
1336
1344
  const formatHost = {
@@ -1353,7 +1361,7 @@ var packageCompileTsc = /* @__PURE__ */ __name(async (noEmit, config2, compilerO
1353
1361
  }
1354
1362
  };
1355
1363
  const program = createProgramFromConfig({
1356
- basePath: pkg ?? cwd(),
1364
+ basePath: pkg ?? cwd2(),
1357
1365
  compilerOptions,
1358
1366
  exclude: [
1359
1367
  "dist",
@@ -1606,7 +1614,7 @@ var packageCopyAssets = /* @__PURE__ */ __name(async ({ target }) => {
1606
1614
 
1607
1615
  // src/actions/package/deps.ts
1608
1616
  import { existsSync as existsSync4, readFileSync as readFileSync3 } from "node:fs";
1609
- import { cwd as cwd2 } from "node:process";
1617
+ import { cwd as cwd3 } from "node:process";
1610
1618
  import chalk24 from "chalk";
1611
1619
  import depcheck from "depcheck";
1612
1620
  var special = depcheck.special;
@@ -1703,7 +1711,7 @@ var analyzeDeps = /* @__PURE__ */ __name(async (pkg, ignoreMatches) => {
1703
1711
  };
1704
1712
  }, "analyzeDeps");
1705
1713
  var packageDeps = /* @__PURE__ */ __name(async () => {
1706
- const pkg = process.env.INIT_CWD ?? cwd2();
1714
+ const pkg = process.env.INIT_CWD ?? cwd3();
1707
1715
  const pkgName = process.env.npm_package_name;
1708
1716
  const packageContent = existsSync4(`${pkg}/package.json`) ? JSON.parse(readFileSync3(`${pkg}/package.json`, {
1709
1717
  encoding: "utf8"