Skip to content

Commit

Permalink
Simplifying occ build script
Browse files Browse the repository at this point in the history
  • Loading branch information
trungleduc committed Nov 21, 2023
1 parent ca3c54c commit 9d2b44d
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 22 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Python
uses: actions/setup-python@v4
with:
Expand All @@ -119,8 +116,7 @@ jobs:
# Remove NodeJS, twice to take care of system and locally installed node versions.
sudo rm -rf $(which node)
sudo rm -rf $(which node)
ls jupyercad-core
ls jupyercad-core/dist
find . | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"
cp jupyercad-core/dist/jupytercad*.whl jupyercad-lab/dist/jupytercad*.whl jupyercad-app/dist/jupytercad*.whl .
python -m pip install "jupyterlab>=4.0.0" jupytercad*.whl
Expand Down
5 changes: 0 additions & 5 deletions packages/opencascade/.gitignore

This file was deleted.

1 change: 1 addition & 0 deletions packages/opencascade/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ mainBuild:
- symbol: TopoDS_Face
- symbol: TopoDS_Iterator
- symbol: TopoDS_Shape
- symbol: TopoDS_Shell
- symbol: TopoDS_Wire
- symbol: TopTools_IndexedDataMapOfShapeListOfShape
- symbol: TopTools_IndexedMapOfShape
Expand Down
3 changes: 1 addition & 2 deletions packages/opencascade/build_opencascade_wasm.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const yaml = require('js-yaml');
const path = require('path');

const IMAGE_NAME = 'donalffons/opencascade.js:2.0.0-beta.b5ff984';
const OPEN_CASCADE_DIR = 'src';
const OPEN_CASCADE_DIR = 'lib';
const VERSION_FILE_NAME = 'jupytercad.opencascade.version';
const VERSION_FILE_PATH = path.join(OPEN_CASCADE_DIR, VERSION_FILE_NAME);
const BUILD_FILE_NAME = 'build.yml';
Expand Down Expand Up @@ -41,7 +41,6 @@ function checkNeedsRebuild() {
needsRebuild = false;
}
}

return needsRebuild;
}

Expand Down
9 changes: 6 additions & 3 deletions packages/opencascade/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@
"url": "https://github.com/jupytercad/jupytercad.git"
},
"scripts": {
"build": "node build_opencascade_wasm.js && tsc && copyfiles --up 1 src/*.d.ts src/*.js src/*.wasm lib",
"build:prod": "node build_opencascade_wasm.js && tsc && copyfiles --up 1 src/*.d.ts src/*.js src/*.wasm lib"
"build": "tsc && node build_opencascade_wasm.js",
"build:prod": "tsc && node build_opencascade_wasm.js",
"clean": "rimraf tsconfig.tsbuildinfo lib"
},
"devDependencies": {
"copyfiles": "^2.4.1",
"js-yaml": "^4.1.0"
"js-yaml": "^4.1.0",
"rimraf": "^3.0.2",
"typescript": "^5"
},
"publishConfig": {
"access": "public"
Expand Down
7 changes: 2 additions & 5 deletions packages/opencascade/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import initOpenCascade from 'opencascade.js';

import opencascade from './jupytercad.opencascade.js';
// eslint-disable-next-line no-undef
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import opencascade from './jupytercad.opencascade';
import opencascadeWasm from './jupytercad.opencascade.wasm';

export * as OCC from './jupytercad.opencascade.js';
export * as OCC from './jupytercad.opencascade';

export async function initializeOpenCascade() {
return initOpenCascade({
Expand Down
1 change: 1 addition & 0 deletions packages/opencascade/src/jupytercad.opencascade.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default null as any;
1 change: 1 addition & 0 deletions packages/opencascade/src/jupytercad.opencascade.wasm.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default null as any;
6 changes: 4 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,8 @@ __metadata:
copyfiles: ^2.4.1
js-yaml: ^4.1.0
opencascade.js: beta
rimraf: ^3.0.2
typescript: ^5
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -12072,11 +12074,11 @@ __metadata:

"typescript@patch:typescript@>=3 < 6#~builtin<compat/typescript>, typescript@patch:typescript@^5#~builtin<compat/typescript>":
version: 5.2.2
resolution: "typescript@patch:typescript@npm%3A5.2.2#~builtin<compat/typescript>::version=5.2.2&hash=f3b441"
resolution: "typescript@patch:typescript@npm%3A5.2.2#~builtin<compat/typescript>::version=5.2.2&hash=85af82"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 0f4da2f15e6f1245e49db15801dbee52f2bbfb267e1c39225afdab5afee1a72839cd86000e65ee9d7e4dfaff12239d28beaf5ee431357fcced15fb08583d72ca
checksum: 07106822b4305de3f22835cbba949a2b35451cad50888759b6818421290ff95d522b38ef7919e70fb381c5fe9c1c643d7dea22c8b31652a717ddbd57b7f4d554
languageName: node
linkType: hard

Expand Down

0 comments on commit 9d2b44d

Please sign in to comment.