-
-
Notifications
You must be signed in to change notification settings - Fork 17
refactor: rewrite of geometryutil as typescript #132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
aa18cbe
5e728e7
8be70d3
ccfd475
6d50a2e
8d33955
b5bb43f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| const { execSync } = require('child_process'); | ||
| const path = require('path'); | ||
|
|
||
| // Build the main TypeScript files | ||
| console.log('Building main TypeScript files...'); | ||
| execSync('npx tsc', { stdio: 'inherit' }); | ||
|
|
||
| // Build the UMD modules using Rollup | ||
| console.log('Building UMD modules with Rollup...'); | ||
| execSync('npx rollup -c rollup.config.mjs', { stdio: 'inherit' }); | ||
|
|
||
| console.log('Build complete!'); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
|
|
||
| /** @type {import("jest").Config} **/ | ||
| module.exports = { | ||
| testEnvironment: "node", | ||
| workerIdleMemoryLimit: 0.2, | ||
| transform: { | ||
| '^.+\\.[jt]sx?$': [ | ||
| 'ts-jest', | ||
| { | ||
| useESM: true, | ||
| tsconfig: 'tsconfig.jest.json', | ||
| }, | ||
| ], | ||
| }, | ||
| testMatch: [ | ||
| '**/tests/**/*.test.ts' | ||
| ], | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
|
|
||
| import { NfpCache } from '../build/nfpDb.js'; | ||
| import { HullPolygon } from '../build/util/HullPolygon.js'; | ||
| import * as GeometryUtil from '../build/util/geometryutil.js'; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are both built versions necessary, or should this import the UMD as well?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. both are needed the UMD is for the worker, and the non UMD is used in non worker context. |
||
|
|
||
| window.onload = function () { | ||
| const { ipcRenderer } = require('electron'); | ||
|
|
@@ -193,7 +194,7 @@ window.onload = function () { | |
| } | ||
|
|
||
| p.require('../../main/util/clipper.js'); | ||
| p.require('../../main/util/geometryutil.js'); | ||
| p.require('../../build/util/umd/geometryutil.umd.js'); | ||
|
|
||
| p.map(process).then(function (processed) { | ||
| function getPart(source) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar with UMD modules, what benefit do they give?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see https://github.com/deepnest-next/deepnest/pull/132/files#diff-73f5a0c098eeed918ec330da8ffc45e7f4ca600d9bb969d0a9dea4b5d2909c85R197