declapract-typescript-ehmpathy 0.48.2 → 0.48.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/practices/bottleneck/bad-practices/bottleneck/package.json +5 -0
- package/dist/practices/bottleneck/bad-practices/bottleneck/package.json.declapract.ts +19 -0
- package/dist/practices/environments/best-practice/package.json +3 -1
- package/dist/practices/logs/bad-practices/simple-log-methods/package.json +5 -0
- package/dist/practices/logs/bad-practices/simple-log-methods/package.json.declapract.ts +18 -0
- package/dist/practices/logs/bad-practices/simple-log-methods/src/<star><star>/<star>.ts.declapract.ts +15 -0
- package/dist/practices/logs/best-practice/package.json +5 -0
- package/dist/practices/logs/best-practice/src/utils/logger.ts +3 -0
- package/dist/practices/provision-github/best-practice/package.json +1 -1
- package/dist/practices/provision-github/best-practice/provision/github.repo/resources.ts +9 -0
- package/dist/practices/rhachet/best-practice/package.json +2 -1
- package/dist/useCases.yml +2 -1
- package/package.json +3 -3
- package/readme.md +1 -1
- package/dist/practices/logging/best-practice/package.json +0 -5
- package/dist/practices/logging/best-practice/src/utils/logger.ts +0 -3
- /package/dist/practices/{logging → logs}/bad-practices/leveled-term/package.json +0 -0
- /package/dist/practices/{logging → logs}/bad-practices/leveled-term/package.json.declapract.ts +0 -0
- /package/dist/practices/{logging → logs}/best-practice/package.json.declapract.ts +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
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 };
|
|
7
|
+
const packageJSON = JSON.parse(contents);
|
|
8
|
+
const updatedPackageJSON = {
|
|
9
|
+
...packageJSON,
|
|
10
|
+
dependencies: {
|
|
11
|
+
...packageJSON.dependencies,
|
|
12
|
+
bottleneck: undefined,
|
|
13
|
+
'with-bottleneck': packageJSON.dependencies?.bottleneck,
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
return {
|
|
17
|
+
contents: JSON.stringify(updatedPackageJSON, null, 2),
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
|
-
"sdk-
|
|
3
|
+
"@aws-sdk/client-account": "@declapract{check.minVersion('3.1042.0')}",
|
|
4
|
+
"@aws-sdk/client-iam": "@declapract{check.minVersion('3.1042.0')}",
|
|
5
|
+
"sdk-environment": "@declapract{check.minVersion('0.1.4')}"
|
|
4
6
|
}
|
|
5
7
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
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 };
|
|
7
|
+
const packageJSON = JSON.parse(contents);
|
|
8
|
+
const updatedPackageJSON = {
|
|
9
|
+
...packageJSON,
|
|
10
|
+
dependencies: {
|
|
11
|
+
...packageJSON.dependencies,
|
|
12
|
+
'simple-log-methods': undefined,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
return {
|
|
16
|
+
contents: JSON.stringify(updatedPackageJSON, null, 2),
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FileCheckFunction, FileFixFunction } from 'declapract';
|
|
2
|
+
|
|
3
|
+
export const check: FileCheckFunction = (contents) => {
|
|
4
|
+
if (contents?.includes("from 'simple-log-methods'")) return;
|
|
5
|
+
throw new Error('does not match bad practice');
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const fix: FileFixFunction = (contents) => {
|
|
9
|
+
if (!contents) return {};
|
|
10
|
+
return {
|
|
11
|
+
contents: contents
|
|
12
|
+
.replace(/from 'simple-log-methods'/g, "from 'sdk-logs'")
|
|
13
|
+
.replace(/generateLogMethods/g, 'genLogMethods'),
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
DeclaredGithubEnvironment,
|
|
6
6
|
DeclaredGithubRepo,
|
|
7
7
|
DeclaredGithubRepoConfig,
|
|
8
|
+
DeclaredGithubTeamRepoAccess,
|
|
8
9
|
getDeclastructGithubProvider,
|
|
9
10
|
} from 'declastruct-github';
|
|
10
11
|
import { type DomainEntity, RefByUnique } from 'domain-objects';
|
|
@@ -126,6 +127,13 @@ export const getResources = async (): Promise<DomainEntity<any>[]> => {
|
|
|
126
127
|
restrictions: null,
|
|
127
128
|
});
|
|
128
129
|
|
|
130
|
+
// grant releasers team access to the repo (required before they can be environment reviewers)
|
|
131
|
+
const teamReleasersAccess = DeclaredGithubTeamRepoAccess.as({
|
|
132
|
+
team: { org: { login: '@declapract{variable.organizationName}' }, slug: 'releasers' },
|
|
133
|
+
repo,
|
|
134
|
+
permission: 'push', // write access needed to deploy
|
|
135
|
+
});
|
|
136
|
+
|
|
129
137
|
// declare environment for production deployments from main (auto-approved)
|
|
130
138
|
const envProductionOnMain = DeclaredGithubEnvironment.as({
|
|
131
139
|
repo,
|
|
@@ -151,6 +159,7 @@ export const getResources = async (): Promise<DomainEntity<any>[]> => {
|
|
|
151
159
|
repo,
|
|
152
160
|
repoConfig,
|
|
153
161
|
branchMainProtection,
|
|
162
|
+
teamReleasersAccess, // must come before environments that reference this team
|
|
154
163
|
envProductionOnMain,
|
|
155
164
|
envProductionOnElse,
|
|
156
165
|
];
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
"rhachet-brains-xai": "@declapract{check.minVersion('0.3.3')}",
|
|
7
7
|
"rhachet-roles-bhrain": "@declapract{check.minVersion('0.29.0')}",
|
|
8
8
|
"rhachet-roles-bhuild": "@declapract{check.minVersion('0.21.15')}",
|
|
9
|
-
"rhachet-roles-ehmpathy": "@declapract{check.minVersion('1.35.12')}"
|
|
9
|
+
"rhachet-roles-ehmpathy": "@declapract{check.minVersion('1.35.12')}",
|
|
10
|
+
"rhachet-roles-rhachet": "@declapract{check.minVersion('0.1.7')}"
|
|
10
11
|
},
|
|
11
12
|
"scripts": {
|
|
12
13
|
"prepare:rhachet": "rhachet init --keys --hooks --roles mechanic behaver driver reviewer librarian ergonomist architect dispatcher",
|
package/dist/useCases.yml
CHANGED
|
@@ -19,6 +19,7 @@ use-cases:
|
|
|
19
19
|
- tests
|
|
20
20
|
- typescript
|
|
21
21
|
- pnpm
|
|
22
|
+
- bottleneck
|
|
22
23
|
npm-package:
|
|
23
24
|
extends:
|
|
24
25
|
- typescript-project
|
|
@@ -39,7 +40,7 @@ use-cases:
|
|
|
39
40
|
- environments-aws
|
|
40
41
|
- lambda-clients
|
|
41
42
|
- lambda-handlers
|
|
42
|
-
-
|
|
43
|
+
- logs
|
|
43
44
|
- node-service
|
|
44
45
|
- runtime-type-checking
|
|
45
46
|
- serverless
|
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.48.
|
|
5
|
+
"version": "0.48.4",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "src/index.js",
|
|
8
8
|
"repository": "ehmpathy/declapract-typescript-ehmpathy",
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
"prepare": "if [ -e .git ] && [ -z \"${CI:-}\" ]; then npm run prepare:husky && npm run prepare:rhachet; fi"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"domain-objects": "0.31.
|
|
50
|
+
"domain-objects": "0.31.13",
|
|
51
51
|
"expect": "29.4.2",
|
|
52
52
|
"flat": "5.0.2",
|
|
53
|
-
"helpful-errors": "1.
|
|
53
|
+
"helpful-errors": "1.7.3",
|
|
54
54
|
"test-fns": "1.15.7",
|
|
55
55
|
"yaml": "2.8.2"
|
|
56
56
|
},
|
package/readme.md
CHANGED
|
@@ -123,7 +123,7 @@ React Native mobile apps with Expo
|
|
|
123
123
|
- **lambda-handlers** - Standard Lambda function structure
|
|
124
124
|
- **lambda-clients** - Type-safe Lambda client wrappers
|
|
125
125
|
- **config** - Environment configuration with AWS Parameter Store
|
|
126
|
-
- **logs** - Structured logging with `
|
|
126
|
+
- **logs** - Structured logging with `sdk-logs`
|
|
127
127
|
- **uuid** - UUID generation standards
|
|
128
128
|
- etc
|
|
129
129
|
|
|
File without changes
|
/package/dist/practices/{logging → logs}/bad-practices/leveled-term/package.json.declapract.ts
RENAMED
|
File without changes
|
|
File without changes
|