@modern-js/utils 3.0.0-alpha.2 → 3.0.1
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/get/data.js +0 -15
- package/dist/esm/cli/get/data.mjs +2 -11
- package/dist/esm-node/cli/alias.mjs +0 -1
- package/dist/esm-node/cli/applyOptionsChain.mjs +0 -1
- package/dist/esm-node/cli/commands.mjs +0 -1
- package/dist/esm-node/cli/common.mjs +0 -1
- package/dist/esm-node/cli/config.mjs +0 -1
- package/dist/esm-node/cli/constants.mjs +0 -1
- package/dist/esm-node/cli/ensure.mjs +0 -1
- package/dist/esm-node/cli/fs.mjs +0 -1
- package/dist/esm-node/cli/get/config.mjs +0 -1
- package/dist/esm-node/cli/get/data.mjs +2 -12
- package/dist/esm-node/cli/get/index.mjs +0 -1
- package/dist/esm-node/cli/index.mjs +0 -1
- package/dist/esm-node/cli/is/config.mjs +0 -1
- package/dist/esm-node/cli/is/env.mjs +0 -1
- package/dist/esm-node/cli/is/index.mjs +0 -1
- package/dist/esm-node/cli/is/project.mjs +0 -1
- package/dist/esm-node/cli/is/type.mjs +0 -1
- package/dist/esm-node/cli/logger.mjs +0 -1
- package/dist/esm-node/cli/monorepo.mjs +0 -1
- package/dist/esm-node/cli/package.mjs +0 -1
- package/dist/esm-node/cli/path.mjs +0 -1
- package/dist/esm-node/cli/port.mjs +0 -1
- package/dist/esm-node/cli/prettyInstructions.mjs +0 -1
- package/dist/esm-node/cli/require.mjs +0 -1
- package/dist/esm-node/cli/route.mjs +0 -1
- package/dist/esm-node/cli/runtimeExports.mjs +0 -1
- package/dist/esm-node/cli/version.mjs +0 -1
- package/dist/esm-node/cli/watch.mjs +0 -1
- package/dist/esm-node/compiled.mjs +0 -1
- package/dist/esm-node/import.mjs +0 -1
- package/dist/esm-node/index.mjs +0 -1
- package/dist/esm-node/universal/constants.mjs +0 -1
- package/dist/esm-node/universal/index.mjs +0 -1
- package/dist/esm-node/universal/path.mjs +0 -1
- package/dist/esm-node/universal/pluginDagSort.mjs +0 -1
- package/dist/types/cli/get/data.d.ts +0 -2
- package/package.json +7 -7
package/dist/cjs/cli/get/data.js
CHANGED
|
@@ -35,9 +35,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
35
35
|
__webpack_require__.d(__webpack_exports__, {
|
|
36
36
|
getPackageManager: ()=>getPackageManager,
|
|
37
37
|
getCoreJsVersion: ()=>getCoreJsVersion,
|
|
38
|
-
getBrowserslist: ()=>getBrowserslist,
|
|
39
38
|
getInternalPlugins: ()=>getInternalPlugins,
|
|
40
|
-
defaults: ()=>defaults,
|
|
41
39
|
readTsConfig: ()=>readTsConfig,
|
|
42
40
|
readTsConfigByFile: ()=>readTsConfigByFile
|
|
43
41
|
});
|
|
@@ -72,15 +70,6 @@ const getCoreJsVersion = (corejsPkgPath)=>{
|
|
|
72
70
|
return '3';
|
|
73
71
|
}
|
|
74
72
|
};
|
|
75
|
-
const defaults = [
|
|
76
|
-
'chrome >= 87',
|
|
77
|
-
'edge >= 88',
|
|
78
|
-
'firefox >= 78',
|
|
79
|
-
'safari >= 14'
|
|
80
|
-
];
|
|
81
|
-
const getBrowserslist = (appDirectory)=>external_compiled_js_namespaceObject.browserslist.loadConfig({
|
|
82
|
-
path: appDirectory
|
|
83
|
-
}) || defaults;
|
|
84
73
|
function getInternalPlugins(appDirectory, internalPlugins = {}) {
|
|
85
74
|
return [
|
|
86
75
|
...Object.keys(internalPlugins).filter((name)=>{
|
|
@@ -99,16 +88,12 @@ const readTsConfigByFile = (filename)=>{
|
|
|
99
88
|
const content = external_compiled_js_namespaceObject.fs.readFileSync(external_path_default().resolve(filename), 'utf-8');
|
|
100
89
|
return external_compiled_js_namespaceObject.json5.parse(content);
|
|
101
90
|
};
|
|
102
|
-
exports.defaults = __webpack_exports__.defaults;
|
|
103
|
-
exports.getBrowserslist = __webpack_exports__.getBrowserslist;
|
|
104
91
|
exports.getCoreJsVersion = __webpack_exports__.getCoreJsVersion;
|
|
105
92
|
exports.getInternalPlugins = __webpack_exports__.getInternalPlugins;
|
|
106
93
|
exports.getPackageManager = __webpack_exports__.getPackageManager;
|
|
107
94
|
exports.readTsConfig = __webpack_exports__.readTsConfig;
|
|
108
95
|
exports.readTsConfigByFile = __webpack_exports__.readTsConfigByFile;
|
|
109
96
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
110
|
-
"defaults",
|
|
111
|
-
"getBrowserslist",
|
|
112
97
|
"getCoreJsVersion",
|
|
113
98
|
"getInternalPlugins",
|
|
114
99
|
"getPackageManager",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import os from "os";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import {
|
|
3
|
+
import { fs, json5 } from "../../compiled.mjs";
|
|
4
4
|
import { isDepExists } from "../is/index.mjs";
|
|
5
5
|
import { canUsePnpm, canUseYarn } from "../package.mjs";
|
|
6
6
|
const MAX_TIMES = 5;
|
|
@@ -27,15 +27,6 @@ const getCoreJsVersion = (corejsPkgPath)=>{
|
|
|
27
27
|
return '3';
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
const defaults = [
|
|
31
|
-
'chrome >= 87',
|
|
32
|
-
'edge >= 88',
|
|
33
|
-
'firefox >= 78',
|
|
34
|
-
'safari >= 14'
|
|
35
|
-
];
|
|
36
|
-
const getBrowserslist = (appDirectory)=>browserslist.loadConfig({
|
|
37
|
-
path: appDirectory
|
|
38
|
-
}) || defaults;
|
|
39
30
|
function getInternalPlugins(appDirectory, internalPlugins = {}) {
|
|
40
31
|
return [
|
|
41
32
|
...Object.keys(internalPlugins).filter((name)=>{
|
|
@@ -54,4 +45,4 @@ const readTsConfigByFile = (filename)=>{
|
|
|
54
45
|
const content = fs.readFileSync(path.resolve(filename), 'utf-8');
|
|
55
46
|
return json5.parse(content);
|
|
56
47
|
};
|
|
57
|
-
export {
|
|
48
|
+
export { getCoreJsVersion, getInternalPlugins, getPackageManager, readTsConfig, readTsConfigByFile };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
/*#__PURE__*/ import.meta.url;
|
|
3
2
|
import { DEFAULT_ENTRY_NAME, MAIN_ENTRY_NAME, NESTED_ROUTE_SPEC_FILE, ROUTE_SPEC_FILE, SERVER_BUNDLE_DIRECTORY, SERVER_PLUGIN_BFF, SERVER_PLUGIN_POLYFILL, SERVER_RENDER_FUNCTION_NAME } from "../universal/constants.mjs";
|
|
4
3
|
const JS_EXTENSIONS = [
|
|
5
4
|
'.js',
|
package/dist/esm-node/cli/fs.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
/*#__PURE__*/ import.meta.url;
|
|
3
2
|
import os from "os";
|
|
4
3
|
import path from "path";
|
|
5
|
-
import {
|
|
4
|
+
import { fs, json5 } from "../../compiled.mjs";
|
|
6
5
|
import { isDepExists } from "../is/index.mjs";
|
|
7
6
|
import { canUsePnpm, canUseYarn } from "../package.mjs";
|
|
8
7
|
const MAX_TIMES = 5;
|
|
@@ -29,15 +28,6 @@ const getCoreJsVersion = (corejsPkgPath)=>{
|
|
|
29
28
|
return '3';
|
|
30
29
|
}
|
|
31
30
|
};
|
|
32
|
-
const defaults = [
|
|
33
|
-
'chrome >= 87',
|
|
34
|
-
'edge >= 88',
|
|
35
|
-
'firefox >= 78',
|
|
36
|
-
'safari >= 14'
|
|
37
|
-
];
|
|
38
|
-
const getBrowserslist = (appDirectory)=>browserslist.loadConfig({
|
|
39
|
-
path: appDirectory
|
|
40
|
-
}) || defaults;
|
|
41
31
|
function getInternalPlugins(appDirectory, internalPlugins = {}) {
|
|
42
32
|
return [
|
|
43
33
|
...Object.keys(internalPlugins).filter((name)=>{
|
|
@@ -56,4 +46,4 @@ const readTsConfigByFile = (filename)=>{
|
|
|
56
46
|
const content = fs.readFileSync(path.resolve(filename), 'utf-8');
|
|
57
47
|
return json5.parse(content);
|
|
58
48
|
};
|
|
59
|
-
export {
|
|
49
|
+
export { getCoreJsVersion, getInternalPlugins, getPackageManager, readTsConfig, readTsConfigByFile };
|
package/dist/esm-node/import.mjs
CHANGED
package/dist/esm-node/index.mjs
CHANGED
|
@@ -1,8 +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 defaults: string[];
|
|
5
|
-
export declare const getBrowserslist: (appDirectory: string) => string[];
|
|
6
4
|
export declare function getInternalPlugins(appDirectory: string, internalPlugins?: InternalPlugins): string[];
|
|
7
5
|
export declare const readTsConfig: (root: string) => any;
|
|
8
6
|
export declare const readTsConfigByFile: (filename: string) => any;
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "3.0.
|
|
18
|
+
"version": "3.0.1",
|
|
19
19
|
"types": "./dist/types/index.d.ts",
|
|
20
20
|
"main": "./dist/cjs/index.js",
|
|
21
21
|
"module": "./dist/esm/index.mjs",
|
|
@@ -142,17 +142,17 @@
|
|
|
142
142
|
"rslog": "^1.3.2"
|
|
143
143
|
},
|
|
144
144
|
"devDependencies": {
|
|
145
|
-
"@rslib/core": "0.19.
|
|
145
|
+
"@rslib/core": "0.19.4",
|
|
146
146
|
"@types/node": "^20",
|
|
147
|
-
"happy-dom": "^20.
|
|
147
|
+
"happy-dom": "^20.4.0",
|
|
148
148
|
"typescript": "^5",
|
|
149
149
|
"@modern-js/rslib": "2.68.10",
|
|
150
|
-
"@
|
|
151
|
-
"@
|
|
150
|
+
"@modern-js/types": "3.0.1",
|
|
151
|
+
"@scripts/rstest-config": "2.66.0"
|
|
152
152
|
},
|
|
153
153
|
"peerDependencies": {
|
|
154
|
-
"react": "^19.2.
|
|
155
|
-
"react-dom": "^19.2.
|
|
154
|
+
"react": "^19.2.4",
|
|
155
|
+
"react-dom": "^19.2.4"
|
|
156
156
|
},
|
|
157
157
|
"peerDependenciesMeta": {
|
|
158
158
|
"react": {
|