Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion sharing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,20 @@ t("MyAwesomePackage")
```

Then, you simply need to push this new folder to the remote repository <https://github.com/myuser/MyAwesomePackage.jl>, 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
Expand Down
11 changes: 7 additions & 4 deletions writing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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{

Expand All @@ -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
Expand Down Expand Up @@ -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.

}

Expand Down Expand Up @@ -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
Expand Down