@bleedingdev/modern-js-app-tools-extensions 3.9.0-ultramodern.3 → 3.9.0-ultramodern.5

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 (107) hide show
  1. package/dist/cjs/backend-federation-build/codegen.js +256 -0
  2. package/dist/cjs/backend-federation-build/config.js +204 -0
  3. package/dist/cjs/backend-federation-build/emit.js +150 -0
  4. package/dist/cjs/backend-federation-build/index.js +53 -0
  5. package/dist/cjs/build-config/build-environment.js +268 -0
  6. package/dist/cjs/build-config/precompress/plugin.js +124 -0
  7. package/dist/cjs/build-config/precompress/types.js +18 -0
  8. package/dist/cjs/build-config/public.js +46 -0
  9. package/dist/cjs/cloudflare/constants.js +1 -1
  10. package/dist/cjs/cloudflare/delivery-unit.js +9 -9
  11. package/dist/cjs/cloudflare-output-contract.js +37 -1
  12. package/dist/cjs/cloudflare-output-verifier/identity.js +6 -6
  13. package/dist/cjs/cloudflare-output-verifier/worker-bundles.js +4 -1
  14. package/dist/cjs/config.js +29 -1
  15. package/dist/cjs/deploy-output/npmAliases.js +226 -0
  16. package/dist/cjs/deploy-output/plugin.js +76 -0
  17. package/dist/cjs/deploy-output/target.js +48 -0
  18. package/dist/cjs/native-type-checker.js +150 -0
  19. package/dist/cjs/release-envelope/framework-output.js +27 -27
  20. package/dist/cjs/release-envelope/plugin.js +2 -1
  21. package/dist/cjs/release-identity.js +3 -6
  22. package/dist/esm/backend-federation-build/codegen.mjs +205 -0
  23. package/dist/esm/backend-federation-build/config.mjs +128 -0
  24. package/dist/esm/backend-federation-build/emit.mjs +99 -0
  25. package/dist/esm/backend-federation-build/index.mjs +1 -0
  26. package/dist/esm/build-config/build-environment.mjs +224 -0
  27. package/dist/esm/build-config/precompress/plugin.mjs +76 -0
  28. package/dist/esm/build-config/precompress/types.mjs +0 -0
  29. package/dist/esm/build-config/public.mjs +1 -0
  30. package/dist/esm/cloudflare/constants.mjs +1 -1
  31. package/dist/esm/cloudflare/delivery-unit.mjs +1 -1
  32. package/dist/esm/cloudflare-output-contract.mjs +35 -2
  33. package/dist/esm/cloudflare-output-verifier/identity.mjs +1 -1
  34. package/dist/esm/cloudflare-output-verifier/worker-bundles.mjs +5 -2
  35. package/dist/esm/config.mjs +1 -0
  36. package/dist/esm/deploy-output/npmAliases.mjs +174 -0
  37. package/dist/esm/deploy-output/plugin.mjs +28 -0
  38. package/dist/esm/deploy-output/target.mjs +10 -0
  39. package/dist/esm/native-type-checker.mjs +99 -0
  40. package/dist/esm/release-envelope/framework-output.mjs +1 -1
  41. package/dist/esm/release-envelope/plugin.mjs +2 -1
  42. package/dist/esm/release-identity.mjs +3 -6
  43. package/dist/esm-node/backend-federation-build/codegen.mjs +206 -0
  44. package/dist/esm-node/backend-federation-build/config.mjs +129 -0
  45. package/dist/esm-node/backend-federation-build/emit.mjs +100 -0
  46. package/dist/esm-node/backend-federation-build/index.mjs +2 -0
  47. package/dist/esm-node/build-config/build-environment.mjs +225 -0
  48. package/dist/esm-node/build-config/precompress/plugin.mjs +77 -0
  49. package/dist/esm-node/build-config/precompress/types.mjs +1 -0
  50. package/dist/esm-node/build-config/public.mjs +2 -0
  51. package/dist/esm-node/cloudflare/constants.mjs +1 -1
  52. package/dist/esm-node/cloudflare/delivery-unit.mjs +1 -1
  53. package/dist/esm-node/cloudflare-output-contract.mjs +35 -2
  54. package/dist/esm-node/cloudflare-output-verifier/identity.mjs +1 -1
  55. package/dist/esm-node/cloudflare-output-verifier/worker-bundles.mjs +5 -2
  56. package/dist/esm-node/config.mjs +1 -0
  57. package/dist/esm-node/deploy-output/npmAliases.mjs +175 -0
  58. package/dist/esm-node/deploy-output/plugin.mjs +31 -0
  59. package/dist/esm-node/deploy-output/target.mjs +11 -0
  60. package/dist/esm-node/native-type-checker.mjs +100 -0
  61. package/dist/esm-node/release-envelope/framework-output.mjs +1 -1
  62. package/dist/esm-node/release-envelope/plugin.mjs +2 -1
  63. package/dist/esm-node/release-identity.mjs +3 -6
  64. package/dist/types/backend-federation-build/codegen.d.ts +86 -0
  65. package/dist/types/backend-federation-build/config.d.ts +103 -0
  66. package/dist/types/backend-federation-build/emit.d.ts +21 -0
  67. package/dist/types/backend-federation-build/index.d.ts +2 -0
  68. package/dist/types/build-config/build-environment.d.ts +22 -0
  69. package/dist/types/build-config/precompress/plugin.d.ts +4 -0
  70. package/dist/types/build-config/precompress/types.d.ts +19 -0
  71. package/dist/types/build-config/public.d.ts +2 -0
  72. package/dist/types/cloudflare/constants.d.ts +1 -1
  73. package/dist/types/cloudflare/delivery-unit.d.ts +1 -1
  74. package/dist/types/cloudflare/worker-manifest.d.ts +2 -2
  75. package/dist/types/cloudflare-output-contract.d.ts +2 -1
  76. package/dist/types/cloudflare-output-verifier/identity.d.ts +1 -1
  77. package/dist/types/config.d.ts +2 -0
  78. package/dist/types/deploy-output/npmAliases.d.ts +14 -0
  79. package/dist/types/deploy-output/plugin.d.ts +15 -0
  80. package/dist/types/deploy-output/target.d.ts +6 -0
  81. package/dist/types/native-type-checker.d.ts +15 -0
  82. package/dist/types/precompress/LICENSE +20 -0
  83. package/dist/types/precompress/index.d.ts +76 -0
  84. package/package.json +55 -8
  85. package/src/backend-federation-build/codegen.ts +245 -0
  86. package/src/backend-federation-build/config.ts +376 -0
  87. package/src/backend-federation-build/emit.ts +205 -0
  88. package/src/backend-federation-build/index.ts +2 -0
  89. package/src/build-config/build-environment.ts +404 -0
  90. package/src/build-config/precompress/plugin.ts +140 -0
  91. package/src/build-config/precompress/types.ts +26 -0
  92. package/src/build-config/public.ts +6 -0
  93. package/src/cloudflare/constants.ts +1 -1
  94. package/src/cloudflare/delivery-unit.ts +2 -2
  95. package/src/cloudflare/worker-manifest.ts +1 -0
  96. package/src/cloudflare-builder.ts +1 -0
  97. package/src/cloudflare-output-contract.ts +37 -0
  98. package/src/cloudflare-output-verifier/identity.ts +1 -1
  99. package/src/cloudflare-output-verifier/worker-bundles.ts +5 -3
  100. package/src/config.ts +7 -0
  101. package/src/deploy-output/npmAliases.ts +333 -0
  102. package/src/deploy-output/plugin.ts +49 -0
  103. package/src/deploy-output/target.ts +23 -0
  104. package/src/native-type-checker.ts +122 -0
  105. package/src/release-envelope/framework-output.ts +1 -1
  106. package/src/release-envelope/plugin.ts +5 -1
  107. package/src/release-identity.ts +3 -2
