@bleedingdev/modern-js-app-tools 3.2.0-ultramodern.5 → 3.2.0-ultramodern.50

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 (129) hide show
  1. package/dist/cjs/builder/generator/getBuilderEnvironments.js +143 -8
  2. package/dist/cjs/builder/shared/builderPlugins/adapterBasic.js +41 -5
  3. package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +3 -1
  4. package/dist/cjs/plugins/deploy/index.js +17 -6
  5. package/dist/cjs/plugins/deploy/platforms/cloudflare.js +220 -0
  6. package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.mjs +258 -0
  7. package/dist/cjs/rsbuild.js +3 -0
  8. package/dist/esm/builder/generator/getBuilderEnvironments.mjs +132 -8
  9. package/dist/esm/builder/shared/builderPlugins/adapterBasic.mjs +41 -5
  10. package/dist/esm/builder/shared/builderPlugins/adapterSSR.mjs +3 -1
  11. package/dist/esm/plugins/deploy/index.mjs +10 -4
  12. package/dist/esm/plugins/deploy/platforms/cloudflare.mjs +176 -0
  13. package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.mjs +258 -0
  14. package/dist/esm/rsbuild.mjs +5 -2
  15. package/dist/esm-node/builder/generator/getBuilderEnvironments.mjs +134 -9
  16. package/dist/esm-node/builder/shared/builderPlugins/adapterBasic.mjs +41 -5
  17. package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.mjs +3 -1
  18. package/dist/esm-node/plugins/deploy/index.mjs +10 -4
  19. package/dist/esm-node/plugins/deploy/platforms/cloudflare.mjs +177 -0
  20. package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.mjs +258 -0
  21. package/dist/esm-node/rsbuild.mjs +5 -2
  22. package/dist/types/baseline.d.ts +46 -0
  23. package/dist/types/builder/builder-rspack/index.d.ts +2 -0
  24. package/dist/types/builder/generator/adapterCopy.d.ts +3 -0
  25. package/dist/types/builder/generator/createBuilderProviderConfig.d.ts +3 -0
  26. package/dist/types/builder/generator/createCopyPattern.d.ts +16 -0
  27. package/dist/types/builder/generator/getBuilderEnvironments.d.ts +6 -0
  28. package/dist/types/builder/generator/index.d.ts +8 -0
  29. package/dist/types/builder/index.d.ts +3 -0
  30. package/dist/types/builder/shared/builderPlugins/adapterBasic.d.ts +3 -0
  31. package/dist/types/builder/shared/builderPlugins/adapterHtml.d.ts +3 -0
  32. package/dist/types/builder/shared/builderPlugins/adapterPrecompress.d.ts +3 -0
  33. package/dist/types/builder/shared/builderPlugins/adapterSSR.d.ts +3 -0
  34. package/dist/types/builder/shared/builderPlugins/builderHooks.d.ts +3 -0
  35. package/dist/types/builder/shared/builderPlugins/index.d.ts +5 -0
  36. package/dist/types/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.d.ts +7 -0
  37. package/dist/types/builder/shared/bundlerPlugins/HtmlBottomTemplate.d.ts +9 -0
  38. package/dist/types/builder/shared/bundlerPlugins/RouterPlugin.d.ts +32 -0
  39. package/dist/types/builder/shared/bundlerPlugins/index.d.ts +3 -0
  40. package/dist/types/builder/shared/createCopyInfo.d.ts +8 -0
  41. package/dist/types/builder/shared/index.d.ts +3 -0
  42. package/dist/types/builder/shared/loaders/serverModuleLoader.d.ts +3 -0
  43. package/dist/types/builder/shared/types.d.ts +6 -0
  44. package/dist/types/commands/build.d.ts +4 -0
  45. package/dist/types/commands/deploy.d.ts +3 -0
  46. package/dist/types/commands/dev.d.ts +9 -0
  47. package/dist/types/commands/index.d.ts +10 -0
  48. package/dist/types/commands/info.d.ts +18 -0
  49. package/dist/types/commands/inspect.d.ts +4 -0
  50. package/dist/types/commands/runtime.d.ts +11 -0
  51. package/dist/types/commands/serve.d.ts +8 -0
  52. package/dist/types/compat/hooks.d.ts +7 -0
  53. package/dist/types/compat/index.d.ts +2 -0
  54. package/dist/types/compat/utils.d.ts +13 -0
  55. package/dist/types/config/default.d.ts +3 -0
  56. package/dist/types/config/index.d.ts +2 -0
  57. package/dist/types/config/initialize/index.d.ts +3 -0
  58. package/dist/types/config/initialize/inits.d.ts +4 -0
  59. package/dist/types/constants.d.ts +2 -0
  60. package/dist/types/defineConfig.d.ts +11 -0
  61. package/dist/types/esm/register-esm.d.mts +5 -0
  62. package/dist/types/esm/ts-paths-loader.d.mts +6 -0
  63. package/dist/types/exports/server.d.ts +1 -0
  64. package/dist/types/index.d.ts +17 -0
  65. package/dist/types/locale/en.d.ts +44 -0
  66. package/dist/types/locale/index.d.ts +3 -0
  67. package/dist/types/locale/zh.d.ts +44 -0
  68. package/dist/types/plugins/analyze/constants.d.ts +3 -0
  69. package/dist/types/plugins/analyze/getBundleEntry.d.ts +4 -0
  70. package/dist/types/plugins/analyze/getFileSystemEntry.d.ts +7 -0
  71. package/dist/types/plugins/analyze/getHtmlTemplate.d.ts +27 -0
  72. package/dist/types/plugins/analyze/getServerRoutes.d.ts +8 -0
  73. package/dist/types/plugins/analyze/index.d.ts +3 -0
  74. package/dist/types/plugins/analyze/isDefaultExportFunction.d.ts +1 -0
  75. package/dist/types/plugins/analyze/templates.d.ts +5 -0
  76. package/dist/types/plugins/analyze/utils.d.ts +10 -0
  77. package/dist/types/plugins/deploy/index.d.ts +6 -0
  78. package/dist/types/plugins/deploy/platforms/cloudflare.d.ts +2 -0
  79. package/dist/types/plugins/deploy/platforms/gh-pages.d.ts +2 -0
  80. package/dist/types/plugins/deploy/platforms/netlify.d.ts +2 -0
  81. package/dist/types/plugins/deploy/platforms/node.d.ts +2 -0
  82. package/dist/types/plugins/deploy/platforms/platform.d.ts +17 -0
  83. package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.d.mts +4 -0
  84. package/dist/types/plugins/deploy/platforms/templates/netlify-entry.d.cts +2 -0
  85. package/dist/types/plugins/deploy/platforms/templates/netlify-entry.d.mts +2 -0
  86. package/dist/types/plugins/deploy/platforms/templates/node-entry.d.cts +1 -0
  87. package/dist/types/plugins/deploy/platforms/templates/node-entry.d.mts +1 -0
  88. package/dist/types/plugins/deploy/platforms/templates/vercel-entry.d.cts +2 -0
  89. package/dist/types/plugins/deploy/platforms/templates/vercel-entry.d.mts +2 -0
  90. package/dist/types/plugins/deploy/platforms/vercel.d.ts +2 -0
  91. package/dist/types/plugins/deploy/types.d.ts +3 -0
  92. package/dist/types/plugins/deploy/utils/generator.d.ts +24 -0
  93. package/dist/types/plugins/deploy/utils/index.d.ts +16 -0
  94. package/dist/types/plugins/initialize/index.d.ts +3 -0
  95. package/dist/types/plugins/serverBuild.d.ts +3 -0
  96. package/dist/types/plugins/serverRuntime.d.ts +3 -0
  97. package/dist/types/presetUltramodern.d.ts +6 -0
  98. package/dist/types/rsbuild.d.ts +12 -0
  99. package/dist/types/run/index.d.ts +20 -0
  100. package/dist/types/types/config/deploy.d.ts +46 -0
  101. package/dist/types/types/config/dev.d.ts +55 -0
  102. package/dist/types/types/config/experiments.d.ts +3 -0
  103. package/dist/types/types/config/html.d.ts +3 -0
  104. package/dist/types/types/config/index.d.ts +48 -0
  105. package/dist/types/types/config/output.d.ts +61 -0
  106. package/dist/types/types/config/performance.d.ts +3 -0
  107. package/dist/types/types/config/resolve.d.ts +2 -0
  108. package/dist/types/types/config/security.d.ts +2 -0
  109. package/dist/types/types/config/source.d.ts +61 -0
  110. package/dist/types/types/config/testing.d.ts +8 -0
  111. package/dist/types/types/config/tools.d.ts +21 -0
  112. package/dist/types/types/index.d.ts +10 -0
  113. package/dist/types/types/plugin.d.ts +114 -0
  114. package/dist/types/types/utils.d.ts +1 -0
  115. package/dist/types/ultramodern/designSystem.d.ts +54 -0
  116. package/dist/types/utils/config.d.ts +2 -0
  117. package/dist/types/utils/createServer.d.ts +5 -0
  118. package/dist/types/utils/env.d.ts +2 -0
  119. package/dist/types/utils/generateWatchFiles.d.ts +2 -0
  120. package/dist/types/utils/getConfigFile.d.ts +1 -0
  121. package/dist/types/utils/getSelectedEntries.d.ts +5 -0
  122. package/dist/types/utils/initAppContext.d.ts +31 -0
  123. package/dist/types/utils/loadPlugins.d.ts +13 -0
  124. package/dist/types/utils/printInstructions.d.ts +3 -0
  125. package/dist/types/utils/register.d.ts +19 -0
  126. package/dist/types/utils/restart.d.ts +2 -0
  127. package/dist/types/utils/routes.d.ts +4 -0
  128. package/dist/types/utils/types.d.ts +49 -0
  129. package/package.json +15 -15
