Skip to content

Commit

Permalink
Release 11.0.0 (#40)
Browse files Browse the repository at this point in the history
* Release 11.0.0. See CHANGELOG for details.
  • Loading branch information
Thesephi authored Aug 22, 2023
1 parent db8feb8 commit 4e5e9e8
Show file tree
Hide file tree
Showing 20 changed files with 8,070 additions and 3,425 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
src/isNginxUnitPatched.*
src/nginxUnitPatch.*
287 changes: 287 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,287 @@
/*
👋 Hi! This file was autogenerated by tslint-to-eslint-config.
https://github.com/typescript-eslint/tslint-to-eslint-config
It represents the closest reasonable ESLint configuration to this
project's original TSLint configuration.
We recommend eventually switching this configuration to extend from
the recommended rulesets in typescript-eslint.
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md
Happy linting! 💖
*/
module.exports = {
"env": {
"browser": false,
"es6": true
},
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"plugins": [
"eslint-plugin-import",
"eslint-plugin-prefer-arrow",
"eslint-plugin-jsdoc",
"@typescript-eslint"
],
"root": true,
"rules": {
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": [
"error",
{
"default": "array"
}
],
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-comment": "error",
"@typescript-eslint/ban-types": [
"error",
{
"types": {
"Object": {
"message": "Avoid using the `Object` type. Did you mean `object`?"
},
"Function": {
"message": "Avoid using the `Function` type. Prefer a specific function type, like `() => void`."
},
"Boolean": {
"message": "Avoid using the `Boolean` type. Did you mean `boolean`?"
},
"Number": {
"message": "Avoid using the `Number` type. Did you mean `number`?"
},
"String": {
"message": "Avoid using the `String` type. Did you mean `string`?"
},
"Symbol": {
"message": "Avoid using the `Symbol` type. Did you mean `symbol`?"
}
}
}
],
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/dot-notation": "error",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "variable",
"format": [
"camelCase",
"UPPER_CASE",
"PascalCase"
],
"leadingUnderscore": "allow",
"trailingUnderscore": "forbid"
}
],
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-base-to-string": "error",
"@typescript-eslint/no-duplicate-enum-values": "error",
"@typescript-eslint/no-duplicate-type-constituents": "error",
"@typescript-eslint/no-empty-function": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-extra-non-null-assertion": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-implied-eval": "error",
"@typescript-eslint/no-loss-of-precision": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-misused-promises": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/no-redundant-type-constituents": "error",
"@typescript-eslint/no-shadow": [
"error",
{
"hoist": "all"
}
],
"@typescript-eslint/no-this-alias": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-unnecessary-type-constraint": "error",
"@typescript-eslint/no-unsafe-argument": "error",
"@typescript-eslint/no-unsafe-assignment": "error",
"@typescript-eslint/no-unsafe-call": "error",
"@typescript-eslint/no-unsafe-declaration-merging": "error",
"@typescript-eslint/no-unsafe-enum-comparison": "error",
"@typescript-eslint/no-unsafe-member-access": "error",
"@typescript-eslint/no-unsafe-return": "error",
"@typescript-eslint/no-unused-expressions": "error",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-as-const": "error",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/quotes": [
"error",
"single"
],
"@typescript-eslint/require-await": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"@typescript-eslint/restrict-template-expressions": "error",
"@typescript-eslint/triple-slash-reference": [
"error",
{
"path": "always",
"types": "prefer-import",
"lib": "always"
}
],
"@typescript-eslint/typedef": "off",
"@typescript-eslint/unbound-method": "error",
"@typescript-eslint/unified-signatures": "error",
"complexity": "off",
"constructor-super": "error",
"dot-notation": "off",
"eqeqeq": [
"error",
"smart"
],
"guard-for-in": "off",
"id-denylist": [
"error",
"any",
"Number",
"number",
"String",
"string",
"Boolean",
"boolean",
"Undefined",
"undefined"
],
"id-match": "error",
"import/order": [
"off",
{
"alphabetize": {
"caseInsensitive": true,
"order": "asc"
},
"newlines-between": "ignore",
"groups": [
[
"builtin",
"external",
"internal",
"unknown",
"object",
"type"
],
"parent",
[
"sibling",
"index"
]
],
"distinctGroup": false,
"pathGroupsExcludedImportTypes": [],
"pathGroups": [
{
"pattern": "./",
"patternOptions": {
"nocomment": true,
"dot": true
},
"group": "sibling",
"position": "before"
},
{
"pattern": ".",
"patternOptions": {
"nocomment": true,
"dot": true
},
"group": "sibling",
"position": "before"
},
{
"pattern": "..",
"patternOptions": {
"nocomment": true,
"dot": true
},
"group": "parent",
"position": "before"
},
{
"pattern": "../",
"patternOptions": {
"nocomment": true,
"dot": true
},
"group": "parent",
"position": "before"
}
]
}
],
"jsdoc/check-alignment": "error",
"jsdoc/check-indentation": "error",
"max-classes-per-file": [
"error",
1
],
"new-parens": "error",
"no-array-constructor": "off",
"no-bitwise": "error",
"no-caller": "error",
"no-cond-assign": "error",
"no-console": "error",
"no-debugger": "error",
"no-empty": "error",
"no-empty-function": "off",
"no-eval": "error",
"no-fallthrough": "off",
"no-implied-eval": "off",
"no-invalid-this": "off",
"no-loss-of-precision": "off",
"no-new-wrappers": "error",
"no-shadow": "off",
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-underscore-dangle": "off",
"no-unsafe-finally": "error",
"no-unused-expressions": "off",
"no-unused-labels": "error",
"no-unused-vars": "off",
"no-use-before-define": "off",
"no-var": "error",
"object-shorthand": "error",
"one-var": [
"error",
"never"
],
"prefer-arrow/prefer-arrow-functions": "off",
"prefer-const": "error",
"radix": "error",
"require-await": "off",
"spaced-comment": [
"error",
"always",
{
"markers": [
"/"
]
}
],
"use-isnan": "error",
"valid-typeof": "off"
}
};
29 changes: 29 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Regression Test after merged

