From ec5db7614a6bdb44a5956271104cebe8b3c58aed Mon Sep 17 00:00:00 2001 From: adriangohjw Date: Tue, 12 Nov 2024 19:57:32 +0800 Subject: [PATCH 1/5] bump @opengovsg/starter-kitty-validators to 1.2.7 --- apps/studio/package.json | 2 +- package-lock.json | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/studio/package.json b/apps/studio/package.json index 6c424a6831..dff5c8eafa 100644 --- a/apps/studio/package.json +++ b/apps/studio/package.json @@ -72,7 +72,7 @@ "@opengovsg/design-system-react": "^1.15.0", "@opengovsg/isomer-components": "*", "@opengovsg/sgid-client": "^2.2.0", - "@opengovsg/starter-kitty-validators": "^1.1.0", + "@opengovsg/starter-kitty-validators": "^1.2.7", "@paralleldrive/cuid2": "^2.2.2", "@prisma/client": "5.10.2", "@sendgrid/mail": "^8.1.3", diff --git a/package-lock.json b/package-lock.json index d100db51f7..2fbdb11bfc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,7 +45,7 @@ "@opengovsg/design-system-react": "^1.15.0", "@opengovsg/isomer-components": "*", "@opengovsg/sgid-client": "^2.2.0", - "@opengovsg/starter-kitty-validators": "^1.1.0", + "@opengovsg/starter-kitty-validators": "^1.2.7", "@paralleldrive/cuid2": "^2.2.2", "@prisma/client": "5.10.2", "@sendgrid/mail": "^8.1.3", @@ -8234,9 +8234,9 @@ } }, "node_modules/@opengovsg/starter-kitty-validators": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@opengovsg/starter-kitty-validators/-/starter-kitty-validators-1.1.0.tgz", - "integrity": "sha512-oi7lEgFTPp6ob/xv8I7+poqxTZ6p8SSuiOosVCptx/DFbqYR4SvPfcp06LkRPSmi2RYMMq6JtycjYWk6pS6AqA==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@opengovsg/starter-kitty-validators/-/starter-kitty-validators-1.2.7.tgz", + "integrity": "sha512-oBmwkwaTSuoFai1I7msx4jfo7cxT4dU2DXzmD2VEUpgNJZmiH0R5QRCmqqelYELexLLLwp4YcoN9wInJBOKXyQ==", "dependencies": { "email-addresses": "^5.0.0", "zod": "^3.23.8", @@ -33177,7 +33177,7 @@ "version": "0.0.13", "license": "ISC", "dependencies": { - "@datadog/browser-rum": "^5.28.1", + "@datadog/browser-rum": "^5.29.1", "@govtechsg/sgds": "^2.3.3", "@govtechsg/sgds-react": "^2.5.1", "@headlessui/react": "^2.1.2", From 65414cfca18ece861bac15bb8dd5b00dc07e3869 Mon Sep 17 00:00:00 2001 From: adriangohjw Date: Tue, 12 Nov 2024 23:31:48 +0800 Subject: [PATCH 2/5] polyfill "node:" path issue --- apps/studio/next.config.mjs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apps/studio/next.config.mjs b/apps/studio/next.config.mjs index 2e8dc78a97..dda1b3e34d 100644 --- a/apps/studio/next.config.mjs +++ b/apps/studio/next.config.mjs @@ -1,3 +1,5 @@ +import webpack from "webpack" + /** * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful * for Docker builds. @@ -65,6 +67,15 @@ const config = { images: { domains: [env.NEXT_PUBLIC_S3_ASSETS_DOMAIN_NAME ?? ""].filter((d) => d), }, + // https://github.com/vercel/next.js/issues/28774#issuecomment-1264555395 + webpack: (config, options) => { + config.plugins.push( + new webpack.NormalModuleReplacementPlugin(/^node:/, (resource) => { + resource.request = resource.request.replace(/^node:/, "") + }), + ) + return config + }, async headers() { return [ { From 50d28474b5bc505da5fe17bdd4e16761c6a21cf2 Mon Sep 17 00:00:00 2001 From: adriangohjw Date: Tue, 12 Nov 2024 23:52:03 +0800 Subject: [PATCH 3/5] polyfill "node:" path issue for storybook --- apps/studio/.storybook/main.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apps/studio/.storybook/main.ts b/apps/studio/.storybook/main.ts index 666380518b..93621b7e6f 100644 --- a/apps/studio/.storybook/main.ts +++ b/apps/studio/.storybook/main.ts @@ -1,5 +1,6 @@ import { dirname, join } from "path" import type { StorybookConfig } from "@storybook/nextjs" +import webpack from "webpack" const config: StorybookConfig = { stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"], @@ -25,6 +26,16 @@ const config: StorybookConfig = { disableTelemetry: true, }, + // https://github.com/vercel/next.js/issues/28774#issuecomment-1264555395 + webpack: (config) => { + config.plugins?.push( + new webpack.NormalModuleReplacementPlugin(/^node:/, (resource) => { + resource.request = resource.request.replace(/^node:/, "") + }), + ) + return config + }, + env: (config) => ({ ...config, SKIP_ENV_VALIDATION: "true", From 74da790b3b83d552feb3aefe8726ff7e86e85c69 Mon Sep 17 00:00:00 2001 From: adriangohjw Date: Mon, 9 Dec 2024 13:43:40 +0800 Subject: [PATCH 4/5] update starter-kitty-validators to 1.2.10 --- apps/studio/package.json | 2 +- package-lock.json | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/studio/package.json b/apps/studio/package.json index a1102d2a38..c0176484ce 100644 --- a/apps/studio/package.json +++ b/apps/studio/package.json @@ -72,7 +72,7 @@ "@opengovsg/design-system-react": "^1.15.0", "@opengovsg/isomer-components": "*", "@opengovsg/sgid-client": "^2.2.0", - "@opengovsg/starter-kitty-validators": "^1.2.7", + "@opengovsg/starter-kitty-validators": "^1.2.10", "@paralleldrive/cuid2": "^2.2.2", "@prisma/client": "5.10.2", "@sendgrid/mail": "^8.1.3", diff --git a/package-lock.json b/package-lock.json index d1cb098f0b..7a066b312c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,7 +45,7 @@ "@opengovsg/design-system-react": "^1.15.0", "@opengovsg/isomer-components": "*", "@opengovsg/sgid-client": "^2.2.0", - "@opengovsg/starter-kitty-validators": "^1.2.7", + "@opengovsg/starter-kitty-validators": "^1.2.10", "@paralleldrive/cuid2": "^2.2.2", "@prisma/client": "5.10.2", "@sendgrid/mail": "^8.1.3", @@ -8147,9 +8147,9 @@ } }, "node_modules/@opengovsg/starter-kitty-validators": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@opengovsg/starter-kitty-validators/-/starter-kitty-validators-1.2.7.tgz", - "integrity": "sha512-oBmwkwaTSuoFai1I7msx4jfo7cxT4dU2DXzmD2VEUpgNJZmiH0R5QRCmqqelYELexLLLwp4YcoN9wInJBOKXyQ==", + "version": "1.2.10", + "resolved": "https://registry.npmjs.org/@opengovsg/starter-kitty-validators/-/starter-kitty-validators-1.2.10.tgz", + "integrity": "sha512-AnO/bDEWbuUfvK6ED6xzt4pYn2/oe0A9PiVXcufGvvFskqsml2awzAu1cYLCq4tdgQGrvQizVBKZ+deKdfhbmg==", "dependencies": { "email-addresses": "^5.0.0", "zod": "^3.23.8", From 040c7a7e5aa61c33106a998f121e4fd0fd293e04 Mon Sep 17 00:00:00 2001 From: adriangohjw Date: Mon, 9 Dec 2024 13:43:46 +0800 Subject: [PATCH 5/5] remove webpack polyfill --- apps/studio/.storybook/main.ts | 11 ----------- apps/studio/next.config.mjs | 11 ----------- 2 files changed, 22 deletions(-) diff --git a/apps/studio/.storybook/main.ts b/apps/studio/.storybook/main.ts index 93621b7e6f..666380518b 100644 --- a/apps/studio/.storybook/main.ts +++ b/apps/studio/.storybook/main.ts @@ -1,6 +1,5 @@ import { dirname, join } from "path" import type { StorybookConfig } from "@storybook/nextjs" -import webpack from "webpack" const config: StorybookConfig = { stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"], @@ -26,16 +25,6 @@ const config: StorybookConfig = { disableTelemetry: true, }, - // https://github.com/vercel/next.js/issues/28774#issuecomment-1264555395 - webpack: (config) => { - config.plugins?.push( - new webpack.NormalModuleReplacementPlugin(/^node:/, (resource) => { - resource.request = resource.request.replace(/^node:/, "") - }), - ) - return config - }, - env: (config) => ({ ...config, SKIP_ENV_VALIDATION: "true", diff --git a/apps/studio/next.config.mjs b/apps/studio/next.config.mjs index d75f4b9196..35283da458 100644 --- a/apps/studio/next.config.mjs +++ b/apps/studio/next.config.mjs @@ -1,5 +1,3 @@ -import webpack from "webpack" - /** * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful * for Docker builds. @@ -131,15 +129,6 @@ const config = { images: { domains: [env.NEXT_PUBLIC_S3_ASSETS_DOMAIN_NAME ?? ""].filter((d) => d), }, - // https://github.com/vercel/next.js/issues/28774#issuecomment-1264555395 - webpack: (config, options) => { - config.plugins.push( - new webpack.NormalModuleReplacementPlugin(/^node:/, (resource) => { - resource.request = resource.request.replace(/^node:/, "") - }), - ) - return config - }, async headers() { return [ {