lukeed / ley

(WIP) Driver-agnostic database migrations
MIT License
259 stars 14 forks source link

Add --mjs option to generate ESM migration #25

Closed karlhorky closed 1 year ago

karlhorky commented 2 years ago

Hey @lukeed πŸ‘‹ Hope that you are well!

A new bootcamp cohort of ours is learning how to use Ley, and I wanted to teach them to use ESM in their migration files, but ley new didn't support it.

What do you think of this --mjs option in this PR? If you are open to it, I can write a docs section for it too. (an alternative name for this flag could be --esm, but that wouldn't indicate that it will also use .mjs files)

This also avoids the tab vs spaces thing by removing any type of indentation from this file.

Closes #21

codecov-commenter commented 2 years ago

Codecov Report

Base: 50.00% // Head: 48.82% // Decreases project coverage by -1.17% :warning:

Coverage data is based on head (b1743c9) compared to base (498186a). Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #25 +/- ## ========================================== - Coverage 50.00% 48.82% -1.18% ========================================== Files 2 2 Lines 206 213 +7 ========================================== + Hits 103 104 +1 - Misses 103 109 +6 ``` | [Impacted Files](https://codecov.io/gh/lukeed/ley/pull/25?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Luke+Edwards) | Coverage Ξ” | | |---|---|---| | [index.js](https://codecov.io/gh/lukeed/ley/pull/25/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Luke+Edwards#diff-aW5kZXguanM=) | `10.65% <0.00%> (-0.56%)` | :arrow_down: | | [lib/util.js](https://codecov.io/gh/lukeed/ley/pull/25/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Luke+Edwards#diff-bGliL3V0aWwuanM=) | `100.00% <0.00%> (ΓΈ)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Luke+Edwards). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Luke+Edwards)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

karlhorky commented 1 year ago

Glad to help, thanks for the merge! πŸ™Œ Opened #32 for the typo in the options property in the condition