@dcloudio/uni-cli-shared 3.0.0-alpha-1000920260515001 → 3.0.0-alpha-5000920260515001

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 (72) hide show
  1. package/dist/dom2/sharedData.js +1 -3
  2. package/dist/dom2/vue.d.ts +0 -2
  3. package/dist/dom2/vue.js +3 -12
  4. package/dist/easycom.d.ts +0 -1
  5. package/dist/easycom.js +0 -10
  6. package/dist/hbx/alias.js +6 -43
  7. package/dist/hbx/log.js +2 -9
  8. package/dist/json/app/pages/definePage.js +1 -1
  9. package/dist/json/index.d.ts +1 -1
  10. package/dist/json/index.js +1 -2
  11. package/dist/json/uni-x/index.d.ts +0 -6
  12. package/dist/json/uni-x/index.js +1 -54
  13. package/dist/logs/console.js +1 -14
  14. package/dist/messages/en.d.ts +0 -4
  15. package/dist/messages/en.js +0 -4
  16. package/dist/messages/index.d.ts +0 -8
  17. package/dist/messages/zh_CN.d.ts +0 -4
  18. package/dist/messages/zh_CN.js +0 -4
  19. package/dist/mp/imports.d.ts +1 -3
  20. package/dist/mp/style.js +2 -6
  21. package/dist/mp/template.d.ts +1 -2
  22. package/dist/mp/usingComponents.d.ts +1 -2
  23. package/dist/uni_modules.cloud.d.ts +1 -2
  24. package/dist/uni_modules.cloud.js +0 -1
  25. package/dist/uts.d.ts +0 -1
  26. package/dist/uts.js +4 -86
  27. package/dist/vite/cloud.js +5 -2
  28. package/dist/vite/index.d.ts +3 -2
  29. package/dist/vite/plugins/console.js +1 -2
  30. package/dist/vite/plugins/copy.js +0 -1
  31. package/dist/vite/plugins/dynamicImportPolyfill.d.ts +1 -8
  32. package/dist/vite/plugins/sourceMap.js +1 -4
  33. package/dist/vite/plugins/stats.js +3 -4
  34. package/dist/vite/plugins/uts/uni_modules.d.ts +1 -1
  35. package/dist/vite/plugins/uts/uni_modules.js +10 -18
  36. package/dist/vite/plugins/vitejs/plugins/asset.d.ts +4 -12
  37. package/dist/vite/plugins/vitejs/plugins/asset.js +1 -3
  38. package/dist/vite/plugins/vitejs/plugins/css.d.ts +3 -6
  39. package/dist/vite/plugins/vitejs/plugins/css.js +3 -14
  40. package/dist/vite/utils/utils.d.ts +2 -3
  41. package/dist/watcher.d.ts +0 -1
  42. package/dist/workers.d.ts +0 -1
  43. package/dist/workers.js +5 -10
  44. package/lib/@vue/compiler-core/dist/compiler-core.cjs.js +23 -16
  45. package/lib/@vue/compiler-core/dist/compiler-core.cjs.prod.js +23 -16
  46. package/lib/@vue/compiler-core/dist/compiler-core.esm-bundler.js +23 -16
  47. package/lib/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +66 -23
  48. package/lib/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js +115 -67
  49. package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.cjs.js +63 -58
  50. package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.cjs.prod.js +63 -58
  51. package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.d.ts +1 -6
  52. package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.esm-bundler.js +47 -22
  53. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.cjs.js +23 -12
  54. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +22 -12
  55. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-browser.js +74 -23
  56. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-browser.prod.js +5 -5
  57. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js +20 -3
  58. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.global.js +363 -310
  59. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.global.prod.js +5 -5
  60. package/lib/dom2/app/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +468 -446
  61. package/lib/dom2/app/@vue/compiler-sfc/dist/compiler-sfc.d.ts +11114 -33
  62. package/lib/dom2/app/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js +1174 -1320
  63. package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.cjs.js +527 -758
  64. package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.d.ts +315 -387
  65. package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.esm-browser.js +632 -868
  66. package/lib/dom2/app/@vue/compiler-vapor-dom2/dist/compiler-vapor-dom2.cjs.js +1 -1
  67. package/lib/dom2/app/@vue/shared/dist/shared.cjs.js +25 -16
  68. package/lib/dom2/app/@vue/shared/dist/shared.cjs.prod.js +25 -16
  69. package/lib/dom2/app/@vue/shared/dist/shared.d.ts +0 -5
  70. package/lib/dom2/app/@vue/shared/dist/shared.esm-bundler.js +23 -11
  71. package/package.json +9 -8
  72. package/lib/@vue/compiler-core/node_modules/.bin/parser +0 -17
@@ -22,9 +22,7 @@ function initSharedDataOptions() {
22
22
  compilerVersion: process.env.HX_Version || process.env.UNI_COMPILER_VERSION,
23
23
  androidOptions: (0, x_1.isUniAppXAndroidJsEngine)()
24
24
  ? {
25
- package: process.env.UNI_COMPILE_TARGET === 'ext-api'
26
- ? 'io.dcloud.uniapp.extapi'
27
- : (0, manifest_1.parseUniXAppAndroidPackage)(manifest.appid),
25
+ package: (0, manifest_1.parseUniXAppAndroidPackage)(manifest.appid),
28
26
  }
29
27
  : undefined,
30
28
  };
