WIP - add extractor, generate snippet_data

This commit is contained in:
Stefan Fejes
2019-08-20 15:52:05 +02:00
parent 88084d3d30
commit cc8f1d8a7a
37396 changed files with 4588842 additions and 133 deletions

9
node_modules/mozjpeg/cli.js generated vendored Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env node
'use strict';
const {spawn} = require('child_process');
const mozjpeg = require('.');
const input = process.argv.slice(2);
spawn(mozjpeg, input, {stdio: 'inherit'})
.on('exit', process.exit);

2
node_modules/mozjpeg/index.js generated vendored Normal file
View File

@ -0,0 +1,2 @@
'use strict';
module.exports = require('./lib').path();

13
node_modules/mozjpeg/lib/index.js generated vendored Normal file
View File

@ -0,0 +1,13 @@
'use strict';
const path = require('path');
const BinWrapper = require('bin-wrapper');
const pkg = require('../package.json');
const url = `https://raw.githubusercontent.com/imagemin/mozjpeg-bin/v${pkg.version}/vendor/`;
module.exports = new BinWrapper()
.src(`${url}macos/cjpeg`, 'darwin')
.src(`${url}linux/cjpeg`, 'linux')
.src(`${url}win/cjpeg.exe`, 'win32')
.dest(path.join(__dirname, '../vendor'))
.use(process.platform === 'win32' ? 'cjpeg.exe' : 'cjpeg');

36
node_modules/mozjpeg/lib/install.js generated vendored Normal file
View File

@ -0,0 +1,36 @@
'use strict';
const os = require('os');
const binBuild = require('bin-build');
const log = require('logalot');
const bin = require('.');
const cpuNum = os.cpus().length;
bin.run(['-version']).then(() => {
log.success('mozjpeg pre-build test passed successfully');
}).catch(error => {
log.warn(error.message);
log.warn('mozjpeg pre-build test failed');
log.info('compiling from source');
let cfgExtras = '';
if (process.platform === 'darwin') {
cfgExtras = 'libpng_LIBS=\'/usr/local/lib/libpng16.a -lz\' --enable-static';
}
const cfg = [
`./configure --enable-static --disable-shared --disable-dependency-tracking --with-jpeg8 ${cfgExtras}`,
`--prefix="${bin.dest()}" --bindir="${bin.dest()}" --libdir="${bin.dest()}"`
].join(' ');
binBuild.url('https://github.com/mozilla/mozjpeg/releases/download/v3.2/mozjpeg-3.2-release-source.tar.gz', [
'autoreconf -fiv',
cfg,
`make -j${cpuNum}`,
`make install -j${cpuNum}`
]).then(() => {
log.success('mozjpeg built successfully');
}).catch(error => {
log.error(error.stack);
});
});

9
node_modules/mozjpeg/license generated vendored Normal file
View File

@ -0,0 +1,9 @@
MIT License
Copyright (c) Imagemin
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

82
node_modules/mozjpeg/package.json generated vendored Normal file
View File

@ -0,0 +1,82 @@
{
"_from": "mozjpeg@^6.0.0",
"_id": "mozjpeg@6.0.1",
"_inBundle": false,
"_integrity": "sha512-9Z59pJMi8ni+IUvSH5xQwK5tNLw7p3dwDNCZ3o1xE+of3G5Hc/yOz6Ue/YuLiBXU3ZB5oaHPURyPdqfBX/QYJA==",
"_location": "/mozjpeg",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "mozjpeg@^6.0.0",
"name": "mozjpeg",
"escapedName": "mozjpeg",
"rawSpec": "^6.0.0",
"saveSpec": null,
"fetchSpec": "^6.0.0"
},
"_requiredBy": [
"/imagemin-mozjpeg"
],
"_resolved": "https://registry.npmjs.org/mozjpeg/-/mozjpeg-6.0.1.tgz",
"_shasum": "56969dddb5741ef2bcb1af066cae21e61a91a27b",
"_spec": "mozjpeg@^6.0.0",
"_where": "/Users/stefanfejes/Projects/30-seconds-of-python-code/node_modules/imagemin-mozjpeg",
"ava": {
"serial": true
},
"bin": {
"mozjpeg": "cli.js"
},
"bugs": {
"url": "https://github.com/imagemin/mozjpeg-bin/issues"
},
"bundleDependencies": false,
"dependencies": {
"bin-build": "^3.0.0",
"bin-wrapper": "^4.0.0",
"logalot": "^2.1.0"
},
"deprecated": false,
"description": "mozjpeg wrapper that makes it seamlessly available as a local dependency",
"devDependencies": {
"ava": "*",
"bin-check": "^4.1.0",
"compare-size": "^3.0.0",
"execa": "^1.0.0",
"tempy": "^0.2.1",
"xo": "*"
},
"engines": {
"node": ">=6"
},
"files": [
"index.js",
"cli.js",
"lib"
],
"homepage": "https://github.com/imagemin/mozjpeg-bin#readme",
"keywords": [
"imagemin",
"jpeg",
"jpg",
"img",
"image",
"compress",
"minify",
"mozjpeg",
"optimize"
],
"license": "MIT",
"name": "mozjpeg",
"repository": {
"type": "git",
"url": "git+https://github.com/imagemin/mozjpeg-bin.git"
},
"scripts": {
"build-linux": "docker build --tag imagemin/mozjpeg docker && docker run --rm --volume $(pwd)/vendor/linux:/src/out imagemin/mozjpeg cp cjpeg /src/out",
"postinstall": "node lib/install.js",
"test": "xo && ava"
},
"version": "6.0.1"
}

40
node_modules/mozjpeg/readme.md generated vendored Normal file
View File

@ -0,0 +1,40 @@
# mozjpeg-bin [![Build Status](https://travis-ci.org/imagemin/mozjpeg-bin.svg?branch=master)](http://travis-ci.org/imagemin/mozjpeg-bin)
> [mozjpeg](https://github.com/mozilla/mozjpeg) is a production-quality JPEG encoder that improves compression while maintaining compatibility with the vast majority of deployed decoders
You probably want [`imagemin-mozjpeg`](https://github.com/imagemin/imagemin-mozjpeg) instead.
## Install
```
$ npm install mozjpeg
```
## Usage
```js
const {execFile} = require('child_process');
const mozjpeg = require('mozjpeg');
execFile(mozjpeg, ['-outfile', 'output.jpg', 'input.jpg'], err => {
console.log('Image minified!');
});
```
## CLI
```
$ npm install --global mozjpeg
```
```
$ mozjpeg --help
```
## License
MIT © [Imagemin](https://github.com/imagemin)

BIN
node_modules/mozjpeg/vendor/cjpeg generated vendored Executable file

Binary file not shown.