Skip to main content
Glama
cli.mjs1.22 kB
#!/usr/bin/env node import { fixCjsDts, fixCjsExports } from "./chunk-4QUQJTWZ.mjs"; // src/cli.ts import path from "path"; import { cac } from "cac"; // package.json var name = "fix-tsup-cjs"; var version = "1.2.0"; // src/to-array.ts var toArray = (val) => { if (!val) return []; return Array.isArray(val) ? val : [val]; }; // src/cli.ts var cli = cac(name); cli.version(version); cli.command("[...files]", "Custom matching files glob").option("--cwd [path]", "Set fix directory", { default: "dist" }).option("--dts", "Fix commonjs d.ts and d.cts files", { default: true }).option("-i, --ignore [...files]", "Ignore files").option("--silent", "Suppress logs").action(async (files, options) => { const { dts, silent } = options; const hasCustomMatchFiles = !!files?.length; const currentDir = process.cwd(); const cwd = path.resolve(currentDir, options.cwd); const ignore = toArray(options.ignore); await fixCjsExports({ files, globOptions: { cwd: hasCustomMatchFiles ? currentDir : cwd, ignore }, silent }); if (dts) { await fixCjsDts({ globOptions: { cwd, ignore }, silent }); } }); cli.help(); cli.parse();

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sadiuysal/mem0-mcp-server-ts'

If you have feedback or need assistance with the MCP directory API, please join our Discord server