-
Notifications
You must be signed in to change notification settings - Fork 160
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
feat(workspace): Add workspaces to specify build order dependencies in packages. #1004
Conversation
Thank you again @jafin , that awesome. Just give me some time to learn abou npm workspace :p Do you have a twitter account or a linkedin? |
@guillaume-chervet Sorry I don't have an active Twitter/linked in at the moment. With respect to publishing, you may also be interested in looking at changeset. When I tested things on my fork of this repo, I setup a github workflow and found it quite easy to perform publishing to npm registry. One thing I did like with it, was the way you can explicitly trigger a release (still from GitHub web), to allow queueing a set of changes, avoiding minor point releases for But this would require a change in PR's, to request a user to run a changeset command to enter a description of the change, and if it was a minor/major breaking change etc. I had a example github workflow here https://github.com/jafin/react-oidc/blob/master/.GitHub/workflows/release.yml It was quite basic though. |
Very Sorry @jafin for the delay, I'am lacking of times these days . |
@guillaume-chervet is all fine, I will need to rework this anyhow after the repo changes, it will be a little while for me to revisit. Changing to draft. |
5fcc349
to
6617a29
Compare
hi @jafin , do you want to continue your pullrequest ? |
Hi @guillaume-chervet I can have a look this weekend. Some questions for you on approach. As I said above I tried lerna and reverts to npm workspaces as I wasn't seeing a huge benefit from having lerna there. Let me know. |
Hi @jafin , I have read more documentation. New lerna version documentation say that learna is compatible with npm workspace. Thank you so much for you help. A little more roadmap information for you. I aim to:
|
@guillaume-chervet sounds good! |
That look awesome @jafin |
Hi @guillaume-chervet This turned out bigger than I thought. I haven't made any changes regarding packaging and versioning, so I am unsure if the pipeline scripts need work or amendment. Ideally, it would be highly beneficial if this project could publish betas or alphas to avoid end users being interrupted in the event there are errors. (I have not done anything in regard to versioning with this change) todo
Changes
Issues EncounteredPostinstall scripts put in wrong folderRunning the demo projects, but issuing If you run The work around, is to run Future improvements (beyond this pr)
|
So awesome @jafin , i test it tomorrow and i will prepare a branch that can publish alpha version to test it. |
.github/workflows/npm-publish.yml
Outdated
@@ -5,9 +5,9 @@ name: React Oidc CI | |||
|
|||
on: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jafin
May you set up the file like bellow.
I do knot know if it work but it will allow to publish alpha directly from "alpha" GIT branch in order to test.
- I have updated how next version compute
- I set up publish of oidc-lient before react-oidc
- set up publish from alpha branch
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
name: React Oidc CI
on:
push:
branches: [ main, alpha ]
pull_request:
branches: [ main, alpha ]
jobs:
skip_ci:
runs-on: ubuntu-latest
outputs:
canSkip: ${{ steps.check.outputs.canSkip }}
steps:
- id: check
uses: Legorooj/skip-ci@main
tests:
runs-on: ubuntu-latest
if: needs.skip_ci.outputs.canSkip != 'true' && github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: 18
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8.5.1
run_install: false
- name: pnpm i
run: pnpm i --frozen-lockfile
working-directory: ./packages/react-oidc
- name: pnpm prepare
run: pnpm run prepare
working-directory: ./packages/react-oidc
- name: pnpm test
run: pnpm test -- --run
working-directory: ./packages/react-oidc
- name: pnpm install
run: pnpm i --frozen-lockfile
working-directory: ./packages/oidc-client
- name: pnpm prepare
run: pnpm run prepare
working-directory: ./packages/oidc-client
build:
environment: react-oidc
runs-on: ubuntu-latest
if: needs.skip_ci.outputs.canSkip != 'true' && !github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GIT_TOKEN }}
- name: Bump version and push tag
id: tag_version
if: github.ref == 'refs/heads/main'
uses: mathieudutour/github-tag-action@v6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Bump version and push tag
id: tag_version
if: github.ref == 'refs/heads/alpha'
uses: mathieudutour/github-tag-action@v6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
dry_run: true
- name: Add tag to output step for main branch
id: tag
run: |
if [ '${{ github.ref }}' = 'refs/heads/main' ]; then
echo "new_version=${{ steps.tag_version.outputs.new_version }}" >> $GITHUB_OUTPUT
else
echo "new_version=${{ steps.tag_version.outputs.new_version }}-alpha${{ github.run_number }}" >> $GITHUB_OUTPUT
fi
- uses: actions/setup-node@v2
with:
node-version: 18
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8.5.1
run_install: false
# Oidc Client
- name: pnpm version ${{ steps.tag_version.outputs.new_tag }}
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/alpha'
run: pnpm version ${{ steps.tag_version.outputs.new_tag }}
working-directory: ./packages/oidc-client
- name: pnpm install
run: pnpm i --frozen-lockfile
working-directory: ./packages/oidc-client
- name: pnpm prepare
run: pnpm run prepare
working-directory: ./packages/oidc-client
- id: publish-oidc-client
uses: JS-DevTools/npm-publish@v1
if: github.ref == 'refs/heads/main'
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/oidc-client/package.json
# React Oidc
- name: npm version ${{ steps.tag_version.outputs.new_tag }}
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/alpha'
run: npm version ${{ steps.tag_version.outputs.new_tag }}
working-directory: ./packages/react-oidc
- name: pnpm i
run: pnpm i --frozen-lockfile
working-directory: ./packages/react-oidc
- name: pnpm prepare
run: pnpm run prepare
working-directory: ./packages/react-oidc
- name: pnpm test
run: pnpm test -- --run
working-directory: ./packages/react-oidc
- id: publish-react
uses: JS-DevTools/npm-publish@v1
if: github.ref == 'refs/heads/main'
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/react-oidc/package.json
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
if: github.event.pull_request.head.repo.full_name == github.repository && !github.event.pull_request.head.repo.fork
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.organization=axaguildev
-Dsonar.projectKey=AxaGuilDEv_react-oidc
-Dsonar.exclusions=**/*.spec.js,**/*.stories.js,Scripts/**,**/*.scss,**/__snapshots__/**,**/*[Tt]ests.cs,**/node_modules/**,**/ClientApp/build/**,**/ClientApp/.storybook/**,**/ClientApp/storybook-static/**,**/obj/**,**/__mocks__/**,**/ClientApp/src/serviceWorker.ts
-Dsonar.javascript.lcov.reportPaths=**/coverage/lcov.info
- name: Commit updates package.json
uses: stefanzweifel/git-auto-commit-action@v4
if: github.ref == 'refs/heads/main'
with:
commit_message: "[skip ci] Update version package.json"
commit_user_name: GitHub
commit_user_email: github-action@bot.com
commit_author: GitHub <github-action@bot.com>
push_options: '--force'
- name: Create a GitHub release
uses: ncipollo/release-action@v1
if: github.ref == 'refs/heads/main'
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
Thank you so much @jafin . I have tested demo and they all works ! |
From your questions,
|
THank you @guillaume-chervet , I think having the option to release test builds before new official version may ensure bugs are fixed before a new official version rolls out. Just a comment, the way you have it setup now in this repo, aligns with github-flow, single branch for deploys makes it simple and quick to do always ready releases. I didn't want to complicate that with other branches, sorry for the misunderstanding. Just a way to push to main without an official release being created, perhaps if the CI is able to release a beta via tagging rather than always create new release on PR push to main, that would be great, and avoid having unnecessary branches. And still adhering to the github-flow approach One option could be each PR merged to main, this triggers a new beta-release. To create an official release, manually tag main? But if this introduces too much overhead I understand. Thank you for reviewing the changes. I'll update the changes you mentioned above and notify when done. |
Thank you again @jafin , you force me to find a better solution. I do not like manual tag because it is too manual. Too many actions. Here an idea of a solution, continue to use last git commit comment and automate everything.
With the script bellow (not tested). It is more intricate, but I think workflow would be simpler. What do you think about ? # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
name: React Oidc CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
skip_ci:
runs-on: ubuntu-latest
outputs:
canSkip: ${{ steps.check.outputs.canSkip }}
steps:
- id: check
uses: Legorooj/skip-ci@main
tests:
runs-on: ubuntu-latest
if: needs.skip_ci.outputs.canSkip != 'true' && github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: 18
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8.5.1
run_install: false
- name: pnpm i
run: pnpm i --frozen-lockfile
working-directory: ./packages/react-oidc
- name: pnpm prepare
run: pnpm run prepare
working-directory: ./packages/react-oidc
- name: pnpm test
run: pnpm test -- --run
working-directory: ./packages/react-oidc
- name: pnpm install
run: pnpm i --frozen-lockfile
working-directory: ./packages/oidc-client
- name: pnpm prepare
run: pnpm run prepare
working-directory: ./packages/oidc-client
build:
environment: react-oidc
runs-on: ubuntu-latest
if: needs.skip_ci.outputs.canSkip != 'true' && !github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GIT_TOKEN }}
- name: Determine Alpha, Beta or Release
id: which_tag
run: |
last_commit_message=$(git log --format=%B -n 1)
# Check if last comment and with "(alpha)"
if [[ $last_commit_message == *"(alpha)" ]]; then
echo "tag=alpha" >> $GITHUB_OUTPUT
fi
if [[ $last_commit_message == *"(beta)" ]]; then
echo "tag=beta" >> $GITHUB_OUTPUT
fi
if [[ $last_commit_message == *"(release)" ]]; then
echo "tag=release" >> $GITHUB_OUTPUT
fi
- name: Bump version and push tag
id: tag_version
if: which_tag.ref == 'refs/heads/main' && steps.which_tag.outputs.tag == 'release'
uses: mathieudutour/github-tag-action@v6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Bump version and push tag
id: tag_version
if: which_tag.ref == 'refs/heads/main' && (steps.which_tag.outputs.tag == 'alpha' || steps.which_tag.outputs.tag == 'beta')
uses: mathieudutour/github-tag-action@v6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
dry_run: true
- name: Add tag to output step for main branch
id: tag
run: |
if [ '${{ github.ref }}' = 'refs/heads/main' && steps.which_tag.outputs.tag = 'release' ]; then
echo "new_version=${{ steps.tag_version.outputs.new_version }}" >> $GITHUB_OUTPUT
fi
if [ '${{ github.ref }}' = 'refs/heads/main' && (steps.which_tag.outputs.tag = 'alpha' ]; then
echo "new_version=${{ steps.tag_version.outputs.new_version }}-alpha${{ github.run_number }}" >> $GITHUB_OUTPUT
fi
if [ '${{ github.ref }}' = 'refs/heads/main' && (steps.which_tag.outputs.tag = 'beta' ]; then
echo "new_version=${{ steps.tag_version.outputs.new_version }}-beta${{ github.run_number }}" >> $GITHUB_OUTPUT
fi
- uses: actions/setup-node@v2
with:
node-version: 18
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8.5.1
run_install: false
# Oidc Client
- name: pnpm version ${{ steps.tag_version.outputs.new_tag }}
if: github.ref == 'refs/heads/main' && (steps.which_tag.outputs.tag == 'release' || steps.which_tag.outputs.tag == 'alpha' || steps.which_tag.outputs.tag == 'beta')
run: pnpm version ${{ steps.tag_version.outputs.new_tag }}
working-directory: ./packages/oidc-client
- name: pnpm install
run: pnpm i --frozen-lockfile
working-directory: ./packages/oidc-client
- name: pnpm prepare
run: pnpm run prepare
working-directory: ./packages/oidc-client
- id: publish-oidc-client
uses: JS-DevTools/npm-publish@v1
if: github.ref == 'refs/heads/main' && (steps.which_tag.outputs.tag == 'release' || steps.which_tag.outputs.tag == 'alpha' || steps.which_tag.outputs.tag == 'beta')
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/oidc-client/package.json
# React Oidc
- name: npm version ${{ steps.tag_version.outputs.new_tag }}
if: github.ref == 'refs/heads/main' && (steps.which_tag.outputs.tag == 'release' || steps.which_tag.outputs.tag == 'alpha' || steps.which_tag.outputs.tag == 'beta')
run: npm version ${{ steps.tag_version.outputs.new_tag }}
working-directory: ./packages/react-oidc
- name: pnpm i
run: pnpm i --frozen-lockfile
working-directory: ./packages/react-oidc
- name: pnpm prepare
run: pnpm run prepare
working-directory: ./packages/react-oidc
- name: pnpm test
run: pnpm test -- --run
working-directory: ./packages/react-oidc
- id: publish-react
uses: JS-DevTools/npm-publish@v1
if: github.ref == 'refs/heads/main' && (steps.which_tag.outputs.tag == 'release' || steps.which_tag.outputs.tag == 'alpha' || steps.which_tag.outputs.tag == 'beta')
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/react-oidc/package.json
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
if: github.event.pull_request.head.repo.full_name == github.repository && !github.event.pull_request.head.repo.fork
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.organization=axaguildev
-Dsonar.projectKey=AxaGuilDEv_react-oidc
-Dsonar.exclusions=**/*.spec.js,**/*.stories.js,Scripts/**,**/*.scss,**/__snapshots__/**,**/*[Tt]ests.cs,**/node_modules/**,**/ClientApp/build/**,**/ClientApp/.storybook/**,**/ClientApp/storybook-static/**,**/obj/**,**/__mocks__/**,**/ClientApp/src/serviceWorker.ts
-Dsonar.javascript.lcov.reportPaths=**/coverage/lcov.info
- name: Commit updates package.json
uses: stefanzweifel/git-auto-commit-action@v4
if: github.ref == 'refs/heads/main'
with:
commit_message: "[skip ci] Update version package.json"
commit_user_name: GitHub
commit_user_email: github-action@bot.com
commit_author: GitHub <github-action@bot.com>
push_options: '--force'
- name: Create a GitHub release
uses: ncipollo/release-action@v1
if: github.ref == 'refs/heads/main'
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
|
I don't have a strong opinion, perhaps try it and see how it works. Also, I have updated the PR with the fixes you highlighted. |
Yes @jafin , let's try like this. |
@guillaume-chervet sure if you can update the CI first, then I'll rebase onto the changes for this PR. Or feel free to amend it as part of this change. Whatever is easiest for you. |
Some suggested changes.
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
name: React Oidc CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
PNPM_VERSION: 8.5.1
NODE_VERSION: 18
jobs:
skip_ci:
runs-on: ubuntu-latest
outputs:
canSkip: ${{ steps.check.outputs.canSkip }}
steps:
- id: check
uses: Legorooj/skip-ci@main
tests:
needs: skip_ci
runs-on: ubuntu-latest
if: needs.skip_ci.outputs.canSkip != 'true' && github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: ${{ env.PNPM_VERSION }}
run_install: false
- name: pnpm i
run: pnpm i --frozen-lockfile
working-directory: ./packages/react-oidc
- name: pnpm prepare
run: pnpm run prepare
working-directory: ./packages/react-oidc
- name: pnpm test
run: pnpm test -- --run
working-directory: ./packages/react-oidc
- name: pnpm install
run: pnpm i --frozen-lockfile
working-directory: ./packages/oidc-client
- name: pnpm prepare
run: pnpm run prepare
working-directory: ./packages/oidc-client
build:
needs: skip_ci
environment: react-oidc
runs-on: ubuntu-latest
if: needs.skip_ci.outputs.canSkip != 'true' && !github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GIT_TOKEN }}
- name: Determine Alpha, Beta or Release
id: which_tag
run: |
last_commit_message=$(git log --format=%B -n 1)
# Check if last comment and with "(alpha)"
if [[ $last_commit_message == *"(alpha)" ]]; then
echo "tag=alpha" >> $GITHUB_OUTPUT
fi
if [[ $last_commit_message == *"(beta)" ]]; then
echo "tag=beta" >> $GITHUB_OUTPUT
fi
if [[ $last_commit_message == *"(release)" ]]; then
echo "tag=release" >> $GITHUB_OUTPUT
fi
- name: Bump version and push tag
id: tag_release
if: steps.which_tag.ref == 'refs/heads/main' && steps.which_tag.outputs.tag == 'release'
uses: mathieudutour/github-tag-action@v6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
dry_run: true
- name: Add tag to output step for main branch
id: tag
run: |
if [ '${{ github.ref }}' = 'refs/heads/main' && steps.which_tag.outputs.tag = 'release' ]; then
echo "new_version=${{ steps.tag_version.outputs.new_version }}" >> $GITHUB_OUTPUT
fi
if [ '${{ github.ref }}' = 'refs/heads/main' && (steps.which_tag.outputs.tag = 'alpha' ]; then
echo "new_version=${{ steps.tag_version.outputs.new_version }}-alpha${{ github.run_number }}" >> $GITHUB_OUTPUT
fi
if [ '${{ github.ref }}' = 'refs/heads/main' && (steps.which_tag.outputs.tag = 'beta' ]; then
echo "new_version=${{ steps.tag_version.outputs.new_version }}-beta${{ github.run_number }}" >> $GITHUB_OUTPUT
fi
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: ${{ env.PNPM_VERSION }}
run_install: false
# Oidc Client
- name: pnpm version ${{ steps.tag_version.outputs.new_tag }}
if: github.ref == 'refs/heads/main' && (steps.which_tag.outputs.tag == 'release' || steps.which_tag.outputs.tag == 'alpha' || steps.which_tag.outputs.tag == 'beta')
run: pnpm version ${{ steps.tag_version.outputs.new_tag }}
working-directory: ./packages/oidc-client
- name: pnpm install
run: pnpm i --frozen-lockfile
working-directory: ./packages/oidc-client
- name: pnpm prepare
run: pnpm run prepare
working-directory: ./packages/oidc-client
- id: publish-oidc-client
uses: JS-DevTools/npm-publish@v1
if: github.ref == 'refs/heads/main' && (steps.which_tag.outputs.tag == 'release' || steps.which_tag.outputs.tag == 'alpha' || steps.which_tag.outputs.tag == 'beta')
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/oidc-client/package.json
# React Oidc
- name: npm version ${{ steps.tag_version.outputs.new_tag }}
if: github.ref == 'refs/heads/main' && (steps.which_tag.outputs.tag == 'release' || steps.which_tag.outputs.tag == 'alpha' || steps.which_tag.outputs.tag == 'beta')
run: npm version ${{ steps.tag_version.outputs.new_tag }}
working-directory: ./packages/react-oidc
- name: pnpm i
run: pnpm i --frozen-lockfile
working-directory: ./packages/react-oidc
- name: pnpm prepare
run: pnpm run prepare
working-directory: ./packages/react-oidc
- name: pnpm test
run: pnpm test -- --run
working-directory: ./packages/react-oidc
- id: publish-react
uses: JS-DevTools/npm-publish@v1
if: github.ref == 'refs/heads/main' && (steps.which_tag.outputs.tag == 'release' || steps.which_tag.outputs.tag == 'alpha' || steps.which_tag.outputs.tag == 'beta')
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/react-oidc/package.json
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
if: github.event.pull_request.head.repo.full_name == github.repository && !github.event.pull_request.head.repo.fork
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.organization=axaguildev
-Dsonar.projectKey=AxaGuilDEv_react-oidc
-Dsonar.exclusions=**/*.spec.js,**/*.stories.js,Scripts/**,**/*.scss,**/__snapshots__/**,**/*[Tt]ests.cs,**/node_modules/**,**/ClientApp/build/**,**/ClientApp/.storybook/**,**/ClientApp/storybook-static/**,**/obj/**,**/__mocks__/**,**/ClientApp/src/serviceWorker.ts
-Dsonar.javascript.lcov.reportPaths=**/coverage/lcov.info
- name: Commit updates package.json
uses: stefanzweifel/git-auto-commit-action@v4
if: github.ref == 'refs/heads/main'
with:
commit_message: "[skip ci] Update version package.json"
commit_user_name: GitHub
commit_user_email: github-action@bot.com
commit_author: GitHub <github-action@bot.com>
push_options: '--force'
- name: Create a GitHub release
uses: ncipollo/release-action@v1
if: github.ref == 'refs/heads/main'
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }} |
- Move packages/nextjs-demo to examples/nextjs-demo - Move packages/oidc-client-demo to examples/ - Isolate/Extract react-oidc-demo from packages/react into examples/react-oidc-demo - Update imports to reference @axa-fr/react-oidc instead of relative path - Setup workspaces in root - build with pnpm - Adjust post install script logic, rename to post-install.(m)js - Extract oidc-service-worker into own package - Configure monorepo dependencies to use `workspace` references internally. - replace craco/cra with vite - Add exports to vanilla-oidc to allow imports from react-oidc.
…nt to build with vite.
…er of build oidc-version then react-oidc
- similar functionality exists in react-oidc-demo
Thanks @guillaume-chervet , merged. |
Thank you so much @jafin |
Which kind of merge do you prefer @jafin . |
@guillaume-chervet just squash it I think. |
Workspaces
oidc-service-worker
up a level outside of packages/reacttest
for each project to be non-watch mode (Added test:watch as replacement). So that pipeline can call test from root and all packages can run test for CI🐲🐲🐲 NOTE: I have not tested the changes to the workflows, it was a BEST EFFORT approach and will need review.
This should assist in easing the package dependency chain. 👏
Decisions
I looked into
lerna
and installed it, but it wasn't doing much above what native npm workspaces added. Lerna documentation also notes that they now lean on npm(pnpm/yarn) workspaces (something lerna->bootstrap used to provide). Perhaps there are some other benefits I didn't discover?Lerna can still be added, it should be a simple update to add it into the root project without much change, and just the various npm workspace commands with lerna equivalent.