@@ -0,0 +1,31 @@
1
+ export declare const initAppContext: ({ metaName, appDirectory, runtimeConfigFile, options, tempDir, }: {
2
+ metaName: string;
3
+ appDirectory: string;
4
+ runtimeConfigFile: string;
5
+ options?: {
6
+ srcDir?: string;
7
+ apiDir?: string;
8
+ distDir?: string;
9
+ sharedDir?: string;
10
+ bffRuntimeFramework?: 'hono' | 'effect';
11
+ };
12
+ tempDir?: string;
13
+ }) => {
14
+ runtimeConfigFile: string;
15
+ ip: any;
16
+ port: number;
17
+ moduleType: any;
18
+ apiDirectory: string;
19
+ lambdaDirectory: string;
20
+ sharedDirectory: string;
21
+ serverPlugins: never[];
22
+ internalDirectory: string;
23
+ htmlTemplates: {};
24
+ serverRoutes: never[];
25
+ entrypoints: never[];
26
+ checkedEntries: never[];
27
+ apiOnly: boolean;
28
+ internalDirAlias: string;
29
+ internalSrcAlias: string;
30
+ bffRuntimeFramework: "effect" | "hono";
31
+ };
@@ -0,0 +1,13 @@
1
+ import type { CLIPluginAPI } from '@modern-js/plugin';
2
+ import type { ServerPlugin as ServerPluginInstance } from '@modern-js/server-core';
3
+ import type { InternalPlugins, ServerPlugin } from '@modern-js/types';
4
+ import type { AppTools } from '../types';
5
+ export declare function getServerPlugins(api: CLIPluginAPI<AppTools>, metaName?: string): Promise<ServerPlugin[]>;
6
+ export declare function loadServerPlugins(api: CLIPluginAPI<AppTools>, appDirectory: string, metaName: string): Promise<ServerPluginInstance[]>;
7
+ /**
8
+ * Load internal plugins which in @modern-js scope and user's custom plugins.
9
+ * @param appDirectory - Application root directory.
10
+ * @param internalPlugins - Internal plugins.
11
+ * @returns Plugin Objects has been required.
12
+ */
13
+ export declare const loadInternalPlugins: (appDirectory: string, internalPlugins?: InternalPlugins) => Promise<any>;
@@ -0,0 +1,3 @@
1
+ import type { AppNormalizedConfig } from '../types';
2
+ import type { AppToolsContext, AppToolsHooks } from '../types/plugin';
3
+ export declare const printInstructions: (hooks: AppToolsHooks, appContext: AppToolsContext, config: AppNormalizedConfig) => Promise<void>;
@@ -0,0 +1,19 @@
1
+ import { type Alias } from '@modern-js/utils';
2
+ import type { ConfigChain } from '@rsbuild/core';
3
+ type TsRuntimeRegisterMode = 'node-loader' | 'unsupported';
4
+ interface TsRuntimeSetupOptions {
5
+ moduleType?: string;
6
+ /**
7
+ * User-configured `server.tsconfigPath`. Forwarded into the shared
8
+ * resolveServerTsconfig helper. Resolved relative to appDir when not
9
+ * absolute. Falls back to `<appDir>/tsconfig.json` when unset.
10
+ */
11
+ tsconfigPath?: string;
12
+ }
13
+ export declare const resolveTsRuntimeRegisterMode: () => TsRuntimeRegisterMode;
14
+ /**
15
+ * Setup TypeScript runtime support.
16
+ * Register Node-native TypeScript path alias resolution.
17
+ */
18
+ export declare const setupTsRuntime: (appDir: string, distDir: string, alias?: ConfigChain<Alias>, options?: TsRuntimeSetupOptions) => Promise<void>;
19
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { AppToolsHooks } from '../types/plugin';
2
+ export declare function restart(hooks: AppToolsHooks, filename: string): Promise<void>;
@@ -0,0 +1,4 @@
1
+ import type { AppToolsContext } from '../types/plugin';
2
+ export declare const generateRoutes: (appContext: AppToolsContext) => Promise<void>;
3
+ export declare const getPathWithoutExt: (filename: string) => string;
4
+ export declare const isMainEntry: (entryName: string, mainEntryName?: string) => boolean;
@@ -0,0 +1,49 @@
1
+ export type DevOptions = {
2
+ entry?: string[] | boolean;
3
+ config?: string;
4
+ apiOnly?: boolean;
5
+ analyze?: boolean;
6
+ };
7
+ export type BuildOptions = {
8
+ config?: string;
9
+ analyze?: boolean;
10
+ watch?: boolean;
11
+ };
12
+ export type DeployOptions = {
13
+ config?: string;
14
+ skipBuild?: boolean;
15
+ };
16
+ export type StartOptions = {
17
+ apiOnly?: boolean;
18
+ };
19
+ export type InspectOptions = {
20
+ env: string;
21
+ output: string;
22
+ verbose?: boolean;
23
+ };
24
+ export type InfoOptions = {
25
+ config?: string;
26
+ json?: boolean;
27
+ };
28
+ export type RuntimeStatusOptions = {
29
+ endpoint?: string;
30
+ token?: string;
31
+ tokenEnv?: string;
32
+ headerName?: string;
33
+ timeout?: string;
34
+ json?: boolean;
35
+ };
36
+ export type RuntimeFallbackSignalOptions = {
37
+ endpoint?: string;
38
+ app: string;
39
+ reason?: string;
40
+ phase?: string;
41
+ entry?: string;
42
+ runtimeDigest?: string;
43
+ metadata?: string;
44
+ token?: string;
45
+ tokenEnv?: string;
46
+ headerName?: string;
47
+ timeout?: string;
48
+ json?: boolean;
49
+ };
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "modern",
18
18
  "modern.js"
