Skip to content

Commit b9fe58b

Browse files
committed
feat: check for new releases (ActivityWatch/activitywatch#114)
1 parent 5e1afd8 commit b9fe58b

15 files changed

+369
-84
lines changed

Makefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,17 @@
22

33
.FORCE: ;
44

5+
# This is to disable check for new release in aw-webui for aw-android
6+
ifdef ON_ANDROID
7+
# The following flag will pass --android as a command line argument to vue-cli-service
8+
# https://docs.npmjs.com/cli/run-script
9+
androidflag := -- --os=android
10+
else
11+
androidflag :=
12+
endif
13+
514
build: install
6-
npm run build
15+
npm run build ${androidflag}
716

817
install:
918
npm ci
@@ -12,7 +21,7 @@ uninstall:
1221
rm -r node_modules/
1322

1423
dev:
15-
npm run serve
24+
npm run serve ${androidflag}
1625

1726
test:
1827
npm test

babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module.exports = {
22
// TODO: We should try to switch to the @vue/app preset, but right now it breaks everything
33
//presets: ['@vue/app'],
4+
presets: ['@vue/cli-plugin-babel/preset'],
45
plugins: ['lodash', '@babel/plugin-syntax-dynamic-import'],
56
comments: false,
67
};

jest.config.js

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,24 @@
1+
// Tests can be added in the aw-webui/test folder
2+
// File names that end with .test.js will be run in the jsdom testEnvironment
3+
// File names that end with .test.node.js will be run in the node testEnvironment
4+
15
module.exports = {
2-
preset: 'ts-jest',
3-
testEnvironment: 'node',
4-
};
6+
projects: [
7+
{
8+
displayName: 'jsdom',
9+
preset: '@vue/cli-plugin-unit-jest',
10+
testEnvironment: 'jsdom',
11+
transform: {
12+
'^.+\\.js$': 'babel-jest',
13+
'^.+\\.vue$': 'vue-jest'
14+
},
15+
testMatch: ['**/test/**/*.test.js?(x)']
16+
},
17+
{
18+
displayName: 'node',
19+
preset: 'ts-jest',
20+
testEnvironment: 'node',
21+
testMatch: ['**/test/**/*.test.node.js?(x)'],
22+
}
23+
],
24+
};

package-lock.json

Lines changed: 84 additions & 75 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"scripts": {
99
"serve": "vue-cli-service serve",
1010
"build": "vue-cli-service build",
11-
"test": "jest --rootDir=src",
11+
"test": "jest --rootDir=./",
1212
"test:unit": "vue-cli-service test:unit",
1313
"test:e2e": "vue-cli-service test:e2e",
1414
"lint": "vue-cli-service lint",
@@ -39,8 +39,8 @@
3939
"css-loader": "^3.6.0",
4040
"eslint": "^6.0",
4141
"eslint-config-prettier": "^6.11.0",
42-
"eslint-plugin-prettier": "^3.1",
4342
"eslint-plugin-jest": "^23.18",
43+
"eslint-plugin-prettier": "^3.1",
4444
"eslint-plugin-vue": "^6.2",
4545
"eventsource-polyfill": "^0.9.6",
4646
"express": "^4.16.3",

src/App.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ div#wrapper
44

55
div.container.aw-container.my-3.py-3
66
error-boundary
7+
new-release-notification(v-if="isNewReleaseCheckEnabled")
78
router-view
89

910
div.container(style="color: #555")
@@ -43,6 +44,7 @@ export default {
4344
return {
4445
activityViews: [],
4546
info: {},
47+
isNewReleaseCheckEnabled: !process.env.VUE_APP_ON_ANDROID,
4648
};
4749
},
4850

0 commit comments

Comments
 (0)