@dcloudio/uni-cli-shared 3.0.0-alpha-4070720250804001 → 3.0.0-alpha-4070620250731002

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.
Files changed (163) hide show
  1. package/dist/easycom.d.ts +0 -1
  2. package/dist/easycom.js +13 -17
  3. package/dist/hbx/alias.js +10 -43
  4. package/dist/hbx/index.js +0 -10
  5. package/dist/hbx/log.js +1 -23
  6. package/dist/index.d.ts +1 -2
  7. package/dist/index.js +1 -3
  8. package/dist/json/index.d.ts +1 -1
  9. package/dist/json/index.js +1 -2
  10. package/dist/json/manifest.d.ts +0 -1
  11. package/dist/json/manifest.js +1 -11
  12. package/dist/json/mp/jsonFile.js +2 -4
  13. package/dist/json/mp/pages.js +0 -1
  14. package/dist/json/mp/types.d.ts +1 -4
  15. package/dist/json/uni-x/manifest.d.ts +0 -1
  16. package/dist/json/uni-x/manifest.js +1 -5
  17. package/dist/messages/zh_CN.js +0 -1
  18. package/dist/uni_modules.cloud.d.ts +4 -10
  19. package/dist/uni_modules.cloud.js +19 -58
  20. package/dist/uni_modules.d.ts +0 -2
  21. package/dist/uni_modules.js +2 -81
  22. package/dist/uts.js +0 -16
  23. package/dist/vite/autoImport.js +0 -2
  24. package/dist/vite/cloud.js +5 -51
  25. package/dist/vite/plugins/index.d.ts +0 -1
  26. package/dist/vite/plugins/index.js +1 -3
  27. package/dist/vite/plugins/inject.js +1 -3
  28. package/dist/vite/plugins/uts/uni_modules.d.ts +0 -1
  29. package/dist/vite/plugins/uts/uni_modules.js +14 -63
  30. package/dist/vite/plugins/uts/uvue.js +3 -17
  31. package/dist/vite/plugins/vitejs/plugins/css.js +5 -40
  32. package/dist/vue/transforms/transformUTSComponent.js +3 -8
  33. package/package.json +38 -38
  34. package/dist/vite/plugins/stats.d.ts +0 -2
  35. package/dist/vite/plugins/stats.js +0 -42
  36. package/dist/workers.d.ts +0 -14
  37. package/dist/workers.js +0 -187
  38. package/lib/vapor/@vitejs/plugin-vue/LICENSE +0 -21
  39. package/lib/vapor/@vitejs/plugin-vue/README.md +0 -278
  40. package/lib/vapor/@vitejs/plugin-vue/dist/index.cjs +0 -3105
  41. package/lib/vapor/@vitejs/plugin-vue/dist/index.d.cts +0 -113
  42. package/lib/vapor/@vitejs/plugin-vue/dist/index.d.mts +0 -111
  43. package/lib/vapor/@vitejs/plugin-vue/dist/index.d.ts +0 -113
  44. package/lib/vapor/@vitejs/plugin-vue/dist/index.mjs +0 -3090
  45. package/lib/vapor/@vitejs/plugin-vue/package.json +0 -50
  46. package/lib/vapor/@vue/compiler-core/LICENSE +0 -21
  47. package/lib/vapor/@vue/compiler-core/README.md +0 -1
  48. package/lib/vapor/@vue/compiler-core/dist/compiler-core.cjs.js +0 -6902
  49. package/lib/vapor/@vue/compiler-core/dist/compiler-core.cjs.prod.js +0 -6779
  50. package/lib/vapor/@vue/compiler-core/dist/compiler-core.esm-bundler.js +0 -5870
  51. package/lib/vapor/@vue/compiler-core/index.js +0 -7
  52. package/lib/vapor/@vue/compiler-core/package.json +0 -58
  53. package/lib/vapor/@vue/compiler-dom/LICENSE +0 -21
  54. package/lib/vapor/@vue/compiler-dom/README.md +0 -1
  55. package/lib/vapor/@vue/compiler-dom/dist/compiler-dom.cjs.js +0 -936
  56. package/lib/vapor/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +0 -856
  57. package/lib/vapor/@vue/compiler-dom/dist/compiler-dom.esm-browser.js +0 -6682
  58. package/lib/vapor/@vue/compiler-dom/dist/compiler-dom.esm-browser.prod.js +0 -14
  59. package/lib/vapor/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js +0 -693
  60. package/lib/vapor/@vue/compiler-dom/dist/compiler-dom.global.js +0 -6855
  61. package/lib/vapor/@vue/compiler-dom/dist/compiler-dom.global.prod.js +0 -14
  62. package/lib/vapor/@vue/compiler-dom/index.js +0 -7
  63. package/lib/vapor/@vue/compiler-dom/package.json +0 -57
  64. package/lib/vapor/@vue/compiler-sfc/LICENSE +0 -21
  65. package/lib/vapor/@vue/compiler-sfc/README.md +0 -80
  66. package/lib/vapor/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +0 -21682
  67. package/lib/vapor/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js +0 -66272
  68. package/lib/vapor/@vue/compiler-sfc/package.json +0 -68
  69. package/lib/vapor/@vue/compiler-ssr/LICENSE +0 -21
  70. package/lib/vapor/@vue/compiler-ssr/README.md +0 -1
  71. package/lib/vapor/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +0 -1402
  72. package/lib/vapor/@vue/compiler-ssr/package.json +0 -34
  73. package/lib/vapor/@vue/compiler-vapor/LICENSE +0 -21
  74. package/lib/vapor/@vue/compiler-vapor/README.md +0 -1
  75. package/lib/vapor/@vue/compiler-vapor/dist/compiler-vapor.cjs.js +0 -4540
  76. package/lib/vapor/@vue/compiler-vapor/dist/compiler-vapor.esm-browser.js +0 -37020
  77. package/lib/vapor/@vue/compiler-vapor/package.json +0 -49
  78. package/lib/vapor/@vue/reactivity/LICENSE +0 -21
  79. package/lib/vapor/@vue/reactivity/README.md +0 -19
  80. package/lib/vapor/@vue/reactivity/dist/reactivity.cjs.js +0 -2033
  81. package/lib/vapor/@vue/reactivity/dist/reactivity.cjs.prod.js +0 -1841
  82. package/lib/vapor/@vue/reactivity/dist/reactivity.esm-browser.js +0 -2023
  83. package/lib/vapor/@vue/reactivity/dist/reactivity.esm-browser.prod.js +0 -5
  84. package/lib/vapor/@vue/reactivity/dist/reactivity.esm-bundler.js +0 -1992
  85. package/lib/vapor/@vue/reactivity/dist/reactivity.global.js +0 -2082
  86. package/lib/vapor/@vue/reactivity/dist/reactivity.global.prod.js +0 -5
  87. package/lib/vapor/@vue/reactivity/index.js +0 -7
  88. package/lib/vapor/@vue/reactivity/package.json +0 -55
  89. package/lib/vapor/@vue/runtime-core/LICENSE +0 -21
  90. package/lib/vapor/@vue/runtime-core/README.md +0 -28
  91. package/lib/vapor/@vue/runtime-core/dist/runtime-core.cjs.js +0 -8972
  92. package/lib/vapor/@vue/runtime-core/dist/runtime-core.cjs.prod.js +0 -7088
  93. package/lib/vapor/@vue/runtime-core/dist/runtime-core.esm-bundler.js +0 -8913
  94. package/lib/vapor/@vue/runtime-core/index.js +0 -7
  95. package/lib/vapor/@vue/runtime-core/package.json +0 -54
  96. package/lib/vapor/@vue/runtime-dom/LICENSE +0 -21
  97. package/lib/vapor/@vue/runtime-dom/README.md +0 -13
  98. package/lib/vapor/@vue/runtime-dom/dist/runtime-dom.cjs.js +0 -1797
  99. package/lib/vapor/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +0 -1646
  100. package/lib/vapor/@vue/runtime-dom/dist/runtime-dom.esm-browser.js +0 -12929
  101. package/lib/vapor/@vue/runtime-dom/dist/runtime-dom.esm-browser.prod.js +0 -6
  102. package/lib/vapor/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js +0 -1838
  103. package/lib/vapor/@vue/runtime-dom/dist/runtime-dom.global.js +0 -13086
  104. package/lib/vapor/@vue/runtime-dom/dist/runtime-dom.global.prod.js +0 -6
  105. package/lib/vapor/@vue/runtime-dom/index.js +0 -7
  106. package/lib/vapor/@vue/runtime-dom/package.json +0 -60
  107. package/lib/vapor/@vue/runtime-vapor/LICENSE +0 -21
  108. package/lib/vapor/@vue/runtime-vapor/README.md +0 -8
  109. package/lib/vapor/@vue/runtime-vapor/dist/runtime-vapor.esm-bundler.js +0 -3242
  110. package/lib/vapor/@vue/runtime-vapor/package.json +0 -47
  111. package/lib/vapor/@vue/server-renderer/LICENSE +0 -21
  112. package/lib/vapor/@vue/server-renderer/README.md +0 -178
  113. package/lib/vapor/@vue/server-renderer/dist/server-renderer.cjs.js +0 -1144
  114. package/lib/vapor/@vue/server-renderer/dist/server-renderer.cjs.prod.js +0 -871
  115. package/lib/vapor/@vue/server-renderer/dist/server-renderer.esm-browser.js +0 -8756
  116. package/lib/vapor/@vue/server-renderer/dist/server-renderer.esm-browser.prod.js +0 -5
  117. package/lib/vapor/@vue/server-renderer/dist/server-renderer.esm-bundler.js +0 -1366
  118. package/lib/vapor/@vue/server-renderer/index.js +0 -7
  119. package/lib/vapor/@vue/server-renderer/package.json +0 -55
  120. package/lib/vapor/@vue/shared/LICENSE +0 -21
  121. package/lib/vapor/@vue/shared/README.md +0 -3
  122. package/lib/vapor/@vue/shared/dist/shared.cjs.js +0 -698
  123. package/lib/vapor/@vue/shared/dist/shared.cjs.prod.js +0 -690
  124. package/lib/vapor/@vue/shared/dist/shared.esm-bundler.js +0 -616
  125. package/lib/vapor/@vue/shared/index.js +0 -7
  126. package/lib/vapor/@vue/shared/package.json +0 -47
  127. package/lib/vapor/@vue/vue/LICENSE +0 -21
  128. package/lib/vapor/@vue/vue/README.md +0 -62
  129. package/lib/vapor/@vue/vue/compiler-sfc/index.browser.js +0 -1
  130. package/lib/vapor/@vue/vue/compiler-sfc/index.browser.mjs +0 -1
  131. package/lib/vapor/@vue/vue/compiler-sfc/index.d.mts +0 -1
  132. package/lib/vapor/@vue/vue/compiler-sfc/index.d.ts +0 -1
  133. package/lib/vapor/@vue/vue/compiler-sfc/index.js +0 -3
  134. package/lib/vapor/@vue/vue/compiler-sfc/index.mjs +0 -3
  135. package/lib/vapor/@vue/vue/compiler-sfc/package.json +0 -4
  136. package/lib/vapor/@vue/vue/compiler-sfc/register-ts.js +0 -3
  137. package/lib/vapor/@vue/vue/dist/vue.cjs.js +0 -80
  138. package/lib/vapor/@vue/vue/dist/vue.cjs.prod.js +0 -66
  139. package/lib/vapor/@vue/vue/dist/vue.esm-browser.js +0 -18840
  140. package/lib/vapor/@vue/vue/dist/vue.esm-browser.prod.js +0 -12
  141. package/lib/vapor/@vue/vue/dist/vue.esm-bundler.js +0 -72
  142. package/lib/vapor/@vue/vue/dist/vue.global.js +0 -18820
  143. package/lib/vapor/@vue/vue/dist/vue.global.prod.js +0 -12
  144. package/lib/vapor/@vue/vue/dist/vue.runtime-with-vapor.esm-browser.js +0 -15648
  145. package/lib/vapor/@vue/vue/dist/vue.runtime-with-vapor.esm-browser.prod.js +0 -9
  146. package/lib/vapor/@vue/vue/dist/vue.runtime.esm-browser.js +0 -12953
  147. package/lib/vapor/@vue/vue/dist/vue.runtime.esm-browser.prod.js +0 -6
  148. package/lib/vapor/@vue/vue/dist/vue.runtime.esm-bundler.js +0 -29
  149. package/lib/vapor/@vue/vue/dist/vue.runtime.global.js +0 -13111
  150. package/lib/vapor/@vue/vue/dist/vue.runtime.global.prod.js +0 -6
  151. package/lib/vapor/@vue/vue/index.js +0 -7
  152. package/lib/vapor/@vue/vue/index.mjs +0 -1
  153. package/lib/vapor/@vue/vue/jsx-runtime/index.d.ts +0 -25
  154. package/lib/vapor/@vue/vue/jsx-runtime/index.js +0 -15
  155. package/lib/vapor/@vue/vue/jsx-runtime/index.mjs +0 -12
  156. package/lib/vapor/@vue/vue/jsx-runtime/package.json +0 -5
  157. package/lib/vapor/@vue/vue/jsx.d.ts +0 -22
  158. package/lib/vapor/@vue/vue/package.json +0 -114
  159. package/lib/vapor/@vue/vue/server-renderer/index.d.mts +0 -1
  160. package/lib/vapor/@vue/vue/server-renderer/index.d.ts +0 -1
  161. package/lib/vapor/@vue/vue/server-renderer/index.js +0 -1
  162. package/lib/vapor/@vue/vue/server-renderer/index.mjs +0 -1
  163. package/lib/vapor/@vue/vue/server-renderer/package.json +0 -4