@@ -0,0 +1,100 @@
1
+ import "node:module";
2
+ import { execFile } from "node:child_process";
3
+ import { realpathSync } from "node:fs";
4
+ import node_path from "node:path";
5
+ import { promisify } from "node:util";
6
+ const execute = promisify(execFile);
7
+ const native_type_checker_name = 'UltramodernNativeTypeChecker';
8
+ const watchDependencyPath = (file)=>'win32' === process.platform ? realpathSync.native(file) : file;
9
+ class UltramodernNativeTypeChecker {
10
+ async check() {
11
+ const { configFile, build } = this.options;
12
+ const args = build ? [
13
+ '--build',
14
+ configFile,
15
+ '--stopBuildOnErrors'
16
+ ] : [
17
+ '--project',
18
+ configFile,
19
+ '--noEmit'
20
+ ];
21
+ await this.run([
22
+ ...args,
23
+ '--pretty',
24
+ 'false'
25
+ ]);
26
+ }
27
+ async run(args) {
28
+ try {
29
+ const result = await execute(this.options.compiler(), args, {
30
+ cwd: node_path.dirname(this.options.configFile),
31
+ maxBuffer: 16777216
32
+ });
33
+ return result.stdout;
34
+ } catch (cause) {
35
+ const output = cause;
36
+ const diagnostics = `${output.stdout ?? ''}${output.stderr ?? ''}`;
37
+ throw new Error(`${native_type_checker_name} failed:\n${diagnostics || (cause instanceof Error ? cause.message : String(cause))}`, {
38
+ cause
39
+ });
40
+ }
41
+ }
42
+ async watchInputs() {
43
+ const inputs = new Set();
44
+ const projects = [
45
+ this.options.configFile
46
+ ];
47
+ const visited = new Set();
48
+ for (const configFile of projects){
49
+ if (visited.has(configFile)) continue;
50
+ visited.add(configFile);
51
+ inputs.add(configFile);
52
+ const config = JSON.parse(await this.run([
53
+ '--showConfig',
54
+ '--project',
55
+ configFile
56
+ ]));
57
+ const directory = node_path.dirname(configFile);
58
+ for (const file of config.files ?? [])inputs.add(node_path.resolve(directory, file));
59
+ for (const reference of config.references ?? []){
60
+ const target = node_path.resolve(directory, reference.path);
61
+ projects.push('.json' === node_path.extname(target) ? target : node_path.join(target, 'tsconfig.json'));
62
+ }
63
+ }
64
+ return inputs;
65
+ }
66
+ apply(compiler) {
67
+ compiler.hooks.thisCompilation.tap(native_type_checker_name, (compilation)=>{
68
+ compilation.hooks.processAssets.tapPromise(native_type_checker_name, async ()=>{
69
+ try {
70
+ compilation.fileDependencies.add(watchDependencyPath(this.options.configFile));
71
+ for (const file of (await this.watchInputs()))compilation.fileDependencies.add(watchDependencyPath(file));
72
+ await this.check();
73
+ } catch (cause) {
74
+ compilation.errors.push(new Error(cause instanceof Error ? cause.message : String(cause), {
75
+ cause
76
+ }));
77
+ }
78
+ });
79
+ });
80
+ }
81
+ constructor(options){
82
+ this.options = options;
83
+ }
84
+ }
85
+ function configureUltramodernTypeChecker(chain, pluginId, resolveCompiler) {
86
+ if (!chain.plugins.has(pluginId)) return;
87
+ const options = chain.plugin(pluginId).get('args')?.[0];
88
+ const typescript = options?.typescript;
89
+ if (typescript?.tsgo === false) return;
90
+ if (!typescript?.configFile) throw new Error(`${native_type_checker_name} requires the configured TypeScript project.`);
91
+ const configFile = node_path.resolve(typescript.configFile);
92
+ chain.plugin(pluginId).use(UltramodernNativeTypeChecker, [
93
+ {
94
+ build: true === typescript.build,
95
+ compiler: ()=>resolveCompiler(configFile),
96
+ configFile
97
+ }
98
+ ]);
99
+ }
100
+ export { UltramodernNativeTypeChecker, configureUltramodernTypeChecker };
@@ -2,7 +2,7 @@ import "node:module";
2
2
  import { createHash } from "node:crypto";
