@xylabs/ts-scripts-yarn3 7.4.26 → 7.4.28
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/index.mjs +333 -88
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/lintlint.mjs +230 -0
- package/dist/actions/lintlint.mjs.map +1 -0
- package/dist/actions/retest.mjs +27 -5
- package/dist/actions/retest.mjs.map +1 -1
- package/dist/actions/test.mjs +23 -4
- package/dist/actions/test.mjs.map +1 -1
- package/dist/bin/xy.mjs +331 -61
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +15 -3
- package/dist/index.mjs +387 -116
- package/dist/index.mjs.map +1 -1
- package/dist/xy/common/index.mjs +36 -13
- package/dist/xy/common/index.mjs.map +1 -1
- package/dist/xy/common/retestCommand.mjs +34 -9
- package/dist/xy/common/retestCommand.mjs.map +1 -1
- package/dist/xy/common/testCommand.mjs +30 -8
- package/dist/xy/common/testCommand.mjs.map +1 -1
- package/dist/xy/index.mjs +331 -61
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/lint/index.mjs +285 -38
- package/dist/xy/lint/index.mjs.map +1 -1
- package/dist/xy/lint/lintlintCommand.mjs +250 -0
- package/dist/xy/lint/lintlintCommand.mjs.map +1 -0
- package/dist/xy/xy.mjs +331 -61
- package/dist/xy/xy.mjs.map +1 -1
- package/package.json +2 -2
package/dist/actions/index.mjs
CHANGED
|
@@ -2417,18 +2417,245 @@ var license = async (pkg) => {
|
|
|
2417
2417
|
)).reduce((prev, value) => prev || value, 0);
|
|
2418
2418
|
};
|
|
2419
2419
|
|
|
2420
|
+
// src/actions/lintlint.ts
|
|
2421
|
+
import { readFileSync as readFileSync13, writeFileSync as writeFileSync6 } from "fs";
|
|
2422
|
+
import PATH9 from "path";
|
|
2423
|
+
import chalk30 from "chalk";
|
|
2424
|
+
import { findUp } from "find-up";
|
|
2425
|
+
function parseRuleValue(value) {
|
|
2426
|
+
if (typeof value === "string") {
|
|
2427
|
+
return { level: value };
|
|
2428
|
+
}
|
|
2429
|
+
if (typeof value === "number") {
|
|
2430
|
+
return { level: String(value) };
|
|
2431
|
+
}
|
|
2432
|
+
if (Array.isArray(value) && value.length > 0) {
|
|
2433
|
+
return {
|
|
2434
|
+
level: String(value[0]),
|
|
2435
|
+
options: value.length > 1 ? value.slice(1) : void 0
|
|
2436
|
+
};
|
|
2437
|
+
}
|
|
2438
|
+
return void 0;
|
|
2439
|
+
}
|
|
2440
|
+
function normalizeLevel(level) {
|
|
2441
|
+
if (level === "0" || level === "off") return "off";
|
|
2442
|
+
if (level === "1" || level === "warn") return "warn";
|
|
2443
|
+
if (level === "2" || level === "error") return "error";
|
|
2444
|
+
return level;
|
|
2445
|
+
}
|
|
2446
|
+
function rulesMatch(a, b) {
|
|
2447
|
+
if (normalizeLevel(a.level) !== normalizeLevel(b.level)) return false;
|
|
2448
|
+
return JSON.stringify(a.options) === JSON.stringify(b.options);
|
|
2449
|
+
}
|
|
2450
|
+
function formatRule(entry) {
|
|
2451
|
+
if (entry.options) {
|
|
2452
|
+
return JSON.stringify([entry.level, ...entry.options]);
|
|
2453
|
+
}
|
|
2454
|
+
return JSON.stringify([entry.level]);
|
|
2455
|
+
}
|
|
2456
|
+
function mergeRulesFromBlocks(blocks) {
|
|
2457
|
+
const merged = /* @__PURE__ */ new Map();
|
|
2458
|
+
for (const block of blocks) {
|
|
2459
|
+
if (!block.rules) continue;
|
|
2460
|
+
for (const [name, value] of Object.entries(block.rules)) {
|
|
2461
|
+
const parsed = parseRuleValue(value);
|
|
2462
|
+
if (parsed) merged.set(name, parsed);
|
|
2463
|
+
}
|
|
2464
|
+
}
|
|
2465
|
+
return merged;
|
|
2466
|
+
}
|
|
2467
|
+
function detectSharedPackage(source) {
|
|
2468
|
+
if (source.includes("@xylabs/eslint-config-react-flat")) return "@xylabs/eslint-config-react-flat";
|
|
2469
|
+
if (source.includes("@xylabs/eslint-config-flat")) return "@xylabs/eslint-config-flat";
|
|
2470
|
+
return void 0;
|
|
2471
|
+
}
|
|
2472
|
+
function extractLocalRuleBlocks(source) {
|
|
2473
|
+
const blocks = [];
|
|
2474
|
+
const ruleBlockRegex = /\{\s*(?:files\s*:\s*\[.*?\]\s*,\s*)?rules\s*:\s*\{([^}]*(?:\{[^}]*\}[^}]*)*)\}/g;
|
|
2475
|
+
let match;
|
|
2476
|
+
while ((match = ruleBlockRegex.exec(source)) !== null) {
|
|
2477
|
+
blocks.push(match[1]);
|
|
2478
|
+
}
|
|
2479
|
+
return blocks;
|
|
2480
|
+
}
|
|
2481
|
+
function extractRulesFromSourceBlocks(blocks) {
|
|
2482
|
+
const rules2 = /* @__PURE__ */ new Map();
|
|
2483
|
+
for (const block of blocks) {
|
|
2484
|
+
const ruleRegex = /['"]([^'"]+)['"]\s*:\s*(\[[\s\S]*?\](?=\s*,|\s*$))/gm;
|
|
2485
|
+
let match;
|
|
2486
|
+
while ((match = ruleRegex.exec(block)) !== null) {
|
|
2487
|
+
rules2.set(match[1], match[2]);
|
|
2488
|
+
}
|
|
2489
|
+
}
|
|
2490
|
+
return rules2;
|
|
2491
|
+
}
|
|
2492
|
+
async function resolveSharedConfig(configDir, sharedPkg) {
|
|
2493
|
+
try {
|
|
2494
|
+
const sharedModule = await import(sharedPkg);
|
|
2495
|
+
const config2 = sharedModule.config ?? sharedModule.default;
|
|
2496
|
+
if (Array.isArray(config2)) return config2;
|
|
2497
|
+
return [];
|
|
2498
|
+
} catch {
|
|
2499
|
+
const distPath = PATH9.resolve(configDir, "node_modules", sharedPkg, "dist", "node", "index.mjs");
|
|
2500
|
+
try {
|
|
2501
|
+
const sharedModule = await import(distPath);
|
|
2502
|
+
const config2 = sharedModule.config ?? sharedModule.default;
|
|
2503
|
+
if (Array.isArray(config2)) return config2;
|
|
2504
|
+
} catch {
|
|
2505
|
+
const neutralPath = PATH9.resolve(configDir, "node_modules", sharedPkg, "dist", "neutral", "index.mjs");
|
|
2506
|
+
const sharedModule = await import(neutralPath);
|
|
2507
|
+
const config2 = sharedModule.config ?? sharedModule.default;
|
|
2508
|
+
if (Array.isArray(config2)) return config2;
|
|
2509
|
+
}
|
|
2510
|
+
return [];
|
|
2511
|
+
}
|
|
2512
|
+
}
|
|
2513
|
+
async function loadSharedRules(configDir, sharedPkg, verbose) {
|
|
2514
|
+
const sharedBlocks = await resolveSharedConfig(configDir, sharedPkg);
|
|
2515
|
+
const sharedRules = mergeRulesFromBlocks(sharedBlocks);
|
|
2516
|
+
if (verbose) {
|
|
2517
|
+
console.log(chalk30.gray(`Shared config defines ${sharedRules.size} rules`));
|
|
2518
|
+
}
|
|
2519
|
+
if (sharedRules.size === 0) {
|
|
2520
|
+
console.error(chalk30.red("Could not load rules from shared config. Is it installed and built?"));
|
|
2521
|
+
return void 0;
|
|
2522
|
+
}
|
|
2523
|
+
return sharedRules;
|
|
2524
|
+
}
|
|
2525
|
+
async function loadLocalRules(eslintConfigPath, source, verbose) {
|
|
2526
|
+
const localModule = await import(eslintConfigPath);
|
|
2527
|
+
const localConfig = localModule.default ?? localModule;
|
|
2528
|
+
const localBlocks = Array.isArray(localConfig) ? localConfig : [localConfig];
|
|
2529
|
+
const resolved = mergeRulesFromBlocks(localBlocks);
|
|
2530
|
+
const localRuleBlocks = extractLocalRuleBlocks(source);
|
|
2531
|
+
const explicit = extractRulesFromSourceBlocks(localRuleBlocks);
|
|
2532
|
+
if (verbose) {
|
|
2533
|
+
console.log(chalk30.gray(`Local config has ${explicit.size} explicit rule setting(s)`));
|
|
2534
|
+
}
|
|
2535
|
+
return { explicit, resolved };
|
|
2536
|
+
}
|
|
2537
|
+
function compareRules(explicitRuleNames, allResolvedRules, sharedRules) {
|
|
2538
|
+
const redundant = [];
|
|
2539
|
+
const overrides = [];
|
|
2540
|
+
const additions = [];
|
|
2541
|
+
for (const ruleName of explicitRuleNames.keys()) {
|
|
2542
|
+
const resolvedEntry = allResolvedRules.get(ruleName);
|
|
2543
|
+
const sharedEntry = sharedRules.get(ruleName);
|
|
2544
|
+
if (!resolvedEntry) continue;
|
|
2545
|
+
if (!sharedEntry) {
|
|
2546
|
+
additions.push({ local: resolvedEntry, rule: ruleName });
|
|
2547
|
+
} else if (rulesMatch(resolvedEntry, sharedEntry)) {
|
|
2548
|
+
redundant.push({
|
|
2549
|
+
local: resolvedEntry,
|
|
2550
|
+
rule: ruleName,
|
|
2551
|
+
shared: sharedEntry
|
|
2552
|
+
});
|
|
2553
|
+
} else {
|
|
2554
|
+
overrides.push({
|
|
2555
|
+
local: resolvedEntry,
|
|
2556
|
+
rule: ruleName,
|
|
2557
|
+
shared: sharedEntry
|
|
2558
|
+
});
|
|
2559
|
+
}
|
|
2560
|
+
}
|
|
2561
|
+
return {
|
|
2562
|
+
additions,
|
|
2563
|
+
overrides,
|
|
2564
|
+
redundant
|
|
2565
|
+
};
|
|
2566
|
+
}
|
|
2567
|
+
function reportResults({
|
|
2568
|
+
additions,
|
|
2569
|
+
overrides,
|
|
2570
|
+
redundant
|
|
2571
|
+
}, verbose) {
|
|
2572
|
+
if (redundant.length > 0) {
|
|
2573
|
+
console.log(chalk30.yellow(`
|
|
2574
|
+
${redundant.length} redundant rule(s) (same as shared config \u2014 can be removed):`));
|
|
2575
|
+
for (const { rule, local } of redundant) {
|
|
2576
|
+
console.log(chalk30.yellow(` ${rule}: ${formatRule(local)}`));
|
|
2577
|
+
}
|
|
2578
|
+
}
|
|
2579
|
+
if (overrides.length > 0) {
|
|
2580
|
+
console.log(chalk30.cyan(`
|
|
2581
|
+
${overrides.length} rule override(s) (different from shared config):`));
|
|
2582
|
+
for (const {
|
|
2583
|
+
rule,
|
|
2584
|
+
local,
|
|
2585
|
+
shared
|
|
2586
|
+
} of overrides) {
|
|
2587
|
+
console.log(chalk30.cyan(` ${rule}:`));
|
|
2588
|
+
console.log(chalk30.gray(` shared: ${formatRule(shared)}`));
|
|
2589
|
+
console.log(chalk30.white(` local: ${formatRule(local)}`));
|
|
2590
|
+
}
|
|
2591
|
+
}
|
|
2592
|
+
if (additions.length > 0 && verbose) {
|
|
2593
|
+
console.log(chalk30.gray(`
|
|
2594
|
+
${additions.length} local addition(s) (not in shared config):`));
|
|
2595
|
+
for (const { rule, local } of additions) {
|
|
2596
|
+
console.log(chalk30.gray(` ${rule}: ${formatRule(local)}`));
|
|
2597
|
+
}
|
|
2598
|
+
}
|
|
2599
|
+
if (redundant.length === 0 && overrides.length === 0) {
|
|
2600
|
+
console.log(chalk30.green("No redundant or overridden rules found"));
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
function fixRedundantRules(eslintConfigPath, source, redundant) {
|
|
2604
|
+
let updated = source;
|
|
2605
|
+
for (const { rule } of redundant) {
|
|
2606
|
+
const escaped = rule.replaceAll("/", String.raw`\/`);
|
|
2607
|
+
const pattern = new RegExp(String.raw`[ \t]*['"]${escaped}['"]\s*:\s*\[[^\]]*\],?[ \t]*\n?`, "g");
|
|
2608
|
+
updated = updated.replace(pattern, "");
|
|
2609
|
+
}
|
|
2610
|
+
updated = updated.replaceAll(/\n{3,}/g, "\n\n");
|
|
2611
|
+
if (updated !== source) {
|
|
2612
|
+
writeFileSync6(eslintConfigPath, updated, "utf8");
|
|
2613
|
+
console.log(chalk30.green(`
|
|
2614
|
+
Fixed: removed ${redundant.length} redundant rule(s)`));
|
|
2615
|
+
}
|
|
2616
|
+
}
|
|
2617
|
+
async function lintlint({ fix: fix2, verbose } = {}) {
|
|
2618
|
+
const eslintConfigPath = await findUp("eslint.config.mjs");
|
|
2619
|
+
if (!eslintConfigPath) {
|
|
2620
|
+
console.error(chalk30.red("No eslint.config.mjs found"));
|
|
2621
|
+
return 1;
|
|
2622
|
+
}
|
|
2623
|
+
const configDir = PATH9.dirname(eslintConfigPath);
|
|
2624
|
+
if (verbose) {
|
|
2625
|
+
console.log(chalk30.gray(`Found config: ${eslintConfigPath}`));
|
|
2626
|
+
}
|
|
2627
|
+
const source = readFileSync13(eslintConfigPath, "utf8");
|
|
2628
|
+
const sharedPkg = detectSharedPackage(source);
|
|
2629
|
+
if (!sharedPkg) {
|
|
2630
|
+
console.log(chalk30.yellow("No @xylabs/eslint-config-flat or @xylabs/eslint-config-react-flat imports found"));
|
|
2631
|
+
return 0;
|
|
2632
|
+
}
|
|
2633
|
+
if (verbose) {
|
|
2634
|
+
console.log(chalk30.gray(`Shared package: ${sharedPkg}`));
|
|
2635
|
+
}
|
|
2636
|
+
const sharedRules = await loadSharedRules(configDir, sharedPkg, !!verbose);
|
|
2637
|
+
if (!sharedRules) return 1;
|
|
2638
|
+
const { explicit, resolved } = await loadLocalRules(eslintConfigPath, source, !!verbose);
|
|
2639
|
+
const results = compareRules(explicit, resolved, sharedRules);
|
|
2640
|
+
reportResults(results, !!verbose);
|
|
2641
|
+
if (results.redundant.length > 0 && fix2) {
|
|
2642
|
+
fixRedundantRules(eslintConfigPath, source, results.redundant);
|
|
2643
|
+
}
|
|
2644
|
+
return results.redundant.length > 0 && !fix2 ? 1 : 0;
|
|
2645
|
+
}
|
|
2646
|
+
|
|
2420
2647
|
// src/actions/npmignore-gen.ts
|
|
2421
2648
|
var filename = ".npmignore";
|
|
2422
2649
|
var npmignoreGen = (pkg) => generateIgnoreFiles(filename, pkg);
|
|
2423
2650
|
|
|
2424
2651
|
// src/actions/package/clean-outputs.ts
|
|
2425
2652
|
import path8 from "path";
|
|
2426
|
-
import
|
|
2653
|
+
import chalk31 from "chalk";
|
|
2427
2654
|
var packageCleanOutputs = () => {
|
|
2428
2655
|
const pkg = process.env.INIT_CWD ?? ".";
|
|
2429
2656
|
const pkgName = process.env.npm_package_name;
|
|
2430
2657
|
const folders = [path8.join(pkg, "dist"), path8.join(pkg, "build"), path8.join(pkg, "docs")];
|
|
2431
|
-
console.log(
|
|
2658
|
+
console.log(chalk31.green(`Cleaning Outputs [${pkgName}]`));
|
|
2432
2659
|
for (let folder of folders) {
|
|
2433
2660
|
deleteGlob(folder);
|
|
2434
2661
|
}
|
|
@@ -2437,11 +2664,11 @@ var packageCleanOutputs = () => {
|
|
|
2437
2664
|
|
|
2438
2665
|
// src/actions/package/clean-typescript.ts
|
|
2439
2666
|
import path9 from "path";
|
|
2440
|
-
import
|
|
2667
|
+
import chalk32 from "chalk";
|
|
2441
2668
|
var packageCleanTypescript = () => {
|
|
2442
2669
|
const pkg = process.env.INIT_CWD ?? ".";
|
|
2443
2670
|
const pkgName = process.env.npm_package_name;
|
|
2444
|
-
console.log(
|
|
2671
|
+
console.log(chalk32.green(`Cleaning Typescript [${pkgName}]`));
|
|
2445
2672
|
const files = [path9.join(pkg, "*.tsbuildinfo"), path9.join(pkg, ".tsconfig.*"), path9.join(pkg, ".eslintcache")];
|
|
2446
2673
|
for (let file of files) {
|
|
2447
2674
|
deleteGlob(file);
|
|
@@ -2455,26 +2682,26 @@ var packageClean = async () => {
|
|
|
2455
2682
|
};
|
|
2456
2683
|
|
|
2457
2684
|
// src/actions/package/compile/compile.ts
|
|
2458
|
-
import
|
|
2685
|
+
import chalk37 from "chalk";
|
|
2459
2686
|
|
|
2460
2687
|
// src/actions/package/compile/packageCompileTsup.ts
|
|
2461
|
-
import
|
|
2688
|
+
import chalk36 from "chalk";
|
|
2462
2689
|
import { build as build2, defineConfig } from "tsup";
|
|
2463
2690
|
|
|
2464
2691
|
// src/actions/package/compile/inputs.ts
|
|
2465
|
-
import
|
|
2692
|
+
import chalk33 from "chalk";
|
|
2466
2693
|
import { glob as glob2 } from "glob";
|
|
2467
2694
|
var getAllInputs = (srcDir, verbose = false) => {
|
|
2468
2695
|
return [...glob2.sync(`${srcDir}/**/*.ts`, { posix: true }).map((file) => {
|
|
2469
2696
|
const result = file.slice(Math.max(0, srcDir.length + 1));
|
|
2470
2697
|
if (verbose) {
|
|
2471
|
-
console.log(
|
|
2698
|
+
console.log(chalk33.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
|
|
2472
2699
|
}
|
|
2473
2700
|
return result;
|
|
2474
2701
|
}), ...glob2.sync(`${srcDir}/**/*.tsx`, { posix: true }).map((file) => {
|
|
2475
2702
|
const result = file.slice(Math.max(0, srcDir.length + 1));
|
|
2476
2703
|
if (verbose) {
|
|
2477
|
-
console.log(
|
|
2704
|
+
console.log(chalk33.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
|
|
2478
2705
|
}
|
|
2479
2706
|
return result;
|
|
2480
2707
|
})];
|
|
@@ -2536,7 +2763,7 @@ function deepMergeObjects(objects) {
|
|
|
2536
2763
|
|
|
2537
2764
|
// src/actions/package/compile/packageCompileTsc.ts
|
|
2538
2765
|
import { cwd as cwd2 } from "process";
|
|
2539
|
-
import
|
|
2766
|
+
import chalk34 from "chalk";
|
|
2540
2767
|
import { createProgramFromConfig } from "tsc-prog";
|
|
2541
2768
|
import ts3, {
|
|
2542
2769
|
DiagnosticCategory,
|
|
@@ -2558,7 +2785,7 @@ var getCompilerOptions = (options = {}, fileName = "tsconfig.json") => {
|
|
|
2558
2785
|
var packageCompileTsc = (platform, entries, srcDir = "src", outDir = "dist", compilerOptionsParam, verbose = false) => {
|
|
2559
2786
|
const pkg = process.env.INIT_CWD ?? cwd2();
|
|
2560
2787
|
if (verbose) {
|
|
2561
|
-
console.log(
|
|
2788
|
+
console.log(chalk34.cyan(`Validating code START: ${entries.length} files to ${outDir} from ${srcDir}`));
|
|
2562
2789
|
}
|
|
2563
2790
|
const configFilePath = ts3.findConfigFile(
|
|
2564
2791
|
"./",
|
|
@@ -2581,10 +2808,10 @@ var packageCompileTsc = (platform, entries, srcDir = "src", outDir = "dist", com
|
|
|
2581
2808
|
emitDeclarationOnly: true,
|
|
2582
2809
|
noEmit: false
|
|
2583
2810
|
};
|
|
2584
|
-
console.log(
|
|
2811
|
+
console.log(chalk34.cyan(`Validating Files: ${entries.length}`));
|
|
2585
2812
|
if (verbose) {
|
|
2586
2813
|
for (const entry of entries) {
|
|
2587
|
-
console.log(
|
|
2814
|
+
console.log(chalk34.grey(`Validating: ${entry}`));
|
|
2588
2815
|
}
|
|
2589
2816
|
}
|
|
2590
2817
|
try {
|
|
@@ -2620,7 +2847,7 @@ var packageCompileTsc = (platform, entries, srcDir = "src", outDir = "dist", com
|
|
|
2620
2847
|
return 0;
|
|
2621
2848
|
} finally {
|
|
2622
2849
|
if (verbose) {
|
|
2623
|
-
console.log(
|
|
2850
|
+
console.log(chalk34.cyan(`Validating code FINISH: ${entries.length} files to ${outDir} from ${srcDir}`));
|
|
2624
2851
|
}
|
|
2625
2852
|
}
|
|
2626
2853
|
};
|
|
@@ -2628,7 +2855,7 @@ var packageCompileTsc = (platform, entries, srcDir = "src", outDir = "dist", com
|
|
|
2628
2855
|
// src/actions/package/compile/packageCompileTscTypes.ts
|
|
2629
2856
|
import path10 from "path";
|
|
2630
2857
|
import { cwd as cwd3 } from "process";
|
|
2631
|
-
import
|
|
2858
|
+
import chalk35 from "chalk";
|
|
2632
2859
|
import { rollup } from "rollup";
|
|
2633
2860
|
import dts from "rollup-plugin-dts";
|
|
2634
2861
|
import nodeExternals from "rollup-plugin-node-externals";
|
|
@@ -2653,8 +2880,8 @@ async function bundleDts(inputPath, outputPath, platform, options, verbose = fal
|
|
|
2653
2880
|
if (ignoredWarningCodes.has(warning.code ?? "")) {
|
|
2654
2881
|
return;
|
|
2655
2882
|
}
|
|
2656
|
-
console.warn(
|
|
2657
|
-
console.warn(
|
|
2883
|
+
console.warn(chalk35.yellow(`[${warning.code}] ${warning.message}`));
|
|
2884
|
+
console.warn(chalk35.gray(inputPath));
|
|
2658
2885
|
warn(warning);
|
|
2659
2886
|
}
|
|
2660
2887
|
});
|
|
@@ -2664,8 +2891,8 @@ async function bundleDts(inputPath, outputPath, platform, options, verbose = fal
|
|
|
2664
2891
|
});
|
|
2665
2892
|
} catch (ex) {
|
|
2666
2893
|
const error = ex;
|
|
2667
|
-
console.warn(
|
|
2668
|
-
console.warn(
|
|
2894
|
+
console.warn(chalk35.red(error));
|
|
2895
|
+
console.warn(chalk35.gray(inputPath));
|
|
2669
2896
|
}
|
|
2670
2897
|
if (verbose) {
|
|
2671
2898
|
console.log(`Bundled declarations written to ${outputPath}`);
|
|
@@ -2673,7 +2900,7 @@ async function bundleDts(inputPath, outputPath, platform, options, verbose = fal
|
|
|
2673
2900
|
}
|
|
2674
2901
|
var packageCompileTscTypes = async (entries, outDir, platform, srcDir = "build", verbose = false) => {
|
|
2675
2902
|
if (verbose) {
|
|
2676
|
-
console.log(
|
|
2903
|
+
console.log(chalk35.cyan(`Compiling Types START [${platform}]: ${entries.length} files to ${outDir} from ${srcDir}`));
|
|
2677
2904
|
console.log(`Entries: ${entries.join(", ")}`);
|
|
2678
2905
|
}
|
|
2679
2906
|
const pkg = process.env.INIT_CWD ?? cwd3();
|
|
@@ -2697,7 +2924,7 @@ var packageCompileTscTypes = async (entries, outDir, platform, srcDir = "build",
|
|
|
2697
2924
|
await bundleDts(`${srcRoot}/${entryTypeName}`, `${outDir}/${entryTypeName}`, platform, { compilerOptions }, verbose);
|
|
2698
2925
|
}));
|
|
2699
2926
|
if (verbose) {
|
|
2700
|
-
console.log(
|
|
2927
|
+
console.log(chalk35.cyan(`Compiling Types FINISH: ${entries.length} files to ${outDir} from ${srcDir}`));
|
|
2701
2928
|
}
|
|
2702
2929
|
return 0;
|
|
2703
2930
|
};
|
|
@@ -2709,15 +2936,15 @@ var compileFolder = async (srcDir, entries, buildDir, options, bundleTypes = fal
|
|
|
2709
2936
|
console.log(`compileFolder [${srcDir}, ${options?.outDir}]`);
|
|
2710
2937
|
}
|
|
2711
2938
|
if (entries.length === 0) {
|
|
2712
|
-
console.warn(
|
|
2939
|
+
console.warn(chalk36.yellow(`No entries found in ${srcDir} to compile`));
|
|
2713
2940
|
return 0;
|
|
2714
2941
|
}
|
|
2715
2942
|
if (verbose) {
|
|
2716
|
-
console.log(
|
|
2943
|
+
console.log(chalk36.gray(`buildDir [${buildDir}]`));
|
|
2717
2944
|
}
|
|
2718
2945
|
const validationResult = packageCompileTsc(options?.platform ?? "neutral", entries, srcDir, buildDir, void 0, verbose);
|
|
2719
2946
|
if (validationResult !== 0) {
|
|
2720
|
-
console.error(
|
|
2947
|
+
console.error(chalk36.red(`Compile:Validation had ${validationResult} errors`));
|
|
2721
2948
|
return validationResult;
|
|
2722
2949
|
}
|
|
2723
2950
|
const optionsParams = tsupOptions([{
|
|
@@ -2742,12 +2969,12 @@ var compileFolder = async (srcDir, entries, buildDir, options, bundleTypes = fal
|
|
|
2742
2969
|
})
|
|
2743
2970
|
)).flat();
|
|
2744
2971
|
if (verbose) {
|
|
2745
|
-
console.log(
|
|
2746
|
-
console.log(
|
|
2972
|
+
console.log(chalk36.cyan(`TSUP:build:start [${srcDir}]`));
|
|
2973
|
+
console.log(chalk36.gray(`TSUP:build:options [${JSON.stringify(optionsList, null, 2)}]`));
|
|
2747
2974
|
}
|
|
2748
2975
|
await Promise.all(optionsList.map((options2) => build2(options2)));
|
|
2749
2976
|
if (verbose) {
|
|
2750
|
-
console.log(
|
|
2977
|
+
console.log(chalk36.cyan(`TSUP:build:stop [${srcDir}]`));
|
|
2751
2978
|
}
|
|
2752
2979
|
if (bundleTypes) {
|
|
2753
2980
|
await packageCompileTscTypes(entries, outDir, options?.platform ?? "neutral", buildDir, verbose);
|
|
@@ -2858,14 +3085,14 @@ var packageCompileTsup = async (config2) => {
|
|
|
2858
3085
|
// src/actions/package/compile/compile.ts
|
|
2859
3086
|
var packageCompile = async (inConfig = {}) => {
|
|
2860
3087
|
const pkg = process.env.INIT_CWD;
|
|
2861
|
-
console.log(
|
|
3088
|
+
console.log(chalk37.green(`Compiling ${pkg}`));
|
|
2862
3089
|
const config2 = await loadConfig(inConfig);
|
|
2863
3090
|
return await packageCompileTsup(config2);
|
|
2864
3091
|
};
|
|
2865
3092
|
|
|
2866
3093
|
// src/actions/package/copy-assets.ts
|
|
2867
3094
|
import path11 from "path/posix";
|
|
2868
|
-
import
|
|
3095
|
+
import chalk38 from "chalk";
|
|
2869
3096
|
import cpy2 from "cpy";
|
|
2870
3097
|
var copyTargetAssets2 = async (target, name, location) => {
|
|
2871
3098
|
try {
|
|
@@ -2878,7 +3105,7 @@ var copyTargetAssets2 = async (target, name, location) => {
|
|
|
2878
3105
|
}
|
|
2879
3106
|
);
|
|
2880
3107
|
if (values.length > 0) {
|
|
2881
|
-
console.log(
|
|
3108
|
+
console.log(chalk38.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
|
|
2882
3109
|
}
|
|
2883
3110
|
for (const value of values) {
|
|
2884
3111
|
console.log(`${value.split("/").pop()} => ./dist/${target}`);
|
|
@@ -2945,7 +3172,7 @@ var packageCycle = async () => {
|
|
|
2945
3172
|
// src/actions/package/gen-docs.ts
|
|
2946
3173
|
import { existsSync as existsSync9 } from "fs";
|
|
2947
3174
|
import path12 from "path";
|
|
2948
|
-
import
|
|
3175
|
+
import chalk39 from "chalk";
|
|
2949
3176
|
import {
|
|
2950
3177
|
Application,
|
|
2951
3178
|
ArgumentsReader,
|
|
@@ -3049,7 +3276,7 @@ var runTypeDoc = async (app) => {
|
|
|
3049
3276
|
return ExitCodes.OutputError;
|
|
3050
3277
|
}
|
|
3051
3278
|
}
|
|
3052
|
-
console.log(
|
|
3279
|
+
console.log(chalk39.green(`${pkgName} - Ok`));
|
|
3053
3280
|
return ExitCodes.Ok;
|
|
3054
3281
|
};
|
|
3055
3282
|
|
|
@@ -3058,30 +3285,30 @@ import { readdirSync as readdirSync6 } from "fs";
|
|
|
3058
3285
|
import path13 from "path";
|
|
3059
3286
|
import { cwd as cwd4 } from "process";
|
|
3060
3287
|
import { pathToFileURL } from "url";
|
|
3061
|
-
import
|
|
3288
|
+
import chalk40 from "chalk";
|
|
3062
3289
|
import { ESLint } from "eslint";
|
|
3063
|
-
import { findUp } from "find-up";
|
|
3290
|
+
import { findUp as findUp2 } from "find-up";
|
|
3064
3291
|
import picomatch from "picomatch";
|
|
3065
3292
|
var dumpMessages = (lintResults) => {
|
|
3066
3293
|
const colors = ["white", "yellow", "red"];
|
|
3067
3294
|
const severity = ["none", "warning", "error"];
|
|
3068
3295
|
for (const lintResult of lintResults) {
|
|
3069
3296
|
if (lintResult.messages.length > 0) {
|
|
3070
|
-
console.log(
|
|
3297
|
+
console.log(chalk40.gray(`
|
|
3071
3298
|
${lintResult.filePath}`));
|
|
3072
3299
|
for (const message of lintResult.messages) {
|
|
3073
3300
|
console.log(
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3301
|
+
chalk40.gray(` ${message.line}:${message.column}`),
|
|
3302
|
+
chalk40[colors[message.severity]](` ${severity[message.severity]}`),
|
|
3303
|
+
chalk40.white(` ${message.message}`),
|
|
3304
|
+
chalk40.gray(` ${message.ruleId}`)
|
|
3078
3305
|
);
|
|
3079
3306
|
}
|
|
3080
3307
|
}
|
|
3081
3308
|
}
|
|
3082
3309
|
};
|
|
3083
3310
|
async function getRootESLintConfig() {
|
|
3084
|
-
const configPath = await
|
|
3311
|
+
const configPath = await findUp2("eslint.config.mjs");
|
|
3085
3312
|
if (configPath === void 0) {
|
|
3086
3313
|
throw new Error("eslint.config.mjs not found in the monorepo");
|
|
3087
3314
|
}
|
|
@@ -3112,10 +3339,10 @@ var packageLint = async (fix2 = false, verbose = false, cache = true) => {
|
|
|
3112
3339
|
cache
|
|
3113
3340
|
});
|
|
3114
3341
|
const files = getFiles(cwd4(), ignoreFolders);
|
|
3115
|
-
console.log(
|
|
3342
|
+
console.log(chalk40.green(`Linting ${pkg} [files = ${files.length}]`));
|
|
3116
3343
|
if (verbose) {
|
|
3117
3344
|
for (const file of files) {
|
|
3118
|
-
console.log(
|
|
3345
|
+
console.log(chalk40.gray(` ${file}`));
|
|
3119
3346
|
}
|
|
3120
3347
|
}
|
|
3121
3348
|
const lintResults = await engine.lintFiles(files);
|
|
@@ -3126,32 +3353,32 @@ var packageLint = async (fix2 = false, verbose = false, cache = true) => {
|
|
|
3126
3353
|
const filesCountColor = files.length < 100 ? "green" : files.length < 1e3 ? "yellow" : "red";
|
|
3127
3354
|
const lintTime = Date.now() - start;
|
|
3128
3355
|
const lintTimeColor = lintTime < 1e3 ? "green" : lintTime < 3e3 ? "yellow" : "red";
|
|
3129
|
-
console.log(
|
|
3356
|
+
console.log(chalk40.white(`Linted ${chalk40[filesCountColor](files.length)} files in ${chalk40[lintTimeColor](lintTime)}ms`));
|
|
3130
3357
|
return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
|
|
3131
3358
|
};
|
|
3132
3359
|
|
|
3133
3360
|
// src/actions/package/publint.ts
|
|
3134
3361
|
import { promises as fs10 } from "fs";
|
|
3135
|
-
import
|
|
3362
|
+
import chalk41 from "chalk";
|
|
3136
3363
|
import sortPackageJson from "sort-package-json";
|
|
3137
3364
|
var customPubLint = (pkg) => {
|
|
3138
3365
|
let errorCount = 0;
|
|
3139
3366
|
let warningCount = 0;
|
|
3140
3367
|
if (pkg.files === void 0) {
|
|
3141
|
-
console.warn(
|
|
3368
|
+
console.warn(chalk41.yellow('Publint [custom]: "files" field is missing'));
|
|
3142
3369
|
warningCount++;
|
|
3143
3370
|
}
|
|
3144
3371
|
if (pkg.main !== void 0) {
|
|
3145
|
-
console.warn(
|
|
3372
|
+
console.warn(chalk41.yellow('Publint [custom]: "main" field is deprecated, use "exports" instead'));
|
|
3146
3373
|
warningCount++;
|
|
3147
3374
|
}
|
|
3148
3375
|
if (pkg.sideEffects !== false) {
|
|
3149
|
-
console.warn(
|
|
3376
|
+
console.warn(chalk41.yellow('Publint [custom]: "sideEffects" field should be set to false'));
|
|
3150
3377
|
warningCount++;
|
|
3151
3378
|
}
|
|
3152
3379
|
if (pkg.resolutions !== void 0) {
|
|
3153
|
-
console.warn(
|
|
3154
|
-
console.warn(
|
|
3380
|
+
console.warn(chalk41.yellow('Publint [custom]: "resolutions" in use'));
|
|
3381
|
+
console.warn(chalk41.gray(JSON.stringify(pkg.resolutions, null, 2)));
|
|
3155
3382
|
warningCount++;
|
|
3156
3383
|
}
|
|
3157
3384
|
return [errorCount, warningCount];
|
|
@@ -3161,8 +3388,8 @@ var packagePublint = async ({ strict = true, verbose = false } = {}) => {
|
|
|
3161
3388
|
const sortedPkg = sortPackageJson(await fs10.readFile(`${pkgDir}/package.json`, "utf8"));
|
|
3162
3389
|
await fs10.writeFile(`${pkgDir}/package.json`, sortedPkg);
|
|
3163
3390
|
const pkg = JSON.parse(await fs10.readFile(`${pkgDir}/package.json`, "utf8"));
|
|
3164
|
-
console.log(
|
|
3165
|
-
console.log(
|
|
3391
|
+
console.log(chalk41.green(`Publint: ${pkg.name}`));
|
|
3392
|
+
console.log(chalk41.gray(pkgDir));
|
|
3166
3393
|
const { publint: publint2 } = await import("publint");
|
|
3167
3394
|
const { messages } = await publint2({
|
|
3168
3395
|
level: "suggestion",
|
|
@@ -3173,22 +3400,22 @@ var packagePublint = async ({ strict = true, verbose = false } = {}) => {
|
|
|
3173
3400
|
for (const message of messages) {
|
|
3174
3401
|
switch (message.type) {
|
|
3175
3402
|
case "error": {
|
|
3176
|
-
console.error(
|
|
3403
|
+
console.error(chalk41.red(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
3177
3404
|
break;
|
|
3178
3405
|
}
|
|
3179
3406
|
case "warning": {
|
|
3180
|
-
console.warn(
|
|
3407
|
+
console.warn(chalk41.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
3181
3408
|
break;
|
|
3182
3409
|
}
|
|
3183
3410
|
default: {
|
|
3184
|
-
console.log(
|
|
3411
|
+
console.log(chalk41.white(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
3185
3412
|
break;
|
|
3186
3413
|
}
|
|
3187
3414
|
}
|
|
3188
3415
|
}
|
|
3189
3416
|
const [errorCount, warningCount] = customPubLint(pkg);
|
|
3190
3417
|
if (verbose) {
|
|
3191
|
-
console.log(
|
|
3418
|
+
console.log(chalk41.gray(`Publint [Finish]: ${pkgDir} [${messages.length + errorCount + warningCount} messages]`));
|
|
3192
3419
|
}
|
|
3193
3420
|
return messages.filter((message) => message.type === "error").length + errorCount;
|
|
3194
3421
|
};
|
|
@@ -3199,9 +3426,9 @@ var packageRecompile = async () => {
|
|
|
3199
3426
|
};
|
|
3200
3427
|
|
|
3201
3428
|
// src/actions/package-lint.ts
|
|
3202
|
-
import { readFileSync as
|
|
3203
|
-
import
|
|
3204
|
-
import
|
|
3429
|
+
import { readFileSync as readFileSync14, writeFileSync as writeFileSync7 } from "fs";
|
|
3430
|
+
import PATH10 from "path";
|
|
3431
|
+
import chalk42 from "chalk";
|
|
3205
3432
|
import picomatch2 from "picomatch";
|
|
3206
3433
|
function emptyResult() {
|
|
3207
3434
|
return {
|
|
@@ -3211,12 +3438,12 @@ function emptyResult() {
|
|
|
3211
3438
|
};
|
|
3212
3439
|
}
|
|
3213
3440
|
function readRootPackageJson(cwd5) {
|
|
3214
|
-
const raw =
|
|
3441
|
+
const raw = readFileSync14(PATH10.resolve(cwd5, "package.json"), "utf8");
|
|
3215
3442
|
return JSON.parse(raw);
|
|
3216
3443
|
}
|
|
3217
3444
|
function writeRootPackageJson(cwd5, pkg) {
|
|
3218
|
-
const path14 =
|
|
3219
|
-
|
|
3445
|
+
const path14 = PATH10.resolve(cwd5, "package.json");
|
|
3446
|
+
writeFileSync7(path14, `${JSON.stringify(pkg, null, 2)}
|
|
3220
3447
|
`, "utf8");
|
|
3221
3448
|
}
|
|
3222
3449
|
function isMonorepo(pkg) {
|
|
@@ -3243,7 +3470,7 @@ function checkRootPrivate(pkg) {
|
|
|
3243
3470
|
function fixRootPrivate(cwd5, pkg) {
|
|
3244
3471
|
pkg.private = true;
|
|
3245
3472
|
writeRootPackageJson(cwd5, pkg);
|
|
3246
|
-
console.log(
|
|
3473
|
+
console.log(chalk42.green(' \u2714 Fixed: set "private": true in root package.json'));
|
|
3247
3474
|
}
|
|
3248
3475
|
function checkNoPublishConfigOnPrivate(pkg) {
|
|
3249
3476
|
const result = emptyResult();
|
|
@@ -3255,7 +3482,7 @@ function checkNoPublishConfigOnPrivate(pkg) {
|
|
|
3255
3482
|
function fixNoPublishConfigOnPrivate(cwd5, pkg) {
|
|
3256
3483
|
delete pkg.publishConfig;
|
|
3257
3484
|
writeRootPackageJson(cwd5, pkg);
|
|
3258
|
-
console.log(
|
|
3485
|
+
console.log(chalk42.green(" \u2714 Fixed: removed publishConfig from private root package.json"));
|
|
3259
3486
|
}
|
|
3260
3487
|
function checkDiscoverable(pkg, workspaces) {
|
|
3261
3488
|
const result = emptyResult();
|
|
@@ -3274,22 +3501,22 @@ function logResults(label, result, fix2) {
|
|
|
3274
3501
|
let errors = 0;
|
|
3275
3502
|
let fixed = 0;
|
|
3276
3503
|
for (const error of result.errors) {
|
|
3277
|
-
console.log(
|
|
3504
|
+
console.log(chalk42.red(` \u2717 ${error}`));
|
|
3278
3505
|
errors++;
|
|
3279
3506
|
}
|
|
3280
3507
|
for (const fixable of result.fixable) {
|
|
3281
3508
|
if (fix2) {
|
|
3282
3509
|
fixed++;
|
|
3283
3510
|
} else {
|
|
3284
|
-
console.log(
|
|
3511
|
+
console.log(chalk42.red(` \u2717 ${fixable} (fixable)`));
|
|
3285
3512
|
errors++;
|
|
3286
3513
|
}
|
|
3287
3514
|
}
|
|
3288
3515
|
for (const warning of result.warnings) {
|
|
3289
|
-
console.log(
|
|
3516
|
+
console.log(chalk42.yellow(` \u26A0 ${warning}`));
|
|
3290
3517
|
}
|
|
3291
3518
|
if (errors === 0 && fixed === 0 && result.warnings.length === 0) {
|
|
3292
|
-
console.log(
|
|
3519
|
+
console.log(chalk42.green(` \u2713 ${label}`));
|
|
3293
3520
|
}
|
|
3294
3521
|
return { errors, fixed };
|
|
3295
3522
|
}
|
|
@@ -3309,14 +3536,14 @@ function runChecks(entries, cwd5, pkg, fix2) {
|
|
|
3309
3536
|
}
|
|
3310
3537
|
function logSummary(errors, fixed) {
|
|
3311
3538
|
if (fixed > 0) {
|
|
3312
|
-
console.log(
|
|
3539
|
+
console.log(chalk42.green(`
|
|
3313
3540
|
Fixed ${fixed} issue(s)`));
|
|
3314
3541
|
}
|
|
3315
3542
|
if (errors > 0) {
|
|
3316
|
-
console.log(
|
|
3543
|
+
console.log(chalk42.red(`
|
|
3317
3544
|
${errors} error(s) found`));
|
|
3318
3545
|
} else if (fixed === 0) {
|
|
3319
|
-
console.log(
|
|
3546
|
+
console.log(chalk42.green("\n All checks passed"));
|
|
3320
3547
|
}
|
|
3321
3548
|
}
|
|
3322
3549
|
function packageLintMonorepo(fix2 = false) {
|
|
@@ -3325,14 +3552,14 @@ function packageLintMonorepo(fix2 = false) {
|
|
|
3325
3552
|
try {
|
|
3326
3553
|
pkg = readRootPackageJson(cwd5);
|
|
3327
3554
|
} catch {
|
|
3328
|
-
console.error(
|
|
3555
|
+
console.error(chalk42.red("Could not read package.json"));
|
|
3329
3556
|
return 1;
|
|
3330
3557
|
}
|
|
3331
3558
|
if (!isMonorepo(pkg)) {
|
|
3332
|
-
console.log(
|
|
3559
|
+
console.log(chalk42.gray("Not a monorepo \u2014 skipping package-lint checks"));
|
|
3333
3560
|
return 0;
|
|
3334
3561
|
}
|
|
3335
|
-
console.log(
|
|
3562
|
+
console.log(chalk42.green("Package Lint"));
|
|
3336
3563
|
const workspaces = yarnWorkspaces();
|
|
3337
3564
|
const checks = [
|
|
3338
3565
|
{
|
|
@@ -3406,7 +3633,7 @@ var rebuild = ({ target }) => {
|
|
|
3406
3633
|
};
|
|
3407
3634
|
|
|
3408
3635
|
// src/actions/recompile.ts
|
|
3409
|
-
import
|
|
3636
|
+
import chalk43 from "chalk";
|
|
3410
3637
|
var recompile = async ({
|
|
3411
3638
|
verbose,
|
|
3412
3639
|
target,
|
|
@@ -3442,7 +3669,7 @@ var recompileAll = async ({
|
|
|
3442
3669
|
const incrementalOptions = incremental ? ["--since", "-Apt", "--topological-dev"] : ["--parallel", "-Apt", "--topological-dev"];
|
|
3443
3670
|
const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
|
|
3444
3671
|
if (jobs) {
|
|
3445
|
-
console.log(
|
|
3672
|
+
console.log(chalk43.blue(`Jobs set to [${jobs}]`));
|
|
3446
3673
|
}
|
|
3447
3674
|
const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
|
|
3448
3675
|
[
|
|
@@ -3473,7 +3700,7 @@ var recompileAll = async ({
|
|
|
3473
3700
|
]
|
|
3474
3701
|
]);
|
|
3475
3702
|
console.log(
|
|
3476
|
-
`${
|
|
3703
|
+
`${chalk43.gray("Recompiled in")} [${chalk43.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk43.gray("seconds")}`
|
|
3477
3704
|
);
|
|
3478
3705
|
return result;
|
|
3479
3706
|
};
|
|
@@ -3504,13 +3731,13 @@ var reinstall = () => {
|
|
|
3504
3731
|
};
|
|
3505
3732
|
|
|
3506
3733
|
// src/actions/relint.ts
|
|
3507
|
-
import
|
|
3734
|
+
import chalk44 from "chalk";
|
|
3508
3735
|
var relintPackage = ({
|
|
3509
3736
|
pkg,
|
|
3510
3737
|
fix: fix2,
|
|
3511
3738
|
verbose
|
|
3512
3739
|
}) => {
|
|
3513
|
-
console.log(
|
|
3740
|
+
console.log(chalk44.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
|
|
3514
3741
|
const start = Date.now();
|
|
3515
3742
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
|
|
3516
3743
|
["yarn", [
|
|
@@ -3520,7 +3747,7 @@ var relintPackage = ({
|
|
|
3520
3747
|
fix2 ? "package-fix" : verbose ? "package-lint-verbose" : "package-lint"
|
|
3521
3748
|
]]
|
|
3522
3749
|
]);
|
|
3523
|
-
console.log(
|
|
3750
|
+
console.log(chalk44.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk44.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk44.gray("seconds")}`));
|
|
3524
3751
|
return result;
|
|
3525
3752
|
};
|
|
3526
3753
|
var relint = ({
|
|
@@ -3540,21 +3767,31 @@ var relint = ({
|
|
|
3540
3767
|
});
|
|
3541
3768
|
};
|
|
3542
3769
|
var relintAllPackages = ({ fix: fix2 = false } = {}) => {
|
|
3543
|
-
console.log(
|
|
3770
|
+
console.log(chalk44.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
|
|
3544
3771
|
const start = Date.now();
|
|
3545
3772
|
const fixOptions = fix2 ? ["--fix"] : [];
|
|
3546
3773
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
|
|
3547
3774
|
["yarn", ["eslint", ...fixOptions]]
|
|
3548
3775
|
]);
|
|
3549
|
-
console.log(
|
|
3776
|
+
console.log(chalk44.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk44.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk44.gray("seconds")}`));
|
|
3550
3777
|
return result;
|
|
3551
3778
|
};
|
|
3552
3779
|
|
|
3553
3780
|
// src/actions/retest.ts
|
|
3554
|
-
|
|
3555
|
-
return
|
|
3781
|
+
function isWorkspace(target) {
|
|
3782
|
+
return yarnWorkspaces().some((ws) => ws.name === target);
|
|
3783
|
+
}
|
|
3784
|
+
var retest = ({ target } = {}) => {
|
|
3785
|
+
if (target && isWorkspace(target)) {
|
|
3786
|
+
return runSteps(`Re-Test [${target}]`, [
|
|
3787
|
+
["yarn", ["workspace", target, "run", "vitest", "--clearCache"]],
|
|
3788
|
+
["yarn", ["workspace", target, "run", "vitest", "."]]
|
|
3789
|
+
]);
|
|
3790
|
+
}
|
|
3791
|
+
const path14 = target ?? ".";
|
|
3792
|
+
return runSteps("Re-Test", [
|
|
3556
3793
|
["yarn", ["vitest", "--clearCache"]],
|
|
3557
|
-
["yarn", ["vitest",
|
|
3794
|
+
["yarn", ["vitest", path14]]
|
|
3558
3795
|
]);
|
|
3559
3796
|
};
|
|
3560
3797
|
|
|
@@ -3564,17 +3801,24 @@ var sonar = () => {
|
|
|
3564
3801
|
};
|
|
3565
3802
|
|
|
3566
3803
|
// src/actions/statics.ts
|
|
3567
|
-
import
|
|
3804
|
+
import chalk45 from "chalk";
|
|
3568
3805
|
var DefaultDependencies = ["axios", "@xylabs/pixel", "react", "graphql", "react-router", "@mui/material", "@mui/system"];
|
|
3569
3806
|
var statics = () => {
|
|
3570
|
-
console.log(
|
|
3807
|
+
console.log(chalk45.green("Check Required Static Dependencies"));
|
|
3571
3808
|
const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
|
|
3572
3809
|
return detectDuplicateDependencies(statics2, DefaultDependencies);
|
|
3573
3810
|
};
|
|
3574
3811
|
|
|
3575
3812
|
// src/actions/test.ts
|
|
3576
|
-
|
|
3577
|
-
return
|
|
3813
|
+
function isWorkspace2(target) {
|
|
3814
|
+
return yarnWorkspaces().some((ws) => ws.name === target);
|
|
3815
|
+
}
|
|
3816
|
+
var test = ({ target } = {}) => {
|
|
3817
|
+
if (target && isWorkspace2(target)) {
|
|
3818
|
+
return runSteps(`Test [${target}]`, [["yarn", ["workspace", target, "run", "vitest", "."]]]);
|
|
3819
|
+
}
|
|
3820
|
+
const path14 = target ?? ".";
|
|
3821
|
+
return runSteps("Test", [["yarn", ["vitest", path14]]]);
|
|
3578
3822
|
};
|
|
3579
3823
|
|
|
3580
3824
|
// src/actions/up.ts
|
|
@@ -3652,6 +3896,7 @@ export {
|
|
|
3652
3896
|
lint,
|
|
3653
3897
|
lintAllPackages,
|
|
3654
3898
|
lintPackage,
|
|
3899
|
+
lintlint,
|
|
3655
3900
|
npmignoreGen,
|
|
3656
3901
|
packageClean,
|
|
3657
3902
|
packageCleanOutputs,
|