@bleedingdev/modern-js-app-tools-extensions 3.8.3-ultramodern.6 → 3.9.0-ultramodern.10

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 (133) hide show
  1. package/dist/cjs/backend-federation-build/codegen.js +256 -0
  2. package/dist/cjs/backend-federation-build/config.js +189 -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 +7 -16
  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 +193 -0
  19. package/dist/cjs/policy-defaults.js +101 -0
  20. package/dist/cjs/release-envelope/framework-output.js +77 -32
  21. package/dist/cjs/release-envelope/plugin.js +5 -3
  22. package/dist/cjs/release-identity.js +3 -6
  23. package/dist/cjs/runtime-package-resolution.js +118 -0
  24. package/dist/esm/backend-federation-build/codegen.mjs +205 -0
  25. package/dist/esm/backend-federation-build/config.mjs +116 -0
  26. package/dist/esm/backend-federation-build/emit.mjs +99 -0
  27. package/dist/esm/backend-federation-build/index.mjs +1 -0
  28. package/dist/esm/build-config/build-environment.mjs +224 -0
  29. package/dist/esm/build-config/precompress/plugin.mjs +76 -0
  30. package/dist/esm/build-config/precompress/types.mjs +0 -0
  31. package/dist/esm/build-config/public.mjs +1 -0
  32. package/dist/esm/cloudflare/constants.mjs +1 -1
  33. package/dist/esm/cloudflare/delivery-unit.mjs +1 -10
  34. package/dist/esm/cloudflare-output-contract.mjs +35 -2
  35. package/dist/esm/cloudflare-output-verifier/identity.mjs +1 -1
  36. package/dist/esm/cloudflare-output-verifier/worker-bundles.mjs +5 -2
  37. package/dist/esm/config.mjs +1 -0
  38. package/dist/esm/deploy-output/npmAliases.mjs +174 -0
  39. package/dist/esm/deploy-output/plugin.mjs +28 -0
  40. package/dist/esm/deploy-output/target.mjs +10 -0
  41. package/dist/esm/native-type-checker.mjs +142 -0
  42. package/dist/esm/policy-defaults.mjs +45 -0
  43. package/dist/esm/release-envelope/framework-output.mjs +51 -6
  44. package/dist/esm/release-envelope/plugin.mjs +5 -3
  45. package/dist/esm/release-identity.mjs +3 -6
  46. package/dist/esm/runtime-package-resolution.mjs +60 -0
  47. package/dist/esm-node/backend-federation-build/codegen.mjs +206 -0
  48. package/dist/esm-node/backend-federation-build/config.mjs +117 -0
  49. package/dist/esm-node/backend-federation-build/emit.mjs +100 -0
  50. package/dist/esm-node/backend-federation-build/index.mjs +2 -0
  51. package/dist/esm-node/build-config/build-environment.mjs +225 -0
  52. package/dist/esm-node/build-config/precompress/plugin.mjs +77 -0
  53. package/dist/esm-node/build-config/precompress/types.mjs +1 -0
  54. package/dist/esm-node/build-config/public.mjs +2 -0
  55. package/dist/esm-node/cloudflare/constants.mjs +1 -1
  56. package/dist/esm-node/cloudflare/delivery-unit.mjs +1 -10
  57. package/dist/esm-node/cloudflare-output-contract.mjs +35 -2
  58. package/dist/esm-node/cloudflare-output-verifier/identity.mjs +1 -1
  59. package/dist/esm-node/cloudflare-output-verifier/worker-bundles.mjs +5 -2
  60. package/dist/esm-node/config.mjs +1 -0
  61. package/dist/esm-node/deploy-output/npmAliases.mjs +175 -0
  62. package/dist/esm-node/deploy-output/plugin.mjs +31 -0
  63. package/dist/esm-node/deploy-output/target.mjs +11 -0
  64. package/dist/esm-node/native-type-checker.mjs +143 -0
  65. package/dist/esm-node/policy-defaults.mjs +46 -0
  66. package/dist/esm-node/release-envelope/framework-output.mjs +51 -6
  67. package/dist/esm-node/release-envelope/plugin.mjs +5 -3
  68. package/dist/esm-node/release-identity.mjs +3 -6
  69. package/dist/esm-node/runtime-package-resolution.mjs +61 -0
  70. package/dist/types/backend-federation-build/codegen.d.ts +86 -0
  71. package/dist/types/backend-federation-build/config.d.ts +102 -0
  72. package/dist/types/backend-federation-build/emit.d.ts +21 -0
  73. package/dist/types/backend-federation-build/index.d.ts +2 -0
  74. package/dist/types/build-config/build-environment.d.ts +22 -0
  75. package/dist/types/build-config/precompress/plugin.d.ts +4 -0
  76. package/dist/types/build-config/precompress/types.d.ts +19 -0
  77. package/dist/types/build-config/public.d.ts +2 -0
  78. package/dist/types/cloudflare/artifacts.d.ts +1 -1
  79. package/dist/types/cloudflare/constants.d.ts +2 -2
  80. package/dist/types/cloudflare/delivery-unit.d.ts +2 -2
  81. package/dist/types/cloudflare/i18n-worker.d.ts +1 -1
  82. package/dist/types/cloudflare/index.d.ts +1 -1
  83. package/dist/types/cloudflare/security-policies.d.ts +1 -1
  84. package/dist/types/cloudflare/types.d.ts +1 -1
  85. package/dist/types/cloudflare/utils.d.ts +1 -1
  86. package/dist/types/cloudflare/worker-manifest.d.ts +4 -4
  87. package/dist/types/cloudflare/wrangler-config.d.ts +2 -2
  88. package/dist/types/cloudflare-output-contract.d.ts +2 -1
  89. package/dist/types/cloudflare-output-plan.d.ts +1 -1
  90. package/dist/types/cloudflare-output-verifier/identity.d.ts +2 -2
  91. package/dist/types/cloudflare-output-verifier/index.d.ts +5 -5
  92. package/dist/types/cloudflare-output-verifier/manifest.d.ts +1 -1
  93. package/dist/types/cloudflare-output-verifier/mutation-policy.d.ts +1 -1
  94. package/dist/types/cloudflare-output-verifier/worker-bundles.d.ts +1 -1
  95. package/dist/types/config.d.ts +2 -0
  96. package/dist/types/deploy-output/npmAliases.d.ts +14 -0
  97. package/dist/types/deploy-output/plugin.d.ts +15 -0
  98. package/dist/types/deploy-output/target.d.ts +6 -0
  99. package/dist/types/index.d.ts +10 -10
  100. package/dist/types/native-type-checker.d.ts +15 -0
  101. package/dist/types/policy-defaults.d.ts +46 -0
  102. package/dist/types/precompress/LICENSE +20 -0
  103. package/dist/types/precompress/index.d.ts +76 -0
  104. package/dist/types/release-envelope/canonical.d.ts +1 -1
  105. package/dist/types/release-envelope/framework-output.d.ts +3 -2
  106. package/dist/types/release-envelope/index.d.ts +3 -3
  107. package/dist/types/runtime-package-resolution.d.ts +28 -0
  108. package/package.json +72 -14
  109. package/src/backend-federation-build/codegen.ts +245 -0
  110. package/src/backend-federation-build/config.ts +356 -0
  111. package/src/backend-federation-build/emit.ts +202 -0
  112. package/src/backend-federation-build/index.ts +2 -0
  113. package/src/build-config/build-environment.ts +404 -0
  114. package/src/build-config/precompress/plugin.ts +140 -0
  115. package/src/build-config/precompress/types.ts +26 -0
  116. package/src/build-config/public.ts +6 -0
  117. package/src/cloudflare/constants.ts +1 -1
  118. package/src/cloudflare/delivery-unit.ts +3 -20
  119. package/src/cloudflare/worker-manifest.ts +1 -0
  120. package/src/cloudflare-builder.ts +1 -0
  121. package/src/cloudflare-output-contract.ts +37 -0
  122. package/src/cloudflare-output-verifier/identity.ts +1 -1
  123. package/src/cloudflare-output-verifier/worker-bundles.ts +5 -3
  124. package/src/config.ts +7 -0
  125. package/src/deploy-output/npmAliases.ts +333 -0
  126. package/src/deploy-output/plugin.ts +49 -0
  127. package/src/deploy-output/target.ts +23 -0
  128. package/src/native-type-checker.ts +183 -0
  129. package/src/policy-defaults.ts +127 -0
  130. package/src/release-envelope/framework-output.ts +135 -4
  131. package/src/release-envelope/plugin.ts +15 -3
  132. package/src/release-identity.ts +3 -2
  133. package/src/runtime-package-resolution.ts +115 -0
