Skip to content

Commit 76dc083

Browse files
committed
upgrade all deps, koyeb sponsoring
1 parent 60f13c9 commit 76dc083

File tree

13 files changed

+3665
-4254
lines changed

13 files changed

+3665
-4254
lines changed

.github/workflows/main.yml

+5-12
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,27 @@
11
name: Build and deploy API
22

33
on:
4-
# Trigger the workflow on push or pull request,
5-
# but only for the main branch
64
push:
75
branches: [ main ]
8-
pull_request:
9-
branches: [ main ]
106

117
jobs:
128
build-and-deploy:
139
runs-on: ubuntu-latest
1410

1511
steps:
16-
- uses: actions/checkout@v3
17-
- uses: actions/setup-node@v3
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
1814
with:
19-
node-version: 18
20-
cache: 'npm' # caching global packages data
15+
node-version: 22
2116

22-
- run: npm ci --legacy-peer-deps
23-
- run: npm run grunt
17+
- run: npm ci
18+
- run: npm run build
2419

2520
- name: Deploy API to book-monkey5/api4-build (main branch)
26-
if: ${{ github.event_name == 'push' }}
2721
env:
2822
GH_TOKEN: ${{ secrets.GH_TOKEN }}
2923
GITHUB_ORG: https://github.com/book-monkey4
3024
GITHUB_NAME: The Buildbot
3125
GITHUB_EMAIL: [email protected]
3226
NAME: api4-build
3327
run: npx angular-cli-ghpages --repo "$GITHUB_ORG/$NAME.git" --name "$GITHUB_NAME" --email "$GITHUB_EMAIL" --branch main --message "Auto-generated commit"
34-

package-lock.json

+3,567-4,089
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+16-23
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,33 @@
99
},
1010
"scripts": {
1111
"prestart": "grunt",
12-
"grunt": "grunt",
12+
"build": "grunt",
1313
"start": "node ./dist/start.js",
1414
"start:dev": "grunt && concurrently \"grunt watch\" \"nodemon\""
1515
},
1616
"dependencies": {
17-
"body-parser": "^1.19.0",
18-
"cookie-parser": "^1.4.5",
17+
"body-parser": "^1.20.2",
1918
"cors": "^2.8.5",
2019
"errorhandler": "^1.5.1",
21-
"express": "^4.17.1",
22-
"express-graphql": "^0.9.0",
23-
"graphql": "^15.0.0",
24-
"graphql-tools": "^5.0.0",
25-
"lodash": "^4.17.15",
26-
"method-override": "^3.0.0",
20+
"express": "^4.19.2",
21+
"lodash": "^4.17.21",
2722
"morgan": "^1.10.0",
28-
"pug": "^2.0.4",
29-
"swagger-ui-express": "4.1.4",
30-
"web-push": "^3.4.3"
23+
"pug": "^3.0.3",
24+
"swagger-ui-express": "5.0.1",
25+
"web-push": "^3.6.7"
3126
},
3227
"devDependencies": {
33-
"@types/body-parser": "1.19.0",
34-
"@types/cookie-parser": "^1.4.2",
35-
"@types/errorhandler": "1.5.0",
36-
"@types/lodash": "^4.14.149",
37-
"@types/method-override": "0.0.31",
38-
"@types/morgan": "^1.9.0",
39-
"@types/web-push": "^3.3.0",
40-
"concurrently": "^5.1.0",
41-
"grunt": "^1.1.0",
28+
"@types/body-parser": "1.19.5",
29+
"@types/errorhandler": "1.5.3",
30+
"@types/lodash": "^4.17.5",
31+
"@types/morgan": "^1.9.9",
32+
"@types/web-push": "^3.6.3",
33+
"concurrently": "^8.2.2",
34+
"grunt": "^1.6.1",
4235
"grunt-contrib-copy": "^1.0.0",
4336
"grunt-contrib-watch": "^1.1.0",
4437
"grunt-ts": "^6.0.0-beta.22",
45-
"nodemon": "^2.0.3",
46-
"typescript": "^3.8.3"
38+
"nodemon": "^3.1.3",
39+
"typescript": "^5.4.5"
4740
}
4841
}

package.prod.json

+7-12
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,17 @@
66
"start": "node start.js"
77
},
88
"engines": {
9-
"node": "18.x"
9+
"node": "22.x"
1010
},
1111
"dependencies": {
12-
"body-parser": "^1.19.0",
13-
"cookie-parser": "^1.4.5",
12+
"body-parser": "^1.20.2",
1413
"cors": "^2.8.5",
1514
"errorhandler": "^1.5.1",
16-
"express": "^4.17.1",
17-
"express-graphql": "^0.9.0",
18-
"graphql": "^15.0.0",
19-
"graphql-tools": "^5.0.0",
20-
"lodash": "^4.17.15",
21-
"method-override": "^3.0.0",
15+
"express": "^4.19.2",
16+
"lodash": "^4.17.21",
2217
"morgan": "^1.10.0",
23-
"pug": "^2.0.4",
24-
"swagger-ui-express": "4.1.4",
25-
"web-push": "^3.4.3"
18+
"pug": "^3.0.3",
19+
"swagger-ui-express": "5.0.1",
20+
"web-push": "^3.6.7"
2621
}
2722
}

