Skip to content

Commit

Permalink
Make build:wasm windows compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
iterion committed Aug 21, 2024
1 parent 5b90f52 commit bb43e48
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"fetch:wasm": "./get-latest-wasm-bundle.sh",
"isomorphic-copy-wasm": "(copy src/wasm-lib/pkg/wasm_lib_bg.wasm public || cp src/wasm-lib/pkg/wasm_lib_bg.wasm public)",
"build:wasm-dev": "(cd src/wasm-lib && wasm-pack build --dev --target web --out-dir pkg && cargo test -p kcl-lib export_bindings) && yarn isomorphic-copy-wasm && yarn fmt",
"build:wasm": "(cd src/wasm-lib && wasm-pack build --release --target web --out-dir pkg && cargo test -p kcl-lib export_bindings) && yarn isomorphic-copy-wasm && yarn fmt",
"build:wasm": "cd src/wasm-lib && wasm-pack build --release --target web --out-dir pkg && cargo test -p kcl-lib export_bindings && cd ../.. && yarn isomorphic-copy-wasm && yarn fmt",
"build:wasm-clean": "yarn wasm-prep && yarn build:wasm",
"remove-importmeta": "sed -i 's/import.meta.url/window.location.origin/g' \"./src/wasm-lib/pkg/wasm_lib.js\"; sed -i '' 's/import.meta.url/window.location.origin/g' \"./src/wasm-lib/pkg/wasm_lib.js\" || echo \"sed for both mac and linux\"",
"wasm-prep": "rm -rf src/wasm-lib/pkg && mkdir src/wasm-lib/pkg && rm -rf src/wasm-lib/kcl/bindings",
Expand Down
4 changes: 0 additions & 4 deletions src/lib/desktop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,9 @@ import {
PROJECT_SETTINGS_FILE_NAME,
SETTINGS_FILE_NAME,
} from './constants'
<<<<<<< HEAD
import { DeepPartial } from './types'
import { ProjectConfiguration } from 'wasm-lib/kcl/bindings/ProjectConfiguration'
import { Configuration } from 'wasm-lib/kcl/bindings/Configuration'
export { parseProjectRoute } from 'lang/wasm'
=======
>>>>>>> 841317ac (Working bare-min project parse)

export async function renameProjectDirectory(
projectPath: string,
Expand Down
10 changes: 5 additions & 5 deletions src/lib/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,24 +74,24 @@ export async function getProjectMetaByRouteId(
}

const parseProjectRoute = (
configuration: Partial<SaveSettingsPayload>,
configuration: DeepPartial<Configuration>,
id: string
) => {
const onDesktop = isDesktop()
let projectName = ''
let projectPath = ''
let currentFileName = ''
if (
configuration.app?.projectDirectory &&
id.startsWith(configuration.app.projectDirectory)
configuration.settings?.app?.project_directory &&
id.startsWith(configuration.settings.app.project_directory)
) {
const relativeToRoot = window.electron.path.relative(
configuration.app.projectDirectory,
configuration.settings.app.project_directory,
id
)
projectName = relativeToRoot.split(window.electron.path.sep)[0]
projectPath = window.electron.path.join(
configuration.app.projectDirectory,
configuration.settings.app.project_directory,
projectName
)
} else {
Expand Down

0 comments on commit bb43e48

Please sign in to comment.