diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc2b787c..8a1724c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,10 @@ jobs: - uses: "actions/checkout@v3" with: fetch-depth: 0 - - run: sudo apt-get install -y valgrind + - name: Install valgrind + run: | + sudo apt-get update + sudo apt-get install -y valgrind - uses: pnpm/action-setup@v2 - uses: actions/setup-node@v3 with: @@ -48,7 +51,10 @@ jobs: - uses: "actions/checkout@v3" with: fetch-depth: 0 - - run: sudo apt-get install -y valgrind + - name: Install valgrind + run: | + sudo apt-get update + sudo apt-get install -y valgrind - uses: pnpm/action-setup@v2 - uses: actions/setup-node@v3 with: @@ -58,7 +64,7 @@ jobs: - run: pnpm moon 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 `@v1` + # use version from `main` branch to always test the latest version, in real projects, use a tag, like `@v2` uses: CodSpeedHQ/action@main with: run: pnpm --filter ${{ matrix.example }} bench-tinybench @@ -66,7 +72,7 @@ jobs: CODSPEED_SKIP_UPLOAD: true CODSPEED_DEBUG: true - name: Run benchmarks with benchmark.js-plugin - # use version from `main` branch to always test the latest version, in real projects, use a tag, like `@v1` + # use version from `main` branch to always test the latest version, in real projects, use a tag, like `@v2` uses: CodSpeedHQ/action@main with: run: pnpm --filter ${{ matrix.example }} bench-benchmark-js diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml index 27c3fa07..904727e6 100644 --- a/.github/workflows/codspeed.yml +++ b/.github/workflows/codspeed.yml @@ -13,7 +13,10 @@ jobs: - uses: "actions/checkout@v3" with: fetch-depth: 0 - - run: sudo apt-get install -y valgrind + - name: Install valgrind + run: | + sudo apt-get update + sudo apt-get install -y valgrind - uses: pnpm/action-setup@v2 - uses: actions/setup-node@v3 with: @@ -23,7 +26,7 @@ jobs: - run: pnpm moon run :build - name: Run benchmarks - # use version from `main` branch to always test the latest version, in real projects, use a tag, like `@v1` + # use version from `main` branch to always test the latest version, in real projects, use a tag, like `@v2` uses: CodSpeedHQ/action@main with: run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f9d12f6c..0bc45da6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,10 @@ jobs: node-version-file: .nvmrc registry-url: "https://registry.npmjs.org" - run: pnpm install --frozen-lockfile --prefer-offline - - run: sudo apt-get install -y valgrind + - name: Install valgrind + run: | + sudo apt-get update + sudo apt-get install -y valgrind - name: Build the libraries run: pnpm moon run :build diff --git a/.moon/toolchain.yml b/.moon/toolchain.yml index 7e64e698..6e8a77c8 100644 --- a/.moon/toolchain.yml +++ b/.moon/toolchain.yml @@ -6,7 +6,6 @@ node: pnpm: version: "8.6.3" - aliasPackageNames: "name-only" dedupeOnLockfileChange: false dependencyVersionFormat: "workspace" inferTasksFromScripts: true diff --git a/.prettierignore b/.prettierignore index 05dd937e..98463e2d 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,4 @@ node_modules .rollup.cache dist +generated diff --git a/.vscode/settings.json b/.vscode/settings.json index b5ef8b55..fca98f68 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,6 +5,6 @@ "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.formatOnSave": true, "editor.codeActionsOnSave": { - "source.organizeImports": false // Import sorting is handled by prettier + "source.organizeImports": "never" // Import sorting is handled by prettier } } diff --git a/examples/with-typescript-esm/package.json b/examples/with-typescript-esm/package.json index 0e282fe6..bdfc5fbb 100644 --- a/examples/with-typescript-esm/package.json +++ b/examples/with-typescript-esm/package.json @@ -5,7 +5,7 @@ "scripts": { "bench-benchmark-js": "node --loader esbuild-register/loader -r esbuild-register bench/benchmark.js/index.bench.ts", "bench-tinybench": "node --loader esbuild-register/loader -r esbuild-register bench/tinybench/index.bench.ts", - "bench-vitest": "vitest bench" + "bench-vitest": "vitest bench --run" }, "devDependencies": { "@codspeed/benchmark.js-plugin": "workspace:*", @@ -16,6 +16,6 @@ "esbuild-register": "^3.4.2", "tinybench": "^2.5.0", "typescript": "^5.1.3", - "vitest": "1.0.0-beta.4" + "vitest": "^1.0.3" } } diff --git a/lerna.json b/lerna.json index a933d8ca..54e1e943 100644 --- a/lerna.json +++ b/lerna.json @@ -3,5 +3,5 @@ "useWorkspaces": true, "packages": ["packages/*"], "$schema": "node_modules/lerna/schemas/lerna-schema.json", - "version": "2.3.1" + "version": "3.0.0" } diff --git a/package.json b/package.json index 57511be4..2b1bd535 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "devDependencies": { "@commitlint/cli": "^17.5.1", "@commitlint/config-conventional": "^17.4.4", - "@moonrepo/cli": "^1.15.4", + "@moonrepo/cli": "^1.19.3", "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-json": "^6.0.1", "@rollup/plugin-node-resolve": "^15.2.3", diff --git a/packages/benchmark.js-plugin/README.md b/packages/benchmark.js-plugin/README.md index 369e75ff..3e6efc20 100644 --- a/packages/benchmark.js-plugin/README.md +++ b/packages/benchmark.js-plugin/README.md @@ -12,11 +12,11 @@ Benchmark.js compatibility layer for CodSpeed ## Documentation -Check out the [documentation](https://docs.codspeed.io/benchmarks/nodejs) for complete integration instructions. +Check out the [documentation](https://docs.codspeed.io/benchmarks/nodejs/benchmark.js) for complete integration instructions. ## Installation -First install the plugin [`@codspeed/benchmark.js-plugin`](https://www.npmjs.com/package/@codspeed/tinybench-plugin) and `benchmark.js` (if not already installed): +First, install the plugin [`@codspeed/benchmark.js-plugin`](https://www.npmjs.com/package/@codspeed/benchmark.js-plugin) and `benchmark.js` (if not already installed): ```sh npm install --save-dev @codspeed/benchmark.js-plugin benchmark.js @@ -83,4 +83,4 @@ fibonacci15 x 194,742 ops/sec ±0.48% (95 runs sampled) And... Congrats🎉, CodSpeed is installed in your benchmarking suite! Locally, CodSpeed will fallback to tinybench since the instrumentation is only available in the CI environment for now. -You can now [run those benchmark in your CI](https://docs.codspeed.io/benchmarks/nodejs#running-the-benchmarks-in-your-ci) to continuously get consistent performance measurements. +You can now [run those benchmarks in your CI](https://docs.codspeed.io/benchmarks/nodejs/benchmark.js#running-the-benchmarks-in-your-ci) to continuously get consistent performance measurements. diff --git a/packages/benchmark.js-plugin/package.json b/packages/benchmark.js-plugin/package.json index 645801a3..f2bab7b8 100644 --- a/packages/benchmark.js-plugin/package.json +++ b/packages/benchmark.js-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@codspeed/benchmark.js-plugin", - "version": "2.3.1", + "version": "3.0.0", "description": "Benchmark.js compatibility layer for CodSpeed", "keywords": [ "codspeed", @@ -27,7 +27,7 @@ "jest-mock-extended": "^3.0.4" }, "dependencies": { - "@codspeed/core": "workspace:^2.3.1", + "@codspeed/core": "workspace:^3.0.0", "lodash": "^4.17.10", "stack-trace": "1.0.0-pre2" }, diff --git a/packages/benchmark.js-plugin/src/index.ts b/packages/benchmark.js-plugin/src/index.ts index 7c413b06..0ffe5a75 100644 --- a/packages/benchmark.js-plugin/src/index.ts +++ b/packages/benchmark.js-plugin/src/index.ts @@ -1,8 +1,11 @@ import { Measurement, + mongoMeasurement, optimizeFunction, optimizeFunctionSync, setupCore, + SetupInstrumentsRequestBody, + SetupInstrumentsResponse, teardownCore, tryIntrospect, } from "@codspeed/core"; @@ -192,18 +195,22 @@ async function runBenchmarks({ if (isAsync) { await optimizeFunction(benchPayload); + await mongoMeasurement.start(uri); await (async function __codspeed_root_frame__() { Measurement.startInstrumentation(); await benchPayload(); Measurement.stopInstrumentation(uri); })(); + await mongoMeasurement.stop(uri); } else { optimizeFunctionSync(benchPayload); + await mongoMeasurement.start(uri); (function __codspeed_root_frame__() { Measurement.startInstrumentation(); benchPayload(); Measurement.stopInstrumentation(uri); })(); + await mongoMeasurement.stop(uri); } if (typeof bench.options.teardown === "function") { @@ -216,3 +223,18 @@ async function runBenchmarks({ teardownCore(); console.log(`[CodSpeed] Done running ${benches.length} benches.`); } + +/** + * Dynamically setup the CodSpeed instruments. + */ +export async function setupInstruments( + body: SetupInstrumentsRequestBody +): Promise { + if (!Measurement.isInstrumented()) { + console.warn("[CodSpeed] No instrumentation found, using default mongoUrl"); + + return { remoteAddr: body.mongoUrl }; + } + + return await mongoMeasurement.setupInstruments(body); +} diff --git a/packages/core/.gitignore b/packages/core/.gitignore index 577caf8f..a39a3e02 100644 --- a/packages/core/.gitignore +++ b/packages/core/.gitignore @@ -1,2 +1,3 @@ build -prebuilds \ No newline at end of file +prebuilds +generated \ No newline at end of file diff --git a/packages/core/moon.yml b/packages/core/moon.yml index 17bb0f81..c72d7bf4 100644 --- a/packages/core/moon.yml +++ b/packages/core/moon.yml @@ -2,9 +2,11 @@ tasks: clean: args: - build + - generated/openapi build: deps: - - "build-native-addon" + - build-native-addon + - build-tracer-client build-native-addon: command: prebuildify --napi --strip @@ -14,3 +16,18 @@ tasks: - "binding.gyp" outputs: - "prebuilds" + + build-tracer-client: + inputs: + - "./tracer.spec.json" + outputs: + - "src/generated/openapi" + command: openapi --client axios --input ./tracer.spec.json --name MongoTracer --output ./src/generated/openapi + + typecheck: + deps: + - build-tracer-client + + lint: + deps: + - build-tracer-client diff --git a/packages/core/package.json b/packages/core/package.json index 67179845..4407ba6e 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@codspeed/core", - "version": "2.3.1", + "version": "3.0.0", "description": "The core Node library used to integrate with Codspeed runners", "keywords": [ "codspeed", @@ -23,10 +23,13 @@ "@types/find-up": "^4.0.0", "node-addon-api": "^5.1.0", "node-gyp": "^9.3.1", + "openapi-typescript-codegen": "^0.23.0", "prebuildify": "^5.0.1" }, "dependencies": { + "axios": "^1.4.0", "find-up": "^6.3.0", + "form-data": "^4.0.0", "node-gyp-build": "^4.6.0" } } diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 72c75b2e..e5360082 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,4 +1,5 @@ import { checkV8Flags } from "./introspection"; +import { MongoMeasurement } from "./mongoMeasurement"; import native_core from "./native_core"; import { initOptimization } from "./optimization"; @@ -8,6 +9,8 @@ const linuxPerf = new native_core.LinuxPerf(); export const isBound = native_core.isBound; +export const mongoMeasurement = new MongoMeasurement(); + export const setupCore = () => { initOptimization(); native_core.Measurement.stopInstrumentation( @@ -21,6 +24,10 @@ export const teardownCore = () => { linuxPerf.stop(); }; +export type { + SetupInstrumentsRequestBody, + SetupInstrumentsResponse, +} from "./generated/openapi"; export { getV8Flags, tryIntrospect } from "./introspection"; export { optimizeFunction, optimizeFunctionSync } from "./optimization"; export * from "./utils"; diff --git a/packages/core/src/mongoMeasurement.ts b/packages/core/src/mongoMeasurement.ts new file mode 100644 index 00000000..642d2c19 --- /dev/null +++ b/packages/core/src/mongoMeasurement.ts @@ -0,0 +1,46 @@ +import { + MongoTracer, + SetupInstrumentsRequestBody, + SetupInstrumentsResponse, +} from "./generated/openapi"; + +export type { SetupInstrumentsRequestBody }; + +export class MongoMeasurement { + private tracerClient: MongoTracer | undefined; + + constructor() { + const serverUrl = process.env.CODSPEED_MONGO_INSTR_SERVER_ADDRESS; + + if (serverUrl !== undefined) { + this.tracerClient = new MongoTracer({ + BASE: serverUrl, + }); + } + } + + public async setupInstruments( + body: SetupInstrumentsRequestBody + ): Promise { + if (this.tracerClient === undefined) { + throw new Error("MongoDB Instrumentation is not enabled"); + } + return await this.tracerClient.instruments.setup(body); + } + + public async start(uri: string) { + if (this.tracerClient !== undefined) { + await this.tracerClient.instrumentation.start({ + uri, + }); + } + } + + public async stop(uri: string) { + if (this.tracerClient !== undefined) { + await this.tracerClient.instrumentation.stop({ + uri, + }); + } + } +} diff --git a/packages/core/tracer.spec.json b/packages/core/tracer.spec.json new file mode 100644 index 00000000..42abb5f0 --- /dev/null +++ b/packages/core/tracer.spec.json @@ -0,0 +1,319 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "CodSpeed MongoDB Tracer", + "description": "Instrumentation API for CodSpeed Tracer", + "version": "0.2.0" + }, + "paths": { + "/benchmark/start": { + "post": { + "tags": ["instrumentation"], + "operationId": "start", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InstrumentationRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InstrumentationStatus" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/benchmark/stop": { + "post": { + "tags": ["instrumentation"], + "operationId": "stop", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InstrumentationRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InstrumentationStatus" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/instruments/setup": { + "post": { + "tags": ["instruments"], + "summary": "Start the instruments (proxy and aggregator) for the given `body.mongo_url`.", + "description": "If other endpoints of the instrumentation server are called before this one, they will likely fail as the proxy and aggregator are not running yet.", + "operationId": "setup", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupInstrumentsRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupInstrumentsResponse" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/status": { + "get": { + "tags": ["instrumentation"], + "operationId": "status", + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InstrumentationStatus" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/terminate": { + "post": { + "tags": ["instrumentation"], + "operationId": "terminate", + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AggregatorStore" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + } + }, + "components": { + "responses": { + "Error": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + }, + "schemas": { + "AggregatorMetadata": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "required": ["name", "version"] + }, + "AggregatorStore": { + "type": "object", + "properties": { + "metadata": { + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/AggregatorMetadata" + } + ] + }, + "queries": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MongoQuery" + } + } + } + }, + "required": ["queries"] + }, + "Document": { + "type": "object" + }, + "Error": { + "description": "Error information from a response.", + "type": "object", + "properties": { + "error_code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "request_id": { + "type": "string" + } + }, + "required": ["message", "request_id"] + }, + "InstrumentationRequestBody": { + "type": "object", + "properties": { + "uri": { + "type": "string" + } + }, + "required": ["uri"] + }, + "InstrumentationStatus": { + "type": "object", + "properties": { + "currentUri": { + "nullable": true, + "type": "string" + } + } + }, + "MongoQuery": { + "type": "object", + "properties": { + "collection": { + "type": "string" + }, + "database": { + "type": "string" + }, + "explanation": { + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/Document" + } + ] + }, + "op": { + "type": "string" + }, + "query_documents": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Document" + } + }, + "response_documents": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Document" + } + } + }, + "required": [ + "collection", + "database", + "op", + "query_documents", + "response_documents" + ] + }, + "SetupInstrumentsRequestBody": { + "type": "object", + "properties": { + "mongoUrl": { + "description": "The full `MONGO_URL` that is usually used to connect to the database.", + "type": "string" + } + }, + "required": ["mongoUrl"] + }, + "SetupInstrumentsResponse": { + "type": "object", + "properties": { + "remoteAddr": { + "description": "The patched `MONGO_URL` that should be used to connect to the database.", + "type": "string" + } + }, + "required": ["remoteAddr"] + } + } + }, + "tags": [ + { + "name": "instrumentation" + }, + { + "name": "instruments" + } + ] +} diff --git a/packages/tinybench-plugin/README.md b/packages/tinybench-plugin/README.md index a9957d9d..eebf5d59 100644 --- a/packages/tinybench-plugin/README.md +++ b/packages/tinybench-plugin/README.md @@ -12,11 +12,11 @@ tinybench compatibility layer for CodSpeed ## Documentation -Check out the [documentation](https://docs.codspeed.io/benchmarks/nodejs) for complete integration instructions. +Check out the [documentation](https://docs.codspeed.io/benchmarks/nodejs/tinybench) for complete integration instructions. ## Installation -First install the plugin [`@codspeed/tinybench-plugin`](https://www.npmjs.com/package/@codspeed/tinybench-plugin) and `tinybench` (if not already installed): +First, install the plugin [`@codspeed/tinybench-plugin`](https://www.npmjs.com/package/@codspeed/tinybench-plugin) and `tinybench` (if not already installed): ```sh npm install --save-dev @codspeed/tinybench-plugin tinybench @@ -87,4 +87,4 @@ $ node benches/bench.mjs And... Congrats🎉, CodSpeed is installed in your benchmarking suite! Locally, CodSpeed will fallback to tinybench since the instrumentation is only available in the CI environment for now. -You can now [run those benchmark in your CI](https://docs.codspeed.io/benchmarks/nodejs#running-the-benchmarks-in-your-ci) to continuously get consistent performance measurements. +You can now [run those benchmarks in your CI](https://docs.codspeed.io/benchmarks/nodejs/tinybench#running-the-benchmarks-in-your-ci) to continuously get consistent performance measurements. diff --git a/packages/tinybench-plugin/package.json b/packages/tinybench-plugin/package.json index 16fa345e..79ba2170 100644 --- a/packages/tinybench-plugin/package.json +++ b/packages/tinybench-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@codspeed/tinybench-plugin", - "version": "2.3.1", + "version": "3.0.0", "description": "tinybench compatibility layer for CodSpeed", "keywords": [ "codspeed", @@ -24,7 +24,7 @@ "tinybench": "^2.5.0" }, "dependencies": { - "@codspeed/core": "workspace:^2.3.1", + "@codspeed/core": "workspace:^3.0.0", "stack-trace": "1.0.0-pre2" }, "peerDependencies": { diff --git a/packages/tinybench-plugin/src/index.ts b/packages/tinybench-plugin/src/index.ts index 65fb6fe9..e573bd44 100644 --- a/packages/tinybench-plugin/src/index.ts +++ b/packages/tinybench-plugin/src/index.ts @@ -1,8 +1,11 @@ import { getGitDir, Measurement, + mongoMeasurement, optimizeFunction, setupCore, + SetupInstrumentsRequestBody, + SetupInstrumentsResponse, teardownCore, tryIntrospect, } from "@codspeed/core"; @@ -65,11 +68,15 @@ export function withCodSpeed(bench: Bench): Bench { // run instrumented benchmark await task.opts.beforeEach?.call(task); + + await mongoMeasurement.start(uri); await (async function __codspeed_root_frame__() { Measurement.startInstrumentation(); await task.fn(); Measurement.stopInstrumentation(uri); })(); + await mongoMeasurement.stop(uri); + await task.opts.afterEach?.call(task); await task.opts.afterAll?.call(task); @@ -96,3 +103,18 @@ function getCallingFile(): string { } return path.relative(gitDir, callingFile); } + +/** + * Dynamically setup the CodSpeed instruments. + */ +export async function setupInstruments( + body: SetupInstrumentsRequestBody +): Promise { + if (!Measurement.isInstrumented()) { + console.warn("[CodSpeed] No instrumentation found, using default mongoUrl"); + + return { remoteAddr: body.mongoUrl }; + } + + return await mongoMeasurement.setupInstruments(body); +} diff --git a/packages/tinybench-plugin/tests/index.integ.test.ts b/packages/tinybench-plugin/tests/index.integ.test.ts index 2fbbabcf..c704e9aa 100644 --- a/packages/tinybench-plugin/tests/index.integ.test.ts +++ b/packages/tinybench-plugin/tests/index.integ.test.ts @@ -29,6 +29,8 @@ describe("Benchmark.Suite", () => { await bench.run(); expect(onComplete).toHaveBeenCalled(); + expect(mockCore.mongoMeasurement.start).not.toHaveBeenCalled(); + expect(mockCore.mongoMeasurement.stop).not.toHaveBeenCalled(); expect(mockCore.Measurement.startInstrumentation).not.toHaveBeenCalled(); expect(mockCore.Measurement.stopInstrumentation).not.toHaveBeenCalled(); }); @@ -39,6 +41,11 @@ describe("Benchmark.Suite", () => { /o/.test("Hello World!"); }) .run(); + + expect(mockCore.mongoMeasurement.start).toHaveBeenCalledWith( + "packages/tinybench-plugin/tests/index.integ.test.ts::RegExp" + ); + expect(mockCore.mongoMeasurement.stop).toHaveBeenCalledTimes(1); expect(mockCore.Measurement.startInstrumentation).toHaveBeenCalled(); expect(mockCore.Measurement.stopInstrumentation).toHaveBeenCalledWith( "packages/tinybench-plugin/tests/index.integ.test.ts::RegExp" @@ -54,6 +61,14 @@ describe("Benchmark.Suite", () => { /o/.test("Hello World!"); }) .run(); + + expect(mockCore.mongoMeasurement.start).toHaveBeenCalledWith( + "packages/tinybench-plugin/tests/index.integ.test.ts::RegExp" + ); + expect(mockCore.mongoMeasurement.start).toHaveBeenCalledWith( + "packages/tinybench-plugin/tests/index.integ.test.ts::RegExp2" + ); + expect(mockCore.mongoMeasurement.stop).toHaveBeenCalledTimes(2); expect(mockCore.Measurement.stopInstrumentation).toHaveBeenCalledWith( "packages/tinybench-plugin/tests/index.integ.test.ts::RegExp" ); diff --git a/packages/vitest-plugin/README.md b/packages/vitest-plugin/README.md index 7d8d2c61..167a8702 100644 --- a/packages/vitest-plugin/README.md +++ b/packages/vitest-plugin/README.md @@ -12,31 +12,31 @@ ## Documentation -Check out the [documentation](https://docs.codspeed.io/benchmarks/nodejs) for complete integration instructions. +Check out the [documentation](https://docs.codspeed.io/benchmarks/nodejs/vitest) for complete integration instructions. ## Installation -First install the plugin [`@codspeed/vitest-plugin`](https://www.npmjs.com/package/@codspeed/vitest-plugin) and `vitest` (if not already installed): +First, install the plugin [`@codspeed/vitest-plugin`](https://www.npmjs.com/package/@codspeed/vitest-plugin) and `vitest` (if not already installed): -> [!WARNING] +> [!NOTE] > The CodSpeed plugin is only compatible with -> [vitest@1.0.0-beta.4](https://github.com/vitest-dev/vitest/releases/tag/v1.0.0-beta.4) +> [vitest@1.0.0](https://www.npmjs.com/package/vitest/v/1.0.0) > and above. ```sh -npm install --save-dev @codspeed/vitest-plugin vitest@1.0.0-beta.4 +npm install --save-dev @codspeed/vitest-plugin vitest ``` or with `yarn`: ```sh -yarn add --dev @codspeed/vitest-plugin vitest@1.0.0-beta.4 +yarn add --dev @codspeed/vitest-plugin vitest ``` or with `pnpm`: ```sh -pnpm add --save-dev @codspeed/vitest-plugin vitest@1.0.0-beta.4 +pnpm add --save-dev @codspeed/vitest-plugin vitest ``` ## Usage @@ -87,4 +87,4 @@ $ pnpm vitest bench --run And... Congrats 🎉, CodSpeed is installed in your benchmarking suite! Locally, CodSpeed will fallback to vitest since the instrumentation is only available in the CI environment for now. -You can now [run those benchmarks in your CI](https://docs.codspeed.io/benchmarks/nodejs#running-the-benchmarks-in-your-ci) to continuously get consistent performance measurements. +You can now [run those benchmarks in your CI](https://docs.codspeed.io/benchmarks/nodejs/vitest#running-the-benchmarks-in-your-ci) to continuously get consistent performance measurements. diff --git a/packages/vitest-plugin/moon.yml b/packages/vitest-plugin/moon.yml index e6b2cba1..64f92547 100644 --- a/packages/vitest-plugin/moon.yml +++ b/packages/vitest-plugin/moon.yml @@ -1,6 +1,6 @@ tasks: bench: - command: vitest bench + command: vitest bench --run inputs: - "benches/**" local: true diff --git a/packages/vitest-plugin/package.json b/packages/vitest-plugin/package.json index 44456995..922d04d7 100644 --- a/packages/vitest-plugin/package.json +++ b/packages/vitest-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@codspeed/vitest-plugin", - "version": "2.3.1", + "version": "3.0.0", "description": "vitest plugin for CodSpeed", "keywords": [ "codspeed", @@ -27,7 +27,7 @@ "bench": "vitest bench" }, "dependencies": { - "@codspeed/core": "workspace:^2.3.1" + "@codspeed/core": "workspace:^3.0.0" }, "peerDependencies": { "vite": "^4.2.0 || ^5.0.0", @@ -37,6 +37,6 @@ "@total-typescript/shoehorn": "^0.1.1", "execa": "^8.0.1", "vite": "^5.0.0", - "vitest": "1.0.0-beta.4" + "vitest": "^1.0.3" } } diff --git a/packages/vitest-plugin/src/__tests__/runner.test.ts b/packages/vitest-plugin/src/__tests__/runner.test.ts index 9b92534b..6391e968 100644 --- a/packages/vitest-plugin/src/__tests__/runner.test.ts +++ b/packages/vitest-plugin/src/__tests__/runner.test.ts @@ -11,6 +11,10 @@ const coreMocks = vi.hoisted(() => { }, setupCore: vi.fn(), teardownCore: vi.fn(), + mongoMeasurement: { + start: vi.fn(), + stop: vi.fn(), + }, }; }); @@ -44,7 +48,13 @@ describe("CodSpeedRunner", () => { ); // run + expect(coreMocks.mongoMeasurement.start).toHaveBeenCalledWith( + "packages/vitest-plugin/src/__tests__/runner.test.ts::test bench" + ); + expect(coreMocks.Measurement.startInstrumentation).toHaveBeenCalledTimes(1); expect(benchFn).toHaveBeenCalledTimes(2); + expect(coreMocks.Measurement.stopInstrumentation).toHaveBeenCalledTimes(1); + expect(coreMocks.mongoMeasurement.stop).toHaveBeenCalledTimes(1); expect(console.log).toHaveBeenCalledWith( "[CodSpeed] packages/vitest-plugin/src/__tests__/runner.test.ts::test bench done" ); @@ -89,7 +99,13 @@ describe("CodSpeedRunner", () => { ); // run + expect(coreMocks.mongoMeasurement.start).toHaveBeenCalledWith( + "packages/vitest-plugin/src/__tests__/runner.test.ts::nested suite::test bench" + ); + expect(coreMocks.Measurement.startInstrumentation).toHaveBeenCalledTimes(1); expect(benchFn).toHaveBeenCalledTimes(2); + expect(coreMocks.Measurement.stopInstrumentation).toHaveBeenCalledTimes(1); + expect(coreMocks.mongoMeasurement.stop).toHaveBeenCalledTimes(1); expect(console.log).toHaveBeenCalledWith( "[CodSpeed] packages/vitest-plugin/src/__tests__/runner.test.ts::nested suite::test bench done" ); diff --git a/packages/vitest-plugin/src/index.ts b/packages/vitest-plugin/src/index.ts index 403f3488..1fbdd5c9 100644 --- a/packages/vitest-plugin/src/index.ts +++ b/packages/vitest-plugin/src/index.ts @@ -1,4 +1,10 @@ -import { getV8Flags, Measurement } from "@codspeed/core"; +import { + getV8Flags, + Measurement, + mongoMeasurement, + SetupInstrumentsRequestBody, + SetupInstrumentsResponse, +} from "@codspeed/core"; import { join } from "path"; import { Plugin } from "vite"; import { UserConfig } from "vitest/config"; @@ -45,3 +51,18 @@ export default function codspeedPlugin(): Plugin { }, }; } + +/** + * Dynamically setup the CodSpeed instruments. + */ +export async function setupInstruments( + body: SetupInstrumentsRequestBody +): Promise { + if (!Measurement.isInstrumented()) { + console.warn("[CodSpeed] No instrumentation found, using default mongoUrl"); + + return { remoteAddr: body.mongoUrl }; + } + + return await mongoMeasurement.setupInstruments(body); +} diff --git a/packages/vitest-plugin/src/runner.ts b/packages/vitest-plugin/src/runner.ts index 3890d76c..38b80088 100644 --- a/packages/vitest-plugin/src/runner.ts +++ b/packages/vitest-plugin/src/runner.ts @@ -2,6 +2,7 @@ import { getGitDir, logDebug, Measurement, + mongoMeasurement, optimizeFunction, setupCore, teardownCore, @@ -48,12 +49,14 @@ async function runBenchmarkSuite(suite: Suite, parentSuiteName?: string) { const fn = getBenchFn(benchmark); await optimizeFunction(fn); + await mongoMeasurement.start(uri); await (async function __codspeed_root_frame__() { Measurement.startInstrumentation(); // @ts-expect-error we do not need to bind the function to an instance of tinybench's Bench await fn(); Measurement.stopInstrumentation(uri); })(); + await mongoMeasurement.stop(uri); logCodSpeed(`${uri} done`); } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7327a4e7..f96cf4e1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,8 +14,8 @@ importers: specifier: ^17.4.4 version: 17.4.4 "@moonrepo/cli": - specifier: ^1.15.4 - version: 1.15.4 + specifier: ^1.19.3 + version: 1.19.3 "@rollup/plugin-commonjs": specifier: ^25.0.7 version: 25.0.7(rollup@4.4.1) @@ -173,8 +173,8 @@ importers: specifier: ^5.1.3 version: 5.1.3 vitest: - specifier: 1.0.0-beta.4 - version: 1.0.0-beta.4(@types/node@18.15.11) + specifier: ^1.0.3 + version: 1.0.3(@types/node@18.15.11) examples/with-typescript-simple-cjs: devDependencies: @@ -227,7 +227,7 @@ importers: packages/benchmark.js-plugin: dependencies: "@codspeed/core": - specifier: workspace:^2.3.1 + specifier: workspace:^3.0.0 version: link:../core lodash: specifier: ^4.17.10 @@ -257,9 +257,15 @@ importers: packages/core: dependencies: + axios: + specifier: ^1.4.0 + version: 1.4.0 find-up: specifier: ^6.3.0 version: 6.3.0 + form-data: + specifier: ^4.0.0 + version: 4.0.0 node-gyp-build: specifier: ^4.6.0 version: 4.6.0 @@ -273,6 +279,9 @@ importers: node-gyp: specifier: ^9.3.1 version: 9.3.1 + openapi-typescript-codegen: + specifier: ^0.23.0 + version: 0.23.0 prebuildify: specifier: ^5.0.1 version: 5.0.1 @@ -280,7 +289,7 @@ importers: packages/tinybench-plugin: dependencies: "@codspeed/core": - specifier: workspace:^2.3.1 + specifier: workspace:^3.0.0 version: link:../core stack-trace: specifier: 1.0.0-pre2 @@ -299,7 +308,7 @@ importers: packages/vitest-plugin: dependencies: "@codspeed/core": - specifier: workspace:^2.3.1 + specifier: workspace:^3.0.0 version: link:../core devDependencies: "@total-typescript/shoehorn": @@ -312,8 +321,8 @@ importers: specifier: ^5.0.0 version: 5.0.0(@types/node@18.15.11) vitest: - specifier: 1.0.0-beta.4 - version: 1.0.0-beta.4(@types/node@18.15.11) + specifier: ^1.0.3 + version: 1.0.3(@types/node@18.15.11) packages: /@ampproject/remapping@2.2.1: @@ -327,6 +336,18 @@ packages: "@jridgewell/trace-mapping": 0.3.18 dev: true + /@apidevtools/json-schema-ref-parser@9.0.9: + resolution: + { + integrity: sha512-GBD2Le9w2+lVFoc4vswGI/TjkNIZSVp7+9xPf+X3uidBfWnAeUWmquteSyt0+VCrhNMWj/FTABISQrD3Z/YA+w==, + } + dependencies: + "@jsdevtools/ono": 7.1.3 + "@types/json-schema": 7.0.11 + call-me-maybe: 1.0.2 + js-yaml: 4.1.0 + dev: true + /@babel/code-frame@7.12.11: resolution: { @@ -3076,6 +3097,16 @@ packages: "@sinclair/typebox": 0.25.24 dev: true + /@jest/schemas@29.6.3: + resolution: + { + integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } + dependencies: + "@sinclair/typebox": 0.27.8 + dev: true + /@jest/source-map@29.4.3: resolution: { @@ -3225,6 +3256,13 @@ packages: "@jridgewell/sourcemap-codec": 1.4.15 dev: true + /@jsdevtools/ono@7.1.3: + resolution: + { + integrity: sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==, + } + dev: true + /@lerna/child-process@6.6.1: resolution: { @@ -3338,29 +3376,29 @@ packages: - supports-color dev: true - /@moonrepo/cli@1.15.4: + /@moonrepo/cli@1.19.3: resolution: { - integrity: sha512-VbI39HnK++HTsDzCd7/Rc71wc/+BNvAdeewtOA3dKl5yS2haxbc5VH7XtPFkX8Cdqodvc7LkEtD1Is4NkS/DpQ==, + integrity: sha512-K/i80oiE68c6zYVBDS8bLSMdrf7VvG1vn/sLNc/VUJIQ/cnl4xPa8MYQzgaOR4BGD/K8jfFklOY7BQXM4/G63g==, } hasBin: true requiresBuild: true dependencies: detect-libc: 2.0.2 optionalDependencies: - "@moonrepo/core-linux-arm64-gnu": 1.15.4 - "@moonrepo/core-linux-arm64-musl": 1.15.4 - "@moonrepo/core-linux-x64-gnu": 1.15.4 - "@moonrepo/core-linux-x64-musl": 1.15.4 - "@moonrepo/core-macos-arm64": 1.15.4 - "@moonrepo/core-macos-x64": 1.15.4 - "@moonrepo/core-windows-x64-msvc": 1.15.4 + "@moonrepo/core-linux-arm64-gnu": 1.19.3 + "@moonrepo/core-linux-arm64-musl": 1.19.3 + "@moonrepo/core-linux-x64-gnu": 1.19.3 + "@moonrepo/core-linux-x64-musl": 1.19.3 + "@moonrepo/core-macos-arm64": 1.19.3 + "@moonrepo/core-macos-x64": 1.19.3 + "@moonrepo/core-windows-x64-msvc": 1.19.3 dev: true - /@moonrepo/core-linux-arm64-gnu@1.15.4: + /@moonrepo/core-linux-arm64-gnu@1.19.3: resolution: { - integrity: sha512-+0djE35qWnicZ3ANgzdM6jLIKGu/mE+zYmtXIpYV1lgcWcUqX/ssTVQ9l0VHHUC1e4qSAhZUe9GAjMTZ6FYq5w==, + integrity: sha512-Gip7AtFQnlqL6uEvfKGEKiHfWwI7u3T6tXbfXc1vE1DdjHED15slO1yKZfj4qwFmVXwsF6zkDk7CMWLSgR6t9g==, } cpu: [arm64] os: [linux] @@ -3368,10 +3406,10 @@ packages: dev: true optional: true - /@moonrepo/core-linux-arm64-musl@1.15.4: + /@moonrepo/core-linux-arm64-musl@1.19.3: resolution: { - integrity: sha512-AYU/8AFaou4ugtkBD5hMnjukP1MB6cR+J8TDGor01Cx6+nCC8bOCkPlUmc9EjeBJmG3mQwJCCbsybu745mNpfw==, + integrity: sha512-GdUxhdwzwv71t/agEvjPuGcAdmElxs26GlxK8PwT1yAvqT1cGmfE+fRMH7tlH3bYpWMEs0Ezv6QY1VtgFkLoxQ==, } cpu: [arm64] os: [linux] @@ -3379,10 +3417,10 @@ packages: dev: true optional: true - /@moonrepo/core-linux-x64-gnu@1.15.4: + /@moonrepo/core-linux-x64-gnu@1.19.3: resolution: { - integrity: sha512-7az1ePM4OsCGp4XR8axAwLJU5C0ujExL8OoQxaF2nJMbkDuLFUP77gPdvX8AzNi1W0kMTNIzgOY9dlbkJ2Yakw==, + integrity: sha512-YmL7hpVbq7rjRqY42PDnTbAnbZe0gLJo/ClaCiNwPdpEDCqqHSahBLigyoAbF5RnZ/J8zjN4TOdE5dtrFjF/jg==, } cpu: [x64] os: [linux] @@ -3390,10 +3428,10 @@ packages: dev: true optional: true - /@moonrepo/core-linux-x64-musl@1.15.4: + /@moonrepo/core-linux-x64-musl@1.19.3: resolution: { - integrity: sha512-xXd/LKlbo7+I0MaD4zaXnH+0UO0/EYrDB+llpAQeUinrl7NAxMTeogothiKZBD1pYOnfMmESyerhxLHVlM4t1w==, + integrity: sha512-FptrjWciMA32UhpAtzEQEwcz722mZzjMTb4QDFvCa33QUix2661RX6f8VKlCknNhXikqAEN4sR0LA9jBZKr3oA==, } cpu: [x64] os: [linux] @@ -3401,10 +3439,10 @@ packages: dev: true optional: true - /@moonrepo/core-macos-arm64@1.15.4: + /@moonrepo/core-macos-arm64@1.19.3: resolution: { - integrity: sha512-MCqKcf3u7NiJY2RmP9Zua+5fjLiblPgXX9yE7lBNyRyt62C93x9lCWYeoFPeuPHkPU8MxhusftkKkJIi8T66fQ==, + integrity: sha512-lgKh6v5NQqtPdQ8vpC5BKfs1pmFHjAUnM0CaX3XyV1Wbvqq2EmgpmcczjXcegTV5XI7w8wx4WthqIuF7UJ05gQ==, } cpu: [arm64] os: [darwin] @@ -3412,10 +3450,10 @@ packages: dev: true optional: true - /@moonrepo/core-macos-x64@1.15.4: + /@moonrepo/core-macos-x64@1.19.3: resolution: { - integrity: sha512-IoFxPJeIOs9ox8BS4UR8TC61ZITJfoqZy/yCR16iQK2GXASnNAoHxk2UaTaLGCNJQu75XPO7Ie/XYg4Vv1P6BQ==, + integrity: sha512-AFKHoO+daa+TZhXypmTB7bAxD4E31FQD5aUyDepvoD0ArWXwkBSO6EbVxlqfgym3WKX8WgBTmp9anvRWytpcDw==, } cpu: [x64] os: [darwin] @@ -3423,10 +3461,10 @@ packages: dev: true optional: true - /@moonrepo/core-windows-x64-msvc@1.15.4: + /@moonrepo/core-windows-x64-msvc@1.19.3: resolution: { - integrity: sha512-EfIllI+iG0ZivIg++hu/Qvjj+kUsgHiGiP27KmRi5FZbCE6CALSLt2Q+1C/BgH/+xzE0Y5pL/IWcSXeEqEFr+g==, + integrity: sha512-O7FYQ+XDq+Nts2jF9GINJa/jflzAnUjRCygdzQqIB15S6YG8PasXUCMofUQqhHxQjETIddzSra9lblgzfgxAuw==, } cpu: [x64] os: [win32] @@ -4366,6 +4404,13 @@ packages: } dev: true + /@sinclair/typebox@0.27.8: + resolution: + { + integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==, + } + dev: true + /@sinonjs/commons@2.0.0: resolution: { @@ -4816,57 +4861,57 @@ packages: eslint-visitor-keys: 3.4.0 dev: true - /@vitest/expect@1.0.0-beta.4: + /@vitest/expect@1.0.3: resolution: { - integrity: sha512-JOpNEva2AFxfySH3F+X+hT52Kq/ZdIrGtzWYbj6yRuBuxFqM55n/7/jV4XtQG+XkmehP3OUZGx5zISOU8KHPQw==, + integrity: sha512-J+JzGw/uvlWI3D3g8s0ewQo7C32nieF5VqEJpmIgAr8CAK36GvIQrV90lChEgQy79iwK3zyQx4UhfMeIF4572g==, } dependencies: - "@vitest/spy": 1.0.0-beta.4 - "@vitest/utils": 1.0.0-beta.4 + "@vitest/spy": 1.0.3 + "@vitest/utils": 1.0.3 chai: 4.3.10 dev: true - /@vitest/runner@1.0.0-beta.4: + /@vitest/runner@1.0.3: resolution: { - integrity: sha512-rlXCMp5MxMVVVN5hdhzPL9NpIkfZC0EXwAtN5gwBbCBoVRv9dBQiZ5qTw+LaNmugPl8gm76U4e4/nMZS9s6wyw==, + integrity: sha512-fCqShW4F8VJ78USVRoc5e1OD5jh1x1quZu4Mgp/lIhZS6PZPtI3wdCfRChWO9ZMJ2Ya7WI3sZTJZD69FR/AosA==, } dependencies: - "@vitest/utils": 1.0.0-beta.4 - p-limit: 4.0.0 + "@vitest/utils": 1.0.3 + p-limit: 5.0.0 pathe: 1.1.1 dev: true - /@vitest/snapshot@1.0.0-beta.4: + /@vitest/snapshot@1.0.3: resolution: { - integrity: sha512-CzmHLGo4RNEQUojYtuEz8wWKp9/p3hvXskejRRJB1iCRH48uWROmoyb2iEQUhgpQw/+WwI4wRP7jek5lp48pRA==, + integrity: sha512-2EQwVEuHusEXr0SKuFiI1JVlysSrUceejtusr6vK254tusAz/g4//QrAiD1b7PMdcUKM8QmdgWvqCMaYDsWyNA==, } dependencies: magic-string: 0.30.5 pathe: 1.1.1 - pretty-format: 29.5.0 + pretty-format: 29.7.0 dev: true - /@vitest/spy@1.0.0-beta.4: + /@vitest/spy@1.0.3: resolution: { - integrity: sha512-YvKUUl7KucKzLJb8+RTd8H3G24EVPGk+CVMFawwtD/KuYjBzM8RCh3oJTTba6ktLpB8JLVy8NVTNL4Oeigqs8A==, + integrity: sha512-aMd7kvqJuZ/h27Q5XqNOh9fRX7cQJ9fcaPX8q/lk5h2MkAqvq/HuqZ7n1xjm2SDOlDqg3xMaEqP/4inNlNG62A==, } dependencies: tinyspy: 2.2.0 dev: true - /@vitest/utils@1.0.0-beta.4: + /@vitest/utils@1.0.3: resolution: { - integrity: sha512-YY4bhhVqyTxuNwuZJXiCM4/D0Z7Z3H3JDHNM8gXty7EyRUf4iPDQtXzIWe1r4zdTtoFnzFAeMr+891pWlv4SPA==, + integrity: sha512-ddGKC6CVjxwjA+ourSlMD6Emc+PhIH6+d25ISGBOQjryXi2NtKpsBSOt1yDT793c2Tqij8g8BBxe87jam3B95w==, } dependencies: - diff-sequences: 29.4.3 + diff-sequences: 29.6.3 loupe: 2.3.7 - pretty-format: 29.5.0 + pretty-format: 29.7.0 dev: true /@yarnpkg/lockfile@1.1.0: @@ -4952,6 +4997,14 @@ packages: engines: { node: ">=0.4.0" } dev: true + /acorn-walk@8.3.1: + resolution: + { + integrity: sha512-TgUZgYvqZprrl7YldZNoa9OciCAyZR+Ejm9eXzKCmjsF5IKp/wgQ7Z/ZpjpGTIUPwrHQIcYeI8qDh4PsEwxMbw==, + } + engines: { node: ">=0.4.0" } + dev: true + /acorn@7.4.1: resolution: { @@ -5280,7 +5333,6 @@ packages: { integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==, } - dev: true /at-least-node@1.0.0: resolution: @@ -5298,10 +5350,10 @@ packages: engines: { node: ">= 0.4" } dev: true - /axios@1.3.5: + /axios@1.4.0: resolution: { - integrity: sha512-glL/PvG/E+xCWwV8S6nCHcrfg1exGx7vxyUIivIA1iL7BIh6bePylCfVHwp6k13ao7SATxB6imau2kqY+I67kw==, + integrity: sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==, } dependencies: follow-redirects: 1.15.2 @@ -5309,7 +5361,6 @@ packages: proxy-from-env: 1.1.0 transitivePeerDependencies: - debug - dev: true /babel-jest@29.5.0(@babel/core@7.21.4): resolution: @@ -5690,6 +5741,13 @@ packages: get-intrinsic: 1.2.0 dev: true + /call-me-maybe@1.0.2: + resolution: + { + integrity: sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==, + } + dev: true + /callsites@3.1.0: resolution: { @@ -6022,6 +6080,13 @@ packages: engines: { node: ">= 0.8" } dependencies: delayed-stream: 1.0.0 + + /commander@9.5.0: + resolution: + { + integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==, + } + engines: { node: ^12.20.0 || >=14 } dev: true /common-ancestor-path@1.0.1: @@ -6471,7 +6536,6 @@ packages: integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==, } engines: { node: ">=0.4.0" } - dev: true /delegates@1.0.0: resolution: @@ -6527,6 +6591,14 @@ packages: engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } dev: true + /diff-sequences@29.6.3: + resolution: + { + integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } + dev: true + /diff@4.0.2: resolution: { @@ -7493,7 +7565,6 @@ packages: peerDependenciesMeta: debug: optional: true - dev: true /for-each@0.3.3: resolution: @@ -7514,7 +7585,6 @@ packages: asynckit: 0.4.0 combined-stream: 1.0.8 mime-types: 2.1.35 - dev: true /fs-constants@1.0.0: resolution: @@ -7523,6 +7593,18 @@ packages: } dev: true + /fs-extra@10.1.0: + resolution: + { + integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==, + } + engines: { node: ">=12" } + dependencies: + graceful-fs: 4.2.11 + jsonfile: 6.1.0 + universalify: 2.0.0 + dev: true + /fs-extra@11.1.1: resolution: { @@ -7543,7 +7625,7 @@ packages: engines: { node: ">=10" } dependencies: at-least-node: 1.0.0 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 jsonfile: 6.1.0 universalify: 2.0.0 dev: true @@ -9474,6 +9556,17 @@ packages: engines: { node: ^14.17.0 || ^16.13.0 || >=18.0.0 } dev: true + /json-schema-ref-parser@9.0.9: + resolution: + { + integrity: sha512-qcP2lmGy+JUoQJ4DOQeLaZDqH9qSkeGCK3suKWxJXS82dg728Mn3j97azDMaOUmJAN4uCq91LdPx4K7E8F1a7Q==, + } + engines: { node: ">=10" } + deprecated: Please switch to @apidevtools/json-schema-ref-parser + dependencies: + "@apidevtools/json-schema-ref-parser": 9.0.9 + dev: true + /json-schema-traverse@0.4.1: resolution: { @@ -9764,18 +9857,21 @@ packages: } engines: { node: ">=8" } dependencies: - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 parse-json: 5.2.0 strip-bom: 4.0.0 type-fest: 0.6.0 dev: true - /local-pkg@0.4.3: + /local-pkg@0.5.0: resolution: { - integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==, + integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==, } engines: { node: ">=14" } + dependencies: + mlly: 1.4.2 + pkg-types: 1.0.3 dev: true /locate-path@2.0.0: @@ -10147,7 +10243,6 @@ packages: integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==, } engines: { node: ">= 0.6" } - dev: true /mime-types@2.1.35: resolution: @@ -10157,7 +10252,6 @@ packages: engines: { node: ">= 0.6" } dependencies: mime-db: 1.52.0 - dev: true /mimic-fn@2.1.0: resolution: @@ -10926,7 +11020,7 @@ packages: "@yarnpkg/lockfile": 1.1.0 "@yarnpkg/parsers": 3.0.0-rc.42 "@zkochan/js-yaml": 0.0.6 - axios: 1.3.5 + axios: 1.4.0 chalk: 4.1.2 cli-cursor: 3.1.0 cli-spinners: 2.6.1 @@ -11050,6 +11144,20 @@ packages: is-wsl: 2.2.0 dev: true + /openapi-typescript-codegen@0.23.0: + resolution: + { + integrity: sha512-gOJXy5g3H3HlLpVNN+USrNK2i2KYBmDczk9Xk34u6JorwrGiDJZUj+al4S+i9TXdfUQ/ZaLxE59Xf3wqkxGfqA==, + } + hasBin: true + dependencies: + camelcase: 6.3.0 + commander: 9.5.0 + fs-extra: 10.1.0 + handlebars: 4.7.7 + json-schema-ref-parser: 9.0.9 + dev: true + /optionator@0.9.1: resolution: { @@ -11138,6 +11246,16 @@ packages: dependencies: yocto-queue: 1.0.0 + /p-limit@5.0.0: + resolution: + { + integrity: sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==, + } + engines: { node: ">=18" } + dependencies: + yocto-queue: 1.0.0 + dev: true + /p-locate@2.0.0: resolution: { @@ -11667,6 +11785,18 @@ packages: react-is: 18.2.0 dev: true + /pretty-format@29.7.0: + resolution: + { + integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } + dependencies: + "@jest/schemas": 29.6.3 + ansi-styles: 5.2.0 + react-is: 18.2.0 + dev: true + /proc-log@2.0.1: resolution: { @@ -11782,7 +11912,6 @@ packages: { integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==, } - dev: true /pump@3.0.0: resolution: @@ -12676,10 +12805,10 @@ packages: } dev: true - /std-env@3.4.3: + /std-env@3.6.0: resolution: { - integrity: sha512-f9aPhy8fYBuMN+sNfakZV18U39PbalgjXG3lLB9WkaYTxijru61wb57V9wxxNthXM5Sd88ETBWi29qLAsHO52Q==, + integrity: sha512-aFZ19IgVmhdB2uX599ve2kE6BIE3YMnQ6Gp6BURhW/oIzpXGKr878TQfAQZn1+i0Flcc/UKUy1gOlcfaUBCryg==, } dev: true @@ -13067,6 +13196,13 @@ packages: } dev: true + /tinybench@2.5.1: + resolution: + { + integrity: sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg==, + } + dev: true + /tinypool@0.8.1: resolution: { @@ -13666,17 +13802,16 @@ packages: builtins: 5.0.1 dev: true - /vite-node@1.0.0-beta.4(@types/node@18.15.11): + /vite-node@1.0.3(@types/node@18.15.11): resolution: { - integrity: sha512-YODjVvHd2Jih+TGMG3B99ktSyvET9w2cMevorAjcuQ3KKiPhDxEf2bRia2KsDHfnUGIfSpwoUdbcDdJ5xR7epg==, + integrity: sha512-7AH08/UgJQm4gWFyXB6xQ1AvI+iMioM2duPmptytxEbkHamVrOhoha4REt9xvOgyiw91G9OykRlixN4zIsQOQg==, } engines: { node: ^18.0.0 || >=20.0.0 } hasBin: true dependencies: cac: 6.7.14 debug: 4.3.4 - mlly: 1.4.2 pathe: 1.1.1 picocolors: 1.0.0 vite: 5.0.0(@types/node@18.15.11) @@ -13730,18 +13865,18 @@ packages: fsevents: 2.3.3 dev: true - /vitest@1.0.0-beta.4(@types/node@18.15.11): + /vitest@1.0.3(@types/node@18.15.11): resolution: { - integrity: sha512-WOJTqxY3hWqn4yy26SK+cx+BlPBeK/KtY9ALWkD6FLWLhSGY0QFEmarc8sdb/UGZQ8xs5pOvcQQS9JJSV8HH8g==, + integrity: sha512-zbMmAdRjTki6mYXEjCXMVH8Vb0FX0rAfCSTrbbn3Dqd8Zz6FzImBavkKYsOF+iXd4+k5RoOqi6RyTSoroRS0mw==, } engines: { node: ^18.0.0 || >=20.0.0 } hasBin: true peerDependencies: "@edge-runtime/vm": "*" "@types/node": ^18.0.0 || >=20.0.0 - "@vitest/browser": "*" - "@vitest/ui": "*" + "@vitest/browser": ^1.0.0 + "@vitest/ui": ^1.0.0 happy-dom: "*" jsdom: "*" peerDependenciesMeta: @@ -13759,26 +13894,26 @@ packages: optional: true dependencies: "@types/node": 18.15.11 - "@vitest/expect": 1.0.0-beta.4 - "@vitest/runner": 1.0.0-beta.4 - "@vitest/snapshot": 1.0.0-beta.4 - "@vitest/spy": 1.0.0-beta.4 - "@vitest/utils": 1.0.0-beta.4 - acorn: 8.10.0 - acorn-walk: 8.2.0 + "@vitest/expect": 1.0.3 + "@vitest/runner": 1.0.3 + "@vitest/snapshot": 1.0.3 + "@vitest/spy": 1.0.3 + "@vitest/utils": 1.0.3 + acorn-walk: 8.3.1 cac: 6.7.14 chai: 4.3.10 debug: 4.3.4 - local-pkg: 0.4.3 + execa: 8.0.1 + local-pkg: 0.5.0 magic-string: 0.30.5 pathe: 1.1.1 picocolors: 1.0.0 - std-env: 3.4.3 + std-env: 3.6.0 strip-literal: 1.3.0 - tinybench: 2.5.0 + tinybench: 2.5.1 tinypool: 0.8.1 vite: 5.0.0(@types/node@18.15.11) - vite-node: 1.0.0-beta.4(@types/node@18.15.11) + vite-node: 1.0.3(@types/node@18.15.11) why-is-node-running: 2.2.2 transitivePeerDependencies: - less pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy