Skip to content

Commit

Permalink
Merge pull request #68 from frouriojs/develop
Browse files Browse the repository at this point in the history
chore(release): 0.12.0
  • Loading branch information
solufa authored Sep 11, 2020
2 parents 3d10c70 + 6e7d8a6 commit 69a24fb
Show file tree
Hide file tree
Showing 165 changed files with 4,539 additions and 2,327 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ updates:
commit-message:
prefix: "fix"
prefix-development: "chore"


6 changes: 2 additions & 4 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ jobs:
strategy:
matrix:
node-version: [12, 14]
os: [macos-latest, windows-latest, ubuntu-latest]
os: [windows-latest, ubuntu-latest]
steps:
- name: Disable autocrlf
run: git config --global core.autocrlf false
if: matrix.os == 'windows-latest'
- uses: actions/checkout@v2
- name: setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
Expand All @@ -31,6 +28,7 @@ jobs:
${{ runner.os }}-yarn-
- run: yarn --frozen-lockfile
- run: yarn lint
if: matrix.os != 'windows-latest'
- run: yarn typecheck
- run: yarn test --coverage
- run: npx codecov
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
dist
benchmark
coverage
58 changes: 58 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,64 @@

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.12.0](https://github.com/frouriojs/frourio/compare/v0.11.0...v0.12.0) (2020-09-11)


### ⚠ BREAKING CHANGES

* override createController

### Features

* add benchmark ([ef5d373](https://github.com/frouriojs/frourio/commit/ef5d373ffcdde0d1452dcb4223e3de52ac8ad754))
* add createHooks ([da05725](https://github.com/frouriojs/frourio/commit/da05725ee95d0b34c0f8488bbdeb6377cb63f171))
* add noPublic ([8e2490b](https://github.com/frouriojs/frourio/commit/8e2490b4dd87779d8417cb01add7ffa31df71af2))
* add noTypedParams ([ed36c1e](https://github.com/frouriojs/frourio/commit/ed36c1e9c0616ae9ba63113a837637cd0e13cfb5))
* add noTypeorm ([a432380](https://github.com/frouriojs/frourio/commit/a432380e9340eb689ed6367cce8327b80c4b64e0))
* build for benchmark ([79034f3](https://github.com/frouriojs/frourio/commit/79034f3eaf59a8f8bcc2509add95069e6028e38a))
* combine index.ts into $app.ts ([2293cd9](https://github.com/frouriojs/frourio/commit/2293cd92d5ff6b3bcedcd9e9ad067cf009ff2e2e))
* delete cors and helmet ([d17e07d](https://github.com/frouriojs/frourio/commit/d17e07d986226b3f7257e015fb92813aa25b8bc4))
* generate controllers array ([babecd9](https://github.com/frouriojs/frourio/commit/babecd95eaf7f354f1dd0b6bc9c9029426896f80))
* ignore empty dirs ([61320be](https://github.com/frouriojs/frourio/commit/61320beaf5f20fab718f23a160cc3381de6eafdb))
* integrate fastify and express ([8203dbb](https://github.com/frouriojs/frourio/commit/8203dbbca94f12a9a71a8fbd137e0667b3afdb39))
* override createController ([ac6e61b](https://github.com/frouriojs/frourio/commit/ac6e61b19d48485dfb81cac5ac90b9808e620aa0))
* parse with tsc ([1880be1](https://github.com/frouriojs/frourio/commit/1880be1fe3b8355e49acf47ebb35aeb4bdd19f18))
* remove dir option ([25f5844](https://github.com/frouriojs/frourio/commit/25f5844697895b15a98facf98432070d0d0a124b))
* remove fastify ([6d59a3d](https://github.com/frouriojs/frourio/commit/6d59a3d60875f6ccddcc3688a506baf10cc297fc))
* remove multer when not in use ([3456679](https://github.com/frouriojs/frourio/commit/34566790bce5ae2501752eec9b988aa7b9623351))
* remove public dir ([b334555](https://github.com/frouriojs/frourio/commit/b33455528e293d565d9acae319ecd12284130078))
* remove typeorm from deps ([76ff7ec](https://github.com/frouriojs/frourio/commit/76ff7ecb674dca0565b7c7305e14a2c94e9bc82f))
* remove typeorm from deps ([5f04bd8](https://github.com/frouriojs/frourio/commit/5f04bd8d2b6817887ece972f60244b722aecf26f))
* rename createController to defineController ([cb6889b](https://github.com/frouriojs/frourio/commit/cb6889b7eac208e0baa4ad7d5d361ffcd0182db5))
* rename createHooks to defineHooks ([17a04aa](https://github.com/frouriojs/frourio/commit/17a04aa4cee1c7f090287757999f3999132a75d6))
* rename types to validators ([ad0adac](https://github.com/frouriojs/frourio/commit/ad0adac86dd639531018ed923f2d42301242c2fc))
* suport fastify ([efce77e](https://github.com/frouriojs/frourio/commit/efce77e251fe7aeb5f1e3980cb26ebd8518feeec))
* support crlf ([e8829d8](https://github.com/frouriojs/frourio/commit/e8829d8c728bf6ebec6f2978ef2166b327c670f6))
* support number type query params ([e859624](https://github.com/frouriojs/frourio/commit/e85962430b0fabc4df4075172942d7975f8a64ab))
* support paths from tsconfig ([c5c9eac](https://github.com/frouriojs/frourio/commit/c5c9eac62b6e8bbbac7e4815a872a07f59c01da2))
* support velona ([521edec](https://github.com/frouriojs/frourio/commit/521edec2f0c7c221e02a205cb6f6411782c215be))
* update [email protected] ([0018225](https://github.com/frouriojs/frourio/commit/00182254793792a4960f0e45950d8605d1c8e04c))


### Bug Fixes

* delete $arrayTypeKeysName ([f21b612](https://github.com/frouriojs/frourio/commit/f21b612bd744fc5f05401a8de690325fa907014f))
* parse JSON ([6d06947](https://github.com/frouriojs/frourio/commit/6d06947b541e334d4d553e0e8649d9acea1922c7))


### Refactors

* add createValidateHandler ([997bc0f](https://github.com/frouriojs/frourio/commit/997bc0f68d44dce42c9a5350f86984fe1b8ed808))
* apply router to app ([d99f5ed](https://github.com/frouriojs/frourio/commit/d99f5ed0f247aab3e3ad978a2ca736bca02572ba))
* optimize controllers ([0641d38](https://github.com/frouriojs/frourio/commit/0641d38e45bb45568f787a1e4cb0c540c434dd8e))
* optimize deps ([83b8d4e](https://github.com/frouriojs/frourio/commit/83b8d4e591148a6ee870c9d133b97eee6c31d217))


### Documentation

* fix broken twitter image link ([9e8ea10](https://github.com/frouriojs/frourio/commit/9e8ea10be447b78d3845b1b6f2c8be08d0da1cfa))
* update README ([a69a219](https://github.com/frouriojs/frourio/commit/a69a2190e98a811549cc1dcf19939d99f06731b2))

## [0.11.0](https://github.com/frouriojs/frourio/compare/v0.10.4...v0.11.0) (2020-07-19)


Expand Down
63 changes: 27 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
# frourio

<a href="https://www.npmjs.com/package/frourio">
<img src="https://img.shields.io/npm/v/frourio" alt="npm version" />
</a>
<a href="https://github.com/frouriojs/frourio/actions?query=workflow%3A%22Node.js+CI%22">
<img src="https://github.com/frouriojs/frourio/workflows/Node.js%20CI/badge.svg?branch=master" alt="Node.js CI" />
</a>
<a href="https://codecov.io/gh/frouriojs/frourio">
<img src="https://img.shields.io/codecov/c/github/frouriojs/frourio.svg" alt="Codecov" />
</a>
<a href="https://github.com/frouriojs/frourio/blob/master/packages/frourio/LICENSE">
<img src="https://img.shields.io/npm/l/frourio" alt="License" />
</a>
<br />
<div align="center">
<img src="https://frouriojs.github.io/frourio/assets/images/ogp.png" width="1280" alt="frourio" />
</div>

> Perfectly type-checkable REST framework for TypeScript.
<div align="center">
<a href="https://www.npmjs.com/package/frourio">
<img src="https://img.shields.io/npm/v/frourio" alt="npm version" />
</a>
<a href="https://github.com/frouriojs/frourio/actions?query=workflow%3A%22Node.js+CI%22">
<img src="https://github.com/frouriojs/frourio/workflows/Node.js%20CI/badge.svg?branch=master" alt="Node.js CI" />
</a>
<a href="https://codecov.io/gh/frouriojs/frourio">
<img src="https://img.shields.io/codecov/c/github/frouriojs/frourio.svg" alt="Codecov" />
</a>
<a href="https://lgtm.com/projects/g/frouriojs/frourio/context:javascript">
<img src="https://img.shields.io/lgtm/grade/javascript/g/frouriojs/frourio.svg" alt="Language grade: JavaScript" />
</a>
<a href="https://github.com/frouriojs/frourio/blob/master/packages/frourio/LICENSE">
<img src="https://img.shields.io/npm/l/frourio" alt="License" />
</a>
</div>

<p align="center">Frourio is a perfectly type-checkable REST framework for TypeScript.</p>
<br />
<br />
<br />

## Why frourio ?

Expand Down Expand Up @@ -49,7 +59,7 @@ The front is checked by the type to see if it is making an API request as define
<img src="https://frouriojs.github.io/frourio/assets/images/architecture.png" width="900" alt="Architecture of create-frourio-app" />
</div>

## Usage
## Install

Make sure you have [npx](https://www.npmjs.com/package/npx) installed (`npx` is shipped by default since [npm](https://www.npmjs.com/get-npm) `5.2.0`)

Expand All @@ -74,25 +84,6 @@ yarn create frourio-app <my-project>
Frourio requires TypeScript 3.9 or higher.
If the TypeScript version of VSCode is low, an error is displayed during development.

## Type definition of API endpoints

aspida: `/apis` --> frourio: `/server/api`

[See: Create an endpoint type definition file | aspida](https://github.com/aspidajs/aspida#create-an-endpoint-type-definition-file)

#### Warning !
examples.

> GET: /api/test
x- /server/api/test.ts
o- /server/api/test/index.ts

> GET: /api/test/{testId}
x- /server/api/test/_testId.ts
o- /server/api/test/_testId/index.ts

## Support

<a href="https://twitter.com/solufa2020">
Expand All @@ -101,4 +92,4 @@ o- /server/api/test/_testId/index.ts

## License

frourio is licensed under a [MIT License](https://github.com/frouriojs/frourio/blob/master/packages/frourio/LICENSE).
Frourio is licensed under a [MIT License](https://github.com/frouriojs/frourio/blob/master/packages/frourio/LICENSE).
3 changes: 0 additions & 3 deletions commitlint.config.js

This file was deleted.

Binary file added docs/assets/images/ogp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
const { pathsToModuleNameMapper } = require('ts-jest/utils')
const { compilerOptions } = require('./tsconfig')

module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
globals: { Blob: {} },
testPathIgnorePatterns: ['apis'],
coveragePathIgnorePatterns: ['apis', 'dist']
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/' }),
coveragePathIgnorePatterns: ['\\$api.ts', 'dist']
}
40 changes: 22 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@
"packages/*"
],
"scripts": {
"dev": "npm run build && cd packages/frourio && cd server && aspida --build && node ../bin/index.js --build",
"build": "npm run rimraf -- frourio && cd packages/frourio && tsc --project tsconfig.json",
"rimraf": "node -e \"require('fs').rmdirSync('packages/' + process.argv[1] + '/dist', { recursive: true })\"",
"dev": "npm run build && cd packages/frourio/servers && aspida && node build.js",
"build": "npm run rimraf -- packages/frourio/dist && tsc -p packages/frourio",
"build:benchmark": "npm run rimraf -- benchmark && tsc -p tsconfig.benchmark.json",
"rimraf": "node -e \"require('fs').rmdirSync(process.argv[1], { recursive: true })\"",
"release": "standard-version --skip.tag",
"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",
"test": "jest",
"typecheck": "npm run build && tsc --noEmit"
"typecheck": "tsc --noEmit"
},
"eslintConfig": {
"env": {
Expand Down Expand Up @@ -64,27 +65,30 @@
]
},
"devDependencies": {
"@aspida/axios": "^0.9.4",
"@commitlint/cli": "^9.1.1",
"@commitlint/config-conventional": "^9.1.1",
"@types/jest": "^26.0.4",
"@types/minimist": "^1.2.0",
"@typescript-eslint/eslint-plugin": "^3.6.1",
"@typescript-eslint/parser": "^3.6.1",
"axios": "^0.19.2",
"eslint": "^7.4.0",
"@aspida/axios": "^0.11.3",
"@types/express": "^4.17.7",
"@types/jest": "^26.0.13",
"@types/multer": "^1.4.4",
"@typescript-eslint/eslint-plugin": "^4.1.0",
"@typescript-eslint/parser": "^4.1.0",
"axios": "^0.20.0",
"class-validator": "^0.12.2",
"eslint": "^7.8.1",
"eslint-config-prettier": "^6.11.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jest": "^23.18.0",
"eslint-plugin-jest": "^24.0.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",
"express": "^4.17.1",
"form-data": "^3.0.0",
"jest": "^26.1.0",
"prettier": "2.0.5",
"standard-version": "^8.0.2",
"ts-jest": "^26.1.3"
"jest": "^26.4.2",
"multer": "^1.4.2",
"prettier": "^2.1.1",
"standard-version": "^9.0.0",
"ts-jest": "^26.3.0",
"typescript": "^4.0.2"
}
}
37 changes: 27 additions & 10 deletions packages/frourio/__test__/build.spec.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,37 @@
import fs from 'fs'
import { version } from '../package.json'
import { run } from '../src/cli'
import build from '../src/buildServerFile'
import aspidaBuild from 'aspida/dist/buildTemplate'

const basePath = 'packages/frourio'

test('version command', () => {
const spyLog = jest.spyOn(console, 'log')
const args = ['--version']

run(args)
expect(console.log).toHaveBeenCalledWith(`v${version}`)

spyLog.mockRestore()
})

test('build', () => {
const inputDir = `${basePath}/server`
const inputDir = `${basePath}/servers`

const result = build(inputDir)
expect(result.text.replace(inputDir, 'server')).toBe(fs.readFileSync(result.filePath, 'utf8'))
fs.readdirSync(inputDir, { withFileTypes: true })
.filter(d => d.isDirectory())
.map(d => `${inputDir}/${d.name}`)
.forEach(input => {
const result = build(input)
expect(result.text).toBe(fs.readFileSync(result.filePath, 'utf8').replace(/\r/g, ''))

const [target] = aspidaBuild({
input: `${inputDir}/api`,
baseURL: '',
trailingSlash: false,
outputEachDir: false
})
expect(target.text).toBe(fs.readFileSync(target.filePath, 'utf8'))
const [target] = aspidaBuild({
input: `${input}/api`,
baseURL: '',
trailingSlash: false,
outputEachDir: false
})
expect(target.text).toBe(fs.readFileSync(target.filePath, 'utf8').replace(/\r/g, ''))
})
})
Loading

0 comments on commit 69a24fb

Please sign in to comment.