@xylabs/ts-scripts-yarn3 4.0.7 → 4.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/cycle.mjs +1 -5
- package/dist/actions/cycle.mjs.map +1 -1
- package/dist/actions/index.mjs +11 -15
- package/dist/actions/index.mjs.map +1 -1
- package/dist/bin/xy-ts.mjs +3 -7
- package/dist/bin/xy-ts.mjs.map +1 -1
- package/dist/bin/xy.mjs +3 -7
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.mjs +11 -15
- package/dist/index.mjs.map +1 -1
- package/dist/xy/index.mjs +3 -7
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/xy.mjs +3 -7
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyLintCommands.mjs +1 -5
- package/dist/xy/xyLintCommands.mjs.map +1 -1
- package/package.json +23 -25
- package/src/actions/cycle.ts +1 -3
package/dist/actions/cycle.mjs
CHANGED
|
@@ -2,7 +2,6 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
|
|
4
4
|
// src/actions/cycle.ts
|
|
5
|
-
import { cwd } from "node:process";
|
|
6
5
|
import { ESLint } from "eslint";
|
|
7
6
|
var cycle = /* @__PURE__ */ __name(async () => {
|
|
8
7
|
const eslint = new ESLint({
|
|
@@ -23,10 +22,7 @@ var cycle = /* @__PURE__ */ __name(async () => {
|
|
|
23
22
|
"packages/**/src/**/*.ts*"
|
|
24
23
|
]);
|
|
25
24
|
const formatter = await eslint.loadFormatter("stylish");
|
|
26
|
-
const resultText = formatter.format(results
|
|
27
|
-
cwd: cwd(),
|
|
28
|
-
rulesMeta: {}
|
|
29
|
-
});
|
|
25
|
+
const resultText = formatter.format(results);
|
|
30
26
|
console.log(resultText);
|
|
31
27
|
return results.length;
|
|
32
28
|
}, "cycle");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/actions/cycle.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../src/actions/cycle.ts"],"sourcesContent":["import { ESLint } from 'eslint'\n\nexport const cycle = async () => {\n const eslint = new ESLint({\n fix: false,\n overrideConfig: { rules: { 'import-x/no-cycle': ['error', { maxDepth: 10 }] } },\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)\n console.log(resultText)\n\n return results.length\n}\n"],"mappings":";;;;AAAA,SAASA,cAAc;AAEhB,IAAMC,QAAQ,mCAAA;AACnB,QAAMC,SAAS,IAAIC,OAAO;IACxBC,KAAK;IACLC,gBAAgB;MAAEC,OAAO;QAAE,qBAAqB;UAAC;UAAS;YAAEC,UAAU;UAAG;;MAAG;IAAE;EAChF,CAAA;AACA,QAAMC,UAAU,MAAMN,OAAOO,UAAU;IAAC;IAAgB;GAA2B;AAEnF,QAAMC,YAAY,MAAMR,OAAOS,cAAc,SAAA;AAC7C,QAAMC,aAAaF,UAAUG,OAAOL,OAAAA;AACpCM,UAAQC,IAAIH,UAAAA;AAEZ,SAAOJ,QAAQQ;AACjB,GAZqB;","names":["ESLint","cycle","eslint","ESLint","fix","overrideConfig","rules","maxDepth","results","lintFiles","formatter","loadFormatter","resultText","format","console","log","length"]}
|
package/dist/actions/index.mjs
CHANGED
|
@@ -446,7 +446,7 @@ var mergeEntries = /* @__PURE__ */ __name((a, b) => [
|
|
|
446
446
|
].sort(), "mergeEntries");
|
|
447
447
|
var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
|
|
448
448
|
console.log(chalk4.green(`Generate ${filename3} Files`));
|
|
449
|
-
const
|
|
449
|
+
const cwd4 = INIT_CWD() ?? ".";
|
|
450
450
|
const workspaces = pkg ? [
|
|
451
451
|
yarnWorkspace(pkg)
|
|
452
452
|
] : yarnWorkspaces();
|
|
@@ -454,7 +454,7 @@ var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
|
|
|
454
454
|
const writeEntries = /* @__PURE__ */ __name((location, entries) => writeLines(`${location}/${filename3}`, entries), "writeEntries");
|
|
455
455
|
const results = workspaces.map(({ location, name }) => {
|
|
456
456
|
try {
|
|
457
|
-
writeEntries(location, mergeEntries(readEntries(
|
|
457
|
+
writeEntries(location, mergeEntries(readEntries(cwd4), readEntries(location)));
|
|
458
458
|
return 0;
|
|
459
459
|
} catch (ex) {
|
|
460
460
|
const error = ex;
|
|
@@ -833,7 +833,6 @@ var copyAssets = /* @__PURE__ */ __name(async ({ target, pkg }) => {
|
|
|
833
833
|
}, "copyAssets");
|
|
834
834
|
|
|
835
835
|
// src/actions/cycle.ts
|
|
836
|
-
import { cwd } from "node:process";
|
|
837
836
|
import { ESLint } from "eslint";
|
|
838
837
|
var cycle = /* @__PURE__ */ __name(async () => {
|
|
839
838
|
const eslint = new ESLint({
|
|
@@ -854,10 +853,7 @@ var cycle = /* @__PURE__ */ __name(async () => {
|
|
|
854
853
|
"packages/**/src/**/*.ts*"
|
|
855
854
|
]);
|
|
856
855
|
const formatter = await eslint.loadFormatter("stylish");
|
|
857
|
-
const resultText = formatter.format(results
|
|
858
|
-
cwd: cwd(),
|
|
859
|
-
rulesMeta: {}
|
|
860
|
-
});
|
|
856
|
+
const resultText = formatter.format(results);
|
|
861
857
|
console.log(resultText);
|
|
862
858
|
return results.length;
|
|
863
859
|
}, "cycle");
|
|
@@ -1462,7 +1458,7 @@ var packagePublint = /* @__PURE__ */ __name(async (params) => {
|
|
|
1462
1458
|
}, "packagePublint");
|
|
1463
1459
|
|
|
1464
1460
|
// src/actions/package/compile/packageCompileTsc.ts
|
|
1465
|
-
import { cwd
|
|
1461
|
+
import { cwd } from "node:process";
|
|
1466
1462
|
import chalk21 from "chalk";
|
|
1467
1463
|
import { createProgramFromConfig } from "tsc-prog";
|
|
1468
1464
|
import { DiagnosticCategory, formatDiagnosticsWithColorAndContext, getLineAndCharacterOfPosition, getPreEmitDiagnostics } from "typescript";
|
|
@@ -1491,7 +1487,7 @@ var getCompilerOptions = /* @__PURE__ */ __name((options = {}, tsconfig = "tscon
|
|
|
1491
1487
|
|
|
1492
1488
|
// src/actions/package/compile/packageCompileTsc.ts
|
|
1493
1489
|
var packageCompileTsc = /* @__PURE__ */ __name(async (noEmit, config2, compilerOptionsParam) => {
|
|
1494
|
-
const pkg = process.env.INIT_CWD ??
|
|
1490
|
+
const pkg = process.env.INIT_CWD ?? cwd();
|
|
1495
1491
|
const publint2 = config2?.publint ?? true;
|
|
1496
1492
|
const verbose = config2?.verbose ?? false;
|
|
1497
1493
|
const formatHost = {
|
|
@@ -1514,7 +1510,7 @@ var packageCompileTsc = /* @__PURE__ */ __name(async (noEmit, config2, compilerO
|
|
|
1514
1510
|
}
|
|
1515
1511
|
};
|
|
1516
1512
|
const program = createProgramFromConfig({
|
|
1517
|
-
basePath: pkg ??
|
|
1513
|
+
basePath: pkg ?? cwd(),
|
|
1518
1514
|
compilerOptions,
|
|
1519
1515
|
exclude: [
|
|
1520
1516
|
"dist",
|
|
@@ -1581,12 +1577,12 @@ var buildEntries = /* @__PURE__ */ __name((folder, entryMode, verbose = false) =
|
|
|
1581
1577
|
}, "buildEntries");
|
|
1582
1578
|
|
|
1583
1579
|
// src/actions/package/compile/packageCompileTscTypes.ts
|
|
1584
|
-
import { cwd as
|
|
1580
|
+
import { cwd as cwd2 } from "node:process";
|
|
1585
1581
|
import chalk22 from "chalk";
|
|
1586
1582
|
import { createProgramFromConfig as createProgramFromConfig2 } from "tsc-prog";
|
|
1587
1583
|
import { DiagnosticCategory as DiagnosticCategory2 } from "typescript";
|
|
1588
1584
|
var packageCompileTscTypes = /* @__PURE__ */ __name((folder = "src", { verbose } = {}, compilerOptionsParam) => {
|
|
1589
|
-
const pkg = process.env.INIT_CWD ??
|
|
1585
|
+
const pkg = process.env.INIT_CWD ?? cwd2();
|
|
1590
1586
|
if (verbose) {
|
|
1591
1587
|
console.log(`Compiling types with TSC [${pkg}]`);
|
|
1592
1588
|
}
|
|
@@ -1604,7 +1600,7 @@ var packageCompileTscTypes = /* @__PURE__ */ __name((folder = "src", { verbose }
|
|
|
1604
1600
|
};
|
|
1605
1601
|
const files = buildEntries(folder, "all");
|
|
1606
1602
|
const result = createProgramFromConfig2({
|
|
1607
|
-
basePath: pkg ??
|
|
1603
|
+
basePath: pkg ?? cwd2(),
|
|
1608
1604
|
compilerOptions,
|
|
1609
1605
|
exclude: [
|
|
1610
1606
|
"dist",
|
|
@@ -1836,7 +1832,7 @@ var packageCopyAssets = /* @__PURE__ */ __name(async ({ target }) => {
|
|
|
1836
1832
|
|
|
1837
1833
|
// src/actions/package/deps.ts
|
|
1838
1834
|
import { existsSync as existsSync4, readFileSync as readFileSync3 } from "node:fs";
|
|
1839
|
-
import { cwd as
|
|
1835
|
+
import { cwd as cwd3 } from "node:process";
|
|
1840
1836
|
import chalk25 from "chalk";
|
|
1841
1837
|
import depcheck from "depcheck";
|
|
1842
1838
|
var special = depcheck.special;
|
|
@@ -1933,7 +1929,7 @@ var analyzeDeps = /* @__PURE__ */ __name(async (pkg, ignoreMatches) => {
|
|
|
1933
1929
|
};
|
|
1934
1930
|
}, "analyzeDeps");
|
|
1935
1931
|
var packageDeps = /* @__PURE__ */ __name(async () => {
|
|
1936
|
-
const pkg = process.env.INIT_CWD ??
|
|
1932
|
+
const pkg = process.env.INIT_CWD ?? cwd3();
|
|
1937
1933
|
const pkgName = process.env.npm_package_name;
|
|
1938
1934
|
const packageContent = existsSync4(`${pkg}/package.json`) ? JSON.parse(readFileSync3(`${pkg}/package.json`, {
|
|
1939
1935
|
encoding: "utf8"
|