@rtorcato/js-tooling
v1.1.0
Published
JavaScript and TypeScript tooling for Node.js, React, Next.js, and Vitest.
Readme
js-tooling
A comprehensive collection of JavaScript/TypeScript development tools and configurations for modern projects.
Installation
Install the package globally or use it directly with npx:
# Or use with npx
npx @rtorcato/js-tooling setupGetting started
Use the interactive CLI to set up tooling for your project:
npx @rtorcato/js-tooling setupOr import specific configurations:
import '@rtorcato/js-tooling/typescript/base';Available Tools
This package includes configurations and presets for:
- TypeScript - Base configurations for different project types
- ESLint - Linting rules for JavaScript and TypeScript
- Prettier - Code formatting configuration
- Biome - Fast linter and formatter
- Vitest - Testing framework configuration
- Jest - Testing framework presets
- Commitlint - Commit message linting
- Semantic Release - Automated versioning and publishing
- GitHub Actions - CI/CD workflow templates
- And more...
CI/CD Setup
The package includes GitHub Actions workflows and semantic-release configuration. For automated publishing, set these secrets in your GitHub repository:
NPM_TOKEN- npm authentication token for publishing packagesGITHUB_TOKEN- automatically provided by GitHub Actions
Repository settings: https://github.com/your-username/your-repo/settings/secrets/actions
CLI Commands
The package provides several CLI commands:
# Interactive project setup wizard
npx @rtorcato/js-tooling setup
# Copy configuration files to current directory
npx @rtorcato/js-tooling copy biome
npx @rtorcato/js-tooling copy tsconfig
# List all available configurations
npx @rtorcato/js-tooling list
# Run commit message helper
npx @rtorcato/js-tooling commitmessage
# Hello world example
npx @rtorcato/js-tooling helloworldConfiguration Usage
Biome (Formatter & Linter)
Since Biome doesn't support configuration extension, use the copy command to get the base configuration:
# Copy base Biome configuration
npx @rtorcato/js-tooling copy biomeThis creates a biome.json file with:
- Tab indentation, 100 character line width
- Single quotes, ES5 trailing commas
- Recommended linting rules with sensible overrides
- Smart file patterns excluding build directories
After copying, customize for your project:
{
"linter": {
"rules": {
"recommended": true,
"suspicious": {
"noExplicitAny": "error"
}
}
}
}TypeScript
Import TypeScript configurations directly in your tsconfig.json:
{
"extends": "@rtorcato/js-tooling/typescript/base"
}Available configurations:
typescript/base- Base configuration for all projectstypescript/react- React-specific settingstypescript/next- Next.js optimized configurationtypescript/node- Node.js server configurationtypescript/express- Express.js API configuration
ESLint
// eslint.config.js
import baseConfig from '@rtorcato/js-tooling/eslint/base'
import nextjsConfig from '@rtorcato/js-tooling/eslint/nextjs'
export default [
...baseConfig,
// Add project-specific rules
]Commitlint
// commitlint.config.js
import config from '@rtorcato/js-tooling/commitlint/config'
export default configVitest
// vitest.config.js
import { defineConfig } from 'vitest/config'
import baseConfig from '@rtorcato/js-tooling/vitest/config'
export default defineConfig({
...baseConfig,
// Add project-specific settings
})Semantic Release
// release.config.js
import config from '@rtorcato/js-tooling/semantic-release/github'
export default configUsing with Package Managers
With pnpm
# Temporarily install and run
pnpm --package=@rtorcato/js-tooling dlx setup
# Or install globally
pnpm add -g @rtorcato/js-toolingWith npm
# Use directly
npx @rtorcato/js-tooling setup
# Or install globally
npm install -g @rtorcato/js-toolingDevelopment
To work on this package locally:
Clone the repository:
git clone https://github.com/rtorcato/js-tooling.git cd js-toolingInstall dependencies:
pnpm installBuild the CLI:
pnpm run build-cliLink globally for testing:
pnpm link --global
For more details, refer to the pnpm link documentation.
Status
Contributing
Contributions are welcome! Please read our contributing guidelines and feel free to submit issues and pull requests.
License
This project is licensed under the MIT License - see the LICENSE file for details.
