@tamagui/build 1.129.3 → 1.129.5-1751174117974

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.
@@ -2,26 +2,26 @@
2
2
  RUN v3.1.3 /Users/n8/tamagui/code/packages/build
3
3
 
4
4
  stdout | __tests__/integration.test.ts > tamagui-build integration test > should rebuild the package on file change when --watch is used
5
- Watch process output: built tamagui-build-test-watch-package in 82 ms
5
+ Watch process output: built tamagui-build-test-watch-package in 63 ms
6
6
 
7
7
  Initial build complete, modifying file...
8
8
 
9
9
  stdout | __tests__/integration.test.ts > tamagui-build integration test > should rebuild the package on file change when --watch is used
10
- Watch process output: built tamagui-build-test-watch-package in 464 ms
10
+ Watch process output: built tamagui-build-test-watch-package in 348 ms
11
11
 
12
12
  Rebuild after file modification complete
13
13
 
14
- ✓ __tests__/integration.test.ts (7 tests) 12057ms
15
- ✓ tamagui-build integration test > should build the package correctly 1625ms
16
- ✓ tamagui-build integration test > should bundle the package correctly 1421ms
17
- ✓ tamagui-build integration test > should skip mjs files when --skip-mjs is used 1452ms
18
- ✓ tamagui-build integration test > should ignore base URL when --ignore-base-url is used 1485ms
19
- ✓ tamagui-build integration test > should rebuild the package on file change when --watch is used 1631ms
20
- ✓ tamagui-build integration test > should generate correct platform-specific output 1504ms
21
- ✓ tamagui-build integration test > should minify the output when MINIFY=true is set 2913ms
14
+ ✓ __tests__/integration.test.ts (7 tests) 9591ms
15
+ ✓ tamagui-build integration test > should build the package correctly 1310ms
16
+ ✓ tamagui-build integration test > should bundle the package correctly 1052ms
17
+ ✓ tamagui-build integration test > should skip mjs files when --skip-mjs is used 1129ms
18
+ ✓ tamagui-build integration test > should ignore base URL when --ignore-base-url is used 1128ms
19
+ ✓ tamagui-build integration test > should rebuild the package on file change when --watch is used 1275ms
20
+ ✓ tamagui-build integration test > should generate correct platform-specific output 1300ms
21
+ ✓ tamagui-build integration test > should minify the output when MINIFY=true is set 2379ms
22
22
 
23
23
  Test Files 1 passed (1)
24
24
  Tests 7 passed (7)
25
- Start at 15:29:45
26
- Duration 12.34s (transform 57ms, setup 0ms, collect 52ms, tests 12.06s, environment 0ms, prepare 57ms)
25
+ Start at 17:36:09
26
+ Duration 9.79s (transform 46ms, setup 0ms, collect 40ms, tests 9.59s, environment 0ms, prepare 42ms)
27
27
 
package/biome.json CHANGED
@@ -72,7 +72,12 @@
72
72
  "indentWidth": 2,
73
73
  "lineWidth": 90,
74
74
  "lineEnding": "lf",
75
- "ignore": ["**/*/generated-new.ts", "**/*/generated-v2.ts", ".tamagui"]
75
+ "ignore": [
76
+ "**/*/generated-new.ts",
77
+ "**/*/generated-v2.ts",
78
+ ".tamagui",
79
+ "package.json"
80
+ ]
76
81
  },
77
82
  "javascript": {
78
83
  "formatter": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/build",
3
- "version": "1.129.3",
3
+ "version": "1.129.5-1751174117974",
4
4
  "bin": {
5
5
  "tamagui-build": "tamagui-build.js",
6
6
  "teesx": "./teesx.sh"
@@ -14,7 +14,7 @@
14
14
  "dependencies": {
15
15
  "@babel/core": "^7.25.2",
16
16
  "@swc/core": "^1.7.21",
17
- "@tamagui/babel-plugin-fully-specified": "1.129.3",
17
+ "@tamagui/babel-plugin-fully-specified": "1.129.5-1751174117974",
18
18
  "@types/fs-extra": "^9.0.13",
19
19
  "@typescript/native-preview": "7.0.0-dev.20250619.1",
20
20
  "chokidar": "^3.5.2",
package/tamagui-build.js CHANGED
@@ -178,7 +178,9 @@ async function build({ skipTypes } = {}) {
178
178
  console.info('built', pkg.name, 'in', Date.now() - start, 'ms')
179
179
  } catch (error) {
180
180
  console.error(` ❌ Error building in ${process.cwd()}:\n\n`, error.stack + '\n')
181
- process.exit(1)
181
+ if (!shouldWatch) {
182
+ process.exit(1)
183
+ }
182
184
  }
183
185
  }
184
186
 
@@ -245,6 +247,9 @@ async function buildTsc(allFiles) {
245
247
  console.error(
246
248
  `Error building: ${diagnostics.map((x) => `${x.file.fileName}: ${x.messageText?.messageText ?? x.messageText}`).join('\n')}`
247
249
  )
250
+ if (shouldWatch) {
251
+ return
252
+ }
248
253
  process.exit(1)
249
254
  }
250
255
 
@@ -387,53 +392,53 @@ async function buildJs(allFiles) {
387
392
  const esbuildBundleProps =
388
393
  bundleNative || bundleNativeTest
389
394
  ? {
390
- entryPoints: [bundleNative],
391
- bundle: true,
392
- plugins: [
393
- alias({
394
- '@tamagui/web': require.resolve('@tamagui/web/native'),
395
-
396
- 'react-native': require.resolve('@tamagui/fake-react-native'),
397
- 'react-native/Libraries/Renderer/shims/ReactFabric': require.resolve(
398
- '@tamagui/fake-react-native'
399
- ),
400
- 'react-native/Libraries/Renderer/shims/ReactNative': require.resolve(
401
- '@tamagui/fake-react-native'
402
- ),
403
-
404
- 'react-native/Libraries/Pressability/Pressability': require.resolve(
405
- '@tamagui/fake-react-native'
406
- ),
407
-
408
- 'react-native/Libraries/Pressability/usePressability': require.resolve(
409
- '@tamagui/fake-react-native/idFn'
410
- ),
411
-
412
- 'react-native-safe-area-context': require.resolve(
413
- '@tamagui/fake-react-native'
414
- ),
415
- 'react-native-gesture-handler': require.resolve('@tamagui/proxy-worm'),
416
- }),
417
- ],
418
- external: [
419
- 'react',
420
- 'react-dom',
421
- bundleNativeTest ? 'react-native' : undefined,
422
- ].filter(Boolean),
423
- resolveExtensions: [
424
- '.native.ts',
425
- '.native.tsx',
426
- '.native.js',
427
- '.ts',
428
- '.tsx',
429
- '.js',
430
- '.jsx',
431
- ],
432
- minify: !!process.env.MINIFY,
433
- define: {
434
- 'process.env.TAMAGUI_IS_CORE_NODE': '"1"',
435
- },
436
- }
395
+ entryPoints: [bundleNative],
396
+ bundle: true,
397
+ plugins: [
398
+ alias({
399
+ '@tamagui/web': require.resolve('@tamagui/web/native'),
400
+
401
+ 'react-native': require.resolve('@tamagui/fake-react-native'),
402
+ 'react-native/Libraries/Renderer/shims/ReactFabric': require.resolve(
403
+ '@tamagui/fake-react-native'
404
+ ),
405
+ 'react-native/Libraries/Renderer/shims/ReactNative': require.resolve(
406
+ '@tamagui/fake-react-native'
407
+ ),
408
+
409
+ 'react-native/Libraries/Pressability/Pressability': require.resolve(
410
+ '@tamagui/fake-react-native'
411
+ ),
412
+
413
+ 'react-native/Libraries/Pressability/usePressability': require.resolve(
414
+ '@tamagui/fake-react-native/idFn'
415
+ ),
416
+
417
+ 'react-native-safe-area-context': require.resolve(
418
+ '@tamagui/fake-react-native'
419
+ ),
420
+ 'react-native-gesture-handler': require.resolve('@tamagui/proxy-worm'),
421
+ }),
422
+ ],
423
+ external: [
424
+ 'react',
425
+ 'react-dom',
426
+ bundleNativeTest ? 'react-native' : undefined,
427
+ ].filter(Boolean),
428
+ resolveExtensions: [
429
+ '.native.ts',
430
+ '.native.tsx',
431
+ '.native.js',
432
+ '.ts',
433
+ '.tsx',
434
+ '.js',
435
+ '.jsx',
436
+ ],
437
+ minify: !!process.env.MINIFY,
438
+ define: {
439
+ 'process.env.TAMAGUI_IS_CORE_NODE': '"1"',
440
+ },
441
+ }
437
442
  : {}
438
443
 
439
444
  const start = Date.now()
@@ -480,101 +485,101 @@ async function buildJs(allFiles) {
480
485
  // web output to cjs
481
486
  pkgMain
482
487
  ? esbuildWriteIfChanged(cjsConfigWeb, {
483
- platform: 'web',
484
- bundle: shouldBundleFlag,
485
- specifyCJS: !avoidCJS,
486
- })
488
+ platform: 'web',
489
+ bundle: shouldBundleFlag,
490
+ specifyCJS: !avoidCJS,
491
+ })
487
492
  : null,
488
493
 
489
494
  // native output to cjs
490
495
  pkgMain && !shouldSkipNative
491
496
  ? esbuildWriteIfChanged(cjsConfig, {
492
- platform: 'native',
493
- })
497
+ platform: 'native',
498
+ })
494
499
  : null,
