Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Command-line wrapper around `@knighted/module` for transforming files between ESM and CommonJS.

> [!NOTE]
> The name "dub" comes from the literal act of dubbing a squire into a knight—short, quick, and accurate.

## Requirements

- Node >= 22.21.1 (or Node 24+)
Expand Down
1 change: 1 addition & 0 deletions docs/helpers-vs-utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

- `helpers/`: identifier/name helpers.
- `utils/`: exports collection, identifier tracking, language/specifier helpers, misc transformation utilities.
- `pipeline/`: ordered, option-aware transformation stages (planning, lowering, prelude/emission). These mutate `MagicString` or return code slices and depend on formatter options/state. They stay separate to keep helpers/utils generic while keeping the format pipeline readable.

## Maintenance tips

Expand Down
5 changes: 0 additions & 5 deletions docs/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,3 @@ Next:

- Emit source maps and clearer diagnostics for transform choices.
- Benchmark scope analysis choices: compare `periscopic`, `scope-analyzer`, and `eslint-scope` on fixtures and pick the final adapter.

## Refactors

- Split `src/format.ts` into focused modules: exports planning (idiomatic/helper), import/require lowering, diagnostics/warnings, and code-emission utilities; add lightweight integration harness and incremental tests to keep coverage tight during the split.
- Add lint rule/enforcer for import ordering: builtins first, then npm/library deps, then relative paths.
10 changes: 9 additions & 1 deletion oxlint.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@
"no-console": "error",
"unicorn/filename-case": ["error", { "case": "camelCase" }],
"@typescript-eslint/no-explicit-any": "error",
"import/order": [
"error",
{
"groups": ["builtin", "external", "internal", "parent", "sibling", "index"],
"newlines-between": "always",
"alphabetize": { "order": "asc", "caseInsensitive": true }
}
],
"import/no-unused-modules": [
"warn",
"error",
{ "missingExports": true, "unusedExports": true }
]
},
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@knighted/module",
"version": "1.3.0",
"version": "1.3.1-rc.0",
"description": "Bidirectional transform for ES modules and CommonJS.",
"type": "module",
"main": "dist/module.js",
Expand Down
Loading