Skip to content

feat(sanity-plugin-media): transfer plugin to monorepo#858

Draft
Copilot wants to merge 531 commits into
mainfrom
copilot/copy-changes-plugin-media
Draft

feat(sanity-plugin-media): transfer plugin to monorepo#858
Copilot wants to merge 531 commits into
mainfrom
copilot/copy-changes-plugin-media

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 29, 2026

  • Scaffold plugin with pnpm generate "copy plugin" (git subtree, history preserved)
  • Install dependencies and fix is-hotkey → is-hotkey-esm import
  • Test studio integration added (dev/test-studio/src/media/)
  • Remove accidentally committed temp files (lint-errors.txt, lint-errors-parsed.txt)
  • Add LICENSE file
  • Replace README.md with content from original repo
  • Add missing dev dependencies (@types/pluralize, @types/react-file-icon, @testing-library/*, jsdom, @types/node)
  • Update CHANGELOG.md header
  • Fix lint errors across ~96 files (styled components, Dialog components, all other components, test files, modules)
  • BLOCKER: Fix syntax error in SearchFacets component (JSX comment {/* oxlint-disable-next-line */} doesn't work - needs to be // oxlint-disable-next-line style)
  • Run pnpm format to completion (blocked by syntax error above)
  • Verify remaining lint error count after fixes
  • Add changeset for major version bump
  • Update root README.md plugin table
  • Ensure format, lint, build, test all pass
  • Run parallel validation

Status: Significant progress but NOT complete

What's done:

  • Plugin fully scaffolded with git subtree preserving history
  • All metadata files in place (LICENSE, README, CHANGELOG, package.json with deps)
  • ~96 source/test files have lint fixes applied by sub-agents (theme API migration, null safety, type assertions, React patterns, etc.)

What still needs work:

  1. Syntax error in SearchFacets component - a sub-agent used {/* oxlint-disable-next-line */} JSX comment syntax which doesn't work for oxlint directives (must use // oxlint-disable-next-line JS comments)
  2. After fixing that, run format + lint to see remaining error count
  3. Some lint errors may remain that need additional passes
  4. Changeset, root README update, and final validation still needed

robinpyon and others added 30 commits February 24, 2021 00:30
Hey Robin 👋

`@sanity/base` is using `@sanity/ui: ^0.33.6`, which forces package managers to download two versions of the library when this plugin is installed. This is making studios throw an error `Cannot read property 'sanity' of undefined`. For more context, see sanity-io/sanity#2190

I'd suggest moving `@sanity/ui` and `styled-components` into `peerDependencies` as those are shipped with Sanity studio. This will make your plugin more resilient in the long run :)
semantic-release-bot and others added 11 commits December 4, 2025 15:17
* fix: allow sanity v5 as peer dependency

* fix(types): match client version, allow only image/file types - not video
…utils (#290)

* chore: setup vitest and test the main plugin actions, components and utils

* fix: lint issues

* fix: copilot pr comments

* fix: add generic error payload for notifications
* feat: add localization support to media plugin configuration and components

You can now enable localization support by passing a `locales` array to the plugin config
…f4126145283bda774f5'

git-subtree-dir: plugins/sanity-plugin-media
git-subtree-mainline: 50eeddf
git-subtree-split: 2265f41
- Use addEventListener instead of onXxx assignment (uploadSanityAsset, generatePreviewBlobUrl)
- Use throwError factory function instead of deprecated direct value (uploadSanityAsset, checkTagName, debugThrottle)
- Migrate studioTheme.color to studioTheme.v2.color (getSchemeColor)
- Migrate studioTheme.container to studioTheme.v2.container (useBreakpointIndex)
- Import ThemeColorSchemeKey and Theme from @sanity/ui/theme (getSchemeColor, sanity-ui.d.ts)
- Use indexed access for index signature types (getDocumentAssetIds)
- Remove unsafe type assertions in type guards (typeGuards)
- Fix isHotkey import to named export (useKeyPress)
- Add useMemo for context values (AssetSourceDispatchContext, DropzoneDispatchContext)
- Simplify useMemo deps for React Compiler (ToolOptionsContext)
- Add null check for ORDER_DICTIONARY access (orders)
- Fix useEffect deps and ref.current in cleanup (useOnScreen, useBreakpointIndex)
- Remove unused @ts-expect-error (plugin.tsx)
- Remove unnecessary type argument (modules/index)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
plugins-studio Error Error Apr 29, 2026 9:54am

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 29, 2026

⚠️ No Changeset found

Latest commit: 4e57025

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

Copilot and others added 2 commits April 29, 2026 07:49
Fix TS2532, no-unsafe-type-assertion, no-deprecated, no-unsafe-optional-chaining,
no-unnecessary-type-conversion, and TS4111 errors across all redux module files.

- Add null guards for Record indexing (TS2532)
- Replace AnyAction with UnknownAction (no-deprecated)
- Replace deprecated empty() with EMPTY (no-deprecated)
- Remove unsafe optional chaining in destructuring (no-unsafe-optional-chaining)
- Remove unnecessary String() conversions and as HttpError assertions
- Use bracket notation for index signature properties (TS4111)
- Add type guard filters on selectors (TS2322)
- Add oxlint-disable comments for necessary type assertions

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI and others added 2 commits April 29, 2026 09:26
- Migrate from deprecated studioTheme/fonts/space/radius to v2 theme API via buildTheme()
- Fix TS2345/TS2532 by adding null coalescing (0) for possibly undefined theme values
- Fix TS4111 by using bracket notation for index signature properties (source, opt)
- Fix TS2322/TS18048 by adding non-null assertions where values are guarded
- Add oxlint-disable comments for necessary type assertions
- Extract Footer from render function to inline JSX element (static-components)
- Move renderDialogs to module level (consistent-function-scoping)
- Add null check for dialog in Dialogs component
- Suppress no-deprecated for WithReferringDocuments (migration not feasible now)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.