Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glob version #1418

Merged
merged 9 commits into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/rotten-baboons-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'houdini': patch
---

Bump deprecated dependency version
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20.13.1
node-version: 20.18.1

- uses: pnpm/[email protected]
name: Install pnpm
Expand Down
8 changes: 4 additions & 4 deletions e2e/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
"graphql-yoga": "^4.0.4",
"houdini": "workspace:^",
"houdini-react": "workspace:^",
"react": "19.0.0-rc-eb259b5d3b-20240605",
"react-dom": "19.0.0-rc-eb259b5d3b-20240605",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-streaming-compat": "^0.3.18"
},
"devDependencies": {
"@playwright/test": "1.48.0",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@types/react": "^19.0.7",
"@types/react-dom": "^19.0.3",
"@vitejs/plugin-react": "^3.1.0",
"autoprefixer": "^10.4.16",
"concurrently": "7.1.0",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@playwright/test": "1.48.0",
"@theguild/eslint-config": "^0.8.0",
"@trivago/prettier-plugin-sort-imports": "^4.0.0",
"@types/react": "^18.2.22",
"@types/react": "^19.0.7",
"@vitest/coverage-v8": "^1.6.0",
"@vitest/ui": "^1.6.0",
"eslint-plugin-unused-imports": "^3.0.0",
Expand Down
5 changes: 2 additions & 3 deletions packages/_scripts/build.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import esbuild from 'esbuild'
import { replace } from 'esbuild-plugin-replace'
import glob from 'glob'
import { glob } from 'glob'
import fs from 'node:fs/promises'
import path from 'node:path'
import { promisify } from 'node:util'

// the relevant directories
const build_dir = path.join(process.cwd(), 'build')
Expand Down Expand Up @@ -107,7 +106,7 @@ async function build({ packages, source, bundle = true, plugin, cmd }) {
// if we aren't bundling, look up the entrypoints once
const children = bundle
? []
: await promisify(glob)(path.join(source, '**/**/!(*.test)*').replaceAll('\\', '/'), {
: await glob(path.join(source, '**/**/!(*.test)*').replaceAll('\\', '/'), {
nodir: true,
})

Expand Down
2 changes: 1 addition & 1 deletion packages/_scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"esbuild": "^0.15.10",
"esbuild-plugin-alias": "^0.2.1",
"esbuild-plugin-replace": "^1.2.0",
"glob": "^8.0.3",
"glob": "^11.0.1",
"rollup": "^3.7.4",
"rollup-plugin-typescript2": "^0.34.0",
"typescript": "^4.9"
Expand Down
5 changes: 2 additions & 3 deletions packages/_scripts/typedefs.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import fsSync from 'fs'
import fs_extra from 'fs-extra'
import fs from 'fs/promises'
import glob from 'glob'
import { glob } from 'glob'
import path from 'path'
import ts from 'typescript'
import { promisify } from 'util'

const { ModuleResolutionKind } = ts
const tsConfig = JSON.parse(fsSync.readFileSync('../../tsconfig.json', 'utf-8'))
Expand All @@ -16,7 +15,7 @@ export default async function generate_typedefs({ plugin }) {
)

// grab any non-tests file
const files = (await promisify(glob)('./src/**/*.ts*', { nodir: true })).filter(
const files = (await glob('./src/**/*.ts*', { nodir: true })).filter(
(path) => !path.endsWith('.test.ts')
)

Expand Down
6 changes: 3 additions & 3 deletions packages/adapter-static/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"build:build": "pnpm build: && pnpm build"
},
"devDependencies": {
"@types/react-dom": "^18.3.0",
"@types/react-dom": "^19.0.3",
"@types/node": "^18.7.23",
"csstype": "^3.1.3",
"scripts": "workspace:^",
Expand All @@ -30,8 +30,8 @@
},
"dependencies": {
"houdini": "workspace:^",
"react": "19.0.0-rc-eb259b5d3b-20240605",
"react-dom": "19.0.0-rc-eb259b5d3b-20240605",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"vite": "^4.1.4"
},
"files": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"@whatwg-node/server": "^0.9.14"
},
"devDependencies": {
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@types/react": "^19.0.7",
"@types/react-dom": "^19.0.3",
"@vitejs/plugin-react": "^3.1.0",
"typescript": "^4.9.3",
"vite": "^4.1.0"
Expand Down
11 changes: 5 additions & 6 deletions packages/houdini-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@
"@types/cookies": "^0.7.7",
"@types/estraverse": "^5.1.2",
"@types/express": "^4.17.17",
"@types/react": "^18.0.33",
"@types/react-dom": "^18.0.10",
"next": "^13.0.1",
"@types/react": "^19.0.7",
"@types/react-dom": "^19.0.3",
"scripts": "workspace:^"
},
"dependencies": {
Expand All @@ -42,8 +41,8 @@
"graphql": "^15.8.0",
"graphql-yoga": "^4.0.4",
"houdini": "workspace:^",
"react": "19.0.0-rc-eb259b5d3b-20240605",
"react-dom": "19.0.0-rc-eb259b5d3b-20240605",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-streaming-compat": "^0.3.18",
"recast": "^0.23.1",
"rollup": "^4.28.1",
Expand Down Expand Up @@ -74,4 +73,4 @@
},
"main": "./build/plugin-cjs/index.js",
"types": "./build/plugin/index.d.ts"
}
}
10 changes: 6 additions & 4 deletions packages/houdini-react/src/runtime/routing/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import { DocumentHandle, useDocumentHandle } from '../hooks/useDocumentHandle'
import { useDocumentStore } from '../hooks/useDocumentStore'
import { SuspenseCache, suspense_cache } from './cache'

type PageComponent = React.ComponentType<{ url: string }>

const PreloadWhich = {
component: 'component',
data: 'data',
Expand Down Expand Up @@ -467,7 +469,7 @@ export function RouterContextProvider({
client: HoudiniClient
cache: Cache
artifact_cache: SuspenseCache<QueryArtifact>
component_cache: SuspenseCache<(props: any) => React.ReactElement>
component_cache: SuspenseCache<PageComponent>
data_cache: SuspenseCache<DocumentStore<GraphQLObject, GraphQLVariables>>
ssr_signals: PendingCache
last_variables: LRUCache<GraphQLVariables>
Expand Down Expand Up @@ -522,7 +524,7 @@ type RouterContext = {

// We also need a cache for component references so we can avoid suspending
// when we load the same page multiple times
component_cache: SuspenseCache<(props: any) => React.ReactElement>
component_cache: SuspenseCache<PageComponent>

// Pages need a way to wait for data
data_cache: SuspenseCache<DocumentStore<GraphQLObject, GraphQLVariables>>
Expand Down Expand Up @@ -791,7 +793,7 @@ function usePreload({ preload }: { preload: (url: string, which: PreloadWhichVal

export type RouterCache = {
artifact_cache: SuspenseCache<QueryArtifact>
component_cache: SuspenseCache<(props: any) => React.ReactElement>
component_cache: SuspenseCache<PageComponent>
data_cache: SuspenseCache<DocumentStore<GraphQLObject, GraphQLVariables>>
last_variables: LRUCache<GraphQLVariables>
ssr_signals: PendingCache
Expand All @@ -807,7 +809,7 @@ export function router_cache({
}: {
pending_queries?: string[]
artifacts?: Record<string, QueryArtifact>
components?: Record<string, (props: any) => React.ReactElement>
components?: Record<string, PageComponent>
initialData?: Record<string, DocumentStore<GraphQLObject, GraphQLVariables>>
initialVariables?: Record<string, GraphQLVariables>
initialArtifacts?: Record<string, QueryArtifact>
Expand Down
2 changes: 1 addition & 1 deletion packages/houdini/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"deepmerge": "^4.2.2",
"estree-walker": "^3.0.1",
"fs-extra": "^10.1.0",
"glob": "^8.0.3",
"glob": "^11.0.1",
"graphql": "^15.8.0",
"graphql-yoga": "^4.0.4",
"memfs": "^3.4.7",
Expand Down
2 changes: 1 addition & 1 deletion packages/houdini/src/lib/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export function snapshot(base?: string) {

// wrap glob in a promise and enforce that the paths are always posix-style
export async function glob(pattern: string) {
return await promisify(G)(path.posixify(pattern))
return await G(path.posixify(pattern))
}

glob.hasMagic = G.hasMagic
2 changes: 1 addition & 1 deletion packages/houdini/src/runtime/router/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ export type RouterPageManifest<_ComponentType> = {
variables: Record<string, { type: string }>
}
>
component: () => Promise<{ default: (props: any) => _ComponentType }>
component: () => Promise<{ default: _ComponentType }>
}
Loading
Loading