Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,31 @@
"version": "0.1.0",
"private": true,
"type": "module",
"license": "BSD-3-Clause",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't remove license from package.json 😄

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed 😅

"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"predev": "pnpm run generate",
"prebuild": "pnpm run generate",
"lint": "next lint --dir src --fix",
"generate": "graphql-codegen --config .graphqlrc.ts",
"generate": "DOTENV_CONFIG_PATH=.env graphql-codegen -r dotenv/config --config ./src/checkout/codegen.yml && graphql-codegen --config .graphqlrc.ts",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: I would rather see you add additional config entry to existing .graphqlrc.ts instead of creating new config file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a new config. in .graphqlrc.ts and remove codegen.yml file

"prepare": "husky install",
"test": "playwright test"
},
"dependencies": {
"@adyen/adyen-web": "5.53.3",
"@adyen/api-library": "15.0.0-beta",
"@headlessui/react": "1.7.18",
"@hookform/resolvers": "3.10.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: why those new dependencies are needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unwanted dependency as I was working with some new functionality.

"@saleor/auth-sdk": "1.0.1",
"@saleor/macaw-ui-next": "npm:@saleor/macaw-ui@1.1.15",
"@stripe/react-stripe-js": "2.6.2",
"@stripe/stripe-js": "2.2.0",
"@tailwindcss/container-queries": "0.1.1",
"clsx": "2.1.0",
"dotenv": "16.4.7",
"editorjs-html": "3.4.3",
"env-vars": "0.5.0",
"formik": "2.4.5",
"libphonenumber-js": "1.10.58",
"lodash-es": "4.17.21",
Expand All @@ -46,8 +49,13 @@
"zustand": "4.4.6"
},
"devDependencies": {
"@graphql-codegen/add": "5.0.3",
"@graphql-codegen/cli": "5.0.0",
"@graphql-codegen/client-preset": "4.1.0",
"@graphql-codegen/introspection": "4.0.3",
"@graphql-codegen/typescript": "4.1.3",
"@graphql-codegen/typescript-operations": "4.4.1",
"@graphql-codegen/typescript-urql": "4.0.0",
"@graphql-typed-document-node/core": "3.2.0",
"@next/env": "14.0.4",
"@parcel/watcher": "2.3.0",
Expand Down
24 changes: 24 additions & 0 deletions src/checkout/codegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
overwrite: true
schema: ${NEXT_PUBLIC_SALEOR_API_URL}
documents: "src/checkout/graphql/**/*.graphql"
generates:
src/checkout/graphql/index.ts:
plugins:
- add:
content: |-
// THIS FILE IS GENERATED WITH `pnpm generate`
import "graphql/language/ast";
- "typescript"
- "typescript-operations"
- "typescript-urql"
config:
scalars:
JSONString: string
UUID: string
Metadata: Record<string, string>
DateTime: string
dedupeOperationSuffix: true # Prevent suffix duplication in generated names
enumsAsTypes: true # note: this doesn't work with @saleor/app-sdk webhook inference
src/checkout/graphql.schema.json:
plugins:
- "introspection"