@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.
- package/README.md +121 -0
- package/lib/index.d.ts +39 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +75 -0
- package/lib/index.js.map +1 -0
- package/lib/module-alias/clsx.d.ts +4 -0
- package/lib/module-alias/clsx.d.ts.map +1 -0
- package/lib/module-alias/clsx.js +13 -0
- package/lib/module-alias/clsx.js.map +1 -0
- package/lib/module-alias/echarts.d.ts +4 -0
- package/lib/module-alias/echarts.d.ts.map +1 -0
- package/lib/module-alias/echarts.js +50 -0
- package/lib/module-alias/echarts.js.map +1 -0
- package/lib/module-alias/registry_echarts_theme.d.ts +696 -0
- package/lib/module-alias/registry_echarts_theme.d.ts.map +1 -0
- package/lib/module-alias/registry_echarts_theme.js +394 -0
- package/lib/module-alias/registry_echarts_theme.js.map +1 -0
- package/lib/preset.d.ts +14 -0
- package/lib/preset.d.ts.map +1 -0
- package/lib/preset.js +283 -0
- package/lib/preset.js.map +1 -0
- package/lib/utils/hmr-timing.d.ts +8 -0
- package/lib/utils/hmr-timing.d.ts.map +1 -0
- package/lib/utils/hmr-timing.js +132 -0
- package/lib/utils/hmr-timing.js.map +1 -0
- package/lib/utils/normalize-base-path.d.ts +7 -0
- package/lib/utils/normalize-base-path.d.ts.map +1 -0
- package/lib/utils/normalize-base-path.js +15 -0
- package/lib/utils/normalize-base-path.js.map +1 -0
- package/lib/utils/snapdom-proxy.d.ts +8 -0
- package/lib/utils/snapdom-proxy.d.ts.map +1 -0
- package/lib/utils/snapdom-proxy.js +52 -0
- package/lib/utils/snapdom-proxy.js.map +1 -0
- package/lib/vite-plugins/html-output-plugin.d.ts +14 -0
- package/lib/vite-plugins/html-output-plugin.d.ts.map +1 -0
- package/lib/vite-plugins/html-output-plugin.js +129 -0
- package/lib/vite-plugins/html-output-plugin.js.map +1 -0
- package/lib/vite-plugins/inspector-css-plugin.d.ts +19 -0
- package/lib/vite-plugins/inspector-css-plugin.d.ts.map +1 -0
- package/lib/vite-plugins/inspector-css-plugin.js +70 -0
- package/lib/vite-plugins/inspector-css-plugin.js.map +1 -0
- package/lib/vite-plugins/module-alias-plugin.d.ts +10 -0
- package/lib/vite-plugins/module-alias-plugin.d.ts.map +1 -0
- package/lib/vite-plugins/module-alias-plugin.js +36 -0
- package/lib/vite-plugins/module-alias-plugin.js.map +1 -0
- package/lib/vite-plugins/og-meta-plugin.d.ts +17 -0
- package/lib/vite-plugins/og-meta-plugin.d.ts.map +1 -0
- package/lib/vite-plugins/og-meta-plugin.js +81 -0
- package/lib/vite-plugins/og-meta-plugin.js.map +1 -0
- package/lib/vite-plugins/route-parser-plugin.d.ts +8 -0
- package/lib/vite-plugins/route-parser-plugin.d.ts.map +1 -0
- package/lib/vite-plugins/route-parser-plugin.js +280 -0
- package/lib/vite-plugins/route-parser-plugin.js.map +1 -0
- package/lib/vite-plugins/runtime-injection-plugin.d.ts +22 -0
- package/lib/vite-plugins/runtime-injection-plugin.d.ts.map +1 -0
- package/lib/vite-plugins/runtime-injection-plugin.js +50 -0
- package/lib/vite-plugins/runtime-injection-plugin.js.map +1 -0
- package/lib/vite-plugins/slardar-plugin.d.ts +10 -0
- package/lib/vite-plugins/slardar-plugin.d.ts.map +1 -0
- package/lib/vite-plugins/slardar-plugin.js +98 -0
- package/lib/vite-plugins/slardar-plugin.js.map +1 -0
- package/lib/vite-plugins/view-context-plugin.d.ts +4 -0
- package/lib/vite-plugins/view-context-plugin.d.ts.map +1 -0
- package/lib/vite-plugins/view-context-plugin.js +40 -0
- package/lib/vite-plugins/view-context-plugin.js.map +1 -0
- package/package.json +57 -0
- package/src/empty.css +1 -0
- package/src/inspector-stub.js +6 -0
- package/src/module-alias/clsx.mjs +8 -0
- package/src/module-alias/echarts.mjs +28 -0
- package/src/module-alias/registry_echarts_theme.mjs +390 -0
package/README.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# @lark-apaas/fullstack-vite-preset
|
|
2
|
+
|
|
3
|
+
Vite preset for Fullstack applications, providing a complete replacement for `@lark-apaas/fullstack-rspack-preset`.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @lark-apaas/fullstack-vite-preset vite
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### Basic Usage
|
|
14
|
+
|
|
15
|
+
Create a `vite.config.ts` file in your project root:
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import path from 'path';
|
|
19
|
+
import { defineConfig } from '@lark-apaas/fullstack-vite-preset';
|
|
20
|
+
|
|
21
|
+
export default defineConfig({
|
|
22
|
+
resolve: {
|
|
23
|
+
alias: {
|
|
24
|
+
'@': path.resolve(__dirname, 'client/src'),
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Environment Variables
|
|
31
|
+
|
|
32
|
+
The preset automatically reads the following environment variables:
|
|
33
|
+
|
|
34
|
+
| Variable | Description | Default |
|
|
35
|
+
|----------|-------------|---------|
|
|
36
|
+
| `NODE_ENV` | development \| production | `development` |
|
|
37
|
+
| `NEED_ROUTES` | Enable route parsing | `true` |
|
|
38
|
+
| `CLIENT_BASE_PATH` | Client base path | `/` |
|
|
39
|
+
| `ASSETS_CDN_PATH` | Production CDN path | `/` |
|
|
40
|
+
| `SERVER_PORT` | Backend server port | `3000` |
|
|
41
|
+
| `CLIENT_DEV_PORT` | Vite dev server port | `8080` |
|
|
42
|
+
| `CLIENT_DEV_HOST` | Vite dev server host | `localhost` |
|
|
43
|
+
| `LOG_DIR` | Log directory | `./logs` |
|
|
44
|
+
|
|
45
|
+
### Scripts
|
|
46
|
+
|
|
47
|
+
Update your `package.json` scripts:
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"scripts": {
|
|
52
|
+
"dev:client": "vite --config vite.config.ts",
|
|
53
|
+
"build:client": "vite build --config vite.config.ts",
|
|
54
|
+
"preview:client": "vite preview --config vite.config.ts"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Features
|
|
60
|
+
|
|
61
|
+
### Included Plugins
|
|
62
|
+
|
|
63
|
+
- **React Plugin**: With automatic JSX runtime and styled-jsx support via Babel
|
|
64
|
+
- **Route Parser Plugin**: Automatically parses React Router routes from `app.tsx`
|
|
65
|
+
- **Slardar Plugin**: Injects performance monitoring SDK
|
|
66
|
+
- **View Context Plugin**: Injects server-side context variables
|
|
67
|
+
- **OG Meta Plugin**: Injects Open Graph meta tags
|
|
68
|
+
- **Module Alias Plugin**: Provides enhanced `clsx` (with tailwind-merge) and `echarts` (with theme)
|
|
69
|
+
- **HMR Timing Plugin**: Tracks and reports HMR compilation metrics
|
|
70
|
+
|
|
71
|
+
### Module Aliases
|
|
72
|
+
|
|
73
|
+
The preset automatically replaces:
|
|
74
|
+
|
|
75
|
+
- `clsx` - Enhanced with `tailwind-merge` for automatic Tailwind class deduplication
|
|
76
|
+
- `echarts` - Pre-configured with a shadcn-compatible theme (`ud`)
|
|
77
|
+
|
|
78
|
+
### Dev Server Features
|
|
79
|
+
|
|
80
|
+
- Proxy configuration for `/api` and `/__innerapi__` routes
|
|
81
|
+
- HTML requests proxied to backend server
|
|
82
|
+
- SnapDom proxy middleware for debugging
|
|
83
|
+
- Dev logs and OpenAPI middleware integration
|
|
84
|
+
|
|
85
|
+
### Build Features
|
|
86
|
+
|
|
87
|
+
- Source maps in development
|
|
88
|
+
- Terser minification in production
|
|
89
|
+
- Code splitting enabled (Vite default)
|
|
90
|
+
- PostCSS with `postcss-import` plugin
|
|
91
|
+
|
|
92
|
+
## HTML Template
|
|
93
|
+
|
|
94
|
+
Ensure your `client/index.html` uses ES module scripts:
|
|
95
|
+
|
|
96
|
+
```html
|
|
97
|
+
<!DOCTYPE html>
|
|
98
|
+
<html lang="en">
|
|
99
|
+
<head>
|
|
100
|
+
<meta charset="UTF-8">
|
|
101
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
102
|
+
<title>Fullstack App</title>
|
|
103
|
+
</head>
|
|
104
|
+
<body>
|
|
105
|
+
<div id="root"></div>
|
|
106
|
+
<script type="module" src="/client/src/index.tsx"></script>
|
|
107
|
+
</body>
|
|
108
|
+
</html>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Migration from Rspack Preset
|
|
112
|
+
|
|
113
|
+
1. Replace `@lark-apaas/fullstack-rspack-preset` with `@lark-apaas/fullstack-vite-preset`
|
|
114
|
+
2. Rename `rspack.config.js` to `vite.config.ts`
|
|
115
|
+
3. Update the config to use the new `defineConfig` function
|
|
116
|
+
4. Update `client/index.html` to use `type="module"` for scripts
|
|
117
|
+
5. Update package.json scripts to use `vite` instead of `rspack`
|
|
118
|
+
|
|
119
|
+
## License
|
|
120
|
+
|
|
121
|
+
MIT
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type UserConfig } from 'vite';
|
|
2
|
+
/**
|
|
3
|
+
* Define Fullstack Vite configuration
|
|
4
|
+
*
|
|
5
|
+
* Automatically reads configuration from environment variables, users only need to provide override configuration
|
|
6
|
+
*
|
|
7
|
+
* @param overrides - User-defined Vite configuration, will be deep merged with default configuration
|
|
8
|
+
* @returns Complete Vite configuration object
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```javascript
|
|
12
|
+
* import { defineConfig } from '@lark-apaas/fullstack-vite-preset';
|
|
13
|
+
* import path from 'path';
|
|
14
|
+
*
|
|
15
|
+
* export default defineConfig({
|
|
16
|
+
* resolve: {
|
|
17
|
+
* alias: {
|
|
18
|
+
* '@': path.resolve(__dirname, 'client/src'),
|
|
19
|
+
* },
|
|
20
|
+
* },
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* Supported environment variables:
|
|
25
|
+
* - NODE_ENV: development | production (default: development)
|
|
26
|
+
* - NEED_ROUTES: true | false (default: true)
|
|
27
|
+
* - CLIENT_BASE_PATH: Client base path (default: /)
|
|
28
|
+
* - ASSETS_CDN_PATH: Production CDN path (default: /)
|
|
29
|
+
* - SERVER_PORT: Server port (default: 3000)
|
|
30
|
+
* - CLIENT_DEV_PORT: Client dev port (default: 8080)
|
|
31
|
+
* - CLIENT_DEV_HOST: Client dev host (default: localhost)
|
|
32
|
+
*/
|
|
33
|
+
export declare function createFullstackViteConfig(overrides?: UserConfig): UserConfig;
|
|
34
|
+
export { createFullstackViteConfig as defineConfig };
|
|
35
|
+
export type { CreateRecommendViteConfigOptions } from './preset';
|
|
36
|
+
export { createRecommendViteConfig } from './preset';
|
|
37
|
+
export { runtimeInjectionPlugin } from './vite-plugins/runtime-injection-plugin';
|
|
38
|
+
export type { RuntimeInjectionPluginOptions } from './vite-plugins/runtime-injection-plugin';
|
|
39
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAMpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,GAAE,UAAe,GACzB,UAAU,CAiCZ;AAGD,OAAO,EAAE,yBAAyB,IAAI,YAAY,EAAE,CAAC;AAGrD,YAAY,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAGrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,YAAY,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runtimeInjectionPlugin = exports.createRecommendViteConfig = void 0;
|
|
4
|
+
exports.createFullstackViteConfig = createFullstackViteConfig;
|
|
5
|
+
exports.defineConfig = createFullstackViteConfig;
|
|
6
|
+
const vite_1 = require("vite");
|
|
7
|
+
const devtool_kits_1 = require("@lark-apaas/devtool-kits");
|
|
8
|
+
const preset_1 = require("./preset");
|
|
9
|
+
const normalize_base_path_1 = require("./utils/normalize-base-path");
|
|
10
|
+
/**
|
|
11
|
+
* Define Fullstack Vite configuration
|
|
12
|
+
*
|
|
13
|
+
* Automatically reads configuration from environment variables, users only need to provide override configuration
|
|
14
|
+
*
|
|
15
|
+
* @param overrides - User-defined Vite configuration, will be deep merged with default configuration
|
|
16
|
+
* @returns Complete Vite configuration object
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```javascript
|
|
20
|
+
* import { defineConfig } from '@lark-apaas/fullstack-vite-preset';
|
|
21
|
+
* import path from 'path';
|
|
22
|
+
*
|
|
23
|
+
* export default defineConfig({
|
|
24
|
+
* resolve: {
|
|
25
|
+
* alias: {
|
|
26
|
+
* '@': path.resolve(__dirname, 'client/src'),
|
|
27
|
+
* },
|
|
28
|
+
* },
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* Supported environment variables:
|
|
33
|
+
* - NODE_ENV: development | production (default: development)
|
|
34
|
+
* - NEED_ROUTES: true | false (default: true)
|
|
35
|
+
* - CLIENT_BASE_PATH: Client base path (default: /)
|
|
36
|
+
* - ASSETS_CDN_PATH: Production CDN path (default: /)
|
|
37
|
+
* - SERVER_PORT: Server port (default: 3000)
|
|
38
|
+
* - CLIENT_DEV_PORT: Client dev port (default: 8080)
|
|
39
|
+
* - CLIENT_DEV_HOST: Client dev host (default: localhost)
|
|
40
|
+
*/
|
|
41
|
+
function createFullstackViteConfig(overrides = {}) {
|
|
42
|
+
// 1. Auto-load .env file (synchronous load to ensure env vars are immediately available)
|
|
43
|
+
try {
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
45
|
+
require('dotenv').config();
|
|
46
|
+
}
|
|
47
|
+
catch (e) {
|
|
48
|
+
// dotenv is an optional dependency, if not installed it won't affect usage
|
|
49
|
+
}
|
|
50
|
+
// 2. Read configuration from environment variables
|
|
51
|
+
const isDev = process.env.NODE_ENV !== 'production';
|
|
52
|
+
const enableReactRefresh = isDev;
|
|
53
|
+
const needRoutes = process.env.NEED_ROUTES !== 'false'; // default true
|
|
54
|
+
// 3. Handle path configuration
|
|
55
|
+
const clientBasePath = (0, devtool_kits_1.normalizeBasePath)(process.env.CLIENT_BASE_PATH || '/');
|
|
56
|
+
const publicPath = (0, normalize_base_path_1.normalizeBasePathWithoutTrailingSlash)(isDev
|
|
57
|
+
? process.env.CLIENT_BASE_PATH || '/'
|
|
58
|
+
: process.env.ASSETS_CDN_PATH || '/');
|
|
59
|
+
// 4. Call preset function to generate base configuration
|
|
60
|
+
const baseConfig = (0, preset_1.createRecommendViteConfig)({
|
|
61
|
+
isDev,
|
|
62
|
+
enableReactRefresh,
|
|
63
|
+
needRoutes,
|
|
64
|
+
clientBasePath,
|
|
65
|
+
publicPath,
|
|
66
|
+
});
|
|
67
|
+
// 5. Deep merge user configuration
|
|
68
|
+
return (0, vite_1.mergeConfig)(baseConfig, overrides);
|
|
69
|
+
}
|
|
70
|
+
var preset_2 = require("./preset");
|
|
71
|
+
Object.defineProperty(exports, "createRecommendViteConfig", { enumerable: true, get: function () { return preset_2.createRecommendViteConfig; } });
|
|
72
|
+
// Re-export plugins for independent use
|
|
73
|
+
var runtime_injection_plugin_1 = require("./vite-plugins/runtime-injection-plugin");
|
|
74
|
+
Object.defineProperty(exports, "runtimeInjectionPlugin", { enumerable: true, get: function () { return runtime_injection_plugin_1.runtimeInjectionPlugin; } });
|
|
75
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAqCA,8DAmCC;AAGqC,iDAAY;AA3ElD,+BAAoD;AACpD,2DAA6D;AAE7D,qCAAqD;AACrD,qEAAoF;AAEpF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,SAAgB,yBAAyB,CACvC,YAAwB,EAAE;IAE1B,yFAAyF;IACzF,IAAI,CAAC;QACH,8DAA8D;QAC9D,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC;IAC7B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,2EAA2E;IAC7E,CAAC;IAED,mDAAmD;IACnD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAC;IACpD,MAAM,kBAAkB,GAAG,KAAK,CAAC;IACjC,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,OAAO,CAAC,CAAC,eAAe;IAEvE,+BAA+B;IAC/B,MAAM,cAAc,GAAG,IAAA,gCAAiB,EAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,GAAG,CAAC,CAAC;IAC9E,MAAM,UAAU,GAAG,IAAA,2DAAqC,EACtD,KAAK;QACH,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,GAAG;QACrC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,GAAG,CACvC,CAAC;IAEF,yDAAyD;IACzD,MAAM,UAAU,GAAG,IAAA,kCAAyB,EAAC;QAC3C,KAAK;QACL,kBAAkB;QAClB,UAAU;QACV,cAAc;QACd,UAAU;KACX,CAAC,CAAC;IAEH,mCAAmC;IACnC,OAAO,IAAA,kBAAW,EAAC,UAAU,EAAE,SAAS,CAAC,CAAC;AAC5C,CAAC;AAOD,mCAAqD;AAA5C,mHAAA,yBAAyB,OAAA;AAElC,wCAAwC;AACxC,oFAAiF;AAAxE,kIAAA,sBAAsB,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clsx.d.ts","sourceRoot":"","sources":["../../src/module-alias/clsx.ts"],"names":[],"mappings":"AAAA,OAAY,EAAE,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAG5C,wBAAgB,IAAI,CAAC,GAAG,IAAI,EAAE,UAAU,EAAE,UAEzC;AAED,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
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.clsx = clsx;
|
|
7
|
+
const clsx_1 = __importDefault(require("clsx"));
|
|
8
|
+
const tailwind_merge_1 = require("tailwind-merge");
|
|
9
|
+
function clsx(...args) {
|
|
10
|
+
return (0, tailwind_merge_1.twMerge)((0, clsx_1.default)(...args));
|
|
11
|
+
}
|
|
12
|
+
exports.default = clsx;
|
|
13
|
+
//# sourceMappingURL=clsx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clsx.js","sourceRoot":"","sources":["../../src/module-alias/clsx.ts"],"names":[],"mappings":";;;;;AAGA,oBAEC;AALD,gDAA4C;AAC5C,mDAAyC;AAEzC,SAAgB,IAAI,CAAC,GAAG,IAAkB;IACxC,OAAO,IAAA,wBAAO,EAAC,IAAA,cAAG,EAAC,GAAG,IAAI,CAAC,CAAC,CAAC;AAC/B,CAAC;AAED,kBAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"echarts.d.ts","sourceRoot":"","sources":["../../src/module-alias/echarts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,SAAS,CAAC;AAC7C,cAAc,SAAS,CAAC;AAOxB,wBAAgB,qBAAqB,IAAI,IAAI,CAoB5C"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.echarts = void 0;
|
|
21
|
+
exports.resgisterEchartsTheme = resgisterEchartsTheme;
|
|
22
|
+
// @ts-nocheck - echarts types are complex, ignore for re-export
|
|
23
|
+
var echarts_1 = require("echarts");
|
|
24
|
+
Object.defineProperty(exports, "echarts", { enumerable: true, get: function () { return __importDefault(echarts_1).default; } });
|
|
25
|
+
__exportStar(require("echarts"), exports);
|
|
26
|
+
const echarts_2 = require("echarts");
|
|
27
|
+
const registry_echarts_theme_1 = require("./registry_echarts_theme");
|
|
28
|
+
let isRegistered = false;
|
|
29
|
+
function resgisterEchartsTheme() {
|
|
30
|
+
// Register ud theme, only register once globally
|
|
31
|
+
if (isRegistered) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
isRegistered = true;
|
|
35
|
+
// After bundling main.js defer execution, css will be loaded
|
|
36
|
+
(0, echarts_2.registerTheme)('ud', (0, registry_echarts_theme_1.getShadcnEChartsTheme)());
|
|
37
|
+
if (process.env.NODE_ENV === 'development') {
|
|
38
|
+
// Listen for HMR update completion to re-register theme
|
|
39
|
+
// Vite uses import.meta.hot instead of webpack's module.hot
|
|
40
|
+
// @ts-ignore - import.meta.hot is Vite-specific
|
|
41
|
+
if (import.meta.hot) {
|
|
42
|
+
// @ts-ignore
|
|
43
|
+
import.meta.hot.on('vite:afterUpdate', () => {
|
|
44
|
+
(0, echarts_2.registerTheme)('ud', (0, registry_echarts_theme_1.getShadcnEChartsTheme)());
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
resgisterEchartsTheme();
|
|
50
|
+
//# sourceMappingURL=echarts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"echarts.js","sourceRoot":"","sources":["../../src/module-alias/echarts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AASA,sDAoBC;AA7BD,gEAAgE;AAChE,mCAA6C;AAApC,mHAAA,OAAO,OAAW;AAC3B,0CAAwB;AAExB,qCAAwC;AACxC,qEAAiE;AAEjE,IAAI,YAAY,GAAG,KAAK,CAAC;AAEzB,SAAgB,qBAAqB;IACnC,iDAAiD;IACjD,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO;IACT,CAAC;IACD,YAAY,GAAG,IAAI,CAAC;IACpB,6DAA6D;IAC7D,IAAA,uBAAa,EAAC,IAAI,EAAE,IAAA,8CAAqB,GAAE,CAAC,CAAC;IAE7C,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE,CAAC;QAC3C,wDAAwD;QACxD,4DAA4D;QAC5D,gDAAgD;QAChD,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;YACpB,aAAa;YACb,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;gBAC1C,IAAA,uBAAa,EAAC,IAAI,EAAE,IAAA,8CAAqB,GAAE,CAAC,CAAC;YAC/C,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC;AAED,qBAAqB,EAAE,CAAC"}
|