Skip to content

Commit

Permalink
refactor: move to inertia_layout.edge
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien-R44 committed Mar 8, 2024
1 parent 66b90da commit 291081a
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/define_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function defineConfig(config: InertiaConfig): ConfigProvider<ResolvedConf

return {
versionCache,
rootView: config.rootView ?? 'root',
rootView: config.rootView ?? 'inertia_layout',
sharedData: config.sharedData || {},
entrypoint: slash(
config.entrypoint ?? (await detector.detectEntrypoint('inertia/app/app.ts'))
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export type AssetsVersion = string | number | undefined
export interface InertiaConfig {
/**
* Path to the Edge view that will be used as the root view for Inertia responses.
* @default root (resources/views/root.edge)
* @default root (resources/views/inertia_layout.edge)
*/
rootView?: string

Expand Down
2 changes: 1 addition & 1 deletion stubs/config.stub
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default defineConfig({
/**
* Path to the Edge view that will be used as the root view for Inertia responses
*/
rootView: 'root',
rootView: 'inertia_layout',

/**
* Data that should be shared with all rendered pages
Expand Down
2 changes: 1 addition & 1 deletion stubs/react/root.edge.stub
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{{
exports({ to: app.makePath('resources/views/root.edge') })
exports({ to: app.makePath('resources/views/inertia_layout.edge') })
}}}
<!DOCTYPE html>
<html>
Expand Down
2 changes: 1 addition & 1 deletion stubs/solid/root.edge.stub
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{{
exports({ to: app.makePath('resources/views/root.edge') })
exports({ to: app.makePath('resources/views/inertia_layout.edge') })
}}}
<!DOCTYPE html>
<html>
Expand Down
2 changes: 1 addition & 1 deletion stubs/svelte/root.edge.stub
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{{
exports({ to: app.makePath('resources/views/root.edge') })
exports({ to: app.makePath('resources/views/inertia_layout.edge') })
}}}
<!DOCTYPE html>
<html>
Expand Down
2 changes: 1 addition & 1 deletion stubs/vue/root.edge.stub
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{{
exports({ to: app.makePath('resources/views/root.edge') })
exports({ to: app.makePath('resources/views/inertia_layout.edge') })
}}}
<!DOCTYPE html>
<html>
Expand Down
16 changes: 8 additions & 8 deletions tests/configure.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ test.group('Frameworks', (group) => {
await command.exec()

await assert.fileExists('inertia/app/app.ts')
await assert.fileExists('resources/views/root.edge')
await assert.fileExists('resources/views/inertia_layout.edge')
await assert.fileExists('inertia/tsconfig.json')
await assert.fileExists('inertia/pages/home.vue')
await assert.fileExists('inertia/pages/errors/not_found.vue')
Expand Down Expand Up @@ -139,7 +139,7 @@ test.group('Frameworks', (group) => {
await command.exec()

await assert.fileExists('inertia/app/app.tsx')
await assert.fileExists('resources/views/root.edge')
await assert.fileExists('resources/views/inertia_layout.edge')
await assert.fileExists('inertia/tsconfig.json')
await assert.fileExists('inertia/pages/home.tsx')
await assert.fileExists('inertia/pages/errors/not_found.tsx')
Expand Down Expand Up @@ -168,7 +168,7 @@ test.group('Frameworks', (group) => {
await command.exec()

await assert.fileExists('inertia/app/app.tsx')
await assert.fileExists('resources/views/root.edge')
await assert.fileExists('resources/views/inertia_layout.edge')
await assert.fileExists('inertia/tsconfig.json')
await assert.fileExists('inertia/pages/home.tsx')
await assert.fileExists('inertia/pages/errors/not_found.tsx')
Expand Down Expand Up @@ -197,7 +197,7 @@ test.group('Frameworks', (group) => {
await command.exec()

await assert.fileExists('inertia/app/app.ts')
await assert.fileExists('resources/views/root.edge')
await assert.fileExists('resources/views/inertia_layout.edge')
await assert.fileExists('inertia/tsconfig.json')
await assert.fileExists('inertia/pages/home.svelte')
await assert.fileExists('inertia/pages/errors/not_found.svelte')
Expand Down Expand Up @@ -243,7 +243,7 @@ test.group('Frameworks | SSR', (group) => {
/**
* Path to the Edge view that will be used as the root view for Inertia responses
*/
rootView: 'root',
rootView: 'inertia_layout',
/**
* Data that should be shared with all rendered pages
Expand Down Expand Up @@ -289,7 +289,7 @@ test.group('Frameworks | SSR', (group) => {
/**
* Path to the Edge view that will be used as the root view for Inertia responses
*/
rootView: 'root',
rootView: 'inertia_layout',
/**
* Data that should be shared with all rendered pages
Expand Down Expand Up @@ -335,7 +335,7 @@ test.group('Frameworks | SSR', (group) => {
/**
* Path to the Edge view that will be used as the root view for Inertia responses
*/
rootView: 'root',
rootView: 'inertia_layout',
/**
* Data that should be shared with all rendered pages
Expand Down Expand Up @@ -366,7 +366,7 @@ test.group('Frameworks | SSR', (group) => {
await command.exec()

await assert.fileExists('inertia/app/app.ts')
await assert.fileExists('resources/views/root.edge')
await assert.fileExists('resources/views/inertia_layout.edge')
await assert.fileExists('inertia/tsconfig.json')
await assert.fileExists('inertia/pages/home.svelte')
await assert.fileContains('inertia/app/app.ts', 'hydrate')
Expand Down

0 comments on commit 291081a

Please sign in to comment.