Skip to content

Commit

Permalink
Merge pull request #10 from South-Paw/gatsby-4
Browse files Browse the repository at this point in the history
4.0.0: Gatsby 4, TypeScript default, Chakra UI and more
  • Loading branch information
South-Paw authored Oct 27, 2022
2 parents 0b9971b + a69d442 commit ffd6f01
Show file tree
Hide file tree
Showing 50 changed files with 33,038 additions and 19,428 deletions.
4 changes: 2 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.cache
.git
coverage
node_modules
public
coverage
src/gatsby-types.d.ts
17 changes: 12 additions & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
{
"root": true,
"parser": "babel-eslint",
"extends": ["airbnb", "plugin:prettier/recommended", "plugin:jest/recommended"],
"extends": [
"airbnb",
"airbnb-typescript",
"airbnb/hooks",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
"import/prefer-default-export": "off",
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"react/function-component-definition": "off",
"react/jsx-props-no-spreading": "off",
"react/jsx-one-expression-per-line": "off"
"react/require-default-props": "off"
},
"overrides": []
}
77 changes: 77 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: CI

on:
push:
branches-ignore:
- "master"
tags-ignore:
- "*.*.*"

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: "18"
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

deploy-to-staging:
name: Deploy to staging
runs-on: ubuntu-latest
needs:
- lint
steps:
- name: Start deployment
uses: bobheadxi/[email protected]
id: deployment
with:
step: start
token: ${{ secrets.GITHUB_TOKEN }}
env: staging

- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: "18"
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Deploy draft to Netlify
uses: netlify/actions/cli@master
id: netlify
with:
# all staging deployments are drafts
args: deploy --dir './public' --message 'staging [${{ github.sha }}]'
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}

- name: Finish deployment
uses: bobheadxi/[email protected]
if: always()
with:
step: finish
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
env_url: ${{ steps.netlify.outputs.NETLIFY_URL }}
52 changes: 52 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Release

on:
push:
tags:
- "*.*.*"
jobs:
deploy-to-production:
name: Deploy to production
runs-on: ubuntu-latest
steps:
- name: Start deployment
uses: bobheadxi/[email protected]
id: deployment
with:
step: start
token: ${{ secrets.GITHUB_TOKEN }}
env: production

- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: "18"
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Deploy to Netlify
uses: netlify/actions/cli@master
id: netlify
with:
args: deploy --prod --dir './public' --message 'production [${{ github.sha }}]'
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}

- name: Finish deployment
uses: bobheadxi/[email protected]
if: always()
with:
step: finish
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
env_url: ${{ steps.netlify.outputs.NETLIFY_URL }}
12 changes: 2 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
# project dependencies
.cache
coverage
node_modules
yarn-error.log

# build directory
public

# generated folders
coverage

# OS generated files
.DS_Store
src/gatsby-types.d.ts
4 changes: 2 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.cache
.git
coverage
node_modules
public
coverage
src/gatsby-types.d.ts
29 changes: 0 additions & 29 deletions .storybook/main.js

This file was deleted.

25 changes: 0 additions & 25 deletions .storybook/preview.js

This file was deleted.

29 changes: 11 additions & 18 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
The MIT License (MIT)
The BSD Zero Clause License (0BSD)

Copyright (c) 2018 Alex Gabites
Copyright (c) 2022 Alex Gabites

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
76 changes: 39 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,68 @@
# @south-paw/awesome-gatsby-starter

👌 A starter for GatsbyJS with a preconfigured MDX, Storybook and ESLint environment

[![Netlify Status][netlify-master-status-img]][netlify-master-status]

