Skip to content

Commit

Permalink
Fix build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rianadon committed Dec 25, 2023
1 parent 7fd0a38 commit ede5573
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/lib/worker/modeling/assembly.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Handle_TDocStd_Document, OpenCascadeInstance, STEPControl_StepModelType, XCAFDoc_ShapeTool } from '$assets/replicad_single'
import { type AnyShape, Compound, getOC, type Plane, type PlaneName, type Point } from 'replicad'
import { blobSTL, combine } from '.'
import { blobSTL, combine } from './index'

/** Builds named assemblies for use in STEP models. */
export class Assembly {
Expand Down
11 changes: 2 additions & 9 deletions src/model_gen/keyholes.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import loadOC from '$assets/replicad_single'
import { exec } from 'child_process'
import { writeFile } from 'fs/promises'
import { dirname } from 'path'
import { setOC } from 'replicad'
import { fileURLToPath } from 'url'
import { promisify } from 'util'
import * as modeling from './modeling'

// patch require and __dirname so that opencascade can import
globalThis.__dirname = 'src/routes/beta/assets'
import { createRequire } from 'module'
globalThis.require = createRequire(import.meta.url)
import { setup } from './node-model'

// async function generateMXPCB() {
// const ops = await parse("src/assets/key_hole.csg.scad")
Expand Down Expand Up @@ -42,8 +36,7 @@ async function generateKey(name: string, options: any) {
}

async function main() {
const oc = await loadOC()
setOC(oc)
await setup()

console.log('Compiling ClojureScript...')
await promisify(exec)('lein cljsbuild once keyholes', {
Expand Down
1 change: 1 addition & 0 deletions src/model_gen/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export function resolve(specifier, context, defaultResolver) {
specifier = `${mappedSpecifier}.js`
} else if (
!specifier.endsWith('.ts') && !specifier.endsWith('.js')
&& !specifier.endsWith('.cjs')
&& (specifier.includes('three/') || specifier.includes('./'))
) {
specifier = specifier + '.js'
Expand Down

0 comments on commit ede5573

Please sign in to comment.