From 947edf401fcdb4c88f4003701517405cea43ac07 Mon Sep 17 00:00:00 2001 From: Fajrian Aidil Pratama Date: Fri, 23 Oct 2026 22:20:04 +0700 Subject: [PATCH 1/2] hotfix(1.6.1): publish window.Prism before the language grammars load The production build failed with 'Prism is not defined': the Home page rendered no content and no docs page showed its code panel. The grammars in prismjs/components call a global Prism, and the bundler does not guarantee that the core publishes it first. A small prism-global module sets it explicitly before any grammar is imported. Checked on the built site: Home and all 21 docs sections render, and every code panel is highlighted. --- src/lib/prism-global.ts | 8 ++++++++ src/lib/prism-setup.ts | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 src/lib/prism-global.ts diff --git a/src/lib/prism-global.ts b/src/lib/prism-global.ts new file mode 100644 index 0000000..93d0aa2 --- /dev/null +++ b/src/lib/prism-global.ts @@ -0,0 +1,8 @@ +import Prism from 'prismjs' + +// The language grammars in prismjs/components call a global `Prism`. Publish it in its own +// module so it exists before any grammar loads. The bundler does not guarantee that order +// for a side-effect import, and the production build failed with "Prism is not defined". +;(globalThis as { Prism?: typeof Prism }).Prism = Prism + +export default Prism diff --git a/src/lib/prism-setup.ts b/src/lib/prism-setup.ts index a42ce7f..89819f7 100644 --- a/src/lib/prism-setup.ts +++ b/src/lib/prism-setup.ts @@ -1,7 +1,7 @@ -import Prism from 'prismjs' +import Prism from './prism-global' // Grammars register on the Prism singleton, so they must live in this one file -// (and one chunk) with the core. Only the languages the docs show are loaded. +// (and one chunk) with the core. prism-global publishes window.Prism first. Only the languages the docs show are loaded. import 'prismjs/components/prism-bash' import 'prismjs/components/prism-json' import 'prismjs/components/prism-python' From 5c5ea52db094ed77c7e5de451da073bdf7272884 Mon Sep 17 00:00:00 2001 From: Fajrian Aidil Pratama Date: Fri, 23 Oct 2026 22:20:04 +0700 Subject: [PATCH 2/2] chore: bump version to 1.6.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7ae4b42..cb1796f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pico-api-docs", - "version": "1.6.0", + "version": "1.6.1", "description": "PICO SulTeng API Documentation - COVID-19 Sulawesi Tengah Data API", "main": "index.js", "scripts": {