Socket
Socket
Sign inDemoInstall

webpack-webfont

Package Overview
Dependencies
287
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.1-alpha.3 to 0.0.1-alpha.4

11

CHANGELOG.md

@@ -0,1 +1,12 @@

# 0.0.1-alpha.4 - 2016-11-09
- Fixed: flush `errors` on every compilation.
- Chore: update a minimal version of `webfont` from `6.0.0` to `7.0.0`.
- Chore: update a minimal version of `eslint-plugin-import` from `2.1.0` to `2.2.0`.
- Chore: update a minimal version of `eslint-plugin-itgalaxy` from `25.0.0` to `26.0.0`.
- Chore: update a minimal version of `eslint-plugin-jsx-a11y` from `2.2.0` to `3.0.0`.
- Chore: update a minimal version of `eslint-plugin-react` from `6.5.0` to `6.6.0`.
- Chore: refactoring for new `webfont` version.
- Chore: improve tests.
# 0.0.1-alpha.3 - 2016-11-08

@@ -2,0 +13,0 @@

116

dist/WebfontPlugin.js

@@ -60,2 +60,4 @@ 'use strict';

if (_this.watcher) {
_this.errors = [];
return done();

@@ -98,78 +100,42 @@ }

if (!options.dest) {
this.errors.push(new Error('Require "dest" argument'));
return callback();
}
if (!options.dest.fontsDir) {
this.errors.push(new Error('Require "fonts" property for "dest" argument'));
return callback();
}
if (options.css && !options.dest.css) {
this.errors.push(new Error('Require "css" property for "dest" argument if you passed "true" "css" argument'));
return callback();
}
return (0, _webfont2.default)(options).then(function (result) {
var promisesFs = [];
var fontsDest = options.dest.fontsDir;
var fontName = result.config.fontName;
var dest = _path2.default.resolve(_this2.options.dest.fontsDir);
if (result.svg) {
promisesFs.push(new Promise(function (resolve, reject) {
return _fsExtra2.default.outputFile(_path2.default.join(fontsDest, fontName + '.svg'), result.svg, function (error) {
if (error) {
return reject(error);
}
var destStyles = null;
return resolve();
});
}));
}
if (result.styles) {
if (_this2.options.dest.stylesDir) {
destStyles = _path2.default.resolve(_this2.options.dest.stylesDir);
}
if (result.ttf) {
promisesFs.push(new Promise(function (resolve, reject) {
return _fsExtra2.default.outputFile(_path2.default.join(fontsDest, fontName + '.ttf'), result.ttf, function (error) {
if (error) {
return reject(error);
}
if (!destStyles) {
destStyles = dest;
}
return resolve();
});
}));
if (result.usedBuildInStylesTemplate) {
destStyles = _path2.default.join(destStyles, result.config.fontName + '.' + result.config.template);
} else {
destStyles = _path2.default.join(destStyles, _path2.default.basename(result.config.template).replace('.njk', ''));
}
}
if (result.eot) {
promisesFs.push(new Promise(function (resolve, reject) {
return _fsExtra2.default.outputFile(_path2.default.join(fontsDest, fontName + '.eot'), result.eot, function (error) {
if (error) {
return reject(error);
}
return Promise.all(Object.keys(result).map(function (type) {
if (type === 'config' || type === 'usedBuildInStylesTemplate') {
return Promise.resolve();
}
return resolve();
});
}));
}
var content = result[type];
var destFilename = null;
if (result.woff) {
promisesFs.push(new Promise(function (resolve, reject) {
return _fsExtra2.default.outputFile(_path2.default.join(fontsDest, fontName + '.woff'), result.woff, function (error) {
if (error) {
return reject(error);
}
if (type !== 'styles') {
destFilename = _path2.default.resolve(_path2.default.join(dest, fontName + '.' + type));
} else {
destFilename = _path2.default.resolve(destStyles);
}
return resolve();
});
}));
}
if (result.woff2) {
promisesFs.push(new Promise(function (resolve, reject) {
return _fsExtra2.default.outputFile(_path2.default.join(fontsDest, fontName + '.woff2'), result.woff2, function (error) {
return new Promise(function (resolve, reject) {
_fsExtra2.default.outputFile(destFilename, content, function (error) {
if (error) {
return reject(error);
return reject(new Error(error));
}

@@ -179,22 +145,4 @@

});
}));
}
if (result.css) {
(function () {
var cssDest = options.dest.css;
promisesFs.push(new Promise(function (resolve, reject) {
return _fsExtra2.default.outputFile(cssDest, result.css, function (error) {
if (error) {
return reject(error);
}
return resolve();
});
}));
})();
}
return Promise.all(promisesFs).then(function () {
});
})).then(function () {
return callback();

@@ -201,0 +149,0 @@ });

{
"name": "webpack-webfont",
"version": "0.0.1-alpha.3",
"version": "0.0.1-alpha.4",
"description": "Webpack plugin for webfont package",

@@ -51,3 +51,3 @@ "license": "MIT",

"dependencies": {
"webfont": "^6.0.0",
"webfont": "^7.0.0",
"fs-extra": "^1.0.0",

@@ -71,5 +71,5 @@ "chokidar": "^1.6.0"

"eslint-plugin-ava": "^4.0.0",
"eslint-plugin-import": "^2.1.0",
"eslint-plugin-itgalaxy": "^25.0.0",
"eslint-plugin-jsx-a11y": "^2.2.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-itgalaxy": "^26.0.0",
"eslint-plugin-jsx-a11y": "^3.0.0",
"eslint-plugin-lodash": "^2.1.0",

@@ -76,0 +76,0 @@ "eslint-plugin-node": "^3.0.0",

@@ -150,5 +150,4 @@ # webpack-webfont

- `fontsDir` - (required) directory fonts saving.
- `css` - (required if you passed `css` argument) path to file with styles.
- `stylesDir` - (optional) directory styles saving.
## Related

@@ -155,0 +154,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with โšก๏ธ by Socket Inc