Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.
Open
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
31 changes: 21 additions & 10 deletions web/publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This document outlines the steps to publish the `@sourcegraph/cody-web` package.

## Prerequisites

- Access to publish to the @sourcegraph organization on npm.
- `pnpm login` using credentials from [1pass](https://start.1password.com/open/i?a=HEDEDSLHPBFGRBTKAKJWE23XX4&v=dnrhbauihkhjs5ag6vszsme45a&i=oye4u4faaxmxxesugzqxojr4q4&h=team-sourcegraph.1password.com).

Expand All @@ -26,49 +27,56 @@ This document outlines the steps to publish the `@sourcegraph/cody-web` package.
Before publishing, it's important to test the package locally within the Sourcegraph client:

1. Build the package:

```bash
cd cody/web
pnpm build
```

2. Create a global link for local testing:

```bash
pnpm link --global
```

3. In the Sourcegraph repository:

```bash
cd sourcegraph
cd client/web-sveltekit/ && pnpm link @sourcegraph/cody-web --global && cd ../web && pnpm link @sourcegraph/cody-web --global && cd ../../
```

4. Add the following configuration to `sg.config.overwrite.yaml`:

```yaml
commands:
web-standalone-http:
install: |
pnpm run generate
web-sveltekit-server:
install: |
pnpm run generate
web-standalone-http:
install: |
pnpm run generate
web-sveltekit-server:
install: |
pnpm run generate
```

5. Run Sourcegraph locally to test:

```bash
sg start web-standalone
```

6. If you encounter login issues with web-standalone, try the following:
- Manually comment out the `pnpm install` commands in the `sg.config.yaml` file
- Then run `sg start` directly

- Temporarily comment out the `pnpm install` commands in the `sg.config.yaml` file.
- Then run `sg start` directly.

7. Verify that the package works as expected in the Sourcegraph client:
- Go to code search and verify all Cody components are working correctly (prompt interface, model selector, etc.)
- Test Cody with a file to ensure it works properly
- Go to Cody Chat and verify all Cody components are working correctly (prompt interface, model selector, etc.)
- Test Cody in the blob view sidebar.

## Step 3: Commit Changes in Cody Repository

1. Create a commit with the version bump:

```bash
git add package.json
git commit -m "chore: bump @sourcegraph/cody-web version to X.X.X"
Expand All @@ -81,11 +89,13 @@ Before publishing, it's important to test the package locally within the Sourceg
Once the version bump is merged in the Cody repository:

1. Ensure you're logged in to npm:

```bash
npm login
```

2. Build the package for production:

```bash
pnpm build
```
Expand All @@ -98,6 +108,7 @@ Once the version bump is merged in the Cody repository:
## Step 5: Update Sourcegraph Repository

1. Create a commit with the version updates:

```bash
git add client/web-sveltekit/package.json client/web/package.json
git commit -m "chore: update @sourcegraph/cody-web version to X.X.X"
Expand Down
Loading