@bleedingdev/modern-js-app-tools 3.9.0-ultramodern.12 → 3.9.0-ultramodern.13

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 (29) hide show
  1. package/dist/cjs/builder/generator/createCopyPattern.js +2 -1
  2. package/dist/cjs/builder/shared/builderPlugins/adapterHtml.js +2 -1
  3. package/dist/cjs/compat/hooks.js +1 -1
  4. package/dist/cjs/plugins/analyze/getFileSystemEntry.js +1 -1
  5. package/dist/cjs/plugins/analyze/getServerRoutes.js +1 -1
  6. package/dist/cjs/plugins/analyze/utils.js +2 -2
  7. package/dist/cjs/plugins/deploy/platforms/node.js +13 -2
  8. package/dist/cjs/plugins/deploy/utils/index.js +3 -2
  9. package/dist/esm/builder/generator/createCopyPattern.mjs +2 -1
  10. package/dist/esm/builder/shared/builderPlugins/adapterHtml.mjs +2 -1
  11. package/dist/esm/compat/hooks.mjs +1 -1
  12. package/dist/esm/plugins/analyze/getFileSystemEntry.mjs +1 -1
  13. package/dist/esm/plugins/analyze/getServerRoutes.mjs +1 -1
  14. package/dist/esm/plugins/analyze/utils.mjs +2 -2
  15. package/dist/esm/plugins/deploy/platforms/node.mjs +13 -2
  16. package/dist/esm/plugins/deploy/utils/index.mjs +4 -3
  17. package/dist/esm-node/builder/generator/createCopyPattern.mjs +2 -1
  18. package/dist/esm-node/builder/shared/builderPlugins/adapterHtml.mjs +2 -1
  19. package/dist/esm-node/compat/hooks.mjs +1 -1
  20. package/dist/esm-node/plugins/analyze/getFileSystemEntry.mjs +1 -1
  21. package/dist/esm-node/plugins/analyze/getServerRoutes.mjs +1 -1
  22. package/dist/esm-node/plugins/analyze/utils.mjs +2 -2
  23. package/dist/esm-node/plugins/deploy/platforms/node.mjs +13 -2
  24. package/dist/esm-node/plugins/deploy/utils/index.mjs +4 -3
  25. package/dist/types/plugins/deploy/utils/index.d.ts +1 -1
  26. package/docs/configure/app/bff/effect.md +6 -6
  27. package/docs/guides/get-started/quick-start.md +1 -1
  28. package/docs/guides/get-started/ultramodern.md +8 -8
  29. package/package.json +20 -20
@@ -47,7 +47,8 @@ function createPublicPattern(appContext, config, chain) {
47
47
  noErrorOnMissing: true,
48
48
  transform: (content, absoluteFrom)=>{
49
49
  if (!/\.html?$/.test(absoluteFrom)) return content;
50
- return content.toString('utf8').replace(/<%=\s*assetPrefix\s*%>/g, (0, utils_namespaceObject.removeTailSlash)(chain.output.get('publicPath')));
50
+ const publicPath = chain.output.get('publicPath');
51
+ return content.toString('utf8').replace(/<%=\s*assetPrefix\s*%>/g, (0, utils_namespaceObject.removeTailSlash)('string' == typeof publicPath ? publicPath : ''));
51
52
  }
52
53
  };
53
54
  }
@@ -58,7 +58,8 @@ const builderPluginAdapterHtml = (options)=>({
58
58
  async function injectAssetPrefix({ chain }) {
59
59
  const entries = chain.entryPoints.entries() || {};
60
60
  const entryNames = Object.keys(entries);
61
- const assetPrefix = (0, utils_namespaceObject.removeTailSlash)(chain.output.get('publicPath') || '');
61
+ const publicPath = chain.output.get('publicPath');
62
+ const assetPrefix = (0, utils_namespaceObject.removeTailSlash)('string' == typeof publicPath ? publicPath : '');
62
63
  const code = `window.__assetPrefix__ = '${assetPrefix}';`;
63
64
  entryNames.forEach((entryName)=>{
64
65
  entries[entryName].prepend(createVirtualModule(code));
@@ -92,7 +92,7 @@ function handleSetupResult(setupResult, api) {
92
92
  if (newAPI && api[newAPI]) api[newAPI](async (...params)=>{
93
93
  const { isMultiple, params: transformParams } = (0, external_utils_js_namespaceObject.transformHookParams)(key, params);
94
94
  if (isMultiple) return (0, external_utils_js_namespaceObject.transformHookResult)(key, await fn(...transformParams));
95
- return (0, external_utils_js_namespaceObject.transformHookResult)(key, await fn(transformParams));
95
+ else return (0, external_utils_js_namespaceObject.transformHookResult)(key, await fn(transformParams));
96
96
  });
97
97
  }
98
98
  });
@@ -106,7 +106,7 @@ const getFileSystemEntry = async (hooks, appContext, config)=>{
106
106
  }));
107
107
  return scanDir(hooks, dirs);
108
108
  } else throw Error("source.entriesDir accept a directory.");
