Skip to content

Commit 1f8900d

Browse files
committed
2 parents a8eaffa + 6d7f927 commit 1f8900d

File tree

233 files changed

+8773
-2307
lines changed

Some content is hidden

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

233 files changed

+8773
-2307
lines changed

.circleci/config.yml

Lines changed: 267 additions & 156 deletions
Large diffs are not rendered by default.

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ stats.json
1818
release
1919
.env
2020
.env.local
21-
21+
.idea/
22+
.yalc/
23+
.yalc
2224

2325
# compiled output
2426
/dist

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing
22

3-
Everyone is welcome to contribute to Remix's codebase and please join our [Discord](https://discord.gg/XcvfUpZPsG).
3+
Everyone is welcome to contribute to Remix's codebase and please join our [Discord](https://discord.gg/7RvvZ4KX9P).
44

55
## Development
66
Remix libraries work closely with [Remix IDE](https://remix.ethereum.org). Each library has a README to explain its application.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
[![GitHub contributors](https://img.shields.io/github/contributors/ethereum/remix-project?style=flat&logo=github)](https://github.com/ethereum/remix-project/graphs/contributors)
1313
[![Awesome Remix](https://img.shields.io/badge/Awesome--Remix-resources-green?logo=awesomelists)](https://github.com/ethereum/awesome-remix)
1414
[![GitHub](https://img.shields.io/github/license/ethereum/remix-project)](https://github.com/ethereum/remix-project/blob/master/LICENSE)
15-
[![Discord](https://img.shields.io/badge/join-discord-brightgreen.svg?style=flat&logo=discord)](https://discord.gg/XcvfUpZPsG)
15+
[![Discord](https://img.shields.io/badge/join-discord-brightgreen.svg?style=flat&logo=discord)](https://discord.gg/7RvvZ4KX9P)
1616
[![X Follow](https://img.shields.io/twitter/follow/ethereumremix?style=flat&logo=x&color=green)](https://x.com/ethereumremix)
1717

1818
</div>
@@ -267,4 +267,4 @@ parameters:
267267
- Curated list of Remix resources: https://github.com/ethereum/awesome-remix
268268
- Medium: https://medium.com/remix-ide
269269
- X: https://x.com/ethereumremix
270-
- Join Discord: https://discord.gg/XcvfUpZPsG
270+
- Join Discord: https://discord.gg/7RvvZ4KX9P

apps/remix-ide-e2e/chrome-driver.sh

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
#!/usr/bin/env bash
2+
# Usage: chrome-driver.sh [install_dir]
3+
# Determine install directory from first argument or ORB_PARAM_DRIVER_INSTALL_DIR
4+
INSTALL_DIR=${1:-${ORB_PARAM_DRIVER_INSTALL_DIR:-"./tmp/webdrivers"}}
5+
echo "Installing ChromeDriver into $INSTALL_DIR"
6+
7+
# Determine the OS platform
8+
OS="$(uname)"
9+
10+
if [ "$OS" == "Darwin" ]; then
11+
# macOS systems
12+
if [ -e "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" ]; then
13+
version=$("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --version)
14+
echo "Google Chrome version on macOS: $version"
15+
else
16+
echo "Google Chrome is not installed on your macOS."
17+
fi
18+
elif [ "$OS" == "Linux" ]; then
19+
# Linux systems
20+
if command -v google-chrome >/dev/null; then
21+
version=$(google-chrome --version)
22+
echo "Google Chrome version on Linux: $version"
23+
else
24+
echo "Google Chrome is not installed on your Linux."
25+
# exit without error
26+
exit 0
27+
fi
28+
else
29+
echo "Unsupported OS."
30+
exit 0
31+
fi
32+
33+
MAJORVERSION=$(echo "$version" | grep -Eo '[0-9]+' | head -1)
34+
echo "CHROME DRIVER INSTALL $MAJORVERSION"
35+
36+
# Determine target platform for ChromeDriver download
37+
case "$OS" in
38+
Darwin)
39+
if [[ "$(uname -m)" == "arm64" ]]; then
40+
PLATFORM="mac-arm64"
41+
else
42+
PLATFORM="mac-x64"
43+
fi
44+
;;
45+
Linux)
46+
PLATFORM="linux64"
47+
;;
48+
*)
49+
echo "Unsupported OS: $OS"; exit 1
50+
;;
51+
esac
52+
echo "Detected platform for download: $PLATFORM"
53+
54+
# Determine ChromeDriver version and download URL
55+
if [ "$MAJORVERSION" -lt 115 ]; then
56+
# Chrome <115: use storage.googleapis.com
57+
CHROMEDRIVER_VERSION=$(curl -sS "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${MAJORVERSION}" | tr -d '\r')
58+
CHROMEDRIVER_DOWNLOAD_URL="https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_${PLATFORM}.zip"
59+
else
60+
# Chrome >=115: use Chrome for Testing JSON feed
61+
FEED_URL="https://googlechromelabs.github.io/chrome-for-testing/latest-versions-per-milestone-with-downloads.json"
62+
CHROMEDRIVER_VERSION=$(curl -sS "$FEED_URL" | jq -r ".milestones.\"$MAJORVERSION\".version")
63+
CHROMEDRIVER_DOWNLOAD_URL=$(curl -sS "$FEED_URL" \
64+
| jq -r ".milestones.\"$MAJORVERSION\".downloads.chromedriver[] \
65+
| select(.platform==\"$PLATFORM\").url")
66+
fi
67+
68+
echo "Matching ChromeDriver version: $CHROMEDRIVER_VERSION"
69+
echo "Downloading ChromeDriver from $CHROMEDRIVER_DOWNLOAD_URL"
70+
71+
# Prepare install directory
72+
mkdir -p "$INSTALL_DIR"
73+
74+
# Download and install ChromeDriver
75+
ZIP_PATH="${INSTALL_DIR}/chromedriver_${PLATFORM}.zip"
76+
curl -sS -o "$ZIP_PATH" "$CHROMEDRIVER_DOWNLOAD_URL"
77+
unzip -o "$ZIP_PATH" -d "$INSTALL_DIR"
78+
79+
# Move the extracted chromedriver binary to the root of INSTALL_DIR
80+
EXTRACTED_DIR="${INSTALL_DIR}/chromedriver-${PLATFORM}"
81+
ALT_DIR="${INSTALL_DIR}/chromedriver_${PLATFORM}"
82+
83+
if [ -f "${EXTRACTED_DIR}/chromedriver" ]; then
84+
mv "${EXTRACTED_DIR}/chromedriver" "$INSTALL_DIR/chromedriver"
85+
elif [ -f "${ALT_DIR}/chromedriver" ]; then
86+
mv "${ALT_DIR}/chromedriver" "$INSTALL_DIR/chromedriver"
87+
else
88+
# Fallback: try to find chromedriver file inside any subdir
89+
FOUND=$(find "$INSTALL_DIR" -type f -name chromedriver | head -n1)
90+
if [ -n "$FOUND" ]; then
91+
mv "$FOUND" "$INSTALL_DIR/chromedriver"
92+
else
93+
echo "Error: chromedriver binary not found"
94+
exit 1
95+
fi
96+
fi
97+
98+
chmod +x "$INSTALL_DIR/chromedriver"
99+
# Cleanup extracted directory and zip
100+
rm -rf "$EXTRACTED_DIR"
101+
rm -f "$ZIP_PATH"
102+
103+
echo "ChromeDriver installed at $INSTALL_DIR/chromedriver"
Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,4 @@
11
#!/bin/bash
2-
3-
# Determine the OS platform
4-
OS="$(uname)"
5-
6-
if [ "$OS" == "Darwin" ]; then
7-
# macOS systems
8-
if [ -e "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" ]; then
9-
version=$("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --version)
10-
echo "Google Chrome version on macOS: $version"
11-
else
12-
echo "Google Chrome is not installed on your macOS."
13-
fi
14-
elif [ "$OS" == "Linux" ]; then
15-
# Linux systems
16-
if command -v google-chrome >/dev/null; then
17-
version=$(google-chrome --version)
18-
echo "Google Chrome version on Linux: $version"
19-
else
20-
echo "Google Chrome is not installed on your Linux."
21-
fi
22-
else
23-
echo "Unsupported OS."
24-
fi
25-
26-
MAJORVERSION=$(echo "$version" | grep -Eo '[0-9]+\.' | head -1 | cut -d'.' -f1)
27-
echo "CHROME DRIVER INSTALL $MAJORVERSION"
28-
292
# Specify the directory to check
303
directory="./tmp/webdrivers"
314

@@ -39,4 +12,6 @@ fi
3912

4013

4114
yarn init -y --cwd "$directory" || exit 1
42-
yarn add -D [email protected] geckodriver --cwd "$directory" || yarn add -D [email protected] geckodriver --cwd "$directory" || yarn add -D chromedriver geckodriver --cwd "$directory" || exit 1
15+
yarn add -D geckodriver --cwd "$directory" || exit 1
16+
17+
bash apps/remix-ide-e2e/chrome-driver.sh || exit 1

apps/remix-ide-e2e/nightwatch-chrome.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module.exports = {
1111
webdriver: {
1212
start_process: true,
1313
port: 9515,
14-
server_path: './tmp/webdrivers/node_modules/chromedriver/bin/chromedriver',
14+
server_path: './tmp/webdrivers/chromedriver',
1515
},
1616

1717
test_settings: {

apps/remix-ide-e2e/nightwatch-firefox.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module.exports = {
3535
'javascriptEnabled': true,
3636
'acceptSslCerts': true,
3737
'moz:firefoxOptions': {
38-
args: ['-width=2560', '-height=1440']
38+
args: ['-width=2560', '-height=1440', '--devtools']
3939
}
4040
}
4141
},

apps/remix-ide-e2e/src/commands/addFile.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import EventEmitter from 'events'
33

44
class AddFile extends EventEmitter {
55
command(this: NightwatchBrowser, name: string, content: NightwatchContractContent, readMeFile?:string): NightwatchBrowser {
6-
if(!readMeFile)
7-
readMeFile = 'README.txt'
6+
if (!readMeFile)
7+
readMeFile = 'README.txt'
88
this.api.perform((done) => {
99
addFile(this.api, name, content, readMeFile, () => {
1010
done()
@@ -28,6 +28,10 @@ function addFile(browser: NightwatchBrowser, name: string, content: NightwatchCo
2828
browser.clickLaunchIcon('filePanel')
2929
}
3030
})
31+
.execute(function () {
32+
const container = document.querySelector('[data-test-id="virtuoso-scroller"]');
33+
container.scrollTop = container.scrollHeight;
34+
})
3135
.scrollInto(readmeSelector)
3236
.waitForElementVisible(readmeSelector)
3337
.click(readmeSelector).pause(1000) // focus on root directory
@@ -63,7 +67,7 @@ function addFile(browser: NightwatchBrowser, name: string, content: NightwatchCo
6367
})
6468
.setEditorValue(content.content)
6569
.getEditorValue((result) => {
66-
if(result != content.content) {
70+
if (result != content.content) {
6771
browser.setEditorValue(content.content)
6872
}
6973
})
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import { NightwatchBrowser } from 'nightwatch'
2+
import EventEmitter from 'events'
3+
4+
class AssistantAddCtx extends EventEmitter {
5+
command(this: NightwatchBrowser, prompt: string): NightwatchBrowser {
6+
this.api.perform((done) => {
7+
selectCtx(this.api, prompt, () => {
8+
done()
9+
this.emit('complete')
10+
})
11+
})
12+
return this
13+
}
14+
}
15+
16+
function selectCtx(browser: NightwatchBrowser, ctx: string, done: VoidFunction) {
17+
browser
18+
.waitForElementVisible('*[data-id="remix-ai-assistant"]')
19+
.waitForElementVisible('*[data-id="composer-ai-add-context"]')
20+
.click({
21+
locateStrategy: 'xpath',
22+
selector: '//*[@data-id="composer-ai-add-context"]'
23+
})
24+
.waitForElementVisible('*[data-id="currentFile-context-option"]')
25+
.perform(async ()=> {
26+
switch (ctx) {
27+
case 'currentFile':
28+
browser.click({
29+
locateStrategy: 'xpath',
30+
selector: '//*[@data-id="currentFile-context-option"]'
31+
});
32+
break;
33+
case 'workspace':
34+
browser.click({
35+
locateStrategy: 'xpath',
36+
selector: '//*[@data-id="workspace-context-option"]'
37+
});
38+
break;
39+
case 'openedFiles':
40+
browser.click({
41+
locateStrategy: 'xpath',
42+
selector: '//*[@data-id="allOpenedFiles-context-option"]'
43+
});
44+
break;
45+
default:
46+
break;
47+
}
48+
})
49+
done()
50+
}
51+
52+
module.exports = AssistantAddCtx;

0 commit comments

Comments
 (0)