@xylabs/ts-scripts-yarn3 7.4.22 → 7.4.24
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/claude-settings.mjs +2 -2
- package/dist/actions/claude-settings.mjs.map +1 -1
- package/dist/actions/index.mjs +168 -12
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/package-lint.mjs +178 -0
- package/dist/actions/package-lint.mjs.map +1 -0
- package/dist/bin/xy.mjs +204 -32
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.mjs +205 -32
- package/dist/index.mjs.map +1 -1
- package/dist/xy/common/claude/index.mjs +2 -2
- package/dist/xy/common/claude/index.mjs.map +1 -1
- package/dist/xy/common/claude/initCommand.mjs +2 -2
- package/dist/xy/common/claude/initCommand.mjs.map +1 -1
- package/dist/xy/common/claude/settingsCommand.mjs +2 -2
- package/dist/xy/common/claude/settingsCommand.mjs.map +1 -1
- package/dist/xy/common/index.mjs +2 -2
- package/dist/xy/common/index.mjs.map +1 -1
- package/dist/xy/index.mjs +204 -32
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/lint/index.mjs +200 -22
- package/dist/xy/lint/index.mjs.map +1 -1
- package/dist/xy/lint/packageLintCommand.mjs +193 -0
- package/dist/xy/lint/packageLintCommand.mjs.map +1 -0
- package/dist/xy/xy.mjs +204 -32
- package/dist/xy/xy.mjs.map +1 -1
- package/package.json +2 -2
- package/templates/gitignore/template.gitignore +11 -0
package/dist/index.d.ts
CHANGED
|
@@ -412,6 +412,8 @@ declare const packagePublint: ({ strict, verbose }?: PackagePublintParams) => Pr
|
|
|
412
412
|
|
|
413
413
|
declare const packageRecompile: () => Promise<number>;
|
|
414
414
|
|
|
415
|
+
declare function packageLintMonorepo(fix?: boolean): number;
|
|
416
|
+
|
|
415
417
|
interface PublintParams {
|
|
416
418
|
pkg?: string;
|
|
417
419
|
verbose?: boolean;
|
|
@@ -524,4 +526,4 @@ declare const xy: () => Promise<{
|
|
|
524
526
|
|
|
525
527
|
declare const xyParseOptions: () => Argv;
|
|
526
528
|
|
|
527
|
-
export { type BuildParams, CROSS_PLATFORM_NEWLINE, type CleanPackageParams, type CleanParams, type CompileConfig, type CompileParams, type CopyAssetsParams, type CycleParams, DEFAULT_README_BODY, DEFAULT_README_TEMPLATE, type DepLintOptions, type DeplintConfig, DuplicateDetector, type DynamicShareConfig, type EntryMode, type GenDocsPackageParams, type GenDocsParams, INIT_CWD, LEGACY_COMMANDS_PREFIX, type LintPackageParams, type LintParams, type LiveShareConfig, type PackageCompileTscConfig, type PackageCompileTsupConfig, type PackageCopyAssetsParams, type PackageJsonEx, type PackagePublintParams, type PathConfig, type PublintPackageParams, type PublintParams, type ReadFileSyncOptions, type ReadmeConfig, type ReadmeGenParams, type ReadmeInitParams, type RebuildParams, type RecompilePackageParams, type RecompileParams, type RelintPackageParams, type RelintParams, type ScriptStep, WINDOWS_NEWLINE_REGEX, type Workspace, XYLABS_COMMANDS_PREFIX, XYLABS_RULES_PREFIX, XYLABS_SKILLS_PREFIX, type XyConfig, type XyConfigBase, type XyConfigLegacy, type XyTscConfig, type XyTsupConfig, applyLogoConfig, build, bundleDts, checkResult, claudeClean, claudeCommandTemplates, claudeCommands, claudeMdLocalTemplate, claudeMdProjectTemplate, claudeMdRuleTemplates, claudeRules, claudeSettings, claudeSkillTemplates, claudeSkills, clean, cleanAll, cleanDocs, cleanPackage, compile, compileAll, compilePackage, copyAssets, createBuildConfig, cycle, cycleAll, cyclePackage, dead, defaultBuildConfig, defaultReadFileSyncOptions, deleteGlob, deplint, deploy, deployMajor, deployMinor, deployNext, detectDuplicateDependencies, dupdeps, empty, fix, genDocs, genDocsAll, genDocsPackage, generateIgnoreFiles, generateReadmeFiles, gitignore, gitignoreGen, gitignoreTemplate, gitlint, gitlintFix, isYarnVersionOrGreater, knip, license, lint, lintAllPackages, lintPackage, loadConfig, loadPackageConfig, multiLineToJSONArray, notEmpty, npmignoreGen, packageClean, packageCleanOutputs, packageCleanTypescript, packageCompile, packageCompileTsc, packageCompileTscTypes, packageCompileTsup, packageCopyAssets, packageCycle, packageGenDocs, packageLint, packagePublint, packageRecompile, parsedPackageJSON, processEx, publint, publintAll, publintPackage, publish, readLines, readNonEmptyLines, readmeGen, readmeInit, rebuild, recompile, recompileAll, recompilePackage, reinstall, relint, relintAllPackages, relintPackage, resolveTemplatePath, retest, runStepAsync, runSteps, runStepsAsync, runXy, runXyWithWarning, safeExit, safeExitAsync, scaffoldTemplate, sonar, statics, test, tryReadFileSync, tsupOptions, union, up, updateYarnPlugins, updateYarnVersion, updo, withErrnoException, withError, writeLines, xy, xyBuildCommands, xyCommonCommands, xyDeployCommands, xyInstallCommands, xyLintCommands, xyParseOptions, yarn3Only, yarnWorkspace, yarnWorkspaces };
|
|
529
|
+
export { type BuildParams, CROSS_PLATFORM_NEWLINE, type CleanPackageParams, type CleanParams, type CompileConfig, type CompileParams, type CopyAssetsParams, type CycleParams, DEFAULT_README_BODY, DEFAULT_README_TEMPLATE, type DepLintOptions, type DeplintConfig, DuplicateDetector, type DynamicShareConfig, type EntryMode, type GenDocsPackageParams, type GenDocsParams, INIT_CWD, LEGACY_COMMANDS_PREFIX, type LintPackageParams, type LintParams, type LiveShareConfig, type PackageCompileTscConfig, type PackageCompileTsupConfig, type PackageCopyAssetsParams, type PackageJsonEx, type PackagePublintParams, type PathConfig, type PublintPackageParams, type PublintParams, type ReadFileSyncOptions, type ReadmeConfig, type ReadmeGenParams, type ReadmeInitParams, type RebuildParams, type RecompilePackageParams, type RecompileParams, type RelintPackageParams, type RelintParams, type ScriptStep, WINDOWS_NEWLINE_REGEX, type Workspace, XYLABS_COMMANDS_PREFIX, XYLABS_RULES_PREFIX, XYLABS_SKILLS_PREFIX, type XyConfig, type XyConfigBase, type XyConfigLegacy, type XyTscConfig, type XyTsupConfig, applyLogoConfig, build, bundleDts, checkResult, claudeClean, claudeCommandTemplates, claudeCommands, claudeMdLocalTemplate, claudeMdProjectTemplate, claudeMdRuleTemplates, claudeRules, claudeSettings, claudeSkillTemplates, claudeSkills, clean, cleanAll, cleanDocs, cleanPackage, compile, compileAll, compilePackage, copyAssets, createBuildConfig, cycle, cycleAll, cyclePackage, dead, defaultBuildConfig, defaultReadFileSyncOptions, deleteGlob, deplint, deploy, deployMajor, deployMinor, deployNext, detectDuplicateDependencies, dupdeps, empty, fix, genDocs, genDocsAll, genDocsPackage, generateIgnoreFiles, generateReadmeFiles, gitignore, gitignoreGen, gitignoreTemplate, gitlint, gitlintFix, isYarnVersionOrGreater, knip, license, lint, lintAllPackages, lintPackage, loadConfig, loadPackageConfig, multiLineToJSONArray, notEmpty, npmignoreGen, packageClean, packageCleanOutputs, packageCleanTypescript, packageCompile, packageCompileTsc, packageCompileTscTypes, packageCompileTsup, packageCopyAssets, packageCycle, packageGenDocs, packageLint, packageLintMonorepo, packagePublint, packageRecompile, parsedPackageJSON, processEx, publint, publintAll, publintPackage, publish, readLines, readNonEmptyLines, readmeGen, readmeInit, rebuild, recompile, recompileAll, recompilePackage, reinstall, relint, relintAllPackages, relintPackage, resolveTemplatePath, retest, runStepAsync, runSteps, runStepsAsync, runXy, runXyWithWarning, safeExit, safeExitAsync, scaffoldTemplate, sonar, statics, test, tryReadFileSync, tsupOptions, union, up, updateYarnPlugins, updateYarnVersion, updo, withErrnoException, withError, writeLines, xy, xyBuildCommands, xyCommonCommands, xyDeployCommands, xyInstallCommands, xyLintCommands, xyParseOptions, yarn3Only, yarnWorkspace, yarnWorkspaces };
|
package/dist/index.mjs
CHANGED
|
@@ -1065,8 +1065,8 @@ var DEFAULT_SETTINGS = {
|
|
|
1065
1065
|
"Skill"
|
|
1066
1066
|
],
|
|
1067
1067
|
deny: [
|
|
1068
|
-
"Bash(git push --force*)",
|
|
1069
|
-
"Bash(git reset --hard*)",
|
|
1068
|
+
"Bash(git push --force *)",
|
|
1069
|
+
"Bash(git reset --hard *)",
|
|
1070
1070
|
"Bash(rm -rf /*)"
|
|
1071
1071
|
]
|
|
1072
1072
|
}
|
|
@@ -3272,6 +3272,161 @@ var packageRecompile = async () => {
|
|
|
3272
3272
|
return await packageClean() || await packageCompile();
|
|
3273
3273
|
};
|
|
3274
3274
|
|
|
3275
|
+
// src/actions/package-lint.ts
|
|
3276
|
+
import { readFileSync as readFileSync15, writeFileSync as writeFileSync6 } from "fs";
|
|
3277
|
+
import PATH9 from "path";
|
|
3278
|
+
import chalk42 from "chalk";
|
|
3279
|
+
import picomatch2 from "picomatch";
|
|
3280
|
+
function emptyResult() {
|
|
3281
|
+
return {
|
|
3282
|
+
errors: [],
|
|
3283
|
+
fixable: [],
|
|
3284
|
+
warnings: []
|
|
3285
|
+
};
|
|
3286
|
+
}
|
|
3287
|
+
function readRootPackageJson(cwd5) {
|
|
3288
|
+
const raw = readFileSync15(PATH9.resolve(cwd5, "package.json"), "utf8");
|
|
3289
|
+
return JSON.parse(raw);
|
|
3290
|
+
}
|
|
3291
|
+
function writeRootPackageJson(cwd5, pkg) {
|
|
3292
|
+
const path14 = PATH9.resolve(cwd5, "package.json");
|
|
3293
|
+
writeFileSync6(path14, `${JSON.stringify(pkg, null, 2)}
|
|
3294
|
+
`, "utf8");
|
|
3295
|
+
}
|
|
3296
|
+
function isMonorepo(pkg) {
|
|
3297
|
+
const workspaces = pkg.workspaces;
|
|
3298
|
+
return Array.isArray(workspaces) && workspaces.length > 0;
|
|
3299
|
+
}
|
|
3300
|
+
function checkPackagesFolder(workspaces) {
|
|
3301
|
+
const result = emptyResult();
|
|
3302
|
+
for (const { location, name } of workspaces) {
|
|
3303
|
+
if (location === ".") continue;
|
|
3304
|
+
if (!location.startsWith("packages/") && !location.startsWith("packages\\")) {
|
|
3305
|
+
result.errors.push(`${name} (${location}) is not inside a packages/ folder`);
|
|
3306
|
+
}
|
|
3307
|
+
}
|
|
3308
|
+
return result;
|
|
3309
|
+
}
|
|
3310
|
+
function checkRootPrivate(pkg) {
|
|
3311
|
+
const result = emptyResult();
|
|
3312
|
+
if (!pkg.private) {
|
|
3313
|
+
result.fixable.push("Root package.json must be private to prevent accidental publishing");
|
|
3314
|
+
}
|
|
3315
|
+
return result;
|
|
3316
|
+
}
|
|
3317
|
+
function fixRootPrivate(cwd5, pkg) {
|
|
3318
|
+
pkg.private = true;
|
|
3319
|
+
writeRootPackageJson(cwd5, pkg);
|
|
3320
|
+
console.log(chalk42.green(' \u2714 Fixed: set "private": true in root package.json'));
|
|
3321
|
+
}
|
|
3322
|
+
function checkNoPublishConfigOnPrivate(pkg) {
|
|
3323
|
+
const result = emptyResult();
|
|
3324
|
+
if (pkg.private && pkg.publishConfig) {
|
|
3325
|
+
result.fixable.push("Root package.json has publishConfig but is private \u2014 publishConfig is unnecessary");
|
|
3326
|
+
}
|
|
3327
|
+
return result;
|
|
3328
|
+
}
|
|
3329
|
+
function fixNoPublishConfigOnPrivate(cwd5, pkg) {
|
|
3330
|
+
delete pkg.publishConfig;
|
|
3331
|
+
writeRootPackageJson(cwd5, pkg);
|
|
3332
|
+
console.log(chalk42.green(" \u2714 Fixed: removed publishConfig from private root package.json"));
|
|
3333
|
+
}
|
|
3334
|
+
function checkDiscoverable(pkg, workspaces) {
|
|
3335
|
+
const result = emptyResult();
|
|
3336
|
+
const globs = pkg.workspaces;
|
|
3337
|
+
const matchers = globs.map((glob3) => picomatch2(glob3));
|
|
3338
|
+
const isMatch = (location) => matchers.some((m) => m(location));
|
|
3339
|
+
for (const { location, name } of workspaces) {
|
|
3340
|
+
if (location === ".") continue;
|
|
3341
|
+
if (!isMatch(location)) {
|
|
3342
|
+
result.errors.push(`${name} (${location}) is not matched by any workspace glob in package.json`);
|
|
3343
|
+
}
|
|
3344
|
+
}
|
|
3345
|
+
return result;
|
|
3346
|
+
}
|
|
3347
|
+
function logResults(label, result, fix2) {
|
|
3348
|
+
let errors = 0;
|
|
3349
|
+
let fixed = 0;
|
|
3350
|
+
for (const error of result.errors) {
|
|
3351
|
+
console.log(chalk42.red(` \u2717 ${error}`));
|
|
3352
|
+
errors++;
|
|
3353
|
+
}
|
|
3354
|
+
for (const fixable of result.fixable) {
|
|
3355
|
+
if (fix2) {
|
|
3356
|
+
fixed++;
|
|
3357
|
+
} else {
|
|
3358
|
+
console.log(chalk42.red(` \u2717 ${fixable} (fixable)`));
|
|
3359
|
+
errors++;
|
|
3360
|
+
}
|
|
3361
|
+
}
|
|
3362
|
+
for (const warning of result.warnings) {
|
|
3363
|
+
console.log(chalk42.yellow(` \u26A0 ${warning}`));
|
|
3364
|
+
}
|
|
3365
|
+
if (errors === 0 && fixed === 0 && result.warnings.length === 0) {
|
|
3366
|
+
console.log(chalk42.green(` \u2713 ${label}`));
|
|
3367
|
+
}
|
|
3368
|
+
return { errors, fixed };
|
|
3369
|
+
}
|
|
3370
|
+
function runChecks(entries, cwd5, pkg, fix2) {
|
|
3371
|
+
let totalErrors = 0;
|
|
3372
|
+
let totalFixed = 0;
|
|
3373
|
+
for (const entry of entries) {
|
|
3374
|
+
const result = entry.check();
|
|
3375
|
+
const log = logResults(entry.label, result, fix2);
|
|
3376
|
+
if (fix2 && entry.fix && result.fixable.length > 0) {
|
|
3377
|
+
entry.fix(cwd5, pkg);
|
|
3378
|
+
}
|
|
3379
|
+
totalErrors += log.errors;
|
|
3380
|
+
totalFixed += log.fixed;
|
|
3381
|
+
}
|
|
3382
|
+
return { errors: totalErrors, fixed: totalFixed };
|
|
3383
|
+
}
|
|
3384
|
+
function logSummary(errors, fixed) {
|
|
3385
|
+
if (fixed > 0) {
|
|
3386
|
+
console.log(chalk42.green(`
|
|
3387
|
+
Fixed ${fixed} issue(s)`));
|
|
3388
|
+
}
|
|
3389
|
+
if (errors > 0) {
|
|
3390
|
+
console.log(chalk42.red(`
|
|
3391
|
+
${errors} error(s) found`));
|
|
3392
|
+
} else if (fixed === 0) {
|
|
3393
|
+
console.log(chalk42.green("\n All checks passed"));
|
|
3394
|
+
}
|
|
3395
|
+
}
|
|
3396
|
+
function packageLintMonorepo(fix2 = false) {
|
|
3397
|
+
const cwd5 = INIT_CWD() ?? process.cwd();
|
|
3398
|
+
let pkg;
|
|
3399
|
+
try {
|
|
3400
|
+
pkg = readRootPackageJson(cwd5);
|
|
3401
|
+
} catch {
|
|
3402
|
+
console.error(chalk42.red("Could not read package.json"));
|
|
3403
|
+
return 1;
|
|
3404
|
+
}
|
|
3405
|
+
if (!isMonorepo(pkg)) {
|
|
3406
|
+
console.log(chalk42.gray("Not a monorepo \u2014 skipping package-lint checks"));
|
|
3407
|
+
return 0;
|
|
3408
|
+
}
|
|
3409
|
+
console.log(chalk42.green("Package Lint"));
|
|
3410
|
+
const workspaces = yarnWorkspaces();
|
|
3411
|
+
const checks = [
|
|
3412
|
+
{
|
|
3413
|
+
check: () => checkRootPrivate(pkg),
|
|
3414
|
+
fix: fixRootPrivate,
|
|
3415
|
+
label: "Root package is private"
|
|
3416
|
+
},
|
|
3417
|
+
{
|
|
3418
|
+
check: () => checkNoPublishConfigOnPrivate(pkg),
|
|
3419
|
+
fix: fixNoPublishConfigOnPrivate,
|
|
3420
|
+
label: "No publishConfig on private root"
|
|
3421
|
+
},
|
|
3422
|
+
{ check: () => checkPackagesFolder(workspaces), label: "All packages are in packages/ folder" },
|
|
3423
|
+
{ check: () => checkDiscoverable(pkg, workspaces), label: "All packages are discoverable from workspace globs" }
|
|
3424
|
+
];
|
|
3425
|
+
const { errors, fixed } = runChecks(checks, cwd5, pkg, fix2);
|
|
3426
|
+
logSummary(errors, fixed);
|
|
3427
|
+
return errors > 0 ? 1 : 0;
|
|
3428
|
+
}
|
|
3429
|
+
|
|
3275
3430
|
// src/actions/publint.ts
|
|
3276
3431
|
var publint = async ({ verbose, pkg }) => {
|
|
3277
3432
|
return pkg === void 0 ? publintAll({ verbose }) : await publintPackage({ pkg, verbose });
|
|
@@ -3325,7 +3480,7 @@ var rebuild = ({ target }) => {
|
|
|
3325
3480
|
};
|
|
3326
3481
|
|
|
3327
3482
|
// src/actions/recompile.ts
|
|
3328
|
-
import
|
|
3483
|
+
import chalk43 from "chalk";
|
|
3329
3484
|
var recompile = async ({
|
|
3330
3485
|
verbose,
|
|
3331
3486
|
target,
|
|
@@ -3361,7 +3516,7 @@ var recompileAll = async ({
|
|
|
3361
3516
|
const incrementalOptions = incremental ? ["--since", "-Apt", "--topological-dev"] : ["--parallel", "-Apt", "--topological-dev"];
|
|
3362
3517
|
const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
|
|
3363
3518
|
if (jobs) {
|
|
3364
|
-
console.log(
|
|
3519
|
+
console.log(chalk43.blue(`Jobs set to [${jobs}]`));
|
|
3365
3520
|
}
|
|
3366
3521
|
const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
|
|
3367
3522
|
[
|
|
@@ -3392,7 +3547,7 @@ var recompileAll = async ({
|
|
|
3392
3547
|
]
|
|
3393
3548
|
]);
|
|
3394
3549
|
console.log(
|
|
3395
|
-
`${
|
|
3550
|
+
`${chalk43.gray("Recompiled in")} [${chalk43.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk43.gray("seconds")}`
|
|
3396
3551
|
);
|
|
3397
3552
|
return result;
|
|
3398
3553
|
};
|
|
@@ -3423,13 +3578,13 @@ var reinstall = () => {
|
|
|
3423
3578
|
};
|
|
3424
3579
|
|
|
3425
3580
|
// src/actions/relint.ts
|
|
3426
|
-
import
|
|
3581
|
+
import chalk44 from "chalk";
|
|
3427
3582
|
var relintPackage = ({
|
|
3428
3583
|
pkg,
|
|
3429
3584
|
fix: fix2,
|
|
3430
3585
|
verbose
|
|
3431
3586
|
}) => {
|
|
3432
|
-
console.log(
|
|
3587
|
+
console.log(chalk44.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
|
|
3433
3588
|
const start = Date.now();
|
|
3434
3589
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
|
|
3435
3590
|
["yarn", [
|
|
@@ -3439,7 +3594,7 @@ var relintPackage = ({
|
|
|
3439
3594
|
fix2 ? "package-fix" : verbose ? "package-lint-verbose" : "package-lint"
|
|
3440
3595
|
]]
|
|
3441
3596
|
]);
|
|
3442
|
-
console.log(
|
|
3597
|
+
console.log(chalk44.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk44.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk44.gray("seconds")}`));
|
|
3443
3598
|
return result;
|
|
3444
3599
|
};
|
|
3445
3600
|
var relint = ({
|
|
@@ -3459,13 +3614,13 @@ var relint = ({
|
|
|
3459
3614
|
});
|
|
3460
3615
|
};
|
|
3461
3616
|
var relintAllPackages = ({ fix: fix2 = false } = {}) => {
|
|
3462
|
-
console.log(
|
|
3617
|
+
console.log(chalk44.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
|
|
3463
3618
|
const start = Date.now();
|
|
3464
3619
|
const fixOptions = fix2 ? ["--fix"] : [];
|
|
3465
3620
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
|
|
3466
3621
|
["yarn", ["eslint", ...fixOptions]]
|
|
3467
3622
|
]);
|
|
3468
|
-
console.log(
|
|
3623
|
+
console.log(chalk44.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk44.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk44.gray("seconds")}`));
|
|
3469
3624
|
return result;
|
|
3470
3625
|
};
|
|
3471
3626
|
|
|
@@ -3483,10 +3638,10 @@ var sonar = () => {
|
|
|
3483
3638
|
};
|
|
3484
3639
|
|
|
3485
3640
|
// src/actions/statics.ts
|
|
3486
|
-
import
|
|
3641
|
+
import chalk45 from "chalk";
|
|
3487
3642
|
var DefaultDependencies = ["axios", "@xylabs/pixel", "react", "graphql", "react-router", "@mui/material", "@mui/system"];
|
|
3488
3643
|
var statics = () => {
|
|
3489
|
-
console.log(
|
|
3644
|
+
console.log(chalk45.green("Check Required Static Dependencies"));
|
|
3490
3645
|
const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
|
|
3491
3646
|
return detectDuplicateDependencies(statics2, DefaultDependencies);
|
|
3492
3647
|
};
|
|
@@ -4075,7 +4230,7 @@ var xyInstallCommands = (args) => {
|
|
|
4075
4230
|
};
|
|
4076
4231
|
|
|
4077
4232
|
// src/xy/lint/cycleCommand.ts
|
|
4078
|
-
import
|
|
4233
|
+
import chalk46 from "chalk";
|
|
4079
4234
|
var cycleCommand = {
|
|
4080
4235
|
command: "cycle [package]",
|
|
4081
4236
|
describe: "Cycle - Check for dependency cycles",
|
|
@@ -4086,12 +4241,12 @@ var cycleCommand = {
|
|
|
4086
4241
|
const start = Date.now();
|
|
4087
4242
|
if (argv.verbose) console.log("Cycle");
|
|
4088
4243
|
process.exitCode = await cycle({ pkg: argv.package });
|
|
4089
|
-
console.log(
|
|
4244
|
+
console.log(chalk46.blue(`Finished in ${Date.now() - start}ms`));
|
|
4090
4245
|
}
|
|
4091
4246
|
};
|
|
4092
4247
|
|
|
4093
4248
|
// src/xy/lint/deplintCommand.ts
|
|
4094
|
-
import
|
|
4249
|
+
import chalk47 from "chalk";
|
|
4095
4250
|
var deplintCommand = {
|
|
4096
4251
|
command: "deplint [package]",
|
|
4097
4252
|
describe: "Deplint - Run Deplint",
|
|
@@ -4129,12 +4284,12 @@ var deplintCommand = {
|
|
|
4129
4284
|
peerDeps: !!argv.peerDeps,
|
|
4130
4285
|
verbose: !!argv.verbose
|
|
4131
4286
|
});
|
|
4132
|
-
console.log(
|
|
4287
|
+
console.log(chalk47.blue(`Finished in ${Date.now() - start}ms`));
|
|
4133
4288
|
}
|
|
4134
4289
|
};
|
|
4135
4290
|
|
|
4136
4291
|
// src/xy/lint/fixCommand.ts
|
|
4137
|
-
import
|
|
4292
|
+
import chalk48 from "chalk";
|
|
4138
4293
|
var fixCommand = {
|
|
4139
4294
|
command: "fix [package]",
|
|
4140
4295
|
describe: "Fix - Run Eslint w/fix",
|
|
@@ -4145,12 +4300,12 @@ var fixCommand = {
|
|
|
4145
4300
|
const start = Date.now();
|
|
4146
4301
|
if (argv.verbose) console.log("Fix");
|
|
4147
4302
|
process.exitCode = fix();
|
|
4148
|
-
console.log(
|
|
4303
|
+
console.log(chalk48.blue(`Finished in ${Date.now() - start}ms`));
|
|
4149
4304
|
}
|
|
4150
4305
|
};
|
|
4151
4306
|
|
|
4152
4307
|
// src/xy/lint/knipCommand.ts
|
|
4153
|
-
import
|
|
4308
|
+
import chalk49 from "chalk";
|
|
4154
4309
|
var knipCommand = {
|
|
4155
4310
|
command: "knip",
|
|
4156
4311
|
describe: "Knip - Run Knip",
|
|
@@ -4161,12 +4316,12 @@ var knipCommand = {
|
|
|
4161
4316
|
if (argv.verbose) console.log("Knip");
|
|
4162
4317
|
const start = Date.now();
|
|
4163
4318
|
process.exitCode = knip();
|
|
4164
|
-
console.log(
|
|
4319
|
+
console.log(chalk49.blue(`Knip finished in ${Date.now() - start}ms`));
|
|
4165
4320
|
}
|
|
4166
4321
|
};
|
|
4167
4322
|
|
|
4168
4323
|
// src/xy/lint/lintCommand.ts
|
|
4169
|
-
import
|
|
4324
|
+
import chalk50 from "chalk";
|
|
4170
4325
|
var lintCommand = {
|
|
4171
4326
|
command: "lint [package]",
|
|
4172
4327
|
describe: "Lint - Run Eslint",
|
|
@@ -4195,12 +4350,29 @@ var lintCommand = {
|
|
|
4195
4350
|
cache: argv.cache,
|
|
4196
4351
|
verbose: !!argv.verbose
|
|
4197
4352
|
});
|
|
4198
|
-
console.log(
|
|
4353
|
+
console.log(chalk50.blue(`Finished in ${Date.now() - start}ms`));
|
|
4354
|
+
}
|
|
4355
|
+
};
|
|
4356
|
+
|
|
4357
|
+
// src/xy/lint/packageLintCommand.ts
|
|
4358
|
+
var packageLintCommand = {
|
|
4359
|
+
builder: (yargs2) => {
|
|
4360
|
+
return yargs2.option("fix", {
|
|
4361
|
+
default: false,
|
|
4362
|
+
description: "Auto-fix fixable issues",
|
|
4363
|
+
type: "boolean"
|
|
4364
|
+
});
|
|
4365
|
+
},
|
|
4366
|
+
command: "package-lint",
|
|
4367
|
+
describe: "Package Lint - Check monorepo package structure",
|
|
4368
|
+
handler: (argv) => {
|
|
4369
|
+
if (argv.verbose) console.log("Package Lint");
|
|
4370
|
+
process.exitCode = packageLintMonorepo(!!argv.fix);
|
|
4199
4371
|
}
|
|
4200
4372
|
};
|
|
4201
4373
|
|
|
4202
4374
|
// src/xy/lint/publintCommand.ts
|
|
4203
|
-
import
|
|
4375
|
+
import chalk51 from "chalk";
|
|
4204
4376
|
var publintCommand = {
|
|
4205
4377
|
command: "publint [package]",
|
|
4206
4378
|
describe: "Publint - Run Publint",
|
|
@@ -4211,12 +4383,12 @@ var publintCommand = {
|
|
|
4211
4383
|
if (argv.verbose) console.log("Publint");
|
|
4212
4384
|
const start = Date.now();
|
|
4213
4385
|
process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
|
|
4214
|
-
console.log(
|
|
4386
|
+
console.log(chalk51.blue(`Finished in ${Date.now() - start}ms`));
|
|
4215
4387
|
}
|
|
4216
4388
|
};
|
|
4217
4389
|
|
|
4218
4390
|
// src/xy/lint/relintCommand.ts
|
|
4219
|
-
import
|
|
4391
|
+
import chalk52 from "chalk";
|
|
4220
4392
|
var relintCommand = {
|
|
4221
4393
|
command: "relint [package]",
|
|
4222
4394
|
describe: "Relint - Clean & Lint",
|
|
@@ -4227,12 +4399,12 @@ var relintCommand = {
|
|
|
4227
4399
|
if (argv.verbose) console.log("Relinting");
|
|
4228
4400
|
const start = Date.now();
|
|
4229
4401
|
process.exitCode = relint();
|
|
4230
|
-
console.log(
|
|
4402
|
+
console.log(chalk52.blue(`Finished in ${Date.now() - start}ms`));
|
|
4231
4403
|
}
|
|
4232
4404
|
};
|
|
4233
4405
|
|
|
4234
4406
|
// src/xy/lint/sonarCommand.ts
|
|
4235
|
-
import
|
|
4407
|
+
import chalk53 from "chalk";
|
|
4236
4408
|
var sonarCommand = {
|
|
4237
4409
|
command: "sonar",
|
|
4238
4410
|
describe: "Sonar - Run Sonar Check",
|
|
@@ -4243,17 +4415,17 @@ var sonarCommand = {
|
|
|
4243
4415
|
const start = Date.now();
|
|
4244
4416
|
if (argv.verbose) console.log("Sonar Check");
|
|
4245
4417
|
process.exitCode = sonar();
|
|
4246
|
-
console.log(
|
|
4418
|
+
console.log(chalk53.blue(`Finished in ${Date.now() - start}ms`));
|
|
4247
4419
|
}
|
|
4248
4420
|
};
|
|
4249
4421
|
|
|
4250
4422
|
// src/xy/lint/index.ts
|
|
4251
4423
|
var xyLintCommands = (args) => {
|
|
4252
|
-
return args.command(cycleCommand).command(lintCommand).command(deplintCommand).command(fixCommand).command(relintCommand).command(publintCommand).command(knipCommand).command(sonarCommand);
|
|
4424
|
+
return args.command(cycleCommand).command(lintCommand).command(deplintCommand).command(fixCommand).command(relintCommand).command(publintCommand).command(knipCommand).command(packageLintCommand).command(sonarCommand);
|
|
4253
4425
|
};
|
|
4254
4426
|
|
|
4255
4427
|
// src/xy/xy.ts
|
|
4256
|
-
import
|
|
4428
|
+
import chalk54 from "chalk";
|
|
4257
4429
|
|
|
4258
4430
|
// src/xy/xyParseOptions.ts
|
|
4259
4431
|
import yargs from "yargs";
|
|
@@ -4286,8 +4458,8 @@ var xyParseOptions = () => {
|
|
|
4286
4458
|
var xy = async () => {
|
|
4287
4459
|
const options = xyParseOptions();
|
|
4288
4460
|
return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
|
|
4289
|
-
console.error(
|
|
4290
|
-
console.log(
|
|
4461
|
+
console.error(chalk54.yellow(`Command not found [${chalk54.magenta(process.argv[2])}]`));
|
|
4462
|
+
console.log(chalk54.gray("Try 'yarn xy --help' for list of commands"));
|
|
4291
4463
|
}).version().help().argv;
|
|
4292
4464
|
};
|
|
4293
4465
|
export {
|
|
@@ -4372,6 +4544,7 @@ export {
|
|
|
4372
4544
|
packageCycle,
|
|
4373
4545
|
packageGenDocs,
|
|
4374
4546
|
packageLint,
|
|
4547
|
+
packageLintMonorepo,
|
|
4375
4548
|
packagePublint,
|
|
4376
4549
|
packageRecompile,
|
|
4377
4550
|
parsedPackageJSON,
|