@lark-apaas/fullstack-vite-preset 1.0.1-alpha.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 (71) hide show
  1. package/README.md +121 -0
  2. package/lib/index.d.ts +39 -0
  3. package/lib/index.d.ts.map +1 -0
  4. package/lib/index.js +75 -0
  5. package/lib/index.js.map +1 -0
  6. package/lib/module-alias/clsx.d.ts +4 -0
  7. package/lib/module-alias/clsx.d.ts.map +1 -0
  8. package/lib/module-alias/clsx.js +13 -0
  9. package/lib/module-alias/clsx.js.map +1 -0
  10. package/lib/module-alias/echarts.d.ts +4 -0
  11. package/lib/module-alias/echarts.d.ts.map +1 -0
  12. package/lib/module-alias/echarts.js +50 -0
  13. package/lib/module-alias/echarts.js.map +1 -0
  14. package/lib/module-alias/registry_echarts_theme.d.ts +696 -0
  15. package/lib/module-alias/registry_echarts_theme.d.ts.map +1 -0
  16. package/lib/module-alias/registry_echarts_theme.js +394 -0
  17. package/lib/module-alias/registry_echarts_theme.js.map +1 -0
  18. package/lib/preset.d.ts +14 -0
  19. package/lib/preset.d.ts.map +1 -0
  20. package/lib/preset.js +283 -0
  21. package/lib/preset.js.map +1 -0
  22. package/lib/utils/hmr-timing.d.ts +8 -0
  23. package/lib/utils/hmr-timing.d.ts.map +1 -0
  24. package/lib/utils/hmr-timing.js +132 -0
  25. package/lib/utils/hmr-timing.js.map +1 -0
  26. package/lib/utils/normalize-base-path.d.ts +7 -0
  27. package/lib/utils/normalize-base-path.d.ts.map +1 -0
  28. package/lib/utils/normalize-base-path.js +15 -0
  29. package/lib/utils/normalize-base-path.js.map +1 -0
  30. package/lib/utils/snapdom-proxy.d.ts +8 -0
  31. package/lib/utils/snapdom-proxy.d.ts.map +1 -0
  32. package/lib/utils/snapdom-proxy.js +52 -0
  33. package/lib/utils/snapdom-proxy.js.map +1 -0
  34. package/lib/vite-plugins/html-output-plugin.d.ts +14 -0
  35. package/lib/vite-plugins/html-output-plugin.d.ts.map +1 -0
  36. package/lib/vite-plugins/html-output-plugin.js +129 -0
  37. package/lib/vite-plugins/html-output-plugin.js.map +1 -0
  38. package/lib/vite-plugins/inspector-css-plugin.d.ts +19 -0
  39. package/lib/vite-plugins/inspector-css-plugin.d.ts.map +1 -0
  40. package/lib/vite-plugins/inspector-css-plugin.js +70 -0
  41. package/lib/vite-plugins/inspector-css-plugin.js.map +1 -0
  42. package/lib/vite-plugins/module-alias-plugin.d.ts +10 -0
  43. package/lib/vite-plugins/module-alias-plugin.d.ts.map +1 -0
  44. package/lib/vite-plugins/module-alias-plugin.js +36 -0
  45. package/lib/vite-plugins/module-alias-plugin.js.map +1 -0
  46. package/lib/vite-plugins/og-meta-plugin.d.ts +17 -0
  47. package/lib/vite-plugins/og-meta-plugin.d.ts.map +1 -0
  48. package/lib/vite-plugins/og-meta-plugin.js +81 -0
  49. package/lib/vite-plugins/og-meta-plugin.js.map +1 -0
  50. package/lib/vite-plugins/route-parser-plugin.d.ts +8 -0
  51. package/lib/vite-plugins/route-parser-plugin.d.ts.map +1 -0
  52. package/lib/vite-plugins/route-parser-plugin.js +280 -0
  53. package/lib/vite-plugins/route-parser-plugin.js.map +1 -0
  54. package/lib/vite-plugins/runtime-injection-plugin.d.ts +22 -0
  55. package/lib/vite-plugins/runtime-injection-plugin.d.ts.map +1 -0
  56. package/lib/vite-plugins/runtime-injection-plugin.js +50 -0
  57. package/lib/vite-plugins/runtime-injection-plugin.js.map +1 -0
  58. package/lib/vite-plugins/slardar-plugin.d.ts +10 -0
  59. package/lib/vite-plugins/slardar-plugin.d.ts.map +1 -0
  60. package/lib/vite-plugins/slardar-plugin.js +98 -0
  61. package/lib/vite-plugins/slardar-plugin.js.map +1 -0
  62. package/lib/vite-plugins/view-context-plugin.d.ts +4 -0
  63. package/lib/vite-plugins/view-context-plugin.d.ts.map +1 -0
  64. package/lib/vite-plugins/view-context-plugin.js +40 -0
  65. package/lib/vite-plugins/view-context-plugin.js.map +1 -0
  66. package/package.json +57 -0
  67. package/src/empty.css +1 -0
  68. package/src/inspector-stub.js +6 -0
  69. package/src/module-alias/clsx.mjs +8 -0
  70. package/src/module-alias/echarts.mjs +28 -0
  71. package/src/module-alias/registry_echarts_theme.mjs +390 -0
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.htmlOutputPlugin = htmlOutputPlugin;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ /**
10
+ * Vite plugin to handle HTML output:
11
+ * 1. In production: fixes HTML output path (removes extra 'client' directory)
12
+ * 2. In development: writes transformed HTML to disk for backend to serve
13
+ */
14
+ function htmlOutputPlugin(options) {
15
+ const { isDev, outDir } = options;
16
+ let config;
17
+ let server = null;
18
+ /**
19
+ * Transform and write HTML to disk for backend to serve
20
+ */
21
+ async function writeHtmlToDisk() {
22
+ if (!server || !config)
23
+ return;
24
+ try {
25
+ // Find the input HTML file from rollup options
26
+ const rollupInput = config.build.rollupOptions?.input;
27
+ let htmlPath;
28
+ if (typeof rollupInput === 'string') {
29
+ htmlPath = rollupInput;
30
+ }
31
+ else if (Array.isArray(rollupInput)) {
32
+ htmlPath = rollupInput.find((f) => f.endsWith('.html')) || '';
33
+ }
34
+ else if (rollupInput && typeof rollupInput === 'object') {
35
+ htmlPath =
36
+ Object.values(rollupInput).find((f) => f.endsWith('.html')) || '';
37
+ }
38
+ else {
39
+ htmlPath = path_1.default.resolve(config.root, 'index.html');
40
+ }
41
+ if (!htmlPath || !fs_1.default.existsSync(htmlPath)) {
42
+ console.warn(`[html-output] HTML file not found: ${htmlPath}`);
43
+ return;
44
+ }
45
+ // Read the source HTML
46
+ let html = fs_1.default.readFileSync(htmlPath, 'utf-8');
47
+ // Apply Vite's HTML transformations (this calls all plugin's transformIndexHtml hooks)
48
+ const url = '/' + path_1.default.relative(config.root, htmlPath);
49
+ html = await server.transformIndexHtml(url, html);
50
+ // Write to output directory
51
+ const outputPath = path_1.default.resolve(outDir, 'index.html');
52
+ // Ensure output directory exists
53
+ const dir = path_1.default.dirname(outputPath);
54
+ if (!fs_1.default.existsSync(dir)) {
55
+ fs_1.default.mkdirSync(dir, { recursive: true });
56
+ }
57
+ fs_1.default.writeFileSync(outputPath, html);
58
+ console.log(`[html-output] Written to: ${outputPath}`);
59
+ }
60
+ catch (e) {
61
+ console.error(`[html-output] Failed to write HTML:`, e);
62
+ }
63
+ }
64
+ return {
65
+ name: 'vite-html-output',
66
+ configResolved(resolvedConfig) {
67
+ config = resolvedConfig;
68
+ },
69
+ configureServer(devServer) {
70
+ if (!isDev)
71
+ return;
72
+ server = devServer;
73
+ // Return a post hook to run after server is set up
74
+ return () => {
75
+ // Write HTML after a short delay to ensure server is fully ready
76
+ setTimeout(() => {
77
+ writeHtmlToDisk();
78
+ }, 100);
79
+ // Watch for HTML file changes
80
+ const rollupInput = config.build.rollupOptions?.input;
81
+ let htmlPath;
82
+ if (typeof rollupInput === 'string' && rollupInput.endsWith('.html')) {
83
+ htmlPath = rollupInput;
84
+ }
85
+ else if (rollupInput && typeof rollupInput === 'object') {
86
+ const inputs = Array.isArray(rollupInput)
87
+ ? rollupInput
88
+ : Object.values(rollupInput);
89
+ htmlPath = inputs.find((f) => f.endsWith('.html'));
90
+ }
91
+ if (htmlPath) {
92
+ devServer.watcher.add(htmlPath);
93
+ devServer.watcher.on('change', (file) => {
94
+ if (file === htmlPath) {
95
+ console.log(`[html-output] HTML changed, regenerating...`);
96
+ writeHtmlToDisk();
97
+ }
98
+ });
99
+ }
100
+ };
101
+ },
102
+ // In production, fix the HTML output path after build
103
+ closeBundle() {
104
+ if (!isDev && config) {
105
+ const outDir = config.build.outDir;
106
+ const wrongPath = path_1.default.resolve(outDir, 'client/index.html');
107
+ const correctPath = path_1.default.resolve(outDir, 'index.html');
108
+ // Check if HTML was output to wrong location
109
+ if (fs_1.default.existsSync(wrongPath)) {
110
+ // Move HTML to correct location
111
+ fs_1.default.renameSync(wrongPath, correctPath);
112
+ console.log(`[html-output] Moved: ${wrongPath} -> ${correctPath}`);
113
+ // Remove empty client directory if it exists
114
+ const clientDir = path_1.default.resolve(outDir, 'client');
115
+ try {
116
+ const files = fs_1.default.readdirSync(clientDir);
117
+ if (files.length === 0) {
118
+ fs_1.default.rmdirSync(clientDir);
119
+ }
120
+ }
121
+ catch {
122
+ // Directory doesn't exist or not empty, ignore
123
+ }
124
+ }
125
+ }
126
+ },
127
+ };
128
+ }
129
+ //# sourceMappingURL=html-output-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html-output-plugin.js","sourceRoot":"","sources":["../../src/vite-plugins/html-output-plugin.ts"],"names":[],"mappings":";;;;;AAgBA,4CA8HC;AA9ID,4CAAoB;AACpB,gDAAwB;AAUxB;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,OAAgC;IAC/D,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAClC,IAAI,MAAsB,CAAC;IAC3B,IAAI,MAAM,GAAyB,IAAI,CAAC;IAExC;;OAEG;IACH,KAAK,UAAU,eAAe;QAC5B,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM;YAAE,OAAO;QAE/B,IAAI,CAAC;YACH,+CAA+C;YAC/C,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC;YACtD,IAAI,QAAgB,CAAC;YAErB,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;gBACpC,QAAQ,GAAG,WAAW,CAAC;YACzB,CAAC;iBAAM,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;gBACtC,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,EA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,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { Plugin } from 'vite';
2
+ /**
3
+ * Vite plugin to handle inspector CSS imports
4
+ *
5
+ * Creates an empty inspector.dev.css stub file if it doesn't exist.
6
+ * This is needed because:
7
+ * 1. @lark-apaas/client-toolkit imports @/inspector.dev.css
8
+ * 2. Vite's internal postcss-import processes @import statements before
9
+ * custom plugins can intercept them
10
+ * 3. The inspector UI injects its own styles at runtime, so this file
11
+ * can be empty
12
+ *
13
+ * In production mode, the stub file is cleaned up after build.
14
+ * In development mode, the stub file is kept (or user can provide real CSS).
15
+ */
16
+ export declare function inspectorCssPlugin(options: {
17
+ isDev: boolean;
18
+ }): Plugin;
19
+ //# sourceMappingURL=inspector-css-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspector-css-plugin.d.ts","sourceRoot":"","sources":["../../src/vite-plugins/inspector-css-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,MAAM,CAAC;AAKnD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CA8CtE"}
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.inspectorCssPlugin = inspectorCssPlugin;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const INSPECTOR_CSS_FILENAME = 'inspector.dev.css';
10
+ const EMPTY_CSS_CONTENT = '/* Inspector CSS - placeholder for postcss-import */\n';
11
+ /**
12
+ * Vite plugin to handle inspector CSS imports
13
+ *
14
+ * Creates an empty inspector.dev.css stub file if it doesn't exist.
15
+ * This is needed because:
16
+ * 1. @lark-apaas/client-toolkit imports @/inspector.dev.css
17
+ * 2. Vite's internal postcss-import processes @import statements before
18
+ * custom plugins can intercept them
19
+ * 3. The inspector UI injects its own styles at runtime, so this file
20
+ * can be empty
21
+ *
22
+ * In production mode, the stub file is cleaned up after build.
23
+ * In development mode, the stub file is kept (or user can provide real CSS).
24
+ */
25
+ function inspectorCssPlugin(options) {
26
+ const { isDev } = options;
27
+ let createdStubFile = null;
28
+ return {
29
+ name: 'vite-inspector-css',
30
+ enforce: 'pre',
31
+ configResolved(config) {
32
+ const rootDir = config.root || process.cwd();
33
+ const stubPath = path_1.default.resolve(rootDir, 'client/src', INSPECTOR_CSS_FILENAME);
34
+ // Create stub file if it doesn't exist (both dev and production)
35
+ // This prevents Vite's internal postcss-import from failing
36
+ if (!fs_1.default.existsSync(stubPath)) {
37
+ try {
38
+ // Ensure directory exists
39
+ const dir = path_1.default.dirname(stubPath);
40
+ if (!fs_1.default.existsSync(dir)) {
41
+ fs_1.default.mkdirSync(dir, { recursive: true });
42
+ }
43
+ fs_1.default.writeFileSync(stubPath, EMPTY_CSS_CONTENT);
44
+ // Only track for cleanup in production mode
45
+ if (!isDev) {
46
+ createdStubFile = stubPath;
47
+ }
48
+ console.log(`[vite-inspector-css] Created stub: ${stubPath}`);
49
+ }
50
+ catch (e) {
51
+ console.warn(`[vite-inspector-css] Could not create stub file: ${e}`);
52
+ }
53
+ }
54
+ },
55
+ buildEnd() {
56
+ // Clean up the stub file after production build completes
57
+ if (createdStubFile && fs_1.default.existsSync(createdStubFile)) {
58
+ try {
59
+ fs_1.default.unlinkSync(createdStubFile);
60
+ console.log(`[vite-inspector-css] Cleaned up stub: ${createdStubFile}`);
61
+ }
62
+ catch (e) {
63
+ console.warn(`[vite-inspector-css] Could not clean up stub file: ${e}`);
64
+ }
65
+ createdStubFile = null;
66
+ }
67
+ },
68
+ };
69
+ }
70
+ //# sourceMappingURL=inspector-css-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspector-css-plugin.js","sourceRoot":"","sources":["../../src/vite-plug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AAC,IAAI,CAAC,oDAAoD,CAAC,EAAE,CAAC,CAAC;gBACxE,CAAC;YACH,CAAC;QACH,CAAC;QAED,QAAQ;YACN,0DAA0D;YAC1D,IAAI,eAAe,IAAI,YAAE,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;gBACtD,IAAI,CAAC;oBACH,YAAE,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;oBAC/B,OAAO,CAAC,GAAG,CAAC,yCAAyC,eAAe,EAAE,CAAC,CAAC;gBAC1E,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,OAAO,CAAC,IAAI,CAAC,sDAAsD,CAAC,EAAE,CAAC,CAAC;gBAC1E,CAAC;gBACD,eAAe,GAAG,IAAI,CAAC;YACzB,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { Plugin } from 'vite';
2
+ /**
3
+ * Module alias plugin for Vite
4
+ * Replaces imports of 'clsx' and 'echarts' with custom wrapper modules
5
+ *
6
+ * Uses ESM (.mjs) files that work directly in browser without bundling
7
+ */
8
+ export declare function moduleAliasPlugin(): Plugin;
9
+ export default moduleAliasPlugin;
10
+ //# sourceMappingURL=module-alias-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-alias-plugin.d.ts","sourceRoot":"","sources":["../../src/vite-plugins/module-alias-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAwB1C;AAED,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.moduleAliasPlugin = moduleAliasPlugin;
7
+ const path_1 = __importDefault(require("path"));
8
+ /**
9
+ * Module alias plugin for Vite
10
+ * Replaces imports of 'clsx' and 'echarts' with custom wrapper modules
11
+ *
12
+ * Uses ESM (.mjs) files that work directly in browser without bundling
13
+ */
14
+ function moduleAliasPlugin() {
15
+ return {
16
+ name: 'fullstack-module-alias',
17
+ enforce: 'pre',
18
+ resolveId(source, importer) {
19
+ // Skip if importing from our own module-alias directory
20
+ if (importer && importer.includes('module-alias')) {
21
+ return null;
22
+ }
23
+ // Replace 'clsx' with our wrapper (ESM version in src/)
24
+ if (source === 'clsx') {
25
+ return path_1.default.resolve(__dirname, '../../src/module-alias/clsx.mjs');
26
+ }
27
+ // Replace 'echarts' with our wrapper (ESM version in src/)
28
+ if (source === 'echarts') {
29
+ return path_1.default.resolve(__dirname, '../../src/module-alias/echarts.mjs');
30
+ }
31
+ return null;
32
+ },
33
+ };
34
+ }
35
+ exports.default = moduleAliasPlugin;
36
+ //# sourceMappingURL=module-alias-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-alias-plugin.js","sourceRoot":"","sources":["../../src/vite-plugins/module-alias-plugin.ts"],"names":[],"mappings":";;;;;AASA,8CAwBC;AAhCD,gDAAwB;AAExB;;;;;GAKG;AACH,SAAgB,iBAAiB;IAC/B,OAAO;QACL,IAAI,EAAE,wBAAwB;QAC9B,OAAO,EAAE,KAAK;QAEd,SAAS,CAAC,MAAM,EAAE,QAAQ;YACxB,wDAAwD;YACxD,IAAI,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;gBAClD,OAAO,IAAI,CAAC;YACd,CAAC;YAED,wDAAwD;YACxD,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;gBACtB,OAAO,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,iCAAiC,CAAC,CAAC;YACpE,CAAC;YAED,2DAA2D;YAC3D,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;gBACzB,OAAO,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,oCAAoC,CAAC,CAAC;YACvE,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC;AACJ,CAAC;AAED,kBAAe,iBAAiB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { Plugin } from 'vite';
2
+ interface OgMetaPluginOptions {
3
+ /** Custom OG tag configuration */
4
+ customTags?: Array<{
5
+ property: string;
6
+ placeholder: string;
7
+ }>;
8
+ /** Custom title placeholder */
9
+ titlePlaceholder?: string;
10
+ /** Custom description placeholder */
11
+ descriptionPlaceholder?: string;
12
+ /** Custom favicon placeholder */
13
+ faviconPlaceholder?: string;
14
+ }
15
+ export declare function ogMetaPlugin(options?: OgMetaPluginOptions): Plugin;
16
+ export default ogMetaPlugin;
17
+ //# sourceMappingURL=og-meta-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"og-meta-plugin.d.ts","sourceRoot":"","sources":["../../src/vite-plugins/og-meta-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,UAAU,mBAAmB;IAC3B,kCAAkC;IAClC,UAAU,CAAC,EAAE,KAAK,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC,CAAC;IACH,+BAA+B;IAC/B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qCAAqC;IACrC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,iCAAiC;IACjC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAcD,wBAAgB,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG,MAAM,CAsGtE;AAED,eAAe,YAAY,CAAC"}
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ogMetaPlugin = ogMetaPlugin;
4
+ // Default OG tags configuration
5
+ const defaultOgTags = [
6
+ { property: 'og:title', placeholder: '{{appName}}' },
7
+ { property: 'og:description', placeholder: '{{appDescription}}' },
8
+ { property: 'og:image', placeholder: '{{appAvatar}}' },
9
+ { property: 'og:url', placeholder: '{{currentUrl}}' },
10
+ ];
11
+ const defaultTitlePlaceholder = '{{appName}}';
12
+ const defaultDescriptionPlaceholder = '{{appDescription}}';
13
+ const defaultFaviconPlaceholder = '{{appAvatar}}';
14
+ function ogMetaPlugin(options = {}) {
15
+ const { customTags, titlePlaceholder = defaultTitlePlaceholder, descriptionPlaceholder = defaultDescriptionPlaceholder, faviconPlaceholder = defaultFaviconPlaceholder, } = options;
16
+ const ogTags = customTags || defaultOgTags;
17
+ return {
18
+ name: 'fullstack-og-meta',
19
+ transformIndexHtml(html) {
20
+ let result = html;
21
+ // 1. Process OG Meta tags
22
+ ogTags.forEach(({ property, placeholder }) => {
23
+ // Escape special characters to avoid regex errors
24
+ const escapedProperty = property.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
25
+ // Check if meta tag with this property exists
26
+ const metaRegex = new RegExp(`<meta\\s+[^>]*property=["']?${escapedProperty}["']?[^>]*>`, 'i');
27
+ if (metaRegex.test(result)) {
28
+ // If exists, replace its content with placeholder
29
+ const replaceRegex = new RegExp(`(<meta\\s+[^>]*property=["']?${escapedProperty}["']?[^>]*content=)["'][^"']*["']([^>]*>)`, 'gi');
30
+ result = result.replace(replaceRegex, `$1"${placeholder}"$2`);
31
+ }
32
+ else {
33
+ // If not exists, insert new tag before </head>
34
+ const newMetaTag = `\n <meta property="${property}" content="${placeholder}">`;
35
+ result = result.replace('</head>', `${newMetaTag}\n </head>`);
36
+ }
37
+ });
38
+ // 2. Process <title> tag
39
+ const titleRegex = /<title>[^<]*<\/title>/i;
40
+ if (titleRegex.test(result)) {
41
+ // If title tag exists, replace its content
42
+ result = result.replace(/<title>[^<]*<\/title>/gi, `<title>${titlePlaceholder}</title>`);
43
+ }
44
+ else {
45
+ // If not exists, insert before </head>
46
+ const newTitleTag = `\n <title>${titlePlaceholder}</title>`;
47
+ result = result.replace('</head>', `${newTitleTag}\n </head>`);
48
+ }
49
+ // 2.1 Process <meta name="description"> tag
50
+ const descriptionMetaRegex = /<meta\b[^>]*\bname=["']description["'][^>]*>/i;
51
+ const descriptionMetaReplaceRegex = /<meta\b[^>]*\bname=["']description["'][^>]*>/gi;
52
+ if (descriptionMetaRegex.test(result)) {
53
+ result = result.replace(descriptionMetaReplaceRegex, (metaTag) => {
54
+ if (/\bcontent=/.test(metaTag)) {
55
+ return metaTag.replace(/\bcontent=(["'])([\s\S]*?)\1/i, `content="${descriptionPlaceholder}"`);
56
+ }
57
+ return metaTag.replace(/>$/, ` content="${descriptionPlaceholder}">`);
58
+ });
59
+ }
60
+ else {
61
+ const newDescriptionTag = `\n <meta name="description" content="${descriptionPlaceholder}">`;
62
+ result = result.replace('</head>', `${newDescriptionTag}\n </head>`);
63
+ }
64
+ // 3. Process <link rel="icon"> tag
65
+ const iconRegex = /<link\s+[^>]*rel=["']?(?:icon|shortcut icon)["']?[^>]*>/i;
66
+ if (iconRegex.test(result)) {
67
+ // If icon tag exists, replace its href
68
+ const replaceIconRegex = /(<link\s+[^>]*rel=["']?(?:icon|shortcut icon)["']?[^>]*href=)["'][^"']*["']([^>]*>)/gi;
69
+ result = result.replace(replaceIconRegex, `$1"${faviconPlaceholder}"$2`);
70
+ }
71
+ else {
72
+ // If not exists, insert before </head>
73
+ const newIconTag = `\n <link rel="icon" href="${faviconPlaceholder}">`;
74
+ result = result.replace('</head>', `${newIconTag}\n </head>`);
75
+ }
76
+ return result;
77
+ },
78
+ };
79
+ }
80
+ exports.default = ogMetaPlugin;
81
+ //# sourceMappingURL=og-meta-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"og-meta-plugin.js","sourceRoot":"","sources":["../../src/vite-plugins/og-meta-plugin.ts"],"names":[],"mappings":";;AA4BA,oCAsGC;AAlHD,gCAAgC;AAChC,MAAM,aAAa,GAAG;IACpB,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAA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AAM,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,iBAAiB,aAAa,CAAC,CAAC;YACxE,CAAC;YAED,mCAAmC;YACnC,MAAM,SAAS,GACb,0DAA0D,CAAC;YAE7D,IAAI,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC3B,uCAAuC;gBACvC,MAAM,gBAAgB,GACpB,uFAAuF,CAAC;gBAC1F,MAAM,GAAG,MAAM,CAAC,OAAO,CACrB,gBAAgB,EAChB,MAAM,kBAAkB,KAAK,CAC9B,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,uCAAuC;gBACvC,MAAM,UAAU,GAAG,gCAAgC,kBAAkB,IAAI,CAAC;gBAC1E,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,UAAU,aAAa,CAAC,CAAC;YACjE,CAAC;YAED,OAAO,MAAM,CAAC;QAChB,CAAC;KACF,CAAC;AACJ,CAAC;AAED,kBAAe,YAAY,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { Plugin } from 'vite';
2
+ interface RouteParserPluginOptions {
3
+ appPath?: string;
4
+ outputPath?: string;
5
+ }
6
+ export declare function routeParserPlugin(options?: RouteParserPluginOptions): Plugin;
7
+ export default routeParserPlugin;
8
+ //# sourceMappingURL=route-parser-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route-parser-plugin.d.ts","sourceRoot":"","sources":["../../src/vite-plugins/route-parser-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,MAAM,CAAC;AAQlD,UAAU,wBAAwB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAoPD,wBAAgB,iBAAiB,CAC/B,OAAO,GAAE,wBAA6B,GACrC,MAAM,CAiDR;AAED,eAAe,iBAAiB,CAAC"}