@orkestrel/probe 0.0.16 → 0.0.17
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/README.md +2 -2
- package/dist/src/core/index.cjs +2 -2
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +6 -6
- package/dist/src/core/index.d.ts +6 -6
- package/dist/src/core/index.js +2 -2
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +21 -21
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.d.cts +12 -12
- package/dist/src/server/index.d.ts +12 -12
- package/dist/src/server/index.js +21 -21
- package/dist/src/server/index.js.map +1 -1
- package/package.json +10 -10
|
@@ -27,9 +27,9 @@ import type * as VitestNode from 'vitest/node';
|
|
|
27
27
|
* ```ts
|
|
28
28
|
* relativeWorkspaceFile(
|
|
29
29
|
* '/srv/checkout',
|
|
30
|
-
* buildRevisionPath('/srv/checkout', 'tmp/
|
|
30
|
+
* buildRevisionPath('/srv/checkout', 'tmp/probes/greeting.test.ts', '4821-9f0c'),
|
|
31
31
|
* )
|
|
32
|
-
* // 'tmp/
|
|
32
|
+
* // 'tmp/probes/greeting.test.probe-4821-9f0c.ts'
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
35
|
export declare function buildRevisionPath(workspace: string, path: string, revision: string): string;
|
|
@@ -221,7 +221,7 @@ export declare function filterUniqueIssues(issues: readonly Issue[]): readonly I
|
|
|
221
221
|
*
|
|
222
222
|
* @example
|
|
223
223
|
* ```ts
|
|
224
|
-
* const test = { path: 'tmp/
|
|
224
|
+
* const test = { path: 'tmp/probes/greeting.test.ts', text: '' }
|
|
225
225
|
* findRefusedPaths({
|
|
226
226
|
* project: 'tsconfig.json',
|
|
227
227
|
* case: { files: [{ path: '../../etc/hosts', text: '' }], test },
|
|
@@ -274,7 +274,7 @@ export declare function inferDocumentLanguage(path: string): string;
|
|
|
274
274
|
*
|
|
275
275
|
* @example
|
|
276
276
|
* ```ts
|
|
277
|
-
* inferTestProject('tmp/
|
|
277
|
+
* inferTestProject('tmp/probes/greeting.test.ts') // 'probe'
|
|
278
278
|
* inferTestProject('tests/src/server/helpers.test.ts') // 'src:server'
|
|
279
279
|
* inferTestProject('tests/config.test.ts') // undefined
|
|
280
280
|
* ```
|
|
@@ -368,11 +368,11 @@ export declare interface InspectionOptions {
|
|
|
368
368
|
* @example
|
|
369
369
|
* ```ts
|
|
370
370
|
* try {
|
|
371
|
-
* writeFileSync('tmp/
|
|
371
|
+
* writeFileSync('tmp/probes/greeting\0.test.ts', '')
|
|
372
372
|
* } catch (error) {
|
|
373
|
-
* isRefusedName('tmp/
|
|
373
|
+
* isRefusedName('tmp/probes/greeting\0.test.ts', error) // true
|
|
374
374
|
* }
|
|
375
|
-
* isRefusedName('tmp/
|
|
375
|
+
* isRefusedName('tmp/probes/greeting.test.ts', new Error('the runtime stage was destroyed')) // false
|
|
376
376
|
* ```
|
|
377
377
|
*/
|
|
378
378
|
export declare function isRefusedName(file: string, error: unknown): boolean;
|
|
@@ -769,7 +769,7 @@ export declare interface OverlayInterface {
|
|
|
769
769
|
*
|
|
770
770
|
* @example
|
|
771
771
|
* ```ts
|
|
772
|
-
* const file = resolveWorkspaceFile('/srv/checkout', 'tmp/
|
|
772
|
+
* const file = resolveWorkspaceFile('/srv/checkout', 'tmp/probes/arm-type.ts', true)
|
|
773
773
|
* writeFileSync(file, 'export type Signal = string\n', { encoding: 'utf8', flag: 'wx' })
|
|
774
774
|
* overwriteFile(file, 'export type Signal = number\n')
|
|
775
775
|
* readFileSync(file, 'utf8') // 'export type Signal = number\n'
|
|
@@ -848,7 +848,7 @@ export declare function parseRevisionOwner(revision: string): number | undefined
|
|
|
848
848
|
* },
|
|
849
849
|
* ],
|
|
850
850
|
* test: {
|
|
851
|
-
* path: 'tmp/
|
|
851
|
+
* path: 'tmp/probes/greeting.test.ts',
|
|
852
852
|
* text: "import { expect, test } from 'vitest'\nimport { createGreeting } from '../../src/core/factories.js'\ntest('greets', () => expect(createGreeting()).toBe('hi'))\n",
|
|
853
853
|
* },
|
|
854
854
|
* },
|
|
@@ -860,7 +860,7 @@ export declare function parseRevisionOwner(revision: string): number | undefined
|
|
|
860
860
|
* },
|
|
861
861
|
* ],
|
|
862
862
|
* test: {
|
|
863
|
-
* path: 'tmp/
|
|
863
|
+
* path: 'tmp/probes/greeting.test.ts',
|
|
864
864
|
* text: "import { expect, test } from 'vitest'\nimport { createGreeting } from '../../src/core/factories.js'\ntest('greets', () => expect(createGreeting()).toBe('hi'))\n",
|
|
865
865
|
* },
|
|
866
866
|
* stage: 'type',
|
|
@@ -870,8 +870,8 @@ export declare function parseRevisionOwner(revision: string): number | undefined
|
|
|
870
870
|
*
|
|
871
871
|
* const probe = new Probe({ workspace: process.cwd() })
|
|
872
872
|
* const verdict = await probe.prove(claim)
|
|
873
|
-
* verdict.digest // '
|
|
874
|
-
* verdict.receipt // 'probe:
|
|
873
|
+
* verdict.digest // 'bdf03e5dfd6bd413ead671c7a2940fcf'
|
|
874
|
+
* verdict.receipt // 'probe:bdf03e5dfd6bd413ead671c7a2940fcf:type:typescript@6.0.3:oxlint@1.86.0:vitest@4.1.11:configs/src/tsconfig.core.json@434f59254d58cf2683d453a26bd0d837'
|
|
875
875
|
* await probe.destroy()
|
|
876
876
|
* ```
|
|
877
877
|
*/
|
|
@@ -27,9 +27,9 @@ import type * as VitestNode from 'vitest/node';
|
|
|
27
27
|
* ```ts
|
|
28
28
|
* relativeWorkspaceFile(
|
|
29
29
|
* '/srv/checkout',
|
|
30
|
-
* buildRevisionPath('/srv/checkout', 'tmp/
|
|
30
|
+
* buildRevisionPath('/srv/checkout', 'tmp/probes/greeting.test.ts', '4821-9f0c'),
|
|
31
31
|
* )
|
|
32
|
-
* // 'tmp/
|
|
32
|
+
* // 'tmp/probes/greeting.test.probe-4821-9f0c.ts'
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
35
|
export declare function buildRevisionPath(workspace: string, path: string, revision: string): string;
|
|
@@ -221,7 +221,7 @@ export declare function filterUniqueIssues(issues: readonly Issue[]): readonly I
|
|
|
221
221
|
*
|
|
222
222
|
* @example
|
|
223
223
|
* ```ts
|
|
224
|
-
* const test = { path: 'tmp/
|
|
224
|
+
* const test = { path: 'tmp/probes/greeting.test.ts', text: '' }
|
|
225
225
|
* findRefusedPaths({
|
|
226
226
|
* project: 'tsconfig.json',
|
|
227
227
|
* case: { files: [{ path: '../../etc/hosts', text: '' }], test },
|
|
@@ -274,7 +274,7 @@ export declare function inferDocumentLanguage(path: string): string;
|
|
|
274
274
|
*
|
|
275
275
|
* @example
|
|
276
276
|
* ```ts
|
|
277
|
-
* inferTestProject('tmp/
|
|
277
|
+
* inferTestProject('tmp/probes/greeting.test.ts') // 'probe'
|
|
278
278
|
* inferTestProject('tests/src/server/helpers.test.ts') // 'src:server'
|
|
279
279
|
* inferTestProject('tests/config.test.ts') // undefined
|
|
280
280
|
* ```
|
|
@@ -368,11 +368,11 @@ export declare interface InspectionOptions {
|
|
|
368
368
|
* @example
|
|
369
369
|
* ```ts
|
|
370
370
|
* try {
|
|
371
|
-
* writeFileSync('tmp/
|
|
371
|
+
* writeFileSync('tmp/probes/greeting\0.test.ts', '')
|
|
372
372
|
* } catch (error) {
|
|
373
|
-
* isRefusedName('tmp/
|
|
373
|
+
* isRefusedName('tmp/probes/greeting\0.test.ts', error) // true
|
|
374
374
|
* }
|
|
375
|
-
* isRefusedName('tmp/
|
|
375
|
+
* isRefusedName('tmp/probes/greeting.test.ts', new Error('the runtime stage was destroyed')) // false
|
|
376
376
|
* ```
|
|
377
377
|
*/
|
|
378
378
|
export declare function isRefusedName(file: string, error: unknown): boolean;
|
|
@@ -769,7 +769,7 @@ export declare interface OverlayInterface {
|
|
|
769
769
|
*
|
|
770
770
|
* @example
|
|
771
771
|
* ```ts
|
|
772
|
-
* const file = resolveWorkspaceFile('/srv/checkout', 'tmp/
|
|
772
|
+
* const file = resolveWorkspaceFile('/srv/checkout', 'tmp/probes/arm-type.ts', true)
|
|
773
773
|
* writeFileSync(file, 'export type Signal = string\n', { encoding: 'utf8', flag: 'wx' })
|
|
774
774
|
* overwriteFile(file, 'export type Signal = number\n')
|
|
775
775
|
* readFileSync(file, 'utf8') // 'export type Signal = number\n'
|
|
@@ -848,7 +848,7 @@ export declare function parseRevisionOwner(revision: string): number | undefined
|
|
|
848
848
|
* },
|
|
849
849
|
* ],
|
|
850
850
|
* test: {
|
|
851
|
-
* path: 'tmp/
|
|
851
|
+
* path: 'tmp/probes/greeting.test.ts',
|
|
852
852
|
* text: "import { expect, test } from 'vitest'\nimport { createGreeting } from '../../src/core/factories.js'\ntest('greets', () => expect(createGreeting()).toBe('hi'))\n",
|
|
853
853
|
* },
|
|
854
854
|
* },
|
|
@@ -860,7 +860,7 @@ export declare function parseRevisionOwner(revision: string): number | undefined
|
|
|
860
860
|
* },
|
|
861
861
|
* ],
|
|
862
862
|
* test: {
|
|
863
|
-
* path: 'tmp/
|
|
863
|
+
* path: 'tmp/probes/greeting.test.ts',
|
|
864
864
|
* text: "import { expect, test } from 'vitest'\nimport { createGreeting } from '../../src/core/factories.js'\ntest('greets', () => expect(createGreeting()).toBe('hi'))\n",
|
|
865
865
|
* },
|
|
866
866
|
* stage: 'type',
|
|
@@ -870,8 +870,8 @@ export declare function parseRevisionOwner(revision: string): number | undefined
|
|
|
870
870
|
*
|
|
871
871
|
* const probe = new Probe({ workspace: process.cwd() })
|
|
872
872
|
* const verdict = await probe.prove(claim)
|
|
873
|
-
* verdict.digest // '
|
|
874
|
-
* verdict.receipt // 'probe:
|
|
873
|
+
* verdict.digest // 'bdf03e5dfd6bd413ead671c7a2940fcf'
|
|
874
|
+
* verdict.receipt // 'probe:bdf03e5dfd6bd413ead671c7a2940fcf:type:typescript@6.0.3:oxlint@1.86.0:vitest@4.1.11:configs/src/tsconfig.core.json@434f59254d58cf2683d453a26bd0d837'
|
|
875
875
|
* await probe.destroy()
|
|
876
876
|
* ```
|
|
877
877
|
*/
|
package/dist/src/server/index.js
CHANGED
|
@@ -195,7 +195,7 @@ function resolveWorkspaceFile(workspace, target, mutate = false) {
|
|
|
195
195
|
*
|
|
196
196
|
* @example
|
|
197
197
|
* ```ts
|
|
198
|
-
* const file = resolveWorkspaceFile('/srv/checkout', 'tmp/
|
|
198
|
+
* const file = resolveWorkspaceFile('/srv/checkout', 'tmp/probes/arm-type.ts', true)
|
|
199
199
|
* writeFileSync(file, 'export type Signal = string\n', { encoding: 'utf8', flag: 'wx' })
|
|
200
200
|
* overwriteFile(file, 'export type Signal = number\n')
|
|
201
201
|
* readFileSync(file, 'utf8') // 'export type Signal = number\n'
|
|
@@ -238,11 +238,11 @@ function overwriteFile(file, text) {
|
|
|
238
238
|
* @example
|
|
239
239
|
* ```ts
|
|
240
240
|
* try {
|
|
241
|
-
* writeFileSync('tmp/
|
|
241
|
+
* writeFileSync('tmp/probes/greeting\0.test.ts', '')
|
|
242
242
|
* } catch (error) {
|
|
243
|
-
* isRefusedName('tmp/
|
|
243
|
+
* isRefusedName('tmp/probes/greeting\0.test.ts', error) // true
|
|
244
244
|
* }
|
|
245
|
-
* isRefusedName('tmp/
|
|
245
|
+
* isRefusedName('tmp/probes/greeting.test.ts', new Error('the runtime stage was destroyed')) // false
|
|
246
246
|
* ```
|
|
247
247
|
*/
|
|
248
248
|
function isRefusedName(file, error) {
|
|
@@ -589,14 +589,14 @@ function inferTypeProject(path) {
|
|
|
589
589
|
*
|
|
590
590
|
* @example
|
|
591
591
|
* ```ts
|
|
592
|
-
* inferTestProject('tmp/
|
|
592
|
+
* inferTestProject('tmp/probes/greeting.test.ts') // 'probe'
|
|
593
593
|
* inferTestProject('tests/src/server/helpers.test.ts') // 'src:server'
|
|
594
594
|
* inferTestProject('tests/config.test.ts') // undefined
|
|
595
595
|
* ```
|
|
596
596
|
*/
|
|
597
597
|
function inferTestProject(path) {
|
|
598
598
|
const [root, axis, environment] = normalizePath(path).split("/");
|
|
599
|
-
if (root === "tmp" && axis === "
|
|
599
|
+
if (root === "tmp" && axis === "probes") return "probe";
|
|
600
600
|
if (root !== "tests" || axis === void 0 || environment === void 0) return void 0;
|
|
601
601
|
if (axis !== "src" && axis !== "app") return void 0;
|
|
602
602
|
return `${axis}:${environment}`;
|
|
@@ -633,9 +633,9 @@ function inferDocumentLanguage(path) {
|
|
|
633
633
|
* ```ts
|
|
634
634
|
* relativeWorkspaceFile(
|
|
635
635
|
* '/srv/checkout',
|
|
636
|
-
* buildRevisionPath('/srv/checkout', 'tmp/
|
|
636
|
+
* buildRevisionPath('/srv/checkout', 'tmp/probes/greeting.test.ts', '4821-9f0c'),
|
|
637
637
|
* )
|
|
638
|
-
* // 'tmp/
|
|
638
|
+
* // 'tmp/probes/greeting.test.probe-4821-9f0c.ts'
|
|
639
639
|
* ```
|
|
640
640
|
*/
|
|
641
641
|
function buildRevisionPath(workspace, path, revision) {
|
|
@@ -825,7 +825,7 @@ async function guardStage(stage, operation) {
|
|
|
825
825
|
*
|
|
826
826
|
* @example
|
|
827
827
|
* ```ts
|
|
828
|
-
* const test = { path: 'tmp/
|
|
828
|
+
* const test = { path: 'tmp/probes/greeting.test.ts', text: '' }
|
|
829
829
|
* findRefusedPaths({
|
|
830
830
|
* project: 'tsconfig.json',
|
|
831
831
|
* case: { files: [{ path: '../../etc/hosts', text: '' }], test },
|
|
@@ -1103,9 +1103,9 @@ var Overlay = class {
|
|
|
1103
1103
|
};
|
|
1104
1104
|
//#endregion
|
|
1105
1105
|
//#region package.json
|
|
1106
|
-
var version = "0.0.
|
|
1106
|
+
var version = "0.0.17";
|
|
1107
1107
|
var peerDependencies = {
|
|
1108
|
-
"oxlint": "^1.
|
|
1108
|
+
"oxlint": "^1.86.0",
|
|
1109
1109
|
"typescript": "^6.0.3",
|
|
1110
1110
|
"vitest": "^4.1.11"
|
|
1111
1111
|
};
|
|
@@ -2461,7 +2461,7 @@ var TypeStage = class {
|
|
|
2461
2461
|
* },
|
|
2462
2462
|
* ],
|
|
2463
2463
|
* test: {
|
|
2464
|
-
* path: 'tmp/
|
|
2464
|
+
* path: 'tmp/probes/greeting.test.ts',
|
|
2465
2465
|
* text: "import { expect, test } from 'vitest'\nimport { createGreeting } from '../../src/core/factories.js'\ntest('greets', () => expect(createGreeting()).toBe('hi'))\n",
|
|
2466
2466
|
* },
|
|
2467
2467
|
* },
|
|
@@ -2473,7 +2473,7 @@ var TypeStage = class {
|
|
|
2473
2473
|
* },
|
|
2474
2474
|
* ],
|
|
2475
2475
|
* test: {
|
|
2476
|
-
* path: 'tmp/
|
|
2476
|
+
* path: 'tmp/probes/greeting.test.ts',
|
|
2477
2477
|
* text: "import { expect, test } from 'vitest'\nimport { createGreeting } from '../../src/core/factories.js'\ntest('greets', () => expect(createGreeting()).toBe('hi'))\n",
|
|
2478
2478
|
* },
|
|
2479
2479
|
* stage: 'type',
|
|
@@ -2483,8 +2483,8 @@ var TypeStage = class {
|
|
|
2483
2483
|
*
|
|
2484
2484
|
* const probe = new Probe({ workspace: process.cwd() })
|
|
2485
2485
|
* const verdict = await probe.prove(claim)
|
|
2486
|
-
* verdict.digest // '
|
|
2487
|
-
* verdict.receipt // 'probe:
|
|
2486
|
+
* verdict.digest // 'bdf03e5dfd6bd413ead671c7a2940fcf'
|
|
2487
|
+
* verdict.receipt // 'probe:bdf03e5dfd6bd413ead671c7a2940fcf:type:typescript@6.0.3:oxlint@1.86.0:vitest@4.1.11:configs/src/tsconfig.core.json@434f59254d58cf2683d453a26bd0d837'
|
|
2488
2488
|
* await probe.destroy()
|
|
2489
2489
|
* ```
|
|
2490
2490
|
*/
|
|
@@ -2630,7 +2630,7 @@ var Probe = class {
|
|
|
2630
2630
|
this.#emitter.emit("error", error);
|
|
2631
2631
|
}
|
|
2632
2632
|
#workbench() {
|
|
2633
|
-
const path = "tmp/
|
|
2633
|
+
const path = "tmp/probes";
|
|
2634
2634
|
const directory = resolveWorkspaceFile(this.#workspace, path);
|
|
2635
2635
|
const created = !existsSync(directory);
|
|
2636
2636
|
try {
|
|
@@ -2648,16 +2648,16 @@ var Probe = class {
|
|
|
2648
2648
|
}
|
|
2649
2649
|
async #boot(created) {
|
|
2650
2650
|
const revision = `${process.pid}-${randomUUID()}`;
|
|
2651
|
-
const typeDependency = buildRevisionPath(this.#workspace, "tmp/
|
|
2652
|
-
const runtimeDependency = buildRevisionPath(this.#workspace, "tmp/
|
|
2651
|
+
const typeDependency = buildRevisionPath(this.#workspace, "tmp/probes/arm-type.ts", revision);
|
|
2652
|
+
const runtimeDependency = buildRevisionPath(this.#workspace, "tmp/probes/arm-runtime.ts", revision);
|
|
2653
2653
|
const typeModule = basename(typeDependency, ".ts");
|
|
2654
2654
|
const runtimeModule = basename(runtimeDependency, ".ts");
|
|
2655
2655
|
const typeTest = {
|
|
2656
|
-
path: `tmp/
|
|
2656
|
+
path: `tmp/probes/${typeModule}.test.ts`,
|
|
2657
2657
|
text: `import type { Signal } from './${typeModule}.js'\nimport { expect, test } from 'vitest'\nconst SIGNAL: Signal = 'before'\ntest('revalidates a mutated type', () => {\n\texpect(SIGNAL).toBe('before')\n})\n`
|
|
2658
2658
|
};
|
|
2659
2659
|
const runtimeTest = {
|
|
2660
|
-
path: `tmp/
|
|
2660
|
+
path: `tmp/probes/${runtimeModule}.test.ts`,
|
|
2661
2661
|
text: `import { SIGNAL } from './${runtimeModule}.js'\nimport { expect, test } from 'vitest'\ntest('revalidates a mutated value', () => {\n\texpect(SIGNAL).toBe('before')\n})\n`
|
|
2662
2662
|
};
|
|
2663
2663
|
const typeClaim = {
|
|
@@ -2732,7 +2732,7 @@ var Probe = class {
|
|
|
2732
2732
|
rmSync(resolveWorkspaceFile(this.#workspace, relative(this.#workspace, typeDependency), true), { force: true });
|
|
2733
2733
|
rmSync(resolveWorkspaceFile(this.#workspace, relative(this.#workspace, runtimeDependency), true), { force: true });
|
|
2734
2734
|
if (created) try {
|
|
2735
|
-
rmdirSync(resolveWorkspaceFile(this.#workspace, "tmp/
|
|
2735
|
+
rmdirSync(resolveWorkspaceFile(this.#workspace, "tmp/probes", true));
|
|
2736
2736
|
} catch {}
|
|
2737
2737
|
}
|
|
2738
2738
|
}
|