From 9f3771211e743be7d29f034feebc72c4b1f0de09 Mon Sep 17 00:00:00 2001 From: David Luna Date: Wed, 13 Nov 2024 16:34:08 +0100 Subject: [PATCH] chore: update docs --- .gitignore | 1 - CONTRIBUTING.md | 25 ++++++++++++++++++++++++- RELEASING.md | 15 +++++---------- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index e60a42e810..578355793a 100644 --- a/.gitignore +++ b/.gitignore @@ -69,7 +69,6 @@ docs #lerna .changelog -package.json.lerna_backup # OS generated files .DS_Store diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a47d95ac8c..eba8b0fd39 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 + +> opentelemetry-contrib@0.1.0 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 ussual commands. + ### CHANGELOG The conventional commit type (in PR title) is very important to automatically bump versions on release. For instance: diff --git a/RELEASING.md b/RELEASING.md index 6c65f0a119..6f5d4dcbcf 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -90,19 +90,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 -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.