Skip to content

Commit

Permalink
merge from main
Browse files Browse the repository at this point in the history
Signed-off-by: Francis <[email protected]>
  • Loading branch information
colifran committed May 10, 2023
1 parent 5b47021 commit 9506b6f
Show file tree
Hide file tree
Showing 23 changed files with 2,916 additions and 0 deletions.
1,528 changes: 1,528 additions & 0 deletions packages/cdk-cli-wrapper/.jsii

Large diffs are not rendered by default.

73 changes: 73 additions & 0 deletions packages/cdk-cli-wrapper/.warnings.jsii.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
function cdk_cli_wrapper_ICdk(p) {
}
function cdk_cli_wrapper_SynthFastOptions(p) {
}
function cdk_cli_wrapper_Environment(p) {
}
function cdk_cli_wrapper_CdkCliWrapperOptions(p) {
}
function cdk_cli_wrapper_CdkCliWrapper(p) {
}
function cdk_cli_wrapper_SynthOptions(p) {
}
function cdk_cli_wrapper_RequireApproval(p) {
}
function cdk_cli_wrapper_DefaultCdkOptions(p) {
}
function cdk_cli_wrapper_DeployOptions(p) {
if (p == null)
return;
visitedObjects.add(p);
try {
if (!visitedObjects.has(p.progress))
cdk_cli_wrapper_StackActivityProgress(p.progress);
if (!visitedObjects.has(p.requireApproval))
cdk_cli_wrapper_RequireApproval(p.requireApproval);
}
finally {
visitedObjects.delete(p);
}
}
function cdk_cli_wrapper_StackActivityProgress(p) {
}
function cdk_cli_wrapper_DestroyOptions(p) {
}
function cdk_cli_wrapper_ListOptions(p) {
}
function print(name, deprecationMessage) {
const deprecated = process.env.JSII_DEPRECATED;
const deprecationMode = ["warn", "fail", "quiet"].includes(deprecated) ? deprecated : "warn";
const message = `${name} is deprecated.\n ${deprecationMessage.trim()}\n This API will be removed in the next major release.`;
switch (deprecationMode) {
case "fail":
throw new DeprecationError(message);
case "warn":
console.warn("[WARNING]", message);
break;
}
}
function getPropertyDescriptor(obj, prop) {
const descriptor = Object.getOwnPropertyDescriptor(obj, prop);
if (descriptor) {
return descriptor;
}
const proto = Object.getPrototypeOf(obj);
const prototypeDescriptor = proto && getPropertyDescriptor(proto, prop);
if (prototypeDescriptor) {
return prototypeDescriptor;
}
return {};
}
const visitedObjects = new Set();
class DeprecationError extends Error {
constructor(...args) {
super(...args);
Object.defineProperty(this, "name", {
configurable: false,
enumerable: true,
value: "DeprecationError",
writable: false,
});
}
}
module.exports = { print, getPropertyDescriptor, DeprecationError, cdk_cli_wrapper_ICdk, cdk_cli_wrapper_SynthFastOptions, cdk_cli_wrapper_Environment, cdk_cli_wrapper_CdkCliWrapperOptions, cdk_cli_wrapper_CdkCliWrapper, cdk_cli_wrapper_SynthOptions, cdk_cli_wrapper_RequireApproval, cdk_cli_wrapper_DefaultCdkOptions, cdk_cli_wrapper_DeployOptions, cdk_cli_wrapper_StackActivityProgress, cdk_cli_wrapper_DestroyOptions, cdk_cli_wrapper_ListOptions };
139 changes: 139 additions & 0 deletions packages/cdk-cli-wrapper/lib/cdk-wrapper.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
import { DeployOptions, DestroyOptions, SynthOptions, ListOptions } from './commands';
/**
* AWS CDK CLI operations
*/
export interface ICdk {
/**
* cdk deploy
*/
deploy(options: DeployOptions): void;
/**
* cdk synth
*/
synth(options: SynthOptions): void;
/**
* cdk destroy
*/
destroy(options: DestroyOptions): void;
/**
* cdk list
*/
list(options: ListOptions): string;
/**
* cdk synth fast
*/
synthFast(options: SynthFastOptions): void;
}
/**
* Options for synthing and bypassing the CDK CLI
*/
export interface SynthFastOptions {
/**
* The command to use to execute the app.
* This is typically the same thing that normally
* gets passed to `--app`
*
* e.g. "node 'bin/my-app.ts'"
* or 'go run main.go'
*/
readonly execCmd: string[];
/**
* Emits the synthesized cloud assembly into a directory
*
* @default cdk.out
*/
readonly output?: string;
/**
* Additional context
*
* @default - no additional context
*/
readonly context?: Record<string, string>;
/**
* Additional environment variables to set in the
* execution environment
*
* @default - no additional env
*/
readonly env?: {
[name: string]: string;
};
}
/**
* Additional environment variables to set in the execution environment
*
* @deprecated Use raw property bags instead (object literals, `Map<String,Object>`, etc... )
*/
export interface Environment {
/**
* This index signature is not usable in non-TypeScript/JavaScript languages.
*
* @jsii ignore
*/
[key: string]: string | undefined;
}
/**
* AWS CDK client that provides an API to programatically execute the CDK CLI
* by wrapping calls to exec the CLI
*/
export interface CdkCliWrapperOptions {
/**
* The directory to run the cdk commands from
*/
readonly directory: string;
/**
* Additional environment variables to set
* in the execution environment that will be running
* the cdk commands
*
* @default - no additional env vars
*/
readonly env?: {
[name: string]: string;
};
/**
* The path to the cdk executable
*
* @default 'aws-cdk/bin/cdk'
*/
readonly cdkExecutable?: string;
/**
* Show the output from running the CDK CLI
*
* @default false
*/
readonly showOutput?: boolean;
}
/**
* Provides a programmatic interface for interacting with the CDK CLI by
* wrapping the CLI with exec
*/
export declare class CdkCliWrapper implements ICdk {
private readonly directory;
private readonly env?;
private readonly cdk;
private readonly showOutput;
constructor(options: CdkCliWrapperOptions);
private validateArgs;
list(options: ListOptions): string;
/**
* cdk deploy
*/
deploy(options: DeployOptions): void;
/**
* cdk destroy
*/
destroy(options: DestroyOptions): void;
/**
* cdk synth
*/
synth(options: SynthOptions): void;
/**
* Do a CDK synth, mimicking the CLI (without actually using it)
*
* The CLI has a pretty slow startup time because of all the modules it needs to load,
* Bypass it to be quicker!
*/
synthFast(options: SynthFastOptions): void;
private createDefaultArguments;
}
Loading

0 comments on commit 9506b6f

Please sign in to comment.