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.
@@ -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
- "postinstall": "[ -d .git ] && npm run prepare:husky || exit 0"
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
- - ts-node
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 ./depcheckrc.yml",
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
  }
@@ -68,6 +68,7 @@ export const desiredRelativeKeyOrder = {
68
68
  'postversion',
69
69
  'postinstall',
70
70
  'prepare:husky',
71
+ 'prepare',
71
72
  'deploy:prune',
72
73
  'deploy:release',
73
74
  'deploy:send-notification',
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "dependencies": {
3
3
  "pg": "@declapract{check.minVersion('8.3.0')}",
4
- "procedure-fns": "@declapract{check.minVersion('1.0.0')}",
5
4
  "yesql": "@declapract{check.minVersion('3.2.2')}"
6
5
  },
7
6
  "devDependencies": {
@@ -0,0 +1,3 @@
1
+ import { FileCheckType } from 'declapract';
2
+
3
+ export const check = FileCheckType.EXISTS;
@@ -0,0 +1,3 @@
1
+ import { FileCheckType } from 'declapract';
2
+
3
+ export const check = FileCheckType.EXISTS;
@@ -0,0 +1,3 @@
1
+ import { FileCheckType } from 'declapract';
2
+
3
+ export const check = FileCheckType.EXISTS;
@@ -0,0 +1,3 @@
1
+ import { FileCheckType } from 'declapract';
2
+
3
+ export const check = FileCheckType.EXISTS;
@@ -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 / npm',
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.0",
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 ./depcheckrc.yml",
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
- "postinstall": "[ -d .git ] && npm run prepare:husky || exit 0",
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": {