@plures/pluresdb 1.5.3 โ†’ 2.9.6

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.
Files changed (103) hide show
  1. package/README.md +106 -414
  2. package/crates/README.md +99 -0
  3. package/crates/pluresdb-node/README.md +181 -0
  4. package/crates/pluresdb-node/index.d.ts +0 -0
  5. package/crates/pluresdb-node/index.js +265 -0
  6. package/crates/pluresdb-node/package.json +35 -0
  7. package/dist/napi/index.js +60 -0
  8. package/embedded.d.ts +1 -0
  9. package/embedded.js +46 -0
  10. package/package.json +27 -10
  11. package/dist/.tsbuildinfo +0 -1
  12. package/dist/better-sqlite3-shared.d.ts +0 -12
  13. package/dist/better-sqlite3-shared.d.ts.map +0 -1
  14. package/dist/better-sqlite3-shared.js +0 -143
  15. package/dist/better-sqlite3-shared.js.map +0 -1
  16. package/dist/better-sqlite3.d.ts +0 -4
  17. package/dist/better-sqlite3.d.ts.map +0 -1
  18. package/dist/better-sqlite3.js +0 -8
  19. package/dist/better-sqlite3.js.map +0 -1
  20. package/dist/cli.d.ts +0 -7
  21. package/dist/cli.d.ts.map +0 -1
  22. package/dist/cli.js.map +0 -1
  23. package/dist/node-index.d.ts +0 -148
  24. package/dist/node-index.d.ts.map +0 -1
  25. package/dist/node-index.js +0 -665
  26. package/dist/node-index.js.map +0 -1
  27. package/dist/node-wrapper.d.ts +0 -44
  28. package/dist/node-wrapper.d.ts.map +0 -1
  29. package/dist/node-wrapper.js +0 -296
  30. package/dist/node-wrapper.js.map +0 -1
  31. package/dist/types/index.d.ts +0 -28
  32. package/dist/types/index.d.ts.map +0 -1
  33. package/dist/types/index.js +0 -3
  34. package/dist/types/index.js.map +0 -1
  35. package/dist/types/node-types.d.ts +0 -71
  36. package/dist/types/node-types.d.ts.map +0 -1
  37. package/dist/types/node-types.js +0 -6
  38. package/dist/types/node-types.js.map +0 -1
  39. package/dist/vscode/extension.d.ts +0 -81
  40. package/dist/vscode/extension.d.ts.map +0 -1
  41. package/dist/vscode/extension.js +0 -309
  42. package/dist/vscode/extension.js.map +0 -1
  43. package/examples/basic-usage.d.ts +0 -2
  44. package/examples/basic-usage.d.ts.map +0 -1
  45. package/examples/basic-usage.js +0 -26
  46. package/examples/basic-usage.js.map +0 -1
  47. package/examples/basic-usage.ts +0 -29
  48. package/examples/vscode-extension-example/README.md +0 -95
  49. package/examples/vscode-extension-example/package.json +0 -49
  50. package/examples/vscode-extension-example/src/extension.ts +0 -172
  51. package/examples/vscode-extension-example/tsconfig.json +0 -12
  52. package/examples/vscode-extension-integration.d.ts +0 -31
  53. package/examples/vscode-extension-integration.d.ts.map +0 -1
  54. package/examples/vscode-extension-integration.js +0 -319
  55. package/examples/vscode-extension-integration.js.map +0 -1
  56. package/examples/vscode-extension-integration.ts +0 -41
  57. package/legacy/benchmarks/memory-benchmarks.ts +0 -350
  58. package/legacy/benchmarks/run-benchmarks.ts +0 -315
  59. package/legacy/better-sqlite3-shared.ts +0 -157
  60. package/legacy/better-sqlite3.ts +0 -4
  61. package/legacy/cli.ts +0 -241
  62. package/legacy/config.ts +0 -50
  63. package/legacy/core/crdt.ts +0 -107
  64. package/legacy/core/database.ts +0 -529
  65. package/legacy/healthcheck.ts +0 -162
  66. package/legacy/http/api-server.ts +0 -438
  67. package/legacy/index.ts +0 -28
  68. package/legacy/logic/rules.ts +0 -46
  69. package/legacy/main.rs +0 -3
  70. package/legacy/main.ts +0 -197
  71. package/legacy/network/websocket-server.ts +0 -115
  72. package/legacy/node-index.ts +0 -823
  73. package/legacy/node-wrapper.ts +0 -329
  74. package/legacy/sqlite-compat.ts +0 -633
  75. package/legacy/sqlite3-compat.ts +0 -55
  76. package/legacy/storage/kv-storage.ts +0 -73
  77. package/legacy/tests/core.test.ts +0 -305
  78. package/legacy/tests/fixtures/performance-data.json +0 -71
  79. package/legacy/tests/fixtures/test-data.json +0 -129
  80. package/legacy/tests/integration/api-server.test.ts +0 -334
  81. package/legacy/tests/integration/mesh-network.test.ts +0 -303
  82. package/legacy/tests/logic.test.ts +0 -34
  83. package/legacy/tests/performance/load.test.ts +0 -290
  84. package/legacy/tests/security/input-validation.test.ts +0 -286
  85. package/legacy/tests/unit/core.test.ts +0 -226
  86. package/legacy/tests/unit/subscriptions.test.ts +0 -135
  87. package/legacy/tests/unit/vector-search.test.ts +0 -173
  88. package/legacy/tests/vscode_extension_test.ts +0 -281
  89. package/legacy/types/index.ts +0 -32
  90. package/legacy/types/node-types.ts +0 -80
  91. package/legacy/util/debug.ts +0 -14
  92. package/legacy/vector/index.ts +0 -59
  93. package/legacy/vscode/extension.ts +0 -387
  94. package/scripts/compiled-crud-verify.ts +0 -30
  95. package/scripts/dogfood.ts +0 -297
  96. package/scripts/postinstall.js +0 -156
  97. package/scripts/publish-crates.sh +0 -95
  98. package/scripts/release-check.js +0 -224
  99. package/scripts/run-tests.ts +0 -178
  100. package/scripts/setup-libclang.ps1 +0 -209
  101. package/scripts/update-changelog.js +0 -214
  102. package/web/README.md +0 -27
  103. package/web/svelte/package.json +0 -31
