Skip to content

Commit

Permalink
Switch lerna -> turborepo, get some jest tests working
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Jan 3, 2024
1 parent c713f93 commit 69bd73b
Show file tree
Hide file tree
Showing 55 changed files with 343 additions and 12,338 deletions.
6 changes: 0 additions & 6 deletions lerna.json

This file was deleted.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
"packages/*"
],
"scripts": {
"dist": "lerna run dist",
"dev": "turbo run dev",
"dist": "turbo run dist",
"watch": "lerna run watch --parallel --stream",
"watch:debug": "lerna run watch:debug --parallel --stream",
"clean:dist": "rm -rf packages/*/dist/**",
"clean:deps": "rm -rf packages/*/node_modules/**",
"test": "lerna run test",
"test": "turbo run test --concurrency 100",
"docs": "typedoc",
"publish": "npm publish --access public"
},
Expand All @@ -36,7 +37,6 @@
"eslint-config-prettier": "8.5.0",
"http-server": "^14.1.1",
"jest-environment-jsdom": "^29.5.0",
"lerna": "6.1.0",
"microbundle": "^0.15.1",
"mikktspace": "1.1.1",
"mkdirp": "^3.0.1",
Expand Down
52 changes: 52 additions & 0 deletions packages/data/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
const path = require('path');

