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: support unixfs metadata and formatting it #14

Merged
merged 6 commits into from
Dec 6, 2019

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Nov 21, 2019

Adds mode and mtime properties to normalised .add inputs, also adds functions for turning metadata into strings for CLI use.

BREAKING CHANGE:

In order to support metadata on intermediate directories, globSource in this module will now emit directories and files where previously it only emitted files.

Copy link
Member

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

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

✨ Really excited for this. Please can we have tests?

realpath: false,
absolute: true
})

for await (const p of glob(path, '**/*', globOptions)) {
if (preserveMode || preserveMtime) {
const stat = await fs.stat(p)
Copy link
Member

Choose a reason for hiding this comment

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

In the future we might get some perf wins by parallel mapping these.

Copy link
Member Author

Choose a reason for hiding this comment

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

Possibly - our bottlenecks typically aren't from reading paths from the filesystem but it's worth measuring before jumping to conclusions. Like I just did. :trollface:

src/files/glob-source.js Show resolved Hide resolved
src/files/glob-source.js Outdated Show resolved Hide resolved
Copy link
Member

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

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

LGTM

@achingbrain
Copy link
Member Author

@hugomrdias if you're happy with this PR could you merge & release it please?

@hugomrdias
Copy link
Member

can you fix the conflicts 🙏

@achingbrain
Copy link
Member Author

@hugomrdias done.

@hugomrdias hugomrdias merged commit 173e4bf into master Dec 6, 2019
@hugomrdias hugomrdias deleted the support-unixfs-metadata branch December 6, 2019 15:06
@achingbrain
Copy link
Member Author

@hugomrdias this went out in the same release as #15 so now UnixFSv1.5 metadata is dependent on the removal of node streams & pull-streams from IPFS, which it shouldn't be.

Can this PR either be backported to 0.4.x or can you do a 0.6.0 release with just this PR and 0.7.0 with this PR and #15 please?

hugomrdias added a commit that referenced this pull request Dec 11, 2019
Adds mode and mtime properties to normalised .add inputs, also adds functions for turning metadata into strings for CLI use.

BREAKING CHANGE:

In order to support metadata on intermediate directories, globSource in this module will now emit directories and files where previously it only emitted files.
hugomrdias added a commit that referenced this pull request Dec 11, 2019
Adds mode and mtime properties to normalised .add inputs, also adds functions for turning metadata into strings for CLI use.

BREAKING CHANGE:

In order to support metadata on intermediate directories, globSource in this module will now emit directories and files where previously it only emitted files.
achingbrain added a commit that referenced this pull request Dec 11, 2019
Adds mode and mtime properties to normalised .add inputs, also adds functions for turning metadata into strings for CLI use.

BREAKING CHANGE:

In order to support metadata on intermediate directories, globSource in this module will now emit directories and files where previously it only emitted files.
hugomrdias pushed a commit that referenced this pull request Dec 11, 2019
Adds mode and mtime properties to normalised .add inputs, also adds functions for turning metadata into strings for CLI use.

BREAKING CHANGE:

In order to support metadata on intermediate directories, globSource in this module will now emit directories and files where previously it only emitted files.
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.

3 participants