Skip to content

feature: add cli to exports #4977

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

maddrag0n
Copy link

@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
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
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