feat(structure): create src/ layout, defer config.lua I/O #333
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/qpkg!333
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/project-structure"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Phase 6: Align project structure to conventions and remove load-time I/O side effects.
Changes
src/ layout (#292/#288-#291)
src/main.lua— thin executable entry point (alternative tobin/qpkg)src/internal/<module>/init.lua— re-exports for all 10 modulessrc/lib/utils/init.lua— shared utilitiessrc/errors/init.lua— centralized errorsAll
src/files are thin wrappers that re-export fromlib/via package.path manipulation.Compat path (#293)
Both
lib/qpkg/andsrc/paths are searched.lib/qpkg/remains the canonical module location.src/provides the conventional layout.Config I/O deferral (#296/#294/#295)
config.luanow has zero I/O at require time:__indexmetamethod on first field accessqpkg.conf) loading deferred until first non-default field accessTesting
lua src/main.lua --versionworkslua src/main.lua --helpworksCloses #292
Review — Approved
Two independent changes, both correct:
Config I/O deferral — OS/arch detection and qpkg.conf loading deferred via
__indexmetamethod. Zero I/O atrequiretime. Results cached onconfigtable after first access. Backward compatible.src/ layout — 11 thin wrapper modules re-exporting from
lib/viapackage.pathmanipulation.src/main.luaentry point works (verified:lua src/main.lua --version).bin/qpkgupdated with compat paths.Verified
lua src/main.lua --version→qpkg version 0.1.0Non-blocking
configtable after first load (onlyos/archare). Filed as #334.