Skip to content

Commit a22aa35

Browse files
authored
Merge branch 'main' into broadcast-redesign
2 parents fca6a66 + 3f6ad06 commit a22aa35

File tree

250 files changed

+47949
-9366
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

250 files changed

+47949
-9366
lines changed

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
node_modules
2+
npm-debug.log
3+
Dockerfile
4+
docker-compose.yml
5+
.dockerignore
26
.git
7+
.gitignore
8+
logs
39
.DS_Store
410
build

.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
# No special permissions needed for public repositories
55
GITHUB_TOKEN=your_github_token_here
66

7+
# Shopify Configuration (for Merch Store)
8+
# Get these from: Shopify Admin > Settings > Apps and sales channels > Develop apps
9+
# Required scopes: unauthenticated_read_product_listings, unauthenticated_write_checkouts
10+
SHOPIFY_STORE_DOMAIN=your-store.myshopify.com
11+
SHOPIFY_STOREFRONT_ACCESS_TOKEN=your_storefront_access_token_here
12+
713
# Firebase Configuration (if needed)
814
# FIREBASE_API_KEY=your_firebase_api_key
915
# FIREBASE_AUTH_DOMAIN=your_firebase_auth_domain

.eslintignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Build output
5+
build/
6+
dist/
7+
out/
8+
9+
# Caches / temp
10+
.cache/
11+
.tmp/
12+
.eslintcache
13+
14+
# Config files (optional)
15+
*.config.js
16+
babel.config.js
17+
18+
# Docs
19+
*.md
20+
*.mdx
21+
docs/**/*.md
22+
blog/**/*.md

.eslintrc.cjs

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
es2021: true,
6+
node: true,
7+
},
8+
extends: [
9+
"eslint:recommended",
10+
"plugin:react/recommended",
11+
"plugin:react/jsx-runtime",
12+
"plugin:@typescript-eslint/recommended",
13+
"prettier",
14+
],
15+
parser: "@typescript-eslint/parser",
16+
parserOptions: {
17+
ecmaFeatures: {
18+
jsx: true,
19+
},
20+
ecmaVersion: "latest",
21+
sourceType: "module",
22+
},
23+
plugins: ["react", "@typescript-eslint", "prettier"],
24+
settings: {
25+
react: {
26+
version: "detect",
27+
},
28+
},
29+
rules: {
30+
"prettier/prettier": "off",
31+
"react/react-in-jsx-scope": "off",
32+
"react/prop-types": "off",
33+
"react/no-unknown-property": "off",
34+
"react/display-name": "off",
35+
"@typescript-eslint/no-unused-vars": "warn",
36+
"@typescript-eslint/no-explicit-any": "warn",
37+
"@typescript-eslint/no-var-requires": "off",
38+
"@typescript-eslint/no-require-imports": "off",
39+
"@typescript-eslint/ban-ts-comment": "off",
40+
"@typescript-eslint/no-empty-object-type": "off",
41+
"no-console": "warn",
42+
"no-undef": "off",
43+
"no-useless-escape": "off",
44+
"no-prototype-builtins": "off",
45+
"no-constant-condition": "off",
46+
"no-misleading-character-class": "off",
47+
"react/no-unescaped-entities": "off",
48+
},
49+
ignorePatterns: [
50+
"node_modules/",
51+
"build/",
52+
".docusaurus/",
53+
".cache-loader/",
54+
"tmp/",
55+
"static/",
56+
"*.config.js",
57+
"babel.config.js",
58+
],
59+
};

