DeployStack Docs

docker-to-iac Available Commands

The following commands are currently supported:

Build Commands

  • npm run build
    • Builds the module using TypeScript compiler and creates output files inside the dist/ directory.

Code Quality Commands

  • npm run lint
    • Runs ESLint to check code quality. ESLint is also run as part of GitHub action test for new pull requests on the default main branch.

Testing Commands

  • npm run test
    • Runs the complete test suite including both unit tests and end-to-end tests.
  • npm run test:unit
    • Runs only the unit tests to validate individual components.
  • npm run test:e2e
    • Runs only the end-to-end tests which validate the entire translation process from Docker run commands or Docker Compose files to infrastructure as code.
  • npm run test:watch
    • Runs tests in watch mode, which automatically re-runs tests when files change.
  • npm run test:coverage
    • Runs tests with coverage reporting to identify untested code paths.

Release Commands

  • npm run release
    • Runs the release-it command which is part of the release process of docker-to-iac modules to npm registry. The release is executed through configurations defined in .release-it.js.

Other Commands

  • npm run pretest:e2e
    • Automatically run before e2e tests to clean the output directory.

You can view all commands and their configurations in the package.json file.

Examples

Running Unit Tests Only

npm run test:unit

Running End-to-End Tests Only

npm run test:e2e

Running All Tests with Coverage

npm run test:coverage

Building the Module

npm run build

Checking Code Quality

npm run lint

Each command is configured to provide the most relevant feedback for its purpose. For example, unit tests provide detailed output about each individual function, while end-to-end tests show a summary of the complete translation process from Docker configurations to infrastructure as code.