Middleware related store generation Clone espeo-create-react-app while init#14
Middleware related store generation Clone espeo-create-react-app while init#14grzegorzkruk wants to merge 6 commits into
Conversation
grzegorzkruk
commented
Jan 17, 2020
- Middleware related store generation
- Clone espeo-create-react-app while init
- Remove /packageTemplate
| .catch(err => { | ||
| throw err; | ||
| }); | ||
| const res = prettify( |
| const spinnerInstance = new Spinner('Installing dependencies... %s'); | ||
| spinnerInstance.setSpinnerString('|/-\\'); | ||
|
|
||
| const outputPath = program.args[0] |
| for (let fileToRemove of middlewareToRemove.files) { | ||
| await exec( | ||
| ` | ||
| rm '${filesManager.getOutputFile(`/${outputPath}/${fileToRemove}`)}' |
There was a problem hiding this comment.
since you're removing all middleware related files, shouldn't we also remove epic / saga folders which you can in MainArticles/store path?
| templatesFolder: '/templates' | ||
| templatesFolder: '/templates', | ||
| projectTemplateRepositoryUrl: 'https://github.com/espeo/espeo-create-react-app.git', | ||
| projectTemplateVersion: '1.0.0', |
There was a problem hiding this comment.
would it be possible to have this value read dynamically from package.json file from cloned repository, instead of keeping it hardcoded?
|
|
||
| let dirDepth = 0; | ||
| const findFile = (fileName, root) => { | ||
| let files = find.fileSync(fileName, root || process.cwd()); |
| const maxDirectoryDepth = 10; | ||
|
|
||
| let dirDepth = 0; | ||
| const findFile = (fileName, root) => { |
There was a problem hiding this comment.
isn't this function of yours doing exactly the same what find-up package do? The one we were using in updateRootStore.js
| const prettify = code => prettier.format( | ||
| code, | ||
| { | ||
| parser: 'typescript', |
There was a problem hiding this comment.
I'm not really fan of keeping prettier settings in two places- here, and in the in .prettierrc.json file in the cloned CRA template- would it be possible to fetch .prettierrc.json settings and apply it here?
| let rootStoreFile = filesManager.findFile('rootReducer.ts'); | ||
| if (!rootStoreFile) { | ||
| console.error('Could not find rootReducer file!'); | ||
| console.log('Could not find rootReducer file!'); |
There was a problem hiding this comment.
does replacing error with log method call do difference?
| "commander": "^4.0.1", | ||
| "consolidate": "^0.15.1", | ||
| "find": "0.3.0", | ||
| "find-up": "4.1.0", |
There was a problem hiding this comment.
if you're not using this package anymore, please clean it up :)
| } from '../actions'; | ||
| {{setVar "upperCaseName" (toUpperCase name)}} | ||
|
|
||
| export type dateValues = '' | 'today' | 'week' | 'month'; |
There was a problem hiding this comment.
I do not think if we should keep all CRA-related references in this template- let's just have dummy generators that do nothing in fact, instead of relying on CRA
| @@ -1,5 +1,7 @@ | |||
| {{setVar "capitalizedName" (capitalize name)}} | |||
There was a problem hiding this comment.
I think we can remove this file at all, we're not using it in CRA at any point
| import { rootEpic } from './rootEpic'; | ||
| {{/ifEquals}} | ||
| | ||
| // Blank |
There was a problem hiding this comment.
what's the purpose of this comment?
|
@grzegorzkruk , I believe we can close this PR, as cloning from github has been implemented in a different manner by @mwojslaw ? |