Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): only include cdk libs in version reporting #1290

Merged
merged 2 commits into from
Dec 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/@aws-cdk/cdk/lib/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ export class App extends Root {
}
}

// include only libraries that are in the @aws-cdk npm scope
for (const name of Object.keys(libraries)) {
if (!name.startsWith('@aws-cdk/')) {
delete libraries[name];
}
}

// add jsii runtime version
libraries['jsii-runtime'] = getJsiiAgentVersion();

Expand Down
20 changes: 19 additions & 1 deletion packages/@aws-cdk/cdk/test/test.app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,25 @@ export = {

delete process.env.JSII_AGENT;
test.done();
}
},

'version reporting includes only @aws-cdk, aws-cdk and jsii libraries'(test: Test) {
eladb marked this conversation as resolved.
Show resolved Hide resolved
const response = withApp({}, app => {
const stack = new Stack(app, 'stack1');
new Resource(stack, 'MyResource', { type: 'Resource::Type' });
});

const libs = response.runtime.libraries;

const version = require('../package.json').version;
test.deepEqual(libs, {
'@aws-cdk/cdk': version,
'@aws-cdk/cx-api': version,
'jsii-runtime': `node.js/${process.version}`
});

test.done();
},
};

class MyConstruct extends Construct {
Expand Down