Skip to content

Commit d3ff159

Browse files
added head package json, implemented scripts for running all unit tests that exist
1 parent 0beda60 commit d3ff159

8 files changed

Lines changed: 118 additions & 5 deletions

File tree

package.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "bitbybit",
3+
"version": "0.19.0",
4+
"description": "Monorepo for browser CAD which holds bitbybit.dev npm packages",
5+
"main": "index.js",
6+
"scripts": {
7+
"test-base": "cd packages/dev/base && npm run test-c",
8+
"test-occt": "cd packages/dev/occt && npm run test-c",
9+
"test-core": "cd packages/dev/core && npm run test-c",
10+
"test-jscad": "cd packages/dev/jscad && npm run test-c",
11+
"test-manifold": "cd packages/dev/manifold && npm run test-c",
12+
"test": "npm run test-occt && npm run test-base && npm run test-core && npm run test-jscad && npm run test-manifold"
13+
},
14+
"repository": {
15+
"type": "git",
16+
"url": "git+https://github.com/bitbybit-dev/bitbybit.git"
17+
},
18+
"keywords": [
19+
"CAD",
20+
"3D",
21+
"Geometry",
22+
"OCCT",
23+
"JSCAD",
24+
"Manifold",
25+
"ThreeJS",
26+
"BabylonJS",
27+
"Automotive",
28+
"AEC"
29+
],
30+
"author": "Bit By Bit Developers",
31+
"license": "MIT",
32+
"bugs": {
33+
"url": "https://github.com/bitbybit-dev/bitbybit/issues"
34+
},
35+
"homepage": "https://bitbybit.dev",
36+
"devDependencies": {
37+
"typescript": "^4.3.5"
38+
}
39+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { Jscad } from "./jscad-service";
2+
3+
describe("Jscad unit tests", () => {
4+
let jscad: Jscad;
5+
beforeAll(async () => {
6+
const s = await import("../../jscad-generated");
7+
jscad = new Jscad(s.default());
8+
});
9+
10+
it("should create jscad instance", () => {
11+
expect(jscad).toBeDefined();
12+
});
13+
14+
it("should create booleans service", () => {
15+
expect(jscad.booleans).toBeDefined();
16+
});
17+
});

packages/dev/manifold-worker/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<img src="https://app.bitbybit.dev/assets/git-cover.png" alt="Picture showing bitbybit.dev platform">
44

5-
This project exposes 3D algorithms based on manifold-3d 3D CAD kernel via webworker. Manifold project is developed by Emmett Lalish, you can find it on https://github.com/elalish/manifold. Bit By Bit Developers platform integrates this kernel into it's platform via this library. Currently we try to expose Manifold library 1:1 in terms of functionality through our structured API, but as time goes we will have more unique algorithms in this package, which will be tuned specifically to our users.
5+
This project exposes 3D algorithms based on manifold-3d 3D CAD kernel via webworker. Manifold project is developed by Emmett Lalish and Chun Kit LAM, you can find it on https://github.com/elalish/manifold. Bit By Bit Developers platform integrates this kernel into it's platform via this library. Currently we try to expose Manifold library 1:1 in terms of functionality through our structured API, but as time goes we will have more unique algorithms in this package, which will be tuned specifically to our users.
66

77
This package should be used in browser based applications. If you want to use our manifold library in Node apps, consider checking @bitbybit-dev/manifold npm package, which this library wraps through webworker.
88

packages/dev/manifold/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<img src="https://app.bitbybit.dev/assets/git-cover.png" alt="Picture showing bitbybit.dev platform">
44

5-
This project exposes 3D algorithms based on manifold-3d 3D CAD kernel, developed by Emmett Lalish, which you can find on https://github.com/elalish/manifold. Bit By Bit Developers platform integrates this kernel into it's platform via this library. Currently we try to expose Manifold library 1:1 in terms of functionality through our structured API, but as time goes we will have more unique algorithms in this package, which will be tuned specifically to our users.
5+
This project exposes 3D algorithms based on manifold-3d 3D CAD kernel, developed by Emmett Lalish and Chun Kit LAM, which you can find on https://github.com/elalish/manifold. Bit By Bit Developers platform integrates this kernel into it's platform via this library. Currently we try to expose Manifold library 1:1 in terms of functionality through our structured API, but as time goes we will have more unique algorithms in this package, which will be tuned specifically to our users.
66

77
This package should work in Node and browser based applications. If you want to use this package in your browser based applications we highly suggest to use @bitbybit-dev/manifold-webworker npm package, which wraps this lib into promisified non-blocking API.
88

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
module.exports = {
22
presets: [
33
[
4-
'@babel/preset-env',
4+
"@babel/preset-env",
55
{
66
targets: {
7-
node: 'current',
7+
node: "current",
88
},
99
},
1010
],
11-
'@babel/preset-typescript'
11+
"@babel/preset-typescript"
12+
],
13+
plugins: [
14+
"babel-plugin-transform-import-meta"
1215
],
1316
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// import Module from "manifold-3d";
2+
import { ManifoldService } from "./manifold-service";
3+
4+
// TODO - if possible, configure to run manifold against actual Module (could be useful to find degradations in expectations), otherwise let's just use mocks
5+
describe("Manifold unit tests", () => {
6+
let manifold: ManifoldService;
7+
beforeAll(async () => {
8+
// const wasm = await Module();
9+
// wasm.setup();
10+
manifold = new ManifoldService({} as any);
11+
});
12+
13+
it("should create manifold instance", () => {
14+
expect(manifold).toBeDefined();
15+
});
16+
17+
});

packages/dev/manifold/package-lock.json

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/dev/manifold/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
"@babel/core": "7.16.0",
7575
"@babel/preset-env": "7.16.0",
7676
"@babel/preset-typescript": "7.16.0",
77+
"babel-plugin-transform-import-meta": "2.2.1",
7778
"jest-html-reporters": "3.0.11"
7879
},
7980
"jest": {

0 commit comments

Comments
 (0)