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
Copy file name to clipboardExpand all lines: README.md
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,7 +128,6 @@ These are the CLI options `duel` supports to work alongside your project's `tsco
128
128
-`--exports-config` Provide a JSON file with `{ "entries": ["./dist/index.js", ...], "main": "./dist/index.js" }` to limit which outputs become exports.
129
129
-`--exports-validate` Dry-run exports generation/validation without writing package.json; combine with `--exports` or `--exports-config` to emit after validation.
130
130
-`--rewrite-policy [safe|warn|skip]` Control how specifier rewrites behave when a matching target is missing (`safe` warns and skips, `warn` rewrites and warns, `skip` leaves specifiers untouched).
131
-
-`--validate-specifiers` Validate that rewritten specifiers resolve to outputs; defaults to `true` when `--rewrite-policy` is `safe`.
132
131
-`--detect-dual-package-hazard, -H [off|warn|error]` Flag mixed import/require usage of dual packages; `error` exits non-zero. If project-scope checks lack file paths, or file-scope checks return pathless diagnostics, Duel falls back to file-scope reporting during transforms so diagnostics include locations.
133
132
-`--dual-package-hazard-allowlist <pkg>[,<pkg>...]` Comma-separated packages to ignore when reporting dual package hazards (e.g., `react`).
134
133
-`--dual-package-hazard-scope [file|project]` Run hazard checks per file (default) or aggregate across the project.
Copy file name to clipboardExpand all lines: docs/faq.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,15 +4,15 @@
4
4
5
5
Duel emits JavaScript and declaration files into `dist/`, and the same `tsconfig.json` is reused for both emitting and type-checking. In workspace setups, sibling packages often import `@scope/pkg` via its package exports, so TypeScript resolves into the generated `.d.ts` files inside `dist/`. When `tsc` later tries to emit, it refuses to overwrite files it now treats as inputs (TS5055). Adding `"exclude": ["dist"]` keeps build artifacts out of the compilation so Duel can regenerate them safely.
6
6
7
-
## Why is this mostly a workspace issue?
7
+
###Why is this mostly a workspace issue?
8
8
9
9
Single-package projects seldom import their own published outputs, but monorepos routinely do. When another package in the workspace references `@scope/pkg`, TypeScript follows that path right back into the freshly built `dist/` directory. Without the exclusion, the repo ends up both producing and consuming those artifacts during the same build, confusing the compiler.
10
10
11
-
## Do I still need `"outDir": "dist"` if I exclude it?
11
+
###Do I still need `"outDir": "dist"` if I exclude it?
12
12
13
13
Yes. `outDir` controls where Duel (and `tsc`) place emit results. The exclusion only affects what the compiler considers source inputs; it does not change the emit destination.
14
14
15
-
## Can I avoid editing `tsconfig.json`?
15
+
###Can I avoid editing `tsconfig.json`?
16
16
17
17
You could maintain separate configs (one for emit, one for checking) or lean on project references, but Duel's default workflow assumes a single package-level config. Excluding `dist/` is the simplest, least error-prone way to ensure dual builds, incremental type-checks, and workspace consumers all cooperate.
Copy file name to clipboardExpand all lines: docs/v4-migration.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ This guide highlights behavior changes introduced in v4 and how to adapt existin
4
4
5
5
## Breaking/Behavioral Changes
6
6
7
-
-**Specifier rewrites now default to safer behavior.**`--rewrite-policy` now defaults to `safe`, and `--validate-specifiers` is forced on when policy is `safe`. Missing targets skip rewrites and emit warnings instead of silently rewriting.
7
+
-**Specifier rewrites now default to safer behavior.**`--rewrite-policy` now defaults to `safe`; missing targets skip rewrites and emit warnings instead of silently rewriting.
8
8
-**Dual-package hazard detection enabled by default.**`--detect-dual-package-hazard` now defaults to `warn`, and `--dual-package-hazard-scope` defaults to `file`. You may see new warnings (or errors if configured).
9
9
-**Build pipeline runs in a temp workspace copy.** Dual builds no longer mutate the root `package.json`; a temp copy is created with an adjusted `type`. External tools that watched in-place `package.json` edits will see different behavior.
10
10
-**IMPORTANT:** The temp-copy flow adds some I/O for large repos (copying sources/reference packages and running transforms there). `node_modules` is skipped; when references exist, existing `dist` may be reused. Very large projects may see modestly slower runs compared to the old in-place mutation.
@@ -18,7 +18,7 @@ This guide highlights behavior changes introduced in v4 and how to adapt existin
18
18
19
19
## Restoring v3-like Behavior
20
20
21
-
-**Specifier rewrites:** use `--rewrite-policy warn --validate-specifiers false` to continue rewriting even when targets are missing (previous behavior). To fully bypass rewrites, set `--rewrite-policy skip`.
21
+
-**Specifier rewrites:** use `--rewrite-policy warn` to continue rewriting even when targets are missing (previous behavior). To fully bypass rewrites, set `--rewrite-policy skip`.
22
22
-**Hazard detection:** disable by passing `--detect-dual-package-hazard off` (or set scope to `project` only if you want aggregated warnings).
23
23
-**Build/package.json side effects:** if tooling depended on in-place `package.json` mutation, update it to read outputs from the temp dual build outputs (`dist/esm` / `dist/cjs` or `outDir` variants). No flag restores the old mutation pattern.
24
24
-**TypeScript references:** if build mode changes output undesirably, remove `references` or run your own `tsc -p` before calling `duel`.
@@ -27,7 +27,7 @@ This guide highlights behavior changes introduced in v4 and how to adapt existin
27
27
28
28
1. Pick a rewrite policy:
29
29
- Safety-first (default): keep `--rewrite-policy safe` (default) and address any missing-target warnings by fixing paths or adding files.
30
-
- Legacy: add`--rewrite-policy warn --validate-specifiers false` to mimic v3 rewrites.
30
+
- Legacy: set`--rewrite-policy warn` to mimic v3 rewrites.
31
31
2. Decide on hazard handling:
32
32
- Keep defaults to surface hazards.
33
33
- Silence: `--detect-dual-package-hazard off`.
@@ -38,9 +38,9 @@ This guide highlights behavior changes introduced in v4 and how to adapt existin
0 commit comments