add ci
This commit is contained in:
53
.woodpecker/ci.yml
Normal file
53
.woodpecker/ci.yml
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
steps:
|
||||||
|
- name: lint
|
||||||
|
image: node:24-slim
|
||||||
|
commands:
|
||||||
|
- npm ci
|
||||||
|
- npm run lint
|
||||||
|
when:
|
||||||
|
- event: pull_request
|
||||||
|
|
||||||
|
- name: test
|
||||||
|
image: node:24-slim
|
||||||
|
environment:
|
||||||
|
CI: "true"
|
||||||
|
commands:
|
||||||
|
- npm run test
|
||||||
|
when:
|
||||||
|
- event: pull_request
|
||||||
|
|
||||||
|
- name: e2e
|
||||||
|
image: mcr.microsoft.com/playwright:v1.58.2-noble
|
||||||
|
commands:
|
||||||
|
- npm ci
|
||||||
|
- npm run test:e2e
|
||||||
|
environment:
|
||||||
|
CI: "true"
|
||||||
|
NODE_TLS_REJECT_UNAUTHORIZED: "0"
|
||||||
|
when:
|
||||||
|
- event: pull_request
|
||||||
|
|
||||||
|
- name: docker-build
|
||||||
|
image: woodpeckerci/plugin-docker-buildx
|
||||||
|
privileged: true
|
||||||
|
settings:
|
||||||
|
repo: git.keligrubb.com/${CI_REPO_OWNER}/${CI_REPO_NAME}
|
||||||
|
registry: git.keligrubb.com
|
||||||
|
tags: latest
|
||||||
|
dry_run: true
|
||||||
|
when:
|
||||||
|
- event: pull_request
|
||||||
|
|
||||||
|
- name: docker-build-push
|
||||||
|
image: woodpeckerci/plugin-docker-buildx
|
||||||
|
privileged: true
|
||||||
|
settings:
|
||||||
|
repo: git.keligrubb.com/${CI_REPO_OWNER}/${CI_REPO_NAME}
|
||||||
|
registry: git.keligrubb.com
|
||||||
|
tags: latest,${CI_COMMIT_SHA:0:7}
|
||||||
|
username: ${CI_REPO_OWNER}
|
||||||
|
password:
|
||||||
|
from_secret: gitea_registry_token
|
||||||
|
when:
|
||||||
|
- event: push
|
||||||
|
- branch: main
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
export function useUser() {
|
export function useUser() {
|
||||||
// eslint-disable-next-line no-undef
|
|
||||||
const requestFetch = useRequestFetch()
|
const requestFetch = useRequestFetch()
|
||||||
const { data: user, refresh } = useAsyncData(
|
const { data: user, refresh } = useAsyncData(
|
||||||
'user',
|
'user',
|
||||||
|
|||||||
@@ -421,8 +421,11 @@ const deleteConfirmUser = ref(null)
|
|||||||
|
|
||||||
function setDropdownWrapRef(userId, el) {
|
function setDropdownWrapRef(userId, el) {
|
||||||
if (el) dropdownWrapRefs.value[userId] = el
|
if (el) dropdownWrapRefs.value[userId] = el
|
||||||
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
else {
|
||||||
else delete dropdownWrapRefs.value[userId]
|
dropdownWrapRefs.value = Object.fromEntries(
|
||||||
|
Object.entries(dropdownWrapRefs.value).filter(([k]) => k !== userId),
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(user, (u) => {
|
watch(user, (u) => {
|
||||||
@@ -484,8 +487,9 @@ async function saveRole(id) {
|
|||||||
try {
|
try {
|
||||||
await $fetch(`/api/users/${id}`, { method: 'PATCH', body: { role } })
|
await $fetch(`/api/users/${id}`, { method: 'PATCH', body: { role } })
|
||||||
await refreshUsers()
|
await refreshUsers()
|
||||||
const { [id]: _, ...rest } = pendingRoleUpdates.value
|
pendingRoleUpdates.value = Object.fromEntries(
|
||||||
pendingRoleUpdates.value = rest
|
Object.entries(pendingRoleUpdates.value).filter(([k]) => k !== id),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
// could set error state
|
// could set error state
|
||||||
|
|||||||
@@ -1,48 +1,5 @@
|
|||||||
import { createConfigForNuxt } from '@nuxt/eslint-config/flat'
|
import withNuxt from './.nuxt/eslint.config.mjs'
|
||||||
|
|
||||||
export default createConfigForNuxt({
|
export default withNuxt(
|
||||||
features: {
|
// Optional: custom rule overrides can go here
|
||||||
tooling: true,
|
)
|
||||||
stylistic: true,
|
|
||||||
},
|
|
||||||
}).prepend({
|
|
||||||
files: ['**/*.{js,vue}'],
|
|
||||||
languageOptions: {
|
|
||||||
globals: {
|
|
||||||
defineAppConfig: 'readonly',
|
|
||||||
defineNuxtConfig: 'readonly',
|
|
||||||
useFetch: 'readonly',
|
|
||||||
defineEventHandler: 'readonly',
|
|
||||||
useAsyncData: 'readonly',
|
|
||||||
defineNuxtRouteMiddleware: 'readonly',
|
|
||||||
defineNuxtPlugin: 'readonly',
|
|
||||||
useUser: 'readonly',
|
|
||||||
useRoute: 'readonly',
|
|
||||||
useRouter: 'readonly',
|
|
||||||
navigateTo: 'readonly',
|
|
||||||
createError: 'readonly',
|
|
||||||
clearNuxtData: 'readonly',
|
|
||||||
ref: 'readonly',
|
|
||||||
computed: 'readonly',
|
|
||||||
onMounted: 'readonly',
|
|
||||||
onBeforeUnmount: 'readonly',
|
|
||||||
nextTick: 'readonly',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}, {
|
|
||||||
files: ['server/**/*.js'],
|
|
||||||
languageOptions: {
|
|
||||||
globals: {
|
|
||||||
defineEventHandler: 'readonly',
|
|
||||||
createError: 'readonly',
|
|
||||||
readBody: 'readonly',
|
|
||||||
setResponseStatus: 'readonly',
|
|
||||||
getCookie: 'readonly',
|
|
||||||
setCookie: 'readonly',
|
|
||||||
deleteCookie: 'readonly',
|
|
||||||
getQuery: 'readonly',
|
|
||||||
getRequestURL: 'readonly',
|
|
||||||
sendRedirect: 'readonly',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const devCert = join(_dirname, '.dev-certs', 'cert.pem')
|
|||||||
const useDevHttps = existsSync(devKey) && existsSync(devCert)
|
const useDevHttps = existsSync(devKey) && existsSync(devCert)
|
||||||
|
|
||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
modules: ['@nuxtjs/tailwindcss', '@nuxt/test-utils/module', '@nuxt/icon'],
|
modules: ['@nuxtjs/tailwindcss', '@nuxt/test-utils/module', '@nuxt/icon', '@nuxt/eslint'],
|
||||||
devtools: { enabled: true },
|
devtools: { enabled: true },
|
||||||
app: {
|
app: {
|
||||||
head: {
|
head: {
|
||||||
@@ -55,4 +55,10 @@ export default defineNuxtConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
eslint: {
|
||||||
|
config: {
|
||||||
|
tooling: true,
|
||||||
|
stylistic: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
3907
package-lock.json
generated
3907
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
15
package.json
15
package.json
@@ -20,7 +20,6 @@
|
|||||||
"@nuxt/icon": "^2.2.1",
|
"@nuxt/icon": "^2.2.1",
|
||||||
"@nuxtjs/tailwindcss": "^6.14.0",
|
"@nuxtjs/tailwindcss": "^6.14.0",
|
||||||
"hls.js": "^1.5.0",
|
"hls.js": "^1.5.0",
|
||||||
"idb": "^8.0.0",
|
|
||||||
"leaflet": "^1.9.4",
|
"leaflet": "^1.9.4",
|
||||||
"leaflet.offline": "^3.2.0",
|
"leaflet.offline": "^3.2.0",
|
||||||
"mediasoup": "^3.19.14",
|
"mediasoup": "^3.19.14",
|
||||||
@@ -33,14 +32,16 @@
|
|||||||
"ws": "^8.18.0"
|
"ws": "^8.18.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nuxt/eslint-config": "^0.7.0",
|
"@nuxt/eslint": "^1.15.0",
|
||||||
"@nuxt/test-utils": "^3.14.0",
|
"@nuxt/test-utils": "^4.0.0",
|
||||||
"@playwright/test": "^1.58.2",
|
"@playwright/test": "^1.58.2",
|
||||||
"@vitest/coverage-v8": "^3.0.0",
|
"@vitest/coverage-v8": "^4.0.0",
|
||||||
"@vue/test-utils": "^2.4.0",
|
"@vue/test-utils": "^2.4.0",
|
||||||
"eslint": "^9.0.0",
|
"eslint": "^9.0.0",
|
||||||
"eslint-plugin-vue": "^9.0.0",
|
"happy-dom": "^20.6.1",
|
||||||
"happy-dom": "^15.0.0",
|
"vitest": "^4.0.0"
|
||||||
"vitest": "^3.0.0"
|
},
|
||||||
|
"overrides": {
|
||||||
|
"tar": "^7.5.7"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { migrateFeedsToDevices } from '../utils/migrateFeedsToDevices.js'
|
|||||||
* so credentials are printed in the terminal before any request.
|
* so credentials are printed in the terminal before any request.
|
||||||
* Close DB on server shutdown to avoid native sqlite3 crashes in worker teardown.
|
* Close DB on server shutdown to avoid native sqlite3 crashes in worker teardown.
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line no-undef
|
|
||||||
export default defineNitroPlugin((nitroApp) => {
|
export default defineNitroPlugin((nitroApp) => {
|
||||||
void getDb().then(() => migrateFeedsToDevices())
|
void getDb().then(() => migrateFeedsToDevices())
|
||||||
nitroApp.hooks.hook('close', () => {
|
nitroApp.hooks.hook('close', () => {
|
||||||
|
|||||||
@@ -86,7 +86,6 @@ export function broadcastToSession(sessionId, message) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line no-undef
|
|
||||||
export default defineNitroPlugin((nitroApp) => {
|
export default defineNitroPlugin((nitroApp) => {
|
||||||
nitroApp.hooks.hook('ready', async () => {
|
nitroApp.hooks.hook('ready', async () => {
|
||||||
const server = nitroApp.h3App.server || nitroApp.h3App.nodeServer
|
const server = nitroApp.h3App.server || nitroApp.h3App.nodeServer
|
||||||
|
|||||||
Reference in New Issue
Block a user