Skip to content

Conversation

@rvfch
Copy link

@rvfch rvfch commented Jul 28, 2025

PR addresses:

  • Reworks Configuru API to allow empty name definition SERVER_PORT: schema.string()
  • Adds reload function for automatic config reload based on previous settings

New example usage viz docs.

Fixes #52
REDMIME-96040

@rvfch rvfch self-assigned this Jul 28, 2025
@rvfch rvfch force-pushed the feat/96040-env-var-names branch 3 times, most recently from 8bddb7e to efa9722 Compare July 28, 2025 10:08
@pavelsvagr pavelsvagr assigned pavelsvagr and unassigned rvfch Nov 3, 2025
@pavelsvagr pavelsvagr force-pushed the feat/96040-env-var-names branch 3 times, most recently from a625585 to 8a6ef11 Compare December 30, 2025 10:58
@pavelsvagr pavelsvagr added this to the v2 milestone Dec 30, 2025
@pavelsvagr pavelsvagr force-pushed the feat/96040-env-var-names branch 4 times, most recently from 49904c4 to 72705f4 Compare December 30, 2025 11:32
@pavelsvagr pavelsvagr requested a review from smoliji December 30, 2025 11:33
@pavelsvagr pavelsvagr force-pushed the feat/96040-env-var-names branch 2 times, most recently from 400e880 to 6fdd21c Compare December 30, 2025 11:42
@pavelsvagr
Copy link
Member

Things to consider - Change of the API and using recursive object traversal should be okay for config files, but it also increases complexity of the library. For example checking nested fields is now done on the whole object if the function is custom. Old library and direct value loading was much more efficient with that.

Comment on lines 38 to 67
### Reloading the config

If you are working in an environment that is able to change the configuration during runtime, `reload`
function can be helpful to load a new configuration based on same settings and schema as the previous one.

```typescript
import { createLoader, schema } from 'configuru'
const loader = createLoader()

const configSchema = loader({
canChange: schema.string('CHANGEABLE'),
})

const { canChange } = configSchema.values() // old value

// value changed in config file or env variables during runtime

const { canChange } = configSchema.reload().values() // new value
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: Super cool feature to keep the config up to date, however nothing to do with the original issue #52, different PR for such a huge feat. would make more sense.

Copy link
Member

Choose a reason for hiding this comment

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

Moved to #63

@pavelsvagr pavelsvagr force-pushed the feat/96040-env-var-names branch 4 times, most recently from cba5026 to a1fd713 Compare February 2, 2026 08:18
@pavelsvagr pavelsvagr requested a review from smoliji February 2, 2026 08:22
@pavelsvagr pavelsvagr force-pushed the feat/96040-env-var-names branch from a1fd713 to e619222 Compare February 2, 2026 08:24
@pavelsvagr pavelsvagr merged commit a8cc639 into master Feb 3, 2026
6 checks passed
@pavelsvagr pavelsvagr deleted the feat/96040-env-var-names branch February 3, 2026 09:27
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.

✨ Increased transparency by always using env var names

4 participants