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

enhance: more consistent patterns generated by elm-land #781

Merged
merged 25 commits into from
Apr 17, 2024

Conversation

plyr4
Copy link
Contributor

@plyr4 plyr4 commented Mar 26, 2024

matching more style/pattern consistency that is generated and formatted from the elm-land CLI using generate:

  • switch statement patterns (new: a :: b :: [])
  • ordering for switch branches, types, imports

and some code was moved elsewhere so that it wouldnt conflict with elm-land generate static code.

  • moved authentication flow logic from Main.elm to /Pages/Account_Authenticate.elm and /Pages/Account_Logout.elm (functionally identical)
  • moved parsePath to Utils.Routes so generate wont cause conflicts with Route.elm

if we combine those changes with some tweaks to the elm-land CLI that I made in this fork:

elm-land/elm-land@main...plyr4:elm-land-vela:main

changes:

  • added the OSS license header to the top of the generated files
  • added query param redirect logic we need for auth

you can actually use elm-land generate to build layouts and pages!

# build custom elm-land CLI from github.com/plyr4/elm-land-vela
(cd projects/cli ; npm install ; npm run setup ; npm link)

# build a new page
elm-land add page '/:org/:repo/newthang'
elm-land generate
elm-format --yes src

then visit http://localhost:8888/org/repo/newthang

note: you need an empty elm-land.json in the root of the repository to run elm-land generate:

{
    "app":{
        "config":{
            "router":{}
        }
    }
}

due to this line: /~https://github.com/plyr4/elm-land-vela/blob/main/projects/cli/src/effects.js#L222

@plyr4 plyr4 requested a review from a team as a code owner March 26, 2024 21:48
@plyr4 plyr4 changed the title Enhance/elm land adjacent enhance: more consistent patterns generated by elm-land Mar 26, 2024
KellyMerrick
KellyMerrick previously approved these changes Apr 2, 2024
Copy link
Contributor

@KellyMerrick KellyMerrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

wass3rw3rk
wass3rw3rk previously approved these changes Apr 12, 2024
Copy link
Contributor

@KellyMerrick KellyMerrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@plyr4 plyr4 merged commit 1534b6d into main Apr 17, 2024
13 checks passed
@plyr4 plyr4 deleted the enhance/elm-land-adjacent branch April 17, 2024 20:47
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

Successfully merging this pull request may close these issues.

4 participants