Skip to content

Commit

Permalink
chore: Generate separate file to store version
Browse files Browse the repository at this point in the history
Closes #848
  • Loading branch information
meltyshev committed Aug 13, 2024
1 parent 4841a65 commit da727c0
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 12 deletions.
1 change: 0 additions & 1 deletion client/.env

This file was deleted.

4 changes: 2 additions & 2 deletions client/src/components/UserSettingsModal/AboutPane.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { useTranslation } from 'react-i18next';
import { Image, Tab } from 'semantic-ui-react';

import Config from '../../constants/Config';
import version from '../../version';

import logo from '../../assets/images/logo.png';

Expand All @@ -15,7 +15,7 @@ const AboutPane = React.memo(() => {
<Tab.Pane attached={false} className={styles.wrapper}>
<Image centered src={logo} size="large" />
<div className={styles.version}>
{t('common.version')} {Config.VERSION}
{t('common.version')} {version}
</div>
</Tab.Pane>
);
Expand Down
3 changes: 0 additions & 3 deletions client/src/constants/Config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const VERSION = process.env.REACT_APP_VERSION;

const { BASE_URL } = window;
const BASE_PATH = BASE_URL.replace(/^.*\/\/[^/]*(.*)[^?#]*.*$/, '$1');

Expand All @@ -18,7 +16,6 @@ const POSITION_GAP = 65535;
const ACTIVITIES_LIMIT = 50;

export default {
VERSION,
BASE_PATH,
SERVER_BASE_URL,
SERVER_BASE_PATH,
Expand Down
1 change: 1 addition & 0 deletions client/src/version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default '1.21.0';
1 change: 1 addition & 0 deletions client/version-template.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default '<%= pkg.version %>';
120 changes: 114 additions & 6 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"client:test": "npm test --prefix client",
"docker:build": "docker build -t ghcr.io/plankanban/planka:local -f Dockerfile .",
"docker:build:base": "docker build -t ghcr.io/plankanban/planka:base-local -f Dockerfile.base .",
"gv": "genversion --source ./ --template client/version-template.ejs client/src/version.js",
"postinstall": "(cd server && npm i && cd ../client && npm i)",
"lint": "npm run server:lint && npm run client:lint",
"prepare": "husky",
Expand Down Expand Up @@ -57,6 +58,7 @@
},
"dependencies": {
"concurrently": "^8.2.2",
"genversion": "^3.2.0",
"husky": "^9.0.1",
"lint-staged": "^15.2.5"
},
Expand Down

0 comments on commit da727c0

Please sign in to comment.