vuepress / create-vuepress-site

VuePress Site Generator
https://www.npmjs.com/package/create-vuepress-site
MIT License
117 stars 43 forks source link

Improve handling of repo on new app #12

Open MichaelCurrin opened 3 years ago

MichaelCurrin commented 3 years ago

Hi

I ran the command to setup an app.

I was confused by the repo argument, in how it appears in the interactive CLI and how it gets used.

Suggestions:

MichaelCurrin commented 3 years ago

I was confused at this line, because it didn't give any example.

lib/generators/blog/index.js

What's the repo of your project?

It made me wonder - should I enter my-app, or my-user/my-app or https://github.com/my-user/my-app?

So help text would be nice. Like example value on the right or greyed out.

MichaelCurrin commented 3 years ago

On further inspection, I see the value actually gets used here in the template: lib/generators/blog/templates/package.json

"<%= repo %>/<%= name %>"

Based on working with package.json, I'd expect the finished value to be like:

{
  "repository": "https://github.com/my-user/my-app"
}

I left it blank.

Which then gave me a result like this with a forward slash

{
  "repository": "/my-app"
}

So leaving out repo seems to get weird behavior.

And if I entered https://github.com/my-user/my-app in the CLI, then I got bad URL:

{
  "repository": "https://github.com/my-user/my-app/my-app",
}

So that looks like a bug.


What I would expect is that the app should ask for "Repo URL" so there is no confusion. e.g. "https://github.com/my-user/my-app".

And then that whole value should appear in the result.

Which means a code change. Maybe even name the variable repoUrl instead of repo.

-  "repository": "<%= repo %>/<%= name %>"
+  "repository": "<%= repo %>"

Or ask the user for path to their GitHub account (not their repo)- e.g.

GitHub user URL: https://github.com/my-user

Then this makes sense with a rename.

-  "repository": "<%= repo %>/<%= name %>"
+  "repository": "<%= userUrl %>/<%= name %>"

Or leave out repo as a question and output field altogether.

snithfferx commented 1 year ago

Any way to solve this issue? I get a really wierd message creating my vuepress project.

C:\Users\JRIVERA\AppData\Roaming\npm-cache_npx\11860\node_modules\create-vuepress-site\node_modules\mem-fs-editor\node_modules\mkdirp\lib\path-arg.js:20 throw Object.assign(new Error('Illegal characters in path.'), { ^

Error: Illegal characters in path. at pathArg (C:\Users\JRIVERA\AppData\Roaming\npm-cache_npx\11860\node_modules\create-vuepress-site\node_modules\mem-fs-editor\node_modules\mkdirp\lib\path-arg.js:20:27) at Function.mkdirpSync [as sync] (C:\Users\JRIVERA\AppData\Roaming\npm-cache_npx\11860\node_modules\create-vuepress-site\node_modules\mem-fs-editor\node_modules\mkdirp\index.js:18:10) at write (C:\Users\JRIVERA\AppData\Roaming\npm-cache_npx\11860\node_modules\create-vuepress-site\node_modules\mem-fs-editor\lib\actions\commit.js:12:12) at DestroyableTransform._transform (C:\Users\JRIVERA\AppData\Roaming\npm-cache_npx\11860\node_modules\create-vuepress-site\node_modules\mem-fs-editor\lib\actions\commit.js:49:7) at DestroyableTransform.Transform._read (C:\Users\JRIVERA\AppData\Roaming\npm-cache_npx\11860\node_modules\create-vuepress-site\node_modules\readable-stream\lib_stream_transform.js:177:10) at DestroyableTransform.Transform._write (C:\Users\JRIVERA\AppData\Roaming\npm-cache_npx\11860\node_modules\create-vuepress-site\node_modules\readable-stream\lib_stream_transform.js:164:83) at doWrite (C:\Users\JRIVERA\AppData\Roaming\npm-cache_npx\11860\node_modules\create-vuepress-site\node_modules\readable-stream\lib_stream_writable.js:409:139) at writeOrBuffer (C:\Users\JRIVERA\AppData\Roaming\npm-cache_npx\11860\node_modules\create-vuepress-site\node_modules\readable-stream\lib_stream_writable.js:398:5) at DestroyableTransform.Writable.write (C:\Users\JRIVERA\AppData\Roaming\npm-cache_npx\11860\node_modules\create-vuepress-site\node_modules\readable-stream\lib_stream_writable.js:307:11) at DestroyableTransform.ondata (C:\Users\JRIVERA\AppData\Roaming\npm-cache_npx\11860\node_modules\create-vuepress-site\node_modules\readable-stream\lib_stream_readable.js:681:20) { path: 'C:\wamp64\www\c:\wamp64\www\tasker-docs\docs', code: 'EINVAL' }

this jumps even when I leave the question blank, or typing something. I was following this guide vuepress, also bad documentation by the way. Maybe a little guide for what or how use the tool will it be nice.

MichaelCurrin commented 1 year ago

This issue was created as general improvement of code and documentation. You have a very specific error, possibly specific to your OS or the fields you are entering. Perhaps you can make an new issue instead and link it here. Also it might get more attention that way, as this issue from 2021 hasn't had activity otherwise.

snithfferx commented 1 year ago

I don't know why, but, this error only jumps in my home computer, at work all go with shining colors. Maybe is something in my setup. Sorry for post it here, I think the project was alive, and the issue also. Thank you for the reply, hope the project goes very fine. I love the simplicity of the deployment (as is at my work). Regards.