Skip to content

Commit

Permalink
[npm publish] - npm publish 2018.4.30
Browse files Browse the repository at this point in the history
- update build
  • Loading branch information
kaizhu256 committed May 3, 2018
1 parent a279aa4 commit 268047b
Show file tree
Hide file tree
Showing 5 changed files with 246 additions and 121 deletions.
24 changes: 12 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@ before_install:
# init xvfb
# http://docs.travis-ci.com/user/gui-and-headless-browsers/
- export DISPLAY=:99.0 && sh -e /etc/init.d/xvfb start
# override $NODE_VERSION
- CI_COMMIT_MESSAGE="$(git log -1 --pretty=%s)" && if (printf "$CI_COMMIT_MESSAGE" | grep -qE "\bNODE_VERSION="); then nvm install "$(printf "$CI_COMMIT_MESSAGE" | sed -e "s/.*\bNODE_VERSION=//" -e "s/ .*//")" && node --version && npm --version; fi
branches:
only:
- alpha
- beta
- cron
- docker.base
- docker.electron
- docker.latest
- docker.tmp
- master
- publish
- task
- /^alpha$/
- /^beta$/
- /^benchmark\..*/
- /^cron$/
- /^docker\..*/
- /^master$/
- /^publish$/
- /^task$/
env:
global:
# this value is auto-created by shTravisCryptoAesEncryptYml
- secure: MbaHofupJXRYmcIUjgP+ZGrlO2UyRSpY5gZUO5k5gCMzKe8RvwXx9KO4jTbJF7n6LLpiSVnWJquTQYU1m2ed7H0WshU81tFPeiODifAY/yt9Or5b0r+Z7Esc2AJ9xzNwMPH5S7Z7Zmxa+aW7k0FplgpGWgAOeGWNinX/erRaio0= # CRYPTO_AES_KEY
language:
- node_js
node_js:
- 6
# - node
# - 8
- node
script:
- npm run build-ci
services:
Expand Down
130 changes: 94 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,9 @@ this zero-dependency package will provide browser-compatible versions of jslint
#### todo
- none

#### changelog for v2018.3.31
- npm publish v2018.3.31
- update function jslintUtility2 to validate tag.classList is sorted
- update macro /* jslint-utility2 */ with rules non-4-space indent, and trailing-whitespace
- add function csslintUtility2 and macro /* jslint-utility2 */
- add function jslintUtility2 and macro /* jslint-utility2 */
- add function shlintUtility2 and macro # jslint-utility2
- update function jslintAndPrint with trailing-whitespace linter
- remove little-used macro /* jslint-indent-begin xxx */ ... /* jslint-indent-end */
#### changelog 2018.4.30
- npm publish 2018.4.30
- update build
- none

