Skip to content

Commit

Permalink
upgrade config and eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
ASafaeirad committed Jan 8, 2024
1 parent 7c87d70 commit a8dc2de
Show file tree
Hide file tree
Showing 9 changed files with 2,235 additions and 1,747 deletions.
63 changes: 38 additions & 25 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,54 @@ import viteProcessor from 'cypress-vite';
import { config } from './vite.config';

const envs = new Config({
port: Config.number({ default: 3000 }),
host: Config.string({ default: 'localhost' }),
retries: Config.number({ default: 1 }),
video: Config.boolean({ default: true }),
auth0Audience: Config.string().require(),
auth0Domain: Config.string().require(),
auth0ClientId: Config.string().require(),
apiEndpoint: Config.string().require(),
hasuraAdminSecret: Config.string().require(),
cypress: Config.object({
port: Config.number({ default: 3000 }),
host: Config.string({ default: 'localhost' }),
retries: Config.number({ default: 1 }),
video: Config.boolean({ default: true }),
}),
auth0: Config.object({
audience: Config.string().required(),
domain: Config.string().required(),
clientId: Config.string().required(),
}),
api: Config.object({
endpoint: Config.string().required(),
secret: Config.string().required(),
}),
}).parse({
port: process.env.PORT,
host: process.env.HOST,
retries: process.env.CYPRESS_RETRIES,
video: process.env.CYPRESS_RECORD_VIDEO,
auth0Audience: process.env.APP_AUTH0_AUDIENCE,
auth0Domain: process.env.APP_AUTH0_DOMAIN,
auth0ClientId: process.env.APP_AUTH0_CLIENT_ID,
apiEndpoint: process.env.APP_API_ENDPOINT,
hasuraAdminSecret: process.env.APP_HASURA_ADMIN_SECRET,
cypress: {
port: process.env.PORT,
host: process.env.HOST,
retries: process.env.CYPRESS_RETRIES,
video: process.env.CYPRESS_RECORD_VIDEO,
},
auth0: {
audience: process.env.APP_AUTH0_AUDIENCE,
domain: process.env.APP_AUTH0_DOMAIN,
clientId: process.env.APP_AUTH0_CLIENT_ID,
},
api: {
endpoint: process.env.APP_API_ENDPOINT,
secret: process.env.APP_HASURA_ADMIN_SECRET,
},
});

