Skip to content
This repository was archived by the owner on Oct 2, 2020. It is now read-only.

kojiyamauchi/frontend-dev-starter

Repository files navigation

๐Ÿ›น
Frontend Dev Starter.

Creating Optimization of I Think About Various Things Necessary for the Development of Recently Frontend & Designs.

ใƒผ

๐Ÿ„โ€ Related Repo.

ใƒผ

๐Ÿ„โ€ Usage.

๐Ÿ›น Setup.

  • Clone or Download This Repository in Project Root Dir.
  • When Creating Simple Web Application.
  • When Creating Static Website.
  • Setup Each Files Below.
    • -> package.json / tsconfig.json / .eslintrc.yml / .github/workflows/delivery.yml && ci.yml
  • Initialize package.json
    • -> yarn init
  • Install All Modules.
    • -> yarn or yarn install

๐Ÿ›น Development & Build. ( Manually Build on Local )

  • When Creating Simple Web Application.
    • Development -> yarn dev
    • Build -> yarn build
  • When Creating Static Website.
    • -> gulp

๐Ÿ›น Setting on GitHub. ( When Use Auto Build & Auto Deployment & CI )

  • Use Repositories...
    • Settings -> Branches -> Branch protection rules
      • -> Branch name pattern
        • Add develop
      • -> Protect matching branches
        • Check Require status checks to pass before merging
        • Check Require branches to be up to date before merging
        • Check Build Test
        • Check Jest & ESLint

๐Ÿ›น Build & Deployment. ( Auto Build & Auto Deployment on GitHub )

  • Use GitHub Actions. ( Deployment for Github Pages or Netlify or FTP )
    • When Pull Requests to the develop Branch are Closed & Merged,
      It Will Auto Build in delivery Directory of the Corresponding Branch.
    • Contents of delivery Directory are Deployed to master Branch.
    • Use GitHub Pages. -> Displayed on GitHub Pages.
    • Use Netlify. -> Deploys via Netlify.
    • Use FTP. -> Deploys via FTP.

Choose Which Type of Build & Deployment, Setting in .github/workflows/delivery.yml
Even When Using SSG with Gatsby.

๐Ÿ›น Continuous Integration.

  • When Commit & Push to the Pull Request, ( Only Pull Request to develop Branch )
    • When There is a File Containing Test Code in resource/tests Directory, Jest Will Launch.
    • Statically Analyze Code with ESLint. ( Before That, Husky & Lint Staged also Uses ESLint ๐Ÿ’ฃ )
    • Test the Build at Every Commit.

Choose Launch Jest & ESLint & Test Build & Which Type of Build, Setting in .github/workflows/ci.yml

๐Ÿ›น Update Modules.

  • Check to Latest Version of Modules on package.json ( ncu )
    • -> yarn check-pkg
  • Update to Latest Version of Modules on package.json ( ncu -u )
    • -> yarn update-pkg
  • Re:Install All Modules. ( rm yarn.lock && rm -rf node_modules && yarn install )
    • -> yarn re-install

This Update Method's for Development by Personal Work ๐Ÿค”
To See Which Modules Can to Be Updated Which Version.
Don't Use yarn install --no-lockfile and yarn install --pure-lockfile
Because Want to Use Cache on GitHub Actions.
When Development with Multiple People, Use yarn upgrade
(Don't Remove yarn.lock, for Eliminate Difference in Version of Each Modules.)

๐Ÿ›น Memo.

  • If HardSourceWebpackPlugin's Warning Displayed on Terminal.
    ๐Ÿ”Ž[hardsource:***] Could not freeze...
    Delete HardSourceWebpackPlugin's Cache Dir.
    • -> yarn remove-fasters-cache

ใƒผ

๐Ÿ„โ€ TODO.

โ˜•๏ธ