Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to yarn workspaces and auto #707

Merged
merged 4 commits into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .changeset/README.md

This file was deleted.

11 changes: 0 additions & 11 deletions .changeset/config.json

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/fresh-grapes-deny.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/many-pots-walk.md

This file was deleted.

12 changes: 0 additions & 12 deletions .changeset/pre.json

This file was deleted.

35 changes: 31 additions & 4 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@
color: 0052cc
- name: bug
description: fixes a bug and should be reviewed ASAP
color: ff9600
color: b54f0b
- name: cron
description: generated by a CI cron job
color: 226e7f
- name: dependencies
description: related to dependencies
color: fcf3b8
- name: work in progress
description: being worked on
color: edcd39
Expand All @@ -32,3 +29,33 @@
- name: enhancement
description: adds a new feature or improves on an existing one
color: ad12cc
- name: 'change: major'
description: A major breaking change
color: fcf3b8
- name: 'change: feature'
description: Adds a new feature or improves on an existing one
color: fcf3b8
- name: 'change: fix'
description: Fixes a bug
color: fcf3b8
- name: 'change: documentation'
description: Changes only affect the documentation
color: fcf3b8
- name: 'change: refactor'
description: Changes that introduce no new features or fixes
color: fcf3b8
- name: 'change: performance'
description: Improve performance of an existing feature
color: fcf3b8
- name: 'change: dependencies'
description: Updates to dependencies only
color: fcf3b8
- name: 'change: tests'
description: Add or improve existing tests
color: 696969
- name: 'change: chore'
description: Changes around build process
color: 696969
- name: 'release'
description: Create a release when this pr is merged
color: 067314
13 changes: 6 additions & 7 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ jobs:
- uses: nrwl/nx-set-shas@v2
with:
main-branch-name: 'next'
- uses: pnpm/[email protected]
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- run: pnpm install
- run: pnpm nx affected:lint
- run: pnpm nx affected:test
- run: pnpm nx affected:build
- uses: bahmutov/npm-install@v1
- run: yarn global add nx
- run: nx affected:lint
- run: nx affected:test
- run: nx affected:build
50 changes: 14 additions & 36 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,27 @@ jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "Andrew Leedham"
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.REPO_GITHUB_TOKEN }}
- uses: nrwl/nx-set-shas@v2
with:
main-branch-name: 'next'
- uses: pnpm/[email protected]
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- run: pnpm install
- run: pnpm nx affected:lint
- run: pnpm nx affected:test
- run: pnpm nx affected:build
- name: Modify Workspace File
run: sed -e "s|'packages\/|'dist/|" pnpm-workspace.yaml > pnpm-new.yaml && mv pnpm-new.yaml pnpm-workspace.yaml
- name: 'Check if already in pre mode'
uses: andstor/file-existence-action@v1
- uses: actions/setup-node@v3
with:
files: '.changeset/pre.json'
- name: Enter prerelease mode (Next)
if: github.ref == 'refs/heads/next' && steps.check_files.outputs.file_exists == 'false'
run: pnpm changeset pre enter next
- name: Exit prerelease mode (Release)
if: github.ref == 'refs/heads/release' && steps.check_files.outputs.file_exists == 'true'
run: pnpm changeset pre exit
- name: Publish with changesets
uses: changesets/action@v1
with:
publish: pnpm changeset publish
setupGitUser: false
node-version: 16.x
- uses: bahmutov/npm-install@v1
- run: yarn global add nx
- run: nx affected:lint
- run: nx affected:test
- run: nx affected:build
- name: Publish to GitHub Packages
if: github.ref == 'refs/heads/release' || github.ref == 'refs/heads/next'
run: |
npx auto shipit
env:
SLACK_WEBHOOK_URL: ${{secrets.NPM_SLACK_WEBHOOK}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
75 changes: 75 additions & 0 deletions auto.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
const labels = [
{
name: 'change: major',
changelogTitle: 'Breaking Change',
description: 'A major breaking change',
releaseType: 'major',
},
{
name: 'change: feature',
changelogTitle: 'Feature',
description: 'Adds a new feature or improves on an existing one',
releaseType: 'minor',
},
{
name: 'change: fix',
changelogTitle: 'Fix',
description: 'Fixes a bug',
releaseType: 'patch',
},
{
name: 'change: documentation',
changelogTitle: 'Documentation',
description: 'Changes only affect the documentation',
releaseType: 'patch',
},
{
name: 'change: refactor',
changelogTitle: 'Refactor',
description: 'Changes that introduce no new features or fixes',
releaseType: 'patch',
},
{
name: 'change: performance',
changelogTitle: 'Performance',
description: 'Improve performance of an existing feature',
releaseType: 'patch',
},
{
name: 'change: dependencies',
changelogTitle: 'Dependencies',
description: 'Updates to dependencies only',
releaseType: 'patch',
},
{
name: 'change: chore',
changelogTitle: 'Chore',
description: 'Changes around build process',
releaseType: 'none',
},
{
name: 'change: tests',
changelogTitle: 'Tests',
description: 'Add or improve existing tests',
releaseType: 'none',
},
{
name: 'release: skip',
description: 'Skips the release step when this pr is merged',
releaseType: 'skip',
},
];

/**
* @type {import('auto').AutoRc}
*/
module.exports = {
baseBranch: 'release',
plugins: [
['npm', { exact: true, commitNextVersion: true }],
'slack',
'released',
],
labels,
prereleaseBranches: ['next'],
};
5 changes: 5 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true
}
22 changes: 14 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,22 @@
"build": "nx run-many --all --target=build"
},
"devDependencies": {
"@auto-it/slack": "^10.37.4",
"@changesets/cli": "2.23.2",
"@nrwl/cli": "latest",
"@nrwl/jest": "latest",
"@nrwl/js": "latest",
"@nrwl/linter": "latest",
"@nrwl/node": "14.4.2",
"@nrwl/nx-cloud": "latest",
"@nrwl/workspace": "latest",
"@nrwl/cli": "14.5.2",
"@nrwl/jest": "14.5.2",
"@nrwl/js": "14.5.2",
"@nrwl/linter": "14.5.2",
"@nrwl/node": "14.5.2",
"@nrwl/nx-cloud": "14.3.0",
"@nrwl/workspace": "14.5.2",
"@types/jest": "28.1.5",
"@types/node": "16.11.44",
"@types/node-fetch": "2.6.2",
"@types/semver": "7.3.10",
"@xerox/eslint-config": "5.0.2",
"@xerox/prettier-config": "4.0.0",
"auto": "^10.37.4",
"eslint": "8.20.0",
"eslint-import-resolver-typescript": "3.2.7",
"eslint-plugin-import": "2.26.0",
Expand All @@ -49,8 +51,12 @@
"typescript": "4.7.4"
},
"private": true,
"workspaces": [
"packages/*",
"root"
],
"dependencies": {
"tslib": "2.4.0"
},
"packageManager": "[email protected]"
"packageManager": "[email protected]"
}
Loading