Skip to content

Commit 26b2934

Browse files
committed
feat(platform-objects): author the object_extension type's display pair in zh-CN, ja-JP and es-ES
The bare-type ledger and the label positive control count the new registry type, as they did for queue and assignment_rule. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 0ca1837 commit 26b2934

9 files changed

Lines changed: 24 additions & 26 deletions

‎.changeset/28574-object-extension-package-item.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ A package can now add fields and rules to an object another package defines by s
1818
- **The doors.** Draft, publish, history restore and delete are the doors every item uses. The save, publish and restore doors refuse, with `VALIDATION_ERROR` / 400 and an issue path: a write bound to no package; `defaultRowScope` or `membershipKeys` in the body (the registry's own sentences); a row filed under a name other than its `extend`; an unregistered target; a target outside the package's dependency closure (with the closure prescription the other save doors print); and a `.custom` field without the `__c` suffix (the existing `__c` judge). A body the schema refuses answers 422 `INVALID_METADATA` with the schema's issues. No error code is added.
1919
- **The registry** (`@objectstack/objectql`). A published row registers its whole parsed body as the package's `'extend'` contributor (`SchemaRegistry.registerObjectExtension`), so its fields, validations and indexes appear on every read of the object, and a publish adds the column to the target's table. Every stored-row sync re-registers it (boot, write-through, read hydration), and deleting the row or uninstalling the package withdraws it (`SchemaRegistry.withdrawObjectExtension`). What a manifest's `objectExtensions` register is unchanged.
2020
- **The export** (`@objectstack/runtime`). `GET /packages/:id/export` carries each of the package's extension items as an `objectExtensions` entry that re-installs. A package's `objects` are now only the objects it owns: an object the package extends is no longer exported as an `'own'` object, which re-install refused with `ObjectOwnershipConflictError`.
21-
- **`@objectstack/platform-objects`**: the metadata-forms translation bundles gain the type's `label` and `description` (regenerated; the non-English locales carry the English text until translated).
21+
- **`@objectstack/platform-objects`**: the metadata-forms translation bundles gain the type's `label` and `description`, authored in zh-CN, ja-JP and es-ES.
2222
- **`@objectstack/lint/runtime`** exports `closureDependencyRemedy`, the closure prescription the save doors print.
2323

2424
Two costs, both on purpose: `/meta/types` serves no JSON schema for `object_extension`, and a draft carries no `_diagnostics` badge, because the type is not bound in `BUILTIN_METADATA_TYPE_SCHEMAS` (that map requires the ADR-0010 envelope, which would change the schema a manifest's `objectExtensions` parse with).

‎packages/platform-objects/src/apps/translations/bare-type-display-echo-decisions.test.ts‎

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ describe('#19403 round 7 — the provenance table agrees these leaves are now au
791791
});
792792

793793
describe('#19403 round 7 — the population, DERIVED from the registry and a shape', () => {
794-
it('⭐ the registry and the catalog describe the same 31 metadata types', () => {
794+
it('⭐ the registry and the catalog describe the same 32 metadata types', () => {
795795
// The ratchet's anchor. The catalog is GENERATED from this registry, so a
796796
// new metadata type arrives in both at once — which is what makes the bare
797797
// class below pick up a future unauthored display pair without anybody
@@ -800,23 +800,25 @@ describe('#19403 round 7 — the population, DERIVED from the registry and a sha
800800
// 28 → 29: `sharing_rule` joined it (ADR-0131 D6), bare with a description too.
801801
// 29 → 31: `queue` and `assignment_rule` joined it (ADR-0142 D1/D5), both bare
802802
// with a description, and both authored in the three locales on arrival.
803-
expect(REGISTRY_TYPES.length).toBe(31);
803+
// 31 → 32: `object_extension` joined it (ADR-0146 D10, #28574), bare with a
804+
// description, authored in the three locales on arrival.
805+
expect(REGISTRY_TYPES.length).toBe(32);
804806
expect([...REGISTRY_TYPES].sort()).toEqual(Object.keys(enMetadataForms as Record<string, any>).sort());
805807
});
806808

807809
it('the BARE predicate splits that population, and is read off the SHAPE not a name list', () => {
808810
// Lit.
809-
expect(BARE_TYPES.length).toBe(14);
811+
expect(BARE_TYPES.length).toBe(15);
810812
expect(PANEL_TYPES.length).toBe(17);
811813
expect(BARE_TYPES.length + PANEL_TYPES.length).toBe(REGISTRY_TYPES.length);
812-
for (const type of ['seed', 'mapping', 'api', 'doc', 'book', 'capability', 'picklist', 'sharing_rule', 'queue', 'assignment_rule']) {
814+
for (const type of ['seed', 'mapping', 'api', 'doc', 'book', 'capability', 'picklist', 'sharing_rule', 'queue', 'assignment_rule', 'object_extension']) {
813815
expect(BARE_TYPES, `${type} is bare`).toContain(type);
814816
}
815817
for (const type of AUTHORED_BARE_TYPES) expect(BARE_TYPES, `${type} is bare`).toContain(type);
816-
// 24 leaves: fourteen labels, and a description on the ten that carry one.
817-
expect(BARE_LEAVES.length).toBe(24);
818-
expect(BARE_LEAVES.filter((l) => l.prop === 'label').length).toBe(14);
819-
expect(BARE_LEAVES.filter((l) => l.prop === 'description').length).toBe(10);
818+
// 26 leaves: fifteen labels, and a description on the eleven that carry one.
819+
expect(BARE_LEAVES.length).toBe(26);
820+
expect(BARE_LEAVES.filter((l) => l.prop === 'label').length).toBe(15);
821+
expect(BARE_LEAVES.filter((l) => l.prop === 'description').length).toBe(11);
820822
expect(BARE_LEAVES.every((l) => ['label', 'description'].includes(l.prop))).toBe(true);
821823
});
822824

@@ -835,8 +837,8 @@ describe('#19403 round 7 — the population, DERIVED from the registry and a sha
835837
expect(registryEntry('dataset')?.description, 'dataset carries a registry description like the six').toBeTruthy();
836838
expect(isBare('dataset')).toBe(false);
837839
const described = REGISTRY_TYPES.filter((t) => typeof registryEntry(t)?.description === 'string');
838-
expect([...described].sort()).toEqual(['api', 'assignment_rule', 'book', 'capability', 'dataset', 'doc', 'mapping', 'picklist', 'queue', 'seed', 'sharing_rule']);
839-
expect(described.filter(isBare).sort()).toEqual(['api', 'assignment_rule', 'book', 'capability', 'doc', 'mapping', 'picklist', 'queue', 'seed', 'sharing_rule']);
840+
expect([...described].sort()).toEqual(['api', 'assignment_rule', 'book', 'capability', 'dataset', 'doc', 'mapping', 'object_extension', 'picklist', 'queue', 'seed', 'sharing_rule']);
841+
expect(described.filter(isBare).sort()).toEqual(['api', 'assignment_rule', 'book', 'capability', 'doc', 'mapping', 'object_extension', 'picklist', 'queue', 'seed', 'sharing_rule']);
840842
// And no panel type's own display pair echoes — the exclusion removes only
841843
// leaves that are already decided elsewhere or already authored.
842844
const panelEchoes: string[] = [];
@@ -897,13 +899,13 @@ describe('#19403 round 7 — the population, DERIVED from the registry and a sha
897899
expect(flagged.length).toBe(BARE_LEAVES.length);
898900
});
899901

900-
it('⭐ this class is now DONE — zero of its 24 leaves echoes in all three locales', () => {
902+
it('⭐ this class is now DONE — zero of its 26 leaves echoes in all three locales', () => {
901903
const echoing = BARE_LEAVES.filter((l) =>
902904
TRANSLATED_LOCALES.every(([, forms]) => forms[l.type]?.[l.prop] === l.en),
903905
);
904906
expect(echoing.map((l) => `${l.type}.${l.prop}`)).toEqual([]);
905907
// Lit — and it really walked the class, which a zero alone would not show.
906-
expect(BARE_LEAVES.length).toBe(24);
908+
expect(BARE_LEAVES.length).toBe(26);
907909
});
908910
});
909911

‎packages/platform-objects/src/apps/translations/es-ES.metadata-forms.generated.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,8 @@ export const esESMetadataForms: NonNullable<TranslationData['metadataForms']> =
516516
}
517517
},
518518
object_extension: {
519-
label: "Object Extension",
520-
description: "Fields and rules a package adds to an object another package defines"
519+
label: "Extensión de Objeto",
520+
description: "Campos y reglas que un paquete añade a un objeto que define otro paquete"
521521
},
522522
field: {
523523
label: "Campo",

‎packages/platform-objects/src/apps/translations/es-ES.source-hashes.generated.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
*/
1919

2020
export const esESGeneratedSourceHashes: Readonly<Record<string, string>> = {
21-
"metadataForms.object_extension.description": "431ee9da2d998151",
22-
"metadataForms.object_extension.label": "61e360eb20e33224",
2321
"objects.sys_email.fields.cc_addresses.label": "02946d952cf15623",
2422
"objects.sys_email.fields.error.label": "786fed84bd8d5a32",
2523
"objects.sys_email.fields.message_id.label": "14cd089a4062f4b1",

‎packages/platform-objects/src/apps/translations/ja-JP.metadata-forms.generated.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,8 @@ export const jaJPMetadataForms: NonNullable<TranslationData['metadataForms']> =
516516
}
517517
},
518518
object_extension: {
519-
label: "Object Extension",
520-
description: "Fields and rules a package adds to an object another package defines"
519+
label: "オブジェクト拡張",
520+
description: "パッケージが、別のパッケージの定義するオブジェクトに追加するフィールドとルール"
521521
},
522522
field: {
523523
label: "フィールド",

‎packages/platform-objects/src/apps/translations/ja-JP.source-hashes.generated.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
*/
1919

2020
export const jaJPGeneratedSourceHashes: Readonly<Record<string, string>> = {
21-
"metadataForms.object_extension.description": "431ee9da2d998151",
22-
"metadataForms.object_extension.label": "61e360eb20e33224",
2321
"objects.sys_email.fields.bcc_addresses.label": "8674899b7b6d5126",
2422
"objects.sys_email.fields.cc_addresses.label": "02946d952cf15623",
2523
"objects.sys_email.fields.message_id.label": "14cd089a4062f4b1",

‎packages/platform-objects/src/apps/translations/object-lifecycle-panel-echo-decisions.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1248,7 +1248,9 @@ describe('#19403 round 10 — the verdicts, on the live bundles', () => {
12481248
// 697 since #28158: the action form's `submitText` row (the verb on the
12491249
// param dialog's submit button) — one row label, authored in all three
12501250
// locales.
1251-
expect(translated.length, `${locale} positive control`).toBe(697);
1251+
// 698 since #28574 (ADR-0146 D10): `object_extension` joined the registry
1252+
// with its type-level display pair, authored in all three locales.
1253+
expect(translated.length, `${locale} positive control`).toBe(698);
12521254
}
12531255
// ⭐ DARK — the blindness, executable. On a synthetic two-locale catalog the
12541256
// all-three predicate returns 0 while the per-locale one returns 1, so the

‎packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,8 @@ export const zhCNMetadataForms: NonNullable<TranslationData['metadataForms']> =
516516
}
517517
},
518518
object_extension: {
519-
label: "Object Extension",
520-
description: "Fields and rules a package adds to an object another package defines"
519+
label: "对象扩展",
520+
description: "一个软件包为另一个软件包定义的对象添加的字段和规则"
521521
},
522522
field: {
523523
label: "字段",

‎packages/platform-objects/src/apps/translations/zh-CN.source-hashes.generated.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
*/
1919

2020
export const zhCNGeneratedSourceHashes: Readonly<Record<string, string>> = {
21-
"metadataForms.object_extension.description": "431ee9da2d998151",
22-
"metadataForms.object_extension.label": "61e360eb20e33224",
2321
"objects.sys_email.fields.message_id.label": "14cd089a4062f4b1",
2422
"objects.sys_email_template.fields.id.label": "00b0385c9c152888",
2523
"objects.sys_exchange_rate.fields.id.label": "00b0385c9c152888",

0 commit comments

Comments
 (0)