Compare commits

...

5 Commits

Author SHA1 Message Date
Thomas Rupprecht b0a2a4321e 0.9.3 2023-09-06 20:56:31 +02:00
Thomas Rupprecht 9d524dde4d fix(linting): add newer version of `addon-linter` via override to support newer browser APIs 2023-09-06 20:55:12 +02:00
Thomas Rupprecht a4a0db71c5 feat(linting): add `stylelint` and add check to lint script 2023-09-06 20:34:06 +02:00
Thomas Rupprecht db0faab4db refactor(storage): use `storage.session` instead of `storage.local` 2023-09-06 20:10:55 +02:00
Thomas Rupprecht 918cf7db91 chore(package): update @commitlint/{cli,config-conventional,cz-commitlint}, git-cliff 2023-09-02 00:09:42 +02:00
9 changed files with 1438 additions and 381 deletions

26
.stylelintrc.cjs Normal file
View File

@ -0,0 +1,26 @@
module.exports = {
extends: ["stylelint-config-standard"],
plugins: ["stylelint-plugin-defensive-css", "stylelint-plugin-logical-css"],
rules: {
"custom-property-empty-line-before": null,
"color-hex-length": "long",
"plugin/use-defensive-css": [true, {
"accidental-hover": false,
"background-repeat": true,
"custom-property-fallbacks": false,
"flex-wrapping": false,
"scroll-chaining": false,
"vendor-prefix-grouping": true
}],
"plugin/use-logical-properties-and-values": [true, {
"severity": "warning",
"disable-auto-fix": true,
"ignore": ["overflow-y", "overflow-x"]
}],
"plugin/use-logical-units": [true, {
"severity": "warning",
"disable-auto-fix": true,
"ignore": ["dvh", "dvw"]
}]
}
};

View File

@ -9,15 +9,18 @@ All notable changes to this project will be documented in this file.
- Add commitlint to enforce commit message format
- Update the changelog automatically on every commit
- Improve colors, refactor css, support rtl lang
- Add `stylelint` and add check to lint script
### 🐛 Bug Fixes
- Correctly update the changelog on release
- Add newer version of `addon-linter` via override to support newer browser APIs
### 🚜 Refactor
- Improve browser-polyfill inject
- Move homepage url to config
- Use `storage.session` instead of `storage.local`
### 📚 Documentation
@ -33,6 +36,8 @@ All notable changes to this project will be documented in this file.
- Update @commitlint/{cli,config-conventional}
- Update @commitlint/{cli,config-conventional}
- Update @commitlint/{cli,config-conventional,cz-commitlint}
- Update @commitlint/{cli,config-conventional,cz-commitlint}, git-cliff
## \[[0.9.2](https://gitea.usrspace.at/XimeX/usrspace-browser-addon/releases/tag/v0.9.2)] - 2023-05-24

1747
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,27 +1,38 @@
{
"name": "usrspace-browser-addon",
"description": "WebExtension for the Hacker-/Maker-Space /usr/space",
"version": "0.9.2",
"version": "0.9.3",
"dependencies": {
"webextension-polyfill": "^0.10.0"
},
"devDependencies": {
"@commitlint/cli": "^17.6.7",
"@commitlint/config-conventional": "^17.6.7",
"@commitlint/cz-commitlint": "^17.6.7",
"@commitlint/cli": "^17.7.1",
"@commitlint/config-conventional": "^17.7.0",
"@commitlint/cz-commitlint": "^17.7.1",
"@types/firefox-webext-browser": "^111.0.1",
"commitizen": "^4.3.0",
"git-cliff": "^1.2.0",
"git-cliff": "^1.3.0",
"husky": "^8.0.3",
"stylelint": "^15.10.3",
"stylelint-config-standard": "^34.0.0",
"stylelint-plugin-defensive-css": "^0.8.1",
"stylelint-plugin-logical-css": "^0.13.2",
"web-ext": "^7.6.2"
},
"overrides": {
"web-ext@^7.6.2": {
"addons-linter": "^6.12.0"
}
},
"scripts": {
"copy-browser-polyfill": "cp node_modules/webextension-polyfill/dist/browser-polyfill.js src/browser-polyfill.js",
"inject-browser-polyfill": "sed -i -r \"s#// \\[INJECT-BROWSER-POLYFILL]#import '\\./browser-polyfill\\.js';#\" src/*.js",
"uninject-browser-polyfill": "sed -i -r \"s#import '\\./browser-polyfill\\.js';#// \\[INJECT-BROWSER-POLYFILL]#\" src/*.js",
"copy-version": "sed -i 's/^\t\"version\": \".*\",$/\t\"version\": \"'$(rg '^\t\"version\": \"(.+)\",$' -r '$1' < package.json)'\",/' src/manifest.json",
"update-changelog": "npm exec git-cliff > CHANGELOG.md",
"lint": "web-ext lint -w",
"lint": "npm run lint:web-ext && npm run lint:css",
"lint:web-ext": "web-ext lint -w",
"lint:css": "stylelint \"src/*.css\"",
"test": "echo \"Error: no test specified\" && exit 0",
"watch:firefox": "web-ext run -t firefox-desktop",
"watch:firefox-android": "web-ext run -t firefox-android",

View File

@ -9,10 +9,6 @@ browser.runtime.onInstalled.addListener(async (details) => {
}
});
browser.runtime.onStartup.addListener(async () => {
await browser.storage.local.remove(['calendar', 'spaceApi']);
});
browser.alarms.onAlarm.addListener((alarm) => {
if (alarm.name === 'fetchData') {
fetchNewData();
@ -68,13 +64,13 @@ async function fetchNewData() {
/**
* @type {import("../types").Storage}
*/
const { spaceApi } = await browser.storage.local.get('spaceApi');
const { spaceApi } = await browser.storage.session.get('spaceApi');
if (spaceApi && spaceApi.state.open !== spaceApiJson.state.open) {
await createStatusChangedNotification(spaceApiJson.state.open);
}
}
await browser.storage.local.set({
await browser.storage.session.set({
calendar: calendarJson,
spaceApi: spaceApiJson,
});

View File

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* stylelint-disable */
/* Global */
html,
body {

View File

@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__",
"version": "0.9.2",
"version": "0.9.3",
"icons": {
"48": "icons/favicon.svg",
"96": "icons/favicon.svg"
@ -28,7 +28,7 @@
"browser_specific_settings": {
"gecko": {
"id": "{c9a907ad-a047-4cf6-8b5d-95097d31aa5b}",
"strict_min_version": "112.0"
"strict_min_version": "115.0"
}
}
}

View File

@ -48,7 +48,7 @@ body {
padding: 6px 12px;
color: var(--color);
background-color: var(--background);
font-family: 'Nunito Sans';
font-family: 'Nunito Sans', sans-serif;
}
section.no-padding {

View File

@ -57,7 +57,7 @@ async function init() {
/**
* @type {import("../types").Storage}
*/
const { calendar, spaceApi } = await browser.storage.local.get(['calendar', 'spaceApi']);
const { calendar, spaceApi } = await browser.storage.session.get(['calendar', 'spaceApi']);
if (calendar) {
updateNextEvent(calendar);