Skip to content

feat(dev): optional per-developer overrides via dev-local.yaml - #1804

Closed
rjmunro wants to merge 5 commits into
Sofie-Automation:mainfrom
rjmunro:rjmunro/dev-local-yaml
Closed

feat(dev): optional per-developer overrides via dev-local.yaml#1804
rjmunro wants to merge 5 commits into
Sofie-Automation:mainfrom
rjmunro:rjmunro/dev-local-yaml

Conversation

@rjmunro

@rjmunro rjmunro commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

About the Contributor

This pull request is posted on behalf of SuperFly.tv.

Type of Contribution

This is a:

Feature / Documentation improvement

Current Behavior

Long yarn dev sessions can grow Node heaps unboundedly (especially TSC and Vite).
Developers who want LAN access to the Vite UI also have to patch tracked config or run
Vite by hand. Personal tweaks were often kept in stashes or one-off package.json
edits that are easy to commit by mistake.

A uniform NODE_OPTIONS / TOOL_NODE_FLAGS in the shell already works for a single
shared heap limit, but not for different per-process limits or Vite --host.

New Behavior

Optional gitignored dev-local.yaml (same idea as meteor-settings.json) is loaded by
scripts/run.mjs when present:

  • Per-process Node memory caps for TSC, Meteor (tool + app), and Vite
  • Optional Vite --host for LAN access

Copy dev-local.example.yamldev-local.yaml and edit. Documented in DEVELOPER.md
and yarn dev --help.

yaml is declared as a root devDependency so we do not rely on transitive hoisting.
It was already present in the tree via lint-staged — the yarn.lock delta is a
single line adding it to the workspace dependency list (no new package resolution).

Testing

  • I have added one or more unit tests for this PR
  • I have updated the relevant unit tests
  • No unit test changes are needed for this PR

Affected areas

  • Local development only (yarn dev / yarn start orchestration)
  • No runtime / production behaviour change when dev-local.yaml is absent

Time Frame

Not urgent — quality-of-life for local development; fine for the in-development release.

Other Information

Example:

cp dev-local.example.yaml dev-local.yaml
# edit memory limits / vite.host as needed
yarn dev
# logs: Found dev-local.yaml

Status

  • PR is ready to be reviewed.
  • The functionality has been tested by the author.
  • Relevant unit tests has been added / updated.
  • Relevant documentation (code comments, system documentation) has been added / updated.

rjmunro added 2 commits July 29, 2026 14:00
- Declare yaml as a root devDependency so scripts/run.mjs can load
  optional gitignored config without relying on transitive hoisting
- Load repo-root dev-local.yaml when present and apply per-process
  Node memory limits for TSC, Meteor, and Vite
- Pass Vite --host when configured so the UI is reachable on the LAN
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 69b6a202-36c4-48b5-93d5-7104dca333ce

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

rjmunro added 2 commits July 30, 2026 10:37
- Commit an annotated example for personal yarn-dev overrides
- Gitignore dev-local.yaml so machine-specific copies stay local
- Describe copying the example file and available overrides in DEVELOPER.md
- Mention the same in yarn-dev --help
@rjmunro
rjmunro force-pushed the rjmunro/dev-local-yaml branch from 0717cc5 to 46047f4 Compare July 30, 2026 09:37
- Yarn was forwarding `vite ... -- --host`, so Vite ignored --host and
  stayed on localhost; LAN clients then got connection refused
@Julusian

Copy link
Copy Markdown
Member

This has overlap with the env file I have as part of #1786
I dont have a strong preference on whether to go with a yaml or env file.

One thing we are visibly disagreeing on is how the example file should work. I went with an approach of that the example should be documentation and shouldnt do anything until something is enabled. You have an approach of the env file being setup with some suggestions that someone may want to disable almost all of. I see it as an example file to me is a suggestion of how to setup your local env, so to me only things that we recommend be set should be set there. (In some projects I have seen it where they will auto-copy the example to a usable one for you if it doesnt exist)

I like the simplicity of the envfile format, partly as it doesn't need a library to load, just invoking node with node --env-file-if-exists=.env . But it is less readable than something structured like yaml.

same idea as meteor-settings.json

Worth noting that this is no longer really used (although I appear to have missed a few references)

@nytamin

nytamin commented Aug 10, 2026

Copy link
Copy Markdown
Member

We'll close this one for now, and keep the idea in mind for later (after the major de-Meteor-merge PRs)

@nytamin nytamin closed this Aug 10, 2026
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.

3 participants