Skip to content

Middleware related store generation Clone espeo-create-react-app while init#14

Open
grzegorzkruk wants to merge 6 commits into
masterfrom
middleware-related-store-generation
Open

Middleware related store generation Clone espeo-create-react-app while init#14
grzegorzkruk wants to merge 6 commits into
masterfrom
middleware-related-store-generation

Conversation

@grzegorzkruk

Copy link
Copy Markdown
Contributor
  • Middleware related store generation
  • Clone espeo-create-react-app while init
  • Remove /packageTemplate

Comment thread helpers/generateFile.js
.catch(err => {
throw err;
});
const res = prettify(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

const spinnerInstance = new Spinner('Installing dependencies... %s');
spinnerInstance.setSpinnerString('|/-\\');

const outputPath = program.args[0]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing semicolon

for (let fileToRemove of middlewareToRemove.files) {
await exec(
`
rm '${filesManager.getOutputFile(`/${outputPath}/${fileToRemove}`)}'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since you're removing all middleware related files, shouldn't we also remove epic / saga folders which you can in MainArticles/store path?

Comment thread config.js
templatesFolder: '/templates'
templatesFolder: '/templates',
projectTemplateRepositoryUrl: 'https://github.com/espeo/espeo-create-react-app.git',
projectTemplateVersion: '1.0.0',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it be possible to have this value read dynamically from package.json file from cloned repository, instead of keeping it hardcoded?

Comment thread helpers/filesManager.js

let dirDepth = 0;
const findFile = (fileName, root) => {
let files = find.fileSync(fileName, root || process.cwd());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it be const?

Comment thread helpers/filesManager.js
const maxDirectoryDepth = 10;

let dirDepth = 0;
const findFile = (fileName, root) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this function of yours doing exactly the same what find-up package do? The one we were using in updateRootStore.js

Comment thread helpers/prettify.js
const prettify = code => prettier.format(
code,
{
parser: 'typescript',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does replacing error with log method call do difference?

Comment thread package.json
"commander": "^4.0.1",
"consolidate": "^0.15.1",
"find": "0.3.0",
"find-up": "4.1.0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you're not using this package anymore, please clean it up :)

} from '../actions';
{{setVar "upperCaseName" (toUpperCase name)}}

export type dateValues = '' | 'today' | 'week' | 'month';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)}}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the purpose of this comment?

@adamkosmala

Copy link
Copy Markdown

@grzegorzkruk , I believe we can close this PR, as cloning from github has been implemented in a different manner by @mwojslaw ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants