@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 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 || DEFAULT_MANIFEST_PATH);
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 || DEFAULT_MANIFEST_PATH);
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 || DEFAULT_MANIFEST_PATH);
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.22.0",
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.22.0"
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": "^5.0.0 || ^6.0.0 || ^7.0.0"
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"
@@ -1,6 +1,6 @@
1
+ import fs from "node:fs";
1
2
  import type { Plugin as HaloPlugin } from "@halo-dev/api-client";
2
3
  import yaml from "js-yaml";
3
- import fs from "node:fs";
4
4
 
5
5
  export function getHaloPluginManifest(manifestPath: string) {
6
6
  const manifest = yaml.load(
package/tsconfig.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "outDir": "dist",
6
6
  "target": "ES2020",
7
7
  "module": "ES2020",
8
- "moduleResolution": "node",
8
+ "moduleResolution": "bundler",
9
9
  "strict": true,
10
10
  "declaration": true,
11
11
  "sourceMap": true,