Skip to content
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

fix: added .nuxtrc & updated tsconfig path #685

Closed
wants to merge 1 commit into from

Conversation

avxkim
Copy link

@avxkim avxkim commented Mar 17, 2024

@danielroe

  1. I've added .nuxtrc with: typescript.includeWorkspace = true, so nuxt imports would be recognized by TS correctly. Layers starter has it by default, but "module starter" doesn't.
  2. Also u updated path in tsconfig.json

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

I’m not yet sure there is actually an issue. The behaviour you mentioned in the other issue is actually correct.

@@ -1,3 +1,3 @@
{
"extends": "./.nuxt/tsconfig.json"
}
"extends": "./playground/.nuxt/tsconfig.json"
Copy link
Member

Choose a reason for hiding this comment

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

The new module builder stub mode outputs the tsconfig in the root of the project.

Copy link
Author

Choose a reason for hiding this comment

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

By "stub mode" you mean a command within package.json?

Copy link
Member

Choose a reason for hiding this comment

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

Yes

Copy link
Author

@avxkim avxkim Mar 17, 2024

Choose a reason for hiding this comment

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

Do i have to run this command when i plan to use playground? I thought it was supposed only when i'm ready to ship it to npm registry.

Also i re-read documentation, and it's not clear enough for me, what steps do i have to make before shipping my module.

But what about .nuxtrc shouldn't it be there in a module starter just as in layer starter?

Copy link
Member

Choose a reason for hiding this comment

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

Stub mode is used in development, not for publishing. Try copying the scripts from the current starter template or starting a new project.

One of the main reasons we adopted stun mode was so people would know they needed to import things from #imports into their module runtime code.

Copy link
Member

Choose a reason for hiding this comment

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

Exactly! If that doesn’t work then we have an issue.

and we may need to document this if it isn’t in the guide 😅

Copy link
Author

Choose a reason for hiding this comment

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

https://github.com/nuxt/starter/tree/module
in README it says

# Install dependencies
npm install

# Generate type stubs
npm run dev:prepare

# Develop with the playground
npm run dev

# Build the playground
npm run dev:build

i guess we have to follow these steps, but what the reason for npm run dev:build in what cases do i need it? Initially i thought npm run dev:build is for building a module for npm registry.

Copy link
Member

Choose a reason for hiding this comment

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

dev:build is for testing your local playground

Copy link
Author

Choose a reason for hiding this comment

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

so, there's no actions needed when pushing to npm registry then?

Copy link
Member

Choose a reason for hiding this comment

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

That's covered in the 'Publishing' section of the guide:

https://nuxt.com/docs/guide/going-further/modules#how-to-publish

@danielroe
Copy link
Member

Closing as this shouldn't be needed but I really appreciate the PR 🙏 ❤️

@danielroe danielroe closed this Apr 10, 2024
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