@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
|
@@ -196,7 +196,7 @@ function resolveWorkspaceFile(workspace, target, mutate = false) {
|
|
|
196
196
|
*
|
|
197
197
|
* @example
|
|
198
198
|
* ```ts
|
|
199
|
-
* const file = resolveWorkspaceFile('/srv/checkout', 'tmp/
|
|
199
|
+
* const file = resolveWorkspaceFile('/srv/checkout', 'tmp/probes/arm-type.ts', true)
|
|
200
200
|
* writeFileSync(file, 'export type Signal = string\n', { encoding: 'utf8', flag: 'wx' })
|
|
201
201
|
* overwriteFile(file, 'export type Signal = number\n')
|
|
202
202
|
* readFileSync(file, 'utf8') // 'export type Signal = number\n'
|
|
@@ -239,11 +239,11 @@ function overwriteFile(file, text) {
|
|
|
239
239
|
* @example
|
|
240
240
|
* ```ts
|
|
241
241
|
* try {
|
|
242
|
-
* writeFileSync('tmp/
|
|
242
|
+
* writeFileSync('tmp/probes/greeting\0.test.ts', '')
|
|
243
243
|
* } catch (error) {
|
|
244
|
-
* isRefusedName('tmp/
|
|
244
|
+
* isRefusedName('tmp/probes/greeting\0.test.ts', error) // true
|
|
245
245
|
* }
|
|
246
|
-
* isRefusedName('tmp/
|
|
246
|
+
* isRefusedName('tmp/probes/greeting.test.ts', new Error('the runtime stage was destroyed')) // false
|
|
247
247
|
* ```
|
|
248
248
|
*/
|
|
249
249
|
function isRefusedName(file, error) {
|
|
@@ -590,14 +590,14 @@ function inferTypeProject(path) {
|
|
|
590
590
|
*
|
|
591
591
|
* @example
|
|
592
592
|
* ```ts
|
|
593
|
-
* inferTestProject('tmp/
|
|
593
|
+
* inferTestProject('tmp/probes/greeting.test.ts') // 'probe'
|
|
594
594
|
* inferTestProject('tests/src/server/helpers.test.ts') // 'src:server'
|
|
595
595
|
* inferTestProject('tests/config.test.ts') // undefined
|
|
596
596
|
* ```
|
|
597
597
|
*/
|
|
598
598
|
function inferTestProject(path) {
|
|
599
599
|
const [root, axis, environment] = normalizePath(path).split("/");
|
|
600
|
-
if (root === "tmp" && axis === "
|
|
600
|
+
if (root === "tmp" && axis === "probes") return "probe";
|
|
601
601
|
if (root !== "tests" || axis === void 0 || environment === void 0) return void 0;
|
|
602
602
|
if (axis !== "src" && axis !== "app") return void 0;
|
|
603
603
|
return `${axis}:${environment}`;
|
|
@@ -634,9 +634,9 @@ function inferDocumentLanguage(path) {
|
|
|
634
634
|
* ```ts
|
|
635
635
|
* relativeWorkspaceFile(
|
|
636
636
|
* '/srv/checkout',
|
|
637
|
-
* buildRevisionPath('/srv/checkout', 'tmp/
|
|
637
|
+
* buildRevisionPath('/srv/checkout', 'tmp/probes/greeting.test.ts', '4821-9f0c'),
|
|
638
638
|
* )
|
|
639
|
-
* // 'tmp/
|
|
639
|
+
* // 'tmp/probes/greeting.test.probe-4821-9f0c.ts'
|
|
640
640
|
* ```
|
|
641
641
|
*/
|
|
642
642
|
function buildRevisionPath(workspace, path, revision) {
|
|
@@ -826,7 +826,7 @@ async function guardStage(stage, operation) {
|
|
|
826
826
|
*
|
|
827
827
|
* @example
|
|
828
828
|
* ```ts
|
|
829
|
-
* const test = { path: 'tmp/
|
|
829
|
+
* const test = { path: 'tmp/probes/greeting.test.ts', text: '' }
|
|
830
830
|
* findRefusedPaths({
|
|
831
831
|
* project: 'tsconfig.json',
|
|
832
832
|
* case: { files: [{ path: '../../etc/hosts', text: '' }], test },
|
|
@@ -1104,9 +1104,9 @@ var Overlay = class {
|
|
|
1104
1104
|
};
|
|
1105
1105
|
//#endregion
|
|
1106
1106
|
//#region package.json
|
|
1107
|
-
var version = "0.0.
|
|
1107
|
+
var version = "0.0.17";
|
|
1108
1108
|
var peerDependencies = {
|
|
1109
|
-
"oxlint": "^1.
|
|
1109
|
+
"oxlint": "^1.86.0",
|
|
1110
1110
|
"typescript": "^6.0.3",
|
|
1111
1111
|
"vitest": "^4.1.11"
|
|
1112
1112
|
};
|
|
@@ -2462,7 +2462,7 @@ var TypeStage = class {
|
|
|
2462
2462
|
* },
|
|
2463
2463
|
* ],
|
|
2464
2464
|
* test: {
|
|
2465
|
-
* path: 'tmp/
|
|
2465
|
+
* path: 'tmp/probes/greeting.test.ts',
|
|
2466
2466
|
* text: "import { expect, test } from 'vitest'\nimport { createGreeting } from '../../src/core/factories.js'\ntest('greets', () => expect(createGreeting()).toBe('hi'))\n",
|
|
2467
2467
|
* },
|
|
2468
2468
|
* },
|
|
@@ -2474,7 +2474,7 @@ var TypeStage = class {
|
|
|
2474
2474
|
* },
|
|
2475
2475
|
* ],
|
|
2476
2476
|
* test: {
|
|
2477
|
-
* path: 'tmp/
|
|
2477
|
+
* path: 'tmp/probes/greeting.test.ts',
|
|
2478
2478
|
* text: "import { expect, test } from 'vitest'\nimport { createGreeting } from '../../src/core/factories.js'\ntest('greets', () => expect(createGreeting()).toBe('hi'))\n",
|
|
2479
2479
|
* },
|
|
2480
2480
|
* stage: 'type',
|
|
@@ -2484,8 +2484,8 @@ var TypeStage = class {
|
|
|
2484
2484
|
*
|
|
2485
2485
|
* const probe = new Probe({ workspace: process.cwd() })
|
|
2486
2486
|
* const verdict = await probe.prove(claim)
|
|
2487
|
-
* verdict.digest // '
|
|
2488
|
-
* verdict.receipt // 'probe:
|
|
2487
|
+
* verdict.digest // 'bdf03e5dfd6bd413ead671c7a2940fcf'
|
|
2488
|
+
* verdict.receipt // 'probe:bdf03e5dfd6bd413ead671c7a2940fcf:type:typescript@6.0.3:oxlint@1.86.0:vitest@4.1.11:configs/src/tsconfig.core.json@434f59254d58cf2683d453a26bd0d837'
|
|
2489
2489
|
* await probe.destroy()
|
|
2490
2490
|
* ```
|
|
2491
2491
|
*/
|
|
@@ -2631,7 +2631,7 @@ var Probe = class {
|
|
|
2631
2631
|
this.#emitter.emit("error", error);
|
|
2632
2632
|
}
|
|
2633
2633
|
#workbench() {
|
|
2634
|
-
const path = "tmp/
|
|
2634
|
+
const path = "tmp/probes";
|
|
2635
2635
|
const directory = resolveWorkspaceFile(this.#workspace, path);
|
|
2636
2636
|
const created = !(0, node_fs.existsSync)(directory);
|
|
2637
2637
|
try {
|
|
@@ -2649,16 +2649,16 @@ var Probe = class {
|
|
|
2649
2649
|
}
|
|
2650
2650
|
async #boot(created) {
|
|
2651
2651
|
const revision = `${process.pid}-${(0, node_crypto.randomUUID)()}`;
|
|
2652
|
-
const typeDependency = buildRevisionPath(this.#workspace, "tmp/
|
|
2653
|
-
const runtimeDependency = buildRevisionPath(this.#workspace, "tmp/
|
|
2652
|
+
const typeDependency = buildRevisionPath(this.#workspace, "tmp/probes/arm-type.ts", revision);
|
|
2653
|
+
const runtimeDependency = buildRevisionPath(this.#workspace, "tmp/probes/arm-runtime.ts", revision);
|
|
2654
2654
|
const typeModule = (0, node_path.basename)(typeDependency, ".ts");
|
|
2655
2655
|
const runtimeModule = (0, node_path.basename)(runtimeDependency, ".ts");
|
|
2656
2656
|
const typeTest = {
|
|
2657
|
-
path: `tmp/
|
|
2657
|
+
path: `tmp/probes/${typeModule}.test.ts`,
|
|
2658
2658
|
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`
|
|
2659
2659
|
};
|
|
2660
2660
|
const runtimeTest = {
|
|
2661
|
-
path: `tmp/
|
|
2661
|
+
path: `tmp/probes/${runtimeModule}.test.ts`,
|
|
2662
2662
|
text: `import { SIGNAL } from './${runtimeModule}.js'\nimport { expect, test } from 'vitest'\ntest('revalidates a mutated value', () => {\n\texpect(SIGNAL).toBe('before')\n})\n`
|
|
2663
2663
|
};
|
|
2664
2664
|
const typeClaim = {
|
|
@@ -2733,7 +2733,7 @@ var Probe = class {
|
|
|
2733
2733
|
(0, node_fs.rmSync)(resolveWorkspaceFile(this.#workspace, (0, node_path.relative)(this.#workspace, typeDependency), true), { force: true });
|
|
2734
2734
|
(0, node_fs.rmSync)(resolveWorkspaceFile(this.#workspace, (0, node_path.relative)(this.#workspace, runtimeDependency), true), { force: true });
|
|
2735
2735
|
if (created) try {
|
|
2736
|
-
(0, node_fs.rmdirSync)(resolveWorkspaceFile(this.#workspace, "tmp/
|
|
2736
|
+
(0, node_fs.rmdirSync)(resolveWorkspaceFile(this.#workspace, "tmp/probes", true));
|
|
2737
2737
|
} catch {}
|
|
2738
2738
|
}
|
|
2739
2739
|
}
|