@rohilaharsh/react-kit
v0.1.3
Published
CLI to initialize a React-related toolkit by installing singleton-injection, context-scoped-state, axios, and rxjs using the detected package manager.
Maintainers
Readme
@rohilaharsh/react-kit
A small CLI that installs a React-related toolkit into an existing Node/React project.
It detects your package manager from lockfiles and runs the appropriate install command for:
singleton-injectioncontext-scoped-stateaxiosrxjs
Installation & usage
You do not install this package as a dependency of your app. Instead, run it via your preferred runner:
bunx @rohilaharsh/react-kit init
# or
npx @rohilaharsh/react-kit init
# or
pnpm dlx @rohilaharsh/react-kit init
# or
yarn dlx @rohilaharsh/react-kit initRun the command inside an existing project that already has a package.json.
What it does
- Verifies there is a
package.jsonin the current working directory. - Detects your package manager in this order:
bun.lockb→ Bunpnpm-lock.yaml→ pnpmyarn.lock→ Yarnpackage-lock.json→ npm- Otherwise, falls back to the
packageManagerfield inpackage.jsonif present. - If nothing else matches, defaults to npm.
- Runs the matching install command to add:
singleton-injectioncontext-scoped-stateaxiosrxjs
Local development (with Bun)
This repo is built and tested using Bun.
Install dependencies:
bun installBuild the CLI:
bun run buildRun tests:
bun testPublishing to npm (using Bun)
Before publishing, make sure you are logged in with npm:
npm loginThen use the provided scripts:
# Bump version (patch/minor/major) and create a git tag, per npm conventions
npm version patch
# Or use the generic script wired through Bun
bun run version
# Build and publish
bun run publishThe prepublishOnly hook ensures that the TypeScript sources are compiled to dist/ before npm publish runs.
