@startsimpli/integrations 0.2.109 → 0.2.110

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startsimpli/integrations",
3
- "version": "0.2.109",
3
+ "version": "0.2.110",
4
4
  "description": "Provider-agnostic types, API clients, hooks, and UI primitives for email + calendar integrations across StartSimpli apps, plus foundry customer email (subpath ./comms).",
5
5
  "license": "MIT",
6
6
  "homepage": "https://startsimpli.com",
@@ -50,9 +50,9 @@
50
50
  "react-native": ">=0.74.0",
51
51
  "@startsimpli/ui-native": ">=0.1.12",
52
52
  "react-native-safe-area-context": ">=4.0.0",
53
- "@startsimpli/utils": "^0.4.17",
54
53
  "@startsimpli/ui": "^0.4.170",
55
- "@startsimpli/auth": "^0.4.49"
54
+ "@startsimpli/auth": "^0.4.49",
55
+ "@startsimpli/utils": "^0.4.17"
56
56
  },
57
57
  "peerDependenciesMeta": {
58
58
  "react": {
@@ -81,6 +81,14 @@ describe('applySchemaTypes: explicit config wins', () => {
81
81
  });
82
82
  });
83
83
 
84
+ describe('plural labels', () => {
85
+ it('leaves a label that is already plural alone and pluralises the rest', () => {
86
+ const c = applySchemaTypes(resolveFoundryApp(base), [{ key: 'agent_settings', label: 'Agent settings' }, { key: 'rule', label: 'Rule' }, { key: 'class', label: 'Class' }, { key: 'party', label: 'Party' }]);
87
+ expect(c.entityTypes.agent_settings.plural).toBe('Agent settings');
88
+ expect([c.entityTypes.rule.plural, c.entityTypes.class.plural, c.entityTypes.party.plural]).toEqual(['Rules', 'Classes', 'Parties']);
89
+ });
90
+ });
91
+
84
92
  describe('needsSchema', () => {
85
93
  it('only when the config leaves something for the schema to fill', () => {
86
94
  expect(needsSchema(resolveFoundryApp(base))).toBe(true);
@@ -5,7 +5,7 @@ import type { FoundryAppConfig, FoundryEntityType, FoundryHomeType, FoundryTabCo
5
5
 
6
6
  const HOME_CARDS = 3;
7
7
  const humanize = (key: string) => key.replace(/[_-]+/g, ' ').replace(/^./, (c) => c.toUpperCase());
8
- const plural = (label: string) => (/[^aeiou]y$/i.test(label) ? `${label.slice(0, -1)}ies` : /(s|x|ch|sh)$/i.test(label) ? `${label}es` : `${label}s`);
8
+ const plural = (label: string) => (/[^aeiou]y$/i.test(label) ? `${label.slice(0, -1)}ies` : /([^s]s)$/i.test(label) ? label : /(ss|x|ch|sh)$/i.test(label) ? `${label}es` : `${label}s`);
9
9
  const tabKey = (type: string) => type.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '');
10
10
 
11
11
  /**