Skip to content

chore: rewrite jsii targets for experimental packages during transformation#15890

Merged
mergify[bot] merged 1 commit intov2-mainfrom
njlynch/alpha-package-on-transform
Aug 4, 2021
Merged

chore: rewrite jsii targets for experimental packages during transformation#15890
mergify[bot] merged 1 commit intov2-mainfrom
njlynch/alpha-package-on-transform

Conversation

@njlynch
Copy link
Copy Markdown
Contributor

@njlynch njlynch commented Aug 4, 2021

As part of #15722, the decision was made to change the package.json files for
experimental packages to add 'alpha' identifiers. This ends up causing issues
for our ubergen-ed packages (i.e., aws-cdk-lib), which then try to include L1s
for these packages under the 'alpha' namespaces. Instead, switch (back) to
adding the alpha identifiers as part of the package transformation step.

Reverted the change to the pkglint rules, and re-ran yarn pkglint to update
the package.json files.

I also did some light refactoring, since the method was a bit hard to read.

fixes #15845


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

…mation

As part of #15722, the decision was made to change the package.json files for
experimental packages to add 'alpha' identifiers. This ends up causing issues
for our ubergen-ed packages (i.e., aws-cdk-lib), which then try to include L1s
for these packages under the 'alpha' namespaces. Instead, switch (back) to
adding the alpha identifiers as part of the package transformation step.

Reverted the change to the pkglint rules, and re-ran `yarn pkglint` to update
the package.json files.

I also did some light refactoring, since the method was a bit hard to read.

fixes #15845
@njlynch njlynch requested review from a team and nija-at August 4, 2021 15:28
@njlynch njlynch self-assigned this Aug 4, 2021
@gitpod-io
Copy link
Copy Markdown

gitpod-io bot commented Aug 4, 2021

@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Aug 4, 2021
Comment on lines +98 to +109
const jsiiTargets = packageJson.jsii.targets;
jsiiTargets.dotnet.namespace = jsiiTargets.dotnet.namespace.replace(
/^Amazon\.CDK\./, 'Amazon.CDK.Alpha.');
jsiiTargets.java.package = jsiiTargets.java.package.replace(
/^software\.amazon\.awscdk\./, 'software.amazon.awscdk.alpha.');
jsiiTargets.java.maven.artifactId = jsiiTargets.java.maven.artifactId.startsWith('cdk-')
? jsiiTargets.java.maven.artifactId.replace(/cdk-/, 'cdk-alpha.')
: 'cdk-alpha.aws-' + jsiiTargets.java.maven.artifactId;
jsiiTargets.python.distName = jsiiTargets.python.distName.replace(
/^aws-cdk\./, 'aws-cdk.alpha.');
jsiiTargets.python.module = jsiiTargets.python.module.replace(
/^aws_cdk\./, 'aws_cdk.alpha.');
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only new code in this file - the rest is a refactor. Sourced from #15722 (comment)

@aws-cdk-automation
Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: efcf474
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit dba3421 into v2-main Aug 4, 2021
@mergify mergify bot deleted the njlynch/alpha-package-on-transform branch August 4, 2021 16:09
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Aug 4, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution/core This is a PR that came from AWS.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants