You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Single-file rename via stdout redirect (CLI has no "out file" flag; `--out-dir` always mirrors inputs):
51
+
52
+
```bash
53
+
dub -t module src/some.cjs > src/some.mjs
54
+
```
55
+
50
56
## Options
51
57
52
58
Short and long forms are supported.
@@ -83,5 +89,5 @@ Short and long forms are supported.
83
89
Notes:
84
90
85
91
- When reading from stdin, output is sent to stdout; `--out-dir` or `--in-place` are not allowed in that mode.
86
-
- Specify either `--out-dir` or `--in-place` for file inputs; stdout is used only when a single file is given and neither flag is set.
92
+
- Specify either `--out-dir` or `--in-place` for file inputs; stdout is used only when a single file is given and neither flag is set.`--out-dir` always mirrors the input path under that directory (no single-file rename flag). Use stdout redirection if you need to rename one file.
87
93
- Diagnostics are printed to stderr; use `--json` for machine-readable output.
Copy file name to clipboardExpand all lines: docs/roadmap.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,11 @@ Status: draft
4
4
5
5
## Idiomatic Exports
6
6
7
-
Shipped: `idiomaticExports: 'safe'` is now the default for CJS → ESM, with fallback to the helper bag plus diagnostics when unsafe.
7
+
Shipped: `idiomaticExports: 'safe'` is now the default for CJS → ESM, with fallback to the helper bag plus diagnostics when unsafe. Auto lifts simple `module.exports = { foo, bar }` object literals to idiomatic exports when safe.
8
8
9
9
Next:
10
10
11
11
- Explore a true `'aggressive'` mode (mixed exports/module.exports, limited reassignments, identifier-safe computed keys) with guarded semantics and explicit diagnostics.
12
-
- In `'auto'`, allow idiomatic `module.exports = { foo, bar }` when the object literal is simple: single top-level assignment, no spreads/getters/computed/duplicate keys, only identifier keys, RHS values limited to safe literals/identifiers/function|class expressions, no `require()` inside RHS, and no `__proto__`/`prototype` keys. Add a shorthand-object fixture test and keep falling back to the helper for anything more complex.
13
12
- Consider a constrained ESM → CJS “pretty” path where live-binding and TLA semantics permit it.
0 commit comments