Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ae6f5bf
Rename unit test files to use '*.test.mo' convention
rvanasa Feb 6, 2023
fe9195a
Merge branch 'master' of https://github.com/dfinity/motoko-base into …
rvanasa Feb 6, 2023
859b706
Reformat vessel.dhall
rvanasa Feb 12, 2023
4587d22
Fix relative path in Array test
rvanasa Feb 12, 2023
803217e
Add 'dfx.json' file with custom package sources command
rvanasa Feb 12, 2023
2e6094e
Use interpreter for flaky tests
rvanasa Feb 14, 2023
9cc59f5
Merge branch 'master' of https://github.com/dfinity/motoko-base into …
rvanasa Feb 14, 2023
663f156
Use interpreter for Float tests
rvanasa Feb 15, 2023
92f2d12
Change default test mode to 'interpreter'
rvanasa Feb 15, 2023
56cd3d5
Merge branch 'master' into ryan/unit-test-vscode
rvanasa Feb 16, 2023
69483a3
Rename RBTreeMore tests
rvanasa Feb 16, 2023
77bfccb
Merge branch 'master' into ryan/unit-test-vscode
rvanasa Feb 17, 2023
50fc014
Merge branch 'master' of https://github.com/dfinity/motoko-base into …
rvanasa Mar 15, 2023
0cd43bd
Merge branch 'ryan/unit-test-vscode' of https://github.com/dfinity/mo…
rvanasa Mar 15, 2023
2e81b7f
Replace test mode 'wasmer' -> 'wasi'
rvanasa Mar 15, 2023
d58f92c
Use WASI mode for Float tests
rvanasa Mar 15, 2023
88e63d8
Replace original test runner with 'mo-test' in CI
rvanasa Mar 15, 2023
fbea93a
Configure mo-test
rvanasa Mar 16, 2023
3cf65c7
Update CI to run validation script
rvanasa Mar 16, 2023
30f8e2a
Test with both WASI and interpreter by default
rvanasa Mar 16, 2023
bf08569
Bump mo-dev
rvanasa Mar 16, 2023
e38d946
Run tests in Nix shell
rvanasa Mar 16, 2023
1031aa1
Run tests outside of Nix shell
rvanasa Mar 16, 2023
a75a78e
Deprecate Makefile in favor of 'npm test'
rvanasa Mar 16, 2023
5f3b0e1
Add comments to JS validation/test scripts
rvanasa Mar 16, 2023
af3c6b1
Bump mo-dev
rvanasa Mar 16, 2023
a9bc0eb
Temporarily remove 'interpreter' test mode
rvanasa Mar 17, 2023
dc1e64b
Update readme
rvanasa Mar 17, 2023
a2b9285
Clarify existing instructions in readme
rvanasa Mar 17, 2023
b23a116
Misc readme changes
rvanasa Mar 17, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
node-version: 16
- run: npm ci
- name: "initial checks"
run: npm test
run: npm run validate
- name: Check if Git tag exists
run: echo "name=HEAD_TAG::$(git tag --points-at HEAD)" >> $GITHUB_ENV
- uses: cachix/install-nix-action@v20
Expand All @@ -43,7 +43,7 @@ jobs:
wget --output-document /home/runner/bin/vessel https://github.com/kritzcreek/vessel/releases/download/${{ env.vessel_version }}/vessel-linux64
chmod +x /home/runner/bin/vessel
- name: "test"
run: make -C test
run: npm test
- name: "graph dependencies"
run: python3 doc/module_graph.py | dot -Tsvg > doc/module_graph.svg && file doc/module_graph.svg
- name: "docs"
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ _out

# Node
node_modules

# Unit testing
/test/generated
*.test.wasm
36 changes: 22 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,51 @@ Usage
If you are installing Motoko through the DFINITY SDK releases, then this base
library is already included.

If you build your project using the [vessel package manager] your package-set most likely already includes base, but if it doesn't or you want to override its version add an entry like so to your `package-set.dhall`:
If you build your project using the [Vessel package manager] your package-set most likely already includes base, but if it doesn't or you want to override its version, add an entry like so to your `package-set.dhall`:

```
{
name = "base",
repo = "https://github.com/dfinity/motoko-base",
version = "dfx-0.9.2",
version = "master",
dependencies = [] : List Text
}
```

The package _name_ `"base"` appears when importing its modules in Motoko (e.g., `import "mo:base/Nat"`). The _repo_ may either be your local clone path, or this public repository url, as above. The _version_ can be any git branch name (among other things). There are no dependencies. See [vessel package manager] docs for more details.
The package _name_ `"base"` appears when importing its modules in Motoko (e.g., `import "mo:base/Nat"`). The _repo_ may either be your local clone path, or this public repository url, as above. The _version_ can be any git branch or tag name (such as `version = "moc-0.8.4"`). There are no dependencies. See the [Vessel package manager] docs for more details.

[vessel package manager]: https://github.com/kritzcreek/vessel
[Vessel package manager]: https://github.com/dfinity/vessel

Building/testing
----------------
Building & Testing
------------------

In `test/`, run
Run the following commands to configure your local development branch:

make
```sh
# First-time setup
git clone https://github.com/dfinity/motoko-base
cd motoko-base
npm install

This will expect `moc` to be installed and in your `$PATH`.
# Run tests
npm test

Running the tests also requires `wasmtime` and `vessel` to be installed.
# Run formatter
npm run prettier:format
```

If you installed `moc` some other way, you can instruct the `Makefile` to use
that compiler:
The test runner will automatically detect the `moc` compiler from your system path or `dfx` installation.

make MOC=moc
Running the tests locally also requires [Wasmtime](https://wasmtime.dev/) and [Vessel](https://github.com/dfinity/vessel) to be installed on your system.

Documentation
-------------

The documentation can be generated in `doc/` by running

./make_docs.sh
```sh
./make_docs.sh
```

which creates `_out/html/index.html`.

Expand Down
Loading