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
Vendored
BIN
View File
Binary file not shown.
+263
View File
@@ -0,0 +1,263 @@
# Send everythign as UTF-8 by default
AddDefaultCharset utf-8
# Set 404 Error fallback page
ErrorDocument 404 /404.html
# Disable the pattern matching based on filenames.
#
# This setting prevents Apache from returning a 404 error as the result
# of a rewrite when the directory with the same name does not exist.
Options -MultiViews
# Prevent Apache from adding a trailing footer line containing
# information about the server to the server-generated documents
# (e.g.: error messages, directory listings, etc.)
ServerSignature Off
# Remove `ETags` as resources are sent with far-future expires headers
FileETag None
<IfModule mod_headers.c>
# Rules to correctly serve gzip compressed CSS and JS files.
# Requires both mod_rewrite and mod_headers to be enabled.
# Serve correct encoding type for zopfli files
<FilesMatch "(\.js\.gz|\.css\.gz|\.svg\.gz|\.html\.gz|\.json\.gz)$">
Header set Content-Encoding gzip
# Force proxies to cache gzipped & non-gzipped css/js files separately.
Header append Vary Accept-Encoding
</FilesMatch>
# Serve correct encoding type for brotli files
<FilesMatch "(\.js\.br|\.css\.br|\.svg\.br|\.html\.br|\.json\.br)$">
Header set Content-Encoding br
# Force proxies to cache gzipped & non-gzipped css/js files separately.
Header append Vary Accept-Encoding
</FilesMatch>
# Set Content Security Policy options
Header set Content-Security-Policy "default-src 'self'; img-src 'self' *.github.com; connect-src 'self' api.asciidisco.com; require-sri-for script style; block-all-mixed-content; frame-ancestors 'self'; form-action 'self'; sandbox allow-same-origin allow-scripts; base-uri 'self';"
Header set X-Content-Type-Options nosniff
Header set X-Frame-Options DENY
# Set Referrer Policy header
Header set Referrer-Policy same-origin
# Detect WebP support with Header Vary Accept
Header append Vary Accept env=REDIRECT_accept
# Prevent some browsers from MIME-sniffing the response.
#
# This reduces exposure to drive-by download attacks and cross-origin
# data leaks, and should be left uncommented, especially if the server
# is serving user-uploaded content or content that could potentially be
# treated as executable by the browser.
Header set X-Content-Type-Options "nosniff"
# Prevent intermediate caches or proxies (e.g.: such as the ones
# used by mobile network providers) from modifying the website's content.
Header merge Cache-Control "no-transform"
# Enable HSTS
Header set Strict-Transport-Security "max-age=63072000"
# Protect website against clickjacking.
#
# The example below sends the `X-Frame-Options` response header with
# the value `DENY`, informing browsers not to display the content of
# the web page in any frame.
Header set X-Frame-Options "DENY"
# Try to re-enable the cross-site scripting (XSS) filter built into most web browsers.
Header set X-XSS-Protection "1; mode=block"
# Remove `ETags` and `Last-Modified` as resources are sent with far-future expires headers.
Header unset ETag
Header unset Last-Modified
# Remove server type header
Header unset X-Powered-By
# Set language header
<FilesMatch "(\.html|\.html\.gz|\.html\.br|\.js|\.js\.gz|\.js\.br|\.css|\.css\.gz|\.css\.br|\.svg|\.svg\.gz|\.svg\.br|\.json|\.json\.gz|\.json\.br|\.xml|\.xml\.gz|\.xml\.br)$">
Header set Content-Language en-GB
</FilesMatch>
# Unset X-FRAME-OPTIONS, X-XSS-Protection and Content-Security-Policy for everything but html
<FilesMatch "(\.js|\.js\.gz|\.js\.br|\.css|\.css\.gz|\.css\.br|\.svg|\.svg\.gz|\.svg\.br|\.json|\.json\.gz|\.json\.br|\.xml|\.xml\.gz|\.xml\.br|\.woff2|\.woff|\.jpg|\.jpeg|\.png|\.webm|\.gif|\.webp)$">
Header unset X-Frame-Options
Header unset X-XSS-Protection
Header unset Content-Security-Policy
</FilesMatch>
# HTTP/2 PUSH Maps
{{{PUSH_MANIFEST}}}
</IfModule>
<IfModule mod_mime.c>
# Data interchange
AddType application/atom+xml atom
AddType application/json json map topojson
AddType application/ld+json jsonld
AddType application/rss+xml rss
AddType application/vnd.geo+json geojson
AddType application/xml rdf xml
# JavaScript
AddType application/javascript js mjs
# Manifest files
AddType application/manifest+json webmanifest
AddType application/x-web-app-manifest+json webapp
AddType text/cache-manifest appcache
# Media files
AddType audio/mp4 f4a f4b m4a
AddType audio/ogg oga ogg opus
AddType image/bmp bmp
AddType image/svg+xml svg svgz
AddType image/webp webp
AddType video/mp4 f4v f4p m4v mp4
AddType video/ogg ogv
AddType video/webm webm
AddType video/x-flv flv
AddType image/x-icon cur ico
# Web fonts
AddType font/woff woff
AddType font/woff2 woff2
AddType application/vnd.ms-fontobject eot
AddType font/ttf ttf
AddType font/collection ttc
AddType font/otf otf
# Other
AddType application/octet-stream safariextz
AddType application/x-bb-appworld bbaw
AddType application/x-chrome-extension crx
AddType application/x-opera-extension oex
AddType application/x-xpinstall xpi
AddType text/calendar ics
AddType text/markdown markdown md
AddType text/vcard vcard vcf
AddType text/vnd.rim.location.xloc xloc
AddType text/vtt vtt
AddType text/x-component htc
AddType image/webp webp
# Send text resources as UTF-8 by default
AddCharset utf-8 .atom \
.bbaw \
.css \
.geojson \
.ics \
.js \
.json \
.jsonld \
.manifest \
.markdown \
.md \
.mjs \
.rdf \
.rss \
.topojson \
.vtt \
.webapp \
.webmanifest \
.xloc \
.xml
</IfModule>
<IfModule mod_rewrite.c>
# Serve brotli/zopfli compressed CSS files if they exist and the client accepts gzip.
RewriteCond %{HTTP:Accept-encoding} br
RewriteCond %{REQUEST_FILENAME}\.br -s
RewriteRule ^(.*)\.css $1\.css\.br [QSA]
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule ^(.*)\.css $1\.css\.gz [QSA]
# Serve brotli/zopfli compressed JS files if they exist and the client accepts gzip.
RewriteCond %{HTTP:Accept-encoding} br
RewriteCond %{REQUEST_FILENAME}\.br -s
RewriteRule ^(.*)\.js $1\.js\.br [QSA]
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule ^(.*)\.js $1\.js\.gz [QSA]
# Serve brotli/zopfli compressed SVG files if they exist and the client accepts gzip.
RewriteCond %{HTTP:Accept-encoding} br
RewriteCond %{REQUEST_FILENAME}\.br -s
RewriteRule ^(.*)\.svg $1\.svg\.br [QSA]
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule ^(.*)\.svg $1\.svg\.gz [QSA]
# Serve brotli/zopfli compressed SVG files if they exist and the client accepts gzip.
RewriteCond %{HTTP:Accept-encoding} br
RewriteCond %{REQUEST_FILENAME}\.br -s
RewriteRule ^(.*)\.html $1\.html\.br [QSA]
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule ^(.*)\.html $1\.html\.gz [QSA]
# Serve brotli/zopfli compressed JSON files if they exist and the client accepts gzip.
RewriteCond %{HTTP:Accept-encoding} br
RewriteCond %{REQUEST_FILENAME}\.br -s
RewriteRule ^(.*)\.json $1\.json\.br [QSA]
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule ^(.*)\.json $1\.json\.gz [QSA]
# Serve correct content types, and prevent mod_deflate double gzip.
RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1]
RewriteRule \.css\.br$ - [T=text/css,E=no-gzip:1]
RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1]
RewriteRule \.js\.br$ - [T=text/javascript,E=no-gzip:1]
RewriteRule \.svg\.gz$ - [T=image/svg+xml,E=no-gzip:1]
RewriteRule \.svg\.br$ - [T=image/svg+xml,E=no-gzip:1]
RewriteRule \.html\.gz$ - [T=text/html,E=no-gzip:1]
RewriteRule \.html\.br$ - [T=text/html,E=no-gzip:1]
RewriteRule \.json\.gz$ - [T=application/json,E=no-gzip:1]
RewriteRule \.json\.br$ - [T=application/json,E=no-gzip:1]
# Force redirect to HTTPS
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# Check if browser support WebP images
RewriteCond %{HTTP_ACCEPT} image/webp
# Check if WebP replacement image exists
RewriteCond %{DOCUMENT_ROOT}/$1.webp -f
# Serve WebP image instead
RewriteRule (.+)\.(jpe?g|png)$ $1.webp [T=image/webp,E=accept:1]
# Route requests to the latest deployment public folder
RewriteCond %{REQUEST_URI} !^/{{PUBLIC_FOLDER}}/
RewriteRule (.*) {{PUBLIC_FOLDER}}/$1 [L]
# Filename-based cache busting
# Rewrites all requests such as `/css/style.12sf65.css` to `/css/style.css`.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)\.([a-zA-Z0-9]+)\.(bmp|css|cur|gif|ico|jpe?g|m?js|png|svgz?|webp|webmanifest)$ $1.$3 [L]
</IfModule>
<IfModule mod_expires.c>
# Serve resources with far-future expires headers
ExpiresActive on
ExpiresDefault "access plus 0 seconds"
# CSS
ExpiresByType text/css "access plus 1 year"
# HTML
ExpiresByType text/html "access plus 0 seconds"
# JavaScript
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType application/x-javascript "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"
</IfModule>
BIN
View File
Binary file not shown.
+86
View File
@@ -0,0 +1,86 @@
const path = require('path')
// get timestamp as deployment directory name
const get_timestamp = () => String(Math.floor(new Date() / 1000))
// static config
module.exports = {
/* paths */
root_dir: get_timestamp(),
basepath: path.normalize(__dirname + '/..'),
template_path: 'templates/',
partials_path: 'components/',
font_path: 'font/',
image_path: 'img/',
css_path: 'css/',
javascipt: 'js/',
paths: {
base: path.normalize(__dirname + '/..'),
js: 'js',
css: 'css',
img: 'img',
font: 'font',
templates: 'templates',
},
html: {
pages: [
{name: 'index', template: 'home', css: ['core', 'home'], js: ['scripts']}
]
},
images: [
'bg/*.{jpg,png,svg}',
'content/*.{jpg,png,svg}',
'menu/*.{jpg,png,svg}',
'util/*.{jpg,png,svg}',
],
/* serviceworker */
serviceworker: {
file: 'sw.js',
statics: ['css/**.css', '**.html', 'img/**/**.{jpg,png,webp,svg}', 'js/**.js']
},
/* ftp connection */
ftp_options: {
host: 'w00dfcf1.kasserver.com',
user: 'f00e43cc',
password: 'UH57MsPPAmXGo3Xm',
},
/* ghost */
ghost: {
id: 'ghost-admin',
secret: 'f481cecda9fb',
username: 'public@asciidisco.com',
password: 'Bx75q3Vt!',
host: 'worried-secure.glitch.me',
},
/* github */
github: {
user: 'asciidisco'
},
/* markdown contents */
mdcontents: {
pages: [
{key: 'about-short', url: 'https://raw.githubusercontent.com/asciidisco/about.me/master/README.md'}
]
},
/* RSS/Atom/JSON feed */
rss: {
title: 'asciidisco.com Blog',
description: 'Blog of asciidisco (Sebastian Golasch)',
id: 'https://stage.asciidisco.com',
link: 'https://stage.asciidisco.com',
image: 'https://stage.asciidisco.com/android-chome-512x512.png',
favicon: 'https://stage.asciidisco.com/favicon.ico',
copyright: '2018 Sebastian Golasch',
generator: 'asciidisco.com',
feedLinks: {
json: 'https://stage.asciidisco.com/feed.json',
atom: 'https://stage.asciidisco.com/feed.atom',
},
author: {
name: 'Sebastian Golasch',
email: 'public@asciidisco.com',
link: 'https://stage.asciidisco.com',
},
categories: ['Technology','JavaScript','Web','Python','Rust','React Native'],
}
}
+84
View File
@@ -0,0 +1,84 @@
{
"manifest": {
"title": "asciidisco.com Blog",
"description": "Blog of asciidisco (Sebastian Golasch)",
"url": "https://stage.asciidisco.com",
"copyright": "2018 Sebastian Golasch",
"author": {
"name": "Sebastian Golasch",
"email": "public@asciidisco.com"
},
"keywords": [
"Technology",
"JavaScript",
"IoT",
"Web",
"Python",
"Rust",
"React Native"
]
},
"content": {
"ghost": {
"id": "ghost-admin",
"secret": "f481cecda9fb",
"username": "public@asciidisco.com",
"password": "Bx75q3Vt!",
"host": "worried-secure.glitch.me"
},
"github": {
"user": "asciidisco"
},
"markdown": {
"pages": [
{"key": "about-short", "url": "https://raw.githubusercontent.com/asciidisco/about.me/master/README.md"}
]
}
},
"css": {
"plugins": {
"postcss-import": {},
"autoprefixer": {},
"css-mqpacker": {},
"postcss-unique-selectors": {},
"postcss-merge-selectors": {},
"postcss-minify-selectors": {},
"postcss-merge-longhand": {},
"postcss-merge-idents": {},
"postcss-convert-values": {},
"postcss-colormin": {},
"postcss-discard-unused": {},
"postcss-minify-font-values": {},
"postcss-discard-duplicates": {},
"postcss-discard-empty": {},
"postcss-ordered-values": {},
"cssnano": {"preset": "default"},
"postcss-csso": {}
}
},
"images": {
"plugins": {
"imagemin-jpegtran": {},
"imagemin-jpegoptim": {},
"imagemin-mozjpeg": {},
"imagemin-zopfli": {"more": true},
"imagemin-pngcrush": {},
"imagemin-advpng": {},
"imagemin-optipng": {},
"imagemin-svgo'": {}
}
},
"serviceworker": {
"statics": {
"prefer-cache": [".css", ".jpg", ".png", ".webp", ".svg", ".js"],
"offline-only": [".html"]
}
},
"deploy": {
"ftp": {
"host": "w00dfcf1.kasserver.com",
"user": "f00e43cc",
"password": "UH57MsPPAmXGo3Xm"
}
}
}
+50
View File
@@ -0,0 +1,50 @@
const config = require('./config')
const content = require('./tasks/fetch_content')
const feed = require('./tasks/feed')
const icons = require('./tasks/icons')
const images = require('./tasks/images')
const fonts = require('./tasks/fonts')
const css = require('./tasks/css')
const javascript = require('./tasks/javascript')
const pwa_manifest = require('./tasks/manifest')
const serviceworker = require('./tasks/serviceworker')
const html = require('./tasks/html')
const htaccess = require('./tasks/htaccess')
const deploy = require('./tasks/deploy')
const chalk = require('chalk')
const log = console.log;
(async function __main() {
let result = {}
log(chalk.blue('>>'), 'Starting static page generator')
try {
log(chalk.blue('>>'), 'Fetching remote content')
result.content = await content(config, result)
/*log(chalk.blue('>>'), 'Creating feed')
result.feed = await feed(config, result)
log(chalk.blue('>>'), 'Creating icons')
result.icons = await icons(config, result)
log(chalk.blue('>>'), 'Creating image files')
result.images = await images(config, result)
log(chalk.blue('>>'), 'Creating font files')
result.fonts = await fonts(config, result)
log(chalk.blue('>>'), 'Creating css files')
result.css = await css(config, result)
log(chalk.blue('>>'), 'Creating js files')
result.javascript = await javascript(config, result)
log(chalk.blue('>>'), 'Creating html files')
result.html = await html(config, result)
log(chalk.blue('>>'), 'Creating PWA manifest')
result.pwa = await pwa_manifest(config, result)*/
//log(chalk.blue('>>'), 'Creating serviceworker file')
//result.serviceworker = await serviceworker(config, result)
/*log(chalk.blue('>>'), 'Creating .htaccess')
result.htaccess = await htaccess(config, result)
log(chalk.blue('>>'), 'Deploying to server')
result.deploy = await deploy(config, result)
log(chalk.blue('>>'), 'Done without errors')*/
} catch(err) {
log(chalk.red('>>'), 'Error:')
log(chalk.red('>>'), err)
}
})()
+39
View File
@@ -0,0 +1,39 @@
const http = require('http')
const https = require('https')
const {promisify} = require('util')
https.get[promisify.custom] = function getAsyncHttps (options) {
return new Promise((resolve, reject) => {
const req = https.get(options, res => {
if (res.statusCode >= 400) return reject(new Error(res.statusCode))
res.end = new Promise(resolve => res.on('end', resolve))
resolve(res)
})
req.on('error', reject)
req.on('timeout', () => reject(new Error('timeout')) && req.abort())
})
}
http.get[promisify.custom] = function getAsyncHttp (options) {
return new Promise((resolve, reject) => {
const req = http.get(options, res => {
if (res.statusCode >= 400) return reject(new Error(res.statusCode))
res.end = new Promise(resolve => res.on('end', resolve))
resolve(res)
})
req.on('error', reject)
req.on('timeout', () => reject(new Error('timeout')) && req.abort())
})
}
const parseJSONData = (data, resolve, reject) => {
try {
resolve(JSON.parse(data.read()))
} catch (error) {
reject(error)
}
}
module.exports.parseJSONData = parseJSONData
module.exports.httpsGetAsync = promisify(https.get)
module.exports.httpGetAsync = promisify(http.get)
BIN
View File
Binary file not shown.
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../JSONStream/bin.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../acorn/bin/acorn
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../advpng-bin/cli.js
+1
View File
@@ -0,0 +1 @@
../autoprefixer/bin/autoprefixer-info
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../babylon/bin/babylon.js
+1
View File
@@ -0,0 +1 @@
../bin-version-check/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../browser-pack/bin/cmd.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../browserify/bin/cmd.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../browserslist/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../color-support/bin.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../csso/bin/csso
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../cwebp-bin/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../deps-sort/bin/cmd.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../detect-libc/bin/detect-libc.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../esprima/bin/esparse.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../esprima/bin/esvalidate.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../executable/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../extract-zip/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../find-versions/cli.js
+1
View File
@@ -0,0 +1 @@
../google-closure-compiler-js/cmd.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../guetzli/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../handlebars/bin/handlebars
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../he/bin/he
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../html-minifier/cli.js
+1
View File
@@ -0,0 +1 @@
../http2-push-manifest/bin/http2-push-manifest
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../image-size/bin/image-size.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../inline-require/index.js
+1
View File
@@ -0,0 +1 @@
../insert-module-globals/bin/cmd.js
+1
View File
@@ -0,0 +1 @@
../jpeg-recompress-bin/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../jpegoptim-bin/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../jpegtran-bin/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../js-yaml/bin/js-yaml.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../jsesc/bin/jsesc
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../json5/lib/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../lnfs/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../loose-envify/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../lpad-align/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../markdown-it/bin/markdown-it.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../miller-rabin/bin/miller-rabin
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../mime/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../mkdirp/bin/cmd.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../module-deps/bin/cmd.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../mozjpeg/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../css-mqpacker/bin/mqpacker.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../node-gyp/bin/node-gyp.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../node-pre-gyp/bin/node-pre-gyp
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../nopt/bin/nopt.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../npm-path/bin/npm-path
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../npm-which/bin/npm-which.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../optipng-bin/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../phantomjs-prebuilt/bin/phantomjs
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../pixelmatch/bin/pixelmatch
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../pngcrush-bin/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../pngout-bin/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../pngquant-bin/cli.js
+1
View File
@@ -0,0 +1 @@
../prebuild-install/bin.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../prepack/bin/prepack.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../prepack/bin/prepack-repl.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../rc/index.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../rimraf/bin.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../seek-bzip/bin/seek-bunzip
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../seek-bzip/bin/seek-bzip-table
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../semver/bin/semver
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../sha.js/bin.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../sshpk/bin/sshpk-conv
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../sshpk/bin/sshpk-sign
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../sshpk/bin/sshpk-verify
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../strip-dirs/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../strip-indent/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../stylehacks/dist/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../svg2png/bin/svg2png-cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../svgo/bin/svgo
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../sw-precache/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../tlds/bin.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../uglify-es/bin/uglifyjs
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../umd/bin/cli.js
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../uuid/bin/uuid
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../vulcanize/bin/vulcanize
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../which/bin/which
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../node-zopfli/bin/zopfli
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../node-zopfli/bin/zopflipng
+27
View File
@@ -0,0 +1,27 @@
{
"lang": "en-US",
"display": "standalone",
"orientation": "natural",
"splash_screens": [{
"src": "splash/lowres",
"sizes": "320x240"
}, {
"src": "splash/hd_small",
"sizes": "1334x750"
}, {
"src": "splash/hd_hi",
"sizes": "1920x1080",
"density": 3
}],
"prefer_related_applications": "true",
"related_applications": [{
"platform": "play",
"url": "https://play.google.com/store/apps/details?id=com.example.app1",
"id": "com.example.app1"
}, {
"platform": "itunes",
"url": "https://itunes.apple.com/app/example-app1/id123456789",
}, {
"platform": "web"
}]
}
+22
View File
@@ -0,0 +1,22 @@
{
"name": "Name for App and Splash Screen",
"short_name": "Short name for Icon and Task",
"icons": [{
"src": "icon-144x144.png",
"sizes": "144x144",
"type": "image/png"
}, {
"src": "icon-192x192.png",
"sizes": "192x192",
"type": "image/png"
}, {
"src": "icon-512x512.png",
"sizes": "512x512",
"type": "image/png"
}],
"start_url": "./?utm_source=web_app_manifest",
"display": "standalone",
"orientation": "natural",
"background_color": "#FFFFFF",
"theme_color": "#3F51B5"
}
+90
View File
@@ -0,0 +1,90 @@
'use strict';
const path = require('path');
const oassign = require('object-assign');
const writeJSON = require('write-json-file');
const loadJSON = require('load-json-file');
const readPkgUp = require('read-pkg-up');
const isCssColorHex = require('is-css-color-hex');
const isCssColorName = require('is-css-color-name');
function validate(vals, pkg) {
const presets = {
dir: ['ltr', 'rtl', 'auto'],
icons: ['72', '96', '128', '144', '152', '192', '384', '512'],
display: ['fullscreen', 'standalone', 'minimal-ui', 'browser'],
orientation: [
'any', 'natural', 'landscape', 'landscape-primary',
'landscape-secondary', 'portrait', 'portrait-primary',
'portrait-secondary'
]
};
const err = m => new Error(m + ' has an invalid value: ' + vals[m]);
const hasPreset = (m, v) => presets[m].indexOf(v) >= 0;
const isCssColorVal = v => isCssColorHex(v) || isCssColorName(v);
const shortize = name => name.slice(0, 12);
if (vals.display && !hasPreset('display', vals.display)) {
throw err('display');
}
if (vals.orientation && !hasPreset('orientation', vals.orientation)) {
throw err('orientation');
}
if (!vals.name && pkg && pkg.name) {
vals.name = pkg.name;
vals.short_name = pkg.name;
}
if (vals.short_name) {
vals.short_name = shortize(vals.short_name);
}
if (vals.background_color && !isCssColorVal(vals.background_color)) {
throw err('background_color');
}
if (vals.theme_color && !isCssColorVal(vals.theme_color)) {
throw err('theme_color');
}
if (vals.dir && !hasPreset('dir', vals.dir)) {
throw err('dir');
}
return vals;
}
function manifestDir(dir) {
return path.join(dir, 'manifest.json');
}
module.exports = function (opts) {
opts = oassign({}, opts);
return readPkgUp({}).then(res => {
opts = validate(opts, res.pkg);
})
.then(() => loadJSON(path.join(__dirname, './assets/manifest.json')))
.then(manifest => {
oassign(manifest, opts);
return manifest;
});
};
module.exports.write = function (dir, manifest) {
return writeJSON(manifestDir(dir), manifest);
};
module.exports.write.sync = function (dir, manifest) {
return writeJSON.sync(manifestDir(dir), manifest);
};
module.exports.read = function (dir) {
return loadJSON(manifestDir(dir));
};
module.exports.read.sync = function (dir) {
return loadJSON.sync(manifestDir(dir));
};
+21
View File
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) ragingwind <ragingwind@gmail.com> (ragingwind.html)
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.
+102
View File
@@ -0,0 +1,102 @@
'use strict';
const x = module.exports;
const ESC = '\u001B[';
const isTerminalApp = process.env.TERM_PROGRAM === 'Apple_Terminal';
x.cursorTo = (x, y) => {
if (typeof x !== 'number') {
throw new TypeError('The `x` argument is required');
}
if (typeof y !== 'number') {
return ESC + (x + 1) + 'G';
}
return ESC + (y + 1) + ';' + (x + 1) + 'H';
};
x.cursorMove = (x, y) => {
if (typeof x !== 'number') {
throw new TypeError('The `x` argument is required');
}
let ret = '';
if (x < 0) {
ret += ESC + (-x) + 'D';
} else if (x > 0) {
ret += ESC + x + 'C';
}
if (y < 0) {
ret += ESC + (-y) + 'A';
} else if (y > 0) {
ret += ESC + y + 'B';
}
return ret;
};
x.cursorUp = count => ESC + (typeof count === 'number' ? count : 1) + 'A';
x.cursorDown = count => ESC + (typeof count === 'number' ? count : 1) + 'B';
x.cursorForward = count => ESC + (typeof count === 'number' ? count : 1) + 'C';
x.cursorBackward = count => ESC + (typeof count === 'number' ? count : 1) + 'D';
x.cursorLeft = ESC + 'G';
x.cursorSavePosition = ESC + (isTerminalApp ? '7' : 's');
x.cursorRestorePosition = ESC + (isTerminalApp ? '8' : 'u');
x.cursorGetPosition = ESC + '6n';
x.cursorNextLine = ESC + 'E';
x.cursorPrevLine = ESC + 'F';
x.cursorHide = ESC + '?25l';
x.cursorShow = ESC + '?25h';
x.eraseLines = count => {
let clear = '';
for (let i = 0; i < count; i++) {
clear += x.eraseLine + (i < count - 1 ? x.cursorUp() : '');
}
if (count) {
clear += x.cursorLeft;
}
return clear;
};
x.eraseEndLine = ESC + 'K';
x.eraseStartLine = ESC + '1K';
x.eraseLine = ESC + '2K';
x.eraseDown = ESC + 'J';
x.eraseUp = ESC + '1J';
x.eraseScreen = ESC + '2J';
x.scrollUp = ESC + 'S';
x.scrollDown = ESC + 'T';
x.clearScreen = '\u001Bc';
x.beep = '\u0007';
x.image = (buf, opts) => {
opts = opts || {};
let ret = '\u001B]1337;File=inline=1';
if (opts.width) {
ret += `;width=${opts.width}`;
}
if (opts.height) {
ret += `;height=${opts.height}`;
}
if (opts.preserveAspectRatio === false) {
ret += ';preserveAspectRatio=0';
}
return ret + ':' + buf.toString('base64') + '\u0007';
};
x.iTerm = {};
x.iTerm.setCwd = cwd => '\u001B]50;CurrentDir=' + (cwd || process.cwd()) + '\u0007';
+9
View File
@@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
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.
@@ -0,0 +1,82 @@
{
"_from": "ansi-escapes@^3.0.0",
"_id": "ansi-escapes@3.0.0",
"_inBundle": false,
"_integrity": "sha512-O/klc27mWNUigtv0F8NJWbLF00OcegQalkqKURWdosW08YZKi4m6CnSUSvIZG1otNJbTWhN01Hhz389DW7mvDQ==",
"_location": "/@pwa/manifest/ansi-escapes",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "ansi-escapes@^3.0.0",
"name": "ansi-escapes",
"escapedName": "ansi-escapes",
"rawSpec": "^3.0.0",
"saveSpec": null,
"fetchSpec": "^3.0.0"
},
"_requiredBy": [
"/@pwa/manifest/inquirer"
],
"_resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.0.0.tgz",
"_shasum": "ec3e8b4e9f8064fc02c3ac9b65f1c275bda8ef92",
"_spec": "ansi-escapes@^3.0.0",
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build/node_modules/@pwa/manifest/node_modules/inquirer",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/ansi-escapes/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "ANSI escape codes for manipulating the terminal",
"devDependencies": {
"ava": "*",
"xo": "*"
},
"engines": {
"node": ">=4"
},
"files": [
"index.js"
],
"homepage": "https://github.com/sindresorhus/ansi-escapes#readme",
"keywords": [
"ansi",
"terminal",
"console",
"cli",
"string",
"tty",
"escape",
"escapes",
"formatting",
"shell",
"xterm",
"log",
"logging",
"command-line",
"text",
"vt100",
"sequence",
"control",
"code",
"codes",
"cursor",
"iterm",
"iterm2"
],
"license": "MIT",
"name": "ansi-escapes",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/ansi-escapes.git"
},
"scripts": {
"test": "xo && ava"
},
"version": "3.0.0"
}
+174
View File
@@ -0,0 +1,174 @@
# ansi-escapes [![Build Status](https://travis-ci.org/sindresorhus/ansi-escapes.svg?branch=master)](https://travis-ci.org/sindresorhus/ansi-escapes)
> [ANSI escape codes](http://www.termsys.demon.co.uk/vtansi.htm) for manipulating the terminal
## Install
```
$ npm install ansi-escapes
```
## Usage
```js
const ansiEscapes = require('ansi-escapes');
// Moves the cursor two rows up and to the left
process.stdout.write(ansiEscapes.cursorUp(2) + ansiEscapes.cursorLeft);
//=> '\u001B[2A\u001B[1000D'
```
## API
### cursorTo(x, [y])
Set the absolute position of the cursor. `x0` `y0` is the top left of the screen.
### cursorMove(x, [y])
Set the position of the cursor relative to its current position.
### cursorUp(count)
Move cursor up a specific amount of rows. Default is `1`.
### cursorDown(count)
Move cursor down a specific amount of rows. Default is `1`.
### cursorForward(count)
Move cursor forward a specific amount of rows. Default is `1`.
### cursorBackward(count)
Move cursor backward a specific amount of rows. Default is `1`.
### cursorLeft
Move cursor to the left side.
### cursorSavePosition
Save cursor position.
### cursorRestorePosition
Restore saved cursor position.
### cursorGetPosition
Get cursor position.
### cursorNextLine
Move cursor to the next line.
### cursorPrevLine
Move cursor to the previous line.
### cursorHide
Hide cursor.
### cursorShow
Show cursor.
### eraseLines(count)
Erase from the current cursor position up the specified amount of rows.
### eraseEndLine
Erase from the current cursor position to the end of the current line.
### eraseStartLine
Erase from the current cursor position to the start of the current line.
### eraseLine
Erase the entire current line.
### eraseDown
Erase the screen from the current line down to the bottom of the screen.
### eraseUp
Erase the screen from the current line up to the top of the screen.
### eraseScreen
Erase the screen and move the cursor the top left position.
### scrollUp
Scroll display up one line.
### scrollDown
Scroll display down one line.
### clearScreen
Clear the terminal screen.
### beep
Output a beeping sound.
### image(input, [options])
Display an image.
*Currently only supported on iTerm2 >=3*
See [term-img](https://github.com/sindresorhus/term-img) for a higher-level module.
#### input
Type: `Buffer`
Buffer of an image. Usually read in with `fs.readFile()`.
#### options
##### width
##### height
Type: `string` `number`
The width and height are given as a number followed by a unit, or the word "auto".
- `N`: N character cells.
- `Npx`: N pixels.
- `N%`: N percent of the session's width or height.
- `auto`: The image's inherent size will be used to determine an appropriate dimension.
##### preserveAspectRatio
Type: `boolean`<br>
Default: `true`
### iTerm.setCwd([path])
Type: `string`<br>
Default: `process.cwd()`
[Inform iTerm2](https://www.iterm2.com/documentation-escape-codes.html) of the current directory to help semantic history and enable [Cmd-clicking relative paths](https://coderwall.com/p/b7e82q/quickly-open-files-in-iterm-with-cmd-click).
## Related
- [ansi-styles](https://github.com/chalk/ansi-styles) - ANSI escape codes for styling strings in the terminal
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)
+10
View File
@@ -0,0 +1,10 @@
'use strict';
module.exports = () => {
const pattern = [
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)',
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))'
].join('|');
return new RegExp(pattern, 'g');
};
+9
View File
@@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
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.
+85
View File
@@ -0,0 +1,85 @@
{
"_from": "ansi-regex@^3.0.0",
"_id": "ansi-regex@3.0.0",
"_inBundle": false,
"_integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
"_location": "/@pwa/manifest/ansi-regex",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "ansi-regex@^3.0.0",
"name": "ansi-regex",
"escapedName": "ansi-regex",
"rawSpec": "^3.0.0",
"saveSpec": null,
"fetchSpec": "^3.0.0"
},
"_requiredBy": [
"/@pwa/manifest/strip-ansi"
],
"_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
"_shasum": "ed0317c322064f79466c02966bddb605ab37d998",
"_spec": "ansi-regex@^3.0.0",
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build/node_modules/@pwa/manifest/node_modules/strip-ansi",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/chalk/ansi-regex/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Regular expression for matching ANSI escape codes",
"devDependencies": {
"ava": "*",
"xo": "*"
},
"engines": {
"node": ">=4"
},
"files": [
"index.js"
],
"homepage": "https://github.com/chalk/ansi-regex#readme",
"keywords": [
"ansi",
"styles",
"color",
"colour",
"colors",
"terminal",
"console",
"cli",
"string",
"tty",
"escape",
"formatting",
"rgb",
"256",
"shell",
"xterm",
"command-line",
"text",
"regex",
"regexp",
"re",
"match",
"test",
"find",
"pattern"
],
"license": "MIT",
"name": "ansi-regex",
"repository": {
"type": "git",
"url": "git+https://github.com/chalk/ansi-regex.git"
},
"scripts": {
"test": "xo && ava",
"view-supported": "node fixtures/view-codes.js"
},
"version": "3.0.0"
}

Some files were not shown because too many files have changed in this diff Show More