@bitbybit-dev/create-app 1.5.0 → 1.6.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 (52) hide show
  1. package/README.md +2 -2
  2. package/dist/index.js +6 -6
  3. package/dist/index.js.map +1 -1
  4. package/package.json +2 -2
  5. package/src/index.ts +6 -6
  6. package/templates/_agent/AGENTS.md +2 -2
  7. package/templates/apps/drone-assembly/README.md +1 -1
  8. package/templates/apps/drone-assembly/package.json +4 -4
  9. package/templates/apps/drone-assembly/scripts/smoke.ts +3 -3
  10. package/templates/apps/drone-assembly/src/main.ts +1 -1
  11. package/templates/apps/drone-assembly/src/parts.ts +1 -1
  12. package/templates/apps/ifc-house/AGENTS.section.md +2 -2
  13. package/templates/apps/ifc-house/README.md +2 -2
  14. package/templates/apps/ifc-house/package.json +9 -9
  15. package/templates/apps/ifc-house/scripts/smoke.ts +3 -3
  16. package/templates/apps/ifc-house/src/main.ts +23 -27
  17. package/templates/apps/ifc-house/src/scene/draw-house.ts +52 -51
  18. package/templates/apps/ifc-house/src/scene/scene-types.ts +4 -3
  19. package/templates/apps/ifc-house/src/workers/manifold.worker.ts +1 -1
  20. package/templates/apps/laser-cut-box/README.md +1 -1
  21. package/templates/apps/laser-cut-box/package.json +3 -3
  22. package/templates/apps/laser-cut-box/scripts/smoke.ts +3 -3
  23. package/templates/apps/product-configurator/AGENTS.section.md +1 -1
  24. package/templates/apps/product-configurator/README.md +1 -1
  25. package/templates/apps/product-configurator/package.json +3 -3
  26. package/templates/apps/product-configurator/scripts/smoke.ts +3 -3
  27. package/templates/apps/sheet-metal-unfold/AGENTS.section.md +3 -3
  28. package/templates/apps/sheet-metal-unfold/README.md +1 -1
  29. package/templates/apps/sheet-metal-unfold/backend/package.json +1 -1
  30. package/templates/apps/sheet-metal-unfold/frontend/package.json +3 -3
  31. package/templates/apps/sheet-metal-unfold/frontend/scripts/smoke.ts +3 -3
  32. package/templates/apps/sheet-metal-unfold/frontend/src/cloud-access.ts +1 -1
  33. package/templates/apps/step-to-gltf-cli/AGENTS.section.md +1 -1
  34. package/templates/apps/step-to-gltf-cli/README.md +1 -1
  35. package/templates/apps/step-to-gltf-cli/package.json +2 -2
  36. package/templates/apps/step-to-gltf-cli/src/cli.ts +2 -2
  37. package/templates/apps/step-to-gltf-cli/src/cloud.ts +1 -1
  38. package/templates/apps/step-to-gltf-cli/src/kernel.ts +3 -3
  39. package/templates/cloud/backends/hono-rest/package.json +1 -1
  40. package/templates/cloud/backends/hono-sdk/package.json +2 -2
  41. package/templates/cloud/backends/nodejs-rest/package.json +1 -1
  42. package/templates/cloud/backends/nodejs-sdk/package.json +2 -2
  43. package/templates/cloud/frontend/package.json +2 -2
  44. package/templates/vite/babylonjs/typescript/AGENTS.section.md +2 -2
  45. package/templates/vite/babylonjs/typescript/package.json +2 -2
  46. package/templates/vite/babylonjs/typescript/scripts/smoke.ts +3 -3
  47. package/templates/vite/playcanvas/typescript/AGENTS.section.md +2 -2
  48. package/templates/vite/playcanvas/typescript/package.json +3 -3
  49. package/templates/vite/playcanvas/typescript/scripts/smoke.ts +3 -3
  50. package/templates/vite/threejs/typescript/AGENTS.section.md +2 -2
  51. package/templates/vite/threejs/typescript/package.json +2 -2
  52. package/templates/vite/threejs/typescript/scripts/smoke.ts +3 -3
@@ -2,7 +2,7 @@ import { createRequire } from "node:module";
2
2
  import { readdirSync } from "node:fs";
3
3
  import { dirname, join } from "node:path";
4
4
  import initOpenCascade from "@bitbybit-dev/occt/bitbybit-dev-occt/index.js";
5
- import { OCCTService, OccHelper, VectorHelperService, ShapesHelperService } from "@bitbybit-dev/occt";
5
+ import { OCCTService } from "@bitbybit-dev/occt";
6
6
  import { buildModel, defaultParams, type Occt } from "../src/model.ts";
7
7
 