.github/workflows/autocomment-iss-raise.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ jobs:
2121
issue_number: context.issue.number,
2222
owner: context.repo.owner,
2323
repo: context.repo.repo,
24-
body: "Thanks for opening this issue! 🎉 We'll look into it as soon as possible, estimated time for response is 5–8 hrs. \n\n Don't raise PR unless assigned to you.\n\nIn the meantime, please provide all necessary details and context to your issue — screenshots or videos of your changes help speed up the review and assignment. If you have questions, reach out to [LinkedIn](https://www.linkedin.com/in/sanjay-k-v/). Your contributions are highly appreciated!😊 \n\n Note: I maintain the repo issue every day twice at 8:00 AM IST and 9:00 PM IST. If your issue goes stale for more than one day, you can tag and comment on this same issue by tagging **@sanjay-kv**.\n\nWe are here to help you on this journey of open source. Consistent contributions are eligible for sponsorship 💰 \n\n 🎁 check our list of amazing people we sponsored so far: [GitHub Sponsorship](https://www.recodehive.com/our-sponsors). ✨ \n\n 📚Resources which can help you know more about Github 👇🏻 \n\n 1. End to End GitHub Beginner Playlist: [GitHub Playlist](https://www.youtube.com/watch?v=GrTV59Y84S8&list=PLrLTYhoDFx-kiuFiGQqVpYYZ56pIhUW63&ab_channel=RecodeHive). \n\n 2. Build your GitHub Profile: [GitHub Profile Optimisation](https://www.youtube.com/watch?v=w1zFVtthiYc&list=PLrLTYhoDFx-lTIzox5agrJgd9QbKHKPOI&ab_channel=RecodeHive). \n\n 3. GitHub Handbook for dummies: [GitHub Blog for Beginners.](https://www.recodehive.com/docs/GitHub/intro-github)"
24+
body: "Thanks for opening this issue! 🎉 We'll look into it as soon as possible, estimated time for response is 5–8 hrs. \n\n Don't raise PR unless assigned to you.\n\nIn the meantime, please provide all necessary details and context to your issue — screenshots or videos of your changes help speed up the review and assignment. If you have questions, reach out to [LinkedIn](https://www.linkedin.com/in/sanjay-k-v/). Your contributions are highly appreciated!😊 \n\n Note: I maintain the repo issue every day twice at 8:00 AM IST and 9:00 PM IST. If your issue goes stale for more than one day, you can tag and comment on this same issue by tagging **@sanjay-kv**.\n\nWe are here to help you on this journey of open source. Consistent contributions are eligible for sponsorship 💰 \n\n 🎁 check our list of amazing people we sponsored so far: [GitHub Sponsorship](https://www.recodehive.com/our-sponsors/#people-we-sponsored). ✨ \n\n 📚Resources which can help you know more about Github 👇🏻 \n\n 1. End to End GitHub Beginner Playlist: [GitHub Playlist](https://www.youtube.com/watch?v=GrTV59Y84S8&list=PLrLTYhoDFx-kiuFiGQqVpYYZ56pIhUW63&ab_channel=RecodeHive). \n\n 2. Build your GitHub Profile: [GitHub Profile Optimisation](https://www.youtube.com/watch?v=w1zFVtthiYc&list=PLrLTYhoDFx-lTIzox5agrJgd9QbKHKPOI&ab_channel=RecodeHive). \n\n 3. GitHub Handbook for dummies: [GitHub Blog for Beginners.](https://www.recodehive.com/docs/GitHub/intro-github)"
2525
2626
});

.github/workflows/autocomment-pr-raise.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
run: |
1919
COMMENT=$(cat <<EOF
2020
{
21-
"body": "Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. The estimated time for response is 5–8 hrs. \\n\n In the meantime, please provide all necessary screenshots and make sure you run - npm build run , command and provide a screenshot, a video recording, or an image of the update you made below, which helps speed up the review and assignment. If you have questions, reach out to [LinkedIn](https://www.linkedin.com/in/sanjay-k-v/). Your contributions are highly appreciated!😊 \n\n Note: I maintain the repo issue every day twice at 8:00 AM IST and 9:00 PM IST. If your PR goes stale for more than one day, you can tag and comment on this same issue by tagging **@sanjay-kv**.\n\n We are here to help you on this journey of open source. Consistent 20 contributions are eligible for sponsorship 💰 \n\n 🎁 check our list of amazing people we sponsored so far: [GitHub Sponsorship](https://www.recodehive.com/our-sponsors). ✨ \n\n 📚Your perks for contribution to this community 👇🏻 \n\n 1. Get free Consultation use code recode50 to get free: [Mentorship for free](https://event.recodehive.com/git). \n\n 2. Get the Ebook for free use code recode at checkout: [Data Science cheatsheet for Beginners](https://dev.recodehive.com/book). \n\n 3. Check out this weekly Newsletter: [Sanjay's Newsletter.](https://recodehive.substack.com/) \n\n If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊"
21+
"body": "Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. The estimated time for response is 5–8 hrs. \\n\n In the meantime, please provide all necessary screenshots and make sure you run - npm build run , command and provide a screenshot, a video recording, or an image of the update you made below, which helps speed up the review and assignment. If you have questions, reach out to [LinkedIn](https://www.linkedin.com/in/sanjay-k-v/). Your contributions are highly appreciated!😊 \n\n Note: I maintain the repo issue every day twice at 8:00 AM IST and 9:00 PM IST. If your PR goes stale for more than one day, you can tag and comment on this same issue by tagging **@sanjay-kv**.\n\n We are here to help you on this journey of open source. Consistent 20 contributions are eligible for sponsorship 💰 \n\n 🎁 check our list of amazing people we sponsored so far: [GitHub Sponsorship](https://www.recodehive.com/our-sponsors/#people-we-sponsored). ✨ \n\n 📚Your perks for contribution to this community 👇🏻 \n\n 1. Get free Consultation use code recode50 to get free: [Mentorship for free](https://event.recodehive.com/git). \n\n 2. Get the Ebook for free use code recode at checkout: [Data Science cheatsheet for Beginners](https://dev.recodehive.com/book). \n\n 3. Check out this weekly Newsletter: [Sanjay's Newsletter.](https://recodehive.substack.com/) \n\n If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊"
2222
}
2323
EOF
2424
)
Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
name: Auto Label PR from Linked Issue
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, edited, synchronize, reopened]
6+
7+
permissions:
8+
pull-requests: write
9+
issues: write
10+
contents: read
11+
12+
jobs:
13+
label-pr:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Extract Issue Numbers from PR Body
21+
id: extract-issues
22+
uses: actions/github-script@v7
23+
with:
24+
github-token: ${{ secrets.GITHUB_TOKEN }}
25+
result-encoding: string
26+
script: |
27+
let prNumber, prBody, prTitle;
28+
29+
// Check if triggered by issue event
30+
if (context.eventName === 'issues') {
31+
// Find all open PRs that link to this issue
32+
const issueNumber = context.payload.issue.number;
33+
console.log(`Issue #${issueNumber} labels were updated`);
34+
35+
// Search for PRs that mention this issue
36+
const { data: pullRequests } = await github.rest.pulls.list({
37+
owner: context.repo.owner,
38+
repo: context.repo.repo,
39+
state: 'open'
40+
});
41+
42+
const linkedPRs = [];
43+
for (const pr of pullRequests) {
44+
const prText = `${pr.title} ${pr.body || ''}`;
45+
const patterns = [
46+
new RegExp(`(?:close[sd]?|fix(?:e[sd])?|resolve[sd]?)\\s+#${issueNumber}\\b`, 'i'),
47+
new RegExp(`#${issueNumber}\\b`)
48+
];
49+
50+
if (patterns.some(p => p.test(prText))) {
51+
linkedPRs.push(pr.number);
52+
}
53+
}
54+
55+
if (linkedPRs.length === 0) {
56+
console.log('No linked PRs found for this issue');
57+
return JSON.stringify({ prs: [], issue: issueNumber });
58+
}
59+
60+
console.log(`Found linked PRs: ${linkedPRs.join(', ')}`);
61+
return JSON.stringify({ prs: linkedPRs, issue: issueNumber });
62+
} else {
63+
// Triggered by PR event - original logic
64+
prBody = context.payload.pull_request.body || '';
65+
prTitle = context.payload.pull_request.title || '';
66+
67+
const patterns = [
68+
/(?:close[sd]?|fix(?:e[sd])?|resolve[sd]?)\s+#(\d+)/gi,
69+
/#(\d+)/g
70+
];
71+
72+
const issueNumbers = new Set();
73+
const textToSearch = prBody + ' ' + prTitle;
74+
75+
patterns.forEach(pattern => {
76+
const matches = [...textToSearch.matchAll(pattern)];
77+
matches.forEach(match => {
78+
issueNumbers.add(match[1]);
79+
});
80+
});
81+
82+
const issues = Array.from(issueNumbers);
83+
console.log('Found linked issues:', issues);
84+
85+
return JSON.stringify({
86+
prs: [context.payload.pull_request.number],
87+
issues: issues
88+
});
89+
}
90+
91+
- name: Get Labels from Linked Issues
92+
id: get-labels
93+
uses: actions/github-script@v7
94+
with:
95+
github-token: ${{ secrets.GITHUB_TOKEN }}
96+
result-encoding: string
97+
script: |
98+
const extractData = JSON.parse('${{ steps.extract-issues.outputs.result }}');
99+
100+
// Labels to exclude from being applied to PRs
101+
const excludedLabels = ['recode', 'hacktoberfest-accepted'];
102+
103+
let issueNumbers = [];
104+
let prsToUpdate = [];
105+
106+
// Handle both PR and issue events
107+
if (extractData.issue) {
108+
// Issue event - update all linked PRs
109+
issueNumbers = [extractData.issue];
110+
prsToUpdate = extractData.prs || [];
111+
} else {
112+
// PR event - update the current PR
113+
issueNumbers = extractData.issues || [];
114+
prsToUpdate = extractData.prs || [];
115+
}
116+
117+
if (!issueNumbers || issueNumbers.length === 0) {
118+
console.log('No linked issues found');
119+
return JSON.stringify({ labels: [], prs: prsToUpdate });
120+
}
121+
122+
const allLabels = new Set();
123+
124+
for (const issueNumber of issueNumbers) {
125+
try {
126+
const issue = await github.rest.issues.get({
127+
owner: context.repo.owner,
128+
repo: context.repo.repo,
129+
issue_number: parseInt(issueNumber)
130+
});
131+
132+
console.log(`Issue #${issueNumber} labels:`, issue.data.labels.map(l => l.name));
133+
134+
issue.data.labels.forEach(label => {
135+
// Only add label if it's not in the excluded list
136+
if (!excludedLabels.includes(label.name.toLowerCase())) {
137+
allLabels.add(label.name);
138+
} else {
139+
console.log(`Excluding label: ${label.name}`);
140+
}
141+
});
142+
} catch (error) {
143+
console.log(`Could not fetch issue #${issueNumber}:`, error.message);
144+
}
145+
}
146+
147+
const labels = Array.from(allLabels);
148+
console.log('All labels to apply:', labels);
149+
150+
return JSON.stringify({ labels: labels, prs: prsToUpdate });
151+
152+
- name: Apply Labels to PR
153+
uses: actions/github-script@v7
154+
with:
155+
github-token: ${{ secrets.GITHUB_TOKEN }}
156+
script: |
157+
const data = JSON.parse('${{ steps.get-labels.outputs.result }}');
158+
const labels = data.labels || [];
159+
const prsToUpdate = data.prs || [];
160+
161+
if (!labels || labels.length === 0) {
162+
console.log('No labels to apply');
163+
return;
164+
}
165+
166+
if (!prsToUpdate || prsToUpdate.length === 0) {
167+
console.log('No PRs to update');
168+
return;
169+
}
170+
171+
// Update each PR
172+
for (const prNumber of prsToUpdate) {
173+
try {
174+
// First, get current PR labels
175+
const { data: pr } = await github.rest.pulls.get({
176+
owner: context.repo.owner,
177+
repo: context.repo.repo,
178+
pull_number: prNumber
179+
});
180+
181+
// Remove all existing labels first (to handle removed issue labels)
182+
const currentLabels = pr.labels.map(l => l.name);
183+
if (currentLabels.length > 0) {
184+
for (const label of currentLabels) {
185+
try {
186+
await github.rest.issues.removeLabel({
187+
owner: context.repo.owner,
188+
repo: context.repo.repo,
189+
issue_number: prNumber,
190+
name: label
191+
});
192+
} catch (e) {
193+
console.log(`Could not remove label ${label}: ${e.message}`);
194+
}
195+
}
196+
}
197+
198+
// Apply new labels
199+
await github.rest.issues.addLabels({
200+
owner: context.repo.owner,
201+
repo: context.repo.repo,
202+
issue_number: prNumber,
203+
labels: labels
204+
});
205+
206+
console.log(`Successfully applied ${labels.length} labels to PR #${prNumber}`);
207+
208+
// Add a comment to the PR
209+
await github.rest.issues.createComment({
210+
owner: context.repo.owner,
211+
repo: context.repo.repo,
212+
issue_number: prNumber,
213+
body: `🏷️ Labels automatically synced from linked issue(s): ${labels.map(l => `\`${l}\``).join(', ')}`
214+
});
215+
} catch (error) {
216+
console.error(`Error updating PR #${prNumber}:`, error.message);
217+
}
218+
}

.github/workflows/autolabler.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
await github.rest.issues.addLabels({
2525
...context.repo,
2626
issue_number: prNumber,
27-
labels: ["recode", "level 1", "hacktoberfest-accepted"]
27+
labels: ["recode","hacktoberfest-accepted"]
2828
});
2929
30-
console.log(`Added labels [recode, level 1,hacktoberfest-accepted] to PR #${prNumber}`);
30+
console.log(`Added labels [recode, hacktoberfest-accepted] to PR #${prNumber}`);
3131
3232
- name: Add labels to Issue
3333
if: github.event_name == 'issues'
@@ -43,3 +43,16 @@ jobs:
4343
});
4444
4545
console.log(`Added labels [recode, level 1, hacktoberfest-accepted] to Issue #${issueNumber}`);
46+
47+
- name: Set Issue Type to Bug
48+
if: github.event_name == 'issues'
49+
run: |
50+
ISSUE_NUMBER=${{ github.event.issue.number }}
51+
REPO=${{ github.repository }}
52+
TOKEN=${{ secrets.GITHUB_TOKEN }}
53+
54+
curl --request PATCH \
55+
--url https://api.github.com/repos/${REPO}/issues/${ISSUE_NUMBER} \
56+
--header "authorization: token ${TOKEN}" \
57+
--header "content-type: application/json" \
58+
--data '{"type":"Bug"}'

.github/workflows/lint.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Lint
2+
on: [push, pull_request]
3+
4+
jobs:
5+
lint:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
- uses: actions/setup-node@v4
10+
with:
11+
node-version: 20
12+
- run: npm ci
13+
- run: npm run lint

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,5 @@ yarn-error.log*
2222
.env
2323
.cursorrule
2424

25-
package-lock.json
26-
2725
# Temporary files
28-
/tmp/
26+
/tmp/

0 commit comments

Comments
 (0)