@emeryld/rrroutes-export 1.0.15 → 1.0.17
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/exportFinalizedLeaves.changelog.d.ts +1 -4
- package/dist/index.cjs +13 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +13 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/tools/finalized-leaves-viewer.html +179 -30
|
@@ -141,10 +141,7 @@ declare function toRouteSnapshots(payload: FinalizedLeavesExport): Record<string
|
|
|
141
141
|
declare function toSourceObjectSnapshots(routesByKey: Record<string, RouteSnapshot>): Record<string, SourceObjectSnapshot>;
|
|
142
142
|
declare function resolveSnapshotTsconfig(worktreeDir: string, modulePath: string, tsconfigOverride?: string): Promise<string>;
|
|
143
143
|
declare function toEmittedModulePath(moduleRel: string): string;
|
|
144
|
-
declare function buildCompileCacheKey(commitSha: string, moduleRel: string,
|
|
145
|
-
mtimeMs: number;
|
|
146
|
-
size: number;
|
|
147
|
-
}): string;
|
|
144
|
+
declare function buildCompileCacheKey(commitSha: string, moduleRel: string, tsconfigKeyPath: string): string;
|
|
148
145
|
declare function compileSnapshotEntry(options: {
|
|
149
146
|
worktreeDir: string;
|
|
150
147
|
moduleRel: string;
|
package/dist/index.cjs
CHANGED
|
@@ -1414,6 +1414,7 @@ var CHANGESET_CFG_FIELDS = [
|
|
|
1414
1414
|
];
|
|
1415
1415
|
var SCHEMA_SECTIONS = ["params", "query", "body", "output"];
|
|
1416
1416
|
var MODULE_EXTENSIONS = [".ts", ".tsx", ".mts", ".cts", ".js", ".mjs", ".cjs"];
|
|
1417
|
+
var COMPILE_CACHE_VERSION = "v2";
|
|
1417
1418
|
var SOURCE_KEY_BY_SECTION = {
|
|
1418
1419
|
params: "paramsSchema",
|
|
1419
1420
|
query: "querySchema",
|
|
@@ -1995,8 +1996,8 @@ function toEmittedModulePath(moduleRel) {
|
|
|
1995
1996
|
if (normalized.endsWith(".ts")) return normalized.slice(0, -3) + ".js";
|
|
1996
1997
|
return normalized;
|
|
1997
1998
|
}
|
|
1998
|
-
function buildCompileCacheKey(commitSha, moduleRel,
|
|
1999
|
-
return import_node_crypto.default.createHash("sha1").update(
|
|
1999
|
+
function buildCompileCacheKey(commitSha, moduleRel, tsconfigKeyPath) {
|
|
2000
|
+
return import_node_crypto.default.createHash("sha1").update(COMPILE_CACHE_VERSION).update("\n").update(commitSha).update("\n").update(normalizePath(moduleRel)).update("\n").update(normalizePath(tsconfigKeyPath)).digest("hex");
|
|
2000
2001
|
}
|
|
2001
2002
|
async function collectFilesRecursive(rootDir) {
|
|
2002
2003
|
const files = [];
|
|
@@ -2051,16 +2052,18 @@ async function resolveEmittedEntryPath(emitRoot, moduleRel) {
|
|
|
2051
2052
|
}
|
|
2052
2053
|
async function compileSnapshotEntry(options) {
|
|
2053
2054
|
const log = options.log ?? (() => void 0);
|
|
2054
|
-
const
|
|
2055
|
+
const relativeTsconfigPath = normalizePath(
|
|
2056
|
+
import_node_path4.default.relative(options.worktreeDir, options.tsconfigPath)
|
|
2057
|
+
);
|
|
2058
|
+
const tsconfigKeyPath = relativeTsconfigPath.startsWith("..") || import_node_path4.default.isAbsolute(relativeTsconfigPath) ? normalizePath(options.tsconfigPath) : relativeTsconfigPath;
|
|
2055
2059
|
const cacheKey = buildCompileCacheKey(
|
|
2056
2060
|
options.commitSha,
|
|
2057
2061
|
options.moduleRel,
|
|
2058
|
-
|
|
2059
|
-
{ mtimeMs: tsconfigStat.mtimeMs, size: tsconfigStat.size }
|
|
2062
|
+
tsconfigKeyPath
|
|
2060
2063
|
);
|
|
2061
2064
|
const emitRoot = import_node_path4.default.join(options.cacheRoot, cacheKey, "dist");
|
|
2062
|
-
let emittedEntry =
|
|
2063
|
-
if (!options.noCache && await pathExists(emittedEntry)) {
|
|
2065
|
+
let emittedEntry = await resolveEmittedEntryPath(emitRoot, options.moduleRel);
|
|
2066
|
+
if (!options.noCache && emittedEntry && await pathExists(emittedEntry)) {
|
|
2064
2067
|
log(`[changelog] compile cache hit: ${options.commitSha.slice(0, 12)}`);
|
|
2065
2068
|
return emittedEntry;
|
|
2066
2069
|
}
|
|
@@ -2108,10 +2111,10 @@ async function compileSnapshotEntry(options) {
|
|
|
2108
2111
|
${message}`
|
|
2109
2112
|
);
|
|
2110
2113
|
}
|
|
2111
|
-
emittedEntry = await resolveEmittedEntryPath(emitRoot, options.moduleRel)
|
|
2112
|
-
if (!await pathExists(emittedEntry)) {
|
|
2114
|
+
emittedEntry = await resolveEmittedEntryPath(emitRoot, options.moduleRel);
|
|
2115
|
+
if (!emittedEntry || !await pathExists(emittedEntry)) {
|
|
2113
2116
|
throw new Error(
|
|
2114
|
-
`Compiled snapshot entry was not emitted
|
|
2117
|
+
`Compiled snapshot entry was not emitted for ${options.moduleRel} under ${emitRoot}. Check module/tsconfig compatibility.`
|
|
2115
2118
|
);
|
|
2116
2119
|
}
|
|
2117
2120
|
log(`[changelog] compiled snapshot entry: ${emittedEntry}`);
|