@ariestools/toolchain 9.1.1 → 9.2.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/COPYING +674 -0
- package/LICENSE +165 -0
- package/README.md +56 -22
- package/dist/actions/deplint/checkPackage/getUnlistedDependencies.d.ts.map +1 -1
- package/dist/actions/deplint/checkPackage/getUnlistedDevDependencies.d.ts.map +1 -1
- package/dist/actions/deplint/findFiles.d.ts.map +1 -1
- package/dist/actions/deplint/findFilesByGlob.d.ts.map +1 -1
- package/dist/actions/deplint/getBasePackageName.d.ts +8 -0
- package/dist/actions/deplint/getBasePackageName.d.ts.map +1 -1
- package/dist/actions/deplint/packageEditor.d.ts.map +1 -1
- package/dist/actions/deplint/packageJsonEditor.d.ts.map +1 -1
- package/dist/actions/incremental.d.ts.map +1 -1
- package/dist/actions/package/compile/XyConfig.d.ts +3 -3
- package/dist/actions/package/compile/compile.d.ts.map +1 -1
- package/dist/actions/package-lint-specs.d.ts.map +1 -1
- package/dist/actions/publish.d.ts +6 -1
- package/dist/actions/publish.d.ts.map +1 -1
- package/dist/actions/repo-init/index.d.ts +2 -1
- package/dist/actions/repo-init/index.d.ts.map +1 -1
- package/dist/actions/repo-init/resolvePlan.d.ts +1 -0
- package/dist/actions/repo-init/resolvePlan.d.ts.map +1 -1
- package/dist/actions/repo-init/templateVars.d.ts +1 -0
- package/dist/actions/repo-init/templateVars.d.ts.map +1 -1
- package/dist/actions/repo-init/types.d.ts +16 -0
- package/dist/actions/repo-init/types.d.ts.map +1 -1
- package/dist/actions/repo-init.d.ts +1 -1
- package/dist/actions/repo-init.d.ts.map +1 -1
- package/dist/actions/skills/defaults.d.ts +16 -2
- package/dist/actions/skills/defaults.d.ts.map +1 -1
- package/dist/actions/skills/index.d.ts +1 -1
- package/dist/actions/skills/index.d.ts.map +1 -1
- package/dist/actions/skills/lint.d.ts +7 -0
- package/dist/actions/skills/lint.d.ts.map +1 -1
- package/dist/actions/skills/lock.d.ts +22 -0
- package/dist/actions/skills/lock.d.ts.map +1 -0
- package/dist/actions/skills/passthrough.d.ts.map +1 -1
- package/dist/actions/skills/skillRules.d.ts +2 -2
- package/dist/actions/skills/skillRules.d.ts.map +1 -1
- package/dist/actions/sonar.d.ts +4 -0
- package/dist/actions/sonar.d.ts.map +1 -1
- package/dist/bin/package/build.mjs +4 -0
- package/dist/bin/package/build.mjs.map +1 -1
- package/dist/bin/package/compile.mjs +4 -0
- package/dist/bin/package/compile.mjs.map +1 -1
- package/dist/bin/package/recompile.mjs +4 -0
- package/dist/bin/package/recompile.mjs.map +1 -1
- package/dist/bin/xy.mjs +813 -256
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/bin/xyex.d.ts +3 -0
- package/dist/bin/xyex.d.ts.map +1 -0
- package/dist/bin/xyex.mjs +62920 -0
- package/dist/bin/xyex.mjs.map +1 -0
- package/dist/lib/gitCheckoutRoot.d.ts +17 -0
- package/dist/lib/gitCheckoutRoot.d.ts.map +1 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/pm/PackageManager.d.ts +7 -0
- package/dist/pm/PackageManager.d.ts.map +1 -1
- package/dist/pm/bunPackageManager.d.ts +1 -1
- package/dist/pm/bunPackageManager.d.ts.map +1 -1
- package/dist/pm/npmPackageManager.d.ts +1 -1
- package/dist/pm/npmPackageManager.d.ts.map +1 -1
- package/dist/pm/pnpmPackageManager.d.ts.map +1 -1
- package/dist/pm/yarnPackageManager.d.ts +1 -1
- package/dist/pm/yarnPackageManager.d.ts.map +1 -1
- package/dist/xy/build/index.d.ts +5 -1
- package/dist/xy/build/index.d.ts.map +1 -1
- package/dist/xy/common/index.d.ts +10 -1
- package/dist/xy/common/index.d.ts.map +1 -1
- package/dist/xy/common/packmanCommand.d.ts +7 -0
- package/dist/xy/common/packmanCommand.d.ts.map +1 -1
- package/dist/xy/common/repo/initCommand.d.ts.map +1 -1
- package/dist/xy/common/skills/index.d.ts.map +1 -1
- package/dist/xy/deploy/publishCommand.d.ts.map +1 -1
- package/dist/xy/experimentalCommand.d.ts +11 -0
- package/dist/xy/experimentalCommand.d.ts.map +1 -0
- package/dist/xy/index.d.ts +3 -0
- package/dist/xy/index.d.ts.map +1 -1
- package/dist/xy/lint/index.d.ts +5 -1
- package/dist/xy/lint/index.d.ts.map +1 -1
- package/dist/xy/react/index.d.ts +5 -1
- package/dist/xy/react/index.d.ts.map +1 -1
- package/dist/xy/stability.d.ts +94 -0
- package/dist/xy/stability.d.ts.map +1 -0
- package/dist/xy/stabilityCatalog.d.ts +30 -0
- package/dist/xy/stabilityCatalog.d.ts.map +1 -0
- package/dist/xy/xy.d.ts +19 -1
- package/dist/xy/xy.d.ts.map +1 -1
- package/dist/xy/xyParseOptions.d.ts +6 -1
- package/dist/xy/xyParseOptions.d.ts.map +1 -1
- package/package.json +19 -14
- package/templates/repo/cli/package/package.json.tmpl +7 -7
- package/templates/repo/cli/root/LICENSE.tmpl +1 -0
- package/templates/repo/cli/root/cspell.json.tmpl +1 -1
- package/templates/repo/cli/root/github/workflows/build-bun.yml.tmpl +8 -12
- package/templates/repo/cli/root/github/workflows/build-npm.yml.tmpl +10 -15
- package/templates/repo/cli/root/github/workflows/build-pnpm.yml.tmpl +9 -14
- package/templates/repo/cli/root/github/workflows/build-yarn.yml.tmpl +9 -14
- package/templates/repo/cli/root/package.json.tmpl +10 -9
- package/templates/repo/cli/root/vitest.config.ts.tmpl +3 -29
package/dist/bin/xy.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { builtinModules, createRequire } from "node:module";
|
|
3
|
+
import process$1, { cwd } from "node:process";
|
|
4
|
+
import os, { EOL, availableParallelism } from "node:os";
|
|
5
|
+
import tty from "node:tty";
|
|
3
6
|
import * as xi from "node:fs";
|
|
4
7
|
import fs, { closeSync, copyFileSync, existsSync, lstatSync, mkdirSync, openSync, promises, readFileSync, readSync, readdirSync, readlinkSync, rmSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
5
8
|
import PATH, { basename, delimiter, dirname, normalize, posix, resolve, win32 } from "node:path";
|
|
6
9
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
7
|
-
import process$1, { cwd } from "node:process";
|
|
8
|
-
import os, { EOL, availableParallelism } from "node:os";
|
|
9
|
-
import tty from "node:tty";
|
|
10
10
|
import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
|
|
11
11
|
import path from "node:path/posix";
|
|
12
12
|
import { lstatSync as lstatSync$1, readFileSync as readFileSync$1, readdir, readdirSync as readdirSync$1, readlinkSync as readlinkSync$1, realpathSync, statSync as statSync$1, writeFile } from "fs";
|
|
@@ -73,54 +73,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
73
73
|
}) : target, mod));
|
|
74
74
|
var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
|
|
75
75
|
//#endregion
|
|
76
|
-
//#region src/lib/aliasSpec.ts
|
|
77
|
-
const ALIAS_PREFIX = "npm:";
|
|
78
|
-
/**
|
|
79
|
-
* Splits an `npm:` alias spec into the registry name and the semver range it
|
|
80
|
-
* carries: `npm:typescript@~7.0.2` → `{ registryName: 'typescript', range: '~7.0.2' }`.
|
|
81
|
-
*
|
|
82
|
-
* Aliases exist so two releases of one package can be installed side by side —
|
|
83
|
-
* `typescript` (the compiler API) alongside `npm:typescript@7` (the native
|
|
84
|
-
* compiler). Without this, the declaration key is the only name updo sees, and
|
|
85
|
-
* a key like `typescript-native` is not a real package: the registry lookup
|
|
86
|
-
* 404s and the dependency is silently never updated.
|
|
87
|
-
*
|
|
88
|
-
* Returns undefined for non-alias specs and for alias specs carrying no range
|
|
89
|
-
* (`npm:typescript`), which express no version intent to move.
|
|
90
|
-
*/
|
|
91
|
-
function parseAliasSpec(spec) {
|
|
92
|
-
if (!spec.startsWith(ALIAS_PREFIX)) return void 0;
|
|
93
|
-
const target = spec.slice(4);
|
|
94
|
-
const separator = target.indexOf("@", 1);
|
|
95
|
-
if (separator <= 0 || separator === target.length - 1) return void 0;
|
|
96
|
-
return {
|
|
97
|
-
range: target.slice(separator + 1),
|
|
98
|
-
registryName: target.slice(0, separator)
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Re-wraps a resolved range in its `npm:` alias spec, so an update to an
|
|
103
|
-
* aliased declaration is written back in the form the package manager expects.
|
|
104
|
-
* Non-aliased declarations pass through untouched.
|
|
105
|
-
*/
|
|
106
|
-
function formatDeclaredRange(dep, range) {
|
|
107
|
-
return dep.registryName === dep.name ? range : `${ALIAS_PREFIX}${dep.registryName}@${range}`;
|
|
108
|
-
}
|
|
109
|
-
//#endregion
|
|
110
|
-
//#region src/lib/bundledCliPath.ts
|
|
111
|
-
const require$8 = createRequire(import.meta.url);
|
|
112
|
-
function toolchainPackageRoot() {
|
|
113
|
-
return PATH.dirname(require$8.resolve("@ariestools/toolchain/package.json"));
|
|
114
|
-
}
|
|
115
|
-
function bundledCliPath(name) {
|
|
116
|
-
return PATH.resolve(toolchainPackageRoot(), "dist/bin", name);
|
|
117
|
-
}
|
|
118
|
-
function resolvePublishedOrDevCli(bundledName, devResolve) {
|
|
119
|
-
const bundled = bundledCliPath(bundledName);
|
|
120
|
-
if (existsSync(bundled)) return bundled;
|
|
121
|
-
return devResolve();
|
|
122
|
-
}
|
|
123
|
-
//#endregion
|
|
124
76
|
//#region ../../node_modules/.pnpm/chalk@6.0.0/node_modules/chalk/source/utilities.js
|
|
125
77
|
function stringReplaceAll(string, substring, postfix) {
|
|
126
78
|
let index = string.indexOf(substring);
|
|
@@ -595,6 +547,89 @@ Object.defineProperties(createChalk.prototype, {
|
|
|
595
547
|
const chalk = createChalk();
|
|
596
548
|
createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
597
549
|
//#endregion
|
|
550
|
+
//#region src/xy/experimentalCommand.ts
|
|
551
|
+
function warnExperimentalCommand(commandName) {
|
|
552
|
+
console.warn(chalk.yellow(`Experimental: "xy ${commandName}" is an experimental command. Prefer "xyex ${commandName}" — the xyex surface may change without a major version bump.`));
|
|
553
|
+
}
|
|
554
|
+
function printXyexBanner() {
|
|
555
|
+
console.warn(chalk.magenta("⬡ XYEX — experimental CLI supersets. Commands and flags here may change on minor releases. Prefer `xy` for stable automation."));
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* Wraps a yargs command so the stable `xy` channel warns (and relabels help)
|
|
559
|
+
* while `xyex` exposes it unchanged.
|
|
560
|
+
*/
|
|
561
|
+
function withExperimentalChannel(command, channel, catalogName) {
|
|
562
|
+
const commandName = catalogName ?? (typeof command.command === "string" ? command.command.split(" ", 1)[0] ?? "unknown" : "unknown");
|
|
563
|
+
if (channel === "experimental") return command;
|
|
564
|
+
const describe = typeof command.describe === "string" ? `${command.describe} (experimental — prefer xyex)` : command.describe;
|
|
565
|
+
const originalHandler = command.handler;
|
|
566
|
+
if (originalHandler === void 0) return {
|
|
567
|
+
...command,
|
|
568
|
+
describe
|
|
569
|
+
};
|
|
570
|
+
return {
|
|
571
|
+
...command,
|
|
572
|
+
describe,
|
|
573
|
+
handler: (argv) => {
|
|
574
|
+
warnExperimentalCommand(commandName);
|
|
575
|
+
return originalHandler(argv);
|
|
576
|
+
}
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
function registerExperimentalCommands(args, channel, commands) {
|
|
580
|
+
let next = args;
|
|
581
|
+
for (const command of commands) next = next.command(withExperimentalChannel(command, channel));
|
|
582
|
+
return next;
|
|
583
|
+
}
|
|
584
|
+
//#endregion
|
|
585
|
+
//#region src/lib/aliasSpec.ts
|
|
586
|
+
const ALIAS_PREFIX = "npm:";
|
|
587
|
+
/**
|
|
588
|
+
* Splits an `npm:` alias spec into the registry name and the semver range it
|
|
589
|
+
* carries: `npm:typescript@~7.0.2` → `{ registryName: 'typescript', range: '~7.0.2' }`.
|
|
590
|
+
*
|
|
591
|
+
* Aliases exist so two releases of one package can be installed side by side —
|
|
592
|
+
* `typescript` (the compiler API) alongside `npm:typescript@7` (the native
|
|
593
|
+
* compiler). Without this, the declaration key is the only name updo sees, and
|
|
594
|
+
* a key like `typescript-native` is not a real package: the registry lookup
|
|
595
|
+
* 404s and the dependency is silently never updated.
|
|
596
|
+
*
|
|
597
|
+
* Returns undefined for non-alias specs and for alias specs carrying no range
|
|
598
|
+
* (`npm:typescript`), which express no version intent to move.
|
|
599
|
+
*/
|
|
600
|
+
function parseAliasSpec(spec) {
|
|
601
|
+
if (!spec.startsWith(ALIAS_PREFIX)) return void 0;
|
|
602
|
+
const target = spec.slice(4);
|
|
603
|
+
const separator = target.indexOf("@", 1);
|
|
604
|
+
if (separator <= 0 || separator === target.length - 1) return void 0;
|
|
605
|
+
return {
|
|
606
|
+
range: target.slice(separator + 1),
|
|
607
|
+
registryName: target.slice(0, separator)
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* Re-wraps a resolved range in its `npm:` alias spec, so an update to an
|
|
612
|
+
* aliased declaration is written back in the form the package manager expects.
|
|
613
|
+
* Non-aliased declarations pass through untouched.
|
|
614
|
+
*/
|
|
615
|
+
function formatDeclaredRange(dep, range) {
|
|
616
|
+
return dep.registryName === dep.name ? range : `${ALIAS_PREFIX}${dep.registryName}@${range}`;
|
|
617
|
+
}
|
|
618
|
+
//#endregion
|
|
619
|
+
//#region src/lib/bundledCliPath.ts
|
|
620
|
+
const require$8 = createRequire(import.meta.url);
|
|
621
|
+
function toolchainPackageRoot() {
|
|
622
|
+
return PATH.dirname(require$8.resolve("@ariestools/toolchain/package.json"));
|
|
623
|
+
}
|
|
624
|
+
function bundledCliPath(name) {
|
|
625
|
+
return PATH.resolve(toolchainPackageRoot(), "dist/bin", name);
|
|
626
|
+
}
|
|
627
|
+
function resolvePublishedOrDevCli(bundledName, devResolve) {
|
|
628
|
+
const bundled = bundledCliPath(bundledName);
|
|
629
|
+
if (existsSync(bundled)) return bundled;
|
|
630
|
+
return devResolve();
|
|
631
|
+
}
|
|
632
|
+
//#endregion
|
|
598
633
|
//#region src/lib/checkResult.ts
|
|
599
634
|
function logFailure(name, result, level, suffix) {
|
|
600
635
|
const message = `${name} had ${result} failures [${suffix}]`;
|
|
@@ -4729,8 +4764,8 @@ var BunPackageManager = class {
|
|
|
4729
4764
|
outdated() {
|
|
4730
4765
|
return ["bun", ["outdated"]];
|
|
4731
4766
|
}
|
|
4732
|
-
publish(
|
|
4733
|
-
return [["bun", ["publish"]]];
|
|
4767
|
+
publish(options = {}) {
|
|
4768
|
+
return [["bun", ["publish", ...options.tag != null && options.tag.length > 0 ? ["--tag", options.tag] : []]]];
|
|
4734
4769
|
}
|
|
4735
4770
|
runInWorkspace(pkg, script, args = []) {
|
|
4736
4771
|
const resolved = this.findWorkspace(pkg)?.name ?? pkg;
|
|
@@ -4896,11 +4931,12 @@ var NpmPackageManager = class {
|
|
|
4896
4931
|
outdated() {
|
|
4897
4932
|
return ["npm", ["outdated", "--workspaces"]];
|
|
4898
4933
|
}
|
|
4899
|
-
publish(
|
|
4934
|
+
publish(options = {}) {
|
|
4900
4935
|
return [["npm", [
|
|
4901
4936
|
"publish",
|
|
4902
4937
|
"--workspaces",
|
|
4903
|
-
"--include-workspace-root=false"
|
|
4938
|
+
"--include-workspace-root=false",
|
|
4939
|
+
...options.tag != null && options.tag.length > 0 ? ["--tag", options.tag] : []
|
|
4904
4940
|
]]];
|
|
4905
4941
|
}
|
|
4906
4942
|
runInWorkspace(pkg, script, args = []) {
|
|
@@ -5045,7 +5081,11 @@ var PnpmPackageManager = class {
|
|
|
5045
5081
|
publish(options = {}) {
|
|
5046
5082
|
const reporterFlags = options.verbose ?? false ? ["--loglevel=debug"] : ["--reporter=append-only"];
|
|
5047
5083
|
const env = { NODE_OPTIONS: "--max-old-space-size=8192" };
|
|
5048
|
-
const baseFlags = [
|
|
5084
|
+
const baseFlags = [
|
|
5085
|
+
"--no-git-checks",
|
|
5086
|
+
...options.tag != null && options.tag.length > 0 ? ["--tag", options.tag] : [],
|
|
5087
|
+
...reporterFlags
|
|
5088
|
+
];
|
|
5049
5089
|
const chunkSize = options.chunkSize ?? 0;
|
|
5050
5090
|
if (chunkSize <= 0) return [[
|
|
5051
5091
|
"pnpm",
|
|
@@ -5196,8 +5236,12 @@ var YarnPackageManager = class {
|
|
|
5196
5236
|
outdated() {
|
|
5197
5237
|
return ["yarn", ["outdated"]];
|
|
5198
5238
|
}
|
|
5199
|
-
publish(
|
|
5200
|
-
return [["npm", [
|
|
5239
|
+
publish(options = {}) {
|
|
5240
|
+
return [["npm", [
|
|
5241
|
+
"publish",
|
|
5242
|
+
"--workspaces",
|
|
5243
|
+
...options.tag != null && options.tag.length > 0 ? ["--tag", options.tag] : []
|
|
5244
|
+
]]];
|
|
5201
5245
|
}
|
|
5202
5246
|
runInWorkspace(pkg, script, args = []) {
|
|
5203
5247
|
const resolved = this.findWorkspace(pkg)?.name ?? pkg;
|
|
@@ -6878,6 +6922,26 @@ const generateIgnoreFiles = (filename, pkg) => {
|
|
|
6878
6922
|
}).every((result) => result === 0) ? 0 : 1;
|
|
6879
6923
|
};
|
|
6880
6924
|
//#endregion
|
|
6925
|
+
//#region src/lib/gitCheckoutRoot.ts
|
|
6926
|
+
/**
|
|
6927
|
+
* Claude Code's per-repo settings/session directory. It holds agent state —
|
|
6928
|
+
* including full Git worktrees under `.claude/worktrees/**` created for
|
|
6929
|
+
* background task sessions — and never holds package source, so file
|
|
6930
|
+
* discovery skips it wholesale.
|
|
6931
|
+
*/
|
|
6932
|
+
const CLAUDE_SETTINGS_DIR = ".claude";
|
|
6933
|
+
/**
|
|
6934
|
+
* True when `dir` is the root of its own Git checkout: a linked `git
|
|
6935
|
+
* worktree` (marked by a `.git` file), such as the `.claude/worktrees/**`
|
|
6936
|
+
* checkouts Claude Code creates for background sessions, or a nested clone
|
|
6937
|
+
* (marked by a `.git` directory). Files inside such a tree belong to that
|
|
6938
|
+
* checkout — file discovery for an enclosing package must never attribute
|
|
6939
|
+
* them to the package being scanned.
|
|
6940
|
+
*/
|
|
6941
|
+
function isGitCheckoutRoot(dir) {
|
|
6942
|
+
return fs.existsSync(PATH.join(dir, ".git"));
|
|
6943
|
+
}
|
|
6944
|
+
//#endregion
|
|
6881
6945
|
//#region src/lib/gitConfig.ts
|
|
6882
6946
|
/**
|
|
6883
6947
|
* Read a single Git config value via `git config --get <key>`.
|
|
@@ -10635,7 +10699,7 @@ In-flight workspace loads — concurrent jobs for the same dir share one search.
|
|
|
10635
10699
|
*/
|
|
10636
10700
|
const workspaceConfigLoadPromises = /* @__PURE__ */ new Map();
|
|
10637
10701
|
const deprecationWarned = /* @__PURE__ */ new Set();
|
|
10638
|
-
function isRecord$
|
|
10702
|
+
function isRecord$11(value) {
|
|
10639
10703
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
10640
10704
|
}
|
|
10641
10705
|
const explorerState = {};
|
|
@@ -10716,12 +10780,12 @@ function warnOnce(key, message) {
|
|
|
10716
10780
|
*/
|
|
10717
10781
|
function resolveCommandField(cfg, commandName, configPath) {
|
|
10718
10782
|
const configKey = canonicalRuleConfigKey(commandName);
|
|
10719
|
-
const commands = isRecord$
|
|
10783
|
+
const commands = isRecord$11(cfg.commands) ? cfg.commands : void 0;
|
|
10720
10784
|
const fromCommands = commands?.[configKey];
|
|
10721
|
-
if (isRecord$
|
|
10785
|
+
if (isRecord$11(fromCommands)) return fromCommands;
|
|
10722
10786
|
for (const alias of deprecatedRuleConfigAliases(configKey)) {
|
|
10723
10787
|
const fromAlias = commands?.[alias];
|
|
10724
|
-
if (!isRecord$
|
|
10788
|
+
if (!isRecord$11(fromAlias)) continue;
|
|
10725
10789
|
warnOnce(`${configPath ?? "unknown"}:commands.${alias}`, `[xy] Deprecated: "commands.${alias}" in ${configPath ?? "xy.config"} — use "commands.${configKey}"`);
|
|
10726
10790
|
return fromAlias;
|
|
10727
10791
|
}
|
|
@@ -10733,7 +10797,7 @@ function resolveCommandField(cfg, commandName, configPath) {
|
|
|
10733
10797
|
return {};
|
|
10734
10798
|
}
|
|
10735
10799
|
function mergeRuleConfigs(target, source) {
|
|
10736
|
-
if (isRecord$
|
|
10800
|
+
if (isRecord$11(target) && isRecord$11(source)) return {
|
|
10737
10801
|
...target,
|
|
10738
10802
|
...source
|
|
10739
10803
|
};
|
|
@@ -19474,7 +19538,7 @@ const SEVERITIES = /* @__PURE__ */ new Set([
|
|
|
19474
19538
|
]);
|
|
19475
19539
|
const SCOPES = /* @__PURE__ */ new Set(["development", "runtime"]);
|
|
19476
19540
|
const RELATIONSHIPS = /* @__PURE__ */ new Set(["direct", "transitive"]);
|
|
19477
|
-
function isRecord$
|
|
19541
|
+
function isRecord$10(value) {
|
|
19478
19542
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
19479
19543
|
}
|
|
19480
19544
|
function readString(value) {
|
|
@@ -19493,13 +19557,13 @@ function readRelationship(value) {
|
|
|
19493
19557
|
return RELATIONSHIPS.has(raw) ? raw : "unknown";
|
|
19494
19558
|
}
|
|
19495
19559
|
function parseDependabotAlert(raw) {
|
|
19496
|
-
if (!isRecord$
|
|
19497
|
-
const dependency = isRecord$
|
|
19498
|
-
const dependencyPackage = isRecord$
|
|
19499
|
-
const advisory = isRecord$
|
|
19500
|
-
const vulnerability = isRecord$
|
|
19501
|
-
const patched = isRecord$
|
|
19502
|
-
const repository = isRecord$
|
|
19560
|
+
if (!isRecord$10(raw)) return void 0;
|
|
19561
|
+
const dependency = isRecord$10(raw.dependency) ? raw.dependency : {};
|
|
19562
|
+
const dependencyPackage = isRecord$10(dependency.package) ? dependency.package : {};
|
|
19563
|
+
const advisory = isRecord$10(raw.security_advisory) ? raw.security_advisory : {};
|
|
19564
|
+
const vulnerability = isRecord$10(raw.security_vulnerability) ? raw.security_vulnerability : {};
|
|
19565
|
+
const patched = isRecord$10(vulnerability.first_patched_version) ? vulnerability.first_patched_version : {};
|
|
19566
|
+
const repository = isRecord$10(raw.repository) ? raw.repository : {};
|
|
19503
19567
|
const packageName = readString(dependencyPackage.name);
|
|
19504
19568
|
if (packageName.length === 0) return void 0;
|
|
19505
19569
|
const patchedVersion = readString(patched.identifier);
|
|
@@ -22821,11 +22885,36 @@ function resolvePeerTargetSections(hasRuntimeSource, peerTargetOrIsTerminal) {
|
|
|
22821
22885
|
//#endregion
|
|
22822
22886
|
//#region src/actions/deplint/findFilesByGlob.ts
|
|
22823
22887
|
init_index_min();
|
|
22824
|
-
|
|
22888
|
+
/**
|
|
22889
|
+
* Wraps the pattern ignores with pruning of nested Git checkouts: any
|
|
22890
|
+
* directory below the scan root that is itself the root of a Git checkout —
|
|
22891
|
+
* a linked worktree such as the `.claude/worktrees/**` checkouts Claude Code
|
|
22892
|
+
* creates for background task sessions, or a nested clone — is a foreign tree
|
|
22893
|
+
* whose files must not be attributed to the package being scanned. Pruning at
|
|
22894
|
+
* the checkout root also keeps the walk from descending into it at all.
|
|
22895
|
+
*/
|
|
22896
|
+
function createIgnore(patterns) {
|
|
22897
|
+
const patternIgnore = new ot(patterns, {});
|
|
22898
|
+
const checkoutRootCache = /* @__PURE__ */ new Map();
|
|
22899
|
+
const isNestedCheckoutRoot = (relative, fullpath) => {
|
|
22900
|
+
if (relative === "") return false;
|
|
22901
|
+
let isCheckoutRoot = checkoutRootCache.get(fullpath);
|
|
22902
|
+
if (isCheckoutRoot === void 0) {
|
|
22903
|
+
isCheckoutRoot = isGitCheckoutRoot(fullpath);
|
|
22904
|
+
checkoutRootCache.set(fullpath, isCheckoutRoot);
|
|
22905
|
+
}
|
|
22906
|
+
return isCheckoutRoot;
|
|
22907
|
+
};
|
|
22908
|
+
return {
|
|
22909
|
+
childrenIgnored: (p) => patternIgnore.childrenIgnored(p) || isNestedCheckoutRoot(p.relative(), p.fullpath()),
|
|
22910
|
+
ignored: (p) => patternIgnore.ignored(p) || p.isDirectory() && isNestedCheckoutRoot(p.relative(), p.fullpath())
|
|
22911
|
+
};
|
|
22912
|
+
}
|
|
22913
|
+
function findFilesByGlob(cwd, pattern, ignore = []) {
|
|
22825
22914
|
return ts$1(pattern, {
|
|
22826
22915
|
cwd,
|
|
22827
22916
|
absolute: true,
|
|
22828
|
-
ignore,
|
|
22917
|
+
ignore: createIgnore(ignore),
|
|
22829
22918
|
nodir: true,
|
|
22830
22919
|
dot: true
|
|
22831
22920
|
});
|
|
@@ -23068,7 +23157,7 @@ const RULE_LEVELS$2 = /* @__PURE__ */ new Set([
|
|
|
23068
23157
|
"off",
|
|
23069
23158
|
"warn"
|
|
23070
23159
|
]);
|
|
23071
|
-
function isRecord$
|
|
23160
|
+
function isRecord$9(value) {
|
|
23072
23161
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
23073
23162
|
}
|
|
23074
23163
|
function isValidWeight(value) {
|
|
@@ -23085,7 +23174,7 @@ function parseTupleRuleSetting(location, setting) {
|
|
|
23085
23174
|
if (setting.length !== 2) throw new TypeError(`${location} tuple must be [level, options]`);
|
|
23086
23175
|
const [level, options] = setting;
|
|
23087
23176
|
if (!isRuleLevel$5(level)) throw new TypeError(`${location} level must be "error", "warn", or "off"`);
|
|
23088
|
-
if (!isRecord$
|
|
23177
|
+
if (!isRecord$9(options)) throw new TypeError(`${location} options must be an object`);
|
|
23089
23178
|
return {
|
|
23090
23179
|
enabled: level !== "off",
|
|
23091
23180
|
level,
|
|
@@ -23118,7 +23207,7 @@ function parseRuleSetting(location, setting) {
|
|
|
23118
23207
|
weight: parseWeight(location, setting)
|
|
23119
23208
|
};
|
|
23120
23209
|
if (Array.isArray(setting)) return parseTupleRuleSetting(location, setting);
|
|
23121
|
-
if (isRecord$
|
|
23210
|
+
if (isRecord$9(setting)) return parseObjectRuleSetting(location, setting);
|
|
23122
23211
|
throw new TypeError(`${location} must be a boolean, rule level, number, "infinite", [level, options], or { enabled?, level?, weight? } object`);
|
|
23123
23212
|
}
|
|
23124
23213
|
function validateRuleIds(location, rules) {
|
|
@@ -23466,7 +23555,31 @@ function getBasePackageName(importName) {
|
|
|
23466
23555
|
const parts = importNameScrubbed.split("/");
|
|
23467
23556
|
return parts.length >= 2 ? `${parts[0]}/${parts[1]}` : importNameScrubbed;
|
|
23468
23557
|
}
|
|
23469
|
-
return importNameScrubbed.split("/", 1)[0];
|
|
23558
|
+
return importNameScrubbed.split("/", 1)[0] ?? "";
|
|
23559
|
+
}
|
|
23560
|
+
/**
|
|
23561
|
+
* npm package names that are safe as package.json dependency keys.
|
|
23562
|
+
* Rejects empty strings, `@scope` without a package, path-like leftovers
|
|
23563
|
+
* (`/foo`), and other names the registry would not accept.
|
|
23564
|
+
*/
|
|
23565
|
+
function isValidNpmDependencyName(name) {
|
|
23566
|
+
if (name.length === 0 || name.length > 214) return false;
|
|
23567
|
+
if (name.startsWith(".") || name.startsWith("_")) return false;
|
|
23568
|
+
if (name.includes("..") || name.includes("\\") || /\s/.test(name)) return false;
|
|
23569
|
+
if (name.startsWith("@")) {
|
|
23570
|
+
const slash = name.indexOf("/");
|
|
23571
|
+
if (slash <= 1 || slash === name.length - 1) return false;
|
|
23572
|
+
return isUnscopedNpmName(name.slice(1, slash)) && isUnscopedNpmName(name.slice(slash + 1));
|
|
23573
|
+
}
|
|
23574
|
+
return isUnscopedNpmName(name);
|
|
23575
|
+
}
|
|
23576
|
+
function isUnscopedNpmName(name) {
|
|
23577
|
+
return name.length > 0 && /^[\da-z][\w.~-]*$/i.test(name);
|
|
23578
|
+
}
|
|
23579
|
+
/** Package name derived from an import specifier, or undefined if it is not a real npm name. */
|
|
23580
|
+
function packageNameFromImport(importName) {
|
|
23581
|
+
const name = getBasePackageName(importName);
|
|
23582
|
+
return isValidNpmDependencyName(name) ? name : void 0;
|
|
23470
23583
|
}
|
|
23471
23584
|
//#endregion
|
|
23472
23585
|
//#region src/actions/api-exposure/analyzer/couplingWalk.ts
|
|
@@ -24349,8 +24462,8 @@ function getImportsFromFile(filePath, importPaths, typeImportPaths) {
|
|
|
24349
24462
|
"node:"
|
|
24350
24463
|
];
|
|
24351
24464
|
const isValidImport = (imp) => importsStartsWithExcludes.every((exc) => !imp.startsWith(exc)) && !imp.includes("*") && !imp.includes("!");
|
|
24352
|
-
const cleanedImports = imports.filter(isValidImport).map(
|
|
24353
|
-
const cleanedTypeImports = typeImports.filter(isValidImport).map(
|
|
24465
|
+
const cleanedImports = imports.filter(isValidImport).map(packageNameFromImport).filter((name) => name !== void 0);
|
|
24466
|
+
const cleanedTypeImports = typeImports.filter(isValidImport).map(packageNameFromImport).filter((name) => name !== void 0);
|
|
24354
24467
|
for (const imp of cleanedImports) {
|
|
24355
24468
|
importPaths[imp] ??= [];
|
|
24356
24469
|
importPaths[imp].push(filePath);
|
|
@@ -25316,6 +25429,7 @@ const workspaceDependencyFields = [
|
|
|
25316
25429
|
];
|
|
25317
25430
|
const ignoredInputDirs = /* @__PURE__ */ new Set([
|
|
25318
25431
|
".cache",
|
|
25432
|
+
".claude",
|
|
25319
25433
|
".git",
|
|
25320
25434
|
".next",
|
|
25321
25435
|
".turbo",
|
|
@@ -25403,7 +25517,8 @@ function collectFiles(dir, baseDir = dir) {
|
|
|
25403
25517
|
const entries = readdirSync(dir, { withFileTypes: true });
|
|
25404
25518
|
for (const entry of entries) {
|
|
25405
25519
|
if (entry.isDirectory()) {
|
|
25406
|
-
|
|
25520
|
+
const childDir = PATH.join(dir, entry.name);
|
|
25521
|
+
if (!ignoredInputDirs.has(entry.name) && !isGitCheckoutRoot(childDir)) files.push(...collectFiles(childDir, baseDir));
|
|
25407
25522
|
continue;
|
|
25408
25523
|
}
|
|
25409
25524
|
if (!entry.isFile() && !entry.isSymbolicLink()) continue;
|
|
@@ -26429,11 +26544,11 @@ function applyPackageEditsToTsSource(text, edits) {
|
|
|
26429
26544
|
}
|
|
26430
26545
|
return result;
|
|
26431
26546
|
}
|
|
26432
|
-
function isRecord$
|
|
26547
|
+
function isRecord$8(value) {
|
|
26433
26548
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
26434
26549
|
}
|
|
26435
26550
|
function readJsonPackageConfig(value) {
|
|
26436
|
-
if (!isRecord$
|
|
26551
|
+
if (!isRecord$8(value)) return void 0;
|
|
26437
26552
|
const config = {};
|
|
26438
26553
|
if (typeof value.placement === "string") config.placement = value.placement;
|
|
26439
26554
|
if (typeof value.presence === "string") config.presence = value.presence;
|
|
@@ -26442,10 +26557,10 @@ function readJsonPackageConfig(value) {
|
|
|
26442
26557
|
return config;
|
|
26443
26558
|
}
|
|
26444
26559
|
function resolveJsonDeplintObject(root) {
|
|
26445
|
-
const commands = isRecord$
|
|
26446
|
-
if (commands !== void 0 && isRecord$
|
|
26447
|
-
if (isRecord$
|
|
26448
|
-
if (!isRecord$
|
|
26560
|
+
const commands = isRecord$8(root.commands) ? root.commands : void 0;
|
|
26561
|
+
if (commands !== void 0 && isRecord$8(commands.deplint)) return commands.deplint;
|
|
26562
|
+
if (isRecord$8(root.deplint)) return root.deplint;
|
|
26563
|
+
if (!isRecord$8(root.commands)) root.commands = {};
|
|
26449
26564
|
const cmds = root.commands;
|
|
26450
26565
|
const deplint = {};
|
|
26451
26566
|
cmds.deplint = deplint;
|
|
@@ -26458,7 +26573,7 @@ function applyPackageEditsToJsonSource(text, edits) {
|
|
|
26458
26573
|
if (edits.length === 0) return text;
|
|
26459
26574
|
const root = JSON.parse(text);
|
|
26460
26575
|
const deplint = resolveJsonDeplintObject(root);
|
|
26461
|
-
const packages = isRecord$
|
|
26576
|
+
const packages = isRecord$8(deplint.packages) ? deplint.packages : deplint.packages = {};
|
|
26462
26577
|
for (const edit of edits) if (edit.config === void 0) delete packages[edit.dependency];
|
|
26463
26578
|
else packages[edit.dependency] = edit.config;
|
|
26464
26579
|
if (Object.keys(packages).length === 0) delete deplint.packages;
|
|
@@ -26493,9 +26608,9 @@ function readPackagesFromConfigFile(configPath) {
|
|
|
26493
26608
|
const result = /* @__PURE__ */ new Map();
|
|
26494
26609
|
if (isJsonConfigPath$1(configPath)) try {
|
|
26495
26610
|
const root = JSON.parse(text);
|
|
26496
|
-
const commands = isRecord$
|
|
26497
|
-
const deplint = commands !== void 0 && isRecord$
|
|
26498
|
-
const packages = deplint !== void 0 && isRecord$
|
|
26611
|
+
const commands = isRecord$8(root.commands) ? root.commands : void 0;
|
|
26612
|
+
const deplint = commands !== void 0 && isRecord$8(commands.deplint) ? commands.deplint : isRecord$8(root.deplint) ? root.deplint : void 0;
|
|
26613
|
+
const packages = deplint !== void 0 && isRecord$8(deplint.packages) ? deplint.packages : void 0;
|
|
26499
26614
|
if (packages === void 0) return result;
|
|
26500
26615
|
for (const [name, value] of Object.entries(packages)) {
|
|
26501
26616
|
const config = readJsonPackageConfig(value);
|
|
@@ -26841,7 +26956,7 @@ const BUILT_IN_RULE_OPTION_KEYS = {
|
|
|
26841
26956
|
]),
|
|
26842
26957
|
"dep.workspace.protocol": /* @__PURE__ */ new Set(["ignore", "protocol"])
|
|
26843
26958
|
};
|
|
26844
|
-
function isRecord$
|
|
26959
|
+
function isRecord$7(value) {
|
|
26845
26960
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
26846
26961
|
}
|
|
26847
26962
|
function isRuleLevel$4(value) {
|
|
@@ -26878,7 +26993,7 @@ function parseRuleConfig$1(ruleId, value) {
|
|
|
26878
26993
|
const level = value[0];
|
|
26879
26994
|
if (!isRuleLevel$4(level)) throw new TypeError(`${formatRuleConfigLocation$1(ruleId)} level must be one of "off", "warn", or "error"`);
|
|
26880
26995
|
const options = value[1];
|
|
26881
|
-
if (!isRecord$
|
|
26996
|
+
if (!isRecord$7(options)) throw new TypeError(`${formatRuleConfigLocation$1(ruleId)} options must be an object`);
|
|
26882
26997
|
return {
|
|
26883
26998
|
level,
|
|
26884
26999
|
options: { ...options }
|
|
@@ -26964,6 +27079,7 @@ const resolutionExtensions = [
|
|
|
26964
27079
|
".tsx"
|
|
26965
27080
|
];
|
|
26966
27081
|
const dotfileIgnorePatterns = [
|
|
27082
|
+
"**/.claude/**",
|
|
26967
27083
|
"**/.git/**",
|
|
26968
27084
|
"**/.yarn/**",
|
|
26969
27085
|
"**/.pnpm/**",
|
|
@@ -27384,7 +27500,7 @@ function getStorybookConfigImports(filePath, importPaths) {
|
|
|
27384
27500
|
ts.forEachChild(node, visit);
|
|
27385
27501
|
}
|
|
27386
27502
|
visit(sourceFile);
|
|
27387
|
-
const cleaned = [...new Set(collected.map(
|
|
27503
|
+
const cleaned = [...new Set(collected.map(packageNameFromImport).filter((name) => name !== void 0))];
|
|
27388
27504
|
for (const imp of cleaned) {
|
|
27389
27505
|
importPaths[imp] ??= [];
|
|
27390
27506
|
if (!importPaths[imp].includes(filePath)) importPaths[imp].push(filePath);
|
|
@@ -28323,6 +28439,7 @@ function removeDep(pkg, dep, section) {
|
|
|
28323
28439
|
* Add a dependency to a section with a resolved version.
|
|
28324
28440
|
*/
|
|
28325
28441
|
function addDep(pkg, dep, version, section) {
|
|
28442
|
+
if (!isValidNpmDependencyName(dep)) return;
|
|
28326
28443
|
const sectionObj = pkg[section] ?? {};
|
|
28327
28444
|
sectionObj[dep] = version;
|
|
28328
28445
|
pkg[section] = sectionObj;
|
|
@@ -28594,25 +28711,34 @@ function findUnlistedDependencies(name, dependencies, devDependencies, peerDepen
|
|
|
28594
28711
|
...peerDependencies
|
|
28595
28712
|
];
|
|
28596
28713
|
const results = [];
|
|
28597
|
-
for (const imp of externalDistImports)
|
|
28598
|
-
imp
|
|
28599
|
-
|
|
28600
|
-
|
|
28601
|
-
|
|
28602
|
-
|
|
28603
|
-
|
|
28604
|
-
|
|
28714
|
+
for (const imp of externalDistImports) {
|
|
28715
|
+
if (!isValidNpmDependencyName(imp)) continue;
|
|
28716
|
+
if (!isRuntimeImportListed(imp, name, dependencies, peerDependencies) && !isSatisfiedByTsScriptsVariant(imp, allDeps)) results.push({
|
|
28717
|
+
imp,
|
|
28718
|
+
section: "dependencies"
|
|
28719
|
+
});
|
|
28720
|
+
}
|
|
28721
|
+
for (const imp of externalDistTypeImports) {
|
|
28722
|
+
if (!isValidNpmDependencyName(imp)) continue;
|
|
28723
|
+
if (!isDistTypeImportListed(imp, name, dependencies, devDependencies, peerDependencies) && !isSatisfiedByTsScriptsVariant(imp, allDeps)) results.push({
|
|
28724
|
+
imp,
|
|
28725
|
+
section: "dependencies"
|
|
28726
|
+
});
|
|
28727
|
+
}
|
|
28605
28728
|
return results;
|
|
28606
28729
|
}
|
|
28607
28730
|
//#endregion
|
|
28608
28731
|
//#region src/actions/deplint/checkPackage/getUnlistedDevDependencies.ts
|
|
28609
28732
|
function findUnlistedDevDeps(name, dependencies, devDependencies, peerDependencies, externalAllImports, distImports, externalDistTypeImports) {
|
|
28610
28733
|
const results = [];
|
|
28611
|
-
for (const imp of externalAllImports)
|
|
28612
|
-
|
|
28613
|
-
|
|
28614
|
-
|
|
28615
|
-
|
|
28734
|
+
for (const imp of externalAllImports) {
|
|
28735
|
+
if (!isValidNpmDependencyName(imp)) continue;
|
|
28736
|
+
if (imp !== name && !distImports.includes(imp) && !externalDistTypeImports.includes(imp) && !dependencies.includes(imp) && !dependencies.includes(`@types/${imp}`) && !peerDependencies.includes(imp) && !peerDependencies.includes(`@types/${imp}`) && !devDependencies.includes(imp) && !devDependencies.includes(`@types/${imp}`) && !builtinModules.includes(imp) && !isSatisfiedByTsScriptsVariant(imp, [
|
|
28737
|
+
...dependencies,
|
|
28738
|
+
...devDependencies,
|
|
28739
|
+
...peerDependencies
|
|
28740
|
+
])) results.push(imp);
|
|
28741
|
+
}
|
|
28616
28742
|
return results;
|
|
28617
28743
|
}
|
|
28618
28744
|
//#endregion
|
|
@@ -30556,6 +30682,7 @@ var DeplintPackageEditor = class {
|
|
|
30556
30682
|
const before = JSON.stringify(this.pkg);
|
|
30557
30683
|
switch (fix.action) {
|
|
30558
30684
|
case "add":
|
|
30685
|
+
if (!isValidNpmDependencyName(fix.dependency)) break;
|
|
30559
30686
|
addDep(this.pkg, fix.dependency, fix.version, fix.section);
|
|
30560
30687
|
if (fix.section === "peerDependencies") setPeerOptional(this.pkg, fix.dependency, fix.optional);
|
|
30561
30688
|
break;
|
|
@@ -34259,7 +34386,7 @@ function formatExportPath$1(pathParts) {
|
|
|
34259
34386
|
function ensureExportsPath$1(value) {
|
|
34260
34387
|
return value.startsWith("./") ? value : `./${value}`;
|
|
34261
34388
|
}
|
|
34262
|
-
function isRecord$
|
|
34389
|
+
function isRecord$6(value) {
|
|
34263
34390
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
34264
34391
|
}
|
|
34265
34392
|
function normalizeTarget(target) {
|
|
@@ -34296,7 +34423,7 @@ function collectExportLeaves(value, subpath = ".", pathParts = ["exports"], cond
|
|
|
34296
34423
|
}];
|
|
34297
34424
|
}
|
|
34298
34425
|
if (Array.isArray(value)) return value.flatMap((entry, index) => collectExportLeaves(entry, subpath, [...pathParts, `[${index}]`], conditionPath));
|
|
34299
|
-
if (!isRecord$
|
|
34426
|
+
if (!isRecord$6(value)) return [];
|
|
34300
34427
|
return Object.entries(value).flatMap(([key, nested]) => {
|
|
34301
34428
|
if (isSubpathExportKey$1(key)) return collectExportLeaves(nested, key, [...pathParts, key], conditionPath);
|
|
34302
34429
|
return collectExportLeaves(nested, subpath, [...pathParts, key], [...conditionPath, key]);
|
|
@@ -34394,14 +34521,14 @@ function shouldNormalizeExportsForFix(pkg) {
|
|
|
34394
34521
|
pkg.exports = { ".": pkg.exports };
|
|
34395
34522
|
return true;
|
|
34396
34523
|
}
|
|
34397
|
-
if (isRecord$
|
|
34524
|
+
if (isRecord$6(pkg.exports) && !hasSubpathKeys(pkg.exports)) {
|
|
34398
34525
|
pkg.exports = { ".": pkg.exports };
|
|
34399
34526
|
return true;
|
|
34400
34527
|
}
|
|
34401
34528
|
return false;
|
|
34402
34529
|
}
|
|
34403
34530
|
function isRecordObject(value) {
|
|
34404
|
-
return isRecord$
|
|
34531
|
+
return isRecord$6(value);
|
|
34405
34532
|
}
|
|
34406
34533
|
function ensureSubpath(exports, subpath) {
|
|
34407
34534
|
const existing = exports[subpath];
|
|
@@ -39970,7 +40097,7 @@ const VALID_RULE_LEVELS = /* @__PURE__ */ new Set([
|
|
|
39970
40097
|
"warn",
|
|
39971
40098
|
"error"
|
|
39972
40099
|
]);
|
|
39973
|
-
function isRecord$
|
|
40100
|
+
function isRecord$5(value) {
|
|
39974
40101
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
39975
40102
|
}
|
|
39976
40103
|
function isRuleLevel$1(value) {
|
|
@@ -39995,13 +40122,13 @@ function parseRuleConfig(ruleId, value) {
|
|
|
39995
40122
|
const level = value[0];
|
|
39996
40123
|
if (!isRuleLevel$1(level)) throw new TypeError(`${formatRuleConfigLocation(ruleId)} level must be one of "off", "warn", or "error"`);
|
|
39997
40124
|
const options = value[1];
|
|
39998
|
-
if (!isRecord$
|
|
40125
|
+
if (!isRecord$5(options)) throw new TypeError(`${formatRuleConfigLocation(ruleId)} options must be an object`);
|
|
39999
40126
|
return {
|
|
40000
40127
|
level,
|
|
40001
40128
|
options: { ...options }
|
|
40002
40129
|
};
|
|
40003
40130
|
}
|
|
40004
|
-
if (isRecord$
|
|
40131
|
+
if (isRecord$5(value)) return {
|
|
40005
40132
|
level: "warn",
|
|
40006
40133
|
options: { ...value }
|
|
40007
40134
|
};
|
|
@@ -41135,7 +41262,7 @@ function applyCompileCompilerToTsSource(text, compiler) {
|
|
|
41135
41262
|
if ((ts.isStringLiteral(validator.initializer) || ts.isNoSubstitutionTemplateLiteral(validator.initializer)) && validator.initializer.text === "shared") result = removePropertyFromObject(result, validator, afterCompiler);
|
|
41136
41263
|
return result;
|
|
41137
41264
|
}
|
|
41138
|
-
function isRecord$
|
|
41265
|
+
function isRecord$4(value) {
|
|
41139
41266
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
41140
41267
|
}
|
|
41141
41268
|
/**
|
|
@@ -41143,7 +41270,7 @@ function isRecord$3(value) {
|
|
|
41143
41270
|
*/
|
|
41144
41271
|
function applyCompileCompilerToJsonSource(text, compiler) {
|
|
41145
41272
|
const root = JSON.parse(text);
|
|
41146
|
-
const compile = isRecord$
|
|
41273
|
+
const compile = isRecord$4(root.compile) ? { ...root.compile } : {};
|
|
41147
41274
|
compile.compiler = compiler;
|
|
41148
41275
|
if (compiler === "native" && compile.validator === "shared") delete compile.validator;
|
|
41149
41276
|
root.compile = compile;
|
|
@@ -43105,12 +43232,12 @@ function checkPnpmReleaseAgeExcludes(cwd, pm, workspaces = []) {
|
|
|
43105
43232
|
for (const pattern of unnecessary) result.fixable.push(`pnpm-workspace.yaml minimumReleaseAgeExclude includes '${pattern}' but the repo does not use that scope`);
|
|
43106
43233
|
return result;
|
|
43107
43234
|
}
|
|
43108
|
-
function isRecord$
|
|
43235
|
+
function isRecord$3(value) {
|
|
43109
43236
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
43110
43237
|
}
|
|
43111
43238
|
function isConfiguredValue(value) {
|
|
43112
43239
|
if (value === void 0 || value === null) return false;
|
|
43113
|
-
if (isRecord$
|
|
43240
|
+
if (isRecord$3(value)) return Object.keys(value).length > 0;
|
|
43114
43241
|
if (Array.isArray(value)) return value.length > 0;
|
|
43115
43242
|
return value !== "";
|
|
43116
43243
|
}
|
|
@@ -43138,8 +43265,8 @@ function formatOverrideWarning(location, keys) {
|
|
|
43138
43265
|
function checkPnpmDependencyOverrides(cwd, pm, rootPkg) {
|
|
43139
43266
|
const result = emptyResult$2();
|
|
43140
43267
|
if (pm !== "pnpm") return result;
|
|
43141
|
-
const packageJsonOverrides = (isRecord$
|
|
43142
|
-
if (isConfiguredValue(packageJsonOverrides)) result.warnings.push(formatOverrideWarning("Root package.json pnpm.overrides field", isRecord$
|
|
43268
|
+
const packageJsonOverrides = (isRecord$3(rootPkg.pnpm) ? rootPkg.pnpm : void 0)?.overrides;
|
|
43269
|
+
if (isConfiguredValue(packageJsonOverrides)) result.warnings.push(formatOverrideWarning("Root package.json pnpm.overrides field", isRecord$3(packageJsonOverrides) ? Object.keys(packageJsonOverrides) : []));
|
|
43143
43270
|
const workspaceOverrides = readPnpmWorkspaceDocument(cwd)?.get("overrides");
|
|
43144
43271
|
if (isConfiguredYamlNode(workspaceOverrides)) result.warnings.push(formatOverrideWarning("pnpm-workspace.yaml overrides field", configuredYamlKeys(workspaceOverrides)));
|
|
43145
43272
|
return result;
|
|
@@ -43222,13 +43349,15 @@ function emptyResult$1() {
|
|
|
43222
43349
|
const SKIP_DIRS = /* @__PURE__ */ new Set([
|
|
43223
43350
|
"node_modules",
|
|
43224
43351
|
"dist",
|
|
43225
|
-
"build"
|
|
43352
|
+
"build",
|
|
43353
|
+
".git",
|
|
43354
|
+
CLAUDE_SETTINGS_DIR
|
|
43226
43355
|
]);
|
|
43227
43356
|
function collectSpecFiles(dir, out) {
|
|
43228
43357
|
for (const entry of readdirSync(dir)) {
|
|
43229
43358
|
const fullPath = PATH.join(dir, entry);
|
|
43230
43359
|
if (statSync(fullPath).isDirectory()) {
|
|
43231
|
-
if (SKIP_DIRS.has(entry)) continue;
|
|
43360
|
+
if (SKIP_DIRS.has(entry) || isGitCheckoutRoot(fullPath)) continue;
|
|
43232
43361
|
collectSpecFiles(fullPath, out);
|
|
43233
43362
|
continue;
|
|
43234
43363
|
}
|
|
@@ -44732,12 +44861,14 @@ function didEnsureAuthenticatedWith(command) {
|
|
|
44732
44861
|
function didEnsurePublishAuthenticated(pmName = detectPackageManager$1()) {
|
|
44733
44862
|
return didEnsureAuthenticatedWith(publishAuthCommand(pmName));
|
|
44734
44863
|
}
|
|
44735
|
-
const publish = ({ chunkSize = 0, isVerbose = false } = {}) => {
|
|
44864
|
+
const publish = ({ chunkSize = 0, isVerbose = false, tag } = {}) => {
|
|
44736
44865
|
if (!didEnsurePublishAuthenticated()) return 1;
|
|
44737
44866
|
const pm = getPackageManager();
|
|
44738
44867
|
if (chunkSize > 0 && !CHUNK_SUPPORTING_PMS.has(pm.name)) console.warn(chalk.yellow(`Publish: --chunk-size=${chunkSize} is ignored by ${pm.name} (only pnpm supports chunking today); publishing in a single call.`));
|
|
44868
|
+
if (tag != null && tag.length > 0) console.log(chalk.gray(`Publish: using npm dist-tag "${tag}"`));
|
|
44739
44869
|
const steps = pm.publish({
|
|
44740
44870
|
chunkSize,
|
|
44871
|
+
tag,
|
|
44741
44872
|
verbose: isVerbose
|
|
44742
44873
|
});
|
|
44743
44874
|
if (chunkSize > 0 && steps.length > 1) console.warn(chalk.yellow(`Publish: chunking enabled (chunkSize=${chunkSize}, ${steps.length} chunks). Each chunk is a fresh package-manager process — if your registry requires interactive 2FA per publish, expect one auth prompt per chunk.`));
|
|
@@ -44911,6 +45042,7 @@ function printSummary(plan) {
|
|
|
44911
45042
|
console.log(chalk.gray(` template: ${plan.template}`));
|
|
44912
45043
|
console.log(chalk.gray(` package: ${plan.packageName}`));
|
|
44913
45044
|
console.log(chalk.gray(` scope: ${plan.scope || "(none)"}`));
|
|
45045
|
+
console.log(chalk.gray(` license: ${plan.license}`));
|
|
44914
45046
|
console.log(chalk.gray(` pm: ${plan.pm}`));
|
|
44915
45047
|
console.log(chalk.gray(` monorepo: ${String(plan.monorepo)}`));
|
|
44916
45048
|
console.log(chalk.gray(` react: ${String(plan.react)}`));
|
|
@@ -44956,10 +45088,22 @@ async function resolvePackageManager(provided, wizard, useDefaults) {
|
|
|
44956
45088
|
if (!wizard || useDefaults) return "pnpm";
|
|
44957
45089
|
return askChoice("Package manager", PMS, "pnpm");
|
|
44958
45090
|
}
|
|
45091
|
+
function normalizeRepoInitScope(raw) {
|
|
45092
|
+
const trimmed = raw.trim();
|
|
45093
|
+
if (trimmed === "none" || trimmed === "-" || trimmed.length === 0) return "";
|
|
45094
|
+
return trimmed.startsWith("@") ? trimmed : `@${trimmed}`;
|
|
45095
|
+
}
|
|
44959
45096
|
async function resolveScope(provided, wizard, useDefaults) {
|
|
44960
|
-
const fallback = provided ?? "@
|
|
45097
|
+
const fallback = normalizeRepoInitScope(provided ?? "@ariestools");
|
|
44961
45098
|
if (provided !== void 0 || !wizard || useDefaults) return fallback;
|
|
44962
|
-
const answer = await askQuestion(chalk.cyan(`npm scope [${fallback}]: `));
|
|
45099
|
+
const answer = await askQuestion(chalk.cyan(`npm scope [${fallback || "none"}] (none for unscoped): `));
|
|
45100
|
+
if (answer.length === 0) return fallback;
|
|
45101
|
+
return normalizeRepoInitScope(answer);
|
|
45102
|
+
}
|
|
45103
|
+
async function resolveLicense(provided, wizard, useDefaults) {
|
|
45104
|
+
const fallback = provided ?? "MIT";
|
|
45105
|
+
if (provided !== void 0 || !wizard || useDefaults) return fallback;
|
|
45106
|
+
const answer = await askQuestion(chalk.cyan(`License [${fallback}]: `));
|
|
44963
45107
|
return answer.length > 0 ? answer : fallback;
|
|
44964
45108
|
}
|
|
44965
45109
|
async function resolveDescription(provided, wizard, useDefaults) {
|
|
@@ -44974,7 +45118,7 @@ async function resolveSkillsTier(provided, wizard, useDefaults) {
|
|
|
44974
45118
|
}
|
|
44975
45119
|
return provided;
|
|
44976
45120
|
}
|
|
44977
|
-
if (!wizard || useDefaults) return
|
|
45121
|
+
if (!wizard || useDefaults) return "xy";
|
|
44978
45122
|
return askChoice("Skills tier (agent skills to install)", TIERS, "xy");
|
|
44979
45123
|
}
|
|
44980
45124
|
async function resolveSkillsOptional(provided, skillsTier, wizard, useDefaults) {
|
|
@@ -45008,10 +45152,12 @@ async function resolvePlanOptions(params, wizard, useDefaults) {
|
|
|
45008
45152
|
const react = await resolveWizardBoolean(params.react, "React project (eslint-config-react-flat + tsconfig-react)?", false, wizard, useDefaults);
|
|
45009
45153
|
const scope = await resolveScope(params.scope, wizard, useDefaults);
|
|
45010
45154
|
const description = await resolveDescription(params.description, wizard, useDefaults);
|
|
45155
|
+
const license = await resolveLicense(params.license, wizard, useDefaults);
|
|
45011
45156
|
const skillsTier = await resolveSkillsTier(params.skillsTier, wizard, useDefaults);
|
|
45012
45157
|
if (skillsTier === void 0) return void 0;
|
|
45013
45158
|
return {
|
|
45014
45159
|
description,
|
|
45160
|
+
license,
|
|
45015
45161
|
monorepo,
|
|
45016
45162
|
pm,
|
|
45017
45163
|
react,
|
|
@@ -45022,10 +45168,19 @@ async function resolvePlanOptions(params, wizard, useDefaults) {
|
|
|
45022
45168
|
}
|
|
45023
45169
|
function buildPlan(params, core, options) {
|
|
45024
45170
|
const projectName = PATH.basename(core.name);
|
|
45171
|
+
const githubOrg = params.githubOrg ?? (options.scope.replace(/^@/, "") || projectName);
|
|
45172
|
+
const authorName = params.author ?? "Aries Tools";
|
|
45173
|
+
const authorEmail = params.authorEmail ?? "support@ariestools.ai";
|
|
45174
|
+
const authorUrl = params.authorUrl ?? "https://ariestools.ai";
|
|
45025
45175
|
return {
|
|
45176
|
+
authorEmail,
|
|
45177
|
+
authorName,
|
|
45178
|
+
authorUrl,
|
|
45026
45179
|
description: options.description,
|
|
45027
|
-
githubOrg
|
|
45180
|
+
githubOrg,
|
|
45181
|
+
homepage: params.homepage ?? (githubOrg.length > 0 ? `https://github.com/${githubOrg}/${projectName}` : authorUrl),
|
|
45028
45182
|
isVerbose: params.isVerbose ?? false,
|
|
45183
|
+
license: options.license,
|
|
45029
45184
|
monorepo: options.monorepo,
|
|
45030
45185
|
name: core.name,
|
|
45031
45186
|
packageName: params.packageName ?? projectName,
|
|
@@ -45082,8 +45237,33 @@ function xyCommandForPm(pm) {
|
|
|
45082
45237
|
default: return `${pm} xy`;
|
|
45083
45238
|
}
|
|
45084
45239
|
}
|
|
45240
|
+
function licenseFileContents(license, year, authorName) {
|
|
45241
|
+
if (license === "MIT") return `MIT License
|
|
45242
|
+
|
|
45243
|
+
Copyright (c) ${String(year)} ${authorName}
|
|
45244
|
+
|
|
45245
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
45246
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
45247
|
+
in the Software without restriction, including without limitation the rights
|
|
45248
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
45249
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
45250
|
+
furnished to do so, subject to the following conditions:
|
|
45251
|
+
|
|
45252
|
+
The above copyright notice and this permission notice shall be included in all
|
|
45253
|
+
copies or substantial portions of the Software.
|
|
45254
|
+
|
|
45255
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
45256
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
45257
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
45258
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
45259
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
45260
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
45261
|
+
SOFTWARE.
|
|
45262
|
+
`;
|
|
45263
|
+
return `${license}\n\nCopyright (c) ${String(year)} ${authorName}\n`;
|
|
45264
|
+
}
|
|
45085
45265
|
function buildTemplateVariables(plan) {
|
|
45086
|
-
const { description, githubOrg, monorepo, packageName, pm, projectName, react, scope } = plan;
|
|
45266
|
+
const { authorEmail, authorName, authorUrl, description, githubOrg, homepage, license, monorepo, packageName, pm, projectName, react, scope } = plan;
|
|
45087
45267
|
const identifierName = packageName.replaceAll(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
45088
45268
|
const npmScope = scope.startsWith("@") || scope.length === 0 ? scope : `@${scope}`;
|
|
45089
45269
|
const scopedPackageName = npmScope.length > 0 ? `${npmScope}/${packageName}` : packageName;
|
|
@@ -45094,18 +45274,30 @@ function buildTemplateVariables(plan) {
|
|
|
45094
45274
|
const testInclude = monorepo ? "packages/*/src/spec/**/*.spec.{ts,tsx,mts,cts}" : "src/spec/**/*.spec.{ts,tsx,mts,cts}";
|
|
45095
45275
|
const srcPrefix = monorepo ? `packages/${packageName}/src/` : "src/";
|
|
45096
45276
|
const layoutLabel = monorepo ? "monorepo (pnpm/yarn/npm workspaces)" : "single package";
|
|
45277
|
+
const layoutDescription = monorepo ? `Monorepo for ${projectName} (\`${scopedPackageName}\`). Package sources live under \`packages/${packageName}\`.` : `Single-package repo for ${projectName} (\`${scopedPackageName}\`). Sources live under \`src/\`.`;
|
|
45278
|
+
const packageDirNote = monorepo ? ", never from inside a package directory" : "";
|
|
45279
|
+
const copyrightYear = String((/* @__PURE__ */ new Date()).getFullYear());
|
|
45097
45280
|
return {
|
|
45281
|
+
authorEmail,
|
|
45282
|
+
authorName,
|
|
45283
|
+
authorUrl,
|
|
45284
|
+
copyrightYear,
|
|
45098
45285
|
coverageInclude,
|
|
45099
45286
|
description,
|
|
45100
45287
|
eslintConfigPackage,
|
|
45101
45288
|
githubOrg,
|
|
45289
|
+
homepage,
|
|
45102
45290
|
identifierName,
|
|
45103
|
-
|
|
45291
|
+
keywordPrimary: npmScope.replace(/^@/, "") || "typescript",
|
|
45292
|
+
layoutDescription,
|
|
45104
45293
|
layoutLabel,
|
|
45294
|
+
license,
|
|
45295
|
+
licenseFile: licenseFileContents(license, Number(copyrightYear), authorName),
|
|
45105
45296
|
npmScope,
|
|
45106
|
-
packageDirNote
|
|
45297
|
+
packageDirNote,
|
|
45107
45298
|
packageManager: packageManagerField(pm),
|
|
45108
45299
|
packageName,
|
|
45300
|
+
pmExperimentalNote: pm === "pnpm" ? "" : "# Experimental package manager. pnpm is fully supported.\n",
|
|
45109
45301
|
pmName: pm,
|
|
45110
45302
|
projectName,
|
|
45111
45303
|
rootPackageName,
|
|
@@ -45298,15 +45490,14 @@ const SKILLS_COMMANDS = [
|
|
|
45298
45490
|
"init",
|
|
45299
45491
|
"experimental_sync",
|
|
45300
45492
|
"defaults",
|
|
45301
|
-
"lint"
|
|
45302
|
-
"updo"
|
|
45493
|
+
"lint"
|
|
45303
45494
|
].join("|");
|
|
45304
45495
|
const NPX_SKILLS_PATTERN = new RegExp(String.raw`${COMMAND_PREFIX}npx(?:\s+-y)?\s+skills(?:@latest)?(?=\W|$)`, "g");
|
|
45305
45496
|
const BARE_USAGE_SKILLS_PATTERN = new RegExp(String.raw`^(\s*(?:${ANSI_PREFIX})*Usage:(?:${ANSI_PREFIX})*\s*)skills(?=\s+<command>)`, "gm");
|
|
45306
45497
|
const BARE_PROMPT_SKILLS_PATTERN = new RegExp(String.raw`^(\s*(?:${ANSI_PREFIX})*\$(?:${ANSI_PREFIX})*\s*)skills(?=\s+(?:${SKILLS_COMMANDS})(?:\W|$))`, "gm");
|
|
45307
45498
|
const require$3 = createRequire(import.meta.url);
|
|
45308
45499
|
const YES_FLAGS = /* @__PURE__ */ new Set(["-y", "--yes"]);
|
|
45309
|
-
const SCOPE_FLAGS
|
|
45500
|
+
const SCOPE_FLAGS = /* @__PURE__ */ new Set([
|
|
45310
45501
|
"-g",
|
|
45311
45502
|
"--global",
|
|
45312
45503
|
"-p",
|
|
@@ -45333,7 +45524,7 @@ const needsSkillsInteractive = (args) => {
|
|
|
45333
45524
|
if (command === void 0 || !INTERACTIVE_COMMANDS.has(command)) return false;
|
|
45334
45525
|
switch (command) {
|
|
45335
45526
|
case "update":
|
|
45336
|
-
case "upgrade": return !hasSkillsFlag(tail, SCOPE_FLAGS
|
|
45527
|
+
case "upgrade": return !hasSkillsFlag(tail, SCOPE_FLAGS) && !hasSkillsFlag(tail, YES_FLAGS) && skillsPositionalArgs(tail).length === 0;
|
|
45337
45528
|
case "add":
|
|
45338
45529
|
case "a":
|
|
45339
45530
|
case "experimental_sync": return !hasSkillsFlag(tail, YES_FLAGS);
|
|
@@ -45418,6 +45609,7 @@ const ARIESTOOLS_SKILLS = [
|
|
|
45418
45609
|
];
|
|
45419
45610
|
const XYO_STACK_SKILLS = [
|
|
45420
45611
|
"xl1-build",
|
|
45612
|
+
"xl1-dapp-kit",
|
|
45421
45613
|
"xl1-knowledge",
|
|
45422
45614
|
"xl1-patterns",
|
|
45423
45615
|
"xl1-scaffold",
|
|
@@ -45425,6 +45617,19 @@ const XYO_STACK_SKILLS = [
|
|
|
45425
45617
|
"xyo-knowledge"
|
|
45426
45618
|
];
|
|
45427
45619
|
/**
|
|
45620
|
+
* Skills that used to live in xyo-skills and now live in ariestools-skills.
|
|
45621
|
+
* `xy skills lint` reports (and `--fix` reinstalls) lockfile entries still on `from`.
|
|
45622
|
+
*/
|
|
45623
|
+
const MIGRATED_SKILLS = [{
|
|
45624
|
+
from: XYO_SKILLS_SOURCE,
|
|
45625
|
+
name: "xy-development",
|
|
45626
|
+
to: ARIESTOOLS_SKILLS_SOURCE
|
|
45627
|
+
}, {
|
|
45628
|
+
from: XYO_SKILLS_SOURCE,
|
|
45629
|
+
name: "xy-toolchain",
|
|
45630
|
+
to: ARIESTOOLS_SKILLS_SOURCE
|
|
45631
|
+
}];
|
|
45632
|
+
/**
|
|
45428
45633
|
All skills managed by `xy skills` conveniences (both sources).
|
|
45429
45634
|
*/
|
|
45430
45635
|
const XYO_DEFAULT_SKILLS = [...ARIESTOOLS_SKILLS, ...XYO_STACK_SKILLS];
|
|
@@ -45473,6 +45678,7 @@ const SKILL_ORDER = [
|
|
|
45473
45678
|
"xyo-knowledge",
|
|
45474
45679
|
"xl1-knowledge",
|
|
45475
45680
|
"xl1-patterns",
|
|
45681
|
+
"xl1-dapp-kit",
|
|
45476
45682
|
"xl1-testing",
|
|
45477
45683
|
"xl1-scaffold",
|
|
45478
45684
|
"xl1-build"
|
|
@@ -45491,7 +45697,11 @@ const XL1_SKILLS = [
|
|
|
45491
45697
|
"xl1-patterns",
|
|
45492
45698
|
"xl1-testing"
|
|
45493
45699
|
];
|
|
45494
|
-
const XL1_OPTIONAL_SKILLS = [
|
|
45700
|
+
const XL1_OPTIONAL_SKILLS = [
|
|
45701
|
+
"xl1-dapp-kit",
|
|
45702
|
+
"xl1-scaffold",
|
|
45703
|
+
"xl1-build"
|
|
45704
|
+
];
|
|
45495
45705
|
const TIER_REQUIRED_SKILLS = {
|
|
45496
45706
|
xy: XY_SKILLS,
|
|
45497
45707
|
xyo: [...XY_SKILLS, ...XYO_SKILLS],
|
|
@@ -51979,6 +52189,64 @@ const listSkillDirsAt = (root) => {
|
|
|
51979
52189
|
return listSkillDirs(root);
|
|
51980
52190
|
};
|
|
51981
52191
|
//#endregion
|
|
52192
|
+
//#region src/actions/skills/lock.ts
|
|
52193
|
+
const SKILLS_LOCK_FILE = "skills-lock.json";
|
|
52194
|
+
const normalizeSkillSource = (source) => {
|
|
52195
|
+
return source.trim().replace(/^https?:\/\/github\.com\//i, "").replace(/^github:/i, "").replace(/\.git$/i, "").replace(/\/+$/, "").toLowerCase();
|
|
52196
|
+
};
|
|
52197
|
+
const isRecord$2 = (value) => {
|
|
52198
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
52199
|
+
};
|
|
52200
|
+
const parseLockEntry = (value) => {
|
|
52201
|
+
if (!isRecord$2(value) || typeof value.source !== "string" || value.source.length === 0) return void 0;
|
|
52202
|
+
return {
|
|
52203
|
+
computedHash: typeof value.computedHash === "string" ? value.computedHash : void 0,
|
|
52204
|
+
skillPath: typeof value.skillPath === "string" ? value.skillPath : void 0,
|
|
52205
|
+
source: value.source,
|
|
52206
|
+
sourceType: typeof value.sourceType === "string" ? value.sourceType : void 0
|
|
52207
|
+
};
|
|
52208
|
+
};
|
|
52209
|
+
const parseSkillsLock = (value) => {
|
|
52210
|
+
if (!isRecord$2(value) || !isRecord$2(value.skills)) return void 0;
|
|
52211
|
+
const skills = {};
|
|
52212
|
+
for (const [name, entry] of Object.entries(value.skills)) {
|
|
52213
|
+
const parsed = parseLockEntry(entry);
|
|
52214
|
+
if (parsed == null) continue;
|
|
52215
|
+
skills[name] = parsed;
|
|
52216
|
+
}
|
|
52217
|
+
return {
|
|
52218
|
+
skills,
|
|
52219
|
+
version: typeof value.version === "number" ? value.version : 1
|
|
52220
|
+
};
|
|
52221
|
+
};
|
|
52222
|
+
const readSkillsLock = (cwd) => {
|
|
52223
|
+
const lockPath = PATH.resolve(cwd, SKILLS_LOCK_FILE);
|
|
52224
|
+
if (!existsSync(lockPath)) return void 0;
|
|
52225
|
+
try {
|
|
52226
|
+
return parseSkillsLock(JSON.parse(readFileSync(lockPath, "utf8")));
|
|
52227
|
+
} catch {
|
|
52228
|
+
return;
|
|
52229
|
+
}
|
|
52230
|
+
};
|
|
52231
|
+
const unmigratedSkillsFromLock = (lock) => {
|
|
52232
|
+
if (lock == null) return [];
|
|
52233
|
+
const unmigrated = [];
|
|
52234
|
+
for (const skill of MIGRATED_SKILLS) {
|
|
52235
|
+
const entry = lock.skills[skill.name];
|
|
52236
|
+
if (entry == null) continue;
|
|
52237
|
+
if (normalizeSkillSource(entry.source) !== normalizeSkillSource(skill.from)) continue;
|
|
52238
|
+
unmigrated.push({
|
|
52239
|
+
currentSource: entry.source,
|
|
52240
|
+
expectedSource: skill.to,
|
|
52241
|
+
name: skill.name
|
|
52242
|
+
});
|
|
52243
|
+
}
|
|
52244
|
+
return unmigrated;
|
|
52245
|
+
};
|
|
52246
|
+
const findUnmigratedSkills = (cwd) => {
|
|
52247
|
+
return unmigratedSkillsFromLock(readSkillsLock(cwd));
|
|
52248
|
+
};
|
|
52249
|
+
//#endregion
|
|
51982
52250
|
//#region src/actions/skills/versions.ts
|
|
51983
52251
|
const VERSION_PATTERN = /metadata:\s*\n(?:[ \t]+[^\n]+\n)*?[ \t]+version:\s*([^\s#]+)/;
|
|
51984
52252
|
const upstreamSkillUrl = (skillName) => {
|
|
@@ -52037,21 +52305,23 @@ const logWarning = (message) => {
|
|
|
52037
52305
|
const logInfo = (message) => {
|
|
52038
52306
|
console.log(chalk.gray(` \u{2139} ${message}`));
|
|
52039
52307
|
};
|
|
52040
|
-
const
|
|
52041
|
-
return
|
|
52042
|
-
|
|
52043
|
-
|
|
52044
|
-
|
|
52045
|
-
|
|
52046
|
-
|
|
52047
|
-
|
|
52308
|
+
const createSkillInstaller = (cwd) => {
|
|
52309
|
+
return async (skillName) => {
|
|
52310
|
+
return runSkills([
|
|
52311
|
+
"add",
|
|
52312
|
+
skillSourceForName(skillName),
|
|
52313
|
+
"--skill",
|
|
52314
|
+
skillName,
|
|
52315
|
+
"-y"
|
|
52316
|
+
], { cwd });
|
|
52317
|
+
};
|
|
52048
52318
|
};
|
|
52049
52319
|
const missingSkillReason = (profile, skillName) => {
|
|
52050
52320
|
if (skillName === "ariestools-sdk" && profile.isUsingAriestoolsSdk) return "repo uses packages from ariestools/sdk-js";
|
|
52051
52321
|
if (skillName === "xy-toolchain" && profile.isUsingToolchain) return "repo uses @ariestools/toolchain";
|
|
52052
52322
|
return "required for repo profile";
|
|
52053
52323
|
};
|
|
52054
|
-
const checkRequiredSkills = (required, installed, latestVersions
|
|
52324
|
+
const checkRequiredSkills = (required, installed, latestVersions) => {
|
|
52055
52325
|
const current = [];
|
|
52056
52326
|
const missing = [];
|
|
52057
52327
|
const outdated = [];
|
|
@@ -52063,7 +52333,7 @@ const checkRequiredSkills = (required, installed, latestVersions, profile, isOff
|
|
|
52063
52333
|
}
|
|
52064
52334
|
const installedVersion = installedSkill.version;
|
|
52065
52335
|
const latestVersion = latestVersions.get(skillName);
|
|
52066
|
-
if (
|
|
52336
|
+
if (isSkillVersionOutdated(installedVersion, latestVersion)) {
|
|
52067
52337
|
outdated.push({
|
|
52068
52338
|
latest: latestVersion,
|
|
52069
52339
|
name: skillName,
|
|
@@ -52083,6 +52353,11 @@ const checkRequiredSkills = (required, installed, latestVersions, profile, isOff
|
|
|
52083
52353
|
outdated
|
|
52084
52354
|
};
|
|
52085
52355
|
};
|
|
52356
|
+
const resolveLatestSkillVersions = async (skillNames, options) => {
|
|
52357
|
+
if (options.latestVersions != null) return new Map(options.latestVersions);
|
|
52358
|
+
if (options.isOffline === true) return /* @__PURE__ */ new Map();
|
|
52359
|
+
return fetchLatestSkillVersions(skillNames);
|
|
52360
|
+
};
|
|
52086
52361
|
const findDuplicateSkills = (cwd, globalDir) => {
|
|
52087
52362
|
const projectClaudeDir = PATH.resolve(cwd, ".claude", "skills");
|
|
52088
52363
|
const projectSkills = listSkillDirsAt(projectClaudeDir);
|
|
@@ -52113,22 +52388,22 @@ const skillDiagnostics = (rule, messages) => {
|
|
|
52113
52388
|
rule
|
|
52114
52389
|
}));
|
|
52115
52390
|
};
|
|
52116
|
-
const
|
|
52391
|
+
const installSkills = async (skillNames, installSkill, heading, success) => {
|
|
52117
52392
|
console.log();
|
|
52118
|
-
console.log(chalk.gray(
|
|
52119
|
-
for (const skillName of
|
|
52120
|
-
const code = await
|
|
52393
|
+
console.log(chalk.gray(heading));
|
|
52394
|
+
for (const skillName of skillNames) {
|
|
52395
|
+
const code = await installSkill(skillName);
|
|
52121
52396
|
if (code !== 0) return code;
|
|
52122
52397
|
}
|
|
52123
|
-
console.log(chalk.green(
|
|
52398
|
+
console.log(chalk.green(success));
|
|
52124
52399
|
return 0;
|
|
52125
52400
|
};
|
|
52126
52401
|
const SKILLS_LINT_RULES = [
|
|
52127
52402
|
{
|
|
52128
|
-
check: async ({ missing, profile }, { fix }) => {
|
|
52403
|
+
check: async ({ installSkill, missing, profile }, { fix }) => {
|
|
52129
52404
|
if (missing.length === 0) return {};
|
|
52130
52405
|
if (fix) {
|
|
52131
|
-
if (await
|
|
52406
|
+
if (await installSkills(missing, installSkill, "Installing missing required skills...", "Missing skills installed. Re-run `xy skills lint` to verify versions.") === 0) return { fixedCount: missing.length };
|
|
52132
52407
|
}
|
|
52133
52408
|
return { diagnostics: skillDiagnostics("skills.required-installed", missing.map((skillName) => `${skillName} — missing (${missingSkillReason(profile, skillName)})`)) };
|
|
52134
52409
|
},
|
|
@@ -52138,11 +52413,35 @@ const SKILLS_LINT_RULES = [
|
|
|
52138
52413
|
id: "skills.required-installed"
|
|
52139
52414
|
},
|
|
52140
52415
|
{
|
|
52141
|
-
check:
|
|
52416
|
+
check: async ({ installSkill, outdated }, { fix }) => {
|
|
52417
|
+
if (outdated.length === 0) return {};
|
|
52418
|
+
if (fix) {
|
|
52419
|
+
if (await installSkills(outdated.map((skill) => skill.name), installSkill, "Updating outdated skills...", "Outdated skills updated. Re-run `xy skills lint` to verify versions.") === 0) return { fixedCount: outdated.length };
|
|
52420
|
+
}
|
|
52421
|
+
return { diagnostics: skillDiagnostics("skills.required-current", outdated.map((skill) => `${skill.name} v${skill.version ?? "unknown"} — outdated (latest ${skill.latest ?? "unknown"})`)) };
|
|
52422
|
+
},
|
|
52142
52423
|
defaultLevel: "error",
|
|
52143
52424
|
description: "Installed required skills are up to date",
|
|
52425
|
+
fixable: true,
|
|
52144
52426
|
id: "skills.required-current"
|
|
52145
52427
|
},
|
|
52428
|
+
{
|
|
52429
|
+
check: async ({ installSkill, unmigrated }, { fix }) => {
|
|
52430
|
+
if (unmigrated.length === 0) return {};
|
|
52431
|
+
if (fix) {
|
|
52432
|
+
if (await installSkills(unmigrated.map((skill) => skill.name), installSkill, "Migrating skills to canonical sources...", "Migrated skills reinstalled from ariestools/ariestools-skills. Re-run `xy skills lint` to verify versions.") === 0) return { fixedCount: unmigrated.length };
|
|
52433
|
+
}
|
|
52434
|
+
return { diagnostics: unmigrated.map((skill) => ({
|
|
52435
|
+
file: SKILLS_LOCK_FILE,
|
|
52436
|
+
message: `${skill.name} — installed from ${skill.currentSource}; migrate to ${skill.expectedSource}`,
|
|
52437
|
+
rule: "skills.migrated-source"
|
|
52438
|
+
})) };
|
|
52439
|
+
},
|
|
52440
|
+
defaultLevel: "error",
|
|
52441
|
+
description: "xy-development and xy-toolchain are installed from ariestools/ariestools-skills, not XYOracleNetwork/xyo-skills",
|
|
52442
|
+
fixable: true,
|
|
52443
|
+
id: "skills.migrated-source"
|
|
52444
|
+
},
|
|
52146
52445
|
{
|
|
52147
52446
|
check: ({ unnecessary }) => ({ diagnostics: skillDiagnostics("skills.unnecessary", unnecessary.map((skillName) => `${skillName} — installed but not required for this repo profile`)) }),
|
|
52148
52447
|
defaultLevel: "warn",
|
|
@@ -52166,23 +52465,48 @@ function logCurrentRequiredSkills(requiredCheck) {
|
|
|
52166
52465
|
logOk(`${skill.name}${versionSuffix}`);
|
|
52167
52466
|
}
|
|
52168
52467
|
}
|
|
52468
|
+
function logSkillsLintHints(diagnostics) {
|
|
52469
|
+
const hasMissingDiagnostic = diagnostics.some((diagnostic) => diagnostic.rule === "skills.required-installed");
|
|
52470
|
+
const hasMigratedDiagnostic = diagnostics.some((diagnostic) => diagnostic.rule === "skills.migrated-source");
|
|
52471
|
+
const hasOutdatedDiagnostic = diagnostics.some((diagnostic) => diagnostic.rule === "skills.required-current");
|
|
52472
|
+
if (!hasMissingDiagnostic && !hasMigratedDiagnostic && !hasOutdatedDiagnostic) return;
|
|
52473
|
+
const hints = [];
|
|
52474
|
+
const fixReasons = [];
|
|
52475
|
+
if (hasMissingDiagnostic) fixReasons.push("install missing required skills");
|
|
52476
|
+
if (hasMigratedDiagnostic) fixReasons.push("migrate xy-development and xy-toolchain to ariestools-skills");
|
|
52477
|
+
if (hasOutdatedDiagnostic) fixReasons.push("update outdated skills");
|
|
52478
|
+
if (fixReasons.length > 0) hints.push(`run \`xy skills lint --fix\` to ${fixReasons.join(" and ")}`);
|
|
52479
|
+
console.log(chalk.yellow(`${hints.join(", or ")}.`));
|
|
52480
|
+
}
|
|
52481
|
+
function reportSkillsLintResult(result, profile, optional, installed) {
|
|
52482
|
+
logOptionalSkills(profile.tier, optional, installed);
|
|
52483
|
+
console.log();
|
|
52484
|
+
const { diagnostics, fixedCount } = result.envelope.data;
|
|
52485
|
+
if (fixedCount === 0 && diagnostics.length === 0) {
|
|
52486
|
+
console.log(chalk.green("All required skills are installed and up to date."));
|
|
52487
|
+
return result;
|
|
52488
|
+
}
|
|
52489
|
+
logSkillsLintHints(diagnostics);
|
|
52490
|
+
return result;
|
|
52491
|
+
}
|
|
52169
52492
|
const skillsLint = async (options = {}) => {
|
|
52170
52493
|
const cwd = options.cwd ?? INIT_CWD();
|
|
52171
52494
|
const projectDirs = options.projectDirs ?? [...PROJECT_SKILL_DIRS];
|
|
52172
52495
|
const globalDir = options.globalDir ?? DEFAULT_GLOBAL_DIR;
|
|
52173
|
-
const isOffline = options.isOffline === true;
|
|
52174
52496
|
const isStrict = options.isStrict === true || options.strict === true;
|
|
52175
52497
|
const profile = detectRepoProfile(cwd);
|
|
52176
52498
|
const required = requiredSkillsForProfile(profile);
|
|
52177
52499
|
const optional = optionalSkillsForTier(profile.tier);
|
|
52178
52500
|
const installed = scanInstalledSkills(cwd, projectDirs);
|
|
52179
52501
|
logProfileHeader(profile);
|
|
52180
|
-
const latestVersions =
|
|
52181
|
-
const requiredCheck = checkRequiredSkills(required, installed, latestVersions
|
|
52502
|
+
const latestVersions = await resolveLatestSkillVersions(collectSkillNamesToCheck(required, installed), options);
|
|
52503
|
+
const requiredCheck = checkRequiredSkills(required, installed, latestVersions);
|
|
52182
52504
|
logCurrentRequiredSkills(requiredCheck);
|
|
52183
52505
|
const unnecessary = collectUnnecessarySkills(profile, installed);
|
|
52184
52506
|
const duplicates = findDuplicateSkills(cwd, globalDir);
|
|
52185
|
-
const
|
|
52507
|
+
const unmigrated = findUnmigratedSkills(cwd);
|
|
52508
|
+
const installSkill = options.installSkill ?? createSkillInstaller(cwd);
|
|
52509
|
+
return reportSkillsLintResult(await runRuleChecks({
|
|
52186
52510
|
commandName: "skills lint",
|
|
52187
52511
|
configKey: "skillsLint",
|
|
52188
52512
|
config: await loadWorkspaceCommandConfig(cwd, "skillsLint"),
|
|
@@ -52190,31 +52514,18 @@ const skillsLint = async (options = {}) => {
|
|
|
52190
52514
|
cwd,
|
|
52191
52515
|
duplicates,
|
|
52192
52516
|
globalDir,
|
|
52517
|
+
installSkill,
|
|
52193
52518
|
missing: requiredCheck.missing,
|
|
52194
52519
|
outdated: requiredCheck.outdated,
|
|
52195
52520
|
profile,
|
|
52521
|
+
unmigrated,
|
|
52196
52522
|
unnecessary
|
|
52197
52523
|
},
|
|
52198
52524
|
fix: options.fix === true,
|
|
52199
52525
|
reporter: { diagnostic: logSkillsDiagnostic },
|
|
52200
52526
|
rules: SKILLS_LINT_RULES,
|
|
52201
52527
|
strict: isStrict
|
|
52202
|
-
});
|
|
52203
|
-
logOptionalSkills(profile.tier, optional, installed);
|
|
52204
|
-
console.log();
|
|
52205
|
-
if (result.envelope.data.diagnostics.length === 0 && result.envelope.data.fixedCount === 0) {
|
|
52206
|
-
console.log(chalk.green("All required skills are installed and up to date."));
|
|
52207
|
-
return result;
|
|
52208
|
-
}
|
|
52209
|
-
const hasMissingDiagnostic = result.envelope.data.diagnostics.some((diagnostic) => diagnostic.rule === "skills.required-installed");
|
|
52210
|
-
const hasOutdatedDiagnostic = result.envelope.data.diagnostics.some((diagnostic) => diagnostic.rule === "skills.required-current");
|
|
52211
|
-
if (hasMissingDiagnostic || hasOutdatedDiagnostic) {
|
|
52212
|
-
const hints = [];
|
|
52213
|
-
if (hasMissingDiagnostic) hints.push("run `xy skills lint --fix` to install missing required skills");
|
|
52214
|
-
if (hasOutdatedDiagnostic) hints.push("run `xy skills updo` to update outdated skills");
|
|
52215
|
-
console.log(chalk.yellow(`${hints.join(", or ")}.`));
|
|
52216
|
-
}
|
|
52217
|
-
return result;
|
|
52528
|
+
}), profile, optional, installed);
|
|
52218
52529
|
};
|
|
52219
52530
|
//#endregion
|
|
52220
52531
|
//#region src/actions/work/id.ts
|
|
@@ -53853,28 +54164,23 @@ const sitemap = () => {
|
|
|
53853
54164
|
return runSteps("Sitemap", [["ts-node-script", "./scripts/sitemap.ts"]]);
|
|
53854
54165
|
};
|
|
53855
54166
|
//#endregion
|
|
53856
|
-
//#region src/actions/skills/updo.ts
|
|
53857
|
-
const SCOPE_FLAGS = /* @__PURE__ */ new Set([
|
|
53858
|
-
"-g",
|
|
53859
|
-
"--global",
|
|
53860
|
-
"-p",
|
|
53861
|
-
"--project"
|
|
53862
|
-
]);
|
|
53863
|
-
const hasSkillsScopeFlag = (args) => args.some((a) => SCOPE_FLAGS.has(a));
|
|
53864
|
-
const skillsUpdoArgs = (args) => {
|
|
53865
|
-
return ["update", ...hasSkillsScopeFlag(args) ? args : ["-p", ...args]];
|
|
53866
|
-
};
|
|
53867
|
-
const skillsUpdo = (args) => {
|
|
53868
|
-
return runSkills(skillsUpdoArgs(args));
|
|
53869
|
-
};
|
|
53870
|
-
//#endregion
|
|
53871
54167
|
//#region src/actions/sonar.ts
|
|
54168
|
+
const SONAR_ESLINTRC = "sonar.eslintrc";
|
|
54169
|
+
/**
|
|
54170
|
+
* Quarantined experimental command. The toolchain no longer ships a bundled
|
|
54171
|
+
* SonarJS ESLint config. A local `sonar.eslintrc` is required to run anything.
|
|
54172
|
+
*/
|
|
53872
54173
|
const sonar = () => {
|
|
54174
|
+
if (!existsSync(SONAR_ESLINTRC)) {
|
|
54175
|
+
console.error(chalk.yellow("xy sonar is quarantined: no sonar.eslintrc in the current directory. The toolchain does not ship a bundled SonarJS config. Prefer `xy lint` (ESLint tiers 0–3). This command may be removed."));
|
|
54176
|
+
return 1;
|
|
54177
|
+
}
|
|
54178
|
+
console.warn(chalk.yellow("xy sonar is experimental and may be removed. Prefer `xyex sonar` only if you maintain sonar.eslintrc locally."));
|
|
53873
54179
|
return runSteps("Sonar", [["eslint", [
|
|
53874
54180
|
"-c",
|
|
53875
|
-
|
|
54181
|
+
SONAR_ESLINTRC,
|
|
53876
54182
|
"."
|
|
53877
|
-
]]]);
|
|
54183
|
+
]]], false);
|
|
53878
54184
|
};
|
|
53879
54185
|
//#endregion
|
|
53880
54186
|
//#region src/actions/start.ts
|
|
@@ -54857,7 +55163,7 @@ const packagePositionalParam = (yargs) => {
|
|
|
54857
55163
|
//#region src/xy/build/tscValidateCommand.ts
|
|
54858
55164
|
const tscValidateCommand = {
|
|
54859
55165
|
command: "tsc-validate [package]",
|
|
54860
|
-
describe: "TSC Validate - Type-check all packages in one process with a shared source-file cache
|
|
55166
|
+
describe: "TSC Validate - Type-check all packages in one process with a shared source-file cache",
|
|
54861
55167
|
builder: (yargs) => {
|
|
54862
55168
|
return packagePositionalParam(yargs);
|
|
54863
55169
|
},
|
|
@@ -54871,8 +55177,12 @@ const tscValidateCommand = {
|
|
|
54871
55177
|
};
|
|
54872
55178
|
//#endregion
|
|
54873
55179
|
//#region src/xy/build/index.ts
|
|
54874
|
-
const
|
|
54875
|
-
return args.command(buildCommand).command(compileCommand).command(recompileCommand).command(rebuildCommand).command(copyAssetsCommand)
|
|
55180
|
+
const xyBuildStableCommands = (args) => {
|
|
55181
|
+
return args.command(buildCommand).command(compileCommand).command(recompileCommand).command(rebuildCommand).command(copyAssetsCommand);
|
|
55182
|
+
};
|
|
55183
|
+
const buildExperimentalCommands = [tscValidateCommand];
|
|
55184
|
+
const xyBuildExperimentalCommands = (args, channel) => {
|
|
55185
|
+
return registerExperimentalCommands(args, channel, buildExperimentalCommands);
|
|
54876
55186
|
};
|
|
54877
55187
|
//#endregion
|
|
54878
55188
|
//#region src/xy/common/checkCommand.ts
|
|
@@ -55198,14 +55508,20 @@ const lintCommand$3 = {
|
|
|
55198
55508
|
}));
|
|
55199
55509
|
}
|
|
55200
55510
|
};
|
|
55201
|
-
|
|
55202
|
-
|
|
55203
|
-
|
|
55204
|
-
|
|
55205
|
-
|
|
55206
|
-
|
|
55207
|
-
|
|
55208
|
-
|
|
55511
|
+
/**
|
|
55512
|
+
* `packman lint` is stable (used by `xy check`). `convert` and `clean` stay
|
|
55513
|
+
* experimental and warn on the `xy` channel.
|
|
55514
|
+
*/
|
|
55515
|
+
function createPackmanCommand(channel) {
|
|
55516
|
+
return {
|
|
55517
|
+
builder: (yargs) => {
|
|
55518
|
+
return yargs.command(lintCommand$3).command(withExperimentalChannel(cleanCommand$1, channel, "packman clean")).command(withExperimentalChannel(convertCommand, channel, "packman convert")).demandCommand(1, "Please specify a packman subcommand").strictCommands();
|
|
55519
|
+
},
|
|
55520
|
+
command: "packman",
|
|
55521
|
+
describe: "Package manager policy — lint is stable; convert and clean are experimental",
|
|
55522
|
+
handler: () => {}
|
|
55523
|
+
};
|
|
55524
|
+
}
|
|
55209
55525
|
//#endregion
|
|
55210
55526
|
//#region src/xy/common/repo/initCommand.ts
|
|
55211
55527
|
const templates = (() => {
|
|
@@ -55227,7 +55543,22 @@ const initCommand$2 = {
|
|
|
55227
55543
|
describe: "Project name (also used as directory name)",
|
|
55228
55544
|
type: "string"
|
|
55229
55545
|
}).option("scope", {
|
|
55230
|
-
describe: "npm scope for packages (default: @
|
|
55546
|
+
describe: "npm scope for packages (default: @ariestools; \"none\" for unscoped)",
|
|
55547
|
+
type: "string"
|
|
55548
|
+
}).option("license", {
|
|
55549
|
+
describe: "SPDX license for the new repo (default: MIT — not the toolchain LGPL)",
|
|
55550
|
+
type: "string"
|
|
55551
|
+
}).option("author", {
|
|
55552
|
+
describe: "package.json author.name (default: Aries Tools)",
|
|
55553
|
+
type: "string"
|
|
55554
|
+
}).option("author-email", {
|
|
55555
|
+
describe: "package.json author.email",
|
|
55556
|
+
type: "string"
|
|
55557
|
+
}).option("author-url", {
|
|
55558
|
+
describe: "package.json author.url",
|
|
55559
|
+
type: "string"
|
|
55560
|
+
}).option("homepage", {
|
|
55561
|
+
describe: "package.json homepage (default: GitHub URL from --github-org)",
|
|
55231
55562
|
type: "string"
|
|
55232
55563
|
}).option("package", {
|
|
55233
55564
|
describe: "Package name within the monorepo (defaults to project name)",
|
|
@@ -55284,9 +55615,14 @@ const initCommand$2 = {
|
|
|
55284
55615
|
handler: async (argv) => {
|
|
55285
55616
|
if (Boolean(argv.verbose)) console.log("Repo Init");
|
|
55286
55617
|
await withEnvelope("repo init", () => repoInit({
|
|
55618
|
+
author: argv.author,
|
|
55619
|
+
authorEmail: argv["author-email"],
|
|
55620
|
+
authorUrl: argv["author-url"],
|
|
55287
55621
|
description: argv.description,
|
|
55288
55622
|
githubOrg: argv["github-org"],
|
|
55623
|
+
homepage: argv.homepage,
|
|
55289
55624
|
isVerbose: Boolean(argv.verbose),
|
|
55625
|
+
license: argv.license,
|
|
55290
55626
|
monorepo: argv.monorepo,
|
|
55291
55627
|
name: argv.name,
|
|
55292
55628
|
packageName: argv.package,
|
|
@@ -55451,11 +55787,7 @@ const secureCommand = {
|
|
|
55451
55787
|
};
|
|
55452
55788
|
//#endregion
|
|
55453
55789
|
//#region src/xy/common/skills/index.ts
|
|
55454
|
-
const CUSTOM_SKILLS_COMMANDS = /* @__PURE__ */ new Set([
|
|
55455
|
-
"defaults",
|
|
55456
|
-
"lint",
|
|
55457
|
-
"updo"
|
|
55458
|
-
]);
|
|
55790
|
+
const CUSTOM_SKILLS_COMMANDS = /* @__PURE__ */ new Set(["defaults", "lint"]);
|
|
55459
55791
|
const HELP_FLAGS = /* @__PURE__ */ new Set(["--help", "-h"]);
|
|
55460
55792
|
const hasHelpFlag = (args) => args.some((arg) => HELP_FLAGS.has(arg));
|
|
55461
55793
|
const printDefaultsHelp = () => {
|
|
@@ -55501,34 +55833,20 @@ Checks:
|
|
|
55501
55833
|
- Detect repo tier (xy, xyo, xl1) from package.json and toolchain signals
|
|
55502
55834
|
- Require ariestools-sdk when packages from ariestools/sdk-js are used
|
|
55503
55835
|
- Required skills installed in .claude/skills and/or .agents/skills
|
|
55836
|
+
- xy-development and xy-toolchain are locked to ariestools-skills, not xyo-skills
|
|
55504
55837
|
- Installed skill versions vs upstream main
|
|
55505
55838
|
(ariestools/ariestools-skills for xy/ariestools-sdk skills;
|
|
55506
55839
|
XYOracleNetwork/xyo-skills for xyo/xl1 skills)
|
|
55507
55840
|
- Project/global duplicate installs
|
|
55508
55841
|
|
|
55509
55842
|
Options:
|
|
55510
|
-
--fix Install missing
|
|
55843
|
+
--fix Install missing, migrate relocated, and update outdated skills (project scope)
|
|
55511
55844
|
--offline Skip upstream version checks
|
|
55512
55845
|
--rules List supported skills lint rules and their effective levels
|
|
55513
55846
|
--strict Fail on warnings (duplicates, unnecessary skills)
|
|
55514
55847
|
-h, --help Show this help
|
|
55515
55848
|
`);
|
|
55516
55849
|
};
|
|
55517
|
-
const printUpdoHelp = () => {
|
|
55518
|
-
console.log(`xy skills updo
|
|
55519
|
-
|
|
55520
|
-
Update installed Skills.sh skills. Defaults to project scope.
|
|
55521
|
-
|
|
55522
|
-
Usage:
|
|
55523
|
-
xy skills updo [skills..] [options]
|
|
55524
|
-
|
|
55525
|
-
Options:
|
|
55526
|
-
-g, --global Update global skills instead of project skills
|
|
55527
|
-
-p, --project Update project skills (default)
|
|
55528
|
-
-y, --yes Skip confirmation prompts
|
|
55529
|
-
-h, --help Show this help
|
|
55530
|
-
`);
|
|
55531
|
-
};
|
|
55532
55850
|
const runSkillsTail = async (tail) => {
|
|
55533
55851
|
const [subcommand, ...args] = tail;
|
|
55534
55852
|
if (subcommand === "defaults" && hasHelpFlag(args)) {
|
|
@@ -55539,10 +55857,6 @@ const runSkillsTail = async (tail) => {
|
|
|
55539
55857
|
printLintHelp();
|
|
55540
55858
|
return 0;
|
|
55541
55859
|
}
|
|
55542
|
-
if (subcommand === "updo" && hasHelpFlag(args)) {
|
|
55543
|
-
printUpdoHelp();
|
|
55544
|
-
return 0;
|
|
55545
|
-
}
|
|
55546
55860
|
if (subcommand === "defaults") return skillsDefaults(args);
|
|
55547
55861
|
if (subcommand === "lint") {
|
|
55548
55862
|
if (args.includes("--rules")) return ruleCatalogResult(await getSkillsLintRuleCatalog(), RULE_COMMANDS.skillsLint.title);
|
|
@@ -55553,7 +55867,6 @@ const runSkillsTail = async (tail) => {
|
|
|
55553
55867
|
}
|
|
55554
55868
|
return skillsLint(parseLintArgs(args));
|
|
55555
55869
|
}
|
|
55556
|
-
if (subcommand === "updo") return skillsUpdo(args);
|
|
55557
55870
|
return runSkills(tail);
|
|
55558
55871
|
};
|
|
55559
55872
|
const skillsCommand = {
|
|
@@ -55565,7 +55878,7 @@ const skillsCommand = {
|
|
|
55565
55878
|
}).help(false).strict(false).version(false);
|
|
55566
55879
|
},
|
|
55567
55880
|
command: "skills [args..]",
|
|
55568
|
-
describe: "Manage agent skills via the bundled Skills.sh CLI; forwards unknown commands and adds XY conveniences: defaults, lint
|
|
55881
|
+
describe: "Manage agent skills via the bundled Skills.sh CLI; forwards unknown commands and adds XY conveniences: defaults, lint",
|
|
55569
55882
|
handler: async () => {
|
|
55570
55883
|
const tail = argvAfterCommand("skills");
|
|
55571
55884
|
await withEnvelope(CUSTOM_SKILLS_COMMANDS.has(tail[0] ?? "") ? `skills ${tail[0]}` : "skills", () => runSkillsTail(tail));
|
|
@@ -56021,8 +56334,19 @@ const workCommand = {
|
|
|
56021
56334
|
};
|
|
56022
56335
|
//#endregion
|
|
56023
56336
|
//#region src/xy/common/index.ts
|
|
56024
|
-
|
|
56025
|
-
|
|
56337
|
+
/** Stable common commands registered on both `xy` and `xyex`. */
|
|
56338
|
+
const xyCommonStableCommands = (args, channel) => {
|
|
56339
|
+
return args.command(checkCommand).command(licenseCommand).command(gitCommand).command(gitlintCommand).command(gitignoreCommand).command(npmignoreGenCommand).command(createPackmanCommand(channel)).command(repoCommand).command(retestCommand).command(secureCommand).command(skillsCommand).command(testCommand);
|
|
56340
|
+
};
|
|
56341
|
+
const commonExperimentalCommands = [
|
|
56342
|
+
deadCommand,
|
|
56343
|
+
enableCommand,
|
|
56344
|
+
orphanCommand,
|
|
56345
|
+
workCommand
|
|
56346
|
+
];
|
|
56347
|
+
/** Experimental common commands — prefer `xyex`; warn when invoked via `xy`. */
|
|
56348
|
+
const xyCommonExperimentalCommands = (args, channel) => {
|
|
56349
|
+
return registerExperimentalCommands(args, channel, commonExperimentalCommands);
|
|
56026
56350
|
};
|
|
56027
56351
|
//#endregion
|
|
56028
56352
|
//#region src/xy/deploy/deployCommand.ts
|
|
@@ -56056,16 +56380,21 @@ const publishCommand = {
|
|
|
56056
56380
|
default: 0,
|
|
56057
56381
|
describe: "Split the publish into chunks of N workspaces (pnpm only). Each chunk spawns a fresh process; 0 disables chunking. WARNING: with per-publish 2FA, each chunk triggers a fresh auth prompt — prefer heap bump first.",
|
|
56058
56382
|
type: "number"
|
|
56383
|
+
}).option("tag", {
|
|
56384
|
+
describe: "npm dist-tag to publish under (e.g. latest, next, canary). Use next/canary for prereleases so latest stays on stable cuts.",
|
|
56385
|
+
type: "string"
|
|
56059
56386
|
}),
|
|
56060
56387
|
command: "publish",
|
|
56061
56388
|
describe: "Publish - Publish packages to npmjs",
|
|
56062
56389
|
handler: async (argv) => {
|
|
56063
56390
|
const isVerbose = !!Boolean(argv.verbose);
|
|
56064
56391
|
const chunkSize = typeof argv.chunkSize === "number" ? argv.chunkSize : 0;
|
|
56392
|
+
const tag = typeof argv.tag === "string" && argv.tag.length > 0 ? argv.tag : void 0;
|
|
56065
56393
|
if (isVerbose) console.log("Publish packages to npmjs");
|
|
56066
56394
|
await withEnvelope("publish", () => publish({
|
|
56067
56395
|
chunkSize,
|
|
56068
|
-
isVerbose
|
|
56396
|
+
isVerbose,
|
|
56397
|
+
tag
|
|
56069
56398
|
}));
|
|
56070
56399
|
}
|
|
56071
56400
|
};
|
|
@@ -56835,7 +57164,7 @@ const republintCommand = {
|
|
|
56835
57164
|
//#region src/xy/lint/sonarCommand.ts
|
|
56836
57165
|
const sonarCommand = {
|
|
56837
57166
|
command: "sonar",
|
|
56838
|
-
describe: "Sonar -
|
|
57167
|
+
describe: "Sonar - Quarantined experimental check (requires local sonar.eslintrc)",
|
|
56839
57168
|
builder: (yargs) => {
|
|
56840
57169
|
return packagePositionalParam(yargs);
|
|
56841
57170
|
},
|
|
@@ -56846,8 +57175,12 @@ const sonarCommand = {
|
|
|
56846
57175
|
};
|
|
56847
57176
|
//#endregion
|
|
56848
57177
|
//#region src/xy/lint/index.ts
|
|
56849
|
-
const
|
|
56850
|
-
return args.command(apiExposureCommand).command(cycleCommand).command(lintCommand).command(lintlintCommand).command(deplintCommand).command(nodeCommand).command(nodeLintCommand).command(fixCommand).command(relintCommand).command(publintCommand).command(republintCommand)
|
|
57178
|
+
const xyLintStableCommands = (args) => {
|
|
57179
|
+
return args.command(apiExposureCommand).command(cycleCommand).command(lintCommand).command(lintlintCommand).command(deplintCommand).command(nodeCommand).command(nodeLintCommand).command(fixCommand).command(relintCommand).command(publintCommand).command(republintCommand);
|
|
57180
|
+
};
|
|
57181
|
+
const lintExperimentalCommands = [sonarCommand];
|
|
57182
|
+
const xyLintExperimentalCommands = (args, channel) => {
|
|
57183
|
+
return registerExperimentalCommands(args, channel, lintExperimentalCommands);
|
|
56851
57184
|
};
|
|
56852
57185
|
//#endregion
|
|
56853
57186
|
//#region src/xy/react/analyzeCommand.ts
|
|
@@ -56940,9 +57273,194 @@ const startCommand = {
|
|
|
56940
57273
|
};
|
|
56941
57274
|
//#endregion
|
|
56942
57275
|
//#region src/xy/react/index.ts
|
|
56943
|
-
const
|
|
56944
|
-
return args.command(
|
|
57276
|
+
const xyReactStableCommands = (args) => {
|
|
57277
|
+
return args.command(startCommand);
|
|
56945
57278
|
};
|
|
57279
|
+
const reactExperimentalCommands = [
|
|
57280
|
+
analyzeCommand,
|
|
57281
|
+
ejectCommand,
|
|
57282
|
+
sitemapCommand
|
|
57283
|
+
];
|
|
57284
|
+
const xyReactExperimentalCommands = (args, channel) => {
|
|
57285
|
+
return registerExperimentalCommands(args, channel, reactExperimentalCommands);
|
|
57286
|
+
};
|
|
57287
|
+
//#endregion
|
|
57288
|
+
//#region src/xy/stability.ts
|
|
57289
|
+
/**
|
|
57290
|
+
* Command names and their stability tier. Keys are the yargs path users type
|
|
57291
|
+
* (`packman`, `packman convert`). Nested subcommands inherit the parent's
|
|
57292
|
+
* tier unless listed separately.
|
|
57293
|
+
*/
|
|
57294
|
+
const COMMAND_STABILITY = {
|
|
57295
|
+
"build": "stable",
|
|
57296
|
+
"compile": "stable",
|
|
57297
|
+
"recompile": "stable",
|
|
57298
|
+
"rebuild": "stable",
|
|
57299
|
+
"copy-assets": "stable",
|
|
57300
|
+
"tsc-validate": "experimental",
|
|
57301
|
+
"lint": "stable",
|
|
57302
|
+
"lintlint": "deprecated",
|
|
57303
|
+
"fix": "stable",
|
|
57304
|
+
"relint": "deprecated",
|
|
57305
|
+
"deplint": "stable",
|
|
57306
|
+
"node": "stable",
|
|
57307
|
+
"node-lint": "deprecated",
|
|
57308
|
+
"publint": "stable",
|
|
57309
|
+
"republint": "deprecated",
|
|
57310
|
+
"api-exposure": "stable",
|
|
57311
|
+
"cycle": "stable",
|
|
57312
|
+
"sonar": "experimental",
|
|
57313
|
+
"deploy": "stable",
|
|
57314
|
+
"publish": "stable",
|
|
57315
|
+
"clean": "stable",
|
|
57316
|
+
"install": "stable",
|
|
57317
|
+
"reinstall": "stable",
|
|
57318
|
+
"up": "stable",
|
|
57319
|
+
"updo": "stable",
|
|
57320
|
+
"statics": "stable",
|
|
57321
|
+
"check": "stable",
|
|
57322
|
+
"license": "stable",
|
|
57323
|
+
"dead": "experimental",
|
|
57324
|
+
"enable": "experimental",
|
|
57325
|
+
"git": "stable",
|
|
57326
|
+
"gitlint": "deprecated",
|
|
57327
|
+
"gitignore": "stable",
|
|
57328
|
+
"npmignore-gen": "stable",
|
|
57329
|
+
"orphan": "experimental",
|
|
57330
|
+
"packman": "stable",
|
|
57331
|
+
"packman lint": "stable",
|
|
57332
|
+
"packman convert": "experimental",
|
|
57333
|
+
"packman clean": "experimental",
|
|
57334
|
+
"repo": "stable",
|
|
57335
|
+
"retest": "stable",
|
|
57336
|
+
"secure": "stable",
|
|
57337
|
+
"skills": "stable",
|
|
57338
|
+
"test": "stable",
|
|
57339
|
+
"work": "experimental",
|
|
57340
|
+
"start": "stable",
|
|
57341
|
+
"analyze": "experimental",
|
|
57342
|
+
"eject": "experimental",
|
|
57343
|
+
"sitemap": "experimental"
|
|
57344
|
+
};
|
|
57345
|
+
Object.entries(COMMAND_STABILITY).filter(([, stability]) => stability === "experimental").map(([name]) => name);
|
|
57346
|
+
const PACKAGE_STABILITY = {
|
|
57347
|
+
"@ariestools/eslint-config-flat": "stable",
|
|
57348
|
+
"@ariestools/eslint-config-react-flat": "stable",
|
|
57349
|
+
"@ariestools/lib-neutral": "stable-narrow",
|
|
57350
|
+
"@ariestools/toolchain": "stable",
|
|
57351
|
+
"@ariestools/tsconfig": "stable",
|
|
57352
|
+
"@ariestools/tsconfig-dom": "stable",
|
|
57353
|
+
"@ariestools/tsconfig-react": "stable",
|
|
57354
|
+
"@ariestools/vitest-config": "stable"
|
|
57355
|
+
};
|
|
57356
|
+
/**
|
|
57357
|
+
* Config flags and fields that may change on a minor. Stable `xy.config.ts`
|
|
57358
|
+
* fields used by stable commands remain semver-stable.
|
|
57359
|
+
*/
|
|
57360
|
+
const EXPERIMENTAL_CONFIG_SURFACES = [
|
|
57361
|
+
{
|
|
57362
|
+
description: "Shared-host typecheck (`compile.validator: 'shared'`). Same engine as `xyex tsc-validate`. Incompatible with `compile.compiler: 'native'`.",
|
|
57363
|
+
id: "compile.validator.shared",
|
|
57364
|
+
path: "compile.validator"
|
|
57365
|
+
},
|
|
57366
|
+
{
|
|
57367
|
+
description: "Reserved `compile.mode: 'tsc'`. Not wired into packageCompile.",
|
|
57368
|
+
id: "compile.mode.tsc",
|
|
57369
|
+
path: "compile.mode"
|
|
57370
|
+
},
|
|
57371
|
+
{
|
|
57372
|
+
description: "TypeScript 7 (Go) compiler. Enable with `xyex enable ts-native`. This repo may dogfood it; public examples must not require it.",
|
|
57373
|
+
id: "compile.compiler.native",
|
|
57374
|
+
path: "compile.compiler"
|
|
57375
|
+
},
|
|
57376
|
+
{
|
|
57377
|
+
description: "ESLint canary tier. Default remains tier 3. May change on a minor.",
|
|
57378
|
+
id: "eslint.tier.4",
|
|
57379
|
+
path: "recommendedConfig({ tier: 4 })"
|
|
57380
|
+
},
|
|
57381
|
+
{
|
|
57382
|
+
description: "Shared TypeScript ingestion lint mode.",
|
|
57383
|
+
id: "lint.mode.shared-typecheck",
|
|
57384
|
+
path: "xy lint --mode shared-typecheck"
|
|
57385
|
+
},
|
|
57386
|
+
{
|
|
57387
|
+
description: "npm, Yarn, and Bun. pnpm is the supported package manager.",
|
|
57388
|
+
id: "package-manager.non-pnpm",
|
|
57389
|
+
path: "package manager"
|
|
57390
|
+
}
|
|
57391
|
+
];
|
|
57392
|
+
const STABILITY_PROMOTION_RUBRIC = [
|
|
57393
|
+
"Tests in this repo and at least one dogfood consumer beyond this repo",
|
|
57394
|
+
"Flags and xy.config.ts fields documented in xy-toolchain skills",
|
|
57395
|
+
"--json envelope works when the command reports findings",
|
|
57396
|
+
"No known data-loss --fix",
|
|
57397
|
+
"One minor without a breaking rename"
|
|
57398
|
+
];
|
|
57399
|
+
//#endregion
|
|
57400
|
+
//#region src/xy/stabilityCatalog.ts
|
|
57401
|
+
function getStabilityCatalog() {
|
|
57402
|
+
const commands = Object.entries(COMMAND_STABILITY).map(([name, stability]) => ({
|
|
57403
|
+
name,
|
|
57404
|
+
stability
|
|
57405
|
+
})).toSorted((a, b) => a.name.localeCompare(b.name));
|
|
57406
|
+
const packages = Object.entries(PACKAGE_STABILITY).map(([name, stability]) => ({
|
|
57407
|
+
name,
|
|
57408
|
+
stability
|
|
57409
|
+
})).toSorted((a, b) => a.name.localeCompare(b.name));
|
|
57410
|
+
return {
|
|
57411
|
+
commands,
|
|
57412
|
+
experimentalConfig: EXPERIMENTAL_CONFIG_SURFACES,
|
|
57413
|
+
packages,
|
|
57414
|
+
promotion: {
|
|
57415
|
+
experimentalToStable: STABILITY_PROMOTION_RUBRIC,
|
|
57416
|
+
stableToRemoved: "major version, after a changelog warning alias"
|
|
57417
|
+
},
|
|
57418
|
+
schemaVersion: 1
|
|
57419
|
+
};
|
|
57420
|
+
}
|
|
57421
|
+
function stabilityColor(stability) {
|
|
57422
|
+
if (stability === "stable") return "green";
|
|
57423
|
+
if (stability === "experimental" || stability === "stable-narrow") return "yellow";
|
|
57424
|
+
return "gray";
|
|
57425
|
+
}
|
|
57426
|
+
function printNamedTable(title, rows) {
|
|
57427
|
+
console.log(chalk.bold(title));
|
|
57428
|
+
const nameWidth = Math.max(...rows.map((row) => row.name.length), 4);
|
|
57429
|
+
for (const row of rows) {
|
|
57430
|
+
const color = stabilityColor(row.stability);
|
|
57431
|
+
console.log(` ${row.name.padEnd(nameWidth)} ${chalk[color](row.stability)}`);
|
|
57432
|
+
}
|
|
57433
|
+
console.log();
|
|
57434
|
+
}
|
|
57435
|
+
function renderStabilityCatalog(catalog) {
|
|
57436
|
+
console.log(chalk.bold("XY Stability"));
|
|
57437
|
+
console.log(chalk.gray("xy is semver-stable. xyex may change on a minor. See docs/STABILITY.md."));
|
|
57438
|
+
console.log();
|
|
57439
|
+
printNamedTable("Commands", catalog.commands);
|
|
57440
|
+
printNamedTable("Packages", catalog.packages);
|
|
57441
|
+
console.log(chalk.bold("Experimental config"));
|
|
57442
|
+
const idWidth = Math.max(...catalog.experimentalConfig.map((entry) => entry.id.length), 4);
|
|
57443
|
+
for (const entry of catalog.experimentalConfig) {
|
|
57444
|
+
console.log(` ${entry.id.padEnd(idWidth)} ${chalk.gray(entry.path)}`);
|
|
57445
|
+
console.log(` ${entry.description}`);
|
|
57446
|
+
}
|
|
57447
|
+
console.log();
|
|
57448
|
+
console.log(chalk.bold("Promotion (experimental → stable)"));
|
|
57449
|
+
for (const item of catalog.promotion.experimentalToStable) console.log(` - ${item}`);
|
|
57450
|
+
console.log(chalk.gray(` Removal of a stable command: ${catalog.promotion.stableToRemoved}`));
|
|
57451
|
+
}
|
|
57452
|
+
function stabilityCatalogResult() {
|
|
57453
|
+
const catalog = getStabilityCatalog();
|
|
57454
|
+
if (!isJsonMode()) renderStabilityCatalog(catalog);
|
|
57455
|
+
return {
|
|
57456
|
+
envelope: {
|
|
57457
|
+
data: catalog,
|
|
57458
|
+
errorCount: 0,
|
|
57459
|
+
warningCount: 0
|
|
57460
|
+
},
|
|
57461
|
+
exitCode: 0
|
|
57462
|
+
};
|
|
57463
|
+
}
|
|
56946
57464
|
//#endregion
|
|
56947
57465
|
//#region src/xy/packageManagerWarning.ts
|
|
56948
57466
|
function unsupportedPackageManagerWarning(packageManager) {
|
|
@@ -62218,12 +62736,12 @@ function isYargsInstance(y) {
|
|
|
62218
62736
|
const Yargs = YargsFactory(esm_default);
|
|
62219
62737
|
//#endregion
|
|
62220
62738
|
//#region src/xy/xyParseOptions.ts
|
|
62221
|
-
function scriptNameForPackageManager() {
|
|
62739
|
+
function scriptNameForPackageManager(binName) {
|
|
62222
62740
|
switch (detectPackageManager$1()) {
|
|
62223
|
-
case "bun": return
|
|
62224
|
-
case "npm": return
|
|
62225
|
-
case "pnpm": return
|
|
62226
|
-
default: return
|
|
62741
|
+
case "bun": return `bun run ${binName}`;
|
|
62742
|
+
case "npm": return `npm exec -- ${binName}`;
|
|
62743
|
+
case "pnpm": return `pnpm ${binName}`;
|
|
62744
|
+
default: return `yarn ${binName}`;
|
|
62227
62745
|
}
|
|
62228
62746
|
}
|
|
62229
62747
|
function formatDuration(ms) {
|
|
@@ -62231,9 +62749,12 @@ function formatDuration(ms) {
|
|
|
62231
62749
|
if (ms < 6e4) return `${(ms / 1e3).toFixed(2)}s`;
|
|
62232
62750
|
return `${Math.floor(ms / 6e4)}m ${(ms % 6e4 / 1e3).toFixed(1)}s`;
|
|
62233
62751
|
}
|
|
62234
|
-
const xyParseOptions = () => {
|
|
62752
|
+
const xyParseOptions = (config = {}) => {
|
|
62235
62753
|
let isTimerRegistered = false;
|
|
62236
|
-
|
|
62754
|
+
const channel = config.channel ?? "stable";
|
|
62755
|
+
const binName = channel === "experimental" ? "xyex" : "xy";
|
|
62756
|
+
const brand = channel === "experimental" ? "XYEX" : "XY";
|
|
62757
|
+
return Yargs(hideBin(process.argv)).scriptName(config.scriptName ?? process.env.SCRIPT_NAME ?? scriptNameForPackageManager(binName)).middleware((argv) => {
|
|
62237
62758
|
if (Boolean(argv.json)) setJsonMode(true);
|
|
62238
62759
|
if (Boolean(argv.strict) || process.env.XY_STRICT === "1") setStrictMode(true);
|
|
62239
62760
|
}, true).middleware((argv) => {
|
|
@@ -62250,7 +62771,7 @@ const xyParseOptions = () => {
|
|
|
62250
62771
|
const commandName = argv._[0];
|
|
62251
62772
|
const jobs = argv.jobs;
|
|
62252
62773
|
const label = commandName != null && commandName.length > 0 ? ` [${chalk.white(commandName)}]` : "";
|
|
62253
|
-
console.log(chalk.blue(
|
|
62774
|
+
console.log(chalk.blue(`⬡ ${brand}`) + label + chalk.gray(` [threads: ${jobs}]`));
|
|
62254
62775
|
const start = Date.now();
|
|
62255
62776
|
process.on("exit", () => {
|
|
62256
62777
|
const whiteCommand = commandName != null && commandName.length > 0 ? chalk.white(commandName) : void 0;
|
|
@@ -62285,6 +62806,10 @@ const xyParseOptions = () => {
|
|
|
62285
62806
|
default: false,
|
|
62286
62807
|
description: "List supported rules and their effective levels",
|
|
62287
62808
|
type: "boolean"
|
|
62809
|
+
}).option("stability", {
|
|
62810
|
+
default: false,
|
|
62811
|
+
description: "List command, package, and experimental config stability",
|
|
62812
|
+
type: "boolean"
|
|
62288
62813
|
}).option("no-defer", {
|
|
62289
62814
|
default: false,
|
|
62290
62815
|
description: "Do not defer to local package.json script of the same name",
|
|
@@ -62306,8 +62831,8 @@ function registerPackageManagers() {
|
|
|
62306
62831
|
function isTruthyLongFlag(arg, flag) {
|
|
62307
62832
|
return arg === flag || arg === `${flag}=true`;
|
|
62308
62833
|
}
|
|
62309
|
-
function
|
|
62310
|
-
if (raw.every((arg) => !isTruthyLongFlag(arg,
|
|
62834
|
+
function isRootLongFlagRequest(flag, raw = process.argv.slice(2)) {
|
|
62835
|
+
if (raw.every((arg) => !isTruthyLongFlag(arg, flag))) return false;
|
|
62311
62836
|
for (let i = 0; i < raw.length; i++) {
|
|
62312
62837
|
const arg = raw[i];
|
|
62313
62838
|
if (arg === "--jobs" || arg === "-j") {
|
|
@@ -62318,17 +62843,41 @@ function isRootRulesRequest(raw = process.argv.slice(2)) {
|
|
|
62318
62843
|
}
|
|
62319
62844
|
return true;
|
|
62320
62845
|
}
|
|
62321
|
-
|
|
62846
|
+
function isRootRulesRequest(raw = process.argv.slice(2)) {
|
|
62847
|
+
return isRootLongFlagRequest("--rules", raw);
|
|
62848
|
+
}
|
|
62849
|
+
function isRootStabilityRequest(raw = process.argv.slice(2)) {
|
|
62850
|
+
return isRootLongFlagRequest("--stability", raw);
|
|
62851
|
+
}
|
|
62852
|
+
function registerCoreCommands(args, channel) {
|
|
62853
|
+
let next = xyLintStableCommands(args);
|
|
62854
|
+
next = xyLintExperimentalCommands(next, channel);
|
|
62855
|
+
next = xyCommonStableCommands(next, channel);
|
|
62856
|
+
next = xyCommonExperimentalCommands(next, channel);
|
|
62857
|
+
next = xyBuildStableCommands(next);
|
|
62858
|
+
next = xyBuildExperimentalCommands(next, channel);
|
|
62859
|
+
return next;
|
|
62860
|
+
}
|
|
62861
|
+
const xyBase = async (options = {}) => {
|
|
62862
|
+
const channel = options.channel ?? "stable";
|
|
62322
62863
|
registerPackageManagers();
|
|
62323
62864
|
warnIfUnsupportedPackageManager();
|
|
62324
|
-
if (
|
|
62865
|
+
if (channel === "experimental") printXyexBanner();
|
|
62866
|
+
if (isRootStabilityRequest() || isRootRulesRequest()) {
|
|
62325
62867
|
if (process.argv.some((arg) => isTruthyLongFlag(arg, "--json"))) setJsonMode(true);
|
|
62868
|
+
if (isRootStabilityRequest()) {
|
|
62869
|
+
await withEnvelope("stability", () => stabilityCatalogResult());
|
|
62870
|
+
return;
|
|
62871
|
+
}
|
|
62326
62872
|
await withEnvelope("rules", async () => ruleCatalogResult(await getMasterRuleCatalog(), ROOT_RULES_TITLE));
|
|
62327
62873
|
return;
|
|
62328
62874
|
}
|
|
62329
|
-
|
|
62330
|
-
|
|
62331
|
-
|
|
62875
|
+
let args = registerCoreCommands(xyParseOptions({
|
|
62876
|
+
channel,
|
|
62877
|
+
scriptName: options.scriptName
|
|
62878
|
+
}), channel);
|
|
62879
|
+
if (options.plugins) args = options.plugins(args, channel);
|
|
62880
|
+
const cliLabel = channel === "experimental" ? "xyex" : "xy";
|
|
62332
62881
|
return await args.demandCommand(1).command("*", "", () => {
|
|
62333
62882
|
const cmd = process.argv[2];
|
|
62334
62883
|
if (cmd === void 0) return;
|
|
@@ -62338,14 +62887,22 @@ const xyBase = async (plugins) => {
|
|
|
62338
62887
|
"--version"
|
|
62339
62888
|
].includes(a))) return;
|
|
62340
62889
|
console.error(chalk.yellow(`Command not found [${chalk.magenta(cmd)}]`));
|
|
62341
|
-
console.log(chalk.gray(
|
|
62890
|
+
console.log(chalk.gray(`Try '${cliLabel} --help' for list of commands`));
|
|
62342
62891
|
}).version().help().argv;
|
|
62343
62892
|
};
|
|
62893
|
+
function registerLifecyclePlugins(args, channel) {
|
|
62894
|
+
let result = xyInstallCommands(xyDeployCommands(args));
|
|
62895
|
+
if (isReactProject()) {
|
|
62896
|
+
result = xyReactStableCommands(result);
|
|
62897
|
+
result = xyReactExperimentalCommands(result, channel);
|
|
62898
|
+
}
|
|
62899
|
+
return result;
|
|
62900
|
+
}
|
|
62901
|
+
/** Stable public CLI (`xy`). Experimental commands still run with a migration warning. */
|
|
62344
62902
|
const xy = async () => {
|
|
62345
|
-
return await xyBase(
|
|
62346
|
-
|
|
62347
|
-
|
|
62348
|
-
return result;
|
|
62903
|
+
return await xyBase({
|
|
62904
|
+
channel: "stable",
|
|
62905
|
+
plugins: registerLifecyclePlugins
|
|
62349
62906
|
});
|
|
62350
62907
|
};
|
|
62351
62908
|
//#endregion
|