Skip to content

Commit 9a815c1

Browse files
committed
display version
1 parent 7d85bf6 commit 9a815c1

File tree

7 files changed

+26
-3
lines changed

7 files changed

+26
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "PhaseScript",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "",
55
"main": "dist/index.js",
66
"scripts": {

src/app/components/settings-editor/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import BaseComponent from 'common/util/base-component';
22
import dataStore from 'services/Store';
3+
import version from 'common/util/version';
34
import style from './settings-editor.css';
45
import markup from './settings-editor.html';
56

@@ -9,8 +10,9 @@ export default class SettingsEditor extends BaseComponent {
910
}
1011

1112
constructor(closeCallback) {
12-
super(style, markup, []);
13+
super(style, markup, [ 'version', ]);
1314
this.handleClose = closeCallback;
15+
this.dom.version.innerText = version;
1416
}
1517

1618
handleFontSizeChange(event) {

src/app/components/settings-editor/settings-editor.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,10 @@
2323
justify-content: flex-start;
2424
padding: 8px;
2525
}
26+
27+
.version {
28+
position: absolute;
29+
left: 0;
30+
bottom: 0;
31+
padding: 8px;
32+
}

src/app/components/settings-editor/settings-editor.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,8 @@
1919
>
2020
</text-input>
2121
</div>
22+
23+
<p class="version">
24+
<span>Version</span>
25+
<span id="version"></span>
26+
</p>

src/app/components/sound-root/sound-root.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
background-color: var(--color-black-light);
3131
border: var(--border-default);
3232
width: 400px;
33-
height: calc(100% - var(--topbar-height));
33+
height: calc(100% - var(--topbar-height) - 2px);
3434
transform: translateX(-100%);
3535
transition: transform 0.15s ease-out;
3636
}

src/common/util/Version.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// eslint-disable-next-line no-undef
2+
const version = VERSION;
3+
export default version;

webpack.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
const webpack = require('webpack');
22
const path = require('path');
3+
const packageJson = require('./package.json');
4+
5+
const { version } = packageJson;
36

47
const webpackConfig = {
58
context: path.resolve(__dirname, 'src'),
@@ -35,6 +38,9 @@ const webpackConfig = {
3538
port: 3001
3639
},
3740
mode: process.env.WEBPACK_SERVE ? 'development' : 'production',
41+
plugins: [
42+
new webpack.DefinePlugin({ VERSION: JSON.stringify(version) })
43+
]
3844
};
3945

4046
module.exports = webpackConfig;

0 commit comments

Comments
 (0)