@esmx/router-vue 3.0.0-rc.78 → 3.0.0-rc.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +10 -10
- package/dist/index.test.mjs +1 -3
- package/dist/plugin.test.mjs +2 -9
- package/dist/use.test.mjs +7 -2
- package/dist/util.test.mjs +1 -2
- package/dist/vue2.d.ts +2 -0
- package/package.json +5 -5
- package/src/index.test.ts +1 -3
- package/src/index.ts +12 -15
- package/src/plugin.test.ts +2 -9
- package/src/router-link.ts +1 -1
- package/src/use.test.ts +8 -3
- package/src/util.test.ts +1 -2
- package/src/util.ts +1 -1
- package/src/vue2.ts +3 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export type * from './vue3';
|
|
3
|
-
export { useRouter, useRoute, useProvideRouter, useLink, useRouterViewDepth, getRouterViewDepth, getRoute, getRouter } from './use';
|
|
1
|
+
export { RouterPlugin } from './plugin';
|
|
4
2
|
export { RouterLink } from './router-link';
|
|
5
3
|
export { RouterView } from './router-view';
|
|
6
|
-
export {
|
|
4
|
+
export { getRoute, getRouter, getRouterViewDepth, useLink, useProvideRouter, useRoute, useRouter, useRouterViewDepth } from './use';
|
|
5
|
+
export type * from './vue2';
|
|
6
|
+
export type * from './vue3';
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
export { RouterPlugin } from "./plugin.mjs";
|
|
2
|
+
export { RouterLink } from "./router-link.mjs";
|
|
3
|
+
export { RouterView } from "./router-view.mjs";
|
|
1
4
|
export {
|
|
2
|
-
useRouter,
|
|
3
|
-
useRoute,
|
|
4
|
-
useProvideRouter,
|
|
5
|
-
useLink,
|
|
6
|
-
useRouterViewDepth,
|
|
7
|
-
getRouterViewDepth,
|
|
8
5
|
getRoute,
|
|
9
|
-
getRouter
|
|
6
|
+
getRouter,
|
|
7
|
+
getRouterViewDepth,
|
|
8
|
+
useLink,
|
|
9
|
+
useProvideRouter,
|
|
10
|
+
useRoute,
|
|
11
|
+
useRouter,
|
|
12
|
+
useRouterViewDepth
|
|
10
13
|
} from "./use.mjs";
|
|
11
|
-
export { RouterLink } from "./router-link.mjs";
|
|
12
|
-
export { RouterView } from "./router-view.mjs";
|
|
13
|
-
export { RouterPlugin } from "./plugin.mjs";
|
package/dist/index.test.mjs
CHANGED
|
@@ -81,9 +81,7 @@ describe("index.ts - Package Entry Point", () => {
|
|
|
81
81
|
];
|
|
82
82
|
expectedExports.forEach((exportName) => {
|
|
83
83
|
expect(RouterVueModule).toHaveProperty(exportName);
|
|
84
|
-
expect(
|
|
85
|
-
RouterVueModule[exportName]
|
|
86
|
-
).toBeDefined();
|
|
84
|
+
expect(Object.hasOwn(RouterVueModule, exportName)).toBe(true);
|
|
87
85
|
});
|
|
88
86
|
});
|
|
89
87
|
it("should not export unexpected items", () => {
|
package/dist/plugin.test.mjs
CHANGED
|
@@ -354,15 +354,8 @@ describe("plugin.ts - RouterPlugin", () => {
|
|
|
354
354
|
expect(routeDescriptor).toBeDefined();
|
|
355
355
|
expect(typeof (routerDescriptor == null ? void 0 : routerDescriptor.get)).toBe("function");
|
|
356
356
|
expect(typeof (routeDescriptor == null ? void 0 : routeDescriptor.get)).toBe("function");
|
|
357
|
-
expect(
|
|
358
|
-
|
|
359
|
-
globalProperties,
|
|
360
|
-
"$router"
|
|
361
|
-
)
|
|
362
|
-
).toBe(true);
|
|
363
|
-
expect(
|
|
364
|
-
Object.prototype.hasOwnProperty.call(globalProperties, "$route")
|
|
365
|
-
).toBe(true);
|
|
357
|
+
expect(Object.hasOwn(globalProperties, "$router")).toBe(true);
|
|
358
|
+
expect(Object.hasOwn(globalProperties, "$route")).toBe(true);
|
|
366
359
|
});
|
|
367
360
|
it("should provide correct component types", () => {
|
|
368
361
|
app = createApp({
|
package/dist/use.test.mjs
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { Router, RouterMode } from "@esmx/router";
|
|
2
2
|
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
createApp,
|
|
5
|
+
defineComponent,
|
|
6
|
+
getCurrentInstance,
|
|
7
|
+
h,
|
|
8
|
+
nextTick
|
|
9
|
+
} from "vue";
|
|
5
10
|
import { RouterView } from "./router-view.mjs";
|
|
6
11
|
import {
|
|
7
12
|
getRouterViewDepth,
|
package/dist/util.test.mjs
CHANGED
|
@@ -2,8 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
5
|
-
import { computed, nextTick, ref } from "vue";
|
|
6
|
-
import { version } from "vue";
|
|
5
|
+
import { computed, nextTick, ref, version } from "vue";
|
|
7
6
|
import {
|
|
8
7
|
createDependentProxy,
|
|
9
8
|
createSymbolProperty,
|
package/dist/vue2.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Route, Router } from '@esmx/router';
|
|
2
|
+
import type Vue from 'vue2';
|
|
2
3
|
declare module 'vue/types/vue' {
|
|
3
4
|
interface Vue {
|
|
4
5
|
readonly $router: Router;
|
|
@@ -11,3 +12,4 @@ declare module 'vue2/types/vue' {
|
|
|
11
12
|
readonly $route: Route;
|
|
12
13
|
}
|
|
13
14
|
}
|
|
15
|
+
export type { Vue };
|
package/package.json
CHANGED
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
"vue": "^3.5.0 || ^2.7.0"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@esmx/router": "3.0.0-rc.
|
|
53
|
+
"@esmx/router": "3.0.0-rc.79"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@biomejs/biome": "
|
|
57
|
-
"@types/node": "^24.
|
|
56
|
+
"@biomejs/biome": "2.3.7",
|
|
57
|
+
"@types/node": "^24.0.0",
|
|
58
58
|
"@vitest/coverage-v8": "3.2.4",
|
|
59
59
|
"typescript": "5.9.3",
|
|
60
60
|
"unbuild": "3.6.1",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"vue": "3.5.23",
|
|
63
63
|
"vue2": "npm:vue@2.7.16"
|
|
64
64
|
},
|
|
65
|
-
"version": "3.0.0-rc.
|
|
65
|
+
"version": "3.0.0-rc.79",
|
|
66
66
|
"type": "module",
|
|
67
67
|
"private": false,
|
|
68
68
|
"exports": {
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"template",
|
|
82
82
|
"public"
|
|
83
83
|
],
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "29c95da5062140daffe10ba135ba66bae6e65fc6"
|
|
85
85
|
}
|
package/src/index.test.ts
CHANGED
|
@@ -97,9 +97,7 @@ describe('index.ts - Package Entry Point', () => {
|
|
|
97
97
|
|
|
98
98
|
expectedExports.forEach((exportName) => {
|
|
99
99
|
expect(RouterVueModule).toHaveProperty(exportName);
|
|
100
|
-
expect(
|
|
101
|
-
RouterVueModule[exportName as keyof typeof RouterVueModule]
|
|
102
|
-
).toBeDefined();
|
|
100
|
+
expect(Object.hasOwn(RouterVueModule, exportName)).toBe(true);
|
|
103
101
|
});
|
|
104
102
|
});
|
|
105
103
|
|
package/src/index.ts
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
|
|
1
|
+
export { RouterPlugin } from './plugin';
|
|
2
|
+
export { RouterLink } from './router-link';
|
|
3
|
+
export { RouterView } from './router-view';
|
|
4
4
|
export {
|
|
5
|
-
useRouter,
|
|
6
|
-
useRoute,
|
|
7
|
-
useProvideRouter,
|
|
8
|
-
useLink,
|
|
9
|
-
useRouterViewDepth,
|
|
10
|
-
getRouterViewDepth,
|
|
11
5
|
getRoute,
|
|
12
|
-
getRouter
|
|
6
|
+
getRouter,
|
|
7
|
+
getRouterViewDepth,
|
|
8
|
+
useLink,
|
|
9
|
+
useProvideRouter,
|
|
10
|
+
useRoute,
|
|
11
|
+
useRouter,
|
|
12
|
+
useRouterViewDepth
|
|
13
13
|
} from './use';
|
|
14
|
-
|
|
15
|
-
export
|
|
16
|
-
export { RouterView } from './router-view';
|
|
17
|
-
|
|
18
|
-
export { RouterPlugin } from './plugin';
|
|
14
|
+
export type * from './vue2';
|
|
15
|
+
export type * from './vue3';
|
package/src/plugin.test.ts
CHANGED
|
@@ -446,15 +446,8 @@ describe('plugin.ts - RouterPlugin', () => {
|
|
|
446
446
|
expect(typeof routeDescriptor?.get).toBe('function');
|
|
447
447
|
|
|
448
448
|
// Verify properties exist in global properties
|
|
449
|
-
expect(
|
|
450
|
-
|
|
451
|
-
globalProperties,
|
|
452
|
-
'$router'
|
|
453
|
-
)
|
|
454
|
-
).toBe(true);
|
|
455
|
-
expect(
|
|
456
|
-
Object.prototype.hasOwnProperty.call(globalProperties, '$route')
|
|
457
|
-
).toBe(true);
|
|
449
|
+
expect(Object.hasOwn(globalProperties, '$router')).toBe(true);
|
|
450
|
+
expect(Object.hasOwn(globalProperties, '$route')).toBe(true);
|
|
458
451
|
});
|
|
459
452
|
|
|
460
453
|
it('should provide correct component types', () => {
|
package/src/router-link.ts
CHANGED
package/src/use.test.ts
CHANGED
|
@@ -2,9 +2,14 @@ import { type Route, Router, RouterMode } from '@esmx/router';
|
|
|
2
2
|
/**
|
|
3
3
|
* @vitest-environment happy-dom
|
|
4
4
|
*/
|
|
5
|
-
import { afterEach, beforeEach, describe, expect, it
|
|
6
|
-
import {
|
|
7
|
-
|
|
5
|
+
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
|
6
|
+
import {
|
|
7
|
+
createApp,
|
|
8
|
+
defineComponent,
|
|
9
|
+
getCurrentInstance,
|
|
10
|
+
h,
|
|
11
|
+
nextTick
|
|
12
|
+
} from 'vue';
|
|
8
13
|
import { RouterView } from './router-view';
|
|
9
14
|
import {
|
|
10
15
|
getRouterViewDepth,
|
package/src/util.test.ts
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
* @vitest-environment happy-dom
|
|
3
3
|
*/
|
|
4
4
|
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
5
|
-
import { computed, nextTick, ref } from 'vue';
|
|
6
|
-
import { version } from 'vue';
|
|
5
|
+
import { computed, nextTick, ref, version } from 'vue';
|
|
7
6
|
import {
|
|
8
7
|
createDependentProxy,
|
|
9
8
|
createSymbolProperty,
|
package/src/util.ts
CHANGED
package/src/vue2.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Route, Router } from '@esmx/router';
|
|
2
2
|
import type Vue from 'vue2';
|
|
3
3
|
|
|
4
|
-
// @ts-
|
|
4
|
+
// @ts-expect-error
|
|
5
5
|
declare module 'vue/types/vue' {
|
|
6
6
|
interface Vue {
|
|
7
7
|
readonly $router: Router;
|
|
@@ -14,3 +14,5 @@ declare module 'vue2/types/vue' {
|
|
|
14
14
|
readonly $route: Route;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
+
|
|
18
|
+
export type { Vue };
|