postcss-font-grabber
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -100,3 +100,3 @@ 'use strict'; | ||
if (res.statusCode !== 200) { | ||
reject('Remote server respond HTTP status: ' + res.statusCode + ' instead of 200.'); | ||
reject(new Error('Remote server respond HTTP status: ' + res.statusCode + ' instead of 200.')); | ||
return; | ||
@@ -127,2 +127,2 @@ } | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9saWIvZG93bmxvYWRlci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7QUFJQTs7OztBQUNBOzs7Ozs7OztJQUdNLFU7Ozs7Ozs7Ozs7QUFjSix3QkFBZTtBQUFBOztBQUNiLFNBQUssVUFBTDtBQUNBLFNBQUssUUFBTDtBQUNEOzs7Ozs7Ozs7Ozs7Ozs7K0JBTVcsTyxFQUFTO0FBQ25CLFdBQUssSUFBTCxHQUFZLE9BQVo7QUFDRDs7Ozs7Ozs7OzZCQU1TLEssRUFBTztBQUNmLFdBQUssRUFBTCxHQUFVLEtBQVY7QUFDRDs7Ozs7Ozs7Ozs7OzZCQVNTLE0sRUFBUSxRLEVBQVU7QUFBQTs7QUFDMUIsYUFBTyxJQUFJLE9BQUosQ0FBWSxVQUFDLE9BQUQsRUFBVSxNQUFWLEVBQXFCO0FBQ3RDLFlBQU0saUJBQWlCLE1BQUssRUFBTCxDQUFRLGlCQUFSLENBQTBCLFFBQTFCLENBQXZCOzs7Ozs7O0FBT0EsY0FBSyxJQUFMLENBQVUsR0FBVixjQUNLLE1BREw7QUFFRSxvQkFBVTtBQUZaLFlBR0csU0FBUyxpQkFBVCxDQUE0QixHQUE1QixFQUFpQzs7Ozs7O0FBTWxDLGNBQUksSUFBSSxVQUFKLEtBQW1CLEdBQXZCLEVBQTRCO0FBQzFCLDJEQUE2QyxJQUFJLFVBQWpEO0FBQ0E7QUFDRD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B9KTtcbiAgICAgIH0pO1xuICAgIH0pO1xuICB9XG59XG5cbi8vXG4vLyBFeHBvc2UgZGVmYXVsdC5cbi8vXG5leHBvcnQgZGVmYXVsdCBEb3dubG9hZGVyO1xuIl19 |
@@ -184,2 +184,7 @@ 'use strict'; | ||
// | ||
// This will be used to calculate relative path. | ||
// | ||
var cssFileDirPath = _path2.default.dirname(cssFilePath); | ||
// | ||
// One src could have multiple `url()`, they are separated with `,`. | ||
@@ -220,6 +225,6 @@ // | ||
// The font file might be saved in a different directory to the CSS | ||
// file, before replace the CSS rule, we have to derive the relative | ||
// file, before replace the CSS rule, we have to derive the relative | ||
// path between them. | ||
// | ||
var relativePath = _path2.default.relative(_path2.default.dirname(cssFilePath), saveDirPath); | ||
var relativePath = _path2.default.relative(cssFileDirPath, saveDirPath); | ||
@@ -314,2 +319,2 @@ // | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9saWIvZm9udC1ncmFiYmVyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7O0FBR0E7Ozs7QUFDQTs7OztBQUNBOzs7O0FBQ0E7O0lBQVksTzs7QUFDWjs7Ozs7Ozs7Ozs7Ozs7SUFNTSxXOzs7Ozs7Ozs7Ozs7OzJDQVUyQixXLEVBQWE7QUFDMUMsVUFBSSxDQUFFLFlBQVksSUFBbEIsRUFBd0I7QUFDdEIsY0FBTSxJQUFJLEtBQUosQ0FBVSxzREFBVixDQUFOO0FBQ0Q7QUFDRCxVQUFJLENBQUUsWUFBWSxFQUFsQixFQUFzQjtBQUNwQixjQUFNLElBQUksS0FBSixDQUFVLG9EQUFWLENBQU47QUFDRDtBQUNGOzs7Ozs7Ozs7Ozs7Ozt1Q0FPMEIsUSxFQUFVO0FBQ25DLGFBQU8sVUFBQyxJQUFELEVBQVU7QUFDZixhQUFLLElBQUwsQ0FBVSxR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HRzLCBwb3N0Y3NzT3B0cyk7XG5cbiAgICAgIC8vXG4gICAgICAvLyBQcm9jZXNzIGV2ZXJ5IERlY2xhcmF0aW9uIHRoYXQgbWF0Y2hzIHJ1bGUgYGZvbnQtZmFjZWAgY29uY3VycmVudGx5LlxuICAgICAgLy9cbiAgICAgIGxldCBwcm9jZXNzUHJvbWlzZXMgPSBbXTtcblxuICAgICAgY29uc3QgZGVjbGFyYXRpb25Qcm9jZXNzb3IgPSAoZGVjbCkgPT4ge1xuICAgICAgICBpZiAoRm9udEdyYWJiZXIuc2hvdWxkUHJvY2Vzc1RoaXNGb250RmFjZURlY2xhcmF0aW9uKGRlY2wpKSB7XG4gICAgICAgICAgcHJvY2Vzc1Byb21pc2VzLnB1c2goXG4gICAgICAgICAgICBGb250R3JhYmJlci5kb3dubG9hZEZvbnRBbmRVcGRhdGVEZWNsYXJhdGlvbihkZWNsLCBvcHRzLmRpclBhdGgsIHBvc3Rjc3NPcHRzLnRvKVxuICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgICAgIH07XG5cbiAgICAgIGNzcy53YWxrQXRSdWxlcygvZm9udC1mYWNlLywgRm9udEdyYWJiZXIuaXRlcmF0ZUNTU1J1bGVXaXRoKGRlY2xhcmF0aW9uUHJvY2Vzc29yKSk7XG5cbiAgICAgIHJldHVybiAoXG4gICAgICAgIHByb2Nlc3NQcm9taXNlcy5sZW5ndGggPT09IDAgP1xuICAgICAgICBQcm9taXNlLnJlc29sdmUoKSA6XG4gICAgICAgIFByb21pc2UuYWxsKHByb2Nlc3NQcm9taXNlcylcbiAgICAgICk7XG4gICAgfTtcbiAgfVxufVxuXG5leHBvcnQgZGVmYXVsdCBGb250R3JhYmJlcjsiXX0= |
{ | ||
"name": "postcss-font-grabber", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Grab remote font in @font-face, download it and update your CSS, end of story.", | ||
@@ -5,0 +5,0 @@ "author": "AaronJan <aaronjan@qq.com>", |
@@ -13,2 +13,8 @@ # PostCSS Font Grabber | ||
## Installation | ||
``` | ||
npm install postcss-font-grabber --save-dev | ||
``` | ||
## Example | ||
@@ -104,11 +110,2 @@ | ||
## Roadmap | ||
1. Grab local file. | ||
2. Rename font file name automatically (Configurable). | ||
3. Just replace the rule, do not download the font file. | ||
## License | ||
@@ -122,2 +119,3 @@ | ||
[PostCSS](https://github.com/postcss/postcss) | ||
[PostCSS Copy Assets](https://github.com/shutterstock/postcss-copy-assets) |
@@ -70,3 +70,3 @@ /** | ||
if (res.statusCode !== 200) { | ||
reject(`Remote server respond HTTP status: ${res.statusCode} instead of 200.`); | ||
reject(new Error(`Remote server respond HTTP status: ${res.statusCode} instead of 200.`)); | ||
return; | ||
@@ -73,0 +73,0 @@ } |
@@ -139,2 +139,7 @@ /** | ||
// | ||
// This will be used to calculate relative path. | ||
// | ||
const cssFileDirPath = path.dirname(cssFilePath); | ||
// | ||
// One src could have multiple `url()`, they are separated with `,`. | ||
@@ -178,7 +183,7 @@ // | ||
// The font file might be saved in a different directory to the CSS | ||
// file, before replace the CSS rule, we have to derive the relative | ||
// file, before replace the CSS rule, we have to derive the relative | ||
// path between them. | ||
// | ||
const relativePath = path.relative( | ||
path.dirname(cssFilePath), | ||
cssFileDirPath, | ||
saveDirPath | ||
@@ -185,0 +190,0 @@ ); |
@@ -11,3 +11,3 @@ /** | ||
*/ | ||
test('download file but get an error', async t => { | ||
test('download file', async t => { | ||
t.plan(2); | ||
@@ -33,2 +33,24 @@ | ||
* | ||
*/ | ||
test('download file but get an error', async t => { | ||
t.plan(3); | ||
const downloader = new Downloader(); | ||
const fs = makeMockFS(); | ||
const http = makeMockHttp(404); | ||
const remoteUrlObject = url.parse('http://dummy.com'); | ||
const filePath = '/var/dummy.file'; | ||
downloader.setFsLib(fs); | ||
downloader.setHttpLib(http); | ||
await t.throws(downloader.download(remoteUrlObject, filePath), Error, 'get an Error when HTTP statue code isn\'t 200'); | ||
t.is(fs.getFilePath(), filePath); | ||
t.deepEqual(remoteUrlObject, http.getOptions(), 'url must be received'); | ||
}); | ||
/** | ||
* | ||
* @returns {FileSystem} | ||
@@ -75,5 +97,6 @@ */ | ||
* | ||
* @param statusCode | ||
* @returns {Http} | ||
*/ | ||
function makeMockHttp () { | ||
function makeMockHttp (statusCode = 200) { | ||
class Http { | ||
@@ -90,3 +113,3 @@ options; | ||
const mockRes = { | ||
statusCode: 200, | ||
statusCode: statusCode, | ||
@@ -93,0 +116,0 @@ pipe (dest, options) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67848
1025
119