Git Product home page Git Product logo

food-static-files-generator's People

Contributors

0xamogh avatar andrewserra avatar atherdon avatar beni03 avatar ebrahim-2 avatar edebo avatar geeksambhu avatar iamravitejag avatar ijb87 avatar oksanafrankiv avatar renovate-bot avatar saphal1998 avatar svr8 avatar vadim9999 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

food-static-files-generator's Issues

generate file todo

Is your feature request related to a problem? Please describe.
https://github.com/GroceriStar/food-static-files-generator/blob/master/src/generateFile.js#L20-L22

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

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Test coverage [discussion only]

Is your feature request related to a problem? Please describe.
As most of our methods were created and perfect, i think it's a good time for cover them with tests, that will help us at our future work

@AndrewSerra let's discuss here what methods should be covered with tests

src/configGenerator.js + GenerateFile/GenerateFiles/GenerateArray

TODO found

https://codeclimate.com/github/GroceriStar/food-static-files-generator/src/configGenerator.js#issue_5d19ea9ab13dea00010000f7


Config Generator -- why we comment a few things, methods?

if we don't need them. lets then add and comment more objects. and hide them for next times?

for generator -- we need to create folders for each generated file as well(compare with src/data).

filesES5 -- we have very long paths
we should make it less long. we can update to ```var { resolve } = require('path') and make files easy to read again.


  1. Config Generator -- why we comment a few things, methods?
    if we don't need them. lets then add and comment more objects. and hide them for next times?

  2. for generator -- we need to create folders for each generated file as well(compare with src/data).

Vadim reply

  1. On the first question - we just were testing generator and we generated files that were needed for a task.
  2. Do you mean to create a folder with adding to the name "generated"? Example: Allergy_generated.json?

Rename this js files:
generateFiles -> generateJSONS
generateFile -> generateJSON
generateArray - separate functions by projects and connect it in configGenerator.js

Note I'm actually not happy with this names as well. but i think it will be solved by the end of this task. we just overgrow those files and that structure

all ESLint warnings should be resolved

Is your feature request related to a problem? Please describe.
One of repeating errors shown by ESLint: Definition for rule 'jest/no-identical-title' was not found
Not sure if we just need to disable it. I assume that it's bad that we don't have a proper test coverage here

Btw, we should skip thinking about fixing errors from project folder, because it's a rudiment, that we'll remove pretty soon

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

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Coding Plan

Release 1
Generator moved outside

Release 2
Migrated functionality to ES6

Release 3
Projects goes away

Release 4
CSV parser as separated module

testts es6 style

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

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

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Rewriting generator into es6 [Main task]

Intro
Now our need to rewrite all code that we have here into es6. The huge task will be separated into small.

Main instructions of what should be done:

  1. Replace require on import.
    For example index.js in src folder -> https://github.com/GroceriStar/food-static-files-generator/blob/master/src/index.js
    Now we have
const { generateFiles } = require('./generateFiles')

module.exports = {
    generateFiles
}

after should be like this

import  generateFiles  from './generateFiles'

export default {
    generateFiles
}

  1. Change
module.exports = {

}

on

export  {

}

Debugging
To make debugging generator. Execute this command

npm run debug:generator

Rollup will build index.cjs in dist folder. Then in runGenerator.js happens calling function generateFiles()

Note
If you will see require in functions doesn't change it. For example like this https://github.com/GroceriStar/food-static-files-generator/blob/master/src/generateArray.js#L21

Useful links:

Expected Behavior / Situation

Actual Behavior / Situation

Modification Proposal

move packages to devDependencies

Is your feature request related to a problem? Please describe.
It's a simple task. When we setup a ESLint module we install a bunch of modules in order to make it work with our current setup. that modules not required to be publishied at npm, so we should remove them from major dependencies and enable at dev section

  • "babel-eslint": "^10.0.2",
  • "eslint-plugin-jest": "^22.7.1",
  • "rollup-plugin-eslint": "^7.0.0",

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

https://blog.heroku.com/cli-flags-get-started-with-oclif

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

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

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Config Generator -- why we comment a few things, methods?

if we don't need them. lets then add and comment more objects. and hide them for next times?

for generator -- we need to create folders for each generated file as well(compare with src/data).

filesES5 -- we have very long paths
we should make it less long. we can update to ```var { resolve } = require('path') and make files easy to read again.

No function named getFileName()

Describe the bug
There is a function named getFileName() trying to be imported from writeFile.js to the file fileSystem.js and it gives an error. There is no function named getFileName() in the repository

To Reproduce
It can be found in the travis-ci error list in issue #113

Screenshots
No screenshots but here is the error:

/home/travis/build/GroceriStar/food-static-files-generator/src/fileSystem.js
   5:47  error    Parse errors in imported module './writeFile': Line 73: Export 'getFileName' is not defined
  71 |   readData,
  72 |   save,
> 73 |   getFileName,
     |   ^
  74 | };
  75 |  (73:3)  import/named

Additional context
The function name may be changed but not for all the repo. I have checked utils.js and thought it may be an older version of getFileInfo()

Bug of eslint in rollup

Describe the bug
A clear and concise description of what the bug is.

To Reproduce

npm run build

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

image

Additional context
Add any other context about the problem here.

small fixes - generator

  1. Config Generator -- why we comment a few things, methods?
    if we don't need them. lets then add and comment more objects. and hide them for next times?

  1. for generator -- we need to create folders for each generated file as well(compare with src/data).

Expected Behavior / Situation

Actual Behavior / Situation

Modification Proposal

create a simple test coverage for fileSystem.js methosd

Is your feature request related to a problem? Please describe.
i'm not requiring anything complex right now.
simple tests that will check if methods exists will work for this task ok.

Tell me if you'll have questions - I can share examples with you

instead of generating files at output folder - we'll generate them wherever user want.

Is your feature request related to a problem? Please describe.
as generator is a separated module - we cannot just generate files inside of it folders
it should be an argument, that will be a pass(should be checked) and if this path exists - we should put there a generated file/files

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

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Renaming generator files

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Rename this js files:
generateFiles -> generateJSONS
generateFile -> generateJSON
generateArray - separate functions by projects and connect it in configGenerator.js

make Travis CI work here

Describe the bug
Partially it will relate on #114 because we have a lint inside of Travis CI

I have feeling, that with our latest changes - when we'll solve ESLint warnings - Travis became green without any problems.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://travis-ci.org/GroceriStar/food-static-files-generator/jobs/556052507

Expected behavior
Travis CI builds should pass green in our PRs

Screenshots
image

Additional context
Add any other context about the problem here.

improve readme and put there all information that we have at SD readme right now

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

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

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

fileSystem methods separation

Is your feature request related to a problem? Please describe.
https://github.com/GroceriStar/food-static-files-generator/blob/master/src/fileSystem.js

#72
Describe the solution you'd like
move write and read methods to a separated file. it will help to make writeFile.js less complicated and shorter

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

todos generateFile.js

Is your feature request related to a problem? Please describe.
file: https://github.com/GroceriStar/food-static-files-generator/blob/master/src/generateFile.js

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

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

add codeclimate, husky, lint-staged to our development process

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

  • CodeClimate
  • Husky
  • LintStaged. I assume that for making lint staged works we should finish #51
  • Another advanced stuff for code + CI(upon request will find it in my notes)

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

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

notes

Generator --> create examples folder, where we show how we combine data, in order to have different structures.

Separated module, so you can install it, and pass your own dataset, or use data, that we have at our static data repository.

Making a generator as an independent module will simplify our work with a graphql server as well.
We can generate files outside of sd for it.
Using promises and callbacks --> so we can call generator inside at our express servers.
First step for use generator at gs-gql will be items.
Then we should test structure for MeasurementsSystems.

replace standard with eslint

Is your feature request related to a problem? Please describe.
as we have babel, you should add bridge between babel and eslint and maybe connect it not only at babel.config.js but also at rollup(only in case if eslint wouldn't work well at rollup build)

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

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

this will be our points of export at index.js?

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
image

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

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

rollup.config.js clean up

rollup cjs setup error

Describe the bug
I assume that we should change settings for cjs rollup because it generates strange errors

To Reproduce
Steps to reproduce the behavior:

  1. Go to SD/generator/FoodComposition/csv_parser
  2. And line, where I'm importing write method(i export it from this method) are generating an issue

https://github.com/GroceriStar/sd/blob/master/generator/projects/FoodComposition/csv_parser.js#L10

Expected behavior
cjs version at sd repo should work, while we not migrate it to es6

Screenshots
If applicable, add screenshots to help explain your problem.
image

Additional context
Add any other context about the problem here.

Bug of empty MeasurementSystemUnits/measurementSystemUnits

Describe the bug

A clear and concise description of what the bug is.
Generating of empty json MeasurementSystemUnits/measurementSystemUnits. This can be a simple mistake or typo. Find out what is the problem and fix this.
Here https://github.com/GroceriStar/food-static-files-generator/blob/master/src/generateArray.js#L125 is a function that returns an array with data. Here https://github.com/GroceriStar/food-static-files-generator/blob/master/src/configGenerator.js#L21 setting function to config.
Here https://github.com/GroceriStar/food-static-files-generator/blob/master/src/generateFiles.js#L32 Calling all functions from config.

Debug
To debug you can use play.js in folder play of food-static-files-generator. To run play.js use this command:

npm run play

Also in play js I have set running a generator. Change path ('../../../sd/src') to sd here https://github.com/GroceriStar/food-static-files-generator/blob/master/src/play/play.js#L25 . SD and food-static-files-generator projects should be in one folder for example in javascript.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

move projects outside from this module

Is your feature request related to a problem? Please describe.
the main idea is simple. this module should have only methods that help to generate additional files, but all things like projects, csv parser and other should be independent as well and use this module as dependency inside of it

How to test generator? [not finished]

Is your feature request related to a problem? Please describe.
Ok, so we trying to separate our generator outside of sd module. But how to test it correctly, so we can understand that it works well with different cases and different code styles?

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

Describe the solution you'd like
A clear and concise description of what you want to happen.

create a plan for moving generator out [Main task]

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

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

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

generator should be written at ES6 - so we'll get features from babel and from rollup checks and from eslit as well

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

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

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Discussion

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

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

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

was tests moved?

Expected Behavior / Situation

Actual Behavior / Situation

Modification Proposal

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.