Skip to content

Commit

Permalink
chore: Replace lerna with turborepo + changesets (#2321)
Browse files Browse the repository at this point in the history
* Add WIP document with context

* Add criteria

* WIP (generated -> lint, versioning, release)

* Remove (likely) unnecessary yarn prefixes

* Lint after generate

* Fix check

* Update generated clients

* Generate services

* Revert "Update generated clients"

This reverts commit 80d23ad.

* Update ADR

* Use changesets

* Simplify util.ts

* Fix top level check:public-api script

* chore: Prepare changesets

* Remove changeset README

* Add first changeset

* Remove lerna from release scripts

* Add generate:common

* Use fixed versions with changesets

* Split test services

* Change flags as files are different when restored from cache

* Add more details to ADR

* Fix tests

* Move private test utils

* Get rid of postinstall

* Fix tests

* Use filter instead of scope

* Update yarn.lock

* Return postinstall to fix tests

* Add comment regarding cycles to ADR

* Remove references from private test utils

* Add transitive peer deps

* import nock from nock

* Revert test-util refactoring

* Remove postinstall & update yarn

* Revert remove postinstall

* Back to yarn 1.22.10

* Revert prepare and postinstall

* Fix build...

* Update yarn lock

* Update generated service

* Remove postinstall and move prepare to prepublishOnly

* Restore postinstall

* Add comment to ADR

* Comments in ADR

* Always build fresh without cache in checks

* Fix tests

* Upgrade yarn

* Add comment to PR template

* Add a compile script on root level

* Add lint fix for e2e script for service

* Remove unnecessary changeset

* Update ADR
  • Loading branch information
Florian Richter authored Apr 29, 2022
1 parent 2cd28c4 commit a2997ce
Show file tree
Hide file tree
Showing 1,101 changed files with 24,909 additions and 173,288 deletions.
9 changes: 9 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [["@sap-cloud-sdk/*"]],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch"
}
8 changes: 5 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ module.exports = {
'**/*.d.ts',
'**/dist/**/*',
'**/node_modules/**/*',
'test-packages/test-services/**/*',
'test-packages/test-services-e2e/**/*',
'test-packages/test-services*/**/*',
'packages/rest-generator/test/test-services/**/*',
'test-resources/cli/**/*',
'**/test-output/**',
Expand All @@ -24,7 +23,10 @@ module.exports = {
'dist',
'node_modules',
'README.md',
'test-packages/test-services',
'test-packages/test-services-odata-v2',
'test-packages/test-services-odata-v4',
'test-packages/test-services-odata-common',
'test-packages/test-services-openapi',
'test-packages/test-services-e2e',
'packages/rest-generator/test/test-services',
'test-resources/cli/',
Expand Down
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Closes SAP/cloud-sdk-backlog#ISSUENUMBER.
* Tests created/adjusted for your changes.
* Release notes updated.
* PR title adheres to [conventional commit guidelines](https://www.conventionalcommits.org).
* Created a changeset `yarn changeset`
* If applicable:
* Documented public API (TypeDoc).
* Checked that `yarn run doc` still works.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/blackduck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
key: ${{ matrix.os }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile
- run: sudo apt-get install jq
- run: echo "project_version=$(lerna ls -l --json | jq '.[0].version' | tr -d '"')" >> $GITHUB_ENV
- run: echo "project_version=$(cat package.json | jq '.version' | tr -d '"')" >> $GITHUB_ENV
- name: Blackduck Scan
uses: SAP/project-piper-action@de2106c218782b7caa3989c7a8af8f3b9d5fa36b
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ jobs:
run: |
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> .npmrc
date=`date +%Y%m%d%H%M%S`
yarn lerna publish --canary --no-push --no-git-tag-version --dist-tag canary --force-publish --preid ${date} -y
yarn changeset publish --tag canary
env:
NPM_TOKEN: ${{ secrets.NPMJS_ACCESS_TOKEN }}
draft-github-release:
Expand Down
13 changes: 2 additions & 11 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ name: bump

on:
workflow_dispatch:
inputs:
bump:
description: Version bump to be used. Can either be 'patch' or 'minor'.
required: false
default: 'minor'

jobs:
bump:
Expand All @@ -24,9 +19,5 @@ jobs:
run: |
git config --global user.email "[email protected]"
git config --global user.name "cloud-sdk-js"
- name: Bump minor version
if: github.event.inputs.bump == 'minor'
run: yarn lerna version minor --force-publish -y
- name: Bump patch version
if: github.event.inputs.bump == 'patch'
run: yarn lerna version patch --force-publish -y
- name: Bump version
run: yarn changeset version
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v1')
run: |
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> .npmrc
yarn lerna publish from-package --dist-tag legacy --force-publish -y
yarn changeset publish --tag legacy
env:
NPM_TOKEN: ${{ secrets.NPMJS_ACCESS_TOKEN }}
- name: Version 2 Stable Release
if: startsWith(github.ref, 'refs/tags/v2')
run: |
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> .npmrc
yarn lerna publish from-package --force-publish -y
yarn changeset publish
env:
NPM_TOKEN: ${{ secrets.NPMJS_ACCESS_TOKEN }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
node_modules
!.github/actions/**/node_modules
.vscode
build/**
dist
.next/**
!.github/actions/**/dist
.DS_Store
coverage
lerna-debug.log
yarn-error.log
*.tgz
**credentials.json
.idea
.nyc_output
documentation
.npmrc
.turbo

test-results.xml
test-packages/type-tests/report.*.json
Expand All @@ -31,3 +33,4 @@ sqlite.db-journal
test-packages/integration-tests/test/auth-flows/vcap-services.json
test-packages/integration-tests/test/auth-flows/user-access-token.json
test-packages/integration-tests/test/auth-flows/systems.json
test-packages/e2e-tests/test/generator-test-output
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ docs/
coverage/
CHANGELOG.md
README.md
.*rc
Loading

0 comments on commit a2997ce

Please sign in to comment.