Skip to content

Commit

Permalink
Trim trailing stash when identifying route root (#643)
Browse files Browse the repository at this point in the history
* address trailing statsh in is_root_route

* changeset

* remove unused import

* fix comment
  • Loading branch information
AlecAivazis authored Oct 25, 2022
1 parent 9beeebc commit 35b189f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/great-pens-return.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'houdini-svelte': patch
---

Fix error preventing session in certain node versions
1 change: 0 additions & 1 deletion e2e/sveltekit/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { PlaywrightTestConfig } from '@playwright/test';
import { devices as replayDevices } from '@replayio/playwright';

// manual switch for now until replayio is fixed (currently breaking our tests)
Expand Down
14 changes: 11 additions & 3 deletions packages/houdini-svelte/src/plugin/fsPatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,18 @@ function virtual_file(name: string, options: Parameters<typeof filesystem.readdi
}

function is_root_route(filepath: PathLike): boolean {
filepath = filepath.toString()

// if the filepath ends with / we need to strip that away
if (filepath.toString().endsWith('/')) {
filepath = filepath.slice(0, -1)
}

return (
filepath.toString().endsWith(path.join('src', 'routes')) &&
// ignore the src/routes that exists in the
!filepath.toString().includes(path.join('.svelte-kit', 'types'))
filepath.endsWith(path.join('src', 'routes')) &&
// ignore the src/routes that exists in the type roots
!filepath.includes('.svelte-kit') &&
!filepath.includes('$houdini')
)
}

Expand Down

2 comments on commit 35b189f

@vercel
Copy link

@vercel vercel bot commented on 35b189f Oct 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs-next – ./site

docs-next-houdinigraphql.vercel.app
docs-next-git-main-houdinigraphql.vercel.app
docs-next-kohl.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 35b189f Oct 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.