@weapp-core/init 4.1.0 → 5.0.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 (171) hide show
  1. package/dist/index.cjs +110 -201
  2. package/dist/index.d.cts +1 -12
  3. package/dist/index.d.ts +1 -12
  4. package/dist/index.js +110 -193
  5. package/package.json +3 -10
  6. package/templates/default/.editorconfig +0 -9
  7. package/templates/default/.vscode/settings.json +0 -5
  8. package/templates/default/README.md +0 -28
  9. package/templates/default/auto-import-components.json +0 -3
  10. package/templates/default/gitignore +0 -35
  11. package/templates/default/package.json +0 -31
  12. package/templates/default/project.config.json +0 -42
  13. package/templates/default/project.private.config.json +0 -8
  14. package/templates/default/public/logo.png +0 -0
  15. package/templates/default/src/app.json +0 -10
  16. package/templates/default/src/app.scss +0 -0
  17. package/templates/default/src/app.ts +0 -6
  18. package/templates/default/src/components/HelloWorld/HelloWorld.json +0 -6
  19. package/templates/default/src/components/HelloWorld/HelloWorld.scss +0 -47
  20. package/templates/default/src/components/HelloWorld/HelloWorld.ts +0 -61
  21. package/templates/default/src/components/HelloWorld/HelloWorld.wxml +0 -16
  22. package/templates/default/src/pages/index/index.json +0 -7
  23. package/templates/default/src/pages/index/index.scss +0 -0
  24. package/templates/default/src/pages/index/index.ts +0 -24
  25. package/templates/default/src/pages/index/index.wxml +0 -14
  26. package/templates/default/src/sitemap.json +0 -10
  27. package/templates/default/src/theme.json +0 -5
  28. package/templates/default/src/utils/util.ts +0 -3
  29. package/templates/default/src/vite-env.d.ts +0 -1
  30. package/templates/default/tsconfig.app.json +0 -60
  31. package/templates/default/tsconfig.json +0 -11
  32. package/templates/default/tsconfig.node.json +0 -33
  33. package/templates/default/vite.config.ts +0 -39
  34. package/templates/tailwindcss/.editorconfig +0 -9
  35. package/templates/tailwindcss/.vscode/settings.json +0 -5
  36. package/templates/tailwindcss/README.md +0 -28
  37. package/templates/tailwindcss/auto-import-components.json +0 -3
  38. package/templates/tailwindcss/gitignore +0 -35
  39. package/templates/tailwindcss/package.json +0 -38
  40. package/templates/tailwindcss/postcss.config.js +0 -6
  41. package/templates/tailwindcss/project.config.json +0 -43
  42. package/templates/tailwindcss/project.private.config.json +0 -8
  43. package/templates/tailwindcss/public/icon0.png +0 -0
  44. package/templates/tailwindcss/public/icon0s.png +0 -0
  45. package/templates/tailwindcss/public/icon1.png +0 -0
  46. package/templates/tailwindcss/public/icon1s.png +0 -0
  47. package/templates/tailwindcss/public/logo.png +0 -0
  48. package/templates/tailwindcss/src/app.json +0 -31
  49. package/templates/tailwindcss/src/app.scss +0 -3
  50. package/templates/tailwindcss/src/app.ts +0 -6
  51. package/templates/tailwindcss/src/components/HelloWorld/HelloWorld.json +0 -7
  52. package/templates/tailwindcss/src/components/HelloWorld/HelloWorld.scss +0 -1
  53. package/templates/tailwindcss/src/components/HelloWorld/HelloWorld.ts +0 -61
  54. package/templates/tailwindcss/src/components/HelloWorld/HelloWorld.wxml +0 -16
  55. package/templates/tailwindcss/src/pages/index/index.json +0 -7
  56. package/templates/tailwindcss/src/pages/index/index.scss +0 -0
  57. package/templates/tailwindcss/src/pages/index/index.ts +0 -48
  58. package/templates/tailwindcss/src/pages/index/index.wxml +0 -24
  59. package/templates/tailwindcss/src/pages/profile/index.json +0 -7
  60. package/templates/tailwindcss/src/pages/profile/index.scss +0 -0
  61. package/templates/tailwindcss/src/pages/profile/index.ts +0 -19
  62. package/templates/tailwindcss/src/pages/profile/index.wxml +0 -11
  63. package/templates/tailwindcss/src/sitemap.json +0 -10
  64. package/templates/tailwindcss/src/theme.json +0 -5
  65. package/templates/tailwindcss/src/utils/util.ts +0 -3
  66. package/templates/tailwindcss/src/vite-env.d.ts +0 -1
  67. package/templates/tailwindcss/tailwind.config.ts +0 -22
  68. package/templates/tailwindcss/tsconfig.app.json +0 -60
  69. package/templates/tailwindcss/tsconfig.json +0 -11
  70. package/templates/tailwindcss/tsconfig.node.json +0 -33
  71. package/templates/tailwindcss/vite.config.ts +0 -37
  72. package/templates/tdesign/.editorconfig +0 -9
  73. package/templates/tdesign/.vscode/settings.json +0 -5
  74. package/templates/tdesign/README.md +0 -28
  75. package/templates/tdesign/gitignore +0 -35
  76. package/templates/tdesign/package.json +0 -41
  77. package/templates/tdesign/postcss.config.js +0 -6
  78. package/templates/tdesign/project.config.json +0 -45
  79. package/templates/tdesign/project.private.config.json +0 -8
  80. package/templates/tdesign/public/logo.png +0 -0
  81. package/templates/tdesign/src/app.json +0 -10
  82. package/templates/tdesign/src/app.scss +0 -3
  83. package/templates/tdesign/src/app.ts +0 -6
  84. package/templates/tdesign/src/components/HelloWorld/HelloWorld.json +0 -8
  85. package/templates/tdesign/src/components/HelloWorld/HelloWorld.scss +0 -1
  86. package/templates/tdesign/src/components/HelloWorld/HelloWorld.ts +0 -64
  87. package/templates/tdesign/src/components/HelloWorld/HelloWorld.wxml +0 -17
  88. package/templates/tdesign/src/pages/index/index.json +0 -7
  89. package/templates/tdesign/src/pages/index/index.scss +0 -0
  90. package/templates/tdesign/src/pages/index/index.ts +0 -97
  91. package/templates/tdesign/src/pages/index/index.wxml +0 -24
  92. package/templates/tdesign/src/sitemap.json +0 -10
  93. package/templates/tdesign/src/theme.json +0 -5
  94. package/templates/tdesign/src/utils/util.ts +0 -3
  95. package/templates/tdesign/src/vite-env.d.ts +0 -1
  96. package/templates/tdesign/tailwind.config.ts +0 -22
  97. package/templates/tdesign/tsconfig.app.json +0 -63
  98. package/templates/tdesign/tsconfig.json +0 -11
  99. package/templates/tdesign/tsconfig.node.json +0 -33
  100. package/templates/tdesign/vite.config.ts +0 -41
  101. package/templates/vant/.editorconfig +0 -9
  102. package/templates/vant/.vscode/settings.json +0 -5
  103. package/templates/vant/README.md +0 -28
  104. package/templates/vant/gitignore +0 -35
  105. package/templates/vant/package.json +0 -41
  106. package/templates/vant/postcss.config.js +0 -6
  107. package/templates/vant/project.config.json +0 -42
  108. package/templates/vant/project.private.config.json +0 -8
  109. package/templates/vant/public/logo.png +0 -0
  110. package/templates/vant/src/app.json +0 -10
  111. package/templates/vant/src/app.scss +0 -3
  112. package/templates/vant/src/app.ts +0 -6
  113. package/templates/vant/src/components/HelloWorld/HelloWorld.json +0 -9
  114. package/templates/vant/src/components/HelloWorld/HelloWorld.scss +0 -1
  115. package/templates/vant/src/components/HelloWorld/HelloWorld.ts +0 -61
  116. package/templates/vant/src/components/HelloWorld/HelloWorld.wxml +0 -19
  117. package/templates/vant/src/pages/index/index.json +0 -7
  118. package/templates/vant/src/pages/index/index.scss +0 -0
  119. package/templates/vant/src/pages/index/index.ts +0 -57
  120. package/templates/vant/src/pages/index/index.wxml +0 -28
  121. package/templates/vant/src/sitemap.json +0 -10
  122. package/templates/vant/src/theme.json +0 -5
  123. package/templates/vant/src/utils/util.ts +0 -3
  124. package/templates/vant/src/vite-env.d.ts +0 -1
  125. package/templates/vant/tailwind.config.ts +0 -22
  126. package/templates/vant/tsconfig.app.json +0 -63
  127. package/templates/vant/tsconfig.json +0 -11
  128. package/templates/vant/tsconfig.node.json +0 -33
  129. package/templates/vant/vite.config.ts +0 -41
  130. package/templates/wevu/.editorconfig +0 -9
  131. package/templates/wevu/.vscode/settings.json +0 -5
  132. package/templates/wevu/README.md +0 -29
  133. package/templates/wevu/auto-import-components.json +0 -1
  134. package/templates/wevu/gitignore +0 -35
  135. package/templates/wevu/package.json +0 -30
  136. package/templates/wevu/project.config.json +0 -43
  137. package/templates/wevu/project.private.config.json +0 -8
  138. package/templates/wevu/public/logo.png +0 -0
  139. package/templates/wevu/src/app.vue +0 -36
  140. package/templates/wevu/src/components/HelloWorld/index.vue +0 -45
  141. package/templates/wevu/src/pages/index/index.vue +0 -138
  142. package/templates/wevu/src/sitemap.json +0 -10
  143. package/templates/wevu/src/theme.json +0 -5
  144. package/templates/wevu/src/vite-env.d.ts +0 -1
  145. package/templates/wevu/tsconfig.app.json +0 -60
  146. package/templates/wevu/tsconfig.json +0 -11
  147. package/templates/wevu/tsconfig.node.json +0 -33
  148. package/templates/wevu/vite.config.ts +0 -8
  149. package/templates/wevu-tdesign/.editorconfig +0 -9
  150. package/templates/wevu-tdesign/.vscode/settings.json +0 -5
  151. package/templates/wevu-tdesign/README.md +0 -29
  152. package/templates/wevu-tdesign/auto-import-components.json +0 -83
  153. package/templates/wevu-tdesign/components.d.ts +0 -183
  154. package/templates/wevu-tdesign/gitignore +0 -35
  155. package/templates/wevu-tdesign/package.json +0 -40
  156. package/templates/wevu-tdesign/postcss.config.js +0 -6
  157. package/templates/wevu-tdesign/project.config.json +0 -43
  158. package/templates/wevu-tdesign/project.private.config.json +0 -8
  159. package/templates/wevu-tdesign/public/logo.png +0 -0
  160. package/templates/wevu-tdesign/src/app.vue +0 -40
  161. package/templates/wevu-tdesign/src/components/HelloWorld/index.vue +0 -45
  162. package/templates/wevu-tdesign/src/pages/index/index.vue +0 -138
  163. package/templates/wevu-tdesign/src/sitemap.json +0 -10
  164. package/templates/wevu-tdesign/src/theme.json +0 -5
  165. package/templates/wevu-tdesign/src/vite-env.d.ts +0 -1
  166. package/templates/wevu-tdesign/tailwind.config.ts +0 -22
  167. package/templates/wevu-tdesign/tsconfig.app.json +0 -60
  168. package/templates/wevu-tdesign/tsconfig.json +0 -11
  169. package/templates/wevu-tdesign/tsconfig.node.json +0 -33
  170. package/templates/wevu-tdesign/typed-components.d.ts +0 -943
  171. package/templates/wevu-tdesign/vite.config.ts +0 -43
