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

fix(read-file): fix path resolution on Windows #4117

Merged
merged 7 commits into from
Jul 5, 2022

Conversation

ardatan
Copy link
Owner

@ardatan ardatan commented Jul 1, 2022

Closes #4094

json-machete uses readFileOrUrl from @graphql-mesh/utils package. Differently than the other users of this function usually provide an absolute path. But json-machete's deference function nestedly resolves the differences with dynamic base paths.
For example, when it resolves ../x/y/z/foo.json, it uses process.cwd but then, it should resolve the $ref: "../t/bar.json" path with foo.json's directory.
That's the case, readFileOrUrl ensures the path is absolute and resolves it correctly with the given "cwd".

@vercel
Copy link

vercel bot commented Jul 1, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
graphql-mesh ✅ Ready (Inspect) Visit Preview Jul 4, 2022 at 9:30PM (UTC)

@changeset-bot
Copy link

changeset-bot bot commented Jul 1, 2022

🦋 Changeset detected

Latest commit: 3384ea7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 89 packages
Name Type
@graphql-mesh/utils Patch
@graphql-mesh/cli Patch
@graphql-mesh/config Patch
@graphql-mesh/jit-executor Patch
json-machete Patch
@graphql-mesh/runtime Patch
@graphql-mesh/store Patch
@graphql-mesh/cache-cfw-kv Patch
@graphql-mesh/cache-file Patch
@graphql-mesh/cache-localforage Patch
@graphql-mesh/cache-redis Patch
@graphql-mesh/graphql Patch
@graphql-mesh/grpc Patch
@graphql-mesh/json-schema Patch
@graphql-mesh/mongoose Patch
@graphql-mesh/mysql Patch
@graphql-mesh/neo4j Patch
@graphql-mesh/new-openapi Patch
@graphql-mesh/odata Patch
@graphql-mesh/openapi Patch
@graphql-mesh/postgraphile Patch
@graphql-mesh/raml Patch
@graphql-mesh/soap Patch
@graphql-mesh/thrift Patch
@graphql-mesh/transform-cache Patch
@graphql-mesh/transform-encapsulate Patch
@graphql-mesh/transform-extend Patch
@graphql-mesh/transform-federation Patch
@graphql-mesh/transform-filter-schema Patch
@graphql-mesh/transform-hoist-field Patch
@graphql-mesh/transform-mock Patch
@graphql-mesh/transform-naming-convention Patch
@graphql-mesh/transform-prefix Patch
@graphql-mesh/transform-rate-limit Patch
@graphql-mesh/transform-rename Patch
@graphql-mesh/transform-replace-field Patch
@graphql-mesh/transform-resolvers-composition Patch
@graphql-mesh/transform-snapshot Patch
@graphql-mesh/transform-type-merging Patch
@graphql-mesh/merger-bare Patch
@graphql-mesh/merger-federation Patch
@graphql-mesh/merger-stitching Patch
@graphql-mesh/plugin-response-cache Patch
@omnigraph/json-schema Patch
@omnigraph/openapi Patch
@omnigraph/raml Patch
@graphql-mesh/container Patch
cloudflare-workers Patch
graphql-file-upload-example Patch
grpc-example Patch
grpc-reflection-example Patch
hasura-openbrewery-geodb Patch
hello-world-esm Patch
json-schema-hello-world Patch
json-schema-example Patch
json-schema-fhir Patch
json-schema-subscriptions Patch
mongoose-example Patch
mysql-employees Patch
mysql-rfam Patch
neo4j-example Patch
nextjs-apollo-example Patch
nextjs-sdk-example Patch
odata-microsoft-graph-example Patch
odata-msgraph-programmatic-ts Patch
odata-msgraph-programmatic Patch
odata-trippin-example Patch
javascript-wiki Patch
openapi-jira Patch
typescript-location-weather-example Patch
openapi-stackexchange Patch
openapi-stripe Patch
openapi-subscriptions Patch
openapi-youtrack Patch
postgres-geodb-example Patch
reddit-example Patch
country-info-example Patch
soap-demo Patch
soap-netsuite Patch
spacex-cfw Patch
chinook Patch
thrift-calculator Patch
type-merging-batching-example Patch
federation-gateway Patch
@graphql-mesh/types Patch
@graphql-mesh/tuql Patch
@graphql-mesh/transform-prune Patch
@graphql-mesh/plugin-live-query Patch
@graphql-mesh/plugin-rate-limit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@theguild-bot
Copy link
Collaborator

theguild-bot commented Jul 1, 2022

The latest changes of this PR are available as alpha in npm (based on the declared changesets):

