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

Consider porting path.swift #392

Closed
ry opened this issue May 11, 2019 · 11 comments
Closed

Consider porting path.swift #392

ry opened this issue May 11, 2019 · 11 comments

Comments

@ry
Copy link
Member

ry commented May 11, 2019

https://github.com/mxcl/path.swift

Seems like a nice api

@zekth
Copy link
Contributor

zekth commented May 12, 2019

Looks nice but all the api?
Seems like you can chain a lot of fs features. Maybe porting it to another repo? Because deno_std.path is already used and may be misunderstanding.

@ry
Copy link
Member Author

ry commented May 13, 2019

It doesn't need to be called "path". That said, I agree it would probably be better developed as an external repo... but if someone felt strongly about it, I would allow it here : )

@zekth
Copy link
Contributor

zekth commented May 13, 2019

I'll start a personnal repo. Let's see how is the interest of it in the futur.

@axetroy
Copy link
Contributor

axetroy commented May 13, 2019

Although I think it is not a standard.

But maybe give it a try and we will see.

@zekth
Copy link
Contributor

zekth commented May 13, 2019

@ry
Copy link
Member Author

ry commented May 13, 2019

@zekth That's not a very good name. 1) it uses dashes instead of underscores 2) 'swift' in the name is confusing.

Better: deno_path2, deno_easypath, deno_fs2, ...

@zekth
Copy link
Contributor

zekth commented May 13, 2019

here we go: https://github.com/zekth/deno_easypath

@axetroy
Copy link
Contributor

axetroy commented May 13, 2019

@zekth

Here is the case.

Your code does not guarantee the order of execution

await Path.home.join("foo").mkdir().copy("bar")

we must rewrite like this:

const actions = Path.home.join("foo").mkdir().copy("bar"); // It just push the action to the queue

await actions.exec(); // execute the actions in the queue

@zekth
Copy link
Contributor

zekth commented May 13, 2019

I've not spotted those kind of example when i first read the documentation. You're right.

Btw i think this is revelant to add also a Sync implementation.

@zekth
Copy link
Contributor

zekth commented May 16, 2019

Improved the API and the chaining:
https://github.com/zekth/deno_easypath

Also waiting for #278 to land for copy and will work on LS to be as tied as path.swift.

Suggestions welcome.

Thanks to @bartlomieju for the contributing.

@ry
Copy link
Member Author

ry commented May 16, 2019

@zekth Nice! Consider submitting it to the registry.

Also, the "new EasyPath" seems kinda weird. Why not have a constructor function?

import { path } from "https://deno.land/x/easypath/mod.ts";

path()
  .join("foo")
  .join("bar.ts")
  .toString(); // output foo/bar.ts

@ry ry closed this as completed May 16, 2019
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

No branches or pull requests

3 participants