@dcloudio/uni-cli-shared 3.0.0-alpha-3030020211129001 → 3.0.0-alpha-3030020211201003
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/index.d.ts +1 -1
- package/dist/json/mp/index.js +2 -1
- package/dist/json/mp/jsonFile.js +4 -1
- package/dist/json/mp/pages.d.ts +1 -0
- package/dist/json/mp/pages.js +11 -1
- package/dist/json/mp/project.d.ts +1 -0
- package/dist/json/mp/project.js +5 -1
- package/dist/vite/plugins/inject.js +2 -0
- package/dist/vue/transforms/transformRef.js +2 -2
- package/package.json +3 -3
package/dist/json/mp/index.d.ts
CHANGED
package/dist/json/mp/index.js
CHANGED
|
@@ -10,9 +10,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.parseMiniProgramProjectJson = exports.parseMiniProgramPagesJson = void 0;
|
|
13
|
+
exports.parseMiniProgramProjectJson = exports.parseMiniProgramPagesJson = exports.mergeMiniProgramAppJson = void 0;
|
|
14
14
|
__exportStar(require("./jsonFile"), exports);
|
|
15
15
|
var pages_1 = require("./pages");
|
|
16
|
+
Object.defineProperty(exports, "mergeMiniProgramAppJson", { enumerable: true, get: function () { return pages_1.mergeMiniProgramAppJson; } });
|
|
16
17
|
Object.defineProperty(exports, "parseMiniProgramPagesJson", { enumerable: true, get: function () { return pages_1.parseMiniProgramPagesJson; } });
|
|
17
18
|
var project_1 = require("./project");
|
|
18
19
|
Object.defineProperty(exports, "parseMiniProgramProjectJson", { enumerable: true, get: function () { return project_1.parseMiniProgramProjectJson; } });
|
package/dist/json/mp/jsonFile.js
CHANGED
|
@@ -46,7 +46,10 @@ function findChangedJsonFiles() {
|
|
|
46
46
|
const usingComponents = newJson.usingComponents;
|
|
47
47
|
// 格式化为相对路径,这样作为分包也可以直接运行
|
|
48
48
|
Object.keys(usingComponents).forEach((name) => {
|
|
49
|
-
|
|
49
|
+
const componentFilename = usingComponents[name];
|
|
50
|
+
if (componentFilename.startsWith('/')) {
|
|
51
|
+
usingComponents[name] = (0, resolve_1.relativeFile)(filename, componentFilename.slice(1));
|
|
52
|
+
}
|
|
50
53
|
});
|
|
51
54
|
const jsonStr = JSON.stringify(newJson, null, 2);
|
|
52
55
|
if (jsonFilesCache.get(filename) !== jsonStr) {
|
package/dist/json/mp/pages.d.ts
CHANGED
|
@@ -13,4 +13,5 @@ export declare function parseMiniProgramPagesJson(jsonStr: string, platform: Uni
|
|
|
13
13
|
pageJsons: Record<string, PageWindowOptions>;
|
|
14
14
|
nvuePages: string[];
|
|
15
15
|
};
|
|
16
|
+
export declare function mergeMiniProgramAppJson(appJson: Record<string, any>, platformJson?: Record<string, any>): void;
|
|
16
17
|
export {};
|
package/dist/json/mp/pages.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.parseMiniProgramPagesJson = void 0;
|
|
6
|
+
exports.mergeMiniProgramAppJson = exports.parseMiniProgramPagesJson = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const shared_1 = require("@vue/shared");
|
|
@@ -11,10 +11,20 @@ const json_1 = require("../json");
|
|
|
11
11
|
const pages_1 = require("../pages");
|
|
12
12
|
const utils_1 = require("./utils");
|
|
13
13
|
const utils_2 = require("../../utils");
|
|
14
|
+
const project_1 = require("./project");
|
|
14
15
|
function parseMiniProgramPagesJson(jsonStr, platform, options = { subpackages: false }) {
|
|
15
16
|
return parsePagesJson(jsonStr, platform, options);
|
|
16
17
|
}
|
|
17
18
|
exports.parseMiniProgramPagesJson = parseMiniProgramPagesJson;
|
|
19
|
+
function mergeMiniProgramAppJson(appJson, platformJson = {}) {
|
|
20
|
+
Object.keys(platformJson).forEach((name) => {
|
|
21
|
+
if (!(0, project_1.isMiniProgramProjectJsonKey)(name) &&
|
|
22
|
+
!['usingComponents', 'optimization'].includes(name)) {
|
|
23
|
+
appJson[name] = platformJson[name];
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
exports.mergeMiniProgramAppJson = mergeMiniProgramAppJson;
|
|
18
28
|
function parsePagesJson(jsonStr, platform, { debug, darkmode, networkTimeout, subpackages, windowOptionsMap, tabBarOptionsMap, tabBarItemOptionsMap, } = {
|
|
19
29
|
subpackages: false,
|
|
20
30
|
}) {
|
|
@@ -4,5 +4,6 @@ interface ParseMiniProgramProjectJsonOptions {
|
|
|
4
4
|
interface ProjectConfig {
|
|
5
5
|
projectname: string;
|
|
6
6
|
}
|
|
7
|
+
export declare function isMiniProgramProjectJsonKey(name: string): boolean;
|
|
7
8
|
export declare function parseMiniProgramProjectJson(jsonStr: string, platform: UniApp.PLATFORM, { template }: ParseMiniProgramProjectJsonOptions): ProjectConfig;
|
|
8
9
|
export {};
|
package/dist/json/mp/project.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseMiniProgramProjectJson = void 0;
|
|
3
|
+
exports.parseMiniProgramProjectJson = exports.isMiniProgramProjectJsonKey = void 0;
|
|
4
4
|
const shared_1 = require("@vue/shared");
|
|
5
5
|
const json_1 = require("../json");
|
|
6
6
|
const projectKeys = [
|
|
@@ -18,6 +18,10 @@ const projectKeys = [
|
|
|
18
18
|
'scripts',
|
|
19
19
|
'cloudbaseRoot',
|
|
20
20
|
];
|
|
21
|
+
function isMiniProgramProjectJsonKey(name) {
|
|
22
|
+
return projectKeys.includes(name);
|
|
23
|
+
}
|
|
24
|
+
exports.isMiniProgramProjectJsonKey = isMiniProgramProjectJsonKey;
|
|
21
25
|
function parseMiniProgramProjectJson(jsonStr, platform, { template }) {
|
|
22
26
|
const project = JSON.parse(JSON.stringify(template));
|
|
23
27
|
const manifestJson = (0, json_1.parseJson)(jsonStr);
|
|
@@ -42,6 +42,8 @@ function uniViteInjectPlugin(options) {
|
|
|
42
42
|
const callback = options.callback;
|
|
43
43
|
return {
|
|
44
44
|
name: 'vite:uni-inject',
|
|
45
|
+
// 确保在 commonjs 之后,否则会混合 es6 module 与 cjs 的代码,导致 commonjs 失效
|
|
46
|
+
enforce: 'post',
|
|
45
47
|
transform(code, id) {
|
|
46
48
|
if (!filter(id))
|
|
47
49
|
return null;
|
|
@@ -17,11 +17,11 @@ function addVueRef(node, context) {
|
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
19
|
if (refProp.type === 6 /* ATTRIBUTE */) {
|
|
20
|
-
refProp.name = '
|
|
20
|
+
refProp.name = 'u-' + utils_1.VUE_REF;
|
|
21
21
|
}
|
|
22
22
|
else {
|
|
23
23
|
;
|
|
24
|
-
refProp.arg.content = '
|
|
24
|
+
refProp.arg.content = 'u-' + utils_1.VUE_REF;
|
|
25
25
|
}
|
|
26
26
|
return (0, utils_1.addStaticClass)(node,
|
|
27
27
|
// ref-in-for
|
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-3030020211201003",
|
|
4
4
|
"description": "@dcloudio/uni-cli-shared",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@babel/parser": "^7.15.0",
|
|
22
22
|
"@babel/types": "^7.15.0",
|
|
23
|
-
"@dcloudio/uni-i18n": "3.0.0-alpha-
|
|
24
|
-
"@dcloudio/uni-shared": "3.0.0-alpha-
|
|
23
|
+
"@dcloudio/uni-i18n": "3.0.0-alpha-3030020211201003",
|
|
24
|
+
"@dcloudio/uni-shared": "3.0.0-alpha-3030020211201003",
|
|
25
25
|
"@rollup/pluginutils": "^4.1.1",
|
|
26
26
|
"@vue/compiler-core": "3.2.23",
|
|
27
27
|
"@vue/compiler-dom": "3.2.23",
|