declapract-typescript-ehmpathy 0.42.0 → 0.42.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.
- package/dist/practices/husky/bad-practices/postinstall/package.json.declapract.ts +18 -0
- package/dist/practices/husky/best-practice/package.json +1 -1
- package/dist/practices/lint/best-practice/.depcheckrc.yml +4 -3
- package/dist/practices/lint/best-practice/package.json +1 -1
- package/dist/practices/package-json-order/best-practice/package.json.declapract.ts +1 -0
- package/dist/practices/persist-with-rds/best-practice/package.json +0 -1
- package/dist/practices/provision-github/bad-practices/terraform-github/provision/github/environment/import-existing-repo.sh.declapract.ts +3 -0
- package/dist/practices/provision-github/bad-practices/terraform-github/provision/github/environment/main.tf.declapract.ts +3 -0
- package/dist/practices/provision-github/bad-practices/terraform-github/provision/github/environment/versions.tf.declapract.ts +3 -0
- package/dist/practices/provision-github/bad-practices/terraform-github/provision/github/product/repository.tf.declapract.ts +3 -0
- package/dist/practices/provision-github/best-practice/provision/github/declastruct.resources.ts +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FileCheckFunction, FileFixFunction } from 'declapract';
|
|
2
|
+
|
|
3
|
+
export const check: FileCheckFunction = (contents) => {
|
|
4
|
+
if (!contents) throw new Error('does not match bad practice');
|
|
5
|
+
const packageJSONObject = JSON.parse(contents);
|
|
6
|
+
if (Object.keys(packageJSONObject.scripts).includes('postinstall')) return; // matches
|
|
7
|
+
throw new Error('does not match bad practice');
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const fix: FileFixFunction = (contents) => {
|
|
11
|
+
if (!contents) return {}; // should not occur
|
|
12
|
+
const packageJSONObject = JSON.parse(contents);
|
|
13
|
+
const fixedPackageJSONObject = {
|
|
14
|
+
...packageJSONObject,
|
|
15
|
+
scripts: { ...packageJSONObject.scripts, postinstall: undefined }, // drop postinstall
|
|
16
|
+
};
|
|
17
|
+
return { contents: JSON.stringify(fixedPackageJSONObject, null, 2) };
|
|
18
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"scripts": {
|
|
3
3
|
"prepare:husky": "npx husky install && chmod ug+x .husky/*",
|
|
4
|
-
"
|
|
4
|
+
"prepare": "[ -d .git ] && npm run prepare:husky || exit 0"
|
|
5
5
|
},
|
|
6
6
|
"devDependencies": {
|
|
7
7
|
"husky": "@declapract{check.minVersion('8.0.3')}"
|
|
@@ -5,10 +5,11 @@ ignores:
|
|
|
5
5
|
- '@commitlint/config-conventional'
|
|
6
6
|
- '@trivago/prettier-plugin-sort-imports'
|
|
7
7
|
- '@tsconfig/node-lts-strictest'
|
|
8
|
+
- babel-jest
|
|
8
9
|
- core-js
|
|
9
10
|
- ts-jest
|
|
10
|
-
-
|
|
11
|
-
- test-fns
|
|
12
|
-
- helpful-errors
|
|
11
|
+
- tsx
|
|
13
12
|
- husky
|
|
14
13
|
- if-env
|
|
14
|
+
- test-fns
|
|
15
|
+
- helpful-errors
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"scripts": {
|
|
14
14
|
"fix:lint": "eslint -c ./.eslintrc.js src/**/*.ts --fix",
|
|
15
15
|
"test:lint:eslint": "eslint -c ./.eslintrc.js src/**/*.ts",
|
|
16
|
-
"test:lint:deps": "npx depcheck -c
|
|
16
|
+
"test:lint:deps": "npx depcheck -c ./.depcheckrc.yml",
|
|
17
17
|
"test:lint": "npm run test:lint:eslint && npm run test:lint:deps"
|
|
18
18
|
}
|
|
19
19
|
}
|
package/dist/practices/provision-github/best-practice/provision/github/declastruct.resources.ts
CHANGED
|
@@ -97,7 +97,7 @@ export const getResources = async (): Promise<DomainEntity<any>[]> => {
|
|
|
97
97
|
requiredStatusChecks: {
|
|
98
98
|
strict: true, // branch must be up to date. otherwise, we dont know if it will really pass once it is merged
|
|
99
99
|
contexts: [
|
|
100
|
-
'suite / install /
|
|
100
|
+
'suite / install / pnpm',
|
|
101
101
|
'suite / test-commits',
|
|
102
102
|
'suite / test-types',
|
|
103
103
|
'suite / test-format',
|
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.42.
|
|
5
|
+
"version": "0.42.2",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "src/index.js",
|
|
8
8
|
"repository": "ehmpathy/declapract-typescript-ehmpathy",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"test:types": "tsc -p ./tsconfig.build.json --noEmit",
|
|
25
25
|
"test:format:prettier": "prettier --parser typescript --check 'src/**/*.ts' --config ./prettier.config.js",
|
|
26
26
|
"test:format": "npm run test:format:prettier",
|
|
27
|
-
"test:lint:deps": "npx depcheck -c
|
|
27
|
+
"test:lint:deps": "npx depcheck -c ./.depcheckrc.yml",
|
|
28
28
|
"test:lint:eslint": "eslint -c ./.eslintrc.js src/**/*.ts",
|
|
29
29
|
"test:lint": "npm run test:lint:eslint && npm run test:lint:deps",
|
|
30
30
|
"test:unit": "jest -c ./jest.unit.config.ts --forceExit --verbose --passWithNoTests $([ -z $THOROUGH ] && echo '--changedSince=main')",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"prepublish": "npm run build",
|
|
38
38
|
"preversion": "npm run prepush",
|
|
39
39
|
"postversion": "git push origin HEAD --tags --no-verify",
|
|
40
|
-
"
|
|
40
|
+
"prepare": "[ -d .git ] && npm run prepare:husky || exit 0",
|
|
41
41
|
"prepare:husky": "npx husky install && chmod ug+x .husky/*"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|