@ai-matrx/associations 0.14.88 → 0.14.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -2
- package/dist/core/index.cjs +32 -1
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +3 -1
- package/dist/core/index.d.ts +3 -1
- package/dist/core/index.js +32 -1
- package/dist/core/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
# Changelog — @ai-matrx/associations
|
|
2
2
|
|
|
3
|
+
## 0.14.89
|
|
4
|
+
|
|
5
|
+
**A kind's plural is real English.** The default plural of a registry label now comes from the new `pluralizeLabel` (exported from core): "Social post analysis" becomes "Social post analyses", "Private contact research" stays as is, and "Code Repository" becomes "Code Repositories". Before this, `label + "s"` printed "analysiss" and "researchs" on the Resources grid. No consumer action required.
|
|
6
|
+
|
|
3
7
|
## 0.14.88
|
|
4
8
|
|
|
5
|
-
|
|
6
|
-
|
|
9
|
+
SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
|
|
10
|
+
so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
|
|
11
|
+
Diff: `git diff 023ace36d2 cc5fee1a63 -- apps/shared/associations/src`
|
|
12
|
+
|
|
13
|
+
Changed shipped source files (1):
|
|
14
|
+
- `apps/shared/associations/src/entity-types.generated.ts`
|
|
7
15
|
|
|
8
16
|
## 0.14.87
|
|
9
17
|
|
package/dist/core/index.cjs
CHANGED
|
@@ -46,6 +46,7 @@ __export(core_exports, {
|
|
|
46
46
|
isContentSourceEdge: () => isContentSourceEdge,
|
|
47
47
|
isMembershipMetadata: () => isMembershipMetadata,
|
|
48
48
|
ok: () => ok,
|
|
49
|
+
pluralizeLabel: () => pluralizeLabel,
|
|
49
50
|
resolveEntityToken: () => resolveEntityToken
|
|
50
51
|
});
|
|
51
52
|
module.exports = __toCommonJS(core_exports);
|
|
@@ -2786,6 +2787,36 @@ function createRpcResultHelpers(errorSink, sessionAttached) {
|
|
|
2786
2787
|
return { ok, err, mapPgError, mapPgErrorPair };
|
|
2787
2788
|
}
|
|
2788
2789
|
|
|
2790
|
+
// src/core/pluralizeLabel.ts
|
|
2791
|
+
var UNCOUNTABLE = /* @__PURE__ */ new Set([
|
|
2792
|
+
"data",
|
|
2793
|
+
"media",
|
|
2794
|
+
"research",
|
|
2795
|
+
"information",
|
|
2796
|
+
"feedback",
|
|
2797
|
+
"content",
|
|
2798
|
+
"software",
|
|
2799
|
+
"evidence",
|
|
2800
|
+
"equipment",
|
|
2801
|
+
"metadata",
|
|
2802
|
+
"knowledge",
|
|
2803
|
+
"news",
|
|
2804
|
+
"series",
|
|
2805
|
+
"species"
|
|
2806
|
+
]);
|
|
2807
|
+
function pluralizeLabel(label) {
|
|
2808
|
+
const m = /^(.*?)([A-Za-z]+)$/.exec(label);
|
|
2809
|
+
const head = m?.[1];
|
|
2810
|
+
const word = m?.[2];
|
|
2811
|
+
if (head === void 0 || word === void 0) return label;
|
|
2812
|
+
const lower = word.toLowerCase();
|
|
2813
|
+
if (UNCOUNTABLE.has(lower)) return label;
|
|
2814
|
+
if (lower.endsWith("sis")) return `${head}${word.slice(0, -2)}es`;
|
|
2815
|
+
if (/[^aeiou]y$/.test(lower)) return `${head}${word.slice(0, -1)}ies`;
|
|
2816
|
+
if (/(s|x|z|ch|sh)$/.test(lower)) return `${head}${word}es`;
|
|
2817
|
+
return `${label}s`;
|
|
2818
|
+
}
|
|
2819
|
+
|
|
2789
2820
|
// src/record-store-nouns.ts
|
|
2790
2821
|
var RECORD_STORE_NOUNS = {
|
|
2791
2822
|
/** The canonical Table token (2026-10-07). */
|
|
@@ -2897,7 +2928,7 @@ function createEntityRegistry(errorSink, initialOverlay) {
|
|
|
2897
2928
|
function getEntityInfo(token) {
|
|
2898
2929
|
const meta = ENTITY_TYPE_METADATA[token] ?? recordStoreMeta(token) ?? retiredTokenMeta(token);
|
|
2899
2930
|
const overlay = overlayByToken[token];
|
|
2900
|
-
const labelPlural = overlay?.labelPlural ??
|
|
2931
|
+
const labelPlural = overlay?.labelPlural ?? pluralizeLabel(meta.label);
|
|
2901
2932
|
const titleColumn = meta.titleColumn;
|
|
2902
2933
|
const contentRole = isContentRole(meta.contentRole) ? meta.contentRole : "destination";
|
|
2903
2934
|
if (meta.contentRole !== null && !isContentRole(meta.contentRole)) {
|