@dcloudio/uni-cli-shared 3.0.0-alpha-3040520220408001 → 3.0.0-alpha-3040520220413002

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.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { LogErrorOptions } from 'vite';
1
+ import type { LogErrorOptions } from 'vite';
2
2
  import { Formatter } from '../logs/format';
3
3
  export declare function formatAtFilename(filename: string, line?: number, column?: number): string;
4
4
  export declare const h5ServeFormatter: Formatter;
package/dist/hbx/log.js CHANGED
@@ -4,9 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.errorFormatter = exports.removeWarnFormatter = exports.removeInfoFormatter = exports.h5ServeFormatter = exports.formatAtFilename = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
7
8
  const path_1 = __importDefault(require("path"));
8
9
  const picocolors_1 = __importDefault(require("picocolors"));
9
10
  const utils_1 = require("../utils");
11
+ const constants_1 = require("../constants");
12
+ const ast_1 = require("../vite/utils/ast");
13
+ const utils_2 = require("../vite/plugins/vitejs/utils");
10
14
  const SIGNAL_H5_LOCAL = ' > Local:';
11
15
  const SIGNAL_H5_NETWORK = ' > Network:';
12
16
  const networkLogs = [];
@@ -75,6 +79,23 @@ function buildErrorMessage(err, args = [], includeStack = true) {
75
79
  var _a, _b;
76
80
  if (err.plugin) {
77
81
  args.push(`${picocolors_1.default.magenta('[plugin:' + err.plugin + ']')} ${picocolors_1.default.red(err.message)}`);
82
+ if (err.loc &&
83
+ err.hook === 'transform' &&
84
+ err.plugin === 'rollup-plugin-dynamic-import-variables' &&
85
+ err.id &&
86
+ constants_1.EXTNAME_VUE_RE.test(err.id)) {
87
+ try {
88
+ const ast = (0, ast_1.parseVue)(fs_1.default.readFileSync(err.id, 'utf8'), []);
89
+ const scriptNode = ast.children.find((node) => node.type === 1 /* ELEMENT */ && node.tag === 'script');
90
+ if (scriptNode) {
91
+ const scriptLoc = scriptNode.loc;
92
+ args.push(picocolors_1.default.yellow(pad((0, utils_2.generateCodeFrame)(scriptLoc.source, err.loc))));
93
+ // correct error location
94
+ err.loc.line = scriptLoc.start.line + err.loc.line - 1;
95
+ }
96
+ }
97
+ catch (e) { }
98
+ }
78
99
  }
79
100
  else {
80
101
  args.push(picocolors_1.default.red(err.message));
@@ -10,6 +10,7 @@ export declare const M: {
10
10
  readonly 'dev.watching.end.pages': "DONE Build complete. PAGES:{pages}";
11
11
  readonly 'dev.watching.end.files': "DONE Build complete. FILES:{files}";
12
12
  readonly 'stat.warn.appid': "当前应用未配置 appid,无法使用 uni 统计,详情参考:https://ask.dcloud.net.cn/article/36303";
13
+ readonly 'stat.warn.version': "当前应用未配置uni统计版本,默认使用1.0版本;建议使用uni统计2.0版本 ,私有部署数据更安全,代码开源可定制。详情:https://uniapp.dcloud.io/uni-stat";
13
14
  readonly 'i18n.fallbackLocale.default': "当前应用未在 manifest.json 配置 fallbackLocale,默认使用:{locale}";
14
15
  readonly 'i18n.fallbackLocale.missing': "当前应用配置的 fallbackLocale 或 locale 为:{locale},但 locale 目录缺少该语言文件";
15
16
  readonly 'easycom.conflict': "easycom组件冲突:";
@@ -13,6 +13,7 @@ exports.M = {
13
13
  'dev.watching.end.pages': 'DONE Build complete. PAGES:{pages}',
14
14
  'dev.watching.end.files': 'DONE Build complete. FILES:{files}',
15
15
  'stat.warn.appid': '当前应用未配置 appid,无法使用 uni 统计,详情参考:https://ask.dcloud.net.cn/article/36303',
16
+ 'stat.warn.version': '当前应用未配置uni统计版本,默认使用1.0版本;建议使用uni统计2.0版本 ,私有部署数据更安全,代码开源可定制。详情:https://uniapp.dcloud.io/uni-stat',
16
17
  'i18n.fallbackLocale.default': '当前应用未在 manifest.json 配置 fallbackLocale,默认使用:{locale}',
17
18
  'i18n.fallbackLocale.missing': '当前应用配置的 fallbackLocale 或 locale 为:{locale},但 locale 目录缺少该语言文件',
18
19
  'easycom.conflict': 'easycom组件冲突:',
package/dist/resolve.d.ts CHANGED
@@ -3,4 +3,5 @@ export declare function relativeFile(from: string, to: string): string;
3
3
  export declare const resolveMainPathOnce: (inputDir: string) => string;
4
4
  export declare function getBuiltInPaths(): string[];
5
5
  export declare function resolveBuiltIn(path: string): string;
6
+ export declare function resolveVueI18nRuntime(): string;
6
7
  export declare function resolveComponentsLibPath(): string;
package/dist/resolve.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.resolveComponentsLibPath = exports.resolveBuiltIn = exports.getBuiltInPaths = exports.resolveMainPathOnce = exports.relativeFile = exports.requireResolve = void 0;
6
+ exports.resolveComponentsLibPath = exports.resolveVueI18nRuntime = exports.resolveBuiltIn = exports.getBuiltInPaths = exports.resolveMainPathOnce = exports.relativeFile = exports.requireResolve = void 0;
7
7
  const fs_1 = __importDefault(require("fs"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const debug_1 = __importDefault(require("debug"));
@@ -87,6 +87,10 @@ function resolveBuiltIn(path) {
87
87
  return require.resolve(path, { paths: getBuiltInPaths() });
88
88
  }
89
89
  exports.resolveBuiltIn = resolveBuiltIn;
90
+ function resolveVueI18nRuntime() {
91
+ return path_1.default.resolve(__dirname, '../lib/vue-i18n/dist/vue-i18n.runtime.esm-bundler.js');
92
+ }
93
+ exports.resolveVueI18nRuntime = resolveVueI18nRuntime;
90
94
  let componentsLibPath = '';
91
95
  function resolveComponentsLibPath() {
92
96
  if (!componentsLibPath) {
package/lib/.DS_Store ADDED
Binary file
Binary file