Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
cache: pnpm
node-version-file: .nvmrc
- run: pnpm install --frozen-lockfile --prefer-offline
- run: pnpm moon check --all
- run: pnpm turbo run lint typecheck test

list-examples:
runs-on: "ubuntu-latest"
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
cache: pnpm
node-version: ${{ matrix.node-version }}
- run: pnpm install --frozen-lockfile --prefer-offline
- run: pnpm moon run :build
- run: pnpm turbo run build

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

- name: Run benchmarks
uses: CodSpeedHQ/action@main
env:
CODSPEED_SKIP_UPLOAD: "true"
# Samply fails to profile pnpm targets for now
CODSPEED_PROFILER_ENABLED: "false"
with:
run: pnpm moon run vitest-plugin:bench
run: pnpm turbo run bench --filter=@codspeed/vitest-plugin
mode: walltime
# TODO: Remove this once the runner has been released with macos support
runner-version: branch:main
22 changes: 11 additions & 11 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ jobs:
cache: pnpm
node-version-file: .nvmrc
- run: pnpm install --frozen-lockfile --prefer-offline
- run: pnpm moon run :build
- run: pnpm turbo run build

- name: Run simulation benchmarks
uses: CodSpeedHQ/action@main
with:
mode: simulation
run: |
pnpm moon run tinybench-plugin:bench
pnpm moon run vitest-plugin:bench
pnpm moon run benchmark.js-plugin:bench
pnpm turbo run bench --filter=@codspeed/tinybench-plugin
pnpm turbo run bench --filter=@codspeed/vitest-plugin
pnpm turbo run bench --filter=@codspeed/benchmark.js-plugin
pnpm --workspace-concurrency 1 -r bench-tinybench
pnpm --workspace-concurrency 1 -r bench-benchmark-js
pnpm --workspace-concurrency 1 -r bench-vitest
Expand All @@ -40,9 +40,9 @@ jobs:
with:
mode: memory
run: |
pnpm moon run tinybench-plugin:bench
pnpm moon run vitest-plugin:bench
pnpm moon run benchmark.js-plugin:bench
pnpm turbo run bench --filter=@codspeed/tinybench-plugin
pnpm turbo run bench --filter=@codspeed/vitest-plugin
pnpm turbo run bench --filter=@codspeed/benchmark.js-plugin
pnpm --workspace-concurrency 1 -r bench-tinybench
pnpm --workspace-concurrency 1 -r bench-benchmark-js
pnpm --workspace-concurrency 1 -r bench-vitest
Expand All @@ -61,16 +61,16 @@ jobs:
cache: pnpm
node-version-file: .nvmrc
- run: pnpm install --frozen-lockfile --prefer-offline
- run: pnpm moon run :build
- run: pnpm turbo run build

- name: Run benchmarks
# use version from `main` branch to always test the latest version, in real projects, use a tag, like `@v2`
uses: CodSpeedHQ/action@main
with:
mode: walltime
run: |
pnpm moon run tinybench-plugin:bench
pnpm moon run vitest-plugin:bench
pnpm moon run benchmark.js-plugin:bench
pnpm turbo run bench --filter=@codspeed/tinybench-plugin
pnpm turbo run bench --filter=@codspeed/vitest-plugin
pnpm turbo run bench --filter=@codspeed/benchmark.js-plugin
pnpm --workspace-concurrency 1 -r bench-tinybench
pnpm --workspace-concurrency 1 -r bench-vitest
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
platform:
# The x86_64 Linux prebuild is generated when running pnpm moon run :build in the `build` job
# The x86_64 Linux prebuild is generated when running pnpm turbo run build in the `build` job
- runs-on: codspeedhq-arm64-ubuntu-22.04
name: linux-arm
- runs-on: macos-latest
Expand All @@ -35,7 +35,7 @@ jobs:
node-version-file: .nvmrc
- run: pnpm install --frozen-lockfile --prefer-offline
- name: Build native addon
run: pnpm moon core:build-native-addon
run: pnpm turbo run build-native-addon --filter=@codspeed/core
- name: Upload prebuilds
uses: actions/upload-artifact@v4
with:
Expand All @@ -59,7 +59,7 @@ jobs:
registry-url: "https://registry.npmjs.org"
- run: pnpm install --frozen-lockfile --prefer-offline
- name: Build the libraries
run: pnpm moon run :build
run: pnpm turbo run build

