Skip to content

Commit

Permalink
feat(tooling)!: ✨ add turbo repo to local & ci pipeline
Browse files Browse the repository at this point in the history
- Added turbo & enabled vercel remote caching
- Improved release pipeline with fancy looking changelog
- Combine many lint script actions into `ci.yml` with turbo
- Fix semantic-pr-title issue with token
  • Loading branch information
navin-moorthy authored Apr 5, 2023
1 parent 30a7072 commit 481bcc6
Show file tree
Hide file tree
Showing 32 changed files with 550 additions and 404 deletions.
5 changes: 4 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,16 @@ jspm_packages
# Storybook Build
storybook-static

# Turbo Repo
.turbo

# Lock files
package-lock.json
yarn.lock
pnpm-lock.yaml

# Custom
release-it/commit.hbs
release-it/**/*.hbs
release-it/remote-commits.json
release-it/conventionalChangelogWriterOptsTransform.cjs

Expand Down
3 changes: 2 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ module.exports = {
},
},
{
files: ["*.tsx"],
files: ["*.tsx", "use*.ts"],
extends: [
"canonical/react",
"canonical/jsx-a11y",
Expand All @@ -147,6 +147,7 @@ module.exports = {
"react/forbid-component-props": "off",
"react/prop-types": "off",
"react/jsx-handler-names": "off",
"react/jsx-curly-newline": "off",
},
settings: {
tailwindcss: {
Expand Down
69 changes: 39 additions & 30 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

Thanks for your interest in contributing to `next-react-app`! 💖

> After this page, see [DEVELOPMENT.md](./DEVELOPMENT.md) for local development
> instructions.
> After this page, see [DEVELOPMENT.md][1] for local development instructions.
## Table of Contents

Expand All @@ -19,17 +18,15 @@ Thanks for your interest in contributing to `next-react-app`! 💖

## Code of Conduct

This project contains a
[Contributor Covenant code of conduct](./CODE_OF_CONDUCT.md) all contributors
are expected to follow.
This project contains a [Contributor Covenant code of conduct][2] all
contributors are expected to follow.

## Reporting Issues

Please do
[report an issue on the issue tracker](https://github.com/timelessco/next-react-app/issues/new/choose)
if there's any bugfix, documentation improvement, or general enhancement you'd
like to see in the repository! Please fully fill out all required fields in the
most appropriate issue form.
Please do [report an issue on the issue tracker][3] if there's any bugfix,
documentation improvement, or general enhancement you'd like to see in the
repository! Please fully fill out all required fields in the most appropriate
issue form.

## Sending Contributions

Expand All @@ -42,31 +39,27 @@ steps involved:
### Finding an Issue

With the exception of very small typos, all changes to this repository generally
need to correspond to an
[open issue marked as `accepting prs` on the issue tracker](https://github.com/timelessco/next-react-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22accepting+prs%22).
If this is your first time contributing, consider searching for
[unassigned issues that also have the `good first issue` label](https://github.com/timelessco/next-react-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22accepting+prs%22+label%3A%22good+first+issue%22+no%3Aassignee).
If the issue you'd like to fix isn't found on the issue, see
[Reporting Issues](#reporting-issues) for filing your own (please do!).
need to correspond to an [open issue marked as `accepting prs` on the issue
tracker][4]. If this is your first time contributing, consider searching for
[unassigned issues that also have the `good first issue` label][5]. If the issue
you'd like to fix isn't found on the issue, see [Reporting Issues][6] for filing
your own (please do!).

### Sending a Pull Request

Once you've identified an open issue accepting PRs that doesn't yet have a PR
sent, you're free to send a pull request. Be sure to fill out the pull request
template's requested information -- otherwise your PR will likely be closed.

PRs are also expected to have a title that adheres to
[commitlint](https://github.com/conventional-changelog/commitlint). Only PR
PRs are also expected to have a title that adheres to [commitlint][7]. Only PR
titles need to be in that format, not individual commits. Don't worry if you get
this wrong: you can always change the PR title after sending it. Check
[previously merged PRs](https://github.com/timelessco/next-react-app/pulls?q=is%3Apr+is%3Amerged+-label%3Adependencies+)
for reference.
[previously merged PRs][8] for reference.

#### Draft PRs

If you don't think your PR is ready for review,
[set it as a draft](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request#converting-a-pull-request-to-a-draft).
Draft PRs won't be reviewed.
If you don't think your PR is ready for review, [set it as a draft][9]. Draft
PRs won't be reviewed.

#### Pull Request Reviews

Expand All @@ -75,15 +68,31 @@ manually `@` tag anybody to request review. A maintainer will look at it when
they're next able to.

After a maintainer reviews your PR, they may request changes on it. Once you've
made those changes,
[re-request review on GitHub](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/about-pull-request-reviews#re-requesting-a-review).
made those changes, [re-request review on GitHub][10].

Please try not to force-push commits to PRs that have already been reviewed.
Doing so makes it harder to review the changes. We squash merge all commits so
there's no need to try to preserve Git history within a PR branch.

Once your PR is merged, if you haven't yet been added to the
[_Contributors_ table in the README.md](../README.md#contributors) for its
[type of contribution](https://allcontributors.org/docs/en/emoji-key "Allcontributors emoji key"),
you should be soon. Please do ping the maintainer who merged your PR if that
doesn't happen within 24 hours - it was likely an oversight on our end!
Once your PR is merged, if you haven't yet been added to the [_Contributors_
table in the README.md][11] for its [type of contribution][12], you should be
soon. Please do ping the maintainer who merged your PR if that doesn't happen
within 24 hours - it was likely an oversight on our end!

[1]: ./DEVELOPMENT.md
[2]: ./CODE_OF_CONDUCT.md
[3]: https://github.com/timelessco/next-react-app/issues/new/choose
[4]:
https://github.com/timelessco/next-react-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22accepting+prs%22
[5]:
https://github.com/timelessco/next-react-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22accepting+prs%22+label%3A%22good+first+issue%22+no%3Aassignee
[6]: #reporting-issues
[7]: https://github.com/conventional-changelog/commitlint
[8]:
https://github.com/timelessco/next-react-app/pulls?q=is%3Apr+is%3Amerged+-label%3Adependencies+
[9]:
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request#converting-a-pull-request-to-a-draft
[10]:
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/about-pull-request-reviews#re-requesting-a-review
[11]: ../README.md#contributors
[12]: https://allcontributors.org/docs/en/emoji-key "Allcontributors emoji key"
60 changes: 36 additions & 24 deletions .github/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
Before you get started, you will need to have the following tools installed on
your machine:

- **[Node.js](https://nodejs.org/en/)** (version 12 or later)
- **[pnpm](https://pnpm.io/)** (version 7 or later)
- **[Git](https://git-scm.com/)** (optional, but recommended for version
control)
- **[Node.js][1]** (version 12 or later)
- **[pnpm][2]** (version 5 or later) or **[npm][3]** or **[yarn][4]** (version 6
or later)
- **[Git][5]** (optional, but recommended for version control)

> This repository includes a list of suggested VS Code extensions. It's a good
> idea to use [VS Code](https://code.visualstudio.com) and accept its suggestion
> to install them, as they'll help with development.
> idea to use [VS Code][6] and accept its suggestion to install them, as they'll
> help with development.
## Getting Started

Expand Down Expand Up @@ -95,23 +95,22 @@ pnpm start

## Deploying the project

Guide on how to deploy Next.js to various
[hosting providers](https://nextjs.org/docs/deployment).
Guide on how to deploy Next.js to various [hosting providers][7].

## More DX scripts

> Check for all the below errors in one command
> Check for all the below errors in one command using [Turbo Repo][8]
`pnpm lint`

> AutoFix all the linting errors in one command
> AutoFix all the linting errors in one command using [Turbo Repo][8]
`pnpm format`

### Prettier

[Prettier](https://prettier.io) is used to format code. It should be applied
automatically when you save files in VS Code or make a Git commit.
[Prettier][9] is used to format code. It should be applied automatically when
you save files in VS Code or make a Git commit.

> Check the formatting errors
Expand All @@ -127,9 +126,8 @@ automatically when you save files in VS Code or make a Git commit.
### Eslint

Extends all the necessary rulesets from
[eslint-config-canonical](https://github.com/gajus/eslint-config-canonical) for
the Next.js project that lints JavaScript and TypeScript source files
Extends all the necessary rulesets from [eslint-config-canonical][10] for the
Next.js project that lints JavaScript and TypeScript source files

> Check for the linting errors
Expand All @@ -141,7 +139,7 @@ the Next.js project that lints JavaScript and TypeScript source files

### Stylelint

([Stylelint](https://stylelint.io/)): Checks all css files
([Stylelint][11]): Checks all css files

> Check the css linting errors
Expand All @@ -153,8 +151,7 @@ the Next.js project that lints JavaScript and TypeScript source files

### Markdown

([Markdownlint](https://github.com/DavidAnson/markdownlint)): Checks all
Markdown files
([Markdownlint][12]): Checks all Markdown files

> Check the markdown linting errors
Expand All @@ -166,33 +163,31 @@ Markdown files

### Check Types

([TypeScript](https://www.typescriptlang.org/)): Checks all TypeScript files
([TypeScript][13]): Checks all TypeScript files

> Check TypeScript types
`pnpm lint:types`

### Check unused dependencies, exports & types

([knip](https://github.com/webpro/knip)): Checks all unused dependencies,
exports & types
([knip][14]): Checks all unused dependencies, exports & types

> Check the spelling errors
`pnpm lint:knip`

### Check Spelling

([cspell](https://cspell.org)): Spell checks across all source files
([cspell][15]): Spell checks across all source files

> Check the spelling errors
`pnpm lint:spelling`

### Check package.json

([npm-package-json-lint](https://npmpackagejsonlint.org/)): Lints the
`package.json` file
([npm-package-json-lint][16]): Lints the `package.json` file

> Check the package.json linting errors
Expand All @@ -203,3 +198,20 @@ exports & types
> Run the test suite
`pnpm test`

[1]: https://nodejs.org/en/
[2]: https://pnpm.io/
[3]: https://www.npmjs.com/
[4]: https://yarnpkg.com/
[5]: https://git-scm.com/
[6]: https://code.visualstudio.com
[7]: https://nextjs.org/docs/deployment
[8]: https://turbo.build/repo
[9]: https://prettier.io
[10]: https://github.com/gajus/eslint-config-canonical
[11]: https://stylelint.io/
[12]: https://github.com/DavidAnson/markdownlint
[13]: https://www.typescriptlang.org/
[14]: https://github.com/webpro/knip
[15]: https://cspell.org
[16]: https://npmpackagejsonlint.org/
12 changes: 7 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ Otherwise we may not be able to review your PR. -->
## PR Checklist

- [ ] Addresses an existing open issue: fixes #000
- [ ] That issue was marked as
[`status: accepting prs`](https://github.com/timelessco/next-react-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22)
- [ ] Steps in
[CONTRIBUTING.md](https://github.com/timelessco/next-react-app/blob/main/.github/CONTRIBUTING.md)
were taken
- [ ] That issue was marked as [`status: accepting prs`][1]
- [ ] Steps in [CONTRIBUTING.md][2] were taken

## Overview

<!-- Description of what is changed and how the code change does that. -->

[1]:
https://github.com/timelessco/next-react-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22
[2]:
https://github.com/timelessco/next-react-app/blob/main/.github/CONTRIBUTING.md
10 changes: 10 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
color: 2af79e
description: "Generic maintenance tasks, e.g., package updates."

- name: "Type: Testing"
color: 6009D7
description:
"Improving how the repository's tests are run and/or code is tested"

- name: "Type: RFC"
color: fbca04

Expand Down Expand Up @@ -106,6 +111,11 @@

- name: "Status: Good first issue"
color: d7e102
description: Good for newcomers, please hop on

- name: "Status: Accepting PRs"
color: 0E8A16
description: Please, send a pull request to resolve this!

# Resolution Status labels
- name: "Resolution: By Design"
Expand Down
7 changes: 4 additions & 3 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"dependencyDashboardTitle": "Renovate Dependency Updates",
"automergeStrategy": "squash",
"postUpdateOptions": ["pnpmDedupe"],
"commitMessageAction": "⬆️ update",
"ignoreDeps": ["framer-motion"],
"commitMessageAction": "⬆️ update",
"commitMessageTopic": "{{depName}}",
"packageRules": [
{
Expand Down Expand Up @@ -80,7 +81,7 @@
"matchUpdateTypes": ["major"],
"labels": ["Dependency ⏫"],
"semanticCommitScope": "deps",
"commitMessageAction": "⬆️ upgrade",
"commitMessageAction": "⬆️ upgrade",
"semanticCommitType": "fix",
"prPriority": 3
},
Expand All @@ -90,7 +91,7 @@
"matchUpdateTypes": ["major"],
"labels": ["DevDependency 🔼"],
"semanticCommitScope": "dev-deps",
"commitMessageAction": "⬆️ upgrade",
"commitMessageAction": "⬆️ upgrade",
"prPriority": 3
},
{
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/lint-css.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Stylelint
name: CI

on:
pull_request: ~
Expand All @@ -8,9 +8,11 @@ on:
- main

jobs:
stylelint:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/prepare
- run: pnpm lint:css
- run:
npx turbo run lint:eslint lint:types lint:css lint:md lint:knip
lint:package-json lint:spelling lint:prettier test
16 changes: 0 additions & 16 deletions .github/workflows/lint-eslint.yml

This file was deleted.

Loading

0 comments on commit 481bcc6

Please sign in to comment.