diff --git a/.credo.exs b/.credo.exs new file mode 100644 index 0000000..9965c2f --- /dev/null +++ b/.credo.exs @@ -0,0 +1,210 @@ +# This file contains the configuration for Credo and you are probably reading +# this after creating it with `mix credo.gen.config`. +# +# If you find anything wrong or unclear in this file, please report an +# issue on GitHub: https://github.com/rrrene/credo/issues +# +%{ + # + # You can have as many configs as you like in the `configs:` field. + configs: [ + %{ + # + # Run any config using `mix credo -C `. If no config name is given + # "default" is used. + # + name: "default", + # + # These are the files included in the analysis: + files: %{ + # + # You can give explicit globs or simply directories. + # In the latter case `**/*.{ex,exs}` will be used. + # + included: [ + "lib/", + "src/", + "test/", + "web/", + "apps/*/lib/", + "apps/*/src/", + "apps/*/test/", + "apps/*/web/" + ], + excluded: [~r"/_build/", ~r"/deps/", ~r"/node_modules/"] + }, + # + # Load and configure plugins here: + # + plugins: [], + # + # If you create your own checks, you must specify the source files for + # them here, so they can be loaded by Credo before running the analysis. + # + requires: [], + # + # If you want to enforce a style guide and need a more traditional linting + # experience, you can change `strict` to `true` below: + # + strict: false, + # + # To modify the timeout for parsing files, change this value: + # + parse_timeout: 5000, + # + # If you want to use uncolored output by default, you can change `color` + # to `false` below: + # + color: true, + # + # You can customize the parameters of any check by adding a second element + # to the tuple. + # + # To disable a check put `false` as second element: + # + # {Credo.Check.Design.DuplicatedCode, false} + # + checks: %{ + enabled: [ + # + ## Consistency Checks + # + {Credo.Check.Consistency.ExceptionNames, []}, + {Credo.Check.Consistency.LineEndings, []}, + {Credo.Check.Consistency.ParameterPatternMatching, []}, + {Credo.Check.Consistency.SpaceAroundOperators, []}, + {Credo.Check.Consistency.SpaceInParentheses, []}, + {Credo.Check.Consistency.TabsOrSpaces, []}, + + # + ## Design Checks + # + # You can customize the priority of any check + # Priority values are: `low, normal, high, higher` + # + {Credo.Check.Design.AliasUsage, + [priority: :low, if_nested_deeper_than: 2, if_called_more_often_than: 0]}, + # You can also customize the exit_status of each check. + # If you don't want TODO comments to cause `mix credo` to fail, just + # set this value to 0 (zero). + # + {Credo.Check.Design.TagTODO, [exit_status: 2]}, + {Credo.Check.Design.TagFIXME, []}, + + # + ## Readability Checks + # + {Credo.Check.Readability.AliasOrder, []}, + {Credo.Check.Readability.FunctionNames, []}, + {Credo.Check.Readability.LargeNumbers, []}, + {Credo.Check.Readability.MaxLineLength, [priority: :low, max_length: 120]}, + {Credo.Check.Readability.ModuleAttributeNames, []}, + {Credo.Check.Readability.ModuleDoc, []}, + {Credo.Check.Readability.ModuleNames, []}, + {Credo.Check.Readability.ParenthesesInCondition, []}, + {Credo.Check.Readability.ParenthesesOnZeroArityDefs, []}, + {Credo.Check.Readability.PipeIntoAnonymousFunctions, []}, + {Credo.Check.Readability.PredicateFunctionNames, []}, + {Credo.Check.Readability.PreferImplicitTry, []}, + {Credo.Check.Readability.RedundantBlankLines, []}, + {Credo.Check.Readability.Semicolons, []}, + {Credo.Check.Readability.SpaceAfterCommas, []}, + {Credo.Check.Readability.StringSigils, []}, + {Credo.Check.Readability.TrailingBlankLine, []}, + {Credo.Check.Readability.TrailingWhiteSpace, []}, + {Credo.Check.Readability.UnnecessaryAliasExpansion, []}, + {Credo.Check.Readability.VariableNames, []}, + {Credo.Check.Readability.WithSingleClause, []}, + + # + ## Refactoring Opportunities + # + {Credo.Check.Refactor.Apply, []}, + {Credo.Check.Refactor.CondStatements, []}, + {Credo.Check.Refactor.CyclomaticComplexity, []}, + {Credo.Check.Refactor.FunctionArity, []}, + {Credo.Check.Refactor.LongQuoteBlocks, []}, + {Credo.Check.Refactor.MatchInCondition, []}, + {Credo.Check.Refactor.MapJoin, []}, + {Credo.Check.Refactor.NegatedConditionsInUnless, []}, + {Credo.Check.Refactor.NegatedConditionsWithElse, []}, + {Credo.Check.Refactor.Nesting, []}, + {Credo.Check.Refactor.UnlessWithElse, []}, + {Credo.Check.Refactor.WithClauses, []}, + {Credo.Check.Refactor.FilterFilter, []}, + {Credo.Check.Refactor.RejectReject, []}, + {Credo.Check.Refactor.RedundantWithClauseResult, []}, + + # + ## Warnings + # + {Credo.Check.Warning.ApplicationConfigInModuleAttribute, []}, + {Credo.Check.Warning.BoolOperationOnSameValues, []}, + {Credo.Check.Warning.ExpensiveEmptyEnumCheck, []}, + {Credo.Check.Warning.IExPry, []}, + {Credo.Check.Warning.IoInspect, []}, + {Credo.Check.Warning.OperationOnSameValues, []}, + {Credo.Check.Warning.OperationWithConstantResult, []}, + {Credo.Check.Warning.RaiseInsideRescue, []}, + {Credo.Check.Warning.SpecWithStruct, []}, + {Credo.Check.Warning.WrongTestFileExtension, []}, + {Credo.Check.Warning.UnusedEnumOperation, []}, + {Credo.Check.Warning.UnusedFileOperation, []}, + {Credo.Check.Warning.UnusedKeywordOperation, []}, + {Credo.Check.Warning.UnusedListOperation, []}, + {Credo.Check.Warning.UnusedPathOperation, []}, + {Credo.Check.Warning.UnusedRegexOperation, []}, + {Credo.Check.Warning.UnusedStringOperation, []}, + {Credo.Check.Warning.UnusedTupleOperation, []}, + {Credo.Check.Warning.UnsafeExec, []} + ], + disabled: [ + # + # Checks scheduled for next check update (opt-in for now, just replace `false` with `[]`) + + # + # Controversial and experimental checks (opt-in, just move the check to `:enabled` + # and be sure to use `mix credo --strict` to see low priority checks) + # + {Credo.Check.Consistency.MultiAliasImportRequireUse, []}, + {Credo.Check.Consistency.UnusedVariableNames, []}, + {Credo.Check.Design.DuplicatedCode, []}, + {Credo.Check.Design.SkipTestWithoutComment, []}, + {Credo.Check.Readability.AliasAs, []}, + {Credo.Check.Readability.BlockPipe, []}, + {Credo.Check.Readability.ImplTrue, []}, + {Credo.Check.Readability.MultiAlias, []}, + {Credo.Check.Readability.NestedFunctionCalls, []}, + {Credo.Check.Readability.SeparateAliasRequire, []}, + {Credo.Check.Readability.SingleFunctionToBlockPipe, []}, + {Credo.Check.Readability.SinglePipe, []}, + {Credo.Check.Readability.Specs, []}, + {Credo.Check.Readability.StrictModuleLayout, []}, + {Credo.Check.Readability.WithCustomTaggedTuple, []}, + {Credo.Check.Refactor.ABCSize, []}, + {Credo.Check.Refactor.AppendSingleItem, []}, + {Credo.Check.Refactor.DoubleBooleanNegation, []}, + {Credo.Check.Refactor.FilterReject, []}, + {Credo.Check.Refactor.IoPuts, []}, + {Credo.Check.Refactor.MapMap, []}, + {Credo.Check.Refactor.ModuleDependencies, []}, + {Credo.Check.Refactor.NegatedIsNil, []}, + {Credo.Check.Refactor.PipeChainStart, []}, + {Credo.Check.Refactor.RejectFilter, []}, + {Credo.Check.Refactor.VariableRebinding, []}, + {Credo.Check.Warning.LazyLogging, []}, + {Credo.Check.Warning.LeakyEnvironment, []}, + {Credo.Check.Warning.MapGetUnsafePass, []}, + {Credo.Check.Warning.MixEnv, []}, + {Credo.Check.Warning.UnsafeToAtom, []} + + # {Credo.Check.Refactor.MapInto, []}, + + # + # Custom checks can be created using `mix credo.gen.check`. + # + ] + } + } + ] +} diff --git a/.gitignore b/.gitignore index eb8b921..21f8dc5 100644 --- a/.gitignore +++ b/.gitignore @@ -31,4 +31,5 @@ reaproche-*.tar # In case you use Node.js/npm, you want to ignore these. npm-debug.log /assets/node_modules/ - +/.idea/ +reaproche.iml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/libraries/bypass.xml b/.idea/libraries/bypass.xml deleted file mode 100644 index 9642c9f..0000000 --- a/.idea/libraries/bypass.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/castore.xml b/.idea/libraries/castore.xml deleted file mode 100644 index 07c456f..0000000 --- a/.idea/libraries/castore.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/circular_buffer.xml b/.idea/libraries/circular_buffer.xml deleted file mode 100644 index 5a328c8..0000000 --- a/.idea/libraries/circular_buffer.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/cowboy.xml b/.idea/libraries/cowboy.xml deleted file mode 100644 index 7969c4d..0000000 --- a/.idea/libraries/cowboy.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/cowboy_telemetry.xml b/.idea/libraries/cowboy_telemetry.xml deleted file mode 100644 index 72aa021..0000000 --- a/.idea/libraries/cowboy_telemetry.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/cowlib.xml b/.idea/libraries/cowlib.xml deleted file mode 100644 index b8a9d1f..0000000 --- a/.idea/libraries/cowlib.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/dialyxir.xml b/.idea/libraries/dialyxir.xml deleted file mode 100644 index 51fbcb5..0000000 --- a/.idea/libraries/dialyxir.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/ecto.xml b/.idea/libraries/ecto.xml deleted file mode 100644 index c4a4e9e..0000000 --- a/.idea/libraries/ecto.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/ecto_mysql_extras.xml b/.idea/libraries/ecto_mysql_extras.xml deleted file mode 100644 index 7f56f56..0000000 --- a/.idea/libraries/ecto_mysql_extras.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/ecto_psql_extras.xml b/.idea/libraries/ecto_psql_extras.xml deleted file mode 100644 index c5cf8ef..0000000 --- a/.idea/libraries/ecto_psql_extras.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/ecto_sql.xml b/.idea/libraries/ecto_sql.xml deleted file mode 100644 index d6e8c96..0000000 --- a/.idea/libraries/ecto_sql.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/esbuild.xml b/.idea/libraries/esbuild.xml deleted file mode 100644 index 3350038..0000000 --- a/.idea/libraries/esbuild.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/ex_doc.xml b/.idea/libraries/ex_doc.xml deleted file mode 100644 index 98baa95..0000000 --- a/.idea/libraries/ex_doc.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/excoveralls.xml b/.idea/libraries/excoveralls.xml deleted file mode 100644 index a16b779..0000000 --- a/.idea/libraries/excoveralls.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/file_system.xml b/.idea/libraries/file_system.xml deleted file mode 100644 index 8411bd4..0000000 --- a/.idea/libraries/file_system.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/finch.xml b/.idea/libraries/finch.xml deleted file mode 100644 index 565f063..0000000 --- a/.idea/libraries/finch.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/floki.xml b/.idea/libraries/floki.xml deleted file mode 100644 index 7743231..0000000 --- a/.idea/libraries/floki.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/gen_smtp.xml b/.idea/libraries/gen_smtp.xml deleted file mode 100644 index ab93561..0000000 --- a/.idea/libraries/gen_smtp.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/gettext.xml b/.idea/libraries/gettext.xml deleted file mode 100644 index b4922d1..0000000 --- a/.idea/libraries/gettext.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/hackney.xml b/.idea/libraries/hackney.xml deleted file mode 100644 index 0fe048e..0000000 --- a/.idea/libraries/hackney.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/html_entities.xml b/.idea/libraries/html_entities.xml deleted file mode 100644 index b59be27..0000000 --- a/.idea/libraries/html_entities.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/jason.xml b/.idea/libraries/jason.xml deleted file mode 100644 index 0ab097c..0000000 --- a/.idea/libraries/jason.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/kadabra.xml b/.idea/libraries/kadabra.xml deleted file mode 100644 index 0f3b970..0000000 --- a/.idea/libraries/kadabra.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/mail.xml b/.idea/libraries/mail.xml deleted file mode 100644 index b278f06..0000000 --- a/.idea/libraries/mail.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/makeup_eex.xml b/.idea/libraries/makeup_eex.xml deleted file mode 100644 index 13af2e3..0000000 --- a/.idea/libraries/makeup_eex.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/mime.xml b/.idea/libraries/mime.xml deleted file mode 100644 index 71a9666..0000000 --- a/.idea/libraries/mime.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/phoenix.xml b/.idea/libraries/phoenix.xml deleted file mode 100644 index f1f6de6..0000000 --- a/.idea/libraries/phoenix.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/phoenix_html.xml b/.idea/libraries/phoenix_html.xml deleted file mode 100644 index 1058283..0000000 --- a/.idea/libraries/phoenix_html.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/phoenix_live_dashboard.xml b/.idea/libraries/phoenix_live_dashboard.xml deleted file mode 100644 index fb6fd2f..0000000 --- a/.idea/libraries/phoenix_live_dashboard.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/phoenix_live_reload.xml b/.idea/libraries/phoenix_live_reload.xml deleted file mode 100644 index d22856f..0000000 --- a/.idea/libraries/phoenix_live_reload.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/phoenix_live_view.xml b/.idea/libraries/phoenix_live_view.xml deleted file mode 100644 index f5dcab6..0000000 --- a/.idea/libraries/phoenix_live_view.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/phoenix_pubsub.xml b/.idea/libraries/phoenix_pubsub.xml deleted file mode 100644 index fe80d8e..0000000 --- a/.idea/libraries/phoenix_pubsub.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/phoenix_view.xml b/.idea/libraries/phoenix_view.xml deleted file mode 100644 index 35f3c55..0000000 --- a/.idea/libraries/phoenix_view.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/phx_new.xml b/.idea/libraries/phx_new.xml deleted file mode 100644 index dd43812..0000000 --- a/.idea/libraries/phx_new.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/plug.xml b/.idea/libraries/plug.xml deleted file mode 100644 index 6279622..0000000 --- a/.idea/libraries/plug.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/plug_cowboy.xml b/.idea/libraries/plug_cowboy.xml deleted file mode 100644 index f35a91b..0000000 --- a/.idea/libraries/plug_cowboy.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/plug_crypto.xml b/.idea/libraries/plug_crypto.xml deleted file mode 100644 index 9807fd3..0000000 --- a/.idea/libraries/plug_crypto.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/ranch.xml b/.idea/libraries/ranch.xml deleted file mode 100644 index 8356fe7..0000000 --- a/.idea/libraries/ranch.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/stream_data.xml b/.idea/libraries/stream_data.xml deleted file mode 100644 index 226e1cc..0000000 --- a/.idea/libraries/stream_data.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/swoosh.xml b/.idea/libraries/swoosh.xml deleted file mode 100644 index 0a35fe8..0000000 --- a/.idea/libraries/swoosh.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/telemetry.xml b/.idea/libraries/telemetry.xml deleted file mode 100644 index 3a58262..0000000 --- a/.idea/libraries/telemetry.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/telemetry_metrics.xml b/.idea/libraries/telemetry_metrics.xml deleted file mode 100644 index dd01407..0000000 --- a/.idea/libraries/telemetry_metrics.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/telemetry_poller.xml b/.idea/libraries/telemetry_poller.xml deleted file mode 100644 index 2cf091d..0000000 --- a/.idea/libraries/telemetry_poller.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/websocket_client.xml b/.idea/libraries/websocket_client.xml deleted file mode 100644 index 4eb4883..0000000 --- a/.idea/libraries/websocket_client.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/x509.xml b/.idea/libraries/x509.xml deleted file mode 100644 index b5bf8ac..0000000 --- a/.idea/libraries/x509.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 5790d2c..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 4f760c6..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/assets/js/app.js b/assets/js/app.js index 2ca06a5..fe9cb1f 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -1,6 +1,7 @@ // We import the CSS which is extracted to its own file by esbuild. // Remove this line if you add a your own CSS build pipeline (e.g postcss). import "../css/app.css" +import Alpine from "alpinejs" // If you want to use Phoenix channels, run `mix help phx.gen.channel` // to get started and then uncomment the line below. @@ -25,10 +26,21 @@ import "phoenix_html" import {Socket} from "phoenix" import {LiveSocket} from "phoenix_live_view" import topbar from "../vendor/topbar" - +window.Alpine = Alpine; +Alpine.start(); +let hooks = {}; let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content") -let liveSocket = new LiveSocket("/live", Socket, {params: {_csrf_token: csrfToken}}) - +let liveSocket = new LiveSocket("/live", Socket, { + params: { _csrf_token: csrfToken }, + hooks: hooks, + dom: { + onBeforeElUpdated(from, to) { + if (from._x_dataStack) { + window.Alpine.clone(from, to); + } + }, + }, +}); // Show progress bar on live navigation and form submits topbar.config({barColors: {0: "#29d"}, shadowColor: "rgba(0, 0, 0, .3)"}) window.addEventListener("phx:page-loading-start", info => topbar.show()) diff --git a/assets/package.json b/assets/package.json new file mode 100644 index 0000000..decc8da --- /dev/null +++ b/assets/package.json @@ -0,0 +1,15 @@ +{ + "name": "assets", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "alpinejs": "^3.10.2" + } +} diff --git a/assets/pnpm-lock.yaml b/assets/pnpm-lock.yaml new file mode 100644 index 0000000..a348c94 --- /dev/null +++ b/assets/pnpm-lock.yaml @@ -0,0 +1,25 @@ +lockfileVersion: 5.4 + +specifiers: + alpinejs: ^3.10.2 + +dependencies: + alpinejs: 3.10.2 + +packages: + + /@vue/reactivity/3.1.5: + resolution: {integrity: sha512-1tdfLmNjWG6t/CsPldh+foumYFo3cpyCHgBYQ34ylaMsJ+SNHQ1kApMIa8jN+i593zQuaw3AdWH0nJTARzCFhg==} + dependencies: + '@vue/shared': 3.1.5 + dev: false + + /@vue/shared/3.1.5: + resolution: {integrity: sha512-oJ4F3TnvpXaQwZJNF3ZK+kLPHKarDmJjJ6jyzVNDKH9md1dptjC7lWR//jrGuLdek/U6iltWxqAnYOu8gCiOvA==} + dev: false + + /alpinejs/3.10.2: + resolution: {integrity: sha512-P6DTX78J94FgsskS3eS23s26hfb0NWQZUidBnkUK7fId1x64/kLm5E79lL3HNItUmHDCKOHvfP8EAcuCVab89w==} + dependencies: + '@vue/reactivity': 3.1.5 + dev: false diff --git a/lib/reaproche_web/templates/layout/root.html.heex b/lib/reaproche_web/templates/layout/root.html.heex index 7ad1dea..51f5b7c 100644 --- a/lib/reaproche_web/templates/layout/root.html.heex +++ b/lib/reaproche_web/templates/layout/root.html.heex @@ -20,7 +20,7 @@ <% end %> - diff --git a/lib/reaproche_web/templates/page/index.html.heex b/lib/reaproche_web/templates/page/index.html.heex index 88ce6a5..2d96570 100644 --- a/lib/reaproche_web/templates/page/index.html.heex +++ b/lib/reaproche_web/templates/page/index.html.heex @@ -40,4 +40,12 @@ +
+

