Skip to content

Commit 8de8b03

Browse files
committed
chore: regenerate the playground projects
1 parent 0f834fe commit 8de8b03

File tree

724 files changed

+12819
-6018
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

724 files changed

+12819
-6018
lines changed

index.js

Lines changed: 11 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,12 @@ import prompts from 'prompts'
99
import { red, green, bold } from 'kolorist'
1010

1111
import renderTemplate from './utils/renderTemplate.js'
12-
import {
13-
postOrderDirectoryTraverse,
14-
preOrderDirectoryTraverse
15-
} from './utils/directoryTraverse.js'
12+
import { postOrderDirectoryTraverse, preOrderDirectoryTraverse } from './utils/directoryTraverse.js'
1613
import generateReadme from './utils/generateReadme.js'
1714
import getCommand from './utils/getCommand.js'
1815

1916
function isValidPackageName(projectName) {
20-
return /^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(
21-
projectName
22-
)
17+
return /^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(projectName)
2318
}
2419

2520
function toValidPackageName(projectName) {
@@ -66,14 +61,8 @@ async function init() {
6661
// if any of the feature flags is set, we would skip the feature prompts
6762
// use `??` instead of `||` once we drop Node.js 12 support
6863
const isFeatureFlagsUsed =
69-
typeof (
70-
argv.default ||
71-
argv.ts ||
72-
argv.jsx ||
73-
argv.router ||
74-
argv.vuex ||
75-
argv.tests
76-
) === 'boolean'
64+
typeof (argv.default || argv.ts || argv.jsx || argv.router || argv.vuex || argv.tests) ===
65+
'boolean'
7766

7867
let targetDir = argv._[0]
7968
const defaultProjectName = !targetDir ? 'vue-project' : targetDir
@@ -99,18 +88,14 @@ async function init() {
9988
type: targetDir ? null : 'text',
10089
message: 'Project name:',
10190
initial: defaultProjectName,
102-
onState: (state) =>
103-
(targetDir = String(state.value).trim() || defaultProjectName)
91+
onState: (state) => (targetDir = String(state.value).trim() || defaultProjectName)
10492
},
10593
{
10694
name: 'shouldOverwrite',
107-
type: () =>
108-
canSafelyOverwrite(targetDir) || forceOverwrite ? null : 'confirm',
95+
type: () => (canSafelyOverwrite(targetDir) || forceOverwrite ? null : 'confirm'),
10996
message: () => {
11097
const dirForPrompt =
111-
targetDir === '.'
112-
? 'Current directory'
113-
: `Target directory "${targetDir}"`
98+
targetDir === '.' ? 'Current directory' : `Target directory "${targetDir}"`
11499

115100
return `${dirForPrompt} is not empty. Remove existing files and continue?`
116101
}
@@ -129,8 +114,7 @@ async function init() {
129114
type: () => (isValidPackageName(targetDir) ? null : 'text'),
130115
message: 'Package name:',
131116
initial: () => toValidPackageName(targetDir),
132-
validate: (dir) =>
133-
isValidPackageName(dir) || 'Invalid package.json name'
117+
validate: (dir) => isValidPackageName(dir) || 'Invalid package.json name'
134118
},
135119
{
136120
name: 'needsTypeScript',
@@ -206,10 +190,7 @@ async function init() {
206190
console.log(`\nScaffolding project in ${root}...`)
207191

208192
const pkg = { name: packageName, version: '0.0.0' }
209-
fs.writeFileSync(
210-
path.resolve(root, 'package.json'),
211-
JSON.stringify(pkg, null, 2)
212-
)
193+
fs.writeFileSync(path.resolve(root, 'package.json'), JSON.stringify(pkg, null, 2))
213194

214195
const templateRoot = new URL('./template', import.meta.url).pathname
215196
const render = function render(templateName) {
@@ -267,21 +248,15 @@ async function init() {
267248
if (filepath.endsWith('.js')) {
268249
fs.renameSync(filepath, filepath.replace(/\.js$/, '.ts'))
269250
} else if (path.basename(filepath) === 'jsconfig.json') {
270-
fs.renameSync(
271-
filepath,
272-
filepath.replace(/jsconfig\.json$/, 'tsconfig.json')
273-
)
251+
fs.renameSync(filepath, filepath.replace(/jsconfig\.json$/, 'tsconfig.json'))
274252
}
275253
}
276254
)
277255

278256
// Rename entry in `index.html`
279257
const indexHtmlPath = path.resolve(root, 'index.html')
280258
const indexHtmlContent = fs.readFileSync(indexHtmlPath, 'utf8')
281-
fs.writeFileSync(
282-
indexHtmlPath,
283-
indexHtmlContent.replace('src/main.js', 'src/main.ts')
284-
)
259+
fs.writeFileSync(indexHtmlPath, indexHtmlContent.replace('src/main.js', 'src/main.ts'))
285260
}
286261

287262
if (!needsTests) {

playground/default/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ See [Vite Configuration Reference](https://vitejs.dev/config/).
1313
## Project Setup
1414

1515
```sh
16-
npm install
16+
pnpm install
1717
```
1818

1919
### Compile and Hot-Reload for Development
2020

2121
```sh
22-
npm run dev
22+
pnpm dev
2323
```
2424

2525
### Compile and Minify for Production
2626

2727
```sh
28-
npm run build
28+
pnpm build
2929
```

playground/default/src/App.vue

Lines changed: 2 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
<script setup>
22
import HelloWorld from './components/HelloWorld.vue'
3-
import IntroductionItem from './components/IntroductionItem.vue'
4-
import ColorSchemeSwitch from './components/ColorSchemeSwitch.vue'
5-
6-
import DocumentationIcon from './components/icons/Documentation.vue'
7-
import ToolingIcon from './components/icons/Tooling.vue'
8-
import EcosystemIcon from './components/icons/Ecosystem.vue'
9-
import CommunityIcon from './components/icons/Community.vue'
10-
import SupportIcon from './components/icons/Support.vue'
3+
import Welcome from './components/Welcome.vue'
114
</script>
125

136
<template>
@@ -16,85 +9,11 @@ import SupportIcon from './components/icons/Support.vue'
169

1710
<div class="wrapper">
1811
<HelloWorld msg="You did it!" />
19-
<ColorSchemeSwitch />
2012
</div>
2113
</header>
2214

2315
<main>
24-
<IntroductionItem>
25-
<template #icon>
26-
<DocumentationIcon />
27-
</template>
28-
<template #heading>Documentation</template>
29-
30-
Widely regarded as one of the best, Vue’s
31-
<a target="_blank" href="https://v3.vuejs.org/">official documentation</a>
32-
will provide you with all information you need to get started. Whether you’re already a Vue
33-
veteran or just trying the framework out, great chances are you’ll find the answer to your
34-
next question there.
35-
</IntroductionItem>
36-
37-
<IntroductionItem>
38-
<template #icon>
39-
<ToolingIcon />
40-
</template>
41-
<template #heading>Tooling</template>
42-
43-
This project is served and bundled with
44-
<a href="https://vitejs.dev/guide/features.html" target="_blank">Vite</a>. The recommended IDE
45-
setup is <a href="https://code.visualstudio.com/" target="_blank">VSCode</a> +
46-
<a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>. If you need to
47-
test your components and web pages, check out
48-
<a href="https://www.cypress.io/" target="_blank">Cypress</a> and
49-
<a href="https://docs.cypress.io/guides/component-testing/introduction" target="_blank"
50-
>Cypress Component Testing</a
51-
>.
52-
53-
<br />
54-
55-
More instructions are available in <code>README.md</code>.
56-
</IntroductionItem>
57-
58-
<IntroductionItem>
59-
<template #icon>
60-
<EcosystemIcon />
61-
</template>
62-
<template #heading>Ecosystem</template>
63-
64-
Get official tools and libraries for your project:
65-
<a target="_blank" href="https://next.vuex.vuejs.org/">Vuex</a>,
66-
<a target="_blank" href="https://next.router.vuejs.org/">Vue Router</a>,
67-
<a target="_blank" href="https://next.vue-test-utils.vuejs.org/">Vue Test Utils</a>, and
68-
<a target="_blank" href="https://github.com/vuejs/devtools">Vue Dev Tools</a>. If you need
69-
more resources, we suggest paying
70-
<a target="_blank" href="https://github.com/vuejs/awesome-vue">Awesome Vue</a>
71-
a visit.
72-
</IntroductionItem>
73-
74-
<IntroductionItem>
75-
<template #icon>
76-
<CommunityIcon />
77-
</template>
78-
<template #heading>Community</template>
79-
80-
Got stuck? Ask your question on
81-
<a target="_blank" href="https://chat.vuejs.org">Vue Land</a>, our official Discord server, or
82-
<a target="_blank" href="https://stackoverflow.com/questions/tagged/vue.js">StackOverflow</a>.
83-
You should also subscribe to
84-
<a target="_blank" href="https://news.vuejs.org">our mailing list</a> for latest news in the
85-
Vue world.
86-
</IntroductionItem>
87-
88-
<IntroductionItem>
89-
<template #icon>
90-
<SupportIcon />
91-
</template>
92-
<template #heading>Support Vue</template>
93-
94-
As an independent project, Vue relies on community backing for its sustainability. You can
95-
help us by
96-
<a target="_blank" href="https://vuejs.org/support-vuejs/">becoming a sponsor</a>.
97-
</IntroductionItem>
16+
<Welcome />
9817
</main>
9918
</template>
10019

playground/default/src/assets/base.css

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
--vt-c-divider-light-1: rgba(60, 60, 60, 0.29);
1414
--vt-c-divider-light-2: rgba(60, 60, 60, 0.12);
15-
--vt-c-divider-dark-1: rgba(84, 84, 84, 0.65);
15+
--vt-c-divider-dadarkrk-1: rgba(84, 84, 84, 0.65);
1616
--vt-c-divider-dark-2: rgba(84, 84, 84, 0.48);
1717

1818
--vt-c-text-light-1: var(--vt-c-indigo);
@@ -36,16 +36,18 @@
3636
--section-gap: 160px;
3737
}
3838

39-
[data-color-scheme='dark'] {
40-
--color-background: var(--vt-c-black);
41-
--color-background-soft: var(--vt-c-black-soft);
42-
--color-background-mute: var(--vt-c-black-mute);
39+
@media (prefers-color-scheme: dark) {
40+
:root {
41+
--color-background: var(--vt-c-black);
42+
--color-background-soft: var(--vt-c-black-soft);
43+
--color-background-mute: var(--vt-c-black-mute);
4344

44-
--color-border: var(--vt-c-divider-dark-2);
45-
--color-border-hover: var(--vt-c-divider-dark-1);
45+
--color-border: var(--vt-c-divider-dark-2);
46+
--color-border-hover: var(--vt-c-divider-dark-1);
4647

47-
--color-heading: var(--vt-c-text-dark-1);
48-
--color-text: var(--vt-c-text-dark-2);
48+
--color-heading: var(--vt-c-text-dark-1);
49+
--color-text: var(--vt-c-text-dark-2);
50+
}
4951
}
5052

5153
*,
-6.69 KB
Binary file not shown.

0 commit comments

Comments
 (0)