Skip to content

Commit

Permalink
Merge pull request #1134 from middyjs/release/5.0
Browse files Browse the repository at this point in the history
Release/5.0
  • Loading branch information
willfarrell authored Nov 15, 2023
2 parents 6c9fcc7 + 3e7e1c9 commit 22cbf5c
Show file tree
Hide file tree
Showing 236 changed files with 20,148 additions and 9,208 deletions.
9 changes: 5 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
How to reproduce the behaviour:

1. Sample code '...'
2. Input '....'
3. Unit test '....'
Expand All @@ -21,9 +21,10 @@ How to reproduce the behaviour:
A clear and concise description of what you expected to happen.

**Environment (please complete the following information):**
- Node.js: [e.g. 16]
- Middy: [e.g. 3.0.0]
- AWS SDK [e.g. 2.1000.0]

- Node.js: [e.g. 20]
- Middy: [e.g. 5.0.0]
- AWS SDK [e.g. 3.0.0]

**Additional context**
Add any other context about the problem here.
1 change: 0 additions & 1 deletion .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
strategy:
matrix:
node-version: [18.x]
#node-version: [ 14.x, 16.x ]

steps:
- name: Checkout repository
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
node-version: [16.x]
node-version: [18.x]

permissions:
contents: read
Expand All @@ -34,16 +34,19 @@ jobs:
run: |
npm install
- name: Transpile for Node.js ${{ matrix.node-version }}
- name: Transpile for Node.js ${{ matrix.node-version }} (esm)
run: |
./node_modules/.bin/lerna exec --bail --concurrency 2 -- ../../node_modules/.bin/swc --config-file ../../swc.cjs.config.json --source-maps false index.js --out-file index.cjs
./node_modules/.bin/lerna exec --bail --concurrency 2 -- sed -i.bak 's/exports,\ \"default\"/module,\ \"exports\"/g' index.cjs # Fix CommonJS default import
sed -i.bak 's/awsembeddedmetrics.default.createMetricsLogger/awsembeddedmetrics.createMetricsLogger/g' packages/cloudwatch-metrics/index.cjs # Fix CommonJS default import
./node_modules/.bin/lerna exec --bail --concurrency 2 -- ../../node_modules/.bin/swc --config-file ../../swc.esm.config.json --source-maps false index.js --out-file index.js
./node_modules/.bin/swc --config-file ./swc.cjs.config.json --source-maps false packages/validator/transpile.js --out-file packages/validator/transpile.cjs
sed -i.bak 's/exports,\ \"default\"/module,\ \"exports\"/g' packages/validator/transpile.cjs # Fix CommonJS default import
./node_modules/.bin/swc --config-file ./swc.esm.config.json --source-maps false packages/validator/transpile.js --out-file packages/validator/transpile.js
#- name: Transpile for Node.js ${{ matrix.node-version }} (cjs)
# run: |
# ./node_modules/.bin/lerna exec --bail --concurrency 2 -- ../../node_modules/.bin/swc --config-file ../../swc.cjs.config.json --source-maps false index.js --out-file index.cjs
# ./node_modules/.bin/lerna exec --bail --concurrency 2 -- sed -i.bak 's/exports,\ \"default\"/module,\ \"exports\"/g' index.cjs # Fix CommonJS default import
# sed -i.bak 's/awsEmbeddedMetrics.default.createMetricsLogger/awsEmbeddedMetrics.createMetricsLogger/g' packages/cloudwatch-metrics/index.cjs # Fix CommonJS default import

# ./node_modules/.bin/swc --config-file ./swc.cjs.config.json --source-maps false packages/validator/transpile.js --out-file packages/validator/transpile.cjs
# sed -i.bak 's/exports,\ \"default\"/module,\ \"exports\"/g' packages/validator/transpile.cjs # Fix CommonJS default import