Alpine JS Installed

+
+ + +


Output:

+
+
diff --git a/mix.exs b/mix.exs index 6252563..2d9c3a8 100644 --- a/mix.exs +++ b/mix.exs @@ -45,7 +45,8 @@ defmodule Reaproche.MixProject do {:telemetry_poller, "~> 1.0"}, {:gettext, "~> 0.18"}, {:jason, "~> 1.2"}, - {:plug_cowboy, "~> 2.5"} + {:plug_cowboy, "~> 2.5"}, + {:credo, "~> 1.6"} ] end diff --git a/mix.lock b/mix.lock index 1c1c13d..700e3f6 100644 --- a/mix.lock +++ b/mix.lock @@ -1,8 +1,10 @@ %{ + "bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"}, "castore": {:hex, :castore, "0.1.16", "2675f717adc700475345c5512c381ef9273eb5df26bdd3f8c13e2636cf4cc175", [:mix], [], "hexpm", "28ed2c43d83b5c25d35c51bc0abf229ac51359c170cba76171a462ced2e4b651"}, "cowboy": {:hex, :cowboy, "2.9.0", "865dd8b6607e14cf03282e10e934023a1bd8be6f6bacf921a7e2a96d800cd452", [:make, :rebar3], [{:cowlib, "2.11.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "2c729f934b4e1aa149aff882f57c6372c15399a20d54f65c8d67bef583021bde"}, "cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"}, "cowlib": {:hex, :cowlib, "2.11.0", "0b9ff9c346629256c42ebe1eeb769a83c6cb771a6ee5960bd110ab0b9b872063", [:make, :rebar3], [], "hexpm", "2b3e9da0b21c4565751a6d4901c20d1b4cc25cbb7fd50d91d2ab6dd287bc86a9"}, + "credo": {:hex, :credo, "1.6.4", "ddd474afb6e8c240313f3a7b0d025cc3213f0d171879429bf8535d7021d9ad78", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "c28f910b61e1ff829bffa056ef7293a8db50e87f2c57a9b5c3f57eee124536b7"}, "esbuild": {:hex, :esbuild, "0.4.0", "9f17db148aead4cf1e6e6a584214357287a93407b5fb51a031f122b61385d4c2", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}], "hexpm", "b61e4e6b92ffe45e4ee4755a22de6211a67c67987dc02afb35a425a0add1d447"}, "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, "floki": {:hex, :floki, "0.32.1", "dfe3b8db3b793939c264e6f785bca01753d17318d144bd44b407fb3493acaa87", [:mix], [{:html_entities, "~> 0.5.0", [hex: :html_entities, repo: "hexpm", optional: false]}], "hexpm", "d4b91c713e4a784a3f7b1e3cc016eefc619f6b1c3898464222867cafd3c681a3"}, diff --git a/reaproche.iml b/reaproche.iml deleted file mode 100644 index 1bfdd85..0000000 --- a/reaproche.iml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file