JS project, fix target serialization

This commit is contained in:
Louis Pilfold 2021-12-18 23:44:03 +00:00
parent 8b278acef9
commit 7be2f84010
22 changed files with 110 additions and 4 deletions

View file

@ -0,0 +1,23 @@
name: test
on:
push:
branches:
- master
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.0.0
- uses: gleam-lang/setup-erlang@v1.1.2
with:
otp-version: 23.2
- uses: gleam-lang/setup-gleam@v1.0.2
with:
gleam-version: 0.18.0-dev
- run: gleam format --check src test
- run: gleam deps download
- run: gleam test

3
test/project_javascript/.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
*.beam
*.ez
build

View file

@ -0,0 +1,32 @@
# Project
A test Gleam project.
It covers these features:
- Downloading packages
- Specified in config.dependencies
- Importing packages
- Specified in config.dependencies
- Compilation of Gleam code
- in src
- in test
- Importing Gleam src code into test
These features are not tested yet
- Downloading packages
- Specified in config.dev-dependencies
- Importing packages
- Specified in config.dev-dependencies
- Compilation of locally defined JavaScript modules
- in src
- in test
- Importing Gleam src code into test
## Quick start
```sh
gleam run
gleam test
```

View file

@ -0,0 +1,8 @@
name = "project"
version = "0.1.0"
target = "javascript"
[dependencies]
gleam_stdlib = "~> 0.18"
[dev-dependencies]

View file

@ -0,0 +1,9 @@
# This file was generated by Gleam
# You typically do not need to edit this file
packages = [
{ name = "gleam_stdlib", version = "0.18.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "2938F996BBB25D75E973226846CDDFA33AB5590AFC8A9D043A356EA85272510D" },
]
[requirements]
gleam_stdlib = "~> 0.18"

View file

@ -0,0 +1,9 @@
import gleam/io
pub fn main() {
io.println("Hello, from the Gleam module!")
io.println(erlang_function())
}
external fn erlang_function() -> String =
"erlang_file" "main"

View file

@ -0,0 +1,7 @@
import gleam/io
import project
pub fn main() {
project.main()
io.println("Hello, from the Gleam test module!")
}