Skip to content

Commit 7c57510

Browse files
committed
Initial commit
1 parent 2ab7f1a commit 7c57510

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+3538
-410
lines changed

.eslintrc

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
{
2-
"extends": ["next", "prettier"],
2+
"extends": [
3+
"next",
4+
"eslint:recommended",
5+
"plugin:@typescript-eslint/recommended",
6+
"plugin:react-hooks/recommended",
7+
"plugin:@typescript-eslint/recommended-requiring-type-checking"
8+
],
9+
"parser": "@typescript-eslint/parser",
10+
"plugins": ["@typescript-eslint", "react-hooks"],
11+
"root": true,
12+
"parserOptions": {
13+
"project": ["tsconfig.json"]
14+
},
315
"rules": {
4-
"import/prefer-default-export": "off",
5-
"no-console": "warn",
6-
"no-var": "error"
16+
"react-hooks/exhaustive-deps": "warn"
717
}
818
}

.eslintrc.cjs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2021: true
5+
},
6+
extends: [
7+
'plugin:react/recommended',
8+
'standard-with-typescript',
9+
'plugin:react-hooks/recommended'
10+
],
11+
overrides: [],
12+
parserOptions: {
13+
ecmaVersion: 'latest',
14+
sourceType: 'module',
15+
project: ['tsconfig.json']
16+
},
17+
plugins: ['react', 'react-hooks'],
18+
rules: {
19+
'react-hooks/exhaustive-deps': 'warn',
20+
semi: 'error'
21+
}
22+
}

.eslintrc.json

-3
This file was deleted.

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.prettierrc

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"printWidth": 80,
3+
"tabWidth": 2,
4+
"singleQuote": false,
5+
"semi": true,
6+
"importOrder": [
7+
"^react",
8+
"^[-a-zA-Z0-9_]+[.]+module[.](css|scss|less)$",
9+
"^[-a-zA-Z0-9_]+[.]+(css|scss|less)$",
10+
"<THIRD_PARTY_MODULES>",
11+
"^src/components"
12+
],
13+
"importOrderSeparation": true,
14+
"importOrderSortSpecifiers": true,
15+
"importOrderGroupNamespaceSpecifiers": true
16+
}

.vscode/settings.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"[typescriptreact]": {
3+
"editor.defaultFormatter": "vscode.typescript-language-features"
4+
},
5+
"editor.codeActionsOnSave": {
6+
"source.fixAll.eslint": true
7+
},
8+
"editor.formatOnSave": true,
9+
"files.associations": {
10+
"*.tsx": "typescriptreact"
11+
},
12+
"eslint.debug": true,
13+
"eslint.format.enable": true,
14+
"eslint.enable": true,
15+
"typescript.validate.enable": true,
16+
"files.eol": "\n",
17+
"editor.formatOnPaste": true,
18+
"eslint.lintTask.options": "-c C:/Users/artur/Documents/GitHub/pray-the-rosary/.eslintrc.cjs",
19+
"eslint.options": { "overrideConfigFile": "C:/Users/artur/Documents/GitHub/pray-the-rosary/.eslintrc.cjs" },
20+
"eslint.validate": ["typescriptreact", "typescript", "javascript", "javascriptreact"],
21+
"typescript.format.enable": true,
22+
}

i18n.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"locales": [
3+
"pt-BR",
4+
"en-US",
5+
"es"
6+
],
7+
"localeDetection": true,
8+
"trailingSlash": true,
9+
"defaultLocale": "pt-BR",
10+
"pages": {
11+
"/": [
12+
"index"
13+
],
14+
"*": [
15+
"countries",
16+
"prays"
17+
]
18+
}
19+
}

locales/en-US/countries.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"brazil": "Brazil",
3+
"unitedStates": "United States"
4+
}

locales/en-US/index.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"title": "How to pray the Rosary?"
3+
}

