Skip to content

Conversation

@GarthDB
Copy link
Member

@GarthDB GarthDB commented Jan 24, 2026

Overview

This PR adds two major features:

1. Schema Converter Library (@adobe/component-schema-converter)

A new library for bidirectional conversion between the Figma plugin's simplified JSON format and the official Spectrum JSON Schema format.

Features:

  • ✅ Bidirectional conversion (Plugin ↔ Schema)
  • ✅ 296 tests with 96.4% code coverage
  • ✅ Validates all 80 component schemas
  • ✅ 96.3% perfect round-trip (77/80 components)
  • ✅ Supports all property types (string, boolean, dimension, enums, icon refs, color refs)

Test Results:

  • 41/80 components: Byte-for-byte identical round-trip
  • 36/80 components: Cosmetic differences only (property ordering)
  • 3/80 components: Missing advanced JSON Schema features (examples, definitions, oneOf)

2. GitHub PR Workflow (@adobe/component-options-editor)

Adds the ability to create pull requests directly from the Figma plugin.

Features:

  • 🔐 Personal Access Token authentication with secure storage (figma.clientStorage)
  • 🔄 Automatic schema conversion using the converter library
  • 📝 Changeset generation for version management
  • ✨ Support for creating new and updating existing component schemas
  • 🛡️ Comprehensive error handling and user feedback

Documentation:

  • Added docs/CREATE_PR.md with complete user guide
  • Updated README with GitHub integration details

Testing

  • ✅ All converter tests passing (296 tests)
  • ✅ Comprehensive validation against all 80 component schemas
  • ✅ Schema diff tool confirms no breaking changes for 77/80 components
  • ✅ Plugin builds successfully with webpack polyfills for Octokit

Breaking Changes

None - this is a new feature addition.

- Add @adobe/component-schema-converter library with bidirectional conversion
  - Plugin format ↔ Official JSON Schema format
  - 296 tests with 96.4% code coverage
  - Validates all 80 component schemas (96.3% perfect round-trip)

- Add GitHub PR creation workflow to Figma plugin
  - Personal Access Token authentication with secure storage
  - Automatic schema conversion using converter library
  - Changeset generation for version management
  - Support for creating new and updating existing schemas

- Add comprehensive test suite and documentation
@changeset-bot
Copy link

changeset-bot bot commented Jan 24, 2026

⚠️ No Changeset found

Latest commit: 6009cff

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

@GarthDB
Copy link
Member Author

GarthDB commented Jan 24, 2026

Run report for 6009cffe

Total time: 39.5s | Comparison time: 1m 8s | Estimated savings: 28.7s (42.1% faster)

Action Time Status Info
⬛️ SetupProto(0.51.4) 0ms Skipped
🟩 SyncWorkspace 6.8ms Passed
🟩 SyncProject(componentSchemas) 0.3ms Passed
🟩 SyncProject(component-options-editor) 0.4ms Passed
⬛️ SetupToolchain(node:20.17.0) 1.4s Skipped
🟩 InstallWorkspaceDeps(node:20.17.0) 10.9s Passed
🟩 RunTask(component-options-editor:type-check) 11.6s Passed
🟥 RunTask(component-options-editor:lint) 13.2s Failed
⬛️ RunTask(component-options-editor:validate) 0.2ms Skipped
🟩 RunTask(component-options-editor:test) 13.8s Passed
🟩 RunTask(component-options-editor:build) 27.2s Passed
Touched files
packages/component-schema-converter/CHANGELOG.md
packages/component-schema-converter/README.md
packages/component-schema-converter/ava.config.js
packages/component-schema-converter/moon.yml
packages/component-schema-converter/package.json
packages/component-schema-converter/src/converters/index.js
packages/component-schema-converter/src/converters/pluginToSchema.js
packages/component-schema-converter/src/converters/schemaToPlugin.js
packages/component-schema-converter/src/converters/validators.js
packages/component-schema-converter/src/index.d.ts
packages/component-schema-converter/src/index.js
packages/component-schema-converter/src/types/schemas.js
packages/component-schema-converter/src/utils/errorHandling.js
packages/component-schema-converter/src/utils/index.js
packages/component-schema-converter/src/utils/schemaGeneration.js
packages/component-schema-converter/src/utils/typeDetection.js
packages/component-schema-converter/test/ROUND_TRIP_ANALYSIS.md
packages/component-schema-converter/test/comprehensive-validation.test.js
packages/component-schema-converter/test/converters/integration.test.js
packages/component-schema-converter/test/converters/pluginToSchema.test.js
packages/component-schema-converter/test/converters/roundTrip.test.js
packages/component-schema-converter/test/converters/schemaToPlugin.test.js
packages/component-schema-converter/test/converters/validators.test.js
packages/component-schema-converter/test/fixtures/official-schema/action-button.json
packages/component-schema-converter/test/fixtures/official-schema/button.json
packages/component-schema-converter/test/fixtures/official-schema/checkbox.json
packages/component-schema-converter/test/fixtures/plugin-format/action-button-icons.json
packages/component-schema-converter/test/fixtures/plugin-format/button-complete.json
packages/component-schema-converter/test/fixtures/plugin-format/button-simple.json
packages/component-schema-converter/test/fixtures/plugin-format/edge-cases.json
packages/component-schema-converter/test/fixtures/plugin-format/empty-options.json
packages/component-schema-converter/test/utils/schemaGeneration.test.js
packages/component-schema-converter/test/utils/typeDetection.test.js
pnpm-lock.yaml
tools/component-options-editor/README.md
tools/component-options-editor/build/plugin/plugin.js
tools/component-options-editor/build/plugin/plugin.js.map
tools/component-options-editor/build/ui/app/litAppElement.js
tools/component-options-editor/build/ui/app/litAppElement.js.map
tools/component-options-editor/docs/CREATE_PR.md
tools/component-options-editor/manifest.json
tools/component-options-editor/package.json
tools/component-options-editor/src/plugin/plugin.ts
tools/component-options-editor/src/services/changesetGenerator.ts
tools/component-options-editor/src/services/errors.ts
tools/component-options-editor/src/services/githubService.ts
tools/component-options-editor/src/services/prWorkflow.ts
tools/component-options-editor/src/types/github.ts
tools/component-options-editor/src/ui/app/litAppElement.ts
tools/component-options-editor/src/ui/app/templates/githubAuth.ts
tools/component-options-editor/test/services/changesetGenerator.test.js
tools/component-options-editor/webpack.config.cjs

- Format all test and source files with Prettier
- Apply Remark markdown formatting to documentation
- Consistent code style across converter library and plugin
- No functional changes
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.

2 participants