MetaCell / MetaCell/nwb-explorer
Implement dynamic version injection
- Dominant language
- JavaScript
- Stars
- 27
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
Pure frontend strategy using env variables
Inside the Docker image:
```Dockerfile
RUN VERSION=$(grep version setup.py | sed 's/^.*version="//g' | sed 's/\",//g') &&\
npm run build --env.VERSION=$VERSION --env.COMMIT=$COMMIT
```
Inside the webpack:
```javascript
module.exports = function (env){
if (env === undefined) {
env = {}
}
if (!env.COMMIT) {
env.COMMIT = 'x.x.x'
}
if (!env.VERSION) {
env.VERSION = PACKAGE.version
}
...
```
Then use the following to get version
```javascript
const PRESENT_COMMIT = process.env.COMMIT;
const PRESENT_VERSION = process.env.VERSION;
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the Dockerfile, webpack configuration, setup.py, and the npm build entry point referenced in the issue. Trace how VERSION and COMMIT reach the frontend, then verify that a Docker build injects both values and that the frontend can read them through the shown environment variables.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, javascript, webpack
- Domain
- build-system, frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100