@take-out/scripts 0.0.32 → 0.0.34
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/package.json +4 -4
- package/src/bootstrap.ts +1 -0
- package/src/check-circular-deps.ts +17 -1
- package/src/dev-tunnel.ts +1 -0
- package/src/env-pull.ts +1 -0
- package/src/helpers/env-load.ts +1 -0
- package/src/helpers/get-test-env.ts +1 -0
- package/src/helpers/handleProcessExit.ts +3 -1
- package/src/helpers/run.ts +3 -2
- package/src/release.ts +2 -1
- package/src/run.ts +3 -1
- package/src/update-deps.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@take-out/scripts",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.34",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -16,15 +16,15 @@
|
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
|
-
"lint": "
|
|
20
|
-
"lint:fix": "
|
|
19
|
+
"lint": "oxlint src",
|
|
20
|
+
"lint:fix": "oxfmt src && oxlint --fix --fix-suggestions src",
|
|
21
21
|
"typecheck": "tko run typecheck"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@take-out/helpers": "0.0.
|
|
27
|
+
"@take-out/helpers": "0.0.34"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"vxrn": "*"
|
package/src/bootstrap.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
|
+
import { basename } from 'node:path'
|
|
4
|
+
|
|
3
5
|
import { $ } from 'bun'
|
|
4
6
|
import { globSync } from 'glob'
|
|
5
|
-
import { basename } from 'node:path'
|
|
6
7
|
|
|
7
8
|
const projectRoot = process.cwd()
|
|
8
9
|
|
|
@@ -60,6 +61,21 @@ try {
|
|
|
60
61
|
// parse the output to check for cycles
|
|
61
62
|
const output = error.stderr?.toString() || error.stdout?.toString() || ''
|
|
62
63
|
|
|
64
|
+
// check if this is a tool crash (assertion error) rather than actual cycle detection
|
|
65
|
+
if (output.includes('Assertion failed') || output.includes('at panic')) {
|
|
66
|
+
const nodeVersion = process.versions.node
|
|
67
|
+
const majorVersion = parseInt(nodeVersion.split('.')[0] || '0', 10)
|
|
68
|
+
if (majorVersion >= 24) {
|
|
69
|
+
console.warn(`⚠️ @glideapps/ts-helper crashes on Node.js ${nodeVersion}`)
|
|
70
|
+
console.warn(' skipping locally - CI uses Node 20 where this check runs properly')
|
|
71
|
+
process.exit(0)
|
|
72
|
+
}
|
|
73
|
+
// unknown crash on older node, fail
|
|
74
|
+
console.error(output)
|
|
75
|
+
console.error('❌ Circular dependency check crashed unexpectedly')
|
|
76
|
+
process.exit(1)
|
|
77
|
+
}
|
|
78
|
+
|
|
63
79
|
// parse cycle arrays from output
|
|
64
80
|
const cycleRegex = /\[([^\]]+)\]/g
|
|
65
81
|
const cycles: string[][] = []
|
package/src/dev-tunnel.ts
CHANGED
package/src/env-pull.ts
CHANGED
package/src/helpers/env-load.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ChildProcess } from 'node:child_process'
|
|
2
1
|
import { spawn } from 'node:child_process'
|
|
2
|
+
|
|
3
3
|
import {
|
|
4
4
|
addProcessHandler,
|
|
5
5
|
setExitCleanupState,
|
|
@@ -7,6 +7,8 @@ import {
|
|
|
7
7
|
type ProcessType,
|
|
8
8
|
} from './run'
|
|
9
9
|
|
|
10
|
+
import type { ChildProcess } from 'node:child_process'
|
|
11
|
+
|
|
10
12
|
type ExitCallback = (info: { signal: NodeJS.Signals | string }) => void | Promise<void>
|
|
11
13
|
|
|
12
14
|
interface HandleProcessExitReturn {
|
package/src/helpers/run.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { ChildProcess } from 'node:child_process'
|
|
2
1
|
import { cpus } from 'node:os'
|
|
2
|
+
|
|
3
3
|
import type { Timer } from '@take-out/helpers'
|
|
4
|
+
import type { ChildProcess } from 'node:child_process'
|
|
4
5
|
|
|
5
6
|
export type ProcessType = ChildProcess | Bun.Subprocess
|
|
6
7
|
export type ProcessHandler = (process: ProcessType) => void
|
|
@@ -92,7 +93,7 @@ export async function run(
|
|
|
92
93
|
|
|
93
94
|
try {
|
|
94
95
|
const shell = Bun.spawn(['bash', '-c', command], {
|
|
95
|
-
env: { ...process.env, ...
|
|
96
|
+
env: { ...process.env, ...env },
|
|
96
97
|
cwd,
|
|
97
98
|
stdout: 'pipe',
|
|
98
99
|
stderr: 'pipe', // always pipe stderr so we can capture it for error messages
|
package/src/release.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import path, { join } from 'node:path'
|
|
2
|
+
|
|
1
3
|
// note! this is an helper script used by tamagui team for publishing the takeout packages
|
|
2
4
|
// you can delete this from your own app
|
|
3
5
|
|
|
4
6
|
import { run } from '@take-out/scripts/helpers/run'
|
|
5
7
|
import fs, { ensureDir, writeJSON } from 'fs-extra'
|
|
6
|
-
import path, { join } from 'node:path'
|
|
7
8
|
import pMap from 'p-map'
|
|
8
9
|
|
|
9
10
|
// avoid emitter error
|
package/src/run.ts
CHANGED
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
* @description Run multiple scripts in parallel or sequence
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { handleProcessExit } from '@take-out/scripts/helpers/handleProcessExit'
|
|
8
7
|
import { spawn } from 'node:child_process'
|
|
9
8
|
import { promises as fs } from 'node:fs'
|
|
10
9
|
import { join, relative, resolve } from 'node:path'
|
|
10
|
+
|
|
11
|
+
import { handleProcessExit } from '@take-out/scripts/helpers/handleProcessExit'
|
|
12
|
+
|
|
11
13
|
import { getIsExiting } from './helpers/run'
|
|
12
14
|
import { checkNodeVersion } from './node-version-check'
|
|
13
15
|
|
package/src/update-deps.ts
CHANGED
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
* @description Update dependencies across workspace packages
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { $ } from 'bun'
|
|
8
7
|
import { existsSync, readdirSync, readFileSync, rmSync } from 'node:fs'
|
|
9
8
|
import { join } from 'node:path'
|
|
10
9
|
|
|
10
|
+
import { $ } from 'bun'
|
|
11
|
+
|
|
11
12
|
let globalTag: string | undefined
|
|
12
13
|
const packagePatterns: string[] = []
|
|
13
14
|
|