@wiser/create-vacancies-scaffold
v0.0.1
Published
A CLI tool to scaffold Next.js 14+ App Router projects with Job Listings templates. It generates a /jobs route, context providers, reusable components, and sets up Jest with React Testing Library for unit testing. Supports automatic dependency installatio
Keywords
Readme
create-vacancies-scaffold
create-vacancies-scaffold is a CLI tool designed to streamline the setup of Next.js (14+) App Router projects with TypeScript. It automates the scaffolding process by generating a robust file structure—including a job listings page, context providers, reusable components, utilities, and Jest configuration—while handling dependency installation and file conflict resolution.
Table of Contents
Features
Automated Scaffold Generation:
- Creates a
/jobsroute withpage.tsx(including<Hero />and<JobListings />components). - Generates a context file at
/contexts/JobListingsContext.tsx. - Sets up components under
/components/organisms,/components/molecules, and/components/atoms, each with accompanying.module.scssand.test.tsxfiles. - Adds a utility file at
/utils/data/readVacanciesData.tsfor fetching data from a CMS API. - Configures Jest for unit testing with
jest.config.tsandjest.setup.tscopied to the project root. - Automatically updates the project's
tsconfig.jsonto include"types": ["node", "jest", "@testing-library/jest-dom"]if it exists. - Installs necessary dependencies if
--installis set.
- Creates a
Smart File Copying:
- Merges directories if they already exist, prompting for file conflicts (unless
--forceis used). - Copies Jest configuration files from the CLI’s root to the new project root.
- Detects if a
/srcfolder exists in the project and copies scaffold files accordingly, while ensuring public assets remain in the root.
- Merges directories if they already exist, prompting for file conflicts (unless
Command-Line Options:
--force(-f): Overwrite existing files without prompting.--install(-i): Automatically install required dependencies.
Installation
Locally for Development
- Clone the repository:
git clone https://github.com/yourusername/create-vacancies-scaffold.git- Install dependencies
npm install- Link the CLI tool globally
npm linkUsage
Run the CLI in the root directory of your Next.js project
npx create-vacancies-scaffold --install