Skip to content

Commit

Permalink
move interface around
Browse files Browse the repository at this point in the history
  • Loading branch information
mrgrain committed Jan 20, 2025
1 parent b55e911 commit dc972d5
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 24 deletions.
1 change: 1 addition & 0 deletions lib/cloud-assembly/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export * from './schema';
export * from './metadata-schema';
export * from './artifact-schema';
export * from './context-queries';
export * from './interfaces';
31 changes: 31 additions & 0 deletions lib/cloud-assembly/interfaces.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// The interfaces in this file, mainly exist __here__ because this is a convenient place to put them.
// The Assembly Schema package is already a jsii package and a dependency of `aws-cdk-lib`.
// It is effectively the only place we can put shared interfaces to be used across the jsii ecosystem.
//
// Putting a shared interface in here should be a huge exception.
// It needs to be justified by great benefits it provides to the ecosystems.
// All interfaces should be as minimal as possible.

/**
* Interoperable representation of a deployable cloud application.
*
* The external and interoperable contract for a Cloud Assembly is
* a directory containing a valid Cloud Assembly.
*
* Implementations should use the directory to load the Cloud Assembly from disk.
* It is recommended that implementations validate loaded manifest files using
* the provided functionality from this package.
* Within an implementation, it may be prudent to keep (parts of) the Cloud Assembly
* in memory during execution and use an implementation-specific contract.
* However when an implementation is providing an external contract,
* this interface should be used.
*/
export interface ICloudAssembly {
/**
* The directory of the cloud assembly.
*
* This directory will be used to read the Cloud Assembly from.
* Its contents (in particular `manifest.json`) must comply with the schema defined in this package.
*/
readonly directory: string;
}
24 changes: 0 additions & 24 deletions lib/cloud-assembly/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,6 @@ import { ArtifactProperties } from './artifact-schema';
import { ContextProvider, ContextQueryProperties } from './context-queries';
import { MetadataEntry } from './metadata-schema';

/**
* Interoperable representation of a deployable cloud application.
*
* The external and interoperable contract for a Cloud Assembly is
* a directory containing a valid Cloud Assembly.
*
* Implementations should use the directory to load the Cloud Assembly from disk.
* It is recommended that implementations validate loaded manifest files using
* the provided functionality from this package.
* Within an implementation, it may be prudent to keep (parts of) the Cloud Assembly
* in memory during execution and use an implementation-specific contract.
* However when an implementation is providing an external contract,
* this interface should be used.
*/
export interface ICloudAssembly {
/**
* The directory of the cloud assembly.
*
* This directory will be used to read the Cloud Assembly from.
* Its contents (in particular `manifest.json`) must comply with the schema defined in this package.
*/
readonly directory: string;
}

/**
* Type of cloud artifact.
*/
Expand Down

0 comments on commit dc972d5

Please sign in to comment.