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

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,41 @@
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
+ import importPlugin from "eslint-plugin-import";
8
+ var cycle = /* @__PURE__ */ __name(async () => {
9
+ const eslint = new ESLint({
10
+ fix: false,
11
+ overrideConfig: {
12
+ plugins: {
13
+ import: importPlugin
14
+ },
15
+ rules: {
16
+ "import/no-cycle": [
17
+ "error",
18
+ {
19
+ maxDepth: 10
20
+ }
21
+ ]
79
22
  }
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
23
  }
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
- ]
24
+ });
25
+ const configFile = await eslint.findConfigFile();
26
+ console.log("Config file:", configFile);
27
+ const results = await eslint.lintFiles([
28
+ "src/**/*.ts*",
29
+ "packages/**/src/**/*.ts*"
116
30
  ]);
31
+ const formatter = await eslint.loadFormatter("stylish");
32
+ const resultText = formatter.format(results, {
33
+ cwd: cwd(),
34
+ rulesMeta: {}
35
+ });
36
+ console.log(resultText);
37
+ console.log("Lint Errors:", results.length);
38
+ return results.length;
117
39
  }, "cycle");
118
40
  export {
119
41
  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":";;;;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,QAAUA,IAAGG,SAASC,UAAaJ,IAAGK,YAAYD,WAAS;AAExE,SAAOF,UAAUF,EAAAA,IAAWC,QAAQD,EAAAA,IAAWI;AACjD,GAPyB;;;ACElB,IAAME,qBAAqB,wBAA0DC,IAAaC,YAAAA;AACvG,SAAOC,UAAaF,IAAIC,SAAS,CAACD,QAAiBA,IAA6BG,UAAUC,MAAAA;AAC5F,GAFkC;;;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;EACxB,CAAA,KACGC,UAAUV,OAAO,CAACA,WAAAA;AACnBK,YAAQL,MAAMM,OAAMC,IAAI,GAAGP,OAAMW,IAAI,KAAKX,OAAMY,OAAO,EAAE,CAAA;AACzD,WAAO;EACT,CAAA,MACI,MAAA;AACFP,YAAQL,MAAMM,OAAMC,IAAI,qBAAqBM,KAAKC,UAAUf,IAAI,MAAM,CAAA,CAAA,EAAI,CAAA;AAC1E,WAAO;EACT,GAAA;AAEFgB,UAAQC,KAAKD,QAAQb,YAAYA,QAAAA;AACnC,GArByB;;;AGDzB,IAAMe,WAAW,wBAACC,MAAoBC,aAAa,SAAI;AACrD,MAAI;AACF,UAAMC,SAASF,KAAAA;AACf,QAAIE,UAAUD,YAAY;AACxBE,cAAQC,KAAKF,MAAAA;IACf;AACA,WAAOA;EACT,SAASG,IAAI;AACX,WAAOC,UAAUD,EAAAA;EACnB;AACF,GAViB;;;ACJjB,SAASE,iBAAqD;AAC9D,SAASC,kBAAkB;AAE3B,OAAOC,YAAW;AASX,IAAMC,WAAW,wBAACC,MAAcC,OAAqBC,aAAa,MAAMC,aAAAA;AAC7E,SAAOC,SAAS,MAAA;AACd,UAAMC,UAAUC,QAAQC,IAAIC;AAC5BC,YAAQC,IAAIC,OAAMC,MAAM,GAAGZ,IAAAA,KAASK,OAAAA,GAAU,CAAA;AAC9C,QAAIQ,cAAc;AAClB,eAAW,CAACC,GAAG,CAACC,SAASC,MAAMC,MAAAA,CAAO,KAAKhB,MAAMiB,QAAO,GAAI;AAC1D,UAAIf,WAAWW,CAAAA,GAAI;AACjBL,gBAAQC,IAAIC,OAAMQ,KAAKhB,WAAWW,CAAAA,CAAE,CAAA;MACtC;AACA,YAAMM,UAAUC,MAAMC,QAAQN,IAAAA,IAAQA,OAAOA,KAAKO,MAAM,GAAA;AACxD,UAAIR,YAAY,UAAU,CAACS,WAAWJ,QAAQ,CAAA,CAAE,GAAG;AACjD,cAAM,IAAIK,MAAM,mBAAmBL,QAAQ,CAAA,CAAE,GAAG;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;;;ACVjB,IAAM+B,QAAQ,6BAAA;AACnB,QAAMC,QAAQ;IAAC;IAA+C;;AAC9D,SAAOC,SAAS,SAAS;IAAC;MAAC;MAAQ;QAAC;WAAaD,MAAME,QAAQC,CAAAA,SAAQ;UAAC;UAAUA;SAAK;QAAG;QAAW;;;GAAM;AAC7G,GAHqB;","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'\nimport importPlugin from 'eslint-plugin-import'\n\nexport const cycle = async () => {\n const eslint = new ESLint({ fix: false, overrideConfig: {\n plugins: { import: importPlugin },\n rules: {\n 'import/no-cycle': ['error', { maxDepth: 10 }],\n },\n } })\n const configFile = await eslint.findConfigFile()\n console.log('Config file:', configFile)\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 console.log('Lint Errors:', results.length)\n return results.length\n}\n"],"mappings":";;;;AAAA,SAASA,WAAW;AAEpB,SAASC,cAAc;AACvB,OAAOC,kBAAkB;AAElB,IAAMC,QAAQ,mCAAA;AACnB,QAAMC,SAAS,IAAIC,OAAO;IAAEC,KAAK;IAAOC,gBAAgB;MACtDC,SAAS;QAAEC,QAAQC;MAAa;MAChCC,OAAO;QACL,mBAAmB;UAAC;UAAS;YAAEC,UAAU;UAAG;;MAC9C;IACF;EAAE,CAAA;AACF,QAAMC,aAAa,MAAMT,OAAOU,eAAc;AAC9CC,UAAQC,IAAI,gBAAgBH,UAAAA;AAC5B,QAAMI,UAAU,MAAMb,OAAOc,UAAU;IAAC;IAAgB;GAA2B;AAEnF,QAAMC,YAAY,MAAMf,OAAOgB,cAAc,SAAA;AAC7C,QAAMC,aAAaF,UAAUG,OAAOL,SAAS;IAAEM,KAAKA,IAAAA;IAAOC,WAAW,CAAC;EAAE,CAAA;AACzET,UAAQC,IAAIK,UAAAA;AAEZN,UAAQC,IAAI,gBAAgBC,QAAQQ,MAAM;AAC1C,SAAOR,QAAQQ;AACjB,GAjBqB;","names":["cwd","ESLint","importPlugin","cycle","eslint","ESLint","fix","overrideConfig","plugins","import","importPlugin","rules","maxDepth","configFile","findConfigFile","console","log","results","lintFiles","formatter","loadFormatter","resultText","format","cwd","rulesMeta","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,40 @@ 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
+ import importPlugin from "eslint-plugin-import";
684
+ var cycle = /* @__PURE__ */ __name(async () => {
685
+ const eslint = new ESLint({
686
+ fix: false,
687
+ overrideConfig: {
688
+ plugins: {
689
+ import: importPlugin
690
+ },
691
+ rules: {
692
+ "import/no-cycle": [
693
+ "error",
694
+ {
695
+ maxDepth: 10
696
+ }
697
+ ]
698
+ }
699
+ }
700
+ });
701
+ const configFile = await eslint.findConfigFile();
702
+ console.log("Config file:", configFile);
703
+ const results = await eslint.lintFiles([
704
+ "src/**/*.ts*",
705
+ "packages/**/src/**/*.ts*"
699
706
  ]);
707
+ const formatter = await eslint.loadFormatter("stylish");
708
+ const resultText = formatter.format(results, {
709
+ cwd: cwd(),
710
+ rulesMeta: {}
711
+ });
712
+ console.log(resultText);
713
+ console.log("Lint Errors:", results.length);
714
+ return results.length;
700
715
  }, "cycle");
701
716
 
702
717
  // src/actions/dead.ts
@@ -1109,7 +1124,7 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
1109
1124
 
1110
1125
  // src/actions/lint.ts
1111
1126
  import chalk17 from "chalk";
1112
- import { ESLint } from "eslint";
1127
+ import { ESLint as ESLint2 } from "eslint";
1113
1128
  var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
1114
1129
  const colors = [
1115
1130
  "white",
@@ -1136,7 +1151,7 @@ var lintPackage = /* @__PURE__ */ __name(async ({ pkg }) => {
1136
1151
  console.error(chalk17.red(`Unable to locate package [${chalk17.magenta(pkg)}]`));
1137
1152
  process.exit(1);
1138
1153
  }
1139
- const engine = new ESLint({
1154
+ const engine = new ESLint2({
1140
1155
  cache: true
1141
1156
  });
1142
1157
  const lintResults = await engine.lintFiles(workspace.location);
@@ -1144,7 +1159,7 @@ var lintPackage = /* @__PURE__ */ __name(async ({ pkg }) => {
1144
1159
  return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
1145
1160
  }, "lintPackage");
1146
1161
  var lintAll = /* @__PURE__ */ __name(async () => {
1147
- const engine = new ESLint({
1162
+ const engine = new ESLint2({
1148
1163
  cache: true
1149
1164
  });
1150
1165
  const lintResults = await engine.lintFiles("./**/*.*");
@@ -1298,7 +1313,7 @@ var packagePublint = /* @__PURE__ */ __name(async (params) => {
1298
1313
  }, "packagePublint");
1299
1314
 
1300
1315
  // src/actions/package/compile/packageCompileTsc.ts
1301
- import { cwd } from "node:process";
1316
+ import { cwd as cwd2 } from "node:process";
1302
1317
  import chalk21 from "chalk";
1303
1318
  import { createProgramFromConfig } from "tsc-prog";
1304
1319
  import { DiagnosticCategory, formatDiagnosticsWithColorAndContext, getLineAndCharacterOfPosition, getPreEmitDiagnostics } from "typescript";
@@ -1330,7 +1345,7 @@ var getCompilerOptions = /* @__PURE__ */ __name((options, tsconfig = "tsconfig.j
1330
1345
 
1331
1346
  // src/actions/package/compile/packageCompileTsc.ts
1332
1347
  var packageCompileTsc = /* @__PURE__ */ __name(async (noEmit, config2, compilerOptionsParam) => {
1333
- const pkg = process.env.INIT_CWD ?? cwd();
1348
+ const pkg = process.env.INIT_CWD ?? cwd2();
1334
1349
  const publint2 = config2?.publint ?? true;
1335
1350
  const verbose = config2?.verbose ?? false;
1336
1351
  const formatHost = {
@@ -1353,7 +1368,7 @@ var packageCompileTsc = /* @__PURE__ */ __name(async (noEmit, config2, compilerO
1353
1368
  }
1354
1369
  };
1355
1370
  const program = createProgramFromConfig({
1356
- basePath: pkg ?? cwd(),
1371
+ basePath: pkg ?? cwd2(),
1357
1372
  compilerOptions,
1358
1373
  exclude: [
1359
1374
  "dist",
@@ -1606,7 +1621,7 @@ var packageCopyAssets = /* @__PURE__ */ __name(async ({ target }) => {
1606
1621
 
1607
1622
  // src/actions/package/deps.ts
1608
1623
  import { existsSync as existsSync4, readFileSync as readFileSync3 } from "node:fs";
1609
- import { cwd as cwd2 } from "node:process";
1624
+ import { cwd as cwd3 } from "node:process";
1610
1625
  import chalk24 from "chalk";
1611
1626
  import depcheck from "depcheck";
1612
1627
  var special = depcheck.special;
@@ -1703,7 +1718,7 @@ var analyzeDeps = /* @__PURE__ */ __name(async (pkg, ignoreMatches) => {
1703
1718
  };
1704
1719
  }, "analyzeDeps");
1705
1720
  var packageDeps = /* @__PURE__ */ __name(async () => {
1706
- const pkg = process.env.INIT_CWD ?? cwd2();
1721
+ const pkg = process.env.INIT_CWD ?? cwd3();
1707
1722
  const pkgName = process.env.npm_package_name;
1708
1723
  const packageContent = existsSync4(`${pkg}/package.json`) ? JSON.parse(readFileSync3(`${pkg}/package.json`, {
1709
1724
  encoding: "utf8"