├── .eslintignore
├── .eslintrc.js
├── .github
└── workflows
│ └── gh-pages.yml
├── .gitignore
├── .npmrc
├── .prettierignore
├── .prettierrc.js
├── .stylelintrc.js
├── LICENSE
├── README.md
├── demo
├── .gitignore
├── README.MD
├── index.html
├── package.json
├── src
│ ├── App.css
│ ├── App.tsx
│ ├── Footer.tsx
│ ├── List.tsx
│ ├── favicon.svg
│ ├── header.tsx
│ ├── index.css
│ ├── logo.png
│ ├── logo.svg
│ ├── main.tsx
│ └── vite-env.d.ts
├── tsconfig.json
└── vite.config.ts
├── examples
├── cra-app
│ ├── .env
│ ├── .gitignore
│ ├── .npmrc
│ ├── README.md
│ ├── components
│ │ ├── XButton
│ │ │ ├── A
│ │ │ │ └── B
│ │ │ │ │ └── a.md
│ │ │ ├── index.jsx
│ │ │ └── index.md
│ │ ├── XTable
│ │ │ ├── index.jsx
│ │ │ └── index.md
│ │ ├── XTable2
│ │ │ ├── index.jsx
│ │ │ └── index.md
│ │ ├── aa
│ │ │ └── bb
│ │ │ │ └── index.md
│ │ ├── bb copy 2
│ │ │ └── bb copy
│ │ │ │ └── index.js
│ │ └── index.jsx
│ ├── config-overrides.js
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ ├── logo192.png
│ │ ├── logo512.png
│ │ ├── manifest.json
│ │ └── robots.txt
│ ├── src
│ │ ├── App.css
│ │ ├── App.jsx
│ │ ├── App.test.js
│ │ ├── Form.jsx
│ │ ├── InnerWarpper.jsx
│ │ ├── Pages
│ │ │ ├── PageA
│ │ │ │ └── index.jsx
│ │ │ ├── PageB
│ │ │ │ └── index.jsx
│ │ │ └── index.js
│ │ ├── b.jsx
│ │ ├── index.css
│ │ ├── index.js
│ │ ├── logo.svg
│ │ ├── reportWebVitals.js
│ │ ├── search-filter.module.less
│ │ └── setupTests.js
│ └── yarn.lock
├── umi-app
│ ├── .editorconfig
│ ├── .gitignore
│ ├── .npmrc
│ ├── .prettierignore
│ ├── .prettierrc
│ ├── .umirc.ts
│ ├── README.md
│ ├── components
│ │ ├── XButton
│ │ │ ├── index.jsx
│ │ │ ├── index.md
│ │ │ └── index2.md
│ │ ├── XTable
│ │ │ ├── index.jsx
│ │ │ └── index.md
│ │ ├── XTable2
│ │ │ ├── index.jsx
│ │ │ └── index.md
│ │ └── index.jsx
│ ├── mock
│ │ └── .gitkeep
│ ├── package.json
│ ├── src
│ │ ├── global.less
│ │ └── pages
│ │ │ ├── TableColspanRowspan
│ │ │ ├── index.less
│ │ │ └── index.tsx
│ │ │ ├── index.less
│ │ │ └── index.tsx
│ ├── tsconfig.json
│ └── typings.d.ts
├── vue2-app
│ ├── .gitignore
│ ├── .npmrc
│ ├── README.md
│ ├── babel.config.js
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ └── index.html
│ ├── src
│ │ ├── App.vue
│ │ ├── assets
│ │ │ └── logo.png
│ │ ├── components
│ │ │ ├── App.vue
│ │ │ └── HelloWorld.vue
│ │ └── main.js
│ ├── vue.config.js
│ └── yarn.lock
├── vue3-app
│ ├── .gitignore
│ ├── .npmrc
│ ├── README.md
│ ├── babel.config.js
│ ├── package.json
│ ├── pnpm-lock.yaml
│ ├── public
│ │ ├── favicon.ico
│ │ └── index.html
│ ├── src
│ │ ├── App.vue
│ │ ├── assets
│ │ │ └── logo.png
│ │ ├── components
│ │ │ └── HelloWorld.vue
│ │ └── main.js
│ ├── vue.config.js
│ └── yarn.lock
└── vue3-vite
│ ├── .gitignore
│ ├── .npmrc
│ ├── README.md
│ ├── index.html
│ ├── package.json
│ ├── public
│ └── favicon.ico
│ ├── src
│ ├── App.vue
│ ├── assets
│ │ └── logo.png
│ ├── components
│ │ └── HelloWorld.vue
│ ├── env.d.ts
│ └── main.ts
│ ├── tsconfig.json
│ ├── vite.config.ts
│ └── yarn.lock
├── package.json
├── packages
├── dev-page
│ ├── .gitignore
│ ├── README.md
│ ├── components.d.ts
│ ├── index.html
│ ├── moveDir.js
│ ├── package.json
│ ├── public
│ │ └── vite.svg
│ ├── src
│ │ ├── App.vue
│ │ ├── Layout.vue
│ │ ├── assets
│ │ │ └── vue.svg
│ │ ├── components
│ │ │ └── HelloWorld.vue
│ │ ├── main.ts
│ │ ├── pages
│ │ │ ├── File
│ │ │ │ ├── index.vue
│ │ │ │ └── test.ts
│ │ │ ├── components
│ │ │ │ ├── A
│ │ │ │ │ └── index.vue
│ │ │ │ └── B
│ │ │ │ │ └── index.vue
│ │ │ └── readme
│ │ │ │ └── index.vue
│ │ ├── routes
│ │ │ └── index.ts
│ │ ├── style.css
│ │ ├── style.less
│ │ ├── styles
│ │ │ └── var.less
│ │ ├── utils.ts
│ │ └── vite-env.d.ts
│ ├── tsconfig.json
│ ├── tsconfig.node.json
│ └── vite.config.ts
├── dev-ui
│ ├── .gitignore
│ ├── LICENSE
│ ├── README.md
│ ├── index.html
│ ├── index.js
│ ├── package-lock.json
│ ├── package.json
│ ├── src
│ │ ├── App.vue
│ │ ├── IconCompents
│ │ │ ├── Aim.vue
│ │ │ ├── Ant.vue
│ │ │ ├── Close.vue
│ │ │ ├── Outline.vue
│ │ │ ├── Proxy.vue
│ │ │ ├── RightArrow.vue
│ │ │ └── SvgIcon.vue
│ │ ├── Layout
│ │ │ ├── Nav.vue
│ │ │ └── index.vue
│ │ ├── Pages
│ │ │ ├── Docs
│ │ │ │ ├── SliderBar.vue
│ │ │ │ ├── SliderLink.vue
│ │ │ │ └── index.vue
│ │ │ └── Setting
│ │ │ │ └── index.vue
│ │ ├── api
│ │ │ └── index.ts
│ │ ├── assets
│ │ │ ├── General.svg
│ │ │ └── logo.png
│ │ ├── components
│ │ │ ├── AimMode.vue
│ │ │ ├── Dialog.vue
│ │ │ ├── Folder.vue
│ │ │ ├── OverLayer.ts
│ │ │ └── ProxyMode.vue
│ │ ├── env.d.ts
│ │ ├── hooks
│ │ │ ├── index.ts
│ │ │ ├── useDocs.ts
│ │ │ ├── useHotkeys.ts
│ │ │ ├── usePrefix.ts
│ │ │ ├── useRequest.ts
│ │ │ ├── useRoute.ts
│ │ │ └── useStore.ts
│ │ ├── main.ts
│ │ ├── style
│ │ │ ├── code.css
│ │ │ ├── md.less
│ │ │ ├── overLayer.less
│ │ │ └── vars.less
│ │ └── utils
│ │ │ ├── api.ts
│ │ │ ├── index.ts
│ │ │ └── launchEditor.ts
│ ├── tsconfig.json
│ └── vite.config.ts
└── visual-dev
│ ├── LICENSE
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── src
│ ├── ast
│ │ ├── index.ts
│ │ ├── injectComponent.ts
│ │ ├── insertReactAttr.ts
│ │ └── insertVueAttr.ts
│ ├── index.ts
│ ├── server
│ │ ├── MiddleWare
│ │ │ ├── analysisFile.ts
│ │ │ ├── getConfig.ts
│ │ │ ├── getMenu.ts
│ │ │ ├── index.ts
│ │ │ ├── injectFile.ts
│ │ │ └── pathMap.ts
│ │ ├── createServer.ts
│ │ └── index.ts
│ ├── types
│ │ ├── payload.ts
│ │ └── types.d.ts
│ ├── umi
│ │ └── index.ts
│ ├── utils
│ │ ├── index.ts
│ │ ├── parsePath.ts
│ │ ├── resolvePath.ts
│ │ └── uid.ts
│ ├── vite
│ │ └── index.ts
│ └── webpack
│ │ ├── analysisPlugin.ts
│ │ ├── index.ts
│ │ ├── injectFile.ts
│ │ ├── parseReactLoader.ts
│ │ └── parseVueLoader.ts
│ ├── target
│ └── npmlist.json
│ └── tsconfig.json
├── pnpm-lock.yaml
├── pnpm-workspace.yaml
├── scripts
├── clear.js
├── demo.js
└── moveFiles.js
├── tsconfig.json
└── types
└── types.d.ts
/.eslintignore:
--------------------------------------------------------------------------------
1 | dist
2 | examples
3 | packages/visual-dev/dev-ui
4 | packages/visual-dev/dist
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | const { defineConfig } = require('eslint-define-config');
2 |
3 | module.exports = defineConfig({
4 | root: true,
5 | parserOptions: {
6 | tsconfigRootDir: __dirname,
7 | sourceType: 'module',
8 | ecmaVersion: 2020,
9 | },
10 | rules: {
11 | 'no-param-reassign': 0,
12 | },
13 | extends: [require.resolve('@umijs/fabric/dist/eslint')],
14 | });
15 |
--------------------------------------------------------------------------------
/.github/workflows/gh-pages.yml:
--------------------------------------------------------------------------------
1 | name: pnpm Example Workflow
2 | on:
3 | push:
4 | jobs:
5 | build:
6 | runs-on: ubuntu-20.04
7 | strategy:
8 | matrix:
9 | node-version: [16]
10 | steps:
11 | - uses: actions/checkout@v2
12 | - uses: pnpm/action-setup@v2.0.1
13 | with:
14 | version: 6.20.3
15 | - name: Use Node.js ${{ matrix.node-version }}
16 | uses: actions/setup-node@v2
17 | with:
18 | node-version: ${{ matrix.node-version }}
19 | cache: 'pnpm'
20 | - name: Install dependencies
21 | run: pnpm install
22 | - name: Run unit build
23 | run: pnpm run build
24 | - name: Deploy to gh-pages
25 | uses: peaceiris/actions-gh-pages@v3
26 | with:
27 | deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
28 | publish_dir: ./demo/dist
29 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | dist
4 | *.log
5 | explorations
6 | .idea
7 | *.local
8 | .vscode/
9 | packages/visual-dev/package-lock.json
10 | packages/visual-dev/dev-ui
11 | packages/visual-dev/plugins
12 | packages/visual-dev/target
13 | demo/dev-ui
14 | demo/plugins
15 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | shamefully-hoist = true
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | docs/.vitepress/dist/
2 | packages/vite/dist/
3 | packages/*/CHANGELOG.md
4 | LICENSE.md
5 | .prettierignore
6 | yarn.lock
7 | .gitignore
8 | LICENSE
9 | .editorconfig
10 | .gitkeep
11 | .eslintignore
12 | examples
13 | public
14 | *.png
15 | assets
16 | .npmrc
17 | *.svg
--------------------------------------------------------------------------------
/.prettierrc.js:
--------------------------------------------------------------------------------
1 | const fabric = require('@umijs/fabric')
2 |
3 | module.exports = {
4 | ...fabric.prettier
5 | }
6 |
--------------------------------------------------------------------------------
/.stylelintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | extends: [require.resolve('@umijs/fabric/dist/stylelint')],
3 | rules: {
4 | // your rules
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 haoming
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 |
visual-dev
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | ## Introduction
11 |
12 | Just one click, you can jump directly to the local IDE source code and **vue** and **react** are supported! !
13 |
14 | 一键直接跳转到本地 IDE 源码,支持 vue 和 react !!
15 |
16 | ## Preview
17 |
18 | 
19 |
20 | ## Motivation
21 |
22 | In a huge project, there are many different components on the page, but it will be very troublesome to find where the component is. Using this plugin, you only need to click to jump to the corresponding position of the ide.
23 |
24 | 在一个大型的项目中,页面上有很多不同的组件,但是要找到组件在哪里会很麻烦。使用这个插件,只需要点击对应的 dom,就能跳转到 IDE 的对应位置。
25 |
26 | ## Installation
27 |
28 | ```bash
29 | npm i visual-dev -D
30 | ```
31 |
32 | ## Options
33 |
34 | ```typescript
35 | type Options = {
36 | /**
37 | * default open vscode.
38 | */
39 | editor: Editor; //vscode webstorm atom sublime textmate emacs macvim phpstorm idea 支持多种编辑器,默认使用 vscode
40 | };
41 | ```
42 |
43 | ## Usage
44 |
45 | webpack
46 |
47 | ```js
48 | // webpack.config.js
49 | const VisualDev = require('visual-dev/plugins/webpack').default;
50 |
51 | module.exports = {
52 | plugins: [
53 | new VisualDev({
54 | editor: 'vscode',
55 | }),
56 | ],
57 | };
58 | ```
59 |
60 | umi
61 |
62 | ```js
63 | // .umiirc.ts
64 | {
65 | plugins: ['visual-dev/plugins/umi'];
66 | visualDev: {
67 | editor: 'vscode';
68 | }
69 | }
70 | ```
71 |
72 | vite
73 |
74 | ```js
75 | import { defineConfig } from 'vite';
76 | import vue from '@vitejs/plugin-vue';
77 | import VisualDev from 'visual-dev/plugins/vite';
78 |
79 | // https://vitejs.dev/config/
80 | export default defineConfig({
81 | plugins: [
82 | vue(),
83 | VisualDev({
84 | editor: 'vscode',
85 | }),
86 | ],
87 | });
88 | ```
89 |
90 | the project is successfully launched, a small icon will appear in the lower left corner of the screen, which can be triggered by clicking.
91 |
92 | 项目启动成功后,在屏幕的左下角会有一个小图标出现,点击即可触发。
93 |
94 | ## WeChat
95 |
96 |
97 |
98 | ## License
99 |
100 | [MIT LICENSE](./LICENSE)
101 |
--------------------------------------------------------------------------------
/demo/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/demo/README.MD:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wen-haoming/visual-dev/c5f9f6eac32ff003da0c0babe85da57d650f0a7f/demo/README.MD
--------------------------------------------------------------------------------
/demo/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
10 | Vite App
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/demo/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vite-project",
3 | "version": "0.0.0",
4 | "scripts": {
5 | "dev": "vite",
6 | "build": "tsc && vite build",
7 | "preview": "vite preview"
8 | },
9 | "dependencies": {
10 | "react": "^17.0.2",
11 | "react-dom": "^17.0.2"
12 | },
13 | "devDependencies": {
14 | "@types/react": "^17.0.33",
15 | "@types/react-dom": "^17.0.10",
16 | "@vitejs/plugin-react": "^1.0.7",
17 | "typescript": "^4.4.4",
18 | "vite": "^2.7.2"
19 | },
20 | "license": "ISC"
21 | }
22 |
--------------------------------------------------------------------------------
/demo/src/App.css:
--------------------------------------------------------------------------------
1 | :root {
2 | --brand: #57a9fb;
3 | --brand-font-color: #86909c;
4 | }
5 | .App {
6 | min-height: 100vh;
7 | display: flex;
8 | flex-direction: column;
9 | align-items: center;
10 | justify-content: center;
11 | font-size: calc(10px + 2vmin);
12 | }
13 |
14 | .App-logo {
15 | height: 40vmin;
16 | pointer-events: none;
17 | }
18 |
19 | .logo {
20 | display: flex;
21 | align-items: center;
22 | font-size: calc(10px + 5vmin);
23 | font-weight: 500;
24 | }
25 |
26 | .logo-hl {
27 | margin-right: 1rem;
28 | background-color: var(--brand);
29 | padding: 2px 10px;
30 | color: #fff;
31 | border-radius: 5px;
32 | }
33 | .list {
34 | font-size: 18px;
35 | text-align: left;
36 | }
37 |
38 | .logo-shl {
39 | color: var(--brand);
40 | }
41 |
42 | .App-link {
43 | color: var(--brand);
44 | }
45 |
46 | .title {
47 | max-width: 980px;
48 | padding: 0 50px;
49 | color: var(--brand-font-color);
50 | }
51 |
52 | li {
53 | color: var(--brand-font-color);
54 | }
55 |
56 | .code {
57 | font-size: 18px;
58 | background-color: var(--brand);
59 | color: #fff;
60 | padding: 5px 15px;
61 | border-radius: 3px;
62 | font-weight: 600;
63 | }
64 |
65 | .container {
66 | margin-top: 30px;
67 | margin-bottom: 40px;
68 | text-align: center;
69 | display: flex;
70 | align-items: center;
71 | color: var(--brand-font-color);
72 | font-size: 22px;
73 | }
74 |
75 | .container .text {
76 | display: inline-block;
77 | margin-right: 20px;
78 | animation: twinkling 2s ease-in-out infinite;
79 | }
80 |
81 | .vd-aim {
82 | }
83 |
84 | @keyframes twinkling {
85 | 0% {
86 | opacity: 0.5;
87 | filter: alpha(opacity=20);
88 | transform: scale(1);
89 | }
90 |
91 | 50% {
92 | opacity: 1;
93 | filter: alpha(opacity=50);
94 | transform: scale(1.12);
95 | }
96 |
97 | 100% {
98 | opacity: 0.5;
99 | filter: alpha(opacity=20);
100 | transform: scale(1);
101 | }
102 | }
103 |
104 | .footer {
105 | margin: 50px auto;
106 | font-size: 25px;
107 | }
108 |
109 | .footer .about-me {
110 | text-decoration: none;
111 | font-size: 16px;
112 | margin: 0 20px;
113 | color: var(--brand-font-color);
114 | }
115 |
116 | .footer .anticon-github {
117 | color: #000;
118 | }
119 |
--------------------------------------------------------------------------------
/demo/src/App.tsx:
--------------------------------------------------------------------------------
1 | import { useEffect, useRef } from 'react';
2 | import Header from './header';
3 | import List from './List';
4 | import './App.css';
5 | import Footer from './Footer';
6 |
7 | function App() {
8 | const wrapper = useRef();
9 |
10 | useEffect(() => {
11 | setTimeout(() => {
12 | const aimDom = document.querySelector('.vd-aim');
13 | if (aimDom) {
14 | wrapper.current.appendChild(aimDom);
15 | }
16 | }, 500);
17 | }, []);
18 |
19 | return (
20 |
21 |
22 |
23 |
Just one click, you can jump directly to the local IDE source code!
24 |
25 |
26 | Try clicking and dragging 👉
27 |
28 |
npm i -D visual-dev
29 |
30 |
31 | );
32 | }
33 |
34 | export default App;
35 |
--------------------------------------------------------------------------------
/demo/src/Footer.tsx:
--------------------------------------------------------------------------------
1 | const Footer = () => {
2 | return (
3 |
23 | );
24 | };
25 |
26 | export default Footer;
27 |
--------------------------------------------------------------------------------
/demo/src/List.tsx:
--------------------------------------------------------------------------------
1 | const List = () => {
2 | return (
3 |
4 | 😊 Support Vue and React
5 | 👀 Simple configuration
6 | 🚀 Open the browser extremely fast
7 |
8 | );
9 | };
10 |
11 | export default List;
12 |
--------------------------------------------------------------------------------
/demo/src/favicon.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/demo/src/header.tsx:
--------------------------------------------------------------------------------
1 | import logo from './logo.png';
2 |
3 | const Header = () => {
4 | return (
5 |
11 | );
12 | };
13 |
14 | export default Header;
15 |
--------------------------------------------------------------------------------
/demo/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
4 | 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
5 | -webkit-font-smoothing: antialiased;
6 | -moz-osx-font-smoothing: grayscale;
7 | }
8 |
9 | code {
10 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
11 | }
12 |
--------------------------------------------------------------------------------
/demo/src/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wen-haoming/visual-dev/c5f9f6eac32ff003da0c0babe85da57d650f0a7f/demo/src/logo.png
--------------------------------------------------------------------------------
/demo/src/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/demo/src/main.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import './index.css';
4 | import App from './App';
5 |
6 | ReactDOM.render(
7 |
8 |
9 | ,
10 | document.getElementById('root'),
11 | );
12 |
--------------------------------------------------------------------------------
/demo/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/demo/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ESNext",
4 | "useDefineForClassFields": true,
5 | "lib": ["DOM", "DOM.Iterable", "ESNext"],
6 | "allowJs": false,
7 | "skipLibCheck": true,
8 | "esModuleInterop": false,
9 | "allowSyntheticDefaultImports": true,
10 | "strict": false,
11 | "forceConsistentCasingInFileNames": true,
12 | "module": "ESNext",
13 | "moduleResolution": "Node",
14 | "resolveJsonModule": true,
15 | "isolatedModules": true,
16 | "noEmit": true,
17 | "jsx": "react-jsx"
18 | },
19 | "include": ["./src"]
20 | }
21 |
--------------------------------------------------------------------------------
/demo/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite';
2 | import react from '@vitejs/plugin-react';
3 | import VisualDev from './plugins/vite';
4 |
5 | // https://vitejs.dev/config/
6 | export default defineConfig({
7 | plugins: [VisualDev({ noServer: true }), react()],
8 | base: '/visual-dev',
9 | });
10 |
--------------------------------------------------------------------------------
/examples/cra-app/.env:
--------------------------------------------------------------------------------
1 | SKIP_PREFLIGHT_CHECK=true
--------------------------------------------------------------------------------
/examples/cra-app/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/examples/cra-app/.npmrc:
--------------------------------------------------------------------------------
1 | shamefully-hoist = false
--------------------------------------------------------------------------------
/examples/cra-app/README.md:
--------------------------------------------------------------------------------
1 | # Getting Started with Create React App
2 |
3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4 |
5 | ## Available Scripts
6 |
7 | In the project directory, you can run:
8 |
9 | ### `yarn start`
10 |
11 | Runs the app in the development mode.\
12 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
13 |
14 | The page will reload if you make edits.\
15 | You will also see any lint errors in the console.
16 |
17 | ### `yarn test`
18 |
19 | Launches the test runner in the interactive watch mode.\
20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21 |
22 | ### `yarn build`
23 |
24 | Builds the app for production to the `build` folder.\
25 | It correctly bundles React in production mode and optimizes the build for the best performance.
26 |
27 | The build is minified and the filenames include the hashes.\
28 | Your app is ready to be deployed!
29 |
30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31 |
32 | ### `yarn eject`
33 |
34 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
35 |
36 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37 |
38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
39 |
40 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
41 |
42 | ## Learn More
43 |
44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45 |
46 | To learn React, check out the [React documentation](https://reactjs.org/).
47 |
48 | ### Code Splitting
49 |
50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
51 |
52 | ### Analyzing the Bundle Size
53 |
54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
55 |
56 | ### Making a Progressive Web App
57 |
58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
59 |
60 | ### Advanced Configuration
61 |
62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
63 |
64 | ### Deployment
65 |
66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
67 |
68 | ### `yarn build` fails to minify
69 |
70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
71 |
--------------------------------------------------------------------------------
/examples/cra-app/components/XButton/A/B/a.md:
--------------------------------------------------------------------------------
1 | # 123
2 |
3 | ## 1213123
--------------------------------------------------------------------------------
/examples/cra-app/components/XButton/index.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | const XButton = ()=>{
4 | return Button
5 | }
6 |
7 | export default XButton
--------------------------------------------------------------------------------
/examples/cra-app/components/XButton/index.md:
--------------------------------------------------------------------------------
1 | # XButton
2 | ## 1231
3 |
4 | ### 123123
5 |
6 | ```ts
7 | const a = 123;
8 | const b = function(){
9 | return 'sdfsdf'
10 | }
11 | ```
--------------------------------------------------------------------------------
/examples/cra-app/components/XTable/index.jsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wen-haoming/visual-dev/c5f9f6eac32ff003da0c0babe85da57d650f0a7f/examples/cra-app/components/XTable/index.jsx
--------------------------------------------------------------------------------
/examples/cra-app/components/XTable/index.md:
--------------------------------------------------------------------------------
1 | # Xtable
2 |
3 | ## 1231
4 |
5 | ### 123123
--------------------------------------------------------------------------------
/examples/cra-app/components/XTable2/index.jsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wen-haoming/visual-dev/c5f9f6eac32ff003da0c0babe85da57d650f0a7f/examples/cra-app/components/XTable2/index.jsx
--------------------------------------------------------------------------------
/examples/cra-app/components/XTable2/index.md:
--------------------------------------------------------------------------------
1 | # Xtable2
2 |
3 | ## 1231
4 |
5 | ### 123123
--------------------------------------------------------------------------------
/examples/cra-app/components/aa/bb/index.md:
--------------------------------------------------------------------------------
1 |
2 | ## 123
3 |
4 | | 参数 | 说明 | 类型 |
5 | |---------|--------------|------------------------------------------------------|
6 | | current | 当前值 | `number` |
7 | | inc | 加,默认加 1 | `(delta?:number) => void` |
8 | | dec | 减,默认减 1 | `(delta?:number) => void` |
9 | | set | 设置 current | `(value: number` \| `((c: number) => number)) => void` |
10 | | reset | 重置为默认值 | `() => void` |
11 |
12 | ### Params
13 |
14 | | 参数 | 说明 | 类型 | 默认值 |
15 | |--------------|--------|----------|--------|
16 | | initialValue | 默认值 | `number` | 0 |
17 | | min | 最小值 | `number` | - |
18 | | max | 最大值 | `number` | - |
--------------------------------------------------------------------------------
/examples/cra-app/components/bb copy 2/bb copy/index.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wen-haoming/visual-dev/c5f9f6eac32ff003da0c0babe85da57d650f0a7f/examples/cra-app/components/bb copy 2/bb copy/index.js
--------------------------------------------------------------------------------
/examples/cra-app/components/index.jsx:
--------------------------------------------------------------------------------
1 | 1231
--------------------------------------------------------------------------------
/examples/cra-app/config-overrides.js:
--------------------------------------------------------------------------------
1 | const { override, addWebpackPlugin } = require('customize-cra')
2 | const path = require('path')
3 | // const WebpackDevToolPLugin = require('visual-dev/webpack').default
4 | const WebpackDevToolPLugin = require('../../packages/visual-dev/plugins/webpack').default
5 |
6 | module.exports = override(addWebpackPlugin(new WebpackDevToolPLugin({
7 | injectFile:false,
8 | analysisPlugin:{
9 | rootPath:'./src/Pages'
10 | },
11 | shortcuts:{
12 | inspect:['c','v','b']
13 | }
14 | })))
15 |
--------------------------------------------------------------------------------
/examples/cra-app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cra-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@ant-design/icons": "^4.7.0",
7 | "@ant-design/pro-form": "^1.43.1",
8 | "@ant-design/pro-layout": "^6.26.2",
9 | "@testing-library/jest-dom": "^5.11.4",
10 | "@testing-library/react": "^11.1.0",
11 | "@testing-library/user-event": "^12.1.10",
12 | "antd": "^4.16.13",
13 | "customize-cra": "^1.0.0",
14 | "react": "^17.0.2",
15 | "react-dom": "^17.0.2",
16 | "react-scripts": "4.0.3",
17 | "visual-dev": "0.3.0",
18 | "web-vitals": "^1.0.1"
19 | },
20 | "scripts": {
21 | "start": "REACT_APP_NO_CLEAR_CONSOLE=true react-app-rewired start",
22 | "build": "react-app-rewired build",
23 | "test": "react-app-rewired test",
24 | "eject": "react-app-rewired eject"
25 | },
26 | "eslintConfig": {
27 | "extends": [
28 | "react-app",
29 | "react-app/jest"
30 | ]
31 | },
32 | "browserslist": {
33 | "production": [
34 | ">0.2%",
35 | "not dead",
36 | "not op_mini all"
37 | ],
38 | "development": [
39 | "last 1 chrome version",
40 | "last 1 firefox version",
41 | "last 1 safari version"
42 | ]
43 | },
44 | "devDependencies": {
45 | "react-app-rewired": "^2.1.8"
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/examples/cra-app/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wen-haoming/visual-dev/c5f9f6eac32ff003da0c0babe85da57d650f0a7f/examples/cra-app/public/favicon.ico
--------------------------------------------------------------------------------
/examples/cra-app/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
17 |
18 |
27 | React App
28 |
29 |
30 | You need to enable JavaScript to run this app.
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/examples/cra-app/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wen-haoming/visual-dev/c5f9f6eac32ff003da0c0babe85da57d650f0a7f/examples/cra-app/public/logo192.png
--------------------------------------------------------------------------------
/examples/cra-app/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wen-haoming/visual-dev/c5f9f6eac32ff003da0c0babe85da57d650f0a7f/examples/cra-app/public/logo512.png
--------------------------------------------------------------------------------
/examples/cra-app/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/examples/cra-app/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/examples/cra-app/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | padding-top: 100px;
4 | }
5 |
6 | .App-logo {
7 | height: 40vmin;
8 | pointer-events: none;
9 | }
10 |
11 | @media (prefers-reduced-motion: no-preference) {
12 | .App-logo {
13 | animation: App-logo-spin infinite 20s linear;
14 | }
15 | }
16 |
17 | .App-header {
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
40 | :root{
41 | --b:red;
42 | }
--------------------------------------------------------------------------------
/examples/cra-app/src/App.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import logo from './logo.svg';
3 | import './App.css';
4 | import B from './b';
5 | import Form from './Form';
6 | import PageA from './Pages/PageA'
7 | import PageB from './Pages/PageB'
8 |
9 | function App() {
10 |
11 | return ;
34 | }
35 |
36 | export default App;
37 |
--------------------------------------------------------------------------------
/examples/cra-app/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render( );
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/examples/cra-app/src/Form.jsx:
--------------------------------------------------------------------------------
1 | import React, { useState } from 'react';
2 | import { Card, Input, Tabs } from 'antd';
3 | import { UpOutlined, DownOutlined } from '@ant-design/icons';
4 | import ProForm, { QueryFilter, ProFormText, ProFormDatePicker } from '@ant-design/pro-form';
5 | import styles from './search-filter.module.less';
6 |
7 | const { TabPane } = Tabs;
8 | const AdvancedSearch = (props) => {
9 | const { onSearch, onTypeChange, defaultType = 'articles', onFilterChange } = props;
10 | const [searchText, setSearchText] = useState();
11 | const [showFilter, setShowFilter] = useState(true);
12 | const quickSearch = ['小程序开发', '入驻', 'ISV 权限'];
13 | return (
14 |
15 |
{
16 | setSearchText(e.target.value);
17 | }} onSearch={onSearch} style={{ maxWidth: 522, width: '100%' }}/>
18 |
19 | {quickSearch.map((text) => ( {
20 | setSearchText(text);
21 | if (onSearch) {
22 | onSearch(text);
23 | }
24 | }}>
25 | {text}
26 | ))}
27 |
28 |
29 | {
30 | setShowFilter(!showFilter);
31 | }}>
32 | 高级筛选 {showFilter ? : }
33 | }>
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | );
48 | };
49 | export default AdvancedSearch;
50 |
--------------------------------------------------------------------------------
/examples/cra-app/src/InnerWarpper.jsx:
--------------------------------------------------------------------------------
1 | const InnerWarpper = ()=>{
2 | return
3 |
4 |
5 |
InnerWarpper
6 |
7 |
8 |
9 | }
10 |
11 | export default InnerWarpper
--------------------------------------------------------------------------------
/examples/cra-app/src/Pages/PageA/index.jsx:
--------------------------------------------------------------------------------
1 | export default () =>{
2 | return 123
3 | }
4 |
--------------------------------------------------------------------------------
/examples/cra-app/src/Pages/PageB/index.jsx:
--------------------------------------------------------------------------------
1 | export default () =>{
2 | return 123
3 | }
4 |
--------------------------------------------------------------------------------
/examples/cra-app/src/Pages/index.js:
--------------------------------------------------------------------------------
1 | import PageA from './PageA'
2 | import PageB from './PageB'
3 |
4 | export default {
5 | PageA,
6 | PageB
7 | }
8 |
--------------------------------------------------------------------------------
/examples/cra-app/src/b.jsx:
--------------------------------------------------------------------------------
1 | import { Button } from "antd";
2 | import React from 'react';
3 |
4 | const B = () => {
5 | return
6 |
Butto123n112323 Button
7 |
;
8 | };
9 |
10 | export default B;
--------------------------------------------------------------------------------
/examples/cra-app/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/examples/cra-app/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import './index.css';
4 | import App from './App.jsx';
5 | import reportWebVitals from './reportWebVitals';
6 | import 'antd/dist/antd.css'
7 |
8 | ReactDOM.render(
9 |
10 |
11 | ,
12 | document.getElementById('root')
13 | );
14 |
15 | // If you want to start measuring performance in your app, pass a function
16 | // to log results (for example: reportWebVitals(console.log))
17 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
18 | reportWebVitals();
19 |
--------------------------------------------------------------------------------
/examples/cra-app/src/logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/cra-app/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/examples/cra-app/src/search-filter.module.less:
--------------------------------------------------------------------------------
1 | @import '~antd/es/style/themes/default.less';
2 |
3 | .selfTrigger {
4 | margin-left: 12px;
5 | }
6 |
7 | .hiddenFilter {
8 | .filter {
9 | height: 0;
10 | }
11 | :global {
12 | .ant-tabs-top > .ant-tabs-nav {
13 | margin-bottom: 0;
14 | }
15 | }
16 | }
17 |
18 | .filter {
19 | overflow: hidden;
20 | }
21 |
22 | .quickSearch {
23 | display: inline-block;
24 | line-height: 40px;
25 | span {
26 | margin-left: 16px;
27 | color: #999;
28 | cursor: pointer;
29 | &:hover {
30 | opacity: 0.85;
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/examples/cra-app/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/examples/umi-app/.editorconfig:
--------------------------------------------------------------------------------
1 | # http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | charset = utf-8
9 | trim_trailing_whitespace = true
10 | insert_final_newline = true
11 |
12 | [*.md]
13 | trim_trailing_whitespace = false
14 |
15 | [Makefile]
16 | indent_style = tab
17 |
--------------------------------------------------------------------------------
/examples/umi-app/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /npm-debug.log*
6 | /yarn-error.log
7 | /yarn.lock
8 | /package-lock.json
9 |
10 | # production
11 | /dist
12 |
13 | # misc
14 | .DS_Store
15 |
16 | # umi
17 | /src/.umi
18 | /src/.umi-production
19 | /src/.umi-test
20 | /.env.local
21 |
--------------------------------------------------------------------------------
/examples/umi-app/.npmrc:
--------------------------------------------------------------------------------
1 | shamefully-hoist = true
--------------------------------------------------------------------------------
/examples/umi-app/.prettierignore:
--------------------------------------------------------------------------------
1 | **/*.md
2 | **/*.svg
3 | **/*.ejs
4 | **/*.html
5 | package.json
6 | .umi
7 | .umi-production
8 | .umi-test
9 | .editorconfig
10 | .gitkeep
11 |
--------------------------------------------------------------------------------
/examples/umi-app/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "singleQuote": true,
3 | "trailingComma": "all",
4 | "printWidth": 80,
5 | "overrides": [
6 | {
7 | "files": ".prettierrc",
8 | "options": { "parser": "json" }
9 | }
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/examples/umi-app/.umirc.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'umi';
2 |
3 | export default defineConfig({
4 | nodeModulesTransform: {
5 | type: 'none',
6 | },
7 | routes: [{ path: '/', component: '@/pages/index' }],
8 | fastRefresh: {},
9 | // plugins:[require.resolve('../../packages/visual-dev/plugins/umi'),],
10 | // visualDev:{}
11 | // plugins:['visual-dev/plugins/umi'],
12 | // chainWebpack(memo) {
13 | // memo.plugin('web-devtools').use(WebpackDevtoolPlugin);
14 | // },
15 | });
16 |
--------------------------------------------------------------------------------
/examples/umi-app/README.md:
--------------------------------------------------------------------------------
1 | # umi project
2 |
3 | ## Getting Started
4 |
5 | Install dependencies,
6 |
7 | ```bash
8 | $ yarn
9 | ```
10 |
11 | Start the dev server,
12 |
13 | ```bash
14 | $ yarn start
15 | ```
16 |
--------------------------------------------------------------------------------
/examples/umi-app/components/XButton/index.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | const XButton = ()=>{
4 | return Button
5 | }
6 |
7 | export default XButton
--------------------------------------------------------------------------------
/examples/umi-app/components/XButton/index.md:
--------------------------------------------------------------------------------
1 | # XButton
2 | ## 1231
3 |
4 | ### 123123
5 |
6 |
7 |
8 | ```ts
9 | const a = 123;
10 | const b = function(){
11 | return 'sdfsdf'
12 | }
13 | ```
--------------------------------------------------------------------------------
/examples/umi-app/components/XButton/index2.md:
--------------------------------------------------------------------------------
1 | # index2.md
2 |
--------------------------------------------------------------------------------
/examples/umi-app/components/XTable/index.jsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wen-haoming/visual-dev/c5f9f6eac32ff003da0c0babe85da57d650f0a7f/examples/umi-app/components/XTable/index.jsx
--------------------------------------------------------------------------------
/examples/umi-app/components/XTable/index.md:
--------------------------------------------------------------------------------
1 | # Xtable
2 |
3 | ## 1231
4 |
5 | ### 123123
--------------------------------------------------------------------------------
/examples/umi-app/components/XTable2/index.jsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wen-haoming/visual-dev/c5f9f6eac32ff003da0c0babe85da57d650f0a7f/examples/umi-app/components/XTable2/index.jsx
--------------------------------------------------------------------------------
/examples/umi-app/components/XTable2/index.md:
--------------------------------------------------------------------------------
1 | # Xtable2
2 |
3 | ## 1231
4 |
5 | ### 123123
--------------------------------------------------------------------------------
/examples/umi-app/components/index.jsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wen-haoming/visual-dev/c5f9f6eac32ff003da0c0babe85da57d650f0a7f/examples/umi-app/components/index.jsx
--------------------------------------------------------------------------------
/examples/umi-app/mock/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wen-haoming/visual-dev/c5f9f6eac32ff003da0c0babe85da57d650f0a7f/examples/umi-app/mock/.gitkeep
--------------------------------------------------------------------------------
/examples/umi-app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "scripts": {
4 | "start": "umi dev",
5 | "build": "umi build",
6 | "postinstall": "umi generate tmp",
7 | "prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
8 | "test": "umi-test",
9 | "test:coverage": "umi-test --coverage"
10 | },
11 | "gitHooks": {
12 | "pre-commit": "lint-staged"
13 | },
14 | "lint-staged": {
15 | "*.{js,jsx,less,md,json}": [
16 | "prettier --write"
17 | ],
18 | "*.ts?(x)": [
19 | "prettier --parser=typescript --write"
20 | ]
21 | },
22 | "dependencies": {
23 | "@ant-design/icons": "^4.0.2",
24 | "@ant-design/pro-layout": "^6.5.0",
25 | "react": "17.x",
26 | "react-dom": "17.x",
27 | "umi": "^3.5.17",
28 | "visual-dev": "0.3.1"
29 | },
30 | "devDependencies": {
31 | "@types/react": "^17.0.0",
32 | "@types/react-dom": "^17.0.0",
33 | "@umijs/preset-react": "1.x",
34 | "@umijs/preset-ui": "^2.2.9",
35 | "@umijs/test": "^3.5.17",
36 | "lint-staged": "^10.0.7",
37 | "prettier": "^2.2.0",
38 | "typescript": "^4.1.2",
39 | "yorkie": "^2.0.0"
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/examples/umi-app/src/global.less:
--------------------------------------------------------------------------------
1 | #root {
2 | width: 100%;
3 | height: 100%;
4 | }
5 |
--------------------------------------------------------------------------------
/examples/umi-app/src/pages/TableColspanRowspan/index.less:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wen-haoming/visual-dev/c5f9f6eac32ff003da0c0babe85da57d650f0a7f/examples/umi-app/src/pages/TableColspanRowspan/index.less
--------------------------------------------------------------------------------
/examples/umi-app/src/pages/TableColspanRowspan/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import styles from "./index.less";
3 | import { Table } from "antd";
4 |
5 | // In the fifth row, other columns are merged into first column
6 | // by setting it's colSpan to be 0
7 | const renderContent = (value, row, index) => {
8 | const obj = {
9 | children: value,
10 | props: {}
11 | };
12 | if (index === 4) {
13 | obj.props.colSpan = 0;
14 | }
15 | return obj;
16 | };
17 |
18 | const columns = [
19 | {
20 | title: "Name",
21 | dataIndex: "name",
22 | render: (text, row, index) => {
23 | if (index < 4) {
24 | return {text} ;
25 | }
26 | return {
27 | children: {text} ,
28 | props: {
29 | colSpan: 5
30 | }
31 | };
32 | }
33 | },
34 | {
35 | title: "Age",
36 | dataIndex: "age",
37 | render: renderContent
38 | },
39 | {
40 | title: "Home phone",
41 | colSpan: 2,
42 | dataIndex: "tel",
43 | render: (value, row, index) => {
44 | const obj = {
45 | children: value,
46 | props: {}
47 | };
48 | if (index === 2) {
49 | obj.props.rowSpan = 2;
50 | }
51 | // These two are merged into above cell
52 | if (index === 3) {
53 | obj.props.rowSpan = 0;
54 | }
55 | if (index === 4) {
56 | obj.props.colSpan = 0;
57 | }
58 | return obj;
59 | }
60 | },
61 | {
62 | title: "Phone",
63 | colSpan: 0,
64 | dataIndex: "phone",
65 | render: renderContent
66 | },
67 | {
68 | title: "Address",
69 | dataIndex: "address",
70 | render: renderContent
71 | }
72 | ];
73 |
74 | const data = [
75 | {
76 | key: "1",
77 | name: "John Brown",
78 | age: 32,
79 | tel: "0571-22098909",
80 | phone: 18889898989,
81 | address: "New York No. 1 Lake Park"
82 | },
83 | {
84 | key: "2",
85 | name: "Jim Green",
86 | tel: "0571-22098333",
87 | phone: 18889898888,
88 | age: 42,
89 | address: "London No. 1 Lake Park"
90 | },
91 | {
92 | key: "3",
93 | name: "Joe Black",
94 | age: 32,
95 | tel: "0575-22098909",
96 | phone: 18900010002,
97 | address: "Sidney No. 1 Lake Park"
98 | },
99 | {
100 | key: "4",
101 | name: "Jim Red",
102 | age: 18,
103 | tel: "0575-22098909",
104 | phone: 18900010002,
105 | address: "London No. 2 Lake Park"
106 | },
107 | {
108 | key: "5",
109 | name: "Jake White",
110 | age: 18,
111 | tel: "0575-22098909",
112 | phone: 18900010002,
113 | address: "Dublin No. 2 Lake Park"
114 | }
115 | ];
116 |
117 | export default () => (
118 |
123 | );
124 |
--------------------------------------------------------------------------------
/examples/umi-app/src/pages/index.less:
--------------------------------------------------------------------------------
1 | .title {
2 | background: rgb(121, 242, 157);
3 | }
4 |
5 | #components-layout-demo-top-side-2 .logo {
6 | float: left;
7 | width: 120px;
8 | height: 31px;
9 | margin: 16px 24px 16px 0;
10 | background: rgba(255, 255, 255, 0.3);
11 | }
12 |
13 | .ant-row-rtl #components-layout-demo-top-side-2 .logo {
14 | float: right;
15 | margin: 16px 0 16px 24px;
16 | }
17 |
18 | .site-layout-background {
19 | background: #fff;
20 | }
21 |
--------------------------------------------------------------------------------
/examples/umi-app/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import { Layout, Menu, Breadcrumb, Button, Avatar } from 'antd';
2 | import { UserOutlined, LaptopOutlined, NotificationOutlined } from '@ant-design/icons';
3 | import './index.less';
4 | import TableColspanRowspan from './TableColspanRowspan';
5 | const {
6 | SubMenu
7 | } = Menu;
8 | const {
9 | Header,
10 | Content,
11 | Sider
12 | } = Layout;
13 | export default (() => {
14 | return
17 |
18 |
19 |
20 |
21 | nav 1
22 | nav 2
23 | nav 3
24 |
25 |
26 |
27 |
28 |
32 | } title="subnav 1">
33 | option1
34 | option2
35 | option3
36 | option4
37 |
38 | } title="subnav 2">
39 | option5
40 | option6
41 | option7
42 | option8
43 |
44 | } title="subnav 3">
45 | option9
46 | option10
47 | option11
48 | option12
49 |
50 |
51 |
52 |
55 | Button ;
58 | Home
59 | List
60 | App
61 |
62 | Button ;Avatar ;Button ;Button ;Button ;
67 | Content
68 |
69 |
70 |
71 | ;
72 | });
73 |
--------------------------------------------------------------------------------
/examples/umi-app/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "esnext",
4 | "module": "esnext",
5 | "moduleResolution": "node",
6 | "resolveJsonModule": true,
7 | "importHelpers": true,
8 | "jsx": "react-jsx",
9 | "esModuleInterop": true,
10 | "sourceMap": true,
11 | "baseUrl": "./",
12 | "strict": true,
13 | "paths": {
14 | "@/*": ["src/*"],
15 | "@@/*": ["src/.umi/*"]
16 | },
17 | "allowSyntheticDefaultImports": true
18 | },
19 | "include": [
20 | "mock/**/*",
21 | "src/**/*",
22 | "config/**/*",
23 | ".umirc.ts",
24 | "typings.d.ts"
25 | ],
26 | "exclude": [
27 | "node_modules",
28 | "lib",
29 | "es",
30 | "dist",
31 | "typings",
32 | "**/__test__",
33 | "test",
34 | "docs",
35 | "tests"
36 | ]
37 | }
38 |
--------------------------------------------------------------------------------
/examples/umi-app/typings.d.ts:
--------------------------------------------------------------------------------
1 | declare module '*.css';
2 | declare module '*.less';
3 | declare module '*.png';
4 | declare module '*.svg' {
5 | export function ReactComponent(
6 | props: React.SVGProps,
7 | ): React.ReactElement;
8 | const url: string;
9 | export default url;
10 | }
11 |
--------------------------------------------------------------------------------
/examples/vue2-app/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 |
6 | # local env files
7 | .env.local
8 | .env.*.local
9 |
10 | # Log files
11 | npm-debug.log*
12 | yarn-debug.log*
13 | yarn-error.log*
14 | pnpm-debug.log*
15 |
16 | # Editor directories and files
17 | .idea
18 | .vscode
19 | *.suo
20 | *.ntvs*
21 | *.njsproj
22 | *.sln
23 | *.sw?
24 |
--------------------------------------------------------------------------------
/examples/vue2-app/.npmrc:
--------------------------------------------------------------------------------
1 | shamefully-hoist = true
--------------------------------------------------------------------------------
/examples/vue2-app/README.md:
--------------------------------------------------------------------------------
1 | # vue2-app
2 |
3 | ## Project setup
4 | ```
5 | npm install
6 | ```
7 |
8 | ### Compiles and hot-reloads for development
9 | ```
10 | npm run serve
11 | ```
12 |
13 | ### Compiles and minifies for production
14 | ```
15 | npm run build
16 | ```
17 |
18 | ### Lints and fixes files
19 | ```
20 | npm run lint
21 | ```
22 |
23 | ### Customize configuration
24 | See [Configuration Reference](https://cli.vuejs.org/config/).
25 |
--------------------------------------------------------------------------------
/examples/vue2-app/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/cli-plugin-babel/preset'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/examples/vue2-app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vue2-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "start": "vue-cli-service serve",
7 | "build": "vue-cli-service build",
8 | "lint": "vue-cli-service lint"
9 | },
10 | "dependencies": {
11 | "@vue/cli": "^4.5.15",
12 | "@web-devtools/webpack": "^0.0.3",
13 | "core-js": "^3.6.5",
14 | "visual-dev": "0.2.0",
15 | "vue": "2.6.11"
16 | },
17 | "devDependencies": {
18 | "@vue/cli-plugin-babel": "~4.5.0",
19 | "@vue/cli-plugin-eslint": "~4.5.0",
20 | "@vue/cli-service": "~4.5.0",
21 | "babel-eslint": "^10.1.0",
22 | "eslint": "^6.7.2",
23 | "eslint-plugin-vue": "^6.2.2",
24 | "vue-template-compiler": "2.6.11"
25 | },
26 | "eslintConfig": {
27 | "root": true,
28 | "env": {
29 | "node": true
30 | },
31 | "extends": [
32 | "plugin:vue/essential",
33 | "eslint:recommended"
34 | ],
35 | "parserOptions": {
36 | "parser": "babel-eslint"
37 | },
38 | "rules": {}
39 | },
40 | "browserslist": [
41 | "> 1%",
42 | "last 2 versions",
43 | "not dead"
44 | ]
45 | }
46 |
--------------------------------------------------------------------------------
/examples/vue2-app/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wen-haoming/visual-dev/c5f9f6eac32ff003da0c0babe85da57d650f0a7f/examples/vue2-app/public/favicon.ico
--------------------------------------------------------------------------------
/examples/vue2-app/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | <%= htmlWebpackPlugin.options.title %>
9 |
10 |
11 |
12 | We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/examples/vue2-app/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
123123111
6 |
11
7 |
8 |
9 |
10 |
11 |
12 |
22 |
23 |
33 |
--------------------------------------------------------------------------------
/examples/vue2-app/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wen-haoming/visual-dev/c5f9f6eac32ff003da0c0babe85da57d650f0a7f/examples/vue2-app/src/assets/logo.png
--------------------------------------------------------------------------------
/examples/vue2-app/src/components/App.vue:
--------------------------------------------------------------------------------
1 |
2 | 123123
3 |
--------------------------------------------------------------------------------
/examples/vue2-app/src/components/HelloWorld.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
{{ msg }}
4 |
5 | For a guide and recipes on how to configure / customize this project,
6 | check out the
7 | vue-cli documentation .
8 |
9 |
Installed CLI Plugins
10 |
14 |
Essential Links
15 |
22 |
Ecosystem
23 |
30 |
31 |
32 |
33 |
34 |
47 |
48 |
49 |
65 |
--------------------------------------------------------------------------------
/examples/vue2-app/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | Vue.config.productionTip = false
5 |
6 | new Vue({
7 | render: h => h(App),
8 | }).$mount('#app')
9 |
--------------------------------------------------------------------------------
/examples/vue2-app/vue.config.js:
--------------------------------------------------------------------------------
1 | // const WebpackDevToolPLugin = require('visual-dev/plugins/webpack').default
2 | const WebpackDevToolPLugin = require('../../packages/visual-dev/plugins/webpack').default
3 |
4 | module.exports = {
5 | devServer: {
6 | proxy: WebpackDevToolPLugin.proxy({
7 | '/api': {
8 | target: '',
9 | ws: true,
10 | changeOrigin: true,
11 | },
12 | '/foo': {
13 | target: ''
14 | }
15 | })
16 | },
17 | configureWebpack: {
18 | plugins: [
19 | new WebpackDevToolPLugin({
20 | injectFile:false
21 | })
22 | ]
23 | }
24 | }
--------------------------------------------------------------------------------
/examples/vue3-app/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 |
6 | # local env files
7 | .env.local
8 | .env.*.local
9 |
10 | # Log files
11 | npm-debug.log*
12 | yarn-debug.log*
13 | yarn-error.log*
14 | pnpm-debug.log*
15 |
16 | # Editor directories and files
17 | .idea
18 | .vscode
19 | *.suo
20 | *.ntvs*
21 | *.njsproj
22 | *.sln
23 | *.sw?
24 |
--------------------------------------------------------------------------------
/examples/vue3-app/.npmrc:
--------------------------------------------------------------------------------
1 | shamefully-hoist=true
2 |
--------------------------------------------------------------------------------
/examples/vue3-app/README.md:
--------------------------------------------------------------------------------
1 | # vue3-app
2 |
3 | ## Project setup
4 | ```
5 | pnpm install
6 | ```
7 |
8 | ### Compiles and hot-reloads for development
9 | ```
10 | pnpm run serve
11 | ```
12 |
13 | ### Compiles and minifies for production
14 | ```
15 | pnpm run build
16 | ```
17 |
18 | ### Lints and fixes files
19 | ```
20 | pnpm run lint
21 | ```
22 |
23 | ### Customize configuration
24 | See [Configuration Reference](https://cli.vuejs.org/config/).
25 |
--------------------------------------------------------------------------------
/examples/vue3-app/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/cli-plugin-babel/preset'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/examples/vue3-app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vue3-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve",
7 | "build": "vue-cli-service build",
8 | "lint": "vue-cli-service lint"
9 | },
10 | "dependencies": {
11 | "core-js": "^3.6.5",
12 | "visual-dev": "0.2.1",
13 | "vue": "^3.0.0"
14 | },
15 | "devDependencies": {
16 | "@vue/cli-plugin-babel": "~4.5.0",
17 | "@vue/cli-plugin-eslint": "~4.5.0",
18 | "@vue/cli-service": "~4.5.0",
19 | "@vue/compiler-sfc": "^3.0.0",
20 | "babel-eslint": "^10.1.0",
21 | "eslint": "^6.7.2",
22 | "eslint-plugin-vue": "^7.0.0"
23 | },
24 | "eslintConfig": {
25 | "root": true,
26 | "env": {
27 | "node": true
28 | },
29 | "extends": [
30 | "plugin:vue/vue3-essential",
31 | "eslint:recommended"
32 | ],
33 | "parserOptions": {
34 | "parser": "babel-eslint"
35 | },
36 | "rules": {}
37 | },
38 | "browserslist": [
39 | "> 1%",
40 | "last 2 versions",
41 | "not dead"
42 | ]
43 | }
44 |
--------------------------------------------------------------------------------
/examples/vue3-app/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wen-haoming/visual-dev/c5f9f6eac32ff003da0c0babe85da57d650f0a7f/examples/vue3-app/public/favicon.ico
--------------------------------------------------------------------------------
/examples/vue3-app/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | <%= htmlWebpackPlugin.options.title %>
9 |
10 |
11 |
12 | We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/examples/vue3-app/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
21 |
22 |
32 |
--------------------------------------------------------------------------------
/examples/vue3-app/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wen-haoming/visual-dev/c5f9f6eac32ff003da0c0babe85da57d650f0a7f/examples/vue3-app/src/assets/logo.png
--------------------------------------------------------------------------------
/examples/vue3-app/src/components/HelloWorld.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
{{ msg }}
4 |
5 | For a guide and recipes on how to configure / customize this project,
6 | check out the
7 | vue-cli documentation .
8 |
9 |
Installed CLI Plugins
10 |
14 |
Essential Links
15 |
22 |
Ecosystem
23 |
30 |
31 |
32 |
33 |
41 |
42 |
43 |
62 |
--------------------------------------------------------------------------------
/examples/vue3-app/src/main.js:
--------------------------------------------------------------------------------
1 | import { createApp } from 'vue'
2 | import App from './App.vue'
3 |
4 | createApp(App).mount('#app')
5 |
--------------------------------------------------------------------------------
/examples/vue3-app/vue.config.js:
--------------------------------------------------------------------------------
1 | // const WebpackDevToolPLugin = require('visual-dev/plugins/webpack').default
2 | const WebpackDevToolPLugin = require('../../packages/visual-dev/plugins/webpack').default
3 |
4 | module.exports = {
5 | devServer: {
6 | proxy: WebpackDevToolPLugin.proxy({
7 | '/api': {
8 | target: '',
9 | ws: true,
10 | changeOrigin: true
11 | },
12 | '/foo': {
13 | target: ''
14 | }
15 | })
16 | },
17 | configureWebpack: {
18 | plugins: [
19 | new WebpackDevToolPLugin({
20 | analysisPlugin:{
21 | rootPath:'./src/Pages'
22 | },
23 | })
24 | ]
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/examples/vue3-vite/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/examples/vue3-vite/.npmrc:
--------------------------------------------------------------------------------
1 | shamefully-hoist = true
--------------------------------------------------------------------------------
/examples/vue3-vite/README.md:
--------------------------------------------------------------------------------
1 | # Vue 3 + Typescript + Vite
2 |
3 | This template should help get you started developing with Vue 3 and Typescript in Vite. The template uses Vue 3 `
12 |