@tamagui/build 1.122.0 → 1.122.2
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tamagui-build-test-simple-tpackage",
|
|
3
|
-
"version": "1.122.
|
|
3
|
+
"version": "1.122.2",
|
|
4
4
|
"main": "dist/cjs",
|
|
5
5
|
"module": "dist/esm/index.mjs",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"build:target-native": "TAMAGUI_TARGET=native node ../../../tamagui-build.js"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@tamagui/build": "1.122.
|
|
19
|
+
"@tamagui/build": "1.122.2",
|
|
20
20
|
"typescript": "^5.7.2"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tamagui-build-test-watch-package",
|
|
3
|
-
"version": "1.122.
|
|
3
|
+
"version": "1.122.2",
|
|
4
4
|
"main": "dist/cjs",
|
|
5
5
|
"module": "dist/esm/index.mjs",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"build:target-native": "TAMAGUI_TARGET=native node ../../../tamagui-build.js"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@tamagui/build": "1.122.
|
|
19
|
+
"@tamagui/build": "1.122.2",
|
|
20
20
|
"typescript": "^5.7.2"
|
|
21
21
|
}
|
|
22
22
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/build",
|
|
3
|
-
"version": "1.122.
|
|
3
|
+
"version": "1.122.2",
|
|
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.122.
|
|
17
|
+
"@tamagui/babel-plugin-fully-specified": "1.122.2",
|
|
18
18
|
"@types/fs-extra": "^9.0.13",
|
|
19
19
|
"chokidar": "^3.5.2",
|
|
20
20
|
"esbuild": "^0.24.2",
|
|
@@ -24,10 +24,11 @@
|
|
|
24
24
|
"fast-glob": "^3.2.11",
|
|
25
25
|
"fs-extra": "^11.2.0",
|
|
26
26
|
"lodash.debounce": "^4.0.8",
|
|
27
|
+
"oxc-transform": "^0.47.1",
|
|
27
28
|
"typescript": "^5.7.2"
|
|
28
29
|
},
|
|
29
30
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
|
|
30
31
|
"devDependencies": {
|
|
31
|
-
"vitest": "^
|
|
32
|
+
"vitest": "^3.0.2"
|
|
32
33
|
}
|
|
33
34
|
}
|
package/tamagui-build.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
const { transform } = require('@babel/core')
|
|
5
5
|
const FSE = require('fs-extra')
|
|
6
6
|
const esbuild = require('esbuild')
|
|
7
|
-
const
|
|
7
|
+
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')
|
|
@@ -155,18 +155,24 @@ async function build({ skipTypes } = {}) {
|
|
|
155
155
|
if (process.env.DEBUG) console.info('🔹', pkg.name)
|
|
156
156
|
try {
|
|
157
157
|
const start = Date.now()
|
|
158
|
+
|
|
159
|
+
const allFiles = (await fastGlob(['src/**/*.(m)?[jt]s(x)?', 'src/**/*.css'])).filter(
|
|
160
|
+
(x) => !x.includes('.d.ts') && (exclude ? !x.match(exclude) : true)
|
|
161
|
+
)
|
|
162
|
+
|
|
158
163
|
await Promise.all([
|
|
159
164
|
//
|
|
160
|
-
skipTypes ? null : buildTsc(),
|
|
161
|
-
buildJs(),
|
|
165
|
+
skipTypes ? null : buildTsc(allFiles.filter((x) => /\.tsx?$/.test(x))),
|
|
166
|
+
buildJs(allFiles),
|
|
162
167
|
])
|
|
168
|
+
|
|
163
169
|
console.info('built', pkg.name, 'in', Date.now() - start, 'ms')
|
|
164
170
|
} catch (error) {
|
|
165
171
|
console.error(` ❌ Error building in ${process.cwd()}:\n\n`, error.stack + '\n')
|
|
166
172
|
}
|
|
167
173
|
}
|
|
168
174
|
|
|
169
|
-
async function buildTsc() {
|
|
175
|
+
async function buildTsc(allFiles) {
|
|
170
176
|
if (!pkgTypes || jsOnly || shouldSkipTypes) return
|
|
171
177
|
if (shouldSkipInitialTypes) {
|
|
172
178
|
shouldSkipInitialTypes = false
|
|
@@ -181,6 +187,33 @@ async function buildTsc() {
|
|
|
181
187
|
if (error) throw error
|
|
182
188
|
|
|
183
189
|
const compilerOptions = createCompilerOptions(config.options, targetDir)
|
|
190
|
+
|
|
191
|
+
if (config.options.isolatedDeclarations) {
|
|
192
|
+
const oxc = require('oxc-transform')
|
|
193
|
+
|
|
194
|
+
await Promise.all(
|
|
195
|
+
allFiles.map(async (file) => {
|
|
196
|
+
const source = await FSE.readFile(file, 'utf-8')
|
|
197
|
+
const { code, map } = oxc.isolatedDeclaration(file, source, {
|
|
198
|
+
sourcemap: true,
|
|
199
|
+
})
|
|
200
|
+
|
|
201
|
+
const dtsPath = path
|
|
202
|
+
.join(`types`, ...file.split('/').slice(1))
|
|
203
|
+
.replace(/\.tsx?$/, '.d.ts')
|
|
204
|
+
const mapPath = `${dtsPath}.map`
|
|
205
|
+
|
|
206
|
+
const output = `${code}\n//# sourceMappingURL=${path.basename(mapPath)}`
|
|
207
|
+
await Promise.all([
|
|
208
|
+
FSE.writeFile(dtsPath, output),
|
|
209
|
+
FSE.writeFile(mapPath, JSON.stringify(map, null, 2)),
|
|
210
|
+
])
|
|
211
|
+
})
|
|
212
|
+
)
|
|
213
|
+
|
|
214
|
+
return
|
|
215
|
+
}
|
|
216
|
+
|
|
184
217
|
const { program, emitResult, diagnostics } = await compileTypeScript(
|
|
185
218
|
config.fileNames,
|
|
186
219
|
compilerOptions
|
|
@@ -295,7 +328,7 @@ function reportDiagnostics(diagnostics) {
|
|
|
295
328
|
})
|
|
296
329
|
}
|
|
297
330
|
|
|
298
|
-
async function buildJs() {
|
|
331
|
+
async function buildJs(allFiles) {
|
|
299
332
|
if (skipJS) {
|
|
300
333
|
return
|
|
301
334
|
}
|
|
@@ -379,10 +412,6 @@ async function buildJs() {
|
|
|
379
412
|
|
|
380
413
|
const start = Date.now()
|
|
381
414
|
|
|
382
|
-
const allFiles = (await fg(['src/**/*.(m)?[jt]s(x)?', 'src/**/*.css'])).filter(
|
|
383
|
-
(x) => !x.includes('.d.ts') && (exclude ? !x.match(exclude) : true)
|
|
384
|
-
)
|
|
385
|
-
|
|
386
415
|
const entryPoints = shouldBundleFlag ? [pkgSource || './src/index.ts'] : allFiles
|
|
387
416
|
|
|
388
417
|
const cjsConfig = {
|