This repository was archived by the owner on Mar 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Windows #4
Merged
Merged
Windows #4
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2b2e2f5
fix(_decode): A file name has OS specific path separator and a key na…
richardschneider 589d0c0
fix(query): glob expects a POSIX path
richardschneider 76f79c0
fix(query): now works on windows
richardschneider 08e7c79
test: sharding fs requires more time
richardschneider 08c157d
chore(ci): build on appveyor
richardschneider 002d7ea
fix(ci): copy and paste error
richardschneider 4e540db
chore(package): don't change contributors, its added automatically on…
richardschneider a705fdc
fix(ci): restrict flow
richardschneider File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
.*/radium/.* | ||
.*/standard-changelog/.* | ||
.*/conventional-changelog-core/.* | ||
.*/node_modules/.* | ||
|
||
[include] | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
version: "{build}" | ||
|
||
environment: | ||
matrix: | ||
- nodejs_version: "6" | ||
|
||
matrix: | ||
fast_finish: true | ||
|
||
install: | ||
# Install Node.js | ||
- ps: Install-Product node $env:nodejs_version | ||
|
||
# Upgrade npm | ||
- npm install -g npm | ||
|
||
# Output our current versions for debugging | ||
- node --version | ||
- npm --version | ||
|
||
# Install our package dependencies | ||
- npm install | ||
|
||
test_script: | ||
- npm run test | ||
|
||
build: off |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
|
||
const fs = require('graceful-fs') | ||
const pull = require('pull-stream') | ||
const glob = require('pull-glob') | ||
const glob = require('glob') | ||
const setImmediate = require('async/setImmediate') | ||
const waterfall = require('async/series') | ||
const each = require('async/each') | ||
|
@@ -136,7 +136,9 @@ class FsDatastore { | |
throw new Error(`Invalid extension: ${path.extname(file)}`) | ||
} | ||
|
||
return new Key(file.slice(this.path.length, -ext.length)) | ||
let keyname = file.slice(this.path.length, -ext.length) | ||
keyname = keyname.split(path.sep).join('/') | ||
return new Key(keyname) | ||
} | ||
|
||
/** | ||
|
@@ -259,7 +261,13 @@ class FsDatastore { | |
* @returns {PullStream} | ||
*/ | ||
query (q /* : Query<Buffer> */) /* : QueryResult<Buffer> */ { | ||
let tasks = [glob(path.join(this.path, '**', '*' + this.opts.extension))] | ||
// glob expects a POSIX path | ||
let prefix = q.prefix || '**' | ||
let pattern = | ||
path.join(this.path, prefix, '*' + this.opts.extension) | ||
.split(path.sep) | ||
.join('/') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't this be the inverse? Split by the key separator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Beg to differ. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah |
||
let tasks = [pull.values(glob.sync(pattern))] | ||
|
||
if (!q.keysOnly) { | ||
tasks.push(pull.asyncMap((f, cb) => { | ||
|
@@ -277,19 +285,10 @@ class FsDatastore { | |
tasks.push(pull.map(f => ({ key: this._decode(f) }))) | ||
} | ||
|
||
let filters = [] | ||
|
||
if (q.prefix != null) { | ||
const prefix = q.prefix | ||
filters.push((e, cb) => cb(null, e.key.toString().startsWith(prefix))) | ||
} | ||
|
||
if (q.filters != null) { | ||
filters = filters.concat(q.filters) | ||
tasks = tasks.concat(q.filters.map(f => asyncFilter(f))) | ||
} | ||
|
||
tasks = tasks.concat(filters.map(f => asyncFilter(f))) | ||
|
||
if (q.orders != null) { | ||
tasks = tasks.concat(q.orders.map(o => asyncSort(o))) | ||
} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this now? Have timeouts increased with this changes? If so, we should have individual timeouts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes a lot of tests were skipped. In particular the
many (3 * 400)
test takes a long time on my top-end laptop when sharding.