refactor #1

Merged
DragonSpirit merged 10 commits from refactor into main 2026-05-14 23:34:13 +03:00
Owner
No description provided.
DragonSpirit added 10 commits 2026-05-14 23:33:14 +03:00
Phase 5 — TransferService extraction:
- New nxst::TransferService owns all sender/receiver state, threads, and atomics
  (previously 11 file-statics across transfer_sender.cpp + transfer_receiver.cpp)
- startReceive() calls io::restore internally; UI never touches infra/fs or infra/net
- TitlesLayout routes all transfer ops through mainApp->transfer
- g_currentUId removed from global scope; TitlesLayout::InitTitles(AccountUid)
- MainApplication gains transfer member; layout refs renamed to snake_case
- userAppExit() updated to cancel via service

Phase 6 — Result<T> + RAII:
- include/nxst/domain/result.hpp: 85-line tagged-union Result<T,E> + Result<void,E>
- include/nxst/infra/fs/handles.hpp: FsFileSystemHandle (auto fsFsClose),
  FileHandle (auto fclose) — eliminates manual close on every error path
- io::backup / io::restore return nxst::Result<std::string> (was tuple<bool,Result,string>)
- new u8[] + malloc in copyFile/restore replaced with std::vector<u8>
- NACP save-creation extracted to createSaveIfNeeded() helper in io.cpp

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
finish refactor, add docs and CI
CI / Build NRO (push) Successful in 29s
CI / Format check (push) Successful in 11s
CI / Layering check (push) Successful in 1s
9339e7dbfe
chore: remove vendored deps/asprintf
CI / Build NRO (push) Successful in 2m54s
CI / Format check (push) Successful in 5m18s
CI / Layering check (push) Successful in 2s
33a1ce73af
vasprintf/asprintf are provided by devkitpro newlib (<stdio.h>).
deps/asprintf was never compiled by CMake (GLOB_RECURSE covers src/ only).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
build: migrate Plutonium to ExternalProject_Add + IMPORTED target
CI / Build NRO (push) Successful in 36s
CI / Format check (push) Successful in 48s
CI / Layering check (push) Successful in 1s
82df796a4a
Replaces add_custom_command/add_custom_target with ExternalProject_Add,
which correctly declares BUILD_BYPRODUCTS for Ninja and propagates include
paths via INTERFACE_INCLUDE_DIRECTORIES on the IMPORTED STATIC target.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Plutonium is now downloaded at build time via ExternalProject_Add
(GIT_REPOSITORY + GIT_TAG) instead of being a git submodule.
Removes lib/, .gitmodules, and the linguist-vendored entry for it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
chore: remove stale deps/** linguist-vendored from .gitattributes
CI / Build NRO (push) Successful in 31s
CI / Format check (push) Successful in 50s
CI / Layering check (push) Successful in 2s
836956394a
deps/ directory was removed with asprintf cleanup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- AccountProfileHandle RAII wrapper in handles.hpp; applied in
  account.cpp (getUser, iconPath) replacing manual accountProfileClose
- FILE* in iconPath replaced with existing FileHandle RAII wrapper
- io::restore split into clearSaveRoot + extractAndCommit static helpers;
  public signature unchanged
- sendAll/recvAll kept as bool — callers don't propagate the error string,
  Result<void> would add noise without benefit

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
another stage of refactoring
CI / Build NRO (push) Successful in 29s
CI / Format check (push) Successful in 28s
CI / Layering check (push) Successful in 2s
CI / Build NRO (pull_request) Successful in 29s
CI / Format check (pull_request) Successful in 27s
CI / Layering check (pull_request) Successful in 1s
49efcde301
DragonSpirit merged commit 1111f691c6 into main 2026-05-14 23:34:13 +03:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DragonSpirit/NXST#1