Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Website mention provider #122

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
3 changes: 3 additions & 0 deletions bin/sample-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"path": "**"
}
]
},
"file:///Users/sqs/src/github.com/sourcegraph/openctx/provider/docs/dist/provider.mjs": {
"index": "file:///Users/sqs/tmp/octx-provider-docs/anthropic-docs-web-index.json"
}
}
}
5 changes: 5 additions & 0 deletions client/vscode/test/fixtures/workspace/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"openctx.enable": true,
"openctx.debug": true,
"openctx.providers": {
//"../../../../../../provider/docs/dist/provider.cjs": {
// // "index": "http://localhost:5900/@fs/home/sqs/tmp/openctx-provider-docs/vite-docs-web.index.json",
// // "index": "file:///home/sqs/tmp/openctx-provider-docs/vite-docs-web.index.json",
// "index": "file:///Users/sqs/tmp/octx-provider-docs/sourcegraph-handbook-web-index.json",
//},
// "https://sourcegraph.test:3443/.api/openctx": true,
// "https://openctx.org/npm/@openctx/provider-hello-world": true,
"../../../../../../provider/hello-world/dist/index.js": true,
Expand Down
1 change: 1 addition & 0 deletions client/web-playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@codemirror/lint": "^6.4.2",
"@openctx/client": "workspace:*",
"@openctx/codemirror-extension": "workspace:*",
"@openctx/provider-docs": "workspace:*",
"@openctx/provider-links": "workspace:*",
"@openctx/provider-storybook": "workspace:*",
"@openctx/ui-react": "workspace:*",
Expand Down
1 change: 1 addition & 0 deletions client/web-playground/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
{ "path": "../../lib/client" },
{ "path": "../../lib/ui-react" },
{ "path": "../../provider/links" },
{ "path": "../../provider/docs" },
],
}
20 changes: 16 additions & 4 deletions client/web-playground/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { resolve } from 'path'
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import { defineConfig, searchForWorkspaceRoot } from 'vite'

// TODO(sqs): un-hardcode
const docsProviderDataDir = resolve('/Users/sqs/tmp/octx-provider-docs')

export default defineConfig(({ mode }) => ({
plugins: [react()],
resolve: {
alias:
mode === 'development'
alias: [
...(mode === 'development'
? [
// In dev mode, build from TypeScript sources so we don't need to run `tsc -b`
// in the background.
Expand All @@ -17,8 +20,14 @@ export default defineConfig(({ mode }) => ({
replacement: '$1/src/index',
},
]
: [],
: []),
{
find: 'tmp-octx-provider-docs',
replacement: docsProviderDataDir,
},
],
},
define: {},
css: {
devSourcemap: true,
modules: {
Expand All @@ -27,6 +36,9 @@ export default defineConfig(({ mode }) => ({
},
server: {
port: 5900,
fs: {
allow: [searchForWorkspaceRoot(process.cwd()), docsProviderDataDir],
},
},
build: {
emptyOutDir: false,
Expand Down
Loading
Loading