Skip to content

Conversation

maddrag0n
Copy link
Contributor

@maddrag0n maddrag0n commented May 9, 2025

closes #4976

exposes the cli in exports to be able to programmatically resolve the path at runtime and updates docs.

ie. bin/openapi-codegen.ts

import { exec } from 'node:child_process'

const cliPath = require.resolve('@rtk-query/codegen-openapi/cli')

// you can also use esbuild-runner (esr) or ts-node instead of tsx
exec(`tsx ${cliPath} config.ts`)

Copy link

codesandbox bot commented May 9, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

codesandbox-ci bot commented May 9, 2025

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 7fc110f:

Sandbox Source
@examples-query-react/basic Configuration
@examples-query-react/advanced Configuration
@examples-action-listener/counter Configuration
rtk-esm-cra Configuration

Copy link

netlify bot commented May 9, 2025

Deploy Preview for redux-starter-kit-docs ready!

Name Link
🔨 Latest commit 7fc110f
🔍 Latest deploy log https://app.netlify.com/sites/redux-starter-kit-docs/deploys/681e4d02ea73980008a2a815
😎 Deploy Preview https://deploy-preview-4977--redux-starter-kit-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@maddrag0n maddrag0n force-pushed the feature/add-cli-to-exports branch 3 times, most recently from 25a38af to 1eb8d35 Compare May 9, 2025 18:01
@maddrag0n maddrag0n marked this pull request as draft May 9, 2025 18:25
@maddrag0n
Copy link
Contributor Author

Unfortunately the CI expects every export to be an ES/CJS module with types and everything. the cli itself does not export anything and no types are generated

@markerikson
Copy link
Collaborator

If that's an issue, then per ATTW's docs we ought to be able to specify specific entry points to include or exclude:

@maddrag0n maddrag0n force-pushed the feature/add-cli-to-exports branch from 1eb8d35 to 7fc110f Compare May 9, 2025 18:44
@maddrag0n maddrag0n marked this pull request as ready for review May 9, 2025 18:44
@maddrag0n
Copy link
Contributor Author

@markerikson lmk if you still intend to merge this PR. otherwise feel free to close.

@markerikson
Copy link
Collaborator

@maddrag0n Yeah, I'd like to get to it, but haven't had time or mental energy to do maintenance work lately. Still on my list :)

@markerikson markerikson merged commit 9dd2202 into reduxjs:master Aug 2, 2025
5 checks passed
@markerikson
Copy link
Collaborator

Okay, yeah, seems reasonable. Thanks for your patience here!

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.

Expose codegen CLI from the package exports

2 participants