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

Missing License.txt #10

Open
tavurth opened this issue Mar 12, 2020 · 11 comments
Open

Missing License.txt #10

tavurth opened this issue Mar 12, 2020 · 11 comments

Comments

@tavurth
Copy link
Contributor

tavurth commented Mar 12, 2020

When I built this library, I discussed with the product owner open sourcing it. Unfortunately no licensing discussion was made at that time.

After I left the company in question, I created the following pull request to allow others to continue contributing to the work, and allow growth of content here.

However, the PR has not been accepted, and so it seems like we're not able to continue improving this library.

As an alternative to this, I've been using fastest-validator, which supports JSON schema out of the box and is in general very nice to use.

Sorry I can't be more helpful in these PRs or issues at this time, as I have no access to this repository.

@tavurth
Copy link
Contributor Author

tavurth commented Mar 12, 2020

I heard that the company who bought out my previous company is https://mail.ru, since they now own the codebase perhaps we could ask them for some allowance to continue editing this repo.

@spaceemotion
Copy link

I got permission from work to work on a rewrite of this package + open source the efforts (most likely under MIT). Feels a bit like wasted time, but since the license isn’t there it has to be written from scratch. Can I use the same format that yup-ast uses? It would be like a compatibility package then, I guess.

@tavurth
Copy link
Contributor Author

tavurth commented Mar 13, 2020

I'm not sure what restrictions the code is under, but I'd say an "Inspired by" is probably not going to cause trouble.

If I were to do it again I might do it a bit differently, perhaps an iteration from the deepest JSON levels first, rising to other levels above later.

{
  "thirdPassA": { // objects shorthanded
    "secondPassA": {
      "firstPassA": [["yup.number"],  ["yup.min", 5]], // 0th level is inside this validator
      "firstPassB": [["yup.number"],  ["yup.min", 5]]
    },
    "secondPassB": {
      "firstPassC": [["yup.number"],  ["yup.min", 5]],
      "firstPassD": [["yup.number"],  ["yup.min", 5]]
    }
  },
  "secondPassC": [ // arrays shorthanded
    {
      "firstPassE": [["yup.number"],  ["yup.min", 5]],
      "firstPassF": [["yup.number"],  ["yup.min", 5]]
    },
    {
      "firstPassG": [["yup.number"],  ["yup.min", 5]],
      "firstPassH": [["yup.number"],  ["yup.min", 5]]
    }
  ]
}

In this way the JSON could be split into passes, and then each pass could be operated on in turn. Previous turns which then contain a YUP schema would be integrated nicely with yup.arrayOf or yup.oneOf types.

The reasoning for this is that recursion of types was the most painful part of the initial implementation.

Might be something like:

const firstPass = [
  { "firstPassA": yup.number().min(5) },
  { "firstPassB": yup.number().min(5) },
  { "firstPassC": yup.number().min(5) },
  { "firstPassD": yup.number().min(5) },
  { "firstPassE": yup.number().min(5) },
  { "firstPassF": yup.number().min(5) }
]

const secondPass = [
  { "secondPassA": { ...matchingFirstPass } },
  { "secondPassB": { ...matchingFirstPass } }
  { "secondPassC": [ ...matchingFirstPass ] }
]

const thirdPass = ...

// And then recombine

I actually just started freelancing, if you need some help or review you can put me in touch with whomever.

@spaceemotion
Copy link

Thanks for the offer. I’ll make sure to tag you in the repo/pr when i got something up and running. Currently, the task is planned for the week after this one, but recent developments might have shifted things a bit.

@spaceemotion
Copy link

@tavurth hey, so I finally was able to spend some time on this and came up with this for now: https://gist.github.com/spaceemotion/68c03dcf443608f7011fecc6fb9037fc

so far, all the tests are passing (i just ported them over for now), even the one outlined in #2, for which I added a test case to the string checks.

I am unsure about the extra methods that yup-ast provides, as there don't seem to be tests available for them?

Otherwise I'd simply create a basic repo, and release this as v1. One thing I am uncertain with regards to licensing are the tests. Would they have to be rewritten as well?

@tavurth
Copy link
Contributor Author

tavurth commented Apr 1, 2020

@tavurth hey, so I finally was able to spend some time on this and came up with this for now: https://gist.github.com/spaceemotion/68c03dcf443608f7011fecc6fb9037fc

so far, all the tests are passing (i just ported them over for now), even the one outlined in #2, for which I added a test case to the string checks.

I am unsure about the extra methods that yup-ast provides, as there don't seem to be tests available for them?

Otherwise I'd simply create a basic repo, and release this as v1. One thing I am uncertain with regards to licensing are the tests. Would they have to be rewritten as well?

I'm really not sure about if the tests would have to be re-written. Certainly this structure needs tests, as the internal logic is complex, and could easily be broken by someone accidentally.

Perhaps a simpler set of tests could cover most cases? I remember that there were some critical tests I added near the end.

@spaceemotion
Copy link

Yeah, i guess I could make a couple "mega-tests" that simply try to copy a larger structure for the beginning.

@spaceemotion
Copy link

@tavurth good news! The new package just got released. If anything's still missing, don't hesitate to open up issues/work on it further. Cheers!

https://github.com/demvsystems/yup-ast

@bitflower
Copy link

That's great news. I just discovered the lib and found it interesting.

@tavurth
Copy link
Contributor Author

tavurth commented May 13, 2020

@tavurth good news! The new package just got released. If anything's still missing, don't hesitate to open up issues/work on it further. Cheers!

https://github.com/demvsystems/yup-ast

Congrats! Thank you!

If you find this thread from google, this library is outdated. Check the above link.

@atassis
Copy link
Contributor

atassis commented May 15, 2020

@tavurth @spaceemotion Hello everyone! I haven't seen for a while this project due to a lot of stuff happening around me lately. I'll try to start maintaining this project lately, still have to resolve some personal questions. If anyone has questions- tag me or write to the telegram with the same username as I do have here.

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

No branches or pull requests

4 participants