@bleedingdev/modern-js-app-tools 3.2.0-ultramodern.10 → 3.2.0-ultramodern.101
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/bin/modern.js +0 -0
- package/dist/cjs/baseline.js +43 -1
- package/dist/cjs/builder/generator/getBuilderEnvironments.js +191 -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 +222 -0
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.mjs +457 -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 +180 -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 +178 -0
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.mjs +457 -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 +185 -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 +179 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.mjs +457 -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 +18 -17
package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-loadable-server.mjs
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import loadableComponent from '@loadable/component';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
const internals = loadableComponent?.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED || {};
|
|
4
|
+
const LoadableContext = internals.Context || React.createContext(null);
|
|
5
|
+
const getRequiredChunkKey = internals.getRequiredChunkKey || ((namespace)=>`${namespace}__LOADABLE_REQUIRED_CHUNKS__`);
|
|
6
|
+
const scriptExtensions = new Set([
|
|
7
|
+
'.js',
|
|
8
|
+
'.mjs'
|
|
9
|
+
]);
|
|
10
|
+
const styleExtensions = new Set([
|
|
11
|
+
'.css'
|
|
12
|
+
]);
|
|
13
|
+
function uniqByUrl(assets) {
|
|
14
|
+
const seen = new Set();
|
|
15
|
+
return assets.filter((asset)=>{
|
|
16
|
+
if (seen.has(asset.url)) return false;
|
|
17
|
+
seen.add(asset.url);
|
|
18
|
+
return true;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function extname(filePath) {
|
|
22
|
+
const basename = String(filePath).split('/').pop() || '';
|
|
23
|
+
const index = basename.lastIndexOf('.');
|
|
24
|
+
return index > 0 ? basename.slice(index) : '';
|
|
25
|
+
}
|
|
26
|
+
function joinUrl(publicPath, filename) {
|
|
27
|
+
const base = publicPath || '/';
|
|
28
|
+
return `${base.replace(/\/+$/u, '')}/${String(filename).replace(/^\/+/u, '')}`;
|
|
29
|
+
}
|
|
30
|
+
function extraPropsToString(extraProps = {}) {
|
|
31
|
+
return Object.entries(extraProps).filter(([, value])=>void 0 !== value && false !== value).map(([key, value])=>true === value ? ` ${key}` : ` ${key}="${value}"`).join('');
|
|
32
|
+
}
|
|
33
|
+
function assetScriptType(filename) {
|
|
34
|
+
const extension = extname(filename);
|
|
35
|
+
if (scriptExtensions.has(extension)) return "script";
|
|
36
|
+
if (styleExtensions.has(extension)) return 'style';
|
|
37
|
+
}
|
|
38
|
+
function getAssetName(asset) {
|
|
39
|
+
return 'object' == typeof asset && asset?.name ? asset.name : asset;
|
|
40
|
+
}
|
|
41
|
+
function getAssetIntegrity(asset) {
|
|
42
|
+
return 'object' == typeof asset && asset?.integrity ? asset.integrity : null;
|
|
43
|
+
}
|
|
44
|
+
function getChunkGroupAssets(chunkGroup) {
|
|
45
|
+
const assets = chunkGroup?.assets;
|
|
46
|
+
if (Array.isArray(assets)) return assets;
|
|
47
|
+
if (assets && 'object' == typeof assets) return [
|
|
48
|
+
...assets.js || [],
|
|
49
|
+
...assets.css || []
|
|
50
|
+
];
|
|
51
|
+
return [];
|
|
52
|
+
}
|
|
53
|
+
function getChunkGroupChildAssets(chunkGroup, type) {
|
|
54
|
+
const childAssets = chunkGroup?.childAssets?.[type];
|
|
55
|
+
return Array.isArray(childAssets) ? childAssets : [];
|
|
56
|
+
}
|
|
57
|
+
function chunkIncludesJs(chunkInfo) {
|
|
58
|
+
return (chunkInfo?.files || []).some((file)=>scriptExtensions.has(extname(file)));
|
|
59
|
+
}
|
|
60
|
+
export function ChunkExtractorManager({ extractor, children }) {
|
|
61
|
+
return React.createElement(LoadableContext.Provider, {
|
|
62
|
+
value: extractor
|
|
63
|
+
}, children);
|
|
64
|
+
}
|
|
65
|
+
export class ChunkExtractor {
|
|
66
|
+
constructor({ stats, entrypoints = [
|
|
67
|
+
'main'
|
|
68
|
+
], namespace = '', outputPath = '/', publicPath } = {}){
|
|
69
|
+
this.namespace = namespace;
|
|
70
|
+
this.stats = stats || {};
|
|
71
|
+
this.publicPath = publicPath || this.stats.publicPath || '/';
|
|
72
|
+
this.outputPath = outputPath || this.stats.outputPath || '/';
|
|
73
|
+
this.entrypoints = Array.isArray(entrypoints) ? entrypoints : [
|
|
74
|
+
entrypoints
|
|
75
|
+
];
|
|
76
|
+
this.chunks = [];
|
|
77
|
+
}
|
|
78
|
+
addChunk(chunk) {
|
|
79
|
+
if (!this.chunks.includes(chunk)) this.chunks.push(chunk);
|
|
80
|
+
}
|
|
81
|
+
collectChunks(app) {
|
|
82
|
+
return React.createElement(ChunkExtractorManager, {
|
|
83
|
+
extractor: this
|
|
84
|
+
}, app);
|
|
85
|
+
}
|
|
86
|
+
getChunkGroup(chunk) {
|
|
87
|
+
return this.stats.namedChunkGroups?.[chunk] || {
|
|
88
|
+
assets: [],
|
|
89
|
+
childAssets: {},
|
|
90
|
+
chunks: []
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
getChunkInfo(chunkId) {
|
|
94
|
+
return (this.stats.chunks || []).find((chunk)=>chunk.id === chunkId);
|
|
95
|
+
}
|
|
96
|
+
resolvePublicUrl(filename) {
|
|
97
|
+
return joinUrl(this.publicPath, filename);
|
|
98
|
+
}
|
|
99
|
+
createChunkAsset({ filename, chunk, type, linkType }) {
|
|
100
|
+
const resolvedFilename = getAssetName(filename);
|
|
101
|
+
const scriptType = assetScriptType(resolvedFilename);
|
|
102
|
+
if (!scriptType) return;
|
|
103
|
+
return {
|
|
104
|
+
filename: resolvedFilename,
|
|
105
|
+
integrity: getAssetIntegrity(filename),
|
|
106
|
+
scriptType,
|
|
107
|
+
chunk,
|
|
108
|
+
url: this.resolvePublicUrl(resolvedFilename),
|
|
109
|
+
path: String(resolvedFilename).replace(/^\/+/u, ''),
|
|
110
|
+
type,
|
|
111
|
+
linkType
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
getChunkAssets(chunks) {
|
|
115
|
+
const one = (chunk)=>getChunkGroupAssets(this.getChunkGroup(chunk)).map((filename)=>this.createChunkAsset({
|
|
116
|
+
filename,
|
|
117
|
+
chunk,
|
|
118
|
+
type: 'mainAsset',
|
|
119
|
+
linkType: 'preload'
|
|
120
|
+
})).filter(Boolean);
|
|
121
|
+
return Array.isArray(chunks) ? uniqByUrl(chunks.flatMap(one)) : one(chunks);
|
|
122
|
+
}
|
|
123
|
+
getChunkChildAssets(chunks, type) {
|
|
124
|
+
const one = (chunk)=>getChunkGroupChildAssets(this.getChunkGroup(chunk), type).map((filename)=>this.createChunkAsset({
|
|
125
|
+
filename,
|
|
126
|
+
chunk,
|
|
127
|
+
type: 'childAsset',
|
|
128
|
+
linkType: type
|
|
129
|
+
})).filter(Boolean);
|
|
130
|
+
return Array.isArray(chunks) ? uniqByUrl(chunks.flatMap(one)) : one(chunks);
|
|
131
|
+
}
|
|
132
|
+
getChunkDependencies(chunks) {
|
|
133
|
+
const one = (chunk)=>(this.getChunkGroup(chunk).chunks || []).filter((chunkId)=>chunkIncludesJs(this.getChunkInfo(chunkId)));
|
|
134
|
+
return Array.isArray(chunks) ? [
|
|
135
|
+
...new Set(chunks.flatMap(one))
|
|
136
|
+
] : one(chunks);
|
|
137
|
+
}
|
|
138
|
+
getRequiredChunksScriptContent() {
|
|
139
|
+
return JSON.stringify(this.getChunkDependencies(this.chunks));
|
|
140
|
+
}
|
|
141
|
+
getRequiredChunksNamesScriptContent() {
|
|
142
|
+
return JSON.stringify({
|
|
143
|
+
namedChunks: this.chunks
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
getRequiredChunksScriptTag(extraProps = {}) {
|
|
147
|
+
const id = getRequiredChunkKey(this.namespace);
|
|
148
|
+
const props = `type="application/json"${extraPropsToString(extraProps)}`;
|
|
149
|
+
return [
|
|
150
|
+
`<script id="${id}" ${props}>${this.getRequiredChunksScriptContent()}</script>`,
|
|
151
|
+
`<script id="${id}_ext" ${props}>${this.getRequiredChunksNamesScriptContent()}</script>`
|
|
152
|
+
].join('');
|
|
153
|
+
}
|
|
154
|
+
getMainAssets(scriptType) {
|
|
155
|
+
const assets = this.getChunkAssets([
|
|
156
|
+
...this.entrypoints,
|
|
157
|
+
...this.chunks
|
|
158
|
+
]);
|
|
159
|
+
return scriptType ? assets.filter((asset)=>asset.scriptType === scriptType) : assets;
|
|
160
|
+
}
|
|
161
|
+
getScriptTags(extraProps = {}) {
|
|
162
|
+
const scripts = this.getMainAssets("script").map((asset)=>`<script async data-chunk="${asset.chunk}" src="${asset.url}"${extraPropsToString(extraProps)}></script>`);
|
|
163
|
+
return [
|
|
164
|
+
this.getRequiredChunksScriptTag(extraProps),
|
|
165
|
+
...scripts
|
|
166
|
+
].join('');
|
|
167
|
+
}
|
|
168
|
+
getStyleTags(extraProps = {}) {
|
|
169
|
+
return this.getMainAssets('style').map((asset)=>`<link data-chunk="${asset.chunk}" rel="stylesheet" href="${asset.url}"${extraPropsToString(extraProps)}>`).join('');
|
|
170
|
+
}
|
|
171
|
+
getLinkTags(extraProps = {}) {
|
|
172
|
+
const assets = [
|
|
173
|
+
...this.getMainAssets(),
|
|
174
|
+
...this.getChunkChildAssets([
|
|
175
|
+
...this.entrypoints,
|
|
176
|
+
...this.chunks
|
|
177
|
+
], 'preload'),
|
|
178
|
+
...this.getChunkChildAssets([
|
|
179
|
+
...this.entrypoints,
|
|
180
|
+
...this.chunks
|
|
181
|
+
], 'prefetch')
|
|
182
|
+
];
|
|
183
|
+
return uniqByUrl(assets).map((asset)=>`<link data-chunk="${asset.chunk}" rel="${asset.linkType}" as="${asset.scriptType}" href="${asset.url}"${extraPropsToString(extraProps)}>`).join('');
|
|
184
|
+
}
|
|
185
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const trimSlashes = (value)=>String(value).replace(/^\/+|\/+$/gu, '');
|
|
2
|
+
const normalizeSeparators = (value)=>String(value).replace(/\\+/gu, '/');
|
|
3
|
+
export const sep = '/';
|
|
4
|
+
export const delimiter = ':';
|
|
5
|
+
export function isAbsolute(filePath) {
|
|
6
|
+
return normalizeSeparators(filePath).startsWith('/');
|
|
7
|
+
}
|
|
8
|
+
export function normalize(filePath) {
|
|
9
|
+
const normalized = normalizeSeparators(filePath);
|
|
10
|
+
const absolute = isAbsolute(normalized);
|
|
11
|
+
const parts = [];
|
|
12
|
+
for (const part of normalized.split('/'))if (part && '.' !== part) {
|
|
13
|
+
if ('..' === part) {
|
|
14
|
+
if (parts.length > 0 && '..' !== parts[parts.length - 1]) parts.pop();
|
|
15
|
+
else if (!absolute) parts.push(part);
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
parts.push(part);
|
|
19
|
+
}
|
|
20
|
+
const joined = parts.join('/');
|
|
21
|
+
if (absolute) return joined ? `/${joined}` : '/';
|
|
22
|
+
return joined || '.';
|
|
23
|
+
}
|
|
24
|
+
export function join(...segments) {
|
|
25
|
+
const joined = segments.map(normalizeSeparators).filter(Boolean).map((segment, index)=>0 === index ? segment : trimSlashes(segment)).filter(Boolean).join('/');
|
|
26
|
+
return joined ? normalize(joined) : '.';
|
|
27
|
+
}
|
|
28
|
+
export function resolve(...segments) {
|
|
29
|
+
const joined = join(...segments);
|
|
30
|
+
return joined.startsWith('/') ? joined : `/${joined}`;
|
|
31
|
+
}
|
|
32
|
+
export function dirname(filePath) {
|
|
33
|
+
const normalized = normalizeSeparators(filePath).replace(/\/+$/u, '');
|
|
34
|
+
const index = normalized.lastIndexOf('/');
|
|
35
|
+
if (index <= 0) return '/';
|
|
36
|
+
return normalized.slice(0, index);
|
|
37
|
+
}
|
|
38
|
+
export function basename(filePath, suffix = '') {
|
|
39
|
+
const normalized = normalizeSeparators(filePath).replace(/\/+$/u, '');
|
|
40
|
+
const base = normalized.slice(normalized.lastIndexOf('/') + 1);
|
|
41
|
+
return suffix && base.endsWith(suffix) ? base.slice(0, -suffix.length) : base;
|
|
42
|
+
}
|
|
43
|
+
export function extname(filePath) {
|
|
44
|
+
const base = basename(filePath);
|
|
45
|
+
const index = base.lastIndexOf('.');
|
|
46
|
+
if (index <= 0) return '';
|
|
47
|
+
return base.slice(index);
|
|
48
|
+
}
|
|
49
|
+
export default {
|
|
50
|
+
basename,
|
|
51
|
+
delimiter,
|
|
52
|
+
dirname,
|
|
53
|
+
extname,
|
|
54
|
+
isAbsolute,
|
|
55
|
+
join,
|
|
56
|
+
normalize,
|
|
57
|
+
resolve,
|
|
58
|
+
sep
|
|
59
|
+
};
|
|
@@ -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.101",
|
|
21
21
|
"types": "./dist/types/index.d.ts",
|
|
22
22
|
"main": "./dist/cjs/index.js",
|
|
23
23
|
"exports": {
|
|
@@ -85,9 +85,10 @@
|
|
|
85
85
|
"@babel/parser": "^7.29.3",
|
|
86
86
|
"@babel/traverse": "^7.29.0",
|
|
87
87
|
"@babel/types": "^7.29.0",
|
|
88
|
-
"@
|
|
89
|
-
"@
|
|
90
|
-
"@swc/
|
|
88
|
+
"@loadable/component": "5.16.7",
|
|
89
|
+
"@rsbuild/core": "2.0.7",
|
|
90
|
+
"@swc/core": "1.15.40",
|
|
91
|
+
"@swc/helpers": "^0.5.23",
|
|
91
92
|
"compression-webpack-plugin": "^12.0.0",
|
|
92
93
|
"es-module-lexer": "^2.1.0",
|
|
93
94
|
"esbuild": "^0.28.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
|
|
104
|
-
"@modern-js/
|
|
105
|
-
"@modern-js/server
|
|
106
|
-
"@modern-js/
|
|
107
|
-
"@modern-js/
|
|
108
|
-
"@modern-js/
|
|
109
|
-
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.
|
|
110
|
-
"@modern-js/
|
|
102
|
+
"@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.2.0-ultramodern.101",
|
|
103
|
+
"@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.2.0-ultramodern.101",
|
|
104
|
+
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.2.0-ultramodern.101",
|
|
105
|
+
"@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.2.0-ultramodern.101",
|
|
106
|
+
"@modern-js/server": "npm:@bleedingdev/modern-js-server@3.2.0-ultramodern.101",
|
|
107
|
+
"@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.2.0-ultramodern.101",
|
|
108
|
+
"@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.2.0-ultramodern.101",
|
|
109
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.101",
|
|
110
|
+
"@modern-js/server-utils": "npm:@bleedingdev/modern-js-server-utils@3.2.0-ultramodern.101",
|
|
111
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.101"
|
|
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
|
}
|