@bleedingdev/modern-js-app-tools 3.2.0-ultramodern.8 → 3.2.0-ultramodern.81
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.
- package/dist/cjs/baseline.js +43 -1
- package/dist/cjs/builder/generator/getBuilderEnvironments.js +175 -8
- package/dist/cjs/builder/shared/builderPlugins/adapterBasic.js +41 -5
- package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +3 -1
- package/dist/cjs/plugins/deploy/index.js +17 -6
- package/dist/cjs/plugins/deploy/platforms/cloudflare.js +221 -0
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.mjs +438 -0
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-fs-promises.mjs +7 -0
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-loadable-server.mjs +185 -0
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-path.mjs +59 -0
- package/dist/cjs/rsbuild.js +3 -0
- package/dist/esm/baseline.mjs +33 -1
- package/dist/esm/builder/generator/getBuilderEnvironments.mjs +164 -8
- package/dist/esm/builder/shared/builderPlugins/adapterBasic.mjs +41 -5
- package/dist/esm/builder/shared/builderPlugins/adapterSSR.mjs +3 -1
- package/dist/esm/plugins/deploy/index.mjs +10 -4
- package/dist/esm/plugins/deploy/platforms/cloudflare.mjs +177 -0
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.mjs +438 -0
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-worker-fs-promises.mjs +7 -0
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-worker-loadable-server.mjs +185 -0
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-worker-path.mjs +59 -0
- package/dist/esm/rsbuild.mjs +5 -2
- package/dist/esm-node/baseline.mjs +33 -1
- package/dist/esm-node/builder/generator/getBuilderEnvironments.mjs +169 -9
- package/dist/esm-node/builder/shared/builderPlugins/adapterBasic.mjs +41 -5
- package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.mjs +3 -1
- package/dist/esm-node/plugins/deploy/index.mjs +10 -4
- package/dist/esm-node/plugins/deploy/platforms/cloudflare.mjs +178 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.mjs +438 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-fs-promises.mjs +7 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-loadable-server.mjs +185 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-path.mjs +59 -0
- package/dist/esm-node/rsbuild.mjs +5 -2
- package/dist/types/locale/en.d.ts +1 -1
- package/dist/types/locale/zh.d.ts +1 -1
- package/dist/types/plugins/deploy/index.d.ts +4 -1
- package/dist/types/plugins/deploy/platforms/cloudflare.d.ts +2 -0
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.d.mts +4 -0
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-worker-fs-promises.d.mts +5 -0
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-worker-loadable-server.d.mts +48 -0
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-worker-path.d.mts +21 -0
- package/dist/types/types/config/deploy.d.ts +8 -0
- package/package.json +17 -16
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import "node:module";
|
|
2
2
|
import { parseRspackConfig } from "@modern-js/builder";
|
|
3
|
+
import { INTERNAL_RUNTIME_PLUGINS } from "@modern-js/utils";
|
|
3
4
|
import { builderPluginAdapterBasic, builderPluginAdapterHooks } from "./builder/shared/builderPlugins/index.mjs";
|
|
4
5
|
import { DEFAULT_CONFIG_FILE } from "./constants.mjs";
|
|
5
6
|
import { getConfigFile } from "./utils/getConfigFile.mjs";
|
|
7
|
+
import { loadInternalPlugins } from "./utils/loadPlugins.mjs";
|
|
6
8
|
import { __webpack_require__ } from "./rslib-runtime.mjs";
|
|
7
9
|
import * as __rspack_external__modern_js_plugin_cli_caa09fa2 from "@modern-js/plugin/cli";
|
|
8
10
|
__webpack_require__.add({
|
|
9
|
-
"@modern-js/plugin/cli?
|
|
11
|
+
"@modern-js/plugin/cli?8936" (module) {
|
|
10
12
|
module.exports = __rspack_external__modern_js_plugin_cli_caa09fa2;
|
|
11
13
|
}
|
|
12
14
|
});
|
|
13
15
|
const MODERN_META_NAME = 'modern-js';
|
|
14
|
-
const { createConfigOptions: createConfigOptions } = __webpack_require__("@modern-js/plugin/cli?
|
|
16
|
+
const { createConfigOptions: createConfigOptions } = __webpack_require__("@modern-js/plugin/cli?8936");
|
|
15
17
|
async function resolveModernRsbuildConfig(options) {
|
|
16
18
|
const { cwd = process.cwd(), metaName = MODERN_META_NAME } = options;
|
|
17
19
|
const configFile = options.configPath || getConfigFile(void 0, cwd);
|
|
@@ -20,6 +22,7 @@ async function resolveModernRsbuildConfig(options) {
|
|
|
20
22
|
command: options.command,
|
|
21
23
|
cwd,
|
|
22
24
|
configFile,
|
|
25
|
+
internalPlugins: await loadInternalPlugins(cwd, INTERNAL_RUNTIME_PLUGINS),
|
|
23
26
|
metaName,
|
|
24
27
|
modifyModernConfig: options.modifyModernConfig
|
|
25
28
|
});
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import type { AppTools, CliPlugin } from '../../types';
|
|
1
|
+
import type { AppTools, AppToolsNormalizedConfig, CliPlugin } from '../../types';
|
|
2
|
+
import type { DeployTarget } from '../../types/config/deploy';
|
|
3
|
+
export declare const getSupportedDeployTargets: () => DeployTarget[];
|
|
4
|
+
export declare const resolveDeployTarget: (modernConfig: AppToolsNormalizedConfig, envDeployTarget?: string | undefined, detectedProvider?: import("std-env").ProviderName) => string;
|
|
2
5
|
declare const _default: () => CliPlugin<AppTools>;
|
|
3
6
|
export default _default;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare function ChunkExtractorManager({ extractor, children }: {
|
|
3
|
+
children: any;
|
|
4
|
+
extractor: any;
|
|
5
|
+
}): React.DetailedReactHTMLElement<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
6
|
+
export declare class ChunkExtractor {
|
|
7
|
+
namespace: string;
|
|
8
|
+
stats: any;
|
|
9
|
+
publicPath: any;
|
|
10
|
+
outputPath: any;
|
|
11
|
+
entrypoints: string[];
|
|
12
|
+
chunks: any[];
|
|
13
|
+
constructor({ stats, entrypoints, namespace, outputPath, publicPath, }?: {
|
|
14
|
+
entrypoints?: string[] | undefined;
|
|
15
|
+
namespace?: string | undefined;
|
|
16
|
+
outputPath?: string | undefined;
|
|
17
|
+
});
|
|
18
|
+
addChunk(chunk: any): void;
|
|
19
|
+
collectChunks(app: any): React.DetailedReactHTMLElement<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
20
|
+
getChunkGroup(chunk: any): any;
|
|
21
|
+
getChunkInfo(chunkId: any): any;
|
|
22
|
+
resolvePublicUrl(filename: any): string;
|
|
23
|
+
createChunkAsset({ filename, chunk, type, linkType }: {
|
|
24
|
+
chunk: any;
|
|
25
|
+
filename: any;
|
|
26
|
+
linkType: any;
|
|
27
|
+
type: any;
|
|
28
|
+
}): {
|
|
29
|
+
filename: any;
|
|
30
|
+
integrity: any;
|
|
31
|
+
scriptType: string;
|
|
32
|
+
chunk: any;
|
|
33
|
+
url: string;
|
|
34
|
+
path: string;
|
|
35
|
+
type: any;
|
|
36
|
+
linkType: any;
|
|
37
|
+
} | undefined;
|
|
38
|
+
getChunkAssets(chunks: any): any;
|
|
39
|
+
getChunkChildAssets(chunks: any, type: any): any;
|
|
40
|
+
getChunkDependencies(chunks: any): any;
|
|
41
|
+
getRequiredChunksScriptContent(): string;
|
|
42
|
+
getRequiredChunksNamesScriptContent(): string;
|
|
43
|
+
getRequiredChunksScriptTag(extraProps?: {}): string;
|
|
44
|
+
getMainAssets(scriptType: any): any;
|
|
45
|
+
getScriptTags(extraProps?: {}): string;
|
|
46
|
+
getStyleTags(extraProps?: {}): any;
|
|
47
|
+
getLinkTags(extraProps?: {}): any;
|
|
48
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const sep = "/";
|
|
2
|
+
export declare const delimiter = ":";
|
|
3
|
+
export declare function isAbsolute(filePath: any): boolean;
|
|
4
|
+
export declare function normalize(filePath: any): string;
|
|
5
|
+
export declare function join(...segments: any[]): string;
|
|
6
|
+
export declare function resolve(...segments: any[]): string;
|
|
7
|
+
export declare function dirname(filePath: any): string;
|
|
8
|
+
export declare function basename(filePath: any, suffix?: string): string;
|
|
9
|
+
export declare function extname(filePath: any): string;
|
|
10
|
+
declare const _default: {
|
|
11
|
+
basename: typeof basename;
|
|
12
|
+
delimiter: string;
|
|
13
|
+
dirname: typeof dirname;
|
|
14
|
+
extname: typeof extname;
|
|
15
|
+
isAbsolute: typeof isAbsolute;
|
|
16
|
+
join: typeof join;
|
|
17
|
+
normalize: typeof normalize;
|
|
18
|
+
resolve: typeof resolve;
|
|
19
|
+
sep: string;
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
@@ -26,13 +26,21 @@ export interface MicroFrontend {
|
|
|
26
26
|
*/
|
|
27
27
|
attestation?: string;
|
|
28
28
|
}
|
|
29
|
+
export type DeployTarget = 'node' | 'vercel' | 'netlify' | 'ghPages' | 'cloudflare';
|
|
29
30
|
export interface DeployUserConfig {
|
|
31
|
+
/**
|
|
32
|
+
* Selects the deploy output preset.
|
|
33
|
+
* `MODERNJS_DEPLOY` still overrides provider auto-detection when set.
|
|
34
|
+
* @default node
|
|
35
|
+
*/
|
|
36
|
+
target?: DeployTarget;
|
|
30
37
|
/**
|
|
31
38
|
* Used to configure micro-frontend sub-application information.
|
|
32
39
|
* @default false
|
|
33
40
|
*/
|
|
34
41
|
microFrontend?: boolean | MicroFrontend;
|
|
35
42
|
worker?: {
|
|
43
|
+
name?: string;
|
|
36
44
|
ssr?: boolean;
|
|
37
45
|
};
|
|
38
46
|
}
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"modern",
|
|
18
18
|
"modern.js"
|
|
19
19
|
],
|
|
20
|
-
"version": "3.2.0-ultramodern.
|
|
20
|
+
"version": "3.2.0-ultramodern.81",
|
|
21
21
|
"types": "./dist/types/index.d.ts",
|
|
22
22
|
"main": "./dist/cjs/index.js",
|
|
23
23
|
"exports": {
|
|
@@ -85,8 +85,9 @@
|
|
|
85
85
|
"@babel/parser": "^7.29.3",
|
|
86
86
|
"@babel/traverse": "^7.29.0",
|
|
87
87
|
"@babel/types": "^7.29.0",
|
|
88
|
-
"@
|
|
89
|
-
"@
|
|
88
|
+
"@loadable/component": "5.16.7",
|
|
89
|
+
"@rsbuild/core": "2.0.7",
|
|
90
|
+
"@swc/core": "1.15.40",
|
|
90
91
|
"@swc/helpers": "^0.5.21",
|
|
91
92
|
"compression-webpack-plugin": "^12.0.0",
|
|
92
93
|
"es-module-lexer": "^2.1.0",
|
|
@@ -98,22 +99,22 @@
|
|
|
98
99
|
"ndepe": "^0.1.13",
|
|
99
100
|
"pkg-types": "^2.3.1",
|
|
100
101
|
"std-env": "4.1.0",
|
|
101
|
-
"@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.2.0-ultramodern.
|
|
102
|
-
"@modern-js/
|
|
103
|
-
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.2.0-ultramodern.
|
|
104
|
-
"@modern-js/
|
|
105
|
-
"@modern-js/
|
|
106
|
-
"@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.2.0-ultramodern.
|
|
107
|
-
"@modern-js/server": "npm:@bleedingdev/modern-js-server@3.2.0-ultramodern.
|
|
108
|
-
"@modern-js/server
|
|
109
|
-
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.
|
|
110
|
-
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.
|
|
102
|
+
"@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.2.0-ultramodern.81",
|
|
103
|
+
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.2.0-ultramodern.81",
|
|
104
|
+
"@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.2.0-ultramodern.81",
|
|
105
|
+
"@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.2.0-ultramodern.81",
|
|
106
|
+
"@modern-js/server": "npm:@bleedingdev/modern-js-server@3.2.0-ultramodern.81",
|
|
107
|
+
"@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.2.0-ultramodern.81",
|
|
108
|
+
"@modern-js/server-utils": "npm:@bleedingdev/modern-js-server-utils@3.2.0-ultramodern.81",
|
|
109
|
+
"@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.2.0-ultramodern.81",
|
|
110
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.81",
|
|
111
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.81"
|
|
111
112
|
},
|
|
112
113
|
"devDependencies": {
|
|
113
114
|
"@rslib/core": "0.21.5",
|
|
114
115
|
"@types/babel__traverse": "7.28.0",
|
|
115
|
-
"@types/node": "^25.
|
|
116
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
116
|
+
"@types/node": "^25.9.1",
|
|
117
|
+
"@typescript/native-preview": "7.0.0-dev.20260527.2",
|
|
117
118
|
"tsconfig-paths": "^4.2.0",
|
|
118
119
|
"@scripts/rstest-config": "2.66.0"
|
|
119
120
|
},
|
|
@@ -132,7 +133,7 @@
|
|
|
132
133
|
},
|
|
133
134
|
"scripts": {
|
|
134
135
|
"dev": "rslib build --watch",
|
|
135
|
-
"build": "rslib build",
|
|
136
|
+
"build": "rslib build && pnpm -w tsgo:dts \"$PWD\"",
|
|
136
137
|
"test": "rstest"
|
|
137
138
|
}
|
|
138
139
|
}
|