@@ -1,40 +0,0 @@
1
- <script setup lang="ts">
2
- import { onHide, onLaunch, onShow } from 'wevu'
3
-
4
- defineAppJson({
5
- pages: [
6
- 'pages/index/index',
7
- ],
8
- window: {
9
- navigationBarTitleText: 'Wepp-Vite + WeVU Template',
10
- navigationBarBackgroundColor: '#4c6ef5',
11
- navigationBarTextStyle: 'white',
12
- },
13
- style: 'v2',
14
- componentFramework: 'glass-easel',
15
- sitemapLocation: 'sitemap.json',
16
- })
17
-
18
- onShow(() => {
19
- console.log('[weapp-vite-wevu-template] app show')
20
- })
21
-
22
- onHide(() => {
23
- console.log('[weapp-vite-wevu-template] app hide')
24
- })
25
-
26
- onLaunch(() => {
27
- console.log('[weapp-vite-wevu-template] app launch')
28
- })
29
- </script>
30
-
31
- <style lang="scss">
32
- @use 'tailwindcss/base';
33
- @use 'tailwindcss/components';
34
- @use 'tailwindcss/utilities';
35
-
36
- page {
37
- color: #1c1c3c;
38
- background: #f6f7fb;
39
- }
40
- </style>
@@ -1,45 +0,0 @@
1
- <script setup lang="ts">
2
- const props = withDefaults(
3
- defineProps<{
4
- title?: string
5
- subtitle?: string
6
- }>(),
7
- {
8
- title: 'Hello WeVU',
9
- subtitle: '',
10
- },
11
- )
12
- </script>
13
-
14
- <template>
15
- <view class="header">
16
- <text class="title">
17
- {{ props.title }}
18
- </text>
19
- <text v-if="props.subtitle" class="subtitle">
20
- {{ props.subtitle }}
21
- </text>
22
- </view>
23
- </template>
24
-
25
- <style>
26
- .header {
27
- padding: 24rpx;
28
- background: linear-gradient(135deg, #4c6ef5, #7048e8);
29
- border-radius: 24rpx;
30
- }
31
-
32
- .title {
33
- display: block;
34
- font-size: 40rpx;
35
- font-weight: 700;
36
- color: #fff;
37
- }
38
-
39
- .subtitle {
40
- display: block;
41
- margin-top: 8rpx;
42
- font-size: 26rpx;
43
- color: rgb(255 255 255 / 85%);
44
- }
45
- </style>
@@ -1,138 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, ref, watch } from 'wevu'
3
-
4
- import HelloWorld from '@/components/HelloWorld/index.vue'
5
-
6
- definePageJson({
7
- navigationBarTitleText: '首页',
8
- })
9
-
10
- const count = ref(0)
11
- const message = ref('Hello WeVU!')
12
- const todos = ref([
13
- '用 Vue SFC 写页面/组件',
14
- '用 wevu API(ref/computed/watch)写逻辑',
15
- '用 v-for / v-if / @tap / v-model 写模板',
16
- ])
17
-
18
- const doubled = computed(() => count.value * 2)
19
-
20
- function increment() {
21
- count.value += 1
22
- }
23
-
24
- function reset() {
25
- count.value = 0
26
- }
27
-
28
- watch(count, (newValue, oldValue) => {
29
- console.log(`[wevu] count changed: ${oldValue} -> ${newValue}`)
30
- })
31
- </script>
32
-
33
- <template>
34
- <view class="page">
35
- <HelloWorld :title="message" :subtitle="`count=${count}, doubled=${doubled}`" />
36
-
37
- <view class="card">
38
- <view class="row">
39
- <text class="label">
40
- 当前计数:{{ count }}
41
- </text>
42
- <text class="label">
43
- 双倍:{{ doubled }}
44
- </text>
45
- </view>
46
-
47
- <view class="row actions">
48
- <button class="btn primary" @tap="increment">
49
- +1
50
- </button>
51
- <button class="btn danger" @tap="reset">
52
- 重置
53
- </button>
54
- </view>
55
-
56
- <view class="row">
57
- <text class="label">
58
- 文本双向绑定:
59
- </text>
60
- </view>
61
- <input v-model="message" class="input" placeholder="输入标题…">
62
-
63
- <view class="row">
64
- <text class="label">
65
- Checklist
66
- </text>
67
- </view>
68
- <view class="todo">
69
- <view v-for="(todo, index) in todos" :key="index" class="todo-item">
70
- <text>• {{ todo }}</text>
71
- </view>
72
- </view>
73
- </view>
74
- </view>
75
- </template>
76
-
77
- <style>
78
- .page {
79
- box-sizing: border-box;
80
- padding: 48rpx 32rpx 64rpx;
81
- }
82
-
83
- .card {
84
- padding: 32rpx;
85
- margin-top: 24rpx;
86
- background: #fff;
87
- border-radius: 24rpx;
88
- box-shadow: 0 12rpx 32rpx rgb(44 44 84 / 10%);
89
- }
90
-
91
- .row {
92
- display: flex;
93
- gap: 16rpx;
94
- align-items: center;
95
- justify-content: space-between;
96
- margin-bottom: 16rpx;
97
- }
98
-
99
- .label {
100
- font-size: 30rpx;
101
- color: #1c1c3c;
102
- }
103
-
104
- .actions {
105
- margin: 24rpx 0;
106
- }
107
-
108
- .btn {
109
- flex: 1;
110
- line-height: 96rpx;
111
- color: #fff;
112
- border-radius: 16rpx;
113
- }
114
-
115
- .btn.primary {
116
- background: #4c6ef5;
117
- }
118
-
119
- .btn.danger {
120
- background: #f03e3e;
121
- }
122
-
123
- .input {
124
- box-sizing: border-box;
125
- height: 88rpx;
126
- padding: 0 24rpx;
127
- margin: 0 0 24rpx;
128
- background: #fff;
129
- border: 2rpx solid #e9ecef;
130
- border-radius: 16rpx;
131
- }
132
-
133
- .todo-item {
134
- margin-bottom: 12rpx;
135
- font-size: 26rpx;
136
- color: #4f4f7a;
137
- }
138
- </style>
@@ -1,10 +0,0 @@
1
- {
2
- "$schema": "https://vite.icebreaker.top/sitemap.json",
3
- "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
4
- "rules": [
5
- {
6
- "action": "allow",
7
- "page": "*"
8
- }
9
- ]
10
- }
@@ -1,5 +0,0 @@
1
- {
2
- "$schema": "https://vite.icebreaker.top/theme.json",
3
- "light": {},
4
- "dark": {}
5
- }
@@ -1 +0,0 @@
1
- /// <reference types="weapp-vite/client" />
@@ -1,22 +0,0 @@
1
- import type { Config } from 'tailwindcss'
2
- import { getIconCollections, iconsPlugin } from '@egoist/tailwindcss-icons'
3
-
4
- export default <Config>{
5
- content: [
6
- // 添加你需要提取的文件目录
7
- 'src/**/*.{wxml,js,ts,vue}',
8
- ],
9
- theme: {
10
- extend: {},
11
- },
12
- plugins: [
13
- iconsPlugin({
14
- collections: getIconCollections(['mdi']),
15
- }),
16
- ],
17
- corePlugins: {
18
- // 小程序不需要 preflight 和 container,因为这主要是给 h5 的,如果你要同时开发小程序和 h5 端,你应该使用环境变量来控制它
19
- preflight: false,
20
- container: false,
21
- },
22
- }
@@ -1,60 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
4
- "target": "ES2023",
5
- "jsx": "preserve",
6
- "lib": [
7
- "ES2023",
8
- "DOM",
9
- "DOM.Iterable"
10
- ],
11
- "moduleDetection": "force",
12
- "baseUrl": ".",
13
- "module": "ESNext",
14
- "moduleResolution": "bundler",
15
- "paths": {
16
- "@/*": [
17
- "./src/*"
18
- ],
19
- "take:@/*": [
20
- "./src/*"
21
- ]
22
- },
23
- "resolveJsonModule": true,
24
- "types": [
25
- "miniprogram-api-typings"
26
- ],
27
- "allowImportingTsExtensions": true,
28
- "allowJs": true,
29
- "strict": true,
30
- "noFallthroughCasesInSwitch": true,
31
- "noUnusedLocals": true,
32
- "noUnusedParameters": true,
33
- "noEmit": true,
34
- "allowSyntheticDefaultImports": true,
35
- "esModuleInterop": true,
36
- "isolatedModules": true,
37
- "verbatimModuleSyntax": true,
38
- "noUncheckedSideEffectImports": true,
39
- "erasableSyntaxOnly": true,
40
- "skipLibCheck": true
41
- },
42
- "vueCompilerOptions": {
43
- "plugins": [
44
- "weapp-vite/volar"
45
- ]
46
- },
47
- "include": [
48
- "src/**/*.ts",
49
- "src/**/*.tsx",
50
- "src/**/*.js",
51
- "src/**/*.jsx",
52
- "src/**/*.mts",
53
- "src/**/*.cts",
54
- "src/**/*.vue",
55
- "src/**/*.json",
56
- "src/**/*.d.ts",
57
- "types/**/*.d.ts",
58
- "env.d.ts"
59
- ]
60
- }
@@ -1,11 +0,0 @@
1
- {
2
- "references": [
3
- {
4
- "path": "./tsconfig.app.json"
5
- },
6
- {
7
- "path": "./tsconfig.node.json"
8
- }
9
- ],
10
- "files": []
11
- }
@@ -1,33 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
4
- "target": "ES2023",
5
- "lib": [
6
- "ES2023"
7
- ],
8
- "moduleDetection": "force",
9
- "module": "ESNext",
10
- "moduleResolution": "bundler",
11
- "resolveJsonModule": true,
12
- "types": [
13
- "node"
14
- ],
15
- "allowImportingTsExtensions": true,
16
- "strict": true,
17
- "noFallthroughCasesInSwitch": true,
18
- "noUnusedLocals": true,
19
- "noUnusedParameters": true,
20
- "noEmit": true,
21
- "verbatimModuleSyntax": true,
22
- "noUncheckedSideEffectImports": true,
23
- "erasableSyntaxOnly": true,
24
- "skipLibCheck": true
25
- },
26
- "include": [
27
- "vite.config.ts",
28
- "vite.config.*.ts",
29
- "*.config.ts",
30
- "config/**/*.ts",
31
- "scripts/**/*.ts"
32
- ]
33
- }