nx-serverless-cdk
Version:
nx-serverless-cdk is an Nx plugin for creating AWS CDK applications and libraries inside an Nx monorepo. It offers the possibility to test and debug CDK applications as well as AWS Lambda functions locally. The plugin provides the full flexibility of the
27 lines • 1.18 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.runExecutor = void 0;
const node_path_1 = require("node:path");
const execute_command_1 = require("../../utils/execute-command");
const get_project_root_1 = require("../../utils/get-project-root");
const get_samconfig_path_1 = require("../../utils/get-samconfig-path");
const runExecutor = async (options, context) => {
const projectRootResolved = (0, node_path_1.resolve)(context.root, (0, get_project_root_1.getProjectRoot)(context));
const { predefinedArguments, __unparsed__ } = options;
const samconfigPath = (0, get_samconfig_path_1.getSamconfigPath)(__unparsed__, projectRootResolved);
const command = `sam`;
const args = [...(predefinedArguments ?? []), ...__unparsed__];
if (samconfigPath) {
args.unshift('--config-file', samconfigPath);
}
args.unshift('local', 'start-lambda');
await (0, execute_command_1.executeCommand)(command, args, {
cwd: projectRootResolved,
});
return {
success: true,
};
};
exports.runExecutor = runExecutor;
exports.default = exports.runExecutor;
//# sourceMappingURL=executor.js.map
;