declapract-typescript-ehmpathy 0.49.2 → 0.49.4

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 (71) hide show
  1. package/dist/getVariables.ts +6 -2
  2. package/dist/practices/cicd-app-react-native-expo/best-practice/.github/workflows/.deploy-expo.yml +1 -1
  3. package/dist/practices/cicd-app-react-native-expo/best-practice/.github/workflows/deploy.yml +8 -8
  4. package/dist/practices/cicd-app-react-native-expo/best-practice/.github/workflows/test.yml +3 -3
  5. package/dist/practices/cicd-app-react-native-expo/best-practice/package.json +9 -9
  6. package/dist/practices/cicd-common/best-practice/.github/workflows/.test.yml +4 -4
  7. package/dist/practices/cicd-common/best-practice/.github/workflows/test.yml +1 -1
  8. package/dist/practices/cicd-package/best-practice/.github/workflows/publish.yml +1 -1
  9. package/dist/practices/cicd-service/best-practice/.agent/repo=.this/skills/use.rds.capacity.sh +1 -1
  10. package/dist/practices/cicd-service/best-practice/.declapract.readme.md +1 -1
  11. package/dist/practices/cicd-service/best-practice/.github/workflows/deploy.yml +3 -3
  12. package/dist/practices/cicd-service/best-practice/.github/workflows/provision.yml +9 -9
  13. package/dist/practices/config/bad-practices/configs-contain-wrong-account-id/config/prod.json.declapract.ts +2 -2
  14. package/dist/practices/config/bad-practices/divergent-config-shapes/.declapract.readme.md +1 -1
  15. package/dist/practices/config/bad-practices/divergent-config-shapes/config/{dev.json.declapract.ts → prep.json.declapract.ts} +7 -7
  16. package/dist/practices/config/bad-practices/old-dev-config-location/config/dev.json.declapract.ts +4 -1
  17. package/dist/practices/config/best-practice/config/prep.json +1 -1
  18. package/dist/practices/config/best-practice/config/test.json +1 -1
  19. package/dist/practices/environments/bad-practices/old-dev-scripts/package.json.declapract.ts +57 -0
  20. package/dist/practices/environments/best-practice/.declapract.readme.md +1 -1
  21. package/dist/practices/environments/best-practice/src/utils/environment.ts +2 -2
  22. package/dist/practices/husky/best-practice/.husky/check.timestamps.sh +48 -0
  23. package/dist/practices/husky/best-practice/.husky/pre-commit +2 -0
  24. package/dist/practices/husky/check.timestamps.play.declapract.integration.test.ts +148 -0
  25. package/dist/practices/node-service/bad-practices/simple-lambda-client/.declapract.readme.md +55 -0
  26. package/dist/practices/node-service/bad-practices/simple-lambda-client/package.json +5 -0
  27. package/dist/practices/node-service/bad-practices/simple-lambda-client/package.json.declapract.ts +27 -0
  28. package/dist/practices/node-service/bad-practices/simple-lambda-client/src/<star><star>/<star>.ts.declapract.ts +44 -0
  29. package/dist/practices/node-service/bad-practices/simple-lambda-handlers/.declapract.readme.md +52 -0
  30. package/dist/practices/node-service/bad-practices/simple-lambda-handlers/package.json +5 -0
  31. package/dist/practices/node-service/bad-practices/simple-lambda-handlers/package.json.declapract.ts +27 -0
  32. package/dist/practices/node-service/bad-practices/simple-lambda-handlers/src/<star><star>/<star>.ts.declapract.ts +50 -0
  33. package/dist/practices/node-service/best-practice/package.json +4 -1
  34. package/dist/practices/package-json-order/best-practice/package.json.declapract.ts +11 -11
  35. package/dist/practices/persist-with-rds/best-practice/.declapract.readme.md +21 -1
  36. package/dist/practices/persist-with-rds/best-practice/provision/aws/product/parameter-store.tf +39 -0
  37. package/dist/practices/persist-with-rds/best-practice/provision/schema/deploy.database.sh +9 -9
  38. package/dist/practices/provision-github/best-practice/.declapract.readme.md +7 -0
  39. package/dist/practices/rhachet/bad-practices/review-peer-artifacts/.behavior/<star><star>/.reviews/<star><star>/<star>peer-review<star>.md.declapract.ts +16 -0
  40. package/dist/practices/rhachet/bad-practices/review-peer-artifacts/.behavior/<star><star>/.reviews/peer/<star><star>/<star>.md.declapract.ts +16 -0
  41. package/dist/practices/rhachet/bad-practices/review-peer-artifacts/.declapract.readme.md +12 -0
  42. package/dist/practices/{runtime-type-checking → runtime-schemas}/bad-practices/joi/package.json.declapract.ts +4 -0
  43. package/dist/practices/runtime-schemas/bad-practices/joi/src/<star><star>/<star>.ts.declapract.ts +50 -0
  44. package/dist/practices/serverless/best-practice/package.json +2 -2
  45. package/dist/practices/serverless/best-practice/serverless.yml +3 -3
  46. package/dist/practices/serverless/best-practice/serverless.yml.declapract.ts +2 -2
  47. package/dist/practices/terraform-aws/bad-practices/old-dev-env-dir/provision/aws/environments/dev/<star>.declapract.ts +14 -0
  48. package/dist/practices/terraform-aws/best-practice/provision/aws/environments/{dev → prep}/main.tf +2 -2
  49. package/dist/practices/terraform-aws/best-practice/provision/aws/environments/test/main.tf +1 -1
  50. package/dist/useCases.yml +1 -3
  51. package/package.json +6 -5
  52. package/dist/practices/lambda-clients/bad-practices/lambda-service-client-package/.declapract.readme.md +0 -1
  53. package/dist/practices/lambda-clients/bad-practices/lambda-service-client-package/package.json +0 -5
  54. package/dist/practices/lambda-clients/bad-practices/lambda-service-client-package/package.json.declapract.ts +0 -16
  55. package/dist/practices/lambda-clients/best-practice/package.json +0 -5
  56. package/dist/practices/lambda-clients/best-practice/src/data/clients/<star>.ts +0 -1
  57. package/dist/practices/lambda-clients/best-practice/src/data/clients/<star>.ts.declapract.ts +0 -3
  58. package/dist/practices/lambda-handlers/best-practice/package.json +0 -6
  59. package/dist/practices/lambda-handlers/best-practice/package.json.declapract.ts +0 -3
  60. package/dist/practices/lambda-handlers/best-practice/src/contract/handlers/<star><star>/<star>.declapract.ts +0 -3
  61. package/dist/practices/runtime-type-checking/bad-practices/joi-types/package.json +0 -5
  62. package/dist/practices/runtime-type-checking/bad-practices/joi-types/package.json.declapract.ts +0 -18
  63. package/dist/practices/runtime-type-checking/bad-practices/old-joi-syntax-valid-input-cant-be-array/.declapract.readme.md +0 -1
  64. package/dist/practices/runtime-type-checking/bad-practices/old-joi-syntax-valid-input-cant-be-array/src/<star><star>/<star>.ts.declapract.ts +0 -15
  65. package/dist/practices/runtime-type-checking/best-practice/package.json.declapract.ts +0 -3
  66. /package/dist/practices/config/bad-practices/configs-contain-wrong-account-id/config/{dev.json.declapract.ts → prep.json.declapract.ts} +0 -0
  67. /package/dist/practices/{runtime-type-checking → runtime-schemas}/bad-practices/joi/.declapract.readme.md +0 -0
  68. /package/dist/practices/{runtime-type-checking → runtime-schemas}/bad-practices/joi/package.json +0 -0
  69. /package/dist/practices/{runtime-type-checking → runtime-schemas}/best-practice/package.json +0 -0
  70. /package/dist/practices/{lambda-clients → runtime-schemas}/best-practice/package.json.declapract.ts +0 -0
  71. /package/dist/practices/terraform-aws/best-practice/provision/aws/environments/{dev → prep}/versions.tf +0 -0
@@ -0,0 +1,14 @@
1
+ import { FileCheckType, type FileFixFunction } from 'declapract';
2
+
3
+ export const check = FileCheckType.EXISTS;
4
+
5
+ export const fix: FileFixFunction = (contents, context) => {
6
+ const newPath = context.relativeFilePath.replace(
7
+ /^provision\/aws\/environments\/dev\//,
8
+ 'provision/aws/environments/prep/',
9
+ );
10
+ return {
11
+ contents: contents ?? null,
12
+ relativeFilePath: newPath,
13
+ };
14
+ };
@@ -1,6 +1,6 @@
1
1
  provider "aws" {
2
2
  region = "us-east-1"
3
- allowed_account_ids = ["@declapract{variable.awsAccountId.dev}"] # `dev` environment resources are provisioned in the `dev` aws account
3
+ allowed_account_ids = ["@declapract{variable.awsAccountId.prep}"] # `prep` access tier resources are provisioned in the `prep` aws account
4
4
  }
5
5
 
6
6
  terraform {
@@ -14,5 +14,5 @@ terraform {
14
14
 
15
15
  module "product" {
16
16
  source = "../../product"
17
- environment = "dev"
17
+ environment = "dev" # infrastructure stays named 'dev', application uses ACCESS=prep
18
18
  }
@@ -1,6 +1,6 @@
1
1
  provider "aws" {
2
2
  region = "us-east-1"
3
- allowed_account_ids = ["@declapract{variable.awsAccountId.dev}"] # `test` environment resources are provisioned in the `dev` aws account
3
+ allowed_account_ids = ["@declapract{variable.awsAccountId.prep}"] # `test` environment resources are provisioned in the `prep` aws account
4
4
  }
5
5
 
6
6
  terraform {
package/dist/useCases.yml CHANGED
@@ -38,11 +38,9 @@ use-cases:
38
38
  - dates-and-times
39
39
  - environments
40
40
  - environments-aws
41
- - lambda-clients
42
- - lambda-handlers
43
41
  - logs
44
42
  - node-service
45
- - runtime-type-checking
43
+ - runtime-schemas
46
44
  - serverless
47
45
  - provision-github
48
46
  - terraform-common
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "declapract-typescript-ehmpathy",
3
3
  "author": "ehmpathy",
4
4
  "description": "declapract best practices declarations for typescript",
5
- "version": "0.49.2",
5
+ "version": "0.49.4",
6
6
  "license": "MIT",
7
7
  "main": "src/index.js",
8
8
  "repository": "ehmpathy/declapract-typescript-ehmpathy",
@@ -76,12 +76,13 @@
76
76
  "esbuild-register": "3.6.0",
77
77
  "husky": "8.0.3",
78
78
  "jest": "30.2.0",
79
- "rhachet": "1.41.21",
79
+ "rhachet": "1.42.3",
80
80
  "rhachet-brains-anthropic": "0.4.1",
81
+ "rhachet-brains-fireworksai": "0.1.3",
81
82
  "rhachet-brains-xai": "0.3.3",
82
- "rhachet-roles-bhrain": "0.29.2",
83
- "rhachet-roles-bhuild": "0.21.16",
84
- "rhachet-roles-ehmpathy": "1.35.15",
83
+ "rhachet-roles-bhrain": "0.29.11",
84
+ "rhachet-roles-bhuild": "0.21.18",
85
+ "rhachet-roles-ehmpathy": "1.37.0",
85
86
  "tsc-alias": "1.8.10",
86
87
  "tsx": "4.20.6",
87
88
  "type-fns": "1.21.2",
@@ -1 +0,0 @@
1
- our `simple-lambda-client` package used to be called `lambda-service-client`. its no longer maintained, but may still be used in some services. it shouldn't be anymore though
@@ -1,5 +0,0 @@
1
- {
2
- "dependencies": {
3
- "lambda-service-client": "@declapract{check.minVersion('0.0.0')}"
4
- }
5
- }
@@ -1,16 +0,0 @@
1
- import { FileCheckType, type FileFixFunction } from 'declapract';
2
-
3
- export const check = FileCheckType.CONTAINS;
4
-
5
- export const fix: FileFixFunction = (contents) => {
6
- if (!contents) return {}; // should not reach here, file should exist; if doesnt though, do nothing
7
- const parsedContents = JSON.parse(contents);
8
- const fixedParsedContents = {
9
- ...parsedContents,
10
- dependencies: {
11
- ...parsedContents.dependencies,
12
- 'lambda-service-client': undefined, // remove this module
13
- },
14
- };
15
- return { contents: JSON.stringify(fixedParsedContents, null, 2) };
16
- };
@@ -1,5 +0,0 @@
1
- {
2
- "dependencies": {
3
- "simple-lambda-client": "@declapract{check.minVersion('2.1.3')}"
4
- }
5
- }
@@ -1 +0,0 @@
1
- import { invokeLambdaFunction } from 'simple-lambda-client';
@@ -1,3 +0,0 @@
1
- import { FileCheckType } from 'declapract';
2
-
3
- export const check = { type: FileCheckType.CONTAINS, optional: true };
@@ -1,6 +0,0 @@
1
- {
2
- "dependencies": {
3
- "simple-lambda-handlers": "@declapract{check.minVersion('0.10.3')}"
4
- },
5
- "devDependencies": {}
6
- }
@@ -1,3 +0,0 @@
1
- import { FileCheckType } from 'declapract';
2
-
3
- export const check = FileCheckType.CONTAINS;
@@ -1,3 +0,0 @@
1
- import { FileCheckType } from 'declapract';
2
-
3
- export const check = FileCheckType.EXISTS; // we should have atleast one handler
@@ -1,5 +0,0 @@
1
- {
2
- "devDependencies": {
3
- "@types/joi": "@declapract{check.minVersion('0.0.0')}"
4
- }
5
- }
@@ -1,18 +0,0 @@
1
- import { FileCheckType, type FileFixFunction } from 'declapract';
2
-
3
- export const check = FileCheckType.CONTAINS;
4
-
5
- export const fix: FileFixFunction = (contents) => {
6
- if (!contents) return { contents }; // do nothing if no contents
7
- const packageJSON = JSON.parse(contents);
8
- const updatedPackageJSON = {
9
- ...packageJSON,
10
- devDependencies: {
11
- ...packageJSON.devDependencies,
12
- '@types/joi': undefined,
13
- },
14
- };
15
- return {
16
- contents: JSON.stringify(updatedPackageJSON, null, 2),
17
- };
18
- };
@@ -1 +0,0 @@
1
- joi updated their syntax and now throws an error if `.valid([])`, instead we need to give `.valid(...[])`
@@ -1,15 +0,0 @@
1
- import type { FileCheckFunction, FileFixFunction } from 'declapract';
2
-
3
- export const check: FileCheckFunction = (contents) => {
4
- if (contents?.includes('.valid(Object.values(')) return; // matches bad practice if this is found
5
- throw new Error('passes, does not match bad practice');
6
- };
7
- export const fix: FileFixFunction = (contents) => {
8
- if (!contents) return {};
9
- return {
10
- contents: contents.replace(
11
- /\.valid\(Object\.values/g,
12
- '.valid(...Object.values',
13
- ),
14
- };
15
- };
@@ -1,3 +0,0 @@
1
- import { FileCheckType } from 'declapract';
2
-
3
- export const check = FileCheckType.CONTAINS;