Skip to content

Add remote TypeSpec file import to typespec-azure playground#4003

Merged
markcowl merged 8 commits intomainfrom
copilot/add-remote-file-import-again
Mar 16, 2026
Merged

Add remote TypeSpec file import to typespec-azure playground#4003
markcowl merged 8 commits intomainfrom
copilot/add-remote-file-import-again

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

  • Create import.tsx component with TSP-only remote file import button
  • Create import.module.css for import component styles
  • Update main.tsx to include the import button in command bar
  • Update package.json to add @fluentui/react-components, @fluentui/react-icons, @types/react dependencies (removed @typespec/pack)
  • Update tsconfig.json to add vite/client types (for CSS module declarations)
  • Merge latest from main
  • Update pnpm-lock.yaml with all dependency entries
  • Add changeset for the change
  • Fix website build failure: replaced @typespec/pack with direct fetch() implementation
  • Fix TypeScript build errors: add @types/react devDependency + vite/client to tsconfig types
  • Fix version mismatch: align @types/react to ~19.2.7 (monorepo-wide version)
  • Verify: pnpm check-version-mismatch — 0 mismatches
  • Verify: playground website build succeeds
Original prompt

This section details on the original issue you should resolve

<issue_title>Add remote file import feature to the typespec-azure playground</issue_title>
<issue_description>Remote file import is available on the TypeSpec core playground, allowing import of tsp files, or conversion of openapi3 files into typespec for import.

Implement this same feature in typespec-azure, but only for tsp file import.</issue_description>

<agent_instructions>Implement the file upload capability available in the typecpec plaayground for the typespec-azure playground</agent_instructions>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI changed the title [WIP] Add remote file import feature to typespec-azure Add remote TypeSpec file import to typespec-azure playground Mar 4, 2026
@markcowl
Copy link
Member

markcowl commented Mar 4, 2026

@copilot the website build is failing

Copy link
Contributor Author

Copilot AI commented Mar 4, 2026

@copilot the website build is failing

Fixed in b5351de. The build was failing because @typespec/pack is a private (unpublished) package only available within the microsoft/typespec monorepo. I replaced it with a direct fetch() implementation — the import button now fetches the TypeSpec file at the provided URL and loads it into the editor. This handles the single-file import case cleanly without any external private dependency.

Copy link
Member

@markcowl markcowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot please ensure that you pull the latest from main, that you fix any errors with building the repo, and that you fix any errors with spelling or formatting (pnpm cspell, pnpm format)

Copy link
Contributor Author

Copilot AI commented Mar 13, 2026

@copilot please ensure that you pull the latest from main, that you fix any errors with building the repo, and that you fix any errors with spelling or formatting (pnpm cspell, pnpm format)

Done in 0842b48:

  • Merged latest from main
  • Fixed the TypeScript build errors: added @types/react to devDependencies and vite/client to tsconfig types (needed for CSS module declarations in the tsc step)
  • Updated pnpm-lock.yaml with all new dependency entries
  • pnpm cspell — 0 issues found
  • pnpm format:check — all files properly formatted
  • Playground website builds successfully end-to-end

Copilot AI requested a review from markcowl March 13, 2026 23:13
@markcowl
Copy link
Member

markcowl commented Mar 16, 2026

/azp run typespec-azure - PR Tools

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@azure-sdk
Copy link
Collaborator

No changes needing a change description found.

@markcowl
Copy link
Member

@copilot Please pull the latest from main and fix any version mismatches. in installation (pnpm check-version-mismatch),

Copy link
Contributor Author

Copilot AI commented Mar 16, 2026

@copilot Please pull the latest from main and fix any version mismatches. in installation (pnpm check-version-mismatch),

Fixed in 456eae9. The @types/react ~19.2.14 I had added in the previous commit was newer than the ~19.2.7 used by all other packages in the monorepo. Changed it to ~19.2.7pnpm check-version-mismatch now shows 0 mismatches and the playground website build still succeeds.

@azure-sdk
Copy link
Collaborator

azure-sdk commented Mar 16, 2026

You can try these changes here

🛝 Playground 🌐 Website

@markcowl markcowl marked this pull request as ready for review March 16, 2026 22:08
@markcowl markcowl added this pull request to the merge queue Mar 16, 2026
Merged via the queue into main with commit 1e6b294 Mar 16, 2026
27 checks passed
@markcowl markcowl deleted the copilot/add-remote-file-import-again branch March 16, 2026 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add remote file import feature to the typespec-azure playground

4 participants