first commit

This commit is contained in:
s.golasch
2023-08-01 13:49:46 +02:00
commit 1fc239fd54
20238 changed files with 3112246 additions and 0 deletions

12
build/node_modules/favicons/.editorconfig generated vendored Normal file
View File

@@ -0,0 +1,12 @@
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[{*.json, *.yml, .eslintrc}]
indent_size = 2

347
build/node_modules/favicons/.eslintrc generated vendored Normal file
View File

@@ -0,0 +1,347 @@
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "script",
"ecmaFeatures": {
"arrowFunctions": true,
"binaryLiterals": true,
"blockBindings": true,
"classes": true,
"defaultParams": true,
"destructuring": true,
"forOf": true,
"generators": true,
"modules": false,
"objectLiteralComputedProperties": true,
"objectLiteralDuplicateProperties": true,
"objectLiteralShorthandMethods": true,
"objectLiteralShorthandProperties": true,
"octalLiterals": true,
"regexUFlag": true,
"regexYFlag": true,
"restParams": true,
"spread": true,
"superInFunctions": true,
"templateStrings": true,
"unicodeCodePointEscapes": true,
"globalReturn": true,
"jsx": false,
"experimentalObjectRestSpread": false
}
},
"env": {
"browser": false,
"node": true,
"commonjs": false,
"es6": true,
"worker": false,
"amd": false,
"mocha": false,
"jasmine": false,
"jest": false,
"phantomjs": false,
"protractor": false,
"qunit": false,
"jquery": false,
"prototypejs": false,
"shelljs": false,
"meteor": false,
"mongo": false,
"applescript": false,
"nashorn": false,
"serviceworker": false,
"atomtest": false,
"embertest": false,
"webextensions": false,
"greasemonkey": false
},
"globals": {
"Typekit": true
},
"plugins": [
],
"rules": {
"comma-dangle": [2, "never"],
"no-cond-assign": [2, "always"],
"no-console": 0,
"no-constant-condition": 2,
"no-control-regex": 2,
"no-debugger": 2,
"no-dupe-args": 2,
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-empty-character-class": 2,
"no-empty": 2,
"no-ex-assign": 2,
"no-extra-boolean-cast": 2,
"no-extra-parens": [2, "functions"],
"no-extra-semi": 2,
"no-func-assign": 2,
"no-inner-declarations": [2, "both"],
"no-invalid-regexp": 2,
"no-irregular-whitespace": 2,
"no-negated-in-lhs": 2,
"no-obj-calls": 2,
"no-regex-spaces": 2,
"no-sparse-arrays": 2,
"no-unexpected-multiline": 2,
"no-unreachable": 2,
"use-isnan": 2,
"valid-jsdoc": 0,
"valid-typeof": 2,
"accessor-pairs": [2, {
"getWithoutSet": true
}],
"block-scoped-var": 2,
"complexity": 0,
"consistent-return": 0,
"curly": [2, "all"],
"default-case": 2,
"dot-location": [2, "property"],
"dot-notation": [2, {
"allowKeywords": true,
"allowPattern": "^[a-z]+(_[a-z]+)+$"
}],
"eqeqeq": [2, "allow-null"],
"guard-for-in": 2,
"no-alert": 2,
"no-caller": 2,
"no-case-declarations": 2,
"no-div-regex": 2,
"no-else-return": 2,
"no-empty-pattern": 2,
"no-eq-null": 2,
"no-eval": 2,
"no-extend-native": 0,
"no-extra-bind": 2,
"no-fallthrough": 2,
"no-floating-decimal": 2,
"no-implicit-coercion": [2, {
"boolean": true,
"number": true,
"string": true
}],
"no-implied-eval": 2,
"no-invalid-this": 2,
"no-iterator": 2,
"no-labels": 0,
"no-lone-blocks": 2,
"no-loop-func": 2,
"no-magic-numbers": [2, {
"ignore": [-1, 0, 1, 2, 100],
"ignoreArrayIndexes": true
}],
"no-multi-spaces": [2, {
"exceptions": {}
}],
"no-multi-str": 2,
"no-native-reassign": [2, {
"exceptions": []
}],
"no-new-func": 2,
"no-new-wrappers": 2,
"no-new": 2,
"no-octal-escape": 2,
"no-octal": 2,
"no-param-reassign": 0,
"no-process-env": 0,
"no-proto": 2,
"no-redeclare": [2, {
"builtinGlobals": true
}],
"no-return-assign": [2, "except-parens"],
"no-script-url": 2,
"no-self-compare": 2,
"no-sequences": 2,
"no-throw-literal": 2,
"no-unused-expressions": [2, {
"allowShortCircuit": true,
"allowTernary": true
}],
"no-useless-call": 2,
"no-useless-concat": 2,
"no-void": 2,
"no-warning-comments": [2, {
"terms": ["todo", "fixme", "xxx"],
"location": "anywhere"
}],
"no-with": 2,
"radix": [2, "always"],
"vars-on-top": 2,
"wrap-iife": [2, "outside"],
"yoda": [2, "never", {
"exceptRange": false,
"onlyEquality": false
}],
"strict": [2, "function"],
"init-declarations": [2, "always"],
"no-catch-shadow": 2,
"no-delete-var": 2,
"no-label-var": 2,
"no-shadow-restricted-names": 2,
"no-shadow": [2, {
"builtinGlobals": true,
"hoist": "all",
"allow": []
}],
"no-undef-init": 2,
"no-undef": [2, {
"typeof": true
}],
"no-undefined": 2,
"no-unused-vars": [2, {
"vars": "all",
"args": "after-used",
"argsIgnorePattern": ""
}],
"no-use-before-define": 2,
"callback-return": [2, ["callback", "cb", "next"]],
"global-require": 2,
"handle-callback-err": [2, "^(err|error)$"],
"no-mixed-requires": [0, {
"grouping": false
}],
"no-new-require": 2,
"no-path-concat": 2,
"no-process-exit": 2,
"no-restricted-modules": [0, ""],
"no-sync": 2,
"array-bracket-spacing": [2, "never"],
"block-spacing": [2, "always"],
"brace-style": [2, "1tbs", {
"allowSingleLine": true
}],
"camelcase": [0, {
"properties": "always"
}],
"comma-spacing": [2, {
"before": false,
"after": true
}],
"comma-style": [2, "last"],
"computed-property-spacing": [2, "never"],
"consistent-this": [2, "that"],
"eol-last": 2,
"func-names": 2,
"func-style": [2, "declaration", {
"allowArrowFunctions": false
}],
"id-length": [0, {
"min": 1,
"max": 20,
"properties": "never",
"exceptions": []
}],
"id-match": 0,
"indent": 0,
"jsx-quotes": 0,
"key-spacing": [2, {
"beforeColon": false,
"afterColon": true
}],
"keyword-spacing": [2, {
"before": true,
"after": true
}],
"linebreak-style": [2, "unix"],
"lines-around-comment": 0,
"max-depth": 0,
"max-len": 0,
"max-nested-callbacks": [2, 5],
"max-params": 0,
"max-statements": 0,
"new-cap": [0, {
"capIsNewExceptions": []
}],
"new-parens": 2,
"newline-after-var": [2, "always"],
"no-array-constructor": 2,
"no-bitwise": 0,
"no-continue": 0,
"no-inline-comments": 0,
"no-lonely-if": 2,
"no-mixed-spaces-and-tabs": 2,
"no-multiple-empty-lines": [2, {
"max": 1,
"maxEOF": 1
}],
"no-negated-condition": 2,
"no-nested-ternary": 2,
"no-new-object": 2,
"no-plusplus": 0,
"no-restricted-syntax": 0,
"no-spaced-func": 2,
"no-ternary": 0,
"no-trailing-spaces": [2, {
"skipBlankLines": false
}],
"no-underscore-dangle": [2, {
"allow": []
}],
"no-unneeded-ternary": 2,
"object-curly-spacing": [2, "always"],
"one-var": 0,
"operator-assignment": [2, "always"],
"operator-linebreak": [2, "none", {
"overrides": {}
}],
"padded-blocks": 0,
"quote-props": [2, "as-needed"],
"quotes": [2, "single"],
"require-jsdoc": 0,
"semi-spacing": [2, {
"before": false,
"after": true
}],
"semi": [2, "always"],
"sort-vars": 0,
"space-before-blocks": [2, "always"],
"space-before-function-paren": [2, "always"],
"space-in-parens": [2, "never"],
"space-infix-ops": [2, {
"int32Hint": false
}],
"space-unary-ops": [1, {
"words": true,
"nonwords": false
}],
"spaced-comment": [2, "always"],
"wrap-regex": 2,
"arrow-body-style": [2, "as-needed"],
"arrow-parens": [2, "always"],
"arrow-spacing": [2, {
"before": true,
"after": true
}],
"constructor-super": 2,
"generator-star-spacing": [2, {
"before": true,
"after": false
}],
"no-arrow-condition": 0,
"no-class-assign": 2,
"no-const-assign": 2,
"no-dupe-class-members": 2,
"no-this-before-super": 2,
"no-var": 2,
"object-shorthand": [2, "properties"],
"prefer-arrow-callback": 2,
"prefer-const": 2,
"prefer-reflect": [2, {
"exceptions": []
}],
"prefer-spread": 2,
"prefer-template": 2,
"require-yield": 2
}
}

1
build/node_modules/favicons/.gitattributes generated vendored Normal file
View File

@@ -0,0 +1 @@
* text=auto

92
build/node_modules/favicons/.npmignore generated vendored Normal file
View File

@@ -0,0 +1,92 @@
# Created by https://www.gitignore.io/api/node,osx,windows
### Node ###
# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directory
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
node_modules
### OSX ###
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
### Custom ###
test/test.html
test/stream.html
test/rfg.html
test/output/
test/files-offline
test/files-online
test/images-offline
test/images-online
test/stream

3
build/node_modules/favicons/.travis.yml generated vendored Normal file
View File

@@ -0,0 +1,3 @@
sudo: false
language: node_js
node_js: "stable"

21
build/node_modules/favicons/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2016 Hayden Bleasel
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.

29
build/node_modules/favicons/config/defaults.json generated vendored Normal file
View File

@@ -0,0 +1,29 @@
{
"appName": null,
"appDescription": null,
"developerName": null,
"developerURL": null,
"background": "#fff",
"dir": "auto",
"lang": "en-US",
"path": "/",
"url": "/",
"display": "standalone",
"orientation": "any",
"start_url": "/?homescreen=1",
"version": "1.0",
"logging": false,
"online": false,
"preferOnline": false,
"pipeHTML": false,
"icons": {
"android": true,
"appleIcon": true,
"appleStartup": true,
"coast": true,
"favicons": true,
"firefox": true,
"windows": true,
"yandex": true
}
}

105
build/node_modules/favicons/config/files.json generated vendored Normal file
View File

@@ -0,0 +1,105 @@
{
"android": {
"manifest.json": {
"name": "Favicons",
"short_name": "Favicons",
"description": "Favicons",
"dir": "auto",
"lang": "en-US",
"display": "standalone",
"orientation": "portrait",
"start_url": "./?utm_source=web_app_manifest",
"background_color": "#FFFFFF",
"theme_color": "#FFFFFF",
"icons": [
{
"src": "android-chrome-36x36.png",
"sizes": "36x36",
"type": "image/png"
},
{
"src": "android-chrome-48x48.png",
"sizes": "48x48",
"type": "image/png"
},
{
"src": "android-chrome-72x72.png",
"sizes": "72x72",
"type": "image/png"
},
{
"src": "android-chrome-96x96.png",
"sizes": "96x96",
"type": "image/png"
},
{
"src": "android-chrome-144x144.png",
"sizes": "144x144",
"type": "image/png"
},
{
"src": "android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "android-chrome-256x256.png",
"sizes": "256x256",
"type": "image\/png"
},
{
"src": "android-chrome-384x384.png",
"sizes": "384x384",
"type": "image\/png"
},
{
"src": "android-chrome-512x512.png",
"sizes": "512x512",
"type": "image\/png"
}
]
}
},
"firefox": {
"manifest.webapp": {
"version": "1.0",
"name": "Favicons",
"description": "Favicon generator for Node.js",
"icons": {
"60": "firefox_app_60x60.png",
"128": "firefox_app_128x128.png",
"512": "firefox_app_512x512.png"
},
"developer": {
"name": "Favicons",
"url": "http://favicons.io"
}
}
},
"windows": {
"browserconfig.xml": [
{ "name": "browserconfig", "children": [
{ "name": "msapplication", "children": [
{ "name": "tile", "children": [
{ "name": "square70x70logo", "attrs": { "src": "mstile-70x70.png" } },
{ "name": "square150x150logo", "attrs": { "src": "mstile-150x150.png" } },
{ "name": "wide310x150logo", "attrs": { "src": "mstile-310x150.png" } },
{ "name": "square310x310logo", "attrs": { "src": "mstile-310x310.png" } },
{ "name": "TileColor", "text": "#FFFFFF" }
]}
]}
]}
]
},
"yandex": {
"yandex-browser-manifest.json": {
"version": 1,
"api_version": 1,
"layout": {
"logo": "yandex-browser-50x50.png",
"color": "#FFFFFF",
"show_title": true
}
}
}
}

50
build/node_modules/favicons/config/html.json generated vendored Normal file
View File

@@ -0,0 +1,50 @@
{
"android": {
"link[rel='manifest'][href$='manifest.json']": "<link rel='manifest' href='manifest.json'>",
"meta[name='mobile-web-app-capable']": "<meta name='mobile-web-app-capable' content='yes'>",
"meta[name='theme-color']": "<meta name='theme-color' content='#FFFFFF'>",
"meta[name='application-name']": "<meta name='application-name' content='Application'>"
},
"appleIcon": {
"link[rel='apple-touch-icon'][sizes='57x57'][href$='apple-touch-icon-57x57.png']": "<link rel='apple-touch-icon' sizes='57x57' href='apple-touch-icon-57x57.png'>",
"link[rel='apple-touch-icon'][sizes='60x60'][href$='apple-touch-icon-60x60.png']": "<link rel='apple-touch-icon' sizes='60x60' href='apple-touch-icon-60x60.png'>",
"link[rel='apple-touch-icon'][sizes='72x72'][href$='apple-touch-icon-72x72.png']": "<link rel='apple-touch-icon' sizes='72x72' href='apple-touch-icon-72x72.png'>",
"link[rel='apple-touch-icon'][sizes='76x76'][href$='apple-touch-icon-76x76.png']": "<link rel='apple-touch-icon' sizes='76x76' href='apple-touch-icon-76x76.png'>",
"link[rel='apple-touch-icon'][sizes='114x114'][href$='apple-touch-icon-114x114.png']": "<link rel='apple-touch-icon' sizes='114x114' href='apple-touch-icon-114x114.png'>",
"link[rel='apple-touch-icon'][sizes='120x120'][href$='apple-touch-icon-120x120.png']": "<link rel='apple-touch-icon' sizes='120x120' href='apple-touch-icon-120x120.png'>",
"link[rel='apple-touch-icon'][sizes='144x144'][href$='apple-touch-icon-144x144.png']": "<link rel='apple-touch-icon' sizes='144x144' href='apple-touch-icon-144x144.png'>",
"link[rel='apple-touch-icon'][sizes='152x152'][href$='apple-touch-icon-152x152.png']": "<link rel='apple-touch-icon' sizes='152x152' href='apple-touch-icon-152x152.png'>",
"link[rel='apple-touch-icon'][sizes='180x180'][href$='apple-touch-icon-180x180.png']": "<link rel='apple-touch-icon' sizes='180x180' href='apple-touch-icon-180x180.png'>",
"meta[name='apple-mobile-web-app-capable']": "<meta name='apple-mobile-web-app-capable' content='yes'>",
"meta[name='apple-mobile-web-app-status-bar-style']": "<meta name='apple-mobile-web-app-status-bar-style' content='black-translucent'>",
"meta[name='apple-mobile-web-app-title']": "<meta name='apple-mobile-web-app-title' content='Application'>"
},
"appleStartup": {
"link[rel='apple-touch-startup-image'][media='(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 1)'][href$='apple-touch-startup-image-320x460.png']": "<link rel='apple-touch-startup-image' media='(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 1)' href='apple-touch-startup-image-320x460.png'>",
"link[rel='apple-touch-startup-image'][media='(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 2)'][href$='apple-touch-startup-image-640x920.png']": "<link rel='apple-touch-startup-image' media='(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 2)' href='apple-touch-startup-image-640x920.png'>",
"link[rel='apple-touch-startup-image'][media='(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)'][href$='apple-touch-startup-image-640x1096.png']": "<link rel='apple-touch-startup-image' media='(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)' href='apple-touch-startup-image-640x1096.png'>",
"link[rel='apple-touch-startup-image'][media='(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)'][href$='apple-touch-startup-image-750x1294.png']": "<link rel='apple-touch-startup-image' media='(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)' href='apple-touch-startup-image-750x1294.png'>",
"link[rel='apple-touch-startup-image'][media='(device-width: 414px) and (device-height: 736px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 3)'][href$='apple-touch-startup-image-1182x2208.png']": "<link rel='apple-touch-startup-image' media='(device-width: 414px) and (device-height: 736px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 3)' href='apple-touch-startup-image-1182x2208.png'>",
"link[rel='apple-touch-startup-image'][media='(device-width: 414px) and (device-height: 736px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 3)'][href$='apple-touch-startup-image-1242x2148.png']": "<link rel='apple-touch-startup-image' media='(device-width: 414px) and (device-height: 736px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 3)' href='apple-touch-startup-image-1242x2148.png'>",
"link[rel='apple-touch-startup-image'][media='(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 1)'][href$='apple-touch-startup-image-748x1024.png']": "<link rel='apple-touch-startup-image' media='(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 1)' href='apple-touch-startup-image-748x1024.png'>",
"link[rel='apple-touch-startup-image'][media='(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 1)'][href$='apple-touch-startup-image-768x1004.png']": "<link rel='apple-touch-startup-image' media='(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 1)' href='apple-touch-startup-image-768x1004.png'>",
"link[rel='apple-touch-startup-image'][media='(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)'][href$='apple-touch-startup-image-1496x2048.png']": "<link rel='apple-touch-startup-image' media='(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)' href='apple-touch-startup-image-1496x2048.png'>",
"link[rel='apple-touch-startup-image'][media='(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)'][href$='apple-touch-startup-image-1536x2008.png']": "<link rel='apple-touch-startup-image' media='(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)' href='apple-touch-startup-image-1536x2008.png'>"
},
"coast": {
"link[rel='icon'][type='image/png'][sizes='228x228'][href$='coast-228x228.png']": "<link rel='icon' type='image/png' sizes='228x228' href='coast-228x228.png'>"
},
"favicons": {
"link[rel='icon'][type='image/png'][sizes='32x32'][href$='favicon-32x32.png']": "<link rel='icon' type='image/png' sizes='32x32' href='favicon-32x32.png'>",
"link[rel='icon'][type='image/png'][sizes='16x16'][href$='favicon-16x16.png']": "<link rel='icon' type='image/png' sizes='16x16' href='favicon-16x16.png'>",
"link[rel='shortcut icon'][href$='favicon.ico']": "<link rel='shortcut icon' href='favicon.ico'>"
},
"windows": {
"meta[name='msapplication-TileColor']": "<meta name='msapplication-TileColor' content='#FFFFFF'>",
"meta[name='msapplication-TileImage'][content$='mstile-144x144.png']": "<meta name='msapplication-TileImage' content='mstile-144x144.png'>",
"meta[name='msapplication-config'][content$='browserconfig.xml']": "<meta name='msapplication-config' content='browserconfig.xml'>"
},
"yandex": {
"link[rel='yandex-tableau-widget'][href$='yandex-browser-manifest.json']": "<link rel='yandex-tableau-widget' href='yandex-browser-manifest.json'>"
}
}

340
build/node_modules/favicons/config/icons.json generated vendored Normal file
View File

@@ -0,0 +1,340 @@
{
"android": {
"android-chrome-36x36.png": {
"width": 36,
"height": 36,
"transparent": true,
"rotate": false,
"mask": false
},
"android-chrome-48x48.png": {
"width": 48,
"height": 48,
"transparent": true,
"rotate": false,
"mask": false
},
"android-chrome-72x72.png": {
"width": 72,
"height": 72,
"transparent": true,
"rotate": false,
"mask": false
},
"android-chrome-96x96.png": {
"width": 96,
"height": 96,
"transparent": true,
"rotate": false,
"mask": false
},
"android-chrome-144x144.png": {
"width": 144,
"height": 144,
"transparent": true,
"rotate": false,
"mask": false
},
"android-chrome-192x192.png": {
"width": 192,
"height": 192,
"transparent": true,
"rotate": false,
"mask": false
},
"android-chrome-256x256.png": {
"width": 256,
"height": 256,
"transparent": true,
"rotate": false,
"mask": false
},
"android-chrome-384x384.png": {
"width": 384,
"height": 384,
"transparent": true,
"rotate": false,
"mask": false
},
"android-chrome-512x512.png": {
"width": 512,
"height": 512,
"transparent": true,
"rotate": false,
"mask": false
}
},
"appleIcon": {
"apple-touch-icon-57x57.png": {
"width": 57,
"height": 57,
"transparent": false,
"rotate": false,
"mask": false
},
"apple-touch-icon-60x60.png": {
"width": 60,
"height": 60,
"transparent": false,
"rotate": false,
"mask": false
},
"apple-touch-icon-72x72.png": {
"width": 72,
"height": 72,
"transparent": false,
"rotate": false,
"mask": false
},
"apple-touch-icon-76x76.png": {
"width": 76,
"height": 76,
"transparent": false,
"rotate": false,
"mask": false
},
"apple-touch-icon-114x114.png": {
"width": 114,
"height": 114,
"transparent": false,
"rotate": false,
"mask": false
},
"apple-touch-icon-120x120.png": {
"width": 120,
"height": 120,
"transparent": false,
"rotate": false,
"mask": false
},
"apple-touch-icon-144x144.png": {
"width": 144,
"height": 144,
"transparent": false,
"rotate": false,
"mask": false
},
"apple-touch-icon-152x152.png": {
"width": 152,
"height": 152,
"transparent": false,
"rotate": false,
"mask": false
},
"apple-touch-icon-167x167.png": {
"width": 167,
"height": 167,
"transparent": false,
"rotate": false,
"mask": false
},
"apple-touch-icon-180x180.png": {
"width": 180,
"height": 180,
"transparent": false,
"rotate": false,
"mask": false
},
"apple-touch-icon.png": {
"width": 180,
"height": 180,
"transparent": false,
"rotate": false,
"mask": false
},
"apple-touch-icon-precomposed.png": {
"width": 180,
"height": 180,
"transparent": false,
"rotate": false,
"mask": false
}
},
"appleStartup": {
"apple-touch-startup-image-320x460.png": {
"width": 320,
"height": 460,
"transparent": false,
"rotate": false,
"mask": false
},
"apple-touch-startup-image-640x920.png": {
"width": 640,
"height": 920,
"transparent": false,
"rotate": false,
"mask": false
},
"apple-touch-startup-image-640x1096.png": {
"width": 640,
"height": 1096,
"transparent": false,
"rotate": false,
"mask": false
},
"apple-touch-startup-image-748x1024.png": {
"width": 748,
"height": 1024,
"transparent": false,
"rotate": true,
"mask": false
},
"apple-touch-startup-image-750x1294.png": {
"width": 750,
"height": 1294,
"transparent": false,
"rotate": false,
"mask": false
},
"apple-touch-startup-image-768x1004.png": {
"width": 768,
"height": 1004,
"transparent": false,
"rotate": false,
"mask": false
},
"apple-touch-startup-image-1182x2208.png": {
"width": 1182,
"height": 2208,
"transparent": false,
"rotate": true,
"mask": false
},
"apple-touch-startup-image-1242x2148.png": {
"width": 1242,
"height": 2148,
"transparent": false,
"rotate": false,
"mask": false
},
"apple-touch-startup-image-1496x2048.png": {
"width": 1496,
"height": 2048,
"transparent": false,
"rotate": true,
"mask": false
},
"apple-touch-startup-image-1536x2008.png": {
"width": 1536,
"height": 2008,
"transparent": false,
"rotate": false,
"mask": false
}
},
"coast": {
"coast-228x228.png": {
"width": 228,
"height": 228,
"transparent": false,
"rotate": false,
"mask": false
}
},
"favicons": {
"favicon-16x16.png": {
"width": 16,
"height": 16,
"transparent": true,
"rotate": false,
"mask": false
},
"favicon-32x32.png": {
"width": 32,
"height": 32,
"transparent": true,
"rotate": false,
"mask": false
},
"favicon.ico": {
"sizes": [{
"width": 16,
"height": 16
}, {
"width": 24,
"height": 24
}, {
"width": 32,
"height": 32
}, {
"width": 48,
"height": 48
}, {
"width": 64,
"height": 64
}],
"transparent": true,
"rotate": false,
"mask": false
}
},
"firefox": {
"firefox_app_60x60.png": {
"width": 60,
"height": 60,
"transparent": false,
"rotate": false,
"mask": true
},
"firefox_app_128x128.png": {
"width": 128,
"height": 128,
"transparent": false,
"rotate": false,
"mask": true
},
"firefox_app_512x512.png": {
"width": 512,
"height": 512,
"transparent": false,
"rotate": false,
"mask": true
}
},
"windows": {
"mstile-70x70.png": {
"width": 128,
"height": 128,
"transparent": true,
"rotate": false,
"mask": false
},
"mstile-144x144.png": {
"width": 144,
"height": 144,
"transparent": true,
"rotate": false,
"mask": false
},
"mstile-150x150.png": {
"width": 270,
"height": 270,
"transparent": true,
"rotate": false,
"mask": false
},
"mstile-310x150.png": {
"width": 558,
"height": 270,
"transparent": true,
"rotate": false,
"mask": false
},
"mstile-310x310.png": {
"width": 558,
"height": 558,
"transparent": true,
"rotate": false,
"mask": false
}
},
"yandex": {
"yandex-browser-50x50.png": {
"width": 50,
"height": 50,
"transparent": true,
"rotate": false,
"mask": false
}
}
}

View File

@@ -0,0 +1,14 @@
{
"offset": {
"platforms": ["android", "appleIcon", "appleStartup", "firefox", "coast"],
"defaultTo": 0
},
"background": {
"platforms": ["android", "appleIcon", "appleStartup", "firefox", "coast", "windows", "yandex"],
"defaultTo": false
},
"shadow": {
"platforms": ["android"],
"defaultTo": false
}
}

66
build/node_modules/favicons/config/rfg.json generated vendored Normal file
View File

@@ -0,0 +1,66 @@
{
"api_key": "586975d64501c4a6cafabfdfd146f799f028a046",
"master_picture": {
"type": "inline",
"content": ""
},
"files_location": {
"type": "path",
"path": ""
},
"favicon_design": {
"desktop_browser": {},
"ios": {
"picture_aspect": "background_and_margin",
"margin": "0",
"background_color": "#FFFFFF",
"startup_image": {
"background_color": "#FFFFFF"
}
},
"windows": {
"picture_aspect": "no_change",
"background_color": "#FFFFFF"
},
"firefox_app": {
"picture_aspect": "circle",
"keep_picture_in_circle": "true",
"circle_inner_margin": "0",
"margin": "0",
"background_color": "#FFFFFF",
"manifest": {
"app_name": "Favicons",
"app_description": "Favicon generator for Node.js",
"developer_name": "Favicons",
"developer_url": "http://favicons.io"
}
},
"android_chrome": {
"picture_aspect": "no_change",
"manifest": {
"name": "Favicons",
"display": "standalone",
"orientation": "portrait"
},
"theme_color": "#FFFFFF"
},
"coast": {
"picture_aspect": "background_and_margin",
"background_color": "#FFFFFF",
"margin": "0"
},
"yandex_browser": {
"background_color": "#FFFFFF",
"manifest": {
"show_title": true,
"version": "1.0"
}
}
},
"settings": {
"compression": "3",
"scaling_algorithm": "Mitchell",
"error_on_image_too_small": true
},
"versioning": false
}

