gutterpress 0.11.21 → 0.11.22-alpha.2

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 (62) hide show
  1. package/README.md +11 -0
  2. package/dist/api/index.d.ts +5 -1
  3. package/dist/api/index.js +68 -47
  4. package/dist/{build-0neyk5h6.js → build-84retk4k.js} +16 -10
  5. package/dist/{index-sth219v1.js → cli-2ppw6q9v.js} +26 -6
  6. package/dist/cli-3twpesca.js +103 -0
  7. package/dist/cli-5et23z83.js +2089 -0
  8. package/dist/{cli-j79451n6.js → cli-5qhjwne5.js} +5 -76
  9. package/dist/cli-80t93x2r.js +75 -0
  10. package/dist/{cli-j0drzb6f.js → cli-885pcze8.js} +885 -5481
  11. package/dist/{cli-b57adna7.js → cli-9pk65fqf.js} +9 -201
  12. package/dist/{cli-sqkccnm7.js → cli-d8xjns66.js} +1 -102
  13. package/dist/cli-h3phdstf.js +200 -0
  14. package/dist/{index-qf7y4d85.js → cli-habkc5ng.js} +12 -258
  15. package/dist/cli-hndkg7bn.js +196 -0
  16. package/dist/cli-pn3z0y9p.js +3073 -0
  17. package/dist/cli.js +15 -13
  18. package/dist/{doctor-fptq8tvn.js → doctor-fmzpg7ag.js} +7 -4
  19. package/dist/engine/shared/print-area.d.ts +77 -1
  20. package/dist/{engine-x07q927h.js → engine-5p8tn9b4.js} +4 -3
  21. package/dist/{engine-0b8bt05n.js → engine-9710cd7x.js} +3 -2
  22. package/dist/{ext-gp624t5c.js → ext-hsdnad5c.js} +21 -14
  23. package/dist/extension-restore-05pae3cp.js +16 -0
  24. package/dist/extension-restore-3r7phztr.js +20 -0
  25. package/dist/{gutterpress-viewer-w7njnkj7.js → gutterpress-viewer-w9jzx6sb.js} +56 -52
  26. package/dist/{index-t7r8g75c.js → index-2d8j0enc.js} +4 -2
  27. package/dist/{cli-sth219v1.js → index-2ppw6q9v.js} +26 -6
  28. package/dist/{index-mr7zs8mv.js → index-3wcr69ba.js} +5579 -10055
  29. package/dist/{cli-5qr3z0qa.js → index-93pqkvty.js} +63 -207
  30. package/dist/{index-mr72vt8n.js → index-apc8w9w8.js} +55 -267
  31. package/dist/index-ew7cyk7c.js +2208 -0
  32. package/dist/index-jsz0s3dy.js +213 -0
  33. package/dist/index-kx03e4m4.js +3244 -0
  34. package/dist/index-r7jcsk6h.js +200 -0
  35. package/dist/index.js +71 -50
  36. package/dist/lib/extension-manifest.d.ts +22 -1
  37. package/dist/lib/markdown/assemble.d.ts +3 -2
  38. package/dist/lib/markdown/plugins.d.ts +20 -0
  39. package/dist/lib/markdown/two-versions.d.ts +32 -0
  40. package/dist/lib/page-size.d.ts +3 -4
  41. package/dist/lib/pdf-inspect.d.ts +12 -0
  42. package/dist/lib/project-scaffold.d.ts +3 -3
  43. package/dist/lib/publish/plugin-provider.d.ts +16 -0
  44. package/dist/lib/publish/run-publish.d.ts +13 -5
  45. package/dist/lib/publish/types.d.ts +34 -2
  46. package/dist/lib/text-diff.d.ts +43 -0
  47. package/dist/lib/two-versions-markers.d.ts +26 -0
  48. package/dist/lib/version-changes.d.ts +87 -0
  49. package/dist/{manifest.schema-n292sb77.json → manifest.schema-nvawq0xv.json} +2 -2
  50. package/dist/{new-dre6aw05.js → new-fqtt022k.js} +23 -16
  51. package/dist/{pdf-inspect-zdmy7qca.js → pdf-inspect-wnw4za71.js} +1 -1
  52. package/dist/plugins-gfvsgnxb.js +24 -0
  53. package/dist/plugins-nfxr831f.js +26 -0
  54. package/dist/{preflight-1k1zkg1p.js → preflight-gr9mscjw.js} +18 -11
  55. package/dist/{preview-dtrksvxf.js → preview-52w9pdps.js} +19 -13
  56. package/dist/{publish-g1ytnrmr.js → publish-esmcyhpb.js} +40 -23
  57. package/dist/render.js +706 -0
  58. package/dist/schema/manifest.types.d.ts +8 -3
  59. package/dist/{source-provider-pzmz0br9.js → source-provider-2r74a7wp.js} +2 -1
  60. package/dist/{source-provider-qbthnmqw.js → source-provider-qbfknhyy.js} +2 -1
  61. package/dist/{validate-yrrq8639.js → validate-vt1d7h6k.js} +16 -10
  62. package/package.json +1 -1
