Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
"changelog": [
"@changesets/changelog-github",
{ "repo": "vercel-labs/chatbot" }
],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
43 changes: 43 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Contributing

Thanks for your interest in contributing to the chatbot template! Here's how to get started.

## Development

1. Fork and clone the repository
2. Install dependencies with `pnpm install`
3. Create a new branch from `demo` for your work

## Changesets

This project uses [Changesets](https://github.com/changesets/changesets) to manage versioning and releases. When you make a change that should be included in the next release, you need to add a changeset.

### Adding a changeset

Run the following command from the root of the repository:

```bash
pnpm changeset
```

You'll be prompted to:

1. **Select the bump type** — `patch` for bug fixes, `minor` for new features, `major` for breaking changes
2. **Write a summary** — a short description of your change that will appear in the changelog

This creates a Markdown file in the `.changeset` directory. Commit this file along with your code changes.

### When to add a changeset

- Bug fixes, new features, breaking changes, dependency updates, and other user-facing changes should include a changeset
- Internal refactors, test-only changes, and documentation updates typically don't need one

### What happens next

When your changes land on `main`, the release workflow picks up any changeset files and opens a "Version Package" PR. Merging that PR bumps the version, updates the changelog, and creates a GitHub Release.

## Pull requests

- Open PRs against the `demo` branch
- Include a changeset if your change affects the release
- Keep PRs focused — one feature or fix per PR
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ jobs:
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Run lint
run: pnpm lint
- name: Run check
run: pnpm check
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
contents: write
pull-requests: write

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Create Release Pull Request or Tag
id: changesets
uses: changesets/action@v1
with:
title: 'chore: version package'
commit: 'chore: version package'
version: pnpm version
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create GitHub Release
if: steps.changesets.outputs.published == 'true'
uses: actions/github-script@v7
env:
PUBLISHED_PACKAGES: ${{ steps.changesets.outputs.publishedPackages }}
with:
script: |
const packages = JSON.parse(process.env.PUBLISHED_PACKAGES);
for (const pkg of packages) {
const tag = `v${pkg.version}`;
await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: tag,
name: tag,
generate_release_notes: true,
});
}
6 changes: 3 additions & 3 deletions components/multimodal-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,10 @@ function PureMultimodalInput({
if (!input.trim() && attachments.length === 0) {
return;
}
if (status !== "ready") {
toast.error("Please wait for the model to finish its response!");
} else {
if (status === "ready") {
submitForm();
} else {
toast.error("Please wait for the model to finish its response!");
}
}}
>
Expand Down
6 changes: 3 additions & 3 deletions components/toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ const Tool = ({
return;
}

if (selectedTool !== description) {
setSelectedTool(description);
} else {
if (selectedTool === description) {
setSelectedTool(null);
onClick({ sendMessage });
} else {
setSelectedTool(description);
}
};

Expand Down
2 changes: 1 addition & 1 deletion lib/editor/diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export const patchTextNodes = (schema, oldNode, newNode) => {
const node = createTextNode(
schema,
sentence,
type !== DiffType.Unchanged ? [createDiffMark(schema, type)] : []
type === DiffType.Unchanged ? [] : [createDiffMark(schema, type)]
);
return node;
});
Expand Down
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@
"dev": "next dev --turbo",
"build": "tsx lib/db/migrate && next build",
"start": "next start",
"lint": "ultracite check",
"format": "ultracite fix",
"check": "ultracite check",
"fix": "ultracite fix",
"db:generate": "drizzle-kit generate",
"db:migrate": "npx tsx lib/db/migrate.ts",
"db:studio": "drizzle-kit studio",
"db:push": "drizzle-kit push",
"db:pull": "drizzle-kit pull",
"db:check": "drizzle-kit check",
"db:up": "drizzle-kit up",
"test": "export PLAYWRIGHT=True && pnpm exec playwright test"
"test": "export PLAYWRIGHT=True && pnpm exec playwright test",
"changeset": "changeset",
"version": "changeset version",
"release": "changeset tag"
},
"dependencies": {
"@ai-sdk/gateway": "^3.0.15",
Expand Down Expand Up @@ -102,6 +105,8 @@
},
"devDependencies": {
"@biomejs/biome": "2.3.11",
"@changesets/changelog-github": "^0.6.0",
"@changesets/cli": "^2.30.0",
"@playwright/test": "^1.50.1",
"@tailwindcss/postcss": "^4.1.13",
"@tailwindcss/typography": "^0.5.15",
Expand Down
Loading
Loading