Skip to content

Commit

Permalink
expose print_deps in moc.js (#4231)
Browse files Browse the repository at this point in the history
so that we can collect usage about base library in playground.
  • Loading branch information
chenyan-dfinity authored Oct 3, 2023
1 parent ddbc845 commit f87ff7f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ jobs:
name: ic-hs-test
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

# Free up disk space on Ubuntu
- name: Free Disk Space (Ubuntu)
uses: insightsengineering/disk-space-reclaimer@v1
if: startsWith(matrix.os, 'ubuntu-')
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# # Free up disk space on Ubuntu
# - name: Free Disk Space (Ubuntu)
# uses: insightsengineering/disk-space-reclaimer@v1
# if: startsWith(matrix.os, 'ubuntu-')
# with:
# # this might remove tools that are actually needed,
# # if set to "true" but frees about 6 GB
# tool-cache: false

# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
# # all of these default to true, but feel free to set to
# # "false" if necessary for your workflow
# android: true
# dotnet: true
# haskell: true
# large-packages: true
# docker-images: true
# swap-storage: true

# until https://github.com/cachix/cachix-action/issues/86 is fixed:
- run: cachix watch-store ic-hs-test &
Expand Down
6 changes: 6 additions & 0 deletions src/js/common.ml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ let wrap_output f =
val result = result
end

let print_deps file =
let _ = Pipeline.print_deps file in
let stdout_result = Buffer.contents stdout_buffer in
Buffer.clear stdout_buffer;
Js.bytestring stdout_result

let add_package package dir =
let libs = Flags.package_urls in
libs := Flags.M.add (Js.to_string package) (Js.to_string dir) !libs
Expand Down
1 change: 1 addition & 0 deletions src/js/moc_js.ml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ let () =
method parseCandid s = js_parse_candid s
method parseMotoko s = js_parse_motoko s
method parseMotokoTyped paths = js_parse_motoko_typed paths
method printDeps file = print_deps file
end);

0 comments on commit f87ff7f

Please sign in to comment.