Skip to content

Migrates 'spo applicationcustomizer' and 'spo apppage' commands to Zod. Closes #7320#7427

Open
MartinM85 wants to merge 3 commits into
pnp:mainfrom
MartinM85:feature/7320-migrates-commands-to-zod
Open

Migrates 'spo applicationcustomizer' and 'spo apppage' commands to Zod. Closes #7320#7427
MartinM85 wants to merge 3 commits into
pnp:mainfrom
MartinM85:feature/7320-migrates-commands-to-zod

Conversation

@MartinM85

Copy link
Copy Markdown
Contributor

Closes #7320

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Migrates SharePoint Online (spo) applicationcustomizer and apppage commands from legacy option/validator/telemetry initialization to Zod schema-based parsing/validation, aligning these commands with the newer CLI validation pipeline and updating tests accordingly.

Changes:

  • Added exported options Zod schemas (with aliases) and schema getters for all migrated commands.
  • Replaced legacy validators/option sets with getRefinedSchema() refinements (including option-set enforcement).
  • Updated unit tests to validate via commandInfo.command.getSchemaToParse() using safeParse()/parse() and added unknown-option rejection tests.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/m365/spo/commands/apppage/apppage-set.ts Migrates spo apppage set to Zod schema validation.
src/m365/spo/commands/apppage/apppage-set.spec.ts Updates apppage-set tests to use refined schema parse/safeParse.
src/m365/spo/commands/apppage/apppage-add.ts Migrates spo apppage add to Zod schema validation.
src/m365/spo/commands/apppage/apppage-add.spec.ts Updates apppage-add tests to use refined schema parse/safeParse.
src/m365/spo/commands/applicationcustomizer/applicationcustomizer-set.ts Migrates spo applicationcustomizer set to Zod with refinements for URL, GUIDs, option-set, and “at least one update” rules.
src/m365/spo/commands/applicationcustomizer/applicationcustomizer-set.spec.ts Updates applicationcustomizer-set tests to schema-based validation.
src/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.ts Migrates spo applicationcustomizer remove to Zod with refinements for URL/GUIDs and option-set.
src/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.spec.ts Updates applicationcustomizer-remove tests to schema-based validation.
src/m365/spo/commands/applicationcustomizer/applicationcustomizer-list.ts Migrates spo applicationcustomizer list to Zod with URL refinement and enum scope.
src/m365/spo/commands/applicationcustomizer/applicationcustomizer-list.spec.ts Updates applicationcustomizer-list tests to schema-based validation.
src/m365/spo/commands/applicationcustomizer/applicationcustomizer-get.ts Migrates spo applicationcustomizer get to Zod with URL/GUID and option-set refinements.
src/m365/spo/commands/applicationcustomizer/applicationcustomizer-get.spec.ts Updates applicationcustomizer-get tests to schema-based validation.
src/m365/spo/commands/applicationcustomizer/applicationcustomizer-add.ts Migrates spo applicationcustomizer add to Zod schema validation.
src/m365/spo/commands/applicationcustomizer/applicationcustomizer-add.spec.ts Updates applicationcustomizer-add tests to schema-based validation.

Comment thread src/m365/spo/commands/apppage/apppage-add.ts Outdated
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.

Migrate spo applicationcustomizer and spo apppage commands to Zod

2 participants