@tamagui/build 1.140.1 → 1.140.3
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/.turbo/turbo-test.log +12 -12
- package/package.json +2 -2
- package/tamagui-build.js +24 -4
- package/esbuildAliasPlugin.js +0 -42
package/.turbo/turbo-test.log
CHANGED
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
[1m[46m RUN [49m[22m [36mv4.0.4 [39m[90m/Users/n8/tamagui/code/packages/build[39m
|
|
3
3
|
|
|
4
4
|
[90mstdout[2m | __tests__/integration.test.ts[2m > [22m[2mtamagui-build integration test[2m > [22m[2mshould rebuild the package on file change when --watch is used
|
|
5
|
-
[22m[39mWatch process output: built tamagui-build-test-watch-package in
|
|
5
|
+
[22m[39mWatch process output: built tamagui-build-test-watch-package in 65 ms
|
|
6
6
|
|
|
7
7
|
Initial build complete, modifying file...
|
|
8
8
|
|
|
9
9
|
[90mstdout[2m | __tests__/integration.test.ts[2m > [22m[2mtamagui-build integration test[2m > [22m[2mshould rebuild the package on file change when --watch is used
|
|
10
|
-
[22m[39mWatch process output: built tamagui-build-test-watch-package in
|
|
10
|
+
[22m[39mWatch process output: built tamagui-build-test-watch-package in 359 ms
|
|
11
11
|
|
|
12
12
|
Rebuild after file modification complete
|
|
13
13
|
|
|
14
|
-
[32m✓[39m __tests__/integration.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m
|
|
15
|
-
[33m[2m✓[22m[39m should build the package correctly [33m
|
|
16
|
-
[33m[2m✓[22m[39m should bundle the package correctly [33m
|
|
17
|
-
[33m[2m✓[22m[39m should skip mjs files when --skip-mjs is used [33m
|
|
18
|
-
[33m[2m✓[22m[39m should ignore base URL when --ignore-base-url is used [33m
|
|
19
|
-
[33m[2m✓[22m[39m should rebuild the package on file change when --watch is used [33m
|
|
20
|
-
[33m[2m✓[22m[39m should generate correct platform-specific output [33m
|
|
21
|
-
[33m[2m✓[22m[39m should minify the output when MINIFY=true is set [33m
|
|
14
|
+
[32m✓[39m __tests__/integration.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m 8613[2mms[22m[39m
|
|
15
|
+
[33m[2m✓[22m[39m should build the package correctly [33m 1207[2mms[22m[39m
|
|
16
|
+
[33m[2m✓[22m[39m should bundle the package correctly [33m 981[2mms[22m[39m
|
|
17
|
+
[33m[2m✓[22m[39m should skip mjs files when --skip-mjs is used [33m 1036[2mms[22m[39m
|
|
18
|
+
[33m[2m✓[22m[39m should ignore base URL when --ignore-base-url is used [33m 1041[2mms[22m[39m
|
|
19
|
+
[33m[2m✓[22m[39m should rebuild the package on file change when --watch is used [33m 1236[2mms[22m[39m
|
|
20
|
+
[33m[2m✓[22m[39m should generate correct platform-specific output [33m 1030[2mms[22m[39m
|
|
21
|
+
[33m[2m✓[22m[39m should minify the output when MINIFY=true is set [33m 2062[2mms[22m[39m
|
|
22
22
|
|
|
23
23
|
[2m Test Files [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
24
24
|
[2m Tests [22m [1m[32m7 passed[39m[22m[90m (7)[39m
|
|
25
|
-
[2m Start at [22m
|
|
26
|
-
[2m Duration [22m
|
|
25
|
+
[2m Start at [22m 12:28:44
|
|
26
|
+
[2m Duration [22m 8.72s[2m (transform 34ms, setup 0ms, collect 40ms, tests 8.61s, environment 0ms, prepare 2ms)[22m
|
|
27
27
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/build",
|
|
3
|
-
"version": "1.140.
|
|
3
|
+
"version": "1.140.3",
|
|
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.14.0",
|
|
17
|
-
"@tamagui/babel-plugin-fully-specified": "1.140.
|
|
17
|
+
"@tamagui/babel-plugin-fully-specified": "1.140.3",
|
|
18
18
|
"@types/fs-extra": "^9.0.13",
|
|
19
19
|
"chokidar": "^3.5.2",
|
|
20
20
|
"esbuild": "^0.25.11",
|
package/tamagui-build.js
CHANGED
|
@@ -8,7 +8,6 @@ const fastGlob = require('fast-glob')
|
|
|
8
8
|
const createExternalPlugin = require('./externalNodePlugin')
|
|
9
9
|
const debounce = require('lodash.debounce')
|
|
10
10
|
const { basename, dirname } = require('node:path')
|
|
11
|
-
const alias = require('./esbuildAliasPlugin')
|
|
12
11
|
const { es5Plugin } = require('./esbuild-es5')
|
|
13
12
|
const ts = require('typescript')
|
|
14
13
|
const path = require('node:path')
|
|
@@ -65,6 +64,8 @@ const buildConfig = pkg['tamagui-build'] || {}
|
|
|
65
64
|
// if bundleOnly is set, only bundle those packages (old behavior)
|
|
66
65
|
// otherwise bundle ALL packages by default (new behavior)
|
|
67
66
|
const bundleOnly = buildConfig.bundleOnly || null
|
|
67
|
+
// if bundleExternal is set, always keep those packages external
|
|
68
|
+
const bundleExternal = buildConfig.bundleExternal || null
|
|
68
69
|
|
|
69
70
|
const flatOut = [pkgMain, pkgModule, pkgModuleJSX].filter(Boolean).length === 1
|
|
70
71
|
|
|
@@ -400,7 +401,7 @@ async function buildJs(allFiles) {
|
|
|
400
401
|
name: `bundle-all-modules`,
|
|
401
402
|
setup(build) {
|
|
402
403
|
// Alias esbuild to esbuild-wasm (but keep it external)
|
|
403
|
-
build.onResolve({ filter: /^esbuild$/ }, (
|
|
404
|
+
build.onResolve({ filter: /^esbuild$/ }, () => {
|
|
404
405
|
return { path: 'esbuild-wasm', external: true }
|
|
405
406
|
})
|
|
406
407
|
|
|
@@ -412,13 +413,32 @@ async function buildJs(allFiles) {
|
|
|
412
413
|
|
|
413
414
|
if (!args.path.startsWith('.') && !args.path.startsWith('/')) {
|
|
414
415
|
// Always keep these external (need runtime file access)
|
|
415
|
-
if (
|
|
416
|
+
if (
|
|
417
|
+
alwaysExternal.some(
|
|
418
|
+
(pkg) => args.path === pkg || args.path.startsWith(pkg + '/')
|
|
419
|
+
)
|
|
420
|
+
) {
|
|
416
421
|
return { external: true }
|
|
417
422
|
}
|
|
418
423
|
|
|
424
|
+
// If bundleExternal is set, keep those packages external
|
|
425
|
+
if (bundleExternal) {
|
|
426
|
+
if (
|
|
427
|
+
bundleExternal.some(
|
|
428
|
+
(pkg) => args.path === pkg || args.path.startsWith(pkg + '/')
|
|
429
|
+
)
|
|
430
|
+
) {
|
|
431
|
+
return { external: true }
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
419
435
|
// If bundleOnly is set, only bundle those specific packages
|
|
420
436
|
if (bundleOnly) {
|
|
421
|
-
if (
|
|
437
|
+
if (
|
|
438
|
+
bundleOnly.some(
|
|
439
|
+
(pkg) => args.path === pkg || args.path.startsWith(pkg + '/')
|
|
440
|
+
)
|
|
441
|
+
) {
|
|
422
442
|
return { external: false }
|
|
423
443
|
}
|
|
424
444
|
return { external: true }
|
package/esbuildAliasPlugin.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* alias plugin
|
|
3
|
-
* @description
|
|
4
|
-
* config example:
|
|
5
|
-
* ```
|
|
6
|
-
* {
|
|
7
|
-
* '@lib': '/some/absolute/path'
|
|
8
|
-
* }
|
|
9
|
-
* ```
|
|
10
|
-
* then `import { something } from '@tamagui/core'` will be transformed to
|
|
11
|
-
* `import { something } from '/some/absolute/path/xxx'`
|
|
12
|
-
* @param {object} config
|
|
13
|
-
*/
|
|
14
|
-
const aliasPlugin = (config) => {
|
|
15
|
-
const alias = config && Object.keys(config)
|
|
16
|
-
return {
|
|
17
|
-
name: 'path-alias',
|
|
18
|
-
|
|
19
|
-
setup(build) {
|
|
20
|
-
if (!alias || !alias.length) {
|
|
21
|
-
return
|
|
22
|
-
}
|
|
23
|
-
const main = (k, args) => {
|
|
24
|
-
const targetPath = config[k].replace(/\/$/, '')
|
|
25
|
-
return {
|
|
26
|
-
path: targetPath,
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
alias.forEach((k) => {
|
|
31
|
-
build.onResolve({ filter: new RegExp(`^.*${k}$`) }, (args) => {
|
|
32
|
-
return main(k, args)
|
|
33
|
-
})
|
|
34
|
-
build.onResolve({ filter: new RegExp(`^.*\\/${k}\\/.*$`) }, (args) => {
|
|
35
|
-
return main(k, args)
|
|
36
|
-
})
|
|
37
|
-
})
|
|
38
|
-
},
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
module.exports = aliasPlugin
|