@lark-apaas/fullstack-vite-preset 1.0.2-alpha.6 → 1.0.2-alpha.8
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/lib/module-alias/echarts.d.ts +1 -2
- package/lib/module-alias/echarts.d.ts.map +1 -1
- package/lib/module-alias/echarts.js +8 -27
- package/lib/module-alias/echarts.js.map +1 -1
- 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/package.json +2 -2
- package/src/module-alias/echarts.mjs +1 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"echarts.d.ts","sourceRoot":"","sources":["../../src/module-alias/echarts.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
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"}
|
|
@@ -10,39 +10,20 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
15
|
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
38
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
20
|
exports.echarts = void 0;
|
|
40
21
|
exports.resgisterEchartsTheme = resgisterEchartsTheme;
|
|
41
22
|
// @ts-nocheck - echarts types are complex, ignore for re-export
|
|
42
|
-
|
|
43
|
-
exports
|
|
23
|
+
var echarts_1 = require("echarts");
|
|
24
|
+
Object.defineProperty(exports, "echarts", { enumerable: true, get: function () { return __importDefault(echarts_1).default; } });
|
|
44
25
|
__exportStar(require("echarts"), exports);
|
|
45
|
-
const
|
|
26
|
+
const echarts_2 = require("echarts");
|
|
46
27
|
const registry_echarts_theme_1 = require("./registry_echarts_theme");
|
|
47
28
|
let isRegistered = false;
|
|
48
29
|
function resgisterEchartsTheme() {
|
|
@@ -52,7 +33,7 @@ function resgisterEchartsTheme() {
|
|
|
52
33
|
}
|
|
53
34
|
isRegistered = true;
|
|
54
35
|
// After bundling main.js defer execution, css will be loaded
|
|
55
|
-
(0,
|
|
36
|
+
(0, echarts_2.registerTheme)('ud', (0, registry_echarts_theme_1.getShadcnEChartsTheme)());
|
|
56
37
|
if (process.env.NODE_ENV === 'development') {
|
|
57
38
|
// Listen for HMR update completion to re-register theme
|
|
58
39
|
// Vite uses import.meta.hot instead of webpack's module.hot
|
|
@@ -60,7 +41,7 @@ function resgisterEchartsTheme() {
|
|
|
60
41
|
if (import.meta.hot) {
|
|
61
42
|
// @ts-ignore
|
|
62
43
|
import.meta.hot.on('vite:afterUpdate', () => {
|
|
63
|
-
(0,
|
|
44
|
+
(0, echarts_2.registerTheme)('ud', (0, registry_echarts_theme_1.getShadcnEChartsTheme)());
|
|
64
45
|
});
|
|
65
46
|
}
|
|
66
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"echarts.js","sourceRoot":"","sources":["../../src/module-alias/echarts.ts"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -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-plugins/inspector-css-plugin.ts"],"names":[],"mappings":";;;;;AAqBA,gDA8CC;AAnED,4CAAoB;AACpB,gDAAwB;AAGxB,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AACnD,MAAM,iBAAiB,GAAG,wDAAwD,CAAC;AAEnF;;;;;;;;;;;;;GAaG;AACH,SAAgB,kBAAkB,CAAC,OAA2B;IAC5D,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAC1B,IAAI,eAAe,GAAkB,IAAI,CAAC;IAE1C,OAAO;QACL,IAAI,EAAE,oBAAoB;QAC1B,OAAO,EAAE,KAAK;QAEd,cAAc,CA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DAAsD,CAAC,EAAE,CAAC,CAAC;gBAC1E,CAAC;gBACD,eAAe,GAAG,IAAI,CAAC;YACzB,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/fullstack-vite-preset",
|
|
3
|
-
"version": "1.0.2-alpha.
|
|
3
|
+
"version": "1.0.2-alpha.8",
|
|
4
4
|
"files": [
|
|
5
5
|
"lib",
|
|
6
6
|
"src/empty.css",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@babel/parser": "^7.28.0",
|
|
33
33
|
"@babel/traverse": "^7.28.0",
|
|
34
34
|
"@babel/types": "^7.28.2",
|
|
35
|
-
"@lark-apaas/devtool-kits": "1.2.17-alpha.
|
|
35
|
+
"@lark-apaas/devtool-kits": "1.2.17-alpha.29",
|
|
36
36
|
"@lark-apaas/miaoda-inspector-jsx-runtime": "^1.0.1",
|
|
37
37
|
"@lark-apaas/vite-inspector-plugin": "^1.0.1",
|
|
38
38
|
"@vitejs/plugin-react": "^4.5.0",
|