Skip to content

Commit

Permalink
feat: init playground
Browse files Browse the repository at this point in the history
  • Loading branch information
FliPPeDround committed Sep 26, 2024
1 parent 67d8b94 commit 6dfe84b
Show file tree
Hide file tree
Showing 36 changed files with 7,730 additions and 569 deletions.
8 changes: 4 additions & 4 deletions docs/guide/start/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ import code from './index.vue?raw'
::: code-group

```bash [<div flex items-center><div i-vscode-icons:file-type-pnpm mr2 /> pnpm</div>]
pnpm i leafer-vue
pnpm i leafer-ui leafer-vue
```

```bash [<div flex items-center><div i-vscode-icons:file-type-yarn mr2 /> yarn</div>]
yarn add leafer-vue
yarn add leafer-ui leafer-vue
```

```bash [<div flex items-center><div i-vscode-icons:file-type-npm mr2 /> npm</div>]
npm i leafer-vue
npm i leafer-ui leafer-vue
```

```bash [<div flex items-center><div i-vscode-icons:file-type-bun mr2 /> bun</div>]
bun add leafer-vue
bun add leafer-ui leafer-vue
```

:::
Expand Down
189 changes: 1 addition & 188 deletions docs/public/leafer-vue.proxy.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/vue3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
},
"dependencies": {
"@vue/runtime-core": "^3.5.4",
"leafer-ui": "^1.0.2",
"vue": "^3.5.4"
}
}
1 change: 1 addition & 0 deletions packages/vue3/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default defineConfig ((options) => {
onSuccess: async () => {
const leaferVueEsm = fs.readFileSync('./dist/index.js', 'utf-8')
fs.writeFileSync('./../../docs/public/leafer-vue.proxy.js', leaferVueEsm)
fs.writeFileSync('./../../playground/public/leafer-vue.proxy.js', leaferVueEsm)
// eslint-disable-next-line no-console
console.log(buildBanner)
return Promise.resolve()
Expand Down
28 changes: 0 additions & 28 deletions playground/.gitignore

This file was deleted.

3 changes: 0 additions & 3 deletions playground/.vscode/extensions.json

This file was deleted.

44 changes: 7 additions & 37 deletions playground/README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,10 @@
# .
<p align="center">
<img width="300px" src="">
</p>

This template should help get you started developing with Vue 3 in Vite.
# Leafer Vue Playground

## Recommended IDE Setup
## Credits

[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).

## Type Support for `.vue` Imports in TS

TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:

1. Disable the built-in TypeScript Extension
1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.

## Customize configuration

See [Vite Configuration Reference](https://vitejs.dev/config/).

## Project Setup

```sh
pnpm install
```

### Compile and Hot-Reload for Development

```sh
pnpm dev
```

### Type-Check, Compile and Minify for Production

```sh
pnpm build
```
- [vuejs/repl](https://github.com/vuejs/repl)
- [element-plus/element-plus-playground](https://github.com/element-plus/element-plus-playground)
1 change: 0 additions & 1 deletion playground/env.d.ts

This file was deleted.

16 changes: 10 additions & 6 deletions playground/index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/svg" href="./src/assets/logo.svg" />
<title>Leafer Vue Playground</title>
<script>
window.process = { env: {} }
</script>
<script type="module" src="./src/main.ts"></script>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
Loading

0 comments on commit 6dfe84b

Please sign in to comment.