cdp-wallet-onramp-kit
Version:
Complete toolkit for Coinbase Developer Platform (CDP) Embedded Wallets and Onramp integration with reusable components, utilities, and documentation
80 lines (79 loc) • 3.22 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const commander_1 = require("commander");
const setup_docs_1 = require("./commands/setup-docs");
const init_project_1 = require("./commands/init-project");
const install_all_1 = require("./commands/install-all");
const validate_environment_1 = require("./commands/validate-environment");
const chalk_1 = __importDefault(require("chalk"));
const program = new commander_1.Command();
program
.name('cdp-wallet-onramp-kit')
.description('Complete toolkit for CDP Embedded Wallets and Onramp integration')
.version('1.0.2');
program
.command('setup')
.description('Set up documentation and templates in your project')
.option('-d, --dir <directory>', 'Target directory', './doc')
.option('-f, --force', 'Overwrite existing files')
.action(async (options) => {
try {
await (0, setup_docs_1.setupDocs)(options);
console.log(chalk_1.default.green('✅ CDP Wallet & Onramp documentation setup complete!'));
console.log(chalk_1.default.blue('📚 Check the ./doc directory for comprehensive guides'));
}
catch (error) {
console.error(chalk_1.default.red('❌ Setup failed:'), error);
process.exit(1);
}
});
program
.command('init')
.description('Initialize a new project with CDP Wallet & Onramp integration')
.option('-t, --template <template>', 'Template type (basic|complete)', 'basic')
.option('-d, --dir <directory>', 'Target directory', '.')
.action(async (options) => {
try {
await (0, init_project_1.initProject)(options);
console.log(chalk_1.default.green('✅ CDP project initialized successfully!'));
console.log(chalk_1.default.blue('🚀 Run npm install to install dependencies'));
}
catch (error) {
console.error(chalk_1.default.red('❌ Initialization failed:'), error);
process.exit(1);
}
});
program
.command('install')
.description('Install complete CDP integration - docs, components, API routes, and dependencies')
.option('-d, --dir <directory>', 'Target directory', '.')
.option('-f, --force', 'Overwrite existing files')
.action(async (options) => {
try {
await (0, install_all_1.installAll)(options);
console.log(chalk_1.default.green('🎉 Complete CDP integration installed successfully!'));
console.log(chalk_1.default.blue('📖 Check CDP_SETUP.md for next steps'));
}
catch (error) {
console.error(chalk_1.default.red('❌ Installation failed:'), error);
process.exit(1);
}
});
program
.command('validate')
.description('Validate CDP environment configuration')
.option('-v, --verbose', 'Show detailed debug information')
.action(async (options) => {
try {
await (0, validate_environment_1.validateEnvironment)(options);
}
catch (error) {
console.error(chalk_1.default.red('❌ Validation command failed:'), error);
process.exit(1);
}
});
program.parse(process.argv);