Merge branch 'main' of https://github.com/Dhravya/supermemory into new-ui

This commit is contained in:
Dhravya 2024-03-31 17:48:11 -07:00
commit 1ae3ff1a5f
10 changed files with 90 additions and 25 deletions

View file

@ -26,4 +26,4 @@ runs:
uses: actions/upload-artifact@v3
with:
name: extension-${{ github.sha }}
path: apps/extensions/dist/extension-${{ github.sha }}.zip
path: apps/extension/dist/extension-${{ github.sha }}.zip

View file

@ -1,10 +1,18 @@
name: Build
name: Build and Deploy Changes
on:
push:
branches: [main]
paths:
- 'apps/web/**'
- 'apps/extension/**'
- 'apps/cf-ai-backend/**'
pull_request:
branches: [main]
paths:
- 'apps/web/**'
- 'apps/extension/**'
- 'apps/cf-ai-backend/**'
jobs:
build-extension:
@ -12,6 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/buildextension
build-app:
runs-on: ubuntu-latest
steps:
@ -41,9 +50,25 @@ jobs:
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }}
directory: apps/web/.vercel/output/static
branch: main
# deploy-cf-worker:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repo
# uses: actions/checkout@v3
# - name: Deploy to Cloudflare Workers
# uses: cloudflare/wrangler-action@1.2.0
# with:
# apiToken: ${{ secrets.CF_API_TOKEN }}
# workingDirectory: apps/cf-ai-backend
# env:
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
# SECURITY_KEY: ${{ secrets.BACKEND_SECURITY_KEY }}

View file

@ -27,4 +27,4 @@ jobs:
clientID: ${{ secrets.GOOGLE_CLIENT_ID }}
clientSecret: ${{ secrets.GOOGLE_CLIENT_SECRET }}
clientRefreshToken: ${{ secrets.GOOGLE_REFRESH_TOKEN }}
extensionFile: apps/extension/extension-${{ github.sha }}.zip
extensionFile: apps/extension/dist/extension-${{ github.sha }}.zip

View file

@ -1,5 +1,4 @@
# Logs
wrangler.toml
logs
_.log

View file

@ -0,0 +1,58 @@
name = "cf-ai-backend"
main = "src/index.ts"
compatibility_date = "2024-02-23"
[[vectorize]]
binding = "VECTORIZE_INDEX"
index_name = "any-vector"
[ai]
binding = "AI"
# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
# Note: Use secrets to store sensitive data.
# Docs: https://developers.cloudflare.com/workers/platform/environment-variables
# [vars]
# MY_VARIABLE = "production_value"
# Bind a KV Namespace. Use KV as persistent storage for small key-value pairs.
# Docs: https://developers.cloudflare.com/workers/runtime-apis/kv
# [[kv_namespaces]]
# binding = "MY_KV_NAMESPACE"
# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# Bind an R2 Bucket. Use R2 to store arbitrarily large blobs of data, such as files.
# Docs: https://developers.cloudflare.com/r2/api/workers/workers-api-usage/
# [[r2_buckets]]
# binding = "MY_BUCKET"
# bucket_name = "my-bucket"
# Bind a Queue producer. Use this binding to schedule an arbitrary task that may be processed later by a Queue consumer.
# Docs: https://developers.cloudflare.com/queues/get-started
# [[queues.producers]]
# binding = "MY_QUEUE"
# queue = "my-queue"
# Bind a Queue consumer. Queue Consumers can retrieve tasks scheduled by Producers to act on them.
# Docs: https://developers.cloudflare.com/queues/get-started
# [[queues.consumers]]
# queue = "my-queue"
# Bind another Worker service. Use this binding to call another Worker without network overhead.
# Docs: https://developers.cloudflare.com/workers/platform/services
# [[services]]
# binding = "MY_SERVICE"
# service = "my-service"
# Bind a Durable Object. Durable objects are a scale-to-zero compute primitive based on the actor model.
# Durable Objects can live for as long as needed. Use these when you need a long-running "server", such as in realtime apps.
# Docs: https://developers.cloudflare.com/workers/runtime-apis/durable-objects
# [[durable_objects.bindings]]
# name = "MY_DURABLE_OBJECT"
# class_name = "MyDurableObject"
# Durable Object migrations.
# Docs: https://developers.cloudflare.com/workers/learning/using-durable-objects#configure-durable-object-classes-with-migrations
# [[migrations]]
# tag = "v1"
# new_classes = ["MyDurableObject"]

View file

@ -28,3 +28,4 @@ export default {
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list

View file

@ -8,7 +8,7 @@ window.addEventListener('message', (event) => {
if (
!(
window.location.hostname === 'localhost' ||
window.location.hostname === 'anycontext.dhr.wtf'
window.location.hostname.endsWith('dhr.wtf')
)
) {
console.log(

View file

@ -65,4 +65,4 @@ In order to enable the example:
After doing this you can run the `dev` or `preview` script and visit the `/api/hello` route to see the example in action.
Finally, if you also want to see the example work in the deployed application make sure to add a `MY_KV_NAMESPACE` binding to your Pages application in its [dashboard kv bindings settings section](https://dash.cloudflare.com/?to=/:account/pages/view/:pages-project/settings/functions#kv_namespace_bindings_section). After having configured it make sure to re-deploy your application.
Finally, if you also want to see the example work in the deployed application make sure to add a `MY_KV_NAMESPACE` binding to your Pages application in its [dashboard kv bindings settings section](https://dash.cloudflare.com/?to=/:account/pages/view/:pages-project/settings/functions#kv_namespace_bindings_section). After having configured it make sure to re-deploy your application.

View file

@ -1,18 +0,0 @@
name = "web"
compatibility_date = "2024-03-29"
compatibility_flags = ["nodejs_compat"]
[[vectorize]]
binding = "VECTORIZE_INDEX"
index_name = "anycontext-idx"
[[d1_databases]]
binding = "DATABASE"
database_name = "dev-d1-anycontext"
[vars]
GOOGLE_CLIENT_ID="-"
GOOGLE_CLIENT_SECRET="-"
NEXTAUTH_SECRET="sec"
NEXTAUTH_URL="http://localhost:3000"
BACKEND_SECURITY_KEY="XP1FNh+rTYghq2TmrFbMLCCBy+eBAvi8iuoMuV9zDUc="

View file

@ -9,4 +9,4 @@ index_name = "anycontext-idx"
[[d1_databases]]
binding = "DATABASE"
database_name = "dev-d1-anycontext"
database_id = "fc562605-157a-4f60-b439-2a24ffed5b4c"
database_id = "fc562605-157a-4f60-b439-2a24ffed5b4c"