Skip to content

Commit 86474bc

Browse files
authored
Add refs to ShareAdd.jl and PackageMaker.jl (#137)
1 parent 6fb3004 commit 86474bc

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

sharing/index.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,20 @@ t("MyAwesomePackage")
4848
```
4949

5050
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.
51+
52+
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.
53+
5154
The rest of this post will explain to you what each part of this folder does, and how to bend them to your will.
5255

53-
To work on the package further, we develop it into the current environment and import it:
56+
To work on the package further, we switch to it's environment or "develop" it into the current one, and then import it:
57+
58+
```julia-repl
59+
julia> using Pkg # remember, you can equivalently do all that from the pkg REPL after pressing ]
60+
61+
julia> Pkg.activate(path="MyAwesomePackage")
62+
```
63+
64+
or
5465

5566
```julia-repl
5667
julia> using Pkg

writing/index.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,8 @@ Once in an environment, the packages you `]add` will be listed in two files `som
355355
* `Manifest.toml` contains the exact versions of all direct and indirect dependencies
356356

357357
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).
358-
Packages installed that way are available no matter which local environment is active, because of "environment stacking".
359-
It is therefore recommended to keep the default environment very light, containing only essential development tools.
358+
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)".
359+
It is recommended to keep the default environment very light to avoid dependencies conflicts. It should contain only essential development tools.
360360

361361
\vscode{
362362

@@ -380,7 +380,7 @@ Once your code base grows beyond a few scripts, you will want to [create a packa
380380
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.
381381
Furthermore, you can specify versions for your package and its dependencies, making your code easier and safer to reuse.
382382

383-
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).
383+
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.
384384

385385
```>generate-package
386386
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
428428

429429
\vscode{
430430

431-
The Julia extension imports Revise.jl by default when it starts a REPL.
431+
The Julia extension imports Revise.jl by default when it starts a REPL, provided it is installed in the default environment.
432432

433433
}
434434

@@ -462,6 +462,9 @@ using MyPackage
462462
MyPackage.myfunc()
463463
```
464464

465+
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.
466+
[ShareAdd.jl](https://github.com/Eben60/ShareAdd.jl) can help you in using and managing these (see its documentation).
467+
465468
}
466469

467470
## Configuration

0 commit comments

Comments
 (0)