Skip to content

WIP: Support namespace prefixes - #2022

Open
kan0neego wants to merge 1 commit into
metarhia:masterfrom
kan0neego:ref/node-alias
Open

kan0neego wants to merge 1 commit into
metarhia:masterfrom
kan0neego:ref/node-alias

Conversation

@kan0neego

Copy link
Copy Markdown
Contributor
  • Remove direct assignment of original name; only camelCase key is used
  • Normalize by replacing '/' and '_' with '-' before camelCase conversion
  • Strip node: prefix for built-in modules
  • Remove explicit aliases for childProcess, StringDecoder, perfHooks, asyncHooks, and timers/promises
  • Add test to ensure no module keys contain forbidden characters (node:, -, _)
  • tests and linter show no problems (npm t)
  • tests are added/updated for bug fixes and new features
  • code is properly formatted (npm run fix)
  • description of changes is added in CHANGELOG.md
  • update .d.ts typings

- Remove direct assignment of original name; only camelCase key is used
- Normalize by replacing '/' and '_' with '-' before camelCase conversion
- Strip `node:` prefix for built-in modules
- Remove explicit aliases for childProcess, StringDecoder, perfHooks, asyncHooks, and timers/promises
- Add test to ensure no module keys contain forbidden characters (`node:`, `-`, `_`)

@tshemsedinov tshemsedinov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The direction looks good.

A few changes are needed before merge:

  • "name.splice(1)" should be "name.slice(1)"
  • The new test doesn't actually check forbidden characters
  • I would like to have both normalized and not normalized names
  • I suggest making the normalization rule explicit and consistent:
node:fs/promises      -> node.fsPromises
node:child_process    -> node.childProcess
node:string_decoder   -> node.stringDecoder
node:stream/consumers -> node.streamConsumers

Then we can remove all special aliases, including "StringDecoder" and "fsp".

@tshemsedinov

Copy link
Copy Markdown
Member

Also we do not use semantic commit messages like feat: etc.

@tshemsedinov tshemsedinov changed the title refactor(deps): simplify namespace assignment and remove aliases Support namespace prefixes Aug 13, 2026
@tshemsedinov

Copy link
Copy Markdown
Member

I'll land this after fixes with commit nama: Support namespace prefixes

@tshemsedinov tshemsedinov changed the title Support namespace prefixes WIP: Support namespace prefixes Aug 13, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants