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

Version Project #724

Merged
merged 15 commits into from
Sep 21, 2020
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
!src
!package*.json
!tsconfig.json
!.env
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
REACT_APP_VERSION=$npm_package_version
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,21 @@ To generate a full report of the licenses used in production:
> npm run license-report
```

### Set Project Version

To update the version of the project:

1. Edit package.json `"version"` to a
[semantic versioning](https://docs.npmjs.com/about-semantic-versioning)
compatible string (e.g. `"0.1.1-alpha.0"`).
2. Run `npm install` to automatically updated `package-lock.json`.

To retrieve the current version of the project from the terminal:

```batch
> npm run --silent version
```

## Docker

### Requirements
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "thecombine",
"version": "0.1.0",
"version": "0.1.0-alpha.0",
"license": "MIT",
"private": true,
"scripts": {
Expand All @@ -25,7 +25,8 @@
"start": "npm install && npm-run-all --parallel frontend database api",
"test": "dotnet test Backend.Tests/Backend.Tests.csproj && react-scripts test",
"test:ci": "dotnet test Backend.Tests/Backend.Tests.csproj && CI=true react-scripts test --ci --all --testResultsProcessor jest-teamcity-reporter",
"test:debug": "react-scripts --inspect-brk test --runInBand --no-cache"
"test:debug": "react-scripts --inspect-brk test --runInBand --no-cache",
"version": "node -e console.log(require('./package.json').version);"
},
"dependencies": {
"@material-ui/core": "^4.11.0",
Expand Down
4 changes: 4 additions & 0 deletions src/components/AppBar/UserMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ interface UserMenuListProps {
* UserMenu options: site settings (for admins), user settings, log out
*/
export function UserMenuList(props: UserMenuListProps) {
const { REACT_APP_VERSION } = process.env;
return (
<React.Fragment>
{/* Only show Site Settings link to Admin users. */}
Expand Down Expand Up @@ -115,6 +116,9 @@ export function UserMenuList(props: UserMenuListProps) {
<ExitToApp style={{ marginRight: theme.spacing(1) }} />
<Translate id="userMenu.logout" />
</MenuItem>
<MenuItem disabled style={{ justifyContent: "center" }}>
v{REACT_APP_VERSION}
</MenuItem>
</React.Fragment>
);
}