258
build/node_modules/favicons/es5.js generated vendored Normal file
View File

@@ -0,0 +1,258 @@
'use strict';
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _ = require('underscore'),
async = require('async'),
through2 = require('through2'),
clone = require('clone'),
mergeDefaults = require('merge-defaults'),
configDefaults = require('require-directory')(module, 'config'),
helpers = require('./helpers-es5.js'),
path = require('path'),
toIco = require('to-ico');
(function () {
'use strict';
_.mergeDefaults = mergeDefaults;
function favicons(source, parameters, next) {
var config = clone(configDefaults),
options = _.mergeDefaults(parameters || {}, config.defaults),
µ = helpers(options);
function createFavicon(sourceset, properties, name, platformOptions, callback) {
if (path.extname(name) === '.ico') {
async.map(properties.sizes, function (sizeProperties, cb) {
var newProperties = clone(properties);
newProperties.width = sizeProperties.width;
newProperties.height = sizeProperties.height;
var tempName = 'favicon-temp-' + newProperties.width + 'x' + newProperties.height + '.png';
createFavicon(sourceset, newProperties, tempName, platformOptions, cb);
}, function (error, results) {
if (error) {
return callback(error);
}
var files = results.map(function (icoImage) {
return icoImage.contents;
});
toIco(files).then(function (buffer) {
return callback(null, { name: name, contents: buffer });
}).catch(callback);
});
} else {
var maximum = Math.max(properties.width, properties.height),
offset = Math.round(maximum / 100 * platformOptions.offset) || 0,
background = µ.General.background(platformOptions.background);
if (platformOptions.disableTransparency) {
properties.transparent = false;
}
async.waterfall([function (cb) {
return µ.Images.nearest(sourceset, properties, offset, cb);
}, function (nearest, cb) {
return µ.Images.read(nearest.file, cb);
}, function (buffer, cb) {
return µ.Images.resize(buffer, properties, offset, cb);
}, function (resizedBuffer, cb) {
return µ.Images.create(properties, background, function (error, canvas) {
return cb(error, resizedBuffer, canvas);
});
}, function (resizedBuffer, canvas, cb) {
return µ.Images.composite(canvas, resizedBuffer, properties, offset, maximum, cb);
}, function (composite, cb) {
µ.Images.getBuffer(composite, cb);
}], function (error, buffer) {
return callback(error, { name: name, contents: buffer });
});
}
}
function createHTML(platform, callback) {
var html = [];
async.forEachOf(config.html[platform], function (tag, selector, cb) {
return µ.HTML.parse(tag, function (error, metadata) {
return cb(html.push(metadata) && error);
});
}, function (error) {
return callback(error, html);
});
}
function createFiles(platform, platformOptions, callback) {
var files = [];
async.forEachOf(config.files[platform], function (properties, name, cb) {
return µ.Files.create(properties, name, platformOptions, function (error, file) {
return cb(files.push(file) && error);
});
}, function (error) {
return callback(error, files);
});
}
function createFavicons(sourceset, platform, platformOptions, callback) {
var images = [];
async.forEachOf(config.icons[platform], function (properties, name, cb) {
return createFavicon(sourceset, properties, name, platformOptions, function (error, image) {
return cb(images.push(image) && error);
});
}, function (error) {
return callback(error, images);
});
}
function createPlatform(sourceset, platform, platformOptions, callback) {
async.parallel([function (cb) {
return createFavicons(sourceset, platform, platformOptions, cb);
}, function (cb) {
return createFiles(platform, platformOptions, cb);
}, function (cb) {
return createHTML(platform, cb);
}], function (error, results) {
return callback(error, results[0], results[1], results[2]);
});
}
function createOffline(sourceset, callback) {
var response = { images: [], files: [], html: [] };
async.forEachOf(options.icons, function (enabled, platform, cb) {
var platformOptions = µ.General.preparePlatformOptions(platform, enabled, options);
if (enabled) {
createPlatform(sourceset, platform, platformOptions, function (error, images, files, html) {
response.images = response.images.concat(images);
response.files = response.files.concat(files);
response.html = response.html.concat(html);
cb(error);
});
} else {
return cb(null);
}
}, function (error) {
return callback(error, response);
});
}
function unpack(pack, callback) {
var response = { images: [], files: [], html: pack.html.split('\n') };
async.each(pack.files, function (url, cb) {
return µ.RFG.fetch(url, function (error, box) {
return cb(response.images.push(box.image) && response.files.push(box.file) && error);
});
}, function (error) {
return callback(error, response);
});
}
function createOnline(sourceset, callback) {
async.waterfall([function (cb) {
return µ.RFG.configure(sourceset, config.rfg, cb);
}, function (request, cb) {
return µ.RFG.request(request, cb);
}, function (pack, cb) {
return unpack(pack, cb);
}], function (error, results) {
if (error && options.preferOnline) {
createOffline(sourceset, callback);
} else {
return callback(error, results);
}
});
}
function create(sourceset, callback) {
options.online || options.preferOnline ? createOnline(sourceset, callback) : createOffline(sourceset, callback);
}
async.waterfall([function (callback) {
return µ.General.source(source, callback);
}, function (sourceset, callback) {
return create(sourceset, callback);
}, function (response, callback) {
if (options.pipeHTML) {
µ.Files.create(response.html, options.html, false, function (error, file) {
response.files = response.files.concat([file]);
return callback(error, response);
});
} else {
return callback(null, response);
}
}], function (error, response) {
return error ? next(error) : next(null, {
images: _.compact(response.images),
files: _.compact(response.files),
html: _.compact(response.html)
});
});
}
function stream(params, handleHtml) {
var config = clone(configDefaults),
µ = helpers(params);
function processDocuments(documents, html, callback) {
async.each(documents, function (document, cb) {
return µ.HTML.update(document, html, config.html, cb);
}, function (error) {
return callback(error);
});
}
/* eslint func-names: 0, no-invalid-this: 0 */
return through2.obj(function (file, encoding, callback) {
var that = this;
if (file.isNull()) {
return callback(null, file);
}
if (file.isStream()) {
return callback(new Error('[gulp-favicons] Streaming not supported'));
}
async.waterfall([function (cb) {
return favicons(file.contents, params, cb);
}, function (response, cb) {
return async.each(response.images.concat(response.files), function (image, c) {
that.push(µ.General.vinyl(image, file));
c();
}, function (error) {
return cb(error, response);
});
}, function (response, cb) {
if (handleHtml) {
handleHtml(response.html);
return cb(null);
}
if (params.html && !params.pipeHTML) {
var documents = _typeof(params.html) === 'object' ? params.html : [params.html];
processDocuments(documents, response.html, cb);
} else {
return cb(null);
}
}], function (error) {
return callback(error);
});
});
}
module.exports = favicons;
module.exports.config = configDefaults;
module.exports.stream = stream;
})();

14
build/node_modules/favicons/gulpfile.js generated vendored Normal file
View File

@@ -0,0 +1,14 @@
var gulp = require('gulp'),
gulpif = require('gulp-if'),
babel = require('gulp-babel'),
rename = require("gulp-rename");
gulp.task('default', () => {
return gulp.src(['index.js', 'helpers.js'])
.pipe(babel({
presets: ['es2015']
}))
.pipe(gulpif(/^index\.js$/, rename('es5.js')))
.pipe(gulpif(/^helpers\.js$/, rename('helpers-es5.js')))
.pipe(gulp.dest('.'));
});

499
build/node_modules/favicons/helpers-es5.js generated vendored Normal file
View File

