@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.
Files changed (2) hide show
  1. package/cli.cjs +4 -3
  2. 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
- const dumpBasePath = path.dirname(path.relative(process.cwd(), resolvedWorklog));
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
- // Base path relative to CWD where the server was launched
341
- const BASE_PATH = path.dirname(path.relative(process.cwd(), WORKLOG_PATH));
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luutuankiet/gsd-reader",
3
- "version": "0.2.24",
3
+ "version": "0.2.25",
4
4
  "description": "Interactive Worklog Reader for GSD-Lite WORK.md files with live reload",
5
5
  "keywords": [
6
6
  "gsd-lite",