locales/en-US/prays.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"paterNoster": {
3+
"name": "Pai Nosso",
4+
"pray": "Pai Nosso que estais no céu\nsantificado seja o vosso Nome\nnvenha a nós o vosso Reino\nseja feito a vossa vontade\nassim na terra como no Céu\nO pão nosso de cada dia nos dai hoje,\nperdoai-nos as nossas ofensas\n assim como nós perdoamos\na quem nos tem ofendido,\ne não nos deixeis cair em tentação,\nmas livrai-nos do Mal.\n"
5+
},
6+
"gloriaPatri": {
7+
"name": "Glória Pai",
8+
"pray": "Glória ao Pai, ao Filho e ao Espírito Santo,\nassim como era no princípio,\nagora e sempre e pelos séculos dos séculos,\nAmém"
9+
}
10+
}

locales/index.ts

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { BR, type FlagComponent, US } from 'country-flag-icons/react/3x2'
2+
3+
export enum LanguageCode {
4+
BRAZILIAN_PORTUGUESE = 'pt-BR',
5+
AMERICAN_ENGLISH = 'en-US',
6+
}
7+
8+
export interface Country {
9+
code: string
10+
name: string
11+
language: string
12+
}
13+
14+
export interface CountryMapProps extends Country {
15+
Flag: FlagComponent
16+
}
17+
18+
export class MapCountry<key, value> extends Map<key, value> {
19+
}
20+
21+
export const Countries = new MapCountry([
22+
[
23+
LanguageCode.BRAZILIAN_PORTUGUESE,
24+
{
25+
Flag: BR,
26+
code: LanguageCode.BRAZILIAN_PORTUGUESE,
27+
language: 'Português',
28+
name: 'brazil'
29+
}
30+
],
31+
[
32+
LanguageCode.AMERICAN_ENGLISH,
33+
{
34+
Flag: US,
35+
code: LanguageCode.AMERICAN_ENGLISH,
36+
language: 'English (US)',
37+
name: 'unitedStates'
38+
}
39+
]
40+
])
41+
42+
export const COUNTRIES_NAMESPACE = 'countries'

locales/pt-BR/countries.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"brazil": "Brasil",
3+
"unitedStates": "Estados Unidos"
4+
}

locales/pt-BR/index.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"title": "Como rezar o rosário?"
3+
}

locales/pt-BR/prays.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"paterNoster": {
3+
"name": "Pai Nosso",
4+
"pray": "Pai Nosso que estais no céu\nsantificado seja o vosso Nome\nnvenha a nós o vosso Reino\nseja feito a vossa vontade\nassim na terra como no Céu\nO pão nosso de cada dia nos dai hoje,\nperdoai-nos as nossas ofensas\n assim como nós perdoamos\na quem nos tem ofendido,\ne não nos deixeis cair em tentação,\nmas livrai-nos do Mal.\n"
5+
},
6+
"gloriaPatri": {
7+
"name": "Glória Pai",
8+
"pray": "Glória ao Pai, ao Filho e ao Espírito Santo,\nassim como era no princípio,\nagora e sempre e pelos séculos dos séculos,\nAmém"
9+
}
10+
}

next.config.js

+73-85
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,86 @@
1+
/* eslint-disable @typescript-eslint/no-var-requires */
2+
/* eslint-disable no-undef */
13
// Config got from Renaud ROHLINGER <https://twitter.com/onirenaud
24

35
/** @type {import('next').NextConfig} */
4-
const plugins = require("next-compose-plugins");
5-
const withBundleAnalyzer = require("@next/bundle-analyzer")({
6-
enabled: process.env.ANALYZE === "true",
7-
});
6+
const plugins = require('next-compose-plugins')
7+
const withBundleAnalyzer = require('@next/bundle-analyzer')({
8+
enabled: process.env.ANALYZE === 'true'
9+
})
810

