@modern-js/app-tools 2.45.1-alpha.0 → 2.45.1-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/analyze/generateCode.js +1 -0
- package/dist/cjs/analyze/index.js +5 -1
- package/dist/cjs/analyze/utils.js +1 -0
- package/dist/esm/analyze/generateCode.js +1 -0
- package/dist/esm/analyze/index.js +5 -1
- package/dist/esm/analyze/utils.js +1 -0
- package/dist/esm-node/analyze/generateCode.js +1 -0
- package/dist/esm-node/analyze/index.js +5 -1
- package/dist/esm-node/analyze/utils.js +1 -0
- package/package.json +6 -6
@@ -181,6 +181,7 @@ const generateCode = async (appContext, config, entrypoints, api) => {
|
|
181
181
|
internalDirAlias
|
182
182
|
})
|
183
183
|
});
|
184
|
+
console.log("222222222", imports);
|
184
185
|
importsStatemets.set(entryName, imports);
|
185
186
|
const entryFile = import_path.default.resolve(internalDirectory, `./${entryName}/${import_constants.ENTRY_POINT_FILE_NAME}`);
|
186
187
|
entrypoint.internalEntry = entryFile;
|
@@ -44,6 +44,10 @@ 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
|
+
};
|
47
51
|
var analyze_default = ({ bundler }) => ({
|
48
52
|
name: "@modern-js/plugin-analyze",
|
49
53
|
setup: (api) => {
|
@@ -216,7 +220,7 @@ var analyze_default = ({ bundler }) => ({
|
|
216
220
|
filename: rootLayoutFile
|
217
221
|
});
|
218
222
|
const hasAppConfig = moduleExports.some((e) => e.n === import_constants.APP_CONFIG_NAME);
|
219
|
-
const generateLayoutPath = (0, import_utils2.replaceWithAlias)(srcDirectory, rootLayoutFile, internalSrcAlias);
|
223
|
+
const generateLayoutPath = getPathWithoutExt((0, import_utils2.replaceWithAlias)(srcDirectory, rootLayoutFile, internalSrcAlias));
|
220
224
|
if (hasAppConfig) {
|
221
225
|
imports.push({
|
222
226
|
value: generateLayoutPath,
|
@@ -132,6 +132,7 @@ 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);
|
135
136
|
return imports;
|
136
137
|
};
|
137
138
|
const isPageComponentFile = (filePath) => {
|
@@ -273,6 +273,7 @@ var generateCode = function() {
|
|
273
273
|
];
|
274
274
|
case 12:
|
275
275
|
imports = _state.sent().imports;
|
276
|
+
console.log("222222222", imports);
|
276
277
|
importsStatemets.set(entryName, imports);
|
277
278
|
entryFile = path.resolve(internalDirectory, "./".concat(entryName, "/").concat(ENTRY_POINT_FILE_NAME));
|
278
279
|
entrypoint.internalEntry = entryFile;
|
@@ -16,6 +16,10 @@ 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
|
+
};
|
19
23
|
function analyze_default(param) {
|
20
24
|
var bundler = param.bundler;
|
21
25
|
return {
|
@@ -418,7 +422,7 @@ function analyze_default(param) {
|
|
418
422
|
hasAppConfig = moduleExports.some(function(e) {
|
419
423
|
return e.n === APP_CONFIG_NAME;
|
420
424
|
});
|
421
|
-
generateLayoutPath = replaceWithAlias(srcDirectory, rootLayoutFile, internalSrcAlias);
|
425
|
+
generateLayoutPath = getPathWithoutExt(replaceWithAlias(srcDirectory, rootLayoutFile, internalSrcAlias));
|
422
426
|
if (hasAppConfig) {
|
423
427
|
imports.push({
|
424
428
|
value: generateLayoutPath,
|
@@ -146,6 +146,7 @@ const generateCode = async (appContext, config, entrypoints, api) => {
|
|
146
146
|
internalDirAlias
|
147
147
|
})
|
148
148
|
});
|
149
|
+
console.log("222222222", imports);
|
149
150
|
importsStatemets.set(entryName, imports);
|
150
151
|
const entryFile = path.resolve(internalDirectory, `./${entryName}/${ENTRY_POINT_FILE_NAME}`);
|
151
152
|
entrypoint.internalEntry = entryFile;
|
@@ -11,6 +11,10 @@ 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
|
+
};
|
14
18
|
var analyze_default = ({ bundler }) => ({
|
15
19
|
name: "@modern-js/plugin-analyze",
|
16
20
|
setup: (api) => {
|
@@ -183,7 +187,7 @@ var analyze_default = ({ bundler }) => ({
|
|
183
187
|
filename: rootLayoutFile
|
184
188
|
});
|
185
189
|
const hasAppConfig = moduleExports.some((e) => e.n === APP_CONFIG_NAME);
|
186
|
-
const generateLayoutPath = replaceWithAlias(srcDirectory, rootLayoutFile, internalSrcAlias);
|
190
|
+
const generateLayoutPath = getPathWithoutExt(replaceWithAlias(srcDirectory, rootLayoutFile, internalSrcAlias));
|
187
191
|
if (hasAppConfig) {
|
188
192
|
imports.push({
|
189
193
|
value: generateLayoutPath,
|
@@ -89,6 +89,7 @@ const getDefaultImports = ({ entrypoint, srcDirectory, appDirectory, internalSrc
|
|
89
89
|
value: normalizeToPosixPath(entry.replace(srcDirectory, internalSrcAlias))
|
90
90
|
});
|
91
91
|
}
|
92
|
+
console.log("iiiiiiiiiii", imports);
|
92
93
|
return imports;
|
93
94
|
};
|
94
95
|
const isPageComponentFile = (filePath) => {
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.45.1-alpha.
|
18
|
+
"version": "2.45.1-alpha.1",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"types": "./dist/types/index.d.ts",
|
21
21
|
"main": "./dist/cjs/index.js",
|
@@ -77,19 +77,19 @@
|
|
77
77
|
"@swc/helpers": "0.5.3",
|
78
78
|
"@modern-js/uni-builder": "2.45.0",
|
79
79
|
"@modern-js/new-action": "2.45.0",
|
80
|
-
"@modern-js/core": "2.45.0",
|
81
80
|
"@modern-js/node-bundle-require": "2.45.0",
|
82
|
-
"@modern-js/plugin-data-loader": "2.45.0",
|
83
81
|
"@modern-js/plugin": "2.45.0",
|
82
|
+
"@modern-js/plugin-i18n": "2.45.0",
|
84
83
|
"@modern-js/plugin-lint": "2.45.0",
|
85
|
-
"@modern-js/prod-server": "2.45.0",
|
86
84
|
"@modern-js/server": "2.45.0",
|
87
85
|
"@modern-js/server-utils": "2.45.0",
|
88
|
-
"@modern-js/plugin-i18n": "2.45.0",
|
89
86
|
"@modern-js/types": "2.45.0",
|
87
|
+
"@modern-js/upgrade": "2.45.0",
|
90
88
|
"@modern-js/utils": "2.45.0",
|
91
89
|
"@modern-js/server-core": "2.45.0",
|
92
|
-
"@modern-js/
|
90
|
+
"@modern-js/core": "2.45.0",
|
91
|
+
"@modern-js/prod-server": "2.45.0",
|
92
|
+
"@modern-js/plugin-data-loader": "2.45.0"
|
93
93
|
},
|
94
94
|
"devDependencies": {
|
95
95
|
"@rsbuild/plugin-swc": "0.2.17",
|