refactor: separate API facade from public contracts - #1787
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: de4cb63f-4a85-432d-a722-697b33e9d49a
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: de4cb63f-4a85-432d-a722-697b33e9d49a
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: de4cb63f-4a85-432d-a722-697b33e9d49a
…rsions Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
|
Copilot resolve the merge conflicts in this pull request |
# Conflicts: # src/test/features/inlineScript/setupEnvironment.unit.test.ts Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
Merged the latest |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: de4cb63f-4a85-432d-a722-697b33e9d49a
|
🔒 Automated review in progress — Bill Schnurr (@bschnurr) is auto-reviewing this PR. |
|
Result: Verification detailsVerification: Isolated verification observed failures whose relationship to this PR could not be determined: Offline dependency bootstrap; this review is not fully verified. Isolated verification observed failures that were not classified as caused by this PR: Dependency and test discovery, Relative import and stale refactor import scan. Summary: The source-copy and package entry-point assertions passed. The API package smoke tests and targeted extension unit tests could not run because offline dependency installation lacked `brace-expansion-2.1.4`, leaving `tsc` unavailable. An additional import scan failed only because the ad-hoc regex matched a commented-out import. Verification is therefore partial, with no PR-related failure observed. Test runs: 1 passed, 3 failed, 2 not run
|
Bill Schnurr (bschnurr)
left a comment
There was a problem hiding this comment.
Approved via Review Center.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: de4cb63f-4a85-432d-a722-697b33e9d49a
|
Result: 🔴 Verification detailsVerification: Isolated verification observed failures that were not classified as caused by this PR: Extension TypeScript test compilation, API package compilation, Offline dependency bootstrap, Relative TypeScript import resolution probe. The relevant tests could not be fully run in the isolated environment; this review is not fully verified. Summary: Verification was blocked by unavailable offline dependencies: `npm ci --offline` failed because `brace-expansion-2.1.4.tgz` was not cached. Consequently, extension and API compilation failed because `tsc` was unavailable, so targeted unit and package smoke tests could not run. An ad-hoc check confirmed all three public source files are copied byte-for-byte into `api/src`. Overall, the PR could not be meaningfully verified. Test runs: 2 passed, 4 failed, 2 not run
❌
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: de4cb63f-4a85-432d-a722-697b33e9d49a
|
Result: Verification detailsVerification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified. Summary: Extension TypeScript compilation, webpack bundling, and 45 targeted unit tests passed. The API package smoke/type tests could not run because the package-local `mve` dependency was unavailable; compilation stopped with `sh: 1: mve: not found`. Verification is therefore partial. Test runs: 4 passed, 1 not run
|
Rich Chiodo (rchiodo)
left a comment
There was a problem hiding this comment.
Approved via Review Center.
This pull request clarifies the distinction between the Python Environments runtime API and the public TypeScript contracts used by the extension and npm package. The API is the runtime mechanism that extensions and automation use to execute operations, while the types define the public contracts and shared data shapes used throughout the codebase and exposed through
@vscode/python-environments.New file structure
src/types.tsPythonEnvironmentApi, environment and package shapes, manager contracts, and event/option types.src/api.tsEXTENSION_ID, and providesPythonEnvironments.api()for resolving the VS Code extension API at runtime.src/publicErrors.tssrc/extensionApi.tsPythonEnvironmentApithat is returned from activation.src/managers/common/models.tsPythonEnvironmentImplandPythonPackageImplmodel implementations.src/managers/common/registeredManagers.tsInternalEnvironmentManagerandInternalPackageManagerto minimize PR impact.Owning feature modules now define their own internal contracts instead of using the old
src/internal.api.tsgrab bag:src/features/envManagers.tsowns environment-manager registry contracts and events.src/features/projectManager.tsowns project-manager contracts and implementation.src/features/creators/projectCreators.tsowns project-creator contracts and implementation.Package and consumer behavior
@vscode/python-environmentsinternally. Shared contracts come from local source files.src/into the package staging area before compiling.Other cleanup
examples/sample extension. External extension authors should use the npm package/public contracts instead of copying a local sample that duplicated API files..jsimport specifiers used by the package-compatible TypeScript sources.Compatibility
No breaking changes are intended. Public names are preserved, internal wrapper names are preserved where possible, and the npm package remains the consumer-facing entry point for external extensions.