kamilkisiela / graphql-config

One configuration for all your GraphQL tools (supported by most tools, editors & IDEs)
https://the-guild.dev/graphql/config
MIT License
1.16k stars 94 forks source link

Support ESM and .mts/.cts extensions with jiti loader #1286

Closed beerose closed 1 year ago

beerose commented 1 year ago

Description

A second approach to adding ESM support. The previous one included using tsc and custom caching and this caching bit had a bunch of edge cases that I wasn't aware of in the beginning.

I replaced it with jiti loader and added more test cases. jiti is much faster than running tsc (similar time to cosmic loader).

Related to issues in graphql-code-generator: https://github.com/dotansimha/graphql-code-generator/issues/8509 and https://github.com/dotansimha/graphql-code-generator/issues/8862. More context in this PR: https://github.com/dotansimha/graphql-code-generator/pull/9086.

Type of change

How Has This Been Tested?

Extended existing tests.

Test Environment:

Checklist:

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

github-actions[bot] commented 1 year ago

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets): Package Version Info
graphql-config 4.5.0-alpha-20230306151301-d7b29ec npm ↗︎ unpkg ↗︎
github-actions[bot] commented 1 year ago
### 💻 Website Preview The latest changes are available as preview in: [https://89159711.graphql-config.pages.dev](https://89159711.graphql-config.pages.dev)
github-actions[bot] commented 1 year ago
diff --git a/website/algolia-lockfile.json b/website/algolia-lockfile.json
index 802afac..05f4d98 100644
--- a/website/algolia-lockfile.json
+++ b/website/algolia-lockfile.json
@@ -72,7 +72,7 @@
         "anchor": "examples"
       }
     ],
-    "content": "5d4cca1d7d43f0035cfd8e97b7621806",
+    "content": "3f2010b9337e2dba13844da178eeceac",
     "url": "https://www.the-guild.dev/graphql/config/docs/",
     "domain": "https://www.the-guild.dev/graphql/config",
     "hierarchy": [