@graphql-mesh/apollo-link@4.0.1-alpha-386f06970.0
@graphql-mesh/cache-cfw-kv@0.0.3-alpha-386f06970.0
@graphql-mesh/cache-file@0.9.2-alpha-386f06970.0
@graphql-mesh/cache-localforage@0.6.17-alpha-386f06970.0
@graphql-mesh/cache-redis@0.10.2-alpha-386f06970.0
@graphql-mesh/cli@0.74.1-alpha-386f06970.0
@graphql-mesh/config@4.0.1-alpha-386f06970.0
@graphql-mesh/container@0.1.120-alpha-386f06970.0
@graphql-mesh/graphql@0.29.1-alpha-386f06970.0
@graphql-mesh/grpc@0.24.12-alpha-386f06970.0
@graphql-mesh/json-schema@0.29.3-alpha-386f06970.0
@graphql-mesh/mongoose@0.10.70-alpha-386f06970.0
@graphql-mesh/mysql@0.16.10-alpha-386f06970.0
@graphql-mesh/neo4j@0.18.3-alpha-386f06970.0
@graphql-mesh/new-openapi@0.5.3-alpha-386f06970.0
@graphql-mesh/odata@0.18.3-alpha-386f06970.0
@graphql-mesh/openapi@0.28.1-alpha-386f06970.0
@graphql-mesh/postgraphile@0.20.33-alpha-386f06970.0
@graphql-mesh/raml@0.4.3-alpha-386f06970.0
@graphql-mesh/soap@0.12.1-alpha-386f06970.0
@graphql-mesh/thrift@0.9.3-alpha-386f06970.0
@graphql-mesh/tuql@0.5.33-alpha-386f06970.0
@graphql-mesh/jit-executor@0.0.12-alpha-386f06970.0
json-machete@0.9.3-alpha-386f06970.0
@omnigraph/json-schema@0.23.1-alpha-386f06970.0
@omnigraph/openapi@0.7.3-alpha-386f06970.0
@omnigraph/raml@0.5.55-alpha-386f06970.0
@graphql-mesh/merger-bare@0.14.3-alpha-386f06970.0
@graphql-mesh/merger-federation@0.11.72-alpha-386f06970.0
@graphql-mesh/merger-stitching@0.15.61-alpha-386f06970.0
@graphql-mesh/plugin-live-query@0.1.2-alpha-386f06970.0
@graphql-mesh/plugin-rate-limit@0.0.3-alpha-386f06970.0
@graphql-mesh/plugin-response-cache@0.1.4-alpha-386f06970.0
@graphql-mesh/runtime@0.40.1-alpha-386f06970.0
@graphql-mesh/store@0.8.20-alpha-386f06970.0
@graphql-mesh/transform-cache@0.12.22-alpha-386f06970.0
@graphql-mesh/transform-encapsulate@0.3.68-alpha-386f06970.0
@graphql-mesh/transform-extend@0.10.32-alpha-386f06970.0
@graphql-mesh/transform-federation@0.9.11-alpha-386f06970.0
@graphql-mesh/transform-filter-schema@0.14.67-alpha-386f06970.0
@graphql-mesh/transform-hoist-field@0.1.32-alpha-386f06970.0
@graphql-mesh/transform-mock@0.14.52-alpha-386f06970.0
@graphql-mesh/transform-naming-convention@0.10.57-alpha-386f06970.0
@graphql-mesh/transform-prefix@0.11.56-alpha-386f06970.0
@graphql-mesh/transform-prune@0.0.43-alpha-386f06970.0
@graphql-mesh/transform-rate-limit@0.1.35-alpha-386f06970.0
@graphql-mesh/transform-rename@0.12.57-alpha-386f06970.0
@graphql-mesh/transform-replace-field@0.3.66-alpha-386f06970.0
@graphql-mesh/transform-resolvers-composition@0.12.66-alpha-386f06970.0
@graphql-mesh/transform-snapshot@0.14.33-alpha-386f06970.0
@graphql-mesh/transform-type-merging@0.4.11-alpha-386f06970.0
@graphql-mesh/types@0.77.2-alpha-386f06970.0
@graphql-mesh/urql-exchange@4.0.1-alpha-386f06970.0
@graphql-mesh/utils@0.37.1-alpha-386f06970.0

@ardatan ardatan merged commit 6e6fd4a into master Jul 5, 2022
@theguild-bot theguild-bot mentioned this pull request Aug 11, 2022
@ardatan ardatan deleted the fix-windows-path-resolution branch September 9, 2022 19:23
@theguild-bot theguild-bot mentioned this pull request Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

json-machete:0.9.0 breaks on Windows when loading local files
2 participants