@soubiran/vite 0.4.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.
@@ -0,0 +1,42 @@
1
+ import { Options } from "unplugin-vue-markdown/types";
2
+
3
+ //#region src/markdown/assert.d.ts
4
+ type AssertFn = (id: string, frontmatter: Record<string, any>) => void;
5
+ //#endregion
6
+ //#region src/markdown/structured-data/schemas/types.d.ts
7
+ interface BreadcrumbItem {
8
+ title: string;
9
+ type?: 'WebSite' | 'WebPage';
10
+ url?: string;
11
+ }
12
+ //#endregion
13
+ //#region src/markdown/structured-data/types.d.ts
14
+ interface StructuredDataPageConfig {
15
+ type: 'article' | 'collection' | 'default';
16
+ breadcrumbItems?: BreadcrumbItem[];
17
+ }
18
+ //#endregion
19
+ //#region src/types.d.ts
20
+ type ExtractPage = (id: string) => string | null;
21
+ interface Options$1 {
22
+ router?: {
23
+ extractPage?: ExtractPage;
24
+ } | false;
25
+ markdown: {
26
+ extractPage: ExtractPage;
27
+ options?: Options;
28
+ } | false;
29
+ seo?: {
30
+ assert?: {
31
+ rules?: AssertFn;
32
+ };
33
+ structuredData?: {
34
+ pageConfig?: (page: string | null, frontmatter: Record<string, any>) => StructuredDataPageConfig;
35
+ };
36
+ };
37
+ api?: {
38
+ categories?: string[];
39
+ };
40
+ }
41
+ //#endregion
42
+ export { StructuredDataPageConfig as n, BreadcrumbItem as r, Options$1 as t };
@@ -0,0 +1,2 @@
1
+ import { n as StructuredDataPageConfig, r as BreadcrumbItem, t as Options } from "./types-D_cQ9r48.mjs";
2
+ export { BreadcrumbItem, Options, StructuredDataPageConfig };
package/dist/types.mjs ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ import { joinURL, withoutTrailingSlash } from "ufo";
2
+ //#region src/constants.ts
3
+ const markdownExtensionRE = /\.md$/;
4
+ const vueExtensionRE = /\.vue$/;
5
+ const indexSuffixRE = /index$/;
6
+ const vueIncludePatterns = [vueExtensionRE, markdownExtensionRE];
7
+ const componentIncludePatterns = [
8
+ vueExtensionRE,
9
+ /\.vue\?vue/,
10
+ markdownExtensionRE
11
+ ];
12
+ //#endregion
13
+ //#region src/utils.ts
14
+ function getUri(id) {
15
+ return withoutTrailingSlash(id.split("/pages/")[1].replace(markdownExtensionRE, "").replace(vueExtensionRE, "").replace(indexSuffixRE, ""));
16
+ }
17
+ function toUrl(hostname, ...paths) {
18
+ return joinURL(`https://${hostname}`, ...paths);
19
+ }
20
+ //#endregion
21
+ export { vueIncludePatterns as a, markdownExtensionRE as i, toUrl as n, componentIncludePatterns as r, getUri as t };
package/dist/utils.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import { n as toUrl, t as getUri } from "./utils-DYsc-HAW.mjs";
2
+ export { getUri, toUrl };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@soubiran/vite",
3
3
  "type": "module",
4
- "version": "0.4.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",
@@ -13,16 +13,20 @@
13
13
  "bugs": "https://github.com/Barbapapazes/.soubiran.dev/issues",
14
14
  "exports": {
15
15
  ".": {
16
- "types": "./dist/vite.config.d.ts",
17
- "import": "./dist/vite.config.mjs"
16
+ "types": "./dist/index.d.mts",
17
+ "import": "./dist/index.mjs"
18
18
  },
19
19
  "./utils": {
20
- "types": "./dist/src/utils.d.ts",
21
- "import": "./dist/src/utils.mjs"
20
+ "types": "./dist/utils.d.mts",
21
+ "import": "./dist/utils.mjs"
22
+ },
23
+ "./types": {
24
+ "types": "./dist/types.d.mts",
25
+ "import": "./dist/types.mjs"
22
26
  }
23
27
  },
