Skip to content

Commit

Permalink
👷 Revert to using js lib as peer dep for proper types resolving
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Oct 19, 2024
1 parent c6e8594 commit 569b19c
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { CodeEditor } from "@/components/inputs/CodeEditor";
export const InstallNextjsPackageSnippet = () => {
return (
<CodeEditor
value={`npm install @typebot.io/nextjs`}
value={`npm install @typebot.io/js @typebot.io/nextjs`}
isReadOnly
lang="shell"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { CodeEditor } from "@/components/inputs/CodeEditor";
export const InstallReactPackageSnippet = () => {
return (
<CodeEditor
value={`npm install @typebot.io/react`}
value={`npm install @typebot.io/js @typebot.io/react`}
isReadOnly
lang="shell"
/>
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/deploy/web/libraries/next-js.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This lib is a convenient wrapper around the [Typebot React](./react) library. It
## Install

```bash
npm install @typebot.io/nextjs
npm install @typebot.io/js @typebot.io/nextjs
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/deploy/web/libraries/react.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: React
## Install

```bash
npm install @typebot.io/react
npm install @typebot.io/js @typebot.io/react
```

## Standard
Expand Down
2 changes: 1 addition & 1 deletion apps/landing-page/src/app/blog/react-chatbot/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Typebot is an open-source platform that makes it easy to create chatbots for Rea
4. In your React project, install **Typebot libraries**:

```bash
npm install @typebot.io/react
npm install @typebot.io/js @typebot.io/react
```

5. Create a new component in your React app:
Expand Down
2 changes: 1 addition & 1 deletion packages/embeds/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/js",
"version": "0.3.22",
"version": "0.3.23",
"description": "Javascript library to display typebots on your website",
"license": "FSL-1.1-ALv2",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/embeds/nextjs/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Install

```bash
npm install @typebot.io/nextjs
npm install @typebot.io/js @typebot.io/nextjs
```

## Standard
Expand Down
8 changes: 6 additions & 2 deletions packages/embeds/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/nextjs",
"version": "0.3.22",
"version": "0.3.23",
"license": "FSL-1.1-ALv2",
"description": "Convenient library to display typebots on your Next.js website",
"type": "module",
Expand All @@ -16,6 +16,9 @@
"dev": "tsup --watch",
"build": "tsup"
},
"dependencies": {
"@typebot.io/js": "workspace:*"
},
"devDependencies": {
"@typebot.io/tsconfig": "workspace:*",
"@types/react": "18.2.15",
Expand All @@ -26,7 +29,8 @@
},
"peerDependencies": {
"react": "^16.0.0 || ^17.0.0 || ^18.0.0",
"next": "12.x || 13.x || 14.x"
"next": "12.x || 13.x || 14.x",
"@typebot.io/js": "0.3.22"
},
"publishConfig": {
"access": "public"
Expand Down
11 changes: 10 additions & 1 deletion packages/embeds/nextjs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,13 @@ export const Popup = dynamic(
},
);

export type * from "@typebot.io/js";
export {
unmount,
toggle,
showPreviewMessage,
setInputValue,
setPrefilledVariables,
open,
hidePreviewMessage,
close,
} from "@typebot.io/js";
1 change: 0 additions & 1 deletion packages/embeds/nextjs/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ export default defineConfig(() => ({
banner: {
js: '"use client"',
},
external: process.env.CI ? undefined : ["@typebot.io/js"],
}));
2 changes: 1 addition & 1 deletion packages/embeds/react/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Install

```bash
npm install @typebot.io/react
npm install @typebot.io/js @typebot.io/react
```

## Standard
Expand Down
11 changes: 7 additions & 4 deletions packages/embeds/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/react",
"version": "0.3.22",
"version": "0.3.23",
"description": "Convenient library to display typebots on your React app",
"license": "FSL-1.1-ALv2",
"type": "module",
Expand All @@ -16,15 +16,18 @@
"dev": "tsup --watch",
"build": "tsup"
},
"dependencies": {
"@typebot.io/js": "workspace:*"
},
"devDependencies": {
"@typebot.io/tsconfig": "workspace:*",
"@types/react": "18.2.15",
"tsup": "8.3.0",
"react": "18.2.0",
"@typebot.io/js": "workspace:*"
"react": "18.2.0"
},
"peerDependencies": {
"react": "^16.0.0 || ^17.0.0 || ^18.0.0"
"react": "^16.0.0 || ^17.0.0 || ^18.0.0",
"@typebot.io/js": "0.3.22"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/embeds/react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ export { Standard } from "./Standard";
export { Bubble } from "./Bubble";
export { Popup } from "./Popup";

export type * from "@typebot.io/js";
export * from "@typebot.io/js";
1 change: 0 additions & 1 deletion packages/embeds/react/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ export default defineConfig((options) => ({
format: "esm",
platform: "browser",
dts: true,
external: process.env.CI ? undefined : ["@typebot.io/js"],
}));

0 comments on commit 569b19c

Please sign in to comment.