Skip to content

feat(WOR-TSK-202): implement config types for Node.js bindings - #113

Merged
miguelramos merged 7 commits into
mainfrom
feat/WOR-TSK-202-CONFIG-TYPES
Jan 5, 2026
Merged

feat(WOR-TSK-202): implement config types for Node.js bindings#113
miguelramos merged 7 commits into
mainfrom
feat/WOR-TSK-202-CONFIG-TYPES

Conversation

@miguelramos

Copy link
Copy Markdown
Member

No description provided.

Sublime Git Bot added 6 commits December 16, 2025 05:44
Implement comprehensive NAPI-compatible type definitions for config commands:

Input Parameters:
- ConfigShowParams: parameters for configShow command
- ConfigValidateParams: parameters for configValidate command

Configuration Structures:
- ConfigData: main configuration container
- ChangesetConfigInfo: changeset management settings
- VersionConfigInfo: version resolution settings
- DependencyConfigInfo: dependency propagation settings
- UpgradeConfigInfo: upgrade detection settings
- RegistryConfigInfo: NPM registry configuration
- ScopedRegistryEntry: scoped registry mapping
- BackupConfigInfo: backup and rollback settings
- ChangelogConfigInfo: changelog generation settings
- AuditConfigInfo: audit and health check settings
- AuditSectionsConfigInfo: audit section flags
- HealthScoreWeightsInfo: health score weights
- GitConfigInfo: git integration settings
- ExecuteConfigInfo: command execution settings

Response Data:
- ConfigShowData: loaded configuration response
- ConfigValidateData: validation results response
- ConfigValidationIssue: individual validation issue

API Responses:
- ConfigShowApiResponse: wrapper for configShow
- ConfigValidateApiResponse: wrapper for configValidate

Constants:
- VALID_STRATEGIES, VALID_BUMP_TYPES, VALID_CHANGELOG_FORMATS
- VALID_MONOREPO_MODES, VALID_SEVERITY_LEVELS

All types include comprehensive documentation, Default implementations,
builder methods, and proper NAPI attributes for TypeScript generation.
Update types/mod.rs to export all config types:
- ConfigShowParams, ConfigValidateParams
- ConfigShowData, ConfigValidateData
- ConfigShowApiResponse, ConfigValidateApiResponse
- ConfigValidationIssue, ConfigData
- All configuration section types (ChangesetConfigInfo, etc.)
- Validation constants

Types are marked with allow(unused_imports) as they will be
used in stories 7.2-7.3 (config commands implementation).
Add 78 new tests across 7 test modules:

- config_params_tests: ConfigShowParams and ConfigValidateParams
- config_info_tests: all configuration section structures
- config_data_tests: ConfigData and ConfigShowData
- config_validation_tests: ConfigValidationIssue and ConfigValidateData
- config_api_response_tests: API response wrappers
- config_constants_tests: validation constants
- config_scenario_tests: complete workflow scenarios

Tests cover:
- Construction and default values
- Builder methods and factory functions
- Clone and serialization
- Error and success scenarios
- Complete config show/validate workflows

Total test count: 914 (78 new tests added)
Regenerate binding.d.ts and binding.js with new config types.

TypeScript definitions now include:
- ConfigShowParams, ConfigValidateParams
- ConfigShowData, ConfigValidateData
- ConfigShowApiResponse, ConfigValidateApiResponse
- ConfigValidationIssue, ConfigData
- All configuration section interfaces

Fixed documentation to use line comments instead of JSDoc
in TypeScript examples to prevent parsing errors.
Update public API exports to include all config types:

Input Parameters:
- ConfigShowParams, ConfigValidateParams

Response Data:
- ConfigShowData, ConfigValidateData

API Responses:
- ConfigShowApiResponse, ConfigValidateApiResponse

Validation Types:
- ConfigValidationIssue

Main Configuration:
- ConfigData

Configuration Sections:
- ChangesetConfigInfo, VersionConfigInfo
- DependencyConfigInfo, UpgradeConfigInfo
- RegistryConfigInfo, ScopedRegistryEntry
- BackupConfigInfo, ChangelogConfigInfo
- AuditConfigInfo, AuditSectionsConfigInfo
- HealthScoreWeightsInfo, GitConfigInfo
- ExecuteConfigInfo
Run napi version to synchronize platform-specific package
versions with the main workspace-tools package.
Apply cargo fmt to fix import ordering in tests.rs.
Fix clippy::field_reassign_with_default by using struct update syntax
instead of mutable reassignment after Default::default().
@miguelramos
miguelramos force-pushed the feat/WOR-TSK-202-CONFIG-TYPES branch from 834a827 to a885351 Compare January 5, 2026 09:14
@miguelramos
miguelramos merged commit 2d40002 into main Jan 5, 2026
31 checks passed
@miguelramos
miguelramos deleted the feat/WOR-TSK-202-CONFIG-TYPES branch January 5, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ TYPE: Feature New feature or capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant