@dcloudio/uni-cli-shared 3.0.0-alpha-3030820220114001 → 3.0.0-alpha-3030820220114002

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/hbx/log.js CHANGED
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.errorFormatter = exports.removeWarnFormatter = exports.removeInfoFormatter = exports.h5ServeFormatter = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
- const chalk_1 = __importDefault(require("chalk"));
8
+ const picocolors_1 = __importDefault(require("picocolors"));
9
9
  const utils_1 = require("../utils");
10
10
  const SIGNAL_H5_LOCAL = ' > Local:';
11
11
  const SIGNAL_H5_NETWORK = ' > Network:';
@@ -66,20 +66,20 @@ exports.errorFormatter = {
66
66
  function buildErrorMessage(err, args = [], includeStack = true) {
67
67
  var _a, _b;
68
68
  if (err.plugin) {
69
- args.push(`${chalk_1.default.magenta('[plugin:' + err.plugin + ']')} ${chalk_1.default.red(err.message)}`);
69
+ args.push(`${picocolors_1.default.magenta('[plugin:' + err.plugin + ']')} ${picocolors_1.default.red(err.message)}`);
70
70
  }
71
71
  else {
72
- args.push(chalk_1.default.red(err.message));
72
+ args.push(picocolors_1.default.red(err.message));
73
73
  }
74
74
  if (err.id) {
75
- args.push(`at ${chalk_1.default.cyan((0, utils_1.normalizePath)(path_1.default.relative(process.env.UNI_INPUT_DIR, err.id.split('?')[0])) +
75
+ args.push(`at ${picocolors_1.default.cyan((0, utils_1.normalizePath)(path_1.default.relative(process.env.UNI_INPUT_DIR, err.id.split('?')[0])) +
76
76
  ':' +
77
77
  (((_a = err.loc) === null || _a === void 0 ? void 0 : _a.line) || 1) +
78
78
  ':' +
79
79
  (((_b = err.loc) === null || _b === void 0 ? void 0 : _b.column) || 0))}`);
80
80
  }
81
81
  if (err.frame) {
82
- args.push(chalk_1.default.yellow(pad(err.frame)));
82
+ args.push(picocolors_1.default.yellow(pad(err.frame)));
83
83
  }
84
84
  if (includeStack && err.stack) {
85
85
  args.push(pad(cleanStack(err.stack)));
@@ -131,8 +131,8 @@ function initManifestFeature({ manifestJson, command, platform, }) {
131
131
  };
132
132
  if (command === 'build') {
133
133
  // TODO 需要预编译一遍?
134
- features.wxs = false;
135
- features.longpress = false;
134
+ // features.wxs = false
135
+ // features.longpress = false
136
136
  }
137
137
  if (manifestJson.h5 &&
138
138
  manifestJson.h5.router &&
@@ -26,7 +26,7 @@ exports.minifyCSS = exports.cssUrlRE = exports.cssPostPlugin = exports.cssPlugin
26
26
  const fs_1 = __importDefault(require("fs"));
27
27
  const path_1 = __importDefault(require("path"));
28
28
  const fast_glob_1 = __importDefault(require("fast-glob"));
29
- const chalk_1 = __importDefault(require("chalk"));
29
+ const picocolors_1 = __importDefault(require("picocolors"));
30
30
  const postcss_load_config_1 = __importDefault(require("postcss-load-config"));
31
31
  const pluginutils_1 = require("@rollup/pluginutils");
32
32
  const utils_1 = require("../utils");
@@ -396,7 +396,7 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
396
396
  column: message.column,
397
397
  })}`;
398
398
  }
399
- config.logger.warn(chalk_1.default.yellow(msg));
399
+ config.logger.warn(picocolors_1.default.yellow(msg));
400
400
  }
401
401
  }
402
402
  return {
@@ -505,7 +505,7 @@ async function minifyCSS(css, config) {
505
505
  });
506
506
  if (warnings.length) {
507
507
  const msgs = await (0, esbuild_1.formatMessages)(warnings, { kind: 'warning' });
508
- config.logger.warn(chalk_1.default.yellow(`warnings when minifying css:\n${msgs.join('\n')}`));
508
+ config.logger.warn(picocolors_1.default.yellow(`warnings when minifying css:\n${msgs.join('\n')}`));
509
509
  }
510
510
  return code;
511
511
  }
@@ -11,6 +11,17 @@ export declare function parseVueRequest(id: string): {
11
11
  query: VueQuery;
12
12
  };
13
13
  export declare const isImportRequest: (url: string) => boolean;
14
+ /**
15
+ * Prefix for resolved fs paths, since windows paths may not be valid as URLs.
16
+ */
17
+ export declare const FS_PREFIX = "/@fs/";
18
+ /**
19
+ * Prefix for resolved Ids that are not valid browser import specifiers
20
+ */
21
+ export declare const VALID_ID_PREFIX = "/@id/";
22
+ export declare const CLIENT_PUBLIC_PATH = "/@vite/client";
23
+ export declare const ENV_PUBLIC_PATH = "/@vite/env";
24
+ export declare const isInternalRequest: (url: string) => boolean;
14
25
  export declare const queryRE: RegExp;
15
26
  export declare const hashRE: RegExp;
16
27
  export declare const cleanUrl: (url: string) => string;
@@ -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.isJsFile = exports.cleanUrl = exports.hashRE = exports.queryRE = exports.isImportRequest = exports.parseVueRequest = void 0;
6
+ exports.isJsFile = exports.cleanUrl = exports.hashRE = exports.queryRE = exports.isInternalRequest = exports.ENV_PUBLIC_PATH = exports.CLIENT_PUBLIC_PATH = exports.VALID_ID_PREFIX = exports.FS_PREFIX = exports.isImportRequest = exports.parseVueRequest = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
8
  const querystring_1 = __importDefault(require("querystring"));