3
3
  import promises from "node:fs/promises";
4
4
  import node_path from "node:path";
5
- import { BACKEND_FEDERATION_MANIFEST_FILE, BACKEND_FEDERATION_REMOTE_ENTRY_FILE, ULTRAMODERN_BUILD_ARTIFACT_FILE, isUltramodernBuildArtifact } from "@modern-js/utils/universal";
5
+ import { BACKEND_FEDERATION_MANIFEST_FILE, BACKEND_FEDERATION_REMOTE_ENTRY_FILE, ULTRAMODERN_BUILD_ARTIFACT_FILE, isUltramodernBuildArtifact } from "@modern-js/backend-federation-contracts";
6
6
  import { canonicalSerializeMicroVerticalReleaseEnvelope, createMicroVerticalReleaseEnvelope, verifyMicroVerticalReleaseEnvelope } from "./index.mjs";
7
7
  const MICROVERTICAL_RELEASE_ENVELOPE_PATH = 'release/microvertical-release-envelope.json';
8
8
  const MICROVERTICAL_RELEASE_IDENTITY_CARRIERS_PATH = 'release/microvertical-release-identity-carriers.json';
@@ -11,7 +11,8 @@ const createUltramodernReleaseEnvelopePlugin = ({ resolveDeployTarget })=>({
11
11
  name: '@modern-js/ultramodern-release-envelope',
12
12
  pre: [
13
13
  '@modern-js/backend-federation-build',
14
- '@modern-js/plugin-bff'
14
+ '@modern-js/plugin-bff',
15
+ '@modern-js/deploy-output-aliases'
15
16
  ],
16
17
  post: [
17
18
  '@modern-js/plugin-deploy'
@@ -5,11 +5,8 @@ const BUILD_MARKER_NAMESPACE = 'ultramodern-delivery-unit-release-build-marker:v
5
5
  const PROMOTABLE_SOURCE_REVISION_PATTERN = /^(?:[a-f0-9]{40}|[a-f0-9]{64})$/u;
6
6
  const gitOutput = (workspaceRoot, args)=>{
7
7
  try {
8
- return execFileSync('git', [
9
- '-C',
10
- workspaceRoot,
11
- ...args
12
- ], {
8
+ return execFileSync('git', args, {
9
+ cwd: workspaceRoot,
13
10
  encoding: 'utf8',
14
11
  stdio: [
15
12
  'ignore',
@@ -44,7 +41,7 @@ const resolveUltramodernSourceRevision = (workspaceRoot = process.cwd(), configu
44
41
  ]);
45
42
  const status = gitOutput(gitRoot, [
46
43
  'status',
47
- '--porcelain=v1',
44
+ '--porcelain',
48
45
  '--untracked-files=all'
49
46
  ]);
50
47
  if (!revision || void 0 === status || status.length > 0) return 'workspace';
@@ -0,0 +1,86 @@
1
+ import type { BackendFederationEntryIntegrity } from '@modern-js/server-runtime-extensions/backend-federation-security';
2
+ import { type BackendFederationApp } from './config.js';
3
+ export declare const createBackendRemoteEntrySource: (workspaceRoot: string, app: BackendFederationApp, effectApiPath: string, entryPath: string) => Promise<string>;
4
+ export declare const createBackendManifest: (workspaceRoot: string, distDirectory: string, app: BackendFederationApp, entryIntegrity: BackendFederationEntryIntegrity) => {
5
+ schemaVersion: number;
6
+ id: string;
7
+ name: string;
8
+ version: string | undefined;
9
+ buildVersion: string | undefined;
10
+ metaData: {
11
+ name: string;
12
+ type: string;
13
+ buildInfo: {
14
+ buildVersion: string | undefined;
15
+ buildName: string | undefined;
16
+ };
17
+ remoteEntry: {
18
+ name: string;
19
+ path: string;
20
+ type: string;
21
+ };
22
+ globalName: string;
23
+ publicPath: string;
24
+ ssrRemoteEntry: {
25
+ name: string;
26
+ path: string;
27
+ type: string;
28
+ };
29
+ ssrPublicPath: string;
30
+ };
31
+ entry: {
32
+ byteLength: number;
33
+ sha256: string;
34
+ file: string;
35
+ path: string;
36
+ type: string;
37
+ url: string;
38
+ };
39
+ exposes: {
40
+ id: string;
41
+ name: string;
42
+ path: string;
43
+ assets: {
44
+ js: {
45
+ async: never[];
46
+ sync: string[];
47
+ };
48
+ css: {
49
+ async: never[];
50
+ sync: never[];
51
+ };
52
+ };
53
+ }[];
54
+ shared: never[];
55
+ backendFederation: {
56
+ role: string;
57
+ appId: string;
58
+ name: string;
59
+ runtimeFramework: string;
60
+ strictEffectApproach: boolean;
61
+ contractVersion: string;
62
+ nodeAdapterVersion: string;
63
+ remoteType: string;
64
+ expose: string;
65
+ manifestUrl: string;
66
+ containerEntry: string;
67
+ source: {
68
+ module: string;
69
+ };
70
+ readinessPath: string;
71
+ openapiPath: string;
72
+ deliveryUnit?: import("@modern-js/backend-federation-contracts").DeliveryUnitContractBlock | undefined;
73
+ versionBoundary: {
74
+ invariant: string;
75
+ packageName: string | undefined;
76
+ version: string | undefined;
77
+ buildVersion: string | undefined;
78
+ uiManifestUrl?: string | undefined;
79
+ deliveryUnit?: {
80
+ unitId: string;
81
+ buildMarker: string;
82
+ sourceRevision: string;
83
+ } | undefined;
84
+ };
85
+ };
86
+ };
@@ -0,0 +1,103 @@
1
+ import { type DeliveryUnitContractBlock, type UltramodernBuildArtifact } from '@modern-js/backend-federation-contracts';
2
+ export declare const COMPACT_CONFIG_PATH = ".modernjs/ultramodern.json";
3
+ export type CompactApp = {
4
+ id?: unknown;
5
+ kind?: unknown;
6
+ path?: unknown;
7
+ package?: unknown;
8
+ port?: unknown;
9
+ api?: {
10
+ prefix?: unknown;
11
+ stem?: unknown;
12
+ };
13
+ moduleFederation?: {
14
+ name?: unknown;
15
+ manifestUrl?: unknown;
16
+ };
17
+ backendFederation?: {
18
+ name?: unknown;
19
+ versionBoundary?: {
20
+ ui?: {
21
+ manifestUrl?: unknown;
22
+ };
23
+ };
24
+ executionSurfaces?: {
25
+ node?: {
26
+ remoteName?: unknown;
27
+ manifestUrl?: unknown;
28
+ containerEntry?: unknown;
29
+ remoteType?: unknown;
30
+ };
31
+ };
32
+ };
33
+ deliveryUnit?: {
34
+ unitId?: unknown;
35
+ buildMarker?: unknown;
36
+ sourceRevision?: unknown;
37
+ packageName?: unknown;
38
+ version?: unknown;
39
+ };
40
+ serverExecution?: {
41
+ node?: {
42
+ remoteName?: unknown;
43
+ manifestUrl?: unknown;
44
+ containerEntry?: unknown;
45
+ remoteType?: unknown;
46
+ };
47
+ };
48
+ };
49
+ export type CompactConfig = {
50
+ topology?: {
51
+ apps?: CompactApp[];
52
+ };
53
+ };
54
+ export type BackendFederationApp = {
55
+ id: string;
56
+ directory: string;
57
+ packageName?: string;
58
+ version?: string;
59
+ buildVersion?: string;
60
+ unitId?: string;
61
+ sourceRevision?: string;
62
+ deliveryUnit?: DeliveryUnitContractBlock;
63
+ port: number;
64
+ apiPrefix: string;
65
+ apiStem: string;
66
+ backendName: string;
67
+ manifestUrl: string;
68
+ containerEntry: string;
69
+ remoteType: string;
70
+ uiManifestUrl?: string;
71
+ compactDeliveryUnit?: {
72
+ unitId?: string;
73
+ buildMarker?: string;
74
+ sourceRevision?: string;
75
+ packageName?: string;
76
+ version?: string;
77
+ };
78
+ };
79
+ export type BackendFederationBuildIdentity = {
80
+ appId?: string;
81
+ packageName?: string;
82
+ version?: string;
83
+ buildVersion?: string;
84
+ unitId?: string;
85
+ sourceRevision?: string;
86
+ artifact?: UltramodernBuildArtifact;
87
+ };
88
+ export declare const normalizeRelativePath: (value: string) => string;
89
+ export declare const buildArtifactPathFor: (appDirectory: string) => string;
90
+ export declare const buildModulePathFor: (appDirectory: string) => string;
91
+ export declare const readBuildIdentity: (appDirectory: string) => Promise<BackendFederationBuildIdentity>;
92
+ export declare const findWorkspaceRoot: (appDirectory: string) => string | undefined;
93
+ export declare const resolveWorkspaceSourceRevision: (workspaceRoot: string) => Promise<string>;
94
+ export declare const createStampedDeliveryUnit: (input: {
95
+ appId: string;
96
+ unitId?: string;
97
+ buildMarker?: string;
98
+ packageName?: string;
99
+ version?: string;
100
+ sourceRevision: string;
101
+ }) => DeliveryUnitContractBlock | undefined;
102
+ export declare const createAppFromCompactMetadata: (workspaceRoot: string, appDirectory: string, compactApp: CompactApp) => BackendFederationApp | undefined;
103
+ export declare const findBackendFederationApp: (workspaceRoot: string, appDirectory: string) => Promise<BackendFederationApp | undefined>;
@@ -0,0 +1,21 @@
1
+ export type { BackendFederationBuildIdentity } from './config.js';
2
+ export type BackendFederationArtifactResult = {
3
+ appId: string;
4
+ manifestPath: string;
5
+ containerPath: string;
6
+ deliveryUnitArtifactPath?: string;
7
+ remoteName: string;
8
+ remoteType: string;
9
+ };
10
+ export declare const emitBackendFederationArtifacts: (appDirectory: string, distDirectory: string) => Promise<BackendFederationArtifactResult | undefined>;
11
+ export default _default;
12
+ declare function _default(): {
13
+ name: string;
14
+ setup(api: {
15
+ getAppContext(): {
16
+ appDirectory: string;
17
+ distDirectory: string;
18
+ };
19
+ onAfterBuild(handler: () => Promise<void>): void;
20
+ }): void;
21
+ };
@@ -0,0 +1,2 @@
1
+ export type { BackendFederationArtifactResult } from './emit.js';
2
+ export { default, emitBackendFederationArtifacts } from './emit.js';
@@ -0,0 +1,22 @@
1
+ import type { URL } from 'node:url';
2
+ import type { Rspack } from '@rsbuild/core';
3
+ /**
4
+ * Reads an environment variable while keeping generated build configs free of
5
+ * direct process access.
6
+ */
7
+ export declare function getBuildConfigEnvironment(name: string): string | undefined;
8
+ /**
9
+ * Runs a Rspack config setup under a leased environment value. The lease is
10
+ * restored when that compiler reaches any supported terminal hook.
11
+ */
12
+ export declare function withBuildConfigEnvironment<Config extends {
13
+ plugins?: Rspack.Plugin[];
14
+ }, SetupArguments extends unknown[]>(name: string, value: string, setup: (config: Config, ...args: SetupArguments) => Config | void | Promise<Config | void>): (config: Config, ...args: SetupArguments) => Promise<Config>;
15
+ export type ResolveEffectTsgoCompilerOptions = {
16
+ /** Module URL or absolute filename used to resolve the consumer's compiler. */
17
+ from: string | URL;
18
+ };
19
+ /**
20
+ * Resolves the Effect TS-Go executable used by Module Federation DTS builds.
21
+ */
22
+ export declare function resolveEffectTsgoCompiler(options: ResolveEffectTsgoCompilerOptions): string;
@@ -0,0 +1,4 @@
1
+ import type { RsbuildPlugin } from '@rsbuild/core';
2
+ import type { PrecompressConfig } from './types.js';
3
+ export type { PrecompressCodecOptions, PrecompressConfig } from './types.js';
4
+ export declare const builderPluginAdapterPrecompress: (precompress: boolean | PrecompressConfig | undefined) => RsbuildPlugin;
@@ -0,0 +1,19 @@
1
+ import type { CompressionPluginOptions } from '../../precompress/index.js';
2
+ export type PrecompressCodecOptions = boolean | Partial<CompressionPluginOptions>;
3
+ export interface PrecompressConfig {
4
+ /**
5
+ * Configure gzip precompression options.
6
+ * `true` means using default options.
7
+ * `false` means disabling gzip precompression.
8
+ * @default true
9
+ */
10
+ gzip?: PrecompressCodecOptions;
11
+ /**
12
+ * Configure brotli precompression options.
13
+ * `true` means using default options.
14
+ * `false` means disabling brotli precompression.
15
+ * @default true
16
+ */
17
+ brotli?: PrecompressCodecOptions;
18
+ }
19
+ export {};
@@ -0,0 +1,2 @@
1
+ export type { ResolveEffectTsgoCompilerOptions } from './build-environment.js';
2
+ export { getBuildConfigEnvironment, resolveEffectTsgoCompiler, withBuildConfigEnvironment, } from './build-environment.js';
@@ -16,7 +16,7 @@ export declare const SERVER_OUTPUT_DIRECTORY = "server";
16
16
  export declare const DEFAULT_SERVER_ONLY_PUBLIC_ASSET_EXCLUDES: readonly ['api', 'shared'];
17
17
  export declare const BFF_EFFECT_WORKER_ENTRY = "worker/__modern_bff_effect.js";
18
18
  export declare const BFF_EFFECT_WORKER_DISPATCHER_EXPORT = "__modern_create_effect_bff_dispatcher";
19
- export declare const EFFECT_BFF_CLOUDFLARE_IMPORT_GUIDANCE = "Ensure the Effect API entry exists at api/index.ts or bff.effect.entry, and import Cloudflare edge handlers from @modern-js/plugin-bff/effect-edge instead of lambda/Hono server helpers.";
19
+ export declare const EFFECT_BFF_CLOUDFLARE_IMPORT_GUIDANCE = "Ensure the Effect API entry exists at api/index.ts or bff.effect.entry, and import Cloudflare edge handlers from @modern-js/bff-effect/effect-edge instead of lambda/Hono server helpers.";
20
20
  export declare const DEFAULT_COMPATIBILITY_DATE = "2026-06-02";
21
21
  export declare const COMPATIBILITY_DATE_PATTERN: RegExp;
22
22
  export declare const REQUIRED_COMPATIBILITY_FLAGS: readonly ["nodejs_compat", "global_fetch_strictly_public"];
@@ -1,4 +1,4 @@
1
- import { type DeliveryUnitIdentity } from '@modern-js/utils/universal';
1
+ import { type DeliveryUnitIdentity } from '@modern-js/backend-federation-contracts';
2
2
  export type DeliveryUnitStamp = DeliveryUnitIdentity & {
3
3
  surfaces: {
4
4
  ui?: DeliveryUnitIdentity & {
@@ -108,8 +108,8 @@ export declare const createWorkerManifest: (outputDirectory: string, modernConfi
108
108
  prefix: string;
109
109
  worker: string;
110
110
  effect: {
111
- openapi?: import("@modern-js/server-core").BffEffectOpenApiUserConfig | undefined;
112
- dataPlatform?: import("@modern-js/server-core").BffEffectDataPlatformUserConfig | undefined;
111
+ openapi?: import("@modern-js/runtime-extensions/server-config").BffEffectOpenApiUserConfig | undefined;
112
+ dataPlatform?: import("@modern-js/runtime-extensions/server-config").BffEffectDataPlatformUserConfig | undefined;
113
113
  crossProjectPolicy: {
114
114
  allowedNamespaces?: string[];
115
115
  verifyProducerIdentity?: (headers: Record<string, unknown>) => string | undefined;
@@ -10,5 +10,6 @@ export declare const CLOUDFLARE_RUNTIME_TYPE = "cloudflare-module-worker";
10
10
  export declare const CLOUDFLARE_OUTPUT_PACKAGE_TYPE = "module";
11
11
  export declare const CLOUDFLARE_WORKER_PACKAGE_TYPE = "commonjs";
12
12
  export declare const CLOUDFLARE_WORKER_BUNDLE_FORMAT = "commonjs";
13
- export declare const CLOUDFLARE_WORKER_NODE_BUILTINS: readonly ['async_hooks', 'buffer', 'crypto', 'events', 'fs/promises', 'module', 'path', 'process', 'stream', 'string_decoder', 'url', 'util'];
13
+ export declare const CLOUDFLARE_WORKER_NODE_BUILTINS: readonly ['assert', 'assert/strict', 'async_hooks', 'buffer', 'child_process', 'crypto', 'dgram', 'dns', 'domain', 'events', 'fs', 'fs/promises', 'http', 'http2', 'inspector', 'module', 'net', 'os', 'path', 'process', 'readline', 'readline/promises', 'repl', 'sqlite', 'stream', 'stream/consumers', 'stream/promises', 'stream/web', 'string_decoder', 'timers', 'timers/promises', 'tls', 'trace_events', 'tty', 'url', 'util', 'util/types', 'v8', 'vm', 'wasi', 'worker_threads', 'zlib'];
14
+ export declare const CLOUDFLARE_WORKER_PLATFORM_MODULES: readonly ['cloudflare:sockets'];
14
15
  export declare const CLOUDFLARE_REQUIRED_COMPATIBILITY_FLAGS: readonly ['nodejs_compat', 'global_fetch_strictly_public'];
@@ -1,4 +1,4 @@
1
- import { type DeliveryUnitIdentity } from '@modern-js/utils/universal';
1
+ import { type DeliveryUnitIdentity } from '@modern-js/backend-federation-contracts';
2
2
  import type { CloudflareOutputVerifierIssue, JsonObject } from './issues.js';
3
3
  export type CloudflareDeliveryUnitIdentity = DeliveryUnitIdentity & {
4
4
  surfaces?: Partial<Record<'api' | 'ui', DeliveryUnitIdentity & {
@@ -1,3 +1,5 @@
1
+ export type { ResolveEffectTsgoCompilerOptions } from './build-config/public.js';
2
+ export { getBuildConfigEnvironment, resolveEffectTsgoCompiler, withBuildConfigEnvironment, } from './build-config/public.js';
1
3
  export type DeployTarget = 'node' | 'vercel' | 'netlify' | 'ghPages' | 'cloudflare';
2
4
  export type CloudflareWorkerSecurityCspMode = 'enforce' | 'report-only' | 'off';
3
5
  export type JsonValue = string | number | boolean | null | JsonValue[] | {
@@ -0,0 +1,14 @@
1
+ export type NpmAlias = {
2
+ aliasName: string;
3
+ targetName: string;
4
+ targetVersion: string;
5
+ };
6
+ export declare function readPackageIdentity(entryPath: string): Promise<{
7
+ name: string;
8
+ version: string;
9
+ }>;
10
+ export declare function preserveNpmAliases({ appDirectory, outputDirectory, implicitAliases, }: {
11
+ appDirectory: string;
12
+ outputDirectory: string;
13
+ implicitAliases?: NpmAlias[];
14
+ }): Promise<void>;
@@ -0,0 +1,15 @@
1
+ import { type DeployOutputConfig } from './target.js';
2
+ export interface DeployOutputPluginApi {
3
+ getAppContext(): {
4
+ appDirectory: string;
5
+ metaName: string;
6
+ };
7
+ getNormalizedConfig(): DeployOutputConfig;
8
+ onAfterDeploy(handler: () => Promise<void>): void;
9
+ }
10
+ export declare const createDeployOutputAliasesPlugin: ({ resolveDeployTarget, }?: {
11
+ resolveDeployTarget?: (config: DeployOutputConfig) => string;
12
+ }) => {
13
+ name: string;
14
+ setup(api: DeployOutputPluginApi): void;
15
+ };
@@ -0,0 +1,6 @@
1
+ export interface DeployOutputConfig {
2
+ deploy?: {
3
+ target?: string;
4
+ };
5
+ }
6
+ export declare const resolveDeployTarget: (config: DeployOutputConfig, envDeployTarget?: string | undefined, detectedProvider?: import("std-env").ProviderName) => string;
@@ -0,0 +1,15 @@
1
+ import type { Rspack, RspackChain } from '@rsbuild/core';
2
+ export declare class UltramodernNativeTypeChecker {
3
+ private readonly options;
4
+ constructor(options: {
5
+ compiler: () => string;
6
+ configFile: string;
7
+ build: boolean;
8
+ });
9
+ check(): Promise<void>;
10
+ private run;
11
+ private watchInputs;
12
+ apply(compiler: Rspack.Compiler): void;
13
+ }
14
+ /** Preserve project-reference emit contracts in the native Effect compiler. */
15
+ export declare function configureUltramodernTypeChecker(chain: RspackChain, pluginId: string, resolveCompiler: (configFile: string) => string): void;
@@ -0,0 +1,20 @@
1
+ Copyright JS Foundation and other contributors
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ 'Software'), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,76 @@
1
+ type BasePluginOptions<T> = {
2
+ /**
3
+ * include all assets that pass test assertion
4
+ */
5
+ test?: Rules | undefined;
6
+ /**
7
+ * include all assets matching any of these conditions
8
+ */
9
+ include?: Rules | undefined;
10
+ /**
11
+ * exclude all assets matching any of these conditions
12
+ */
13
+ exclude?: Rules | undefined;
14
+ /**
15
+ * only assets bigger than this size are processed, in bytes
16
+ */
17
+ threshold?: number | undefined;
18
+ /**
19
+ * only assets that compress better than this ratio are processed (`minRatio = Compressed Size / Original Size`)
20
+ */
21
+ minRatio?: number | undefined;
22
+ /**
23
+ * whether to delete the original assets or not
24
+ */
25
+ deleteOriginalAssets?: DeleteOriginalAssets | undefined;
26
+ /**
27
+ * the target asset filename
28
+ */
29
+ filename?: Filename | undefined;
30
+ };
31
+ type Rules = Rule[] | Rule;
32
+ type Rule = RegExp | string;
33
+ type DeleteOriginalAssets =
34
+ | boolean
35
+ | "keep-source-map"
36
+ | ((name: string) => boolean);
37
+ type Filename = string | ((fileData: PathData) => string);
38
+ type PathData = import('@rsbuild/core').Rspack.PathData;
39
+ type DefinedDefaultAlgorithmAndOptions<T> = T extends ZlibOptions
40
+ ? {
41
+ algorithm?: string | AlgorithmFunction<T> | undefined;
42
+ compressionOptions?: CompressionOptions<T> | undefined;
43
+ }
44
+ : {
45
+ algorithm: string | AlgorithmFunction<T>;
46
+ compressionOptions?: CompressionOptions<T> | undefined;
47
+ };
48
+ type ZlibOptions = import("zlib").ZlibOptions;
49
+ type AlgorithmFunction<T> = (
50
+ input: Buffer,
51
+ options: CompressionOptions<T>,
52
+ callback: (
53
+ error: Error | null | undefined,
54
+ result:
55
+ | WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>
56
+ | Uint8Array
57
+ | ReadonlyArray<number>
58
+ | WithImplicitCoercion<Uint8Array | ReadonlyArray<number> | string>
59
+ | WithImplicitCoercion<string>
60
+ | {
61
+ [Symbol.toPrimitive](hint: "string"): string;
62
+ },
63
+ ) => void,
64
+ ) => any;
65
+ type CompressionOptions<T> = InferDefaultType<T>;
66
+ type InferDefaultType<T> = T extends infer U ? U : CustomOptions;
67
+ type CustomOptions = {
68
+ [key: string]: EXPECTED_ANY;
69
+ };
70
+ type EXPECTED_ANY = any;
71
+ type WithImplicitCoercion<T> =
72
+ | T
73
+ | {
74
+ valueOf(): T;
75
+ };
76
+ export type CompressionPluginOptions = BasePluginOptions<ZlibOptions> & DefinedDefaultAlgorithmAndOptions<ZlibOptions>;