24
- "main": "dist/vite.config.mjs",
25
- "types": "dist/vite.config.d.ts",
28
+ "main": "dist/index.mjs",
29
+ "types": "dist/index.d.mts",
26
30
  "files": [
27
31
  "dist"
28
32
  ],
@@ -58,7 +62,7 @@
58
62
  "vite": "^8.0.1",
59
63
  "vite-ssg": "^28.3.0",
60
64
  "vue-router": "^4.6.3",
61
- "@soubiran/ui": "0.4.0"
65
+ "@soubiran/ui": "0.6.0"
62
66
  },
63
67
  "devDependencies": {
64
68
  "tsdown": "^0.21.4"
@@ -1,10 +0,0 @@
1
- import { joinURL, withoutTrailingSlash } from "ufo";
2
- //#region src/utils.ts
3
- function getUri(id) {
4
- return withoutTrailingSlash(id.split("/pages/")[1].replace(/\.md$/, "").replace(/\.vue$/, "").replace(/index$/, ""));
5
- }
6
- function toUrl(hostname, ...paths) {
7
- return joinURL(`https://${hostname}`, ...paths);
8
- }
9
- //#endregion
10
- export { getUri, toUrl };
@@ -1,78 +0,0 @@
1
- import { UserConfig } from "vite";
2
- import { Options } from "unplugin-vue-markdown/types";
3
-
4
- //#region src/assert.d.ts
5
- type AssertFn = (id: string, frontmatter: Record<string, any>) => void;
6
- //#endregion
7
- //#region src/structured-data/breadcrumb.d.ts
8
- interface BreadcrumbItem {
9
- title: string;
10
- type?: 'WebSite' | 'WebPage';
11
- url?: string;
12
- }
13
- //#endregion
14
- //#region src/structured-data/person.d.ts
15
- interface PersonOptions {
16
- name: string;
17
- sameAs: string[];
18
- }
19
- //#endregion
20
- //#region src/structured-data/index.d.ts
21
- interface StructuredDataPageConfig {
22
- type: 'article' | 'collection' | 'default';
23
- breadcrumbItems?: BreadcrumbItem[];
24
- }
25
- //#endregion
26
- //#region vite.config.d.ts
27
- /**
28
- * Main configuration interface for the infrastructure status app.
29
- */
30
- interface Options$1 {
31
- /**
32
- * Extracts the page identifier from a given file path or id.
33
- * @param id - The file path or identifier.
34
- * @returns The extracted page name, or null if not found.
35
- */
36
- extractPage: (id: string) => string | null;
37
- /**
38
- * Markdown rendering options for unplugin-vue-markdown.
39
- */
40
- markdown?: Options;
41
- /**
42
- * SEO and structured data configuration.
43
- */
44
- seo?: {
45
- /**
46
- * Person information for Schema.org structured data.
47
- */
48
- person?: PersonOptions;
49
- /**
50
- * Custom validation rules for frontmatter fields.
51
- */
52
- assert?: {
53
- /**
54
- * Validation rules function for frontmatter.
55
- */
56
- rules?: AssertFn;
57
- };
58
- /**
59
- * Structured data generation configuration.
60
- */
61
- structuredData?: {
62
- /**
63
- * Callback to determine page type and configuration for structured data generation.
64
- * @param page - The page name or null.
65
- * @param frontmatter - The frontmatter data for the page.
66
- * @returns Structured data configuration for the page.
67
- */
68
- pageConfig?: (page: string | null, frontmatter: Record<string, any>) => StructuredDataPageConfig;
69
- };
70
- };
71
- /**
72
- * Categories to generate API JSON files for (e.g., ['websites', 'platforms']).
73
- */
74
- apiCategories?: string[];
75
- }
76
- declare const _default: (title: string, hostname: string, options: Options$1, config?: UserConfig) => Record<string, any>;
77
- //#endregion
78
- export { type BreadcrumbItem, type PersonOptions, type StructuredDataPageConfig, _default as default };
File without changes