@adonisjs/inertia 1.0.0-14 → 1.0.0-15
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/build/{chunk-NVJNYWGW.js → chunk-7ZZGYDYU.js} +2 -2
- package/build/index.js +5 -1
- package/build/providers/inertia_provider.js +1 -1
- package/build/react/app.tsx.stub +1 -1
- package/build/react/home.tsx.stub +1 -1
- package/build/react/root.edge.stub +1 -1
- package/build/solid/app.tsx.stub +1 -1
- package/build/solid/home.tsx.stub +1 -1
- package/build/solid/root.edge.stub +1 -1
- package/build/src/inertia_middleware.js +1 -1
- package/build/svelte/app.ts.stub +26 -0
- package/build/svelte/home.svelte.stub +19 -0
- package/build/svelte/root.edge.stub +21 -0
- package/build/svelte/ssr.ts.stub +15 -0
- package/build/svelte/tsconfig.json.stub +26 -0
- package/build/vue/home.vue.stub +3 -3
- package/package.json +1 -1
|
@@ -60,8 +60,8 @@ var ServerRenderer = class {
|
|
|
60
60
|
async render(pageObject) {
|
|
61
61
|
let render;
|
|
62
62
|
let preloadTags = [];
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
const devServer = this.vite?.getDevServer();
|
|
64
|
+
if (devServer) {
|
|
65
65
|
const runtime = await this.vite.createRuntime();
|
|
66
66
|
render = await runtime.executeEntrypoint(this.config.ssr.entrypoint);
|
|
67
67
|
const entryMod = devServer.moduleGraph.getModuleById(this.config.entrypoint);
|
package/build/index.js
CHANGED
|
@@ -54,7 +54,7 @@ var ADAPTERS_INFO = {
|
|
|
54
54
|
viteRegister: {
|
|
55
55
|
pluginCall: "svelte()",
|
|
56
56
|
importDeclarations: [
|
|
57
|
-
{ isNamed:
|
|
57
|
+
{ isNamed: true, module: "@sveltejs/vite-plugin-svelte", identifier: "svelte" }
|
|
58
58
|
]
|
|
59
59
|
},
|
|
60
60
|
ssrEntrypoint: "resources/ssr.ts"
|
|
@@ -156,6 +156,10 @@ async function configure(command) {
|
|
|
156
156
|
ssr && adapterInfo.viteRegister.ssrPluginCall ? adapterInfo.viteRegister.ssrPluginCall : adapterInfo.viteRegister.pluginCall,
|
|
157
157
|
adapterInfo.viteRegister.importDeclarations
|
|
158
158
|
);
|
|
159
|
+
const adonisjsPluginCall = `adonisjs({ entrypoints: ['resources/app.${appExt}'], reload: ['resources/views/**/*.edge'] })`;
|
|
160
|
+
await codemods.registerVitePlugin(adonisjsPluginCall, [
|
|
161
|
+
{ isNamed: false, module: "@adonisjs/vite/client", identifier: "adonisjs" }
|
|
162
|
+
]);
|
|
159
163
|
await defineExampleRoute(command, codemods);
|
|
160
164
|
const pkgToInstall = adapterInfo.dependencies;
|
|
161
165
|
if (ssr && adapterInfo.ssrDependencies) {
|
package/build/react/app.tsx.stub
CHANGED
|
@@ -13,7 +13,7 @@ export default function Home(props: { version: number }) {
|
|
|
13
13
|
|
|
14
14
|
<span>
|
|
15
15
|
Learn more about AdonisJS and Inertia.js by visiting the{' '}
|
|
16
|
-
<a href="https://docs.adonisjs.com/inertia">AdonisJS documentation</a>.
|
|
16
|
+
<a href="https://docs.adonisjs.com/guides/inertia">AdonisJS documentation</a>.
|
|
17
17
|
</span>
|
|
18
18
|
</div>
|
|
19
19
|
</>
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
<title inertia>AdonisJS x Inertia x React</title>
|
|
12
12
|
|
|
13
13
|
@viteReactRefresh()
|
|
14
|
-
{{ "@vite(['resources/app.tsx', `resources/pages/${page.component}.tsx`])" }}
|
|
15
14
|
@inertiaHead()
|
|
15
|
+
{{ "@vite(['resources/app.tsx', `resources/pages/${page.component}.tsx`])" }}
|
|
16
16
|
</head>
|
|
17
17
|
|
|
18
18
|
<body>
|
package/build/solid/app.tsx.stub
CHANGED
|
@@ -13,7 +13,7 @@ export default function Home(props: { version: number }) {
|
|
|
13
13
|
|
|
14
14
|
<span>
|
|
15
15
|
Learn more about AdonisJS and Inertia.js by visiting the{' '}
|
|
16
|
-
<a href="https://docs.adonisjs.com/inertia">AdonisJS documentation</a>.
|
|
16
|
+
<a href="https://docs.adonisjs.com/guides/inertia">AdonisJS documentation</a>.
|
|
17
17
|
</span>
|
|
18
18
|
</div>
|
|
19
19
|
</>
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
<title inertia>AdonisJS x Inertia x SolidJS</title>
|
|
12
12
|
|
|
13
|
-
{{ "@vite(['resources/app.tsx', `resources/pages/${page.component}.tsx`])" }}
|
|
14
13
|
@inertiaHead()
|
|
14
|
+
{{ "@vite(['resources/app.tsx', `resources/pages/${page.component}.tsx`])" }}
|
|
15
15
|
</head>
|
|
16
16
|
|
|
17
17
|
<body>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{{{
|
|
2
|
+
exports({ to: app.makePath('resources/app.ts') })
|
|
3
|
+
}}}
|
|
4
|
+
import './css/app.css';
|
|
5
|
+
|
|
6
|
+
import { createInertiaApp } from '@inertiajs/svelte'
|
|
7
|
+
import { resolvePageComponent } from '@adonisjs/inertia/helpers'
|
|
8
|
+
|
|
9
|
+
const appName = import.meta.env.VITE_APP_NAME || 'AdonisJS'
|
|
10
|
+
|
|
11
|
+
createInertiaApp({
|
|
12
|
+
progress: { color: '#5468FF' },
|
|
13
|
+
|
|
14
|
+
title: (title) => {{ '`${title} - ${appName}`' }},
|
|
15
|
+
|
|
16
|
+
resolve: (name) => {
|
|
17
|
+
return resolvePageComponent(
|
|
18
|
+
{{ '`./pages/${name}.svelte`' }},
|
|
19
|
+
import.meta.glob('./pages/**/*.svelte'),
|
|
20
|
+
)
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
setup({ el, App, props }) {
|
|
24
|
+
new App({ target: el, props })
|
|
25
|
+
},
|
|
26
|
+
})
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{{{
|
|
2
|
+
exports({ to: app.makePath('resources/pages/home.svelte') })
|
|
3
|
+
}}}
|
|
4
|
+
<script>
|
|
5
|
+
export let version: number
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<svelte:head>
|
|
9
|
+
<title>Homepage</title>
|
|
10
|
+
</svelte:head>
|
|
11
|
+
|
|
12
|
+
<div className="container">
|
|
13
|
+
<div className="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/root.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(['resources/app.ts', `resources/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('resources/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,26 @@
|
|
|
1
|
+
{{{
|
|
2
|
+
exports({ to: app.makePath('resources/tsconfig.json') })
|
|
3
|
+
}}}
|
|
4
|
+
{
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"target": "ESNext",
|
|
7
|
+
"jsx": "preserve",
|
|
8
|
+
"jsxImportSource": "vue",
|
|
9
|
+
"lib": ["DOM", "ESNext", "DOM.Iterable", "ES2020"],
|
|
10
|
+
"useDefineForClassFields": true,
|
|
11
|
+
"baseUrl": ".",
|
|
12
|
+
"module": "ESNext",
|
|
13
|
+
"moduleResolution": "Bundler",
|
|
14
|
+
"paths": {
|
|
15
|
+
"@/*": ["./*"],
|
|
16
|
+
"~/*": ["../*"],
|
|
17
|
+
},
|
|
18
|
+
"resolveJsonModule": true,
|
|
19
|
+
"types": ["vite/client"],
|
|
20
|
+
"allowSyntheticDefaultImports": true,
|
|
21
|
+
"esModuleInterop": true,
|
|
22
|
+
"verbatimModuleSyntax": true,
|
|
23
|
+
"skipLibCheck": true,
|
|
24
|
+
},
|
|
25
|
+
"include": ["./**/*.ts", "./**/*.svelte"],
|
|
26
|
+
}
|
package/build/vue/home.vue.stub
CHANGED
|
@@ -10,12 +10,12 @@ defineProps<{ version: number }>()
|
|
|
10
10
|
<template>
|
|
11
11
|
<Head title="Homepage" />
|
|
12
12
|
|
|
13
|
-
<div
|
|
14
|
-
<div
|
|
13
|
+
<div class="container">
|
|
14
|
+
<div class="title">AdonisJS \{\{ version \}\} x Inertia x Vue.js</div>
|
|
15
15
|
|
|
16
16
|
<span>
|
|
17
17
|
Learn more about AdonisJS and Inertia.js by visiting the
|
|
18
|
-
<a href="https://docs.adonisjs.com/inertia">AdonisJS documentation</a>.
|
|
18
|
+
<a href="https://docs.adonisjs.com/guides/inertia">AdonisJS documentation</a>.
|
|
19
19
|
</span>
|
|
20
20
|
</div>
|
|
21
21
|
</template>
|