Skip to content

Add domain data type for bare domain names - #1045

Merged
theoephraim merged 3 commits into
mainfrom
domain-data-type
Aug 28, 2026
Merged

Add domain data type for bare domain names#1045
theoephraim merged 3 commits into
mainfrom
domain-data-type

Conversation

@theoephraim

Copy link
Copy Markdown
Member

Adds a new domain data type for bare domain names (hostnames) like example.com, since this is a common config shape currently only coverable with url or string.

Validates RFC 1123 hostname structure (label charset/length, 253-char total), and rejects values with a protocol, path, port, or credentials with errors pointing at @type=url / @type=ip where appropriate. Requires at least two labels by default.

Options:

  • allowWildcard: permit a leading *. label (certs, CORS)
  • allowSingleLabel: permit localhost / internal service names
  • allowIp: also accept an IPv4 address, for HOST-style vars (DB_HOST) that hold a hostname in one env and an IP in another
  • normalize: lowercase before validation
  • matches: regex constraint, same syntax as string/url

Also generates proxy placeholders as <seed>.invalid (reserved TLD), and includes VSCode extension support (completions + static value diagnostics), docs, and tests.

Deliberately rejected for now: trailing-dot FQDNs, leading-dot cookie-domain form, IPv6 (incl. bracketed literals), and host:port values.

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

bumpy-frog

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

minor Minor releases

  • @varlock/native-helper-darwin 1.17.1 → 1.18.0
  • @varlock/native-helper-linux-arm64 1.17.1 → 1.18.0
  • @varlock/native-helper-linux-x64 1.17.1 → 1.18.0
  • @varlock/native-helper-win32-x64 1.17.1 → 1.18.0
  • env-spec-language 0.3.3 → 0.4.0
  • varlock 1.17.1 → 1.18.0

Bump files in this PR

Click here if you want to add another bump file to this PR


This comment is maintained by bumpy.

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle size

⚠️ grows the bundle by 8.0 KB (+0.2%)

Metric main This PR Δ
Total dist 4094.0 KB 4102.0 KB +8.0 KB (+0.2%)
JS 1586.1 KB 1588.6 KB +2.5 KB (+0.2%)
Sourcemaps 2422.8 KB 2428.3 KB +5.4 KB (+0.2%)
Type defs 85.1 KB 85.1 KB
Other 0.0 KB 0.0 KB

dist/ only; native binaries are versioned separately and not counted here.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

The new validators accept an overlength wildcard hostname and the editor can reject domain values that the runtime accepts. Both should be aligned before merging.

Reviewed changes in the two commits through 4f84f3b, covering the runtime domain type, VS Code support, tests, docs, and release entries.

  • Runtime type: Adds hostname validation, coercion, proxy placeholders, and options for wildcards, single-label names, IPv4 values, normalization, and regex matching.
  • Editor support: Adds completion metadata and static diagnostics intended to mirror runtime domain validation.
  • Coverage and docs: Adds runtime and editor tests, reference documentation, and package bump entries.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using azure/gpt-5.6-sol𝕏

Comment thread packages/varlock/src/env-graph/lib/data-types.ts Outdated
Comment thread packages/vscode-plugin/src/diagnostics-core.ts Outdated
@pkg-pr-new

pkg-pr-new Bot commented Aug 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

varlock

npm i https://pkg.pr.new/varlock@1045

@varlock/native-helper-darwin

npm i https://pkg.pr.new/@varlock/native-helper-darwin@1045

@varlock/native-helper-linux-arm64

npm i https://pkg.pr.new/@varlock/native-helper-linux-arm64@1045

@varlock/native-helper-linux-x64

npm i https://pkg.pr.new/@varlock/native-helper-linux-x64@1045

@varlock/native-helper-win32-x64

npm i https://pkg.pr.new/@varlock/native-helper-win32-x64@1045

commit: af03d33

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 27, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
varlock-website 4f84f3b Commit Preview URL

Branch Preview URL
Aug 27 2026, 10:24 PM

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes since the prior Pullfrog review at 4f84f3b, covering the corrective commit and its regression tests.

  • Counted wildcard length correctly: Changed runtime and editor validation to include the leading *. in the 253-character domain limit and added exact boundary coverage.
  • Aligned editor regex semantics: Applied domain matching after normalization and preserved regex literal flags across domain, string, and URL diagnostics.

Pullfrog  | View workflow run | Using azure/gpt-5.6-sol𝕏

@theoephraim
theoephraim merged commit ee3bc19 into main Aug 28, 2026
27 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.

1 participant