mirror of
https://github.com/gleam-lang/gleam.git
synced 2025-12-23 09:47:08 +00:00
JS project, fix target serialization
This commit is contained in:
parent
8b278acef9
commit
7be2f84010
22 changed files with 110 additions and 4 deletions
23
test/project_javascript/.github/workflows/test.yml
vendored
Normal file
23
test/project_javascript/.github/workflows/test.yml
vendored
Normal 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
3
test/project_javascript/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
*.beam
|
||||
*.ez
|
||||
build
|
||||
32
test/project_javascript/README.md
Normal file
32
test/project_javascript/README.md
Normal 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
|
||||
```
|
||||
8
test/project_javascript/gleam.toml
Normal file
8
test/project_javascript/gleam.toml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
name = "project"
|
||||
version = "0.1.0"
|
||||
target = "javascript"
|
||||
|
||||
[dependencies]
|
||||
gleam_stdlib = "~> 0.18"
|
||||
|
||||
[dev-dependencies]
|
||||
9
test/project_javascript/manifest.toml
Normal file
9
test/project_javascript/manifest.toml
Normal 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"
|
||||
9
test/project_javascript/src/project.gleam
Normal file
9
test/project_javascript/src/project.gleam
Normal 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"
|
||||
7
test/project_javascript/test/project_test.gleam
Normal file
7
test/project_javascript/test/project_test.gleam
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import gleam/io
|
||||
import project
|
||||
|
||||
pub fn main() {
|
||||
project.main()
|
||||
io.println("Hello, from the Gleam test module!")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue