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

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 +9 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/build",
3
- "version": "1.0.1-beta.135",
3
+ "version": "1.0.1-beta.136",
4
4
  "bin": {
5
5
  "tamagui-build": "tamagui-build.js"
6
6
  },
package/tamagui-build.js CHANGED
@@ -96,13 +96,15 @@ async function buildTsc() {
96
96
  }
97
97
 
98
98
  async function buildThenCopy() {
99
- const targetDir = join(tmpdir(), `tamagui-${Math.random() * 100000000}`.replace('.', ''))
100
- await exec(
101
- 'npx',
102
- `tsc --baseUrl . --outDir ${targetDir} --rootDir src --declaration --emitDeclarationOnly --declarationMap`.split(
103
- ' '
104
- )
105
- )
99
+ if (!(await fs.pathExists(`tsconfig.json`))) {
100
+ throw new Error(`No tsconfig.json found`)
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(' '))
106
108
  await fs.remove('types')
107
109
  await fs.copy(targetDir, 'types')
108
110
  }