@dogsbay/ssg 0.2.0-beta.139 → 0.2.0-beta.141

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.
@@ -1,31 +1,31 @@
1
1
  Third-party software in @dogsbay/ssg (dist/package/)
2
2
 
3
3
  ========================================================================
4
- @dogsbay/elements@0.2.0-beta.139 (MIT)
4
+ @dogsbay/elements@0.2.0-beta.141 (MIT)
5
5
  https://github.com/dogsbay/dogsbay.git
6
6
 
7
7
  Licensed under MIT; the package ships no licence file.
8
8
 
9
9
  ========================================================================
10
- @dogsbay/primitives@0.2.0-beta.139 (MIT)
10
+ @dogsbay/primitives@0.2.0-beta.141 (MIT)
11
11
  https://github.com/dogsbay/dogsbay.git
12
12
 
13
13
  Licensed under MIT; the package ships no licence file.
14
14
 
15
15
  ========================================================================
16
- @dogsbay/render-html@0.2.0-beta.139 (MIT)
16
+ @dogsbay/render-html@0.2.0-beta.141 (MIT)
17
17
  https://github.com/dogsbay/dogsbay.git
18
18
 
19
19
  Licensed under MIT; the package ships no licence file.
20
20
 
21
21
  ========================================================================
22
- @dogsbay/search@0.2.0-beta.139 (MIT)
22
+ @dogsbay/search@0.2.0-beta.141 (MIT)
23
23
  https://github.com/dogsbay/dogsbay.git
24
24
 
25
25
  Licensed under MIT; the package ships no licence file.
26
26
 
27
27
  ========================================================================
28
- @dogsbay/ui@0.2.0-beta.139 (MIT)
28
+ @dogsbay/ui@0.2.0-beta.141 (MIT)
29
29
  https://github.com/dogsbay/dogsbay.git
30
30
 
31
31
  Licensed under MIT; the package ships no licence file.
