@dayme/bunraylib 0.1.0 → 1.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.
Files changed (67) hide show
  1. package/README.md +60 -11
  2. package/package.json +11 -3
  3. package/src/Raylib.ts +58 -3678
  4. package/src/c/common.h +0 -2
  5. package/src/constants.ts +2 -2
  6. package/src/index.ts +6 -6
  7. package/src/main.c +0 -1
  8. package/src/main.d.ts +1 -1
  9. package/src/modules/audio/AudioModule.ts +197 -0
  10. package/src/modules/audio/symbols.ts +70 -0
  11. package/src/{c/audio.c → modules/audio/wrapper.c} +40 -80
  12. package/src/modules/camera/CameraModule.ts +239 -0
  13. package/src/modules/camera/symbols.ts +49 -0
  14. package/src/modules/camera/wrapper.c +141 -0
  15. package/src/modules/collision/CollisionModule.ts +363 -0
  16. package/src/modules/collision/symbols.ts +149 -0
  17. package/src/modules/collision/wrapper.c +176 -0
  18. package/src/modules/color/ColorModule.ts +65 -0
  19. package/src/modules/color/symbols.ts +26 -0
  20. package/src/modules/color/wrapper.c +16 -0
  21. package/src/modules/draw3d/Draw3DModule.ts +441 -0
  22. package/src/modules/draw3d/symbols.ts +199 -0
  23. package/src/modules/draw3d/wrapper.c +202 -0
  24. package/src/modules/font/FontModule.ts +250 -0
  25. package/src/modules/font/symbols.ts +46 -0
  26. package/src/{c/font.c → modules/font/wrapper.c} +50 -70
  27. package/src/modules/image/ImageModule.ts +451 -0
  28. package/src/{symbols/image.ts → modules/image/symbols.ts} +15 -12
  29. package/src/{c/image.c → modules/image/wrapper.c} +23 -45
  30. package/src/modules/input/InputModule.ts +160 -0
  31. package/src/modules/input/symbols.ts +54 -0
  32. package/src/modules/input/wrapper.c +31 -0
  33. package/src/modules/model/ModelModule.ts +228 -0
  34. package/src/{symbols/model.ts → modules/model/symbols.ts} +17 -14
  35. package/src/{c/model.c → modules/model/wrapper.c} +30 -30
  36. package/src/modules/shader/ShaderModule.ts +78 -0
  37. package/src/{symbols/shader.ts → modules/shader/symbols.ts} +3 -1
  38. package/src/{c/shader.c → modules/shader/wrapper.c} +11 -1
  39. package/src/modules/shapes/ShapesModule.ts +687 -0
  40. package/src/modules/shapes/symbols.ts +161 -0
  41. package/src/modules/shapes/wrapper.c +183 -0
  42. package/src/modules/texture/TextureModule.ts +190 -0
  43. package/src/{symbols/texture.ts → modules/texture/symbols.ts} +15 -9
  44. package/src/{c/texture.c → modules/texture/wrapper.c} +7 -22
  45. package/src/modules/window/WindowModule.ts +248 -0
  46. package/src/modules/window/symbols.ts +85 -0
  47. package/src/modules/window/wrapper.c +39 -0
  48. package/src/symbols.ts +87 -47
  49. package/src/utils.ts +63 -15
  50. package/src/c/camera.c +0 -161
  51. package/src/c/collision.c +0 -176
  52. package/src/c/color.c +0 -100
  53. package/src/c/draw3d.c +0 -222
  54. package/src/c/filesystem.c +0 -36
  55. package/src/c/input.c +0 -85
  56. package/src/c/shapes.c +0 -283
  57. package/src/c/window.c +0 -150
  58. package/src/symbols/audio.ts +0 -64
  59. package/src/symbols/camera.ts +0 -46
  60. package/src/symbols/collision.ts +0 -116
  61. package/src/symbols/color.ts +0 -22
  62. package/src/symbols/draw3d.ts +0 -137
  63. package/src/symbols/filesystem.ts +0 -30
  64. package/src/symbols/font.ts +0 -40
  65. package/src/symbols/input.ts +0 -51
  66. package/src/symbols/shapes.ts +0 -92
  67. package/src/symbols/window.ts +0 -83
package/README.md CHANGED
@@ -1,31 +1,80 @@
1
1
  # rraylib
2
2
 
