@take-out/scripts 0.0.94 → 0.0.96
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/cmd.ts +13 -10
- package/src/dev-tunnel.ts +7 -4
- package/src/env-update.ts +1 -4
- package/src/release.ts +8 -6
- package/src/typecheck.ts +2 -6
- package/src/up.ts +9 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@take-out/scripts",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.96",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/run.ts",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@clack/prompts": "^0.8.2",
|
|
32
|
-
"@take-out/helpers": "0.0.
|
|
32
|
+
"@take-out/helpers": "0.0.96",
|
|
33
33
|
"picocolors": "^1.1.1"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"vxrn": "^1.
|
|
36
|
+
"vxrn": "^1.6.1"
|
|
37
37
|
},
|
|
38
38
|
"peerDependenciesMeta": {
|
|
39
39
|
"vxrn": {
|
|
@@ -41,6 +41,6 @@
|
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"vxrn": "1.
|
|
44
|
+
"vxrn": "1.6.1"
|
|
45
45
|
}
|
|
46
46
|
}
|
package/src/cmd.ts
CHANGED
|
@@ -18,7 +18,9 @@ type RunFn<S extends string> = (
|
|
|
18
18
|
|
|
19
19
|
let _interceptCmd: ((info: { description: string; args?: string }) => void) | undefined
|
|
20
20
|
|
|
21
|
-
export function setInterceptCmd(
|
|
21
|
+
export function setInterceptCmd(
|
|
22
|
+
fn: ((info: { description: string; args?: string }) => void) | undefined
|
|
23
|
+
) {
|
|
22
24
|
_interceptCmd = fn
|
|
23
25
|
}
|
|
24
26
|
|
|
@@ -48,15 +50,16 @@ function createCmd(description: string) {
|
|
|
48
50
|
process.exit(0)
|
|
49
51
|
}
|
|
50
52
|
|
|
51
|
-
const [{ $ }, prompt, { run }, { args: parseArgs }, fs, path, os] =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
const [{ $ }, prompt, { run }, { args: parseArgs }, fs, path, os] =
|
|
54
|
+
await Promise.all([
|
|
55
|
+
import(`bun`),
|
|
56
|
+
import(`@clack/prompts`),
|
|
57
|
+
import(`./helpers/run`),
|
|
58
|
+
import(`./helpers/args`),
|
|
59
|
+
import(`node:fs/promises`),
|
|
60
|
+
import(`node:path`),
|
|
61
|
+
import(`node:os`),
|
|
62
|
+
])
|
|
60
63
|
|
|
61
64
|
const args = spec ? parseArgs(spec) : ({ rest: [] } as Args<S>)
|
|
62
65
|
await fn({ args, $, colors, prompt, run, fs, path, os } as Prettify<
|
package/src/dev-tunnel.ts
CHANGED
|
@@ -131,10 +131,13 @@ await cmd`set up cloudflare dev tunnel for local development`
|
|
|
131
131
|
// get the public url in the background
|
|
132
132
|
setTimeout(async () => {
|
|
133
133
|
try {
|
|
134
|
-
const { stdout } = await run(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
const { stdout } = await run(
|
|
135
|
+
`cloudflared tunnel info ${tunnelId} --output json`,
|
|
136
|
+
{
|
|
137
|
+
captureOutput: true,
|
|
138
|
+
silent: true,
|
|
139
|
+
}
|
|
140
|
+
)
|
|
138
141
|
|
|
139
142
|
try {
|
|
140
143
|
const info = JSON.parse(stdout)
|
package/src/env-update.ts
CHANGED
|
@@ -117,10 +117,7 @@ await cmd`sync environment variables from package.json to CI and server configs`
|
|
|
117
117
|
|
|
118
118
|
// detect format: if markers are under an x- anchor block, use map syntax (KEY: val)
|
|
119
119
|
// otherwise use list syntax (- KEY=val)
|
|
120
|
-
const beforeMarker = dockerCompose.slice(
|
|
121
|
-
0,
|
|
122
|
-
dockerCompose.indexOf(yamlStartMarker)
|
|
123
|
-
)
|
|
120
|
+
const beforeMarker = dockerCompose.slice(0, dockerCompose.indexOf(yamlStartMarker))
|
|
124
121
|
const isMap = /x-[\w-]+:.*&[\w-]+/s.test(beforeMarker)
|
|
125
122
|
|
|
126
123
|
const envLines = Object.keys(envVars)
|
package/src/release.ts
CHANGED
|
@@ -36,10 +36,7 @@ await cmd`publish takeout packages to npm`
|
|
|
36
36
|
const shouldPatch = args.patch
|
|
37
37
|
const dirty = finish || args.dirty
|
|
38
38
|
const skipTest =
|
|
39
|
-
finish ||
|
|
40
|
-
rePublish ||
|
|
41
|
-
args.skipTest ||
|
|
42
|
-
process.argv.includes('--skip-tests')
|
|
39
|
+
finish || rePublish || args.skipTest || process.argv.includes('--skip-tests')
|
|
43
40
|
const skipBuild = finish || rePublish || args.skipBuild
|
|
44
41
|
const dryRun = args.dryRun
|
|
45
42
|
const tamaguiGitUser = args.tamaguiGitUser
|
|
@@ -50,7 +47,9 @@ await cmd`publish takeout packages to npm`
|
|
|
50
47
|
if (!(await fs.pathExists(onZeroGithub))) return
|
|
51
48
|
|
|
52
49
|
// check if there are commits after the last sync commit
|
|
53
|
-
const log = (
|
|
50
|
+
const log = (
|
|
51
|
+
await $`git -C ${onZeroGithub} log --oneline --format=%s`.text()
|
|
52
|
+
).trim()
|
|
54
53
|
const commits = log.split('\n')
|
|
55
54
|
const lastSyncIdx = commits.findIndex((c) => c.startsWith('sync: from takeout'))
|
|
56
55
|
|
|
@@ -94,7 +93,10 @@ await cmd`publish takeout packages to npm`
|
|
|
94
93
|
await fs.copy(path.join(onZeroTakeout, 'src'), path.join(onZeroGithub, 'src'), {
|
|
95
94
|
overwrite: true,
|
|
96
95
|
})
|
|
97
|
-
await fs.copy(
|
|
96
|
+
await fs.copy(
|
|
97
|
+
path.join(onZeroTakeout, 'cli.cjs'),
|
|
98
|
+
path.join(onZeroGithub, 'cli.cjs')
|
|
99
|
+
)
|
|
98
100
|
await fs.copy(
|
|
99
101
|
path.join(onZeroTakeout, 'tsconfig.json'),
|
|
100
102
|
path.join(onZeroGithub, 'tsconfig.json')
|
package/src/typecheck.ts
CHANGED
|
@@ -14,12 +14,8 @@ await cmd`run typescript type checking`.run(async ({ run }) => {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
if (useTsgo) {
|
|
17
|
-
await run(
|
|
18
|
-
`bun tsgo --project ./tsconfig.json --noEmit --preserveWatchOutput ${args}`
|
|
19
|
-
)
|
|
17
|
+
await run(`bun tsgo --project ./tsconfig.json --noEmit --preserveWatchOutput ${args}`)
|
|
20
18
|
} else {
|
|
21
|
-
await run(
|
|
22
|
-
`bun tsc --project ./tsconfig.json --noEmit --preserveWatchOutput ${args}`
|
|
23
|
-
)
|
|
19
|
+
await run(`bun tsc --project ./tsconfig.json --noEmit --preserveWatchOutput ${args}`)
|
|
24
20
|
}
|
|
25
21
|
})
|
package/src/up.ts
CHANGED
|
@@ -21,7 +21,9 @@ await cmd`upgrade packages by name or pattern`
|
|
|
21
21
|
|
|
22
22
|
const packagePatterns: string[] = []
|
|
23
23
|
const rootDir = process.cwd()
|
|
24
|
-
const rootPackageJson = JSON.parse(
|
|
24
|
+
const rootPackageJson = JSON.parse(
|
|
25
|
+
readFileSync(path.join(rootDir, 'package.json'), 'utf-8')
|
|
26
|
+
)
|
|
25
27
|
const upgradeSets: Record<string, string[]> = rootPackageJson.upgradeSets || {}
|
|
26
28
|
|
|
27
29
|
for (const arg of args.rest) {
|
|
@@ -273,7 +275,8 @@ await cmd`upgrade packages by name or pattern`
|
|
|
273
275
|
|
|
274
276
|
for (const packageJsonPath of packageJsonFiles) {
|
|
275
277
|
const packagesInWorkspace =
|
|
276
|
-
packagesByWorkspace.get(getWorkspaceName(packageJsonPath, rootDir))?.packages ||
|
|
278
|
+
packagesByWorkspace.get(getWorkspaceName(packageJsonPath, rootDir))?.packages ||
|
|
279
|
+
[]
|
|
277
280
|
|
|
278
281
|
if (packagesInWorkspace.length > 0) {
|
|
279
282
|
const updates = updatePackageJsonVersions(
|
|
@@ -299,7 +302,10 @@ await cmd`upgrade packages by name or pattern`
|
|
|
299
302
|
} catch (error: any) {
|
|
300
303
|
const stderr = error.stderr?.toString() || error.message || ''
|
|
301
304
|
// check if it's a version resolution error (common after new publish)
|
|
302
|
-
if (
|
|
305
|
+
if (
|
|
306
|
+
stderr.includes('No version matching') ||
|
|
307
|
+
stderr.includes('failed to resolve')
|
|
308
|
+
) {
|
|
303
309
|
console.info(`⚠️ Version not in cache, clearing cache and retrying...`)
|
|
304
310
|
try {
|
|
305
311
|
await $`bun pm cache rm`.quiet()
|