From 8cd84292d0a3b3ca88f2e262ac53f57626238d58 Mon Sep 17 00:00:00 2001 From: Kaizen Conroy Date: Tue, 11 Jul 2023 23:44:55 -0400 Subject: [PATCH 1/2] fix(pkglint): library creation generates incorrect package names --- packages/aws-cdk-lib/aws-backupgateway/README.md | 2 +- packages/aws-cdk-lib/aws-cleanrooms/README.md | 2 +- tools/@aws-cdk/pkglint/lib/library-creation.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/aws-cdk-lib/aws-backupgateway/README.md b/packages/aws-cdk-lib/aws-backupgateway/README.md index 71de5ac737451..1eb7cabfc3507 100644 --- a/packages/aws-cdk-lib/aws-backupgateway/README.md +++ b/packages/aws-cdk-lib/aws-backupgateway/README.md @@ -16,7 +16,7 @@ This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project. ```ts nofixture -import * as backupgateway from '@aws-cdk/aws-backupgateway'; +import * as backupgateway from 'aws-cdk-lib/aws-backupgateway'; ``` diff --git a/packages/aws-cdk-lib/aws-cleanrooms/README.md b/packages/aws-cdk-lib/aws-cleanrooms/README.md index 117249fc13e53..d5704db2b153e 100644 --- a/packages/aws-cdk-lib/aws-cleanrooms/README.md +++ b/packages/aws-cdk-lib/aws-cleanrooms/README.md @@ -16,7 +16,7 @@ This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project. ```ts nofixture -import * as cleanrooms from '@aws-cdk/aws-cleanrooms'; +import * as cleanrooms from 'aws-cdk-lib/aws-cleanrooms'; ``` diff --git a/tools/@aws-cdk/pkglint/lib/library-creation.ts b/tools/@aws-cdk/pkglint/lib/library-creation.ts index c035ce168c7e0..4287f99d5f969 100644 --- a/tools/@aws-cdk/pkglint/lib/library-creation.ts +++ b/tools/@aws-cdk/pkglint/lib/library-creation.ts @@ -24,7 +24,7 @@ export function createModuleDefinitionFromCfnNamespace(namespace: string): Modul const submoduleName = moduleName.replace('-', '_'); const lowcaseModuleName = moduleBaseName.toLocaleLowerCase(); - const packageName = `@aws-cdk/${moduleName}`; + const packageName = `aws-cdk-lib/${moduleName}`; // dotnet names const dotnetPackage = `Amazon.CDK.${moduleFamily}.${moduleBaseName}`; From 0a47a50f94f32b17ed6cc2436248967c26358035 Mon Sep 17 00:00:00 2001 From: Kaizen Conroy Date: Wed, 12 Jul 2023 11:39:17 -0400 Subject: [PATCH 2/2] fix tests --- packages/aws-cdk-lib/aws-proton/README.md | 2 +- tools/@aws-cdk/pkglint/test/libary-creation.test.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/aws-cdk-lib/aws-proton/README.md b/packages/aws-cdk-lib/aws-proton/README.md index 557882eeb9b6e..6b751e418d18d 100644 --- a/packages/aws-cdk-lib/aws-proton/README.md +++ b/packages/aws-cdk-lib/aws-proton/README.md @@ -16,7 +16,7 @@ This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project. ```ts nofixture -import * as proton from '@aws-cdk/aws-proton'; +import * as proton from 'aws-cdk-lib/aws-proton'; ``` diff --git a/tools/@aws-cdk/pkglint/test/libary-creation.test.ts b/tools/@aws-cdk/pkglint/test/libary-creation.test.ts index bf7a2e03ed5ca..d2d76b2c3ce9e 100644 --- a/tools/@aws-cdk/pkglint/test/libary-creation.test.ts +++ b/tools/@aws-cdk/pkglint/test/libary-creation.test.ts @@ -11,7 +11,7 @@ describe('createModuleDefinitionFromCfnNamespace', () => { moduleName: 'aws-ec2', moduleFamily: 'AWS', moduleBaseName: 'EC2', - packageName: '@aws-cdk/aws-ec2', + packageName: 'aws-cdk-lib/aws-ec2', dotnetPackage: 'Amazon.CDK.AWS.EC2', javaGroupId: 'software.amazon.awscdk', javaPackage: 'services.ec2', @@ -30,7 +30,7 @@ describe('createModuleDefinitionFromCfnNamespace', () => { moduleName: 'aws-sam', moduleFamily: 'AWS', moduleBaseName: 'SAM', - packageName: '@aws-cdk/aws-sam', + packageName: 'aws-cdk-lib/aws-sam', dotnetPackage: 'Amazon.CDK.AWS.SAM', javaGroupId: 'software.amazon.awscdk', javaPackage: 'services.sam', @@ -49,7 +49,7 @@ describe('createModuleDefinitionFromCfnNamespace', () => { moduleName: 'alexa-ask', moduleFamily: 'Alexa', moduleBaseName: 'ASK', - packageName: '@aws-cdk/alexa-ask', + packageName: 'aws-cdk-lib/alexa-ask', dotnetPackage: 'Amazon.CDK.Alexa.ASK', javaGroupId: 'software.amazon.awscdk', javaPackage: 'alexa.ask', @@ -81,6 +81,6 @@ describe('createLibraryReadme', () => { await createLibraryReadme('Alexa::ASK', readmePath); const readme = fs.readFileSync(readmePath, { encoding: 'utf8' }); - expect(readme).toContain("import * as alexa_ask from '@aws-cdk/alexa-ask';"); + expect(readme).toContain("import * as alexa_ask from 'aws-cdk-lib/alexa-ask';"); }); });