Skip to content

Commit

Permalink
Merge branch 'dev' into sakari/feature/clan-overview
Browse files Browse the repository at this point in the history
  • Loading branch information
Skoivumaki authored Sep 18, 2024
2 parents 7562adf + 8c86842 commit 6307896
Show file tree
Hide file tree
Showing 198 changed files with 3,382 additions and 1,219 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CI

on:
push:
branches:
- '*'
pull_request:
branches:
- '*'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 'v20.12.2'

- name: Install dependencies
run: npm install
working-directory: ./frontend-next-migration

# - name: Lint
# run: npm run lint
# working-directory: pages/frontend

- name: Build
run: npm run build
working-directory: ./frontend-next-migration
env:
NEXT_PUBLIC_API_LINK: ${{ secrets.NEXT_PUBLIC_API_LINK }}
NEXT_PUBLIC_API_DOMAIN: ${{ secrets.NEXT_PUBLIC_API_DOMAIN }}
NEXT_PUBLIC_LOCAL_HOST: ${{ secrets.NEXT_PUBLIC_LOCAL_HOST }}

- name: Run tests
run: npm test
working-directory: ./frontend-next-migration
env:
NEXT_PUBLIC_API_LINK: ${{ secrets.NEXT_PUBLIC_API_LINK }}
NEXT_PUBLIC_API_DOMAIN: ${{ secrets.NEXT_PUBLIC_API_DOMAIN }}
NEXT_PUBLIC_LOCAL_HOST: ${{ secrets.NEXT_PUBLIC_LOCAL_HOST }}

# - name: Run Cypress tests
# run: npm run cypress:run
# env:
# CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# working-directory: ./frontend-next-migration
#
# - name: Build Storybook
# run: npm run build-storybook
# working-directory: ./frontend-next-migration
8 changes: 5 additions & 3 deletions frontend-next-migration/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,16 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

USER nextjs

EXPOSE 3001
EXPOSE 3000
#EXPOSE 3000

ENV PORT 3001
ENV PORT 3000
#ENV PORT 3000
# set hostname to localhost
ENV HOSTNAME "0.0.0.0"

# server.js is created by next build from the standalone output
# https://nextjs.org/docs/pages/api-reference/next-config-js/output
CMD ["node", "server.js"]
CMD ["node", "server.js"]

#"todo delete"
2 changes: 1 addition & 1 deletion frontend-next-migration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pnpm dev
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

Expand Down
5 changes: 5 additions & 0 deletions frontend-next-migration/__mocks__/svgMock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React from 'react';

const MockSvg = (props) => <div {...props} />;

export default MockSvg;
1 change: 1 addition & 0 deletions frontend-next-migration/altzone-cli/sortImports.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import { Project } from 'ts-morph';
1 change: 1 addition & 0 deletions frontend-next-migration/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ const config: Config = {

// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
moduleNameMapper: {
'^.+\\.(svg)$': '<rootDir>/__mocks__/svgMock.js',
'^@/(.*)$': '<rootDir>/src/$1',
},

Expand Down
74 changes: 74 additions & 0 deletions frontend-next-migration/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion frontend-next-migration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"name": "frontend-next-migration",
"version": "0.1.0",
"private": true,
"bin": {
"altzone": "./changemewhenready.ts"
},
"scripts": {
"dev": "next dev -p 5173",
"build": "next build",
Expand All @@ -12,7 +15,9 @@
"cypress:open": "cypress open",
"cypress:run": "cypress run",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
"build-storybook": "storybook build",

"cli": ""
},
"dependencies": {
"@fancyapps/ui": "^5.0.25",
Expand Down Expand Up @@ -81,6 +86,7 @@
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"storybook": "^7.6.17",
"ts-morph": "^23.0.0",
"ts-node": "^10.9.2",
"typescript": "^5"
}
Expand Down
Binary file not shown.
4 changes: 4 additions & 0 deletions frontend-next-migration/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
User-agent: *
Disallow:

Sitemap: https://altzone.fi/sitemap.xml
127 changes: 56 additions & 71 deletions frontend-next-migration/src/app/[lng]/(home)/_getPage.ts
Original file line number Diff line number Diff line change
@@ -1,75 +1,60 @@
import {MainPageProps} from "@/preparedPages/MainPage";
import {useServerTranslation} from "@/shared/i18n";
import {AppExternalLinks} from "@/shared/appLinks/appExternalLinks";
import {RoutePaths} from "@/shared/appLinks/RoutePaths";

export async function _getPage (lng: string){
const {t} = await useServerTranslation(lng, 'main');


const seo = {
title: t("head-title"),
description: t("head-description"),
keywords: t("head-keywords"),
}

const playWithUs = {
title: t("playWithUs-title"),
webGl: {
title: t('PlayOnline'),
link: AppExternalLinks.webgl
},
googlePLayLink: AppExternalLinks.downloadAndroid,
belowNavs: [{
title: t("playWithUs-OpenPositions-title"),
body: t("playWithUs-OpenPositions-body"),
link: AppExternalLinks.duunitori,
isExternal: true
},
{
title: t("playWithUs-BecomeATester-title"),
body: t("playWithUs-BecomeATester-body"),
link: AppExternalLinks.discord,
isExternal: true
}]
}


const projectDescription = {
title: t('project-description-title'),
description: t('project-description-text')
}

const getToKnowComics = {
title: t("getToKnowComics-title"),
buttonParams: { innerText: t("getToKnowComics"), href: RoutePaths.COMICS_GALLERY }
}

const videoAndGalleries = {
videoLink: AppExternalLinks.previewVideoYoutube,
title: t("videoAndGalleries-title")
}


const classifiedHeroesBlocks = {
title: t("classifiedHeroesBlocks-title"),
seeMoreLink: {
text: t("classifiedHeroesBlocks-seeMore"),
href: RoutePaths.HEROES
}
}

const page = {
playWithUs,
projectDescription,
getToKnowComics,
videoAndGalleries,
classifiedHeroesBlocks
}


return {
page,
seo
}

import {createPage} from "@/app/_helpers";

export async function _getPage(lng: string) {
const { t } = await useServerTranslation(lng, "main");

return createPage<MainPageProps>({
buildSeo: () => ({
title: t("head-title"),
description: t("head-description"),
keywords: t("head-keywords"),
}),
buildPage: () => ({
playWithUs: {
title: t("playWithUs-title"),
webGl: {
title: t("PlayOnline"),
link: AppExternalLinks.webgl,
},
googlePLayLink: AppExternalLinks.downloadAndroid,
belowNavs: [
{
title: t("playWithUs-OpenPositions-title"),
body: t("playWithUs-OpenPositions-body"),
link: AppExternalLinks.duunitori,
isExternal: true,
},
{
title: t("playWithUs-BecomeATester-title"),
body: t("playWithUs-BecomeATester-body"),
link: AppExternalLinks.discord,
isExternal: true,
},
],
},
projectDescription: {
title: t("project-description-title"),
description: t("project-description-text"),
},
getToKnowComics: {
title: t("getToKnowComics-title"),
buttonParams: { innerText: t("getToKnowComics"), href: RoutePaths.COMICS_GALLERY },
},
videoAndGalleries: {
videoLink: AppExternalLinks.previewVideoYoutube,
title: t("videoAndGalleries-title"),
},
classifiedHeroesBlocks: {
title: t("classifiedHeroesBlocks-title"),
seeMoreLink: {
text: t("classifiedHeroesBlocks-seeMore"),
href: RoutePaths.HEROES,
},
},
}),
});
}
Loading

0 comments on commit 6307896

Please sign in to comment.