weapp-vite 5.12.0 → 6.0.0-alpha.0

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 (51) hide show
  1. package/README.md +60 -2
  2. package/dist/auto-import-components/resolvers.cjs +6 -6
  3. package/dist/auto-import-components/resolvers.mjs +1 -1
  4. package/dist/auto-routes.cjs +9 -8
  5. package/dist/auto-routes.mjs +5 -4
  6. package/dist/{chunk-TS7WK45E.mjs → chunk-4P5KX3LT.mjs} +2736 -2346
  7. package/dist/{chunk-MDUMD5GP.mjs → chunk-5CBZRYDL.mjs} +1 -8
  8. package/dist/{chunk-INJNZ3X2.cjs → chunk-E34K6TPD.cjs} +2 -2
  9. package/dist/{chunk-ANDG4OME.cjs → chunk-EL4WI75Z.cjs} +2746 -2356
  10. package/dist/{chunk-7DRE4BEK.cjs → chunk-FB7KR7SH.cjs} +6 -6
  11. package/dist/chunk-IEICAJDZ.cjs +188 -0
  12. package/dist/chunk-MK4LDVBT.mjs +188 -0
  13. package/dist/{chunk-7KGGMLZZ.mjs → chunk-ML5KPLC5.mjs} +1 -1
  14. package/dist/{chunk-IVFT4TLR.mjs → chunk-O6633IWP.mjs} +1 -1
  15. package/dist/{chunk-MTUYQJIF.cjs → chunk-SJSLFDTA.cjs} +2 -2
  16. package/dist/{chunk-N5FVU7GR.cjs → chunk-TZGJRA2Y.cjs} +2 -9
  17. package/dist/chunk-UKTIE44Q.cjs +34 -0
  18. package/dist/{chunk-LLYDSPS7.mjs → chunk-VKLSO3EM.mjs} +2 -2
  19. package/dist/chunk-WYYIFHJZ.cjs +6 -0
  20. package/dist/chunk-YIVKT2UN.mjs +34 -0
  21. package/dist/{chunk-46VA2TEF.mjs → chunk-YXFADQPY.mjs} +1 -1
  22. package/dist/cli.cjs +117 -92
  23. package/dist/cli.mjs +33 -8
  24. package/dist/{config-sFIhUM69.d.ts → config-B6T_L15M.d.ts} +29 -0
  25. package/dist/{config-DgMm7Geo.d.cts → config-D5ATg2Pv.d.cts} +29 -0
  26. package/dist/config.cjs +4 -4
  27. package/dist/config.d.cts +1 -1
  28. package/dist/config.d.ts +1 -1
  29. package/dist/config.mjs +3 -3
  30. package/dist/file-KXULPGWG.mjs +29 -0
  31. package/dist/file-S6QIP4VW.cjs +29 -0
  32. package/dist/index.cjs +18 -9
  33. package/dist/index.d.cts +4 -2
  34. package/dist/index.d.ts +4 -2
  35. package/dist/index.mjs +15 -6
  36. package/dist/json.cjs +3 -3
  37. package/dist/json.d.cts +1 -1
  38. package/dist/json.d.ts +1 -1
  39. package/dist/json.mjs +2 -2
  40. package/dist/runtime.cjs +11 -0
  41. package/dist/runtime.d.cts +29 -0
  42. package/dist/runtime.d.ts +29 -0
  43. package/dist/runtime.mjs +11 -0
  44. package/dist/types.cjs +9 -9
  45. package/dist/types.d.cts +2 -1
  46. package/dist/types.d.ts +2 -1
  47. package/dist/types.mjs +2 -2
  48. package/dist/volar.cjs +2 -2
  49. package/dist/volar.mjs +1 -1
  50. package/package.json +19 -12
  51. package/dist/chunk-2KCQ5UBK.cjs +0 -6
package/dist/cli.mjs CHANGED
@@ -1,20 +1,22 @@
1
1
  import {
2
2
  createCompilerContext
3
- } from "./chunk-LLYDSPS7.mjs";
3
+ } from "./chunk-VKLSO3EM.mjs";
4
4
  import {
5
5
  DEFAULT_MP_PLATFORM,
6
6
  SHARED_CHUNK_VIRTUAL_PREFIX,
7
- VERSION,
8
7
  checkRuntime,
9
8
  createSharedBuildConfig,
10
9
  logger_default,
11
10
  normalizeMiniPlatform,
12
11
  resolveMiniPlatform,
13
12
  resolveWeappConfigFile
14
- } from "./chunk-TS7WK45E.mjs";
13
+ } from "./chunk-4P5KX3LT.mjs";
14
+ import {
15
+ VERSION
16
+ } from "./chunk-MK4LDVBT.mjs";
15
17
  import {
16
18
  init_esm_shims
17
- } from "./chunk-MDUMD5GP.mjs";
19
+ } from "./chunk-5CBZRYDL.mjs";
18
20
 
19
21
  // src/cli.ts
20
22
  init_esm_shims();