> Prefer TypeScript? No worries, try [awesome-gatsby-starter-ts](https://github.com/South-Paw/awesome-gatsby-starter-ts)
👌 A starter for Gatsby 4 with TypeScript, Chakra UI, ESLint and Prettier.

## Features

- [Gatsby MDX](https://www.gatsbyjs.org/packages/gatsby-plugin-mdx/) for creation of pages with Markdown + JSX
- [Storybook](https://storybook.js.org/) with the Storybook Docs addon and support for components that use Gatsby components such as Link and StaticQuery
- [styled-components](https://www.styled-components.com/) for CSS-in-JS
- [ESLint](https://eslint.org/) with [Airbnb's config](https://www.npmjs.com/package/eslint-config-airbnb)
- [Prettier](https://prettier.io/) integrated into ESLint
- A few example components and pages with stories and simple site structure
- TypeScript
- Chakra UI
- ESLint
- Prettier
- Common Gatsby Plugins
- GitHub action workflows for deployment to Netlify

## Getting started
## Getting Started

Install this starter (assuming you have [`gatsby-cli`](https://www.npmjs.com/package/gatsby-cli) installed) by running the following command:
Use this starter for your new project by running the following command:

```bash
gatsby new your-projects-name https://github.com/South-Paw/awesome-gatsby-starter
npx gatsby new your-projects-name https://github.com/South-Paw/awesome-gatsby-starter
```

## Gatsby Plugins

- Image plugins
- [`gatsby-plugin-image`](https://www.gatsbyjs.com/plugins/gatsby-plugin-image)
- [`gatsby-plugin-sharp`](https://www.gatsbyjs.com/plugins/gatsby-plugin-sharp)
- [`gatsby-transformer-sharp`](https://www.gatsbyjs.com/plugins/gatsby-transformer-sharp)
- [`gatsby-source-filesystem`](https://www.gatsbyjs.com/plugins/gatsby-source-filesystem)
- [`gatsby-plugin-manifest`](https://www.gatsbyjs.com/plugins/gatsby-plugin-manifest/)
- Optional (install and uncomment in config)
- [`gatsby-plugin-google-analytics`](https://www.gatsbyjs.com/plugins/gatsby-plugin-google-analytics)
- [`gatsby-plugin-google-tagmanager`](https://www.gatsbyjs.com/plugins/gatsby-plugin-google-tagmanager)
- [`gatsby-plugin-remove-generator`](https://www.gatsbyjs.com/plugins/gatsby-plugin-remove-generator)
- [`gatsby-plugin-sitemap`](https://www.gatsbyjs.com/plugins/gatsby-plugin-sitemap)
- [`@chakra-ui/gatsby-plugin`](https://www.gatsbyjs.com/plugins/@chakra-ui/gatsby-plugin)

## Development

Install [`Node.js`](https://nodejs.org/) and [`Yarn`](https://yarnpkg.com).
Install [`Node.js`](https://nodejs.org/).

Open the project directory in your CLI and run the `yarn` command to install dependencies.
Open the project directory in your CLI and run the `npm i` command to install dependencies.

After that you can run any of following commands

```bash
# local development (localhost:8000)
yarn start
# Local development (localhost:8000)
npm run start

# storybook development (localhost:9000)
yarn start:storybook
# Run linter
npm run lint

# run eslint on project
yarn lint
# Build for deployment (/public)
npm run build

# build site for deployment (/public)
yarn build
# Run gatsby serve
npm run serve

# build storybook for deployment (/public/storybook)
yarn build:storybook

# local gatsby serve of /public
yarn serve

# clean build artifacts (/.cache and /public)
yarn clean
# Run gatsby clean
npm run clean
```

## Issues and Bugs

If you manage to find any, please report them [here](https://github.com/South-Paw/awesome-gatsby-starter/issues) so they can be squashed.
If you find any, please report them [here](https://github.com/South-Paw/awesome-gatsby-starter/issues) so they can be squashed.

## License

MIT, see the [LICENSE](https://github.com/South-Paw/awesome-gatsby-starter/blob/master/LICENSE) file.

[netlify-master-status-img]: https://api.netlify.com/api/v1/badges/f517f897-7c3d-427a-a46f-11e07daa2d96/deploy-status
[netlify-master-status]: https://app.netlify.com/sites/awesome-gatsby-starter/deploys
0BSD, see the [LICENSE](https://github.com/South-Paw/awesome-gatsby-starter/blob/master/LICENSE) file.
7 changes: 0 additions & 7 deletions gatsby-browser.js

This file was deleted.

Loading

0 comments on commit ffd6f01

Please sign in to comment.