Skip to content

Support standalone AOT CLI execution under dart install - #215

Merged
gmpassos merged 6 commits into
Colossus-Services:masterfrom
sigurdm:fix/dart-install-aot
Dec 1, 2026
Merged

gmpassos merged 6 commits into
Colossus-Services:masterfrom
sigurdm:fix/dart-install-aot

Conversation

@sigurdm

@sigurdm sigurdm commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

As part of preparing ecosystem CLIs for dart install / dart run <pkg>@ (see dart-lang/sdk#64955):

Running bones_api as a standalone AOT executable (dart install bones_api or dart run bones_api@) previously failed at startup because DefaultTemplate.configure() unconditionally resolved package:bones_api/src/template/bones_api_template.tar.gz to a local file path.

Changes:

  • Embed bones_api_template.tar.gz in lib/src/template/bones_api_template_data.dart (kept in sync by tool/embed_template.dart / update_project_template.sh and verified against the archive on disk) and load it directly in memory via StorageTarGzip.fromCompressed when no on-disk file URI is available.
  • Fall back to spawning a dart VM in the target project directory for bones_api serve and bones_api console when running outside a JIT VM (where Isolate.spawnUri is unavailable), normalizing relative --directory, --config, --lets-encrypt-dir, and --domain paths before changing working directories.

sigurdm and others added 4 commits November 30, 2026 08:57
….tar.gz

After merging master (v1.37.1, updated template archive), re-run
`tool/embed_template.dart` so `bones_api_template_data.dart` matches the
archive on disk again (checked by `bones_api_cli_template_test.dart`).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gmpassos

gmpassos commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@sigurdm

Thanks for the PR and for taking the time to improve bones_api! I appreciate the contribution and the effort put into making it work with standalone AOT execution. Great work!

@codecov

codecov Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.96%. Comparing base (8a3f596) to head (70d0ec9).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #215      +/-   ##
==========================================
- Coverage   96.00%   95.96%   -0.05%     
==========================================
  Files          75       76       +1     
  Lines       26042    26046       +4     
==========================================
- Hits        25001    24994       -7     
- Misses       1041     1052      +11     
Flag Coverage Δ
unittests 95.96% <100.00%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

gmpassos and others added 2 commits December 1, 2026 07:09
- `bin/bones_api.dart`: doc comments for `_isRunningInJITVM`,
  `normalizeProjectDirectoryPath`, `resolveForwardedApiConfig`,
  `resolveForwardedDomains` and `DefaultTemplate` (why each exists and where
  it is used); explain the swallowed package-URI resolution error.
- Version 1.38.0 (`pubspec.yaml`, `BonesAPI.VERSION`) + CHANGELOG entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Regenerated with `update_project_template.sh` (archive + embedded data):
memory API config fixed (`sql.memory`, adapters booted), new SQLite
configs, `generate_tables_sql.dart` exits. CHANGELOG (1.38.0) updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gmpassos
gmpassos merged commit cd24a03 into Colossus-Services:master Dec 1, 2026
9 checks passed
@gmpassos

gmpassos commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Merged and released. Published bones_api: ^1.38.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants