diff --git a/.circleci/config.yml b/.circleci/config.yml index 7f101ed684..17a37c5d3c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,6 +6,7 @@ parameters: default: false orbs: browser-tools: circleci/browser-tools@1.4.4 + win: circleci/windows@5.0 jobs: build: docker: @@ -28,9 +29,9 @@ jobs: name: Build command: | if [ "${CIRCLE_BRANCH}" == "master" ]; then - NX_BIN_URL=http://127.0.0.1:8080/assets/js/soljson NX_WASM_URL=http://127.0.0.1:8080/assets/js/soljson NPM_URL=http://localhost:9090/ yarn build:production + NX_BIN_URL=http://127.0.0.1:8080/assets/js/soljson NX_WASM_URL=http://127.0.0.1:8080/assets/js/soljson NX_NPM_URL=http://127.0.0.1:9090/ yarn build:production else - NX_BIN_URL=http://127.0.0.1:8080/assets/js/soljson NX_WASM_URL=http://127.0.0.1:8080/assets/js/soljson NPM_URL=http://localhost:9090/ yarn build + NX_BIN_URL=http://127.0.0.1:8080/assets/js/soljson NX_WASM_URL=http://127.0.0.1:8080/assets/js/soljson NX_NPM_URL=http://127.0.0.1:9090/ yarn build fi - run: yarn run build:e2e @@ -50,6 +51,32 @@ jobs: paths: - "persist" + build-desktop: + docker: + - image: cimg/node:20.0.0-browsers + + resource_class: + xlarge + working_directory: ~/remix-project + steps: + - checkout + - restore_cache: + keys: + - v1-deps-{{ checksum "yarn.lock" }} + - run: yarn + - save_cache: + key: v1-deps-{{ checksum "yarn.lock" }} + paths: + - node_modules + - run: + name: Build + command: | + yarn build:desktop + - run: mkdir persist && zip -0 -r persist/desktopbuild.zip dist/apps/remix-ide + - persist_to_workspace: + root: . + paths: + - "persist" build-plugin: docker: @@ -77,6 +104,126 @@ jobs: paths: - "persist" + build-remixdesktop-linux: + machine: + image: ubuntu-2004:current + resource_class: + xlarge + working_directory: ~/remix-project + steps: + - run: ldd --version + - checkout + - attach_workspace: + at: . + - run: unzip ./persist/desktopbuild.zip + - run: + command: | + node -v + mkdir apps/remixdesktop/build + cp -r dist/apps/remix-ide apps/remixdesktop/build + cd apps/remixdesktop/ + yarn add node-pty + yarn --ignore-optional + yarn add @remix-project/remix-ws-templates + PUBLISH_FOR_PULL_REQUEST='true' yarn dist + rm -rf release/*-unpacked + - save_cache: + key: remixdesktop-linux-deps-{{ checksum "apps/remixdesktop/yarn.lock" }} + paths: + - apps/remixdesktop/node_modules + - store_artifacts: + path: apps/remixdesktop/release/ + destination: remixdesktop-linux + + build-remixdesktop-windows: + executor: + name: win/default # executor type + size: xlarge # can be medium, large, xlarge, 2xlarge + shell: bash.exe + working_directory: ~/remix-project + steps: + - checkout + - attach_workspace: + at: . + - run: unzip ./persist/desktopbuild.zip + - restore_cache: + key: node-20-windows-v3 + - run: + command: | + nvm install 20.0.0 + nvm use 20.0.0 + node -v + npx -v + npm install --global yarn + yarn -v + - save_cache: + key: node-20-windows-v3 + paths: + - /ProgramData/nvm/v20.0.0 + - restore_cache: + keys: + - remixdesktop-windows-deps-{{ checksum "apps/remixdesktop/yarn.lock" }} + - run: + command: | + mkdir apps/remixdesktop/build + cp -r dist/apps/remix-ide apps/remixdesktop/build + cd apps/remixdesktop/ + yarn + PUBLISH_FOR_PULL_REQUEST='true' yarn dist + rm -rf release/*-unpacked + - save_cache: + key: remixdesktop-windows-deps-{{ checksum "apps/remixdesktop/yarn.lock" }} + paths: + - apps/remixdesktop/node_modules + - store_artifacts: + path: apps/remixdesktop/release/ + destination: remixdesktop-windows + + build-remixdesktop-mac: + macos: + xcode: 14.2.0 + resource_class: + macos.m1.large.gen1 + working_directory: ~/remix-project + steps: + - checkout + - attach_workspace: + at: . + - run: unzip ./persist/desktopbuild.zip + - run: + command: | + ls -la dist/apps/remix-ide + nvm install 20.0.0 + nvm use 20.0.0 + - restore_cache: + keys: + - remixdesktop-deps-mac-{{ checksum "apps/remixdesktop/yarn.lock" }} + - run: + command: | + nvm use 20.0.0 + cd apps/remixdesktop && yarn + yarn add @remix-project/remix-ws-templates + - save_cache: + key: remixdesktop-deps-mac-{{ checksum "apps/remixdesktop/yarn.lock" }} + paths: + - apps/remixdesktop/node_modules + # use USE_HARD_LINK=false https://github.com/electron-userland/electron-builder/issues/3179 + - run: + command: | + nvm use 20.0.0 + mkdir apps/remixdesktop/build + cp -r dist/apps/remix-ide apps/remixdesktop/build + cd apps/remixdesktop + yarn + yarn installRipGrepMacOXarm64 + PUBLISH_FOR_PULL_REQUEST='true' USE_HARD_LINKS=false yarn dist --mac --arm64 + yarn installRipGrepMacOXx64 + PUBLISH_FOR_PULL_REQUEST='true' USE_HARD_LINKS=false yarn dist --mac --x64 + rm -rf release/mac* + - store_artifacts: + path: apps/remixdesktop/release/ + destination: remixdesktop-mac + lint: docker: - image: cimg/node:20.0.0-browsers @@ -166,7 +313,7 @@ jobs: at: . - run: unzip ./persist/dist.zip - run: yarn install --cwd ./apps/remix-ide-e2e --modules-folder ../../node_modules - + - run: mkdir node_modules/hardhat && wget https://unpkg.com/hardhat/console.sol -O node_modules/hardhat/console.sol - run: ls -la ./dist/apps/remix-ide/assets/js - run: yarn run selenium-install || yarn run selenium-install - when: @@ -295,6 +442,19 @@ workflows: unless: << pipeline.parameters.run_flaky_tests >> jobs: - build + - build-desktop: + filters: + branches: + only: ['master', /.*desktop.*/] + - build-remixdesktop-mac: + requires: + - build-desktop + - build-remixdesktop-windows: + requires: + - build-desktop + - build-remixdesktop-linux: + requires: + - build-desktop - build-plugin: matrix: parameters: diff --git a/.gitignore b/.gitignore index ad98096af7..01477ff7f7 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,10 @@ testem.log .DS_Store .vscode/settings.json .vscode/launch.json + +apps/remixdesktop/.webpack +apps/remixdesktop/out +apps/remixdesktop/release/ +apps/remix-ide/src/assets/list.json +apps/remix-ide/src/assets/esbuild.wasm +apps/remixdesktop/build* diff --git a/.prettierrc.json b/.prettierrc.json index b98b463e1a..07681f5b0a 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -4,5 +4,6 @@ "bracketSpacing": false, "useTabs": false, "semi": false, - "singleQuote": true + "singleQuote": true, + "bracketSpacing": false } diff --git a/apps/circuit-compiler/src/app/components/feedback.tsx b/apps/circuit-compiler/src/app/components/feedback.tsx index b4c9367699..164c39e1ac 100644 --- a/apps/circuit-compiler/src/app/components/feedback.tsx +++ b/apps/circuit-compiler/src/app/components/feedback.tsx @@ -22,7 +22,7 @@ export function CompilerFeedback ({ feedback, filePathToId, hideWarnings, openEr