This repository serves as a template for creating packages for Ink, a React renderer for command-line apps.
To use this template:
- Clone the repository:
git clone git@github.com:neiropacks/packs-template.git your-package-name cd your-package-name - Install dependencies:
bun install
- Rename the package:
- Update the
namefield inpackage.jsonto your desired package name (e.g.,your-package-name). - If you intend to publish under a different npm scope, update
@neirosinpackage.jsonand in the GitHub Actions workflow (.github/workflows/publish.yml).
- Update the
- Start developing:
- Your main library code should reside in
src/. - Hooks go into
src/hooks/. - Providers go into
src/components/providers/. - Utility functions go into
src/utils/.
- Your main library code should reside in
After setting up the repository and installing dependencies, you can use the following commands:
bun run build: Compiles the TypeScript code into JavaScript and generates type declaration files.bun run lint: Runs ESLint and Biome checks to identify code quality issues.bun run format: Formats the code using Biome and applies ESLint fixes.bun run lint:fix: Applies ESLint fixes to the codebase.bun run biome:check: Runs Biome checks and applies unsafe fixes.
This template is configured to publish to npm automatically when a version tag (e.g., v1.0.0) is pushed to the main branch.
Important:
- Ensure you have set up an
NPM_TOKENsecret in your GitHub repository settings with a valid npm automation token. - Remember to update the package name in
package.jsonbefore publishing.