@adonisjs/inertia 1.0.0-3 → 1.0.0-30

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.
Files changed (49) hide show
  1. package/README.md +3 -3
  2. package/build/app.css.stub +39 -0
  3. package/build/{chunk-GDULL3NT.js → chunk-QKSM72AR.js} +84 -6
  4. package/build/{stubs/config.stub → config.stub} +10 -2
  5. package/build/index.d.ts +6 -4
  6. package/build/index.js +212 -36
  7. package/build/providers/inertia_provider.d.ts +15 -1
  8. package/build/providers/inertia_provider.js +29 -16
  9. package/build/react/app.tsx.stub +38 -0
  10. package/build/react/errors/not_found.tsx.stub +14 -0
  11. package/build/react/errors/server_error.tsx.stub +14 -0
  12. package/build/react/home.tsx.stub +21 -0
  13. package/build/react/root.edge.stub +22 -0
  14. package/build/react/ssr.tsx.stub +17 -0
  15. package/build/react/tsconfig.json.stub +15 -0
  16. package/build/solid/app.tsx.stub +38 -0
  17. package/build/solid/errors/not_found.tsx.stub +14 -0
  18. package/build/solid/errors/server_error.tsx.stub +14 -0
  19. package/build/solid/home.tsx.stub +18 -0
  20. package/build/solid/root.edge.stub +21 -0
  21. package/build/solid/ssr.tsx.stub +19 -0
  22. package/build/solid/tsconfig.json.stub +16 -0
  23. package/build/src/helpers.d.ts +12 -0
  24. package/build/src/helpers.js +14 -0
  25. package/build/src/inertia_middleware.d.ts +6 -43
  26. package/build/src/inertia_middleware.js +1 -1
  27. package/build/src/plugins/edge/plugin.d.ts +8 -0
  28. package/build/src/plugins/{api_client.d.ts → japa/api_client.d.ts} +3 -1
  29. package/build/src/plugins/{api_client.js → japa/api_client.js} +1 -1
  30. package/build/src/plugins/vite.d.ts +26 -0
  31. package/build/src/plugins/vite.js +36 -0
  32. package/build/src/types.d.ts +5 -69
  33. package/build/svelte/app.ts.stub +33 -0
  34. package/build/svelte/errors/not_found.svelte.stub +10 -0
  35. package/build/svelte/errors/server_error.svelte.stub +14 -0
  36. package/build/svelte/home.svelte.stub +19 -0
  37. package/build/svelte/root.edge.stub +21 -0
  38. package/build/svelte/ssr.ts.stub +15 -0
  39. package/build/svelte/tsconfig.json.stub +14 -0
  40. package/build/types-fb05P61I.d.ts +203 -0
  41. package/build/vue/app.ts.stub +41 -0
  42. package/build/vue/errors/not_found.vue.stub +10 -0
  43. package/build/vue/errors/server_error.vue.stub +14 -0
  44. package/build/vue/home.vue.stub +21 -0
  45. package/build/vue/root.edge.stub +21 -0
  46. package/build/vue/ssr.ts.stub +22 -0
  47. package/build/vue/tsconfig.json.stub +16 -0
  48. package/package.json +65 -53
  49. /package/build/{plugin-QOPSYJCV.js → src/plugins/edge/plugin.js} +0 -0
