chore: various fixes/improvements

This commit is contained in:
Zach Daniel 2022-09-27 14:19:19 -04:00
parent 5ac9513526
commit e725df6c1e
13 changed files with 24 additions and 22 deletions

View file

@ -7,7 +7,6 @@
"{config,lib,test}/**/*.{ex,exs}"
],
subdirectories: ["priv/*/migrations"],
plugins: [Spark.Formatter, Surface.Formatter.Plugin],
locals_without_parens: [
auto_sanitize_name_attribute?: 1,
name_attribute: 1,

View file

@ -14,6 +14,7 @@
"900": "#000000"
},
"base-light": {
"DEFAULT": "#6b7280",
"50": "#f9fafb",
"100": "#f3f4f6",
"200": "#e5e7eb",

View file

@ -16,8 +16,8 @@ processes = []
protocol = "tcp"
[services.concurrency]
hard_limit = 25
soft_limit = 20
hard_limit = 10000
soft_limit = 9000
[[services.ports]]
handlers = ["http"]

View file

@ -11,7 +11,7 @@ defmodule AshHq.Accounts.User.Changes.RemoveAllTokens do
Ash.Changeset.after_action(changeset, fn _changeset, user ->
{:ok, query} =
AshHq.Accounts.UserToken
|> Ash.Query.filter(token.user_id == ^user.id)
|> Ash.Query.filter(user_id == ^user.id)
|> Ash.Query.data_layer_query()
AshHq.Repo.delete_all(query)

View file

@ -26,7 +26,7 @@ defmodule AshHq.Accounts.UserToken do
argument :user, :map
change manage_relationship(:user, type: :replace)
change manage_relationship(:user, type: :append_and_remove)
change set_attribute(:context, "session")
change AshHq.Accounts.UserToken.Changes.BuildSessionToken
end
@ -36,7 +36,7 @@ defmodule AshHq.Accounts.UserToken do
argument :user, :map
change manage_relationship(:user, type: :replace)
change manage_relationship(:user, type: :append_and_remove)
change AshHq.Accounts.UserToken.Changes.BuildHashedToken
end
end

View file

@ -59,7 +59,7 @@ defmodule AshHq.Docs.Dsl do
change {AshHq.Docs.Changes.AddArgToRelationship, arg: :library_version, rel: :options}
change manage_relationship(:options, type: :direct_control)
change manage_relationship(:library_version, type: :replace)
change manage_relationship(:library_version, type: :append_and_remove)
end
end

View file

@ -48,7 +48,7 @@ defmodule AshHq.Docs.Extension do
end
argument :dsls, {:array, :map}
change manage_relationship(:library_version, type: :replace)
change manage_relationship(:library_version, type: :append_and_remove)
change {AshHq.Docs.Changes.AddArgToRelationship, arg: :library_version, rel: :dsls}
change {AshHq.Docs.Changes.AddArgToRelationship,

View file

@ -92,7 +92,7 @@ defmodule AshHq.Docs.Function do
primary? true
argument :library_version, :uuid
change manage_relationship(:library_version, type: :replace)
change manage_relationship(:library_version, type: :append_and_remove)
end
end

View file

@ -77,7 +77,7 @@ defmodule AshHq.Docs.LibraryVersion do
attr: :id, arg: :library_version, rel: :extensions, generate: &Ash.UUID.generate/0}
change manage_relationship(:guides, type: :create)
change manage_relationship(:library, type: :replace)
change manage_relationship(:library, type: :append_and_remove)
change manage_relationship(:modules, type: :create)
change manage_relationship(:extensions, type: :create)
end

View file

@ -74,7 +74,7 @@ defmodule AshHq.Docs.Module do
change {AshHq.Docs.Changes.AddArgToRelationship, arg: :library_version, rel: :functions}
change manage_relationship(:functions, type: :direct_control)
change manage_relationship(:library_version, type: :replace)
change manage_relationship(:library_version, type: :append_and_remove)
end
end

View file

@ -94,8 +94,8 @@ defmodule AshHq.Docs.Option do
allow_nil? false
end
change manage_relationship(:extension_id, :extension, type: :replace)
change manage_relationship(:library_version, type: :replace)
change manage_relationship(:extension_id, :extension, type: :append_and_remove)
change manage_relationship(:library_version, type: :append_and_remove)
end
end

10
mix.exs
View file

@ -33,8 +33,10 @@ defmodule AshHq.MixProject do
# Type `mix help deps` for examples and options.
defp deps do
[
{:ash, "~> 2.0.0-rc.7"},
{:ash, github: "ash-project/ash", override: true},
# {:ash, "~> 2.0.0-rc.8"},
# {:ash, path: "../ash", override: true},
# {:ash_postgres, "~> 1.0.0-rc.3"},
{:ash_postgres, github: "ash-project/ash_postgres"},
# {:ash_postgres, path: "../ash_postgres"},
@ -44,10 +46,10 @@ defmodule AshHq.MixProject do
{:absinthe_plug, "~> 1.5"},
# {:ash_phoenix, github: "ash-project/ash_phoenix", branch: "ash-2.0", override: true},
# {:ash_livebook, path: "../ash_livebook", only: [:dev]},
# {:spark, "~> 0.1"},
{:spark, path: "../spark", override: true},
{:spark, "~> 0.1"},
# {:spark, path: "../spark", override: true},
{:earmark, "~> 1.5.0-pre1", override: true},
{:surface, "~> 0.8.1"},
{:surface, "== 0.8.1"},
{:surface_heroicons, "~> 0.6.0"},
# Syntax Highlighting
{:makeup, "~> 1.1"},

View file

@ -1,8 +1,8 @@
%{
"absinthe": {:hex, :absinthe, "1.7.0", "36819e7b1fd5046c9c734f27fe7e564aed3bda59f0354c37cd2df88fd32dd014", [:mix], [{:dataloader, "~> 1.0.0", [hex: :dataloader, repo: "hexpm", optional: true]}, {:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}, {:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0 or ~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "566a5b5519afc9b29c4d367f0c6768162de3ec03e9bf9916f9dc2bcbe7c09643"},
"absinthe_plug": {:hex, :absinthe_plug, "1.5.8", "38d230641ba9dca8f72f1fed2dfc8abd53b3907d1996363da32434ab6ee5d6ab", [:mix], [{:absinthe, "~> 1.5", [hex: :absinthe, repo: "hexpm", optional: false]}, {:plug, "~> 1.4", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "bbb04176647b735828861e7b2705465e53e2cf54ccf5a73ddd1ebd855f996e5a"},
"ash": {:hex, :ash, "2.0.0-rc.7", "5e75f13034b6d3cbfbb0e4c0e3cadfbb6b391bdf08db47294a328be885bb22cb", [:mix], [{:comparable, "~> 1.0", [hex: :comparable, repo: "hexpm", optional: false]}, {:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:earmark, "~> 1.4", [hex: :earmark, repo: "hexpm", optional: true]}, {:ecto, "~> 3.7", [hex: :ecto, repo: "hexpm", optional: false]}, {:ets, "~> 0.8.0", [hex: :ets, repo: "hexpm", optional: false]}, {:jason, ">= 1.0.0", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:picosat_elixir, "~> 0.2", [hex: :picosat_elixir, repo: "hexpm", optional: false]}, {:spark, "~> 0.1 and >= 0.1.9", [hex: :spark, repo: "hexpm", optional: false]}, {:stream_data, "~> 0.5.0", [hex: :stream_data, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.1", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "dbff72557272e390a8ebeb879406d7e2dd93418093939ea778afdb7a8d5dc80c"},
"ash_graphql": {:git, "https://github.com/ash-project/ash_graphql.git", "b4dc207ed8834840c049c5baff65c53b3fc0a598", []},
"ash": {:git, "https://github.com/ash-project/ash.git", "8f1a43419b2a701b49b23ba6585171829077b35e", []},
"ash_graphql": {:git, "https://github.com/ash-project/ash_graphql.git", "d859026ddb11b2d359cab29641257aeed303743b", []},
"ash_phoenix": {:git, "https://github.com/ash-project/ash_phoenix.git", "75f07d12358b3473c4780c51333ef44aedf4c839", []},
"ash_postgres": {:git, "https://github.com/ash-project/ash_postgres.git", "0fa1ee05f4a6ba5461394dfef096ed8f9c1ada57", []},
"bcrypt_elixir": {:hex, :bcrypt_elixir, "3.0.1", "9be815469e6bfefec40fa74658ecbbe6897acfb57614df1416eeccd4903f602c", [:make, :mix], [{:comeonin, "~> 5.3", [hex: :comeonin, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "486bb95efb645d1efc6794c1ddd776a186a9a713abf06f45708a6ce324fb96cf"},
@ -70,7 +70,7 @@
"phoenix_html": {:hex, :phoenix_html, "3.2.0", "1c1219d4b6cb22ac72f12f73dc5fad6c7563104d083f711c3fcd8551a1f4ae11", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "36ec97ba56d25c0136ef1992c37957e4246b649d620958a1f9fa86165f8bc54f"},
"phoenix_live_dashboard": {:hex, :phoenix_live_dashboard, "0.6.5", "1495bb014be12c9a9252eca04b9af54246f6b5c1e4cd1f30210cd00ec540cf8e", [:mix], [{:ecto, "~> 3.6.2 or ~> 3.7", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_mysql_extras, "~> 0.3", [hex: :ecto_mysql_extras, repo: "hexpm", optional: true]}, {:ecto_psql_extras, "~> 0.7", [hex: :ecto_psql_extras, repo: "hexpm", optional: true]}, {:mime, "~> 1.6 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.17.7", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:telemetry_metrics, "~> 0.6.0", [hex: :telemetry_metrics, repo: "hexpm", optional: false]}], "hexpm", "ef4fa50dd78364409039c99cf6f98ab5209b4c5f8796c17f4db118324f0db852"},
"phoenix_live_reload": {:hex, :phoenix_live_reload, "1.3.3", "3a53772a6118d5679bf50fc1670505a290e32a1d195df9e069d8c53ab040c054", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "766796676e5f558dbae5d1bdb066849673e956005e3730dfd5affd7a6da4abac"},
"phoenix_live_view": {:hex, :phoenix_live_view, "0.17.11", "205f6aa5405648c76f2abcd57716f42fc07d8f21dd8ea7b262dd12b324b50c95", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.1", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7177791944b7f90ed18f5935a6a5f07f760b36f7b3bdfb9d28c57440a3c43f99"},
"phoenix_live_view": {:hex, :phoenix_live_view, "0.17.12", "74f4c0ad02d7deac2d04f50b52827a5efdc5c6e7fac5cede145f5f0e4183aedc", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.0 or ~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.1", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "af6dd5e0aac16ff43571f527a8e0616d62cb80b10eb87aac82170243e50d99c8"},
"phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.1", "ba04e489ef03763bf28a17eb2eaddc2c20c6d217e2150a61e3298b0f4c2012b5", [:mix], [], "hexpm", "81367c6d1eea5878ad726be80808eb5a787a23dee699f96e72b1109c57cdd8d9"},
"phoenix_view": {:hex, :phoenix_view, "1.1.2", "1b82764a065fb41051637872c7bd07ed2fdb6f5c3bd89684d4dca6e10115c95a", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "7ae90ad27b09091266f6adbb61e1d2516a7c3d7062c6789d46a7554ec40f3a56"},
"picosat_elixir": {:hex, :picosat_elixir, "0.2.2", "1cacfdb4fb0c3ead5e5e9b1e98ac822a777f07eab35e29c3f8fc7086de2bfb36", [:make, :mix], [{:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "9d0cc569552cca417abea8270a54b71153a63be4b951ff249e94642f1c0f35d1"},
@ -84,10 +84,10 @@
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
"sobelow": {:hex, :sobelow, "0.11.1", "23438964486f8112b41e743bbfd402da3e5b296fdc9eacab29914b79c48916dd", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "9897363a7eff96f4809304a90aad819e2ad5e5d24db547af502885146746a53c"},
"sourceror": {:hex, :sourceror, "0.11.2", "549ce48be666421ac60cfb7f59c8752e0d393baa0b14d06271d3f6a8c1b027ab", [:mix], [], "hexpm", "9ab659118896a36be6eec68ff7b0674cba372fc8e210b1e9dc8cf2b55bb70dfb"},
"spark": {:hex, :spark, "0.1.23", "7142c0658a80079304cc8e5bc18e4921ebcd08393c3774d6295cec3b417968ce", [:mix], [{:nimble_options, "~> 0.4.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:sourceror, "~> 0.1", [hex: :sourceror, repo: "hexpm", optional: false]}], "hexpm", "5a430e6ed95423ad0daaeb01b7c7edcc1e0b954094f5e2e65834d33fe8347202"},
"spark": {:hex, :spark, "0.1.25", "7890f76fd3f32fa588df1c69ae249855b8439d218a7877434a4841aa5d16b41a", [:mix], [{:nimble_options, "~> 0.4.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:sourceror, "~> 0.1", [hex: :sourceror, repo: "hexpm", optional: false]}], "hexpm", "dcdf52b0bc9a1f29ba571547f6d6ad8eecd8458040f896a82f050986d1ae66ac"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"},
"stream_data": {:hex, :stream_data, "0.5.0", "b27641e58941685c75b353577dc602c9d2c12292dd84babf506c2033cd97893e", [:mix], [], "hexpm", "012bd2eec069ada4db3411f9115ccafa38540a3c78c4c0349f151fc761b9e271"},
"surface": {:hex, :surface, "0.8.2", "4ade1007e73cfb3bcdce5d5010ec8e9bd7fe1f1b450a566bb17c78cdb27ed44c", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.17.6", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:sourceror, "~> 0.11", [hex: :sourceror, repo: "hexpm", optional: false]}], "hexpm", "418497e57c84a24e0a6ec11ed29774fed857260246d5afb75847d9ba287021cb"},
"surface": {:hex, :surface, "0.8.1", "3228df8a82fea8daf8daefaa343b30be04d524ae41c657f5c5bb9ea4f711fc28", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.17.6", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:sourceror, "~> 0.9", [hex: :sourceror, repo: "hexpm", optional: false]}], "hexpm", "8a824660bc7a4cc4dd77ca986591b2935f27f6de01332df41ec3f5335213d114"},
"surface_heroicons": {:hex, :surface_heroicons, "0.6.0", "04e171843439d2d52c868f8adf5294c49505f504a74a0200179e49c447d6f354", [:mix], [{:surface, ">= 0.5.0", [hex: :surface, repo: "hexpm", optional: false]}], "hexpm", "1136c88a8de44a63c050cec9b0b64f771127dfd96feabab4cd0bde8b6b727ba2"},
"swoosh": {:hex, :swoosh, "1.7.4", "f967d9b2659e81bab241b96267aae1001d35c2beea2df9c03dcf47b007bf566f", [:mix], [{:cowboy, "~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:ex_aws, "~> 2.1", [hex: :ex_aws, repo: "hexpm", optional: true]}, {:finch, "~> 0.6", [hex: :finch, repo: "hexpm", optional: true]}, {:gen_smtp, "~> 0.13 or ~> 1.0", [hex: :gen_smtp, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mail, "~> 0.2", [hex: :mail, repo: "hexpm", optional: true]}, {:mime, "~> 1.1 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_cowboy, ">= 1.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "1553d994b4cf069162965e63de1e1c53d8236e127118d21e56ce2abeaa3f25b4"},
"table_rex": {:hex, :table_rex, "3.1.1", "0c67164d1714b5e806d5067c1e96ff098ba7ae79413cc075973e17c38a587caa", [:mix], [], "hexpm", "678a23aba4d670419c23c17790f9dcd635a4a89022040df7d5d772cb21012490"},