cycling_adaptive (1.0.0)

Published 2026-09-22 09:34:47 +00:00 by Platform

Installation

dart pub add cycling_adaptive:1.0.0 --hosted-url=

About this package

Adaptive training: intent to session, a heart-rate-steered conductor, and the athlete model it learns from.

Dart.Package.Cycling.Adaptive

Template for creating Dart packages, published to this account's Pub feed.

Quick Start

  1. On Forgejo, create a new repository and pick this repo (Dart.Package.Template) as the Repository Template, with Git Content (Default Branch) checked — that's what runs the placeholder substitution below.

  2. Name the new repo following the Dart.Package.<Name> convention. Every Dart.Package.Cycling.Adaptive placeholder in this template — currently just the README — gets replaced with that exact name on creation.

  3. Rename package_name to your real package name (lowercase_with_underscores, e.g. my_package) and update the places that still say package_name:

    • pubspec.yaml — the name field (the Pub package name)
    • lib/package_name.dart — rename the file (this is the package's public entrypoint, imported as package:my_package/my_package.dart)
    • lib/src/package_name_base.dart — rename the file, and the export in the file above
    • test/package_name_test.dart — rename the file and its import 'package:package_name/package_name.dart'
    • example/example.dart's import 'package:package_name/package_name.dart'
    • .forgejo/workflows/cleanup.yml's package-name: input

    This has to be manual — Dart.Package.Cycling.Adaptive is a dotted name (Dart.Package.Foo), which isn't a legal Pub package name or Dart library identifier, so there's no placeholder substitution that can turn it into the right identifier automatically.

  4. Write the actual library under lib/ — the public API in lib/<your_package>.dart (only exports, no implementation), everything else under lib/src/ (implementation, not meant to be imported directly by consumers — a Pub convention, not enforced by the language). Tests go in test/. example/example.dart is a throwaway script for manually exercising the library — delete it if you don't need it.

  5. Replace the TODOs in pubspec.yaml's description and lib/<your_package>.dart's doc comment.

  6. Bump Version.txt and push to main to publish (see Versioning below).

If you can't create-from-template

Clone this repo directly, then find-and-replace every literal Dart.Package.Cycling.Adaptive in README.md with the new repo's name yourself before building.

Project structure

pubspec.yaml            package metadata + dependencies
analysis_options.yaml   package:lints/recommended.yaml
CHANGELOG.md            one entry per published version
LICENSE                 required by `dart pub publish` - a hard error without one
Version.txt             The version to publish, same convention as the other package templates
lib/
├── package_name.dart       rename me — public API, only exports
└── src/
    └── package_name_base.dart   rename me — implementation
test/
└── package_name_test.dart   rename me — run with `dart test`
example/
└── example.dart          throwaway script — manually exercise the library

lib/src/ for implementation (with only exports in the top-level lib/<package>.dart) is the standard Pub package layout — it signals to consumers that anything under src/ isn't part of the public API and can change without a semver-major bump, the same convention dart create -t package scaffolds by default.

Versioning and publishing

Version.txt is the exact version that gets published — nothing is computed for you. A push to main publishes it only when that version isn't on the feed yet; leave it alone and the push just resolves and tests, logs that the version is already published, and stops there. Bump it (patch for an ordinary change, minor/major for a feature or a breaking change) whenever you want a release.

Pushes to any other branch never publish — they only resolves and tests.

pubspec.yaml's version: field starts as a placeholder (0.0.0) — CI overwrites it with Version.txt's value immediately before publishing. Don't hand-edit it; it's not the source of truth.

CI

.forgejo/workflows/build.yml installs the Dart SDK, resolves dependencies, and runs dart test on every push. It also computes the next version, publishes via dart pub publish, tags the commit v<version>, and creates a matching Release with a source tarball attached — all via the shared Platform/Forgejo.Package.Actions/dart-publish composite action. Re-pushing an already-published version is a no-op (the "already exists" error from dart pub publish is swallowed rather than failing the build, mirroring nuget-publish's --skip-duplicate). Also has a workflow_dispatch trigger, so it can be re-run on demand from the repo's Actions tab (or the API) without a new commit — e.g. to retry after a transient failure.

.forgejo/workflows/cleanup.yml runs when a branch is deleted and removes every Pub package version whose prerelease label matches that branch, via Platform/Forgejo.Package.Actions/dart-cleanup, so in-progress/abandoned branches don't leave permanent clutter on the feed. This only applies to prerelease versions — deleting a branch never touches anything published from main.

Sends a Pushover notification on publish success/failure — see dart-publish's own docs in the Forgejo.Package.Actions README.

Needs NUGET_PACKAGES_USER/NUGET_PACKAGES_TOKEN (the same account-wide PAT every other feed uses — nothing NuGet-specific about it, just named from where it was first set up) and, optionally, PUSHOVER_APP_TOKEN/PUSHOVER_USER_KEY — all already set as account-level Actions secrets, so every repo this account owns picks them up automatically, no per-repo setup needed.

Note: like Python.Package.Template/Cpp.Package.Template, build.yml's single step is skipped entirely when running against this template repo itself (if: github.event.repository.name != 'Dart.Package.Template'), so pushing straight to this repo's main can never try to publish a package named package_name to the real feed.

Consuming a published package

From another Dart project, add the Forgejo hosted source once:

dart pub add package_name --hosted-url=https://forge.dajno.com/api/packages/Platform/pub

or add it directly to pubspec.yaml:

dependencies:
  package_name:
    hosted: https://forge.dajno.com/api/packages/Platform/pub
    version: ^1.0.0

Pulling from a private feed needs the same PAT registered locally:

dart pub token add https://forge.dajno.com/api/packages/Platform/pub
Details
Pub
2026-09-22 09:34:47 +00:00
3
259 KiB
Assets (1)
1.0.0.tar.gz 259 KiB
Versions (7) View all
1.5.0 2026-09-28
1.4.0 2026-09-26
1.3.0 2026-09-24
1.2.0 2026-09-22
1.1.0 2026-09-22