8
8
  function inProcess(service: object): Occt {
@@ -12,9 +12,9 @@ function inProcess(service: object): Occt {
12
12
  const require = createRequire(import.meta.url);
13
13
  const kernelDir = dirname(require.resolve("@bitbybit-dev/occt/bitbybit-dev-occt/index.js"));
14
14
  const wasmFile = readdirSync(kernelDir).find((file) => file.endsWith(".wasm"));
15
- if (!wasmFile) throw new Error(`no OCCT kernel (.wasm) found in ${kernelDir}`);
15
+ if (!wasmFile) throw new Error(`no Bitbybit OCCT Kernel (.wasm) found in ${kernelDir}`);
16
16
  const occ = await initOpenCascade({ locateFile: (file: string) => (file.endsWith(".wasm") ? join(kernelDir, wasmFile) : file) });
17
- const occt = inProcess(new OCCTService(occ, new OccHelper(new VectorHelperService(), new ShapesHelperService(), occ)));
17
+ const occt = inProcess(new OCCTService(occ));
18
18
 
19
19
  const shape = await buildModel(occt, defaultParams);
20
20
  const info = await occt.shapes.solid.debugInfo({ shape });
@@ -2,7 +2,7 @@
2
2
 
3
3
  - `src/model.ts` is the geometry. `buildModel(occt, params)` builds the OCCT shape from `ModelParams` and returns it. It knows nothing about rendering, and every kernel call is awaited, so the same function runs in the browser (through the OCCT worker, whose calls return promises) and in Node (in-process, whose calls return values). Put new geometry here, and new parameters in `ModelParams` with a default in `defaultParams`.
4
4
  - `src/main.ts` is the wiring: it starts the Three.js scene, initialises Bitbybit, calls `buildModel` and draws the result. The Manifold and JSCAD demonstrations live here as well. Keep geometry out of this file.
5
- - `scripts/smoke.ts` loads the OCCT kernel in Node, runs `buildModel` with `defaultParams` and prints one JSON line with the field names `template`, `params`, `valid`, `faces`, `edges`, `volume`, `area` and `bbox`, the box that just holds the exact geometry (`analysis.measure.tightBoundingBox`). It exits 1 when `shapeFix.isValid` finds the shape malformed or it has no volume; `debugInfo`'s own `valid` only says the shape is not empty. Add an assertion here when a change to the model has a fact worth pinning, such as a face count or a bounding box.
5
+ - `scripts/smoke.ts` loads the Bitbybit OCCT Kernel in Node, runs `buildModel` with `defaultParams` and prints one JSON line with the field names `template`, `params`, `valid`, `faces`, `edges`, `volume`, `area` and `bbox`, the box that just holds the exact geometry (`analysis.measure.tightBoundingBox`). It exits 1 when `shapeFix.isValid` finds the shape malformed or it has no volume; `debugInfo`'s own `valid` only says the shape is not empty. Add an assertion here when a change to the model has a fact worth pinning, such as a face count or a bounding box.
6
6
 
7
7
  Commands:
8
8
 
@@ -10,4 +10,4 @@ Commands:
10
10
  - `npm run build` typechecks and bundles for production; `npm run typecheck` and `npm run lint` run alone as well
11
11
  - `npm run smoke` typechecks, lints, then builds the model headlessly and prints the summary line; the kernel loads from `node_modules`, so nothing is downloaded: it is the same WebAssembly the browser runs inside a worker, loaded in-process, its content-hashed `.wasm` found beside the loader. The smoke script types the in-process kernel as the same `Occt` the browser code sees, through one `inProcess` cast, and awaits every call, so `buildModel` runs exactly as it does in the browser and `scripts/` is typechecked with the rest.
12
12
 
13
- The OCCT kernel runs in a web worker in the browser, so the objects `buildModel` handles there are pointers to shapes held by the worker, not the shapes themselves. That is why geometry is built entirely inside `buildModel` and only the result is drawn.
13
+ The Bitbybit OCCT Kernel runs in a web worker in the browser, so the objects `buildModel` handles there are pointers to shapes held by the worker, not the shapes themselves. That is why geometry is built entirely inside `buildModel` and only the result is drawn.
@@ -12,10 +12,10 @@
12
12
  "lint": "eslint . --max-warnings 0"
13
13
  },
14
14
  "dependencies": {
15
- "@bitbybit-dev/threejs": "1.5.0"
15
+ "@bitbybit-dev/threejs": "1.6.0"
16
16
  },
17
17
  "devDependencies": {
18
- "@bitbybit-dev/occt": "1.5.0",
18
+ "@bitbybit-dev/occt": "1.6.0",
19
19
  "@eslint/js": "10.0.1",
20
20
  "@types/node": "22.20.1",
21
21
  "@types/three": "0.186.0",
@@ -2,7 +2,7 @@ import { createRequire } from "node:module";
2
2
  import { readdirSync } from "node:fs";
3
3
  import { dirname, join } from "node:path";
4
4
  import initOpenCascade from "@bitbybit-dev/occt/bitbybit-dev-occt/index.js";
5
- import { OCCTService, OccHelper, VectorHelperService, ShapesHelperService } from "@bitbybit-dev/occt";
5
+ import { OCCTService } from "@bitbybit-dev/occt";
6
6
  import { buildModel, defaultParams, type Occt } from "../src/model.ts";
7
7
 
8
8
  function inProcess(service: object): Occt {
@@ -12,9 +12,9 @@ function inProcess(service: object): Occt {
12
12
  const require = createRequire(import.meta.url);
13
13
  const kernelDir = dirname(require.resolve("@bitbybit-dev/occt/bitbybit-dev-occt/index.js"));
14
14
  const wasmFile = readdirSync(kernelDir).find((file) => file.endsWith(".wasm"));
15
- if (!wasmFile) throw new Error(`no OCCT kernel (.wasm) found in ${kernelDir}`);
15
+ if (!wasmFile) throw new Error(`no Bitbybit OCCT Kernel (.wasm) found in ${kernelDir}`);
16
16
  const occ = await initOpenCascade({ locateFile: (file: string) => (file.endsWith(".wasm") ? join(kernelDir, wasmFile) : file) });
17
- const occt = inProcess(new OCCTService(occ, new OccHelper(new VectorHelperService(), new ShapesHelperService(), occ)));
17
+ const occt = inProcess(new OCCTService(occ));
18
18
 
19
19
  const shape = await buildModel(occt, defaultParams);
20
20
  const info = await occt.shapes.solid.debugInfo({ shape });