Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { typescriptVersionsSync, typescriptVersionsYoungerThanDaysSync } from '.

await shell.shell(['cdk', 'init', '--lib-version', context.library.requestedVersion(), '-l', 'typescript', template]);

await shell.shell(['npm', 'ci']); // this will fail if we have bundled dependencies that introduce version conflicts

await shell.shell(['npm', 'prune']);
await shell.shell(['npm', 'ls']); // this will fail if we have unmet peer dependencies
await shell.shell(['npm', 'run', 'build']);
Expand Down Expand Up @@ -48,6 +50,7 @@ TYPESCRIPT_VERSIONS.forEach(tsVersion => {
await shell.shell(['npm', 'install', '--save-dev', 'ts-node@^10']);

await shell.shell(['npm', 'install']); // Older versions of npm require this to be a separate step from the one above

await shell.shell(['npx', 'tsc', '--version']);
await shell.shell(['npm', 'prune']);
await shell.shell(['npm', 'ls']); // this will fail if we have unmet peer dependencies
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import * as fs from 'fs/promises';
import { integTest, withTemporaryDirectory, ShellHelper, withPackages } from '../../lib';

// Sometimes, due to our own use of bundled dependencies, NPM will fail if a customer declares
// aws-cdk-lib as a bundled dependency. Test whether that still works.
integTest('using aws-cdk-lib as a bundled dependency', withTemporaryDirectory(withPackages(async (context) => {
const shell = ShellHelper.fromContext(context);
await context.cli.makeCliAvailable();

await shell.shell(['npm', 'init', '-y']);

const packageJson = JSON.parse(await fs.readFile('package.json', 'utf-8'));

packageJson.dependencies = {
...packageJson.dependencies,
'aws-cdk-lib': context.library.requestedVersion(),
};
packageJson.bundleDependencies = ['aws-cdk-lib'];

await fs.writeFile('package.json', JSON.stringify(packageJson, undefined, 2), 'utf-8');

await shell.shell(['npm', 'install']);
})));
Loading