@dcloudio/uni-cli-shared 3.0.0-alpha-3041020220516001 → 3.0.0-alpha-3041120220520001
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 +1 -1
- package/dist/json/mp/jsonFile.js +10 -2
- package/dist/vue/parse.js +2 -2
- package/package.json +3 -3
|
@@ -6,7 +6,7 @@ export declare function getComponentJsonFilenames(): string[];
|
|
|
6
6
|
export declare function findJsonFile(filename: string): Record<string, any> | undefined;
|
|
7
7
|
export declare function findUsingComponents(filename: string): UsingComponents | undefined;
|
|
8
8
|
export declare function normalizeJsonFilename(filename: string): string;
|
|
9
|
-
export declare function findChangedJsonFiles(): Map<string, string>;
|
|
9
|
+
export declare function findChangedJsonFiles(supportGlobalUsingComponents?: boolean): Map<string, string>;
|
|
10
10
|
export declare function addMiniProgramAppJson(appJson: Record<string, any>): void;
|
|
11
11
|
export declare function addMiniProgramPageJson(filename: string, json: PageWindowOptions): void;
|
|
12
12
|
export declare function addMiniProgramComponentJson(filename: string, json: ComponentJson): void;
|
package/dist/json/mp/jsonFile.js
CHANGED
|
@@ -50,24 +50,32 @@ function normalizeJsonFilename(filename) {
|
|
|
50
50
|
return (0, utils_1.normalizeNodeModules)(filename);
|
|
51
51
|
}
|
|
52
52
|
exports.normalizeJsonFilename = normalizeJsonFilename;
|
|
53
|
-
function findChangedJsonFiles() {
|
|
53
|
+
function findChangedJsonFiles(supportGlobalUsingComponents = true) {
|
|
54
54
|
const changedJsonFiles = new Map();
|
|
55
55
|
function findChangedFile(filename, json) {
|
|
56
|
+
var _a;
|
|
56
57
|
const newJson = JSON.parse(JSON.stringify(json));
|
|
57
58
|
if (!newJson.usingComponents) {
|
|
58
59
|
newJson.usingComponents = {};
|
|
59
60
|
}
|
|
60
61
|
(0, shared_1.extend)(newJson.usingComponents, jsonUsingComponentsCache.get(filename));
|
|
61
|
-
const usingComponents = newJson.usingComponents;
|
|
62
62
|
// 格式化为相对路径,这样作为分包也可以直接运行
|
|
63
63
|
// app.json mp-baidu 在 win 不支持相对路径。所有平台改用绝对路径
|
|
64
64
|
if (filename !== 'app') {
|
|
65
|
+
let usingComponents = newJson.usingComponents;
|
|
66
|
+
const globalUsingComponents = (_a = appJsonCache === null || appJsonCache === void 0 ? void 0 : appJsonCache.usingComponents) !== null && _a !== void 0 ? _a : {};
|
|
67
|
+
// 如果小程序不支持 global 的 usingComponents
|
|
68
|
+
if (!supportGlobalUsingComponents) {
|
|
69
|
+
// 从 appJsonCache 中读取全局的 usingComponents 并补充到子组件 usingComponents 中
|
|
70
|
+
usingComponents = { ...globalUsingComponents, ...newJson.usingComponents };
|
|
71
|
+
}
|
|
65
72
|
Object.keys(usingComponents).forEach((name) => {
|
|
66
73
|
const componentFilename = usingComponents[name];
|
|
67
74
|
if (componentFilename.startsWith('/')) {
|
|
68
75
|
usingComponents[name] = (0, resolve_1.relativeFile)(filename, componentFilename.slice(1));
|
|
69
76
|
}
|
|
70
77
|
});
|
|
78
|
+
newJson.usingComponents = usingComponents;
|
|
71
79
|
}
|
|
72
80
|
const jsonStr = JSON.stringify(newJson, null, 2);
|
|
73
81
|
if (jsonFilesCache.get(filename) !== jsonStr) {
|
package/dist/vue/parse.js
CHANGED
|
@@ -7,8 +7,8 @@ exports.parseWxsCode = exports.parseWxsNodes = exports.parseBlockCode = exports.
|
|
|
7
7
|
const magic_string_1 = __importDefault(require("magic-string"));
|
|
8
8
|
const ast_1 = require("../vite/utils/ast");
|
|
9
9
|
const BLOCK_RE = /<\/block>/;
|
|
10
|
-
const WXS_LANG_RE = /lang=["|'](renderjs|wxs)["|']/;
|
|
11
|
-
const WXS_ATTRS = ['wxs', 'renderjs'];
|
|
10
|
+
const WXS_LANG_RE = /lang=["|'](renderjs|wxs|sjs)["|']/;
|
|
11
|
+
const WXS_ATTRS = ['wxs', 'renderjs', 'sjs'];
|
|
12
12
|
function parseVueCode(code, isNVue = false) {
|
|
13
13
|
const hasBlock = BLOCK_RE.test(code);
|
|
14
14
|
const hasWxs = WXS_LANG_RE.test(code);
|
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-3041120220520001",
|
|
4
4
|
"description": "@dcloudio/uni-cli-shared",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"@babel/core": "^7.17.9",
|
|
23
23
|
"@babel/parser": "^7.17.9",
|
|
24
24
|
"@babel/types": "^7.17.0",
|
|
25
|
-
"@dcloudio/uni-i18n": "3.0.0-alpha-
|
|
26
|
-
"@dcloudio/uni-shared": "3.0.0-alpha-
|
|
25
|
+
"@dcloudio/uni-i18n": "3.0.0-alpha-3041120220520001",
|
|
26
|
+
"@dcloudio/uni-shared": "3.0.0-alpha-3041120220520001",
|
|
27
27
|
"@intlify/core-base": "9.1.9",
|
|
28
28
|
"@intlify/shared": "9.1.9",
|
|
29
29
|
"@intlify/vue-devtools": "9.1.9",
|