weapp-vite 6.0.0-alpha.3 → 6.0.0-alpha.5

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 (53) hide show
  1. package/README.md +11 -9
  2. package/client.d.ts +16 -0
  3. package/dist/auto-import-components/resolvers.cjs +6 -6
  4. package/dist/auto-import-components/resolvers.mjs +1 -1
  5. package/dist/auto-routes.cjs +9 -9
  6. package/dist/auto-routes.mjs +5 -5
  7. package/dist/{chunk-SJSLFDTA.cjs → chunk-2CHNKORP.cjs} +2 -2
  8. package/dist/{chunk-ML5KPLC5.mjs → chunk-3WGUNRY5.mjs} +1 -1
  9. package/dist/chunk-53RK3GBH.cjs +6 -0
  10. package/dist/{chunk-YIVKT2UN.mjs → chunk-7GJOCTON.mjs} +1 -1
  11. package/dist/{chunk-5CBZRYDL.mjs → chunk-AOUAT7U3.mjs} +2 -2
  12. package/dist/{chunk-YXFADQPY.mjs → chunk-AZBN7A5I.mjs} +1 -1
  13. package/dist/{chunk-645T2KR3.mjs → chunk-B44QTW7W.mjs} +3599 -1522
  14. package/dist/{chunk-E34K6TPD.cjs → chunk-HL25C7YQ.cjs} +2 -2
  15. package/dist/{chunk-UKTIE44Q.cjs → chunk-HRJEZONN.cjs} +2 -2
  16. package/dist/{chunk-TTGMOBMK.mjs → chunk-HTF2YIJT.mjs} +2 -2
  17. package/dist/{chunk-HXHJ32P4.cjs → chunk-JZO2G5T5.cjs} +3625 -1548
  18. package/dist/{chunk-TZGJRA2Y.cjs → chunk-PFE2IVZ3.cjs} +2 -2
  19. package/dist/{chunk-MK4LDVBT.mjs → chunk-T6MAVU7E.mjs} +10 -7
  20. package/dist/{chunk-O6633IWP.mjs → chunk-V5RMQ6TF.mjs} +1 -1
  21. package/dist/{chunk-TLK44FFK.cjs → chunk-WLWDPBMV.cjs} +6 -6
  22. package/dist/{chunk-IEICAJDZ.cjs → chunk-ZZA26GJI.cjs} +12 -9
  23. package/dist/cli.cjs +78 -78
  24. package/dist/cli.mjs +4 -4
  25. package/dist/{config-B6T_L15M.d.ts → config-CNXNPp1P.d.ts} +4 -4
  26. package/dist/{config-D5ATg2Pv.d.cts → config-D0FIclL4.d.cts} +4 -4
  27. package/dist/config.cjs +4 -4
  28. package/dist/config.d.cts +1 -1
  29. package/dist/config.d.ts +1 -1
  30. package/dist/config.mjs +3 -3
  31. package/dist/{file-KXULPGWG.mjs → file-4WEK4X45.mjs} +2 -2
  32. package/dist/file-IMZTAEKY.cjs +29 -0
  33. package/dist/index.cjs +10 -10
  34. package/dist/index.d.cts +2 -2
  35. package/dist/index.d.ts +2 -2
  36. package/dist/index.mjs +8 -8
  37. package/dist/json.cjs +3 -3
  38. package/dist/json.d.cts +1 -1
  39. package/dist/json.d.ts +1 -1
  40. package/dist/json.mjs +2 -2
  41. package/dist/runtime.cjs +3 -3
  42. package/dist/runtime.d.cts +6 -6
  43. package/dist/runtime.d.ts +6 -6
  44. package/dist/runtime.mjs +2 -2
  45. package/dist/types.cjs +9 -9
  46. package/dist/types.d.cts +1 -1
  47. package/dist/types.d.ts +1 -1
  48. package/dist/types.mjs +2 -2
  49. package/dist/volar.cjs +2 -2
  50. package/dist/volar.mjs +1 -1
  51. package/package.json +10 -9
  52. package/dist/chunk-WYYIFHJZ.cjs +0 -6
  53. package/dist/file-S6QIP4VW.cjs +0 -29
package/README.md CHANGED
@@ -33,9 +33,9 @@
33
33
  ### Vue 项目
34
34
 
35
35
  ```typescript
36
+ import weappVite from '@weapp-vite/vite'
36
37
  // vite.config.ts
37
38
  import { defineConfig } from 'vite'
38
- import weappVite from '@weapp-vite/vite'
39
39
 
40
40
  export default defineConfig({
41
41
  plugins: [
@@ -53,23 +53,25 @@ export default defineConfig({
53
53
 
54
54
  ```vue
55
55
  <!-- App.vue -->
56
- <template>
57
- <view class="container">
58
- <text>{{ message }}</text>
59
- <button @click="handleClick">Click</button>
60
- </view>
61
- </template>
62
-
63
56
  <script setup>
