Skip to content

Commit 604a2b3

Browse files
refactor(types)!: delete the two field-types orphans nothing reads (#31316)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XUdLNsYDSwYM1UrcfZv5vcX)_ Part of #25921 Clause-②: no (narrowing) Metadata-protocol: none Skills-docs: none — neither name appears under `skills/**` or `content/docs/**` ## 维护者速读 - 改了什么:`@object-ui/types` 删掉 `field-types.ts` 里两个早已标 `@deprecated` 的孤儿类型 `VisibilityCondition` 与 `GeolocationFieldMetadata`,根入口的 "Field Types" 列表同步去掉;这是 #25921 的第 13 批。 - 为什么改:两者在 objectui#12242 之后就没有任何读者(前者给已退役的 `visible_on` 键定型,后者已被移出 `FieldMetadata` 联合,`geolocation` 不是规格字段类型);两个仓库里 0 引用,含散文。 - 风险与回滚:只删类型,构建出的 JavaScript 不变;外部 npm 宿主若 import 了它们会编译失败(未实测,changeset 写了 BREAKING 与替代写法)。`!` patch。回滚即 revert 本 PR。 - 先看:`ui/packages/types/src/field-types.ts`(两处退役注释与联合注释)、`ui/packages/types/src/index.ts`(列表)、`.changeset/25921-types-field-types-orphans.md`。 - 两分钟验证:`node scripts/check-adr-0087-registration.mjs --base origin/main`,预期两名都 `verified ... (export, ui/packages/types/src/field-types.ts)`、退出 0。 - 需要你做的:无,席位落地。 ## What changes Batch 13 as named in the seat's amendment 6714801527 on claim 6714769871 (census option A, `/mnt/project-files/pm-orders/ui/25921-b13-census.md`, `origin/main` `7c523aa1`, hotcrm `6961ab1`). - **`ui/packages/types/src/field-types.ts`**: `VisibilityCondition` and `GeolocationFieldMetadata` are deleted, each replaced by a short retirement comment that names the live replacement (`BaseFieldMetadata.visibleWhen`; the spec's `location` type, `LocationFieldMetadata`). The `FieldMetadata` union's comment no longer names the retired interface. - **`ui/packages/types/src/index.ts`**: both names leave the "Field Types" export-type list, with a one-line note pointing at `field-types.ts`. - **`__tests__/field-metadata-family-retired-12242.test.ts`**: one JSDoc prose bullet reworded so it does not name the retired interface as current. No assertion read either name. - **Changeset** `.changeset/25921-types-field-types-orphans.md`: `!` patch, BREAKING, FROM/TO for each name, `runtime-export-retired` ×2 (FROM spans 1:1), both declaration lines. Every other name of the module stays: each has an outside reader, or is a member of `FieldMetadata` (os_out 56) and so is reached by a kept export's signature. ## Tests - Census per name (`git grep -lw` on `origin/main`, CHANGELOGs excluded): `VisibilityCondition` hits only `field-types.ts` and `index.ts`; `GeolocationFieldMetadata` hits those plus one JSDoc line in the 12242 pin. hotcrm 0 for both. Positive controls in the same module: `FieldMetadata` 56 outside files, `BaseFieldMetadata` 11. No zod twin, not a subpath, README 0, pending changesets 0, predicate-2 surface (`*.zod.ts`, spec contracts, object definitions) 0. - No test was added or removed, and there is no ablation: this deletes two TypeScript-only declarations and changes no tested behaviour. ## Acceptance notes - Left on the card (seat amendment 6714801527): option B (`FieldValidationFunction`, plus the unbarrelled `FieldConstraints` that reads it) has three prose readers in `ui/scripts/__tests__/one-authority-per-exported-name-6273.test.ts`, outside this batch's surface; option C (`UploadedFileMetadata`) is named by the latest fields release note as the host-stored value shape. The seven `Spec*` aliases still wait on the predicate-2 ruling. - `dist/index.js` keeps the `index.ts` retirement note as a comment line (the bundler keeps comments); no export of either name is in `dist/`. ## Verification All on head `0da1e7d5` (base `7c523aa1`). Exit codes captured before any pipe. <details><summary>Package: build, type-check, 388/388 files, 10470/10470 tests</summary> - Under the verification lock: clean `dist` + tsbuildinfo, `pnpm --filter @object-ui/types build`, `pnpm --filter @object-ui/types run type-check`, `pnpm exec vitest run packages/types/` (from `ui/`): `Test Files 388 passed (388)`, `Tests 10470 passed (10470)`, VERDICT command-exit 0. - Built `dist/`: no export of either name; `LocationFieldMetadata` control present in 2 files. The one `dist/index.js` hit is the `index.ts` retirement comment line. - Reverse probe against the built `.d.ts` (a throwaway file in `@object-ui/fields`, removed): `TS2305 ... no exported member 'VisibilityCondition'` and `TS2724 ... no exported member named 'GeolocationFieldMetadata'. Did you mean 'LocationFieldMetadata'?`; no error on the `LocationFieldMetadata` control. </details> <details><summary>Derived gates: 36 derived, 36 run, all exit 0</summary> - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` on `0da1e7d5`: 36 families, each run with stdin closed; every one exit 0, including `check-adr-0087-registration --base origin/main` ("verified: @object-ui/types#VisibilityCondition (export, ui/packages/types/src/field-types.ts), @object-ui/types#GeolocationFieldMetadata (export, ...)"), `check-empty-changeset`, `check-changeset-no-major`, `check:type-check-debt`, `check:published-files` and `pnpm --dir ui exec vitest run scripts/` (170 passed, 2 skipped files; 4996 tests). - `--ran` reconciliation: "36 derived famil(ies) accounted for — 36 run, 0 NOT-MEASURED (a DERIVED zero — all 36 recorded an exit code and none of them is 3)". - Beyond the derivation: `node scripts/check-platform-checklist.mjs --changed-from origin/main` exit 0 (no anchored file in the change set); `pnpm --dir ui check:new-line-citations` exit 0, 0 new citations. </details> <details><summary>Full dogfood battery: 435 passed, 3 skipped files; 3610 passed, 41 skipped tests</summary> - Under the verification lock: `pnpm --filter '@objectstack/dogfood^...' build && pnpm --filter @objectstack/dogfood test`, VERDICT command-exit 0; `Test Files 435 passed | 3 skipped (438)`, `Tests 3610 passed | 41 skipped (3651)`; no failure. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01FEkQ5mTGTu2zw57z7wQ6cn)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01FEkQ5mTGTu2zw57z7wQ6cn Co-authored-by: Claude <noreply@anthropic.com>
1 parent 85d9264 commit 604a2b3

4 files changed

Lines changed: 37 additions & 37 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@object-ui/types': patch
3+
---
4+
5+
refactor(types)!: delete the two `field-types` orphans nothing reads, `VisibilityCondition` and `GeolocationFieldMetadata`
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (runtime-export-retired @object-ui/types#VisibilityCondition, @object-ui/types#GeolocationFieldMetadata) the retired operands are TypeScript-only shapes declared in `field-types.ts`: a condition object that typed the field key objectui#12242 retired, and the interface of a field type that is not a spec `FieldType` and already left the `FieldMetadata` union; nothing in the workspace or in hotcrm imports either from the package entry, they have no zod twin, they are not arms of `AnySchema`, and no packages/spec schema, registered node type, conversion surface or stored shape names them, so there is nothing for `objectstack migrate meta` to rewrite -->
11+
12+
**BREAKING** for a host that imports either of these two types from `@object-ui/types`. Neither had an importer anywhere in the workspace or in hotcrm, so the Console and every `@object-ui/*` package are unaffected. Both were already marked `@deprecated`.
13+
14+
They are **gone from the package, not only from the entry**: `src/field-types.ts` no longer declares them. They were types only, so the built JavaScript is unchanged. Every other field metadata type stays, including every member of `FieldMetadata`.
15+
16+
What leaves, and what to write instead:
17+
18+
- FROM `VisibilityCondition` TO no replacement in this package. It typed the retired `visible_on` key; a field's visibility is `visibleWhen`, a CEL predicate on the field.
19+
- FROM `GeolocationFieldMetadata` TO no replacement. `geolocation` is not a spec field type, so no published object can declare it; the spec's map-point field type is `location`, typed by `LocationFieldMetadata`. The `field:geolocation` widget in `@object-ui/fields` stays registered.

‎ui/packages/types/src/__tests__/field-metadata-family-retired-12242.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@
3333
* keys). A fresh annotated literal carrying one is refused here.
3434
* - `pattern`, `pattern_message` and `validate` RETIRE as `never` tombstones:
3535
* the spec's regex check is the object's `format` validation rule.
36-
* - `GeolocationFieldMetadata` leaves the `FieldMetadata` union: `geolocation`
37-
* is not a spec `FieldType`.
36+
* - the `geolocation` member leaves the `FieldMetadata` union: `geolocation`
37+
* is not a spec `FieldType` (its interface was later retired outright,
38+
* objectstack#25921 batch 13).
3839
*
3940
* `dueLike` was deliberately NOT moved: `@objectstack/spec` declared it on
4041
* `FieldSchema` before it reached the installed release. Now that it has, it

‎ui/packages/types/src/field-types.ts‎

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -219,21 +219,10 @@ export interface BaseFieldMetadata {
219219
unique?: boolean;
220220
}
221221

222-
/**
223-
* Visibility condition type.
224-
*
225-
* @deprecated No member declares it since objectui#12242: it typed the retired
226-
* `BaseFieldMetadata.visible_on`, and no reader ever drew this object shape as
227-
* a gate. A field's visibility is `BaseFieldMetadata.visibleWhen`, a CEL
228-
* predicate.
229-
*/
230-
export type VisibilityCondition = {
231-
field: string;
232-
operator?: '=' | '!=' | '>' | '>=' | '<' | '<=' | 'in';
233-
value?: any;
234-
and?: VisibilityCondition[];
235-
or?: VisibilityCondition[];
236-
};
222+
// `VisibilityCondition` is retired (objectstack#25921, batch 13): it typed the
223+
// `BaseFieldMetadata.visible_on` key objectui#12242 retired, and nothing in this
224+
// workspace or in hotcrm read it. A field's visibility is
225+
// `BaseFieldMetadata.visibleWhen`, a CEL predicate.
237226

238227
/**
239228
* Validation function type.
@@ -1419,22 +1408,12 @@ export interface AddressFieldMetadata extends BaseFieldMetadata {
14191408
type: 'address';
14201409
}
14211410

1422-
/**
1423-
* `geolocation` field metadata — OUT of the {@link FieldMetadata} union since
1424-
* objectui#12242 (ruling A). `geolocation` is not a `@objectstack/spec`
1425-
* `FieldType`: `FieldSchema` refuses it at `type` with `invalid_value`, so no
1426-
* published object can declare it, and the authoring union no longer offers
1427-
* it. The spec's map-point field type is `location`
1428-
* ({@link LocationFieldMetadata}), which renders a different widget.
1429-
*
1430-
* The `field:geolocation` widget itself stays registered in
1431-
* `@object-ui/fields`; only the authoring face stops offering the type value.
1432-
*
1433-
* @deprecated Not a spec field type, and no longer a member of `FieldMetadata`.
1434-
*/
1435-
export interface GeolocationFieldMetadata extends BaseFieldMetadata {
1436-
type: 'geolocation';
1437-
}
1411+
// `GeolocationFieldMetadata` is retired (objectstack#25921, batch 13). It left
1412+
// the `FieldMetadata` union in objectui#12242, because `geolocation` is not a
1413+
// `@objectstack/spec` `FieldType` (`FieldSchema` refuses it at `type`), and
1414+
// nothing in this workspace or in hotcrm read it after that. The spec's
1415+
// map-point field type is `location` (`LocationFieldMetadata`). The
1416+
// `field:geolocation` widget itself stays registered in `@object-ui/fields`.
14381417

14391418
export interface SliderFieldMetadata extends BaseFieldMetadata {
14401419
type: 'slider';
@@ -1504,8 +1483,9 @@ export type FieldMetadata =
15041483
| SignatureFieldMetadata
15051484
| QRCodeFieldMetadata
15061485
| AddressFieldMetadata
1507-
// ⛔ No `GeolocationFieldMetadata` (objectui#12242): `geolocation` is not a
1508-
// spec `FieldType`, so a published object cannot declare it.
1486+
// ⛔ No `geolocation` member (objectui#12242): it is not a spec `FieldType`,
1487+
// so a published object cannot declare it. Its interface is retired too
1488+
// (objectstack#25921, batch 13).
15091489
| SliderFieldMetadata
15101490
| RatingFieldMetadata
15111491
| MasterDetailFieldMetadata;

‎ui/packages/types/src/index.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,6 @@ export type {
576576
export type {
577577
BaseFieldMetadata,
578578
FieldDependsOn,
579-
VisibilityCondition,
580579
FieldValidationFunction,
581580
TextFieldMetadata,
582581
TextareaFieldMetadata,
@@ -616,7 +615,6 @@ export type {
616615
SignatureFieldMetadata,
617616
QRCodeFieldMetadata,
618617
AddressFieldMetadata,
619-
GeolocationFieldMetadata,
620618
SliderFieldMetadata,
621619
RatingFieldMetadata,
622620
MasterDetailFieldMetadata,
@@ -626,6 +624,8 @@ export type {
626624
ObjectIndex,
627625
GridFieldRetiredKey,
628626
} from './field-types.js';
627+
// `VisibilityCondition` and `GeolocationFieldMetadata` were retired from this
628+
// list (objectstack#25921, batch 13) — see the notes in `field-types.ts`.
629629
// objectui#11610 — the `grid` field's retired snake_case field-level keys, each
630630
// mapped to its camelCase replacement: the one list the form-field zod mirror's
631631
// alias refusals and the `grid` widget's named refusal both read.

0 commit comments

Comments
 (0)