Skip to content

Commit

Permalink
fixup! feat: upgrading react-ssr-with-vite project dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
fpasquet committed Oct 12, 2023
1 parent 3095757 commit 97154c4
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 14 deletions.
9 changes: 9 additions & 0 deletions templates/react-ssr-with-vite/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
labels:
- "RFR"
- "dependencies"
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Tests and Checks
on:
pull_request:
paths:
- 'templates/react-ssr-with-vite/**'
jobs:
checks:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install modules
run: yarn --frozen-lockfile
- name: Run ESLint
run: yarn lint:es
- name: Run Compile TypeScript
run: yarn tsc
- name: Run Test
run: yarn test
2 changes: 1 addition & 1 deletion templates/react-ssr-with-vite/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16
v18
4 changes: 2 additions & 2 deletions templates/react-ssr-with-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"engines": {
"npm": "please-use-yarn-instead",
"yarn": ">= 1.2.0",
"node": ">= 16.0"
"node": ">= 18.0"
},
"prettier": "@eleven-labs/prettier-config",
"dependencies": {
Expand Down Expand Up @@ -54,7 +54,7 @@
"prettier": "3.0.3",
"sass": "^1.69.3",
"ts-node": "^10.9.1",
"typescript": "^5.2.2",
"typescript": "^4.9.5",
"vite": "^4.4.11",
"vite-tsconfig-paths": "^4.2.1"
}
Expand Down
8 changes: 6 additions & 2 deletions templates/react-ssr-with-vite/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { getEnv } from '@/helpers/getEnvHelper';

export const AUTHORIZED_LANGUAGES: string[] = ['fr', 'en'];
export const DEFAULT_LANGUAGE: string = 'fr';
export const LanguageEnum = {
EN: 'en',
FR: 'fr',
};
export const AUTHORIZED_LANGUAGES: string[] = Object.values(LanguageEnum);
export const DEFAULT_LANGUAGE: string = LanguageEnum.FR;

export const PATHS = {
HOME: '/:lang/',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as React from 'react';
import { useTranslation } from 'react-i18next';
import { Link, generatePath } from 'react-router-dom';

import { PATHS } from '@/constants';
import { LanguageEnum, PATHS } from '@/constants';
import { getValidLanguage } from '@/helpers/langHelper';
import { useCurrentPath } from '@/hooks/useCurrentPath';

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

return (
<Flex alignItems="center" flexDirection="column" gap="m" height="full" justifyContent="center">
Expand All @@ -38,8 +38,10 @@ export const LayoutTemplateContainer: React.FC<LayoutTemplateContainerProps> = (
</Button>
</Flex>
<Button
to={generatePath(!currentPath || currentPath === PATHS.ROOT ? PATHS.HOME : currentPath, {
lang: languageForChange,
})}
as={Link}
to={generatePath(currentPath === PATHS.ROOT ? PATHS.HOME : currentPath, { lang: languageForChange })}
variant="secondary"
>
{t('layout.change-lang', { lang: languageForChange })}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ export interface PokemonListPageProps {
title: string;
}

export const PokemonListPage: React.FC<PokemonListPageProps> = ({ pokemons }) => (
export const PokemonListPage: React.FC<PokemonListPageProps> = ({ pokemons, title }) => (
<>
<Heading>{<title />}</Heading>
<Heading>{title}</Heading>
<Flex alignItems="center" gap="xs" justifyContent="center">
{pokemons.map((pokemon, index) => (
<Box key={index} textAlign="center">
Expand Down
8 changes: 4 additions & 4 deletions templates/react-ssr-with-vite/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3909,10 +3909,10 @@ typed-array-length@^1.0.4:
for-each "^0.3.3"
is-typed-array "^1.1.9"

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

unbox-primitive@^1.0.2:
version "1.0.2"
Expand Down

0 comments on commit 97154c4

Please sign in to comment.