@devwaren/vanilla-ts 1.0.22 → 1.0.24
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.cjs +4 -4
- package/dist/index.js +4 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -30,14 +30,14 @@ export default function ${_.name}(DOM: HTMLElement) {
|
|
|
30
30
|
</div>
|
|
31
31
|
\`);
|
|
32
32
|
};
|
|
33
|
-
`,"utf-8")}let k=M.map(_=>{let Jt="../pages/"+t.relative(s,_.file).replace(/\\/g,"/").replace(/\.ts$/,"");return`{ path: "${_.route}", name: "${_.name}", component: () => import("${Jt}") as Promise<import("../gen/
|
|
33
|
+
`,"utf-8")}let k=M.map(_=>{let Jt="../pages/"+t.relative(s,_.file).replace(/\\/g,"/").replace(/\.ts$/,"");return`{ path: "${_.route}", name: "${_.name}", component: () => import("${Jt}") as Promise<import("../gen/tsrouter.d").Module> }`}).join(`,
|
|
34
34
|
`),Qe=`// AUTO-GENERATED ROUTER
|
|
35
35
|
import { useTSElements, useTSParams, html } from "@devwaren/vanilla-ts";
|
|
36
|
-
import type { Module, Component } from "./
|
|
36
|
+
import type { Module, Component } from "./tsrouter.d";
|
|
37
37
|
|
|
38
38
|
// -----------------------------
|
|
39
39
|
${E?`export const NotFound = async (DOM: HTMLElement) => {
|
|
40
|
-
const mod
|
|
40
|
+
const mod = await import("../pages/${t.relative(s,E.file).replace(/\\/g,"/").replace(/\\.ts$/,"")}");
|
|
41
41
|
return mod.default(DOM);
|
|
42
42
|
};`:"export const NotFound = (DOM: HTMLElement) =>\n useTSElements(DOM, html`<h1>404 - Page Not Found</h1>`);"}
|
|
43
43
|
|
|
@@ -101,7 +101,7 @@ export async function createRouter(DOM: HTMLElement) {
|
|
|
101
101
|
componentLoader = matched.route.component;
|
|
102
102
|
params = matched.params;
|
|
103
103
|
} else {
|
|
104
|
-
componentLoader = async () => ({ default: NotFound as import("../gen/
|
|
104
|
+
componentLoader = async () => ({ default: NotFound as import("../gen/tsrouter.d").Component });
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
if (push) history.pushState(null, "", url.pathname + url.search);
|
package/dist/index.js
CHANGED
|
@@ -30,14 +30,14 @@ export default function ${T.name}(DOM: HTMLElement) {
|
|
|
30
30
|
</div>
|
|
31
31
|
\`);
|
|
32
32
|
};
|
|
33
|
-
`,"utf-8")}let R=S.map(T=>{let K="../pages/"+e.relative(r,T.file).replace(/\\/g,"/").replace(/\.ts$/,"");return`{ path: "${T.route}", name: "${T.name}", component: () => import("${K}") as Promise<import("../gen/
|
|
33
|
+
`,"utf-8")}let R=S.map(T=>{let K="../pages/"+e.relative(r,T.file).replace(/\\/g,"/").replace(/\.ts$/,"");return`{ path: "${T.route}", name: "${T.name}", component: () => import("${K}") as Promise<import("../gen/tsrouter.d").Module> }`}).join(`,
|
|
34
34
|
`),Pe=`// AUTO-GENERATED ROUTER
|
|
35
35
|
import { useTSElements, useTSParams, html } from "@devwaren/vanilla-ts";
|
|
36
|
-
import type { Module, Component } from "./
|
|
36
|
+
import type { Module, Component } from "./tsrouter.d";
|
|
37
37
|
|
|
38
38
|
// -----------------------------
|
|
39
39
|
${h?`export const NotFound = async (DOM: HTMLElement) => {
|
|
40
|
-
const mod
|
|
40
|
+
const mod = await import("../pages/${e.relative(r,h.file).replace(/\\/g,"/").replace(/\\.ts$/,"")}");
|
|
41
41
|
return mod.default(DOM);
|
|
42
42
|
};`:"export const NotFound = (DOM: HTMLElement) =>\n useTSElements(DOM, html`<h1>404 - Page Not Found</h1>`);"}
|
|
43
43
|
|
|
@@ -101,7 +101,7 @@ export async function createRouter(DOM: HTMLElement) {
|
|
|
101
101
|
componentLoader = matched.route.component;
|
|
102
102
|
params = matched.params;
|
|
103
103
|
} else {
|
|
104
|
-
componentLoader = async () => ({ default: NotFound as import("../gen/
|
|
104
|
+
componentLoader = async () => ({ default: NotFound as import("../gen/tsrouter.d").Component });
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
if (push) history.pushState(null, "", url.pathname + url.search);
|