Skip to content

Commit d2a5187

Browse files
authored
[major] TypeScript rewrite, support ES Modules. (vercel#706)
1 parent 8949c70 commit d2a5187

File tree

28 files changed

+6121
-2170
lines changed

28 files changed

+6121
-2170
lines changed

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# .gitattributes
2+
# Makes sure all line endings are LF.
3+
4+
* text=auto eol=lf
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Report a bug
2+
description: ———
3+
labels: [bug]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
# Thanks for reporting this bug!
9+
10+
Help us replicate and find a fix for the issue by filling in this form.
11+
- type: textarea
12+
attributes:
13+
label: Description
14+
description: |
15+
Describe the issue and how to replicate it. If possible, please include
16+
a minimal example to reproduce the issue.
17+
validations:
18+
required: true
19+
- type: input
20+
attributes:
21+
label: Library version
22+
description: |
23+
Output of the `serve --version` command
24+
validations:
25+
required: true
26+
- type: input
27+
attributes:
28+
label: Node version
29+
description: Output of the `node --version` command
30+
validations:
31+
required: true
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Suggest an improvement or new feature
2+
description: ———
3+
labels: [enhancement]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
# Thanks for filing this feature request!
9+
10+
Help us understanding this feature and the need for it better by filling in this form.
11+
- type: textarea
12+
attributes:
13+
label: Description
14+
description: Describe the feature in detail
15+
validations:
16+
required: true
17+
- type: textarea
18+
attributes:
19+
label: Why
20+
description: Why should we add this feature? What are potential use cases for it?
21+
validations:
22+
required: true
23+
- type: textarea
24+
attributes:
25+
label: Alternatives
26+
description: Describe the alternatives you have considered, or existing workarounds
27+
validations:
28+
required: true
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<!--
2+
Hi there! Thanks for contributing! Please fill in this template to help us
3+
review and merge the PR as quickly and easily as possible!
4+
-->
5+
6+
## Related Issues
7+
8+
<!--
9+
If this is a bug fix, or adds a feature mentioned in another issue, mention
10+
it as follows:
11+
12+
- Closes #10
13+
- Fixes #15
14+
-->
15+
16+
## Description
17+
18+
<!--
19+
Explain what has been added/changed/removed, in
20+
[keepachangelog.com](https://keepachangelog.com) style.
21+
-->
22+
23+
### Added
24+
25+
<!--
26+
- Added a new method on the limiter object to reset the count for a certain IP [#10]
27+
-->
28+
29+
### Changed
30+
31+
<!--
32+
- Deprecated `global` option
33+
- Fixed test for deprecated options [#15]
34+
-->
35+
36+
### Removed
37+
38+
<!--
39+
- Removed deprecated `headers` option
40+
-->
41+
42+
## Caveats/Problems/Issues
43+
44+
<!--
45+
Any weird code/problems you faced while making this PR. Feel free to ask for
46+
help with anything, especially if it's your first time contributing!
47+
-->
48+
49+
## Checklist
50+
51+
- [ ] The issues that this PR fixes/closes have been mentioned above.
52+
- [ ] What this PR adds/changes/removes has been explained.
53+
- [ ] All tests (`pnpm test`) pass.
54+
- [ ] The linter (`pnpm lint`) does not throw an errors.
55+
- [ ] All added/modified code has been commented, and
56+
methods/classes/constants/types have been annotated with TSDoc comments.

.github/workflows/ci.yaml

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,47 @@
1+
# .github/workflows/ci.yaml
2+
# Lints and tests the server every time a commit is pushed to the remote
3+
# repository.
4+
15
name: CI
2-
on:
3-
- push
4-
- pull_request
6+
on: [push, pull_request]
57
jobs:
8+
lint:
9+
name: Lint
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout the repository
13+
uses: actions/checkout@v2
14+
- name: Setup PNPM 7
15+
uses: pnpm/action-setup@v2.0.1
16+
with:
17+
version: latest
18+
- name: Setup Node 18
19+
uses: actions/setup-node@v2
20+
with:
21+
node-version: 18
22+
registry-url: 'https://registry.npmjs.org/'
23+
cache: 'pnpm'
24+
- name: Install dependencies
25+
run: pnpm install
26+
- name: Check for errors in code/formatting
27+
run: pnpm lint
628
test:
7-
name: Node.js ${{ matrix.node-version }}
29+
name: Test
830
runs-on: ubuntu-latest
9-
strategy:
10-
matrix:
11-
node-version:
12-
- 16
13-
- 14
1431
steps:
15-
- uses: actions/checkout@v2
16-
- uses: actions/setup-node@v1
32+
- name: Checkout the repository
33+
uses: actions/checkout@v2
34+
- name: Setup PNPM 7
35+
uses: pnpm/action-setup@v2.0.1
36+
with:
37+
version: latest
38+
- name: Setup Node 18
39+
uses: actions/setup-node@v2
1740
with:
18-
node-version: ${{ matrix.node-version }}
19-
- run: npm install
20-
- run: npm test
41+
node-version: 18
42+
registry-url: 'https://registry.npmjs.org/'
43+
cache: 'pnpm'
44+
- name: Install dependencies
45+
run: pnpm install
46+
- name: Run all tests
47+
run: pnpm test

.gitignore

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1-
node_modules
1+
# .gitignore
2+
# A list of files and folders that should not be tracked by Git.
3+
4+
node_modules/
5+
coverage/
6+
build/
7+
.cache/
8+
.idea/
9+
.vscode/
10+
211
*.log
3-
.nyc_output
12+
*.tgz
13+
*.bak
14+
*.tmp

.npmrc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
save-exact = true
1+
# .npmrc
2+
# Configuration for pnpm.
3+
4+
# Uses the exact version instead of any within-patch-range version of an
5+
# installed package.
6+
save-exact=true
7+
# Do not error out on missing peer dependencies.
8+
strict-peer-dependencies=false

LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)