@blinkhost/cli 2.6.0 → 2.8.0
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/CHANGELOG.md +13 -0
- package/README.md +534 -2
- package/dist/api.d.ts +2 -2
- package/dist/api.js +57 -8
- package/dist/assistant.js +6 -1
- package/dist/cli.js +162 -9
- package/dist/design.d.ts +5 -0
- package/dist/design.js +82 -0
- package/dist/guidance.d.ts +1 -1
- package/dist/guidance.js +55 -12
- package/dist/javascript-runtime/resource-limits.js +3 -0
- package/dist/javascript-runtime/resource-profiles.js +2 -0
- package/dist/local-dev.d.ts +3 -0
- package/dist/local-dev.js +145 -0
- package/dist/local-development/README.md +410 -0
- package/dist/local-development/artifact-watch.mjs +36 -0
- package/dist/local-development/blinkhost.local.example.json +15 -0
- package/dist/local-development/frontend-proxy.mjs +189 -0
- package/dist/local-development/hello.rs +24 -0
- package/dist/local-development/local-stack.mjs +511 -0
- package/dist/local-development/native-database.mjs +37 -0
- package/dist/local-development/provider-fixtures.example.json +36 -0
- package/dist/local-development/provider-fixtures.mjs +203 -0
- package/dist/local-development/provider-grants.mjs +36 -0
- package/dist/local-development/test-provider-example.mjs +74 -0
- package/dist/local-source-build.d.ts +39 -0
- package/dist/local-source-build.js +225 -0
- package/dist/local-source-watch.d.ts +24 -0
- package/dist/local-source-watch.js +87 -0
- package/dist/local-test-command.d.ts +49 -0
- package/dist/local-test-command.js +128 -0
- package/dist/local-test-config.d.ts +37 -0
- package/dist/local-test-config.js +174 -0
- package/dist/local-test-gates.d.ts +71 -0
- package/dist/local-test-gates.js +247 -0
- package/dist/local-test-go-runner.d.ts +27 -0
- package/dist/local-test-go-runner.js +209 -0
- package/dist/local-test-node-arguments.d.ts +2 -0
- package/dist/local-test-node-arguments.js +14 -0
- package/dist/local-test-node-reporter.d.ts +7 -0
- package/dist/local-test-node-reporter.js +159 -0
- package/dist/local-test-results.d.ts +65 -0
- package/dist/local-test-results.js +163 -0
- package/dist/local-test-rust-runner.d.ts +18 -0
- package/dist/local-test-rust-runner.js +252 -0
- package/dist/local-test-starters.d.ts +3 -0
- package/dist/local-test-starters.js +157 -0
- package/dist/logs.d.ts +43 -0
- package/dist/logs.js +417 -0
- package/dist/module-build-diagnostics.d.ts +10 -0
- package/dist/module-build-diagnostics.js +208 -0
- package/dist/module-build.js +4 -0
- package/dist/release-preparation-diagnostics.d.ts +38 -0
- package/dist/release-preparation-diagnostics.js +204 -0
- package/dist/remote.js +14 -0
- package/dist/templates.d.ts +1 -0
- package/dist/templates.js +4 -1
- package/dist/test-credentials.d.ts +7 -0
- package/dist/test-credentials.js +236 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/workflows.d.ts +39 -2
- package/dist/workflows.js +241 -14
- package/package.json +4 -3
- package/test-runners/python-unittest.py +266 -0
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { stdin } from 'node:process';
|
|
2
|
+
import { parseDocument } from 'yaml';
|
|
3
|
+
import { ApiClient } from './api.js';
|
|
4
|
+
import { CliError, EXIT } from './errors.js';
|
|
5
|
+
const LIMIT = 64 * 1024;
|
|
6
|
+
const BASE = '/api/source-control/test-credential-fixtures/';
|
|
7
|
+
const UUID = /^[a-f0-9]{8}-(?:[a-f0-9]{4}-){3}[a-f0-9]{12}$/;
|
|
8
|
+
function invalid() {
|
|
9
|
+
throw new CliError('Invalid test credential input. Use the documented JSON contract and supply values only through --stdin.', EXIT.validation, 'test_credentials_invalid');
|
|
10
|
+
}
|
|
11
|
+
function object(value, fields) {
|
|
12
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)
|
|
13
|
+
|| Object.keys(value).length !== fields.length || fields.some(key => !Object.hasOwn(value, key)))
|
|
14
|
+
invalid();
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
function uuid(value) {
|
|
18
|
+
if (typeof value !== 'string' || !UUID.test(value) || value === '00000000-0000-0000-0000-000000000000')
|
|
19
|
+
invalid();
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
function integer(value, max = Number.MAX_SAFE_INTEGER) {
|
|
23
|
+
if (typeof value !== 'number' || !Number.isSafeInteger(value) || value < 1 || value > max)
|
|
24
|
+
invalid();
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
function reference(value) {
|
|
28
|
+
const row = object(value, ['name', 'scope', 'version', 'fixture_id', 'fixture_revision']);
|
|
29
|
+
if (typeof row.name !== 'string' || !/^[A-Za-z_][A-Za-z0-9_]{0,127}$/.test(row.name)
|
|
30
|
+
|| !['preview', 'production', 'development'].includes(String(row.scope)))
|
|
31
|
+
invalid();
|
|
32
|
+
return { name: row.name, scope: row.scope, version: integer(row.version, 2_147_483_647),
|
|
33
|
+
fixture_id: uuid(row.fixture_id), fixture_revision: uuid(row.fixture_revision) };
|
|
34
|
+
}
|
|
35
|
+
function selection(value) {
|
|
36
|
+
const row = object(value, ['schema', 'project_id', 'environment_id', 'module_id', 'module_binding', 'credentials']);
|
|
37
|
+
if (row.schema !== 'blinkhost.customer-test-credential-selection/v1')
|
|
38
|
+
invalid();
|
|
39
|
+
const binding = object(row.module_binding, ['schema', 'module', 'artifact_sha256', 'runtime_policy_sha256']);
|
|
40
|
+
if (binding.schema !== 'blinkhost.release-test-module-binding/v1' || typeof binding.module !== 'string'
|
|
41
|
+
|| !/^[A-Za-z0-9_-]{1,64}$/.test(binding.module)
|
|
42
|
+
|| ![binding.artifact_sha256, binding.runtime_policy_sha256].every(v => typeof v === 'string' && /^[a-f0-9]{64}$/.test(v)))
|
|
43
|
+
invalid();
|
|
44
|
+
if (!Array.isArray(row.credentials) || !row.credentials.length || row.credentials.length > 32)
|
|
45
|
+
invalid();
|
|
46
|
+
const refs = row.credentials.map(reference);
|
|
47
|
+
if (new Set(refs.map(ref => ref.fixture_id)).size !== refs.length
|
|
48
|
+
|| refs.some((ref, i) => i > 0 && String(ref.name) <= String(refs[i - 1].name)))
|
|
49
|
+
invalid();
|
|
50
|
+
return { schema: row.schema, project_id: uuid(row.project_id), environment_id: integer(row.environment_id),
|
|
51
|
+
module_id: uuid(row.module_id), module_binding: { schema: binding.schema, module: binding.module,
|
|
52
|
+
artifact_sha256: binding.artifact_sha256, runtime_policy_sha256: binding.runtime_policy_sha256 }, credentials: refs };
|
|
53
|
+
}
|
|
54
|
+
// Read a bounded stream without echoing it, saving it, trimming its values or
|
|
55
|
+
// accepting private input in arguments. JavaScript strings are not zeroizable.
|
|
56
|
+
export function readTestCredentialInput(input = stdin, timeoutMs = 30_000) {
|
|
57
|
+
if (input.isTTY)
|
|
58
|
+
return Promise.reject(new CliError('Pipe test credential JSON through standard input.', EXIT.usage, 'test_credentials_stdin_required'));
|
|
59
|
+
return new Promise((resolve, reject) => {
|
|
60
|
+
const chunks = [];
|
|
61
|
+
let size = 0;
|
|
62
|
+
const finish = (error) => {
|
|
63
|
+
clearTimeout(timer);
|
|
64
|
+
input.off('data', data).off('end', end).off('error', failed).off('close', closed);
|
|
65
|
+
input.pause();
|
|
66
|
+
try {
|
|
67
|
+
if (error) {
|
|
68
|
+
input.destroy();
|
|
69
|
+
reject(error);
|
|
70
|
+
}
|
|
71
|
+
else
|
|
72
|
+
resolve(new TextDecoder('utf-8', { fatal: true, ignoreBOM: true }).decode(Buffer.concat(chunks, size)));
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
reject(new CliError('Test credential input must be valid UTF-8 JSON.', EXIT.validation, 'test_credentials_invalid'));
|
|
76
|
+
}
|
|
77
|
+
finally {
|
|
78
|
+
for (const chunk of chunks)
|
|
79
|
+
chunk.fill(0);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
const failed = () => finish(new CliError('Test credential input could not be read.', EXIT.filesystem, 'test_credentials_input_failed'));
|
|
83
|
+
const closed = () => finish(new CliError('Test credential input closed before completion.', EXIT.filesystem, 'test_credentials_input_failed'));
|
|
84
|
+
const end = () => finish();
|
|
85
|
+
const data = (chunk) => {
|
|
86
|
+
const bytes = Buffer.from(chunk);
|
|
87
|
+
size += bytes.length;
|
|
88
|
+
if (size > LIMIT) {
|
|
89
|
+
bytes.fill(0);
|
|
90
|
+
finish(new CliError('Test credential JSON must not exceed 64 KiB.', EXIT.validation, 'test_credentials_too_large'));
|
|
91
|
+
}
|
|
92
|
+
else
|
|
93
|
+
chunks.push(bytes);
|
|
94
|
+
};
|
|
95
|
+
const timer = setTimeout(() => finish(new CliError('Test credential input timed out.', EXIT.network, 'test_credentials_input_timeout')), timeoutMs);
|
|
96
|
+
input.on('data', data).once('end', end).once('error', failed).once('close', closed);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function document(raw, action) {
|
|
100
|
+
try {
|
|
101
|
+
if (!raw.length || Buffer.byteLength(raw) > LIMIT)
|
|
102
|
+
invalid();
|
|
103
|
+
// Bound parser depth independently of byte size. JSON.parse enforces JSON
|
|
104
|
+
// syntax; the YAML JSON parser detects duplicate (including escaped) keys.
|
|
105
|
+
let depth = 0, quoted = false, escaped = false;
|
|
106
|
+
for (const char of raw) {
|
|
107
|
+
if (quoted) {
|
|
108
|
+
if (escaped)
|
|
109
|
+
escaped = false;
|
|
110
|
+
else if (char === '\\')
|
|
111
|
+
escaped = true;
|
|
112
|
+
else if (char === '"')
|
|
113
|
+
quoted = false;
|
|
114
|
+
}
|
|
115
|
+
else if (char === '"')
|
|
116
|
+
quoted = true;
|
|
117
|
+
else if (char === '{' || char === '[') {
|
|
118
|
+
if (++depth > 12)
|
|
119
|
+
invalid();
|
|
120
|
+
}
|
|
121
|
+
else if (char === '}' || char === ']')
|
|
122
|
+
depth--;
|
|
123
|
+
}
|
|
124
|
+
const parsed = JSON.parse(raw);
|
|
125
|
+
if (parseDocument(raw, { schema: 'json', uniqueKeys: true }).errors.length)
|
|
126
|
+
invalid();
|
|
127
|
+
const row = object(parsed, action === 'revoke' ? ['selection'] : ['selection', 'values', 'replaces']);
|
|
128
|
+
const selected = selection(row.selection);
|
|
129
|
+
if (action !== 'revoke') {
|
|
130
|
+
const values = object(row.values, selected.credentials.map(ref => String(ref.name)));
|
|
131
|
+
for (const value of Object.values(values)) {
|
|
132
|
+
if (typeof value !== 'string' || value.includes('\0') || Buffer.from(value).toString('utf8') !== value
|
|
133
|
+
|| Buffer.byteLength(value) > 16 * 1024)
|
|
134
|
+
invalid();
|
|
135
|
+
}
|
|
136
|
+
if (action === 'create') {
|
|
137
|
+
if (row.replaces !== null)
|
|
138
|
+
invalid();
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
const previous = selection(row.replaces);
|
|
142
|
+
const old = previous.credentials;
|
|
143
|
+
if (JSON.stringify({ ...previous, credentials: [] }) !== JSON.stringify({ ...selected, credentials: [] })
|
|
144
|
+
|| old.length !== selected.credentials.length || old.some((ref, i) => {
|
|
145
|
+
const next = selected.credentials[i];
|
|
146
|
+
return ref.fixture_revision === next.fixture_revision
|
|
147
|
+
|| JSON.stringify({ ...ref, fixture_revision: null }) !== JSON.stringify({ ...next, fixture_revision: null });
|
|
148
|
+
}))
|
|
149
|
+
invalid();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return { ...row, selection: selected };
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
invalid();
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
function timestamp(value) {
|
|
159
|
+
if (typeof value !== 'string' || !/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.\d{1,6})?(?:Z|[+-]\d\d:\d\d)$/.test(value)
|
|
160
|
+
|| !Number.isFinite(Date.parse(value)))
|
|
161
|
+
invalid();
|
|
162
|
+
}
|
|
163
|
+
function metadata(value, after) {
|
|
164
|
+
const body = object(value, ['fixtures', 'next_after']);
|
|
165
|
+
if (!Array.isArray(body.fixtures) || body.fixtures.length > 100)
|
|
166
|
+
invalid();
|
|
167
|
+
let previous = after || '';
|
|
168
|
+
const fixtures = body.fixtures.map(value => {
|
|
169
|
+
const row = object(value, ['id', 'fixture_id', 'revision', 'name', 'scope', 'version', 'module_name', 'created_at', 'revoked_at']);
|
|
170
|
+
const id = uuid(row.id);
|
|
171
|
+
if (id <= previous || typeof row.module_name !== 'string' || !/^[A-Za-z0-9_-]{1,64}$/.test(row.module_name))
|
|
172
|
+
invalid();
|
|
173
|
+
previous = id;
|
|
174
|
+
reference({ name: row.name, scope: row.scope, version: row.version, fixture_id: row.fixture_id, fixture_revision: row.revision });
|
|
175
|
+
timestamp(row.created_at);
|
|
176
|
+
if (row.revoked_at !== null)
|
|
177
|
+
timestamp(row.revoked_at);
|
|
178
|
+
return row;
|
|
179
|
+
});
|
|
180
|
+
if (body.next_after !== null && (fixtures.length !== 100 || uuid(body.next_after) !== previous))
|
|
181
|
+
invalid();
|
|
182
|
+
return { fixtures, next_after: body.next_after };
|
|
183
|
+
}
|
|
184
|
+
export async function runTestCredentials(input, profile, source = stdin) {
|
|
185
|
+
const args = [...input];
|
|
186
|
+
const action = args.shift();
|
|
187
|
+
let path, raw, selected, after;
|
|
188
|
+
if (action === 'list') {
|
|
189
|
+
const options = {};
|
|
190
|
+
while (args.length) {
|
|
191
|
+
const flag = args.shift();
|
|
192
|
+
const value = args.shift();
|
|
193
|
+
if (!['--project', '--environment', '--module', '--after'].includes(flag) || !value || options[flag])
|
|
194
|
+
invalid();
|
|
195
|
+
options[flag] = value;
|
|
196
|
+
}
|
|
197
|
+
if (!/^[1-9][0-9]*$/.test(options['--environment'] || ''))
|
|
198
|
+
invalid();
|
|
199
|
+
after = options['--after'] === undefined ? undefined : uuid(options['--after']);
|
|
200
|
+
path = `${BASE}${uuid(options['--project'])}/${integer(Number(options['--environment']))}/${uuid(options['--module'])}/`;
|
|
201
|
+
if (after)
|
|
202
|
+
path += `?after=${after}`;
|
|
203
|
+
}
|
|
204
|
+
else if (['create', 'rotate', 'revoke'].includes(action)) {
|
|
205
|
+
if (args.length !== 1 || args[0] !== '--stdin')
|
|
206
|
+
invalid();
|
|
207
|
+
raw = await readTestCredentialInput(source);
|
|
208
|
+
selected = document(raw, action).selection;
|
|
209
|
+
path = `${BASE}${selected.project_id}/${selected.environment_id}/${selected.module_id}/`;
|
|
210
|
+
}
|
|
211
|
+
else
|
|
212
|
+
invalid();
|
|
213
|
+
try {
|
|
214
|
+
const client = await ApiClient.create(profile);
|
|
215
|
+
const result = await client.request(path, { method: action === 'list' ? 'GET' : action === 'revoke' ? 'DELETE' : 'POST',
|
|
216
|
+
...(raw === undefined ? {} : { body: raw }) }, LIMIT);
|
|
217
|
+
if (action === 'list')
|
|
218
|
+
return metadata(result, after);
|
|
219
|
+
if (action === 'revoke') {
|
|
220
|
+
if (result !== null)
|
|
221
|
+
invalid();
|
|
222
|
+
return { revoked: true };
|
|
223
|
+
}
|
|
224
|
+
const response = object(result, ['credentials']);
|
|
225
|
+
if (!Array.isArray(response.credentials) || response.credentials.length > 32
|
|
226
|
+
|| JSON.stringify(response.credentials.map(reference)) !== JSON.stringify(selected.credentials))
|
|
227
|
+
invalid();
|
|
228
|
+
return { credentials: selected.credentials };
|
|
229
|
+
}
|
|
230
|
+
catch (error) {
|
|
231
|
+
// A server or transport error may contain a reflected value. Do not expose
|
|
232
|
+
// its body, request ID, arbitrary code or exception text, even in JSON mode.
|
|
233
|
+
throw new CliError('Test credential operation could not be confirmed. Check access and list fixture metadata before retrying a write.', error instanceof CliError ? error.exitCode : EXIT.remote, 'test_credentials_unconfirmed');
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
//# sourceMappingURL=test-credentials.js.map
|
package/dist/version.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const VERSION = "2.
|
|
1
|
+
export declare const VERSION = "2.8.0";
|
|
2
2
|
export declare const DOCUMENTATION_URL = "https://app.blinkhost.me/docs/source-control/cli";
|
|
3
3
|
export declare const RELEASES_URL = "https://github.com/blinkhost-ltd/blinkhost-cli/releases";
|
|
4
4
|
export declare function supportedNodeVersion(version?: string): boolean;
|
package/dist/version.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const VERSION = '2.
|
|
1
|
+
export const VERSION = '2.8.0';
|
|
2
2
|
export const DOCUMENTATION_URL = 'https://app.blinkhost.me/docs/source-control/cli';
|
|
3
3
|
export const RELEASES_URL = 'https://github.com/blinkhost-ltd/blinkhost-cli/releases';
|
|
4
4
|
export function supportedNodeVersion(version = process.versions.node) {
|
package/dist/workflows.d.ts
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { type LocalDevWriter } from './local-dev.js';
|
|
2
|
+
import { type LocalTestCommandResult } from './local-test-command.js';
|
|
3
|
+
import { type LocalCheckDefinition, type LocalProjectDiscovery } from './local-test-config.js';
|
|
4
|
+
import { type LocalTestGateReceipt } from './local-test-gates.js';
|
|
5
|
+
import { type LocalTestReport, type LocalTestCounts } from './local-test-results.js';
|
|
6
|
+
export declare function runDev(input: string[], json?: boolean, write?: LocalDevWriter): Promise<unknown>;
|
|
7
|
+
export interface LocalProjectCheckResult {
|
|
8
|
+
schema: 'blinkhost.local-project-checks/v1';
|
|
9
|
+
validated: true;
|
|
10
|
+
status: 'validation_only' | 'build_only' | 'test_command_succeeded' | 'checks_succeeded' | 'tests_passed' | 'no_tests' | 'skipped' | 'unsupported';
|
|
11
|
+
command?: string;
|
|
12
|
+
exit_code?: number;
|
|
13
|
+
build?: 'not_required';
|
|
14
|
+
tests_executed: number | null;
|
|
15
|
+
test_evidence: 'not_run' | 'command_exit_only' | 'customer_runner_reported' | 'mixed';
|
|
16
|
+
test_counts?: LocalTestCounts;
|
|
17
|
+
coverage: {
|
|
18
|
+
native: 'not_collected' | 'customer_runner_reported';
|
|
19
|
+
wasm: 'not_collected' | 'customer_runner_reported';
|
|
20
|
+
};
|
|
21
|
+
backend_modules: Array<{
|
|
22
|
+
name: string;
|
|
23
|
+
path: string;
|
|
24
|
+
language: string;
|
|
25
|
+
status: 'not_run' | 'test_command_succeeded' | 'tests_passed' | 'no_tests' | 'skipped' | 'unsupported' | 'build_only' | 'failed';
|
|
26
|
+
}>;
|
|
27
|
+
execution?: LocalTestCommandResult;
|
|
28
|
+
configuration: 'explicit' | 'frontend_default' | 'none';
|
|
29
|
+
discovery: LocalProjectDiscovery;
|
|
30
|
+
checks: Array<Omit<LocalCheckDefinition, 'command' | 'args'> & {
|
|
31
|
+
status: LocalTestCommandResult['status'] | 'not_run';
|
|
32
|
+
execution?: LocalTestCommandResult;
|
|
33
|
+
report?: LocalTestReport;
|
|
34
|
+
report_error?: string;
|
|
35
|
+
}>;
|
|
36
|
+
local_gate?: LocalTestGateReceipt;
|
|
37
|
+
}
|
|
38
|
+
export declare function localProjectCheckMessage(result: LocalProjectCheckResult): string;
|
|
39
|
+
export declare function testProject(input: string[], _json?: boolean, signal?: AbortSignal): Promise<LocalProjectCheckResult>;
|
|
3
40
|
export declare function observability(kind: 'logs' | 'metrics' | 'analytics', input: string[], profile?: string): Promise<unknown>;
|
|
4
41
|
export declare function runPlugins(input: string[], json?: boolean): Promise<unknown>;
|
|
5
42
|
export declare function completion(shell: string | undefined): string;
|
package/dist/workflows.js
CHANGED
|
@@ -10,6 +10,12 @@ import { readProjectManifest, resolveLocalPath, validateProject } from './projec
|
|
|
10
10
|
import { readProjectLink } from './remote.js';
|
|
11
11
|
import { TOP_LEVEL_COMMANDS } from './guidance.js';
|
|
12
12
|
import { VERSION } from './version.js';
|
|
13
|
+
import { runLocalDev } from './local-dev.js';
|
|
14
|
+
import { parseLogOptions, sinceFilters } from './logs.js';
|
|
15
|
+
import { LOCAL_TEST_LIMITS, LocalTestChecksFailure, LocalTestCommandFailure, runLocalTestCommand } from './local-test-command.js';
|
|
16
|
+
import { discoverLocalProjects, readLocalTestConfig } from './local-test-config.js';
|
|
17
|
+
import { captureLocalTestGateConfiguration, prepareLocalTestGate, finishLocalTestGate, blockedLocalTestGate } from './local-test-gates.js';
|
|
18
|
+
import { createLocalTestResultSink, readLocalTestResults, removeLocalTestResultSink, screenLocalTestRunContext, LOCAL_TEST_RESULT_LIMITS } from './local-test-results.js';
|
|
13
19
|
function takeOption(args, name) {
|
|
14
20
|
const index = args.indexOf(name);
|
|
15
21
|
if (index < 0)
|
|
@@ -38,16 +44,41 @@ async function spawnInherited(command, args, cwd, env, json = false) {
|
|
|
38
44
|
child.once('exit', (code) => { process.off('SIGINT', forward); process.off('SIGTERM', forward); resolve(code ?? 1); });
|
|
39
45
|
});
|
|
40
46
|
}
|
|
41
|
-
export async function runDev(input, json = false) {
|
|
47
|
+
export async function runDev(input, json = false, write) {
|
|
42
48
|
const args = [...input];
|
|
43
|
-
const
|
|
49
|
+
const localConfig = takeOption(args, '--local-config');
|
|
50
|
+
const stateDirectory = takeOption(args, '--state-dir');
|
|
51
|
+
const localBuildConfig = takeOption(args, '--local-build-config');
|
|
52
|
+
const watchArtifact = takeFlag(args, '--watch-artifact');
|
|
53
|
+
const watchSource = takeFlag(args, '--watch-source');
|
|
44
54
|
const host = takeOption(args, '--host');
|
|
45
55
|
const port = takeOption(args, '--port');
|
|
56
|
+
const root = resolveLocalPath(args.shift());
|
|
46
57
|
noExtra(args);
|
|
58
|
+
if ((localConfig === undefined) !== (stateDirectory === undefined)) {
|
|
59
|
+
throw new CliError('Local stack development requires both --local-config FILE and --state-dir NEW_DIRECTORY.', EXIT.usage, 'local_stack_options_required');
|
|
60
|
+
}
|
|
61
|
+
if (watchArtifact && localConfig === undefined) {
|
|
62
|
+
throw new CliError('Artifact watching requires --local-config FILE and --state-dir NEW_DIRECTORY.', EXIT.usage, 'local_stack_watch_options_required');
|
|
63
|
+
}
|
|
64
|
+
if (localBuildConfig !== undefined && localConfig === undefined) {
|
|
65
|
+
throw new CliError('Local source builds require --local-config FILE and --state-dir NEW_DIRECTORY.', EXIT.usage, 'local_source_build_options_required');
|
|
66
|
+
}
|
|
67
|
+
if (localBuildConfig !== undefined && watchArtifact) {
|
|
68
|
+
throw new CliError('Use source compilation or separately compiled artifact watching in a development run.', EXIT.usage, 'local_source_build_watch_conflict');
|
|
69
|
+
}
|
|
70
|
+
if (watchSource && (localBuildConfig === undefined || watchArtifact)) {
|
|
71
|
+
throw new CliError('Source watching requires --local-build-config FILE and the explicit local stack.', EXIT.usage, 'local_source_watch_options_required');
|
|
72
|
+
}
|
|
73
|
+
if (localConfig !== undefined && (host !== undefined || port !== undefined)) {
|
|
74
|
+
throw new CliError('Local stack listeners use loopback ports selected by the operating system. Omit --host and --port.', EXIT.usage, 'local_stack_listen_options');
|
|
75
|
+
}
|
|
47
76
|
const validation = await validateProject(root);
|
|
48
77
|
if (validation.errors.length)
|
|
49
78
|
throw new CliError('Project validation failed before local development started.', EXIT.validation, 'project_invalid', validation.errors);
|
|
50
79
|
const manifest = validation.manifest;
|
|
80
|
+
if (localConfig !== undefined && stateDirectory !== undefined)
|
|
81
|
+
return runLocalDev(root, localConfig, stateDirectory, json, write, watchArtifact, localBuildConfig, watchSource);
|
|
51
82
|
if (manifest.frontend.framework === 'html')
|
|
52
83
|
throw new CliError('Static HTML projects do not define a development process. Use a local static-file server.', EXIT.validation, 'dev_command_unavailable');
|
|
53
84
|
const manager = manifest.frontend.package_manager;
|
|
@@ -62,25 +93,217 @@ export async function runDev(input, json = false) {
|
|
|
62
93
|
throw new CliError(`The local development process exited with code ${exitCode}.`, EXIT.remote, 'dev_process_failed', [`If dependencies are missing, run \`${manager} install\` in ${dependencyRoot}, then retry.`]);
|
|
63
94
|
return { exit_code: exitCode };
|
|
64
95
|
}
|
|
65
|
-
export
|
|
96
|
+
export function localProjectCheckMessage(result) {
|
|
97
|
+
const message = result.test_counts
|
|
98
|
+
? `Customer runner reported ${result.test_counts.passed} passed, ${result.test_counts.failed} failed, ${result.test_counts.skipped} skipped and ${result.test_counts.unsupported} unsupported tests.`
|
|
99
|
+
: result.test_evidence === 'mixed'
|
|
100
|
+
? 'Configured local commands completed. Some results are customer runner reported; aggregate test counts are unknown.'
|
|
101
|
+
: result.status === 'validation_only'
|
|
102
|
+
? 'Project structure validated. No tests ran.'
|
|
103
|
+
: result.status === 'build_only'
|
|
104
|
+
? result.configuration === 'frontend_default' ? 'Frontend build completed. No tests ran.' : 'Local build commands completed. No tests ran.'
|
|
105
|
+
: result.status === 'checks_succeeded'
|
|
106
|
+
? 'Configured local commands completed. Test counts and coverage were not collected.'
|
|
107
|
+
: 'Frontend test command completed. Test counts and coverage were not collected.';
|
|
108
|
+
const untested = result.backend_modules.filter(row => ['not_run', 'build_only', 'no_tests', 'skipped', 'unsupported'].includes(row.status)).length;
|
|
109
|
+
return message + (untested ? ` ${untested} backend module(s) were not tested.` : '')
|
|
110
|
+
+ (result.discovery.nested_projects.length ? ` ${result.discovery.nested_projects.length} nested project(s) were not run; test them explicitly.` : '')
|
|
111
|
+
+ (!result.discovery.complete ? ' Project discovery reached a bound; review the remaining directories explicitly.' : '')
|
|
112
|
+
+ (result.local_gate ? ` The ${result.local_gate.stage} local gate ${result.local_gate.status} for the declared inputs.` : '');
|
|
113
|
+
}
|
|
114
|
+
export async function testProject(input, _json = false, signal) {
|
|
66
115
|
const args = [...input];
|
|
116
|
+
const timeoutRaw = takeOption(args, '--timeout');
|
|
117
|
+
const outputRaw = takeOption(args, '--max-output-bytes');
|
|
118
|
+
const gateStage = takeOption(args, '--gate');
|
|
119
|
+
const numeric = (value, fallback, maximum, minimum) => {
|
|
120
|
+
if (value === undefined)
|
|
121
|
+
return fallback;
|
|
122
|
+
const number = Number(value);
|
|
123
|
+
if (!/^\d+$/.test(value) || !Number.isSafeInteger(number) || number < minimum || number > maximum) {
|
|
124
|
+
throw new CliError('Test timeout must be 1–3600 seconds; output limit must be 1024–8388608 bytes.', EXIT.usage, 'invalid_test_limits');
|
|
125
|
+
}
|
|
126
|
+
return number;
|
|
127
|
+
};
|
|
128
|
+
const timeoutMs = numeric(timeoutRaw, LOCAL_TEST_LIMITS.timeoutMs / 1000, LOCAL_TEST_LIMITS.maxTimeoutMs / 1000, 1) * 1000;
|
|
129
|
+
const maxOutputBytes = numeric(outputRaw, LOCAL_TEST_LIMITS.maxOutputBytes, LOCAL_TEST_LIMITS.maximumOutputBytes, 1024);
|
|
130
|
+
const gateDeadline = performance.now() + timeoutMs;
|
|
67
131
|
const root = resolveLocalPath(args.shift());
|
|
68
132
|
noExtra(args);
|
|
133
|
+
let gateConfiguration;
|
|
134
|
+
if (gateStage !== undefined) {
|
|
135
|
+
if (gateStage !== 'preview' && gateStage !== 'promotion')
|
|
136
|
+
throw new CliError('Select preview or promotion for the local test gate.', EXIT.validation, 'invalid_local_test_gate');
|
|
137
|
+
try {
|
|
138
|
+
gateConfiguration = await captureLocalTestGateConfiguration(root, gateDeadline, signal);
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
if (error instanceof CliError)
|
|
142
|
+
throw error;
|
|
143
|
+
throw new CliError('Local test gates require available project, test and gate configuration files.', EXIT.validation, 'invalid_local_test_gate');
|
|
144
|
+
}
|
|
145
|
+
}
|
|
69
146
|
const validation = await validateProject(root);
|
|
70
147
|
if (validation.errors.length)
|
|
71
148
|
throw new CliError('Project validation failed.', EXIT.validation, 'project_invalid', validation.errors);
|
|
72
149
|
const manifest = validation.manifest;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
150
|
+
const configured = await readLocalTestConfig(root, manifest);
|
|
151
|
+
if (gateStage !== undefined && !configured)
|
|
152
|
+
throw new CliError('Local test gates require explicit structured customer checks.', EXIT.validation, 'invalid_local_test_gate');
|
|
153
|
+
const discovery = await discoverLocalProjects(root, signal);
|
|
154
|
+
const common = {
|
|
155
|
+
schema: 'blinkhost.local-project-checks/v1',
|
|
156
|
+
validated: true,
|
|
157
|
+
coverage: { native: 'not_collected', wasm: 'not_collected' },
|
|
158
|
+
backend_modules: manifest.modules.map(({ name, path, language }) => ({ name, path, language,
|
|
159
|
+
status: 'not_run' })),
|
|
160
|
+
discovery,
|
|
161
|
+
};
|
|
162
|
+
if (!configured && manifest.frontend.framework === 'html')
|
|
163
|
+
return {
|
|
164
|
+
...common, status: 'validation_only', build: 'not_required', tests_executed: 0, test_evidence: 'not_run',
|
|
165
|
+
configuration: 'none', checks: [],
|
|
166
|
+
};
|
|
167
|
+
let definitions = configured;
|
|
168
|
+
if (!definitions) {
|
|
169
|
+
const packageJson = JSON.parse(await readFile(join(root, manifest.frontend.dependency_root, 'package.json'), 'utf8'));
|
|
170
|
+
const script = packageJson.scripts?.test ? 'test' : 'build';
|
|
171
|
+
definitions = [{ id: 'frontend', target: 'frontend', cwd: manifest.frontend.dependency_root,
|
|
172
|
+
command: manifest.frontend.package_manager, args: ['run', script], kind: script, profile: 'unspecified' }];
|
|
173
|
+
}
|
|
174
|
+
const configuration = configured ? 'explicit' : 'frontend_default';
|
|
175
|
+
const checks = definitions.map(({ command: _command, args: _args, ...row }) => ({ ...row, status: 'not_run' }));
|
|
176
|
+
const deadline = gateStage !== undefined ? gateDeadline : performance.now() + timeoutMs;
|
|
177
|
+
let gate;
|
|
178
|
+
try {
|
|
179
|
+
gate = gateStage !== undefined ? await prepareLocalTestGate(root, gateStage, definitions, { timeout_ms: timeoutMs, max_output_bytes: maxOutputBytes }, deadline, signal, gateConfiguration) : undefined;
|
|
180
|
+
}
|
|
181
|
+
catch (error) {
|
|
182
|
+
if (error instanceof CliError)
|
|
183
|
+
throw error;
|
|
184
|
+
throw new CliError('Local test gate inputs are missing or unavailable.', EXIT.validation, 'invalid_local_test_gate');
|
|
185
|
+
}
|
|
186
|
+
const failureContext = (reason) => ({ configuration, checks, backend_modules: common.backend_modules, discovery,
|
|
187
|
+
...(gate ? { local_gate: blockedLocalTestGate(gate, checks, reason) } : {}) });
|
|
188
|
+
let outputRemaining = maxOutputBytes;
|
|
189
|
+
let resultBytesRemaining = LOCAL_TEST_RESULT_LIMITS.totalBytes;
|
|
190
|
+
for (let index = 0; index < checks.length; index++) {
|
|
191
|
+
const check = checks[index];
|
|
192
|
+
const definition = definitions[index];
|
|
193
|
+
if (signal?.aborted || performance.now() >= deadline || outputRemaining < 1) {
|
|
194
|
+
throw new LocalTestChecksFailure(signal?.aborted ? 'Project checks were cancelled.'
|
|
195
|
+
: outputRemaining < 1 ? 'Project checks exhausted their shared output budget.' : 'Project checks exhausted their shared timeout.', signal?.aborted ? signal.reason === 'SIGTERM' ? 143 : 130 : EXIT.validation, signal?.aborted ? 'project_test_cancelled' : outputRemaining < 1 ? 'project_test_output_limit' : 'project_test_timeout', [], failureContext('test_execution_incomplete'));
|
|
196
|
+
}
|
|
197
|
+
const sink = definition.results ? await createLocalTestResultSink() : undefined;
|
|
198
|
+
let execution;
|
|
199
|
+
try {
|
|
200
|
+
const env = { ...process.env, CI: '1' };
|
|
201
|
+
// A parent node:test harness sets this private marker. Inheriting it silently
|
|
202
|
+
// suppresses a new customer runner's file execution and custom reporters.
|
|
203
|
+
delete env.NODE_TEST_CONTEXT;
|
|
204
|
+
delete env.BLINKHOST_TEST_RESULT_PATH;
|
|
205
|
+
delete env.BLINKHOST_TEST_RUN_ID;
|
|
206
|
+
delete env.BLINKHOST_TEST_CHECK_ID;
|
|
207
|
+
delete env.BLINKHOST_TEST_PROFILE;
|
|
208
|
+
if (sink)
|
|
209
|
+
Object.assign(env, { BLINKHOST_TEST_RESULT_PATH: sink.path, BLINKHOST_TEST_RUN_ID: sink.runId,
|
|
210
|
+
BLINKHOST_TEST_CHECK_ID: check.id, BLINKHOST_TEST_PROFILE: check.profile });
|
|
211
|
+
execution = await runLocalTestCommand(definition.command, definition.args, {
|
|
212
|
+
cwd: join(root, check.cwd), env,
|
|
213
|
+
timeoutMs: Math.max(1, Math.ceil(deadline - performance.now())), maxOutputBytes: outputRemaining,
|
|
214
|
+
...(signal ? { signal } : {}),
|
|
215
|
+
});
|
|
216
|
+
if (sink) {
|
|
217
|
+
execution.output.stdout = screenLocalTestRunContext(execution.output.stdout, sink);
|
|
218
|
+
execution.output.stderr = screenLocalTestRunContext(execution.output.stderr, sink);
|
|
219
|
+
}
|
|
220
|
+
check.status = execution.status;
|
|
221
|
+
check.execution = execution;
|
|
222
|
+
if (sink && (execution.status === 'succeeded' || execution.status === 'failed')) {
|
|
223
|
+
try {
|
|
224
|
+
check.report = await readLocalTestResults(sink, check, resultBytesRemaining);
|
|
225
|
+
}
|
|
226
|
+
catch (error) {
|
|
227
|
+
check.report_error = error instanceof CliError ? error.code : 'invalid_local_test_results';
|
|
228
|
+
}
|
|
229
|
+
if (check.report) {
|
|
230
|
+
resultBytesRemaining -= check.report.source_bytes;
|
|
231
|
+
if (check.report.coverage.status === 'collected' && (check.profile === 'native' || check.profile === 'wasm')) {
|
|
232
|
+
common.coverage[check.profile] = 'customer_runner_reported';
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
finally {
|
|
238
|
+
if (sink)
|
|
239
|
+
await removeLocalTestResultSink(sink);
|
|
240
|
+
}
|
|
241
|
+
outputRemaining -= execution.captured_output_bytes;
|
|
242
|
+
const module = common.backend_modules.find(row => check.target === `module:${row.name}`);
|
|
243
|
+
if (module) {
|
|
244
|
+
if (execution.status !== 'succeeded' || check.report_error || check.report?.status === 'failed')
|
|
245
|
+
module.status = 'failed';
|
|
246
|
+
else if (check.kind === 'build') {
|
|
247
|
+
if (module.status === 'not_run')
|
|
248
|
+
module.status = 'build_only';
|
|
249
|
+
}
|
|
250
|
+
else if (check.report?.status === 'passed')
|
|
251
|
+
module.status = 'tests_passed';
|
|
252
|
+
else if (!['tests_passed', 'test_command_succeeded'].includes(module.status))
|
|
253
|
+
module.status = check.report?.status ?? 'test_command_succeeded';
|
|
254
|
+
}
|
|
255
|
+
const context = failureContext('test_execution_failed');
|
|
256
|
+
if (execution.status === 'succeeded' && (signal?.aborted || performance.now() >= deadline)) {
|
|
257
|
+
throw new LocalTestChecksFailure(signal?.aborted ? 'Project checks were cancelled.' : 'Project checks exhausted their shared timeout.', signal?.aborted ? signal.reason === 'SIGTERM' ? 143 : 130 : EXIT.validation, signal?.aborted ? 'project_test_cancelled' : 'project_test_timeout', [], context);
|
|
258
|
+
}
|
|
259
|
+
if (execution.status === 'succeeded' && (check.report_error || check.report?.status === 'failed')) {
|
|
260
|
+
throw new LocalTestChecksFailure(check.report_error ? 'The required customer runner result is missing or invalid.' : 'The customer runner reported failed tests.', EXIT.validation, check.report_error ?? 'project_test_results_failed', [], context);
|
|
261
|
+
}
|
|
262
|
+
if (execution.status === 'succeeded')
|
|
263
|
+
continue;
|
|
264
|
+
const failures = {
|
|
265
|
+
failed: [`Project ${check.kind} exited with code ${execution.exit_code ?? execution.signal ?? 'unknown'}.`, EXIT.validation, 'project_test_failed'],
|
|
266
|
+
timed_out: [`Project ${check.kind} exceeded its shared timeout.`, EXIT.validation, 'project_test_timeout'],
|
|
267
|
+
output_limit: [`Project ${check.kind} exceeded its shared output limit.`, EXIT.validation, 'project_test_output_limit'],
|
|
268
|
+
cancelled: [`Project ${check.kind} was cancelled.`, signal?.reason === 'SIGTERM' ? 143 : 130, 'project_test_cancelled'],
|
|
269
|
+
unavailable: ['The local check executable is unavailable.', EXIT.filesystem, 'executable_unavailable'],
|
|
270
|
+
};
|
|
271
|
+
const [message, exitCode, code] = failures[execution.status];
|
|
272
|
+
throw new LocalTestCommandFailure(message, exitCode, code, execution, ['Local command cleanup covers the owned POSIX process group, or the direct child on Windows. This is not a security sandbox.'], context);
|
|
273
|
+
}
|
|
274
|
+
const hasTests = checks.some(row => row.kind !== 'build');
|
|
275
|
+
const testChecks = checks.filter(row => row.kind !== 'build');
|
|
276
|
+
const reportedChecks = testChecks.filter(row => row.report);
|
|
277
|
+
const allReported = hasTests && reportedChecks.length === testChecks.length;
|
|
278
|
+
const testCounts = allReported ? reportedChecks.reduce((sum, row) => {
|
|
279
|
+
for (const key of ['total', 'passed', 'failed', 'skipped', 'unsupported'])
|
|
280
|
+
sum[key] += row.report.counts[key];
|
|
281
|
+
return sum;
|
|
282
|
+
}, { total: 0, passed: 0, failed: 0, skipped: 0, unsupported: 0 }) : undefined;
|
|
283
|
+
const first = checks[0];
|
|
284
|
+
const localGate = gate ? await finishLocalTestGate(gate, checks, deadline, signal) : undefined;
|
|
285
|
+
if (localGate?.status === 'blocked')
|
|
286
|
+
throw new LocalTestChecksFailure('The selected local test gate did not pass.', localGate.reason === 'project_test_cancelled' ? signal?.reason === 'SIGTERM' ? 143 : 130 : EXIT.validation, localGate.reason === 'project_test_cancelled' || localGate.reason === 'project_test_timeout' ? localGate.reason : 'local_test_gate_blocked', [], { ...failureContext(localGate.reason ?? 'required_checks_blocked'), local_gate: localGate });
|
|
287
|
+
return { ...common, configuration, checks,
|
|
288
|
+
status: testCounts ? testCounts.passed ? 'tests_passed' : !testCounts.total ? 'no_tests'
|
|
289
|
+
: testCounts.unsupported === testCounts.total ? 'unsupported' : 'skipped'
|
|
290
|
+
: hasTests ? configured ? 'checks_succeeded' : 'test_command_succeeded' : 'build_only',
|
|
291
|
+
...(!configured ? { command: [definitions[0].command, ...definitions[0].args].join(' '), execution: first.execution } : {}),
|
|
292
|
+
exit_code: 0, tests_executed: testCounts ? testCounts.passed + testCounts.failed : hasTests ? null : 0,
|
|
293
|
+
test_evidence: allReported ? 'customer_runner_reported' : reportedChecks.length ? 'mixed' : hasTests ? 'command_exit_only' : 'not_run',
|
|
294
|
+
...(testCounts ? { test_counts: testCounts } : {}), ...(localGate ? { local_gate: localGate } : {}) };
|
|
82
295
|
}
|
|
83
296
|
export async function observability(kind, input, profile) {
|
|
297
|
+
if (kind === 'logs') {
|
|
298
|
+
const options = parseLogOptions(input);
|
|
299
|
+
if (options.follow)
|
|
300
|
+
throw new CliError('Use the streaming logs command for --follow.', EXIT.usage, 'invalid_log_options');
|
|
301
|
+
const project = options.project || (await readProjectLink()).project_id;
|
|
302
|
+
const query = new URLSearchParams(options.filters);
|
|
303
|
+
if (options.cursor)
|
|
304
|
+
query.set('cursor', options.cursor);
|
|
305
|
+
return (await ApiClient.create(profile)).request(`/api/sites/${encodeURIComponent(project)}/observability/logs/?${query}`, {}, 2 * 1024 * 1024);
|
|
306
|
+
}
|
|
84
307
|
const args = [...input];
|
|
85
308
|
let project = takeOption(args, '--project');
|
|
86
309
|
const since = takeOption(args, '--since');
|
|
@@ -96,9 +319,13 @@ export async function observability(kind, input, profile) {
|
|
|
96
319
|
throw new CliError('Provide --project or link this directory with `blinkhost projects link`.', EXIT.usage, 'project_required');
|
|
97
320
|
const query = new URLSearchParams();
|
|
98
321
|
if (since)
|
|
99
|
-
|
|
100
|
-
|
|
322
|
+
for (const [key, value] of Object.entries(sinceFilters(since, Date.now(), true)))
|
|
323
|
+
query.set(key, value);
|
|
324
|
+
if (limit) {
|
|
325
|
+
if (!/^\d+$/.test(limit) || Number(limit) < 1 || Number(limit) > 200)
|
|
326
|
+
throw new CliError('--limit must be an integer from 1 to 200.', EXIT.usage, 'invalid_log_options');
|
|
101
327
|
query.set('limit', limit);
|
|
328
|
+
}
|
|
102
329
|
const suffix = query.size ? `?${query}` : '';
|
|
103
330
|
const client = await ApiClient.create(profile);
|
|
104
331
|
return client.request(`/api/sites/${encodeURIComponent(project)}/observability/${kind}/${suffix}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blinkhost/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "Secure local and remote developer workflows for BlinkHost",
|
|
5
5
|
"keywords": ["blinkhost", "deployment", "hosting", "cloud", "cli", "developer-tools"],
|
|
6
6
|
"homepage": "https://app.blinkhost.me/docs/source-control/cli",
|
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
"bugs": { "url": "https://github.com/blinkhost-ltd/blinkhost-cli/issues" },
|
|
9
9
|
"type": "module",
|
|
10
10
|
"bin": { "blinkhost": "dist/cli.js" },
|
|
11
|
-
"
|
|
11
|
+
"exports": { "./test/node-reporter": "./dist/local-test-node-reporter.js", "./test/go-runner": "./dist/local-test-go-runner.js", "./test/rust-runner": "./dist/local-test-rust-runner.js" },
|
|
12
|
+
"files": ["dist/*.js", "dist/*.d.ts", "dist/local-development/*.mjs", "dist/local-development/*.json", "dist/local-development/README.md", "dist/local-development/hello.rs", "dist/javascript-runtime/*.js", "test-runners/python-unittest.py", "README.md", "CHANGELOG.md", "LICENSE"],
|
|
12
13
|
"engines": { "node": ">=22.12.0" },
|
|
13
14
|
"scripts": {
|
|
14
|
-
"build": "tsc -p tsconfig.json",
|
|
15
|
+
"build": "tsc -p tsconfig.json && node scripts/package-local-tools.mjs",
|
|
15
16
|
"test": "npm run build && node --test dist/test/*.test.js",
|
|
16
17
|
"prepack": "npm test"
|
|
17
18
|
},
|