@halo-dev/ui-plugin-bundler-kit 2.22.0 → 2.23.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.mjs +5 -16
- package/package.json +8 -10
- package/src/utils/halo-plugin.ts +1 -1
- package/tsconfig.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import yaml from "js-yaml";
|
|
2
1
|
import fs from "node:fs";
|
|
2
|
+
import yaml from "js-yaml";
|
|
3
3
|
import { defineConfig, mergeRsbuildConfig } from "@rsbuild/core";
|
|
4
4
|
import { pluginVue } from "@rsbuild/plugin-vue";
|
|
5
5
|
import Vue from "@vitejs/plugin-vue";
|
|
6
6
|
import { defineConfig as defineConfig$1, mergeConfig } from "vite";
|
|
7
|
-
|
|
8
7
|
//#region src/constants/build.ts
|
|
9
8
|
const DEFAULT_OUT_DIR_DEV = "../build/resources/main/console";
|
|
10
9
|
const DEFAULT_OUT_DIR_PROD = "./build/dist";
|
|
11
|
-
|
|
12
10
|
//#endregion
|
|
13
11
|
//#region src/constants/externals.ts
|
|
14
12
|
const GLOBALS = {
|
|
@@ -25,17 +23,11 @@ const GLOBALS = {
|
|
|
25
23
|
axios: "axios"
|
|
26
24
|
};
|
|
27
25
|
const EXTERNALS = Object.keys(GLOBALS);
|
|
28
|
-
|
|
29
|
-
//#endregion
|
|
30
|
-
//#region src/constants/halo-plugin.ts
|
|
31
|
-
const DEFAULT_MANIFEST_PATH = "../src/main/resources/plugin.yaml";
|
|
32
|
-
|
|
33
26
|
//#endregion
|
|
34
27
|
//#region src/utils/halo-plugin.ts
|
|
35
28
|
function getHaloPluginManifest(manifestPath) {
|
|
36
29
|
return yaml.load(fs.readFileSync(manifestPath, "utf8"));
|
|
37
30
|
}
|
|
38
|
-
|
|
39
31
|
//#endregion
|
|
40
32
|
//#region src/legacy.ts
|
|
41
33
|
const LEGACY_OUT_DIR_PROD = "../src/main/resources/console";
|
|
@@ -50,7 +42,7 @@ function HaloUIPluginBundlerKit(options = {}) {
|
|
|
50
42
|
let outDir = isProduction ? LEGACY_OUT_DIR_PROD : DEFAULT_OUT_DIR_DEV;
|
|
51
43
|
if (options.outDir) if (typeof options.outDir === "string") outDir = options.outDir;
|
|
52
44
|
else outDir = isProduction ? options.outDir.prod : options.outDir.dev;
|
|
53
|
-
const manifest = getHaloPluginManifest(options.manifestPath ||
|
|
45
|
+
const manifest = getHaloPluginManifest(options.manifestPath || "../src/main/resources/plugin.yaml");
|
|
54
46
|
return {
|
|
55
47
|
...config,
|
|
56
48
|
define: { "process.env": process.env },
|
|
@@ -75,7 +67,6 @@ function HaloUIPluginBundlerKit(options = {}) {
|
|
|
75
67
|
}
|
|
76
68
|
};
|
|
77
69
|
}
|
|
78
|
-
|
|
79
70
|
//#endregion
|
|
80
71
|
//#region src/rsbuild.ts
|
|
81
72
|
function createRsbuildPresetsConfig(manifestPath) {
|
|
@@ -150,12 +141,11 @@ function createRsbuildPresetsConfig(manifestPath) {
|
|
|
150
141
|
* @returns
|
|
151
142
|
*/
|
|
152
143
|
function rsbuildConfig(config) {
|
|
153
|
-
const presetsConfigFn = createRsbuildPresetsConfig(config?.manifestPath ||
|
|
144
|
+
const presetsConfigFn = createRsbuildPresetsConfig(config?.manifestPath || "../src/main/resources/plugin.yaml");
|
|
154
145
|
return defineConfig((env) => {
|
|
155
146
|
return mergeRsbuildConfig(presetsConfigFn(env), typeof config?.rsbuild === "function" ? config.rsbuild(env) : config?.rsbuild || {});
|
|
156
147
|
});
|
|
157
148
|
}
|
|
158
|
-
|
|
159
149
|
//#endregion
|
|
160
150
|
//#region src/vite.ts
|
|
161
151
|
function createVitePresetsConfig(manifestPath) {
|
|
@@ -202,11 +192,10 @@ function createVitePresetsConfig(manifestPath) {
|
|
|
202
192
|
* ```
|
|
203
193
|
*/
|
|
204
194
|
function viteConfig(config) {
|
|
205
|
-
const presetsConfigFn = createVitePresetsConfig(config?.manifestPath ||
|
|
195
|
+
const presetsConfigFn = createVitePresetsConfig(config?.manifestPath || "../src/main/resources/plugin.yaml");
|
|
206
196
|
return defineConfig$1((env) => {
|
|
207
197
|
return mergeConfig(presetsConfigFn(env), typeof config?.vite === "function" ? config.vite(env) : config?.vite || {});
|
|
208
198
|
});
|
|
209
199
|
}
|
|
210
|
-
|
|
211
200
|
//#endregion
|
|
212
|
-
export { HaloUIPluginBundlerKit, rsbuildConfig, viteConfig };
|
|
201
|
+
export { HaloUIPluginBundlerKit, rsbuildConfig, viteConfig };
|
package/package.json
CHANGED
|
@@ -1,37 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@halo-dev/ui-plugin-bundler-kit",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.23.0",
|
|
4
4
|
"homepage": "https://github.com/halo-dev/halo/tree/main/ui/packages/ui-plugin-bundler-kit#readme",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/halo-dev/halo/issues"
|
|
7
7
|
},
|
|
8
|
+
"license": "GPL-3.0",
|
|
9
|
+
"author": "@halo-dev",
|
|
8
10
|
"repository": {
|
|
9
11
|
"type": "git",
|
|
10
12
|
"url": "https://github.com/halo-dev/halo.git",
|
|
11
13
|
"directory": "ui/packages/ui-plugin-bundler-kit"
|
|
12
14
|
},
|
|
13
|
-
"license": "GPL-3.0",
|
|
14
|
-
"author": "@halo-dev",
|
|
15
15
|
"type": "module",
|
|
16
|
+
"types": "./dist/index.d.mts",
|
|
16
17
|
"exports": {
|
|
17
18
|
".": "./dist/index.mjs",
|
|
18
19
|
"./package.json": "./package.json"
|
|
19
20
|
},
|
|
20
|
-
"main": "./dist/index.mjs",
|
|
21
|
-
"module": "./dist/index.mjs",
|
|
22
|
-
"types": "./dist/index.d.mts",
|
|
23
21
|
"dependencies": {
|
|
24
22
|
"js-yaml": "^4.1.1",
|
|
25
|
-
"@halo-dev/api-client": "2.
|
|
23
|
+
"@halo-dev/api-client": "2.23.0"
|
|
26
24
|
},
|
|
27
25
|
"devDependencies": {
|
|
28
26
|
"@types/js-yaml": "^4.0.9"
|
|
29
27
|
},
|
|
30
28
|
"peerDependencies": {
|
|
31
|
-
"@rsbuild/core": "^1.0.0",
|
|
32
|
-
"@rsbuild/plugin-vue": "^1.0.0",
|
|
29
|
+
"@rsbuild/core": "^1.0.0 || ^2.0.0",
|
|
30
|
+
"@rsbuild/plugin-vue": "^1.0.0 || ^2.0.0",
|
|
33
31
|
"@vitejs/plugin-vue": "^5.0.0 || ^6.0.0",
|
|
34
|
-
"vite": "^
|
|
32
|
+
"vite": "^6.0.0 || ^7.0.0 || ^8.0.0"
|
|
35
33
|
},
|
|
36
34
|
"engines": {
|
|
37
35
|
"node": "^18.0.0 || >=20.0.0"
|
package/src/utils/halo-plugin.ts
CHANGED