⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

JeffEmery/dev-setup

Repository files navigation

2025 Development Environment

A development environment for creating a modern React based web application.

Framework + Language + Build

React, TypeScript, Vite /w esbuild

Developer Setup for Windows

  • Windows 11 with WSL2

  • WSL Setup from Ubuntu Bash Shell in Windows Terminal

    (type -p wget >/dev/null || (sudo apt update && sudo apt install wget -y)) \
    	&& sudo mkdir -p -m 755 /etc/apt/keyrings \
    	&& out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
    	&& cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
    	&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
    	&& sudo mkdir -p -m 755 /etc/apt/sources.list.d \
    	&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
    	&& sudo apt update \
    	&& sudo apt install gh -y
  • Create new project

    • From a WSL bash shell (Ubuntu in Terminal or bash in Cursor)

    • Create the project in a WSL folder such as ~/code/my-app

    • Run Create Vite command to start a new project pnpx create-vite@latest my-app --template react-ts

    • Initialize the git repository git init -b main

    • Require pnpm package manager, pnpm/only-allow#33 (comment) create the .npmrc file and add setting engine-strict=true

      // .npmrc
      engine-strict=true
      // package.json
      ...
      "engines": {
        "node": ">=24.12.0"
      },
      "devEngines": {
        "packageManager": {
          "name": "pnpm",
          "version": "^10.20.0",
          "onFail": "error"
        }
      },
    • Add security settings to pnmp-workspace.yaml

      # https://pnpm.io/blog/2025/12/05/newsroom-npm-supply-chain-security
      
      strictDepBuilds: true
      
      onlyBuiltDependencies:
        - package-with-necessary-build-scripts
      
      ignoredBuiltDependencies:
        - package-with-unnecessary-build-scripts
      
      minimumReleaseAge: 10080
      
      minimumReleaseAgeExclude:
        - [email protected]
      
      trustPolicy: no-downgrade
      
      trustPolicyExclude:
        - [email protected]
    • Add the necessary packages for the development environment

      • Prettier pnpm add -D prettier

      • Vitest pnpm add -D vitest

      • lint-staged pnpm add -D lint-staged

      • eslint-plugin-react-x, eslint-plugin-react-dom pnpm add -D eslint-plugin-react-x eslint-plugin-react-dom, per VITE_README.md

      • Husky pnpm add -D husky, init pnpx husky init

      • Modify the Husky pre-commit file

      # .husky\pre-commit
      lint-staged
      pnpm test
      • Modify the package.json file for vitest and lint-staged
      // package.json
      "scripts": {
        ...
        "test": "vitest",
        "bench": "vitest bench",
        ...
      },
      ...
      "lint-staged": {
        "*.{js,jsx,ts,tsx}": [
            "eslint --cache --fix"
        ],
        "*.{json,js,ts,jsx,tsx,html}": [
            "prettier --write --ignore-unknown"
        ]
      }
      
      

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published