@@ -0,0 +1,499 @@
'use strict';
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* eslint camelcase: 0, no-shadow: 0 */
var path = require('path'),
fs = require('fs'),
_ = require('underscore'),
color = require('tinycolor2'),
cheerio = require('cheerio'),
colors = require('colors'),
jsonxml = require('jsontoxml'),
sizeOf = require('image-size'),
async = require('async'),
mkdirp = require('mkdirp'),
Jimp = require('jimp'),
svg2png = require('svg2png'),
File = require('vinyl'),
Reflect = require('harmony-reflect'),
NRC = require('node-rest-client').Client,
PLATFORM_OPTIONS = require('./config/platform-options.json'),
ANDROID_BASE_SIZE = 36,
IOS_BASE_SIZE = 57,
IOS_STARTUP_BASE_SIZE = 320,
COAST_BASE_SIZE = 228,
FIREFOX_BASE_SIZE = 60;
(function () {
'use strict';
var xmlconfig = { prettyPrint: true, xmlHeader: true, indent: ' ' },
client = new NRC(),
HEX_MAX = 255,
NON_EXISTANT = -1,
ROTATE_DEGREES = 90,
HTTP_SUCCESS = 200;
client.setMaxListeners(0);
function helpers(options) {
function contains(array, element) {
return array.indexOf(element.toLowerCase()) > NON_EXISTANT;
}
function relative(directory) {
return path.join(options.path, directory).replace(/\\/g, '/');
}
function print(context, message) {
var newMessage = '';
if (options.logging && message) {
_.each(message.split(' '), function (item) {
newMessage += ' ' + (/^\d+x\d+$/gm.test(item) ? colors.magenta(item) : item);
});
console.log(colors.green('[Favicons]') + ' ' + context.yellow + ':' + newMessage + '...');
}
}
function readFile(filepath, callback) {
fs.readFile(filepath, callback);
}
function updateDocument(document, code, tags, next) {
var $ = cheerio.load(document, { decodeEntities: false }),
target = $('head').length > 0 ? $('head') : $.root(),
newCode = cheerio.load(code.join('\n'), { decodeEntities: false });
async.each(tags, function (platform, callback) {
async.forEachOf(platform, function (tag, selector, cb) {
if (options.replace) {
$(selector).remove();
} else if ($(selector).length) {
newCode(selector).remove();
}
return cb(null);
}, callback);
}, function (error) {
target.append(newCode.html());
return next(error, $.html().replace(/^\s*$[\n\r]{1,}/gm, ''));
});
}
function preparePlatformOptions(platform, options, baseOptions) {
if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) !== 'object') {
options = {};
}
_.each(options, function (value, key) {
var platformOptionsRef = PLATFORM_OPTIONS[key];
if (typeof platformOptionsRef === 'undefined' || platformOptionsRef.platforms.indexOf(platform) === -1) {
return Reflect.deleteProperty(options, key);
}
});
_.each(PLATFORM_OPTIONS, function (_ref, key) {
var platforms = _ref.platforms,
defaultTo = _ref.defaultTo;
if (typeof options[key] === 'undefined' && platforms.indexOf(platform) !== -1) {
options[key] = defaultTo;
}
});
if (typeof options.background === 'boolean') {
if (platform === 'android' && !options.background) {
options.background = 'transparent';
} else {
options.background = baseOptions.background;
}
}
if (platform === 'android' && options.background !== 'transparent') {
options.disableTransparency = true;
}
return options;
}
return {
General: {
preparePlatformOptions: preparePlatformOptions,
background: function background(hex) {
print('General:background', 'Parsing colour ' + hex);
var rgba = color(hex).toRgb();
return Jimp.rgbaToInt(rgba.r, rgba.g, rgba.b, rgba.a * HEX_MAX);
},
source: function source(_source, callback) {
var sourceset = [];
print('General:source', 'Source type is ' + (typeof _source === 'undefined' ? 'undefined' : _typeof(_source)));
if (!_source || !_source.length) {
return callback('No source provided');
} else if (Buffer.isBuffer(_source)) {
sourceset = [{ size: sizeOf(_source), file: _source }];
return callback(null, sourceset);
} else if (Array.isArray(_source)) {
async.each(_source, function (file, cb) {
return readFile(file, function (error, buffer) {
if (error) {
return cb(error);
}
sourceset.push({
size: sizeOf(buffer),
file: buffer
});
cb(null);
});
}, function (error) {
return callback(error || sourceset.length ? null : 'Favicons source is invalid', sourceset);
});
} else if (typeof _source === 'string') {
readFile(_source, function (error, buffer) {
if (error) {
return callback(error);
}
sourceset = [{ size: sizeOf(buffer), file: buffer }];
return callback(null, sourceset);
});
} else {
return callback('Invalid source type provided');
}
},
/* eslint no-underscore-dangle: 0 */
vinyl: function vinyl(object, input) {
var output = new File({
path: object.name,
contents: Buffer.isBuffer(object.contents) ? object.contents : new Buffer(object.contents)
});
// gulp-cache support
if (typeof input._cachedKey !== 'undefined') {
output._cachedKey = input._cachedKey;
}
return output;
}
},
HTML: {
parse: function parse(html, callback) {
print('HTML:parse', 'HTML found, parsing and modifying source');
var $ = cheerio.load(html),
link = $('*').is('link'),
attribute = link ? 'href' : 'content',
value = $('*').first().attr(attribute);
if (path.extname(value)) {
$('*').first().attr(attribute, relative(value));
} else if (value.slice(0, 1) === '#') {
$('*').first().attr(attribute, options.background);
} else if (html.indexOf('application-name') !== NON_EXISTANT || html.indexOf('apple-mobile-web-app-title') !== NON_EXISTANT) {
$('*').first().attr(attribute, options.appName);
}
return callback(null, $.html());
},
update: function update(document, code, tags, callback) {
var encoding = { encoding: 'utf8' };
async.waterfall([function (cb) {
return mkdirp(path.dirname(document), cb);
}, function (made, cb) {
return fs.readFile(document, encoding, function (error, data) {
return cb(null, error ? null : data);
});
}, function (data, cb) {
return data ? updateDocument(data, code, tags, cb) : cb(null, code.join('\n'));
}, function (html, cb) {
return fs.writeFile(document, html, options, cb);
}], callback);
}
},
Files: {
create: function create(properties, name, platformOptions, callback) {
print('Files:create', 'Creating file: ' + name);
if (name === 'manifest.json') {
properties.name = options.appName;
properties.short_name = options.appName;
properties.description = options.appDescription;
properties.dir = options.dir;
properties.lang = options.lang;
properties.display = options.display;
properties.orientation = options.orientation;
properties.start_url = options.start_url;
properties.background_color = options.background;
properties.theme_color = options.theme_color;
_.map(properties.icons, function (icon) {
return icon.src = relative(icon.src);
});
properties = JSON.stringify(properties, null, 2);
} else if (name === 'manifest.webapp') {
properties.version = options.version;
properties.name = options.appName;
properties.description = options.appDescription;
properties.developer.name = options.developerName;
properties.developer.url = options.developerURL;
properties.icons = _.mapObject(properties.icons, function (property) {
return relative(property);
});
properties = JSON.stringify(properties, null, 2);
} else if (name === 'browserconfig.xml') {
_.map(properties[0].children[0].children[0].children, function (property) {
if (property.name === 'TileColor') {
property.text = platformOptions.background;
} else {
property.attrs.src = relative(property.attrs.src);
}
});
properties = jsonxml(properties, xmlconfig);
} else if (name === 'yandex-browser-manifest.json') {
properties.version = options.version;
properties.api_version = 1;
properties.layout.logo = relative(properties.layout.logo);
properties.layout.color = platformOptions.background;
properties = JSON.stringify(properties, null, 2);
} else if (/\.html$/.test(name)) {
properties = properties.join('\n');
}
return callback(null, { name: name, contents: properties });
}
},
Images: {
create: function create(properties, background, callback) {
var jimp = null;
print('Image:create', 'Creating empty ' + properties.width + 'x' + properties.height + ' canvas with ' + (properties.transparent ? 'transparent' : background) + ' background');
jimp = new Jimp(properties.width, properties.height, properties.transparent ? 0x00000000 : background, function (error, canvas) {
return callback(error, canvas, jimp);
});
},
read: function read(file, callback) {
print('Image:read', 'Reading file: ' + file.buffer);
return Jimp.read(file, callback);
},
nearest: function nearest(sourceset, properties, offset, callback) {
print('Image:nearest', 'Find nearest icon to ' + properties.width + 'x' + properties.height + ' with offset ' + offset);
var offsetSize = offset * 2,
width = properties.width - offsetSize,
height = properties.height - offsetSize,
sideSize = Math.max(width, height),
svgSource = _.find(sourceset, function (source) {
return source.size.type === 'svg';
});
var nearestIcon = sourceset[0],
nearestSideSize = Math.max(nearestIcon.size.width, nearestIcon.size.height);
if (svgSource) {
print('Image:nearest', 'SVG source will be saved as ' + width + 'x' + height);
svg2png(svgSource.file, { height: height, width: width }).then(function (resizedBuffer) {
return callback(null, {
size: sizeOf(resizedBuffer),
file: resizedBuffer
});
}).catch(callback);
} else {
_.each(sourceset, function (icon) {
var max = Math.max(icon.size.width, icon.size.height);
if ((nearestSideSize > max || nearestSideSize < sideSize) && max >= sideSize) {
nearestIcon = icon;
nearestSideSize = max;
}
});
return callback(null, nearestIcon);
}
},
resize: function resize(image, properties, offset, callback) {
print('Images:resize', 'Resizing image to contain in ' + properties.width + 'x' + properties.height + ' with offset ' + offset);
var offsetSize = offset * 2;
if (properties.rotate) {
print('Images:resize', 'Rotating image by ' + ROTATE_DEGREES);
image.rotate(ROTATE_DEGREES, false);
}
image.contain(properties.width - offsetSize, properties.height - offsetSize, Jimp.HORIZONTAL_ALIGN_CENTER | Jimp.VERTICAL_ALIGN_MIDDLE);
return callback(null, image);
},
composite: function composite(canvas, image, properties, offset, maximum, callback) {
var circle = path.join(__dirname, 'mask.png'),
overlay = path.join(__dirname, 'overlay.png');
function compositeIcon() {
print('Images:composite', 'Compositing favicon on ' + properties.width + 'x' + properties.height + ' canvas with offset ' + offset);
canvas.composite(image, offset, offset);
}
if (properties.mask) {
print('Images:composite', 'Masking composite image on circle');
async.parallel([function (cb) {
return Jimp.read(circle, cb);
}, function (cb) {
return Jimp.read(overlay, cb);
}], function (error, images) {
images[0].resize(maximum, Jimp.AUTO);
images[1].resize(maximum, Jimp.AUTO);
canvas.mask(images[0], 0, 0);
canvas.composite(images[1], 0, 0);
compositeIcon();
return callback(error, canvas);
});
} else {
compositeIcon();
return callback(null, canvas);
}
},
getBuffer: function getBuffer(canvas, callback) {
print('Images:getBuffer', 'Collecting image buffer from canvas');
canvas.getBuffer(Jimp.MIME_PNG, callback);
}
},
RFG: {
configure: function configure(sourceset, request, callback) {
print('RFG:configure', 'Configuring RFG API request');
var svgSource = _.find(sourceset, function (source) {
return source.size.type === 'svg';
});
options.background = '#' + color(options.background).toHex();
request.master_picture.content = (svgSource || _.max(sourceset, function (_ref2) {
var _ref2$size = _ref2.size,
width = _ref2$size.width,
height = _ref2$size.height;
return Math.max(width, height);
})).file.toString('base64');
request.files_location.path = options.path;
if (options.icons.android) {
var androidOptions = preparePlatformOptions('android', options.icons.android, options);
request.favicon_design.android_chrome.theme_color = options.background;
request.favicon_design.android_chrome.manifest.name = options.appName;
request.favicon_design.android_chrome.manifest.display = options.display;
request.favicon_design.android_chrome.manifest.orientation = options.orientation;
if (androidOptions.shadow) {
request.favicon_design.android_chrome.picture_aspect = 'shadow';
} else if (androidOptions.offset > 0 && androidOptions.background) {
request.favicon_design.android_chrome.picture_aspect = 'background_and_margin';
request.favicon_design.android_chrome.background_color = androidOptions.background;
request.favicon_design.android_chrome.margin = Math.round(ANDROID_BASE_SIZE / 100 * androidOptions.offset);
}
} else {
Reflect.deleteProperty(request.favicon_design, 'android_chrome');
}
if (options.icons.appleIcon) {
var appleIconOptions = preparePlatformOptions('appleIcon', options.icons.appleIcon, options);
request.favicon_design.ios.background_color = appleIconOptions.background;
request.favicon_design.ios.margin = Math.round(IOS_BASE_SIZE / 100 * appleIconOptions.offset);
} else {
Reflect.deleteProperty(request.favicon_design, 'ios');
}
if (options.icons.appleIcon && options.icons.appleStartup) {
var appleStartupOptions = preparePlatformOptions('appleStartup', options.icons.appleStartup, options);
request.favicon_design.ios.startup_image.background_color = appleStartupOptions.background;
request.favicon_design.ios.startup_image.margin = Math.round(IOS_STARTUP_BASE_SIZE / 100 * appleStartupOptions.offset);
} else if (request.favicon_design.ios) {
Reflect.deleteProperty(request.favicon_design.ios, 'startup_image');
}
if (options.icons.coast) {
var coastOptions = preparePlatformOptions('coast', options.icons.coast, options);
request.favicon_design.coast.background_color = coastOptions.background;
request.favicon_design.coast.margin = Math.round(COAST_BASE_SIZE / 100 * coastOptions.offset);
} else {
Reflect.deleteProperty(request.favicon_design, 'coast');
}
if (!options.icons.favicons) {
Reflect.deleteProperty(request.favicon_design, 'desktop_browser');
}
if (options.icons.firefox) {
var firefoxOptions = preparePlatformOptions('firefox', options.icons.firefox, options);
request.favicon_design.firefox_app.background_color = firefoxOptions.background;
request.favicon_design.firefox_app.margin = Math.round(FIREFOX_BASE_SIZE / 100 * firefoxOptions.offset);
request.favicon_design.firefox_app.manifest.app_name = options.appName;
request.favicon_design.firefox_app.manifest.app_description = options.appDescription;
request.favicon_design.firefox_app.manifest.developer_name = options.developerName;
request.favicon_design.firefox_app.manifest.developer_url = options.developerURL;
} else {
Reflect.deleteProperty(request.favicon_design, 'firefox_app');
}
if (options.icons.windows) {
var windowsOptions = preparePlatformOptions('windows', options.icons.windows, options);
request.favicon_design.windows.background_color = windowsOptions.background;
} else {
Reflect.deleteProperty(request.favicon_design, 'windows');
}
if (options.icons.yandex) {
var yandexOptions = preparePlatformOptions('yandex', options.icons.yandex, options);
request.favicon_design.yandex_browser.background_color = yandexOptions.background;
request.favicon_design.yandex_browser.manifest.version = options.version;
} else {
Reflect.deleteProperty(request.favicon_design, 'yandex_browser');
}
return callback(null, request);
},
request: function request(_request, callback) {
print('RFG:request', 'Posting a request to the RFG API');
client.post('http://realfavicongenerator.net/api/favicon', {
data: { favicon_generation: _request },
headers: { 'Content-Type': 'application/json' }
}, function (data, response) {
var result = data.favicon_generation_result;
return result && response.statusCode === HTTP_SUCCESS ? callback(null, {
files: result.favicon.files_urls,
html: result.favicon.html_code
}) : callback(result.result.error_message);
});
},
fetch: function fetch(address, callback) {
var name = path.basename(address),
image = contains(['.png', '.jpg', '.bmp', '.ico', '.svg'], path.extname(name));
print('RFG:fetch', 'Fetching ' + (image ? 'image' : 'file') + ' from RFG: ' + address);
client.get(address, function (buffer, response) {
var success = buffer && response.statusCode === HTTP_SUCCESS;
return success ? callback(null, {
file: image ? null : { name: name, contents: buffer },
image: image ? { name: name, contents: buffer } : null
}) : callback('Could not fetch URL: ' + address);
});
}
}
};
}
module.exports = helpers;
})();

479
build/node_modules/favicons/helpers.js generated vendored Normal file
View File

