From 5fa3a1a32d1a50f303d0cce200f56ea79ac88be3 Mon Sep 17 00:00:00 2001 From: Jonas Hungershausen Date: Mon, 19 Aug 2024 11:15:29 +0000 Subject: [PATCH] chore: remove lerna (#196) * chore: remove lerna * chore: remove --dry-run --- .github/workflows/release.yml | 9 ++++----- .gitignore | 1 - Makefile | 2 +- README.md | 14 ++++++-------- examples/preact-spa/.gitignore | 1 - examples/react-spa/.gitignore | 1 - lerna.json | 11 ----------- package.json | 17 ++++++----------- 8 files changed, 17 insertions(+), 39 deletions(-) delete mode 100644 lerna.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9ac34720c..633e5e9a1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,16 +7,15 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: "0" token: ${{ secrets.ORY_BOT_PAT }} - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: "20" - - run: npm run initialize + - run: npm ci - run: npm run build:clean - - run: git checkout main - run: | echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN_AENEASR }}" > ~/.npmrc - run: make format @@ -32,4 +31,4 @@ jobs: return isPrerelease ? 'next' : 'latest'; result-encoding: string - run: | - npx lerna publish -y ${{ github.event.release.tag_name }} --dist-tag="${{ steps.compute-dist-tag.outputs.result }}" --message 'chore(release): bump version to %s' --no-git-tag-version + npx nx release publish --specifier=${{ github.event.release.tag_name }} --tag="${{ steps.compute-dist-tag.outputs.result }}" --git-commit-message 'chore(release): bump version to ${{ github.event.release.tag_name }}' --git-tag=false diff --git a/.gitignore b/.gitignore index 0195ba1e6..aa9f05000 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,6 @@ npm-debug.log* yarn-debug.log* yarn-error.log* pnpm-debug.log* -lerna-debug.log* node_modules dist diff --git a/Makefile b/Makefile index 2e9e5903f..55ae5d337 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ export PATH := .bin:${PATH} .PHONY: install install: - npm run initialize && npm run build:clean + npm install test: npm run test diff --git a/README.md b/README.md index 1765a88de..999b30fa0 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ Clone this repository and set up the React example. ```shell git clone git@github.com:ory/elements -npm run initialize +npm install npm run build:clean cd examples/react-spa export VITE_ORY_SDK_URL=http://localhost:4000 @@ -263,7 +263,7 @@ Explore the Ory Elements via [Storybook](https://storybook.js.org/)! Clone this repository and run: ```shell -npm run initialize +npm run install npm run build # or `npm run build:clean` to ensure no packages have cached versions npm run storybook @@ -282,7 +282,7 @@ E2E and component tests are written in [Playwright](https://playwright.dev/). **Example Apps** To contribute an example application, please add it to the `examples/` folder. -To ensure the example works correctly within the Lerna build system, add the +To ensure the example works correctly within the workspace build system, add the `elements` package to the example `package.json` with an asterisk `*` as the version. @@ -310,12 +310,10 @@ Elements loads the default translations. ### Bundling System -Ory Elements uses [Lerna](https://lerna.js.org/) to bundle each package in the -Ory Elements mono-repository. This also helps with package management and build -caching. Lerna also publishes the code to the public -[npm registry](https://www.npmjs.com/) for us. +Ory Elements uses [nx](https://nx.dev/) to bundle each package in the Ory +Elements mono-repository. -Lerna also use [Nx](https://nx.dev/) to build the packages in parallel. +Nx publishes the code to the public [npm registry](https://www.npmjs.com/). ### Strongly typed CSS using Vanilla-Extract diff --git a/examples/preact-spa/.gitignore b/examples/preact-spa/.gitignore index c5863c6b4..f8b755819 100644 --- a/examples/preact-spa/.gitignore +++ b/examples/preact-spa/.gitignore @@ -5,7 +5,6 @@ npm-debug.log* yarn-debug.log* yarn-error.log* pnpm-debug.log* -lerna-debug.log* node_modules dist diff --git a/examples/react-spa/.gitignore b/examples/react-spa/.gitignore index 4e525c0ad..10b90b1b3 100644 --- a/examples/react-spa/.gitignore +++ b/examples/react-spa/.gitignore @@ -5,7 +5,6 @@ npm-debug.log* yarn-debug.log* yarn-error.log* pnpm-debug.log* -lerna-debug.log* node_modules dist diff --git a/lerna.json b/lerna.json deleted file mode 100644 index 4dc98ff4a..000000000 --- a/lerna.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$schema": "node_modules/lerna/schemas/lerna-schema.json", - "useNx": true, - "useWorkspaces": true, - "version": "0.0.1-alpha.29", - "command": { - "publish": { - "private": false - } - } -} diff --git a/package.json b/package.json index 0ff204391..f6a6cfe1f 100644 --- a/package.json +++ b/package.json @@ -4,17 +4,13 @@ "private": "true", "scripts": { "storybook": "storybook dev -p 6006", - "initialize": "npm run clean && npx lerna bootstrap --hoist", - "clean": "npx lerna clean --yes", "build-storybook": "storybook build", - "refresh": "lerna bootstrap --hoist", - "build:clean": "lerna run build --skip-nx-cache", - "build": "lerna run build --stream", - "build:react": "lerna run build --stream --scope=@ory/elements --skip-nx-cache", - "build:preact": "lerna run build --stream --scope=@ory/elements-preact --skip-nx-cache", - "build:markup": "lerna run build --stream --scope=@ory/elements-markup --skip-nx-cache", - "build:test": "lerna run build --stream --scope=@ory/elements-test --skip-nx-cache", - "build:elementsv1": "lerna run build --stream --scope=@ory/elements-react --skip-nx-cache", + "build:clean": "nx run-many --target=build --all --skip-nx-cache", + "build": "nx run-many --target=build --all", + "build:react": "nx run @ory/elements:build --skip-nx-cache", + "build:preact": "nx run @ory/elements-preact:build --skip-nx-cache", + "build:markup": "nx run @ory/elements-markup:build --skip-nx-cache", + "build:test": "nx run @ory/elements-test:build --skip-nx-cache", "test": "jest; playwright test -c playwright-ct.config.ts", "docs": "typedoc --entryPointStrategy packages . --out docs", "generate-locales": "cd scripts && npm run generate-locales" @@ -78,7 +74,6 @@ "eslint-plugin-storybook": "0.6.14", "eslint-plugin-tsdoc": "0.2.17", "jest": "29.7.0", - "lerna": "8.1.7", "license-checker": "25.0.1", "nx": "19.5.4", "ory-prettier-styles": "1.3.0",