@take-out/scripts 0.0.40 → 0.0.42

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@take-out/scripts",
3
- "version": "0.0.40",
3
+ "version": "0.0.42",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "sideEffects": false,
@@ -24,7 +24,7 @@
24
24
  "access": "public"
25
25
  },
26
26
  "dependencies": {
27
- "@take-out/helpers": "0.0.40"
27
+ "@take-out/helpers": "0.0.42"
28
28
  },
29
29
  "devDependencies": {
30
30
  "vxrn": "*"
@@ -20,11 +20,11 @@ if (!(await exists(`./node_modules/.bin/tko`))) {
20
20
  }
21
21
  }
22
22
 
23
- // check if critical packages are built - both helpers and takeout are needed for tko to work
23
+ // check if critical packages are built - both helpers and cli are needed for tko to work
24
24
  if (hasPackages) {
25
25
  const needsBuild =
26
26
  !(await exists(`./packages/helpers/dist`)) ||
27
- !(await exists(`./packages/takeout/dist/esm`))
27
+ !(await exists(`./packages/cli/dist/esm`))
28
28
 
29
29
  if (needsBuild) {
30
30
  // build helpers first as other packages depend on it
@@ -69,7 +69,7 @@ function symlinkBins() {
69
69
  // workaround for https://github.com/oven-sh/bun/issues/19782
70
70
  // bun doesn't create symlinks for workspace packages properly
71
71
  const packagesWithCLI = [
72
- { name: 'takeout', cliFile: 'cli.mjs', alias: 'tko' },
72
+ { name: 'cli', cliFile: 'cli.mjs', alias: 'tko' },
73
73
  { name: 'postgres', cliFile: 'cli.cjs' },
74
74
  ]
75
75
 
@@ -193,17 +193,18 @@ async function updatePackages(packagesToUpdate: string[], cwd: string) {
193
193
  if (globalTag) {
194
194
  // check which packages actually have the tag
195
195
  console.info(`šŸ” Checking which packages have tag '${globalTag}'...\n`)
196
- const packagesWithTag: string[] = []
197
-
198
- for (const pkg of packagesToUpdate) {
199
- try {
200
- await $`npm view ${pkg}@${globalTag} version --json`.quiet()
201
- packagesWithTag.push(pkg)
202
- console.info(` āœ“ ${pkg}@${globalTag} exists`)
203
- } catch {
204
- console.info(` ⊘ ${pkg}@${globalTag} not found, skipping`)
205
- }
206
- }
196
+ const packagesWithTag = await Promise.all(
197
+ packagesToUpdate.flatMap(async (pkg) => {
198
+ try {
199
+ await $`npm view ${pkg}@${globalTag} version --json`.quiet()
200
+ console.info(` āœ“ ${pkg}@${globalTag} exists`)
201
+ return [pkg]
202
+ } catch {
203
+ console.info(` ⊘ ${pkg}@${globalTag} not found, skipping`)
204
+ return []
205
+ }
206
+ })
207
+ )
207
208
 
208
209
  if (packagesWithTag.length === 0) {
209
210
  console.info(`\nāš ļø No packages found with tag '${globalTag}'`)