Skip to content

Commit

Permalink
chore(deps): update dependency tsbb to v3.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Sep 30, 2021
1 parent 7129f20 commit cf4f51c
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 20 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,28 @@ jobs:
node-version: 14

- name: Look Changelog
uses: jaywcjlove/changelog-generator@v1.4.3
uses: jaywcjlove/changelog-generator@v1.4.6
with:
token: ${{ secrets.GITHUB_TOKEN }}
filter-author: (jaywcjlove|小弟调调™|dependabot\[bot\]|Renovate Bot)
filter-author: (小弟调调™|Renovate Bot)
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'

- run: yarn install
- run: yarn run build
- run: yarn run coverage
- run: yarn run doc

- run: npm install @jsdevtools/npm-publish -g
- run: npm-publish --token="${{ secrets.NPM_TOKEN }}" ./packages/core/package.json


- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./packages/core/docs

- run: npm i markdown-to-html-cli -g
- name: markdown-to-html
working-directory: packages/core
run: markdown-to-html --output docs/index.html

- name: Is a tag created auto?
id: create_tag
uses: jaywcjlove/create-tag-action@v1.2.1
Expand All @@ -44,12 +46,12 @@ jobs:

- name: Generate Changelog
id: changelog
uses: jaywcjlove/changelog-generator@v1.4.3
uses: jaywcjlove/changelog-generator@v1.4.6
if: steps.create_tag.outputs.successful
with:
token: ${{ secrets.GITHUB_TOKEN }}
head-ref: ${{ steps.create_tag.outputs.version }}
filter-author: (jaywcjlove|小弟调调™|dependabot\[bot\]|Renovate Bot)
filter-author: (小弟调调™|Renovate Bot)
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'

- name: Create Release
Expand All @@ -61,9 +63,14 @@ jobs:
tag: ${{ steps.create_tag.outputs.version }}
body: |
[![](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/mocker-api@${{steps.create_tag.outputs.versionNumber}}/file/README.md) [![npm version](https://img.shields.io/npm/v/mocker-api.svg)](https://www.npmjs.com/package/mocker-api) [![npm bundle size](https://img.shields.io/bundlephobia/minzip/mocker-api)](https://bundlephobia.com/result?p=mocker-api@${{steps.create_tag.outputs.versionNumber}})
```bash
npm i mocker-api@${{steps.create_tag.outputs.versionNumber}}
```
${{ steps.changelog.outputs.compareurl }}
${{ steps.changelog.outputs.changelog }}
- run: npm install @jsdevtools/npm-publish -g
- run: npm-publish --token="${{ secrets.NPM_TOKEN }}" ./packages/core/package.json
2 changes: 1 addition & 1 deletion example/base/mocker/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const delay = require('mocker-api/lib/delay');
const { delay } = require('mocker-api');
const user = require('./user.mock');

// 是否禁用代理
Expand Down
2 changes: 1 addition & 1 deletion example/create-react-app/mocker/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const delay = require('mocker-api/lib/delay');
const { delay } = require('mocker-api');

// 是否禁用代理
const noProxy = process.env.NO_PROXY === 'true';
Expand Down
2 changes: 1 addition & 1 deletion example/express/mocker/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const delay = require('mocker-api/lib/delay');
const { delay } = require('mocker-api');
const user = require('./user.mock');

console.log('user:', user)
Expand Down
2 changes: 1 addition & 1 deletion example/loadData/mocker/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const delay = require('mocker-api/lib/delay');
const { delay } = require('mocker-api');

// 是否禁用代理
const noProxy = process.env.NO_PROXY === 'true';
Expand Down
2 changes: 1 addition & 1 deletion example/typescript/mocker/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const delay = require('mocker-api/lib/delay');
const { delay } = require('mocker-api');
const user = require('./user.mock');

// 是否禁用代理
Expand Down
2 changes: 1 addition & 1 deletion example/webpack/mocker/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { delay } = require('mocker-api');
const { login } = require('./user');
const delay = require('mocker-api/lib/delay');

// 是否禁用代理
const noProxy = process.env.NO_PROXY === 'true';
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
]
},
"scripts": {
"doc": "yarn workspace mocker-api typedoc src/index.ts src/delay.ts --name mocker-api",
"build": "yarn workspace mocker-api tsbb build --no-esm",
"watch": "yarn workspace mocker-api tsbb watch --no-esm",
"doc": "yarn workspace mocker-api typedoc src/index.ts src/delay.ts --name mocker-api --out docs/type",
"build": "yarn workspace mocker-api tsbb build --disable-babel --file-names src/bin/mocker.ts --file-names src/delay.ts",
"watch": "yarn workspace mocker-api tsbb watch --disable-babel --file-names src/bin/mocker.ts --file-names src/delay.ts",
"test": "yarn workspace mocker-api tsbb test",
"coverage": "yarn workspace mocker-api tsbb test --coverage",
"example:base": "yarn workspace base api"
Expand All @@ -28,7 +28,7 @@
"license": "MIT",
"author": "Kenny Wong <wowohoo@qq.com>",
"devDependencies": {
"tsbb": "3.1.6",
"tsbb": "3.3.7",
"typescript": "4.3.5",
"typedoc": "0.22.4"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ module.exports = proxy;
You can use functional tool to enhance mock. [#17](https://github.com/jaywcjlove/webpack-api-mocker/issues/17)

```js
const delay = require('mocker-api/lib/delay');
const { delay } = require('mocker-api');
const noProxy = process.env.NO_PROXY === 'true';

const proxy = {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/delay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { MockerProxyRoute, MockerResult, MockerResultFunction } from './';
* module.exports = (noProxy ? {} : delay(proxy, 1000));
* ```
*/
export default function delay(proxy: MockerProxyRoute, timer: number = 0): MockerResult {
export function delay(proxy: MockerProxyRoute, timer: number = 0): MockerResult {
const mockApi: MockerResult = {};
Object.keys(proxy).forEach((key) => {
const result = proxy[key];
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import color from 'colors-cli/safe';
import { proxyHandle } from './proxyHandle';
import { mockerHandle } from './mockerHandle';

export * from './delay';
export * from './utils';

export type ProxyTargetUrl = string | Partial<URL.Url>;
export type MockerResultFunction = ((req: Request, res: Response, next?: NextFunction) => void);
export type MockerResult = string | number| Array<any> | Record<string, any> | MockerResultFunction;
Expand Down

0 comments on commit cf4f51c

Please sign in to comment.