Skip to content

Commit

Permalink
Upgrade dependencies (#2177)
Browse files Browse the repository at this point in the history
  • Loading branch information
scriptex authored Aug 26, 2022
1 parent 2d2609a commit e24de36
Show file tree
Hide file tree
Showing 12 changed files with 541 additions and 519 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
tsconfigRootDir: __dirname
},
plugins: ['jest', '@typescript-eslint'],
ignorePatterns: ['bin/*', '.eslintrc.js', 'test-config/*', 'workbox-config.js', 'webpack.config.js'],
ignorePatterns: ['bin/*', '*.js', '*.mjs'],
rules: {
'react/display-name': 'off',
'@typescript-eslint/no-explicit-any': 'off'
Expand Down
22 changes: 9 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-react-app-ts",
"version": "1.9.0",
"version": "1.10.0",
"description": "Scalable starter boilerplate for React applications",
"main": "./src/index.tsx",
"bin": {
Expand All @@ -12,14 +12,14 @@
"build": "yarn tsc:enums && webpack --mode production",
"tsc": "tsc --noEmit --skipLibCheck",
"tsc:enums": "rm -rf ./dist && tsc --project tsconfig-enums.json --skipLibCheck",
"lint": "npm run lint:ts && npm run lint:scss",
"lint": "yarn lint:ts && yarn lint:scss",
"lint:ts": "eslint 'src/**/*.{ts,tsx}'",
"lint:scss": "stylelint './src/**/*.scss' --config .stylelintrc",
"test": "jest",
"test:coverage": "jest --coverage",
"locale:scan": "i18next-scanner --config ./src/i18n/scanner-config.ts './src/**/*.{ts,tsx}'",
"locale:pot": "node ./src/i18n/gettext-converter.ts jsonToPot",
"locale:po": "node ./src/i18n/gettext-converter.ts poToJson",
"locale:scan": "i18next-scanner --config ./src/i18n/scanner-config.js './src/**/*.{ts,tsx}'",
"locale:pot": "node ./src/i18n/gettext-converter.mjs jsonToPot",
"locale:po": "node ./src/i18n/gettext-converter.mjs poToJson",
"locale": "yarn locale:scan && yarn locale:pot && yarn locale:po",
"run-dist": "yarn build && npx ecstatic ./dist --root=./dist --host=localhost --port=8080 --baseDir=/",
"postbuild": "workbox generateSW"
Expand Down Expand Up @@ -69,7 +69,7 @@
"react": "18.2.0",
"react-dom": "18.2.0",
"react-hook-form": "7.34.2",
"react-i18next": "11.18.4",
"react-i18next": "11.18.5",
"react-inlinesvg": "3.0.1",
"react-redux": "8.0.2",
"react-router": "5.3.3",
Expand All @@ -86,9 +86,9 @@
"@types/enzyme": "3.10.12",
"@types/jest": "28.1.8",
"@types/loadable__component": "5.13.4",
"@types/node": "18.7.1",
"@types/node": "18.7.13",
"@types/react": "18.0.17",
"@types/react-dom": "17.0.17",
"@types/react-dom": "18.0.6",
"@types/react-loadable": "5.5.6",
"@types/react-redux": "7.1.24",
"@types/react-router": "5.1.18",
Expand All @@ -112,7 +112,7 @@
"html-webpack-plugin": "5.5.0",
"i18next-conv": "13.1.0",
"i18next-scanner": "4.0.0",
"jest": "28.1.3",
"jest": "29.0.0",
"mini-css-extract-plugin": "2.6.1",
"postcss": "8.4.16",
"postcss-easy-import": "4.0.0",
Expand Down Expand Up @@ -196,9 +196,5 @@
"<rootDir>/dist/",
"<rootDir>/test-config/"
]
},
"resolutions": {
"@types/react": "18.0.17",
"@types/react-dom": "17.0.17"
}
}
6 changes: 3 additions & 3 deletions src/assets/locale/translations.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2021-11-12T14:49:19.706Z\n"
"PO-Revision-Date: 2021-11-12T14:49:19.706Z\n"
"POT-Creation-Date: 2022-08-26T09:41:59.560Z\n"
"PO-Revision-Date: 2022-08-26T09:41:59.560Z\n"

msgid "All rights reserved."
msgstr "All rights reserved."
Expand Down Expand Up @@ -99,4 +99,4 @@ msgid "Homepage"
msgstr "Homepage"

