Skip to content

Commit 9c525e9

Browse files
feat: migrate from moon to turbo
1 parent ac96aa0 commit 9c525e9

17 files changed

Lines changed: 251 additions & 193 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
cache: pnpm
2424
node-version-file: .nvmrc
2525
- run: pnpm install --frozen-lockfile --prefer-offline
26-
- run: pnpm moon check --all
26+
- run: pnpm turbo run lint typecheck test
2727

2828
list-examples:
2929
runs-on: "ubuntu-latest"
@@ -61,7 +61,7 @@ jobs:
6161
cache: pnpm
6262
node-version: ${{ matrix.node-version }}
6363
- run: pnpm install --frozen-lockfile --prefer-offline
64-
- run: pnpm moon run :build
64+
- run: pnpm turbo run build
6565

6666
- name: Run benchmarks with tinybench-plugin
6767
# use version from `main` branch to always test the latest version, in real projects, use a tag, like `@v2`
@@ -95,14 +95,14 @@ jobs:
9595
cache: pnpm
9696
node-version-file: .nvmrc
9797
- run: pnpm install --frozen-lockfile --prefer-offline
98-
- run: pnpm moon run :build
98+
- run: pnpm turbo run build
9999

100100
- name: Run benchmarks
101101
uses: CodSpeedHQ/action@main
102102
env:
103103
CODSPEED_SKIP_UPLOAD: "true"
104104
with:
105-
run: pnpm moon run vitest-plugin:bench
105+
run: pnpm turbo run bench --filter=@codspeed/vitest-plugin
106106
mode: walltime
107107
# TODO: Remove this once the runner has been released with macos support
108108
runner-version: branch:main

.github/workflows/codspeed.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ jobs:
2121
cache: pnpm
2222
node-version-file: .nvmrc
2323
- run: pnpm install --frozen-lockfile --prefer-offline
24-
- run: pnpm moon run :build
24+
- run: pnpm turbo run build
2525

2626
- name: Run simulation benchmarks
2727
uses: CodSpeedHQ/action@main
2828
with:
2929
mode: simulation
3030
run: |
31-
pnpm moon run tinybench-plugin:bench
32-
pnpm moon run vitest-plugin:bench
33-
pnpm moon run benchmark.js-plugin:bench
31+
pnpm turbo run bench --filter=@codspeed/tinybench-plugin
32+
pnpm turbo run bench --filter=@codspeed/vitest-plugin
33+
pnpm turbo run bench --filter=@codspeed/benchmark.js-plugin
3434
pnpm --workspace-concurrency 1 -r bench-tinybench
3535
pnpm --workspace-concurrency 1 -r bench-benchmark-js
3636
pnpm --workspace-concurrency 1 -r bench-vitest
@@ -40,9 +40,9 @@ jobs:
4040
with:
4141
mode: memory
4242
run: |
43-
pnpm moon run tinybench-plugin:bench
44-
pnpm moon run vitest-plugin:bench
45-
pnpm moon run benchmark.js-plugin:bench
43+
pnpm turbo run bench --filter=@codspeed/tinybench-plugin
44+
pnpm turbo run bench --filter=@codspeed/vitest-plugin
45+
pnpm turbo run bench --filter=@codspeed/benchmark.js-plugin
4646
pnpm --workspace-concurrency 1 -r bench-tinybench
4747
pnpm --workspace-concurrency 1 -r bench-benchmark-js
4848
pnpm --workspace-concurrency 1 -r bench-vitest
@@ -61,16 +61,16 @@ jobs:
6161
cache: pnpm
6262
node-version-file: .nvmrc
6363
- run: pnpm install --frozen-lockfile --prefer-offline
64-
- run: pnpm moon run :build
64+
- run: pnpm turbo run build
6565

6666
- name: Run benchmarks
6767
# use version from `main` branch to always test the latest version, in real projects, use a tag, like `@v2`
6868
uses: CodSpeedHQ/action@main
6969
with:
7070
mode: walltime
7171
run: |
72-
pnpm moon run tinybench-plugin:bench
73-
pnpm moon run vitest-plugin:bench
74-
pnpm moon run benchmark.js-plugin:bench
72+
pnpm turbo run bench --filter=@codspeed/tinybench-plugin
73+
pnpm turbo run bench --filter=@codspeed/vitest-plugin
74+
pnpm turbo run bench --filter=@codspeed/benchmark.js-plugin
7575
pnpm --workspace-concurrency 1 -r bench-tinybench
7676
pnpm --workspace-concurrency 1 -r bench-vitest

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
matrix:
1717
platform:
18-
# The x86_64 Linux prebuild is generated when running pnpm moon run :build in the `build` job
18+
# The x86_64 Linux prebuild is generated when running pnpm turbo run build in the `build` job
1919
- runs-on: codspeedhq-arm64-ubuntu-22.04
2020
name: linux-arm
2121
- runs-on: macos-latest
@@ -35,7 +35,7 @@ jobs:
3535
node-version-file: .nvmrc
3636
- run: pnpm install --frozen-lockfile --prefer-offline
3737
- name: Build native addon
38-
run: pnpm moon core:build-native-addon
38+
run: pnpm turbo run build-native-addon --filter=@codspeed/core
3939
- name: Upload prebuilds
4040
uses: actions/upload-artifact@v4
4141
with:
@@ -59,7 +59,7 @@ jobs:
5959
registry-url: "https://registry.npmjs.org"
6060
- run: pnpm install --frozen-lockfile --prefer-offline
6161
- name: Build the libraries
62-
run: pnpm moon run :build
62+
run: pnpm turbo run build
6363

