|
| 1 | +# Working on a BioFSharp extension |
| 2 | + |
| 3 | +## Purpose and scope |
| 4 | + |
| 5 | +`BioFSharp.XYZ` is a template for an independently packaged extension of |
| 6 | +[BioFSharp](https://github.com/BioFSharp/BioFSharp). Its current `BioTalk` library, |
| 7 | +test, and documentation example demonstrate the tooling; they do not define the |
| 8 | +purpose of a scaffolded package. |
| 9 | + |
| 10 | +When scaffolding, replace the placeholder names and update this section with the |
| 11 | +package's biological domain, supported capabilities, and boundaries. Keep this |
| 12 | +guide aligned with the implementation. Use `README.md` for user-facing setup and |
| 13 | +development instructions. |
| 14 | + |
| 15 | +## Relationship to core BioFSharp |
| 16 | + |
| 17 | +- Core provides general biological types, file-format models, IO, and foundational |
| 18 | + algorithms. Extensions build on that foundation with specialized functionality, |
| 19 | + models, and dependencies, and may have independent release schedules. |
| 20 | +- Keep dependencies directed from the extension toward core and other reusable |
| 21 | + packages. Do not introduce a dependency from core back to this extension or a |
| 22 | + circular dependency between extensions. |
| 23 | +- Check the referenced core package and relevant extension APIs before adding a |
| 24 | + type, parser, or algorithm. Reuse or compose existing representations instead of |
| 25 | + copying their implementations or creating competing versions of the same model. |
| 26 | +- Use NuGet package references as the portable default. A sibling checkout can |
| 27 | + help with inspection, but a fresh clone must not require a particular local |
| 28 | + repository layout. Check that APIs found in another checkout exist in the |
| 29 | + package version this project actually references. |
| 30 | + |
| 31 | +## Models, namespaces, and ownership |
| 32 | + |
| 33 | +- A namespace describes conceptual organization, not repository or assembly |
| 34 | + ownership. An extension may add distinct modules under |
| 35 | + `BioFSharp.FileFormats.<Format>` and `BioFSharp.IO.<Format>`, as appropriate. |
| 36 | + Avoid fully qualified type or module names already exported by core or another |
| 37 | + dependency. Package-specific APIs normally belong under `BioFSharp.XYZ`. |
| 38 | +- Keep reusable format models and parsing/writing independent of network access, |
| 39 | + persistence, and workflow orchestration. This is a separation of responsibilities; |
| 40 | + it does not require a separate project or NuGet package for every layer. |
| 41 | +- Distinguish a reusable file format from a service-specific response or projection. |
| 42 | + Preserve biological meaning when modelling data, including identifier semantics, |
| 43 | + units, coordinate conventions, evidence, and missing values where relevant. |
| 44 | + Prefer explicit types and conversions over silently dropping information. |
| 45 | +- Upstreaming a mature model or parser is optional. Consider it when it is broadly |
| 46 | + useful independently of this extension. Moving public types between assemblies |
| 47 | + needs a compatibility and versioning strategy even if their namespaces stay the |
| 48 | + same; do not treat it as a transparent file move. |
| 49 | + |
| 50 | +## Repository and code conventions |
| 51 | + |
| 52 | +- `src/BioFSharp.XYZ` contains the library; `tests/BioFSharp.XYZ.Tests` contains |
| 53 | + xUnit tests. `docs` contains literate F# examples. `build` contains FAKE targets. |
| 54 | +- Treat `global.json`, project files, and the local tool manifest as the sources |
| 55 | + of truth for SDK, target framework, and tool versions. The library's compatibility |
| 56 | + target is independent of the SDK and runtime used for development and tests. |
| 57 | +- Register new F# files explicitly in their `.fsproj` in dependency order. Update |
| 58 | + the solution, project references, and `build/ProjectInfo.fs` when adding or |
| 59 | + renaming projects; keep documentation DLL references aligned. |
| 60 | +- Follow existing F# conventions and document public APIs with `///` comments. |
| 61 | + Explain important biological assumptions and failure behavior in the API docs. |
| 62 | +- Test observable behavior with representative inputs and relevant edge cases. |
| 63 | + Keep ordinary tests independent of live services where possible, using fixtures |
| 64 | + or injected dependencies. Keep any live integration checks separately opt-in. |
| 65 | + |
| 66 | +## Build and validation |
| 67 | + |
| 68 | +Run commands from the repository root. Prefer the FAKE entry points for |
| 69 | +solution-wide checks; direct `dotnet` commands are useful for focused iteration. |
| 70 | + |
| 71 | +| Task | Windows PowerShell | Linux / macOS | |
| 72 | +| --- | --- | --- | |
| 73 | +| Build | `.\build.cmd` | `bash ./build.sh` | |
| 74 | +| Tests and coverage | `.\build.cmd RunTests` | `bash ./build.sh RunTests` | |
| 75 | +| Build documentation | `.\build.cmd BuildDocs` | `bash ./build.sh BuildDocs` | |
| 76 | +| Package locally | `.\build.cmd Pack` | `bash ./build.sh Pack` | |
| 77 | + |
| 78 | +`RunTests` cleans and builds before testing. `Pack` also runs those checks, prompts |
| 79 | +for the version from `RELEASE_NOTES.md`, and writes artifacts to `pkg`. |
| 80 | +Documentation targets restore the pinned tools automatically. After changing |
| 81 | +executable documentation, inspect the rendered examples as well as the command's |
| 82 | +exit status. |
| 83 | + |
| 84 | +Choose validation appropriate to the change. Documentation-only guidance edits |
| 85 | +need path, link, and diff checks; they do not require rebuilding unchanged code. |
| 86 | +Report the checks performed and any limitations. |
| 87 | + |
| 88 | +Release targets can push Git tags, publish NuGet packages, and deploy documentation. |
| 89 | +Run them as part of a requested release, not as routine validation. Publishing uses |
| 90 | +`NUGET_API_KEY`; keep credentials out of source and logs. See the README for the |
| 91 | +release workflow and the distinction between local packaging and publishing. |
0 commit comments