2
0

build: upgrade packages

This commit is contained in:
Baptiste Arnaud
2022-08-21 22:33:09 +02:00
parent 93161b74b2
commit 59281426b0
23 changed files with 2341 additions and 1063 deletions

View File

@ -13,7 +13,7 @@
},
"dependencies": {
"@chakra-ui/css-reset": "2.0.3",
"@chakra-ui/react": "^2.2.6",
"@chakra-ui/react": "^2.2.8",
"@codemirror/lang-css": "^6.0.0",
"@codemirror/lang-html": "^6.1.0",
"@codemirror/lang-javascript": "^6.0.2",
@ -27,19 +27,19 @@
"@emotion/styled": "^11.10.0",
"@giphy/js-fetch-api": "4.4.0",
"@giphy/js-types": "^4.2.1",
"@giphy/react-components": "6.0.0",
"@giphy/react-components": "6.1.1",
"@googleapis/drive": "^3.0.1",
"@sentry/nextjs": "7.9.0",
"@sentry/nextjs": "7.11.1",
"@stripe/stripe-js": "1.35.0",
"@tanstack/react-table": "8.5.11",
"@udecode/plate-basic-marks": "16.0.0",
"@udecode/plate-basic-marks": "16.3.0",
"@udecode/plate-common": "^7.0.2",
"@udecode/plate-core": "16.0.0",
"@udecode/plate-link": "16.0.0",
"@udecode/plate-serializer-html": "16.0.0",
"@udecode/plate-ui-link": "16.0.0",
"@udecode/plate-ui-toolbar": "16.0.0",
"aws-sdk": "2.1189.0",
"@udecode/plate-core": "16.3.0",
"@udecode/plate-link": "16.3.0",
"@udecode/plate-serializer-html": "16.3.0",
"@udecode/plate-ui-link": "16.3.0",
"@udecode/plate-ui-toolbar": "16.3.0",
"aws-sdk": "2.1199.0",
"bot-engine": "workspace:*",
"browser-image-compression": "^2.0.0",
"canvas-confetti": "^1.5.1",
@ -49,8 +49,8 @@
"dequal": "^2.0.3",
"emojilib": "3.0.7",
"focus-visible": "^5.2.0",
"framer-motion": "7.0.0",
"google-auth-library": "^8.1.1",
"framer-motion": "7.2.0",
"google-auth-library": "^8.3.0",
"google-spreadsheet": "^3.3.0",
"got": "12.3.1",
"htmlparser2": "^8.0.1",
@ -61,9 +61,9 @@
"micro": "9.4.1",
"micro-cors": "^0.1.1",
"minio": "7.0.30",
"next": "12.2.4",
"next": "12.2.5",
"next-auth": "4.10.3",
"nodemailer": "^6.7.7",
"nodemailer": "^6.7.8",
"nprogress": "^0.2.0",
"papaparse": "^5.3.2",
"prettier": "2.7.1",
@ -75,7 +75,7 @@
"slate-history": "^0.66.0",
"slate-hyperscript": "^0.77.0",
"slate-react": "0.82.0",
"stripe": "10.0.0",
"stripe": "10.3.0",
"styled-components": "^5.3.5",
"svg-round-corners": "^0.3.0",
"swr": "^1.3.0",
@ -85,13 +85,14 @@
},
"devDependencies": {
"@babel/core": "7.18.10",
"@chakra-ui/styled-system": "^2.2.7",
"@playwright/test": "1.25.0",
"@types/canvas-confetti": "^1.4.3",
"@types/google-spreadsheet": "^3.3.0",
"@types/jsonwebtoken": "8.5.8",
"@types/micro-cors": "^0.1.2",
"@types/minio": "^7.0.13",
"@types/node": "18.6.5",
"@types/node": "18.7.8",
"@types/nodemailer": "6.4.5",
"@types/nprogress": "^0.2.0",
"@types/papaparse": "5.3.3",
@ -100,12 +101,12 @@
"@types/react": "^18.0.17",
"@types/react-table": "^7.7.12",
"@types/tinycolor2": "^1.4.3",
"@typescript-eslint/eslint-plugin": "5.33.0",
"@typescript-eslint/parser": "5.33.0",
"@typescript-eslint/eslint-plugin": "5.33.1",
"@typescript-eslint/parser": "5.33.1",
"db": "workspace:*",
"dotenv": "^16.0.1",
"eslint": "8.21.0",
"eslint-config-next": "12.2.4",
"eslint": "8.22.0",
"eslint-config-next": "12.2.5",
"eslint-plugin-react": "^7.30.1",
"models": "workspace:*",
"typescript": "^4.7.4",

View File

@ -16,7 +16,8 @@ test.describe('Send email block', () => {
!process.env.SMTP_PORT ||
!process.env.SMTP_SECURE ||
!process.env.SMTP_HOST ||
!process.env.SMTP_PASSWORD
!process.env.SMTP_PASSWORD ||
!process.env.SMTP_FROM
)
throw new Error('SMTP_ env vars are missing')
await importTypebotInDatabase(
@ -31,9 +32,7 @@ test.describe('Send email block', () => {
await page.goto(`/typebots/${typebotId}/edit`)
await page.click('text=Configure...')
await page.click(
`text=${process.env.NEXT_PUBLIC_SMTP_FROM?.match(/\<(.*)\>/)?.pop()}`
)
await page.click(`text=${process.env.SMTP_FROM}`)
await page.click('text=Connect new')
const createButton = page.locator('button >> text=Create')
await expect(createButton).toBeDisabled()

View File

@ -26,6 +26,9 @@ test.describe.parallel('Theme page', () => {
}
)
await page.goto(`/typebots/${typebotId}/theme`)
await expect(
typebotViewer(page).locator('button >> text="Go"')
).toBeVisible()
await page.click('button:has-text("General")')
// Font
@ -60,6 +63,9 @@ test.describe.parallel('Theme page', () => {
} catch {}
await page.goto(`/typebots/${typebotId}/theme`)
await expect(
typebotViewer(page).locator('button >> text="Go"')
).toBeVisible()
await page.click('button:has-text("Chat")')
// Host avatar
@ -175,6 +181,9 @@ test.describe.parallel('Theme page', () => {
}
)
await page.goto(`/typebots/${typebotId}/theme`)
await expect(
typebotViewer(page).locator('button >> text="Go"')
).toBeVisible()
await page.click('button:has-text("Custom CSS")')
await page.fill(
'div[role="textbox"]',

View File

@ -8,30 +8,30 @@
"analyze": "cross-env ANALYZE=true next build"
},
"dependencies": {
"@chakra-ui/icon": "^3.0.6",
"@chakra-ui/react": "2.2.6",
"@chakra-ui/icon": "^3.0.8",
"@chakra-ui/react": "2.2.8",
"@emotion/react": "11.10.0",
"@emotion/styled": "11.10.0",
"aos": "^2.3.4",
"bot-engine": "*",
"focus-visible": "^5.2.0",
"framer-motion": "7.0.0",
"framer-motion": "7.2.0",
"models": "*",
"next": "12.2.4",
"next": "12.2.5",
"react": "18.2.0",
"react-dom": "18.2.0",
"utils": "*"
},
"devDependencies": {
"@babel/core": "7.18.10",
"@chakra-ui/styled-system": "^2.2.5",
"@next/bundle-analyzer": "12.2.4",
"@chakra-ui/styled-system": "^2.2.7",
"@next/bundle-analyzer": "12.2.5",
"@types/aos": "^3.0.4",
"@types/node": "18.6.5",
"@types/node": "18.7.8",
"@types/react": "^18.0.17",
"autoprefixer": "10.4.8",
"cross-env": "^7.0.3",
"eslint": "8.21.0",
"eslint": "8.22.0",
"postcss": "8.4.16",
"prettier": "2.7.1",
"typescript": "^4.7.4"

View File

@ -12,38 +12,39 @@
"test:open": "PWDEBUG=1 pnpm playwright test"
},
"dependencies": {
"@sentry/nextjs": "7.9.0",
"aws-sdk": "2.1190.0",
"@sentry/nextjs": "7.11.1",
"aws-sdk": "2.1199.0",
"bot-engine": "*",
"cors": "^2.8.5",
"cuid": "^2.1.8",
"db": "workspace:*",
"google-spreadsheet": "^3.3.0",
"got": "12.3.1",
"next": "12.2.4",
"nodemailer": "^6.7.7",
"next": "12.2.5",
"nodemailer": "^6.7.8",
"qs": "^6.11.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sanitize-html": "^2.7.1",
"stripe": "10.0.0"
"stripe": "10.3.0"
},
"devDependencies": {
"@types/papaparse": "5.3.3",
"@babel/preset-env": "^7.18.10",
"@playwright/test": "1.25.0",
"eslint-plugin-react": "^7.30.1",
"@types/cors": "^2.8.12",
"@types/google-spreadsheet": "^3.3.0",
"@types/node": "18.6.5",
"@types/node": "18.7.8",
"@types/nodemailer": "6.4.5",
"@types/papaparse": "5.3.3",
"@types/qs": "^6.9.7",
"@types/react": "^18.0.17",
"@types/sanitize-html": "2.6.2",
"@typescript-eslint/eslint-plugin": "5.33.0",
"@typescript-eslint/parser": "5.33.0",
"eslint": "8.21.0",
"eslint-config-next": "12.2.4",
"google-auth-library": "^8.1.1",
"@typescript-eslint/parser": "5.33.1",
"eslint": "8.22.0",
"eslint-config-next": "12.2.5",
"eslint-plugin-react": "^7.30.1",
"google-auth-library": "^8.3.0",
"models": "workspace:*",
"next-transpile-modules": "^9.0.0",
"papaparse": "^5.3.2",

View File

@ -2,7 +2,9 @@ import { devices, PlaywrightTestConfig } from '@playwright/test'
import path from 'path'
// eslint-disable-next-line @typescript-eslint/no-var-requires
require('dotenv').config({ path: path.join(__dirname, '.env.local') })
require('dotenv').config({
path: path.join(__dirname, 'playwright/.env'),
})
const config: PlaywrightTestConfig = {
globalSetup: require.resolve(path.join(__dirname, 'playwright/global-setup')),
@ -11,14 +13,13 @@ const config: PlaywrightTestConfig = {
expect: {
timeout: 5000,
},
retries: process.env.NO_RETRIES ? 0 : 2,
retries: process.env.NO_RETRIES ? 0 : 1,
workers: process.env.CI ? 1 : 3,
reporter: 'html',
maxFailures: process.env.CI ? 10 : undefined,
use: {
actionTimeout: 0,
baseURL: process.env.NEXT_PUBLIC_VIEWER_URL,
storageState: path.join(__dirname, 'playwright/proUser.json'),
baseURL: process.env.VIEWER_URL,
trace: 'on-first-retry',
video: 'retain-on-failure',
locale: 'en-US',

View File

@ -0,0 +1,4 @@
VIEWER_URL=http://localhost:3001
BUILDER_URL=http://localhost:3000
DATABASE_URL=postgresql://postgres:typebot@localhost:5432/typebot
ENCRYPTION_SECRET=SgVkYp2s5v8y/B?E(H+MbQeThWmZq4t6 #256-bits secret (can be generated here: https://www.allkeysgenerator.com/Random/Security-Encryption-Key-Generator.aspx)

View File

@ -1,18 +0,0 @@
{
"cookies": [],
"origins": [
{
"origin": "http://localhost:3000",
"localStorage": [
{
"name": "authenticatedUser",
"value": "{\"id\":\"proUser\",\"name\":\"Pro user\",\"email\":\"pro-user@email.com\",\"emailVerified\":null,\"image\":\"https://avatars.githubusercontent.com/u/16015833?v=4\",\"plan\":\"PRO\",\"stripeId\":null}"
},
{
"name": "typebot-20-modal",
"value": "hide"
}
]
}
]
}

View File

@ -0,0 +1,12 @@
import { Page } from '@playwright/test'
export const mockSessionApiCalls = (page: Page) =>
page.route(`${process.env.BUILDER_URL}/api/auth/session`, (route) => {
if (route.request().method() === 'GET') {
return route.fulfill({
status: 200,
body: '{"user":{"id":"proUser","name":"Pro user","email":"pro-user@email.com","emailVerified":null,"image":"https://avatars.githubusercontent.com/u/16015833?v=4","stripeId":null,"graphNavigation": "TRACKPAD"}}',
})
}
return route.continue()
})

View File

@ -6,6 +6,9 @@ import { typebotViewer } from '../services/selectorUtils'
import { importTypebotInDatabase } from '../services/database'
import { readFileSync } from 'fs'
import { isDefined } from 'utils'
import { mockSessionApiCalls } from 'playwright/services/browser'
test.beforeEach(({ page }) => mockSessionApiCalls(page))
test('should work as expected', async ({ page, browser }) => {
const typebotId = cuid()
@ -26,7 +29,7 @@ test('should work as expected', async ({ page, browser }) => {
await expect(
typebotViewer(page).locator(`text="3 files uploaded"`)
).toBeVisible()
await page.goto(`http://localhost:3000/typebots/${typebotId}/results`)
await page.goto(`${process.env.BUILDER_URL}/typebots/${typebotId}/results`)
await expect(page.locator('text="api.json"')).toHaveAttribute(
'href',
/.+\/api\.json/

View File

@ -3,6 +3,9 @@ import path from 'path'
import { importTypebotInDatabase } from '../services/database'
import { typebotViewer } from '../services/selectorUtils'
import cuid from 'cuid'
import { mockSessionApiCalls } from 'playwright/services/browser'
test.beforeEach(({ page }) => mockSessionApiCalls(page))
test('should work as expected', async ({ page }) => {
const typebotId = cuid()
@ -16,7 +19,7 @@ test('should work as expected', async ({ page }) => {
await typebotViewer(page).locator('input').fill('26')
await typebotViewer(page).locator('input').press('Enter')
await typebotViewer(page).locator('button >> text=Yes').click()
await page.goto(`http://localhost:3000/typebots/${typebotId}/results`)
await page.goto(`${process.env.BUILDER_URL}/typebots/${typebotId}/results`)
await expect(page.locator('text="Baptiste"')).toBeVisible()
await expect(page.locator('text="26"')).toBeVisible()
await expect(page.locator('text="Yes"')).toBeVisible()

View File

@ -11,6 +11,9 @@ import {
} from 'models'
import { typebotViewer } from '../services/selectorUtils'
import cuid from 'cuid'
import { mockSessionApiCalls } from 'playwright/services/browser'
test.beforeEach(({ page }) => mockSessionApiCalls(page))
test('Should correctly parse metadata', async ({ page }) => {
const typebotId = cuid()

View File

@ -3,6 +3,9 @@ import { importTypebotInDatabase } from '../services/database'
import cuid from 'cuid'
import path from 'path'
import { typebotViewer } from '../services/selectorUtils'
import { mockSessionApiCalls } from 'playwright/services/browser'
test.beforeEach(({ page }) => mockSessionApiCalls(page))
test('should correctly be injected', async ({ page }) => {
const typebotId = cuid()

View File

@ -7,17 +7,20 @@ import cuid from 'cuid'
import path from 'path'
import { typebotViewer } from '../services/selectorUtils'
import { SmtpCredentialsData } from 'models'
import { mockSessionApiCalls } from 'playwright/services/browser'
test.beforeEach(({ page }) => mockSessionApiCalls(page))
const mockSmtpCredentials: SmtpCredentialsData = {
from: {
email: 'tobin.tillman65@ethereal.email',
name: 'John Smith',
email: 'kimberly.boyer36@ethereal.email',
name: 'Kimberly Boyer',
},
host: 'smtp.ethereal.email',
port: 587,
isTlsEnabled: false,
username: 'tobin.tillman65@ethereal.email',
password: 'Ty9BcwCBrK6w8AG2hx',
isTlsEnabled: true,
username: 'kimberly.boyer36@ethereal.email',
password: '4jvjGUgxYKRjbk15tW',
}
test('should send an email', async ({ page }) => {
@ -36,13 +39,13 @@ test('should send an email', async ({ page }) => {
const { previewUrl } = await response.json()
await page.goto(previewUrl)
await expect(page.locator('text="Hey!"')).toBeVisible()
await expect(page.locator('text="John Smith"')).toBeVisible()
await expect(page.locator('text="Kimberly Boyer"')).toBeVisible()
await expect(page.locator('text="<test1@gmail.com>" >> nth=0')).toBeVisible()
await expect(page.locator('text="<test2@gmail.com>" >> nth=0')).toBeVisible()
await expect(
page.locator('text="<baptiste.arnaud95@gmail.com>" >> nth=0')
).toBeVisible()
await page.goto(`http://localhost:3000/typebots/${typebotId}/results`)
await page.goto(`${process.env.BUILDER_URL}/typebots/${typebotId}/results`)
await page.click('text="See logs"')
await expect(page.locator('text="Email successfully sent"')).toBeVisible()
})

View File

@ -10,6 +10,9 @@ import {
defaultTextInputOptions,
InputBlockType,
} from 'models'
import { mockSessionApiCalls } from 'playwright/services/browser'
test.beforeEach(({ page }) => mockSessionApiCalls(page))
test('Result should be in storage by default', async ({ page }) => {
const typebotId = cuid()

View File

@ -2,6 +2,9 @@ import test, { expect } from '@playwright/test'
import path from 'path'
import { importTypebotInDatabase } from '../services/database'
import { typebotViewer } from '../services/selectorUtils'
import { mockSessionApiCalls } from 'playwright/services/browser'
test.beforeEach(({ page }) => mockSessionApiCalls(page))
test('should work as expected', async ({ page }) => {
const typebotId = 'cl0ibhi7s0018n21aarlmg0cm'
@ -24,6 +27,6 @@ test('should work as expected', async ({ page }) => {
resp.status() === 200 &&
resp.request().method() === 'PUT'
)
await page.goto(`http://localhost:3000/typebots/${typebotId}/results`)
await page.goto(`${process.env.BUILDER_URL}/typebots/${typebotId}/results`)
await expect(page.locator('text=Hello there!')).toBeVisible()
})

View File

@ -4,6 +4,9 @@ import cuid from 'cuid'
import path from 'path'
import { typebotViewer } from '../services/selectorUtils'
import { HttpMethod } from 'models'
import { mockSessionApiCalls } from 'playwright/services/browser'
test.beforeEach(({ page }) => mockSessionApiCalls(page))
test('should execute webhooks properly', async ({ page }) => {
const typebotId = cuid()

View File

@ -11,7 +11,7 @@
"prop-types": "^15.8.1",
"qs": "^6.11.0",
"react-frame-component": "5.2.3",
"react-phone-number-input": "3.2.6",
"react-phone-number-input": "3.2.8",
"react-scroll": "^1.8.7",
"react-transition-group": "4.4.5",
"resize-observer": "^1.0.4"
@ -27,11 +27,11 @@
"@types/react-scroll": "^1.8.4",
"@types/react-transition-group": "^4.4.5",
"@typescript-eslint/eslint-plugin": "5.33.0",
"@typescript-eslint/parser": "5.33.0",
"@typescript-eslint/parser": "5.33.1",
"autoprefixer": "10.4.8",
"db": "workspace:*",
"eslint": "8.21.0",
"eslint-config-next": "12.2.4",
"eslint": "8.22.0",
"eslint-config-next": "12.2.5",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "7.30.1",
@ -40,7 +40,7 @@
"prettier": "2.7.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup": "2.77.2",
"rollup": "2.78.1",
"rollup-plugin-dts": "^4.2.2",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^4.0.2",

View File

@ -5,12 +5,12 @@
"main": "./index.ts",
"types": "./index.ts",
"devDependencies": {
"prisma": "4.1.1",
"prisma": "4.2.1",
"typescript": "^4.7.4",
"dotenv-cli": "6.0.0"
},
"dependencies": {
"@prisma/client": "4.1.1"
"@prisma/client": "4.2.1"
},
"scripts": {
"dx": "dotenv -e ../../apps/builder/.env.local prisma db push && pnpm generate:schema && pnpm start:sutdio ",

View File

@ -11,14 +11,14 @@
"@rollup/plugin-commonjs": "22.0.2",
"@rollup/plugin-node-resolve": "^13.3.0",
"@rollup/plugin-typescript": "8.3.4",
"rollup": "2.77.2",
"rollup": "2.78.1",
"rollup-plugin-dts": "^4.2.2",
"rollup-plugin-peer-deps-external": "^2.2.4",
"next": "12.2.4",
"next": "12.2.5",
"db": "workspace:*"
},
"dependencies": {
"zod": "^3.17.10"
"zod": "^3.18.0"
},
"peerDependencies": {
"next": "^12.0.0",

View File

@ -11,19 +11,19 @@
},
"devDependencies": {
"@rollup/plugin-typescript": "8.3.4",
"@types/jest": "^28.1.6",
"@types/jest": "^28.1.7",
"@typescript-eslint/eslint-plugin": "5.32.0",
"@typescript-eslint/parser": "5.32.0",
"eslint": "8.21.0",
"@typescript-eslint/parser": "5.33.1",
"eslint": "8.22.0",
"eslint-plugin-functional": "^4.2.2",
"eslint-plugin-jest": "26.7.0",
"eslint-plugin-jest": "26.8.5",
"eslint-plugin-prettier": "^4.2.1",
"jest": "^28.1.3",
"prettier": "2.7.1",
"rollup": "2.77.2",
"rollup": "2.78.1",
"rollup-plugin-styles": "^4.0.0",
"rollup-plugin-terser": "^7.0.2",
"ts-jest": "^28.0.7",
"ts-jest": "^28.0.8",
"tslib": "^2.4.0",
"typescript": "^4.7.4"
},

View File

@ -10,14 +10,14 @@
"@rollup/plugin-commonjs": "22.0.2",
"@rollup/plugin-node-resolve": "^13.3.0",
"@rollup/plugin-typescript": "8.3.4",
"rollup": "2.77.2",
"rollup": "2.78.1",
"rollup-plugin-dts": "^4.2.2",
"rollup-plugin-peer-deps-external": "^2.2.4",
"tslib": "^2.4.0",
"typescript": "^4.7.4",
"aws-sdk": "2.1190.0",
"aws-sdk": "2.1199.0",
"models": "workspace:*",
"next": "12.2.4"
"next": "12.2.5"
},
"peerDependencies": {
"aws-sdk": "^2.1152.0",

3181
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff