[Feature Request] SDK function for `varlock load --filter`

Open
#1,250 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
node.js, typescript
Domain
backend

Research direction

Start by reading the public load() API and the internal.loadEnvGraph path mentioned in the issue, then trace how the CLI's varlock load --filter handles schema loading, filtering, values, and errors. Add a public API that accepts basePath and filter and returns the filtered results; done means callers can use it without resolving secrets, and the result includes values and errors.

Written by the indexing model from the issue text.

Description

Description

Please add a public function that does the same as varlock load --filter=…. It loads the schema from a given directory, resolves only the items that match the filter, and returns their values and errors.

import { loadFiltered } from 'varlock';

const { valid, values } = await loadFiltered({ basePath: root, filter: '!@sensitive' });
Motivation

Our setup checks validate the public values in Node, so they must not decrypt secrets. load() resolves every item, so it asks for Touch ID. Today we use internal.loadEnvGraph or spawn the CLI instead.

Dominant language
TypeScript
Stars
4.9k
Forks
140
Avg merge
2d 3h
Merged PRs (30d)
35

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dmno-dev/varlock

All issues in dmno-dev/varlock

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.