Repository navigation
Version 2.0.0 - #5
Conversation
…the crypto-migrate CLI command.
…amed type exports.
|
|
We detected this is a high-risk PR and are running a free ultrareview. An ultrareview is a deeper, multi-pass review that catches hard-to-find bugs a standard review can miss. We'll post the findings when it completes. This PR appears to change authentication, authorization, or input validation, where a missed bug can expose data or grant the wrong access, so a deeper multi-pass review is worth running. Want an ultrareview on every high-risk PR? Set up automated ultrareviews. |
There was a problem hiding this comment.
We detected this is a high-risk PR and ran a free ultrareview. An ultrareview is a deeper, multi-pass review that catches hard-to-find bugs a standard review can miss.
This PR appears to change authentication, authorization, or input validation, where a missed bug can expose data or grant the wrong access, so a deeper multi-pass review is worth running.
Want an ultrareview on every high-risk PR? Set up automated ultrareviews.
2 issues found across 36 files
Confidence score: 4/5
- The
CHANGELOG.mdentry overstates when SetMeUp warns about loading a legacy file; the warning depends on the optionalanyhowmodule. Qualify the release note or make the warning unconditional. - The
README.mdload()example leaves out theNODE_ENVfallback, so it gives the wrong file list whenNODE_ENV=productionandAPP_ENVis unset. Includesettings.production.json.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="CHANGELOG.md">
<violation number="1" location="CHANGELOG.md:8">
P3: This entry promises a warning whenever a legacy file is loaded, but SetMeUp emits it only when the optional `anyhow` module is installed. Qualify the release note as Anyhow-dependent or add an unconditional warning path.</violation>
</file>
<file name="README.md">
<violation number="1" location="README.md:34">
P3: The `load()` example omits the `NODE_ENV` fallback documented above: with `NODE_ENV=production` and no `APP_ENV`, it loads `settings.production.json`, not `settings.APP_ENV.json`. Include that fallback in the file list.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
| - NEW: Native ESM support via package exports, alongside CommonJS. | ||
| - NEW: Values are now encrypted as `enc2-` (AES-256-GCM, random IV per value, key of any length). Legacy `enc-` values can still be decrypted. | ||
| - NEW: `setmeup crypto-migrate` CLI command to convert legacy `enc-` values to `enc2-`. | ||
| - DEPRECATED: Legacy `enc-` encryption will be deprecated in the next release, loading files with `enc-` values logs a warning. |
There was a problem hiding this comment.
P3: This entry promises a warning whenever a legacy file is loaded, but SetMeUp emits it only when the optional anyhow module is installed. Qualify the release note as Anyhow-dependent or add an unconditional warning path.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At CHANGELOG.md, line 8:
<comment>This entry promises a warning whenever a legacy file is loaded, but SetMeUp emits it only when the optional `anyhow` module is installed. Qualify the release note as Anyhow-dependent or add an unconditional warning path.</comment>
<file context>
@@ -0,0 +1,141 @@
+- NEW: Native ESM support via package exports, alongside CommonJS.
+- NEW: Values are now encrypted as `enc2-` (AES-256-GCM, random IV per value, key of any length). Legacy `enc-` values can still be decrypted.
+- NEW: `setmeup crypto-migrate` CLI command to convert legacy `enc-` values to `enc2-`.
+- DEPRECATED: Legacy `enc-` encryption will be deprecated in the next release, loading files with `enc-` values logs a warning.
+- NEW: Types `SetMeUp`, `LoadOptions`, `LoadEnvOptions`, `LoadedFile` and `CryptoOptions` are exported.
+- BREAKING: Requires Node.js 22 or newer.
</file context>
| // By default it will load from settings.default.json, settings.json and settings.NODE_ENV.json | ||
| // automatically. Here we load settings from a custom file as well. | ||
| // Settings are not loaded automatically, so load the default files | ||
| // (settings.default.json, settings.json, settings.APP_ENV.json and settings.secret.json). |
There was a problem hiding this comment.
P3: The load() example omits the NODE_ENV fallback documented above: with NODE_ENV=production and no APP_ENV, it loads settings.production.json, not settings.APP_ENV.json. Include that fallback in the file list.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At README.md, line 34:
<comment>The `load()` example omits the `NODE_ENV` fallback documented above: with `NODE_ENV=production` and no `APP_ENV`, it loads `settings.production.json`, not `settings.APP_ENV.json`. Include that fallback in the file list.</comment>
<file context>
@@ -4,31 +4,42 @@
-// By default it will load from settings.default.json, settings.json and settings.NODE_ENV.json
-// automatically. Here we load settings from a custom file as well.
+// Settings are not loaded automatically, so load the default files
+// (settings.default.json, settings.json, settings.APP_ENV.json and settings.secret.json).
+setmeup.load()
+
</file context>
| // (settings.default.json, settings.json, settings.APP_ENV.json and settings.secret.json). | |
| // (settings.default.json, settings.json, settings.APP_ENV.json or settings.NODE_ENV.json when APP_ENV is unset, and settings.secret.json). |
Summary
SetMeUp 2.0.0: native ESM support, a new authenticated encryption format, exported TypeScript types, and a batch of bug fixes.
Major changes
New
enc2-encryption formatenc2-type:iv:tag:data. The value type is authenticated, so tampered or swapped values fail to decrypt.enc-values can still be loaded and decrypted.SMU_CRYPTO_CIPHERandSMU_CRYPTO_IVnow only apply to them.enc-values logs a deprecation warning, as legacy encryption will be deprecated in the next release.setmeup crypto-migrate <file>CLI command converts legacyenc-values toenc2-in memory, leaving all other values untouched.settings.secret.json.ESM and TypeScript
exports, sharing the same singleton instance with CommonJS.SetMeUp,LoadOptions,LoadEnvOptions,LoadedFileandCryptoOptionscan be imported by name, on both CommonJS and ESM.Environment variables
true/false(case insensitive) are loaded as booleans, and numeric values as numbers. Values that would change when converted (like007or very large IDs) are kept as strings.SMU_aandSMU_a_b), the nested one now wins deterministically instead of throwing.Breaking changes
loadFromEnv()casts booleans and numbers.Other changes
loadandloadFromEnvevents are emitted after the settings were updated.watch()keep their original load options, and reload failures no longer throw inside the file watcher.unwatch()only removes its own file listeners.once()triggering listeners multiple times.__proto__,constructorandprototypekeys.filesentries when loading the same file multiple times.loadJson()returns the loaded data.printinstead ofload), and running it without an action shows the help.