Skip to content

Commit c133fa7

Browse files
authored
Merge pull request #6741 from cowprotocol/release/2025-12-22
chore(release): 2025 12 22
2 parents f3f8e11 + f4ee169 commit c133fa7

File tree

219 files changed

+23824
-1978
lines changed

Some content is hidden

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

219 files changed

+23824
-1978
lines changed

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: CI
22

33
on:
4+
# main and develop branches
5+
push:
6+
branches:
7+
- main
8+
- develop
49
# build on PR creation/updates
510
pull_request:
611
types: [opened, synchronize]
@@ -115,6 +120,38 @@ jobs:
115120
- name: Run eslint
116121
run: yarn lint
117122

123+
build:
124+
name: Build
125+
needs: setup
126+
runs-on: ubuntu-latest
127+
128+
steps:
129+
- name: Checkout code
130+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
131+
with:
132+
persist-credentials: false
133+
134+
- name: Set up node
135+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
136+
with:
137+
node-version: ${{ env.NODE_VERSION }}
138+
cache: yarn
139+
140+
- name: Install dependencies
141+
run: yarn install --frozen-lockfile
142+
143+
- name: Load generated files
144+
id: cache-generated-files
145+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
146+
with:
147+
path: |
148+
src/state/data
149+
src/locales
150+
key: ${{ runner.os }}-generatedFiles-${{ hashFiles('**/yarn.lock') }}
151+
152+
- name: Build
153+
run: yarn build
154+
118155
integration-tests:
119156
name: Cypress
120157
runs-on: ubuntu-latest
@@ -178,3 +215,20 @@ jobs:
178215
# - name: Setup tmate session
179216
# uses: mxschmitt/action-tmate@v3
180217
# if: ${{ failure() }}
218+
219+
notify-failure:
220+
name: Notify Slack on Failure
221+
needs: [setup, build, test, lint]
222+
runs-on: ubuntu-latest
223+
if: failure() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop')
224+
225+
steps:
226+
- name: Notify Failure
227+
run: |
228+
curl -X POST -H "Content-type: application/json" --data "{\"text\": \"❌ CI failed on $REF_NAME. Check the build at $SERVER_URL/$REPOSITORY/actions/runs/$RUN_ID\"}" "$SLACK_WEBHOOK_URL"
229+
env:
230+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
231+
REF_NAME: ${{ github.ref_name }}
232+
SERVER_URL: ${{ github.server_url }}
233+
REPOSITORY: ${{ github.repository }}
234+
RUN_ID: ${{ github.run_id }}

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,4 @@ CLAUDE.md
7575
.serena/
7676

7777
# Github
78-
.github/
7978
/.npmrc

.prettierignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22
/dist
33
/coverage
44
/static-files
5-
.cursor/
5+
.cursor/
6+
7+
/libs/abis/src/generated
8+
CHANGELOG.md

.vscode/settings.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,30 @@
11
{
2+
"editor.codeActionsOnSave": {
3+
"source.fixAll.eslint": "explicit"
4+
},
5+
"editor.defaultFormatter": "esbenp.prettier-vscode",
6+
"[javascript]": {
7+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
8+
},
9+
"[typescript]": {
10+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
11+
},
12+
"[javascriptreact]": {
13+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
14+
},
15+
"[typescriptreact]": {
16+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
17+
},
18+
"[markdown]": {
19+
"editor.defaultFormatter": "esbenp.prettier-vscode"
20+
},
21+
"[json]": {
22+
"editor.defaultFormatter": "esbenp.prettier-vscode"
23+
},
24+
"[css]": {
25+
"editor.defaultFormatter": "vscode.css-language-features"
26+
},
27+
"[html]": {
28+
"editor.defaultFormatter": "vscode.html-language-features"
29+
}
230
}

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Start with issues labeled **Help Wanted**.
106106
- Abide by the structure of the respective projects
107107
- Use Storybook when coding UI in a project that uses Storybook, Cosmos where Cosmos is used
108108
- Code should be auto-formatted with rules defined in the project (ESLint)
109-
- You are free to use whatever editor you fancy (VSCode, Intellij, vim, emacs), preferably with format on save (Prettier plugin)
109+
- You are free to use whatever editor you fancy (VSCode, Intellij, vim, emacs), preferably with format on save (ESLint plugin)
110110

111111
**Keep functions small & prevent unnecessary re-renders.**
112112

@@ -134,7 +134,7 @@ Additional Guidelines:
134134

135135
## 7. Styling & Formatting
136136

137-
- ESLint + Prettier must pass; camelCase everywhere
137+
- ESLint must pass; camelCase everywhere
138138
- Import order:
139139
1. Core (react, jotai…)
140140
2. External (@cowprotocol/_, @uniswap/_, …)

README.md

Lines changed: 13 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ peer-to-peer among its users or into any on-chain liquidity source while
77
providing MEV protection.
88