@@ -0,0 +1,14 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/pages/errors/not_found.tsx') })
3
+ }}}
4
+ export default function NotFound() {
5
+ return (
6
+ <>
7
+ <div className="container">
8
+ <div className="title">Page not found</div>
9
+
10
+ <span>This page does not exist.</span>
11
+ </div>
12
+ </>
13
+ )
14
+ }
@@ -0,0 +1,14 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/pages/errors/server_error.tsx') })
3
+ }}}
4
+ export default function ServerError(props: { error: any }) {
5
+ return (
6
+ <>
7
+ <div className="container">
8
+ <div className="title">Server Error</div>
9
+
10
+ <span>{props.error.message}</span>
11
+ </div>
12
+ </>
13
+ )
14
+ }
@@ -0,0 +1,21 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/pages/home.tsx') })
3
+ }}}
4
+ import { Head } from '@inertiajs/react'
5
+
6
+ export default function Home(props: { version: number }) {
7
+ return (
8
+ <>
9
+ <Head title="Homepage" />
10
+
11
+ <div className="container">
12
+ <div className="title">AdonisJS {props.version} x Inertia x React</div>
13
+
14
+ <span>
15
+ Learn more about AdonisJS and Inertia.js by visiting the{' '}
16
+ <a href="https://docs.adonisjs.com/guides/inertia">AdonisJS documentation</a>.
17
+ </span>
18
+ </div>
19
+ </>
20
+ )
21
+ }
@@ -0,0 +1,22 @@
1
+ {{{
2
+ exports({ to: app.makePath('resources/views/inertia_layout.edge') })
3
+ }}}
4
+ <!DOCTYPE html>
5
+ <html>
6
+
7
+ <head>
8
+ <meta charset="utf-8">
9
+ <meta name="viewport" content="width=device-width, initial-scale=1">
10
+
11
+ <title inertia>AdonisJS x Inertia x React</title>
12
+
13
+ @viteReactRefresh()
14
+ @inertiaHead()
15
+ {{ "@vite(['inertia/app/app.tsx', `inertia/pages/${page.component}.tsx`])" }}
16
+ </head>
17
+
18
+ <body>
19
+ @inertia()
20
+ </body>
21
+
22
+ </html>
@@ -0,0 +1,17 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/app/ssr.tsx') })
3
+ }}}
4
+ import ReactDOMServer from 'react-dom/server'
5
+ import { createInertiaApp } from '@inertiajs/react'
6
+
7
+ export default function render(page: any) {
8
+ return createInertiaApp({
9
+ page,
10
+ render: ReactDOMServer.renderToString,
11
+ resolve: (name) => {
12
+ const pages = import.meta.glob('../pages/**/*.tsx', { eager: true })
13
+ {{ 'return pages[`../pages/${name}.tsx`]' }}
14
+ },
15
+ setup: ({ App, props }) => <App {...props} />,
16
+ })
17
+ }
@@ -0,0 +1,15 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/tsconfig.json') })
3
+ }}}
4
+ {
5
+ "extends": "@adonisjs/tsconfig/tsconfig.client.json",
6
+ "compilerOptions": {
7
+ "baseUrl": ".",
8
+ "module": "ESNext",
9
+ "jsx": "react-jsx",
10
+ "paths": {
11
+ "~/*": ["./*"],
12
+ },
13
+ },
14
+ "include": ["./**/*.ts", "./**/*.tsx"],
15
+ }
@@ -0,0 +1,38 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/app/app.tsx') })
3
+ }}}
4
+ /// <reference path="../../adonisrc.ts" />
5
+ /// <reference path="../../config/inertia.ts" />
6
+
7
+ import '../css/app.css'
8
+
9
+ {{#if ssr}}
10
+ import { hydrate } from 'solid-js/web';
11
+ {{#else}}
12
+ import { render } from 'solid-js/web'
13
+ {{/if}}
14
+ import { createInertiaApp } from 'inertia-adapter-solid'
15
+ import { resolvePageComponent } from '@adonisjs/inertia/helpers'
16
+
17
+ const appName = import.meta.env.VITE_APP_NAME || 'AdonisJS'
18
+
19
+ createInertiaApp({
20
+ progress: { color: '#5468FF' },
21
+
22
+ title: (title) => {{ '`${title} - ${appName}`' }},
23
+
24
+ resolve: (name) => {
25
+ return resolvePageComponent(
26
+ {{ '`../pages/${name}.tsx`' }},
27
+ import.meta.glob('../pages/**/*.tsx'),
28
+ )
29
+ },
30
+
31
+ setup({ el, App, props }) {
32
+ {{#if ssr}}
33
+ hydrate(() => <App {...props} />, el)
34
+ {{#else}}
35
+ render(() => <App {...props} />, el)
36
+ {{/if}}
37
+ },
38
+ })
@@ -0,0 +1,14 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/pages/errors/not_found.tsx') })
3
+ }}}
4
+ export default function NotFound() {
5
+ return (
6
+ <>
7
+ <div class="container">
8
+ <div class="title">Page not found</div>
9
+
10
+ <span>This page does not exist.</span>
11
+ </div>
12
+ </>
13
+ )
14
+ }
@@ -0,0 +1,14 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/pages/errors/server_error.tsx') })
3
+ }}}
4
+ export default function ServerError(props: { error: any }) {
5
+ return (
6
+ <>
7
+ <div class="container">
8
+ <div class="title">Server Error</div>
9
+
10
+ <span>{props.error.message}</span>
11
+ </div>
12
+ </>
13
+ )
14
+ }
@@ -0,0 +1,18 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/pages/home.tsx') })
3
+ }}}
4
+
5
+ export default function Home(props: { version: number }) {
6
+ return (
7
+ <>
8
+ <div class="container">
9
+ <div class="title">AdonisJS {props.version} x Inertia x Solid.js</div>
10
+
11
+ <span>
12
+ Learn more about AdonisJS and Inertia.js by visiting the{' '}
13
+ <a href="https://docs.adonisjs.com/guides/inertia">AdonisJS documentation</a>.
14
+ </span>
15
+ </div>
16
+ </>
17
+ )
18
+ }
@@ -0,0 +1,21 @@
1
+ {{{
2
+ exports({ to: app.makePath('resources/views/inertia_layout.edge') })
3
+ }}}
4
+ <!DOCTYPE html>
5
+ <html>
6
+
7
+ <head>
8
+ <meta charset="utf-8">
9
+ <meta name="viewport" content="width=device-width, initial-scale=1">
10
+
11
+ <title inertia>AdonisJS x Inertia x SolidJS</title>
12
+
13
+ @inertiaHead()
14
+ {{ "@vite(['inertia/app/app.tsx', `inertia/pages/${page.component}.tsx`])" }}
15
+ </head>
16
+
17
+ <body>
18
+ @inertia()
19
+ </body>
20
+
21
+ </html>
@@ -0,0 +1,19 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/app/ssr.tsx') })
3
+ }}}
4
+
5
+ import { hydrate } from 'solid-js/web'
6
+ import { createInertiaApp } from 'inertia-adapter-solid'
7
+
8
+ export default function render(page: any) {
9
+ return createInertiaApp({
10
+ page,
11
+ resolve: (name) => {
12
+ const pages = import.meta.glob('../pages/**/*.tsx', { eager: true })
13
+ {{ 'return pages[`../pages/${name}.tsx`]' }}
14
+ },
15
+ setup({ el, App, props }) {
16
+ hydrate(() => <App {...props} />, el)
17
+ },
18
+ })
19
+ }
@@ -0,0 +1,16 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/tsconfig.json') })
3
+ }}}
4
+ {
5
+ "extends": "@adonisjs/tsconfig/tsconfig.client.json",
6
+ "compilerOptions": {
7
+ "baseUrl": ".",
8
+ "jsx": "preserve",
9
+ "module": "ESNext",
10
+ "jsxImportSource": "solid-js",
11
+ "paths": {
12
+ "~/*": ["./*"],
13
+ },
14
+ },
15
+ "include": ["./**/*.ts", "./**/*.tsx"],
16
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Utility function to resolve a page component
3
+ *
4
+ * @example
5
+ * return resolvePageComponent(
6
+ * `./pages/${name}.vue`,
7
+ * import.meta.glob<DefineComponent>("./pages/**\/*.vue")
8
+ * )
9
+ */
10
+ declare function resolvePageComponent<T>(path: string | string[], pages: Record<string, Promise<T> | (() => Promise<T>)>): Promise<T>;
11
+
12
+ export { resolvePageComponent };
@@ -0,0 +1,14 @@
1
+ // src/helpers.ts
2
+ async function resolvePageComponent(path, pages) {
3
+ for (const p of Array.isArray(path) ? path : [path]) {
4
+ const page = pages[p];
5
+ if (typeof page === "undefined") {
6
+ continue;
7
+ }
8
+ return typeof page === "function" ? page() : page;
9
+ }
10
+ throw new Error(`Page not found: ${path}`);
11
+ }
12
+ export {
13
+ resolvePageComponent
14
+ };
@@ -1,47 +1,9 @@
1
+ import { Vite } from '@adonisjs/vite';
1
2
  import { HttpContext } from '@adonisjs/core/http';
2
3
  import { NextFn } from '@adonisjs/core/types/http';
3
- import { ResolvedConfig, PageProps, MaybePromise } from './types.js';
4
-
5
- /**
6
- * Symbol used to identify lazy props
7
- */
8
- declare const kLazySymbol: unique symbol;
9
- /**
10
- * Main class used to interact with Inertia
11
- */
12
- declare class Inertia {
13
- #private;
14
- protected ctx: HttpContext;
15
- protected config: ResolvedConfig;
16
- constructor(ctx: HttpContext, config: ResolvedConfig);
17
- /**
18
- * Render a page using Inertia
19
- */
20
- render<TPageProps extends Record<string, any> = PageProps, TViewProps extends Record<string, any> = PageProps>(component: string, pageProps?: TPageProps, viewProps?: TViewProps): Promise<string | {
21
- component: string;
22
- version: string | number;
23
- props: any;
24
- url: string;
25
- }>;
26
- /**
27
- * Create a lazy prop
28
- *
29
- * Lazy props are never resolved on first visit, but only when the client
30
- * request a partial reload explicitely with this value.
31
- *
32
- * See https://inertiajs.com/partial-reloads#lazy-data-evaluation
33
- */
34
- lazy(callback: () => MaybePromise<any>): {
35
- [kLazySymbol]: () => MaybePromise<any>;
36
- };
37
- /**
38
- * This method can be used to redirect the user to an external website
39
- * or even a non-inertia route of your application.
40
- *
41
- * See https://inertiajs.com/redirects#external-redirects
42
- */
43
- location(url: string): Promise<void>;
44
- }
4
+ import { a as Inertia, R as ResolvedConfig } from '../types-fb05P61I.js';
5
+ import '@adonisjs/core/types';
6
+ import '@tuyau/utils/types';
45
7
 
46
8
  /**
47
9
  * HttpContext augmentations
@@ -57,7 +19,8 @@ declare module '@adonisjs/core/http' {
57
19
  */
58
20
  declare class InertiaMiddleware {
59
21
  protected config: ResolvedConfig;
60
- constructor(config: ResolvedConfig);
22
+ protected vite?: Vite | undefined;
23
+ constructor(config: ResolvedConfig, vite?: Vite | undefined);
61
24
  handle(ctx: HttpContext, next: NextFn): Promise<void>;
62
25
  }
63
26
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  InertiaMiddleware
3
- } from "../chunk-GDULL3NT.js";
3
+ } from "../chunk-QKSM72AR.js";
4
4
  export {
5
5
  InertiaMiddleware as default
6
6
  };