@@ -1386,6 +1388,7 @@ function registerAnalyzeCommand(cli2) {
1386
1388
 
1387
1389
  // src/cli/commands/build.ts
1388
1390
  init_esm_shims();
1391
+ import process4 from "process";
1389
1392
 
1390
1393
  // src/cli/logBuildAppFinish.ts
1391
1394
  init_esm_shims();
@@ -1639,8 +1642,30 @@ function registerBuildCommand(cli2) {
1639
1642
  if (analyzeHandle) {
1640
1643
  await analyzeHandle.waitForExit();
1641
1644
  }
1645
+ ctx.watcherService?.closeAll();
1646
+ terminateStaleSassEmbeddedProcess();
1642
1647
  });
1643
1648
  }
1649
+ function terminateStaleSassEmbeddedProcess() {
1650
+ const getHandles = process4._getActiveHandles;
1651
+ const handles = typeof getHandles === "function" ? getHandles() : void 0;
1652
+ if (!Array.isArray(handles)) {
1653
+ return;
1654
+ }
1655
+ for (const handle of handles) {
1656
+ if (isSassEmbeddedChild(handle)) {
1657
+ try {
1658
+ handle.kill();
1659
+ } catch {
1660
+ }
1661
+ }
1662
+ }
1663
+ }
1664
+ function isSassEmbeddedChild(handle) {
1665
+ return Boolean(
1666
+ handle && typeof handle === "object" && "kill" in handle && "spawnfile" in handle && typeof handle.spawnfile === "string" && handle.spawnfile?.includes("sass-embedded")
1667
+ );
1668
+ }
1644
1669
 
1645
1670
  // src/cli/commands/create.ts
1646
1671
  init_esm_shims();
@@ -1657,7 +1682,7 @@ import path5 from "pathe";
1657
1682
 
1658
1683
  // src/schematics.ts
1659
1684
  init_esm_shims();
1660
- import process4 from "process";
1685
+ import process5 from "process";
1661
1686
  import { generateJs, generateJson, generateWxml, generateWxss } from "@weapp-core/schematics";
1662
1687
  import { defu } from "@weapp-core/shared";
1663
1688
  import fs4 from "fs-extra";
@@ -1710,7 +1735,7 @@ async function generate(options) {
1710
1735
  extensions: {
1711
1736
  ...defaultExtensions
1712
1737
  },
1713
- cwd: process4.cwd(),
1738
+ cwd: process5.cwd(),
1714
1739
  templates: void 0
1715
1740
  });
