Skip to content

Commit

Permalink
chore(dev-deps): latest (#76)
Browse files Browse the repository at this point in the history
* chore(dev-deps): latest

* chore(dev-deps): latest

* chore(dev-deps): latest eslint

* refactor: lint with latest typescript recommded
  • Loading branch information
belgattitude authored Sep 16, 2023
1 parent e6bc233 commit 0005c23
Show file tree
Hide file tree
Showing 16 changed files with 933 additions and 845 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v3
with:
#with:
# Fetch all git history so that yarn workspaces --since can compare with the correct commits
# @link https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches
fetch-depth: 0
# fetch-depth: 0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
Expand Down
2 changes: 2 additions & 0 deletions examples/next-classic/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const {

module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: 'tsconfig.json',
Expand All @@ -31,6 +32,7 @@ module.exports = {
],
rules: {
// optional overrides per project
'@typescript-eslint/require-await': 'warn',
},
overrides: [
// optional overrides per project file match
Expand Down
6 changes: 3 additions & 3 deletions examples/next-classic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@
"zod": "3.22.2"
},
"devDependencies": {
"@belgattitude/eslint-config-bases": "1.17.1",
"@belgattitude/eslint-config-bases": "2.6.0",
"@types/node": "20.6.2",
"@types/react": "18.2.21",
"@types/react-dom": "18.2.7",
"cross-env": "7.0.3",
"eslint": "8.49.0",
"eslint-config-next": "13.4.19",
"postcss": "8.4.29",
"prettier": "2.8.3",
"prettier": "3.0.3",
"rimraf": "5.0.1",
"tailwindcss": "3.3.3",
"typescript": "4.9.4"
"typescript": "4.9.5"
}
}
6 changes: 2 additions & 4 deletions examples/next-classic/src/backend/withApiErrorHandler.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import type { HttpException } from '@httpx/exception';
import { isHttpException } from '@httpx/exception';
import { isHttpException, type HttpException } from '@httpx/exception';
import { convertToSerializable } from '@httpx/exception/serializer';
import type { NextApiHandler, NextApiRequest, NextApiResponse } from 'next';
import type { LoggerInterface } from '@/lib';
import { ConsoleLogger } from '@/lib';
import { ConsoleLogger, type LoggerInterface } from '@/lib';

type Params = {
logger?: LoggerInterface;
Expand Down
4 changes: 2 additions & 2 deletions examples/next-classic/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { InferZodServerSideProps } from '@nextvalid/zod-request';
import { zodGssp } from '@nextvalid/zod-request';
import { zodGssp, type InferZodServerSideProps } from '@nextvalid/zod-request';
import type { GetServerSideProps, InferGetServerSidePropsType } from 'next';
import { z } from 'zod';

Expand Down Expand Up @@ -42,6 +41,7 @@ export default function ssrRoute(

export const getServerSideProps: GetServerSideProps<Props> = async (
context
// eslint-disable-next-line @typescript-eslint/require-await
) => {
const data = schema.parse(context);
return {
Expand Down
10 changes: 6 additions & 4 deletions examples/next-classic/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@
"@nextvalid/zod-request": ["../../packages/zod-request/src/index"]
}
},
"exclude": ["**/node_modules", ".next", "**/.*/*", "storybook-static"],
"include": [
".eslintrc.*",
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"**/*.js",
"**/*.jsx",
"**/*.cjs",
"**/*.mjs"
],
"exclude": ["**/node_modules", "**/.*/"]
"**.*.cjs",
"**/*.mjs",
"**/*.json"
]
}
38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
"packages/*"
],
"scripts": {
"g:clean": "yarn clean:global-cache && yarn workspaces foreach -Wp run clean",
"g:build": "yarn workspaces foreach -Wpt run build",
"g:clean": "yarn clean:global-cache && yarn workspaces foreach -Ap run clean",
"g:build": "yarn workspaces foreach -At run build",
"g:build-packages": "yarn workspaces foreach -Wpt --from './packages/**' run build",
"g:build-examples": "yarn workspaces foreach -Wpt --from './examples/**' run build",
"g:build-doc": "yarn workspaces foreach -ptv run build-doc",
"g:test": "yarn workspaces foreach -p run test",
"g:test-unit": "yarn workspaces foreach -W run test-unit",
"g:lint": "yarn workspaces foreach -W run lint",
"g:typecheck": "yarn workspaces foreach -W run typecheck",
"g:build-doc": "yarn workspaces foreach -Apt run build-doc",
"g:test": "yarn workspaces foreach -A run test",
"g:test-unit": "yarn workspaces foreach -A run test-unit",
"g:lint": "yarn workspaces foreach -A run lint",
"g:typecheck": "yarn workspaces foreach -A run typecheck",
"g:lint-staged-files": "lint-staged --allow-empty",
"g:fix-all-files": "yarn workspaces foreach -Wpt run fix-all-files",
"g:fix-all-files": "yarn workspaces foreach -Apt run fix-all-files",
"g:changeset": "changeset",
"g:check-dist": "yarn workspaces foreach -Wpt run check-dist",
"g:check-size": "yarn workspaces foreach -Wpt run check-size",
"g:check-dist": "yarn workspaces foreach -Apt run check-dist",
"g:check-size": "yarn workspaces foreach -Apt run check-size",
"g:release": "yarn g:build-packages && changeset publish",
"clean:lint": "rimraf ./.cache/eslint",
"clean:global-cache": "rimraf ./.cache",
Expand All @@ -42,25 +42,25 @@
"nuke:node_modules": "rimraf --glob '**/node_modules'"
},
"devDependencies": {
"@belgattitude/eslint-config-bases": "1.35.0",
"@belgattitude/eslint-config-bases": "2.6.0",
"@changesets/changelog-github": "0.4.8",
"@changesets/cli": "2.26.2",
"@commitlint/cli": "17.4.2",
"@commitlint/config-conventional": "17.4.2",
"@commitlint/cli": "17.7.1",
"@commitlint/config-conventional": "17.7.0",
"@types/prettier": "2.7.2",
"@types/shell-quote": "1.7.1",
"cross-env": "7.0.3",
"docsify": "4.13.0",
"docsify": "4.13.1",
"docsify-cli": "4.4.4",
"eslint": "8.32.0",
"eslint": "8.49.0",
"husky": "8.0.3",
"is-ci": "3.0.1",
"lint-staged": "13.1.0",
"lint-staged": "14.0.1",
"npm-run-all": "4.1.5",
"prettier": "2.8.3",
"prettier": "3.0.3",
"rimraf": "5.0.1",
"shell-quote": "1.7.4",
"typescript": "4.9.4"
"shell-quote": "1.8.1",
"typescript": "4.9.5"
},
"resolutions?": {
"eslint-plugin-react-hooks": "https://github.com/vercel/next.js/issues/52365"
Expand Down
2 changes: 2 additions & 0 deletions packages/zod-request/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const {

module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: 'tsconfig.json',
Expand All @@ -27,6 +28,7 @@ module.exports = {
],
rules: {
// optional overrides per project
'@typescript-eslint/no-redundant-type-constituents': 'warn',
},
overrides: [
// optional overrides per project file match
Expand Down
6 changes: 3 additions & 3 deletions packages/zod-request/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
}
},
"devDependencies": {
"@belgattitude/eslint-config-bases": "1.35.0",
"@belgattitude/eslint-config-bases": "2.6.0",
"@size-limit/file": "9.0.0",
"@size-limit/webpack": "9.0.0",
"@size-limit/webpack-why": "9.0.0",
Expand All @@ -96,7 +96,7 @@
"get-tsconfig": "4.7.0",
"next": "13.4.19",
"npm-run-all": "4.1.5",
"prettier": "2.8.3",
"prettier": "3.0.3",
"react": "18.2.0",
"react-dom": "18.2.0",
"rimraf": "5.0.1",
Expand All @@ -105,7 +105,7 @@
"tsup": "6.5.0",
"typedoc": "0.25.1",
"typedoc-plugin-markdown": "3.16.0",
"typescript": "4.9.4",
"typescript": "4.9.5",
"vite": "4.4.9",
"vite-tsconfig-paths": "4.2.1",
"vitest": "0.34.3",
Expand Down
3 changes: 1 addition & 2 deletions packages/zod-request/src/ZodRequest.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { z } from 'zod';
import type { IErrorHandler } from './error';
import { HttpExceptionHandler } from './error';
import { HttpExceptionHandler, type IErrorHandler } from './error';
import type { ParsableRequest, RequestSchema } from './types';
import { mapRequestSchemaToZod } from './utils';

Expand Down
3 changes: 1 addition & 2 deletions packages/zod-request/src/ZodServerSideProps.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { z } from 'zod';
import type { IErrorHandler } from './error';
import { HttpExceptionHandler } from './error';
import { HttpExceptionHandler, type IErrorHandler } from './error';
import type { ServerSidePropsSchema, ParsableGsspContext } from './types';
import { mapServerSidePropsSchemaToZod } from './utils';

Expand Down
6 changes: 3 additions & 3 deletions packages/zod-request/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export type InferReqSchema<T extends Partial<RequestSchema>> = z.infer<
>;

export type InferServerSidePropsSchema<
T extends Partial<ServerSidePropsSchema>
T extends Partial<ServerSidePropsSchema>,
> = z.infer<
ReturnType<
typeof mapServerSidePropsSchemaToZod<{
Expand All @@ -85,7 +85,7 @@ export type InferServerSidePropsSchema<

export type InferZodRequest<
ZR extends ZodRequest<RequestSchema>,
T = ZR['schema']
T = ZR['schema'],
> = z.infer<
ReturnType<
typeof mapRequestSchemaToZod<{
Expand All @@ -105,7 +105,7 @@ export type InferZodRequest<

export type InferZodServerSideProps<
ZR extends ZodServerSideProps<ServerSidePropsSchema>,
T = ZR['schema']
T = ZR['schema'],
> = z.infer<
ReturnType<
typeof mapRequestSchemaToZod<{
Expand Down
6 changes: 3 additions & 3 deletions packages/zod-request/test/zodGssp.type-expect.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { assertType, expectTypeOf } from 'vitest';
import { expectTypeOf } from 'vitest';
import { z } from 'zod';
import { zodGssp, zodReq, ZodServerSideProps } from '../src';
import { createGsspContext, createNextRequest } from './_helpers';
import { zodGssp } from '../src';
import { createGsspContext } from './_helpers';

describe('zodGssp type expectations', () => {
it('should pass types and runtime checks', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/zod-request/test/zodReq.type-expect.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertType, expectTypeOf } from 'vitest';
import { expectTypeOf } from 'vitest';
import { z } from 'zod';
import { zodReq } from '../src';
import { createNextRequest } from './_helpers';
Expand Down
13 changes: 11 additions & 2 deletions packages/zod-request/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
"paths": {},
"types": ["vitest/globals"]
},
"exclude": ["**/node_modules", "**/.*/", "./dist", "./coverage"],
"include": ["**/*.ts", "**/*.js", "**/.cjs", "**/*.mjs", "**/*.json"]
"exclude": ["**/node_modules", ".next", "**/.*/*", "coverage"],
"include": [
".eslintrc.*",
"**/*.ts",
"**/*.tsx",
"**/*.js",
"**/*.jsx",
"**.*.cjs",
"**/*.mjs",
"**/*.json"
]
}
Loading

0 comments on commit 0005c23

Please sign in to comment.