Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add web-types.json for WebStorm #1288

Merged
merged 4 commits into from
Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,18 @@
"main": "./dist/module.cjs",
"module": "./dist/module.mjs",
"types": "./dist/types.d.ts",
"web-types": "./dist/web-types.json",
"files": [
"dist"
],
"scripts": {
"build": "nuxt-module-build",
"dev": "./scripts/playground.sh",
"dev:build": "nuxi build playground/basic",
"dev:prepare": "nuxt-module-build --stub && nuxi prepare playground/basic",
"dev:fixtures": "./scripts/fixture.sh",
"build": "nuxt-module-build && yarn build:web-types",
"build:docs": "(cd docs && nuxi build)",
"build:web-types": "vue-docgen-web-types src/runtime/components/ ./dist/web-types.json",
"example": "./scripts/example.sh",
"lint": "eslint --ext .js,.ts,.vue .",
"prepack": "yarn build",
Expand Down Expand Up @@ -101,6 +103,7 @@
"nuxt": "^3.0.0-rc.4",
"rehype-figure": "^1.0.1",
"remark-oembed": "^1.2.2",
"vitest": "^0.16.0"
"vitest": "^0.16.0",
"vue-docgen-web-types": "^0.1.7"
}
}
9 changes: 9 additions & 0 deletions src/runtime/components/ContentDoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ export default defineComponent({
default: true
}
},

/**
* Document empty fallback
* @slot empty
*/
/**
* Document not found fallback
* @slot not-found
*/
render (ctx) {
const slots = useSlots()

Expand Down
9 changes: 9 additions & 0 deletions src/runtime/components/ContentList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ export default defineComponent({
default: undefined
}
},

/**
* Content empty fallback
* @slot empty
*/
/**
* Content not found fallback
* @slot not-found
*/
render (ctx) {
const slots = useSlots()

Expand Down
5 changes: 5 additions & 0 deletions src/runtime/components/ContentNavigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ export default defineComponent({
refresh
}
},

/**
* Navigation empty fallback
* @slot empty
*/
render (ctx) {
const slots = useSlots()

Expand Down
5 changes: 5 additions & 0 deletions src/runtime/components/ContentQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ export default defineComponent({
refresh
}
},

/**
* Content not found fallback
* @slot not-found
*/
render (ctx) {
const slots = useSlots()

Expand Down
4 changes: 4 additions & 0 deletions src/runtime/components/ContentRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ export default defineComponent({
}
)
},
/**
* Content empty fallback
* @slot empty
*/
render (ctx) {
const slots = useSlots()

Expand Down