vitest-environment-webgpu-node 1.0.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
- ## [vitest-environment-webgpu-node-v1.0.2](https://github.com/bhouston/vitest-gpu/compare/vitest-environment-webgpu-node-v1.0.1...vitest-environment-webgpu-node-v1.0.2) (2026-09-21)
1
+ ## [vitest-environment-webgpu-node-v2.0.0](https://github.com/bhouston/vitest-gpu/compare/vitest-environment-webgpu-node-v1.0.2...vitest-environment-webgpu-node-v2.0.0) (2026-09-23)
2
2
 
3
- ### Bug Fixes
3
+ ### ⚠ BREAKING CHANGES
4
4
 
5
- * support public types across TypeScript versions ([0f3df06](https://github.com/bhouston/vitest-gpu/commit/0f3df067f28308e0154045304ecbcaf2ba840fcc)), closes [#24](https://github.com/bhouston/vitest-gpu/issues/24)
5
+ * **webgpu-node:** TypeScript 5 projects no longer receive WebGPU types
6
+ from this package; upgrade to TypeScript 6 or add @webgpu/types.
7
+
8
+ ### Features
9
+
10
+ * **webgl-node:** warn when backend or api options are ignored ([2cb09c0](https://github.com/bhouston/vitest-gpu/commit/2cb09c00fecd091dc5ec1d60ed149a3b54b6d902)), closes [#42](https://github.com/bhouston/vitest-gpu/issues/42)
11
+ * **webgpu-node:** require TypeScript 6 or later ([bfb2586](https://github.com/bhouston/vitest-gpu/commit/bfb258649b354420bd2961e005e48044ad9122b3)), closes [#43](https://github.com/bhouston/vitest-gpu/issues/43) [#44](https://github.com/bhouston/vitest-gpu/issues/44)
12
+ * **webgpu-node:** require TypeScript 6 or later ([daf463d](https://github.com/bhouston/vitest-gpu/commit/daf463d1e89193f4bf4e08e9646c328962a95c1b)), closes [#42](https://github.com/bhouston/vitest-gpu/issues/42)
package/README.md CHANGED
@@ -1,6 +1,13 @@
1
1
  # vitest-environment-webgpu-node
2
2
 
3
- Real, headless WebGPU inside Vitest, with no browser. Powered by Google's Dawn through the
3
+ [![npm version][npm-badge]][npm-url]
4
+ [![npm downloads][downloads-badge]][npm-url]
5
+ [![Tests][tests-badge]][tests-url]
6
+
7
+ Real, headless WebGPU inside Vitest, with no browser. Native GPU testing is up to 2.4x faster
8
+ than running the same tests in a browser — see the
9
+ [blog post](https://ben3d.ca/blog/native-gpu-testing-for-vitest-and-jest) for details.
10
+ Powered by Google's Dawn through the
4
11
  [`webgpu`](https://github.com/dawn-gpu/node-webgpu) npm package.
5
12
 
6
13
  The environment puts `navigator.gpu` and every `GPU*` class and constant (`GPUBufferUsage`,
@@ -16,10 +23,14 @@ in [jest-gpu](https://github.com/bhouston/jest-gpu).
16
23
  pnpm add -D vitest vitest-environment-webgpu-node
17
24
  ```
18
25
 
26
+ Type checking needs TypeScript 6 or later (see [TypeScript types](#typescript-types)).
27
+
19
28
  ## Usage
20
29
 
21
30
  ```ts
22
31
  // vitest.config.ts
32
+ import { defineConfig } from 'vitest/config';
33
+
23
34
  export default defineConfig({
24
35
  test: {
25
36
  environment: 'webgpu-node',
@@ -30,9 +41,8 @@ export default defineConfig({
30
41
 
31
42
  ### TypeScript types
32
43
 
33
- The package selects WebGPU declarations for your compiler version. TypeScript 5 receives the bundled
34
- `@webgpu/types` dependency; TypeScript 6 and later use WebGPU declarations from their DOM library. Include
35
- the DOM library and keep `skipLibCheck` disabled to catch declaration conflicts:
44
+ Requires TypeScript 6 or later, whose DOM library declares the WebGPU API. Include the DOM library in
45
+ `lib` (a project without it can add `@webgpu/types` to `types` instead):
36
46
 
37
47
  ```json
38
48
  {
@@ -88,3 +98,9 @@ Created by [Ben Houston](https://ben3d.ca) and sponsored by [Land of Assets](htt
88
98
  ## License
89
99
 
90
100
  MIT
101
+
102
+ [npm-badge]: https://img.shields.io/npm/v/vitest-environment-webgpu-node.svg
103
+ [npm-url]: https://www.npmjs.com/package/vitest-environment-webgpu-node
104
+ [downloads-badge]: https://img.shields.io/npm/dm/vitest-environment-webgpu-node.svg
105
+ [tests-badge]: https://github.com/bhouston/vitest-gpu/actions/workflows/ci.yml/badge.svg
106
+ [tests-url]: https://github.com/bhouston/vitest-gpu/actions/workflows/ci.yml
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitest-environment-webgpu-node",
3
- "version": "1.0.2",
3
+ "version": "2.0.0",
4
4
  "description": "Vitest environment that provides real headless WebGPU (Dawn via the webgpu package) in Node",
5
5
  "keywords": [
6
6
  "dawn",
@@ -22,7 +22,6 @@
22
22
  "directory": "packages/vitest-environment-webgpu-node"
23
23
  },
24
24
  "files": [
25
- "legacy.d.ts",
26
25
  "dist/**/*.js",
27
26
  "dist/**/*.js.map",
28
27
  "dist/**/*.d.ts",
@@ -36,7 +35,6 @@
36
35
  "types": "./dist/index.d.ts",
37
36
  "exports": {
38
37
  ".": {
39
- "types@<6.0": "./legacy.d.ts",
40
38
  "types": "./dist/index.d.ts",
41
39
  "import": "./dist/index.js"
42
40
  }
@@ -49,12 +47,17 @@
49
47
  "tsc": "tsc"
50
48
  },
51
49
  "dependencies": {
52
- "@webgpu/types": "^0.1.72",
53
50
  "webgpu": "^0.6.1"
54
51
  },
55
52
  "peerDependencies": {
53
+ "typescript": ">=6",
56
54
  "vitest": ">=3 <5"
57
55
  },
56
+ "peerDependenciesMeta": {
57
+ "typescript": {
58
+ "optional": true
59
+ }
60
+ },
58
61
  "engines": {
59
62
  "node": ">=20.0.0"
60
63
  }
package/legacy.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /** WebGPU declarations for TypeScript versions whose DOM library predates the WebGPU API. */
2
- /// <reference types="@webgpu/types" />
3
-
4
- export { default } from './dist/index.js';
5
- export * from './dist/index.js';