feat: fold orderable-document-list into monorepo#908
Conversation
fix scrolling, stacking and disable unordered documents
fix: add `type` to the dependency list of data loading hook
increment version
fixes missing 'compose' button in Pane
prevent re-renders on document open + reduce queried data
highlight duplicate orders, change click handling
fix self-referencing variable
add key to force a re-render when switching between items
21acc4c to
f2e9dfd
Compare
|
@copilot fix the knip issues |
Fixed in 3 places (commit
|
|
@copilot also fix the lint errors |
Fixed — deleted the unused |
Adds a dedicated workspace that demonstrates the orderable list UI via orderableDocumentListDeskItem in a custom structure, alongside a second orderableProject schema type for a richer demo. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
a7eeaaa to
cde3f93
Compare
There was a problem hiding this comment.
Pull request overview
Folds the standalone @sanity/orderable-document-list plugin into this monorepo, replacing standalone tooling with monorepo equivalents and wiring it into dev/test-studio, root README, CODEOWNERS, Changesets, and Knip. Behavior is the migrated upstream code (LexoRank-based drag/drop ordering, perspective-aware dedupe) adjusted to satisfy monorepo lint/type rules.
Changes:
- Imports plugin source under
plugins/@sanity/orderable-document-list/with monorepopackage.json,tsconfig*.json,package.config.ts, andvitest.config.ts. - Integrates the plugin into
dev/test-studiovia a new workspace and a kitchen-sink entry. - Adds Changeset (major), root README row, CODEOWNERS rule, and Knip workspace entry.
Reviewed changes
Copilot reviewed 48 out of 49 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Adds @sanity/orderable-document-list row to Current Plugins. |
| pnpm-lock.yaml | Lockfile updates for new workspace and resolved transitive graphs. |
| plugins/@sanity/orderable-document-list/vitest.config.ts | Inlines vitest-package-exports for export tests. |
| plugins/@sanity/orderable-document-list/tsconfig.json | Extends repo check.json. |
| plugins/@sanity/orderable-document-list/tsconfig.build.json | Extends repo build.json, disables isolated declarations. |
| plugins/@sanity/orderable-document-list/src/types.ts | Shared SanityDocumentWithOrder and NewItemPosition types. |
| plugins/@sanity/orderable-document-list/src/OrderableDocumentList.tsx | Class component exposing resetOrder/showIncrements action handlers. |
| plugins/@sanity/orderable-document-list/src/OrderableContext.ts | Context for showIncrements flag. |
| plugins/@sanity/orderable-document-list/src/index.ts | Public API barrel. |
| plugins/@sanity/orderable-document-list/src/index.test.ts | Snapshot-based package exports test. |
| plugins/@sanity/orderable-document-list/src/helpers/resetOrder.ts | Recomputes LexoRank for every doc and commits async. |
| plugins/@sanity/orderable-document-list/src/helpers/reorderDocuments.ts | Computes new ranks/patches for drag-and-drop. |
| plugins/@sanity/orderable-document-list/src/helpers/query.ts | Perspective-aware GROQ for the listening query. |
| plugins/@sanity/orderable-document-list/src/helpers/parseOrderRank.ts | Safe LexoRank parser with fallback. |
| plugins/@sanity/orderable-document-list/src/helpers/initialRank.ts | Computes initial rank from neighbor. |
| plugins/@sanity/orderable-document-list/src/helpers/getFilteredDedupedDocs.ts | Dedupes drafts/published/version docs by perspective. |
| plugins/@sanity/orderable-document-list/src/helpers/constants.ts | ORDER_FIELD_NAME and API_VERSION. |
| plugins/@sanity/orderable-document-list/src/helpers/client.ts | useSanityClient with current perspective stack. |
| plugins/@sanity/orderable-document-list/src/helpers/tests/*.test.ts | Vitest coverage for helpers and dedupe behavior. |
| plugins/@sanity/orderable-document-list/src/fields/orderRankOrdering.ts | Sort ordering by orderRank. |
| plugins/@sanity/orderable-document-list/src/fields/orderRankField.ts | Hidden/read-only field definition with initial-value GROQ. |
| plugins/@sanity/orderable-document-list/src/DraggableList.tsx | Drag-and-drop list, multi-select, patch transaction (sync). |
| plugins/@sanity/orderable-document-list/src/DocumentListWrapper.tsx | Schema validation + OrderableContext provider. |
| plugins/@sanity/orderable-document-list/src/DocumentListQuery.tsx | Listening query, loading/error/empty states. |
| plugins/@sanity/orderable-document-list/src/Document.tsx | Row preview with status indicator and increment buttons. |
| plugins/@sanity/orderable-document-list/src/desk-structure/orderableDocumentListDeskItem.ts | Structure builder list item rendering OrderableDocumentList. |
| plugins/@sanity/orderable-document-list/package.json | Monorepo-compatible package manifest. |
| plugins/@sanity/orderable-document-list/package.config.ts | pkg-utils config with React Compiler + styled-components. |
| plugins/@sanity/orderable-document-list/CHANGELOG.md | Imported historical changelog. |
| plugins/@sanity/orderable-document-list/.releaserc.json | Leftover semantic-release config from standalone repo. |
| plugins/@sanity/orderable-document-list/.prettierrc / .prettierignore | Leftover Prettier config. |
| plugins/@sanity/orderable-document-list/.npmignore | Leftover npm ignore. |
| plugins/@sanity/orderable-document-list/.husky/* | Leftover husky hooks. |
| plugins/@sanity/orderable-document-list/.gitignore / .editorconfig | Leftover repo-level configs. |
| plugins/@sanity/orderable-document-list/.github/workflows/main.yml | Leftover standalone CI workflow. |
| plugins/@sanity/orderable-document-list/.eslintrc / .eslintignore | Leftover ESLint config (repo uses oxlint). |
| knip.jsonc | Adds Knip workspace entry. |
| dev/test-studio/src/orderable-document-list/index.tsx | Example schemas/structure for test studio. |
| dev/test-studio/sanity.config.ts | Registers new workspace and adds plugin to kitchen-sink. |
| dev/test-studio/package.json | Adds workspace dependency. |
| .github/CODEOWNERS | Assigns plugin path to Studio team. |
| .changeset/orderable-document-list-monorepo.md | Major changeset describing breaking changes. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| "extends": "@sanity/semantic-release-preset", | ||
| "branches": ["main", {"name": "studio-v2", "channel": "studio-v2", "range": "0.x.x"}] | ||
| } |
| "sanity", | ||
| "sanity-plugin" | ||
| ], | ||
| "homepage": "https://github.com/sanity-io/plugins/tree/main/plugins/@sanity/orderable-document-list#readme", |
Folds
@sanity/orderable-document-listfrom its standalone repository into this monorepo.Changes
ea04e91bpackage.json,tsconfig.json,tsconfig.build.json,package.config.ts, andvitest.config.tsdev/test-studiofor local developmentREADME.mdandCODEOWNERSto include the pluginMaifestArgs→ManifestArgs