create-weapp-vite 2.0.21 → 2.0.22

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.
@@ -5,10 +5,10 @@ import fs2 from "fs-extra";
5
5
  import path2 from "pathe";
6
6
 
7
7
  // ../weapp-vite/package.json
8
- var version = "6.5.1";
8
+ var version = "6.5.2";
9
9
 
10
10
  // ../wevu/package.json
11
- var version2 = "2.1.5";
11
+ var version2 = "2.1.6";
12
12
 
13
13
  // src/enums.ts
14
14
  var TemplateName = /* @__PURE__ */ ((TemplateName2) => {
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createProject
3
- } from "./chunk-YDQVC4RV.js";
3
+ } from "./chunk-LMYAXMKW.js";
4
4
 
5
5
  // src/cli.ts
6
6
  import path from "path";
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  TemplateName,
3
3
  createProject
4
- } from "./chunk-YDQVC4RV.js";
4
+ } from "./chunk-LMYAXMKW.js";
5
5
  export {
6
6
  TemplateName,
7
7
  createProject
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-weapp-vite",
3
3
  "type": "module",
4
- "version": "2.0.21",
4
+ "version": "2.0.22",
5
5
  "description": "create-weapp-vite",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -1,20 +1,83 @@
1
- <script>
1
+ <script lang="ts">
2
+ import { ref } from 'wevu'
3
+
2
4
  export default {
3
- name: 'LibSfcBoth',
5
+ name: 'LibSfcBothLegacy',
6
+ options: {
7
+ virtualHost: true,
8
+ },
4
9
  }
5
10
  </script>
6
11
 
7
- <script setup>
8
- const text = 'Script + setup Vue SFC component'
12
+ <script setup lang="ts">
13
+ defineOptions({
14
+ inheritAttrs: false,
15
+ options: {
16
+ multipleSlots: true,
17
+ },
18
+ })
19
+
20
+ const props = withDefaults(defineProps<{
21
+ title?: string
22
+ variant?: 'plain' | 'soft' | 'outline'
23
+ tone?: 'forest' | 'mint' | 'teal'
24
+ }>(), {
25
+ title: 'SFC (script + setup)',
26
+ variant: 'soft',
27
+ tone: 'forest',
28
+ })
29
+
30
+ const emit = defineEmits<{
31
+ (e: 'change', value: boolean): void
32
+ (e: 'press', payload: { count: number }): void
33
+ }>()
34
+ const checked = defineModel<boolean>('checked', { default: false })
35
+ const count = ref(0)
36
+
37
+ function toggleChecked() {
38
+ checked.value = !checked.value
39
+ emit('change', checked.value)
40
+ }
41
+
42
+ function bumpCount() {
43
+ count.value += 1
44
+ emit('press', { count: count.value })
45
+ }
46
+
47
+ function reset() {
48
+ checked.value = false
49
+ count.value = 0
50
+ }
51
+
52
+ defineExpose({
53
+ toggleChecked,
54
+ bumpCount,
55
+ reset,
56
+ })
9
57
  </script>
10
58
 
11
59
  <template>
12
- <view class="card">
60
+ <view
61
+ class="card"
62
+ :class="[
63
+ `variant-${props.variant}`,
64
+ `tone-${props.tone}`,
65
+ { 'is-checked': checked, 'has-count': count > 0 },
66
+ ]"
67
+ >
13
68
  <view class="title">
14
- SFC (script + setup)
69
+ {{ props.title }}
15
70
  </view>
16
71
  <view class="desc">
17
- {{ text }}
72
+ Checked: {{ checked ? 'yes' : 'no' }} · Count: {{ count }}
73
+ </view>
74
+ <view class="actions">
75
+ <button class="btn ghost" @tap="toggleChecked">
76
+ Toggle
77
+ </button>
78
+ <button class="btn" @tap="bumpCount">
79
+ +1
80
+ </button>
18
81
  </view>
19
82
  </view>
20
83
  </template>
@@ -23,19 +86,74 @@ const text = 'Script + setup Vue SFC component'
23
86
  .card {
24
87
  padding: 20rpx;
25
88
  background: #f0fdf4;
26
- border: 2rpx solid #86efac;
89
+ border: 2rpx solid transparent;
27
90
  border-radius: 16rpx;
28
91
  }
29
92
 
30
93
  .title {
31
94
  font-size: 28rpx;
32
95
  font-weight: 600;
33
- color: #166534;
96
+ color: #0f3d2e;
34
97
  }
35
98
 
36
99
  .desc {
37
100
  margin-top: 8rpx;
38
101
  font-size: 24rpx;
39
- color: #14532d;
102
+ color: #165445;
103
+ }
104
+
105
+ .actions {
106
+ display: flex;
107
+ gap: 12rpx;
108
+ margin-top: 16rpx;
109
+ }
110
+
111
+ .btn {
112
+ padding: 8rpx 16rpx;
113
+ font-size: 22rpx;
114
+ color: #f0fdf4;
115
+ background: #0f3d2e;
116
+ border: 2rpx solid #0f3d2e;
117
+ border-radius: 999rpx;
118
+ }
119
+
120
+ .btn.ghost {
121
+ color: #0f3d2e;
122
+ background: transparent;
123
+ }
124
+
125
+ .tone-forest {
126
+ background: #f0fdf4;
127
+ border-color: #86efac;
128
+ }
129
+
130
+ .tone-mint {
131
+ background: #ecfeff;
132
+ border-color: #67e8f9;
133
+ }
134
+
135
+ .tone-teal {
136
+ background: #f0fdfa;
137
+ border-color: #5eead4;
138
+ }
139
+
140
+ .variant-plain {
141
+ background: #fff;
142
+ }
143
+
144
+ .variant-soft {
145
+ box-shadow: inset 0 0 0 1rpx rgb(15 61 46 / 12%);
146
+ }
147
+
148
+ .variant-outline {
149
+ background: transparent;
150
+ }
151
+
152
+ .is-checked {
153
+ box-shadow: 0 0 0 4rpx rgb(16 185 129 / 20%);
154
+ }
155
+
156
+ .has-count .title {
157
+ letter-spacing: 1rpx;
40
158
  }
