-
Notifications
You must be signed in to change notification settings - Fork 132
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
Undo removal of run.js #866
Undo removal of run.js #866
Conversation
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 a few comments about this overall.
Also, by reverting back to using files for |
yep makes sense. I wonder if there is a reason to use an absolute path, this problem shouldn’t happen with relative paths I guess |
I'm not sure absolute paths are needed, but it seemed like it might have been needed for |
I wouldn't like to fix a bug by introducing a regression, so I think that bug should also be fixed in this PR. |
Regarding tests: I think it would be also nice to have some tests for this, since it has grown now in logic. But the problem is that we would need different purescript versions and I am not sure how we would do that. |
I have added the escaping of the file name with spaces, which should fix the bug. I added also two more fixes for source maps and esm format on node when bundling modules. As it is right now, it is ready for review, but I still don't know how to write some test cases without refactoring the whole thing. Also I don't really know how to add a test for the |
Hi @f-f , do you have time to review this soon? It is currently blocking the |
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.
We can also comment out spago test temporarily in CI and only rely on spago build, switching to pulp test for the time being. After all, we need to add bower and pulp to all the contrib libraries too. That way @f-f can have some breathing room to review as he’s got a ton of things on his plate. |
Works for me! |
src/Spago/Cmd.hs
Outdated
import qualified Data.Versions as Version | ||
|
||
-- | Get the semantic version of a command, e.g. purs --version | ||
getCmdVersion :: Text -> RIO env (Either Text Version.SemVer) |
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.
Having a whole separate module only for this is a bit noisy - we usually hold all these utilities in our custom Spago.Prelude
, could we move this function there?
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 did this before, but then I ran into a cyclic dependency issue, that's why I had to create a separate module
@sigma-andex a few more notes:
|
This sounds like the easiest way forward. |
Removal of run.js interfered with cli programs. Generate run.mjs for projects >= 0.15 Relax es modules version constraint to 0.15.0-alpha-01
Co-authored-by: Fabrizio Ferrai <fabrizio.ferrai@gmail.com>
Other than 'thanks!', nope! 😄 |
This change forces the `build` command's `Env` arg to have more capabilities. For now, I've propagated that by granting it the `HasBuildEnv`, but that might be granting it too many capabilities.
- checkFixture and fixPackagesDhall works regardless of the number of nested dirs used - run and test tests run in another nested folder with space - run, test, bundle-app/module tests remain in original positions - run, test, bundle-app/module tests wrapped by a purs-0.15 label
Thanks @JordanMartinez for improving the diff! I'll have another look now 🙂 |
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.
Looks great now! Thanks everyone 👏
I think this is good to merge once we figure out the NPM stuff.
Ok. CI builds! 🎉 @f-f Since you previously approved this and the last thing to resolve--the NPM installation--has now been resolved, I'm going to merge this. |
Since the most recent commit gets rid of the metadata needed to install and runs |
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.
Wonderful, we're good to go! Thanks everyone for contributing to this 😊
I'll cut a release later today so we get to use this ASAP |
Description of the change
Undo #846 since this does not work in the case of cli commands, see this comment.
Use
run.mjs
in the case of es modules since otherwise this will fail if"type":"module"
is not set in thepackage.json
.Checklist:
README
P.S.: the above checks are not compulsory to get a change merged, so you may skip them. However, taking care of them will result in less work for the maintainers and will be much appreciated 😊