495
500
 
496
501
  // for tests to load native-mode from node
497
502
  bundleNative && !shouldSkipNative
498
503
  ? esbuildWriteIfChanged(
499
- {
500
- ...esbuildBundleProps,
501
- outfile: `dist/native.js`,
502
- },
503
- {
504
- platform: 'native',
505
- }
506
- )
504
+ {
505
+ ...esbuildBundleProps,
506
+ outfile: `dist/native.js`,
507
+ },
508
+ {
509
+ platform: 'native',
510
+ }
511
+ )
507
512
  : null,
508
513
 
509
514
  // for tests to load native-mode from node
510
515
  bundleNativeTest && !shouldSkipNative
511
516
  ? esbuildWriteIfChanged(
512
- {
513
- ...esbuildBundleProps,
514
- outfile: `dist/test.js`,
515
- },
516
- {
517
- platform: 'native',
518
- env: 'test',
519
- }
520
- )
517
+ {
518
+ ...esbuildBundleProps,
519
+ outfile: `dist/test.js`,
520
+ },
521
+ {
522
+ platform: 'native',
523
+ env: 'test',
524
+ }
525
+ )
521
526
  : null,
522
527
 
523
528
  // web output to esm
524
529
  pkgModule
525
530
  ? esbuildWriteIfChanged(esmConfig, {
526
- platform: 'web',
527
- bundle: shouldBundleFlag,
528
- })
531
+ platform: 'web',
532
+ bundle: shouldBundleFlag,
533
+ })
529
534
  : null,
530
535
 
531
536
  // native output to esm
532
537
  pkgModule && !shouldSkipNative
533
538
  ? esbuildWriteIfChanged(esmConfig, {
534
- platform: 'native',
535
- })
539
+ platform: 'native',
540
+ })
536
541
  : null,
537
542
 
538
543
  // jsx web
539
544
  pkgModuleJSX
540
545
  ? esbuildWriteIfChanged(
541
- {
542
- // only diff is jsx preserve and outdir
543
- jsx: 'preserve',
544
- outdir: flatOut ? 'dist' : 'dist/jsx',
545
- entryPoints,
546
- bundle: shouldBundleFlag,
547
- allowOverwrite: true,
548
- target: 'esnext',
549
- format: 'esm',
550
- minify: !!process.env.MINIFY,
551
- platform: 'neutral',
552
- },
553
- {
554
- platform: 'web',
555
- }
556
- )
546
+ {
547
+ // only diff is jsx preserve and outdir
548
+ jsx: 'preserve',
549
+ outdir: flatOut ? 'dist' : 'dist/jsx',
550
+ entryPoints,
551
+ bundle: shouldBundleFlag,
552
+ allowOverwrite: true,
553
+ target: 'esnext',
554
+ format: 'esm',
555
+ minify: !!process.env.MINIFY,
556
+ platform: 'neutral',
557
+ },
558
+ {
559
+ platform: 'web',
560
+ }
561
+ )
557
562
  : null,
558
563
 
559
564
  // jsx native
560
565
  pkgModuleJSX && !shouldSkipNative
