Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/add-orbit-chain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
- name: Commit changes
run: |
git add "packages/arb-token-bridge-ui/src/**/*"
git add "packages/arb-token-bridge-ui/public/**/*"
git add "packages/app/public/**/*"
git status
git commit -m "feat: add ${{ steps.issue.outputs.result }}"
git push origin ${{ steps.branch.outputs.name }}
Expand Down
6 changes: 4 additions & 2 deletions packages/arb-token-bridge-ui/src/generateOpenGraphImages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ function getCoreChainImage(from: Chain, to: Chain) {
async function getOrbitChainImage(orbitChain: Chain) {
const chainConfig = getBridgeUiConfigForChain(orbitChain)
const isSvg = chainConfig.network.logo.endsWith('.svg')
const logoFileBuffer = fs.readFileSync(`./public${chainConfig.network.logo}`)
const logoFileBuffer = fs.readFileSync(
`../app/public${chainConfig.network.logo}`
)

console.log(`Generating image for ${orbitChain}`)

Expand Down Expand Up @@ -331,7 +333,7 @@ async function generateSvg(
const file = isOrbitChain
? `${chainsOrOrbitChain}.jpg`
: `${chainsOrOrbitChain.from}-to-${chainsOrOrbitChain.to}.jpg`
const filePath = `./public/images/__auto-generated/open-graph/${file}`
const filePath = `../app/public/images/__auto-generated/open-graph/${file}`

await sharp(Buffer.from(svg))
.jpeg({ quality: 90, mozjpeg: true })
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/src/addOrbitChain/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { getProvider } from './provider'

// Load .env from the UI project directory
dotenv.config({
path: path.resolve(__dirname, '../../../arb-token-bridge-ui/.env')
path: path.resolve(__dirname, '../../../app/.env')
})
export const TESTNET_PARENT_CHAIN_IDS = [11155111, 421614, 84532]
const ZERO_ADDRESS = constants.AddressZero
Expand Down
6 changes: 3 additions & 3 deletions packages/scripts/src/addOrbitChain/tests/transforms.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ describe('Transforms', () => {
process.cwd(),
'..',
'..',
'arb-token-bridge-ui',
'app',
'public',
'images',
'downloaded_chain_logo.png'
Expand Down Expand Up @@ -244,7 +244,7 @@ describe('Transforms', () => {
process.cwd(),
'..',
'..',
'arb-token-bridge-ui',
'app',
'public',
savedImagePath
)
Expand Down Expand Up @@ -360,7 +360,7 @@ const saveImageLocally = (
process.cwd(),
'..',
'..',
'arb-token-bridge-ui',
'app',
'public',
imageSavePath
)
Expand Down
7 changes: 2 additions & 5 deletions packages/scripts/src/addOrbitChain/transforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ export const fetchAndProcessImage = async (
}
} else {
// Handle local paths
const localPath = `../../arb-token-bridge-ui/public/${urlOrPath}`
const localPath = `../../app/public/${urlOrPath}`
if (!fs.existsSync(localPath)) {
throw new Error(
`Provided local path '${localPath}' did not match any existing images.`
Expand Down Expand Up @@ -328,10 +328,7 @@ export const fetchAndSaveImage = async (
const { buffer, fileExtension } = await fetchAndProcessImage(urlOrPath)
const imageSavePath = `images/${fileName}${fileExtension}`

const fullPath = path.join(
process.cwd(),
'../../packages/arb-token-bridge-ui/public/images'
)
const fullPath = path.join(process.cwd(), '../../packages/app/public/images')

// Save the file locally
fs.writeFileSync(path.join(fullPath, `${fileName}${fileExtension}`), buffer)
Expand Down
Loading