Skip to content

Commit bfc38bc

Browse files
authored
Merge pull request #16 from PacktPublishing/chapters-update
update chapters
2 parents 5dcea50 + ab1b4e6 commit bfc38bc

File tree

580 files changed

+90084
-16089
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

580 files changed

+90084
-16089
lines changed

.github/workflows/cd.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Continuous Deployment
2+
run-name: ${{ github.event.workflow_run.head_commit.message }}
3+
on:
4+
workflow_run:
5+
workflows: [Continuous Integration]
6+
branches: [main]
7+
types: [completed]
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push'
12+
env:
13+
RENDER_SERVICE_ID: ${{ secrets.RENDER_SERVICE_ID }}
14+
RENDER_API_KEY: ${{ secrets.RENDER_API_KEY }}
15+
steps:
16+
- if: env.RENDER_SERVICE_ID != '' && env.RENDER_API_KEY != ''
17+
uses: JorgeLNJunior/render-deploy@v1.5.0
18+
with:
19+
service_id: ${{ secrets.RENDER_SERVICE_ID }}
20+
api_key: ${{ secrets.RENDER_API_KEY }}
21+
wait_deploy: true

.github/workflows/ci.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Continuous Integration
2+
on:
3+
- push
4+
- pull_request
5+
jobs:
6+
code-checks:
7+
name: Code Checks
8+
runs-on: ubuntu-latest
9+
defaults:
10+
run:
11+
working-directory: ./chapter-12
12+
steps:
13+
- uses: actions/checkout@v6
14+
- uses: actions/setup-node@v6
15+
with:
16+
node-version: 24
17+
- run: npm ci
18+
- run: npm run lint
19+
- run: npm run typecheck
20+
- run: npm run format:check
21+
unit-tests:
22+
name: Unit Tests
23+
runs-on: ubuntu-latest
24+
defaults:
25+
run:
26+
working-directory: ./chapter-12
27+
steps:
28+
- uses: actions/checkout@v6
29+
- uses: actions/setup-node@v6
30+
with:
31+
node-version: 24
32+
- run: npm ci
33+
- run: cp .env.example .env
34+
- run: npm run test:unit
35+
integration-tests:
36+
name: Integration Tests
37+
runs-on: ubuntu-latest
38+
defaults:
39+
run:
40+
working-directory: ./chapter-12
41+
steps:
42+
- uses: actions/checkout@v6
43+
- uses: actions/setup-node@v6
44+
with:
45+
node-version: 24
46+
- run: npm ci
47+
- run: npx playwright install --with-deps
48+
- run: cp .env.example .env
49+
- run: npm run test:integration
50+
- uses: actions/upload-artifact@v4
51+
if: failure()
52+
with:
53+
name: playwright-report-integration
54+
path: chapter-12/playwright-report/
55+
retention-days: 30
56+
e2e-tests:
57+
name: E2E Tests
58+
runs-on: ubuntu-latest
59+
defaults:
60+
run:
61+
working-directory: ./chapter-12
62+
steps:
63+
- uses: actions/checkout@v6
64+
- uses: actions/setup-node@v6
65+
with:
66+
node-version: 24
67+
- run: npm ci
68+
- run: npx playwright install --with-deps
69+
- run: cp .env.example .env
70+
- run: npm run test:e2e
71+
- uses: actions/upload-artifact@v4
72+
if: failure()
73+
with:
74+
name: playwright-report-e2e
75+
path: chapter-12/playwright-report/
76+
retention-days: 30

api/package-lock.json

Lines changed: 86 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@
55
"license": "MIT",
66
"scripts": {
77
"dev": "tsx watch src/index.ts",
8-
"start": "node ./dist/src/index.js",
8+
"start": "PORT=9999 node ./dist/src/index.js",
99
"typecheck": "tsc --noEmit",
1010
"lint": "eslint .",
1111
"lint:fix": "npm run lint --fix",
1212
"test": "cross-env NODE_ENV=test vitest",
1313
"build": "tsc && tsc-alias",
1414
"seed": "tsx src/db/seed.ts",
15-
"migrate": "npx drizzle-kit migrate",
16-
"generate": "npx drizzle-kit generate",
17-
"studio": "npx drizzle-kit studio",
15+
"migrate": "drizzle-kit migrate",
16+
"generate": "drizzle-kit generate",
17+
"studio": "drizzle-kit studio",
1818
"reset": "npm run migrate && npm run seed",
1919
"postinstall": "npm run reset"
2020
},
2121
"dependencies": {
2222
"@hono/node-server": "^1.18.1",
2323
"@hono/swagger-ui": "^0.5.2",
2424
"@hono/zod-openapi": "^1.0.2",
25-
"@libsql/client": "^0.15.10",
25+
"@libsql/client": "^0.17.0",
2626
"@scalar/hono-api-reference": "^0.9.13",
2727
"@types/bcryptjs": "^3.0.0",
2828
"@types/jsonwebtoken": "^9.0.10",
@@ -53,4 +53,4 @@
5353
"typescript": "^5.8.3",
5454
"vitest": "^3.2.1"
5555
}
56-
}
56+
}

chapter-02/eslint.config.js

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import js from '@eslint/js';
22
import typescript from '@typescript-eslint/eslint-plugin';
33
import typescriptParser from '@typescript-eslint/parser';
4+
import { defineConfig } from 'eslint/config';
45
import prettierConfig from 'eslint-config-prettier';
56
import checkFile from 'eslint-plugin-check-file';
67
import importPlugin from 'eslint-plugin-import';
@@ -11,10 +12,10 @@ import globals from 'globals';
1112

1213
import { importRules } from './infra/eslint-import-rules.js';
1314

14-
export default [
15+
export default defineConfig([
1516
js.configs.recommended,
1617
{
17-
ignores: ['.react-router/**', 'build/**', 'dist/**', 'node_modules/**'],
18+
ignores: ['.react-router/**', 'build/**'],
1819
},
1920
{
2021
files: ['eslint.config.js'],
@@ -107,16 +108,4 @@ export default [
107108
},
108109
},
109110
},
110-
{
111-
files: ['**/*.{test,spec}.{js,jsx,ts,tsx}'],
112-
languageOptions: {
113-
globals: {
114-
...globals.browser,
115-
...globals.es2022,
116-
...globals.node,
117-
...globals.vitest,
118-
React: 'readonly',
119-
},
120-
},
121-
},
122-
];
111+
]);

0 commit comments

Comments
 (0)