A project scaffold for React apps, including:
- Styled Components & Styled System
Styled Components is a CSS-in-JS library that allows you to easily style your React components with valid CSS directly inside your component JavaScript. - Babel
Babel allows using the latest JavaScript (and TypeScript) features by rewriting your code to make it compatible with older browsers. - TypeScript
TypeScript is a superset of JavaScript, providing useful features for defining how your app should work. It allows you to strictly define variable types, function parameters and return values, and provides feedback in your development environment (e.g. VS Code). - Webpack
Webpack begins with your program's entry file and crawls through it building a tree of all the other code you use from there. It then processes it based on the provided configuration, ultimately leading to the JavaScript bundle and assets output into a dedicated directory. It also provides HMR (Hot Module Replacement), which replaces only the changed files dynamically as your develop, greatly speeding up the development experience for larger apps/builds. - Jest
Jest will run test files named likemy-component.**test**.tsxand provide the results on the command line. - Prettier
Prettier automatically formats your code so you don't have to! - ESLint
ESLint will give you additional feedback in the IDE and throw errors during build if your code has errors.
This is still a work-in-progress and may still include some configuration problems.
-
Install
brew
Brew is a package manager for macOS that makes it super easy to install development tools./usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -
Install
node(includesnpmandnpx) andgit
Node.js is a headless JavaScript runtime, allowing you to run JavaScript from the command line. NPM is a package manager for Node. Git is a version control system.brew install node git
-
Download this repository as a new project
npxallows you to execute a remotenpmpackage, without having to install it into your project.npx create-from-repo \ -b develop \ -s \ git@github.com:lndwn/react-starter-kit.git \ <dirname> \ && cd <dirname> \ && git init
-
Install dependencies
Thenpm i[nstall]command will look for the nearestpackage.jsonfile, and install all of the libraries listed independeciesanddevDependencies.npm i
-
Start the development server
Thenpm startcommand will look for the nearestpackage.jsonfile, and run the command namedstartin thescriptsobject.npm start
Tests are (usually) simple programs that perform various things on your code to ensure they are working as expected.
npm run testTesting has been setup with jest, ts-jest, and react-testing-library (plus a few other helpers).
A Linter will analyse your code and identify common mistakes in syntax, or code style, based on a set of rules provided.
npm run lintLinting has been setup with eslint. The lint command uses the TypeScript compiler to check types first, then runs ESLint. Running both may be unneccessary, but better to be safe than sorry.
npm run buildBundling is setup to use Webpack, and a few helpful plugins, including:
- GitRevisionPlugin: make some variables available about the current repository
- Webpack Env Plugin: some default environment variables are configured in
webpack.config.js, and will be overrided if provided from the command line