@tamagui/build 1.0.13 → 1.0.15

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 +18 -25
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/build",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "bin": {
5
5
  "tamagui-build": "tamagui-build.js"
6
6
  },
package/tamagui-build.js CHANGED
@@ -118,33 +118,26 @@ async function buildTsc() {
118
118
  return
119
119
  }
120
120
 
121
- async function buildThenCopy() {
122
- if (!(await fs.pathExists(`tsconfig.json`))) {
123
- throw new Error(`No tsconfig.json found`)
124
- }
125
- const targetDir = 'types'
126
- try {
127
- // typescripts build cache messes up when doing declarationOnly
128
- await fs.remove('tsconfig.tsbuildinfo')
129
- await fs.ensureDir(targetDir)
130
- const cmd = `tsc --baseUrl . --outDir ${targetDir} --rootDir src --emitDeclarationOnly --declarationMap`
131
- // console.log('\x1b[2m$', `npx ${cmd}`)
132
- await exec('npx', cmd.split(' '))
133
- } finally {
134
- await fs.remove('tsconfig.tsbuildinfo')
135
- }
121
+ if (!(await fs.pathExists(`tsconfig.json`))) {
122
+ throw new Error(`No tsconfig.json found`)
136
123
  }
137
124
 
138
- // NOTE:
139
- // for Intellisense to work in monorepo you need baseUrl: "../.."
140
- // but to build things nicely we need here to reset a few things:
141
- // baseUrl: ., outDir: types, rootDir: src
142
- // for best of both worlds
143
-
144
- // there's a bug with typescript where outputting within the same dir just doesn't output for whatever reason
145
- // i have a hunch it's some cache thing, because if i give a new outDir it works
146
- // so fixing by always giving a random tmp outdir, and then copying
147
- await buildThenCopy()
125
+ const targetDir = 'types'
126
+ try {
127
+ // typescripts build cache messes up when doing declarationOnly
128
+ await fs.remove('tsconfig.tsbuildinfo')
129
+ await fs.ensureDir(targetDir)
130
+ const cmd = `tsc --baseUrl . --outDir ${targetDir} --rootDir src --emitDeclarationOnly --declarationMap`
131
+ // console.log('\x1b[2m$', `npx ${cmd}`)
132
+ await exec('npx', cmd.split(' '))
133
+ } catch (err) {
134
+ console.log(err.message)
135
+ if (!shouldWatch) {
136
+ process.exit(1)
137
+ }
138
+ } finally {
139
+ await fs.remove('tsconfig.tsbuildinfo')
140
+ }
148
141
  }
149
142
 
150
143
  async function buildJs() {