feat: add project boundary support to tspconfig.yaml#10242
Draft
feat: add project boundary support to tspconfig.yaml#10242
Conversation
Add `project` field to tspconfig.yaml that marks a config as a project boundary. When present, the directory containing the file becomes the project root with an explicit entrypoint declaration. Changes: - Add TypeSpecProjectConfig and TypeSpecRawProjectConfig types - Add project field to TypeSpecRawConfig and TypeSpecConfig - Add project property to JSON schema validation - Update config loader to parse and normalize project settings - Update CLI entrypoint resolution to check project tspconfig first - Update IDE entrypoint resolver to check project tspconfig first - Update tsp init scaffold to include project: true for non-library templates - Add comprehensive tests for all new functionality Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/52b4adb2-a8c8-4e7c-b9a6-8a3fcfdb2fb6 Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/52b4adb2-a8c8-4e7c-b9a6-8a3fcfdb2fb6 Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update tspconfig.yaml to define project boundaries
feat: add project boundary support to tspconfig.yaml
Apr 1, 2026
commit: |
Member
|
@copilot e2e test are failing, make sure the pnpm and test also pass |
The scaffolded tspconfig.yaml with project: true was rejected by the published compiler version used in e2e tests (which doesn't know about the new field). Remove the automatic addition from scaffold since users can manually opt-in to project: true once the feature is released. Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/e47a1ecd-c8a3-4d1f-af77-277a4b10ea04 Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Contributor
Author
Fixed in 7dac40b. The e2e Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
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.
Today
tspconfig.yamlis purely build config — no project identity, no explicit entrypoint, no project-scoped settings. This implements Phase 1 of the project tspconfig design: project boundary marker and entrypoint resolution.Usage
Changes
config/types.ts): AddedTypeSpecProjectConfig,TypeSpecRawProjectConfig, andprojectfield on both raw and normalized config interfacesconfig-schema.ts):projectvalidates astrue | { entrypoint?: string }viaoneOfconfig-loader.ts):resolveProjectConfig()normalizes raw project config, resolving entrypoint to an absolute path relative to config directory (default:main.tsp)entrypoint-resolution.ts):resolveTypeSpecEntrypointForDirchecks project tspconfig beforepackage.jsontspMainandmain.tspfallbackentrypoint-resolver.ts): At each directory in the walk-up, project tspconfig is checked first. If found, the walk stops — entrypoint is definitively resolvedBackward compatibility
Existing
tspconfig.yamlfiles withoutprojectcontinue to work identically. The project check is additive — only configs withprojectparticipate in the new resolution path.Note:
tsp initdoes not automatically addproject: trueto scaffolded configs, since the published compiler version would reject the unknown field. Users can manually opt-in by addingproject: trueto their tspconfig.yaml.