Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add new decorator-less config pattern #14

Merged
merged 3 commits into from
Jan 11, 2025

Conversation

mvantellingen
Copy link
Member

Add a simplified config method in order to make it work without decorators. With support for running typescript directly from node having a proper decorator less approach makes sense.

Example usage:

import { BaseConfig, EnviConfig, envfield } from "@labdigital/enviconf"

class SampleConfig extends BaseConfig {
  /** The port number to listen on */
  readonly HTTP_PORT: number = 4000

  config(): EnviConfig {
    return {
      HTTP_PORT: envfield.number(/* options here */)
    }
  }
}
const config = SampleConfig.load()

Add a simplified config method in order to make it work without
decorators.
Copy link

changeset-bot bot commented Jan 11, 2025

🦋 Changeset detected

Latest commit: b78e949

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

This PR includes changesets to release 1 package
Name Type
@labdigital/enviconf Minor

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

@mvantellingen mvantellingen force-pushed the feature/new-config-style branch 2 times, most recently from 6407c70 to afd7fbe Compare January 11, 2025 09:28
@mvantellingen mvantellingen force-pushed the feature/new-config-style branch from 3939446 to b78e949 Compare January 11, 2025 09:33
@mvantellingen mvantellingen merged commit f41c270 into main Jan 11, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant