Skip to content

Commit

Permalink
feat: add typescript support
Browse files Browse the repository at this point in the history
  • Loading branch information
zyronon committed Apr 5, 2024
1 parent 83d6872 commit 906a572
Show file tree
Hide file tree
Showing 58 changed files with 4,263 additions and 3,598 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ module.exports = {
rules: {
'vue/multi-word-component-names': 0
},
'ignorePatterns': ['vite.config.js', 'mobile-select.js']
'ignorePatterns': ['vite.config.ts', 'mobile-select.js']
};
31 changes: 18 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
.DS_Store
node_modules
/dist


# local env files
.env.local
.env.*.local

# Log files
# 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
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
/php_backend
report.html

*.tsbuildinfo
18 changes: 18 additions & 0 deletions env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/// <reference types="vite/client" />

declare global {
interface Navigator {
control: any
webkitGetUserMedia: any
mozGetUserMedia: any
getUserMedia: any
}
}

declare module '*.vue' {
import type { DefineComponent } from 'vue'
const component: DefineComponent<{}, {}, any>
export default component
}

export {}
20 changes: 10 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
<!-- integrity="sha512-KkkY/3auRhaXDFzFMpwtZ+BrS8EBQ+GfiBxdJ9jGMi6Gg74/sYbq/IZpY593pkNjTmbeRfBwjpZo+7gcpH45Ww=="-->
<!-- src="https://lib.baomitu.com/eruda/3.0.1/eruda.min.js"></script>-->
<!-- <script>eruda.init();</script>-->
<!-- <script>-->
<!-- var _hmt = _hmt || []-->
<!-- ;(function () {-->
<!-- var hm = document.createElement('script')-->
<!-- hm.src = 'https://hm.baidu.com/hm.js?6f910830f5a7d8b5f7e75d8d67458a7a'-->
<!-- var s = document.getElementsByTagName('script')[0]-->
<!-- s.parentNode.insertBefore(hm, s)-->
<!-- })()-->
<!-- </script>-->
<!-- <script>-->
<!-- var _hmt = _hmt || []-->
<!-- ;(function () {-->
<!-- var hm = document.createElement('script')-->
<!-- hm.src = 'https://hm.baidu.com/hm.js?6f910830f5a7d8b5f7e75d8d67458a7a'-->
<!-- var s = document.getElementsByTagName('script')[0]-->
<!-- s.parentNode.insertBefore(hm, s)-->
<!-- })()-->
<!-- </script>-->
<style>
::-webkit-scrollbar {
display: none; /* Chrome Safari */
Expand Down Expand Up @@ -58,6 +58,6 @@
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
22 changes: 16 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"name": "my-vue-app",
"version": "0.0.0",
"name": "douyin-vue",
"version": "1.1.0",
"private": true,
"scripts": {
"dev": "vite --host",
"start": "vite --host",
"serve": "vite --host",
"build": "vite build --mode prod",
"build-uni-app": "vite build --mode uni",
"build-only": "vite build",
"buildp-check": "run-p type-check \"build-only {@}\" --",
"type-check": "vue-tsc --build --force",
"report": "vite build",
"preview": "vite preview",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore",
Expand All @@ -16,7 +20,7 @@
},
"dependencies": {
"@jambonn/vue-lazyload": "1.0.9",
"axios": "1.6.0",
"axios": "^1.6.8",
"axios-mock-adapter": "^1.22.0",
"core-js": "3.21.1",
"dayjs": "1.11.0",
Expand All @@ -34,13 +38,16 @@
"@commitlint/cli": "^19.2.1",
"@commitlint/config-conventional": "^19.1.0",
"@iconify/vue": "^4.1.1",
"@rollup/plugin-commonjs": "^25.0.7",
"@rushstack/eslint-patch": "^1.3.3",
"@tsconfig/node20": "^20.1.2",
"@types/jquery": "3.5.29",
"@types/lodash-es": "^4.17.9",
"@types/node": "^20.11.28",
"@vitejs/plugin-vue": "4.0.0",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"@vue/eslint-config-prettier": "^8.0.0",
"@vue/eslint-config-typescript": "^12.0.0",
"@vue/tsconfig": "^0.5.1",
"commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.57.0",
Expand All @@ -50,9 +57,12 @@
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"rollup-plugin-visualizer": "^5.9.2",
"typescript": "~5.4.0",
"unplugin-vue-define-options": "^1.4.1",
"vite": "4.5.3",
"vite-plugin-cdn-import": "0.3.5"
"vite": "^5.1.6",
"vite-plugin-cdn-import": "0.3.5",
"vite-plugin-commonjs": "^0.10.1",
"vue-tsc": "^2.0.6"
},
"lint-staged": {
"*.{js,ts,vue,jsx,tsx}": [
Expand Down
Loading

0 comments on commit 906a572

Please sign in to comment.