diff --git a/.changeset/sour-dingos-roll.md b/.changeset/sour-dingos-roll.md new file mode 100644 index 0000000..7c004bc --- /dev/null +++ b/.changeset/sour-dingos-roll.md @@ -0,0 +1,15 @@ +--- +"saleor-app-emails-and-messages": patch +"saleor-app-data-importer": patch +"saleor-app-products-feed": patch +"saleor-app-monitoring": patch +"saleor-app-invoices": patch +"saleor-app-klaviyo": patch +"saleor-app-search": patch +"saleor-app-slack": patch +"saleor-app-taxes": patch +"saleor-app-cms": patch +"saleor-app-crm": patch +--- + +Restored Pino logger packages to each app, to fix failing logs in development. Also updated .env.example to contain up to date APP_LOG_LEVEL variable diff --git a/apps/cms/package.json b/apps/cms/package.json index ddd44fc..95d125a 100644 --- a/apps/cms/package.json +++ b/apps/cms/package.json @@ -30,6 +30,8 @@ "graphql": "^16.6.0", "graphql-tag": "^2.12.6", "next": "13.3.0", + "pino": "^8.14.1", + "pino-pretty": "^10.0.0", "react": "18.2.0", "react-dom": "18.2.0", "react-hook-form": "^7.39.1", diff --git a/apps/crm/.env.example b/apps/crm/.env.example index bf8ef31..c556029 100644 --- a/apps/crm/.env.example +++ b/apps/crm/.env.example @@ -9,4 +9,4 @@ REST_APL_TOKEN= MAILCHIMP_CLIENT_ID= MAILCHIMP_CLIENT_SECRET= -APP_LOG_LEVEL=debug \ No newline at end of file +APP_LOG_LEVEL=info \ No newline at end of file diff --git a/apps/crm/package.json b/apps/crm/package.json index 0fd8acc..846e594 100644 --- a/apps/crm/package.json +++ b/apps/crm/package.json @@ -33,6 +33,8 @@ "jsdom": "^20.0.3", "next": "13.3.0", "next-urql": "^4.0.2", + "pino": "^8.14.1", + "pino-pretty": "^10.0.0", "react": "18.2.0", "react-dom": "18.2.0", "react-hook-form": "^7.43.0", diff --git a/apps/data-importer/.env.example b/apps/data-importer/.env.example index f62e6b0..abc3cff 100644 --- a/apps/data-importer/.env.example +++ b/apps/data-importer/.env.example @@ -1,3 +1,5 @@ # https://getnuvo.com/ NEXT_PUBLIC_NUVO_LICENSE_KEY= -NEXT_PUBLIC_NUVO_PROD_MODE=false \ No newline at end of file +NEXT_PUBLIC_NUVO_PROD_MODE=false + +APP_LOG_LEVEL=info \ No newline at end of file diff --git a/apps/data-importer/package.json b/apps/data-importer/package.json index afae05d..ac489ff 100644 --- a/apps/data-importer/package.json +++ b/apps/data-importer/package.json @@ -34,6 +34,8 @@ "jsdom": "^20.0.3", "next": "13.3.0", "nuvo-react": "^1.22.1", + "pino": "^8.14.1", + "pino-pretty": "^10.0.0", "react": "18.2.0", "react-dom": "18.2.0", "urql": "^3.0.3", diff --git a/apps/emails-and-messages/.env.example b/apps/emails-and-messages/.env.example index c923f4e..118ad0f 100644 --- a/apps/emails-and-messages/.env.example +++ b/apps/emails-and-messages/.env.example @@ -7,3 +7,4 @@ APL= REST_APL_ENDPOINT= REST_APL_TOKEN= +APP_LOG_LEVEL=info \ No newline at end of file diff --git a/apps/emails-and-messages/package.json b/apps/emails-and-messages/package.json index 2c8ae95..7e0282a 100644 --- a/apps/emails-and-messages/package.json +++ b/apps/emails-and-messages/package.json @@ -42,6 +42,8 @@ "next": "13.3.0", "next-urql": "^4.0.3", "nodemailer": "^6.9.1", + "pino": "^8.14.1", + "pino-pretty": "^10.0.0", "react": "18.2.0", "react-dom": "18.2.0", "react-hook-form": "^7.43.0", diff --git a/apps/invoices/.env.example b/apps/invoices/.env.example index e0038b5..bec91ed 100644 --- a/apps/invoices/.env.example +++ b/apps/invoices/.env.example @@ -2,7 +2,7 @@ # https://vercel.com/guides/how-can-i-use-files-in-serverless-functions TEMP_PDF_STORAGE_DIR= #"fatal" | "error" | "warn" | "info" | "debug" | "trace" -APP_DEBUG=info +APP_LOG_LEVEL=info # Optional # Regex pattern consumed conditionally to restrcit app installation to specific urls. # See api/register.tsx diff --git a/apps/invoices/package.json b/apps/invoices/package.json index 2a83d15..b0b4e53 100644 --- a/apps/invoices/package.json +++ b/apps/invoices/package.json @@ -17,6 +17,7 @@ "schemaVersion": "3.10" }, "dependencies": { + "@hookform/resolvers": "^3.1.0", "@saleor/app-sdk": "0.37.3", "@saleor/apps-shared": "workspace:*", "@saleor/macaw-ui": "^0.8.0-pre.80", @@ -34,6 +35,8 @@ "graphql-tag": "^2.12.6", "microinvoice": "^1.0.6", "next": "13.3.0", + "pino": "^8.14.1", + "pino-pretty": "^10.0.0", "react": "18.2.0", "react-dom": "18.2.0", "react-hook-form": "^7.41.0", @@ -41,8 +44,7 @@ "tiny-invariant": "^1.3.1", "urql": "^3.0.3", "usehooks-ts": "^2.9.1", - "zod": "^3.20.2", - "@hookform/resolvers": "^3.1.0" + "zod": "^3.20.2" }, "devDependencies": { "@graphql-codegen/cli": "3.2.2", diff --git a/apps/klaviyo/.env.example b/apps/klaviyo/.env.example index ed25d30..d4b1107 100644 --- a/apps/klaviyo/.env.example +++ b/apps/klaviyo/.env.example @@ -6,4 +6,6 @@ APL=file # Example: "https:\/\/.*.saleor.cloud\/graphql\/" to enable Saleor Cloud APIs ALLOWED_DOMAIN_PATTERN= # Encryption key used by the EncryptedSettingsManager. Required by the production builds -SECRET_KEY= \ No newline at end of file +SECRET_KEY= + +APP_LOG_LEVEL=info \ No newline at end of file diff --git a/apps/klaviyo/package.json b/apps/klaviyo/package.json index 96d65fb..82260d0 100644 --- a/apps/klaviyo/package.json +++ b/apps/klaviyo/package.json @@ -28,6 +28,8 @@ "graphql-tag": "^2.12.6", "next": "13.3.0", "node-fetch": "^3.2.6", + "pino": "^8.14.1", + "pino-pretty": "^10.0.0", "react": "18.2.0", "react-dom": "18.2.0", "react-helmet": "^6.1.0", diff --git a/apps/monitoring/package.json b/apps/monitoring/package.json index 7b23c82..0fb6cdd 100644 --- a/apps/monitoring/package.json +++ b/apps/monitoring/package.json @@ -28,6 +28,8 @@ "graphql-tag": "^2.12.6", "jsdom": "^20.0.3", "next": "13.3.0", + "pino": "^8.14.1", + "pino-pretty": "^10.0.0", "react": "18.2.0", "react-dom": "18.2.0", "react-hook-form": "^7.42.1", diff --git a/apps/products-feed/package.json b/apps/products-feed/package.json index 313debd..05a2eef 100644 --- a/apps/products-feed/package.json +++ b/apps/products-feed/package.json @@ -37,6 +37,8 @@ "jsdom": "^20.0.3", "next": "13.3.0", "next-urql": "^4.0.2", + "pino": "^8.14.1", + "pino-pretty": "^10.0.0", "react": "18.2.0", "react-dom": "18.2.0", "react-hook-form": "^7.43.0", diff --git a/apps/search/.env.example b/apps/search/.env.example index e382ef7..cbee4ca 100644 --- a/apps/search/.env.example +++ b/apps/search/.env.example @@ -1,2 +1,4 @@ # Encryption key used by the EncryptedSettingsManager. Required by the production builds -SECRET_KEY= \ No newline at end of file +SECRET_KEY= + +APP_LOG_LEVEL=info \ No newline at end of file diff --git a/apps/search/package.json b/apps/search/package.json index fe3d420..4e94340 100644 --- a/apps/search/package.json +++ b/apps/search/package.json @@ -30,6 +30,8 @@ "graphql-tag": "^2.12.6", "next": "13.3.0", "next-urql": "4.0.0", + "pino": "^8.14.1", + "pino-pretty": "^10.0.0", "react": "18.2.0", "react-dom": "18.2.0", "react-helmet": "^6.1.0", @@ -56,10 +58,10 @@ "eslint-config-next": "13.0.2", "eslint-config-prettier": "^8.5.0", "eslint-config-saleor": "workspace:*", + "node-mocks-http": "^1.12.2", "prettier": "^2.7.1", "typescript": "4.8.4", "vite": "^4.3.1", - "vitest": "^0.30.1", - "node-mocks-http": "^1.12.2" + "vitest": "^0.30.1" } } diff --git a/apps/search/src/lib/logger.ts b/apps/search/src/lib/logger.ts index d455fa1..a0356cb 100644 --- a/apps/search/src/lib/logger.ts +++ b/apps/search/src/lib/logger.ts @@ -3,8 +3,11 @@ import { createLogger as _createLogger } from "@saleor/apps-shared"; /** * Extend factory to add more settings specific for the app */ -export const logger = _createLogger({ - redact: ["token", "secretKey"], -}); +export const logger = _createLogger( + {}, + { + redact: ["token", "secretKey"], + } +); export const createLogger = logger.child.bind(logger); diff --git a/apps/slack/.env.example b/apps/slack/.env.example index fd1a7cc..cbee4ca 100644 --- a/apps/slack/.env.example +++ b/apps/slack/.env.example @@ -1,2 +1,4 @@ # Encryption key used by the EncryptedSettingsManager. Required by the production builds SECRET_KEY= + +APP_LOG_LEVEL=info \ No newline at end of file diff --git a/apps/slack/package.json b/apps/slack/package.json index dbd3327..8a67206 100644 --- a/apps/slack/package.json +++ b/apps/slack/package.json @@ -28,6 +28,8 @@ "graphql-tag": "^2.12.6", "jose": "^4.11.2", "next": "13.3.0", + "pino": "^8.14.1", + "pino-pretty": "^10.0.0", "react": "18.2.0", "react-dom": "18.2.0", "react-helmet": "^6.1.0", diff --git a/apps/taxes/.env.example b/apps/taxes/.env.example index c0d1f30..6c323ed 100644 --- a/apps/taxes/.env.example +++ b/apps/taxes/.env.example @@ -1,6 +1,7 @@ +APL=file + #"fatal" | "error" | "warn" | "info" | "debug" | "trace" -APL= -APP_DEBUG=info +APP_LOG_LEVEL=info NODE_ENV= SECRET_KEY= PORT= diff --git a/apps/taxes/package.json b/apps/taxes/package.json index c64ab64..9eb296c 100644 --- a/apps/taxes/package.json +++ b/apps/taxes/package.json @@ -38,6 +38,8 @@ "jotai": "^2.0.0", "jsdom": "^20.0.3", "next": "13.3.0", + "pino": "^8.14.1", + "pino-pretty": "^10.0.0", "react": "18.2.0", "react-dom": "18.2.0", "react-hook-form": "^7.42.1", diff --git a/apps/taxes/src/lib/logger.ts b/apps/taxes/src/lib/logger.ts index 42c4c7f..6ca8c55 100644 --- a/apps/taxes/src/lib/logger.ts +++ b/apps/taxes/src/lib/logger.ts @@ -1,13 +1,16 @@ -import { createLogger as _createLogger, Logger } from "@saleor/apps-shared"; +import { Logger, logger as _logger } from "@saleor/apps-shared"; -export const logger = _createLogger({ - redact: [ - "metadata", - "providerInstance.config.username", - "providerInstance.config.password", - "providerInstance.config.apiKey", - ], -}); +export const logger = _logger.child( + {}, + { + redact: [ + "metadata", + "providerInstance.config.username", + "providerInstance.config.password", + "providerInstance.config.apiKey", + ], + } +); export const createLogger = logger.child.bind(logger); diff --git a/packages/shared/package.json b/packages/shared/package.json index e0daf76..06a1087 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -2,8 +2,8 @@ "name": "@saleor/apps-shared", "version": "1.5.0", "dependencies": { - "pino": "^8.8.0", - "pino-pretty": "^9.1.1" + "pino": "^8.14.1", + "pino-pretty": "^10.0.0" }, "devDependencies": { "@material-ui/core": "^4.12.4", @@ -21,6 +21,8 @@ }, "peerDependencies": { "next": "^13.3.0", + "pino": "^8.14.1", + "pino-pretty": "^10.0.0", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ea685da..438b874 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -73,6 +73,12 @@ importers: next: specifier: 13.3.0 version: 13.3.0(@babel/core@7.21.4)(react-dom@18.2.0)(react@18.2.0) + pino: + specifier: ^8.14.1 + version: 8.14.1 + pino-pretty: + specifier: ^10.0.0 + version: 10.0.0 react: specifier: 18.2.0 version: 18.2.0 @@ -218,6 +224,12 @@ importers: next-urql: specifier: ^4.0.2 version: 4.0.3(react@18.2.0)(urql@3.0.3) + pino: + specifier: ^8.14.1 + version: 8.14.1 + pino-pretty: + specifier: ^10.0.0 + version: 10.0.0 react: specifier: 18.2.0 version: 18.2.0 @@ -363,6 +375,12 @@ importers: nuvo-react: specifier: ^1.22.1 version: 1.22.1(@babel/core@7.21.4)(react-dom@18.2.0)(react@18.2.0) + pino: + specifier: ^8.14.1 + version: 8.14.1 + pino-pretty: + specifier: ^10.0.0 + version: 10.0.0 react: specifier: 18.2.0 version: 18.2.0 @@ -523,6 +541,12 @@ importers: nodemailer: specifier: ^6.9.1 version: 6.9.1 + pino: + specifier: ^8.14.1 + version: 8.14.1 + pino-pretty: + specifier: ^10.0.0 + version: 10.0.0 react: specifier: 18.2.0 version: 18.2.0 @@ -680,6 +704,12 @@ importers: next: specifier: 13.3.0 version: 13.3.0(@babel/core@7.21.4)(react-dom@18.2.0)(react@18.2.0) + pino: + specifier: ^8.14.1 + version: 8.14.1 + pino-pretty: + specifier: ^10.0.0 + version: 10.0.0 react: specifier: 18.2.0 version: 18.2.0 @@ -816,6 +846,12 @@ importers: node-fetch: specifier: ^3.2.6 version: 3.3.0 + pino: + specifier: ^8.14.1 + version: 8.14.1 + pino-pretty: + specifier: ^10.0.0 + version: 10.0.0 react: specifier: 18.2.0 version: 18.2.0 @@ -940,6 +976,12 @@ importers: next: specifier: 13.3.0 version: 13.3.0(@babel/core@7.21.4)(react-dom@18.2.0)(react@18.2.0) + pino: + specifier: ^8.14.1 + version: 8.14.1 + pino-pretty: + specifier: ^10.0.0 + version: 10.0.0 react: specifier: 18.2.0 version: 18.2.0 @@ -1085,6 +1127,12 @@ importers: next-urql: specifier: ^4.0.2 version: 4.0.3(react@18.2.0)(urql@3.0.3) + pino: + specifier: ^8.14.1 + version: 8.14.1 + pino-pretty: + specifier: ^10.0.0 + version: 10.0.0 react: specifier: 18.2.0 version: 18.2.0 @@ -1218,6 +1266,12 @@ importers: next-urql: specifier: 4.0.0 version: 4.0.0(react@18.2.0)(urql@3.0.3) + pino: + specifier: ^8.14.1 + version: 8.14.1 + pino-pretty: + specifier: ^10.0.0 + version: 10.0.0 react: specifier: 18.2.0 version: 18.2.0 @@ -1348,6 +1402,12 @@ importers: next: specifier: 13.3.0 version: 13.3.0(@babel/core@7.21.4)(react-dom@18.2.0)(react@18.2.0) + pino: + specifier: ^8.14.1 + version: 8.14.1 + pino-pretty: + specifier: ^10.0.0 + version: 10.0.0 react: specifier: 18.2.0 version: 18.2.0 @@ -1499,6 +1559,12 @@ importers: next: specifier: 13.3.0 version: 13.3.0(@babel/core@7.21.4)(react-dom@18.2.0)(react@18.2.0) + pino: + specifier: ^8.14.1 + version: 8.14.1 + pino-pretty: + specifier: ^10.0.0 + version: 10.0.0 react: specifier: 18.2.0 version: 18.2.0 @@ -1622,11 +1688,11 @@ importers: packages/shared: dependencies: pino: - specifier: ^8.8.0 - version: 8.9.0 + specifier: ^8.14.1 + version: 8.14.1 pino-pretty: - specifier: ^9.1.1 - version: 9.1.1 + specifier: ^10.0.0 + version: 10.0.0 devDependencies: '@material-ui/core': specifier: ^4.12.4 @@ -14042,8 +14108,8 @@ packages: split2: 4.1.0 dev: false - /pino-pretty@9.1.1: - resolution: {integrity: sha512-iJrnjgR4FWQIXZkUF48oNgoRI9BpyMhaEmihonHeCnZ6F50ZHAS4YGfGBT/ZVNsPmd+hzkIPGzjKdY08+/yAXw==} + /pino-pretty@10.0.0: + resolution: {integrity: sha512-zKFjYXBzLaLTEAN1ayKpHXtL5UeRQC7R3lvhKe7fWs7hIVEjKGG/qIXwQt9HmeUp71ogUd/YcW+LmMwRp4KT6Q==} hasBin: true dependencies: colorette: 2.0.19 @@ -14066,8 +14132,8 @@ packages: resolution: {integrity: sha512-KO0m2f1HkrPe9S0ldjx7za9BJjeHqBku5Ch8JyxETxT8dEFGz1PwgrHaOQupVYitpzbFSYm7nnljxD8dik2c+g==} dev: false - /pino@8.9.0: - resolution: {integrity: sha512-/x9qSrFW4wh+7OL5bLIbfl06aK/8yCSIldhD3VmVGiVYWSdFFpXvJh/4xWKENs+DhG1VkJnnpWxMF6fZ2zGXeg==} + /pino@8.14.1: + resolution: {integrity: sha512-8LYNv7BKWXSfS+k6oEc6occy5La+q2sPwU3q2ljTX5AZk7v+5kND2o5W794FyRaqha6DJajmkNRsWtPpFyMUdw==} hasBin: true dependencies: atomic-sleep: 1.0.0