@@ -1,156 +0,0 @@
1
- /**
2
- * Post-install script for PluresDB npm package
3
- * This script ensures Deno is available and sets up the environment
4
- */
5
-
6
- const { spawn, exec } = require("child_process");
7
- const fs = require("fs");
8
- const path = require("path");
9
- const os = require("os");
10
-
11
- const DENO_VERSION = "1.40.0";
12
-
13
- function log(message) {
14
- console.log(`[pluresdb] ${message}`);
15
- }
16
-
17
- function logError(message) {
18
- console.error(`[pluresdb] ERROR: ${message}`);
19
- }
20
-
21
- function isDenoInstalled() {
22
- return new Promise((resolve) => {
23
- exec("deno --version", (error) => {
24
- resolve(!error);
25
- });
26
- });
27
- }
28
-
29
- function installDeno() {
30
- return new Promise((resolve, reject) => {
31
- const platform = os.platform();
32
- const arch = os.arch();
33
-
34
- log("Installing Deno...");
35
-
36
- let installCommand;
37
-
38
- if (platform === "win32") {
39
- // Windows - use PowerShell
40
- installCommand =
41
- `powershell -c "iwr https://deno.land/install.ps1 -useb | iex"`;
42
- } else if (platform === "darwin") {
43
- // macOS - use Homebrew or curl
44
- installCommand = "curl -fsSL https://deno.land/install.sh | sh";
45
- } else {
46
- // Linux - use curl
47
- installCommand = "curl -fsSL https://deno.land/install.sh | sh";
48
- }
49
-
50
- exec(installCommand, (error, stdout, stderr) => {
51
- if (error) {
52
- logError(`Failed to install Deno: ${error.message}`);
53
- logError("Please install Deno manually from https://deno.land/");
54
- reject(error);
55
- } else {
56
- log("Deno installed successfully");
57
- resolve();
58
- }
59
- });
60
- });
61
- }
62
-
63
- function createStartScript() {
64
- const scriptContent = `#!/bin/bash
65
- # PluresDB start script
66
- export DENO_INSTALL="$HOME/.deno"
67
- export PATH="$DENO_INSTALL/bin:$PATH"
68
-
69
- # Start PluresDB
70
- deno run -A "${path.join(__dirname, "../src/main.ts")}" serve "$@"
71
- `;
72
-
73
- const scriptPath = path.join(__dirname, "../bin/pluresdb.sh");
74
- const scriptDir = path.dirname(scriptPath);
75
-
76
- if (!fs.existsSync(scriptDir)) {
77
- fs.mkdirSync(scriptDir, { recursive: true });
78
- }
79
-
80
- fs.writeFileSync(scriptPath, scriptContent);
81
- fs.chmodSync(scriptPath, "755");
82
-
83
- log("Created start script");
84
- }
85
-
86
- function createWindowsStartScript() {
87
- const scriptContent = `@echo off
88
- REM PluresDB start script for Windows
89
- set DENO_INSTALL=%USERPROFILE%\\.deno
90
- set PATH=%DENO_INSTALL%\\bin;%PATH%
91
-
92
- REM Start PluresDB
93
- deno run -A "${path.join(__dirname, "../src/main.ts")}" serve %*
94
- `;
95
-
96
- const scriptPath = path.join(__dirname, "../bin/pluresdb.bat");
97
- const scriptDir = path.dirname(scriptPath);
98
-
99
- if (!fs.existsSync(scriptDir)) {
100
- fs.mkdirSync(scriptDir, { recursive: true });
101
- }
102
-
103
- fs.writeFileSync(scriptPath, scriptContent);
104
-
105
- log("Created Windows start script");
106
- }
107
-
108
- async function main() {
109
- try {
110
- log("Setting up PluresDB...");
111
-
112
- // Check if Deno is installed
113
- const denoInstalled = await isDenoInstalled();
114
-
115
- if (!denoInstalled) {
116
- log("Deno not found, attempting to install...");
117
- try {
118
- await installDeno();
119
- } catch {
120
- logError("Failed to install Deno automatically");
121
- logError("Please install Deno manually:");
122
- logError(" Windows: iwr https://deno.land/install.ps1 -useb | iex");
123
- logError(" macOS/Linux: curl -fsSL https://deno.land/install.sh | sh");
124
- logError(" Or visit: https://deno.land/");
125
- return;
126
- }
127
- } else {
128
- log("Deno is already installed");
129
- }
130
-
131
- // Create start scripts
132
- createStartScript();
133
- if (os.platform() === "win32") {
134
- createWindowsStartScript();
135
- }
136
-
137
- // Create data directory
138
- const dataDir = path.join(os.homedir(), ".pluresdb");
139
- if (!fs.existsSync(dataDir)) {
140
- fs.mkdirSync(dataDir, { recursive: true });
141
- log(`Created data directory: ${dataDir}`);
142
- }
143
-
144
- log("Setup complete!");
145
- log("Usage:");
146
- log(" npx pluresdb serve");
147
- log(" or");
148
- log(" node node_modules/pluresdb/dist/cli.js serve");
149
- } catch (error) {
150
- logError(`Setup failed: ${error.message}`);
151
- Deno.exit(1);
152
- }
153
- }
154
-
155
- // Run the setup
156
- main();
@@ -1,95 +0,0 @@
1
- #!/bin/bash
2
- # Publish all PluresDB crates to crates.io
3
- # Usage: ./scripts/publish-crates.sh
4
-
5
- set -e
6
-
7
- echo "=========================================="
8
- echo "Publishing PluresDB Crates to crates.io"
9
- echo "=========================================="
10
- echo ""
11
-
12
- # Check if logged in
13
- if ! cargo login --check 2>/dev/null; then
14
- echo "Error: Not logged in to crates.io"
15
- echo "Run: cargo login <your-api-token>"
16
- exit 1
17
- fi
18
-
19
- # Colors for output
20
- GREEN='\033[0;32m'
21
- YELLOW='\033[1;33m'
22
- RED='\033[0;31m'
23
- NC='\033[0m' # No Color
24
-
25
- # Function to publish a crate
26
- publish_crate() {
27
- local crate_name=$1
28
- local crate_path=$2
29
-
30
- echo -e "${YELLOW}Publishing ${crate_name}...${NC}"
31
- cd "$crate_path"
32
-
33
- # Verify it builds
34
- echo " Building..."
35
- if ! cargo build --release > /dev/null 2>&1; then
36
- echo -e "${RED} โœ— Build failed${NC}"
37
- return 1
38
- fi
39
-
40
- # Run tests
41
- echo " Running tests..."
42
- if ! cargo test > /dev/null 2>&1; then
43
- echo -e "${RED} โœ— Tests failed${NC}"
44
- return 1
45
- fi
46
-
47
- # Check package
48
- echo " Checking package..."
49
- if ! cargo package > /dev/null 2>&1; then
50
- echo -e "${RED} โœ— Package check failed${NC}"
51
- return 1
52
- fi
53
-
54
- # Publish
55
- echo " Publishing to crates.io..."
56
- if cargo publish; then
57
- echo -e "${GREEN} โœ“ ${crate_name} published successfully${NC}"
58
- cd - > /dev/null
59
- return 0
60
- else
61
- echo -e "${RED} โœ— Publishing failed${NC}"
62
- cd - > /dev/null
63
- return 1
64
- fi
65
- }
66
-
67
- # Publish in dependency order
68
- echo "Publishing crates in dependency order..."
69
- echo ""
70
-
71
- # Note: pluresdb-core and pluresdb-sync are already published
72
- # Uncomment if you need to republish them:
73
- # publish_crate "pluresdb-core" "crates/pluresdb-core"
74
- # publish_crate "pluresdb-sync" "crates/pluresdb-sync"
75
-
76
- # Publish storage (depends on core)
77
- publish_crate "pluresdb-storage" "crates/pluresdb-storage"
78
- echo ""
79
-
80
- # Publish unified main crate (depends on core, storage, sync)
81
- publish_crate "pluresdb" "crates/pluresdb"
82
- echo ""
83
-
84
- # Publish CLI (depends on core, storage, sync)
85
- publish_crate "pluresdb-cli" "crates/pluresdb-cli"
86
- echo ""
87
-
88
- echo "=========================================="
89
- echo -e "${GREEN}All crates published successfully!${NC}"
90
- echo "=========================================="
91
- echo ""
92
- echo "Note: pluresdb-node and pluresdb-deno are published separately:"
93
- echo " - pluresdb-node: npm publish (in crates/pluresdb-node)"
94
- echo " - pluresdb-deno: deno publish (in crates/pluresdb-deno)"
95
-
@@ -1,224 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * Pre-release validation checks
5
- * Ensures the repository is ready for a release
6
- *
7
- * Usage: node scripts/release-check.js
8
- */
9
-
10
- const { execSync } = require('child_process');
11
- const fs = require('fs');
12
- const path = require('path');
13
-
14
- function run(cmd, ignoreError = false) {
15
- try {
16
- return execSync(cmd, { encoding: 'utf8', stdio: 'pipe' }).trim();
17
- } catch (e) {
18
- if (ignoreError) return null;
19
- throw e;
20
- }
21
- }
22
-
23
- function checkGitStatus() {
24
- console.log('๐Ÿ” Checking git status...');
25
- const status = run('git status --porcelain', true);
26
-
27
- if (status && status.length > 0) {
28
- console.warn('โš ๏ธ Warning: Working directory has uncommitted changes');
29
- console.log(status);
30
- } else {
31
- console.log('โœ… Working directory is clean');
32
- }
33
- }
34
-
35
- function checkPackageVersions() {
36
- console.log('\n๐Ÿ” Checking package versions...');
37
-
38
- const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8'));
39
- const cargoToml = fs.readFileSync('Cargo.toml', 'utf8');
40
-
41
- let denoVersion = null;
42
- if (fs.existsSync('deno.json')) {
43
- const denoJson = JSON.parse(fs.readFileSync('deno.json', 'utf8'));
44
- denoVersion = denoJson.version;
45
- }
46
-
47
- const packageVersion = packageJson.version;
48
- const cargoMatch = cargoToml.match(/^version\s*=\s*"([^"]+)"/m);
49
- const cargoVersion = cargoMatch ? cargoMatch[1] : null;
50
-
51
- console.log(` package.json: ${packageVersion}`);
52
- console.log(` Cargo.toml: ${cargoVersion || 'not found'}`);
53
- if (denoVersion) {
54
- console.log(` deno.json: ${denoVersion}`);
55
- }
56
-
57
- let hasError = false;
58
-
59
- if (cargoVersion && packageVersion !== cargoVersion) {
60
- console.error('โŒ Version mismatch between package.json and Cargo.toml');
61
- console.error('');
62
- console.error('To fix this issue:');
63
- console.error(` 1. Update package.json version from ${packageVersion} to ${cargoVersion}`);
64
- console.error(` OR update Cargo.toml version from ${cargoVersion} to ${packageVersion}`);
65
- console.error(' 2. Ensure both files always have the same version number');
66
- console.error(' 3. Run this check again: npm run release-check');
67
- console.error('');
68
- console.error('Note: The version in both files must be identical for releases.');
69
- hasError = true;
70
- }
71
-
72
- if (denoVersion && packageVersion !== denoVersion) {
73
- console.error('โŒ Version mismatch between package.json and deno.json');
74
- console.error('');
75
- console.error('To fix this issue:');
76
- console.error(` 1. Update deno.json version from ${denoVersion} to ${packageVersion}`);
77
- console.error(` OR update package.json version from ${packageVersion} to ${denoVersion}`);
78
- console.error(' 2. Ensure both files always have the same version number');
79
- console.error('');
80
- hasError = true;
81
- }
82
-
83
- if (hasError) {
84
- return false;
85
- }
86
-
87
- console.log('โœ… Package versions are consistent');
88
- return true;
89
- }
90
-
91
- function checkChangelog() {
92
- console.log('\n๐Ÿ” Checking CHANGELOG.md...');
93
-
94
- if (!fs.existsSync('CHANGELOG.md')) {
95
- console.error('โŒ CHANGELOG.md not found');
96
- return false;
97
- }
98
-
99
- const changelog = fs.readFileSync('CHANGELOG.md', 'utf8');
100
- const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8'));
101
- const currentVersion = packageJson.version;
102
-
103
- if (!changelog.includes(`## [${currentVersion}]`)) {
104
- console.warn(`โš ๏ธ Warning: Current version ${currentVersion} not found in CHANGELOG.md`);
105
- } else {
106
- console.log(`โœ… CHANGELOG.md includes current version ${currentVersion}`);
107
- }
108
-
109
- return true;
110
- }
111
-
112
- function checkCommitMessages() {
113
- console.log('\n๐Ÿ” Checking recent commit messages...');
114
-
115
- const lastTag = run('git describe --tags --abbrev=0 2>/dev/null', true);
116
- const range = lastTag ? `${lastTag}..HEAD` : '--all';
117
-
118
- const commits = run(`git log --format="%s" ${range}`, true);
119
-
120
- if (!commits) {
121
- console.log('โ„น๏ธ No commits to check');
122
- return true;
123
- }
124
-
125
- const commitLines = commits.split('\n').filter(Boolean);
126
- const conventionalTypes = ['feat', 'fix', 'docs', 'style', 'refactor', 'perf', 'test', 'chore', 'ci', 'build', 'revert'];
127
-
128
- let conventionalCount = 0;
129
- commitLines.forEach(commit => {
130
- const match = commit.match(/^(\w+)(\(.+\))?:/);
131
- if (match && conventionalTypes.includes(match[1])) {
132
- conventionalCount++;
133
- }
134
- });
135
-
136
- const percentage = (conventionalCount / commitLines.length * 100).toFixed(0);
137
- console.log(` ${conventionalCount}/${commitLines.length} commits follow conventional format (${percentage}%)`);
138
-
139
- if (conventionalCount === 0) {
140
- console.warn('โš ๏ธ Warning: No conventional commits found');
141
- } else {
142
- console.log('โœ… Found conventional commits');
143
- }
144
-
145
- return true;
146
- }
147
-
148
- function checkBuildStatus() {
149
- console.log('\n๐Ÿ” Checking if project builds...');
150
-
151
- try {
152
- // Check if npm build works
153
- console.log(' Running npm run build:lib...');
154
- run('npm run build:lib');
155
- console.log('โœ… Build successful');
156
- return true;
157
- } catch (e) {
158
- console.error('โŒ Build failed');
159
- console.error(e.message);
160
- return false;
161
- }
162
- }
163
-
164
- function checkTests() {
165
- console.log('\n๐Ÿ” Checking tests...');
166
-
167
- try {
168
- console.log(' Running tests...');
169
- run('npm test');
170
- console.log('โœ… Tests passed');
171
- return true;
172
- } catch (e) {
173
- console.error('โŒ Tests failed');
174
- console.error(e.message);
175
- return false;
176
- }
177
- }
178
-
179
- function main() {
180
- console.log('๐Ÿš€ Running pre-release checks for pluresdb\n');
181
-
182
- let allPassed = true;
183
-
184
- try {
185
- checkGitStatus();
186
-
187
- if (!checkPackageVersions()) {
188
- allPassed = false;
189
- }
190
-
191
- if (!checkChangelog()) {
192
- allPassed = false;
193
- }
194
-
195
- checkCommitMessages();
196
-
197
- // Skip build and test checks in CI for now
198
- if (process.env.CI !== 'true') {
199
- if (!checkBuildStatus()) {
200
- allPassed = false;
201
- }
202
-
203
- if (!checkTests()) {
204
- allPassed = false;
205
- }
206
- } else {
207
- console.log('\nโ„น๏ธ Skipping build and test checks in CI');
208
- }
209
-
210
- console.log('\n' + '='.repeat(50));
211
- if (allPassed) {
212
- console.log('โœ… All pre-release checks passed!');
213
- process.exit(0);
214
- } else {
215
- console.log('โŒ Some pre-release checks failed');
216
- process.exit(1);
217
- }
218
- } catch (e) {
219
- console.error('\nโŒ Pre-release check error:', e.message);
220
- process.exit(1);
221
- }
222
- }
223
-
224
- main();
@@ -1,178 +0,0 @@
1
- #!/usr/bin/env -S deno run -A --unstable-kv
2
-
3
- // @ts-nocheck
4
-
5
- interface TestSuite {
6
- name: string;
7
- command: string;
8
- description: string;
9
- timeout?: number;
10
- }
11
-
12
- interface TestResults {
13
- suite: string;
14
- passed: boolean;
15
- duration: number;
16
- output: string;
17
- error?: string;
18
- }
19
-
20
- class TestRunner {
21
- private results: TestResults[] = [];
22
-
23
- async runTestSuite(suite: TestSuite): Promise<TestResults> {
24
- console.log(`\n๐Ÿงช Running ${suite.name}...`);
25
- console.log(` ${suite.description}`);
26
-
27
- const startTime = performance.now();
28
-
29
- try {
30
- const command = new Deno.Command("deno", {
31
- args: suite.command.split(" "),
32
- stdout: "piped",
33
- stderr: "piped",
34
- });
35
-
36
- const { code, stdout, stderr } = await command.output();
37
- const duration = performance.now() - startTime;
38
-
39
- const output = new TextDecoder().decode(stdout);
40
- const error = new TextDecoder().decode(stderr);
41
-
42
- const result: TestResults = {
43
- suite: suite.name,
44
- passed: code === 0,
45
- duration,
46
- output,
47
- error: code !== 0 ? error : undefined,
48
- };
49
-
50
- this.results.push(result);
51
-
52
- if (result.passed) {
53
- console.log(` โœ… Passed (${duration.toFixed(2)}ms)`);
54
- } else {
55
- console.log(` โŒ Failed (${duration.toFixed(2)}ms)`);
56
- console.log(` Error: ${result.error}`);
57
- }
58
-
59
- return result;
60
- } catch (error) {
61
- const duration = performance.now() - startTime;
62
-
63
- const result: TestResults = {
64
- suite: suite.name,
65
- passed: false,
66
- duration,
67
- output: "",
68
- error: error.message,
69
- };
70
-
71
- this.results.push(result);
72
-
73
- console.log(` โŒ Failed (${duration.toFixed(2)}ms)`);
74
- console.log(` Error: ${error.message}`);
75
-
76
- return result;
77
- }
78
- }
79
-
80
- printSummary() {
81
- console.log("\n" + "=".repeat(80));
82
- console.log("TEST SUMMARY");
83
- console.log("=".repeat(80));
84
-
85
- const passed = this.results.filter((r) => r.passed).length;
86
- const total = this.results.length;
87
- const totalDuration = this.results.reduce((sum, r) => sum + r.duration, 0);
88
-
89
- console.log(`Total Tests: ${total}`);
90
- console.log(`Passed: ${passed}`);
91
- console.log(`Failed: ${total - passed}`);
92
- console.log(`Total Duration: ${totalDuration.toFixed(2)}ms`);
93
- console.log(`Success Rate: ${((passed / total) * 100).toFixed(1)}%`);
94
-
95
- console.log("\nDetailed Results:");
96
- this.results.forEach((result) => {
97
- const status = result.passed ? "โœ…" : "โŒ";
98
- console.log(
99
- ` ${status} ${result.suite} (${result.duration.toFixed(2)}ms)`,
100
- );
101
- });
102
-
103
- if (passed < total) {
104
- console.log("\nFailed Tests:");
105
- this.results
106
- .filter((r) => !r.passed)
107
- .forEach((result) => {
108
- console.log(`\nโŒ ${result.suite}:`);
109
- console.log(` Error: ${result.error}`);
110
- });
111
- }
112
- }
113
- }
114
-
115
- async function main() {
116
- console.log("๐Ÿš€ PluresDB Test Suite Runner");
117
- console.log("===============================");
118
-
119
- const testSuites: TestSuite[] = [
120
- {
121
- name: "Unit Tests",
122
- command: "test -A --unstable-kv --parallel src/tests/unit/",
123
- description:
124
- "Core functionality tests (CRUD, subscriptions, vector search)",
125
- timeout: 30000,
126
- },
127
- {
128
- name: "Integration Tests",
129
- command: "test -A --unstable-kv --parallel src/tests/integration/",
130
- description: "Mesh networking and API server tests",
131
- timeout: 60000,
132
- },
133
- {
134
- name: "Performance Tests",
135
- command: "test -A --unstable-kv --parallel src/tests/performance/",
136
- description: "Load testing and performance validation",
137
- timeout: 120000,
138
- },
139
- {
140
- name: "Security Tests",
141
- command: "test -A --unstable-kv --parallel src/tests/security/",
142
- description: "Input validation and security testing",
143
- timeout: 30000,
144
- },
145
- {
146
- name: "Code Quality",
147
- command: "lint src/",
148
- description: "Code linting and style checks",
149
- timeout: 10000,
150
- },
151
- {
152
- name: "Type Checking",
153
- command: "check src/main.ts",
154
- description: "TypeScript type checking",
155
- timeout: 15000,
156
- },
157
- ];
158
-
159
- const runner = new TestRunner();
160
-
161
- for (const suite of testSuites) {
162
- await runner.runTestSuite(suite);
163
- }
164
-
165
- runner.printSummary();
166
-
167
- const failedTests = runner.results.filter((r) => !r.passed).length;
168
- if (failedTests > 0) {
169
- console.log(`\nโŒ ${failedTests} test suite(s) failed!`);
170
- Deno.exit(1);
171
- } else {
172
- console.log("\n๐ŸŽ‰ All tests passed!");
173
- }
174
- }
175
-
176
- if (import.meta.main) {
177
- await main();
178
- }