-
-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Add README to generated project. #33
Conversation
@@ -47,6 +47,7 @@ module.exports = function(hostPath, appName, verbose) { | |||
); | |||
}); | |||
copySync(path.join(selfPath, 'index.html'), path.join(hostPath, 'index.html')); | |||
copySync(path.join(selfPath, 'README.md'), path.join(hostPath, 'README.md')) |
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.
I wanted to get some feedback on where we wanted to keep a README for the project itself.
I assume we don't want to just copy over the README from create-react-app
but rather a README that takes the user's app name and just lists out some basic getting started instructions.
I was going to put it in the ./src
but we're copying all of those files into the ./src
of the project, so I'd have to end up checking for it and omitting it.
Any thoughts?
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.
Yeah, let's do a separate directory for host setup, and put another README there that is more practical (basically a howto document).
Would it make sense to have all of the code that will be put into the user's project in one place? So instead of the following being in the root of the library:
You have something more like this:
That way when we're creating the user's files the method would be simpler, we can just |
Sounds like a good idea to me |
ok, I'm working on a |
path.join(selfPath, 'templateFiles', filename), | ||
path.join(hostPath, filename) | ||
) | ||
}) |
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.
Just as with the src
directory, all of the files within the templateFiles
directory will be put into the root of the project.
Hey @gaearon any idea why this travis test is failing on node 4 but not 6? |
Cool, should I hold off merging until this is fixed? |
Please do, I’m almost finished there. |
No prob! |
You’re good to go now, sorry for the interruption! |
Cool thanks, rebuilding now. I think this PR is to be reviewed |
@@ -13,7 +13,7 @@ | |||
"config", | |||
"scripts", | |||
"src", | |||
"index.html" | |||
"templateFiles" |
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 do you think about moving src
itself to templateFiles
?
Also I’d prefer template
to templateFiles
.
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.
yeah I guess the template
directory would be a good place for it, essentially a mirror of the default user app.
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.
If you go that way you’ll need to look for var relative =
and adjust those paths.
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.
kk, thanks for the tip. I'll hop on this later today after work.
@gaearon sorry this took so long! I think it's ready now. |
path.join(hostPath, 'src', filename) | ||
); | ||
}); | ||
copySync(path.join(selfPath, 'index.html'), path.join(hostPath, 'index.html')); | ||
fs.readdirSync(path.join(selfPath, 'template')).forEach(function(filename) { | ||
console.log('what even is this?', path.join(selfPath, 'template', filename)) |
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.
you probably don't want this log 😉
Thanks! |
Thanks for putting up with me :) |
Local npm start and npm run build got broken by #33
Local npm start and npm run build got broken by #33
Fixes #29