gutterpress 0.10.8 → 0.10.9

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 (59) hide show
  1. package/README.md +93 -90
  2. package/dist/{README-aaqapam1.md → README-6c7fda1s.md} +9 -7
  3. package/dist/{README-mdq34cmb.md → README-jntqyj1z.md} +19 -10
  4. package/dist/api/index.d.ts +8 -8
  5. package/dist/api/index.js +46 -46
  6. package/dist/{audit-m3ce9pvq.js → audit-fq7s1gsz.js} +4 -4
  7. package/dist/{build-qnecb3a1.js → build-dyat3fqd.js} +5 -8
  8. package/dist/checks/source/dangling-links.d.ts +18 -0
  9. package/dist/checks/source/index.d.ts +1 -0
  10. package/dist/checks/source/local-ref-parser.d.ts +13 -0
  11. package/dist/{cli-1hx14cgk.js → cli-8pg731p5.js} +2941 -2927
  12. package/dist/{cli-4vtgt2ng.js → cli-bx950tb4.js} +7 -7
  13. package/dist/{cli-pfpb1t3h.js → cli-bzxqtvrk.js} +1 -2
  14. package/dist/{cli-vcv5ewqj.js → cli-rh05byck.js} +2 -9
  15. package/dist/{cli-vxf151ea.js → cli-ypfvnhag.js} +1 -1
  16. package/dist/cli.js +24 -53
  17. package/dist/{doctor-qvqye1wd.js → doctor-yr85n080.js} +2 -2
  18. package/dist/{engine-daad33qn.js → engine-19mshh07.js} +2 -2
  19. package/dist/{engine-db8632w6.js → engine-d46wgg99.js} +3 -3
  20. package/dist/ext-jrg8c48s.js +268 -0
  21. package/dist/{index-rpt4vtby.js → index-dhgzkhs7.js} +1 -1
  22. package/dist/{index-dfw8hn8q.js → index-mey5vraz.js} +5852 -5899
  23. package/dist/{index-9pbaznww.js → index-zwcv1njy.js} +7 -7
  24. package/dist/index.js +47 -47
  25. package/dist/lib/build-runner.d.ts +0 -7
  26. package/dist/lib/build-staging.d.ts +36 -0
  27. package/dist/lib/cli-args.d.ts +0 -7
  28. package/dist/lib/{theme-import.d.ts → extension-import.d.ts} +20 -11
  29. package/dist/lib/extension-manager.d.ts +170 -0
  30. package/dist/lib/extension-manifest.d.ts +25 -17
  31. package/dist/lib/extension-specifier.d.ts +31 -0
  32. package/dist/lib/manifest-doc.d.ts +3 -9
  33. package/dist/lib/markdown/markers.d.ts +2 -2
  34. package/dist/lib/markdown/plugins.d.ts +4 -4
  35. package/dist/lib/missing-asset-placeholder.d.ts +11 -0
  36. package/dist/lib/presets.d.ts +1 -1
  37. package/dist/lib/publish/providers/gdrive.d.ts +1 -1
  38. package/dist/lib/snippets.d.ts +11 -15
  39. package/dist/lib/style-resolver.d.ts +1 -1
  40. package/dist/{lint-3p1s8agk.js → lint-enasqbqx.js} +4 -4
  41. package/dist/{manifest.schema-1q35yxs9.json → manifest.schema-hsn8rsgr.json} +18 -53
  42. package/dist/{new-xffarp40.js → new-r9c99wsn.js} +11 -12
  43. package/dist/{plugin.test.js-mv0ghv5n.tpl → plugin.test.js-npnfhyca.tpl} +0 -1
  44. package/dist/{preflight-z6xpty9w.js → preflight-shk7vqbs.js} +4 -4
  45. package/dist/preview/file-watcher.d.ts +4 -4
  46. package/dist/preview/lifecycle.d.ts +1 -1
  47. package/dist/{preview-xa1n7why.js → preview-52918mxk.js} +6 -10
  48. package/dist/{publish-zgmr99kd.js → publish-8s60vhx7.js} +4 -4
  49. package/dist/schema/manifest.types.d.ts +28 -44
  50. package/dist/{theme-cd6efzjw.json → theme-etj4gxck.json} +4 -1
  51. package/dist/{theme-tqfypc1w.json → theme-s2rg7xe7.json} +4 -1
  52. package/dist/{theme-xt0hjb1b.json → theme-vktedy8q.json} +4 -1
  53. package/dist/types.d.ts +0 -7
  54. package/dist/{validate-43hqgzz5.js → validate-awccx32r.js} +4 -4
  55. package/package.json +1 -1
  56. package/dist/lib/plugin-manager.d.ts +0 -106
  57. package/dist/lib/theme-manager.d.ts +0 -242
  58. package/dist/plugin-b05ck7zd.js +0 -126
  59. package/dist/theme-m9dtxkhj.js +0 -323
package/dist/api/index.js CHANGED
@@ -6,8 +6,10 @@ import {
6
6
  AUTO_SYNC_MAX_MINUTES,
7
7
  AUTO_SYNC_MIN_MINUTES,
8
8
  AUTO_SYNC_PUSH_INTERVAL_MINUTES,
9
+ BUILT_IN_STYLE_SET_IDS,
9
10
  BUILT_IN_TEMPLATE_IDS,
10
- BUILT_IN_THEME_IDS,
11
+ BUNDLED_EXTENSIONS,
12
+ EXTENSIONS_DIR,
11
13
  EXTENSION_KINDS,
12
14
  EXTENSION_MANIFEST_FILENAME,
13
15
  FileTokenStore,
@@ -22,17 +24,15 @@ import {
22
24
  PRESETS,
23
25
  PRESET_IDS,
24
26
  PublishSelectionsStore,
25
- RECOMMENDED_PLUGINS,
27
+ RECOMMENDED_EXTENSIONS,
26
28
  RESERVED_PREFIX,
27
29
  SNIPPETS_DIR,
28
30
  SYNC_SNAPSHOT_MESSAGE,
29
31
  TARGETS,
30
32
  TARGET_IDS,
31
- THEMES_DIR,
32
- addLocalPlugin,
33
- addNpmPlugin,
33
+ addBuiltInStyleSet,
34
+ addExtension,
34
35
  adoptFolder,
35
- applyTheme,
36
36
  assertExtensionContained,
37
37
  autoSnapshotDelayMs,
38
38
  autoSyncDelayMs,
@@ -42,40 +42,40 @@ import {
42
42
  connectPublishProvider,
43
43
  defaultConfigDir,
44
44
  deleteSnippet,
45
- detectLegacyForkedTheme,
45
+ describeExtension,
46
46
  diagnoseProjectRemote,
47
47
  disconnectPublishCredential,
48
48
  escapeYamlScalar,
49
- extensionEngineStyleList,
49
+ extensionCarries,
50
50
  extensionStyleList,
51
+ extensionStyleListWithDefault,
51
52
  extractUrlCredential,
52
53
  extractVariables,
53
54
  forgeKindForHost,
54
- getActiveTheme,
55
- getPreviousTheme,
56
55
  getSystemDiagnostics,
57
56
  hasProjectManifest,
57
+ importExtensionFromFile,
58
+ importExtensionFromUrl,
58
59
  importTemplateFromFolder,
59
- importThemeFromFile,
60
- importThemeFromFolder,
61
- importThemeFromUrl,
60
+ isBundledExtension,
62
61
  isGitInternalPath,
62
+ isPathSpecifier,
63
63
  isSshRemoteUrl,
64
64
  knownForgeTokenUrl,
65
+ listBuiltInStyleSets,
65
66
  listBuiltInTemplates,
66
- listBuiltInThemes,
67
67
  listCustomTemplates,
68
68
  listGitHubBranches,
69
69
  listGitHubRepositories,
70
70
  listMergedSnippets,
71
- listProjectPlugins,
71
+ listProjectExtensions,
72
72
  listProjectStyles,
73
- listProjectThemes,
74
73
  listPublishAccounts,
75
74
  listPublishProviders,
76
75
  listRepoBooks,
77
76
  listSnippets,
78
77
  loadManifestWithPath,
78
+ parseExtensionSpecifier,
79
79
  parseRemoteOrigin,
80
80
  pathEscapesFolder,
81
81
  pkceChallengeFromVerifier,
@@ -83,16 +83,16 @@ import {
83
83
  publishCredentialKey,
84
84
  publishProviderFor,
85
85
  publishTargetFor,
86
+ readExtensionCss,
86
87
  readExtensionMeta,
87
88
  readExtensionSnippet,
88
89
  readManifestFields,
89
90
  readPublishSettings,
90
91
  readSnippet,
91
- readThemeCss,
92
- removeProjectTheme,
92
+ removeExtension,
93
+ reorderExtensions,
93
94
  requireGoogleClientCredentials,
94
95
  resolveActiveStyles,
95
- resolveBuiltInTheme,
96
96
  resolveConfig,
97
97
  resolveExtension,
98
98
  resolveExtensionPrefix,
@@ -101,18 +101,18 @@ import {
101
101
  resolveGoogleClientSecret,
102
102
  resolvePublishFormat,
103
103
  resolvePublishRequest,
104
- revertTheme,
105
104
  revokeGoogleCredential,
106
105
  runBuild,
107
106
  runPublish,
107
+ sameExtension,
108
108
  sanitizeCloneFolderName,
109
109
  saveProjectAsTemplate,
110
110
  saveSnippet,
111
111
  scaffoldExtension,
112
112
  scaffoldProject,
113
113
  setActiveStyles,
114
+ setExtensionEnabled,
114
115
  setManifestFields,
115
- setPluginEnabled,
116
116
  setPublishProviderConfig,
117
117
  slugifyProjectName,
118
118
  splitOutPath,
@@ -120,13 +120,13 @@ import {
120
120
  substituteVariables,
121
121
  syncProject,
122
122
  testRemoteAccess,
123
- validateProjectPlugins
124
- } from "../index-dfw8hn8q.js";
123
+ validateProjectExtensions
124
+ } from "../index-mey5vraz.js";
125
125
  import {
126
126
  BuildError,
127
127
  DEFAULT_PRINT_OPTS,
128
128
  readyProbeExpr
129
- } from "../index-9pbaznww.js";
129
+ } from "../index-zwcv1njy.js";
130
130
  import {
131
131
  AUTO_SNAPSHOT_MESSAGE,
132
132
  HISTORY_PAGE_LIMIT,
@@ -145,7 +145,7 @@ import {
145
145
  } from "../index-v5mp7a6q.js";
146
146
  import"../index-37x76zdn.js";
147
147
  export {
148
- validateProjectPlugins,
148
+ validateProjectExtensions,
149
149
  testRemoteAccess,
150
150
  syncProject,
151
151
  substituteVariables,
@@ -153,18 +153,18 @@ export {
153
153
  splitOutPath,
154
154
  slugifyProjectName,
155
155
  setPublishProviderConfig,
156
- setPluginEnabled,
157
156
  setManifestFields,
157
+ setExtensionEnabled,
158
158
  setActiveStyles,
159
159
  scaffoldProject,
160
160
  scaffoldExtension,
161
161
  saveSnippet,
162
162
  saveProjectAsTemplate,
163
163
  sanitizeCloneFolderName,
164
+ sameExtension,
164
165
  runPublish,
165
166
  runBuild,
166
167
  revokeGoogleCredential,
167
- revertTheme,
168
168
  restoreVersionWithBackup,
169
169
  resolvePublishRequest,
170
170
  resolvePublishFormat,
@@ -175,19 +175,19 @@ export {
175
175
  resolveExtensionPrefix,
176
176
  resolveExtension,
177
177
  resolveConfig,
178
- resolveBuiltInTheme,
179
178
  resolveActiveStyles,
180
179
  requireGoogleClientCredentials,
181
180
  repoSubPath,
182
181
  repoRootForSource,
183
- removeProjectTheme,
182
+ reorderExtensions,
183
+ removeExtension,
184
184
  readyProbeExpr,
185
- readThemeCss,
186
185
  readSnippet,
187
186
  readPublishSettings,
188
187
  readManifestFields,
189
188
  readExtensionSnippet,
190
189
  readExtensionMeta,
190
+ readExtensionCss,
191
191
  publishTargetFor,
192
192
  publishProviderFor,
193
193
  publishCredentialKey,
@@ -196,43 +196,43 @@ export {
196
196
  pkceChallengeFromVerifier,
197
197
  pathEscapesFolder,
198
198
  parseRemoteOrigin,
199
+ parseExtensionSpecifier,
199
200
  loadManifestWithPath,
200
201
  listSnippets,
201
202
  listRepoBooks,
202
203
  listPublishProviders,
203
204
  listPublishAccounts,
204
- listProjectThemes,
205
205
  listProjectStyles,
206
- listProjectPlugins,
206
+ listProjectExtensions,
207
207
  listMergedSnippets,
208
208
  listGitHubRepositories,
209
209
  listGitHubBranches,
210
210
  listCustomTemplates,
211
- listBuiltInThemes,
212
211
  listBuiltInTemplates,
212
+ listBuiltInStyleSets,
213
213
  knownForgeTokenUrl,
214
214
  isSshRemoteUrl,
215
+ isPathSpecifier,
215
216
  isNoChangesError,
216
217
  isGitInternalPath,
217
- importThemeFromUrl,
218
- importThemeFromFolder,
219
- importThemeFromFile,
218
+ isBundledExtension,
220
219
  importTemplateFromFolder,
220
+ importExtensionFromUrl,
221
+ importExtensionFromFile,
221
222
  hasProjectManifest,
222
223
  getSystemDiagnostics,
223
- getPreviousTheme,
224
- getActiveTheme,
225
224
  forgeKindForHost,
226
225
  findEnclosingRepoDir,
227
226
  extractVariables,
228
227
  extractUrlCredential,
228
+ extensionStyleListWithDefault,
229
229
  extensionStyleList,
230
- extensionEngineStyleList,
230
+ extensionCarries,
231
231
  escapeYamlScalar,
232
232
  disconnectPublishCredential,
233
233
  diagnoseProjectRemote,
234
234
  detectProjectSource,
235
- detectLegacyForkedTheme,
235
+ describeExtension,
236
236
  deleteSnippet,
237
237
  defaultConfigDir,
238
238
  connectPublishProvider,
@@ -243,18 +243,16 @@ export {
243
243
  autoSyncDelayMs,
244
244
  autoSnapshotDelayMs,
245
245
  assertExtensionContained,
246
- applyTheme,
247
246
  adoptFolder,
248
- addNpmPlugin,
249
- addLocalPlugin,
250
- THEMES_DIR,
247
+ addExtension,
248
+ addBuiltInStyleSet,
251
249
  TARGET_IDS,
252
250
  TARGETS,
253
251
  SYNC_SNAPSHOT_MESSAGE,
254
252
  SNIPPETS_DIR,
255
253
  RESTORE_BACKUP_MESSAGE,
256
254
  RESERVED_PREFIX,
257
- RECOMMENDED_PLUGINS,
255
+ RECOMMENDED_EXTENSIONS,
258
256
  PublishSelectionsStore,
259
257
  PRESET_IDS,
260
258
  PRESETS,
@@ -270,10 +268,12 @@ export {
270
268
  FileTokenStore,
271
269
  EXTENSION_MANIFEST_FILENAME,
272
270
  EXTENSION_KINDS,
271
+ EXTENSIONS_DIR,
273
272
  DEFAULT_PRINT_OPTS,
274
273
  BuildError,
275
- BUILT_IN_THEME_IDS,
274
+ BUNDLED_EXTENSIONS,
276
275
  BUILT_IN_TEMPLATE_IDS,
276
+ BUILT_IN_STYLE_SET_IDS,
277
277
  AUTO_SYNC_PUSH_INTERVAL_MINUTES,
278
278
  AUTO_SYNC_MIN_MINUTES,
279
279
  AUTO_SYNC_MAX_MINUTES,
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  executeAndReport
3
- } from "./cli-1hx14cgk.js";
3
+ } from "./cli-8pg731p5.js";
4
4
  import {
5
5
  log
6
- } from "./cli-vxf151ea.js";
6
+ } from "./cli-ypfvnhag.js";
7
7
  import {
8
8
  UsageError,
9
9
  rejectExtraPositionals,
10
10
  rejectUnknownFlags
11
- } from "./cli-vcv5ewqj.js";
12
- import"./cli-4vtgt2ng.js";
11
+ } from "./cli-rh05byck.js";
12
+ import"./cli-bx950tb4.js";
13
13
  import"./cli-c41yr7he.js";
14
14
  import {
15
15
  EXIT_CODES
@@ -1,19 +1,18 @@
1
1
  import {
2
2
  runBuild,
3
3
  splitOutPath
4
- } from "./cli-1hx14cgk.js";
4
+ } from "./cli-8pg731p5.js";
5
5
  import {
6
6
  log
7
- } from "./cli-vxf151ea.js";
7
+ } from "./cli-ypfvnhag.js";
8
8
  import {
9
9
  UsageError,
10
- parseEngine,
11
10
  parseFormat,
12
11
  parsePdfxFlavor,
13
12
  rejectExtraPositionals,
14
13
  rejectUnknownFlags
15
- } from "./cli-vcv5ewqj.js";
16
- import"./cli-4vtgt2ng.js";
14
+ } from "./cli-rh05byck.js";
15
+ import"./cli-bx950tb4.js";
17
16
  import"./cli-c41yr7he.js";
18
17
  import {
19
18
  BuildError
@@ -37,8 +36,7 @@ var commandArgs = {
37
36
  "skip-lint": { type: "boolean", description: "Skip CSS linting (default: lint runs for pdf/pdfx)" },
38
37
  "skip-pre-validate": { type: "boolean", description: "Skip pre-build validation" },
39
38
  "skip-post-validate": { type: "boolean", description: "Skip post-build PDF/X validation" },
40
- "allow-shrink": { type: "boolean", description: "Build anyway when content is wider than the page content box, instead of failing. Chromium then scales the WHOLE book down to fit; each offender is reported as a warning." },
41
- engine: { type: "string", description: "Pagination engine. Native is the only engine. This flag is accepted but ignored (a warning fires for --engine paged)." }
39
+ "allow-shrink": { type: "boolean", description: "Build anyway when content is wider than the page content box, instead of failing. Chromium then scales the WHOLE book down to fit; each offender is reported as a warning." }
42
40
  };
43
41
  var build_default = defineCommand({
44
42
  meta: {
@@ -68,7 +66,6 @@ var build_default = defineCommand({
68
66
  skipPreValidate: !!args["skip-pre-validate"],
69
67
  skipPostValidate: !!args["skip-post-validate"],
70
68
  allowShrink: !!args["allow-shrink"],
71
- engine: parseEngine(args.engine),
72
69
  rawArgs: args
73
70
  });
74
71
  } catch (error) {
@@ -0,0 +1,18 @@
1
+ import type { Check } from "../types";
2
+ /**
3
+ * A relative link — `[text](docs/x.md)`, `[next](./02.md)`, even one to an
4
+ * image the build copies — cannot be opened from the printed book: a PDF has
5
+ * no files beside it, and every chapter is concatenated into one document at
6
+ * the staging root, so the browser resolved the href to the build machine's
7
+ * temp dir and baked that into the PDF (#263). The build now drops such an
8
+ * href before print (lib/build-staging.ts `dropRelativeLinkHrefs`); this
9
+ * check tells the author which links that affects, at the source line, so
10
+ * they can choose `#anchor`, an absolute URL, or plain text instead.
11
+ *
12
+ * `source.links.local-refs` answers a different question — does the target
13
+ * exist on disk — and a link can pass that while still being unopenable from
14
+ * a PDF, which is why this is its own check (and can be switched off for an
15
+ * HTML-only book via `validate.checks`).
16
+ */
17
+ declare const check: Check;
18
+ export default check;
@@ -3,6 +3,7 @@ import "./htmlhint";
3
3
  import "./stylelint";
4
4
  import "./css-ownership";
5
5
  import "./local-refs";
6
+ import "./dangling-links";
6
7
  import "./accessibility-alt-text";
7
8
  import "./accessibility-heading-order";
8
9
  import "./layout-markers";
@@ -1,4 +1,5 @@
1
1
  import type { LoadedPlugin } from "../../lib/markdown/renderer";
2
+ import type { CheckContext, CheckResult } from "../types";
2
3
  export type RenderedRefKind = "image" | "link";
3
4
  export interface RenderedLocalRef {
4
5
  ref: string;
@@ -26,3 +27,15 @@ export type RenderedLocalRefCollector = (content: string) => RenderedLocalRef[];
26
27
  * source files avoids loading/applying a project plugin once per chapter.
27
28
  */
28
29
  export declare function createRenderedLocalRefCollector(customPlugins?: LoadedPlugin[]): RenderedLocalRefCollector;
30
+ /**
31
+ * Every rendered link/image of every source file, with the scaffolding the
32
+ * link checks share: the book's plugins loaded degrade-and-report (a plugin
33
+ * that will not load is pushed to `results` as an inspection failure and the
34
+ * rest is still checked — the loader's path-module cache avoids repeating
35
+ * module-level plugin side effects when another check or the build already
36
+ * loaded the same unchanged plugin), one parser reused for every chapter, and
37
+ * a file that cannot be read or parsed reported rather than thrown.
38
+ */
39
+ export declare function renderedLocalRefs(ctx: CheckContext, checkId: string, results: CheckResult[]): AsyncGenerator<RenderedLocalRef & {
40
+ file: string;
41
+ }>;