@bleedingdev/modern-js-builder 3.2.0-ultramodern.99 → 3.4.0-ultramodern.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.
Files changed (42) hide show
  1. package/dist/cjs/createBuilder.js +13 -7
  2. package/dist/cjs/index.js +9 -5
  3. package/dist/cjs/plugins/devtools.js +12 -8
  4. package/dist/cjs/plugins/emitRouteFile.js +9 -5
  5. package/dist/cjs/plugins/environmentDefaults.js +9 -5
  6. package/dist/cjs/plugins/globalVars.js +9 -5
  7. package/dist/cjs/plugins/htmlMinify.js +9 -5
  8. package/dist/cjs/plugins/manifest.js +9 -5
  9. package/dist/cjs/plugins/postcss.js +16 -49
  10. package/dist/cjs/plugins/rscConfig.js +13 -6
  11. package/dist/cjs/plugins/rsdoctor.js +12 -8
  12. package/dist/cjs/plugins/runtimeChunk.js +9 -5
  13. package/dist/cjs/rsdoctorConfig.js +18 -0
  14. package/dist/cjs/shared/devServer.js +9 -5
  15. package/dist/cjs/shared/getCssSupport.js +9 -5
  16. package/dist/cjs/shared/manifest.js +12 -8
  17. package/dist/cjs/shared/parseCommonConfig.js +23 -11
  18. package/dist/cjs/shared/rsc/rsc-server-entry-loader.js +12 -8
  19. package/dist/cjs/shared/rsc/rscClientBrowserFallback.js +9 -5
  20. package/dist/cjs/shared/rsc/rscEmptyModule.js +12 -8
  21. package/dist/cjs/shared/tsgo.js +76 -0
  22. package/dist/cjs/shared/utils.js +9 -5
  23. package/dist/esm/createBuilder.mjs +4 -2
  24. package/dist/esm/plugins/postcss.mjs +5 -45
  25. package/dist/esm/plugins/rscConfig.mjs +4 -1
  26. package/dist/esm/rsdoctorConfig.mjs +0 -0
  27. package/dist/esm/shared/parseCommonConfig.mjs +14 -6
  28. package/dist/esm/shared/tsgo.mjs +35 -0
  29. package/dist/esm-node/createBuilder.mjs +4 -2
  30. package/dist/esm-node/plugins/postcss.mjs +5 -45
  31. package/dist/esm-node/plugins/rscConfig.mjs +4 -1
  32. package/dist/esm-node/rsdoctorConfig.mjs +1 -0
  33. package/dist/esm-node/shared/parseCommonConfig.mjs +14 -6
  34. package/dist/esm-node/shared/tsgo.mjs +36 -0
  35. package/dist/types/plugins/postcss.d.ts +1 -0
  36. package/dist/types/plugins/rscConfig.d.ts +10 -1
  37. package/dist/types/plugins/rsdoctor.d.ts +1 -1
  38. package/dist/types/rsdoctorConfig.d.ts +12 -0
  39. package/dist/types/shared/parseCommonConfig.d.ts +2 -1
  40. package/dist/types/shared/tsgo.d.ts +12 -0
  41. package/dist/types/types.d.ts +27 -14
  42. package/package.json +27 -27
@@ -10,6 +10,8 @@ import type { PluginSourceBuildOptions } from '@rsbuild/plugin-source-build';
10
10
  import type { SvgDefaultExport } from '@rsbuild/plugin-svgr';
11
11
  import type { PluginTypeCheckerOptions } from '@rsbuild/plugin-type-check';
12
12
  import type { Options as AutoprefixerOptions } from 'autoprefixer';
13
+ import type { RsdoctorUserConfig } from './rsdoctorConfig';
14
+ export type { RsdoctorUserConfig } from './rsdoctorConfig';
13
15
  export type CacheGroup = Rspack.OptimizationSplitChunksCacheGroup;
14
16
  export type Stats = Omit<Rspack.Stats, '#private' | 'hash' | 'startTime' | 'endTime'>;
15
17
  export type RspackConfig = Rspack.Configuration;
@@ -79,18 +81,6 @@ export type ToolsDevServerConfig = ConfigChain<{
79
81
  watch?: boolean;
80
82
  }>;
81
83
  export type ToolsAutoprefixerConfig = ConfigChain<AutoprefixerOptions>;
