Skip to content

Commit fd37677

Browse files
Merge pull request #1 from httpland/beta
Beta
2 parents 3a5ca39 + 4f5c769 commit fd37677

26 files changed

+2783
-24
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
pull_request:
8+
branches: [ main ]
9+
10+
schedule:
11+
- cron: '18 15 * * 2'
12+
13+
jobs:
14+
analyze:
15+
name: Analyze
16+
runs-on: ubuntu-latest
17+
permissions:
18+
actions: read
19+
contents: read
20+
security-events: write
21+
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
language: [ 'typescript' ]
26+
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v2
30+
31+
- name: Initialize CodeQL
32+
uses: github/codeql-action/init@v1
33+
with:
34+
languages: ${{ matrix.language }}
35+
36+
- name: Autobuild
37+
uses: github/codeql-action/autobuild@v1
38+
39+
- name: Perform CodeQL Analysis
40+
uses: github/codeql-action/analyze@v1

.github/workflows/release-npm.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: release-npm
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
release:
9+
runs-on: ${{ matrix.os }}
10+
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest]
14+
deno: [v1.x]
15+
node: [16.x]
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
21+
- uses: denoland/setup-deno@v1
22+
with:
23+
deno-version: ${{ matrix.deno }}
24+
25+
- name: Cache node_modules
26+
uses: actions/cache@v2
27+
with:
28+
path: ~/.pnpm-store
29+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
30+
restore-keys: |
31+
${{ runner.os }}-
32+
33+
- uses: pnpm/[email protected]
34+
with:
35+
version: 6.23.6
36+
run_install: |
37+
- recursive: true
38+
args: [--frozen-lockfile, --prefer-offline, --ignore-scripts]
39+
40+
- name: Get tag version
41+
if: startsWith(github.ref, 'refs/tags/')
42+
id: get_tag_version
43+
run: echo ::set-output name=TAG_VERSION::${GITHUB_REF/refs\/tags\//}
44+
45+
- uses: actions/setup-node@v2
46+
with:
47+
node-version: ${{ matrix.node }}
48+
registry-url: 'https://registry.npmjs.org'
49+
50+
- name: build
51+
run: deno run -A ./_tools/build_npm.ts ${{steps.get_tag_version.outputs.TAG_VERSION}}
52+
53+
- name: publish
54+
env:
55+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
56+
run: deno run -A ./_tools/publish_npm.ts ${{steps.get_tag_version.outputs.TAG_VERSION}}
57+

.github/workflows/release.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: release
2+
3+
on:
4+
push:
5+
branches:
6+
- beta
7+
- main
8+
9+
jobs:
10+
lint:
11+
runs-on: ${{ matrix.os }}
12+
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest]
16+
deno: [v1.x]
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v2
21+
22+
- uses: denoland/setup-deno@v1
23+
with:
24+
deno-version: ${{ matrix.deno }}
25+
26+
- name: Lint
27+
run: |
28+
deno fmt --check
29+
deno lint
30+
31+
test:
32+
runs-on: ${{ matrix.os }}
33+
34+
strategy:
35+
matrix:
36+
os: [ubuntu-latest]
37+
deno: [v1.x]
38+
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v2
42+
43+
- uses: denoland/setup-deno@v1
44+
with:
45+
deno-version: ${{ matrix.deno }}
46+
47+
- name: Test
48+
run: deno task test --coverage=coverage
49+
50+
- name: Generate coverage
51+
if: ${{ matrix.deno == 'v1.x' }}
52+
run: deno coverage coverage --lcov > cov_profile.lcov
53+
54+
- uses: codecov/codecov-action@v2
55+
if: ${{ matrix.deno == 'v1.x' }}
56+
with:
57+
files: cov_profile.lcov
58+
59+
release:
60+
needs: [lint, test]
61+
runs-on: ${{ matrix.os }}
62+
63+
strategy:
64+
matrix:
65+
os: [ubuntu-latest]
66+
67+
steps:
68+
- name: Checkout
69+
uses: actions/checkout@v2
70+
71+
- uses: cycjimmy/semantic-release-action@v3
72+
with:
73+
extra_plugins: |
74+
@semantic-release/changelog
75+
@semantic-release/git
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

