Skip to content

Commit 3b1f109

Browse files
authored
chore: Overhaul and update project (#11)
- Breaking Change: Dropping support for Node 11 and below. - Breaking Change: Dropping support for Flow. - Bug Fix: Resolves #5. Event handlers are cleaned up after each iteration, fixing some memory leak issues. - Bug Fix: Resolves #7. Code no longer depends on babel runtimes or regenerator. - Bug Fix: Handles stream not buffering due to starving the event loop. - Feature: Resolves #1. Now handles `.throw` and `.return` hooks on the async iterator. - Feature: Properly closes stream when finished. - Feature: Added support for TypeScript. - Feature: Support for Node.js versions 12, 14, and 16. - Chore: General overhaul of project setup (should not impact what is published).
1 parent 85933cc commit 3b1f109

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+12060
-807
lines changed

.babelrc

-20
This file was deleted.

.editorconfig

+2-9
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,8 @@ root = true
44
# Unix-style newlines with a newline ending every file
55
[*]
66
charset = utf-8
7-
trim_trailing_whitespace = true
87
end_of_line = lf
9-
insert_final_newline = true
10-
indent_style = space
118
indent_size = 4
12-
13-
[Makefile]
14-
indent_style = tab
15-
16-
[{package.json,.travis.yml}]
179
indent_style = space
18-
indent_size = 2
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true

.eslintignore

+24-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1-
.idea/
2-
build/
3-
flow-typed/
1+
# project
2+
/.nyc_output/
3+
/coverage/
4+
/lib/
5+
*.tsbuildinfo
6+
*.tgz
7+
8+
# node
9+
/node_modules/
10+
**/npm-debug.log*
11+
12+
# editors
13+
/.idea/
14+
**/*.kate-swp
15+
**/*.swp
16+
**/*~
17+
18+
# git
19+
**/*.orig
20+
21+
# file managers
22+
**/.directory
23+
**/.DS_Store
24+
**/Thumbs.db

.eslintrc.js

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
"use strict";
2+
const config = {
3+
root: true,
4+
env: {
5+
es2022: true,
6+
node: true,
7+
},
8+
extends: ["eslint:recommended"],
9+
rules: {
10+
strict: ["error"],
11+
"valid-jsdoc": [
12+
"error",
13+
{
14+
requireReturn: false,
15+
requireReturnType: false,
16+
requireParamType: false,
17+
},
18+
],
19+
},
20+
overrides: [
21+
{
22+
files: ["src/**"],
23+
parser: "@typescript-eslint/parser",
24+
parserOptions: {
25+
tsconfigRootDir: __dirname,
26+
project: ["./tsconfig.json"],
27+
},
28+
plugins: ["@typescript-eslint/eslint-plugin"],
29+
extends: [
30+
"eslint:recommended",
31+
"plugin:@typescript-eslint/recommended",
32+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
33+
"prettier",
34+
],
35+
},
36+
],
37+
};
38+
module.exports = config;

.eslintrc.json

-28
This file was deleted.

.flowconfig

Whitespace-only changes.

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @basicdays

.github/dependabot.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
3+
updates:
4+
# see: https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/keeping-your-actions-up-to-date-with-github-dependabot
5+
- package-ecosystem: github-actions
6+
directory: "/"
7+
schedule:
8+
interval: daily
9+
reviewers:
10+
- basicdays

.github/workflows/build.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "build"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- v0.2
8+
push:
9+
branches:
10+
- master
11+
- v0.2
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-20.04
16+
strategy:
17+
matrix:
18+
node: ["12", "14", "16"]
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
- name: Setup Node
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: ${{ matrix.node }}
26+
- run: npm install
27+
- run: npm run build
28+
- run: npm test

.gitignore

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
# project
22
/.nyc_output/
3-
/build/
43
/coverage/
4+
/lib/
5+
*.tsbuildinfo
6+
*.tgz
57

68
# node
7-
node_modules/
8-
npm-debug.log
9+
/node_modules/
10+
**/npm-debug.log*
911

1012
# editors
11-
/.idea/dictionaries
12-
/.idea/*.local.xml
13-
/.idea/workspace.xml
14-
*.kate-swp
15-
*.swp
13+
/.idea/
14+
**/*.kate-swp
15+
**/*.swp
16+
**/*~
1617

1718
# git
18-
*.orig
19+
**/*.orig
1920

2021
# file managers
21-
.directory
22-
.DS_Store
22+
**/.directory
23+
**/.DS_Store
24+
**/Thumbs.db

.idea/encodings.xml

-6
This file was deleted.

.idea/inspectionProfiles/Project_Default.xml

-17
This file was deleted.

.idea/jsLibraryMappings.xml

-7
This file was deleted.

.idea/misc.xml

-9
This file was deleted.

.idea/modules.xml

-8
This file was deleted.

.idea/node-stream-to-async-iterator.iml

-9
This file was deleted.

.idea/vcs.xml

-6
This file was deleted.

.mocharc.cover.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"require": ["./src/test/index.ts"],
3+
"spec": [
4+
"./src/**/*.test.{ts,tsx,js,mjs}",
5+
"./src/test/**/*.{ts,tsx,js,mjs}"
6+
]
7+
}

.mocharc.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"require": ["./lib/test/index.js"],
3+
"spec": ["./lib/**/*.test.js", "./lib/test/**/*.js"]
4+
}

.npmignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
test/
1+
*
2+
!lib/**/*
3+
lib/**/*.map
4+
lib/**/*.test.{d.ts,js}
5+
lib/test/**/*

.prettierignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# project
2+
/.nyc_output/
3+
/coverage/
4+
/lib/
5+
*.tsbuildinfo
6+
*.tgz
7+
8+
# node
9+
/node_modules/
10+
**/npm-debug.log*
11+
12+
# editors
13+
/.idea/
14+
**/*.kate-swp
15+
**/*.swp
16+
**/*~
17+
18+
# git
19+
**/*.orig
20+
21+
# file managers
22+
**/.directory
23+
**/.DS_Store
24+
**/Thumbs.db

.travis.yml

-8
This file was deleted.

.vscode/launch.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "pwa-node",
9+
"request": "launch",
10+
"name": "Test",
11+
"skipFiles": ["<node_internals>/**"],
12+
"runtimeExecutable": "npm",
13+
"runtimeArgs": ["test"]
14+
}
15+
]
16+
}

.vscode/settings.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"editor.codeActionsOnSave": {
3+
"source.fixAll.eslint": true
4+
},
5+
"editor.defaultFormatter": "esbenp.prettier-vscode",
6+
"editor.formatOnSave": true
7+
}

.vscode/tasks.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"type": "npm",
6+
"script": "build",
7+
"group": {
8+
"kind": "build",
9+
"isDefault": true
10+
},
11+
"problemMatcher": [],
12+
"label": "npm: build",
13+
"detail": "run-p 'build:*'"
14+
},
15+
{
16+
"type": "npm",
17+
"script": "test:mocha",
18+
"problemMatcher": [],
19+
"label": "npm: test:mocha",
20+
"detail": "mocha",
21+
"group": {
22+
"kind": "test",
23+
"isDefault": true
24+
}
25+
}
26+
]
27+
}

0 commit comments

Comments
 (0)