64
57
  import { ref } from 'vue'
65
58
 
66
59
  const message = ref('Hello Vue in Mini-program!')
67
60
 
68
- const handleClick = () => {
61
+ function handleClick() {
69
62
  console.log('Button clicked!')
70
63
  }
71
64
  </script>
72
65
 
66
+ <template>
67
+ <view class="container">
68
+ <text>{{ message }}</text>
69
+ <button @click="handleClick">
70
+ Click
71
+ </button>
72
+ </view>
73
+ </template>
74
+
73
75
  <style scoped>
74
76
  .container {
75
77
  padding: 20rpx;
package/client.d.ts CHANGED
@@ -30,3 +30,19 @@ declare module 'process' {
30
30
  }
31
31
  }
32
32
  }
33
+
34
+ type __WEAPP_APP_JSON__ = import('@weapp-core/schematics').App
35
+ type __WEAPP_PAGE_JSON__ = import('@weapp-core/schematics').Page
36
+ type __WEAPP_COMPONENT_JSON__ = import('@weapp-core/schematics').Component
37
+
38
+ declare function defineAppJson(config: () => __WEAPP_APP_JSON__): () => __WEAPP_APP_JSON__
39
+ declare function defineAppJson(config: () => Promise<__WEAPP_APP_JSON__>): () => Promise<__WEAPP_APP_JSON__>
40
+ declare function defineAppJson(config: __WEAPP_APP_JSON__): __WEAPP_APP_JSON__
41
+
42
+ declare function definePageJson(config: () => __WEAPP_PAGE_JSON__): () => __WEAPP_PAGE_JSON__
43
+ declare function definePageJson(config: () => Promise<__WEAPP_PAGE_JSON__>): () => Promise<__WEAPP_PAGE_JSON__>
44
+ declare function definePageJson(config: __WEAPP_PAGE_JSON__): __WEAPP_PAGE_JSON__
45
+
46
+ declare function defineComponentJson(config: () => __WEAPP_COMPONENT_JSON__): () => __WEAPP_COMPONENT_JSON__
47
+ declare function defineComponentJson(config: () => Promise<__WEAPP_COMPONENT_JSON__>): () => Promise<__WEAPP_COMPONENT_JSON__>
48
+ declare function defineComponentJson(config: __WEAPP_COMPONENT_JSON__): __WEAPP_COMPONENT_JSON__
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkTZGJRA2Ycjs = require('../chunk-TZGJRA2Y.cjs');
3
+ var _chunkPFE2IVZ3cjs = require('../chunk-PFE2IVZ3.cjs');
4
4
 
5
5
  // src/auto-import-components/resolvers/index.ts
6
- _chunkTZGJRA2Ycjs.init_cjs_shims.call(void 0, );
6
+ _chunkPFE2IVZ3cjs.init_cjs_shims.call(void 0, );
7
7
 
8
8
  // src/auto-import-components/resolvers/tdesign.ts
9
- _chunkTZGJRA2Ycjs.init_cjs_shims.call(void 0, );
9
+ _chunkPFE2IVZ3cjs.init_cjs_shims.call(void 0, );
10
10
  var _shared = require('@weapp-core/shared');
11
11
 
12
12
  // src/auto-import-components/resolvers/json/tdesign.json
@@ -129,10 +129,10 @@ var TDesignResolver = (opts) => {
129
129
  };
130
130
 
131
131
  // src/auto-import-components/resolvers/types.ts
132
- _chunkTZGJRA2Ycjs.init_cjs_shims.call(void 0, );
132
+ _chunkPFE2IVZ3cjs.init_cjs_shims.call(void 0, );
133
133
 
134
134
  // src/auto-import-components/resolvers/vant.ts
135
- _chunkTZGJRA2Ycjs.init_cjs_shims.call(void 0, );
135
+ _chunkPFE2IVZ3cjs.init_cjs_shims.call(void 0, );
136
136
 
137
137
 
138
138
  // src/auto-import-components/resolvers/json/vant.json
@@ -243,7 +243,7 @@ var VantResolver = (opts) => {
243
243
  };
244
244
 
245
245
  // src/auto-import-components/resolvers/weui.ts
246
- _chunkTZGJRA2Ycjs.init_cjs_shims.call(void 0, );
246
+ _chunkPFE2IVZ3cjs.init_cjs_shims.call(void 0, );
247
247
 
248
248
 
249
249
  // src/auto-import-components/resolvers/json/weui.json
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "../chunk-5CBZRYDL.mjs";
3
+ } from "../chunk-AOUAT7U3.mjs";
4
4
 
5
5
  // src/auto-import-components/resolvers/index.ts
6
6
  init_esm_shims();