@@ -0,0 +1,479 @@
/* eslint camelcase: 0, no-shadow: 0 */
const path = require('path'),
fs = require('fs'),
_ = require('underscore'),
color = require('tinycolor2'),
cheerio = require('cheerio'),
colors = require('colors'),
jsonxml = require('jsontoxml'),
sizeOf = require('image-size'),
async = require('async'),
mkdirp = require('mkdirp'),
Jimp = require('jimp'),
svg2png = require('svg2png'),
File = require('vinyl'),
Reflect = require('harmony-reflect'),
NRC = require('node-rest-client').Client,
PLATFORM_OPTIONS = require('./config/platform-options.json'),
ANDROID_BASE_SIZE = 36,
IOS_BASE_SIZE = 57,
IOS_STARTUP_BASE_SIZE = 320,
COAST_BASE_SIZE = 228,
FIREFOX_BASE_SIZE = 60;
(() => {
'use strict';
const xmlconfig = { prettyPrint: true, xmlHeader: true, indent: ' ' },
client = new NRC(),
HEX_MAX = 255,
NON_EXISTANT = -1,
ROTATE_DEGREES = 90,
HTTP_SUCCESS = 200;
client.setMaxListeners(0);
function helpers (options) {
function contains (array, element) {
return array.indexOf(element.toLowerCase()) > NON_EXISTANT;
}
function relative (directory) {
return path.join(options.path, directory).replace(/\\/g, '/');
}
function print (context, message) {
let newMessage = '';
if (options.logging && message) {
_.each(message.split(' '), (item) => {
newMessage += ` ${ ((/^\d+x\d+$/gm).test(item) ? colors.magenta(item) : item) }`;
});
console.log(`${ colors.green('[Favicons]') } ${ context.yellow }:${ newMessage }...`);
}
}
function readFile (filepath, callback) {
fs.readFile(filepath, callback);
}
function updateDocument (document, code, tags, next) {
const $ = cheerio.load(document, { decodeEntities: false }),
target = $('head').length > 0 ? $('head') : $.root(),
newCode = cheerio.load(code.join('\n'), { decodeEntities: false });
async.each(tags, (platform, callback) => {
async.forEachOf(platform, (tag, selector, cb) => {
if (options.replace) {
$(selector).remove();
} else if ($(selector).length) {
newCode(selector).remove();
}
return cb(null);
}, callback);
}, (error) => {
target.append(newCode.html());
return next(error, $.html().replace(/^\s*$[\n\r]{1,}/gm, ''));
});
}
function preparePlatformOptions (platform, options, baseOptions) {
if (typeof options !== 'object') {
options = {};
}
_.each(options, (value, key) => {
const platformOptionsRef = PLATFORM_OPTIONS[key];
if (typeof platformOptionsRef === 'undefined' || platformOptionsRef.platforms.indexOf(platform) === -1) {
return Reflect.deleteProperty(options, key);
}
});
_.each(PLATFORM_OPTIONS, ({ platforms, defaultTo }, key) => {
if (typeof options[key] === 'undefined' && platforms.indexOf(platform) !== -1) {
options[key] = defaultTo;
}
});
if (typeof options.background === 'boolean') {
if (platform === 'android' && !options.background) {
options.background = 'transparent';
} else {
options.background = baseOptions.background;
}
}
if (platform === 'android' && options.background !== 'transparent') {
options.disableTransparency = true;
}
return options;
}
return {
General: {
preparePlatformOptions,
background: (hex) => {
print('General:background', `Parsing colour ${ hex }`);
const rgba = color(hex).toRgb();
return Jimp.rgbaToInt(rgba.r, rgba.g, rgba.b, rgba.a * HEX_MAX);
},
source: (source, callback) => {
let sourceset = [];
print('General:source', `Source type is ${ typeof source }`);
if (!source || !source.length) {
return callback('No source provided');
} else if (Buffer.isBuffer(source)) {
sourceset = [{ size: sizeOf(source), file: source }];
return callback(null, sourceset);
} else if (Array.isArray(source)) {
async.each(source, (file, cb) =>
readFile(file, (error, buffer) => {
if (error) {
return cb(error);
}
sourceset.push({
size: sizeOf(buffer),
file: buffer
});
cb(null);
}),
(error) =>
callback(error || sourceset.length ? null : 'Favicons source is invalid', sourceset)
);
} else if (typeof source === 'string') {
readFile(source, (error, buffer) => {
if (error) {
return callback(error);
}
sourceset = [{ size: sizeOf(buffer), file: buffer }];
return callback(null, sourceset);
});
} else {
return callback('Invalid source type provided');
}
},
/* eslint no-underscore-dangle: 0 */
vinyl: (object, input) => {
const output = new File({
path: object.name,
contents: Buffer.isBuffer(object.contents) ? object.contents : new Buffer(object.contents)
});
// gulp-cache support
if (typeof input._cachedKey !== 'undefined') {
output._cachedKey = input._cachedKey;
}
return output;
}
},
HTML: {
parse: (html, callback) => {
print('HTML:parse', 'HTML found, parsing and modifying source');
const $ = cheerio.load(html),
link = $('*').is('link'),
attribute = link ? 'href' : 'content',
value = $('*').first().attr(attribute);
if (path.extname(value)) {
$('*').first().attr(attribute, relative(value));
} else if (value.slice(0, 1) === '#') {
$('*').first().attr(attribute, options.background);
} else if (html.indexOf('application-name') !== NON_EXISTANT || html.indexOf('apple-mobile-web-app-title') !== NON_EXISTANT) {
$('*').first().attr(attribute, options.appName);
}
return callback(null, $.html());
},
update: (document, code, tags, callback) => {
const encoding = { encoding: 'utf8' };
async.waterfall([
(cb) =>
mkdirp(path.dirname(document), cb),
(made, cb) =>
fs.readFile(document, encoding, (error, data) => cb(null, error ? null : data)),
(data, cb) =>
(data ? updateDocument(data, code, tags, cb) : cb(null, code.join('\n'))),
(html, cb) =>
fs.writeFile(document, html, options, cb)
], callback);
}
},
Files: {
create: (properties, name, platformOptions, callback) => {
print('Files:create', `Creating file: ${ name }`);
if (name === 'manifest.json') {
properties.name = options.appName;
properties.short_name = options.appName;
properties.description = options.appDescription;
properties.dir = options.dir;
properties.lang = options.lang;
properties.display = options.display;
properties.orientation = options.orientation;
properties.start_url = options.start_url;
properties.background_color = options.background;
properties.theme_color = options.theme_color;
_.map(properties.icons, (icon) => (icon.src = relative(icon.src)));
properties = JSON.stringify(properties, null, 2);
} else if (name === 'manifest.webapp') {
properties.version = options.version;
properties.name = options.appName;
properties.description = options.appDescription;
properties.developer.name = options.developerName;
properties.developer.url = options.developerURL;
properties.icons = _.mapObject(properties.icons, (property) => relative(property));
properties = JSON.stringify(properties, null, 2);
} else if (name === 'browserconfig.xml') {
_.map(properties[0].children[0].children[0].children, (property) => {
if (property.name === 'TileColor') {
property.text = platformOptions.background;
} else {
property.attrs.src = relative(property.attrs.src);
}
});
properties = jsonxml(properties, xmlconfig);
} else if (name === 'yandex-browser-manifest.json') {
properties.version = options.version;
properties.api_version = 1;
properties.layout.logo = relative(properties.layout.logo);
properties.layout.color = platformOptions.background;
properties = JSON.stringify(properties, null, 2);
} else if (/\.html$/.test(name)) {
properties = properties.join('\n');
}
return callback(null, { name, contents: properties });
}
},
Images: {
create: (properties, background, callback) => {
let jimp = null;
print('Image:create', `Creating empty ${ properties.width }x${ properties.height } canvas with ${ (properties.transparent ? 'transparent' : background) } background`);
jimp = new Jimp(properties.width, properties.height, properties.transparent ? 0x00000000 : background, (error, canvas) =>
callback(error, canvas, jimp));
},
read: (file, callback) => {
print('Image:read', `Reading file: ${ file.buffer }`);
return Jimp.read(file, callback);
},
nearest: (sourceset, properties, offset, callback) => {
print('Image:nearest', `Find nearest icon to ${ properties.width }x${ properties.height } with offset ${ offset }`);
const offsetSize = offset * 2,
width = properties.width - offsetSize,
height = properties.height - offsetSize,
sideSize = Math.max(width, height),
svgSource = _.find(sourceset, (source) => source.size.type === 'svg');
let nearestIcon = sourceset[0],
nearestSideSize = Math.max(nearestIcon.size.width, nearestIcon.size.height);
if (svgSource) {
print('Image:nearest', `SVG source will be saved as ${ width }x${ height }`);
svg2png(svgSource.file, { height, width })
.then((resizedBuffer) => callback(null, {
size: sizeOf(resizedBuffer),
file: resizedBuffer
}))
.catch(callback);
} else {
_.each(sourceset, (icon) => {
const max = Math.max(icon.size.width, icon.size.height);
if ((nearestSideSize > max || nearestSideSize < sideSize) && max >= sideSize) {
nearestIcon = icon;
nearestSideSize = max;
}
});
return callback(null, nearestIcon);
}
},
resize: (image, properties, offset, callback) => {
print('Images:resize', `Resizing image to contain in ${ properties.width }x${ properties.height } with offset ${ offset }`);
const offsetSize = offset * 2;
if (properties.rotate) {
print('Images:resize', `Rotating image by ${ROTATE_DEGREES}`);
image.rotate(ROTATE_DEGREES, false);
}
image.contain(properties.width - offsetSize, properties.height - offsetSize, Jimp.HORIZONTAL_ALIGN_CENTER | Jimp.VERTICAL_ALIGN_MIDDLE);
return callback(null, image);
},
composite: (canvas, image, properties, offset, maximum, callback) => {
const circle = path.join(__dirname, 'mask.png'),
overlay = path.join(__dirname, 'overlay.png');
function compositeIcon () {
print('Images:composite', `Compositing favicon on ${ properties.width }x${ properties.height } canvas with offset ${ offset }`);
canvas.composite(image, offset, offset);
}
if (properties.mask) {
print('Images:composite', 'Masking composite image on circle');
async.parallel([
(cb) => Jimp.read(circle, cb),
(cb) => Jimp.read(overlay, cb)
], (error, images) => {
images[0].resize(maximum, Jimp.AUTO);
images[1].resize(maximum, Jimp.AUTO);
canvas.mask(images[0], 0, 0);
canvas.composite(images[1], 0, 0);
compositeIcon();
return callback(error, canvas);
});
} else {
compositeIcon();
return callback(null, canvas);
}
},
getBuffer: (canvas, callback) => {
print('Images:getBuffer', 'Collecting image buffer from canvas');
canvas.getBuffer(Jimp.MIME_PNG, callback);
}
},
RFG: {
configure: (sourceset, request, callback) => {
print('RFG:configure', 'Configuring RFG API request');
const svgSource = _.find(sourceset, (source) => source.size.type === 'svg');
options.background = `#${ color(options.background).toHex() }`;
request.master_picture.content = (svgSource || _.max(sourceset, ({ size: { width, height } }) => Math.max(width, height))).file.toString('base64');
request.files_location.path = options.path;
if (options.icons.android) {
const androidOptions = preparePlatformOptions('android', options.icons.android, options);
request.favicon_design.android_chrome.theme_color = options.background;
request.favicon_design.android_chrome.manifest.name = options.appName;
request.favicon_design.android_chrome.manifest.display = options.display;
request.favicon_design.android_chrome.manifest.orientation = options.orientation;
if (androidOptions.shadow) {
request.favicon_design.android_chrome.picture_aspect = 'shadow';
} else if (androidOptions.offset > 0 && androidOptions.background) {
request.favicon_design.android_chrome.picture_aspect = 'background_and_margin';
request.favicon_design.android_chrome.background_color = androidOptions.background;
request.favicon_design.android_chrome.margin = Math.round(ANDROID_BASE_SIZE / 100 * androidOptions.offset);
}
} else {
Reflect.deleteProperty(request.favicon_design, 'android_chrome');
}
if (options.icons.appleIcon) {
const appleIconOptions = preparePlatformOptions('appleIcon', options.icons.appleIcon, options);
request.favicon_design.ios.background_color = appleIconOptions.background;
request.favicon_design.ios.margin = Math.round(IOS_BASE_SIZE / 100 * appleIconOptions.offset);
} else {
Reflect.deleteProperty(request.favicon_design, 'ios');
}
if (options.icons.appleIcon && options.icons.appleStartup) {
const appleStartupOptions = preparePlatformOptions('appleStartup', options.icons.appleStartup, options);
request.favicon_design.ios.startup_image.background_color = appleStartupOptions.background;
request.favicon_design.ios.startup_image.margin = Math.round(IOS_STARTUP_BASE_SIZE / 100 * appleStartupOptions.offset);
} else if (request.favicon_design.ios) {
Reflect.deleteProperty(request.favicon_design.ios, 'startup_image');
}
if (options.icons.coast) {
const coastOptions = preparePlatformOptions('coast', options.icons.coast, options);
request.favicon_design.coast.background_color = coastOptions.background;
request.favicon_design.coast.margin = Math.round(COAST_BASE_SIZE / 100 * coastOptions.offset);
} else {
Reflect.deleteProperty(request.favicon_design, 'coast');
}
if (!options.icons.favicons) {
Reflect.deleteProperty(request.favicon_design, 'desktop_browser');
}
if (options.icons.firefox) {
const firefoxOptions = preparePlatformOptions('firefox', options.icons.firefox, options);
request.favicon_design.firefox_app.background_color = firefoxOptions.background;
request.favicon_design.firefox_app.margin = Math.round(FIREFOX_BASE_SIZE / 100 * firefoxOptions.offset);
request.favicon_design.firefox_app.manifest.app_name = options.appName;
request.favicon_design.firefox_app.manifest.app_description = options.appDescription;
request.favicon_design.firefox_app.manifest.developer_name = options.developerName;
request.favicon_design.firefox_app.manifest.developer_url = options.developerURL;
} else {
Reflect.deleteProperty(request.favicon_design, 'firefox_app');
}
if (options.icons.windows) {
const windowsOptions = preparePlatformOptions('windows', options.icons.windows, options);
request.favicon_design.windows.background_color = windowsOptions.background;
} else {
Reflect.deleteProperty(request.favicon_design, 'windows');
}
if (options.icons.yandex) {
const yandexOptions = preparePlatformOptions('yandex', options.icons.yandex, options);
request.favicon_design.yandex_browser.background_color = yandexOptions.background;
request.favicon_design.yandex_browser.manifest.version = options.version;
} else {
Reflect.deleteProperty(request.favicon_design, 'yandex_browser');
}
return callback(null, request);
},
request: (request, callback) => {
print('RFG:request', 'Posting a request to the RFG API');
client.post('http://realfavicongenerator.net/api/favicon', {
data: { favicon_generation: request },
headers: { 'Content-Type': 'application/json' }
}, (data, response) => {
const result = data.favicon_generation_result;
return result && response.statusCode === HTTP_SUCCESS ? callback(null, {
files: result.favicon.files_urls,
html: result.favicon.html_code
}) : callback(result.result.error_message);
});
},
fetch: (address, callback) => {
const name = path.basename(address),
image = contains(['.png', '.jpg', '.bmp', '.ico', '.svg'], path.extname(name));
print('RFG:fetch', `Fetching ${ image ? 'image' : 'file' } from RFG: ${ address }`);
client.get(address, (buffer, response) => {
const success = buffer && response.statusCode === HTTP_SUCCESS;
return success ? callback(null, {
file: image ? null : { name, contents: buffer },
image: image ? { name, contents: buffer } : null
}) : callback(`Could not fetch URL: ${ address }`);
});
}
}
};
}
module.exports = helpers;
})();

250
build/node_modules/favicons/index.js generated vendored Normal file
View File

@@ -0,0 +1,250 @@
const _ = require('underscore'),
async = require('async'),
through2 = require('through2'),
clone = require('clone'),
mergeDefaults = require('merge-defaults'),
configDefaults = require('require-directory')(module, 'config'),
helpers = require('./helpers-es5.js'),
path = require('path'),
toIco = require('to-ico');
(() => {
'use strict';
_.mergeDefaults = mergeDefaults;
function favicons (source, parameters, next) {
const config = clone(configDefaults),
options = _.mergeDefaults(parameters || {}, config.defaults),
µ = helpers(options);
function createFavicon (sourceset, properties, name, platformOptions, callback) {
if (path.extname(name) === '.ico') {
async.map(
properties.sizes,
(sizeProperties, cb) => {
const newProperties = clone(properties);
newProperties.width = sizeProperties.width;
newProperties.height = sizeProperties.height;
const tempName = `favicon-temp-${newProperties.width}x${newProperties.height}.png`;
createFavicon(sourceset, newProperties, tempName, platformOptions, cb);
},
(error, results) => {
if (error) {
return callback(error);
}
const files = results.map((icoImage) => icoImage.contents);
toIco(files)
.then((buffer) => callback(null, { name, contents: buffer }))
.catch(callback);
}
);
} else {
const maximum = Math.max(properties.width, properties.height),
offset = Math.round(maximum / 100 * platformOptions.offset) || 0,
background = µ.General.background(platformOptions.background);
if (platformOptions.disableTransparency) {
properties.transparent = false;
}
async.waterfall([
(cb) =>
µ.Images.nearest(sourceset, properties, offset, cb),
(nearest, cb) =>
µ.Images.read(nearest.file, cb),
(buffer, cb) =>
µ.Images.resize(buffer, properties, offset, cb),
(resizedBuffer, cb) =>
µ.Images.create(properties, background, (error, canvas) =>
cb(error, resizedBuffer, canvas)),
(resizedBuffer, canvas, cb) =>
µ.Images.composite(canvas, resizedBuffer, properties, offset, maximum, cb),
(composite, cb) => {
µ.Images.getBuffer(composite, cb);
}
], (error, buffer) =>
callback(error, { name, contents: buffer }));
}
}
function createHTML (platform, callback) {
const html = [];
async.forEachOf(config.html[platform], (tag, selector, cb) =>
µ.HTML.parse(tag, (error, metadata) =>
cb(html.push(metadata) && error)),
(error) =>
callback(error, html));
}
function createFiles (platform, platformOptions, callback) {
const files = [];
async.forEachOf(config.files[platform], (properties, name, cb) =>
µ.Files.create(properties, name, platformOptions, (error, file) =>
cb(files.push(file) && error)),
(error) =>
callback(error, files));
}
function createFavicons (sourceset, platform, platformOptions, callback) {
const images = [];
async.forEachOf(config.icons[platform], (properties, name, cb) =>
createFavicon(sourceset, properties, name, platformOptions, (error, image) =>
cb(images.push(image) && error)),
(error) =>
callback(error, images));
}
function createPlatform (sourceset, platform, platformOptions, callback) {
async.parallel([
(cb) =>
createFavicons(sourceset, platform, platformOptions, cb),
(cb) =>
createFiles(platform, platformOptions, cb),
(cb) =>
createHTML(platform, cb)
], (error, results) =>
callback(error, results[0], results[1], results[2]));
}
function createOffline (sourceset, callback) {
const response = { images: [], files: [], html: [] };
async.forEachOf(options.icons, (enabled, platform, cb) => {
const platformOptions = µ.General.preparePlatformOptions(platform, enabled, options);
if (enabled) {
createPlatform(sourceset, platform, platformOptions, (error, images, files, html) => {
response.images = response.images.concat(images);
response.files = response.files.concat(files);
response.html = response.html.concat(html);
cb(error);
});
} else {
return cb(null);
}
}, (error) =>
callback(error, response));
}
function unpack (pack, callback) {
const response = { images: [], files: [], html: pack.html.split('\n') };
async.each(pack.files, (url, cb) =>
µ.RFG.fetch(url, (error, box) =>
cb(response.images.push(box.image) && response.files.push(box.file) && error)),
(error) =>
callback(error, response));
}
function createOnline (sourceset, callback) {
async.waterfall([
(cb) =>
µ.RFG.configure(sourceset, config.rfg, cb),
(request, cb) =>
µ.RFG.request(request, cb),
(pack, cb) =>
unpack(pack, cb)
], (error, results) => {
if (error && options.preferOnline) {
createOffline(sourceset, callback);
} else {
return callback(error, results);
}
});
}
function create (sourceset, callback) {
options.online || options.preferOnline ? createOnline(sourceset, callback) : createOffline(sourceset, callback);
}
async.waterfall([
(callback) =>
µ.General.source(source, callback),
(sourceset, callback) =>
create(sourceset, callback),
(response, callback) => {
if (options.pipeHTML) {
µ.Files.create(response.html, options.html, false, (error, file) => {
response.files = response.files.concat([file]);
return callback(error, response);
});
} else {
return callback(null, response);
}
}
], (error, response) =>
error ? next(error) : next(null, {
images: _.compact(response.images),
files: _.compact(response.files),
html: _.compact(response.html)
}));
}
function stream (params, handleHtml) {
const config = clone(configDefaults),
µ = helpers(params);
function processDocuments (documents, html, callback) {
async.each(documents, (document, cb) =>
µ.HTML.update(document, html, config.html, cb),
(error) =>
callback(error));
}
/* eslint func-names: 0, no-invalid-this: 0 */
return through2.obj(function (file, encoding, callback) {
const that = this;
if (file.isNull()) {
return callback(null, file);
}
if (file.isStream()) {
return callback(new Error('[gulp-favicons] Streaming not supported'));
}
async.waterfall([
(cb) =>
favicons(file.contents, params, cb),
(response, cb) =>
async.each(response.images.concat(response.files), (image, c) => {
that.push(µ.General.vinyl(image, file));
c();
}, (error) =>
cb(error, response)),
(response, cb) => {
if (handleHtml) {
handleHtml(response.html);
return cb(null);
}
if (params.html && !params.pipeHTML) {
const documents = typeof params.html === 'object' ? params.html : [params.html];
processDocuments(documents, response.html, cb);
} else {
return cb(null);
}
}
], (error) =>
callback(error));
});
}
module.exports = favicons;
module.exports.config = configDefaults;
module.exports.stream = stream;
})();

