chore: A round of "yarn fix" for everyone (#75)

This commit is contained in:
Felix Rieseberg 2025-07-18 10:09:52 -07:00 • committed by GitHub
commit 7c9d61d9e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 58 additions and 42 deletions

2
CLI.md
View file

@ -157,12 +157,10 @@ dxt unsign my-extension.dxt
For signing extensions, you need:
1. **Certificate**: X.509 certificate in PEM format
- Should have Code Signing extended key usage
- Can be self-signed (for development) or CA-issued (for production)
2. **Private Key**: Corresponding private key in PEM format
- Must match the certificate's public key
3. **Intermediate Certificates** (optional): For CA-issued certificates

View file

@ -290,14 +290,12 @@ The `server` object defines how to run the MCP server:
### Server Types
1. **Python**: `server.type = "python"`
- Requires `entry_point` to Python file
- All dependencies must be bundled in the DXT
- Can use `server/lib` for packages or `server/venv` for full virtual environment
- Python runtime version specified in `compatibility.runtimes.python`
2. **Node.js**: `server.type = "node"`
- Requires `entry_point` to JavaScript file
- All dependencies must be bundled in `node_modules`
- Node.js runtime version specified in `compatibility.runtimes.node`

View file

@ -71,11 +71,7 @@
]
}
},
"keywords": [
"api",
"automation",
"productivity"
],
"keywords": ["api", "automation", "productivity"],
"license": "MIT",
"compatibility": {
"claude_desktop": ">=0.10.0",

View file

@ -18,12 +18,15 @@ const loadServer = async () => {
process.argv = [process.argv[0], process.argv[1], ...args];
// Dynamically import the ESM module
await import('@modelcontextprotocol/server-filesystem/dist/index.js');
await import("@modelcontextprotocol/server-filesystem/dist/index.js");
// Restore original argv
process.argv = originalArgv;
} catch (error) {
console.error('Failed to load @modelcontextprotocol/server-filesystem:', error);
console.error(
"Failed to load @modelcontextprotocol/server-filesystem:",
error,
);
process.exit(1);
}
};

View file

@ -8,7 +8,7 @@ export default {
"^.+\\.ts$": [
"ts-jest",
{
tsConfig: 'tsconfig.test.json'
tsConfig: "tsconfig.test.json",
},
],
},

View file

@ -78,5 +78,6 @@
"resolutions": {
"@babel/helpers": "7.27.1",
"@babel/parser": "7.27.3"
}
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}

View file

@ -4,9 +4,9 @@ import fs from "node:fs/promises";
import path from "node:path";
const schemasToWrite = {
'dxt-manifest': DxtManifestSchema,
'dxt-signature-info': DxtSignatureInfoSchema
}
"dxt-manifest": DxtManifestSchema,
"dxt-signature-info": DxtSignatureInfoSchema,
};
await fs.mkdir(path.join(import.meta.dirname, "../dist"), { recursive: true });
@ -20,4 +20,3 @@ for (const key in schemasToWrite) {
},
);
}

View file

@ -1,5 +1,11 @@
import { unzipSync } from "fflate";
import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
import {
chmodSync,
existsSync,
mkdirSync,
readFileSync,
writeFileSync,
} from "fs";
import { join, resolve, sep } from "path";
import { extractSignatureBlock } from "../node/sign.js";
@ -61,7 +67,11 @@ export async function unpackExtension({
if (zipBuffer.readUInt32LE(offset) === 0x02014b50) {
const externalAttrs = zipBuffer.readUInt32LE(offset + 38);
const filenameLength = zipBuffer.readUInt16LE(offset + 28);
const filename = zipBuffer.toString('utf8', offset + 46, offset + 46 + filenameLength);
const filename = zipBuffer.toString(
"utf8",
offset + 46,
offset + 46 + filenameLength,
);
// Extract Unix permissions from external attributes (upper 16 bits)
const mode = (externalAttrs >> 16) & 0o777;

View file

@ -207,7 +207,10 @@ describe("DXT CLI", () => {
// Create an executable script
const executableScript = join(tempExecDir, "run-script.sh");
fs.writeFileSync(executableScript, "#!/bin/bash\necho 'Hello from executable'");
fs.writeFileSync(
executableScript,
"#!/bin/bash\necho 'Hello from executable'",
);
fs.chmodSync(executableScript, 0o755); // Make it executable
// Create a regular file for comparison
@ -221,13 +224,18 @@ describe("DXT CLI", () => {
});
// Unpack the extension
execSync(`node ${cliPath} unpack ${execPackedFilePath} ${execUnpackedDir}`, {
encoding: "utf-8",
});
execSync(
`node ${cliPath} unpack ${execPackedFilePath} ${execUnpackedDir}`,
{
encoding: "utf-8",
},
);
// Check that the executable file preserved its permissions
const originalStats = fs.statSync(executableScript);
const unpackedStats = fs.statSync(join(execUnpackedDir, "run-script.sh"));
const unpackedStats = fs.statSync(
join(execUnpackedDir, "run-script.sh"),
);
// Check that executable permissions are preserved (0o755)
expect(unpackedStats.mode & 0o777).toBe(0o755);
@ -235,11 +243,14 @@ describe("DXT CLI", () => {
// Check that regular file permissions are preserved (0o644)
const originalRegularStats = fs.statSync(regularFile);
const unpackedRegularStats = fs.statSync(join(execUnpackedDir, "regular-file.txt"));
const unpackedRegularStats = fs.statSync(
join(execUnpackedDir, "regular-file.txt"),
);
expect(unpackedRegularStats.mode & 0o777).toBe(0o644);
expect(originalRegularStats.mode & 0o777).toBe(unpackedRegularStats.mode & 0o777);
expect(originalRegularStats.mode & 0o777).toBe(
unpackedRegularStats.mode & 0o777,
);
} finally {
// Clean up
fs.rmSync(tempExecDir, { recursive: true, force: true });

View file

@ -4,7 +4,7 @@
"noEmit": true,
"module": "node18",
"moduleResolution": "node16",
"types": ["node", "jest"],
"types": ["node", "jest"]
},
"include": ["src/**/*.ts", "test/**/*.ts"]
}