@@ -6,8 +6,6 @@ export declare function initVueTemplateCompilerExtraOptions(descriptor: SFCDescr
6
6
  filename: string;
7
7
  relativeFilename: string;
8
8
  helper: any;
9
- enableRootScrollViewTransform: boolean;
10
- rootScrollView: import("src/json/uni-x").UniXPageOptions | undefined;
11
9
  scriptCppBlocks: any;
12
10
  disableStaticStyle: boolean;
13
11
  onVueTemplateCompileLog(type: 'warn' | 'error', error: CompilerError): void;
package/dist/dom2/vue.js CHANGED
@@ -11,16 +11,10 @@ const vue_1 = require("../vue");
11
11
  function initVueTemplateCompilerExtraOptions(descriptor) {
12
12
  const filename = (0, utils_1.normalizePath)(descriptor.filename.split('?')[0]);
13
13
  const relativeFilename = (0, utils_1.normalizePath)(path_1.default.relative(process.env.UNI_INPUT_DIR, filename));
14
- const rootScrollView = (0, json_1.parseUniXPageOptions)(filename);
15
- const componentType = rootScrollView || (0, json_1.isUniPageFile)(filename) ? 'page' : 'component';
16
14
  const isDevX = process.env.UNI_HX_VERSION_DEV === 'true' &&
17
15
  process.env.UNI_APP_X === 'true';
18
- const isDynamic = process.env.UNI_APP_X_DOM2_DYNAMIC === 'true';
19
16
  let disableStaticStyle = false;
20
- if (isDevX &&
21
- // 动态渲染时,仍旧使用静态样式,避免性能问题。
22
- !isDynamic &&
23
- process.env.NODE_ENV === 'development') {
17
+ if (isDevX && process.env.NODE_ENV === 'development') {
24
18
  if (process.env.UNI_UTS_PLATFORM === 'app-harmony') {
25
19
  // 开发版本、开发模式下,非鸿蒙release模式打包
26
20
  disableStaticStyle = process.env.UNI_APP_HARMONY_RUN_MODE !== 'release';
@@ -30,13 +24,10 @@ function initVueTemplateCompilerExtraOptions(descriptor) {
30
24
  return {
31
25
  root: (0, utils_1.normalizePath)(process.env.UNI_INPUT_DIR),
32
26
  platform: process.env.UNI_UTS_PLATFORM,
33
- componentType,
27
+ componentType: (0, json_1.isUniPageFile)(filename) ? 'page' : 'component',
34
28
  filename: filename,
35
29
  relativeFilename,
36
30
  helper,
37
- enableRootScrollViewTransform: true,
38
- // 仅页面透传 rootScrollView,避免非页面组件误触发 ROOT 自动包裹逻辑。
39
- rootScrollView: componentType === 'page' ? rootScrollView : undefined,
40
31
  scriptCppBlocks: descriptor.scriptCppBlocks,
41
32
  disableStaticStyle,
42
33
  onVueTemplateCompileLog(type, error) {
@@ -44,7 +35,7 @@ function initVueTemplateCompilerExtraOptions(descriptor) {
44
35
  },
45
36
  r: helper.K,
46
37
  className: helper.GCN(descriptor.filename, process.env.UNI_INPUT_DIR),
47
- inlineRender: !isDynamic && process.env.UNI_UTS_PLATFORM === 'app-android',
38
+ inlineRender: process.env.UNI_UTS_PLATFORM === 'app-android',
48
39
  };
49
40
  }
50
41
  exports.initVueTemplateCompilerExtraOptions = initVueTemplateCompilerExtraOptions;
package/dist/easycom.d.ts CHANGED
@@ -11,7 +11,6 @@ export interface EasycomMatcher {
11
11
  name: string;
12
12
  pattern: RegExp;
13
13
  replacement: string;
14
- dom2IncompatibleFile?: string;
15
14
  }
16
15
  interface EasycomCustom {
17
16
  [key: string]: string;
package/dist/easycom.js CHANGED
@@ -65,9 +65,6 @@ function initEasycoms(inputDir, { dirs, platform, isX, }) {
65
65
  ;
66
66
  globalThis.uts2jsSourceCodeMap.initUts2jsEasycom(easycoms);
67
67
  }
68
- // UTS / customElements 组件是在 initEasycom 之后补充进去的,
69
- // 这里补一次状态,避免项目里只有这类组件时被误判为没有 easycom。
70
- hasEasycom = !!easycoms.length;
71
68
  };
72
69
  const initUTSEasycomCustomElements = () => {
73
70
  (0, uts_1.initUTSCustomElements)(inputDir, platform).forEach((item) => {
@@ -198,13 +195,6 @@ function matchEasycom(tag) {
198
195
  easycomsInvalidCache.add(tag);
199
196
  return false;
200
197
  }
201
- // dom2 不支持旧版 uni-app 兼容模式组件,这里在 easycom 真正命中时再报错,
202
- // 避免扫描阶段就对未使用的插件组件产生误报。
203
- if (process.env.UNI_APP_X_DOM2 === 'true' && matcher.dom2IncompatibleFile) {
204
- throw new Error(messages_1.M['dom2.compatible.component']
205
- .replace('{name}', `<${tag}>`)
206
- .replace('{file}', matcher.dom2IncompatibleFile));
207
- }
208
198
  source = tag.replace(matcher.pattern, matcher.replacement);
209
199
  easycomsCache.set(tag, source);
210
200
  debugEasycom('matchEasycom', tag, source);
package/dist/hbx/alias.js CHANGED
@@ -27,7 +27,6 @@ function initModuleAlias() {
27
27
  process.env.UNI_APP_X_DOM2_CPP_DIR =
28
28
  process.env.UNI_APP_HARMONY_DOM2_CPP_DIR;
29
29
  }
30
- // TODO 等待正式对外推出后,删除这个兼容逻辑
31
30
  if (process.env.UNI_APP_PLATFORM === 'ios' ||
32
31
  process.env.UNI_APP_PLATFORM === 'android') {
33
32
  if (process.env.UNI_INPUT_DIR) {
@@ -50,24 +49,14 @@ function initModuleAlias() {
50
49
  process.env.UNI_PLATFORM === 'app-plus' ||
51
50
  process.env.UNI_PLATFORM === 'app-harmony')) {
52
51
  if (!process.env.UNI_APP_X_DOM2_CPP_DIR) {
53
- let baseDir = '';
54
- const isAndroid = process.env.UNI_APP_PLATFORM === 'android';
55
- const isIOS = process.env.UNI_APP_PLATFORM === 'ios';
56
- if (process.env.NODE_ENV !== 'development' && (isAndroid || isIOS)) {
57
- baseDir = path_1.default.resolve(process.env.UNI_OUTPUT_DIR, '.uniappx', isAndroid ? 'android' : 'ios');
58
- }
59
- else {
60
- baseDir =
61
- process.env.UNI_PLATFORM === 'app-harmony'
62
- ? process.env.UNI_OUTPUT_DIR
63
- : process.env.UNI_APP_X_CACHE_DIR || process.env.UNI_OUTPUT_DIR;
64
- }
52
+ const baseDir = process.env.UNI_PLATFORM === 'app-harmony'
53
+ ? process.env.UNI_OUTPUT_DIR
54
+ : process.env.UNI_APP_X_CACHE_DIR || process.env.UNI_OUTPUT_DIR;
65
55
  process.env.UNI_APP_X_DOM2_CPP_DIR = path_1.default.resolve(baseDir, 'cpp');
66
- process.env.UNI_APP_X_DOM2_SO_DIR = path_1.default.resolve(baseDir, 'so');
67
56
  }
68
57
  if (!process.env.UNI_APP_X_DOM2_KT_DIR) {
69
58
  if (process.env.NODE_ENV !== 'development') {
70
- process.env.UNI_APP_X_DOM2_KT_DIR = path_1.default.resolve(process.env.UNI_OUTPUT_DIR, '.uniappx/android', 'src');
59
+ process.env.UNI_APP_X_DOM2_KT_DIR = path_1.default.resolve(process.env.UNI_OUTPUT_DIR, 'src/.uniappx/android', 'src');
71
60
  }
72
61
  else {
73
62
  process.env.UNI_APP_X_DOM2_KT_DIR = path_1.default.resolve(process.env.UNI_APP_X_CACHE_DIR ||
@@ -77,36 +66,10 @@ function initModuleAlias() {
77
66
  }
78
67
  if (process.env.UNI_APP_PLATFORM ||
79
68
  process.env.UNI_PLATFORM === 'app-harmony') {
80
- if (!process.env.UNI_APP_X_VAPOR_RENDER_TARGET) {
81
- // ios 和 harmony 平台默认使用 bytecode 目标,存在 .native 文件时使用 native 目标;其他平台如果存在 .dynamic 文件则使用 bytecode 目标,否则使用 native 目标
82
- if (process.env.UNI_APP_PLATFORM === 'ios' ||
83
- process.env.UNI_APP_PLATFORM === 'harmony' ||
84
- process.env.UNI_PLATFORM === 'app-harmony') {
85
- if (process.env.UNI_INPUT_DIR &&
86
- fs_1.default.existsSync(path_1.default.resolve(process.env.UNI_INPUT_DIR, '.native'))) {
87
- process.env.UNI_APP_X_VAPOR_RENDER_TARGET = 'nativecode';
88
- }
89
- else {
90
- process.env.UNI_APP_X_VAPOR_RENDER_TARGET = 'bytecode';
91
- }
92
- }
93
- else {
94
- if (process.env.UNI_INPUT_DIR &&
95
- fs_1.default.existsSync(path_1.default.resolve(process.env.UNI_INPUT_DIR, '.dynamic'))) {
96
- process.env.UNI_APP_X_VAPOR_RENDER_TARGET = 'bytecode';
97
- }
98
- else {
99
- process.env.UNI_APP_X_VAPOR_RENDER_TARGET = 'nativecode';
100
- }
101
- }
102
- }
103
- if (process.env.UNI_APP_X_VAPOR_RENDER_TARGET?.includes('bytecode')) {
69
+ const dynamicFilename = path_1.default.resolve(process.env.UNI_INPUT_DIR, '.dynamic');
70
+ if (fs_1.default.existsSync(dynamicFilename)) {
104
71
  process.env.UNI_APP_X_DOM2_DYNAMIC = 'true';
105
72
  }
106
- // 如果是 ext-api 目标,强制使用 nativecode 目标
107
- if (process.env.UNI_COMPILE_TARGET === 'ext-api') {
108
- delete process.env.UNI_APP_X_DOM2_DYNAMIC;
109
- }
110
73
  }
111
74
  }
112
75
  if (process.env.UNI_APP_X_DOM2 === 'true') {
package/dist/hbx/log.js CHANGED
@@ -10,10 +10,9 @@ const picocolors_1 = __importDefault(require("picocolors"));
10
10
  const compiler_core_1 = require("@vue/compiler-core");
11
11
  const shared_1 = require("@vue/shared");
12
12
  const utils_1 = require("../utils");
13
- const utils_2 = require("./utils");
14
13
  const constants_1 = require("../constants");
15
14
  const ast_1 = require("../vite/utils/ast");
16
- const utils_3 = require("../vite/plugins/vitejs/utils");
15
+ const utils_2 = require("../vite/plugins/vitejs/utils");
17
16
  const SIGNAL_H5_LOCAL = ' ➜ Local:';
18
17
  const SIGNAL_H5_NETWORK = ' ➜ Network:';
19
18
  const networkLogs = [];
@@ -30,12 +29,6 @@ function overridedConsole(name, oldFn, char) {
30
29
  console[name] = function (...args) {
31
30
  oldFn.apply(this, args.map((arg) => {
32
31
  let item;
33
- if ((0, utils_2.isInHBuilderX)() && typeof arg === 'string' && arg.includes('\n')) {
34
- arg = arg
35
- .split('\n')
36
- .map((line) => `${char}${line}${char}`)
37
- .join('\n');
38
- }
39
32
  if (typeof arg !== 'object') {
40
33
  item = `${char}${arg}${char}`;
41
34
  }
@@ -207,7 +200,7 @@ function buildErrorMessage(err, args = [], includeStack = true) {
207
200
  const scriptNode = ast.children.find((node) => node.type === compiler_core_1.NodeTypes.ELEMENT && node.tag === 'script');
208
201
  if (scriptNode) {
209
202
  const scriptLoc = scriptNode.loc;
210
- args.push(picocolors_1.default.yellow(pad((0, utils_3.generateCodeFrame)(scriptLoc.source, err.loc))));
203
+ args.push(picocolors_1.default.yellow(pad((0, utils_2.generateCodeFrame)(scriptLoc.source, err.loc))));
211
204
  // correct error location
212
205
  err.loc.line = scriptLoc.start.line + err.loc.line - 1;
213
206
  }
@@ -46,7 +46,7 @@ function defineNVuePageCode(pagesJson) {
46
46
  }
47
47
  const pagePathWithExtname = (0, utils_1.normalizePagePath)(page.path, 'app');
48
48
  if (pagePathWithExtname) {
49
- importNVuePagesCode.push(`import('./${pagePathWithExtname}').then((res)=>res.default)`);
49
+ importNVuePagesCode.push(`import('./${pagePathWithExtname}').then((res)=>{res()})`);
50
50
  }
51
51
  });
52
52
  return importNVuePagesCode.join('\n');
@@ -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, parseUniXPageOptions, parseUniXFlexDirection, parseUniXSplashScreen, isUniXPageFile, getUniXPagePaths, parseUniXAppAndroidPackage, } from './uni-x';
7
+ export { normalizeUniAppXAppPagesJson, normalizeUniAppXAppConfig, parseUniXFlexDirection, parseUniXSplashScreen, isUniXPageFile, getUniXPagePaths, parseUniXAppAndroidPackage, } 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.parseUniXPageOptions = exports.normalizeUniAppXAppConfig = exports.normalizeUniAppXAppPagesJson = void 0;
17
+ exports.checkPagesJson = exports.parseUniXAppAndroidPackage = 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);
@@ -24,7 +24,6 @@ __exportStar(require("./theme"), exports);
24
24
  var uni_x_1 = require("./uni-x");
25
25
  Object.defineProperty(exports, "normalizeUniAppXAppPagesJson", { enumerable: true, get: function () { return uni_x_1.normalizeUniAppXAppPagesJson; } });
26
26
  Object.defineProperty(exports, "normalizeUniAppXAppConfig", { enumerable: true, get: function () { return uni_x_1.normalizeUniAppXAppConfig; } });
27
- Object.defineProperty(exports, "parseUniXPageOptions", { enumerable: true, get: function () { return uni_x_1.parseUniXPageOptions; } });
28
27
  Object.defineProperty(exports, "parseUniXFlexDirection", { enumerable: true, get: function () { return uni_x_1.parseUniXFlexDirection; } });
29
28
  Object.defineProperty(exports, "parseUniXSplashScreen", { enumerable: true, get: function () { return uni_x_1.parseUniXSplashScreen; } });
30
29
  Object.defineProperty(exports, "isUniXPageFile", { enumerable: true, get: function () { return uni_x_1.isUniXPageFile; } });
@@ -1,11 +1,5 @@
1
1
  export * from './manifest';
2
- export interface UniXPageOptions {
3
- disableScroll?: boolean;
4
- enablePullDownRefresh?: boolean;
5
- scrollIndicator?: 'none';
6
- }
7
2
  export declare function normalizeUniAppXAppPagesJson(jsonStr: string): UniApp.PagesJson;
8
- export declare function parseUniXPageOptions(filename: string): UniXPageOptions | undefined;
9
3
  /**
10
4
  * TODO 应该闭包,通过globalThis赋值?
11
5
  * @param pagesJson
@@ -17,8 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.getUniXPagePaths = exports.isUniXPageFile = exports.normalizeUniAppXAppConfig = exports.parseUniXPageOptions = exports.normalizeUniAppXAppPagesJson = void 0;
21
- const fs_1 = __importDefault(require("fs"));
20
+ exports.getUniXPagePaths = exports.isUniXPageFile = exports.normalizeUniAppXAppConfig = exports.normalizeUniAppXAppPagesJson = void 0;
22
21
  const path_1 = __importDefault(require("path"));
23
22
  const shared_1 = require("@vue/shared");
24
23
  const json_1 = require("../json");
@@ -29,7 +28,6 @@ const uniConfig_1 = require("./uniConfig");
29
28
  const preprocess_1 = require("../../preprocess");
30
29
  const utils_2 = require("../utils");
31
30
  __exportStar(require("./manifest"), exports);
32
- const uniXPageOptionsCache = new Map();
33
31
  function normalizeUniAppXAppPagesJson(jsonStr) {
34
32
  // 先条件编译
35
33
  jsonStr = (0, preprocess_1.preUVueJson)(jsonStr, 'pages.json');
@@ -79,60 +77,9 @@ function normalizeUniAppXAppPagesJson(jsonStr) {
79
77
  // 缓存页面列表
80
78
  pages_1.pagesCacheSet.clear();
81
79
  pagesJson.pages.forEach((page) => pages_1.pagesCacheSet.add(page.path));
82
- updateUniXPageOptions(pagesJson);
83
80
  return pagesJson;
84
81
  }
85
82
  exports.normalizeUniAppXAppPagesJson = normalizeUniAppXAppPagesJson;
86
- function updateUniXPageOptions(pagesJson) {
87
- const inputDir = getUniXInputDir();
88
- if (!inputDir) {
89
- return;
90
- }
91
- const pageOptions = new Map();
92
- pagesJson.pages.forEach((page) => {
93
- pageOptions.set(page.path, normalizeRootPageOptions(page.style));
94
- });
95
- uniXPageOptionsCache.set(inputDir, pageOptions);
96
- }
97
- function normalizeRootPageOptions(pageStyle) {
98
- if (!pageStyle) {
99
- return {};
100
- }
101
- return {
102
- disableScroll: pageStyle.disableScroll === true || undefined,
103
- enablePullDownRefresh: isEnablePullDownRefresh(pageStyle) || undefined,
104
- scrollIndicator: pageStyle.scrollIndicator,
105
- };
106
- }
107
- function initUniXPageOptions() {
108
- const inputDir = getUniXInputDir();
109
- if (!inputDir || uniXPageOptionsCache.has(inputDir)) {
110
- return;
111
- }
112
- const filename = path_1.default.resolve(inputDir, 'pages.json');
113
- if (!fs_1.default.existsSync(filename)) {
114
- return;
115
- }
116
- normalizeUniAppXAppPagesJson(fs_1.default.readFileSync(filename, 'utf8'));
117
- }
118
- function isEnablePullDownRefresh(pageStyle) {
119
- return pageStyle.enablePullDownRefresh || pageStyle.pullToRefresh?.support;
120
- }
121
- function parseUniXPageOptions(filename) {
122
- initUniXPageOptions();
123
- const inputDir = getUniXInputDir();
124
- if (!inputDir) {
125
- return;
126
- }
127
- const pagePath = (0, utils_1.removeExt)((0, utils_1.normalizePath)(path_1.default.relative(inputDir, filename.split('?')[0])));
128
- return uniXPageOptionsCache.get(inputDir)?.get(pagePath);
129
- }
130
- exports.parseUniXPageOptions = parseUniXPageOptions;
131
- function getUniXInputDir() {
132
- return process.env.UNI_INPUT_DIR
133
- ? (0, utils_1.normalizePath)(process.env.UNI_INPUT_DIR)
134
- : undefined;
135
- }
136
83
  function normalizeSubPackages(subPackages) {
137
84
  const pages = [];
138
85
  if ((0, shared_1.isArray)(subPackages)) {
@@ -19,25 +19,12 @@ function rewriteConsoleExpr(method, id, filename, code, sourceMap = false) {
19
19
  if (s.hasChanged()) {
20
20
  return {
21
21
  code: s.toString(),
22
- map: sourceMap
23
- ? normalizeSourceMap(s.generateMap({ hires: true }))
24
- : { mappings: '' },
22
+ map: sourceMap ? s.generateMap({ hires: true }) : { mappings: '' },
25
23
  };
26
24
  }
27
25
  return { code, map: null };
28
26
  }
29
27
  exports.rewriteConsoleExpr = rewriteConsoleExpr;
30
- function normalizeSourceMap(map) {
31
- return {
32
- ...map,
33
- file: map.file || '',
34
- names: map.names || [],
35
- sources: map.sources || [],
36
- sourcesContent: map.sourcesContent || [],
37
- toString: () => map.toString(),
38
- toUrl: () => map.toUrl(),
39
- };
40
- }
41
28
  function restoreConsoleExpr(code) {
42
29
  return code.replace(/(?:uni\.)?__f__\('([^']+)','at ([^:]+):(\d+)',/g, 'console.$1(');
43
30
  }
@@ -1,8 +1,5 @@
1
1
  declare const _default: {
2
2
  readonly 'app.compiler.version': "Compiler version: {version}";
3
- readonly 'view.render.compiler.target': "Current view.render compile target: {target}";
4
- readonly 'view.render.compiler.target.bytecode': "bytecode";
5
- readonly 'view.render.compiler.target.nativecode': "nativecode";
6
3
  readonly 'style.isolation.version': "Style isolation version: {version}";
7
4
  readonly compiling: "Compiling...";
8
5
  readonly 'dev.performance': "Please note that in running mode, due to log output, sourcemap, and uncompressed source code, the performance and package size are not as good as release mode.";
@@ -23,7 +20,6 @@ declare const _default: {
23
20
  readonly 'i18n.fallbackLocale.default': "fallbackLocale is missing in manifest.json, use: {locale}";
24
21
  readonly 'i18n.fallbackLocale.missing': "./local/{locale}.json is missing";
25
22
  readonly 'easycom.conflict': "easycom component conflict: ";
26
- readonly 'dom2.compatible.component': "Vapor mode does not support the uni-app compatibility component {name}. The implementation file {file} was detected. Please use the standard UTS component implementation for this purpose.";
27
23
  readonly 'mp.component.args[0]': "The first parameter of {0} must be a static string";
28
24
  readonly 'mp.component.args[1]': "{0} requires two parameters";
29
25
  readonly 'mp.360.unsupported': "360 is unsupported";
@@ -2,9 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
4
4
  'app.compiler.version': 'Compiler version: {version}',
5
- 'view.render.compiler.target': 'Current view.render compile target: {target}',
6
- 'view.render.compiler.target.bytecode': 'bytecode',
7
- 'view.render.compiler.target.nativecode': 'nativecode',
8
5
  'style.isolation.version': 'Style isolation version: {version}',
9
6
  compiling: 'Compiling...',
10
7
  'dev.performance': 'Please note that in running mode, due to log output, sourcemap, and uncompressed source code, the performance and package size are not as good as release mode.',
@@ -25,7 +22,6 @@ exports.default = {
25
22
  'i18n.fallbackLocale.default': 'fallbackLocale is missing in manifest.json, use: {locale}',
26
23
  'i18n.fallbackLocale.missing': './local/{locale}.json is missing',
27
24
  'easycom.conflict': 'easycom component conflict: ',
28
- 'dom2.compatible.component': 'Vapor mode does not support the uni-app compatibility component {name}. The implementation file {file} was detected. Please use the standard UTS component implementation for this purpose.',
29
25
  'mp.component.args[0]': 'The first parameter of {0} must be a static string',
30
26
  'mp.component.args[1]': '{0} requires two parameters',
31
27
  'mp.360.unsupported': '360 is unsupported',
@@ -1,8 +1,5 @@
1
1
  export declare const M: {
2
2
  readonly 'app.compiler.version': "编译器版本:{version}";
3
- readonly 'view.render.compiler.target': "当前视图层编译目标:{target}";
4
- readonly 'view.render.compiler.target.bytecode': "字节码";
5
- readonly 'view.render.compiler.target.nativecode': "机器码";
6
3
  readonly 'style.isolation.version': "当前样式隔离策略:{version}。详见:https://doc.dcloud.net.cn/uni-app-x/css/common/style-isolation.html";
7
4
  readonly compiling: "正在编译中...";
8
5
  readonly 'dev.performance': "请注意运行模式下,因日志输出、sourcemap 以及未压缩源码等原因,性能和包体积,均不及发行模式。";
@@ -23,7 +20,6 @@ export declare const M: {
23
20
  readonly 'i18n.fallbackLocale.default': "当前应用未在 manifest.json 配置 fallbackLocale,默认使用:{locale}";
24
21
  readonly 'i18n.fallbackLocale.missing': "当前应用配置的 fallbackLocale 或 locale 为:{locale},但 locale 目录缺少该语言文件";
25
22
  readonly 'easycom.conflict': "easycom组件冲突:";
26
- readonly 'dom2.compatible.component': "蒸汽模式不支持 uni-app 兼容模式组件 {name},检测到其实现文件为 {file}。请改用标准模式的UTS组件实现来实现。";
27
23
  readonly 'mp.component.args[0]': "{0}的第一个参数必须为静态字符串";
28
24
  readonly 'mp.component.args[1]': "{0}需要两个参数";
29
25
  readonly 'mp.360.unsupported': "vue3暂不支持360小程序";
@@ -56,9 +52,6 @@ export declare const M: {
56
52
  readonly 'pages.json.tabbar.page.notfound': "tabBar 中配置的页面 \"{pagePath}\" 未在 pages.json 中注册。";
57
53
  } | {
58
54
  readonly 'app.compiler.version': "Compiler version: {version}";
59
- readonly 'view.render.compiler.target': "Current view.render compile target: {target}";
60
- readonly 'view.render.compiler.target.bytecode': "bytecode";
61
- readonly 'view.render.compiler.target.nativecode': "nativecode";
62
55
  readonly 'style.isolation.version': "Style isolation version: {version}";
63
56
  readonly compiling: "Compiling...";
64
57
  readonly 'dev.performance': "Please note that in running mode, due to log output, sourcemap, and uncompressed source code, the performance and package size are not as good as release mode.";
@@ -79,7 +72,6 @@ export declare const M: {
79
72
  readonly 'i18n.fallbackLocale.default': "fallbackLocale is missing in manifest.json, use: {locale}";
80
73
  readonly 'i18n.fallbackLocale.missing': "./local/{locale}.json is missing";
81
74
  readonly 'easycom.conflict': "easycom component conflict: ";
82
- readonly 'dom2.compatible.component': "Vapor mode does not support the uni-app compatibility component {name}. The implementation file {file} was detected. Please use the standard UTS component implementation for this purpose.";
83
75
  readonly 'mp.component.args[0]': "The first parameter of {0} must be a static string";
84
76
  readonly 'mp.component.args[1]': "{0} requires two parameters";
85
77
  readonly 'mp.360.unsupported': "360 is unsupported";
@@ -1,8 +1,5 @@
1
1
  declare const _default: {
2
2
  readonly 'app.compiler.version': "编译器版本:{version}";
3
- readonly 'view.render.compiler.target': "当前视图层编译目标:{target}";
4
- readonly 'view.render.compiler.target.bytecode': "字节码";
5
- readonly 'view.render.compiler.target.nativecode': "机器码";
6
3
  readonly 'style.isolation.version': "当前样式隔离策略:{version}。详见:https://doc.dcloud.net.cn/uni-app-x/css/common/style-isolation.html";
7
4
  readonly compiling: "正在编译中...";
8
5
  readonly 'dev.performance': "请注意运行模式下,因日志输出、sourcemap 以及未压缩源码等原因,性能和包体积,均不及发行模式。";
@@ -23,7 +20,6 @@ declare const _default: {
23
20
  readonly 'i18n.fallbackLocale.default': "当前应用未在 manifest.json 配置 fallbackLocale,默认使用:{locale}";
24
21
  readonly 'i18n.fallbackLocale.missing': "当前应用配置的 fallbackLocale 或 locale 为:{locale},但 locale 目录缺少该语言文件";
25
22
  readonly 'easycom.conflict': "easycom组件冲突:";
26
- readonly 'dom2.compatible.component': "蒸汽模式不支持 uni-app 兼容模式组件 {name},检测到其实现文件为 {file}。请改用标准模式的UTS组件实现来实现。";
27
23
  readonly 'mp.component.args[0]': "{0}的第一个参数必须为静态字符串";
28
24
  readonly 'mp.component.args[1]': "{0}需要两个参数";
29
25
  readonly 'mp.360.unsupported': "vue3暂不支持360小程序";
@@ -2,9 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
4
4
  'app.compiler.version': '编译器版本:{version}',
5
- 'view.render.compiler.target': '当前视图层编译目标:{target}',
6
- 'view.render.compiler.target.bytecode': '字节码',
7
- 'view.render.compiler.target.nativecode': '机器码',
8
5
  'style.isolation.version': '当前样式隔离策略:{version}。详见:https://doc.dcloud.net.cn/uni-app-x/css/common/style-isolation.html',
9
6
  compiling: '正在编译中...',
10
7
  'dev.performance': '请注意运行模式下,因日志输出、sourcemap 以及未压缩源码等原因,性能和包体积,均不及发行模式。',
@@ -25,7 +22,6 @@ exports.default = {
25
22
  'i18n.fallbackLocale.default': '当前应用未在 manifest.json 配置 fallbackLocale,默认使用:{locale}',
26
23
  'i18n.fallbackLocale.missing': '当前应用配置的 fallbackLocale 或 locale 为:{locale},但 locale 目录缺少该语言文件',
27
24
  'easycom.conflict': 'easycom组件冲突:',
28
- 'dom2.compatible.component': '蒸汽模式不支持 uni-app 兼容模式组件 {name},检测到其实现文件为 {file}。请改用标准模式的UTS组件实现来实现。',
29
25
  'mp.component.args[0]': '{0}的第一个参数必须为静态字符串',
30
26
  'mp.component.args[1]': '{0}需要两个参数',
31
27
  'mp.360.unsupported': 'vue3暂不支持360小程序',
@@ -1,6 +1,5 @@
1
+ import type { PluginContext } from 'rollup';
1
2
  import { type ImportSpecifier } from 'es-module-lexer';
2
- import type { Rolldown } from 'vite';
3
- type PluginContext = Rolldown.PluginContext;
4
3
  /**
5
4
  * 暂时没用
6
5
  * @param source
@@ -11,4 +10,3 @@ type PluginContext = Rolldown.PluginContext;
11
10
  export declare function findVueComponentImports(source: string, importer: string, resolve: PluginContext['resolve']): Promise<(ImportSpecifier & {
12
11
  i: string;
13
12
  })[]>;
14
- export {};
package/dist/mp/style.js CHANGED
@@ -4,7 +4,6 @@ exports.transformPartSelector = exports.transformScopedCss = void 0;
4
4
  const tags_1 = require("./tags");
5
5
  const logs_1 = require("../logs");
6
6
  const uni_shared_1 = require("@dcloudio/uni-shared");
7
- const HTML_TAG_SELECTOR_RE = new RegExp(`/\\*[\\s\\S]*?(?:\\*/|$)|[\\s,}](${Object.keys(tags_1.HTML_TO_MINI_PROGRAM_TAGS).join('|')})\\s*(?=,|\\{)`, 'g');
8
7
  function transformScopedCss(cssCode) {
9
8
  checkHtmlTagSelector(cssCode);
10
9
  return cssCode.replace(/\[(data-v-[a-f0-9]{8})\]/gi, (_, scopedId) => {
@@ -19,11 +18,8 @@ function transformPartSelector(cssCode) {
19
18
  }
20
19
  exports.transformPartSelector = transformPartSelector;
21
20
  function checkHtmlTagSelector(cssCode) {
22
- HTML_TAG_SELECTOR_RE.lastIndex = 0;
23
- let match;
24
- while ((match = HTML_TAG_SELECTOR_RE.exec(cssCode))) {
25
- const tag = match[1];
26
- if (tag) {
21
+ for (const tag in tags_1.HTML_TO_MINI_PROGRAM_TAGS) {
22
+ if (new RegExp(`( |\n|\t|,|})${tag}( *)(,|{)`, 'g').test(cssCode)) {
27
23
  (0, logs_1.output)('warn', `小程序端 style 暂不支持 ${tag} 标签选择器,推荐使用 class 选择器,详情参考:https://uniapp.dcloud.net.cn/tutorial/migration-to-vue3.html#style`);
28
24
  break;
29
25
  }
@@ -1,7 +1,6 @@
1
- import type { Rolldown } from 'vite';
1
+ import type { EmittedAsset } from 'rollup';
2
2
  import type { AttributeNode, DirectiveNode, ElementNode } from '@vue/compiler-core';
3
3
  import type { MiniProgramComponentsType } from '../json/mp/types';
4
- type EmittedAsset = Rolldown.EmittedAsset;
5
4
  type LazyElementFn = (node: ElementNode, context: {
6
5
  isMiniProgramComponent(name: string): MiniProgramComponentsType | undefined;
7
6
  }) => {
@@ -1,6 +1,5 @@
1
1
  import { type ImportDeclaration, type Program } from '@babel/types';
2
- import type { Rolldown } from 'vite';
3
- type PluginContext = Rolldown.PluginContext;
2
+ import type { PluginContext } from 'rollup';
4
3
  type BindingComponents = Record<string, {
5
4
  tag: string;
6
5
  type: 'unknown' | 'setup' | 'self';
@@ -32,7 +32,6 @@ export interface EncryptPackageJson {
32
32
  dependencies: string[];
33
33
  artifacts: {
34
34
  env: {
35
- vapor: boolean;
36
35
  compilerVersion: string;
37
36
  } & Record<string, any>;
38
37
  apis: string[];
@@ -46,7 +45,7 @@ export interface EncryptPackageJson {
46
45
  };
47
46
  };
48
47
  }
49
- export declare function initCheckEnv(): Record<string, unknown>;
48
+ export declare function initCheckEnv(): Record<string, string>;
50
49
  export declare function resolveEncryptUniModule(id: string, platform: typeof process.env.UNI_UTS_PLATFORM, isX?: boolean): string | undefined;
51
50
  type CloudCompileSdkType = 'utssdk' | 'easycom' | 'all';
52
51
  export interface CloudCompileParams {
@@ -323,7 +323,6 @@ function findUniModuleFiles(platform, id, inputDir) {
323
323
  function initCheckEnv() {
324
324
  return {
325
325
  // 云端编译的版本号不带日期及小版本
326
- vapor: process.env.UNI_APP_X_DOM2 === 'true',
327
326
  compilerVersion: process.env.UNI_COMPILER_VERSION,
328
327
  };
329
328
  }
package/dist/uts.d.ts CHANGED
@@ -11,7 +11,6 @@ import type { EasycomMatcher } from './easycom';
11
11
  */
12
12
  export declare function resolveUTSAppModule(platform: typeof process.env.UNI_UTS_PLATFORM, id: string, importer: string, includeUTSSDK?: boolean): string | undefined;
13
13
  export declare function resolveUTSModule(id: string, importer: string, includeUTSSDK?: boolean): string | undefined;
14
- export declare function hasUTSModulePlatformFile(pluginDir: string, platform: typeof process.env.UNI_UTS_PLATFORM): boolean;
15
14
  export declare function resolveUTSCompiler(throwError?: boolean): typeof UTSCompiler;
16
15
  export declare function resolveUTSCompilerVersion(): string;
17
16
  interface UTSComponentMeta {