create-vue icon indicating copy to clipboard operation
create-vue copied to clipboard

Documentation on generated files

Open bmulholland opened this issue 2 years ago • 8 comments

I've run create-vue and have a bunch of files now. Thanks! It's a good start. But I don't understand all these files. Is there a docs site that explains the result of running create-vue? I tried looking at the official Vue docs, in this repo, etc, but no luck. Please let me know if I've missed anything.

  1. There are several tsconfig variants... why? What are each for? What do they do? Why? When I change the config, which should I change, and when?
  2. There's an env.d.ts. What's that for?
  3. What's the intended difference between public/ and src/assets/ dirs? What should I put in which?

I have to understand all of them because I'm converting an existing project over from Nuxt. I'm trying to fold all these files into my existing repo. But, to do that well, I have to understand each first.

As an example of what I'm looking for, Nuxt has a Directory Structure section in the sidebar here that explains all the files in a Nuxt 3 project.

bmulholland avatar Nov 28 '23 20:11 bmulholland

In general, a docs site for "here's what you get and how to use it" would be extremely helpful. I recognize this is a scaffold, but still the goal is a gentle onramp to Vue and IMHO it's yet not as good as vue-cli at doing that.

bmulholland avatar Nov 29 '23 14:11 bmulholland

Hi @bmulholland

Thanks for your feedback

Did you check https://vuejs.org/guide/typescript/overview.html#project-setup ?

There is a specific issue logged to improve the documentation of the TS config files, see https://github.com/vuejs/create-vue/issues/265

But as you noted, this project is just a scaffolding for Vite, so you should be able to find more specific documentation on https://vitejs.dev/ and the other tools you chose when scaffolding.

cexbrayat avatar Nov 29 '23 15:11 cexbrayat

I did check that page, yes. Glad there's a specific Issue about the tsconfig ones, those are indeed confusing.

There's more to it, though. As I note, the env.d.ts isn't clear. There's also main.ts and App.vue, and it's not immediately obvious to me what each does. Understanding the purpose of each would help me use the resulting files much better.

Beyond that: what choices does the scaffolding use by default, and why? What other choices might we consider?

And going even further, ideally there would be some info on suggested best practices, so I don't start coding and dig myself into a hole right away. The scaffolding is pretty unopinionated, but that doesn't mean it can't have some :)

I will figure this all out manually, including by going to vite's docs. These thoughts are in the spirit of helping future people figure it out faster than I did. So take it as product feedback from a user, nothing more. I guess in that sense it's not an "Issue," but Discussions aren't open on this repo

bmulholland avatar Nov 30 '23 13:11 bmulholland

Sure, thanks for the feedback 👍

I'm just wondering if this is the best place to discuss/log this, or if that should be an issue on docs repo https://github.com/vuejs/docs (because there is no docs in this repo as you've seen)

cexbrayat avatar Nov 30 '23 13:11 cexbrayat

I wonder that too :)

Happy to file it there if you know that's the right place. Given that doesn't have docs for this, it's not obvious the feedback belongs there either?

bmulholland avatar Nov 30 '23 17:11 bmulholland

Another question I just had, storing it here so it's in one place for now at least: If I want to change the page title for each route, what system does that? Which docs do I look at? Vite? Vue? Vue Router? Something else?

bmulholland avatar Nov 30 '23 17:11 bmulholland

For the title of the page, you can change the default one in index.html. If you want a dynamic title depending on the URL, you'll have to use the router.

cexbrayat avatar Dec 01 '23 08:12 cexbrayat

Yeah, I figured that out, but it was way too hard. Even vue-router barely documents how to do dynamic titles. ChatGPT is what gave me a real solution, and I'm still not sure if that's the best practice approach? Anyway, just recording all the questions that someone starting up, hopefully these can get answered in an accessible place for others in future.

bmulholland avatar Dec 02 '23 13:12 bmulholland