Skip to content

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

Merged
lachlancollins merged 4 commits into
TanStack:mainfrom
ontanj:main
Apr 25, 2024
Merged

fix(codemods): Use .cjs extension for CommonJS files#7333
lachlancollins merged 4 commits into
TanStack:mainfrom
ontanj:main

Conversation

@ontanj

@ontanj ontanj commented Apr 24, 2024

Copy link
Copy Markdown
Contributor

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.

Rename CommonJS files in codemods to distinguish them from ES module
files otherwise used in this project.
Resolve an issue occuring since package.json in codemods is removed when
publishing causing module type data to be lost.

Fix issue TanStack#7154
@vercel

vercel Bot commented Apr 24, 2024

Copy link
Copy Markdown

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

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
query ⬜️ Ignored (Inspect) Visit Preview Apr 25, 2024 7:01am

@codesandbox-ci

codesandbox-ci Bot commented Apr 24, 2024

Copy link
Copy Markdown

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 32477e8:

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

@lachlancollins
lachlancollins self-requested a review April 24, 2024 21:48
@nx-cloud

nx-cloud Bot commented Apr 24, 2024

Copy link
Copy Markdown

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 32477e8. 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

Sent with 💌 from NxCloud.

@lachlancollins lachlancollins changed the title bug(codemods): rename CommonJS files to .cjs fix(codemods): Use .cjs extension for CommonJS files Apr 25, 2024
@ontanj
ontanj marked this pull request as draft April 25, 2024 06:16

@lachlancollins lachlancollins left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ontanj
ontanj marked this pull request as ready for review April 25, 2024 06:59
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Apr 25, 2024
@ontanj

ontanj commented Apr 25, 2024

Copy link
Copy Markdown
Contributor Author

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

@lachlancollins
lachlancollins merged commit 2aca521 into TanStack:main Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation package: query-codemods

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants