improve typescript setup

This commit is contained in:
Philipp Kühn 2021-09-17 12:43:26 +02:00
parent 2a0a365d45
commit 1a43d2992f
13 changed files with 65 additions and 55 deletions

8
demos/env.d.ts vendored
View File

@ -1,8 +0,0 @@
/// <reference types="vite/client" />
declare module '*.vue' {
import { DefineComponent } from 'vue'
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
const component: DefineComponent<{}, {}, any>
export default component
}

View File

@ -1,6 +1,5 @@
{ {
"extends": "../tsconfig.json", "extends": "../tsconfig.json",
"types": ["vite/client"],
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {
@ -12,9 +11,5 @@
}, },
"include": [ "include": [
"**/*.vue" "**/*.vue"
],
"exclude": [
"**/node_modules",
"**/dist"
] ]
} }

1
env.d.ts vendored Normal file
View File

@ -0,0 +1 @@
declare module '*.vue' {}

View File

@ -52,7 +52,6 @@
"rollup-plugin-auto-external": "^2.0.0", "rollup-plugin-auto-external": "^2.0.0",
"rollup-plugin-sourcemaps": "^0.6.3", "rollup-plugin-sourcemaps": "^0.6.3",
"rollup-plugin-typescript2": "^0.30.0", "rollup-plugin-typescript2": "^0.30.0",
"typescript": "^4.4.3", "typescript": "^4.4.3"
"vue": "^2.6.14"
} }
} }

View File

@ -20,20 +20,22 @@
"src", "src",
"dist" "dist"
], ],
"devDependencies": {
"@types/react": "^17.0.20",
"@types/react-dom": "^17.0.7",
"react": "^17.0.0",
"react-dom": "^17.0.0"
},
"peerDependencies": { "peerDependencies": {
"@tiptap/core": "^2.0.0-beta.1", "@tiptap/core": "^2.0.0-beta.1",
"react": "^17.0.1", "react": "^17.0.0",
"react-dom": "^17.0.1" "react-dom": "^17.0.0"
}, },
"dependencies": { "dependencies": {
"@tiptap/extension-bubble-menu": "^2.0.0-beta.34", "@tiptap/extension-bubble-menu": "^2.0.0-beta.34",
"@tiptap/extension-floating-menu": "^2.0.0-beta.28", "@tiptap/extension-floating-menu": "^2.0.0-beta.28",
"prosemirror-view": "^1.20.1" "prosemirror-view": "^1.20.1"
}, },
"devDependencies": {
"@types/react": "^17.0.20",
"@types/react-dom": "^17.0.7"
},
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/ueberdosis/tiptap", "url": "https://github.com/ueberdosis/tiptap",

View File

@ -1,11 +1,10 @@
{ {
"extends": "../../tsconfig", "extends": "../../tsconfig",
"compilerOptions": {
"jsx": "react",
},
"exclude": [ "exclude": [
"**/node_modules", "**/node_modules",
"**/dist", "**/dist",
"../vue-3", "../../demos",
"../vue-2",
"../vue-3"
] ]
} }

View File

@ -20,9 +20,12 @@
"src", "src",
"dist" "dist"
], ],
"devDependencies": {
"vue": "^2.6.0"
},
"peerDependencies": { "peerDependencies": {
"@tiptap/core": "^2.0.0-beta.1", "@tiptap/core": "^2.0.0-beta.1",
"vue": "^2.6.12" "vue": "^2.6.0"
}, },
"dependencies": { "dependencies": {
"@tiptap/extension-bubble-menu": "^2.0.0-beta.34", "@tiptap/extension-bubble-menu": "^2.0.0-beta.34",

View File

@ -0,0 +1,9 @@
{
"extends": "../../tsconfig",
"exclude": [
"**/node_modules",
"**/dist",
"../../demos",
"../vue-3"
]
}

View File

@ -20,15 +20,18 @@
"src", "src",
"dist" "dist"
], ],
"devDependencies": {
"vue": "^3.0.0"
},
"peerDependencies": { "peerDependencies": {
"@tiptap/core": "^2.0.0-beta.1" "@tiptap/core": "^2.0.0-beta.1",
"vue": "^3.0.0"
}, },
"dependencies": { "dependencies": {
"@tiptap/extension-bubble-menu": "^2.0.0-beta.34", "@tiptap/extension-bubble-menu": "^2.0.0-beta.34",
"@tiptap/extension-floating-menu": "^2.0.0-beta.28", "@tiptap/extension-floating-menu": "^2.0.0-beta.28",
"prosemirror-state": "^1.3.4", "prosemirror-state": "^1.3.4",
"prosemirror-view": "^1.20.1", "prosemirror-view": "^1.20.1"
"vue": "^3.0.0"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -3,5 +3,7 @@
"exclude": [ "exclude": [
"**/node_modules", "**/node_modules",
"**/dist", "**/dist",
"../../demos",
"../vue-2"
] ]
} }

