TanStack / query

🤖 Powerful asynchronous state management, server-state utilities and data fetching for the web. TS/JS, React Query, Solid Query, Svelte Query and Vue Query.
https://tanstack.com/query
MIT License
40.09k stars 2.69k forks source link

fix(codemods): Use .cjs extension for CommonJS files #7333

Closed ontanj closed 3 weeks ago

ontanj commented 3 weeks ago

Rename CommonJS files in codemods to distinguish them from ES module files otherwise used in this project.

Fix issue #7154 which occurs since package.json in codemods is removed when publishing, causing module type data to be lost.

The issue can also be fixed by adding package.json to the published package. But since the project mainly uses ES modules it makes sense to use .cjs for the others.

vercel[bot] commented 3 weeks ago

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

1 Ignored Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **query** | ⬜️ Ignored ([Inspect](https://vercel.com/tanstack/query/522ReUMq231UYZqtaXPMaTeMjcq4)) | [Visit Preview](https://query-git-fork-ontanj-main-tanstack.vercel.app) | | Apr 25, 2024 7:01am |
codesandbox-ci[bot] commented 3 weeks ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 32477e8a27688b62ed1e22f23cba90ba9e5a1e08:

Sandbox Source
@tanstack/query-example-angular-basic Configuration
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-svelte-basic Configuration
@tanstack/query-example-vue-basic Configuration
nx-cloud[bot] commented 3 weeks ago

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 32477e8a27688b62ed1e22f23cba90ba9e5a1e08. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 2 targets - [`nx affected --targets=test:format,test:sherif,test:knip,test:eslint,test:lib,test:types,test:build,build,test:attw --parallel=3`](https://cloud.nx.app/runs/Oh6KykO7Oa?utm_source=pull-request&utm_medium=comment) - [`nx run-many --targets=test:format,test:sherif,test:knip,test:eslint,test:lib,test:types,test:build,build,test:attw --parallel=3`](https://cloud.nx.app/runs/3d7nP4bk1m?utm_source=pull-request&utm_medium=comment)

Sent with 💌 from NxCloud.

ontanj commented 3 weeks ago

Another solution to #7154 would of course be to rewrite codemods as ES modules. Is there a reason it is using CommonJS?