Skip to content
Open
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
6 changes: 6 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
TALENT_PROTOCOL_API_KEY=
SUPABASE_URL=
SUPABASE_KEY=
DUNE_API_KEY=
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
120 changes: 120 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Build Extension

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allow manual trigger
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build Chrome extension
run: npm run build:chrome
env:
NODE_ENV: production

- name: Build Firefox extension
run: npm run build:firefox
env:
NODE_ENV: production

- name: Build Firefox XPI
run: npm run build:firefox-xpi

- name: Package Chrome extension
run: |
cd dist/chrome
zip -r ../../chrome-extension.zip ./*
cd ../..

- name: Upload Chrome artifact
uses: actions/upload-artifact@v4
with:
name: chrome-extension
path: chrome-extension.zip

- name: Upload Firefox artifact
uses: actions/upload-artifact@v4
with:
name: firefox-extension
path: web-ext-artifacts/*.xpi

release:
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Download Chrome artifact
uses: actions/download-artifact@v4
with:
name: chrome-extension

- name: Download Firefox artifact
uses: actions/download-artifact@v4
with:
name: firefox-extension

- name: Get version
id: package_version
run: |
echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV

- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ env.VERSION }}
name: Release v${{ env.VERSION }}
draft: false
prerelease: false
files: |
chrome-extension.zip
*.xpi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Install web-ext
run: npm install -g web-ext

- name: Lint Firefox extension
run: |
npm run build:firefox
web-ext lint -s dist/firefox
83 changes: 83 additions & 0 deletions manifest.chrome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"manifest_version": 3,
"name": "BuilderScore",
"version": "1.0.1",
"description": "Display Builder Scores from Talent Protocol on X profiles",
"icons": {
"16": "icons/icon-16.png",
"32": "icons/icon-32.png",
"48": "icons/icon-48.png",
"128": "icons/icon-128.png"
},
"content_security_policy": {
"extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self'",
"sandbox": "sandbox allow-scripts allow-forms allow-popups allow-modals"
},
"background": {
"service_worker": "background.js",
"type": "module"
},
"action": {
"default_popup": "popup.html",
"default_icon": {
"16": "icons/icon-16.png",
"32": "icons/icon-32.png",
"48": "icons/icon-48.png",
"128": "icons/icon-128.png"
}
},
"permissions": [
"storage",
"activeTab",
"tabs",
"scripting",
"alarms"
],
"host_permissions": [
"*://*.linkedin.com/*",
"*://*.talentprotocol.com/*",
"*://*.x.com/*",
"*://*.twitter.com/*",
"*://*.github.com/*",
"https://*.warpcast.com/*",
"https://warpcast.com/*",
"*://*.talent.aipop.fun/*"
],
"content_scripts": [
{
"matches": [
"*://*.x.com/*",
"*://*.twitter.com/*",
"*://*.github.com/*",
"*://*.warpcast.com/*",
"https://*.warpcast.com/*",
"https://warpcast.com/*",
"*://*.linkedin.com/*"
],
"js": ["content.js"],
"css": [
"global.css",
"styles.css"
],
"run_at": "document_idle",
"all_frames": false
}
],
"web_accessible_resources": [
{
"resources": [
"icons/*",
"*.js",
"*.css"
],
"matches": [
"*://*.x.com/*",
"*://*.twitter.com/*",
"https://*.warpcast.com/*",
"https://warpcast.com/*",
"*://*.warpcast.com/*",
"*://*.linkedin.com/*"
]
}
]
}
38 changes: 38 additions & 0 deletions manifest.firefox.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"manifest_version": 3,
"name": "Builder Score Extension",
"version": "1.0.1",
"description": "Extension to display Builder Scores on social platforms",
"permissions": [
"storage",
"webRequest",
"*://*.talent.aipop.fun/*",
"*://*.twitter.com/*",
"*://*.warpcast.com/*",
"*://*.linkedin.com/*"
],
"background": {
"scripts": ["background.js"],
"persistent": false
},
"content_scripts": [
{
"matches": [
"https://*.twitter.com/*",
"https://*.warpcast.com/*",
"https://*.linkedin.com/*"
],
"js": ["content.js"]
}
],
"icons": {
"48": "icons/icon-48.png",
"128": "icons/icon-128.png"
},
"browser_specific_settings": {
"gecko": {
"id": "builder-score@extension.org",
"strict_min_version": "57.0"
}
}
}
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@
"author": "codingsh",
"description": "Chrome extension to replace addresses with Farcaster names on DexScreener",
"scripts": {
"build": "webpack --config webpack.config.js",
"dev": "webpack --config webpack.config.js --watch"
"build:chrome": "webpack --config webpack.config.js --env browser=chrome",
"build:firefox": "webpack --config webpack.config.js --env browser=firefox",
"build": "npm run build:chrome && npm run build:firefox",
"dev:chrome": "webpack --config webpack.config.js --env browser=chrome --watch",
"dev:firefox": "webpack --config webpack.config.js --env browser=firefox --watch",
"build:firefox-xpi": "web-ext build --source-dir ./dist/firefox --artifacts-dir ./web-ext-artifacts"
},
"dependencies": {
"@radix-ui/react-switch": "^1.1.1",
"@supabase/supabase-js": "^2.48.1",
"@types/firefox-webext-browser": "^120.0.4",
"autoprefix": "^1.0.1",
"class-variance-authority": "^0.7.1",
"dotenv": "^16.0.3",
Expand All @@ -20,6 +25,7 @@
"tailwind-merge": "^2.5.5",
"tailwindcss-animate": "^1.0.7",
"terser-webpack-plugin": "^5.3.10",
"web-ext": "^8.4.0",
"zustand": "^5.0.3"
},
"devDependencies": {
Expand Down
Loading
Loading