@dcloudio/uni-cli-shared 3.0.0-alpha-3030020211130002 → 3.0.0-alpha-3030020211201001

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.
@@ -1,4 +1,4 @@
1
1
  export * from './jsonFile';
2
2
  export { AppJson } from './types';
3
- export { parseMiniProgramPagesJson } from './pages';
3
+ export { mergeMiniProgramAppJson, parseMiniProgramPagesJson } from './pages';
4
4
  export { parseMiniProgramProjectJson } from './project';
@@ -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; } });
@@ -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 {};
@@ -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 {};
@@ -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);
@@ -17,11 +17,11 @@ function addVueRef(node, context) {
17
17
  return;
18
18
  }
19
19
  if (refProp.type === 6 /* ATTRIBUTE */) {
20
- refProp.name = 'data-' + utils_1.VUE_REF;
20
+ refProp.name = 'u-' + utils_1.VUE_REF;
21
21
  }
22
22
  else {
23
23
  ;
24
- refProp.arg.content = 'data-' + utils_1.VUE_REF;
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-3030020211130002",
3
+ "version": "3.0.0-alpha-3030020211201001",
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-3030020211130002",
24
- "@dcloudio/uni-shared": "3.0.0-alpha-3030020211130002",
23
+ "@dcloudio/uni-i18n": "3.0.0-alpha-3030020211201001",
24
+ "@dcloudio/uni-shared": "3.0.0-alpha-3030020211201001",
25
25
  "@rollup/pluginutils": "^4.1.1",
26
26
  "@vue/compiler-core": "3.2.23",
27
27
  "@vue/compiler-dom": "3.2.23",