99
| **Platform** | **Link** |
10-
|-----------------------|---------------------------------------------------------------------------------------------------------------|
10+
| --------------------- | ------------------------------------------------------------------------------------------------------------- |
1111
| 🐮 **CoW Swap** 🐮 | [swap.cow.fi](https://swap.cow.fi/) |
1212
| CoW Swap (IPFS) | Every release is deployed automatically to IPFS ([Releases](https://github.com/cowprotocol/cowswap/releases)) |
1313
| CoW Swap (ENS) | [ens://cowswap.eth](ens://cowswap.eth) or ([cowswap.eth.limo](https://cowswap.eth.limo)) |
@@ -28,9 +28,10 @@ yarn
2828
```
2929

3030
Or, if you want to use `@cowprotocol/sdk` preview versions like `"@cowprotocol/cow-sdk": "7.0.4-pr-546-c04641f0.0"`, then:
31-
- set the versions in `package.json`
32-
- run `PACKAGE_READ_AUTH_TOKEN=XXX yarn run install:sdk-preview` instead of just `yarn`
33-
- the token must be generated in GitHub with `read:packages` permissions
31+
32+
- set the versions in `package.json`
33+
- run `PACKAGE_READ_AUTH_TOKEN=XXX yarn run install:sdk-preview` instead of just `yarn`
34+
- the token must be generated in GitHub with `read:packages` permissions
3435

3536
## Run
3637

@@ -90,7 +91,7 @@ yarn build:cowfi
9091

9192
# 🖼️ Widget Configurator
9293

93-
Start the Widget Configurator on <http://127.0.0.1:4200/widget-configurator>
94+
Start the Widget Configurator on <http://localhost:4200/widget-configurator>
9495

9596
```bash
9697
# Start
@@ -122,38 +123,18 @@ To launch it with our development server (so you have live-reloading):
122123

123124
```bash
124125
yarn start
125-
yarn cypress
126-
```
127-
128-
Alternatively, you can build the project and launch the integration test.
129-
130-
```bash
131-
yarn build
132-
yarn integration-test
126+
yarn e2e
133127
```
134128

135129
If we want to use the Cypress UI:
136130

137131
```bash
138132
yarn build
139133
yarn serve
140-
yarn cypress
134+
yarn e2e:open
141135
```
142136

143-
## Build/test UI Library
144-
145-
CoW Swap has a library of reusable components.
146-
147-
```bash
148-
yarn ui:build
149-
yarn ui:test
150-
```
151-
152-
## Build
153-
154-
```bash
155-
yarn build
156-
```
137+
## Analyze build
157138

158139
Analyze CoW Swap bundle:
159140

@@ -250,7 +231,7 @@ All price feeds are enabled by default, but they can be individually disabled by
250231
using an environment variable:
251232
252233
| Name | Environment variable | Type | Description |
253-
|-----------|--------------------------------------|------------------------------|--------------------------------------------------------------------------------------|
234+
| --------- | ------------------------------------ | ---------------------------- | ------------------------------------------------------------------------------------ |
254235
| **1inch** | `REACT_APP_PRICE_FEED_1INCH_ENABLED` | `boolean` (default = `true`) | [Paraswap](https://1inch.exchange) price estimation. Used for all price estimations. |
255236
| **0x** | `REACT_APP_PRICE_FEED_0X_ENABLED` | `boolean` (default = `true`) | [0x](https://0x.org/) price estimation. Used for all price estimation. |
256237
@@ -273,13 +254,9 @@ environment variable. For more details, check out the environment file (<.env>)
273254
274255
## Sitemap
275256
276-
The sitemap can be found in <./public/sitemap.xml>
277-
278-
To update its content:
257+
`yarn build:cowfi` also generates `./sitemap.xml` file.
279258
280-
1. Edit the list of pages in <./src/sitemap.js>
281-
2. Run `yarn sitemap`
282-
3. Commit the changes to git
259+
See [next-sitemap.config.js](apps/cow-fi/next-sitemap.config.js)
283260
284261
# 🔫 Troubleshooting
285262
@@ -313,5 +290,5 @@ List of applications and their labels:
313290
# 📚 Technical Documentation
314291
315292
1. [Oveall Architecture](docs/architecture-overview.md)
316-
2. [Amounts formatting](apps/cowswap-frontend/src/utils/amountFormat/README.md)
293+
2. [Amounts formatting](libs/common-utils/src/amountFormat/README.md)
317294
3. [ABIs](libs/abis/README.md)

apps/cow-fi/app/layout.tsx

Lines changed: 58 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
import type { ReactNode } from 'react'
2+
13
import { Metadata, Viewport } from 'next'
2-
import { CONFIG } from '@/const/meta'
4+
import { headers } from 'next/headers'
5+
36
import { Providers } from './providers'
7+
8+
import { CONFIG } from '@/const/meta'
9+
import { checkEnvironment } from '@/util/environment'
410
import { getPageMetadata } from '@/util/getPageMetadata'
511

612
export const viewport: Viewport = {
@@ -12,42 +18,61 @@ export const viewport: Viewport = {
1218

1319
const defaultMetadata = getPageMetadata({ description: CONFIG.description })
1420

15-
export const metadata: Metadata = {
16-
...defaultMetadata,
17-
metadataBase: new URL(CONFIG.url.root),
18-
alternates: { canonical: './' },
19-
icons: {
20-
icon: [
21-
{ url: '/favicon-light-mode.png', type: 'image/png', media: '(prefers-color-scheme: light)' },
22-
{ url: '/favicon-dark-mode.png', type: 'image/png', media: '(prefers-color-scheme: dark)' },
23-
{ url: '/favicon-dark-mode.png', type: 'image/png', media: '(prefers-color-scheme: no-preference)' },
24-
],
25-
apple: '/apple-touch-icon.png',
21+
export async function generateMetadata(): Promise<Metadata> {
22+
const headersList = await headers()
23+
const host = headersList.get('host') || ''
24+
const { isDev, isPr } = checkEnvironment(host, '')
25+
26+
return {
27+
...defaultMetadata,
28+
metadataBase: new URL(CONFIG.url.root),
29+
alternates: { canonical: './' },
30+
// Add noindex for develop.cow.fi and PR preview environments to prevent search engine indexing
31+
robots:
32+
isDev || isPr
33+
? {
34+
index: false,
35+
follow: false,
36+
noarchive: true,
37+
nosnippet: true,
38+
}
39+
: {
40+
index: true,
41+
follow: true,
42+
},
43+
icons: {
44+
icon: [
45+
{ url: '/favicon-light-mode.png', type: 'image/png', media: '(prefers-color-scheme: light)' },
46+
{ url: '/favicon-dark-mode.png', type: 'image/png', media: '(prefers-color-scheme: dark)' },
47+
{ url: '/favicon-dark-mode.png', type: 'image/png', media: '(prefers-color-scheme: no-preference)' },
48+
],
49+
apple: '/apple-touch-icon.png',
50+
other: {
51+
rel: 'mask-icon',
52+
url: '/safari-pinned-tab.svg',
53+
color: '#000000',
54+
},
55+
},
56+
twitter: {
57+
...defaultMetadata.twitter,
58+
card: 'summary_large_image',
59+
site: CONFIG.social.twitter.account,
60+
images: [{ url: `${CONFIG.url.root}/images/og-meta-cowdao.png` }],
61+
},
62+
openGraph: {
63+
...defaultMetadata.openGraph,
64+
type: 'website',
65+
url: './',
66+
images: [{ url: `${CONFIG.url.root}/images/og-meta-cowdao.png` }],
67+
},
68+
manifest: '/site.webmanifest',
2669
other: {
27-
rel: 'mask-icon',
28-
url: '/safari-pinned-tab.svg',
29-
color: '#000000',
70+
'msapplication-TileColor': '#000000',
3071
},
31-
},
32-
twitter: {
33-
...defaultMetadata.twitter,
34-
card: 'summary_large_image',
35-
site: CONFIG.social.twitter.account,
36-
images: [{ url: `${CONFIG.url.root}/images/og-meta-cowdao.png` }],
37-
},
38-
openGraph: {
39-
...defaultMetadata.openGraph,
40-
type: 'website',
41-
url: './',
42-
images: [{ url: `${CONFIG.url.root}/images/og-meta-cowdao.png` }],
43-
},
44-
manifest: '/site.webmanifest',
45-
other: {
46-
'msapplication-TileColor': '#000000',
47-
},
72+
}
4873
}
4974

50-
export default function RootLayout({ children }: { children: React.ReactNode }) {
75+
export default function RootLayout({ children }: { children: ReactNode }): ReactNode {
5176
return (
5277
<html lang="en">
5378
<body>

apps/cow-fi/app/robots.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { headers } from 'next/headers'
2+
3+
import type { MetadataRoute } from 'next'
4+
5+
import { checkEnvironment } from '@/util/environment'
6+
7+
export default async function robots(): Promise<MetadataRoute.Robots> {
8+
const headersList = await headers()
9+
const host = headersList.get('host') || ''
10+
const { isDev, isPr } = checkEnvironment(host, '')
11+
12+
// Block all indexing on develop.cow.fi and PR preview environments
13+
if (isDev || isPr) {
14+
return {
15+
rules: {
16+
userAgent: '*',
17+
disallow: '/',
18+
},
19+
}
20+
}
21+
22+
// Allow indexing on production
23+
return {
24+
rules: {
25+
userAgent: '*',
26+
allow: '/',
27+
},
28+
sitemap: `${process.env.NEXT_PUBLIC_SITE_URL || 'https://cow.fi'}/sitemap.xml`,
29+
}
30+
}

0 commit comments

Comments
 (0)