declapract-typescript-ehmpathy 0.43.16 → 0.43.17

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,3 @@
1
+ joi has been replaced by zod as the preferred runtime type-checking library.
2
+
3
+ zod provides better TypeScript integration with automatic type inference, smaller bundle size, and a more modern API.
@@ -0,0 +1,5 @@
1
+ {
2
+ "dependencies": {
3
+ "joi": "@declapract{check.minVersion('0.0.0')}"
4
+ }
5
+ }
@@ -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
+ joi: undefined,
13
+ zod: packageJSON.dependencies?.zod ?? '^3.24.0',
14
+ },
15
+ };
16
+ return {
17
+ contents: JSON.stringify(updatedPackageJSON, null, 2),
18
+ };
19
+ };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "dependencies": {
3
- "joi": "@declapract{check.minVersion('17.4.0')}"
3
+ "zod": "@declapract{check.minVersion('3.24.0')}"
4
4
  }
5
5
  }
@@ -8,7 +8,7 @@ plugins:
8
8
 
9
9
  provider:
10
10
  name: aws
11
- runtime: nodejs16.x
11
+ runtime: nodejs22.x
12
12
  memorySize: 1024 # optional, in mb, default is 1024
13
13
  timeout: 60 # default timeout to 1min, for resilience against increased cold start times; individual functions can override this
14
14
  stage: ${opt:stage}
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.43.16",
5
+ "version": "0.43.17",
6
6
  "license": "MIT",
7
7
  "main": "src/index.js",
8
8
  "repository": "ehmpathy/declapract-typescript-ehmpathy",