stack-site-builder 1.17.0 → 1.17.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.
package/CHANGELOG.md CHANGED
@@ -11,6 +11,25 @@ content schema, while a consuming site supplies only content, taxonomy data and
11
11
  config. Sites track the theme with `pnpm up stack-site-builder`, so each release
12
12
  here is a plain version bump they pull in.
13
13
 
14
+ ## [1.17.1] - 2026-07-22
15
+
16
+ ### Fixed
17
+
18
+ - **Mermaid never rendered on npm-consuming sites' dev server** — the loader
19
+ imported the package default (`mermaid.core.mjs`), whose bare CJS
20
+ dependencies (dayjs, …) are served without interop when the import chain
21
+ starts inside `node_modules`, killing the whole loader module with a
22
+ SyntaxError. It now imports the self-contained
23
+ `mermaid/dist/mermaid.esm.min.mjs` bundle, which loads identically in dev
24
+ and build. (The theme's own playground never hit this — its workspace
25
+ symlink resolves outside `node_modules`, so Vite prebundled mermaid.)
26
+
27
+ - **Course → slide-deck links matched nothing** — a course's `slides`
28
+ frontmatter lists locale-less deck slugs, but the detail page compared
29
+ them against raw collection ids (`ko/<deck>/index`), so the chips never
30
+ rendered and would have linked to the wrong path. Decks are now resolved
31
+ per locale via the slides helpers.
32
+
14
33
  ## [1.17.0] - 2026-07-22
15
34
 
16
35
  ### Changed
@@ -225,6 +244,7 @@ catalog sites from a thin content-only repository.
225
244
  - **Standalone development setup** — a devcontainer and a minimal `playground/`
226
245
  consuming site for developing and previewing the theme on its own.
227
246
 
247
+ [1.17.1]: https://github.com/CodeCompose7/stack-site-builder/compare/v1.17.0...v1.17.1
228
248
  [1.17.0]: https://github.com/CodeCompose7/stack-site-builder/compare/v1.16.0...v1.17.0
229
249
  [1.16.0]: https://github.com/CodeCompose7/stack-site-builder/compare/v1.15.0...v1.16.0
230
250
  [1.15.0]: https://github.com/CodeCompose7/stack-site-builder/compare/v1.14.0...v1.15.0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "stack-site-builder",
3
3
  "type": "module",
4
- "version": "1.17.0",
4
+ "version": "1.17.1",
5
5
  "license": "MIT",
6
6
  "description": "The engine behind the awesome-*-stack catalog sites: an Astro theme with the catalog/concepts/articles/slides/samples routes, components, styles and markdown pipeline. Sites provide content, taxonomy data and config.",
7
7
  "repository": {
@@ -1,7 +1,8 @@
1
1
  ---
2
- import { render, getCollection } from 'astro:content';
2
+ import { render } from 'astro:content';
3
3
  import { getRelativeLocaleUrl } from 'astro:i18n';
4
4
  import { getCourses, courseSlugOf, type CourseEntry } from '../lib/courses';
5
+ import { getDecks, deckSlugOf } from '../lib/slides';
5
6
  import { inlineMd } from '../lib/inline-md';
6
7
  import { Image } from 'astro:assets';
7
8
  import { useTranslations, type Lang } from '../i18n/ui';
@@ -33,14 +34,14 @@ const relatedCourses = data.related
33
34
  .map((sl) => courseBySlug.get(sl))
34
35
  .filter(Boolean) as CourseEntry[];
35
36
 
36
- // Decks in the `slides` collection that belong to this course. Only linked when
37
- // the slides section is enabled (otherwise its routes don't exist) and the deck
38
- // id actually resolves a typo just drops the chip instead of a dead link.
39
- const slideDecks = sectionEnabled('slides') && data.slides.length > 0
40
- ? (await getCollection('slides')).filter(
41
- (d) => data.slides.includes(d.id) && !d.data.draft,
42
- )
43
- : [];
37
+ // Decks in the `slides` collection that belong to this course, matched by
38
+ // their locale-less slug (what the frontmatter lists). Only linked when the
39
+ // slides section is enabled (otherwise its routes don't exist) and the slug
40
+ // actually resolves a typo just drops the chip instead of a dead link.
41
+ const slideDecks =
42
+ sectionEnabled('slides') && data.slides.length > 0
43
+ ? (await getDecks(lang)).filter((d) => data.slides.includes(deckSlugOf(d)))
44
+ : [];
44
45
 
45
46
  // Breadcrumb: All courses › category › subcategory… (each segment linked).
46
47
  const crumbs = [
@@ -84,7 +85,7 @@ const crumbs = [
84
85
  </span>
85
86
  {slideDecks.map((d) => (
86
87
  <a
87
- href={getRelativeLocaleUrl(lang, `slides/${d.id}/`)}
88
+ href={getRelativeLocaleUrl(lang, `slides/${deckSlugOf(d)}/`)}
88
89
  class="rounded-full border border-[var(--aas-border)] bg-[var(--aas-panel)] px-3 py-1 text-sm text-[var(--aas-text)] no-underline hover:bg-[var(--aas-tint)]"
89
90
  >
90
91
  {d.data.title}
@@ -5,7 +5,15 @@
5
5
  ---
6
6
 
7
7
  <script>
8
- import mermaid from 'mermaid';
8
+ // The self-contained browser bundle, NOT the package default: the default
9
+ // entry (mermaid.core.mjs) keeps dayjs/d3 as bare CJS imports, which break
10
+ // with a "does not provide an export named 'default'" SyntaxError in a
11
+ // CONSUMING site's dev server — the theme lives in node_modules there, so
12
+ // Vite serves the import chain raw without CJS interop. The esm.min bundle
13
+ // inlines every dependency (relative-chunk imports only), so it loads the
14
+ // same in dev and build.
15
+ // @ts-expect-error — the bundled build ships no type mapping; same API.
16
+ import mermaid from 'mermaid/dist/mermaid.esm.min.mjs';
9
17
  import { initOnReady } from '../lib/reinit';
10
18
 
11
19
  // Read the live site palette so Mermaid matches the current theme exactly.