@revojs/vue 0.1.24 → 0.1.26

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.js CHANGED
@@ -1,4 +1,4 @@
1
- import { addAlias, addRoutes, useKit } from "revojs/kit";
1
+ import { addAlias, addRoutes, addTypes, useKit } from "revojs/kit";
2
2
 
3
3
  //#region src/index.ts
4
4
  function addPages(app, path) {
@@ -7,7 +7,7 @@ function addPages(app, path) {
7
7
  function vue() {
8
8
  return {
9
9
  config: { sources: { pages: {
10
- match: "**/*.vue",
10
+ match: "**/{page,layout}.vue",
11
11
  entries: ["./routes"]
12
12
  } } },
13
13
  setup(app) {
@@ -20,6 +20,7 @@ function vue() {
20
20
  addRoutes(app, fromModule("./module/routes"));
21
21
  addAlias(app, "vue/app", fromModule("./module/app.ts"));
22
22
  addAlias(app, "vue/main", fromModule("./module/main.vue"));
23
+ addTypes(app, "revojs-vue.d.ts", () => `import "@revojs/vue/types"`);
23
24
  }
24
25
  };
25
26
  }
@@ -12,10 +12,10 @@ import {
12
12
  } from "vue-router";
13
13
 
14
14
  function toRoute(path: string, node: Node<Component>, index: number): RouteRecordRaw {
15
- const layout = node.children["+layout"];
15
+ const layout = node.children["layout"];
16
16
 
17
17
  if (layout) {
18
- delete node.children["+layout"];
18
+ delete node.children["layout"];
19
19
  }
20
20
 
21
21
  const children = Object.entries(node.children).map(([path, node]) => toRoute(path, node, index + 1));
@@ -48,7 +48,7 @@ export default async (scope: Scope) => {
48
48
  const segments = path.toLowerCase().split("/");
49
49
 
50
50
  for (const attribute of segments.pop()?.split(".") ?? []) {
51
- if (attribute === "index" || attribute === "vue") {
51
+ if (attribute === "page" || attribute === "vue") {
52
52
  continue;
53
53
  }
54
54
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revojs/vue",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
4
4
  "type": "module",
5
5
  "repository": "coverbase/revojs",
6
6
  "license": "MIT",