Public Access
v0.2.0: ship the client Dockerfile with generated Nuxt apps #8
No files matched your search
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
Submodule assets/testdata/template updated: 41df89929f...70067c968a.
@@ -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)
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
Reference in new issue
Block a user