@plures/praxis 1.2.41 → 1.4.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/dist/browser/{chunk-BBP2F7TT.js → chunk-MJK3IYTJ.js} +123 -5
- package/dist/browser/{chunk-FCEH7WMH.js → chunk-N63K4KWS.js} +1 -1
- package/dist/browser/{engine-65QDGCAN.js → engine-YIEGSX7U.js} +1 -1
- package/dist/browser/index.d.ts +2 -2
- package/dist/browser/index.js +10 -5
- package/dist/browser/integrations/svelte.d.ts +2 -2
- package/dist/browser/integrations/svelte.js +2 -2
- package/dist/browser/{reactive-engine.svelte-Cqd8Mod2.d.ts → reactive-engine.svelte-DjynI82A.d.ts} +83 -4
- package/dist/node/chunk-2IUFZBH3.js +87 -0
- package/dist/node/{chunk-WZ6B3LZ6.js → chunk-7CSWBDFL.js} +3 -56
- package/dist/node/{chunk-32YFEEML.js → chunk-7M3HV4XR.js} +4 -4
- package/dist/node/{chunk-PTH6MD6P.js → chunk-FWOXU4MM.js} +1 -1
- package/dist/node/{chunk-BBP2F7TT.js → chunk-KMJWAFZV.js} +128 -5
- package/dist/node/chunk-PGVSB6NR.js +59 -0
- package/dist/node/cli/index.cjs +1078 -211
- package/dist/node/cli/index.js +21 -2
- package/dist/node/cloud/index.d.cts +1 -1
- package/dist/node/cloud/index.d.ts +1 -1
- package/dist/node/{engine-7CXQV6RC.js → engine-FEN5IYZ5.js} +1 -1
- package/dist/node/index.cjs +1633 -59
- package/dist/node/index.d.cts +769 -5
- package/dist/node/index.d.ts +769 -5
- package/dist/node/index.js +1375 -45
- package/dist/node/integrations/svelte.cjs +123 -5
- package/dist/node/integrations/svelte.d.cts +3 -3
- package/dist/node/integrations/svelte.d.ts +3 -3
- package/dist/node/integrations/svelte.js +3 -3
- package/dist/node/{protocol-BocKczNv.d.ts → protocol-DcyGMmWY.d.cts} +7 -0
- package/dist/node/{protocol-BocKczNv.d.cts → protocol-DcyGMmWY.d.ts} +7 -0
- package/dist/node/{reactive-engine.svelte-CGe8SpVE.d.cts → reactive-engine.svelte-Cg0Yc2Hs.d.cts} +90 -6
- package/dist/node/{reactive-engine.svelte-D-xTDxT5.d.ts → reactive-engine.svelte-DekxqFu0.d.ts} +90 -6
- package/dist/node/{reverse-W7THPV45.js → reverse-YD3CWIGM.js} +3 -2
- package/dist/node/rules-4DAJ4Z4N.js +7 -0
- package/dist/node/server-SYZPDULV.js +361 -0
- package/dist/node/{validate-EN3M4FUR.js → validate-TQGVIG7G.js} +4 -3
- package/package.json +29 -3
- package/src/__tests__/engine-v2.test.ts +532 -0
- package/src/__tests__/expectations.test.ts +364 -0
- package/src/__tests__/factory.test.ts +426 -0
- package/src/__tests__/mcp-server.test.ts +310 -0
- package/src/__tests__/project.test.ts +396 -0
- package/src/cli/index.ts +28 -0
- package/src/core/completeness.ts +274 -0
- package/src/core/engine.ts +47 -5
- package/src/core/pluresdb/store.ts +9 -3
- package/src/core/protocol.ts +7 -0
- package/src/core/rule-result.ts +130 -0
- package/src/core/rules.ts +12 -5
- package/src/core/ui-rules.ts +340 -0
- package/src/expectations/expectations.ts +471 -0
- package/src/expectations/index.ts +29 -0
- package/src/expectations/types.ts +95 -0
- package/src/factory/factory.ts +634 -0
- package/src/factory/index.ts +27 -0
- package/src/factory/types.ts +64 -0
- package/src/index.ts +84 -0
- package/src/mcp/index.ts +33 -0
- package/src/mcp/server.ts +485 -0
- package/src/mcp/types.ts +161 -0
- package/src/project/index.ts +31 -0
- package/src/project/project.ts +423 -0
- package/src/project/types.ts +87 -0
- package/src/vite/completeness-plugin.ts +72 -0
- /package/dist/node/{chunk-R2PSBPKQ.js → chunk-TEMFJOIH.js} +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vite Plugin: Praxis Completeness Report
|
|
3
|
+
*
|
|
4
|
+
* Automatically outputs completeness score in build output.
|
|
5
|
+
* Silent by default in production builds unless `verbose: true`.
|
|
6
|
+
* Always shows in dev mode unless explicitly silenced.
|
|
7
|
+
*
|
|
8
|
+
* Usage in vite.config.ts:
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { praxisCompletenessPlugin } from '@plures/praxis/vite';
|
|
11
|
+
*
|
|
12
|
+
* export default defineConfig({
|
|
13
|
+
* plugins: [
|
|
14
|
+
* praxisCompletenessPlugin({
|
|
15
|
+
* manifestPath: './src/lib/completeness-manifest.ts',
|
|
16
|
+
* threshold: 90, // fail build if below (CI mode)
|
|
17
|
+
* strict: false, // set to true for CI
|
|
18
|
+
* silent: false, // set to true to suppress output
|
|
19
|
+
* }),
|
|
20
|
+
* ],
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
export interface PraxisCompletenessPluginOptions {
|
|
26
|
+
/**
|
|
27
|
+
* Path to the completeness manifest module.
|
|
28
|
+
* Must default-export or named-export { branches, stateFields, transitions, rulesNeedingContracts }.
|
|
29
|
+
*/
|
|
30
|
+
manifestPath?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Minimum score to pass (default: 90). Below this is a warning; in strict mode, an error.
|
|
33
|
+
*/
|
|
34
|
+
threshold?: number;
|
|
35
|
+
/**
|
|
36
|
+
* If true, build fails when below threshold. Use for CI.
|
|
37
|
+
*/
|
|
38
|
+
strict?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* If true, suppresses all completeness output.
|
|
41
|
+
*/
|
|
42
|
+
silent?: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Creates a Vite plugin that reports Praxis completeness in build output.
|
|
47
|
+
*
|
|
48
|
+
* The plugin loads the manifest at build time, evaluates coverage, and
|
|
49
|
+
* prints a summary. In strict mode, it fails the build if below threshold.
|
|
50
|
+
*/
|
|
51
|
+
export function praxisCompletenessPlugin(_options?: PraxisCompletenessPluginOptions) {
|
|
52
|
+
const options = _options ?? {};
|
|
53
|
+
const threshold = options.threshold ?? 90;
|
|
54
|
+
const silent = options.silent ?? false;
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
name: 'vite-plugin-praxis-completeness',
|
|
58
|
+
enforce: 'post' as const,
|
|
59
|
+
|
|
60
|
+
// We hook into buildEnd so the report appears at the end of the build
|
|
61
|
+
buildEnd() {
|
|
62
|
+
if (silent) return;
|
|
63
|
+
|
|
64
|
+
// This plugin works as a hook point — the actual manifest loading
|
|
65
|
+
// happens at the app level since manifests are app-specific.
|
|
66
|
+
// The plugin provides the infrastructure; apps wire their manifest.
|
|
67
|
+
console.log(`\n⟐ Praxis Completeness: threshold=${threshold}, strict=${options.strict ?? false}`);
|
|
68
|
+
console.log(' Import your manifest and call auditCompleteness() in a build script or test.');
|
|
69
|
+
console.log(' See @plures/praxis docs for setup.\n');
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
}
|
|
File without changes
|