diff --git a/.env.development b/.env.development new file mode 100644 index 00000000..ec5fb844 --- /dev/null +++ b/.env.development @@ -0,0 +1,3 @@ +VITE_OPEN_SAUCED_INSIGHTS_DOMAIN = "beta.insights.opensauced.pizza" +VITE_OPEN_SAUCED_API_ENDPOINT = "https://beta.api.opensauced.pizza/v1" +VITE_OPEN_SAUCED_SUPABASE_ID = "fcqqkxwlntnrtjfbcioz" \ No newline at end of file diff --git a/.env.production b/.env.production new file mode 100644 index 00000000..7de39ca8 --- /dev/null +++ b/.env.production @@ -0,0 +1,3 @@ +VITE_OPEN_SAUCED_INSIGHTS_DOMAIN = "insights.opensauced.pizza" +VITE_OPEN_SAUCED_API_ENDPOINT = "https://api.opensauced.pizza/v1" +VITE_OPEN_SAUCED_SUPABASE_ID = "ibcwmlhcimymasokhgvn" \ No newline at end of file diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml index 2c94a619..dc999dbe 100644 --- a/.github/workflows/triage.yml +++ b/.github/workflows/triage.yml @@ -12,9 +12,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - name: disable take an issue + - name: take an issue uses: bdougie/take-action@main with: - message: The auto-take issues workflow is not enabled here, we can only assign issues to @open-sauced/triage, @open-sauced/committers, @open-sauced/maintainers in this repo for now. We suggest folks not on the team open issues and take a look at the [Bugs](https://github.com/orgs/open-sauced/projects/6) or [Papercuts](https://github.com/open-sauced/insights/issues?q=is%3Aopen+is%3Aissue+milestone%3APapercuts). If you would like to find good first issues, please check out the companion project to this, [open-sauced/hot](https://github.com/open-sauced/hot). issueCurrentlyAssignedMessage: Thanks for being interested in this issue. It looks like this ticket is already assigned to a contributor. token: ${{ secrets.GITHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 1db2de5e..248c6667 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,56 @@ > All notable changes to this project will be documented in this file +## [1.4.0-beta.2](https://github.com/open-sauced/ai/compare/v1.4.0-beta.1...v1.4.0-beta.2) (2023-06-03) + + +### 🍕 Features + +* uses username on highlight instead of full name ([#162](https://github.com/open-sauced/ai/issues/162)) ([801fe5a](https://github.com/open-sauced/ai/commit/801fe5a2fdfa69268b46bc9bdf7ef00ffadf5fdb)) + +## [1.4.0-beta.1](https://github.com/open-sauced/ai/compare/v1.3.1-beta.5...v1.4.0-beta.1) (2023-06-03) + + +### 🍕 Features + +* latest highlights ([#154](https://github.com/open-sauced/ai/issues/154)) ([0ccd0e7](https://github.com/open-sauced/ai/commit/0ccd0e778c7d290e9ab2c9fbe97fc3c04f3be878)) + +## [1.3.1-beta.5](https://github.com/open-sauced/ai/compare/v1.3.1-beta.4...v1.3.1-beta.5) (2023-06-03) + + +### 🐛 Bug Fixes + +* undefined config during build ([#158](https://github.com/open-sauced/ai/issues/158)) ([c986086](https://github.com/open-sauced/ai/commit/c986086f0b819746bd330fe17e3c94537633e6f4)) + +## [1.3.1-beta.4](https://github.com/open-sauced/ai/compare/v1.3.1-beta.3...v1.3.1-beta.4) (2023-05-29) + + +### 🐛 Bug Fixes + +* Post a highlight ([#101](https://github.com/open-sauced/ai/issues/101)) ([e3b7051](https://github.com/open-sauced/ai/commit/e3b7051826f016bbd64c8d0b6a37ae2c48865879)) + +## [1.3.1-beta.3](https://github.com/open-sauced/ai/compare/v1.3.1-beta.2...v1.3.1-beta.3) (2023-05-29) + + +### ✅ Tests + +* add tests for checkAuth.ts ([#149](https://github.com/open-sauced/ai/issues/149)) ([3a79fac](https://github.com/open-sauced/ai/commit/3a79facf2196537b4cfc0ce763ed74934c7b268f)) + +## [1.3.1-beta.2](https://github.com/open-sauced/ai/compare/v1.3.1-beta.1...v1.3.1-beta.2) (2023-05-27) + + +### ✅ Tests + +* add tests for utils/urlMatchers.ts ([#143](https://github.com/open-sauced/ai/issues/143)) ([26702e6](https://github.com/open-sauced/ai/commit/26702e689641138a791f3c8cb935ddc99540a19e)) + +## [1.3.1-beta.1](https://github.com/open-sauced/ai/compare/v1.3.0...v1.3.1-beta.1) (2023-05-27) + + +### 🐛 Bug Fixes + +* remove auto-take message from triage.yml ([258a828](https://github.com/open-sauced/ai/commit/258a8284d294d01b4228ca17d3b4d591692a890b)) +* rename triage.yml ([3b9a14b](https://github.com/open-sauced/ai/commit/3b9a14bab991c739b9e57b1d0d829100695f47fb)) + ## [1.3.0](https://github.com/open-sauced/ai/compare/v1.2.0...v1.3.0) (2023-05-27) diff --git a/README.md b/README.md index 8dc00379..9b0080d5 100644 --- a/README.md +++ b/README.md @@ -38,12 +38,23 @@ To install the project dependencies: npm ci ``` + To run a local instance of the project: +### On development environment + ```shell npm run dev ``` +### On Production environment + +```shell +npm run build +npm run preview +``` + + ## Installing the local build on a Chromium based browser: After running the above commands, 1. Navigate to `chrome://extensions`. diff --git a/manifest.json b/manifest.json index e68ac894..f44bbee7 100644 --- a/manifest.json +++ b/manifest.json @@ -20,6 +20,6 @@ "48": "src/assets/os-icons/os-icon-48.png", "128": "src/assets/os-icons/os-icon-128.png" }, - "host_permissions": ["https://github.com/*", "https://insights.opensauced.pizza/*"], + "host_permissions": ["https://github.com/*", "https://*.insights.opensauced.pizza/*"], "permissions": ["storage", "tabs", "cookies"] } diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index d5e8385d..29788a3e 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,12 +1,12 @@ { "name": "opensauced-browser-extension", - "version": "1.3.0", + "version": "1.4.0-beta.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "opensauced-browser-extension", - "version": "1.3.0", + "version": "1.4.0-beta.2", "dependencies": { "date-fns": "^2.30.0", "gpt-tokenizer": "^1.0.5", diff --git a/package.json b/package.json index dc75f8c9..c94be7ba 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "opensauced-browser-extension", "private": true, - "version": "1.3.0", + "version": "1.4.0-beta.2", "files": [ "dist" ], diff --git a/src/constants.ts b/src/constants.ts index 7328b3da..5f8aefa7 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,18 +1,23 @@ // OpenSauced constants -export const SUPABASE_LOGIN_URL = "https://ibcwmlhcimymasokhgvn.supabase.co/auth/v1/authorize?provider=github&redirect_to=https://insights.opensauced.pizza/"; +export const OPEN_SAUCED_INSIGHTS_DOMAIN = import.meta.env.VITE_OPEN_SAUCED_INSIGHTS_DOMAIN; +export const OPEN_SAUCED_API_ENDPOINT = import.meta.env.VITE_OPEN_SAUCED_API_ENDPOINT; +export const SUPABASE_LOGIN_URL = `https://${import.meta.env.VITE_OPEN_SAUCED_SUPABASE_ID}.supabase.co/auth/v1/authorize?provider=github&redirect_to=https://${OPEN_SAUCED_INSIGHTS_DOMAIN}/`; + + export const SUPABASE_AUTH_COOKIE_NAME = "supabase-auth-token"; export const OPEN_SAUCED_AUTH_TOKEN_KEY = "os-access-token"; export const OPEN_SAUCED_OPTED_LOG_OUT_KEY = "opted-log-out"; -export const OPEN_SAUCED_INSIGHTS_DOMAIN = "insights.opensauced.pizza"; export const AI_PR_DESCRIPTION_CONFIG_KEY = "ai-pr-description-config"; -// API endpoints -export const OPEN_SAUCED_USERS_ENDPOINT = "https://api.opensauced.pizza/v1/users"; -export const OPEN_SAUCED_REPOS_ENDPOINT = "https://api.opensauced.pizza/v1/repos"; -export const OPEN_SAUCED_SESSION_ENDPOINT = "https://api.opensauced.pizza/v1/auth/session"; -export const OPEN_SAUCED_USER_INSIGHTS_ENDPOINT = "https://api.opensauced.pizza/v1/user/insights"; -export const OPEN_SAUCED_AI_PR_DESCRIPTION_ENDPOINT = "https://api.opensauced.pizza/v1/prs/description/generate"; -export const OPEN_SAUCED_AI_CODE_REFACTOR_ENDPOINT = "https://api.opensauced.pizza/v1/prs/suggestion/generate"; + +export const OPEN_SAUCED_USERS_ENDPOINT = `${OPEN_SAUCED_API_ENDPOINT}/users`; +export const OPEN_SAUCED_REPOS_ENDPOINT = `${OPEN_SAUCED_API_ENDPOINT}/repos`; +export const OPEN_SAUCED_SESSION_ENDPOINT = `${OPEN_SAUCED_API_ENDPOINT}/auth/session`; +export const OPEN_SAUCED_USER_INSIGHTS_ENDPOINT = `${OPEN_SAUCED_API_ENDPOINT}/user/insights`; +export const OPEN_SAUCED_AI_PR_DESCRIPTION_ENDPOINT = `${OPEN_SAUCED_API_ENDPOINT}/prs/description/generate`; +export const OPEN_SAUCED_USER_HIGHLIGHTS_ENDPOINT = `${OPEN_SAUCED_API_ENDPOINT}/user/highlights`; +export const OPEN_SAUCED_AI_CODE_REFACTOR_ENDPOINT = `${OPEN_SAUCED_API_ENDPOINT}/prs/suggestion/generate`; +export const OPEN_SAUCED_HIGHLIGHTS_ENDPOINT = `${OPEN_SAUCED_API_ENDPOINT}/highlights/list`; // GitHub constants/selectors export const GITHUB_PROFILE_MENU_SELECTOR = ".p-nickname.vcard-username.d-block"; diff --git a/src/content-scripts/components/AddPRToHighlights/AddPRToHighlightsButton.ts b/src/content-scripts/components/AddPRToHighlights/AddPRToHighlightsButton.ts index 15a9ff01..16e436eb 100644 --- a/src/content-scripts/components/AddPRToHighlights/AddPRToHighlightsButton.ts +++ b/src/content-scripts/components/AddPRToHighlights/AddPRToHighlightsButton.ts @@ -1,5 +1,6 @@ import { createHtmlElement } from "../../../utils/createHtmlElement"; import openSaucedLogoIcon from "../../../assets/opensauced-icon.svg"; +import { OPEN_SAUCED_INSIGHTS_DOMAIN } from "../../../constants"; export const AddPRToHighlightsButton = () => { const addPRToHighlightsButton = createHtmlElement("a", { @@ -9,7 +10,7 @@ export const AddPRToHighlightsButton = () => { openSaucedLogoIcon, )}>