Skip to content

Rearrange folder structure to prepare for Nuxt 4#55

Merged
ejfine merged 14 commits intomainfrom
nuxt4
Jul 28, 2025
Merged

Rearrange folder structure to prepare for Nuxt 4#55
ejfine merged 14 commits intomainfrom
nuxt4

Conversation

@ejfine
Copy link
Contributor

@ejfine ejfine commented Jul 28, 2025

Why is this change necessary?

Get ready for Nuxt 4

How does this change address the issue?

Moves things into the app subfolder recommended for Nuxt 4

What side effects does this change have?

None

How is this change tested?

Downstream repos

Other

lowered concurrency in pnpm run generate for nitro prerender to use less memory and avoid out-of-memory errors

Summary by CodeRabbit

  • New Features

    • Added a new color configuration for input menus in the frontend app.
    • Introduced a concurrency limit for prerendering in the server configuration to optimize memory usage.
  • Chores

    • Updated and added several dependency versions for improved compatibility.
    • Switched development dependency versions in the template to use dynamic template variables.
    • Updated import paths in test files for consistency.
    • Explicitly set the root directory in the test configuration.
    • Adjusted GraphQL code generation paths for better organization.
    • Updated internal version references for project consistency.

@ejfine ejfine requested a review from Copilot July 28, 2025 16:12
@ejfine ejfine self-assigned this Jul 28, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 28, 2025

Walkthrough

This update introduces dependency version bumps, adds new dependency variables, and adjusts configuration files for the frontend app. It includes explicit concurrency limits for Nitro prerendering, expands color configuration, updates import aliases, and modifies template variables for dynamic package management. GraphQL codegen and test configurations are also refined.

Changes

Cohort / File(s) Change Summary
Copier Version Bump
.copier-answers.yml
Updated the _commit field from v0.0.58 to v0.0.59.
Dependency Version Updates
extensions/context.py
Bumped versions for Nuxt, Nuxt UI, Vue, Vue Router, and Faker; added dot_env_cli_version and playwright_version.
Frontend App Config Enhancement
template/frontend/app/app.config.ts
Added inputMenu property with a nested slots.content CSS class in the colors section.
Nuxt Nitro Prerender Concurrency
template/frontend/nuxt.config.ts.jinja
Added prerender option with concurrency: 4 under the nitro config.
Dynamic Package Versioning
template/frontend/package.json.jinja
Changed several dev dependency versions to use template variables; removed flush-promises and adjusted trailing commas.
Import Alias Updates in Tests
template/frontend/tests/e2e/index.spec.ts,
template/frontend/tests/setup/globalSetup.ts
Changed import paths from ~ to ~~ alias.
Vitest Config Root Option
template/frontend/vitest.config.ts
Added root: "." to the test config object.
GraphQL Codegen Path Update
template/frontend/{% if frontend_uses_graphql %}codegen.ts{% endif %}
Updated paths for GraphQL documents and generated output to reside under the app/ directory.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant Template as package.json.jinja
    participant Context as context.py

    Dev->>Context: Updates dependency version variables
    Dev->>Template: Uses template variables for dependency versions
    Template->>Dev: Generates package.json with correct versions
Loading
sequenceDiagram
    participant NuxtConfig as nuxt.config.ts.jinja
    participant Nitro as Nitro Server

    NuxtConfig->>Nitro: Set prerender concurrency to 4
    Nitro-->>NuxtConfig: Prerender with limited concurrency
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Possibly related PRs

Poem

🐇
A hop, a skip, some versions rise,
Prerender capped—no more surprise!
Colors bloom and configs grow,
Template magic starts to show.
Aliases doubled, tests align,
All the carrots—fresh and fine!
—Rabbit, with code in mind.

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch nuxt4

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR restructures the project folder layout to align with the recommended Nuxt 4 directory structure by moving files into an app subfolder. It also updates various dependency versions and reduces memory usage during build processes.

  • Moves GraphQL-related files to the app directory structure for Nuxt 4 compatibility
  • Updates dependency versions for Nuxt, Playwright, and other packages
  • Reduces prerender concurrency to prevent out-of-memory errors during builds

Reviewed Changes

Copilot reviewed 9 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
template/frontend/{% if frontend_uses_graphql %}codegen.ts{% endif %} Updates GraphQL document and generation paths to use app/ prefix
template/frontend/vitest.config.ts Adds explicit root configuration for test setup
template/frontend/tests/setup/globalSetup.ts Changes import path from ~/ to ~~/ for constants
template/frontend/tests/e2e/index.spec.ts Updates import paths from ~/ to ~~/ for test helpers
template/frontend/package.json.jinja Updates dependency versions and removes flush-promises
template/frontend/nuxt.config.ts.jinja Adds prerender concurrency limit to reduce memory usage
template/frontend/app/app.config.ts Adds inputMenu configuration with min-width styling
extensions/context.py Updates version numbers for various dependencies
.copier-answers.yml Bumps template version from v0.0.58 to v0.0.59

"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 %}
Copy link

Copilot AI Jul 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of the 'flush-promises' dependency appears to be unrelated to the folder restructuring. This change should be documented in the PR description or handled in a separate commit to maintain clear change tracking.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, that was on purpose. we can just import it from vue-test-utils

@ejfine ejfine merged commit 9a05c4a into main Jul 28, 2025
11 of 12 checks passed
@ejfine ejfine deleted the nuxt4 branch July 28, 2025 16:17
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
template/frontend/vitest.config.ts (1)

15-15: Adding root: "." may override Nuxt Test Utils defaults

defineVitestConfig() already injects root pointing at the Nuxt project root. Explicitly setting root: "." (relative to template/frontend) is probably fine, but if this file is ever hoisted or symlinked the path can mis-align.

Consider dropping root unless you hit a concrete resolution issue; otherwise add:

-  test: {
+  test: {
+    root: fileURLToPath(new URL('.', import.meta.url)),

to lock it unambiguously to the config file’s directory.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 124b25c and 1e478fd.

📒 Files selected for processing (9)
  • .copier-answers.yml (1 hunks)
  • extensions/context.py (1 hunks)
  • template/frontend/app/app.config.ts (1 hunks)
  • template/frontend/nuxt.config.ts.jinja (1 hunks)
  • template/frontend/package.json.jinja (1 hunks)
  • template/frontend/tests/e2e/index.spec.ts (1 hunks)
  • template/frontend/tests/setup/globalSetup.ts (1 hunks)
  • template/frontend/vitest.config.ts (1 hunks)
  • template/frontend/{% if frontend_uses_graphql %}codegen.ts{% endif %} (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: lint-matrix (ubuntu-24.04, 3.12.7, --data-file tests/copier_data/data3.yaml)
  • GitHub Check: lint-matrix (ubuntu-24.04, 3.13.2, --data-file tests/copier_data/data1.yaml)
  • GitHub Check: lint-matrix (ubuntu-24.04, 3.12.7, --data-file tests/copier_data/data4.yaml)
  • GitHub Check: lint-matrix (ubuntu-24.04, 3.13.2, --data-file tests/copier_data/data2.yaml)
🔇 Additional comments (8)
extensions/context.py (1)

39-46: All bumped frontend dependencies are compatible

  • Nuxt 3.17.7 declares dependencies on vue@^3.5.17 and vue-router@^4.5.1, which cover our ^3.5.18 and ^4.5.1 updates.
  • @nuxt/ui@3.3.0 peer-dependency of vue-router@^4.5.0 includes 4.5.1.
  • dot_env_cli_version and playwright_version are correctly referenced in template/frontend/package.json.jinja, so they won’t drift.
template/frontend/tests/e2e/index.spec.ts (1)

2-3: Alias switch ~~~ can break path resolution in tests

~~ resolves to Nuxt rootDir, while ~ resolves to srcDir. After the folder shuffle to an app/ directory, double-check that the helper paths still exist at rootDir/tests/**. Otherwise the module loader will throw at runtime.

Run pnpm vitest run locally to confirm no “Cannot find module” errors surface.

template/frontend/tests/setup/globalSetup.ts (1)

7-7: Consistent aliasing across setup files

Same alias remark as above: ensure ~~/tests/setup/constants is reachable from rootDir.
If those helpers actually live under srcDir, revert to a single tilde.

template/frontend/{% if frontend_uses_graphql %}codegen.ts{% endif %} (1)

5-7: LGTM! Correct path updates for Nuxt 4 structure.

The GraphQL codegen paths have been properly updated to use the app/ directory structure, which aligns with Nuxt 4 requirements. Both the documents input path and generated output path are consistently moved to the new structure.

template/frontend/app/app.config.ts (1)

12-16: LGTM! Clean UI configuration addition.

The new inputMenu configuration with min-w-fit styling is properly structured and follows the established pattern in the UI config. This addition enhances the styling options for input menu components without affecting existing configuration.

template/frontend/nuxt.config.ts.jinja (1)

29-31: LGTM! Appropriate concurrency limit for memory management.

The prerender concurrency limit of 4 is a sensible configuration to prevent memory issues during the build process. The clear comment explains the rationale, and this change aligns with the PR objective of reducing memory usage during Nitro prerendering.

template/frontend/package.json.jinja (1)

42-63: LGTM! Excellent migration to template variables for version management.

The conversion from hardcoded version strings to template variables (e.g., {{ nuxt_version }}, {{ playwright_version }}, {{ typescript_version }}) significantly improves maintainability by enabling centralized version management. This follows the established pattern used elsewhere in the template and makes dependency updates much more manageable.

.copier-answers.yml (1)

2-2: Template tag v0.0.59 exists in the upstream template repository
Confirmed by git ls-remote output (refs/tags/v0.0.59). No further action required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants