declapract-typescript-ehmpathy 0.22.8 → 0.23.0

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.
Files changed (31) hide show
  1. package/dist/practices/{cicd-integrate → cicd-common}/best-practice/.github/workflows/.test.yml +10 -6
  2. package/dist/practices/{cicd-deploy-package → cicd-package}/best-practice/.github/workflows/.publish-npm.yml +4 -9
  3. package/dist/practices/cicd-package/best-practice/.github/workflows/publish.yml +15 -0
  4. package/dist/practices/cicd-package/best-practice/.github/workflows/test.yml +13 -0
  5. package/dist/practices/git/best-practice/.gitignore.declapract.ts +1 -0
  6. package/dist/practices/terraform/best-practice/provision/aws/product/variables.tf +7 -0
  7. package/dist/useCases.yml +3 -3
  8. package/package.json +1 -1
  9. package/dist/practices/cicd-deploy-package/best-practice/.github/workflows/publish.yml +0 -21
  10. /package/dist/practices/{cicd-integrate → cicd-common}/bad-practices/old-names/.github/workflows/ci-on-commit.yml.declapract.ts +0 -0
  11. /package/dist/practices/{cicd-integrate → cicd-common}/bad-practices/old-names/.github/workflows/ci_on_commit.yml.declapract.ts +0 -0
  12. /package/dist/practices/{cicd-integrate → cicd-common}/bad-practices/old-names/.github/workflows/pr-release-on-main.yml.declapract.ts +0 -0
  13. /package/dist/practices/{cicd-integrate → cicd-common}/bad-practices/old-names/.github/workflows/test-on-commit.yml.declapract.ts +0 -0
  14. /package/dist/practices/{cicd-integrate → cicd-common}/bad-practices/old-names/.github/workflows/test_on_commit.yml.declapract.ts +0 -0
  15. /package/dist/practices/{cicd-integrate → cicd-common}/best-practice/.declapract.readme.md +0 -0
  16. /package/dist/practices/{cicd-integrate → cicd-common}/best-practice/.github/workflows/release.yml +0 -0
  17. /package/dist/practices/{cicd-deploy-package → cicd-package}/bad-practices/old-names/.github/workflows/publish_on_tag.yml.declapract.ts +0 -0
  18. /package/dist/practices/{cicd-deploy-package → cicd-package}/best-practice/.declapract.readme.md +0 -0
  19. /package/dist/practices/{cicd-deploy-service → cicd-service}/bad-practices/old-names/.github/workflows/deploy-dev-on-main.yml.declapract.ts +0 -0
  20. /package/dist/practices/{cicd-deploy-service → cicd-service}/bad-practices/old-names/.github/workflows/deploy-prod-on-tag.yml.declapract.ts +0 -0
  21. /package/dist/practices/{cicd-deploy-service → cicd-service}/bad-practices/old-names/.github/workflows/deploy_dev_on_main.yml.declapract.ts +0 -0
  22. /package/dist/practices/{cicd-deploy-service → cicd-service}/bad-practices/old-names/.github/workflows/deploy_dev_on_master.yml.declapract.ts +0 -0
  23. /package/dist/practices/{cicd-deploy-service → cicd-service}/bad-practices/old-names/.github/workflows/deploy_on_tag.yml.declapract.ts +0 -0
  24. /package/dist/practices/{cicd-deploy-service → cicd-service}/bad-practices/old-names/.github/workflows/deploy_prod_on_tag.yml.declapract.ts +0 -0
  25. /package/dist/practices/{cicd-deploy-service → cicd-service}/best-practice/.declapract.readme.md +0 -0
  26. /package/dist/practices/{cicd-deploy-service → cicd-service}/best-practice/.github/workflows/.deploy-sls.yml +0 -0
  27. /package/dist/practices/{cicd-deploy-service → cicd-service}/best-practice/.github/workflows/.sql-schema-control.yml +0 -0
  28. /package/dist/practices/{cicd-deploy-service → cicd-service}/best-practice/.github/workflows/.terraform.yml +0 -0
  29. /package/dist/practices/{cicd-deploy-service → cicd-service}/best-practice/.github/workflows/deploy.yml +0 -0
  30. /package/dist/practices/{cicd-deploy-service → cicd-service}/best-practice/.github/workflows/provision.yml +0 -0
  31. /package/dist/practices/{cicd-integrate → cicd-service}/best-practice/.github/workflows/test.yml +0 -0
@@ -6,17 +6,17 @@ on:
6
6
  aws-region:
7
7
  type: string
8
8
  description: the aws region within which we should run the tests
9
- required: true
9
+ required: false
10
10
  aws-account-id:
11
11
  type: string
12
12
  description: the id of the account the credentials are expected to access
13
- required: true
13
+ required: false
14
14
  secrets:
15
15
  aws-access-key-id:
16
- required: true
16
+ required: false
17
17
  description: required credentials to authenticate with aws the aws account against which to run the tests
18
18
  aws-secret-access-key:
19
- required: true
19
+ required: false
20
20
  description: required credentials to authenticate with aws the aws account against which to run the tests
21
21
 
22
22
  jobs:
@@ -174,14 +174,16 @@ jobs:
174
174
  key: ${{ runner.os }}-node-${{ github.sha }}
175
175
 
176
176
  - name: configure aws credentials
177
+ if: "${{ inputs.aws-account-id != '' }}"
177
178
  uses: aws-actions/configure-aws-credentials@v1
178
179
  id: credentials
179
180
  with:
180
181
  aws-access-key-id: ${{ secrets.aws-access-key-id }}
