deno_std icon indicating copy to clipboard operation
deno_std copied to clipboard

Refactor: Move internals file in node folder to `/node/internal`

Open getspooky opened this issue 3 years ago • 5 comments

Move internals files like _net.ts , _errors , etc to node/internal . Target:

  • [x] _net.ts
  • [x] _async_hooks.ts #2051
  • [x] _buffer.js #2643
  • [x] _dtrace.ts
  • [x] _errors_test.ts, _errors.ts
  • [x] _fixed_queue.ts https://github.com/denoland/deno_std/pull/2064
  • [x] _idna.ts
  • [x] _options.ts #2065
  • [ ] _readline.js
  • [ ] _stream.js
  • [x] _timers.ts #1699
  • [x] _util/_debuglog,ts -> internal/util/debuglog.ts

getspooky avatar Dec 14 '21 16:12 getspooky

@getspooky Thank you for creating this issue!

Right. We should keep the file structure as close as possible to Node.js structure. The above change make sense to me.

BTW node/_core.js is something we invented on our own. Maybe we should keep it somewhere else?

kt3k avatar Dec 15 '21 03:12 kt3k

Also deno_std/node/_buffer.js seems corresponding to node/lib/buffer.js. So let's just rename it to deno_std/node/buffer.js in this case.

Please carefully compare node.js lib/ directory and deno_std node/ directory before starting working on each item

kt3k avatar Dec 15 '21 08:12 kt3k

@kt3k thanks for feedback, i will start working on it

getspooky avatar Dec 15 '21 10:12 getspooky

Also _timers will conflicts with #1699. Please avoid it at first.

kt3k avatar Dec 15 '21 11:12 kt3k

I updated the description, and crossed out some items (_core.ts _events.js _next_tick.ts _utils.ts) which don't seem existing in internal/

kt3k avatar Dec 16 '21 11:12 kt3k

@kt3k, I'll do _readline.mjs. Is there any issue in essentially merging the .mjs and .d.ts files into a .ts file? I gather that .mjs is separated to make following the node version easier to follow.

iuioiua avatar Oct 11 '22 07:10 iuioiua

@iuioiua I think there's no such issue. Do you think we should merge .mjs and .d.ts into .ts?

kt3k avatar Oct 12 '22 11:10 kt3k

Looks these are all done now. Thanks for your efforts!

kt3k avatar Mar 21 '23 06:03 kt3k