docs: improve types

This commit is contained in:
Philipp Kühn
2021-08-26 23:40:31 +02:00
parent afd021fffa
commit e0d7b01b1c
3 changed files with 9 additions and 11 deletions

View File

@@ -20,6 +20,7 @@
"@types/prosemirror-state": "^1.2.7", "@types/prosemirror-state": "^1.2.7",
"@types/prosemirror-transform": "^1.1.4", "@types/prosemirror-transform": "^1.1.4",
"@types/prosemirror-view": "^1.17.2", "@types/prosemirror-view": "^1.17.2",
"@types/uuid": "^8.3.1",
"@vitejs/plugin-react-refresh": "^1.3.6", "@vitejs/plugin-react-refresh": "^1.3.6",
"autoprefixer": "^10.3.1", "autoprefixer": "^10.3.1",
"iframe-resizer": "^4.3.2", "iframe-resizer": "^4.3.2",

View File

@@ -1,4 +1,3 @@
// @ts-nocheck
import { import {
resolve, resolve,
basename, basename,
@@ -53,7 +52,7 @@ export default defineConfig({
{ {
name: 'raw', name: 'raw',
resolveId(id, importer) { resolveId(id, importer) {
if (id.startsWith('raw!')) { if (id.startsWith('raw!') && importer) {
const [, relativePath] = id.split('raw!') const [, relativePath] = id.split('raw!')
const fullPath = join(dirname(importer), relativePath) const fullPath = join(dirname(importer), relativePath)
@@ -103,7 +102,7 @@ export default defineConfig({
{ {
name: 'source', name: 'source',
resolveId(id, importer) { resolveId(id, importer) {
if (id === '@source') { if (id === '@source' && importer) {
return `source!${dirname(importer)}!!${uuid()}` return `source!${dirname(importer)}!!${uuid()}`
} }
}, },
@@ -163,7 +162,7 @@ export default defineConfig({
configureServer(viteDevServer) { configureServer(viteDevServer) {
return () => { return () => {
viteDevServer.middlewares.use(async (req, res, next) => { viteDevServer.middlewares.use(async (req, res, next) => {
if (req.originalUrl.startsWith('/preview')) { if (req?.originalUrl?.startsWith('/preview')) {
req.url = '/preview/index.html' req.url = '/preview/index.html'
} }
@@ -183,11 +182,4 @@ export default defineConfig({
}), }),
], ],
}, },
// server: {
// fs: {
// // Allow serving files from one level up to the project root
// allow: ['..']
// }
// }
}) })

View File

@@ -2465,6 +2465,11 @@
resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.6.tgz#250a7b16c3b91f672a24552ec64678eeb1d3a08d" resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.6.tgz#250a7b16c3b91f672a24552ec64678eeb1d3a08d"
integrity sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ== integrity sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==
"@types/uuid@^8.3.1":
version "8.3.1"
resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.1.tgz#1a32969cf8f0364b3d8c8af9cc3555b7805df14f"
integrity sha512-Y2mHTRAbqfFkpjldbkHGY8JIzRN6XqYRliG8/24FcHm2D2PwW24fl5xMRTVGdrb7iMrwCaIEbLWerGIkXuFWVg==
"@types/vfile-message@*": "@types/vfile-message@*":
version "2.0.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/@types/vfile-message/-/vfile-message-2.0.0.tgz#690e46af0fdfc1f9faae00cd049cc888957927d5" resolved "https://registry.yarnpkg.com/@types/vfile-message/-/vfile-message-2.0.0.tgz#690e46af0fdfc1f9faae00cd049cc888957927d5"