Skip to content

Commit 0913752

Browse files
committed
chore(adapter-rescue-flights): apply standalone adapter setup matching HN pattern
- Add .gitignore (node_modules/, dist/, .DS_Store, *.storage-state.json) - Update package.json: fix peerDep/devDep for @browserkit-dev/core to non-workspace refs (>=0.1.0 / github:browserkit-dev/browserkit#main), add engines.node>=20, files, and prepublishOnly script - Replace tsconfig.json: remove extends monorepo base, use standalone inline config matching browserkit-adapter-hackernews (NodeNext, strict, declaration, sourceMap) - Add .github/workflows/ci.yml: CI workflow matching HN pattern — dual-checkout, core build, dep path patch, patchright install, build, L1 unit tests only Made-with: Cursor
1 parent 4760aed commit 0913752

4 files changed

Lines changed: 92 additions & 7 deletions

File tree

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
name: Build & Test
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
# Checkout this adapter repo
16+
- uses: actions/checkout@v4
17+
with:
18+
path: adapter-rescue-flights
19+
20+
# Checkout browserkit core alongside it so the file: dep resolves
21+
- uses: actions/checkout@v4
22+
with:
23+
repository: browserkit-dev/browserkit
24+
path: browserkit
25+
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: 20
29+
30+
# Build core first so its dist/ is available
31+
- name: Install & build @browserkit-dev/core
32+
working-directory: browserkit
33+
run: |
34+
npm install -g pnpm
35+
pnpm install --frozen-lockfile
36+
pnpm --filter @browserkit-dev/core build
37+
38+
# Point adapter's @browserkit-dev/core dep at the checked-out core
39+
- name: Patch @browserkit-dev/core dep path
40+
working-directory: adapter-rescue-flights
41+
run: |
42+
npm pkg set 'devDependencies.@browserkit-dev/core'='file:../browserkit/packages/core'
43+
npm pkg set 'peerDependencies.@browserkit-dev/core'='>=0.1.0'
44+
45+
- name: Install adapter dependencies
46+
working-directory: adapter-rescue-flights
47+
run: npm install
48+
49+
- name: Install Patchright Chromium
50+
working-directory: adapter-rescue-flights
51+
run: npx patchright install chromium --with-deps
52+
53+
- name: Build
54+
working-directory: adapter-rescue-flights
55+
run: npm run build
56+
57+
# L1 unit tests only — integration tests (*.integration.test.ts) excluded by default vitest config
58+
# Integration tests require live network to El Al and Israir — not run in CI
59+
- name: Test
60+
working-directory: adapter-rescue-flights
61+
run: npm test
62+
timeout-minutes: 10
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules/
2+
dist/
3+
.DS_Store
4+
*.storage-state.json

packages/adapter-rescue-flights/package.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,24 @@
1010
"build": "tsc",
1111
"test": "vitest run",
1212
"test:integration": "vitest run --config vitest.integration.config.ts",
13-
"lint": "tsc --noEmit"
13+
"lint": "tsc --noEmit",
14+
"prepublishOnly": "tsc"
1415
},
15-
"peerDependencies": { "@browserkit-dev/core": "workspace:*" },
16+
"peerDependencies": { "@browserkit-dev/core": ">=0.1.0" },
1617
"devDependencies": {
17-
"@browserkit-dev/core": "workspace:*",
18+
"@browserkit-dev/core": "github:browserkit-dev/browserkit#main",
1819
"@types/node": "^22.13.14",
1920
"patchright": "^1.51.1",
2021
"tsx": "^4.19.3",
2122
"typescript": "^5.7.3",
2223
"vitest": "^3.0.9",
2324
"zod": "^3.24.2"
24-
}
25+
},
26+
"engines": {
27+
"node": ">=20"
28+
},
29+
"files": [
30+
"dist",
31+
"README.md"
32+
]
2533
}

packages/adapter-rescue-flights/tsconfig.json

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
{
2-
"extends": "../../tsconfig.base.json",
32
"compilerOptions": {
4-
"rootDir": "src",
3+
"target": "ES2022",
4+
"module": "NodeNext",
5+
"moduleResolution": "NodeNext",
6+
"lib": ["ES2022", "DOM"],
7+
"strict": true,
8+
"noUncheckedIndexedAccess": true,
9+
"noImplicitReturns": true,
10+
"noFallthroughCasesInSwitch": true,
11+
"esModuleInterop": true,
12+
"skipLibCheck": true,
13+
"declaration": true,
14+
"declarationMap": true,
15+
"sourceMap": true,
516
"outDir": "dist",
6-
"lib": ["ES2022", "DOM"]
17+
"rootDir": "src"
718
},
819
"include": ["src/**/*"],
920
"exclude": ["node_modules", "dist", "tests"]

0 commit comments

Comments
 (0)