Skip to content

Commit 16caae0

Browse files
committed
fixup! feat: upgrading react-ssr-with-vite project dependencies
1 parent 3095757 commit 16caae0

File tree

8 files changed

+67
-26
lines changed

8 files changed

+67
-26
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
labels:
8+
- "RFR"
9+
- "dependencies"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Tests and Checks
2+
on:
3+
pull_request:
4+
paths:
5+
- 'templates/react-ssr-with-vite/**'
6+
jobs:
7+
checks:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout Repo
11+
uses: actions/checkout@v3
12+
- name: Setup Node
13+
uses: actions/setup-node@v3
14+
with:
15+
node-version: 18
16+
- name: Get yarn cache directory path
17+
id: yarn-cache-dir-path
18+
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
19+
- uses: actions/cache@v3
20+
id: yarn-cache
21+
with:
22+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
23+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
24+
restore-keys: |
25+
${{ runner.os }}-yarn-
26+
- name: Install modules
27+
run: yarn --frozen-lockfile
28+
- name: Run ESLint
29+
run: yarn lint:es
30+
- name: Run Compile TypeScript
31+
run: yarn tsc
32+
- name: Run Test
33+
run: yarn test
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v16
1+
v18

templates/react-ssr-with-vite/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"engines": {
1919
"npm": "please-use-yarn-instead",
2020
"yarn": ">= 1.2.0",
21-
"node": ">= 16.0"
21+
"node": ">= 18.0"
2222
},
2323
"prettier": "@eleven-labs/prettier-config",
2424
"dependencies": {
@@ -41,7 +41,7 @@
4141
"@eleven-labs/prettier-config": "^1.0.0",
4242
"@types/express": "^4.17.19",
4343
"@types/i18next": "^13.0.0",
44-
"@types/node": "^20.8.4",
44+
"@types/node": "^18.18.4",
4545
"@types/react": "^18.2.28",
4646
"@types/react-dom": "^18.2.13",
4747
"@types/react-i18next": "^8.1.0",
@@ -54,7 +54,7 @@
5454
"prettier": "3.0.3",
5555
"sass": "^1.69.3",
5656
"ts-node": "^10.9.1",
57-
"typescript": "^5.2.2",
57+
"typescript": "^4.9.5",
5858
"vite": "^4.4.11",
5959
"vite-tsconfig-paths": "^4.2.1"
6060
}

templates/react-ssr-with-vite/src/constants.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import { getEnv } from '@/helpers/getEnvHelper';
22

3-
export const AUTHORIZED_LANGUAGES: string[] = ['fr', 'en'];
4-
export const DEFAULT_LANGUAGE: string = 'fr';
3+
export const LanguageEnum = {
4+
EN: 'en',
5+
FR: 'fr',
6+
};
7+
export const AUTHORIZED_LANGUAGES: string[] = Object.values(LanguageEnum);
8+
export const DEFAULT_LANGUAGE: string = LanguageEnum.FR;
59

610
export const PATHS = {
711
HOME: '/:lang/',

templates/react-ssr-with-vite/src/containers/LayoutTemplateContainer/LayoutTemplateContainer.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as React from 'react';
33
import { useTranslation } from 'react-i18next';
44
import { Link, generatePath } from 'react-router-dom';
55

6-
import { PATHS } from '@/constants';
6+
import { LanguageEnum, PATHS } from '@/constants';
77
import { getValidLanguage } from '@/helpers/langHelper';
88
import { useCurrentPath } from '@/hooks/useCurrentPath';
99

@@ -14,7 +14,7 @@ export interface LayoutTemplateContainerProps {
1414
export const LayoutTemplateContainer: React.FC<LayoutTemplateContainerProps> = ({ children }) => {
1515
const { i18n, t } = useTranslation();
1616
const currentPath = useCurrentPath();
17-
const languageForChange = i18n.language === 'fr' ? 'en' : 'fr';
17+
const languageForChange = i18n.language === LanguageEnum.FR ? LanguageEnum.EN : LanguageEnum.FR;
1818

1919
return (
2020
<Flex alignItems="center" flexDirection="column" gap="m" height="full" justifyContent="center">
@@ -38,8 +38,10 @@ export const LayoutTemplateContainer: React.FC<LayoutTemplateContainerProps> = (
3838
</Button>
3939
</Flex>
4040
<Button
41+
to={generatePath(!currentPath || currentPath === PATHS.ROOT ? PATHS.HOME : currentPath, {
42+
lang: languageForChange,
43+
})}
4144
as={Link}
42-
to={generatePath(currentPath === PATHS.ROOT ? PATHS.HOME : currentPath, { lang: languageForChange })}
4345
variant="secondary"
4446
>
4547
{t('layout.change-lang', { lang: languageForChange })}

templates/react-ssr-with-vite/src/pages/PokemonListPage/PokemonListPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ export interface PokemonListPageProps {
66
title: string;
77
}
88

9-
export const PokemonListPage: React.FC<PokemonListPageProps> = ({ pokemons }) => (
9+
export const PokemonListPage: React.FC<PokemonListPageProps> = ({ pokemons, title }) => (
1010
<>
11-
<Heading>{<title />}</Heading>
11+
<Heading>{title}</Heading>
1212
<Flex alignItems="center" gap="xs" justifyContent="center">
1313
{pokemons.map((pokemon, index) => (
1414
<Box key={index} textAlign="center">

templates/react-ssr-with-vite/yarn.lock

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -485,12 +485,10 @@
485485
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.9.tgz#02d013de7058cea16d36168ef2fc653464cfbad4"
486486
integrity sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==
487487

488-
"@types/node@^20.8.4":
489-
version "20.8.4"
490-
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.8.4.tgz#0e9ebb2ff29d5c3302fc84477d066fa7c6b441aa"
491-
integrity sha512-ZVPnqU58giiCjSxjVUESDtdPk4QR5WQhhINbc9UBrKLU68MX5BF6kbQzTrkwbolyr0X8ChBpXfavr5mZFKZQ5A==
492-
dependencies:
493-
undici-types "~5.25.1"
488+
"@types/node@^18.18.4":
489+
version "18.18.4"
490+
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.18.4.tgz#519fef47a13cf869be290c20fc6ae9b7fe887aa7"
491+
integrity sha512-t3rNFBgJRugIhackit2mVcLfF6IRc0JE4oeizPQL8Zrm8n2WY/0wOdpOPhdtG0V9Q2TlW/axbF1MJ6z+Yj/kKQ==
494492

495493
"@types/normalize-package-data@^2.4.0":
496494
version "2.4.2"
@@ -3909,10 +3907,10 @@ typed-array-length@^1.0.4:
39093907
for-each "^0.3.3"
39103908
is-typed-array "^1.1.9"
39113909

3912-
typescript@^5.2.2:
3913-
version "5.2.2"
3914-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78"
3915-
integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==
3910+
typescript@^4.9.5:
3911+
version "4.9.5"
3912+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
3913+
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
39163914

39173915
unbox-primitive@^1.0.2:
39183916
version "1.0.2"
@@ -3924,11 +3922,6 @@ unbox-primitive@^1.0.2:
39243922
has-symbols "^1.0.3"
39253923
which-boxed-primitive "^1.0.2"
39263924

3927-
undici-types@~5.25.1:
3928-
version "5.25.3"
3929-
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.25.3.tgz#e044115914c85f0bcbb229f346ab739f064998c3"
3930-
integrity sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==
3931-
39323925
[email protected], unpipe@~1.0.0:
39333926
version "1.0.0"
39343927
resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"

0 commit comments

Comments
 (0)