Skip to content

Instantly share code, notes, and snippets.

@mashingan
Forked from stisa/nimblepkgstructure.md
Created October 2, 2017 04:24
Show Gist options
  • Save mashingan/7adef7d058a4fbe679ced7d7f075fd98 to your computer and use it in GitHub Desktop.
Save mashingan/7adef7d058a4fbe679ced7d7f075fd98 to your computer and use it in GitHub Desktop.

First suggestion:

src/
  <pkgname>.nim
tests/
docs/
<pkgname>.nimble # with srcDir = "src"

library with single module

<pkgname>.nim
<pkgname>.nimble # with skipDirs = @["tests","docs"]
tests/
docs/

library with multiple modules

<pkgname>/
  private/ # optional
    priv1.nim
    priv2.nim
  module1.nim
  module2.nim
<pkgname>.nimble # with skipDirs = @["tests","docs"]
tests/
docs/

binary

<pkgname>.nim
<pkgname>.nimble # with bin = @["<pkgname>"]

hybrid

<pkgname>pkg/
  private/ # optional
    priv1.nim
    priv2.nim
  module1.nim
  module2.nim
<pkgname>.nim
<pkgname>.nimble # with bin = @["<pkgname>"]

bonus: what I do:

src/
  <pkgname>.nim
  <pkgname>/
    private/ # optional
      priv1.nim
      priv2.nim
    module1.nim
    module2.nim
<pkgname>.nimble # with srcDir = "src"
tests/
docs/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment