2.6 KiB
2.6 KiB
Codebase Structure
Directory Layout
smartdeno/
├── ts/ # Source code
│ ├── index.ts # Main entry point (exports SmartDeno)
│ ├── plugins.ts # Dependency imports
│ ├── paths.ts # Path configurations
│ ├── classes.smartdeno.ts # Main SmartDeno class
│ ├── classes.denodownloader.ts # Deno download logic
│ ├── classes.scriptserver.ts # Script execution server
│ ├── classes.denoexecution.ts # Script execution wrapper
│ └── 00_commitinfo_data.ts # Commit metadata
├── test/ # Test files
│ └── test.ts # Main test suite
├── dist_ts/ # Compiled output (gitignored)
├── .nogit/ # Temporary/debug files (gitignored)
├── assets/ # Static assets
├── .gitea/ # Gitea-specific configs
├── .vscode/ # VS Code settings
├── .claude/ # Claude Code settings
├── .serena/ # Serena agent settings
├── package.json # Package manifest
├── tsconfig.json # TypeScript config
├── npmextra.json # Extended npm metadata
├── readme.md # Main documentation
└── readme.hints.md # Development hints (currently empty)
Core Classes
SmartDeno (ts/classes.smartdeno.ts)
Main orchestrator class with methods:
start(options)- Initialize and download Deno if neededstop()- Cleanup resourcesexecuteScript(scriptArg)- Execute a Deno script
DenoDownloader (ts/classes.denodownloader.ts)
Handles Deno binary download:
- Fetches latest Deno release from GitHub
- Platform detection (Linux, macOS, Windows)
- Architecture detection (x64, arm64)
- Downloads and extracts Deno binary
ScriptServer (ts/classes.scriptserver.ts)
Internal server for script execution
DenoExecution (ts/classes.denoexecution.ts)
Wraps individual script execution
Entry Point Flow
- User imports from
@push.rocks/smartdeno index.tsexportsSmartDenoclass- User creates instance:
new SmartDeno() - User calls
await smartDeno.start()to initialize - User calls
await smartDeno.executeScript(code)to run Deno code
Dependencies Pattern
All external dependencies are:
- Imported in
plugins.ts - Exported as namespace
- Used with full path (e.g.,
plugins.smartfile.fs.readFile())