window.h = routerHistory
window.r = router
-if ('scrollRestoration' in history) {
- history.scrollRestoration = 'manual'
-}
-
const app = createApp()
app.provide('state', globalState)
app.use(RouterPlugin, router)
"@rollup/plugin-replace": "^2.3.0",
"@types/jest": "^24.9.0",
"@types/jsdom": "^12.2.4",
- "@types/webpack": "^4.41.2",
+ "@types/webpack": "^4.41.3",
"@types/webpack-env": "^1.15.0",
"@vue/compiler-sfc": "^3.0.0-alpha.2",
- "axios": "^0.19.1",
+ "axios": "^0.19.2",
"browserstack-local": "^1.4.4",
"chromedriver": "^79.0.0",
- "codecov": "^3.6.1",
+ "codecov": "^3.6.2",
"consola": "^2.11.3",
"css-loader": "^3.4.2",
"dotenv": "^8.2.0",
"ts-jest": "^24.2.0",
"ts-loader": "^6.2.1",
"ts-node": "^8.6.2",
- "typescript": "^3.7.4",
+ "typescript": "^3.7.5",
"vue": "^3.0.0-alpha.2",
"vue-loader": "^16.0.0-alpha.2",
"webpack": "^4.41.5",
}
export default function createHistory(base: string = ''): RouterHistory {
+ if ('scrollRestoration' in history) {
+ history.scrollRestoration = 'manual'
+ }
+
const historyNavigation = useHistoryStateNavigation(base)
const historyListeners = useHistoryListeners(
base,
import createHashHistory from './history/hash'
import View from './components/View'
import Link from './components/Link'
+import { RouteLocationNormalized } from './types'
-export { RouteLocationNormalized } from './types'
-export { Router } from './router'
+declare module '@vue/runtime-core' {
+ function inject(name: 'router'): Router
+ function inject(name: 'route'): RouteLocationNormalized
+}
+
+// @ts-ignore: we are not importing it so it complains
+declare module '@vue/runtime-dom' {
+ function inject(name: 'router'): Router
+ function inject(name: 'route'): RouteLocationNormalized
+}
+
+// @ts-ignore: we are not importing it so it complains
+declare module 'vue' {
+ function inject(name: 'router'): Router
+ function inject(name: 'route'): RouteLocationNormalized
+}
export function RouterPlugin(app: App, router: Router) {
// TODO: remove as any
app.provide('route', router.currentRoute)
}
-export { createHistory, createMemoryHistory, createHashHistory, createRouter }
+export {
+ createHistory,
+ createMemoryHistory,
+ createHashHistory,
+ createRouter,
+ RouteLocationNormalized,
+ Router,
+}
"@types/source-list-map" "*"
source-map "^0.6.1"
-"@types/webpack@^4.41.2":
- version "4.41.2"
- resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.41.2.tgz#c6faf0111de27afdffe1158dac559e447c273516"
- integrity sha512-DNMQOfEvwzWRRyp6Wy9QVCgJ3gkelZsuBE2KUD318dg95s9DKGiT5CszmmV58hq8jk89I9NClre48AEy1MWAJA==
+"@types/webpack@^4.41.3":
+ version "4.41.3"
+ resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.41.3.tgz#30c2251db1d69a45bbffd79c0577dd9baf50e7ba"
+ integrity sha512-dH+BZ6pHBZFrXpnif0YU/PbmUq3lQrvRPnqkxsciSIzvG/DE+Vm/Wrjn56T7V3+B5ryQa5fw0oGnHL8tk4ll6w==
dependencies:
"@types/anymatch" "*"
"@types/node" "*"
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.9.0.tgz#24390e6ad61386b0a747265754d2a17219de862c"
integrity sha512-Uvq6hVe90D0B2WEnUqtdgY1bATGz3mw33nH9Y+dmA+w5DHvUmBgkr5rM/KCHpCsiFNRUfokW/szpPPgMK2hm4A==
-axios@^0.19.1:
- version "0.19.1"
- resolved "https://registry.yarnpkg.com/axios/-/axios-0.19.1.tgz#8a6a04eed23dfe72747e1dd43c604b8f1677b5aa"
- integrity sha512-Yl+7nfreYKaLRvAvjNPkvfjnQHJM1yLBY3zhqAwcJSwR/6ETkanUgylgtIvkvz0xJ+p/vZuNw8X7Hnb7Whsbpw==
+axios@^0.19.2:
+ version "0.19.2"
+ resolved "https://registry.yarnpkg.com/axios/-/axios-0.19.2.tgz#3ea36c5d8818d0d5f8a8a97a6d36b86cdc00cb27"
+ integrity sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==
dependencies:
follow-redirects "1.5.10"
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=
-codecov@^3.6.1:
- version "3.6.1"
- resolved "https://registry.yarnpkg.com/codecov/-/codecov-3.6.1.tgz#f39fc49413445555f81f8e3ca5730992843b4517"
- integrity sha512-IUJB6WG47nWK7o50etF8jBadxdMw7DmoQg05yIljstXFBGB6clOZsIj6iD4P82T2YaIU3qq+FFu8K9pxgkCJDQ==
+codecov@^3.6.2:
+ version "3.6.2"
+ resolved "https://registry.yarnpkg.com/codecov/-/codecov-3.6.2.tgz#9503533d744233f6864f8f3ead9435d285ed3f47"
+ integrity sha512-i1VYZYY3M8Lodk/QRsIWYVimkuhl0oMSiM2itxbTbEIjB0PCSWP1cI7cscu5P0MayggoTl6I/jkXV2go8Ub8/Q==
dependencies:
argv "^0.0.2"
ignore-walk "^3.0.1"
js-yaml "^3.13.1"
teeny-request "^3.11.3"
urlgrey "^0.4.4"
+ validator "^12.1.0"
collection-visit@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
-typescript@^3.7.4:
- version "3.7.4"
- resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.4.tgz#1743a5ec5fef6a1fa9f3e4708e33c81c73876c19"
- integrity sha512-A25xv5XCtarLwXpcDNZzCGvW2D1S3/bACratYBx2sax8PefsFhlYmkQicKHvpYflFS8if4zne5zT5kpJ7pzuvw==
+typescript@^3.7.5:
+ version "3.7.5"
+ resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae"
+ integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==
uglify-js@3.4.x:
version "3.4.10"
spdx-correct "^3.0.0"
spdx-expression-parse "^3.0.0"
+validator@^12.1.0:
+ version "12.1.0"
+ resolved "https://registry.yarnpkg.com/validator/-/validator-12.1.0.tgz#a3a7315d5238cbc15e46ad8d5e479aafa7119925"
+ integrity sha512-gIC2RBuFRi574Rb9vewGCJ7TCLxHXNx6EKthEgs+Iz0pYa9a9Te1VLG/bGLsAyGWrqR5FfR7tbFUI7FEF2LiGA==
+
vary@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"