Skip to content

Commit

Permalink
WIP probably garbage
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Nelson committed Nov 28, 2024
1 parent 6d477de commit c4e1ce3
Show file tree
Hide file tree
Showing 21 changed files with 64,002 additions and 26 deletions.
5 changes: 3 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
elixir 1.15.2
erlang 25.1
rust 1.81.0
erlang 26.2.1
elixir 1.17.2-otp-26
nodejs 18.1.0
11 changes: 9 additions & 2 deletions assets/js/launch-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { liveState, liveStateConfig } from 'phx-live-state';

@customElement('launch-form')
@liveState({
properties: ['complete'],
properties: ['complete', 'result'],
provide: {
scope: window,
name: 'launchFormState'
Expand All @@ -23,6 +23,9 @@ export class LaunchFormElement extends LitElement {
@state()
complete: boolean = false;

@state()
result: string = 'Thanks for your submission!';

@property({ attribute: 'form-id' })
formId: string = '';

Expand All @@ -43,6 +46,10 @@ export class LaunchFormElement extends LitElement {
}

render() {
return this.complete ? html`<slot name="success">Thanks for your submission!</slot>` : html`<slot></slot>`;
if (this.complete) {
return html`<slot name="success">${this.result}</slot>`
} else {
return html`<slot></slot>`;
}
}
}
28 changes: 20 additions & 8 deletions lib/launch_cart/forms.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ defmodule LaunchCart.Forms do
"""

import Ecto.Query, warn: false
alias LaunchCart.Forms.WasmComponentHandler
alias LaunchCart.Repo

alias LaunchCart.Forms.{Form, FormEmail, FormMailer, FormResponse, WasmHandler}
Expand Down Expand Up @@ -41,7 +42,8 @@ defmodule LaunchCart.Forms do
** (Ecto.NoResultsError)
"""
def get_form!(id), do: Repo.get!(Form, id) |> Repo.preload([:web_hooks, :form_emails, :wasm_handlers])
def get_form!(id),
do: Repo.get!(Form, id) |> Repo.preload([:web_hooks, :form_emails, :wasm_handlers])

def get_form_responses!(id) do
Repo.all(from form_response in FormResponse, where: form_response.form_id == ^id)
Expand Down Expand Up @@ -228,8 +230,8 @@ defmodule LaunchCart.Forms do
with {:ok, form_response} <- create_form_response(%{form_id: form_id, response: response}) do
send_web_hooks(web_hooks, response)
send_emails(form_emails, response)
fire_wasm_handlers(wasm_handlers, response)
{:ok, form_response}
result = fire_wasm_handlers(wasm_handlers, response)
{:ok, result, form_response}
end
end

Expand All @@ -246,13 +248,23 @@ defmodule LaunchCart.Forms do
end

defp fire_wasm_handlers(wasm_handlers, response) do
wasm_handlers |> Enum.map(&fire_wasm_handler(&1, response))
wasm_handlers
|> Enum.reduce(%{}, &fire_wasm_handler(&1, &2, response))
|> IO.inspect(label: "reduce result")
end

defp fire_wasm_handler(%WasmHandler{wasm: %{file_name: file_name}}, response) do
manifest = %{wasm: [%{path: "./priv/static/uploads/#{file_name}"}], allowed_hosts: ["*"]}
{:ok, plugin} = Extism.Plugin.new(manifest, true)
Extism.Plugin.call(plugin, "handleForm", response |> Jason.encode!())
defp fire_wasm_handler(%WasmHandler{wasm: %{file_name: file_name}}, acc, response) do
component_bytes = File.read!("./priv/static/uploads/#{file_name}")
{:ok, form_handler} = WasmComponentHandler.new(component_bytes)
IO.inspect(response, label: "response passed to handler")

result =
WasmComponentHandler.handle_submit(
form_handler,
response |> Enum.map(fn {k, v} -> {to_string(k), [v]} end) |> Enum.into([])
)

%{result: result}
end

defp preload(%Form{} = form), do: Repo.preload(form, [:web_hooks, :form_emails])
Expand Down
16 changes: 16 additions & 0 deletions lib/launch_cart/forms/native.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
defmodule LaunchCart.Forms.WasmComponentHandler.Native do
use Rustler, otp_app: :launch_cart, crate: :launchcart_formhandler_native

def instantiate(_store, _component), do: error()

def handle_submit(_store, _instance, _form_data), do: error()

def engine_new(_config), do: error()

def new_component(_store, _component), do: error()

def new_store(_options, _limits), do: error()

defp error, do: :erlang.nif_error(:nif_not_loaded)

end
15 changes: 15 additions & 0 deletions lib/launch_cart/forms/wasm_component_handler.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
defmodule LaunchCart.Forms.WasmComponentHandler do
alias LaunchCart.Forms.WasmComponentHandler.Native

defstruct instance: nil, store: nil, reference: nil

def handle_submit(%__MODULE__{instance: instance, store: store}, form_data), do: Native.handle_submit(store, instance, form_data)

def new(component_bytes, options \\ []) do
store = Native.new_store(%WasmComponentsEx.WasiOptions{}, %WasmComponentsEx.StoreLimits{})
component = Native.new_component(store, component_bytes)
instance = Native.instantiate(store, component)
{:ok, %__MODULE__{instance: instance, store: store}}
end

end
4 changes: 2 additions & 2 deletions lib/launch_cart_web/channels/launch_form_channel.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ defmodule LaunchCartWeb.LaunchFormChannel do
%{form_id: form_id}
) do
with form <- Forms.get_form!(form_id),
{:ok, _response} <- Forms.submit_response(form, form_data) do
{:noreply, %{complete: true}}
{:ok, result, _response} <- Forms.submit_response(form, form_data) do
{:noreply, Map.merge(result, %{complete: true})}
end
end
end
2 changes: 1 addition & 1 deletion lib/launch_cart_web/live/form_live/show.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<%= live_redirect "View reponses", to: Routes.form_form_responses_path(@socket, :index, @form) %>
</p>

<.link patch={~p"/forms/#{@form.id}/wasm_handlers"}>WASM Form Handlers</.link>
<.link navigate={~p"/forms/#{@form.id}/wasm_handlers"}>WASM Form Handlers</.link>

<h2 class="u-push__top--xl">Usage:</h2>
<p>Using your Launch Form is easy! </p>
Expand Down
6 changes: 5 additions & 1 deletion lib/launch_cart_web/live/wasm_handler_live/form_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ defmodule LaunchCartWeb.WasmHandlerLive.FormComponent do
|> assign(:form_id, form_id)
|> assign(assigns)
|> assign_form(changeset)
|> allow_upload(:wasm, accept: ~w(.wasm))}
|> allow_upload(:wasm, accept: ~w(.wasm), max_file_size: 100_000_000)}
end

@impl true
Expand All @@ -51,6 +51,7 @@ defmodule LaunchCartWeb.WasmHandlerLive.FormComponent do
socket.assigns.wasm_handler
|> Forms.change_wasm_handler(wasm_handler_params)
|> Map.put(:action, :validate)
|> IO.inspect(label: "changeset in validate")

{:noreply, assign_form(socket, changeset)}
end
Expand Down Expand Up @@ -78,6 +79,7 @@ defmodule LaunchCartWeb.WasmHandlerLive.FormComponent do
|> push_patch(to: socket.assigns.patch)}

{:error, %Ecto.Changeset{} = changeset} ->
IO.inspect(changeset)
{:noreply, assign_form(socket, changeset)}
end
end
Expand All @@ -93,6 +95,8 @@ defmodule LaunchCartWeb.WasmHandlerLive.FormComponent do
|> push_patch(to: socket.assigns.patch)}

{:error, %Ecto.Changeset{} = changeset} ->
IO.inspect(changeset)

{:noreply, assign_form(socket, changeset)}
end
end
Expand Down
24 changes: 17 additions & 7 deletions lib/launch_cart_web/live/wasm_handler_live/index.html.heex
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
<.header>
Listing Wasm handlers
<:actions>
<.link patch={~p"/forms/#{@form_id}/wasm_handlers/new"}>
New WASM Handler
</.link>
</:actions>
</.header>
<.link navigate={~p"/forms/#{@form_id}/wasm_handlers/new"}>
New WASM Handler
</.link>

