Skip to content

Commit

Permalink
perf: imporve request log
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Feb 22, 2021
1 parent 2140987 commit f9353fd
Show file tree
Hide file tree
Showing 12 changed files with 245 additions and 146 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Npm Publish

on:
push:
branches:
- main

jobs:
publish-npm:
if: "contains(github.event.head_commit.message, 'release')"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: use Node.js 14
uses: actions/setup-node@v1
with:
registry-url: https://registry.npmjs.org/
node-version: 14

- name: npm install and publish
run: |
npm install
npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Create Release

on:
push:
tags:
- v*

jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master

- name: Create Release for Tag
id: release_tag
uses: yyx990803/release-tag@master
env:
GITHUB_TOKEN: ${{ secrets.OPER_TOKEN }}
with:
tag_name: ${{ github.ref }}
body: |
Please refer to [CHANGELOG.md](https://github.com/anncwb/vite-plugin-mock/blob/main/CHANGELOG.md) for details.
# - name: npm install and create changeLog
# run: |
# npm install
# npm run log
2 changes: 1 addition & 1 deletion README.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ vite 的数据模拟插件,是基于 vite.js 开发的。 并同时支持本

**node version:** >=12.0.0

**vite version:** >=2.0.0-beta.64
**vite version:** >=2.0.0

```bash
yarn add mockjs
Expand Down
4 changes: 2 additions & 2 deletions examples/js-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@vitejs/plugin-vue": "^1.1.4",
"@vue/compiler-sfc": "^3.0.5",
"cross-env": "^7.0.3",
"vite": "^2.0.0-beta.64",
"vite-plugin-mock": "^2.0.0-rc.2"
"vite": "^2.0.2",
"vite-plugin-mock": "^2.1.4"
}
}
2 changes: 1 addition & 1 deletion examples/js-example/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { viteMockServe } from 'vite-plugin-mock';
import { viteMockServe } from '../../src';

import vue from '@vitejs/plugin-vue';

Expand Down
99 changes: 50 additions & 49 deletions examples/js-example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
"@nodelib/fs.scandir" "2.1.4"
fastq "^1.6.0"

"@rollup/plugin-node-resolve@^11.0.1":
version "11.0.1"
resolved "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.0.1.tgz#d3765eec4bccf960801439a999382aed2dca959b"
integrity sha512-ltlsj/4Bhwwhb+Nb5xCz/6vieuEj2/BAkkqVIKmZwC7pIdl8srmgmglE4S0jFlZa32K4qvdQ6NHdmpRKD/LwoQ==
"@rollup/plugin-node-resolve@^11.1.1":
version "11.2.0"
resolved "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.0.tgz#a5ab88c35bb7622d115f44984dee305112b6f714"
integrity sha512-qHjNIKYt5pCcn+5RUBQxK8krhRvf1HnyVgUCcFFcweDS7fhkOLZeYh0mhHK6Ery8/bb9tvN/ubPzmfF0qjDCTA==
dependencies:
"@rollup/pluginutils" "^3.1.0"
"@types/resolve" "1.17.1"
Expand Down Expand Up @@ -81,6 +81,11 @@
resolved "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==

"@types/mockjs@^1.0.3":
version "1.0.3"
resolved "https://registry.npmjs.org/@types/mockjs/-/mockjs-1.0.3.tgz#bd8ee3c7cbbd9a18788ab677b9e4f97c8d0bb0bf"
integrity sha512-OlwyyyoY81P8f7FU0zILUPxqQQ3/W+CwbqI6dWvOxaH8w948fAl1+hOG9C9ZgJcwzG+aloJcsastY4c4p91R1Q==

"@types/node@*":
version "14.10.1"
resolved "https://registry.npmjs.org/@types/node/-/node-14.10.1.tgz#cc323bad8e8a533d4822f45ce4e5326f36e42177"
Expand Down Expand Up @@ -271,10 +276,10 @@ chalk@^4.1.0:
ansi-styles "^4.1.0"
supports-color "^7.1.0"

chokidar@^3.4.3:
version "3.4.3"
resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz#c1df38231448e45ca4ac588e6c79573ba6a57d5b"
integrity sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==
chokidar@^3.5.1:
version "3.5.1"
resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a"
integrity sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==
dependencies:
anymatch "~3.1.1"
braces "~3.0.2"
Expand All @@ -284,7 +289,7 @@ chokidar@^3.4.3:
normalize-path "~3.0.0"
readdirp "~3.5.0"
optionalDependencies:
fsevents "~2.1.2"
fsevents "~2.3.1"

color-convert@^1.9.0:
version "1.9.3"
Expand Down Expand Up @@ -368,7 +373,7 @@ csstype@^2.6.8:
resolved "https://registry.npmjs.org/csstype/-/csstype-2.6.13.tgz#a6893015b90e84dd6e85d0e3b442a1e84f2dbe0f"
integrity sha512-ul26pfSQTZW8dcOnD2iiJssfXw0gdNVX9IJDH/X3K5DGPfj+fUYe3kB+swUY6BF3oZDxaID3AJt+9/ojSAE05A==

dayjs@^1.10.3:
dayjs@^1.10.4:
version "1.10.4"
resolved "https://registry.npmjs.org/dayjs/-/dayjs-1.10.4.tgz#8e544a9b8683f61783f570980a8a80eaf54ab1e2"
integrity sha512-RI/Hh4kqRc1UKLOAf/T5zdMMX5DQIlDxwUe3wSyMMnEbGunnpENCdbUgM+dW7kXidZqCttBrmw7BhN4TMddkCw==
Expand All @@ -380,10 +385,10 @@ debug@2.6.9:
dependencies:
ms "2.0.0"

debug@^4.3.1:
version "4.3.1"
resolved "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee"
integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==
debug@^4.3.2:
version "4.3.2"
resolved "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b"
integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==
dependencies:
ms "2.1.2"

Expand Down Expand Up @@ -412,15 +417,10 @@ encodeurl@~1.0.2:
resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59"
integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=

esbuild@^0.8.29:
version "0.8.29"
resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.8.29.tgz#cc20fb752e0905a3546d68ae1be58f9b97044c39"
integrity sha512-UDsEoeXuctVgG2hEts1Hwq2jYDGqV7nksEHEZaiCy2v+lXF5ButX4ErPAJAFi5ZNKKW+6Pom93pArV7hki6HnQ==

esbuild@^0.8.34:
version "0.8.39"
resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.8.39.tgz#18b84a3d56173c55ee8f45bc6c7b5374b0a98ecb"
integrity sha512-/do5H74a5ChyeKRWfkDh3EpICXpsz6dWTtFFbotb7BlIHvWqnRrZYDb8IBubOHdEtKzuiksilRO19aBtp3/HHQ==
esbuild@^0.8.39, esbuild@^0.8.47:
version "0.8.50"
resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.8.50.tgz#ebf24fde0cdad1a369789dd6fd7a820b0a01e46c"
integrity sha512-oidFLXssA7IccYzkqLVZSqNJDwDq8Mh/vqvrW+3fPWM7iUiC5O2bCllhnO8+K9LlyL/2Z6n+WwRJAz9fqSIVRg==

escape-html@~1.0.3:
version "1.0.3"
Expand Down Expand Up @@ -486,10 +486,10 @@ follow-redirects@^1.10.0:
resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz#b42e8d93a2a7eea5ed88633676d6597bc8e384db"
integrity sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==

fsevents@~2.1.2:
version "2.1.3"
resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e"
integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==
fsevents@~2.3.1:
version "2.3.2"
resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==

function-bind@^1.1.1:
version "1.1.1"
Expand Down Expand Up @@ -888,12 +888,12 @@ rollup-plugin-esbuild@^2.6.1:
joycon "^2.2.5"
strip-json-comments "^3.1.1"

rollup@^2.35.1:
version "2.35.1"
resolved "https://registry.npmjs.org/rollup/-/rollup-2.35.1.tgz#e6bc8d10893556a638066f89e8c97f422d03968c"
integrity sha512-q5KxEyWpprAIcainhVy6HfRttD9kutQpHbeqDTWnqAFNJotiojetK6uqmcydNMymBEtC4I8bCYR+J3mTMqeaUA==
rollup@^2.38.4, rollup@^2.38.5:
version "2.39.0"
resolved "https://registry.npmjs.org/rollup/-/rollup-2.39.0.tgz#be4f98c9e421793a8fec82c854fb567c35e22ab6"
integrity sha512-+WR3bttcq7zE+BntH09UxaW3bQo3vItuYeLsyk4dL2tuwbeSKJuvwiawyhEnvRdRgrII0Uzk00FpctHO/zB1kw==
optionalDependencies:
fsevents "~2.1.2"
fsevents "~2.3.1"

run-parallel@^1.1.9:
version "1.1.10"
Expand Down Expand Up @@ -1013,34 +1013,35 @@ utils-merge@1.0.1:
resolved "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713"
integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=

vite-plugin-mock@^2.0.0-rc.2:
version "2.0.0-rc.2"
resolved "https://registry.npmjs.org/vite-plugin-mock/-/vite-plugin-mock-2.0.0-rc.2.tgz#02aacfd90617c4584df54b6c457832ba9b9f90fa"
integrity sha512-MfQJc5eGqBmZ8mudT5+Y55wfISBgFebBjrUe4fDAKSFxKTIZ6Dz8KRAQJl82GQRENjoWhcF6kt70azrdZGwM9w==
vite-plugin-mock@^2.1.4:
version "2.1.4"
resolved "https://registry.npmjs.org/vite-plugin-mock/-/vite-plugin-mock-2.1.4.tgz#b1f91418e7ed4678c969d5581276fe68c27a27d0"
integrity sha512-3qYMDZ7jmTVk7mxPpKEgnbA6B19NKvkuEzpZrKq3I9yJH1tjsTIQi/t3EaH2rXJip4EZff6NRJO8aarW3OAsOg==
dependencies:
"@rollup/plugin-node-resolve" "^11.0.1"
"@rollup/plugin-node-resolve" "^11.1.1"
"@types/mockjs" "^1.0.3"
body-parser "^1.19.0"
chalk "^4.1.0"
chokidar "^3.4.3"
chokidar "^3.5.1"
connect "^3.7.0"
dayjs "^1.10.3"
debug "^4.3.1"
esbuild "^0.8.29"
dayjs "^1.10.4"
debug "^4.3.2"
esbuild "^0.8.39"
fast-glob "^3.2.5"
rollup "^2.35.1"
rollup "^2.38.4"
rollup-plugin-esbuild "^2.6.1"

vite@^2.0.0-beta.64:
version "2.0.0-beta.64"
resolved "https://registry.npmjs.org/vite/-/vite-2.0.0-beta.64.tgz#245cabc72335911d4cb704545f713d47e880d84f"
integrity sha512-/dR5rOXohhdXfkAIBAjmwX7JmoMWhQc7+VI6/EjyqXQCQzREmfBztLgTk/rPkmsNY87Cd71u9b+nlbcYK4TDCA==
vite@^2.0.2:
version "2.0.2"
resolved "https://registry.npmjs.org/vite/-/vite-2.0.2.tgz#d984528b5a1c8e725d2804245751769b11d671cf"
integrity sha512-X+PTIPRt6/5Odf/h0kBkwkck+YC0I6oKH5+ttA9ytoLyC9yeksktVq1KNzImqB+/1CNBiBE2vr7orcgSxAi67w==
dependencies:
esbuild "^0.8.34"
esbuild "^0.8.47"
postcss "^8.2.1"
resolve "^1.19.0"
rollup "^2.35.1"
rollup "^2.38.5"
optionalDependencies:
fsevents "~2.1.2"
fsevents "~2.3.1"

vue@^3.0.5:
version "3.0.5"
Expand Down
6 changes: 3 additions & 3 deletions examples/ts-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"@vitejs/plugin-vue": "^1.1.4",
"@vue/compiler-sfc": "^3.0.5",
"cross-env": "^7.0.3",
"typescript": "^4.1.3",
"vite": "^2.0.0-beta.64",
"vite-plugin-mock": "^2.0.0-rc.2"
"typescript": "^4.1.5",
"vite": "^2.0.2",
"vite-plugin-mock": "^2.1.4"
}
}
1 change: 1 addition & 0 deletions examples/ts-example/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default ({ command }: ConfigEnv): UserConfigExport => {
import { setupProdMockServer } from './mockProdServer';
setupProdMockServer();
`,
showTime: true,
}),
],
};
Expand Down
Loading

0 comments on commit f9353fd

Please sign in to comment.