Skip to content

Commit 2e6fe58

Browse files
authored
Merge pull request #4 from alexmarqs/main
♻️ Migrate to PNPM workspaces + Biomejs + Vitest
2 parents 53dba64 + 08dcd09 commit 2e6fe58

21 files changed

+5200
-21237
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,42 @@ name: CI
22
on:
33
push:
44
branches: ["main"]
5-
tags: ["*"]
65
pull_request:
76
branches: ["main"]
87

98
jobs:
10-
oxlint:
11-
name: Lint JS
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@v3
15-
- run: npx --yes oxlint@latest
16-
test:
17-
name: Test
9+
build-and-test:
10+
name: Build and Test
1811
runs-on: ubuntu-latest
1912
strategy:
2013
matrix:
21-
node-version: [18.x]
22-
needs:
23-
- oxlint
14+
node-version: [18.x]
2415
steps:
2516
- uses: actions/checkout@v4
17+
18+
- name: Setup pnpm
19+
uses: pnpm/action-setup@v4
20+
2621
- name: Use Node.js ${{ matrix.node-version }}
2722
uses: actions/setup-node@v4
2823
with:
2924
node-version: ${{ matrix.node-version }}
30-
- run: npm ci
31-
- run: npm run build
32-
- run: npm run lint
33-
- run: npm test
25+
cache: 'pnpm'
26+
27+
- name: Install dependencies
28+
run: pnpm install --frozen-lockfile
3429

35-
publish:
36-
name: Publish
37-
runs-on: ubuntu-latest
38-
if: startsWith(github.ref, 'refs/tags/')
39-
needs:
40-
- test
41-
steps:
42-
- uses: actions/checkout@v4
43-
- uses: actions/setup-node@v4
44-
with:
45-
registry-url: https://registry.npmjs.org/
46-
- run: npm ci
47-
- run: npm publish --access public --workspaces
48-
env:
49-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
30+
- name: Typecheck
31+
run: pnpm typecheck
32+
33+
- name: Oxlint
34+
run: pnpm dlx oxlint@latest
35+
36+
- name: Lint
37+
run: pnpm lint
38+
39+
- name: Build
40+
run: pnpm build
41+
42+
- name: Test
43+
run: pnpm test

.vscode/settings.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"editor.defaultFormatter": "biomejs.biome",
3+
"editor.codeActionsOnSave": {
4+
"source.organizeImports": "always"
5+
},
6+
"[json]": {
7+
"editor.defaultFormatter": "biomejs.biome"
8+
},
9+
"[typescript]": {
10+
"editor.defaultFormatter": "biomejs.biome"
11+
},
12+
"[javascript]": {
13+
"editor.defaultFormatter": "biomejs.biome"
14+
}
15+
}

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@ This repository is designed to host a collection of useful AWS Lambda Utilities
1414
- [Lambda Server-Timing Middleware (ext)](https://github.com/NishuGoel/lambda-server-timing/tree/main/src): Enables Lambdas to return responses with Server-Timing Header allowing to to pass request-specific timings from the backend to the browser. Allows a server to communicate performance metrics about the request-response cycle to the user agent. It also standardizes a JavaScript interface to enable applications to collect, process, and act on these metrics to optimize application delivery.
1515

1616
## Contributing
17+
1718
The packages contained in this repository are free and open-source software. Pull requests are welcome!
1819

20+
## Packages releases
21+
22+
This repository requires manual releases of the packages for now. We will be including `changesets` (or similar) in the future to manage packages releases in the monorepo.
23+
1924
## Disclaimer
2025

2126
This library is currently in beta. Expect missing features, incomplete documentation, and potential breaking changes in the API.

biome.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3+
"files": {
4+
"ignore": ["node_modules", "dist", "lib", "docs", "coverage", "tmp", "static"]
5+
},
6+
"formatter": {
7+
"enabled": true,
8+
"lineWidth": 120,
9+
"indentStyle": "space",
10+
"indentWidth": 2,
11+
"lineEnding": "lf",
12+
"formatWithErrors": false
13+
},
14+
"organizeImports": {
15+
"enabled": true
16+
},
17+
"linter": {
18+
"enabled": true,
19+
"rules": {
20+
"recommended": true,
21+
"complexity": {
22+
"useLiteralKeys": "off"
23+
},
24+
"style": {
25+
"useTemplate": "off",
26+
"noUnusedTemplateLiteral": "off"
27+
}
28+
}
29+
},
30+
"javascript": {
31+
"formatter": {
32+
"quoteStyle": "single",
33+
"trailingCommas": "all",
34+
"semicolons": "always"
35+
}
36+
}
37+
}

0 commit comments

Comments
 (0)