Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
tylermichael authored May 10, 2024
2 parents 35bdd52 + f4b071b commit 190d953
Show file tree
Hide file tree
Showing 19 changed files with 479 additions and 96 deletions.
2 changes: 1 addition & 1 deletion .github/DISCUSSION_TEMPLATE/help.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ body:
- type: input
attributes:
label: Example
description: A link to a minimal reproduction is helpful for debugging! You can fork [this stackblitz setup](https://stackblitz.com/edit/sqs-consumer-starter) to get a reproduction setup quickly.
description: A link to a minimal reproduction is helpful for debugging! You can use one of our [existing examples](https://github.com/bbc/sqs-consumer-starter/tree/main/examples) to get a reproduction setup quickly.
validations:
required: false
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ body:
Please add a link to a minimal reproduction.
Note:
- Please keep your example as simple and reproduceable as possible, try leaving out dependencies that are not required for reproduction.
- To create a shareable code example for web, you can use Stackblitz (https://stackblitz.com/edit/sqs-consumer-starter).
- To create a shareable code example for web, you can use one of our existing examples: (https://github.com/bbc/sqs-consumer-starter/tree/main/examples).
- Please make sure the example is complete and runnable - e.g. avoid localhost URLs.
placeholder: |
e.g. Code Sandbox, Stackblitz, Expo Snack or TypeScript playground
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/annotate-test-reports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Annotate CI run with test results
on:
workflow_run:
workflows:
- "Run Tests"
types:
- completed
permissions:
actions: read
contents: read
checks: write
pull-requests: write

jobs:
annotate:
name: Annotate CI run with test results
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion != 'cancelled' }}
strategy:
fail-fast: false
matrix:
node-version: [18.x, 20.x, 22.x]
timeout-minutes: 5
steps:
- name: Annotate CI run with test results
uses: dorny/test-reporter@v1
with:
artifact: test-reports-${{ matrix.node-version }}
name: Test Results (${{matrix.node-version}}
path: "test-results.json"
reporter: mocha-json
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20.x
cache: 'npm'

- name: NPM Audit
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/pr-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Comment PR Coverage
on:
pull_request:
branches:
- 'main'
permissions:
contents: read
pull-requests: write

jobs:
coverage_report:
name: Generate coverage report
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install Node Modules
run: npm ci

- name: Run Coverage Check
run: npm run lcov

- name: Setup LCOV
uses: hrishikesh-kadam/setup-lcov@v1

- name: Report code coverage
uses: zgosalvez/github-actions-report-lcov@v3
with:
coverage-files: coverage/lcov.info
minimum-coverage: 90
artifact-name: code-coverage-report
github-token: ${{ secrets.GITHUB_TOKEN }}
update-comment: true
6 changes: 4 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ on:
- main
permissions:
contents: read
checks: write
pull-requests: write

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v4
Expand All @@ -34,7 +36,7 @@ jobs:
- name: Run Tests and Linting
run: npm run test

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: test-reports-${{ matrix.node-version }}
path: test/reports/
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 12 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
{
"name": "sqs-consumer",
"version": "10.0.0-canary.2",
"version": "10.1.0",
"description": "Build SQS-based Node applications without the boilerplate",
"type": "module",
"main": "dist/cjs/index.js",
"types": "dist/cjs/index.d.ts",
"exports": {
".": {
"types": "./dist/types/index.d.ts",
"require": "./dist/cjs/index.js",
"import": "./dist/esm/index.js",
"default": "./dist/esm/index.js"
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.js"
}
}
},
"engines": {
Expand All @@ -21,7 +27,7 @@
"build": "npm run clean && npm run compile && npm run add-package-jsons",
"watch": "tsc --watch",
"prepublishOnly": "npm run build",
"test:unit": "mocha --recursive --full-trace --exit",
"test:unit": "mocha --recursive --full-trace --exit --reporter json > test/reports/test-results.json",
"pretest:integration:init": "npm run build",
"test:integration:init": "sh ./test/scripts/initIntTests.sh",
"test:integration": "npm run test:integration:init && cucumber-js --config ./test/config/cucumber.mjs",
Expand Down
4 changes: 4 additions & 0 deletions scripts/addPackageJsons.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ function buildPackageJson() {
throw err;
}
dirs.forEach((dir) => {
if (dir === "types") {
return;
}

const packageJsonFile = join(buildDir, dir, "/package.json");

if (!existsSync(packageJsonFile)) {
Expand Down
22 changes: 0 additions & 22 deletions src/bind.ts

This file was deleted.

Loading

0 comments on commit 190d953

Please sign in to comment.