9
9
  const constants_1 = require("../../constants");
@@ -28,9 +28,28 @@ function parseVueRequest(id) {
28
28
  };
29
29
  }
30
30
  exports.parseVueRequest = parseVueRequest;
31
- const importQueryRE = /(\?|&)import(?:&|$)/;
31
+ const importQueryRE = /(\?|&)import=?(?:&|$)/;
32
32
  const isImportRequest = (url) => importQueryRE.test(url);
33
33
  exports.isImportRequest = isImportRequest;
34
+ /**
35
+ * Prefix for resolved fs paths, since windows paths may not be valid as URLs.
36
+ */
37
+ exports.FS_PREFIX = `/@fs/`;
38
+ /**
39
+ * Prefix for resolved Ids that are not valid browser import specifiers
40
+ */
41
+ exports.VALID_ID_PREFIX = `/@id/`;
42
+ exports.CLIENT_PUBLIC_PATH = `/@vite/client`;
43
+ exports.ENV_PUBLIC_PATH = `/@vite/env`;
44
+ const internalPrefixes = [
45
+ exports.FS_PREFIX,
46
+ exports.VALID_ID_PREFIX,
47
+ exports.CLIENT_PUBLIC_PATH,
48
+ exports.ENV_PUBLIC_PATH,
49
+ ];
50
+ const InternalPrefixRE = new RegExp(`^(?:${internalPrefixes.join('|')})`);
51
+ const isInternalRequest = (url) => InternalPrefixRE.test(url);
52
+ exports.isInternalRequest = isInternalRequest;
34
53
  exports.queryRE = /\?.*$/;
35
54
  exports.hashRE = /#.*$/;
36
55
  const cleanUrl = (url) => url.replace(exports.hashRE, '').replace(exports.queryRE, '');
@@ -37,6 +37,12 @@ exports.transformMatchMedia = (0, transformTag_1.createTransformTag)({
37
37
  'match-media': 'uni-match-media',
38
38
  });
39
39
  exports.transformTapToClick = (0, transformEvent_1.createTransformEvent)({
40
- tap: 'click',
40
+ tap: (node) => {
41
+ // 地图组件有自己特定的 tap 事件
42
+ if (node.tag === 'map' || node.tag === 'v-uni-map') {
43
+ return 'tap';
44
+ }
45
+ return 'click';
46
+ },
41
47
  });
42
48
  exports.transformComponentLink = (0, transformComponent_1.createTransformComponentLink)(constants_1.COMPONENT_BIND_LINK);
@@ -1,2 +1,2 @@
1
- import { NodeTransform } from '@vue/compiler-core';
2
- export declare function createTransformEvent(options: Record<string, string>): NodeTransform;
1
+ import { DirectiveNode, ElementNode, NodeTransform } from '@vue/compiler-core';
2
+ export declare function createTransformEvent(options: Record<string, string | ((node: ElementNode, dir: DirectiveNode) => string)>): NodeTransform;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createTransformEvent = void 0;
4
+ const shared_1 = require("@vue/shared");
4
5
  const ast_1 = require("../../vite/utils/ast");
5
6
  function createTransformEvent(options) {
6
7
  return function transformEvent(node) {
@@ -13,7 +14,12 @@ function createTransformEvent(options) {
13
14
  const eventType = options[arg.content];
14
15
  if (eventType) {
15
16
  // e.g tap => click
16
- arg.content = eventType;
17
+ if ((0, shared_1.isFunction)(eventType)) {
18
+ arg.content = eventType(node, prop);
19
+ }
20
+ else {
21
+ arg.content = eventType;
22
+ }
17
23
  }
18
24
  }
19
25
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-cli-shared",
3
- "version": "3.0.0-alpha-3030820220114001",
3
+ "version": "3.0.0-alpha-3030820220114002",
4
4
  "description": "@dcloudio/uni-cli-shared",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -21,16 +21,15 @@
21
21
  "@babel/core": "^7.16.5",
22
22
  "@babel/parser": "^7.16.4",
23
23
  "@babel/types": "^7.16.0",
24
- "@dcloudio/uni-i18n": "3.0.0-alpha-3030820220114001",
25
- "@dcloudio/uni-shared": "3.0.0-alpha-3030820220114001",
24
+ "@dcloudio/uni-i18n": "3.0.0-alpha-3030820220114002",
25
+ "@dcloudio/uni-shared": "3.0.0-alpha-3030820220114002",
26
26
  "@rollup/pluginutils": "^4.1.2",
27
- "@vue/compiler-core": "3.2.26",
28
- "@vue/compiler-dom": "3.2.26",
29
- "@vue/compiler-sfc": "3.2.26",
30
- "@vue/server-renderer": "3.2.26",
31
- "@vue/shared": "3.2.26",
27
+ "@vue/compiler-core": "3.2.27",
28
+ "@vue/compiler-dom": "3.2.27",
29
+ "@vue/compiler-sfc": "3.2.27",
30
+ "@vue/server-renderer": "3.2.27",
31
+ "@vue/shared": "3.2.27",
32
32
  "base64url": "^3.0.1",
33
- "chalk": "^4.1.1",
34
33
  "chokidar": "^3.5.2",
35
34
  "compare-versions": "^3.6.0",
36
35
  "debug": "^4.3.2",
@@ -45,6 +44,7 @@
45
44
  "merge": "^2.1.1",
46
45
  "mime": "^3.0.0",
47
46
  "module-alias": "^2.2.2",
47
+ "picocolors": "^1.0.0",
48
48
  "postcss-import": "^14.0.2",
49
49
  "postcss-load-config": "^3.1.0",
50
50
  "postcss-modules": "^4.2.2",