3
- TypeScript FFI bindings for [raylib](https://www.raylib.com/) — built entirely with [Bun](https://bun.sh/).
3
+ > TypeScript FFI bindings for [raylib](https://www.raylib.com/) — powered by [Bun](https://bun.sh/).
4
4
 
5
- No external dependencies required. Everything is compiled through `bun ffi cc`, so all you need is Bun.
5
+ Zero external dependencies. The C wrappers are compiled on-the-fly via `bun ffi cc`, so all you need is Bun ≥1.3.
6
6
 
7
- ## Progress
7
+ ## Install
8
8
 
9
- **500 / 548 functions implemented (91.2%)**
9
+ ```bash
10
+ bun install @dayme/bunraylib
11
+ ```
12
+
13
+ ## Quick start
14
+
15
+ ```typescript
16
+ import { Raylib, COLORS } from "@dayme/bunraylib";
17
+
18
+ Raylib.initWindow(800, 600, "Hello rraylib");
19
+ Raylib.setTargetFPS(60);
20
+
21
+ while (!Raylib.windowShouldClose()) {
22
+ Raylib.beginDrawing();
23
+ Raylib.clearBackground(COLORS.DARKGRAY);
24
+ Raylib.drawText("Hello World!", 350, 280, 20, COLORS.WHITE);
25
+ Raylib.endDrawing();
26
+ }
27
+
28
+ Raylib.closeWindow();
29
+ ```
30
+
31
+ Run it:
32
+
33
+ ```bash
34
+ bun run main.ts
35
+ ```
36
+
37
+ ## API coverage
38
+
39
+ **494 / 496 functions implemented (99.6%)**
10
40
 
11
41
  | Module | Progress |
12
42
  | --- | --- |
13
- | Window and Graphics Device | 114/147 (78%) |
43
+ | Window and Graphics Device | 97/99 (98%) |
14
44
  | Input Handling | 37/37 (100%) |
15
45
  | Gestures and Touch | 8/8 (100%) |
16
46
  | Camera System | 2/2 (100%) |
17
- | Shapes Drawing | 66/69 (96%) |
47
+ | Shapes Drawing | 69/69 (100%) |
18
48
  | Texture Loading and Drawing | 112/112 (100%) |
19
- | Font Loading and Text Drawing | 34/37 (92%) |
49
+ | Font Loading and Text Drawing | 37/37 (100%) |
20
50
  | Basic 3D Shapes | 21/21 (100%) |
21
- | Model Loading and Drawing | 48/50 (96%) |
22
- | Audio Loading and Playing | 58/65 (89%) |
51
+ | Model Loading and Drawing | 50/50 (100%) |
52
+ | Audio Loading and Playing | 61/61 (100%) |
23
53
 
24
54
  Full breakdown: [PROGRESS.md](./PROGRESS.md)
25
55
 
26
- ## Usage
56
+ ## Examples
57
+
58
+ Explore the [`examples/`](./examples) directory:
59
+
60
+ ```bash
61
+ bun run examples/shapes.ts # 2D shapes
62
+ bun run examples/shapes3d.ts # 3D primitives
63
+ bun run examples/textures.ts # Textures & render targets
64
+ bun run examples/models.ts # GLB model viewer
65
+ bun run examples/audio.ts # Sound & music
66
+ bun run examples/index.ts # Input, window & clipboard demo
67
+ ```
68
+
69
+ ## Requirements
70
+
71
+ - [Bun](https://bun.sh/) ≥ 1.3
72
+
73
+ ## Development
27
74
 
28
75
  ```bash
29
76
  bun install
30
- bun run index.ts
77
+ bun test # run all tests
78
+ bun run lint # oxlint
79
+ bun run progress # regenerate PROGRESS.md
31
80
  ```
package/package.json CHANGED
@@ -1,8 +1,14 @@
1
1
  {
2
2
  "name": "@dayme/bunraylib",
3
- "version": "0.1.0",
3
+ "version": "1.0.0",
4
4
  "description": "TypeScript FFI bindings for raylib — zero dependencies, powered by Bun",
5
- "keywords": ["raylib", "ffi", "bun", "gamedev", "graphics"],
5
+ "keywords": [
6
+ "raylib",
7
+ "ffi",
8
+ "bun",
9
+ "gamedev",
10
+ "graphics"
11
+ ],
6
12
  "license": "MIT",
7
13
  "type": "module",
8
14
  "module": "src/index.ts",
@@ -27,8 +33,10 @@
27
33
  "@types/bun": "^1.3.11"
28
34
  },
29
35
  "devDependencies": {
36
+ "fast-check": "^4.8.0",
30
37
  "oxfmt": "^0.43.0",
31
- "oxlint": "^1.58.0"
38
+ "oxlint": "^1.58.0",
39
+ "oxlint-tsgolint": "^0.23.0"
32
40
  },
33
41
  "peerDependencies": {
34
42
  "typescript": "^5"