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
Added hs create vue-app that utilizes vue-cli init command #280
Conversation
…ndividual methods are responsible for this
|
||
return new Promise(resolve => { | ||
const vueInit = spawn( | ||
'vue', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if vue
is not installed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I had mean't to handle this -- I will look into it.
@@ -181,7 +187,7 @@ function configureCreateCommand(program) { | |||
dest = resolveLocalPath(dest); | |||
|
|||
try { | |||
await fs.ensureDir(dest); | |||
await fs.exists(dest); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if dest
is not a directory?
@@ -131,6 +131,8 @@ function createFunction( | |||
if (fs.existsSync(functionFilePath)) { | |||
logger.error(`The JavaScript file at "${functionFilePath}" already exists`); | |||
return; | |||
} else { | |||
fs.ensureFileSync(functionFilePath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So fs.ensureDir
in commands/create.js
will check if the directory exists and, if not, create it. This was the one case that relied on the folder being created by that. So when I changed it from fs.ensureDir
to fs.exists
this needed to be added to create the folder.
resolve(); | ||
}); | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing that I think is unclear here is that hs
is running vue
under the hood. I am not 100% sure that this adds a ton of value since the user has to have the vue CLI installed. If it does add value, I think we need to make it as clear as we can that the vue
CLI is be run by the hs
because if there is a problem it needs to be clear that the problem is with vue
not hs
.
I did some more research into vue including the With the release of vue v3, the vue-cli will be essentially deprecating the To @gcorne's comment about clarity of using Creating a project through the cms-vue-boilerplate and the cms-vue-module-template both allow subsequent addition of plugins through the With these points in mind, I'm thinking that the previous iteration of the I'm going to close this out in favor of the previous iteration that uses cms-vue-boilerplate which was reverted until we could look into templates more. |
This adds the
hs create vue-app <destinationFolder>
command which generates a boilerplate Vue module app using the vue-cli and the cms-vue-module-template repo. It is the equivalent of runningvue init HubSpot/cms-vue-module-template <destinationFolder>
.Fixes #217