@d-mok/quasar-app-extension-quasar-axe 4.1.47 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.prettierrc.json +7 -0
- package/README.md +19 -0
- package/package.json +49 -40
- package/src/index.ts +49 -0
- package/src/install.ts +14 -0
- package/src/templates/src/boot/axe/AutoReg.ts +6 -4
- package/src/templates/src/boot/axe/AutoRoute.ts +41 -92
- package/src/templates/src/boot/axe/Interceptor.ts +20 -19
- package/src/templates/src/boot/axe/LoadEnd.ts +3 -4
- package/src/templates/src/boot/axe/LoadStart.ts +3 -4
- package/src/templates/src/boot/axe/QueryProps.ts +78 -0
- package/src/templates/src/utils/index.ts +1 -2
- package/src/templates/src/utils/puppets/index.ts +13 -11
- package/src/templates/src/utils/storage.ts +5 -1
- package/src/templates/src/utils/supabase.ts +3 -3
- package/src/uninstall.ts +13 -0
- package/tsconfig.json +24 -76
- package/.gitattributes +0 -2
- package/shims-vue.d.ts +0 -5
- package/src/index.js +0 -41
- package/src/install.js +0 -6
- package/src/prompts.js +0 -3
- package/src/templates/src/utils/extension.ts +0 -13
- package/src/uninstall.js +0 -5
package/.prettierrc.json
ADDED
package/README.md
ADDED
package/package.json
CHANGED
|
@@ -1,40 +1,49 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@d-mok/quasar-app-extension-quasar-axe",
|
|
3
|
+
"version": "5.0.0",
|
|
4
|
+
"description": "A Quasar App Extension",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"imports": {
|
|
8
|
+
"#q-app": "@quasar/app-vite"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@clack/prompts": "^1.4.0",
|
|
12
|
+
"@handsontable/vue3": "^15.3.0",
|
|
13
|
+
"@supabase/supabase-js": "^2.118.0",
|
|
14
|
+
"@types/webpack-env": "^1.18.8",
|
|
15
|
+
"@vueuse/core": "^15.0.0",
|
|
16
|
+
"@vueuse/integrations": "^15.0.0",
|
|
17
|
+
"@vueuse/router": "^15.0.0",
|
|
18
|
+
"handsontable": "^15.3.0",
|
|
19
|
+
"jszip": "^3.10.2",
|
|
20
|
+
"sapphire-js": "^3.0.3",
|
|
21
|
+
"sortablejs": "^1.15.7",
|
|
22
|
+
"valibot": "^1.5.0",
|
|
23
|
+
"zod": "^4.6.7"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@quasar/app-vite": "^3.10.3",
|
|
27
|
+
"quasar": "^2.35.2",
|
|
28
|
+
"vite": "^8.3.5",
|
|
29
|
+
"vue": "^3.5.39",
|
|
30
|
+
"vue-router": "^5.0.6"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"@quasar/app-vite": "^3.5.0"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">= 26 || ^24 || ^22.12"
|
|
37
|
+
},
|
|
38
|
+
"prettier": {
|
|
39
|
+
"tabWidth": 4,
|
|
40
|
+
"semi": false,
|
|
41
|
+
"singleQuote": true,
|
|
42
|
+
"arrowParens": "avoid",
|
|
43
|
+
"singleAttributePerLine": true
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"publish-package": "pnpm publish --access public && pnpm version patch --no-git-tag-version",
|
|
47
|
+
"login": "pnpm login"
|
|
48
|
+
}
|
|
49
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quasar App Extension index/runner script
|
|
3
|
+
* (runs on each dev/build)
|
|
4
|
+
*
|
|
5
|
+
* Docs: https://quasar.dev/app-extensions/development-guide/index-api
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { defineIndexScript } from '#q-app'
|
|
9
|
+
|
|
10
|
+
// can be async
|
|
11
|
+
export default defineIndexScript(api => {
|
|
12
|
+
api.extendQuasarConf(conf => {
|
|
13
|
+
const hostBoot = conf.boot ?? []
|
|
14
|
+
conf.boot = []
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
boot: [
|
|
18
|
+
'axe/LoadStart',
|
|
19
|
+
'axe/Interceptor',
|
|
20
|
+
'axe/AutoReg',
|
|
21
|
+
'axe/AutoRoute',
|
|
22
|
+
'axe/QueryProps',
|
|
23
|
+
...hostBoot,
|
|
24
|
+
'axe/LoadEnd',
|
|
25
|
+
],
|
|
26
|
+
framework: {
|
|
27
|
+
plugins: ['AppVisibility', 'Notify', 'Dialog', 'LoadingBar'],
|
|
28
|
+
config: {
|
|
29
|
+
loadingBar: {
|
|
30
|
+
position: 'top',
|
|
31
|
+
color: 'white',
|
|
32
|
+
size: '5px',
|
|
33
|
+
skipHijack: true,
|
|
34
|
+
},
|
|
35
|
+
notify: {},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
animations: ['fadeIn', 'fadeOut', 'zoomIn', 'zoomOut'],
|
|
39
|
+
build: {
|
|
40
|
+
viteVuePluginOptions: {
|
|
41
|
+
script: {
|
|
42
|
+
defineModel: true,
|
|
43
|
+
propsDestructure: true,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
})
|
package/src/install.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quasar App Extension install script
|
|
3
|
+
* https://quasar.dev/app-extensions/development-guide/install-api
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { defineInstallScript } from '#q-app'
|
|
7
|
+
|
|
8
|
+
// can be async
|
|
9
|
+
export default defineInstallScript(api => {
|
|
10
|
+
api.compatibleWith('quasar', '^2.0.0')
|
|
11
|
+
api.compatibleWith('@quasar/app-vite', '^3.0.0 || ^2.0.0')
|
|
12
|
+
api.render('./templates')
|
|
13
|
+
api.onExitLog('Thanks for installing quasar-axe!')
|
|
14
|
+
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineBoot } from '#q-app'
|
|
2
2
|
|
|
3
3
|
function pascal(s: string): string {
|
|
4
4
|
return s
|
|
@@ -7,11 +7,13 @@ function pascal(s: string): string {
|
|
|
7
7
|
.replace(/\.\w+$/, '')
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
export default defineBoot(({ app }) => {
|
|
11
|
+
console.log('[QuasarAxe] Run Boot AutoReg')
|
|
11
12
|
|
|
12
|
-
const components = import.meta.glob<any>('
|
|
13
|
+
const components = import.meta.glob<any>('./../../**/*.vue', {
|
|
14
|
+
eager: true,
|
|
15
|
+
})
|
|
13
16
|
|
|
14
|
-
export default boot(({ app }) => {
|
|
15
17
|
for (let path in components) {
|
|
16
18
|
app.component(pascal(path), components[path].default)
|
|
17
19
|
}
|
|
@@ -1,58 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
LocationQuery,
|
|
4
|
-
RouteLocationNormalizedGeneric,
|
|
5
|
-
RouteRecordRaw,
|
|
6
|
-
} from 'vue-router'
|
|
1
|
+
import { defineBoot } from '#q-app'
|
|
7
2
|
|
|
8
|
-
|
|
3
|
+
import { RouteRecordRaw } from 'vue-router'
|
|
9
4
|
|
|
10
|
-
|
|
5
|
+
export default defineBoot(({ router }) => {
|
|
6
|
+
if (!import.meta.env.QCLI_HOME_ROUTE)
|
|
7
|
+
throw 'Missing HOME_ROUTE in process.env!'
|
|
11
8
|
|
|
12
|
-
|
|
9
|
+
const HOME_ROUTE = import.meta.env.QCLI_HOME_ROUTE ?? '/'
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
...import.meta.glob('src/layouts/*.vue', { eager: true, query: '?raw' }),
|
|
16
|
-
...import.meta.glob('src/pages/**/*.vue', { eager: true, query: '?raw' }),
|
|
17
|
-
}
|
|
11
|
+
console.log('[QuasarAxe] Run Boot AutoRoute')
|
|
18
12
|
|
|
19
|
-
function parse(glob: Record<string, { default: any }>) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
})
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const [layoutMaster] = parse(
|
|
41
|
-
import.meta.glob('src/boot/axe/LayoutMaster.vue', { eager: true }),
|
|
42
|
-
)
|
|
43
|
-
const layouts = parse(import.meta.glob('src/layouts/*.vue', { eager: true }))
|
|
44
|
-
const pages = parse(import.meta.glob('src/pages/**/*.vue', { eager: true }))
|
|
13
|
+
function parse(glob: Record<string, { default: any }>) {
|
|
14
|
+
return Object.entries(glob).map(([filepath, val]) => {
|
|
15
|
+
const filename = filepath
|
|
16
|
+
.split('/')
|
|
17
|
+
.at(-1)!
|
|
18
|
+
.replace(/\.\w+$/, '')
|
|
19
|
+
const name = filename.toLowerCase().replace('_', '') // for underscore pages
|
|
20
|
+
return {
|
|
21
|
+
filepath,
|
|
22
|
+
filename,
|
|
23
|
+
// for raw route record
|
|
24
|
+
component: val.default,
|
|
25
|
+
path: '/' + name, // absolute path
|
|
26
|
+
name: name,
|
|
27
|
+
children: [] as RouteRecordRaw[],
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
}
|
|
45
31
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
32
|
+
const [layoutMaster] = parse(
|
|
33
|
+
import.meta.glob('./../../boot/axe/LayoutMaster.vue', { eager: true }),
|
|
34
|
+
)
|
|
35
|
+
const layouts = parse(
|
|
36
|
+
import.meta.glob('./../../layouts/*.vue', { eager: true }),
|
|
49
37
|
)
|
|
50
|
-
|
|
38
|
+
const pages = parse(
|
|
39
|
+
import.meta.glob('./../../pages/**/*.vue', { eager: true }),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
for (const layout of layouts) {
|
|
43
|
+
layout.children = pages.filter($ =>
|
|
44
|
+
$.filepath.includes('pages/' + layout.filename),
|
|
45
|
+
)
|
|
46
|
+
}
|
|
51
47
|
|
|
52
|
-
console.
|
|
53
|
-
console.
|
|
48
|
+
if (import.meta.env.QUASAR_DEBUG) console.log('[QuasarAxe] Routes:')
|
|
49
|
+
if (import.meta.env.QUASAR_DEBUG) console.log(layouts)
|
|
54
50
|
|
|
55
|
-
export default boot(({ app, router }) => {
|
|
56
51
|
router.addRoute({
|
|
57
52
|
component: layoutMaster?.component,
|
|
58
53
|
path: '/',
|
|
@@ -69,49 +64,3 @@ export default boot(({ app, router }) => {
|
|
|
69
64
|
],
|
|
70
65
|
})
|
|
71
66
|
})
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* HELPER FUNCTIONS
|
|
75
|
-
*/
|
|
76
|
-
|
|
77
|
-
function getProps(filetext: string, query: LocationQuery) {
|
|
78
|
-
const text = filetext
|
|
79
|
-
.replaceAll(' ', '')
|
|
80
|
-
.replaceAll('\n', '')
|
|
81
|
-
.between('defineProps<', '>()')
|
|
82
|
-
.join('')
|
|
83
|
-
const casted: Record<
|
|
84
|
-
string,
|
|
85
|
-
string | number | boolean | string[] | number[] | boolean[]
|
|
86
|
-
> = {}
|
|
87
|
-
for (const k in query) {
|
|
88
|
-
let v = query[k]
|
|
89
|
-
if (v === undefined) continue
|
|
90
|
-
if (!Array.isArray(v)) {
|
|
91
|
-
v = [v]
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const keys = {
|
|
95
|
-
':number[]': v.map(Number),
|
|
96
|
-
':number': Number(v[0]),
|
|
97
|
-
':boolean[]': v.map($ => $ === 'true'),
|
|
98
|
-
':boolean': v[0] === 'true',
|
|
99
|
-
':string[]': v.map(String),
|
|
100
|
-
':string': String(v[0]),
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
for (const [type, val] of Object.entries(keys)) {
|
|
104
|
-
if (text.includes(k + type) || text.includes(k + '?' + type)) {
|
|
105
|
-
casted[k] = val
|
|
106
|
-
break
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if (Object.keys(casted).length > 0) {
|
|
112
|
-
console.dev('[Route] Query Props:')
|
|
113
|
-
console.dev(casted)
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return casted
|
|
117
|
-
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LoadingBar } from 'quasar'
|
|
1
|
+
import { defineBoot } from '#q-app'
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
import { LoadingBar } from 'quasar'
|
|
5
4
|
|
|
6
5
|
declare global {
|
|
7
6
|
interface XMLHttpRequest {
|
|
@@ -11,7 +10,7 @@ declare global {
|
|
|
11
10
|
|
|
12
11
|
export function setAjaxInterceptor(
|
|
13
12
|
onStart: (_: XMLHttpRequest) => void,
|
|
14
|
-
onEnd: (_: XMLHttpRequest) => void
|
|
13
|
+
onEnd: (_: XMLHttpRequest) => void,
|
|
15
14
|
) {
|
|
16
15
|
var open = window.XMLHttpRequest.prototype.open
|
|
17
16
|
var send = window.XMLHttpRequest.prototype.send
|
|
@@ -37,7 +36,7 @@ export function setAjaxInterceptor(
|
|
|
37
36
|
|
|
38
37
|
export function setFetchInterceptor(
|
|
39
38
|
onStart: (..._: Parameters<typeof window.fetch>) => void,
|
|
40
|
-
onEnd: (..._: Parameters<typeof window.fetch>) => void
|
|
39
|
+
onEnd: (..._: Parameters<typeof window.fetch>) => void,
|
|
41
40
|
) {
|
|
42
41
|
const oldFetch = window.fetch
|
|
43
42
|
|
|
@@ -75,24 +74,26 @@ setAjaxInterceptor(
|
|
|
75
74
|
if (!isLogRocket(request)) {
|
|
76
75
|
LoadingBar.stop()
|
|
77
76
|
}
|
|
78
|
-
}
|
|
77
|
+
},
|
|
79
78
|
)
|
|
80
79
|
|
|
81
80
|
function isPosthog(url: URL | RequestInfo): boolean {
|
|
82
81
|
return typeof url === 'string' && url.startsWith('https://us.i.posthog.com')
|
|
83
82
|
}
|
|
84
83
|
|
|
85
|
-
|
|
86
|
-
(
|
|
87
|
-
let url = args[0]
|
|
88
|
-
if (isPosthog(url)) return
|
|
89
|
-
LoadingBar.start()
|
|
90
|
-
},
|
|
91
|
-
(...args) => {
|
|
92
|
-
let url = args[0]
|
|
93
|
-
if (isPosthog(url)) return
|
|
94
|
-
LoadingBar.stop()
|
|
95
|
-
}
|
|
96
|
-
)
|
|
84
|
+
export default defineBoot(({ app, router }) => {
|
|
85
|
+
console.log('[QuasarAxe] Run Boot Interceptor')
|
|
97
86
|
|
|
98
|
-
|
|
87
|
+
setFetchInterceptor(
|
|
88
|
+
(...args) => {
|
|
89
|
+
let url = args[0]
|
|
90
|
+
if (isPosthog(url)) return
|
|
91
|
+
LoadingBar.start()
|
|
92
|
+
},
|
|
93
|
+
(...args) => {
|
|
94
|
+
let url = args[0]
|
|
95
|
+
if (isPosthog(url)) return
|
|
96
|
+
LoadingBar.stop()
|
|
97
|
+
},
|
|
98
|
+
)
|
|
99
|
+
})
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineBoot } from '#q-app'
|
|
2
2
|
import { qNotify } from '../../utils'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export default boot(({ app }) => {
|
|
4
|
+
export default defineBoot(({ app }) => {
|
|
5
|
+
console.log('[QuasarAxe] Run Boot LoadEnd')
|
|
7
6
|
qNotify.unload()
|
|
8
7
|
})
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineBoot } from '#q-app'
|
|
2
2
|
import { qNotify } from '../../utils'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export default boot(({ app }) => {
|
|
4
|
+
export default defineBoot(({ app }) => {
|
|
5
|
+
console.log('[QuasarAxe] Run Boot LoadStart')
|
|
7
6
|
qNotify.load()
|
|
8
7
|
})
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { defineBoot } from '#q-app'
|
|
2
|
+
|
|
3
|
+
import { LocationQuery, RouteLocationNormalizedGeneric } from 'vue-router'
|
|
4
|
+
|
|
5
|
+
export default defineBoot(({ router }) => {
|
|
6
|
+
console.log('[QuasarAxe] Run Boot QueryProps')
|
|
7
|
+
|
|
8
|
+
const globTexts: Record<string, string> = Object.mapKeys(
|
|
9
|
+
Object.mapValues(
|
|
10
|
+
{
|
|
11
|
+
...import.meta.glob('./../../layouts/*.vue', {
|
|
12
|
+
eager: true,
|
|
13
|
+
query: '?raw',
|
|
14
|
+
}),
|
|
15
|
+
...import.meta.glob('./../../pages/**/*.vue', {
|
|
16
|
+
eager: true,
|
|
17
|
+
query: '?raw',
|
|
18
|
+
}),
|
|
19
|
+
} as Record<string, { default: string }>,
|
|
20
|
+
(v, k) => v.default,
|
|
21
|
+
),
|
|
22
|
+
(v, k) => String(k).split('/').nth(-1)?.replace('.vue', '') ?? '',
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
for (const route of router.getRoutes()) {
|
|
26
|
+
const path = route.path.split('/').nth(-1) ?? route.path
|
|
27
|
+
const filetext = globTexts[path] ?? ''
|
|
28
|
+
route.props.default = (to: RouteLocationNormalizedGeneric) => {
|
|
29
|
+
return getProps(filetext, to.query)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* HELPER FUNCTIONS
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
function getProps(filetext: string, query: LocationQuery) {
|
|
39
|
+
const text = filetext
|
|
40
|
+
.replaceAll(' ', '')
|
|
41
|
+
.replaceAll('\n', '')
|
|
42
|
+
.between('defineProps<', '>()')
|
|
43
|
+
.join('')
|
|
44
|
+
const casted: Record<
|
|
45
|
+
string,
|
|
46
|
+
string | number | boolean | string[] | number[] | boolean[]
|
|
47
|
+
> = {}
|
|
48
|
+
for (const k in query) {
|
|
49
|
+
let v = query[k]
|
|
50
|
+
if (v === undefined) continue
|
|
51
|
+
if (!Array.isArray(v)) {
|
|
52
|
+
v = [v]
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const keys = {
|
|
56
|
+
':number[]': v.map(Number),
|
|
57
|
+
':number': Number(v[0]),
|
|
58
|
+
':boolean[]': v.map($ => $ === 'true'),
|
|
59
|
+
':boolean': v[0] === 'true',
|
|
60
|
+
':string[]': v.map(String),
|
|
61
|
+
':string': String(v[0]),
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
for (const [type, val] of Object.entries(keys)) {
|
|
65
|
+
if (text.includes(k + type) || text.includes(k + '?' + type)) {
|
|
66
|
+
casted[k] = val
|
|
67
|
+
break
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (Object.keys(casted).length > 0) {
|
|
73
|
+
if (import.meta.env.QUASAR_DEBUG) console.log('[Route] Query Props:')
|
|
74
|
+
if (import.meta.env.QUASAR_DEBUG) console.log(casted)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return casted
|
|
78
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import 'sapphire-js'
|
|
2
|
-
import './extension'
|
|
3
2
|
|
|
4
3
|
export { qDialog } from './dialog'
|
|
5
4
|
export * as qNotify from './notify'
|
|
@@ -10,7 +9,7 @@ export { ORM } from './puppets'
|
|
|
10
9
|
|
|
11
10
|
import { supabase } from './supabase'
|
|
12
11
|
|
|
13
|
-
if (
|
|
12
|
+
if (import.meta.env.QUASAR_DEBUG) {
|
|
14
13
|
// @ts-ignore
|
|
15
14
|
globalThis.supabase = supabase
|
|
16
15
|
}
|
|
@@ -4,7 +4,7 @@ import { qDialog } from '../dialog'
|
|
|
4
4
|
import * as qNotify from '../notify'
|
|
5
5
|
import { LoadingBar } from 'quasar'
|
|
6
6
|
|
|
7
|
-
import type { PostgrestFilterBuilder } from '@supabase/
|
|
7
|
+
import type { PostgrestFilterBuilder } from '@supabase/supabase-js'
|
|
8
8
|
|
|
9
9
|
type Constructor<T extends object = {}> = new (...args: any[]) => T
|
|
10
10
|
|
|
@@ -88,7 +88,7 @@ export function ORM<
|
|
|
88
88
|
reactive(): this {
|
|
89
89
|
const rec = reactive(this) as this
|
|
90
90
|
tableMaster.set(this.uuid, rec)
|
|
91
|
-
if (
|
|
91
|
+
if (import.meta.env.QUASAR_DEBUG) {
|
|
92
92
|
// @ts-ignore
|
|
93
93
|
globalThis.TABLES.push(rec)
|
|
94
94
|
}
|
|
@@ -151,7 +151,8 @@ export function ORM<
|
|
|
151
151
|
qNotify.toast(n)
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
if (import.meta.env.QUASAR_DEBUG)
|
|
155
|
+
console.log(`[${tableName}] ${logType}`, entities)
|
|
155
156
|
|
|
156
157
|
return entities
|
|
157
158
|
}
|
|
@@ -238,7 +239,7 @@ export function ORM<
|
|
|
238
239
|
return await this.wrapper('insert', options, async () => {
|
|
239
240
|
const data: R[] = await supabase
|
|
240
241
|
.from(tableName)
|
|
241
|
-
.insert(rows.map($ => this.onSanitize($)))
|
|
242
|
+
.insert(rows.map($ => this.onSanitize($)) as any)
|
|
242
243
|
.select(fields)
|
|
243
244
|
.then(handleError)
|
|
244
245
|
|
|
@@ -268,8 +269,8 @@ export function ORM<
|
|
|
268
269
|
async () => {
|
|
269
270
|
const data: R = await supabase
|
|
270
271
|
.from(tableName)
|
|
271
|
-
.update(this.onSanitize(row))
|
|
272
|
-
.eq(idKey, idVal as any)
|
|
272
|
+
.update(this.onSanitize(row) as any)
|
|
273
|
+
.eq(idKey as string, idVal as any)
|
|
273
274
|
.select(fields)
|
|
274
275
|
.single()
|
|
275
276
|
.then(handleError)
|
|
@@ -292,7 +293,7 @@ export function ORM<
|
|
|
292
293
|
const data: R = await supabase
|
|
293
294
|
.from(tableName)
|
|
294
295
|
.delete()
|
|
295
|
-
.eq(idKey, idVal as any)
|
|
296
|
+
.eq(idKey as string, idVal as any)
|
|
296
297
|
.select(fields)
|
|
297
298
|
.single()
|
|
298
299
|
.then(handleError)
|
|
@@ -338,14 +339,15 @@ export function ORM<
|
|
|
338
339
|
return TableClass
|
|
339
340
|
}
|
|
340
341
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
342
|
+
if (import.meta.env.QUASAR_DEBUG)
|
|
343
|
+
console.log(
|
|
344
|
+
`Create Table [${tableName}] idKey [${idKey}] entity [${E.name}]`,
|
|
345
|
+
)
|
|
344
346
|
|
|
345
347
|
return { Entity: E, Table: getTable }
|
|
346
348
|
}
|
|
347
349
|
|
|
348
|
-
if (
|
|
350
|
+
if (import.meta.env.QUASAR_DEBUG) {
|
|
349
351
|
// @ts-ignore
|
|
350
352
|
globalThis.TABLES = []
|
|
351
353
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { supabase, handleError } from '.'
|
|
2
2
|
import { reactive } from 'vue'
|
|
3
|
-
import {
|
|
3
|
+
import type { SupabaseClient } from '@supabase/supabase-js'
|
|
4
4
|
import { mimeTypesToExt } from './mimeTypesToExt'
|
|
5
5
|
|
|
6
|
+
type FileOptions = NonNullable<
|
|
7
|
+
Parameters<ReturnType<SupabaseClient['storage']['from']>['upload']>[2]
|
|
8
|
+
>
|
|
9
|
+
|
|
6
10
|
export class SupabaseBucket extends Map<string, string> {
|
|
7
11
|
constructor(public bucketName: string) {
|
|
8
12
|
super()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PostgrestError, SupabaseClient } from '@supabase/supabase-js'
|
|
2
2
|
import { qDialog } from './dialog'
|
|
3
3
|
|
|
4
|
-
let SUPABASE_URL =
|
|
5
|
-
let SUPABASE_KEY =
|
|
4
|
+
let SUPABASE_URL = import.meta.env.QCLI_SUPABASE_URL ?? ''
|
|
5
|
+
let SUPABASE_KEY = import.meta.env.QCLI_SUPABASE_KEY ?? ''
|
|
6
6
|
|
|
7
7
|
export class MySupabaseClient extends SupabaseClient {
|
|
8
8
|
email: string = 'unauthenticated'
|
|
@@ -11,7 +11,7 @@ export class MySupabaseClient extends SupabaseClient {
|
|
|
11
11
|
super(SUPABASE_URL, SUPABASE_KEY, {
|
|
12
12
|
db: {
|
|
13
13
|
// @ts-ignore
|
|
14
|
-
schema:
|
|
14
|
+
schema: import.meta.env.QCLI_SUPABASE_SCHEMA ?? 'public',
|
|
15
15
|
},
|
|
16
16
|
})
|
|
17
17
|
this.auth.onAuthStateChange((event, session) => {
|
package/src/uninstall.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quasar App Extension uninstall script
|
|
3
|
+
* https://quasar.dev/app-extensions/development-guide/uninstall-api
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { defineUninstallScript } from '#q-app'
|
|
7
|
+
|
|
8
|
+
// can be async
|
|
9
|
+
export default defineUninstallScript(api => {
|
|
10
|
+
api.removePath('./src/utils')
|
|
11
|
+
api.removePath('src/boot/axe')
|
|
12
|
+
api.onExitLog('Thanks for using quasar-axe! ByeBye!')
|
|
13
|
+
})
|
package/tsconfig.json
CHANGED
|
@@ -1,76 +1,24 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"isolatedModules": true /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */,
|
|
26
|
-
|
|
27
|
-
/* Strict Type-Checking Options */
|
|
28
|
-
"strict": true /* Enable all strict type-checking options. */,
|
|
29
|
-
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
|
30
|
-
// "strictNullChecks": true, /* Enable strict null checks. */
|
|
31
|
-
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
|
|
32
|
-
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
|
|
33
|
-
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
|
|
34
|
-
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
|
|
35
|
-
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
|
36
|
-
|
|
37
|
-
/* Additional Checks */
|
|
38
|
-
// "noUnusedLocals": true, /* Report errors on unused locals. */
|
|
39
|
-
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
|
40
|
-
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
|
41
|
-
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
|
42
|
-
"noUncheckedIndexedAccess": true /* Include 'undefined' in index signature results */,
|
|
43
|
-
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an 'override' modifier. */
|
|
44
|
-
// "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */
|
|
45
|
-
|
|
46
|
-
/* Module Resolution Options */
|
|
47
|
-
// "moduleResolution": "nodenext" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
|
|
48
|
-
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
|
49
|
-
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
|
50
|
-
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
|
51
|
-
// "typeRoots": [], /* List of folders to include type definitions from. */
|
|
52
|
-
"types": [
|
|
53
|
-
"quasar",
|
|
54
|
-
"webpack-env",
|
|
55
|
-
"vite/client"
|
|
56
|
-
] /* Type declaration files to be included in compilation. */,
|
|
57
|
-
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
|
58
|
-
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
|
|
59
|
-
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
|
60
|
-
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
61
|
-
|
|
62
|
-
/* Source Map Options */
|
|
63
|
-
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
|
64
|
-
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
65
|
-
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
|
|
66
|
-
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
|
|
67
|
-
|
|
68
|
-
/* Experimental Options */
|
|
69
|
-
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
|
70
|
-
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
|
71
|
-
|
|
72
|
-
/* Advanced Options */
|
|
73
|
-
"skipLibCheck": true /* Skip type checking of declaration files. */,
|
|
74
|
-
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
|
|
75
|
-
}
|
|
76
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"esModuleInterop": true,
|
|
4
|
+
"skipLibCheck": true,
|
|
5
|
+
"target": "esnext",
|
|
6
|
+
"allowJs": true,
|
|
7
|
+
"resolveJsonModule": true,
|
|
8
|
+
"moduleDetection": "force",
|
|
9
|
+
"moduleResolution": "bundler",
|
|
10
|
+
"isolatedModules": true,
|
|
11
|
+
"module": "preserve",
|
|
12
|
+
"noEmit": true,
|
|
13
|
+
"lib": ["esnext", "dom", "dom.iterable"],
|
|
14
|
+
"strict": true,
|
|
15
|
+
"allowUnreachableCode": false,
|
|
16
|
+
"allowUnusedLabels": false,
|
|
17
|
+
"noImplicitOverride": true,
|
|
18
|
+
"exactOptionalPropertyTypes": true,
|
|
19
|
+
"noUncheckedIndexedAccess": true,
|
|
20
|
+
"types": ["vite/client"]
|
|
21
|
+
},
|
|
22
|
+
"include": ["./src/**/*"],
|
|
23
|
+
"exclude": ["./node_modules"]
|
|
24
|
+
}
|
package/.gitattributes
DELETED
package/shims-vue.d.ts
DELETED
package/src/index.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
function extendQuasarConf(conf, prompts) {
|
|
2
|
-
for (let b of ['AutoRoute', 'AutoReg', 'Interceptor'])
|
|
3
|
-
conf.boot.unshift(`axe/${b}`)
|
|
4
|
-
// console.log('[QuasarAxe] Config pushed Boots')
|
|
5
|
-
conf.boot.unshift('axe/LoadStart')
|
|
6
|
-
conf.boot.push('axe/LoadEnd')
|
|
7
|
-
|
|
8
|
-
conf.framework.plugins.push(
|
|
9
|
-
'AppVisibility',
|
|
10
|
-
'Notify',
|
|
11
|
-
'Dialog',
|
|
12
|
-
'LoadingBar'
|
|
13
|
-
)
|
|
14
|
-
// console.log('[QuasarAxe] Config pushed framework.plugins')
|
|
15
|
-
|
|
16
|
-
conf.framework.config.loadingBar = {
|
|
17
|
-
position: 'top',
|
|
18
|
-
color: 'white',
|
|
19
|
-
size: '5px',
|
|
20
|
-
skipHijack: true,
|
|
21
|
-
}
|
|
22
|
-
conf.framework.config.notify = {}
|
|
23
|
-
// console.log('[QuasarAxe] Config pushed framework.config')
|
|
24
|
-
|
|
25
|
-
conf.animations.push('fadeIn', 'fadeOut', 'zoomIn', 'zoomOut')
|
|
26
|
-
// console.log('[QuasarAxe] Config pushed animations')
|
|
27
|
-
|
|
28
|
-
conf.build.viteVuePluginOptions = {
|
|
29
|
-
script: {
|
|
30
|
-
defineModel: true,
|
|
31
|
-
propsDestructure: true,
|
|
32
|
-
},
|
|
33
|
-
}
|
|
34
|
-
// console.log('[QuasarAxe] Config pushed viteVuePluginOptions')
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
module.exports = function (api) {
|
|
38
|
-
api.compatibleWith('quasar', '^2.0.0')
|
|
39
|
-
api.compatibleWith('@quasar/app-vite', '^1.0.0 || ^2.0.0')
|
|
40
|
-
api.extendQuasarConf(conf => extendQuasarConf(conf, api.prompts))
|
|
41
|
-
}
|
package/src/install.js
DELETED
package/src/prompts.js
DELETED