Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
jogold committed Jun 9, 2020
1 parent 028281d commit 84460d2
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 199 deletions.
187 changes: 0 additions & 187 deletions packages/@aws-cdk/core/lib/assembly.ts

This file was deleted.

7 changes: 0 additions & 7 deletions packages/@aws-cdk/core/lib/deps.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Assembly } from './assembly';
import { CfnResource } from './cfn-resource';
import { Stack } from './stack';
import { Stage } from './stage';
Expand Down Expand Up @@ -31,13 +30,7 @@ export function addDependency<T extends Element>(source: T, target: T, reason?:
}

const sourceStack = Stack.of(source);
const sourceAssembly = Assembly.of(sourceStack);
const targetStack = Stack.of(target);
const targetAssembly = Assembly.of(targetStack);

if (sourceAssembly !== targetAssembly) {
throw new Error(`You cannot add a dependency from '${source.node.path}' (in ${describeAssembly(sourceAssembly)}) to '${target.node.path}' (in ${describeAssembly(targetAssembly)}): dependency cannot cross stage boundaries`);
}

const sourceStage = Stage.of(sourceStack);
const targetStage = Stage.of(targetStack);
Expand Down
1 change: 0 additions & 1 deletion packages/@aws-cdk/core/lib/private/prepare-app.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ConstructOrder } from 'constructs';
import { Assembly } from '../assembly';
import { CfnResource } from '../cfn-resource';
import { IConstruct } from '../construct-compat';
import { Stack } from '../stack';
Expand Down
1 change: 0 additions & 1 deletion packages/@aws-cdk/core/lib/stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,6 @@ function makeStackName(components: string[]) {

// These imports have to be at the end to prevent circular imports
import { Arn, ArnComponents } from './arn';
import { Assembly } from './assembly';
import { CfnElement } from './cfn-element';
import { Fn } from './cfn-fn';
import { Aws, ScopedAws } from './cfn-pseudo';
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/core/test/test.stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ export = {
new CfnParameter(stack1, 'SomeParameter', { type: 'String', default: account2 });

test.throws(() => {
app.synth();
ConstructNode.prepare(app.node);
// tslint:disable-next-line:max-line-length
}, "'Stack2' depends on 'Stack1' (Stack2/SomeParameter -> Stack1.AWS::AccountId). Adding this dependency (Stack1/SomeParameter -> Stack2.AWS::AccountId) would create a cyclic reference.");

Expand All @@ -541,7 +541,7 @@ export = {
// WHEN
new CfnParameter(stack2, 'SomeParameter', { type: 'String', default: account1 });

app.synth();
ConstructNode.prepare(app.node);

// THEN
test.deepEqual(stack2.dependencies.map(s => s.node.id), ['Stack1']);
Expand All @@ -560,7 +560,7 @@ export = {
new CfnParameter(stack2, 'SomeParameter', { type: 'String', default: account1 });

test.throws(() => {
app.synth();
ConstructNode.prepare(app.node);
}, /Stack "Stack2" cannot consume a cross reference from stack "Stack1"/);

test.done();
Expand Down

0 comments on commit 84460d2

Please sign in to comment.