Skip to content

Commit

Permalink
upgrade all deps, koyeb sponsoring
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesHoppe committed Jun 14, 2024
1 parent 60f13c9 commit 76dc083
Show file tree
Hide file tree
Showing 13 changed files with 3,665 additions and 4,254 deletions.
17 changes: 5 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
name: Build and deploy API

on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm' # caching global packages data
node-version: 22

- run: npm ci --legacy-peer-deps
- run: npm run grunt
- run: npm ci
- run: npm run build

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

7,656 changes: 3,567 additions & 4,089 deletions package-lock.json

Large diffs are not rendered by default.

39 changes: 16 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,33 @@
},
"scripts": {
"prestart": "grunt",
"grunt": "grunt",
"build": "grunt",
"start": "node ./dist/start.js",
"start:dev": "grunt && concurrently \"grunt watch\" \"nodemon\""
},
"dependencies": {
"body-parser": "^1.19.0",
"cookie-parser": "^1.4.5",
"body-parser": "^1.20.2",
"cors": "^2.8.5",
"errorhandler": "^1.5.1",
"express": "^4.17.1",
"express-graphql": "^0.9.0",
"graphql": "^15.0.0",
"graphql-tools": "^5.0.0",
"lodash": "^4.17.15",
"method-override": "^3.0.0",
"express": "^4.19.2",
"lodash": "^4.17.21",
"morgan": "^1.10.0",
"pug": "^2.0.4",
"swagger-ui-express": "4.1.4",
"web-push": "^3.4.3"
"pug": "^3.0.3",
"swagger-ui-express": "5.0.1",
"web-push": "^3.6.7"
},
"devDependencies": {
"@types/body-parser": "1.19.0",
"@types/cookie-parser": "^1.4.2",
"@types/errorhandler": "1.5.0",
"@types/lodash": "^4.14.149",
"@types/method-override": "0.0.31",
"@types/morgan": "^1.9.0",
"@types/web-push": "^3.3.0",
"concurrently": "^5.1.0",
"grunt": "^1.1.0",
"@types/body-parser": "1.19.5",
"@types/errorhandler": "1.5.3",
"@types/lodash": "^4.17.5",
"@types/morgan": "^1.9.9",
"@types/web-push": "^3.6.3",
"concurrently": "^8.2.2",
"grunt": "^1.6.1",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-watch": "^1.1.0",
"grunt-ts": "^6.0.0-beta.22",
"nodemon": "^2.0.3",
"typescript": "^3.8.3"
"nodemon": "^3.1.3",
"typescript": "^5.4.5"
}
}
19 changes: 7 additions & 12 deletions package.prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,17 @@
"start": "node start.js"
},
"engines": {
"node": "18.x"
"node": "22.x"
},
"dependencies": {
"body-parser": "^1.19.0",
"cookie-parser": "^1.4.5",
"body-parser": "^1.20.2",
"cors": "^2.8.5",
"errorhandler": "^1.5.1",
"express": "^4.17.1",
"express-graphql": "^0.9.0",
"graphql": "^15.0.0",
"graphql-tools": "^5.0.0",
"lodash": "^4.17.15",
"method-override": "^3.0.0",
"express": "^4.19.2",
"lodash": "^4.17.21",
"morgan": "^1.10.0",
"pug": "^2.0.4",
"swagger-ui-express": "4.1.4",
"web-push": "^3.4.3"
"pug": "^3.0.3",
"swagger-ui-express": "5.0.1",
"web-push": "^3.6.7"
}
}
35 changes: 35 additions & 0 deletions public/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,41 @@
background-color:white;
}

button#reset {
padding: 0.375rem 0.75rem;
color: white;
background: #dc3545;
border: 1px solid #dc3545;
border-radius: 5px;
cursor: pointer;
font-weight: bold;
}

button#reset:hover {
background: #bb2d3b;
border: 1px solid #b02a37;
}

#resetOK {
margin-left: 10px;
font-weight: bold;
color: green;
visibility: hidden;
}

p.sponsor {
margin-top: 2rem !important;
padding: 1rem;
font-style: italic;
background-color: #ededed;
}

.heart {
float: right;
width: 80px;
}



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

Expand Down
24 changes: 0 additions & 24 deletions src/graphql/resolvers.ts

This file was deleted.

17 changes: 0 additions & 17 deletions src/graphql/routes.ts

This file was deleted.

9 changes: 0 additions & 9 deletions src/graphql/schema.ts

This file was deleted.

46 changes: 0 additions & 46 deletions src/graphql/types.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/routes/books.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NextFunction, Request, Response, Router } from "express";
import { NextFunction, Request, Response, Router } from 'express';
import * as _ from 'lodash';

import { BookFactory, PLACEHOLDER_IMG } from '../model/book-factory';
Expand Down
6 changes: 2 additions & 4 deletions src/routes/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NextFunction, Request, Response } from "express";
import { NextFunction, Request, Response } from 'express';

/**
* Constructor
Expand All @@ -8,10 +8,8 @@ import { NextFunction, Request, Response } from "express";
export class BaseRoute {

protected title: string;

private scripts: string[];


/**
* Constructor
*
Expand Down Expand Up @@ -50,7 +48,7 @@ export class BaseRoute {
*/
public render(req: Request, res: Response, view: string, options?: Object) {
//add constants
res.locals.BASE_URL = "/";
res.locals.BASE_URL = '/';

//add scripts
res.locals.scripts = this.scripts;
Expand Down
11 changes: 1 addition & 10 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@ import * as logger from 'morgan';
import * as path from 'path';
import * as swaggerUi from 'swagger-ui-express';
import errorHandler = require('errorhandler');
import methodOverride = require('method-override');
const fs = require('fs');

import { IndexRoute } from './routes/index';
import { BooksStore } from './books-store';
import { BooksRoute } from './routes/books';
import { NotificationsRoute } from './routes/notifications';
import { GraphQLRoute } from './graphql/routes';
import { fakeBearerMiddleware } from './fake-bearer-middleware';
import { NotificationService } from './notification-service';

var fs = require('fs');

/**
* The server.
Expand Down Expand Up @@ -85,9 +83,6 @@ export class Server {
extended: true
}));

//mount override?
this.app.use(methodOverride());

// catch 404 and forward to error handler
this.app.use(function (err: any, req: express.Request, res: express.Response, next: express.NextFunction) {
err.status = 404;
Expand Down Expand Up @@ -144,9 +139,6 @@ export class Server {
const booksRouter = express.Router();
BooksRoute.create(booksRouter, store, notificationService)

const graphQLRouter = express.Router();
GraphQLRoute.create(graphQLRouter, store);

const notificationsRouter = express.Router();
NotificationsRoute.create(notificationsRouter, notificationService)

Expand All @@ -159,7 +151,6 @@ export class Server {
this.app.use('/books', booksRouter);
this.app.use('/secure/book', fakeBearerMiddleware, booksRouter);
this.app.use('/secure/books', fakeBearerMiddleware, booksRouter);
this.app.use('/graphql', graphQLRouter);
this.app.use('/notifications', notificationsRouter);
this.app.use(router);
}
Expand Down
Loading

0 comments on commit 76dc083

Please sign in to comment.