I’ve found this guide to be the most helpful. Should the above two references be updated to follow this workflow?
I’m attempting to update the first guide, and want to clarify what prereqs are needed to launch the repl.
Edit: Found yarn spago repl, so disregard the rest of this message.
Should purescript still be installed with npm or yarn globally, or should I find a way to temporarily add the project’s specific version (located in node_modules/purescript/purs.bin) to $PATH?
Here’s a log of what happens when attempting to launch the repl if purescript is only installed via yarn as described in the first post:
> purs repl
Command 'purs' not found
> node_modules/purescript/purs.bin --version
0.13.3
> node_modules/purescript/purs.bin repl
purs repl: No input files; try running `pulp psci` instead.
For help getting started, visit https://github.com/purescript/documentation/blob/master/guides/PSCi.md
Usage: For basic information, try the `--help' option.
> pulp psci
Command 'pulp' not found
Yea, looks like the yarn ... commands are what you’re looking for if you want to run locally-installed tooling in your project. As far as updating the getting started guides, I opened an issue about adding this guide, but it hasn’t seen much progress yet.
Ultimately I think of this as my recommendation, but not necessarily something that would work as an official ‘PureScript’ stance. Still, I think it deserves a place somewhere in the official docs.
Unfortunately, I’m struggling to get spago bundle-app working (see default.nix):
purs bundle: No input files.
[error] Bundle failed.
Please let me know if you have suggestions!
Edit: that error was due to missing \ on line 28. Now I get a new error:
Couldn't find a CommonJS module for the specified main module: Example.Main
[error] Bundle failed.
I think this is because there is no Example in dist, but if I try to call spago without --no-install --no-build, it fails due to no internet connectivity in sandbox.
I agree that more opinionation would really improve the new user experience.
There’s currently no clear pathway to getting a web app running from the purescript.org landing page, even for users who read through both the quick start guide and the documentation page.
Something like create-react-app would be great. For now, it could just be a template clone command.
This would favor a particular toolchain and framework, but I don’t think that’s worse than the existing alternative of no direction. The unfairness could be partially remedied with a link to a “more frameworks” page.
Having official templates would also help focus everyone’s maintenance efforts and be a consistent springboard for tutorials.
For example, it would be nice if we could arrive at best practices from each of these 7 reasonable Halogen templates and track one of them under the purescript-contrib org.
@milesfrain great points!
I opened this issue in Spago to track the addition of the --template flag as you mentioned in your post. I’ve been holding off on tracking this because I was not sure if it was a widespread need (vs just my feeling), but it looks like it would improve UX so I’d be happy to see this happening
Since this thread is about opinionated recommendations, which editor / IDE would you recommend for PureScript development?
I’m a long time Sublime Text user, but I have found the ST plugin quite lacking. There is no auto-import, the import auto-complete is close to useless, the error reporting hover window comes out once every full moon and sometimes it gets stuck completely and I have to pkill -f purs.ide.server. I might as well keep it only for the syntax highlighting and just use some other aiding tool, such as the aforementioned pscid.
I’m conversant with Python, so I might pick up the ST plugin in the future and work on it, but for now I’m still learning PureScript, so I’d like to at least know what the state of the art is.
As of 2020, which IDE has the best integration, meaning the best auto-complete, auto-import, error reporting, type information, pop-up documentation, jump to definition, and such features?
I had this issue when I was using emacs as well. Have you tried enabling the option psc-ide-editor-mode (which may be named some what differently in vscode). I believe that fixed the issue of needing to restart the server for me
I’m using coc.nvim with purescript-language-server and I’m really pleased with it. Has all of the listed features and if I need to rebuild the project after installing a new dependency for example, I then just issues :CocRestart to refresh, but I think in theory it should pick up the new dependencies automatically.