-
Notifications
You must be signed in to change notification settings - Fork 11
replaced redux for context, changed some files to ts and added reques… #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8fa58e0
87c532e
0e542d0
b819750
2c28c49
ff96713
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
module.exports = { | ||
extends: ['wolox-react'], | ||
extends: ['wolox', 'wolox-react', 'wolox-typescript'], | ||
parser: '@typescript-eslint/parser', | ||
rules: { | ||
'import/no-unresolved': 'off', | ||
'import/no-extraneous-dependencies': 'off' | ||
'import/no-extraneous-dependencies': 'off', | ||
'@typescript-eslint/no-var-requires': 'off' | ||
}, | ||
settings: { | ||
react: { | ||
version: 'detect' | ||
} | ||
} | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,16 +84,18 @@ module.exports.FILES_TO_DESTINATION = [LINTER_IGNORE_PATH, RESCRIPTS_PATH, NPMRC | |
|
||
module.exports.CI_CONFIG_FILE = `${CI_PATH}/config.yml`; | ||
|
||
module.exports.BOOTSTRAP_TYPES = [{ name: 'Clean', value: false }, { name: 'Customized', value: true }]; | ||
module.exports.BOOTSTRAP_TYPES = [ | ||
{ name: 'Clean', value: false }, | ||
{ name: 'Customized', value: true } | ||
]; | ||
|
||
module.exports.DEV_DEPENDENCIES = [ | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected].0', | ||
'[email protected].1', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
const COMPONENTS_PATH = 'src/app/components'; | ||
const SCREENS_PATH = 'src/app/screens'; | ||
const CONFIG_PATH = 'src/config'; | ||
const REDUX_PATH = 'src/redux'; | ||
const UTILS_PATH = 'src/utils'; | ||
const SERVICES_PATH = 'src/services'; | ||
const CONSTANTS_PATH = 'src/constants'; | ||
const DOCS_README_PATH = 'docs'; | ||
const DEPENDENCY_SPECIFIC_PATH = 'src/dependency_specific'; | ||
const HOOKS_PATH = 'src/app/hooks'; | ||
const CONTEXT_PATH = 'src/app/contexts'; | ||
|
||
module.exports.RESCRIPTS_PATH = { | ||
src: 'rescriptsrc.js', | ||
|
@@ -18,40 +19,37 @@ module.exports.NPMRC_PATH = { | |
destination: '.npmrc' | ||
}; | ||
|
||
module.exports.REDUX_COMPONENTS = [`${COMPONENTS_PATH}/Field/index.js`]; | ||
|
||
module.exports.FILES = [ | ||
CONFIG_PATH, | ||
CONSTANTS_PATH, | ||
DOCS_README_PATH, | ||
REDUX_PATH, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't we need to change this for a global Context Folder.? Just for global values, like Auth There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. global context is in ~app/context and it's already being added in this same object:
|
||
SCREENS_PATH, | ||
UTILS_PATH, | ||
HOOKS_PATH, | ||
CONTEXT_PATH, | ||
'aws.js', | ||
'tsconfig.json', | ||
'tsconfig.paths.json', | ||
'scripts/deploy.js', | ||
'src/react-app-env.d.ts', | ||
`${COMPONENTS_PATH}/Routes/components/AuthenticatedRoute.tsx`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happened with the authenticated route? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I changed it to RouteItem, it's more generic. That component has the potential to receive any condition for being shown or not. For instance, if you have many user types with different access levels |
||
`${COMPONENTS_PATH}/Routes/styles.module.scss`, | ||
'src/app/index.tsx', | ||
`${COMPONENTS_PATH}/Routes`, | ||
`${COMPONENTS_PATH}/Spinner`, | ||
`${COMPONENTS_PATH}/Suspense`, | ||
`${COMPONENTS_PATH}/SearchBar`, | ||
`${COMPONENTS_PATH}/InputLabel`, | ||
`${COMPONENTS_PATH}/TextArea`, | ||
`${COMPONENTS_PATH}/Checkbox`, | ||
`${COMPONENTS_PATH}/RadioGroup`, | ||
`${SERVICES_PATH}/AuthServices.js`, | ||
`${SERVICES_PATH}/AnalyticsService.js` | ||
`${COMPONENTS_PATH}/ProviderWrapper`, | ||
`${SERVICES_PATH}/AuthServices.js` | ||
]; | ||
|
||
module.exports.TEMPLATE_FILES = [ | ||
// TODO: Insert here all template ejs files | ||
'.eslintrc.js', | ||
'.babelrc.js', | ||
'src/index.tsx', | ||
'src/app/index.tsx', | ||
`${COMPONENTS_PATH}/Routes/index.tsx`, | ||
`${SERVICES_PATH}/LocalStorageService.js` | ||
]; | ||
|
||
|
@@ -73,7 +71,6 @@ module.exports.WITHOUT_SEAMLESS_FILES = { | |
module.exports.OPTIONAL_DEPENDENCIES = { | ||
moment: { dependencies: ['moment@^2.23.0'] }, | ||
'seamless-immutable': { dependencies: ['seamless-immutable@^7.1.4'] }, | ||
reselect: { dependencies: ['reselect@^4.0.0'] }, | ||
'babel-module-resolver': { | ||
dependencies: ['babel-plugin-module-resolver@^3.1.1'], | ||
devDependencies: ['eslint-import-resolver-babel-module@^5.0.0'] | ||
|
@@ -82,16 +79,8 @@ module.exports.OPTIONAL_DEPENDENCIES = { | |
|
||
module.exports.DEPENDENCIES = [ | ||
'apisauce@^1.0.1', | ||
'redux@^4.0.1', | ||
'react-redux@^6.0.0', | ||
'connected-react-router@^6.0.0', | ||
'react-router-dom@^4.3.1', | ||
'redux-recompose@^2.1.0', | ||
'redux-form@^8.0.4', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add Formik? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same answer |
||
'redux-thunk@^2.3.0', | ||
'react-router@^4.3.1', | ||
'redux-beacon@^2.0.3', | ||
'@redux-beacon/google-analytics@^1.1.1', | ||
'react-router@^5.1.2', | ||
'react-router-dom@^5.1.2', | ||
'seamless-immutable@^7.1.4', | ||
'history@^4.7.2', | ||
'i18next@^13.0.0', | ||
|
@@ -104,9 +93,10 @@ module.exports.DEV_DEPENDENCIES = [ | |
'@types/node@^12.12.14', | ||
'@types/react@^16.9.13', | ||
'@types/react-dom@^16.9.4', | ||
'@types/react-redux@^7.1.5', | ||
'@types/react-router@^5.1.2', | ||
'@types/react-router@^5.1.4', | ||
'@types/react-router-dom@^5.1.3', | ||
'@types/seamless-immutable@^7.1.11', | ||
'@types/webpack-env@^1.14.1' | ||
'@types/webpack-env@^1.14.1', | ||
'eslint-config-wolox-typescript' | ||
]; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,10 @@ const { FILES, FILES_TO_DELETE, TEMPLATE_FILES, WITHOUT_SEAMLESS_FILES } = requi | |
module.exports = function copyAllFiles() { | ||
mkdirp(this.destinationPath(`${this.projectName}/src/app/assets/`)); | ||
|
||
console.log('Deleting default CRA files...'); | ||
deleteFiles.bind(this)(FILES_TO_DELETE); | ||
|
||
console.log('Adding files...'); | ||
Comment on lines
+10
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these on purpose? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I used them to debug but then I thought it improved the output for the user |
||
copyFiles.bind(this)(FILES); | ||
copyTemplateFiles.bind(this)(TEMPLATE_FILES); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,13 @@ const getPackageJsonAttributes = (projectName, projectVersion, repoUrl) => ({ | |
name: projectName, | ||
title: projectName, | ||
version: projectVersion, | ||
jest: { | ||
moduleNameMapper: { | ||
'~screens(.*)': '<rootDir>/src/app/screens/$1', | ||
'~components(.*)': '<rootDir>/src/app/components/$1', | ||
'^~(.*)/(.*)$': '<rootDir>/src/$1/$2' | ||
} | ||
}, | ||
repository: { | ||
type: 'git', | ||
url: repoUrl | ||
|
@@ -60,10 +67,11 @@ module.exports.createJSConfig = function createJSConfig() { | |
'~screens/*': ['./src/app/screens/*'], | ||
'~config/*': ['./src/config/*'], | ||
'~constants/*': ['./src/constants/*'], | ||
'~redux/*': ['./src/redux/*'], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we add a context folder we should add it here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the I answered this in the previous comment |
||
'~services/*': ['./src/services/*'], | ||
'~utils/*': ['./src/utils/*'], | ||
'~assets/*': ['./src/assets/*'] | ||
'~assets/*': ['./src/assets/*'], | ||
'~hooks/*': ['./src/app/hooks/*'], | ||
'~contexts/*': ['./src/app/contexts/*'] | ||
}; | ||
} | ||
|
||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,10 +11,11 @@ | |
"~screens/*": ["./src/app/screens/*"], | ||
"~config/*": ["./src/config/*"], | ||
"~constants/*": ["./src/constants/*"], | ||
"~redux/*": ["./src/redux/*"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think it is a discussion for now, but should we use
With this eslint can differenciate between @apollo and @components. I think it could be a good improvment, what do you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I had issues with jest for some reason when I tried it to use @. Can you add a card in here https://trello.com/b/sZVeiFgw/departamento-de-frontend so we can do this separatedly? |
||
"~services/*": ["./src/services/*"], | ||
"~utils/*": ["./src/utils/*"], | ||
"~assets/*": ["./src/assets/*"] | ||
"~assets/*": ["./src/assets/*"], | ||
"~hooks/*": ["./src/hooks/*"], | ||
"~contexts/*": ["./src/contexts/*"] | ||
} | ||
}, | ||
"include": ["src"], | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a suggestion, if we are going to remove Redux and with that redux-form. Shouldn't we add Formik? Maybe we can have it already installed as a customized library
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe, but I won't do it in this PR. As of right now, nothing is actually using redux-form, so I'm not removing any functionality. We should think if we want to force Formik, set it as optional dependency or what do we actually want