Skip to content

feat: add Section library deploy script - #1293

Merged
sas5580 merged 8 commits into
section-libraryfrom
section-library-deploy-script
Aug 28, 2026
Merged

feat: add Section library deploy script#1293
sas5580 merged 8 commits into
section-libraryfrom
section-library-deploy-script

Conversation

@sas5580

@sas5580 sas5580 commented Aug 24, 2026

Copy link
Copy Markdown

Add yextve deploy script. It helps create Section Libraries and Section Library Revisions via the Section Library API.

Some features of this tool:

  • creates Section Library using the id in library/library.json if it doesn't already exist
  • saves account ID, universe, API key, git origin name in .yextrc file so future deploys are simple
  • deploys commit at HEAD
  • waits for artifact build to complete

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9d666bf4-a635-4e6e-ba93-b682377b3736


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sas5580 sas5580 changed the title Section library deploy script feat: Section library deploy script Aug 25, 2026
@sas5580 sas5580 changed the title feat: Section library deploy script feat: add Section library deploy script Aug 25, 2026
Comment thread packages/visual-editor/src/deploy/deploy.test.ts Outdated
benlife5 added a commit that referenced this pull request Aug 27, 2026
1. Adds a cli binary `yextve`
  - Will reconcile with @sas5580's cli in #1293 
  - See `src/cli`
 2. Adds a cli command `validate`
   - has `--yextCI flag` for skipping API validation
- also has individual flags for skipping different parts of validation
   - See `src/cli/commands/validate` 
3. Adds validation scritps
- stage 1: metadata - checks the library.json is ready to be uploaded to
the API
- stage 2: structure - checks that the repo structure, layout jsons, and
component frontmatter are valid
     - This was largely copied from Brian's previous CRs
   - stage 3: code checks
     - XSS checks
     - bans `node:` imports
     - import denylist (per team discussion)
    - see `src/internal/sectionLibraryValidation`
4. Various other clean up
  - adds comments to some types
  - moves a file of types into the `types` dir
  - moves shared validation out of the vite plugin 

Example validation failure:
```bash
$ npm run validate

> pages-visual-editor-starter@0.0.0 validate
> yextve validate

Library metadata: failed (2 errors)
  src/library/library.json: id must be at most 64 characters and may contain only letters, numbers, underscores, and hyphens.
  src/library/library.json: schemaVersion must equal 1.
Repository structure: failed (3 errors)
  src/library/layouts/yext-bar-social-dining/defaultLayout.json: Layout yext-bar-social-dining references missing or incompatible section YextBarSocialDiningMapSection
  src/library/sections/YextBarSocialDiningMapSection.tsx: src/library/sections/YextBarSocialDiningMapSection.tsx config must define a valid id. Accepted form: export const config: SectionConfig = { ... };
  src/library/sections/invalid-dir: Section directories are not supported.
Code checks: failed (3 errors)
  src/library/sections/YextBarSocialDiningBreadcrumbsSection.tsx:3:21: Package 'express' is not permitted in Section Library code.
  src/library/sections/YextBarSocialDiningFaqSection.tsx:29:26: Node built-in module 'node:fs' cannot run in Section Library browser code.
  src/library/sections/YextBarSocialDiningFaqSection.tsx:735:18: dangerouslySetInnerHTML is not permitted in Section Library code.

Validation failed. 8 errors.
```

Example validation success:
```bash
$ npm run validate

> pages-visual-editor-starter@0.0.0 validate
> yextve validate

Library metadata: passed
Repository structure: passed
Code checks: passed

Validation passed. 0 errors.
```

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Comment thread package.json
Comment thread packages/visual-editor/src/bin/cli.ts Outdated
Comment thread packages/visual-editor/package.json Outdated

@benlife5 benlife5 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.

LGTM
Can you merge this into section-library? There's already a cli there, but feel free to overwrite that with your cli setup and register the yextve validate command. Sorry for the overlapping work

Comment thread README.md Outdated
Comment thread packages/visual-editor/src/bin/cli.ts Outdated

@jwartofsky-yext jwartofsky-yext 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.

lgtm!

@sas5580
sas5580 force-pushed the section-library-deploy-script branch from 71c2021 to 17a255d Compare August 28, 2026 16:16
@sas5580
sas5580 changed the base branch from 2026-custom-components-templates to section-library August 28, 2026 16:18
@sas5580

sas5580 commented Aug 28, 2026

Copy link
Copy Markdown
Author

Rebased onto section-library and refactored commands to normalize a bit.

@benlife5 benlife5 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.

🔥

@sas5580
sas5580 merged commit 431406b into section-library Aug 28, 2026
3 checks passed
@sas5580
sas5580 deleted the section-library-deploy-script branch August 28, 2026 17:49
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.

4 participants