Skip to content
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

if I comment any of those cases - i wouldnt get any warning or something in our ... #1433

Open
github-actions bot opened this issue Jul 29, 2022 · 5 comments
Labels

Comments

@github-actions
Copy link

reactFull: () => generateReactFullTemplate(FULL_SOURCE),

// TODO if I comment any of those cases - i wouldnt get any warning or something in our command line.

import { isFolderExists } from './domain/write';

import { generateReactFullTemplate } from './templates/NewsletterReactTemplate';
import { generateFullTemplateHackernoon } from './templates/HackernoonTemplate';
//-------------------
// @TODO add path package, in order to make it work PERFECTLY
const FULL_SOURCE = 'source/source.md';

isFolderExists('./generated');
isFolderExists('./tests/_generated');

console.log('Mode', process.env.PARSE);

// TODO if I comment any of those cases - i wouldnt get any warning or something in our command line.

const modeMap = {
  full: () => generateFullTemplateHackernoon(FULL_SOURCE),
  // reactContentOnly: () => generateReactContent(CONTENT_SOURCE),
  reactFull: () => generateReactFullTemplate(FULL_SOURCE),
};

modeMap[process.env.PARSE ?? 'full']();
@github-actions github-actions bot added the todo label Jul 29, 2022
@vadim9999
Copy link
Collaborator

@atherdon the problem was with printMessage, because you have wrapped params into object, but didn't change call of this function

@atherdon
Copy link
Collaborator

hmm. I mean, probably there was an issue with my code, but the reason why I created this issue is different.

i mean that it's hard to manage items from this array. while we protected our main page - we still don't have a proper way to get an error. Imagine this situation - this generator was used for creating 100 different templates - do you think this structure will be able to handle that?

Do you want to explore this issue deeper?

@atherdon
Copy link
Collaborator

cc @vadim9999

@vadim9999
Copy link
Collaborator

I don't think that the object can cause any errors. switch is not so good, because it's hard to read and understand what is going on. also there are some troubles with switch block, and it's recommended to use object instead

@atherdon
Copy link
Collaborator

atherdon commented Jul 31, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants