@umami/shiso 1.3.0 → 1.5.0

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 (45) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/bin/shiso.mjs +10 -1
  3. package/config.js +8 -0
  4. package/dist/chunks/App.js +270 -66
  5. package/dist/chunks/local.js +12 -3
  6. package/dist/chunks/pagefind.js +100 -0
  7. package/dist/entry-client.js +1 -1
  8. package/dist/entry-server.js +16 -5
  9. package/dist/search.js +10 -1
  10. package/docs.schema.json +30 -27
  11. package/package.json +10 -1
  12. package/scripts/build-runtime.mjs +1 -0
  13. package/scripts/check-package.mjs +1 -0
  14. package/scripts/generate-icon-registry.mjs +12 -2
  15. package/scripts/generate-search-index.mjs +4 -3
  16. package/scripts/load-shiso-config.mjs +167 -0
  17. package/scripts/pagefind-index.mjs +127 -0
  18. package/scripts/prerender.mjs +4 -2
  19. package/scripts/validate-config.mjs +23 -10
  20. package/scripts/vite-docs-config.mjs +52 -13
  21. package/src/App.tsx +12 -3
  22. package/src/components/DocContent.tsx +18 -4
  23. package/src/components/Header.tsx +61 -24
  24. package/src/components/Search.tsx +29 -2
  25. package/src/components/TopNav.tsx +9 -7
  26. package/src/components/docs/Button.tsx +67 -0
  27. package/src/components/docs/index.ts +1 -0
  28. package/src/components/ui/command.tsx +2 -2
  29. package/src/declarations.d.ts +7 -0
  30. package/src/entry-server.tsx +20 -3
  31. package/src/lib/content.ts +10 -2
  32. package/src/lib/head.ts +15 -7
  33. package/src/lib/locale.ts +1 -1
  34. package/src/lib/paths.ts +11 -7
  35. package/src/lib/search/provider.ts +13 -2
  36. package/src/lib/search/providers/pagefind.ts +180 -0
  37. package/src/lib/search.ts +32 -4
  38. package/src/lib/site-config.ts +21 -3
  39. package/src/lib/site-model.ts +7 -2
  40. package/src/lib/standalone-pages.ts +129 -0
  41. package/src/lib/types.ts +34 -4
  42. package/src/pages/StandalonePage.tsx +42 -0
  43. package/types/config.d.ts +19 -0
  44. package/types/search.d.ts +9 -0
  45. package/vite.config.ts +58 -18
package/CHANGELOG.md CHANGED
@@ -3,6 +3,23 @@
3
3
  All notable changes to `@umami/shiso` are documented here. This project follows
4
4
  [Semantic Versioning](https://semver.org/).
5
5
 
6
+ ## 2.0.0 - 2026-08-21
7
+
8
+ ### Breaking
9
+
10
+ - Move project settings (`docsPrefix`, `contentDir`, `siteUrl`, `locale`) from
11
+ the `$shiso` key in docs.json to a new optional `shiso.config.ts` file at the
12
+ project root. `shiso check` now rejects docs.json files that still contain
13
+ `$shiso` with a migration message.
14
+
15
+ ### Added
16
+
17
+ - New `@umami/shiso/config` export providing `defineConfig` and the
18
+ `ShisoConfig` type for shiso.config.ts.
19
+ - `shiso.config.ts`, `shiso.config.mjs`, and `shiso.config.js` are supported;
20
+ the file is optional and defaults apply when absent. Config edits (and
21
+ creating the file) hot-reload during development.
22
+
6
23
  ## 1.1.11 - 2026-08-19
7
24
 
8
25
  ### Changed
package/bin/shiso.mjs CHANGED
@@ -5,6 +5,7 @@ import fs from 'node:fs/promises';
5
5
  import path from 'node:path';
6
6
  import process from 'node:process';
7
7
  import { fileURLToPath } from 'node:url';
8
+ import { loadShisoConfig } from '../scripts/load-shiso-config.mjs';
8
9
  import { validateProject } from '../scripts/validate-config.mjs';
9
10
 
10
11
  const PACKAGE_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
@@ -22,7 +23,7 @@ Commands:
22
23
  dev Start the development server
23
24
  build Validate and build the static site
24
25
  preview Preview the production build
25
- check Validate docs.json
26
+ check Validate docs.json and shiso.config
26
27
 
27
28
  Options after dev, build, or preview are passed to Vite.
28
29
  `;
@@ -55,6 +56,13 @@ async function check(projectRoot) {
55
56
  }
56
57
 
57
58
  console.log('docs.json is valid.');
59
+
60
+ // Fails fast on a broken shiso.config.* before any Vite build starts.
61
+ const shiso = await loadShisoConfig({ root: projectRoot });
62
+
63
+ if (shiso.sourcePath) {
64
+ console.log(`${path.basename(shiso.sourcePath)} loaded.`);
65
+ }
58
66
  }
59
67
 
60
68
  async function main() {
@@ -116,6 +124,7 @@ async function main() {
116
124
  projectRoot,
117
125
  );
118
126
  run(process.execPath, [path.join(PACKAGE_ROOT, 'scripts/prerender.mjs')], projectRoot);
127
+ run(process.execPath, [path.join(PACKAGE_ROOT, 'scripts/pagefind-index.mjs')], projectRoot);
119
128
  return;
120
129
  }
121
130
 
package/config.js ADDED
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Identity helper that gives shiso.config.ts typing today and room for future
3
+ * config forms (functions, plugins) without another migration. Ships as plain
4
+ * JS so it resolves under Node and jiti with no build step or dependencies.
5
+ */
6
+ export function defineConfig(config) {
7
+ return config;
8
+ }