@overkill-dev/test 0.0.1 → 0.0.3

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Overkill contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json CHANGED
@@ -1,7 +1,32 @@
1
1
  {
2
- "name": "@overkill-dev/test",
3
- "version": "0.0.1",
4
- "description": "Placeholder claiming the npm package name \"@overkill-dev/test\" so a trusted publisher can be configured. See https://github.com/npm/cli/issues/8544.",
5
- "license": "MIT",
6
- "deprecated": "Placeholder published as a workaround so a Trusted Publisher could be configured. See https://github.com/npm/cli/issues/8544."
7
- }
2
+ "author": "Christian Rackerseder <git@echooff.de>",
3
+ "bin": {
4
+ "overkill": "./packages/test/overkill.entry-point.js"
5
+ },
6
+ "bugs": {
7
+ "url": "https://github.com/enormora/overkill/issues"
8
+ },
9
+ "dependencies": {
10
+ "@overkill-dev/run": "0.0.23",
11
+ "cmd-ts": "0.15.0"
12
+ },
13
+ "description": "Standard Overkill distribution and command-line binary.",
14
+ "engines": {
15
+ "node": "^26"
16
+ },
17
+ "exports": {},
18
+ "homepage": "https://github.com/enormora/overkill#readme",
19
+ "keywords": [
20
+ "tdd",
21
+ "test",
22
+ "tests"
23
+ ],
24
+ "license": "MIT",
25
+ "name": "@overkill-dev/test",
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/enormora/overkill.git"
29
+ },
30
+ "type": "module",
31
+ "version": "0.0.3"
32
+ }
@@ -0,0 +1,274 @@
1
+ import { command, flag, multioption, option, restPositionals, runSafely, string, subcommands } from 'cmd-ts';
2
+ const defaultResourceBudgetOverrides = {
3
+ activeResourceCount: null,
4
+ javaScriptEngineHeapBytes: null,
5
+ residentSetBytes: null,
6
+ residentSetGrowthBytesPerSecond: null
7
+ };
8
+ const resourceBudgetNames = new Set([
9
+ 'activeResourceCount',
10
+ 'javaScriptEngineHeapBytes',
11
+ 'residentSetBytes',
12
+ 'residentSetGrowthBytesPerSecond'
13
+ ]);
14
+ const wrapperExitCodes = {
15
+ argumentOrConfig: 3,
16
+ internalCrash: 70,
17
+ pass: 0
18
+ };
19
+ function writeLine(output, text) {
20
+ output.write(text.endsWith('\n') ? text : `${text}\n`);
21
+ }
22
+ function formatUnknownError(error) {
23
+ return error instanceof Error ? error.message : String(error);
24
+ }
25
+ function isInspectableObject(value) {
26
+ return value !== null && typeof value === 'object';
27
+ }
28
+ function isCmdTsOutputTarget(value) {
29
+ return value === 'stderr' || value === 'stdout';
30
+ }
31
+ function isCmdTsExitConfig(value) {
32
+ return isInspectableObject(value) &&
33
+ typeof value.exitCode === 'number' &&
34
+ isCmdTsOutputTarget(value.into) &&
35
+ typeof value.message === 'string';
36
+ }
37
+ function isCmdTsExit(value) {
38
+ return isInspectableObject(value) && isCmdTsExitConfig(value.config);
39
+ }
40
+ function createBudgetOverrides() {
41
+ return { ...defaultResourceBudgetOverrides };
42
+ }
43
+ function isResourceBudgetName(name) {
44
+ return resourceBudgetNames.has(name);
45
+ }
46
+ function parseResourceBudgetName(name) {
47
+ if (isResourceBudgetName(name)) {
48
+ return name;
49
+ }
50
+ throw new TypeError(`Unknown resource budget name: ${name}`);
51
+ }
52
+ function parseResourceBudgetValue(value) {
53
+ if (value === '') {
54
+ throw new TypeError('Resource budget value must not be empty.');
55
+ }
56
+ const parsedValue = Number(value);
57
+ if (!Number.isFinite(parsedValue)) {
58
+ throw new TypeError(`Resource budget value must be numeric: ${value}`);
59
+ }
60
+ return parsedValue;
61
+ }
62
+ function parseResourceBudgetOverride(rawValue) {
63
+ const separatorIndex = rawValue.indexOf('=');
64
+ if (separatorIndex <= 0) {
65
+ throw new TypeError(`Resource budget must use name=value syntax: ${rawValue}`);
66
+ }
67
+ return {
68
+ name: parseResourceBudgetName(rawValue.slice(0, separatorIndex)),
69
+ value: parseResourceBudgetValue(rawValue.slice(separatorIndex + 1))
70
+ };
71
+ }
72
+ function assignResourceBudgetOverride(overrides, override) {
73
+ return {
74
+ ...overrides,
75
+ [override.name]: override.value
76
+ };
77
+ }
78
+ function assertUnusedResourceBudgetName(seenNames, name) {
79
+ if (seenNames.has(name)) {
80
+ throw new TypeError(`Duplicate resource budget name: ${name}`);
81
+ }
82
+ }
83
+ function parseResourceBudgetOverrides(rawValues) {
84
+ let overrides = createBudgetOverrides();
85
+ const seenNames = new Set();
86
+ for (const rawValue of rawValues) {
87
+ const override = parseResourceBudgetOverride(rawValue);
88
+ assertUnusedResourceBudgetName(seenNames, override.name);
89
+ seenNames.add(override.name);
90
+ overrides = assignResourceBudgetOverride(overrides, override);
91
+ }
92
+ return overrides;
93
+ }
94
+ const configPathType = {
95
+ async from(value) {
96
+ return value;
97
+ }
98
+ };
99
+ const resourceBudgetOverridesType = {
100
+ displayName: 'name=value',
101
+ async from(rawValues) {
102
+ return rawValues.length === 0 ? null : parseResourceBudgetOverrides(rawValues);
103
+ }
104
+ };
105
+ function readMeasureResourceUsage(args) {
106
+ if (args.measureResourceUsage || args.resourceBudgetOverrides !== null) {
107
+ return true;
108
+ }
109
+ return null;
110
+ }
111
+ function createRunTestsRequest(args, cwd) {
112
+ return {
113
+ configPath: args.configPath,
114
+ cwd,
115
+ runRequest: {
116
+ baselineUpdateMode: 'none',
117
+ capabilityRestrictions: { mode: 'enabled' },
118
+ capture: 'buffered',
119
+ debug: {
120
+ mode: 'off',
121
+ selectors: []
122
+ },
123
+ execution: { mode: 'profile-default' },
124
+ measureResourceUsage: readMeasureResourceUsage(args),
125
+ order: 'plan',
126
+ paths: args.paths,
127
+ profile: args.profile,
128
+ resourceBudgetOverrides: args.resourceBudgetOverrides,
129
+ resourceUsageSamplingIntervalMilliseconds: null,
130
+ seed: { value: null },
131
+ selection: { kind: 'all' },
132
+ shard: { index: 0, total: 1 },
133
+ verbose: false
134
+ }
135
+ };
136
+ }
137
+ function createListTestsRequest(args, cwd) {
138
+ return {
139
+ configPath: args.configPath,
140
+ cwd,
141
+ listRequest: {
142
+ paths: args.paths,
143
+ profile: args.profile,
144
+ withOrphans: args.withOrphans
145
+ }
146
+ };
147
+ }
148
+ function createOverkillCommand(loadRunner, cwd) {
149
+ const runCommand = command({
150
+ name: 'run',
151
+ args: {
152
+ configPath: option({
153
+ long: 'config',
154
+ type: configPathType,
155
+ defaultValue() {
156
+ return null;
157
+ }
158
+ }),
159
+ measureResourceUsage: flag({ long: 'measure-resource-usage' }),
160
+ profile: option({
161
+ long: 'profile',
162
+ type: string,
163
+ defaultValue() {
164
+ return 'microtest';
165
+ }
166
+ }),
167
+ resourceBudgetOverrides: multioption({
168
+ long: 'resource-budget',
169
+ type: resourceBudgetOverridesType,
170
+ defaultValue() {
171
+ return null;
172
+ }
173
+ }),
174
+ paths: restPositionals({ displayName: 'path' })
175
+ },
176
+ async handler(args) {
177
+ const runner = await loadRunner();
178
+ return await runner.runTests(createRunTestsRequest(args, cwd));
179
+ }
180
+ });
181
+ const listCommand = command({
182
+ name: 'list',
183
+ args: {
184
+ configPath: option({
185
+ long: 'config',
186
+ type: configPathType,
187
+ defaultValue() {
188
+ return null;
189
+ }
190
+ }),
191
+ profile: option({
192
+ long: 'profile',
193
+ type: string,
194
+ defaultValue() {
195
+ return 'microtest';
196
+ }
197
+ }),
198
+ withOrphans: flag({ long: 'with-orphans' }),
199
+ paths: restPositionals({ displayName: 'path' })
200
+ },
201
+ async handler(args) {
202
+ const runner = await loadRunner();
203
+ return await runner.listTests(createListTestsRequest(args, cwd));
204
+ }
205
+ });
206
+ return subcommands({
207
+ name: 'overkill',
208
+ cmds: { list: listCommand, run: runCommand }
209
+ });
210
+ }
211
+ function writeStdoutLines(stdout, result) {
212
+ for (const line of result.stdoutLines) {
213
+ writeLine(stdout, line);
214
+ }
215
+ }
216
+ function writeFallbackDiagnostics(stderr, result) {
217
+ for (const diagnostic of result.fallbackDiagnostics) {
218
+ writeLine(stderr, diagnostic);
219
+ }
220
+ }
221
+ function applyCmdTsExit(request, message, exitCode) {
222
+ writeLine(request.stderr, message);
223
+ request.applyExitCode(exitCode);
224
+ }
225
+ function applyCmdTsSuccessExit(request, message, into) {
226
+ writeLine(into === 'stdout' ? request.stdout : request.stderr, message);
227
+ request.applyExitCode(wrapperExitCodes.pass);
228
+ }
229
+ async function readCmdTsErrorExitCode(request, error) {
230
+ if (error.config.exitCode === 0) {
231
+ applyCmdTsSuccessExit(request, error.config.message, error.config.into);
232
+ return wrapperExitCodes.pass;
233
+ }
234
+ applyCmdTsExit(request, error.config.message, wrapperExitCodes.argumentOrConfig);
235
+ return wrapperExitCodes.argumentOrConfig;
236
+ }
237
+ function applyRunResultExit(request, result) {
238
+ writeStdoutLines(request.stdout, result);
239
+ writeFallbackDiagnostics(request.stderr, result);
240
+ request.applyExitCode(result.exitCode);
241
+ return result.exitCode;
242
+ }
243
+ function isCmdTsRunFailure(result) {
244
+ return isInspectableObject(result) &&
245
+ Object.hasOwn(result, 'error') &&
246
+ isCmdTsExit(result.error);
247
+ }
248
+ function isCmdTsRunSuccess(result) {
249
+ if (!isInspectableObject(result) || !Object.hasOwn(result, 'value')) {
250
+ return false;
251
+ }
252
+ const commandResult = result.value;
253
+ return isInspectableObject(commandResult) && Object.hasOwn(commandResult, 'value');
254
+ }
255
+ async function runWithCmdTs(request) {
256
+ const result = await runSafely(createOverkillCommand(request.loadRunner, request.cwd), Array.from(request.arguments));
257
+ if (isCmdTsRunFailure(result)) {
258
+ return await readCmdTsErrorExitCode(request, result.error);
259
+ }
260
+ if (!isCmdTsRunSuccess(result)) {
261
+ throw new Error('Unexpected command-line parser result.');
262
+ }
263
+ return applyRunResultExit(request, await result.value.value);
264
+ }
265
+ export async function runOverkillCommandLine(request) {
266
+ try {
267
+ return await runWithCmdTs(request);
268
+ }
269
+ catch (error) {
270
+ applyCmdTsExit(request, `Overkill internal error: ${formatUnknownError(error)}`, wrapperExitCodes.internalCrash);
271
+ return wrapperExitCodes.internalCrash;
272
+ }
273
+ }
274
+ //# sourceMappingURL=command-line-runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-line-runner.js","sourceRoot":"","sources":["../../../../../source/packages/test/command-line-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,OAAO,EACP,IAAI,EACJ,WAAW,EACX,MAAM,EACN,eAAe,EACf,SAAS,EACT,MAAM,EACN,WAAW,EAEd,MAAM,QAAQ,CAAC;AAkEhB,MAAM,8BAA8B,GAA4B;IAC5D,mBAAmB,EAAE,IAAI;IACzB,yBAAyB,EAAE,IAAI;IAC/B,gBAAgB,EAAE,IAAI;IACtB,+BAA+B,EAAE,IAAI;CACxC,CAAC;AAEF,MAAM,mBAAmB,GAAwB,IAAI,GAAG,CAAC;IACrD,qBAAqB;IACrB,2BAA2B;IAC3B,kBAAkB;IAClB,iCAAiC;CACpC,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAIlB;IACA,gBAAgB,EAAE,CAAC;IACnB,aAAa,EAAE,EAAE;IAC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O,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/D,CAAC;IAED,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,kBAAkB,CAAC,OAAO,EAAE,MAAM,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACjE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,OAAsC;IAC/E,IAAI,CAAC;QACD,OAAO,MAAM,YAAY,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACtB,cAAc,CACV,OAAO,EACP,4BAA4B,kBAAkB,CAAC,KAAK,CAAC,EAAE,EACvD,gBAAgB,CAAC,aAAa,CACjC,CAAC;QAEF,OAAO,gBAAgB,CAAC,aAAa,CAAC;IAC1C,CAAC;AACL,CAAC"}
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env -S node --permission-audit
2
+ import { runOverkillCommandLine } from "./command-line-runner.js";
3
+ const commandArgumentStartIndex = 2;
4
+ await runOverkillCommandLine({
5
+ arguments: process.argv.slice(commandArgumentStartIndex),
6
+ applyExitCode(exitCode) {
7
+ process.exitCode = exitCode;
8
+ },
9
+ cwd: process.cwd(),
10
+ async loadRunner() {
11
+ const runnerModule = await import("@overkill-dev/run/command-line");
12
+ return runnerModule.commandLineRunner;
13
+ },
14
+ stderr: process.stderr,
15
+ stdout: process.stdout
16
+ });
17
+ //# sourceMappingURL=overkill.entry-point.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overkill.entry-point.js","sourceRoot":"","sources":["../../../../../source/packages/test/overkill.entry-point.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAEpC,MAAM,sBAAsB,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,yBAAyB,CAAC;IACxD,aAAa,CAAC,QAAQ;QAClB,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAChC,CAAC;IACD,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;IAClB,KAAK,CAAC,UAAU;QACZ,MAAM,YAAY,GAAG,MAAM,MAAM,CAAC,gCAAoC,CAAC,CAAC;QAExE,OAAO,YAAY,CAAC,iBAAiB,CAAC;IAC1C,CAAC;IACD,MAAM,EAAE,OAAO,CAAC,MAAM;IACtB,MAAM,EAAE,OAAO,CAAC,MAAM;CACzB,CAAC,CAAC"}
package/readme.md CHANGED
@@ -1,7 +1,28 @@
1
- # @overkill-dev/test
1
+ # `@overkill-dev/test`
2
2
 
