@dcloudio/uni-cli-shared 3.0.0-alpha-3060920221117001 → 3.0.0-alpha-3060920221117002

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.
@@ -157,6 +157,7 @@ function getMac() {
157
157
  else if (
158
158
  // Node >= v18
159
159
  typeof item.family === 'number' &&
160
+ // @ts-ignore
160
161
  (item.family === 4 || item.family === 6)) {
161
162
  mac = item.mac;
162
163
  break;
package/dist/hbx/env.js CHANGED
@@ -45,22 +45,30 @@ function initModulePaths() {
45
45
  };
46
46
  }
47
47
  exports.initModulePaths = initModulePaths;
48
+ function resolveEsbuildModule(name) {
49
+ try {
50
+ return path_1.default.dirname(require.resolve(name + '/package.json', {
51
+ paths: [path_1.default.dirname((0, resolve_1.resolveBuiltIn)('esbuild/package.json'))],
52
+ }));
53
+ }
54
+ catch (e) { }
55
+ return '';
56
+ }
48
57
  function fixBinaryPath() {
49
58
  // cli 工程在 HBuilderX 中运行
50
59
  if (!(0, exports.isInHBuilderX)() && (0, exports.runByHBuilderX)()) {
51
- if (!utils_1.isWindows) {
52
- process.env.ESBUILD_BINARY_PATH = path_1.default.join((0, resolve_1.resolveBuiltIn)('esbuild/package.json'), '../bin/esbuild');
53
- }
54
- try {
55
- if (utils_1.isWindows) {
56
- process.env.UTS_BINARY_PATH = (0, resolve_1.resolveBuiltIn)('@dcloudio/uts-win32-x64-msvc');
60
+ if (utils_1.isWindows) {
61
+ const win64 = resolveEsbuildModule('esbuild-windows-64');
62
+ if (win64) {
63
+ process.env.ESBUILD_BINARY_PATH = path_1.default.join(win64, 'esbuild.exe');
57
64
  }
58
- else {
59
- // 强制使用 arm64 也不行,会报错:have 'arm64', need 'x86_64'
60
- // process.env.UTS_BINARY_PATH = resolveBuiltIn('@dcloudio/uts-darwin-arm64')
65
+ }
66
+ else {
67
+ const arm64 = resolveEsbuildModule('esbuild-darwin-arm64');
68
+ if (arm64) {
69
+ process.env.ESBUILD_BINARY_PATH = path_1.default.join(arm64, 'bin/esbuild');
61
70
  }
62
71
  }
63
- catch (e) { }
64
72
  }
65
73
  }
66
74
  exports.fixBinaryPath = fixBinaryPath;
package/dist/uts.js CHANGED
@@ -81,14 +81,20 @@ function resolveUTSCompiler() {
81
81
  }
82
82
  catch (e) { }
83
83
  }
84
- try {
85
- compilerPath = require.resolve('@dcloudio/uni-uts-v1', {
86
- paths: [process.env.UNI_CLI_CONTEXT],
87
- });
88
- }
89
- catch (e) {
90
- console.error((0, utils_1.installDepTips)('devDependencies', '@dcloudio/uni-uts-v1', require('@dcloudio/uni-cli-shared/package.json').version));
91
- process.exit(0);
84
+ if (!compilerPath) {
85
+ try {
86
+ compilerPath = require.resolve('@dcloudio/uni-uts-v1', {
87
+ paths: [process.env.UNI_CLI_CONTEXT],
88
+ });
89
+ }
90
+ catch (e) {
91
+ let version = require('@dcloudio/uni-cli-shared/package.json').version;
92
+ if (version.startsWith('2.0.')) {
93
+ version = '^3.0.0-alpha-3060920221117001';
94
+ }
95
+ console.error((0, utils_1.installDepTips)('devDependencies', '@dcloudio/uni-uts-v1', version));
96
+ process.exit(0);
97
+ }
92
98
  }
93
99
  return require(compilerPath);
94
100
  }
@@ -112,7 +112,7 @@ async function processSrcSet(srcs, replacer) {
112
112
  const src = s.replace(escapedSpaceCharacters, ' ').trim();
113
113
  const [url] = imageSetUrlRE.exec(src) || [];
114
114
  return {
115
- url,
115
+ url: url,
116
116
  descriptor: src === null || src === void 0 ? void 0 : src.slice(url.length).trim(),
117
117
  };
118
118
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-cli-shared",
3
- "version": "3.0.0-alpha-3060920221117001",
3
+ "version": "3.0.0-alpha-3060920221117002",
4
4
  "description": "@dcloudio/uni-cli-shared",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -25,8 +25,8 @@
25
25
  "@babel/core": "^7.19.6",
26
26
  "@babel/parser": "^7.19.6",
27
27
  "@babel/types": "^7.20.0",
28
- "@dcloudio/uni-i18n": "3.0.0-alpha-3060920221117001",
29
- "@dcloudio/uni-shared": "3.0.0-alpha-3060920221117001",
28
+ "@dcloudio/uni-i18n": "3.0.0-alpha-3060920221117002",
29
+ "@dcloudio/uni-shared": "3.0.0-alpha-3060920221117002",
30
30
  "@intlify/core-base": "9.1.9",
31
31
  "@intlify/shared": "9.1.9",
32
32
  "@intlify/vue-devtools": "9.1.9",
@@ -64,7 +64,7 @@
64
64
  },
65
65
  "gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
66
66
  "devDependencies": {
67
- "@dcloudio/uni-uts-v1": "3.0.0-alpha-3060920221117001",
67
+ "@dcloudio/uni-uts-v1": "3.0.0-alpha-3060920221117002",
68
68
  "@types/babel__core": "^7.1.19",
69
69
  "@types/debug": "^4.1.7",
70
70
  "@types/estree": "^0.0.51",