Skip to content

Commit

Permalink
fix: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
spaenleh committed Feb 21, 2024
1 parent e3e044a commit fcee917
Show file tree
Hide file tree
Showing 6 changed files with 2,662 additions and 756 deletions.
42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@
"dependencies": {
"@emotion/react": "11.11.3",
"@emotion/styled": "11.11.0",
"@graasp/apps-query-client": "3.4.1",
"@graasp/sdk": "3.6.0",
"@graasp/ui": "4.5.1",
"@mui/icons-material": "5.15.7",
"@graasp/apps-query-client": "3.4.4",
"@graasp/sdk": "3.10.0",
"@graasp/ui": "4.8.1",
"@mui/icons-material": "5.15.10",
"@mui/lab": "5.0.0-alpha.160",
"@mui/material": "5.15.7",
"@sentry/react": "7.99.0",
"@mui/material": "5.15.10",
"@sentry/react": "7.102.0",
"@tanstack/react-query": "^4.36.1",
"@tanstack/react-query-devtools": "^4.36.1",
"@types/node": "20.11.15",
"@types/react": "18.2.51",
"@types/react-dom": "18.2.18",
"i18next": "23.7.11",
"@types/node": "20.11.19",
"@types/react": "18.2.57",
"@types/react-dom": "18.2.19",
"i18next": "^23.9.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-i18next": "13.5.0",
"react-i18next": "14.0.5",
"react-toastify": "10.0.4",
"typescript": "5.3.3"
},
Expand All @@ -53,18 +53,18 @@
"cov:report": "open ./coverage/lcov-report/index.html"
},
"devDependencies": {
"@commitlint/cli": "18.6.0",
"@commitlint/config-conventional": "18.6.0",
"@cypress/code-coverage": "3.12.19",
"@commitlint/cli": "18.6.1",
"@commitlint/config-conventional": "18.6.2",
"@cypress/code-coverage": "3.12.24",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/i18n": "0.13.10",
"@types/uuid": "9.0.8",
"@typescript-eslint/eslint-plugin": "6.20.0",
"@typescript-eslint/parser": "6.20.0",
"@typescript-eslint/eslint-plugin": "7.0.2",
"@typescript-eslint/parser": "7.0.2",
"@vitejs/plugin-react": "^4.2.1",
"axios": "1.6.7",
"concurrently": "8.2.2",
"cypress": "13.6.4",
"cypress": "13.6.5",
"env-cmd": "10.1.0",
"eslint": "8.56.0",
"eslint-config-airbnb": "19.0.4",
Expand All @@ -78,13 +78,13 @@
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "4.6.0",
"husky": "9.0.9",
"husky": "9.0.11",
"miragejs": "^0.1.48",
"nock": "^13.5.1",
"nock": "^13.5.3",
"nyc": "15.1.0",
"prettier": "3.2.4",
"prettier": "3.2.5",
"uuid": "9.0.1",
"vite": "^5.0.12",
"vite": "^5.1.3",
"vite-plugin-checker": "^0.6.4",
"vite-plugin-istanbul": "^5.0.0"
},
Expand Down
4 changes: 3 additions & 1 deletion renovate.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>graasp/renovate-config"]
"extends": [
"github>graasp/renovate-config:app"
]
}
4 changes: 3 additions & 1 deletion src/config/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import i18n from 'i18next';
import en from '../langs/en.json';
import fr from '../langs/fr.json';

export const DEFAULT_LANGUAGE = 'en';
export const defaultNS = 'translations';
export const resources = {
en,
Expand All @@ -20,7 +21,8 @@ declare module 'react-i18next' {

i18n.use(initReactI18next).init({
resources,
lng: 'en',
lng: DEFAULT_LANGUAGE,
fallbackLng: DEFAULT_LANGUAGE,
// debug only when not in production
debug: import.meta.env.DEV,
ns: [defaultNS],
Expand Down
47 changes: 18 additions & 29 deletions src/mocks/db.ts
Original file line number Diff line number Diff line change
@@ -1,53 +1,42 @@
import type { Database, LocalContext } from '@graasp/apps-query-client';
import {
AppItemFactory,
CompleteMember,
DiscriminatedItem,
ItemType,
MemberFactory,
PermissionLevel,
} from '@graasp/sdk';

import { API_HOST } from '@/config/env';

export const defaultMockContext: LocalContext = {
apiHost: API_HOST,
permission: PermissionLevel.Admin,
context: 'builder',
itemId: '1234-1234-123456-8123-123456',
memberId: 'mock-member-id',
};

export const mockMembers: CompleteMember[] = [
{
id: defaultMockContext.memberId || '',
MemberFactory({
id: 'd3b90b7d-2bb4-4329-89b3-099bae00d582',
name: 'current-member',
email: '',
extra: {},
type: 'individual',
createdAt: new Date('1996-09-08T19:00:00').toISOString(),
updatedAt: new Date().toISOString(),
},
{
id: 'mock-member-id-2',
}),
MemberFactory({
id: 'bab43e0a-3267-4b34-86f1-0ef0c1234d7f',
name: 'mock-member-2',
email: '',
extra: {},
type: 'individual',
createdAt: new Date('1995-02-02T15:00:00').toISOString(),
createdAt: new Date('1996-09-08T19:00:00').toISOString(),
updatedAt: new Date().toISOString(),
},
}),
];

export const mockItem: DiscriminatedItem = {
id: defaultMockContext.itemId,
export const mockItem: DiscriminatedItem = AppItemFactory({
name: 'app-starter-ts-vite',
description: null,
path: '',
settings: {},
type: ItemType.APP,
extra: { [ItemType.APP]: { url: 'http://localhost:3002' } },
creator: mockMembers[0],
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
});

export const defaultMockContext: LocalContext = {
apiHost: API_HOST,
permission: PermissionLevel.Admin,
context: 'builder',
itemId: mockItem.id,
memberId: mockMembers[0].id,
};

const buildDatabase = (members?: CompleteMember[]): Database => ({
Expand Down
6 changes: 3 additions & 3 deletions src/modules/main/App.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useEffect } from 'react';

import { useLocalContext } from '@graasp/apps-query-client';
import { Context, DEFAULT_LANG } from '@graasp/sdk';
import { Context } from '@graasp/sdk';

import i18n from '../../config/i18n';
import i18n, { DEFAULT_LANGUAGE } from '../../config/i18n';
import { SettingsProvider } from '../context/SettingsContext';
import AnalyticsView from './AnalyticsView';
import BuilderView from './BuilderView';
Expand All @@ -14,7 +14,7 @@ const App = (): JSX.Element => {

useEffect(() => {
// handle a change of language
const lang = context?.lang ?? DEFAULT_LANG;
const lang = context?.lang ?? DEFAULT_LANGUAGE;
if (i18n.language !== lang) {
i18n.changeLanguage(lang);
}
Expand Down
Loading

0 comments on commit fcee917

Please sign in to comment.