<.link navigate={~p"/forms/#{@form_id}"}>
Back
</.link>
<.table
id="wasm_handlers"
rows={@streams.wasm_handlers}
row_click={fn {_id, wasm_handler} -> JS.navigate(~p"/forms/#{@form_id}/wasm_handlers/#{wasm_handler}") end}
row_click={
fn {_id, wasm_handler} ->
JS.navigate(~p"/forms/#{@form_id}/wasm_handlers/#{wasm_handler}")
end
}
>
<:col :let={{_id, wasm_handler}} label="Description"><%= wasm_handler.description %></:col>
<:action :let={{_id, wasm_handler}}>
Expand All @@ -29,7 +34,12 @@
</:action>
</.table>

<.modal :if={@live_action in [:new, :edit]} id="wasm_handler-modal" show on_cancel={JS.patch(~p"/wasm_handlers")}>
<.modal
:if={@live_action in [:new, :edit]}
id="wasm_handler-modal"
show
on_cancel={JS.patch(~p"/wasm_handlers")}
>
<.live_component
module={LaunchCartWeb.WasmHandlerLive.FormComponent}
id={@wasm_handler.id || :new}
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ defmodule LaunchCart.MixProject do
{:live_elements, ">= 0.0.0"},
{:waffle, ">= 0.0.0"},
{:waffle_ecto, ">= 0.0.0"},
{:extism, "1.0.0"},
{:wasm_components_ex, path: "../wasm_components_ex"},
{:wallaby, "~> 0.30.2",
git: "https://github.com/launchscout/wallaby.git",
branch: "shadow-dom",
Expand Down
10 changes: 8 additions & 2 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@
"extism": {:hex, :extism, "1.0.0", "ddff96ba205ae669a55da39c3215917ea2d507d7191a6d4cab4318763774138a", [:mix], [{:json, "~> 1.4", [hex: :json, repo: "hexpm", optional: false]}, {:rustler, "~> 0.29", [hex: :rustler, repo: "hexpm", optional: false]}], "hexpm", "e0069ed2e7b671e4454a21f30af53169dc628440ea907be1cff4b67006191495"},
"faker": {:hex, :faker, "0.17.0", "671019d0652f63aefd8723b72167ecdb284baf7d47ad3a82a15e9b8a6df5d1fa", [:mix], [], "hexpm", "a7d4ad84a93fd25c5f5303510753789fc2433ff241bf3b4144d3f6f291658a6a"},
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
"finch": {:hex, :finch, "0.19.0", "c644641491ea854fc5c1bbaef36bfc764e3f08e7185e1f084e35e0672241b76d", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.6.2 or ~> 1.7", [hex: :mint, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_pool, "~> 1.1", [hex: :nimble_pool, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "fc5324ce209125d1e2fa0fcd2634601c52a787aff1cd33ee833664a5af4ea2b6"},
"floki": {:hex, :floki, "0.33.1", "f20f1eb471e726342b45ccb68edb9486729e7df94da403936ea94a794f072781", [:mix], [{:html_entities, "~> 0.5.0", [hex: :html_entities, repo: "hexpm", optional: false]}], "hexpm", "461035fd125f13fdf30f243c85a0b1e50afbec876cbf1ceefe6fddd2e6d712c6"},
"gettext": {:hex, :gettext, "0.20.0", "75ad71de05f2ef56991dbae224d35c68b098dd0e26918def5bb45591d5c8d429", [:mix], [], "hexpm", "1c03b177435e93a47441d7f681a7040bd2a816ece9e2666d1c9001035121eb3d"},
"hackney": {:hex, :hackney, "1.18.1", "f48bf88f521f2a229fc7bae88cf4f85adc9cd9bcf23b5dc8eb6a1788c662c4f6", [:rebar3], [{:certifi, "~>2.9.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a4ecdaff44297e9b5894ae499e9a070ea1888c84afdd1fd9b7b2bc384950128e"},
"hpax": {:hex, :hpax, "1.0.0", "28dcf54509fe2152a3d040e4e3df5b265dcb6cb532029ecbacf4ce52caea3fd2", [:mix], [], "hexpm", "7f1314731d711e2ca5fdc7fd361296593fc2542570b3105595bb0bc6d0fad601"},
"html_entities": {:hex, :html_entities, "0.5.2", "9e47e70598da7de2a9ff6af8758399251db6dbb7eebe2b013f2bbd2515895c3c", [:mix], [], "hexpm", "c53ba390403485615623b9531e97696f076ed415e8d8058b1dbaa28181f4fdcc"},
"httpoison": {:hex, :httpoison, "1.8.2", "9eb9c63ae289296a544842ef816a85d881d4a31f518a0fec089aaa744beae290", [:mix], [{:hackney, "~> 1.17", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "2bb350d26972e30c96e2ca74a1aaf8293d61d0742ff17f01e0279fef11599921"},
"idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"},
"jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"},
"jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},
"json": {:hex, :json, "1.4.1", "8648f04a9439765ad449bc56a3ff7d8b11dd44ff08ffcdefc4329f7c93843dfa", [:mix], [], "hexpm", "9abf218dbe4ea4fcb875e087d5f904ef263d012ee5ed21d46e9dbca63f053d16"},
"json_diff": {:hex, :json_diff, "0.1.3", "c80d5ca5416e785867e765e906e9a91b7efc35bfd505af276654d108f4995736", [:mix], [], "hexpm", "a5332e8293e7e9f384d34ea44645d7961334db73739165178fd4a7728d06f7d1"},
"jumper": {:hex, :jumper, "1.0.1", "3c00542ef1a83532b72269fab9f0f0c82bf23a35e27d278bfd9ed0865cecabff", [:mix], [], "hexpm", "318c59078ac220e966d27af3646026db9b5a5e6703cb2aa3e26bcfaba65b7433"},
Expand All @@ -42,8 +44,11 @@
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"},
"mime": {:hex, :mime, "2.0.5", "dc34c8efd439abe6ae0343edbb8556f4d63f178594894720607772a041b04b02", [:mix], [], "hexpm", "da0d64a365c45bc9935cc5c8a7fc5e49a0e0f9932a761c55d6c52b142780a05c"},
"mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"},
"mint": {:hex, :mint, "1.6.2", "af6d97a4051eee4f05b5500671d47c3a67dac7386045d87a904126fd4bbcea2e", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1 or ~> 0.2.0 or ~> 1.0", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "5ee441dffc1892f1ae59127f74afe8fd82fda6587794278d924e4d90ea3d63f9"},
"mix_test_watch": {:hex, :mix_test_watch, "1.1.0", "330bb91c8ed271fe408c42d07e0773340a7938d8a0d281d57a14243eae9dc8c3", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}], "hexpm", "52b6b1c476cbb70fd899ca5394506482f12e5f6b0d6acff9df95c7f1e0812ec3"},
"nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"},
"nimble_parsec": {:hex, :nimble_parsec, "1.3.1", "2c54013ecf170e249e9291ed0a62e5832f70a476c61da16f6aac6dca0189f2af", [:mix], [], "hexpm", "2682e3c0b2eb58d90c6375fc0cc30bc7be06f365bf72608804fb9cffa5e1b167"},
"nimble_pool": {:hex, :nimble_pool, "1.1.0", "bf9c29fbdcba3564a8b800d1eeb5a3c58f36e1e11d7b7fb2e084a643f645f06b", [:mix], [], "hexpm", "af2e4e6b34197db81f7aad230c1118eac993acc0dae6bc83bac0126d4ae0813a"},
"parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"},
"phoenix": {:hex, :phoenix, "1.7.7", "4cc501d4d823015007ba3cdd9c41ecaaf2ffb619d6fb283199fa8ddba89191e0", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "8966e15c395e5e37591b6ed0bd2ae7f48e961f0f60ac4c733f9566b519453085"},
"phoenix_ecto": {:hex, :phoenix_ecto, "4.4.0", "0672ed4e4808b3fbed494dded89958e22fb882de47a97634c0b13e7b0b5f7720", [:mix], [{:ecto, "~> 3.3", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "09864e558ed31ee00bd48fcc1d4fc58ae9678c9e81649075431e69dbabb43cc1"},
Expand All @@ -59,7 +64,8 @@
"plug_crypto": {:hex, :plug_crypto, "1.2.5", "918772575e48e81e455818229bf719d4ab4181fcbf7f85b68a35620f78d89ced", [:mix], [], "hexpm", "26549a1d6345e2172eb1c233866756ae44a9609bd33ee6f99147ab3fd87fd842"},
"postgrex": {:hex, :postgrex, "0.17.3", "c92cda8de2033a7585dae8c61b1d420a1a1322421df84da9a82a6764580c503d", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "946cf46935a4fdca7a81448be76ba3503cff082df42c6ec1ff16a4bdfbfb098d"},
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
"rustler": {:hex, :rustler, "0.31.0", "7e5eefe61e6e6f8901e5aa3de60073d360c6320d9ec363027b0197297b80c46a", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:toml, "~> 0.6", [hex: :toml, repo: "hexpm", optional: false]}], "hexpm", "99e378459bfb9c3bda6d3548b2b3bc6f9ad97f728f76bdbae7bf5c770a4f8abd"},
"req": {:hex, :req, "0.5.1", "90584216d064389a4ff2d4279fe2c11ff6c812ab00fa01a9fb9d15457f65ba70", [:mix], [{:brotli, "~> 0.3.1", [hex: :brotli, repo: "hexpm", optional: true]}, {:ezstd, "~> 1.0", [hex: :ezstd, repo: "hexpm", optional: true]}, {:finch, "~> 0.17", [hex: :finch, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mime, "~> 1.6 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:nimble_csv, "~> 1.0", [hex: :nimble_csv, repo: "hexpm", optional: true]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "7ea96a1a95388eb0fefa92d89466cdfedba24032794e5c1147d78ec90db7edca"},
"rustler": {:hex, :rustler, "0.34.0", "e9a73ee419fc296a10e49b415a2eb87a88c9217aa0275ec9f383d37eed290c1c", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:req, "~> 0.5", [hex: :req, repo: "hexpm", optional: false]}, {:toml, "~> 0.6", [hex: :toml, repo: "hexpm", optional: false]}], "hexpm", "1d0c7449482b459513003230c0e2422b0252245776fe6fd6e41cb2b11bd8e628"},
"sleeplocks": {:hex, :sleeplocks, "1.1.1", "3d462a0639a6ef36cc75d6038b7393ae537ab394641beb59830a1b8271faeed3", [:rebar3], [], "hexpm", "84ee37aeff4d0d92b290fff986d6a95ac5eedf9b383fadfd1d88e9b84a1c02e1"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"},
"stripity_stripe": {:hex, :stripity_stripe, "2.17.1", "0c8e2227921bc2654a3842be70b864ae86db3538c9f504d39a28730956ad65ba", [:mix], [{:hackney, "~> 1.15", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: true]}, {:uri_query, "~> 0.1.2", [hex: :uri_query, repo: "hexpm", optional: false]}], "hexpm", "20ca3b5517fd7b947a2f43fa3f4cde1100e0b32dcb571de5b702ec7bb40bfd91"},
Expand Down
20 changes: 20 additions & 0 deletions native/launchcart_formhandler_native/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[target.'cfg(target_os = "macos")']
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]

# See https://github.com/rust-lang/rust/issues/59302
[target.x86_64-unknown-linux-musl]
rustflags = [
"-C", "target-feature=-crt-static"
]

[target.aarch64-unknown-linux-musl]
rustflags = [
"-C", "target-feature=-crt-static"
]

# Provides a small build size, but takes more time to build.
[profile.release]
lto = true
1 change: 1 addition & 0 deletions native/launchcart_formhandler_native/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
Loading

0 comments on commit c4e1ce3

Please sign in to comment.