package/dist/easycom.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  interface EasycomOption {
2
- platform: UniApp.PLATFORM;
3
2
  isX?: boolean;
4
3
  dirs?: string[];
5
4
  rootDir: string;
package/dist/easycom.js CHANGED
@@ -32,7 +32,6 @@ function initEasycoms(inputDir, { dirs, platform, isX, }) {
32
32
  // 初始化时,从once中读取缓存,refresh时,实时读取
33
33
  const { easycom } = pagesJson || (0, pages_1.parsePagesJson)(inputDir, platform, false);
34
34
  const easycomOptions = {
35
- platform,
36
35
  isX,
37
36
  dirs: easycom && easycom.autoscan === false
38
37
  ? [...dirs] // 禁止自动扫描
@@ -128,11 +127,11 @@ function initUniModulesEasycomDirs(uniModulesDir, componentsDir = 'components')
128
127
  })
129
128
  .filter(Boolean);
130
129
  }
131
- function initEasycom({ platform, isX, dirs, rootDir, custom, extensions, }) {
130
+ function initEasycom({ isX, dirs, rootDir, custom, extensions, }) {
132
131
  rootDir = (0, utils_1.normalizePath)(rootDir);
133
132
  const easycomsObj = Object.create(null);
134
133
  if (dirs && dirs.length && rootDir) {
135
- const autoEasyComObj = initAutoScanEasycoms(platform, dirs, rootDir, extensions);
134
+ const autoEasyComObj = initAutoScanEasycoms(dirs, rootDir, extensions);
136
135
  if (isX) {
137
136
  Object.keys(autoEasyComObj).forEach((tagName) => {
138
137
  let source = autoEasyComObj[tagName];
@@ -202,7 +201,7 @@ const isDir = (path) => {
202
201
  }
203
202
  return false;
204
203
  };
205
- function initAutoScanEasycom(platform, dir, rootDir, extensions) {
204
+ function initAutoScanEasycom(dir, rootDir, extensions) {
206
205
  if (!path_1.default.isAbsolute(dir)) {
207
206
  dir = path_1.default.resolve(rootDir, dir);
208
207
  }
@@ -210,7 +209,6 @@ function initAutoScanEasycom(platform, dir, rootDir, extensions) {
210
209
  if (!fs_1.default.existsSync(dir)) {
211
210
  return easycoms;
212
211
  }
213
- const isMp = platform.startsWith('mp-');
214
212
  const is_uni_modules = path_1.default.basename(path_1.default.resolve(dir, '../..')) === 'uni_modules';
215
213
  const is_easycom_encrypt_uni_modules = // uni_modules模式不需要此逻辑
216
214
  process.env.UNI_COMPILE_TARGET !== 'uni_modules' &&
@@ -230,26 +228,24 @@ function initAutoScanEasycom(platform, dir, rootDir, extensions) {
230
228
  for (let i = 0; i < extensions.length; i++) {
231
229
  const ext = extensions[i];
232
230
  if (files.includes(name + ext)) {
233
- easycoms[`^${name}$`] =
234
- // mp平台,这里不处理,由uniEntryPlugin处理
235
- is_easycom_encrypt_uni_modules && !isMp
236
- ? (0, utils_1.normalizePath)(path_1.default.join(rootDir, `uni_modules/${uni_modules_plugin_id}?${
237
- // android 走 proxy
238
- process.env.UNI_APP_X === 'true' &&
239
- process.env.UNI_UTS_PLATFORM === 'app-android'
240
- ? 'uts-proxy'
241
- : 'uni_helpers'}`))
242
- : `${importDir}/${name}${ext}`;
231
+ easycoms[`^${name}$`] = is_easycom_encrypt_uni_modules
232
+ ? (0, utils_1.normalizePath)(path_1.default.join(rootDir, `uni_modules/${uni_modules_plugin_id}?${
233
+ // android 走 proxy
234
+ process.env.UNI_APP_X === 'true' &&
235
+ process.env.UNI_UTS_PLATFORM === 'app-android'
236
+ ? 'uts-proxy'
237
+ : 'uni_helpers'}`))
238
+ : `${importDir}/${name}${ext}`;
243
239
  break;
244
240
  }
245
241
  }
246
242
  });
247
243
  return easycoms;
248
244
  }
249
- function initAutoScanEasycoms(platform, dirs, rootDir, extensions) {
245
+ function initAutoScanEasycoms(dirs, rootDir, extensions) {
250
246
  const conflict = {};
251
247
  const res = dirs.reduce((easycoms, dir) => {
252
- const curEasycoms = initAutoScanEasycom(platform, dir, rootDir, extensions);
248
+ const curEasycoms = initAutoScanEasycom(dir, rootDir, extensions);
253
249
  Object.keys(curEasycoms).forEach((name) => {
254
250
  // Use the first component when name conflict
255
251
  const componentPath = easycoms[name];
package/dist/hbx/alias.js CHANGED
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.formatInstallHBuilderXPluginTips = exports.moduleAliasFormatter = exports.installHBuilderXPlugin = exports.initModuleAlias = void 0;
8
- const fs_1 = __importDefault(require("fs"));
9
8
  const path_1 = __importDefault(require("path"));
10
9
  const module_alias_1 = __importDefault(require("module-alias"));
11
10
  const utils_1 = require("./utils");
@@ -20,48 +19,16 @@ function initModuleAlias() {
20
19
  const libDir = path_1.default.resolve(__dirname, '../../lib');
21
20
  const compilerSfcPath = path_1.default.resolve(libDir, '@vue/compiler-sfc');
22
21
  const serverRendererPath = require.resolve('@vue/server-renderer');
23
- // TODO 临时开关启用vapor
24
- if (!process.env.UNI_VUE_VAPOR &&
25
- process.env.UNI_INPUT_DIR &&
26
- // 该代码执行较早,不能使用UNI_UTS_PLATFORM
27
- (process.env.UNI_PLATFORM === 'app-harmony' ||
28
- (process.env.UNI_PLATFORM === 'app' &&
29
- process.env.UNI_APP_PLATFORM === 'ios'))) {
30
- const vaporConfig = path_1.default.resolve(process.env.UNI_INPUT_DIR, '.vapor');
31
- if (fs_1.default.existsSync(vaporConfig)) {
32
- process.env.UNI_VUE_VAPOR = 'true';
33
- if (fs_1.default.readFileSync(vaporConfig, 'utf-8').trim() === '*') {
34
- process.env.UNI_VUE_VAPOR_ALL = 'true';
35
- }
36
- }
37
- }
38
- if (process.env.UNI_VUE_VAPOR === 'true') {
39
- const vuePkgs = [
40
- '@vue/compiler-core',
41
- '@vue/compiler-dom',
42
- '@vue/compiler-sfc',
43
- '@vue/compiler-ssr',
44
- '@vue/compiler-vapor',
45
- '@vue/server-renderer',
46
- '@vue/shared',
47
- ];
48
- vuePkgs.forEach((pkg) => {
49
- module_alias_1.default.addAlias(pkg, path_1.default.resolve(libDir, 'vapor', '@vue', pkg.split('/').pop()));
50
- });
51
- module_alias_1.default.addAlias('@vitejs/plugin-vue', path_1.default.resolve(libDir, 'vapor', '@vitejs', 'plugin-vue'));
52
- }
53
- else {
54
- module_alias_1.default.addAliases({
55
- '@vue/shared': require.resolve('@vue/shared'),
56
- '@vue/shared/dist/shared.esm-bundler.js': require.resolve('@vue/shared/dist/shared.esm-bundler.js'),
57
- '@vue/compiler-core': path_1.default.resolve(libDir, '@vue/compiler-core'),
58
- '@vue/compiler-dom': require.resolve('@vue/compiler-dom'),
59
- '@vue/compiler-sfc': compilerSfcPath,
60
- '@vue/server-renderer': serverRendererPath,
61
- 'vue/compiler-sfc': compilerSfcPath,
62
- 'vue/server-renderer': serverRendererPath,
63
- });
64
- }
22
+ module_alias_1.default.addAliases({
23
+ '@vue/shared': require.resolve('@vue/shared'),
24
+ '@vue/shared/dist/shared.esm-bundler.js': require.resolve('@vue/shared/dist/shared.esm-bundler.js'),
25
+ '@vue/compiler-core': path_1.default.resolve(libDir, '@vue/compiler-core'),
26
+ '@vue/compiler-dom': require.resolve('@vue/compiler-dom'),
27
+ '@vue/compiler-sfc': compilerSfcPath,
28
+ '@vue/server-renderer': serverRendererPath,
29
+ 'vue/compiler-sfc': compilerSfcPath,
30
+ 'vue/server-renderer': serverRendererPath,
31
+ });
65
32
  if (process.env.VITEST) {
66
33
  module_alias_1.default.addAliases({
67
34
  vue: '@dcloudio/uni-h5-vue',
package/dist/hbx/index.js CHANGED
@@ -21,7 +21,6 @@ exports.isEnableConsole = exports.uniHBuilderXConsolePlugin = exports.formatInst
21
21
  const path_1 = __importDefault(require("path"));
22
22
  const utils_1 = require("../utils");
23
23
  const console_1 = require("../vite/plugins/console");
24
- const workers_1 = require("../workers");
25
24
  var log_1 = require("./log");
26
25
  Object.defineProperty(exports, "formatAtFilename", { enumerable: true, get: function () { return log_1.formatAtFilename; } });
27
26
  __exportStar(require("./env"), exports);
@@ -30,17 +29,8 @@ Object.defineProperty(exports, "initModuleAlias", { enumerable: true, get: funct
30
29
  Object.defineProperty(exports, "installHBuilderXPlugin", { enumerable: true, get: function () { return alias_1.installHBuilderXPlugin; } });
31
30
  Object.defineProperty(exports, "formatInstallHBuilderXPluginTips", { enumerable: true, get: function () { return alias_1.formatInstallHBuilderXPluginTips; } });
32
31
  function uniHBuilderXConsolePlugin(method = '__f__') {
33
- const exclude = [];
34
- if (process.env.UNI_APP_X === 'true') {
35
- const workersDir = (0, workers_1.resolveWorkersDir)(process.env.UNI_INPUT_DIR);
36
- if (workersDir) {
37
- // 排除workers目录
38
- exclude.push((0, utils_1.pathToGlob)(path_1.default.join(process.env.UNI_INPUT_DIR, workersDir), '**/*'));
39
- }
40
- }
41
32
  return (0, console_1.uniConsolePlugin)({
42
33
  method,
43
- exclude,
44
34
  filename(filename) {
45
35
  filename = path_1.default.relative(process.env.UNI_INPUT_DIR, filename);
46
36
  if (filename.startsWith('.') || path_1.default.isAbsolute(filename)) {
package/dist/hbx/log.js CHANGED
@@ -125,22 +125,7 @@ exports.errorFormatter = {
125
125
  return buildErrorMessage(opts.error, [], false);
126
126
  },
127
127
  };
128
- const VITE_ROLLUP_FAILED_TO_RESOLVE_IMPORT_RE = /\[vite\]: Rollup failed to resolve import "([^"]+)" from "([^"]+)"/;
129
128
  function buildErrorMessage(err, args = [], includeStack = true) {
130
- if (err.customPrint) {
131
- err.customPrint();
132
- return '';
133
- }
134
- if (VITE_ROLLUP_FAILED_TO_RESOLVE_IMPORT_RE.test(err.message)) {
135
- const [, importPath, fromPath] = err.message.match(VITE_ROLLUP_FAILED_TO_RESOLVE_IMPORT_RE) || [];
136
- err.message = `Could not resolve "${importPath}" from "${fromPath}"`;
137
- err.id = fromPath;
138
- }
139
- // 移除 from 后面的内容
140
- // 主要是处理:Could not resolve "./static/logo1.png" from "../../../../../../Users/xxx/HBuilderProjects/test-x/pages/index/index.uvue?vue&type=script&lang.uts"
141
- if (err.id && err.message.startsWith('Could not resolve ')) {
142
- err.message = err.message.split(' from ')[0];
143
- }
144
129
  if (err.plugin) {
145
130
  // 避免出现这样的错误:[plugin:vite:vue] [plugin vite:vue]
146
131
  if (err.message.startsWith(`[plugin ${err.plugin}]`)) {
@@ -149,7 +134,7 @@ function buildErrorMessage(err, args = [], includeStack = true) {
149
134
  // [plugin:vite:vue] pages/index/index.vue (2:12): v-on="" is not supported
150
135
  const locStr = `(${err.loc.line}:${err.loc.column}):`;
151
136
  if (msg.includes(locStr)) {
152
- msg = msg.split(locStr)[1].trim();
137
+ msg = msg.split(locStr)[1];
153
138
  }
154
139
  }
155
140
  args.push(`${picocolors_1.default.magenta('[plugin:' + err.plugin + ']')} ${picocolors_1.default.red(msg)}`);
@@ -163,13 +148,6 @@ function buildErrorMessage(err, args = [], includeStack = true) {
163
148
  otherMsgs.push(`[plugin:${msg}`);
164
149
  });
165
150
  }
166
- if (err.loc) {
167
- // [plugin:vite:vue] pages/index/index.vue (2:12): v-on="" is not supported
168
- const locStr = `(${err.loc.line}:${err.loc.column}):`;
169
- if (err.message.includes(locStr)) {
170
- err.message = err.message.split(locStr)[1].trim();
171
- }
172
- }
173
151
  args.push(`${picocolors_1.default.magenta('[plugin:' + err.plugin + ']')} ${picocolors_1.default.red(err.message)}`);
174
152
  args.push(...otherMsgs);
175
153
  if (err.loc &&
package/dist/index.d.ts CHANGED
@@ -22,9 +22,8 @@ export * from './resolve';
22
22
  export * from './scripts';
23
23
  export * from './platform';
24
24
  export * from './utsUtils';
25
- export * from './workers';
26
25
  export { parseUniExtApi, parseUniExtApis, parseInjects, Define, DefineOptions, Defines, getUniExtApiProviderRegisters, formatExtApiProviderName, } from './uni_modules';
27
- export { getUniModulesEncryptType, parseUniModulesArtifacts, resolveEncryptUniModule, } from './uni_modules.cloud';
26
+ export { parseUniModulesArtifacts, resolveEncryptUniModule, } from './uni_modules.cloud';
28
27
  import type { EncryptPackageJson } from './uni_modules.cloud';
29
28
  export type EncryptArtifacts = EncryptPackageJson['uni_modules']['artifacts'];
30
29
  export { M } from './messages';
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.checkUpdate = exports.M = exports.resolveEncryptUniModule = exports.parseUniModulesArtifacts = exports.getUniModulesEncryptType = exports.formatExtApiProviderName = exports.getUniExtApiProviderRegisters = exports.parseInjects = exports.parseUniExtApis = exports.parseUniExtApi = void 0;
17
+ exports.checkUpdate = exports.M = exports.resolveEncryptUniModule = exports.parseUniModulesArtifacts = exports.formatExtApiProviderName = exports.getUniExtApiProviderRegisters = exports.parseInjects = exports.parseUniExtApis = exports.parseUniExtApi = void 0;
18
18
  __exportStar(require("./fs"), exports);
19
19
  __exportStar(require("./mp"), exports);
20
20
  __exportStar(require("./url"), exports);
@@ -39,7 +39,6 @@ __exportStar(require("./resolve"), exports);
39
39
  __exportStar(require("./scripts"), exports);
40
40
  __exportStar(require("./platform"), exports);
41
41
  __exportStar(require("./utsUtils"), exports);
42
- __exportStar(require("./workers"), exports);
43
42
  var uni_modules_1 = require("./uni_modules");
44
43
  Object.defineProperty(exports, "parseUniExtApi", { enumerable: true, get: function () { return uni_modules_1.parseUniExtApi; } });
45
44
  Object.defineProperty(exports, "parseUniExtApis", { enumerable: true, get: function () { return uni_modules_1.parseUniExtApis; } });
@@ -47,7 +46,6 @@ Object.defineProperty(exports, "parseInjects", { enumerable: true, get: function
47
46
  Object.defineProperty(exports, "getUniExtApiProviderRegisters", { enumerable: true, get: function () { return uni_modules_1.getUniExtApiProviderRegisters; } });
48
47
  Object.defineProperty(exports, "formatExtApiProviderName", { enumerable: true, get: function () { return uni_modules_1.formatExtApiProviderName; } });
49
48
  var uni_modules_cloud_1 = require("./uni_modules.cloud");
50
- Object.defineProperty(exports, "getUniModulesEncryptType", { enumerable: true, get: function () { return uni_modules_cloud_1.getUniModulesEncryptType; } });
51
49
  Object.defineProperty(exports, "parseUniModulesArtifacts", { enumerable: true, get: function () { return uni_modules_cloud_1.parseUniModulesArtifacts; } });
52
50
  Object.defineProperty(exports, "resolveEncryptUniModule", { enumerable: true, get: function () { return uni_modules_cloud_1.resolveEncryptUniModule; } });
53
51
  var messages_1 = require("./messages");
@@ -4,5 +4,5 @@ export * from './json';
4
4
  export * from './pages';
5
5
  export * from './manifest';
6
6
  export * from './theme';
7
- export { normalizeUniAppXAppPagesJson, normalizeUniAppXAppConfig, parseUniXFlexDirection, parseUniXSplashScreen, isUniXPageFile, getUniXPagePaths, parseUniXAppAndroidPackage, } from './uni-x';
7
+ export { normalizeUniAppXAppPagesJson, normalizeUniAppXAppConfig, parseUniXFlexDirection, parseUniXSplashScreen, isUniXPageFile, getUniXPagePaths, } from './uni-x';
8
8
  export { checkPagesJson } from './utils';
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.checkPagesJson = exports.parseUniXAppAndroidPackage = exports.getUniXPagePaths = exports.isUniXPageFile = exports.parseUniXSplashScreen = exports.parseUniXFlexDirection = exports.normalizeUniAppXAppConfig = exports.normalizeUniAppXAppPagesJson = void 0;
17
+ exports.checkPagesJson = exports.getUniXPagePaths = exports.isUniXPageFile = exports.parseUniXSplashScreen = exports.parseUniXFlexDirection = exports.normalizeUniAppXAppConfig = exports.normalizeUniAppXAppPagesJson = void 0;
18
18
  __exportStar(require("./mp"), exports);
19
19
  __exportStar(require("./app"), exports);
20
20
  __exportStar(require("./json"), exports);
@@ -28,6 +28,5 @@ Object.defineProperty(exports, "parseUniXFlexDirection", { enumerable: true, get
28
28
  Object.defineProperty(exports, "parseUniXSplashScreen", { enumerable: true, get: function () { return uni_x_1.parseUniXSplashScreen; } });
29
29
  Object.defineProperty(exports, "isUniXPageFile", { enumerable: true, get: function () { return uni_x_1.isUniXPageFile; } });
30
30
  Object.defineProperty(exports, "getUniXPagePaths", { enumerable: true, get: function () { return uni_x_1.getUniXPagePaths; } });
31
- Object.defineProperty(exports, "parseUniXAppAndroidPackage", { enumerable: true, get: function () { return uni_x_1.parseUniXAppAndroidPackage; } });
32
31
  var utils_1 = require("./utils");
33
32
  Object.defineProperty(exports, "checkPagesJson", { enumerable: true, get: function () { return utils_1.checkPagesJson; } });
@@ -1,7 +1,6 @@
1
1
  export declare const parseManifestJson: (inputDir: string) => any;
2
2
  export declare const parseManifestJsonOnce: (inputDir: string) => any;
3
3
  export declare const parseRpx2UnitOnce: (inputDir: string, platform?: UniApp.PLATFORM) => any;
4
- export declare function getNativeTags(inputDir?: string, platform?: UniApp.PLATFORM): any;
5
4
  interface CompilerCompatConfig {
6
5
  MODE?: 2 | 3;
7
6
  }
@@ -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.validateThemeValue = exports.getPlatformManifestJsonOnce = exports.getPlatformManifestJson = exports.getDevServerOptions = exports.isEnableTreeShaking = exports.getRouterOptions = exports.isUniPushOffline = exports.hasPushModule = exports.isEnableSecureNetwork = exports.isEnableUniPushV2 = exports.isEnableUniPushV1 = exports.getUniStatistics = exports.normalizeNetworkTimeout = exports.parseCompatConfigOnce = exports.getNativeTags = exports.parseRpx2UnitOnce = exports.parseManifestJsonOnce = exports.parseManifestJson = void 0;
6
+ exports.validateThemeValue = exports.getPlatformManifestJsonOnce = exports.getPlatformManifestJson = exports.getDevServerOptions = exports.isEnableTreeShaking = exports.getRouterOptions = exports.isUniPushOffline = exports.hasPushModule = exports.isEnableSecureNetwork = exports.isEnableUniPushV2 = exports.isEnableUniPushV1 = exports.getUniStatistics = exports.normalizeNetworkTimeout = exports.parseCompatConfigOnce = exports.parseRpx2UnitOnce = exports.parseManifestJsonOnce = exports.parseManifestJson = 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");
@@ -32,16 +32,6 @@ exports.parseRpx2UnitOnce = (0, uni_shared_1.once)((inputDir, platform = 'h5') =
32
32
  }
33
33
  return (0, shared_1.extend)({}, rpx2unit);
34
34
  });
35
- // 获取配置的小程序原生组件
36
- function getNativeTags(inputDir, platform) {
37
- if (!inputDir || !platform) {
38
- return [];
39
- }
40
- const manifestJson = (0, exports.parseManifestJsonOnce)(inputDir);
41
- const platformOptions = getPlatformManifestJson(manifestJson, platform);
42
- return platformOptions?.nativeTags || [];
43
- }
44
- exports.getNativeTags = getNativeTags;
45
35
  function parseCompatConfig(_inputDir) {
46
36
  // 不支持 mode:2
47
37
  return { MODE: 3 }; //parseManifestJsonOnce(inputDir).compatConfig || {}
@@ -93,10 +93,8 @@ function findChangedJsonFiles(supportGlobalUsingComponents = true) {
93
93
  findChangedFile(name, jsonsCache.get(name));
94
94
  }
95
95
  }
96
- if (process.env.UNI_COMPILE_TARGET !== 'uni_modules') {
97
- findChangedFile('app', appJsonCache);
98
- findChangedFiles(jsonPagesCache);
99
- }
96
+ findChangedFile('app', appJsonCache);
97
+ findChangedFiles(jsonPagesCache);
100
98
  findChangedFiles(jsonComponentsCache);
101
99
  return changedJsonFiles;
102
100
  }
@@ -33,7 +33,6 @@ const NON_APP_JSON_KEYS = [
33
33
  'mergeVirtualHostAttributes',
34
34
  'styleIsolation',
35
35
  'enableVirtualHost',
36
- 'nativeTags',
37
36
  ];
38
37
  function mergeMiniProgramAppJson(appJson, platformJson = {}, source = {}) {
39
38
  Object.keys(source).forEach((key) => {
@@ -101,10 +101,7 @@ export interface AppJson {
101
101
  debug?: boolean;
102
102
  functionalPages?: boolean;
103
103
  subPackages?: SubPackage[];
104
- workers?: string | {
105
- path: string;
106
- isSubpackage: boolean;
107
- };
104
+ workers?: string;
108
105
  requiredBackgroundModes?: string[];
109
106
  plugins?: Plugins;
110
107
  preloadRule?: PreloadRule;
@@ -1,3 +1,2 @@
1
1
  export declare function parseUniXFlexDirection(manifestJson: Record<string, any>): any;
2
2
  export declare function parseUniXSplashScreen(platform: 'app-android' | 'app-ios' | 'app-harmony', manifestJson: Record<string, any>): false | object;
3
- export declare function parseUniXAppAndroidPackage(appid: string): string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseUniXAppAndroidPackage = exports.parseUniXSplashScreen = exports.parseUniXFlexDirection = void 0;
3
+ exports.parseUniXSplashScreen = exports.parseUniXFlexDirection = void 0;
4
4
  const shared_1 = require("@vue/shared");
5
5
  const flexDirs = ['row', 'row-reverse', 'column', 'column-reverse'];
6
6
  function parseUniXFlexDirection(manifestJson) {
@@ -19,7 +19,3 @@ function parseUniXSplashScreen(platform, manifestJson) {
19
19
  return false;
20
20
  }
21
21
  exports.parseUniXSplashScreen = parseUniXSplashScreen;
22
- function parseUniXAppAndroidPackage(appid) {
23
- return 'uni.' + appid.replace(/_/g, '');
24
- }
25
- exports.parseUniXAppAndroidPackage = parseUniXAppAndroidPackage;
@@ -44,7 +44,6 @@ exports.default = {
44
44
  'prompt.run.devtools.quickapp-webview-huawei': '华为快应用开发者工具',
45
45
  'prompt.run.devtools.quickapp-webview-union': '快应用联盟开发者工具',
46
46
  'uvue.unsupported': 'uvue 暂不支持 {platform} 平台',
47
- // 重要:HBuilderX也会用到,如果调整了文案,需要同步调整HBuilderX的文案
48
47
  'uvue.dev.watching.end.empty': '本次代码变更,编译结果未发生变化,跳过同步手机端程序文件。',
49
48
  'uni_modules.import': '插件[{0}]仅支持 @/uni_modules/{1} 方式引入,不支持直接导入内部文件 {2}。',
50
49
  'pages.json.page.notfound': '页面"{pagePath}"不存在,请确保填写的页面路径不包含文件后缀,且必须与真实的文件路径大小写保持一致。',
@@ -1,4 +1,4 @@
1
- export declare function genEncryptEasyComModuleCode(pluginId: string, platform: typeof process.env.UNI_UTS_PLATFORM, components: Record<string, '.vue' | '.uvue'>): string;
1
+ export declare function genEncryptEasyComModuleCode(platform: typeof process.env.UNI_UTS_PLATFORM, components: Record<string, '.vue' | '.uvue'>): string;
2
2
  export declare function genEncryptUTSModuleCode(module: string, inputDir: string, platform: typeof process.env.UNI_UTS_PLATFORM): string;
3
3
  export declare function parseUniModulesWithComponents(inputDir: string, platform: typeof process.env.UNI_UTS_PLATFORM): Record<string, string>;
4
4
  /**
@@ -19,7 +19,7 @@ export declare function parseEasyComComponents(pluginId: string, inputDir: strin
19
19
  * @param cacheDir
20
20
  * @returns
21
21
  */
22
- export declare function findCloudEncryptUniModules(platform: typeof process.env.UNI_UTS_PLATFORM, inputDir: string, cacheDir?: string, sdkType?: CloudCompileSdkType): Record<string, EncryptPackageJson | undefined>;
22
+ export declare function findCloudEncryptUniModules(platform: typeof process.env.UNI_UTS_PLATFORM, inputDir: string, cacheDir?: string): Record<string, EncryptPackageJson | undefined>;
23
23
  export declare function findUploadEncryptUniModulesFiles(uniModules: Record<string, EncryptPackageJson | undefined>, platform: typeof process.env.UNI_UTS_PLATFORM, inputDir: string): Record<string, string[]>;
24
24
  export declare function packUploadEncryptUniModules(uniModules: Record<string, EncryptPackageJson | undefined>, platform: typeof process.env.UNI_UTS_PLATFORM, inputDir: string, cacheDir: string): {
25
25
  zipFile: string;
@@ -47,8 +47,7 @@ export interface EncryptPackageJson {
47
47
  }
48
48
  export declare function initCheckEnv(): Record<string, string>;
49
49
  export declare function resolveEncryptUniModule(id: string, platform: typeof process.env.UNI_UTS_PLATFORM, isX?: boolean): string | undefined;
50
- type CloudCompileSdkType = 'utssdk' | 'easycom' | 'all';
51
- export interface CloudCompileParams {
50
+ export declare function checkEncryptUniModules(inputDir: string, params: {
52
51
  mode: 'development' | 'production';
53
52
  packType: 'debug' | 'release';
54
53
  compilerVersion: string;
@@ -56,15 +55,10 @@ export interface CloudCompileParams {
56
55
  appname: string;
57
56
  platform: typeof process.env.UNI_UTS_PLATFORM;
58
57
  'uni-app-x': boolean;
59
- env: Record<string, string>;
60
- }
61
- export declare function checkEncryptUniModules(inputDir: string, params: CloudCompileParams, sdkType?: CloudCompileSdkType): Promise<{} | undefined>;
62
- export declare function getUniModulesEncryptType(pluginId: string): "" | "utssdk" | "easycom" | undefined;
58
+ }): Promise<{} | undefined>;
63
59
  export declare function parseUniModulesArtifacts(): {
64
60
  name: string;
65
61
  package: string;
66
62
  scopedSlots: string[];
67
63
  declaration: string;
68
64
  }[];
69
- export declare function virtualComponentPath(filepath: string): string;
70
- 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.virtualComponentPath = exports.parseUniModulesArtifacts = exports.getUniModulesEncryptType = exports.checkEncryptUniModules = exports.resolveEncryptUniModule = exports.initCheckEnv = exports.packUploadEncryptUniModules = exports.findUploadEncryptUniModulesFiles = exports.findCloudEncryptUniModules = exports.parseEasyComComponents = exports.parseUniModulesWithComponents = exports.genEncryptUTSModuleCode = exports.genEncryptEasyComModuleCode = void 0;
6
+ exports.parseUniModulesArtifacts = exports.checkEncryptUniModules = exports.resolveEncryptUniModule = exports.initCheckEnv = exports.packUploadEncryptUniModules = exports.findUploadEncryptUniModulesFiles = exports.findCloudEncryptUniModules = exports.parseEasyComComponents = exports.parseUniModulesWithComponents = exports.genEncryptUTSModuleCode = exports.genEncryptEasyComModuleCode = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
8
  const fs_extra_1 = __importDefault(require("fs-extra"));
9
9
  const fast_glob_1 = require("fast-glob");
@@ -11,49 +11,32 @@ const utils_1 = require("./utils");
11
11
  const easycom_1 = require("./easycom");
12
12
  const messages_1 = require("./messages");
13
13
  const constants_1 = require("./constants");
14
- const url_1 = require("./url");
15
- function genEncryptEasyComModuleIndex(pluginId, platform, components) {
16
- const isMp = platform.startsWith('mp-');
14
+ function genEncryptEasyComModuleIndex(platform, components) {
17
15
  const imports = [];
18
- const code = [];
19
16
  const ids = [];
20
17
  Object.keys(components).forEach((component) => {
21
18
  const id = (0, utils_1.capitalize)((0, utils_1.camelize)(component));
22
- if (!isMp) {
23
- ids.push(id);
24
- }
19
+ ids.push(id);
25
20
  let instance = '';
26
21
  if (platform === 'app-android') {
27
22
  instance = (0, easycom_1.genUTSComponentPublicInstanceIdent)(component);
28
23
  // 类型
29
24
  ids.push(instance);
30
25
  }
31
- if (isMp) {
32
- const filename = `uni_modules/${pluginId}/components/${component}/${component}${components[component]}`;
33
- // 为了触发json、wxss的生成
34
- imports.push(`import ${id} from '${virtualComponentPath(filename)}'`);
35
- code.push(`function defineComponent${id}(){
36
- ${process.env.UNI_MP_GLOBAL || 'uni'}.createComponent(${id})
37
- }`);
38
- ids.push(`defineComponent${id}`);
39
- }
40
- else {
41
- imports.push(`import ${id}${instance ? `, { ${instance} }` : ''} from './components/${component}/${component}${components[component]}'`);
42
- }
26
+ imports.push(`import ${id}${instance ? `, { ${instance} }` : ''} from './components/${component}/${component}${components[component]}'`);
43
27
  });
44
28
  return `
45
29
  ${imports.join('\n')}
46
- ${code.join('\n')}
47
30
  export {
48
31
  ${ids.join(',\n ')}
49
32
  }
50
33
  `;
51
34
  }
52
35
  // easyCom
53
- function genEncryptEasyComModuleCode(pluginId, platform, components) {
36
+ function genEncryptEasyComModuleCode(platform, components) {
54
37
  // easyCom
55
38
  if (components && Object.keys(components).length) {
56
- return genEncryptEasyComModuleIndex(pluginId, platform, components);
39
+ return genEncryptEasyComModuleIndex(platform, components);
57
40
  }
58
41
  return '';
59
42
  }
@@ -100,7 +83,7 @@ function parseUniModulesWithComponents(inputDir, platform) {
100
83
  // 解析加密的 easyCom 插件列表
101
84
  const components = parseEasyComComponents(uniModuleDir, inputDir, false);
102
85
  if (Object.keys(components).length) {
103
- codes.push(genEncryptEasyComModuleCode(uniModuleDir, platform, components));
86
+ codes.push(genEncryptEasyComModuleCode(platform, components));
104
87
  }
105
88
  if (codes.length) {
106
89
  uniModules[uniModuleDir] = codes.join(`\n`);
@@ -162,7 +145,7 @@ const uniModulesEncryptTypes = new Map();
162
145
  * @param cacheDir
163
146
  * @returns
164
147
  */
165
- function findCloudEncryptUniModules(platform, inputDir, cacheDir = '', sdkType = 'all') {
148
+ function findCloudEncryptUniModules(platform, inputDir, cacheDir = '') {
166
149
  uniModulesEncryptTypes.clear();
167
150
  const uniModules = {};
168
151
  const modulesDir = path_1.default.resolve(inputDir, 'uni_modules');
@@ -176,7 +159,10 @@ function findCloudEncryptUniModules(platform, inputDir, cacheDir = '', sdkType =
176
159
  let type = '';
177
160
  if (fs_extra_1.default.existsSync(utssdkDir)) {
178
161
  // app-android 和 app-ios 不能云编译 utssdk 插件,而是需要自定义基座
179
- if (platform === 'app-android' || platform === 'app-ios') {
162
+ // app-harmony 平台目前不支持云编译
163
+ if (platform === 'app-android' ||
164
+ platform === 'app-ios' ||
165
+ platform === 'app-harmony') {
180
166
  return;
181
167
  }
182
168
  // 其他平台必须有平台index.uts或根目录index.uts
@@ -195,12 +181,6 @@ function findCloudEncryptUniModules(platform, inputDir, cacheDir = '', sdkType =
195
181
  }
196
182
  type = 'easycom';
197
183
  }
198
- if (sdkType === 'utssdk' && type === 'easycom') {
199
- return;
200
- }
201
- if (sdkType === 'easycom' && type === 'utssdk') {
202
- return;
203
- }
204
184
  const pkg = require(path_1.default.resolve(uniModuleRootDir, 'package.json'));
205
185
  uniModules[uniModuleDir] = findEncryptUniModuleCache(uniModuleDir, cacheDir, {
206
186
  version: pkg.version,
@@ -351,21 +331,12 @@ function resolveEncryptUniModule(id, platform, isX = true) {
351
331
  // 为了避免兼容性问题,
352
332
  // 目前排除 app-android 和 app-ios 平台,其他平台需要判断是否uvue文件,比如web端。加密utssdk插件,但同时easycom使用了非加密组件
353
333
  if (platform !== 'app-android' && platform !== 'app-ios') {
354
- const encryptType = getUniModulesEncryptType(uniModuleId);
355
- if (encryptType === 'utssdk') {
334
+ if (uniModulesEncryptTypes.get(uniModuleId) === 'utssdk') {
356
335
  // 如果是utssdk加密插件,且是vue文件,则不走uts-proxy
357
336
  if (constants_1.EXTNAME_VUE_RE.test(id)) {
358
337
  return;
359
338
  }
360
339
  }
361
- // 小程序平台不使用uni_helpers来处理easycom组件,而是用uniEntryPlugin处理
362
- if (platform.startsWith('mp-')) {
363
- if (encryptType === 'easycom') {
364
- if (constants_1.EXTNAME_VUE_RE.test(id)) {
365
- return;
366
- }
367
- }
368
- }
369
340
  }
370
341
  // 原生平台走旧的uts-proxy
371
342
  return (0, utils_1.normalizePath)(path_1.default.join(process.env.UNI_INPUT_DIR, `uni_modules/${uniModuleId}?${isX && platform === 'app-android' ? 'uts-proxy' : 'uni_helpers'}`));
@@ -373,17 +344,17 @@ function resolveEncryptUniModule(id, platform, isX = true) {
373
344
  }
374
345
  }
375
346
  exports.resolveEncryptUniModule = resolveEncryptUniModule;
376
- async function checkEncryptUniModules(inputDir, params, sdkType = 'all') {
377
- // 初始化指定 sdk 类型的加密插件
378
- const curEncryptUniModules = findCloudEncryptUniModules(params.platform, inputDir, process.env.UNI_MODULES_ENCRYPT_CACHE_DIR, sdkType);
379
- if (!Object.keys(curEncryptUniModules).length) {
347
+ async function checkEncryptUniModules(inputDir, params) {
348
+ // 扫描加密插件云编译
349
+ encryptUniModules = findCloudEncryptUniModules(params.platform, inputDir, process.env.UNI_MODULES_ENCRYPT_CACHE_DIR);
350
+ if (!Object.keys(encryptUniModules).length) {
380
351
  return {};
381
352
  }
382
353
  if (!process.env.UNI_HBUILDERX_PLUGINS) {
383
354
  return {};
384
355
  }
385
356
  const cacheDir = process.env.UNI_MODULES_ENCRYPT_CACHE_DIR;
386
- const { zipFile, modules } = packUploadEncryptUniModules(curEncryptUniModules, process.env.UNI_UTS_PLATFORM, inputDir, cacheDir);
357
+ const { zipFile, modules } = packUploadEncryptUniModules(encryptUniModules, process.env.UNI_UTS_PLATFORM, inputDir, cacheDir);
387
358
  if (zipFile) {
388
359
  const downloadFile = path_1.default.resolve(cacheDir, 'uni_modules.download.zip');
389
360
  const { C, D, R, U } = (0, utils_1.requireUniHelpers)();
@@ -440,14 +411,9 @@ async function checkEncryptUniModules(inputDir, params, sdkType = 'all') {
440
411
  });
441
412
  }
442
413
  }
443
- // 初始化所有
444
- encryptUniModules = findCloudEncryptUniModules(params.platform, inputDir, process.env.UNI_MODULES_ENCRYPT_CACHE_DIR, 'all');
414
+ encryptUniModules = findCloudEncryptUniModules(params.platform, inputDir, process.env.UNI_MODULES_ENCRYPT_CACHE_DIR);
445
415
  }
446
416
  exports.checkEncryptUniModules = checkEncryptUniModules;
447
- function getUniModulesEncryptType(pluginId) {
448
- return uniModulesEncryptTypes.get(pluginId);
449
- }
450
- exports.getUniModulesEncryptType = getUniModulesEncryptType;
451
417
  function parseUniModulesArtifacts() {
452
418
  const res = [];
453
419
  Object.keys(encryptUniModules).forEach((uniModuleId) => {
@@ -464,8 +430,3 @@ function parseUniModulesArtifacts() {
464
430
  return res;
465
431
  }
466
432
  exports.parseUniModulesArtifacts = parseUniModulesArtifacts;
467
- const uniComponentPrefix = 'uniComponent://';
468
- function virtualComponentPath(filepath) {
469
- return uniComponentPrefix + (0, url_1.encodeBase64Url)(filepath);
470
- }
471
- exports.virtualComponentPath = virtualComponentPath;
@@ -17,8 +17,6 @@ export type Defines = {
17
17
  export interface Exports {
18
18
  [name: string]: Define | Defines | false;
19
19
  }
20
- export declare function getNonTreeShakingPlugins(): string[];
21
- export declare function isNonTreeShakingPlugin(platform: typeof process.env.UNI_UTS_PLATFORM, uni_modules: Record<string, any>): boolean;
22
20
  export declare function getUniExtApiProviders(): {
23
21
  plugin: string;
24
22
  service: string;