Skip to content

Commit

Permalink
Support SvelteKit's new API (#449)
Browse files Browse the repository at this point in the history
* fix import order with multiple inline queries

* make text friendlier

* update store integration tests to use new embedded api

* update preprocess tests

* invert fragment argument order

* added changesets

* comment tweak

* add loadAll

* add test for loadAll

* add infrastructure to inject context into query store

* add plugin to inject houdini context everywhere

* tweak readme

* remove context from integration tests and moved ctx arg to back of pagination methods

* context error in pagination methods

* injectContext is now a list

* dont lint site

* docs - hooks dont return props

* fixed highlighting colors

* more doc fixes

* docs

* document pull-schema cmd

* remove mentions of sapper

* invert fragment order

* endpoint

* remove references to houdiniContext

* store loading api

* more updates and release notes section

* fix incorrect header in release notes guide

* version change release notes guide link

* fix build errors

* redo working-with-graphql guide

* fix transformation css class

* typo

* order section

* working-with-graphql recommendation first

* more working with graphql tweaks

* SSR -> server side rendering

* so many tweaks

* conclusion to working with graphql

* english

* add plugin docs

* clean up hook docs

* dry up subscription config

* fix syntax highlighting

* fix session tracking

* supress context logs in store factory

* error msg tweak

* rename svelte-preprocess to preprocess

* added integration tests

* avoid duplicate tag bug in asyncWalk

* fix watch and run bugs

* sync on postinstall

* start moving to typescript

* move to vitest

* 🚧 UPDATE: integration prj

