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

fix(pkglint): library creation generates incorrect package names #26330

Merged
merged 4 commits into from
Jul 12, 2023
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
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-backupgateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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';
```

<!--BEGIN CFNONLY DISCLAIMER-->
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-cleanrooms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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';
```

<!--BEGIN CFNONLY DISCLAIMER-->
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-proton/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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';
```

<!--BEGIN CFNONLY DISCLAIMER-->
Expand Down
2 changes: 1 addition & 1 deletion tools/@aws-cdk/pkglint/lib/library-creation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand Down
8 changes: 4 additions & 4 deletions tools/@aws-cdk/pkglint/test/libary-creation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand Down Expand Up @@ -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';");
});
});