@@ -1085,31 +1085,31 @@ var CLIENT_CANDIDATES = ['""', '"&"', '"\\\\$&")).join("|")})', '"\\\\$&")}"', '
1085
1085
  var SITE_NOTICES = `Third-party software in this site's _dogsbay/ files (dogsbay.js, site.css) and pages
1086
1086
 
1087
1087
  ========================================================================
1088
- @dogsbay/elements@0.2.0-beta.139 (MIT)
1088
+ @dogsbay/elements@0.2.0-beta.141 (MIT)
1089
1089
  https://github.com/dogsbay/dogsbay.git
1090
1090
 
1091
1091
  Licensed under MIT; the package ships no licence file.
1092
1092
 
1093
1093
  ========================================================================
1094
- @dogsbay/primitives@0.2.0-beta.139 (MIT)
1094
+ @dogsbay/primitives@0.2.0-beta.141 (MIT)
1095
1095
  https://github.com/dogsbay/dogsbay.git
1096
1096
 
1097
1097
  Licensed under MIT; the package ships no licence file.
1098
1098
 
1099
1099
  ========================================================================
1100
- @dogsbay/render-html@0.2.0-beta.139 (MIT)
1100
+ @dogsbay/render-html@0.2.0-beta.141 (MIT)
1101
1101
  https://github.com/dogsbay/dogsbay.git
1102
1102
 
1103
1103
  Licensed under MIT; the package ships no licence file.
1104
1104
 
1105
1105
  ========================================================================
1106
- @dogsbay/search@0.2.0-beta.139 (MIT)
1106
+ @dogsbay/search@0.2.0-beta.141 (MIT)
1107
1107
  https://github.com/dogsbay/dogsbay.git
1108
1108
 
1109
1109
  Licensed under MIT; the package ships no licence file.
1110
1110
 
1111
1111
  ========================================================================
1112
- @dogsbay/ui@0.2.0-beta.139 (MIT)
1112
+ @dogsbay/ui@0.2.0-beta.141 (MIT)
1113
1113
  https://github.com/dogsbay/dogsbay.git
1114
1114
 
1115
1115
  Licensed under MIT; the package ships no licence file.
@@ -3486,6 +3486,7 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path, read2),
3486
3486
  const diagrams = state.diagrams;
3487
3487
  const taxonomies = cfg.taxonomies.length ? new TaxonomyCollector(cfg.taxonomies) : void 0;
3488
3488
  const blog = cfg.blog ? new BlogCollector(cfg.blog) : void 0;
3489
+ state.scanned?.(unit, "start");
3489
3490
  const infos = /* @__PURE__ */ new Map();
3490
3491
  const stubTargets = /* @__PURE__ */ new Map();
3491
3492
  const frontMatter = /* @__PURE__ */ new Map();
@@ -3782,6 +3783,7 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path, read2),
3782
3783
  let search = cfg.search && cfg.searchEngine !== "pagefind" ? new SearchIndexBuilder({ lang: unit.locale ?? cfg.defaultLocale ?? "en" }) : void 0;
3783
3784
  const siteDepthPrefix = unit.prefix ? "../".repeat(unit.prefix.split("/").length) : "";
3784
3785
  phase.scan = (phase.scan ?? 0) + now() - t;
3786
+ state.scanned?.(unit, "end");
3785
3787
  input.onUnitAssets?.(unit.prefix, assetPaths);
3786
3788
  if (diagrams) {
3787
3789
  t = now();
@@ -4879,6 +4881,14 @@ async function openDevSession(input, o = {}) {
4879
4881
  let buildError;
4880
4882
  let buildProblem;
4881
4883
  let diagnosed = /* @__PURE__ */ new Map();
4884
+ let scanProblems = /* @__PURE__ */ new Map();
4885
+ const watchScan = (c, into) => {
4886
+ let from = 0;
4887
+ c.state.scanned = (unit, at) => {
4888
+ if (at === "start") from = c.problems.length;
4889
+ else into.set(unit.prefix, c.problems.slice(from));
4890
+ };
4891
+ };
4882
4892
  const failed = (e) => {
4883
4893
  buildError = e.message || String(e);
4884
4894
  buildProblem = problemOf(e, buildError);
@@ -4887,6 +4897,7 @@ async function openDevSession(input, o = {}) {
4887
4897
  const next = /* @__PURE__ */ new Map();
4888
4898
  const nextUnits = /* @__PURE__ */ new Map();
4889
4899
  const nextDiagnosed = /* @__PURE__ */ new Map();
4900
+ const nextScan = /* @__PURE__ */ new Map();
4890
4901
  let nextCtx;
4891
4902
  const sink = async (path, content) => {
4892
4903
  next.set(path, isStream(content) ? await joinChunks(content.chunks()) : content);
@@ -4908,7 +4919,10 @@ async function openDevSession(input, o = {}) {
4908
4919
  {
4909
4920
  keep: true,
4910
4921
  lazy: o.lazy,
4911
- context: (c) => nextCtx = c,
4922
+ context: (c) => {
4923
+ nextCtx = c;
4924
+ watchScan(c, nextScan);
4925
+ },
4912
4926
  diagnostics: (f, list) => nextDiagnosed.set(f, list),
4913
4927
  // A copy: the build keeps adding the classes of pages it renders later to its own set.
4914
4928
  unitBuilt: (unit, handle, classes) => nextUnits.set(unit.prefix, { unit, handle, classes: new Set(classes) })
@@ -4922,6 +4936,7 @@ async function openDevSession(input, o = {}) {
4922
4936
  units = nextUnits;
4923
4937
  ctx = nextCtx;
4924
4938
  diagnosed = nextDiagnosed;
4939
+ scanProblems = nextScan;
4925
4940
  config = nextCtx?.cfg ?? nextConfig;
4926
4941
  taken = 0;
4927
4942
  takenProblems = 0;
@@ -5052,7 +5067,11 @@ async function openDevSession(input, o = {}) {
5052
5067
  get,
5053
5068
  async change(paths) {
5054
5069
  const t0 = Date.now();
5055
- const done = (r) => ({ ...r, ms: Date.now() - t0 });
5070
+ const before = allFiles();
5071
+ const done = (r, marked) => {
5072
+ const stale2 = marked ?? /* @__PURE__ */ new Set([...before, ...allFiles()]);
5073
+ return { ...r, stale: [...stale2].sort(), ms: Date.now() - t0 };
5074
+ };
5056
5075
  try {
5057
5076
  if (buildError !== void 0) {
5058
5077
  await full();
@@ -5060,14 +5079,33 @@ async function openDevSession(input, o = {}) {
5060
5079
  buildProblem = void 0;
5061
5080
  return done({ css: true, handled: "full" });
5062
5081
  }
5063
- return done(await budgeted(() => changeParts(paths)));
5082
+ const marked = /* @__PURE__ */ new Set();
5083
+ const r = await budgeted(() => changeParts(paths, marked));
5084
+ return done(r, r.handled === "full" ? void 0 : marked);
5064
5085
  } catch (e) {
5065
5086
  failed(e);
5066
- return done({ css: false, handled: "full" });
5087
+ return done({ css: false, handled: "full" }, /* @__PURE__ */ new Set());
5067
5088
  }
5068
5089
  }
5069
5090
  };
5070
- async function changeParts(paths) {
5091
+ function allFiles() {
5092
+ const all = /* @__PURE__ */ new Set();
5093
+ for (const u of units.values()) for (const o2 of u.handle.pageOuts) {
5094
+ const src = u.handle.sourceForPage(o2);
5095
+ if (src !== void 0) all.add(src);
5096
+ }
5097
+ for (const list of scanProblems.values()) for (const p of list) if (p.file !== void 0) all.add(p.file);
5098
+ return all;
5099
+ }
5100
+ async function changeParts(paths, marked) {
5101
+ const again = /* @__PURE__ */ new Map();
5102
+ const markStale = (page, u = unitForSitePath(page), rebuilt = false) => {
5103
+ stale.add(page);
5104
+ const src = u?.handle.sourceForPage(page);
5105
+ if (src === void 0) return;
5106
+ marked.add(src);
5107
+ if (!rebuilt) again.set(src, u.unit.prefix);
5108
+ };
5071
5109
  const themeDir = config.themeDir ? config.themeDir.replace(/\/+$/, "") + "/" : void 0;
5072
5110
  const extraCss = new Set(config.css.map((c) => c.replace(/^\.\//, "")));
5073
5111
  const lazy = /* @__PURE__ */ new Set();
@@ -5113,7 +5151,7 @@ async function openDevSession(input, o = {}) {
5113
5151
  }
5114
5152
  x.handle.invalidateData();
5115
5153
  for (const page of x.handle.dataReaders(p)) {
5116
- stale.add(page);
5154
+ markStale(page, x);
5117
5155
  mark("page");
5118
5156
  }
5119
5157
  }
@@ -5126,7 +5164,7 @@ async function openDevSession(input, o = {}) {
5126
5164
  const page = u.handle.pageForSource(p);
5127
5165
  const text = content === void 0 ? void 0 : await textOf(content);
5128
5166
  if (page && text !== void 0 && u.handle.sameFrontMatter(p, text) && !u.handle.included(p)) {
5129
- stale.add(page);
5167
+ markStale(page, u);
5130
5168
  mark("page");
5131
5169
  } else {
5132
5170
  u.handle.forget(p);
@@ -5157,21 +5195,30 @@ async function openDevSession(input, o = {}) {
5157
5195
  if (unitForSitePath(key) === u) out.delete(key);
5158
5196
  }
5159
5197
  for (const s of [...stale]) if (unitForSitePath(s) === u) stale.delete(s);
5198
+ for (const o2 of u.handle.pageOuts) {
5199
+ const src = u.handle.sourceForPage(o2);
5200
+ if (src !== void 0) marked.add(src);
5201
+ }
5202
+ const named = (list) => {
5203
+ for (const p of list ?? []) if (p.file !== void 0) marked.add(p.file);
5204
+ };
5205
+ named(scanProblems.get(prefix));
5160
5206
  const handle = await rebuildUnitLazy({ ...ctx, emit: emitInto }, u.unit);
5207
+ named(scanProblems.get(prefix));
5161
5208
  const next = { ...u, handle };
5162
5209
  units.set(prefix, next);
5163
- for (const o2 of handle.pageOuts) stale.add(o2);
5210
+ for (const o2 of handle.pageOuts) markStale(o2, next, true);
5164
5211
  }
5165
5212
  if (config.defaultVersion && [...lazy].some((prefix) => units.get(prefix)?.unit.version === config.defaultVersion)) {
5166
5213
  const all = [...units.values()].map((u) => u.unit);
5167
5214
  ctx.state.canonical = await defaultTables(config, all, all, input.files, readText);
5168
- for (const u of units.values()) if (u.unit.version !== config.defaultVersion) for (const o2 of u.handle.pageOuts) stale.add(o2);
5215
+ for (const u of units.values()) if (u.unit.version !== config.defaultVersion) for (const o2 of u.handle.pageOuts) markStale(o2, u);
5169
5216
  }
5170
5217
  if (lazy.size && ctx.state.languages) {
5171
5218
  const all = [...units.values()].map((u) => u.unit);
5172
5219
  const versions = new Set([...lazy].map((prefix) => units.get(prefix)?.unit.version));
5173
5220
  ctx.state.languages = await languageTables(config, all, all, input.files, readText);
5174
- for (const u of units.values()) if (versions.has(u.unit.version) && !lazy.has(u.unit.prefix)) for (const o2 of u.handle.pageOuts) stale.add(o2);
5221
+ for (const u of units.values()) if (versions.has(u.unit.version) && !lazy.has(u.unit.prefix)) for (const o2 of u.handle.pageOuts) markStale(o2, u);
5175
5222
  }
5176
5223
  if (lazy.size) {
5177
5224
  const all = [...units.values()].map((u) => u.unit);
@@ -5187,6 +5234,14 @@ async function openDevSession(input, o = {}) {
5187
5234
  (p) => stale.has(p)
5188
5235
  );
5189
5236
  }
5237
+ for (const [src, prefix] of again) {
5238
+ if (lazy.has(prefix)) continue;
5239
+ for (const p of scanProblems.get(prefix) ?? []) {
5240
+ if (p.file !== src) continue;
5241
+ ctx.problems.push(p);
5242
+ ctx.warnings.push(p.text);
5243
+ }
5244
+ }
5190
5245
  return { css: false, handled };
5191
5246
  }
5192
5247
  async function attributesOnly() {
@@ -226,6 +226,8 @@ export interface SiteState {
226
226
  stubs: string[];
227
227
  /** A dev session's: what pass 1 read from each page, kept between its rebuilds (src/core/scan-cache.ts). */
228
228
  scan?: ScanCache;
229
+ /** A dev session's: called as each unit's pass 1 starts and ends, so it knows which problems pass 1 reported (src/core/dev.ts). */
230
+ scanned?: (unit: BuildUnit, at: "start" | "end") => void;
229
231
  /** Included templates' parses (false: none kept), kept as long as the state: a dev session's unit rebuilds keep it. */
230
232
  parseCache: ParseCache | false;
231
233
  /** Template time left for the build, or for a dev session's current request. */
@@ -76,6 +76,15 @@ export interface ChangeResult {
76
76
  * their pages), `page` (pages marked stale), `asset` (files replaced), `none` (nothing it builds).
77
77
  */
78
78
  handled: "full" | "unit" | "page" | "asset" | "none";
79
+ /**
80
+ * The source files (project paths) of the pages whose earlier warnings no longer stand: drop
81
+ * them, then read `takeProblems()`. A listed page that still exists renders again when asked for
82
+ * (`get`, `diagnostics`), and its warnings are in `takeProblems()` once that resolves, so one that
83
+ * brings none is clean. Removed pages are listed too. After a `full` change, every page before
84
+ * and after, and `takeProblems()` starts again from the first. Pages with no source file (tag
85
+ * pages, translation stubs) are not listed; pages not listed keep their warnings.
86
+ */
87
+ stale: string[];
79
88
  ms: number;
80
89
  }
81
90
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dogsbay/ssg",
3
- "version": "0.2.0-beta.139",
3
+ "version": "0.2.0-beta.141",
4
4
  "type": "module",
5
5
  "description": "Documentation static site generator for Dogsbay-MD that builds inside Cloudflare Workers and publishes sites that work offline",
6
6
  "license": "Apache-2.0",
@@ -49,38 +49,38 @@
49
49
  "tailwindcss": "^4.3.2"
50
50
  },
51
51
  "peerDependencies": {
52
- "@dogsbay/elements": "0.2.0-beta.139",
53
- "@dogsbay/format-dogsbay-md": "0.2.0-beta.139",
54
- "@dogsbay/format-openapi": "0.2.0-beta.139",
55
- "@dogsbay/format-topicmap": "0.2.0-beta.139",
56
- "@dogsbay/highlight": "0.2.0-beta.139",
57
- "@dogsbay/minja": "0.2.0-beta.139",
58
- "@dogsbay/primitives": "0.2.0-beta.139",
59
- "@dogsbay/render-html": "0.2.0-beta.139",
60
- "@dogsbay/search": "0.2.0-beta.139",
61
- "@dogsbay/serialize-core": "0.2.0-beta.139",
62
- "@dogsbay/site-check": "0.2.0-beta.139",
63
- "@dogsbay/site-files": "0.2.0-beta.139",
64
- "@dogsbay/types": "0.2.0-beta.139"
52
+ "@dogsbay/elements": "0.2.0-beta.141",
53
+ "@dogsbay/format-dogsbay-md": "0.2.0-beta.141",
54
+ "@dogsbay/format-openapi": "0.2.0-beta.141",
55
+ "@dogsbay/format-topicmap": "0.2.0-beta.141",
56
+ "@dogsbay/highlight": "0.2.0-beta.141",
57
+ "@dogsbay/minja": "0.2.0-beta.141",
58
+ "@dogsbay/primitives": "0.2.0-beta.141",
59
+ "@dogsbay/render-html": "0.2.0-beta.141",
60
+ "@dogsbay/search": "0.2.0-beta.141",
61
+ "@dogsbay/serialize-core": "0.2.0-beta.141",
62
+ "@dogsbay/site-check": "0.2.0-beta.141",
63
+ "@dogsbay/site-files": "0.2.0-beta.141",
64
+ "@dogsbay/types": "0.2.0-beta.141"
65
65
  },
66
66
  "devDependencies": {
67
67
  "@axe-core/playwright": "^4.12.1",
68
68
  "@cloudflare/workers-types": "^5.20260921.1",
69
- "@dogsbay/elements": "0.2.0-beta.139",
70
- "@dogsbay/format-dogsbay-md": "0.2.0-beta.139",
71
- "@dogsbay/format-openapi": "0.2.0-beta.139",
72
- "@dogsbay/format-topicmap": "0.2.0-beta.139",
73
- "@dogsbay/highlight": "0.2.0-beta.139",
74
- "@dogsbay/icons": "0.2.0-beta.139",
75
- "@dogsbay/minja": "0.2.0-beta.139",
76
- "@dogsbay/primitives": "0.2.0-beta.139",
77
- "@dogsbay/render-html": "0.2.0-beta.139",
78
- "@dogsbay/search": "0.2.0-beta.139",
79
- "@dogsbay/serialize-core": "0.2.0-beta.139",
80
- "@dogsbay/site-check": "0.2.0-beta.139",
81
- "@dogsbay/site-files": "0.2.0-beta.139",
82
- "@dogsbay/types": "0.2.0-beta.139",
83
- "@dogsbay/ui": "0.2.0-beta.139",
69
+ "@dogsbay/elements": "0.2.0-beta.141",
70
+ "@dogsbay/format-dogsbay-md": "0.2.0-beta.141",
71
+ "@dogsbay/format-openapi": "0.2.0-beta.141",
72
+ "@dogsbay/format-topicmap": "0.2.0-beta.141",
73
+ "@dogsbay/highlight": "0.2.0-beta.141",
74
+ "@dogsbay/icons": "0.2.0-beta.141",
75
+ "@dogsbay/minja": "0.2.0-beta.141",
76
+ "@dogsbay/primitives": "0.2.0-beta.141",
77
+ "@dogsbay/render-html": "0.2.0-beta.141",
78
+ "@dogsbay/search": "0.2.0-beta.141",
79
+ "@dogsbay/serialize-core": "0.2.0-beta.141",
80
+ "@dogsbay/site-check": "0.2.0-beta.141",
81
+ "@dogsbay/site-files": "0.2.0-beta.141",
82
+ "@dogsbay/types": "0.2.0-beta.141",
83
+ "@dogsbay/ui": "0.2.0-beta.141",
84
84
  "@mermanjs/web": "0.7.0",
85
85
  "@playwright/test": "1.61.1",
86
86
  "@types/node": "^22.10.0",