Skip to content

Commit 8f0dfe9

Browse files
committed
ci(module): init lint and typecheck
1 parent 391b6c7 commit 8f0dfe9

32 files changed

+377
-364
lines changed

.github/workflows/module.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: module
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- feat/*
8+
- fix/*
9+
pull_request:
10+
branches:
11+
- main
12+
13+
jobs:
14+
build:
15+
runs-on: ${{ matrix.os }}
16+
17+
strategy:
18+
matrix:
19+
os: ${{ github.event_name == 'pull_request' && fromJSON('["ubuntu-latest"]') || fromJSON('["ubuntu-latest", "windows-latest"]') }} # macos-latest
20+
node: [22]
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v5
25+
26+
- name: Install pnpm
27+
uses: pnpm/action-setup@v4
28+
29+
- name: Install node
30+
uses: actions/setup-node@v5
31+
with:
32+
node-version: ${{ matrix.node }}
33+
cache: pnpm
34+
35+
- name: Install dependencies
36+
run: pnpm install
37+
38+
- name: Prepare
39+
run: pnpm run dev:prepare
40+
41+
- name: Lint
42+
run: pnpm run lint
43+
44+
- name: Prepack
45+
run: pnpm run prepack
46+
47+
- name: Typecheck
48+
run: pnpm run typecheck
49+
50+
- name: Test
51+
run: pnpm run test run

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"dev:prepare": "nuxt-module-build build --stub src/module && nuxt-module-build prepare src/module && nuxi prepare playground/docus",
2727
"release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
2828
"lint": "eslint .",
29+
"typecheck": "nuxt typecheck",
2930
"test": "vitest run",
3031
"test:watch": "vitest watch",
3132
"test:types": "vue-tsc --noEmit && cd playground/docus && vue-tsc --noEmit"

playground/minimal/app/app.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ const { data } = await useAsyncData('posts', () => queryCollection('docs').path(
44

55
<template>
66
<div>
7-
<ContentRenderer v-if="data" :value="data" />
7+
<ContentRenderer
8+
v-if="data"
9+
:value="data"
10+
/>
811
</div>
9-
</template>
12+
</template>

playground/minimal/content.config.ts

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,21 @@ const createDocsSchema = () => z.object({
1111
})).optional(),
1212
})
1313

14-
let collections: Record<string, DefinedCollection>
15-
16-
collections = {
17-
// landing: defineCollection({
18-
// type: 'page',
19-
// source: {
20-
// include: 'index.md',
21-
// },
22-
// }),
23-
docs: defineCollection({
24-
type: 'page',
25-
source: {
26-
include: '**',
27-
// exclude: ['index.md'],
28-
},
29-
schema: createDocsSchema(),
30-
}),
31-
}
14+
const collections: Record<string, DefinedCollection> = {
15+
// landing: defineCollection({
16+
// type: 'page',
17+
// source: {
18+
// include: 'index.md',
19+
// },
20+
// }),
21+
docs: defineCollection({
22+
type: 'page',
23+
source: {
24+
include: '**',
25+
// exclude: ['index.md'],
26+
},
27+
schema: createDocsSchema(),
28+
}),
29+
}
3230

3331
export default defineContentConfig({ collections })

src/app/src/components/CommitPreviewModal.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script setup lang="ts">
1+
<!-- <script setup lang="ts">
22
import { ref, watch } from 'vue'
33
import ReviewPanel from './ReviewPanel.vue'
44
import { useStudio } from '../composables/useStudio'
@@ -102,4 +102,4 @@ watch(modelValue, () => {
102102
</div>
103103
</template>
104104
</UModal>
105-
</template>
105+
</template> -->

src/app/src/components/ContentDiffView.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<template>
1+
<!-- <template>
22
<div
33
ref="target"
44
class="w-full h-full"
@@ -73,4 +73,4 @@ else {
7373
readOnly: true,
7474
})
7575
}
76-
</script>
76+
</script> -->

src/app/src/components/ContentsListModal.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script setup lang="ts">
1+
<!-- <script setup lang="ts">
22
import { ref, computed, watch, toRaw } from 'vue'
33
import { useStudio } from '../composables/useStudio'
44
// import { MDCEditorAST } from '@farnabaz/mdc-editor'
@@ -120,4 +120,4 @@ const items = computed(() => filtered.value.map(item => ({
120120
</div>
121121
</template>
122122
</UModal>
123-
</template>
123+
</template> -->

src/app/src/components/LogoPro.vue

Lines changed: 0 additions & 67 deletions
This file was deleted.

src/app/src/components/ReviewPanel.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<template>
1+
<!-- <template>
22
<div class="flex">
33
<UDashboardSidebar
44
id="default"
@@ -79,4 +79,4 @@ const changedFileLinks = computed(() => {
7979
onSelect: () => selectDraft(file),
8080
} as NavigationMenuItem))
8181
})
82-
</script>
82+
</script> -->

src/app/src/components/panel/content/editor/PanelContentEditor.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ const document = computed<DatabasePageItem>({
2727
if (dbItem.body?.type === 'minimark') {
2828
result = {
2929
...props.draftItem.document as DatabasePageItem,
30-
body: decompressTree(dbItem.body) as unknown as MarkdownRoot,
30+
// @ts-expect-error todo fix MarkdownRoot/MDCRoot conversion in MDC module
31+
body: decompressTree(dbItem.body) as MarkdownRoot,
3132
}
3233
}
3334
else {

0 commit comments

Comments
 (0)