1716
1741
  if (fileName === void 0) {
@@ -1764,12 +1789,12 @@ async function generate(options) {
1764
1789
 
1765
1790
  // src/cli/loadConfig.ts
1766
1791
  init_esm_shims();
1767
- import process5 from "process";
1792
+ import process6 from "process";
1768
1793
  import { defu as defu2 } from "@weapp-core/shared";
1769
1794
  import path4 from "pathe";
1770
1795
  import { loadConfigFromFile } from "vite";
1771
1796
  async function loadConfig(configFile) {
1772
- const cwd = process5.cwd();
1797
+ const cwd = process6.cwd();
1773
1798
  let resolvedConfigFile = configFile;
1774
1799
  if (resolvedConfigFile && !path4.isAbsolute(resolvedConfigFile)) {
1775
1800
  resolvedConfigFile = path4.resolve(cwd, resolvedConfigFile);
@@ -416,6 +416,35 @@ interface WeappViteConfig {
416
416
  */
417
417
  entry?: string | string[];
418
418
  };
419
+ /**
420
+ * @description Vue 单文件组件支持配置
421
+ */
422
+ vue?: {
423
+ /**
424
+ * @description 是否启用 Vue 支持
425
+ * @default true
426
+ */
427
+ enable?: boolean;
428
+ /**
429
+ * @description 模板编译选项
430
+ */
431
+ template?: {
432
+ /**
433
+ * @description 是否移除注释
434
+ * @default true
435
+ */
436
+ removeComments?: boolean;
437
+ /**
438
+ * @description 是否简化空白符
439
+ * @default true
440
+ */
441
+ simplifyWhitespace?: boolean;
442
+ };
443
+ /**
444
+ * @description 是否自动导入 Vue 组件
445
+ */
446
+ autoImport?: boolean;
447
+ };
419
448
  /**
420
449
  * @description 共享代码拆分策略配置
421
450
  */
@@ -416,6 +416,35 @@ interface WeappViteConfig {
416
416
  */
417
417
  entry?: string | string[];
418
418
  };
419
+ /**
420
+ * @description Vue 单文件组件支持配置
421
+ */
422
+ vue?: {
423
+ /**
424
+ * @description 是否启用 Vue 支持
425
+ * @default true
426
+ */
427
+ enable?: boolean;
428
+ /**
429
+ * @description 模板编译选项
430
+ */
431
+ template?: {
432
+ /**
433
+ * @description 是否移除注释
434
+ * @default true
435
+ */
436
+ removeComments?: boolean;
437
+ /**
438
+ * @description 是否简化空白符
439
+ * @default true
440
+ */
441
+ simplifyWhitespace?: boolean;
442
+ };
443
+ /**
444
+ * @description 是否自动导入 Vue 组件
445
+ */
446
+ autoImport?: boolean;
447
+ };
419
448
  /**
420
449
  * @description 共享代码拆分策略配置
421
450
  */
package/dist/config.cjs CHANGED
@@ -1,14 +1,14 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkINJNZ3X2cjs = require('./chunk-INJNZ3X2.cjs');
3
+ var _chunkE34K6TPDcjs = require('./chunk-E34K6TPD.cjs');
4
4
 
5
5
 
6
6
 
7
7
 
8
8
 
9
9
 
10
- var _chunkMTUYQJIFcjs = require('./chunk-MTUYQJIF.cjs');
11
- require('./chunk-N5FVU7GR.cjs');
10
+ var _chunkSJSLFDTAcjs = require('./chunk-SJSLFDTA.cjs');
11
+ require('./chunk-TZGJRA2Y.cjs');
12
12
 
13
13
 
14
14
 
@@ -16,4 +16,4 @@ require('./chunk-N5FVU7GR.cjs');
16
16
 
17
17
 
18
18
 
19
- exports.defineAppJson = _chunkMTUYQJIFcjs.defineAppJson; exports.defineComponentJson = _chunkMTUYQJIFcjs.defineComponentJson; exports.defineConfig = _chunkINJNZ3X2cjs.defineConfig; exports.definePageJson = _chunkMTUYQJIFcjs.definePageJson; exports.defineSitemapJson = _chunkMTUYQJIFcjs.defineSitemapJson; exports.defineThemeJson = _chunkMTUYQJIFcjs.defineThemeJson;
19
+ exports.defineAppJson = _chunkSJSLFDTAcjs.defineAppJson; exports.defineComponentJson = _chunkSJSLFDTAcjs.defineComponentJson; exports.defineConfig = _chunkE34K6TPDcjs.defineConfig; exports.definePageJson = _chunkSJSLFDTAcjs.definePageJson; exports.defineSitemapJson = _chunkSJSLFDTAcjs.defineSitemapJson; exports.defineThemeJson = _chunkSJSLFDTAcjs.defineThemeJson;
package/dist/config.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { UserConfig, UserConfigExport, UserConfigFnObject } from 'vite';
2
- export { W as WeappViteConfig, a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-DgMm7Geo.cjs';
2
+ export { W as WeappViteConfig, a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-D5ATg2Pv.cjs';
3
3
  export { App, Component, Page, Sitemap, Theme } from '@weapp-core/schematics';
4
4
  import '@weapp-vite/web';
5
5
  import 'rolldown';
package/dist/config.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { UserConfig, UserConfigExport, UserConfigFnObject } from 'vite';
2
- export { W as WeappViteConfig, a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-sFIhUM69.js';
2
+ export { W as WeappViteConfig, a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-B6T_L15M.js';
3
3
  export { App, Component, Page, Sitemap, Theme } from '@weapp-core/schematics';
4
4
  import '@weapp-vite/web';
5
5
  import 'rolldown';
package/dist/config.mjs CHANGED
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  defineConfig
3
- } from "./chunk-46VA2TEF.mjs";
3
+ } from "./chunk-YXFADQPY.mjs";
4
4
  import {
5
5
  defineAppJson,
6
6
  defineComponentJson,
7
7
  definePageJson,
8
8
  defineSitemapJson,
9
9
  defineThemeJson
10
- } from "./chunk-IVFT4TLR.mjs";
11
- import "./chunk-MDUMD5GP.mjs";
10
+ } from "./chunk-O6633IWP.mjs";
11
+ import "./chunk-5CBZRYDL.mjs";
12
12
  export {
13
13
  defineAppJson,
14
14
  defineComponentJson,
@@ -0,0 +1,29 @@
1
+ import {
2
+ changeFileExtension,
3
+ extractConfigFromVue,
4
+ findCssEntry,
5
+ findJsEntry,
6
+ findJsonEntry,
7
+ findTemplateEntry,
8
+ findVueEntry,
9
+ isJsOrTs,
10
+ isTemplate,
11
+ isTemplateRequest,
12
+ touch,
13
+ touchSync
14
+ } from "./chunk-MK4LDVBT.mjs";
15
+ import "./chunk-5CBZRYDL.mjs";
16
+ export {
17
+ changeFileExtension,
18
+ extractConfigFromVue,
19
+ findCssEntry,
20
+ findJsEntry,
21
+ findJsonEntry,
22
+ findTemplateEntry,
23
+ findVueEntry,
24
+ isJsOrTs,
25
+ isTemplate,
26
+ isTemplateRequest,
27
+ touch,
28
+ touchSync
29
+ };
@@ -0,0 +1,29 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+ var _chunkIEICAJDZcjs = require('./chunk-IEICAJDZ.cjs');
15
+ require('./chunk-TZGJRA2Y.cjs');
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+ exports.changeFileExtension = _chunkIEICAJDZcjs.changeFileExtension; exports.extractConfigFromVue = _chunkIEICAJDZcjs.extractConfigFromVue; exports.findCssEntry = _chunkIEICAJDZcjs.findCssEntry; exports.findJsEntry = _chunkIEICAJDZcjs.findJsEntry; exports.findJsonEntry = _chunkIEICAJDZcjs.findJsonEntry; exports.findTemplateEntry = _chunkIEICAJDZcjs.findTemplateEntry; exports.findVueEntry = _chunkIEICAJDZcjs.findVueEntry; exports.isJsOrTs = _chunkIEICAJDZcjs.isJsOrTs; exports.isTemplate = _chunkIEICAJDZcjs.isTemplate; exports.isTemplateRequest = _chunkIEICAJDZcjs.isTemplateRequest; exports.touch = _chunkIEICAJDZcjs.touch; exports.touchSync = _chunkIEICAJDZcjs.touchSync;
package/dist/index.cjs CHANGED
@@ -1,24 +1,33 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-WYYIFHJZ.cjs');
2
2
 
3
- var _chunk7DRE4BEKcjs = require('./chunk-7DRE4BEK.cjs');
4
- require('./chunk-ANDG4OME.cjs');
5
3
 
4
+ var _chunkFB7KR7SHcjs = require('./chunk-FB7KR7SH.cjs');
6
5
 
7
- var _chunkINJNZ3X2cjs = require('./chunk-INJNZ3X2.cjs');
8
6
 
9
7
 
8
+ var _chunkUKTIE44Qcjs = require('./chunk-UKTIE44Q.cjs');
9
+ require('./chunk-EL4WI75Z.cjs');
10
+ require('./chunk-IEICAJDZ.cjs');
10
11
 
11
12
 
13
+ var _chunkE34K6TPDcjs = require('./chunk-E34K6TPD.cjs');
12
14
 
13
15
 
14
- var _chunkMTUYQJIFcjs = require('./chunk-MTUYQJIF.cjs');
15
- require('./chunk-2KCQ5UBK.cjs');
16
16
 
17
17
 
18
- var _chunkN5FVU7GRcjs = require('./chunk-N5FVU7GR.cjs');
18
+
19
+
20
+ var _chunkSJSLFDTAcjs = require('./chunk-SJSLFDTA.cjs');
21
+
22
+
23
+ var _chunkTZGJRA2Ycjs = require('./chunk-TZGJRA2Y.cjs');
19
24
 
20
25
  // src/index.ts
21
- _chunkN5FVU7GRcjs.init_cjs_shims.call(void 0, );
26
+ _chunkTZGJRA2Ycjs.init_cjs_shims.call(void 0, );
27
+ var _wevu = require('wevu');
28
+
29
+
30
+
22
31
 
23
32
 
24
33
 
@@ -27,4 +36,4 @@ _chunkN5FVU7GRcjs.init_cjs_shims.call(void 0, );
27
36
 
28
37
 
29
38
 
30
- exports.createCompilerContext = _chunk7DRE4BEKcjs.createCompilerContext; exports.defineAppJson = _chunkMTUYQJIFcjs.defineAppJson; exports.defineComponentJson = _chunkMTUYQJIFcjs.defineComponentJson; exports.defineConfig = _chunkINJNZ3X2cjs.defineConfig; exports.definePageJson = _chunkMTUYQJIFcjs.definePageJson; exports.defineSitemapJson = _chunkMTUYQJIFcjs.defineSitemapJson; exports.defineThemeJson = _chunkMTUYQJIFcjs.defineThemeJson;
39
+ exports.createCompilerContext = _chunkFB7KR7SHcjs.createCompilerContext; exports.createWevuComponent = _wevu.createWevuComponent; exports.defineAppJson = _chunkSJSLFDTAcjs.defineAppJson; exports.defineComponentJson = _chunkSJSLFDTAcjs.defineComponentJson; exports.defineConfig = _chunkE34K6TPDcjs.defineConfig; exports.defineEmits = _chunkUKTIE44Qcjs.defineEmits; exports.definePageJson = _chunkSJSLFDTAcjs.definePageJson; exports.defineProps = _chunkUKTIE44Qcjs.defineProps; exports.defineSitemapJson = _chunkSJSLFDTAcjs.defineSitemapJson; exports.defineThemeJson = _chunkSJSLFDTAcjs.defineThemeJson;
package/dist/index.d.cts CHANGED
@@ -1,7 +1,9 @@
1
- import { L as LoadConfigOptions, C as CompilerContext } from './config-DgMm7Geo.cjs';
2
- export { W as WeappViteConfig, a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-DgMm7Geo.cjs';
1
+ import { L as LoadConfigOptions, C as CompilerContext } from './config-D5ATg2Pv.cjs';
2
+ export { W as WeappViteConfig, a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-D5ATg2Pv.cjs';
3
+ export { WevuComponentOptions, defineEmits, defineProps } from './runtime.cjs';
3
4
  export { RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, WatchOptions as RolldownWatchOptions, RolldownWatcher } from 'rolldown';
4
5
  export { ConfigEnv, InlineConfig, Plugin, PluginOption, ResolvedConfig, UserConfig, UserConfigExport, UserConfigFnObject, ViteDevServer } from 'vite';
6
+ export { ComputedDefinitions, MethodDefinitions, Ref, createWevuComponent } from 'wevu';
5
7
  export { App, Component, Page, Sitemap, Theme } from '@weapp-core/schematics';
6
8
  import '@weapp-vite/web';
7
9
  import 'vite-plugin-performance';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
- import { L as LoadConfigOptions, C as CompilerContext } from './config-sFIhUM69.js';
2
- export { W as WeappViteConfig, a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-sFIhUM69.js';
1
+ import { L as LoadConfigOptions, C as CompilerContext } from './config-B6T_L15M.js';
2
+ export { W as WeappViteConfig, a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-B6T_L15M.js';
3
+ export { WevuComponentOptions, defineEmits, defineProps } from './runtime.js';
3
4
  export { RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, WatchOptions as RolldownWatchOptions, RolldownWatcher } from 'rolldown';
4
5
  export { ConfigEnv, InlineConfig, Plugin, PluginOption, ResolvedConfig, UserConfig, UserConfigExport, UserConfigFnObject, ViteDevServer } from 'vite';
6
+ export { ComputedDefinitions, MethodDefinitions, Ref, createWevuComponent } from 'wevu';
5
7
  export { App, Component, Page, Sitemap, Theme } from '@weapp-core/schematics';
6
8
  import '@weapp-vite/web';
7
9
  import 'vite-plugin-performance';
package/dist/index.mjs CHANGED
@@ -1,30 +1,39 @@
1
+ import "./chunk-ML5KPLC5.mjs";
1
2
  import {
2
3
  createCompilerContext
3
- } from "./chunk-LLYDSPS7.mjs";
4
- import "./chunk-TS7WK45E.mjs";
4
+ } from "./chunk-VKLSO3EM.mjs";
5
+ import {
6
+ defineEmits,
7
+ defineProps
8
+ } from "./chunk-YIVKT2UN.mjs";
9
+ import "./chunk-4P5KX3LT.mjs";
10
+ import "./chunk-MK4LDVBT.mjs";
5
11
  import {
6
12
  defineConfig
7
- } from "./chunk-46VA2TEF.mjs";
13
+ } from "./chunk-YXFADQPY.mjs";
8
14
  import {
9
15
  defineAppJson,
10
16
  defineComponentJson,
11
17
  definePageJson,
12
18
  defineSitemapJson,
13
19
  defineThemeJson
14
- } from "./chunk-IVFT4TLR.mjs";
15
- import "./chunk-7KGGMLZZ.mjs";
20
+ } from "./chunk-O6633IWP.mjs";
16
21
  import {
17
22
  init_esm_shims
18
- } from "./chunk-MDUMD5GP.mjs";
23
+ } from "./chunk-5CBZRYDL.mjs";
19
24
 
20
25
  // src/index.ts
21
26
  init_esm_shims();
27
+ import { createWevuComponent } from "wevu";
22
28
  export {
23
29
  createCompilerContext,
30
+ createWevuComponent,
24
31
  defineAppJson,
25
32
  defineComponentJson,
26
33
  defineConfig,
34
+ defineEmits,
27
35
  definePageJson,
36
+ defineProps,
28
37
  defineSitemapJson,
29
38
  defineThemeJson
30
39
  };
package/dist/json.cjs CHANGED
@@ -4,12 +4,12 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkMTUYQJIFcjs = require('./chunk-MTUYQJIF.cjs');
8
- require('./chunk-N5FVU7GR.cjs');
7
+ var _chunkSJSLFDTAcjs = require('./chunk-SJSLFDTA.cjs');
8
+ require('./chunk-TZGJRA2Y.cjs');
9
9
 
10
10
 
11
11
 
12
12
 
13
13
 
14
14
 
15
- exports.defineAppJson = _chunkMTUYQJIFcjs.defineAppJson; exports.defineComponentJson = _chunkMTUYQJIFcjs.defineComponentJson; exports.definePageJson = _chunkMTUYQJIFcjs.definePageJson; exports.defineSitemapJson = _chunkMTUYQJIFcjs.defineSitemapJson; exports.defineThemeJson = _chunkMTUYQJIFcjs.defineThemeJson;
15
+ exports.defineAppJson = _chunkSJSLFDTAcjs.defineAppJson; exports.defineComponentJson = _chunkSJSLFDTAcjs.defineComponentJson; exports.definePageJson = _chunkSJSLFDTAcjs.definePageJson; exports.defineSitemapJson = _chunkSJSLFDTAcjs.defineSitemapJson; exports.defineThemeJson = _chunkSJSLFDTAcjs.defineThemeJson;
package/dist/json.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { App, Component, Page, Sitemap, Theme } from '@weapp-core/schematics';
2
- export { a as defineAppJson, c as defineComponentJson, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-DgMm7Geo.cjs';
2
+ export { a as defineAppJson, c as defineComponentJson, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-D5ATg2Pv.cjs';
3
3
  import 'vite';
4
4
  import '@weapp-vite/web';
5
5
  import 'rolldown';
package/dist/json.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { App, Component, Page, Sitemap, Theme } from '@weapp-core/schematics';
2
- export { a as defineAppJson, c as defineComponentJson, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-sFIhUM69.js';
2
+ export { a as defineAppJson, c as defineComponentJson, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-B6T_L15M.js';
3
3
  import 'vite';
4
4
  import '@weapp-vite/web';
5
5
  import 'rolldown';
package/dist/json.mjs CHANGED
@@ -4,8 +4,8 @@ import {
4
4
  definePageJson,
5
5
  defineSitemapJson,
6
6
  defineThemeJson
7
- } from "./chunk-IVFT4TLR.mjs";
8
- import "./chunk-MDUMD5GP.mjs";
7
+ } from "./chunk-O6633IWP.mjs";
8
+ import "./chunk-5CBZRYDL.mjs";
9
9
  export {
10
10
  defineAppJson,
11
11
  defineComponentJson,
@@ -0,0 +1,11 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+ var _chunkUKTIE44Qcjs = require('./chunk-UKTIE44Q.cjs');
6
+ require('./chunk-TZGJRA2Y.cjs');
7
+
8
+
9
+
10
+
11
+ exports.createWevuComponent = _chunkUKTIE44Qcjs.createWevuComponent; exports.defineEmits = _chunkUKTIE44Qcjs.defineEmits; exports.defineProps = _chunkUKTIE44Qcjs.defineProps;
@@ -0,0 +1,29 @@
1
+ import { ComputedDefinitions, MethodDefinitions } from 'wevu';
2
+
3
+ interface WevuComponentOptions<D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions> {
4
+ data?: () => D;
5
+ computed?: C;
6
+ methods?: M;
7
+ watch?: any;
8
+ setup?: (...args: any[]) => any;
9
+ properties?: Record<string, any>;
10
+ [key: string]: any;
11
+ }
12
+ /**
13
+ * Create a wevu component from Vue SFC options
14
+ * Supports both Vue 2 style (Options API) and Vue 3 style (Composition API)
15
+ *
16
+ * Always uses defineComponent (which calls Component() in mini-program).
17
+ * In WeChat mini-programs, Component() can define both pages and components.
18
+ */
19
+ declare function createWevuComponent(options: WevuComponentOptions): void;
20
+ /**
21
+ * Define component with Vue 3 style props
22
+ */
23
+ declare function defineProps<T extends Record<string, any>>(props: T): T;
24
+ /**
25
+ * Define emits with Vue 3 style
26
+ */
27
+ declare function defineEmits<T extends Record<string, any> | string[]>(emits: T): T;
28
+
29
+ export { type WevuComponentOptions, createWevuComponent, defineEmits, defineProps };
@@ -0,0 +1,29 @@
1
+ import { ComputedDefinitions, MethodDefinitions } from 'wevu';
2
+
3
+ interface WevuComponentOptions<D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions> {
4
+ data?: () => D;
5
+ computed?: C;
6
+ methods?: M;
7
+ watch?: any;
8
+ setup?: (...args: any[]) => any;
9
+ properties?: Record<string, any>;
10
+ [key: string]: any;
11
+ }
12
+ /**
13
+ * Create a wevu component from Vue SFC options
14
+ * Supports both Vue 2 style (Options API) and Vue 3 style (Composition API)
15
+ *
16
+ * Always uses defineComponent (which calls Component() in mini-program).
17
+ * In WeChat mini-programs, Component() can define both pages and components.
18
+ */
19
+ declare function createWevuComponent(options: WevuComponentOptions): void;
20
+ /**
21
+ * Define component with Vue 3 style props
22
+ */
23
+ declare function defineProps<T extends Record<string, any>>(props: T): T;
24
+ /**
25
+ * Define emits with Vue 3 style
26
+ */
27
+ declare function defineEmits<T extends Record<string, any> | string[]>(emits: T): T;
28
+
29
+ export { type WevuComponentOptions, createWevuComponent, defineEmits, defineProps };
@@ -0,0 +1,11 @@
1
+ import {
2
+ createWevuComponent,
3
+ defineEmits,
4
+ defineProps
5
+ } from "./chunk-YIVKT2UN.mjs";
6
+ import "./chunk-5CBZRYDL.mjs";
7
+ export {
8
+ createWevuComponent,
9
+ defineEmits,
10
+ defineProps
11
+ };
package/dist/types.cjs CHANGED
@@ -1,25 +1,25 @@
1
- "use strict";require('./chunk-2KCQ5UBK.cjs');
1
+ "use strict";require('./chunk-WYYIFHJZ.cjs');
2
2
 
3
3
 
4
- var _chunkN5FVU7GRcjs = require('./chunk-N5FVU7GR.cjs');
4
+ var _chunkTZGJRA2Ycjs = require('./chunk-TZGJRA2Y.cjs');
5
5
 
6
6
  // src/types/index.ts
7
- _chunkN5FVU7GRcjs.init_cjs_shims.call(void 0, );
7
+ _chunkTZGJRA2Ycjs.init_cjs_shims.call(void 0, );
8
8
 
9
9
  // src/types/config.ts
10
- _chunkN5FVU7GRcjs.init_cjs_shims.call(void 0, );
10
+ _chunkTZGJRA2Ycjs.init_cjs_shims.call(void 0, );
11
11
 
12
12
  // src/types/context.ts
13
- _chunkN5FVU7GRcjs.init_cjs_shims.call(void 0, );
13
+ _chunkTZGJRA2Ycjs.init_cjs_shims.call(void 0, );
14
14
 
15
15
  // src/types/entry.ts
16
- _chunkN5FVU7GRcjs.init_cjs_shims.call(void 0, );
16
+ _chunkTZGJRA2Ycjs.init_cjs_shims.call(void 0, );
17
17
 
18
18
  // src/types/errors.ts
19
- _chunkN5FVU7GRcjs.init_cjs_shims.call(void 0, );
19
+ _chunkTZGJRA2Ycjs.init_cjs_shims.call(void 0, );
20
20
 
21
21
  // src/types/plugin.ts
22
- _chunkN5FVU7GRcjs.init_cjs_shims.call(void 0, );
22
+ _chunkTZGJRA2Ycjs.init_cjs_shims.call(void 0, );
23
23
 
24
24
  // src/types/routes.ts
25
- _chunkN5FVU7GRcjs.init_cjs_shims.call(void 0, );
25
+ _chunkTZGJRA2Ycjs.init_cjs_shims.call(void 0, );
package/dist/types.d.cts CHANGED
@@ -1,6 +1,7 @@
1
- export { A as Alias, g as AliasOptions, $ as AppEntry, B as AutoImportComponents, D as AutoImportComponentsOption, Z as BaseEntry, J as BuildNpmPackageMeta, a4 as ChangeEvent, P as ChunksConfig, a1 as ComponentEntry, Y as ComponentsMap, y as CopyGlobs, x as CopyOptions, I as EnhanceOptions, E as EnhanceWxmlOptions, _ as Entry, a2 as EntryJsonFragment, l as GenerateDirsOptions, G as GenerateExtensionsOptions, n as GenerateFileType, m as GenerateFilenamesOptions, w as GenerateOptions, s as GenerateTemplate, o as GenerateTemplateContext, t as GenerateTemplateEntry, r as GenerateTemplateFactory, p as GenerateTemplateFileSource, q as GenerateTemplateInlineSource, u as GenerateTemplateScope, v as GenerateTemplatesConfig, H as HandleWxmlOptions, K as JsFormat, M as MpPlatform, N as NpmBuildOptions, a0 as PageEntry, Q as ProjectConfig, R as ResolvedAlias, X as ScanComponentItem, F as ScanWxmlOptions, O as SharedChunkStrategy, S as SubPackage, T as SubPackageMetaValue, j as SubPackageStyleConfigEntry, i as SubPackageStyleConfigObject, k as SubPackageStyleEntry, h as SubPackageStyleScope, U as UserConfig, W as WeappViteConfig, a3 as WeappVitePluginApi, z as WeappWebConfig, V as WxmlDep } from './config-DgMm7Geo.cjs';
1
+ export { A as Alias, g as AliasOptions, $ as AppEntry, B as AutoImportComponents, D as AutoImportComponentsOption, Z as BaseEntry, J as BuildNpmPackageMeta, a4 as ChangeEvent, P as ChunksConfig, a1 as ComponentEntry, Y as ComponentsMap, y as CopyGlobs, x as CopyOptions, I as EnhanceOptions, E as EnhanceWxmlOptions, _ as Entry, a2 as EntryJsonFragment, l as GenerateDirsOptions, G as GenerateExtensionsOptions, n as GenerateFileType, m as GenerateFilenamesOptions, w as GenerateOptions, s as GenerateTemplate, o as GenerateTemplateContext, t as GenerateTemplateEntry, r as GenerateTemplateFactory, p as GenerateTemplateFileSource, q as GenerateTemplateInlineSource, u as GenerateTemplateScope, v as GenerateTemplatesConfig, H as HandleWxmlOptions, K as JsFormat, M as MpPlatform, N as NpmBuildOptions, a0 as PageEntry, Q as ProjectConfig, R as ResolvedAlias, X as ScanComponentItem, F as ScanWxmlOptions, O as SharedChunkStrategy, S as SubPackage, T as SubPackageMetaValue, j as SubPackageStyleConfigEntry, i as SubPackageStyleConfigObject, k as SubPackageStyleEntry, h as SubPackageStyleScope, U as UserConfig, W as WeappViteConfig, a3 as WeappVitePluginApi, z as WeappWebConfig, V as WxmlDep } from './config-D5ATg2Pv.cjs';
2
2
  export { RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, WatchOptions as RolldownWatchOptions, RolldownWatcher } from 'rolldown';
3
3
  export { ConfigEnv, InlineConfig, Plugin, PluginOption, ResolvedConfig, ViteDevServer } from 'vite';
4
+ export { ComputedDefinitions, MethodDefinitions, Ref } from 'wevu';
4
5
  export { A as AutoRoutes, a as AutoRoutesSubPackage } from './routes-C9hKJjXs.cjs';
5
6
  export { R as Resolver } from './types-3q1Qq6Fe.cjs';
6
7
  import '@weapp-core/schematics';
package/dist/types.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- export { A as Alias, g as AliasOptions, $ as AppEntry, B as AutoImportComponents, D as AutoImportComponentsOption, Z as BaseEntry, J as BuildNpmPackageMeta, a4 as ChangeEvent, P as ChunksConfig, a1 as ComponentEntry, Y as ComponentsMap, y as CopyGlobs, x as CopyOptions, I as EnhanceOptions, E as EnhanceWxmlOptions, _ as Entry, a2 as EntryJsonFragment, l as GenerateDirsOptions, G as GenerateExtensionsOptions, n as GenerateFileType, m as GenerateFilenamesOptions, w as GenerateOptions, s as GenerateTemplate, o as GenerateTemplateContext, t as GenerateTemplateEntry, r as GenerateTemplateFactory, p as GenerateTemplateFileSource, q as GenerateTemplateInlineSource, u as GenerateTemplateScope, v as GenerateTemplatesConfig, H as HandleWxmlOptions, K as JsFormat, M as MpPlatform, N as NpmBuildOptions, a0 as PageEntry, Q as ProjectConfig, R as ResolvedAlias, X as ScanComponentItem, F as ScanWxmlOptions, O as SharedChunkStrategy, S as SubPackage, T as SubPackageMetaValue, j as SubPackageStyleConfigEntry, i as SubPackageStyleConfigObject, k as SubPackageStyleEntry, h as SubPackageStyleScope, U as UserConfig, W as WeappViteConfig, a3 as WeappVitePluginApi, z as WeappWebConfig, V as WxmlDep } from './config-sFIhUM69.js';
1
+ export { A as Alias, g as AliasOptions, $ as AppEntry, B as AutoImportComponents, D as AutoImportComponentsOption, Z as BaseEntry, J as BuildNpmPackageMeta, a4 as ChangeEvent, P as ChunksConfig, a1 as ComponentEntry, Y as ComponentsMap, y as CopyGlobs, x as CopyOptions, I as EnhanceOptions, E as EnhanceWxmlOptions, _ as Entry, a2 as EntryJsonFragment, l as GenerateDirsOptions, G as GenerateExtensionsOptions, n as GenerateFileType, m as GenerateFilenamesOptions, w as GenerateOptions, s as GenerateTemplate, o as GenerateTemplateContext, t as GenerateTemplateEntry, r as GenerateTemplateFactory, p as GenerateTemplateFileSource, q as GenerateTemplateInlineSource, u as GenerateTemplateScope, v as GenerateTemplatesConfig, H as HandleWxmlOptions, K as JsFormat, M as MpPlatform, N as NpmBuildOptions, a0 as PageEntry, Q as ProjectConfig, R as ResolvedAlias, X as ScanComponentItem, F as ScanWxmlOptions, O as SharedChunkStrategy, S as SubPackage, T as SubPackageMetaValue, j as SubPackageStyleConfigEntry, i as SubPackageStyleConfigObject, k as SubPackageStyleEntry, h as SubPackageStyleScope, U as UserConfig, W as WeappViteConfig, a3 as WeappVitePluginApi, z as WeappWebConfig, V as WxmlDep } from './config-B6T_L15M.js';
2
2
  export { RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, WatchOptions as RolldownWatchOptions, RolldownWatcher } from 'rolldown';
3
3
  export { ConfigEnv, InlineConfig, Plugin, PluginOption, ResolvedConfig, ViteDevServer } from 'vite';
4
+ export { ComputedDefinitions, MethodDefinitions, Ref } from 'wevu';
4
5
  export { A as AutoRoutes, a as AutoRoutesSubPackage } from './routes-C9hKJjXs.js';
5
6
  export { R as Resolver } from './types-3q1Qq6Fe.js';
6
7
  import '@weapp-core/schematics';
package/dist/types.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import "./chunk-7KGGMLZZ.mjs";
1
+ import "./chunk-ML5KPLC5.mjs";
2
2
  import {
3
3
  init_esm_shims
4
- } from "./chunk-MDUMD5GP.mjs";
4
+ } from "./chunk-5CBZRYDL.mjs";
5
5
 
6
6
  // src/types/index.ts
7
7
  init_esm_shims();
package/dist/volar.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
- var _chunkN5FVU7GRcjs = require('./chunk-N5FVU7GR.cjs');
3
+ var _chunkTZGJRA2Ycjs = require('./chunk-TZGJRA2Y.cjs');
4
4
 
5
5
  // src/volar.ts
6
- _chunkN5FVU7GRcjs.init_cjs_shims.call(void 0, );
6
+ _chunkTZGJRA2Ycjs.init_cjs_shims.call(void 0, );
7
7
  var _volar = require('@weapp-vite/volar'); var _volar2 = _interopRequireDefault(_volar);
8
8
  var volar_default = _volar2.default;
9
9
 
package/dist/volar.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "./chunk-MDUMD5GP.mjs";
3
+ } from "./chunk-5CBZRYDL.mjs";
4
4
 
5
5
  // src/volar.ts
6
6
  init_esm_shims();