Skip to content

Commit

Permalink
feat: check for new releases (ActivityWatch/activitywatch#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
billangli committed Aug 15, 2020
1 parent 5e1afd8 commit b9fe58b
Show file tree
Hide file tree
Showing 15 changed files with 369 additions and 84 deletions.
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@

.FORCE: ;

# This is to disable check for new release in aw-webui for aw-android
ifdef ON_ANDROID
# The following flag will pass --android as a command line argument to vue-cli-service
# https://docs.npmjs.com/cli/run-script
androidflag := -- --os=android
else
androidflag :=
endif

build: install
npm run build
npm run build ${androidflag}

install:
npm ci
Expand All @@ -12,7 +21,7 @@ uninstall:
rm -r node_modules/

dev:
npm run serve
npm run serve ${androidflag}

test:
npm test
Expand Down
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
// TODO: We should try to switch to the @vue/app preset, but right now it breaks everything
//presets: ['@vue/app'],
presets: ['@vue/cli-plugin-babel/preset'],
plugins: ['lodash', '@babel/plugin-syntax-dynamic-import'],
comments: false,
};
26 changes: 23 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
// Tests can be added in the aw-webui/test folder
// File names that end with .test.js will be run in the jsdom testEnvironment
// File names that end with .test.node.js will be run in the node testEnvironment

module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
projects: [
{
displayName: 'jsdom',
preset: '@vue/cli-plugin-unit-jest',
testEnvironment: 'jsdom',
transform: {
'^.+\\.js$': 'babel-jest',
'^.+\\.vue$': 'vue-jest'
},
testMatch: ['**/test/**/*.test.js?(x)']
},
{
displayName: 'node',
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/test/**/*.test.node.js?(x)'],
}
],
};
159 changes: 84 additions & 75 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"test": "jest --rootDir=src",
"test": "jest --rootDir=./",
"test:unit": "vue-cli-service test:unit",
"test:e2e": "vue-cli-service test:e2e",
"lint": "vue-cli-service lint",
Expand Down Expand Up @@ -39,8 +39,8 @@
"css-loader": "^3.6.0",
"eslint": "^6.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1",
"eslint-plugin-jest": "^23.18",
"eslint-plugin-prettier": "^3.1",
"eslint-plugin-vue": "^6.2",
"eventsource-polyfill": "^0.9.6",
"express": "^4.16.3",
Expand Down
2 changes: 2 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ div#wrapper

div.container.aw-container.my-3.py-3
error-boundary
new-release-notification(v-if="isNewReleaseCheckEnabled")
router-view

div.container(style="color: #555")
Expand Down Expand Up @@ -43,6 +44,7 @@ export default {
return {
activityViews: [],
info: {},
isNewReleaseCheckEnabled: !process.env.VUE_APP_ON_ANDROID,
};
},
Expand Down

0 comments on commit b9fe58b

Please sign in to comment.