diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000000000000000000000000000000000000..aa10096d1cbfdbc83ce73990cbcddfc69874ce8e --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,21 @@ +{ + "env": { + "browser": true, + "es6": true, + "amd": true, + "commonjs": true + }, + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module" + }, + "extends": "eslint:recommended", + "globals": { + "process": "readonly" + }, + "rules": { + "indent": ["error", 2], + "quotes": ["error", "single"], + "no-extra-semi": "off" + } +} diff --git a/.gitattributes b/.gitattributes index a6344aac8c09253b3b630fb776ae94478aa0275b..b1c7ae95b95e22ad1c86d7776b1c0ad647c9e9a7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -33,3 +33,12 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text *.zst filter=lfs diff=lfs merge=lfs -text *tfevents* filter=lfs diff=lfs merge=lfs -text +vue-devtools/media/chrome-webstore/screenshot1-size.png filter=lfs diff=lfs merge=lfs -text +vue-devtools/media/chrome-webstore/screenshot1.png filter=lfs diff=lfs merge=lfs -text +vue-devtools/media/screenshot-rounded.png filter=lfs diff=lfs merge=lfs -text +vue-devtools/media/screenshot-shadow.png filter=lfs diff=lfs merge=lfs -text +vue-devtools/media/screenshot.png filter=lfs diff=lfs merge=lfs -text +vue-devtools/packages/app-frontend/src/assets/Roboto-Mono.ttf filter=lfs diff=lfs merge=lfs -text +vue-devtools/packages/docs/src/assets/dev-shell-url.png filter=lfs diff=lfs merge=lfs -text +vue-devtools/packages/docs/src/assets/edge-settings1.png filter=lfs diff=lfs merge=lfs -text +vue-devtools/packages/docs/src/public/logo-edge.png filter=lfs diff=lfs merge=lfs -text diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000000000000000000000000000000000000..df64aa565647c610fcc9e4867dcd9272225b04a6 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +ko_fi: surunzi +open_collective: eruda \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..b9615c4667ab3537c23e01793dc299e417eff1e5 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,31 @@ +name: CI + +on: + workflow_dispatch: + push: + branches: + - 'master' + paths: + - 'src/**/*' + +jobs: + ci: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + - run: | + npm install -g @liriliri/lsla + npm install -g yarn + npm run init + npm run init:front + npm run ci diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000000000000000000000000000000000000..8931508a68bb893b2cde533fdf1c15bd28dc2aa5 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,31 @@ +name: Publish to NPM + +on: + workflow_dispatch: + release: + types: [created] + +jobs: + publish: + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: '18.x' + registry-url: 'https://registry.npmjs.org' + - name: Build eruda-vue + run: | + npm install -g @liriliri/lsla + npm install -g yarn + npm run init + npm run init:front + npm run build + - name: Publish package on NPM + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..66453c75707ddcc70e6be63138c4fe9743274109 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +node_modules/ +src/devtools.txt +eruda-vue.js +eruda-vue.js.map +package-lock.json \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000000000000000000000000000000000..9da8230ee61377f2ea58986c717e2bcaabde5e57 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "vue-devtools"] + path = vue-devtools + url = https://github.com/liriliri/vue-devtools diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000000000000000000000000000000000..4c471aaba1b4808872e31ce83f61d9da3fe4af94 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +src/devtools.js \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000000000000000000000000000000000000..1ddf8df97855e1b5e71ae04adaed165e72e718e9 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "tabWidth": 2, + "semi": false +} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..a70aaec6778cb68f3a5919c3ee0910c243f92f3e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,15 @@ +## v1.1.1 (5 Sep 2024) + +* fix: safari + +## v1.1.0 (4 Sep 2024) + +* feat: force dev mode + +## v1.0.1 (16 Aug 2024) + +* fix: initial theme not correct + +## v1.0.0 (15 Aug 2024) + +Initial release. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..6cb785655324d2671dd4f37cf58e90b9bf32e749 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2024-present liriliri + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 99d2a2889552f778e15ffb543ec1b6fb3a6f6e68..1124ad575d986575d169474c3ea5233844b5141d 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,30 @@ ---- -title: Eruda Vue -emoji: 📚 -colorFrom: green -colorTo: yellow -sdk: docker -pinned: false ---- - -Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference +# eruda-vue + +[![NPM version][npm-image]][npm-url] +[![Build status][ci-image]][ci-url] +[![License][license-image]][npm-url] + +[npm-image]: https://img.shields.io/npm/v/eruda-vue.svg +[npm-url]: https://npmjs.org/package/eruda-vue +[ci-image]: https://img.shields.io/github/actions/workflow/status/liriliri/eruda-vue/main.yml?branch=master&style=flat-square +[ci-url]: https://github.com/liriliri/eruda-vue/actions/workflows/main.yml +[license-image]: https://img.shields.io/npm/l/eruda-vue.svg + +Eruda plugin for Vue. + +## Demo + +Browse it on your phone: +[https://eruda.liriliri.io/?plugin=vue](https://eruda.liriliri.io/?plugin=vue) + +## Install + +```bash +npm install eruda-vue --save +``` + +```javascript +eruda.add(erudaVue); +``` + +Make sure Eruda is loaded before this plugin, otherwise won't work. \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000000000000000000000000000000000000..1df3932e164f1a27578c68fd91dc7acb0c8bccb1 --- /dev/null +++ b/index.html @@ -0,0 +1,38 @@ + + + + + + Eruda-vue + + + +
{{ message }}
+ + + + + + + diff --git a/package.json b/package.json new file mode 100644 index 0000000000000000000000000000000000000000..092641cd8c30747015f378683811a3a0ab3c9bbb --- /dev/null +++ b/package.json @@ -0,0 +1,56 @@ +{ + "name": "eruda-vue", + "version": "1.1.1", + "main": "eruda-vue.js", + "description": "Eruda plugin for Vue", + "files": [ + "eruda-vue.js", + "eruda-vue.js.map" + ], + "scripts": { + "init": "git submodule init && git submodule update && npm install --force && cd vue-devtools && yarn && npm run build", + "init:front": "npm run build:front && npm run copy:front", + "build:front": "cd vue-devtools/packages/shell-eruda && npm run build", + "copy:front": "lsla shx cp -r vue-devtools/packages/shell-eruda/build/devtools.js src/devtools.txt", + "dev": "webpack-dev-server --host 0.0.0.0 --mode development", + "build": "webpack --mode production", + "ci": "npm run lint && npm run build", + "lint": "eslint src/**/*.js", + "format": "lsla prettier \"src/*.{js,scss}\" \"*.{json,html}\" --write" + }, + "keywords": [ + "eruda", + "vue", + "plugin" + ], + "author": "surunzi", + "license": "MIT", + "bugs": { + "url": "https://github.com/liriliri/eruda-vue/issues" + }, + "homepage": "https://github.com/liriliri/eruda-vue#readme", + "devDependencies": { + "@babel/core": "^7.21.3", + "@babel/plugin-transform-runtime": "^7.21.0", + "@babel/preset-env": "^7.20.2", + "autoprefixer": "^10.4.14", + "babel-loader": "^9.1.2", + "css-loader": "^3.4.2", + "eruda": "^3.2.0", + "eslint": "^8.57.0", + "licia": "^1.41.1", + "path-browserify": "^1.0.1", + "postcss": "^8.4.21", + "postcss-class-prefix": "^0.3.0", + "postcss-loader": "^7.0.2", + "raw-loader": "^4.0.2", + "sass": "^1.77.8", + "sass-loader": "^14.2.1", + "webpack": "^5.93.0", + "webpack-cli": "^5.1.4", + "webpack-dev-server": "^4.12.0" + }, + "workspaces": [ + "vue-devtools/packages/*" + ] +} diff --git a/src/back.js b/src/back.js new file mode 100644 index 0000000000000000000000000000000000000000..bca630ebbf64328c7ef8a74eea4c43a6bba298c2 --- /dev/null +++ b/src/back.js @@ -0,0 +1,221 @@ +import { installHook as _installHook } from '@back/hook' +import { Bridge } from '@utils/bridge' +import { SharedData } from '@utils/shared-data' +import createUrl from 'licia/createUrl' +import devtools from 'raw-loader!./devtools.txt' + +let theme = 'auto' +let shareDataLoaded = false + +export function installHook() { + if (window.__VUE_DEVTOOLS_GLOBAL_HOOK__) { + return + } + _installHook(window) +} + +export function initDevtools(iframe) { + const bridge = new Bridge({ + listen(fn) { + window.addEventListener('message', (evt) => { + if (process.env.NODE_ENV !== 'production') { + console.log('devtools -> backend', evt.data) + } + fn(evt.data) + }) + }, + send(data) { + if (process.env.NODE_ENV !== 'production') { + console.log('backend -> devtools', data) + } + iframe.contentWindow.postMessage(data, '*') + }, + }) + bridge.on('shared-data:load-complete', () => { + shareDataLoaded = true + setTheme(theme) + }) + import('@back').then(({ initBackend }) => { + initBackend(bridge) + }) + + const devtoolsSrc = createUrl(devtools, { type: 'application/javascript' }) + + const devtoolsUrl = createUrl( + ` + + + + + + +
+ + + `, + { + type: 'text/html', + } + ) + + iframe.__vdevtools__injected = true + iframe.src = devtoolsUrl +} + +export function setTheme(value) { + theme = value + if (shareDataLoaded) { + SharedData.theme = value + } +} + +// Modified from vue-devtools +export function forceEnable() { + if (!window.__VUE_DEVTOOLS_GLOBAL_HOOK__) { + return + } + + let delay = 1000 + let detectRemainingTries = 10 + + function runDetect() { + // Method 1: Check Nuxt.js + const nuxtDetected = !!(window.__NUXT__ || window.$nuxt) + + if (nuxtDetected) { + let Vue + + if (window.$nuxt) { + Vue = window.$nuxt.$root && window.$nuxt.$root.constructor + } + + crack({ + devtoolsEnabled: + (Vue && Vue.config.devtools) || + (window.__VUE_DEVTOOLS_GLOBAL_HOOK__ && + window.__VUE_DEVTOOLS_GLOBAL_HOOK__.enabled), + vueDetected: true, + nuxtDetected: true, + }) + + return + } + + // Method 2: Check Vue 3 + const vueDetected = !!window.__VUE__ + if (vueDetected) { + crack({ + devtoolsEnabled: + window.__VUE_DEVTOOLS_GLOBAL_HOOK__ && + window.__VUE_DEVTOOLS_GLOBAL_HOOK__.enabled, + vueDetected: true, + }) + + return + } + + // Method 3: Scan all elements inside document + const all = document.querySelectorAll('*') + let el + for (let i = 0; i < all.length; i++) { + if (all[i].__vue__) { + el = all[i] + break + } + } + if (el) { + let Vue = Object.getPrototypeOf(el.__vue__).constructor + while (Vue.super) { + Vue = Vue.super + } + crack({ + devtoolsEnabled: Vue.config.devtools, + vueDetected: true, + }) + return + } + + if (detectRemainingTries > 0) { + detectRemainingTries-- + setTimeout(() => { + runDetect() + }, delay) + delay *= 5 + } + } + + setTimeout(() => { + runDetect() + }, 100) +} + +// https://github.com/hzmming/vue-force-dev +function crack(data) { + if (data.devtoolsEnabled) { + return + } + + // Nuxt.js + if (data.nuxtDetected) { + let Vue + + if (window.$nuxt) { + Vue = window.$nuxt.$root && window.$nuxt.$root.constructor + } + + // Vue 2 + if (Vue) { + crackVue2(Vue) + } else { + // Vue 3.2.14+ + crackVue3() + } + } + // Vue 3 + else if (window.__VUE__) { + crackVue3() + } + // Vue 2 + else { + crackVue2() + } +} + +function crackVue2(Vue) { + if (!Vue) { + const app = getVueRootInstance(2) + if (!app) return false // Vue may not be finished yet + Vue = Object.getPrototypeOf(app).constructor + while (Vue.super) { + Vue = Vue.super + } + } + + const devtools = window.__VUE_DEVTOOLS_GLOBAL_HOOK__ + Vue.config.devtools = true + devtools.emit('init', Vue) +} + +function crackVue3() { + const app = getVueRootInstance(3) + if (!app) return false // Vue may not be finished yet + const devtools = window.__VUE_DEVTOOLS_GLOBAL_HOOK__ + devtools.enabled = true + const version = app.version + devtools.emit('app:init' /* APP_INIT */, app, version, { + Fragment: Symbol.for('v-fgt'), + Text: Symbol.for('v-txt'), + Comment: Symbol.for('v-cmt'), + Static: Symbol.for('v-stc'), + }) +} + +function getVueRootInstance(version) { + const signProperty = version === 2 ? '__vue__' : '__vue_app__' + const all = document.querySelectorAll('*') + for (let i = 0; i < all.length; i++) { + if (all[i][signProperty]) { + return all[i][signProperty] + } + } +} diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000000000000000000000000000000000000..dd73371ecdaa9f99a875162d79baaf43bad667d4 --- /dev/null +++ b/src/index.js @@ -0,0 +1,45 @@ +const { initDevtools, setTheme, installHook, forceEnable } = require('./back') + +module.exports = function (eruda) { + let { evalCss } = eruda.util + + class Vue extends eruda.Tool { + constructor() { + super() + this.name = 'vue' + this._style = evalCss(require('./style.scss')) + } + init($el, container) { + super.init($el, container) + $el.html('') + const iframe = $el.find('.eruda-vue-devtools').get(0) + + installHook() + forceEnable() + initDevtools(iframe) + + setTheme(this._getTheme()) + eruda.get().config.on('change', this._onThemeChange) + } + show() { + super.show() + } + hide() { + super.hide() + } + destroy() { + super.destroy() + evalCss.remove(this._style) + } + _getTheme() { + return eruda.util.isDarkTheme() ? 'dark' : 'light' + } + _onThemeChange = (name) => { + if (name === 'theme') { + setTheme(this._getTheme()) + } + } + } + + return new Vue() +} diff --git a/src/style.scss b/src/style.scss new file mode 100644 index 0000000000000000000000000000000000000000..bf0aa9cf5b9a3d898de5cb28b6e34b146515941b --- /dev/null +++ b/src/style.scss @@ -0,0 +1,12 @@ +.vue { + padding: 0; + .tip { + padding: 10px; + background: #fff; + color: #263238; + } + .vue-devtools { + width: 100%; + height: 100%; + } +} diff --git a/vue-devtools/.browserslistrc b/vue-devtools/.browserslistrc new file mode 100644 index 0000000000000000000000000000000000000000..1057c3add9f4cac640d0295a20d31118d6668fe4 --- /dev/null +++ b/vue-devtools/.browserslistrc @@ -0,0 +1,2 @@ +Chrome >= 52 +Firefox >= 48 diff --git a/vue-devtools/.circleci/config.yml b/vue-devtools/.circleci/config.yml new file mode 100644 index 0000000000000000000000000000000000000000..6e4d2b9f7be4496e3b60c3007f4e00c69abcd7c8 --- /dev/null +++ b/vue-devtools/.circleci/config.yml @@ -0,0 +1,37 @@ +version: 2 +jobs: + build: + docker: + # specify the version you desire here + - image: node:current + - image: vuejs/ci + resource_class: medium+ + + working_directory: ~/repo + + steps: + - checkout + + # Download and cache dependencies + - restore_cache: + keys: + - v3-dependencies-{{ checksum "yarn.lock" }} + # fallback to using the latest cache if no exact match is found + - v3-dependencies- + + - run: yarn install --pure-lockfile + + - save_cache: + paths: + - node_modules + - ~/.cache/yarn + - ~/.cache/Cypress + key: v3-dependencies-{{ checksum "yarn.lock" }} + + # run tests! + - run: yarn build && yarn test + + - store_artifacts: + path: cypress/videos + - store_artifacts: + path: cypress/screenshots diff --git a/vue-devtools/.github/FUNDING.yml b/vue-devtools/.github/FUNDING.yml new file mode 100644 index 0000000000000000000000000000000000000000..b500cc317e457685932b7e90bb6885ee3747f749 --- /dev/null +++ b/vue-devtools/.github/FUNDING.yml @@ -0,0 +1 @@ +github: Akryum diff --git a/vue-devtools/.github/ISSUE_TEMPLATE/bug_report.yml b/vue-devtools/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000000000000000000000000000000000000..ebd154bd1f6900ca59f215db37238aaed0c9019a --- /dev/null +++ b/vue-devtools/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,78 @@ +name: 🐞 Bug report +description: Create a report to help us improve +body: + - type: markdown + attributes: + value: | + **Before You Start...** + + This form is only for submitting bug reports. If you have a usage question + or are unsure if this is really a bug, make sure to: + + - Read the [docs](https://devtools.vuejs.org/) + - Read the [FAQ](https://devtools.vuejs.org/guide/faq.html) + - Ask on [GitHub Discussions](https://github.com/vuejs/devtools/discussions) + - Ask on [Discord Chat](https://chat.vuejs.org/) + + Also try to search for your issue - it may have already been answered or even fixed in the development branch. + However, if you find that an old, closed issue still persists in the latest version, + you should open a new issue using the form below instead of commenting on the old issue. + - type: input + id: version + attributes: + label: Vue devtools version + description: | + Open your browser Extensions page and find the Vue devtools extension. Then write in this field the version number shown next to the Vue devtools extension name. + validations: + required: true + - type: input + id: reproduction-link + attributes: + label: Link to minimal reproduction + description: | + The easiest way to provide a reproduction is by showing the bug in [The SFC Playground](https://sfc.vuejs.org/). + If it cannot be reproduced in the playground and requires a proper build setup, try [StackBlitz](https://vite.new/vue). + If neither of these are suitable, you can always provide a GitHub repository. + + The reproduction should be **minimal** - i.e. it should contain only the bare minimum amount of code needed + to show the bug. See [Bug Reproduction Guidelines](https://github.com/vuejs/core/blob/main/.github/bug-repro-guidelines.md) for more details. + + Please do not just fill in a random link. The issue will be closed if no valid reproduction is provided. + placeholder: Reproduction Link + validations: + required: true + - type: textarea + id: steps-to-reproduce + attributes: + label: Steps to reproduce & screenshots + description: | + What do we need to do after opening your repro in order to make the bug happen in the devtools? Clear and concise reproduction instructions are important for us to be able to triage your issue in a timely manner. Note that you can upload screenshots and use [Markdown](https://guides.github.com/features/mastering-markdown/) to format lists and code. + placeholder: Steps to reproduce + validations: + required: true + - type: textarea + id: expected + attributes: + label: What is expected? + validations: + required: true + - type: textarea + id: actually-happening + attributes: + label: What is actually happening? + validations: + required: true + - type: textarea + id: system-info + attributes: + label: System Info + description: Output of `npx envinfo --system --npmPackages vue --binaries --browsers` + render: shell + placeholder: System, Binaries, Browsers + validations: + required: true + - type: textarea + id: additional-comments + attributes: + label: Any additional comments? + description: e.g. some background/context of how you ran into this bug. diff --git a/vue-devtools/.github/ISSUE_TEMPLATE/config.yml b/vue-devtools/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000000000000000000000000000000000..3a4001789a4ecdca525b13d87a6f48fc3bf77431 --- /dev/null +++ b/vue-devtools/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,14 @@ +blank_issues_enabled: false +contact_links: + - name: I have a performance issue + url: https://devtools.vuejs.org/guide/devtools-perf.html + about: Follow the guide to share performance profiling data with us! + - name: Questions & Discussions + url: https://github.com/vuejs/devtools/discussions + about: Use GitHub discussions for message-board style questions and discussions. + - name: Discord Chat + url: https://chat.vuejs.org + about: Ask questions and discuss with other Vue users in real time. + - name: GitHub Sponsor + url: https://github.com/sponsors/Akryum + about: Love the Vue devtools? Please consider supporting us via GitHub sponsors. diff --git a/vue-devtools/.github/ISSUE_TEMPLATE/feature_request.yml b/vue-devtools/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000000000000000000000000000000000000..b52c4120f5d5a0ae872a92f048c57ddf4e052566 --- /dev/null +++ b/vue-devtools/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,28 @@ +name: 🚀 New feature proposal +description: Suggest an idea for this project +labels: [':sparkles: feature request'] +body: + - type: markdown + attributes: + value: | + **Before You Start...** + + This form is only for submitting feature requests. If you have a usage question + or are unsure if this is really a bug, make sure to: + + - Read the [docs](https://devtools.vuejs.org/) + - Read the [FAQ](https://devtools.vuejs.org/guide/faq.html) + - Ask on [GitHub Discussions](https://github.com/vuejs/devtools/discussions) + - Ask on [Discord Chat](https://chat.vuejs.org/) + + Also try to search for your issue - another user may have already requested something similar! + + - type: textarea + id: problem-description + attributes: + label: What problem does this feature solve? + description: | + Explain your use case, context, and rationale behind this feature request. More importantly, what is the **end user experience** you are trying to build that led to the need for this feature? + placeholder: Problem description + validations: + required: true diff --git a/vue-devtools/.github/PULL_REQUEST_TEMPLATE.md b/vue-devtools/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000000000000000000000000000000..4f8b077713676893eed652b7759266e9e8eebb5b --- /dev/null +++ b/vue-devtools/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,26 @@ + + +### Description + + + +### Additional context + + + +--- + +### What is the purpose of this pull request? + +- [ ] Bug fix +- [ ] New Feature +- [ ] Documentation update +- [ ] Other + +### Before submitting the PR, please make sure you do the following + +- [ ] Read the [Contributing Guidelines](https://devtools.vuejs.org/guide/contributing.html). +- [ ] Read the [Pull Request Guidelines](https://devtools.vuejs.org/guide/contributing.html#pull-request-guidelines) and follow the [Commit Convention](https://github.com/vuejs/devtools/blob/main/.github/commit-convention.md). +- [ ] Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate. +- [ ] Provide a description in this PR that addresses **what** the PR is solving, or reference the issue that it solves (e.g. `fixes #123`). + diff --git a/vue-devtools/.github/commit-convention.md b/vue-devtools/.github/commit-convention.md new file mode 100644 index 0000000000000000000000000000000000000000..baa447479e9c39aedbe5c306a1710c936ce762d1 --- /dev/null +++ b/vue-devtools/.github/commit-convention.md @@ -0,0 +1,92 @@ +## Git Commit Message Convention + +> This is adapted from [Angular's commit convention](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular). + +#### TL;DR: + +Messages must be matched by the following regex: + + +```js +/^(revert: )?(feat|fix|docs|dx|refactor|perf|test|workflow|build|ci|chore|types|wip|release|deps)(\(.+\))?: .{1,50}/ +``` + +#### Examples + +Appears under "Features" header, `dev` subheader: + +``` +feat(dev): add 'comments' option +``` + +Appears under "Bug Fixes" header, `dev` subheader, with a link to issue #28: + +``` +fix(dev): fix dev error + +close #28 +``` + +Appears under "Performance Improvements" header, and under "Breaking Changes" with the breaking change explanation: + +``` +perf(build): remove 'foo' option + +BREAKING CHANGE: The 'foo' option has been removed. +``` + +The following commit and commit `667ecc1` do not appear in the changelog if they are under the same release. If not, the revert commit appears under the "Reverts" header. + +``` +revert: feat(compiler): add 'comments' option + +This reverts commit 667ecc1654a317a13331b17617d973392f415f02. +``` + +### Full Message Format + +A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**: + +``` +(): + + + +