export default defineConfig({
e2e: {
retries: envs.get('retries'),
baseUrl: `https://${envs.get('host')}:${envs.get('port')}`,
retries: envs.get('cypress.retries'),
baseUrl: `https://${envs.get('cypress.host')}:${envs.get('cypress.port')}`,
projectId: '8jt3ix',
video: envs.get('video'),
video: envs.get('cypress.video'),
defaultCommandTimeout: 10000,
experimentalMemoryManagement: true,
env: {
APP_AUTH0_AUDIENCE: envs.get('auth0Audience'),
APP_AUTH0_DOMAIN: envs.get('auth0Domain'),
APP_AUTH0_CLIENT_ID: envs.get('auth0ClientId'),
APP_API_ENDPOINT: envs.get('apiEndpoint'),
APP_HASURA_ADMIN_SECRET: envs.get('hasuraAdminSecret'),
APP_AUTH0_AUDIENCE: envs.get('auth0.audience'),
APP_AUTH0_DOMAIN: envs.get('auth0.domain'),
APP_AUTH0_CLIENT_ID: envs.get('auth0.clientId'),
APP_API_ENDPOINT: envs.get(`api.endpoint`),
APP_HASURA_ADMIN_SECRET: envs.get('api.secret'),
},
setupNodeEvents(on) {
on('file:preprocessor', viteProcessor());
Expand Down
1 change: 0 additions & 1 deletion libs/debug/Debug.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { Tuple } from '@fullstacksjs/toolbox';

/* eslint-disable @typescript-eslint/no-empty-function */
export type LogLevel = 'error' | 'info' | 'silent' | 'trace' | 'warn';

export interface Logger {
Expand Down
2 changes: 0 additions & 2 deletions libs/design/theme/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ export const theme: MantineThemeOverride = {
backgroundColor: palette.secondary.default,
borderRadius: '4px',
},

/* eslint-enable @typescript-eslint/naming-convention */
}),
dir: 'rtl',
fontFamily: 'IRANSansFaNum, IRANSans',
Expand Down
8 changes: 4 additions & 4 deletions libs/router/PathParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import type { AppRoute } from './AppRoutes';
type ExtractRouteParams<T> = string extends T
? Record<string, string>
: T extends `${infer Ignore}:${infer Param}/${infer Rest}`
? { [k in Param | keyof ExtractRouteParams<Rest>]: string }
: T extends `${infer Ignore}:${infer Param}`
? { [k in Param]: string }
: Record<string, string>;
? { [k in Param | keyof ExtractRouteParams<Rest>]: string }
: T extends `${infer Ignore}:${infer Param}`
? { [k in Param]: string }
: Record<string, string>;

// Object which has matching parameter keys for a path.
export type PathParams<P extends AppRoute> = ExtractRouteParams<P>;
1 change: 0 additions & 1 deletion libs/router/buildUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export const buildUrl = (

return parts.reduce((acc, part) => {
const param = part.startsWith(':') ? params[part.slice(1)] : part;
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
return `${acc}/${param ?? part}`;
});
};
1 change: 0 additions & 1 deletion libs/zod-addons/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
// eslint-disable-next-line import/export
export * from './monkeyPatchZod';

Check failure on line 1 in libs/zod-addons/index.ts

View workflow job for this annotation

GitHub Actions / verify

No named exports found in module './monkeyPatchZod'
export * from './toZodLiteralList';
88 changes: 44 additions & 44 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,38 +27,38 @@
"verify": "run-p compile lint:ci test:unit:ci"
},
"dependencies": {
"@apollo/client": "3.8.6",
"@auth0/auth0-react": "2.2.1",
"@cspell/dict-fa-ir": "3.0.0",
"@emotion/react": "11.11.1",
"@fullstacksjs/toolbox": "4.6.1",
"@apollo/client": "3.8.8",
"@auth0/auth0-react": "2.2.4",
"@cspell/dict-fa-ir": "4.0.0",
"@emotion/react": "11.11.3",
"@fullstacksjs/toolbox": "4.7.0",
"@graphiql/toolkit": "0.9.1",
"@hookform/resolvers": "3.3.2",
"@hookform/resolvers": "3.3.4",
"@mantine/core": "6.0.20",
"@mantine/hooks": "6.0.20",
"@mantine/modals": "6.0.20",
"@mantine/notifications": "6.0.20",
"@tanstack/react-location": "3.7.4",
"@tanstack/react-table": "8.10.7",
"@tanstack/react-table": "8.11.3",
"@total-typescript/ts-reset": "0.5.1",
"ahooks": "3.7.8",
"dayjs": "1.11.10",
"graphiql": "3.0.6",
"graphiql": "3.1.0",
"graphql": "16.8.1",
"mantine-datepicker-jalali": "1.2.3",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-dropzone": "14.2.3",
"react-feather": "2.0.10",
"react-hook-form": "7.47.0",
"stylis": "4.3.0",
"react-hook-form": "7.49.2",
"stylis": "4.3.1",
"stylis-plugin-rtl": "2.1.1",
"zod": "3.22.4"
},
"devDependencies": {
"@faker-js/faker": "8.2.0",
"@fullstacksjs/config": "1.1.0-next.4",
"@fullstacksjs/eslint-config": "10.6.3",
"@faker-js/faker": "8.3.1",
"@fullstacksjs/config": "1.1.0-next.15",
"@fullstacksjs/eslint-config": "10.9.0",
"@fullstacksjs/tsconfig": "1.1.0",
"@graphql-codegen/add": "5.0.0",
"@graphql-codegen/cli": "5.0.0",
Expand All @@ -67,49 +67,49 @@
"@graphql-codegen/typescript-operations": "4.0.1",
"@graphql-codegen/typescript-react-apollo": "4.1.0",
"@parcel/watcher": "2.3.0",
"@storybook/addon-a11y": "7.5.1",
"@storybook/addon-actions": "7.5.1",
"@storybook/addon-essentials": "7.5.1",
"@storybook/addon-interactions": "7.5.1",
"@storybook/addon-links": "7.5.1",
"@storybook/react": "7.5.1",
"@storybook/react-vite": "7.5.1",
"@storybook/addon-a11y": "7.6.7",
"@storybook/addon-actions": "7.6.7",
"@storybook/addon-essentials": "7.6.7",
"@storybook/addon-interactions": "7.6.7",
"@storybook/addon-links": "7.6.7",
"@storybook/react": "7.6.7",
"@storybook/react-vite": "7.6.7",
"@storybook/testing-library": "0.2.2",
"@testing-library/cypress": "10.0.1",
"@testing-library/jest-dom": "6.1.4",
"@testing-library/react": "14.0.0",
"@testing-library/user-event": "14.5.1",
"@types/node": "20.8.9",
"@types/react": "18.2.33",
"@types/react-dom": "18.2.14",
"@vitejs/plugin-basic-ssl": "1.0.1",
"@vitejs/plugin-react": "4.1.0",
"@testing-library/jest-dom": "6.2.0",
"@testing-library/react": "14.1.2",
"@testing-library/user-event": "14.5.2",
"@types/node": "20.10.7",
"@types/react": "18.2.47",
"@types/react-dom": "18.2.18",
"@vitejs/plugin-basic-ssl": "1.0.2",
"@vitejs/plugin-react": "4.2.1",
"buffer": "6.0.3",
"change-case-all": "1.0.15",
"chromatic": "7.5.4",
"cspell": "7.3.8",
"cypress": "13.3.3",
"cypress-vite": "1.4.2",
"chromatic": "10.2.0",
"cspell": "8.3.2",
"cypress": "13.6.2",
"cypress-vite": "1.5.0",
"dotenv": "16.3.1",
"dotenv-cli": "7.3.0",
"eslint": "8.52.0",
"eslint": "8.56.0",
"graphql-config": "5.0.3",
"graphql-request": "6.1.0",
"husky": "8.0.3",
"jsdom": "22.1.0",
"lint-staged": "15.0.2",
"jsdom": "23.2.0",
"lint-staged": "15.2.0",
"npm-run-all": "4.1.5",
"prettier": "3.0.3",
"storybook": "7.5.1",
"prettier": "3.1.1",
"storybook": "7.6.7",
"storybook-addon-apollo-client": "5.0.0",
"ts-node": "10.9.1",
"type-fest": "4.6.0",
"typescript": "5.2.2",
"vite": "4.5.0",
"ts-node": "10.9.2",
"type-fest": "4.9.0",
"typescript": "5.3.3",
"vite": "5.0.11",
"vite-plugin-checker": "0.6.2",
"vite-plugin-svgr": "4.1.0",
"vite-tsconfig-paths": "4.2.1",
"vitest": "0.34.6",
"vite-plugin-svgr": "4.2.0",
"vite-tsconfig-paths": "4.2.3",
"vitest": "1.1.3",
"vitest-dom": "0.1.1"
},
"volta": {
Expand Down
Loading

0 comments on commit a8dc2de

Please sign in to comment.