Skip to content

add multi-line fn calls#278

Merged
theoephraim merged 2 commits intomainfrom
multi-line-fns
Feb 6, 2026
Merged

add multi-line fn calls#278
theoephraim merged 2 commits intomainfrom
multi-line-fns

Conversation

@theoephraim
Copy link
Member

@theoephraim theoephraim commented Feb 6, 2026

Adds multi-line support for function calls, both in decorators and item values.

Big pain that this solves is very long lists of imported keys. see #217

Supporting this in item values does break our previous goal of not breaking other .env parsers, but I think it may be worthwhile. If a specific user needs to maintain support for another env loader for some reason, they can just choose to not use multi-line fn call values. This should be relatively rare unless you start getting into very complicated composition of values and functions...

Follow up work here is

  • support nested function calls within decorators
  • support commenting out whole lines within a multi line fn call
  • support trailing comments after a line within a multi-line fn call
  • support same commenting within decorator multi-line fns

@changeset-bot
Copy link

changeset-bot bot commented Feb 6, 2026

🦋 Changeset detected

Latest commit: d1ad043

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@env-spec/parser Minor
varlock Minor
@varlock/astro-integration Major
@varlock/nextjs-integration Major
@varlock/vite-integration Major
@varlock/1password-plugin Major
@varlock/google-secret-manager-plugin Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 6, 2026

Open in StackBlitz

@env-spec/parser

npm i https://pkg.pr.new/dmno-dev/varlock/@env-spec/parser@278

varlock

npm i https://pkg.pr.new/dmno-dev/varlock@278

@varlock/astro-integration

npm i https://pkg.pr.new/dmno-dev/varlock/@varlock/astro-integration@278

@varlock/nextjs-integration

npm i https://pkg.pr.new/dmno-dev/varlock/@varlock/nextjs-integration@278

@varlock/vite-integration

npm i https://pkg.pr.new/dmno-dev/varlock/@varlock/vite-integration@278

@varlock/1password-plugin

npm i https://pkg.pr.new/dmno-dev/varlock/@varlock/1password-plugin@278

@varlock/google-secret-manager-plugin

npm i https://pkg.pr.new/dmno-dev/varlock/@varlock/google-secret-manager-plugin@278

commit: d1ad043

Copy link
Member

@philmillman philmillman left a comment

Choose a reason for hiding this comment

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

LGTM

Two things:

  • we should consider an escape hatch that will 'flatten' multiline values for portability's sake
  • this should probably be a minor version not a patch (see comment)

@@ -0,0 +1,6 @@
---
"@env-spec/parser": patch
"varlock": patch
Copy link
Member

Choose a reason for hiding this comment

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

We might consider a minor version here since it's potentially breaking and files with multiline values won't work in older versions

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch!

both for decorators and item values
@theoephraim theoephraim merged commit fe893e2 into main Feb 6, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants