Skip to content

Commit

Permalink
Refactor(Project-Scaffold): Change generator name for Next.js App
Browse files Browse the repository at this point in the history
  • Loading branch information
nurulakbaral committed Jul 13, 2024
1 parent 57f9469 commit 56dbc13
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 52 deletions.
48 changes: 0 additions & 48 deletions packages/project-scaffold/src/generators/create-next-app/index.ts

This file was deleted.

13 changes: 13 additions & 0 deletions packages/project-scaffold/src/generators/next-app-biome/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { type NodePlopAPI } from 'plop'

export interface TAnswers {
packageManager: 'npm' | 'pnpm' | 'bun'
}

export default function (plop: NodePlopAPI) {
plop.setGenerator('next-app-biome', {
description: 'Setup Biome for Next.js App',
prompts: [],
actions: [],
})
}
13 changes: 13 additions & 0 deletions packages/project-scaffold/src/generators/next-app-clean/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { type NodePlopAPI } from 'plop'

export interface TAnswers {
packageManager: 'npm' | 'pnpm' | 'bun'
}

export default function (plop: NodePlopAPI) {
plop.setGenerator('next-app-clean', {
description: 'Clean Next.js App from Create Next App',
prompts: [],
actions: [],
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export default function (plop: NodePlopAPI) {

return 'Husky initialized successfully!'
})
plop.setGenerator('setup-prettier-eslint', {
description: 'Setup Prettier and ESLint for Next.js project',
plop.setGenerator('next-app-prettier-eslint', {
description: 'Setup Prettier and ESLint for Next.js App',
prompts: [
{
name: 'confirm',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { type NodePlopAPI } from 'plop'

export interface TAnswers {
packageManager: 'npm' | 'pnpm' | 'bun'
}

export default function (plop: NodePlopAPI) {
plop.setGenerator('next-app-structure', {
description: 'Setup Folder Structure for Next.js App (App Router)',
prompts: [],
actions: [],
})
}
6 changes: 4 additions & 2 deletions packages/project-scaffold/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { type NodePlopAPI } from 'plop'

export default async function (plop: NodePlopAPI) {
await plop.load('./generators/create-next-app', {}, true)
await plop.load('./generators/setup-prettier-eslint', {}, true)
await plop.load('./generators/next-app-clean', {}, true)
await plop.load('./generators/next-app-structure', {}, true)
await plop.load('./generators/next-app-prettier-eslint', {}, true)
await plop.load('./generators/next-app-biome', {}, true)
}

0 comments on commit 56dbc13

Please sign in to comment.