redux-toolkit
redux-toolkit copied to clipboard
feature: add cli to exports
closes https://github.com/reduxjs/redux-toolkit/issues/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`)
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 7fc110f23b2b260d5b3b2deecb253e8f8be1f16f:
| Sandbox | Source |
|---|---|
| @examples-query-react/basic | Configuration |
| @examples-query-react/advanced | Configuration |
| @examples-action-listener/counter | Configuration |
| rtk-esm-cra | Configuration |
Deploy Preview for redux-starter-kit-docs ready!
| Name | Link |
|---|---|
| Latest commit | 7fc110f23b2b260d5b3b2deecb253e8f8be1f16f |
| 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...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
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
If that's an issue, then per ATTW's docs we ought to be able to specify specific entry points to include or exclude:
- https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/packages/cli/README.md#entrypoints
@markerikson lmk if you still intend to merge this PR. otherwise feel free to close.
@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 :)
Okay, yeah, seems reasonable. Thanks for your patience here!