Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
swap npm run for yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasBa committed Jan 4, 2024
1 parent 4d0156e commit 3916d0d
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 39 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ jobs:
# configure build test copy x64
- name: Configure gyp
if: matrix.arch != 'arm64'
run: npm run build:configure
run: yarn build:configure

- name: Build bindings
if: matrix.arch != 'arm64'
run: npm run build:bindings
run: yarn build:bindings

- name: Test
if: matrix.arch != 'arm64'
run: npm run test --silent
run: yarn test --silent

# configure build test copy arm64
- name: setup (arm64, ${{ contains(matrix.container, 'alpine') && 'musl' || 'glibc' }})
Expand All @@ -184,7 +184,7 @@ jobs:
# linux arm64
- name: "Configure gyp (arm64, ${{ contains(matrix.container, 'alpine') && 'musl' || 'glibc' }})"
if: matrix.arch == 'arm64' && matrix.target_platform != 'darwin'
run: npm run build:configure:arm64
run: yarn build:configure:arm64

- name: Setup musl cross compiler
if: contains(matrix.container, 'alpine')
Expand All @@ -198,24 +198,24 @@ jobs:
run: |
CC=$(pwd)/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc \
CXX=$(pwd)/aarch64-linux-musl-cross/bin/aarch64-linux-musl-g++ \
BUILD_ARCH=arm64 npm run build:bindings
BUILD_ARCH=arm64 yarn build:bindings
- name: "Build bindings (arm64, ${{ contains(matrix.container, 'alpine') && 'musl' || 'glibc' }})"
if: matrix.arch == 'arm64' && !contains(matrix.container, 'alpine') && matrix.target_platform != 'darwin'
run: |
CC=aarch64-linux-gnu-gcc \
CXX=aarch64-linux-gnu-g++ \
BUILD_ARCH=arm64 npm run build:bindings:arm64
BUILD_ARCH=arm64 yarn build:bindings:arm64
# linux arm64 target darwin
- name: "Configure gyp (arm64, darwin)"
if: matrix.arch == 'arm64' && matrix.target_platform == 'darwin'
run: npm run build:configure:arm64
run: yarn build:configure:arm64

- name: "Build bindings (arm64, darwin)"
if: matrix.arch == 'arm64' && matrix.target_platform == 'darwin'
run: |
BUILD_PLATFORM=darwin BUILD_ARCH=arm64 npm run build:bindings:arm64
BUILD_PLATFORM=darwin BUILD_ARCH=arm64 yarn build:bindings:arm64
# continue with common steps
- name: Log binary
Expand All @@ -237,12 +237,12 @@ jobs:
with:
node-version: 18
- run: npm ci
- run: npm run build:lib
- run: yarn build:lib
- uses: actions/download-artifact@v3
with:
name: binaries-${{ github.sha }}
path: build/
- run: npm run test:bundle
- run: yarn test:bundle

build-and-pack:
runs-on: ubuntu-latest
Expand All @@ -256,7 +256,7 @@ jobs:
node-version: 18

- run: npm ci
- run: npm run build:lib
- run: yarn build:lib

- uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -311,7 +311,7 @@ jobs:
node-version: 18

- run: npm install --ignore-scripts
- run: npm run build:lib
- run: yarn build:lib

- uses: actions/download-artifact@v3
with:
Expand All @@ -320,7 +320,7 @@ jobs:
- run: ls -l build/

- run: npm link
- run: npm run test:setup:bundle
- run: npm run test:${{matrix.bundler}}:build
- run: npm run test:${{matrix.bundler}}:run
- run: yarn test:setup:bundle
- run: yarn test:${{matrix.bundler}}:build
- run: yarn test:${{matrix.bundler}}:run
- run: rm -rf ./node_modules/ && npm install --omit=dev && node scripts/check-build.mjs
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- run: |
git config clangFormat.binary node_modules/.bin/clang-format
git config clangFormat.style file
npm run lint
yarn lint
build-test-matrix:
strategy:
Expand All @@ -33,13 +33,13 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- run: npm run clean
- run: yarn clean

- name: Setup windows build tools
uses: microsoft/[email protected]
if: ${{ runner.os == 'Windows' }}

- run: npm install
- run: npm run build:configure
- run: npm run build
- run: npm run test --silent
- run: yarn build:configure
- run: yarn build
- run: yarn test --silent
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ Because the repository requires you to compile the c++ bindings via node-gyp, we