public/style.css

+35
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,41 @@
77
background-color:white;
88
}
99

10+
button#reset {
11+
padding: 0.375rem 0.75rem;
12+
color: white;
13+
background: #dc3545;
14+
border: 1px solid #dc3545;
15+
border-radius: 5px;
16+
cursor: pointer;
17+
font-weight: bold;
18+
}
19+
20+
button#reset:hover {
21+
background: #bb2d3b;
22+
border: 1px solid #b02a37;
23+
}
24+
25+
#resetOK {
26+
margin-left: 10px;
27+
font-weight: bold;
28+
color: green;
29+
visibility: hidden;
30+
}
31+
32+
p.sponsor {
33+
margin-top: 2rem !important;
34+
padding: 1rem;
35+
font-style: italic;
36+
background-color: #ededed;
37+
}
38+
39+
.heart {
40+
float: right;
41+
width: 80px;
42+
}
43+
44+
1045

1146
/* https://github.com/sindresorhus/github-markdown-css */
1247

src/graphql/resolvers.ts

-24
This file was deleted.

src/graphql/routes.ts

-17
This file was deleted.

src/graphql/schema.ts

-9
This file was deleted.

src/graphql/types.ts

-46
This file was deleted.

src/routes/books.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NextFunction, Request, Response, Router } from "express";
1+
import { NextFunction, Request, Response, Router } from 'express';
22
import * as _ from 'lodash';
33

44
import { BookFactory, PLACEHOLDER_IMG } from '../model/book-factory';

src/routes/route.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NextFunction, Request, Response } from "express";
1+
import { NextFunction, Request, Response } from 'express';
22

33
/**
44
* Constructor
@@ -8,10 +8,8 @@ import { NextFunction, Request, Response } from "express";
88
export class BaseRoute {
99

1010
protected title: string;
11-
1211
private scripts: string[];
1312

14-
1513
/**
1614
* Constructor
1715
*
@@ -50,7 +48,7 @@ export class BaseRoute {
5048
*/
5149
public render(req: Request, res: Response, view: string, options?: Object) {
5250
//add constants
53-
res.locals.BASE_URL = "/";
51+
res.locals.BASE_URL = '/';
5452

5553
//add scripts
5654
res.locals.scripts = this.scripts;

src/server.ts

+1-10
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,15 @@ import * as logger from 'morgan';
55
import * as path from 'path';
66
import * as swaggerUi from 'swagger-ui-express';
77
import errorHandler = require('errorhandler');
8-
import methodOverride = require('method-override');
8+
const fs = require('fs');
99

1010
import { IndexRoute } from './routes/index';
1111
import { BooksStore } from './books-store';
1212
import { BooksRoute } from './routes/books';
1313
import { NotificationsRoute } from './routes/notifications';
14-
import { GraphQLRoute } from './graphql/routes';
1514
import { fakeBearerMiddleware } from './fake-bearer-middleware';
1615
import { NotificationService } from './notification-service';
1716

18-
var fs = require('fs');
1917

2018
/**
2119
* The server.
@@ -85,9 +83,6 @@ export class Server {
8583
extended: true
8684
}));
8785

88-
//mount override?
89-
this.app.use(methodOverride());
90-
9186
// catch 404 and forward to error handler
9287
this.app.use(function (err: any, req: express.Request, res: express.Response, next: express.NextFunction) {
9388
err.status = 404;
@@ -144,9 +139,6 @@ export class Server {
144139
const booksRouter = express.Router();
145140
BooksRoute.create(booksRouter, store, notificationService)
146141

147-
const graphQLRouter = express.Router();
148-
GraphQLRoute.create(graphQLRouter, store);
149-
150142
const notificationsRouter = express.Router();
151143
NotificationsRoute.create(notificationsRouter, notificationService)
152144

@@ -159,7 +151,6 @@ export class Server {
159151
this.app.use('/books', booksRouter);
160152
this.app.use('/secure/book', fakeBearerMiddleware, booksRouter);
161153
this.app.use('/secure/books', fakeBearerMiddleware, booksRouter);
162-
this.app.use('/graphql', graphQLRouter);
163154
this.app.use('/notifications', notificationsRouter);
164155
this.app.use(router);
165156
}

0 commit comments

Comments
 (0)