@emeryld/rrroutes-export 1.0.14 → 1.0.16
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/defaultViewerTemplate.d.ts +1 -1
- package/dist/exportFinalizedLeaves.changelog.d.ts +1 -4
- package/dist/index.cjs +16 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +16 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/tools/finalized-leaves-viewer.html +266 -53
package/dist/index.mjs
CHANGED
|
@@ -365,7 +365,7 @@ var DEFAULT_VIEWER_TEMPLATE = `<!doctype html>
|
|
|
365
365
|
<head>
|
|
366
366
|
<meta charset="UTF-8" />
|
|
367
367
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
368
|
-
<title>
|
|
368
|
+
<title>RRRoutes Export Viewer</title>
|
|
369
369
|
<style>
|
|
370
370
|
:root {
|
|
371
371
|
--bg: #212121;
|
|
@@ -394,7 +394,7 @@ var DEFAULT_VIEWER_TEMPLATE = `<!doctype html>
|
|
|
394
394
|
</head>
|
|
395
395
|
<body>
|
|
396
396
|
<div class="wrap">
|
|
397
|
-
<h1>
|
|
397
|
+
<h1>RRRoutes Export Viewer (Baked)</h1>
|
|
398
398
|
<div class="card">
|
|
399
399
|
<div id="status" class="meta">Waiting for baked payload...</div>
|
|
400
400
|
</div>
|
|
@@ -429,7 +429,7 @@ var DEFAULT_VIEWER_TEMPLATE = `<!doctype html>
|
|
|
429
429
|
wrapSection('By Source Object', payload.bySourceObject || {}),
|
|
430
430
|
)
|
|
431
431
|
} else if (!payload || !Array.isArray(payload.leaves)) {
|
|
432
|
-
statusEl.textContent = 'No baked payload found in this HTML file.'
|
|
432
|
+
statusEl.textContent = 'No baked leaves/changelog/bundle payload found in this HTML file.'
|
|
433
433
|
} else {
|
|
434
434
|
statusEl.textContent = 'Loaded baked payload with ' + payload.leaves.length + ' routes.'
|
|
435
435
|
|
|
@@ -1358,6 +1358,7 @@ var CHANGESET_CFG_FIELDS = [
|
|
|
1358
1358
|
];
|
|
1359
1359
|
var SCHEMA_SECTIONS = ["params", "query", "body", "output"];
|
|
1360
1360
|
var MODULE_EXTENSIONS = [".ts", ".tsx", ".mts", ".cts", ".js", ".mjs", ".cjs"];
|
|
1361
|
+
var COMPILE_CACHE_VERSION = "v2";
|
|
1361
1362
|
var SOURCE_KEY_BY_SECTION = {
|
|
1362
1363
|
params: "paramsSchema",
|
|
1363
1364
|
query: "querySchema",
|
|
@@ -1939,8 +1940,8 @@ function toEmittedModulePath(moduleRel) {
|
|
|
1939
1940
|
if (normalized.endsWith(".ts")) return normalized.slice(0, -3) + ".js";
|
|
1940
1941
|
return normalized;
|
|
1941
1942
|
}
|
|
1942
|
-
function buildCompileCacheKey(commitSha, moduleRel,
|
|
1943
|
-
return crypto.createHash("sha1").update(
|
|
1943
|
+
function buildCompileCacheKey(commitSha, moduleRel, tsconfigKeyPath) {
|
|
1944
|
+
return crypto.createHash("sha1").update(COMPILE_CACHE_VERSION).update("\n").update(commitSha).update("\n").update(normalizePath(moduleRel)).update("\n").update(normalizePath(tsconfigKeyPath)).digest("hex");
|
|
1944
1945
|
}
|
|
1945
1946
|
async function collectFilesRecursive(rootDir) {
|
|
1946
1947
|
const files = [];
|
|
@@ -1995,16 +1996,18 @@ async function resolveEmittedEntryPath(emitRoot, moduleRel) {
|
|
|
1995
1996
|
}
|
|
1996
1997
|
async function compileSnapshotEntry(options) {
|
|
1997
1998
|
const log = options.log ?? (() => void 0);
|
|
1998
|
-
const
|
|
1999
|
+
const relativeTsconfigPath = normalizePath(
|
|
2000
|
+
path4.relative(options.worktreeDir, options.tsconfigPath)
|
|
2001
|
+
);
|
|
2002
|
+
const tsconfigKeyPath = relativeTsconfigPath.startsWith("..") || path4.isAbsolute(relativeTsconfigPath) ? normalizePath(options.tsconfigPath) : relativeTsconfigPath;
|
|
1999
2003
|
const cacheKey = buildCompileCacheKey(
|
|
2000
2004
|
options.commitSha,
|
|
2001
2005
|
options.moduleRel,
|
|
2002
|
-
|
|
2003
|
-
{ mtimeMs: tsconfigStat.mtimeMs, size: tsconfigStat.size }
|
|
2006
|
+
tsconfigKeyPath
|
|
2004
2007
|
);
|
|
2005
2008
|
const emitRoot = path4.join(options.cacheRoot, cacheKey, "dist");
|
|
2006
|
-
let emittedEntry =
|
|
2007
|
-
if (!options.noCache && await pathExists(emittedEntry)) {
|
|
2009
|
+
let emittedEntry = await resolveEmittedEntryPath(emitRoot, options.moduleRel);
|
|
2010
|
+
if (!options.noCache && emittedEntry && await pathExists(emittedEntry)) {
|
|
2008
2011
|
log(`[changelog] compile cache hit: ${options.commitSha.slice(0, 12)}`);
|
|
2009
2012
|
return emittedEntry;
|
|
2010
2013
|
}
|
|
@@ -2052,10 +2055,10 @@ async function compileSnapshotEntry(options) {
|
|
|
2052
2055
|
${message}`
|
|
2053
2056
|
);
|
|
2054
2057
|
}
|
|
2055
|
-
emittedEntry = await resolveEmittedEntryPath(emitRoot, options.moduleRel)
|
|
2056
|
-
if (!await pathExists(emittedEntry)) {
|
|
2058
|
+
emittedEntry = await resolveEmittedEntryPath(emitRoot, options.moduleRel);
|
|
2059
|
+
if (!emittedEntry || !await pathExists(emittedEntry)) {
|
|
2057
2060
|
throw new Error(
|
|
2058
|
-
`Compiled snapshot entry was not emitted
|
|
2061
|
+
`Compiled snapshot entry was not emitted for ${options.moduleRel} under ${emitRoot}. Check module/tsconfig compatibility.`
|
|
2059
2062
|
);
|
|
2060
2063
|
}
|
|
2061
2064
|
log(`[changelog] compiled snapshot entry: ${emittedEntry}`);
|