19
19
  ],
20
- "version": "3.2.0-ultramodern.5",
20
+ "version": "3.2.0-ultramodern.50",
21
21
  "types": "./dist/types/index.d.ts",
22
22
  "main": "./dist/cjs/index.js",
23
23
  "exports": {
@@ -85,8 +85,8 @@
85
85
  "@babel/parser": "^7.29.3",
86
86
  "@babel/traverse": "^7.29.0",
87
87
  "@babel/types": "^7.29.0",
88
- "@rsbuild/core": "2.0.6",
89
- "@swc/core": "1.15.33",
88
+ "@rsbuild/core": "2.0.7",
89
+ "@swc/core": "1.15.40",
90
90
  "@swc/helpers": "^0.5.21",
91
91
  "compression-webpack-plugin": "^12.0.0",
92
92
  "es-module-lexer": "^2.1.0",
@@ -98,22 +98,22 @@
98
98
  "ndepe": "^0.1.13",
99
99
  "pkg-types": "^2.3.1",
100
100
  "std-env": "4.1.0",
101
- "@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.2.0-ultramodern.5",
102
- "@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.2.0-ultramodern.5",
103
- "@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.2.0-ultramodern.5",
104
- "@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.2.0-ultramodern.5",
105
- "@modern-js/server-utils": "npm:@bleedingdev/modern-js-server-utils@3.2.0-ultramodern.5",
106
- "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.5",
107
- "@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.2.0-ultramodern.5",
108
- "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.5",
109
- "@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.2.0-ultramodern.5",
110
- "@modern-js/server": "npm:@bleedingdev/modern-js-server@3.2.0-ultramodern.5"
101
+ "@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.2.0-ultramodern.50",
102
+ "@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.2.0-ultramodern.50",
103
+ "@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.2.0-ultramodern.50",
104
+ "@modern-js/server": "npm:@bleedingdev/modern-js-server@3.2.0-ultramodern.50",
105
+ "@modern-js/server-utils": "npm:@bleedingdev/modern-js-server-utils@3.2.0-ultramodern.50",
106
+ "@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.2.0-ultramodern.50",
107
+ "@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.2.0-ultramodern.50",
108
+ "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.50",
109
+ "@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.2.0-ultramodern.50",
110
+ "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.50"
111
111
  },
112
112
  "devDependencies": {
113
113
  "@rslib/core": "0.21.5",
114
114
  "@types/babel__traverse": "7.28.0",
115
- "@types/node": "^25.8.0",
116
- "@typescript/native-preview": "7.0.0-dev.20260516.1",
115
+ "@types/node": "^25.9.1",
116
+ "@typescript/native-preview": "7.0.0-dev.20260527.2",
117
117
  "tsconfig-paths": "^4.2.0",
118
118
  "@scripts/rstest-config": "2.66.0"
119
119
  },