diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ede672b2..50a060bb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,11 +60,11 @@ jobs: uses: actions/cache@v2 with: path: | - packages/jupytercad-opencascade/lib/jupytercad.opencascade.js - packages/jupytercad-opencascade/lib/jupytercad.opencascade.wasm - packages/jupytercad-opencascade/lib/jupytercad.opencascade.d.ts - packages/jupytercad-opencascade/lib/jupytercad.opencascade.version - key: ${{ hashFiles('packages/jupytercad-opencascade/build.yml') }} + packages/opencascade/lib/jupytercad.opencascade.js + packages/opencascade/lib/jupytercad.opencascade.wasm + packages/opencascade/lib/jupytercad.opencascade.d.ts + packages/opencascade/lib/jupytercad.opencascade.version + key: ${{ hashFiles('packages/opencascade/build.yml') }} - name: Build the extension shell: bash -l {0} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 651617ec..acf33fd9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,10 +42,10 @@ jupyter lab build --minimize=False JupyterCAD uses a custom build of Open Cascade WASM. For performance and data usage concern, we only build the symbols we need. -This custom build is done in the `jupytercad-opencascade` directory: +This custom build is done in the `packages/opencascade` directory: ```bash -cd jupytercad-opencascade +cd packages/opencascade ``` In order to rebuild it yourself, you need to install Docker, then you need to run the following (this may take some time): @@ -60,20 +60,6 @@ In the case where you need to add new symbols, you can rebuild Open Cascade with yarn run build --add symbol_to_add another_symbol ... ``` -In order to build jupytercad with your local `jupytercad-opencascade` build, you can use `yarn link`: - -```bash -# Link jupytercad-opencascade (this can be done only once) -cd jupytercad-opencascade -yarn link - -cd .. -yarn link jupytercad-opencascade - -# Rebuild jupytercad with our local jupytercad-opencascade -yarn run build -``` - #### See also Custom build doc: https://ocjs.org/docs/app-dev-workflow/custom-builds diff --git a/packages/base/package.json b/packages/base/package.json index 093303e2..83d690d7 100644 --- a/packages/base/package.json +++ b/packages/base/package.json @@ -39,8 +39,8 @@ "@jupyter/collaboration": "^1.0.0", "@jupyter/docprovider": "^1.0.0", "@jupyter/ydoc": "^0.3.4 || ^1.0.2", - "@jupytercad/jupytercad-opencascade": "^0.3.3", "@jupytercad/occ-worker": "^0.3.3", + "@jupytercad/opencascade": "^0.3.3", "@jupytercad/schema": "^0.3.3", "@jupyterlab/application": "^4.0.0", "@jupyterlab/apputils": "^4.0.0", diff --git a/packages/occ-worker/package.json b/packages/occ-worker/package.json index 7beb82e2..e9c7c987 100644 --- a/packages/occ-worker/package.json +++ b/packages/occ-worker/package.json @@ -33,7 +33,7 @@ "watch": "webpack --config worker.webpack.config.js --watch --mode=development" }, "dependencies": { - "@jupytercad/jupytercad-opencascade": "^0.3.3", + "@jupytercad/opencascade": "^0.3.3", "@jupytercad/schema": "^0.3.3", "uuid": "^8.3.2" }, diff --git a/packages/occ-worker/src/actions.ts b/packages/occ-worker/src/actions.ts index bbdcca4c..3b587330 100644 --- a/packages/occ-worker/src/actions.ts +++ b/packages/occ-worker/src/actions.ts @@ -2,7 +2,7 @@ import { Handle_Poly_Triangulation, OpenCascadeInstance, TopoDS_Shape -} from '@jupytercad/jupytercad-opencascade'; +} from '@jupytercad/opencascade'; import { IJCadContent, IJCadObject } from '@jupytercad/schema'; import { IDict, WorkerAction } from './types'; diff --git a/packages/occ-worker/src/occapi.ts b/packages/occ-worker/src/occapi.ts index d57a4132..227be08d 100644 --- a/packages/occ-worker/src/occapi.ts +++ b/packages/occ-worker/src/occapi.ts @@ -1,4 +1,4 @@ -import { TopoDS_Shape } from '@jupytercad/jupytercad-opencascade'; +import { TopoDS_Shape } from '@jupytercad/opencascade'; import { v4 as uuid } from 'uuid'; import { diff --git a/packages/occ-worker/src/occparser.ts b/packages/occ-worker/src/occparser.ts index f2e26a88..8d05eb92 100644 --- a/packages/occ-worker/src/occparser.ts +++ b/packages/occ-worker/src/occparser.ts @@ -2,7 +2,7 @@ import { Handle_Poly_Triangulation, OpenCascadeInstance, TopoDS_Shape -} from '@jupytercad/jupytercad-opencascade'; +} from '@jupytercad/opencascade'; import { IJCadObject } from '@jupytercad/schema'; import { diff --git a/packages/occ-worker/src/operatorcache.ts b/packages/occ-worker/src/operatorcache.ts index 44d9b5d7..01811f41 100644 --- a/packages/occ-worker/src/operatorcache.ts +++ b/packages/occ-worker/src/operatorcache.ts @@ -1,4 +1,4 @@ -import { TopoDS_Shape } from '@jupytercad/jupytercad-opencascade'; +import { TopoDS_Shape } from '@jupytercad/opencascade'; import { IJCadContent, IShapeMetadata, Parts } from '@jupytercad/schema'; import { getOcc } from './actions'; diff --git a/packages/occ-worker/src/types.ts b/packages/occ-worker/src/types.ts index b1662149..c4309a51 100644 --- a/packages/occ-worker/src/types.ts +++ b/packages/occ-worker/src/types.ts @@ -1,4 +1,4 @@ -import { TopoDS_Shape } from '@jupytercad/jupytercad-opencascade'; +import { TopoDS_Shape } from '@jupytercad/opencascade'; import { IAny, IBox, diff --git a/packages/occ-worker/src/worker.ts b/packages/occ-worker/src/worker.ts index 9bb4dc98..59347566 100644 --- a/packages/occ-worker/src/worker.ts +++ b/packages/occ-worker/src/worker.ts @@ -1,6 +1,4 @@ -import initOpenCascade, { - OpenCascadeInstance -} from '@jupytercad/jupytercad-opencascade'; +import initOpenCascade, { OpenCascadeInstance } from '@jupytercad/opencascade'; import WorkerHandler from './actions'; import { diff --git a/packages/jupytercad-opencascade/build.yml b/packages/opencascade/build.yml similarity index 91% rename from packages/jupytercad-opencascade/build.yml rename to packages/opencascade/build.yml index 3227eea5..98c08327 100644 --- a/packages/jupytercad-opencascade/build.yml +++ b/packages/opencascade/build.yml @@ -89,16 +89,16 @@ mainBuild: - symbol: TopTools_IndexedMapOfShape - symbol: TopTools_ListOfShape emccFlags: - - "-flto" - - "-fexceptions" - - "-sDISABLE_EXCEPTION_CATCHING=1" - - "-O3" - - "-sEXPORT_ES6=1" - - "-sUSE_ES6_IMPORT_META=0" + - '-flto' + - '-fexceptions' + - '-sDISABLE_EXCEPTION_CATCHING=1' + - '-O3' + - '-sEXPORT_ES6=1' + - '-sUSE_ES6_IMPORT_META=0' - "-sEXPORTED_RUNTIME_METHODS=['FS']" - - "-sINITIAL_MEMORY=15MB" - - "-sMAXIMUM_MEMORY=4GB" - - "-sALLOW_MEMORY_GROWTH=1" - - "-sLLD_REPORT_UNDEFINED" - - "--no-entry" + - '-sINITIAL_MEMORY=15MB' + - '-sMAXIMUM_MEMORY=4GB' + - '-sALLOW_MEMORY_GROWTH=1' + - '-sLLD_REPORT_UNDEFINED' + - '--no-entry' - "-sENVIRONMENT='web'" diff --git a/packages/jupytercad-opencascade/build_opencascade.js b/packages/opencascade/build_opencascade.js similarity index 100% rename from packages/jupytercad-opencascade/build_opencascade.js rename to packages/opencascade/build_opencascade.js diff --git a/packages/jupytercad-opencascade/package.json b/packages/opencascade/package.json similarity index 95% rename from packages/jupytercad-opencascade/package.json rename to packages/opencascade/package.json index 6df542ab..7a4d1d61 100644 --- a/packages/jupytercad-opencascade/package.json +++ b/packages/opencascade/package.json @@ -1,5 +1,5 @@ { - "name": "@jupytercad/jupytercad-opencascade", + "name": "@jupytercad/opencascade", "version": "0.3.3", "description": "The custom OpenCascade build for JupyterCAD.", "keywords": [ diff --git a/python/jupytercad-core/extension.webpack.config.js b/python/jupytercad-core/extension.webpack.config.js index a81f1c58..03a1194d 100644 --- a/python/jupytercad-core/extension.webpack.config.js +++ b/python/jupytercad-core/extension.webpack.config.js @@ -6,7 +6,7 @@ const occPath = [ '../', '../', 'node_modules', - '@jupytercad/jupytercad-opencascade', + '@jupytercad/opencascade', 'lib', '*.wasm' ]; diff --git a/python/jupytercad-core/package.json b/python/jupytercad-core/package.json index 97c7a303..c4a74c3e 100644 --- a/python/jupytercad-core/package.json +++ b/python/jupytercad-core/package.json @@ -54,8 +54,8 @@ }, "dependencies": { "@jupytercad/base": "^0.3.3", - "@jupytercad/jupytercad-opencascade": "^0.3.3", "@jupytercad/occ-worker": "^0.3.3", + "@jupytercad/opencascade": "^0.3.3", "@jupyterlab/application": "^4.0.0", "@jupyterlab/coreutils": "^6.0.0", "@jupyterlab/services": "^7.0.0" diff --git a/python/jupytercad-lab/package.json b/python/jupytercad-lab/package.json index a8bb9aaa..5fe7980a 100644 --- a/python/jupytercad-lab/package.json +++ b/python/jupytercad-lab/package.json @@ -55,8 +55,8 @@ "@jupyter/collaboration": "^1.0.0", "@jupyter/docprovider": "^1.0.0", "@jupyter/ydoc": "^0.3.4 || ^1.0.2", - "@jupytercad/jupytercad-opencascade": "^0.3.3", "@jupytercad/occ-worker": "^0.3.3", + "@jupytercad/opencascade": "^0.3.3", "@jupytercad/schema": "^0.3.3", "@jupyterlab/application": "^4.0.0", "@jupyterlab/apputils": "^4.0.0", @@ -135,9 +135,9 @@ "outputDir": "jupytercad_lab/labextension", "sharedPackages": { "@jupytercad/base": { - "singleton": true, - "bundled": false - } - } + "singleton": true, + "bundled": false + } + } } } diff --git a/yarn.lock b/yarn.lock index e00611be..d074009e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -897,8 +897,8 @@ __metadata: "@jupyter/collaboration": ^1.0.0 "@jupyter/docprovider": ^1.0.0 "@jupyter/ydoc": ^0.3.4 || ^1.0.2 - "@jupytercad/jupytercad-opencascade": ^0.3.3 "@jupytercad/occ-worker": ^0.3.3 + "@jupytercad/opencascade": ^0.3.3 "@jupytercad/schema": ^0.3.3 "@jupyterlab/application": ^4.0.0 "@jupyterlab/apputils": ^4.0.0 @@ -1006,8 +1006,8 @@ __metadata: resolution: "@jupytercad/jupytercad-core@workspace:python/jupytercad-core" dependencies: "@jupytercad/base": ^0.3.3 - "@jupytercad/jupytercad-opencascade": ^0.3.3 "@jupytercad/occ-worker": ^0.3.3 + "@jupytercad/opencascade": ^0.3.3 "@jupyterlab/application": ^4.0.0 "@jupyterlab/builder": ^4.0.0 "@jupyterlab/coreutils": ^6.0.0 @@ -1034,8 +1034,8 @@ __metadata: "@jupyter/collaboration": ^1.0.0 "@jupyter/docprovider": ^1.0.0 "@jupyter/ydoc": ^0.3.4 || ^1.0.2 - "@jupytercad/jupytercad-opencascade": ^0.3.3 "@jupytercad/occ-worker": ^0.3.3 + "@jupytercad/opencascade": ^0.3.3 "@jupytercad/schema": ^0.3.3 "@jupyterlab/application": ^4.0.0 "@jupyterlab/apputils": ^4.0.0 @@ -1091,15 +1091,6 @@ __metadata: languageName: unknown linkType: soft -"@jupytercad/jupytercad-opencascade@^0.3.3, @jupytercad/jupytercad-opencascade@workspace:packages/jupytercad-opencascade": - version: 0.0.0-use.local - resolution: "@jupytercad/jupytercad-opencascade@workspace:packages/jupytercad-opencascade" - dependencies: - js-yaml: ^4.1.0 - rimraf: ^3.0.2 - languageName: unknown - linkType: soft - "@jupytercad/jupytercad-root@workspace:.": version: 0.0.0-use.local resolution: "@jupytercad/jupytercad-root@workspace:." @@ -1123,7 +1114,7 @@ __metadata: version: 0.0.0-use.local resolution: "@jupytercad/occ-worker@workspace:packages/occ-worker" dependencies: - "@jupytercad/jupytercad-opencascade": ^0.3.3 + "@jupytercad/opencascade": ^0.3.3 "@jupytercad/schema": ^0.3.3 "@types/node": ^18.15.11 copy-webpack-plugin: ^10.0.0 @@ -1138,6 +1129,15 @@ __metadata: languageName: unknown linkType: soft +"@jupytercad/opencascade@^0.3.3, @jupytercad/opencascade@workspace:packages/opencascade": + version: 0.0.0-use.local + resolution: "@jupytercad/opencascade@workspace:packages/opencascade" + dependencies: + js-yaml: ^4.1.0 + rimraf: ^3.0.2 + languageName: unknown + linkType: soft + "@jupytercad/schema@^0.3.3, @jupytercad/schema@workspace:packages/schema": version: 0.0.0-use.local resolution: "@jupytercad/schema@workspace:packages/schema"