@revojs/vue 0.1.35 → 0.1.37
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/client/index.d.mts +1 -1
- package/dist/module/app.ts +3 -3
- package/dist/module/routes/[...]/get.ts +3 -3
- package/package.json +13 -13
- package/src/types/index.d.ts +0 -8
- package/src/types/pages.d.ts +5 -0
package/dist/client/index.d.mts
CHANGED
|
@@ -20,7 +20,7 @@ declare function useFetch<T, TError = Error>(scope: Scope, input: string | URL,
|
|
|
20
20
|
refresh: (options?: AsyncOptions<TError> | undefined) => Promise<T | undefined>;
|
|
21
21
|
}>;
|
|
22
22
|
declare function refreshAsync(scope: Scope, input?: string | Array<string>): Promise<void[] | undefined>;
|
|
23
|
-
declare const isServerSideRendering:
|
|
23
|
+
declare const isServerSideRendering: boolean;
|
|
24
24
|
declare const REFRESH_ASYNC_HOOK: revojs.Descriptor<(names?: Array<string>) => Promise<void>>;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { AsyncOptions, REFRESH_ASYNC_HOOK, isServerSideRendering, refreshAsync, useAsync, useFetch, useScope, useState };
|
package/dist/module/app.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Main from "#alias/vue/main";
|
|
2
|
-
import
|
|
2
|
+
import { entries } from "#pages";
|
|
3
3
|
import { isServer, Radix, Scope, useUrl, type Node } from "revojs";
|
|
4
4
|
import { createApp, createSSRApp, type Component } from "vue";
|
|
5
5
|
import {
|
|
@@ -45,7 +45,7 @@ function toRoute(path: string, node: Node<Component>, index: number): RouteRecor
|
|
|
45
45
|
export default async (scope: Scope) => {
|
|
46
46
|
const radix = new Radix<Component>();
|
|
47
47
|
|
|
48
|
-
for (const path in
|
|
48
|
+
for (const path in entries) {
|
|
49
49
|
const segments = path.split("/");
|
|
50
50
|
|
|
51
51
|
for (const attribute of segments.pop()?.split(".") ?? []) {
|
|
@@ -56,7 +56,7 @@ export default async (scope: Scope) => {
|
|
|
56
56
|
segments.push(attribute);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
radix.use(segments,
|
|
59
|
+
radix.use(segments, entries[path]);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
const rootNode = toRoute("/", radix.rootNode, 0);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import createApp from "#alias/vue/app";
|
|
2
|
-
import client from "#
|
|
2
|
+
import client from "#client";
|
|
3
3
|
import { defineRoute, sendHtml, useServer } from "revojs";
|
|
4
4
|
import { renderToString } from "vue/server-renderer";
|
|
5
5
|
import { isServerSideRendering } from "../../../client";
|
|
@@ -27,8 +27,8 @@ export default defineRoute({
|
|
|
27
27
|
scope,
|
|
28
28
|
content.replace(
|
|
29
29
|
"<!-- HEAD -->",
|
|
30
|
-
"<script id='STATES' type='application/json'>" + JSON.stringify(states) + "</script>"
|
|
31
|
-
)
|
|
30
|
+
"<script id='STATES' type='application/json'>" + JSON.stringify(states) + "</script>",
|
|
31
|
+
),
|
|
32
32
|
);
|
|
33
33
|
},
|
|
34
34
|
});
|
package/package.json
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@revojs/vue",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"repository": "coverbase/revojs",
|
|
3
|
+
"version": "0.1.37",
|
|
6
4
|
"license": "MIT",
|
|
5
|
+
"repository": "coverbase/revojs",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist",
|
|
8
|
+
"src/types"
|
|
9
|
+
],
|
|
10
|
+
"type": "module",
|
|
11
|
+
"main": "./dist/index.mjs",
|
|
12
|
+
"module": "./dist/index.mjs",
|
|
13
|
+
"types": "./dist/index.d.mts",
|
|
7
14
|
"exports": {
|
|
8
15
|
".": {
|
|
9
16
|
"types": "./dist/index.d.mts",
|
|
@@ -14,24 +21,17 @@
|
|
|
14
21
|
"import": "./dist/client/index.mjs"
|
|
15
22
|
},
|
|
16
23
|
"./types": {
|
|
17
|
-
"types": "./src/types/index.d.
|
|
24
|
+
"types": "./src/types/index.d.ts"
|
|
18
25
|
}
|
|
19
26
|
},
|
|
20
|
-
"types": "./dist/index.d.mts",
|
|
21
|
-
"module": "./dist/index.mjs",
|
|
22
|
-
"main": "./dist/index.mjs",
|
|
23
|
-
"files": [
|
|
24
|
-
"dist",
|
|
25
|
-
"src/types"
|
|
26
|
-
],
|
|
27
27
|
"scripts": {
|
|
28
28
|
"build": "tsdown",
|
|
29
29
|
"watch": "tsdown -w"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
+
"revojs": "*",
|
|
32
33
|
"vue": "^3.5.27",
|
|
33
|
-
"vue-router": "^5.0.2"
|
|
34
|
-
"revojs": "*"
|
|
34
|
+
"vue-router": "^5.0.2"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@revojs/tsconfig": "*",
|
package/src/types/index.d.ts
CHANGED
|
@@ -12,14 +12,6 @@ declare module "#alias/vue/main" {
|
|
|
12
12
|
export default app;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
declare module "#virtual/pages" {
|
|
16
|
-
import type { Component } from "vue";
|
|
17
|
-
|
|
18
|
-
const pages: Record<string, Component>;
|
|
19
|
-
|
|
20
|
-
export default pages;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
15
|
declare module "*.vue" {
|
|
24
16
|
import type { DefineComponent } from "vue";
|
|
25
17
|
|