Skip to content

Commit 8f3b4e6

Browse files
committed
fix: tsconfig and auth cleanup
1 parent 13424e4 commit 8f3b4e6

File tree

6 files changed

+13
-15
lines changed

6 files changed

+13
-15
lines changed

.github/sync-env-vars.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Check if required environment variables are set
44
if [ -z "$CLOUDFLARE_ACCOUNT_ID" ] || [ -z "$CLOUDFLARE_API_TOKEN" ] || [ -z "$GITHUB_REPOSITORY" ] || \
5-
[ -z "$VOYAGEAI_API_KEY" ] || [ -z "$SUPABASE_URL" ] || [ -z "$SUPABASE_ANON_KEY" ] || [ -z "$SUPABASE_KEY" ]; then
5+
[ -z "$VOYAGEAI_API_KEY" ] || [ -z "$SUPABASE_URL" ] || [ -z "$SUPABASE_KEY" ]; then
66
echo "Error: Required environment variables are not set"
77
exit 1
88
fi
@@ -32,10 +32,6 @@ curl -X PATCH \
3232
"value": "'"${SUPABASE_URL}"'",
3333
"type": "secret_text"
3434
},
35-
"SUPABASE_ANON_KEY": {
36-
"value": "'"${SUPABASE_ANON_KEY}"'",
37-
"type": "secret_text"
38-
},
3935
"SUPABASE_KEY": {
4036
"value": "'"${SUPABASE_KEY}"'",
4137
"type": "secret_text"

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Upload build artifact
3535
uses: actions/upload-artifact@v4
3636
with:
37-
name: full-stack-app
37+
name: static
3838
path: |
3939
static
4040
functions

.github/workflows/deploy.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
with:
1919
repository: ${{ github.repository }}
2020
production_branch: ${{ github.event.repository.default_branch }}
21-
build_artifact_name: "full-stack-app"
22-
output_directory: "full-stack-app"
21+
build_artifact_name: "static"
22+
output_directory: "static"
2323
current_branch: ${{ github.event.workflow_run.head_branch }}
2424
cloudflare_account_id: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
2525
cloudflare_api_token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
@@ -44,7 +44,6 @@ jobs:
4444
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
4545
VOYAGEAI_API_KEY: ${{ secrets.VOYAGEAI_API_KEY }}
4646
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
47-
SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }}
4847
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
4948
run: bash .github/sync-env-vars.sh
5049

functions/issue-scraper.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,12 @@ async function issueScraper(username: string, supabase: SupabaseClient, voyageAp
279279

280280
const authorIdMap = await batchFetchAuthorIds(octokit, uniqueAuthors);
281281

282-
const markdowns = issues.map((issue) => `${issue.body || ""} ${issue.title || ""}`);
282+
const markdowns = issues.map((issue) => {
283+
if (!issue.title) {
284+
throw new Error(`Issue ${issue.id} is missing a title`);
285+
}
286+
return `${issue.body || ""} ${issue.title}`;
287+
});
283288
const plainTexts = markdowns.map(markdownToPlainText);
284289
const embeddings = await batchEmbeddings(voyageClient, markdowns);
285290

@@ -297,7 +302,7 @@ async function issueScraper(username: string, supabase: SupabaseClient, voyageAp
297302
issue: {
298303
nodeId: issue.id,
299304
number: issue.number,
300-
title: issue.title || "",
305+
title: issue.title,
301306
body: issue.body || "",
302307
state: issue.state,
303308
stateReason: issue.stateReason,

functions/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"module": "esnext",
55
"lib": ["esnext"],
66
"types": ["@cloudflare/workers-types"],
7-
"moduleResolution": "Node"
7+
"moduleResolution": "Node",
8+
"esModuleInterop": true,
89
}
910
}

src/home/authentication.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { trackReferralCode } from "./register-referral";
55
import { displayGitHubUserInformation } from "./rendering/display-github-user-information";
66
import { renderGitHubLoginButton } from "./rendering/render-github-login-button";
77
import { startIssueScraper } from "./scraper/issue-scraper";
8-
// import { issueScraper } from "./scraper/issue-scraper";
98

109
export async function authentication() {
1110
if (!navigator.onLine) {
@@ -22,8 +21,6 @@ export async function authentication() {
2221
if (gitHubUser) {
2322
await trackReferralCode();
2423
await displayGitHubUserInformation(gitHubUser);
25-
// <-- Issue Scraper here -->
26-
// const supabase = getSupabase();
2724
const githubUserName = gitHubUser.login;
2825
await startIssueScraper(githubUserName);
2926
}

0 commit comments

Comments
 (0)