@dcloudio/uni-cli-shared 3.0.0-alpha-3030820220114011 → 3.0.0-alpha-3031220220222002
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/json/mp/jsonFile.d.ts +5 -1
- package/dist/json/mp/jsonFile.js +13 -10
- package/package.json +10 -10
|
@@ -16,8 +16,12 @@ export declare function isMiniProgramUsingComponent(name: string, options: {
|
|
|
16
16
|
inputDir: string;
|
|
17
17
|
componentsDir?: string;
|
|
18
18
|
}): boolean;
|
|
19
|
+
interface MiniProgramComponents {
|
|
20
|
+
[name: string]: 'plugin' | 'component';
|
|
21
|
+
}
|
|
19
22
|
export declare function findMiniProgramUsingComponents({ filename, inputDir, componentsDir, }: {
|
|
20
23
|
filename: string;
|
|
21
24
|
inputDir: string;
|
|
22
25
|
componentsDir?: string;
|
|
23
|
-
}):
|
|
26
|
+
}): MiniProgramComponents;
|
|
27
|
+
export {};
|
package/dist/json/mp/jsonFile.js
CHANGED
|
@@ -103,28 +103,31 @@ function addMiniProgramUsingComponents(filename, json) {
|
|
|
103
103
|
}
|
|
104
104
|
exports.addMiniProgramUsingComponents = addMiniProgramUsingComponents;
|
|
105
105
|
function isMiniProgramUsingComponent(name, options) {
|
|
106
|
-
return findMiniProgramUsingComponents(options)
|
|
106
|
+
return !!findMiniProgramUsingComponents(options)[name];
|
|
107
107
|
}
|
|
108
108
|
exports.isMiniProgramUsingComponent = isMiniProgramUsingComponent;
|
|
109
109
|
function findMiniProgramUsingComponents({ filename, inputDir, componentsDir, }) {
|
|
110
|
-
if (!componentsDir) {
|
|
111
|
-
return [];
|
|
112
|
-
}
|
|
113
110
|
const globalUsingComponents = appJsonCache && appJsonCache.usingComponents;
|
|
114
|
-
const miniProgramComponents =
|
|
111
|
+
const miniProgramComponents = {};
|
|
115
112
|
if (globalUsingComponents) {
|
|
116
|
-
|
|
113
|
+
(0, shared_1.extend)(miniProgramComponents, findMiniProgramUsingComponent(globalUsingComponents, componentsDir));
|
|
117
114
|
}
|
|
118
115
|
const jsonFile = findJsonFile((0, utils_1.removeExt)((0, utils_1.normalizeMiniProgramFilename)(filename, inputDir)));
|
|
119
116
|
if (jsonFile === null || jsonFile === void 0 ? void 0 : jsonFile.usingComponents) {
|
|
120
|
-
|
|
117
|
+
(0, shared_1.extend)(miniProgramComponents, findMiniProgramUsingComponent(jsonFile.usingComponents, componentsDir));
|
|
121
118
|
}
|
|
122
119
|
return miniProgramComponents;
|
|
123
120
|
}
|
|
124
121
|
exports.findMiniProgramUsingComponents = findMiniProgramUsingComponents;
|
|
125
122
|
function findMiniProgramUsingComponent(usingComponents, componentsDir) {
|
|
126
|
-
return Object.keys(usingComponents).
|
|
123
|
+
return Object.keys(usingComponents).reduce((res, name) => {
|
|
127
124
|
const path = usingComponents[name];
|
|
128
|
-
|
|
129
|
-
|
|
125
|
+
if (componentsDir && path.includes(componentsDir + '/')) {
|
|
126
|
+
res[name] = 'component';
|
|
127
|
+
}
|
|
128
|
+
else if (path.includes('plugin://')) {
|
|
129
|
+
res[name] = 'plugin';
|
|
130
|
+
}
|
|
131
|
+
return res;
|
|
132
|
+
}, {});
|
|
130
133
|
}
|
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-3031220220222002",
|
|
4
4
|
"description": "@dcloudio/uni-cli-shared",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,17 +18,17 @@
|
|
|
18
18
|
"url": "https://github.com/dcloudio/uni-app/issues"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@babel/core": "^7.
|
|
22
|
-
"@babel/parser": "^7.16.
|
|
21
|
+
"@babel/core": "^7.17.2",
|
|
22
|
+
"@babel/parser": "^7.16.4",
|
|
23
23
|
"@babel/types": "^7.16.8",
|
|
24
|
-
"@dcloudio/uni-i18n": "3.0.0-alpha-
|
|
25
|
-
"@dcloudio/uni-shared": "3.0.0-alpha-
|
|
24
|
+
"@dcloudio/uni-i18n": "3.0.0-alpha-3031220220222002",
|
|
25
|
+
"@dcloudio/uni-shared": "3.0.0-alpha-3031220220222002",
|
|
26
26
|
"@rollup/pluginutils": "^4.1.2",
|
|
27
|
-
"@vue/compiler-core": "3.2.
|
|
28
|
-
"@vue/compiler-dom": "3.2.
|
|
29
|
-
"@vue/compiler-sfc": "3.2.
|
|
30
|
-
"@vue/server-renderer": "3.2.
|
|
31
|
-
"@vue/shared": "3.2.
|
|
27
|
+
"@vue/compiler-core": "3.2.31",
|
|
28
|
+
"@vue/compiler-dom": "3.2.31",
|
|
29
|
+
"@vue/compiler-sfc": "3.2.31",
|
|
30
|
+
"@vue/server-renderer": "3.2.31",
|
|
31
|
+
"@vue/shared": "3.2.31",
|
|
32
32
|
"autoprefixer": "^10.4.2",
|
|
33
33
|
"base64url": "^3.0.1",
|
|
34
34
|
"chokidar": "^3.5.3",
|