561
566
  ? esbuildWriteIfChanged(
562
- {
563
- // only diff is jsx preserve and outdir
564
- jsx: 'preserve',
565
- outdir: flatOut ? 'dist' : 'dist/jsx',
566
- entryPoints,
567
- bundle: shouldBundleFlag,
568
- allowOverwrite: true,
569
- target: 'node16',
570
- format: 'esm',
571
- minify: !!process.env.MINIFY,
572
- platform: 'neutral',
573
- },
574
- {
575
- platform: 'native',
576
- }
577
- )
567
+ {
568
+ // only diff is jsx preserve and outdir
569
+ jsx: 'preserve',
570
+ outdir: flatOut ? 'dist' : 'dist/jsx',
571
+ entryPoints,
572
+ bundle: shouldBundleFlag,
573
+ allowOverwrite: true,
574
+ target: 'node16',
575
+ format: 'esm',
576
+ minify: !!process.env.MINIFY,
577
+ platform: 'neutral',
578
+ },
579
+ {
580
+ platform: 'native',
581
+ }
582
+ )
578
583
  : null,
579
584
  ]).then(() => {
580
585
  if (process.env.DEBUG) {
@@ -639,9 +644,9 @@ async function esbuildWriteIfChanged(
639
644
 
640
645
  ...(platform === 'native'
641
646
  ? [
642
- // class isnt supported by hermes
643
- es5Plugin(),
644
- ]
647
+ // class isnt supported by hermes
648
+ es5Plugin(),
649
+ ]
645
650
  : []),
646
651
  ].filter(Boolean),
647
652
 
@@ -675,7 +680,9 @@ async function esbuildWriteIfChanged(
675
680
  built = await esbuild.build(buildSettings)
676
681
  } catch (err) {
677
682
  console.error(`Error building`, err)
678
- process.exit(1)
683
+ if (!shouldWatch) {
684
+ process.exit(1)
685
+ }
679
686
  }
680
687
 
681
688
  if (!built.outputFiles) {
@@ -821,13 +828,13 @@ async function esbuildWriteIfChanged(
821
828
  const result = opts.bundle
822
829
  ? { code: contents }
823
830
  : transform(contents, {
824
- filename: path,
825
- configFile: false,
826
- sourceMap: true,
827
- plugins: [
828
- require.resolve('@tamagui/babel-plugin-fully-specified/commonjs'),
829
- ].filter(Boolean),
830
- })
831
+ filename: path,
832
+ configFile: false,
833
+ sourceMap: true,
834
+ plugins: [
835
+ require.resolve('@tamagui/babel-plugin-fully-specified/commonjs'),
836
+ ].filter(Boolean),
837
+ })
831
838
 
832
839
  cleanupNonCjsFiles.push(path)
833
840
 
@@ -857,19 +864,19 @@ async function esbuildWriteIfChanged(
857
864
  const result = opts.bundle
858
865
  ? { code: contents }
859
866
  : transform(contents, {
860
- filename: mjsOutPath,
861
- configFile: false,
862
- sourceMap: true,
863
- plugins: [
864
- [
865
- require.resolve('@tamagui/babel-plugin-fully-specified'),
866
- {
867
- esExtensionDefault: platform === 'native' ? '.native.js' : '.mjs',
868
- esExtensions: platform === 'native' ? ['.js'] : ['.mjs'],
869
- },
870
- ],
871
- ].filter(Boolean),
872
- })
867
+ filename: mjsOutPath,
868
+ configFile: false,
869
+ sourceMap: true,
870
+ plugins: [
871
+ [
872
+ require.resolve('@tamagui/babel-plugin-fully-specified'),
873
+ {
874
+ esExtensionDefault: platform === 'native' ? '.native.js' : '.mjs',
875
+ esExtensions: platform === 'native' ? ['.js'] : ['.mjs'],
876
+ },
877
+ ],
878
+ ].filter(Boolean),
879
+ })
873
880
 
874
881
  if (!path.includes('.native.')) {
875
882
  cleanupNonMjsFiles.push(path)
@@ -881,7 +888,7 @@ async function esbuildWriteIfChanged(
881
888
  await flush(
882
889
  mjsOutPath,
883
890
  result.code +
884
- (result.map ? `\n//# sourceMappingURL=${basename(mjsOutPath)}.map\n` : '')
891
+ (result.map ? `\n//# sourceMappingURL=${basename(mjsOutPath)}.map\n` : '')
885
892
  )
886
893
  ) {
887
894
  if (result.map) {