Skip to content

Commit

Permalink
chore: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
david-luna committed Nov 13, 2024
1 parent fb4df28 commit 9f37712
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ docs

#lerna
.changelog
package.json.lerna_backup

# OS generated files
.DS_Store
Expand Down
25 changes: 24 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
Expand All @@ -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 ussual commands.

### CHANGELOG

The conventional commit type (in PR title) is very important to automatically bump versions on release. For instance:
Expand Down
15 changes: 5 additions & 10 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 9f37712

Please sign in to comment.