@ariestools/toolchain 8.7.1 → 8.7.3
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/README.md +44 -0
- package/dist/actions/api-exposure/analyzer/analyzePackage.d.ts.map +1 -1
- package/dist/actions/api-exposure/reporters.d.ts.map +1 -1
- package/dist/actions/api-exposure/scoring.d.ts +1 -0
- package/dist/actions/api-exposure/scoring.d.ts.map +1 -1
- package/dist/actions/api-exposure/types.d.ts +3 -0
- package/dist/actions/api-exposure/types.d.ts.map +1 -1
- package/dist/actions/deplint/deplint.d.ts +3 -1
- package/dist/actions/deplint/deplint.d.ts.map +1 -1
- package/dist/actions/deplint/engine.d.ts +2 -2
- package/dist/actions/deplint/engine.d.ts.map +1 -1
- package/dist/actions/deplint/findFiles.d.ts.map +1 -1
- package/dist/actions/deplint/getCliReferencedPackagesFromFiles.d.ts.map +1 -1
- package/dist/actions/deplint/getImportsFromFile.d.ts.map +1 -1
- package/dist/actions/deplint/getStorybookConfigImports.d.ts.map +1 -1
- package/dist/actions/deplint/index.d.ts +2 -0
- package/dist/actions/deplint/index.d.ts.map +1 -1
- package/dist/actions/deplint/reporters.d.ts +6 -1
- package/dist/actions/deplint/reporters.d.ts.map +1 -1
- package/dist/actions/deplint/runDeplint.d.ts +4 -0
- package/dist/actions/deplint/runDeplint.d.ts.map +1 -0
- package/dist/actions/deplint/snapshot.d.ts +7 -0
- package/dist/actions/deplint/snapshot.d.ts.map +1 -1
- package/dist/actions/deplint/sourceFileCache.d.ts +11 -0
- package/dist/actions/deplint/sourceFileCache.d.ts.map +1 -0
- package/dist/actions/deplint/types.d.ts +31 -0
- package/dist/actions/deplint/types.d.ts.map +1 -1
- package/dist/actions/license.d.ts +2 -1
- package/dist/actions/license.d.ts.map +1 -1
- package/dist/actions/lintNextWorker.d.ts.map +1 -1
- package/dist/actions/package/compile/MonolithConfig.d.ts +10 -0
- package/dist/actions/package/compile/MonolithConfig.d.ts.map +1 -1
- package/dist/actions/package/compile/XyConfig.d.ts +2 -0
- package/dist/actions/package/compile/XyConfig.d.ts.map +1 -1
- package/dist/actions/package/compile/index.d.ts +1 -0
- package/dist/actions/package/compile/index.d.ts.map +1 -1
- package/dist/actions/package/compile/monolithCopyEntries.d.ts +14 -0
- package/dist/actions/package/compile/monolithCopyEntries.d.ts.map +1 -0
- package/dist/actions/package/compile/packageCompileMonolith.d.ts.map +1 -1
- package/dist/actions/package/expectedCompileOutputs.d.ts +1 -0
- package/dist/actions/package/expectedCompileOutputs.d.ts.map +1 -1
- package/dist/actions/package/exportMapPublint.d.ts.map +1 -1
- package/dist/bin/package/build.mjs +118 -14
- package/dist/bin/package/build.mjs.map +1 -1
- package/dist/bin/package/compile.mjs +84 -6
- package/dist/bin/package/compile.mjs.map +1 -1
- package/dist/bin/package/publint.mjs +95 -14
- package/dist/bin/package/publint.mjs.map +1 -1
- package/dist/bin/package/recompile.mjs +84 -6
- package/dist/bin/package/recompile.mjs.map +1 -1
- package/dist/bin/package/sync-layout.mjs +23 -6
- package/dist/bin/package/sync-layout.mjs.map +1 -1
- package/dist/bin/xy.mjs +1929 -1704
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/lib/licenseCheck/checkLicenses.d.ts +17 -1
- package/dist/lib/licenseCheck/checkLicenses.d.ts.map +1 -1
- package/dist/lib/loadConfig.d.ts.map +1 -1
- package/dist/xy/lint/deplintCommand.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -9142,17 +9142,26 @@ var import_dist = (/* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
9142
9142
|
})))();
|
|
9143
9143
|
const configState = {
|
|
9144
9144
|
config: void 0,
|
|
9145
|
+
/** In-flight root load so concurrent callers share one cosmiconfig search. */
|
|
9146
|
+
loadPromise: void 0,
|
|
9145
9147
|
rootConfigPath: void 0
|
|
9146
9148
|
};
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
+
const explorerState = {};
|
|
9150
|
+
function getExplorer() {
|
|
9151
|
+
explorerState.current ??= (0, import_dist.cosmiconfig)("xy", {
|
|
9149
9152
|
cache: true,
|
|
9150
9153
|
loaders: { ".ts": TypeScriptLoader() }
|
|
9151
9154
|
});
|
|
9155
|
+
return explorerState.current;
|
|
9152
9156
|
}
|
|
9153
|
-
|
|
9154
|
-
if (configState.config
|
|
9155
|
-
|
|
9157
|
+
async function ensureRootConfigLoaded() {
|
|
9158
|
+
if (configState.config !== void 0) return;
|
|
9159
|
+
if (configState.loadPromise !== void 0) {
|
|
9160
|
+
await configState.loadPromise;
|
|
9161
|
+
return;
|
|
9162
|
+
}
|
|
9163
|
+
configState.loadPromise = (async () => {
|
|
9164
|
+
const cosmicConfigResult = await getExplorer().search();
|
|
9156
9165
|
configState.config = cosmicConfigResult?.config ?? {};
|
|
9157
9166
|
configState.rootConfigPath = cosmicConfigResult?.filepath;
|
|
9158
9167
|
const configFilePath = cosmicConfigResult?.filepath;
|
|
@@ -9160,8 +9169,16 @@ const loadConfig = async (params) => {
|
|
|
9160
9169
|
console.log(chalk.green(`Loaded config from ${configFilePath}`));
|
|
9161
9170
|
if (Boolean(configState.config.verbose)) console.log(chalk.gray(JSON.stringify(configState.config, null, 2)));
|
|
9162
9171
|
}
|
|
9172
|
+
})();
|
|
9173
|
+
try {
|
|
9174
|
+
await configState.loadPromise;
|
|
9175
|
+
} finally {
|
|
9176
|
+
configState.loadPromise = void 0;
|
|
9163
9177
|
}
|
|
9164
|
-
|
|
9178
|
+
}
|
|
9179
|
+
const loadConfig = async (params) => {
|
|
9180
|
+
await ensureRootConfigLoaded();
|
|
9181
|
+
return deepMerge$1(configState.config ?? {}, params ?? {});
|
|
9165
9182
|
};
|
|
9166
9183
|
//#endregion
|
|
9167
9184
|
//#region ../../node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js
|
|
@@ -13001,6 +13018,65 @@ function buildMonolithEntries(config) {
|
|
|
13001
13018
|
return entries;
|
|
13002
13019
|
}
|
|
13003
13020
|
//#endregion
|
|
13021
|
+
//#region src/actions/package/compile/monolithCopyEntries.ts
|
|
13022
|
+
const copyPlatforms = /* @__PURE__ */ new Set([
|
|
13023
|
+
"browser",
|
|
13024
|
+
"neutral",
|
|
13025
|
+
"node"
|
|
13026
|
+
]);
|
|
13027
|
+
function isPathInside(parent, candidate) {
|
|
13028
|
+
const relative = PATH.relative(parent, candidate);
|
|
13029
|
+
return relative.length > 0 && relative !== ".." && !relative.startsWith(`..${PATH.sep}`) && !PATH.isAbsolute(relative);
|
|
13030
|
+
}
|
|
13031
|
+
/** Resolves configured copy destinations without requiring their sources to exist. */
|
|
13032
|
+
function listMonolithCopyEntries(packageDir, config) {
|
|
13033
|
+
const distDir = PATH.resolve(packageDir, "dist");
|
|
13034
|
+
const entries = [];
|
|
13035
|
+
const configuredCopyEntries = Object.entries(config.copyEntries ?? {});
|
|
13036
|
+
for (const [platformName, configuredEntries] of configuredCopyEntries) {
|
|
13037
|
+
if (!copyPlatforms.has(platformName)) throw new Error(`Unsupported monolith copy entry platform "${platformName}"`);
|
|
13038
|
+
const platform = platformName;
|
|
13039
|
+
const platformDir = PATH.join(distDir, platform);
|
|
13040
|
+
for (const [output, source] of Object.entries(configuredEntries)) {
|
|
13041
|
+
if (output.length === 0) throw new Error(`Monolith copy entry for ${platform} has an empty output path`);
|
|
13042
|
+
if (source.length === 0) throw new Error(`Monolith copy entry "${output}" has an empty source`);
|
|
13043
|
+
if (PATH.isAbsolute(output)) throw new Error(`Monolith copy entry output must be relative: "${output}"`);
|
|
13044
|
+
const destination = PATH.resolve(platformDir, output);
|
|
13045
|
+
if (!isPathInside(platformDir, destination)) throw new Error(`Monolith copy entry output escapes dist/${platform}: "${output}"`);
|
|
13046
|
+
const normalizedOutput = PATH.relative(platformDir, destination).split(PATH.sep).join("/");
|
|
13047
|
+
entries.push({
|
|
13048
|
+
destination,
|
|
13049
|
+
output: normalizedOutput,
|
|
13050
|
+
platform,
|
|
13051
|
+
source,
|
|
13052
|
+
subpath: `./${normalizedOutput}`
|
|
13053
|
+
});
|
|
13054
|
+
}
|
|
13055
|
+
}
|
|
13056
|
+
return entries;
|
|
13057
|
+
}
|
|
13058
|
+
function resolveCopySource(packageDir, source) {
|
|
13059
|
+
let resolved;
|
|
13060
|
+
try {
|
|
13061
|
+
resolved = PATH.isAbsolute(source) || source.startsWith(".") ? PATH.resolve(packageDir, source) : createRequire(PATH.join(packageDir, "package.json")).resolve(source);
|
|
13062
|
+
} catch (reason) {
|
|
13063
|
+
const detail = reason instanceof Error ? reason.message : String(reason);
|
|
13064
|
+
throw new Error(`Unable to resolve monolith copy entry source "${source}": ${detail}`, { cause: reason });
|
|
13065
|
+
}
|
|
13066
|
+
if (!fs.existsSync(resolved) || !fs.statSync(resolved).isFile()) throw new Error(`Monolith copy entry source is not a file: "${source}" (${resolved})`);
|
|
13067
|
+
return resolved;
|
|
13068
|
+
}
|
|
13069
|
+
/** Copies configured opaque entries into their exact dist destinations. */
|
|
13070
|
+
function copyMonolithEntries(packageDir, config) {
|
|
13071
|
+
const entries = listMonolithCopyEntries(packageDir, config);
|
|
13072
|
+
for (const entry of entries) {
|
|
13073
|
+
const source = resolveCopySource(packageDir, entry.source);
|
|
13074
|
+
fs.mkdirSync(PATH.dirname(entry.destination), { recursive: true });
|
|
13075
|
+
fs.copyFileSync(source, entry.destination);
|
|
13076
|
+
}
|
|
13077
|
+
return entries.length;
|
|
13078
|
+
}
|
|
13079
|
+
//#endregion
|
|
13004
13080
|
//#region src/actions/package/compile/packageCompileMonolith.ts
|
|
13005
13081
|
function assertNoManualEntries(compile) {
|
|
13006
13082
|
if (compile.entryMode !== void 0) throw new Error("monolith mode computes entries; remove compile.entryMode");
|
|
@@ -13093,6 +13169,8 @@ const packageCompileMonolith = async (config, mode = {}) => {
|
|
|
13093
13169
|
if (isVerbose && flattened > 0) console.log(chalk.gray(`monolith pure reexport flatten: ${flattened} files`));
|
|
13094
13170
|
const rewritten = fixMonolithDeclarations(distDir, monolith);
|
|
13095
13171
|
if (isVerbose) console.log(chalk.gray(`monolith declaration fixups: ${rewritten} files`));
|
|
13172
|
+
const copied = copyMonolithEntries(packageDir, monolith);
|
|
13173
|
+
if (isVerbose && copied > 0) console.log(chalk.gray(`monolith copied entries: ${copied} files`));
|
|
13096
13174
|
const specifierProblems = verifyMonolithRuntimeSpecifiers(distDir, monolith);
|
|
13097
13175
|
if (specifierProblems.length > 0) {
|
|
13098
13176
|
for (const problem of specifierProblems) console.error(chalk.red(problem));
|