Skip to content

Commit 5f13138

Browse files
committed
refactor: clean up a bit
1 parent 79352ad commit 5f13138

28 files changed

+492
-293
lines changed

eslint.config.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,19 @@ export default defineConfigWithVueTs(
4040
},
4141
"rules": {
4242

43+
/* Disabled rules */
44+
"vue/multi-word-component-names" : ["off"], // why do I need to use multiple words for a 'Layout' component, for example?
45+
"vue/no-multiple-template-root" : ["off"], // no need for this rule since Vue 3.x
46+
"unicorn/no-null" : ["off"], // the second argument of 'JSON#stringify' doesn't accept 'undefined' to save formatting
47+
"unicorn/prefer-global-this" : ["off"], // no need for this rule since this app is fully CSR, and Web Workers are not going to be used
48+
"unicorn/prefer-top-level-await" : ["off"], // top level await is broken somehow
49+
"unicorn/prefer-query-selector" : ["off"], // 'getElementById' is a lot easier to use
50+
"unicorn/prefer-at" : ["off"], // requires a different lib version
51+
"@stylistic/no-multi-spaces" : ["off"], // conflicts with 'eslint@stylistic/key-spacing'
52+
"@stylistic/line-comment-position": ["off"], // I don't see any problems using both above and beside comments
53+
"@stylistic/linebreak-style" : ["off"], // conflicts with git
54+
"@stylistic/eol-last" : ["off"], // conflicts with git
55+
4356
/* Important */
4457
"@stylistic/semi" : ["error", "always"],
4558
"@stylistic/no-confusing-arrow": ["error", {
@@ -91,20 +104,6 @@ export default defineConfigWithVueTs(
91104
],
92105
}],
93106

94-
/* Disabled rules */
95-
"vue/multi-word-component-names" : ["off"], // why do I need to use multiple words for a 'Layout' component, for example?
96-
"vue/no-multiple-template-root" : ["off"], // no need for this rule since Vue 3.x
97-
"unicorn/no-null" : ["off"], // the second argument of a 'JSON.stringify' doesn't accept 'undefined' to save formatting
98-
"unicorn/prefer-global-this" : ["off"], // no need for this rule since this app is fully CSR, and Web Workers are not going to be used
99-
"unicorn/prefer-top-level-await" : ["off"], // top level await is broken somehow
100-
"unicorn/prefer-query-selector" : ["off"], // 'getElementById' is a lot easier to use
101-
"unicorn/prefer-at" : ["off"], // requires a different lib version
102-
"@stylistic/no-multi-spaces" : ["off"], // conflicts with 'eslint@stylistic/key-spacing'
103-
"@stylistic/line-comment-position" : ["off"],
104-
"@stylistic/linebreak-style" : ["off"],
105-
"@stylistic/eol-last" : ["off"],
106-
"@stylistic/object-property-newline": ["off"],
107-
108107
/* TypeScript */
109108
"@typescript-eslint/explicit-function-return-type": ["warn"],
110109
"@typescript-eslint/no-unused-vars" : ["warn"],

src-tauri/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ Let me explain some properties in `tauri.conf.json`:
77
- `macOSPrivateApi` allows to make webview window transparent on macOS.
88
- `withGlobalTauri` adds Tauri internals to global `window` object. This is needed for extensions.
99
- `app.windows[0].visible` makes webview window hidden by default so that user will not see blank screen while webview and frontend are loading. I manually make it visible in the code (check `/src/main.ts`) once Vue finishes mounting.
10+
11+
Tauri API permissions are located in `./capabilities/`.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "../gen/schemas/desktop-schema.json",
3+
"identifier": "core-app",
4+
"description": "enables the core:app:* permissions",
5+
"windows": [
6+
"main"
7+
],
8+
"permissions": [
9+
"core:app:allow-app-hide",
10+
"core:app:allow-app-show",
11+
"core:app:allow-default-window-icon",
12+
"core:app:allow-name",
13+
"core:app:allow-set-app-theme",
14+
"core:app:allow-tauri-version",
15+
"core:app:allow-version"
16+
]
17+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "../gen/schemas/desktop-schema.json",
3+
"identifier": "core-event",
4+
"description": "enables the core:event:* permissions",
5+
"windows": [
6+
"main"
7+
],
8+
"permissions": [
9+
"core:event:allow-emit",
10+
"core:event:allow-emit-to",
11+
"core:event:allow-listen",
12+
"core:event:allow-unlisten"
13+
]
14+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "../gen/schemas/desktop-schema.json",
3+
"identifier": "core-image",
4+
"description": "enables the core:image:* permissions",
5+
"windows": [
6+
"main"
7+
],
8+
"permissions": [
9+
"core:image:allow-from-bytes",
10+
"core:image:allow-from-path",
11+
"core:image:allow-new",
12+
"core:image:allow-rgba",
13+
"core:image:allow-size"
14+
]
15+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"$schema": "../gen/schemas/desktop-schema.json",
3+
"identifier": "core-menu",
4+
"description": "enables the core:menu:* permissions",
5+
"windows": [
6+
"main"
7+
],
8+
"permissions": [
9+
"core:menu:allow-append",
10+
"core:menu:allow-create-default",
11+
"core:menu:allow-get",
12+
"core:menu:allow-insert",
13+
"core:menu:allow-is-checked",
14+
"core:menu:allow-is-enabled",
15+
"core:menu:allow-items",
16+
"core:menu:allow-new",
17+
"core:menu:allow-popup",
18+
"core:menu:allow-prepend",
19+
"core:menu:allow-remove",
20+
"core:menu:allow-remove-at",
21+
"core:menu:allow-set-accelerator",
22+
"core:menu:allow-set-as-app-menu",
23+
"core:menu:allow-set-as-help-menu-for-nsapp",
24+
"core:menu:allow-set-as-window-menu",
25+
"core:menu:allow-set-as-windows-menu-for-nsapp",
26+
"core:menu:allow-set-checked",
27+
"core:menu:allow-set-enabled",
28+
"core:menu:allow-set-icon",
29+
"core:menu:allow-set-text",
30+
"core:menu:allow-text"
31+
]
32+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$schema": "../gen/schemas/desktop-schema.json",
3+
"identifier": "core-path",
4+
"description": "enables the core:path:* permissions",
5+
"windows": [
6+
"main"
7+
],
8+
"permissions": [
9+
"core:path:allow-basename",
10+
"core:path:allow-dirname",
11+
"core:path:allow-extname",
12+
"core:path:allow-is-absolute",
13+
"core:path:allow-join",
14+
"core:path:allow-normalize",
15+
"core:path:allow-resolve",
16+
"core:path:allow-resolve-directory"
17+
]
18+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "../gen/schemas/desktop-schema.json",
3+
"identifier": "core-resources",
4+
"description": "enables the core:resources:* permissions",
5+
"windows": [
6+
"main"
7+
],
8+
"permissions": [
9+
"core:resources:allow-close"
10+
]
11+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "../gen/schemas/desktop-schema.json",
3+
"identifier": "core-tray",
4+
"description": "enables the core:tray:* permissions",
5+
"windows": [
6+
"main"
7+
],
8+
"permissions": [
9+
"core:tray:allow-get-by-id",
10+
"core:tray:allow-new",
11+
"core:tray:allow-remove-by-id",
12+
"core:tray:allow-set-icon",
13+
"core:tray:allow-set-icon-as-template",
14+
"core:tray:allow-set-menu",
15+
"core:tray:allow-set-show-menu-on-left-click",
16+
"core:tray:allow-set-temp-dir-path",
17+
"core:tray:allow-set-title",
18+
"core:tray:allow-set-tooltip",
19+
"core:tray:allow-set-visible"
20+
]
21+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"$schema": "../gen/schemas/desktop-schema.json",
3+
"identifier": "core-webview",
4+
"description": "enables the core:webview:* permissions",
5+
"windows": [
6+
"main"
7+
],
8+
"permissions": [
9+
"core:webview:allow-clear-all-browsing-data",
10+
"core:webview:allow-create-webview",
11+
"core:webview:allow-create-webview-window",
12+
"core:webview:allow-get-all-webviews",
13+
"core:webview:allow-internal-toggle-devtools",
14+
"core:webview:allow-print",
15+
"core:webview:allow-reparent",
16+
"core:webview:allow-set-webview-focus",
17+
"core:webview:allow-set-webview-position",
18+
"core:webview:allow-set-webview-size",
19+
"core:webview:allow-set-webview-zoom",
20+
"core:webview:allow-webview-close",
21+
"core:webview:allow-webview-hide",
22+
"core:webview:allow-webview-position",
23+
"core:webview:allow-webview-show",
24+
"core:webview:allow-webview-size"
25+
]
26+
}

0 commit comments

Comments
 (0)