Required:
- Node.js (minimum version declared in package.json)
Recommended:
- Docker & Docker Compose - Required for running smoke-tests.
- Docker Desktop is a reliable choice if you don't have your own preference.
- remake - A better make.
- Each script defined in package.json is also a make target.
View them with
remake --tasks
. - Make? When we've got npm scripts? Yes. See Make Is Cool
- Each script defined in package.json is also a make target.
View them with
- VS Code - plugins:
- ESLint (dbaeumer.vscode-eslint)
- Prettier (esbenp.prettier-vscode)
- Prettier ESLint (rvest.vs-code-prettier-eslint)
When you first clone the project:
# from the top-level directory:
npm install
The build command compiles the typescript to javascript in a dist
directory.
The clean command removes the compiled javascript code from the dist
directory.
# from the top-level directory:
npm run build
npm run clean
Format and lint scripts
npm run check-format
will specify files that will have formatting changes made.
npm run format
will fix the changes; most times you'll just want to run this command.
npm run lint
will specify files that have linting errors.
npm run lint-fix
will try to fix the linting errors.
Testing scripts
npm run test
will run the unit tests, it is on silent by default for verbose output of console logs and warnings use npm run test-verbose
- Hello World is a simple javascript application. It has a readme for example development.
To run the example from the root directory, run npm run example-node
.
- Hello World Express is a simple javascript application that uses Express.
To run the example from the root directory, run npm run example-node-express
.
To get a tarball to use as a local dependency, after cleaning and building run npm pack
:
npm install
npm run clean
npm run build
npm pack
This creates a file in the root directory like this: honeycombio-opentelemetry-node-0.1.42-beta.tgz
To use as a dependency in another project, install it with npm
:
npm install honeycombio-opentelemetry-node-0.1.1-beta.tgz
This will create a dependency in your package.json
like this:
"dependencies": {
"@honeycombio/opentelemetry-node": "file:honeycombio-opentelemetry-node-0.1.42-beta.tgz",
}
This is one of several projects maintained by the same group of people.
That group has settled on Makefiles as a way to smooth the context-switching that occurs when moving between projects written in different languages using different tooling.
Makefiles let us have a common set of commands in our workflows across projects.
The command below use remake, but are equally effective with make
.
When you first clone the project:
# from the top-level directory, see the common project tasks
remake --tasks
# install dependencies and run the routine code checks
remake
The build target compiles the typescript to javascript in a dist
directory.
The clean target removes the compiled javascript code from the dist
directory.
# from the top-level directory:
remake build
remake clean
Format and lint scripts
remake check-format
will specify files that will have formatting changes made.
remake format
will fix the changes; most times you'll just want to run this command.
remake lint
will specify files that have linting errors.
remake lint-fix
will try to fix the linting errors.
Testing scripts
remake test
will run the unit tests