Skip to content

Commit

Permalink
Trying again
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewpatto committed Nov 15, 2023
1 parent bd5c7ff commit 2651b49
Show file tree
Hide file tree
Showing 18 changed files with 677 additions and 725 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/release-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:

# first set the versions of our packages to the release version

- run: pnpm version ${{github.ref_name}}
working-directory: packages/client
#- run: pnpm version ${{github.ref_name}}
# working-directory: packages/client

- run: npm version ${{github.ref_name}}
working-directory: packages/stack
Expand All @@ -36,11 +36,11 @@ jobs:

# if all the builds have completed - we can publish the two packages

- run: npx publib-npm
working-directory: packages/client
env:
NPM_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}
NPM_ACCESS_LEVEL: public
#- run: npx publib-npm
# working-directory: packages/client
# env:
# NPM_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}
# NPM_ACCESS_LEVEL: public

- run: npx publib-npm
working-directory: packages/stack
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repos:
- id: check-added-large-files

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
rev: v3.1.0
hooks:
- id: prettier

Expand Down
13 changes: 6 additions & 7 deletions dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@
"clean": "git clean -fXd"
},
"dependencies": {
"cdk-nag": "2.27.160",
"elsa-data-aws-infrastructure": "link:../packages/stack",
"elsa-data-aws-infrastructure-client": "link:../packages/client"
"aws-cdk": "2.108.1",
"aws-cdk-lib": "2.108.1",
"cdk-nag": "2.27.191",
"constructs": "10.3.0",
"elsa-data-aws-infrastructure": "link:../packages/stack"
},
"devDependencies": {
"aws-cdk": "2.100.0",
"aws-cdk-lib": "2.100.0",
"constructs": "10.3.0",
"tsconfig-paths": "^4.2.0"
"@tsconfig/node18": "^18.2.2"
}
}
13 changes: 1 addition & 12 deletions dev/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
{
// tsconfig-paths is needed because whilst our JSII packages that get built (and used downstream via npm)
// successfully remove the @common syntax (and turn the TS into JS) - this dev project
// references the packages directly as typescript. So it still need somehow to resolve the @common
// imports. Here we give it a hint how to do that.
"ts-node": {
"require": ["tsconfig-paths/register"]
},
"compilerOptions": {
"paths": {
"@common/*": ["../packages/common/*"]
}
},
"extends": "@tsconfig/node18/tsconfig.json",
"exclude": ["node_modules"]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"license": "MIT",
"devDependencies": {
"prettier": "3.0.3",
"prettier": "3.1.0",
"typescript": "5.2.2"
}
}
11 changes: 0 additions & 11 deletions packages/client/.gitignore

This file was deleted.

15 changes: 0 additions & 15 deletions packages/client/.npmignore

This file was deleted.

11 changes: 0 additions & 11 deletions packages/client/README.md

This file was deleted.

50 changes: 0 additions & 50 deletions packages/client/package.json

This file was deleted.

2 changes: 0 additions & 2 deletions packages/common/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions packages/common/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion packages/stack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ significant periods of time.
## Use

The infrastructure stack resources can be accessed in another CDK stack
through the use of the `@elsa-data/aws-infrastructure-client` project (and the
through the use of the `@elsa-data/aws-infrastructure-stack` project (and the
infrastructure stack name) - which
provides SSM parameters containing values from the infrastructure.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ import { IHostedZone } from "aws-cdk-lib/aws-route53";
import { Construct } from "constructs";
import { PolicyStatement } from "aws-cdk-lib/aws-iam";
import {
certificateArnParameterName,
databaseEdgeDbSecurityGroupIdParameterName,
namespaceArnParameterName,
namespaceIdParameterName,
namespaceNameParameterName,
secretsManagerSecretsPrefixParameterName,
vpcAvailabilityZonesParameterName,
vpcIdParameterName,
Expand All @@ -21,7 +24,7 @@ import {
vpcPrivateSubnetRouteTableIdsParameterName,
vpcPublicSubnetIdsParameterName,
vpcPublicSubnetRouteTableIdsParameterName,
} from "@common/parameter-names";
} from "./parameter-names";
import { ISecret, Secret } from "aws-cdk-lib/aws-secretsmanager";
import { Bucket, IBucket } from "aws-cdk-lib/aws-s3";

Expand Down Expand Up @@ -164,15 +167,15 @@ export class InfrastructureClient {
return HttpNamespace.fromHttpNamespaceAttributes(scope, "Namespace", {
namespaceArn: StringParameter.valueFromLookup(
scope,
`/${this.infrastructureStackId}/HttpNamespace/namespaceArn`,
namespaceArnParameterName(this.infrastructureStackId),
),
namespaceId: StringParameter.valueFromLookup(
scope,
`/${this.infrastructureStackId}/HttpNamespace/namespaceId`,
namespaceIdParameterName(this.infrastructureStackId),
),
namespaceName: StringParameter.valueFromLookup(
scope,
`/${this.infrastructureStackId}/HttpNamespace/namespaceName`,
namespaceNameParameterName(this.infrastructureStackId),
),
});
}
Expand Down Expand Up @@ -204,7 +207,7 @@ export class InfrastructureClient {
"SslCert",
StringParameter.valueFromLookup(
scope,
`/${this.infrastructureStackId}/Certificate/certificateArn`,
certificateArnParameterName(this.infrastructureStackId),
),
);

Expand Down
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 "@common/parameter-names";
} from "./parameter-names";
import { camelCase } from "./justCamelCase";

export {
Expand Down
20 changes: 7 additions & 13 deletions packages/stack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,18 @@
"jsii": {
"outdir": "dist",
"targets": {},
"tsc": {
"paths": {
"@common/*": [
"../common/*"
]
}
}
"tsc": {}
},
"peerDependencies": {
"aws-cdk-lib": "^2.100.0",
"aws-cdk-lib": "^2.108.1",
"constructs": "^10.3.0"
},
"devDependencies": {
"aws-cdk": "2.100.0",
"aws-cdk-lib": "2.100.0",
"aws-cdk": "2.108.1",
"aws-cdk-lib": "2.108.1",
"constructs": "10.3.0",
"jsii": "5.2.14",
"jsii-pacmak": "1.90.0",
"publib": "0.2.737"
"jsii": "5.2.29",
"jsii-pacmak": "1.91.0",
"publib": "0.2.745"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ export function namespaceArnParameterName(infrastructureStackId: string) {
return `/${infrastructureStackId}/HttpNamespace/namespaceArn`;
}

export function certificateArnParameterName(infrastructureStackId: string) {
return `/${infrastructureStackId}/Certificate/certificateArn`;
}

export function databaseEdgeDbDsnNoPasswordOrDatabaseParameterName(
infrastructureStackId: string,
dbName: string,
Expand Down
Loading

0 comments on commit 2651b49

Please sign in to comment.