Skip to content

Add url validation options + regex literal syntax#599

Merged
theoephraim merged 7 commits intomainfrom
copilot/add-url-validation-options
Apr 14, 2026
Merged

Add url validation options + regex literal syntax#599
theoephraim merged 7 commits intomainfrom
copilot/add-url-validation-options

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 13, 2026

URL validation options

  • Add noTrailingSlash and matches options to url data type
  • Support regex("pattern") wrapper in matches option (runtime + vscode paths)
  • Tests for regex() wrapper in matches option (url and string)

Regex literal syntax (/pattern/flags)

  • New ParsedEnvSpecRegexLiteral AST class in env-spec-parser
  • RegexLiteral grammar rule, wired into all value positions (config values, function args, decorator values)
  • Regex literals handled natively in simplifiedValues, convertParsedValueToResolvers, and expand
  • VSCode diagnostics updated to recognize /pattern/flags in matches option and isDynamicValue
  • regex() function marked as deprecated in intellisense, with guidance to use literal syntax
  • Parser tests: literals as values, in function args, in key=value args, toString roundtrip
  • Resolver tests: regex literal match, regex literal with flags, regex literal as top-level value error
  • Changeset added

Example usage

# before (still works, but deprecated)
ITEM=remap($ENV, regex("^dev.*"), "http://localhost", regex("^prod.*"), "https://prod.example.com")
# @type=url(matches=regex("^https://api\."))

# after
ITEM=remap($ENV, /^dev.*/, "http://localhost", /^prod.*/, "https://prod.example.com")
# @type=url(matches=/^https:\/\/api\./)

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 13, 2026

🦋 Changeset detected

Latest commit: d54c0ee

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

This PR includes changesets to release 20 packages
Name Type
varlock
env-spec-language Patch
@env-spec/parser Minor
@varlock/astro-integration Major
@varlock/cloudflare-integration Major
@varlock/expo-integration Major
@varlock/nextjs-integration Major
@varlock/vite-integration Major
@varlock/1password-plugin Major
@varlock/aws-secrets-plugin Major
@varlock/azure-key-vault-plugin Major
@varlock/bitwarden-plugin Major
@varlock/dashlane-plugin Major
@varlock/google-secret-manager-plugin Major
@varlock/hashicorp-vault-plugin Major
@varlock/infisical-plugin Major
@varlock/keepass-plugin Major
@varlock/pass-plugin Major
@varlock/passbolt-plugin Major
@varlock/proton-pass-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

Copilot AI requested a review from theoephraim April 13, 2026 06:42
Copilot stopped work on behalf of theoephraim due to an error April 13, 2026 06:42
@theoephraim theoephraim changed the title Add noTrailingSlash and matches (regex) options to the url data type Add url validation options + regex literal syntax Apr 13, 2026
@theoephraim theoephraim requested a review from philmillman April 13, 2026 07:33
@theoephraim theoephraim marked this pull request as ready for review April 13, 2026 07:34
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 13, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@env-spec/parser@599
npm i https://pkg.pr.new/varlock@599

commit: d54c0ee

Copilot AI and others added 7 commits April 13, 2026 22:15
Agent-Logs-Url: https://github.com/dmno-dev/varlock/sessions/c64bda59-564c-4d92-b03d-abf64bb1f3e3

Co-authored-by: theoephraim <1158956+theoephraim@users.noreply.github.com>
Introduce /pattern/flags as a first-class value type in the env-spec
grammar, deprecating the regex() function wrapper. Regex literals work
in all value positions: config item values, function args, decorator
values, and key=value pairs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Circular class references between FunctionArgs and FunctionCall make
reordering impossible; suppress the lint rule on the specific line.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@theoephraim theoephraim force-pushed the copilot/add-url-validation-options branch from 6a450dc to d54c0ee Compare April 14, 2026 05:16
@theoephraim theoephraim merged commit c498964 into main Apr 14, 2026
18 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