also looking at this
umbrella: pet-store storefront fixes (rolling)
#3
586 files
+38082
-7487
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import { $ } from 'bun' |
| 2 | import { existsSync, statSync } from 'node:fs' | |
| 2 | import { existsSync, readFileSync, statSync } from 'node:fs' | |
| 3 | 3 | import process from 'node:process' |
| 4 | 4 | import { dim, italic, log } from '@stacksjs/cli' |
| 5 | 5 | import { corePath } from '@stacksjs/path' |
| @@ -16,7 +16,15 @@ const dirs = allEntries.filter((entry) => { | ||
| 16 | 16 | const pkgPath = `${entry}/package.json` |
| 17 | 17 | if (!existsSync(pkgPath)) |
| 18 | 18 | return false |
| 19 | return true | |
| 19 | ||
| 20 | try { | |
| 21 | const pkg = JSON.parse(readFileSync(pkgPath, 'utf8')) as { scripts?: Record<string, string> } | |
| 22 | return typeof pkg.scripts?.build === 'string' | |
| 23 | } | |
| 24 | catch (error) { | |
| 25 | log.warn(`Skipping ${italic(dim(entry))}: package.json could not be read`) | |
| 26 | return false | |
| 27 | } | |
| 20 | 28 | }) |
| 21 | 29 | |
| 22 | 30 | if (dirs.length === 0) { |