Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot] cdd27f3033
chore(deps): bump path-parse from 1.0.6 to 1.0.7
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-10 18:51:50 +00:00
13 changed files with 4696 additions and 14698 deletions

View File

@ -14,14 +14,14 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: ['14', '16']
node: ['12', '14']
name: Node ${{ matrix.node }} on ${{ matrix.os }}
name: Node ${{ matrix.node-version }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Test
uses: actions/setup-node@v2.4.1
uses: actions/setup-node@v2.1.5
with:
node-version: ${{ matrix.node }}
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test

1
.gitignore vendored
View File

@ -2,7 +2,6 @@ node_modules
.env
*~
.vscode
.idea
# Parcel build dirs
.cache

View File

@ -63,28 +63,17 @@ your webpack config:
```javascript
// webpack.config.js
var { FilerWebpackPlugin } = require('filer/webpack');
var filer = require('filer');
module.exports = {
plugins: [
new FilerWebpackPlugin(),
new filer.FilerWebpackPlugin(),
],
}
```
---
**NOTE**
Previously it was recommended to access the `FilerWebpackPlugin` class by importing the main filer module. This was depracated due [this issue](https://github.com/filerjs/filer/issues/790). For anyone using ***filer version 1.4.0 or earlier***, please import the plugin class like this:
```javascript
var FilerWebpackPlugin = require('filer/src/webpack-plugin');
```
---
You can then import the node.js [fs](http://nodejs.org/api/fs.html) and [path](http://nodejs.org/api/path.html)
modules as normal and `FilerWebpackPlugin` will ensure that webpack will resolve references to these modules to
modules as normal and FilerWebpackPlugin will ensure that webpack will resolve references to these modules to
the appropriate filer shims. You will then be able to use these modules as normal (with the exception of the
synchronous fs methods e.g. `mkdirSync()`).
@ -101,7 +90,7 @@ options object.
// webpack.config.js
module.exports = {
plugins: [
new FilerWebpackPlugin({
new filer.FilerWebpackPlugin({
// Options
}),
],

10820
dist/filer.js vendored

File diff suppressed because it is too large Load Diff

2
dist/filer.js.map vendored

File diff suppressed because one or more lines are too long

188
dist/filer.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

8253
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,7 @@
"indexeddb",
"idb"
],
"version": "1.4.1",
"version": "1.2.0",
"author": "Alan K <ack@modeswitch.org> (http://blog.modeswitch.org)",
"homepage": "http://filerjs.github.io/filer",
"bugs": "https://github.com/filerjs/filer/issues",
@ -45,41 +45,39 @@
"url": "https://github.com/filerjs/filer.git"
},
"dependencies": {
"es6-promisify": "^7.0.0",
"es6-promisify": "^6.1.0",
"minimatch": "^3.0.4",
"schema-utils": "^3.1.1"
"schema-utils": "^3.0.0"
},
"devDependencies": {
"regenerator-runtime": "^0.13.9",
"chai": "^4.3.4",
"regenerator-runtime": "^0.13.7",
"chai": "^4.3.0",
"chai-datetime": "^1.8.0",
"eslint": "^7.32.0",
"fake-indexeddb": "^3.1.7",
"karma": "^6.3.8",
"eslint": "^7.20.0",
"fake-indexeddb": "^3.1.2",
"karma": "^6.1.1",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^3.1.0",
"karma-firefox-launcher": "^2.1.2",
"karma-firefox-launcher": "^2.1.0",
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"karma-summary-reporter": "^3.0.0",
"meow": "^10.0.1",
"mocha": "^9.1.3",
"karma-summary-reporter": "^2.0.0",
"meow": "^9.0.0",
"mocha": "^8.3.0",
"nyc": "^15.1.0",
"parcel-bundler": "^1.12.5",
"pretty-bytes": "^5.6.0",
"release-it": "^14.11.6",
"parcel-bundler": "^1.12.4",
"pretty-bytes": "^5.5.0",
"release-it": "^14.4.1",
"run.env": "^1.1.0",
"unused-filename": "^3.0.1",
"walk": "^2.3.15"
"unused-filename": "^2.1.0",
"walk": "^2.3.14"
},
"main": "./src/index.js",
"browser": "./dist/filer.min.js",
"files": [
"src",
"lib",
"dist",
"shims",
"webpack"
"dist"
],
"nyc": {
"exclude": [

View File

@ -480,7 +480,7 @@ function access_file(context, path, mode, callback) {
}
// In any other case, the file isn't accessible
callback(new Errors.EACCES('permission denied',path)) ;
callback(new Errors.EACCES('permission denied',path)) ;
});
}
@ -1079,7 +1079,7 @@ function unlink_node(context, path, callback) {
context.putObject(fileNode.id, fileNode, function(error) {
if(error) {
callback(error);
} else {
} else {
update_node_times(context, path, fileNode, { ctime: Date.now() }, update_directory_data);
}
});
@ -1177,7 +1177,7 @@ function read_directory(context, path, options, callback) {
callback(error, dirEnts);
});
}
else {
callback(null, files);
}
@ -1275,12 +1275,12 @@ function make_symbolic_link(context, srcpath, dstpath, callback) {
// but store both versions, since we'll use the relative one in readlink().
if(!isAbsolutePath(srcpath)) {
fileNode.symlink_relpath = srcpath;
srcpath = Path.resolve(parentPath, srcpath);
srcpath = Path.resolve(parentPath, srcpath);
}
fileNode.size = srcpath.length;
fileNode.data = srcpath;
context.putObject(fileNode.id, fileNode, update_directory_data);
});
}
@ -1758,7 +1758,7 @@ function mkdir(context, path, mode, callback) {
mode = validateAndMaskMode(mode, FULL_READ_WRITE_EXEC_PERMISSIONS, callback);
if(!mode) return;
}
make_directory(context, path, callback);
}
@ -1776,14 +1776,14 @@ function mkdtemp(context, prefix, options, callback) {
callback = arguments[arguments.length - 1];
if(!prefix) {
return callback(new Error('filename prefix is required'));
}
}
let random = shared.randomChars(6);
var path = prefix + '-' + random;
var path = prefix + '-' + random;
make_directory(context, path, function(error) {
callback(error, path);
});
});
}
function rmdir(context, path, callback) {
@ -2326,7 +2326,7 @@ function rename(context, oldpath, newpath, callback) {
newpath = normalize(newpath);
var oldParentPath = Path.dirname(oldpath);
var newParentPath = Path.dirname(newpath);
var newParentPath = Path.dirname(oldpath);
var oldName = Path.basename(oldpath);
var newName = Path.basename(newpath);
var oldParentDirectory, oldParentData;

View File

@ -9,15 +9,6 @@ module.exports = Filer = {
path: require('./path.js'),
Errors: require('./errors.js'),
Shell: require('./shell/shell.js'),
/**
* @deprecated Importing filer from your webpack config is not recommended.
*
* The filer `FilerWebpackPlugin` class is exposed directly.
*
* ```
* const { FilerWebpackPlugin } = require('filer/webpack');
* ```
*/
FilerWebpackPlugin: require('./webpack-plugin'),
};

View File

@ -20,7 +20,7 @@ describe('fs.rename', function() {
if(error) throw error;
fs.rename('/myfile', '/myfile', function(error) {
expect(error).not.to.exist;
expect(error).not.to.exist;
done();
});
});
@ -108,35 +108,6 @@ describe('fs.rename', function() {
});
});
it('should rename an existing directory into another sub directory', () => {
var fsPromises = util.fs().promises;
return fsPromises.mkdir('/mydir')
.then(() => fsPromises.mkdir('/mydir/subdir'))
.then(() => fsPromises.mkdir('/anotherdir'))
.then(() => fsPromises.rename('/mydir', '/anotherdir/originaldir'))
.then(() => { fsPromises.stat('/mydir')
.catch((error) => {
expect(error).to.exist;
expect(error.code).to.equal('ENOENT');
});
})
.then(() => { fsPromises.stat('/anotherdir/mydir')
.catch((error) => {
expect(error).to.exist;
expect(error.code).to.equal('ENOENT');
});
})
.then(() => { fsPromises.stat('/anotherdir/originaldir/subdir')
.then(result => {
expect(result.nlinks).to.equal(1);
});
})
.catch((error) => {
if (error) throw error;
});
});
it('should rename an existing directory if the new path points to an existing directory', function(done) {
var fs = util.fs();

View File

@ -1,3 +0,0 @@
module.exports = {
FilerWebpackPlugin: require('../src/webpack-plugin'),
};