Skip to content

Commit a19210e

Browse files
author
DavidQ
committed
Move sanitizeText into src/shared/utils/stringUtils.js and update the exact tool consumers in the shared/tools boundary lane.
1 parent ff636c7 commit a19210e

12 files changed

Lines changed: 39 additions & 17 deletions

File tree

docs/dev/CODEX_COMMANDS.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ MODEL: GPT-5.4-codex
22
REASONING: high
33

44
COMMAND:
5-
Execute docs/pr/BUILD_PR_REPO_STRUCTURE_65_MOVE_MAP_SHARED_TOOLS_BOUNDARY.md exactly.
6-
Move only clearly shared utility files from tools to src/shared.
7-
Update imports accordingly.
8-
Package to:
9-
<project folder>/tmp/BUILD_PR_REPO_STRUCTURE_65_MOVE_MAP_SHARED_TOOLS_BOUNDARY_delta.zip
5+
Execute exactly docs/pr/BUILD_PR_REPO_STRUCTURE_66_MOVE_MAP_SANITIZETEXT_TO_SHARED_STRINGUTILS.md.
6+
Modify only the exact target files listed in the PR doc.
7+
Do not expand scope.
8+
Package the delta zip to:
9+
<project folder>/tmp/BUILD_PR_REPO_STRUCTURE_66_MOVE_MAP_SANITIZETEXT_TO_SHARED_STRINGUTILS_delta.zip

docs/dev/COMMIT_COMMENT.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Enforce shared vs tools boundary by moving pure utilities to src/shared
1+
Move sanitizeText into src/shared/utils/stringUtils.js and update the exact tool consumers in the shared/tools boundary lane.

docs/dev/NEXT_COMMAND.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Next: BUILD_PR_REPO_STRUCTURE_66_MOVE_MAP_GAMES_BOUNDARY
1+
Next: inspect remaining shared/tools boundary candidates and build the next exact slice only if the target files are explicit.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
shared/tools boundary enforcement
1+
- continue shared/tools boundary enforcement with one exact reusable string helper
2+
- move canonical sanitizeText ownership into shared string utils
3+
- update only the listed tool consumers; preserve engine-facing behavior

docs/dev/reports/file_tree.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
tools → shared moves only
1+
docs/pr/BUILD_PR_REPO_STRUCTURE_66_MOVE_MAP_SANITIZETEXT_TO_SHARED_STRINGUTILS.md
2+
docs/dev/codex_commands.md
3+
docs/dev/commit_comment.txt
4+
docs/dev/next_command.txt
5+
docs/dev/reports/file_tree.txt
6+
docs/dev/reports/change_summary.txt
7+
docs/dev/reports/validation_checklist.txt
8+
src/engine/debug/inspectors/shared/inspectorUtils.js
9+
src/shared/utils/stringUtils.js
10+
tools/dev/commandPacks/groupCommandPack.js
11+
tools/dev/commandPacks/overlayCommandPack.js
12+
tools/dev/commandPacks/inspectorCommandPack.js
13+
tools/dev/presets/debugPresetApplier.js
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
only pure utilities moved, imports updated
1+
- single PR purpose only
2+
- exact target files only
3+
- no broad repo scan
4+
- no unrelated helper moves
5+
- no behavior change
6+
- imports/exports resolve after the move

src/engine/debug/inspectors/shared/inspectorUtils.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ inspectorUtils.js
66
*/
77

88
import { asPositiveInteger } from "../../../../shared/utils/numberUtils.js";
9+
import { sanitizeText } from "../../../../shared/utils/stringUtils.js";
910

10-
export function sanitizeText(value) {
11-
return typeof value === "string" ? value.trim() : "";
12-
}
11+
export { sanitizeText };
1312

1413
export function asObject(value) {
1514
return value !== null && typeof value === "object" && !Array.isArray(value)

src/shared/utils/stringUtils.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ export function trimSafe(value) {
22
return typeof value === "string" ? value.trim() : "";
33
}
44

5+
export function sanitizeText(value) {
6+
return typeof value === "string" ? value.trim() : "";
7+
}
8+
59
export function normalizeString(value) {
610
return trimSafe(value);
711
}

tools/dev/commandPacks/groupCommandPack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
import { createResult } from "./commandPackResultUtils.js";
1515
import { getRuntimeAndRegistry } from "../../../src/shared/utils/runtimeRegistryUtils.js";
1616

17-
import { sanitizeText } from "../../../src/engine/debug/inspectors/shared/inspectorUtils.js";
17+
import { sanitizeText } from "../../../src/shared/utils/stringUtils.js";
1818

1919
function buildSnapshot(panelRegistry) {
2020
const panels = panelRegistry.getOrderedPanels(true);

tools/dev/commandPacks/inspectorCommandPack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
} from "./packUtils.js";
1616
import { stringifyValue } from "../../../src/shared/utils/stringifyValueUtils.js";
1717

18-
import { sanitizeText } from "../../../src/engine/debug/inspectors/shared/inspectorUtils.js";
18+
import { sanitizeText } from "../../../src/shared/utils/stringUtils.js";
1919

2020
function asPositiveInt(value, fallback) {
2121
const normalized = Number.isFinite(value) ? Math.floor(Number(value)) : fallback;

0 commit comments

Comments
 (0)