- name: Download prebuilds
uses: actions/download-artifact@v4
Expand Down
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ packages/app/.env
.vercel
.DS_Store

# moon
.moon/cache
.moon/docker
# turbo
.turbo/
.rollup.cache/
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm moon run :lint :format :typecheck --affected --status=staged
pnpm turbo run lint format typecheck --affected

28 changes: 19 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,45 @@
{
"name": "root",
"private": true,
"scripts": {
"build": "turbo run build",
"test": "turbo run test",
"lint": "turbo run lint",
"typecheck": "turbo run typecheck",
"format": "turbo run format",
"fix-format": "turbo run fix-format",
"clean": "turbo run clean",
"check": "turbo run lint typecheck test"
},
"devDependencies": {
"@commitlint/cli": "^17.5.1",
"@commitlint/config-conventional": "^17.4.4",
"@moonrepo/cli": "1.37.3",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.0.1",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.5",
"@types/jest": "^29.5.0",
"@types/node": "^20.5.1",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"@typescript-eslint/eslint-plugin": "^8.57.0",
"@typescript-eslint/parser": "^8.57.0",
"esbuild": "^0.17.16",
"esbuild-register": "^3.4.2",
"eslint": "^7.32.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-import": "^2.27.5",
"eslint": "^8.57.1",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "^2.32.0",
"husky": "^7.0.4",
"jest": "^29.5.0",
"jest-config": "^29.5.0",
"lerna": "^6.6.1",
"prettier": "^2.8.7",
"prettier-plugin-organize-imports": "^3.2.2",
"prettier": "^3.8.3",
"prettier-plugin-organize-imports": "^4.3.0",
"rollup": "^4.47.1",
"rollup-plugin-dts": "^6.1.0",
"rollup-plugin-esbuild": "^6.1.0",
"ts-jest": "^29.1.0",
"tslib": "^2.5.0",
"typescript": "4.9.4"
"turbo": "^2.5.6",
"typescript": "^5.6.3"
},
"packageManager": "pnpm@10.12.4",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/benchmark.js-plugin/benches/parsePr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function sendEvent(numberOfOperations: number): void {

function logMetrics(
numberOfOperations: number,
numberOfDeepOperations: number
numberOfDeepOperations: number,
): void {
for (let i = 0; i < numberOfOperations; i++) {
for (let i = 0; i < numberOfOperations; i++) {
Expand Down
3 changes: 2 additions & 1 deletion packages/benchmark.js-plugin/benches/sample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import parsePr from "./parsePr";
const LONG_BODY =
new Array(1_000)
.fill(
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt, earum. Atque architecto vero veniam est tempora fugiat sint quo praesentium quia. Autem, veritatis omnis beatae iste delectus recusandae animi non."
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt, earum. Atque architecto vero veniam est tempora fugiat sint quo praesentium quia. Autem, veritatis omnis beatae iste delectus recusandae animi non.",
)
.join("\n") + "fixes #123";

Expand All @@ -16,6 +16,7 @@ suite
/o/.test("Hello World!");
})
.add("String#indexOf", function () {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
"Hello World!".indexOf("o") > -1;
})
.add("short body", () => {
Expand Down
9 changes: 0 additions & 9 deletions packages/benchmark.js-plugin/moon.yml

This file was deleted.

15 changes: 12 additions & 3 deletions packages/benchmark.js-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@
"files": [
"dist"
],
"scripts": {
"build": "NODE_NO_WARNINGS=1 rollup -c rollup.config.ts --configPlugin typescript",
"test": "jest --passWithNoTests --silent",
"test/integ": "jest --passWithNoTests --silent -c jest.config.integ.js",
"lint": "eslint .",
"typecheck": "tsc --noEmit --pretty",
"format": "prettier --config ../../.prettierrc.json --ignore-path ../../.prettierignore --check .",
"fix-format": "prettier --config ../../.prettierrc.json --ignore-path ../../.prettierignore --write .",
"bench": "node -r esbuild-register benches/sample.ts",
"clean": "rm -rf dist"
},
"author": "Arthur Pastel <arthur@codspeed.io>",
"repository": "https://github.com/CodSpeedHQ/codspeed-node",
"homepage": "https://codspeed.io",
Expand All @@ -22,14 +33,12 @@
"@babel/preset-env": "^7.22.5",
"@types/benchmark": "^2.1.2",
"@types/lodash": "^4.14.195",
"@types/stack-trace": "^0.0.30",
"benchmark": "^2.1.4",
"jest-mock-extended": "^3.0.4"
},
"dependencies": {
"@codspeed/core": "workspace:^5.4.0",
"lodash": "^4.17.10",
"stack-trace": "1.0.0-pre2"
"lodash": "^4.17.10"
},
"peerDependencies": {
"benchmark": "^2.1.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/benchmark.js-plugin/rollup.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from "rollup";
import { declarationsPlugin, jsPlugins } from "../../rollup.options";
import pkg from "./package.json" assert { type: "json" };
import pkg from "./package.json" with { type: "json" };

const entrypoint = "src/index.ts";

Expand Down
20 changes: 10 additions & 10 deletions packages/benchmark.js-plugin/src/__tests__/buildSuiteAdd.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ describe("buildSuiteAdd", () => {
suite.add({ name: "test", fn: emptyBench });
suite.forEach((bench: CodSpeedBenchmark) =>
expect(bench.uri).toBe(
"packages/benchmark.js-plugin/src/__tests__/buildSuiteAdd.test.ts::test"
)
"packages/benchmark.js-plugin/src/__tests__/buildSuiteAdd.test.ts::test",
),
);
});

Expand All @@ -28,8 +28,8 @@ describe("buildSuiteAdd", () => {
suite.add(emptyBench, { name: "test" });
suite.forEach((bench: CodSpeedBenchmark) =>
expect(bench.uri).toBe(
"packages/benchmark.js-plugin/src/__tests__/buildSuiteAdd.test.ts::test"
)
"packages/benchmark.js-plugin/src/__tests__/buildSuiteAdd.test.ts::test",
),
);
});

Expand All @@ -38,8 +38,8 @@ describe("buildSuiteAdd", () => {
suite.add("test", { fn: emptyBench });
suite.forEach((bench: CodSpeedBenchmark) =>
expect(bench.uri).toBe(
"packages/benchmark.js-plugin/src/__tests__/buildSuiteAdd.test.ts::test"
)
"packages/benchmark.js-plugin/src/__tests__/buildSuiteAdd.test.ts::test",
),
);
});

Expand All @@ -48,8 +48,8 @@ describe("buildSuiteAdd", () => {
suite.add("test", emptyBench);
suite.forEach((bench: CodSpeedBenchmark) =>
expect(bench.uri).toBe(
"packages/benchmark.js-plugin/src/__tests__/buildSuiteAdd.test.ts::test"
)
"packages/benchmark.js-plugin/src/__tests__/buildSuiteAdd.test.ts::test",
),
);
});

Expand All @@ -59,8 +59,8 @@ describe("buildSuiteAdd", () => {
suite.add("test", emptyBench);
suite.forEach((bench: CodSpeedBenchmark) =>
expect(bench.uri).toBe(
"packages/benchmark.js-plugin/src/__tests__/buildSuiteAdd.test.ts::suite::test"
)
"packages/benchmark.js-plugin/src/__tests__/buildSuiteAdd.test.ts::suite::test",
),
);
});

Expand Down
6 changes: 3 additions & 3 deletions packages/benchmark.js-plugin/src/buildSuiteAdd.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getCallingFile } from "@codspeed/core";
import { Options, Suite } from "benchmark";
import { isFunction, isPlainObject } from "lodash";
import getCallingFile from "./getCallingFile";

function isOptions(options: unknown): options is Options {
return isPlainObject(options);
Expand All @@ -22,10 +22,10 @@ export default function buildSuiteAdd(suite: Suite) {
}

function add(options: Options): Suite;
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
function add(fn: Function, options?: Options): Suite;
function add(name: string, options?: Options): Suite;
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
function add(name: string, fn: Function, options?: Options): Suite;
function add(name: unknown, fn?: unknown, opts?: unknown) {
// 1 argument: (options: Options)
Expand Down
17 changes: 0 additions & 17 deletions packages/benchmark.js-plugin/src/getCallingFile.ts

This file was deleted.

Loading
Loading