Since we are using [`TypeScript`](https://www.typescriptlang.org/) and native node addons, you need to transpile the code to JavaScript and compile the c++ bindings in order to be able to run the addon.

- `npm run build` will compile the c++ bindings and ts files.
- `npm run build:lib` will compile ts files
- `npm run build:bindings` will compile c++ bindings
- `yarn build` will compile the c++ bindings and ts files.
- `yarn build:lib` will compile ts files
- `yarn build:bindings` will compile c++ bindings

## Tests

Tests are colocated with source files and should have a .test.ts suffix. The entire test suite can be ran using the `npm run test` command.
Tests are colocated with source files and should have a .test.ts suffix. The entire test suite can be ran using the `yarn test` command.

## Linting

Similar to building and testing, linting can be done via `npm run lint` command.
Similar to building and testing, linting can be done via `yarn lint` command.

## Considerations Before Sending Your First PR

Expand All @@ -42,7 +42,7 @@ When contributing to the codebase, please note:

## Benchmarks

The repository contains micro benchmarks. You can find all benchmarks at the benchmarks folder in project root directory. The benchmarks can either be ran directly through node via `node benchmarks/cpu/benchmark.profiler.js` or via `npm run benchmark` command. There are also individual npm run benchmark commands like `npm run benchmark:server` or `npm run benchmark:methods` which will only run individual benchmarks.
The repository contains micro benchmarks. You can find all benchmarks at the benchmarks folder in project root directory. The benchmarks can either be ran directly through node via `node benchmarks/cpu/benchmark.profiler.js` or via `yarn benchmark` command. There are also individual yarn benchmark commands like `yarn benchmark:server` or `yarn benchmark:methods` which will only run individual benchmarks.

Remember that these are micro benchmarks and that results will vary across different OS and architectures.

Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@
"scripts": {
"install": "node scripts/check-build.mjs",
"clean": "rm -rf ./build && rm -rf build",
"lint": "npm run lint:eslint && npm run lint:clang",
"lint": "yarn lint:eslint && yarn lint:clang",
"lint:eslint": "eslint . --format stylish",
"lint:clang": "./node_modules/.bin/check-clang-format --style=file",
"lint:fix": "npm run lint:fix:eslint && npm run lint:fix:clang",
"lint:fix": "yarn lint:fix:eslint && yarn lint:fix:clang",
"lint:fix:eslint": "eslint . --format stylish --fix",
"lint:fix:clang": "./node_modules/.bin/clang-format --style=file -i ./**/*.cc ",
"build": "npm run build:bindings && npm run build:lib",
"build": "yarn build:bindings && yarn build:lib",
"build:lib": "tsc -p ./tsconfig.types.json && node ./esbuild.mjs",
"build:configure": "node-gyp configure",
"build:configure:arm64": "node-gyp configure --arch=arm64 --target_arch=arm64",
"build:bindings": "node-gyp build && node scripts/copy-target.mjs",
"build:bindings:arm64": "node-gyp build --arch=arm64 && node scripts/copy-target.mjs",
"build:benchmark:format": "node-gyp -DFORMAT_BENCHMARK=1 build",
"build:dev": "npm run clean && npm run build:configure && npm run build",
"benchmark": "npm run benchmark:methods && npm run benchmark:profiler && npm run benchmark:server && npm run benchmark:format",
"build:dev": "yarn clean && yarn build:configure && yarn build",
"benchmark": "yarn benchmark:methods && yarn benchmark:profiler && yarn benchmark:server && yarn benchmark:format",
"benchmark:methods": "node benchmarks/cpu/benchmark.methods.js",
"benchmark:profiler": "node benchmarks/cpu/benchmark.profiler.js",
"benchmark:server": "node benchmarks/cpu/benchmark.server.js",
Expand All @@ -55,13 +55,13 @@
"test:setup:bundle": "(npm link && cd demo_app && npm install && npm link @sentry/profiling-node)",
"test:esbuild:build": "node ./demo_app/esbuild.mjs",
"test:esbuild:run": "BUNDLER=esbuild node ./demo_app/dist/esbuild/index.js",
"test:esbuild": "npm run test:esbuild:build && npm run test:esbuild:run",
"test:esbuild": "yarn test:esbuild:build && yarn test:esbuild:run",
"test:webpack:build": "webpack --config ./demo_app/webpack.config.js",
"test:webpack:run": "BUNDLER=webpack node ./demo_app/dist/webpack/index.js",
"test:webpack": "npm run test:webpack:build && npm run test:webpack:run",
"test:webpack": "yarn test:webpack:build && yarn test:webpack:run",
"test:rollup:build": "rollup --config ./demo_app/rollup.config.js",
"test:rollup:run": "BUNDLER=rollup node ./demo_app/dist/rollup/index.js",
"test:rollup": "npm run test:rollup:build && npm run test:rollup:run",
"test:rollup": "yarn test:rollup:build && yarn test:rollup:run",
"test": "cross-env SENTRY_PROFILER_BINARY_DIR=./build jest --config jest.config.ts"
},
"keywords": [
Expand Down
10 changes: 5 additions & 5 deletions scripts/benchmark-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ if [[ -n $(git status -s) ]]; then
fi

git checkout "$BEFORE";
npm run build:benchmark:format;
RUN_NAME=$BEFORE npm run benchmark:format;
yarn build:benchmark:format;
RUN_NAME=$BEFORE yarn benchmark:format;
git stash;
git checkout "$AFTER";
git stash pop;
npm run build:benchmark:format;
RUN_NAME=$AFTER npm run benchmark:format;
BEFORE="$BEFORE" AFTER="$AFTER" npm run benchmark:format;
yarn build:benchmark:format;
RUN_NAME=$AFTER yarn benchmark:format;
BEFORE="$BEFORE" AFTER="$AFTER" yarn benchmark:format;
git restore .;

0 comments on commit 3916d0d

Please sign in to comment.