@@ -2,7 +2,11 @@ import {
2
2
  capabilitiesFor,
3
3
  detectProjectSource,
4
4
  findEnclosingRepoDir
5
- } from "./index-v5mp7a6q.js";
5
+ } from "./cli-v5mp7a6q.js";
6
+ import {
7
+ PLUGINS_DIR,
8
+ VENDORED_NPM_DIR
9
+ } from "./cli-h3phdstf.js";
6
10
 
7
11
  // src/lib/git-fs.ts
8
12
  import * as nodeFs from "node:fs";
@@ -82,7 +86,7 @@ var gitFs = {
82
86
  };
83
87
 
84
88
  // src/lib/source-provider.ts
85
- import path3 from "node:path";
89
+ import path2 from "node:path";
86
90
  import git from "isomorphic-git";
87
91
 
88
92
  // src/lib/remote-auth/operation-log.ts
@@ -99,52 +103,6 @@ function sanitizeLogText(value, secrets = []) {
99
103
  }
100
104
  return text.replace(/\/\/[^/\s]*@/g, "//").replace(/([?&](?:access_token|token|password|secret|key|code)=)[^&#\s]*/gi, "$1[redacted]").replace(/\b(Bearer|Basic)\s+[A-Za-z0-9+/_.=~-]+/gi, "$1 [redacted]").replace(/\b(?:gh[pousr]_[A-Za-z0-9_]+|github_pat_[A-Za-z0-9_]+)/g, "[redacted]").replace(/[\s\x00-\x1f\x7f]+/g, " ").trim().slice(0, 6000);
101
105
  }
102
- function errorLogData(error) {
103
- const out = { error: error == null ? String(error) : undefined };
104
- let current = error;
105
- const seen = new Set;
106
- for (let depth = 0;depth < 3 && current != null && !seen.has(current); depth++) {
107
- seen.add(current);
108
- const prefix = depth === 0 ? "" : `cause${depth}_`;
109
- if (typeof current !== "object") {
110
- out[`${prefix}error`] = String(current);
111
- break;
112
- }
113
- const err = current;
114
- out[`${prefix}error`] = typeof err.message === "string" ? err.message : "Unknown error";
115
- for (const key of ["code", "name", "caller", "stack", "syscall", "path"]) {
116
- if (typeof err[key] === "string")
117
- out[`${prefix}${key}`] = err[key];
118
- }
119
- const data = err.data;
120
- if (data && typeof data === "object") {
121
- for (const key of [
122
- "statusCode",
123
- "reason",
124
- "prettyDetails",
125
- "oid",
126
- "ref",
127
- "what",
128
- "filepath",
129
- "filepaths",
130
- "bothModified",
131
- "deleteByUs",
132
- "deleteByTheirs"
133
- ]) {
134
- const value = data[key];
135
- if (typeof value === "string" || typeof value === "number")
136
- out[`${prefix}${key}`] = value;
137
- else if (Array.isArray(value)) {
138
- out[`${prefix}${key}`] = value.filter((v) => typeof v === "string").slice(0, 50);
139
- if (value.length > 50)
140
- out[`${prefix}${key}Count`] = value.length;
141
- }
142
- }
143
- }
144
- current = err.cause;
145
- }
146
- return out;
147
- }
148
106
  var noop = {
149
107
  debug: () => {},
150
108
  info: () => {},
@@ -177,11 +135,6 @@ function createFileLogger(logFile, operation, minLevel = "debug", options = {})
177
135
  error: (step, message, data) => write("error", step, message, data)
178
136
  };
179
137
  }
