Skip to content

Commit 81d76d2

Browse files
committed
chore(complex-types): add playground
1 parent 1f9a00c commit 81d76d2

File tree

14 files changed

+396
-6
lines changed

14 files changed

+396
-6
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"tsdown": "^0.15.11",
2727
"typescript": "^5.9.3",
2828
"vite": "^7.1.12",
29+
"vite-plugin-inspect": "^11.3.3",
2930
"vite-tsconfig-paths": "^5.1.4",
3031
"vitest": "^4.0.5",
3132
"vue": "^3.5.22"

packages/complex-types/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
},
6464
"scripts": {
6565
"build": "tsdown",
66+
"play": "vite playground",
6667
"prepublishOnly": "nr build",
6768
"watch": "tsdown --watch"
6869
},
@@ -77,7 +78,9 @@
7778
},
7879
"devDependencies": {
7980
"@nuxt/schema": "catalog:",
81+
"@vitejs/plugin-vue": "^6.0.1",
8082
"@vue-macros/better-define": "^3.1.1",
83+
"@vue/tsconfig": "^0.8.1",
8184
"rolldown": "catalog:",
8285
"rollup": "catalog:",
8386
"vite": "catalog:",
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>playground</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.ts"></script>
12+
</body>
13+
</html>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<script setup lang="ts">
2+
import HelloWorld from "./components/HelloWorld.vue";
3+
</script>
4+
5+
<template>
6+
<div>
7+
<a href="https://vuejs.org/" target="_blank">
8+
<img alt="Vue logo" class="logo vue" src="./assets/vue.svg" />
9+
</a>
10+
</div>
11+
<HelloWorld msg="Vite + Vue" />
12+
<HelloWorld msg="Vite + Vue" />
13+
<HelloWorld msg="Vite + Vue" />
14+
<HelloWorld msg="Vite + Vue" />
15+
<HelloWorld msg="Vite + Vue" />
16+
<HelloWorld msg="Vite + Vue" />
17+
<HelloWorld msg="Vite + Vue" />
18+
</template>
19+
20+
<style scoped>
21+
.logo {
22+
height: 6em;
23+
padding: 1.5em;
24+
will-change: filter;
25+
transition: filter 300ms;
26+
}
27+
.logo.vue:hover {
28+
filter: drop-shadow(0 0 2em #42b883aa);
29+
}
30+
</style>
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<script setup lang="ts">
2+
import { ref } from "vue";
3+
4+
type Props = 1 extends 2 ? { wtf?: true } : { msg: string };
5+
6+
defineProps<Props>();
7+
8+
const count = ref(0);
9+
</script>
10+
11+
<template>
12+
<h1>{{ msg }}</h1>
13+
14+
<div class="card">
15+
<button type="button" @click="count++">count is {{ count }}</button>
16+
<p>
17+
Edit
18+
<code>components/HelloWorld.vue</code>
19+
to test HMR
20+
</p>
21+
</div>
22+
23+
<p>
24+
Check out
25+
<a href="https://vuejs.org/guide/quick-start.html#local" target="_blank">
26+
create-vue
27+
</a>
28+
, the official Vue + Vite starter
29+
</p>
30+
<p>
31+
Learn more about IDE Support for Vue in the
32+
<a
33+
href="https://vuejs.org/guide/scaling-up/tooling.html#ide-support"
34+
target="_blank"
35+
>
36+
Vue Docs Scaling up Guide
37+
</a>
38+
.
39+
</p>
40+
<p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
41+
</template>
42+
43+
<style scoped>
44+
.read-the-docs {
45+
color: #888;
46+
}
47+
</style>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { createApp } from "vue";
2+
3+
import App from "./App.vue";
4+
5+
import "./style.css";
6+
7+
createApp(App).mount("#app");
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
:root {
2+
font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
3+
line-height: 1.5;
4+
font-weight: 400;
5+
6+
color-scheme: light dark;
7+
color: rgba(255, 255, 255, 0.87);
8+
background-color: #242424;
9+
10+
font-synthesis: none;
11+
text-rendering: optimizeLegibility;
12+
-webkit-font-smoothing: antialiased;
13+
-moz-osx-font-smoothing: grayscale;
14+
}
15+
16+
a {
17+
font-weight: 500;
18+
color: #646cff;
19+
text-decoration: inherit;
20+
}
21+
a:hover {
22+
color: #535bf2;
23+
}
24+
25+
body {
26+
margin: 0;
27+
display: flex;
28+
place-items: center;
29+
min-width: 320px;
30+
min-height: 100vh;
31+
}
32+
33+
h1 {
34+
font-size: 3.2em;
35+
line-height: 1.1;
36+
}
37+
38+
button {
39+
border-radius: 8px;
40+
border: 1px solid transparent;
41+
padding: 0.6em 1.2em;
42+
font-size: 1em;
43+
font-weight: 500;
44+
font-family: inherit;
45+
background-color: #1a1a1a;
46+
cursor: pointer;
47+
transition: border-color 0.25s;
48+
}
49+
button:hover {
50+
border-color: #646cff;
51+
}
52+
button:focus,
53+
button:focus-visible {
54+
outline: 4px auto -webkit-focus-ring-color;
55+
}
56+
57+
.card {
58+
padding: 2em;
59+
}
60+
61+
#app {
62+
max-width: 1280px;
63+
margin: 0 auto;
64+
padding: 2rem;
65+
text-align: center;
66+
}
67+
68+
@media (prefers-color-scheme: light) {
69+
:root {
70+
color: #213547;
71+
background-color: #ffffff;
72+
}
73+
a:hover {
74+
color: #747bff;
75+
}
76+
button {
77+
background-color: #f9f9f9;
78+
}
79+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"extends": "@vue/tsconfig/tsconfig.dom.json",
3+
"compilerOptions": {
4+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
5+
"types": ["vite/client"],
6+
7+
/* Linting */
8+
"strict": true,
9+
"noFallthroughCasesInSwitch": true,
10+
"noUnusedLocals": true,
11+
"noUnusedParameters": true,
12+
"erasableSyntaxOnly": true,
13+
"noUncheckedSideEffectImports": true
14+
},
15+
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"]
16+
}

0 commit comments

Comments
 (0)