How to use this template

  1. Create repository from template

    gh repo create --clone --template castdin/quickstart-nextjs --private $projectName
    
  2. Install dependencies

    bun install
    

How to update this template

Updating dependencies

rm bun.lockb
jq '.dependencies | keys[]' package.json | xargs bun add $1
jq '.devDependencies | keys[]' package.json | xargs bun add --dev $1

Updating all files

  1. Clone template repository

    git clone git@github.com:castdin/quickstart-nextjs.git
    
  2. Reset Git index

    git rm -rf .
    
    git clean -fxd
    
    git reset
    
  3. Re-create NextJS project

    bunx create-next-app . --typescript --eslint --tailwind --src-dir --app --use-bun
    
  4. Change dependencies to range versions

    jq '.dependencies | keys[]' package.json | xargs bun add $1
    
    jq '.devDependencies | keys[]' package.json | xargs bun add --dev $1
    
  5. Sort dependencies in package.json

    bunx sort-package-json
    
  6. Add Prettier dependencies

    bun add --dev prettier eslint-config-prettier prettier-plugin-tailwindcss prettier-plugin-css-order
    
  7. Create or update the following configuration files:

    • .editorconfig

      root = true
      
      [*]
      indent_style = tab
      insert_final_newline = true
      trim_trailing_whitespace = true
      
    • .eslintrc.json

      {
      	"extends": ["next", "prettier"]
      }
    • .prettierrc.json

      {
      	"plugins": ["prettier-plugin-tailwindcss"]
      }
  8. Run Prettier

    bun prettier --write .