109
- throw Error(`src dir ${entriesDir} not found.`);
109
+ else throw Error(`src dir ${entriesDir} not found.`);
110
110
  };
111
111
  exports.getFileSystemEntry = __webpack_exports__.getFileSystemEntry;
112
112
  exports.hasEntry = __webpack_exports__.hasEntry;
@@ -70,7 +70,7 @@ const applyRouteOptions = (original, routeOptions)=>{
70
70
  ...original,
71
71
  urlPath: url
72
72
  };
73
- {
73
+ else {
74
74
  const { path: urlPath, ...other } = url;
75
75
  return {
76
76
  ...original,
@@ -58,14 +58,14 @@ const walkDirectory = (dir)=>external_fs_default().readdirSync(dir).reduce((prev
58
58
  ...previous,
59
59
  ...walkDirectory(filePath)
60
60
  ];
61
- return [
61
+ else return [
62
62
  ...previous,
63
63
  filePath
64
64
  ];
65
65
  }, []);
66
66
  const replaceWithAlias = (base, filePath, alias)=>{
67
67
  if (filePath.includes(base)) return (0, utils_namespaceObject.normalizeToPosixPath)(external_path_default().join(alias, external_path_default().relative(base, filePath)));
68
- return filePath;
68
+ else return filePath;
69
69
  };
70
70
  const parseModule = async ({ source, filename })=>{
71
71
  let content = source;
@@ -39,6 +39,7 @@ __webpack_require__.r(__webpack_exports__);
39
39
  __webpack_require__.d(__webpack_exports__, {
40
40
  createNodePreset: ()=>createNodePreset
41
41
  });
42
+ const external_node_module_namespaceObject = require("node:module");
42
43
  const external_node_path_namespaceObject = require("node:path");
43
44
  var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
44
45
  const utils_namespaceObject = require("@modern-js/utils");
@@ -46,7 +47,7 @@ const external_ndepe_namespaceObject = require("ndepe");
46
47
  const index_js_namespaceObject = require("../utils/index.js");
47
48
  const generator_js_namespaceObject = require("../utils/generator.js");
48
49
  const createNodePreset = ({ appContext, modernConfig })=>{
49
- const { appDirectory, distDirectory, moduleType } = appContext;
50
+ const { appDirectory, distDirectory, moduleType, serverPlugins } = appContext;
50
51
  const isEsmProject = 'module' === moduleType;
51
52
  const outputDirectory = external_node_path_default().join(appDirectory, '.output');
52
53
  const staticDirectory = external_node_path_default().join(outputDirectory, 'static');
@@ -77,11 +78,21 @@ const createNodePreset = ({ appContext, modernConfig })=>{
77
78
  const filter = (filePath)=>!filePath.startsWith(staticDirectory) && !filePath.endsWith('.map');
78
79
  const entry = isEsmProject ? await (0, index_js_namespaceObject.resolveESMDependency)('@modern-js/prod-server') : require.resolve('@modern-js/prod-server');
79
80
  if (!entry) throw new Error('Cannot find @modern-js/prod-server');
81
+ const requireFromApp = (0, external_node_module_namespaceObject.createRequire)(external_node_path_default().join(appDirectory, 'package.json'));
82
+ const pluginEntries = new Set();
83
+ for (const plugin of serverPlugins)for (const specifier of plugin.includeEntries ?? []){
84
+ pluginEntries.add(requireFromApp.resolve(specifier));
85
+ if (!isEsmProject) continue;
86
+ const importEntry = await (0, index_js_namespaceObject.resolveESMDependency)(specifier, appDirectory);
87
+ if (!importEntry) throw new Error(`Cannot resolve Node import entry for server plugin ${specifier}`);
88
+ pluginEntries.add(importEntry);
89
+ }
80
90
  await (0, external_ndepe_namespaceObject.nodeDepEmit)({
81
91
  appDir: appDirectory,
82
92
  sourceDir: outputDirectory,
83
93
  includeEntries: [
84
- entry
94
+ entry,
95
+ ...pluginEntries
85
96
  ],
86
97
  copyWholePackage (pkgName) {
87
98
  return '@modern-js/utils' === pkgName;
@@ -72,7 +72,7 @@ const getProjectUsage = (appDirectory, distDirectory, metaName)=>{
72
72
  };
73
73
  const getTemplatePath = (file)=>external_path_default().join(__dirname, '../platforms/templates', file);
74
74
  const readTemplate = async (file)=>(await utils_namespaceObject.fs.readFile(getTemplatePath(file))).toString();
75
- const resolveESMDependency = async (entry)=>{
75
+ const resolveESMDependency = async (entry, fromDirectory)=>{
76
76
  const conditions = new Set([
77
77
  'node',
78
78
  'import',
@@ -82,7 +82,8 @@ const resolveESMDependency = async (entry)=>{
82
82
  try {
83
83
  const resolverPath = (0, external_node_url_namespaceObject.pathToFileURL)((0, external_node_module_namespaceObject.createRequire)(__filename).resolve('import-meta-resolve')).href;
84
84
  const { moduleResolve } = await (0, utils_namespaceObject.dynamicImport)(resolverPath);
85
- return normalizePath(moduleResolve(entry, (0, external_node_url_namespaceObject.pathToFileURL)(`${__dirname}/`), conditions, false).pathname.replace(/^\/(\w):/, '$1:'));
85
+ const resolved = moduleResolve(entry, fromDirectory ? (0, external_node_url_namespaceObject.pathToFileURL)(external_path_default().join(fromDirectory, 'package.json')) : (0, external_node_url_namespaceObject.pathToFileURL)(`${__dirname}/`), conditions, false);
86
+ return normalizePath((0, external_node_url_namespaceObject.fileURLToPath)(resolved));
86
87
  } catch (err) {}
87
88
  };
88
89
  exports.getProjectUsage = __webpack_exports__.getProjectUsage;
@@ -14,7 +14,8 @@ function createPublicPattern(appContext, config, chain) {
14
14
  noErrorOnMissing: true,
15
15
  transform: (content, absoluteFrom)=>{
16
16
  if (!/\.html?$/.test(absoluteFrom)) return content;
17
- return content.toString('utf8').replace(/<%=\s*assetPrefix\s*%>/g, removeTailSlash(chain.output.get('publicPath')));
17
+ const publicPath = chain.output.get('publicPath');
18
+ return content.toString('utf8').replace(/<%=\s*assetPrefix\s*%>/g, removeTailSlash('string' == typeof publicPath ? publicPath : ''));
18
19
  }
19
20
  };
20
21
  }
@@ -26,7 +26,8 @@ const builderPluginAdapterHtml = (options)=>({
26
26
  async function injectAssetPrefix({ chain }) {
27
27
  const entries = chain.entryPoints.entries() || {};
28
28
  const entryNames = Object.keys(entries);
29
- const assetPrefix = removeTailSlash(chain.output.get('publicPath') || '');
29
+ const publicPath = chain.output.get('publicPath');
30
+ const assetPrefix = removeTailSlash('string' == typeof publicPath ? publicPath : '');
30
31
  const code = `window.__assetPrefix__ = '${assetPrefix}';`;
31
32
  entryNames.forEach((entryName)=>{
32
33
  entries[entryName].prepend(createVirtualModule(code));
@@ -59,7 +59,7 @@ function handleSetupResult(setupResult, api) {
59
59
  if (newAPI && api[newAPI]) api[newAPI](async (...params)=>{
60
60
  const { isMultiple, params: transformParams } = transformHookParams(key, params);
61
61
  if (isMultiple) return transformHookResult(key, await fn(...transformParams));
62
- return transformHookResult(key, await fn(transformParams));
62
+ else return transformHookResult(key, await fn(transformParams));
63
63
  });
64
64
  }
65
65
  });
@@ -61,6 +61,6 @@ const getFileSystemEntry = async (hooks, appContext, config)=>{
61
61
  }));
62
62
  return scanDir(hooks, dirs);
63
63
  } else throw Error("source.entriesDir accept a directory.");
64
- throw Error(`src dir ${entriesDir} not found.`);
64
+ else throw Error(`src dir ${entriesDir} not found.`);
65
65
  };
66
66
  export { getFileSystemEntry, hasEntry, hasServerEntry };
@@ -26,7 +26,7 @@ const applyRouteOptions = (original, routeOptions)=>{
26
26
  ...original,
27
27
  urlPath: url
28
28
  };
29
- {
29
+ else {
30
30
  const { path: urlPath, ...other } = url;
31
31
  return {
32
32
  ...original,
@@ -9,14 +9,14 @@ const walkDirectory = (dir)=>fs.readdirSync(dir).reduce((previous, filename)=>{
9
9
  ...previous,
10
10
  ...walkDirectory(filePath)
11
11
  ];
12
- return [
12
+ else return [
13
13
  ...previous,
14
14
  filePath
15
15
  ];
16
16
  }, []);
17
17
  const replaceWithAlias = (base, filePath, alias)=>{
18
18
  if (filePath.includes(base)) return normalizeToPosixPath(path.join(alias, path.relative(base, filePath)));
19
- return filePath;
19
+ else return filePath;
20
20
  };
21
21
  const parseModule = async ({ source, filename })=>{
22
22
  let content = source;
@@ -1,10 +1,11 @@
1
+ import { createRequire } from "node:module";
1
2
  import node_path from "node:path";
2
3
  import { chalk, fs, removeModuleSyncFromExports } from "@modern-js/utils";
3
4
  import { nodeDepEmit } from "ndepe";
4
5
  import { readTemplate, resolveESMDependency } from "../utils/index.mjs";
5
6
  import { generateHandler } from "../utils/generator.mjs";
6
7
  const createNodePreset = ({ appContext, modernConfig })=>{
7
- const { appDirectory, distDirectory, moduleType } = appContext;
8
+ const { appDirectory, distDirectory, moduleType, serverPlugins } = appContext;
8
9
  const isEsmProject = 'module' === moduleType;
9
10
  const outputDirectory = node_path.join(appDirectory, '.output');
10
11
  const staticDirectory = node_path.join(outputDirectory, 'static');
@@ -35,11 +36,21 @@ const createNodePreset = ({ appContext, modernConfig })=>{
35
36
  const filter = (filePath)=>!filePath.startsWith(staticDirectory) && !filePath.endsWith('.map');
36
37
  const entry = isEsmProject ? await resolveESMDependency('@modern-js/prod-server') : require.resolve('@modern-js/prod-server');
37
38
  if (!entry) throw new Error('Cannot find @modern-js/prod-server');
39
+ const requireFromApp = createRequire(node_path.join(appDirectory, 'package.json'));
40
+ const pluginEntries = new Set();
41
+ for (const plugin of serverPlugins)for (const specifier of plugin.includeEntries ?? []){
42
+ pluginEntries.add(requireFromApp.resolve(specifier));
43
+ if (!isEsmProject) continue;
44
+ const importEntry = await resolveESMDependency(specifier, appDirectory);
45
+ if (!importEntry) throw new Error(`Cannot resolve Node import entry for server plugin ${specifier}`);
46
+ pluginEntries.add(importEntry);
47
+ }
38
48
  await nodeDepEmit({
39
49
  appDir: appDirectory,
40
50
  sourceDir: outputDirectory,
41
51
  includeEntries: [
42
- entry
52
+ entry,
53
+ ...pluginEntries
43
54
  ],
44
55
  copyWholePackage (pkgName) {
45
56
  return '@modern-js/utils' === pkgName;
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module";
2
- import { pathToFileURL } from "node:url";
2
+ import { fileURLToPath, pathToFileURL } from "node:url";
3
3
  import { ROUTE_SPEC_FILE, SERVER_DIR, dynamicImport, fs, getMeta } from "@modern-js/utils";
4
4
  import path from "path";
5
5
  const normalizePath = (filePath)=>filePath.replace(/\\/g, '/');
@@ -26,7 +26,7 @@ const getProjectUsage = (appDirectory, distDirectory, metaName)=>{
26
26
  };
27
27
  const getTemplatePath = (file)=>path.join(__dirname, '../platforms/templates', file);
28
28
  const readTemplate = async (file)=>(await fs.readFile(getTemplatePath(file))).toString();
29
- const resolveESMDependency = async (entry)=>{
29
+ const resolveESMDependency = async (entry, fromDirectory)=>{
30
30
  const conditions = new Set([
31
31
  'node',
32
32
  'import',
@@ -36,7 +36,8 @@ const resolveESMDependency = async (entry)=>{
36
36
  try {
37
37
  const resolverPath = pathToFileURL(createRequire(__filename).resolve('import-meta-resolve')).href;
38
38
  const { moduleResolve } = await dynamicImport(resolverPath);
39
- return normalizePath(moduleResolve(entry, pathToFileURL(`${__dirname}/`), conditions, false).pathname.replace(/^\/(\w):/, '$1:'));
39
+ const resolved = moduleResolve(entry, fromDirectory ? pathToFileURL(path.join(fromDirectory, 'package.json')) : pathToFileURL(`${__dirname}/`), conditions, false);
40
+ return normalizePath(fileURLToPath(resolved));
40
41
  } catch (err) {}
41
42
  };
42
43
  export { getProjectUsage, getTemplatePath, normalizePath, readTemplate, resolveESMDependency };
@@ -15,7 +15,8 @@ function createPublicPattern(appContext, config, chain) {
15
15
  noErrorOnMissing: true,
16
16
  transform: (content, absoluteFrom)=>{
17
17
  if (!/\.html?$/.test(absoluteFrom)) return content;
18
- return content.toString('utf8').replace(/<%=\s*assetPrefix\s*%>/g, removeTailSlash(chain.output.get('publicPath')));
18
+ const publicPath = chain.output.get('publicPath');
19
+ return content.toString('utf8').replace(/<%=\s*assetPrefix\s*%>/g, removeTailSlash('string' == typeof publicPath ? publicPath : ''));
19
20
  }
20
21
  };
21
22
  }
@@ -27,7 +27,8 @@ const builderPluginAdapterHtml = (options)=>({
27
27
  async function injectAssetPrefix({ chain }) {
28
28
  const entries = chain.entryPoints.entries() || {};
29
29
  const entryNames = Object.keys(entries);
30
- const assetPrefix = removeTailSlash(chain.output.get('publicPath') || '');
30
+ const publicPath = chain.output.get('publicPath');
31
+ const assetPrefix = removeTailSlash('string' == typeof publicPath ? publicPath : '');
31
32
  const code = `window.__assetPrefix__ = '${assetPrefix}';`;
32
33
  entryNames.forEach((entryName)=>{
33
34
  entries[entryName].prepend(createVirtualModule(code));
@@ -60,7 +60,7 @@ function handleSetupResult(setupResult, api) {
60
60
  if (newAPI && api[newAPI]) api[newAPI](async (...params)=>{
61
61
  const { isMultiple, params: transformParams } = transformHookParams(key, params);
62
62
  if (isMultiple) return transformHookResult(key, await fn(...transformParams));
63
- return transformHookResult(key, await fn(transformParams));
63
+ else return transformHookResult(key, await fn(transformParams));
64
64
  });
65
65
  }
66
66
  });
@@ -62,6 +62,6 @@ const getFileSystemEntry = async (hooks, appContext, config)=>{
62
62
  }));
63
63
  return scanDir(hooks, dirs);
64
64
  } else throw Error("source.entriesDir accept a directory.");
65
- throw Error(`src dir ${entriesDir} not found.`);
65
+ else throw Error(`src dir ${entriesDir} not found.`);
66
66
  };
67
67
  export { getFileSystemEntry, hasEntry, hasServerEntry };
@@ -27,7 +27,7 @@ const applyRouteOptions = (original, routeOptions)=>{
27
27
  ...original,
28
28
  urlPath: url
29
29
  };
30
- {
30
+ else {
31
31
  const { path: urlPath, ...other } = url;
32
32
  return {
33
33
  ...original,
@@ -10,14 +10,14 @@ const walkDirectory = (dir)=>fs.readdirSync(dir).reduce((previous, filename)=>{
10
10
  ...previous,
11
11
  ...walkDirectory(filePath)
12
12
  ];
13
- return [
13
+ else return [
14
14
  ...previous,
15
15
  filePath
16
16
  ];
17
17
  }, []);
18
18
  const replaceWithAlias = (base, filePath, alias)=>{
19
19
  if (filePath.includes(base)) return normalizeToPosixPath(path.join(alias, path.relative(base, filePath)));
20
- return filePath;
20
+ else return filePath;
21
21
  };
22
22
  const parseModule = async ({ source, filename })=>{
23
23
  let content = source;
@@ -1,12 +1,13 @@
1
1
  import __rslib_shim_module__ from "node:module";
2
2
  const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(/*#__PURE__*/ (()=>import.meta.url)());
3
+ import { createRequire } from "node:module";
3
4
  import node_path from "node:path";
4
5
  import { chalk, fs, removeModuleSyncFromExports } from "@modern-js/utils";
5
6
  import { nodeDepEmit } from "ndepe";
6
7
  import { readTemplate, resolveESMDependency } from "../utils/index.mjs";
7
8
  import { generateHandler } from "../utils/generator.mjs";
8
9
  const createNodePreset = ({ appContext, modernConfig })=>{
9
- const { appDirectory, distDirectory, moduleType } = appContext;
10
+ const { appDirectory, distDirectory, moduleType, serverPlugins } = appContext;
10
11
  const isEsmProject = 'module' === moduleType;
11
12
  const outputDirectory = node_path.join(appDirectory, '.output');
12
13
  const staticDirectory = node_path.join(outputDirectory, 'static');
@@ -37,11 +38,21 @@ const createNodePreset = ({ appContext, modernConfig })=>{
37
38
  const filter = (filePath)=>!filePath.startsWith(staticDirectory) && !filePath.endsWith('.map');
38
39
  const entry = isEsmProject ? await resolveESMDependency('@modern-js/prod-server') : require.resolve('@modern-js/prod-server');
39
40
  if (!entry) throw new Error('Cannot find @modern-js/prod-server');
41
+ const requireFromApp = createRequire(node_path.join(appDirectory, 'package.json'));
42
+ const pluginEntries = new Set();
43
+ for (const plugin of serverPlugins)for (const specifier of plugin.includeEntries ?? []){
44
+ pluginEntries.add(requireFromApp.resolve(specifier));
45
+ if (!isEsmProject) continue;
46
+ const importEntry = await resolveESMDependency(specifier, appDirectory);
47
+ if (!importEntry) throw new Error(`Cannot resolve Node import entry for server plugin ${specifier}`);
48
+ pluginEntries.add(importEntry);
49
+ }
40
50
  await nodeDepEmit({
41
51
  appDir: appDirectory,
42
52
  sourceDir: outputDirectory,
43
53
  includeEntries: [
44
- entry
54
+ entry,
55
+ ...pluginEntries
45
56
  ],
46
57
  copyWholePackage (pkgName) {
47
58
  return '@modern-js/utils' === pkgName;
@@ -1,6 +1,6 @@
1
1
  import "node:module";
2
2
  import { createRequire } from "node:module";
3
- import { pathToFileURL } from "node:url";
3
+ import { fileURLToPath, pathToFileURL } from "node:url";
4
4
  import { ROUTE_SPEC_FILE, SERVER_DIR, dynamicImport, fs, getMeta } from "@modern-js/utils";
5
5
  import path from "path";
6
6
  import { fileURLToPath as __rspack_fileURLToPath } from "node:url";
@@ -31,7 +31,7 @@ const getProjectUsage = (appDirectory, distDirectory, metaName)=>{
31
31
  };
32
32
  const getTemplatePath = (file)=>path.join(__rspack_import_meta_dirname__, '../platforms/templates', file);
33
33
  const readTemplate = async (file)=>(await fs.readFile(getTemplatePath(file))).toString();
34
- const resolveESMDependency = async (entry)=>{
34
+ const resolveESMDependency = async (entry, fromDirectory)=>{
35
35
  const conditions = new Set([
36
36
  'node',
37
37
  'import',
@@ -41,7 +41,8 @@ const resolveESMDependency = async (entry)=>{
41
41
  try {
42
42
  const resolverPath = pathToFileURL(createRequire(__rspack_import_meta_filename__).resolve('import-meta-resolve')).href;
43
43
  const { moduleResolve } = await dynamicImport(resolverPath);
44
- return normalizePath(moduleResolve(entry, pathToFileURL(`${__rspack_import_meta_dirname__}/`), conditions, false).pathname.replace(/^\/(\w):/, '$1:'));
44
+ const resolved = moduleResolve(entry, fromDirectory ? pathToFileURL(path.join(fromDirectory, 'package.json')) : pathToFileURL(`${__rspack_import_meta_dirname__}/`), conditions, false);
45
+ return normalizePath(fileURLToPath(resolved));
45
46
  } catch (err) {}
46
47
  };
47
48
  export { getProjectUsage, getTemplatePath, normalizePath, readTemplate, resolveESMDependency };
@@ -13,4 +13,4 @@ export declare const getProjectUsage: (appDirectory: string, distDirectory: stri
13
13
  };
14
14
  export declare const getTemplatePath: (file: string) => string;
15
15
  export declare const readTemplate: (file: string) => Promise<string>;
16
- export declare const resolveESMDependency: (entry: string) => Promise<string | undefined>;
16
+ export declare const resolveESMDependency: (entry: string, fromDirectory?: string) => Promise<string | undefined>;
@@ -51,7 +51,7 @@ the framework use the same Effect instance. Before setting
51
51
  `/effect-edge` or `/effect-client`, install the exact cohort:
52
52
 
53
53
  ```bash
54
- pnpm add effect@4.0.0-rc.112 @effect/opentelemetry@4.0.0-rc.112
54
+ pnpm add effect@4.0.0-rc.117 @effect/opentelemetry@4.0.0-rc.117
55
55
  ```
56
56
 
57
57
  The pin is exact because UltraModern ships Effect as one lockstep cohort. Apps
@@ -228,13 +228,13 @@ generated apps use:
228
228
 
229
229
  ```yaml
230
230
  trustPolicyExclude:
231
- - 'effect@4.0.0-rc.112'
232
- - '@effect/opentelemetry@4.0.0-rc.112'
231
+ - 'effect@4.0.0-rc.117'
232
+ - '@effect/opentelemetry@4.0.0-rc.117'
233
233
 
234
234
  overrides:
235
- '@effect/opentelemetry': 4.0.0-rc.112
236
- '@effect/vitest': 4.0.0-rc.112
237
- effect: 4.0.0-rc.112
235
+ '@effect/opentelemetry': 4.0.0-rc.117
236
+ '@effect/vitest': 4.0.0-rc.117
237
+ effect: 4.0.0-rc.117
238
238
  ```
239
239
 
240
240
  Do not add a different direct `effect` version in an app package. A mismatched
@@ -40,7 +40,7 @@ Additionally, after installing nvm or fnm, when there is a `.nvmrc` file contain
40
40
  It is recommended to use [pnpm](https://pnpm.io/installation) to manage dependencies:
41
41
 
42
42
  ```bash
43
- mise use pnpm@11.24.0
43
+ mise use pnpm@11.27.1
44
44
  ```
45
45
 
46
46
  :::note
@@ -62,8 +62,8 @@ curl -I -H 'Accept-Language: cs-CZ,cs;q=0.9,en;q=0.1' https://<worker-host>/
62
62
  ```
63
63
 
64
64
  Generated strict Effect workspaces pin the compatible Effect cohort with pnpm
65
- overrides: `effect@4.0.0-rc.112`, `@effect/opentelemetry@4.0.0-rc.112`,
66
- and `@effect/vitest@4.0.0-rc.112`. Do not add app-local direct Effect
65
+ overrides: `effect@4.0.0-rc.117`, `@effect/opentelemetry@4.0.0-rc.117`,
66
+ and `@effect/vitest@4.0.0-rc.117`. Do not add app-local direct Effect
67
67
  versions that disagree with those overrides. The strict 24-hour release-age
68
68
  gate applies to installed packages; this cohort carries no Effect age
69
69
  exemption, and override-only `@effect/vitest` is not an installed approval
@@ -75,13 +75,13 @@ metadata transition; they are not release-age approvals.
75
75
 
76
76
  | Surface | Pin |
77
77
  | ------------------------------ | --------------------------------------------------------------------------------------------------- |
78
- | Effect runtime and test cohort | `effect`, `@effect/opentelemetry`, and `@effect/vitest`: `4.0.0-rc.112` |
79
- | Effect compiler | `@effect/tsgo@0.41.0` |
80
- | Oxc and Ultracite | `oxlint@1.81.0`, `oxfmt@0.66.0`, `ultracite@7.11.0` |
81
- | TanStack Router | `@tanstack/react-router@1.170.33`, `@tanstack/router-core@1.171.28`, `@tanstack/history@1.162.2` |
82
- | Module Federation | `bridge-react`, `manifest`, `modern-js-v3`, and `rspack`: `2.9.0`; `@module-federation/node@2.7.50` |
78
+ | Effect runtime and test cohort | `effect`, `@effect/opentelemetry`, and `@effect/vitest`: `4.0.0-rc.117` |
79
+ | Effect compiler | `@effect/tsgo@0.45.0` |
80
+ | Oxc and Ultracite | `oxlint@1.85.0`, `oxfmt@0.70.0`, `ultracite@7.12.0` |
81
+ | TanStack Router | `@tanstack/react-router@1.170.39`, `@tanstack/router-core@1.171.32`, `@tanstack/history@1.162.4` |
82
+ | Module Federation | `bridge-react`, `manifest`, `modern-js-v3`, and `rspack`: `2.9.1`; `@module-federation/node@2.7.51` |
83
83
  | Tailwind CSS | `tailwindcss@4.3.3` |
84
- | Node and package tooling | Node `26.7.0`, `@types/node@^26.4.1`, pnpm `11.24.0` |
84
+ | Node and package tooling | Node `26.7.0`, `@types/node@^26.6.2`, pnpm `11.27.1` |
85
85
 
86
86
  Generated workspaces default to Module Federation bridge-react's router-free
87
87
  base entry (`bridge.enableBridgeRouter: false`), with TanStack Router as the
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "modern",
18
18
  "modern.js"
19
19
  ],
20
- "version": "3.9.0-ultramodern.12",
20
+ "version": "3.9.0-ultramodern.13",
21
21
  "types": "./dist/types/index.d.ts",
22
22
  "main": "./dist/cjs/index.js",
23
23
  "exports": {
@@ -123,23 +123,23 @@
123
123
  }
124
124
  },
125
125
  "dependencies": {
126
- "@babel/parser": "^8.0.4",
127
- "@babel/traverse": "^8.0.4",
128
- "@babel/types": "^8.0.4",
126
+ "@babel/parser": "^8.0.6",
127
+ "@babel/traverse": "^8.0.6",
128
+ "@babel/types": "^8.0.6",
129
129
  "@loadable/component": "5.16.7",
130
- "@modern-js/app-tools-extensions": "npm:@bleedingdev/modern-js-app-tools-extensions@3.9.0-ultramodern.12",
131
- "@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.9.0-ultramodern.12",
132
- "@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.9.0-ultramodern.12",
133
- "@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.9.0-ultramodern.12",
134
- "@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.9.0-ultramodern.12",
135
- "@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.9.0-ultramodern.12",
136
- "@modern-js/server": "npm:@bleedingdev/modern-js-server@3.9.0-ultramodern.12",
137
- "@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.9.0-ultramodern.12",
138
- "@modern-js/server-runtime-extensions": "npm:@bleedingdev/modern-js-server-runtime-extensions@3.9.0-ultramodern.12",
139
- "@modern-js/server-utils": "npm:@bleedingdev/modern-js-server-utils@3.9.0-ultramodern.12",
140
- "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.9.0-ultramodern.12",
141
- "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.0-ultramodern.12",
142
- "@rsbuild/core": "2.2.3",
130
+ "@modern-js/app-tools-extensions": "npm:@bleedingdev/modern-js-app-tools-extensions@3.9.0-ultramodern.13",
131
+ "@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.9.0-ultramodern.13",
132
+ "@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.9.0-ultramodern.13",
133
+ "@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.9.0-ultramodern.13",
134
+ "@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.9.0-ultramodern.13",
135
+ "@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.9.0-ultramodern.13",
136
+ "@modern-js/server": "npm:@bleedingdev/modern-js-server@3.9.0-ultramodern.13",
137
+ "@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.9.0-ultramodern.13",
138
+ "@modern-js/server-runtime-extensions": "npm:@bleedingdev/modern-js-server-runtime-extensions@3.9.0-ultramodern.13",
139
+ "@modern-js/server-utils": "npm:@bleedingdev/modern-js-server-utils@3.9.0-ultramodern.13",
140
+ "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.9.0-ultramodern.13",
141
+ "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.0-ultramodern.13",
142
+ "@rsbuild/core": "2.2.9",
143
143
  "@swc/core": "1.16.2",
144
144
  "@swc/helpers": "^0.5.23",
145
145
  "compression-webpack-plugin": "^12.0.0",
@@ -149,14 +149,14 @@
149
149
  "import-meta-resolve": "^4.2.0",
150
150
  "mlly": "^1.8.2",
151
151
  "ndepe": "^0.1.13",
152
- "pkg-types": "^2.3.2",
152
+ "pkg-types": "^2.3.3",
153
153
  "std-env": "4.2.0"
154
154
  },
155
155
  "devDependencies": {
156
- "@rslib/core": "1.0.0",
156
+ "@rslib/core": "1.0.2",
157
157
  "@scripts/rstest-config": "2.66.0",
158
158
  "@types/babel__traverse": "7.28.0",
159
- "@types/node": "^26.4.1",
159
+ "@types/node": "^26.6.2",
160
160
  "@typescript/native-preview": "7.0.0-dev.20260707.2",
161
161
  "typescript": "^7.0.2"
162
162
  },