Skip to content

Commit

Permalink
Rename serverless to sam
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Goodwin committed Mar 22, 2019
1 parent 0de2206 commit cf61189
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 15 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions packages/@aws-cdk/aws-sam/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## AWS Serverless Construct Library

```ts
const sam = require('@aws-cdk/aws-sam');
```
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// AWS::Serverless CloudFormation Resources:
export * from './serverless.generated';
export * from './sam.generated';
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@aws-cdk/aws-serverless",
"name": "@aws-cdk/aws-sam",
"version": "0.26.0",
"description": "The CDK Construct Library for AWS::Serverless",
"main": "lib/index.js",
Expand All @@ -8,16 +8,16 @@
"outdir": "dist",
"targets": {
"dotnet": {
"namespace": "Amazon.CDK.AWS.Serverless",
"packageId": "Amazon.CDK.AWS.Serverless",
"namespace": "Amazon.CDK.AWS.Sam",
"packageId": "Amazon.CDK.AWS.Sam",
"signAssembly": true,
"assemblyOriginatorKeyFile": "../../key.snk"
},
"java": {
"package": "software.amazon.awscdk.services.serverless",
"package": "software.amazon.awscdk.services.sam",
"maven": {
"groupId": "software.amazon.awscdk",
"artifactId": "serverless"
"artifactId": "sam"
}
},
"sphinx": {}
Expand Down Expand Up @@ -46,7 +46,7 @@
"aws",
"cdk",
"constructs",
"aws-serverless"
"aws-sam"
],
"author": {
"name": "Amazon Web Services",
Expand Down
File renamed without changes.
5 changes: 0 additions & 5 deletions packages/@aws-cdk/aws-serverless/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion packages/decdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@
"@aws-cdk/aws-s3": "^0.26.0",
"@aws-cdk/aws-s3-deployment": "^0.26.0",
"@aws-cdk/aws-s3-notifications": "^0.26.0",
"@aws-cdk/aws-sam": "^0.26.0",
"@aws-cdk/aws-sagemaker": "^0.26.0",
"@aws-cdk/aws-sdb": "^0.26.0",
"@aws-cdk/aws-secretsmanager": "^0.26.0",
"@aws-cdk/aws-serverless": "^0.26.0",
"@aws-cdk/aws-servicecatalog": "^0.26.0",
"@aws-cdk/aws-servicediscovery": "^0.26.0",
"@aws-cdk/aws-ses": "^0.26.0",
Expand Down
12 changes: 11 additions & 1 deletion tools/awslint/lib/rules/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,17 @@ moduleLinter.add( {
eval: e => {
if (!e.ctx.namespace) { return; }
if (!e.ctx.assembly) { return; }
const namespace = e.ctx.namespace.toLocaleLowerCase().replace('::', '-');
const namespace = overrideNamespace(e.ctx.namespace.toLocaleLowerCase().replace('::', '-'));
e.assertEquals(e.ctx.assembly.name, `@aws-cdk/${namespace}`, e.ctx.assembly.name);
}
});

/**
* Overrides special-case namespaces like aws-serverless=>aws-sam
*/
function overrideNamespace(namespace: string) {
if (namespace === 'aws-serverless') {
return 'aws-sam';
}
return namespace;
}
12 changes: 11 additions & 1 deletion tools/cfn2ts/lib/genspec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,17 @@ export function packageName(module: SpecName | string): string {
throw new Error(`Module component name must be "AWS::Xxx" or "Alexa::Xxx" (module: ${module})`);
}

return parts[parts.length - 1].toLowerCase();
return overridePackageName(parts[parts.length - 1].toLowerCase());
}

/**
* Overrides special-case namespaces like serverless=>sam
*/
function overridePackageName(name: string) {
if (name === 'serverless') {
return 'sam';
}
return name;
}

/**
Expand Down

0 comments on commit cf61189

Please sign in to comment.