gutterpress 0.11.21-alpha.1 → 0.11.22-alpha.1

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 (51) hide show
  1. package/README.md +11 -0
  2. package/dist/api/index.d.ts +5 -1
  3. package/dist/api/index.js +67 -46
  4. package/dist/{build-jd5ky1xh.js → build-se85j9ec.js} +16 -10
  5. package/dist/cli-5553w972.js +75 -0
  6. package/dist/{cli-b57adna7.js → cli-8hccw62p.js} +9 -201
  7. package/dist/cli-9vy4b6ec.js +2089 -0
  8. package/dist/{cli-a8azwpgj.js → cli-d8xjns66.js} +1 -102
  9. package/dist/{cli-xvtqsqy3.js → cli-fbwqv7p4.js} +720 -5428
  10. package/dist/cli-gc9av5hs.js +103 -0
  11. package/dist/cli-gmm3bdeq.js +196 -0
  12. package/dist/cli-h3phdstf.js +200 -0
  13. package/dist/{index-qf7y4d85.js → cli-habkc5ng.js} +12 -258
  14. package/dist/cli-pfrg1r9x.js +3073 -0
  15. package/dist/{cli-3zab895b.js → cli-yejbb9f8.js} +5 -76
  16. package/dist/cli.js +15 -13
  17. package/dist/{doctor-0kgq1ns6.js → doctor-bv2t82zd.js} +7 -4
  18. package/dist/{engine-x07q927h.js → engine-h4ehmrvf.js} +4 -3
  19. package/dist/{engine-0b8bt05n.js → engine-qwkyhrej.js} +3 -2
  20. package/dist/{ext-f90yv3dv.js → ext-a8ndp142.js} +21 -14
  21. package/dist/extension-restore-926mv2qk.js +16 -0
  22. package/dist/extension-restore-q1f7njec.js +20 -0
  23. package/dist/index-38e18a7j.js +3244 -0
  24. package/dist/{index-mr72vt8n.js → index-5h9a38jn.js} +1 -213
  25. package/dist/{cli-5qr3z0qa.js → index-93pqkvty.js} +63 -207
  26. package/dist/index-dhknsvfz.js +213 -0
  27. package/dist/index-dm7hx46j.js +2208 -0
  28. package/dist/{index-t7r8g75c.js → index-gmfh6n05.js} +4 -2
  29. package/dist/index-r7jcsk6h.js +200 -0
  30. package/dist/{index-5qam734s.js → index-tkjvs1gf.js} +4774 -9354
  31. package/dist/index.js +70 -49
  32. package/dist/lib/extension-manifest.d.ts +22 -1
  33. package/dist/lib/markdown/plugins.d.ts +20 -0
  34. package/dist/lib/markdown/two-versions.d.ts +32 -0
  35. package/dist/lib/publish/plugin-provider.d.ts +16 -0
  36. package/dist/lib/publish/run-publish.d.ts +13 -5
  37. package/dist/lib/publish/types.d.ts +34 -2
  38. package/dist/lib/text-diff.d.ts +43 -0
  39. package/dist/lib/two-versions-markers.d.ts +26 -0
  40. package/dist/lib/version-changes.d.ts +87 -0
  41. package/dist/{new-fc7nwxea.js → new-nadp2hvb.js} +23 -16
  42. package/dist/plugins-gy4q9vaa.js +26 -0
  43. package/dist/plugins-yeh4shd7.js +24 -0
  44. package/dist/{preflight-hwvj3k3d.js → preflight-c6q25xqa.js} +18 -11
  45. package/dist/{preview-ktqjnf3d.js → preview-y8chv4cb.js} +19 -13
  46. package/dist/{publish-nf3d5cbv.js → publish-3qwvxsxa.js} +40 -23
  47. package/dist/render.js +120 -0
  48. package/dist/{source-provider-pzmz0br9.js → source-provider-2r74a7wp.js} +2 -1
  49. package/dist/{source-provider-qbthnmqw.js → source-provider-qbfknhyy.js} +2 -1
  50. package/dist/{validate-7aywy6m4.js → validate-w108kk87.js} +16 -10
  51. package/package.json +1 -1
package/README.md CHANGED
@@ -274,6 +274,17 @@ gutterpress publish --provider gdrive --connect
274
274
  gutterpress publish --provider gdrive ./my-book
275
275
  ```
276
276
 
277
+ **Publishing plugins (experimental — may change or be removed).** `--provider`
278
+ also takes the package name of a publishing plugin listed in the book's
279
+ `extensions:`. `--list` shows those plugins after the built-ins with the status
280
+ `experimental` (`experimental: true` in `--json`). A plugin whose downloaded
281
+ copy is missing is downloaded first, as for `build` (a failed download exits 3
282
+ with the reason); publishing to a built-in never loads plugins. See
283
+ [User Guide: Chapter 8 — Publishing](https://github.com/dimm-city/gutterpress/blob/main/examples/gutterpress-user-guide/08-publishing.md)
284
+ for authors and
285
+ [Chapter 5 — Plugins](https://github.com/dimm-city/gutterpress/blob/main/examples/gutterpress-user-guide/05-plugins.md)
286
+ for the plugin contract.
287
+
277
288
  ### `gutterpress validate`
278
289
 
279
290
  Run the validation pipeline (pre-build source checks and/or post-build PDF checks). Tools that aren't installed are skipped with a warning — they don't fail the run. See [User Guide: Chapter 6 — Validation](https://github.com/dimm-city/gutterpress/blob/main/examples/gutterpress-user-guide/06-validation.md) for the full check list and [User Guide: Chapter 7 — System Setup](https://github.com/dimm-city/gutterpress/blob/main/examples/gutterpress-user-guide/07-system-setup.md) for which external tools each check needs.
@@ -55,6 +55,8 @@ export { readPageSetup, setPageSetup } from "../lib/page-size.ts";
55
55
  export type { PageSetup, PageSizeChoice, PageSizePoints } from "../lib/page-size.ts";
56
56
  export { providerFor, restoreVersionWithBackup, isNoChangesError, countUnversionedChanges, whenGitIdle, AUTO_SNAPSHOT_MESSAGE, RESTORE_BACKUP_MESSAGE, HISTORY_PAGE_LIMIT, listLocalBranches, switchBranch, SWITCH_BRANCH_SNAPSHOT_MESSAGE, } from "../lib/source-provider.ts";
57
57
  export type { ListHistoryOptions, HistoryPage, UnversionedChanges, LocalBranches, SwitchBranchOptions, SwitchBranchResult, } from "../lib/source-provider.ts";
58
+ export { describeVersions, listOnlineVersions, compareVersionFile, exportVersionTree, VERSION_CHANGES_SHOWN, } from "../lib/version-changes.ts";
59
+ export type { VersionEntry, VersionFileChange, CompareRow } from "../lib/version-changes.ts";
58
60
  export { autoSnapshotDelayMs, autoSyncDelayMs, isGitInternalPath, AUTO_SNAPSHOT_DEFAULT_MINUTES, AUTO_SYNC_MIN_MINUTES, AUTO_SYNC_MAX_MINUTES, AUTO_SYNC_DEFAULT_MINUTES, AUTO_SYNC_PUSH_INTERVAL_MINUTES, } from "../lib/host-policy.ts";
59
61
  export type { AutoSnapshotPolicy, AutoSyncPolicy, } from "../lib/host-policy.ts";
60
62
  export { FileTokenStore, defaultConfigDir, extractUrlCredential, } from "../lib/remote-auth/token-store.ts";
@@ -85,6 +87,8 @@ export type { SnapshotEntry, InitVersionHistoryOptions, SnapshotOptions, Restore
85
87
  export { runPublish, resolvePublishRequest, resolvePublishFormat, } from "../lib/publish/run-publish.ts";
86
88
  export type { RunPublishOptions, RunPublishResult, } from "../lib/publish/run-publish.ts";
87
89
  export { listPublishProviders, publishProviderFor, } from "../lib/publish/registry.ts";
90
+ export { listBookPublishProviders, resolvePublishProvider, } from "../lib/publish/plugin-provider.ts";
91
+ export type { PublishBook } from "../lib/publish/plugin-provider.ts";
88
92
  export { connectPublishProvider, disconnectPublishCredential } from "../lib/publish/connect.ts";
89
93
  export type { ConnectPublishProviderOptions, DisconnectPublishCredentialOptions, } from "../lib/publish/connect.ts";
90
94
  export { publishConnectionStatus, publishCredentialKey, listPublishAccounts, } from "../lib/publish/types.ts";
@@ -92,6 +96,6 @@ export type { PublishSavedAccount } from "../lib/publish/types.ts";
92
96
  export { PublishSelectionsStore } from "../lib/publish/selections.ts";
93
97
  export type { PublishAccountSelection } from "../lib/publish/selections.ts";
94
98
  export { readPublishSettings, setPublishProviderConfig, } from "../lib/publish/manifest-publish.ts";
95
- export type { PublishProvider, PublishProviderId, PublishProviderInfo, PublishProviderKind, PublishConfigField, PublishArtifact, PublishArtifactFormat, PublishAuthStatus, PublishDeps, PublishListingMetadata, PublishOutcome, PublishProduct, PublishProject, PublishRequest, PreflightIssue, CommandRunner, CommandResult, } from "../lib/publish/types.ts";
99
+ export type { PublishProvider, PublishProviderId, PublishProviderInfo, PublishProviderKind, PublishConfigField, PublishArtifact, PublishArtifactFormat, PublishAuthStatus, PublishDeps, PublishListingMetadata, PublishOutcome, PublishProduct, PublishProject, PublishRequest, PreflightIssue, CommandRunner, CommandResult, PublishPluginContext, PublishPluginFunction, PublishPluginResult, } from "../lib/publish/types.ts";
96
100
  export { resolveLogger } from "../lib/remote-auth/operation-log.ts";
97
101
  export type { OperationLogger, LogData } from "../lib/remote-auth/operation-log.ts";
package/dist/api/index.js CHANGED
@@ -4,69 +4,50 @@ import {
4
4
  AUTO_SYNC_MAX_MINUTES,
5
5
  AUTO_SYNC_MIN_MINUTES,
6
6
  AUTO_SYNC_PUSH_INTERVAL_MINUTES,
7
- BUILT_IN_STYLE_SET_IDS,
8
7
  BUILT_IN_TEMPLATE_IDS,
9
- BUNDLED_EXTENSIONS,
10
- DEFAULT_NPM_REGISTRY,
11
- EXTENSIONS_DIR,
12
8
  EXTENSION_KINDS,
13
- EXTENSION_MANIFEST_FILENAME,
14
9
  FileTokenStore,
15
10
  GDRIVE_HOST,
16
11
  GITHUB_HOST,
17
12
  GOOGLE_NOT_CONFIGURED_MESSAGE,
18
13
  GitHubAuthProvider,
19
14
  GoogleAuthProvider,
20
- MANIFEST_FILENAMES,
21
15
  MAX_SEARCH_BYTES,
22
- PRESETS,
23
- PRESET_IDS,
24
16
  PublishSelectionsStore,
25
- RECOMMENDED_EXTENSIONS,
26
17
  REPAIR_SNAPSHOT_MESSAGE,
27
18
  RESERVED_PREFIX,
28
19
  SEARCH_KEYWORDS,
29
20
  SNIPPETS_DIR,
30
21
  SYNC_SNAPSHOT_MESSAGE,
31
- TARGETS,
32
- TARGET_IDS,
33
- addBuiltInStyleSet,
34
- addExtension,
22
+ VERSION_CHANGES_SHOWN,
35
23
  adoptFolder,
36
- assertExtensionContained,
37
24
  autoSnapshotDelayMs,
38
25
  autoSyncDelayMs,
39
- checkExtensionUpdates,
40
26
  checkRemoteUpdates,
41
27
  cloneRepository,
28
+ compareVersionFile,
42
29
  connectGenericHost,
43
30
  connectGoogleDrive,
44
31
  connectPublishProvider,
45
32
  defaultConfigDir,
46
33
  deleteSnippet,
47
- describeExtension,
34
+ describeVersions,
48
35
  diagnoseProjectRemote,
49
36
  disconnectPublishCredential,
50
- ensureProjectGitignore,
51
37
  escapeYamlScalar,
52
- extensionCarries,
53
- extensionEntry,
54
- extensionStyleList,
38
+ exportVersionTree,
55
39
  extractUrlCredential,
56
40
  extractVariables,
57
41
  forgeKindForHost,
58
42
  getSystemDiagnostics,
59
- hasProjectManifest,
60
43
  importExtensionFromFile,
61
44
  importExtensionFromUrl,
62
45
  importTemplateFromFolder,
63
- isBundledExtension,
64
46
  isGitInternalPath,
65
- isPathSpecifier,
66
47
  isSshRemoteUrl,
67
48
  isValidRepositoryName,
68
49
  knownForgeTokenUrl,
69
- listBuiltInStyleSets,
50
+ listBookPublishProviders,
70
51
  listBuiltInTemplates,
71
52
  listCustomTemplates,
72
53
  listGitHubBranches,
@@ -74,48 +55,34 @@ import {
74
55
  listLocationVariants,
75
56
  listMarkerComponents,
76
57
  listMergedSnippets,
77
- listNpmVersions,
78
- listProjectExtensions,
58
+ listOnlineVersions,
79
59
  listProjectStyles,
80
60
  listPublishAccounts,
81
61
  listPublishProviders,
82
62
  listRepoBooks,
83
63
  listSnippets,
84
- loadManifestWithPath,
85
- npmRegistryUrl,
86
- parseExtensionSpecifier,
87
64
  parseRemoteOrigin,
88
- pathEscapesFolder,
89
65
  pkceChallengeFromVerifier,
90
66
  publishConnectionStatus,
91
67
  publishCredentialKey,
92
68
  publishProviderFor,
93
- publishTargetFor,
94
- readExtensionCss,
95
- readExtensionMeta,
96
69
  readManifestFields,
97
70
  readPageSetup,
98
71
  readPublishSettings,
99
72
  refreshRemoteCopies,
100
- removeExtension,
101
- reorderExtensions,
102
73
  repairOnlineBackup,
103
74
  requireGoogleClientCredentials,
104
75
  resolveActiveStyles,
105
- resolveConfig,
106
- resolveExtension,
107
76
  resolveExtensionPrefix,
108
77
  resolveGitHubClientId,
109
78
  resolveGoogleClientId,
110
79
  resolveGoogleClientSecret,
111
80
  resolvePublishFormat,
81
+ resolvePublishProvider,
112
82
  resolvePublishRequest,
113
- restoreFailureMessage,
114
- restorePinnedExtensions,
115
83
  revokeGoogleCredential,
116
84
  runBuild,
117
85
  runPublish,
118
- sameExtension,
119
86
  sanitizeCloneFolderName,
120
87
  saveProjectAsTemplate,
121
88
  saveSnippet,
@@ -124,7 +91,6 @@ import {
124
91
  scorchedEarth,
125
92
  searchNpmExtensions,
126
93
  setActiveStyles,
127
- setExtensionEnabled,
128
94
  setManifestFields,
129
95
  setPageSetup,
130
96
  setPublishProviderConfig,
@@ -134,14 +100,60 @@ import {
134
100
  startPreviewServer,
135
101
  substituteVariables,
136
102
  syncProject,
137
- testRemoteAccess,
103
+ testRemoteAccess
104
+ } from "../index-tkjvs1gf.js";
105
+ import {
106
+ BUILT_IN_STYLE_SET_IDS,
107
+ BUNDLED_EXTENSIONS,
108
+ DEFAULT_NPM_REGISTRY,
109
+ EXTENSIONS_DIR,
110
+ MANIFEST_FILENAMES,
111
+ PRESETS,
112
+ PRESET_IDS,
113
+ RECOMMENDED_EXTENSIONS,
114
+ TARGETS,
115
+ TARGET_IDS,
116
+ addBuiltInStyleSet,
117
+ addExtension,
118
+ checkExtensionUpdates,
119
+ describeExtension,
120
+ ensureProjectGitignore,
121
+ hasProjectManifest,
122
+ isBundledExtension,
123
+ isPathSpecifier,
124
+ listBuiltInStyleSets,
125
+ listNpmVersions,
126
+ listProjectExtensions,
127
+ loadManifestWithPath,
128
+ npmRegistryUrl,
129
+ parseExtensionSpecifier,
130
+ publishTargetFor,
131
+ readExtensionCss,
132
+ removeExtension,
133
+ reorderExtensions,
134
+ resolveConfig,
135
+ restoreFailureMessage,
136
+ restorePinnedExtensions,
137
+ sameExtension,
138
+ setExtensionEnabled,
138
139
  updateExtensions,
139
140
  validateProjectExtensions
140
- } from "../index-5qam734s.js";
141
+ } from "../index-dm7hx46j.js";
142
+ import {
143
+ EXTENSION_MANIFEST_FILENAME,
144
+ assertExtensionContained,
145
+ extensionCarries,
146
+ extensionEntry,
147
+ extensionStyleList,
148
+ pathEscapesFolder,
149
+ readExtensionMeta,
150
+ resolveExtension
151
+ } from "../index-38e18a7j.js";
141
152
  import"../index-ht1bcqdd.js";
153
+ import"../index-5h9a38jn.js";
142
154
  import {
143
155
  BuildError
144
- } from "../index-mr72vt8n.js";
156
+ } from "../index-dhknsvfz.js";
145
157
  import"../index-sth219v1.js";
146
158
  import {
147
159
  DEFAULT_PRINT_OPTS,
@@ -151,7 +163,6 @@ import {
151
163
  import {
152
164
  AUTO_SNAPSHOT_MESSAGE,
153
165
  HISTORY_PAGE_LIMIT,
154
- PLUGINS_DIR,
155
166
  RESTORE_BACKUP_MESSAGE,
156
167
  SWITCH_BRANCH_SNAPSHOT_MESSAGE,
157
168
  countUnversionedChanges,
@@ -162,7 +173,10 @@ import {
162
173
  restoreVersionWithBackup,
163
174
  switchBranch,
164
175
  whenGitIdle
165
- } from "../index-qf7y4d85.js";
176
+ } from "../index-93pqkvty.js";
177
+ import {
178
+ PLUGINS_DIR
179
+ } from "../index-r7jcsk6h.js";
166
180
  import {
167
181
  capabilitiesFor,
168
182
  detectProjectSource,
@@ -203,6 +217,7 @@ export {
203
217
  restorePinnedExtensions,
204
218
  restoreFailureMessage,
205
219
  resolvePublishRequest,
220
+ resolvePublishProvider,
206
221
  resolvePublishFormat,
207
222
  resolveLogger,
208
223
  resolveGoogleClientSecret,
@@ -242,6 +257,7 @@ export {
242
257
  listPublishAccounts,
243
258
  listProjectStyles,
244
259
  listProjectExtensions,
260
+ listOnlineVersions,
245
261
  listNpmVersions,
246
262
  listMergedSnippets,
247
263
  listMarkerComponents,
@@ -252,6 +268,7 @@ export {
252
268
  listCustomTemplates,
253
269
  listBuiltInTemplates,
254
270
  listBuiltInStyleSets,
271
+ listBookPublishProviders,
255
272
  knownForgeTokenUrl,
256
273
  isValidRepositoryName,
257
274
  isSshRemoteUrl,
@@ -271,11 +288,13 @@ export {
271
288
  extensionStyleList,
272
289
  extensionEntry,
273
290
  extensionCarries,
291
+ exportVersionTree,
274
292
  escapeYamlScalar,
275
293
  ensureProjectGitignore,
276
294
  disconnectPublishCredential,
277
295
  diagnoseProjectRemote,
278
296
  detectProjectSource,
297
+ describeVersions,
279
298
  describeExtension,
280
299
  deleteSnippet,
281
300
  defaultConfigDir,
@@ -283,6 +302,7 @@ export {
283
302
  connectPublishProvider,
284
303
  connectGoogleDrive,
285
304
  connectGenericHost,
305
+ compareVersionFile,
286
306
  cloneRepository,
287
307
  checkRemoteUpdates,
288
308
  checkExtensionUpdates,
@@ -294,6 +314,7 @@ export {
294
314
  adoptFolder,
295
315
  addExtension,
296
316
  addBuiltInStyleSet,
317
+ VERSION_CHANGES_SHOWN,
297
318
  TARGET_IDS,
298
319
  TARGETS,
299
320
  SYNC_SNAPSHOT_MESSAGE,
@@ -1,27 +1,33 @@
1
1
  import {
2
2
  runBuild,
3
3
  splitOutPath
4
- } from "./cli-xvtqsqy3.js";
4
+ } from "./cli-fbwqv7p4.js";
5
+ import"./cli-yejbb9f8.js";
6
+ import"./cli-ht1bcqdd.js";
7
+ import"./cli-8hccw62p.js";
8
+ import"./cli-sth219v1.js";
9
+ import"./cli-eyyggect.js";
10
+ import"./cli-asap4t1z.js";
11
+ import"./cli-habkc5ng.js";
12
+ import"./cli-v5mp7a6q.js";
13
+ import"./cli-9vy4b6ec.js";
14
+ import"./cli-pfrg1r9x.js";
5
15
  import {
6
16
  log
7
- } from "./cli-3zab895b.js";
17
+ } from "./cli-5553w972.js";
8
18
  import {
9
19
  UsageError,
10
20
  parseFormat,
11
21
  parsePdfxFlavor,
12
22
  rejectExtraPositionals,
13
23
  rejectUnknownFlags
14
- } from "./cli-a8azwpgj.js";
15
- import"./cli-ht1bcqdd.js";
16
- import"./cli-b57adna7.js";
24
+ } from "./cli-d8xjns66.js";
25
+ import"./cli-gc9av5hs.js";
26
+ import"./cli-gmm3bdeq.js";
17
27
  import {
18
28
  BuildError
19
29
  } from "./cli-46ycxe6r.js";
20
- import"./cli-sth219v1.js";
21
- import"./cli-eyyggect.js";
22
- import"./cli-asap4t1z.js";
23
- import"./cli-5qr3z0qa.js";
24
- import"./cli-v5mp7a6q.js";
30
+ import"./cli-h3phdstf.js";
25
31
  import"./cli-37x76zdn.js";
26
32
 
27
33
  // src/commands/build.ts
@@ -0,0 +1,75 @@
1
+ import {
2
+ package_default
3
+ } from "./cli-gc9av5hs.js";
4
+
5
+ // src/utils/logger.ts
6
+ var currentLevel = "INFO";
7
+ var LEVELS = {
8
+ DEBUG: 0,
9
+ INFO: 1,
10
+ WARN: 2,
11
+ ERROR: 3
12
+ };
13
+ function setLogLevel(level) {
14
+ currentLevel = level;
15
+ }
16
+ function emit(level, message, ...args) {
17
+ if (LEVELS[level] < LEVELS[currentLevel])
18
+ return;
19
+ const colors = {
20
+ DEBUG: "\x1B[36m",
21
+ INFO: "\x1B[32m",
22
+ WARN: "\x1B[33m",
23
+ ERROR: "\x1B[31m"
24
+ };
25
+ const reset = "\x1B[0m";
26
+ const timestamp = new Date().toISOString().slice(11, 19);
27
+ const prefix = `${colors[level]}[${timestamp}] ${level}${reset}:`;
28
+ if (level === "ERROR") {
29
+ console.error(prefix, message, ...args);
30
+ } else {
31
+ console.log(prefix, message, ...args);
32
+ }
33
+ }
34
+ function debug(message, ...args) {
35
+ emit("DEBUG", message, ...args);
36
+ }
37
+ function info(message, ...args) {
38
+ emit("INFO", message, ...args);
39
+ }
40
+ function warn(message, ...args) {
41
+ emit("WARN", message, ...args);
42
+ }
43
+ function error(message, ...args) {
44
+ emit("ERROR", message, ...args);
45
+ }
46
+ var RESET = "\x1B[0m";
47
+ var BOLD = "\x1B[1m";
48
+ var RED = "\x1B[31m";
49
+ var YELLOW = "\x1B[33m";
50
+ var GREEN = "\x1B[32m";
51
+ var CYAN = "\x1B[36m";
52
+ var log = {
53
+ info(msg, ...args) {
54
+ console.log(`${CYAN}info${RESET} ${msg}`, ...args);
55
+ },
56
+ warn(msg, ...args) {
57
+ console.warn(`${YELLOW}warn${RESET} ${msg}`, ...args);
58
+ },
59
+ error(msg, ...args) {
60
+ console.error(`${RED}${BOLD}error${RESET} ${msg}`, ...args);
61
+ },
62
+ success(msg, ...args) {
63
+ console.log(`${GREEN}ok${RESET} ${msg}`, ...args);
64
+ }
65
+ };
66
+
67
+ // src/lib/version.ts
68
+ var PACKAGE_META = {
69
+ version: package_default.version ?? "unknown",
70
+ dependencies: package_default.dependencies ?? {},
71
+ devDependencies: package_default.devDependencies ?? {}
72
+ };
73
+ var PACKAGE_VERSION = PACKAGE_META.version;
74
+
75
+ export { setLogLevel, debug, info, warn, error, log, PACKAGE_META, PACKAGE_VERSION };
@@ -1,10 +1,13 @@
1
1
  import {
2
2
  launchChromium
3
3
  } from "./cli-eyyggect.js";
4
+ import {
5
+ getAssetPath
6
+ } from "./cli-gmm3bdeq.js";
4
7
 
5
8
  // src/engine/compiler/build.ts
6
- import { readFile as readFile2 } from "node:fs/promises";
7
- import { resolve as resolve2 } from "node:path";
9
+ import { readFile } from "node:fs/promises";
10
+ import { resolve } from "node:path";
8
11
  import { pathToFileURL } from "node:url";
9
12
 
10
13
  // src/engine/shared/gcpm-extract.ts
@@ -1123,201 +1126,6 @@ async function inspectPdf(bytes) {
1123
1126
  return { pageCount: pages.length, boxes, linkTargets, namedDests, outline };
1124
1127
  }
1125
1128
 
1126
- // src/lib/embedded-assets.ts
1127
- import { existsSync } from "node:fs";
1128
- import { mkdtemp, mkdir, writeFile, readFile } from "node:fs/promises";
1129
- import { tmpdir } from "node:os";
1130
- import { dirname, join, resolve } from "node:path";
1131
- import { fileURLToPath } from "node:url";
1132
-
1133
- // src/assets/favicon.ico
1134
- var favicon_default = "./favicon-272ga6y0.ico";
1135
-
1136
- // src/assets/manifest.schema.json
1137
- var manifest_schema_default = "./manifest.schema-n292sb77.json";
1138
-
1139
- // src/assets/preview/scripts/preview-interface.js
1140
- var preview_interface_default = "./preview-interface-nnmrxyqm.js";
1141
-
1142
- // src/assets/preview/scripts/preview-bridge.js
1143
- var preview_bridge_default = "./preview-bridge-8wjcjec3.js";
1144
-
1145
- // src/assets/preview/scripts/preview-shell.js
1146
- var preview_shell_default = "./preview-shell-wk9k3gcd.js";
1147
-
1148
- // profiles/CGATS21_CRPC1.icc
1149
- var CGATS21_CRPC1_default = "./CGATS21_CRPC1-g0e3k7kr.icc";
1150
-
1151
- // src/assets/engine/gutterpress-viewer.js
1152
- var gutterpress_viewer_default = "./gutterpress-viewer-w7njnkj7.js";
1153
-
1154
- // src/assets/engine/gutterpress-agent.js
1155
- var gutterpress_agent_default = "./gutterpress-agent-d29ry3ak.js";
1156
-
1157
- // src/assets/templates/book/manifest.yaml
1158
- var manifest_default = "./manifest-n1gh3qw5.yaml";
1159
-
1160
- // src/assets/templates/book/chapter-01.md
1161
- var chapter_01_default = "./chapter-01-rkpyvjna.md";
1162
-
1163
- // src/assets/templates/zine/manifest.yaml
1164
- var manifest_default2 = "./manifest-n1gh3qw5.yaml";
1165
-
1166
- // src/assets/templates/zine/chapter-01.md
1167
- var chapter_01_default2 = "./chapter-01-7jwqg1ct.md";
1168
-
1169
- // src/assets/templates/technical/manifest.yaml
1170
- var manifest_default3 = "./manifest-n1gh3qw5.yaml";
1171
-
1172
- // src/assets/templates/technical/chapter-01.md
1173
- var chapter_01_default3 = "./chapter-01-6fn9pvd0.md";
1174
-
1175
- // src/assets/extension-templates/plugin/package.json
1176
- var package_default = "./package-9rv69pxm.json";
1177
-
1178
- // src/assets/extension-templates/plugin/README.md
1179
- var README_default = "./README-vsnsc1b3.md";
1180
-
1181
- // src/assets/extension-templates/plugin/plugin.js.tpl
1182
- var plugin_js_default = "./plugin.js-cswq7wvd.tpl";
1183
-
1184
- // src/assets/extension-templates/plugin/styles/plugin.css
1185
- var plugin_default = "./plugin-spbcem4j.css";
1186
-
1187
- // src/assets/extension-templates/plugin/snippets/term-box.md
1188
- var term_box_default = "./term-box-4y0w7y32.md";
1189
-
1190
- // src/assets/extension-templates/plugin/test/fixture.md
1191
- var fixture_default = "./fixture-2qnyqgb5.md";
1192
-
1193
- // src/assets/extension-templates/plugin/test/expected.html
1194
- var expected_default = "./expected-ycmacem8.html";
1195
-
1196
- // src/assets/extension-templates/plugin/test/plugin.test.js.tpl
1197
- var plugin_test_js_default = "./plugin.test.js-xgxrd8hf.tpl";
1198
-
1199
- // src/assets/extension-templates/theme/package.json
1200
- var package_default2 = "./package-aenwjew3.json";
1201
-
1202
- // src/assets/extension-templates/theme/README.md
1203
- var README_default2 = "./README-3nj919rm.md";
1204
-
1205
- // src/assets/extension-templates/theme/components.yaml
1206
- var components_default = "./components-zzqdpt3m.yaml";
1207
-
1208
- // src/assets/extension-templates/theme/snippets/callout.md
1209
- var callout_default = "./callout-hv56m16h.md";
1210
-
1211
- // src/assets/extension-templates/theme/styles/tokens.css
1212
- var tokens_default = "./tokens-7984461t.css";
1213
-
1214
- // src/assets/extension-templates/theme/styles/base.css
1215
- var base_default = "./base-ypqh9n7f.css";
1216
-
1217
- // src/assets/extension-templates/theme/styles/components.css
1218
- var components_default2 = "./components-aam0fe2z.css";
1219
-
1220
- // src/assets/extension-templates/theme/styles/page-templates.css
1221
- var page_templates_default = "./page-templates-tx9ryt19.css";
1222
-
1223
- // src/assets/extension-templates/theme/styles/page-rules.css
1224
- var page_rules_default = "./page-rules-nsj3aw42.css";
1225
-
1226
- // src/assets/extension-templates/theme/styles/book.css
1227
- var book_default = "./book-ted3tzrp.css";
1228
-
1229
- // src/assets/themes/clean-book/theme.css
1230
- var theme_default = "./theme-j2bagrfx.css";
1231
-
1232
- // src/assets/themes/clean-book/package.json
1233
- var package_default3 = "./package-97gm31sg.json";
1234
-
1235
- // src/assets/themes/zine/theme.css
1236
- var theme_default2 = "./theme-h5recz6c.css";
1237
-
1238
- // src/assets/themes/zine/package.json
1239
- var package_default4 = "./package-gag6ykwn.json";
1240
-
1241
- // src/assets/themes/technical-doc/theme.css
1242
- var theme_default3 = "./theme-nn6d53zy.css";
1243
-
1244
- // src/assets/themes/technical-doc/package.json
1245
- var package_default5 = "./package-nrhkwf2m.json";
1246
-
1247
- // src/lib/embedded-assets.ts
1248
- var __libdir = dirname(fileURLToPath(import.meta.url));
1249
- var abs = (p) => resolve(__libdir, p);
1250
- var filePath = (v) => v;
1251
- var EMBEDDED_ASSETS = {
1252
- "favicon.ico": abs(favicon_default),
1253
- "manifest.schema.json": abs(filePath(manifest_schema_default)),
1254
- "preview/scripts/preview-interface.js": abs(filePath(preview_interface_default)),
1255
- "preview/scripts/preview-bridge.js": abs(filePath(preview_bridge_default)),
1256
- "preview/scripts/preview-shell.js": abs(filePath(preview_shell_default)),
1257
- "profiles/CGATS21_CRPC1.icc": abs(filePath(CGATS21_CRPC1_default)),
1258
- "engine/gutterpress-viewer.js": abs(filePath(gutterpress_viewer_default)),
1259
- "engine/gutterpress-agent.js": abs(filePath(gutterpress_agent_default)),
1260
- "templates/book/manifest.yaml": abs(filePath(manifest_default)),
1261
- "templates/book/chapter-01.md": abs(filePath(chapter_01_default)),
1262
- "templates/zine/manifest.yaml": abs(filePath(manifest_default2)),
1263
- "templates/zine/chapter-01.md": abs(filePath(chapter_01_default2)),
1264
- "templates/technical/manifest.yaml": abs(filePath(manifest_default3)),
1265
- "templates/technical/chapter-01.md": abs(filePath(chapter_01_default3)),
1266
- "extension-templates/plugin/package.json": abs(filePath(package_default)),
1267
- "extension-templates/plugin/README.md": abs(filePath(README_default)),
1268
- "extension-templates/plugin/plugin.js.tpl": abs(filePath(plugin_js_default)),
1269
- "extension-templates/plugin/styles/plugin.css": abs(filePath(plugin_default)),
1270
- "extension-templates/plugin/snippets/term-box.md": abs(filePath(term_box_default)),
1271
- "extension-templates/plugin/test/fixture.md": abs(filePath(fixture_default)),
1272
- "extension-templates/plugin/test/expected.html": abs(filePath(expected_default)),
1273
- "extension-templates/plugin/test/plugin.test.js.tpl": abs(filePath(plugin_test_js_default)),
1274
- "extension-templates/theme/package.json": abs(filePath(package_default2)),
1275
- "extension-templates/theme/README.md": abs(filePath(README_default2)),
1276
- "extension-templates/theme/components.yaml": abs(filePath(components_default)),
1277
- "extension-templates/theme/snippets/callout.md": abs(filePath(callout_default)),
1278
- "extension-templates/theme/styles/tokens.css": abs(filePath(tokens_default)),
1279
- "extension-templates/theme/styles/base.css": abs(filePath(base_default)),
1280
- "extension-templates/theme/styles/components.css": abs(filePath(components_default2)),
1281
- "extension-templates/theme/styles/page-templates.css": abs(filePath(page_templates_default)),
1282
- "extension-templates/theme/styles/page-rules.css": abs(filePath(page_rules_default)),
1283
- "extension-templates/theme/styles/book.css": abs(filePath(book_default)),
1284
- "themes/clean-book/theme.css": abs(filePath(theme_default)),
1285
- "themes/clean-book/package.json": abs(filePath(package_default3)),
1286
- "themes/zine/theme.css": abs(filePath(theme_default2)),
1287
- "themes/zine/package.json": abs(filePath(package_default4)),
1288
- "themes/technical-doc/theme.css": abs(filePath(theme_default3)),
1289
- "themes/technical-doc/package.json": abs(filePath(package_default5))
1290
- };
1291
- var extractPromise = null;
1292
- async function extractAssets() {
1293
- const root = await mkdtemp(join(tmpdir(), "gutterpress-assets-"));
1294
- for (const [relPath, srcPath] of Object.entries(EMBEDDED_ASSETS)) {
1295
- const dest = join(root, relPath);
1296
- await mkdir(dirname(dest), { recursive: true });
1297
- const bytes = await readFile(srcPath);
1298
- await writeFile(dest, bytes);
1299
- }
1300
- return root;
1301
- }
1302
- var SENTINEL_ASSET = "engine/gutterpress-viewer.js";
1303
- async function getAssetsDir() {
1304
- if (extractPromise) {
1305
- try {
1306
- const root = await extractPromise;
1307
- if (existsSync(join(root, SENTINEL_ASSET))) {
1308
- return root;
1309
- }
1310
- } catch {}
1311
- extractPromise = null;
1312
- }
1313
- extractPromise = extractAssets();
1314
- return extractPromise;
1315
- }
1316
- async function getAssetPath(relPath) {
1317
- const root = await getAssetsDir();
1318
- return join(root, relPath);
1319
- }
1320
-
1321
1129
  // src/engine/compiler/tier2.ts
1322
1130
  var DEFAULT_SLUG_PT = 18;
1323
1131
  function classify(model) {
@@ -1643,8 +1451,8 @@ function pagePseudoContexts(model) {
1643
1451
  }
1644
1452
  async function build(opts) {
1645
1453
  const log = opts.onProgress ?? (() => {});
1646
- const AGENT = await readFile2(await getAssetPath("engine/gutterpress-agent.js"), "utf8");
1647
- const VIEWER = await readFile2(await getAssetPath("engine/gutterpress-viewer.js"), "utf8");
1454
+ const AGENT = await readFile(await getAssetPath("engine/gutterpress-agent.js"), "utf8");
1455
+ const VIEWER = await readFile(await getAssetPath("engine/gutterpress-viewer.js"), "utf8");
1648
1456
  const browser = opts.browser ?? await launchChromium();
1649
1457
  const ownsBrowser = !opts.browser;
1650
1458
  const page = await browser.newPage();
@@ -1653,7 +1461,7 @@ async function build(opts) {
1653
1461
  const diagnose = (code, message, severity = "warning") => diagnostics.push({ code, severity, message });
1654
1462
  let prints = 0;
1655
1463
  try {
1656
- const url = /^(https?|file):\/\//.test(opts.input) ? opts.input : pathToFileURL(resolve2(opts.input)).href;
1464
+ const url = /^(https?|file):\/\//.test(opts.input) ? opts.input : pathToFileURL(resolve(opts.input)).href;
1657
1465
  await page.navigate(url);
1658
1466
  await page.evaluate(AGENT);
1659
1467
  await page.waitForReady();
@@ -2695,4 +2503,4 @@ ${lines.length ? lines.join(`
2695
2503
  `);
2696
2504
  }
2697
2505
 
2698
- export { lastPageMode, getAssetsDir, getAssetPath, MARGIN_BOX_IGNORED_PROPERTIES, build };
2506
+ export { lastPageMode, MARGIN_BOX_IGNORED_PROPERTIES, build };