Skip to content

Commit

Permalink
refactor of linkis-web
Browse files Browse the repository at this point in the history
  • Loading branch information
CoderSerio committed Oct 23, 2023
1 parent 95f229a commit e09fcda
Show file tree
Hide file tree
Showing 193 changed files with 40,562 additions and 0 deletions.
49 changes: 49 additions & 0 deletions linkis-web-next/.commitlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"extends": [
"@commitlint/config-conventional"
],
"rules": {
"type-enum": [
2,
"always",
[
"build",
"chore",
"ci",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"style",
"test"
]
],
"type-case": [
0
],
"type-empty": [
0
],
"scope-empty": [
0
],
"scope-case": [
0
],
"subject-full-stop": [
0,
"never"
],
"subject-case": [
0,
"never"
],
"header-max-length": [
0,
"always",
72
]
}
}
5 changes: 5 additions & 0 deletions linkis-web-next/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
VITE_VUE_APP_HOST=
VITE_BACKEND_URL=
VITE_VUE_APP_MN_CONFIG_PREFIX=
VITE_VUE_APP_MN_CONFIG_SOCKET=
VITE_VUE_APP_VERSION=
2 changes: 2 additions & 0 deletions linkis-web-next/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
40 changes: 40 additions & 0 deletions linkis-web-next/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"root": true,
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:vue/vue3-essential",
"plugin:@typescript-eslint/recommended",
"airbnb-base",
"prettier"
],
"overrides": [],
"parser": "vue-eslint-parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"parser": "@typescript-eslint/parser"
},
"settings": {
"import/resolver": {
"typescript": {},
"alias": {
"map": ["@", "./src"],
"extentions": [".js", ".ts", ".vue"]
}
}
},
"plugins": ["vue", "@typescript-eslint"],
"rules": {
"indent": ["error", 4],
"linebreak-style": ["error", "unix"],
"semi": ["error", "always"],
"vue/multi-word-component-names": 0,
"quotes": ["error", "single"],
"vue/html-quotes": ["error", "double"],
"import/extensions": "off"
}
}
4 changes: 4 additions & 0 deletions linkis-web-next/.husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit $1
4 changes: 4 additions & 0 deletions linkis-web-next/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
12 changes: 12 additions & 0 deletions linkis-web-next/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"trailingComma": "all",
"tabWidth": 4,
"semi": true,
"singleQuote": true,
"overrides": [
{
"files": [".prettierrc", ".commitlintrc"],
"options": { "parser": "json" }
}
]
}
18 changes: 18 additions & 0 deletions linkis-web-next/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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) (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.
13 changes: 13 additions & 0 deletions linkis-web-next/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 + Vue + TS</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
Loading

0 comments on commit e09fcda

Please sign in to comment.