181
182
  aws-secret-access-key: ${{ secrets.aws-secret-access-key }}
182
- aws-region: us-east-1
183
+ aws-region: ${{ inputs.aws-region }}
183
184
 
184
185
  - name: confirm aws credentials
186
+ if: "${{ inputs.aws-account-id != '' }}"
185
187
  run: |
186
188
  [[ ${{steps.credentials.outputs.aws-account-id}} != ${{ inputs.aws-account-id }} ]] \
187
189
  && echo 'wrong aws account' && exit 1 \
@@ -213,14 +215,16 @@ jobs:
213
215
  key: ${{ runner.os }}-node-${{ github.sha }}
214
216
 
215
217
  - name: configure aws credentials
218
+ if: "${{ inputs.aws-account-id != '' }}"
216
219
  uses: aws-actions/configure-aws-credentials@v1
217
220
  id: credentials
218
221
  with:
219
222
  aws-access-key-id: ${{ secrets.aws-access-key-id }}
220
223
  aws-secret-access-key: ${{ secrets.aws-secret-access-key }}
221
- aws-region: us-east-1
224
+ aws-region: ${{ inputs.aws-region }}
222
225
 
223
226
  - name: confirm aws credentials
227
+ if: "${{ inputs.aws-account-id != '' }}"
224
228
  run: |
225
229
  [[ ${{steps.credentials.outputs.aws-account-id}} != ${{ inputs.aws-account-id }} ]] \
226
230
  && echo 'wrong aws account' && exit 1 \
@@ -12,17 +12,12 @@ jobs:
12
12
  runs-on: ubuntu-20.04
13
13
  steps:
14
14
  - name: checkout
15
- uses: actions/checkout@v2
15
+ uses: actions/checkout@v3
16
16
 
17
- - name: read nvmrc
18
- id: nvmrc
19
- run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
20
-
21
- - name: setup node
22
- uses: actions/setup-node@v2
17
+ - name: set node version
18
+ uses: actions/setup-node@v3
23
19
  with:
24
- node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }}
25
- registry-url: 'https://registry.npmjs.org'
20
+ node-version-file: '.nvmrc'
26
21
  cache: 'npm'
27
22
 
28
23
  - name: install
@@ -0,0 +1,15 @@
1
+ name: publish
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - v*
7
+
8
+ jobs:
9
+ test:
10
+ uses: ./.github/workflows/.test.yml
11
+
12
+ publish:
13
+ uses: ./.github/workflows/.publish-npm.yml
14
+ secrets:
15
+ npm-auth-token: ${{ secrets.NPM_TOKEN }}
@@ -0,0 +1,13 @@
1
+ name: test
2
+
3
+ on:
4
+ workflow_call:
5
+ push:
6
+ branches-ignore:
7
+ - 'main' # exclude main branch, since deploy workflow triggers on main, and calls the test workflow inside of it already
8
+ tags-ignore:
9
+ - v* # exclude tags, since deploy workflow triggers on tags, and calls the test workflow inside of it already
10
+
11
+ jobs:
12
+ suite:
13
+ uses: ./.github/workflows/.test.yml
@@ -3,6 +3,7 @@ import expect from 'expect';
3
3
  import uniq from 'lodash.uniq';
4
4
 
5
5
  const expectedIgnores = [
6
+ '*.log',
6
7
  '.artifact', // deployment artifacts from `simple-artifact-builder` are produced here
7
8
  '.env',
8
9
  '.serverless',
@@ -12,3 +12,10 @@ locals {
12
12
  product = local.service
13
13
  }
14
14
  }
15
+
16
+ data "aws_caller_identity" "current" {}
17
+ data "aws_region" "current" {}
18
+ locals {
19
+ aws_account_id = data.aws_caller_identity.current.account_id
20
+ aws_region = data.aws_region.current.name
21
+ }
package/dist/useCases.yml CHANGED
@@ -2,7 +2,7 @@
2
2
  use-cases:
3
3
  typescript-project:
4
4
  practices:
5
- - cicd-integrate
5
+ - cicd-common
6
6
  - conventional-commits
7
7
  - directory-structure-src
8
8
  - domain
@@ -22,14 +22,14 @@ use-cases:
22
22
  extends:
23
23
  - typescript-project
24
24
  practices:
25
- - cicd-deploy-package
25
+ - cicd-package
26
26
  - node-package
27
27
  lambda-service:
28
28
  extends:
29
29
  - typescript-project
30
30
  practices:
31
31
  - artifact
32
- - cicd-deploy-service
32
+ - cicd-service
33
33
  - config
34
34
  - dates-and-times
35
35
  - environments-aws
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "declapract-typescript-ehmpathy",
3
- "version": "0.22.8",
3
+ "version": "0.23.0",
4
4
  "description": "declapract best practices declarations for typescript",
5
5
  "main": "src/index.js",
6
6
  "repository": "ehmpathy/declapract-typescript-ehmpathy",
@@ -1,21 +0,0 @@
1
- name: publish
2
-
3
- on:
4
- push:
5
- tags:
6
- - v*
7
-
8
- jobs:
9
- test:
10
- uses: ./.github/workflows/.test.yml
11
- with:
12
- aws-region: us-east-1
13
- aws-account-id: '@declapract{variable.awsAccountId.dev}'
14
- secrets:
15
- aws-access-key-id: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
16
- aws-secret-access-key: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
17
-
18
- publish:
19
- uses: ./.github/workflows/.publish-npm.yml
20
- secrets:
21
- npm-auth-token: ${{ secrets.NPM_TOKEN }}