@ariestools/toolchain 9.0.3 → 9.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/build.d.ts.map +1 -1
- package/dist/actions/clean.d.ts.map +1 -1
- package/dist/actions/compile.d.ts.map +1 -1
- package/dist/actions/deplint/checkPackage/checkPackage.d.ts.map +1 -1
- package/dist/actions/deplint/getExtendsFromTsconfigs.d.ts.map +1 -1
- package/dist/actions/publint.d.ts.map +1 -1
- package/dist/bin/package/build.mjs +382 -379
- package/dist/bin/package/build.mjs.map +1 -1
- package/dist/bin/package/clean.mjs.map +1 -1
- package/dist/bin/package/compile.mjs +382 -379
- package/dist/bin/package/compile.mjs.map +1 -1
- package/dist/bin/package/publint.mjs.map +1 -1
- package/dist/bin/package/recompile.mjs +382 -379
- package/dist/bin/package/recompile.mjs.map +1 -1
- package/dist/bin/xy.mjs +38 -17
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/lib/secure/collectDeclaredDependencies.d.ts.map +1 -1
- package/dist/lib/updo/runUpdo.d.ts.map +1 -1
- package/dist/pm/PackageManager.d.ts +16 -0
- package/dist/pm/PackageManager.d.ts.map +1 -1
- package/dist/pm/pnpmPackageManager.d.ts.map +1 -1
- package/dist/pm/workspaceDir.d.ts +11 -0
- package/dist/pm/workspaceDir.d.ts.map +1 -0
- package/dist/pm/workspaces.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/bin/xy.mjs
CHANGED
|
@@ -4642,10 +4642,12 @@ function findWorkspaceRoot(startDir) {
|
|
|
4642
4642
|
function workspaceFromPackageJsonMatch(match, cwd, seen) {
|
|
4643
4643
|
const name = readJsonFile$1(match)?.name;
|
|
4644
4644
|
if (name === void 0 || name.length === 0) return void 0;
|
|
4645
|
-
const
|
|
4645
|
+
const dir = PATH.dirname(match);
|
|
4646
|
+
const location = PATH.relative(cwd, dir) || ".";
|
|
4646
4647
|
if (seen.has(location)) return void 0;
|
|
4647
4648
|
seen.add(location);
|
|
4648
4649
|
return {
|
|
4650
|
+
dir: PATH.resolve(dir),
|
|
4649
4651
|
location,
|
|
4650
4652
|
name
|
|
4651
4653
|
};
|
|
@@ -4810,7 +4812,7 @@ function hasReactDependency(packageJsonPath) {
|
|
|
4810
4812
|
}
|
|
4811
4813
|
}
|
|
4812
4814
|
function hasWorkspaceReact(workspace) {
|
|
4813
|
-
return hasReactDependency(PATH.join(workspace.
|
|
4815
|
+
return hasReactDependency(PATH.join(workspace.dir, "package.json"));
|
|
4814
4816
|
}
|
|
4815
4817
|
function isReactInMonorepo(cwd, isVerbose) {
|
|
4816
4818
|
if (hasReactDependency(PATH.resolve(cwd, "package.json"))) {
|
|
@@ -5029,6 +5031,7 @@ var PnpmPackageManager = class {
|
|
|
5029
5031
|
if (Array.isArray(parsed)) return parsed.map((pkg) => {
|
|
5030
5032
|
const rel = PATH.relative(cwd, pkg.path);
|
|
5031
5033
|
return {
|
|
5034
|
+
dir: PATH.resolve(cwd, pkg.path),
|
|
5032
5035
|
location: rel === "" ? "." : rel,
|
|
5033
5036
|
name: pkg.name
|
|
5034
5037
|
};
|
|
@@ -19399,6 +19402,7 @@ function collectSecurePackageTargets(cwd, workspaces) {
|
|
|
19399
19402
|
const rootName = readPackageJson$10(PATH.resolve(cwd, "package.json"))?.name;
|
|
19400
19403
|
if (rootName !== void 0 && rootName.length > 0) {
|
|
19401
19404
|
targets.push({
|
|
19405
|
+
dir: PATH.resolve(cwd),
|
|
19402
19406
|
location: ".",
|
|
19403
19407
|
name: rootName
|
|
19404
19408
|
});
|
|
@@ -19408,6 +19412,7 @@ function collectSecurePackageTargets(cwd, workspaces) {
|
|
|
19408
19412
|
const normalizedLocation = workspace.location || ".";
|
|
19409
19413
|
if (seenLocations.has(normalizedLocation)) continue;
|
|
19410
19414
|
targets.push({
|
|
19415
|
+
dir: workspace.dir,
|
|
19411
19416
|
location: normalizedLocation,
|
|
19412
19417
|
name: workspace.name
|
|
19413
19418
|
});
|
|
@@ -22050,6 +22055,7 @@ function listWorkspacesFromFs(cwd) {
|
|
|
22050
22055
|
if (existsSync(rootPath)) try {
|
|
22051
22056
|
const root = JSON.parse(readFileSync(rootPath, "utf8"));
|
|
22052
22057
|
if (root.name != null && root.name.length > 0 && workspaces.every((ws) => ws.location !== ".")) workspaces.unshift({
|
|
22058
|
+
dir: PATH.dirname(rootPath),
|
|
22053
22059
|
location: ".",
|
|
22054
22060
|
name: root.name
|
|
22055
22061
|
});
|
|
@@ -25873,6 +25879,7 @@ function readRootWorkspace(rootDir) {
|
|
|
25873
25879
|
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
|
|
25874
25880
|
if (packageJson.name == null || packageJson.name.length === 0) return void 0;
|
|
25875
25881
|
return {
|
|
25882
|
+
dir: PATH.resolve(rootDir),
|
|
25876
25883
|
listed: false,
|
|
25877
25884
|
location: ".",
|
|
25878
25885
|
name: packageJson.name,
|
|
@@ -27228,6 +27235,14 @@ function parseTypesField(value) {
|
|
|
27228
27235
|
if (Array.isArray(value)) return value.filter((v) => typeof v === "string");
|
|
27229
27236
|
return [];
|
|
27230
27237
|
}
|
|
27238
|
+
function parseCompilerOptions(value, basePath, configFileName) {
|
|
27239
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return {};
|
|
27240
|
+
return ts.convertCompilerOptionsFromJson(value, basePath, configFileName).options;
|
|
27241
|
+
}
|
|
27242
|
+
function resolveTypeReferencePackage(ref, containingFile, compilerOptions) {
|
|
27243
|
+
const packageName = ts.resolveTypeReferenceDirective(ref, containingFile, compilerOptions, ts.sys).resolvedTypeReferenceDirective?.packageId?.name;
|
|
27244
|
+
return packageName === void 0 ? void 0 : getBasePackageName(packageName);
|
|
27245
|
+
}
|
|
27231
27246
|
function parsePathsField(value) {
|
|
27232
27247
|
if (typeof value !== "object" || value === null) return [];
|
|
27233
27248
|
return Object.keys(value);
|
|
@@ -27307,7 +27322,11 @@ function getTypesFromTsconfigs(location) {
|
|
|
27307
27322
|
for (const file of collectTsconfigFiles(location)) try {
|
|
27308
27323
|
const compilerOptions = parseTsconfig(file).compilerOptions;
|
|
27309
27324
|
const refs = parseTypesField(compilerOptions?.types);
|
|
27310
|
-
|
|
27325
|
+
const resolvedCompilerOptions = parseCompilerOptions(compilerOptions, PATH.dirname(file), file);
|
|
27326
|
+
for (const ref of refs) {
|
|
27327
|
+
const packageName = resolveTypeReferencePackage(ref, file, resolvedCompilerOptions);
|
|
27328
|
+
if (packageName !== void 0) packages.add(packageName);
|
|
27329
|
+
}
|
|
27311
27330
|
} catch {}
|
|
27312
27331
|
return [...packages];
|
|
27313
27332
|
}
|
|
@@ -30182,16 +30201,16 @@ function buildWorkspaceContext(workspace, options = {}) {
|
|
|
30182
30201
|
hasRuntimeRoots: runtimeRoots.length > 0,
|
|
30183
30202
|
location: workspace.location,
|
|
30184
30203
|
name: workspace.name,
|
|
30185
|
-
tsconfigExtends: getExtendsFromTsconfigs(workspace.
|
|
30186
|
-
tsconfigPaths: getPathsFromTsconfigs(workspace.
|
|
30187
|
-
tsconfigTypes: getTypesFromTsconfigs(workspace.
|
|
30204
|
+
tsconfigExtends: getExtendsFromTsconfigs(workspace.dir),
|
|
30205
|
+
tsconfigPaths: getPathsFromTsconfigs(workspace.dir),
|
|
30206
|
+
tsconfigTypes: getTypesFromTsconfigs(workspace.dir),
|
|
30188
30207
|
useSourceFallback: packageClassification.facets.runtimeEntry !== "none"
|
|
30189
30208
|
});
|
|
30190
30209
|
recordPhase(phases, "importsMs", importsStarted);
|
|
30191
|
-
const packageJsonPath = `${workspace.
|
|
30210
|
+
const packageJsonPath = `${workspace.dir}/package.json`;
|
|
30192
30211
|
const packageParams = getDependenciesFromPackageJson(packageJsonPath);
|
|
30193
30212
|
const peerForwarding = resolvePeerForwardingPolicy(options.classifier, options.apiExposureConfig, sourceParams);
|
|
30194
|
-
const requiredTransitivePeers = getRequiredNonOptionalTransitivePeers(workspace.
|
|
30213
|
+
const requiredTransitivePeers = getRequiredNonOptionalTransitivePeers(workspace.dir, packageParams);
|
|
30195
30214
|
const runtimeRootedRequired = new Set([...getRuntimeRootedNonOptionalTransitivePeers(workspace.location, packageParams)].filter((peer) => isPeerForwarded(peerForwarding, peer)));
|
|
30196
30215
|
return {
|
|
30197
30216
|
classifierMode: options.classifier ?? "legacy",
|
|
@@ -32171,12 +32190,12 @@ function failedSemanticResult(pkg, output, timeMs) {
|
|
|
32171
32190
|
}
|
|
32172
32191
|
async function lintSemanticPackage({ analyze, configOverride, fix, gitignore, gitignorePath, profile, rulePlan, sharedCache, verbose, workspace }) {
|
|
32173
32192
|
const started = performance$1.now();
|
|
32174
|
-
const programResult = createWorkspaceProgramInProcess(workspace.
|
|
32193
|
+
const programResult = createWorkspaceProgramInProcess(workspace.dir, sharedCache);
|
|
32175
32194
|
if (programResult.kind === "skipped") return failedSemanticResult(workspace.name, `Shared typecheck [${workspace.name}] requires ${PATH.join(workspace.location, "tsconfig.json")}\n`, Math.round(performance$1.now() - started));
|
|
32176
32195
|
if (programResult.kind === "error") return failedSemanticResult(workspace.name, programResult.formatted, Math.round(performance$1.now() - started));
|
|
32177
32196
|
const lintFiles = programResult.rootNames.filter((fileName) => scriptExtensionPattern.test(fileName));
|
|
32178
32197
|
if (lintFiles.length === 0) return emptySemanticResult(workspace.name);
|
|
32179
|
-
const base = await baseSharedTypecheckConfigs(workspace.
|
|
32198
|
+
const base = await baseSharedTypecheckConfigs(workspace.dir, configOverride, gitignorePath);
|
|
32180
32199
|
const disabledRules = Object.fromEntries([...rulePlan.activeRuleNames].filter((ruleName) => !rulePlan.typeCheckedRuleNames.has(ruleName)).map((ruleName) => [ruleName, "off"]));
|
|
32181
32200
|
const semanticConfig = {
|
|
32182
32201
|
files: sharedTypecheckScriptPatterns,
|
|
@@ -38253,7 +38272,7 @@ const publintSingle = async ({ cliExclude, cliInclude, fix, pack, pkg, verbose }
|
|
|
38253
38272
|
ruleLevels: resolvedRules,
|
|
38254
38273
|
shouldFix: fix,
|
|
38255
38274
|
shouldPack,
|
|
38256
|
-
pkgDir: workspace.
|
|
38275
|
+
pkgDir: workspace.dir,
|
|
38257
38276
|
verbose
|
|
38258
38277
|
});
|
|
38259
38278
|
logPublintSummary(1, result.errors, result.warnings, performance.now() - start);
|
|
@@ -38280,7 +38299,7 @@ async function runWorkspacePublint({ cliExclude, cliInclude, fix, pack, verbose,
|
|
|
38280
38299
|
ruleLevels: resolvedRules,
|
|
38281
38300
|
shouldFix: fix,
|
|
38282
38301
|
shouldPack,
|
|
38283
|
-
pkgDir: ws.
|
|
38302
|
+
pkgDir: ws.dir,
|
|
38284
38303
|
verbose
|
|
38285
38304
|
});
|
|
38286
38305
|
captured = {
|
|
@@ -38423,7 +38442,8 @@ function selectedWorkspaces(workspaces, names) {
|
|
|
38423
38442
|
return workspaces.filter((workspace) => selected.has(workspace.name));
|
|
38424
38443
|
}
|
|
38425
38444
|
function listedWorkspaces(workspaces) {
|
|
38426
|
-
return workspaces.filter((workspace) => workspace.listed !== false).map(({ location, name }) => ({
|
|
38445
|
+
return workspaces.filter((workspace) => workspace.listed !== false).map(({ dir, location, name }) => ({
|
|
38446
|
+
dir,
|
|
38427
38447
|
location,
|
|
38428
38448
|
name
|
|
38429
38449
|
}));
|
|
@@ -38567,6 +38587,7 @@ function readPackageJson$2(packagePath) {
|
|
|
38567
38587
|
function rootWorkspace(rootDir) {
|
|
38568
38588
|
const name = readPackageJson$2(rootDir)?.name ?? packageName();
|
|
38569
38589
|
return name != null && name.length > 0 ? {
|
|
38590
|
+
dir: PATH.resolve(rootDir),
|
|
38570
38591
|
location: ".",
|
|
38571
38592
|
name
|
|
38572
38593
|
} : void 0;
|
|
@@ -40988,7 +41009,7 @@ const dead = async (options = {}) => {
|
|
|
40988
41009
|
//#endregion
|
|
40989
41010
|
//#region src/actions/deploy.ts
|
|
40990
41011
|
const privatePackageExcludeList = () => {
|
|
40991
|
-
return getPackageManager().listWorkspaces().map((workspace) => [workspace, JSON.parse(readFileSync(`${workspace.
|
|
41012
|
+
return getPackageManager().listWorkspaces().map((workspace) => [workspace, JSON.parse(readFileSync(`${workspace.dir}/package.json`, { encoding: "utf8" }))]).filter(([_, pkg]) => pkg.private ?? false).map(([workspace]) => workspace).map((workspace) => `--exclude ${workspace.name}`);
|
|
40992
41013
|
};
|
|
40993
41014
|
function deploy(level = "patch") {
|
|
40994
41015
|
const excludeList = privatePackageExcludeList();
|
|
@@ -42916,7 +42937,7 @@ function collectUsedReleaseAgeScopePrefixes(cwd, workspaces) {
|
|
|
42916
42937
|
for (const workspace of workspaces) {
|
|
42917
42938
|
addKnownScopesUsedByPackageName(used, workspace.name);
|
|
42918
42939
|
if (workspace.location === ".") continue;
|
|
42919
|
-
scanPackageJson(workspace.
|
|
42940
|
+
scanPackageJson(workspace.dir);
|
|
42920
42941
|
}
|
|
42921
42942
|
return used;
|
|
42922
42943
|
}
|
|
@@ -45521,7 +45542,7 @@ async function loadCommandConfig$1(commandName, pkg) {
|
|
|
45521
45542
|
if (pkg !== void 0 && pkg.length > 0) {
|
|
45522
45543
|
const workspace = getPackageManager().findWorkspace(pkg);
|
|
45523
45544
|
if (workspace === void 0) throw new Error(`Workspace not found: ${pkg}`);
|
|
45524
|
-
return loadWorkspaceCommandConfig(workspace.
|
|
45545
|
+
return loadWorkspaceCommandConfig(workspace.dir, commandName);
|
|
45525
45546
|
}
|
|
45526
45547
|
return loadWorkspaceCommandConfig(process.cwd(), commandName);
|
|
45527
45548
|
}
|
|
@@ -53357,7 +53378,7 @@ async function loadCommandConfig(commandName, pkg) {
|
|
|
53357
53378
|
if (pkg !== void 0 && pkg.length > 0) {
|
|
53358
53379
|
const workspace = getPackageManager().findWorkspace(pkg);
|
|
53359
53380
|
if (workspace === void 0) throw new Error(`Workspace not found: ${pkg}`);
|
|
53360
|
-
return loadWorkspaceCommandConfig(workspace.
|
|
53381
|
+
return loadWorkspaceCommandConfig(workspace.dir, commandName);
|
|
53361
53382
|
}
|
|
53362
53383
|
return loadWorkspaceCommandConfig(process.cwd(), commandName);
|
|
53363
53384
|
}
|