From 2f1ad93a74bbccf4d086318d11dc5200b1dbd255 Mon Sep 17 00:00:00 2001 From: FernandoJVideira <03.pleaser-minster@icloud.com> Date: Wed, 16 Sep 2026 13:08:18 +0100 Subject: [PATCH] Ship the client Dockerfile with generated Nuxt apps; bump to v0.2.0 A generated monorepo's docker-compose.yml already built apps/client from apps/client/Dockerfile, but the client overlay only embedded app/ and public/, so the file never existed and `docker compose build client` failed on every fresh project. The client-nuxt sync job now embeds the template's Dockerfile too, and the Nuxt scaffold rewrites its pnpm pin to the locally detected version - the one that produces the generated project's lockfile - the same way it already stamps packageManager. Bumps the submodule to the template commit that mounts ~/.npmrc as a build secret for the registry token, and the Makefile VERSION to v0.2.0 for the release. Co-Authored-By: Claude Fable 5.1 --- Makefile | 2 +- README.md | 2 +- assets/testdata/template | 2 +- cmd/client.go | 7 +++++++ tools/sync_templates.go | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index d1cd1fa..4dc5c8d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ 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/*') .PHONY: version build windows win-arm linux mac prepare-embed clean diff --git a/README.md b/README.md index b151ffe..dcdb51f 100644 --- a/README.md +++ b/README.md @@ -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 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 diff --git a/assets/testdata/template b/assets/testdata/template index 41df899..70067c9 160000 --- a/assets/testdata/template +++ b/assets/testdata/template @@ -1 +1 @@ -Subproject commit 41df89929ff6ccdd7f1bcbf3bb2557dea8f55cb2 +Subproject commit 70067c968a24f7ffb84c09391980022aeffebd93 diff --git a/cmd/client.go b/cmd/client.go index 51b67d3..2443118 100644 --- a/cmd/client.go +++ b/cmd/client.go @@ -68,8 +68,15 @@ func scaffoldClientNuxt(projectDir, serviceName string) error { 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{ "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. + "pnpm@11.22.0": "pnpm@" + version, } if err := copyEmbeddedDir("embedded/client-nuxt", projectDir, replacements); err != nil { return fmt.Errorf("error copying client overlay: %w", err) diff --git a/tools/sync_templates.go b/tools/sync_templates.go index 3670065..81c91fa 100644 --- a/tools/sync_templates.go +++ b/tools/sync_templates.go @@ -39,7 +39,7 @@ var jobs = []syncJob{ templateName: "client-nuxt", sourceDir: "assets/testdata/template/apps/client", targetDir: "assets/embedded/client-nuxt", - includePrefixes: []string{"app/", "public/"}, + includePrefixes: []string{"app/", "public/", "Dockerfile"}, }, { templateName: "client-vue", -- 2.54.0