Refactor ConfigSource API for better encapsulation#54
Merged
Conversation
- Change loadDwJson() to return {config, path} for proper path tracking
- Make internal utilities internal (remove mapDwJsonToNormalizedConfig,
mergeConfigsWithProtection, getPopulatedFields from exports)
- Remove deprecated 'sources' option from ResolveConfigOptions
- CLI commands now use ResolvedB2CConfig directly with .values.* access
- SDK command classes use factory methods (createB2CInstance(),
createMrtAuth(), etc.) instead of manual construction
- Fix replaceDefaultSources option to work without sourcesAfter
BREAKING CHANGE: loadConfig() now returns ResolvedB2CConfig instead of
NormalizedConfig. Access config values via .values.* property.
Add missing structured fields to log calls while preserving human-readable messages with interpolated values. This makes logs both machine-parseable and human-friendly. Changes: - Add jobId, executionId, path fields to job operations - Add cartridgeName, codeVersionId fields to code operations - Add method, url fields to client logging - Add headerName, keyPreview, username, port fields to auth - Change reserved 'hostname' field to 'server' in watch.ts
The oclif flag had a default value that was always passed as an override to config resolution, preventing dw.json values from being used. Remove the default from the flag and rely on the existing fallback in the accountManagerHost getter.
charithaT07
approved these changes
Jan 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is largely a cleanup PR, removing unused or unnecessary code, refining interfaces, removing internal functions from public API, and making logging more verbose. no real functional changes. Net negative lines of code.
Summary
loadDwJson()to return{config, path}for proper path tracking in DwJsonSourcemapDwJsonToNormalizedConfig,mergeConfigsWithProtection,getPopulatedFieldsfrom public exports)sourcesoption fromResolveConfigOptionsResolvedB2CConfigdirectly with.values.*access patterncreateB2CInstance(),createMrtAuth(), etc.) instead of manual constructionreplaceDefaultSourcesoption to work without requiringsourcesAfterBug Fix: account-manager-host from dw.json ignored
Fixed an issue where
account-manager-hostconfigured in dw.json was being ignored. The oclif flag had adefaultvalue that was always passed as an override to config resolution, preventing dw.json values from being used. Removed the default from the flag definition and rely on the existing fallback in theaccountManagerHostgetter.Structured Logging Improvements
Improved structured logging across the SDK to ensure log calls have proper structured fields for machine-parseable output while preserving human-readable messages:
Pattern Applied
Files Updated
api-key.ts,basic.ts,oauth.ts,oauth-implicit.ts- Added auth-specific fields (headerName, keyPreview, username, port, duration)jobs/run.ts,jobs/site-archive.ts,code/deploy.ts,code/versions.ts,code/watch.ts- Added domain-specific fields (jobId, executionId, codeVersionId, cartridgeName, path)middleware.ts,webdav.ts- Added HTTP fields (method, url, status, duration)Key Changes
jobIdnotid,codeVersionIdnotversion)path,method,url,server)hostnametoserverin watch.tsBreaking Changes
loadConfig()now returnsResolvedB2CConfiginstead ofNormalizedConfig.values.*property (e.g.,this.resolvedConfig.values.hostname)ResolvedConfigtype alias removed from exportsTest plan