82
- export type RsdoctorUserConfig = boolean | {
83
- /**
84
- * Force enable / disable Rsdoctor.
85
- * By default, Modern.js enables Rsdoctor in production builds.
86
- */
87
- enabled?: boolean;
88
- /**
89
- * Disable Rsdoctor client server and ensure build process exits after report generation.
90
- * @default true
91
- */
92
- disableClientServer?: boolean;
93
- };
94
84
  export type BuilderExtraConfig = {
95
85
  tools?: {
96
86
  /**
@@ -253,6 +243,30 @@ export type DistPath = DistPathConfig & {
253
243
  server?: string;
254
244
  worker?: string;
255
245
  };
246
+ /**
247
+ * RSC (React Server Components) configuration.
248
+ *
249
+ * - `true` / `false`: enable or disable RSC with the default `'server'` and
250
+ * `'client'` environment names.
251
+ * - object form: enable RSC and customize which Rsbuild environments the RSC
252
+ * plugin attaches to. Frameworks whose environment names differ from the
253
+ * defaults (e.g. multi-page builders that already declare their own
254
+ * server/client environments) can map RSC onto those existing environments
255
+ * instead of letting the plugin create new empty `'server'`/`'client'` ones.
256
+ */
257
+ export type RscConfig = boolean | {
258
+ /**
259
+ * Map the RSC plugin's server/client environments onto existing Rsbuild
260
+ * environment names. Omitted keys fall back to the defaults
261
+ * (`'server'` / `'client'`).
262
+ */
263
+ environments?: {
264
+ /** Rsbuild environment name for the React Server Components (server) bundle. @default 'server' */
265
+ server?: string;
266
+ /** Rsbuild environment name for the client (browser) bundle. @default 'client' */
267
+ client?: string;
268
+ };
269
+ };
256
270
  export type BuilderConfig = {
257
271
  dev?: Omit<DevConfig, 'setupMiddlewares'> & {
258
272
  server?: {
@@ -269,7 +283,7 @@ export type BuilderConfig = {
269
283
  distPath?: DistPath;
270
284
  };
271
285
  server?: {
272
- rsc?: boolean;
286
+ rsc?: RscConfig;
273
287
  port?: number;
274
288
  cors?: ServerConfig['cors'];
275
289
  };
@@ -284,4 +298,3 @@ export type BuilderConfig = {
284
298
  [key: string]: EnvironmentConfig;
285
299
  };
286
300
  } & BuilderExtraConfig;
287
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bleedingdev/modern-js-builder",
3
- "version": "3.2.0-ultramodern.99",
3
+ "version": "3.4.0-ultramodern.0",
4
4
  "description": "A builder for Modern.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,25 +26,26 @@
26
26
  "dist"
27
27
  ],
28
28
  "dependencies": {
29
- "@rsbuild/core": "2.0.7",
30
- "@rsbuild/plugin-assets-retry": "2.0.0",
31
- "@rsbuild/plugin-check-syntax": "1.6.1",
32
- "@rsbuild/plugin-css-minimizer": "2.0.0",
33
- "@rsbuild/plugin-less": "1.6.3",
34
- "@rsbuild/plugin-react": "2.0.0",
35
- "@rsbuild/plugin-rem": "1.0.5",
36
- "@rsbuild/plugin-sass": "1.5.2",
37
- "@rsbuild/plugin-source-build": "1.0.5",
38
- "@rsbuild/plugin-svgr": "2.0.2",
39
- "@rsbuild/plugin-type-check": "1.3.4",
40
- "@rsbuild/plugin-typed-css-modules": "1.2.2",
41
- "@rsdoctor/rspack-plugin": "^1.5.11",
42
- "@swc/core": "1.15.40",
29
+ "@rsbuild/core": "2.0.15",
30
+ "@rsbuild/plugin-assets-retry": "2.0.1",
31
+ "@rsbuild/plugin-check-syntax": "2.0.0",
32
+ "@rsbuild/plugin-css-minimizer": "2.0.1",
33
+ "@rsbuild/plugin-less": "2.0.0",
34
+ "@rsbuild/plugin-react": "2.1.0",
35
+ "@rsbuild/plugin-rem": "1.0.6",
36
+ "@rsbuild/plugin-sass": "2.0.0",
37
+ "@rsbuild/plugin-source-build": "1.0.6",
38
+ "@rsbuild/plugin-svgr": "2.0.4",
39
+ "@rsbuild/plugin-type-check": "1.4.0",
40
+ "@rsbuild/plugin-typed-css-modules": "1.2.4",
41
+ "@rsdoctor/rspack-plugin": "^1.5.16",
42
+ "@swc/core": "1.15.43",
43
43
  "@swc/helpers": "^0.5.23",
44
- "autoprefixer": "10.5.0",
45
- "browserslist": "4.28.2",
44
+ "@typescript/native-preview": "7.0.0-dev.20260624.1",
45
+ "autoprefixer": "10.5.1",
46
+ "browserslist": "4.28.4",
46
47
  "core-js": "^3.49.0",
47
- "cssnano": "8.0.1",
48
+ "cssnano": "8.0.2",
48
49
  "html-minifier-terser": "^7.2.0",
49
50
  "lodash": "^4.18.1",
50
51
  "postcss": "^8.5.15",
@@ -52,23 +53,22 @@
52
53
  "postcss-flexbugs-fixes": "5.0.2",
53
54
  "postcss-font-variant": "5.0.0",
54
55
  "postcss-initial": "4.0.1",
55
- "postcss-load-config": "6.0.1",
56
56
  "postcss-media-minmax": "5.0.0",
57
57
  "postcss-nesting": "14.0.0",
58
58
  "postcss-page-break": "3.0.4",
59
- "rsbuild-plugin-rsc": "0.1.0",
60
- "rspack-manifest-plugin": "5.2.1",
59
+ "rsbuild-plugin-rsc": "0.1.1",
60
+ "rspack-manifest-plugin": "5.2.2",
61
61
  "ts-deepmerge": "8.0.0",
62
- "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.99"
62
+ "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.4.0-ultramodern.0"
63
63
  },
64
64
  "devDependencies": {
65
- "@rslib/core": "0.21.5",
65
+ "@rslib/core": "0.23.0",
66
66
  "@types/html-minifier-terser": "^7.0.2",
67
67
  "@types/lodash": "^4.17.24",
68
- "@typescript/native-preview": "7.0.0-dev.20260527.2",
69
- "react": "^19.2.6",
68
+ "react": "^19.2.7",
70
69
  "terser": "^5.48.0",
71
- "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.99",
70
+ "typescript": "^6.0.3",
71
+ "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.4.0-ultramodern.0",
72
72
  "@scripts/rstest-config": "2.66.0"
73
73
  },
74
74
  "publishConfig": {
@@ -76,7 +76,7 @@
76
76
  "registry": "https://registry.npmjs.org/"
77
77
  },
78
78
  "scripts": {
79
- "build": "rslib build",
79
+ "build": "rslib build && pnpm -w tsgo:dts \"$PWD\"",
80
80
  "dev": "rslib build --watch",
81
81
  "test": "rstest run",
82
82
  "test:watch": "rstest watch"