-
Notifications
You must be signed in to change notification settings - Fork 17
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
Remote templates #36
Remote templates #36
Conversation
npm-cli/.npmignore
Outdated
src/* | ||
share/* |
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.
Should just remove the share folder probably
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. It wouldn't hurt to publish the .re files to npm.
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.
Okay, I can just remove this from the ignore again then. They are not used in this PR anymore but I guess they don't hurt either?
npm-cli/src/Pesy.re
Outdated
if (Js.eqNullable(e, Js.Nullable.null)) { | ||
let id = Spinner.start("\x1b[2mRunning\x1b[0m esy pesy\x1b[2m and \x1b[0m building project dependencies"); | ||
exec("esy pesy", (e, stdout, stderr) => { | ||
let libKebab = packageNameKebabSansScope; |
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.
Everything from here is basically just refmt.
npm-cli/src/Pesy.re
Outdated
let id = Spinner.start("\x1b[2mRunning\x1b[0m esy pesy\x1b[2m and \x1b[0m building project dependencies"); | ||
exec("esy pesy", (e, stdout, stderr) => { | ||
let libKebab = packageNameKebabSansScope; | ||
let duneProjectFile = Path.(projectPath / "dune-project"); |
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 decided to keep generating a dune-project file and the .opam file, what do you think?
npm-cli/.npmignore
Outdated
src/* | ||
share/* |
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. It wouldn't hurt to publish the .re files to npm.
npm-cli/src/Pesy.re
Outdated
); | ||
|
||
let libKebab = packageNameKebabSansScope; | ||
let duneProjectFile = Path.(projectPath / "dune-project"); |
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.
Isn't dune-project
file a part of the hello-reason-pesy repo?
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.
It is, but in this case we're generating a dune-project
and package-name.opam
if the template doesn't include them for some reason.
But I could just remove these, in that case we could potentially support bucklescript as well if it works with esy
in the future.
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.
Well, then this brings up the issue of validation of the templates. For now let's track this in a separate issue and assume the template has all the files needed.
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.
e6628f0
to
0a668cb
Compare
I guess this will address #5 too |
let substituteFileNames = s => | ||
s | ||
|> Js.String.replaceByRe( | ||
[%bs.re "/__PACKAGE_NAME_FULL__/g"], |
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.
Why was this change in the template variable required? (__PACKAGE_NAME_FULL__
)
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.
Windows couldn't handle files named <PACKAGE_NAME_FULL>
so this is specific for file names, the in-file replaces are the same as before.
npm-cli/src/Pesy.re
Outdated
); | ||
|
||
let libKebab = packageNameKebabSansScope; | ||
let duneProjectFile = Path.(projectPath / "dune-project"); |
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.
Well, then this brings up the issue of validation of the templates. For now let's track this in a separate issue and assume the template has all the files needed.
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 noticed the template variables look different. Was it necessary?
The template variable change is only for the file names, it's the same inside the files. |
No description provided.