@uni-helper/manifest-json-schema
v0.6.0
Published
Schema for uni-app manifest.json
Downloads
1,257
Readme
@uni-helper/manifest-json-schema
为 uni-app 的 manifest.json 提供 schema。
不想看文档?直接问 AI 🤖
请考虑持续赞助以维持该项目的持续健康发展,非常感谢!🙏
安装
pnpm add @uni-helper/manifest-json-schema编辑器提示
为 manifest.json 启用自动补全与校验,推荐安装 uni-app-schemas-vscode 扩展。
- VS Code:https://marketplace.visualstudio.com/items?itemName=uni-helper.uni-app-schemas-vscode
- Open VSX(Cursor / VSCodium 等):https://open-vsx.org/extension/uni-helper/uni-app-schemas-vscode
不想安装扩展时,也可手动在 .vscode/settings.json 关联 schema:
{
"json.schemas": [
{
"fileMatch": ["manifest.json"],
"url": "https://unpkg.com/@uni-helper/manifest-json-schema/schema.json"
}
]
}除了 unpkg,还可以使用 jsdelivr。
{
"json.schemas": [
{
"fileMatch": ["manifest.json"],
"url": "https://cdn.jsdelivr.net/npm/@uni-helper/manifest-json-schema/schema.json"
}
]
}代码内使用
import ManifestSchema from '@uni-helper/manifest-json-schema/schema.json'
console.log(ManifestSchema)
// {
// "$ref": "#/definitions/ManifestConfig",
// "$schema": "http://json-schema.org/draft-07/schema#",
// "definitions": {...}
// }如果你正在使用 TypeScript,请在对应的 tsconfig.json 中设置 compilerOptions.resolveJsonModule 为 true。
关联项目
- @uni-helper/vite-plugin-uni-manifest - 使用 TypeScript 编写
uni-app的manifest.json - @uni-helper/manifest-json-schema - 为 uni-app 的 manifest.json 提供 schema
- @uni-helper/uni-manifest-types - 为 uni-app 的 manifest.json 提供 TypeScript 类型
- uni-helper/vite-plugin-uni-pages - 为 Vite 下的 uni-app 提供基于文件系统的路由
- uni-helper/vite-plugin-uni-platform - 基于文件名 (.<h5|mp-weixin|app>.) 的按平台编译插件
- uni-helper/vite-plugin-uni-platform-modifier - 为属性、指令提供平台修饰符并按需编译
- uni-helper/vite-plugin-uni-layouts - 为 Vite 下的 uni-app 提供类 nuxt 的 layouts 系统
- uni-ku/root - 解决 uni-app 无法使用根部组件问题
