@bleedingdev/modern-js-app-tools 3.4.0-ultramodern.1 → 3.4.0-ultramodern.2

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.
@@ -48,12 +48,14 @@ const utils_namespaceObject = require("@modern-js/utils");
48
48
  const BFF_EFFECT_WORKER_ENTRY_NAME = '__modern_bff_effect';
49
49
  const BFF_EFFECT_WORKER_RUNTIME_QUERY = 'modern-bff-runtime';
50
50
  const JS_OR_TS_EXTS = [
51
- '.ts',
52
- '.tsx',
53
51
  '.js',
54
52
  '.jsx',
53
+ '.ts',
54
+ '.tsx',
55
55
  '.mjs',
56
- '.cjs'
56
+ '.mts',
57
+ '.cjs',
58
+ '.cts'
57
59
  ];
58
60
  const CLOUDFLARE_WORKER_NODE_BUILTINS = [
59
61
  'async_hooks',
@@ -73,6 +75,11 @@ const CLOUDFLARE_WORKER_COMPAT_TEMPLATE_DIR = external_node_path_default().resol
73
75
  function findExistingFile(candidates) {
74
76
  return candidates.find((candidate)=>external_node_fs_default().existsSync(candidate));
75
77
  }
78
+ function resolveJsOrTsEntry(entryWithoutOrWithExt) {
79
+ const extension = external_node_path_default().extname(entryWithoutOrWithExt);
80
+ if (JS_OR_TS_EXTS.includes(extension)) return external_node_fs_default().existsSync(entryWithoutOrWithExt) ? entryWithoutOrWithExt : void 0;
81
+ return findExistingFile(JS_OR_TS_EXTS.map((extension)=>`${entryWithoutOrWithExt}${extension}`));
82
+ }
76
83
  function resolvePackageEntry(packageName, paths) {
77
84
  try {
78
85
  return external_node_fs_default().realpathSync(require.resolve(packageName, {
@@ -130,8 +137,8 @@ function getCloudflareWorkerNodeExternals() {
130
137
  function getEffectBffEntry(normalizedConfig, appContext) {
131
138
  if (!normalizedConfig.bff || 'hono' === normalizedConfig.bff.runtimeFramework) return;
132
139
  const configuredEntry = normalizedConfig.bff.effect?.entry;
133
- const entryWithoutExtension = configuredEntry ? external_node_path_default().isAbsolute(configuredEntry) ? configuredEntry : external_node_path_default().resolve(appContext.appDirectory, configuredEntry) : external_node_path_default().resolve(appContext.apiDirectory, 'effect', 'index');
134
- return findExistingFile(JS_OR_TS_EXTS.map((extension)=>`${entryWithoutExtension}${extension}`));
140
+ const entryWithoutOrWithExtension = configuredEntry ? external_node_path_default().isAbsolute(configuredEntry) ? configuredEntry : external_node_path_default().resolve(appContext.appDirectory, configuredEntry) : external_node_path_default().resolve(appContext.apiDirectory, 'effect', 'index');
141
+ return resolveJsOrTsEntry(entryWithoutOrWithExtension);
135
142
  }
136
143
  function isCloudflareWorkerDeploy(normalizedConfig) {
137
144
  return normalizedConfig.deploy?.target === 'cloudflare' || 'cloudflare' === process.env.MODERNJS_DEPLOY;
@@ -30,8 +30,21 @@ var __webpack_require__ = {};
30
30
  })();
31
31
  var __webpack_exports__ = {};
32
32
  __webpack_require__.r(__webpack_exports__);
33
+ let registeredPathHooks;
33
34
  const registerPathsLoader = async ({ appDir, baseUrl, paths })=>{
34
- const { register } = await import("node:module");
35
+ const { register, registerHooks } = await import("node:module");
36
+ if ('function' == typeof registerHooks) {
37
+ const loader = await import("./ts-paths-loader.js");
38
+ await loader.initialize({
39
+ appDir,
40
+ baseUrl,
41
+ paths
42
+ });
43
+ registeredPathHooks ??= registerHooks({
44
+ resolve: loader.resolve
45
+ });
46
+ return registeredPathHooks;
47
+ }
35
48
  register('./ts-paths-loader.mjs', __rslib_import_meta_url__, {
36
49
  data: {
37
50
  appDir,
@@ -1,5 +1,18 @@
1
+ let registeredPathHooks;
1
2
  export const registerPathsLoader = async ({ appDir, baseUrl, paths })=>{
2
- const { register } = await import('node:module');
3
+ const { register, registerHooks } = await import('node:module');
4
+ if ('function' == typeof registerHooks) {
5
+ const loader = await import('./ts-paths-loader.mjs');
6
+ await loader.initialize({
7
+ appDir,
8
+ baseUrl,
9
+ paths
10
+ });
11
+ registeredPathHooks ??= registerHooks({
12
+ resolve: loader.resolve
13
+ });
14
+ return registeredPathHooks;
15
+ }
3
16
  register('./ts-paths-loader.mjs', import.meta.url, {
4
17
  data: {
5
18
  appDir,
@@ -54,6 +54,7 @@ const PUBLIC_ASSETS_DIRECTORY = 'public';
54
54
  const WORKER_BUNDLE_DIRECTORY = 'worker';
55
55
  const SERVER_BUNDLE_DIRECTORY = 'bundles';
56
56
  const BFF_EFFECT_WORKER_ENTRY = `${WORKER_BUNDLE_DIRECTORY}/__modern_bff_effect.js`;
57
+ const EFFECT_BFF_CLOUDFLARE_IMPORT_GUIDANCE = 'Ensure the Effect BFF entry exists at api/effect/index.ts or bff.effect.entry, and import Cloudflare edge handlers from @modern-js/plugin-bff/effect-edge instead of lambda/Hono server helpers.';
57
58
  const DEFAULT_COMPATIBILITY_DATE = '2026-06-02';
58
59
  const COMPATIBILITY_DATE_PATTERN = /^\d{4}-\d{2}-\d{2}$/u;
59
60
  const DEFAULT_SECURITY_HEADERS = {
@@ -247,6 +248,7 @@ const readRouteSpec = async (outputDirectory)=>{
247
248
  routes: Array.isArray(routeSpec.routes) ? routeSpec.routes : []
248
249
  };
249
250
  };
251
+ const createMissingEffectBffWorkerError = (outputDirectory, worker)=>new Error(`Cloudflare Effect BFF is configured, but the BFF worker bundle is missing: ${external_node_path_default().join(outputDirectory, worker)}. ${EFFECT_BFF_CLOUDFLARE_IMPORT_GUIDANCE}`);
250
252
  const createWorkerManifest = async (outputDirectory, modernConfig)=>{
251
253
  const routeSpec = await readRouteSpec(outputDirectory);
252
254
  const routes = await Promise.all(routeSpec.routes.map(async (route)=>{
@@ -264,6 +266,7 @@ const createWorkerManifest = async (outputDirectory, modernConfig)=>{
264
266
  const primaryBffPrefix = Array.isArray(bffPrefix) ? bffPrefix[0] : bffPrefix;
265
267
  const isEffectBff = Boolean(modernConfig.bff) && modernConfig.bff?.runtimeFramework !== 'hono';
266
268
  const effectBffWorkerExists = await utils_namespaceObject.fs.pathExists(external_node_path_default().join(outputDirectory, BFF_EFFECT_WORKER_ENTRY));
269
+ if (isEffectBff && primaryBffPrefix && !effectBffWorkerExists) throw createMissingEffectBffWorkerError(outputDirectory, BFF_EFFECT_WORKER_ENTRY);
267
270
  return {
268
271
  version: 1,
269
272
  runtime: {
@@ -357,9 +360,15 @@ const createCloudflarePreset = ({ appContext, modernConfig })=>{
357
360
  const routeSpecSourcePath = external_node_path_default().join(distDirectory, ROUTE_SPEC_FILE);
358
361
  if (await utils_namespaceObject.fs.pathExists(routeSpecSourcePath)) await utils_namespaceObject.fs.copy(routeSpecSourcePath, routeSpecOutputPath);
359
362
  const workerBundleSourceDirectory = external_node_path_default().join(distDirectory, WORKER_BUNDLE_DIRECTORY);
360
- if (await utils_namespaceObject.fs.pathExists(workerBundleSourceDirectory)) await utils_namespaceObject.fs.copy(workerBundleSourceDirectory, external_node_path_default().join(outputDirectory, WORKER_BUNDLE_DIRECTORY), {
361
- filter: (src)=>shouldCopyToWorkerBundle(src, workerBundleSourceDirectory)
362
- });
363
+ const workerBundleOutputDirectory = external_node_path_default().join(outputDirectory, WORKER_BUNDLE_DIRECTORY);
364
+ if (await utils_namespaceObject.fs.pathExists(workerBundleSourceDirectory)) {
365
+ await utils_namespaceObject.fs.copy(workerBundleSourceDirectory, workerBundleOutputDirectory, {
366
+ filter: (src)=>shouldCopyToWorkerBundle(src, workerBundleSourceDirectory)
367
+ });
368
+ await utils_namespaceObject.fs.writeJSON(external_node_path_default().join(workerBundleOutputDirectory, 'package.json'), {
369
+ type: 'commonjs'
370
+ });
371
+ }
363
372
  await utils_namespaceObject.fs.writeJSON(wranglerConfigPath, {
364
373
  $schema: 'node_modules/wrangler/config-schema.json',
365
374
  name: workerName,
@@ -381,7 +390,7 @@ const createCloudflarePreset = ({ appContext, modernConfig })=>{
381
390
  spaces: 2
382
391
  });
383
392
  await utils_namespaceObject.fs.writeJSON(external_node_path_default().join(outputDirectory, 'package.json'), {
384
- type: 'commonjs'
393
+ type: 'module'
385
394
  });
386
395
  },
387
396
  async genEntry () {
@@ -5,12 +5,14 @@ import { isProd, isSSR, isServiceWorker, isUseRsc, isUseSSRBundle } from "@moder
5
5
  const BFF_EFFECT_WORKER_ENTRY_NAME = '__modern_bff_effect';
6
6
  const BFF_EFFECT_WORKER_RUNTIME_QUERY = 'modern-bff-runtime';
7
7
  const JS_OR_TS_EXTS = [
8
- '.ts',
9
- '.tsx',
10
8
  '.js',
11
9
  '.jsx',
10
+ '.ts',
11
+ '.tsx',
12
12
  '.mjs',
13
- '.cjs'
13
+ '.mts',
14
+ '.cjs',
15
+ '.cts'
14
16
  ];
15
17
  const CLOUDFLARE_WORKER_NODE_BUILTINS = [
16
18
  'async_hooks',
@@ -30,6 +32,11 @@ const CLOUDFLARE_WORKER_COMPAT_TEMPLATE_DIR = node_path.resolve(__dirname, '../.
30
32
  function findExistingFile(candidates) {
31
33
  return candidates.find((candidate)=>node_fs.existsSync(candidate));
32
34
  }
35
+ function resolveJsOrTsEntry(entryWithoutOrWithExt) {
36
+ const extension = node_path.extname(entryWithoutOrWithExt);
37
+ if (JS_OR_TS_EXTS.includes(extension)) return node_fs.existsSync(entryWithoutOrWithExt) ? entryWithoutOrWithExt : void 0;
38
+ return findExistingFile(JS_OR_TS_EXTS.map((extension)=>`${entryWithoutOrWithExt}${extension}`));
39
+ }
33
40
  function resolvePackageEntry(packageName, paths) {
34
41
  try {
35
42
  return node_fs.realpathSync(require.resolve(packageName, {
@@ -87,8 +94,8 @@ function getCloudflareWorkerNodeExternals() {
87
94
  function getEffectBffEntry(normalizedConfig, appContext) {
88
95
  if (!normalizedConfig.bff || 'hono' === normalizedConfig.bff.runtimeFramework) return;
89
96
  const configuredEntry = normalizedConfig.bff.effect?.entry;
90
- const entryWithoutExtension = configuredEntry ? node_path.isAbsolute(configuredEntry) ? configuredEntry : node_path.resolve(appContext.appDirectory, configuredEntry) : node_path.resolve(appContext.apiDirectory, 'effect', 'index');
91
- return findExistingFile(JS_OR_TS_EXTS.map((extension)=>`${entryWithoutExtension}${extension}`));
97
+ const entryWithoutOrWithExtension = configuredEntry ? node_path.isAbsolute(configuredEntry) ? configuredEntry : node_path.resolve(appContext.appDirectory, configuredEntry) : node_path.resolve(appContext.apiDirectory, 'effect', 'index');
98
+ return resolveJsOrTsEntry(entryWithoutOrWithExtension);
92
99
  }
93
100
  function isCloudflareWorkerDeploy(normalizedConfig) {
94
101
  return normalizedConfig.deploy?.target === 'cloudflare' || 'cloudflare' === process.env.MODERNJS_DEPLOY;
@@ -1,5 +1,18 @@
1
+ let registeredPathHooks;
1
2
  const registerPathsLoader = async ({ appDir, baseUrl, paths })=>{
2
- const { register } = await import("node:module");
3
+ const { register, registerHooks } = await import("node:module");
4
+ if ('function' == typeof registerHooks) {
5
+ const loader = await import("./ts-paths-loader.mjs");
6
+ await loader.initialize({
7
+ appDir,
8
+ baseUrl,
9
+ paths
10
+ });
11
+ registeredPathHooks ??= registerHooks({
12
+ resolve: loader.resolve
13
+ });
14
+ return registeredPathHooks;
15
+ }
3
16
  register('./ts-paths-loader.mjs', import.meta.url, {
4
17
  data: {
5
18
  appDir,
@@ -12,6 +12,7 @@ const PUBLIC_ASSETS_DIRECTORY = 'public';
12
12
  const WORKER_BUNDLE_DIRECTORY = 'worker';
13
13
  const SERVER_BUNDLE_DIRECTORY = 'bundles';
14
14
  const BFF_EFFECT_WORKER_ENTRY = `${WORKER_BUNDLE_DIRECTORY}/__modern_bff_effect.js`;
15
+ const EFFECT_BFF_CLOUDFLARE_IMPORT_GUIDANCE = 'Ensure the Effect BFF entry exists at api/effect/index.ts or bff.effect.entry, and import Cloudflare edge handlers from @modern-js/plugin-bff/effect-edge instead of lambda/Hono server helpers.';
15
16
  const DEFAULT_COMPATIBILITY_DATE = '2026-06-02';
16
17
  const COMPATIBILITY_DATE_PATTERN = /^\d{4}-\d{2}-\d{2}$/u;
17
18
  const DEFAULT_SECURITY_HEADERS = {
@@ -205,6 +206,7 @@ const readRouteSpec = async (outputDirectory)=>{
205
206
  routes: Array.isArray(routeSpec.routes) ? routeSpec.routes : []
206
207
  };
207
208
  };
209
+ const createMissingEffectBffWorkerError = (outputDirectory, worker)=>new Error(`Cloudflare Effect BFF is configured, but the BFF worker bundle is missing: ${node_path.join(outputDirectory, worker)}. ${EFFECT_BFF_CLOUDFLARE_IMPORT_GUIDANCE}`);
208
210
  const createWorkerManifest = async (outputDirectory, modernConfig)=>{
209
211
  const routeSpec = await readRouteSpec(outputDirectory);
210
212
  const routes = await Promise.all(routeSpec.routes.map(async (route)=>{
@@ -222,6 +224,7 @@ const createWorkerManifest = async (outputDirectory, modernConfig)=>{
222
224
  const primaryBffPrefix = Array.isArray(bffPrefix) ? bffPrefix[0] : bffPrefix;
223
225
  const isEffectBff = Boolean(modernConfig.bff) && modernConfig.bff?.runtimeFramework !== 'hono';
224
226
  const effectBffWorkerExists = await fs.pathExists(node_path.join(outputDirectory, BFF_EFFECT_WORKER_ENTRY));
227
+ if (isEffectBff && primaryBffPrefix && !effectBffWorkerExists) throw createMissingEffectBffWorkerError(outputDirectory, BFF_EFFECT_WORKER_ENTRY);
225
228
  return {
226
229
  version: 1,
227
230
  runtime: {
@@ -315,9 +318,15 @@ const createCloudflarePreset = ({ appContext, modernConfig })=>{
315
318
  const routeSpecSourcePath = node_path.join(distDirectory, ROUTE_SPEC_FILE);
316
319
  if (await fs.pathExists(routeSpecSourcePath)) await fs.copy(routeSpecSourcePath, routeSpecOutputPath);
317
320
  const workerBundleSourceDirectory = node_path.join(distDirectory, WORKER_BUNDLE_DIRECTORY);
318
- if (await fs.pathExists(workerBundleSourceDirectory)) await fs.copy(workerBundleSourceDirectory, node_path.join(outputDirectory, WORKER_BUNDLE_DIRECTORY), {
319
- filter: (src)=>shouldCopyToWorkerBundle(src, workerBundleSourceDirectory)
320
- });
321
+ const workerBundleOutputDirectory = node_path.join(outputDirectory, WORKER_BUNDLE_DIRECTORY);
322
+ if (await fs.pathExists(workerBundleSourceDirectory)) {
323
+ await fs.copy(workerBundleSourceDirectory, workerBundleOutputDirectory, {
324
+ filter: (src)=>shouldCopyToWorkerBundle(src, workerBundleSourceDirectory)
325
+ });
326
+ await fs.writeJSON(node_path.join(workerBundleOutputDirectory, 'package.json'), {
327
+ type: 'commonjs'
328
+ });
329
+ }
321
330
  await fs.writeJSON(wranglerConfigPath, {
322
331
  $schema: 'node_modules/wrangler/config-schema.json',
323
332
  name: workerName,
@@ -339,7 +348,7 @@ const createCloudflarePreset = ({ appContext, modernConfig })=>{
339
348
  spaces: 2
340
349
  });
341
350
  await fs.writeJSON(node_path.join(outputDirectory, 'package.json'), {
342
- type: 'commonjs'
351
+ type: 'module'
343
352
  });
344
353
  },
345
354
  async genEntry () {
@@ -10,12 +10,14 @@ var getBuilderEnvironments_dirname = __rspack_dirname(__rspack_fileURLToPath(imp
10
10
  const BFF_EFFECT_WORKER_ENTRY_NAME = '__modern_bff_effect';
11
11
  const BFF_EFFECT_WORKER_RUNTIME_QUERY = 'modern-bff-runtime';
12
12
  const JS_OR_TS_EXTS = [
13
- '.ts',
14
- '.tsx',
15
13
  '.js',
16
14
  '.jsx',
15
+ '.ts',
16
+ '.tsx',
17
17
  '.mjs',
18
- '.cjs'
18
+ '.mts',
19
+ '.cjs',
20
+ '.cts'
19
21
  ];
20
22
  const CLOUDFLARE_WORKER_NODE_BUILTINS = [
21
23
  'async_hooks',
@@ -35,6 +37,11 @@ const CLOUDFLARE_WORKER_COMPAT_TEMPLATE_DIR = node_path.resolve(getBuilderEnviro
35
37
  function findExistingFile(candidates) {
36
38
  return candidates.find((candidate)=>node_fs.existsSync(candidate));
37
39
  }
40
+ function resolveJsOrTsEntry(entryWithoutOrWithExt) {
41
+ const extension = node_path.extname(entryWithoutOrWithExt);
42
+ if (JS_OR_TS_EXTS.includes(extension)) return node_fs.existsSync(entryWithoutOrWithExt) ? entryWithoutOrWithExt : void 0;
43
+ return findExistingFile(JS_OR_TS_EXTS.map((extension)=>`${entryWithoutOrWithExt}${extension}`));
44
+ }
38
45
  function resolvePackageEntry(packageName, paths) {
39
46
  try {
40
47
  return node_fs.realpathSync(require.resolve(packageName, {
@@ -92,8 +99,8 @@ function getCloudflareWorkerNodeExternals() {
92
99
  function getEffectBffEntry(normalizedConfig, appContext) {
93
100
  if (!normalizedConfig.bff || 'hono' === normalizedConfig.bff.runtimeFramework) return;
94
101
  const configuredEntry = normalizedConfig.bff.effect?.entry;
95
- const entryWithoutExtension = configuredEntry ? node_path.isAbsolute(configuredEntry) ? configuredEntry : node_path.resolve(appContext.appDirectory, configuredEntry) : node_path.resolve(appContext.apiDirectory, 'effect', 'index');
96
- return findExistingFile(JS_OR_TS_EXTS.map((extension)=>`${entryWithoutExtension}${extension}`));
102
+ const entryWithoutOrWithExtension = configuredEntry ? node_path.isAbsolute(configuredEntry) ? configuredEntry : node_path.resolve(appContext.appDirectory, configuredEntry) : node_path.resolve(appContext.apiDirectory, 'effect', 'index');
103
+ return resolveJsOrTsEntry(entryWithoutOrWithExtension);
97
104
  }
98
105
  function isCloudflareWorkerDeploy(normalizedConfig) {
99
106
  return normalizedConfig.deploy?.target === 'cloudflare' || 'cloudflare' === process.env.MODERNJS_DEPLOY;
@@ -1,6 +1,19 @@
1
1
  import "node:module";
2
+ let registeredPathHooks;
2
3
  const registerPathsLoader = async ({ appDir, baseUrl, paths })=>{
3
- const { register } = await import("node:module");
4
+ const { register, registerHooks } = await import("node:module");
5
+ if ('function' == typeof registerHooks) {
6
+ const loader = await import("./ts-paths-loader.mjs");
7
+ await loader.initialize({
8
+ appDir,
9
+ baseUrl,
10
+ paths
11
+ });
12
+ registeredPathHooks ??= registerHooks({
13
+ resolve: loader.resolve
14
+ });
15
+ return registeredPathHooks;
16
+ }
4
17
  register('./ts-paths-loader.mjs', import.meta.url, {
5
18
  data: {
6
19
  appDir,
@@ -13,6 +13,7 @@ const PUBLIC_ASSETS_DIRECTORY = 'public';
13
13
  const WORKER_BUNDLE_DIRECTORY = 'worker';
14
14
  const SERVER_BUNDLE_DIRECTORY = 'bundles';
15
15
  const BFF_EFFECT_WORKER_ENTRY = `${WORKER_BUNDLE_DIRECTORY}/__modern_bff_effect.js`;
16
+ const EFFECT_BFF_CLOUDFLARE_IMPORT_GUIDANCE = 'Ensure the Effect BFF entry exists at api/effect/index.ts or bff.effect.entry, and import Cloudflare edge handlers from @modern-js/plugin-bff/effect-edge instead of lambda/Hono server helpers.';
16
17
  const DEFAULT_COMPATIBILITY_DATE = '2026-06-02';
17
18
  const COMPATIBILITY_DATE_PATTERN = /^\d{4}-\d{2}-\d{2}$/u;
18
19
  const DEFAULT_SECURITY_HEADERS = {
@@ -206,6 +207,7 @@ const readRouteSpec = async (outputDirectory)=>{
206
207
  routes: Array.isArray(routeSpec.routes) ? routeSpec.routes : []
207
208
  };
208
209
  };
210
+ const createMissingEffectBffWorkerError = (outputDirectory, worker)=>new Error(`Cloudflare Effect BFF is configured, but the BFF worker bundle is missing: ${node_path.join(outputDirectory, worker)}. ${EFFECT_BFF_CLOUDFLARE_IMPORT_GUIDANCE}`);
209
211
  const createWorkerManifest = async (outputDirectory, modernConfig)=>{
210
212
  const routeSpec = await readRouteSpec(outputDirectory);
211
213
  const routes = await Promise.all(routeSpec.routes.map(async (route)=>{
@@ -223,6 +225,7 @@ const createWorkerManifest = async (outputDirectory, modernConfig)=>{
223
225
  const primaryBffPrefix = Array.isArray(bffPrefix) ? bffPrefix[0] : bffPrefix;
224
226
  const isEffectBff = Boolean(modernConfig.bff) && modernConfig.bff?.runtimeFramework !== 'hono';
225
227
  const effectBffWorkerExists = await fs.pathExists(node_path.join(outputDirectory, BFF_EFFECT_WORKER_ENTRY));
228
+ if (isEffectBff && primaryBffPrefix && !effectBffWorkerExists) throw createMissingEffectBffWorkerError(outputDirectory, BFF_EFFECT_WORKER_ENTRY);
226
229
  return {
227
230
  version: 1,
228
231
  runtime: {
@@ -316,9 +319,15 @@ const createCloudflarePreset = ({ appContext, modernConfig })=>{
316
319
  const routeSpecSourcePath = node_path.join(distDirectory, ROUTE_SPEC_FILE);
317
320
  if (await fs.pathExists(routeSpecSourcePath)) await fs.copy(routeSpecSourcePath, routeSpecOutputPath);
318
321
  const workerBundleSourceDirectory = node_path.join(distDirectory, WORKER_BUNDLE_DIRECTORY);
319
- if (await fs.pathExists(workerBundleSourceDirectory)) await fs.copy(workerBundleSourceDirectory, node_path.join(outputDirectory, WORKER_BUNDLE_DIRECTORY), {
320
- filter: (src)=>shouldCopyToWorkerBundle(src, workerBundleSourceDirectory)
321
- });
322
+ const workerBundleOutputDirectory = node_path.join(outputDirectory, WORKER_BUNDLE_DIRECTORY);
323
+ if (await fs.pathExists(workerBundleSourceDirectory)) {
324
+ await fs.copy(workerBundleSourceDirectory, workerBundleOutputDirectory, {
325
+ filter: (src)=>shouldCopyToWorkerBundle(src, workerBundleSourceDirectory)
326
+ });
327
+ await fs.writeJSON(node_path.join(workerBundleOutputDirectory, 'package.json'), {
328
+ type: 'commonjs'
329
+ });
330
+ }
322
331
  await fs.writeJSON(wranglerConfigPath, {
323
332
  $schema: 'node_modules/wrangler/config-schema.json',
324
333
  name: workerName,
@@ -340,7 +349,7 @@ const createCloudflarePreset = ({ appContext, modernConfig })=>{
340
349
  spaces: 2
341
350
  });
342
351
  await fs.writeJSON(node_path.join(outputDirectory, 'package.json'), {
343
- type: 'commonjs'
352
+ type: 'module'
344
353
  });
345
354
  },
346
355
  async genEntry () {
@@ -2,4 +2,4 @@ export declare const registerPathsLoader: ({ appDir, baseUrl, paths }: {
2
2
  appDir: any;
3
3
  baseUrl: any;
4
4
  paths: any;
5
- }) => Promise<void>;
5
+ }) => Promise<any>;
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "modern",
18
18
  "modern.js"
19
19
  ],
20
- "version": "3.4.0-ultramodern.1",
20
+ "version": "3.4.0-ultramodern.2",
21
21
  "types": "./dist/types/index.d.ts",
22
22
  "main": "./dist/cjs/index.js",
23
23
  "exports": {
@@ -86,7 +86,7 @@
86
86
  "@babel/traverse": "^8.0.0",
87
87
  "@babel/types": "^8.0.0",
88
88
  "@loadable/component": "5.16.7",
89
- "@rsbuild/core": "2.0.15",
89
+ "@rsbuild/core": "2.1.0",
90
90
  "@swc/core": "1.15.43",
91
91
  "@swc/helpers": "^0.5.23",
92
92
  "compression-webpack-plugin": "^12.0.0",
@@ -98,21 +98,21 @@
98
98
  "ndepe": "^0.1.13",
99
99
  "pkg-types": "^2.3.1",
100
100
  "std-env": "4.1.0",
101
- "@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.4.0-ultramodern.1",
102
- "@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.4.0-ultramodern.1",
103
- "@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.4.0-ultramodern.1",
104
- "@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.4.0-ultramodern.1",
105
- "@modern-js/server": "npm:@bleedingdev/modern-js-server@3.4.0-ultramodern.1",
106
- "@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.4.0-ultramodern.1",
107
- "@modern-js/server-utils": "npm:@bleedingdev/modern-js-server-utils@3.4.0-ultramodern.1",
108
- "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.4.0-ultramodern.1",
109
- "@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.4.0-ultramodern.1",
110
- "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.4.0-ultramodern.1"
101
+ "@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.4.0-ultramodern.2",
102
+ "@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.4.0-ultramodern.2",
103
+ "@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.4.0-ultramodern.2",
104
+ "@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.4.0-ultramodern.2",
105
+ "@modern-js/server": "npm:@bleedingdev/modern-js-server@3.4.0-ultramodern.2",
106
+ "@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.4.0-ultramodern.2",
107
+ "@modern-js/server-utils": "npm:@bleedingdev/modern-js-server-utils@3.4.0-ultramodern.2",
108
+ "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.4.0-ultramodern.2",
109
+ "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.4.0-ultramodern.2",
110
+ "@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.4.0-ultramodern.2"
111
111
  },
112
112
  "devDependencies": {
113
113
  "@rslib/core": "0.23.0",
114
114
  "@types/babel__traverse": "7.28.0",
115
- "@types/node": "^26.0.0",
115
+ "@types/node": "^26.0.1",
116
116
  "@typescript/native-preview": "7.0.0-dev.20260624.1",
117
117
  "ts-node": "^10.9.2",
118
118
  "tsconfig-paths": "^4.2.0",