@luutuankiet/gsd-reader 0.2.24 → 0.2.25
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/cli.cjs +4 -3
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -173,7 +173,8 @@ async function commandDump() {
|
|
|
173
173
|
const worklogBase64 = Buffer.from(worklogContent, 'utf-8').toString('base64');
|
|
174
174
|
const projectBase64 = Buffer.from(projectContent, 'utf-8').toString('base64');
|
|
175
175
|
const architectureBase64 = Buffer.from(architectureContent, 'utf-8').toString('base64');
|
|
176
|
-
|
|
176
|
+
// Absolute path from origin machine — persists when static dump is served remotely
|
|
177
|
+
const dumpBasePath = path.dirname(resolvedWorklog);
|
|
177
178
|
const injectScript = `<script>window.__WORKLOG_CONTENT_B64__ = "${worklogBase64}";window.__PROJECT_CONTENT_B64__ = "${projectBase64}";window.__ARCHITECTURE_CONTENT_B64__ = "${architectureBase64}";window.__GSD_BASE_PATH__ = "${dumpBasePath}";</script>`;
|
|
178
179
|
indexHtml = indexHtml.replace('</head>', `${injectScript}\n</head>`);
|
|
179
180
|
fs.writeFileSync(indexPath, indexHtml);
|
|
@@ -337,8 +338,8 @@ function commandServe() {
|
|
|
337
338
|
const WORKLOG = positionalArgs[0] || './gsd-lite/WORK.md';
|
|
338
339
|
const WORKLOG_PATH = path.resolve(WORKLOG);
|
|
339
340
|
const ARTIFACT_DIR = path.dirname(WORKLOG_PATH);
|
|
340
|
-
//
|
|
341
|
-
const BASE_PATH = path.dirname(
|
|
341
|
+
// Absolute path to gsd-lite directory on the origin machine
|
|
342
|
+
const BASE_PATH = path.dirname(WORKLOG_PATH);
|
|
342
343
|
const PROJECT_PATH = path.join(ARTIFACT_DIR, 'PROJECT.md');
|
|
343
344
|
const ARCHITECTURE_PATH = path.join(ARTIFACT_DIR, 'ARCHITECTURE.md');
|
|
344
345
|
|