on:
pull_request_target:
branches:
- master
types:
- closed

jobs:
test:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build:prod --if-present # prod build
- run: npm test # test code in both src and dist
8 changes: 3 additions & 5 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Pull Request Workflow
name: Pull Request

on:
push:
branches: [ "!master", "!dependabot/*" ]
pull_request:
branches: [ "!master", "!dependabot/*" ]
branches: [ "master" ]

jobs:
build:
test:

runs-on: ubuntu-latest

Expand Down
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ tslint.json
deprecated
test
examples
tsconfig.json
.eslintignore
.eslintrc.js
tslint-to-eslint-config.log

# local pack (`npm pack` result)
somnus-*.tgz
Expand Down
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
## [11.0.0] - 2023-08-22
### Changed
- general dependency upgrades inc. `restify@11`
- Node.js v18 is supported
- updated a few examples to adapt the `async/await` syntax for route handler declaration

## Removed
- support for older (end-of-life / near end-of-life) Node.js versions (e.g. v16 and below)
- `tslint.json` config (in favour of `eslint`); the removed config is quoted below for historic reasons:
```
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended"
],
"jsRules": {},
"rules": {
"quotemark": [true, "single"],
"ordered-imports": [false],
"object-literal-sort-keys": [false],
"only-arrow-functions": [false],
"forin": false
},
"rulesDirectory": []
}
```
- Travis-CI integration (in favour of GitHub Actions)

## [8.4.0] - 2022-07-11
### Changed
- truly decoupled `unit-http` from `somnus` in user-land (see https://github.com/somnusjs/somnus/issues/33)
Expand Down
7 changes: 6 additions & 1 deletion examples/helloworld-js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ const somnus = require('../../lib/somnus').default;

somnus.start({
routeConfig: {
'get /hello': (req, res) => res.send('world')
'get /hello': async (req, res) => {
res.send('world');
},
'get /hi': (req, res, next) => {
res.send('earth');
}
}
});
Loading

0 comments on commit 4e5e9e8

Please sign in to comment.