#### this package requires
Expand Down Expand Up @@ -284,11 +278,40 @@ instruction
// init exports
module.exports = local;
// require builtins
Object.keys(process.binding('natives')).forEach(function (key) {
if (!local[key] && !(/\/|^_|^assert|^sys$/).test(key)) {
local[key] = require(key);
}
});
// local.assert = require('assert');
local.buffer = require('buffer');
local.child_process = require('child_process');
local.cluster = require('cluster');
local.console = require('console');
local.constants = require('constants');
local.crypto = require('crypto');
local.dgram = require('dgram');
local.dns = require('dns');
local.domain = require('domain');
local.events = require('events');
local.fs = require('fs');
local.http = require('http');
local.https = require('https');
local.module = require('module');
local.net = require('net');
local.os = require('os');
local.path = require('path');
local.process = require('process');
local.punycode = require('punycode');
local.querystring = require('querystring');
local.readline = require('readline');
local.repl = require('repl');
local.stream = require('stream');
local.string_decoder = require('string_decoder');
local.timers = require('timers');
local.tls = require('tls');
local.tty = require('tty');
local.url = require('url');
local.util = require('util');
local.v8 = require('v8');
local.vm = require('vm');
local.zlib = require('zlib');
/* validateLineSortedReset */
// init assets
local.assetsDict = local.assetsDict || {};
/* jslint-ignore-begin */
Expand All @@ -298,8 +321,8 @@ instruction
<head>\n\
<meta charset="UTF-8">\n\
<meta name="viewport" content="width=device-width, initial-scale=1">\n\
<!-- "assets.index.default.template.html" -->\n\
<title>{{env.npm_package_name}} (v{{env.npm_package_version}})</title>\n\
<!-- "assets.utility2.template.html" -->\n\
<title>{{env.npm_package_name}} ({{env.npm_package_version}})</title>\n\
<style>\n\
/* jslint-utility2 */\n\
/*csslint\n\
Expand Down Expand Up @@ -333,6 +356,11 @@ instruction
a {\n\
overflow-wrap: break-word;\n\
}\n\
body {\n\
background: #eef;\n\
font-family: Arial, Helvetica, sans-serif;\n\
margin: 0 40px;\n\
}\n\
body > div,\n\
body > pre,\n\
body > textarea,\n\
Expand Down Expand Up @@ -406,10 +434,10 @@ textarea {\n\
}\n\
</style>\n\
</head>\n\
<body style="background: #eef; font-family: Arial, Helvetica, sans-serif; margin: 0 40px;">\n\
<body>\n\
<div id="ajaxProgressDiv1" style="background: #d00; height: 2px; left: 0; margin: 0; padding: 0; position: fixed; top: 0; transition: background 500ms, width 1500ms; width: 0%; z-index: 1;"></div>\n\
<div class="uiAnimateSpin" style="animation: uiAnimateSpin 2s linear infinite; border: 5px solid #999; border-radius: 50%; border-top: 5px solid #7d7; display: none; height: 25px; vertical-align: middle; width: 25px;"></div>\n\
<code style="display: none;"></code><div class="button uiAnimateShake uiAnimateSlide utility2FooterDiv zeroPixel" style="display: none;"></div><pre style="display: none;"></pre><textarea readonly style="display: none;"></textarea>\n\
<code style="display: none;"></code><div class="button colorError uiAnimateShake uiAnimateSlide utility2FooterDiv zeroPixel" style="display: none;"></div><pre style="display: none;"></pre><textarea readonly style="display: none;"></textarea>\n\
<script>\n\
/* jslint-utility2 */\n\
/*jslint\n\
Expand All @@ -422,12 +450,18 @@ textarea {\n\
regexp: true,\n\
stupid: true\n\
*/\n\
// init timerIntervalAjaxProgressUpdate\n\
(function () {\n\
/*\n\
* this function will increment the ajax-progress-bar until the webpage has loaded\n\
*/\n\
"use strict";\n\
var ajaxProgressDiv1,\n\
ajaxProgressState,\n\
ajaxProgressUpdate,\n\
timerIntervalAjaxProgressUpdate;\n\
ajaxProgressUpdate;\n\
if (window.timerIntervalAjaxProgressUpdate) {\n\
return;\n\
}\n\
ajaxProgressDiv1 = document.querySelector("#ajaxProgressDiv1");\n\
setTimeout(function () {\n\
ajaxProgressDiv1.style.width = "25%";\n\
Expand All @@ -443,18 +477,44 @@ textarea {\n\
}, 500);\n\
}, 1500);\n\
};\n\
timerIntervalAjaxProgressUpdate = setInterval(function () {\n\
window.timerIntervalAjaxProgressUpdate = setInterval(function () {\n\
ajaxProgressState += 1;\n\
ajaxProgressDiv1.style.width = Math.max(\n\
100 - 75 * Math.exp(-0.125 * ajaxProgressState),\n\
Number(ajaxProgressDiv1.style.width.slice(0, -1)) || 0\n\
) + "%";\n\
}, 1000);\n\
window.addEventListener("load", function () {\n\
clearInterval(timerIntervalAjaxProgressUpdate);\n\
clearInterval(window.timerIntervalAjaxProgressUpdate);\n\
ajaxProgressUpdate();\n\
});\n\
}());\n\
// init domOnEventSelectAllInsidePre\n\
(function () {\n\
/*\n\
* this function will limit select-all from growing outside a <pre tabIndex="0"> element\n\
* https://stackoverflow.com/questions/985272/selecting-text-in-an-element-akin-to-highlighting-with-your-mouse\n\
*/\n\
"use strict";\n\
if (window.domOnEventSelectAllInsidePre) {\n\
return;\n\
}\n\
window.domOnEventSelectAllInsidePre = function (event) {\n\
var range, selection;\n\
if (event &&\n\
event.code === "KeyA" &&\n\
(event.ctrlKey || event.metaKey) &&\n\
event.target.closest("pre")) {\n\
range = document.createRange();\n\
range.selectNodeContents(event.target.closest("pre"));\n\
selection = window.getSelection();\n\
selection.removeAllRanges();\n\
selection.addRange(range);\n\
event.preventDefault();\n\
}\n\
};\n\
document.addEventListener("keydown", window.domOnEventSelectAllInsidePre);\n\
}());\n\
</script>\n\
<h1>\n\
<!-- utility2-comment\n\
Expand All @@ -465,7 +525,7 @@ textarea {\n\
target="_blank"\n\
>\n\
utility2-comment -->\n\
{{env.npm_package_name}} (v{{env.npm_package_version}})\n\
{{env.npm_package_name}} ({{env.npm_package_version}})\n\
<!-- utility2-comment\n\
</a>\n\
utility2-comment -->\n\
Expand Down Expand Up @@ -549,6 +609,12 @@ utility2-comment -->\n\
);
}
});
/* validateLineSortedReset */
// bug-workaround - long $npm_package_buildCustomOrg
/* jslint-ignore-begin */
local.assetsDict['/assets.jslint.js'] = local.assetsDict['/assets.jslint.js'] ||
local.fs.readFileSync(local.__dirname + '/lib.jslint.js', 'utf8'
).replace((/^#!/), '//');
/* validateLineSortedReset */
local.assetsDict['/'] =
local.assetsDict['/assets.example.html'] =
Expand All @@ -574,14 +640,6 @@ utility2-comment -->\n\
local.assetsDict['/assets.example.js'] =
local.assetsDict['/assets.example.js'] ||
local.fs.readFileSync(__filename, 'utf8');
// bug-workaround - long $npm_package_buildCustomOrg
/* jslint-ignore-begin */
local.assetsDict['/assets.jslint.js'] =
local.assetsDict['/assets.jslint.js'] ||
local.fs.readFileSync(
local.__dirname + '/lib.jslint.js',
'utf8'
).replace((/^#!/), '//');
/* jslint-ignore-end */
local.assetsDict['/favicon.ico'] = local.assetsDict['/favicon.ico'] || '';
// if $npm_config_timeout_exit exists,
Expand Down Expand Up @@ -695,12 +753,12 @@ utility2-comment -->\n\
"apidocRawFetch": "[ ! -f npm_scripts.sh ] || ./npm_scripts.sh shNpmScriptApidocRawFetch",
"build-ci": "utility2 shReadmeTest build_ci.sh",
"env": "env",
"heroku-postbuild": "npm uninstall utility2 2>/dev/null; npm install kaizhu256/node-utility2#alpha && utility2 shDeployHeroku",
"heroku-postbuild": "npm install kaizhu256/node-utility2#alpha --prefix . && utility2 shDeployHeroku",
"postinstall": "[ ! -f npm_scripts.sh ] || ./npm_scripts.sh shNpmScriptPostinstall",
"start": "PORT=${PORT:-8080} utility2 start test.js",
"test": "PORT=$(utility2 shServerPortRandom) utility2 test test.js"
},
"version": "2018.3.31"
"version": "2018.4.30"
}
```

Expand All @@ -718,20 +776,20 @@ utility2-comment -->\n\

# this shell script will run the build for this package

shBuildCiAfter() {(set -e
shBuildCiAfter () {(set -e
# shDeployCustom
shDeployGithub
shDeployHeroku
shReadmeTest example.sh
)}

shBuildCiBefore() {(set -e
shBuildCiBefore () {(set -e
shNpmTestPublished
shReadmeTest example.js
)}

# run shBuildCi
eval $(utility2 source)
eval "$(utility2 source)"
shBuildCi
```

Expand Down
Loading

0 comments on commit 268047b

Please sign in to comment.