redux-toolkit icon indicating copy to clipboard operation
redux-toolkit copied to clipboard

feature: add cli to exports

Open maddrag0n opened this issue 6 months ago • 5 comments

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`)

maddrag0n avatar May 09 '25 08:05 maddrag0n

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders
Open Preview

codesandbox[bot] avatar May 09 '25 08:05 codesandbox[bot]

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

codesandbox-ci[bot] avatar May 09 '25 09:05 codesandbox-ci[bot]

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

QR Code

Use your smartphone camera to open QR code link.

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

netlify[bot] avatar May 09 '25 09:05 netlify[bot]

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

maddrag0n avatar May 09 '25 18:05 maddrag0n

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 avatar May 09 '25 18:05 markerikson

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

maddrag0n avatar Jul 28 '25 14:07 maddrag0n

@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 avatar Jul 31 '25 00:07 markerikson

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

markerikson avatar Aug 02 '25 16:08 markerikson