Fork of daniellemaywood.uk/gleam — Wasm codegen work
2

Configure Feed

Select the types of activity you want to include in your feed.

Swap broken package for target specific packages

+122 -77
+6 -8
.github/workflows/ci.yaml
··· 148 148 working-directory: ./test/project_erlang 149 149 if: ${{ matrix.run-integration-tests }} 150 150 151 - - name: test/run_dependency_with_broken_root erlang 152 - run: | 153 - gleam run -m gleeunit 154 - working-directory: ./test/fixtures/run_dependency_with_broken_root 151 + - name: test/external_only_javascript 152 + run: make 153 + working-directory: ./test/external_only_javascript 155 154 if: ${{ matrix.run-integration-tests }} 156 155 157 - - name: test/run_dependency_with_broken_root javascript 158 - run: | 159 - gleam run --target=js -m gleeunit 160 - working-directory: ./test/fixtures/run_dependency_with_broken_root 156 + - name: test/external_only_erlang 157 + run: make 158 + working-directory: ./test/external_only_erlang 161 159 if: ${{ matrix.run-integration-tests }} 162 160 163 161 - name: test/project_javascript
-23
test-community-packages/.github/workflows/test.yml
··· 1 - name: test 2 - 3 - on: 4 - push: 5 - branches: 6 - - master 7 - - main 8 - pull_request: 9 - 10 - jobs: 11 - test: 12 - runs-on: ubuntu-latest 13 - steps: 14 - - uses: actions/checkout@v3 15 - - uses: erlef/setup-beam@v1 16 - with: 17 - otp-version: "26.0.2" 18 - gleam-version: "0.34.1" 19 - rebar3-version: "3" 20 - # elixir-version: "1.15.4" 21 - - run: gleam deps download 22 - - run: gleam test 23 - - run: gleam format --check src test
+3
test/external_only_erlang/Makefile
··· 1 + .PHONY: test 2 + test: 3 + sh test.sh
+3
test/external_only_erlang/README.md
··· 1 + # external_only_erlang 2 + 3 + A project that can only be run on Erlang due to an external function.
+8
test/external_only_erlang/gleam.toml
··· 1 + name = "external_only_erlang" 2 + version = "1.0.0" 3 + target = "erlang" 4 + 5 + [dependencies] 6 + hello_joe = "~> 1.0" 7 + 8 + [dev-dependencies]
+10
test/external_only_erlang/manifest.toml
··· 1 + # This file was generated by Gleam 2 + # You typically do not need to edit this file 3 + 4 + packages = [ 5 + { name = "gleam_stdlib", version = "0.34.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "1FB8454D2991E9B4C0C804544D8A9AD0F6184725E20D63C3155F0AEB4230B016" }, 6 + { name = "hello_joe", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "hello_joe", source = "hex", outer_checksum = "CC896BC24A45528DE6C59A705171E2DD9F1EA4C3C031428E4A533539EF461519" }, 7 + ] 8 + 9 + [requirements] 10 + hello_joe = { version = "~> 1.0" }
+2
test/external_only_erlang/src/external_only_erlang.gleam
··· 1 + @external(erlang, "external_only_erlang_ffi", "main") 2 + pub fn main() -> Nil
+5
test/external_only_erlang/src/external_only_erlang_ffi.erl
··· 1 + -module(external_only_erlang_ffi). 2 + -export([main/0]). 3 + 4 + main() -> 5 + io:format("Hello!\n", []).
+26
test/external_only_erlang/test.sh
··· 1 + #!/bin/sh 2 + 3 + set -eu 4 + 5 + g() { 6 + echo "Running: gleam $@" 7 + cargo run --quiet -- "$@" 8 + } 9 + 10 + echo This should succeed regardless of target as it is a dependency module 11 + g run --module=hello_joe --target=erlang 12 + g run --module=hello_joe --target=javascript 13 + 14 + echo This should succeed as Erlang is supported 15 + g build --target=erlang 16 + g run --target=erlang 17 + 18 + echo This should fail as JavaScript is not supported 19 + if g build --target=javascript; then 20 + echo "Expected build to fail" 21 + exit 1 22 + fi 23 + if g run --target=javascript; then 24 + echo "Expected run to fail" 25 + exit 1 26 + fi
+4
test/external_only_javascript/.gitignore
··· 1 + *.beam 2 + *.ez 3 + /build 4 + erl_crash.dump
+3
test/external_only_javascript/Makefile
··· 1 + .PHONY: test 2 + test: 3 + sh test.sh
+3
test/external_only_javascript/README.md
··· 1 + # external_only_javascript 2 + 3 + A project that can only be run on JavaScript due to an external function.
+8
test/external_only_javascript/gleam.toml
··· 1 + name = "external_only_javascript" 2 + version = "1.0.0" 3 + target = "javascript" 4 + 5 + [dependencies] 6 + hello_joe = "~> 1.0" 7 + 8 + [dev-dependencies]
+10
test/external_only_javascript/manifest.toml
··· 1 + # This file was generated by Gleam 2 + # You typically do not need to edit this file 3 + 4 + packages = [ 5 + { name = "gleam_stdlib", version = "0.34.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "1FB8454D2991E9B4C0C804544D8A9AD0F6184725E20D63C3155F0AEB4230B016" }, 6 + { name = "hello_joe", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "hello_joe", source = "hex", outer_checksum = "CC896BC24A45528DE6C59A705171E2DD9F1EA4C3C031428E4A533539EF461519" }, 7 + ] 8 + 9 + [requirements] 10 + hello_joe = { version = "~> 1.0" }
+2
test/external_only_javascript/src/external_only_javascript.gleam
··· 1 + @external(javascript, "./external_only_javascript.mjs", "main") 2 + pub fn main() -> Nil
+3
test/external_only_javascript/src/external_only_javascript.mjs
··· 1 + export function main() { 2 + console.log("Hello"); 3 + }
+26
test/external_only_javascript/test.sh
··· 1 + #!/bin/sh 2 + 3 + set -eu 4 + 5 + g() { 6 + echo "Running: gleam $@" 7 + cargo run --quiet -- "$@" 8 + } 9 + 10 + echo This should succeed regardless of target as it is a dependency module 11 + g run --module=hello_joe --target=erlang 12 + g run --module=hello_joe --target=javascript 13 + 14 + echo This should succeed as JavaScript is supported 15 + g build --target=javascript 16 + g run --target=javascript 17 + 18 + echo This should fail as Erlang is not supported 19 + if g build --target=erlang; then 20 + echo "Expected build to fail" 21 + exit 1 22 + fi 23 + if g run --target=erlang; then 24 + echo "Expected run to fail" 25 + exit 1 26 + fi
test/fixtures/run_dependency_with_broken_root/.gitignore test/external_only_erlang/.gitignore
-5
test/fixtures/run_dependency_with_broken_root/README.md
··· 1 - # run_dependency_with_broken_root 2 - 3 - This package has a module with broken code. 4 - It is used to test that running `gleam run -m <module>` with a module belonging 5 - to an external dependency - gleeunit in this case - still works.
-19
test/fixtures/run_dependency_with_broken_root/gleam.toml
··· 1 - name = "run_dependency_with_broken_root" 2 - version = "1.0.0" 3 - 4 - # Fill out these fields if you intend to generate HTML documentation or publish 5 - # your project to the Hex package manager. 6 - # 7 - # description = "" 8 - # licences = ["Apache-2.0"] 9 - # repository = { type = "github", user = "username", repo = "project" } 10 - # links = [{ title = "Website", href = "https://gleam.run" }] 11 - # 12 - # For a full reference of all the available options, you can have a look at 13 - # https://gleam.run/writing-gleam/gleam-toml/. 14 - 15 - [dependencies] 16 - gleam_stdlib = "~> 0.34 or ~> 1.0" 17 - 18 - [dev-dependencies] 19 - gleeunit = "~> 1.0"
-11
test/fixtures/run_dependency_with_broken_root/manifest.toml
··· 1 - # This file was generated by Gleam 2 - # You typically do not need to edit this file 3 - 4 - packages = [ 5 - { name = "gleam_stdlib", version = "0.34.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "1FB8454D2991E9B4C0C804544D8A9AD0F6184725E20D63C3155F0AEB4230B016" }, 6 - { name = "gleeunit", version = "1.0.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "D364C87AFEB26BDB4FB8A5ABDE67D635DC9FA52D6AB68416044C35B096C6882D" }, 7 - ] 8 - 9 - [requirements] 10 - gleam_stdlib = { version = "~> 0.34 or ~> 1.0" } 11 - gleeunit = { version = "~> 1.0" }
-6
test/fixtures/run_dependency_with_broken_root/src/run_dependency_with_broken_root.gleam
··· 1 - import gleam/io 2 - 3 - pub fn main() { 4 - let this_is_intentionally_broken: Int = "Broken!" 5 - io.println("Hello from run_dependency_with_broken_root!") 6 - }
-5
test/fixtures/run_dependency_with_broken_root/test/run_dependency_with_broken_root_test.gleam
··· 1 - import gleeunit 2 - 3 - pub fn main() { 4 - gleeunit.main() 5 - }