@driftengine/physics 4.8.7 → 4.10.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/README.md CHANGED
@@ -399,7 +399,7 @@ asserting that property since. What kept a pool out was never the engine.
399
399
 
400
400
  ```ts
401
401
  import { PhysicsWorld } from '@driftengine/physics';
402
- import { createIslandPool } from '@driftengine/physics/src/workers.ts';
402
+ import { createIslandPool } from '@driftengine/physics/workers';
403
403
 
404
404
  const world = new PhysicsWorld({ workers: 4, pool: createIslandPool });
405
405
  world.parallelism; // { requested: 4, running: 4, reason: '' }
@@ -414,7 +414,7 @@ unreachable, so a barrel that merely re-exported the factory still wrote **12,25
414
414
  worker to disk in builds where nothing could fetch it. Reported by one consumer and reproduced on a
415
415
  second the same day.
416
416
 
417
- So the factory is at `@driftengine/physics/src/workers.ts`. A caller already had to name it, so the
417
+ So the factory is at `@driftengine/physics/workers`. A caller already had to name it, so the
418
418
  cost is the specifier and nothing else, and importing `PhysicsWorld` now names no worker at all.
419
419
 
420
420
  **Read `parallelism` instead of assuming the option took.** Every path that does not start a pool
package/dist/workers.d.ts CHANGED
@@ -23,11 +23,16 @@
23
23
  *
24
24
  * ```ts
25
25
  * import { PhysicsWorld } from '@driftengine/physics';
26
- * import { createIslandPool } from '@driftengine/physics/src/workers.ts';
26
+ * import { createIslandPool } from '@driftengine/physics/workers';
27
27
  *
28
28
  * const world = new PhysicsWorld({ workers: 4, pool: createIslandPool });
29
29
  * ```
30
30
  *
31
+ * **A declared subpath, so it resolves the way the barrel does**: to the build by default and to
32
+ * this file under `drift-source`. The path into `src/` documented until it was declared still
33
+ * resolves, through the manifest's `./*` passthrough, and hands every consumer TypeScript inside
34
+ * `node_modules`, which is the default the 2026-09-13 flip took away from the barrels.
35
+ *
31
36
  * `scripts/worker-entry.test.mjs` bundles the barrel and asserts it names no worker, because every
32
37
  * gate in this repository passed while the chunk was shipping.
33
38
  */
package/dist/workers.js CHANGED
@@ -23,11 +23,16 @@
23
23
  *
24
24
  * ```ts
25
25
  * import { PhysicsWorld } from '@driftengine/physics';
26
- * import { createIslandPool } from '@driftengine/physics/src/workers.ts';
26
+ * import { createIslandPool } from '@driftengine/physics/workers';
27
27
  *
28
28
  * const world = new PhysicsWorld({ workers: 4, pool: createIslandPool });
29
29
  * ```
30
30
  *
31
+ * **A declared subpath, so it resolves the way the barrel does**: to the build by default and to
32
+ * this file under `drift-source`. The path into `src/` documented until it was declared still
33
+ * resolves, through the manifest's `./*` passthrough, and hands every consumer TypeScript inside
34
+ * `node_modules`, which is the default the 2026-09-13 flip took away from the barrels.
35
+ *
31
36
  * `scripts/worker-entry.test.mjs` bundles the barrel and asserts it names no worker, because every
32
37
  * gate in this repository passed while the chunk was shipping.
33
38
  */
