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

Removal of Babel for back-end build inhibits building Hajk on Windows #1483

Closed
sweco-semara opened this issue Mar 8, 2024 · 7 comments · Fixed by #1484
Closed

Removal of Babel for back-end build inhibits building Hajk on Windows #1483

sweco-semara opened this issue Mar 8, 2024 · 7 comments · Fixed by #1484
Labels
Milestone

Comments

@sweco-semara
Copy link
Contributor

sweco-semara commented Mar 8, 2024

Describe the bug
Since removal of Babel for dist-copy of back-end, Hajk no longer builds with a standard Windows toolchain.

To Reproduce

  1. Check out current develop on Windows
  2. Use e.g. CMD to build:
cd new-backend
npm i
npm run compile
  1. Platform-specific commands for build script "compile" fails (rm not present unless using bash terminal etc.)

Expected behavior
Expect cross-platform build scripts.

Additional context
Should be a minor fix to reintroduce cross-platform build. E.g. using rimraf for recursive dist removal and conditional copy commands for recursive server to dist copy, or just using shx as a devDependency to get *nix style tools availability in a cross-platform manner.

@jesade-vbg
Copy link
Contributor

Interesting. It sure looks like that. The main reason for this to get unnoticed for so long is the fact that most of the active developers in Hajk either uses bash or similar, or git-bash on windows.

@Hallbergs
Copy link
Member

Nice catch! As @jesade-vbg said, i've missed it since im using bash

@sweco-semara
Copy link
Contributor Author

Yes sure, me too (git-bash). Not a problem, I just stumbled accross this and will contribute a small shx fix.

@Hallbergs
Copy link
Member

Great! 🥳

sweco-semara added a commit to sweco-se/hajk-fork that referenced this issue Mar 8, 2024
* Re-introduces e.g. Windows CMD compile capability for Hajk's back-end
* Fixes hajkmap#1483 after Babel removal (Hajk's RFC1/2 clean-up project)
@sweco-semara sweco-semara linked a pull request Mar 8, 2024 that will close this issue
sweco-semara added a commit to sweco-se/hajk-fork that referenced this issue Mar 8, 2024
* Re-introduces e.g. Windows CMD compile capability for Hajk's back-end
* Fixes hajkmap#1483 after Babel removal (Hajk's RFC1/2 clean-up project)
@jacobwod
Copy link
Member

jacobwod commented Mar 8, 2024

Valid point. We actually talked about it today and thought that "everyone [read: everyone who is an active Hajk developer uses Git bash anyway, so go for POSIX-style commands". 😄 But obviously there are cases (build chain) where we end up with CMD and the current commands won't work.

I trust you regarding the proposed solution (shx). 👍

Just out of curiosity: wouldn't current commands work on PowerShell? Or is it that CMD is still the standard shell on Windows?

@Hallbergs Hallbergs added this to the 3.13 milestone Mar 11, 2024
@sweco-semara
Copy link
Contributor Author

sweco-semara commented Mar 14, 2024

@jacobwod Sorry, missed your question. No unfortunately the "rm -rf" command does not work in PowerShell either. There is a simple "rm" alias in PS as well as "rmdir" but they both refer to Remove-Item cmdlet that can't parse the combined parameters. The current Hajk cp command would work in PS since that is a Copy-Item alias and using only one command-line parameter allows for the abbreviation to work so "cp -r" is PS-compatible. (But e.g. "cp -fr" would not be, it would have to be "cp -f -r" (=Copy-Item -Force -Recursive) in PS - pretty stupid, but that's how it is...).

Regarding standard console it's highly dependent on deploy pipeline/process so to be flexible for Windows Server it's recommended that Hajk can handle both.

@jacobwod
Copy link
Member

Thanks and no worries @sweco-semara! 😄 It's merged and confirmed working as intended (here, in ZSH):

Skärmavbild 2024-03-14 kl  07 40 52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants