Skip to content

Commit

Permalink
build: upgrade to node 20.x (#114)
Browse files Browse the repository at this point in the history
* build: upgrade to node 20.x

* ci: update gh action
  • Loading branch information
gupta-ji6 authored Mar 14, 2024
1 parent 42ca395 commit 9d69f2f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 19 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,26 @@ on:
pull_request:
branches: ['**']

env:
NODE_VERSION: 20.x

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/checkout@v4
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install modules
run: yarn
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Check Build Status
env:
CMS_API: ${{ secrets.CMS_API }}
SITE_URL: ${{ secrets.SITE_URL }}
NEXT_PUBLIC_FACEBOOK_APP_ID: ${{ secrets.NEXT_PUBLIC_FACEBOOK_APP_ID }}
run: npm run build --if-present
run: yarn run build
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.x
v20.x
2 changes: 1 addition & 1 deletion lib/cms-config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const config = provider => ({
export const config = (provider: string) => ({
client: {
id: client[provider].id,
secret: client[provider].secret,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"license": "(MIT OR Apache-2.0)",
"engines": {
"node": "16.x"
"node": "20.x"
},
"scripts": {
"dev": "next dev",
Expand Down Expand Up @@ -54,4 +54,4 @@
"prettier": "2.1.1",
"typescript": "4.3.5"
}
}
}
4 changes: 2 additions & 2 deletions pages/api/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { randomBytes } from 'crypto';
import { config, scopes } from '../../lib/cms-config';
import { NextApiRequest, NextApiResponse } from 'next';

export const randomString = () => randomBytes(4).toString('hex');
export const randomString = (): string => randomBytes(4).toString('hex');

const auth = async (req: NextApiRequest, res: NextApiResponse) => {
const auth = async (req: NextApiRequest, res: NextApiResponse): Promise<void> => {
const { host } = req.headers;
const url = new URL(`https://${host}/${req.url}`);
const urlParams = url.searchParams;
Expand Down
2 changes: 1 addition & 1 deletion pages/api/callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AuthorizationCode } from 'simple-oauth2';
import { config } from '../../lib/cms-config';
import { NextApiRequest, NextApiResponse } from 'next';

const callback = async (req: NextApiRequest, res: NextApiResponse) => {
const callback = async (req: NextApiRequest, res: NextApiResponse): Promise<void> => {
const { host } = req.headers;
const url = new URL(`https://${host}/${req.url}`);
const urlParams = url.searchParams;
Expand Down

0 comments on commit 9d69f2f

Please sign in to comment.