cdk8s-cli
Version:
This is the command line tool for Cloud Development Kit (CDK) for Kubernetes (cdk8s).
125 lines • 16.9 kB
JavaScript
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const path = __importStar(require("path"));
const fs = __importStar(require("fs-extra"));
const pacmak = __importStar(require("jsii-pacmak"));
const pacmakv = __importStar(require("jsii-pacmak/lib/targets/version-utils"));
const sscaff_1 = require("sscaff");
const pkgroot = path.join(__dirname, '..', '..', '..');
const pkg = fs.readJsonSync(path.join(pkgroot, 'package.json'));
const constructsVersion = pkg.dependencies.constructs.replace('^', '');
const templatesDir = path.join(pkgroot, 'templates');
const availableTemplates = fs.readdirSync(templatesDir).filter(x => !x.startsWith('.'));
class Command {
constructor() {
this.command = 'init TYPE';
this.describe = 'Create a new cdk8s project from a template.';
this.builder = (args) => args
.positional('TYPE', { demandOption: true, desc: 'Project type' })
.showHelpOnFail(false)
.choices('TYPE', availableTemplates);
}
async handler(argv) {
var _a, _b;
if (fs.readdirSync('.').filter(f => !f.startsWith('.')).length > 0) {
console.error('Cannot initialize a project in a non-empty directory');
process.exit(1);
}
console.error(`Initializing a project from the ${argv.type} template`);
const templatePath = path.join(templatesDir, argv.type);
const deps = await determineDeps();
try {
await (0, sscaff_1.sscaff)(templatePath, '.', deps);
}
catch (er) {
const e = er;
throw new Error(`error during project initialization: ${e.stack}\nSTDOUT:\n${(_a = e.stdout) === null || _a === void 0 ? void 0 : _a.toString()}\nSTDERR:\n${(_b = e.stderr) === null || _b === void 0 ? void 0 : _b.toString()}`);
}
}
}
async function determineDeps() {
const cdk8s = new ModuleVersion('cdk8s', { jsii: true });
const cdk8sPlus = new ModuleVersion('cdk8s-plus-28', { jsii: true });
const cdk8sCli = new ModuleVersion('cdk8s-cli');
const jsii = new ModuleVersion('jsii-pacmak');
const cdk8sTarball = process.env.CDK8S_TARBALL;
const cdk8sTarballEscaped = cdk8sTarball ? (cdk8sTarball.replace(/\\/g, '\\\\')) : undefined;
return {
pypi_cdk8s: cdk8s.pypiDependency,
pypi_cdk8s_plus: cdk8sPlus.pypiDependency,
mvn_cdk8s: cdk8s.mavenDependency,
mvn_cdk8s_plus: cdk8sPlus.mavenDependency,
cdk8s_core_version: cdk8s.version,
cdk8s_plus_version: cdk8sPlus.version,
constructs_version: constructsVersion,
jsii_version: jsii.version,
cdk8s_cli_spec: cdk8sTarballEscaped !== null && cdk8sTarballEscaped !== void 0 ? cdk8sTarballEscaped : `^${cdk8sCli.version}`,
};
}
class ModuleVersion {
constructor(moduleName, options = {}) {
var _a;
this.moduleName = moduleName;
this.version = this.resolveVersion(moduleName);
this.npmVersion = this.version;
this.pypiVersion = pacmakv.toReleaseVersion(this.version, pacmak.TargetName.PYTHON);
this.mavenVersion = pacmakv.toReleaseVersion(this.version, pacmak.TargetName.JAVA);
this.jsii = (_a = options.jsii) !== null && _a !== void 0 ? _a : false;
}
get npmTarballFile() {
if (this.jsii) {
return `${this.moduleName}@${this.version}.jsii.tgz`;
}
else {
return `${this.moduleName}-v${this.version}.tgz`;
}
}
get pypiWheelFile() {
const [major, minor, patch, pre] = this.pypiVersion.split('.');
return `${this.moduleName.replace(/-/g, '_')}-${major}.${minor}.${patch}${pre !== null && pre !== void 0 ? pre : ''}-py3-none-any.whl`;
}
get javaJarFile() {
return `org/cdk8s/${this.moduleName}/${this.mavenVersion}/${this.moduleName}-${this.mavenVersion}.jar`;
}
get npmDependency() {
return `${this.moduleName}@^${this.npmVersion}`;
}
get pypiDependency() {
return `${this.moduleName}~=${this.pypiVersion}`;
}
get mavenDependency() {
return this.mavenVersion;
}
resolveVersion(module) {
if (module === 'cdk8s-cli') {
module = '../../../';
}
// eslint-disable-next-line @typescript-eslint/no-require-imports
return require(`${module}/package.json`).version;
}
}
module.exports = new Command();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5pdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbGkvY21kcy9pbml0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSwyQ0FBNkI7QUFDN0IsNkNBQStCO0FBQy9CLG9EQUFzQztBQUN0QywrRUFBaUU7QUFDakUsbUNBQWdDO0FBR2hDLE1BQU0sT0FBTyxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFFLElBQUksRUFBRSxJQUFJLEVBQUUsSUFBSSxDQUFDLENBQUM7QUFFdkQsTUFBTSxHQUFHLEdBQUcsRUFBRSxDQUFDLFlBQVksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLE9BQU8sRUFBRSxjQUFjLENBQUMsQ0FBQyxDQUFDO0FBQ2hFLE1BQU0saUJBQWlCLEdBQUcsR0FBRyxDQUFDLFlBQVksQ0FBQyxVQUFVLENBQUMsT0FBTyxDQUFDLEdBQUcsRUFBRSxFQUFFLENBQUMsQ0FBQztBQUV2RSxNQUFNLFlBQVksR0FBRyxJQUFJLENBQUMsSUFBSSxDQUFDLE9BQU8sRUFBRSxXQUFXLENBQUMsQ0FBQztB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