@soubiran/vite 0.5.0 → 0.6.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.
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as Options } from "./types-DznJAci_.mjs";
1
+ import { t as Options } from "./types-D_cQ9r48.mjs";
2
2
  import { PluginOption } from "vite";
3
3
 
4
4
  //#region src/index.d.ts
package/dist/index.mjs CHANGED
@@ -10,7 +10,7 @@ import matter from "gray-matter";
10
10
  import fonts from "unplugin-fonts/vite";
11
11
  import icons from "unplugin-icons/vite";
12
12
  import markdown from "unplugin-vue-markdown/vite";
13
- import vueRouter from "unplugin-vue-router/vite";
13
+ import router from "unplugin-vue-router/vite";
14
14
  import { joinURL, withoutTrailingSlash } from "ufo";
15
15
  import { Buffer } from "node:buffer";
16
16
  import { basename, dirname, join, resolve } from "node:path";
@@ -881,14 +881,14 @@ function ssg_default() {
881
881
  //#region src/index.ts
882
882
  function soubiran(title, hostname, options) {
883
883
  return [
884
- vueRouter({
884
+ options.router === false ? void 0 : router({
885
885
  extensions: [".vue", ".md"],
886
886
  routesFolder: "pages",
887
- dts: "src/typed-router.d.ts",
887
+ dts: "src/route-map.d.ts",
888
888
  extendRoute(route) {
889
889
  const path = route.components.get("default");
890
890
  if (!path) return;
891
- if (path.endsWith(".vue")) route.addToMeta({ frontmatter: { page: options.extractPage(path) } });
891
+ if (path.endsWith(".vue") && options.router && options.router.extractPage) route.addToMeta({ frontmatter: { page: options.router.extractPage(path) } });
892
892
  if (path.endsWith(".md")) {
893
893
  const { data } = matter(readFileSync(path, "utf-8"));
894
894
  route.addToMeta({ frontmatter: data });
@@ -919,16 +919,16 @@ function soubiran(title, hostname, options) {
919
919
  },
920
920
  ui: { colors: { neutral: "neutral" } }
921
921
  }),
922
- markdown({
922
+ options.markdown === false ? void 0 : markdown({
923
923
  headEnabled: true,
924
924
  wrapperClasses: soubiranWrapperClasses,
925
- transforms: options.markdown?.transforms ?? {},
926
- wrapperComponent: options.markdown?.wrapperComponent,
925
+ transforms: options.markdown?.options?.transforms ?? {},
926
+ wrapperComponent: options.markdown?.options?.wrapperComponent,
927
927
  markdownItSetup: markdownRulesFactory(hostname),
928
928
  frontmatterPreprocess: markdownFrontmatterFactory({
929
929
  title,
930
930
  hostname,
931
- extractPage: options.extractPage,
931
+ extractPage: options.markdown.extractPage,
932
932
  assertRules: options.seo?.assert?.rules,
933
933
  getPageConfig: options.seo?.structuredData?.pageConfig
934
934
  })
@@ -17,9 +17,15 @@ interface StructuredDataPageConfig {
17
17
  }
18
18
  //#endregion
19
19
  //#region src/types.d.ts
20
+ type ExtractPage = (id: string) => string | null;
20
21
  interface Options$1 {
21
- extractPage: (id: string) => string | null;
22
- markdown?: Options;
22
+ router?: {
23
+ extractPage?: ExtractPage;
24
+ } | false;
25
+ markdown: {
26
+ extractPage: ExtractPage;
27
+ options?: Options;
28
+ } | false;
23
29
  seo?: {
24
30
  assert?: {
25
31
  rules?: AssertFn;
package/dist/types.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as StructuredDataPageConfig, r as BreadcrumbItem, t as Options } from "./types-DznJAci_.mjs";
1
+ import { n as StructuredDataPageConfig, r as BreadcrumbItem, t as Options } from "./types-D_cQ9r48.mjs";
2
2
  export { BreadcrumbItem, Options, StructuredDataPageConfig };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@soubiran/vite",
3
3
  "type": "module",
4
- "version": "0.5.0",
4
+ "version": "0.6.0",
5
5
  "author": "Estéban Soubiran <esteban@soubiran.dev>",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/Barbapapazes",
@@ -62,7 +62,7 @@
62
62
  "vite": "^8.0.1",
63
63
  "vite-ssg": "^28.3.0",
64
64
  "vue-router": "^4.6.3",
65
- "@soubiran/ui": "0.5.0"
65
+ "@soubiran/ui": "0.6.0"
66
66
  },
67
67
  "devDependencies": {
68
68
  "tsdown": "^0.21.4"