Skip to content

Commit

Permalink
fix(core): import from fuse directly rather than hoping for a dedupe (#…
Browse files Browse the repository at this point in the history
…148)

* import from fuse directly rather than hoping for a dedupe

* add changeset

* convert vitest to mts

* try out without workspace link

* apply to more areas

* also reflect thsi in examples
  • Loading branch information
JoviDeCroock authored Feb 7, 2024
1 parent 8f8db40 commit 31f66fc
Show file tree
Hide file tree
Showing 11 changed files with 205 additions and 364 deletions.
5 changes: 5 additions & 0 deletions .changeset/clever-berries-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'fuse': patch
---

Dedupe the builder so that we can't end up with multiple fuse copies
2 changes: 1 addition & 1 deletion examples/standalone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@types/react-dom": "^18.2.15",
"@vitejs/plugin-react": "^4.2.0",
"concurrently": "^8.2.2",
"fuse": "workspace:*",
"fuse": "file:../../packages/core",
"typescript": "^5.2.2",
"vite": "^5.0.0"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/adapters/bun.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference types="bun" />
import { createYoga } from 'graphql-yoga'

import { builder } from '../builder'
// @ts-ignore
import { builder } from 'fuse'
import { getYogaPlugins, wrappedContext } from '../utils/yoga-helpers'

export async function main() {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/adapters/cloudflare.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createYoga } from 'graphql-yoga'

import { builder } from '../builder'
// @ts-ignore
import { builder } from 'fuse'
import { getYogaPlugins, wrappedContext } from '../utils/yoga-helpers'

function fetch(request) {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/adapters/lambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import type {
Context,
} from 'aws-lambda'
import { createYoga } from 'graphql-yoga'

import { builder } from '../builder'
// @ts-ignore
import { builder } from 'fuse'
import { getYogaPlugins, wrappedContext } from '../utils/yoga-helpers'

export async function fetch(
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/adapters/node.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import http from 'http'
import { createYoga } from 'graphql-yoga'

import { builder } from '../builder'
// @ts-ignore
import { builder } from 'fuse'
import { getYogaPlugins, wrappedContext } from '../utils/yoga-helpers'

export async function main() {
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/dev.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// @ts-ignore
import { builder } from 'fuse'
import { printSchema } from 'graphql'
import { createYoga } from 'graphql-yoga'

import { getYogaPlugins, wrappedContext } from './utils/yoga-helpers'
import { builder } from './builder'

// prettier-ignore
const defaultQuery = /* GraphQL */ `query {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/fixtures/simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.0.0",
"type": "module",
"devDependencies": {
"fuse": "workspace:*",
"fuse": "file:../../../",
"typescript": "^5.2.2"
}
}
2 changes: 1 addition & 1 deletion packages/core/test/fixtures/tada/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"devDependencies": {
"@0no-co/graphqlsp": "1.3.3",
"fuse": "workspace:*",
"fuse": "file:../../../",
"typescript": "^5.2.2",
"gql.tada": "1.2.1"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { defineConfig } from 'vitest/config'

export default defineConfig({
test: {},

test: {
alias: {
fuse: './builder.mjs'
}
},
})
Loading

0 comments on commit 31f66fc

Please sign in to comment.