module.exports = {
transform: {
"^.+\\.(t|j)sx?$": ["@swc/jest"],
},
moduleNameMapper: {
"@xeokit/basictypes/(.*)$": path.join(__dirname, "../basictypes/src/$1"),
"@xeokit/bcf/(.*)$": path.join(__dirname, "../bcf/src/$1"),
"@xeokit/boundaries/(.*)$": path.join(__dirname, "../boundaries/src/$1"),
"@xeokit/bundle/(.*)$": path.join(__dirname, "../bundle/src/$1"),
"@xeokit/cameracontrol/(.*)$": path.join(__dirname, "../cameracontrol/src/$1"),
"@xeokit/cityjson/(.*)$": path.join(__dirname, "../cityjson/src/$1"),
"@xeokit/cityjson2xkt/(.*)$": path.join(__dirname, "../cityjson2xkt/src/$1"),
"@xeokit/cityjsontypes_1_1_3/(.*)$": path.join(__dirname, "../cityjsontypes_1_1_3/src/$1"),
"@xeokit/compression(.*)$": path.join(__dirname, "../compression/src/$1"),
"@xeokit/constants(.*)$": path.join(__dirname, "../constants/src/$1"),
"@xeokit/core(.*)$": path.join(__dirname, "../core/src/$1"),
"@xeokit/curves(.*)$": path.join(__dirname, "../curves/src/$1"),
"@xeokit/data/(.*)$": path.join(__dirname, "../data/src/$1"),
"@xeokit/dotbim/(.*)$": path.join(__dirname, "../data/src/$1"),
"@xeokit/gltf/(.*)$": path.join(__dirname, "../gltf/src/$1"),
"@xeokit/gltf2xkt/(.*)$": path.join(__dirname, "../gltf2xkt/src/$1"),
"@xeokit/ifc2xkt/(.*)$": path.join(__dirname, "../ifc2xkt/src/$1"),
"@xeokit/kdtree2/(.*)$": path.join(__dirname, "../kdtree2/src/$1"),
"@xeokit/kdtree3/(.*)$": path.join(__dirname, "../kdtree3/src/$1"),
"@xeokit/ktx2/(.*)$": path.join(__dirname, "../ktx2/src/$1"),
"@xeokit/las/(.*)$": path.join(__dirname, "../las/src/$1"),
"@xeokit/las2xkt/(.*)$": path.join(__dirname, "../las2xkt/src/$1"),
"@xeokit/locale/(.*)$": path.join(__dirname, "../locale/src/$1"),
"@xeokit/math(.*)$": path.join(__dirname, "../math/src/$1"),
"@xeokit/matrix(.*)$": path.join(__dirname, "../matrix/src/$1"),
"@xeokit/mockrenderer(.*)$": path.join(__dirname, "../mockrenderer/src/$1"),
"@xeokit/pick(.*)$": path.join(__dirname, "../pick/src/$1"),
"@xeokit/procgen(.*)$": path.join(__dirname, "../procgen/src/$1"),
"@xeokit/rtc(.*)$": path.join(__dirname, "../rtc/src/$1"),
"@xeokit/scene(.*)$": path.join(__dirname, "../scene/src/$1"),
"@xeokit/threedxml(.*)$": path.join(__dirname, "../threedxml/src/$1"),
"@xeokit/treeview(.*)$": path.join(__dirname, "../treeview/src/$1"),
"@xeokit/utils(.*)$": path.join(__dirname, "../utils/src/$1"),
"@xeokit/viewer(.*)$": path.join(__dirname, "../viewer/src/$1"),
"@xeokit/webglrenderer(.*)$": path.join(__dirname, "../webglrenderer/src/$1"),
"@xeokit/webglutils(.*)$": path.join(__dirname, "../webglutils/src/$1"),
"@xeokit/webgpu(.*)$": path.join(__dirname, "../webgpu/src/$1"),
"@xeokit/webgpurenderer(.*)$": path.join(__dirname, "../webgpurenderer/src/$1"),
"@xeokit/webifc(.*)$": path.join(__dirname, "../webifc/src/$1"),
"@xeokit/webifcviewer(.*)$": path.join(__dirname, "../webifcviewer/src/$1")
},
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
resolver: undefined,
silent: false
};
5 changes: 3 additions & 2 deletions packages/data/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "@xeokit/data",
"private": false,
"type": "module",
"version": "1.0.1-alpha.0",
"description": "An entity-relationship data graph composed of multiple federated data models.",
"main": "src/index.ts",
"scripts": {},
"scripts": {
"test": "jest"
},
"repository": {
"type": "git",
"url": "git+https://github.com/xeokit/sdk.git"
Expand Down
72 changes: 39 additions & 33 deletions packages/dotbim/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,46 @@ module.exports = {
"^.+\\.(t|j)sx?$": ["@swc/jest"],
},
moduleNameMapper: {

"@xeokit/basictypes/(.*)$": path.join(__dirname, "../basictypes/src/$1"),
"@xeokit/bcf/(.*)$": path.join(__dirname, "../bcf/src/$1"),
"@xeokit/boundaries/(.*)$": path.join(__dirname, "../boundaries/src/$1"),
"@xeokit/bundle/(.*)$": path.join(__dirname, "../bundle/src/$1"),
"@xeokit/cameracontrol/(.*)$": path.join(__dirname, "../cameracontrol/src/$1"),
"@xeokit/cityjson/(.*)$": path.join(__dirname, "../cityjson/src/$1"),
"@xeokit/cityjson2xkt/(.*)$": path.join(__dirname, "../cityjson2xkt/src/$1"),
"@xeokit/cityjsontypes_1_1_3/(.*)$": path.join(__dirname, "../cityjsontypes_1_1_3/src/$1"),
"@xeokit/compression(.*)$": path.join(__dirname, "../compression/src/$1"),
"@xeokit/constants(.*)$": path.join(__dirname, "../constants/src/$1"),
"@xeokit/core(.*)$": path.join(__dirname, "../core/src/$1"),
"@xeokit/curves(.*)$": path.join(__dirname, "../curves/src/$1"),
"@xeokit/data/(.*)$": path.join(__dirname, "../data/src/$1"),
"@xeokit/core(.*)$": path.join(__dirname, "../core/src/components$1"),
"@xeokit/utils(.*)$": path.join(__dirname, "../core/src/utils$1"),
"@xeokit/constants(.*)$": path.join(__dirname, "../core/src/constants$1"),
"@xeokit/math(.*)$": path.join(__dirname, "../math/src/math$1"),
"@xeokit/boundaries(.*)$": path.join(__dirname, "../math/src/boundaries$1"),
"@xeokit/curves(.*)$": path.join(__dirname, "../math/src/curves$1"),
"@xeokit/frustum(.*)$": path.join(__dirname, "../math/src/frustum$1"),
"@xeokit/compression(.*)$": path.join(__dirname, "../math/src/compression$1"),
"@xeokit/matrix(.*)$": path.join(__dirname, "../math/src/matrix$1"),
"@xeokit/ray(.*)$": path.join(__dirname, "../math/src/ray$1"),
"@xeokit/rtc(.*)$": path.join(__dirname, "../math/src/rtc$1"),

//
// "@xeokit/rtc": ["math/src/rtc"],
// "@xeokit/viewer": ["viewer/src"],
// "@xeokit/webglutils": ["webglutils/src"],
// "@xeokit/webglrenderer": ["webglrenderer/src"],

"@xeokit/basictypes/basicTypes": path.join(__dirname, "../datatypes/src/basicTypes"),
"@xeokit/ifctypes(.*)$": path.join(__dirname, "../datatypes/src/ifcTypes"),
//
// "@xeokit/xkt": ["xkt/src"],
// "@xeokit/las": ["las/src"],
// "@xeokit/gltf": ["gltf/src"],
// "@xeokit/locale": ["locale/src"],
// "@xeokit/compression": ["compression/src"],
// "@xeokit/procgen": ["procgen/src/geometry"],
// "@xeokit/ktx2": ["ktx2/src"],
// "@xeokit/bcf": ["bcf/src"],
// "@xeokit/controls": ["controls/src"],
// "@xeokit/scene": ["scene/src"],
// "@xeokit/treeview": ["treeview/src"]
"@xeokit/dotbim/(.*)$": path.join(__dirname, "../data/src/$1"),
"@xeokit/gltf/(.*)$": path.join(__dirname, "../gltf/src/$1"),
"@xeokit/gltf2xkt/(.*)$": path.join(__dirname, "../gltf2xkt/src/$1"),
"@xeokit/ifc2xkt/(.*)$": path.join(__dirname, "../ifc2xkt/src/$1"),
"@xeokit/kdtree2/(.*)$": path.join(__dirname, "../kdtree2/src/$1"),
"@xeokit/kdtree3/(.*)$": path.join(__dirname, "../kdtree3/src/$1"),
"@xeokit/ktx2/(.*)$": path.join(__dirname, "../ktx2/src/$1"),
"@xeokit/las/(.*)$": path.join(__dirname, "../las/src/$1"),
"@xeokit/las2xkt/(.*)$": path.join(__dirname, "../las2xkt/src/$1"),
"@xeokit/locale/(.*)$": path.join(__dirname, "../locale/src/$1"),
"@xeokit/math(.*)$": path.join(__dirname, "../math/src/$1"),
"@xeokit/matrix(.*)$": path.join(__dirname, "../matrix/src/$1"),
"@xeokit/mockrenderer(.*)$": path.join(__dirname, "../mockrenderer/src/$1"),
"@xeokit/pick(.*)$": path.join(__dirname, "../pick/src/$1"),
"@xeokit/procgen(.*)$": path.join(__dirname, "../procgen/src/$1"),
"@xeokit/rtc(.*)$": path.join(__dirname, "../rtc/src/$1"),
"@xeokit/scene(.*)$": path.join(__dirname, "../scene/src/$1"),
"@xeokit/threedxml(.*)$": path.join(__dirname, "../threedxml/src/$1"),
"@xeokit/treeview(.*)$": path.join(__dirname, "../treeview/src/$1"),
"@xeokit/utils(.*)$": path.join(__dirname, "../utils/src/$1"),
"@xeokit/viewer(.*)$": path.join(__dirname, "../viewer/src/$1"),
"@xeokit/webglrenderer(.*)$": path.join(__dirname, "../webglrenderer/src/$1"),
"@xeokit/webglutils(.*)$": path.join(__dirname, "../webglutils/src/$1"),
"@xeokit/webgpu(.*)$": path.join(__dirname, "../webgpu/src/$1"),
"@xeokit/webgpurenderer(.*)$": path.join(__dirname, "../webgpurenderer/src/$1"),
"@xeokit/webifc(.*)$": path.join(__dirname, "../webifc/src/$1"),
"@xeokit/webifcviewer(.*)$": path.join(__dirname, "../webifcviewer/src/$1")
},
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
resolver: undefined,
Expand Down
5 changes: 3 additions & 2 deletions packages/dotbim/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "@xeokit/dotbim",
"private": false,
"type": "module",
"version": "1.0.1-alpha.0",
"description": ".BIM loader for xeokit.",
"main": "src/index.ts",
"scripts": {},
"scripts": {
"test": "jest"
},
"repository": {
"type": "git",
"url": "git+https://github.com/xeokit/sdk.git"
Expand Down
2 changes: 1 addition & 1 deletion packages/dotbim/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
* ---
*
* The xeokit SDK allows us to import 3D models from [.BIM](/docs/pages/GLOSSARY.html#dotbim), a JSON-based
* The xeokit SDK allows us to import 3D models from [.BIM](https://xeokit.github.io/sdk/docs/pages/GLOSSARY.html#dotbim), a JSON-based
* file format specifically designed for lightweight, user-friendly, and human-readable storage and sharing of 3D BIM models.
*
* .BIM is an open-source and minimalist file format for BIM that's built to be easy to read and write. Essentially, .BIM
Expand Down
4 changes: 1 addition & 3 deletions packages/dotbim/tests/loadDotBIM.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ describe('loadDotBIM Test', () => {
const scene = new Scene();
let dataModel;
let sceneModel;
let geometry;

it('loadDotBIM Test', () => {

Expand All @@ -36,11 +35,10 @@ describe('loadDotBIM Test', () => {
const meshGeometryArrays = {}

loadDotBIM({
data: fileData,
fileData,
sceneModel,
dataModel
}, {
rotateX: true
}).then(() => {

sceneModel.build().then(() => {
Expand Down
72 changes: 39 additions & 33 deletions packages/gltf/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,46 @@ module.exports = {
"^.+\\.(t|j)sx?$": ["@swc/jest"],
},
moduleNameMapper: {

"@xeokit/basictypes/(.*)$": path.join(__dirname, "../basictypes/src/$1"),
"@xeokit/bcf/(.*)$": path.join(__dirname, "../bcf/src/$1"),
"@xeokit/boundaries/(.*)$": path.join(__dirname, "../boundaries/src/$1"),
"@xeokit/bundle/(.*)$": path.join(__dirname, "../bundle/src/$1"),
"@xeokit/cameracontrol/(.*)$": path.join(__dirname, "../cameracontrol/src/$1"),
"@xeokit/cityjson/(.*)$": path.join(__dirname, "../cityjson/src/$1"),
"@xeokit/cityjson2xkt/(.*)$": path.join(__dirname, "../cityjson2xkt/src/$1"),
"@xeokit/cityjsontypes_1_1_3/(.*)$": path.join(__dirname, "../cityjsontypes_1_1_3/src/$1"),
"@xeokit/compression(.*)$": path.join(__dirname, "../compression/src/$1"),
"@xeokit/constants(.*)$": path.join(__dirname, "../constants/src/$1"),
"@xeokit/core(.*)$": path.join(__dirname, "../core/src/$1"),
"@xeokit/curves(.*)$": path.join(__dirname, "../curves/src/$1"),
"@xeokit/data/(.*)$": path.join(__dirname, "../data/src/$1"),
"@xeokit/core(.*)$": path.join(__dirname, "../core/src/components$1"),
"@xeokit/utils(.*)$": path.join(__dirname, "../core/src/utils$1"),
"@xeokit/constants(.*)$": path.join(__dirname, "../core/src/constants$1"),
"@xeokit/math(.*)$": path.join(__dirname, "../math/src/math$1"),
"@xeokit/boundaries(.*)$": path.join(__dirname, "../math/src/boundaries$1"),
"@xeokit/curves(.*)$": path.join(__dirname, "../math/src/curves$1"),
"@xeokit/frustum(.*)$": path.join(__dirname, "../math/src/frustum$1"),
"@xeokit/compression(.*)$": path.join(__dirname, "../math/src/compression$1"),
"@xeokit/matrix(.*)$": path.join(__dirname, "../math/src/matrix$1"),
"@xeokit/ray(.*)$": path.join(__dirname, "../math/src/ray$1"),
"@xeokit/rtc(.*)$": path.join(__dirname, "../math/src/rtc$1"),

//
// "@xeokit/rtc": ["math/src/rtc"],
// "@xeokit/viewer": ["viewer/src"],
// "@xeokit/webglutils": ["webglutils/src"],
// "@xeokit/webglrenderer": ["webglrenderer/src"],

"@xeokit/basictypes/basicTypes": path.join(__dirname, "../datatypes/src/basicTypes"),
"@xeokit/ifctypes(.*)$": path.join(__dirname, "../datatypes/src/ifcTypes"),
//
// "@xeokit/xkt": ["xkt/src"],
// "@xeokit/las": ["las/src"],
// "@xeokit/gltf": ["gltf/src"],
// "@xeokit/locale": ["locale/src"],
// "@xeokit/compression": ["compression/src"],
// "@xeokit/procgen": ["procgen/src/geometry"],
// "@xeokit/ktx2": ["ktx2/src"],
// "@xeokit/bcf": ["bcf/src"],
// "@xeokit/controls": ["controls/src"],
// "@xeokit/scene": ["scene/src"],
// "@xeokit/treeview": ["treeview/src"]
"@xeokit/dotbim/(.*)$": path.join(__dirname, "../data/src/$1"),
"@xeokit/gltf/(.*)$": path.join(__dirname, "../gltf/src/$1"),
"@xeokit/gltf2xkt/(.*)$": path.join(__dirname, "../gltf2xkt/src/$1"),
"@xeokit/ifc2xkt/(.*)$": path.join(__dirname, "../ifc2xkt/src/$1"),
"@xeokit/kdtree2/(.*)$": path.join(__dirname, "../kdtree2/src/$1"),
"@xeokit/kdtree3/(.*)$": path.join(__dirname, "../kdtree3/src/$1"),
"@xeokit/ktx2/(.*)$": path.join(__dirname, "../ktx2/src/$1"),
"@xeokit/las/(.*)$": path.join(__dirname, "../las/src/$1"),
"@xeokit/las2xkt/(.*)$": path.join(__dirname, "../las2xkt/src/$1"),
"@xeokit/locale/(.*)$": path.join(__dirname, "../locale/src/$1"),
"@xeokit/math(.*)$": path.join(__dirname, "../math/src/$1"),
"@xeokit/matrix(.*)$": path.join(__dirname, "../matrix/src/$1"),
"@xeokit/mockrenderer(.*)$": path.join(__dirname, "../mockrenderer/src/$1"),
"@xeokit/pick(.*)$": path.join(__dirname, "../pick/src/$1"),
"@xeokit/procgen(.*)$": path.join(__dirname, "../procgen/src/$1"),
"@xeokit/rtc(.*)$": path.join(__dirname, "../rtc/src/$1"),
"@xeokit/scene(.*)$": path.join(__dirname, "../scene/src/$1"),
"@xeokit/threedxml(.*)$": path.join(__dirname, "../threedxml/src/$1"),
"@xeokit/treeview(.*)$": path.join(__dirname, "../treeview/src/$1"),
"@xeokit/utils(.*)$": path.join(__dirname, "../utils/src/$1"),
"@xeokit/viewer(.*)$": path.join(__dirname, "../viewer/src/$1"),
"@xeokit/webglrenderer(.*)$": path.join(__dirname, "../webglrenderer/src/$1"),
"@xeokit/webglutils(.*)$": path.join(__dirname, "../webglutils/src/$1"),
"@xeokit/webgpu(.*)$": path.join(__dirname, "../webgpu/src/$1"),
"@xeokit/webgpurenderer(.*)$": path.join(__dirname, "../webgpurenderer/src/$1"),
"@xeokit/webifc(.*)$": path.join(__dirname, "../webifc/src/$1"),
"@xeokit/webifcviewer(.*)$": path.join(__dirname, "../webifcviewer/src/$1")
},
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
resolver: undefined,
Expand Down
5 changes: 3 additions & 2 deletions packages/gltf/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "@xeokit/gltf",
"private": true,
"type": "module",
"version": "1.0.1-alpha.0",
"description": "glTF loader for xeokit",
"main": "src/index.ts",
"scripts": {},
"scripts": {
"test": "jest"
},
"repository": {
"type": "git",
"url": "git+https://github.com/xeokit/sdk.git"
Expand Down
5 changes: 2 additions & 3 deletions packages/gltf/tests/loadGLTF.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ describe('loadGLTF Test', () => {

fs.readFile("./tests/assets/HousePlan.glb", (err, buffer) => {


const arraybuffer = toArrayBuffer(buffer);
const fileData = toArrayBuffer(buffer);

expect(sceneModel.built).toBe(false);

// console.log(arraybuffer)

loadGLTF({
data: arraybuffer,
fileData,
sceneModel,
dataModel
}).then(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/gltf2xkt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"gltf2xkt": "dist/gltf2xkt.js"
},
"scripts": {
"test": "jest"
"XXtest": "jest"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/ifc2xkt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"module": "src/index.ts",
"source": "src/index.ts",
"scripts": {
"test": "jest"
"XXtest": "jest"
},
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit 69bd73b

Please sign in to comment.