diff --git a/sharing/index.md b/sharing/index.md index 57c5fad..79f575b 100644 --- a/sharing/index.md +++ b/sharing/index.md @@ -48,9 +48,20 @@ t("MyAwesomePackage") ``` Then, you simply need to push this new folder to the remote repository , and you're ready to go. + +The steps described above, including creation of a GitHub repo and pushing your project to it, can also be comfortably done with the help of [PackageMaker.jl](https://github.com/Eben60/PackageMaker.jl), which is a graphical wrapper around [PkgTemplates.jl](https://github.com/JuliaCI/PkgTemplates.jl) with a couple features of its own. + The rest of this post will explain to you what each part of this folder does, and how to bend them to your will. -To work on the package further, we develop it into the current environment and import it: +To work on the package further, we switch to it's environment or "develop" it into the current one, and then import it: + +```julia-repl +julia> using Pkg # remember, you can equivalently do all that from the pkg REPL after pressing ] + +julia> Pkg.activate(path="MyAwesomePackage") +``` + +or ```julia-repl julia> using Pkg diff --git a/writing/index.md b/writing/index.md index 88cbfbf..5606574 100644 --- a/writing/index.md +++ b/writing/index.md @@ -355,8 +355,8 @@ Once in an environment, the packages you `]add` will be listed in two files `som * `Manifest.toml` contains the exact versions of all direct and indirect dependencies If you haven't entered any local project, packages will be installed in the default environment, called `@v1.X` after the active version of Julia (note the `@` before the name). -Packages installed that way are available no matter which local environment is active, because of "environment stacking". -It is therefore recommended to keep the default environment very light, containing only essential development tools. +Packages installed that way are available no matter which local environment is active, because of "environment [stacking](https://docs.julialang.org/en/v1/manual/code-loading/#Environment-stacks)". +It is recommended to keep the default environment very light to avoid dependencies conflicts. It should contain only essential development tools. \vscode{ @@ -380,7 +380,7 @@ Once your code base grows beyond a few scripts, you will want to [create a packa The first advantage is that you don't need to specify the path of every file: `using MyPackage: myfunc` is enough to get access to the names you define. Furthermore, you can specify versions for your package and its dependencies, making your code easier and safer to reuse. -To create a new package locally, the easy way is to use `]generate` (we will discuss a more sophisticated workflow in the next blog post). +To create a new package locally, one easy way is to use `]generate`. We will discuss more sophisticated workflows, including a graphical tool, in the next blog post. ```>generate-package Pkg.generate(sitepath("MyPackage")); # ignore sitepath @@ -428,7 +428,7 @@ Whenever you edit a source file and hit save, the REPL will update its state acc \vscode{ -The Julia extension imports Revise.jl by default when it starts a REPL. +The Julia extension imports Revise.jl by default when it starts a REPL, provided it is installed in the default environment. } @@ -462,6 +462,9 @@ using MyPackage MyPackage.myfunc() ``` +For the common case of dependencies needed for interactive work only, [shared](https://pkgdocs.julialang.org/v1/environments/#Shared-environments) or [stacked](https://docs.julialang.org/en/v1/manual/code-loading/#Environment-stacks) environments are another practical solution. +[ShareAdd.jl](https://github.com/Eben60/ShareAdd.jl) can help you in using and managing these (see its documentation). + } ## Configuration