@tamagui/build 1.0.0-alpha.1 → 1.0.0-alpha.12

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.
package/.ultra.cache.json CHANGED
@@ -1 +1 @@
1
- {"files":{"node_modules":"1637314740088.0405","externalNodePlugin.js":"fa1cd57f4fb8bc9a8c7ea03adaabc309b322ae0b","package.json":"1f64427e6ff4d05435038f5640160c049cd1a882","tamagui-build.js":"05b9862d7b7019904cd3c34ec444b259cdc8d6aa"},"deps":{}}
1
+ {"files":{"node_modules":"1637314740088.0405","externalNodePlugin.js":"fa1cd57f4fb8bc9a8c7ea03adaabc309b322ae0b","package.json":"debcb00839a9a83a4779764d057c3584db919d43","tamagui-build.js":"7820f3c95f0fb219b6981e6a8d704f9df4fd9c31.1637967515169.9587"},"deps":{}}
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Nate Wienert
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/build",
3
- "version": "1.0.0-alpha.1",
3
+ "version": "1.0.0-alpha.12",
4
4
  "bin": {
5
5
  "tamagui-build": "tamagui-build.js"
6
6
  },
@@ -14,11 +14,11 @@
14
14
  "devDependencies": {
15
15
  "chokidar": "^3.5.2",
16
16
  "chokidar-cli": "^2.1.0",
17
- "dts-bundle-generator": "^5.9.0",
18
17
  "esbuild": "^0.13.14",
19
18
  "execa": "^5.0.0",
20
19
  "fast-glob": "^3.2.7",
21
20
  "fs-extra": "^9.1.0",
22
21
  "typescript": "^4.2.4"
23
- }
22
+ },
23
+ "gitHead": "d50261a4e08d2212395af4f2d8f49555fc780c3e"
24
24
  }
package/tamagui-build.js CHANGED
@@ -8,10 +8,8 @@ const createExternalPlugin = require('./externalNodePlugin')
8
8
  const path = require('path')
9
9
 
10
10
  const skipJS = process.env.SKIP_JS || false
11
- const skipTypes = process.argv.includes('skip-types') || process.env.SKIP_TYPES
12
- const jsx = process.argv.includes('--jsx')
13
- const watch = process.argv.includes('--watch')
14
- const legacy = process.argv.includes('legacy')
11
+ const shouldSkipTypes = process.argv.includes('skip-types') || process.env.SKIP_TYPES
12
+ const shouldWatch = process.argv.includes('--watch')
15
13
 
16
14
  const pkg = fs.readJSONSync('./package.json')
17
15
  const pkgSource = pkg.source || 'src/index.ts'
@@ -30,28 +28,25 @@ async function build() {
30
28
  }
31
29
 
32
30
  async function buildTsc() {
33
- if (process.env.JS_ONLY || skipTypes) return
34
- try {
35
- if (legacy) {
36
- await exec('npx', [
37
- 'tsc',
38
- '--declaration',
39
- '--emitDeclarationOnly',
40
- '--declarationMap',
41
- '--declarationDir',
42
- 'types',
43
- ])
44
- } else {
45
- await exec(
46
- 'npx',
47
- // was going super slow... --no-check for now..?
48
- ['dts-bundle-generator', watch ? '--no-check' : [], '-o', 'types.d.ts', pkgSource].flat()
49
- )
50
- }
51
- } catch (err) {
52
- console.log('Errors during tsc build, may be ok')
53
- console.log(err.message.replace(ignoreSkipLibCheckOutputRNNodeConflicting, ''))
54
- }
31
+ if (process.env.JS_ONLY || shouldSkipTypes) return
32
+ // NOTE:
33
+ // for Intellisense to work in monorepo you need baseUrl: "../.."
34
+ // but to build things nicely we need here to reset a few things:
35
+ // baseUrl: ., outDir: types, rootDir: src
36
+ // now we can have the best of both worlds
37
+ await fs.remove('types')
38
+ await exec('npx', [
39
+ 'tsc',
40
+ '--baseUrl',
41
+ '.',
42
+ '--outDir',
43
+ 'types',
44
+ '--rootDir',
45
+ 'src',
46
+ '--declaration',
47
+ '--emitDeclarationOnly',
48
+ '--declarationMap',
49
+ ])
55
50
  }
56
51
 
