Skip to content

refactor: Migrate project files and directories to the app directory using the new compatibilityVersion: 4 feature #127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

WuChenDi
Copy link
Contributor

  • Moved app.config.ts to the app directory
  • Migrated .vue files and other assets to the app directory
  • Updated import paths to reflect the new file locations

Documentation here: https://nuxt.com/docs/getting-started/upgrade#opting-in-to-nuxt-4

…using the new compatibilityVersion: 4 feature

- Moved `app.config.ts` to the `app` directory
- Migrated `.vue` files and other assets to the `app` directory
- Updated import paths to reflect the new file locations
@@ -1,5 +1,5 @@
import type { z } from 'zod'
import { LinkSchema } from '@/schemas/link'
import { LinkSchema } from '@@/schemas/link'

Choose a reason for hiding this comment

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

It's a little bit weird that we need to use double '@'. Can you change the alias import to use only a single '@' instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is .nuxt/tsconfig.json, you can take a look.

// Generated by nuxi
{
  "compilerOptions": {
    // ...
    "paths": {
      "~": [
        ".."
      ],
      "~/*": [
        "../*"
      ],
      "@": [
        ".."
      ],
      "@/*": [
        "../*"
      ],
      "~~": [
        ".."
      ],
      "~~/*": [
        "../*"
      ],
      "@@": [
        ".."
      ],
      "@@/*": [
        "../*"
      ],
      "assets": [
        "../assets"
      ],
      "assets/*": [
        "../assets/*"
      ],
      "public": [
        "../public"
      ],
      "public/*": [
        "../public/*"
      ],
    },
  },
  // ...
}

Since schemas is at the same level as the app, it can be adjusted as well.

What do you all think?

Choose a reason for hiding this comment

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

I see. I think we can keep it as is

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