#- name: Pre-Release
# if: contains(${{GITHUB_REF}}, 'alpha') || contains(${{GITHUB_REF}}, 'beta') || contains(${{GITHUB_REF}}, 'rc')
Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [18.x, 20.x]

steps:
- name: Checkout repository
Expand All @@ -28,22 +28,25 @@ jobs:
run: |
npm install
- name: Transpile for Node.js ${{ matrix.node-version }}
- name: Transpile for Node.js ${{ matrix.node-version }} (esm)
run: |
./node_modules/.bin/lerna exec --bail --concurrency 2 -- ../../node_modules/.bin/swc --config-file ../../swc.cjs.config.json --source-maps false index.js --out-file index.cjs
./node_modules/.bin/lerna exec --bail --concurrency 2 -- sed -i.bak 's/exports,\ \"default\"/module,\ \"exports\"/g' index.cjs # Fix CommonJS default import
sed -i.bak 's/awsEmbeddedMetrics.default.createMetricsLogger/awsEmbeddedMetrics.createMetricsLogger/g' packages/cloudwatch-metrics/index.cjs # Fix CommonJS default import
./node_modules/.bin/lerna exec --bail --concurrency 2 -- ../../node_modules/.bin/swc --config-file ../../swc.esm.config.json --source-maps false index.js --out-file index.js
./node_modules/.bin/swc --config-file ./swc.cjs.config.json --source-maps false packages/validator/transpile.js --out-file packages/validator/transpile.cjs
sed -i.bak 's/exports,\ \"default\"/module,\ \"exports\"/g' packages/validator/transpile.cjs # Fix CommonJS default import
./node_modules/.bin/swc --config-file ./swc.esm.config.json --source-maps false packages/validator/transpile.js --out-file packages/validator/transpile.js
#- name: Transpile for Node.js ${{ matrix.node-version }} (cjs)
# run: |
# ./node_modules/.bin/lerna exec --bail --concurrency 2 -- ../../node_modules/.bin/swc --config-file ../../swc.cjs.config.json --source-maps false index.js --out-file index.cjs
# ./node_modules/.bin/lerna exec --bail --concurrency 2 -- sed -i.bak 's/exports,\ \"default\"/module,\ \"exports\"/g' index.cjs # Fix CommonJS default import
# sed -i.bak 's/awsEmbeddedMetrics.default.createMetricsLogger/awsEmbeddedMetrics.createMetricsLogger/g' packages/cloudwatch-metrics/index.cjs # Fix CommonJS default import

# ./node_modules/.bin/swc --config-file ./swc.cjs.config.json --source-maps false packages/validator/transpile.js --out-file packages/validator/transpile.cjs
# sed -i.bak 's/exports,\ \"default\"/module,\ \"exports\"/g' packages/validator/transpile.cjs # Fix CommonJS default import
- name: Unit tests
run: |
npm run test:packages:unit
- name: Test cjs can be required
run: |
node -e 'const middy = require("./packages/core/index.cjs"); middy()'
node -e 'const httpRouterHandler = require("./packages/http-router/index.cjs"); httpRouterHandler([])'
node -e 'const {transpileSchema, transpileLocale} = require("./packages/validator/transpile.cjs"); transpileSchema({}); transpileLocale("")'
#- name: Test cjs can be required
# run: |
# node -e 'const middy = require("./packages/core/index.cjs"); middy()'
# node -e 'const httpRouterHandler = require("./packages/http-router/index.cjs"); httpRouterHandler([])'
# node -e 'const {transpileSchema, transpileLocale} = require("./packages/validator/transpile.cjs"); transpileSchema({}); transpileLocale("")'
7 changes: 6 additions & 1 deletion .github/workflows/website-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@ jobs:
website:
name: Publish website
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 18.x
node-version: ${{ matrix.node-version }}
- name: Install dependencies
working-directory: website
run: |
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"packages": ["packages/*"],
"version": "4.7.0"
"version": "5.0.0"
}
Loading

0 comments on commit 22cbf5c

Please sign in to comment.