Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"devDependencies": {
"@code-chronicles/eslint-config": "workspace:*",
"@yarnpkg/types": "4.0.0",
"eslint": "9.11.1",
"eslint": "9.12.0",
"husky": "9.1.6",
"lint-staged": "15.2.10",
"prettier": "3.3.3"
Expand Down
6 changes: 3 additions & 3 deletions workspaces/adventure-pack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,18 @@
"@code-chronicles/util": "workspace:*",
"@jest/globals": "29.7.0",
"@types/node": "22.7.4",
"@types/react": "18.3.10",
"@types/react": "18.3.11",
"@types/react-dom": "18.3.0",
"@types/react-syntax-highlighter": "15.5.13",
"cross-env": "7.0.3",
"eslint": "9.11.1",
"eslint": "9.12.0",
"fork-ts-checker-webpack-plugin": "9.0.2",
"jest": "29.7.0",
"prettier": "3.3.3",
"prettier-plugin-java": "2.6.4",
"ts-jest": "29.2.5",
"ts-loader": "9.5.1",
"ts-morph": "23.0.0",
"ts-morph": "24.0.0",
"tsx": "4.19.1",
"type-fest": "4.26.1",
"typescript": "5.6.2",
Expand Down
2 changes: 1 addition & 1 deletion workspaces/download-leetcode-submissions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@code-chronicles/webpack-make-output-executable-plugin": "workspace:*",
"@types/node": "22.7.4",
"cross-env": "7.0.3",
"eslint": "9.11.1",
"eslint": "9.12.0",
"fork-ts-checker-webpack-plugin": "9.0.2",
"prettier": "3.3.3",
"ts-loader": "9.5.1",
Expand Down
12 changes: 6 additions & 6 deletions workspaces/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@
"lint": "eslint --color --max-warnings=0 ."
},
"dependencies": {
"@stylistic/eslint-plugin-js": "2.8.0",
"@stylistic/eslint-plugin-ts": "2.8.0",
"@stylistic/eslint-plugin-js": "2.9.0",
"@stylistic/eslint-plugin-ts": "2.9.0",
"@typescript-eslint/eslint-plugin": "8.5.0",
"@typescript-eslint/parser": "8.5.0",
"eslint-import-resolver-typescript": "3.6.3",
"eslint-plugin-import": "2.30.0",
"eslint-plugin-import-x": "4.3.0",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-import-x": "4.3.1",
"eslint-plugin-jest": "28.8.3",
"globals": "15.9.0",
"globals": "15.10.0",
"typescript": "5.6.2"
},
"devDependencies": {
"eslint": "9.11.1",
"eslint": "9.12.0",
"prettier": "3.3.3"
}
}
2 changes: 1 addition & 1 deletion workspaces/fetch-leetcode-problem-list/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@code-chronicles/webpack-make-output-executable-plugin": "workspace:*",
"@types/node": "22.7.4",
"cross-env": "7.0.3",
"eslint": "9.11.1",
"eslint": "9.12.0",
"fork-ts-checker-webpack-plugin": "9.0.2",
"prettier": "3.3.3",
"ts-loader": "9.5.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@code-chronicles/webpack-make-output-executable-plugin": "workspace:*",
"@types/node": "22.7.4",
"cross-env": "7.0.3",
"eslint": "9.11.1",
"eslint": "9.12.0",
"fork-ts-checker-webpack-plugin": "9.0.2",
"prettier": "3.3.3",
"ts-loader": "9.5.1",
Expand Down
2 changes: 1 addition & 1 deletion workspaces/generate-health-report/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"devDependencies": {
"@code-chronicles/eslint-config": "workspace:*",
"@types/node": "22.7.4",
"eslint": "9.11.1",
"eslint": "9.12.0",
"prettier": "3.3.3",
"typescript": "5.6.2"
}
Expand Down
2 changes: 1 addition & 1 deletion workspaces/javascript-leetcode-month/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@code-chronicles/util": "workspace:*",
"@types/mdast": "4.0.4",
"@types/node": "22.7.4",
"eslint": "9.11.1",
"eslint": "9.12.0",
"mdast": "3.0.0",
"prettier": "3.3.3",
"remark": "15.0.1",
Expand Down
39 changes: 39 additions & 0 deletions workspaces/leetcode-api/graphql-codegen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import type { CodegenConfig } from "@graphql-codegen/cli";