3
shims/vue.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
declare module '*.vue' {
}

View File

@ -25,6 +25,9 @@
"scripthost" "scripthost"
] ]
}, },
"files": [
"./env.d.ts"
],
"include": [ "include": [
"**/*.ts", "**/*.ts",
"**/*.d.ts", "**/*.d.ts",
@ -33,7 +36,6 @@
], ],
"exclude": [ "exclude": [
"**/node_modules", "**/node_modules",
"**/dist", "**/dist"
"**/vue-2"
] ]
} }

View File

@ -1853,9 +1853,9 @@
fastq "^1.6.0" fastq "^1.6.0"
"@octokit/auth-token@^2.4.0": "@octokit/auth-token@^2.4.0":
version "2.4.5" version "2.5.0"
resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-2.4.5.tgz#568ccfb8cb46f36441fac094ce34f7a875b197f3" resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-2.5.0.tgz#27c37ea26c205f28443402477ffd261311f21e36"
integrity sha512-BpGYsPgJt05M7/L/5FoE1PiAbdxXFZkX/3kDYcsvd1v6UhlnE5e96dTDr0ezX/EFwciQxf3cNV0loipsURU+WA== integrity sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g==
dependencies: dependencies:
"@octokit/types" "^6.0.3" "@octokit/types" "^6.0.3"
@ -2068,14 +2068,14 @@
integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==
"@types/node@*", "@types/node@>= 8": "@types/node@*", "@types/node@>= 8":
version "16.9.1" version "16.9.2"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.9.1.tgz#0611b37db4246c937feef529ddcc018cf8e35708" resolved "https://registry.yarnpkg.com/@types/node/-/node-16.9.2.tgz#81f5a039d6ed1941f8cc57506c74e7c2b8fc64b9"
integrity sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g== integrity sha512-ZHty/hKoOLZvSz6BtP1g7tc7nUeJhoCf3flLjh8ZEv1vFKBWHXcnMbJMyN/pftSljNyy0kNW/UqI3DccnBnZ8w==
"@types/node@^14.14.31": "@types/node@^14.14.31":
version "14.17.16" version "14.17.17"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.16.tgz#2b9252bd4fdf0393696190cd9550901dd967c777" resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.17.tgz#4ec7b71bbcb01a4e55455b60b18b1b6a783fe31d"
integrity sha512-WiFf2izl01P1CpeY8WqFAeKWwByMueBEkND38EcN8N68qb0aDG3oIS1P5MhAX5kUdr469qRyqsY/MjanLjsFbQ== integrity sha512-niAjcewgEYvSPCZm3OaM9y6YQrL2SEPH9PymtE6fuZAvFiP6ereCcvApGl2jKTq7copTIguX3PBvfP08LN4LvQ==
"@types/normalize-package-data@^2.4.0": "@types/normalize-package-data@^2.4.0":
version "2.4.1" version "2.4.1"
@ -3180,9 +3180,9 @@ camelcase@^5.0.0, camelcase@^5.3.1:
integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==
caniuse-lite@^1.0.30001252, caniuse-lite@^1.0.30001254: caniuse-lite@^1.0.30001252, caniuse-lite@^1.0.30001254:
version "1.0.30001257" version "1.0.30001258"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001257.tgz#150aaf649a48bee531104cfeda57f92ce587f6e5" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001258.tgz#b604eed80cc54a578e4bf5a02ae3ed49f869d252"
integrity sha512-JN49KplOgHSXpIsVSF+LUyhD8PUp6xPpAXeRrrcBh4KBeP7W864jHn6RvzJgDlrReyeVjMFJL3PLpPvKIxlIHA== integrity sha512-RBByOG6xWXUp0CR2/WU2amXz3stjKpSl5J1xU49F1n2OxD//uBZO4wCKUiG+QMGf7CHGfDDcqoKriomoGVxTeA==
caseless@~0.12.0: caseless@~0.12.0:
version "0.12.0" version "0.12.0"
@ -4299,9 +4299,9 @@ ecc-jsbn@~0.1.1:
safer-buffer "^2.1.0" safer-buffer "^2.1.0"
electron-to-chromium@^1.3.830: electron-to-chromium@^1.3.830:
version "1.3.840" version "1.3.842"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.840.tgz#3f2a1df97015d9b1db5d86a4c6bd4cdb920adcbb" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.842.tgz#641e414012dded277468892c0156cb01984f4f6f"
integrity sha512-yRoUmTLDJnkIJx23xLY7GbSvnmDCq++NSuxHDQ0jiyDJ9YZBUGJcrdUqm+ZwZFzMbCciVzfem2N2AWiHJcWlbw== integrity sha512-P/nDMPIYdb2PyqCQwhTXNi5JFjX1AsDVR0y6FrHw752izJIAJ+Pn5lugqyBq4tXeRSZBMBb2ZGvRGB1djtELEQ==
emmet@^2.3.0: emmet@^2.3.0:
version "2.3.4" version "2.3.4"
@ -8190,7 +8190,7 @@ randombytes@^2.1.0:
dependencies: dependencies:
safe-buffer "^5.1.0" safe-buffer "^5.1.0"
react-dom@^17.0.2: react-dom@^17.0.0, react-dom@^17.0.2:
version "17.0.2" version "17.0.2"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23"
integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA== integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==
@ -8238,7 +8238,7 @@ react-router@5.2.1:
tiny-invariant "^1.0.2" tiny-invariant "^1.0.2"
tiny-warning "^1.0.0" tiny-warning "^1.0.0"
react@^17.0.2: react@^17.0.0, react@^17.0.2:
version "17.0.2" version "17.0.2"
resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037"
integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA== integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==
@ -8739,9 +8739,9 @@ safe-resolve@^1.0.0:
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
sass@^1.40.1: sass@^1.40.1:
version "1.41.0" version "1.41.1"
resolved "https://registry.yarnpkg.com/sass/-/sass-1.41.0.tgz#f7b41dc00336a4c03429c37b9680b86758af61d4" resolved "https://registry.yarnpkg.com/sass/-/sass-1.41.1.tgz#bca5bed2154192779c29f48fca9c644c60c38d98"
integrity sha512-wb8nT60cjo9ZZMcHzG7TzdbFtCAmHEKWrH+zAdScPb4ZxL64WQBnGdbp5nwlenW5wJPcHva1JWmVa0h6iqA5eg== integrity sha512-vIjX7izRxw3Wsiez7SX7D+j76v7tenfO18P59nonjr/nzCkZuoHuF7I/Fo0ZRZPKr88v29ivIdE9BqGDgQD/Nw==
dependencies: dependencies:
chokidar ">=3.0.0 <4.0.0" chokidar ">=3.0.0 <4.0.0"
@ -9820,9 +9820,9 @@ verror@1.10.0:
extsprintf "^1.2.0" extsprintf "^1.2.0"
vite@^2.5.7: vite@^2.5.7:
version "2.5.7" version "2.5.8"
resolved "https://registry.yarnpkg.com/vite/-/vite-2.5.7.tgz#e495be9d8bcbf9d30c7141efdccacde746ee0125" resolved "https://registry.yarnpkg.com/vite/-/vite-2.5.8.tgz#e2da21540411e91cb1c4a62e133c652a787cf116"
integrity sha512-hyUoWmRPhjN1aI+ZSBqDINKdIq7aokHE2ZXiztOg4YlmtpeQtMwMeyxv6X9YxHZmvGzg/js/eATM9Z1nwyakxg== integrity sha512-2GRsLrmMsFI0u31WTtkGbKvEIJO4I9qDltma3QiyDJEk14IzjM35OCElAFHFs2VlL7h2qX5AdHbwfEhnmwhQgw==
dependencies: dependencies:
esbuild "^0.12.17" esbuild "^0.12.17"
postcss "^8.3.6" postcss "^8.3.6"
@ -9997,7 +9997,7 @@ vue-tsc@^0.3.0:
dependencies: dependencies:
vscode-vue-languageservice "^0.27.0" vscode-vue-languageservice "^0.27.0"
vue@^2.6.14: vue@^2.6.0:
version "2.6.14" version "2.6.14"
resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.14.tgz#e51aa5250250d569a3fbad3a8a5a687d6036e235" resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.14.tgz#e51aa5250250d569a3fbad3a8a5a687d6036e235"
integrity sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ== integrity sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ==