@dcloudio/uni-cli-shared 3.0.0-alpha-3031220220222002 → 3.0.0-alpha-3040020220301001

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,3 +1,4 @@
1
+ export { formatAtFilename } from './log';
1
2
  export * from './env';
2
3
  export { initModuleAlias, installHBuilderXPlugin, formatInstallHBuilderXPluginTips, } from './alias';
3
4
  export declare function uniHBuilderXConsolePlugin(): import("vite").Plugin;
package/dist/hbx/index.js CHANGED
@@ -13,10 +13,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  return (mod && mod.__esModule) ? mod : { "default": mod };
14
14
  };
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.uniHBuilderXConsolePlugin = exports.formatInstallHBuilderXPluginTips = exports.installHBuilderXPlugin = exports.initModuleAlias = void 0;
16
+ exports.uniHBuilderXConsolePlugin = exports.formatInstallHBuilderXPluginTips = exports.installHBuilderXPlugin = exports.initModuleAlias = exports.formatAtFilename = void 0;
17
17
  const path_1 = __importDefault(require("path"));
18
18
  const utils_1 = require("../utils");
19
19
  const console_1 = require("../vite/plugins/console");
20
+ var log_1 = require("./log");
21
+ Object.defineProperty(exports, "formatAtFilename", { enumerable: true, get: function () { return log_1.formatAtFilename; } });
20
22
  __exportStar(require("./env"), exports);
21
23
  var alias_1 = require("./alias");
22
24
  Object.defineProperty(exports, "initModuleAlias", { enumerable: true, get: function () { return alias_1.initModuleAlias; } });
package/dist/hbx/log.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { LogErrorOptions } from 'vite';
2
2
  import { Formatter } from '../logs/format';
3
+ export declare function formatAtFilename(filename: string, line?: number, column?: number): string;
3
4
  export declare const h5ServeFormatter: Formatter;
4
5
  export declare const removeInfoFormatter: Formatter;
5
6
  export declare const removeWarnFormatter: Formatter;
package/dist/hbx/log.js CHANGED
@@ -3,13 +3,21 @@ 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.errorFormatter = exports.removeWarnFormatter = exports.removeInfoFormatter = exports.h5ServeFormatter = void 0;
6
+ exports.errorFormatter = exports.removeWarnFormatter = exports.removeInfoFormatter = exports.h5ServeFormatter = exports.formatAtFilename = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
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:';
12
12
  const networkLogs = [];
13
+ function formatAtFilename(filename, line, column) {
14
+ return `at ${picocolors_1.default.cyan((0, utils_1.normalizePath)(path_1.default.relative(process.env.UNI_INPUT_DIR, filename.split('?')[0])) +
15
+ ':' +
16
+ (line || 1) +
17
+ ':' +
18
+ (column || 0))}`;
19
+ }
20
+ exports.formatAtFilename = formatAtFilename;
13
21
  exports.h5ServeFormatter = {
14
22
  test(msg) {
15
23
  return msg.includes(SIGNAL_H5_LOCAL) || msg.includes(SIGNAL_H5_NETWORK);
@@ -72,11 +80,7 @@ function buildErrorMessage(err, args = [], includeStack = true) {
72
80
  args.push(picocolors_1.default.red(err.message));
73
81
  }
74
82
  if (err.id) {
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
- ':' +
77
- (((_a = err.loc) === null || _a === void 0 ? void 0 : _a.line) || 1) +
78
- ':' +
79
- (((_b = err.loc) === null || _b === void 0 ? void 0 : _b.column) || 0))}`);
83
+ args.push(formatAtFilename(err.id, (_a = err.loc) === null || _a === void 0 ? void 0 : _a.line, (_b = err.loc) === null || _b === void 0 ? void 0 : _b.column));
80
84
  }
81
85
  if (err.frame) {
82
86
  args.push(picocolors_1.default.yellow(pad(err.frame)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-cli-shared",
3
- "version": "3.0.0-alpha-3031220220222002",
3
+ "version": "3.0.0-alpha-3040020220301001",
4
4
  "description": "@dcloudio/uni-cli-shared",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -21,8 +21,8 @@
21
21
  "@babel/core": "^7.17.2",
22
22
  "@babel/parser": "^7.16.4",
23
23
  "@babel/types": "^7.16.8",
24
- "@dcloudio/uni-i18n": "3.0.0-alpha-3031220220222002",
25
- "@dcloudio/uni-shared": "3.0.0-alpha-3031220220222002",
24
+ "@dcloudio/uni-i18n": "3.0.0-alpha-3040020220301001",
25
+ "@dcloudio/uni-shared": "3.0.0-alpha-3040020220301001",
26
26
  "@rollup/pluginutils": "^4.1.2",
27
27
  "@vue/compiler-core": "3.2.31",
28
28
  "@vue/compiler-dom": "3.2.31",