Skip to content

Add allowMissing flag to @import decorator for optional imports#281

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/add-allowmissing-import-flag
Draft

Add allowMissing flag to @import decorator for optional imports#281
Copilot wants to merge 4 commits intomainfrom
copilot/add-allowmissing-import-flag

Conversation

Copy link
Contributor

Copilot AI commented Feb 6, 2026

Adds allowMissing parameter to @import() to make imports optional. When true, missing files/directories are silently skipped instead of causing load errors.

Changes

  • Core: Added allowMissing boolean parameter to import processing in data-source.ts

    • Defaults to false (backward compatible)
    • Applies to file, directory, and virtual imports
    • Validates type and errors on non-boolean values
  • Tests: Added 7 test cases covering missing files/directories, interaction with enabled parameter, and error validation

  • Docs: Updated import guide and root-decorators reference with usage examples

Usage

# Skip if missing without error
# @import(./.env.local, allowMissing=true)

# Combine with conditional imports
# @import(./.env.features, FEATURE_X, enabled=eq($ENV, "dev"), allowMissing=true)

Useful for optional environment-specific overrides or local development configs that may not exist in all environments.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature Request] @import flag to allow optional imports</issue_title>
<issue_description>### Description

Add a new flag allowMissing to the @import decorator which will not fail if the file/directory does not exist.

Motivation

No response

Proposed Solution

No response

Alternatives

No response

Additional Information

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@changeset-bot
Copy link

changeset-bot bot commented Feb 6, 2026

⚠️ No Changeset found

Latest commit: 9f3464a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copilot AI and others added 2 commits February 6, 2026 22:33
Co-authored-by: theoephraim <1158956+theoephraim@users.noreply.github.com>
Co-authored-by: theoephraim <1158956+theoephraim@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Workers  Cloudflare Workers

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

Status Name Latest Commit Updated (UTC)
🔵 In progress
View logs
varlock-website 4e1649e Feb 06 2026, 10:34 PM

Co-authored-by: theoephraim <1158956+theoephraim@users.noreply.github.com>
Copilot AI changed the title [WIP] Add allowMissing flag to @import decorator Add allowMissing flag to @import decorator for optional imports Feb 6, 2026
Copilot AI requested a review from theoephraim February 6, 2026 22:39
@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@281

varlock

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

@varlock/astro-integration

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

@varlock/nextjs-integration

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

@varlock/vite-integration

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

@varlock/1password-plugin

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

@varlock/google-secret-manager-plugin

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

commit: 9f3464a

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.

[Feature Request] @import flag to allow optional imports

2 participants