BIN
build/node_modules/favicons/mask.png generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -0,0 +1,125 @@
# v1.5.2
- Allow using `"consructor"` as an argument in `memoize` (#998)
- Give a better error messsage when `auto` dependency checking fails (#994)
- Various doc updates (#936, #956, #979, #1002)
# v1.5.1
- Fix issue with `pause` in `queue` with concurrency enabled (#946)
- `while` and `until` now pass the final result to callback (#963)
- `auto` will properly handle concurrency when there is no callback (#966)
- `auto` will now properly stop execution when an error occurs (#988, #993)
- Various doc fixes (#971, #980)
# v1.5.0
- Added `transform`, analogous to [`_.transform`](http://lodash.com/docs#transform) (#892)
- `map` now returns an object when an object is passed in, rather than array with non-numeric keys. `map` will begin always returning an array with numeric indexes in the next major release. (#873)
- `auto` now accepts an optional `concurrency` argument to limit the number of running tasks (#637)
- Added `queue#workersList()`, to retrieve the list of currently running tasks. (#891)
- Various code simplifications (#896, #904)
- Various doc fixes :scroll: (#890, #894, #903, #905, #912)
# v1.4.2
- Ensure coverage files don't get published on npm (#879)
# v1.4.1
- Add in overlooked `detectLimit` method (#866)
- Removed unnecessary files from npm releases (#861)
- Removed usage of a reserved word to prevent :boom: in older environments (#870)
# v1.4.0
- `asyncify` now supports promises (#840)
- Added `Limit` versions of `filter` and `reject` (#836)
- Add `Limit` versions of `detect`, `some` and `every` (#828, #829)
- `some`, `every` and `detect` now short circuit early (#828, #829)
- Improve detection of the global object (#804), enabling use in WebWorkers
- `whilst` now called with arguments from iterator (#823)
- `during` now gets called with arguments from iterator (#824)
- Code simplifications and optimizations aplenty ([diff](https://github.com/caolan/async/compare/v1.3.0...v1.4.0))
# v1.3.0
New Features:
- Added `constant`
- Added `asyncify`/`wrapSync` for making sync functions work with callbacks. (#671, #806)
- Added `during` and `doDuring`, which are like `whilst` with an async truth test. (#800)
- `retry` now accepts an `interval` parameter to specify a delay between retries. (#793)
- `async` should work better in Web Workers due to better `root` detection (#804)
- Callbacks are now optional in `whilst`, `doWhilst`, `until`, and `doUntil` (#642)
- Various internal updates (#786, #801, #802, #803)
- Various doc fixes (#790, #794)
Bug Fixes:
- `cargo` now exposes the `payload` size, and `cargo.payload` can be changed on the fly after the `cargo` is created. (#740, #744, #783)
# v1.2.1
Bug Fix:
- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. (#782)
# v1.2.0
New Features:
- Added `timesLimit` (#743)
- `concurrency` can be changed after initialization in `queue` by setting `q.concurrency`. The new concurrency will be reflected the next time a task is processed. (#747, #772)
Bug Fixes:
- Fixed a regression in `each` and family with empty arrays that have additional properties. (#775, #777)
# v1.1.1
Bug Fix:
- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. (#782)
# v1.1.0
New Features:
- `cargo` now supports all of the same methods and event callbacks as `queue`.
- Added `ensureAsync` - A wrapper that ensures an async function calls its callback on a later tick. (#769)
- Optimized `map`, `eachOf`, and `waterfall` families of functions
- Passing a `null` or `undefined` array to `map`, `each`, `parallel` and families will be treated as an empty array (#667).
- The callback is now optional for the composed results of `compose` and `seq`. (#618)
- Reduced file size by 4kb, (minified version by 1kb)
- Added code coverage through `nyc` and `coveralls` (#768)
Bug Fixes:
- `forever` will no longer stack overflow with a synchronous iterator (#622)
- `eachLimit` and other limit functions will stop iterating once an error occurs (#754)
- Always pass `null` in callbacks when there is no error (#439)
- Ensure proper conditions when calling `drain()` after pushing an empty data set to a queue (#668)
- `each` and family will properly handle an empty array (#578)
- `eachSeries` and family will finish if the underlying array is modified during execution (#557)
- `queue` will throw if a non-function is passed to `q.push()` (#593)
- Doc fixes (#629, #766)
# v1.0.0
No known breaking changes, we are simply complying with semver from here on out.
Changes:
- Start using a changelog!
- Add `forEachOf` for iterating over Objects (or to iterate Arrays with indexes available) (#168 #704 #321)
- Detect deadlocks in `auto` (#663)
- Better support for require.js (#527)
- Throw if queue created with concurrency `0` (#714)
- Fix unneeded iteration in `queue.resume()` (#758)
- Guard against timer mocking overriding `setImmediate` (#609 #611)
- Miscellaneous doc fixes (#542 #596 #615 #628 #631 #690 #729)
- Use single noop function internally (#546)
- Optimize internal `_each`, `_map` and `_keys` functions.

19
build/node_modules/favicons/node_modules/async/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,19 @@
Copyright (c) 2010-2014 Caolan McMahon
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.

1877
build/node_modules/favicons/node_modules/async/README.md generated vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,113 @@
{
"_from": "async@^1.5.0",
"_id": "async@1.5.2",
"_inBundle": false,
"_integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=",
"_location": "/favicons/async",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "async@^1.5.0",
"name": "async",
"escapedName": "async",
"rawSpec": "^1.5.0",
"saveSpec": null,
"fetchSpec": "^1.5.0"
},
"_requiredBy": [
"/favicons"
],
"_resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz",
"_shasum": "ec6a61ae56480c0c3cb241c95618e20892f9672a",
"_spec": "async@^1.5.0",
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build/node_modules/favicons",
"author": {
"name": "Caolan McMahon"
},
"bugs": {
"url": "https://github.com/caolan/async/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Higher-order functions and common patterns for asynchronous code",
"devDependencies": {
"benchmark": "github:bestiejs/benchmark.js",
"bluebird": "^2.9.32",
"chai": "^3.1.0",
"coveralls": "^2.11.2",
"es6-promise": "^2.3.0",
"jscs": "^1.13.1",
"jshint": "~2.8.0",
"karma": "^0.13.2",
"karma-browserify": "^4.2.1",
"karma-firefox-launcher": "^0.1.6",
"karma-mocha": "^0.2.0",
"karma-mocha-reporter": "^1.0.2",
"lodash": "^3.9.0",
"mkdirp": "~0.5.1",
"mocha": "^2.2.5",
"native-promise-only": "^0.8.0-a",
"nodeunit": ">0.0.0",
"nyc": "^2.1.0",
"rsvp": "^3.0.18",
"semver": "^4.3.6",
"uglify-js": "~2.4.0",
"xyz": "^0.5.0",
"yargs": "~3.9.1"
},
"files": [
"lib",
"dist/async.js",
"dist/async.min.js"
],
"homepage": "https://github.com/caolan/async#readme",
"jam": {
"main": "lib/async.js",
"include": [
"lib/async.js",
"README.md",
"LICENSE"
],
"categories": [
"Utilities"
]
},
"keywords": [
"async",
"callback",
"utility",
"module"
],
"license": "MIT",
"main": "lib/async.js",
"name": "async",
"repository": {
"type": "git",
"url": "git+https://github.com/caolan/async.git"
},
"scripts": {
"coverage": "nyc npm test && nyc report",
"coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls",
"lint": "jshint lib/*.js test/*.js perf/*.js && jscs lib/*.js test/*.js perf/*.js",
"mocha-browser-test": "karma start",
"mocha-node-test": "mocha mocha_test/",
"mocha-test": "npm run mocha-node-test && npm run mocha-browser-test",
"nodeunit-test": "nodeunit test/test-async.js",
"test": "npm run-script lint && npm run nodeunit-test && npm run mocha-test"
},
"spm": {
"main": "lib/async.js"
},
"version": "1.5.2",
"volo": {
"main": "lib/async.js",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
]
}
}

View File

@@ -0,0 +1,3 @@
test
.jshintrc
.travis.yml

View File

@@ -0,0 +1,336 @@
<!doctype html>
<!-- Created with GFM2HTML: https://github.com/rvagg/gfm2html -->
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="created-with" content="https://github.com/rvagg/gfm2html">
<style type="text/css">
/* most of normalize.css */
article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block;}[hidden],template{display:none;}html{font-family:sans-serif;/*1*/-ms-text-size-adjust:100%;/*2*/-webkit-text-size-adjust:100%;/*2*/}body{margin:0;}a{background:transparent;}a:focus{outline:thindotted;}a:active,a:hover{outline:0;}h1{font-size:2em;margin:0.67em0;}abbr[title]{border-bottom:1pxdotted;}b,strong{font-weight:bold;}dfn{font-style:italic;}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0;}mark{background:#ff0;color:#000;}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em;}pre{white-space:pre-wrap;}q{quotes:"\201C""\201D""\2018""\2019";}small{font-size:80%;}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}sup{top:-0.5em;}sub{bottom:-0.25em;}img{border:0;}svg:not(:root){overflow:hidden;}table{border-collapse:collapse;border-spacing:0;}
html {
font: 14px 'Helvetica Neue', Helvetica, arial, freesans, clean, sans-serif;
}
.container {
line-height: 1.6;
color: #333;
background: #eee;
border-radius: 3px;
padding: 3px;
width: 790px;
margin: 10px auto;
}
.body-content {
background-color: #fff;
border: 1px solid #CACACA;
padding: 30px;
}
.body-content > *:first-child {
margin-top: 0 !important;
}
a, a:visited {
color: #4183c4;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
p, blockquote, ul, ol, dl, table, pre {
margin: 15px 0;
}
.markdown-body h1
, .markdown-body h2
, .markdown-body h3
, .markdown-body h4
, .markdown-body h5
, .markdown-body h6 {
margin: 20px 0 10px;
padding: 0;
font-weight: bold;
}
h1 {
font-size: 2.5em;
color: #000;
border-bottom: 1px solid #ddd;
}
h2 {
font-size: 2em;
border-bottom: 1px solid #eee;
color: #000;
}
img {
max-width: 100%;
}
hr {
background: transparent url("/img/hr.png") repeat-x 0 0;
border: 0 none;
color: #ccc;
height: 4px;
padding: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
tr:nth-child(2n) {
background-color: #f8f8f8;
}
.markdown-body tr {
border-top: 1px solid #ccc;
background-color: #fff;
}
td, th {
border: 1px solid #ccc;
padding: 6px 13px;
}
th {
font-weight: bold;
}
blockquote {
border-left: 4px solid #ddd;
padding: 0 15px;
color: #777;
}
blockquote > :last-child, blockquote > :first-child {
margin-bottom: 0px;
}
pre, code {
font-size: 13px;
font-family: 'UbuntuMono', monospace;
white-space: nowrap;
margin: 0 2px;
padding: 0px 5px;
border: 1px solid #eaeaea;
background-color: #f8f8f8;
border-radius: 3px;
}
pre > code {
white-space: pre;
}
pre {
overflow-x: auto;
white-space: pre;
padding: 10px;
line-height: 150%;
background-color: #f8f8f8;
border-color: #ccc;
}
pre code, pre tt {
margin: 0;
padding: 0;
border: 0;
background-color: transparent;
border: none;
}
.highlight .c
, .highlight .cm
, .highlight .cp
, .highlight .c1 {
color:#999988;
font-style:italic;
}
.highlight .err {
color:#a61717;
background-color:#e3d2d2
}
.highlight .o
, .highlight .gs
, .highlight .kc
, .highlight .kd
, .highlight .kn
, .highlight .kp
, .highlight .kr {
font-weight:bold
}
.highlight .cs {
color:#999999;
font-weight:bold;
font-style:italic
}
.highlight .gd {
color:#000000;
background-color:#ffdddd
}
.highlight .gd .x {
color:#000000;
background-color:#ffaaaa
}
.highlight .ge {
font-style:italic
}
.highlight .gr
, .highlight .gt {
color:#aa0000
}
.highlight .gh
, .highlight .bp {
color:#999999
}
.highlight .gi {
color:#000000;
background-color:#ddffdd
}
.highlight .gi .x {
color:#000000;
background-color:#aaffaa
}
.highlight .go {
color:#888888
}
.highlight .gp
, .highlight .nn {
color:#555555
}
.highlight .gu {
color:#800080;
font-weight:bold
}
.highlight .kt {
color:#445588;
font-weight:bold
}
.highlight .m
, .highlight .mf
, .highlight .mh
, .highlight .mi
, .highlight .mo
, .highlight .il {
color:#009999
}
.highlight .s
, .highlight .sb
, .highlight .sc
, .highlight .sd
, .highlight .s2
, .highlight .se
, .highlight .sh
, .highlight .si
, .highlight .sx
, .highlight .s1 {
color:#d14
}
.highlight .n {
color:#333333
}
.highlight .na
, .highlight .no
, .highlight .nv
, .highlight .vc
, .highlight .vg
, .highlight .vi
, .highlight .nb {
color:#0086B3
}
.highlight .nc {
color:#445588;
font-weight:bold
}
.highlight .ni {
color:#800080
}
.highlight .ne
, .highlight .nf {
color:#990000;
font-weight:bold
}
.highlight .nt {
color:#000080
}
.highlight .ow {
font-weight:bold
}
.highlight .w {
color:#bbbbbb
}
.highlight .sr {
color:#009926
}
.highlight .ss {
color:#990073
}
.highlight .gc {
color:#999;
background-color:#EAF2F5
}
@media print {
.container {
background: transparent;
border-radius: 0;
padding: 0;
}
.body-content {
border: none;
}
}
</style>
</head>
<body>
<div class="container">
<div class="body-content"><h1 id="the-mit-license-mit-">The MIT License (MIT)</h1>
<p><strong>Copyright (c) 2016 Rod Vagg (the &quot;Original Author&quot;) and additional contributors</strong></p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &quot;Software&quot;), 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:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, 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.</p>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,9 @@
# The MIT License (MIT)
**Copyright (c) 2016 Rod Vagg (the "Original Author") and additional contributors**
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.

View File

@@ -0,0 +1,136 @@
# through2
[![NPM](https://nodei.co/npm/through2.png?downloads&downloadRank)](https://nodei.co/npm/through2/)
**A tiny wrapper around Node streams.Transform (Streams2) to avoid explicit subclassing noise**
Inspired by [Dominic Tarr](https://github.com/dominictarr)'s [through](https://github.com/dominictarr/through) in that it's so much easier to make a stream out of a function than it is to set up the prototype chain properly: `through(function (chunk) { ... })`.
Note: As 2.x.x this module starts using **Streams3** instead of Stream2. To continue using a Streams2 version use `npm install through2@0` to fetch the latest version of 0.x.x. More information about Streams2 vs Streams3 and recommendations see the article **[Why I don't use Node's core 'stream' module](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html)**.
```js
fs.createReadStream('ex.txt')
.pipe(through2(function (chunk, enc, callback) {
for (var i = 0; i < chunk.length; i++)
if (chunk[i] == 97)
chunk[i] = 122 // swap 'a' for 'z'
this.push(chunk)
callback()
}))
.pipe(fs.createWriteStream('out.txt'))
.on('finish', function () {
doSomethingSpecial()
})
```
Or object streams:
```js
var all = []
fs.createReadStream('data.csv')
.pipe(csv2())
.pipe(through2.obj(function (chunk, enc, callback) {
var data = {
name : chunk[0]
, address : chunk[3]
, phone : chunk[10]
}
this.push(data)
callback()
}))
.on('data', function (data) {
all.push(data)
})
.on('end', function () {
doSomethingSpecial(all)
})
```
Note that `through2.obj(fn)` is a convenience wrapper around `through2({ objectMode: true }, fn)`.
## API
<b><code>through2([ options, ] [ transformFunction ] [, flushFunction ])</code></b>
Consult the **[stream.Transform](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_transform)** documentation for the exact rules of the `transformFunction` (i.e. `this._transform`) and the optional `flushFunction` (i.e. `this._flush`).
### options
The options argument is optional and is passed straight through to `stream.Transform`. So you can use `objectMode:true` if you are processing non-binary streams (or just use `through2.obj()`).
The `options` argument is first, unlike standard convention, because if I'm passing in an anonymous function then I'd prefer for the options argument to not get lost at the end of the call:
```js
fs.createReadStream('/tmp/important.dat')
.pipe(through2({ objectMode: true, allowHalfOpen: false },
function (chunk, enc, cb) {
cb(null, 'wut?') // note we can use the second argument on the callback
// to provide data as an alternative to this.push('wut?')
}
)
.pipe(fs.createWriteStream('/tmp/wut.txt'))
```
### transformFunction
The `transformFunction` must have the following signature: `function (chunk, encoding, callback) {}`. A minimal implementation should call the `callback` function to indicate that the transformation is done, even if that transformation means discarding the chunk.
To queue a new chunk, call `this.push(chunk)`&mdash;this can be called as many times as required before the `callback()` if you have multiple pieces to send on.
Alternatively, you may use `callback(err, chunk)` as shorthand for emitting a single chunk or an error.
If you **do not provide a `transformFunction`** then you will get a simple pass-through stream.
### flushFunction
The optional `flushFunction` is provided as the last argument (2nd or 3rd, depending on whether you've supplied options) is called just prior to the stream ending. Can be used to finish up any processing that may be in progress.
```js
fs.createReadStream('/tmp/important.dat')
.pipe(through2(
function (chunk, enc, cb) { cb(null, chunk) }, // transform is a noop
function (cb) { // flush function
this.push('tacking on an extra buffer to the end');
cb();
}
))
.pipe(fs.createWriteStream('/tmp/wut.txt'));
```
<b><code>through2.ctor([ options, ] transformFunction[, flushFunction ])</code></b>
Instead of returning a `stream.Transform` instance, `through2.ctor()` returns a **constructor** for a custom Transform. This is useful when you want to use the same transform logic in multiple instances.
```js
var FToC = through2.ctor({objectMode: true}, function (record, encoding, callback) {
if (record.temp != null && record.unit == "F") {
record.temp = ( ( record.temp - 32 ) * 5 ) / 9
record.unit = "C"
}
this.push(record)
callback()
})
// Create instances of FToC like so:
var converter = new FToC()
// Or:
var converter = FToC()
// Or specify/override options when you instantiate, if you prefer:
var converter = FToC({objectMode: true})
```
## See Also
- [through2-map](https://github.com/brycebaril/through2-map) - Array.prototype.map analog for streams.
- [through2-filter](https://github.com/brycebaril/through2-filter) - Array.prototype.filter analog for streams.
- [through2-reduce](https://github.com/brycebaril/through2-reduce) - Array.prototype.reduce analog for streams.
- [through2-spy](https://github.com/brycebaril/through2-spy) - Wrapper for simple stream.PassThrough spies.
- the [mississippi stream utility collection](https://github.com/maxogden/mississippi) includes `through2` as well as many more useful stream modules similar to this one
## License
**through2** is Copyright (c) 2013 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.

View File

@@ -0,0 +1,65 @@
{
"_from": "through2@^2.0.0",
"_id": "through2@2.0.3",
"_inBundle": false,
"_integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=",
"_location": "/favicons/through2",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "through2@^2.0.0",
"name": "through2",
"escapedName": "through2",
"rawSpec": "^2.0.0",
"saveSpec": null,
"fetchSpec": "^2.0.0"
},
"_requiredBy": [
"/favicons"
],
"_resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz",
"_shasum": "0004569b37c7c74ba39c43f3ced78d1ad94140be",
"_spec": "through2@^2.0.0",
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build/node_modules/favicons",
"author": {
"name": "Rod Vagg",
"email": "r@va.gg",
"url": "https://github.com/rvagg"
},
"bugs": {
"url": "https://github.com/rvagg/through2/issues"
},
"bundleDependencies": false,
"dependencies": {
"readable-stream": "^2.1.5",
"xtend": "~4.0.1"
},
"deprecated": false,
"description": "A tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise",
"devDependencies": {
"bl": "~1.1.2",
"faucet": "0.0.1",
"stream-spigot": "~3.0.5",
"tape": "~4.6.2"
},
"homepage": "https://github.com/rvagg/through2#readme",
"keywords": [
"stream",
"streams2",
"through",
"transform"
],
"license": "MIT",
"main": "through2.js",
"name": "through2",
"repository": {
"type": "git",
"url": "git+https://github.com/rvagg/through2.git"
},
"scripts": {
"test": "node test/test.js | faucet",
"test-local": "brtapsauce-local test/basic-test.js"
},
"version": "2.0.3"
}

View File

@@ -0,0 +1,96 @@
var Transform = require('readable-stream/transform')
, inherits = require('util').inherits
, xtend = require('xtend')
function DestroyableTransform(opts) {
Transform.call(this, opts)
this._destroyed = false
}
inherits(DestroyableTransform, Transform)
DestroyableTransform.prototype.destroy = function(err) {
if (this._destroyed) return
this._destroyed = true
var self = this
process.nextTick(function() {
if (err)
self.emit('error', err)
self.emit('close')
})
}
// a noop _transform function
function noop (chunk, enc, callback) {
callback(null, chunk)
}
// create a new export function, used by both the main export and
// the .ctor export, contains common logic for dealing with arguments
function through2 (construct) {
return function (options, transform, flush) {
if (typeof options == 'function') {
flush = transform
transform = options
options = {}
}
if (typeof transform != 'function')
transform = noop
if (typeof flush != 'function')
flush = null
return construct(options, transform, flush)
}
}
// main export, just make me a transform stream!
module.exports = through2(function (options, transform, flush) {
var t2 = new DestroyableTransform(options)
t2._transform = transform
if (flush)
t2._flush = flush
return t2
})
// make me a reusable prototype that I can `new`, or implicitly `new`
// with a constructor call
module.exports.ctor = through2(function (options, transform, flush) {
function Through2 (override) {
if (!(this instanceof Through2))
return new Through2(override)
this.options = xtend(options, override)
DestroyableTransform.call(this, this.options)
}
inherits(Through2, DestroyableTransform)
Through2.prototype._transform = transform
if (flush)
Through2.prototype._flush = flush
return Through2
})
module.exports.obj = through2(function (options, transform, flush) {
var t2 = new DestroyableTransform(xtend({ objectMode: true, highWaterMark: 16 }, options))
t2._transform = transform
if (flush)
t2._flush = flush
return t2
})

BIN
build/node_modules/favicons/overlay.png generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

89
build/node_modules/favicons/package.json generated vendored Normal file
View File

@@ -0,0 +1,89 @@
{
"_from": "favicons",
"_id": "favicons@4.8.6",
"_inBundle": false,
"_integrity": "sha1-orE4AKs/7CcVvI8n+oQdA41HYeI=",
"_location": "/favicons",
"_phantomChildren": {
"readable-stream": "2.3.3",
"xtend": "4.0.1"
},
"_requested": {
"type": "tag",
"registry": true,
"raw": "favicons",
"name": "favicons",
"escapedName": "favicons",
"rawSpec": "",
"saveSpec": null,
"fetchSpec": "latest"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmjs.org/favicons/-/favicons-4.8.6.tgz",
"_shasum": "a2b13800ab3fec2715bc8f27fa841d038d4761e2",
"_spec": "favicons",
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build",
"author": {
"name": "Hayden Bleasel",
"email": "haydenbleasel@gmail.com"
},
"bugs": {
"url": "https://github.com/haydenbleasel/favicons/issues"
},
"bundleDependencies": false,
"dependencies": {
"async": "^1.5.0",
"cheerio": "^0.19.0",
"clone": "^1.0.2",
"colors": "^1.1.2",
"harmony-reflect": "^1.4.2",
"image-size": "^0.4.0",
"jimp": "^0.2.13",
"jsontoxml": "0.0.11",
"merge-defaults": "^0.2.1",
"mkdirp": "^0.5.1",
"node-rest-client": "^1.5.1",
"require-directory": "^2.1.1",
"svg2png": "~3.0.1",
"through2": "^2.0.0",
"tinycolor2": "^1.1.2",
"to-ico": "^1.1.2",
"underscore": "^1.8.3",
"vinyl": "^1.1.0"
},
"deprecated": false,
"description": "Favicon generator for Node.js",
"devDependencies": {
"babel-preset-es2015": "^6.1.18",
"eslint": "^2.3.0",
"gulp": "^3.9.0",
"gulp-babel": "^6.1.1",
"gulp-if": "^2.0.0",
"gulp-rename": "^1.2.2",
"gutil": "^1.6.4"
},
"homepage": "https://github.com/haydenbleasel/favicons",
"keywords": [
"favicon",
"ico",
"generator",
"node",
"realfavicongenerator",
"gulpfriendly"
],
"license": "ISC",
"main": "index.js",
"name": "favicons",
"repository": {
"type": "git",
"url": "git+https://github.com/haydenbleasel/favicons.git"
},
"scripts": {
"prepublish": "gulp",
"test": "cd test && node test.js && gulp"
},
"version": "4.8.6"
}

152
build/node_modules/favicons/readme.md generated vendored Normal file
View File

@@ -0,0 +1,152 @@
# Favicons [![Build Status](https://travis-ci.org/haydenbleasel/favicons.svg?branch=master)](https://travis-ci.org/haydenbleasel/favicons)
A Node.js module for generating favicons and their associated files. Originally built for [Google's Web Starter Kit](https://github.com/google/web-starter-kit) and [Catalyst](https://github.com/haydenbleasel/catalyst). Requires Node 4+. Installed through NPM with:
```
npm install favicons
```
## Usage
### Node.js
To use Favicons, require the appropriate module and call it, optionally specifying configuration and callback objects. A sample is shown on the right. The full list of options can be found on GitHub.
The Gulp / Grunt wrapper modules have a few extra properties. You can also configure and use Favicons from the terminal with dot syntax.
Favicons generates its icons locally using pure Javascript with no external dependencies. However, due to extensive collaboration with RealFaviconGenerator, you can opt to have your favicons generated using their online API.
Please note: Favicons is written in ES6, meaning you need Node 4.x or above.
```js
var favicons = require('favicons'),
source = 'test/logo.png', // Source image(s). `string`, `buffer` or array of `string`
configuration = {
appName: null, // Your application's name. `string`
appDescription: null, // Your application's description. `string`
developerName: null, // Your (or your developer's) name. `string`
developerURL: null, // Your (or your developer's) URL. `string`
background: "#fff", // Background colour for flattened icons. `string`
theme_color: "#fff", // Theme color for browser chrome. `string`
path: "/", // Path for overriding default icons path. `string`
display: "standalone", // Android display: "browser" or "standalone". `string`
orientation: "portrait", // Android orientation: "portrait" or "landscape". `string`
start_url: "/?homescreen=1", // Android start application's URL. `string`
version: "1.0", // Your application's version number. `number`
logging: false, // Print logs to console? `boolean`
online: false, // Use RealFaviconGenerator to create favicons? `boolean`
preferOnline: false, // Use offline generation, if online generation has failed. `boolean`
icons: {
// Platform Options:
// - offset - offset in percentage
// - shadow - drop shadow for Android icons, available online only
// - background:
// * false - use default
// * true - force use default, e.g. set background for Android icons
// * color - set background for the specified icons
//
android: true, // Create Android homescreen icon. `boolean` or `{ offset, background, shadow }`
appleIcon: true, // Create Apple touch icons. `boolean` or `{ offset, background }`
appleStartup: true, // Create Apple startup images. `boolean` or `{ offset, background }`
coast: { offset: 25 }, // Create Opera Coast icon with offset 25%. `boolean` or `{ offset, background }`
favicons: true, // Create regular favicons. `boolean`
firefox: true, // Create Firefox OS icons. `boolean` or `{ offset, background }`
windows: true, // Create Windows 8 tile icons. `boolean` or `{ background }`
yandex: true // Create Yandex browser icon. `boolean` or `{ background }`
}
},
callback = function (error, response) {
if (error) {
console.log(error.status); // HTTP error code (e.g. `200`) or `null`
console.log(error.name); // Error name e.g. "API Error"
console.log(error.message); // Error description e.g. "An unknown error has occurred"
return;
}
console.log(response.images); // Array of { name: string, contents: <buffer> }
console.log(response.files); // Array of { name: string, contents: <string> }
console.log(response.html); // Array of strings (html elements)
};
favicons(source, configuration, callback);
```
If you need an ES5 build for legacy purposes, just require the ES5 file:
```js
var favicons = require('favicons/es5');
```
You can programmatically access Favicons configuration (icon filenames, HTML, manifest files, etc) with:
```js
var config = require('favicons').config;
```
### Gulp
To use Favicons with Gulp, require the `gulp-favicons` wrapper and use it as follows:
```js
var favicons = require("gulp-favicons"),
gutil = require("gulp-util");
gulp.task("default", function () {
return gulp.src("logo.png").pipe(favicons({
appName: "My App",
appDescription: "This is my application",
developerName: "Hayden Bleasel",
developerURL: "http://haydenbleasel.com/",
background: "#020307",
path: "favicons/",
url: "http://haydenbleasel.com/",
display: "standalone",
orientation: "portrait",
start_url: "/?homescreen=1",
version: 1.0,
logging: false,
online: false,
html: "index.html",
pipeHTML: true,
replace: true
}))
.on("error", gutil.log)
.pipe(gulp.dest("./"));
});
```
If you need an ES5 build for legacy purposes, just require the ES5 file:
```js
var favicons = require('gulp-favicons/es5');
```
## Output
For the full list of files, check `config/files.json`. For the full HTML code, check `config/html.json`. Finally, for the full list of icons, check `config/icons.json`.
## Contributing
To build the ES5 version for Node.js:
```sh
gulp
```
## Questions
> What's the difference between offline and online?
Offline uses pure Javascript image manipulation (JIMP) in Node.js to create your Favicons. Online uses the [RealFaviconGenerator API](https://realfavicongenerator.net/) to generate a Favicons package and then we download it. When using offline, generating favicons is a lot faster and doesn't require an internet connection, however we're missing a few features from RFG at the moment.
> Why are you missing certain favicons?
Because pure Javascript modules aren't available at the moment. For example, the [El Capitan SVG favicon](https://github.com/haydenbleasel/favicons/issues/61) and the [Windows tile silhouette ability](https://github.com/haydenbleasel/favicons/issues/58) both require [SVG support](https://github.com/haydenbleasel/favicons/issues/53). If modules for these task begin to appear, please jump on the appropriate issue and we'll get on it ASAP.
## Credits
Thank you to...
- [@phbernard](https://github.com/phbernard) for all the work we did together to make Favicons and RFG awesome.
- [@addyosmani](https://github.com/addyosmani), [@gauntface](https://github.com/gauntface), [@paulirish](https://github.com/paulirish), [@mathiasbynens](https://github.com/mathiasbynens) and [@pbakaus](https://github.com/pbakaus) for [their input](https://github.com/google/web-starter-kit/pull/442) on multiple source images.
- [@sindresorhus](https://github.com/sindresorhus) for his help on documentation and parameter improvements.
- Everyone who opens an issue or submits a pull request to this repo :)

34
build/node_modules/favicons/test/gulpfile.js generated vendored Normal file
View File

@@ -0,0 +1,34 @@
const gulp = require('gulp'),
gutil = require('gutil'),
favicons = require('../').stream;
(() => {
'use strict';
gulp.task('default', () =>
gulp.src('logo.png')
.pipe(favicons({
appName: 'Favicons 4.0',
appDescription: 'Testing suite for Favicons',
developerName: 'Hayden Bleasel',
developerURL: 'http://haydenbleasel.com/',
background: '#26353F',
path: 'stream/',
url: 'http://haydenbleasel.com/',
display: 'browser',
orientation: 'landscape',
version: '1.0',
logging: true,
online: false,
icons: {
coast: false
},
html: 'stream.html',
pipeHTML: true,
replace: false
}))
.on('error', gutil.log)
.pipe(gulp.dest('stream/')));
})();

31
build/node_modules/favicons/test/index.html generated vendored Normal file
View File

@@ -0,0 +1,31 @@
<!doctype html><html><head>
<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="images/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="images/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="images/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="images/apple-touch-icon-180x180.png">
<link rel="apple-touch-icon" sizes="57x57" href="images/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="images/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="images/apple-touch-icon-76x76.png">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="icon" type="image/png" sizes="192x192" href="images/android-chrome-192x192.png">
<link rel="manifest" href="images/manifest.json">
<meta name="mobile-web-app-capable" content="yes">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="230x230" href="images/favicon-230x230.png">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon-96x96.png">
<link rel="shortcut icon" href="images/favicon.ico">
<link rel="yandex-tableau-widget" href="images/yandex-browser-manifest.json">
<meta name="msapplication-TileColor" content="#FFFFFF">
<meta name="msapplication-TileImage" content="images/mstile-144x144.png">
<meta name="msapplication-config" content="images/browserconfig.xml">
<link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 1)" href="images/apple-touch-startup-image-1024x748.png">
<link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" href="images/apple-touch-startup-image-1536x2008.png">
<link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" href="images/apple-touch-startup-image-2048x1496.png">
<link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 1)" href="images/apple-touch-startup-image-320x460.png">
<link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)" href="images/apple-touch-startup-image-640x1096.png">
<link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 2)" href="images/apple-touch-startup-image-640x920.png">
<link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 1)" href="images/apple-touch-startup-image-768x1004.png">
</head><body></body></html>

BIN
build/node_modules/favicons/test/logo.png generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

101
build/node_modules/favicons/test/test.js generated vendored Normal file
View File

@@ -0,0 +1,101 @@
/* eslint no-sync: 0 */
const favicons = require('../'),
fs = require('fs'),
mkdirp = require('mkdirp');
(() => {
'use strict';
favicons('./logo.png', {
appName: 'Favicons 4.0',
appDescription: 'Testing suite for Favicons',
developerName: 'Hayden Bleasel',
developerURL: 'http://haydenbleasel.com/',
background: '#26353F',
theme_color: 'aliceblue',
dir: 'ltr',
lang: 'en-US',
path: 'images/',
url: 'http://haydenbleasel.com/',
display: 'browser',
orientation: 'landscape',
start_url: "/?android-homescreen=1",
version: '1.0',
logging: true,
online: false,
icons: {
coast: false
}
}, (error, response) => {
if (error) {
throw error;
}
console.log(`Images: ${ response.images }`);
console.log(`Files: ${ response.files }`);
console.log(`HTML: ${ response.html }`);
if (response.images) {
mkdirp.sync('./images-offline/');
response.images.forEach((image) =>
fs.writeFileSync(`./images-offline/${ image.name }`, image.contents));
}
if (response.files) {
mkdirp.sync('./files-offline/');
response.files.forEach((file) =>
fs.writeFileSync(`./files-offline/${ file.name }`, file.contents));
}
if (response.html) {
fs.writeFileSync('./test.html', response.html.join('\n'));
}
});
favicons('./logo.png', {
appName: 'Favicons 4.0',
appDescription: 'Testing suite for Favicons',
developerName: 'Hayden Bleasel',
developerURL: 'http://haydenbleasel.com/',
background: '#26353F',
path: 'images/',
display: 'browser',
orientation: 'landscape',
version: '1.0',
online: true,
icons: {
coast: false
}
}, (error, response) => {
if (error) {
throw error;
}
console.log(`Images: ${ response.images }`);
console.log(`Files: ${ response.files }`);
console.log(`HTML: ${ response.html }`);
if (response.images) {
mkdirp.sync('./images-online/');
response.images.forEach((image) =>
fs.writeFileSync(`./images-online/${ image.name }`, image.contents));
}
if (response.files) {
mkdirp.sync('./files-online/');
response.files.forEach((file) =>
fs.writeFileSync(`./files-online/${ file.name }`, file.contents));
}
if (response.html) {
fs.writeFileSync('./rfg.html', response.html.join('\n'));
}
});
})();