ReviewOS

also looking at this

stacks/pet-store

umbrella: pet-store storefront fixes (rolling)

#3
Merged glennmichael123 wants to merge umbrella/pet-store into main
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.

storage/framework/core/actions/src/build/views.tsmodified+21-5
Changes to storage/framework/core/actions/src/build/views.ts
@@ -1,7 +1,23 @@
11import { runCommand } from '@stacksjs/cli'
2import { frameworkPath } from '@stacksjs/path'
2import { frameworkPath, projectPath } from '@stacksjs/path'
33
4await runCommand('bun run build', {
5 // ...options,
6 cwd: frameworkPath('views/web'),
7})
4// If the project ships its own `build.ts` (the canonical static-site
5// escape hatch — same shape as `serve.ts` for dev), use it. The
6// project's build.ts owns the build pipeline (buildStaticSite, store
7// bundling, post-processing) and the framework's role here is just to
8// invoke it. Mirrors the dev/views.ts loader so `./buddy build:frontend`
9// and `./buddy dev:frontend` follow the same convention.
10//
11// Falls back to the legacy `framework/views/web` Vue-views build for
12// projects that haven't migrated yet.
13const projectBuild = projectPath('build.ts')
14if (await Bun.file(projectBuild).exists()) {
15 await runCommand('bun build.ts', {
16 cwd: projectPath(),
17 })
18}
19else {
20 await runCommand('bun run build', {
21 cwd: frameworkPath('views/web'),
22 })
23}
storage/framework/core/buddy/src/commands/build.tsmodified+12-0
Changes to storage/framework/core/buddy/src/commands/build.ts
@@ -164,6 +164,18 @@ export function build(buddy: CLI): void {
164164 await runAction(Action.BuildWebComponentLib, options)
165165 })
166166
167 buddy
168 .command('build:frontend', descriptions.pages)
169 .alias('build:pages')
170 .alias('build:views')
171 .alias('prod:frontend')
172 .option('-p, --project [project]', descriptions.project, { default: false })
173 .option('--verbose', descriptions.verbose, { default: false })
174 .action(async (options: BuildOptions) => {
175 log.debug('Running `buddy build:frontend` ...', options)
176 await runAction(Action.BuildViews, options)
177 })
178
167179 buddy
168180 .command('build:docs', 'Automagically build your documentation site.')
169181 .alias('prod:docs')