Skip to content
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

fix(bindgen): local package.json path in pipelines-base-url.ts #1003

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/bindgen/typescript/resources/pipeline-worker-url.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Generated file. To retain edits, remove this comment.

import { getPipelineWorkerUrl as itkWasmGetPipelineWorkerUrl } from 'itk-wasm'

let pipelineWorkerUrl: string | URL | null | undefined
Expand Down
4 changes: 3 additions & 1 deletion src/bindgen/typescript/resources/pipelines-base-url.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Generated file. To retain edits, remove this comment.

import { getPipelinesBaseUrl as itkWasmGetPipelinesBaseUrl } from 'itk-wasm'
import packageJson from '../package.json'
import packageJson from './package.json'

let pipelinesBaseUrl: string | URL | undefined
let defaultPipelinesBaseUrl: string | URL = `https://cdn.jsdelivr.net/npm/<bindgenPackageName>@${packageJson.version}/dist/pipelines`
Expand Down
4 changes: 2 additions & 2 deletions src/bindgen/typescript/write-support-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ function writeSupportFiles(outputDir, forNode, bindgenResource, packageName, pac
fs.copyFileSync(bindgenResource('pipelines-base-url.ts'), pipelinesBaseUrlPath)
let pipelinesBaseUrlPathContent = fs.readFileSync(bindgenResource('pipelines-base-url.ts'), { encoding: 'utf8', flag: 'r' })
pipelinesBaseUrlPathContent = pipelinesBaseUrlPathContent.replaceAll('<bindgenPackageName>', packageName)
fs.writeFileSync(pipelinesBaseUrlPath, pipelinesBaseUrlPathContent)
writeIfOverrideNotPresent(pipelinesBaseUrlPath, pipelinesBaseUrlPathContent)
}
const pipelineWorkerUrlPath = path.join(outputDir, 'src', 'pipeline-worker-url.ts')
if (!fs.existsSync(pipelineWorkerUrlPath)) {
let pipelineWorkerUrlPathContent = fs.readFileSync(bindgenResource('pipeline-worker-url.ts'), { encoding: 'utf8', flag: 'r' })
pipelineWorkerUrlPathContent = pipelineWorkerUrlPathContent.replaceAll('<bindgenPackageName>', packageName)
fs.writeFileSync(pipelineWorkerUrlPath, pipelineWorkerUrlPathContent)
writeIfOverrideNotPresent(pipelineWorkerUrlPath, pipelineWorkerUrlPathContent)
}

const indexWorkerEmbeddedPath = path.join(outputDir, 'src', 'index-worker-embedded.ts')
Expand Down
Loading