@@ -1,21 +1,21 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkHXHJ32P4cjs = require('./chunk-HXHJ32P4.cjs');
4
- require('./chunk-IEICAJDZ.cjs');
5
- require('./chunk-E34K6TPD.cjs');
6
- require('./chunk-SJSLFDTA.cjs');
3
+ var _chunkJZO2G5T5cjs = require('./chunk-JZO2G5T5.cjs');
4
+ require('./chunk-ZZA26GJI.cjs');
5
+ require('./chunk-HL25C7YQ.cjs');
6
+ require('./chunk-2CHNKORP.cjs');
7
7
 
8
8
 
9
- var _chunkTZGJRA2Ycjs = require('./chunk-TZGJRA2Y.cjs');
9
+ var _chunkPFE2IVZ3cjs = require('./chunk-PFE2IVZ3.cjs');
10
10
 
11
11
  // src/auto-routes.ts
12
- _chunkTZGJRA2Ycjs.init_cjs_shims.call(void 0, );
12
+ _chunkPFE2IVZ3cjs.init_cjs_shims.call(void 0, );
13
13
 
14
14
  // src/context/index.ts
15
- _chunkTZGJRA2Ycjs.init_cjs_shims.call(void 0, );
15
+ _chunkPFE2IVZ3cjs.init_cjs_shims.call(void 0, );
16
16
 
17
17
  // src/context/CompilerContext.ts
18
- _chunkTZGJRA2Ycjs.init_cjs_shims.call(void 0, );
18
+ _chunkPFE2IVZ3cjs.init_cjs_shims.call(void 0, );
19
19
 
20
20
  // src/auto-routes.ts
21
21
  function createGetter(resolver) {
@@ -25,7 +25,7 @@ function createGetter(resolver) {
25
25
  get: resolver
26
26
  };
27
27
  }
28
- var ctx = _chunkHXHJ32P4cjs.getCompilerContext.call(void 0, );
28
+ var ctx = _chunkJZO2G5T5cjs.getCompilerContext.call(void 0, );
29
29
  var service = ctx.autoRoutesService;
30
30
  var routes = {};
31
31
  Object.defineProperties(routes, {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  getCompilerContext
3
- } from "./chunk-645T2KR3.mjs";
4
- import "./chunk-MK4LDVBT.mjs";
5
- import "./chunk-YXFADQPY.mjs";
6
- import "./chunk-O6633IWP.mjs";
3
+ } from "./chunk-B44QTW7W.mjs";
4
+ import "./chunk-T6MAVU7E.mjs";
5
+ import "./chunk-AZBN7A5I.mjs";
6
+ import "./chunk-V5RMQ6TF.mjs";
7
7
  import {
8
8
  init_esm_shims
9
- } from "./chunk-5CBZRYDL.mjs";
9
+ } from "./chunk-AOUAT7U3.mjs";
10
10
 
11
11
  // src/auto-routes.ts
12
12
  init_esm_shims();
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkTZGJRA2Ycjs = require('./chunk-TZGJRA2Y.cjs');
3
+ var _chunkPFE2IVZ3cjs = require('./chunk-PFE2IVZ3.cjs');
4
4
 
5
5
  // src/json.ts
6
- _chunkTZGJRA2Ycjs.init_cjs_shims.call(void 0, );
6
+ _chunkPFE2IVZ3cjs.init_cjs_shims.call(void 0, );
7
7
  var defineAppJson = (config) => {
8
8
  return config;
9
9
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "./chunk-5CBZRYDL.mjs";
3
+ } from "./chunk-AOUAT7U3.mjs";
4
4
 
5
5
  // src/types/external.ts
6
6
  init_esm_shims();
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ var _chunkPFE2IVZ3cjs = require('./chunk-PFE2IVZ3.cjs');
4
+
5
+ // src/types/external.ts
6
+ _chunkPFE2IVZ3cjs.init_cjs_shims.call(void 0, );
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "./chunk-5CBZRYDL.mjs";
3
+ } from "./chunk-AOUAT7U3.mjs";
4
4
 
5
5
  // src/plugins/vue/runtime.ts
6
6
  init_esm_shims();
@@ -27,11 +27,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
27
  mod
28
28
  ));
29
29
 
30
- // ../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.7_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_typescript@5.9.3_yaml@2.8.2/node_modules/tsup/assets/esm_shims.js
30
+ // ../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.8_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_typescript@5.9.3_yaml@2.8.2/node_modules/tsup/assets/esm_shims.js
31
31
  import path from "path";
32
32
  import { fileURLToPath } from "url";
33
33
  var init_esm_shims = __esm({
34
- "../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.7_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_typescript@5.9.3_yaml@2.8.2/node_modules/tsup/assets/esm_shims.js"() {
34
+ "../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.8_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_typescript@5.9.3_yaml@2.8.2/node_modules/tsup/assets/esm_shims.js"() {
35
35
  "use strict";
36
36
  }
37
37
  });
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "./chunk-5CBZRYDL.mjs";
3
+ } from "./chunk-AOUAT7U3.mjs";
4
4
 
5
5
  // src/config.ts
6
6
  init_esm_shims();