msgid "Page not found"
msgstr "Page not found"
msgstr "Page not found"
4 changes: 2 additions & 2 deletions src/components/login-form/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exports[`LoginForm component should render successfully 1`] = `
name="email"
placeholder="[email protected]"
register={
Object {
{
"name": "email",
"onBlur": [Function],
"onChange": [Function],
Expand All @@ -27,7 +27,7 @@ exports[`LoginForm component should render successfully 1`] = `
name="password"
placeholder="********"
register={
Object {
{
"name": "password",
"onBlur": [Function],
"onChange": [Function],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exports[`PasswordResetForm component should render successfully 1`] = `
name="email"
placeholder="[email protected]"
register={
Object {
{
"name": "email",
"onBlur": [Function],
"onChange": [Function],
Expand All @@ -27,7 +27,7 @@ exports[`PasswordResetForm component should render successfully 1`] = `
name="password"
placeholder="********"
register={
Object {
{
"name": "password",
"onBlur": [Function],
"onChange": [Function],
Expand All @@ -41,7 +41,7 @@ exports[`PasswordResetForm component should render successfully 1`] = `
name="confirm"
placeholder="********"
register={
Object {
{
"name": "confirm",
"onBlur": [Function],
"onChange": [Function],
Expand Down
18 changes: 9 additions & 9 deletions src/components/signup-form/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ exports[`SignupForm component should render successfully 1`] = `
name="email"
placeholder="[email protected]"
register={
Object {
{
"name": "email",
"onBlur": [Function],
"onChange": [Function],
Expand All @@ -33,7 +33,7 @@ exports[`SignupForm component should render successfully 1`] = `
name="password"
placeholder="********"
register={
Object {
{
"name": "password",
"onBlur": [Function],
"onChange": [Function],
Expand All @@ -47,7 +47,7 @@ exports[`SignupForm component should render successfully 1`] = `
name="confirm"
placeholder="********"
register={
Object {
{
"name": "confirm",
"onBlur": [Function],
"onChange": [Function],
Expand All @@ -61,7 +61,7 @@ exports[`SignupForm component should render successfully 1`] = `
name="username"
placeholder="JohnSmith"
register={
Object {
{
"name": "username",
"onBlur": [Function],
"onChange": [Function],
Expand All @@ -79,7 +79,7 @@ exports[`SignupForm component should render successfully 1`] = `
name="first_name"
placeholder="John"
register={
Object {
{
"name": "first_name",
"onBlur": [Function],
"onChange": [Function],
Expand All @@ -93,7 +93,7 @@ exports[`SignupForm component should render successfully 1`] = `
name="last_name"
placeholder="Smith"
register={
Object {
{
"name": "last_name",
"onBlur": [Function],
"onChange": [Function],
Expand All @@ -106,14 +106,14 @@ exports[`SignupForm component should render successfully 1`] = `
label="Gender"
name="gender"
options={
Array [
[
"Unspecified",
"Male",
"Female",
]
}
register={
Object {
{
"name": "gender",
"onBlur": [Function],
"onChange": [Function],
Expand All @@ -127,7 +127,7 @@ exports[`SignupForm component should render successfully 1`] = `
name="image_url"
placeholder="https://images.com/john-smith.jpg"
register={
Object {
{
"name": "image_url",
"onBlur": [Function],
"onChange": [Function],
Expand Down
10 changes: 4 additions & 6 deletions src/i18n/gettext-converter.ts → src/i18n/gettext-converter.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
/* eslint-disable @typescript-eslint/no-var-requires */
const { readFileSync, writeFileSync } = require('fs');
const { i18nextToPot, gettextToI18next } = require('i18next-conv');
import { readFileSync, writeFileSync } from 'fs';
import { i18nextToPot, gettextToI18next } from 'i18next-conv';

import locales from './locales.mjs';

const locales = require('./locales');
const basePath = './src/assets/locale/';

// @ts-ignore
const save = target => result => writeFileSync(target, result);

const jsonToPot = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as de from '../assets/locale/de.json';

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import * as locales from './locales';
import * as locales from './locales.mjs';

const resources = {
en: {
Expand Down
1 change: 0 additions & 1 deletion src/i18n/locales.js

This file was deleted.

1 change: 1 addition & 0 deletions src/i18n/locales.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default ['de'];
5 changes: 1 addition & 4 deletions src/i18n/scanner-config.ts → src/i18n/scanner-config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
module.exports = {
options: {
debug: false,
Expand All @@ -11,10 +10,8 @@ module.exports = {
i18nKey: 'i18nKey',
defaultsKey: 'defaults',
extensions: ['.js', '.jsx'],
// @ts-ignore
fallbackKey: (ns, value) => value
fallbackKey: (_, value) => value
},
// @ts-ignore
defaultValue: (lng, ns, key) => key,
resource: {
loadPath: 'src/assets/locale/translations.json',
Expand Down
Loading

0 comments on commit e24de36

Please sign in to comment.