Adding support for NPM as an extension source#121
Open
michaeljolley wants to merge 1 commit into
Open
Conversation
michaeljolley
requested review from
DHowett,
chatasweetie,
crutkas,
niels9001 and
zadjii-msft
as code owners
July 21, 2026 23:04
niels9001
approved these changes
Jul 23, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds npm as a supported extension install source across the repository’s JSON schemas and CI validation, enabling extensions to reference npm packages in installSources.
Changes:
- Extended
extension.schema.jsonandgallery.schema.jsonto allowinstallSourcesentries with"type": "npm"and anid. - Updated the PR submission checklist to include npm as a valid install source.
- Added npm registry validation in
.github/scripts/validate.py(existence check + warning behavior).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/scripts/validate.py |
Adds npm registry validation and integrates it into extension validation flow. |
.github/schemas/gallery.schema.json |
Allows gallery entries to specify npm install sources. |
.github/schemas/extension.schema.json |
Allows extension manifests to specify npm install sources. |
.github/PULL_REQUEST_TEMPLATE.md |
Updates checklist to mention npm as an install source option. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+427
to
+435
| # The registry "name" field is the canonical package name; compare it to | ||
| # the extension title as a loose sanity check. | ||
| registry_name = data.get("name", "") | ||
| if registry_name and registry_name.strip().lower() != extension_title.strip().lower(): | ||
| warnings.append( | ||
| f"{display_path}: npm package name mismatch — " | ||
| f"npm has \"{registry_name}\" but extension.json title is " | ||
| f"\"{extension_title}\"" | ||
| ) |
| # Scoped packages (e.g. "@scope/name") must have the slash percent-encoded | ||
| # in the URL, but the leading "@" must remain unencoded. | ||
| encoded_id = urllib.parse.quote(package_id, safe="@") | ||
| url = f"{NPM_PKGS_URL}{encoded_id}" |
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.
This pull request adds support for validating npm packages as extension install sources. The changes update the schema definitions to allow specifying npm packages, update documentation accordingly, and enhance the validation script to check npm package existence and provide helpful warnings.
Schema and documentation updates:
.github/schemas/extension.schema.jsonand.github/schemas/gallery.schema.json: Added support for specifying npm packages as valid install sources by allowing"type": "npm"with anidfield. [1] [2].github/PULL_REQUEST_TEMPLATE.md: Updated checklist to mention npm as a valid install source.Validation script enhancements:
.github/scripts/validate.py: Addedvalidate_npm_sourcefunction to check npm package existence via the npm registry, including proper URL encoding for scoped packages. It also warns if the package name does not match the extension title..github/scripts/validate.py: Integrated npm validation into the main validation flow for extensions specifying an npm source..github/scripts/validate.py: Added necessary imports and constants for npm registry access. [1] [2]