@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
|
@@ -9127,17 +9127,26 @@ var import_dist = (/* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
9127
9127
|
})))();
|
|
9128
9128
|
const configState = {
|
|
9129
9129
|
config: void 0,
|
|
9130
|
+
/** In-flight root load so concurrent callers share one cosmiconfig search. */
|
|
9131
|
+
loadPromise: void 0,
|
|
9130
9132
|
rootConfigPath: void 0
|
|
9131
9133
|
};
|
|
9132
|
-
|
|
9133
|
-
|
|
9134
|
+
const explorerState = {};
|
|
9135
|
+
function getExplorer() {
|
|
9136
|
+
explorerState.current ??= (0, import_dist.cosmiconfig)("xy", {
|
|
9134
9137
|
cache: true,
|
|
9135
9138
|
loaders: { ".ts": TypeScriptLoader() }
|
|
9136
9139
|
});
|
|
9140
|
+
return explorerState.current;
|
|
9137
9141
|
}
|
|
9138
|
-
|
|
9139
|
-
if (configState.config
|
|
9140
|
-
|
|
9142
|
+
async function ensureRootConfigLoaded() {
|
|
9143
|
+
if (configState.config !== void 0) return;
|
|
9144
|
+
if (configState.loadPromise !== void 0) {
|
|
9145
|
+
await configState.loadPromise;
|
|
9146
|
+
return;
|
|
9147
|
+
}
|
|
9148
|
+
configState.loadPromise = (async () => {
|
|
9149
|
+
const cosmicConfigResult = await getExplorer().search();
|
|
9141
9150
|
configState.config = cosmicConfigResult?.config ?? {};
|
|
9142
9151
|
configState.rootConfigPath = cosmicConfigResult?.filepath;
|
|
9143
9152
|
const configFilePath = cosmicConfigResult?.filepath;
|
|
@@ -9145,8 +9154,16 @@ const loadConfig = async (params) => {
|
|
|
9145
9154
|
console.log(chalk.green(`Loaded config from ${configFilePath}`));
|
|
9146
9155
|
if (Boolean(configState.config.verbose)) console.log(chalk.gray(JSON.stringify(configState.config, null, 2)));
|
|
9147
9156
|
}
|
|
9157
|
+
})();
|
|
9158
|
+
try {
|
|
9159
|
+
await configState.loadPromise;
|
|
9160
|
+
} finally {
|
|
9161
|
+
configState.loadPromise = void 0;
|
|
9148
9162
|
}
|
|
9149
|
-
|
|
9163
|
+
}
|
|
9164
|
+
const loadConfig = async (params) => {
|
|
9165
|
+
await ensureRootConfigLoaded();
|
|
9166
|
+
return deepMerge$1(configState.config ?? {}, params ?? {});
|
|
9150
9167
|
};
|
|
9151
9168
|
//#endregion
|
|
9152
9169
|
//#region ../../node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js
|
|
@@ -12929,6 +12946,65 @@ function buildMonolithEntries(config) {
|
|
|
12929
12946
|
return entries;
|
|
12930
12947
|
}
|
|
12931
12948
|
//#endregion
|
|
12949
|
+
//#region src/actions/package/compile/monolithCopyEntries.ts
|
|
12950
|
+
const copyPlatforms = /* @__PURE__ */ new Set([
|
|
12951
|
+
"browser",
|
|
12952
|
+
"neutral",
|
|
12953
|
+
"node"
|
|
12954
|
+
]);
|
|
12955
|
+
function isPathInside(parent, candidate) {
|
|
12956
|
+
const relative = PATH.relative(parent, candidate);
|
|
12957
|
+
return relative.length > 0 && relative !== ".." && !relative.startsWith(`..${PATH.sep}`) && !PATH.isAbsolute(relative);
|
|
12958
|
+
}
|
|
12959
|
+
/** Resolves configured copy destinations without requiring their sources to exist. */
|
|
12960
|
+
function listMonolithCopyEntries(packageDir, config) {
|
|
12961
|
+
const distDir = PATH.resolve(packageDir, "dist");
|
|
12962
|
+
const entries = [];
|
|
12963
|
+
const configuredCopyEntries = Object.entries(config.copyEntries ?? {});
|
|
12964
|
+
for (const [platformName, configuredEntries] of configuredCopyEntries) {
|
|
12965
|
+
if (!copyPlatforms.has(platformName)) throw new Error(`Unsupported monolith copy entry platform "${platformName}"`);
|
|
12966
|
+
const platform = platformName;
|
|
12967
|
+
const platformDir = PATH.join(distDir, platform);
|
|
12968
|
+
for (const [output, source] of Object.entries(configuredEntries)) {
|
|
12969
|
+
if (output.length === 0) throw new Error(`Monolith copy entry for ${platform} has an empty output path`);
|
|
12970
|
+
if (source.length === 0) throw new Error(`Monolith copy entry "${output}" has an empty source`);
|
|
12971
|
+
if (PATH.isAbsolute(output)) throw new Error(`Monolith copy entry output must be relative: "${output}"`);
|
|
12972
|
+
const destination = PATH.resolve(platformDir, output);
|
|
12973
|
+
if (!isPathInside(platformDir, destination)) throw new Error(`Monolith copy entry output escapes dist/${platform}: "${output}"`);
|
|
12974
|
+
const normalizedOutput = PATH.relative(platformDir, destination).split(PATH.sep).join("/");
|
|
12975
|
+
entries.push({
|
|
12976
|
+
destination,
|
|
12977
|
+
output: normalizedOutput,
|
|
12978
|
+
platform,
|
|
12979
|
+
source,
|
|
12980
|
+
subpath: `./${normalizedOutput}`
|
|
12981
|
+
});
|
|
12982
|
+
}
|
|
12983
|
+
}
|
|
12984
|
+
return entries;
|
|
12985
|
+
}
|
|
12986
|
+
function resolveCopySource(packageDir, source) {
|
|
12987
|
+
let resolved;
|
|
12988
|
+
try {
|
|
12989
|
+
resolved = PATH.isAbsolute(source) || source.startsWith(".") ? PATH.resolve(packageDir, source) : createRequire(PATH.join(packageDir, "package.json")).resolve(source);
|
|
12990
|
+
} catch (reason) {
|
|
12991
|
+
const detail = reason instanceof Error ? reason.message : String(reason);
|
|
12992
|
+
throw new Error(`Unable to resolve monolith copy entry source "${source}": ${detail}`, { cause: reason });
|
|
12993
|
+
}
|
|
12994
|
+
if (!fs.existsSync(resolved) || !fs.statSync(resolved).isFile()) throw new Error(`Monolith copy entry source is not a file: "${source}" (${resolved})`);
|
|
12995
|
+
return resolved;
|
|
12996
|
+
}
|
|
12997
|
+
/** Copies configured opaque entries into their exact dist destinations. */
|
|
12998
|
+
function copyMonolithEntries(packageDir, config) {
|
|
12999
|
+
const entries = listMonolithCopyEntries(packageDir, config);
|
|
13000
|
+
for (const entry of entries) {
|
|
13001
|
+
const source = resolveCopySource(packageDir, entry.source);
|
|
13002
|
+
fs.mkdirSync(PATH.dirname(entry.destination), { recursive: true });
|
|
13003
|
+
fs.copyFileSync(source, entry.destination);
|
|
13004
|
+
}
|
|
13005
|
+
return entries.length;
|
|
13006
|
+
}
|
|
13007
|
+
//#endregion
|
|
12932
13008
|
//#region src/actions/package/compile/packageCompileMonolith.ts
|
|
12933
13009
|
function assertNoManualEntries(compile) {
|
|
12934
13010
|
if (compile.entryMode !== void 0) throw new Error("monolith mode computes entries; remove compile.entryMode");
|
|
@@ -13021,6 +13097,8 @@ const packageCompileMonolith = async (config, mode = {}) => {
|
|
|
13021
13097
|
if (isVerbose && flattened > 0) console.log(chalk.gray(`monolith pure reexport flatten: ${flattened} files`));
|
|
13022
13098
|
const rewritten = fixMonolithDeclarations(distDir, monolith);
|
|
13023
13099
|
if (isVerbose) console.log(chalk.gray(`monolith declaration fixups: ${rewritten} files`));
|
|
13100
|
+
const copied = copyMonolithEntries(packageDir, monolith);
|
|
13101
|
+
if (isVerbose && copied > 0) console.log(chalk.gray(`monolith copied entries: ${copied} files`));
|
|
13024
13102
|
const specifierProblems = verifyMonolithRuntimeSpecifiers(distDir, monolith);
|
|
13025
13103
|
if (specifierProblems.length > 0) {
|
|
13026
13104
|
for (const problem of specifierProblems) console.error(chalk.red(problem));
|