@bleedingdev/modern-js-builder 3.9.0-ultramodern.9 → 3.9.3-ultramodern.2

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.
@@ -8,7 +8,10 @@ import type { RsbuildPlugin } from '@rsbuild/core';
8
8
  * 4. Adding entry name virtual module for client-side entries
9
9
  * 5. Adding 'use server-entry' directive to route components
10
10
  */
11
- export declare function pluginRscConfig(): RsbuildPlugin;
11
+ export declare function pluginRscConfig(environments?: {
12
+ server?: string;
13
+ client?: string;
14
+ }, rscLayerMatchers?: RegExp[]): RsbuildPlugin;
12
15
  /**
13
16
  * Get RSC plugins based on configuration
14
17
  * @param enableRsc - Whether RSC is enabled
@@ -0,0 +1,32 @@
1
+ import type { PluginLessOptions } from '@rsbuild/plugin-less';
2
+ import type { PluginSassOptions } from '../sass/index.js';
3
+ import type { PluginSvgrOptions, SvgDefaultExport } from '@rsbuild/plugin-svgr';
4
+ import type { BuilderConfig } from '../types.js';
5
+ type BuilderToolsConfig = NonNullable<BuilderConfig['tools']>;
6
+ /** Reset the warn-once state. Only meant for unit tests. */
7
+ export declare const resetPluginOptionsWarnings: () => void;
8
+ /**
9
+ * `tools.less` accepts either the full options of `@rsbuild/plugin-less`
10
+ * or, for backward compatibility, the less-loader options directly
11
+ * (object, function or array form). The legacy form is wrapped into
12
+ * `lessLoaderOptions` so the generated bundler config stays unchanged.
13
+ */
14
+ export declare const normalizeLessOptions: (less: BuilderToolsConfig['less']) => PluginLessOptions;
15
+ /**
16
+ * Same as {@link normalizeLessOptions} for `tools.sass`.
17
+ */
18
+ export declare const normalizeSassOptions: (sass: BuilderToolsConfig['sass']) => PluginSassOptions;
19
+ /**
20
+ * Resolve the options passed to `@rsbuild/plugin-svgr`, or `false` when the
21
+ * plugin should not be registered.
22
+ *
23
+ * `tools.svgr` takes precedence over the deprecated `output.disableSvgr` and
24
+ * `output.svgDefaultExport`; the two legacy options keep working when
25
+ * `tools.svgr` is not set.
26
+ */
27
+ export declare const resolveSvgrOptions: ({ svgr, disableSvgr, svgDefaultExport, }: {
28
+ svgr: BuilderToolsConfig['svgr'];
29
+ disableSvgr?: boolean;
30
+ svgDefaultExport?: SvgDefaultExport;
31
+ }) => PluginSvgrOptions | false;
32
+ export {};
@@ -18,10 +18,8 @@ export type TsCheckerOptions = Parameters<TsCheckerFn>[0];
18
18
  */
19
19
  export declare const refreshTsgoCheckerConfig: (checkerConfigFile: string) => string | undefined;
20
20
  /**
21
- * Type checking runs on TypeScript Go (`tsgo`) by default. The checker
22
- * prefers the project's stable TypeScript 7 package, then falls back to
23
- * `@typescript/native-preview` for projects still on the preview lane.
24
- * Set `tools.tsChecker.typescript.tsgo: false` to use the classic checker.
21
+ * Type checking uses the canonical stable TypeScript 7.0.2 package by default,
22
+ * supplied by the project or the builder's declared production dependency.
25
23
  */
26
24
  export declare const withTsgoDefaults: (userOptions: TsCheckerChain | undefined, rootPath: string) => TsCheckerChain;
27
25
  export {};
@@ -1,16 +1,20 @@
1
- import type { AliasOption } from '@modern-js/utils';
1
+ import type { AliasOption } from '@modern-js/utils/alias';
2
2
  import type { ConfigChain, ConfigChainWithContext, DevConfig, DistPathConfig, EnvironmentConfig, HtmlConfig, OutputConfig, Polyfill, RsbuildConfig, RsbuildPluginAPI, RsbuildPlugins, RsbuildTarget, Rspack, SecurityConfig, ServerConfig, SourceConfig, ToolsConfig } from '@rsbuild/core';
3
3
  import type { PluginAssetsRetryOptions } from '@rsbuild/plugin-assets-retry';
4
4
  import type { PluginCheckSyntaxOptions } from '@rsbuild/plugin-check-syntax';
5
5
  import type { PluginCssMinimizerOptions } from './css-minimizer/index.js';
6
6
  import type { PluginLessOptions } from '@rsbuild/plugin-less';
7
- import type { PluginReactOptions } from '@rsbuild/plugin-react';
8
7
  import type { PluginRemOptions } from '@rsbuild/plugin-rem';
9
8
  import type { PluginSassOptions } from './sass/index.js';
10
9
  import type { PluginSourceBuildOptions } from '@rsbuild/plugin-source-build';
11
- type SvgDefaultExport = 'component' | 'url';
12
10
  import type { PluginTypeCheckerOptions } from '@rsbuild/plugin-type-check';
13
11
  import type { Options as AutoprefixerOptions } from 'autoprefixer';
12
+ /** Renderer-owned SVG compiler options, registered by the selected React owner. */
13
+ export interface BuilderSvgOptions {
14
+ }
15
+ type RegisteredSvgOptions = BuilderSvgOptions extends {
16
+ options: infer Options;
17
+ } ? Options : never;
14
18
  export type CacheGroup = Rspack.OptimizationSplitChunksCacheGroup;
15
19
  export type Stats = Omit<Rspack.Stats, '#private' | 'hash' | 'startTime' | 'endTime'>;
16
20
  export type RspackConfig = Rspack.Configuration;
@@ -105,13 +109,29 @@ export type BuilderExtraConfig = {
105
109
  */
106
110
  minifyCss?: PluginCssMinimizerOptions['pluginOptions'];
107
111
  /**
108
- * Modify the config of [less-loader](https://github.com/webpack-contrib/less-loader).
112
+ * Modify the options of [@rsbuild/plugin-less](https://rsbuild.rs/plugins/list/plugin-less),
113
+ * such as `lessLoaderOptions`, `include`, `exclude` and `parallel`.
114
+ *
115
+ * Passing the [less-loader](https://github.com/webpack-contrib/less-loader)
116
+ * options directly is still supported for backward compatibility, but is
117
+ * deprecated: move them under `lessLoaderOptions`.
109
118
  */
110
- less?: PluginLessOptions['lessLoaderOptions'];
119
+ less?: PluginLessOptions['lessLoaderOptions'] | PluginLessOptions;
111
120
  /**
112
- * Modify the config of [sass-loader](https://github.com/webpack-contrib/sass-loader).
121
+ * Modify the options of [@rsbuild/plugin-sass](https://rsbuild.rs/plugins/list/plugin-sass),
122
+ * such as `sassLoaderOptions`, `include`, `exclude` and `rewriteUrls`.
123
+ *
124
+ * Passing the [sass-loader](https://github.com/webpack-contrib/sass-loader)
125
+ * options directly is still supported for backward compatibility, but is
126
+ * deprecated: move them under `sassLoaderOptions`.
113
127
  */
114
- sass?: PluginSassOptions['sassLoaderOptions'];
128
+ sass?: PluginSassOptions['sassLoaderOptions'] | PluginSassOptions;
129
+ /**
130
+ * Modify the options of [@rsbuild/plugin-svgr](https://rsbuild.rs/plugins/list/plugin-svgr),
131
+ * such as `svgrOptions`, `parallel`, `exclude` and `query`.
132
+ * Set to `false` to disable SVGR; all `.svg` files are then treated as static assets.
133
+ */
134
+ svgr?: [RegisteredSvgOptions] extends [never] ? false : ConfigChain<RegisteredSvgOptions> | false;
115
135
  };
