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

Refactor seeding steps #48

Open
lolmaus opened this issue Jan 28, 2020 · 4 comments
Open

Refactor seeding steps #48

lolmaus opened this issue Jan 28, 2020 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@lolmaus
Copy link
Contributor

lolmaus commented Jan 28, 2020

Seeding steps are a mess. They are inconsistent and hard to grasp.

Also, this should be extracted into a converter:

    const typePlural = pluralize(camelize(typeRaw));
    assert(`Collection ${typePlural} does not exist in Mirage`, server.db[typePlural]);
@lolmaus lolmaus added the enhancement New feature or request label Jan 28, 2020
@lolmaus lolmaus added this to the First beta release milestone Jan 28, 2020
@lolmaus lolmaus self-assigned this Jan 28, 2020
@simonihmig
Copy link
Member

What do you have in mind as an alternative?

@lolmaus
Copy link
Contributor Author

lolmaus commented Jan 28, 2020

  1. Make it obvious from the step text whether the step accepts a raw JSON input or a table.
  2. Remove relationship lookup from tables and instead use productIds pseudo-attrs.
  3. Provide single-line and multi-line versions of JSON-driven steps.
  4. Less confusing documentation.

@lolmaus
Copy link
Contributor Author

lolmaus commented Jan 28, 2020

  1. Remove the @id special format.

@lolmaus
Copy link
Contributor Author

lolmaus commented Jan 28, 2020

Previously, I've been trying to kill two birds with one stone: simplicity and readability. It was a limited success and I'm not happy with the quirks our seeding steps have.

Thus, I want to remove all the magic from the existing seeding steps, as described above, and focus on simplicity.

For readability, I have created a separate issue: #49. Set it to the farther milestone, since it's not a priority for us. Might make sense to remove it from the milestone.

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

No branches or pull requests

2 participants