diff --git a/.copier-answers.yml b/.copier-answers.yml index 939f6c23f..fd6305cd7 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: v0.0.58 +_commit: v0.0.59 _src_path: gh:LabAutomationAndScreening/copier-base-template.git description: A web app that is hosted within a local intranet. Nuxt frontend, python backend, docker-compose diff --git a/extensions/context.py b/extensions/context.py index 07e80de32..2df35f789 100644 --- a/extensions/context.py +++ b/extensions/context.py @@ -36,12 +36,14 @@ def hook(self, context: dict[Any, Any]) -> dict[Any, Any]: context["uvicorn_version"] = "0.35.0" context["lab_auto_pulumi_version"] = "0.1.15" - context["nuxt_ui_version"] = "^3.1.2" - context["nuxt_version"] = "^3.17.3" + context["nuxt_ui_version"] = "^3.3.0" + context["nuxt_version"] = "^3.17.7" context["typescript_version"] = "^5.8.2" - context["vue_version"] = "^3.5.13" - context["vue_router_version"] = "^4.5.0" - context["faker_version"] = "^9.8.0" + context["dot_env_cli_version"] = "^9.0.0" + context["playwright_version"] = "^1.52.0" + context["vue_version"] = "^3.5.18" + context["vue_router_version"] = "^4.5.1" + context["faker_version"] = "^9.9.0" context["graphql_codegen_cli_version"] = "^5.0.5" context["graphql_codegen_typescript_version"] = "^4.1.6" diff --git a/template/frontend/app.config.ts b/template/frontend/app/app.config.ts similarity index 74% rename from template/frontend/app.config.ts rename to template/frontend/app/app.config.ts index 58b85c627..54ae43224 100644 --- a/template/frontend/app.config.ts +++ b/template/frontend/app/app.config.ts @@ -9,5 +9,10 @@ export default defineAppConfig({ error: "red", neutral: "slate", }, + inputMenu: { + slots: { + content: "min-w-fit", + }, + }, }, }); diff --git a/template/frontend/assets/css/main.css b/template/frontend/app/assets/css/main.css similarity index 100% rename from template/frontend/assets/css/main.css rename to template/frontend/app/assets/css/main.css diff --git a/template/frontend/layouts/default.vue b/template/frontend/app/layouts/default.vue similarity index 100% rename from template/frontend/layouts/default.vue rename to template/frontend/app/layouts/default.vue diff --git a/template/frontend/pages/index.vue b/template/frontend/app/pages/index.vue similarity index 100% rename from template/frontend/pages/index.vue rename to template/frontend/app/pages/index.vue diff --git a/template/frontend/nuxt.config.ts.jinja b/template/frontend/nuxt.config.ts.jinja index a22e75734..ec012fdf9 100644 --- a/template/frontend/nuxt.config.ts.jinja +++ b/template/frontend/nuxt.config.ts.jinja @@ -26,6 +26,9 @@ export default defineNuxtConfig({ css: ["~/assets/css/main.css"], experimental: { appManifest: false }, // https://github.com/nuxt/nuxt/issues/30461#issuecomment-2572616714{% endraw %}{% if has_backend and not deploy_as_executable %}{% raw %} nitro: { + prerender: { + concurrency: 4, // lower the concurrency to not be such a memory hog + }, devProxy: { // this is just a proxy used for `pnpm run dev` "/api": { diff --git a/template/frontend/package.json.jinja b/template/frontend/package.json.jinja index 355bae5c7..9345820eb 100644 --- a/template/frontend/package.json.jinja +++ b/template/frontend/package.json.jinja @@ -39,26 +39,25 @@ "@graphql-tools/mock": "^9.0.22", "@graphql-tools/schema": "^10.0.23",{% endraw %}{% endif %}{% raw %} "@nuxt/eslint": "^1.2.0", - "@nuxt/schema": "^3.0.0", + "@nuxt/schema": "{% endraw %}{{ nuxt_version }}{% raw %}", "@nuxt/test-utils": "^3.17.2",{% endraw %}{% if frontend_uses_graphql %}{% raw %} "@nuxtjs/apollo": "5.0.0-alpha.14",{% endraw %}{% endif %}{% raw %} "@nuxtjs/eslint-config-typescript": "^12.1.0", - "@playwright/test": "^1.52.0", + "@playwright/test": "{% endraw %}{{ playwright_version }}{% raw %}", "@vitest/coverage-istanbul": "^3.1.3",{% endraw %}{% if frontend_uses_graphql %}{% raw %} "@vue/apollo-composable": "^4.2.2",{% endraw %}{% endif %}{% raw %} "@vue/devtools-api": "^7.7.2", "@vue/test-utils": "^2.4.6", "autoprefixer": "^10.4.21", - "dotenv-cli": "^8.0.0", + "dotenv-cli": "{% endraw %}{{ dot_env_cli_version }}{% raw %}", "eslint": "^9.22.0", - "eslint-plugin-vitest": "^0.5.4", - "flush-promises": "^1.0.2",{% endraw %}{% if frontend_uses_graphql %}{% raw %} + "eslint-plugin-vitest": "^0.5.4",{% endraw %}{% if frontend_uses_graphql %}{% raw %} "graphql": "^16.10.0", "graphql-tag": "^2.12.6",{% endraw %}{% endif %}{% raw %} "happy-dom": "^17.4.4",{% endraw %}{% if frontend_uses_graphql %}{% raw %} "mock-apollo-client": "^1.3.1",{% endraw %}{% endif %}{% raw %} - "playwright": "^1.52.0", - "playwright-core": "^1.52.0", + "playwright": "{% endraw %}{{ playwright_version }}{% raw %}", + "playwright-core": "{% endraw %}{{ playwright_version }}{% raw %}", "postcss": "^8.5.3", "tailwindcss": "^4.0.14", "typescript": "{% endraw %}{{ typescript_version }}{% raw %}", diff --git a/template/frontend/tests/e2e/index.spec.ts b/template/frontend/tests/e2e/index.spec.ts index b3ab4890a..506dfb3b0 100644 --- a/template/frontend/tests/e2e/index.spec.ts +++ b/template/frontend/tests/e2e/index.spec.ts @@ -1,6 +1,6 @@ import { describe, expect, test } from "vitest"; -import { url } from "~/tests/e2e/helpers/playwright"; -import { getPage } from "~/tests/setup/app"; +import { url } from "~~/tests/e2e/helpers/playwright"; +import { getPage } from "~~/tests/setup/app"; describe("Index page", async () => { test("Page displays Hello World", async () => { diff --git a/template/frontend/tests/setup/globalSetup.ts b/template/frontend/tests/setup/globalSetup.ts index 014b8def7..bed6f4635 100644 --- a/template/frontend/tests/setup/globalSetup.ts +++ b/template/frontend/tests/setup/globalSetup.ts @@ -4,7 +4,7 @@ import path from "path"; import type { Browser } from "playwright"; import { chromium } from "playwright"; import type { TestProject } from "vitest/node"; -import { APP_NAME, DEPLOYED_BACKEND_PORT_NUMBER, DEPLOYED_FRONTEND_PORT_NUMBER } from "~/tests/setup/constants"; +import { APP_NAME, DEPLOYED_BACKEND_PORT_NUMBER, DEPLOYED_FRONTEND_PORT_NUMBER } from "~~/tests/setup/constants"; const isE2E = process.env.USE_DOCKER_COMPOSE_FOR_VITEST_E2E || process.env.USE_BUILT_BACKEND_FOR_VITEST_E2E; const isDockerE2E = process.env.USE_DOCKER_COMPOSE_FOR_VITEST_E2E; diff --git a/template/frontend/vitest.config.ts b/template/frontend/vitest.config.ts index 71e5af138..fd0b5f04d 100644 --- a/template/frontend/vitest.config.ts +++ b/template/frontend/vitest.config.ts @@ -12,6 +12,7 @@ export default defineVitestConfig({ shuffle: true, }, include: ["tests/**/*.spec.ts"], + root: ".", coverage: { provider: "istanbul", reporter: ["text", "json", "html"], diff --git a/template/frontend/{% if frontend_uses_graphql %}codegen.ts{% endif %} b/template/frontend/{% if frontend_uses_graphql %}codegen.ts{% endif %} index 6744d5f2e..ac961473b 100644 --- a/template/frontend/{% if frontend_uses_graphql %}codegen.ts{% endif %} +++ b/template/frontend/{% if frontend_uses_graphql %}codegen.ts{% endif %} @@ -2,9 +2,9 @@ import type { CodegenConfig } from "@graphql-codegen/cli"; const config: CodegenConfig = { schema: process.env.GRAPHQL_ENDPOINT || "http://127.0.0.1:4000/api/graphql", - documents: "./graphql/queries/**/*.gql", + documents: "./app/graphql/queries/**/*.gql", generates: { - "./graphql/generated/graphql.ts": { + "./app/graphql/generated/graphql.ts": { plugins: ["typescript", "typescript-operations", "typescript-vue-apollo"], // cannot use `preset: "client"` because it causes duplications with typescript-vue-apollo config: { documentMode: "graphQLTag",