@modern-js/utils 2.69.5 → 3.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/cli/alias.js +76 -70
- package/dist/cjs/cli/applyOptionsChain.js +44 -45
- package/dist/cjs/cli/babel.js +100 -119
- package/dist/cjs/cli/commands.js +61 -59
- package/dist/cjs/cli/common.js +45 -37
- package/dist/cjs/cli/config.js +36 -30
- package/dist/cjs/cli/constants.js +124 -161
- package/dist/cjs/cli/ensure.js +52 -45
- package/dist/cjs/cli/fs.js +41 -38
- package/dist/cjs/cli/get/config.js +43 -38
- package/dist/cjs/cli/get/data.js +108 -125
- package/dist/cjs/cli/get/index.js +109 -58
- package/dist/cjs/cli/index.js +202 -63
- package/dist/cjs/cli/is/config.js +75 -71
- package/dist/cjs/cli/is/env.js +49 -37
- package/dist/cjs/cli/is/index.js +76 -25
- package/dist/cjs/cli/is/project.js +139 -135
- package/dist/cjs/cli/is/type.js +65 -49
- package/dist/cjs/cli/logger.js +36 -27
- package/dist/cjs/cli/monorepo.js +100 -96
- package/dist/cjs/cli/package.js +85 -82
- package/dist/cjs/cli/path.js +101 -82
- package/dist/cjs/cli/port.js +71 -74
- package/dist/cjs/cli/prettyInstructions.js +106 -116
- package/dist/cjs/cli/require.js +116 -136
- package/dist/cjs/cli/route.js +67 -77
- package/dist/cjs/cli/runtimeExports.js +16 -70
- package/dist/cjs/cli/version.js +53 -42
- package/dist/cjs/cli/watch.js +79 -72
- package/dist/cjs/compiled.js +199 -128
- package/dist/cjs/import.js +58 -33
- package/dist/cjs/index.js +69 -23
- package/dist/cjs/universal/constants.js +77 -67
- package/dist/cjs/universal/index.js +33 -25
- package/dist/cjs/universal/path.js +33 -27
- package/dist/cjs/universal/pluginDagSort.js +69 -68
- package/dist/compiled/address/index.js +171 -1
- package/dist/compiled/browserslist/index.js +1329 -1
- package/dist/compiled/chalk/index.js +2368 -1
- package/dist/compiled/chokidar/index.js +4138 -16
- package/dist/compiled/chokidar/index.js.LICENSE.txt +41 -0
- package/dist/compiled/commander/index.js +1540 -1
- package/dist/compiled/debug/index.js +621 -1
- package/dist/compiled/dotenv/index.js +101 -1
- package/dist/compiled/dotenv-expand/index.js +54 -1
- package/dist/compiled/execa/index.js +1738 -1
- package/dist/compiled/fast-glob/index.js +4645 -17
- package/dist/compiled/fast-glob/index.js.LICENSE.txt +38 -0
- package/dist/compiled/filesize/index.js +193 -4
- package/dist/compiled/filesize/index.js.LICENSE.txt +7 -0
- package/dist/compiled/fs-extra/index.js +2222 -1
- package/dist/compiled/glob/index.js +2011 -1
- package/dist/compiled/globby/index.js +690 -1
- package/dist/compiled/gzip-size/index.js +157 -1
- package/dist/compiled/import-lazy/index.js +45 -1
- package/dist/compiled/inquirer/index.js +20162 -4
- package/dist/compiled/inquirer/index.js.LICENSE.txt +7 -0
- package/dist/compiled/js-yaml/index.js +2188 -1
- package/dist/compiled/json5/index.js +983 -1
- package/dist/compiled/lodash/index.js +0 -4
- package/dist/compiled/mime-types/index.js +108 -6
- package/dist/compiled/mime-types/index.js.LICENSE.txt +13 -0
- package/dist/compiled/minimist/index.js +202 -1
- package/dist/compiled/nanoid/index.js +83 -1
- package/dist/compiled/ora/index.js +3936 -3
- package/dist/compiled/ora/index.js.LICENSE.txt +1 -0
- package/dist/compiled/pkg-up/index.js +177 -1
- package/dist/compiled/semver/index.js +1779 -1
- package/dist/compiled/signale/index.js +1704 -1
- package/dist/compiled/slash/index.js +32 -1
- package/dist/compiled/strip-ansi/index.js +34 -1
- package/dist/compiled/tsconfig-paths/index.js +629 -1
- package/dist/compiled/upath/index.js +135 -1
- package/dist/compiled/url-join/index.js +61 -1
- package/dist/compiled/webpack-chain/index.js +1475 -1
- package/dist/esm/cli/alias.mjs +31 -0
- package/dist/esm/cli/applyOptionsChain.mjs +16 -0
- package/dist/esm/cli/babel.mjs +76 -0
- package/dist/esm/cli/commands.mjs +23 -0
- package/dist/esm/cli/common.mjs +11 -0
- package/dist/esm/cli/config.mjs +5 -0
- package/dist/esm/cli/constants.mjs +29 -0
- package/dist/esm/cli/ensure.mjs +9 -0
- package/dist/esm/cli/fs.mjs +9 -0
- package/dist/esm/cli/get/config.mjs +14 -0
- package/dist/esm/cli/get/data.mjs +57 -0
- package/dist/esm/cli/get/index.mjs +18 -0
- package/dist/{esm-node/cli/index.js → esm/cli/index.mjs} +0 -1
- package/dist/esm/cli/is/config.mjs +34 -0
- package/dist/esm/cli/is/env.mjs +6 -0
- package/dist/esm/cli/is/project.mjs +104 -0
- package/dist/esm/cli/is/type.mjs +26 -0
- package/dist/esm/cli/logger.mjs +2 -0
- package/dist/esm/cli/monorepo.mjs +50 -0
- package/dist/esm/cli/package.mjs +51 -0
- package/dist/esm/cli/path.mjs +35 -0
- package/dist/esm/cli/port.mjs +35 -0
- package/dist/esm/cli/prettyInstructions.mjs +68 -0
- package/dist/esm/cli/require.mjs +79 -0
- package/dist/esm/cli/route.mjs +36 -0
- package/dist/esm/cli/runtimeExports.mjs +0 -0
- package/dist/esm/cli/version.mjs +21 -0
- package/dist/esm/cli/watch.mjs +40 -0
- package/dist/esm/compiled.mjs +115 -0
- package/dist/esm/import.mjs +25 -0
- package/dist/esm/universal/constants.mjs +13 -0
- package/dist/{esm-node/universal/index.js → esm/universal/index.mjs} +1 -3
- package/dist/esm/universal/path.mjs +2 -0
- package/dist/esm/universal/pluginDagSort.mjs +41 -0
- package/dist/esm-node/cli/alias.mjs +31 -0
- package/dist/esm-node/cli/applyOptionsChain.mjs +16 -0
- package/dist/esm-node/cli/babel.mjs +76 -0
- package/dist/esm-node/cli/commands.mjs +23 -0
- package/dist/esm-node/cli/common.mjs +11 -0
- package/dist/esm-node/cli/config.mjs +5 -0
- package/dist/esm-node/cli/constants.mjs +29 -0
- package/dist/esm-node/cli/ensure.mjs +9 -0
- package/dist/esm-node/cli/fs.mjs +9 -0
- package/dist/esm-node/cli/get/config.mjs +14 -0
- package/dist/esm-node/cli/get/data.mjs +57 -0
- package/dist/esm-node/cli/get/index.mjs +18 -0
- package/dist/esm-node/cli/index.mjs +22 -0
- package/dist/esm-node/cli/is/config.mjs +34 -0
- package/dist/esm-node/cli/is/env.mjs +6 -0
- package/dist/esm-node/cli/is/index.mjs +4 -0
- package/dist/esm-node/cli/is/project.mjs +104 -0
- package/dist/esm-node/cli/is/type.mjs +26 -0
- package/dist/esm-node/cli/logger.mjs +2 -0
- package/dist/esm-node/cli/monorepo.mjs +50 -0
- package/dist/esm-node/cli/package.mjs +51 -0
- package/dist/esm-node/cli/path.mjs +35 -0
- package/dist/esm-node/cli/port.mjs +35 -0
- package/dist/esm-node/cli/prettyInstructions.mjs +68 -0
- package/dist/esm-node/cli/require.mjs +79 -0
- package/dist/esm-node/cli/route.mjs +36 -0
- package/dist/esm-node/cli/runtimeExports.mjs +0 -0
- package/dist/esm-node/cli/version.mjs +21 -0
- package/dist/esm-node/cli/watch.mjs +40 -0
- package/dist/esm-node/compiled.mjs +115 -0
- package/dist/esm-node/import.mjs +25 -0
- package/dist/esm-node/index.mjs +3 -0
- package/dist/esm-node/universal/constants.mjs +13 -0
- package/dist/esm-node/universal/index.mjs +2 -0
- package/dist/esm-node/universal/path.mjs +2 -0
- package/dist/esm-node/universal/pluginDagSort.mjs +41 -0
- package/dist/types/cli/constants.d.ts +2 -26
- package/dist/types/cli/get/data.d.ts +0 -1
- package/dist/types/cli/index.d.ts +0 -1
- package/dist/types/cli/is/config.d.ts +1 -1
- package/dist/types/cli/runtimeExports.d.ts +1 -4
- package/dist/types/cli/watch.d.ts +1 -1
- package/dist/types/compiled.d.ts +0 -5
- package/dist/types/universal/constants.d.ts +4 -7
- package/package.json +27 -27
- package/rslib.config.mts +140 -0
- package/dist/cjs/cli/action.js +0 -55
- package/dist/cjs/universal/formatWebpack.js +0 -127
- package/dist/esm/cli/action.js +0 -68
- package/dist/esm/cli/alias.js +0 -43
- package/dist/esm/cli/applyOptionsChain.js +0 -29
- package/dist/esm/cli/babel.js +0 -122
- package/dist/esm/cli/commands.js +0 -39
- package/dist/esm/cli/common.js +0 -20
- package/dist/esm/cli/config.js +0 -11
- package/dist/esm/cli/constants.js +0 -114
- package/dist/esm/cli/ensure.js +0 -16
- package/dist/esm/cli/fs.js +0 -65
- package/dist/esm/cli/get/config.js +0 -19
- package/dist/esm/cli/get/data.js +0 -143
- package/dist/esm/cli/get/index.js +0 -38
- package/dist/esm/cli/index.js +0 -23
- package/dist/esm/cli/is/config.js +0 -70
- package/dist/esm/cli/is/env.js +0 -22
- package/dist/esm/cli/is/index.js +0 -4
- package/dist/esm/cli/is/project.js +0 -146
- package/dist/esm/cli/is/type.js +0 -39
- package/dist/esm/cli/logger.js +0 -5
- package/dist/esm/cli/monorepo.js +0 -82
- package/dist/esm/cli/package.js +0 -203
- package/dist/esm/cli/path.js +0 -66
- package/dist/esm/cli/port.js +0 -97
- package/dist/esm/cli/prettyInstructions.js +0 -102
- package/dist/esm/cli/require.js +0 -235
- package/dist/esm/cli/route.js +0 -64
- package/dist/esm/cli/runtimeExports.js +0 -44
- package/dist/esm/cli/version.js +0 -26
- package/dist/esm/cli/watch.js +0 -112
- package/dist/esm/compiled.js +0 -66
- package/dist/esm/import.js +0 -11
- package/dist/esm/index.js +0 -3
- package/dist/esm/universal/constants.js +0 -32
- package/dist/esm/universal/formatWebpack.js +0 -95
- package/dist/esm/universal/index.js +0 -4
- package/dist/esm/universal/path.js +0 -6
- package/dist/esm/universal/pluginDagSort.js +0 -73
- package/dist/esm-node/cli/action.js +0 -30
- package/dist/esm-node/cli/alias.js +0 -40
- package/dist/esm-node/cli/applyOptionsChain.js +0 -27
- package/dist/esm-node/cli/babel.js +0 -107
- package/dist/esm-node/cli/commands.js +0 -39
- package/dist/esm-node/cli/common.js +0 -15
- package/dist/esm-node/cli/config.js +0 -9
- package/dist/esm-node/cli/constants.js +0 -114
- package/dist/esm-node/cli/ensure.js +0 -14
- package/dist/esm-node/cli/fs.js +0 -18
- package/dist/esm-node/cli/get/config.js +0 -19
- package/dist/esm-node/cli/get/data.js +0 -96
- package/dist/esm-node/cli/get/index.js +0 -22
- package/dist/esm-node/cli/is/config.js +0 -50
- package/dist/esm-node/cli/is/env.js +0 -12
- package/dist/esm-node/cli/is/project.js +0 -105
- package/dist/esm-node/cli/is/type.js +0 -36
- package/dist/esm-node/cli/logger.js +0 -5
- package/dist/esm-node/cli/monorepo.js +0 -67
- package/dist/esm-node/cli/package.js +0 -66
- package/dist/esm-node/cli/path.js +0 -48
- package/dist/esm-node/cli/port.js +0 -48
- package/dist/esm-node/cli/prettyInstructions.js +0 -90
- package/dist/esm-node/cli/require.js +0 -111
- package/dist/esm-node/cli/route.js +0 -60
- package/dist/esm-node/cli/runtimeExports.js +0 -38
- package/dist/esm-node/cli/version.js +0 -26
- package/dist/esm-node/cli/watch.js +0 -45
- package/dist/esm-node/compiled.js +0 -66
- package/dist/esm-node/import.js +0 -11
- package/dist/esm-node/universal/constants.js +0 -32
- package/dist/esm-node/universal/formatWebpack.js +0 -102
- package/dist/esm-node/universal/path.js +0 -6
- package/dist/esm-node/universal/pluginDagSort.js +0 -50
- package/dist/types/cli/action.d.ts +0 -2
- package/dist/types/universal/formatWebpack.d.ts +0 -26
- /package/dist/{esm-node/cli/is/index.js → esm/cli/is/index.mjs} +0 -0
- /package/dist/{esm-node/index.js → esm/index.mjs} +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { isAbsolute } from "node:path";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
3
|
+
import { findExists } from "./fs.mjs";
|
|
4
|
+
async function compatibleRequire(path, interop = true) {
|
|
5
|
+
if (path.endsWith('.json')) return require(path);
|
|
6
|
+
let requiredModule;
|
|
7
|
+
try {
|
|
8
|
+
requiredModule = require(path);
|
|
9
|
+
} catch (err) {
|
|
10
|
+
if ('ERR_REQUIRE_ESM' === err.code) {
|
|
11
|
+
const modulePath = isAbsolute(path) ? pathToFileURL(path).href : path;
|
|
12
|
+
if ('development' === process.env.NODE_ENV) {
|
|
13
|
+
const timestamp = Date.now();
|
|
14
|
+
requiredModule = await import(`${modulePath}?t=${timestamp}`);
|
|
15
|
+
} else requiredModule = await import(modulePath);
|
|
16
|
+
return interop ? requiredModule.default : requiredModule;
|
|
17
|
+
}
|
|
18
|
+
throw err;
|
|
19
|
+
}
|
|
20
|
+
return interop && requiredModule?.__esModule ? requiredModule.default : requiredModule;
|
|
21
|
+
}
|
|
22
|
+
async function loadFromProject(moduleName, appDir) {
|
|
23
|
+
let requiredModule;
|
|
24
|
+
const paths = [
|
|
25
|
+
appDir,
|
|
26
|
+
process.cwd()
|
|
27
|
+
];
|
|
28
|
+
try {
|
|
29
|
+
{
|
|
30
|
+
const modulePath = require.resolve(moduleName, {
|
|
31
|
+
paths
|
|
32
|
+
});
|
|
33
|
+
requiredModule = require(modulePath);
|
|
34
|
+
}
|
|
35
|
+
return requiredModule.default || requiredModule;
|
|
36
|
+
} catch (error) {
|
|
37
|
+
if ('MODULE_NOT_FOUND' === error.code) throw new Error(`Cannot find module ${moduleName}.`);
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const dynamicImport = new Function('modulePath', 'return import(modulePath)');
|
|
42
|
+
const requireExistModule = async (filename, opt)=>{
|
|
43
|
+
const final = {
|
|
44
|
+
extensions: [
|
|
45
|
+
'.ts',
|
|
46
|
+
'.js'
|
|
47
|
+
],
|
|
48
|
+
interop: true,
|
|
49
|
+
...opt
|
|
50
|
+
};
|
|
51
|
+
const exist = findExists(final.extensions.map((ext)=>`${filename}${ext}`));
|
|
52
|
+
if (!exist) return null;
|
|
53
|
+
return compatibleRequire(exist, final.interop);
|
|
54
|
+
};
|
|
55
|
+
const cleanRequireCache = (filelist)=>{
|
|
56
|
+
filelist.forEach((filepath)=>{
|
|
57
|
+
if (require.cache) delete require.cache[filepath];
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
function deleteRequireCache(path) {
|
|
61
|
+
if (require.cache[path]) delete require.cache[path];
|
|
62
|
+
if (module.children) module.children = module.children.filter((item)=>item.filename !== path);
|
|
63
|
+
}
|
|
64
|
+
const tryResolve = (name, resolvePath)=>{
|
|
65
|
+
let filePath = '';
|
|
66
|
+
try {
|
|
67
|
+
filePath = require.resolve(name, {
|
|
68
|
+
paths: [
|
|
69
|
+
resolvePath
|
|
70
|
+
]
|
|
71
|
+
});
|
|
72
|
+
delete require.cache[filePath];
|
|
73
|
+
} catch (err) {
|
|
74
|
+
if ('MODULE_NOT_FOUND' === err.code) throw new Error(`Can not find module ${name}.`);
|
|
75
|
+
throw err;
|
|
76
|
+
}
|
|
77
|
+
return filePath;
|
|
78
|
+
};
|
|
79
|
+
export { cleanRequireCache, compatibleRequire, deleteRequireCache, dynamicImport, loadFromProject, requireExistModule, tryResolve };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { lodash } from "../compiled.mjs";
|
|
2
|
+
const { cloneDeep } = lodash;
|
|
3
|
+
function filterRoutesForServer(routes) {
|
|
4
|
+
const clonedRoutes = cloneDeep(routes);
|
|
5
|
+
const newRoutes = clonedRoutes.map((route)=>{
|
|
6
|
+
if ('nested' !== route.type) return route;
|
|
7
|
+
if (route.children && route.children.length > 0) route.children = filterRoutesForServer(route.children);
|
|
8
|
+
if (route.inValidSSRRoute) return null;
|
|
9
|
+
return route;
|
|
10
|
+
}).filter((route)=>null !== route);
|
|
11
|
+
return newRoutes;
|
|
12
|
+
}
|
|
13
|
+
function filterRoutesLoader(routes) {
|
|
14
|
+
const clonedRoutes = cloneDeep(routes);
|
|
15
|
+
const newRoutes = clonedRoutes.map((route)=>{
|
|
16
|
+
if ('nested' !== route.type) return route;
|
|
17
|
+
if (route.children && route.children.length > 0) route.children = filterRoutesLoader(route.children);
|
|
18
|
+
if (route.inValidSSRRoute) {
|
|
19
|
+
delete route.loader;
|
|
20
|
+
delete route.data;
|
|
21
|
+
delete route.action;
|
|
22
|
+
}
|
|
23
|
+
return route;
|
|
24
|
+
}).filter((route)=>null !== route);
|
|
25
|
+
return newRoutes;
|
|
26
|
+
}
|
|
27
|
+
function markRoutes(routes, routeIds) {
|
|
28
|
+
return routes.map((route)=>{
|
|
29
|
+
if ('nested' !== route.type) return route;
|
|
30
|
+
if (route.children && route.children.length > 0) route.children = markRoutes(route.children, routeIds);
|
|
31
|
+
if (route.children && route.children.length > 0) route.inValidSSRRoute = route.children.every((child)=>child.inValidSSRRoute ?? false);
|
|
32
|
+
else if (route.id) route.inValidSSRRoute = !routeIds.includes(route.id);
|
|
33
|
+
return route;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
export { filterRoutesForServer, filterRoutesLoader, markRoutes };
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function isVersionAtLeast1819() {
|
|
2
|
+
const nodeVersion = process.versions.node;
|
|
3
|
+
const versionArr = nodeVersion.split('.').map(Number);
|
|
4
|
+
return versionArr[0] > 18 || 18 === versionArr[0] && versionArr[1] >= 19;
|
|
5
|
+
}
|
|
6
|
+
function isVersionAtLeast18() {
|
|
7
|
+
const nodeVersion = process.versions.node;
|
|
8
|
+
const versionArr = nodeVersion.split('.').map(Number);
|
|
9
|
+
return versionArr[0] >= 18;
|
|
10
|
+
}
|
|
11
|
+
function isVersionAtLeast22() {
|
|
12
|
+
const nodeVersion = process.versions.node;
|
|
13
|
+
const versionArr = nodeVersion.split('.').map(Number);
|
|
14
|
+
return versionArr[0] >= 22;
|
|
15
|
+
}
|
|
16
|
+
function isVersionAtLeast20() {
|
|
17
|
+
const nodeVersion = process.versions.node;
|
|
18
|
+
const versionArr = nodeVersion.split('.').map(Number);
|
|
19
|
+
return versionArr[0] >= 20;
|
|
20
|
+
}
|
|
21
|
+
export { isVersionAtLeast18, isVersionAtLeast1819, isVersionAtLeast20, isVersionAtLeast22 };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import { chokidar } from "../compiled.mjs";
|
|
3
|
+
const WatchChangeType = {
|
|
4
|
+
ADD: 'add',
|
|
5
|
+
UNLINK: 'unlink',
|
|
6
|
+
CHANGE: 'change'
|
|
7
|
+
};
|
|
8
|
+
const watch = (watchDir, runTask, ignored = [])=>{
|
|
9
|
+
let ready = false;
|
|
10
|
+
const watcher = chokidar.watch(watchDir, {
|
|
11
|
+
ignored
|
|
12
|
+
});
|
|
13
|
+
watcher.on('ready', ()=>ready = true);
|
|
14
|
+
watcher.on('change', async (filePath)=>{
|
|
15
|
+
const changedFilePath = path.resolve(filePath);
|
|
16
|
+
await runTask({
|
|
17
|
+
changedFilePath,
|
|
18
|
+
changeType: WatchChangeType.CHANGE
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
watcher.on('add', async (filePath)=>{
|
|
22
|
+
const changedFilePath = path.resolve(filePath);
|
|
23
|
+
if (ready) await runTask({
|
|
24
|
+
changedFilePath,
|
|
25
|
+
changeType: WatchChangeType.ADD
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
watcher.on('unlink', async (filePath)=>{
|
|
29
|
+
const changedFilePath = path.resolve(filePath);
|
|
30
|
+
await runTask({
|
|
31
|
+
changedFilePath,
|
|
32
|
+
changeType: WatchChangeType.UNLINK
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
watcher.on('error', (err)=>{
|
|
36
|
+
throw err;
|
|
37
|
+
});
|
|
38
|
+
return watcher;
|
|
39
|
+
};
|
|
40
|
+
export { WatchChangeType, watch };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { Import } from "./import.mjs";
|
|
3
|
+
import { createRequire as __rspack_createRequire } from "node:module";
|
|
4
|
+
const __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
|
|
5
|
+
var __webpack_require__ = {};
|
|
6
|
+
(()=>{
|
|
7
|
+
__webpack_require__.n = (module)=>{
|
|
8
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
9
|
+
__webpack_require__.d(getter, {
|
|
10
|
+
a: getter
|
|
11
|
+
});
|
|
12
|
+
return getter;
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.d = (exports, definition)=>{
|
|
17
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: definition[key]
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
})();
|
|
23
|
+
(()=>{
|
|
24
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
25
|
+
})();
|
|
26
|
+
const index_js_namespaceObject = __rspack_createRequire_require("../compiled/fs-extra/index.js");
|
|
27
|
+
var index_js_default = /*#__PURE__*/ __webpack_require__.n(index_js_namespaceObject);
|
|
28
|
+
const ora_index_js_namespaceObject = __rspack_createRequire_require("../compiled/ora/index.js");
|
|
29
|
+
var ora_index_js_default = /*#__PURE__*/ __webpack_require__.n(ora_index_js_namespaceObject);
|
|
30
|
+
const glob_index_js_namespaceObject = __rspack_createRequire_require("../compiled/glob/index.js");
|
|
31
|
+
var glob_index_js_default = /*#__PURE__*/ __webpack_require__.n(glob_index_js_namespaceObject);
|
|
32
|
+
const js_yaml_index_js_namespaceObject = __rspack_createRequire_require("../compiled/js-yaml/index.js");
|
|
33
|
+
var js_yaml_index_js_default = /*#__PURE__*/ __webpack_require__.n(js_yaml_index_js_namespaceObject);
|
|
34
|
+
const chalk_index_js_namespaceObject = __rspack_createRequire_require("../compiled/chalk/index.js");
|
|
35
|
+
var chalk_index_js_default = /*#__PURE__*/ __webpack_require__.n(chalk_index_js_namespaceObject);
|
|
36
|
+
const debug_index_js_namespaceObject = __rspack_createRequire_require("../compiled/debug/index.js");
|
|
37
|
+
var debug_index_js_default = /*#__PURE__*/ __webpack_require__.n(debug_index_js_namespaceObject);
|
|
38
|
+
const slash_index_js_namespaceObject = __rspack_createRequire_require("../compiled/slash/index.js");
|
|
39
|
+
var slash_index_js_default = /*#__PURE__*/ __webpack_require__.n(slash_index_js_namespaceObject);
|
|
40
|
+
const execa_index_js_namespaceObject = __rspack_createRequire_require("../compiled/execa/index.js");
|
|
41
|
+
var execa_index_js_default = /*#__PURE__*/ __webpack_require__.n(execa_index_js_namespaceObject);
|
|
42
|
+
const json5_index_js_namespaceObject = __rspack_createRequire_require("../compiled/json5/index.js");
|
|
43
|
+
var json5_index_js_default = /*#__PURE__*/ __webpack_require__.n(json5_index_js_namespaceObject);
|
|
44
|
+
const upath_index_js_namespaceObject = __rspack_createRequire_require("../compiled/upath/index.js");
|
|
45
|
+
var upath_index_js_default = /*#__PURE__*/ __webpack_require__.n(upath_index_js_namespaceObject);
|
|
46
|
+
const pkg_up_index_js_namespaceObject = __rspack_createRequire_require("../compiled/pkg-up/index.js");
|
|
47
|
+
var pkg_up_index_js_default = /*#__PURE__*/ __webpack_require__.n(pkg_up_index_js_namespaceObject);
|
|
48
|
+
const nanoid_index_js_namespaceObject = __rspack_createRequire_require("../compiled/nanoid/index.js");
|
|
49
|
+
const semver_index_js_namespaceObject = __rspack_createRequire_require("../compiled/semver/index.js");
|
|
50
|
+
var semver_index_js_default = /*#__PURE__*/ __webpack_require__.n(semver_index_js_namespaceObject);
|
|
51
|
+
const dotenv_index_js_namespaceObject = __rspack_createRequire_require("../compiled/dotenv/index.js");
|
|
52
|
+
var dotenv_index_js_default = /*#__PURE__*/ __webpack_require__.n(dotenv_index_js_namespaceObject);
|
|
53
|
+
const lodash_index_js_namespaceObject = __rspack_createRequire_require("../compiled/lodash/index.js");
|
|
54
|
+
var lodash_index_js_default = /*#__PURE__*/ __webpack_require__.n(lodash_index_js_namespaceObject);
|
|
55
|
+
const globby_index_js_namespaceObject = __rspack_createRequire_require("../compiled/globby/index.js");
|
|
56
|
+
var globby_index_js_default = /*#__PURE__*/ __webpack_require__.n(globby_index_js_namespaceObject);
|
|
57
|
+
const address_index_js_namespaceObject = __rspack_createRequire_require("../compiled/address/index.js");
|
|
58
|
+
var address_index_js_default = /*#__PURE__*/ __webpack_require__.n(address_index_js_namespaceObject);
|
|
59
|
+
const signale_index_js_namespaceObject = __rspack_createRequire_require("../compiled/signale/index.js");
|
|
60
|
+
var signale_index_js_default = /*#__PURE__*/ __webpack_require__.n(signale_index_js_namespaceObject);
|
|
61
|
+
const url_join_index_js_namespaceObject = __rspack_createRequire_require("../compiled/url-join/index.js");
|
|
62
|
+
var url_join_index_js_default = /*#__PURE__*/ __webpack_require__.n(url_join_index_js_namespaceObject);
|
|
63
|
+
const minimist_index_js_namespaceObject = __rspack_createRequire_require("../compiled/minimist/index.js");
|
|
64
|
+
var minimist_index_js_default = /*#__PURE__*/ __webpack_require__.n(minimist_index_js_namespaceObject);
|
|
65
|
+
const fast_glob_index_js_namespaceObject = __rspack_createRequire_require("../compiled/fast-glob/index.js");
|
|
66
|
+
var fast_glob_index_js_default = /*#__PURE__*/ __webpack_require__.n(fast_glob_index_js_namespaceObject);
|
|
67
|
+
const filesize_index_js_namespaceObject = __rspack_createRequire_require("../compiled/filesize/index.js");
|
|
68
|
+
var filesize_index_js_default = /*#__PURE__*/ __webpack_require__.n(filesize_index_js_namespaceObject);
|
|
69
|
+
const gzip_size_index_js_namespaceObject = __rspack_createRequire_require("../compiled/gzip-size/index.js");
|
|
70
|
+
var gzip_size_index_js_default = /*#__PURE__*/ __webpack_require__.n(gzip_size_index_js_namespaceObject);
|
|
71
|
+
const strip_ansi_index_js_namespaceObject = __rspack_createRequire_require("../compiled/strip-ansi/index.js");
|
|
72
|
+
var strip_ansi_index_js_default = /*#__PURE__*/ __webpack_require__.n(strip_ansi_index_js_namespaceObject);
|
|
73
|
+
const dotenv_expand_index_js_namespaceObject = __rspack_createRequire_require("../compiled/dotenv-expand/index.js");
|
|
74
|
+
var dotenv_expand_index_js_default = /*#__PURE__*/ __webpack_require__.n(dotenv_expand_index_js_namespaceObject);
|
|
75
|
+
const browserslist_index_js_namespaceObject = __rspack_createRequire_require("../compiled/browserslist/index.js");
|
|
76
|
+
var browserslist_index_js_default = /*#__PURE__*/ __webpack_require__.n(browserslist_index_js_namespaceObject);
|
|
77
|
+
const commander_index_js_namespaceObject = __rspack_createRequire_require("../compiled/commander/index.js");
|
|
78
|
+
const nodeRequire = (()=>{
|
|
79
|
+
const gRequire = globalThis.require;
|
|
80
|
+
if ('function' == typeof gRequire) return gRequire;
|
|
81
|
+
return createRequire(import.meta.url);
|
|
82
|
+
})();
|
|
83
|
+
const mime = Import.lazy('../compiled/mime-types', nodeRequire);
|
|
84
|
+
const chokidar = Import.lazy('../compiled/chokidar', nodeRequire);
|
|
85
|
+
const inquirer = Import.lazy('../compiled/inquirer', nodeRequire);
|
|
86
|
+
var __webpack_exports__Command = commander_index_js_namespaceObject.Command;
|
|
87
|
+
var __webpack_exports__Signale = signale_index_js_namespaceObject.Signale;
|
|
88
|
+
var __webpack_exports__address = address_index_js_default();
|
|
89
|
+
var __webpack_exports__browserslist = browserslist_index_js_default();
|
|
90
|
+
var __webpack_exports__chalk = chalk_index_js_default();
|
|
91
|
+
var __webpack_exports__debug = debug_index_js_default();
|
|
92
|
+
var __webpack_exports__dotenv = dotenv_index_js_default();
|
|
93
|
+
var __webpack_exports__dotenvExpand = dotenv_expand_index_js_default();
|
|
94
|
+
var __webpack_exports__execa = execa_index_js_default();
|
|
95
|
+
var __webpack_exports__fastGlob = fast_glob_index_js_default();
|
|
96
|
+
var __webpack_exports__filesize = filesize_index_js_default();
|
|
97
|
+
var __webpack_exports__fs = index_js_default();
|
|
98
|
+
var __webpack_exports__glob = glob_index_js_default();
|
|
99
|
+
var __webpack_exports__globby = globby_index_js_default();
|
|
100
|
+
var __webpack_exports__gzipSize = gzip_size_index_js_default();
|
|
101
|
+
var __webpack_exports__json5 = json5_index_js_default();
|
|
102
|
+
var __webpack_exports__lodash = lodash_index_js_default();
|
|
103
|
+
var __webpack_exports__minimist = minimist_index_js_default();
|
|
104
|
+
var __webpack_exports__nanoid = nanoid_index_js_namespaceObject.nanoid;
|
|
105
|
+
var __webpack_exports__ora = ora_index_js_default();
|
|
106
|
+
var __webpack_exports__pkgUp = pkg_up_index_js_default();
|
|
107
|
+
var __webpack_exports__program = commander_index_js_namespaceObject.program;
|
|
108
|
+
var __webpack_exports__semver = semver_index_js_default();
|
|
109
|
+
var __webpack_exports__signale = signale_index_js_default();
|
|
110
|
+
var __webpack_exports__slash = slash_index_js_default();
|
|
111
|
+
var __webpack_exports__stripAnsi = strip_ansi_index_js_default();
|
|
112
|
+
var __webpack_exports__upath = upath_index_js_default();
|
|
113
|
+
var __webpack_exports__urlJoin = url_join_index_js_default();
|
|
114
|
+
var __webpack_exports__yaml = js_yaml_index_js_default();
|
|
115
|
+
export { chokidar, inquirer, mime, __webpack_exports__Command as Command, __webpack_exports__Signale as Signale, __webpack_exports__address as address, __webpack_exports__browserslist as browserslist, __webpack_exports__chalk as chalk, __webpack_exports__debug as debug, __webpack_exports__dotenv as dotenv, __webpack_exports__dotenvExpand as dotenvExpand, __webpack_exports__execa as execa, __webpack_exports__fastGlob as fastGlob, __webpack_exports__filesize as filesize, __webpack_exports__fs as fs, __webpack_exports__glob as glob, __webpack_exports__globby as globby, __webpack_exports__gzipSize as gzipSize, __webpack_exports__json5 as json5, __webpack_exports__lodash as lodash, __webpack_exports__minimist as minimist, __webpack_exports__nanoid as nanoid, __webpack_exports__ora as ora, __webpack_exports__pkgUp as pkgUp, __webpack_exports__program as program, __webpack_exports__semver as semver, __webpack_exports__signale as signale, __webpack_exports__slash as slash, __webpack_exports__stripAnsi as stripAnsi, __webpack_exports__upath as upath, __webpack_exports__urlJoin as urlJoin, __webpack_exports__yaml as yaml };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createRequire as __rspack_createRequire } from "node:module";
|
|
2
|
+
const __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
|
|
3
|
+
var __webpack_modules__ = {
|
|
4
|
+
"../compiled/import-lazy" (module) {
|
|
5
|
+
module.exports = __rspack_createRequire_require("../compiled/import-lazy/index.js");
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
var __webpack_module_cache__ = {};
|
|
9
|
+
function __webpack_require__(moduleId) {
|
|
10
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
11
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
12
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
13
|
+
exports: {}
|
|
14
|
+
};
|
|
15
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
16
|
+
return module.exports;
|
|
17
|
+
}
|
|
18
|
+
const lazy = (moduleName, requireFn)=>{
|
|
19
|
+
const importLazyLocal = __webpack_require__("../compiled/import-lazy")(requireFn);
|
|
20
|
+
return importLazyLocal(moduleName);
|
|
21
|
+
};
|
|
22
|
+
const Import = {
|
|
23
|
+
lazy
|
|
24
|
+
};
|
|
25
|
+
export { Import, lazy as lazyImport };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const ROUTE_MANIFEST = "_MODERNJS_ROUTE_MANIFEST";
|
|
2
|
+
const ROUTE_MODULES = "_routeModules";
|
|
3
|
+
const HTML_CHUNKSMAP_SEPARATOR = '<!--<?- chunksMap.js ?>-->';
|
|
4
|
+
const LOADER_REPORTER_NAME = "server-loader";
|
|
5
|
+
const ROUTE_SPEC_FILE = 'route.json';
|
|
6
|
+
const NESTED_ROUTE_SPEC_FILE = 'nestedRoutes.json';
|
|
7
|
+
const MAIN_ENTRY_NAME = 'main';
|
|
8
|
+
const DEFAULT_ENTRY_NAME = 'index';
|
|
9
|
+
const SERVER_BUNDLE_DIRECTORY = 'bundles';
|
|
10
|
+
const SERVER_RENDER_FUNCTION_NAME = 'serverRender';
|
|
11
|
+
const SERVER_PLUGIN_BFF = '@modern-js/plugin-bff';
|
|
12
|
+
const SERVER_PLUGIN_POLYFILL = '@modern-js/plugin-polyfill';
|
|
13
|
+
export { DEFAULT_ENTRY_NAME, HTML_CHUNKSMAP_SEPARATOR, LOADER_REPORTER_NAME, MAIN_ENTRY_NAME, NESTED_ROUTE_SPEC_FILE, ROUTE_MANIFEST, ROUTE_MODULES, ROUTE_SPEC_FILE, SERVER_BUNDLE_DIRECTORY, SERVER_PLUGIN_BFF, SERVER_PLUGIN_POLYFILL, SERVER_RENDER_FUNCTION_NAME };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const pluginDagSort = (plugins, key = 'name', preKey = 'pre', postKey = 'post')=>{
|
|
2
|
+
let allLines = [];
|
|
3
|
+
function getPluginByAny(q) {
|
|
4
|
+
const target = plugins.find((item)=>'string' == typeof q ? item[key] === q : item[key] === q[key]);
|
|
5
|
+
if (!target) throw new Error(`plugin ${q} not existed`);
|
|
6
|
+
return target;
|
|
7
|
+
}
|
|
8
|
+
plugins.forEach((item)=>{
|
|
9
|
+
item[preKey]?.forEach((p)=>{
|
|
10
|
+
if (plugins.find((ap)=>ap.name === p)) allLines.push([
|
|
11
|
+
getPluginByAny(p)[key],
|
|
12
|
+
getPluginByAny(item)[key]
|
|
13
|
+
]);
|
|
14
|
+
});
|
|
15
|
+
item[postKey]?.forEach((pt)=>{
|
|
16
|
+
if (plugins.find((ap)=>ap.name === pt)) allLines.push([
|
|
17
|
+
getPluginByAny(item)[key],
|
|
18
|
+
getPluginByAny(pt)[key]
|
|
19
|
+
]);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
let zeroEndPoints = plugins.filter((item)=>!allLines.find((l)=>l[1] === item[key]));
|
|
23
|
+
const sortedPoint = [];
|
|
24
|
+
while(zeroEndPoints.length){
|
|
25
|
+
const zep = zeroEndPoints.shift();
|
|
26
|
+
sortedPoint.push(getPluginByAny(zep));
|
|
27
|
+
allLines = allLines.filter((l)=>l[0] !== getPluginByAny(zep)[key]);
|
|
28
|
+
const restPoints = plugins.filter((item)=>!sortedPoint.find((sp)=>sp[key] === item[key]));
|
|
29
|
+
zeroEndPoints = restPoints.filter((item)=>!allLines.find((l)=>l[1] === item[key]));
|
|
30
|
+
}
|
|
31
|
+
if (allLines.length) {
|
|
32
|
+
const restInRingPoints = {};
|
|
33
|
+
allLines.forEach((l)=>{
|
|
34
|
+
restInRingPoints[l[0]] = true;
|
|
35
|
+
restInRingPoints[l[1]] = true;
|
|
36
|
+
});
|
|
37
|
+
throw new Error(`plugins dependencies has loop: ${Object.keys(restInRingPoints).join(',')}`);
|
|
38
|
+
}
|
|
39
|
+
return sortedPoint;
|
|
40
|
+
};
|
|
41
|
+
export { pluginDagSort };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InternalPlugins } from '@modern-js/types';
|
|
2
|
-
export { NESTED_ROUTE_SPEC_FILE, MAIN_ENTRY_NAME, ROUTE_SPEC_FILE, SERVER_BUNDLE_DIRECTORY, SERVER_RENDER_FUNCTION_NAME, SERVER_PLUGIN_BFF,
|
|
2
|
+
export { NESTED_ROUTE_SPEC_FILE, MAIN_ENTRY_NAME, DEFAULT_ENTRY_NAME, ROUTE_SPEC_FILE, SERVER_BUNDLE_DIRECTORY, SERVER_RENDER_FUNCTION_NAME, SERVER_PLUGIN_BFF, SERVER_PLUGIN_POLYFILL, } from '../universal/constants';
|
|
3
3
|
export declare const JS_EXTENSIONS: string[];
|
|
4
4
|
/**
|
|
5
5
|
* server side bundles directory, which relative to dist.
|
|
@@ -36,10 +36,6 @@ export declare const OUTPUT_CONFIG_FILE = "modern.config.json";
|
|
|
36
36
|
* Default runtime config filename
|
|
37
37
|
*/
|
|
38
38
|
export declare const DEFAULT_RUNTIME_CONFIG = "modern.runtime";
|
|
39
|
-
/**
|
|
40
|
-
* Default server config basename
|
|
41
|
-
*/
|
|
42
|
-
export declare const DEFAULT_SERVER_CONFIG = "modern.server-runtime.config";
|
|
43
39
|
/**
|
|
44
40
|
* Routes manifest filename
|
|
45
41
|
*/
|
|
@@ -52,24 +48,4 @@ export declare const LOADER_ROUTES_DIR = "loader-routes";
|
|
|
52
48
|
* default host for dev
|
|
53
49
|
*/
|
|
54
50
|
export declare const DEFAULT_DEV_HOST = "0.0.0.0";
|
|
55
|
-
|
|
56
|
-
* Internal app-tools plugins that work as soon as they are installed.
|
|
57
|
-
*/
|
|
58
|
-
export declare const INTERNAL_APP_TOOLS_PLUGINS: InternalPlugins;
|
|
59
|
-
export declare const INTERNAL_APP_TOOLS_RUNTIME_PLUGINS: InternalPlugins;
|
|
60
|
-
/**
|
|
61
|
-
* Internal module-tools plugins that work as soon as they are installed.
|
|
62
|
-
*/
|
|
63
|
-
export declare const INTERNAL_MODULE_TOOLS_PLUGINS: InternalPlugins;
|
|
64
|
-
/**
|
|
65
|
-
* Internal monorepo-tools plugins that work as soon as they are installed.
|
|
66
|
-
*/
|
|
67
|
-
export declare const INTERNAL_MONOREPO_TOOLS_PLUGINS: InternalPlugins;
|
|
68
|
-
/**
|
|
69
|
-
* Internal doc-tools plugins that work as soon as they are installed.
|
|
70
|
-
*/
|
|
71
|
-
export declare const INTERNAL_DOC_TOOLS_PLUGINS: InternalPlugins;
|
|
72
|
-
/**
|
|
73
|
-
* Internal plugins that work as soon as they are installed.
|
|
74
|
-
*/
|
|
75
|
-
export declare const INTERNAL_CLI_PLUGINS: InternalPlugins;
|
|
51
|
+
export declare const INTERNAL_RUNTIME_PLUGINS: InternalPlugins;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { InternalPlugins } from '@modern-js/types';
|
|
2
2
|
export declare function getPackageManager(cwd?: string): Promise<"pnpm" | "npm" | "yarn">;
|
|
3
3
|
export declare const getCoreJsVersion: (corejsPkgPath: string) => string;
|
|
4
|
-
export declare const getAntdMajorVersion: (appDirectory: string) => number | null;
|
|
5
4
|
export declare const defaults: string[];
|
|
6
5
|
export declare const getBrowserslist: (appDirectory: string) => string[];
|
|
7
6
|
export declare function getInternalPlugins(appDirectory: string, internalPlugins?: InternalPlugins): string[];
|
|
@@ -17,6 +17,6 @@ export declare const isUseRsc: (config: any) => boolean;
|
|
|
17
17
|
* @returns Whether to use worker deploy.
|
|
18
18
|
*/
|
|
19
19
|
export declare const isServiceWorker: (config: any) => boolean;
|
|
20
|
-
export declare const isSSGEntry: (config: any, entryName: string, entrypoints: EntryPoint[]) =>
|
|
20
|
+
export declare const isSSGEntry: (config: any, entryName: string, entrypoints: EntryPoint[]) => any;
|
|
21
21
|
export declare const isSingleEntry: (entrypoints: EntryPoint[], mainEntryName?: string) => boolean;
|
|
22
22
|
export {};
|
|
@@ -4,5 +4,5 @@ type RunTaskType = (option: {
|
|
|
4
4
|
changedFilePath: string;
|
|
5
5
|
changeType: WatchChangeTypeValueT;
|
|
6
6
|
}) => void | Promise<void>;
|
|
7
|
-
export declare const watch: (watchDir: string | string[], runTask: RunTaskType, ignored?: (string | RegExp)[]) => import("compiled/chokidar/types").FSWatcher;
|
|
7
|
+
export declare const watch: (watchDir: string | string[], runTask: RunTaskType, ignored?: (string | RegExp)[]) => import("../../../compiled/chokidar/types").FSWatcher;
|
|
8
8
|
export {};
|
package/dist/types/compiled.d.ts
CHANGED
|
@@ -31,11 +31,6 @@ export type { IOptions as GlobOptions } from '../compiled/glob';
|
|
|
31
31
|
export type { GlobbyOptions } from '../compiled/globby';
|
|
32
32
|
export type { FSWatcher, WatchOptions } from '../compiled/chokidar';
|
|
33
33
|
export type { ExecaError } from '../compiled/execa';
|
|
34
|
-
export type { default as WebpackChain } from '../compiled/webpack-chain';
|
|
35
|
-
/**
|
|
36
|
-
* Lazy import some expensive modules that will slow down startup speed.
|
|
37
|
-
* Notice that `csmith-tools build` can not bundle lazy imported modules.
|
|
38
|
-
*/
|
|
39
34
|
export declare const mime: typeof import('../compiled/mime-types');
|
|
40
35
|
export declare const chokidar: typeof import('../compiled/chokidar');
|
|
41
36
|
export declare const inquirer: typeof import('../compiled/inquirer');
|
|
@@ -6,10 +6,6 @@ export declare const ROUTE_MANIFEST = "_MODERNJS_ROUTE_MANIFEST";
|
|
|
6
6
|
* Property mounted on window that record all route modules
|
|
7
7
|
*/
|
|
8
8
|
export declare const ROUTE_MODULES = "_routeModules";
|
|
9
|
-
/**
|
|
10
|
-
* hmr socket connect path
|
|
11
|
-
*/
|
|
12
|
-
export declare const HMR_SOCK_PATH = "/webpack-hmr";
|
|
13
9
|
/**
|
|
14
10
|
* html placeholder
|
|
15
11
|
*/
|
|
@@ -30,6 +26,10 @@ export declare const NESTED_ROUTE_SPEC_FILE = "nestedRoutes.json";
|
|
|
30
26
|
* main entry name
|
|
31
27
|
*/
|
|
32
28
|
export declare const MAIN_ENTRY_NAME = "main";
|
|
29
|
+
/**
|
|
30
|
+
* default entry name
|
|
31
|
+
*/
|
|
32
|
+
export declare const DEFAULT_ENTRY_NAME = "index";
|
|
33
33
|
/**
|
|
34
34
|
* server side bundles directory, which relative to dist.
|
|
35
35
|
*/
|
|
@@ -39,7 +39,4 @@ export declare const SERVER_BUNDLE_DIRECTORY = "bundles";
|
|
|
39
39
|
*/
|
|
40
40
|
export declare const SERVER_RENDER_FUNCTION_NAME = "serverRender";
|
|
41
41
|
export declare const SERVER_PLUGIN_BFF = "@modern-js/plugin-bff";
|
|
42
|
-
export declare const SERVER_PLUGIN_EXPRESS = "@modern-js/plugin-express";
|
|
43
|
-
export declare const SERVER_PLUGIN_KOA = "@modern-js/plugin-koa";
|
|
44
|
-
export declare const SERVER_PLUGIN_SERVER = "@modern-js/plugin-server";
|
|
45
42
|
export declare const SERVER_PLUGIN_POLYFILL = "@modern-js/plugin-polyfill";
|
package/package.json
CHANGED
|
@@ -15,15 +15,16 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "
|
|
18
|
+
"version": "3.0.0-alpha.0",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/index.js",
|
|
22
|
-
"module": "./dist/esm/index.
|
|
22
|
+
"module": "./dist/esm/index.mjs",
|
|
23
23
|
"_comment": "Provide ESM and CJS exports, ESM is used by runtime package, for treeshaking",
|
|
24
24
|
"exports": {
|
|
25
25
|
".": {
|
|
26
26
|
"types": "./dist/types/index.d.ts",
|
|
27
|
+
"import": "./dist/esm-node/index.mjs",
|
|
27
28
|
"default": "./dist/cjs/index.js"
|
|
28
29
|
},
|
|
29
30
|
"./logger": {
|
|
@@ -46,22 +47,17 @@
|
|
|
46
47
|
},
|
|
47
48
|
"./universal": {
|
|
48
49
|
"types": "./dist/types/universal/index.d.ts",
|
|
49
|
-
"import": "./dist/esm/universal/index.
|
|
50
|
+
"import": "./dist/esm/universal/index.mjs",
|
|
50
51
|
"default": "./dist/cjs/universal/index.js"
|
|
51
52
|
},
|
|
52
53
|
"./universal/constants": {
|
|
53
54
|
"types": "./dist/types/universal/constants.d.ts",
|
|
54
|
-
"import": "./dist/esm/universal/constants.
|
|
55
|
+
"import": "./dist/esm/universal/constants.mjs",
|
|
55
56
|
"default": "./dist/cjs/universal/constants.js"
|
|
56
57
|
},
|
|
57
|
-
"./universal/format-webpack": {
|
|
58
|
-
"types": "./dist/types/universal/formatWebpack.d.ts",
|
|
59
|
-
"import": "./dist/esm/universal/formatWebpack.js",
|
|
60
|
-
"default": "./dist/cjs/universal/formatWebpack.js"
|
|
61
|
-
},
|
|
62
58
|
"./universal/plugin-dag-sort": {
|
|
63
59
|
"types": "./dist/types/universal/pluginDagSort.d.ts",
|
|
64
|
-
"import": "./dist/esm/universal/pluginDagSort.
|
|
60
|
+
"import": "./dist/esm/universal/pluginDagSort.mjs",
|
|
65
61
|
"default": "./dist/cjs/universal/pluginDagSort.js"
|
|
66
62
|
},
|
|
67
63
|
"./commander": "./dist/compiled/commander/index.js",
|
|
@@ -79,7 +75,6 @@
|
|
|
79
75
|
"./mime-types": "./dist/compiled/mime-types/index.js",
|
|
80
76
|
"./strip-ansi": "./dist/compiled/strip-ansi/index.js",
|
|
81
77
|
"./browserslist": "./dist/compiled/browserslist/index.js",
|
|
82
|
-
"./webpack-chain": "./dist/compiled/webpack-chain/index.js",
|
|
83
78
|
"./tsconfig-paths": "./dist/compiled/tsconfig-paths/index.js"
|
|
84
79
|
},
|
|
85
80
|
"publishConfig": {
|
|
@@ -106,9 +101,6 @@
|
|
|
106
101
|
"universal/constants": [
|
|
107
102
|
"./dist/types/universal/constants.d.ts"
|
|
108
103
|
],
|
|
109
|
-
"universal/format-webpack": [
|
|
110
|
-
"./dist/types/universal/formatWebpack.d.ts"
|
|
111
|
-
],
|
|
112
104
|
"universal/plugin-dag-sort": [
|
|
113
105
|
"./dist/types/universal/pluginDagSort.d.ts"
|
|
114
106
|
],
|
|
@@ -151,9 +143,6 @@
|
|
|
151
143
|
"browserslist": [
|
|
152
144
|
"./dist/compiled/browserslist/index.d.ts"
|
|
153
145
|
],
|
|
154
|
-
"webpack-chain": [
|
|
155
|
-
"./dist/compiled/webpack-chain/types/index.d.ts"
|
|
156
|
-
],
|
|
157
146
|
"tsconfig-paths": [
|
|
158
147
|
"./dist/compiled/tsconfig-paths/lib/index.d.ts"
|
|
159
148
|
],
|
|
@@ -169,23 +158,34 @@
|
|
|
169
158
|
"@swc/helpers": "^0.5.17",
|
|
170
159
|
"caniuse-lite": "^1.0.30001520",
|
|
171
160
|
"lodash": "^4.17.21",
|
|
172
|
-
"rslog": "^1.
|
|
161
|
+
"rslog": "^1.3.2"
|
|
173
162
|
},
|
|
174
163
|
"devDependencies": {
|
|
175
|
-
"@types/jest": "^29",
|
|
176
|
-
"@types/node": "^
|
|
177
|
-
"jest": "^29",
|
|
164
|
+
"@types/jest": "^29.5.14",
|
|
165
|
+
"@types/node": "^20",
|
|
166
|
+
"jest": "^29.7.0",
|
|
167
|
+
"@rslib/core": "0.18.5",
|
|
178
168
|
"typescript": "^5",
|
|
179
|
-
"
|
|
180
|
-
"@modern-js/
|
|
181
|
-
"@scripts/build": "2.66.0",
|
|
169
|
+
"@modern-js/types": "3.0.0-alpha.0",
|
|
170
|
+
"@modern-js/rslib": "2.68.10",
|
|
182
171
|
"@scripts/jest-config": "2.66.0"
|
|
183
172
|
},
|
|
173
|
+
"peerDependencies": {
|
|
174
|
+
"react": "^19.2.3",
|
|
175
|
+
"react-dom": "^19.2.3"
|
|
176
|
+
},
|
|
177
|
+
"peerDependenciesMeta": {
|
|
178
|
+
"react": {
|
|
179
|
+
"optional": true
|
|
180
|
+
},
|
|
181
|
+
"react-dom": {
|
|
182
|
+
"optional": true
|
|
183
|
+
}
|
|
184
|
+
},
|
|
184
185
|
"sideEffects": false,
|
|
185
186
|
"scripts": {
|
|
186
|
-
"
|
|
187
|
-
"
|
|
188
|
-
"build": "modern-lib build",
|
|
187
|
+
"dev": "rslib build --watch",
|
|
188
|
+
"build": "rslib build",
|
|
189
189
|
"test": "jest --passWithNoTests"
|
|
190
190
|
}
|
|
191
191
|
}
|