Skip to content

Commit

Permalink
chore(builder-related): add deprecated warning (#5204)
Browse files Browse the repository at this point in the history
Co-authored-by: neverland <chenjiahan.jait@bytedance.com>
  • Loading branch information
9aoy and chenjiahan committed Jan 10, 2024
1 parent 54f749c commit 22d9635
Show file tree
Hide file tree
Showing 20 changed files with 36 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .changeset/mighty-lies-lie.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
'@modern-js/builder-cli': patch
---

chore(builder-cli): add deprecated warning, please use rsbuild instead
chore(builder-related): add deprecated warning for builder related packages, please use rsbuild instead

chore(builder-cli): 添加废弃声明,推荐使用 rsbuild 代替
chore(builder-related): 为 builder 相关包添加废弃声明,推荐使用 rsbuild 代替
1 change: 1 addition & 0 deletions packages/builder/builder-cli/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
> DEPRECATED: use [Rsbuild](https://github.com/web-infra-dev/rsbuild) instead.
<p align="center">
<a href="https://modernjs.dev" target="blank"><img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png" width="300" alt="Modern.js Logo" /></a>
Expand Down
1 change: 1 addition & 0 deletions packages/builder/builder-rspack-provider/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
> DEPRECATED: use [Rsbuild](https://github.com/web-infra-dev/rsbuild) instead.
<p align="center">
<a href="https://modernjs.dev" target="blank"><img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png" width="300" alt="Modern.js Logo" /></a>
Expand Down
1 change: 1 addition & 0 deletions packages/builder/builder-shared/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
> DEPRECATED: use [Rsbuild](https://github.com/web-infra-dev/rsbuild) instead.
<p align="center">
<a href="https://modernjs.dev" target="blank"><img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png" width="300" alt="Modern.js Logo" /></a>
Expand Down
1 change: 1 addition & 0 deletions packages/builder/builder-webpack-provider/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
> DEPRECATED: use [Rsbuild](https://github.com/web-infra-dev/rsbuild) instead.
<p align="center">
<a href="https://modernjs.dev" target="blank"><img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png" width="300" alt="Modern.js Logo" /></a>
Expand Down
1 change: 1 addition & 0 deletions packages/builder/builder/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
> DEPRECATED: use [Rsbuild](https://github.com/web-infra-dev/rsbuild) instead.
<p align="center">
<a href="https://modernjs.dev" target="blank"><img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png" width="300" alt="Modern.js Logo" /></a>
Expand Down
2 changes: 2 additions & 0 deletions packages/builder/plugin-esbuild/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
> DEPRECATED: use [Rsbuild](https://github.com/web-infra-dev/rsbuild) instead.
<p align="center">
<a href="https://modernjs.dev" target="blank"><img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png" width="300" alt="Modern.js Logo" /></a>
</p>
Expand Down
3 changes: 3 additions & 0 deletions packages/builder/plugin-esbuild/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export interface PluginEsbuildOptions {
minimize?: false | MinifyPluginOptions;
}

/**
* @deprecated Using @rsbuild/plugin-esbuild instead.
* */
export function builderPluginEsbuild(
userOptions: PluginEsbuildOptions = {},
): BuilderPlugin<BuilderPluginAPI> {
Expand Down
1 change: 1 addition & 0 deletions packages/builder/plugin-image-compress/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
> DEPRECATED: use [Rsbuild](https://github.com/web-infra-dev/rsbuild) instead.
<p align="center">
<a href="https://modernjs.dev" target="blank"><img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png" width="300" alt="Modern.js Logo" /></a>
Expand Down
6 changes: 5 additions & 1 deletion packages/builder/plugin-image-compress/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ const normalizeOptions = (options: Options[]) => {
return normalized;
};

/** Options enable by default: {@link DEFAULT_OPTIONS} */
/**
* @deprecated Using [@rsbuild/plugin-image-compress](https://rsbuild.dev/plugins/list/plugin-image-compress) instead.
*
* Options enable by default: {@link DEFAULT_OPTIONS}
* */
export const builderPluginImageCompress: IPluginImageCompress = (
...args
): BuilderPlugin => ({
Expand Down
1 change: 1 addition & 0 deletions packages/builder/plugin-node-polyfill/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
> DEPRECATED: use [Rsbuild](https://github.com/web-infra-dev/rsbuild) instead.
<p align="center">
<a href="https://modernjs.dev" target="blank"><img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png" width="300" alt="Modern.js Logo" /></a>
Expand Down
8 changes: 2 additions & 6 deletions packages/builder/plugin-node-polyfill/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,8 @@ const getProvideLibs = async () => {
};

/**
* Usage:
*
* const { builderPluginNodePolyfill } = await import('@modern-js/builder-plugin-node-polyfill');
*
* builder.addPlugins([ builderPluginNodePolyfill() ]);
*/
* @deprecated Using [@rsbuild/plugin-node-polyfill](https://rsbuild.dev/plugins/list/plugin-node-polyfill) instead.
* */
export function builderPluginNodePolyfill(): BuilderPlugin<
WebpackBuilderPluginAPI | RspackBuilderPluginAPI
> {
Expand Down
1 change: 1 addition & 0 deletions packages/builder/plugin-stylus/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
> DEPRECATED: use [Rsbuild](https://github.com/web-infra-dev/rsbuild) instead.
<p align="center">
<a href="https://modernjs.dev" target="blank"><img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png" width="300" alt="Modern.js Logo" /></a>
Expand Down
3 changes: 3 additions & 0 deletions packages/builder/plugin-stylus/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ type StylusLoaderOptions = {

export type PluginStylusOptions = StylusLoaderOptions;

/**
* @deprecated Using [@rsbuild/plugin-stylus](https://rsbuild.dev/plugins/list/plugin-stylus) instead.
* */
export function builderPluginStylus(
options?: PluginStylusOptions,
): BuilderPlugin<BuilderPluginAPI> {
Expand Down
1 change: 1 addition & 0 deletions packages/builder/plugin-swc/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
> DEPRECATED: use [Rsbuild](https://github.com/web-infra-dev/rsbuild) instead.
<p align="center">
<a href="https://modernjs.dev" target="blank"><img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png" width="300" alt="Modern.js Logo" /></a>
Expand Down
2 changes: 2 additions & 0 deletions packages/builder/plugin-swc/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import { SwcMinimizerPlugin } from './minizer';
const PLUGIN_NAME = 'builder-plugin-swc';

/**
* @deprecated Using \@rsbuild/plugin-swc instead.
*
* In this plugin, we do:
* - Remove Babel loader if exists
* - Add our own swc loader
Expand Down
1 change: 1 addition & 0 deletions packages/builder/plugin-vue/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
> DEPRECATED: use [Rsbuild](https://github.com/web-infra-dev/rsbuild) instead.
<p align="center">
<a href="https://modernjs.dev" target="blank"><img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png" width="300" alt="Modern.js Logo" /></a>
Expand Down
3 changes: 3 additions & 0 deletions packages/builder/plugin-vue/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ export type PluginVueOptions = {
vueLoaderOptions?: VueLoaderOptions;
};

/**
* @deprecated Using [@rsbuild/plugin-vue](https://rsbuild.dev/plugins/list/plugin-vue) instead.
* */
export function builderPluginVue(
options: PluginVueOptions = {},
): BuilderPlugin<BuilderPluginAPI> {
Expand Down
1 change: 1 addition & 0 deletions packages/builder/plugin-vue2/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
> DEPRECATED: use [Rsbuild](https://github.com/web-infra-dev/rsbuild) instead.
<p align="center">
<a href="https://modernjs.dev" target="blank"><img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png" width="300" alt="Modern.js Logo" /></a>
Expand Down
3 changes: 3 additions & 0 deletions packages/builder/plugin-vue2/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export type PluginVueOptions = {
vueLoaderOptions?: VueLoaderOptions;
};

/**
* @deprecated Using [@rsbuild/plugin-vue2](https://rsbuild.dev/plugins/list/plugin-vue2) instead.
* */
export function builderPluginVue2(
options: PluginVueOptions = {},
): BuilderPlugin<BuilderPluginAPI> {
Expand Down

0 comments on commit 22d9635

Please sign in to comment.