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.
- package/dist/getVariables.ts +6 -2
- package/dist/practices/cicd-app-react-native-expo/best-practice/.github/workflows/.deploy-expo.yml +1 -1
- package/dist/practices/cicd-app-react-native-expo/best-practice/.github/workflows/deploy.yml +8 -8
- package/dist/practices/cicd-app-react-native-expo/best-practice/.github/workflows/test.yml +3 -3
- package/dist/practices/cicd-app-react-native-expo/best-practice/package.json +9 -9
- package/dist/practices/cicd-common/best-practice/.github/workflows/.test.yml +4 -4
- package/dist/practices/cicd-common/best-practice/.github/workflows/test.yml +1 -1
- package/dist/practices/cicd-package/best-practice/.github/workflows/publish.yml +1 -1
- package/dist/practices/cicd-service/best-practice/.agent/repo=.this/skills/use.rds.capacity.sh +1 -1
- package/dist/practices/cicd-service/best-practice/.declapract.readme.md +1 -1
- package/dist/practices/cicd-service/best-practice/.github/workflows/deploy.yml +3 -3
- package/dist/practices/cicd-service/best-practice/.github/workflows/provision.yml +9 -9
- package/dist/practices/config/bad-practices/configs-contain-wrong-account-id/config/prod.json.declapract.ts +2 -2
- package/dist/practices/config/bad-practices/divergent-config-shapes/.declapract.readme.md +1 -1
- package/dist/practices/config/bad-practices/divergent-config-shapes/config/{dev.json.declapract.ts → prep.json.declapract.ts} +7 -7
- package/dist/practices/config/bad-practices/old-dev-config-location/config/dev.json.declapract.ts +4 -1
- package/dist/practices/config/best-practice/config/prep.json +1 -1
- package/dist/practices/config/best-practice/config/test.json +1 -1
- package/dist/practices/environments/bad-practices/old-dev-scripts/package.json.declapract.ts +57 -0
- package/dist/practices/environments/best-practice/.declapract.readme.md +1 -1
- package/dist/practices/environments/best-practice/src/utils/environment.ts +2 -2
- package/dist/practices/husky/best-practice/.husky/check.timestamps.sh +48 -0
- package/dist/practices/husky/best-practice/.husky/pre-commit +2 -0
- package/dist/practices/husky/check.timestamps.play.declapract.integration.test.ts +148 -0
- package/dist/practices/node-service/bad-practices/simple-lambda-client/.declapract.readme.md +55 -0
- package/dist/practices/node-service/bad-practices/simple-lambda-client/package.json +5 -0
- package/dist/practices/node-service/bad-practices/simple-lambda-client/package.json.declapract.ts +27 -0
- package/dist/practices/node-service/bad-practices/simple-lambda-client/src/<star><star>/<star>.ts.declapract.ts +44 -0
- package/dist/practices/node-service/bad-practices/simple-lambda-handlers/.declapract.readme.md +52 -0
- package/dist/practices/node-service/bad-practices/simple-lambda-handlers/package.json +5 -0
- package/dist/practices/node-service/bad-practices/simple-lambda-handlers/package.json.declapract.ts +27 -0
- package/dist/practices/node-service/bad-practices/simple-lambda-handlers/src/<star><star>/<star>.ts.declapract.ts +50 -0
- package/dist/practices/node-service/best-practice/package.json +4 -1
- package/dist/practices/package-json-order/best-practice/package.json.declapract.ts +11 -11
- package/dist/practices/persist-with-rds/best-practice/.declapract.readme.md +21 -1
- package/dist/practices/persist-with-rds/best-practice/provision/aws/product/parameter-store.tf +39 -0
- package/dist/practices/persist-with-rds/best-practice/provision/schema/deploy.database.sh +9 -9
- package/dist/practices/provision-github/best-practice/.declapract.readme.md +7 -0
- package/dist/practices/rhachet/bad-practices/review-peer-artifacts/.behavior/<star><star>/.reviews/<star><star>/<star>peer-review<star>.md.declapract.ts +16 -0
- package/dist/practices/rhachet/bad-practices/review-peer-artifacts/.behavior/<star><star>/.reviews/peer/<star><star>/<star>.md.declapract.ts +16 -0
- package/dist/practices/rhachet/bad-practices/review-peer-artifacts/.declapract.readme.md +12 -0
- package/dist/practices/{runtime-type-checking → runtime-schemas}/bad-practices/joi/package.json.declapract.ts +4 -0
- package/dist/practices/runtime-schemas/bad-practices/joi/src/<star><star>/<star>.ts.declapract.ts +50 -0
- package/dist/practices/serverless/best-practice/package.json +2 -2
- package/dist/practices/serverless/best-practice/serverless.yml +3 -3
- package/dist/practices/serverless/best-practice/serverless.yml.declapract.ts +2 -2
- package/dist/practices/terraform-aws/bad-practices/old-dev-env-dir/provision/aws/environments/dev/<star>.declapract.ts +14 -0
- package/dist/practices/terraform-aws/best-practice/provision/aws/environments/{dev → prep}/main.tf +2 -2
- package/dist/practices/terraform-aws/best-practice/provision/aws/environments/test/main.tf +1 -1
- package/dist/useCases.yml +1 -3
- package/package.json +6 -5
- package/dist/practices/lambda-clients/bad-practices/lambda-service-client-package/.declapract.readme.md +0 -1
- package/dist/practices/lambda-clients/bad-practices/lambda-service-client-package/package.json +0 -5
- package/dist/practices/lambda-clients/bad-practices/lambda-service-client-package/package.json.declapract.ts +0 -16
- package/dist/practices/lambda-clients/best-practice/package.json +0 -5
- package/dist/practices/lambda-clients/best-practice/src/data/clients/<star>.ts +0 -1
- package/dist/practices/lambda-clients/best-practice/src/data/clients/<star>.ts.declapract.ts +0 -3
- package/dist/practices/lambda-handlers/best-practice/package.json +0 -6
- package/dist/practices/lambda-handlers/best-practice/package.json.declapract.ts +0 -3
- package/dist/practices/lambda-handlers/best-practice/src/contract/handlers/<star><star>/<star>.declapract.ts +0 -3
- package/dist/practices/runtime-type-checking/bad-practices/joi-types/package.json +0 -5
- package/dist/practices/runtime-type-checking/bad-practices/joi-types/package.json.declapract.ts +0 -18
- package/dist/practices/runtime-type-checking/bad-practices/old-joi-syntax-valid-input-cant-be-array/.declapract.readme.md +0 -1
- 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
- package/dist/practices/runtime-type-checking/best-practice/package.json.declapract.ts +0 -3
- /package/dist/practices/config/bad-practices/configs-contain-wrong-account-id/config/{dev.json.declapract.ts → prep.json.declapract.ts} +0 -0
- /package/dist/practices/{runtime-type-checking → runtime-schemas}/bad-practices/joi/.declapract.readme.md +0 -0
- /package/dist/practices/{runtime-type-checking → runtime-schemas}/bad-practices/joi/package.json +0 -0
- /package/dist/practices/{runtime-type-checking → runtime-schemas}/best-practice/package.json +0 -0
- /package/dist/practices/{lambda-clients → runtime-schemas}/best-practice/package.json.declapract.ts +0 -0
- /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
|
+
};
|
package/dist/practices/terraform-aws/best-practice/provision/aws/environments/{dev → prep}/main.tf
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
provider "aws" {
|
|
2
2
|
region = "us-east-1"
|
|
3
|
-
allowed_account_ids = ["@declapract{variable.awsAccountId.
|
|
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.
|
|
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
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.
|
|
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.
|
|
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.
|
|
83
|
-
"rhachet-roles-bhuild": "0.21.
|
|
84
|
-
"rhachet-roles-ehmpathy": "1.
|
|
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,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 +0,0 @@
|
|
|
1
|
-
import { invokeLambdaFunction } from 'simple-lambda-client';
|
package/dist/practices/runtime-type-checking/bad-practices/joi-types/package.json.declapract.ts
DELETED
|
@@ -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
|
-
};
|
|
File without changes
|
|
File without changes
|
/package/dist/practices/{runtime-type-checking → runtime-schemas}/bad-practices/joi/package.json
RENAMED
|
File without changes
|
/package/dist/practices/{runtime-type-checking → runtime-schemas}/best-practice/package.json
RENAMED
|
File without changes
|
/package/dist/practices/{lambda-clients → runtime-schemas}/best-practice/package.json.declapract.ts
RENAMED
|
File without changes
|
|
File without changes
|