Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: deno_std node addition #3319

Merged
merged 12 commits into from Nov 12, 2019

Conversation

@zekth
Copy link
Contributor

zekth commented Nov 11, 2019

Moving the https://github.com/denolib/node to deno_std.

zekth added 6 commits Nov 11, 2019
# Deno Node compatibility

This module is meant to have a compatibility layer for the
[nodeJS standard library](https://nodejs.org/docs/latest-v11.x/api/).

This comment has been minimized.

Copy link
@axetroy

axetroy Nov 11, 2019

Contributor

this should be TLS version

This comment has been minimized.

Copy link
@kevinkassimo

kevinkassimo Nov 11, 2019

Contributor

*LTS

This comment has been minimized.

Copy link
@zekth

zekth Nov 12, 2019

Author Contributor

There is no link directly pointing to LTS version, updated it to aim v12 as it's LTS: https://nodejs.org/en/

Copy link
Contributor

axetroy left a comment

I don't think it's a good time to merge it into deno.

At least, there is no relative discussion.

@kevinkassimo

This comment has been minimized.

Copy link
Contributor

kevinkassimo commented Nov 11, 2019

@axetroy Actually there was some basic discussion in Gitter chatroom.
Moving to std serves to expose this better for contributions and gaining more traction.

isObject,
isError,
isFunction
} from "./util/main.ts";

This comment has been minimized.

Copy link
@kevinkassimo

kevinkassimo Nov 11, 2019

Contributor

Let's change this from main.ts to mod.ts.

I am not quite sure if we should reexpose mod as std/node/util.ts or just leave as std/node/util/mod.ts. The latter follows our recommendation better, while the former might seem more familiar to node users...

This comment has been minimized.

Copy link
@zekth

zekth Nov 12, 2019

Author Contributor

mod.ts seems better yes.
Regarding the exposure it's more like a taste, you have 2 solutions
import { fs } from 'std/node' or import { readfile } from 'std/node/fs' i'm ok with both

This module is meant to have a compatibility layer for the
[nodeJS standard library](https://nodejs.org/docs/latest-v11.x/api/).

**Warning** : Any function of this module do not have to be refered anywhere in

This comment has been minimized.

Copy link
@kevinkassimo

kevinkassimo Nov 11, 2019

Contributor

I assume this is "should not" instead of "do not have to"?
std/node should be able to import utilities from other std modules, but not the other way around IMO.

This comment has been minimized.

Copy link
@hayd

hayd Nov 11, 2019

Contributor

Typo: referred

This comment has been minimized.

Copy link
@zekth

zekth Nov 12, 2019

Author Contributor

I assume this is "should not" instead of "do not have to"?
std/node should be able to import utilities from other std modules, but not the other way around IMO.

that's what i was meaning. Sorry for my engrish

@zekth

This comment has been minimized.

Copy link
Contributor Author

zekth commented Nov 12, 2019

I don't think it's a good time to merge it into deno.

At least, there is no relative discussion.

Ref: https://gitter.im/denolife/Lobby?at=5dbda5dbe1c5e915081e2729

zekth added 3 commits Nov 12, 2019
Copy link
Collaborator

ry left a comment

Looking good ...

@@ -0,0 +1 @@
export { readFile, readFileSync } from "./fs/read_file.ts";

This comment has been minimized.

Copy link
@ry

ry Nov 12, 2019

Collaborator

Maybe just merge read_file.ts into this one - it will make for better docs on Deno.land and also I prefer to keep the number of files small until it becomes unwieldy to have so many functions in a single file - at that point we can break it out. So just fs.ts and fs_test.ts please.

This comment has been minimized.

Copy link
@zekth

zekth Nov 12, 2019

Author Contributor

it was just a direct port but i get your point.

@@ -0,0 +1,122 @@
import { test } from "../../testing/mod.ts";
import { assert } from "../../testing/asserts.ts";
import * as util from "./main.ts";

This comment has been minimized.

Copy link
@ry

ry Nov 12, 2019

Collaborator

main.ts ? I don’t think we should use the file name main.ts in std/node ...

This comment has been minimized.

Copy link
@zekth

zekth Nov 12, 2019

Author Contributor

Yeah, direct port, i'll change this as mentionned in the other comment

zekth added 3 commits Nov 12, 2019
This reverts commit 5665b40.
@ry
ry approved these changes Nov 12, 2019
Copy link
Collaborator

ry left a comment

LGTM - thanks - hopefully this gets more attention in std. I kinda want to add std/node/require.ts now.

@ry ry merged commit ee1b8dc into denoland:master Nov 12, 2019
10 checks passed
10 checks passed
test macOS-latest
Details
test_std macOS-latest
Details
test windows-2019
Details
test_std windows-2019
Details
test ubuntu-16.04
Details
test_debug ubuntu-16.04
Details
test_std ubuntu-16.04
Details
bench ubuntu-16.04
Details
lint ubuntu-16.04
Details
license/cla Contributor License Agreement is signed.
Details
@zekth zekth deleted the zekth:add_denolib_node branch Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants
You can’t perform that action at this time.