@frontfactory/vitepress-theme 1.4.0 → 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.
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/dist/style.css CHANGED
@@ -1273,7 +1273,7 @@
1273
1273
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
1274
1274
  gap: 1.5rem;
1275
1275
  max-width: var(--ff-layout-wide);
1276
- margin: 4rem auto 0;
1276
+ margin: 0 auto;
1277
1277
  padding-top: 1.75rem;
1278
1278
  border-top: var(--ff-rule-width) solid var(--ff-color-rule);
1279
1279
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontfactory/vitepress-theme",
3
- "version": "1.4.0",
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": {
@@ -367,7 +367,7 @@
367
367
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
368
368
  gap: 1.5rem;
369
369
  max-width: #{mg.ref("layout-wide")};
370
- margin: 4rem auto 0;
370
+ margin: 0 auto;
371
371
  padding-top: 1.75rem;
372
372
  border-top: #{mg.ref("rule-width")} solid #{mg.ref("color-rule")};
373
373
  }