Skip to content

Workaround Main Builds#305

Open
markovejnovic wants to merge 1 commit into
wolfadex:mainfrom
harmont-dev:harmont/prepare-script
Open

Workaround Main Builds#305
markovejnovic wants to merge 1 commit into
wolfadex:mainfrom
harmont-dev:harmont/prepare-script

Conversation

@markovejnovic
Copy link
Copy Markdown

@markovejnovic markovejnovic commented May 8, 2026

This PR implements a workaround around an upstream issue mdgriffith/elm-optimize-level-2#120 by disabling --optimize 2, and falling back to --optimize 1.


Additionally, I add a npm prepare script which relies on npm (for cross-compatibility) and makes it easier for people to install this package via git (and my project has it as such:

"devDependencies": {
  "elm-open-api": "github:harmont-dev/elm-open-api-cli#25d7..."
}

Note: This adds a package-lock.json.

If you find the package-lock.json undesirable, I can revert the addition of the npm prepare script.


Heads up: PR made with the help of LLMs

Drops --debug (current elm-pages emits a non-runnable bundle in debug
mode) and switches to --optimize 1 to avoid the elm-optimize-level-2
F-wrapper-arity bug tracked in
mdgriffith/elm-optimize-level-2#120 (which
elm-pages bundle-script uses by default at --optimize 2).

The 'prepare' hook lets consumers depend on this fork via a git URL —
npm runs the script after cloning so dist/elm-open-api.js materialises
without a manual build step.

elm-pages is pinned to the bun.lock version (3.3.3) since the npm/elm
package pair must agree.
@markovejnovic markovejnovic changed the title Fix mainline builds Workaround Main Builds May 8, 2026
@miniBill
Copy link
Copy Markdown
Collaborator

miniBill commented May 9, 2026

Yes, please separate out the prepare from the --optimize 1. The latter can be merged without much discussion, the former is something that we probably need to weight and understand more first

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.

2 participants