Skip to content
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

Deploy website via fluid command-line #1057

Closed
3 tasks done
rolyp opened this issue Aug 20, 2024 · 11 comments
Closed
3 tasks done

Deploy website via fluid command-line #1057

rolyp opened this issue Aug 20, 2024 · 11 comments

Comments

@rolyp
Copy link
Collaborator

rolyp commented Aug 20, 2024

Overview

Want to be able to import fluid as an npm package, and publish / test websites that way, instead of by bundling all of fluid, and forcing the user to download the Purescript compiler. Instead, we want to be able to build websites locally, supply them with fluid as a library, and then run them as we would expect. Currently, we are able to do this in the local project, and as an npm package, but have yet to test calling the script by using the fluid command-line tool that gets supplied to a consumer of the npm package.

Done/dropped:

Also:

@rolyp rolyp mentioned this issue Aug 20, 2024
10 tasks
@rolyp rolyp changed the title command-line tool fluid command-line tool Aug 20, 2024
@rolyp rolyp added this to Fluid Aug 20, 2024
@github-project-automation github-project-automation bot moved this to Proposed in Fluid Aug 20, 2024
@rolyp rolyp moved this from Proposed to In Progress in Fluid Aug 20, 2024
@rolyp rolyp added this to the v0.7.5 Internships 2024 milestone Aug 20, 2024
@rolyp
Copy link
Collaborator Author

rolyp commented Aug 20, 2024

Hi @ColinC-UoE:

  • Clarified the tasks above: I don’t think we need to check the --global behaviour, it’s enough to know that after yarn install fluid into a fresh repo, we can yarn fluid.
  • Added a link to optparse, the standard PureScript library for parsing command-line arguments. We can use this to process our single command-line argument (to make it mandatory, emit a help string, etc). Let’s go for the simplest possible thing here.

@rolyp
Copy link
Collaborator Author

rolyp commented Aug 22, 2024

Hi @ColinC-UoE. Do you want to start capturing some new subtasks above? I think it might be worth posting a question about purescript-optparse to the PureScript discourse, so let’s add that as a potential to do (we can decide later whether to bother). Then it’s probably worth experimenting with commander (although maybe do a very quick look at alternatives to check that this is the best option). There doesn’t seem to be a PureScript wrapper for commander, so we can write our own – i.e. a Commander.js and Commander.purs that exports just the method(s) we initially need, and simplifying where appropriate/feasible.

Btw, how did you get on with testing the command-line after yarn install fluid into a fresh repo?

@ColinC-UoE
Copy link
Collaborator

Hi @ColinC-UoE. Do you want to start capturing some new subtasks above? I think it might be worth posting a question about purescript-optparse to the PureScript discourse, so let’s add that as a potential to do (we can decide later whether to bother). Then it’s probably worth experimenting with commander (although maybe do a very quick look at alternatives to check that this is the best option). There doesn’t seem to be a PureScript wrapper for commander, so we can write our own – i.e. a Commander.js and Commander.purs that exports just the method(s) we initially need, and simplifying where appropriate/feasible.

Btw, how did you get on with testing the command-line after yarn install fluid into a fresh repo?

I've added some subtasks now.
Currently, I'm thinking the effort put into purescript-optparse is not worth the limited time left.
command-line-args is another alternative with some popularity, but more lightweight than commander. I'll try out commander first, though.
Another reason I'm leaning towards abandoning purescript-optparse is that I would want to undo all the dependency installations that are causing the compilation errors, which means I cannot properly test the command line feature after a yarn install fluid since I would need to build.

@rolyp
Copy link
Collaborator Author

rolyp commented Aug 22, 2024

I agree, purescript-optparse would only be worth pursuing if a new version of the library were released that fixed the packaging/dependencies problem.

For a pure NPM solution, yargs also looks promising.

@ColinC-UoE
Copy link
Collaborator

I had a look into yargs and opted for commander in the end as it appeared more straight forward to use.
After some investigation, it seems JavaScript is not made to be able to access local user files for security reasons, so I'm unsure how a user may have their .yml file be read.

@rolyp
Copy link
Collaborator Author

rolyp commented Aug 22, 2024

Ok, sounds good. Re. file loading, yes front-end Node apps (which have been bundled to run in the browser) aren’t able to access the file system. But if you’re compiling for Node itself (backend JavaScript) you should have access to the file system – I think it depends on how you build the app. (I thought just --platform=node would be enough but I don’t know much about this.)

@ColinC-UoE
Copy link
Collaborator

Ah ha. I kept my search terms to "JavaScript ..." so none of the results mentioned Node.

@rolyp rolyp moved this from In Progress to Paused in Fluid Sep 3, 2024
@rolyp rolyp moved this from Paused to In Progress in Fluid Sep 6, 2024
@rolyp rolyp moved this from In Progress to Paused in Fluid Sep 11, 2024
@rolyp rolyp removed this from the v0.7.4 Website update milestone Sep 24, 2024
@rolyp rolyp moved this from Paused to Planned in Fluid Sep 25, 2024
@rolyp rolyp changed the title fluid command-line tool Command-line publishing tool Nov 7, 2024
@rolyp
Copy link
Collaborator Author

rolyp commented Nov 13, 2024

Done/dropped:

  • fluid.js hosts webpage using express or http-serve dist/article (see puppeteer.js)
  • May need to deploy artifact in deploy.yml or merge deploy into build.yml to ensure build data is preserved [Note: Resolved by including dist/article in NPM publish?]
  • NPM Upload -> Download NPM package -> Point npx http-serve to serve dist/article -> Check webpage loads
    • Include dist/article when publishing to NPM
  • Get publish-single.sh to accept Fluid.purs located in Publish folder
  • Get local authorisation key to locally publish to NPM (N.B. npm login -> copy provided link into browser and log in)
  • Quick investigation into command line parser packages
  • Install fluid into fresh NPM project without global flag to check yarn fluid works
  • Command accepts only 1 argument
  • Command initially does nothing and returns via exit 0
  • Command accepts .yml filename as argument but does nothing with it (command format: node fluid <filename>.yml)
  • Command accepts .yml filename as argument and only returns 0 if file exists (otherwise reports error)

@rolyp rolyp added this to the transparent-text 0.2 milestone Dec 14, 2024
@rolyp rolyp changed the title Command-line publishing tool Deploy website via fluid command-line Dec 14, 2024
@rolyp
Copy link
Collaborator Author

rolyp commented Dec 14, 2024

Renamed from “Command-line publishing tool” and moved into transparent-text 0.2 milestone.

@JosephBond JosephBond removed the status in Fluid Dec 16, 2024
@JosephBond JosephBond moved this to In Progress in Fluid Dec 16, 2024
@rolyp
Copy link
Collaborator Author

rolyp commented Dec 18, 2024

Moved to fluid 0.7.next milestone.

@JosephBond
Copy link
Collaborator

Closing as completed, further work to be found under #1203

@github-project-automation github-project-automation bot moved this from In Progress to Done in Fluid Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

3 participants