Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"dev:node": "DEV=true pnpm build:node -w",
"dev:shared": "node scripts/copyShared",
"dev:watch": "node scripts/watchAndCopy",
"build": "pnpm build:prepare && pnpm build:client && pnpm build:node",
"build": "pnpm build:prepare && pnpm build:client && pnpm build:node && node scripts/webTypes.js",
"build:prepare": "pnpm clean && node scripts/copyShared",
"build:client": "vue-tsc --noEmit -p src/client && tsc -p src/client && node scripts/copyClient",
"build:node": "tsc -p src/node --noEmit && rollup --config rollup.config.ts --configPlugin esbuild",
Expand Down Expand Up @@ -209,5 +209,6 @@
"optional": true
}
},
"packageManager": "pnpm@10.32.1"
"packageManager": "pnpm@10.32.1",
"web-types": "./dist/web-types.json"
}
67 changes: 67 additions & 0 deletions scripts/webTypes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import { createRequire } from 'node:module'
import { writeFile } from 'node:fs/promises'

const require = createRequire(import.meta.url)

// release script will change the version before running the build script
const { version } = require('../package.json')

await writeFile(
'./dist/web-types.json',
JSON.stringify(
{
// $schema: 'https://json.schemastore.org/web-types',
$schema:
'https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json',
framework: 'vue',
name: 'vitepress',
version: version,
'js-types-syntax': 'typescript',
'description-markup': 'markdown',
'framework-config': {
'enable-when': {
'node-packages': ['vue'],
'file-extensions': ['vue'],
'ide-libraries': ['vue']
}
},
contributions: {
html: {
'vue-components': [
{
name: 'ClientOnly',
description:
'ClientOnly component renders its default slot only at client side.',
'doc-url':
'https://vitepress.dev/reference/runtime-api#clientonly',
slots: [
{
name: 'default',
description: 'Content to render once client app is mounted'
}
]
},
{
name: 'Content',
description:
'The Content component displays the rendered markdown contents. Useful when creating your own theme.',
'doc-url': 'https://vitepress.dev/reference/runtime-api#content',
props: [
{
name: 'as',
description:
'An HTML tag name, a Component name or Component class reference.',
type: ['string', 'object'],
default: '"div"'
}
]
}
]
}
}
},
null,
2
),
'utf8'
)