@@ -0,0 +1,8 @@
1
+ import { PluginFn } from 'edge.js/types';
2
+
3
+ /**
4
+ * Register the Inertia tags and globals within Edge
5
+ */
6
+ declare const edgePluginInertia: () => PluginFn<undefined>;
7
+
8
+ export { edgePluginInertia };
@@ -1,7 +1,9 @@
1
1
  import { PluginFn } from '@japa/runner/types';
2
- import { PageProps } from '../types.js';
3
2
  import { ApplicationService } from '@adonisjs/core/types';
3
+ import { P as PageProps } from '../../../types-fb05P61I.js';
4
4
  import '@adonisjs/core/http';
5
+ import '@tuyau/utils/types';
6
+ import '@adonisjs/vite';
5
7
 
6
8
  declare module '@japa/api-client' {
7
9
  interface ApiRequest {
@@ -1,4 +1,4 @@
1
- // src/plugins/api_client.ts
1
+ // src/plugins/japa/api_client.ts
2
2
  import { configProvider } from "@adonisjs/core";
3
3
  import { RuntimeException } from "@poppinss/utils";
4
4
  import { ApiRequest, ApiResponse } from "@japa/api-client";
@@ -0,0 +1,26 @@
1
+ import { PluginOption } from 'vite';
2
+
3
+ type InertiaPluginOptions = {
4
+ ssr?: {
5
+ /**
6
+ * Whether or not to enable server-side rendering
7
+ */
8
+ enabled: true;
9
+ /**
10
+ * The entrypoint for the server-side rendering
11
+ */
12
+ entrypoint: string;
13
+ /**
14
+ * The output directory for the server-side rendering bundle
15
+ */
16
+ output?: string;
17
+ } | {
18
+ enabled: false;
19
+ };
20
+ };
21
+ /**
22
+ * Inertia plugin for Vite that is tailored for AdonisJS
23
+ */
24
+ declare function inertia(options?: InertiaPluginOptions): PluginOption;
25
+
26
+ export { type InertiaPluginOptions, inertia as default };
@@ -0,0 +1,36 @@
1
+ // src/plugins/vite.ts
2
+ function inertia(options) {
3
+ return {
4
+ name: "vite-plugin-inertia",
5
+ config: (_, { command }) => {
6
+ if (!options?.ssr?.enabled)
7
+ return {};
8
+ if (command === "build") {
9
+ process.env.NODE_ENV = "production";
10
+ }
11
+ return {
12
+ buildSteps: [
13
+ {
14
+ name: "build-client",
15
+ description: "build inertia client bundle",
16
+ config: { build: { outDir: "build/public/assets/" } }
17
+ },
18
+ {
19
+ name: "build-ssr",
20
+ description: "build inertia server bundle",
21
+ config: {
22
+ build: {
23
+ ssr: true,
24
+ outDir: options.ssr.output || "build/ssr",
25
+ rollupOptions: { input: options.ssr.entrypoint }
26
+ }
27
+ }
28
+ }
29
+ ]
30
+ };
31
+ }
32
+ };
33
+ }
34
+ export {
35
+ inertia as default
36
+ };
@@ -1,69 +1,5 @@
1
- import { HttpContext } from '@adonisjs/core/http';
2
-
3
- /**
4
- * VersionCache is used to cache the version of the assets.
5
- *
6
- * If the user has provided a version, it will be used.
7
- * Otherwise, we will compute a hash from the manifest file
8
- * and cache it.
9
- */
10
- declare class VersionCache {
11
- #private;
12
- protected appRoot: URL;
13
- protected assetsVersion?: AssetsVersion;
14
- constructor(appRoot: URL, assetsVersion?: AssetsVersion);
15
- /**
16
- * Pre-compute the version
17
- */
18
- computeVersion(): Promise<this>;
19
- /**
20
- * Returns the current assets version
21
- */
22
- getVersion(): string | number;
23
- /**
24
- * Set the assets version
25
- */
26
- setVersion(version: AssetsVersion): Promise<void>;
27
- }
28
-
29
- type MaybePromise<T> = T | Promise<T>;
30
- /**
31
- * Props that will be passed to inertia render method
32
- */
33
- type PageProps = Record<string, unknown>;
34
- /**
35
- * Shared data types
36
- */
37
- type Data = string | number | object | boolean;
38
- type SharedDatumFactory = (ctx: HttpContext) => MaybePromise<Data>;
39
- type SharedData = Record<string, Data | SharedDatumFactory>;
40
- /**
41
- * Allowed values for the assets version
42
- */
43
- type AssetsVersion = string | number | undefined;
44
- interface InertiaConfig {
45
- /**
46
- * Path to the Edge view that will be used as the root view for Inertia responses.
47
- * @default root (resources/views/root.edge)
48
- */
49
- rootView?: string;
50
- /**
51
- * The version of your assets. Every client request will be checked against this version.
52
- * If the version is not the same, the client will do a full reload.
53
- */
54
- assetsVersion?: AssetsVersion;
55
- /**
56
- * Data that should be shared with all rendered pages
57
- */
58
- sharedData?: SharedData;
59
- }
60
- /**
61
- * Resolved inertia configuration
62
- */
63
- interface ResolvedConfig {
64
- rootView: string;
65
- versionCache: VersionCache;
66
- sharedData: SharedData;
67
- }
68
-
69
- export type { AssetsVersion, Data, InertiaConfig, MaybePromise, PageProps, ResolvedConfig, SharedData, SharedDatumFactory };
1
+ import '@adonisjs/core/types';
2
+ import '@adonisjs/core/http';
3
+ import '@tuyau/utils/types';
4
+ export { A as AssetsVersion, D as Data, I as InertiaConfig, f as InferPageProps, d as InferSharedProps, M as MaybePromise, c as PageObject, P as PageProps, g as RenderInertiaSsrApp, R as ResolvedConfig, S as SharedData, b as SharedDatumFactory, e as SharedProps } from '../types-fb05P61I.js';
5
+ import '@adonisjs/vite';
@@ -0,0 +1,33 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/app/app.ts') })
3
+ }}}
4
+ /// <reference path="../../adonisrc.ts" />
5
+ /// <reference path="../../config/inertia.ts" />
6
+
7
+ import '../css/app.css';
8
+
9
+ import { createInertiaApp } from '@inertiajs/svelte'
10
+ import { resolvePageComponent } from '@adonisjs/inertia/helpers'
11
+
12
+ const appName = import.meta.env.VITE_APP_NAME || 'AdonisJS'
13
+
14
+ createInertiaApp({
15
+ progress: { color: '#5468FF' },
16
+
17
+ title: (title) => {{ '`${title} - ${appName}`' }},
18
+
19
+ resolve: (name) => {
20
+ return resolvePageComponent(
21
+ {{ '`../pages/${name}.svelte`' }},
22
+ import.meta.glob('../pages/**/*.svelte'),
23
+ )
24
+ },
25
+
26
+ setup({ el, App, props }) {
27
+ {{#if ssr}}
28
+ new App({ target: el, props, hydrate: true })
29
+ {{#else}}
30
+ new App({ target: el, props })
31
+ {{/if}}
32
+ },
33
+ })
@@ -0,0 +1,10 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/pages/errors/not_found.svelte') })
3
+ }}}
4
+ <div>
5
+ <div class="container">
6
+ <div class="title">Page not found</div>
7
+
8
+ <span>This page does not exist.</span>
9
+ </div>
10
+ </div>
@@ -0,0 +1,14 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/pages/errors/server_error.svelte') })
3
+ }}}
4
+ <script>
5
+ export let error
6
+ </script>
7
+
8
+ <div>
9
+ <div class="container">
10
+ <div class="title">Server Error</div>
11
+
12
+ <span>{error.message}</span>
13
+ </div>
14
+ </div>
@@ -0,0 +1,19 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/pages/home.svelte') })
3
+ }}}
4
+ <script>
5
+ export let version
6
+ </script>
7
+
8
+ <svelte:head>
9
+ <title>Homepage</title>
10
+ </svelte:head>
11
+
12
+ <div class="container">
13
+ <div class="title">AdonisJS \{ version \} x Inertia x Svelte</div>
14
+
15
+ <span>
16
+ Learn more about AdonisJS and Inertia.js by visiting the
17
+ <a href="https://docs.adonisjs.com/guides/inertia">AdonisJS documentation</a>.
18
+ </span>
19
+ </div>
@@ -0,0 +1,21 @@
1
+ {{{
2
+ exports({ to: app.makePath('resources/views/inertia_layout.edge') })
3
+ }}}
4
+ <!DOCTYPE html>
5
+ <html>
6
+
7
+ <head>
8
+ <meta charset="utf-8">
9
+ <meta name="viewport" content="width=device-width, initial-scale=1">
10
+
11
+ <title inertia>AdonisJS x Inertia x Svelte</title>
12
+
13
+ {{ "@vite(['inertia/app/app.ts', `inertia/pages/${page.component}.svelte`])" }}
14
+ @inertiaHead()
15
+ </head>
16
+
17
+ <body>
18
+ @inertia()
19
+ </body>
20
+
21
+ </html>
@@ -0,0 +1,15 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/app/ssr.ts') })
3
+ }}}
4
+
5
+ import { createInertiaApp } from '@inertiajs/svelte'
6
+
7
+ export default function render(page: any) {
8
+ return createInertiaApp({
9
+ page,
10
+ resolve: (name) => {
11
+ const pages = import.meta.glob('../pages/**/*.svelte', { eager: true })
12
+ {{ 'return pages[`../pages/${name}.svelte`]' }}
13
+ }
14
+ })
15
+ }
@@ -0,0 +1,14 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/tsconfig.json') })
3
+ }}}
4
+ {
5
+ "extends": "@adonisjs/tsconfig/tsconfig.client.json",
6
+ "compilerOptions": {
7
+ "baseUrl": ".",
8
+ "module": "ESNext",
9
+ "paths": {
10
+ "~/*": ["./*"],
11
+ },
12
+ },
13
+ "include": ["./**/*.ts", "./**/*.svelte"],
14
+ }