Repository navigation
DeltaScript 1.0.2
DeltaScript v1.0.2 — Release Notes
Date: 2025-11-01
Highlights
- Native .ds module imports end-to-end:
import ... from "./file.ds"andexport ... from "./file.ds"now work across the transpiler and CLI. - Accurate diagnostics after interfaces: syntax errors now map precisely to the original source lines even when
interfaceblocks are stripped. - Single-file CLI runner is module-aware: recursively compiles
.dsdependencies and executes as ESM with clean output (no Node warnings).
Added
- .ds import support in transpiler
- Rewrites all
.dsspecifiers to.js:- Static:
import ... from "x.ds",export ... from "x.ds". - Bare/dynamic:
import "x.ds",import("x.ds").
- Static:
- Adds
./to specifiers lacking a relative prefix so Node treats them as relative modules (avoids “Cannot find package …” errors in ESM).
- Rewrites all
- CLI single-file dependency graph
dsc <entry.ds>now parses.dsimports, recursively transpiles all dependencies into a temp workspace preserving folder structure, and runs the entry as.mjs.- Injects Spectral builtins into every transpiled module in single-file mode (so
spec.*works in imported modules too). - Writes a temporary
package.jsonwith{"type":"module"}to suppress Node ESM warnings.
Changed
- Transpiler emit normalization
- Emits valid JS for function declarations:
func Name(→function Name(async func Name(→async function Name(
- Consistently rewrites
.dsimports/exports/bare/dynamic to.jsin both preprocessing and emitted output.
- Emits valid JS for function declarations:
- Fallback Spectral shim
- Removed unused
specwebconstant from the injected shim. - Shim remains synchronous and safe for Node and browser environments.
- Removed unused
Fixed
- Interface line/column mapping
- Parser-phase syntax errors are now mapped back to original source lines using a parsed→source map that simulates full interface removal (including single-line interfaces and trailing code after
}). - Column positions are corrected for inline transformations (e.g., removal of
::Type,func → function,maybeexpansion).
- Parser-phase syntax errors are now mapped back to original source lines using a parsed→source map that simulates full interface removal (including single-line interfaces and trailing code after
- ESM false positives
- JS syntax validation is skipped for ESM output to avoid reporting false “Unexpected token” errors when using
export/import.
- JS syntax validation is skipped for ESM output to avoid reporting false “Unexpected token” errors when using
- Single-file execution
- Ensures imported modules have
specavailable when builtins are enabled. - Suppresses Node’s MODULE_TYPELESS_PACKAGE_JSON warning by marking the temp workspace as ESM.
- Ensures imported modules have
CLI
dsc buildunchanged for multi-file projects (rewrites.ds→.jsin output).dsc <file.ds>:- Recursively compiles imported
.dsfiles. - Runs entry as
.mjswithcwdset to the temp workspace. - Applies builtins/migration only to the entry for console→spec migration; builtins are injected into all modules to provide
spec.
- Recursively compiles imported
Compatibility / Breaking Changes
- No breaking changes to the DeltaScript language syntax.
- If you relied on
specwebfrom the fallback shim, it has been removed (it was unused and undocumented). - For single-file runs that import other
.dsfiles, usedsc <entry.ds>; dependencies will be transpiled automatically.
Acknowledgements
Thanks for the feedback that led to:
- Robust .ds import handling (static, bare, dynamic).
- Precise diagnostic mapping after interfaces.
- Clean ESM execution in single-file workflows.