41
159
  </style>
@@ -1,14 +1,75 @@
1
- <script setup>
2
- const text = 'Script setup only Vue SFC component'
1
+ <script setup lang="ts">
2
+ import { ref } from 'wevu'
3
+
4
+ defineOptions({
5
+ name: 'LibSfcSetup',
6
+ inheritAttrs: false,
7
+ options: {
8
+ multipleSlots: true,
9
+ },
10
+ })
11
+
12
+ const props = withDefaults(defineProps<{
13
+ title?: string
14
+ tone?: 'info' | 'success' | 'warning'
15
+ size?: 'sm' | 'md' | 'lg'
16
+ }>(), {
17
+ title: 'SFC (script setup)',
18
+ tone: 'info',
19
+ size: 'md',
20
+ })
21
+
22
+ const emit = defineEmits<{
23
+ (e: 'toggle', value: boolean): void
24
+ (e: 'bump', payload: { count: number }): void
25
+ }>()
26
+ const active = defineModel<boolean>('active', { default: false })
27
+ const count = ref(0)
28
+
29
+ function toggleActive() {
30
+ active.value = !active.value
31
+ emit('toggle', active.value)
32
+ }
33
+
34
+ function bumpCount() {
35
+ count.value += 1
36
+ emit('bump', { count: count.value })
37
+ }
38
+
39
+ function reset() {
40
+ active.value = false
41
+ count.value = 0
42
+ }
43
+
44
+ defineExpose({
45
+ toggleActive,
46
+ bumpCount,
47
+ reset,
48
+ })
3
49
  </script>
4
50
 
5
51
  <template>
6
- <view class="card">
52
+ <view
53
+ class="card"
54
+ :class="[
55
+ `tone-${props.tone}`,
56
+ `size-${props.size}`,
57
+ { 'is-active': active, 'has-count': count > 0 },
58
+ ]"
59
+ >
7
60
  <view class="title">
8
- SFC (script setup)
61
+ {{ props.title }}
9
62
  </view>
10
63
  <view class="desc">
11
- {{ text }}
64
+ State: {{ active ? 'active' : 'idle' }} · Count: {{ count }}
65
+ </view>
66
+ <view class="actions">
67
+ <button class="btn ghost" @tap="toggleActive">
68
+ Toggle
69
+ </button>
70
+ <button class="btn" @tap="bumpCount">
71
+ +1
72
+ </button>
12
73
  </view>
13
74
  </view>
14
75
  </template>
@@ -16,9 +77,9 @@ const text = 'Script setup only Vue SFC component'
16
77
  <style>
17
78
  .card {
18
79
  padding: 20rpx;
19
- background: #eff6ff;
20
- border: 2rpx solid #93c5fd;
21
80
  border-radius: 16rpx;
81
+ border: 2rpx solid transparent;
82
+ background: #eff6ff;
22
83
  }
23
84
 
24
85
  .title {
@@ -32,4 +93,59 @@ const text = 'Script setup only Vue SFC component'
32
93
  font-size: 24rpx;
33
94
  color: #1e40af;
34
95
  }
96
+
97
+ .actions {
98
+ display: flex;
99
+ gap: 12rpx;
100
+ margin-top: 16rpx;
101
+ }
102
+
103
+ .btn {
104
+ padding: 8rpx 16rpx;
105
+ border-radius: 999rpx;
106
+ border: 2rpx solid #1d4ed8;
107
+ background: #1d4ed8;
108
+ color: #eff6ff;
109
+ font-size: 22rpx;
110
+ }
111
+
112
+ .btn.ghost {
113
+ background: transparent;
114
+ color: #1d4ed8;
115
+ }
116
+
117
+ .tone-info {
118
+ background: #eff6ff;
119
+ border-color: #93c5fd;
120
+ }
121
+
122
+ .tone-success {
123
+ background: #ecfdf3;
124
+ border-color: #86efac;
125
+ }
126
+
127
+ .tone-warning {
128
+ background: #fff7ed;
129
+ border-color: #fdba74;
130
+ }
131
+
132
+ .size-sm {
133
+ padding: 16rpx;
134
+ }
135
+
136
+ .size-md {
137
+ padding: 20rpx;
138
+ }
139
+
140
+ .size-lg {
141
+ padding: 24rpx;
142
+ }
143
+
144
+ .is-active {
145
+ box-shadow: 0 0 0 4rpx rgba(29, 78, 216, 0.2);
146
+ }
147
+
148
+ .has-count .title {
149
+ letter-spacing: 1rpx;
150
+ }
35
151
  </style>