@dcloudio/uni-cli-shared 3.0.0-alpha-1000920260522733 → 3.0.0-alpha-5010120260522001

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 (40) hide show
  1. package/dist/hbx/alias.js +2 -21
  2. package/dist/json/app/pages/definePage.js +1 -1
  3. package/dist/messages/en.d.ts +1 -0
  4. package/dist/messages/en.js +1 -0
  5. package/dist/messages/index.d.ts +2 -0
  6. package/dist/messages/zh_CN.d.ts +1 -0
  7. package/dist/messages/zh_CN.js +1 -0
  8. package/dist/vite/cloud.js +0 -2
  9. package/dist/vite/plugins/console.js +1 -2
  10. package/dist/vite/plugins/stats.js +26 -0
  11. package/dist/vite/plugins/vitejs/plugins/asset.d.ts +0 -1
  12. package/dist/vite/plugins/vitejs/plugins/asset.js +0 -2
  13. package/dist/vite/plugins/vitejs/plugins/css.js +0 -3
  14. package/dist/vue/transforms/x/transformDirection.js +33 -4
  15. package/dist/watcher.d.ts +0 -1
  16. package/lib/@vue/compiler-core/dist/compiler-core.cjs.js +23 -16
  17. package/lib/@vue/compiler-core/dist/compiler-core.cjs.prod.js +23 -16
  18. package/lib/@vue/compiler-core/dist/compiler-core.esm-bundler.js +23 -16
  19. package/lib/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +66 -23
  20. package/lib/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js +115 -67
  21. package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.cjs.js +1 -1
  22. package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.cjs.prod.js +1 -1
  23. package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.esm-bundler.js +1 -1
  24. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.cjs.js +1 -1
  25. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +1 -1
  26. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-browser.js +1 -1
  27. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-browser.prod.js +1 -1
  28. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js +1 -1
  29. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.global.js +1 -1
  30. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.global.prod.js +1 -1
  31. package/lib/dom2/app/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +3 -3
  32. package/lib/dom2/app/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js +201 -43
  33. package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.cjs.js +199 -41
  34. package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.d.ts +50 -12
  35. package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.esm-browser.js +212 -42
  36. package/lib/dom2/app/@vue/compiler-vapor-dom2/dist/compiler-vapor-dom2.cjs.js +1 -1
  37. package/lib/dom2/app/@vue/shared/dist/shared.cjs.js +1 -1
  38. package/lib/dom2/app/@vue/shared/dist/shared.cjs.prod.js +1 -1
  39. package/lib/dom2/app/@vue/shared/dist/shared.esm-bundler.js +1 -1
  40. package/package.json +8 -7
package/dist/hbx/alias.js CHANGED
@@ -78,27 +78,8 @@ function initModuleAlias() {
78
78
  if (process.env.UNI_APP_PLATFORM ||
79
79
  process.env.UNI_PLATFORM === 'app-harmony') {
80
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
- }
81
+ // 默认 app 平台使用 bytecode 目标
82
+ process.env.UNI_APP_X_VAPOR_RENDER_TARGET = 'bytecode';
102
83
  }