57
52
  const externalPlugin = createExternalPlugin({
@@ -67,11 +62,11 @@ async function build() {
67
62
  pkgMain
68
63
  ? esbuild
69
64
  .build({
70
- entryPoints: ['./src/index'],
71
- outfile: pkgMain,
65
+ entryPoints: files,
66
+ outdir: 'dist/cjs',
67
+ bundle: false,
72
68
  sourcemap: true,
73
69
  target: 'node16',
74
- bundle: true,
75
70
  keepNames: true,
76
71
  format: 'cjs',
77
72
  color: true,
@@ -89,7 +84,7 @@ async function build() {
89
84
  ? esbuild
90
85
  .build({
91
86
  entryPoints: files,
92
- outdir: 'dist',
87
+ outdir: 'dist/esm',
93
88
  sourcemap: true,
94
89
  target: 'es2020',
95
90
  keepNames: true,
@@ -103,26 +98,24 @@ async function build() {
103
98
  console.log(' >-> esm')
104
99
  })
105
100
  : null,
106
- jsx
107
- ? esbuild
108
- .build({
109
- // only diff is jsx preserve and outdir
110
- jsx: 'preserve',
111
- outdir: '_jsx',
112
- entryPoints: files,
113
- sourcemap: false,
114
- target: 'es2020',
115
- keepNames: true,
116
- format: 'esm',
117
- color: true,
118
- logLevel: 'error',
119
- minify: false,
120
- platform: 'neutral',
121
- })
122
- .then(() => {
123
- console.log(' >-> jsx')
124
- })
125
- : null,
101
+ esbuild
102
+ .build({
103
+ // only diff is jsx preserve and outdir
104
+ jsx: 'preserve',
105
+ outdir: 'dist/jsx',
106
+ entryPoints: files,
107
+ sourcemap: false,
108
+ target: 'es2020',
109
+ keepNames: true,
110
+ format: 'esm',
111
+ color: true,
112
+ logLevel: 'error',
113
+ minify: false,
114
+ platform: 'neutral',
115
+ })
116
+ .then(() => {
117
+ console.log(' >-> jsx')
118
+ }),
126
119
  ]),
127
120
  ])
128
121
  } catch (error) {
@@ -132,7 +125,7 @@ async function build() {
132
125
  }
133
126
  }
134
127
 
135
- if (watch) {
128
+ if (shouldWatch) {
136
129
  const path = require('path')
137
130
  process.env.IS_WATCHING = true
138
131
  process.env.DISABLE_AUTORUN = true
@@ -161,13 +154,13 @@ if (watch) {
161
154
 
162
155
  for (const dir of watchDirs) {
163
156
  if (dir === 'src') {
164
- build().then(() => watch())
157
+ build().then(() => doWatch())
165
158
  } else {
166
- watch()
159
+ doWatch()
167
160
  }
168
161
 
169
162
  const watchSize = {}
170
- function watch() {
163
+ function doWatch() {
171
164
  const finish = (event, path, stats) => {
172
165
  if (dir === 'src' || (stats && stats.size != watchSize[path])) {
173
166
  if (stats) watchSize[path] = stats.size
@@ -205,39 +198,3 @@ function debounce(callback, wait) {
205
198
  timer = setTimeout(() => callback(...args), wait)
206
199
  }
207
200
  }
208
-
209
- const ignoreSkipLibCheckOutputRNNodeConflicting = `../../node_modules/@types/node/globals.d.ts(47,11): error TS2300: Duplicate identifier 'AbortController'.
210
- ../../node_modules/@types/node/globals.d.ts(60,11): error TS2300: Duplicate identifier 'AbortSignal'.
211
- ../../node_modules/@types/node/globals.d.ts(67,13): error TS2300: Duplicate identifier 'AbortController'.
212
- ../../node_modules/@types/node/globals.d.ts(72,13): error TS2300: Duplicate identifier 'AbortSignal'.
213
- ../../node_modules/@types/react-native/globals.d.ts(50,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'Blob' must be of type '{ new (blobParts?: BlobPart[] | undefined, options?: BlobPropertyBag | undefined): Blob; prototype: Blob; }', but here has type '{ new (blobParts?: (string | Blob)[] | undefined, options?: BlobOptions | undefined): Blob; prototype: Blob; }'.
214
- ../../node_modules/@types/react-native/globals.d.ts(65,15): error TS2300: Duplicate identifier 'FormData'.
215
- ../../node_modules/@types/react-native/globals.d.ts(122,5): error TS2717: Subsequent property declarations must have the same type. Property 'body' must be of type 'BodyInit | null | undefined', but here has type 'BodyInit_ | undefined'.
216
- ../../node_modules/@types/react-native/globals.d.ts(131,5): error TS2717: Subsequent property declarations must have the same type. Property 'signal' must be of type 'AbortSignal | null | undefined', but here has type 'AbortSignal | undefined'.
217
- ../../node_modules/@types/react-native/globals.d.ts(149,14): error TS2300: Duplicate identifier 'RequestInfo'.
218
- ../../node_modules/@types/react-native/globals.d.ts(168,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'Response' must be of type '{ new (body?: BodyInit | null | undefined, init?: ResponseInit | undefined): Response; prototype: Response; error(): Response; redirect(url: string | URL, status?: number | undefined): Response; }', but here has type '{ new (body?: BodyInit_ | undefined, init?: ResponseInit | undefined): Response; prototype: Response; error: () => Response; redirect: (url: string, status?: number | undefined) => Response; }'.
219
- ../../node_modules/@types/react-native/globals.d.ts(245,5): error TS2717: Subsequent property declarations must have the same type. Property 'abort' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.
220
- ../../node_modules/@types/react-native/globals.d.ts(246,5): error TS2717: Subsequent property declarations must have the same type. Property 'error' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.
221
- ../../node_modules/@types/react-native/globals.d.ts(247,5): error TS2717: Subsequent property declarations must have the same type. Property 'load' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.
222
- ../../node_modules/@types/react-native/globals.d.ts(248,5): error TS2717: Subsequent property declarations must have the same type. Property 'loadend' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.
223
- ../../node_modules/@types/react-native/globals.d.ts(249,5): error TS2717: Subsequent property declarations must have the same type. Property 'loadstart' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.
224
- ../../node_modules/@types/react-native/globals.d.ts(250,5): error TS2717: Subsequent property declarations must have the same type. Property 'progress' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.
225
- ../../node_modules/@types/react-native/globals.d.ts(251,5): error TS2717: Subsequent property declarations must have the same type. Property 'timeout' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.
226
- ../../node_modules/@types/react-native/globals.d.ts(292,14): error TS2300: Duplicate identifier 'XMLHttpRequestResponseType'.
227
- ../../node_modules/@types/react-native/globals.d.ts(299,15): error TS2300: Duplicate identifier 'URL'.
228
- ../../node_modules/@types/react-native/globals.d.ts(324,15): error TS2300: Duplicate identifier 'URLSearchParams'.
229
- ../../node_modules/@types/react-native/globals.d.ts(368,5): error TS2717: Subsequent property declarations must have the same type. Property 'onopen' must be of type '((this: WebSocket, ev: Event) => any) | null', but here has type '(() => void) | null'.
230
- ../../node_modules/@types/react-native/globals.d.ts(369,5): error TS2717: Subsequent property declarations must have the same type. Property 'onmessage' must be of type '((this: WebSocket, ev: MessageEvent<any>) => any) | null', but here has type '((event: WebSocketMessageEvent) => void) | null'.
231
- ../../node_modules/@types/react-native/globals.d.ts(370,5): error TS2717: Subsequent property declarations must have the same type. Property 'onerror' must be of type '((this: WebSocket, ev: Event) => any) | null', but here has type '((event: WebSocketErrorEvent) => void) | null'.
232
- ../../node_modules/@types/react-native/globals.d.ts(371,5): error TS2717: Subsequent property declarations must have the same type. Property 'onclose' must be of type '((this: WebSocket, ev: CloseEvent) => any) | null', but here has type '((event: WebSocketCloseEvent) => void) | null'.
233
- ../../node_modules/@types/react-native/globals.d.ts(372,5): error TS2717: Subsequent property declarations must have the same type. Property 'addEventListener' must be of type '{ <K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined): void; (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | ... 1 more ... | undefined): void; }', but here has type 'WebsocketEventListener'.
234
- ../../node_modules/@types/react-native/globals.d.ts(373,5): error TS2717: Subsequent property declarations must have the same type. Property 'removeEventListener' must be of type '{ <K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | EventListenerOptions | undefined): void; (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | ... 1 more ... | undefined): void; }', but here has type 'WebsocketEventListener'.
235
- ../../node_modules/@types/react-native/globals.d.ts(376,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'WebSocket' must be of type '{ new (url: string | URL, protocols?: string | string[] | undefined): WebSocket; prototype: WebSocket; readonly CLOSED: number; readonly CLOSING: number; readonly CONNECTING: number; readonly OPEN: number; }', but here has type '{ new (uri: string, protocols?: string | string[] | null | undefined, options?: { [optionName: string]: any; headers: { [headerName: string]: string; }; } | null | undefined): WebSocket; ... 4 more ...; readonly OPEN: number; }'.
236
- ../../node_modules/@types/react-native/globals.d.ts(400,15): error TS2300: Duplicate identifier 'AbortSignal'.
237
- ../../node_modules/@types/react-native/globals.d.ts(400,15): error TS2420: Class 'AbortSignal' incorrectly implements interface 'EventTarget'.
238
- Property 'dispatchEvent' is missing in type 'AbortSignal' but required in type 'EventTarget'.
239
- ../../node_modules/@types/react-native/globals.d.ts(435,15): error TS2300: Duplicate identifier 'AbortController'.
240
- ../../node_modules/@types/react-native/globals.d.ts(460,14): error TS2717: Subsequent property declarations must have the same type. Property 'error' must be of type 'DOMException | null', but here has type 'Error | null'.
241
- ../../node_modules/@types/react-native/globals.d.ts(468,14): error TS2717: Subsequent property declarations must have the same type. Property 'result' must be of type 'string | ArrayBuffer | null', but here has type 'string | ArrayBuffer'.
242
- ../../node_modules/@types/react-native/node_modules/@types/react/index.d.ts(3094,14): error TS2300: Duplicate identifier 'LibraryManagedAttributes'.
243
- ../../node_modules/@types/react-native/node_modu`