Repository navigation
refactor(ui)!: fold the providers upload context into fields and data-objectstack, retire @object-ui/providers - #30550
Conversation
…-objectstack, retire the package UploadProvider and useUpload move into @object-ui/fields, next to the file, image and avatar widgets that read them. createObjectStackUploadAdapter and its options move into @object-ui/data-objectstack, beside the other fetch logic against an ObjectStack server. The UploadAdapter, UploadOptions and UploadResult contract both sides share goes into @object-ui/types, as DataSource does, because the two packages do not depend on each other. createS3Adapter and createAzureBlobAdapter had no consumer in the workspace or in hotcrm and retire with the package. createObjectUrlAdapter stays as the module-private fallback useUpload answers with when no provider is mounted. Every importer, alias line, mock and the fixed release group are re-pointed; the lockfile is regenerated. Co-Authored-By: Claude <noreply@anthropic.com>
…retired providers README carried Co-Authored-By: Claude <noreply@anthropic.com>
|
domain:ui#1 · os-sales · session_01L6bhgWn6zhNa4LL7VB1rtL Contract-review-claim: session_01L6bhgWn6zhNa4LL7VB1rtL · head 4e1e0e0 · 2026-11-05T15:39Z |
|
domain:ui#1 · os-sales · session_01L6bhgWn6zhNa4LL7VB1rtL Contract reviewServed-tier: Inputs: card #25921 body and all 71 comments; PR #30550 body, file list (61 files, +308/−2132 net; 3186 changed lines under the dispatch count) and the net diff against ① Derived judgments
② Semver level
③ Boundary flagsDev report 6662170794:
④ Design judgmentThe narrowing, read against the published spec on Findings:
Implemented-by: VERDICT: FAIL |
…ring the retired providers README held The changeset now declares the fold as a diff that widens two entries and narrows by retiring a package. Co-Authored-By: Claude <noreply@anthropic.com>
|
domain:ui#1 · os-sales · session_01L6bhgWn6zhNa4LL7VB1rtL Contract-review-claim: session_01L6bhgWn6zhNa4LL7VB1rtL · head 6f59446 · 2026-11-05T16:18Z |
|
domain:ui#1 · os-sales · session_01L6bhgWn6zhNa4LL7VB1rtL Contract reviewServed-tier: Delta review by the same reviewer on the head after record 6662493953 (FAIL at Inputs: card #25921 body and all 73 comments (the two new ones: amendment 4 ① Derived judgmentsUnchanged from 6662493953, items 1–10, all judged right: the three widenings ( Delta judgments on what the READMEs now claim, read against the code at the head: ② Semver level
③ Boundary flagsPatch-round report 6663027806: no The three findings of 6662493953, each closed:
One stale sentence, not a finding: the PR body's Acceptance notes still say the retired README held the only usage guide and "no package README carries it now ... A docs follow-up", which the delta made untrue. The seat may trim it when it next patches the body; it misleads nobody about the tree. The seat's size reading, judged as asked and outside the verdict: the rule text is AGENTS.md §7 (c), "changed lines exceed 3,000 ( Author: ④ Design judgmentUnchanged from 6662493953: the narrowing takes no declared capability away at a consumer; the upload context and the ObjectStack adapter are delivered whole from their new homes with the contract in Findings: none. The must-fix and both should-fixes of 6662493953 are closed on this head (③). Implemented-by: VERDICT: PASS |
|
domain:ui#1 · os-sales · session_01L6bhgWn6zhNa4LL7VB1rtL 维护者速读
席位核对 — ACCEPT · head 6f59446
|
Requested by Sales · project thread
Part of #25921 (the providers/upload fold only; the card's barrel batches and
clearSharedDiscoveryCachestay on it).Clause-②: yes (narrowing)
Metadata-protocol: none
Skills-docs: follow-up #30559
维护者速读
UploadProvider/useUpload搬进@object-ui/fields,连 ObjectStack 存储服务的上传适配器搬进@object-ui/data-objectstack,两边共用的上传契约类型放进@object-ui/types,@object-ui/providers整包退役。@object-ui/providers导入,升级时编译报错,changeset 写了改从哪里导入。回滚就是 revert 本 PR。ui/packages/fields/src/widgets/UploadProvider.tsx(上下文与无 provider 时的本地回退),ui/packages/data-objectstack/src/upload-adapter.ts(三步上传,与原包代码相同),.changeset/25921-providers-upload-fold.md(BREAKING 说明与迁移行)。pnpm --dir ui exec vitest run packages/data-objectstack/src/objectstack-upload-scope-12055.test.ts apps/console/src/__tests__/App.uploadAltitude-10131.test.tsx,预期两个文件全部通过。What changes
@object-ui/providershad one job left: the upload context the file, image and avatar widgets of@object-ui/fieldsupload through, plus the adapters that fill it. This PR moves each piece to the package that owns it and retires the package.@object-ui/typesgainsui/packages/types/src/upload.ts: theUploadAdapter,UploadOptionsandUploadResultinterfaces, unchanged in shape. They live here, asDataSourcedoes, because@object-ui/fieldsand@object-ui/data-objectstackdo not depend on each other and both need them.@object-ui/fieldsgainssrc/widgets/UploadProvider.tsx(UploadProvider,useUpload,UploadProviderProps) and re-exports the three contract types from its entry.AvatarField,FileFieldandImageFieldread it relatively.createObjectUrlAdaptermoves in as a module-private function: it is still theblob:fallbackuseUploadanswers with when no provider is mounted, and it is no longer exported.@object-ui/data-objectstackgainssrc/upload-adapter.ts(createObjectStackUploadAdapter,ObjectStackUploadAdapterOptions): fetch logic against an ObjectStack server, so it sits beside the other fetch logic (ui/AGENTS.md section 3). The three-step presign, PUT and complete flow is the original code. Itsscopeoption stays typed asAPI.UploadScope, and the objectui#12055 test moved with it.createS3Adapter,createAzureBlobAdapter,S3AdapterOptions,AzureBlobAdapterOptions. They had zero consumers in the workspace and zero inobjectstack-ai/hotcrm(shallow clone at6961ab1; every upload name 0 hits, while a control name hits). A host that uploads to its own bucket writes anUploadAdapteragainst@object-ui/types.App.tsx(import only; theUploadProviderwrap is unchanged),ProfilePage.tsx, app-shell'sRecordAttachmentsPanel.tsx,SettingsPage.tsxand one renderer comment, and every test that imported or mocked the package. The@object-ui/providersdependency leaves the console, app-shell and fields manifests, its alias lines leaveui/vitest.config.mtsand four vite configs, and it leaves the.changeset/config.jsonfixed group, the rootCONTRIBUTING.mdpackage table, two gate fixture lists and the lockfile (regenerated withpnpm install --lockfile-only, deletions only).ui/scripts/__tests__/check-doc-links.test.tscounts the decidable links in every package README, and the retired README carried 2 of them (127 on the merge base, 125 here), so its floor moves from 126 to 125 with the measurement in its comment, as the@object-ui/plugin-airetirement did. The site-absolute floor is unchanged (48 measured, floor 39).25921-providers-upload-fold.md(fields and data-objectstack, patch,!, BREAKING paragraph, one FROM line naming the package, ADR-0087 markerruntime-export-retired @object-ui/providers#*) and25921-upload-adapter-contract.md(types, patch, widening).Changed lines: 2482 on the PR (+350 / −2132, 63 files; GitHub reads the two moved files as renames), under the 3000-line threshold (seat correction; AGENTS.md reads the PR's
additions + deletions).dispatch-gatescounts with--no-renames, so it counts the moved code once as deleted and once as added and arrives at about 3,200 lines. 2386 of the deletions are the retired package's own nine files (itsCHANGELOG.mdalone is 1524).Why
The package existed so the widgets and the console could share one upload context. With the theme, data-source and metadata providers retired earlier (objectui#13453), every remaining export belonged to either the widgets or the ObjectStack data adapter.
Tests
Behaviour is not changed, so the existing tests are the proof; they were re-pointed, not rewritten. All runs on
4e1e0e0e(the scripts/ run first on15c54522, see Verification), under the shared verify lock:pnpm --dir ui exec vitest run packages/fields/ packages/data-objectstack/ packages/types/ packages/cli/src/__tests__/workspace-vite.test.ts: 801 files passed, 1 skipped; 16261 tests passed, 7 skipped. This includes the moved objectui#12055 presign-body test and its compile-time pins.pnpm --filter @object-ui/console test(the whole console project, sinceApp.tsxchanged): 298 files, 2939 tests passed, includingApp.uploadAltitude-10131, the threeFormPageupload tests and the fiveProfilePagetests.views/__tests__/file, theActionParamDialog,RecordDetailView, settings and chatbot files that render an upload site, plusWizardForm.nextMidUpload,affordanceGrantMap-12082,uploadInFlightSave): 104 files, 937 tests passed.pnpm --dir ui exec vitest run scripts/: on15c54522169 files passed and 1 failed, the doc-links floor above (expected 125 to be at least 126). With the floor moved,check-doc-links.test.tsalone passes 123/123; the full rerun on the final head is in the report.No ablation: nothing tested changed behaviour.
Acceptance notes
UploadProvider,useUploadandcreateObjectStackUploadAdapterkeep their signatures and bodies, and the presign request body is pinned by the moved objectui#12055 test.WizardForm.nextMidUploadtest used to mock the@object-ui/providersmodule. A mock of the@object-ui/fieldsbarrel would not reach the widgets, which import./UploadProvider.jsrelatively, so the test now mounts the realUploadProviderwith a deferred adapter. It drives the same pending upload.@object-ui/providersthis PR leaves alone, because they are outside its file surface or are historical text that stays true:skills/objectui/guides/project-setup.md:249and:307(governed; they still tell a reader to install@object-ui/providersfor uploads, a follow-up).ui/.claude/skills/objectui-contributor/guides/console-development.md:409(governed).content/docs/releases/v18/18-2.mdx:374(release text).UploadProviderusage guide. It now lives inui/packages/fields/README.md(anUploadProvidersection) andui/packages/data-objectstack/README.md(a File Uploads section), added in the patch round (seat correction).ui/packages/types/src/theme.ts:68,77,ui/packages/types/src/__tests__/p2-spec-exports.test.ts:256,ui/scripts/__tests__/one-authority-per-exported-name-6273.test.ts:616, the objectui#4194 error text quoted inui/packages/plugin-editor/vite.config.ts:64andui/packages/plugin-markdown/vite.config.ts:64, andui/.changeset/13453-*,13464-*,13465-*,25685-*(not read by the root changeset config).Verification
turbo run build --filter=@object-ui/console... --filter='./packages/**' --filter='@objectstack/dogfood^...', 113/113 tasks, exit 0 (consoletscandvite buildincluded).@object-ui/types,fields,data-objectstack,app-shell,plugin-form,console,cli,plugin-editor,plugin-markdown,runner(pnpm --filter PKG run type-check, which compiles each package's tests where it has a test tsconfig).dispatch-gates --commands: 60 commands, all run. 59 exit 0;pnpm --dir ui exec vitest run scripts/exited 1 on15c54522for the doc-links floor above, and its rerun on the final head is in the report.check-adr-0087-registration --base origin/mainverifies@object-ui/providers#*(package deleted, absent from the workspace and the fixed group).check:type-check-debtexit 0 on the final head.pnpm --dir ui run check:spec-symbolsexit 0;check-platform-checklist --changed-from origin/mainexit 0 (0 anchored files); eslint on the 45 changed ui source files, 0 errors (the one react-compiler ref warning inUploadProvider.tsxis the same warning the original file carried).objectstack-ai/hotcrmat6961ab1, 0 hits for@object-ui/providers,UploadProvider,useUpload,createObjectStackUploadAdapter,createS3Adapter,createAzureBlobAdapter,createObjectUrlAdapter, with a control name hitting.!) runs on the final head under the lock; its count goes in the dev report on retire the zero-consumer surface: nine dead modules (2,211 LOC), plugin-ai, runner's publish flag, test-only reset helpers on public barrels, the providers trio, 122 dead i18n keys, root orphans #25921.origin/mainhas moved 5 commits since the base;git merge-tree --write-tree HEAD origin/mainexits 0, and the one shared file (ui/packages/fields/src/index.tsx) is changed in a different region.Human Minimum
packages/specholds no runtime logic. (packages/specuntouched.)pnpm lintpasses. (eslint on every changed ui source file: 0 errors.)main, one pull request.packages/spectouched: not touched, nothing to regenerate.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/. (The retired package'sCHANGELOG.mdis deleted with it, not edited.)Generated by Claude Code