180
- function resolveLogger(logFile, operation, options = {}) {
181
- if (!logFile)
182
- return noop;
183
- return createFileLogger(logFile, operation, "debug", options);
184
- }
185
138
  function formatData(data, clean) {
186
139
  if (!data)
187
140
  return "";
@@ -198,205 +151,6 @@ function formatData(data, clean) {
198
151
  return parts.length > 0 ? " " + parts.join(" ") : "";
199
152
  }
200
153
 
201
- // src/lib/plugin-vendor.ts
202
- import { lstat, readFile, realpath } from "node:fs/promises";
203
- import path2 from "node:path";
204
- import { exports as resolveExports } from "resolve.exports";
205
- var PLUGINS_DIR = "plugins";
206
- var VENDORED_NPM_DIR = "npm";
207
- var NPM_SEGMENT = /^[a-z0-9][a-z0-9._~-]*$/;
208
- var EXACT_VERSION = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
209
- var WINDOWS_RESERVED = /^(con|prn|aux|nul|clock\$|conin\$|conout\$|com[1-9¹²³]|lpt[1-9¹²³])(?:\..*)?$/i;
210
- function isValidNpmPackageName(name) {
211
- if (!name || name.length > 214 || name !== name.toLowerCase())
212
- return false;
213
- if (name.startsWith("@")) {
214
- const parts = name.slice(1).split("/");
215
- return parts.length === 2 && parts.every((part) => NPM_SEGMENT.test(part));
216
- }
217
- return !name.includes("/") && NPM_SEGMENT.test(name);
218
- }
219
- function parseNpmPluginSpec(input) {
220
- const spec = input.trim();
221
- if (!spec)
222
- throw new Error("An npm package name is required.");
223
- let name = spec;
224
- let selector;
225
- if (spec.startsWith("@")) {
226
- const slash = spec.indexOf("/");
227
- const versionAt = spec.lastIndexOf("@");
228
- if (slash > 1 && versionAt > slash) {
229
- name = spec.slice(0, versionAt);
230
- selector = spec.slice(versionAt + 1);
231
- }
232
- } else {
233
- const versionAt = spec.lastIndexOf("@");
234
- if (versionAt > 0) {
235
- name = spec.slice(0, versionAt);
236
- selector = spec.slice(versionAt + 1);
237
- }
238
- }
239
- if (!isValidNpmPackageName(name)) {
240
- throw new Error(`"${name}" is not a valid npm package name. Use a name like ` + "markdown-it-highlightjs or @scope/markdown-it-plugin.");
241
- }
242
- if (selector !== undefined && !selector) {
243
- throw new Error(`The package spec "${spec}" is missing a selector after @.`);
244
- }
245
- return selector === undefined ? { name } : { name, selector };
246
- }
247
- function isExactNpmVersion(version) {
248
- return EXACT_VERSION.test(version);
249
- }
250
- function encodePathPart(value) {
251
- return encodeURIComponent(value).replace(/[!'()*]/g, (char) => `%${char.charCodeAt(0).toString(16).toUpperCase()}`);
252
- }
253
- function vendoredNpmPluginRoot(projectDir, name, version) {
254
- return path2.join(projectDir, PLUGINS_DIR, VENDORED_NPM_DIR, encodePathPart(name), encodePathPart(version));
255
- }
256
- function vendoredNpmPluginPackageDir(installRoot, name) {
257
- return path2.join(installRoot, "node_modules", ...name.split("/"));
258
- }
259
- function toPosixPath(value) {
260
- return value.split(path2.sep).join("/");
261
- }
262
- function assertWindowsSafeRelativePath(relative) {
263
- if (!relative || relative.includes("\\") || relative.startsWith("/") || /^[a-zA-Z]:/.test(relative)) {
264
- throw new Error(`Unsafe package path: ${relative || "(empty)"}`);
265
- }
266
- const normalized = relative.normalize("NFKC");
267
- const parts = normalized.split("/");
268
- if (parts.some((part) => !part || part === "." || part === "..")) {
269
- throw new Error(`Unsafe package path: ${relative}`);
270
- }
271
- for (const part of parts) {
272
- if (part.length > 255 || /[\u0000-\u001f<>:"|?*]/.test(part) || part.endsWith(".") || part.endsWith(" ") || WINDOWS_RESERVED.test(part)) {
273
- throw new Error(`Package path is invalid on Windows: ${relative}`);
274
- }
275
- }
276
- }
277
- function windowsPathKey(relative) {
278
- return relative.normalize("NFKC").toLowerCase();
279
- }
280
- function isContained(root, candidate) {
281
- const relative = path2.relative(root, candidate);
282
- return relative === "" || !relative.startsWith("..") && !path2.isAbsolute(relative);
283
- }
284
- function object(value) {
285
- return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
286
- }
287
- async function readPackageJson(packageDir) {
288
- const packageJsonPath = path2.join(packageDir, "package.json");
289
- const info = await lstat(packageJsonPath);
290
- if (!info.isFile() || info.isSymbolicLink()) {
291
- throw new Error(`Package metadata is not a regular file: ${packageJsonPath}`);
292
- }
293
- const parsed = object(JSON.parse(await readFile(packageJsonPath, "utf8")));
294
- if (!parsed)
295
- throw new Error(`Package metadata is not an object: ${packageJsonPath}`);
296
- return parsed;
297
- }
298
- function packageResolutionTargets(manifest, subpath, condition) {
299
- if (manifest.exports !== undefined) {
300
- try {
301
- const targets2 = resolveExports(manifest, subpath ? `./${subpath}` : ".", { require: condition === "require" }) ?? [];
302
- return targets2.map((target) => ({ target, exact: true }));
303
- } catch {
304
- return [];
305
- }
306
- }
307
- if (subpath)
308
- return [{ target: subpath, exact: false }];
309
- const targets = [
310
- ...condition === "import" && typeof manifest.module === "string" ? [manifest.module] : [],
311
- ...typeof manifest.main === "string" ? [manifest.main] : [],
312
- "index.mjs",
313
- "index.js",
314
- "index.cjs"
315
- ];
316
- return [...new Set(targets)].map((target) => ({ target, exact: false }));
317
- }
318
- function safePackageTarget(target) {
319
- if (!target || target.includes("\\") || target.includes("*") || target.includes("?") || target.includes("#")) {
320
- return null;
321
- }
322
- const relative = target.startsWith("./") ? target.slice(2) : target;
323
- if (!relative || path2.isAbsolute(relative))
324
- return null;
325
- assertWindowsSafeRelativePath(relative);
326
- if (relative.normalize("NFKC").split("/").some((part) => part.toLowerCase() === "node_modules")) {
327
- return null;
328
- }
329
- return relative;
330
- }
331
- async function resolveEntryCandidate(packageDir, resolution) {
332
- const relative = safePackageTarget(resolution.target);
333
- if (!relative)
334
- return null;
335
- const base = path2.resolve(packageDir, ...relative.split("/"));
336
- if (!isContained(packageDir, base))
337
- return null;
338
- const candidates = resolution.exact ? [base] : [
339
- base,
340
- `${base}.mjs`,
341
- `${base}.js`,
342
- `${base}.cjs`,
343
- `${base}.json`,
344
- path2.join(base, "index.mjs"),
345
- path2.join(base, "index.js"),
346
- path2.join(base, "index.cjs"),
347
- path2.join(base, "index.json")
348
- ];
349
- for (const candidate of candidates) {
350
- try {
351
- const info = await lstat(candidate);
352
- if (!info.isFile() || info.isSymbolicLink())
353
- continue;
354
- const extension = path2.extname(candidate);
355
- if (extension && ![".js", ".mjs", ".cjs", ".json"].includes(extension))
356
- continue;
357
- const [realRoot, realCandidate] = await Promise.all([realpath(packageDir), realpath(candidate)]);
358
- if (!isContained(realRoot, realCandidate))
359
- continue;
360
- return toPosixPath(path2.relative(packageDir, realCandidate));
361
- } catch {}
362
- }
363
- return null;
364
- }
365
- async function resolvePackageEntry(packageDir, packageJson) {
366
- const manifest = packageJson ?? await readPackageJson(packageDir);
367
- for (const condition of ["import", "require"]) {
368
- for (const target of packageResolutionTargets(manifest, "", condition)) {
369
- const resolved = await resolveEntryCandidate(packageDir, target);
370
- if (resolved)
371
- return resolved;
372
- }
373
- }
374
- throw new Error("Package has no contained JavaScript entry point.");
375
- }
376
- async function resolveVendoredPluginInstallRoot(projectDir, expectedName, expectedVersion) {
377
- const requestedProjectRoot = path2.resolve(projectDir);
378
- const requestedInstallRoot = vendoredNpmPluginRoot(requestedProjectRoot, expectedName, expectedVersion);
379
- let installInfo;
380
- try {
381
- installInfo = await lstat(requestedInstallRoot);
382
- } catch (error) {
383
- if (error.code === "ENOENT")
384
- return null;
385
- throw error;
386
- }
387
- if (!installInfo.isDirectory() || installInfo.isSymbolicLink()) {
388
- throw new Error("Vendor install root is not a normal directory.");
389
- }
390
- const [realProjectRoot, installRoot] = await Promise.all([
391
- realpath(requestedProjectRoot),
392
- realpath(requestedInstallRoot)
393
- ]);
394
- if (!isContained(realProjectRoot, installRoot)) {
395
- throw new Error("Vendor install root resolves outside the book folder.");
396
- }
397
- return installRoot;
398
- }
399
-
400
154
  // src/lib/source-provider.ts
401
155
  var noopLogger = {
402
156
  debug: () => {},
@@ -414,7 +168,7 @@ var DEFAULT_BRANCH = "main";
414
168
  var SNAPSHOT_STAGING_MARKER = "gutterpress-snapshot-staging";
415
169
  var repoQueues = new Map;
416
170
  function repoLockKey(projectDir) {
417
- const resolved = path3.resolve(projectDir);
171
+ const resolved = path2.resolve(projectDir);
418
172
  try {
419
173
  return gitFs.realpathSync(resolved);
420
174
  } catch {
@@ -504,7 +258,7 @@ async function listWorkdirChanges(dir, cache = {}) {
504
258
  if (workdirOid !== stageOid) {
505
259
  adds.push(filepath);
506
260
  } else {
507
- const fileBytes = await gitFs.promises.readFile(path3.join(dir, filepath));
261
+ const fileBytes = await gitFs.promises.readFile(path2.join(dir, filepath));
508
262
  const { oid: actualOid } = await git.hashBlob({ object: fileBytes });
509
263
  if (actualOid !== stageOid)
510
264
  adds.push(filepath);
@@ -775,10 +529,10 @@ function providerFor(source) {
775
529
  }
776
530
  }
777
531
  function gitDirFor(projectDir) {
778
- return path3.join(projectDir, ".git");
532
+ return path2.join(projectDir, ".git");
779
533
  }
780
534
  function snapshotStagingMarkerPath(projectDir) {
781
- return path3.join(gitDirFor(projectDir), SNAPSHOT_STAGING_MARKER);
535
+ return path2.join(gitDirFor(projectDir), SNAPSHOT_STAGING_MARKER);
782
536
  }
783
537
  var RESTORE_BACKUP_MESSAGE = "Automatic backup before restoring an earlier version";
784
538
  var AUTO_SNAPSHOT_MESSAGE = "Automatic snapshot";
@@ -931,9 +685,9 @@ async function switchBranch(options) {
931
685
  const changedPaths = fromOid && fromOid !== toOid ? await diffCommitPaths(repoDir, fromOid, toOid, cache) : [];
932
686
  return {
933
687
  current: branch,
934
- changedFiles: changedPaths.map((p) => path3.join(repoDir, p))
688
+ changedFiles: changedPaths.map((p) => path2.join(repoDir, p))
935
689
  };
936
690
  });
937
691
  }
938
692
 
939
- export { PLUGINS_DIR, VENDORED_NPM_DIR, isValidNpmPackageName, parseNpmPluginSpec, isExactNpmVersion, vendoredNpmPluginRoot, vendoredNpmPluginPackageDir, toPosixPath, assertWindowsSafeRelativePath, windowsPathKey, packageResolutionTargets, safePackageTarget, resolvePackageEntry, resolveVendoredPluginInstallRoot, gitFs, errorLogData, resolveLogger, gitScopeFor, HISTORY_PAGE_LIMIT, withRepoLock, whenGitIdle, __repoLockQueueSizeForTests, resolveGitAuthor, listWorkdirChanges, stageChanges, hasPendingChanges, hasUncommittedChanges, snapshotWorkingTreeUnlocked, isNoChangesError, countUnversionedChanges, providerFor, gitDirFor, snapshotStagingMarkerPath, RESTORE_BACKUP_MESSAGE, AUTO_SNAPSHOT_MESSAGE, restoreVersionWithBackup, SWITCH_BRANCH_SNAPSHOT_MESSAGE, listLocalBranches, switchBranch };
693
+ export { gitScopeFor, HISTORY_PAGE_LIMIT, withRepoLock, whenGitIdle, __repoLockQueueSizeForTests, resolveGitAuthor, listWorkdirChanges, stageChanges, hasPendingChanges, hasUncommittedChanges, snapshotWorkingTreeUnlocked, isNoChangesError, countUnversionedChanges, providerFor, gitDirFor, snapshotStagingMarkerPath, RESTORE_BACKUP_MESSAGE, AUTO_SNAPSHOT_MESSAGE, restoreVersionWithBackup, SWITCH_BRANCH_SNAPSHOT_MESSAGE, listLocalBranches, switchBranch };
@@ -0,0 +1,196 @@
1
+ // src/lib/embedded-assets.ts
2
+ import { existsSync } from "node:fs";
3
+ import { mkdtemp, mkdir, writeFile, readFile } from "node:fs/promises";
4
+ import { tmpdir } from "node:os";
5
+ import { dirname, join, resolve } from "node:path";
6
+ import { fileURLToPath } from "node:url";
7
+
8
+ // src/assets/favicon.ico
9
+ var favicon_default = "./favicon-272ga6y0.ico";
10
+
11
+ // src/assets/manifest.schema.json
12
+ var manifest_schema_default = "./manifest.schema-nvawq0xv.json";
13
+
14
+ // src/assets/preview/scripts/preview-interface.js
15
+ var preview_interface_default = "./preview-interface-nnmrxyqm.js";
16
+
17
+ // src/assets/preview/scripts/preview-bridge.js
18
+ var preview_bridge_default = "./preview-bridge-8wjcjec3.js";
19
+
20
+ // src/assets/preview/scripts/preview-shell.js
21
+ var preview_shell_default = "./preview-shell-wk9k3gcd.js";
22
+
23
+ // profiles/CGATS21_CRPC1.icc
24
+ var CGATS21_CRPC1_default = "./CGATS21_CRPC1-g0e3k7kr.icc";
25
+
26
+ // src/assets/engine/gutterpress-viewer.js
27
+ var gutterpress_viewer_default = "./gutterpress-viewer-w9jzx6sb.js";
28
+
29
+ // src/assets/engine/gutterpress-agent.js
30
+ var gutterpress_agent_default = "./gutterpress-agent-d29ry3ak.js";
31
+
32
+ // src/assets/templates/book/manifest.yaml
33
+ var manifest_default = "./manifest-n1gh3qw5.yaml";
34
+
35
+ // src/assets/templates/book/chapter-01.md
36
+ var chapter_01_default = "./chapter-01-rkpyvjna.md";
37
+
38
+ // src/assets/templates/zine/manifest.yaml
39
+ var manifest_default2 = "./manifest-n1gh3qw5.yaml";
40
+
41
+ // src/assets/templates/zine/chapter-01.md
42
+ var chapter_01_default2 = "./chapter-01-7jwqg1ct.md";
43
+
44
+ // src/assets/templates/technical/manifest.yaml
45
+ var manifest_default3 = "./manifest-n1gh3qw5.yaml";
46
+
47
+ // src/assets/templates/technical/chapter-01.md
48
+ var chapter_01_default3 = "./chapter-01-6fn9pvd0.md";
49
+
50
+ // src/assets/extension-templates/plugin/package.json
51
+ var package_default = "./package-9rv69pxm.json";
52
+
53
+ // src/assets/extension-templates/plugin/README.md
54
+ var README_default = "./README-vsnsc1b3.md";
55
+
56
+ // src/assets/extension-templates/plugin/plugin.js.tpl
57
+ var plugin_js_default = "./plugin.js-cswq7wvd.tpl";
58
+
59
+ // src/assets/extension-templates/plugin/styles/plugin.css
60
+ var plugin_default = "./plugin-spbcem4j.css";
61
+
62
+ // src/assets/extension-templates/plugin/snippets/term-box.md
63
+ var term_box_default = "./term-box-4y0w7y32.md";
64
+
65
+ // src/assets/extension-templates/plugin/test/fixture.md
66
+ var fixture_default = "./fixture-2qnyqgb5.md";
67
+
68
+ // src/assets/extension-templates/plugin/test/expected.html
69
+ var expected_default = "./expected-ycmacem8.html";
70
+
71
+ // src/assets/extension-templates/plugin/test/plugin.test.js.tpl
72
+ var plugin_test_js_default = "./plugin.test.js-xgxrd8hf.tpl";
73
+
74
+ // src/assets/extension-templates/theme/package.json
75
+ var package_default2 = "./package-aenwjew3.json";
76
+
77
+ // src/assets/extension-templates/theme/README.md
78
+ var README_default2 = "./README-3nj919rm.md";
79
+
80
+ // src/assets/extension-templates/theme/components.yaml
81
+ var components_default = "./components-zzqdpt3m.yaml";
82
+
83
+ // src/assets/extension-templates/theme/snippets/callout.md
84
+ var callout_default = "./callout-hv56m16h.md";
85
+
86
+ // src/assets/extension-templates/theme/styles/tokens.css
87
+ var tokens_default = "./tokens-7984461t.css";
88
+
89
+ // src/assets/extension-templates/theme/styles/base.css
90
+ var base_default = "./base-ypqh9n7f.css";
91
+
92
+ // src/assets/extension-templates/theme/styles/components.css
93
+ var components_default2 = "./components-aam0fe2z.css";
94
+
95
+ // src/assets/extension-templates/theme/styles/page-templates.css
96
+ var page_templates_default = "./page-templates-tx9ryt19.css";
97
+
98
+ // src/assets/extension-templates/theme/styles/page-rules.css
99
+ var page_rules_default = "./page-rules-nsj3aw42.css";
100
+
101
+ // src/assets/extension-templates/theme/styles/book.css
102
+ var book_default = "./book-ted3tzrp.css";
103
+
104
+ // src/assets/themes/clean-book/theme.css
105
+ var theme_default = "./theme-j2bagrfx.css";
106
+
107
+ // src/assets/themes/clean-book/package.json
108
+ var package_default3 = "./package-97gm31sg.json";
109
+
110
+ // src/assets/themes/zine/theme.css
111
+ var theme_default2 = "./theme-h5recz6c.css";
112
+
113
+ // src/assets/themes/zine/package.json
114
+ var package_default4 = "./package-gag6ykwn.json";
115
+
116
+ // src/assets/themes/technical-doc/theme.css
117
+ var theme_default3 = "./theme-nn6d53zy.css";
118
+
119
+ // src/assets/themes/technical-doc/package.json
120
+ var package_default5 = "./package-nrhkwf2m.json";
121
+
122
+ // src/lib/embedded-assets.ts
123
+ var __libdir = dirname(fileURLToPath(import.meta.url));
124
+ var abs = (p) => resolve(__libdir, p);
125
+ var filePath = (v) => v;
126
+ var EMBEDDED_ASSETS = {
127
+ "favicon.ico": abs(favicon_default),
128
+ "manifest.schema.json": abs(filePath(manifest_schema_default)),
129
+ "preview/scripts/preview-interface.js": abs(filePath(preview_interface_default)),
130
+ "preview/scripts/preview-bridge.js": abs(filePath(preview_bridge_default)),
131
+ "preview/scripts/preview-shell.js": abs(filePath(preview_shell_default)),
132
+ "profiles/CGATS21_CRPC1.icc": abs(filePath(CGATS21_CRPC1_default)),
133
+ "engine/gutterpress-viewer.js": abs(filePath(gutterpress_viewer_default)),
134
+ "engine/gutterpress-agent.js": abs(filePath(gutterpress_agent_default)),
135
+ "templates/book/manifest.yaml": abs(filePath(manifest_default)),
136
+ "templates/book/chapter-01.md": abs(filePath(chapter_01_default)),
137
+ "templates/zine/manifest.yaml": abs(filePath(manifest_default2)),
138
+ "templates/zine/chapter-01.md": abs(filePath(chapter_01_default2)),
139
+ "templates/technical/manifest.yaml": abs(filePath(manifest_default3)),
140
+ "templates/technical/chapter-01.md": abs(filePath(chapter_01_default3)),
141
+ "extension-templates/plugin/package.json": abs(filePath(package_default)),
142
+ "extension-templates/plugin/README.md": abs(filePath(README_default)),
143
+ "extension-templates/plugin/plugin.js.tpl": abs(filePath(plugin_js_default)),
144
+ "extension-templates/plugin/styles/plugin.css": abs(filePath(plugin_default)),
145
+ "extension-templates/plugin/snippets/term-box.md": abs(filePath(term_box_default)),
146
+ "extension-templates/plugin/test/fixture.md": abs(filePath(fixture_default)),
147
+ "extension-templates/plugin/test/expected.html": abs(filePath(expected_default)),
148
+ "extension-templates/plugin/test/plugin.test.js.tpl": abs(filePath(plugin_test_js_default)),
149
+ "extension-templates/theme/package.json": abs(filePath(package_default2)),
150
+ "extension-templates/theme/README.md": abs(filePath(README_default2)),
151
+ "extension-templates/theme/components.yaml": abs(filePath(components_default)),
152
+ "extension-templates/theme/snippets/callout.md": abs(filePath(callout_default)),
153
+ "extension-templates/theme/styles/tokens.css": abs(filePath(tokens_default)),
154
+ "extension-templates/theme/styles/base.css": abs(filePath(base_default)),
155
+ "extension-templates/theme/styles/components.css": abs(filePath(components_default2)),
156
+ "extension-templates/theme/styles/page-templates.css": abs(filePath(page_templates_default)),
157
+ "extension-templates/theme/styles/page-rules.css": abs(filePath(page_rules_default)),
158
+ "extension-templates/theme/styles/book.css": abs(filePath(book_default)),
159
+ "themes/clean-book/theme.css": abs(filePath(theme_default)),
160
+ "themes/clean-book/package.json": abs(filePath(package_default3)),
161
+ "themes/zine/theme.css": abs(filePath(theme_default2)),
162
+ "themes/zine/package.json": abs(filePath(package_default4)),
163
+ "themes/technical-doc/theme.css": abs(filePath(theme_default3)),
164
+ "themes/technical-doc/package.json": abs(filePath(package_default5))
165
+ };
166
+ var extractPromise = null;
167
+ async function extractAssets() {
168
+ const root = await mkdtemp(join(tmpdir(), "gutterpress-assets-"));
169
+ for (const [relPath, srcPath] of Object.entries(EMBEDDED_ASSETS)) {
170
+ const dest = join(root, relPath);
171
+ await mkdir(dirname(dest), { recursive: true });
172
+ const bytes = await readFile(srcPath);
173
+ await writeFile(dest, bytes);
174
+ }
175
+ return root;
176
+ }
177
+ var SENTINEL_ASSET = "engine/gutterpress-viewer.js";
178
+ async function getAssetsDir() {
179
+ if (extractPromise) {
180
+ try {
181
+ const root = await extractPromise;
182
+ if (existsSync(join(root, SENTINEL_ASSET))) {
183
+ return root;
184
+ }
185
+ } catch {}
186
+ extractPromise = null;
187
+ }
188
+ extractPromise = extractAssets();
189
+ return extractPromise;
190
+ }
191
+ async function getAssetPath(relPath) {
192
+ const root = await getAssetsDir();
193
+ return join(root, relPath);
194
+ }
195
+
196
+ export { getAssetsDir, getAssetPath };