chore(cli,shared,vscode): fix imports to be module level only#2196
Merged
rocketstack-matt merged 4 commits intofinos:mainfrom Mar 1, 2026
Merged
chore(cli,shared,vscode): fix imports to be module level only#2196rocketstack-matt merged 4 commits intofinos:mainfrom
rocketstack-matt merged 4 commits intofinos:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR standardizes consumption of @finos/calm-shared by removing deep dist/... imports across the CLI and VS Code extension, and updating the shared package barrel exports to support root-level imports.
Changes:
- Updated
shared/src/index.tsto re-export additional shared types (ValidateOutputFormat,CalmChoice,CalmOption) from the package root. - Refactored CLI and VS Code extension code to import shared utilities/types directly from
@finos/calm-shared. - Updated some tests’ imports, but left a couple of deep-path module mocks that no longer align with the new import entrypoint.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| shared/src/index.ts | Exposes additional exports at the package root to support module-level imports. |
| cli/src/command-helpers/validate.ts | Replaces deep imports with root @finos/calm-shared imports. |
| cli/src/command-helpers/generate-options.ts | Switches option-related imports to the package root. |
| cli/src/command-helpers/generate-options.spec.ts | Updates type import to root, but mock path still targets deep dist/... module. |
| cli/src/cli.ts | Consolidates shared imports to the package root (document loader + option types). |
| calm-plugins/vscode/src/features/validation/validation-service.ts | Moves document-loader imports to the package root. |
| calm-plugins/vscode/src/core/services/navigation-service.ts | Moves document-loader imports to the package root. |
| calm-plugins/vscode/src/core/services/navigation-service.spec.ts | Updates import to root, but mock path still targets deep dist/... module. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rocketstack-matt
approved these changes
Mar 1, 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.
Description
As identified in #2167 (comment)
This pull request refactors imports across both the CLI and VSCode plugin codebases to standardize how shared types and utilities are imported from the
@finos/calm-sharedpackage. The changes remove deep or path-specific imports in favour of importing directly from the package root, which improves maintainability and reduces the risk of breaking changes if internal file structures change.In other words, imports should only be
import {...} from '@finos/shared'.Refactoring and Simplification of Imports:
All imports of
CalmChoice,CalmOption,extractOptions,buildDocumentLoader,DocumentLoader,DocumentLoaderOptions, andValidateOutputFormatare now sourced directly from@finos/calm-sharedinstead of deep paths like@finos/calm-shared/dist/.... This affects both CLI and VSCode plugin files. [1] [2] [3] [4] [5] [6] [7]The shared package's
index.ts(shared/src/index.ts) is updated to exportCalmChoice,CalmOption, andValidateOutputFormatat the top level, enabling the simplified imports.These changes make the codebase easier to maintain and more robust against internal refactors in the shared library.
Type of Change
Affected Components
cli/)calm/)calm-ai/)calm-hub/)calm-hub-ui/)calm-server/)calm-widgets/)docs/)shared/)calm-plugins/vscode/)Commit Message Format ✅
Testing
Checklist