Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #337 from isoppp/scaffdog
Browse files Browse the repository at this point in the history
replace hygen with scaffdog
  • Loading branch information
isoppp authored Nov 3, 2023
2 parents bc27b7a + b9df287 commit 64aa3e8
Show file tree
Hide file tree
Showing 5 changed files with 1,191 additions and 128 deletions.
3 changes: 3 additions & 0 deletions .scaffdog/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
files: ['*'],
}
36 changes: 36 additions & 0 deletions .scaffdog/react-component.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: 'react-component'
root: './src'
output: ['components/*', 'features/*/components']
ignore: []
questions:
name: 'Please enter component name.(Convert to Pascal case.)'
---

# {{ inputs.name | pascal }}/index.tsx

```markdown
import { FC } from 'react'

type Props = {}

export const {{ inputs.name | pascal }}: FC<Props> = ({}) => {
return <div>{{ inputs.name | pascal }}</div>
}
```

# {{ inputs.name | pascal }}/{{ inputs.name | pascal }}.stories.tsx

```markdown
import { Meta, StoryObj } from '@storybook/react'

import { {{ inputs.name | pascal }} as Component } from './'

export default {
component: Component,
} as Meta<typeof Component>

export const Default: StoryObj<typeof Component> = {
args: {},
}
```
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Setup

- React(Next.js) + Typescript
- Component generation using hygen
- Component generation using scaffdog
- ESLint + Prettier + Husky + ling-staged
- TailwindCSS + clsx
- React Hook Form + zod
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
"name": "my-nextjs-starter",
"version": "1.0.0",
"main": "index.js",
"engines": {
"pnpm": ">=8.6"
},
"packageManager": "[email protected]",
"scripts": {
"start-by-docker": "echo $COMMIT_HASH && npx prisma migrate deploy && node server.js",
"start": "npx prisma migrate deploy && next start",
Expand All @@ -16,6 +14,7 @@
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"gen-c": "hygen component new",
"gen-c2": "scaffdog generate react-component",
"migrate": "dotenv -e .env.development -- prisma migrate dev",
"migrate:reset": "dotenv -e .env.development -- prisma migrate reset",
"migrate:reset:test": "dotenv -e .env.test -- prisma migrate reset --force --skip-seed",
Expand Down Expand Up @@ -74,6 +73,7 @@
"eslint-plugin-storybook": "0.6.15",
"eslint-plugin-tailwindcss": "3.13.0",
"eslint-plugin-unused-imports": "3.0.0",
"scaffdog": "3.0.0",
"vite-tsconfig-paths": "4.2.1",
"vitest": "0.34.6"
},
Expand Down
Loading

0 comments on commit 64aa3e8

Please sign in to comment.