View Source MishkaInstaller.Installer.DepHandler (Mishka Installer v0.0.3)
A module that holds new dependencies' information, and add them into database or validating to implement in runtime
responsibilities-of-this-module
Responsibilities of this module
- Create
Json
- it helps developer to implement theire plugin/commponent into the project. - Add dependencies into database - for validating, stroing and keeping backup of runtime dependencies
- Get dependencies information in several different ways
for-example-these-are-output-from-json-file
For example, these are output from Json
file
[
%{
app: :mishka_installer,
version: "0.0.2",
type: :git, # :hex, if user upload elixir libraries (path), we should keep them in a temporary folder, and Docker should make it valume
url: "https://github.com/mishka-group/mishka_installer", # if it is hex: https://hex.pm/packages/mishka_installer
git_tag: "0.0.2", # we consider it when it is a git, and if does not exist we get master,
custom_command: "ecto.migrate", # you can write nil or you task file like ecto.migrate
dependency_type: :none, # :force_update, When you use this, the RunTime sourcing check what dependencies you use in your program have a higher version
#compared to the old source. it just notice admin there is a update, it does not force the source to be updated
dependencies: [ # this part let mishka_installer to know can update or not dependencies of a app, we should consider a backup file
%{app: :mishka_developer_tools, max: "0.0.2", min: "0.0.1"},
%{app: :mishka_social, max: "0.0.2", min: "0.0.1"}
]
}
]
OR
%MishkaInstaller.Installer.DepHandler{
app: "mishka_social",
version: "0.0.2 ",
type: "hex",
url: "https://hex.pm/packages/mishka_social",
git_tag: nil,
custom_command: nil,
dependency_type: "force_update",
dependencies: [
%{app: :phoenix, min: "1.6"},
%{app: :phoenix_live_view, max: "0.17.7", min: "0.17.7"},
%{app: :ueberauth, max: "0.17.7", min: "0.17.7"},
%{app: :ueberauth_github, min: "0.8.1"},
%{app: :ueberauth_google, min: "0.10.1"},
]
}
Link to this section Summary
Functions
## Run and Get a dependency
Link to this section Types
@type run() :: :hex | :git | :upload
Link to this section Functions
Link to this function
check_or_create_deps_json(project_path \\ MishkaInstaller.get_config(:project_path))
View Source
Link to this function
compare_dependencies_with_json(installed_apps \\ Application.loaded_applications())
View Source@spec compare_dependencies_with_json(installed_apps() | any()) :: list() | {:error, :compare_dependencies_with_json, String.t()}
Link to this function
compare_sub_dependencies_with_json(installed_apps \\ Application.loaded_applications())
View Source@spec create_mix_file() :: :ok
@spec extensions_json_path() :: binary()
@spec get_deps_from_mix_lock() :: list()
@spec mix_read_from_json() :: list()
## Run and Get a dependency
Application.spec(:timex, :vsn)
MishkaInstaller.Installer.DepHandler.run(:hex, "faker")
app = %{url: "https://github.com/bitwalker/timex", tag: "3.7.5"}
MishkaInstaller.Installer.DepHandler.run(:git, app)
app = %{url: "https://github.com/bitwalker/timex", tag: "3.7.6"}
MishkaInstaller.Installer.DepHandler.run(:git, app)
app = %{url: "https://github.com/bitwalker/timex", tag: "3.7.8"}
MishkaInstaller.Installer.DepHandler.run(:git, app)
app = %{url: "https://github.com/elixirs/faker", tag: "v0.17.0"}
MishkaInstaller.Installer.DepHandler.run(:git, app)
app = %{url: "https://github.com/martinsvalin/html_entities", tag: "v0.5.1"}
MishkaInstaller.Installer.DepHandler.run(:git, app)
app = %{url: "https://github.com/beatrichartz/csv", tag: "v2.3.0"}
MishkaInstaller.Installer.DepHandler.run(:git, app)
MishkaInstaller.Installer.DepHandler.run(:upload, ["../mishka_installer/deployment/extensions/timex-3.7.8.zip"])