Skip to content

Commit

Permalink
Improve generated types for routes (#673)
Browse files Browse the repository at this point in the history
* Working on new type generation, commit before merge to 0.17.0

* prepare for merge

* notes for future

* Regex the hell out of this

* {Type}Data is functional

* Working 🎉

* relative imports for load types

* added changeset

* Tests working 🎉 & LoadInput proper generation

* FIX: diffs not merged

* FIX: Format and unnecessary log in tests

* tiny formatting issue that will annpy me if I don't fix it

* Additional fs exports were not necessary, oops

* added comments

* Reorder of type generation

* FIX: Run prettier

* Fix lint

* Using walk_routes

* Formatting, Lint and remove commented old code

* Fixed proxy files, use houdini types in e2e, added copyFileSync to fs

* FIX: Format

* FIX: return from copyFileSync

* FIX: add fs.copyFile, fixed async calls, use internal path

* tidy up changeset

Co-authored-by: Alec Aivazis <[email protected]>
  • Loading branch information
sjcobb2022 and AlecAivazis authored Nov 10, 2022
1 parent 57577ee commit 3986d5e
Show file tree
Hide file tree
Showing 14 changed files with 744 additions and 407 deletions.
6 changes: 6 additions & 0 deletions .changeset/shy-months-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'houdini': patch
'houdini-svelte': patch
---

Added typescript codegen
4 changes: 3 additions & 1 deletion e2e/sveltekit/src/routes/plugin/+layout.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// don't delete this. It's here as a way to verify some behavior on the session test
export async function load() {
return {};
return {
test: 'test'
};
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import type { PageData } from './$types';
import type { PageData } from './$houdini';
export let data: PageData;
$: ({ Partial_List } = data);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import type { PageData } from './$types';
import type { PageData } from './$houdini';
export let data: PageData;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import type { PageData } from './$types';
import type { PageData } from './$houdini';
export let data: PageData;
Expand Down
2 changes: 1 addition & 1 deletion e2e/sveltekit/src/routes/stores/ssr-[userId]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { CachePolicy } from '$houdini';
import { page } from '$app/stores';
import { stry } from '@kitql/helper';
import type { PageData } from './$types';
import type { PageData } from './$houdini';
export let data: PageData;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { MultiUserStore } from '$houdini';
import type { PageData } from './$types';
import type { PageData } from './$houdini';
export let data: PageData;
Expand Down
2 changes: 1 addition & 1 deletion e2e/sveltekit/src/routes/stores/ssr/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import type { PageData } from './$types';
import type { PageData } from './$houdini';
export let data: PageData;
$: ({ usersList, Hello } = data);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
"@changesets/changelog-github": "^0.4.7",
"@changesets/cli": "^2.25.0",
"@playwright/test": "1.25.0",
"playwright-core": "1.25.0",
"@theguild/eslint-config": "^0.1.0",
"@trivago/prettier-plugin-sort-imports": "^3.3.0",
"eslint-plugin-unused-imports": "^2.0.0",
"graphql": "^15.8.0",
"playwright-core": "1.25.0",
"prettier": "^2.7.0",
"turbo": "^1.5.4",
"vite": "^3.1.6",
Expand Down
Loading

2 comments on commit 3986d5e

@vercel
Copy link

@vercel vercel bot commented on 3986d5e Nov 10, 2022

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on 3986d5e Nov 10, 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-kohl.vercel.app
docs-next-git-main-houdinigraphql.vercel.app
docs-next-houdinigraphql.vercel.app

Please sign in to comment.