Skip to content

Commit

Permalink
feat(projects): complete generate vue router dts, imports
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed Jul 2, 2023
1 parent fe371da commit 00b750c
Show file tree
Hide file tree
Showing 97 changed files with 8,879 additions and 362 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md

This file was deleted.

3 changes: 3 additions & 0 deletions README.en_US.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# elegent-router

English | [中文](./README.md)
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# create-soybean
# elegent-router 优雅的路由

SoybeanJS 的命令行, 可以创建很多类型的项目模版
中文 | [English](./README.en_US.md)

## 介绍

## 安装

## 使用

## 注意事项
11 changes: 11 additions & 0 deletions examples/template-vue/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "soybeanjs/vue",
"overrides": [
{
"files": ["*.vue"],
"rules": {
"no-undef": "off" // use tsc to check the ts code of the vue
}
}
]
}
33 changes: 33 additions & 0 deletions examples/template-vue/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist
dist-ssr
coverage
*.local

/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
!.vscode/settings.json
!.vscode/launch.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

package-lock.json
yarn.lock
2 changes: 2 additions & 0 deletions examples/template-vue/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
registry=https://registry.npmmirror.com/
shamefully-hoist=true
27 changes: 27 additions & 0 deletions examples/template-vue/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"recommendations": [
"afzalsayed96.icones",
"antfu.iconify",
"antfu.unocss",
"christian-kohler.path-intellisense",
"dbaeumer.vscode-eslint",
"eamodio.gitlens",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"formulahendry.auto-close-tag",
"formulahendry.auto-complete-tag",
"formulahendry.auto-rename-tag",
"kisstkondoros.vscode-gutter-preview",
"lokalise.i18n-ally",
"mariusalchimavicius.json-to-ts",
"mhutchie.git-graph",
"mikestead.dotenv",
"naumovs.color-highlight",
"pkief.material-icon-theme",
"sdras.vue-vscode-snippets",
"vue.volar",
"vue.vscode-typescript-vue-plugin",
"whtouche.vscode-js-console-utils",
"zhuangtongfa.material-theme"
]
}
20 changes: 20 additions & 0 deletions examples/template-vue/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Vue debugger",
"url": "http://localhost:5173",
"webRoot": "${workspaceFolder}"
},
{
"type": "node",
"request": "launch",
"name": "TS debugger",
"skipFiles": ["<node_internals>/**"],
"runtimeArgs": ["--loader", "tsx"],
"program": "${relativeFile}"
}
]
}
74 changes: 74 additions & 0 deletions examples/template-vue/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.fontLigatures": true,
"editor.formatOnSave": false,
"editor.guides.bracketPairs": "active",
"editor.quickSuggestions": {
"strings": true
},
"editor.tabSize": 2,
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact", "vue", "json"],
"files.associations": {
"*.env.*": "dotenv"
},
"files.eol": "\n",
"git.enableSmartCommit": true,
"gutterpreview.paths": {
"@": "/src",
"~@": "/src"
},
"material-icon-theme.activeIconPack": "angular",
"material-icon-theme.files.associations": {},
"material-icon-theme.folders.associations": {
"src-tauri": "src",
"enum": "typescript",
"enums": "typescript",
"store": "context",
"stores": "context",
"composable": "hook",
"composables": "hook",
"directive": "tools",
"directives": "tools",
"business": "core",
"request": "api",
"adapter": "middleware"
},
"path-intellisense.mappings": {
"@": "${workspaceFolder}/src",
"~@": "${workspaceFolder}/src"
},
"terminal.integrated.fontSize": 14,
"terminal.integrated.fontWeight": 500,
"terminal.integrated.tabs.enabled": true,
"workbench.iconTheme": "material-icon-theme",
"workbench.colorTheme": "One Dark Pro",
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.defaultFormatter": "yzhang.markdown-all-in-one"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[vue]": {
"editor.defaultFormatter": "Vue.volar"
}
}
40 changes: 40 additions & 0 deletions examples/template-vue/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# template-vue

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

## Recommended IDE Setup

[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
```
13 changes: 13 additions & 0 deletions examples/template-vue/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" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
32 changes: 32 additions & 0 deletions examples/template-vue/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "template-vue",
"version": "0.0.1",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "run-s type-check build-only",
"preview": "vite preview",
"build-only": "vite build",
"type-check": "vue-tsc --noEmit --skipLibCheck",
"lint": "eslint . --fix"
},
"dependencies": {
"@elegent-router/vue": "workspace:*",
"pinia": "^2.1.4",
"vue": "^3.3.4",
"vue-router": "^4.2.2"
},
"devDependencies": {
"@soybeanjs/cli": "^0.6.2",
"@types/node": "^20.3.3",
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue-jsx": "^3.0.1",
"eslint": "^8.44.0",
"eslint-config-soybeanjs": "^0.4.9",
"npm-run-all": "^4.1.5",
"typescript": "5.1.6",
"vite": "^4.3.9",
"vue-tsc": "^1.8.3"
}
}
Loading

0 comments on commit 00b750c

Please sign in to comment.