@fairfox/polly 0.19.0 → 0.20.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/README.md +125 -948
- package/dist/cli/polly.js +25 -4
- package/dist/cli/polly.js.map +3 -3
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +46 -3
- package/dist/src/index.js.map +6 -5
- package/dist/src/shared/lib/resource.d.ts +54 -0
- package/dist/src/shared/lib/resource.js +583 -0
- package/dist/src/shared/lib/resource.js.map +13 -0
- package/dist/src/shared/lib/state.d.ts +1 -0
- package/dist/src/shared/lib/state.js +2 -1
- package/dist/src/shared/lib/state.js.map +3 -3
- package/dist/src/shared/state/app-state.js.map +2 -2
- package/dist/tools/init/templates/pwa/package.json.template +1 -2
- package/dist/tools/verify/specs/docker-compose.yml +1 -1
- package/dist/tools/verify/src/cli.js +176 -9
- package/dist/tools/verify/src/cli.js.map +6 -6
- package/dist/tools/visualize/src/cli.js +139 -4
- package/dist/tools/visualize/src/cli.js.map +3 -3
- package/package.json +5 -5
- package/dist/src/elysia/tla-generator.d.ts +0 -16
- package/dist/tools/verify/specs/verification.config.ts +0 -64
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fairfox/polly",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Multi-execution-context framework with reactive state and cross-context messaging for Chrome extensions, PWAs, and worker-based applications",
|
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
"import": "./dist/src/shared/lib/state.js",
|
|
23
23
|
"types": "./dist/shared/lib/state.d.ts"
|
|
24
24
|
},
|
|
25
|
+
"./resource": {
|
|
26
|
+
"import": "./dist/src/shared/lib/resource.js",
|
|
27
|
+
"types": "./dist/shared/lib/resource.d.ts"
|
|
28
|
+
},
|
|
25
29
|
"./message-bus": {
|
|
26
30
|
"import": "./dist/src/shared/lib/message-bus.js",
|
|
27
31
|
"types": "./dist/shared/lib/message-bus.d.ts"
|
|
@@ -82,10 +86,6 @@
|
|
|
82
86
|
"format": "biome format --write .",
|
|
83
87
|
"test": "bun run --cwd tests test",
|
|
84
88
|
"test:watch": "bun run --cwd tests test:watch",
|
|
85
|
-
"test:framework": "bun run --cwd tests test:framework",
|
|
86
|
-
"test:framework:ui": "bun run --cwd tests test:framework:ui",
|
|
87
|
-
"test:framework:debug": "bun run --cwd tests test:framework:debug",
|
|
88
|
-
"test:framework:headed": "bun run --cwd tests test:framework:headed",
|
|
89
89
|
"test:all": "bun run lint && bun run typecheck && bun run --cwd tests test:all && bun run test:examples",
|
|
90
90
|
"test:examples": "echo '\\n=== Testing Examples ===' && bun run test:example:minimal && bun run test:example:todo-list && bun run test:example:full-featured",
|
|
91
91
|
"test:example:minimal": "echo '\\n--- Minimal Example ---' && bun run --cwd examples/minimal test:all",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { PollyConfig } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Generate TLA+ specification from Elysia app + Polly config
|
|
4
|
-
*
|
|
5
|
-
* This generates a formal model that can be checked with TLC (TLA+ model checker)
|
|
6
|
-
* to verify distributed systems properties like:
|
|
7
|
-
* - Eventually consistent state
|
|
8
|
-
* - Authorization enforcement
|
|
9
|
-
* - No lost updates
|
|
10
|
-
* - Causal ordering of events
|
|
11
|
-
*/
|
|
12
|
-
export declare function generateTLASpec(moduleName: string, config: PollyConfig): string;
|
|
13
|
-
/**
|
|
14
|
-
* Export TLA+ spec to file
|
|
15
|
-
*/
|
|
16
|
-
export declare function exportTLASpec(moduleName: string, config: PollyConfig, outputPath: string): Promise<void>;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
// ═══════════════════════════════════════════════════════════════
|
|
2
|
-
// Verification Configuration
|
|
3
|
-
// ═══════════════════════════════════════════════════════════════
|
|
4
|
-
//
|
|
5
|
-
// This file configures TLA+ verification for your extension.
|
|
6
|
-
// Some values are auto-configured, others need your input.
|
|
7
|
-
//
|
|
8
|
-
// Look for:
|
|
9
|
-
// • /* CONFIGURE */ - Replace with your value
|
|
10
|
-
// • /* REVIEW */ - Check the auto-generated value
|
|
11
|
-
// • null - Must be replaced with a concrete value
|
|
12
|
-
//
|
|
13
|
-
// Run 'bun verify' to check for incomplete configuration.
|
|
14
|
-
// Run 'bun verify --setup' for interactive help.
|
|
15
|
-
//
|
|
16
|
-
|
|
17
|
-
import { defineVerification } from "../src/index";
|
|
18
|
-
|
|
19
|
-
export const verificationConfig = defineVerification({
|
|
20
|
-
state: {},
|
|
21
|
-
|
|
22
|
-
messages: {
|
|
23
|
-
// Maximum messages in flight simultaneously across all contexts.
|
|
24
|
-
// Higher = more realistic concurrency, but exponentially slower.
|
|
25
|
-
//
|
|
26
|
-
// Recommended values:
|
|
27
|
-
// • 2-3: Fast verification (< 10 seconds)
|
|
28
|
-
// • 4-6: Balanced (10-60 seconds)
|
|
29
|
-
// • 8+: Thorough but slow (minutes)
|
|
30
|
-
//
|
|
31
|
-
// WARNING: State space grows exponentially! Start small.
|
|
32
|
-
maxInFlight: 3,
|
|
33
|
-
|
|
34
|
-
// Maximum tab IDs to model (content scripts are per-tab).
|
|
35
|
-
//
|
|
36
|
-
// Recommended:
|
|
37
|
-
// • 0-1: Most extensions (single tab or tab-agnostic)
|
|
38
|
-
// • 2-3: Multi-tab coordination
|
|
39
|
-
//
|
|
40
|
-
// Start with 0 or 1 for faster verification.
|
|
41
|
-
maxTabs: 1,
|
|
42
|
-
|
|
43
|
-
// TEST: Message filtering (Issue #14)
|
|
44
|
-
// Only verify these specific message types
|
|
45
|
-
include: ["test_message_1", "test_message_2", "test_message_3"],
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
// Verification behavior
|
|
49
|
-
// ─────────────────────
|
|
50
|
-
//
|
|
51
|
-
// onBuild: What to do during development builds
|
|
52
|
-
// • 'warn' - Show warnings but don't fail (recommended)
|
|
53
|
-
// • 'error' - Fail the build on violations
|
|
54
|
-
// • 'off' - Skip verification
|
|
55
|
-
//
|
|
56
|
-
onBuild: "warn",
|
|
57
|
-
|
|
58
|
-
// onRelease: What to do during production builds
|
|
59
|
-
// • 'error' - Fail the build on violations (recommended)
|
|
60
|
-
// • 'warn' - Show warnings but don't fail
|
|
61
|
-
// • 'off' - Skip verification
|
|
62
|
-
//
|
|
63
|
-
onRelease: "error",
|
|
64
|
-
});
|