Commit Graph

3 Commits (main)

Author SHA1 Message Date
Ryan Wang 5e28c6db0c
chore: update prettier and simplify config (#7589)
#### What type of PR is this?

/area ui
/kind cleanup

#### What this PR does / why we need it:

Upgrade Prettier and related plugins, and simplify Prettier configuration.

Now, formatting for all packages will be managed by Prettier in the project root directory.

#### Does this PR introduce a user-facing change?

```release-note
None
```
2025-06-25 09:47:21 +00:00
Ryan Wang b602195b11
feat(ui-plugin-bundler-kit): support function-based configuration for env-aware builds (#7572)
#### What type of PR is this?

/area ui
/area plugin
/kind improvement
/milestone 2.21.x

#### What this PR does / why we need it:

rsbuild example:

```ts
export default rsbuildConfig({
  rsbuild: ({ env, envMode }) => {
    console.log(env,envMode);

    return {
      resolve: {
        alias: {
          "@": "./src",
        },
      },
      plugins: [pluginSass()],
    };
  },
});
```

```ts
export default viteConfig({
  vite: ({ mode }) => {
    const env = loadEnv(mode, process.cwd(), '');
    console.log(env);
    return {
      resolve: {
        alias: {
          "@": fileURLToPath(new URL("./src", import.meta.url)),
        },
      },
    };
  },
});
```

#### Does this PR introduce a user-facing change?

```release-note
None
```
2025-06-19 08:05:01 +00:00
Ryan Wang 1e5958dd5c
chore: refactor ui plugin bundler kit and support rsbuild (#7568)
#### What type of PR is this?

/area ui
/kind feature
/area plugin
/milestone 2.21.x

#### What this PR does / why we need it:

This PR adds Rsbuild preset configuration support and refactors the Vite preset configuration approach for `@halo-dev/ui-plugin-bundler-kit`.

- **Added Rsbuild support** - New `rsbuildConfig` function with pre-configured settings for Halo plugin development
- **Refactored Vite configuration** - Improved `viteConfig` function with better preset handling
- **Updated documentation** - Comprehensive README with usage examples and build tool comparison

example:

```typescript
// Vite
import { viteConfig } from "@halo-dev/ui-plugin-bundler-kit";
export default viteConfig({ vite: { /* custom config */ } });

// Rsbuild
import { rsbuildConfig } from "@halo-dev/ui-plugin-bundler-kit";
export default rsbuildConfig({ rsbuild: { /* custom config */ } });
```

real-world example: https://github.com/guqing/plugin-metrics-graph/pull/5

For detailed configuration options and examples, please refer to the updated README.md

⚠️ `HaloUIPluginBundlerKit` function is now deprecated (still functional but marked for removal)

#### Which issue(s) this PR fixes:

Fixes #

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?

```release-note
重构 `@halo-dev/ui-plugin-bundler-kit`,以预配置的方式为插件提供 Vite 和 Rsbuild 的构建配置。
```
2025-06-18 10:38:57 +00:00