@forgeax/engine-ecs 0.1.25 → 0.1.26
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": "@forgeax/engine-ecs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.26",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"LICENSE"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@forgeax/engine-math": "0.1.
|
|
42
|
-
"@forgeax/engine-plugin": "0.1.
|
|
43
|
-
"@forgeax/engine-types": "0.1.
|
|
41
|
+
"@forgeax/engine-math": "0.1.26",
|
|
42
|
+
"@forgeax/engine-plugin": "0.1.26",
|
|
43
|
+
"@forgeax/engine-types": "0.1.26"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/node": "^20.14.0"
|
|
@@ -58,8 +58,12 @@ import { World } from '../world';
|
|
|
58
58
|
const NAME = 'register' + 'Component';
|
|
59
59
|
const CALL_PATTERN = `[.](${NAME}|${NAME}Checked)[(]`;
|
|
60
60
|
const FIELD_PATTERN = `${NAME}:`;
|
|
61
|
+
// The repo-wide source scan runs inside the coverage pool alongside 180+
|
|
62
|
+
// instrumented files. Keep the default unit-test budget for normal cases,
|
|
63
|
+
// but allow a contended runner to finish this I/O-only contract gate.
|
|
64
|
+
const SOURCE_SCAN_TIMEOUT_MS = 30_000;
|
|
61
65
|
|
|
62
|
-
function
|
|
66
|
+
function sourceHitsFallback(pattern: string): string[] {
|
|
63
67
|
const expression = new RegExp(pattern);
|
|
64
68
|
const hits: string[] = [];
|
|
65
69
|
const visit = (relativeDir: string): void => {
|
|
@@ -85,20 +89,68 @@ import { World } from '../world';
|
|
|
85
89
|
return hits;
|
|
86
90
|
}
|
|
87
91
|
|
|
92
|
+
function sourceHits(pattern: string): string[] {
|
|
93
|
+
const result = spawnSync(
|
|
94
|
+
'rg',
|
|
95
|
+
[
|
|
96
|
+
'--no-heading',
|
|
97
|
+
'--color=never',
|
|
98
|
+
'--line-number',
|
|
99
|
+
'--glob',
|
|
100
|
+
'*.ts',
|
|
101
|
+
'--glob',
|
|
102
|
+
'*.mjs',
|
|
103
|
+
'--glob',
|
|
104
|
+
'!dist/**',
|
|
105
|
+
'--glob',
|
|
106
|
+
'!node_modules/**',
|
|
107
|
+
pattern,
|
|
108
|
+
...SCAN_DIRS,
|
|
109
|
+
],
|
|
110
|
+
{ cwd: repoRoot, encoding: 'utf8' },
|
|
111
|
+
);
|
|
112
|
+
if (result.error === undefined) {
|
|
113
|
+
if (result.status === 1) return [];
|
|
114
|
+
if (result.status !== 0) {
|
|
115
|
+
throw result.error ?? new Error(`rg exited with status ${result.status}`);
|
|
116
|
+
}
|
|
117
|
+
return result.stdout
|
|
118
|
+
.trimEnd()
|
|
119
|
+
.split('\n')
|
|
120
|
+
.filter(Boolean)
|
|
121
|
+
.map((line) => {
|
|
122
|
+
const separator = line.indexOf(':');
|
|
123
|
+
const lineEnd = line.indexOf(':', separator + 1);
|
|
124
|
+
return `${line.slice(0, separator)}:${line.slice(separator + 1, lineEnd)}:${line
|
|
125
|
+
.slice(lineEnd + 1)
|
|
126
|
+
.trim()}`;
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
return sourceHitsFallback(pattern);
|
|
130
|
+
}
|
|
131
|
+
|
|
88
132
|
describe('ac16-register-component-grep-gate.test.ts', () => {
|
|
89
133
|
describe('AC-16 - register-component call surface is zero repo-wide (w20)', () => {
|
|
90
|
-
it(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
134
|
+
it(
|
|
135
|
+
'layer 1: zero method-call sites for the deleted register* methods',
|
|
136
|
+
() => {
|
|
137
|
+
const hits = sourceHits(CALL_PATTERN);
|
|
138
|
+
expect(hits, `unexpected register-component call sites:\n${hits.join('\n')}`).toEqual([]);
|
|
139
|
+
},
|
|
140
|
+
SOURCE_SCAN_TIMEOUT_MS,
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
it(
|
|
144
|
+
'layer 2: zero mock interface field declarations for the deleted method',
|
|
145
|
+
() => {
|
|
146
|
+
const hits = sourceHits(FIELD_PATTERN);
|
|
147
|
+
expect(
|
|
148
|
+
hits,
|
|
149
|
+
`unexpected register-component field declarations:\n${hits.join('\n')}`,
|
|
150
|
+
).toEqual([]);
|
|
151
|
+
},
|
|
152
|
+
SOURCE_SCAN_TIMEOUT_MS,
|
|
153
|
+
);
|
|
102
154
|
});
|
|
103
155
|
});
|
|
104
156
|
}
|