.github/workflows/test.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: test
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- '_docs/**'
7+
schedule:
8+
- cron: '* 9 * * *'
9+
jobs:
10+
lint:
11+
runs-on: ${{ matrix.os }}
12+
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, ubuntu-18.04, macos-latest, windows-latest]
16+
deno: [v1.x, canary]
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v2
21+
22+
- uses: denoland/setup-deno@v1
23+
with:
24+
deno-version: ${{ matrix.deno }}
25+
26+
- name: Lint
27+
run: |
28+
deno fmt --check
29+
deno lint
30+
31+
test:
32+
runs-on: ${{ matrix.os }}
33+
34+
strategy:
35+
matrix:
36+
os: [ubuntu-latest, ubuntu-18.04, macos-latest, windows-latest]
37+
deno: [v1.x, canary]
38+
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v2
42+
43+
- uses: denoland/setup-deno@v1
44+
with:
45+
deno-version: ${{ matrix.deno }}
46+
47+
- name: Test
48+
run: deno task test

CHANGELOG.md

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# [1.0.0-beta.16](https://github.com/httpland/http-utils/compare/1.0.0-beta.15...1.0.0-beta.16) (2023-04-01)
2+
3+
4+
### Features
5+
6+
* **header:** improve type guard ([7ce4075](https://github.com/httpland/http-utils/commit/7ce4075089bdbb745c2c5fe3bca859afc4a9e890))
7+
* **header:** remove irrelevant modules ([404620e](https://github.com/httpland/http-utils/commit/404620ef041b560e348129b838f5d474aa6caa8e))
8+
* **header:** stop const enum ([f416a82](https://github.com/httpland/http-utils/commit/f416a82cdd5a37dc6cb32d5ae86d3c684dc5d404))
9+
* **method:** improve types from enum ([a44845a](https://github.com/httpland/http-utils/commit/a44845a98b1912310517effb9127fb5d7aa87e46))
10+
* **mod:** remove index entry point ([c616b57](https://github.com/httpland/http-utils/commit/c616b57ec39786e410d1d626994fc332f99e9518))
11+
* **mod:** remove unnecessary module ([ee7b865](https://github.com/httpland/http-utils/commit/ee7b865c520bbc176b7db8da5410090da6f083e4))
12+
* remove `safeResponse` function ([d4fd65e](https://github.com/httpland/http-utils/commit/d4fd65eb42ab04d3d2ae8c1eab8a309cb74e53ef))
13+
* **request:** change `equalsRequest` interface ([d6afee9](https://github.com/httpland/http-utils/commit/d6afee9ff5c83886ae64f3428e2bd9c830c87b4e))
14+
* **response:** add checking body type to `equalsResponse` ([415bfee](https://github.com/httpland/http-utils/commit/415bfee5c53464f106bbfce98d778348740fe41d))
15+
16+
# [1.0.0-beta.15](https://github.com/httpland/http-utils/compare/1.0.0-beta.14...1.0.0-beta.15) (2023-04-01)
17+
18+
19+
### Features
20+
21+
* **message:** add `withHeader` function ([1f4260d](https://github.com/httpland/http-utils/commit/1f4260d8b6ed10a6057439264181c5844e7837e3))
22+
23+
# [1.0.0-beta.14](https://github.com/httpland/http-utils/compare/1.0.0-beta.13...1.0.0-beta.14) (2023-03-23)
24+
25+
26+
### Features
27+
28+
* **handler:** remove handler module ([44c719f](https://github.com/httpland/http-utils/commit/44c719fb3a3da3ce93698f86fa30c24948d94282))
29+
* **header:** add filtering by header field name function ([84c402c](https://github.com/httpland/http-utils/commit/84c402c5ab224f12bbd42df662c5552628d26507))
30+
* **header:** add type guard for headers ([6622fa2](https://github.com/httpland/http-utils/commit/6622fa2bd0e5cea619a16cffadd43b308bf2417d))
31+
32+
# [1.0.0-beta.13](https://github.com/httpland/http-utils/compare/1.0.0-beta.12...1.0.0-beta.13) (2023-03-06)
33+
34+
35+
### Features
36+
37+
* **header:** add message forwarding header fields ([f2a439f](https://github.com/httpland/http-utils/commit/f2a439fcfa629b11813d6e66d02482c3f53e9cb8))
38+
* **header:** add message metadata header fields ([75bb6ee](https://github.com/httpland/http-utils/commit/75bb6ee636af69c3814a79c19ac9a86ae781e498))
39+
40+
# [1.0.0-beta.12](https://github.com/httpland/http-utils/compare/1.0.0-beta.11...1.0.0-beta.12) (2023-03-05)
41+
42+
43+
### Features
44+
45+
* **header:** add range requests header fields ([7c00c47](https://github.com/httpland/http-utils/commit/7c00c47fec3e0edd9cbf794b8ef602a0298d3eca))
46+
* **method:** add retrieve method checking function ([702f18f](https://github.com/httpland/http-utils/commit/702f18fb3caa68bf0366dd7636cd5ea73d6b7a21))
47+
48+
# [1.0.0-beta.11](https://github.com/httpland/http-utils/compare/1.0.0-beta.10...1.0.0-beta.11) (2023-03-04)
49+
50+
51+
### Features
52+
53+
* **header:** add conditional header fields ([863f4cb](https://github.com/httpland/http-utils/commit/863f4cb905e0b981de616acc58b54be0512f437c))
54+
* **header:** add content negotiation header fields ([cc6c3d0](https://github.com/httpland/http-utils/commit/cc6c3d0eb0c3605d9b118e703fdda86c93b9237e))
55+
* **heaer:** add http authentication header fields ([5cfa316](https://github.com/httpland/http-utils/commit/5cfa3166e9eaa8a15e0f2c82779466e7a0bfb55b))
56+
57+
# [1.0.0-beta.10](https://github.com/httpland/http-utils/compare/1.0.0-beta.9...1.0.0-beta.10) (2023-03-04)
58+
59+
60+
### Features
61+
62+
* **header:** add caching header enum ([1844621](https://github.com/httpland/http-utils/commit/1844621b43293e362c41af24ef2f57dcf24eac4b))
63+
64+
# [1.0.0-beta.9](https://github.com/httpland/http-utils/compare/1.0.0-beta.8...1.0.0-beta.9) (2023-03-04)
65+
66+
67+
### Features
68+
69+
* **header:** add fileld to representation header ([58965b2](https://github.com/httpland/http-utils/commit/58965b247926983b1e81462adcdb7eb69d2cc13e))
70+
* **header:** add representation header enum ([2561134](https://github.com/httpland/http-utils/commit/25611347552a620ea19bc301ca5357179ebb5533))
71+
72+
# [1.0.0-beta.8](https://github.com/httpland/http-utils/compare/1.0.0-beta.7...1.0.0-beta.8) (2023-03-03)
73+
74+
75+
### Features
76+
77+
* **response:** add throwing error pattern to `equalsResponse` ([d58690a](https://github.com/httpland/http-utils/commit/d58690a8f18ac8db1d108af9d849b49a8e68855b))
78+
79+
# [1.0.0-beta.7](https://github.com/httpland/http-utils/compare/1.0.0-beta.6...1.0.0-beta.7) (2023-03-01)
80+
81+
82+
### Features
83+
84+
* **method:** add http method enum ([5e31439](https://github.com/httpland/http-utils/commit/5e31439fdeaf4ea5a25bee094cebacc7552a45b9))
85+
* **method:** add method utilities ([44a025c](https://github.com/httpland/http-utils/commit/44a025c7d6311bbd0f2e5e40ae8521527d7a26d4))
86+
* **responses:** add overload types to `equalsResponse` ([7af961b](https://github.com/httpland/http-utils/commit/7af961b06a8c56ef0b1c6931b95366bc740d0966))
87+
88+
# [1.0.0-beta.6](https://github.com/httpland/http-utils/compare/1.0.0-beta.5...1.0.0-beta.6) (2022-10-13)
89+
90+
91+
### Features
92+
93+
* **responses:** add checking body content ([3c57c76](https://github.com/httpland/http-utils/commit/3c57c76fa85b85c6157c0c5a459aca0bee500f8e))
94+
95+
# [1.0.0-beta.5](https://github.com/httpland/http-utils/compare/1.0.0-beta.4...1.0.0-beta.5) (2022-10-11)
96+
97+
98+
### Features
99+
100+
* **requests:** add checking request body equality ([4ddca1b](https://github.com/httpland/http-utils/commit/4ddca1b7c0fa7869fb37f76b561cc05cc1ede646))
101+
102+
# [1.0.0-beta.4](https://github.com/httpland/http-utils/compare/1.0.0-beta.3...1.0.0-beta.4) (2022-10-08)
103+
104+
105+
### Features
106+
107+
* **requests:** add `isRequest` function ([cf92dc1](https://github.com/httpland/http-utils/commit/cf92dc1440c40198ba2b8f48898e14dc145acf9d))
108+
* **responses:** add `isResponse` function ([176d614](https://github.com/httpland/http-utils/commit/176d61486ce7cc2e1f974c8925c15f6a440f1c03))
109+
110+
# [1.0.0-beta.3](https://github.com/httpland/http-utils/compare/1.0.0-beta.2...1.0.0-beta.3) (2022-10-02)
111+
112+
113+
### Features
114+
115+
* **handlers:** rename types ([cdf2721](https://github.com/httpland/http-utils/commit/cdf27215e4a33289b744903ec1f4afa4ff3f28cb))
116+
* **headers:** add `parseFieldValue` function ([2dca3bd](https://github.com/httpland/http-utils/commit/2dca3bd26076c8982e15c4f65fc34c523361a003))
117+
* **headers:** add options to `mergeHeaders`, accept custom merge function ([e161c6d](https://github.com/httpland/http-utils/commit/e161c6d30cf3306d27b6c02bf4d54946bf16febc))
118+
* **responses:** change `safeResponse` interface ([ffd3ddc](https://github.com/httpland/http-utils/commit/ffd3ddc79d1ed3f7ca67b1e4ae0b02dbc50d69e8))
119+
120+
# [1.0.0-beta.2](https://github.com/httpland/http-utils/compare/1.0.0-beta.1...1.0.0-beta.2) (2022-09-14)
121+
122+
123+
### Features
124+
125+
* **headers:** add `isSingletonField` function ([9109451](https://github.com/httpland/http-utils/commit/9109451c156610289b91405aa86a9fe7ae828d1f))
126+
* **headers:** add `mergeHeaders` function ([cd224d3](https://github.com/httpland/http-utils/commit/cd224d39f6ae7b9817b5122fe2226b21c7c0fffc))
127+
* **headers:** add checking equality of `Headers` object ([66c108f](https://github.com/httpland/http-utils/commit/66c108f3c7a5cbd8a881f560fac6bbff0f51cbc1))
128+
* **requests:** add `equalsRequest` function ([383be15](https://github.com/httpland/http-utils/commit/383be151e21df37cc35ee8c255288f20e9bf2957))
129+
* **requests:** rename to `HttpMethod` from `Method` ([097490b](https://github.com/httpland/http-utils/commit/097490b9d21df9ac57ba9684812cc0981a3b670c))
130+
* **responses:** add `equalsResponse` function ([b1d8ade](https://github.com/httpland/http-utils/commit/b1d8adeff317cfa74e80f9c64e9e79f6be516da9))
131+
* **responses:** add `safeResponse` function ([74e9aed](https://github.com/httpland/http-utils/commit/74e9aedc489abe35dac6224762aa5836d2cf3535))
132+
133+
# 1.0.0-beta.1 (2022-08-19)
134+
135+
136+
### Features
137+
138+
* **handler:** add types for http handler ([a0f3785](https://github.com/httpland/http-utils/commit/a0f3785df6686cd9f6e201bffb9d5befbcf1155e))
139+
* **request:** add types for http methods ([2f59e87](https://github.com/httpland/http-utils/commit/2f59e870d4e2e9c54bf9c9295db416276cc55553))

LICENSE

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
MIT License
22

3-
Copyright (c) 2021 httpland
3+
Copyright (c) 2023 httpland
44

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
1111

1212
The above copyright notice and this permission notice shall be included in all
1313
copies or substantial portions of the Software.
1414

1515
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)