const commonTypeScriptPluginConfig = {
arrayInputCoercion: false,
avoidOptionals: true,
enumsAsTypes: true,
defaultScalarType: "unknown",
skipTypename: true,
useTypeImports: true,

// TODO: add strictScalars: true
};

const config: CodegenConfig = {
schema: "schema.graphql",
documents: ["src/**/*.graphql"],
overwrite: true,
emitLegacyCommonJSImports: false,
generates: {
"src/graphqlTypes.generated.ts": {
plugins: ["typescript"],
config: commonTypeScriptPluginConfig,
},
"src/": {
preset: "near-operation-file",
presetConfig: {
baseTypesPath: "~./graphqlTypes.generated",
extension: ".generated.ts",
},
plugins: ["typescript-operations"],
config: commonTypeScriptPluginConfig,
},
},
hooks: {
afterAllFileWrite: ["prettier --write"],
},
};

export default config;
6 changes: 4 additions & 2 deletions workspaces/leetcode-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"type": "module",
"exports": "./src/main.ts",
"scripts": {
"codegen": "graphql-codegen-esm --config graphql-codegen.ts",
"format": "prettier --color --write .",
"lint": "eslint --color --max-warnings=0 .",
"scrape-graphql-schema": "tsx src/scripts/scrape-graphql-schema/main.ts",
Expand All @@ -31,9 +32,10 @@
},
"devDependencies": {
"@code-chronicles/eslint-config": "workspace:*",
"@graphql-codegen/cli": "5.0.2",
"@graphql-codegen/near-operation-file-preset": "3.0.0",
"@types/node": "22.7.4",
"eslint": "9.11.1",
"graphql": "16.9.0",
"eslint": "9.12.0",
"jest": "29.7.0",
"prettier": "3.3.3",
"ts-jest": "29.2.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { questionDifficultyZodType } from "./zod-types/questionDifficultyZodType
import { questionTitleSlugZodType } from "./zod-types/questionTitleSlugZodType.ts";

const QUERY = gql`
query {
query fetchActiveDailyCodingChallengeQuestion {
activeDailyCodingChallengeQuestion {
date
question {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getGraphQLClient } from "./getGraphQLClient.ts";
// TODO: see if there are any fun GraphQL ESLint plugins

const QUERY = gql`
query ($topicId: Int!) {
query fetchTopic($topicId: Int!) {
topic(id: $topicId) {
title
solutionTags {
Expand Down
21 changes: 21 additions & 0 deletions workspaces/leetcode-api/src/fetchQuestionList.generated.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type * as Types from "./graphqlTypes.generated.js";

export type FetchQuestionListQueryVariables = Types.Exact<{
categorySlug: Types.Scalars["String"]["input"];
limit: Types.InputMaybe<Types.Scalars["Int"]["input"]>;
skip: Types.InputMaybe<Types.Scalars["Int"]["input"]>;
filters: Types.QuestionListFilterInput;
}>;

export type FetchQuestionListQuery = {
questionList: {
totalNum: number;
data: Array<{
difficulty: string | null;
isPaidOnly: boolean | null;
questionFrontendId: string | null;
title: string;
titleSlug: string;
}>;
} | null;
};
22 changes: 22 additions & 0 deletions workspaces/leetcode-api/src/fetchQuestionList.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
query fetchQuestionList(
$categorySlug: String!
$limit: Int
$skip: Int
$filters: QuestionListFilterInput!
) {
questionList(
categorySlug: $categorySlug
limit: $limit
skip: $skip
filters: $filters
) {
data {
difficulty
isPaidOnly
questionFrontendId
title
titleSlug
}
totalNum
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getGraphQLClient } from "./getGraphQLClient.ts";
import { questionTitleSlugZodType } from "./zod-types/questionTitleSlugZodType.ts";

const QUERY = gql`
query ($username: String!, $limit: Int!) {
query fetchRecentAcSubmissionList($username: String!, $limit: Int!) {
recentAcSubmissionList(username: $username, limit: $limit) {
id
title
Expand Down
Loading
Loading