Skip to content

Commit

Permalink
Merge branch 'release/5.0' into fix/http-json-body-parser/resolve-typ…
Browse files Browse the repository at this point in the history
…e-issues
  • Loading branch information
naorpeled committed Nov 11, 2023
2 parents 53c0166 + 583a3b0 commit a996c81
Show file tree
Hide file tree
Showing 235 changed files with 17,585 additions and 6,590 deletions.
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-alpha.2"
}
6 changes: 3 additions & 3 deletions package-lock.json

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

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@middy/monorepo",
"version": "4.7.0",
"version": "5.0.0-alpha.2",
"description": "🛵 The stylish Node.js middleware engine for AWS Lambda",
"private": true,
"type": "module",
"engines": {
"node": ">=16"
"node": ">=18"
},
"engineStrict": true,
"scripts": {
Expand All @@ -24,11 +24,10 @@
"test:packages:typings": "lerna exec --bail --concurrency 5 tsd",
"release:tag": "git tag $npm_package_version && git push --tags",
"lerna:rm": "npm run lerna:rm:node_modules && npm run lerna:rm:lock",
"lerna:rm:cjs": "lerna exec -- rm -rf index.cjs && lerna exec -- rm -rf index.cjs.bak",
"lerna:rm:lock": "lerna exec -- rm -rf package-lock.json",
"lerna:rm:node_modules": "lerna exec -- rm -rf node_modules",
"lerna:update": "lerna exec --bail --concurrency 5 npm update && npm install",
"lerna:outdated": "lerna exec --concurrency 5 npm outdated --no-bail",
"lerna:outdated": "lerna exec --concurrency 5 --no-bail npm outdated",
"lerna:audit": "lerna exec --concurrency 2 npm audit fix",
"lerna:fund": "lerna exec --concurrency 2 npm fund",
"lerna:sync": "lerna exec --bail --concurrency 2 npm install && lerna publish --exact --yes --skip-npm --skip-git --repo-version $npm_package_version",
Expand Down
Loading

0 comments on commit a996c81

Please sign in to comment.