GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(contracts): simplify monogram length validation · pingdotgg/t3code@41e4f63

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/contracts
    • package.json
    • src
      • mobile-runtime.test.ts
      • orchestration.ts
  • pnpm-lock.yaml
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/contracts/package.json‎

Copy file name to clipboardExpand all lines: packages/contracts/package.json
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
"test": "vp test run"
2626
},
2727
"dependencies": {
28-
"effect": "catalog:",
29-
"unicode-segmenter": "0.17.3"
28+
"effect": "catalog:"
3029
},
3130
"devDependencies": {
3231
"@effect/vitest": "catalog:",
Collapse file

‎packages/contracts/src/mobile-runtime.test.ts‎

Copy file name to clipboardExpand all lines: packages/contracts/src/mobile-runtime.test.ts
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@ it("loads contracts and validates monograms without Intl.Segmenter", async () =>
1313
const Schema = await import("effect/Schema");
1414
const isMonogram = Schema.is(ProjectMonogramText);
1515

16-
for (const text of ["A", "T3", "e\u0301", "किखि", "\u1100\u1161\u11a8"]) {
16+
for (const text of ["A", "T3", "e\u0301", "किखि", "\u1100\u1161\u11a8", "𐐀𐐁", "A\u200dB"]) {
1717
expect(isMonogram(text), text).toBe(true);
1818
}
1919
for (const text of ["", "ABC", "किखिगि", "\u0301", "A B", "🚀"]) {
2020
expect(isMonogram(text), text).toBe(false);
2121
}
22+
23+
// The lightweight limit counts consonants separately in complex Indic conjuncts.
24+
expect(isMonogram("क्ष्म")).toBe(false);
25+
expect(isMonogram("A\u200dB\u200dC")).toBe(false);
2226
});
Collapse file

‎packages/contracts/src/orchestration.ts‎

Copy file name to clipboardExpand all lines: packages/contracts/src/orchestration.ts
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import * as Schema from "effect/Schema";
33
import * as SchemaIssue from "effect/SchemaIssue";
44
import * as SchemaTransformation from "effect/SchemaTransformation";
55
import * as Struct from "effect/Struct";
6-
import { countGraphemes } from "unicode-segmenter/grapheme";
76
import { OrchestrationMessageContext } from "./composerContext.ts";
87
import { ProviderOptionSelections } from "./model.ts";
98
import { RepositoryIdentity, ThreadEnvMode } from "./environment.ts";
@@ -463,8 +462,11 @@ const ProjectEmoji = TrimmedNonEmptyString.check(Schema.isMaxLength(32));
463462
export const ProjectMonogramText = TrimmedNonEmptyString.check(
464463
Schema.isMaxLength(32),
465464
Schema.isPattern(/^[\p{L}\p{N}][\p{L}\p{N}\p{M}\u200c\u200d]*$/u),
466-
// These contracts also load in Hermes, which does not provide Intl.Segmenter.
467-
Schema.makeFilter((text) => countGraphemes(text) <= 2),
465+
// Approximate monogram length without Intl.Segmenter, which Hermes lacks.
466+
// Normalize composed letters and ignore marks/joiners; complex conjuncts may count as multiple letters.
467+
Schema.makeFilter(
468+
(text) => [...text.normalize("NFC").replace(/[\p{M}\u200c\u200d]/gu, "")].length <= 2,
469+
),
468470
);
469471

470472
export const ProjectIconOverride = Schema.Union([
Collapse file

‎pnpm-lock.yaml‎

Copy file name to clipboardExpand all lines: pnpm-lock.yaml
-8Lines changed: 0 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.