Skip to content

Commit

Permalink
Switch to NextJS app router
Browse files Browse the repository at this point in the history
  • Loading branch information
nadundesilva committed Sep 5, 2023
1 parent 2cb950e commit b2b06ab
Show file tree
Hide file tree
Showing 47 changed files with 2,382 additions and 2,222 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/deploy-site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18.12.1"
node-version: "18.17.1"
- name: Install Dependencies
run: npm ci
- name: Build NextJS types
run: npm run build
- name: Lint Code Base
uses: github/super-linter@v4
uses: github/super-linter@v5
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -47,7 +47,7 @@ jobs:
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
Expand All @@ -64,7 +64,7 @@ jobs:
security-events: write
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
Expand All @@ -84,11 +84,11 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18.12.1"
node-version: "18.17.1"
- name: Install Dependencies
run: npm ci
- name: Running Unit Tests
Expand All @@ -113,10 +113,10 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: "18.12.1"
node-version: "18.17.1"
- name: Install Dependencies
run: npm ci
- name: Build Site
Expand All @@ -142,11 +142,11 @@ jobs:
needs: build-site
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18.12.1"
node-version: "18.17.1"
- name: Install Dependencies
run: npm ci
- name: Download Site
Expand All @@ -161,7 +161,7 @@ jobs:
WEBSITE_BUILD_DIR: _site
- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v1.5.4
uses: lycheeverse/lychee-action@v1.8.0
with:
args: --verbose --no-progress https://cadmus-labs.github.io/
fail: true
Expand All @@ -183,7 +183,7 @@ jobs:
# needs: build-site
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# uses: actions/checkout@v4
# - name: Download Site
# uses: actions/download-artifact@v3
# with:
Expand All @@ -192,7 +192,7 @@ jobs:
# - name: Setup Node.js
# uses: actions/setup-node@v3
# with:
# node-version: "18.12.1"
# node-version: "18.17.1"
# - name: Run Lighthouse Audit
# run: |
# npm install -g @lhci/cli@0.10.x
Expand Down Expand Up @@ -224,7 +224,7 @@ jobs:
# - run-website-audit
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Download Site
uses: actions/download-artifact@v3
with:
Expand All @@ -233,7 +233,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18.12.1"
node-version: "18.17.1"
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deployment-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v1.5.4
uses: lycheeverse/lychee-action@v1.8.0
with:
args: --verbose --no-progress https://cadmus-labs.github.io/
fail: true
Expand All @@ -36,7 +36,7 @@ jobs:
# runs-on: ubuntu-20.04
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# uses: actions/checkout@v4
# - name: Setup Node.js
# uses: actions/setup-node@v3
# with:
Expand All @@ -62,7 +62,7 @@ jobs:
security-events: write
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/website-oracle-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Check Certificate
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Check Website Certificate
uses: cadmus-labs/check-website-certificate-action@main
with:
Expand All @@ -23,7 +23,7 @@ jobs:
name: Check Dependencies
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Check Dependencies
uses: cadmus-labs/check-website-dependencies-action@main
with:
Expand Down
2 changes: 1 addition & 1 deletion .lycheeignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
^https?://www.googletagmanager.com/$
^https?://www\.googletagmanager\.com/$
20 changes: 4 additions & 16 deletions constants/routes.tsx → app/[...not_found]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,9 @@
*
* © 2023 Cadmus Labs. All rights reserved.
*/
import { redirect } from "next/navigation";
import type React from "react";

export interface Route {
name: string;
subRoutes?: Record<string, Route>;
}
const NotFound = (): React.ReactElement => redirect("/");

export const ANY_ROUTE = "*";

export const Routes: Record<string, Route> = {
"/solutions": {
name: "Solutions",
subRoutes: {
"/website-oracle": {
name: "Website Oracle",
},
},
},
};
export default NotFound;
41 changes: 41 additions & 0 deletions app/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
"use client";
/*
* Cadmus Labs - All Rights Reserved
*
* This source code and its associated files are the
* confidential and proprietary information of Cadmus Labs.
* Unauthorized reproduction, distribution, or disclosure
* in any form, in whole or in part, is strictly prohibited
* except as explicitly provided under a separate license
* agreement with Cadmus Labs.
*
* Website: https://cadmus-labs.github.io
*
* © 2023 Cadmus Labs. All rights reserved.
*/
import { Button, Typography, type Theme, Container, Box } from "@mui/material";

interface ErrorProps {
reset: () => void;
}

const Error = ({ reset }: ErrorProps): React.ReactElement => (
<Container
sx={{
height: (theme: Theme) =>
`calc(100vh - ${theme.spacing(15)} - ${
theme.typography.fontSize
}px - ${theme.mixins.toolbar.minHeight ?? 0}px)`,
display: "flex",
justifyContent: "center",
alignItems: "center",
}}
>
<Box sx={{ textAlign: "center" }}>
<Typography sx={{ my: 2 }}>Something went wrong</Typography>
<Button onClick={reset}>Try Again</Button>
</Box>
</Container>
);

export default Error;
File renamed without changes.
Loading

0 comments on commit b2b06ab

Please sign in to comment.