@plures/pluresdb 1.4.0 → 1.5.3
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 +1 -1
- package/package.json +1 -1
- package/scripts/publish-crates.sh +95 -0
- package/scripts/release-check.js +34 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PluresDB
|
|
2
2
|
|
|
3
|
-
[](https://badge.fury.io/js/pluresdb)
|
|
3
|
+
[](https://badge.fury.io/js/@plures/pluresdb)
|
|
4
4
|
[](https://crates.io/crates/pluresdb-core)
|
|
5
5
|
[](https://deno.land)
|
|
6
6
|
[](https://opensource.org/licenses/AGPL-3.0)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plures/pluresdb",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"description": "P2P Graph Database with SQLite Compatibility - Local-first, offline-first database for modern applications",
|
|
5
5
|
"main": "dist/node-index.js",
|
|
6
6
|
"types": "dist/node-index.d.ts",
|
|
@@ -0,0 +1,95 @@
|
|
|
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
|
+
|
package/scripts/release-check.js
CHANGED
|
@@ -38,15 +38,49 @@ function checkPackageVersions() {
|
|
|
38
38
|
const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8'));
|
|
39
39
|
const cargoToml = fs.readFileSync('Cargo.toml', 'utf8');
|
|
40
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
|
+
|
|
41
47
|
const packageVersion = packageJson.version;
|
|
42
48
|
const cargoMatch = cargoToml.match(/^version\s*=\s*"([^"]+)"/m);
|
|
43
49
|
const cargoVersion = cargoMatch ? cargoMatch[1] : null;
|
|
44
50
|
|
|
45
51
|
console.log(` package.json: ${packageVersion}`);
|
|
46
52
|
console.log(` Cargo.toml: ${cargoVersion || 'not found'}`);
|
|
53
|
+
if (denoVersion) {
|
|
54
|
+
console.log(` deno.json: ${denoVersion}`);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
let hasError = false;
|
|
47
58
|
|
|
48
59
|
if (cargoVersion && packageVersion !== cargoVersion) {
|
|
49
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) {
|
|
50
84
|
return false;
|
|
51
85
|
}
|
|
52
86
|
|