From 57c14aee2374e3fba7f2554ebc77536f63a34082 Mon Sep 17 00:00:00 2001 From: Nikhil Mehta Date: Sat, 6 Sep 2025 20:48:39 +0530 Subject: [PATCH 1/5] refactor: moved api code to typescript --- api/createLink.js | 27 ----- api/createLink.ts | 31 +++++ api/db/{dbConstants.js => dbConstants.ts} | 0 api/db/{getRecordById.js => getRecordById.ts} | 2 +- ...{getTop10Records.js => getTop10Records.ts} | 0 api/db/{index.js => index.ts} | 9 +- api/db/{insertRecord.js => insertRecord.ts} | 4 +- api/getLink.js | 18 --- api/getLink.ts | 22 ++++ api/package.json | 3 + api/types.ts | 7 ++ package-lock.json | 114 +++++++++++++----- package.json | 2 + vercel.json | 4 +- 14 files changed, 159 insertions(+), 84 deletions(-) delete mode 100644 api/createLink.js create mode 100644 api/createLink.ts rename api/db/{dbConstants.js => dbConstants.ts} (100%) rename api/db/{getRecordById.js => getRecordById.ts} (88%) rename api/db/{getTop10Records.js => getTop10Records.ts} (100%) rename api/db/{index.js => index.ts} (62%) rename api/db/{insertRecord.js => insertRecord.ts} (76%) delete mode 100644 api/getLink.js create mode 100644 api/getLink.ts create mode 100644 api/package.json create mode 100644 api/types.ts diff --git a/api/createLink.js b/api/createLink.js deleted file mode 100644 index 6162a88..0000000 --- a/api/createLink.js +++ /dev/null @@ -1,27 +0,0 @@ -import { getPool } from './db/index.js' -import { insertRecord } from './db/insertRecord.js' - -export const config = { runtime: 'nodejs' } - -export default async function handler(req, res) { - try { - const result = await insertRecord({ - data: req.body.data, - id: req.body.id, - }) - if (result) { - res.status(200).json({ - success: true, - }) - } else { - throw new Error('Failed to insert record') - } - } catch (error) { - console.error(error) - res.status(500).json({ message: error.message || 'Internal server error' }) - } -} - -process.on('SIGTERM', () => { - getPool().end() -}) diff --git a/api/createLink.ts b/api/createLink.ts new file mode 100644 index 0000000..b6b8285 --- /dev/null +++ b/api/createLink.ts @@ -0,0 +1,31 @@ +import { Request, Response } from 'express' +import { getPool } from './db/index.js' +import { insertRecord } from './db/insertRecord.js' +import { DBInsertRecord } from './types.js' +export const config = { runtime: 'nodejs' } + +export default async function handler(req: Request<{}, {}, DBInsertRecord>, res: Response) { + const body = req.body + try { + const result = await insertRecord({ + data: body.data, + id: body.id, + }) + if (result) { + res.status(200).json({ + success: true, + }) + } else { + throw new Error('Failed to insert record') + } + } catch (error: unknown) { + if (error instanceof Error) { + console.error(error) + res.status(500).json({ message: error.message || 'Internal server error' }) + } + } +} + +process.on('SIGTERM', () => { + getPool().end() +}) diff --git a/api/db/dbConstants.js b/api/db/dbConstants.ts similarity index 100% rename from api/db/dbConstants.js rename to api/db/dbConstants.ts diff --git a/api/db/getRecordById.js b/api/db/getRecordById.ts similarity index 88% rename from api/db/getRecordById.js rename to api/db/getRecordById.ts index 763ea25..18204d7 100644 --- a/api/db/getRecordById.js +++ b/api/db/getRecordById.ts @@ -1,7 +1,7 @@ import { DB_SCHEMA } from './dbConstants.js' import { getPool } from './index.js' -export async function getRecordById(id) { +export async function getRecordById(id: string) { const client = await getPool().connect() try { const res = await client.query( diff --git a/api/db/getTop10Records.js b/api/db/getTop10Records.ts similarity index 100% rename from api/db/getTop10Records.js rename to api/db/getTop10Records.ts diff --git a/api/db/index.js b/api/db/index.ts similarity index 62% rename from api/db/index.js rename to api/db/index.ts index 659c84e..74d8365 100644 --- a/api/db/index.js +++ b/api/db/index.ts @@ -1,15 +1,18 @@ import { Pool } from 'pg' -let pool = null +let pool: Pool | null = null export function getPool() { - if (!pool || !pool.connected) { + if (!process.env.DB_USER || !process.env.DB_HOST || !process.env.DB_NAME || !process.env.DB_PASSWORD || !process.env.DB_PORT) { + throw new Error('Missing database environment variables') + } + if (!pool) { pool = new Pool({ user: process.env.DB_USER, host: process.env.DB_HOST, database: process.env.DB_NAME, password: process.env.DB_PASSWORD, - port: process.env.DB_PORT, + port: parseInt(process.env.DB_PORT), max: 5, // Maximum number of connections in the pool idleTimeoutMillis: 30000, // Close idle connections after 30 seconds connectionTimeoutMillis: 2000, // How long to wait for a connection from the pool diff --git a/api/db/insertRecord.js b/api/db/insertRecord.ts similarity index 76% rename from api/db/insertRecord.js rename to api/db/insertRecord.ts index 43cdf43..a9fcd93 100644 --- a/api/db/insertRecord.js +++ b/api/db/insertRecord.ts @@ -1,6 +1,8 @@ +import { DBInsertRecord } from '../types.js' import { DB_SCHEMA } from './dbConstants.js' import { getPool } from './index.js' -export async function insertRecord({ data, id }) { + +export async function insertRecord({ data, id }: DBInsertRecord) { const client = await getPool().connect() try { await client.query( diff --git a/api/getLink.js b/api/getLink.js deleted file mode 100644 index a0d9545..0000000 --- a/api/getLink.js +++ /dev/null @@ -1,18 +0,0 @@ -import { getRecordById } from './db/getRecordById.js' -import { getPool } from './db/index.js' - -export const config = { runtime: 'nodejs' } - -export default async function handler(req, res) { - try { - const records = await getRecordById(req.query.id) - res.json(records) - } catch (error) { - console.error(error) - res.status(500).json({ message: error.message || 'Internal server error' }) - } -} - -process.on('SIGTERM', () => { - getPool().end() -}) diff --git a/api/getLink.ts b/api/getLink.ts new file mode 100644 index 0000000..cbcd09e --- /dev/null +++ b/api/getLink.ts @@ -0,0 +1,22 @@ +import { Request, Response } from 'express' +import { getRecordById } from './db/getRecordById.js' +import { getPool } from './db/index.js' +import { DBRecord } from './types.js' + +export const config = { runtime: 'nodejs' } + +export default async function handler(req: Request<{}, {}, {}, Pick>, res: Response) { + try { + const records = await getRecordById(req.query.id) + res.json(records) + } catch (error: unknown) { + if (error instanceof Error) { + console.error(error) + res.status(500).json({ message: error.message || 'Internal server error' }) + } + } +} + +process.on('SIGTERM', () => { + getPool().end() +}) diff --git a/api/package.json b/api/package.json new file mode 100644 index 0000000..3dbc1ca --- /dev/null +++ b/api/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/api/types.ts b/api/types.ts new file mode 100644 index 0000000..3223822 --- /dev/null +++ b/api/types.ts @@ -0,0 +1,7 @@ +export interface DBRecord { + data: string + id: string + creationTimestamp: string +} + +export type DBInsertRecord = Omit diff --git a/package-lock.json b/package-lock.json index 64486b2..02775c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,6 +33,8 @@ "@nuxtjs/eslint-module": "^3.0.2", "@nuxtjs/stylelint-module": "^4.0.0", "@nuxtjs/tailwindcss": "^4.2.0", + "@types/express": "^5.0.3", + "@types/pg": "^8.15.5", "@vue/test-utils": "^1.2.1", "babel-core": "7.0.0-bridge.0", "babel-jest": "^27.0.5", @@ -6291,26 +6293,28 @@ } }, "node_modules/@types/express": { - "version": "4.17.13", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", - "integrity": "sha1-p24plXKJmbq1GjP6vOHXBaNwkDQ=", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.3.tgz", + "integrity": "sha512-wGA0NX93b19/dZC1J18tKWVIYWyyF2ZjT9vin/NRu0qzzvfVzWjs04iq2rQ3H65vCTQYlRqs3YHfY7zjdV+9Kw==", "dev": true, + "license": "MIT", "dependencies": { "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.18", - "@types/qs": "*", + "@types/express-serve-static-core": "^5.0.0", "@types/serve-static": "*" } }, "node_modules/@types/express-serve-static-core": { - "version": "4.17.25", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.25.tgz", - "integrity": "sha1-5C9wRq3GXs4utgWbd67Pvp6fguA=", + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.7.tgz", + "integrity": "sha512-R+33OsgWw7rOhD1emjU7dzCDHucJrgJXMA5PYCzJxVil0dsyx5iBEPHqpPfiKNJQb7lZ1vxwoLR4Z87bBUpeGQ==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*", "@types/qs": "*", - "@types/range-parser": "*" + "@types/range-parser": "*", + "@types/send": "*" } }, "node_modules/@types/file-loader": { @@ -6445,6 +6449,18 @@ "integrity": "sha1-L4u0QUNNFjs1+4/9zNcTiSf/uMA=", "dev": true }, + "node_modules/@types/pg": { + "version": "8.15.5", + "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.15.5.tgz", + "integrity": "sha512-LF7lF6zWEKxuT3/OR8wAZGzkg4ENGXFNyiV/JeOt9z5B+0ZVwbql9McqX5c/WStFq1GaGso7H1AzP/qSzmlCKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "pg-protocol": "*", + "pg-types": "^2.2.0" + } + }, "node_modules/@types/prettier": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.4.2.tgz", @@ -6463,16 +6479,18 @@ "integrity": "sha1-daKo59irSyMEFFBdkjNdHctTpt8=" }, "node_modules/@types/qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", - "integrity": "sha1-Y7t9Bn2xB8weRXwwO8JdUR/r9ss=", - "dev": true + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ==", + "dev": true, + "license": "MIT" }, "node_modules/@types/range-parser": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", - "integrity": "sha1-zWZ7z90CUhOq+3ylkVqTJZCs3Nw=", - "dev": true + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true, + "license": "MIT" }, "node_modules/@types/relateurl": { "version": "0.2.29", @@ -6508,6 +6526,17 @@ "@types/node": "*" } }, + "node_modules/@types/send": { + "version": "0.17.5", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.5.tgz", + "integrity": "sha512-z6F2D3cOStZvuk2SaP6YrwkNO65iTZcwA2ZkSABegdkAh/lf+Aa/YQndZVfmEXT5vgAp6zv06VQ3ejSVjAny4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, "node_modules/@types/serve-static": { "version": "1.13.9", "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.9.tgz", @@ -37184,26 +37213,26 @@ } }, "@types/express": { - "version": "4.17.13", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", - "integrity": "sha1-p24plXKJmbq1GjP6vOHXBaNwkDQ=", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.3.tgz", + "integrity": "sha512-wGA0NX93b19/dZC1J18tKWVIYWyyF2ZjT9vin/NRu0qzzvfVzWjs04iq2rQ3H65vCTQYlRqs3YHfY7zjdV+9Kw==", "dev": true, "requires": { "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.18", - "@types/qs": "*", + "@types/express-serve-static-core": "^5.0.0", "@types/serve-static": "*" } }, "@types/express-serve-static-core": { - "version": "4.17.25", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.25.tgz", - "integrity": "sha1-5C9wRq3GXs4utgWbd67Pvp6fguA=", + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.7.tgz", + "integrity": "sha512-R+33OsgWw7rOhD1emjU7dzCDHucJrgJXMA5PYCzJxVil0dsyx5iBEPHqpPfiKNJQb7lZ1vxwoLR4Z87bBUpeGQ==", "dev": true, "requires": { "@types/node": "*", "@types/qs": "*", - "@types/range-parser": "*" + "@types/range-parser": "*", + "@types/send": "*" } }, "@types/file-loader": { @@ -37337,6 +37366,17 @@ "integrity": "sha1-L4u0QUNNFjs1+4/9zNcTiSf/uMA=", "dev": true }, + "@types/pg": { + "version": "8.15.5", + "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.15.5.tgz", + "integrity": "sha512-LF7lF6zWEKxuT3/OR8wAZGzkg4ENGXFNyiV/JeOt9z5B+0ZVwbql9McqX5c/WStFq1GaGso7H1AzP/qSzmlCKQ==", + "dev": true, + "requires": { + "@types/node": "*", + "pg-protocol": "*", + "pg-types": "^2.2.0" + } + }, "@types/prettier": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.4.2.tgz", @@ -37355,15 +37395,15 @@ "integrity": "sha1-daKo59irSyMEFFBdkjNdHctTpt8=" }, "@types/qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", - "integrity": "sha1-Y7t9Bn2xB8weRXwwO8JdUR/r9ss=", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ==", "dev": true }, "@types/range-parser": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", - "integrity": "sha1-zWZ7z90CUhOq+3ylkVqTJZCs3Nw=", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", "dev": true }, "@types/relateurl": { @@ -37400,6 +37440,16 @@ "@types/node": "*" } }, + "@types/send": { + "version": "0.17.5", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.5.tgz", + "integrity": "sha512-z6F2D3cOStZvuk2SaP6YrwkNO65iTZcwA2ZkSABegdkAh/lf+Aa/YQndZVfmEXT5vgAp6zv06VQ3ejSVjAny4w==", + "dev": true, + "requires": { + "@types/mime": "^1", + "@types/node": "*" + } + }, "@types/serve-static": { "version": "1.13.9", "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.9.tgz", diff --git a/package.json b/package.json index 465da3f..67d0c72 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,8 @@ "@nuxtjs/eslint-module": "^3.0.2", "@nuxtjs/stylelint-module": "^4.0.0", "@nuxtjs/tailwindcss": "^4.2.0", + "@types/express": "^5.0.3", + "@types/pg": "^8.15.5", "@vue/test-utils": "^1.2.1", "babel-core": "7.0.0-bridge.0", "babel-jest": "^27.0.5", diff --git a/vercel.json b/vercel.json index 03bca1a..a618bad 100644 --- a/vercel.json +++ b/vercel.json @@ -8,10 +8,10 @@ } ], "functions": { - "api/createLink.js": { + "api/createLink.ts": { "maxDuration": 50 }, - "api/getLink.js": { + "api/getLink.ts": { "maxDuration": 50 } } From af440c4d406936aee5aa99d28152516b98d0162e Mon Sep 17 00:00:00 2001 From: Nikhil Mehta Date: Mon, 15 Sep 2025 18:51:41 +0530 Subject: [PATCH 2/5] fix(api): fixed failing apis due to typescript issues added seperate package.json and tsconfig.json for api directory --- .gitignore | 1 + api/tsconfig.json | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 api/tsconfig.json diff --git a/.gitignore b/.gitignore index a222d1d..02b7873 100644 --- a/.gitignore +++ b/.gitignore @@ -91,3 +91,4 @@ sw.* # Vercel cli .vercel +.vercel_cache diff --git a/api/tsconfig.json b/api/tsconfig.json new file mode 100644 index 0000000..a192e88 --- /dev/null +++ b/api/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "ES2018", + "module": "ESNext", + "moduleResolution": "Node", + "lib": [ + "ESNext", + "ESNext.AsyncIterable", + ], + "esModuleInterop": true, + "allowJs": true, + "sourceMap": true, + "strict": true, + "noEmit": true, + "experimentalDecorators": true, + "baseUrl": ".", + "types": [ + "@types/node", + ] + }, + "exclude": [ + "node_modules", + "dist" + ] +} From fa8994fefe14bc9b63871fe3ae33ab8dd7837cd0 Mon Sep 17 00:00:00 2001 From: Nikhil Mehta Date: Mon, 15 Sep 2025 18:52:45 +0530 Subject: [PATCH 3/5] feat(driver.js): showing driverjs tutorial for e2e link --- helpers/driverjsTutorials.ts | 35 +++++++++++++++++++++++++--- helpers/isSkipCopyE2ELinkTutorial.ts | 16 +++++++++++++ helpers/types.ts | 1 + pages/v2/diff.vue | 6 +++-- pages/v2/index.vue | 2 +- plugins/cookie-injector.client.ts | 2 ++ 6 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 helpers/isSkipCopyE2ELinkTutorial.ts diff --git a/helpers/driverjsTutorials.ts b/helpers/driverjsTutorials.ts index cd3a8b8..78fe3e2 100644 --- a/helpers/driverjsTutorials.ts +++ b/helpers/driverjsTutorials.ts @@ -75,7 +75,17 @@ const copyLinkShortcutTutorial: Tutorial[] = [ }, ] -const diffTutorials: TutorialMetadata[] = [ +const CopyE2ELinkTutorial: Tutorial[] = [ + { + element: '#copyLinkButton', + popover: { + title: 'Copy E2E link', + description: 'Now links for large data comparison are end-to-end encrytpted automatically. Read more about it on github repo.', + }, + }, +] + +const diffV1Tutorials: TutorialMetadata[] = [ { tutorial: actionBarTutorial, cookieName: 'isSkipScrollInSyncTutorial', @@ -88,6 +98,25 @@ const diffTutorials: TutorialMetadata[] = [ tutorial: copyLinkShortcutTutorial, cookieName: 'isSkipCopyLinkShortcutTutorial', }, + { + tutorial: CopyE2ELinkTutorial, + cookieName: 'isSkipCopyE2ELinkTutorial', + } +] + +const diffV2Tutorials: TutorialMetadata[] = [ + { + tutorial: CopyE2ELinkTutorial, + cookieName: 'isSkipCopyE2ELinkTutorial', + }, + { + tutorial: backButtonTutorial, + cookieName: 'isSkipBackButtonPersistsDataTutorial', + }, + { + tutorial: copyLinkShortcutTutorial, + cookieName: 'isSkipCopyLinkShortcutTutorial', + }, ] const comparePageTutorials: TutorialMetadata[] = [ @@ -102,8 +131,8 @@ const comparePageTutorials: TutorialMetadata[] = [ ] const tutorialsMetadata: TutorialsMetadata = { - '/v1/diff': diffTutorials, - '/v2/diff': diffTutorials, + '/v1/diff': diffV1Tutorials, + '/v2/diff': diffV2Tutorials, '/': comparePageTutorials, '/v2': comparePageTutorials, } diff --git a/helpers/isSkipCopyE2ELinkTutorial.ts b/helpers/isSkipCopyE2ELinkTutorial.ts new file mode 100644 index 0000000..2f20ef2 --- /dev/null +++ b/helpers/isSkipCopyE2ELinkTutorial.ts @@ -0,0 +1,16 @@ +export default function () { + const cookies = document.cookie.split(';') + const cookieMap: { + isSkipCopyE2ELinkTutorial?: string + } = { + isSkipCopyE2ELinkTutorial: 'false', + } + cookies.forEach((element) => { + const [name, val] = element.split('=') + const trimmedName = name.trim() + if (trimmedName === 'isSkipCopyE2ELinkTutorial') { + cookieMap[trimmedName] = val + } + }) + return cookieMap.isSkipCopyE2ELinkTutorial === 'true' +} diff --git a/helpers/types.ts b/helpers/types.ts index c582252..134b3e1 100644 --- a/helpers/types.ts +++ b/helpers/types.ts @@ -5,6 +5,7 @@ export interface Cookies { isSkipBackButtonPersistsDataTutorial: boolean isSkipSubmitKbdShortcutTutorial: boolean isSkipCopyLinkShortcutTutorial: boolean + isSkipCopyE2ELinkTutorial: boolean } export interface Tutorial { diff --git a/pages/v2/diff.vue b/pages/v2/diff.vue index 085317f..11a83ee 100644 --- a/pages/v2/diff.vue +++ b/pages/v2/diff.vue @@ -79,6 +79,7 @@ import { E2E_DATA_LOADING_INFO, E2E_DATA_NO_LONGER_AVAILABLE_ERROR, } from '~/constants/messages' +import showTutorials from '~/helpers/driverjsTutorials' export default Vue.extend({ components: { DiffActionBar, Navbar, Footer }, layout: 'main', @@ -138,8 +139,8 @@ export default Vue.extend({ const url = new URL(window.location.href) const id = url.searchParams.get('id') const key = url.hash.replace(/^#/, '') - let response = null; - let data = null + let response = null + let data = null try { response = await fetch(`/api/getLink?id=${id}`) data = await response.json() @@ -200,6 +201,7 @@ export default Vue.extend({ ) } } + showTutorials(this.$cookies, this.$route.path, this.$cookies.isDarkMode) }) }, unzipCommitData(data: string) { diff --git a/pages/v2/index.vue b/pages/v2/index.vue index 20f2af9..15cd95f 100644 --- a/pages/v2/index.vue +++ b/pages/v2/index.vue @@ -144,7 +144,6 @@ export default Vue.extend({ }, }, mounted() { - showTutorials(this.$cookies, this.$route.path, this.$cookies.isDarkMode) document.addEventListener('keydown', this.handleCtrlEnter) // Hover on each property to see its docs! const lhs = document.getElementById('lhs') @@ -152,6 +151,7 @@ export default Vue.extend({ const theme = this.$cookies.isDarkMode ? 'vs-dark' : 'light' const monacoEditorOptions = getMonacoEditorDefaultOptions(theme) loader.init().then((monaco) => { + showTutorials(this.$cookies, this.$route.path, this.$cookies.isDarkMode) if (lhs) { this.lhsEditor = monaco.editor.create(lhs, { ...monacoEditorOptions, diff --git a/plugins/cookie-injector.client.ts b/plugins/cookie-injector.client.ts index d6cc637..ac7bb58 100644 --- a/plugins/cookie-injector.client.ts +++ b/plugins/cookie-injector.client.ts @@ -6,6 +6,7 @@ import isSkipBackButtonPersistsDataTutorial from '~/helpers/isSkipBackButtonPers import isSkipSubmitKbdShortcutTutorial from '~/helpers/isSkipSubmitKbdShortcutTutorial' import { Cookies } from '~/helpers/types' import isSkipCopyLinkShortcutTutorial from '~/helpers/isSkipCopyLinkShortcutTutorial' +import isSkipCopyE2ELinkTutorial from '~/helpers/isSkipCopyE2ELinkTutorial' declare module 'vue/types/vue' { interface Vue { @@ -40,6 +41,7 @@ const cookieInjectorPlugin: Plugin = (_context, inject) => { isSkipBackButtonPersistsDataTutorial(), isSkipSubmitKbdShortcutTutorial: isSkipSubmitKbdShortcutTutorial(), isSkipCopyLinkShortcutTutorial: isSkipCopyLinkShortcutTutorial(), + isSkipCopyE2ELinkTutorial: isSkipCopyE2ELinkTutorial(), }) } From 03a3ea67c2d746cd119831daab9d93f3e519caa1 Mon Sep 17 00:00:00 2001 From: Nikhil Mehta Date: Tue, 16 Sep 2025 17:21:36 +0530 Subject: [PATCH 4/5] chore(e2e): moved to neondb from filess.io Moving neondb for bigger freemium storage --- api/db/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/db/index.ts b/api/db/index.ts index 74d8365..adace39 100644 --- a/api/db/index.ts +++ b/api/db/index.ts @@ -12,10 +12,10 @@ export function getPool() { host: process.env.DB_HOST, database: process.env.DB_NAME, password: process.env.DB_PASSWORD, - port: parseInt(process.env.DB_PORT), max: 5, // Maximum number of connections in the pool idleTimeoutMillis: 30000, // Close idle connections after 30 seconds connectionTimeoutMillis: 2000, // How long to wait for a connection from the pool + ssl: true, }) } return pool From 040e6948708a978a7b36fc3385bec5b58fe51e6b Mon Sep 17 00:00:00 2001 From: Nikhil Mehta Date: Tue, 16 Sep 2025 17:23:50 +0530 Subject: [PATCH 5/5] fix(driver.js): removed unwanted tutorials on v2 page Removed the keyboard short cut tutorial on v2/index.ts page --- helpers/driverjsTutorials.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/helpers/driverjsTutorials.ts b/helpers/driverjsTutorials.ts index 78fe3e2..56e8a2b 100644 --- a/helpers/driverjsTutorials.ts +++ b/helpers/driverjsTutorials.ts @@ -1,4 +1,4 @@ -import { Cookies, Tutorial, TutorialsMetadata, TutorialMetadata } from './types' +import { Cookies, Tutorial, TutorialMetadata, TutorialsMetadata } from './types' // Need this to keep track of latest value of cookie otherwise users sees same tutorial untill they refresh the page after the cookie is dropped const _cookies: Partial = {} const labelsTutorial: Tutorial[] = [ @@ -119,7 +119,7 @@ const diffV2Tutorials: TutorialMetadata[] = [ }, ] -const comparePageTutorials: TutorialMetadata[] = [ +const comparePageV1Tutorials: TutorialMetadata[] = [ { tutorial: labelsTutorial, cookieName: 'isSkipTutorial', @@ -130,11 +130,18 @@ const comparePageTutorials: TutorialMetadata[] = [ }, ] +const comparePageV2Tutorials: TutorialMetadata[] = [ + { + tutorial: labelsTutorial, + cookieName: 'isSkipTutorial', + }, +] + const tutorialsMetadata: TutorialsMetadata = { '/v1/diff': diffV1Tutorials, '/v2/diff': diffV2Tutorials, - '/': comparePageTutorials, - '/v2': comparePageTutorials, + '/': comparePageV1Tutorials, + '/v2': comparePageV2Tutorials, } export default async function showTutorials(