diff --git a/packages/jupytercad-extension/extension.webpack.config.js b/packages/jupytercad-extension/extension.webpack.config.js index 0a036540..eab97fc4 100644 --- a/packages/jupytercad-extension/extension.webpack.config.js +++ b/packages/jupytercad-extension/extension.webpack.config.js @@ -3,6 +3,10 @@ const path = require('path'); const occPath = [ __dirname, + '../', + '../', + 'node_modules', + '@jupytercad/jupytercad-opencascade', 'lib', '*.wasm' ]; diff --git a/packages/jupytercad-extension/src/worker/actions.ts b/packages/jupytercad-extension/src/worker/actions.ts index 85bf303b..7dedcf80 100644 --- a/packages/jupytercad-extension/src/worker/actions.ts +++ b/packages/jupytercad-extension/src/worker/actions.ts @@ -1,5 +1,5 @@ import { IJCadObject } from '../_interface/jcad'; -import { OCC } from '@jupytercad/jupytercad-opencascade'; +import * as OCC from '@jupytercad/jupytercad-opencascade'; import { IDict, WorkerAction } from '../types'; import { IJCadContent } from '../_interface/jcad'; diff --git a/packages/jupytercad-extension/src/worker/occapi.ts b/packages/jupytercad-extension/src/worker/occapi.ts index cc068f60..c7ddd2df 100644 --- a/packages/jupytercad-extension/src/worker/occapi.ts +++ b/packages/jupytercad-extension/src/worker/occapi.ts @@ -1,4 +1,4 @@ -import { OCC } from '@jupytercad/jupytercad-opencascade'; +import * as OCC from '@jupytercad/jupytercad-opencascade'; import { v4 as uuid } from 'uuid'; import { IBox } from '../_interface/box'; diff --git a/packages/jupytercad-extension/src/worker/occparser.ts b/packages/jupytercad-extension/src/worker/occparser.ts index ceb70c29..b169e953 100644 --- a/packages/jupytercad-extension/src/worker/occparser.ts +++ b/packages/jupytercad-extension/src/worker/occparser.ts @@ -1,5 +1,5 @@ import { IDict, IParsedShape } from '../types'; -import { OCC } from '@jupytercad/jupytercad-opencascade'; +import * as OCC from '@jupytercad/jupytercad-opencascade'; import { IJCadObject } from '../_interface/jcad'; import { IEdge, IFace } from '../types'; diff --git a/packages/jupytercad-extension/src/worker/operatorcache.ts b/packages/jupytercad-extension/src/worker/operatorcache.ts index 49888e12..2d9562e0 100644 --- a/packages/jupytercad-extension/src/worker/operatorcache.ts +++ b/packages/jupytercad-extension/src/worker/operatorcache.ts @@ -1,4 +1,4 @@ -import { OCC } from '@jupytercad/jupytercad-opencascade'; +import * as OCC from '@jupytercad/jupytercad-opencascade'; import { IJCadContent, Parts, IShapeMetadata } from '../_interface/jcad'; import { IDict } from '../types'; diff --git a/packages/jupytercad-extension/src/worker/types.ts b/packages/jupytercad-extension/src/worker/types.ts index d8443deb..4997805e 100644 --- a/packages/jupytercad-extension/src/worker/types.ts +++ b/packages/jupytercad-extension/src/worker/types.ts @@ -1,5 +1,5 @@ import { IJCadContent, IShapeMetadata } from '../_interface/jcad'; -import { OCC } from '@jupytercad/jupytercad-opencascade'; +import * as OCC from '@jupytercad/jupytercad-opencascade'; import { IBox } from '../_interface/box'; import { ICylinder } from '../_interface/cylinder'; import { ISphere } from '../_interface/sphere'; diff --git a/packages/jupytercad-extension/src/worker/worker.ts b/packages/jupytercad-extension/src/worker/worker.ts index e6893338..5fb3da33 100644 --- a/packages/jupytercad-extension/src/worker/worker.ts +++ b/packages/jupytercad-extension/src/worker/worker.ts @@ -1,4 +1,6 @@ -import { initializeOpenCascade, OCC } from '@jupytercad/jupytercad-opencascade'; +import initOpenCascade, { + OpenCascadeInstance +} from '@jupytercad/jupytercad-opencascade'; import { WorkerAction, IWorkerMessage, @@ -8,11 +10,11 @@ import { } from '../types'; import WorkerHandler from './actions'; -let occ: OCC.OpenCascadeInstance; +let occ: OpenCascadeInstance; const ports: IDict = {}; console.log('Initializing OCC...'); -initializeOpenCascade().then(occInstance => { +initOpenCascade().then(occInstance => { console.log('Done!'); occ = occInstance; diff --git a/packages/jupytercad-opencascade/build.yml b/packages/jupytercad-opencascade/build.yml index 87e19657..3227eea5 100644 --- a/packages/jupytercad-opencascade/build.yml +++ b/packages/jupytercad-opencascade/build.yml @@ -63,8 +63,6 @@ mainBuild: - symbol: NCollection_BaseList - symbol: NCollection_BaseMap - symbol: Poly_Array1OfTriangle - - symbol: Poly_ArrayOfNodes - - symbol: Poly_ArrayOfUVNodes - symbol: Poly_Connect - symbol: Poly_PolygonOnTriangulation - symbol: Poly_Triangle diff --git a/packages/jupytercad-opencascade/lib/index.d.ts b/packages/jupytercad-opencascade/lib/index.d.ts deleted file mode 100644 index 7da2310b..00000000 --- a/packages/jupytercad-opencascade/lib/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { OpenCascadeInstance } from './jupytercad-opencascade.js'; -export * as OCC from './jupytercad-opencascade.js'; -export declare function initializeOpenCascade(): Promise; diff --git a/packages/jupytercad-opencascade/lib/index.js b/packages/jupytercad-opencascade/lib/index.js deleted file mode 100644 index ac8a7c9a..00000000 --- a/packages/jupytercad-opencascade/lib/index.js +++ /dev/null @@ -1,9 +0,0 @@ -import initOpenCascade from 'opencascade.js'; -import opencascade from './jupytercad.opencascade.js'; -import opencascadeWasm from './jupytercad.opencascade.wasm'; -export async function initializeOpenCascade() { - return initOpenCascade({ - mainJS: opencascade, - mainWasm: opencascadeWasm, - }); -} diff --git a/packages/jupytercad-opencascade/package.json b/packages/jupytercad-opencascade/package.json index 2ee0c0bd..6df542ab 100644 --- a/packages/jupytercad-opencascade/package.json +++ b/packages/jupytercad-opencascade/package.json @@ -15,29 +15,27 @@ "name": "JupyterCad contributors" }, "files": [ - "lib/index.js", - "lib/index.d.ts", "lib/jupytercad.opencascade.js", "lib/jupytercad.opencascade.d.ts", "lib/jupytercad.opencascade.wasm" ], - "main": "lib/index.js", - "types": "lib/index.d.ts", + "main": "lib/jupytercad.opencascade.js", + "types": "lib/jupytercad.opencascade.d.ts", "repository": { "type": "git", "url": "https://github.com/jupyter-cad/jupytercad.git" }, "scripts": { - "build": "node build_opencascade_wasm.js", - "build:prod": "node build_opencascade_wasm.js" + "build": "node build_opencascade.js", + "build:prod": "node build_opencascade.js", + "clean": "rimraf ./lib", + "clean:all": "rimraf ./lib" }, "devDependencies": { - "js-yaml": "^4.1.0" + "js-yaml": "^4.1.0", + "rimraf": "^3.0.2" }, "publishConfig": { "access": "public" - }, - "dependencies": { - "opencascade.js": "beta" } } diff --git a/yarn.lock b/yarn.lock index 8c4b4cff..94eadb39 100644 --- a/yarn.lock +++ b/yarn.lock @@ -969,7 +969,7 @@ __metadata: resolution: "@jupytercad/jupytercad-opencascade@workspace:packages/jupytercad-opencascade" dependencies: js-yaml: ^4.1.0 - opencascade.js: beta + rimraf: ^3.0.2 languageName: unknown linkType: soft @@ -9591,15 +9591,6 @@ __metadata: languageName: node linkType: hard -"opencascade.js@npm:beta": - version: 2.0.0-beta.b5ff984 - resolution: "opencascade.js@npm:2.0.0-beta.b5ff984" - peerDependencies: - ws: ^8.5.0 - checksum: 751fa25e3625497fb562d4c586e884020478b9c5aeae61c43ce10bac9a011826f5c7518c2126fc6b1f79792c83bbc4d43069bff40dfbee4e48137cb9a496424e - languageName: node - linkType: hard - "optionator@npm:^0.9.1": version: 0.9.3 resolution: "optionator@npm:0.9.3"