Skip to content

Commit e30b8c2

Browse files
chore: sync from internal
1 parent 97fd86d commit e30b8c2

10 files changed

Lines changed: 106 additions & 5 deletions

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"lint": "turbo run lint",
1515
"check-types": "turbo run check-types",
1616
"release": "yarn build && yarn pack-release && yarn changeset publish",
17-
"test": "turbo run test"
17+
"test": "turbo run test",
18+
"check-package-configs": "node scripts/check-package-configs.mjs"
1819
},
1920
"workspaces": [
2021
"packages/*",

packages/mcp-server/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# @phantom/mcp-server
22

3+
## 0.2.4
4+
5+
### Patch Changes
6+
7+
- 04a0319: Fix dependencies
8+
- Updated dependencies [04a0319]
9+
- @phantom/perps-client@0.1.4
10+
- @phantom/phantom-api-client@0.1.2
11+
312
## 0.2.3
413

514
### Patch Changes

packages/mcp-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@phantom/mcp-server",
3-
"version": "0.2.3",
3+
"version": "0.2.4",
44
"description": "MCP Server for Phantom Wallet",
55
"repository": {
66
"type": "git",

packages/perps-client/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# @phantom/perps-client
22

3+
## 0.1.4
4+
5+
### Patch Changes
6+
7+
- 04a0319: Fix dependencies
8+
- Updated dependencies [04a0319]
9+
- @phantom/phantom-api-client@0.1.2
10+
311
## 0.1.3
412

513
### Patch Changes

packages/perps-client/package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@phantom/perps-client",
3-
"version": "0.1.3",
3+
"version": "0.1.4",
44
"description": "Hyperliquid perpetuals client for Phantom Wallet",
55
"repository": {
66
"type": "git",
@@ -18,6 +18,8 @@
1818
}
1919
},
2020
"scripts": {
21+
"?pack-release": "When https://github.com/changesets/changesets/issues/432 has a solution we can remove this trick",
22+
"pack-release": "rimraf ./_release && yarn pack && mkdir ./_release && tar zxvf ./package.tgz --directory ./_release && rm ./package.tgz",
2123
"build": "rimraf ./dist && tsup src/index.ts --format cjs,esm --dts",
2224
"dev": "tsc --watch",
2325
"test": "jest",
@@ -40,5 +42,11 @@
4042
"@phantom/phantom-api-client": "workspace:^",
4143
"axios": "^1.6.7",
4244
"js-sha3": "^0.9.3"
45+
},
46+
"files": [
47+
"dist"
48+
],
49+
"publishConfig": {
50+
"directory": "_release/package"
4351
}
4452
}

packages/phantom-api-client/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @phantom/phantom-api-client
22

3+
## 0.1.2
4+
5+
### Patch Changes
6+
7+
- 04a0319: Fix dependencies
8+
39
## 0.1.1
410

511
### Patch Changes

packages/phantom-api-client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@phantom/phantom-api-client",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "Shared HTTP client for api.phantom.app with 402/429 payment gating support",
55
"repository": {
66
"type": "git",

packages/phantom-openclaw-plugin/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# @phantom/openclaw-plugin
22

3+
## 0.2.4
4+
5+
### Patch Changes
6+
7+
- 04a0319: Fix dependencies
8+
- Updated dependencies [04a0319]
9+
- @phantom/mcp-server@0.2.4
10+
- @phantom/phantom-api-client@0.1.2
11+
312
## 0.2.3
413

514
### Patch Changes

packages/phantom-openclaw-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@phantom/phantom-openclaw-plugin",
3-
"version": "0.2.3",
3+
"version": "0.2.4",
44
"description": "OpenClaw plugin that bridges tool calls to Phantom's MCP server for wallet operations.",
55
"repository": {
66
"type": "git",

scripts/check-package-configs.mjs

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/usr/bin/env node
2+
/**
3+
* Validates that every public package in packages/* has:
4+
* 1. repository.url === EXPECTED_REPO_URL
5+
* 2. pack-release script + publishConfig.directory (required when workspace: deps are present)
6+
*/
7+
import fs from "fs";
8+
import path from "path";
9+
import { fileURLToPath } from "url";
10+
11+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
12+
const PACKAGES_DIR = path.resolve(__dirname, "../packages");
13+
const EXPECTED_REPO_URL = "https://github.com/phantom/phantom-connect-sdk";
14+
15+
const errors = [];
16+
17+
const packageDirs = fs
18+
.readdirSync(PACKAGES_DIR)
19+
.filter(name => fs.statSync(path.join(PACKAGES_DIR, name)).isDirectory());
20+
21+
for (const dir of packageDirs) {
22+
const pkgPath = path.join(PACKAGES_DIR, dir, "package.json");
23+
if (!fs.existsSync(pkgPath)) continue;
24+
25+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
26+
if (pkg.private) continue;
27+
28+
const prefix = `[${pkg.name}]`;
29+
30+
// 1. repository.url check
31+
if (pkg.repository?.url !== EXPECTED_REPO_URL) {
32+
errors.push(`${prefix} repository.url is "${pkg.repository?.url ?? ""}", expected "${EXPECTED_REPO_URL}"`);
33+
}
34+
35+
// 2. pack-release + publishConfig required when workspace: deps are present
36+
const allDeps = {
37+
...pkg.dependencies,
38+
...pkg.devDependencies,
39+
...pkg.peerDependencies,
40+
...pkg.optionalDependencies,
41+
};
42+
const hasWorkspaceDeps = Object.values(allDeps).some(v => String(v).startsWith("workspace:"));
43+
44+
if (hasWorkspaceDeps) {
45+
if (!pkg.scripts?.["pack-release"]) {
46+
errors.push(`${prefix} has workspace: deps but is missing the "pack-release" script`);
47+
}
48+
if (pkg.publishConfig?.directory !== "_release/package") {
49+
errors.push(`${prefix} has workspace: deps but publishConfig.directory is not "_release/package"`);
50+
}
51+
}
52+
}
53+
54+
if (errors.length > 0) {
55+
console.error("Package config check failed:\n");
56+
errors.forEach(e => console.error(` ✗ ${e}`));
57+
process.exit(1);
58+
} else {
59+
console.log(`Package config check passed (${packageDirs.length} packages checked).`);
60+
}

0 commit comments

Comments
 (0)