We welcome contributions! This guide will help you get started.
-
Clone the repository
git clone https://github.com/drawdb-io/drawdb-cli.git cd drawdb-cli -
Install dependencies
npm install
-
Link for local testing
npm link
This makes the
drawdb-clicommand available globally, pointing to your local source.
bin/: CLI entry point (drawdb-cli.js)src/: Source codecli.js: CLI logic (Commander.js)index.js: Main library exportconverters/: Format converters (one file per format)data/: Constants and type definitionsutils/: Shared utilities
tests/: Jest unit tests and fixtures
We use Jest for testing.
# Run all tests
npm test
# Run specific test file
npm test tests/mysql.test.js
# Run with coverage
npm run test:coverage- Create a new file in
src/converters/(e.g.,oracle.js). - Implement
toOracle(diagram)(export) and optionallyfromOracle(sql)(import). - Register the converter in
src/converters/index.js:oracle: { name: "Oracle", extensions: [".plsql"], import: null, // or fromOracle export: toOracle }
- Add unit tests in
tests/oracle.test.js. - Update
README.mdsupported formats table.
-
Use ES Modules (
import/export). -
Follow existing patterns for SQL generation.
-
Ensure all tests pass before submitting a PR.
-
Ensure all tests pass before submitting a PR.