@dcloudio/uni-cli-shared 3.0.0-alpha-3060420220922002 → 3.0.0-alpha-3060420220922004
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.
|
@@ -117,7 +117,10 @@ function updateMiniProgramComponentsByMainFilename(mainFilename, inputDir, norma
|
|
|
117
117
|
if (!scriptDescriptor) {
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
|
-
const bindingComponents = parseBindingComponents(
|
|
120
|
+
const bindingComponents = parseBindingComponents({
|
|
121
|
+
...templateDescriptor.bindingComponents,
|
|
122
|
+
...scriptDescriptor.setupBindingComponents,
|
|
123
|
+
}, scriptDescriptor.bindingComponents);
|
|
121
124
|
const imports = parseImports(mainDescriptor.imports, scriptDescriptor.imports, templateDescriptor.imports);
|
|
122
125
|
(0, jsonFile_1.addMiniProgramUsingComponents)((0, utils_1.removeExt)((0, utils_1.normalizeMiniProgramFilename)(mainFilename, inputDir)), createUsingComponents(bindingComponents, imports, inputDir, normalizeComponentName));
|
|
123
126
|
}
|
|
@@ -203,6 +206,7 @@ async function parseScriptDescriptor(filename, ast, options) {
|
|
|
203
206
|
: [];
|
|
204
207
|
const descriptor = {
|
|
205
208
|
bindingComponents: parseComponents(ast),
|
|
209
|
+
setupBindingComponents: findBindingComponents(ast.body),
|
|
206
210
|
imports,
|
|
207
211
|
};
|
|
208
212
|
scriptDescriptors.set(filename, descriptor);
|
package/dist/resolve.js
CHANGED
|
@@ -116,11 +116,12 @@ function resolveUtsAppModule(id, importer) {
|
|
|
116
116
|
const parts = (0, utils_1.normalizePath)(id).split('/');
|
|
117
117
|
const parentDir = parts[parts.length - 2];
|
|
118
118
|
if (parentDir === 'uni_modules' || parentDir === 'utssdk') {
|
|
119
|
-
|
|
119
|
+
const basedir = parentDir === 'uni_modules' ? 'utssdk' : '';
|
|
120
|
+
if (fs_1.default.existsSync(path_1.default.resolve(id, basedir, 'index.uts'))) {
|
|
120
121
|
return id;
|
|
121
122
|
}
|
|
122
123
|
const resolvePlatformDir = (p) => {
|
|
123
|
-
return path_1.default.resolve(id,
|
|
124
|
+
return path_1.default.resolve(id, basedir, p);
|
|
124
125
|
};
|
|
125
126
|
const extname = ['.uts'];
|
|
126
127
|
if (resolveUtsFile(resolvePlatformDir('app-android'), extname)) {
|
|
@@ -150,14 +151,15 @@ function resolveUtsModule(id, importer, platform) {
|
|
|
150
151
|
const parts = (0, utils_1.normalizePath)(id).split('/');
|
|
151
152
|
const parentDir = parts[parts.length - 2];
|
|
152
153
|
if (parentDir === 'uni_modules' || parentDir === 'utssdk') {
|
|
154
|
+
const basedir = parentDir === 'uni_modules' ? 'utssdk' : '';
|
|
153
155
|
const resolvePlatformDir = (p) => {
|
|
154
|
-
return path_1.default.resolve(id,
|
|
156
|
+
return path_1.default.resolve(id, basedir, p);
|
|
155
157
|
};
|
|
156
158
|
let index = resolveUtsFile(resolvePlatformDir(platform));
|
|
157
159
|
if (index) {
|
|
158
160
|
return index;
|
|
159
161
|
}
|
|
160
|
-
index = path_1.default.resolve(id, 'index.uts');
|
|
162
|
+
index = path_1.default.resolve(id, basedir, 'index.uts');
|
|
161
163
|
if (fs_1.default.existsSync(index)) {
|
|
162
164
|
return index;
|
|
163
165
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcloudio/uni-cli-shared",
|
|
3
|
-
"version": "3.0.0-alpha-
|
|
3
|
+
"version": "3.0.0-alpha-3060420220922004",
|
|
4
4
|
"description": "@dcloudio/uni-cli-shared",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"@babel/core": "^7.18.13",
|
|
26
26
|
"@babel/parser": "^7.18.13",
|
|
27
27
|
"@babel/types": "^7.17.0",
|
|
28
|
-
"@dcloudio/uni-i18n": "3.0.0-alpha-
|
|
29
|
-
"@dcloudio/uni-shared": "3.0.0-alpha-
|
|
28
|
+
"@dcloudio/uni-i18n": "3.0.0-alpha-3060420220922004",
|
|
29
|
+
"@dcloudio/uni-shared": "3.0.0-alpha-3060420220922004",
|
|
30
30
|
"@intlify/core-base": "9.1.9",
|
|
31
31
|
"@intlify/shared": "9.1.9",
|
|
32
32
|
"@intlify/vue-devtools": "9.1.9",
|