Programmatically get SUSHI version
- Dominant language
- JavaScript
- Stars
- 11
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
Transferred from internal JIRA issue originally created 2020-12-15.
Right now, we hardcode the SUSHI version that FSH Online is using. We may be able to use pre- or post- build steps to do this. From Chris when discussing this originally on the [pull request](https://github.com/FSHSchool/FSHOnline/pull/27):
The SUSHI version is known at build-time. I think we could find a way to inject it into the code during the build - so it's not hard-coded in our source, but looks hard-coded in the output. I'm thinking we could do that as a post-build script that does a replacement in the output file or maybe use [custom environment variables](https://create-react-app.dev/docs/adding-custom-environment-variables/)--maybe setting the SUSHI number programmatically as an env variable in a pre-build step... Anyway, I'm not sure the most elegant approach, and I don't think it has to be figured out in this PR, but I suspect we can come up with something.
BTW, I think we could pull the SUSHI version from the package-lock.json (but again, this would need to be handled during build rather than during runtime).
Contributor guide
Research direction
Start by reading package-lock.json and locating the existing build steps that produce the FSH Online output. Compare the current hardcoded SUSHI version with the build-time value, then verify that the generated output reports the package version without requiring a runtime lookup or a hardcoded source value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100