Skip to content

Commit 40f5e60

Browse files
Migrate to Turborepo and Changesets (#163)
* minor: convert to turbo repo and changesets * dist: add dependabot, changsets, and automate releases * dist: cleanup dependabot and cicd matrix * dist: more cicd cleanup * dist: more cleanup * dist: setup dependabot for all subpackages * dist: update README and add script to root package.json * Apply suggestions from code review Co-authored-by: Kawika Bader <[email protected]> Co-authored-by: Kawika Bader <[email protected]>
1 parent 25164d1 commit 40f5e60

File tree

26 files changed

+20168
-34150
lines changed

26 files changed

+20168
-34150
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.changeset/rotten-mugs-smash.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"eslint-config-godaddy": minor
3+
"eslint-config-godaddy-flow": minor
4+
"eslint-config-godaddy-react": minor
5+
"eslint-config-godaddy-react-flow": minor
6+
"eslint-config-godaddy-react-typescript": minor
7+
"eslint-config-godaddy-typescript": minor
8+
---
9+
10+
Convert to turbo repo and changesets
File renamed without changes.

.github/dependabot.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
version: 2
2+
updates:
3+
- directory: /
4+
package-ecosystem: github-actions
5+
rebase-strategy: auto
6+
schedule:
7+
interval: daily
8+
- directory: /
9+
package-ecosystem: npm
10+
rebase-strategy: auto
11+
schedule:
12+
interval: daily
13+
- directory: /packages/eslint-config-godaddy
14+
package-ecosystem: npm
15+
rebase-strategy: auto
16+
schedule:
17+
interval: daily
18+
- directory: /packages/eslint-config-godaddy-flow
19+
package-ecosystem: npm
20+
rebase-strategy: auto
21+
schedule:
22+
interval: daily
23+
- directory: /packages/eslint-config-godaddy-react
24+
package-ecosystem: npm
25+
rebase-strategy: auto
26+
schedule:
27+
interval: daily
28+
- directory: /packages/eslint-config-godaddy-react-flow
29+
package-ecosystem: npm
30+
rebase-strategy: auto
31+
schedule:
32+
interval: daily
33+
- directory: /packages/eslint-config-godaddy-react-typescript
34+
package-ecosystem: npm
35+
rebase-strategy: auto
36+
schedule:
37+
interval: daily
38+
- directory: /packages/eslint-config-godaddy-typescript
39+
package-ecosystem: npm
40+
rebase-strategy: auto
41+
schedule:
42+
interval: daily
43+

.github/workflows/cicd.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
name: CICD
2-
on: [pull_request]
2+
on:
3+
push:
4+
branches:
5+
- 'main'
6+
pull_request:
7+
branches:
8+
- '*'
39

410
jobs:
5-
build:
6-
runs-on: ubuntu-18.04
7-
strategy:
8-
matrix:
9-
node: ['12', '14']
11+
cicd:
12+
runs-on: ubuntu-latest
13+
concurrency: ${{ github.workflow }}-${{ github.ref }}
1014
steps:
1115
- name: Checkout code
12-
uses: actions/checkout@v2
16+
uses: actions/checkout@v3
1317
with:
1418
fetch-depth: 0
1519
- name: Setup Node.js
16-
uses: actions/setup-node@v1
20+
uses: actions/setup-node@v3
1721
with:
1822
node-version: ${{ matrix.node }}
1923
- name: Install dependencies

.github/workflows/release.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
jobs:
11+
release:
12+
name: Release
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Repo
16+
uses: actions/checkout@v3
17+
18+
- name: Setup Node
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version-file: '.nvmrc'
22+
23+
- name: Install Dependencies
24+
run: npm ci
25+
26+
- name: Create Release Pull Request or Publish to npm
27+
id: changesets
28+
uses: changesets/action@v1
29+
with:
30+
# This expects you to have a script called release which does a build for your packages and calls changeset publish
31+
publish: npm run release
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ node_modules
3030

3131
# Editor artifacts
3232
.idea
33+
34+
# Turbo artifacts
35+
.turbo

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
16

README.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,17 +150,34 @@ For a first time setup make sure to run from the root of the monorepo
150150
npm install
151151
```
152152

153-
From there the bootstrap script will setup the packages and hoist the node_modules
153+
Since this repository uses npm workspaces it will install and hoist all `node_modules` to
154+
the root of the monorepo.
155+
156+
### Submit a changeset
157+
158+
This repository utilizes [changesets] to handle versioning and publishing as you submit a pull-request. To initiate a changeset run:
159+
160+
```bash
161+
npm run changeset
162+
```
163+
164+
After which follow the command prompts to select which packages and which version each package should receive.
154165

155166
### Publishing
156167

157168
If you are lucky enough to get to publish a new version of a package you are in luck. This monorepo is setup to independently publish packages based on changes commited. Just make sure to run:
158169

159170
```bash
160-
npm run publish
171+
npm version
172+
```
173+
174+
This will run `changeset version` and will update all packages to the versions based on the changesets committed into the `.changeset` directory. After the versioning is complete to handle publishing and creating a release run:
175+
176+
```bash
177+
npm run release
161178
```
162179

163-
This runs `lerna publish` under the hood and will run you through a cli driven experience to help you determine the next version. To learn more about it see [lerna publish]
180+
This runs `changeset publish` under the hood and handle as mentioned above.
164181

165182
### I disagree with a specific rule
166183

@@ -188,4 +205,4 @@ No problem. Reach out to us by [opening an issue]
188205
[`eslint-config-godaddy-react-typescript`]: /packages/eslint-config-godaddy-react-typescript
189206
[`eslint-config-godaddy-flow`]: /packages/eslint-config-godaddy-react-flow
190207
[`eslint-config-godaddy-react-flow`]: /packages/eslint-config-godaddy-react-flow
191-
[lerna publish]: https://github.com/lerna/lerna/tree/main/commands/publish#readme
208+
[changesets]: https://github.com/changesets/changesets

0 commit comments

Comments
 (0)