* Generate type definitions for route functions (#470)

* start variable typedefs

* unify load import behavior

* start building variable definition file

* battery about to die

* keep on keeping on

* tests pass

* build errors

* integration builds

* formatting

* add changeset

* tests pass

* add missing Prism import

* add route typdefs to release notes

* flesh out typescript guide (finally)

* trim fluff

* ♻️ UPDATE: sync

* tentative

* fix test name

* plugin resolves

* 🚧 ADD: routDir, FIX: some paths, TODO: svelte only

* use artifact name in generated load prop

* update snapshot

* 🚧 UPDATE: init with vite config for kit & svelte

* 🚧 FIX: init in layout.tjs file

* 🚧 IMPROVE: svelte init with main.js

* 🚧 IMPROVE: init in layout.svelte

* 🚧 IMPROVE: rmv defaults

* manual load ssr works 🎉

* add kit plugin back

* fix build errors

* ✨ NEW: add graphql in devDep

* ✨ IMPROVE: init cmd with client

* fix config and client imports

* add ? to components

* inline documents use $$props references

* update snapshot

* attempt to migrate to pnpm

* better attempt at pnpm cached install

* i hate yaml

* add minimatch types

* missing deps

* bump node version

* import BaseNode from estree-walker

* more deps

* remove estree dep

* no need to generate runtime with integration linter

* more deps!

* use pnpm --filter to run workspace command

* try without --filter

* maybe its the pnpm cache?

* gotta run install now

* missed on

* build houdini before integration linter

* no need for generate before preview in integration tests

* tweak test flow

* cd integration &&

* dont generate in playwright server

* does that move the error?

* build before sync

* more ci tweaks

* add indexFile generator back

* aaaand we're back

* fix yaml

* fix import

* fix indexFile tests

* update test file and watch and run bug

* indexFile tests need to use mock fs

* fix type errors in integration tests

* add warning about missing client file

* remove flaky test (integration tests cover it)

* formatting

* delete yarn files

* ✨ IMPROVE: logs. Show the end if starting... (if not we could not show starting...) 👀

* 🚸 REMOVE: some yarn things

* query, mutation, and subscription store classes

* first pass at type checking class-based stores

* mark type exports explicitly

* update snapshots

* rename houdini/kit to houdini/vite

* linter

* update mutation, fragment, and subscription stores to use classes

* added changeset

* document stores as classes

* missing punctuation

* fix typedefinitions for paginated queries

* fix bug preventing initial page info from loading

* offset query pagination

* clean up logs

* disable eslint for one line

* ✅ FIX: endpoint mutation test

* 🐛 FIX: windows build

* ♻️ IMPROVE: file orga

* fixed hidden page.js client import path

* 🚸 IMPROVE: linting

* inline document functions return stores directly

* added changeset

* initial pageinfo ssr's

* paginated fragments typecheck

* paginated fragments tests pass

* more imports

* more integration tests passing (sessions, endpoints, etc)

* component queries

* remove import.meta.env for cjs compat

* more integration test cleanup

* watch-and-run errors and only generate runtime if version changed

* add tests for generating route types

* layout queries

* set process.env.TEST  in vite.setup

* better check for updated versions

* fix prettier config

* 🎨 IMPROVE: logs

* a

* 🎨 IMPROVE: one liner in plugin

* consolidate store vs inline docs

* update intro

* document config.client

* update snapshots and check for unexported data variable

* generate valid page data type

* PageData includes return values from hook functions

* update contributing guide

* clean up todos

* update snapshot

* linter and check

* update snapshot

* bump

* enable replay

* downgrade node version

* independent replay config file

* add retries

* remove workers config

* fix a few tests

* more local testing

* more invalid tests

* more test fixes

* initial page size for paginated fragments

* add retries to local test config

* start migration guide

* add migration guide to left bar

* bring highlight imports local

* conclusion for migration guide

* small tweaks

* 🐛 FIX: inline mutation

* 🚧 UPDATE: rmv retries for fast tests (will be back later)

* ⚡ IMPROVE: page goto default

* ⚡ IMPROVE: timing margin

* ⚡ UPDATE: goto with extra timing

* 🐛 FIX: file name

* 🚸 FIX: goto and expect (timing)

* 👌 FIX: linting

* 🚧 TMP: logs in gh

* enter prerelease mode

* more doc updates

* ✅ IMPROVE: testing

* 🚧 UPDATE: for CI

* 🚧 REMOVE: waitForRequest

* ♻️ UPDATE: namings

* 🤡 UPDATE: OMG?

* 👌 FIX: wait after click to navigate well

* ✏️ UPDATE: comment

* ♻️ REMOVE: scripts and 1 playwright config with options (test worker 60)

* ♻️ UPDATE: playwright settings

* try caching pnpm and playwright

* bump playwright cache version

* cache rest of workflows

* fix houdini client import (to break integration tests)

* graphql tag to return any

* pull schema if it doesn't exist on startup

* fix bug seeing changes in schema file

* convert all errors to HoudiniError

* more fixes from fehnomenal

* fix nullish mutation response

* remove context and inline document functions

* added changeset

* remove all inline document functions except fragment

* document lack of inline wrappers

* tests pass

* 🐛 FIX: types (thx to @fehnomenal)

Co-authored-by: fehnomenal <[email protected]>

* 🚸 FIX: typings

* update snapshots

* remove mention of session

* Generate input types (and more fixes) (#476)

* Fix typing for generated fragment load functions

* Fix copy/paste error (probably)

* Unify naming and usage of document inputs and results

* Generate null input types

* ✨ NEW: custom globalStoreName (#460)

* ✏️ UPDATE: doc & changeset

* ✅ UPDATE: tests with globalStorePrefix

* 🚧 IMPROVE: adding forbiddenNames

* ✅ FIX: tests using forbidden names

* 🤡 UPDATE: snap (sorry, I pushed it wrong before)

* different link to release notes

* add mdsvex as regular dep

* move dev deps to deps

* actual link

* add svelte as dep

Co-authored-by: jycouet <[email protected]>
Co-authored-by: fehnomenal <[email protected]>
  • Loading branch information
3 people authored Aug 25, 2022
1 parent 9aa8471 commit 59257d1
Show file tree
Hide file tree
Showing 431 changed files with 29,094 additions and 29,753 deletions.
5 changes: 5 additions & 0 deletions .changeset/breezy-birds-end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'houdini': patch
---

You can now define the prefix of your global stores with globalStorePrefix param in the config.
5 changes: 5 additions & 0 deletions .changeset/cool-brooms-shop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'houdini': minor
---

remove inline document functions query, paginatedQuery, subscription, and mutation
5 changes: 5 additions & 0 deletions .changeset/fifty-doors-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'houdini': minor
---

renamed `generate --pull-header` to `generate --header` and `generate --persist-output` to `generate --output`
5 changes: 5 additions & 0 deletions .changeset/good-trees-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'houdini': minor
---

added support for page queries
5 changes: 5 additions & 0 deletions .changeset/green-melons-lick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'houdini': minor
---

inverted argument order for inline fragments
5 changes: 5 additions & 0 deletions .changeset/mean-colts-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'houdini': minor
---

inline document functions return store references directly
5 changes: 5 additions & 0 deletions .changeset/neat-taxis-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'houdini': minor
---

Stores are now classes and need to be instantiated with `new MyQueryStore()`
5 changes: 5 additions & 0 deletions .changeset/nice-items-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'houdini': minor
---

query stores must now be passed to routes as props instead of globally imported
5 changes: 5 additions & 0 deletions .changeset/ninety-balloons-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'houdini': patch
---

graphql tags return store references
10 changes: 10 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"mode": "pre",
"tag": "next",
"initialVersions": {
"houdini": "0.15.8",
"integration": "0.0.1",
"site": "0.0.1"
},
"changesets": []
}
5 changes: 5 additions & 0 deletions .changeset/silent-pandas-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'houdini': minor
---

SvelteKit projects must now use houdini/kit as a vite plugin
5 changes: 5 additions & 0 deletions .changeset/slow-planes-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'houdini': patch
---

add generated typedefs for route functions
5 changes: 5 additions & 0 deletions .changeset/swift-ducks-camp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'houdini': minor
---

`config.sourceGlob` has been renamed to `config.include` and is now optional. Also added `config.exclude` to filter out files matched by `config.include`
5 changes: 5 additions & 0 deletions .changeset/ten-pets-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'houdini': minor
---

renamed `houdini/preprocess` to `houdini/svelte-preprocess`
36 changes: 36 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
module.exports = {
root: true,
extends: '@theguild',
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/prefer-as-const': 'off',
'@typescript-eslint/no-var-requires': 'off',
'unicorn/no-lonely-if': 'off',
'unicorn/filename-case': 'off',
'unicorn/no-instanceof-array': 'off',
'unicorn/prefer-includes': 'off',
'import/no-default-export': 'off',
'sonarjs/no-gratuitous-expressions': 'off',
'no-lonely-if': 'off',
'no-console': 'off',
'prefer-arrow-callback': 'off',
'prefer-const': 'off',
'no-else-return': 'off',
'no-empty': 'off',
'no-var': 'off',
'no-undef': 'off',
'object-shorthand': 'off',
// 'no-console': ['error', { allow: ['info', 'warn', 'error', 'time', 'timeEnd'] }],
},
ignorePatterns: ['integration', 'example', 'site'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
},
}
16 changes: 10 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 16.14.2
node-version: 18.7.0

- name: Set Git Identity
run: |
Expand All @@ -47,16 +47,20 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 7

- name: Install Dependencies
run: yarn install
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
run: pnpm install

- name: Create Release Pull Request or Deploy
uses: changesets/action@v1
with:
version: yarn version
publish: yarn release
version: pnpm run version
publish: pnpm run release
title: '📦 Version Update'
commit: '📦 v{VERSION}'
env:
Expand Down
151 changes: 104 additions & 47 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,25 @@ jobs:
with:
ref: ${{ github.ref }}

- name: Setup Node
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16.14.2
cache: 'yarn'
node-version: 16.17.0

- name: Install Dependencies
run: yarn install
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 7

- name: Install dependencies
run: pnpm install

- name: Check prettier
run: yarn format:check
run: pnpm run format:check

- name: Check lint
run: pnpm run lint

tests:
name: Tests
Expand All @@ -47,22 +53,38 @@ jobs:
with:
ref: ${{ github.ref }}

- name: Setup Node
- name: Install Node.js
uses: actions/setup-node@v3
with:
cache: 'yarn'
node-version: 16.14.2
node-version: 16.17.0

- name: Install Dependencies
run: yarn install
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 7

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Build packages
run: yarn build
run: pnpm run build

- name: Tests
run: yarn tests
run: pnpm run tests

integration:
name: Integration Tests
Expand All @@ -74,43 +96,62 @@ jobs:
with:
ref: ${{ github.ref }}

- name: Setup Node
- name: Install Node.js
uses: actions/setup-node@v3
with:
cache: 'yarn'
node-version: 16.14.2
node-version: 16.17.0

- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 7

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Cache playwright binaries
uses: actions/cache@v2
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: cache-playwright-linux-1.21.0

- name: Install dependencies
run: yarn install --immutable
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
key: cache-playwright-linux-1.25.0

- name: Build packages
run: yarn build
run: pnpm run build

- name: Install Playwright
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install --with-deps

- name: SvelteKit Sync
run: cd integration && npx svelte-kit sync

- name: Integration Tests
run: yarn workspace integration tests
run: pnpm --filter integration tests
env:
RECORD_REPLAY_TEST_RUN_ID: ${{ env.GITHUB_SHA }}

# - name: Upload videos
# uses: replayio/[email protected]
# if: ${{ always() }}
# with:
# api-key: ${{ secrets.RECORD_REPLAY_API_KEY }}
# filter: ${{ 'function($v) { $v.metadata.test.result = "failed" and $v.status = "onDisk" }' }}
- name: Upload videos
uses: replayio/[email protected]
if: ${{ always() }}
with:
api-key: ${{ secrets.RECORD_REPLAY_API_KEY }}
filter: ${{ 'function($v) { $v.metadata.test.result = "failed" and $v.status = "onDisk" }' }}

integration_linter:
name: Integration Linter
Expand All @@ -122,29 +163,45 @@ jobs:
with:
ref: ${{ github.ref }}

- name: Setup Node
- name: Install Node.js
uses: actions/setup-node@v3
with:
cache: 'yarn'
node-version: 16.14.2
node-version: 16.17.0

- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 7

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: yarn install
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
run: pnpm install

- name: Build packages
run: yarn build
- name: Build Package
run: pnpm run build

- name: Generate runtime
run: yarn workspace integration generate
- name: SvelteKit Sync
run: cd integration && npx svelte-kit sync

- name: Build kit assets
run: yarn workspace integration build
run: pnpm --filter integration run build

# needs to run after build & houdini generate
- name: Integration lint
run: yarn workspace integration lint
run: pnpm --filter integration run lint

- name: Integration check
run: yarn workspace integration check
run: pnpm --filter integration run check
Loading

0 comments on commit 59257d1

Please sign in to comment.