2
0

🐛 (embed) Make sure env.ts is not bundled in js embed lib

This commit is contained in:
Baptiste Arnaud
2023-08-29 14:52:44 +02:00
parent 5b20f414c8
commit da4005e160
19 changed files with 1813 additions and 68 deletions

View File

@ -14,7 +14,8 @@ import {
} from '@typebot.io/schemas'
import { Log } from '@typebot.io/prisma'
import { LiteBadge } from './LiteBadge'
import { getViewerUrl, isEmpty, isNotEmpty } from '@typebot.io/lib'
import { isNotEmpty } from '@typebot.io/lib'
import { getViewerUrl } from '@typebot.io/lib/getViewerUrl'
export type TypebotViewerProps = {
typebot: Omit<PublicTypebot, 'updatedAt' | 'createdAt'>

View File

@ -1,6 +1,6 @@
{
"name": "@typebot.io/js",
"version": "0.1.21",
"version": "0.1.22",
"description": "Javascript library to display typebots on your website",
"type": "module",
"main": "dist/index.js",

View File

@ -1,6 +1,6 @@
{
"name": "@typebot.io/nextjs",
"version": "0.1.21",
"version": "0.1.22",
"description": "Convenient library to display typebots on your Next.js website",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@ -1,6 +1,6 @@
{
"name": "@typebot.io/react",
"version": "0.1.21",
"version": "0.1.22",
"description": "Convenient library to display typebots on your React app",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@ -0,0 +1,4 @@
import { env } from '@typebot.io/env'
export const getViewerUrl = () =>
env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ?? env.NEXT_PUBLIC_VIEWER_URL[0]

View File

@ -1,6 +1,5 @@
import got from 'got'
import { TelemetryEvent } from '@typebot.io/schemas/features/telemetry'
import { isNotEmpty } from '../utils'
import { env } from '@typebot.io/env'
export const sendTelemetryEvents = async (events: TelemetryEvent[]) => {

View File

@ -19,7 +19,6 @@ import { BubbleBlockType } from '@typebot.io/schemas/features/blocks/bubbles/enu
import { LogicBlockType } from '@typebot.io/schemas/features/blocks/logic/enums'
import { IntegrationBlockType } from '@typebot.io/schemas/features/blocks/integrations/enums'
import { PictureChoiceBlock } from '@typebot.io/schemas/features/blocks/inputs/pictureChoice'
import { env } from '@typebot.io/env'
export const sendRequest = async <ResponseData>(
params:
@ -257,9 +256,6 @@ export const hasValue = (
value !== 'undefined' &&
value !== 'null'
export const getViewerUrl = () =>
env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ?? env.NEXT_PUBLIC_VIEWER_URL[0]
export const parseNumberWithCommas = (num: number) =>
num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')