@canopy-iiif/app 0.9.7 → 0.9.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.
package/lib/AGENTS.md CHANGED
@@ -62,7 +62,7 @@ Logbook
62
62
  -------
63
63
  - 2025-09-26 / chatgpt: Hardened runtime bundlers to throw when esbuild or source compilation fails and required `content/works/_layout.mdx`; build now aborts instead of silently writing placeholder assets.
64
64
  - 2025-09-26 / chatgpt: Replaced the legacy command runtime stub with an esbuild-bundled runtime (`search/search-form-runtime.js`); `prepareSearchFormRuntime()` now builds `site/scripts/canopy-search-form.js` and fails if esbuild is missing.
65
- - 2025-09-27 / chatgpt: Documented Tailwind token flow in `app/styles/tailwind.config.js`, compiled UI Sass variables during config load, and exposed `stylesheetHref`/`Stylesheet` helpers via `@canopy-iiif/app/head` so `_app.mdx` can reference the generated CSS directly.
65
+ - 2025-09-27 / chatgpt: Documented Tailwind token flow in `app/styles/tailwind.config.mts`, compiled UI Sass variables during config load, and exposed `stylesheetHref`/`Stylesheet` helpers via `@canopy-iiif/app/head` so `_app.mdx` can reference the generated CSS directly.
66
66
  - 2025-09-27 / chatgpt: Expanded search indexing to harvest MDX pages (respecting frontmatter/layout types), injected BASE_PATH hydration data into search.html, and reworked `mdx.extractTitle()` so generated records surface real headings instead of `Untitled`.
67
67
 
68
68
  Verification Commands
package/lib/build/dev.js CHANGED
@@ -3,7 +3,6 @@ const fsp = fs.promises;
3
3
  const path = require("path");
4
4
  const { spawn, spawnSync } = require("child_process");
5
5
  const http = require("http");
6
- const url = require("url");
7
6
  const {
8
7
  CONTENT_DIR,
9
8
  OUT_DIR,
@@ -558,8 +557,14 @@ function startServer() {
558
557
  onCssChange = () => broadcast("css");
559
558
 
560
559
  const server = http.createServer((req, res) => {
561
- const parsed = url.parse(req.url || "/");
562
- let pathname = decodeURI(parsed.pathname || "/");
560
+ const origin = `http://${req.headers.host || `localhost:${PORT}`}`;
561
+ let parsedUrl;
562
+ try {
563
+ parsedUrl = new URL(req.url || "/", origin);
564
+ } catch (_) {
565
+ parsedUrl = new URL("/", origin);
566
+ }
567
+ let pathname = decodeURI(parsedUrl.pathname || "/");
563
568
  // Serve dev toast assets and config
564
569
  if (pathname === "/__livereload-config") {
565
570
  res.writeHead(200, {
@@ -801,12 +806,14 @@ async function dev() {
801
806
  "tailwind.config.js",
802
807
  "tailwind.config.cjs",
803
808
  "tailwind.config.mjs",
809
+ "tailwind.config.mts",
804
810
  "tailwind.config.ts",
805
811
  ].map((n) => path.join(root, n));
806
812
  const twConfigsApp = [
807
813
  "tailwind.config.js",
808
814
  "tailwind.config.cjs",
809
815
  "tailwind.config.mjs",
816
+ "tailwind.config.mts",
810
817
  "tailwind.config.ts",
811
818
  ].map((n) => path.join(appStylesDir, n));
812
819
  const configPath = [...twConfigsApp, ...twConfigsRoot].find((p) => {
@@ -818,7 +825,7 @@ async function dev() {
818
825
  });
819
826
  if (!configPath) {
820
827
  throw new Error(
821
- "[tailwind] Missing Tailwind config. Expected app/styles/tailwind.config.{js,cjs,mjs,ts} or a root-level Tailwind config."
828
+ "[tailwind] Missing Tailwind config. Expected app/styles/tailwind.config.{js,cjs,mjs,mts,ts} or a root-level Tailwind config."
822
829
  );
823
830
  }
824
831
  const inputCandidates = [
@@ -20,12 +20,14 @@ async function ensureStyles() {
20
20
  path.join(root, "tailwind.config.js"),
21
21
  path.join(root, "tailwind.config.cjs"),
22
22
  path.join(root, "tailwind.config.mjs"),
23
+ path.join(root, "tailwind.config.mts"),
23
24
  path.join(root, "tailwind.config.ts"),
24
25
  ];
25
26
  const twConfigsApp = [
26
27
  path.join(appStylesDir, "tailwind.config.js"),
27
28
  path.join(appStylesDir, "tailwind.config.cjs"),
28
29
  path.join(appStylesDir, "tailwind.config.mjs"),
30
+ path.join(appStylesDir, "tailwind.config.mts"),
29
31
  path.join(appStylesDir, "tailwind.config.ts"),
30
32
  ];
31
33
  let configPath = [...twConfigsApp, ...twConfigsRoot].find((p) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canopy-iiif/app",
3
- "version": "0.9.7",
3
+ "version": "0.9.9",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "Mat Jordan <mat@northwestern.edu>",