64 lines
2.0 KiB
Groff
64 lines
2.0 KiB
Groff
CELL-BUILD(1) Cell Manual CELL-BUILD(1)
|
|
|
|
NAME
|
|
cell build - Compile all modules to bytecode
|
|
|
|
SYNOPSIS
|
|
cell build
|
|
|
|
DESCRIPTION
|
|
The build command compiles all JavaScript modules in the modules/
|
|
directory to bytecode format. Compiled modules are stored in
|
|
.cell/build/ with a .jso extension and load faster than source files.
|
|
|
|
Cell's module system automatically uses compiled versions when
|
|
available, falling back to source files if needed.
|
|
|
|
OPERATION
|
|
1. Scans .cell/modules/ for all dependencies
|
|
2. Compiles each .js file to bytecode using QuickJS
|
|
3. Saves compiled bytecode with .jso extension in .cell/build/
|
|
4. Preserves module structure and naming
|
|
5. Updates module resolution to prefer compiled versions
|
|
|
|
COMPILATION PROCESS
|
|
For each module:
|
|
- Source: .cell/modules/chess@v1.0.0/main.js
|
|
- Output: .cell/build/chess@v1.0.0/main.jso
|
|
|
|
The compilation uses QuickJS bytecode format which:
|
|
- Loads faster than parsing source
|
|
- Provides some obfuscation
|
|
- Maintains full compatibility
|
|
|
|
EXAMPLES
|
|
Build all modules:
|
|
cell build
|
|
|
|
Typical workflow:
|
|
cell get git.world/jj/chess@v1.0.0
|
|
cell build
|
|
# Your code now uses compiled chess module
|
|
|
|
NOTES
|
|
- Compilation is optional - source modules work without building
|
|
- Compiled modules are preferred over source when available
|
|
- The .jso extension indicates QuickJS bytecode
|
|
- Bytecode is platform-independent
|
|
- TODO: Actual compilation implementation pending
|
|
|
|
FILES
|
|
.cell/build/
|
|
Contains all compiled modules
|
|
|
|
.cell/modules/
|
|
Source modules read from here
|
|
|
|
PERFORMANCE
|
|
Compiled modules provide:
|
|
- Faster load times (no parsing needed)
|
|
- Reduced memory usage during loading
|
|
- Same runtime performance as source
|
|
|
|
SEE ALSO
|
|
cell(1), cell-get(1), cell-vendor(1) |