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,7 +1,23 @@ | ||
| 1 | 1 | import { runCommand } from '@stacksjs/cli' |
| 2 | import { frameworkPath } from '@stacksjs/path' | |
| 2 | import { frameworkPath, projectPath } from '@stacksjs/path' | |
| 3 | 3 | |
| 4 | await 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. | |
| 13 | const projectBuild = projectPath('build.ts') | |
| 14 | if (await Bun.file(projectBuild).exists()) { | |
| 15 | await runCommand('bun build.ts', { | |
| 16 | cwd: projectPath(), | |
| 17 | }) | |
| 18 | } | |
| 19 | else { | |
| 20 | await runCommand('bun run build', { | |
| 21 | cwd: frameworkPath('views/web'), | |
| 22 | }) | |
| 23 | } | |
| @@ -164,6 +164,18 @@ export function build(buddy: CLI): void { | ||
| 164 | 164 | await runAction(Action.BuildWebComponentLib, options) |
| 165 | 165 | }) |
| 166 | 166 | |
| 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 | ||
| 167 | 179 | buddy |
| 168 | 180 | .command('build:docs', 'Automagically build your documentation site.') |
| 169 | 181 | .alias('prod:docs') |