v0.2.0: ship the client Dockerfile with generated Nuxt apps #8

Merged
FernandoJVideira merged 1 commits from chore/v0.2.0 into main 2026-09-16 12:09:32 +00:00
5 changed files with 11 additions and 4 deletions
Showing only changes of commit 2f1ad93a74 - Show all commits

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
PKG_NAME := git.fernandovideira.com/FernandoJVideira/draft PKG_NAME := git.fernandovideira.com/FernandoJVideira/draft
VERSION := v0.1.0 VERSION := v0.2.0
GO_SOURCES := $(shell find . -name '*.go' -not -path './assets/testdata/*') GO_SOURCES := $(shell find . -name '*.go' -not -path './assets/testdata/*')
.PHONY: version build windows win-arm linux mac prepare-embed clean .PHONY: version build windows win-arm linux mac prepare-embed clean
+1 -1
View File
@@ -85,7 +85,7 @@ draft new client
3. Scaffolds the base app via the official tooling (`nuxi init` for Nuxt, `create-vue` for Vue), so the generated boilerplate, dependency versions, and lockfile are always current rather than pinned by Draft 3. Scaffolds the base app via the official tooling (`nuxi init` for Nuxt, `create-vue` for Vue), so the generated boilerplate, dependency versions, and lockfile are always current rather than pinned by Draft
4. Layers a Draft-maintained overlay on top: an auth store (login/logout/register/token refresh), route guards, API composable, and pages for login/signup/profile/organizations/email verification/invites — all wired up to talk to a Draft-generated API out of the box 4. Layers a Draft-maintained overlay on top: an auth store (login/logout/register/token refresh), route guards, API composable, and pages for login/signup/profile/organizations/email verification/invites — all wired up to talk to a Draft-generated API out of the box
Both frameworks produce a comparable app: [`vue-ui-kit`](https://git.fernandovideira.com/FernandoJVideira/vue-ui-kit) (installed from its own Gitea npm registry - see its README for the one-time `.npmrc` token setup) + Tailwind, the same component library and theme tokens on either framework. Both frameworks produce a comparable app: [`vue-ui-kit`](https://git.fernandovideira.com/FernandoJVideira/vue-ui-kit) (installed from its own Gitea npm registry - see its README for the one-time `.npmrc` token setup) + Tailwind, the same component library and theme tokens on either framework. The generated Nuxt client's Dockerfile mounts that `~/.npmrc` as a build secret (wired up in the monorepo's `docker-compose.yml`), so container builds resolve the package without baking the token into the image.
### Create a New Monorepo Project ### Create a New Monorepo Project
+7
View File
@@ -68,8 +68,15 @@ func scaffoldClientNuxt(projectDir, serviceName string) error {
return fmt.Errorf("error running nuxi init: %w", err) return fmt.Errorf("error running nuxi init: %w", err)
} }
version, err := pnpmVersion()
if err != nil {
return fmt.Errorf("error detecting pnpm version: %w", err)
}
replacements := map[string]string{ replacements := map[string]string{
"App Template": serviceName, "App Template": serviceName,
// The overlay's Dockerfile pins the pnpm that produced the template's
// lockfile; the generated project's lockfile comes from the local pnpm.
"[email protected]": "pnpm@" + version,
} }
if err := copyEmbeddedDir("embedded/client-nuxt", projectDir, replacements); err != nil { if err := copyEmbeddedDir("embedded/client-nuxt", projectDir, replacements); err != nil {
return fmt.Errorf("error copying client overlay: %w", err) return fmt.Errorf("error copying client overlay: %w", err)
+1 -1
View File
@@ -39,7 +39,7 @@ var jobs = []syncJob{
templateName: "client-nuxt", templateName: "client-nuxt",
sourceDir: "assets/testdata/template/apps/client", sourceDir: "assets/testdata/template/apps/client",
targetDir: "assets/embedded/client-nuxt", targetDir: "assets/embedded/client-nuxt",
includePrefixes: []string{"app/", "public/"}, includePrefixes: []string{"app/", "public/", "Dockerfile"},
}, },
{ {
templateName: "client-vue", templateName: "client-vue",