-
Notifications
You must be signed in to change notification settings - Fork 530
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
chore: remove lerna #2526
base: main
Are you sure you want to change the base?
chore: remove lerna #2526
Changes from all commits
590d035
5d268b5
221fc4f
ae4ed34
f38a38c
4e229dc
fb4df28
9f37712
6b8d618
362fb4f
6d8aaa1
629f866
174d218
23b7c71
60400f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,8 +15,8 @@ jobs: | |
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install lerna | ||
run: npm install -g [email protected] | ||
- name: Install glob | ||
run: npm install glob | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note for reviewer: necessary dependency for the next step |
||
|
||
- name: Ensure Release Please Config and Manifest are in sync with the repository | ||
run: node scripts/check-release-please.mjs |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,6 @@ docs | |
|
||
#lerna | ||
.changelog | ||
package.json.lerna_backup | ||
|
||
# OS generated files | ||
.DS_Store | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,7 +96,7 @@ Please also see [GitHub workflow](https://github.com/open-telemetry/community/bl | |
|
||
- [NPM](https://npmjs.com) | ||
- [TypeScript](https://www.typescriptlang.org/) | ||
- [lerna](https://github.com/lerna/lerna) to manage dependencies, compilations, and links between packages. Most lerna commands should be run by calling the provided npm scripts. | ||
- [nx](https://github.com/nrwl/nx) to manage dependencies, compilations, and links between packages. Most nx commands should be run by calling the provided npm scripts. | ||
- [npm workspaces](https://docs.npmjs.com/cli/v10/using-npm/workspaces) | ||
- [MochaJS](https://mochajs.org/) for tests | ||
- [eslint](https://eslint.org/) | ||
|
@@ -119,6 +119,29 @@ Some tests depend on other packages to be installed, so these steps are also req | |
|
||
Each of these commands can also be run in individual packages, as long as the initial install and compile are done first in the root directory. | ||
|
||
If you're going to work on a single package and want to quickly jump into its development you can make use of the `focus` script. This scritp will run | ||
the necessary tasks to have only that package ready for development saving time. For example, if you want to work with `@opentelemetry/resource-detector-aws` | ||
run the following command in the root folder | ||
|
||
```sh | ||
npm run focus @opentelemetry/resource-detector-aws | ||
|
||
> [email protected] focus | ||
> nx run-many -t compile -p @opentelemetry/resource-detector-aws | ||
|
||
|
||
✔ nx run @opentelemetry/instrumentation-fs:version:update (796ms) | ||
✔ nx run @opentelemetry/contrib-test-utils:compile (3s) | ||
✔ nx run @opentelemetry/instrumentation-fs:compile (3s) | ||
✔ nx run @opentelemetry/resource-detector-aws:compile (3s) | ||
|
||
——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— | ||
|
||
> NX Successfully ran target compile for project @opentelemetry/resource-detector-aws and 3 tasks it depends on (7s) | ||
``` | ||
|
||
Once the command is done you can `cd` into the package and start using the usual commands. | ||
|
||
### CHANGELOG | ||
|
||
The conventional commit type (in PR title) is very important to automatically bump versions on release. For instance: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note to self: although manual release is unlikely to happen we should provide a way to do it. So we need to provide an alternative to the command Do not merge this PR until this is resolved. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is now implemented in |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,14 +32,13 @@ Create a new branch called `x.y.z-proposal` from the current commit. | |
Decide on the next `major.minor.patch` release number based on [semver](http://semver.org/) guidelines. | ||
|
||
- Use `npm install` command to initialize all package directories | ||
- Use `lerna publish --skip-npm --no-git-tag-version --no-push` to bump the version in all `package.json` | ||
- Use `npm run bootstrap` to generate latest `version.ts` files | ||
- Use `node ./scripts/bump-pacakge-versions.mjs` to bump the version in all `package.json` | ||
|
||
## Use the Changelog to create a GitHub Release | ||
|
||
### Generate the changelog with lerna | ||
|
||
Since we use `lerna`, we can use [lerna-changelog](https://github.com/lerna/lerna-changelog#lerna-changelog) | ||
We use [lerna-changelog](https://github.com/lerna/lerna-changelog#lerna-changelog) | ||
|
||
#### How to use | ||
|
||
|
@@ -90,19 +89,14 @@ Create a pull request titled `chore: x.y.z release proposal`. The commit body sh | |
|
||
Merge the PR, and pull the changes locally (using the commands in the first step). Ensure that `chore: x.y.z release proposal` is the most recent commit. | ||
|
||
## Publish all packages | ||
## Compile all packages | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note to reviewer: IMO this step was missing since |
||
|
||
Go into each directory and use `npm publish` (requires permissions) to publish the package. You can use the following script to automate this. | ||
Go into the root folder and run `npm ci && npm run compile` to build all packages with the latest version of the code. | ||
|
||
```bash | ||
#!/bin/bash | ||
## Publish all packages | ||
|
||
for dir in $(ls packages); do | ||
pushd packages/$dir | ||
npm publish | ||
popd | ||
done | ||
``` | ||
Use the dedicated script for publishing by running the command `node ./scripts/publish-to-npm.mjs` in the root folder. The script will | ||
walk over all non private packages and publish the ones that has not been published yet. | ||
|
||
Check your e-mail and make sure the number of “you’ve published this module” emails matches the number you expect. | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,17 +18,22 @@ | |
"^compile" | ||
], | ||
"inputs": [ | ||
"{projectRoot}/src", | ||
"{projectRoot}/test" | ||
"{projectRoot}/src/**/*.ts", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note to reviewer: although |
||
"{projectRoot}/test/**/*.ts" | ||
], | ||
"outputs": [ | ||
"{projectRoot}/build" | ||
] | ||
}, | ||
"watch": { | ||
"dependsOn": [ | ||
"compile" | ||
] | ||
}, | ||
"lint": { | ||
"inputs": [ | ||
"{projectRoot}/src", | ||
"{projectRoot}/test" | ||
"{projectRoot}/src/**/*.ts", | ||
"{projectRoot}/test/**/*.ts" | ||
] | ||
}, | ||
"version:update": { | ||
|
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.
note for reviewer: this script was used only here so now it's changed to walk over all packages to do the API check.