6464
- name: Download prebuilds
6565
uses: actions/download-artifact@v4

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ packages/app/.env
129129
.vercel
130130
.DS_Store
131131

132-
# moon
133-
.moon/cache
134-
.moon/docker
132+
# turbo
133+
.turbo/
135134
.rollup.cache/

package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
{
22
"name": "root",
33
"private": true,
4+
"scripts": {
5+
"build": "turbo run build",
6+
"test": "turbo run test",
7+
"lint": "turbo run lint",
8+
"typecheck": "turbo run typecheck",
9+
"format": "turbo run format",
10+
"fix-format": "turbo run fix-format",
11+
"clean": "turbo run clean",
12+
"check": "turbo run lint typecheck test"
13+
},
414
"devDependencies": {
515
"@commitlint/cli": "^17.5.1",
616
"@commitlint/config-conventional": "^17.4.4",
7-
"@moonrepo/cli": "1.37.3",
817
"@rollup/plugin-commonjs": "^25.0.7",
918
"@rollup/plugin-json": "^6.0.1",
1019
"@rollup/plugin-node-resolve": "^15.2.3",
@@ -29,6 +38,7 @@
2938
"rollup-plugin-esbuild": "^6.1.0",
3039
"ts-jest": "^29.1.0",
3140
"tslib": "^2.5.0",
41+
"turbo": "^2.5.6",
3242
"typescript": "4.9.4"
3343
},
3444
"packageManager": "pnpm@10.12.4",

packages/benchmark.js-plugin/moon.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/benchmark.js-plugin/package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@
1414
"files": [
1515
"dist"
1616
],
17+
"scripts": {
18+
"build": "NODE_NO_WARNINGS=1 rollup -c rollup.config.ts --configPlugin typescript",
19+
"test": "jest --passWithNoTests --silent",
20+
"test/integ": "jest --passWithNoTests --silent -c jest.config.integ.js",
21+
"lint": "eslint .",
22+
"typecheck": "tsc --noEmit --pretty",
23+
"format": "prettier --config ../../.prettierrc.json --ignore-path ../../.prettierignore --check .",
24+
"fix-format": "prettier --config ../../.prettierrc.json --ignore-path ../../.prettierignore --write .",
25+
"bench": "node -r esbuild-register benches/sample.ts",
26+
"clean": "rm -rf dist"
27+
},
1728
"author": "Arthur Pastel <arthur@codspeed.io>",
1829
"repository": "https://github.com/CodSpeedHQ/codspeed-node",
1930
"homepage": "https://codspeed.io",

packages/core/moon.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

packages/core/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@
1515
"module": "dist/index.es5.js",
1616
"types": "dist/index.d.ts",
1717
"gypfile": true,
18+
"scripts": {
19+
"build": "NODE_NO_WARNINGS=1 rollup -c rollup.config.ts --configPlugin typescript",
20+
"build-native-addon": "prebuildify --napi --strip",
21+
"build-tracer-client": "openapi --client axios --input ./tracer.spec.json --name MongoTracer --output ./src/generated/openapi",
22+
"test": "jest --passWithNoTests --silent",
23+
"test/integ": "jest --passWithNoTests --silent -c jest.config.integ.js",
24+
"lint": "eslint .",
25+
"typecheck": "tsc --noEmit --pretty",
26+
"format": "prettier --config ../../.prettierrc.json --ignore-path ../../.prettierignore --check .",
27+
"fix-format": "prettier --config ../../.prettierrc.json --ignore-path ../../.prettierignore --write .",
28+
"clean": "rm -rf dist build generated/openapi"
29+
},
1830
"author": "Arthur Pastel <arthur@codspeed.io>",
1931
"repository": "https://github.com/CodSpeedHQ/codspeed-node",
2032
"homepage": "https://codspeed.io",

packages/core/src/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ export type {
7676
SetupInstrumentsResponse,
7777
} from "./generated/openapi";
7878
export { getV8Flags, tryIntrospect } from "./introspection";
79+
export {
80+
MARKER_TYPE_BENCHMARK_END,
81+
MARKER_TYPE_BENCHMARK_START,
82+
MARKER_TYPE_SAMPLE_END,
83+
MARKER_TYPE_SAMPLE_START,
84+
} from "./native_core/instruments/hooks";
7985
export { optimizeFunction, optimizeFunctionSync } from "./optimization";
8086
export * from "./utils";
8187
export * from "./walltime";
8288
export type { InstrumentMode };
8389
export const InstrumentHooks = native_core.InstrumentHooks;
84-
export {
85-
MARKER_TYPE_SAMPLE_START,
86-
MARKER_TYPE_SAMPLE_END,
87-
MARKER_TYPE_BENCHMARK_START,
88-
MARKER_TYPE_BENCHMARK_END,
89-
} from "./native_core/instruments/hooks";

0 commit comments

Comments
 (0)