@wolffo/three-fire 1.0.4 → 1.0.5

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.
Files changed (2) hide show
  1. package/README.md +23 -0
  2. package/package.json +21 -11
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Three fire
2
2
 
3
3
  [![CI](https://github.com/typeWolffo/THREE.Fire/workflows/CI/badge.svg)](https://github.com/typeWolffo/THREE.Fire/actions)
4
+ [![Tests](https://img.shields.io/github/actions/workflow/status/typeWolffo/THREE.Fire/ci.yml?label=tests)](https://github.com/typeWolffo/THREE.Fire/actions)
5
+ [![Coverage](https://img.shields.io/badge/coverage-92%25-brightgreen)](https://github.com/typeWolffo/THREE.Fire)
4
6
  [![npm version](https://img.shields.io/npm/v/@wolffo/three-fire.svg)](https://www.npmjs.com/package/@wolffo/three-fire)
5
7
  [![npm downloads](https://img.shields.io/npm/dm/@wolffo/three-fire.svg)](https://www.npmjs.com/package/@wolffo/three-fire)
6
8
 
@@ -171,8 +173,29 @@ npm run typecheck
171
173
 
172
174
  # Run tests
173
175
  npm test
176
+
177
+ # Test in watch mode
178
+ npm run test:watch
179
+
180
+ # Visual test UI
181
+ npm run test:ui
182
+
183
+ # Coverage report
184
+ npm run test:coverage
174
185
  ```
175
186
 
187
+ ### Testing
188
+
189
+ The project includes comprehensive tests with **92%+ coverage**:
190
+
191
+ - **49 test cases** covering all functionality
192
+ - **Unit tests** for Fire class and FireShader
193
+ - **Integration tests** for React components
194
+ - **Mock environment** for Three.js and React Three Fiber
195
+ - **Coverage reporting** with detailed metrics
196
+
197
+ Test files are located in `test/` and use Vitest with Testing Library.
198
+
176
199
  ## Credits
177
200
 
178
201
  Based on the original THREE.Fire by [mattatz](https://github.com/mattatz/THREE.Fire)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wolffo/three-fire",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "type": "module",
5
5
  "description": "Modern TypeScript volumetric fire effect for Three.js and React Three Fiber",
6
6
  "main": "dist/index.js",
@@ -8,16 +8,19 @@
8
8
  "module": "dist/index.esm.js",
9
9
  "exports": {
10
10
  ".": {
11
+ "types": "./dist/index.d.ts",
11
12
  "import": "./dist/index.esm.js",
12
- "require": "./dist/index.js",
13
- "types": "./dist/index.d.ts"
13
+ "require": "./dist/index.js"
14
14
  }
15
15
  },
16
16
  "scripts": {
17
17
  "build": "rollup -c",
18
18
  "dev": "rollup -c -w",
19
19
  "typecheck": "tsc --noEmit",
20
- "test": "node test/test-vanilla.js",
20
+ "test": "vitest run",
21
+ "test:watch": "vitest",
22
+ "test:ui": "vitest --ui",
23
+ "test:coverage": "vitest run --coverage",
21
24
  "prepublishOnly": "npm run build",
22
25
  "release:patch": "npm version patch && git push origin master --tags",
23
26
  "release:minor": "npm version minor && git push origin master --tags",
@@ -38,9 +41,9 @@
38
41
  "author": "wolffo",
39
42
  "license": "MIT",
40
43
  "peerDependencies": {
41
- "three": ">=0.150.0",
44
+ "@react-three/fiber": ">=8.0.0",
42
45
  "react": ">=18.0.0",
43
- "@react-three/fiber": ">=8.0.0"
46
+ "three": ">=0.150.0"
44
47
  },
45
48
  "peerDependenciesMeta": {
46
49
  "react": {
@@ -51,16 +54,23 @@
51
54
  }
52
55
  },
53
56
  "devDependencies": {
57
+ "@react-three/fiber": "^8.15.12",
58
+ "@rollup/plugin-typescript": "^11.1.5",
59
+ "@testing-library/jest-dom": "^6.6.3",
60
+ "@testing-library/react": "^16.3.0",
54
61
  "@types/react": "^18.2.45",
55
62
  "@types/three": "^0.160.0",
56
- "@react-three/fiber": "^8.15.12",
63
+ "@vitest/coverage-v8": "^3.2.4",
64
+ "@vitest/ui": "^3.2.4",
65
+ "happy-dom": "^18.0.1",
57
66
  "react": "^18.2.0",
58
- "three": "^0.160.0",
59
- "typescript": "^5.3.3",
67
+ "react-dom": "^18.3.1",
60
68
  "rollup": "^4.9.2",
61
- "@rollup/plugin-typescript": "^11.1.5",
62
69
  "rollup-plugin-dts": "^6.1.0",
63
- "tslib": "^2.6.2"
70
+ "three": "^0.160.0",
71
+ "tslib": "^2.6.2",
72
+ "typescript": "^5.3.3",
73
+ "vitest": "^3.2.4"
64
74
  },
65
75
  "files": [
66
76
  "dist",