Skip to content

Commit

Permalink
🎉 init(vite-plugin-autogeneration-import-file-test-app-1): 初始化测试应用项目。
Browse files Browse the repository at this point in the history
  • Loading branch information
ruan-cat committed Oct 22, 2024
1 parent d7ee528 commit 9498653
Show file tree
Hide file tree
Showing 32 changed files with 375 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
"Spades.vs-picgo"
],
"unwantedRecommendations": []
}
}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@
// https://nodejs.org/en/learn/typescript/run#registering-tsx-via-node
"typescript": "pnpm dotenvx run -- node --import=tsx $fullFileName"
}
}
}
2 changes: 1 addition & 1 deletion configs-package/commitlint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@
"peerDependencies": {
"typescript": "catalog:"
}
}
}
2 changes: 1 addition & 1 deletion demos/vercel-deploy-tool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@
"@vitest/ui": "^2.0.5",
"vitest": "^2.0.5"
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@
"consola": "^3.2.3",
"lodash-es": "catalog:"
}
}
}
2 changes: 1 addition & 1 deletion packages/docs-01-star/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"vitepress": "^1.3.0",
"vue": "^3.4.30"
}
}
}
2 changes: 1 addition & 1 deletion packages/vuepress-preset-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@
"vuepress-plugin-search-pro": "2.0.0-rc.57",
"vuepress-theme-hope": "2.0.0-rc.58"
}
}
}
22 changes: 6 additions & 16 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@
"$schema": "https://turbo.build/schema.json",
"tasks": {
"build": {
"dependsOn": [
"^build"
]
"dependsOn": ["^build"]
},
"build:docs": {
"dependsOn": [
"^build"
]
"dependsOn": ["^build"]
},
"docs:update-package": {
"dependsOn": []
Expand All @@ -18,19 +14,13 @@
"dependsOn": []
},
"clear": {
"dependsOn": [
"^clear"
]
"dependsOn": ["^clear"]
},
"//#changeset:publish": {
"dependsOn": [
"^build"
]
"dependsOn": ["^build"]
},
"//#do-publish": {
"dependsOn": [
"//#changeset:publish"
]
"dependsOn": ["//#changeset:publish"]
}
}
}
}
2 changes: 1 addition & 1 deletion utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@
"optional": true
}
}
}
}
30 changes: 7 additions & 23 deletions utils/turbo.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"extends": [
"//"
],
"extends": ["//"],
"tasks": {
"copy-readme": {
"cache": false
Expand All @@ -13,33 +11,19 @@
"cache": false
},
"generate-md": {
"dependsOn": [
"copy-readme",
"copy-changelog",
"typedoc"
]
"dependsOn": ["copy-readme", "copy-changelog", "typedoc"]
},
"docs:dev-main": {
"dependsOn": [
"build",
"generate-md"
]
"dependsOn": ["build", "generate-md"]
},
"docs:dev": {
"dependsOn": [
"docs:dev-main"
]
"dependsOn": ["docs:dev-main"]
},
"build:docs-main": {
"dependsOn": [
"build",
"generate-md"
]
"dependsOn": ["build", "generate-md"]
},
"do-build-docs": {
"dependsOn": [
"build:docs-main"
]
"dependsOn": ["build:docs-main"]
}
}
}
}
7 changes: 7 additions & 0 deletions vite-plugin-autogeneration-import-file/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@


# 自动生成的类型文件 都不参与提交
*.d.ts

# 垫片类型文件 需要提交至仓库
!vite-env.d.ts
16 changes: 16 additions & 0 deletions vite-plugin-autogeneration-import-file/app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Vue 3 + TypeScript + Vite

This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.

## Recommended IDE Setup

- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar)

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

Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can enable Volar's Take Over mode by following these steps:

1. Run `Extensions: Show Built-in Extensions` from VS Code's command palette, look for `TypeScript and JavaScript Language Features`, then right click and select `Disable (Workspace)`. By default, Take Over mode will enable itself if the default TypeScript extension is disabled.
2. Reload the VS Code window by running `Developer: Reload Window` from the command palette.

You can learn more about Take Over mode [here](https://github.com/johnsoncodehk/volar/discussions/471).
13 changes: 13 additions & 0 deletions vite-plugin-autogeneration-import-file/app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>内测 vite-plugin-autogeneration-import-file 插件</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
22 changes: 22 additions & 0 deletions vite-plugin-autogeneration-import-file/app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "@ruan-cat-test/vite-plugin-autogeneration-import-file-test-app-1",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": " vite build",
"preview": "vite preview",
"vite-plugin-autogeneration-import-file": "file:../.."
},
"dependencies": {
"vue": "^3.5.12"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.1.4",
"typescript": "catalog:",
"unplugin-vue-components": "^0.27.4",
"vite": "^5.4.9",
"vue-tsc": "^2.1.6"
}
}
1 change: 1 addition & 0 deletions vite-plugin-autogeneration-import-file/app/public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions vite-plugin-autogeneration-import-file/app/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<script setup lang="ts">
// This starter template is using Vue 3 <script setup> SFCs
// Check out https://vuejs.org/api/sfc-script-setup.html#script-setup
import test from "./resovleComponents/resolve.vue";
</script>

<template>
<div>
<input v-focus />
<a href="https://vitejs.dev" target="_blank">
<img src="/vite.svg" class="logo" alt="Vite logo" />
</a>
<a href="https://vuejs.org/" target="_blank">
<img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
</a>
</div>
<HelloWorld msg="Vite + Vue" />
<test></test>
<test-dir></test-dir>
</template>

<style scoped>
.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.vue:hover {
filter: drop-shadow(0 0 2em #42b883aa);
}
</style>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<script setup lang="ts">
import { ref } from "vue";
defineProps<{ msg: string }>();
const count = ref(0);
</script>

<template>
<h1>{{ msg }}</h1>

<div class="card">
<button type="button" @click="count++">count is {{ count }}</button>
<p>
Edit
<code>components/HelloWorld.vue</code> to test HMR
</p>
</div>

<p>
Check out
<a href="https://vuejs.org/guide/quick-start.html#local" target="_blank">create-vue</a>, the official Vue + Vite
starter
</p>
<p>
Install
<a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>
in your IDE for a better DX
</p>
<p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
</template>

<style scoped>
.read-the-docs {
color: #888;
}
</style>
5 changes: 5 additions & 0 deletions vite-plugin-autogeneration-import-file/app/src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createApp } from "vue";
import "./style.css";
import App from "./App.vue";

createApp(App).mount("#app");
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<template>test</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<template>test dir</template>
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const focus = {
mounted: (el: HTMLElement) => {
console.log(111, el);
el.focus();
},
};

export default focus;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<template>resolve</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//当前文件由vite-plugin-autogeneration-import-file自动生成
//code
81 changes: 81 additions & 0 deletions vite-plugin-autogeneration-import-file/app/src/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
:root {
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 24px;
font-weight: 400;

color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;

font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-text-size-adjust: 100%;
}

a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
}

body {
margin: 0;
display: flex;
place-items: center;
min-width: 320px;
min-height: 100vh;
}

h1 {
font-size: 3.2em;
line-height: 1.1;
}

button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
transition: border-color 0.25s;
}
button:hover {
border-color: #646cff;
}
button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}

.card {
padding: 2em;
}

#app {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}

@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
}
Loading

0 comments on commit 9498653

Please sign in to comment.