UNPKG

declapract

Version:

A tool to declaratively define best practices, maintainable evolve them, and scalably enforce them.

41 lines 1.78 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const core_1 = require("@oclif/core"); const compile_1 = require("../../logic/commands/compile"); // eslint-disable-next-line import/no-default-export class Compile extends core_1.Command { async run() { const { flags } = await this.parse(Compile); const sourceDirectory = flags.sourceDirectory; const distributionDirectory = flags.distributionDirectory; // generate the code const sourceDirectoryAbsolute = sourceDirectory.slice(0, 1) === '/' ? sourceDirectory : `${process.cwd()}/${sourceDirectory}`; // if starts with /, consider it as an absolute path const distributionDirectoryAbsolute = distributionDirectory.slice(0, 1) === '/' ? distributionDirectory : `${process.cwd()}/${distributionDirectory}`; // if starts with /, consider it as an absolute path await (0, compile_1.compile)({ sourceDirectory: sourceDirectoryAbsolute, distributionDirectory: distributionDirectoryAbsolute, }); } } Compile.description = 'compile the declared declarations so that they can be packaged and distributed by npm safely'; Compile.flags = { help: core_1.Flags.help({ char: 'h' }), sourceDirectory: core_1.Flags.string({ char: 's', description: 'the source directory which contains the declarations to compile', required: true, default: 'src', }), distributionDirectory: core_1.Flags.string({ char: 'd', description: 'the distribution directory to which we will compile the declarations', required: true, default: 'dist', }), }; exports.default = Compile; //# sourceMappingURL=compile.js.map