All Projects → gojutin → Gatsby Starter Typescript Deluxe

gojutin / Gatsby Starter Typescript Deluxe

Licence: mit
A Gatsby starter with TypeScript, Storybook, Styled Components, Framer Motion, Jest, and more.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Gatsby Starter Typescript Deluxe

react-component-library-lerna
Build your own React component library managed with lerna, presented with storybook and published in private npm registry.
Stars: ✭ 55 (+10%)
Mutual labels:  eslint, styled-components, storybook
Gatsby V2 Tutorial Starter
Gatsby V2 Starter - product of step by step tutorial
Stars: ✭ 139 (+178%)
Mutual labels:  eslint, gatsby, styled-components
Quantum
The default pack of components and layout principles that dictates Catho Frontend applications.
Stars: ✭ 39 (-22%)
Mutual labels:  styled-components, storybook
Tslint Config Standard
A TSLint config for JavaScript Standard Style
Stars: ✭ 358 (+616%)
Mutual labels:  eslint, tslint
Gatsby Starter Strict
A Gatsby starter with strict linting and auto-formatting rules.
Stars: ✭ 43 (-14%)
Mutual labels:  eslint, gatsby
Lint Review
An automated code linting bot that integrates various code lint tools with github pull requests.
Stars: ✭ 279 (+458%)
Mutual labels:  eslint, tslint
React Bolt
⚡ The most simple & robust boilerplate for your React projects.
Stars: ✭ 298 (+496%)
Mutual labels:  eslint, styled-components
React Typescript Web Extension Starter
🖥 A Web Extension starter kit built with React, TypeScript, SCSS, Storybook, Jest, EsLint, Prettier, Webpack and Bootstrap. Supports Google Chrome + Mozilla Firefox + Brave Browser 🔥
Stars: ✭ 510 (+920%)
Mutual labels:  eslint, storybook
v2
Hack Club’s (old) website ✨
Stars: ✭ 101 (+102%)
Mutual labels:  styled-components, gatsby
Bonneville
A simple, clean GatsbyJS starter for those looking to get up and running with Gatsby
Stars: ✭ 23 (-54%)
Mutual labels:  gatsby, styled-components
Tslint To Eslint Config
Converts your TSLint configuration to the closest possible ESLint equivalent. 🚀
Stars: ✭ 680 (+1260%)
Mutual labels:  eslint, tslint
React Redux Saga Starter
Basic, Opinionated starter kit for React+Redux+Redux Saga with support for SCSS CSS Modules, Storybook, JEST testing, and ESLint
Stars: ✭ 12 (-76%)
Mutual labels:  eslint, storybook
V4
Fourth iteration of my personal website built with Gatsby
Stars: ✭ 4,114 (+8128%)
Mutual labels:  gatsby, styled-components
SENT-template
Skip setup and start code with SENT (Sapper Express Node Template) and other tools
Stars: ✭ 69 (+38%)
Mutual labels:  eslint, storybook
Moveit
🚀 NLW #4 | React+ TypeScript + NextJS + StyledComponents + Firebase + MongoDb +Axios
Stars: ✭ 39 (-22%)
Mutual labels:  styled-components, storybook
personal-website-react
A personal website built using Gatsby 🚀⚛️
Stars: ✭ 43 (-14%)
Mutual labels:  styled-components, gatsby
Lynt
✨ A zero config JavaScript linter with support for Typescript, Flow, and React.
Stars: ✭ 390 (+680%)
Mutual labels:  eslint, tslint
React Ssr Starter
All have been introduced React environment
Stars: ✭ 20 (-60%)
Mutual labels:  eslint, styled-components
react-enterprise-starter-kit
Highly Scalable Awesome React Starter Kit for an enterprise application with a very easy maintainable codebase. 🔥
Stars: ✭ 55 (+10%)
Mutual labels:  eslint, storybook
eleventy-react
Use React components in Eleventy.
Stars: ✭ 66 (+32%)
Mutual labels:  styled-components, storybook

gatsby-starter-typescript-deluxe 🌟

An opinionated starter library for creating React applications with Gatsby and TypeScript.

View Demo Netlify Status

This starter library is pre-configured with the following integrations:

  • TypeScript for type-safe code.
  • Styled-Components for all your styles.
  • modern-css-reset for a reset of sensible default styles.
  • Framer Motion for awesome animations.
  • gatsby-image and gatsby-transformer-sharp for optimized images.
  • gatsby-plugin-manifest / SEO component for an SEO-friendly PWA.
  • Storybook with add-ons for showing off your awesome components.
  • Jest and React Testing library for snapshots and unit tests.
  • ESLint with an emphasis on functional patterns (with Prettier and TypeScript integration) to make your code look its best.
  • React Axe and React A11y for accessibility so that your site is awesome for everyone.

Installation

You will need to have node and npm installed on your computer.

You can either use npx or install the gatsby-cli globally.

The npx way:

npx gatsby new my-site https://github.com/gojutin/gatsby-starter-typescript-deluxe

or the global way:

npm i -g gatsby-cli
gatsby new my-site https://github.com/gojutin/gatsby-starter-typescript-deluxe

Usage

To start the development servers:

npm run develop

If all was successful, you should see links to two development servers in the Node terminal. You can open these url in any browser that you would like.

  1. http://localhost:8080:

This is the development server that allows you to preview your website. It comes with hot-module reloading, which means that you should see your changes almost immediately without having to refresh the browser tab.

  1. http://localhost:8000/___graphql:

This is the development server that allows you to interact with the your site's GraphQL data via the GraphiQL IDE.

Available Scripts

Script Description
develop Start the development server with hot module reloading.
dev Alias for develop.
format Format your code with Prettier.
clean Delete the .cache and public directories.
test Run your Jest tests once.
test:watch Run your Jest tests in watch mode.
lint Lint your code with ESLint.
lint:watch Lint your code with ESLint in watch mode.
lint:fix Lint your code with ESLint and attempt to fix linting issues.
serve Serve the production build of your site for testing.
build Compile your application and make it ready for deployment
storybook Starts Storybook.
build-storybook Compiles your stories and makes them ready for deployment.
update Updates the package.json to the latest dependency versions using npm-check-updates.

Styling

This library is pre-configured with styled-components.

Global Styles

Global styles are defined in the src/styles/global-styles.tsx file using the createGlobalStyle function provided by styled-components. The global styles are injected in the Layout component via the component that is provided from the createGlobalStyle function.

The global style also includes the styles from css-modern-reset, which aims to provide a sensible reset of browser styles.

Theme

You can define your theme styles in the /src/styles/theme file. The theme will be available in any styled-component via props.theme and to any other component via the useTheme hook.

Handling Media Queries

The theme utilizes the use-media library, which allows you to track the state of a CSS media queries. This works by passing a boolean for each screen size that you defined in your theme. Just define your screen sizes in src/styles/theme.

Styling Examples

src/pages/about.tsx includes various examples (with comments) of using styled-components and framer-motion with the theme provider.

The CSS Prop

This starter is also preconfigured to work with the css prop:

import styled from "styled-components";

const MyComponent = () => (
  <div>
    <h1
      css={`
        color: #333;
      `}
    >
      Hello World!
    </h1>
  </div>
);

Note: The css prop does not play nicely with the jsx-no-multiline-js ESLint rule. You may want to disable the rule if you plan on using the css prop. This can be done in the .eslintrc.js file.

I personally do not use the css prop and prefer to define styled-components outside of the component definition. My general rule is if the component that is using a styled-component is the only component that uses it, I define the styled-component in the same file. Otherwise, I will move it out to a components/common directory.

import styled from "styled-components";

const Heading = styled.h1`
  color: #333;
`;

const MyComponent = () => (
  <div>
    <Heading>Hello World!</Heading>
  </div>
);

CSS Debugger

This starter also includes a CSSDebugger component. This component allows you to easily debug your styles by drawing outlines around all elements and applying a grid in the background. It also includes a toggle button that you can optionally use during debugging.

Note: You can drag the toggle button around if it gets in your way.

The CSSDebugger component is used in the layout.tsx component.

GIF of css debugger

Linting

This project includes a combination of ESLint and React-A11y rules for React and TypeScript code, which are extended from the eslint-config-gojutin npm package. Many of the rules favor a functional approach with a strong emphasis on immutability and strong type definitions. Since all of the rules and dependencies are included in this package, you can easily remove it if you prefer to wire up your own linting configuration.

The rules are listed as key/value pairs. The key represents the rule name and the value (number) represents the setting of the rule:

0 off
1 warn
2 error

Here is an example of a rule:

"immutable/no-this": 2

This particular rule disallows the use of the this keyword, which will result in an error.

Storybook

Storybook is available by creating stories in the src/stories directory and running the npm run storybook script. Your storybook will be availble at http://localhost:6006.

You can also compile a production build of your Storybook by running npm run build:storybook. The compiled production build will be located in a /storybook-static directory.

Deployment

Lint your files and fix all linting issues.

npm run lint

Run your test suite and fix any broken tests.

npm run test

Compile a production build to the /public directory.

npm run build

Lighthouse Audit Score 💯

Lighthouse Score

TODOS

  • Write more robust unit tests for all components and custom hook.
  • Possibly add support for MDX and markdown.
  • Add more Storybook add-ons with more component demos.

That's about it. Now, build something awesome 😀

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].