Skip to content

refactor(scripts): move collection scripts from scripts/plugins to scripts/collections #521

@katriendg

Description

@katriendg

Summary

Move collection-related scripts (Validate-Collections.ps1, Modules/PluginHelpers.psm1) from scripts/plugins/ to a new scripts/collections/ top-level folder. Collection manifests serve both plugin generation and extension packaging; their validation and shared utilities belong at a scope that reflects both consumers.

Motivation

scripts/plugins/ implies the scripts are specific to "Copilot CLI plugin generation." In practice:

  • Validate-Collections.ps1 is referenced by npm run lint:collections-metadata (linting scope)
  • PluginHelpers.psm1 exports functions consumed by both Generate-Plugins.ps1 and Package-Extension.ps1
  • Collection manifests in collections/ are a top-level concern, not a plugin-specific one

A scripts/collections/ directory aligns the script organization with the data it operates on.

Deliverables

  1. Create scripts/collections/ directory
  2. Move Validate-Collections.ps1 to scripts/collections/Validate-Collections.ps1
  3. Move/refactor shared functions from PluginHelpers.psm1 into scripts/collections/Modules/CollectionHelpers.psm1 (collection-specific functions) while keeping plugin-specific functions in scripts/plugins/
  4. Update Generate-Plugins.ps1 to import from the new module location
  5. Update Package-Extension.ps1 import paths
  6. Update package.json npm scripts (lint:collections-metadata, plugin:validate)
  7. Update Pester test paths in scripts/tests/
  8. Update scripts/README.md and copilot-instructions.md project structure section

Acceptance Criteria

  • scripts/collections/ directory exists with relocated scripts
  • npm run lint:collections-metadata runs from new location
  • npm run plugin:generate and npm run plugin:validate work correctly
  • npm run extension:package works correctly
  • All Pester tests pass with updated paths
  • scripts/README.md updated
  • No broken imports or references

Metadata

Metadata

Labels

infrastructureRepository infrastructure and toolingmaintenanceMaintenance work, no version bump

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions