Skip to content
Source
Sign inSign up
TanStack/query

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

Mergedontanj(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/7333/headmerged by lachlancollins(GitHub profile, opens in a new tab) View on GitHub

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.

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

      1 Ignored Deployment
      NameStatusPreviewCommentsUpdated (UTC)
      query⬜️ Ignored (Inspect)Visit PreviewApr 25, 2024 7:01am
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: query-codemods

    3. 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:

      SandboxSource
      @tanstack/query-example-angular-basicConfiguration
      @tanstack/query-example-react-basic-typescriptConfiguration
      @tanstack/query-example-solid-basic-typescriptConfiguration
      @tanstack/query-example-svelte-basicConfiguration
      @tanstack/query-example-vue-basicConfiguration
    4. ☁️ 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

    5. Sent with 💌 from NxCloud.

  • github-actions[bot](GitHub profile, opens in a new tab) added labelsdocumentation

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

  • Sign in to join this conversation.