@tamagui/build 1.0.1-beta.136 → 1.0.1-beta.139

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/tamagui-build.js +12 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/build",
3
- "version": "1.0.1-beta.136",
3
+ "version": "1.0.1-beta.139",
4
4
  "bin": {
5
5
  "tamagui-build": "tamagui-build.js"
6
6
  },
package/tamagui-build.js CHANGED
@@ -99,14 +99,18 @@ async function buildTsc() {
99
99
  if (!(await fs.pathExists(`tsconfig.json`))) {
100
100
  throw new Error(`No tsconfig.json found`)
101
101
  }
102
- // nest it one extra so permissions of .tsbuildinfo thats written to parent folder arent off
103
- const targetDir = join(tmpdir(), `tamagui-${Math.random() * 100000000}`.replace('.', ''), 'out')
104
- await fs.ensureDir(targetDir)
105
- const cmd = `tsc --baseUrl . --outDir ${targetDir} --rootDir src --declaration --emitDeclarationOnly --declarationMap`
106
- // console.log('\x1b[2m$', `npx ${cmd}`)
107
- await exec('npx', cmd.split(' '))
108
- await fs.remove('types')
109
- await fs.copy(targetDir, 'types')
102
+ const targetDir = `types${Math.floor(Math.random() * 1_000_000)}`
103
+ try {
104
+ // typescripts build cache messes up when doing declarationOnly so need to bust it
105
+ await fs.ensureDir(targetDir)
106
+ const cmd = `tsc --baseUrl . --outDir ${targetDir} --rootDir src --emitDeclarationOnly --declarationMap`
107
+ // console.log('\x1b[2m$', `npx ${cmd}`)
108
+ await exec('npx', cmd.split(' '))
109
+ await fs.remove('types')
110
+ await fs.copy(targetDir, 'types')
111
+ } finally {
112
+ await fs.remove(targetDir)
113
+ }
110
114
  }
111
115
 
112
116
  // NOTE: