create-weapp-vite 2.0.78 → 2.0.80

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.
package/dist/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as RECOMMENDED_SKILLS_INSTALL_COMMAND, r as TemplateName, t as createProject } from "./src-CCWjAwFU.js";
1
+ import { n as RECOMMENDED_SKILLS_INSTALL_COMMAND, r as TemplateName, t as createProject } from "./src-CVPELAx0.js";
2
2
  import logger from "@weapp-core/logger";
3
3
  import { fs } from "@weapp-core/shared";
4
4
  import process from "node:process";
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { r as TemplateName, t as createProject } from "./src-CCWjAwFU.js";
1
+ import { r as TemplateName, t as createProject } from "./src-CVPELAx0.js";
2
2
  export { TemplateName, createProject };
@@ -9,10 +9,10 @@ import process from "node:process";
9
9
  var version$2 = "0.2.3";
10
10
  //#endregion
11
11
  //#region ../../packages-runtime/wevu/package.json
12
- var version$1 = "6.14.0";
12
+ var version$1 = "6.14.2";
13
13
  //#endregion
14
14
  //#region ../weapp-vite/package.json
15
- var version = "6.14.0";
15
+ var version = "6.14.2";
16
16
  //#endregion
17
17
  //#region src/enums.ts
18
18
  let TemplateName = /* @__PURE__ */ function(TemplateName) {
@@ -116,10 +116,10 @@ const TEMPLATE_CATALOG = {
116
116
  "comment-json": "^4.6.2",
117
117
  "estree-walker": "^3.0.3",
118
118
  "gm-crypto": "^0.1.12",
119
- "lru-cache": "^11.2.7",
119
+ "lru-cache": "^11.3.2",
120
120
  "magic-string": "^0.30.21",
121
121
  "miniprogram-api-typings": "^5.1.2",
122
- "oxc-parser": "^0.123.0",
122
+ "oxc-parser": "^0.124.0",
123
123
  "oxc-walker": "^0.7.0",
124
124
  "pkg-types": "^2.3.0",
125
125
  "sass-embedded": "^1.99.0",
@@ -141,13 +141,13 @@ const TEMPLATE_CATALOG = {
141
141
  lodash: "^4.18.1",
142
142
  merge: "^2.1.1",
143
143
  pathe: "^2.0.3",
144
- postcss: "^8.5.8",
145
- rolldown: "1.0.0-rc.11",
144
+ postcss: "^8.5.9",
145
+ rolldown: "1.0.0-rc.13",
146
146
  sass: "^1.99.0",
147
147
  tailwindcss: "^4.2.2",
148
148
  tslib: "^2.8.1",
149
149
  typescript: "^6.0.2",
150
- vite: "8.0.2",
150
+ vite: "8.0.7",
151
151
  vue: "^3.5.32",
152
152
  zod: "^4.3.6"
153
153
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-weapp-vite",
3
3
  "type": "module",
4
- "version": "2.0.78",
4
+ "version": "2.0.80",
5
5
  "description": "create-weapp-vite",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -47,7 +47,7 @@
47
47
  "node": "^20.19.0 || >=22.12.0"
48
48
  },
49
49
  "dependencies": {
50
- "@inquirer/prompts": "^8.3.2",
50
+ "@inquirer/prompts": "^8.4.1",
51
51
  "pathe": "^2.0.3",
52
52
  "pkg-types": "^2.3.0",
53
53
  "@weapp-core/logger": "^3.1.1",
@@ -28,8 +28,8 @@
28
28
  "postinstall": "wv prepare"
29
29
  },
30
30
  "devDependencies": {
31
- "@icebreakers/eslint-config": "^4.0.0",
32
- "@icebreakers/stylelint-config": "^3.0.0",
31
+ "@icebreakers/eslint-config": "^4.0.2",
32
+ "@icebreakers/stylelint-config": "^3.0.2",
33
33
  "eslint": "^10.2.0",
34
34
  "miniprogram-api-typings": "catalog:",
35
35
  "sass": "catalog:",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "weapp-vite-lib-template",
3
3
  "type": "module",
4
- "version": "5.0.0",
4
+ "version": "5.0.2",
5
5
  "private": true,
6
6
  "description": "weapp-vite 组件库(lib 模式)模板",
7
7
  "author": "ice breaker <1324318532@qq.com>",
@@ -33,8 +33,8 @@
33
33
  "wevu": "workspace:*"
34
34
  },
35
35
  "devDependencies": {
36
- "@icebreakers/eslint-config": "^4.0.0",
37
- "@icebreakers/stylelint-config": "^3.0.0",
36
+ "@icebreakers/eslint-config": "^4.0.2",
37
+ "@icebreakers/stylelint-config": "^3.0.2",
38
38
  "@wevu/api": "workspace:*",
39
39
  "eslint": "^10.2.0",
40
40
  "miniprogram-api-typings": "catalog:",
@@ -29,8 +29,8 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "@egoist/tailwindcss-icons": "catalog:",
32
- "@icebreakers/eslint-config": "^4.0.0",
33
- "@icebreakers/stylelint-config": "^3.0.0",
32
+ "@icebreakers/eslint-config": "^4.0.2",
33
+ "@icebreakers/stylelint-config": "^3.0.2",
34
34
  "@iconify-json/mdi": "catalog:",
35
35
  "autoprefixer": "catalog:",
36
36
  "eslint": "^10.2.0",
@@ -32,8 +32,8 @@
32
32
  },
33
33
  "devDependencies": {
34
34
  "@egoist/tailwindcss-icons": "catalog:",
35
- "@icebreakers/eslint-config": "^4.0.0",
36
- "@icebreakers/stylelint-config": "^3.0.0",
35
+ "@icebreakers/eslint-config": "^4.0.2",
36
+ "@icebreakers/stylelint-config": "^3.0.2",
37
37
  "@iconify-json/mdi": "catalog:",
38
38
  "autoprefixer": "catalog:",
39
39
  "eslint": "^10.2.0",
@@ -32,8 +32,8 @@
32
32
  },
33
33
  "devDependencies": {
34
34
  "@egoist/tailwindcss-icons": "catalog:",
35
- "@icebreakers/eslint-config": "^4.0.0",
36
- "@icebreakers/stylelint-config": "^3.0.0",
35
+ "@icebreakers/eslint-config": "^4.0.2",
36
+ "@icebreakers/stylelint-config": "^3.0.2",
37
37
  "@iconify-json/mdi": "catalog:",
38
38
  "autoprefixer": "catalog:",
39
39
  "eslint": "^10.2.0",
@@ -28,8 +28,8 @@
28
28
  "postinstall": "wv prepare"
29
29
  },
30
30
  "devDependencies": {
31
- "@icebreakers/eslint-config": "^4.0.0",
32
- "@icebreakers/stylelint-config": "^3.0.0",
31
+ "@icebreakers/eslint-config": "^4.0.2",
32
+ "@icebreakers/stylelint-config": "^3.0.2",
33
33
  "eslint": "^10.2.0",
34
34
  "miniprogram-api-typings": "catalog:",
35
35
  "stylelint": "^17.6.0",
@@ -32,8 +32,8 @@
32
32
  },
33
33
  "devDependencies": {
34
34
  "@egoist/tailwindcss-icons": "catalog:",
35
- "@icebreakers/eslint-config": "^4.0.0",
36
- "@icebreakers/stylelint-config": "^3.0.0",
35
+ "@icebreakers/eslint-config": "^4.0.2",
36
+ "@icebreakers/stylelint-config": "^3.0.2",
37
37
  "@iconify-json/mdi": "catalog:",
38
38
  "autoprefixer": "catalog:",
39
39
  "eslint": "^10.2.0",
@@ -67,6 +67,12 @@
67
67
  "query": "",
68
68
  "scene": null
69
69
  },
70
+ {
71
+ "name": "virtualHost class 透传实验",
72
+ "pathName": "subpackages/lab/virtual-host-class/index",
73
+ "query": "",
74
+ "scene": null
75
+ },
70
76
  {
71
77
  "name": "系统能力页",
72
78
  "pathName": "subpackages/ability/index",
@@ -60,7 +60,7 @@ defineAppJson({
60
60
  subPackages: [
61
61
  {
62
62
  root: 'subpackages/lab',
63
- pages: ['index', 'class-binding/index'],
63
+ pages: ['index', 'class-binding/index', 'virtual-host-class/index'],
64
64
  },
65
65
  {
66
66
  root: 'subpackages/ability',
@@ -0,0 +1,46 @@
1
+ <script setup lang="ts">
2
+ defineProps<{
3
+ title: string
4
+ subtitle: string
5
+ }>()
6
+
7
+ defineComponentJson({
8
+ styleIsolation: 'apply-shared',
9
+ })
10
+ </script>
11
+
12
+ <template>
13
+ <view class="demo-card">
14
+ <text class="demo-title">
15
+ {{ title }}
16
+ </text>
17
+ <text class="demo-subtitle">
18
+ {{ subtitle }}
19
+ </text>
20
+ </view>
21
+ </template>
22
+
23
+ <style>
24
+ .demo-card {
25
+ display: flex;
26
+ flex-direction: column;
27
+ gap: 10rpx;
28
+ padding: 20rpx;
29
+ background: #fff;
30
+ border-radius: 20rpx;
31
+ box-shadow: 0 12rpx 28rpx rgb(17 24 39 / 8%);
32
+ }
33
+
34
+ .demo-title {
35
+ display: block;
36
+ font-size: 28rpx;
37
+ font-weight: 600;
38
+ }
39
+
40
+ .demo-subtitle {
41
+ display: block;
42
+ font-size: 22rpx;
43
+ line-height: 1.6;
44
+ opacity: 0.82;
45
+ }
46
+ </style>
@@ -0,0 +1,50 @@
1
+ <script setup lang="ts">
2
+ defineOptions({
3
+ externalClasses: ['class'],
4
+ })
5
+
6
+ defineProps<{
7
+ title: string
8
+ subtitle: string
9
+ }>()
10
+
11
+ defineComponentJson({
12
+ styleIsolation: 'apply-shared',
13
+ })
14
+ </script>
15
+
16
+ <template>
17
+ <view class="demo-card class">
18
+ <text class="demo-title">
19
+ {{ title }}
20
+ </text>
21
+ <text class="demo-subtitle">
22
+ {{ subtitle }}
23
+ </text>
24
+ </view>
25
+ </template>
26
+
27
+ <style>
28
+ .demo-card {
29
+ display: flex;
30
+ flex-direction: column;
31
+ gap: 10rpx;
32
+ padding: 20rpx;
33
+ background: #fff;
34
+ border-radius: 20rpx;
35
+ box-shadow: 0 12rpx 28rpx rgb(17 24 39 / 8%);
36
+ }
37
+
38
+ .demo-title {
39
+ display: block;
40
+ font-size: 28rpx;
41
+ font-weight: 600;
42
+ }
43
+
44
+ .demo-subtitle {
45
+ display: block;
46
+ font-size: 22rpx;
47
+ line-height: 1.6;
48
+ opacity: 0.82;
49
+ }
50
+ </style>
@@ -0,0 +1,53 @@
1
+ <script setup lang="ts">
2
+ defineOptions({
3
+ externalClasses: ['custom-class'],
4
+ })
5
+
6
+ const props = withDefaults(defineProps<{
7
+ title: string
8
+ subtitle: string
9
+ rootStyle?: string
10
+ }>(), {
11
+ rootStyle: '',
12
+ })
13
+
14
+ defineComponentJson({
15
+ styleIsolation: 'apply-shared',
16
+ })
17
+ </script>
18
+
19
+ <template>
20
+ <view class="demo-card custom-class" :style="props.rootStyle">
21
+ <text class="demo-title">
22
+ {{ title }}
23
+ </text>
24
+ <text class="demo-subtitle">
25
+ {{ subtitle }}
26
+ </text>
27
+ </view>
28
+ </template>
29
+
30
+ <style>
31
+ .demo-card {
32
+ display: flex;
33
+ flex-direction: column;
34
+ gap: 10rpx;
35
+ padding: 20rpx;
36
+ background: #fff;
37
+ border-radius: 20rpx;
38
+ box-shadow: 0 12rpx 28rpx rgb(17 24 39 / 8%);
39
+ }
40
+
41
+ .demo-title {
42
+ display: block;
43
+ font-size: 28rpx;
44
+ font-weight: 600;
45
+ }
46
+
47
+ .demo-subtitle {
48
+ display: block;
49
+ font-size: 22rpx;
50
+ line-height: 1.6;
51
+ opacity: 0.82;
52
+ }
53
+ </style>
@@ -98,6 +98,7 @@ async function navigateTo(url: string) {
98
98
  <view class="mt-[8rpx]">
99
99
  <t-cell-group>
100
100
  <t-cell title="Class 绑定实验室" note="子包:/subpackages/lab/class-binding" arrow @tap="navigateTo('/subpackages/lab/class-binding/index')" />
101
+ <t-cell title="virtualHost class 透传实验" note="子包:/subpackages/lab/virtual-host-class" arrow @tap="navigateTo('/subpackages/lab/virtual-host-class/index')" />
101
102
  </t-cell-group>
102
103
  </view>
103
104
  </view>
@@ -0,0 +1,94 @@
1
+ <script setup lang="ts">
2
+ import BrokenCard from '@/components/VirtualHostClassDemo/BrokenCard.vue'
3
+ import FixedExternalClassCard from '@/components/VirtualHostClassDemo/FixedExternalClassCard.vue'
4
+ import RecommendedCard from '@/components/VirtualHostClassDemo/RecommendedCard.vue'
5
+
6
+ definePageJson({
7
+ navigationBarTitleText: 'virtualHost class demo',
8
+ backgroundColor: '#f6f7fb',
9
+ })
10
+
11
+ const classCase = 'rounded-[20rpx] border border-red-500 bg-red-50 px-[20rpx] py-[16rpx] text-red-500'
12
+ const inlineStyleCase = 'color:#2563eb;background:#dbeafe;padding:16rpx;border-radius:20rpx;border:2rpx solid #60a5fa;'
13
+ </script>
14
+
15
+ <template>
16
+ <view class="min-h-screen bg-[#f6f7fb] px-[28rpx] pb-[88rpx] pt-[24rpx] text-[#1c1c3c]">
17
+ <view class="rounded-[28rpx] bg-gradient-to-br from-[#f5f3ff] via-[#ffffff] to-[#eef2ff] p-[20rpx]">
18
+ <text class="text-[32rpx] font-semibold text-[#1f1a3f]">
19
+ virtualHost + class/style 透传实验
20
+ </text>
21
+ <text class="mt-[10rpx] block text-[22rpx] leading-[1.7] text-[#5b5b7b]">
22
+ 当前模板已全局开启组件 `virtualHost: true` 和 `styleIsolation: 'apply-shared'`。本页用最小组件对比 4 种写法的实际效果。
23
+ </text>
24
+ </view>
25
+
26
+ <view class="mt-[18rpx] rounded-[24rpx] bg-white p-[20rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
27
+ <text class="text-[28rpx] font-semibold text-[#1f1a3f]">
28
+ 1. 仅 `apply-shared`,不做 class 透传
29
+ </text>
30
+ <text class="mt-[8rpx] block text-[22rpx] leading-[1.7] text-[#6f6b8a]">
31
+ 组件标签上写 `class` / `style`,但组件内部根节点没有接收这些 attrs。
32
+ </text>
33
+ <view class="mt-[14rpx] flex flex-col gap-[14rpx]">
34
+ <BrokenCard
35
+ :class="classCase"
36
+ title="BrokenCard"
37
+ subtitle="预期应变红并出现红色边框,但实际不会。"
38
+ />
39
+ <BrokenCard
40
+ :style="inlineStyleCase"
41
+ title="BrokenCard style"
42
+ subtitle="预期应变蓝并出现蓝色背景/边框,但实际不会。"
43
+ />
44
+ </view>
45
+ </view>
46
+
47
+ <view class="mt-[18rpx] rounded-[24rpx] bg-white p-[20rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
48
+ <text class="text-[28rpx] font-semibold text-[#1f1a3f]">
49
+ 2. `defineOptions({ externalClasses: ['class'] })`
50
+ </text>
51
+ <text class="mt-[8rpx] block text-[22rpx] leading-[1.7] text-[#6f6b8a]">
52
+ 这是你问的那种“继续用组件标签上的 `class`”方案。组件内部根节点必须显式写上 `class` 占位。
53
+ </text>
54
+ <view class="mt-[14rpx]">
55
+ <FixedExternalClassCard
56
+ :class="classCase"
57
+ title="FixedExternalClassCard"
58
+ subtitle="这一块应该会变红,并出现红色边框和浅红背景。"
59
+ />
60
+ </view>
61
+ </view>
62
+
63
+ <view class="mt-[18rpx] rounded-[24rpx] bg-white p-[20rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
64
+ <text class="text-[28rpx] font-semibold text-[#1f1a3f]">
65
+ 3. 推荐方案:`custom-class` + `rootStyle`
66
+ </text>
67
+ <text class="mt-[8rpx] block text-[22rpx] leading-[1.7] text-[#6f6b8a]">
68
+ `class` 和 `style` 分开设计,避免把组件标签 attrs 是否透传这件事变成隐式行为。
69
+ </text>
70
+ <view class="mt-[14rpx] flex flex-col gap-[14rpx]">
71
+ <RecommendedCard
72
+ custom-class="rounded-[20rpx] border border-emerald-500 bg-emerald-50 px-[20rpx] py-[16rpx] text-emerald-600"
73
+ title="RecommendedCard custom-class"
74
+ subtitle="通过 externalClasses 显式接收类名。"
75
+ />
76
+ <RecommendedCard
77
+ :root-style="inlineStyleCase"
78
+ title="RecommendedCard rootStyle"
79
+ subtitle="通过显式 prop 接收内联样式。"
80
+ />
81
+ </view>
82
+ </view>
83
+
84
+ <view class="mt-[18rpx] rounded-[24rpx] bg-[#1f1a3f] p-[20rpx] text-white">
85
+ <text class="text-[26rpx] font-semibold">
86
+ 结论
87
+ </text>
88
+ <text class="mt-[10rpx] block text-[22rpx] leading-[1.8] text-white/80">
89
+ `virtualHost: true` 和 `styleIsolation: 'apply-shared'` 不会自动提供 Vue 式根节点 `class/style` fallthrough。
90
+ 要么显式声明 `externalClasses` 并在根节点接入,要么把 `style` 做成显式 prop。
91
+ </text>
92
+ </view>
93
+ </view>
94
+ </template>