Skip to content

Commit

Permalink
Removed shared package (as a real package) and just literally share t…
Browse files Browse the repository at this point in the history
…he Typescript file
  • Loading branch information
andrewpatto committed Nov 14, 2023
1 parent 90f2a1d commit 58f250c
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 190 deletions.
2 changes: 1 addition & 1 deletion packages/client/infrastructure-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
vpcPrivateSubnetRouteTableIdsParameterName,
vpcPublicSubnetIdsParameterName,
vpcPublicSubnetRouteTableIdsParameterName,
} from "shared";
} from "@common/parameter-names";
import { ISecret, Secret } from "aws-cdk-lib/aws-secretsmanager";
import { Bucket, IBucket } from "aws-cdk-lib/aws-s3";

Expand Down
15 changes: 8 additions & 7 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,19 @@
],
"jsii": {
"outdir": "dist",
"targets": {}
"targets": {},
"tsc": {
"paths": {
"@common/*": [
"../common/*"
]
}
}
},
"peerDependencies": {
"aws-cdk-lib": "^2.100.0",
"constructs": "^10.3.0"
},
"dependencies": {
"shared": "file:../shared"
},
"bundledDependencies": [
"shared"
],
"devDependencies": {
"aws-cdk-lib": "2.100.0",
"constructs": "10.3.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/common/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/*.js
**/*.d.ts
5 changes: 5 additions & 0 deletions packages/common/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
We just want to be able to share some common string definitions
between both our actual stack and the client library.

There is very little "code" here - so we are not worried about
the fact these functions end up duplicated into both packages.
92 changes: 92 additions & 0 deletions packages/common/parameter-names.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
export function vpcIdParameterName(infrastructureStackId: string) {
return `/${infrastructureStackId}/VPC/vpcId`;
}

export function vpcAvailabilityZonesParameterName(
infrastructureStackId: string,
) {
return `/${infrastructureStackId}/VPC/availabilityZones`;
}

export function vpcPublicSubnetIdsParameterName(infrastructureStackId: string) {
return `/${infrastructureStackId}/VPC/publicSubnetIds`;
}

export function vpcPublicSubnetRouteTableIdsParameterName(
infrastructureStackId: string,
) {
return `/${infrastructureStackId}/VPC/publicSubnetRouteTableIds`;
}

export function vpcPrivateSubnetIdsParameterName(
infrastructureStackId: string,
) {
return `/${infrastructureStackId}/VPC/privateSubnetIds`;
}

export function vpcPrivateSubnetRouteTableIdsParameterName(
infrastructureStackId: string,
) {
return `/${infrastructureStackId}/VPC/privateSubnetRouteTableIds`;
}

export function vpcIsolatedSubnetIdsParameterName(
infrastructureStackId: string,
) {
return `/${infrastructureStackId}/VPC/isolatedSubnetIds`;
}

export function vpcIsolatedSubnetRouteTableIdsParameterName(
infrastructureStackId: string,
) {
return `/${infrastructureStackId}/VPC/isolatedSubnetRouteTableIds`;
}

export function vpcSecurityGroupIdParameterName(infrastructureStackId: string) {
return `/${infrastructureStackId}/VPC/securityGroupId`;
}

export function vpcInternalSecurityGroupIdParameterName(
infrastructureStackId: string,
) {
return `/${infrastructureStackId}/VPC/internalSecurityGroupId`;
}

export function secretsManagerSecretsPrefixParameterName(
infrastructureStackId: string,
) {
return `/${infrastructureStackId}/SecretsManager/secretsPrefix`;
}

export function namespaceNameParameterName(infrastructureStackId: string) {
return `/${infrastructureStackId}/HttpNamespace/namespaceName`;
}

export function namespaceIdParameterName(infrastructureStackId: string) {
return `/${infrastructureStackId}/HttpNamespace/namespaceId`;
}

export function namespaceArnParameterName(infrastructureStackId: string) {
return `/${infrastructureStackId}/HttpNamespace/namespaceArn`;
}

export function databaseEdgeDbDsnNoPasswordOrDatabaseParameterName(
infrastructureStackId: string,
dbName: string,
) {
return `/${infrastructureStackId}/Database/${dbName}/EdgeDb/dsnNoPasswordOrDatabase`;
}

export function databaseEdgeDbAdminPasswordSecretArnParameterName(
infrastructureStackId: string,
dbName: string,
) {
return `/${infrastructureStackId}/Database/${dbName}/EdgeDb/adminPasswordSecretArn`;
}

export function databaseEdgeDbSecurityGroupIdParameterName(
infrastructureStackId: string,
dbName: string,
) {
return `/${infrastructureStackId}/Database/${dbName}/EdgeDb/securityGroupId`;
}
66 changes: 0 additions & 66 deletions packages/shared/index.d.ts

This file was deleted.

98 changes: 0 additions & 98 deletions packages/shared/index.js

This file was deleted.

9 changes: 0 additions & 9 deletions packages/shared/package.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/stack/infrastructure-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import {
vpcPublicSubnetIdsParameterName,
vpcPublicSubnetRouteTableIdsParameterName,
vpcSecurityGroupIdParameterName,
} from "shared";
} from "@common/parameter-names";
import { camelCase } from "./justCamelCase";

export {
Expand Down
17 changes: 9 additions & 8 deletions packages/stack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"homepage": "https://github.com/elsa-data",
"repository": {
"type": "git",
"url": "https://github.com/elsa-data/elsa-data-aws-infrastructure/stack"
"url": "https://github.com/elsa-data/aws-infrastructure/stack"
},
"license": "MIT",
"scripts": {
Expand All @@ -27,18 +27,19 @@
],
"jsii": {
"outdir": "dist",
"targets": {}
"targets": {},
"tsc": {
"paths": {
"@common/*": [
"../common/*"
]
}
}
},
"peerDependencies": {
"aws-cdk-lib": "^2.100.0",
"constructs": "^10.3.0"
},
"dependencies": {
"shared": "file:../shared"
},
"bundledDependencies": [
"shared"
],
"devDependencies": {
"aws-cdk": "2.100.0",
"aws-cdk-lib": "2.100.0",
Expand Down

0 comments on commit 58f250c

Please sign in to comment.