9-
const nextConfig = {
10-
reactStrictMode: true,
11-
compiler: {
12-
// ssr and displayName are configured by default
13-
styledComponents: true,
14-
},
15-
webpack(config, { isServer }) {
16-
// audio support
17-
config.module.rules.push({
18-
test: /\.(ogg|mp3|wav|mpe?g)$/i,
19-
exclude: config.exclude,
20-
use: [
21-
{
22-
loader: require.resolve("url-loader"),
23-
options: {
24-
limit: config.inlineImageLimit,
25-
fallback: require.resolve("file-loader"),
26-
publicPath: `${config.assetPrefix}/_next/static/images/`,
27-
outputPath: `${isServer ? "../" : ""}static/images/`,
28-
name: "[name]-[hash].[ext]",
29-
esModule: config.esModule || false,
30-
},
31-
},
32-
],
33-
});
11+
const nextTranslate = require('next-translate-plugin')
3412

35-
// shader support
36-
config.module.rules.push({
37-
test: /\.(glsl|vs|fs|vert|frag)$/,
38-
exclude: /node_modules/,
39-
use: ["raw-loader", "glslify-loader"],
40-
});
13+
const nextConfig = {
14+
reactStrictMode: true,
15+
compiler: {
16+
// ssr and displayName are configured by default
17+
styledComponents: true
18+
},
19+
...nextTranslate({
20+
webpack: (config, { isServer }) => {
21+
// audio support
22+
config.module.rules.push({
23+
test: /\.(ogg|mp3|wav|mpe?g)$/i,
24+
exclude: config.exclude,
25+
use: [
26+
{
27+
loader: require.resolve('url-loader'),
28+
options: {
29+
limit: config.inlineImageLimit,
30+
fallback: require.resolve('file-loader'),
31+
publicPath: `${config.assetPrefix}/_next/static/images/`,
32+
outputPath: `${isServer ? '../' : ''}static/images/`,
33+
name: '[name]-[hash].[ext]',
34+
esModule: config.esModule || false
35+
}
36+
}
37+
]
38+
})
4139

42-
return config;
43-
},
44-
};
40+
// shader support
41+
config.module.rules.push({
42+
test: /\.(glsl|vs|fs|vert|frag)$/,
43+
exclude: /node_modules/,
44+
use: ['raw-loader', 'glslify-loader']
45+
})
4546

46-
// manage i18n
47-
if (process.env.EXPORT !== "true") {
48-
nextConfig.i18n = {
49-
locales: ["en-US"],
50-
defaultLocale: "en-US",
51-
};
47+
return config
48+
}
49+
})
5250
}
5351

5452
module.exports = plugins(
53+
[
5554
[
56-
[
55+
{
56+
workboxOpts: {
57+
swDest: process.env.NEXT_EXPORT
58+
? 'service-worker.js'
59+
: 'static/service-worker.js',
60+
runtimeCaching: [
61+
{
62+
urlPattern: /^https?.*/,
63+
handler: 'NetworkFirst',
64+
options: {
65+
cacheName: 'offlineCache',
66+
expiration: {
67+
maxEntries: 200
68+
}
69+
}
70+
}
71+
]
72+
},
73+
async rewrites () {
74+
return [
5775
{
58-
workboxOpts: {
59-
swDest: process.env.NEXT_EXPORT
60-
? "service-worker.js"
61-
: "static/service-worker.js",
62-
runtimeCaching: [
63-
{
64-
urlPattern: /^https?.*/,
65-
handler: "NetworkFirst",
66-
options: {
67-
cacheName: "offlineCache",
68-
expiration: {
69-
maxEntries: 200,
70-
},
71-
},
72-
},
73-
],
74-
},
75-
async rewrites() {
76-
return [
77-
{
78-
source: "/service-worker.js",
79-
destination: "/_next/static/service-worker.js",
80-
},
81-
];
82-
},
83-
},
84-
],
85-
withBundleAnalyzer,
76+
source: '/service-worker.js',
77+
destination: '/_next/static/service-worker.js'
78+
}
79+
]
80+
}
81+
}
8682
],
87-
nextConfig
88-
);
89-
90-
// const nextConfig = {
91-
// reactStrictMode: true,
92-
// compiler: {
93-
// // ssr and displayName are configured by default
94-
// styledComponents: true,
95-
// },
96-
// };
97-
98-
// module.exports = nextConfig
83+
withBundleAnalyzer
84+
],
85+
nextConfig
86+
)

0 commit comments

Comments
 (0)