@modern-js/app-tools 2.45.1-alpha.1 → 2.46.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/analyze/generateCode.js +0 -1
- package/dist/cjs/analyze/index.js +1 -5
- package/dist/cjs/analyze/nestedRoutes.js +1 -1
- package/dist/cjs/analyze/utils.js +0 -1
- package/dist/esm/analyze/generateCode.js +0 -1
- package/dist/esm/analyze/index.js +1 -5
- package/dist/esm/analyze/nestedRoutes.js +1 -1
- package/dist/esm/analyze/utils.js +0 -1
- package/dist/esm-node/analyze/generateCode.js +0 -1
- package/dist/esm-node/analyze/index.js +1 -5
- package/dist/esm-node/analyze/nestedRoutes.js +1 -1
- package/dist/esm-node/analyze/utils.js +0 -1
- package/package.json +22 -22
@@ -181,7 +181,6 @@ const generateCode = async (appContext, config, entrypoints, api) => {
|
|
181
181
|
internalDirAlias
|
182
182
|
})
|
183
183
|
});
|
184
|
-
console.log("222222222", imports);
|
185
184
|
importsStatemets.set(entryName, imports);
|
186
185
|
const entryFile = import_path.default.resolve(internalDirectory, `./${entryName}/${import_constants.ENTRY_POINT_FILE_NAME}`);
|
187
186
|
entrypoint.internalEntry = entryFile;
|
@@ -44,10 +44,6 @@ var import_utils2 = require("./utils");
|
|
44
44
|
var import_constants = require("./constants");
|
45
45
|
var import_generateCode = require("./generateCode");
|
46
46
|
const debug = (0, import_utils.createDebugger)("plugin-analyze");
|
47
|
-
const getPathWithoutExt = (filename) => {
|
48
|
-
const extname = path.extname(filename);
|
49
|
-
return filename.slice(0, -extname.length);
|
50
|
-
};
|
51
47
|
var analyze_default = ({ bundler }) => ({
|
52
48
|
name: "@modern-js/plugin-analyze",
|
53
49
|
setup: (api) => {
|
@@ -220,7 +216,7 @@ var analyze_default = ({ bundler }) => ({
|
|
220
216
|
filename: rootLayoutFile
|
221
217
|
});
|
222
218
|
const hasAppConfig = moduleExports.some((e) => e.n === import_constants.APP_CONFIG_NAME);
|
223
|
-
const generateLayoutPath =
|
219
|
+
const generateLayoutPath = (0, import_utils2.replaceWithAlias)(srcDirectory, rootLayoutFile, internalSrcAlias);
|
224
220
|
if (hasAppConfig) {
|
225
221
|
imports.push({
|
226
222
|
value: generateLayoutPath,
|
@@ -143,7 +143,7 @@ const walk = async (dirname, rootDir, alias, entryName, isMainEntry, oldVersion)
|
|
143
143
|
const items = await import_utils.fs.readdir(dirname);
|
144
144
|
for (const item of items) {
|
145
145
|
const itemPath = path.join(dirname, item);
|
146
|
-
const itemPathWithAlias =
|
146
|
+
const itemPathWithAlias = (0, import_utils2.replaceWithAlias)(alias.basename, itemPath, alias.name);
|
147
147
|
const extname = path.extname(item);
|
148
148
|
const itemWithoutExt = item.slice(0, -extname.length);
|
149
149
|
const isDirectory2 = (await import_utils.fs.stat(itemPath)).isDirectory();
|
@@ -132,7 +132,6 @@ const getDefaultImports = ({ entrypoint, srcDirectory, appDirectory, internalSrc
|
|
132
132
|
value: (0, import_utils.normalizeToPosixPath)(entry.replace(srcDirectory, internalSrcAlias))
|
133
133
|
});
|
134
134
|
}
|
135
|
-
console.log("iiiiiiiiiii", imports);
|
136
135
|
return imports;
|
137
136
|
};
|
138
137
|
const isPageComponentFile = (filePath) => {
|
@@ -273,7 +273,6 @@ var generateCode = function() {
|
|
273
273
|
];
|
274
274
|
case 12:
|
275
275
|
imports = _state.sent().imports;
|
276
|
-
console.log("222222222", imports);
|
277
276
|
importsStatemets.set(entryName, imports);
|
278
277
|
entryFile = path.resolve(internalDirectory, "./".concat(entryName, "/").concat(ENTRY_POINT_FILE_NAME));
|
279
278
|
entrypoint.internalEntry = entryFile;
|
@@ -16,10 +16,6 @@ import { checkIsBuildCommands, isPageComponentFile, parseModule, replaceWithAlia
|
|
16
16
|
import { APP_CONFIG_NAME, APP_INIT_EXPORTED, APP_INIT_IMPORTED } from "./constants";
|
17
17
|
import { generateIndexCode } from "./generateCode";
|
18
18
|
var debug = createDebugger("plugin-analyze");
|
19
|
-
var getPathWithoutExt = function(filename) {
|
20
|
-
var extname = path.extname(filename);
|
21
|
-
return filename.slice(0, -extname.length);
|
22
|
-
};
|
23
19
|
function analyze_default(param) {
|
24
20
|
var bundler = param.bundler;
|
25
21
|
return {
|
@@ -422,7 +418,7 @@ function analyze_default(param) {
|
|
422
418
|
hasAppConfig = moduleExports.some(function(e) {
|
423
419
|
return e.n === APP_CONFIG_NAME;
|
424
420
|
});
|
425
|
-
generateLayoutPath =
|
421
|
+
generateLayoutPath = replaceWithAlias(srcDirectory, rootLayoutFile, internalSrcAlias);
|
426
422
|
if (hasAppConfig) {
|
427
423
|
imports.push({
|
428
424
|
value: generateLayoutPath,
|
@@ -150,7 +150,7 @@ var walk = function() {
|
|
150
150
|
];
|
151
151
|
item = _step.value;
|
152
152
|
itemPath = path.join(dirname, item);
|
153
|
-
itemPathWithAlias =
|
153
|
+
itemPathWithAlias = replaceWithAlias(alias.basename, itemPath, alias.name);
|
154
154
|
extname = path.extname(item);
|
155
155
|
itemWithoutExt = item.slice(0, -extname.length);
|
156
156
|
return [
|
@@ -146,7 +146,6 @@ const generateCode = async (appContext, config, entrypoints, api) => {
|
|
146
146
|
internalDirAlias
|
147
147
|
})
|
148
148
|
});
|
149
|
-
console.log("222222222", imports);
|
150
149
|
importsStatemets.set(entryName, imports);
|
151
150
|
const entryFile = path.resolve(internalDirectory, `./${entryName}/${ENTRY_POINT_FILE_NAME}`);
|
152
151
|
entrypoint.internalEntry = entryFile;
|
@@ -11,10 +11,6 @@ import { checkIsBuildCommands, isPageComponentFile, parseModule, replaceWithAlia
|
|
11
11
|
import { APP_CONFIG_NAME, APP_INIT_EXPORTED, APP_INIT_IMPORTED } from "./constants";
|
12
12
|
import { generateIndexCode } from "./generateCode";
|
13
13
|
const debug = createDebugger("plugin-analyze");
|
14
|
-
const getPathWithoutExt = (filename) => {
|
15
|
-
const extname = path.extname(filename);
|
16
|
-
return filename.slice(0, -extname.length);
|
17
|
-
};
|
18
14
|
var analyze_default = ({ bundler }) => ({
|
19
15
|
name: "@modern-js/plugin-analyze",
|
20
16
|
setup: (api) => {
|
@@ -187,7 +183,7 @@ var analyze_default = ({ bundler }) => ({
|
|
187
183
|
filename: rootLayoutFile
|
188
184
|
});
|
189
185
|
const hasAppConfig = moduleExports.some((e) => e.n === APP_CONFIG_NAME);
|
190
|
-
const generateLayoutPath =
|
186
|
+
const generateLayoutPath = replaceWithAlias(srcDirectory, rootLayoutFile, internalSrcAlias);
|
191
187
|
if (hasAppConfig) {
|
192
188
|
imports.push({
|
193
189
|
value: generateLayoutPath,
|
@@ -108,7 +108,7 @@ const walk = async (dirname, rootDir, alias, entryName, isMainEntry, oldVersion)
|
|
108
108
|
const items = await fs.readdir(dirname);
|
109
109
|
for (const item of items) {
|
110
110
|
const itemPath = path.join(dirname, item);
|
111
|
-
const itemPathWithAlias =
|
111
|
+
const itemPathWithAlias = replaceWithAlias(alias.basename, itemPath, alias.name);
|
112
112
|
const extname = path.extname(item);
|
113
113
|
const itemWithoutExt = item.slice(0, -extname.length);
|
114
114
|
const isDirectory2 = (await fs.stat(itemPath)).isDirectory();
|
@@ -89,7 +89,6 @@ const getDefaultImports = ({ entrypoint, srcDirectory, appDirectory, internalSrc
|
|
89
89
|
value: normalizeToPosixPath(entry.replace(srcDirectory, internalSrcAlias))
|
90
90
|
});
|
91
91
|
}
|
92
|
-
console.log("iiiiiiiiiii", imports);
|
93
92
|
return imports;
|
94
93
|
};
|
95
94
|
const isPageComponentFile = (filePath) => {
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.
|
18
|
+
"version": "2.46.1",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"types": "./dist/types/index.d.ts",
|
21
21
|
"main": "./dist/cjs/index.js",
|
@@ -69,38 +69,38 @@
|
|
69
69
|
"@babel/parser": "^7.22.15",
|
70
70
|
"@babel/traverse": "^7.23.2",
|
71
71
|
"@babel/types": "^7.23.0",
|
72
|
-
"@rsbuild/plugin-esbuild": "0.
|
73
|
-
"@rsbuild/plugin-node-polyfill": "0.
|
74
|
-
"@rsbuild/shared": "0.
|
72
|
+
"@rsbuild/plugin-esbuild": "0.3.4",
|
73
|
+
"@rsbuild/plugin-node-polyfill": "0.3.4",
|
74
|
+
"@rsbuild/shared": "0.3.4",
|
75
75
|
"es-module-lexer": "^1.1.0",
|
76
76
|
"esbuild": "0.17.19",
|
77
77
|
"@swc/helpers": "0.5.3",
|
78
|
-
"@modern-js/uni-builder": "2.
|
79
|
-
"@modern-js/
|
80
|
-
"@modern-js/
|
81
|
-
"@modern-js/
|
82
|
-
"@modern-js/plugin-
|
83
|
-
"@modern-js/plugin
|
84
|
-
"@modern-js/
|
85
|
-
"@modern-js/server
|
86
|
-
"@modern-js/
|
87
|
-
"@modern-js/
|
88
|
-
"@modern-js/utils": "2.
|
89
|
-
"@modern-js/
|
90
|
-
"@modern-js/
|
91
|
-
"@modern-js/
|
92
|
-
"@modern-js/
|
78
|
+
"@modern-js/uni-builder": "2.46.1",
|
79
|
+
"@modern-js/core": "2.46.1",
|
80
|
+
"@modern-js/new-action": "2.46.1",
|
81
|
+
"@modern-js/node-bundle-require": "2.46.1",
|
82
|
+
"@modern-js/plugin-data-loader": "2.46.1",
|
83
|
+
"@modern-js/plugin": "2.46.1",
|
84
|
+
"@modern-js/plugin-i18n": "2.46.1",
|
85
|
+
"@modern-js/prod-server": "2.46.1",
|
86
|
+
"@modern-js/plugin-lint": "2.46.1",
|
87
|
+
"@modern-js/server": "2.46.1",
|
88
|
+
"@modern-js/server-utils": "2.46.1",
|
89
|
+
"@modern-js/types": "2.46.1",
|
90
|
+
"@modern-js/upgrade": "2.46.1",
|
91
|
+
"@modern-js/utils": "2.46.1",
|
92
|
+
"@modern-js/server-core": "2.46.1"
|
93
93
|
},
|
94
94
|
"devDependencies": {
|
95
|
-
"@rsbuild/plugin-swc": "0.
|
95
|
+
"@rsbuild/plugin-swc": "0.3.4",
|
96
96
|
"@types/babel__traverse": "7.18.5",
|
97
97
|
"@types/jest": "^29",
|
98
98
|
"@types/node": "^14",
|
99
99
|
"jest": "^29",
|
100
100
|
"typescript": "^5",
|
101
101
|
"webpack": "^5.89.0",
|
102
|
-
"@scripts/
|
103
|
-
"@scripts/
|
102
|
+
"@scripts/jest-config": "2.46.1",
|
103
|
+
"@scripts/build": "2.46.1"
|
104
104
|
},
|
105
105
|
"sideEffects": false,
|
106
106
|
"publishConfig": {
|