Skip to content

Commit a371614

Browse files
committed
fix(@jcoreio/toolchain-typescript): work around @arethetypeswrong/cli bs again
1 parent 5e633dc commit a371614

1 file changed

Lines changed: 9 additions & 19 deletions

File tree

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,24 @@
11
const execa = require('@jcoreio/toolchain/util/execa.cjs')
2-
const { toolchainConfig } = require('@jcoreio/toolchain/util/findUps.cjs')
3-
const fs = require('fs/promises')
42
const path = require('path')
3+
const {
4+
projectDir,
5+
toolchainConfig,
6+
} = require('@jcoreio/toolchain/util/findUps.cjs')
57

68
module.exports = [
79
async function smokeTestBuild() {
8-
const attwDir = path.resolve(
9-
__dirname,
10-
'../node_modules/@arethetypeswrong/cli'
11-
)
12-
const { bin } = JSON.parse(
13-
await fs.readFile(path.resolve(attwDir, 'package.json'))
14-
)
15-
const attw = path.resolve(
16-
attwDir,
17-
typeof bin === 'string' ? bin : bin && bin.attw
18-
)
1910
await execa(
20-
process.execPath,
11+
'pnpm',
2112
[
22-
// used to just dlx the package but we need to pin transitive deps to work
23-
// around bugs
24-
attw,
13+
'exec',
14+
'attw',
2515
'--pack',
26-
'.',
16+
path.join(projectDir, 'dist'),
2717
...(toolchainConfig.outputCjs === false ?
2818
['--profile', 'esm-only']
2919
: []),
3020
],
31-
{ cwd: 'dist' }
21+
{ cwd: __dirname }
3222
)
3323
},
3424
]

0 commit comments

Comments
 (0)