@@ -0,0 +1,2 @@
1
+ export type { ResolveEffectTsgoCompilerOptions } from './build-environment.js';
2
+ export { getBuildConfigEnvironment, resolveEffectTsgoCompiler, withBuildConfigEnvironment, } from './build-environment.js';
@@ -1,4 +1,4 @@
1
- import type { CloudflareModernConfig } from './types';
1
+ import type { CloudflareModernConfig } from './types.js';
2
2
  export declare const getCloudflareArtifacts: (modernConfig: CloudflareModernConfig) => {
3
3
  from: string;
4
4
  to: string;
@@ -1,4 +1,4 @@
1
- import { CLOUDFLARE_RUNTIME_TYPE, CLOUDFLARE_WORKER_BUNDLE_FORMAT } from '../cloudflare-output-contract';
1
+ import { CLOUDFLARE_RUNTIME_TYPE, CLOUDFLARE_WORKER_BUNDLE_FORMAT } from '../cloudflare-output-contract.js';
2
2
  export { CLOUDFLARE_RUNTIME_TYPE, CLOUDFLARE_WORKER_BUNDLE_FORMAT };
3
3
  export declare const WORKER_ENTRY = "server/index.mjs";
4
4
  export declare const WORKER_MANIFEST = "server/modern-worker-manifest.json";
@@ -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 & {
@@ -17,7 +17,7 @@ export type DeliveryUnitStamp = DeliveryUnitIdentity & {
17
17
  export declare const resolveTopologyDeliveryUnit: (appDirectory: string) => Promise<DeliveryUnitStamp | undefined>;
18
18
  /**
19
19
  * Resolve the delivery-unit identity actually bundled into the worker by
20
- * parsing the generated `shared/ultramodern-build.ts` module. This is the
20
+ * reading the generated `shared/ultramodern-build.json` artifact. This is the
21
21
  * worker snapshot / declared surface source that gets stamped into the manifest.
22
22
  */
23
23
  export declare const resolveWorkerDeliveryUnitStamp: (appDirectory: string) => Promise<DeliveryUnitStamp | undefined>;
@@ -1,4 +1,4 @@
1
- import type { CloudflareAppContext } from './types';
1
+ import type { CloudflareAppContext } from './types.js';
2
2
  type WorkerI18nDetection = {
3
3
  order: string[];
4
4
  lookupQuerystring: string;
@@ -1,2 +1,2 @@
1
- import type { CreateCloudflarePreset } from './types';
1
+ import type { CreateCloudflarePreset } from './types.js';
2
2
  export declare const createCloudflarePreset: CreateCloudflarePreset;
@@ -1,4 +1,4 @@
1
- import type { CloudflareModernConfig } from './types';
1
+ import type { CloudflareModernConfig } from './types.js';
2
2
  export declare const createCloudflareWorkerSecurityPolicy: (modernConfig: CloudflareModernConfig) => {
3
3
  enabled: boolean;
4
4
  cors: {
@@ -1,6 +1,6 @@
1
1
  import type { BffUserConfig } from '@modern-js/server-core';
2
2
  import type { ServerPlugin } from '@modern-js/types';
3
- import type { CloudflareDeployConfig } from '../config';
3
+ import type { CloudflareDeployConfig } from '../config.js';
4
4
  export interface CloudflareAppContext {
5
5
  apiOnly: boolean;
6
6
  appDirectory: string;
@@ -1,4 +1,4 @@
1
- import type { JsonValue } from '../config';
1
+ import type { JsonValue } from '../config.js';
2
2
  export declare const isRecord: (value: unknown) => value is Record<string, unknown>;
3
3
  export declare const normalizeRelativePath: (value: unknown, label: string, scope?: string, options?: {
4
4
  allowRoot?: boolean;
@@ -1,5 +1,5 @@
1
- import type { DeliveryUnitStamp } from './delivery-unit';
2
- import type { CloudflareAppContext, CloudflareModernConfig } from './types';
1
+ import type { DeliveryUnitStamp } from './delivery-unit.js';
2
+ import type { CloudflareAppContext, CloudflareModernConfig } from './types.js';
3
3
  export declare const createWorkerManifest: (outputDirectory: string, modernConfig: CloudflareModernConfig, appContext: CloudflareAppContext, deliveryUnitStamp: DeliveryUnitStamp | undefined) => Promise<{
4
4
  version: number;
5
5
  runtime: {
@@ -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;
@@ -1,5 +1,5 @@
1
- import type { JsonValue } from '../config';
2
- import type { CloudflareModernConfig } from './types';
1
+ import type { JsonValue } from '../config.js';
2
+ import type { CloudflareModernConfig } from './types.js';
3
3
  export declare const createWorkerServiceBindings: (modernConfig: CloudflareModernConfig, configuredWranglerServices: JsonValue | undefined) => {
4
4
  binding: string;
5
5
  service: string;
@@ -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 { CLOUDFLARE_ASSETS_BINDING, CLOUDFLARE_OUTPUT_PACKAGE_TYPE, CLOUDFLARE_PUBLIC_ASSETS_DIRECTORY, CLOUDFLARE_REQUIRED_COMPATIBILITY_FLAGS, CLOUDFLARE_WORKER_ENTRY, CLOUDFLARE_WORKER_PACKAGE_TYPE } from './cloudflare-output-contract';
1
+ import { CLOUDFLARE_ASSETS_BINDING, CLOUDFLARE_OUTPUT_PACKAGE_TYPE, CLOUDFLARE_PUBLIC_ASSETS_DIRECTORY, CLOUDFLARE_REQUIRED_COMPATIBILITY_FLAGS, CLOUDFLARE_WORKER_ENTRY, CLOUDFLARE_WORKER_PACKAGE_TYPE } from './cloudflare-output-contract.js';
2
2
  type CloudflareOutputPlan = {
3
3
  outputDirectory: string;
4
4
  requiredFiles: string[];
@@ -1,5 +1,5 @@
1
- import { type DeliveryUnitIdentity } from '@modern-js/utils/universal';
2
- import type { CloudflareOutputVerifierIssue, JsonObject } from './issues';
1
+ import { type DeliveryUnitIdentity } from '@modern-js/backend-federation-contracts';
2
+ import type { CloudflareOutputVerifierIssue, JsonObject } from './issues.js';
3
3
  export type CloudflareDeliveryUnitIdentity = DeliveryUnitIdentity & {
4
4
  surfaces?: Partial<Record<'api' | 'ui', DeliveryUnitIdentity & {
5
5
  surface: 'api' | 'ui';
@@ -1,8 +1,8 @@
1
- import type { CloudflareDeliveryUnitIdentity } from './identity';
2
- import type { CloudflareOutputVerifierResult } from './issues';
3
- export type { CloudflareDeliveryUnitIdentity } from './identity';
4
- export type { CloudflareOutputVerifierIssue, CloudflareOutputVerifierIssueCode, CloudflareOutputVerifierResult, } from './issues';
5
- export { type VerifyCloudflareOutputMutationPolicyOptions, verifyCloudflareOutputMutationPolicy, } from './mutation-policy';
1
+ import type { CloudflareDeliveryUnitIdentity } from './identity.js';
2
+ import type { CloudflareOutputVerifierResult } from './issues.js';
3
+ export type { CloudflareDeliveryUnitIdentity } from './identity.js';
4
+ export type { CloudflareOutputVerifierIssue, CloudflareOutputVerifierIssueCode, CloudflareOutputVerifierResult, } from './issues.js';
5
+ export { type VerifyCloudflareOutputMutationPolicyOptions, verifyCloudflareOutputMutationPolicy, } from './mutation-policy.js';
6
6
  export interface VerifyCloudflareOutputOptions {
7
7
  outputDirectory: string;
8
8
  importWorker?: boolean;
@@ -1,2 +1,2 @@
1
- import type { CloudflareOutputVerifierIssue, JsonObject } from './issues';
1
+ import type { CloudflareOutputVerifierIssue, JsonObject } from './issues.js';
2
2
  export declare const verifyManifestShape: (issues: CloudflareOutputVerifierIssue[], manifest: JsonObject, manifestPath: string) => void;
@@ -1,4 +1,4 @@
1
- import type { CloudflareOutputVerifierResult } from './issues';
1
+ import type { CloudflareOutputVerifierResult } from './issues.js';
2
2
  export interface VerifyCloudflareOutputMutationPolicyOptions {
3
3
  scanRoots: string[];
4
4
  /**
@@ -1,4 +1,4 @@
1
- import type { CloudflareOutputVerifierIssue, JsonObject } from './issues';
1
+ import type { CloudflareOutputVerifierIssue, JsonObject } from './issues.js';
2
2
  interface WorkerBundleReference {
3
3
  dispatcherExport?: string;
4
4
  kind: 'effect-bff' | 'route';
@@ -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;
@@ -1,10 +1,10 @@
1
- export * from './cloudflare';
2
- export * from './cloudflare-builder';
3
- export * from './cloudflare-output-contract';
4
- export * from './cloudflare-output-plan';
5
- export * from './cloudflare-output-verifier';
6
- export * from './config';
7
- export * from './css-extract-runtime-plugin';
8
- export * from './release-envelope';
9
- export * from './release-envelope/plugin';
10
- export * from './release-identity';
1
+ export * from './cloudflare/index.js';
2
+ export * from './cloudflare-builder.js';
3
+ export * from './cloudflare-output-contract.js';
4
+ export * from './cloudflare-output-plan.js';
5
+ export * from './cloudflare-output-verifier/index.js';
6
+ export * from './config.js';
7
+ export * from './css-extract-runtime-plugin.js';
8
+ export * from './release-envelope/index.js';
9
+ export * from './release-envelope/plugin.js';
10
+ export * from './release-identity.js';
@@ -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,46 @@
1
+ /**
2
+ * The fork's renderer policy (head rendering, HTML template assembly and asset
3
+ * ordering) and server policy (localised loaders, error responses, telemetry,
4
+ * module-federation CSS and asset cache headers, static serving) are the
5
+ * default behaviour of an UltraModern.js app.
6
+ *
7
+ * They live in their own packages so they can also be composed explicitly, but
8
+ * a plain `appTools()` app gets them without opting in — that is what this fork
9
+ * has always done. Pass `appTools({ rendererExtensions: false })` or
10
+ * `appTools({ serverExtensions: false })` to run without them.
11
+ */
12
+ export declare const RENDERER_EXTENSIONS_PACKAGE = "@modern-js/runtime-renderer-extensions";
13
+ export declare const RENDERER_EXTENSIONS_PLUGIN_NAME = "rendererHead";
14
+ export declare const SERVER_EXTENSIONS_PLUGIN_NAME = "@modern-js/app-tools/server-plugin";
15
+ export interface PolicyDefaultsOptions {
16
+ /** Default `true`. Set to `false` to drop the fork's renderer policy. */
17
+ rendererExtensions?: boolean;
18
+ /** Default `true`. Set to `false` to drop the fork's server policy. */
19
+ serverExtensions?: boolean;
20
+ }
21
+ /**
22
+ * The subset of the CLI plugin API these defaults use. Typed structurally, and
23
+ * loosely at the hook boundary, so this package stays free of a dependency on
24
+ * the solution that consumes it — which depends on this one.
25
+ */
26
+ export interface PolicyDefaultsPluginApi {
27
+ _internalRuntimePlugins(fn: (input: any) => any): void;
28
+ _internalServerPlugins(fn: (input: any) => any): void;
29
+ modifyResolvedConfig(fn: (config: any) => any): void;
30
+ }
31
+ export declare const POLICY_DEFAULTS_PLUGIN_NAME = "@modern-js/ultramodern-policy-defaults";
32
+ /** Registers the fork's default renderer and server policy. */
33
+ export declare const applyPolicyDefaults: (api: PolicyDefaultsPluginApi, options?: PolicyDefaultsOptions) => void;
34
+ /**
35
+ * The fork defaults as a CLI plugin.
36
+ *
37
+ * The descriptor this registers may land before the ones it wraps — CLI
38
+ * ordering cannot be constrained here without a cycle, because the plugins
39
+ * that emit those descriptors are themselves ordered after `appTools()`.
40
+ * Ordering is settled on the runtime side instead: `rendererHeadPlugin`
41
+ * declares the runtime plugins that run before it.
42
+ */
43
+ export declare const createPolicyDefaultsPlugin: (options?: PolicyDefaultsOptions) => {
44
+ name: string;
45
+ setup(api: PolicyDefaultsPluginApi): void;
46
+ };
@@ -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>;
@@ -1,4 +1,4 @@
1
- import type { MicroVerticalReleaseEnvelope, MicroVerticalReleaseEnvelopePayload } from './types';
1
+ import type { MicroVerticalReleaseEnvelope, MicroVerticalReleaseEnvelopePayload } from './types.js';
2
2
  export declare const releaseEnvelopePayload: (envelope: MicroVerticalReleaseEnvelope) => MicroVerticalReleaseEnvelopePayload;
3
3
  export declare const canonicalSerializeMicroVerticalReleaseEnvelopePayload: (payload: MicroVerticalReleaseEnvelopePayload) => string;
4
4
  export declare const canonicalSerializeMicroVerticalReleaseEnvelope: (envelope: MicroVerticalReleaseEnvelope) => string;
@@ -1,9 +1,10 @@
1
- import type { MicroVerticalReleaseArtifact, MicroVerticalReleaseEnvelope, MicroVerticalReleaseTarget } from './types';
1
+ import type { MicroVerticalReleaseArtifact, MicroVerticalReleaseEnvelope, MicroVerticalReleaseTarget } from './types.js';
2
2
  export declare const MICROVERTICAL_RELEASE_ENVELOPE_PATH = "release/microvertical-release-envelope.json";
3
3
  export declare const MICROVERTICAL_RELEASE_IDENTITY_CARRIERS_PATH = "release/microvertical-release-identity-carriers.json";
4
- export declare const emitFrameworkMicroVerticalReleaseEnvelope: ({ apiOnly, distDirectory, target, }: {
4
+ export declare const emitFrameworkMicroVerticalReleaseEnvelope: ({ apiOnly, distDirectory, requirePromotable, target, }: {
5
5
  apiOnly: boolean;
6
6
  distDirectory: string;
7
+ requirePromotable?: boolean;
7
8
  target: MicroVerticalReleaseTarget;
8
9
  }) => Promise<MicroVerticalReleaseEnvelope | undefined>;
9
10
  export declare const readFrameworkMicroVerticalReleaseEnvelope: ({ artifactRoot, expectedTarget, logicalPathForArtifact, required, }: {
@@ -1,6 +1,6 @@
1
- import { canonicalSerializeMicroVerticalReleaseEnvelope } from './canonical';
2
- import { type CreateMicroVerticalReleaseEnvelopeInput, MICROVERTICAL_RELEASE_ENVELOPE_KIND, MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION, MICROVERTICAL_RELEASE_TARGETS, type MicroVerticalReleaseEnvelope, type VerifyMicroVerticalReleaseEnvelopeOptions } from './types';
3
- export type { CreateMicroVerticalReleaseEnvelopeInput, MicroVerticalReleaseArtifact, MicroVerticalReleaseArtifactInput, MicroVerticalReleaseArtifactInputs, MicroVerticalReleaseEnvelope, MicroVerticalReleaseEnvelopePayload, MicroVerticalReleaseFileArtifact, MicroVerticalReleaseIdentity, MicroVerticalReleaseSurfaces, MicroVerticalReleaseSymbolicLinkArtifact, MicroVerticalReleaseTarget, VerifyMicroVerticalReleaseEnvelopeOptions, } from './types';
1
+ import { canonicalSerializeMicroVerticalReleaseEnvelope } from './canonical.js';
2
+ import { type CreateMicroVerticalReleaseEnvelopeInput, MICROVERTICAL_RELEASE_ENVELOPE_KIND, MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION, MICROVERTICAL_RELEASE_TARGETS, type MicroVerticalReleaseEnvelope, type VerifyMicroVerticalReleaseEnvelopeOptions } from './types.js';
3
+ export type { CreateMicroVerticalReleaseEnvelopeInput, MicroVerticalReleaseArtifact, MicroVerticalReleaseArtifactInput, MicroVerticalReleaseArtifactInputs, MicroVerticalReleaseEnvelope, MicroVerticalReleaseEnvelopePayload, MicroVerticalReleaseFileArtifact, MicroVerticalReleaseIdentity, MicroVerticalReleaseSurfaces, MicroVerticalReleaseSymbolicLinkArtifact, MicroVerticalReleaseTarget, VerifyMicroVerticalReleaseEnvelopeOptions, } from './types.js';
4
4
  export { canonicalSerializeMicroVerticalReleaseEnvelope, MICROVERTICAL_RELEASE_ENVELOPE_KIND, MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION, MICROVERTICAL_RELEASE_TARGETS, };
5
5
  export declare const createMicroVerticalReleaseEnvelope: (input: CreateMicroVerticalReleaseEnvelopeInput) => Promise<MicroVerticalReleaseEnvelope>;
6
6
  export declare const verifyMicroVerticalReleaseEnvelope: (value: unknown, options: VerifyMicroVerticalReleaseEnvelopeOptions) => Promise<MicroVerticalReleaseEnvelope>;
@@ -0,0 +1,28 @@
1
+ import type { RsbuildPlugin } from '@rsbuild/core';
2
+ /**
3
+ * A generated `runtime-register.js` lives inside the *application*, so every
4
+ * runtime plugin it imports has to resolve from the application's own
5
+ * `node_modules`. Packages registered by a CLI plugin are dependencies of that
6
+ * CLI plugin, not of the application, and under an isolated (pnpm) linker the
7
+ * application cannot see them — the build fails with `Module not found`.
8
+ *
9
+ * Instead of freezing a single resolved file (which would lock one export
10
+ * condition and break the web/node split), the registering package contributes
11
+ * the `node_modules` directory that actually hosts the package as a *fallback*
12
+ * module directory. Bare specifiers keep their normal `exports` resolution, the
13
+ * application's own copy still wins when it declares the dependency, and both
14
+ * the workspace source layout and a published pnpm layout work.
15
+ */
16
+ export declare const findHostingModuleDirectory: (packageName: string, fromDirectory: string) => string | undefined;
17
+ /**
18
+ * Collect the fallback module directories for the given packages, starting the
19
+ * search at the module that registers them.
20
+ */
21
+ export declare const collectRuntimePackageModuleDirectories: (packageNames: readonly string[], registrarUrl: string) => string[];
22
+ /**
23
+ * Rsbuild plugin that adds the given directories as fallback module roots for
24
+ * every environment (web, node and worker bundles alike).
25
+ */
26
+ export declare const createRuntimePackageResolutionPlugin: (directories: readonly string[]) => RsbuildPlugin;
27
+ /** `true` when the package resolves from the registering module at all. */
28
+ export declare const canResolveRuntimePackage: (packageName: string, registrarUrl: string) => boolean;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "directory": "packages/solutions/app-tools-extensions"
12
12
  },
13
13
  "license": "MIT",
14
- "version": "3.8.3-ultramodern.6",
14
+ "version": "3.9.0-ultramodern.10",
15
15
  "files": [
16
16
  "dist",
17
17
  "src"
@@ -81,6 +81,41 @@
81
81
  "types": "./dist/types/release-identity.d.ts",
82
82
  "import": "./dist/esm-node/release-identity.mjs",
83
83
  "require": "./dist/cjs/release-identity.js"
84
+ },
85
+ "./native-type-checker": {
86
+ "types": "./dist/types/native-type-checker.d.ts",
87
+ "import": "./dist/esm-node/native-type-checker.mjs",
88
+ "require": "./dist/cjs/native-type-checker.js"
89
+ },
90
+ "./runtime-package-resolution": {
91
+ "types": "./dist/types/runtime-package-resolution.d.ts",
92
+ "import": "./dist/esm-node/runtime-package-resolution.mjs",
93
+ "require": "./dist/cjs/runtime-package-resolution.js"
94
+ },
95
+ "./policy-defaults": {
96
+ "types": "./dist/types/policy-defaults.d.ts",
97
+ "import": "./dist/esm-node/policy-defaults.mjs",
98
+ "require": "./dist/cjs/policy-defaults.js"
99
+ },
100
+ "./build-config/precompress/plugin": {
101
+ "types": "./dist/types/build-config/precompress/plugin.d.ts",
102
+ "import": "./dist/esm-node/build-config/precompress/plugin.mjs",
103
+ "require": "./dist/cjs/build-config/precompress/plugin.js"
104
+ },
105
+ "./backend-federation-build": {
106
+ "types": "./dist/types/backend-federation-build/index.d.ts",
107
+ "import": "./dist/esm-node/backend-federation-build/index.mjs",
108
+ "require": "./dist/cjs/backend-federation-build/index.js"
109
+ },
110
+ "./deploy-output/plugin": {
111
+ "types": "./dist/types/deploy-output/plugin.d.ts",
112
+ "import": "./dist/esm-node/deploy-output/plugin.mjs",
113
+ "require": "./dist/cjs/deploy-output/plugin.js"
114
+ },
115
+ "./deploy-output/target": {
116
+ "types": "./dist/types/deploy-output/target.d.ts",
117
+ "import": "./dist/esm-node/deploy-output/target.mjs",
118
+ "require": "./dist/cjs/deploy-output/target.js"
84
119
  }
85
120
  },
86
121
  "typesVersions": {
@@ -88,6 +123,18 @@
88
123
  "*": [
89
124
  "./dist/types/*",
90
125
  "./src/*"
126
+ ],
127
+ "build-config/precompress/plugin": [
128
+ "./dist/types/build-config/precompress/plugin.d.ts"
129
+ ],
130
+ "backend-federation-build": [
131
+ "./dist/types/backend-federation-build/index.d.ts"
132
+ ],
133
+ "deploy-output/plugin": [
134
+ "./dist/types/deploy-output/plugin.d.ts"
135
+ ],
136
+ "deploy-output/target": [
137
+ "./dist/types/deploy-output/target.d.ts"
91
138
  ]
92
139
  }
93
140
  },
@@ -95,28 +142,38 @@
95
142
  "node": ">=26.7.0"
96
143
  },
97
144
  "dependencies": {
98
- "@babel/parser": "^8.0.0",
99
- "@babel/traverse": "^8.0.0",
145
+ "@babel/parser": "^8.0.4",
146
+ "@babel/traverse": "^8.0.4",
100
147
  "@loadable/component": "5.16.7",
101
- "@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.8.3-ultramodern.6",
102
- "@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.8.3-ultramodern.6",
103
- "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.8.3-ultramodern.6",
104
- "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.8.3-ultramodern.6",
148
+ "@modern-js/backend-federation-contracts": "npm:@bleedingdev/modern-js-backend-federation-contracts@3.9.0-ultramodern.10",
149
+ "@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.9.0-ultramodern.10",
150
+ "@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.9.0-ultramodern.10",
151
+ "@modern-js/runtime-renderer-extensions": "npm:@bleedingdev/modern-js-runtime-renderer-extensions@3.9.0-ultramodern.10",
152
+ "@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.9.0-ultramodern.10",
153
+ "@modern-js/server-runtime-extensions": "npm:@bleedingdev/modern-js-server-runtime-extensions@3.9.0-ultramodern.10",
154
+ "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.9.0-ultramodern.10",
155
+ "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.0-ultramodern.10",
105
156
  "@swc/helpers": "^0.5.23",
157
+ "compression-webpack-plugin": "^12.0.0",
158
+ "esbuild": "^0.28.2",
106
159
  "std-env": "4.2.0"
107
160
  },
108
161
  "peerDependencies": {
109
- "@rsbuild/core": "2.2.0"
162
+ "@rsbuild/core": "2.2.3"
110
163
  },
111
164
  "devDependencies": {
165
+ "@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.9.0-ultramodern.10",
166
+ "@modern-js/plugin-bff-extensions": "npm:@bleedingdev/modern-js-plugin-bff-extensions@3.9.0-ultramodern.10",
112
167
  "@module-federation/runtime-tools": "2.9.0",
113
- "@rsbuild/core": "2.2.0",
114
- "@rslib/core": "0.23.2",
168
+ "@rsbuild/core": "2.2.3",
169
+ "@rslib/core": "1.0.0",
115
170
  "@scripts/rstest-config": "2.66.0",
116
171
  "@types/babel__traverse": "7.28.0",
117
- "@types/node": "^26.2.0",
172
+ "@types/node": "^26.4.1",
118
173
  "@typescript/native-preview": "7.0.0-dev.20260707.2",
119
- "core-js": "^3.49.0"
174
+ "core-js": "^3.50.0",
175
+ "effect": "4.0.0-rc.112",
176
+ "ndepe": "^0.1.13"
120
177
  },
121
178
  "sideEffects": false,
122
179
  "publishConfig": {
@@ -125,7 +182,8 @@
125
182
  "scripts": {
126
183
  "pretest": "pnpm run build",
127
184
  "dev": "rslib build --watch",
128
- "build": "rslib build",
129
- "test": "rstest"
185
+ "build": "rslib build && pnpm run verify:public-surface",
186
+ "test": "rstest",
187
+ "verify:public-surface": "node ./tests/build-config/verify-public-surface.mjs"
130
188
  }
131
189
  }