├── .commitlintrc.cjs ├── .czrc ├── .editorconfig ├── .eslintrc.cjs ├── .github └── workflows │ └── release.yml ├── .gitignore ├── .husky ├── commit-msg └── pre-commit ├── .lintstagedrc.cjs ├── .markdownlint.json ├── .npmrc ├── .nvmrc ├── .prettierrc.cjs ├── .vscodeignore ├── LICENSE ├── README.md ├── package-lock.json ├── package.json ├── tsconfig.json └── uni-helper.png /.commitlintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['@commitlint/config-conventional'], 3 | }; 4 | -------------------------------------------------------------------------------- /.czrc: -------------------------------------------------------------------------------- 1 | { 2 | "path": "@commitlint/prompt" 3 | } 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 2 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: [require.resolve('@modyqyw/fabric/eslint')], 3 | }; 4 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: release 2 | 3 | on: 4 | push: 5 | tags: 6 | - 'v*' 7 | 8 | jobs: 9 | release: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/checkout@v4 14 | with: 15 | fetch-depth: 0 16 | - uses: actions/setup-node@v4 17 | with: 18 | node-version-file: .nvmrc 19 | cache: npm 20 | registry-url: https://registry.npmjs.org 21 | - run: corepack enable 22 | - run: npm install 23 | - run: npm run publish 24 | env: 25 | VSCE_PAT: ${{ secrets.VSCE_PAT }} 26 | OVSX_PAT: ${{ secrets.OVSX_PAT }} 27 | - run: npx changelogithub 28 | env: 29 | GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | pnpm-debug.log* 9 | run 10 | 11 | # Diagnostic reports (https://nodejs.org/api/report.html) 12 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 13 | 14 | # Runtime data 15 | pids 16 | *.pid 17 | *.seed 18 | *.pid.lock 19 | 20 | # Directory for instrumented libs generated by jscoverage/JSCover 21 | lib-cov 22 | 23 | # Coverage directory used by tools like istanbul 24 | coverage 25 | *.lcov 26 | 27 | # nyc test coverage 28 | .nyc_output 29 | 30 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 31 | .grunt 32 | 33 | # Bower dependency directory (https://bower.io/) 34 | bower_components 35 | 36 | # node-waf configuration 37 | .lock-wscript 38 | 39 | # Compiled binary addons (https://nodejs.org/api/addons.html) 40 | build/Release 41 | 42 | # Dependency directories 43 | node_modules 44 | jspm_packages 45 | 46 | # Snowpack dependency directory (https://snowpack.dev/) 47 | web_modules 48 | 49 | # Temp directory 50 | .temp 51 | .tmp 52 | 53 | # TypeScript cache 54 | *.tsbuildinfo 55 | 56 | # Optional npm cache directory 57 | .npm 58 | 59 | # Optional eslint cache 60 | .eslintcache 61 | 62 | # Microbundle cache 63 | .rpt2_cache 64 | .rts2_cache_cjs 65 | .rts2_cache_es 66 | .rts2_cache_umd 67 | 68 | # Optional REPL history 69 | .node_repl_history 70 | 71 | # Output of 'npm pack' 72 | *.tgz 73 | 74 | # Yarn Integrity file 75 | .yarn-integrity 76 | 77 | # dotenv environment variables file 78 | .env 79 | .env.test 80 | .env.*.test 81 | .env.local 82 | .env.*.local 83 | *.local 84 | 85 | # parcel-bundler cache (https://parceljs.org/) 86 | .cache 87 | .parcel-cache 88 | 89 | # Electron 90 | dist-electron 91 | dist_electron 92 | 93 | # Tauri 94 | dist-tauri 95 | dist_tauri 96 | 97 | # Cordova 98 | dist-cordova 99 | dist_cordova 100 | 101 | # Capacitor 102 | dist-capacitor 103 | dist_capacitor 104 | 105 | # Next.js build output 106 | .next 107 | out 108 | 109 | # Umi.js build output 110 | .umi 111 | .umi-production 112 | .umi-test 113 | 114 | # Nuxt.js build / generate output 115 | .nuxt 116 | dist 117 | 118 | # Rax.js build 119 | .rax 120 | 121 | # Vuepress build output 122 | .vuepress/dist 123 | 124 | # SSR 125 | dist-ssr 126 | dist_ssr 127 | 128 | # SSG 129 | dist-ssg 130 | dist_ssg 131 | 132 | # Serverless 133 | .serverless 134 | .dynamodb 135 | .s3 136 | .buckets 137 | .seeds 138 | 139 | # FuseBox cache 140 | .fusebox 141 | 142 | # TernJS port file 143 | .tern-port 144 | 145 | # Cypress 146 | /cypress/videos/ 147 | /cypress/screenshots/ 148 | 149 | # Editor 150 | .vscode-test 151 | .vscode/** 152 | !.vscode/extensions.json 153 | !.vscode/settings.json 154 | *.vsix 155 | .idea 156 | .hbuilder 157 | .hbuilderx 158 | *.suo 159 | *.ntvs* 160 | *.njsproj 161 | *.sln 162 | *.sw? 163 | 164 | # yarn v2 165 | .yarn/cache 166 | .yarn/unplugged 167 | .yarn/build-state.yml 168 | .yarn/install-state.gz 169 | .pnp.* 170 | 171 | # Apple 172 | .DS_Store 173 | *.p12 174 | *.mobileprovision 175 | 176 | # Android 177 | *.keystore 178 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx --no-install commitlint --edit $1 5 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx --no-install lint-staged 5 | -------------------------------------------------------------------------------- /.lintstagedrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | '*.md': 'markdownlint --fix --ignore-path=.gitignore', 3 | '*.{js,cjs,mjs,ts,cts,mts,json}': 'eslint --fix --cache --ignore-path=.gitignore', 4 | }; 5 | -------------------------------------------------------------------------------- /.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "MD001": false, 3 | "MD003": false, 4 | "MD013": false, 5 | "MD022": false, 6 | "MD024": false, 7 | "MD025": false, 8 | "MD033": false, 9 | "MD036": false, 10 | "MD050": false 11 | } 12 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | legacy-peer-deps=true 2 | shamefully-hoist=true 3 | registry=https://registry.npmjs.org/ 4 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 20 2 | -------------------------------------------------------------------------------- /.prettierrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | ...require('@modyqyw/fabric/prettier'), 3 | }; 4 | -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | out/test/** 4 | test/** 5 | src/** 6 | **/*.map 7 | .gitignore 8 | tsconfig.json 9 | vsc-extension-quickstart.md 10 | .github 11 | pnpm-lock.yaml 12 | package-lock.json 13 | yarn.lock 14 | scripts/** 15 | renovate.json 16 | .release-it.cjs 17 | .nvmrc 18 | .lintstagedrc.cjs 19 | .markdownlint.json 20 | .czrc 21 | .husky/** 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020-present uni-helper 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # @uni-helper/uni-helper-vscode 2 | 3 | [![License](https://img.shields.io/github/license/uni-helper/uni-helper-vscode?label=License&color=brightgreen)](https://github.com/uni-helper/uni-helper-vscode/blob/main/LICENSE) 4 | 5 | [![Visual Studio Marketplace Version](https://img.shields.io/visual-studio-marketplace/v/uni-helper.uni-helper-vscode?label=VS%20Marketplace&color=brightgreen)](https://marketplace.visualstudio.com/items?itemName=uni-helper.uni-helper-vscode) 6 | 7 | [![Open VSX Version](https://img.shields.io/open-vsx/v/uni-helper/uni-helper-vscode?label=Open%20VSX&color=brightgreen)](https://open-vsx.org/extension/uni-helper/uni-helper-vscode) 8 | 9 | 增强 `uni-app` 系列产品在 `VSCode` 内的体验。 10 | 11 | 想让 `uni-app` 开发变得更直观、高效?想要更好的 `uni-app` 开发体验?不妨看看 [uni-helper 主页](https://uni-helper.js.org) 和 [uni-helper GitHub Organization](https://github.com/uni-helper)! 12 | 13 | ## 插件特性 14 | 15 | 本插件实际上是以下几个插件的扩展包。 16 | 17 | - [uni-app-schemas](https://marketplace.visualstudio.com/items?itemName=uni-helper.uni-app-schemas-vscode) - 校验 `uni-app` 中的 `androidPrivacy.json`、`pages.json` 和 `manifest.json` 格式,也可以直接在对应的文件中添加 `$schema` 来使用对应的 `schema` 文件 18 | - [uni-app-snippets](https://marketplace.visualstudio.com/items?itemName=uni-helper.uni-app-snippets-vscode) - 提供 `uni-app` 基本能力代码片段 19 | - [uni-cloud-snippets](https://marketplace.visualstudio.com/items?itemName=uni-helper.uni-cloud-snippets-vscode) - 提供 `uni-cloud` 基本能力代码片段 20 | - [uni-ui-snippets](https://marketplace.visualstudio.com/items?itemName=uni-helper.uni-ui-snippets-vscode) - 提供 `uni-ui` 基本能力代码片段 21 | - [uni-highlight](https://marketplace.visualstudio.com/items?itemName=uni-helper.uni-highlight-vscode) - 在 `VSCode` 中对条件编译的代码注释部分提供了语法高亮 22 | 23 | **插件和文档的冲突之处,请以文档为准。** 24 | 25 | 插件源代码在 [uni-helper/uni-helper-vscode](https://github.com/uni-helper/uni-helper-vscode)。欢迎提交 ISSUE 和 PR 改进本插件。 26 | 27 | ## 使用 28 | 29 | 安装插件后重启 VSCode 即可。 30 | 31 | ## 额外推荐 32 | 33 | ### uni-app 34 | 35 | 以下是 `uni-app` 插件推荐,请视情况安装。 36 | 37 | - [create-uniapp-view](https://marketplace.visualstudio.com/items?itemName=mrmaoddxxaa.create-uniapp-view) - 快捷创建 `uni-app` 页面并添加到 `pages.json`,也可以快速创建 `uni-app` 组件 38 | 39 | ### vue 40 | 41 | 以下是 `vue` 插件推荐,请视情况安装。 42 | 43 | - [Volar](https://marketplace.visualstudio.com/items?itemName=vue.volar) - 请仔细阅读 [文档](https://cn.vuejs.org/guide/typescript/overview.html),并按照文档做相应的设置,目前官方更推荐使用 `Volar` 而不是 `Vetur` 44 | 45 | ### 开发 46 | 47 | 以下是个人开发插件推荐,请视情况安装。 48 | 49 | - [any-rule](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) 50 | - [Auto NPX](https://marketplace.visualstudio.com/items?itemName=antfu.auto-npx) 51 | - [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) 52 | - [DotENV Official + Vault](https://marketplace.visualstudio.com/items?itemName=dotenv.dotenv-vscode) 53 | - [EditorConfig for VS Code](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig) 54 | - [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) 55 | - [Git Graph](https://marketplace.visualstudio.com/items?itemName=mhutchie.git-graph) 56 | - [Git History](https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory) 57 | - [Git Line Blame](https://marketplace.visualstudio.com/items?itemName=carlthome.git-line-blame) 58 | - [Goto definition alias](https://marketplace.visualstudio.com/items?itemName=antfu.goto-alias) 59 | - [i18n Ally](https://marketplace.visualstudio.com/items?itemName=Lokalise.i18n-ally) 60 | - [Image preview](https://marketplace.visualstudio.com/items?itemName=kisstkondoros.vscode-gutter-preview) 61 | - [Markdown All in One](https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one) 62 | - [Markdown Preview Enhanced](https://marketplace.visualstudio.com/items?itemName=shd101wyy.markdown-preview-enhanced) 63 | - [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint) 64 | - [Partial Diff](https://marketplace.visualstudio.com/items?itemName=ryu1kn.partial-diff) 65 | - [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) 66 | - [Stylelint](https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint) 67 | - [SVG](https://marketplace.visualstudio.com/items?itemName=jock.svg) 68 | - [Tailwind CSS IntelliSense](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss) 69 | - [Todo Tree](https://marketplace.visualstudio.com/items?itemName=Gruntfuggly.todo-tree) 70 | - [TSConfig Helper](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.vscode-tsconfig-helper) 71 | - [UnoCSS](https://marketplace.visualstudio.com/items?itemName=antfu.unocss) 72 | - [YAML](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) 73 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "uni-helper-vscode", 3 | "displayName": "uni-helper", 4 | "version": "0.5.9", 5 | "description": "增强 uni-app 系列产品在 VSCode 内的体验", 6 | "categories": [ 7 | "Extension Packs" 8 | ], 9 | "keywords": [ 10 | "uniapp", 11 | "uni-app", 12 | "unicloud", 13 | "uni-cloud", 14 | "uniui", 15 | "uni-ui", 16 | "uni", 17 | "helper", 18 | "schema", 19 | "schemas", 20 | "snippet", 21 | "snippets" 22 | ], 23 | "homepage": "https://github.com/uni-helper/uni-helper-vscode#readme", 24 | "bugs": { 25 | "url": "https://github.com/uni-helper/uni-helper-vscode/issues" 26 | }, 27 | "repository": { 28 | "type": "git", 29 | "url": "https://github.com/uni-helper/uni-helper-vscode" 30 | }, 31 | "license": "MIT", 32 | "author": { 33 | "name": "ModyQyW", 34 | "email": "wurui-dev@foxmail.com", 35 | "url": "https://modyqyw.github.io" 36 | }, 37 | "publisher": "uni-helper", 38 | "type": "module", 39 | "files": [ 40 | "*.vsix" 41 | ], 42 | "scripts": { 43 | "check:deps": "taze", 44 | "check:types": "tsc --noEmit", 45 | "lint": "run-p lint:eslint lint:markdownlint", 46 | "lint:eslint": "eslint . --fix --cache --ignore-path=.gitignore", 47 | "lint:markdownlint": "markdownlint . --fix --ignore-path=.gitignore", 48 | "release": "bumpp", 49 | "prepare": "is-ci || husky install", 50 | "publish": "run-p publish:vscode publish:openvsx", 51 | "publish:vscode": "vsce package && vsce publish", 52 | "publish:openvsx": "ovsx publish" 53 | }, 54 | "devDependencies": { 55 | "@commitlint/cli": "^17.6.1", 56 | "@commitlint/config-conventional": "^17.6.1", 57 | "@commitlint/prompt": "^17.6.1", 58 | "@modyqyw/fabric": "^7.5.0", 59 | "@tsconfig/node18": "^2.0.0", 60 | "@types/node": "^18.16.0", 61 | "@typescript-eslint/eslint-plugin": "^5.59.1", 62 | "@typescript-eslint/parser": "^5.59.1", 63 | "@vscode/vsce": "^2.19.0", 64 | "bumpp": "^9.1.0", 65 | "commitizen": "^4.3.0", 66 | "eslint": "^8.39.0", 67 | "husky": "^8.0.3", 68 | "is-ci": "^3.0.1", 69 | "lint-staged": "^13.2.1", 70 | "markdownlint-cli": "^0.33.0", 71 | "npm-run-all": "^4.1.5", 72 | "ovsx": "^0.8.0", 73 | "prettier": "^2.8.8", 74 | "release-it": "^15.10.1", 75 | "taze": "^0.9.1", 76 | "tsx": "^3.12.6", 77 | "typescript": "^5.0.4" 78 | }, 79 | "extensionPack": [ 80 | "uni-helper.uni-app-schemas-vscode", 81 | "uni-helper.uni-app-snippets-vscode", 82 | "uni-helper.uni-cloud-snippets-vscode", 83 | "uni-helper.uni-highlight-vscode", 84 | "uni-helper.uni-ui-snippets-vscode" 85 | ], 86 | "packageManager": "npm@9.6.5", 87 | "engines": { 88 | "node": ">=14.18", 89 | "vscode": "^1.40.0" 90 | }, 91 | "icon": "uni-helper.png", 92 | "sponsor": { 93 | "url": "https://github.com/ModyQyW/sponsors" 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@tsconfig/node18", 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "lib": ["ESNext"], 6 | "module": "ESNext", 7 | "target": "ESNext", 8 | "resolveJsonModule": true, 9 | "types": ["node"] 10 | }, 11 | "include": ["**/*.js", "**/*.cjs", "**/*.mjs", "**/*.ts", "**/*.cts", "**/*.mts"], 12 | "exclude": ["**/node_modules", "**/dist"] 13 | } 14 | -------------------------------------------------------------------------------- /uni-helper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uni-helper/uni-helper-vscode/535ebd751f746098c3bd7d55079d2f153e6c2d0d/uni-helper.png --------------------------------------------------------------------------------