Skip to content

Add url and email plugin setting field types (Issue #175)#189

Open
Sayeem3051 wants to merge 17 commits intoemdash-cms:mainfrom
Sayeem3051:patch-3
Open

Add url and email plugin setting field types (Issue #175)#189
Sayeem3051 wants to merge 17 commits intoemdash-cms:mainfrom
Sayeem3051:patch-3

Conversation

@Sayeem3051
Copy link
Copy Markdown

This PR adds support for url and email plugin setting field types to resolve issue #175.

  • Added url and email to the SettingFieldType union in types.ts
  • Added UrlSettingField and EmailSettingField interfaces with optional default and placeholder fields
  • Added corresponding Zod schemas in manifest-schema.ts discriminated union

Closes #175

Type of change

  • Bug fix
  • Feature (requires approved Discussion)
  • Refactor (no behavior change)
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes
  • pnpm --silent lint:json | jq '.diagnostics | length' returns 0
  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • New features link to an approved Discussion: https://github.com/emdash-cms/emdash/discussions/...

AI-generated code disclosure

  • This PR includes AI-generated code

Screenshots / test output

Add UrlSettingField and EmailSettingField interfaces to the plugin settings schema.

- Updated SettingFieldType union to include "url" and "email"
- Added UrlSettingField and EmailSettingField interfaces
- Updated SettingField union type

Fixes emdash-cms#175
Add Zod schemas for url and email field types to the plugin setting field discriminated union in manifest-schema.ts, to resolve issue emdash-cms#175.
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 3, 2026

⚠️ No Changeset found

Latest commit: 575714f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@Sayeem3051
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Apr 3, 2026
Comment thread packages/core/src/plugins/manifest-schema.ts Outdated
Comment thread packages/core/src/plugins/types.ts Outdated
ascorbic
ascorbic previously approved these changes Apr 11, 2026
Copy link
Copy Markdown
Collaborator

@ascorbic ascorbic left a comment

Choose a reason for hiding this comment

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

Thanks!

Sayeem3051 and others added 3 commits April 12, 2026 17:42
- Added missing closing brace after SecretSettingField's type property
- Removed semicolon from SecretSettingField in the SettingField union type
- This fixes the TypeScript TS(1070) error: 'export' modifier cannot appear on a type member
- Fixes the CI Format check failure on PR emdash-cms#189
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 12, 2026

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@189

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@189

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@189

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@189

emdash

npm i https://pkg.pr.new/emdash@189

create-emdash

npm i https://pkg.pr.new/create-emdash@189

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@189

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@189

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@189

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@189

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@189

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@189

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@189

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@189

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@189

commit: cbbcd42

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds new plugin setting field types (url, email) to the core plugin settings type system and manifest validation, enabling richer admin UI generation and schema support for plugins (Issue #175).

Changes:

  • Extended SettingFieldType / SettingField to include url and email field variants.
  • Added UrlSettingField and EmailSettingField interfaces (with default/placeholder).
  • Updated the plugin manifest Zod discriminated union to recognize url and email setting fields.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
packages/core/src/plugins/types.ts Adds new setting field types/interfaces; updates the SettingField union.
packages/core/src/plugins/manifest-schema.ts Extends manifest validation to accept url and email in admin.settingsSchema.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/core/src/plugins/types.ts Outdated
| BooleanSettingField
| SelectSettingField
| SecretSettingField;
| SecretSettingFiel
Comment on lines +134 to +135
z.object({ ...baseSettingFields, type: z.literal("url") }),
z.object({ ...baseSettingFields, type: z.literal("email") }),
Comment on lines +134 to +135
z.object({ ...baseSettingFields, type: z.literal("url") }),
z.object({ ...baseSettingFields, type: z.literal("email") }),
Added tests for url and email field types in admin.settingsSchema.
@github-actions github-actions bot added size/M and removed size/S labels Apr 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Overlapping PRs

This PR modifies files that are also changed by other open PRs:

This may cause merge conflicts or duplicated work. A maintainer will coordinate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add url and email field types for plugin settings schema

3 participants