@bleedingdev/modern-js-app-tools 3.2.0-ultramodern.12 → 3.2.0-ultramodern.121
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 +12 -50
- package/dist/cjs/builder/builder-rspack/index.js +9 -5
- package/dist/cjs/builder/generator/adapterCopy.js +9 -5
- package/dist/cjs/builder/generator/createBuilderProviderConfig.js +9 -5
- package/dist/cjs/builder/generator/createCopyPattern.js +9 -5
- package/dist/cjs/builder/generator/getBuilderEnvironments.js +199 -12
- package/dist/cjs/builder/generator/index.js +9 -5
- package/dist/cjs/builder/index.js +9 -5
- package/dist/cjs/builder/shared/builderPlugins/adapterBasic.js +50 -10
- package/dist/cjs/builder/shared/builderPlugins/adapterHtml.js +10 -6
- package/dist/cjs/builder/shared/builderPlugins/adapterPrecompress.js +9 -5
- package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +12 -6
- package/dist/cjs/builder/shared/builderPlugins/builderHooks.js +12 -8
- package/dist/cjs/builder/shared/builderPlugins/index.js +9 -5
- package/dist/cjs/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.js +9 -5
- package/dist/cjs/builder/shared/bundlerPlugins/HtmlBottomTemplate.js +12 -8
- package/dist/cjs/builder/shared/bundlerPlugins/RouterPlugin.js +9 -5
- package/dist/cjs/builder/shared/bundlerPlugins/index.js +9 -5
- package/dist/cjs/builder/shared/createCopyInfo.js +9 -5
- package/dist/cjs/builder/shared/index.js +9 -5
- package/dist/cjs/builder/shared/loaders/serverModuleLoader.js +12 -8
- package/dist/cjs/commands/build.js +9 -5
- package/dist/cjs/commands/deploy.js +9 -5
- package/dist/cjs/commands/dev.js +9 -5
- package/dist/cjs/commands/index.js +12 -11
- package/dist/cjs/commands/info.js +9 -5
- package/dist/cjs/commands/inspect.js +12 -8
- package/dist/cjs/commands/runtime.js +50 -13
- package/dist/cjs/commands/serve.js +9 -5
- package/dist/cjs/compat/hooks.js +9 -5
- package/dist/cjs/compat/index.js +9 -5
- package/dist/cjs/compat/utils.js +9 -5
- package/dist/cjs/config/default.js +9 -5
- package/dist/cjs/config/index.js +9 -5
- package/dist/cjs/config/initialize/index.js +9 -5
- package/dist/cjs/config/initialize/inits.js +9 -5
- package/dist/cjs/constants.js +13 -9
- package/dist/cjs/defineConfig.js +12 -8
- package/dist/cjs/esm/register-esm.js +12 -8
- package/dist/cjs/esm/ts-paths-loader.js +9 -5
- package/dist/cjs/index.js +22 -17
- package/dist/cjs/locale/en.js +12 -8
- package/dist/cjs/locale/index.js +9 -5
- package/dist/cjs/locale/zh.js +12 -8
- package/dist/cjs/plugins/analyze/constants.js +14 -10
- package/dist/cjs/plugins/analyze/getBundleEntry.js +9 -5
- package/dist/cjs/plugins/analyze/getFileSystemEntry.js +9 -5
- package/dist/cjs/plugins/analyze/getHtmlTemplate.js +9 -5
- package/dist/cjs/plugins/analyze/getServerRoutes.js +9 -5
- package/dist/cjs/plugins/analyze/index.js +9 -5
- package/dist/cjs/plugins/analyze/isDefaultExportFunction.js +9 -5
- package/dist/cjs/plugins/analyze/templates.js +12 -8
- package/dist/cjs/plugins/analyze/utils.js +9 -5
- package/dist/cjs/plugins/deploy/index.js +26 -11
- package/dist/cjs/plugins/deploy/platforms/cloudflare.js +400 -0
- package/dist/cjs/plugins/deploy/platforms/gh-pages.js +9 -5
- package/dist/cjs/plugins/deploy/platforms/netlify.js +9 -5
- package/dist/cjs/plugins/deploy/platforms/node.js +9 -5
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.mjs +563 -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/plugins/deploy/platforms/vercel.js +9 -5
- package/dist/cjs/plugins/deploy/utils/generator.js +9 -5
- package/dist/cjs/plugins/deploy/utils/index.js +19 -40
- package/dist/cjs/plugins/initialize/index.js +9 -5
- package/dist/cjs/plugins/serverBuild.js +9 -5
- package/dist/cjs/plugins/serverRuntime.js +12 -8
- package/dist/cjs/presetUltramodern.js +95 -7
- package/dist/cjs/rsbuild.js +55 -64
- package/dist/cjs/run/index.js +9 -5
- package/dist/cjs/types/config/cloudflareDeploy.js +18 -0
- package/dist/cjs/types/config/index.js +9 -5
- package/dist/cjs/types/config/precompress.js +18 -0
- package/dist/cjs/types/index.js +9 -5
- package/dist/cjs/ultramodern/designSystem.js +16 -12
- package/dist/cjs/utils/config.js +9 -5
- package/dist/cjs/utils/createServer.js +14 -10
- package/dist/cjs/utils/env.js +9 -5
- package/dist/cjs/utils/generateWatchFiles.js +9 -5
- package/dist/cjs/utils/getConfigFile.js +9 -5
- package/dist/cjs/utils/getSelectedEntries.js +9 -5
- package/dist/cjs/utils/initAppContext.js +9 -5
- package/dist/cjs/utils/loadPlugins.js +9 -5
- package/dist/cjs/utils/printInstructions.js +9 -5
- package/dist/cjs/utils/register.js +9 -5
- package/dist/cjs/utils/restart.js +9 -5
- package/dist/cjs/utils/routes.js +9 -5
- package/dist/esm/baseline.mjs +3 -45
- 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/adapterHtml.mjs +1 -1
- package/dist/esm/builder/shared/builderPlugins/adapterSSR.mjs +3 -1
- package/dist/esm/commands/index.mjs +2 -5
- package/dist/esm/commands/runtime.mjs +33 -3
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/plugins/deploy/index.mjs +10 -4
- package/dist/esm/plugins/deploy/platforms/cloudflare.mjs +352 -0
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.mjs +563 -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/plugins/deploy/utils/index.mjs +11 -36
- package/dist/esm/presetUltramodern.mjs +77 -3
- package/dist/esm/rsbuild.mjs +4 -8
- package/dist/esm/types/config/cloudflareDeploy.mjs +0 -0
- package/dist/esm/types/config/precompress.mjs +0 -0
- package/dist/esm-node/baseline.mjs +3 -45
- 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/adapterHtml.mjs +1 -1
- package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.mjs +3 -1
- package/dist/esm-node/commands/index.mjs +2 -5
- package/dist/esm-node/commands/runtime.mjs +33 -3
- package/dist/esm-node/index.mjs +2 -2
- package/dist/esm-node/plugins/deploy/index.mjs +10 -4
- package/dist/esm-node/plugins/deploy/platforms/cloudflare.mjs +353 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.mjs +563 -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/plugins/deploy/utils/index.mjs +12 -36
- package/dist/esm-node/presetUltramodern.mjs +77 -3
- package/dist/esm-node/rsbuild.mjs +4 -8
- package/dist/esm-node/types/config/cloudflareDeploy.mjs +1 -0
- package/dist/esm-node/types/config/precompress.mjs +1 -0
- package/dist/types/baseline.d.ts +16 -46
- package/dist/types/builder/builder-rspack/index.d.ts +1 -1
- package/dist/types/builder/generator/index.d.ts +1 -1
- package/dist/types/builder/shared/createCopyInfo.d.ts +1 -1
- package/dist/types/commands/index.d.ts +1 -1
- package/dist/types/commands/inspect.d.ts +1 -1
- package/dist/types/commands/runtime.d.ts +1 -0
- package/dist/types/locale/en.d.ts +1 -1
- package/dist/types/locale/index.d.ts +89 -2
- package/dist/types/locale/zh.d.ts +1 -1
- package/dist/types/plugins/analyze/getFileSystemEntry.d.ts +2 -2
- package/dist/types/plugins/analyze/utils.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/plugins/deploy/utils/generator.d.ts +2 -2
- package/dist/types/plugins/deploy/utils/index.d.ts +1 -1
- package/dist/types/presetUltramodern.d.ts +52 -2
- package/dist/types/rsbuild.d.ts +1 -1
- package/dist/types/run/index.d.ts +1 -1
- package/dist/types/types/config/cloudflareDeploy.d.ts +79 -0
- package/dist/types/types/config/deploy.d.ts +16 -14
- package/dist/types/types/config/output.d.ts +4 -20
- package/dist/types/types/config/precompress.d.ts +20 -0
- package/dist/types/utils/getConfigFile.d.ts +1 -1
- package/dist/types/utils/loadPlugins.d.ts +2 -2
- package/package.json +21 -22
- package/dist/esm/rslib-runtime.mjs +0 -18
- package/dist/esm-node/rslib-runtime.mjs +0 -19
|
@@ -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;
|
|
@@ -5,8 +5,8 @@ export declare const serverAppContextTemplate: (appContext: AppToolsContext) =>
|
|
|
5
5
|
sharedDirectory: string;
|
|
6
6
|
apiDirectory: string;
|
|
7
7
|
lambdaDirectory: string;
|
|
8
|
-
metaName:
|
|
9
|
-
bffRuntimeFramework:
|
|
8
|
+
metaName: string;
|
|
9
|
+
bffRuntimeFramework: "effect" | "hono";
|
|
10
10
|
};
|
|
11
11
|
export type PluginItem = [string, Record<string, any> | undefined];
|
|
12
12
|
export declare const genPluginImportsCode: (plugins: PluginItem[], isESM?: boolean) => string;
|
|
@@ -12,5 +12,5 @@ export declare const getProjectUsage: (appDirectory: string, distDirectory: stri
|
|
|
12
12
|
useWebServer: boolean;
|
|
13
13
|
};
|
|
14
14
|
export declare const getTemplatePath: (file: string) => string;
|
|
15
|
-
export declare const readTemplate: (file: string) => Promise<
|
|
15
|
+
export declare const readTemplate: (file: string) => Promise<string>;
|
|
16
16
|
export declare const resolveESMDependency: (entry: string) => Promise<string | undefined>;
|
|
@@ -1,6 +1,56 @@
|
|
|
1
|
-
import { type AppBaselineOptions } from './baseline';
|
|
2
1
|
import type { AppUserConfig } from './types';
|
|
3
|
-
export interface PresetUltramodernOptions
|
|
2
|
+
export interface PresetUltramodernOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Stable producer identity used by BFF cross-project clients.
|
|
5
|
+
* @default "app"
|
|
6
|
+
*/
|
|
7
|
+
appId?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Enable BFF requestId contract by default.
|
|
10
|
+
* @default true
|
|
11
|
+
*/
|
|
12
|
+
enableBffRequestId?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Enable telemetry contract by default.
|
|
15
|
+
* Exporters are still configured separately by applications.
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
enableTelemetry?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Enable telemetry exporters.
|
|
21
|
+
*
|
|
22
|
+
* By default each exporter is enabled only when its endpoint is explicitly
|
|
23
|
+
* configured (via the matching option or environment variable), so a bare
|
|
24
|
+
* preset app boots in production without local collectors.
|
|
25
|
+
* Set `true` to force both exporters on with their default localhost
|
|
26
|
+
* endpoints, or `false` to disable exporters entirely.
|
|
27
|
+
* @default undefined (endpoint-driven)
|
|
28
|
+
*/
|
|
29
|
+
enableTelemetryExporters?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* OTLP exporter endpoint. Setting it (or the environment variable)
|
|
32
|
+
* enables the OTLP exporter unless `enableTelemetryExporters` is `false`.
|
|
33
|
+
* @default process.env.MODERN_TELEMETRY_OTLP_ENDPOINT || 'http://127.0.0.1:4318/v1/logs'
|
|
34
|
+
*/
|
|
35
|
+
otlpEndpoint?: string;
|
|
36
|
+
/**
|
|
37
|
+
* VictoriaMetrics exporter endpoint. Setting it (or the environment
|
|
38
|
+
* variable) enables the VictoriaMetrics exporter unless
|
|
39
|
+
* `enableTelemetryExporters` is `false`.
|
|
40
|
+
* @default process.env.MODERN_TELEMETRY_VICTORIA_ENDPOINT || 'http://127.0.0.1:8428/api/v1/import/prometheus'
|
|
41
|
+
*/
|
|
42
|
+
victoriaMetricsEndpoint?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Enable fail-loud startup probing for telemetry exporters.
|
|
45
|
+
* Probes only run for exporters that are actually enabled.
|
|
46
|
+
* @default true
|
|
47
|
+
*/
|
|
48
|
+
telemetryFailLoudStartup?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Enable app-level Module Federation SSR handshake by default.
|
|
51
|
+
* @default true
|
|
52
|
+
*/
|
|
53
|
+
enableModuleFederationSSR?: boolean;
|
|
4
54
|
}
|
|
5
55
|
export declare const createPresetUltramodernConfig: (options?: PresetUltramodernOptions) => AppUserConfig;
|
|
6
56
|
export declare const presetUltramodern: (config: AppUserConfig, options?: PresetUltramodernOptions) => AppUserConfig;
|
package/dist/types/rsbuild.d.ts
CHANGED
|
@@ -7,6 +7,6 @@ type ResolveModernRsbuildConfigOptions = {
|
|
|
7
7
|
modifyModernConfig?: (config: AppUserConfig) => AppUserConfig | Promise<AppUserConfig>;
|
|
8
8
|
};
|
|
9
9
|
export declare function resolveModernRsbuildConfig(options: ResolveModernRsbuildConfigOptions): Promise<{
|
|
10
|
-
rsbuildConfig:
|
|
10
|
+
rsbuildConfig: import("@rsbuild/core").RsbuildConfig;
|
|
11
11
|
}>;
|
|
12
12
|
export type { ResolveModernRsbuildConfigOptions };
|
|
@@ -14,7 +14,7 @@ export declare function createRunOptions({ cwd, initialLog, metaName, version, i
|
|
|
14
14
|
initialLog: string;
|
|
15
15
|
configFile: string;
|
|
16
16
|
metaName: string;
|
|
17
|
-
internalPlugins:
|
|
17
|
+
internalPlugins: import("@modern-js/plugin").Plugin[];
|
|
18
18
|
handleSetupResult: typeof handleSetupResult;
|
|
19
19
|
}>;
|
|
20
20
|
export declare function run(options: RunOptions): Promise<void>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export type DeployTarget = 'node' | 'vercel' | 'netlify' | 'ghPages' | 'cloudflare';
|
|
2
|
+
export type CloudflareWorkerSecurityCspMode = 'enforce' | 'report-only' | 'off';
|
|
3
|
+
export interface CloudflareWorkerSecurityCspConfig {
|
|
4
|
+
mode?: CloudflareWorkerSecurityCspMode;
|
|
5
|
+
directives?: Record<string, string[] | string | false>;
|
|
6
|
+
additionalScriptSrc?: string[];
|
|
7
|
+
additionalStyleSrc?: string[];
|
|
8
|
+
additionalConnectSrc?: string[];
|
|
9
|
+
additionalImgSrc?: string[];
|
|
10
|
+
frameAncestors?: string[] | false;
|
|
11
|
+
reportUri?: string;
|
|
12
|
+
reason?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface CloudflareWorkerSecurityNoindexConfig {
|
|
15
|
+
workersDev?: boolean;
|
|
16
|
+
localhost?: boolean;
|
|
17
|
+
previewHostnames?: string[];
|
|
18
|
+
reason?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface CloudflareWorkerSecurityCorsConfig {
|
|
21
|
+
/**
|
|
22
|
+
* Origins allowed to read application responses (BFF APIs, SSR HTML,
|
|
23
|
+
* route fallbacks) cross-origin. Accepts exact origins
|
|
24
|
+
* (e.g. `https://shell.example.com`) or `'*'`.
|
|
25
|
+
* When empty, application responses carry no CORS headers (same-origin).
|
|
26
|
+
* @default []
|
|
27
|
+
*/
|
|
28
|
+
allowedOrigins?: string[];
|
|
29
|
+
/**
|
|
30
|
+
* Methods advertised on CORS preflight responses for application routes.
|
|
31
|
+
* @default ['GET', 'HEAD', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS']
|
|
32
|
+
*/
|
|
33
|
+
allowedMethods?: string[];
|
|
34
|
+
/**
|
|
35
|
+
* Headers advertised on CORS preflight responses for application routes.
|
|
36
|
+
* @default ['*']
|
|
37
|
+
*/
|
|
38
|
+
allowedHeaders?: string[];
|
|
39
|
+
/**
|
|
40
|
+
* Apply wildcard CORS to static asset responses so federated remotes
|
|
41
|
+
* (remote entries, manifests, CSS) can be loaded cross-origin.
|
|
42
|
+
* @default true
|
|
43
|
+
*/
|
|
44
|
+
assets?: boolean;
|
|
45
|
+
reason?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface CloudflareWorkerSecurityConfig {
|
|
48
|
+
/**
|
|
49
|
+
* Disable all Cloudflare worker security defaults for this app.
|
|
50
|
+
* Prefer narrower escape hatches when possible.
|
|
51
|
+
*/
|
|
52
|
+
enabled?: boolean;
|
|
53
|
+
headers?: {
|
|
54
|
+
referrerPolicy?: string | false;
|
|
55
|
+
contentTypeOptions?: 'nosniff' | false;
|
|
56
|
+
permissionsPolicy?: string | false;
|
|
57
|
+
};
|
|
58
|
+
contentSecurityPolicy?: CloudflareWorkerSecurityCspConfig;
|
|
59
|
+
noindex?: boolean | CloudflareWorkerSecurityNoindexConfig;
|
|
60
|
+
/**
|
|
61
|
+
* Cross-origin resource sharing policy applied by the generated worker.
|
|
62
|
+
* Asset responses default to wildcard CORS for federated loading;
|
|
63
|
+
* application responses (BFF, SSR) default to no CORS headers.
|
|
64
|
+
*/
|
|
65
|
+
cors?: CloudflareWorkerSecurityCorsConfig;
|
|
66
|
+
/**
|
|
67
|
+
* @deprecated Write-only: this option never had any runtime effect — the
|
|
68
|
+
* generated worker never mutates application `Set-Cookie` headers.
|
|
69
|
+
* Kept temporarily so configs emitted by existing `modern create`
|
|
70
|
+
* templates keep typechecking; will be removed once the generator stops
|
|
71
|
+
* emitting it. Use {@link CloudflareWorkerSecurityConfig.cors} for the
|
|
72
|
+
* worker's cross-origin policy.
|
|
73
|
+
*/
|
|
74
|
+
cookies?: {
|
|
75
|
+
mutateSetCookie?: false;
|
|
76
|
+
reason?: string;
|
|
77
|
+
};
|
|
78
|
+
reason?: string;
|
|
79
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { CloudflareWorkerSecurityConfig, DeployTarget } from './cloudflareDeploy';
|
|
2
|
+
export type { CloudflareWorkerSecurityConfig, CloudflareWorkerSecurityCorsConfig, CloudflareWorkerSecurityCspConfig, CloudflareWorkerSecurityCspMode, CloudflareWorkerSecurityNoindexConfig, DeployTarget, } from './cloudflareDeploy';
|
|
1
3
|
export interface MicroFrontend {
|
|
2
4
|
/**
|
|
3
5
|
* Specifies whether to enable the HTML entry.
|
|
@@ -11,28 +13,28 @@ export interface MicroFrontend {
|
|
|
11
13
|
*/
|
|
12
14
|
externalBasicLibrary?: boolean;
|
|
13
15
|
moduleApp?: string;
|
|
14
|
-
/**
|
|
15
|
-
* Runtime compatibility digest exposed in remote contracts (manifest / remote entry).
|
|
16
|
-
*/
|
|
17
|
-
runtimeDigest?: string;
|
|
18
|
-
/**
|
|
19
|
-
* SRI-style integrity token for the remote entry contract.
|
|
20
|
-
* Example: `sha256-<base64Digest>`.
|
|
21
|
-
*/
|
|
22
|
-
integrity?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Opaque attestation token exposed in remote runtime metadata.
|
|
25
|
-
* Can be validated by the host via runtime `remoteTrust.attestations`.
|
|
26
|
-
*/
|
|
27
|
-
attestation?: string;
|
|
28
16
|
}
|
|
29
17
|
export interface DeployUserConfig {
|
|
18
|
+
/**
|
|
19
|
+
* Selects the deploy output preset.
|
|
20
|
+
* `MODERNJS_DEPLOY` still overrides provider auto-detection when set.
|
|
21
|
+
* @default node
|
|
22
|
+
*/
|
|
23
|
+
target?: DeployTarget;
|
|
30
24
|
/**
|
|
31
25
|
* Used to configure micro-frontend sub-application information.
|
|
32
26
|
* @default false
|
|
33
27
|
*/
|
|
34
28
|
microFrontend?: boolean | MicroFrontend;
|
|
35
29
|
worker?: {
|
|
30
|
+
name?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Cloudflare Workers compatibility date for generated wrangler config.
|
|
33
|
+
* Use YYYY-MM-DD. Defaults to the date validated against the bundled
|
|
34
|
+
* Wrangler version used by UltraModern generated workspaces.
|
|
35
|
+
*/
|
|
36
|
+
compatibilityDate?: string;
|
|
36
37
|
ssr?: boolean;
|
|
38
|
+
security?: CloudflareWorkerSecurityConfig;
|
|
37
39
|
};
|
|
38
40
|
}
|
|
@@ -1,25 +1,8 @@
|
|
|
1
1
|
import type { BuilderConfig } from '@modern-js/builder';
|
|
2
2
|
import type { SSGConfig, SSGMultiEntryOptions } from '@modern-js/types';
|
|
3
|
-
import type CompressionPlugin from 'compression-webpack-plugin';
|
|
4
3
|
import type { UnwrapBuilderConfig } from '../utils';
|
|
5
|
-
type
|
|
6
|
-
export type PrecompressCodecOptions
|
|
7
|
-
export interface PrecompressConfig {
|
|
8
|
-
/**
|
|
9
|
-
* Configure gzip precompression options.
|
|
10
|
-
* `true` means using default options.
|
|
11
|
-
* `false` means disabling gzip precompression.
|
|
12
|
-
* @default true
|
|
13
|
-
*/
|
|
14
|
-
gzip?: PrecompressCodecOptions;
|
|
15
|
-
/**
|
|
16
|
-
* Configure brotli precompression options.
|
|
17
|
-
* `true` means using default options.
|
|
18
|
-
* `false` means disabling brotli precompression.
|
|
19
|
-
* @default true
|
|
20
|
-
*/
|
|
21
|
-
brotli?: PrecompressCodecOptions;
|
|
22
|
-
}
|
|
4
|
+
import type { PrecompressConfig } from './precompress';
|
|
5
|
+
export type { PrecompressCodecOptions, PrecompressConfig } from './precompress';
|
|
23
6
|
export interface OutputUserConfig extends UnwrapBuilderConfig<BuilderConfig, 'output'> {
|
|
24
7
|
/**
|
|
25
8
|
* Enable SSG for self-controlled routing or conventional routing.
|
|
@@ -54,7 +37,8 @@ export interface OutputUserConfig extends UnwrapBuilderConfig<BuilderConfig, 'ou
|
|
|
54
37
|
/**
|
|
55
38
|
* Generate precompressed static assets by using compression-webpack-plugin.
|
|
56
39
|
* `true` means enabling both gzip and brotli with default options.
|
|
57
|
-
*
|
|
40
|
+
* Disabled unless explicitly configured; `presetUltramodern` enables it.
|
|
41
|
+
* @default false
|
|
58
42
|
*/
|
|
59
43
|
precompress?: boolean | PrecompressConfig;
|
|
60
44
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type CompressionPlugin from 'compression-webpack-plugin';
|
|
2
|
+
type CompressionPluginOptions = NonNullable<ConstructorParameters<typeof CompressionPlugin>[0]>;
|
|
3
|
+
export type PrecompressCodecOptions = boolean | CompressionPluginOptions;
|
|
4
|
+
export interface PrecompressConfig {
|
|
5
|
+
/**
|
|
6
|
+
* Configure gzip precompression options.
|
|
7
|
+
* `true` means using default options.
|
|
8
|
+
* `false` means disabling gzip precompression.
|
|
9
|
+
* @default true
|
|
10
|
+
*/
|
|
11
|
+
gzip?: PrecompressCodecOptions;
|
|
12
|
+
/**
|
|
13
|
+
* Configure brotli precompression options.
|
|
14
|
+
* `true` means using default options.
|
|
15
|
+
* `false` means disabling brotli precompression.
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
brotli?: PrecompressCodecOptions;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getConfigFile: (configFile?: string, cwd?: string) =>
|
|
1
|
+
export declare const getConfigFile: (configFile?: string, cwd?: string) => string | false;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CLIPluginAPI } from '@modern-js/plugin';
|
|
1
|
+
import type { CLIPluginAPI, Plugin } from '@modern-js/plugin';
|
|
2
2
|
import type { ServerPlugin as ServerPluginInstance } from '@modern-js/server-core';
|
|
3
3
|
import type { InternalPlugins, ServerPlugin } from '@modern-js/types';
|
|
4
4
|
import type { AppTools } from '../types';
|
|
@@ -10,4 +10,4 @@ export declare function loadServerPlugins(api: CLIPluginAPI<AppTools>, appDirect
|
|
|
10
10
|
* @param internalPlugins - Internal plugins.
|
|
11
11
|
* @returns Plugin Objects has been required.
|
|
12
12
|
*/
|
|
13
|
-
export declare const loadInternalPlugins: (appDirectory: string, internalPlugins?: InternalPlugins) => Promise<
|
|
13
|
+
export declare const loadInternalPlugins: (appDirectory: string, internalPlugins?: InternalPlugins) => Promise<Plugin[]>;
|
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.121",
|
|
21
21
|
"types": "./dist/types/index.d.ts",
|
|
22
22
|
"main": "./dist/cjs/index.js",
|
|
23
23
|
"exports": {
|
|
@@ -82,38 +82,37 @@
|
|
|
82
82
|
"modern-app": "bin/modern.js"
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@babel/parser": "^7.29.
|
|
86
|
-
"@babel/traverse": "^7.29.
|
|
87
|
-
"@babel/types": "^7.29.
|
|
88
|
-
"@
|
|
89
|
-
"@
|
|
90
|
-
"@swc/helpers": "^0.5.
|
|
85
|
+
"@babel/parser": "^7.29.7",
|
|
86
|
+
"@babel/traverse": "^7.29.7",
|
|
87
|
+
"@babel/types": "^7.29.7",
|
|
88
|
+
"@loadable/component": "5.16.7",
|
|
89
|
+
"@rsbuild/core": "2.0.11",
|
|
90
|
+
"@swc/helpers": "^0.5.23",
|
|
91
91
|
"compression-webpack-plugin": "^12.0.0",
|
|
92
92
|
"es-module-lexer": "^2.1.0",
|
|
93
93
|
"esbuild": "^0.28.0",
|
|
94
|
-
"esbuild-register": "^3.6.0",
|
|
95
94
|
"flatted": "^3.4.2",
|
|
96
95
|
"import-meta-resolve": "^4.2.0",
|
|
97
96
|
"mlly": "^1.8.2",
|
|
98
97
|
"ndepe": "^0.1.13",
|
|
99
98
|
"pkg-types": "^2.3.1",
|
|
100
99
|
"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/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.2.0-ultramodern.
|
|
106
|
-
"@modern-js/
|
|
107
|
-
"@modern-js/server-
|
|
108
|
-
"@modern-js/
|
|
109
|
-
"@modern-js/
|
|
110
|
-
"@modern-js/server": "npm:@bleedingdev/modern-js-server@3.2.0-ultramodern.
|
|
100
|
+
"@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.2.0-ultramodern.121",
|
|
101
|
+
"@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.2.0-ultramodern.121",
|
|
102
|
+
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.2.0-ultramodern.121",
|
|
103
|
+
"@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.2.0-ultramodern.121",
|
|
104
|
+
"@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.2.0-ultramodern.121",
|
|
105
|
+
"@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.2.0-ultramodern.121",
|
|
106
|
+
"@modern-js/server-utils": "npm:@bleedingdev/modern-js-server-utils@3.2.0-ultramodern.121",
|
|
107
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.121",
|
|
108
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.121",
|
|
109
|
+
"@modern-js/server": "npm:@bleedingdev/modern-js-server@3.2.0-ultramodern.121"
|
|
111
110
|
},
|
|
112
111
|
"devDependencies": {
|
|
113
|
-
"@rslib/core": "0.
|
|
112
|
+
"@rslib/core": "0.22.0",
|
|
114
113
|
"@types/babel__traverse": "7.28.0",
|
|
115
|
-
"@types/node": "^25.
|
|
116
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
114
|
+
"@types/node": "^25.9.3",
|
|
115
|
+
"@typescript/native-preview": "7.0.0-dev.20260610.1",
|
|
117
116
|
"tsconfig-paths": "^4.2.0",
|
|
118
117
|
"@scripts/rstest-config": "2.66.0"
|
|
119
118
|
},
|
|
@@ -132,7 +131,7 @@
|
|
|
132
131
|
},
|
|
133
132
|
"scripts": {
|
|
134
133
|
"dev": "rslib build --watch",
|
|
135
|
-
"build": "rslib build",
|
|
134
|
+
"build": "rslib build && pnpm -w tsgo:dts \"$PWD\"",
|
|
136
135
|
"test": "rstest"
|
|
137
136
|
}
|
|
138
137
|
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
var __webpack_modules__ = {};
|
|
2
|
-
var __webpack_module_cache__ = {};
|
|
3
|
-
function __webpack_require__(moduleId) {
|
|
4
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
|
5
|
-
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
6
|
-
var module = __webpack_module_cache__[moduleId] = {
|
|
7
|
-
exports: {}
|
|
8
|
-
};
|
|
9
|
-
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
10
|
-
return module.exports;
|
|
11
|
-
}
|
|
12
|
-
__webpack_require__.m = __webpack_modules__;
|
|
13
|
-
(()=>{
|
|
14
|
-
__webpack_require__.add = function(modules) {
|
|
15
|
-
Object.assign(__webpack_require__.m, modules);
|
|
16
|
-
};
|
|
17
|
-
})();
|
|
18
|
-
export { __webpack_require__ };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import "node:module";
|
|
2
|
-
var __webpack_modules__ = {};
|
|
3
|
-
var __webpack_module_cache__ = {};
|
|
4
|
-
function __webpack_require__(moduleId) {
|
|
5
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
|
6
|
-
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
7
|
-
var module = __webpack_module_cache__[moduleId] = {
|
|
8
|
-
exports: {}
|
|
9
|
-
};
|
|
10
|
-
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
11
|
-
return module.exports;
|
|
12
|
-
}
|
|
13
|
-
__webpack_require__.m = __webpack_modules__;
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.add = function(modules) {
|
|
16
|
-
Object.assign(__webpack_require__.m, modules);
|
|
17
|
-
};
|
|
18
|
-
})();
|
|
19
|
-
export { __webpack_require__ };
|