@frsource/babylon-box3d 1.0.0 → 1.1.1

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/README.md CHANGED
@@ -71,10 +71,18 @@ compiled `box3d-wasm@0.2.0` binary by instantiating it and inspecting the live p
71
71
  raw access. Both are ambient module declarations; `index.ts` pulls them into the program via triple-slash
72
72
  references, so any package that does `import { Box3DPlugin } from '@frsource/babylon-box3d'` gets them for free --
73
73
  no `tsconfig.json` changes needed, _as long as you access box3d-wasm's types only through `Box3DPlugin` itself_
74
- (e.g. `plugin.world.createWheelJoint(...)`). If your own code also writes a direct `import ... from 'box3d-wasm'`,
74
+ (e.g. `plugin.world.createWheelJoint(...)`).
75
+
76
+ If your own code also writes a direct `import ... from 'box3d-wasm'`,
75
77
  TypeScript won't honor a dependency's augmentation of an already-resolved-but-untyped module for that import (see
76
- TS2665) -- copy `box3d-wasm.d.ts` (and `extraJoints.d.ts` if you need the wheel/filter/parallel joints) into your
77
- own project in that case, the way `docs/` here does for the demo.
78
+ TS2665). In that case, we recommend adding "include" property into your tsconfig.json like on the example:
79
+
80
+ ```json
81
+ // tsconfig.json
82
+ {
83
+ "include": ["node_modules/@frsource/babylon-box3d/dist"]
84
+ }
85
+ ```
78
86
 
79
87
  ## Demo
80
88
 
package/dist/index.d.mts CHANGED
@@ -645,6 +645,7 @@ declare module 'box3d-wasm' {
645
645
 
646
646
  import { IPhysicsEnginePluginV2, Observable, IPhysicsCollisionEvent, IBasePhysicsCollisionEvent, Vector3, PhysicsBody, PhysicsMotionType, Quaternion, Mesh, TransformNode, Nullable, PhysicsShape, PhysicsShapeType, PhysicsMassProperties, PhysicsConstraint, PhysicsShapeParameters, PhysicsMaterial, BoundingBox, PhysicsConstraintAxis, PhysicsConstraintAxisLimitMode, PhysicsConstraintMotorType, ConstrainedBodyPair, PhysicsRaycastResult, IRaycastQuery } from '@babylonjs/core';
647
647
  import { World, Box3DModule } from 'box3d-wasm';
648
+ export * from 'box3d-wasm';
648
649
 
649
650
  /**
650
651
  * Babylon.js Physics V2 plugin backed by {@link https://github.com/monteslu/box3d-wasm | box3d-wasm}.
package/dist/index.d.ts CHANGED
@@ -645,6 +645,7 @@ declare module 'box3d-wasm' {
645
645
 
646
646
  import { IPhysicsEnginePluginV2, Observable, IPhysicsCollisionEvent, IBasePhysicsCollisionEvent, Vector3, PhysicsBody, PhysicsMotionType, Quaternion, Mesh, TransformNode, Nullable, PhysicsShape, PhysicsShapeType, PhysicsMassProperties, PhysicsConstraint, PhysicsShapeParameters, PhysicsMaterial, BoundingBox, PhysicsConstraintAxis, PhysicsConstraintAxisLimitMode, PhysicsConstraintMotorType, ConstrainedBodyPair, PhysicsRaycastResult, IRaycastQuery } from '@babylonjs/core';
647
647
  import { World, Box3DModule } from 'box3d-wasm';
648
+ export * from 'box3d-wasm';
648
649
 
649
650
  /**
650
651
  * Babylon.js Physics V2 plugin backed by {@link https://github.com/monteslu/box3d-wasm | box3d-wasm}.
package/dist/index.js CHANGED
@@ -15,6 +15,7 @@ var __copyProps = (to, from, except, desc) => {
15
15
  }
16
16
  return to;
17
17
  };
18
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
18
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
20
 
20
21
  // index.ts
@@ -1237,7 +1238,11 @@ function readLimit(data, axis) {
1237
1238
  }
1238
1239
  return { min: data.axisMinLimit.get(axis), max: data.axisMaxLimit.get(axis) };
1239
1240
  }
1241
+
1242
+ // index.ts
1243
+ __reExport(index_exports, require("box3d-wasm"), module.exports);
1240
1244
  // Annotate the CommonJS export names for ESM import in node:
1241
1245
  0 && (module.exports = {
1242
- Box3DPlugin
1246
+ Box3DPlugin,
1247
+ ...require("box3d-wasm")
1243
1248
  });
package/dist/index.mjs CHANGED
@@ -1224,6 +1224,9 @@ function readLimit(data, axis) {
1224
1224
  }
1225
1225
  return { min: data.axisMinLimit.get(axis), max: data.axisMaxLimit.get(axis) };
1226
1226
  }
1227
+
1228
+ // index.ts
1229
+ export * from "box3d-wasm";
1227
1230
  export {
1228
1231
  Box3DPlugin
1229
1232
  };
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@frsource/babylon-box3d",
3
- "version": "1.0.0",
3
+ "version": "1.1.1",
4
4
  "description": "Babylon.js Physics V2 plugin backed by box3d-wasm (Erin Catto's Box3D compiled to WebAssembly)",
5
5
  "repository": "https://github.com/FRSOURCE/babylon-box3d.git",
6
6
  "homepage": "https://github.com/FRSOURCE/babylon-box3d",
7
7
  "scripts": {
8
+ "dev": "pnpm run --filter @frsource/babylon-box3d-demo dev",
8
9
  "build": "tsup && node scripts/bundle-ambient-types.mjs",
9
10
  "lint": "eslint . && prettier . --check",
10
11
  "fix": "pnpm eslint --fix && prettier . --write",
@@ -48,8 +49,8 @@
48
49
  "@frsource/eslint-config": "1.85.2",
49
50
  "@frsource/prettier-config": "1.47.2",
50
51
  "@frsource/semantic-release-config": "1.116.2",
51
- "@vitest/coverage-v8": "4.1.9",
52
- "@vitest/ui": "4.1.9",
52
+ "@vitest/coverage-v8": "4.1.10",
53
+ "@vitest/ui": "4.1.10",
53
54
  "del-cli": "7.0.0",
54
55
  "eslint": "10.5.0",
55
56
  "globals": "17.7.0",
@@ -57,7 +58,7 @@
57
58
  "prettier": "3.8.4",
58
59
  "semantic-release": "25.0.5",
59
60
  "typescript": "^6.0.3",
60
- "vitest": "4.1.9"
61
+ "vitest": "4.1.10"
61
62
  },
62
63
  "publishConfig": {
63
64
  "access": "public"