3
- This version is a placeholder published only to claim the npm name `@overkill-dev/test` so a Trusted Publisher
4
- can subsequently be configured for it. It contains no real package content and is published already
5
- deprecated.
3
+ Standard user-facing Overkill distribution.
6
4
 
7
- Workaround context: https://github.com/npm/cli/issues/8544
5
+ This package currently ships the public `overkill` binary only. The binary
6
+ parses the minimal `run` command surface and delegates execution to
7
+ `@overkill-dev/run/command-line`.
8
+
9
+ Supported command-line surface:
10
+
11
+ - `overkill run [paths...]`
12
+ - `overkill list [paths...]`
13
+ - `--config <path>`
14
+ - `--profile <name>`
15
+ - `--measure-resource-usage`
16
+ - `--resource-budget <name=value>`
17
+
18
+ `--resource-budget` accepts `activeResourceCount`,
19
+ `javaScriptEngineHeapBytes`, `residentSetBytes`, and
20
+ `residentSetGrowthBytesPerSecond`. Supplying a resource budget enables
21
+ resource usage measurement for that run.
22
+
23
+ When no paths are supplied, `run` and `list` discover files from the selected
24
+ profile's `files.include` and `files.exclude` policy. Explicit file paths run
25
+ directly. Directory paths filter the selected profile's discovered files and
26
+ require that profile policy.
27
+
28
+ The root authoring facade and standard subpaths are later milestones.
package/sbom.cdx.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json",
3
+ "bomFormat": "CycloneDX",
4
+ "specVersion": "1.6",
5
+ "version": 1,
6
+ "metadata": {
7
+ "tools": {
8
+ "components": [
9
+ {
10
+ "type": "application",
11
+ "name": "packtory",
12
+ "version": "0.0.97"
13
+ }
14
+ ]
15
+ },
16
+ "component": {
17
+ "type": "library",
18
+ "name": "@overkill-dev/test",
19
+ "version": "0.0.3",
20
+ "bom-ref": "pkg:npm/@overkill-dev/test@0.0.3",
21
+ "purl": "pkg:npm/@overkill-dev/test@0.0.3"
22
+ }
23
+ },
24
+ "components": [
25
+ {
26
+ "type": "library",
27
+ "name": "@overkill-dev/run",
28
+ "version": "0.0.23",
29
+ "bom-ref": "pkg:npm/@overkill-dev/run@0.0.23",
30
+ "scope": "required",
31
+ "licenses": [
32
+ {
33
+ "expression": "MIT"
34
+ }
35
+ ],
36
+ "purl": "pkg:npm/@overkill-dev/run@0.0.23"
37
+ },
38
+ {
39
+ "type": "library",
40
+ "name": "cmd-ts",
41
+ "version": "0.15.0",
42
+ "bom-ref": "pkg:npm/cmd-ts@0.15.0",
43
+ "scope": "required",
44
+ "licenses": [
45
+ {
46
+ "expression": "MIT"
47
+ }
48
+ ],
49
+ "purl": "pkg:npm/cmd-ts@0.15.0"
50
+ }
51
+ ],
52
+ "dependencies": [
53
+ {
54
+ "ref": "pkg:npm/@overkill-dev/run@0.0.23"
55
+ },
56
+ {
57
+ "ref": "pkg:npm/@overkill-dev/test@0.0.3",
58
+ "dependsOn": [
59
+ "pkg:npm/@overkill-dev/run@0.0.23",
60
+ "pkg:npm/cmd-ts@0.15.0"
61
+ ]
62
+ },
63
+ {
64
+ "ref": "pkg:npm/cmd-ts@0.15.0"
65
+ }
66
+ ]
67
+ }