package/dist/world.d.ts CHANGED
@@ -87,7 +87,7 @@ export interface WorldOptions {
87
87
  *
88
88
  * ```ts
89
89
  * import { PhysicsWorld } from '@driftengine/physics';
90
- * import { createIslandPool } from '@driftengine/physics/src/workers.ts';
90
+ * import { createIslandPool } from '@driftengine/physics/workers';
91
91
  *
92
92
  * const world = new PhysicsWorld({ workers: 4, pool: createIslandPool });
93
93
  * ```
package/dist/world.js CHANGED
@@ -134,9 +134,9 @@ export class PhysicsWorld {
134
134
  if (granted > 0) {
135
135
  if (options.pool === undefined) {
136
136
  this.parallelism.reason =
137
- 'workers were asked for but no pool was given. Import createIslandPool from ' +
138
- '@driftengine/physics/src/workers.ts and pass it as the pool option; it is behind its ' +
139
- 'own specifier so that importing PhysicsWorld does not put a worker in your bundle.';
137
+ 'workers were asked for but no pool was given. Import createIslandPool, exported by ' +
138
+ "'@driftengine/physics/workers', and pass it as the pool option; it is behind its own " +
139
+ 'specifier so that importing PhysicsWorld does not put a worker in your bundle.';
140
140
  }
141
141
  else {
142
142
  const pool = options.pool({ workers: granted, spawn: options.spawn });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@driftengine/physics",
3
- "version": "4.8.7",
3
+ "version": "4.10.0",
4
4
  "description": "Collision shapes, spatial queries and swept kinematic collision",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -12,6 +12,11 @@
12
12
  "types": "./dist/index.d.ts",
13
13
  "default": "./dist/index.js"
14
14
  },
15
+ "./workers": {
16
+ "drift-source": "./src/workers.ts",
17
+ "types": "./dist/workers.d.ts",
18
+ "default": "./dist/workers.js"
19
+ },
15
20
  "./package.json": "./package.json",
16
21
  "./*": "./*"
17
22
  },
package/src/index.ts CHANGED
@@ -59,7 +59,7 @@ export { solveIslandInto } from './islandSolve.ts';
59
59
  * decides the pool is unreachable — so re-exporting it from this barrel wrote a 12 KB gzipped
60
60
  * worker chunk into the bundle of every consumer that merely imported `PhysicsWorld`.
61
61
  *
62
- * It lives at `@driftengine/physics/src/workers.ts`, which that file explains. A caller already had
62
+ * It lives at `@driftengine/physics/workers`, which `workers.ts` explains. A caller already had
63
63
  * to name `createIslandPool` at the call site for 3.54.0's own reason, so this costs a specifier.
64
64
  *
65
65
  * The *types* stay reachable from here, because a type import emits nothing and a consumer typing a
package/src/workers.ts CHANGED
@@ -23,11 +23,16 @@
23
23
  *
24
24
  * ```ts
25
25
  * import { PhysicsWorld } from '@driftengine/physics';
26
- * import { createIslandPool } from '@driftengine/physics/src/workers.ts';
26
+ * import { createIslandPool } from '@driftengine/physics/workers';
27
27
  *
28
28
  * const world = new PhysicsWorld({ workers: 4, pool: createIslandPool });
29
29
  * ```
30
30
  *
31
+ * **A declared subpath, so it resolves the way the barrel does**: to the build by default and to
32
+ * this file under `drift-source`. The path into `src/` documented until it was declared still
33
+ * resolves, through the manifest's `./*` passthrough, and hands every consumer TypeScript inside
34
+ * `node_modules`, which is the default the 2026-09-13 flip took away from the barrels.
35
+ *
31
36
  * `scripts/worker-entry.test.mjs` bundles the barrel and asserts it names no worker, because every
32
37
  * gate in this repository passed while the chunk was shipping.
33
38
  */
package/src/world.ts CHANGED
@@ -126,7 +126,7 @@ export interface WorldOptions {
126
126
  *
127
127
  * ```ts
128
128
  * import { PhysicsWorld } from '@driftengine/physics';
129
- * import { createIslandPool } from '@driftengine/physics/src/workers.ts';
129
+ * import { createIslandPool } from '@driftengine/physics/workers';
130
130
  *
131
131
  * const world = new PhysicsWorld({ workers: 4, pool: createIslandPool });
132
132
  * ```
@@ -284,9 +284,9 @@ export class PhysicsWorld implements IslandSolver {
284
284
  if (granted > 0) {
285
285
  if (options.pool === undefined) {
286
286
  this.parallelism.reason =
287
- 'workers were asked for but no pool was given. Import createIslandPool from ' +
288
- '@driftengine/physics/src/workers.ts and pass it as the pool option; it is behind its ' +
289
- 'own specifier so that importing PhysicsWorld does not put a worker in your bundle.';
287
+ 'workers were asked for but no pool was given. Import createIslandPool, exported by ' +
288
+ "'@driftengine/physics/workers', and pass it as the pool option; it is behind its own " +
289
+ 'specifier so that importing PhysicsWorld does not put a worker in your bundle.';
290
290
  } else {
291
291
  const pool = options.pool({ workers: granted, spawn: options.spawn });
292
292
  if (pool.executor !== null) this.executor = pool.executor;