@tamagui/build 1.0.1-beta.140 → 1.0.1-beta.141

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 +25 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/build",
3
- "version": "1.0.1-beta.140",
3
+ "version": "1.0.1-beta.141",
4
4
  "bin": {
5
5
  "tamagui-build": "tamagui-build.js"
6
6
  },
package/tamagui-build.js CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ /* eslint-disable no-console */
2
3
 
3
4
  const exec = require('execa')
4
5
  const fs = require('fs-extra')
@@ -7,7 +8,6 @@ const fg = require('fast-glob')
7
8
  const createExternalPlugin = require('./externalNodePlugin')
8
9
  const debounce = require('lodash.debounce')
9
10
  const { dirname, join } = require('path')
10
- const { tmpdir } = require('os')
11
11
 
12
12
  const jsOnly = !!process.env.JS_ONLY
13
13
  const skipJS = !!(process.env.SKIP_JS || false)
@@ -33,14 +33,18 @@ async function clean() {
33
33
  fs.remove('types'),
34
34
  fs.remove('dist'),
35
35
  ])
36
- } catch {}
36
+ } catch {
37
+ // ok
38
+ }
37
39
  if (shouldCleanBuildOnly) {
38
40
  console.log('🔹 cleaned', pkg.name)
39
41
  process.exit(0)
40
42
  }
41
43
  try {
42
44
  await Promise.allSettled([fs.remove('node_modules')])
43
- } catch {}
45
+ } catch {
46
+ // ok
47
+ }
44
48
  console.log('🔹 cleaned', pkg.name)
45
49
  process.exit(0)
46
50
  }
@@ -88,6 +92,19 @@ async function build() {
88
92
  }
89
93
  }
90
94
 
95
+ // const targetDir = `.types${Math.floor(Math.random() * 1_000_000)}`
96
+ // const cleanup = () => {
97
+ // try {
98
+ // fs.removeSync(targetDir)
99
+ // } catch {
100
+ // // ok
101
+ // }
102
+ // }
103
+
104
+ // process.once('beforeExit', cleanup)
105
+ // process.once('SIGINT', cleanup)
106
+ // process.once('SIGTERM', cleanup)
107
+
91
108
  async function buildTsc() {
92
109
  if (jsOnly || shouldSkipTypes) return
93
110
  if (shouldSkipInitialTypes) {
@@ -99,17 +116,16 @@ async function buildTsc() {
99
116
  if (!(await fs.pathExists(`tsconfig.json`))) {
100
117
  throw new Error(`No tsconfig.json found`)
101
118
  }
102
- const targetDir = `types${Math.floor(Math.random() * 1_000_000)}`
119
+ const targetDir = 'types'
103
120
  try {
104
- // typescripts build cache messes up when doing declarationOnly so need to bust it
121
+ // typescripts build cache messes up when doing declarationOnly
122
+ await fs.remove('tsconfig.tsbuildinfo')
105
123
  await fs.ensureDir(targetDir)
106
124
  const cmd = `tsc --baseUrl . --outDir ${targetDir} --rootDir src --emitDeclarationOnly --declarationMap`
107
125
  // console.log('\x1b[2m$', `npx ${cmd}`)
108
126
  await exec('npx', cmd.split(' '))
109
- await fs.remove('types')
110
- await fs.copy(targetDir, 'types')
111
127
  } finally {
112
- await fs.remove(targetDir)
128
+ await fs.remove('tsconfig.tsbuildinfo')
113
129
  }
114
130
  }
115
131
 
@@ -175,7 +191,7 @@ async function buildJs() {
175
191
  outdir: flatOut ? 'dist' : 'dist/jsx',
176
192
  entryPoints: files,
177
193
  sourcemap: true,
178
- target: 'es2019',
194
+ target: 'es2020',
179
195
  keepNames: false,
180
196
  format: 'esm',
181
197
  color: true,