Skip to content

Commit

Permalink
use mops to replace vessel, add custom domain (#173)
Browse files Browse the repository at this point in the history
* use mops to replace vessel

* fix

* fix

* fix

* custom domain and use binding from dfx generate
  • Loading branch information
chenyan-dfinity authored Jun 6, 2023
1 parent 57d2c93 commit b70f7e0
Show file tree
Hide file tree
Showing 38 changed files with 1,765 additions and 238 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ jobs:
strategy:
fail-fast: false
env:
DFX_VERSION: 0.14.0
VESSEL_VERSION: v0.6.4
IC_REPL_VERSION: 0.3.18
DFX_VERSION: 0.14.1
IC_REPL_VERSION: 0.4.0
MOC_VERSION: 0.9.1
steps:
- uses: actions/checkout@v2
Expand All @@ -37,16 +36,16 @@ jobs:
~/.cargo/git
service/wasm-utils/target
key: cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dfx
run: |
echo y | DFX_VERSION=$DFX_VERSION bash -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"
wget https://github.com/chenyan2002/ic-repl/releases/download/$IC_REPL_VERSION/ic-repl-linux64
cp ./ic-repl-linux64 /usr/local/bin/ic-repl
chmod a+x /usr/local/bin/ic-repl
wget https://github.com/dfinity/vessel/releases/download/$VESSEL_VERSION/vessel-linux64
cp ./vessel-linux64 /usr/local/bin/vessel
chmod a+x /usr/local/bin/vessel
sudo apt-get install -y binaryen
npm i -g ic-mops
dfx cache install
cd $(dfx cache show)
wget https://github.com/dfinity/motoko/releases/download/$MOC_VERSION/motoko-linux64-$MOC_VERSION.tar.gz
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ jobs:
- 14
- 16
env:
DFX_VERSION: 0.14.0
VESSEL_VERSION: v0.6.4
DFX_VERSION: 0.14.1
SKIP_WASM: true
MOC_VERSION: 0.9.1
steps:
Expand All @@ -36,9 +35,7 @@ jobs:
- name: Install dfx
run: |
echo y | DFX_VERSION=$DFX_VERSION bash -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"
wget https://github.com/dfinity/vessel/releases/download/$VESSEL_VERSION/vessel-linux64
cp ./vessel-linux64 /usr/local/bin/vessel
chmod a+x /usr/local/bin/vessel
npm i -g ic-mops
dfx cache install
cd $(dfx cache show)
wget https://github.com/dfinity/motoko/releases/download/$MOC_VERSION/motoko-linux64-$MOC_VERSION.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ yarn-debug.log*
yarn-error.log*

.eslintcache
.vessel
.mops

/service/wasm-utils/*.old.did

Expand Down
21 changes: 5 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,20 @@ We plan on adding many more features to make playground a full-featured web IDE

- [Install Internet Computer SDK](https://sdk.dfinity.org/docs/quickstart/local-quickstart.html)
- [Install npm](https://nodejs.org/en/download/)
- [Install Vessel](https://github.com/dfinity/vessel/releases)
- Download the latest release to your `/usr/local/bin` folder
- Rename from `vessel-{platform}` to `vessel`
- Run `chmod +x /usr/local/bin/vessel`
- [Install mops](https://mops.one/docs/install)
```
npm i -g ic-mops
```
- [Install Rust](https://www.rust-lang.org/tools/install)
- Add wasm32 target to Rust
```
rustup target add wasm32-unknown-unknown
```
- Install binaryen

```
apt install binaryen
```

or

```
brew install binaryen
```

### To run the Motoko Playground locally, proceed as follows after cloning the respository:

```sh
npm install # Install `npm` and `vessel` dependencies
npm install # Install `npm` dependencies
npm start # Run the local development server
```

Expand Down
4 changes: 0 additions & 4 deletions craco.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
const { addBeforeLoader, loaderByName } = require("@craco/craco");
const generateAliases = require("./src/config/generateAliases");
const webpack = require("webpack");

const aliases = generateAliases();

let canisterEnv;

function initCanisterIds() {
Expand Down Expand Up @@ -36,7 +33,6 @@ function initCanisterIds() {
initCanisterIds();

const overrideWebpackConfig = ({ webpackConfig }) => {
webpackConfig.resolve.alias = { ...webpackConfig.resolve.alias, ...aliases };
webpackConfig.resolve.plugins = webpackConfig.resolve.plugins.filter(
(plugin) =>
// Removes ModuleScopePlugin so `dfx-generated/` aliases work correctly
Expand Down
13 changes: 8 additions & 5 deletions dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@
"wasm-utils": {
"type": "custom",
"candid": "service/wasm-utils/wasm-utils.did",
"wasm": "service/wasm-utils/target/wasm32-unknown-unknown/release/wasm_opt.wasm",
"build": ["sh -c 'cd service/wasm-utils && ./build.sh'"]
"wasm": "service/wasm-utils/target/wasm32-unknown-unknown/release/wasm_utils.wasm",
"build": ["sh -c 'cd service/wasm-utils && ./build.sh'"],
"optimize": "cycles"
},
"backend": {
"dependencies": ["wasm-utils"],
"main": "service/pool/Main.mo",
"type": "motoko"
"type": "motoko",
"optimize": "cycles"
},
"saved": {
"main": "service/saved/Saved.mo",
"type": "motoko"
"type": "motoko",
"optimize": "cycles"
},
"react_app": {
"dependencies": ["backend", "saved"],
Expand All @@ -27,7 +30,7 @@
"defaults": {
"build": {
"output": "build",
"packtool": "vessel sources"
"packtool": "mops sources"
}
}
}
4 changes: 4 additions & 0 deletions mops.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[dependencies]
base = "0.9.1"
splay = "0.1.0"

Loading

0 comments on commit b70f7e0

Please sign in to comment.