Skip to content

Commit

Permalink
Deps update and minor plain object refactor (#1661)
Browse files Browse the repository at this point in the history
* chore: update codecov script

* refactor: return earlier

* chore(dev-deps): all to latest

* chore: move eslint jest to vitest plugin
  • Loading branch information
belgattitude authored Nov 17, 2024
1 parent 49edbb6 commit be1dbb3
Show file tree
Hide file tree
Showing 38 changed files with 788 additions and 1,485 deletions.
5 changes: 5 additions & 0 deletions .changeset/twenty-squids-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@httpx/plain-object": patch
---

Tiny size reduction
2 changes: 1 addition & 1 deletion .github/scripts/install-codecov.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

VERSION=0.7.3
VERSION=0.8.0
PLATFORM=linux
CODECOV_BINARY_URL=https://github.com/codecov/uploader/releases/download/v${VERSION}/codecov-${PLATFORM}
OUTPUT_DIR="$(cd $(dirname $0); pwd)/download"
Expand Down
2 changes: 1 addition & 1 deletion devtools/vitest/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
'@belgattitude/eslint-config-bases/import-x',
'@belgattitude/eslint-config-bases/sonar',
'@belgattitude/eslint-config-bases/regexp',
'@belgattitude/eslint-config-bases/jest',
'@belgattitude/eslint-config-bases/vitest',
'@belgattitude/eslint-config-bases/performance',

// Apply prettier and disable incompatible rules
Expand Down
4 changes: 2 additions & 2 deletions devtools/vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"vitest": "2.1.5"
},
"dependencies": {
"@belgattitude/eslint-config-bases": "6.4.0",
"@belgattitude/eslint-config-bases": "6.5.0",
"@cloudflare/vitest-pool-workers": "0.5.28",
"@codspeed/vitest-plugin": "3.1.1",
"@edge-runtime/vm": "4.0.4",
Expand All @@ -39,7 +39,7 @@
"esbuild": "0.24.0",
"playwright": "1.48.2",
"typescript": "5.6.3",
"vite": "5.4.10",
"vite": "5.4.11",
"vite-tsconfig-paths": "5.1.2"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion docs/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {
'@belgattitude/eslint-config-bases/simple-import-sort',
'@belgattitude/eslint-config-bases/sonar',
'@belgattitude/eslint-config-bases/regexp',
'@belgattitude/eslint-config-bases/jest',
'@belgattitude/eslint-config-bases/vitest',
'@belgattitude/eslint-config-bases/react',
'@belgattitude/eslint-config-bases/rtl',
'@belgattitude/eslint-config-bases/tailwind',
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"react-dom": "18.3.1"
},
"devDependencies": {
"@belgattitude/eslint-config-bases": "6.4.0",
"@belgattitude/eslint-config-bases": "6.5.0",
"eslint": "8.57.1",
"eslint-config-next": "15.0.3",
"eslint-plugin-tailwindcss": "3.17.5",
Expand Down
4 changes: 2 additions & 2 deletions docs2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
},
"dependencies": {
"@astrojs/check": "0.9.4",
"@astrojs/starlight": "0.28.6",
"astro": "4.16.10",
"@astrojs/starlight": "0.29.0",
"astro": "4.16.13",
"sharp": "0.33.5",
"typescript": "5.6.3"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs-app/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
'@belgattitude/eslint-config-bases/perfectionist',
'@belgattitude/eslint-config-bases/sonar',
'@belgattitude/eslint-config-bases/regexp',
'@belgattitude/eslint-config-bases/jest',
'@belgattitude/eslint-config-bases/vitest',
'@belgattitude/eslint-config-bases/react',
'@belgattitude/eslint-config-bases/rtl',
// Add specific rules for nextjs
Expand Down
29 changes: 15 additions & 14 deletions examples/nextjs-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"axios": "1.7.7",
"clsx": "2.1.1",
"ky": "1.7.2",
"next": "15.0.2",
"next": "15.0.3",
"pino": "9.5.0",
"primereact": "10.8.4",
"react": "18.3.1",
Expand All @@ -38,25 +38,26 @@
"zod": "3.23.8"
},
"devDependencies": {
"@belgattitude/eslint-config-bases": "6.2.0",
"@types/node": "22.8.4",
"@belgattitude/eslint-config-bases": "6.5.0",
"@types/node": "22.9.0",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"@vitejs/plugin-react-swc": "3.7.1",
"@vitest/coverage-v8": "2.1.4",
"@vitest/ui": "2.1.4",
"@vitest/coverage-v8": "2.1.5",
"@vitest/ui": "2.1.5",
"cross-env": "7.0.3",
"eslint": "8.57.1",
"eslint-config-next": "15.0.2",
"happy-dom": "15.7.4",
"postcss": "8.4.47",
"eslint-config-next": "15.0.3",
"happy-dom": "15.11.6",
"postcss": "8.4.49",
"prettier": "3.3.3",
"rimraf": "6.0.1",
"tailwindcss": "3.4.14",
"tailwindcss": "3.4.15",
"typescript": "5.6.3",
"vite": "5.4.10",
"vite-plugin-svgr": "4.2.0",
"vite-tsconfig-paths": "5.0.1",
"vitest": "2.1.4",
"webpack": "5.95.0"
"vite": "5.4.11",
"vite-plugin-svgr": "4.3.0",
"vite-tsconfig-paths": "5.1.2",
"vitest": "2.1.5",
"webpack": "5.96.1"
}
}
2 changes: 1 addition & 1 deletion integrations/prisma-exception/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
'@belgattitude/eslint-config-bases/import-x',
'@belgattitude/eslint-config-bases/sonar',
'@belgattitude/eslint-config-bases/regexp',
'@belgattitude/eslint-config-bases/jest',
'@belgattitude/eslint-config-bases/vitest',
'@belgattitude/eslint-config-bases/performance',
// Apply prettier and disable incompatible rules
'@belgattitude/eslint-config-bases/prettier-plugin',
Expand Down
5 changes: 3 additions & 2 deletions integrations/prisma-exception/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
},
"devDependencies": {
"@arethetypeswrong/cli": "0.17.0",
"@belgattitude/eslint-config-bases": "6.4.0",
"@belgattitude/eslint-config-bases": "6.5.0",
"@size-limit/file": "11.1.6",
"@size-limit/webpack": "11.1.6",
"@size-limit/webpack-why": "11.1.6",
Expand All @@ -83,14 +83,15 @@
"esbuild": "0.24.0",
"eslint": "8.57.1",
"npm-run-all2": "7.0.1",
"prettier": "3.3.3",
"publint": "0.2.12",
"rimraf": "6.0.1",
"size-limit": "11.1.6",
"tsup": "8.3.5",
"typedoc": "0.26.11",
"typedoc-plugin-markdown": "4.2.10",
"typescript": "5.6.3",
"vite": "5.4.10",
"vite": "5.4.11",
"vite-tsconfig-paths": "5.1.2",
"vitest": "2.1.5",
"webpack": "5.96.1"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
],
"packageManager": "[email protected]",
"devDependencies": {
"@belgattitude/eslint-config-bases": "6.4.0",
"@belgattitude/eslint-config-bases": "6.5.0",
"@changesets/changelog-github": "0.5.0",
"@changesets/cli": "2.27.9",
"@commitlint/cli": "19.5.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/assert/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
'@belgattitude/eslint-config-bases/import-x',
'@belgattitude/eslint-config-bases/sonar',
'@belgattitude/eslint-config-bases/regexp',
'@belgattitude/eslint-config-bases/jest',
'@belgattitude/eslint-config-bases/vitest',
'@belgattitude/eslint-config-bases/performance',

// Apply prettier and disable incompatible rules
Expand Down
5 changes: 3 additions & 2 deletions packages/assert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@
},
"devDependencies": {
"@arethetypeswrong/cli": "0.17.0",
"@belgattitude/eslint-config-bases": "6.4.0",
"@belgattitude/eslint-config-bases": "6.5.0",
"@httpx/devtools-vitest": "workspace:^",
"@sinclair/typebox": "0.34.0",
"@sinclair/typebox": "0.34.2",
"@sindresorhus/is": "7.0.1",
"@size-limit/file": "11.1.6",
"@size-limit/webpack": "11.1.6",
Expand All @@ -88,6 +88,7 @@
"is-plain-obj": "4.1.0",
"lodash-es": "4.17.21",
"npm-run-all2": "7.0.1",
"prettier": "3.3.3",
"publint": "0.2.12",
"rimraf": "6.0.1",
"rollup": "4.27.2",
Expand Down
8 changes: 4 additions & 4 deletions packages/assert/src/__tests__/object.types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('object types tests', () => {
key: 'value',
} as unknown;
const typed = isPlainObject(unknownPo);
// eslint-disable-next-line jest/no-conditional-in-test
// eslint-disable-next-line @vitest/no-conditional-in-test
if (!typed) {
throw new Error('Test code is incorrect');
}
Expand All @@ -56,7 +56,7 @@ describe('object types tests', () => {
key: 'value',
};
const typed = isPlainObject(knownPo);
// eslint-disable-next-line jest/no-conditional-in-test
// eslint-disable-next-line @vitest/no-conditional-in-test
if (!typed) {
throw new Error('Test code is incorrect');
}
Expand All @@ -77,7 +77,7 @@ describe('object types tests', () => {
},
} as unknown;
const typed = isPlainObject<CustomType>(unknownPo);
// eslint-disable-next-line jest/no-conditional-in-test
// eslint-disable-next-line @vitest/no-conditional-in-test
if (!typed) {
throw new Error('Test code is incorrect');
}
Expand Down Expand Up @@ -116,7 +116,7 @@ describe('object types tests', () => {
},
} as unknown;
const typed = isPlainObject<DeepCustomType>(po);
// eslint-disable-next-line jest/no-conditional-in-test
// eslint-disable-next-line @vitest/no-conditional-in-test
if (!typed) {
throw new Error('Test code is incorrect');
}
Expand Down
8 changes: 4 additions & 4 deletions packages/assert/src/__tests__/types.assert.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('type assertions', () => {
state: 'loading' | 'error';
};
const ret = (net: Network) => {
// eslint-disable-next-line jest/no-conditional-in-test
// eslint-disable-next-line @vitest/no-conditional-in-test
switch (net.state) {
case 'error':
return 'error';
Expand All @@ -35,7 +35,7 @@ describe('type assertions', () => {
state: 'loading' | 'error';
};
const ret = (net: Network) => {
// eslint-disable-next-line jest/no-conditional-in-test
// eslint-disable-next-line @vitest/no-conditional-in-test
switch (net.state) {
case 'error':
return 'error';
Expand Down Expand Up @@ -65,7 +65,7 @@ describe('type assertions', () => {
state: 'loading' | 'error';
};
const ret = (net: Network) => {
// eslint-disable-next-line jest/no-conditional-in-test
// eslint-disable-next-line @vitest/no-conditional-in-test
switch (net.state) {
case 'error':
return 'error';
Expand All @@ -92,7 +92,7 @@ describe('type assertions', () => {
state: 'loading' | 'error';
};
const ret = (net: Network) => {
// eslint-disable-next-line jest/no-conditional-in-test
// eslint-disable-next-line @vitest/no-conditional-in-test
switch (net.state) {
case 'error':
return 'error';
Expand Down
2 changes: 1 addition & 1 deletion packages/dsn-parser/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
'@belgattitude/eslint-config-bases/import-x',
'@belgattitude/eslint-config-bases/sonar',
'@belgattitude/eslint-config-bases/regexp',
'@belgattitude/eslint-config-bases/jest',
'@belgattitude/eslint-config-bases/vitest',
'@belgattitude/eslint-config-bases/performance',

// Apply prettier and disable incompatible rules
Expand Down
3 changes: 2 additions & 1 deletion packages/dsn-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
},
"devDependencies": {
"@arethetypeswrong/cli": "0.17.0",
"@belgattitude/eslint-config-bases": "6.4.0",
"@belgattitude/eslint-config-bases": "6.5.0",
"@httpx/devtools-vitest": "workspace:^",
"@size-limit/file": "11.1.6",
"@size-limit/webpack": "11.1.6",
Expand All @@ -82,6 +82,7 @@
"esbuild": "0.24.0",
"eslint": "8.57.1",
"npm-run-all2": "7.0.1",
"prettier": "3.3.3",
"publint": "0.2.12",
"rimraf": "6.0.1",
"rollup": "4.27.2",
Expand Down
3 changes: 1 addition & 2 deletions packages/dsn-parser/src/is-parsable-dsn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ import type { ParsableDsn } from './dsn-parser.type';
import { parseDsn } from './parse-dsn';

export const isParsableDsn = (dsn: unknown): dsn is ParsableDsn => {
const parsed = parseDsn(dsn as string);
return parsed.success;
return parseDsn(dsn as string).success;
};
2 changes: 1 addition & 1 deletion packages/exception/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
'@belgattitude/eslint-config-bases/import-x',
'@belgattitude/eslint-config-bases/sonar',
'@belgattitude/eslint-config-bases/regexp',
'@belgattitude/eslint-config-bases/jest',
'@belgattitude/eslint-config-bases/vitest',
'@belgattitude/eslint-config-bases/performance',
// Apply prettier and disable incompatible rules
'@belgattitude/eslint-config-bases/prettier-plugin',
Expand Down
3 changes: 2 additions & 1 deletion packages/exception/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
},
"devDependencies": {
"@arethetypeswrong/cli": "0.17.0",
"@belgattitude/eslint-config-bases": "6.4.0",
"@belgattitude/eslint-config-bases": "6.5.0",
"@httpx/devtools-vitest": "workspace:^",
"@size-limit/file": "11.1.6",
"@size-limit/webpack": "11.1.6",
Expand All @@ -121,6 +121,7 @@
"esbuild": "0.24.0",
"eslint": "8.57.1",
"npm-run-all2": "7.0.1",
"prettier": "3.3.3",
"publint": "0.2.12",
"rimraf": "6.0.1",
"rollup": "4.27.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('isNativeError', () => {
}) as [name: string, err: NativeError][];

it.each(native)('should return true for %p', (_name, err) => {
expect(isNativeError(err)).toBeTruthy();
expect(isNativeError(err)).toBe(true);
});
});
describe('when a custom error is provided', () => {
Expand All @@ -24,7 +24,7 @@ describe('isNativeError', () => {
}
}
const e = new NonNativeError('cool');
expect(isNativeError(e)).toBeFalsy();
expect(isNativeError(e)).toBe(false);
});
});

Expand All @@ -33,6 +33,6 @@ describe('isNativeError', () => {
['null', null],
['undefined', undefined],
])('"%p" is not native', (_name, err) => {
expect(isNativeError(err as unknown as Error)).toBeFalsy();
expect(isNativeError(err as unknown as Error)).toBe(false);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ import { isHttpErrorStatusCode } from '../isHttpErrorStatusCode';

describe('isHttpErrorStatusCode', () => {
it('should return true if status code is an http error status', () => {
expect(isHttpErrorStatusCode(400)).toBeTruthy();
expect(isHttpErrorStatusCode(599)).toBeTruthy();
expect(isHttpErrorStatusCode(400)).toBe(true);
expect(isHttpErrorStatusCode(599)).toBe(true);
});

it('should return false if status code not an error', () => {
expect(isHttpErrorStatusCode(200)).toBeFalsy();
expect(isHttpErrorStatusCode(399)).toBeFalsy();
expect(isHttpErrorStatusCode(600)).toBeFalsy();
expect(isHttpErrorStatusCode(200)).toBe(false);
expect(isHttpErrorStatusCode(399)).toBe(false);
expect(isHttpErrorStatusCode(600)).toBe(false);
});

it('should return false if status is not a number', () => {
expect(isHttpErrorStatusCode(new Date())).toBeFalsy();
expect(isHttpErrorStatusCode(Number.NaN)).toBeFalsy();
expect(isHttpErrorStatusCode('100')).toBeFalsy();
expect(isHttpErrorStatusCode(new Date())).toBe(false);
expect(isHttpErrorStatusCode(Number.NaN)).toBe(false);
expect(isHttpErrorStatusCode('100')).toBe(false);
});
});
Loading

0 comments on commit be1dbb3

Please sign in to comment.