Skip to content

Commit c51cce2

Browse files
committed
fix(pnpm-script): always build typescript for build:gen:typescript
We need to update the package version.ts, version.js.
1 parent 935cb9d commit c51cce2

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

packages/core/typescript/itk-wasm/src/cli/pnpm-script.js

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,16 @@ async function pnpmScript(name, extraArgs, options) {
6060
)
6161
const micromambaRootPath = path.resolve('micromamba')
6262
const environmentFile = path.resolve('environment.yml')
63-
const environmentFileContents = fs.existsSync(environmentFile) ? fs.readFileSync(environmentFile, 'utf8') : null
64-
const environmentName = fs.existsSync(environmentFile) ? environmentFileContents
65-
.split('\n')
66-
.filter((l) => l.includes('name:'))[0]
67-
.split(':')[1]
68-
.trim() : null
63+
const environmentFileContents = fs.existsSync(environmentFile)
64+
? fs.readFileSync(environmentFile, 'utf8')
65+
: null
66+
const environmentName = fs.existsSync(environmentFile)
67+
? environmentFileContents
68+
.split('\n')
69+
.filter((l) => l.includes('name:'))[0]
70+
.split(':')[1]
71+
.trim()
72+
: null
6973

7074
const pnpmRootCommand = ['root']
7175
const pnpmRootProcess = spawnSync('pnpm', pnpmRootCommand, {
@@ -301,20 +305,18 @@ async function pnpmScript(name, extraArgs, options) {
301305
'pnpm',
302306
'bindgen:typescript'
303307
])
304-
if (!fs.existsSync(path.join(typescriptOutputDir, 'package.json'))) {
305-
pnpmCommand = pnpmCommand.concat([
306-
'&&',
307-
'pnpm',
308-
'--filter',
309-
`{${typescriptOutputDir}}`,
310-
'install',
311-
'&&',
312-
'pnpm',
313-
'--filter',
314-
`{${typescriptOutputDir}}`,
315-
'build'
316-
])
317-
}
308+
pnpmCommand = pnpmCommand.concat([
309+
'&&',
310+
'pnpm',
311+
'--filter',
312+
`{${typescriptOutputDir}}`,
313+
'install',
314+
'&&',
315+
'pnpm',
316+
'--filter',
317+
`{${typescriptOutputDir}}`,
318+
'build'
319+
])
318320
}
319321
break
320322
case 'build:gen:python':

0 commit comments

Comments
 (0)