declapract-typescript-ehmpathy 0.22.0 → 0.22.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,7 +35,7 @@ jobs:
35
35
  plan:
36
36
  runs-on: ubuntu-latest
37
37
  outputs:
38
- has-changes-planned: ${{ steps.evaluate-plan.output.has-changes-planned }}
38
+ has-changes-planned: ${{ steps.evaluate-plan.outputs.has-changes-planned }}
39
39
  steps:
40
40
  - name: checkout
41
41
  uses: actions/checkout@v3
@@ -105,6 +105,9 @@ jobs:
105
105
  echo "has-changes-planned=true" >> "$GITHUB_OUTPUT"
106
106
  fi
107
107
 
108
+ - name: has changes planned?
109
+ run: echo "${{ steps.evaluate-plan.outputs.has-changes-planned }}"
110
+
108
111
  - name: vpn:disconnect
109
112
  run: sudo killall openvpn
110
113
 
@@ -37,7 +37,7 @@ jobs:
37
37
  run:
38
38
  working-directory: ${{ inputs.working-directory }}
39
39
  outputs:
40
- has-changes-planned: ${{ steps.evaluate-plan.output.has-changes-planned }}
40
+ has-changes-planned: ${{ steps.evaluate-plan.outputs.has-changes-planned }}
41
41
  steps:
42
42
  - name: checkout
43
43
  uses: actions/checkout@v3
@@ -67,7 +67,7 @@ jobs:
67
67
 
68
68
  - name: terraform plan
69
69
  id: plan
70
- run: terraform plan | tee ./plan.log
70
+ run: terraform plan -detailed-exitcode | tee ./plan.log
71
71
  env:
72
72
  GITHUB_TOKEN: ${{ secrets.github-token }} # allow specifying a github token to pass to the terraform command
73
73
 
@@ -81,6 +81,9 @@ jobs:
81
81
  echo "has-changes-planned=true" >> "$GITHUB_OUTPUT"
82
82
  fi
83
83
 
84
+ - name: has changes planned?
85
+ run: echo "${{ steps.evaluate-plan.outputs.has-changes-planned }}"
86
+
84
87
  apply:
85
88
  runs-on: ubuntu-latest
86
89
  environment: ${{ inputs.github-environment }}
@@ -114,6 +117,6 @@ jobs:
114
117
  run: terraform init
115
118
 
116
119
  - name: terraform apply
117
- run: terraform apply
120
+ run: terraform apply -auto-approve
118
121
  env:
119
122
  GITHUB_TOKEN: ${{ secrets.github-token }} # allow specifying a github token to pass to the terraform command
@@ -11,6 +11,17 @@ on:
11
11
  workflow_dispatch:
12
12
 
13
13
  jobs:
14
+ aws-test:
15
+ uses: ./.github/workflows/.terraform.yml
16
+ with:
17
+ working-directory: provision/aws/environments/test
18
+ github-environment: dev
19
+ aws-region: us-east-1
20
+ aws-account-id: '@declapract{variable.awsAccountId.dev}'
21
+ secrets:
22
+ aws-access-key-id: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
23
+ aws-secret-access-key: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
24
+
14
25
  aws-dev:
15
26
  uses: ./.github/workflows/.terraform.yml
16
27
  with:
@@ -0,0 +1,5 @@
1
+ /**
2
+ * specify that dynamodb should use the local dynamodb database, if running in test env
3
+ */
4
+ if (stage === Stage.TEST)
5
+ process.env.USE_CUSTOM_DYNAMODB_ENDPOINT = 'http://localhost:7337';
@@ -0,0 +1,3 @@
1
+ import { FileCheckType } from 'declapract';
2
+
3
+ export const check = FileCheckType.CONTAINS;
@@ -0,0 +1,3 @@
1
+ endpoints {
2
+ dynamodb = "http://localhost:7337/"
3
+ }
@@ -0,0 +1,3 @@
1
+ import { FileCheckType } from 'declapract';
2
+
3
+ export const check = FileCheckType.CONTAINS; // should contain specifier that test applies to local dynamodb
@@ -0,0 +1 @@
1
+ we switched from `provision/docker/integration_test_db` to `provision/docker/integration-test-db`
@@ -0,0 +1,3 @@
1
+ import { FileCheckType } from 'declapract';
2
+
3
+ export const check = FileCheckType.EXISTS; // if a file exists with this path pattern, then it's bad practice
@@ -16,6 +16,7 @@
16
16
  "generate:schema": "npx sql-schema-generator generate -c codegen.sql.schema.yml && npm run fix:format",
17
17
  "generate:types-from-sql": "npx sql-code-generator generate -c codegen.sql.types.yml && npm run fix:format",
18
18
  "provision:docker:clear": "docker rm -f $(docker ps -a -f 'publish=7821' -q) 2>/dev/null || true && echo 'ensured port is available 👍'",
19
+ "provision:docker:prepare": "cp provision/schema/sql/init/.extensions.sql provision/docker/integration-test-db/init/extensions.sql && cp provision/schema/sql/init/.schema.sql provision/docker/integration-test-db/init/schema.sql && cp provision/schema/sql/init/.user.cicd.sql provision/docker/integration-test-db/init/user.cicd.sql",
19
20
  "provision:docker:up": "docker-compose -f ./provision/docker/integration-test-db/docker-compose.yml up -d --force-recreate --build --renew-anon-volumes",
20
21
  "provision:docker:await": "docker-compose -f ./provision/docker/integration-test-db/docker-compose.yml exec -T postgres /root/wait-for-postgres.sh",
21
22
  "provision:docker:down": "docker-compose -f ./provision/docker/integration-test-db/docker-compose.yml down",
@@ -1,10 +1,6 @@
1
1
  provider "aws" {
2
2
  region = "us-east-1"
3
3
  allowed_account_ids = ["@declapract{variable.awsAccountId.dev}"] # `test` environment resources are provisioned in the `dev` aws account
4
-
5
- endpoints {
6
- dynamodb = "http://localhost:7337/"
7
- }
8
4
  }
9
5
 
10
6
  terraform {
@@ -10,9 +10,3 @@ jest.setTimeout(90000); // since we're calling downstream apis
10
10
  */
11
11
  if (stage !== Stage.TEST && process.env.I_KNOW_WHAT_IM_DOING !== 'true')
12
12
  throw new Error(`integration-test is not targeting stage 'test'`);
13
-
14
- /**
15
- * specify that dynamodb should use the local dynamodb database, if running in test env
16
- */
17
- if (stage === Stage.TEST)
18
- process.env.USE_CUSTOM_DYNAMODB_ENDPOINT = 'http://localhost:7337';
@@ -5,6 +5,7 @@
5
5
  "noPropertyAccessFromIndexSignature": false,
6
6
  "noUnusedLocals": false, // this is something a linter should warn on, not something a compiler should fail on
7
7
  "noUnusedParameters": false, // this is something a linter should warn on, not something a compiler should fail on
8
+ "exactOptionalPropertyTypes": false, // too clunky when `{ name?: string }` !== `{ name?: string | undefined }`. too rare of a cause of issue to be worth it
8
9
  "noImplicitOverride": false,
9
10
  "resolveJsonModule": true,
10
11
  "sourceMap": true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "declapract-typescript-ehmpathy",
3
- "version": "0.22.0",
3
+ "version": "0.22.2",
4
4
  "description": "declapract best practices declarations for typescript",
5
5
  "main": "src/index.js",
6
6
  "repository": "ehmpathy/declapract-typescript-ehmpathy",