declapract-typescript-ehmpathy 0.47.74 → 0.48.0
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/cache/best-practice/package.json +7 -0
- package/dist/practices/config/best-practice/package.json +0 -1
- package/dist/practices/dates-and-times/bad-practices/uni-time/package.json +5 -0
- package/dist/practices/dates-and-times/bad-practices/uni-time/package.json.declapract.ts +23 -0
- package/dist/practices/dates-and-times/bad-practices/uni-time/src/<star><star>/<star>.ts.declapract.ts +17 -0
- package/dist/practices/domain/best-practice/package.json +2 -2
- package/dist/practices/lint/best-practice/.depcheckrc.yml +3 -0
- package/dist/practices/lint/best-practice/.dpdmrc.yaml +5 -2
- package/dist/practices/lint/best-practice/package.json +1 -1
- package/dist/useCases.yml +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"dependencies": {
|
|
3
|
+
"simple-in-memory-cache": "@declapract{check.minVersion('0.4.3').ifPresent()}",
|
|
4
|
+
"simple-on-disk-cache": "@declapract{check.minVersion('1.7.10').ifPresent()}",
|
|
5
|
+
"with-simple-cache": "@declapract{check.minVersion('0.16.2').ifPresent()}"
|
|
6
|
+
}
|
|
7
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
|
+
import { FileCheckType, type FileFixFunction } from 'declapract';
|
|
3
|
+
|
|
4
|
+
export const check = FileCheckType.CONTAINS;
|
|
5
|
+
|
|
6
|
+
export const fix: FileFixFunction = (contents) => {
|
|
7
|
+
if (!contents) return { contents }; // pass through if contents absent
|
|
8
|
+
const packageJSON = JSON.parse(contents);
|
|
9
|
+
const updatedPackageJSON = {
|
|
10
|
+
...packageJSON,
|
|
11
|
+
dependencies: {
|
|
12
|
+
...packageJSON.dependencies,
|
|
13
|
+
'@ehmpathy/uni-time': undefined,
|
|
14
|
+
},
|
|
15
|
+
devDependencies: {
|
|
16
|
+
...packageJSON.devDependencies,
|
|
17
|
+
'@ehmpathy/uni-time': undefined,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
return {
|
|
21
|
+
contents: JSON.stringify(updatedPackageJSON, null, 2),
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
|
+
import type { FileCheckFunction, FileFixFunction } from 'declapract';
|
|
3
|
+
|
|
4
|
+
export const check: FileCheckFunction = (contents) => {
|
|
5
|
+
if (contents?.includes("from '@ehmpathy/uni-time'")) return; // matches if it includes this
|
|
6
|
+
throw new Error('does not match bad practice'); // does not otherwise
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const fix: FileFixFunction = (contents) => {
|
|
10
|
+
if (!contents) return {}; // pass through if contents absent
|
|
11
|
+
return {
|
|
12
|
+
contents: contents.replace(
|
|
13
|
+
/from '@ehmpathy\/uni-time'/g,
|
|
14
|
+
"from 'iso-time'",
|
|
15
|
+
),
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
|
-
"domain-objects": "@declapract{check.minVersion('0.31.
|
|
4
|
-
"type-fns": "@declapract{check.minVersion('1.21.
|
|
3
|
+
"domain-objects": "@declapract{check.minVersion('0.31.13')}",
|
|
4
|
+
"type-fns": "@declapract{check.minVersion('1.21.3')}"
|
|
5
5
|
}
|
|
6
6
|
}
|
|
@@ -7,6 +7,7 @@ ignores:
|
|
|
7
7
|
- rhachet-roles-bhrain
|
|
8
8
|
- rhachet-roles-bhuild
|
|
9
9
|
- rhachet-roles-ehmpathy
|
|
10
|
+
- rhachet-roles-rhachet
|
|
10
11
|
- declapract
|
|
11
12
|
- declapract-typescript-ehmpathy
|
|
12
13
|
- "@commitlint/config-conventional"
|
|
@@ -20,3 +21,5 @@ ignores:
|
|
|
20
21
|
- tsx
|
|
21
22
|
- tsc-alias
|
|
22
23
|
- yalc
|
|
24
|
+
- test-fns
|
|
25
|
+
- type-fns
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# dpdm exclude patterns
|
|
2
2
|
# each entry is joined with | to form a single regex for --exclude
|
|
3
3
|
#
|
|
4
|
-
#
|
|
5
|
-
#
|
|
4
|
+
# with --transform flag, type imports are erased before analysis
|
|
5
|
+
# and test files are excluded via glob pattern '!(*.test).ts'
|
|
6
|
+
# so excludes are rarely needed even for devDependencies
|
|
7
|
+
#
|
|
8
|
+
# never exclude prod dependencies — you'd ship cycles to consumers
|
|
6
9
|
exclude: []
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"test:format:biome": "biome format",
|
|
11
11
|
"test:lint:biome": "biome check --diagnostic-level=error",
|
|
12
12
|
"test:lint:biome:all": "biome check",
|
|
13
|
-
"test:lint:cycles": "dpdm --no-warning --no-tree --exit-code circular:1 --exclude \"$(yq -r '.exclude | join(\"|\") // \"^$\"' .dpdmrc.yaml)\" 'src
|
|
13
|
+
"test:lint:cycles": "dpdm --no-warning --no-tree --transform --exit-code circular:1 --exclude \"$(yq -r '.exclude | join(\"|\") // \"^$\"' .dpdmrc.yaml)\" 'src/**/!(*.test).ts'",
|
|
14
14
|
"test:lint:deps": "npx depcheck -c ./.depcheckrc.yml",
|
|
15
15
|
"test:lint": "npm run test:lint:biome && npm run test:lint:cycles && npm run test:lint:deps"
|
|
16
16
|
}
|
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.
|
|
5
|
+
"version": "0.48.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "src/index.js",
|
|
8
8
|
"repository": "ehmpathy/declapract-typescript-ehmpathy",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"preversion": "npm run prepush",
|
|
44
44
|
"postversion": "git push origin HEAD --tags --no-verify",
|
|
45
45
|
"prepare:husky": "husky install && chmod ug+x .husky/*",
|
|
46
|
-
"prepare:rhachet": "rhachet init --hooks --roles mechanic behaver driver
|
|
46
|
+
"prepare:rhachet": "rhachet init --hooks --roles mechanic behaver driver architect ergonomist reviewer dreamer dispatcher",
|
|
47
47
|
"prepare": "if [ -e .git ] && [ -z \"${CI:-}\" ]; then npm run prepare:husky && npm run prepare:rhachet; fi"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"yaml": "2.8.2"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"declapract": ">=0.13.
|
|
58
|
+
"declapract": ">=0.13.22"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@biomejs/biome": "2.3.8",
|