103
84
  if (process.env.UNI_APP_X_VAPOR_RENDER_TARGET?.includes('bytecode')) {
104
85
  process.env.UNI_APP_X_DOM2_DYNAMIC = 'true';
@@ -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');
@@ -15,6 +15,7 @@ declare const _default: {
15
15
  readonly 'dev.watching.end.pages': "DONE Build complete. PAGES:{pages}";
16
16
  readonly 'dev.watching.end.files': "DONE Build complete. FILES:{files}";
17
17
  readonly 'dev.watching.restart.vapor': "DONE Restart required. Switching vapor mode requires restarting to take effect.";
18
+ readonly 'dev.watching.vapor.render.target': "vapor-render-target in manifest.json was changed to {manifestTarget}, but the running console is still {runtimeTarget}.";
18
19
  readonly 'build.failed': "DONE Build failed.";
19
20
  readonly 'compiler.build.failed': "Build failed with errors.";
20
21
  readonly 'stat.warn.appid': "The current application is not configured with Appid, and uni statistics cannot be used. For details, see https://ask.dcloud.net.cn/article/36303";
@@ -17,6 +17,7 @@ exports.default = {
17
17
  'dev.watching.end.pages': 'DONE Build complete. PAGES:{pages}',
18
18
  'dev.watching.end.files': 'DONE Build complete. FILES:{files}',
19
19
  'dev.watching.restart.vapor': 'DONE Restart required. Switching vapor mode requires restarting to take effect.',
20
+ 'dev.watching.vapor.render.target': 'vapor-render-target in manifest.json was changed to {manifestTarget}, but the running console is still {runtimeTarget}.',
20
21
  'build.failed': 'DONE Build failed.',
21
22
  'compiler.build.failed': 'Build failed with errors.',
22
23
  'stat.warn.appid': 'The current application is not configured with Appid, and uni statistics cannot be used. For details, see https://ask.dcloud.net.cn/article/36303',
@@ -15,6 +15,7 @@ export declare const M: {
15
15
  readonly 'dev.watching.end.pages': "DONE Build complete. PAGES:{pages}";
16
16
  readonly 'dev.watching.end.files': "DONE Build complete. FILES:{files}";
17
17
  readonly 'dev.watching.restart.vapor': "DONE Restart required. 切换蒸汽模式需要重新运行才能生效。";
18
+ readonly 'dev.watching.vapor.render.target': "manifest.json 中更改了视图层编译目标为{manifestTarget},但注意运行控制台还是{runtimeTarget}。";
18
19
  readonly 'build.failed': "DONE Build failed.";
19
20
  readonly 'compiler.build.failed': "编译失败";
20
21
  readonly 'stat.warn.appid': "当前应用未配置 appid,无法使用 uni 统计,详情参考:https://ask.dcloud.net.cn/article/36303";
@@ -71,6 +72,7 @@ export declare const M: {
71
72
  readonly 'dev.watching.end.pages': "DONE Build complete. PAGES:{pages}";
72
73
  readonly 'dev.watching.end.files': "DONE Build complete. FILES:{files}";
73
74
  readonly 'dev.watching.restart.vapor': "DONE Restart required. Switching vapor mode requires restarting to take effect.";
75
+ readonly 'dev.watching.vapor.render.target': "vapor-render-target in manifest.json was changed to {manifestTarget}, but the running console is still {runtimeTarget}.";
74
76
  readonly 'build.failed': "DONE Build failed.";
75
77
  readonly 'compiler.build.failed': "Build failed with errors.";
76
78
  readonly 'stat.warn.appid': "The current application is not configured with Appid, and uni statistics cannot be used. For details, see https://ask.dcloud.net.cn/article/36303";
@@ -15,6 +15,7 @@ declare const _default: {
15
15
  readonly 'dev.watching.end.pages': "DONE Build complete. PAGES:{pages}";
16
16
  readonly 'dev.watching.end.files': "DONE Build complete. FILES:{files}";
17
17
  readonly 'dev.watching.restart.vapor': "DONE Restart required. 切换蒸汽模式需要重新运行才能生效。";
18
+ readonly 'dev.watching.vapor.render.target': "manifest.json 中更改了视图层编译目标为{manifestTarget},但注意运行控制台还是{runtimeTarget}。";
18
19
  readonly 'build.failed': "DONE Build failed.";
19
20
  readonly 'compiler.build.failed': "编译失败";
20
21
  readonly 'stat.warn.appid': "当前应用未配置 appid,无法使用 uni 统计,详情参考:https://ask.dcloud.net.cn/article/36303";
@@ -17,6 +17,7 @@ exports.default = {
17
17
  'dev.watching.end.pages': 'DONE Build complete. PAGES:{pages}',
18
18
  'dev.watching.end.files': 'DONE Build complete. FILES:{files}',
19
19
  'dev.watching.restart.vapor': 'DONE Restart required. 切换蒸汽模式需要重新运行才能生效。',
20
+ 'dev.watching.vapor.render.target': 'manifest.json 中更改了视图层编译目标为{manifestTarget},但注意运行控制台还是{runtimeTarget}。',
20
21
  'build.failed': 'DONE Build failed.',
21
22
  'compiler.build.failed': '编译失败',
22
23
  'stat.warn.appid': '当前应用未配置 appid,无法使用 uni 统计,详情参考:https://ask.dcloud.net.cn/article/36303',
@@ -135,9 +135,7 @@ function uniEncryptUniModulesPlugin() {
135
135
  type: 'asset',
136
136
  fileName: pkg,
137
137
  name: pkg,
138
- names: [pkg],
139
138
  originalFileName: null,
140
- originalFileNames: [],
141
139
  needsCodeReference: false,
142
140
  source: genUniModulesPackageJson(uniModuleId, process.env.UNI_INPUT_DIR, {
143
141
  env: (0, uni_modules_cloud_1.initCheckEnv)(),
@@ -22,8 +22,7 @@ function uniConsolePlugin(options) {
22
22
  resolvedConfig = config;
23
23
  // 理论上发行模式就不应该有这个逻辑了,只不过为了尽量不引发兼容性问题,目前严谨一些判断是否配置了 drop_console
24
24
  if (process.env.NODE_ENV !== 'development') {
25
- const compressOptions = resolvedConfig.build.terserOptions
26
- ?.compress;
25
+ const compressOptions = resolvedConfig.build.terserOptions?.compress;
27
26
  if (compressOptions && typeof compressOptions === 'object') {
28
27
  dropConsole = !!compressOptions.drop_console;
29
28
  }
@@ -9,6 +9,23 @@ const utils_1 = require("../../utils");
9
9
  const json_1 = require("../../json");
10
10
  const messages_1 = require("../../messages");
11
11
  const emittedHashMap = new WeakMap();
12
+ function normalizeVaporRenderTarget(target) {
13
+ if (typeof target !== 'string') {
14
+ return;
15
+ }
16
+ if (target.includes('bytecode')) {
17
+ return 'bytecode';
18
+ }
19
+ if (target.includes('nativecode')) {
20
+ return 'nativecode';
21
+ }
22
+ }
23
+ function formatVaporRenderTarget(target) {
24
+ return messages_1.M[`view.render.compiler.target.${target}`];
25
+ }
26
+ function getManifestVaporRenderTarget(manifest) {
27
+ return normalizeVaporRenderTarget(manifest['uni-app-x']?.['vapor-render-target']);
28
+ }
12
29
  function uniStatsPlugin() {
13
30
  let resolvedConfig;
14
31
  let isManifestChanged = false;
@@ -28,6 +45,15 @@ function uniStatsPlugin() {
28
45
  try {
29
46
  const manifest = (0, json_1.parseJson)(fs_extra_1.default.readFileSync(id, 'utf-8'), true, 'manifest.json');
30
47
  const uniAppX = manifest['uni-app-x'] || {};
48
+ const vaporRenderTarget = getManifestVaporRenderTarget(manifest);
49
+ const runtimeVaporRenderTarget = normalizeVaporRenderTarget(process.env.UNI_APP_X_VAPOR_RENDER_TARGET);
50
+ if (vaporRenderTarget &&
51
+ runtimeVaporRenderTarget &&
52
+ vaporRenderTarget !== runtimeVaporRenderTarget) {
53
+ console.warn(messages_1.M['dev.watching.vapor.render.target']
54
+ .replace('{manifestTarget}', formatVaporRenderTarget(vaporRenderTarget))
55
+ .replace('{runtimeTarget}', formatVaporRenderTarget(runtimeVaporRenderTarget)));
56
+ }
31
57
  if (uniAppX.vapor !== isVapor) {
32
58
  isVapor = uniAppX.vapor === true;
33
59
  console.warn(messages_1.M['dev.watching.restart.vapor']);
@@ -1,5 +1,4 @@
1
1
  /// <reference types="node" />
2
- /// <reference types="node" />
3
2
  import type { OutputOptions, PluginContext, RenderedChunk } from 'rollup';
4
3
  import type { Plugin } from '../plugin';
5
4
  import type { ResolvedConfig } from '../config';
@@ -237,9 +237,7 @@ function assetFileNamesToFileName(assetFileNames, file, contentHash, content) {
237
237
  if ((0, shared_1.isFunction)(assetFileNames)) {
238
238
  assetFileNames = assetFileNames({
239
239
  name: file,
240
- names: [file],
241
240
  originalFileName: null,
242
- originalFileNames: [],
243
241
  source: content,
244
242
  type: 'asset',
245
243
  });
@@ -935,9 +935,6 @@ const scss = async (source, root, options, resolvers, isNVue) => {
935
935
  if (err) {
936
936
  reject(err);
937
937
  }
938
- else if (!res) {
939
- reject(new Error('Sass render result is empty.'));
940
- }
941
938
  else {
942
939
  resolve(res);
943
940
  }
@@ -4,6 +4,7 @@ exports.transformDirection = void 0;
4
4
  const vite_1 = require("../../../vite");
5
5
  const utils_1 = require("../../utils");
6
6
  const compiler_core_1 = require("@vue/compiler-core");
7
+ const shared_1 = require("@vue/shared");
7
8
  /**
8
9
  * 将direction属性转化为scroll-x和scroll-y
9
10
  * 注意transformMPBuiltInTag内会讲list-view转化为scroll-view,所以此transform应该在transformMPBuiltInTag之后执行
@@ -27,7 +28,7 @@ const transformDirection = function (node, context) {
27
28
  return;
28
29
  }
29
30
  const directionProp = node.props[directionPropIndex];
30
- if (directionProp.type === compiler_core_1.NodeTypes.ATTRIBUTE) {
31
+ if ((0, vite_1.isAttributeNode)(directionProp)) {
31
32
  const directionValue = directionProp.value?.content;
32
33
  const scrollX = directionValue === 'horizontal' || directionValue === 'all';
33
34
  const scrollY = !directionValue ||
@@ -39,12 +40,16 @@ const transformDirection = function (node, context) {
39
40
  }
40
41
  else if (directionProp.type === compiler_core_1.NodeTypes.DIRECTIVE) {
41
42
  if (!directionProp.arg ||
42
- directionProp.arg.type !== compiler_core_1.NodeTypes.SIMPLE_EXPRESSION ||
43
+ !(0, vite_1.isSimpleExpressionNode)(directionProp.arg) ||
43
44
  !directionProp.exp ||
44
- directionProp.exp.type !== compiler_core_1.NodeTypes.SIMPLE_EXPRESSION) {
45
+ !((0, vite_1.isSimpleExpressionNode)(directionProp.exp) ||
46
+ (0, vite_1.isCompoundExpressionNode)(directionProp.exp))) {
47
+ return;
48
+ }
49
+ const exp = stringifyExpression(directionProp.exp);
50
+ if (!exp) {
45
51
  return;
46
52
  }
47
- const exp = directionProp.exp.content;
48
53
  const scrollX = `(${exp}) === 'horizontal' || (${exp}) === 'all'`;
49
54
  const scrollY = `!(${exp}) || (${exp}) === 'vertical' || (${exp}) === 'all'`;
50
55
  node.props.splice(directionPropIndex, 1);
@@ -53,3 +58,27 @@ const transformDirection = function (node, context) {
53
58
  }
54
59
  };
55
60
  exports.transformDirection = transformDirection;
61
+ function stringifyExpression(exp) {
62
+ if ((0, vite_1.isSimpleExpressionNode)(exp)) {
63
+ return exp.content;
64
+ }
65
+ if ((0, vite_1.isCompoundExpressionNode)(exp)) {
66
+ const children = [];
67
+ for (const child of exp.children) {
68
+ if ((0, shared_1.isString)(child)) {
69
+ children.push(child);
70
+ }
71
+ else if ((0, shared_1.isSymbol)(child)) {
72
+ return;
73
+ }
74
+ else {
75
+ const content = stringifyExpression(child);
76
+ if (content === undefined) {
77
+ return;
78
+ }
79
+ children.push(content);
80
+ }
81
+ }
82
+ return children.join('');
83
+ }
84
+ }
package/dist/watcher.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  /// <reference types="node" />
2
- /// <reference types="node" />
3
2
  import { type FSWatcher, type WatchOptions } from 'chokidar';
4
3
  type FileTransform = (source: Buffer, filename: string) => void | string;
5
4
  export interface FileWatcherOptions {
@@ -374,6 +374,12 @@ function convertToBlock(node, { helper, removeHelper, inSSR }) {
374
374
  }
375
375
  }
376
376
 
377
+ var __defProp = Object.defineProperty;
378
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
379
+ var __publicField = (obj, key, value) => {
380
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
381
+ return value;
382
+ };
377
383
  const defaultDelimitersOpen = new Uint8Array([123, 123]);
378
384
  const defaultDelimitersClose = new Uint8Array([125, 125]);
379
385
  function isTagStartChar(c) {
@@ -424,31 +430,32 @@ class Tokenizer {
424
430
  this.stack = stack;
425
431
  this.cbs = cbs;
426
432
  /** The current state the tokenizer is in. */
427
- this.state = 1;
433
+ __publicField(this, "state", 1);
428
434
  /** The read buffer. */
429
- this.buffer = "";
435
+ __publicField(this, "buffer", "");
430
436
  /** The beginning of the section that is currently being read. */
431
- this.sectionStart = 0;
437
+ __publicField(this, "sectionStart", 0);
432
438
  /** The index within the buffer that we are currently looking at. */
433
- this.index = 0;
439
+ __publicField(this, "index", 0);
434
440
  /** The start of the last entity. */
435
- this.entityStart = 0;
441
+ __publicField(this, "entityStart", 0);
436
442
  /** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */
437
- this.baseState = 1;
443
+ __publicField(this, "baseState", 1);
438
444
  /** For special parsing behavior inside of script and style tags. */
439
- this.inRCDATA = false;
445
+ __publicField(this, "inRCDATA", false);
440
446
  /** For disabling RCDATA tags handling */
441
- this.inXML = false;
447
+ __publicField(this, "inXML", false);
442
448
  /** For disabling interpolation parsing in v-pre */
443
- this.inVPre = false;
449
+ __publicField(this, "inVPre", false);
444
450
  /** Record newline positions for fast line / column calculation */
445
- this.newlines = [];
446
- this.mode = 0;
447
- this.delimiterOpen = defaultDelimitersOpen;
448
- this.delimiterClose = defaultDelimitersClose;
449
- this.delimiterIndex = -1;
450
- this.currentSequence = void 0;
451
- this.sequenceIndex = 0;
451
+ __publicField(this, "newlines", []);
452
+ __publicField(this, "entityDecoder");
453
+ __publicField(this, "mode", 0);
454
+ __publicField(this, "delimiterOpen", defaultDelimitersOpen);
455
+ __publicField(this, "delimiterClose", defaultDelimitersClose);
456
+ __publicField(this, "delimiterIndex", -1);
457
+ __publicField(this, "currentSequence");
458
+ __publicField(this, "sequenceIndex", 0);
452
459
  {
453
460
  this.entityDecoder = new decode_js.EntityDecoder(
454
461
  decode_js.htmlDecodeTree,
@@ -374,6 +374,12 @@ function convertToBlock(node, { helper, removeHelper, inSSR }) {
374
374
  }
375
375
  }
376
376
 
377
+ var __defProp = Object.defineProperty;
378
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
379
+ var __publicField = (obj, key, value) => {
380
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
381
+ return value;
382
+ };
377
383
  const defaultDelimitersOpen = new Uint8Array([123, 123]);
378
384
  const defaultDelimitersClose = new Uint8Array([125, 125]);
379
385
  function isTagStartChar(c) {
@@ -424,31 +430,32 @@ class Tokenizer {
424
430
  this.stack = stack;
425
431
  this.cbs = cbs;
426
432
  /** The current state the tokenizer is in. */
427
- this.state = 1;
433
+ __publicField(this, "state", 1);
428
434
  /** The read buffer. */
429
- this.buffer = "";
435
+ __publicField(this, "buffer", "");
430
436
  /** The beginning of the section that is currently being read. */
431
- this.sectionStart = 0;
437
+ __publicField(this, "sectionStart", 0);
432
438
  /** The index within the buffer that we are currently looking at. */
433
- this.index = 0;
439
+ __publicField(this, "index", 0);
434
440
  /** The start of the last entity. */
435
- this.entityStart = 0;
441
+ __publicField(this, "entityStart", 0);
436
442
  /** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */
437
- this.baseState = 1;
443
+ __publicField(this, "baseState", 1);
438
444
  /** For special parsing behavior inside of script and style tags. */
439
- this.inRCDATA = false;
445
+ __publicField(this, "inRCDATA", false);
440
446
  /** For disabling RCDATA tags handling */
441
- this.inXML = false;
447
+ __publicField(this, "inXML", false);
442
448
  /** For disabling interpolation parsing in v-pre */
443
- this.inVPre = false;
449
+ __publicField(this, "inVPre", false);
444
450
  /** Record newline positions for fast line / column calculation */
445
- this.newlines = [];
446
- this.mode = 0;
447
- this.delimiterOpen = defaultDelimitersOpen;
448
- this.delimiterClose = defaultDelimitersClose;
449
- this.delimiterIndex = -1;
450
- this.currentSequence = void 0;
451
- this.sequenceIndex = 0;
451
+ __publicField(this, "newlines", []);
452
+ __publicField(this, "entityDecoder");
453
+ __publicField(this, "mode", 0);
454
+ __publicField(this, "delimiterOpen", defaultDelimitersOpen);
455
+ __publicField(this, "delimiterClose", defaultDelimitersClose);
456
+ __publicField(this, "delimiterIndex", -1);
457
+ __publicField(this, "currentSequence");
458
+ __publicField(this, "sequenceIndex", 0);
452
459
  {
453
460
  this.entityDecoder = new decode_js.EntityDecoder(
454
461
  decode_js.htmlDecodeTree,
@@ -368,6 +368,12 @@ function convertToBlock(node, { helper, removeHelper, inSSR }) {
368
368
  }
369
369
  }
370
370
 
371
+ var __defProp = Object.defineProperty;
372
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
373
+ var __publicField = (obj, key, value) => {
374
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
375
+ return value;
376
+ };
371
377
  const defaultDelimitersOpen = new Uint8Array([123, 123]);
372
378
  const defaultDelimitersClose = new Uint8Array([125, 125]);
373
379
  function isTagStartChar(c) {
@@ -418,31 +424,32 @@ class Tokenizer {
418
424
  this.stack = stack;
419
425
  this.cbs = cbs;
420
426
  /** The current state the tokenizer is in. */
421
- this.state = 1;
427
+ __publicField(this, "state", 1);
422
428
  /** The read buffer. */
423
- this.buffer = "";
429
+ __publicField(this, "buffer", "");
424
430
  /** The beginning of the section that is currently being read. */
425
- this.sectionStart = 0;
431
+ __publicField(this, "sectionStart", 0);
426
432
  /** The index within the buffer that we are currently looking at. */
427
- this.index = 0;
433
+ __publicField(this, "index", 0);
428
434
  /** The start of the last entity. */
429
- this.entityStart = 0;
435
+ __publicField(this, "entityStart", 0);
430
436
  /** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */
431
- this.baseState = 1;
437
+ __publicField(this, "baseState", 1);
432
438
  /** For special parsing behavior inside of script and style tags. */
433
- this.inRCDATA = false;
439
+ __publicField(this, "inRCDATA", false);
434
440
  /** For disabling RCDATA tags handling */
435
- this.inXML = false;
441
+ __publicField(this, "inXML", false);
436
442
  /** For disabling interpolation parsing in v-pre */
437
- this.inVPre = false;
443
+ __publicField(this, "inVPre", false);
438
444
  /** Record newline positions for fast line / column calculation */
439
- this.newlines = [];
440
- this.mode = 0;
441
- this.delimiterOpen = defaultDelimitersOpen;
442
- this.delimiterClose = defaultDelimitersClose;
443
- this.delimiterIndex = -1;
444
- this.currentSequence = void 0;
445
- this.sequenceIndex = 0;
445
+ __publicField(this, "newlines", []);
446
+ __publicField(this, "entityDecoder");
447
+ __publicField(this, "mode", 0);
448
+ __publicField(this, "delimiterOpen", defaultDelimitersOpen);
449
+ __publicField(this, "delimiterClose", defaultDelimitersClose);
450
+ __publicField(this, "delimiterIndex", -1);
451
+ __publicField(this, "currentSequence");
452
+ __publicField(this, "sequenceIndex", 0);
446
453
  }
447
454
  get inSFCRoot() {
448
455
  return this.mode === 2 && this.stack.length === 0;
@@ -19032,33 +19032,70 @@ function getObjectOrArrayExpressionKeys(value) {
19032
19032
  return [];
19033
19033
  }
19034
19034
 
19035
+ var __defProp$1 = Object.defineProperty;
19036
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19037
+ var __publicField$1 = (obj, key, value) => {
19038
+ __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
19039
+ return value;
19040
+ };
19035
19041
  var _a, _b;
19036
19042
  class ScriptCompileContext {
19037
19043
  constructor(descriptor, options) {
19038
19044
  this.descriptor = descriptor;
19039
19045
  this.options = options;
19040
- this.isCE = false;
19041
- this.source = this.descriptor.source;
19042
- this.filename = this.descriptor.filename;
19043
- this.s = new MagicString(this.source);
19044
- this.startOffset = (_a = this.descriptor.scriptSetup) == null ? void 0 : _a.loc.start.offset;
19045
- this.endOffset = (_b = this.descriptor.scriptSetup) == null ? void 0 : _b.loc.end.offset;
19046
- this.userImports = /* @__PURE__ */ Object.create(null);
19046
+ __publicField$1(this, "isJS");
19047
+ __publicField$1(this, "isTS");
19048
+ // fixed by xxxxxx
19049
+ __publicField$1(this, "isUTS");
19050
+ __publicField$1(this, "isCE", false);
19051
+ __publicField$1(this, "scriptAst");
19052
+ __publicField$1(this, "scriptSetupAst");
19053
+ __publicField$1(this, "source", this.descriptor.source);
19054
+ __publicField$1(this, "filename", this.descriptor.filename);
19055
+ __publicField$1(this, "s", new MagicString(this.source));
19056
+ __publicField$1(this, "startOffset", (_a = this.descriptor.scriptSetup) == null ? void 0 : _a.loc.start.offset);
19057
+ __publicField$1(this, "endOffset", (_b = this.descriptor.scriptSetup) == null ? void 0 : _b.loc.end.offset);
19058
+ // import / type analysis
19059
+ __publicField$1(this, "scope");
19060
+ __publicField$1(this, "globalScopes");
19061
+ __publicField$1(this, "userImports", /* @__PURE__ */ Object.create(null));
19047
19062
  // macros presence check
19048
- this.hasDefinePropsCall = false;
19049
- this.hasDefineEmitCall = false;
19050
- this.hasDefineExposeCall = false;
19051
- this.hasDefaultExportName = false;
19052
- this.hasDefaultExportRender = false;
19053
- this.hasDefineOptionsCall = false;
19054
- this.hasDefineSlotsCall = false;
19055
- this.hasDefineModelCall = false;
19056
- this.propsDestructuredBindings = /* @__PURE__ */ Object.create(null);
19063
+ __publicField$1(this, "hasDefinePropsCall", false);
19064
+ __publicField$1(this, "hasDefineEmitCall", false);
19065
+ __publicField$1(this, "hasDefineExposeCall", false);
19066
+ __publicField$1(this, "hasDefaultExportName", false);
19067
+ __publicField$1(this, "hasDefaultExportRender", false);
19068
+ __publicField$1(this, "hasDefineOptionsCall", false);
19069
+ __publicField$1(this, "hasDefineSlotsCall", false);
19070
+ __publicField$1(this, "hasDefineModelCall", false);
19071
+ // defineProps
19072
+ __publicField$1(this, "propsCall");
19073
+ __publicField$1(this, "propsDecl");
19074
+ __publicField$1(this, "propsRuntimeDecl");
19075
+ __publicField$1(this, "propsTypeDecl");
19076
+ __publicField$1(this, "propsDestructureDecl");
19077
+ __publicField$1(this, "propsDestructuredBindings", /* @__PURE__ */ Object.create(null));
19078
+ __publicField$1(this, "propsDestructureRestId");
19079
+ __publicField$1(this, "propsRuntimeDefaults");
19080
+ // defineEmits
19081
+ __publicField$1(this, "emitsRuntimeDecl");
19082
+ __publicField$1(this, "emitsTypeDecl");
19083
+ __publicField$1(this, "emitDecl");
19057
19084
  // defineModel
19058
- this.modelDecls = /* @__PURE__ */ Object.create(null);
19085
+ __publicField$1(this, "modelDecls", /* @__PURE__ */ Object.create(null));
19086
+ // defineOptions
19087
+ __publicField$1(this, "optionsRuntimeDecl");
19059
19088
  // codegen
19060
- this.bindingMetadata = {};
19061
- this.helperImports = /* @__PURE__ */ new Set();
19089
+ __publicField$1(this, "bindingMetadata", {});
19090
+ __publicField$1(this, "helperImports", /* @__PURE__ */ new Set());
19091
+ /**
19092
+ * to be exposed on compiled script block for HMR cache busting
19093
+ */
19094
+ __publicField$1(this, "deps");
19095
+ /**
19096
+ * cache for resolved fs
19097
+ */
19098
+ __publicField$1(this, "fs");
19062
19099
  const { script, scriptSetup } = descriptor;
19063
19100
  const scriptLang = script && script.lang;
19064
19101
  const scriptSetupLang = scriptSetup && scriptSetup.lang;
@@ -21340,6 +21377,12 @@ minimatch.Minimatch = Minimatch;
21340
21377
  minimatch.escape = escape;
21341
21378
  minimatch.unescape = unescape;
21342
21379
 
21380
+ var __defProp = Object.defineProperty;
21381
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
21382
+ var __publicField = (obj, key, value) => {
21383
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
21384
+ return value;
21385
+ };
21343
21386
  class TypeScope {
21344
21387
  constructor(filename, source, offset = 0, imports = /* @__PURE__ */ Object.create(null), types = /* @__PURE__ */ Object.create(null), declares = /* @__PURE__ */ Object.create(null)) {
21345
21388
  this.filename = filename;
@@ -21348,10 +21391,10 @@ class TypeScope {
21348
21391
  this.imports = imports;
21349
21392
  this.types = types;
21350
21393
  this.declares = declares;
21351
- this.isGenericScope = false;
21352
- this.resolvedImportSources = /* @__PURE__ */ Object.create(null);
21353
- this.exportedTypes = /* @__PURE__ */ Object.create(null);
21354
- this.exportedDeclares = /* @__PURE__ */ Object.create(null);
21394
+ __publicField(this, "isGenericScope", false);
21395
+ __publicField(this, "resolvedImportSources", /* @__PURE__ */ Object.create(null));
21396
+ __publicField(this, "exportedTypes", /* @__PURE__ */ Object.create(null));
21397
+ __publicField(this, "exportedDeclares", /* @__PURE__ */ Object.create(null));
21355
21398
  }
21356
21399
  }
21357
21400
  function resolveTypeElements(ctx, node, scope, typeParameters) {