Skip to content

Commit f04c640

Browse files
david-lunapichlermarctrentm
authored
chore: upgrade lerna (#2836)
Co-authored-by: Marc Pichler <[email protected]> Co-authored-by: Trent Mick <[email protected]>
1 parent 3a5378c commit f04c640

File tree

82 files changed

+2700
-6594
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+2700
-6594
lines changed

.github/workflows/peer-api.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
run: npm ci
2020

2121
- name: Check API dependency semantics
22-
run: npx lerna exec "node \$LERNA_ROOT_PATH/scripts/peer-api-check.js"
22+
run: node ./scripts/peer-api-check.js

.github/workflows/release-please-validate.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ jobs:
1515
- name: Checkout
1616
uses: actions/checkout@v4
1717

18-
- name: Install lerna
19-
run: npm install -g [email protected]
18+
- name: Install glob
19+
run: npm install glob
2020

2121
- name: Ensure Release Please Config and Manifest are in sync with the repository
2222
run: node scripts/check-release-please.mjs

.github/workflows/release-please.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
7575
# Release Please has already incremented versions and published tags, so we just
7676
# need to publish all unpublished versions to npm here
77-
# See: https://github.com/lerna/lerna/tree/main/commands/publish#bump-from-package
77+
# See: https://github.com/lerna/lerna/tree/main/libs/commands/publish#bump-from-package
7878
- name: Publish to npm
7979
# only publish if a release has been created
8080
if: ${{ steps.release.outputs.releases_created }}

.github/workflows/test-all-versions.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ jobs:
3737
uses: actions/upload-artifact@v4
3838
with:
3939
name: tav-build-cache-${{ github.run_number }}
40-
path: node_modules/.cache/nx
40+
path: .nx
41+
include-hidden-files: true
42+
if-no-files-found: error
4143
retention-days: 1
4244

4345
tav:
@@ -169,7 +171,7 @@ jobs:
169171
uses: actions/download-artifact@v4
170172
with:
171173
name: tav-build-cache-${{ github.run_number }}
172-
path: node_modules/.cache/nx
174+
path: .nx
173175
- name: Build
174176
run: npm run compile
175177
- name: Run test-all-versions

.github/workflows/unit-test.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ jobs:
2525
run: npm ci
2626
- name: Build
2727
run: npm run compile
28-
- name: Upload build artifact
28+
- name: Upload Build Artifacts
2929
uses: actions/upload-artifact@v4
3030
with:
3131
name: tests-build-cache-${{ github.run_number }}
32-
path: node_modules/.cache/nx
32+
path: .nx
33+
include-hidden-files: true
34+
if-no-files-found: error
3335
retention-days: 1
3436

3537
unit-test:
@@ -182,7 +184,7 @@ jobs:
182184
uses: actions/download-artifact@v4
183185
with:
184186
name: tests-build-cache-${{ github.run_number }}
185-
path: node_modules/.cache/nx
187+
path: .nx
186188
- name: Build
187189
run: npm run compile
188190
- name: Unit tests (Full)
@@ -223,7 +225,7 @@ jobs:
223225
uses: actions/download-artifact@v4
224226
with:
225227
name: tests-build-cache-${{ github.run_number }}
226-
path: node_modules/.cache/nx
228+
path: .nx
227229
- name: Build
228230
run: npm run compile
229231
- name: Unit tests

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ docs
6969

7070
#lerna
7171
.changelog
72-
package.json.lerna_backup
72+
.nx
7373

7474
# OS generated files
7575
.DS_Store

CONTRIBUTING.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,23 @@ Refer to the root-level [package.json](https://github.com/open-telemetry/opentel
108108

109109
The `opentelemetry-js-contrib` project is written in TypeScript.
110110

111-
As a general rule, installing and then compiling from the root directory should always be done first before anything else.
112-
After making changes to a specific package, compile again from the specific package directory you are working in.
113-
Some tests depend on other packages to be installed, so these steps are also required for running tests.
111+
As a general rule, installing from the root directory should always be done first before anything else.
112+
Packages within this repository might have dependencies between them. This means the dependencies should
113+
be built before if you want to `compile` or `test` the changes you've made in a package. Each package
114+
has a script to ensure these dependecies are ready.
115+
116+
The required steps to start development on a pacakge are:
117+
118+
- `npm ci` from root folder to install dependencies ([see npm-ci docs](https://docs.npmjs.com/cli/v10/commands/npm-ci))
119+
- `cd` into the pacakge you want to apply changes.
120+
- `npm run setup:dev` compiles the TypeScript files for this package and its dependencies within the repository.
121+
122+
Then you can proceed to do apply the changes and use the scripts below for development workflow
114123

115-
- `npm ci` installs dependencies ([see npm-ci docs](https://docs.npmjs.com/cli/v10/commands/npm-ci))
116124
- `npm run compile` compiles the code, checking for type errors.
117125
- `npm test` runs most unit tests, though some packages require other dependencies so are only run in CI or with a separate command in the package's `package.json` file.
118126
- `npm run lint:fix` lint any changes and fix if needed.
119127

120-
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.
121-
122128
### CHANGELOG
123129

124130
The conventional commit type (in PR title) is very important to automatically bump versions on release. For instance:

RELEASING.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ Decide on the next `major.minor.patch` release number based on [semver](http://s
3333

3434
- Use `npm install` command to initialize all package directories
3535
- Use `lerna publish --skip-npm --no-git-tag-version --no-push` to bump the version in all `package.json`
36-
- Use `npm run bootstrap` to generate latest `version.ts` files
3736

3837
## Use the Changelog to create a GitHub Release
3938

@@ -90,18 +89,16 @@ Create a pull request titled `chore: x.y.z release proposal`. The commit body sh
9089

9190
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.
9291

93-
## Publish all packages
92+
## Compile all packages
9493

95-
Go into each directory and use `npm publish` (requires permissions) to publish the package. You can use the following script to automate this.
94+
Go into the root folder and run `npm ci && npm run compile` to build all packages with the latest version of the code.
9695

97-
```bash
98-
#!/bin/bash
96+
## Publish all packages
97+
98+
Use lerna's `publish` command to walk over all non private packages and publish the ones that has not been published yet.
9999

100-
for dir in $(ls packages); do
101-
pushd packages/$dir
102-
npm publish
103-
popd
104-
done
100+
```sh
101+
npx lerna publish from-package --no-push --no-private --no-git-tag-version --no-verify-access --yes
105102
```
106103

107104
Check your e-mail and make sure the number of “you’ve published this module” emails matches the number you expect.

detectors/node/opentelemetry-resource-detector-alibaba-cloud/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
"repository": "open-telemetry/opentelemetry-js-contrib",
99
"scripts": {
1010
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json",
11+
"setup:dev": "nx run-many -t compile -p @opentelemetry/resource-detector-alibaba-cloud",
1112
"compile": "tsc --build tsconfig.json tsconfig.esm.json",
1213
"lint": "eslint . --ext .ts",
1314
"lint:fix": "eslint . --ext .ts --fix",
14-
"prewatch": "npm run precompile",
1515
"prepublishOnly": "npm run compile",
1616
"test": "nyc mocha 'test/**/*.test.ts'",
1717
"tdd": "npm run test -- --watch-extensions ts --watch",

detectors/node/opentelemetry-resource-detector-aws/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
"repository": "open-telemetry/opentelemetry-js-contrib",
99
"scripts": {
1010
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json",
11+
"setup:dev": "nx run-many -t compile -p @opentelemetry/resource-detector-aws",
1112
"compile": "tsc --build tsconfig.json tsconfig.esm.json",
1213
"lint": "eslint . --ext .ts",
1314
"lint:fix": "eslint . --ext .ts --fix",
14-
"prewatch": "npm run precompile",
1515
"prepublishOnly": "npm run compile",
1616
"test": "nyc mocha 'test/**/*.test.ts'",
1717
"tdd": "npm run test -- --watch-extensions ts --watch",

0 commit comments

Comments
 (0)