Skip to content

Commit

Permalink
Merge pull request #173 from aspida/develop
Browse files Browse the repository at this point in the history
chore(release): 0.9.0
  • Loading branch information
solufa authored Feb 7, 2022
2 parents 342eca3 + 926781f commit 96dec18
Show file tree
Hide file tree
Showing 18 changed files with 2,097 additions and 2,873 deletions.
16 changes: 0 additions & 16 deletions .github/dependabot.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"eslint.run": "onSave",
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [0.9.0](https://github.com/aspida/aspida-mock/compare/v0.8.2...v0.9.0) (2022-02-07)


### Features

* insert prettier-ignore comment ([4beee14](https://github.com/aspida/aspida-mock/commit/4beee1464b61e408dbf46bc0391e509262aaa113))

### [0.8.2](https://github.com/aspida/aspida-mock/compare/v0.8.1...v0.8.2) (2020-10-02)


Expand Down
1 change: 1 addition & 0 deletions __tests__/lib/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ describe('cli', () => {
const { text, filePath } = build({
input: config.input,
baseURL: '',
outputMode: 'all',
trailingSlash: false,
outputEachDir: false
})
Expand Down
204 changes: 110 additions & 94 deletions api/$api.ts

Large diffs are not rendered by default.

26 changes: 20 additions & 6 deletions api/$mock.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,42 @@
/* eslint-disable */
// prettier-ignore
import { AspidaClient } from 'aspida'
// prettier-ignore
import { MockClient, MockConfig, mockClient } from 'aspida-mock'
// prettier-ignore
import baseMiddleware from './@middleware'
// prettier-ignore
import api from './$api'
// prettier-ignore
import mock0 from './v2.0/index'
import mock1 from './v1.1/users/_userId@User[\'id\']'
// prettier-ignore
import mock1 from './v1.1/users/_userId@string'
// prettier-ignore
import mock2 from './v1.1/_articleId.json'
// prettier-ignore
import mock3 from './v1.1/3.1'
import mock4 from './v1.1/2/_hogeId@HogeId/test-4/_fugaId'
// prettier-ignore
import mock4 from './v1.1/2/_hogeId@string/test-4/_fugaId'
// prettier-ignore
import mock5 from './v1.1'
// prettier-ignore
import mock6 from './index'
import mock7 from './_sampleId.json@number'
// prettier-ignore
import mock7 from './_sampleId@number.json'

// prettier-ignore
export const mockRoutes = () => [
{ path: '/v2.0', methods: mock0 },
{ path: '/v1.1/users/_userId@User[\'id\']', methods: mock1 },
{ path: '/v1.1/users/_userId@string', methods: mock1 },
{ path: '/v1.1/_articleId.json', methods: mock2 },
{ path: '/v1.1/3.1', methods: mock3 },
{ path: '/v1.1/2/_hogeId@HogeId/test-4/_fugaId', methods: mock4 },
{ path: '/v1.1/2/_hogeId@string/test-4/_fugaId', methods: mock4 },
{ path: '/v1.1', methods: mock5 },
{ path: '', methods: mock6 },
{ path: '/_sampleId.json@number', methods: mock7 }
{ path: '/_sampleId@number.json', methods: mock7 }
]

// prettier-ignore
export default <U>(client: AspidaClient<U> | MockClient<U>, config?: MockConfig) => {
const middleware = [...baseMiddleware, ...(config?.middleware || [])]
const mock = 'attachRoutes' in client ? client : mockClient(client)
Expand Down
5 changes: 0 additions & 5 deletions api/@types.ts

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions api/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable */
import { mockMethods } from 'aspida-mock'

// prettier-ignore
export type Methods = {
get: {
reqHeaders?:
Expand Down
1 change: 1 addition & 0 deletions api/v1.1.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { mockMethods } from 'aspida-mock'

// prettier-ignore
export type Methods = {
get: {
// test
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { mockMethods } from 'aspida-mock'

// prettier-ignore
export type Methods = {
get: {
query?: { aa?: number }
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
43 changes: 20 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aspida-mock",
"version": "0.8.2",
"version": "0.9.0",
"description": "TypeScript friendly RESTful API mock for aspida",
"author": "Solufa <solufa2020@gmail.com>",
"license": "MIT",
Expand All @@ -14,8 +14,8 @@
"release:major": "npm run release -- --release-as major",
"release:minor": "npm run release -- --release-as minor",
"release:patch": "npm run release -- --release-as patch",
"lint": "eslint --ext .js,.ts --ignore-path .gitignore .",
"lint:fix": "npm run lint -- --fix",
"lint": "eslint --ext .js,.ts --ignore-path .gitignore . && prettier --check \"./**/*.ts\"",
"lint:fix": "eslint --ext .js,.ts --ignore-path .gitignore . --fix && prettier --write \"./**/*.ts\"",
"test": "jest",
"typecheck": "tsc --noEmit"
},
Expand Down Expand Up @@ -45,9 +45,7 @@
"standard",
"plugin:@typescript-eslint/recommended",
"plugin:jest/recommended",
"plugin:prettier/recommended",
"prettier/@typescript-eslint",
"prettier/standard"
"prettier"
],
"parserOptions": {
"ecmaVersion": 2018,
Expand Down Expand Up @@ -83,24 +81,23 @@
]
},
"devDependencies": {
"@aspida/node-fetch": "^0.9.0",
"@types/jest": "^26.0.14",
"@typescript-eslint/eslint-plugin": "^4.3.0",
"@typescript-eslint/parser": "^4.3.0",
"eslint": "^7.10.0",
"eslint-config-prettier": "^6.12.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.0.2",
"@aspida/node-fetch": "^1.7.1",
"@types/jest": "^27.4.0",
"@typescript-eslint/eslint-plugin": "^5.11.0",
"@typescript-eslint/parser": "^5.11.0",
"eslint": "^8.8.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jest": "^26.1.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"jest": "^26.4.2",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-standard": "^5.0.0",
"jest": "^27.5.0",
"node-fetch": "^2.6.1",
"prettier": "^2.1.2",
"standard-version": "^9.0.0",
"ts-jest": "^26.4.1",
"typescript": "^4.0.3"
"prettier": "^2.5.1",
"standard-version": "^9.3.2",
"ts-jest": "^27.1.3",
"typescript": "^4.5.5"
}
}
2 changes: 1 addition & 1 deletion src/cli/createRouteString.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ export default <U>(client: AspidaClient<U> | MockClient<U>, config?: MockConfig)
mock.attachRoutes(mockRoutes(), ${hasMiddleware ? '{ ...config, middleware }' : 'config'})
return api(mock)
}\n`
}\n`.replace(/\n([a-z])/g, '\n// prettier-ignore\n$1')
Loading

0 comments on commit 96dec18

Please sign in to comment.