Skip to content

Commit

Permalink
Put erlang_target back
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodrigo Álvarez committed Mar 10, 2025
1 parent 1c00730 commit d617496
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 0 additions & 2 deletions compiler-core/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ use strum::{Display, EnumIter, EnumString, EnumVariantNames, VariantNames};
use vec1::Vec1;

#[derive(
Default,
Debug,
Serialize,
Deserialize,
Expand All @@ -59,7 +58,6 @@ use vec1::Vec1;
pub enum Target {
#[strum(serialize = "erlang", serialize = "erl")]
#[serde(rename = "erlang", alias = "erl")]
#[default]
Erlang,
#[strum(serialize = "javascript", serialize = "js")]
#[serde(rename = "javascript", alias = "js")]
Expand Down
6 changes: 5 additions & 1 deletion compiler-core/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ fn default_version() -> Version {
Version::parse("0.1.0").expect("default version")
}

fn erlang_target() -> Target {
Target::Erlang
}

fn default_javascript_runtime() -> Runtime {
Runtime::NodeJs
}
Expand Down Expand Up @@ -117,7 +121,7 @@ pub struct PackageConfig {
pub erlang: ErlangConfig,
#[serde(default, skip_serializing_if = "is_default")]
pub javascript: JavaScriptConfig,
#[serde(default, skip_serializing_if = "is_default")]
#[serde(default = "erlang_target")]
pub target: Target,
#[serde(default, skip_serializing_if = "is_default")]
pub internal_modules: Option<Vec<Glob>>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
source: compiler-core/src/config.rs
expression: json
---
{"name":"my_project","version":"1.0.0"}
{"name":"my_project","version":"1.0.0","target":"erlang"}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
source: compiler-core/src/config.rs
expression: json
---
{"name":"my_project","version":"1.0.0","gleam":">= 0.30.0","licences":["Apache-2.0","MIT"],"description":"Pretty complex config","documentation":{"pages":[{"title":"My Page","path":"my-page.html","source":"./path/to/my-page.md"}]},"dependencies":{"my_other_project":{"path":"../my_other_project"},"gleam_stdlib":{"version":">= 0.18.0 and < 2.0.0"}},"dev-dependencies":{"gleeunit":{"version":">= 1.0.0 and < 2.0.0"}},"repository":{"type":"github","user":"example","repo":"my_dep"},"links":[{"title":"Home page","href":"https://example.com/"}],"erlang":{"application_start_module":"my_app/application","extra_applications":["inets","ssl"]},"javascript":{"typescript_declarations":true,"runtime":"nodejs","deno":{"allow_env":["DATABASE_URL"],"allow_net":["example.com:443"],"allow_ffi":true,"allow_read":["./database.sqlite"]}},"internal_modules":["my_app/internal"]}
{"name":"my_project","version":"1.0.0","gleam":">= 0.30.0","licences":["Apache-2.0","MIT"],"description":"Pretty complex config","documentation":{"pages":[{"title":"My Page","path":"my-page.html","source":"./path/to/my-page.md"}]},"dependencies":{"gleam_stdlib":{"version":">= 0.18.0 and < 2.0.0"},"my_other_project":{"path":"../my_other_project"}},"dev-dependencies":{"gleeunit":{"version":">= 1.0.0 and < 2.0.0"}},"repository":{"type":"github","user":"example","repo":"my_dep"},"links":[{"title":"Home page","href":"https://example.com/"}],"erlang":{"application_start_module":"my_app/application","extra_applications":["inets","ssl"]},"javascript":{"typescript_declarations":true,"runtime":"nodejs","deno":{"allow_env":["DATABASE_URL"],"allow_net":["example.com:443"],"allow_ffi":true,"allow_read":["./database.sqlite"]}},"target":"erlang","internal_modules":["my_app/internal"]}

0 comments on commit d617496

Please sign in to comment.