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

Generator module should be independent [Main task] #209

Open
atherdon opened this issue Aug 7, 2019 · 15 comments
Open

Generator module should be independent [Main task] #209

atherdon opened this issue Aug 7, 2019 · 15 comments
Labels
help wanted Extra attention is needed in-process

Comments

@atherdon
Copy link
Contributor

atherdon commented Aug 7, 2019

Is your feature request related to a problem? Please describe.
Some history:

  • 4 months ago generator was just a script at sd repository
  • Now we move it out and want to make it completely independent from prev source.
  • Right now at src folder we have few files that a rudimentary, from old times. Files like (configGenerator.js + GenerateFile/GenerateFiles/GenerateArray)
    Our goal is to adjust our methods (i think we talking about methods from fileSystem.js) in order to accept functions, that change the structure of objects from the outside of this module.
    For this case we have Promises at our main methods at fileSystem.js

I think we not finished code for read method(#194)

Is it was created as task at GitHub issues? Please provide an issue number or link
#100 #194

Describe the solution you'd like
I want to be able to create a function at sd repository, that will be able to be passed inside of generator methods like read/write and it will work.

Additional context
@vadim9999 @Beni03 @edward-hong @IamRaviTejaG @AndrewSerra @svr8 @sarthakvijayvergiya

Links to files:
https://github.com/GroceriStar/food-static-files-generator/blob/master/src/generateFile.js
https://github.com/GroceriStar/food-static-files-generator/blob/master/src/generateFiles.js
https://github.com/GroceriStar/food-static-files-generator/blob/master/projects/configGenerator.js
https://github.com/GroceriStar/food-static-files-generator/blob/master/projects/menuGenerator.js

@atherdon atherdon changed the title Generator module should be [Main task] Generator module should be independent [Main task] Aug 7, 2019
@atherdon atherdon added help wanted Extra attention is needed in-process labels Aug 7, 2019
@atherdon atherdon added this to the separation from sd milestone Aug 7, 2019
@atherdon
Copy link
Contributor Author

atherdon commented Aug 7, 2019

@geeksambhu

@atherdon atherdon pinned this issue Aug 7, 2019
@geeksambhu
Copy link
Contributor

@atherdon I really don't understand the mentioned details and the context. Can you please summarize or elaborate more

@atherdon
Copy link
Contributor Author

atherdon commented Aug 7, 2019 via email

@ghost
Copy link

ghost commented Aug 8, 2019

@atherdon

From reading the comments in the file src/generateFile.js I'm guessing you want the file to be refactored to something like:

import { write } from "./fileSystem";
import getMenuGenerator from "./utils";

const generateFile = (path, callback) => {

  // not sure how the callback can be passed as an attribute getMenuGenerator method.
  const data = callback()

  write(path, data);
};

module.exports = generateFile;

Am I on the right track?

@atherdon
Copy link
Contributor Author

atherdon commented Aug 8, 2019

I made a video, take a look: https://www.loom.com/share/6df49e613a274aac93ff34c7f13bbdef

@atherdon
Copy link
Contributor Author

@vadim9999 can you jump into this task?

@Mishra121
Copy link

@atherdon Do I need to implement the callback or something else?

@atherdon
Copy link
Contributor Author

atherdon commented Sep 16, 2019

@Mishra121 can you explain more or maybe show your code change at pull request? Because now it's not clear for me

@atherdon
Copy link
Contributor Author

@saphal1998 please check this video - it will give you some details what to do next https://www.loom.com/share/2ec12f1a007b47b484a813ac9979e71b

@saphal1998
Copy link
Contributor

Firstly, Sorry for the delay. I was a bit occupied since the past two days.

As far as I understood, you're looking to modularise the generator code to individual folders in projects3.0. So I will try and just see how this code works for now and send a pull request when I see some changes that I can make.

Thanks for filling me in @atherdon

@atherdon
Copy link
Contributor Author

@saphal1998 not a problem at all. sure go ahead

@saphal1998
Copy link
Contributor

saphal1998 commented Oct 4, 2019

@atherdon I'm having a hard time understanding what WeeklyMenu does. I have run the functions individually but can you please describe what is the agenda of all the individual files in the src folder.

For example:

// 3. using generateFile method here instead of previous versions just for testing how it works
// const generateFile = require('./generateFile')
// generateFile();

in the index.js of WeeklyMenu, what does it mean here? it works fine if we send any parameters, so I think I just need a better idea of what is to be done with this module exactly.

@atherdon
Copy link
Contributor Author

atherdon commented Oct 5, 2019 via email

@saphal1998
Copy link
Contributor

@atherdon I was working on the Measurements directory. I wanted to know why all the code in methods.js has been commented out. Could you explain to me what the file is doing?

// const {
// measurementSystem,
// measurementUnits
// } = require("@groceristar/sd-wrapper");

// const { generateArrWithId } = require("@groceristar/static-data-generator");

Upon being run independently, these aren't yielding any outputs either, so if you could tell me what each of these is doing, perhaps I can write a function to mimic its functionality.

@atherdon
Copy link
Contributor Author

atherdon commented Oct 9, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed in-process
Projects
None yet
Development

No branches or pull requests

4 participants