Skip to main content

Getting Started

Installationโ€‹

npx @rtorcato/js-tooling setup

What it looks likeโ€‹

Terminal
$ npx @rtorcato/js-tooling setup

๐Ÿ› ๏ธ Welcome to JS Tooling Setup!

Setting up tooling in: /home/user/my-lib

? ๐Ÿ“ฆ What is your project name? my-lib
? ๐Ÿ—๏ธ What type of project are you building? ๐Ÿ“š Library/Package
? ๐Ÿ“˜ Do you want to use TypeScript? Yes
? โš™๏ธ Which TypeScript configuration? ๐Ÿ”ง Base (General purpose)
? ๐Ÿ” Which linting/formatting tool? โšก Biome (Fast, all-in-one)
? ๐Ÿงช Which testing framework? โšก Vitest (Fast, Vite-powered)
? ๐Ÿช Set up Git hooks (Husky + lint-staged)? Yes
? ๐Ÿ“ Set up conventional commit linting? Yes
? ๐Ÿš€ Set up semantic release for automated versioning? Yes
? ๐Ÿ›ก๏ธ Include security automation (Dependabot + CodeQL)? Yes
? ๐Ÿ“ฆ Which bundler/build tool? ๐Ÿ“ฆ tsup (TypeScript packages)

๐Ÿ“ Generating configuration files...

โœ… Setup completed successfully!

๐Ÿ“‹ Next Steps:

1. ๐Ÿ”ง Customize your tsconfig.json as needed
2. ๐Ÿ” Run linting with: pnpm biome check .
3. ๐Ÿงช Run tests with: pnpm vitest
4. ๐Ÿช Commit your changes to test the git hooks
5. ๐Ÿ“– Check the generated README.md for more details

Setup wizardโ€‹

Running setup (or its alias init) launches an interactive wizard:

PromptOptions
Project namedefaults to directory name
Project typelibrary, web-app, node-api, nextjs-app, react-app
TypeScript?yes/no
TS config variantbase, react, next, node, express (context-filtered)
Linting/formatting toolbiome (recommended), eslint, both, none
ESLint config (if ESLint)base or nextjs
Testing frameworkvitest (recommended), jest, playwright, none
Test environment (if Jest)node, browser, both
Git hooks (Husky + lint-staged)?yes/no
Conventional commit linting?yes/no (if git hooks enabled)
Semantic release?yes/no (library projects only)
Security automation (Dependabot + CodeQL)?yes/no
Bundlertsup, esbuild, vite (web apps), none

A universal baseline (.editorconfig, .nvmrc, engines.node, knip.json) is scaffolded automatically โ€” no prompt โ€” because these are safe defaults for every project.

Files generatedโ€‹

  • package.json โ€” merged with chosen devDependencies, scripts, and engines.node
  • .editorconfig, .nvmrc, knip.json โ€” universal baseline
  • tsconfig.json โ€” extends the matching preset
  • biome.json / eslint.config.js + prettier.config.js โ€” based on linting choice
  • vitest.config.js / jest.config.js โ€” testing config
  • .husky/pre-commit, commitlint.config.js โ€” if git hooks chosen
  • release.config.js โ€” if semantic release chosen
  • .github/workflows/ci.yml โ€” CI workflow
  • .github/dependabot.yml, .github/workflows/codeql.yml โ€” if security automation chosen
  • README.md โ€” project README scaffold
  • reset.d.ts โ€” ts-reset type augmentation (if TypeScript)

Existing projects: doctor + fixโ€‹

For repos that already exist, don't rerun setup (it's a fresh-project wizard and would clobber your configs). Use doctor to find drift, then fix to apply scaffolders incrementally:

npx @rtorcato/js-tooling doctor # see what's missing or drifted
npx @rtorcato/js-tooling fix # walk every finding, prompting per item
npx @rtorcato/js-tooling fix dependabot # or apply just one

fix defaults to No when overwriting existing files โ€” your customisations are preserved unless you explicitly opt in (or pass --yes). See CLI reference for full details.

Using specific configs without the wizardโ€‹

If you only need one config file, use copy:

npx @rtorcato/js-tooling copy biome # โ†’ biome.json
npx @rtorcato/js-tooling copy tsconfig # โ†’ tsconfig.json

Or import configs directly in your own files:

import '@rtorcato/js-tooling/typescript/base'

CI/CD secretsโ€‹

For automated publishing via Semantic Release, add these to your GitHub repository secrets:

  1. NPM_TOKEN โ€” npm authentication token
  2. GITHUB_TOKEN โ€” automatically provided by GitHub Actions

Settings โ†’ Secrets and variables โ†’ Actions