@frontfactory/vitepress-theme 1.4.1 → 1.4.2

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 (2) hide show
  1. package/config.js +9 -3
  2. package/package.json +1 -1
package/config.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { resolve } from 'node:path'
2
+ import { searchForWorkspaceRoot } from 'vite'
2
3
 
3
4
  const dir = import.meta.dirname
4
5
  const pkg = '@frontfactory/vitepress-theme'
@@ -23,8 +24,13 @@ const alias = Object.entries(overrides).map(([name, file]) => ({
23
24
  * https://vitepress.dev/guide/custom-theme#distributing-a-custom-theme.
24
25
  *
25
26
  * Swaps the components the theme replaces, keeps the package out of dependency pre-bundling and
26
- * SSR externalisation, and lets Vite serve a locally linked checkout. `transformHead` injects the
27
- * inline script that keeps a dismissed banner from painting — it needs the banner id from the
27
+ * SSR externalisation, and lets Vite serve a locally linked checkout. The `fs.allow` entry adds to
28
+ * Vite's default allow list rather than replacing it — `dir` is only needed on top of it, for the
29
+ * case where the theme is npm-linked from outside the host project's own root (this repo's
30
+ * playground, `npm link`). Replacing the list instead of extending it used to lock the dev server
31
+ * out of the host project's own files whenever the theme was installed as a normal dependency
32
+ * (e.g. on StackBlitz), because `dir` then points inside `node_modules`. `transformHead` injects
33
+ * the inline script that keeps a dismissed banner from painting — it needs the banner id from the
28
34
  * host's own themeConfig, which is only known once VitePress has resolved the merged config, so it
29
35
  * cannot be a static head entry here.
30
36
  */
@@ -33,7 +39,7 @@ const config = {
33
39
  resolve: { alias },
34
40
  optimizeDeps: { exclude: [pkg] },
35
41
  ssr: { noExternal: [pkg] },
36
- server: { fs: { allow: [dir] } }
42
+ server: { fs: { allow: [dir, searchForWorkspaceRoot(process.cwd())] } }
37
43
  },
38
44
  transformHead({ siteData }) {
39
45
  const id = siteData.themeConfig?.ff?.banner?.id
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontfactory/vitepress-theme",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "Editorial VitePress theme — hairline rules, numbered sections and monospaced metadata.",
5
5
  "type": "module",
6
6
  "scripts": {