diff --git a/.github/workflows/build_and_release.yml b/.github/workflows/build_and_release.yml index 4a9e795..d3c6dca 100644 --- a/.github/workflows/build_and_release.yml +++ b/.github/workflows/build_and_release.yml @@ -10,11 +10,11 @@ permissions: contents: write jobs: - test: - uses: markmybytes/install-it/.github/workflows/test.yml@main + checks: + uses: markmybytes/install-it/.github/workflows/ci.yml@main build: - needs: test + needs: checks runs-on: windows-latest env: BUILD_NAME: windows-x64 @@ -23,7 +23,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Set up Go environment uses: actions/setup-go@v6 diff --git a/.github/workflows/test.yml b/.github/workflows/ci.yml similarity index 57% rename from .github/workflows/test.yml rename to .github/workflows/ci.yml index f37b284..bfa6907 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/ci.yml @@ -1,13 +1,19 @@ -name: Test +name: CI on: pull_request: branches: [main] + push: + branches: [main] workflow_call: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: go-test: - name: Go tests + name: Go checks runs-on: windows-latest steps: - name: Checkout repository @@ -18,6 +24,15 @@ jobs: with: go-version-file: "go.mod" + # frontend/dist is generated by wails build, not committed, required by //go:embed. + - name: Scaffold embed assets + run: | + New-Item -ItemType Directory -Force -Path frontend/dist | Out-Null + Set-Content -Path frontend/dist/.gitkeep -Value "" + + - name: Run vet + run: go vet ./... + - name: Generate PCI ID database run: go generate ./pkg/sysinfo/... @@ -25,7 +40,7 @@ jobs: run: go test ./pkg/... frontend-test: - name: Frontend tests + name: Frontend checks runs-on: ubuntu-latest defaults: run: @@ -44,5 +59,14 @@ jobs: - name: Install dependencies run: npm ci + - name: Run lint + run: npm run lint + + - name: Check formatting + run: npm run format:check + + - name: Run type-check + run: npm run type-check + - name: Run tests run: npm test diff --git a/frontend/.gitignore b/frontend/.gitignore index 2f2620a..8ee54e8 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -28,7 +28,3 @@ coverage *.sw? *.tsbuildinfo - -# Auto-generated type declarations -auto-imports.d.ts -components.d.ts diff --git a/frontend/auto-imports.d.ts b/frontend/auto-imports.d.ts new file mode 100644 index 0000000..7758900 --- /dev/null +++ b/frontend/auto-imports.d.ts @@ -0,0 +1,97 @@ +/* eslint-disable */ +/* prettier-ignore */ +// @ts-nocheck +// noinspection JSUnusedGlobalSymbols +// Generated by unplugin-auto-import +// biome-ignore lint: disable +export {} +declare global { + const EffectScope: typeof import('vue').EffectScope + const computed: typeof import('vue').computed + const createApp: typeof import('vue').createApp + const customRef: typeof import('vue').customRef + const defineAsyncComponent: typeof import('vue').defineAsyncComponent + const defineComponent: typeof import('vue').defineComponent + const defineLocale: typeof import('./node_modules/@nuxt/ui/dist/runtime/composables/defineLocale').defineLocale + const defineShortcuts: typeof import('./node_modules/@nuxt/ui/dist/runtime/composables/defineShortcuts').defineShortcuts + const effectScope: typeof import('vue').effectScope + const extendLocale: typeof import('./node_modules/@nuxt/ui/dist/runtime/composables/defineLocale').extendLocale + const extractShortcuts: typeof import('./node_modules/@nuxt/ui/dist/runtime/composables/defineShortcuts').extractShortcuts + const getCurrentInstance: typeof import('vue').getCurrentInstance + const getCurrentScope: typeof import('vue').getCurrentScope + const getCurrentWatcher: typeof import('vue').getCurrentWatcher + const h: typeof import('vue').h + const inject: typeof import('vue').inject + const isProxy: typeof import('vue').isProxy + const isReactive: typeof import('vue').isReactive + const isReadonly: typeof import('vue').isReadonly + const isRef: typeof import('vue').isRef + const isShallow: typeof import('vue').isShallow + const markRaw: typeof import('vue').markRaw + const nextTick: typeof import('vue').nextTick + const onActivated: typeof import('vue').onActivated + const onBeforeMount: typeof import('vue').onBeforeMount + const onBeforeUnmount: typeof import('vue').onBeforeUnmount + const onBeforeUpdate: typeof import('vue').onBeforeUpdate + const onDeactivated: typeof import('vue').onDeactivated + const onErrorCaptured: typeof import('vue').onErrorCaptured + const onMounted: typeof import('vue').onMounted + const onRenderTracked: typeof import('vue').onRenderTracked + const onRenderTriggered: typeof import('vue').onRenderTriggered + const onScopeDispose: typeof import('vue').onScopeDispose + const onServerPrefetch: typeof import('vue').onServerPrefetch + const onUnmounted: typeof import('vue').onUnmounted + const onUpdated: typeof import('vue').onUpdated + const onWatcherCleanup: typeof import('vue').onWatcherCleanup + const provide: typeof import('vue').provide + const reactive: typeof import('vue').reactive + const readonly: typeof import('vue').readonly + const ref: typeof import('vue').ref + const resolveComponent: typeof import('vue').resolveComponent + const shallowReactive: typeof import('vue').shallowReactive + const shallowReadonly: typeof import('vue').shallowReadonly + const shallowRef: typeof import('vue').shallowRef + const toRaw: typeof import('vue').toRaw + const toRef: typeof import('vue').toRef + const toRefs: typeof import('vue').toRefs + const toValue: typeof import('vue').toValue + const triggerRef: typeof import('vue').triggerRef + const unref: typeof import('vue').unref + const useAppConfig: typeof import('./node_modules/@nuxt/ui/dist/runtime/vue/composables/useAppConfig.js').useAppConfig + const useAppSettingStore: typeof import('./src/stores/useAppSettingStore').default + const useAttrs: typeof import('vue').useAttrs + const useContentSearch: typeof import('./node_modules/@nuxt/ui/dist/runtime/composables/useContentSearch').useContentSearch + const useCssModule: typeof import('vue').useCssModule + const useCssVars: typeof import('vue').useCssVars + const useDriverGroupStore: typeof import('./src/stores/useDriverGroupStore').default + const useEditor: typeof import('./src/composables/useEditor').useEditor + const useExecute: typeof import('./src/composables/useExecute').useExecute + const useFileUpload: typeof import('./node_modules/@nuxt/ui/dist/runtime/composables/useFileUpload').useFileUpload + const useFormField: typeof import('./node_modules/@nuxt/ui/dist/runtime/composables/useFormField').useFormField + const useId: typeof import('vue').useId + const useKbd: typeof import('./node_modules/@nuxt/ui/dist/runtime/composables/useKbd').useKbd + const useLoading: typeof import('./src/composables/useLoading').useLoading + const useMatchRuleStore: typeof import('./src/stores/useMatchRuleStore').default + const useModel: typeof import('vue').useModel + const useOverlay: typeof import('./node_modules/@nuxt/ui/dist/runtime/composables/useOverlay').useOverlay + const usePorterToast: typeof import('./src/composables/usePorterToast').usePorterToast + const useReorderable: typeof import('./src/composables/useReorderable').useReorderable + const useResizable: typeof import('./node_modules/@nuxt/ui/dist/runtime/composables/useResizable').useResizable + const useScrollPosition: typeof import('./src/composables/useScrollPosition').useScrollPosition + const useScrollShadow: typeof import('./node_modules/@nuxt/ui/dist/runtime/composables/useScrollShadow').useScrollShadow + const useScrollspy: typeof import('./node_modules/@nuxt/ui/dist/runtime/composables/useScrollspy').useScrollspy + const useSlots: typeof import('vue').useSlots + const useTemplateRef: typeof import('vue').useTemplateRef + const useToast: typeof import('./node_modules/@nuxt/ui/dist/runtime/composables/useToast').useToast + const useUnsavedFormStore: typeof import('./src/stores/useUnsavedFormStore').default + const watch: typeof import('vue').watch + const watchEffect: typeof import('vue').watchEffect + const watchPostEffect: typeof import('vue').watchPostEffect + const watchSyncEffect: typeof import('vue').watchSyncEffect +} +// for type re-export +declare global { + // @ts-ignore + export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, ShallowRef, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue' + import('vue') +} diff --git a/frontend/components.d.ts b/frontend/components.d.ts new file mode 100644 index 0000000..386399d --- /dev/null +++ b/frontend/components.d.ts @@ -0,0 +1,45 @@ +/* eslint-disable */ +// @ts-nocheck +// biome-ignore lint: disable +// oxlint-disable +// ------ +// Generated by unplugin-vue-components +// Read more: https://github.com/vuejs/core/pull/3399 + +export {} + +/* prettier-ignore */ +declare module 'vue' { + export interface GlobalComponents { + ChipInput: typeof import('./src/components/ChipInput.vue')['default'] + CommandStatusModal: typeof import('./src/components/CommandStatusModal.vue')['default'] + DriverEditor: typeof import('./src/components/DriverEditor.vue')['default'] + DriverFormComponent: typeof import('./src/components/DriverFormComponent.vue')['default'] + DriverInspectModal: typeof import('./src/components/DriverInspectModal.vue')['default'] + DriverSelector: typeof import('./src/components/DriverSelector.vue')['default'] + LoadingOverlay: typeof import('./src/components/LoadingOverlay.vue')['default'] + MatchRuleFormComponent: typeof import('./src/components/MatchRuleFormComponent.vue')['default'] + MatchRuleInputModal: typeof import('./src/components/MatchRuleInputModal.vue')['default'] + PageHeader: typeof import('./src/components/PageHeader.vue')['default'] + ProgressModal: typeof import('./src/components/ProgressModal.vue')['default'] + ProgressStepper: typeof import('./src/components/ProgressStepper.vue')['default'] + RouterLink: typeof import('vue-router')['RouterLink'] + RouterView: typeof import('vue-router')['RouterView'] + TaggedInput: typeof import('./src/components/TaggedInput.vue')['default'] + TaskStatus: typeof import('./src/components/TaskStatus.vue')['default'] + UApp: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/App.vue')['default'] + UBadge: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Badge.vue')['default'] + UButton: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Button.vue')['default'] + UCheckbox: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Checkbox.vue')['default'] + UDropdownMenu: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/DropdownMenu.vue')['default'] + UIcon: typeof import('./node_modules/@nuxt/ui/dist/runtime/vue/components/Icon.vue')['default'] + UInput: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Input.vue')['default'] + UModal: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Modal.vue')['default'] + UnsaveConfirmModal: typeof import('./src/components/UnsaveConfirmModal.vue')['default'] + UpdateModal: typeof import('./src/components/UpdateModal.vue')['default'] + USelect: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Select.vue')['default'] + USkeleton: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Skeleton.vue')['default'] + UTextarea: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Textarea.vue')['default'] + UTooltip: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Tooltip.vue')['default'] + } +} diff --git a/frontend/package.json b/frontend/package.json index b6823ac..08462af 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -11,6 +11,7 @@ "type-check": "vue-tsc --noEmit -p tsconfig.app.json", "lint": "eslint .", "format": "prettier --write src/", + "format:check": "prettier --check src/", "test": "vitest run", "test:watch": "vitest", "test:coverage": "vitest run --coverage" diff --git a/frontend/src/components/DriverInspectModal.vue b/frontend/src/components/DriverInspectModal.vue index 30bace2..6f28572 100644 --- a/frontend/src/components/DriverInspectModal.vue +++ b/frontend/src/components/DriverInspectModal.vue @@ -153,7 +153,13 @@ watch( class="mt-0.5 block font-mono text-xs font-bold xl:text-sm" :class="d.globalExclusive ? 'text-fuchsia-700' : 'text-gray-700'" > - {{ d.globalExclusive ? $t('fieldGlobalExclusive') : d.incompatibles.length > 0 ? d.incompatibles.length : '--' }} + {{ + d.globalExclusive + ? $t('fieldGlobalExclusive') + : d.incompatibles.length > 0 + ? d.incompatibles.length + : '--' + }}