116
136
  dev?: {
117
137
  /** Set the page URL to open when the server starts. */
@@ -150,10 +170,13 @@ export type BuilderExtraConfig = {
150
170
  * The transform is enabled by default through Rsbuild's SWC integration.
151
171
  * Set this to `false` to disable it.
152
172
  *
173
+ * Only browser environments (`output.target: 'web'`) are compiled;
174
+ * `node` and `web-worker` (SSR, BFF) environments never are.
175
+ *
153
176
  * For React 17 or 18, install `react-compiler-runtime` and set the
154
177
  * matching target version, for example `{ target: '18' }`.
155
178
  */
156
- reactCompiler?: PluginReactOptions['reactCompiler'];
179
+ reactCompiler?: Rspack.SwcLoaderTransformConfig['reactCompiler'];
157
180
  };
158
181
  output?: {
159
182
  /**
@@ -186,10 +209,14 @@ export type BuilderExtraConfig = {
186
209
  disableTsChecker?: boolean;
187
210
  /**
188
211
  * Configure the default export type of SVG files.
212
+ * @deprecated Use `tools.svgr.svgrOptions.exportType` instead:
213
+ * `'component'` maps to `exportType: 'default'`, `'url'` maps to `exportType: 'named'`.
189
214
  */
190
- svgDefaultExport?: SvgDefaultExport;
215
+ svgDefaultExport?: 'component' | 'url';
191
216
  /**
192
217
  * Whether to transform SVGs into React components. If true, will treat all .svg files as assets.
218
+ * @deprecated Use `tools.svgr` instead: `output.disableSvgr: true` maps to `tools.svgr: false`;
219
+ * `false` is the default behavior and can simply be removed.
193
220
  */
194
221
  disableSvgr?: boolean;
195
222
  };
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@bleedingdev/modern-js-builder",
3
- "version": "3.9.0-ultramodern.9",
3
+ "version": "3.9.3-ultramodern.2",
4
4
  "description": "A builder for Modern.js",
5
5
  "repository": {
6
6
  "type": "git",
7
- "url": "git+https://github.com/BleedingDev/ultramodern.js.git",
7
+ "url": "git+https://github.com/ultramodernjs/ultramodern.js.git",
8
8
  "directory": "packages/cli/builder"
9
9
  },
10
10
  "license": "MIT",
@@ -17,6 +17,9 @@
17
17
  "require": "./dist/cjs/index.js"
18
18
  },
19
19
  "default": "./dist/cjs/index.js"
20
+ },
21
+ "./types": {
22
+ "types": "./dist/types/types.d.ts"
20
23
  }
21
24
  },
22
25
  "main": "./dist/cjs/index.js",
@@ -27,57 +30,66 @@
27
30
  ],
28
31
  "dependencies": {
29
32
  "@jridgewell/trace-mapping": "^0.3.31",
30
- "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.0-ultramodern.9",
31
- "@rsbuild/core": "2.2.3",
33
+ "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.3-ultramodern.2",
34
+ "@rsbuild/core": "2.2.11",
32
35
  "@rsbuild/plugin-assets-retry": "2.0.2",
33
36
  "@rsbuild/plugin-check-syntax": "2.0.1",
34
37
  "@rsbuild/plugin-css-minimizer": "2.0.1",
35
38
  "@rsbuild/plugin-less": "2.0.1",
36
- "@rsbuild/plugin-react": "2.1.0",
37
39
  "@rsbuild/plugin-rem": "1.0.6",
38
40
  "@rsbuild/plugin-sass": "2.0.1",
39
- "@rsbuild/plugin-source-build": "1.0.6",
40
- "@rsbuild/plugin-svgr": "2.0.5",
41
+ "@rsbuild/plugin-source-build": "1.0.7",
41
42
  "@rsbuild/plugin-type-check": "1.6.0",
42
43
  "@rsbuild/plugin-typed-css-modules": "1.2.4",
43
- "@swc/core": "1.16.2",
44
+ "@swc/core": "1.16.13",
44
45
  "@swc/helpers": "^0.5.23",
45
- "autoprefixer": "10.5.5",
46
- "browserslist": "4.28.9",
46
+ "autoprefixer": "10.6.1",
47
+ "browserslist": "4.29.3",
47
48
  "core-js": "^3.50.0",
48
- "cssnano": "9.0.3",
49
+ "cssnano": "9.1.2",
49
50
  "html-minifier-terser": "^7.2.0",
50
51
  "lodash": "^4.18.1",
51
52
  "postcss": "^8.5.28",
52
- "postcss-custom-properties": "15.0.1",
53
+ "postcss-custom-properties": "15.0.3",
53
54
  "postcss-flexbugs-fixes": "5.0.2",
54
55
  "postcss-font-variant": "5.0.0",
55
56
  "postcss-initial": "4.0.1",
56
57
  "postcss-media-minmax": "5.0.0",
57
- "postcss-nesting": "14.0.1",
58
+ "postcss-nesting": "14.0.2",
58
59
  "postcss-page-break": "3.0.4",
59
60
  "rspack-manifest-plugin": "5.2.2",
60
- "sass-embedded": "1.100.0",
61
- "ts-deepmerge": "8.0.0"
61
+ "sass-embedded": "1.105.1",
62
+ "ts-deepmerge": "8.0.0",
63
+ "typescript": "7.0.2",
64
+ "webpack": "5.111.1"
62
65
  },
63
66
  "devDependencies": {
64
- "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.9.0-ultramodern.9",
65
- "@rsdoctor/rspack-plugin": "^1.6.3",
66
- "@rslib/core": "1.0.0",
67
+ "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.9.3-ultramodern.2",
68
+ "@rsbuild/plugin-react": "2.1.1",
69
+ "@rsbuild/plugin-svgr": "2.0.5",
70
+ "@rsdoctor/rspack-plugin": "^1.6.4",
71
+ "@rslib/core": "1.0.3",
67
72
  "@scripts/rstest-config": "2.66.0",
68
73
  "@types/html-minifier-terser": "^7.0.2",
69
74
  "@types/lodash": "^4.17.25",
70
- "react": "^19.2.8",
75
+ "react": "^19.3.0",
71
76
  "react-server-dom-rspack": "0.1.0",
72
77
  "rsbuild-plugin-rsc": "0.1.1",
73
- "terser": "^5.51.2",
74
- "typescript": "^7.0.2"
78
+ "terser": "^5.51.2"
75
79
  },
76
80
  "peerDependencies": {
81
+ "@rsbuild/plugin-react": "2.1.1",
82
+ "@rsbuild/plugin-svgr": "2.0.5",
77
83
  "react-server-dom-rspack": "0.1.0",
78
84
  "rsbuild-plugin-rsc": "0.1.1"
79
85
  },
80
86
  "peerDependenciesMeta": {
87
+ "@rsbuild/plugin-react": {
88
+ "optional": true
89
+ },
90
+ "@rsbuild/plugin-svgr": {
91
+ "optional": true
92
+ },
81
93
  "react-server-dom-rspack": {
82
94
  "optional": true
83
95
  },
@@ -94,8 +106,11 @@
94
106
  "test": "rstest run",
95
107
  "test:watch": "rstest watch"
96
108
  },
97
- "homepage": "https://github.com/BleedingDev/ultramodern.js#readme",
109
+ "homepage": "https://github.com/ultramodernjs/ultramodern.js#readme",
98
110
  "bugs": {
99
- "url": "https://github.com/BleedingDev/ultramodern.js/issues"
111
+ "url": "https://github.com/ultramodernjs/ultramodern.js/issues"
112
+ },
113
+ "ultramodern": {
114
+ "sourceName": "@modern-js/builder"
100
115
  }
101
116
  }