author
int64 4.98k
943k
| date
stringdate 2017-04-15 16:45:02
2022-02-25 15:32:15
| timezone
int64 -46,800
39.6k
| hash
stringlengths 40
40
| message
stringlengths 8
468
| mods
listlengths 1
16
| language
stringclasses 9
values | license
stringclasses 2
values | repo
stringclasses 119
values | original_message
stringlengths 12
491
| is_CCS
int64 1
1
| commit_type
stringclasses 129
values | commit_scope
stringlengths 1
44
⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
679,913
|
27.02.2018 14:34:18
| 0
|
8a070ff278067fc4cd3c008e1dcbb7744f4e4497
|
feat(hiccup-dom): start(), add optional spans arg
|
[
{
"change_type": "MODIFY",
"diff": "import { isString } from \"@thi.ng/checks/is-string\";\n-import { diffElement, normalizeTree } from \"./diff\";\n+import { diffElement } from \"./diff\";\n+import { normalizeTree } from \"./normalize\";\n/**\n* Takes a parent DOM element (or ID) and hiccup tree\n@@ -10,15 +11,17 @@ import { diffElement, normalizeTree } from \"./diff\";\n* Important: The parent element given is assumed to have NO\n* children at the time when `start()` is called. Since\n* hiccup-dom does NOT track the real DOM, the resulting\n- * changes will result in potentially undefined behavior.\n+ * changes will result in potentially undefined behavior\n+ * if the parent element wasn't empty.\n*\n* Returns a function, which when called, immediately\n* cancels the update loop.\n*\n- * @param parent\n- * @param tree\n+ * @param parent root element or ID\n+ * @param tree hiccup DOM tree\n+ * @param spans true (default), if text should be wrapped in `<span>`\n*/\n-export function start(parent: Element | string, tree: any) {\n+export function start(parent: Element | string, tree: any, spans = true) {\nlet prev = [];\nlet isActive = true;\nparent = isString(parent) ?\n@@ -26,7 +29,7 @@ export function start(parent: Element | string, tree: any) {\nparent;\nfunction update() {\nif (isActive) {\n- diffElement(<any>parent, prev, prev = normalizeTree(tree));\n+ diffElement(<Element>parent, prev, prev = normalizeTree(tree, [0], true, spans));\n// check again in case one of the components called cancel\nisActive && requestAnimationFrame(update);\n}\n",
"new_path": "packages/hiccup-dom/src/start.ts",
"old_path": "packages/hiccup-dom/src/start.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(hiccup-dom): start(), add optional spans arg
| 1
|
feat
|
hiccup-dom
|
807,849
|
27.02.2018 14:47:16
| 28,800
|
9d0ae4870205635a193d8b5e5e3dd78b361be374
|
chore(appveyor): set PATH before install, shallow_clone: true
|
[
{
"change_type": "MODIFY",
"diff": "# don't build tags, it's redundant\nskip_tags: true\n-clone_depth: 1\n+shallow_clone: true\nenvironment:\nNO_UPDATE_NOTIFIER: \"1\"\n@@ -19,8 +19,9 @@ cache:\ninstall:\n- ps: Install-Product node $env:nodejs_version\n- npm config set loglevel warn\n- - IF %nodejs_version% EQU 6 npm -g install npm@latest-5\n- - npm i --prefer-offline\n+ - npm install --global npm@latest\n+ - set PATH=%APPDATA%\\npm;%PATH%\n+ - npm install --prefer-offline\nbefore_test:\n- git config --global user.email test@example.com\n",
"new_path": "appveyor.yml",
"old_path": "appveyor.yml"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
chore(appveyor): set PATH before install, shallow_clone: true
| 1
|
chore
|
appveyor
|
807,849
|
27.02.2018 14:48:21
| 28,800
|
0d362b9581cd36137887d9241000e3cce27a4167
|
chore(travis): always install latest npm, use full command names
|
[
{
"change_type": "MODIFY",
"diff": "@@ -23,10 +23,9 @@ cache:\nbefore_install:\n- npm config set loglevel warn\n- - if [[ `node -v` == v6* ]]; then npm i -g npm@latest-5; fi\n- - if [[ `npm -v` != `npm v npm dist-tags.latest-5` ]]; then npm i -g npm@latest-5; fi\n+ - npm install --global npm@latest\n-install: npm i --prefer-offline\n+install: npm install --prefer-offline\nbefore_script:\n- git config --global user.email test@example.com\n",
"new_path": ".travis.yml",
"old_path": ".travis.yml"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
chore(travis): always install latest npm, use full command names
| 1
|
chore
|
travis
|
679,913
|
27.02.2018 15:14:42
| 0
|
4a8feffce5ef7488351173c0c1c160eceb4dae6c
|
docs(hiccup-dom): fix update readme
|
[
{
"change_type": "MODIFY",
"diff": "@@ -78,6 +78,10 @@ If you're interested in using this, please also consider the\npackages to integrate app state handling, event streams & reactive value\nsubscriptions. More examples are forthcoming...\n+## Status\n+\n+This project is currently still in BETA. The overall \"API\" is stable, but there's still further work planned on optimization and generalization beyond the standard browser DOM use cases (see #4). Furthermore, the project has been used for several projects in production since 2016.\n+\n## Installation\n```\n",
"new_path": "packages/hiccup-dom/README.md",
"old_path": "packages/hiccup-dom/README.md"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs(hiccup-dom): fix #7, update readme
| 1
|
docs
|
hiccup-dom
|
807,849
|
27.02.2018 15:19:49
| 28,800
|
d86f768ea1eff781a97e0a9c2cfbd9ffe4bb08ba
|
chore: bump conventional-changelog-*
|
[
{
"change_type": "MODIFY",
"diff": "\"dev\": true\n},\n\"camelcase\": {\n- \"version\": \"2.1.1\",\n- \"resolved\": \"https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz\",\n- \"integrity\": \"sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=\"\n+ \"version\": \"4.1.0\",\n+ \"resolved\": \"https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz\",\n+ \"integrity\": \"sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=\"\n},\n\"camelcase-keys\": {\n- \"version\": \"2.1.0\",\n- \"resolved\": \"https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz\",\n- \"integrity\": \"sha1-MIvur/3ygRkFHvodkyITyRuPkuc=\",\n+ \"version\": \"4.2.0\",\n+ \"resolved\": \"https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz\",\n+ \"integrity\": \"sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=\",\n\"requires\": {\n- \"camelcase\": \"2.1.1\",\n- \"map-obj\": \"1.0.1\"\n+ \"camelcase\": \"4.1.0\",\n+ \"map-obj\": \"2.0.0\",\n+ \"quick-lru\": \"1.1.0\"\n}\n},\n\"capture-stack-trace\": {\n\"dev\": true\n},\n\"conventional-changelog-angular\": {\n- \"version\": \"1.6.4\",\n- \"resolved\": \"https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-1.6.4.tgz\",\n- \"integrity\": \"sha512-CGtgqRBYOYYwP/FGBZ+NydolVv0+9bFcQZYMqw8YPKms1n6QlKguaqO0bfBLRChWZjDXjTI3Spd/bNineVtAqA==\",\n+ \"version\": \"1.6.6\",\n+ \"resolved\": \"https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-1.6.6.tgz\",\n+ \"integrity\": \"sha512-suQnFSqCxRwyBxY68pYTsFkG0taIdinHLNEAX5ivtw8bCRnIgnpvcHmlR/yjUyZIrNPYAoXlY1WiEKWgSE4BNg==\",\n\"requires\": {\n\"compare-func\": \"1.3.2\",\n\"q\": \"1.5.1\"\n}\n},\n\"conventional-changelog-core\": {\n- \"version\": \"2.0.3\",\n- \"resolved\": \"https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-2.0.3.tgz\",\n- \"integrity\": \"sha512-yLnwThgG5M7k4ZuG87sWXQBEQPTijcB4TpUrSzJcH6Jk7vkZR4ej7GJgY5TqKKiVwALWzyAGd6GenzGbNZvYnw==\",\n+ \"version\": \"2.0.5\",\n+ \"resolved\": \"https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-2.0.5.tgz\",\n+ \"integrity\": \"sha512-lP1s7Z3NyEFcG78bWy7GG7nXsq9OpAJgo2xbyAlVBDweLSL5ghvyEZlkEamnAQpIUVK0CAVhs8nPvCiQuXT/VA==\",\n\"requires\": {\n- \"conventional-changelog-writer\": \"3.0.2\",\n- \"conventional-commits-parser\": \"2.1.3\",\n- \"dateformat\": \"1.0.12\",\n+ \"conventional-changelog-writer\": \"3.0.4\",\n+ \"conventional-commits-parser\": \"2.1.5\",\n+ \"dateformat\": \"3.0.3\",\n\"get-pkg-repo\": \"1.4.0\",\n- \"git-raw-commits\": \"1.3.2\",\n+ \"git-raw-commits\": \"1.3.4\",\n\"git-remote-origin-url\": \"2.0.0\",\n- \"git-semver-tags\": \"1.3.2\",\n+ \"git-semver-tags\": \"1.3.4\",\n\"lodash\": \"4.17.5\",\n\"normalize-package-data\": \"2.4.0\",\n\"q\": \"1.5.1\",\n}\n},\n\"conventional-changelog-preset-loader\": {\n- \"version\": \"1.1.4\",\n- \"resolved\": \"https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-1.1.4.tgz\",\n- \"integrity\": \"sha512-KY9sGPKnKlW542FpNN4++GkijXnND69/MgMa6EDibnyYXO6gV/NPwQwDTH6MOVVIjhspMgEM69H3yFVHo5Ud5g==\"\n+ \"version\": \"1.1.6\",\n+ \"resolved\": \"https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-1.1.6.tgz\",\n+ \"integrity\": \"sha512-yWPIP9wwsCKeUSPYApnApWhKIDjWRIX/uHejGS1tYfEsQR/bwpDFET7LYiHT+ujNbrlf6h1s3NlPGheOd4yJRQ==\"\n},\n\"conventional-changelog-writer\": {\n- \"version\": \"3.0.2\",\n- \"resolved\": \"https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-3.0.2.tgz\",\n- \"integrity\": \"sha512-eYXmYxT1IUuzzfpQuFA2/t3ex+7rFBbJchDIWyDTAs7OFkPBAfAs3EG04cDkEAG6Tn3wnwrtDKVZL9sMfA3kIw==\",\n+ \"version\": \"3.0.4\",\n+ \"resolved\": \"https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-3.0.4.tgz\",\n+ \"integrity\": \"sha512-EUf/hWiEj3IOa5Jk8XDzM6oS0WgijlYGkUfLc+mDnLH9RwpZqhYIBwgJHWHzEB4My013wx2FhmUu45P6tQrucw==\",\n\"requires\": {\n\"compare-func\": \"1.3.2\",\n- \"conventional-commits-filter\": \"1.1.3\",\n- \"dateformat\": \"1.0.12\",\n+ \"conventional-commits-filter\": \"1.1.5\",\n+ \"dateformat\": \"3.0.3\",\n\"handlebars\": \"4.0.11\",\n\"json-stringify-safe\": \"5.0.1\",\n\"lodash\": \"4.17.5\",\n- \"meow\": \"3.7.0\",\n+ \"meow\": \"4.0.0\",\n\"semver\": \"5.5.0\",\n\"split\": \"1.0.1\",\n\"through2\": \"2.0.3\"\n}\n},\n\"conventional-commits-filter\": {\n- \"version\": \"1.1.3\",\n- \"resolved\": \"https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-1.1.3.tgz\",\n- \"integrity\": \"sha512-kwGGg0xCHR51YIVjtoCTNgx9I1qEMETerTdSK4XsH2OxNLigDn6XKXnPMFZ+gfoUxaqbnpFSJqs4jYVpuJ1XAg==\",\n+ \"version\": \"1.1.5\",\n+ \"resolved\": \"https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-1.1.5.tgz\",\n+ \"integrity\": \"sha512-mj3+WLj8UZE72zO9jocZjx8+W4Bwnx/KHoIz1vb4F8XUXj0XSjp8Y3MFkpRyIpsRiCBX+DkDjxGKF/nfeu7BGw==\",\n\"requires\": {\n\"is-subset\": \"0.1.1\",\n\"modify-values\": \"1.0.0\"\n}\n},\n\"conventional-commits-parser\": {\n- \"version\": \"2.1.3\",\n- \"resolved\": \"https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-2.1.3.tgz\",\n- \"integrity\": \"sha512-j5nXna/snJtrzFtPbDm+9R5UsjteJkXn+cG1kGEi4+4e25U57CZBB6DiUdxOCnM9LOIHeLDBF61e9MtjPsZthw==\",\n+ \"version\": \"2.1.5\",\n+ \"resolved\": \"https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-2.1.5.tgz\",\n+ \"integrity\": \"sha512-jaAP61py+ISMF3/n3yIiIuY5h6mJlucOqawu5mLB1HaQADLvg/y5UB3pT7HSucZJan34lp7+7ylQPfbKEGmxrA==\",\n\"requires\": {\n\"JSONStream\": \"1.3.2\",\n\"is-text-path\": \"1.0.1\",\n\"lodash\": \"4.17.5\",\n- \"meow\": \"3.7.0\",\n+ \"meow\": \"4.0.0\",\n\"split2\": \"2.2.0\",\n\"through2\": \"2.0.3\",\n\"trim-off-newlines\": \"1.0.1\"\n}\n},\n\"conventional-recommended-bump\": {\n- \"version\": \"2.0.4\",\n- \"resolved\": \"https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-2.0.4.tgz\",\n- \"integrity\": \"sha512-GICSJxGywYR7Am6aEerLYS5CZoLvV1IzpOBeCl4v5WFmqyVecKVSOL62NqFuAz9mskSNqjzBjDxNIt3Lagag9g==\",\n+ \"version\": \"2.0.6\",\n+ \"resolved\": \"https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-2.0.6.tgz\",\n+ \"integrity\": \"sha512-deb55+yFNqNjWvIU8Xe6EJZnp09/Q014rmJmGX3VtnIczyb8rD+RhGXpV5Mene6BFrlGuyHRlsn5e6kYXoIyOw==\",\n\"requires\": {\n\"concat-stream\": \"1.6.0\",\n- \"conventional-changelog-preset-loader\": \"1.1.4\",\n- \"conventional-commits-filter\": \"1.1.3\",\n- \"conventional-commits-parser\": \"2.1.3\",\n- \"git-raw-commits\": \"1.3.2\",\n- \"git-semver-tags\": \"1.3.2\",\n- \"meow\": \"3.7.0\",\n+ \"conventional-changelog-preset-loader\": \"1.1.6\",\n+ \"conventional-commits-filter\": \"1.1.5\",\n+ \"conventional-commits-parser\": \"2.1.5\",\n+ \"git-raw-commits\": \"1.3.4\",\n+ \"git-semver-tags\": \"1.3.4\",\n+ \"meow\": \"4.0.0\",\n\"q\": \"1.5.1\"\n}\n},\n}\n},\n\"dateformat\": {\n- \"version\": \"1.0.12\",\n- \"resolved\": \"https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz\",\n- \"integrity\": \"sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk=\",\n- \"requires\": {\n- \"get-stdin\": \"4.0.1\",\n- \"meow\": \"3.7.0\"\n- }\n+ \"version\": \"3.0.3\",\n+ \"resolved\": \"https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz\",\n+ \"integrity\": \"sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==\"\n},\n\"debug\": {\n\"version\": \"3.1.0\",\n\"resolved\": \"https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz\",\n\"integrity\": \"sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=\"\n},\n+ \"decamelize-keys\": {\n+ \"version\": \"1.1.0\",\n+ \"resolved\": \"https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz\",\n+ \"integrity\": \"sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=\",\n+ \"requires\": {\n+ \"decamelize\": \"1.2.0\",\n+ \"map-obj\": \"1.0.1\"\n+ },\n+ \"dependencies\": {\n+ \"map-obj\": {\n+ \"version\": \"1.0.1\",\n+ \"resolved\": \"https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz\",\n+ \"integrity\": \"sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=\"\n+ }\n+ }\n+ },\n\"dedent\": {\n\"version\": \"0.7.0\",\n\"resolved\": \"https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz\",\n\"normalize-package-data\": \"2.4.0\",\n\"parse-github-repo-url\": \"1.4.1\",\n\"through2\": \"2.0.3\"\n+ },\n+ \"dependencies\": {\n+ \"camelcase\": {\n+ \"version\": \"2.1.1\",\n+ \"resolved\": \"https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz\",\n+ \"integrity\": \"sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=\"\n+ },\n+ \"camelcase-keys\": {\n+ \"version\": \"2.1.0\",\n+ \"resolved\": \"https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz\",\n+ \"integrity\": \"sha1-MIvur/3ygRkFHvodkyITyRuPkuc=\",\n+ \"requires\": {\n+ \"camelcase\": \"2.1.1\",\n+ \"map-obj\": \"1.0.1\"\n+ }\n+ },\n+ \"indent-string\": {\n+ \"version\": \"2.1.0\",\n+ \"resolved\": \"https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz\",\n+ \"integrity\": \"sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=\",\n+ \"requires\": {\n+ \"repeating\": \"2.0.1\"\n+ }\n+ },\n+ \"map-obj\": {\n+ \"version\": \"1.0.1\",\n+ \"resolved\": \"https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz\",\n+ \"integrity\": \"sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=\"\n+ },\n+ \"meow\": {\n+ \"version\": \"3.7.0\",\n+ \"resolved\": \"https://registry.npmjs.org/meow/-/meow-3.7.0.tgz\",\n+ \"integrity\": \"sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=\",\n+ \"requires\": {\n+ \"camelcase-keys\": \"2.1.0\",\n+ \"decamelize\": \"1.2.0\",\n+ \"loud-rejection\": \"1.6.0\",\n+ \"map-obj\": \"1.0.1\",\n+ \"minimist\": \"1.2.0\",\n+ \"normalize-package-data\": \"2.4.0\",\n+ \"object-assign\": \"4.1.1\",\n+ \"read-pkg-up\": \"1.0.1\",\n+ \"redent\": \"1.0.0\",\n+ \"trim-newlines\": \"1.0.0\"\n+ }\n+ },\n+ \"minimist\": {\n+ \"version\": \"1.2.0\",\n+ \"resolved\": \"https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz\",\n+ \"integrity\": \"sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=\"\n+ },\n+ \"redent\": {\n+ \"version\": \"1.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/redent/-/redent-1.0.0.tgz\",\n+ \"integrity\": \"sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=\",\n+ \"requires\": {\n+ \"indent-string\": \"2.1.0\",\n+ \"strip-indent\": \"1.0.1\"\n+ }\n+ },\n+ \"strip-indent\": {\n+ \"version\": \"1.0.1\",\n+ \"resolved\": \"https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz\",\n+ \"integrity\": \"sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=\",\n+ \"requires\": {\n+ \"get-stdin\": \"4.0.1\"\n+ }\n+ },\n+ \"trim-newlines\": {\n+ \"version\": \"1.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz\",\n+ \"integrity\": \"sha1-WIeWa7WCpFA6QetST301ARgVphM=\"\n+ }\n}\n},\n\"get-port\": {\n}\n},\n\"git-raw-commits\": {\n- \"version\": \"1.3.2\",\n- \"resolved\": \"https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-1.3.2.tgz\",\n- \"integrity\": \"sha512-ojMbErvEIPXaqNNwomSp/DYLhhbU+BEcCOyPZ26U8VNaQjBRN9lZ7E3vfjIkTA8JLWYc5zsSxuVXut6bczKhrg==\",\n+ \"version\": \"1.3.4\",\n+ \"resolved\": \"https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-1.3.4.tgz\",\n+ \"integrity\": \"sha512-G3O+41xHbscpgL5nA0DUkbFVgaAz5rd57AMSIMew8p7C8SyFwZDyn08MoXHkTl9zcD0LmxsLFPxbqFY4YPbpPA==\",\n\"requires\": {\n\"dargs\": \"4.1.0\",\n\"lodash.template\": \"4.4.0\",\n- \"meow\": \"3.7.0\",\n+ \"meow\": \"4.0.0\",\n\"split2\": \"2.2.0\",\n\"through2\": \"2.0.3\"\n}\n}\n},\n\"git-semver-tags\": {\n- \"version\": \"1.3.2\",\n- \"resolved\": \"https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-1.3.2.tgz\",\n- \"integrity\": \"sha512-CXQJ4GdxkUya1YQaEKGcYIJ9RiuX4RTWnRIhiMlTItl8czRix4akE0CpoUSLmljuxEnUM/pFpd2FFwo+nV0SPA==\",\n+ \"version\": \"1.3.4\",\n+ \"resolved\": \"https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-1.3.4.tgz\",\n+ \"integrity\": \"sha512-Xe2Z74MwXZfAezuaO6e6cA4nsgeCiARPzaBp23gma325c/OXdt//PhrknptIaynNeUp2yWtmikV7k5RIicgGIQ==\",\n\"requires\": {\n- \"meow\": \"3.7.0\",\n+ \"meow\": \"4.0.0\",\n\"semver\": \"5.5.0\"\n}\n},\n\"integrity\": \"sha1-khi5srkoojixPcT7a21XbyMUU+o=\"\n},\n\"indent-string\": {\n- \"version\": \"2.1.0\",\n- \"resolved\": \"https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz\",\n- \"integrity\": \"sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=\",\n- \"requires\": {\n- \"repeating\": \"2.0.1\"\n- }\n+ \"version\": \"3.2.0\",\n+ \"resolved\": \"https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz\",\n+ \"integrity\": \"sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=\"\n},\n\"inflight\": {\n\"version\": \"1.0.6\",\n}\n},\n\"map-obj\": {\n- \"version\": \"1.0.1\",\n- \"resolved\": \"https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz\",\n- \"integrity\": \"sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=\"\n+ \"version\": \"2.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz\",\n+ \"integrity\": \"sha1-plzSkIepJZi4eRJXpSPgISIqwfk=\"\n},\n\"mem\": {\n\"version\": \"1.1.0\",\n}\n},\n\"meow\": {\n- \"version\": \"3.7.0\",\n- \"resolved\": \"https://registry.npmjs.org/meow/-/meow-3.7.0.tgz\",\n- \"integrity\": \"sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=\",\n+ \"version\": \"4.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/meow/-/meow-4.0.0.tgz\",\n+ \"integrity\": \"sha512-Me/kel335m6vMKmEmA6c87Z6DUFW3JqkINRnxkbC+A/PUm0D5Fl2dEBQrPKnqCL9Te/CIa1MUt/0InMJhuC/sw==\",\n\"requires\": {\n- \"camelcase-keys\": \"2.1.0\",\n- \"decamelize\": \"1.2.0\",\n+ \"camelcase-keys\": \"4.2.0\",\n+ \"decamelize-keys\": \"1.1.0\",\n\"loud-rejection\": \"1.6.0\",\n- \"map-obj\": \"1.0.1\",\n\"minimist\": \"1.2.0\",\n+ \"minimist-options\": \"3.0.2\",\n\"normalize-package-data\": \"2.4.0\",\n- \"object-assign\": \"4.1.1\",\n- \"read-pkg-up\": \"1.0.1\",\n- \"redent\": \"1.0.0\",\n- \"trim-newlines\": \"1.0.0\"\n+ \"read-pkg-up\": \"3.0.0\",\n+ \"redent\": \"2.0.0\",\n+ \"trim-newlines\": \"2.0.0\"\n},\n\"dependencies\": {\n\"minimist\": {\n\"version\": \"1.2.0\",\n\"resolved\": \"https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz\",\n\"integrity\": \"sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=\"\n+ },\n+ \"read-pkg-up\": {\n+ \"version\": \"3.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz\",\n+ \"integrity\": \"sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=\",\n+ \"requires\": {\n+ \"find-up\": \"2.1.0\",\n+ \"read-pkg\": \"3.0.0\"\n+ }\n}\n}\n},\n\"resolved\": \"https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz\",\n\"integrity\": \"sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=\"\n},\n+ \"minimist-options\": {\n+ \"version\": \"3.0.2\",\n+ \"resolved\": \"https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz\",\n+ \"integrity\": \"sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==\",\n+ \"requires\": {\n+ \"arrify\": \"1.0.1\",\n+ \"is-plain-obj\": \"1.1.0\"\n+ }\n+ },\n\"mkdirp\": {\n\"version\": \"0.5.1\",\n\"resolved\": \"https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz\",\n\"integrity\": \"sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==\",\n\"dev\": true\n},\n+ \"quick-lru\": {\n+ \"version\": \"1.1.0\",\n+ \"resolved\": \"https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz\",\n+ \"integrity\": \"sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=\"\n+ },\n\"randomatic\": {\n\"version\": \"1.1.7\",\n\"resolved\": \"https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz\",\n}\n},\n\"redent\": {\n- \"version\": \"1.0.0\",\n- \"resolved\": \"https://registry.npmjs.org/redent/-/redent-1.0.0.tgz\",\n- \"integrity\": \"sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=\",\n+ \"version\": \"2.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/redent/-/redent-2.0.0.tgz\",\n+ \"integrity\": \"sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=\",\n\"requires\": {\n- \"indent-string\": \"2.1.0\",\n- \"strip-indent\": \"1.0.1\"\n+ \"indent-string\": \"3.2.0\",\n+ \"strip-indent\": \"2.0.0\"\n}\n},\n\"regenerator-runtime\": {\n\"integrity\": \"sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=\"\n},\n\"strip-indent\": {\n- \"version\": \"1.0.1\",\n- \"resolved\": \"https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz\",\n- \"integrity\": \"sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=\",\n- \"requires\": {\n- \"get-stdin\": \"4.0.1\"\n- }\n+ \"version\": \"2.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz\",\n+ \"integrity\": \"sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=\"\n},\n\"strip-json-comments\": {\n\"version\": \"2.0.1\",\n}\n},\n\"trim-newlines\": {\n- \"version\": \"1.0.0\",\n- \"resolved\": \"https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz\",\n- \"integrity\": \"sha1-WIeWa7WCpFA6QetST301ARgVphM=\"\n+ \"version\": \"2.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz\",\n+ \"integrity\": \"sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=\"\n},\n\"trim-off-newlines\": {\n\"version\": \"1.0.1\",\n",
"new_path": "package-lock.json",
"old_path": "package-lock.json"
},
{
"change_type": "MODIFY",
"diff": "\"cmd-shim\": \"^2.0.2\",\n\"columnify\": \"^1.5.4\",\n\"command-join\": \"^2.0.0\",\n- \"conventional-changelog-angular\": \"^1.6.4\",\n- \"conventional-changelog-core\": \"^2.0.3\",\n- \"conventional-recommended-bump\": \"^2.0.4\",\n+ \"conventional-changelog-angular\": \"^1.6.6\",\n+ \"conventional-changelog-core\": \"^2.0.5\",\n+ \"conventional-recommended-bump\": \"^2.0.6\",\n\"dedent\": \"^0.7.0\",\n\"escape-string-regexp\": \"^1.0.5\",\n\"execa\": \"^0.9.0\",\n",
"new_path": "package.json",
"old_path": "package.json"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
chore: bump conventional-changelog-*
| 1
|
chore
| null |
815,745
|
27.02.2018 18:03:41
| -7,200
|
66a0a8c6883b9ff35760d39ce948b6b5eebef337
|
fix: close dropdown on outside click
fixes fixes
|
[
{
"change_type": "MODIFY",
"diff": "@@ -24,7 +24,9 @@ import { DataService } from '../shared/data.service';\nbindLabel=\"company\"\nplaceholder=\"Select item\"\nappendTo=\"body\"\n- [(ngModel)]=\"selected\">\n+ multiple=\"true\"\n+ [closeOnSelect]=\"false\"\n+ [(ngModel)]=\"selected2\">\n</ng-select>\n</div>\n---\n@@ -46,6 +48,7 @@ export class AppendToComponent implements OnInit {\npeople: any = [];\nselected: any;\n+ selected2: any;\nconstructor(private dataService: DataService) { }\nngOnInit() {\n",
"new_path": "demo/app/examples/append-to.component.ts",
"old_path": "demo/app/examples/append-to.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -10,6 +10,7 @@ import { DataService } from '../shared/data.service';\n<ng-select\n[items]=\"people$1 | async\"\n[multiple]=\"true\"\n+ [closeOnSelect]=\"false\"\nbindLabel=\"name\"\nplaceholder=\"Select people\"\n[(ngModel)]=\"selectedPeople1\">\n",
"new_path": "demo/app/examples/multi.component.ts",
"old_path": "demo/app/examples/multi.component.ts"
},
{
"change_type": "MODIFY",
"diff": "box-sizing: border-box;\nposition: absolute;\nwidth: 100%;\n- z-index: 3;\n+ z-index: 1000;\n-webkit-overflow-scrolling: touch;\n.ng-dropdown-panel-items {\ndisplay: block;\n",
"new_path": "src/ng-select/ng-dropdown-panel.component.scss",
"old_path": "src/ng-select/ng-dropdown-panel.component.scss"
},
{
"change_type": "MODIFY",
"diff": "</span>\n</div>\n+<div class=\"ng-overlay-container\" *ngIf=\"isOpen\">\n+ <div class=\"ng-overlay\" (click)=\"isOpen = false\" ></div>\n+</div>\n+\n<ng-dropdown-panel *ngIf=\"isOpen\"\nclass=\"ng-dropdown-panel\"\n[bufferAmount]=\"bufferAmount\"\n",
"new_path": "src/ng-select/ng-select.component.html",
"old_path": "src/ng-select/ng-select.component.html"
},
{
"change_type": "MODIFY",
"diff": "opacity: 1;\n}\n}\n+ &.opened .ng-control {\n+ z-index: 1001;\n+ }\n&.disabled {\n.ng-control {\n.ng-value-container {\nline-height: 1;\n}\n}\n-\n.ng-spinner-loader {\nborder-radius: 50%;\nwidth: 17px;\nborder-left: 2px solid #424242;\ntransform: translateZ(0);\nanimation: load8 0.8s infinite linear;\n-\n&:after {\nborder-radius: 50%;\nwidth: 17px;\nheight: 17px;\n}\n-\n@-webkit-keyframes load8 {\n0% {\n-webkit-transform: rotate(0deg);\n}\n}\n}\n-\n.ng-arrow-zone {\ncursor: pointer;\nposition: relative;\nposition: relative;\n}\n}\n+ .ng-overlay-container {\n+ pointer-events: none;\n+ top: 0;\n+ left: 0;\n+ height: 100%;\n+ width: 100%;\n+ position: fixed;\n+ z-index: 1000;\n+ .ng-overlay {\n+ top: 0;\n+ bottom: 0;\n+ left: 0;\n+ right: 0;\n+ opacity: 0;\n+ position: absolute;\n+ pointer-events: auto;\n+ z-index: 1000;\n+ }\n+ }\n}\n-\n",
"new_path": "src/ng-select/ng-select.component.scss",
"old_path": "src/ng-select/ng-select.component.scss"
},
{
"change_type": "MODIFY",
"diff": "@@ -720,29 +720,47 @@ describe('NgSelectComponent', function () {\n});\n});\n- describe('Document:click', () => {\n+ describe('Outside click', () => {\nlet fixture: ComponentFixture<NgSelectBasicTestCmp>;\nbeforeEach(() => {\nfixture = createTestingModule(\nNgSelectBasicTestCmp,\n- `<button id=\"close\">close</button>\n- <ng-select id=\"select\" [items]=\"cities\"\n+ ` <ng-select id=\"select\" [items]=\"cities\"\nbindLabel=\"name\"\n+ multiple=\"true\"\n+ [closeOnSelect]=\"false\"\n+ appendTo=\"body\"\n[(ngModel)]=\"selectedCity\">\n</ng-select>`);\n});\nit('close dropdown if opened and clicked outside dropdown container', () => {\n- fixture.componentInstance.select.isOpen = true;\n- document.getElementById('close').click();\n- expect(fixture.componentInstance.select.isOpen).toBe(false);\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\n+ expect(fixture.componentInstance.select.isOpen).toBeTruthy();\n+ fixture.whenStable().then(() => {\n+ (document.querySelector('.ng-overlay') as HTMLElement).click();\n+ expect(fixture.componentInstance.select.isOpen).toBeFalsy();\n+ });\n});\nit('prevent dropdown close if clicked on select', () => {\n- fixture.componentInstance.select.isOpen = true;\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\n+ expect(fixture.componentInstance.select.isOpen).toBeTruthy();\n+ fixture.whenStable().then(() => {\ndocument.getElementById('select').click();\n- expect(fixture.componentInstance.select.isOpen).toBe(true);\n+ expect(fixture.componentInstance.select.isOpen).toBeTruthy();\n+ });\n+ });\n+\n+ it('should not close dropdown when closeOnSelect is false and in body', () => {\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\n+ expect(fixture.componentInstance.select.isOpen).toBeTruthy();\n+ fixture.whenStable().then(() => {\n+ (document.querySelector('.ng-option.marked') as HTMLElement).click();\n+ fixture.detectChanges();\n+ expect(fixture.componentInstance.select.isOpen).toBeTruthy();\n+ });\n});\n});\n",
"new_path": "src/ng-select/ng-select.component.spec.ts",
"old_path": "src/ng-select/ng-select.component.spec.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -4,7 +4,6 @@ import { takeUntil, startWith } from 'rxjs/operators';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport {\nComponent,\n- OnInit,\nOnDestroy,\nOnChanges,\nAfterViewInit,\n@@ -23,7 +22,8 @@ import {\nChangeDetectionStrategy,\nInject,\nSimpleChanges,\n- Renderer2, ContentChildren, QueryList,\n+ ContentChildren,\n+ QueryList,\nInjectionToken\n} from '@angular/core';\n@@ -62,7 +62,7 @@ export type DropdownPosition = 'bottom' | 'top' | 'auto';\n'[class.ng-selected]': 'hasValue'\n}\n})\n-export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, AfterViewInit, ControlValueAccessor {\n+export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, ControlValueAccessor {\n// inputs\n@Input() items: any[] = [];\n@@ -127,7 +127,6 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, AfterVie\nprivate readonly _destroy$ = new Subject<void>();\nprivate _onChange = (_: NgOption) => { };\nprivate _onTouched = () => { };\n- private _disposeDocumentClickListener = () => { };\nclearItem = (item: any) => {\nconst option = this.selectedItems.find(x => x.value === item);\n@@ -136,8 +135,7 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, AfterVie\nconstructor(@Inject(NG_SELECT_DEFAULT_CONFIG) config: NgSelectConfig,\nprivate changeDetectorRef: ChangeDetectorRef,\n- public elementRef: ElementRef,\n- private renderer: Renderer2\n+ public elementRef: ElementRef\n) {\nthis._mergeGlobalConfig(config);\n}\n@@ -166,10 +164,6 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, AfterVie\n}\n}\n- ngOnInit() {\n- this._handleDocumentClick();\n- }\n-\nngAfterViewInit() {\nif (this.ngOptions.length > 0 && this.items.length === 0) {\nthis._setItemsFromNgOptions();\n@@ -177,7 +171,6 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, AfterVie\n}\nngOnDestroy() {\n- this._disposeDocumentClickListener();\nthis._destroy$.next();\nthis._destroy$.complete();\n}\n@@ -466,34 +459,6 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, AfterVie\n});\n}\n- private _handleDocumentClick() {\n- const handler = ($event: any) => {\n- // prevent close if clicked on select\n- if (this.elementRef.nativeElement.contains($event.target)) {\n- return;\n- }\n-\n- // prevent close if clicked on dropdown menu\n- const dropdown = this._getDropdownMenu();\n- if (dropdown && dropdown.contains($event.target)\n- ) {\n- return;\n- }\n-\n- if (this.isFocused) {\n- this.onInputBlur();\n- this.changeDetectorRef.markForCheck();\n- }\n-\n- if (this.isOpen) {\n- this.close();\n- this.changeDetectorRef.markForCheck();\n- }\n- };\n-\n- this._disposeDocumentClickListener = this.renderer.listen('document', 'click', handler);\n- }\n-\nprivate _validateWriteValue(value: any) {\nif (!this._isDefined(value)) {\nreturn;\n@@ -652,13 +617,6 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, AfterVie\n}\n}\n- private _getDropdownMenu() {\n- if (!this.isOpen || !this.dropdownPanel) {\n- return null;\n- }\n- return <HTMLElement>this.elementRef.nativeElement.querySelector('.ng-menu-outer');\n- }\n-\nprivate get _isTypeahead() {\nreturn this.typeahead && this.typeahead.observers.length > 0;\n}\n",
"new_path": "src/ng-select/ng-select.component.ts",
"old_path": "src/ng-select/ng-select.component.ts"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
fix: close dropdown on outside click (#296)
fixes #289, fixes #270
| 1
|
fix
| null |
815,746
|
27.02.2018 18:04:48
| -7,200
|
3d6b035791c791d3e7dc710c5a62f0a42643afee
|
chore(release): 0.23.1
|
[
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"0.23.1\"></a>\n+## [0.23.1](https://github.com/ng-select/ng-select/compare/v0.23.0...v0.23.1) (2018-02-27)\n+\n+\n+### Bug Fixes\n+\n+* close dropdown on outside click ([#296](https://github.com/ng-select/ng-select/issues/296)) ([66a0a8c](https://github.com/ng-select/ng-select/commit/66a0a8c)), closes [#289](https://github.com/ng-select/ng-select/issues/289) [#270](https://github.com/ng-select/ng-select/issues/270)\n+* hide clear button on disable ([#295](https://github.com/ng-select/ng-select/issues/295)) ([a85c53f](https://github.com/ng-select/ng-select/commit/a85c53f))\n+\n+\n+\n<a name=\"0.23.0\"></a>\n# [0.23.0](https://github.com/ng-select/ng-select/compare/v0.22.0...v0.23.0) (2018-02-26)\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@ng-select/ng-select\",\n- \"version\": \"0.23.0\",\n+ \"version\": \"0.23.1\",\n\"description\": \"Angular ng-select - All in One UI Select, Multiselect and Autocomplete\",\n\"author\": \"@ng-select/ng-select\",\n\"license\": \"MIT\",\n",
"new_path": "src/package.json",
"old_path": "src/package.json"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
chore(release): 0.23.1
| 1
|
chore
|
release
|
807,849
|
27.02.2018 18:31:05
| 28,800
|
41d475927dde5fd98711e524ddbdbb5c7f60f82f
|
chore: Update CHANGELOG for v3.0.0-alpha.1
|
[
{
"change_type": "MODIFY",
"diff": "+## v3.0.0-alpha.1 (2018-02-28)\n+\n+#### :boom: Breaking Change\n+\n+* [#1278](https://github.com/lerna/lerna/pull/1278) Add universal hosted git URL support. ([@evocateur](https://github.com/evocateur))\n+* [#1289](https://github.com/lerna/lerna/pull/1289) Convert command lifecycle from callbacks to Promises. ([@evocateur](https://github.com/evocateur))\n+* [#1290](https://github.com/lerna/lerna/pull/1290) Preserve package.json structure during bootstrap mangling. ([@evocateur](https://github.com/evocateur))\n+ Thanks to [@compulim](https://github.com/compulim) for the initial PR!\n+\n+#### :house: Internal\n+\n+* [#1271](https://github.com/lerna/lerna/pull/1271) Split symlink methods out of FileSystemUtilities. ([@evocateur](https://github.com/evocateur), [@compulim](https://github.com/compulim))\n+* Tons of other refactoring afoot! Check out [this diff](https://github.com/lerna/lerna/compare/v3.0.0-alpha.0...v3.0.0-alpha.1).\n+\n+#### Committers: 1\n+\n+* Daniel Stockman ([evocateur](https://github.com/evocateur))\n+\n## v3.0.0-alpha.0 (2018-02-14)\n#### :boom: Breaking Change\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
chore: Update CHANGELOG for v3.0.0-alpha.1
| 1
|
chore
| null |
791,699
|
28.02.2018 04:01:54
| -39,600
|
cb7bcc23bc5cdce32c7d47e977f48099d8e1f758
|
core(response-compression): also check x-original-content-encoding
|
[
{
"change_type": "MODIFY",
"diff": "const Gatherer = require('../gatherer');\nconst gzip = require('zlib').gzip;\n+const compressionHeaders = ['content-encoding', 'x-original-content-encoding'];\nconst compressionTypes = ['gzip', 'br', 'deflate'];\nconst binaryMimeTypes = ['image', 'audio', 'video'];\nconst CHROME_EXTENSION_PROTOCOL = 'chrome-extension:';\n@@ -39,7 +40,7 @@ class ResponseCompression extends Gatherer {\n}\nconst isContentEncoded = record.responseHeaders.find(header =>\n- header.name.toLowerCase() === 'content-encoding' &&\n+ compressionHeaders.includes(header.name.toLowerCase()) &&\ncompressionTypes.includes(header.value)\n);\n",
"new_path": "lighthouse-core/gather/gatherers/dobetterweb/response-compression.js",
"old_path": "lighthouse-core/gather/gatherers/dobetterweb/response-compression.js"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
core(response-compression): also check x-original-content-encoding (#4607)
| 1
|
core
|
response-compression
|
815,746
|
28.02.2018 09:41:01
| -7,200
|
fc5c58aa33983e4ffbaf575e84e18438059f9ffb
|
fix: bundle size
fixes
|
[
{
"change_type": "MODIFY",
"diff": "\"scripts\": {\n\"clean\": \"rimraf out-tsc dist/*\",\n\"prebuild\": \"npm run clean\",\n- \"build\": \"ng-packagr -p ./src/ng-package.json && npm run build:themes\",\n+ \"build\": \"ng-packagr -p ./src/package.json && npm run build:themes\",\n\"build:demo\": \"rimraf dist && webpack --config ./scripts/webpack.dev.js --progress --profile --bail\",\n\"build:themes\": \"node-sass --output-style compressed src/themes/ -o dist/themes\",\n\"prestart\": \"yarn install\",\n\"@angular/platform-browser\": \"^5.0.3\",\n\"@angular/platform-browser-dynamic\": \"^5.0.3\",\n\"@angular/router\": \"^5.0.3\",\n+ \"tsickle\": \">=0.25.5\",\n+ \"tslib\": \"^1.7.1\",\n\"@ng-bootstrap/ng-bootstrap\": \"^1.0.0-beta.5\",\n\"@types/jasmine\": \"^2.5.36\",\n\"@types/node\": \"^6.0.87\",\n\"karma-remap-istanbul\": \"0.2.1\",\n\"karma-sourcemap-loader\": \"^0.3.7\",\n\"karma-webpack\": \"2.0.5\",\n- \"ng-packagr\": \"^1.5.0-rc.0\",\n+ \"ng-packagr\": \"^2.1.0\",\n\"ng-snippets-loader\": \"^0.2.5\",\n\"node-sass\": \"^4.0.0\",\n\"null-loader\": \"0.1.1\",\n",
"new_path": "package.json",
"old_path": "package.json"
},
{
"change_type": "DELETE",
"diff": "-{\n- \"dest\": \"../dist\",\n- \"lib\": {\n- \"entryFile\": \"index.ts\"\n- }\n-}\n",
"new_path": null,
"old_path": "src/ng-package.json"
},
{
"change_type": "MODIFY",
"diff": "{\n+ \"$schema\": \"../node_modules/ng-packagr/package.schema.json\",\n\"name\": \"@ng-select/ng-select\",\n\"version\": \"0.23.1\",\n\"description\": \"Angular ng-select - All in One UI Select, Multiselect and Autocomplete\",\n\"@angular/common\": \">=4.0.0 <6.0.0\",\n\"@angular/core\": \">=4.0.0 <6.0.0\",\n\"@angular/forms\": \">=4.0.0 <6.0.0\"\n+ },\n+ \"ngPackage\": {\n+ \"lib\": {\n+ \"flatModuleFile\": \"ng-select\",\n+ \"entryFile\": \"index.ts\"\n+ },\n+ \"dest\": \"../dist\"\n}\n}\n",
"new_path": "src/package.json",
"old_path": "src/package.json"
},
{
"change_type": "MODIFY",
"diff": "dependencies:\ntslib \"^1.7.1\"\n-\"@angular/tsc-wrapped@^4.2.0\":\n- version \"4.4.6\"\n- resolved \"https://registry.yarnpkg.com/@angular/tsc-wrapped/-/tsc-wrapped-4.4.6.tgz#16787cbbf50bdc7e738123b19c32527f244e178d\"\n- dependencies:\n- tsickle \"^0.21.0\"\n-\n\"@ng-bootstrap/ng-bootstrap@^1.0.0-beta.5\":\nversion \"1.0.0-beta.5\"\nresolved \"https://registry.yarnpkg.com/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-1.0.0-beta.5.tgz#da2b9066b3701a284cac5a16168a77def947b4ab\"\n@@ -154,7 +148,7 @@ acorn-dynamic-import@^2.0.0:\ndependencies:\nacorn \"^4.0.3\"\n-acorn@^4.0.3:\n+acorn@4.x, acorn@^4.0.3:\nversion \"4.0.13\"\nresolved \"https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787\"\n@@ -406,7 +400,7 @@ async@1.x, async@^1.4.0, async@^1.5.2:\nversion \"1.5.2\"\nresolved \"https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a\"\n-async@^2.0.0-rc.5, async@^2.1.2, async@^2.1.5, async@^2.4.1:\n+async@^2.1.2, async@^2.1.5, async@^2.4.1:\nversion \"2.5.0\"\nresolved \"https://registry.yarnpkg.com/async/-/async-2.5.0.tgz#843190fd6b7357a0b9e1c956edddd5ec8462b54d\"\ndependencies:\n@@ -859,14 +853,6 @@ chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3:\nstrip-ansi \"^3.0.0\"\nsupports-color \"^2.0.0\"\n-chalk@^2.0.0:\n- version \"2.2.0\"\n- resolved \"https://registry.yarnpkg.com/chalk/-/chalk-2.2.0.tgz#477b3bf2f9b8fd5ca9e429747e37f724ee7af240\"\n- dependencies:\n- ansi-styles \"^3.1.0\"\n- escape-string-regexp \"^1.0.5\"\n- supports-color \"^4.0.0\"\n-\nchalk@^2.0.1, chalk@^2.1.0:\nversion \"2.1.0\"\nresolved \"https://registry.yarnpkg.com/chalk/-/chalk-2.1.0.tgz#ac5becf14fa21b99c6c92ca7a7d7cfd5b17e743e\"\n@@ -948,7 +934,7 @@ clone-stats@^0.0.1:\nversion \"0.0.1\"\nresolved \"https://registry.yarnpkg.com/clone-stats/-/clone-stats-0.0.1.tgz#b88f94a82cf38b8791d58046ea4029ad88ca99d1\"\n-clone@^1.0.0, clone@^1.0.2, clone@~1.0.2:\n+clone@^1.0.0, clone@^1.0.2:\nversion \"1.0.2\"\nresolved \"https://registry.yarnpkg.com/clone/-/clone-1.0.2.tgz#260b7a99ebb1edfe247538175f783243cb19d149\"\n@@ -1021,10 +1007,18 @@ combined-stream@^1.0.5, combined-stream@~1.0.5:\ndependencies:\ndelayed-stream \"~1.0.0\"\n-commander@2.11.x, commander@^2.11.0, commander@^2.9.0, commander@~2.11.0:\n+commander@2.11.x, commander@^2.9.0, commander@~2.11.0:\nversion \"2.11.0\"\nresolved \"https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563\"\n+commander@^2.12.0:\n+ version \"2.14.1\"\n+ resolved \"https://registry.yarnpkg.com/commander/-/commander-2.14.1.tgz#2235123e37af8ca3c65df45b026dbd357b01b9aa\"\n+\n+commenting@1.0.4:\n+ version \"1.0.4\"\n+ resolved \"https://registry.yarnpkg.com/commenting/-/commenting-1.0.4.tgz#d140af32634fcbdee4d71396934c1fcdac147e50\"\n+\ncompare-func@^1.3.1:\nversion \"1.3.2\"\nresolved \"https://registry.yarnpkg.com/compare-func/-/compare-func-1.3.2.tgz#99dd0ba457e1f9bc722b12c08ec33eeab31fa648\"\n@@ -1248,10 +1242,6 @@ conventional-recommended-bump@^1.0.0:\nmeow \"^3.3.0\"\nobject-assign \"^4.0.1\"\n-convert-source-map@^1.1.1:\n- version \"1.5.0\"\n- resolved \"https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.0.tgz#9acd70851c6d5dfdd93d9282e5edf94a03ff46b5\"\n-\ncookie-signature@1.0.6:\nversion \"1.0.6\"\nresolved \"https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c\"\n@@ -1486,6 +1476,10 @@ csso@~2.3.1:\nclap \"^1.0.9\"\nsource-map \"^0.5.3\"\n+cuint@^0.2.2:\n+ version \"0.2.2\"\n+ resolved \"https://registry.yarnpkg.com/cuint/-/cuint-0.2.2.tgz#408086d409550c2631155619e9fa7bcadc3b991b\"\n+\ncurrently-unhandled@^0.4.1:\nversion \"0.4.1\"\nresolved \"https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea\"\n@@ -1525,10 +1519,6 @@ dateformat@^1.0.11, dateformat@^1.0.12, dateformat@^1.0.6:\nget-stdin \"^4.0.1\"\nmeow \"^3.3.0\"\n-dateformat@^2.0.0:\n- version \"2.2.0\"\n- resolved \"https://registry.yarnpkg.com/dateformat/-/dateformat-2.2.0.tgz#4065e2013cf9fb916ddfd82efb506ad4c6769062\"\n-\ndebug@*:\nversion \"3.1.0\"\nresolved \"https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261\"\n@@ -1646,10 +1636,6 @@ di@^0.0.1:\nversion \"0.0.1\"\nresolved \"https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c\"\n-diff@^3.1.0:\n- version \"3.4.0\"\n- resolved \"https://registry.yarnpkg.com/diff/-/diff-3.4.0.tgz#b1d85507daf3964828de54b37d0d73ba67dda56c\"\n-\ndiff@^3.2.0:\nversion \"3.3.1\"\nresolved \"https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75\"\n@@ -1748,15 +1734,6 @@ duplexer@^0.1.1:\nversion \"0.1.1\"\nresolved \"https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1\"\n-duplexify@^3.2.0:\n- version \"3.5.1\"\n- resolved \"https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.1.tgz#4e1516be68838bc90a49994f0b39a6e5960befcd\"\n- dependencies:\n- end-of-stream \"^1.0.0\"\n- inherits \"^2.0.1\"\n- readable-stream \"^2.0.0\"\n- stream-shift \"^1.0.0\"\n-\necc-jsbn@~0.1.1:\nversion \"0.1.1\"\nresolved \"https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505\"\n@@ -1795,12 +1772,6 @@ encodeurl@~1.0.1:\nversion \"1.0.1\"\nresolved \"https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.1.tgz#79e3d58655346909fe6f0f45a5de68103b294d20\"\n-end-of-stream@^1.0.0:\n- version \"1.4.0\"\n- resolved \"https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.0.tgz#7a90d833efda6cfa6eac0f4949dbb0fad3a63206\"\n- dependencies:\n- once \"^1.4.0\"\n-\nengine.io-client@1.8.3:\nversion \"1.8.3\"\nresolved \"https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-1.8.3.tgz#1798ed93451246453d4c6f635d7a201fe940d5ab\"\n@@ -1943,7 +1914,7 @@ es6-symbol@3.1.1, es6-symbol@^3.1.1, es6-symbol@~3.1.1:\nd \"1\"\nes5-ext \"~0.10.14\"\n-es6-templates@^0.2.2, es6-templates@~0.2.2:\n+es6-templates@^0.2.2:\nversion \"0.2.3\"\nresolved \"https://registry.yarnpkg.com/es6-templates/-/es6-templates-0.2.3.tgz#5cb9ac9fb1ded6eb1239342b81d792bbb4078ee4\"\ndependencies:\n@@ -2292,6 +2263,10 @@ find-index@^0.1.1:\nversion \"0.1.1\"\nresolved \"https://registry.yarnpkg.com/find-index/-/find-index-0.1.1.tgz#675d358b2ca3892d795a1ab47232f8b6e2e0dde4\"\n+find-parent-dir@^0.3.0:\n+ version \"0.3.0\"\n+ resolved \"https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54\"\n+\nfind-up@^1.0.0:\nversion \"1.1.2\"\nresolved \"https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f\"\n@@ -2305,10 +2280,6 @@ find-up@^2.0.0:\ndependencies:\nlocate-path \"^2.0.0\"\n-first-chunk-stream@^1.0.0:\n- version \"1.0.0\"\n- resolved \"https://registry.yarnpkg.com/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz#59bfb50cd905f60d7c394cd3d9acaab4e6ad934e\"\n-\nflatten@^1.0.2:\nversion \"1.0.2\"\nresolved \"https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782\"\n@@ -2394,9 +2365,9 @@ fs-extra@^2.0.0:\ngraceful-fs \"^4.1.2\"\njsonfile \"^2.1.0\"\n-fs-extra@^4.0.2:\n- version \"4.0.2\"\n- resolved \"https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.2.tgz#f91704c53d1b461f893452b0c307d9997647ab6b\"\n+fs-extra@^5.0.0:\n+ version \"5.0.0\"\n+ resolved \"https://registry.yarnpkg.com/fs-extra/-/fs-extra-5.0.0.tgz#414d0110cdd06705734d055652c5411260c31abd\"\ndependencies:\ngraceful-fs \"^4.1.2\"\njsonfile \"^4.0.0\"\n@@ -2542,33 +2513,13 @@ glob-parent@^2.0.0:\ndependencies:\nis-glob \"^2.0.0\"\n-glob-parent@^3.0.0:\n- version \"3.1.0\"\n- resolved \"https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae\"\n- dependencies:\n- is-glob \"^3.1.0\"\n- path-dirname \"^1.0.0\"\n-\n-glob-stream@^5.3.2:\n- version \"5.3.5\"\n- resolved \"https://registry.yarnpkg.com/glob-stream/-/glob-stream-5.3.5.tgz#a55665a9a8ccdc41915a87c701e32d4e016fad22\"\n- dependencies:\n- extend \"^3.0.0\"\n- glob \"^5.0.3\"\n- glob-parent \"^3.0.0\"\n- micromatch \"^2.3.7\"\n- ordered-read-streams \"^0.3.0\"\n- through2 \"^0.6.0\"\n- to-absolute-glob \"^0.1.1\"\n- unique-stream \"^2.0.2\"\n-\nglob2base@^0.0.12:\nversion \"0.0.12\"\nresolved \"https://registry.yarnpkg.com/glob2base/-/glob2base-0.0.12.tgz#9d419b3e28f12e83a362164a277055922c9c0d56\"\ndependencies:\nfind-index \"^0.1.1\"\n-glob@5.x, glob@^5.0.15, glob@^5.0.3:\n+glob@5.x, glob@^5.0.15:\nversion \"5.0.15\"\nresolved \"https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1\"\ndependencies:\n@@ -2652,32 +2603,10 @@ glogg@^1.0.0:\ndependencies:\nsparkles \"^1.0.0\"\n-graceful-fs@^4.0.0, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.6, graceful-fs@^4.1.9:\n+graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.6, graceful-fs@^4.1.9:\nversion \"4.1.11\"\nresolved \"https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658\"\n-gulp-inline-ng2-template@^4.0.0:\n- version \"4.0.0\"\n- resolved \"https://registry.yarnpkg.com/gulp-inline-ng2-template/-/gulp-inline-ng2-template-4.0.0.tgz#a145f216f79a0da6c9c6b17bce47e199018cd838\"\n- dependencies:\n- async \"^2.0.0-rc.5\"\n- clone \"~1.0.2\"\n- es6-templates \"~0.2.2\"\n- extend \"~3.0.0\"\n- gulp-util \"~3.0.6\"\n- isarray \"0.0.1\"\n- through2 \"~2.0.0\"\n-\n-gulp-sourcemaps@1.6.0:\n- version \"1.6.0\"\n- resolved \"https://registry.yarnpkg.com/gulp-sourcemaps/-/gulp-sourcemaps-1.6.0.tgz#b86ff349d801ceb56e1d9e7dc7bbcb4b7dee600c\"\n- dependencies:\n- convert-source-map \"^1.1.1\"\n- graceful-fs \"^4.1.2\"\n- strip-bom \"^2.0.0\"\n- through2 \"^2.0.0\"\n- vinyl \"^1.0.0\"\n-\ngulp-util@3.0.7:\nversion \"3.0.7\"\nresolved \"https://registry.yarnpkg.com/gulp-util/-/gulp-util-3.0.7.tgz#78925c4b8f8b49005ac01a011c557e6218941cbb\"\n@@ -2701,29 +2630,6 @@ gulp-util@3.0.7:\nthrough2 \"^2.0.0\"\nvinyl \"^0.5.0\"\n-gulp-util@~3.0.6:\n- version \"3.0.8\"\n- resolved \"https://registry.yarnpkg.com/gulp-util/-/gulp-util-3.0.8.tgz#0054e1e744502e27c04c187c3ecc505dd54bbb4f\"\n- dependencies:\n- array-differ \"^1.0.0\"\n- array-uniq \"^1.0.2\"\n- beeper \"^1.0.0\"\n- chalk \"^1.0.0\"\n- dateformat \"^2.0.0\"\n- fancy-log \"^1.1.0\"\n- gulplog \"^1.0.0\"\n- has-gulplog \"^0.1.0\"\n- lodash._reescape \"^3.0.0\"\n- lodash._reevaluate \"^3.0.0\"\n- lodash._reinterpolate \"^3.0.0\"\n- lodash.template \"^3.0.0\"\n- minimist \"^1.1.0\"\n- multipipe \"^0.1.2\"\n- object-assign \"^3.0.0\"\n- replace-ext \"0.0.1\"\n- through2 \"^2.0.0\"\n- vinyl \"^0.5.0\"\n-\ngulplog@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/gulplog/-/gulplog-1.0.0.tgz#e28c4d45d05ecbbed818363ce8f9c5926229ffe5\"\n@@ -2914,12 +2820,6 @@ hoek@4.x.x:\nversion \"4.2.0\"\nresolved \"https://registry.yarnpkg.com/hoek/-/hoek-4.2.0.tgz#72d9d0754f7fe25ca2d01ad8f8f9a9449a89526d\"\n-homedir-polyfill@^1.0.1:\n- version \"1.0.1\"\n- resolved \"https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz#4c2bbc8a758998feebf5ed68580f76d46768b4bc\"\n- dependencies:\n- parse-passwd \"^1.0.0\"\n-\nhosted-git-info@^2.1.4:\nversion \"2.5.0\"\nresolved \"https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c\"\n@@ -3098,6 +2998,10 @@ ini@^1.3.2, ini@^1.3.4, ini@~1.3.0:\nversion \"1.3.4\"\nresolved \"https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e\"\n+injection-js@^2.2.1:\n+ version \"2.2.1\"\n+ resolved \"https://registry.yarnpkg.com/injection-js/-/injection-js-2.2.1.tgz#a8d6a085b2f0b8d8650f6f4487f6abb8cc0d67ce\"\n+\ninternal-ip@1.2.0:\nversion \"1.2.0\"\nresolved \"https://registry.yarnpkg.com/internal-ip/-/internal-ip-1.2.0.tgz#ae9fbf93b984878785d50a8de1b356956058cf5c\"\n@@ -3317,7 +3221,7 @@ is-regex@^1.0.4:\ndependencies:\nhas \"^1.0.1\"\n-is-stream@^1.0.1, is-stream@^1.1.0:\n+is-stream@^1.1.0:\nversion \"1.1.0\"\nresolved \"https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44\"\n@@ -3349,10 +3253,6 @@ is-utf8@^0.2.0:\nversion \"0.2.1\"\nresolved \"https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72\"\n-is-valid-glob@^0.3.0:\n- version \"0.3.0\"\n- resolved \"https://registry.yarnpkg.com/is-valid-glob/-/is-valid-glob-0.3.0.tgz#d4b55c69f51886f9b65c70d6c2622d37e29f48fe\"\n-\nis-wsl@^1.1.0:\nversion \"1.1.0\"\nresolved \"https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d\"\n@@ -3508,7 +3408,7 @@ json-schema@0.2.3:\nversion \"0.2.3\"\nresolved \"https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13\"\n-json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1:\n+json-stable-stringify@^1.0.1:\nversion \"1.0.1\"\nresolved \"https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af\"\ndependencies:\n@@ -3704,12 +3604,6 @@ lazy-cache@^2.0.2:\ndependencies:\nset-getter \"^0.1.0\"\n-lazystream@^1.0.0:\n- version \"1.0.0\"\n- resolved \"https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.0.tgz#f6995fe0f820392f61396be89462407bb77168e4\"\n- dependencies:\n- readable-stream \"^2.0.5\"\n-\nlcid@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835\"\n@@ -3849,10 +3743,6 @@ lodash.isarray@^3.0.0:\nversion \"3.0.4\"\nresolved \"https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55\"\n-lodash.isequal@^4.0.0:\n- version \"4.5.0\"\n- resolved \"https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0\"\n-\nlodash.keys@^3.0.0:\nversion \"3.1.2\"\nresolved \"https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a\"\n@@ -3915,14 +3805,14 @@ lodash.uniq@^4.5.0:\nversion \"4.5.0\"\nresolved \"https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773\"\n+lodash@4.17.4, lodash@^4.0.0, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.17.2, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.2.1, lodash@^4.3.0, lodash@^4.5.0, lodash@~4.17.4:\n+ version \"4.17.4\"\n+ resolved \"https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae\"\n+\nlodash@^3.8.0:\nversion \"3.10.1\"\nresolved \"https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6\"\n-lodash@^4.0.0, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.17.2, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.2.1, lodash@^4.3.0, lodash@^4.5.0, lodash@~4.17.4:\n- version \"4.17.4\"\n- resolved \"https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae\"\n-\nlodash@~2.2.0:\nversion \"2.2.1\"\nresolved \"https://registry.yarnpkg.com/lodash/-/lodash-2.2.1.tgz#ca935fd14ab3c0c872abacf198b9cda501440867\"\n@@ -3982,16 +3872,12 @@ macaddress@^0.2.8:\nversion \"0.2.8\"\nresolved \"https://registry.yarnpkg.com/macaddress/-/macaddress-0.2.8.tgz#5904dc537c39ec6dbefeae902327135fa8511f12\"\n-magic-string@^0.22.4:\n+magic-string@0.22.4, magic-string@^0.22.4:\nversion \"0.22.4\"\nresolved \"https://registry.yarnpkg.com/magic-string/-/magic-string-0.22.4.tgz#31039b4e40366395618c1d6cf8193c53917475ff\"\ndependencies:\nvlq \"^0.2.1\"\n-make-error@^1.1.1:\n- version \"1.3.0\"\n- resolved \"https://registry.yarnpkg.com/make-error/-/make-error-1.3.0.tgz#52ad3a339ccf10ce62b4040b708fe707244b8b96\"\n-\nmap-cache@^0.2.2:\nversion \"0.2.2\"\nresolved \"https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf\"\n@@ -4057,17 +3943,11 @@ merge-descriptors@1.0.1:\nversion \"1.0.1\"\nresolved \"https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61\"\n-merge-stream@^1.0.0:\n- version \"1.0.1\"\n- resolved \"https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1\"\n- dependencies:\n- readable-stream \"^2.0.1\"\n-\nmethods@~1.1.2:\nversion \"1.1.2\"\nresolved \"https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee\"\n-micromatch@^2.1.5, micromatch@^2.3.11, micromatch@^2.3.7:\n+micromatch@^2.1.5, micromatch@^2.3.11:\nversion \"2.3.11\"\nresolved \"https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565\"\ndependencies:\n@@ -4128,6 +4008,10 @@ mime@1.4.1, mime@^1.2.11, mime@^1.3.4:\nversion \"1.4.1\"\nresolved \"https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6\"\n+mime@^1.4.1:\n+ version \"1.6.0\"\n+ resolved \"https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1\"\n+\nmimic-fn@^1.0.0:\nversion \"1.1.0\"\nresolved \"https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18\"\n@@ -4185,7 +4069,7 @@ mixin-object@^2.0.1:\nfor-in \"^0.1.3\"\nis-extendable \"^0.1.1\"\n-mkdirp@0.5.x, \"mkdirp@>=0.5 0\", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1:\n+mkdirp@0.5.1, mkdirp@0.5.x, \"mkdirp@>=0.5 0\", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1:\nversion \"0.5.1\"\nresolved \"https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903\"\ndependencies:\n@@ -4195,6 +4079,10 @@ modify-values@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.0.tgz#e2b6cdeb9ce19f99317a53722f3dbf5df5eaaab2\"\n+moment@2.18.1:\n+ version \"2.18.1\"\n+ resolved \"https://registry.yarnpkg.com/moment/-/moment-2.18.1.tgz#c36193dd3ce1c2eed2adb7c802dbbc77a81b1c0f\"\n+\nms@0.7.1:\nversion \"0.7.1\"\nresolved \"https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098\"\n@@ -4258,34 +4146,35 @@ negotiator@0.6.1:\nversion \"0.6.1\"\nresolved \"https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9\"\n-ng-packagr@^1.5.0-rc.0:\n- version \"1.5.0-rc.0\"\n- resolved \"https://registry.yarnpkg.com/ng-packagr/-/ng-packagr-1.5.0-rc.0.tgz#62b3d68fa605948a0343c8d249beda1d3a51288a\"\n+ng-packagr@^2.1.0:\n+ version \"2.1.0\"\n+ resolved \"https://registry.yarnpkg.com/ng-packagr/-/ng-packagr-2.1.0.tgz#f6a696ba6572011d1edc7d29b551d853fa1363d7\"\ndependencies:\n- \"@angular/tsc-wrapped\" \"^4.2.0\"\n\"@ngtools/json-schema\" \"^1.1.0\"\nautoprefixer \"^7.1.1\"\nbrowserslist \"^2.1.5\"\n- commander \"^2.11.0\"\n+ commander \"^2.12.0\"\ncpx \"^1.5.0\"\n- fs-extra \"^4.0.2\"\n+ fs-extra \"^5.0.0\"\nglob \"^7.1.2\"\n- gulp-inline-ng2-template \"^4.0.0\"\n+ injection-js \"^2.2.1\"\nless \"^2.7.2\"\n- lodash \"^4.17.4\"\nnode-sass \"^4.5.3\"\n+ node-sass-tilde-importer \"^1.0.0\"\npostcss \"^6.0.2\"\n- read-file \"^0.2.0\"\n+ postcss-discard-comments \"^2.0.4\"\n+ postcss-url \"^7.3.0\"\nrimraf \"^2.6.1\"\n- rollup \"^0.50.0\"\n+ rollup \"^0.55.0\"\n+ rollup-plugin-cleanup \"^2.0.0\"\nrollup-plugin-commonjs \"^8.2.1\"\n+ rollup-plugin-license \"^0.5.0\"\nrollup-plugin-node-resolve \"^3.0.0\"\n+ rxjs \"^5.5.0\"\nsorcery \"^0.10.0\"\n+ strip-bom \"^3.0.0\"\nstylus \"^0.54.5\"\n- ts-node \"^3.0.4\"\n- typescript \"^2.3.2\"\nuglify-js \"^3.0.7\"\n- vinyl-fs \"^2.4.4\"\nng-snippets-loader@^0.2.5:\nversion \"0.2.5\"\n@@ -4370,6 +4259,12 @@ node-pre-gyp@^0.6.36:\ntar \"^2.2.1\"\ntar-pack \"^3.4.0\"\n+node-sass-tilde-importer@^1.0.0:\n+ version \"1.0.1\"\n+ resolved \"https://registry.yarnpkg.com/node-sass-tilde-importer/-/node-sass-tilde-importer-1.0.1.tgz#3eab5247a3bf53354766bb1e6fd2214ce17e74ee\"\n+ dependencies:\n+ find-parent-dir \"^0.3.0\"\n+\nnode-sass@^4.0.0, node-sass@^4.5.3:\nversion \"4.5.3\"\nresolved \"https://registry.yarnpkg.com/node-sass/-/node-sass-4.5.3.tgz#d09c9d1179641239d1b97ffc6231fdcec53e1568\"\n@@ -4479,7 +4374,7 @@ object-assign@4.1.0:\nversion \"4.1.0\"\nresolved \"https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.0.tgz#7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0\"\n-object-assign@4.x.x, object-assign@^4.0.0, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1:\n+object-assign@4.x.x, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1:\nversion \"4.1.1\"\nresolved \"https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863\"\n@@ -4536,7 +4431,7 @@ on-headers@~1.0.1:\nversion \"1.0.1\"\nresolved \"https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.1.tgz#928f5d0f470d49342651ea6794b0857c100693f7\"\n-once@1.x, once@^1.3.0, once@^1.3.3, once@^1.4.0:\n+once@1.x, once@^1.3.0, once@^1.3.3:\nversion \"1.4.0\"\nresolved \"https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1\"\ndependencies:\n@@ -4570,13 +4465,6 @@ options@>=0.0.5:\nversion \"0.0.6\"\nresolved \"https://registry.yarnpkg.com/options/-/options-0.0.6.tgz#ec22d312806bb53e731773e7cdaefcf1c643128f\"\n-ordered-read-streams@^0.3.0:\n- version \"0.3.0\"\n- resolved \"https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-0.3.0.tgz#7137e69b3298bb342247a1bbee3881c80e2fd78b\"\n- dependencies:\n- is-stream \"^1.0.1\"\n- readable-stream \"^2.0.1\"\n-\noriginal@>=0.0.5:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/original/-/original-1.0.0.tgz#9147f93fa1696d04be61e01bd50baeaca656bd3b\"\n@@ -4673,10 +4561,6 @@ parse-json@^2.2.0:\ndependencies:\nerror-ex \"^1.2.0\"\n-parse-passwd@^1.0.0:\n- version \"1.0.0\"\n- resolved \"https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6\"\n-\nparsejson@0.0.3:\nversion \"0.0.3\"\nresolved \"https://registry.yarnpkg.com/parsejson/-/parsejson-0.0.3.tgz#ab7e3759f209ece99437973f7d0f1f64ae0e64ab\"\n@@ -4707,10 +4591,6 @@ path-browserify@0.0.0:\nversion \"0.0.0\"\nresolved \"https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a\"\n-path-dirname@^1.0.0:\n- version \"1.0.2\"\n- resolved \"https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0\"\n-\npath-exists@^2.0.0:\nversion \"2.1.0\"\nresolved \"https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b\"\n@@ -5052,6 +4932,16 @@ postcss-unique-selectors@^2.0.2:\npostcss \"^5.0.4\"\nuniqs \"^2.0.0\"\n+postcss-url@^7.3.0:\n+ version \"7.3.1\"\n+ resolved \"https://registry.yarnpkg.com/postcss-url/-/postcss-url-7.3.1.tgz#b43ae0f0dae4cd06c831fa3aeac2d7a5b73754ed\"\n+ dependencies:\n+ mime \"^1.4.1\"\n+ minimatch \"^3.0.4\"\n+ mkdirp \"^0.5.0\"\n+ postcss \"^6.0.1\"\n+ xxhashjs \"^0.2.1\"\n+\npostcss-value-parser@^3.0.1, postcss-value-parser@^3.0.2, postcss-value-parser@^3.1.1, postcss-value-parser@^3.1.2, postcss-value-parser@^3.2.3, postcss-value-parser@^3.3.0:\nversion \"3.3.0\"\nresolved \"https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz#87f38f9f18f774a4ab4c8a232f5c5ce8872a9d15\"\n@@ -5269,10 +5159,6 @@ rc@^1.1.7:\nminimist \"^1.2.0\"\nstrip-json-comments \"~2.0.1\"\n-read-file@^0.2.0:\n- version \"0.2.0\"\n- resolved \"https://registry.yarnpkg.com/read-file/-/read-file-0.2.0.tgz#70c6baf8842ec7d1540f981fd0e6aed4c81bd545\"\n-\nread-pkg-up@^1.0.1:\nversion \"1.0.1\"\nresolved \"https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02\"\n@@ -5303,7 +5189,7 @@ read-pkg@^2.0.0:\nnormalize-package-data \"^2.3.2\"\npath-type \"^2.0.0\"\n-readable-stream@1.0, \"readable-stream@>=1.0.33-1 <1.1.0-0\", readable-stream@~1.0.2:\n+readable-stream@1.0, readable-stream@~1.0.2:\nversion \"1.0.34\"\nresolved \"https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c\"\ndependencies:\n@@ -5312,7 +5198,7 @@ readable-stream@1.0, \"readable-stream@>=1.0.33-1 <1.1.0-0\", readable-stream@~1.0\nisarray \"0.0.1\"\nstring_decoder \"~0.10.x\"\n-readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.2.6, readable-stream@^2.2.9:\n+readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.2.6, readable-stream@^2.2.9:\nversion \"2.3.3\"\nresolved \"https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c\"\ndependencies:\n@@ -5609,6 +5495,14 @@ ripemd160@^2.0.0, ripemd160@^2.0.1:\nhash-base \"^2.0.0\"\ninherits \"^2.0.1\"\n+rollup-plugin-cleanup@^2.0.0:\n+ version \"2.0.0\"\n+ resolved \"https://registry.yarnpkg.com/rollup-plugin-cleanup/-/rollup-plugin-cleanup-2.0.0.tgz#85977319a3bf54750a9d75fb909c7e51f59a2da4\"\n+ dependencies:\n+ acorn \"4.x\"\n+ magic-string \"^0.22.4\"\n+ rollup-pluginutils \"^2.0.1\"\n+\nrollup-plugin-commonjs@^8.2.1:\nversion \"8.2.4\"\nresolved \"https://registry.yarnpkg.com/rollup-plugin-commonjs/-/rollup-plugin-commonjs-8.2.4.tgz#435b01fb591cb508dc740196cec8b60f10132e78\"\n@@ -5619,6 +5513,16 @@ rollup-plugin-commonjs@^8.2.1:\nresolve \"^1.4.0\"\nrollup-pluginutils \"^2.0.1\"\n+rollup-plugin-license@^0.5.0:\n+ version \"0.5.0\"\n+ resolved \"https://registry.yarnpkg.com/rollup-plugin-license/-/rollup-plugin-license-0.5.0.tgz#5e707375fb58d29575253a0d28e97e41882682f7\"\n+ dependencies:\n+ commenting \"1.0.4\"\n+ lodash \"4.17.4\"\n+ magic-string \"0.22.4\"\n+ mkdirp \"0.5.1\"\n+ moment \"2.18.1\"\n+\nrollup-plugin-node-resolve@^3.0.0:\nversion \"3.0.0\"\nresolved \"https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.0.0.tgz#8b897c4c3030d5001277b0514b25d2ca09683ee0\"\n@@ -5635,9 +5539,15 @@ rollup-pluginutils@^2.0.1:\nestree-walker \"^0.3.0\"\nmicromatch \"^2.3.11\"\n-rollup@^0.50.0:\n- version \"0.50.0\"\n- resolved \"https://registry.yarnpkg.com/rollup/-/rollup-0.50.0.tgz#4c158f4e780e6cb33ff0dbfc184a52cc58cd5f3b\"\n+rollup@^0.55.0:\n+ version \"0.55.5\"\n+ resolved \"https://registry.yarnpkg.com/rollup/-/rollup-0.55.5.tgz#2f88c300f7cf24b5ec2dca8a6aba73b04e087e93\"\n+\n+rxjs@^5.5.0:\n+ version \"5.5.6\"\n+ resolved \"https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.6.tgz#e31fb96d6fd2ff1fd84bcea8ae9c02d007179c02\"\n+ dependencies:\n+ symbol-observable \"1.0.1\"\nrxjs@^5.5.3:\nversion \"5.5.3\"\n@@ -6011,12 +5921,18 @@ source-map-resolve@^0.5.0:\nsource-map-url \"^0.4.0\"\nurix \"^0.1.0\"\n-source-map-support@^0.4.0, source-map-support@^0.4.15, source-map-support@^0.4.2, source-map-support@~0.4.0:\n+source-map-support@^0.4.15, source-map-support@^0.4.2, source-map-support@~0.4.0:\nversion \"0.4.18\"\nresolved \"https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f\"\ndependencies:\nsource-map \"^0.5.6\"\n+source-map-support@^0.5.0:\n+ version \"0.5.3\"\n+ resolved \"https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.3.tgz#2b3d5fff298cfa4d1afd7d4352d569e9a0158e76\"\n+ dependencies:\n+ source-map \"^0.6.0\"\n+\nsource-map-url@^0.4.0:\nversion \"0.4.0\"\nresolved \"https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3\"\n@@ -6031,7 +5947,7 @@ source-map@0.5.x, source-map@^0.5.1, source-map@^0.5.3, source-map@^0.5.6, sourc\nversion \"0.5.7\"\nresolved \"https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc\"\n-source-map@>=0.5.6, source-map@^0.6.1, source-map@~0.6.1:\n+source-map@>=0.5.6, source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1:\nversion \"0.6.1\"\nresolved \"https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263\"\n@@ -6182,10 +6098,6 @@ stream-http@^2.3.1:\nto-arraybuffer \"^1.0.0\"\nxtend \"^4.0.0\"\n-stream-shift@^1.0.0:\n- version \"1.0.0\"\n- resolved \"https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952\"\n-\nstrict-uri-encode@^1.0.0:\nversion \"1.1.0\"\nresolved \"https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713\"\n@@ -6231,13 +6143,6 @@ strip-ansi@^4.0.0:\ndependencies:\nansi-regex \"^3.0.0\"\n-strip-bom-stream@^1.0.0:\n- version \"1.0.0\"\n- resolved \"https://registry.yarnpkg.com/strip-bom-stream/-/strip-bom-stream-1.0.0.tgz#e7144398577d51a6bed0fa1994fa05f43fd988ee\"\n- dependencies:\n- first-chunk-stream \"^1.0.0\"\n- strip-bom \"^2.0.0\"\n-\nstrip-bom@^2.0.0:\nversion \"2.0.0\"\nresolved \"https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e\"\n@@ -6258,7 +6163,7 @@ strip-indent@^1.0.1:\ndependencies:\nget-stdin \"^4.0.1\"\n-strip-json-comments@^2.0.0, strip-json-comments@~2.0.1:\n+strip-json-comments@~2.0.1:\nversion \"2.0.1\"\nresolved \"https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a\"\n@@ -6319,6 +6224,10 @@ svgo@^0.7.0:\nsax \"~1.2.1\"\nwhet.extend \"~0.9.9\"\n+symbol-observable@1.0.1:\n+ version \"1.0.1\"\n+ resolved \"https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.1.tgz#8340fc4702c3122df5d22288f88283f513d3fdd4\"\n+\nsymbol-observable@^1.0.1:\nversion \"1.0.4\"\nresolved \"https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d\"\n@@ -6352,13 +6261,6 @@ text-extensions@^1.0.0:\nversion \"1.6.0\"\nresolved \"https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.6.0.tgz#771561b26022783a45f5b6c2e78ad6e7de9fe322\"\n-through2-filter@^2.0.0:\n- version \"2.0.0\"\n- resolved \"https://registry.yarnpkg.com/through2-filter/-/through2-filter-2.0.0.tgz#60bc55a0dacb76085db1f9dae99ab43f83d622ec\"\n- dependencies:\n- through2 \"~2.0.0\"\n- xtend \"~4.0.0\"\n-\nthrough2@2.0.1:\nversion \"2.0.1\"\nresolved \"https://registry.yarnpkg.com/through2/-/through2-2.0.1.tgz#384e75314d49f32de12eebb8136b8eb6b5d59da9\"\n@@ -6366,14 +6268,7 @@ through2@2.0.1:\nreadable-stream \"~2.0.0\"\nxtend \"~4.0.0\"\n-through2@^0.6.0:\n- version \"0.6.5\"\n- resolved \"https://registry.yarnpkg.com/through2/-/through2-0.6.5.tgz#41ab9c67b29d57209071410e1d7a7a968cd3ad48\"\n- dependencies:\n- readable-stream \">=1.0.33-1 <1.1.0-0\"\n- xtend \">=4.0.0 <4.1.0-0\"\n-\n-through2@^2.0.0, through2@^2.0.2, through2@~2.0.0:\n+through2@^2.0.0, through2@^2.0.2:\nversion \"2.0.3\"\nresolved \"https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be\"\ndependencies:\n@@ -6418,12 +6313,6 @@ tmp@0.0.x:\ndependencies:\nos-tmpdir \"~1.0.2\"\n-to-absolute-glob@^0.1.1:\n- version \"0.1.1\"\n- resolved \"https://registry.yarnpkg.com/to-absolute-glob/-/to-absolute-glob-0.1.1.tgz#1cdfa472a9ef50c239ee66999b662ca0eb39937f\"\n- dependencies:\n- extend-shallow \"^2.0.1\"\n-\nto-array@0.1.4:\nversion \"0.1.4\"\nresolved \"https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890\"\n@@ -6475,36 +6364,14 @@ ts-helpers@^1.1.1:\nversion \"1.1.2\"\nresolved \"https://registry.yarnpkg.com/ts-helpers/-/ts-helpers-1.1.2.tgz#fc69be9f1f3baed01fb1a0ef8d4cfe748814d835\"\n-ts-node@^3.0.4:\n- version \"3.3.0\"\n- resolved \"https://registry.yarnpkg.com/ts-node/-/ts-node-3.3.0.tgz#c13c6a3024e30be1180dd53038fc209289d4bf69\"\n+tsickle@>=0.25.5:\n+ version \"0.27.2\"\n+ resolved \"https://registry.yarnpkg.com/tsickle/-/tsickle-0.27.2.tgz#f33d46d046f73dd5c155a37922e422816e878736\"\ndependencies:\n- arrify \"^1.0.0\"\n- chalk \"^2.0.0\"\n- diff \"^3.1.0\"\n- make-error \"^1.1.1\"\nminimist \"^1.2.0\"\nmkdirp \"^0.5.1\"\n- source-map-support \"^0.4.0\"\n- tsconfig \"^6.0.0\"\n- v8flags \"^3.0.0\"\n- yn \"^2.0.0\"\n-\n-tsconfig@^6.0.0:\n- version \"6.0.0\"\n- resolved \"https://registry.yarnpkg.com/tsconfig/-/tsconfig-6.0.0.tgz#6b0e8376003d7af1864f8df8f89dd0059ffcd032\"\n- dependencies:\n- strip-bom \"^3.0.0\"\n- strip-json-comments \"^2.0.0\"\n-\n-tsickle@^0.21.0:\n- version \"0.21.6\"\n- resolved \"https://registry.yarnpkg.com/tsickle/-/tsickle-0.21.6.tgz#53b01b979c5c13fdb13afb3fb958177e5991588d\"\n- dependencies:\n- minimist \"^1.2.0\"\n- mkdirp \"^0.5.1\"\n- source-map \"^0.5.6\"\n- source-map-support \"^0.4.2\"\n+ source-map \"^0.6.0\"\n+ source-map-support \"^0.5.0\"\ntsickle@^0.24.0:\nversion \"0.24.1\"\n@@ -6615,7 +6482,7 @@ typescript@2.2.2:\nversion \"2.2.2\"\nresolved \"https://registry.yarnpkg.com/typescript/-/typescript-2.2.2.tgz#606022508479b55ffa368b58fee963a03dfd7b0c\"\n-typescript@^2.3.2, typescript@^2.5.1:\n+typescript@^2.5.1:\nversion \"2.5.3\"\nresolved \"https://registry.yarnpkg.com/typescript/-/typescript-2.5.3.tgz#df3dcdc38f3beb800d4bc322646b04a3f6ca7f0d\"\n@@ -6685,13 +6552,6 @@ uniqs@^2.0.0:\nversion \"2.0.0\"\nresolved \"https://registry.yarnpkg.com/uniqs/-/uniqs-2.0.0.tgz#ffede4b36b25290696e6e165d4a59edb998e6b02\"\n-unique-stream@^2.0.2:\n- version \"2.2.1\"\n- resolved \"https://registry.yarnpkg.com/unique-stream/-/unique-stream-2.2.1.tgz#5aa003cfbe94c5ff866c4e7d668bb1c4dbadb369\"\n- dependencies:\n- json-stable-stringify \"^1.0.0\"\n- through2-filter \"^2.0.0\"\n-\nuniversalify@^0.1.0:\nversion \"0.1.1\"\nresolved \"https://registry.yarnpkg.com/universalify/-/universalify-0.1.1.tgz#fa71badd4437af4c148841e3b3b165f9e9e590b7\"\n@@ -6788,16 +6648,6 @@ uuid@^3.0.0, uuid@^3.1.0:\nversion \"3.1.0\"\nresolved \"https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04\"\n-v8flags@^3.0.0:\n- version \"3.0.1\"\n- resolved \"https://registry.yarnpkg.com/v8flags/-/v8flags-3.0.1.tgz#dce8fc379c17d9f2c9e9ed78d89ce00052b1b76b\"\n- dependencies:\n- homedir-polyfill \"^1.0.1\"\n-\n-vali-date@^1.0.0:\n- version \"1.0.0\"\n- resolved \"https://registry.yarnpkg.com/vali-date/-/vali-date-1.0.0.tgz#1b904a59609fb328ef078138420934f6b86709a6\"\n-\nvalidate-npm-package-license@^3.0.1:\nversion \"3.0.1\"\nresolved \"https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc\"\n@@ -6821,28 +6671,6 @@ verror@1.10.0:\ncore-util-is \"1.0.2\"\nextsprintf \"^1.2.0\"\n-vinyl-fs@^2.4.4:\n- version \"2.4.4\"\n- resolved \"https://registry.yarnpkg.com/vinyl-fs/-/vinyl-fs-2.4.4.tgz#be6ff3270cb55dfd7d3063640de81f25d7532239\"\n- dependencies:\n- duplexify \"^3.2.0\"\n- glob-stream \"^5.3.2\"\n- graceful-fs \"^4.0.0\"\n- gulp-sourcemaps \"1.6.0\"\n- is-valid-glob \"^0.3.0\"\n- lazystream \"^1.0.0\"\n- lodash.isequal \"^4.0.0\"\n- merge-stream \"^1.0.0\"\n- mkdirp \"^0.5.0\"\n- object-assign \"^4.0.0\"\n- readable-stream \"^2.0.4\"\n- strip-bom \"^2.0.0\"\n- strip-bom-stream \"^1.0.0\"\n- through2 \"^2.0.0\"\n- through2-filter \"^2.0.0\"\n- vali-date \"^1.0.0\"\n- vinyl \"^1.0.0\"\n-\nvinyl@^0.5.0:\nversion \"0.5.3\"\nresolved \"https://registry.yarnpkg.com/vinyl/-/vinyl-0.5.3.tgz#b0455b38fc5e0cf30d4325132e461970c2091cde\"\n@@ -6851,14 +6679,6 @@ vinyl@^0.5.0:\nclone-stats \"^0.0.1\"\nreplace-ext \"0.0.1\"\n-vinyl@^1.0.0:\n- version \"1.2.0\"\n- resolved \"https://registry.yarnpkg.com/vinyl/-/vinyl-1.2.0.tgz#5c88036cf565e5df05558bfc911f8656df218884\"\n- dependencies:\n- clone \"^1.0.0\"\n- clone-stats \"^0.0.1\"\n- replace-ext \"0.0.1\"\n-\nvlq@^0.2.1:\nversion \"0.2.2\"\nresolved \"https://registry.yarnpkg.com/vlq/-/vlq-0.2.2.tgz#e316d5257b40b86bb43cb8d5fea5d7f54d6b0ca1\"\n@@ -7074,10 +6894,16 @@ xmlhttprequest-ssl@1.5.3:\nversion \"1.5.3\"\nresolved \"https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.3.tgz#185a888c04eca46c3e4070d99f7b49de3528992d\"\n-\"xtend@>=4.0.0 <4.1.0-0\", xtend@^4.0.0, xtend@~4.0.0, xtend@~4.0.1:\n+xtend@^4.0.0, xtend@~4.0.0, xtend@~4.0.1:\nversion \"4.0.1\"\nresolved \"https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af\"\n+xxhashjs@^0.2.1:\n+ version \"0.2.2\"\n+ resolved \"https://registry.yarnpkg.com/xxhashjs/-/xxhashjs-0.2.2.tgz#8a6251567621a1c46a5ae204da0249c7f8caa9d8\"\n+ dependencies:\n+ cuint \"^0.2.2\"\n+\ny18n@^3.2.1:\nversion \"3.2.1\"\nresolved \"https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41\"\n@@ -7171,10 +6997,6 @@ yeast@0.1.2:\nversion \"0.1.2\"\nresolved \"https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419\"\n-yn@^2.0.0:\n- version \"2.0.0\"\n- resolved \"https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a\"\n-\nzone.js@^0.8.16:\nversion \"0.8.18\"\nresolved \"https://registry.yarnpkg.com/zone.js/-/zone.js-0.8.18.tgz#8cecb3977fcd1b3090562ff4570e2847e752b48d\"\n",
"new_path": "yarn.lock",
"old_path": "yarn.lock"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
fix: bundle size (#304)
fixes #300
| 1
|
fix
| null |
815,746
|
28.02.2018 09:41:45
| -7,200
|
3957d8091a1a53d1bfb3e494a5077e2f292e1c50
|
chore(release): 0.23.2
|
[
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"0.23.2\"></a>\n+## [0.23.2](https://github.com/ng-select/ng-select/compare/v0.23.1...v0.23.2) (2018-02-28)\n+\n+\n+### Bug Fixes\n+\n+* bundle size ([#304](https://github.com/ng-select/ng-select/issues/304)) ([fc5c58a](https://github.com/ng-select/ng-select/commit/fc5c58a)), closes [#300](https://github.com/ng-select/ng-select/issues/300)\n+\n+\n+\n<a name=\"0.23.1\"></a>\n## [0.23.1](https://github.com/ng-select/ng-select/compare/v0.23.0...v0.23.1) (2018-02-27)\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"$schema\": \"../node_modules/ng-packagr/package.schema.json\",\n\"name\": \"@ng-select/ng-select\",\n- \"version\": \"0.23.1\",\n+ \"version\": \"0.23.2\",\n\"description\": \"Angular ng-select - All in One UI Select, Multiselect and Autocomplete\",\n\"author\": \"@ng-select/ng-select\",\n\"license\": \"MIT\",\n",
"new_path": "src/package.json",
"old_path": "src/package.json"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
chore(release): 0.23.2
| 1
|
chore
|
release
|
679,913
|
28.02.2018 12:36:10
| 0
|
050a5656d11139f39553ab65532e73b1144f544f
|
docs(hiccup-dom): update initial readme example
|
[
{
"change_type": "MODIFY",
"diff": "@@ -23,32 +23,34 @@ Benefits:\n- Only ~10KB minified\n```typescript\n-import { serialize } from \"@thi.ng/hiccup\";\n-import { start } from \"@thi.ng/hiccup-dom\";\n+import * as hiccup from \"@thi.ng/hiccup\";\n+import * as hdom from \"@thi.ng/hiccup-dom\";\n// stateless component w/ params\nconst greeter = (name) => [\"h1.title\", \"hello \", name];\n// component w/ local state\n-const counter = () => {\n- let i = 0;\n+const counter = (i = 0) => {\nreturn () => [\"button\", { onclick: () => (i++) }, `clicks: ${i}`];\n};\nconst app = () => {\n- // instantiation\n- const counters = [counter(), counter()];\n// root component is just a static array\n- return [\"div#app\", [greeter, \"world\"], ...counters];\n+ // instantiate counters w/ different start offsets\n+ return [\"div#app\", [greeter, \"world\"], counter(), counter(100)];\n};\n-// browser only (see diagram below)\n-start(document.body, app());\n+// start update loop (browser only, see diagram below)\n+hdom.start(document.body, app());\n+\n+// alternatively apply DOM tree only once\n+// (stateful components won't update though)\n+hdom.createDOM(document.body, hdom.normalizeTree(app()));\n-// browser or server side serialization\n-// (note: does not emit event attributes w/ functions as values)\n-serialize(app);\n-// <div id=\"app\"><h1 class=\"title\">hello world</h1><button>clicks: 0</button><button>clicks: 0</button></div>\n+// alternatively browser or server side HTML serialization\n+// (note: does not emit attributes w/ functions as values, i.e. the button \"onclick\" attribs)\n+console.log(hiccup.serialize(app()));\n+// <div id=\"app\"><h1 class=\"title\">hello world</h1><button>clicks: 0</button><button>clicks: 100</button></div>\n```\n[Live demo](http://demo.thi.ng/umbrella/hiccup-dom/basics/) | [standalone example](../../examples/hdom-basics)\n",
"new_path": "packages/hiccup-dom/README.md",
"old_path": "packages/hiccup-dom/README.md"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs(hiccup-dom): update initial readme example
| 1
|
docs
|
hiccup-dom
|
679,913
|
28.02.2018 13:24:20
| 0
|
ca17389c026fe6dc976287a4fb6f7067784e0a44
|
feat(hiccup-dom): add support for function attribs, add docs
update setAttrib & setAttribs()
|
[
{
"change_type": "MODIFY",
"diff": "@@ -111,11 +111,11 @@ function diffAttributes(el: Element, prev: any, curr: any) {\nremoveAttribs(el, delta.dels);\nfor (edits = delta.edits, i = edits.length - 1; i >= 0; i--) {\ne = edits[i];\n- setAttrib(el, e[0], e[1]);\n+ setAttrib(el, e[0], e[1], curr);\n}\nfor (edits = delta.adds, i = edits.length - 1; i >= 0; i--) {\ne = edits[i];\n- setAttrib(el, e, curr[e]);\n+ setAttrib(el, e, curr[e], curr);\n}\n}\n",
"new_path": "packages/hiccup-dom/src/diff.ts",
"old_path": "packages/hiccup-dom/src/diff.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -70,32 +70,55 @@ export function cloneWithNewAttribs(el: Element, attribs: any) {\n}\nexport function setAttribs(el: Element, attribs: any) {\n- const keys = Object.keys(attribs);\n- for (let i = keys.length - 1; i >= 0; i--) {\n- const k = keys[i];\n- setAttrib(el, k, attribs[k]);\n+ for (let k in attribs) {\n+ setAttrib(el, k, attribs[k], attribs);\n}\nreturn el;\n}\n-export function setAttrib(el: Element, k: string, v: any) {\n- if (v !== undefined && v !== false) {\n- switch (k) {\n+/**\n+ * Sets a single attribute on given element. If attrib name is NOT\n+ * an event name and its value is a function, it is called with\n+ * given `attribs` object (usually the full attrib object passed\n+ * to `setAttribs`) and the function's return value is used as attrib\n+ * value.\n+ *\n+ * Special rules apply for certain attributes:\n+ *\n+ * - \"style\": see `setStyle()`\n+ * - \"value\": see `updateValueAttrib()`\n+ * - attrib IDs starting with \"on\" are treated as event listeners\n+ *\n+ * If the given (or computed) attrib value is `false` or `undefined`\n+ * the attrib is removed from the element.\n+ *\n+ * @param el\n+ * @param id\n+ * @param val\n+ * @param attribs\n+ */\n+export function setAttrib(el: Element, id: string, val: any, attribs?: any) {\n+ const isListener = id.indexOf(\"on\") === 0;\n+ if (!isListener && isFunction(val)) {\n+ val = val(attribs);\n+ }\n+ if (val !== undefined && val !== false) {\n+ switch (id) {\ncase \"style\":\n- setStyle(el, v);\n+ setStyle(el, val);\nbreak;\ncase \"value\":\n- updateValueAttrib(<HTMLInputElement>el, v);\n+ updateValueAttrib(<HTMLInputElement>el, val);\nbreak;\ndefault:\n- if (k.indexOf(\"on\") === 0) {\n- el.addEventListener(k.substr(2), v);\n+ if (isListener) {\n+ el.addEventListener(id.substr(2), val);\n} else {\n- el.setAttribute(k, v);\n+ el.setAttribute(id, val);\n}\n}\n} else {\n- el.removeAttribute(k);\n+ el.removeAttribute(id);\n}\nreturn el;\n}\n@@ -114,12 +137,11 @@ export function updateValueAttrib(el: HTMLInputElement, v: any) {\nconst off = v.length - (e.value.length - e.selectionStart);\ne.value = v;\ne.selectionStart = e.selectionEnd = off;\n- return;\n}\ndefault:\n- }\nel.value = v;\n}\n+}\nexport function removeAttribs(el: Element, attribs: string[]) {\nfor (let i = attribs.length - 1; i >= 0; i--) {\n",
"new_path": "packages/hiccup-dom/src/dom.ts",
"old_path": "packages/hiccup-dom/src/dom.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(hiccup-dom): add support for function attribs, add docs
- update setAttrib & setAttribs()
| 1
|
feat
|
hiccup-dom
|
791,690
|
28.02.2018 15:42:24
| 28,800
|
662b387b8e89296d9f988333313b4394f8721eb9
|
misc(typecheck): add dependency graph to tsc
|
[
{
"change_type": "MODIFY",
"diff": "@@ -9,8 +9,8 @@ const Node = require('./node');\nclass CPUNode extends Node {\n/**\n- * @param {!TraceEvent} parentEvent\n- * @param {!Array<TraceEvent>=} childEvents\n+ * @param {LH.TraceEvent} parentEvent\n+ * @param {LH.TraceEvent[]=} childEvents\n*/\nconstructor(parentEvent, childEvents = []) {\nconst nodeId = `${parentEvent.tid}.${parentEvent.ts}`;\n@@ -42,14 +42,14 @@ class CPUNode extends Node {\n}\n/**\n- * @return {!TraceEvent}\n+ * @return {LH.TraceEvent}\n*/\nget event() {\nreturn this._event;\n}\n/**\n- * @return {!TraceEvent}\n+ * @return {LH.TraceEvent[]}\n*/\nget childEvents() {\nreturn this._childEvents;\n@@ -65,7 +65,7 @@ class CPUNode extends Node {\n/**\n* Returns true if this node contains the EvaluateScript task for a URL in the given set.\n- * @param {!Set<string>} urls\n+ * @param {Set<string>} urls\n* @return {boolean}\n*/\nisEvaluateScriptFor(urls) {\n@@ -77,7 +77,7 @@ class CPUNode extends Node {\n}\n/**\n- * @return {!CPUNode}\n+ * @return {CPUNode}\n*/\ncloneWithoutRelationships() {\nreturn new CPUNode(this._event, this._childEvents);\n",
"new_path": "lighthouse-core/lib/dependency-graph/cpu-node.js",
"old_path": "lighthouse-core/lib/dependency-graph/cpu-node.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -10,7 +10,7 @@ const WebInspector = require('../web-inspector');\nclass NetworkNode extends Node {\n/**\n- * @param {!WebInspector.NetworkRequest} networkRecord\n+ * @param {LH.NetworkRequest} networkRecord\n*/\nconstructor(networkRecord) {\nsuper(networkRecord.requestId);\n@@ -39,7 +39,7 @@ class NetworkNode extends Node {\n}\n/**\n- * @return {!WebInspector.NetworkRequest}\n+ * @return {LH.NetworkRequest}\n*/\nget record() {\n// Ensure that the record has an origin value\n@@ -69,7 +69,7 @@ class NetworkNode extends Node {\n}\n/**\n- * @return {!NetworkNode}\n+ * @return {NetworkNode}\n*/\ncloneWithoutRelationships() {\nreturn new NetworkNode(this._record);\n",
"new_path": "lighthouse-core/lib/dependency-graph/network-node.js",
"old_path": "lighthouse-core/lib/dependency-graph/network-node.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -23,7 +23,9 @@ class Node {\n*/\nconstructor(id) {\nthis._id = id;\n+ /** @type {Node[]} */\nthis._dependents = [];\n+ /** @type {Node[]} */\nthis._dependencies = [];\n}\n@@ -56,14 +58,14 @@ class Node {\n}\n/**\n- * @return {!Array<!Node>}\n+ * @return {Node[]}\n*/\ngetDependents() {\nreturn this._dependents.slice();\n}\n/**\n- * @return {!Array<!Node>}\n+ * @return {Node[]}\n*/\ngetDependencies() {\nreturn this._dependencies.slice();\n@@ -77,9 +79,10 @@ class Node {\n}\n/**\n- * @return {!Node}\n+ * @return {Node}\n*/\ngetRootNode() {\n+ /** @type {Node} */\nlet rootNode = this;\nwhile (rootNode._dependencies.length) {\nrootNode = rootNode._dependencies[0];\n@@ -89,14 +92,14 @@ class Node {\n}\n/**\n- * @param {!Node}\n+ * @param {Node} node\n*/\naddDependent(node) {\nnode.addDependency(this);\n}\n/**\n- * @param {!Node}\n+ * @param {Node} node\n*/\naddDependency(node) {\nif (this._dependencies.includes(node)) {\n@@ -109,7 +112,7 @@ class Node {\n/**\n* Clones the node's information without adding any dependencies/dependents.\n- * @return {!Node}\n+ * @return {Node}\n*/\ncloneWithoutRelationships() {\nreturn new Node(this.id);\n@@ -120,12 +123,13 @@ class Node {\n* included by the predicate, all nodes along the paths between the two will be included. If the\n* node that was called clone is not included in the resulting filtered graph, the return will be\n* undefined.\n- * @param {function(!Node):boolean=} predicate\n- * @return {!Node|undefined}\n+ * @param {function(Node):boolean=} predicate\n+ * @return {Node|undefined}\n*/\ncloneWithRelationships(predicate) {\nconst rootNode = this.getRootNode();\n+ /** @type {function(Node): boolean} */\nlet shouldIncludeNode = () => true;\nif (predicate) {\nconst idsToInclude = new Set();\n@@ -164,12 +168,15 @@ class Node {\n/**\n* Traverses all paths in the graph, calling iterator on each node visited. Decides which nodes to\n* visit with the getNext function.\n- * @param {function(!Node,!Array<!Node>)} iterator\n- * @param {function(!Node):!Array<!Node>} getNext\n+ * @param {function(Node,Node[])} iterator\n+ * @param {function(Node):Node[]} getNext\n*/\n_traversePaths(iterator, getNext) {\n+ /** @type {Node[][]} */\nconst stack = [[this]];\nwhile (stack.length) {\n+ /** @type {Node[]} */\n+ // @ts-ignore - stack has length so it's guaranteed to have an item\nconst path = stack.shift();\nconst node = path[0];\niterator(node, path);\n@@ -184,8 +191,8 @@ class Node {\n/**\n* Traverses all connected nodes exactly once, calling iterator on each. Decides which nodes to\n* visit with the getNext function.\n- * @param {function(!Node,!Array<!Node>)} iterator\n- * @param {function(!Node):!Array<!Node>=} getNext Defaults to returning the dependents.\n+ * @param {function(Node,Node[])} iterator\n+ * @param {function(Node):Node[]} [getNext] Defaults to returning the dependents.\n*/\ntraverse(iterator, getNext) {\nif (!getNext) {\n@@ -208,11 +215,12 @@ class Node {\n/**\n* Returns whether the given node has a cycle in its dependent graph by performing a DFS.\n- * @param {!Node} node\n+ * @param {Node} node\n* @return {boolean}\n*/\nstatic hasCycle(node) {\nconst visited = new Set();\n+ /** @type {Node[]} */\nconst currentPath = [];\nconst toVisit = [node];\nconst depthAdded = new Map([[node, 0]]);\n@@ -220,6 +228,8 @@ class Node {\n// Keep going while we have nodes to visit in the stack\nwhile (toVisit.length) {\n// Get the last node in the stack (DFS uses stack, not queue)\n+ /** @type {Node} */\n+ // @ts-ignore - toVisit has length so it's guaranteed to have an item\nconst currentNode = toVisit.pop();\n// We've hit a cycle if the node we're visiting is in our current dependency path\n@@ -228,6 +238,7 @@ class Node {\nif (visited.has(currentNode)) continue;\n// Since we're visiting this node, clear out any nodes in our path that we had to backtrack\n+ // @ts-ignore\nwhile (currentPath.length > depthAdded.get(currentNode)) currentPath.pop();\n// Update our data structures to reflect that we're adding this node to our path\n",
"new_path": "lighthouse-core/lib/dependency-graph/node.js",
"old_path": "lighthouse-core/lib/dependency-graph/node.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -13,7 +13,7 @@ const TLS_SCHEMES = ['https', 'wss'];\nmodule.exports = class ConnectionPool {\n/**\n- * @param {!Array<!WebInspector.NetworkRequest>} records\n+ * @param {LH.NetworkRequest[]} records\n* @param {Object=} options\n*/\nconstructor(records, options) {\n@@ -32,7 +32,9 @@ module.exports = class ConnectionPool {\n}\nthis._records = records;\n+ /** @type {Map<string, TcpConnection[]>} */\nthis._connectionsByOrigin = new Map();\n+ /** @type {Map<LH.NetworkRequest, TcpConnection>} */\nthis._connectionsByRecord = new Map();\nthis._connectionsInUse = new Set();\nthis._connectionReusedByRequestId = NetworkAnalyzer.estimateIfConnectionWasReused(records, {\n@@ -43,7 +45,7 @@ module.exports = class ConnectionPool {\n}\n/**\n- * @return {!Array<!WebInspector.NetworkRequest>}\n+ * @return {TcpConnection[]}\n*/\nconnectionsInUse() {\nreturn Array.from(this._connectionsInUse);\n@@ -85,16 +87,18 @@ module.exports = class ConnectionPool {\n}\n/**\n- * @param {!WebInspector.NetworkRequest} record\n+ * @param {LH.NetworkRequest} record\n* @return {?TcpConnection}\n*/\nacquire(record) {\nif (this._connectionsByRecord.has(record)) {\n+ // @ts-ignore\nreturn this._connectionsByRecord.get(record);\n}\n- const origin = record.origin;\n- const connections = this._connectionsByOrigin.get(origin);\n+ const origin = String(record.origin);\n+ /** @type {TcpConnection[]} */\n+ const connections = this._connectionsByOrigin.get(origin) || [];\nconst wasConnectionWarm = !!this._connectionReusedByRequestId.get(record.requestId);\nconst connection = connections.find(connection => {\nconst meetsWarmRequirement = wasConnectionWarm === connection.isWarm();\n@@ -108,7 +112,7 @@ module.exports = class ConnectionPool {\n}\n/**\n- * @param {!WebInspector.NetworkRequest} record\n+ * @param {LH.NetworkRequest} record\n*/\nrelease(record) {\nconst connection = this._connectionsByRecord.get(record);\n",
"new_path": "lighthouse-core/lib/dependency-graph/simulator/connection-pool.js",
"old_path": "lighthouse-core/lib/dependency-graph/simulator/connection-pool.js"
},
{
"change_type": "MODIFY",
"diff": "const INITIAL_CWD = 14 * 1024;\nmodule.exports = class NetworkAnalyzer {\n+ /**\n+ * @return {string}\n+ */\n+ static get SUMMARY() {\n+ return '__SUMMARY__';\n+ }\n+\n+ /**\n+ * @param {LH.NetworkRequest[]} records\n+ * @return {Map<string, LH.NetworkRequest[]>}\n+ */\nstatic groupByOrigin(records) {\nconst grouped = new Map();\nrecords.forEach(item => {\n@@ -20,22 +31,10 @@ module.exports = class NetworkAnalyzer {\n}\n/**\n- * @param {!Array<number>} values\n- * @return {!NetworkAnalyzer.Summary}\n+ * @param {number[]} values\n+ * @return {NetworkAnalyzer.Summary}\n*/\n- static summary(values) {\n- if (values instanceof Map) {\n- const summaryByKey = new Map();\n- const allEstimates = [];\n- for (const [key, estimates] of values) {\n- summaryByKey.set(key, NetworkAnalyzer.summary(estimates));\n- allEstimates.push(...estimates);\n- }\n-\n- summaryByKey.set(NetworkAnalyzer.SUMMARY, NetworkAnalyzer.summary(allEstimates));\n- return summaryByKey;\n- }\n-\n+ static getSummary(values) {\nvalues.sort((a, b) => a - b);\nreturn {\n@@ -47,9 +46,25 @@ module.exports = class NetworkAnalyzer {\n}\n/**\n- * @param {!Array<WebInspector.NetworkRequest>} records\n- * @param {function():void} iteratee\n- * @return {!Map<string, !Array<number>>}\n+ * @param {Map<string,number[]>} values\n+ * @return {Map<string, NetworkAnalyzer.Summary>}\n+ */\n+ static summarize(values) {\n+ const summaryByKey = new Map();\n+ const allEstimates = [];\n+ for (const [key, estimates] of values) {\n+ summaryByKey.set(key, NetworkAnalyzer.getSummary(estimates));\n+ allEstimates.push(...estimates);\n+ }\n+\n+ summaryByKey.set(NetworkAnalyzer.SUMMARY, NetworkAnalyzer.getSummary(allEstimates));\n+ return summaryByKey;\n+ }\n+\n+ /**\n+ * @param {LH.NetworkRequest[]} records\n+ * @param {function(any):any} iteratee\n+ * @return {Map<string, number[]>}\n*/\nstatic _estimateValueByOrigin(records, iteratee) {\nconst connectionWasReused = NetworkAnalyzer.estimateIfConnectionWasReused(records);\n@@ -57,6 +72,7 @@ module.exports = class NetworkAnalyzer {\nconst estimates = new Map();\nfor (const [origin, originRecords] of groupedByOrigin.entries()) {\n+ /** @type {number[]} */\nlet originEstimates = [];\nfor (const record of originRecords) {\n@@ -84,8 +100,8 @@ module.exports = class NetworkAnalyzer {\n* Estimates the observed RTT to each origin based on how long the TCP handshake took.\n* This is the most accurate and preferred method of measurement when the data is available.\n*\n- * @param {!Array<WebInspector.NetworkRequest>} records\n- * @return {!Map<string, !Array<number>>}\n+ * @param {LH.NetworkRequest[]} records\n+ * @return {Map<string, number[]>}\n*/\nstatic _estimateRTTByOriginViaTCPTiming(records) {\nreturn NetworkAnalyzer._estimateValueByOrigin(records, ({timing, connectionReused}) => {\n@@ -106,8 +122,8 @@ module.exports = class NetworkAnalyzer {\n* NOTE: this will tend to overestimate the actual RTT quite significantly as the download can be\n* slow for other reasons as well such as bandwidth constraints.\n*\n- * @param {!Array<WebInspector.NetworkRequest>} records\n- * @return {!Map<string, !Array<number>>}\n+ * @param {LH.NetworkRequest[]} records\n+ * @return {Map<string, number[]>}\n*/\nstatic _estimateRTTByOriginViaDownloadTiming(records) {\nreturn NetworkAnalyzer._estimateValueByOrigin(records, ({record, timing, connectionReused}) => {\n@@ -134,8 +150,8 @@ module.exports = class NetworkAnalyzer {\n* NOTE: this will tend to overestimate the actual RTT as the request can be delayed for other\n* reasons as well such as DNS lookup.\n*\n- * @param {!Array<WebInspector.NetworkRequest>} records\n- * @return {!Map<string, !Array<number>>}\n+ * @param {LH.NetworkRequest[]} records\n+ * @return {Map<string, number[]>}\n*/\nstatic _estimateRTTByOriginViaSendStartTiming(records) {\nreturn NetworkAnalyzer._estimateValueByOrigin(records, ({record, timing, connectionReused}) => {\n@@ -153,9 +169,9 @@ module.exports = class NetworkAnalyzer {\n/**\n* Given the RTT to each origin, estimates the observed server response times.\n*\n- * @param {!Array<WebInspector.NetworkRequest>} records\n- * @param {!Map<string, number>} rttByOrigin\n- * @return {!Map<string, !Array<number>>}\n+ * @param {LH.NetworkRequest[]} records\n+ * @param {Map<string, number>} rttByOrigin\n+ * @return {Map<string, number[]>}\n*/\nstatic _estimateResponseTimeByOrigin(records, rttByOrigin) {\nreturn NetworkAnalyzer._estimateValueByOrigin(records, ({record, timing}) => {\n@@ -164,7 +180,7 @@ module.exports = class NetworkAnalyzer {\nconst ttfb = timing.receiveHeadersEnd - timing.sendEnd;\nconst origin = record.origin;\n- const rtt = rttByOrigin.get(origin) || rttByOrigin.get(NetworkAnalyzer.SUMMARY);\n+ const rtt = rttByOrigin.get(origin) || rttByOrigin.get(NetworkAnalyzer.SUMMARY) || 0;\nreturn Math.max(ttfb - rtt, 0);\n});\n}\n@@ -173,8 +189,9 @@ module.exports = class NetworkAnalyzer {\n* Returns a map of requestId -> connectionReused, estimating the information if the information\n* available in the records themselves appears untrustworthy.\n*\n- * @param {!WebInspector.NetworkRequest} records\n- * @return {!Map<string, boolean>}\n+ * @param {LH.NetworkRequest[]} records\n+ * @param {object} [options]\n+ * @return {Map<string, boolean>}\n*/\nstatic estimateIfConnectionWasReused(records, options) {\noptions = Object.assign({forceCoarseEstimates: false}, options);\n@@ -182,6 +199,7 @@ module.exports = class NetworkAnalyzer {\nconst connectionIds = new Set(records.map(record => record.connectionId));\n// If the records actually have distinct connectionIds we can reuse these.\nif (!options.forceCoarseEstimates && connectionIds.size > 1) {\n+ // @ts-ignore\nreturn new Map(records.map(record => [record.requestId, !!record.connectionReused]));\n}\n@@ -217,9 +235,9 @@ module.exports = class NetworkAnalyzer {\n* Attempts to use the most accurate information first and falls back to coarser estimates when it\n* is unavailable.\n*\n- * @param {!Array<WebInspector.NetworkRequest>} records\n- * @param {Object=} options\n- * @return {!Map<string, !NetworkAnalyzer.Summary>}\n+ * @param {LH.NetworkRequest[]} records\n+ * @param {object} [options]\n+ * @return {Map<string, !NetworkAnalyzer.Summary>}\n*/\nstatic estimateRTTByOrigin(records, options) {\noptions = Object.assign(\n@@ -238,10 +256,7 @@ module.exports = class NetworkAnalyzer {\nif (!estimatesByOrigin.size || options.forceCoarseEstimates) {\nestimatesByOrigin = new Map();\nconst estimatesViaDownload = NetworkAnalyzer._estimateRTTByOriginViaDownloadTiming(records);\n- const estimatesViaSendStart = NetworkAnalyzer._estimateRTTByOriginViaSendStartTiming(\n- records,\n- options.estimateResponseTime\n- );\n+ const estimatesViaSendStart = NetworkAnalyzer._estimateRTTByOriginViaSendStartTiming(records);\nfor (const [origin, estimates] of estimatesViaDownload.entries()) {\nestimatesByOrigin.set(origin, estimates);\n@@ -258,16 +273,16 @@ module.exports = class NetworkAnalyzer {\n}\nif (!estimatesByOrigin.size) throw new Error('No timing information available');\n- return NetworkAnalyzer.summary(estimatesByOrigin);\n+ return NetworkAnalyzer.summarize(estimatesByOrigin);\n}\n/**\n* Estimates the server response time of each origin. RTT times can be passed in or will be\n* estimated automatically if not provided.\n*\n- * @param {!Array<WebInspector.NetworkRequest>} records\n+ * @param {LH.NetworkRequest[]} records\n* @param {Object=} options\n- * @return {!Map<string, !NetworkAnalyzer.Summary>}\n+ * @return {Map<string, !NetworkAnalyzer.Summary>}\n*/\nstatic estimateServerResponseTimeByOrigin(records, options) {\noptions = Object.assign(\n@@ -286,7 +301,7 @@ module.exports = class NetworkAnalyzer {\n}\nconst estimatesByOrigin = NetworkAnalyzer._estimateResponseTimeByOrigin(records, rttByOrigin);\n- return NetworkAnalyzer.summary(estimatesByOrigin);\n+ return NetworkAnalyzer.summarize(estimatesByOrigin);\n}\n};\n@@ -297,5 +312,3 @@ module.exports = class NetworkAnalyzer {\n* @property {number} avg\n* @property {number} median\n*/\n-\n-module.exports.SUMMARY = Symbol('__SUMMARY__');\n",
"new_path": "lighthouse-core/lib/dependency-graph/simulator/network-analyzer.js",
"old_path": "lighthouse-core/lib/dependency-graph/simulator/network-analyzer.js"
},
{
"change_type": "MODIFY",
"diff": "'use strict';\nconst Node = require('../node');\n+const NetworkNode = require('../network-node'); // eslint-disable-line no-unused-vars\n+const CpuNode = require('../cpu-node'); // eslint-disable-line no-unused-vars\nconst TcpConnection = require('./tcp-connection');\nconst ConnectionPool = require('./connection-pool');\nconst emulation = require('../../emulation').settings;\n@@ -33,9 +35,8 @@ const NodeState = {\nclass Simulator {\n/**\n- * @param {!Node} graph\n- * @param {{rtt: number, throughput: number, fallbackTTFB: number,\n- * maximumConcurrentRequests: number}=} options\n+ * @param {Node} graph\n+ * @param {SimulationOptions} [options]\n*/\nconstructor(graph, options) {\nthis._graph = graph;\n@@ -58,16 +59,23 @@ class Simulator {\n);\nthis._cpuTaskMultiplier = this._options.cpuTaskMultiplier;\nthis._layoutTaskMultiplier = this._options.layoutTaskMultiplier;\n+\n+ this._nodeTiming = new Map();\n+ this._numberInProgressByType = new Map();\n+ this._nodes = {};\n+ // @ts-ignore\n+ this._connectionPool = /** @type {ConnectionPool} */ (null);\n}\n/**\n*\n*/\n_initializeConnectionPool() {\n+ /** @type {LH.NetworkRequest[]} */\nconst records = [];\nthis._graph.getRootNode().traverse(node => {\nif (node.type === Node.TYPES.NETWORK) {\n- records.push(node.record);\n+ records.push((/** @type {NetworkNode} */ (node)).record);\n}\n});\n@@ -81,7 +89,7 @@ class Simulator {\nthis._nodeTiming = new Map();\nthis._numberInProgressByType = new Map();\n- this._nodes = [];\n+ this._nodes = {};\nfor (const key of Object.keys(NodeState)) {\nthis._nodes[NodeState[key]] = new Set();\n}\n@@ -96,8 +104,8 @@ class Simulator {\n}\n/**\n- * @param {!Node} node\n- * @param {!NodeTimingData} values\n+ * @param {Node} node\n+ * @param {NodeTimingData} values\n*/\n_setTimingData(node, values) {\nconst timingData = this._nodeTiming.get(node) || {};\n@@ -106,7 +114,7 @@ class Simulator {\n}\n/**\n- * @param {!Node} node\n+ * @param {Node} node\n* @param {number} queuedTime\n*/\n_markNodeAsReadyToStart(node, queuedTime) {\n@@ -116,7 +124,7 @@ class Simulator {\n}\n/**\n- * @param {!Node} node\n+ * @param {Node} node\n* @param {number} startTime\n*/\n_markNodeAsInProgress(node, startTime) {\n@@ -127,7 +135,7 @@ class Simulator {\n}\n/**\n- * @param {!Node} node\n+ * @param {Node} node\n* @param {number} endTime\n*/\n_markNodeAsComplete(node, endTime) {\n@@ -148,7 +156,7 @@ class Simulator {\n}\n/**\n- * @param {!Node} node\n+ * @param {Node} node\n* @param {number} totalElapsedTime\n*/\n_startNodeIfPossible(node, totalElapsedTime) {\n@@ -167,7 +175,7 @@ class Simulator {\n// Start a network request if we're not at max requests and a connection is available\nconst numberOfActiveRequests = this._numberInProgress(node.type);\nif (numberOfActiveRequests >= this._maximumConcurrentRequests) return;\n- const connection = this._connectionPool.acquire(node.record);\n+ const connection = this._connectionPool.acquire((/** @type {NetworkNode} */ (node)).record);\nif (!connection) return;\nthis._markNodeAsInProgress(node, totalElapsedTime);\n@@ -190,17 +198,17 @@ class Simulator {\n/**\n* Estimates the number of milliseconds remaining given current condidtions before the node is complete.\n- * @param {!Node} node\n+ * @param {Node} node\n* @return {number}\n*/\n_estimateTimeRemaining(node) {\nif (node.type === Node.TYPES.CPU) {\nconst timingData = this._nodeTiming.get(node);\n- const multiplier = node.didPerformLayout()\n+ const multiplier = (/** @type {CpuNode} */ (node)).didPerformLayout()\n? this._layoutTaskMultiplier\n: this._cpuTaskMultiplier;\nconst totalDuration = Math.min(\n- Math.round(node.event.dur / 1000 * multiplier),\n+ Math.round((/** @type {CpuNode} */ (node)).event.dur / 1000 * multiplier),\nDEFAULT_MAXIMUM_CPU_TASK_DURATION\n);\nconst estimatedTimeElapsed = totalDuration - timingData.timeElapsed;\n@@ -210,11 +218,12 @@ class Simulator {\nif (node.type !== Node.TYPES.NETWORK) throw new Error('Unsupported');\n+ const record = (/** @type {NetworkNode} */ (node)).record;\nconst timingData = this._nodeTiming.get(node);\n- const connection = this._connectionPool.acquire(node.record);\n+ const connection = /** @type {TcpConnection} */ (this._connectionPool.acquire(record));\nconst calculation = connection.simulateDownloadUntil(\n- node.record.transferSize - timingData.bytesDownloaded,\n- {timeAlreadyElapsed: timingData.timeElapsed}\n+ record.transferSize - timingData.bytesDownloaded,\n+ {timeAlreadyElapsed: timingData.timeElapsed, maximumTimeToElapse: Infinity}\n);\nconst estimatedTimeElapsed = calculation.timeElapsed + timingData.timeElapsedOvershoot;\n@@ -237,7 +246,7 @@ class Simulator {\n/**\n* Given a time period, computes the progress toward completion that the node made durin that time.\n- * @param {!Node} node\n+ * @param {Node} node\n* @param {number} timePeriodLength\n* @param {number} totalElapsedTime\n*/\n@@ -253,9 +262,10 @@ class Simulator {\nif (node.type !== Node.TYPES.NETWORK) throw new Error('Unsupported');\n- const connection = this._connectionPool.acquire(node.record);\n+ const record = (/** @type {NetworkNode} */ (node)).record;\n+ const connection = /** @type {TcpConnection} */ (this._connectionPool.acquire(record));\nconst calculation = connection.simulateDownloadUntil(\n- node.record.transferSize - timingData.bytesDownloaded,\n+ record.transferSize - timingData.bytesDownloaded,\n{\ntimeAlreadyElapsed: timingData.timeElapsed,\nmaximumTimeToElapse: timePeriodLength - timingData.timeElapsedOvershoot,\n@@ -267,7 +277,7 @@ class Simulator {\nif (isFinished) {\nconnection.setWarmed(true);\n- this._connectionPool.release(node.record);\n+ this._connectionPool.release(record);\nthis._markNodeAsComplete(node, totalElapsedTime);\n} else {\ntimingData.timeElapsed += calculation.timeElapsed;\n@@ -278,7 +288,7 @@ class Simulator {\n/**\n* Estimates the time taken to process all of the graph's nodes.\n- * @return {{timeInMs: number, nodeTiming: !Map<!Node, !NodeTimingData>}}\n+ * @return {{timeInMs: number, nodeTiming: Map<Node, NodeTimingData>}}\n*/\nsimulate() {\n// initialize the necessary data containers\n@@ -334,11 +344,23 @@ class Simulator {\nmodule.exports = Simulator;\n/**\n- * @typedef {{\n- * estimatedTimeElapsed: number|undefined,\n- * timeElapsed: number|undefined,\n- * timeElapsedOvershoot: number|undefined,\n- * bytesDownloaded: number|undefined,\n- * }}\n+ * @typedef NodeTimingData\n+ * @property {number} [startTime]\n+ * @property {number} [endTime]\n+ * @property {number} [queuedTime]\n+ * @property {number} [estimatedTimeElapsed]\n+ * @property {number} [timeElapsed]\n+ * @property {number} [timeElapsedOvershoot]\n+ * @property {number} [bytesDownloaded]\n*/\n-Simulator.NodeTimingData; // eslint-disable-line no-unused-expressions\n+\n+/**\n+ * @typedef SimulationOptions\n+ * @property {number} [rtt]\n+ * @property {number} [throughput]\n+ * @property {number} [fallbackTTFB]\n+ * @property {number} [maximumConcurrentRequests]\n+ * @property {number} [cpuTaskMultiplier]\n+ * @property {number} [layoutTaskMultiplier]\n+ */\n+\n",
"new_path": "lighthouse-core/lib/dependency-graph/simulator/simulator.js",
"old_path": "lighthouse-core/lib/dependency-graph/simulator/simulator.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -96,8 +96,8 @@ class TcpConnection {\n* https://hpbn.co/transport-layer-security-tls/#tls-handshake for details.\n*\n* @param {number} bytesToDownload\n- * @param {{timeAlreadyElapsed: number, maximumTimeToElapse}=} options\n- * @return {{timeElapsed: number, roundTrips: number, bytesDownloaded: number, congestionWindow: number}}\n+ * @param {DownloadOptions} [options]\n+ * @return {DownloadResults}\n*/\nsimulateDownloadUntil(bytesToDownload, options) {\nconst {timeAlreadyElapsed = 0, maximumTimeToElapse = Infinity} = options || {};\n@@ -164,3 +164,18 @@ class TcpConnection {\n}\nmodule.exports = TcpConnection;\n+\n+/**\n+ * @typedef DownloadOptions\n+ * @property {number} [timeAlreadyElapsed]\n+ * @property {number} [maximumTimeToElapse]\n+ */\n+\n+/**\n+ * @typedef DownloadResults\n+ * @property {number} roundTrips\n+ * @property {number} timeElapsed\n+ * @property {number} bytesDownloaded\n+ * @property {number} extraBytesDownloaded\n+ * @property {number} congestionWindow\n+ */\n",
"new_path": "lighthouse-core/lib/dependency-graph/simulator/tcp-connection.js",
"old_path": "lighthouse-core/lib/dependency-graph/simulator/tcp-connection.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -30,7 +30,7 @@ class LighthouseError extends Error {\n}\n/**\n- * @param {!LH.LighthouseError} err\n+ * @param {LH.LighthouseError} err\n*/\nstatic isPageLoadError(err) {\nreturn err.code === ERRORS.NO_DOCUMENT_REQUEST.code ||\n",
"new_path": "lighthouse-core/lib/errors.js",
"old_path": "lighthouse-core/lib/errors.js"
},
{
"change_type": "MODIFY",
"diff": "},\n\"include\": [\n\"lighthouse-cli/**/*.js\",\n+ \"lighthouse-core/lib/dependency-graph/**/*.js\",\n\"./typings/externs.d.ts\"\n],\n\"exclude\": [\n",
"new_path": "tsconfig.json",
"old_path": "tsconfig.json"
},
{
"change_type": "MODIFY",
"diff": "* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n*/\n-export as namespace LH\n+export as namespace LH;\nexport interface Flags {\n_: string[];\n@@ -31,9 +31,7 @@ export interface Flags {\nquiet: boolean;\n}\n-export interface Config {\n-\n-}\n+export interface Config {}\nexport interface AuditResult {\nrawValue: boolean | number;\n@@ -41,11 +39,11 @@ export interface AuditResult {\ndebugString?: string;\nscore?: boolean | number;\noptimalValue: number | string;\n- extendedInfo?: {value: string;};\n+ extendedInfo?: {value: string};\n}\nexport interface AuditResults {\n- [metric: string]: AuditResult\n+ [metric: string]: AuditResult;\n}\nexport interface AuditFullResult {\n@@ -62,7 +60,7 @@ export interface AuditFullResult {\n}\nexport interface AuditFullResults {\n- [metric: string]: AuditFullResult\n+ [metric: string]: AuditFullResult;\n}\nexport interface Results {\n@@ -84,3 +82,51 @@ export interface LighthouseError extends Error {\ncode?: string;\nfriendlyMessage?: string;\n}\n+\n+export interface TraceEvent {\n+ name: string;\n+ args: any;\n+ tid: number;\n+ ts: number;\n+ dur: number;\n+}\n+\n+export interface NetworkRequest {\n+ requestId: string;\n+ connectionId: string;\n+ connectionReused: boolean;\n+\n+ url: string;\n+ protocol: string;\n+ origin: string | null;\n+ parsedURL: DevToolsParsedURL;\n+\n+ startTime: number;\n+ endTime: number;\n+\n+ transferSize: number;\n+\n+ _initiator: NetworkRequestInitiator;\n+ _timing: NetworkRequestTiming;\n+ _resourceType: any;\n+ priority(): 'VeryHigh' | 'High' | 'Medium' | 'Low';\n+}\n+\n+export interface NetworkRequestInitiator {\n+ type: 'script' | 'parser';\n+}\n+\n+export interface NetworkRequestTiming {\n+ connectStart: number;\n+ connectEnd: number\n+ sslStart: number;\n+ sslEnd: number;\n+ sendStart: number;\n+ sendEnd: number;\n+ receiveHeadersEnd: number;\n+}\n+\n+export interface DevToolsParsedURL {\n+ scheme: string;\n+ host: string;\n+}\n",
"new_path": "typings/externs.d.ts",
"old_path": "typings/externs.d.ts"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
misc(typecheck): add dependency graph to tsc (#4605)
| 1
|
misc
|
typecheck
|
791,690
|
28.02.2018 16:06:51
| 28,800
|
fb3fbc3df337f9984f54574d054fa9794daf22f8
|
core(network-requests): add network requests audit
|
[
{
"change_type": "MODIFY",
"diff": "@@ -36,6 +36,13 @@ module.exports = [\n// Can be flaky, so test float rawValue instead of boolean score\nrawValue: '<1000',\n},\n+ 'network-requests': {\n+ details: {\n+ items: {\n+ length: '>5',\n+ },\n+ },\n+ },\n'uses-rel-preload': {\nscore: '<100',\nrawValue: '>500',\n",
"new_path": "lighthouse-cli/test/smokehouse/perf/expectations.js",
"old_path": "lighthouse-cli/test/smokehouse/perf/expectations.js"
},
{
"change_type": "ADD",
"diff": "+/**\n+ * @license Copyright 2018 Google Inc. All Rights Reserved.\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n+ */\n+'use strict';\n+\n+const Audit = require('./audit');\n+const URL = require('../lib/url-shim');\n+\n+class NetworkRequests extends Audit {\n+ /**\n+ * @return {!AuditMeta}\n+ */\n+ static get meta() {\n+ return {\n+ name: 'network-requests',\n+ informative: true,\n+ description: 'Network Requests',\n+ helpText: 'Lists the network requests that were made during page load.',\n+ requiredArtifacts: ['devtoolsLogs'],\n+ };\n+ }\n+\n+ /**\n+ * @param {!Artifacts} artifacts\n+ * @return {!AuditResult}\n+ */\n+ static audit(artifacts) {\n+ const devtoolsLog = artifacts.devtoolsLogs[Audit.DEFAULT_PASS];\n+ return artifacts.requestNetworkRecords(devtoolsLog).then(records => {\n+ const earliestStartTime = records.reduce(\n+ (min, record) => Math.min(min, record.startTime),\n+ Infinity\n+ );\n+\n+ const results = records.map(record => {\n+ return {\n+ url: URL.elideDataURI(record.url),\n+ startTime: (record.startTime - earliestStartTime) * 1000,\n+ endTime: (record.endTime - earliestStartTime) * 1000,\n+ transferSize: record.transferSize,\n+ statusCode: record.statusCode,\n+ };\n+ });\n+\n+ const headings = [\n+ {key: 'url', itemType: 'url', text: 'URL'},\n+ {key: 'startTime', itemType: 'ms', granularity: 1, text: 'Start Time'},\n+ {key: 'endTime', itemType: 'ms', granularity: 1, text: 'End Time'},\n+ {\n+ key: 'transferSize',\n+ itemType: 'bytes',\n+ displayUnit: 'kb',\n+ granularity: 1,\n+ text: 'Transfer Size',\n+ },\n+ {key: 'statusCode', itemType: 'text', text: 'Status Code'},\n+ ];\n+\n+ const tableDetails = Audit.makeTableDetails(headings, results);\n+\n+ return {\n+ score: 100,\n+ rawValue: records.length,\n+ extendedInfo: {value: results},\n+ details: tableDetails,\n+ };\n+ });\n+ }\n+}\n+\n+module.exports = NetworkRequests;\n",
"new_path": "lighthouse-core/audits/network-requests.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -101,6 +101,7 @@ module.exports = {\n'bootup-time',\n'uses-rel-preload',\n'font-display',\n+ 'network-requests',\n'manual/pwa-cross-browser',\n'manual/pwa-page-transitions',\n'manual/pwa-each-page-has-url',\n@@ -285,6 +286,7 @@ module.exports = {\n{id: 'uses-long-cache-ttl', weight: 0, group: 'perf-info'},\n{id: 'dom-size', weight: 0, group: 'perf-info'},\n{id: 'critical-request-chains', weight: 0, group: 'perf-info'},\n+ {id: 'network-requests', weight: 0},\n{id: 'user-timings', weight: 0, group: 'perf-info'},\n{id: 'bootup-time', weight: 0, group: 'perf-info'},\n{id: 'screenshot-thumbnails', weight: 0},\n",
"new_path": "lighthouse-core/config/default.js",
"old_path": "lighthouse-core/config/default.js"
},
{
"change_type": "ADD",
"diff": "+/**\n+ * @license Copyright 2018 Google Inc. All Rights Reserved.\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n+ */\n+'use strict';\n+\n+const NetworkRequests = require('../../audits/network-requests');\n+const Runner = require('../../runner.js');\n+const assert = require('assert');\n+\n+const acceptableDevToolsLog = require('../fixtures/traces/progressive-app-m60.devtools.log.json');\n+\n+/* eslint-env mocha */\n+describe('Network requests audit', () => {\n+ it('should return network requests', () => {\n+ const artifacts = Object.assign({\n+ devtoolsLogs: {\n+ [NetworkRequests.DEFAULT_PASS]: acceptableDevToolsLog,\n+ },\n+ }, Runner.instantiateComputedArtifacts());\n+\n+ return NetworkRequests.audit(artifacts).then(output => {\n+ assert.equal(output.score, 100);\n+ assert.equal(output.rawValue, 66);\n+ assert.equal(output.details.items.length, 66);\n+ assert.equal(output.extendedInfo.value[0].url, 'https://pwa.rocks/');\n+ assert.equal(output.extendedInfo.value[0].startTime, 0);\n+ assert.equal(output.extendedInfo.value[0].statusCode, 200);\n+ assert.equal(output.extendedInfo.value[0].transferSize, 5368);\n+ });\n+ });\n+});\n",
"new_path": "lighthouse-core/test/audits/network-requests-test.js",
"old_path": null
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
core(network-requests): add network requests audit (#4631)
| 1
|
core
|
network-requests
|
815,746
|
28.02.2018 21:05:08
| -7,200
|
1a254ef0e4126cf033ab7ca1cae8e05746d293ff
|
fix: remove uneeded node removal logic
fixes
|
[
{
"change_type": "MODIFY",
"diff": "@@ -113,7 +113,6 @@ export class NgDropdownPanelComponent implements OnDestroy {\nngOnDestroy() {\nthis._disposeDocumentResizeListener();\nthis._disposeScrollListener();\n- this._elementRef.nativeElement.remove();\n}\nrefresh() {\n",
"new_path": "src/ng-select/ng-dropdown-panel.component.ts",
"old_path": "src/ng-select/ng-dropdown-panel.component.ts"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
fix: remove uneeded node removal logic (#305)
fixes #303
| 1
|
fix
| null |
815,746
|
28.02.2018 21:05:47
| -7,200
|
43b67765409a152d525c87efdd5ef79af23cd90f
|
chore(release): 0.23.3
|
[
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"0.23.3\"></a>\n+## [0.23.3](https://github.com/ng-select/ng-select/compare/v0.23.2...v0.23.3) (2018-02-28)\n+\n+\n+### Bug Fixes\n+\n+* remove uneeded node removal logic ([#305](https://github.com/ng-select/ng-select/issues/305)) ([1a254ef](https://github.com/ng-select/ng-select/commit/1a254ef)), closes [#303](https://github.com/ng-select/ng-select/issues/303)\n+\n+\n+\n<a name=\"0.23.2\"></a>\n## [0.23.2](https://github.com/ng-select/ng-select/compare/v0.23.1...v0.23.2) (2018-02-28)\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"$schema\": \"../node_modules/ng-packagr/package.schema.json\",\n\"name\": \"@ng-select/ng-select\",\n- \"version\": \"0.23.2\",\n+ \"version\": \"0.23.3\",\n\"description\": \"Angular ng-select - All in One UI Select, Multiselect and Autocomplete\",\n\"author\": \"@ng-select/ng-select\",\n\"license\": \"MIT\",\n",
"new_path": "src/package.json",
"old_path": "src/package.json"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
chore(release): 0.23.3
| 1
|
chore
|
release
|
815,746
|
28.02.2018 22:11:22
| -7,200
|
ea6b636efe6bc7ee96d50fdfa4b809ed3d529069
|
feat: disable virtual scroll by default
|
[
{
"change_type": "MODIFY",
"diff": "@@ -119,36 +119,37 @@ map: {\n## API\n| Input | Type | Default | Required | Description |\n| ------------- | ------------- | ------------- | ------------- | ------------- |\n-| [items] | `Array<NgOption>` | `[]` | yes | Items array |\n-| bindLabel | `string` | `label` | no | Object property to use for label. Default `label` |\n+| [addTag] | `boolean | ((term: string) => any | Promise<any>)` | `false` | no | Allows to create custom options. |\n+| addTagText | `string` | `Add item` | no | Set custom text when using tagging |\n+| appendTo | `string` | null | no | Append drodown to body or any other element using css selector |\n| bindValue | `string` | `-` | no | Object property to use for selected model. By default binds to whole object. |\n+| bindLabel | `string` | `label` | no | Object property to use for label. Default `label` |\n+| closeOnSelect | `boolean` | true | no | Whether to close the menu when a value is selected |\n| [clearable] | `boolean` | `true` | no | Allow to clear selected value. Default `true`|\n+| clearAllText | `string` | `Clear all` | no | Set custom text for clear all icon title |\n+| dropdownPosition | `bottom`,`top`,`auto` | `bottom` | no | Set the dropdown position on open |\n+| [items] | `Array<NgOption>` | `[]` | yes | Items array |\n+| loading | `boolean` | `-` | no | You can set the loading state from the outside (e.g. async items loading) |\n+| loadingText | `string` | `Loading...` | no | Set custom text when for loading items |\n| [markFirst] | `boolean` | `true` | no | Marks first item as focused when opening/filtering. Default `true`|\n-| [searchable] | `boolean` | `true` | no | Allow to search for value. Default `true`|\n-| multiple | `boolean` | `false` | no | Allows to select multiple items. |\n| maxSelectedItems | `number` | none | no | When multiple = true, allows to set a limit number of selection. |\n-| [addTag] | `boolean \\| ((term: string) => any \\| Promise<any>)` | `false` | no | Allows to create custom options. |\n-| placeholder | `string` | `-` | no | Placeholder text. |\n+| multiple | `boolean` | `false` | no | Allows to select multiple items. |\n| notFoundText | `string` | `No items found` | no | Set custom text when filter returns empty result |\n-| typeToSearchText | `string` | `Type to search` | no | Set custom text when using Typeahead |\n-| clearAllText | `string` | `Clear all` | no | Set custom text for clear all icon title |\n-| addTagText | `string` | `Add item` | no | Set custom text when using tagging |\n-| loadingText | `string` | `Loading...` | no | Set custom text when for loading items |\n+| placeholder | `string` | `-` | no | Placeholder text. |\n+| [searchable] | `boolean` | `true` | no | Allow to search for value. Default `true`|\n| [typeahead] | `Subject` | `-` | no | Custom autocomplete or filter. |\n-| dropdownPosition | `bottom`,`top`,`auto` | `bottom` | no | Set the dropdown position on open |\n-| appendTo | `string` | null | no | Append drodown to body or any other element using css selector |\n-| loading | `boolean` | `-` | no | you can set the loading state from the outside (e.g. async items loading) |\n-| closeOnSelect | `boolean` | true | no | whether to close the menu when a value is selected |\n+| typeToSearchText | `string` | `Type to search` | no | Set custom text when using Typeahead |\n+| [virtualScroll] | `boolean` | false | no | Enable virtual scroll for better performance when rendering a lot of data |\n| Output | Description |\n| ------------- | ------------- |\n-| (focus) | Fired on select focus |\n+| (add) | Fired when item is selected |\n| (blur) | Fired on select blur |\n| (change) | Fired on selected value change |\n-| (open) | Fired on select dropdown open |\n| (close) | Fired on select dropdown close |\n| (clear) | Fired on clear icon click |\n-| (add) | Fired when item is selected |\n+| (focus) | Fired on select focus |\n+| (open) | Fired on select dropdown open |\n| (remove) | Fired when item is removed |\n| (scrollToEnd) | Fired when scrolled to the end of items. Can be used for loading more items in chunks. |\n",
"new_path": "README.md",
"old_path": "README.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -23,8 +23,21 @@ import { DataService } from '../shared/data.service';\n---html,true\n<ng-select [items]=\"cities2\" [(ngModel)]=\"selectedCity2\" bindLabel=\"name\" bindValue=\"name\">\n<ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\n+ <div *ngIf=\"item.name === 'Kaunas'\">{{item.name}}</div>\n+ <div class=\"card\" *ngIf=\"item.name !== 'Kaunas'\">\n+ <div class=\"card-body\">\n+ <h5 class=\"card-title\" [innerHTML]=\"item.name\" [ngOptionHighlight]=\"search\"></h5>\n+ <h6 class=\"card-subtitle mb-2 text-muted\">Card subtitle</h6>\n+ <p class=\"card-text\">\n<img height=\"15\" width=\"15\" [src]=\"item.avatar\"/>\n- <b [innerHTML]=\"item.name\" [ngOptionHighlight]=\"search\"></b>\n+ Some quick example text to build\n+ </p>\n+ <div *ngIf=\"item.name === 'Pavilnys'\">\n+ <a href=\"#\" class=\"card-link\">Card link</a>\n+ <a href=\"#\" class=\"card-link\">Another link</a>\n+ </div>\n+ </div>\n+ </div>\n</ng-template>\n</ng-select>\n---\n@@ -79,7 +92,8 @@ export class SelectWithTemplatesComponent {\ncities = [\n{id: 1, name: 'Vilnius', avatar: '//www.gravatar.com/avatar/b0d8c6e5ea589e6fc3d3e08afb1873bb?d=retro&r=g&s=30 2x'},\n{id: 2, name: 'Kaunas', avatar: '//www.gravatar.com/avatar/ddac2aa63ce82315b513be9dc93336e5?d=retro&r=g&s=15'},\n- {id: 3, name: 'Pavilnys', avatar: '//www.gravatar.com/avatar/6acb7abf486516ab7fb0a6efa372042b?d=retro&r=g&s=15'}\n+ {id: 3, name: 'Pavilnys', avatar: '//www.gravatar.com/avatar/6acb7abf486516ab7fb0a6efa372042b?d=retro&r=g&s=15'},\n+ {id: 4, name: 'Siauliai', avatar: '//www.gravatar.com/avatar/b0d8c6e5ea589e6fc3d3e08afb1873bb?d=retro&r=g&s=30 2x'},\n];\ncities2 = this.cities.slice();\n",
"new_path": "demo/app/examples/custom-templates.component.ts",
"old_path": "demo/app/examples/custom-templates.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -3,6 +3,7 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms';\nimport { NgOption } from '@ng-select/ng-select';\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\nimport { DataService } from '../shared/data.service';\n+import { NgSelectComponent } from '../../../src/ng-select/ng-select.component';\n@Component({\nselector: 'reactive-forms',\n@@ -75,9 +76,12 @@ import { DataService } from '../shared/data.service';\n<div class=\"form-group\">\n<label for=\"album\">Loading async data</label>\n<ng-select [items]=\"albums\"\n+ #select\nbindLabel=\"title\"\n+ dropdownPosition=\"auto\"\nbindValue=\"id\"\nplaceholder=\"Select album\"\n+ [virtualScroll]=\"true\"\nformControlName=\"album\">\n<ng-template ng-option-tmp let-item=\"item\" let-search=\"searchTerm\">\n<div><span>Title: </span><span [innerHTML]=\"item.title\" [ngOptionHighlight]=\"search\"></span></div>\n@@ -89,6 +93,8 @@ import { DataService } from '../shared/data.service';\n<button class=\"btn btn-secondary btn-sm\" (click)=\"selectFirstAlbum()\">Select first album</button>\n<button class=\"btn btn-secondary btn-sm\" (click)=\"selectAlbumsRange(0, 10)\">Set 0-10 albums</button>\n<button class=\"btn btn-secondary btn-sm\" (click)=\"selectAlbumsRange(10, 20)\">Set 10-20 albums</button>\n+ <button (click)=\"openSelect(select)\" class=\"btn btn-sm btn-secondary\">Open</button>\n+ <button (click)=\"closeSelect(select)\" class=\"btn btn-sm btn-secondary\">Close</button>\n</div>\n<hr>\n@@ -98,6 +104,7 @@ import { DataService } from '../shared/data.service';\nbindLabel=\"title\"\nbindValue=\"thumbnailUrl\"\nplaceholder=\"Select photo\"\n+ [virtualScroll]=\"true\"\nformControlName=\"photo\">\n<ng-template ng-label-tmp let-item=\"item\">\n<img height=\"15\" width=\"15\" [src]=\"item.thumbnailUrl\"/>\n@@ -130,6 +137,7 @@ import { DataService } from '../shared/data.service';\nbindLabel=\"title\"\nbindValue=\"thumbnailUrl\"\nplaceholder=\"Select photo\"\n+ [virtualScroll]=\"true\"\nformControlName=\"photo\">\n<ng-template ng-label-tmp let-item=\"item\">\n<img height=\"15\" width=\"15\" [src]=\"item.thumbnailUrl\"/>\n@@ -193,6 +201,14 @@ export class ReactiveFormsComponent {\n});\n}\n+ openSelect(select: NgSelectComponent) {\n+ select.open();\n+ }\n+\n+ closeSelect(select: NgSelectComponent) {\n+ select.close();\n+ }\n+\ntoggleAgeDisable() {\nif (this.heroForm.controls.age.disabled) {\nthis.heroForm.controls.age.enable();\n",
"new_path": "demo/app/examples/reactive-forms.component.ts",
"old_path": "demo/app/examples/reactive-forms.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -11,6 +11,8 @@ import { HttpClient } from '@angular/common/http';\n</p>\n---html,true\n<ng-select [items]=\"photosBuffer\"\n+ [virtualScroll]=\"true\"\n+ [loading]=\"loading\"\nbindLabel=\"title\"\nbindValue=\"thumbnailUrl\"\nplaceholder=\"Select photo\"\n@@ -30,6 +32,7 @@ export class VirtualScrollComponent {\nphotos = [];\nphotosBuffer = [];\nbufferSize = 50;\n+ loading = false;\nconstructor(private http: HttpClient) {}\n@@ -40,11 +43,14 @@ export class VirtualScrollComponent {\n});\n}\n- fetchMore($event: {start: number; end: number}) {\n+ fetchMore() {\nconst len = this.photosBuffer.length;\n- if ($event.end === len) {\nconst more = this.photos.slice(len, this.bufferSize + len);\n+ this.loading = true;\n+ // using timeout here to simulate backend API delay\n+ setTimeout(() => {\n+ this.loading = false;\nthis.photosBuffer = this.photosBuffer.concat(more);\n- }\n+ }, 200)\n}\n}\n",
"new_path": "demo/app/examples/virtual-scroll.component.ts",
"old_path": "demo/app/examples/virtual-scroll.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -118,11 +118,10 @@ export class ItemsList {\nthis._markedIndex = this._filteredItems.indexOf(item);\n}\n- markSelectedOrDefault(markDefault: boolean) {\n+ markSelectedOrDefault(markDefault?: boolean) {\nif (this._filteredItems.length === 0) {\nreturn;\n}\n-\nconst indexOfLastSelected = this._filteredItems.indexOf(this._lastSelectedItem);\nif (this._lastSelectedItem && indexOfLastSelected > -1) {\nthis._markedIndex = indexOfLastSelected;\n",
"new_path": "src/ng-select/items-list.ts",
"old_path": "src/ng-select/items-list.ts"
},
{
"change_type": "DELETE",
"diff": "-import { Component, Injectable, ViewChild, ErrorHandler, NgZone } from '@angular/core';\n-import { ComponentFixture, TestBed, async } from '@angular/core/testing';\n-import { NgDropdownPanelComponent } from './ng-dropdown-panel.component';\n-import { NgSelectComponent } from './ng-select.component';\n-import { WindowService } from './window.service';\n-import { VirtualScrollService } from './virtual-scroll.service';\n-import { ItemsList } from './items-list';\n-import { MockNgZone, MockNgWindow } from '../testing/mocks';\n-import { TestsErrorHandler } from '../testing/helpers';\n-\n-@Component({\n- template: `\n- <ng-dropdown-panel *ngIf=\"isOpen\"\n- class=\"ng-dropdown-panel\"\n- [items]=\"itemsList.filteredItems\"\n- (update)=\"viewPortItems = $event\">\n- <div class=\"ng-option\" *ngFor=\"let item of viewPortItems\">{{item.label}}</div>\n- </ng-dropdown-panel>\n- `\n-})\n-@Injectable()\n-class MockNgSelect {\n- @ViewChild(NgDropdownPanelComponent) dropdownPanel: NgDropdownPanelComponent;\n- itemsList = new ItemsList(<any>this);\n- viewPortItems = [];\n- isOpen = true;\n-}\n-\n-describe('NgDropdowPanel', function () {\n- let fixture: ComponentFixture<MockNgSelect>;\n-\n- beforeEach(() => {\n- fixture = TestBed.configureTestingModule({\n- providers: [\n- VirtualScrollService,\n- { provide: ErrorHandler, useClass: TestsErrorHandler },\n- { provide: NgZone, useFactory: () => new MockNgZone() },\n- { provide: WindowService, useFactory: () => new MockNgWindow() },\n- { provide: NgSelectComponent, useClass: MockNgSelect },\n- ],\n- declarations: [\n- NgDropdownPanelComponent,\n- MockNgSelect\n- ]\n- }).createComponent(MockNgSelect);\n-\n- fixture.detectChanges();\n- });\n-\n- it('should render items', async(() => {\n- fixture.componentInstance.itemsList.setItems(['A', 'B', 'C'], true);\n- fixture.detectChanges();\n-\n- fixture.whenStable().then(() => {\n- expect(fixture.componentInstance.dropdownPanel.items.length).toBe(3);\n- const options = fixture.debugElement.nativeElement.querySelectorAll('.ng-option');\n- expect(options.length).toBe(3);\n- expect(options[0].innerText).toBe('A');\n- expect(options[1].innerText).toBe('B');\n- expect(options[2].innerText).toBe('C');\n- });\n- }));\n-\n- it('should not render items when items length is zero', async(() => {\n- fixture.componentInstance.itemsList.setItems([]);\n- fixture.detectChanges();\n-\n- fixture.whenStable().then(() => {\n- expect(fixture.componentInstance.dropdownPanel.items.length).toBe(0);\n- const options = fixture.debugElement.nativeElement.querySelectorAll('.ng-option');\n- expect(options.length).toBe(0);\n- });\n- }));\n-\n-});\n-\n",
"new_path": null,
"old_path": "src/ng-select/ng-dropdown-panel.component.spec.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -31,8 +31,8 @@ import { VirtualScrollService } from './virtual-scroll.service';\n<ng-container [ngTemplateOutlet]=\"headerTemplate\"></ng-container>\n</div>\n<div #scroll class=\"ng-dropdown-panel-items scroll-host\">\n- <div #padding class=\"total-padding\"></div>\n- <div #content [class.scrollable-content]=\"items.length > 0\">\n+ <div #padding [class.total-padding]=\"virtualScroll\"></div>\n+ <div #content [class.scrollable-content]=\"virtualScroll && items.length > 0\">\n<ng-content></ng-content>\n</div>\n</div>\n@@ -52,6 +52,7 @@ export class NgDropdownPanelComponent implements OnDestroy {\n@Input() position: DropdownPosition;\n@Input() appendTo: string;\n@Input() bufferAmount = 4;\n+ @Input() virtualScroll = false;\n@Input() headerTemplate: TemplateRef<any>;\n@Input() footerTemplate: TemplateRef<any>;\n@@ -69,7 +70,7 @@ export class NgDropdownPanelComponent implements OnDestroy {\nprivate _previousStart: number;\nprivate _previousEnd: number;\nprivate _startupLoop = true;\n- private _scrolledToMarked = false;\n+ private _isScrolledToMarked = false;\nprivate _scrollToEndFired = false;\nprivate _itemsList: ItemsList;\nprivate _disposeScrollListener = () => { };\n@@ -117,22 +118,29 @@ export class NgDropdownPanelComponent implements OnDestroy {\nrefresh() {\nthis._zone.runOutsideAngular(() => {\n- this._window.requestAnimationFrame(() => this._calculateItems());\n+ this._window.requestAnimationFrame(() => this._updateItems());\n});\n}\n- scrollInto(item: any) {\n+ scrollInto(item: NgOption) {\nif (!item) {\nreturn;\n}\n- const index: number = (this.items || []).indexOf(item);\n- if (index < 0 || index >= (this.items || []).length) {\n+ const index = this.items.indexOf(item);\n+ if (index < 0 || index >= this.items.length) {\nreturn;\n}\n+\n+ const d = this._calculateDimensions(this.virtualScroll ? 0 : index);\nconst scrollEl: Element = this.scrollElementRef.nativeElement;\n- const d = this._calculateDimensions();\nconst buffer = Math.floor(d.viewHeight / d.childHeight) - 1;\n- scrollEl.scrollTop = (Math.floor(index) * d.childHeight) - (d.childHeight * Math.min(index, buffer));\n+ if (this.virtualScroll) {\n+ scrollEl.scrollTop = (index * d.childHeight) - (d.childHeight * Math.min(index, buffer));\n+ } else {\n+ const contentEl: HTMLElement = this.contentElementRef.nativeElement;\n+ const childrenHeight = Array.from(contentEl.children).slice(0, index).reduce((c, n) => c + n.clientHeight, 0);\n+ scrollEl.scrollTop = childrenHeight - (d.childHeight * Math.min(index, buffer));\n+ }\n}\nscrollIntoTag() {\n@@ -143,7 +151,8 @@ export class NgDropdownPanelComponent implements OnDestroy {\nprivate _handleScroll() {\nthis._disposeScrollListener = this._renderer.listen(this.scrollElementRef.nativeElement, 'scroll', () => {\n- this.refresh()\n+ this.refresh();\n+ this._fireScrollToEnd();\n});\n}\n@@ -159,9 +168,18 @@ export class NgDropdownPanelComponent implements OnDestroy {\nthis.refresh();\n}\n- private _calculateItems() {\n+ private _updateItems(): void {\nNgZone.assertNotInAngularZone();\n+ if (!this.virtualScroll) {\n+ this._zone.run(() => {\n+ this.update.emit(this.items.slice());\n+ this._scrollToMarked();\n+ });\n+ return;\n+ }\n+\n+ const loop = () => {\nconst d = this._calculateDimensions();\nconst res = this._virtualScrollService.calculateItems(d, this.scrollElementRef.nativeElement, this.bufferAmount || 0);\n@@ -172,29 +190,44 @@ export class NgDropdownPanelComponent implements OnDestroy {\nif (res.start !== this._previousStart || res.end !== this._previousEnd) {\nthis._zone.run(() => {\nthis.update.emit(this.items.slice(res.start, res.end));\n-\n- if (res.end === this.items.length && !this._scrollToEndFired) {\n- this._scrollToEndFired = true;\n- this.scrollToEnd.emit({ start: res.start, end: res.end });\n- }\n-\n+ });\nthis._previousStart = res.start;\nthis._previousEnd = res.end;\n- });\nif (this._startupLoop === true) {\n- this.refresh();\n+ loop()\n}\n} else if (this._startupLoop === true) {\nthis._startupLoop = false;\nthis._scrollToMarked();\n+ return\n}\n+ };\n+\n+ loop();\n}\n- private _calculateDimensions() {\n+ private _fireScrollToEnd() {\n+ if (this._scrollToEndFired) {\n+ return;\n+ }\n+ const scroll: HTMLElement = this.scrollElementRef.nativeElement;\n+ const panel: HTMLElement = this._elementRef.nativeElement;\n+ const padding: HTMLElement = this.virtualScroll ?\n+ this.paddingElementRef.nativeElement :\n+ this.contentElementRef.nativeElement;\n+\n+ if (scroll.scrollTop + panel.clientHeight > padding.clientHeight) {\n+ this.scrollToEnd.emit();\n+ this._scrollToEndFired = true;\n+ }\n+ }\n+\n+ private _calculateDimensions(index = 0) {\nreturn this._virtualScrollService.calculateDimensions(\nthis.items.length,\n+ index,\nthis.scrollElementRef.nativeElement,\nthis.contentElementRef.nativeElement\n)\n@@ -210,10 +243,11 @@ export class NgDropdownPanelComponent implements OnDestroy {\n}\nprivate _scrollToMarked() {\n- if (this._scrolledToMarked) {\n+ if (this._isScrolledToMarked) {\nreturn;\n}\n- this._scrolledToMarked = true;\n+ this._isScrolledToMarked = true;\n+\nthis.scrollInto(this._itemsList.markedItem)\n}\n",
"new_path": "src/ng-select/ng-dropdown-panel.component.ts",
"old_path": "src/ng-select/ng-dropdown-panel.component.ts"
},
{
"change_type": "MODIFY",
"diff": "</div>\n<div class=\"ng-overlay-container\" *ngIf=\"isOpen\">\n- <div class=\"ng-overlay\" (click)=\"isOpen = false\" ></div>\n+ <div class=\"ng-overlay\" (click)=\"close()\" ></div>\n</div>\n<ng-dropdown-panel *ngIf=\"isOpen\"\nclass=\"ng-dropdown-panel\"\n+ [virtualScroll]=\"virtualScroll\"\n[bufferAmount]=\"bufferAmount\"\n[appendTo]=\"appendTo\"\n[position]=\"dropdownPosition\"\n",
"new_path": "src/ng-select/ng-select.component.html",
"old_path": "src/ng-select/ng-select.component.html"
},
{
"change_type": "MODIFY",
"diff": "cursor: pointer;\nposition: relative;\nwidth: 17px;\n+ user-select: none;\n.ng-clear {\ndisplay: inline-block;\nfont-size: 18px;\ncursor: pointer;\nposition: relative;\ntext-align: center;\n+ user-select: none;\n.ng-arrow {\ndisplay: inline-block;\nheight: 0;\n",
"new_path": "src/ng-select/ng-select.component.scss",
"old_path": "src/ng-select/ng-select.component.scss"
},
{
"change_type": "MODIFY",
"diff": "@@ -491,7 +491,104 @@ describe('NgSelectComponent', function () {\n});\n});\n- describe('Dropdown', () => {\n+ describe('Dropdown panel', () => {\n+ it('should set and render items in dropdown panel', fakeAsync(() => {\n+ const fixture = createTestingModule(\n+ NgSelectBasicTestCmp,\n+ `<ng-select [items]=\"cities\"\n+ bindLabel=\"name\"\n+ [(ngModel)]=\"city\">\n+ </ng-select>`);\n+\n+ fixture.componentInstance.select.isOpen = true;\n+ tickAndDetectChanges(fixture);\n+\n+ expect(fixture.componentInstance.select.dropdownPanel.items.length).toBe(3);\n+ let options = fixture.debugElement.nativeElement.querySelectorAll('.ng-option');\n+ expect(options.length).toBe(3);\n+ expect(options[0].innerText).toBe('Vilnius');\n+ expect(options[1].innerText).toBe('Kaunas');\n+ expect(options[2].innerText).toBe('Pabrade');\n+\n+ fixture.componentInstance.cities = Array.from(Array(30).keys()).map((_, i) => ({ id: i, name: String.fromCharCode(97 + i) }));\n+ tickAndDetectChanges(fixture);\n+ options = fixture.debugElement.nativeElement.querySelectorAll('.ng-option');\n+ expect(options.length).toBe(30);\n+ expect(options[0].innerText).toBe('a');\n+ }));\n+\n+ it('should set and render items in dropdown panel with virtual scroll', fakeAsync(() => {\n+ const fixture = createTestingModule(\n+ NgSelectBasicTestCmp,\n+ `<ng-select [items]=\"cities\"\n+ bindLabel=\"name\"\n+ [virtualScroll]=\"true\"\n+ [(ngModel)]=\"city\">\n+ </ng-select>`);\n+\n+ fixture.componentInstance.select.isOpen = true;\n+ tickAndDetectChanges(fixture);\n+\n+ expect(fixture.componentInstance.select.dropdownPanel.items.length).toBe(3);\n+ let options = fixture.debugElement.nativeElement.querySelectorAll('.ng-option');\n+ expect(options.length).toBe(3);\n+ expect(options[0].innerText).toBe('Vilnius');\n+ expect(options[1].innerText).toBe('Kaunas');\n+ expect(options[2].innerText).toBe('Pabrade');\n+\n+ fixture.componentInstance.cities = Array.from(Array(30).keys()).map((_, i) => ({ id: i, name: String.fromCharCode(97 + i) }));\n+ tickAndDetectChanges(fixture);\n+ options = fixture.debugElement.nativeElement.querySelectorAll('.ng-option');\n+ expect(options.length).toBe(6);\n+ expect(options[0].innerText).toBe('a');\n+ }));\n+\n+ it('should scroll to item and do not change scroll position when scrolled to visible item', fakeAsync(() => {\n+ const fixture = createTestingModule(\n+ NgSelectBasicTestCmp,\n+ `<ng-select [items]=\"cities\"\n+ bindLabel=\"name\"\n+ [(ngModel)]=\"city\">\n+ </ng-select>`);\n+ const cmp = fixture.componentInstance;\n+ const el: HTMLElement = fixture.debugElement.nativeElement;\n+\n+ cmp.select.isOpen = true;\n+ tickAndDetectChanges(fixture);\n+\n+ cmp.cities = Array.from(Array(30).keys()).map((_, i) => ({ id: i, name: String.fromCharCode(97 + i) }));\n+ tickAndDetectChanges(fixture);\n+\n+ cmp.select.dropdownPanel.scrollInto(cmp.select.itemsList.items[1]);\n+ tickAndDetectChanges(fixture);\n+\n+ const panelItems = el.querySelector('.ng-dropdown-panel-items');\n+ expect(panelItems.scrollTop).toBe(0);\n+ }));\n+\n+ it('should scroll to item and change scroll position when scrolled to not visible visible item', fakeAsync(() => {\n+ const fixture = createTestingModule(\n+ NgSelectBasicTestCmp,\n+ `<ng-select [items]=\"cities\"\n+ bindLabel=\"name\"\n+ [(ngModel)]=\"city\">\n+ </ng-select>`);\n+ const cmp = fixture.componentInstance;\n+ const el: HTMLElement = fixture.debugElement.nativeElement;\n+\n+ cmp.select.isOpen = true;\n+ tickAndDetectChanges(fixture);\n+\n+ cmp.cities = Array.from(Array(30).keys()).map((_, i) => ({ id: i, name: String.fromCharCode(97 + i) }));\n+ tickAndDetectChanges(fixture);\n+\n+ cmp.select.dropdownPanel.scrollInto(cmp.select.itemsList.items[15]);\n+ tickAndDetectChanges(fixture);\n+\n+ const panelItems = el.querySelector('.ng-dropdown-panel-items');\n+ expect(panelItems.scrollTop).toBe(54);\n+ }));\n+\nit('should close on option select by default', async(() => {\nconst fixture = createTestingModule(\nNgSelectBasicTestCmp,\n@@ -765,7 +862,7 @@ describe('NgSelectComponent', function () {\n});\ndescribe('Dropdown position', () => {\n- it('should be set to `bottom` by default', () => {\n+ it('should be set to `bottom` by default', fakeAsync(() => {\nconst fixture = createTestingModule(\nNgSelectBasicTestCmp,\n`<ng-select id=\"select\"></ng-select>`);\n@@ -773,20 +870,40 @@ describe('NgSelectComponent', function () {\nconst classes = fixture.debugElement.query(By.css('ng-select')).classes;\nexpect(classes.bottom).toBeTruthy();\nexpect(classes.top).toBeFalsy();\n- });\n+ }));\n- it('should allow changing dropdown position', () => {\n+ it('should allow changing dropdown position to top', fakeAsync(() => {\nconst fixture = createTestingModule(\nNgSelectBasicTestCmp,\n`<ng-select id=\"select\" [dropdownPosition]=\"dropdownPosition\"></ng-select>`);\nfixture.componentInstance.dropdownPosition = 'top';\n- fixture.detectChanges();\n+ tickAndDetectChanges(fixture);\n+\n+ fixture.componentInstance.select.open();\n+ tickAndDetectChanges(fixture);\n+\nconst classes = fixture.debugElement.query(By.css('ng-select')).classes;\nexpect(classes.bottom).toBeFalsy();\nexpect(classes.top).toBeTruthy();\n- });\n+ }));\n+\n+ it('should allow changing dropdown position to auto', fakeAsync(() => {\n+ const fixture = createTestingModule(\n+ NgSelectBasicTestCmp,\n+ `<ng-select id=\"select\" [dropdownPosition]=\"dropdownPosition\"></ng-select>`);\n+\n+ fixture.componentInstance.dropdownPosition = 'auto';\n+ tickAndDetectChanges(fixture);\n+\n+ fixture.componentInstance.select.open();\n+ tickAndDetectChanges(fixture);\n+\n+ const classes = fixture.debugElement.query(By.css('ng-select')).classes;\n+ expect(classes.bottom).toBeTruthy()\n+ expect(classes.top).toBeFalsy();\n+ }));\n});\ndescribe('Custom templates', () => {\n@@ -1797,4 +1914,6 @@ class NgSelectEventsTestCmp {\n}\nonClear() { }\n+\n+ onScrollToEnd() {}\n}\n",
"new_path": "src/ng-select/ng-select.component.spec.ts",
"old_path": "src/ng-select/ng-select.component.spec.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -82,6 +82,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n@Input() closeOnSelect = true;\n@Input() maxSelectedItems: number;\n@Input() bufferAmount = 4;\n+ @Input() virtualScroll = false;\n@Input() @HostBinding('class.typeahead') typeahead: Subject<string>;\n@Input() @HostBinding('class.ng-multiple') multiple = false;\n@Input() @HostBinding('class.taggable') addTag: boolean | ((term: string) => any | Promise<any>) = false;\n@@ -117,7 +118,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nitemsList = new ItemsList(this);\nviewPortItems: NgOption[] = [];\nfilterValue: string = null;\n- currentDropdownPosition: 'bottom' | 'top' | 'auto' = 'bottom';\n+ currentDropdownPosition: DropdownPosition = 'bottom';\nprivate _ngModel: any = null;\nprivate _defaultLabel = 'label';\n@@ -273,6 +274,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nif (!this.filterValue) {\nthis.focusSearchInput();\n}\n+ this.detectChanges();\n}\nclose() {\n@@ -283,6 +285,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nthis._clearSearch();\nthis._onTouched();\nthis.closeEvent.emit();\n+ this.detectChanges();\n}\ntoggleItem(item: NgOption) {\n",
"new_path": "src/ng-select/ng-select.component.ts",
"old_path": "src/ng-select/ng-select.component.ts"
},
{
"change_type": "MODIFY",
"diff": "import { TestBed, inject } from '@angular/core/testing';\n-\nimport { VirtualScrollService } from './virtual-scroll.service';\ndescribe('VirtualScrollService', () => {\n@@ -21,7 +20,7 @@ describe('VirtualScrollService', () => {\nconst itemsLength = 100;\nconst buffer = 4;\n- const d = service.calculateDimensions(itemsLength, dropdown, content);\n+ const d = service.calculateDimensions(itemsLength, 0, dropdown, content);\nconst res = service.calculateItems(d, dropdown, buffer);\nexpect(res).toEqual({\n@@ -43,7 +42,7 @@ describe('VirtualScrollService', () => {\ndocument.body.appendChild(content);\nconst itemsLength = 100;\n- const res = service.calculateDimensions(itemsLength, dropdown, content);\n+ const res = service.calculateDimensions(itemsLength, 0, dropdown, content);\nexpect(res).toEqual({\nitemsLength: itemsLength,\n",
"new_path": "src/ng-select/virtual-scroll.service.spec.ts",
"old_path": "src/ng-select/virtual-scroll.service.spec.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -50,27 +50,22 @@ export class VirtualScrollService {\n}\n}\n- calculateDimensions(itemsLength: number, dropdownEl: HTMLElement, contentEl: HTMLElement): ItemsDimensions {\n- const viewWidth = dropdownEl.clientWidth;\n- const viewHeight = dropdownEl.clientHeight;\n-\n- let contentDimensions;\n-\n- contentDimensions = contentEl.children[0] ? contentEl.children[0].getBoundingClientRect() : {\n- width: viewWidth,\n- height: viewHeight\n+ calculateDimensions(itemsLength: number, index: number, panelEl: HTMLElement, contentEl: HTMLElement): ItemsDimensions {\n+ const panelRect = panelEl.getBoundingClientRect();\n+ const itemRect = contentEl.children[index] ? contentEl.children[index].getBoundingClientRect() : {\n+ width: panelRect.width,\n+ height: panelRect.height,\n+ top: 0,\n};\n- const childWidth = contentDimensions.width;\n- const childHeight = contentDimensions.height;\n- const itemsPerCol = Math.max(1, Math.floor(viewHeight / childHeight));\n+ const itemsPerCol = Math.max(1, Math.floor(panelRect.height / itemRect.height));\nreturn {\nitemsLength: itemsLength,\n- viewWidth: viewWidth,\n- viewHeight: viewHeight,\n- childWidth: childWidth,\n- childHeight: childHeight,\n- itemsPerCol: itemsPerCol\n+ viewWidth: panelRect.width,\n+ viewHeight: panelRect.height,\n+ childWidth: itemRect.width,\n+ childHeight: itemRect.height,\n+ itemsPerCol: itemsPerCol,\n};\n}\n}\n",
"new_path": "src/ng-select/virtual-scroll.service.ts",
"old_path": "src/ng-select/virtual-scroll.service.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -4,6 +4,9 @@ $color-selected: #f5faff;\n>.ng-control {\nbackground: #fff;\nborder-color: #b3b3b3 #ccc #d9d9d9;\n+ &:hover {\n+ box-shadow: none;\n+ }\n.ng-arrow {\ntop: -2px;\nborder-color: transparent transparent #999;\n",
"new_path": "src/themes/default.theme.scss",
"old_path": "src/themes/default.theme.scss"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
feat: disable virtual scroll by default (#299)
| 1
|
feat
| null |
679,913
|
01.03.2018 00:13:59
| 0
|
ed23376dac38b67c79641b4df71edcd94dd8607a
|
perf(atom): add optimized getters for path len < 5
benchmark (len=4) now: 57ms vs 3150ms (55x faster!)
|
[
{
"change_type": "MODIFY",
"diff": "@@ -11,7 +11,23 @@ function compG(k, f) {\nreturn (s) => s ? f(s[k]) : undefined;\n}\n-function toPath(path: PropertyKey | PropertyKey[]) {\n+/**\n+ * Converts the given key path to canonical form (array).\n+ *\n+ * ```\n+ * toPath(\"a.b.c\");\n+ * // [\"a\", \"b\", \"c\"]\n+ *\n+ * toPath(0)\n+ * // [0]\n+ *\n+ * toPath([\"a\", \"b\", \"c\"])\n+ * // [\"a\", \"b\", \"c\"]\n+ * ```\n+ *\n+ * @param path\n+ */\n+export function toPath(path: PropertyKey | PropertyKey[]) {\nreturn isArray(path) ? path : isString(path) ? path.split(\".\") : [path];\n}\n@@ -43,7 +59,19 @@ function toPath(path: PropertyKey | PropertyKey[]) {\n*/\nexport function getter(path: PropertyKey | PropertyKey[]) {\nconst ks = toPath(path);\n- if (ks.length > 0) {\n+ let [a, b, c, d] = ks;\n+ switch (ks.length) {\n+ case 0:\n+ return (s) => s;\n+ case 1:\n+ return (s) => s ? s[a] : undefined;\n+ case 2:\n+ return (s) => s ? (s = s[a]) ? s[b] : undefined : undefined;\n+ case 3:\n+ return (s) => s ? (s = s[a]) ? (s = s[b]) ? s[c] : undefined : undefined : undefined;\n+ case 4:\n+ return (s) => s ? (s = s[a]) ? (s = s[b]) ? (s = s[c]) ? s[d] : undefined : undefined : undefined : undefined;\n+ default:\nconst kl = ks[ks.length - 1];\nlet f = (s) => s ? s[kl] : undefined;\nfor (let i = ks.length - 2; i >= 0; i--) {\n@@ -51,7 +79,6 @@ export function getter(path: PropertyKey | PropertyKey[]) {\n}\nreturn f;\n}\n- return (s) => s;\n}\n/**\n",
"new_path": "packages/atom/src/path.ts",
"old_path": "packages/atom/src/path.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
perf(atom): add optimized getters for path len < 5
- benchmark (len=4) now: 57ms vs 3150ms (55x faster!)
| 1
|
perf
|
atom
|
679,913
|
01.03.2018 00:35:54
| 0
|
55c6a7d598dd782d96c43ee63643c51e480da8a7
|
perf(atom): add optimized setter() for path len < 5, fix toPath()
treat empty string as zero-length path
|
[
{
"change_type": "MODIFY",
"diff": "@@ -28,11 +28,14 @@ function compG(k, f) {\n* @param path\n*/\nexport function toPath(path: PropertyKey | PropertyKey[]) {\n- return isArray(path) ? path : isString(path) ? path.split(\".\") : [path];\n+ return isArray(path) ? path : isString(path) ? path.length > 0 ? path.split(\".\") : [] : path != null ? [path] : [];\n}\n/**\n* Composes a getter function for given nested lookup path.\n+ * Optimized fast execution paths are provided for path lengths\n+ * less than 5.\n+ *\n* If `path` is given as string, it will be split using `.`.\n* Returns function which accepts single object and\n* when called, returns value at given path.\n@@ -40,8 +43,8 @@ export function toPath(path: PropertyKey | PropertyKey[]) {\n* If any intermediate key is not present in the given obj,\n* descent stops and the function returns `undefined`.\n*\n- * If `path` is an empty array, the returned getter will simply\n- * return the given state arg (identity function).\n+ * If `path` is an empty string or array, the returned getter\n+ * will simply return the given state arg (identity function).\n*\n* Also see: `getIn()`\n*\n@@ -83,6 +86,9 @@ export function getter(path: PropertyKey | PropertyKey[]) {\n/**\n* Composes a setter function for given nested lookup path.\n+ * Optimized fast execution paths are provided for path lengths\n+ * less than 5.\n+ *\n* If `path` is given as string, it will be split using `.`.\n* Returns function which accepts single object and\n* when called, **immutably** updates value at given path,\n@@ -91,8 +97,8 @@ export function getter(path: PropertyKey | PropertyKey[]) {\n* If any intermediate key is not present in the given obj,\n* creates a plain empty object for that key and descends further.\n*\n- * If `path` is an empty array, the returned setter will simply\n- * return the new value.\n+ * If `path` is an empty string or array, the returned setter\n+ * will simply return the new value.\n*\n* Also see: `setIn()`, `updateIn()`, `deleteIn()`\n*\n@@ -130,7 +136,20 @@ export function getter(path: PropertyKey | PropertyKey[]) {\n*/\nexport function setter(path: PropertyKey | PropertyKey[]) {\nconst ks = toPath(path);\n- if (ks.length > 0) {\n+ // (s, v) => ({ ...s, [k]: f((s || {})[k], v) });\n+ let [a, b, c, d] = ks;\n+ switch (ks.length) {\n+ case 0:\n+ return (_, v) => v;\n+ case 1:\n+ return (s, v) => ({ ...s, [a]: v });\n+ case 2:\n+ return (s, v) => ({ ...s, [a]: { ...s[a], [b]: v } });\n+ case 3:\n+ return (s, v) => ({ ...s, [a]: { ...s[a], [b]: { ...s[b], [c]: v } } });\n+ case 4:\n+ return (s, v) => ({ ...s, [a]: { ...s[a], [b]: { ...s[b], [c]: { ...s[c], [d]: v } } } });\n+ default:\nconst kl = ks[ks.length - 1];\nlet f = (s, v) => ({ ...(s || {}), [kl]: v });\nfor (let i = ks.length - 2; i >= 0; i--) {\n@@ -138,7 +157,6 @@ export function setter(path: PropertyKey | PropertyKey[]) {\n}\nreturn f;\n}\n- return (_, v) => v;\n}\n/**\n@@ -195,7 +213,7 @@ export function updateIn(state: any, path: PropertyKey | PropertyKey[], fn: Swap\n* Uses `updateIn()` and returns updated state with key for given path removed.\n* Does not modify original state.\n*\n- * Returns `undefined` if `path` is an empty array.\n+ * Returns `undefined` if `path` is an empty string or array.\n*\n* ```\n* deleteIn({a:{b:{c: 23}}}, \"a.b.c\");\n",
"new_path": "packages/atom/src/path.ts",
"old_path": "packages/atom/src/path.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
perf(atom): add optimized setter() for path len < 5, fix toPath()
- treat empty string as zero-length path
| 1
|
perf
|
atom
|
679,913
|
01.03.2018 00:38:36
| 0
|
8c0c621c2f840f91177974148e469085b6cdfe08
|
feat(atom): add View type to create derrived views/value subscriptions
|
[
{
"change_type": "MODIFY",
"diff": "@@ -2,6 +2,8 @@ import * as api from \"@thi.ng/api/api\";\nexport type SwapFn<T> = (curr: T, ...args: any[]) => T;\n+export type ViewTransform<A, B> = (x: A) => B;\n+\nexport interface ReadonlyAtom<T> extends\napi.IDeref<T>,\napi.IWatch<T> {\n",
"new_path": "packages/atom/src/api.ts",
"old_path": "packages/atom/src/api.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -2,3 +2,4 @@ export * from \"./atom\";\nexport * from \"./cursor\";\nexport * from \"./history\";\nexport * from \"./path\";\n+export * from \"./view\";\n",
"new_path": "packages/atom/src/index.ts",
"old_path": "packages/atom/src/index.ts"
},
{
"change_type": "ADD",
"diff": "+import { IDeref, IID, IRelease } from \"@thi.ng/api/api\";\n+import { equiv as _equiv } from \"@thi.ng/api/equiv\";\n+import { ReadonlyAtom, ViewTransform } from \"./api\";\n+import { getter, toPath } from \"./path\";\n+\n+export class View<A, B> implements\n+ IDeref<B>,\n+ IID<string>,\n+ IRelease {\n+\n+ static NEXT_ID = 0;\n+\n+ readonly id: string;\n+\n+ readonly parent: ReadonlyAtom<A>;\n+ readonly path: PropertyKey[];\n+\n+ protected state: B;\n+ protected tx: ViewTransform<A, B>;\n+ protected unprocessed: A;\n+ protected isDirty: boolean;\n+\n+ constructor(parent: ReadonlyAtom<A>, path: PropertyKey | PropertyKey[], tx?: ViewTransform<A, B>, equiv = _equiv) {\n+ this.parent = parent;\n+ this.id = `view-${View.NEXT_ID++}`;\n+ this.tx = tx || ((x: any) => x);\n+ this.path = toPath(path);\n+ this.isDirty = true;\n+ const lookup = getter(this.path);\n+ const state = this.parent.deref();\n+ this.unprocessed = state ? lookup(state) : undefined;\n+ parent.addWatch(this.id, (_, prev, curr) => {\n+ const pval: A = prev ? lookup(prev) : prev;\n+ const val: A = curr ? lookup(curr) : curr;\n+ if (!equiv(val, pval)) {\n+ this.unprocessed = val;\n+ this.isDirty = true;\n+ }\n+ });\n+ }\n+\n+ deref() {\n+ if (this.isDirty) {\n+ this.state = this.tx(this.unprocessed);\n+ this.unprocessed = undefined;\n+ this.isDirty = false;\n+ }\n+ return this.state;\n+ }\n+\n+ /**\n+ * Like `deref()`, but doesn't update view's cached state\n+ * and dirty flag if value has changed. If there's an unprocessed\n+ * value change, returns result of this sub's transformer or else\n+ * the cached value.\n+ *\n+ * **Important:** Use this function only if the view's transformer\n+ * is stateless or else might cause undefined/inconsistent\n+ * behavior when calling deref() subsequently.\n+ */\n+ view() {\n+ return this.isDirty ? this.tx(this.unprocessed) : this.state;\n+ }\n+\n+ release() {\n+ this.unprocessed = undefined;\n+ this.isDirty = true;\n+ return this.parent.removeWatch(this.id);\n+ }\n+\n+ changed() {\n+ return this.isDirty;\n+ }\n+}\n",
"new_path": "packages/atom/src/view.ts",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(atom): add View type to create derrived views/value subscriptions
| 1
|
feat
|
atom
|
679,913
|
01.03.2018 01:34:17
| 0
|
9ad83b270377a077699651dc5182b8cef65dd6f9
|
feat(atom): add IView, IViewable, impl for Atom, Cursor, History
update IAtom to include IViewable
update View & ViewTransform generics
|
[
{
"change_type": "MODIFY",
"diff": "import * as api from \"@thi.ng/api/api\";\n+import { IDeref, IID, IRelease } from \"@thi.ng/api/api\";\n+\n+export type Path = PropertyKey | PropertyKey[];\nexport type SwapFn<T> = (curr: T, ...args: any[]) => T;\n-export type ViewTransform<A, B> = (x: A) => B;\n+export type ViewTransform<T> = (x: any) => T;\nexport interface ReadonlyAtom<T> extends\napi.IDeref<T>,\n@@ -12,7 +15,8 @@ export interface ReadonlyAtom<T> extends\nexport interface IAtom<T> extends\nReadonlyAtom<T>,\nIReset<T>,\n- ISwap<T> {\n+ ISwap<T>,\n+ IViewable {\n}\nexport interface IReset<T> {\n@@ -22,3 +26,16 @@ export interface IReset<T> {\nexport interface ISwap<T> {\nswap(fn: SwapFn<T>, ...args: any[]): T;\n}\n+\n+export interface IView<T> extends\n+ IDeref<T>,\n+ IID<string>,\n+ IRelease {\n+\n+ view(): T;\n+ changed(): boolean;\n+};\n+\n+export interface IViewable {\n+ addView<T>(path: Path, tx?: ViewTransform<T>): IView<T>;\n+}\n",
"new_path": "packages/atom/src/api.ts",
"old_path": "packages/atom/src/api.ts"
},
{
"change_type": "MODIFY",
"diff": "import { IEquiv, Watch } from \"@thi.ng/api/api\";\nimport { IWatch } from \"@thi.ng/api/mixins/iwatch\";\n-import { IAtom, SwapFn } from \"./api\";\n+import { IAtom, IView, Path, SwapFn, ViewTransform } from \"./api\";\n+import { View } from \"./view\";\n/**\n* Mutable wrapper for an (usually) immutable value.\n@@ -56,4 +57,8 @@ export class Atom<T> implements\n// mixin stub\n/* istanbul ignore next */\nnotifyWatches(oldState: T, newState: T) { }\n+\n+ addView<V>(path: Path, tx?: ViewTransform<V>): IView<V> {\n+ return new View<V>(this, path, tx);\n+ }\n}\n",
"new_path": "packages/atom/src/atom.ts",
"old_path": "packages/atom/src/atom.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,9 +5,10 @@ import { isNumber } from \"@thi.ng/checks/is-number\";\nimport { isString } from \"@thi.ng/checks/is-string\";\nimport { isSymbol } from \"@thi.ng/checks/is-symbol\";\n-import { IAtom, SwapFn } from \"./api\";\n+import { IAtom, SwapFn, IView, Path, ViewTransform } from \"./api\";\nimport { Atom } from \"./atom\";\nimport { getter, setter } from \"./path\";\n+import { View } from \"./view\";\nexport class Cursor<T> implements\nIAtom<T>,\n@@ -90,4 +91,8 @@ export class Cursor<T> implements\nnotifyWatches(oldState: T, newState: T) {\nreturn this.local.notifyWatches(oldState, newState);\n}\n+\n+ addView<V>(path: Path, tx?: ViewTransform<V>): IView<V> {\n+ return new View<V>(this, path, tx);\n+ }\n}\n",
"new_path": "packages/atom/src/cursor.ts",
"old_path": "packages/atom/src/cursor.ts"
},
{
"change_type": "MODIFY",
"diff": "import { Predicate2, Watch } from \"@thi.ng/api/api\";\nimport { equiv } from \"@thi.ng/api/equiv\";\n-import { IAtom, SwapFn } from \"./api\";\n+import { IAtom, SwapFn, IView, Path, ViewTransform } from \"./api\";\n+import { View } from \"./view\";\n/**\n* Undo/redo history stack wrapper for atoms and cursors.\n@@ -157,4 +158,8 @@ export class History<T> implements\nnotifyWatches(oldState: T, newState: T) {\nreturn this.state.notifyWatches(oldState, newState);\n}\n+\n+ addView<V>(path: Path, tx?: ViewTransform<V>): IView<V> {\n+ return new View<V>(this, path, tx);\n+ }\n}\n",
"new_path": "packages/atom/src/history.ts",
"old_path": "packages/atom/src/history.ts"
},
{
"change_type": "MODIFY",
"diff": "-import { IDeref, IID, IRelease } from \"@thi.ng/api/api\";\nimport { equiv as _equiv } from \"@thi.ng/api/equiv\";\n-import { ReadonlyAtom, ViewTransform } from \"./api\";\n+import { IView, Path, ReadonlyAtom, ViewTransform } from \"./api\";\nimport { getter, toPath } from \"./path\";\n-export class View<A, B> implements\n- IDeref<B>,\n- IID<string>,\n- IRelease {\n+export class View<T> implements\n+ IView<T> {\nstatic NEXT_ID = 0;\nreadonly id: string;\n- readonly parent: ReadonlyAtom<A>;\n+ readonly parent: ReadonlyAtom<any>;\nreadonly path: PropertyKey[];\n- protected state: B;\n- protected tx: ViewTransform<A, B>;\n- protected unprocessed: A;\n+ protected state: T;\n+ protected tx: ViewTransform<T>;\n+ protected unprocessed: any;\nprotected isDirty: boolean;\n- constructor(parent: ReadonlyAtom<A>, path: PropertyKey | PropertyKey[], tx?: ViewTransform<A, B>, equiv = _equiv) {\n+ constructor(parent: ReadonlyAtom<any>, path: Path, tx?: ViewTransform<T>, equiv = _equiv) {\nthis.parent = parent;\nthis.id = `view-${View.NEXT_ID++}`;\nthis.tx = tx || ((x: any) => x);\n@@ -30,8 +27,8 @@ export class View<A, B> implements\nconst state = this.parent.deref();\nthis.unprocessed = state ? lookup(state) : undefined;\nparent.addWatch(this.id, (_, prev, curr) => {\n- const pval: A = prev ? lookup(prev) : prev;\n- const val: A = curr ? lookup(curr) : curr;\n+ const pval: T = prev ? lookup(prev) : prev;\n+ const val: T = curr ? lookup(curr) : curr;\nif (!equiv(val, pval)) {\nthis.unprocessed = val;\nthis.isDirty = true;\n@@ -48,6 +45,10 @@ export class View<A, B> implements\nreturn this.state;\n}\n+ changed() {\n+ return this.isDirty;\n+ }\n+\n/**\n* Like `deref()`, but doesn't update view's cached state\n* and dirty flag if value has changed. If there's an unprocessed\n@@ -67,8 +68,4 @@ export class View<A, B> implements\nthis.isDirty = true;\nreturn this.parent.removeWatch(this.id);\n}\n-\n- changed() {\n- return this.isDirty;\n- }\n}\n",
"new_path": "packages/atom/src/view.ts",
"old_path": "packages/atom/src/view.ts"
},
{
"change_type": "MODIFY",
"diff": "import * as assert from \"assert\";\n+import { IView } from \"../src/api\";\nimport { Atom } from \"../src/atom\";\nimport { Cursor } from \"../src/cursor\";\nimport { View } from \"../src/view\";\n@@ -8,12 +9,31 @@ import { setIn, updateIn } from \"../src/path\";\ndescribe(\"subscription\", () => {\nlet a: Atom<any>;\n- let s: View<number, number>;\n+ let s: IView<number>;\nbeforeEach(() => {\na = new Atom({ a: 1, b: { c: 2, d: 3 }, e: 4 });\n});\n+ it(\"can be created from atom\", () => {\n+ s = a.addView(\"e\");\n+ assert(s instanceof View);\n+ assert.equal(s.deref(), 4);\n+ s = a.addView(\"e\", (x) => x * 10);\n+ assert(s instanceof View);\n+ assert.equal(s.deref(), 40);\n+ });\n+\n+ it(\"can be created from cursor\", () => {\n+ let c = new Cursor(a, \"b\");\n+ s = c.addView(\"d\");\n+ assert(s instanceof View);\n+ assert.equal(s.deref(), 3);\n+ s = c.addView(\"c\", (x: number) => x * 10);\n+ assert(s instanceof View);\n+ assert.equal(s.deref(), 20);\n+ });\n+\nit(\"can be deref'd\", () => {\nassert.equal(new View(a, \"b.c\").deref(), 2);\nassert.equal(new View(new Cursor(a, \"b\"), \"d\").deref(), 3);\n",
"new_path": "packages/atom/test/view.ts",
"old_path": "packages/atom/test/view.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(atom): add IView, IViewable, impl for Atom, Cursor, History
- update IAtom to include IViewable
- update View & ViewTransform generics
| 1
|
feat
|
atom
|
679,913
|
01.03.2018 01:34:37
| 0
|
a0ce6e76c3571d9f5b6e8fd5a604abbc4132ca61
|
refactor(atom): update Path type references
|
[
{
"change_type": "MODIFY",
"diff": "import { isArray } from \"@thi.ng/checks/is-array\";\nimport { isString } from \"@thi.ng/checks/is-string\";\n-import { SwapFn } from \"./api\";\n+import { Path, SwapFn } from \"./api\";\nfunction compS(k, f) {\nreturn (s, v) => ({ ...s, [k]: f((s || {})[k], v) });\n@@ -27,7 +27,7 @@ function compG(k, f) {\n*\n* @param path\n*/\n-export function toPath(path: PropertyKey | PropertyKey[]) {\n+export function toPath(path: Path) {\nreturn isArray(path) ? path : isString(path) ? path.length > 0 ? path.split(\".\") : [] : path != null ? [path] : [];\n}\n@@ -60,7 +60,7 @@ export function toPath(path: PropertyKey | PropertyKey[]) {\n*\n* @param path\n*/\n-export function getter(path: PropertyKey | PropertyKey[]) {\n+export function getter(path: Path) {\nconst ks = toPath(path);\nlet [a, b, c, d] = ks;\nswitch (ks.length) {\n@@ -134,7 +134,7 @@ export function getter(path: PropertyKey | PropertyKey[]) {\n*\n* @param path\n*/\n-export function setter(path: PropertyKey | PropertyKey[]) {\n+export function setter(path: Path) {\nconst ks = toPath(path);\n// (s, v) => ({ ...s, [k]: f((s || {})[k], v) });\nlet [a, b, c, d] = ks;\n@@ -170,7 +170,7 @@ export function setter(path: PropertyKey | PropertyKey[]) {\n* @param state\n* @param path\n*/\n-export function getIn(state: any, path: PropertyKey | PropertyKey[]) {\n+export function getIn(state: any, path: Path) {\nreturn getter(path)(state);\n}\n@@ -185,7 +185,7 @@ export function getIn(state: any, path: PropertyKey | PropertyKey[]) {\n* @param state\n* @param path\n*/\n-export function setIn(state: any, path: PropertyKey | PropertyKey[], val: any) {\n+export function setIn(state: any, path: Path, val: any) {\nreturn setter(path)(state, val);\n}\n@@ -204,7 +204,7 @@ export function setIn(state: any, path: PropertyKey | PropertyKey[], val: any) {\n* @param state\n* @param path\n*/\n-export function updateIn(state: any, path: PropertyKey | PropertyKey[], fn: SwapFn<any>, ...args: any[]) {\n+export function updateIn(state: any, path: Path, fn: SwapFn<any>, ...args: any[]) {\nargs.unshift(getIn(state, path));\nreturn setter(path)(state, fn.apply(null, args));\n}\n@@ -223,7 +223,7 @@ export function updateIn(state: any, path: PropertyKey | PropertyKey[], fn: Swap\n* @param state\n* @param path\n*/\n-export function deleteIn(state: any, path: PropertyKey | PropertyKey[]) {\n+export function deleteIn(state: any, path: Path) {\nconst ks = [...toPath(path)];\nif (ks.length > 0) {\nconst k = ks.pop();\n",
"new_path": "packages/atom/src/path.ts",
"old_path": "packages/atom/src/path.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(atom): update Path type references
| 1
|
refactor
|
atom
|
807,849
|
01.03.2018 11:27:49
| 28,800
|
2288513939a4119c951a129b68ed418afc624cf9
|
chore: extract normalize-test-root from integration test
|
[
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+const normalizePath = require(\"normalize-path\");\n+const path = require(\"path\");\n+\n+module.exports = normalizeTestRoot;\n+\n+function normalizeTestRoot(cwd) {\n+ // lol windows paths often look like escaped slashes, so re-re-escape them :P\n+ const dirPath = new RegExp(`(${cwd.replace(/\\\\/g, \"\\\\\\\\\")})([\\\\S]*)`, \"g\");\n+\n+ return str => str.replace(dirPath, serializeTestRoot);\n+}\n+\n+function serializeTestRoot(match, cwd, subPath) {\n+ return normalizePath(path.join(\"__TEST_ROOTDIR__\", subPath));\n+}\n",
"new_path": "test/helpers/normalize-test-root.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "\"use strict\";\nconst globby = require(\"globby\");\n-const normalizePath = require(\"normalize-path\");\n-const path = require(\"path\");\nconst cliRunner = require(\"../helpers/cli-runner\");\nconst initFixture = require(\"../helpers/initFixture\");\n+const normalizeTestRoot = require(\"../helpers/normalize-test-root\");\ndescribe(\"lerna clean\", () => {\n- const serializeTestRoot = (match, testDir, subPath) =>\n- normalizePath(path.join(\"__TEST_ROOTDIR__\", subPath));\n-\n- const normalizeLog = cwd => {\n- // lol windows paths often look like escaped slashes, so re-re-escape them :P\n- const dirPath = new RegExp(`(${cwd.replace(/\\\\/g, \"\\\\\\\\\")})([\\\\S]+)`, \"g\");\n-\n- return stderr => stderr.replace(dirPath, serializeTestRoot);\n- };\n-\ntest(\"global\", async () => {\nconst cwd = await initFixture(\"CleanCommand/basic\");\nconst args = [\"clean\", \"--yes\", \"--concurrency=1\"];\nconst { stderr } = await cliRunner(cwd)(...args);\n- expect(normalizeLog(cwd)(stderr)).toMatchSnapshot(\"stderr\");\n+ expect(normalizeTestRoot(cwd)(stderr)).toMatchSnapshot(\"stderr\");\nconst found = await globby([\"package-*/node_modules\"], { cwd, onlyDirectories: true });\nexpect(found).toEqual([]);\n",
"new_path": "test/integration/lerna-clean.test.js",
"old_path": "test/integration/lerna-clean.test.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
chore: extract normalize-test-root from integration test
| 1
|
chore
| null |
791,723
|
01.03.2018 15:24:38
| 28,800
|
cc536883f8928d1591a376b719667c3a6fedefea
|
docs(understanding-results): description can dynamically be the failureDescription
|
[
{
"change_type": "MODIFY",
"diff": "@@ -50,7 +50,7 @@ An object containing the results of the audits, keyed by their name.\n| Name | Type | Description |\n| -- | -- | -- |\n| name | `string` | The string identifier of the audit in kebab case. |\n-| description | `string` | The brief description of the audit's successful state. |\n+| description | `string` | The brief description of the audit. The text can change depending on if the audit passed or failed. |\n| helpText | `string` | A more detailed description that describes why the audit is important and links to Lighthouse documentation on the audit, markdown links supported. |\n| debugString | <code>string|undefined</code> | A string indicating some additional information to the user explaining an unusual circumstance or reason for failure. |\n| error | `boolean` | Set to true if there was an an exception thrown within the audit. The error message will be in `debugString`.\n",
"new_path": "docs/understanding-results.md",
"old_path": "docs/understanding-results.md"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
docs(understanding-results): description can dynamically be the failureDescription
| 1
|
docs
|
understanding-results
|
807,849
|
01.03.2018 18:09:35
| 28,800
|
2ead31074cbc8396d34e051d651c48226859aa87
|
fix: use localeCompare to sort packages by path
|
[
{
"change_type": "MODIFY",
"diff": "@@ -56,7 +56,7 @@ function collectPackages({ packageConfigs, rootPath }) {\n{ concurrency: 4 }\n).then(results => {\n// fast-glob does not respect pattern order, so we re-sort by absolute path\n- const lexicalByLocation = (a, b) => b.location < a.location;\n+ const lexicalByLocation = (a, b) => a.location.localeCompare(b.location);\nreturn results.reduce((pkgs, result) => pkgs.concat(result.sort(lexicalByLocation)), []);\n});\n",
"new_path": "src/utils/collect-packages.js",
"old_path": "src/utils/collect-packages.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
fix: use localeCompare to sort packages by path
| 1
|
fix
| null |
807,849
|
01.03.2018 18:09:53
| 28,800
|
e91c9f2cc1d02d2291c870fe3c2cc79c798decf8
|
fix: disable progress in commands that only output lists
|
[
{
"change_type": "MODIFY",
"diff": "@@ -38,6 +38,9 @@ class LsCommand extends Command {\n}\ninitialize() {\n+ // don't interrupt stdio\n+ this.logger.disableProgress();\n+\nthis.resultList = this.filteredPackages.map(pkg => ({\nname: pkg.name,\nversion: pkg.version,\n",
"new_path": "src/commands/LsCommand.js",
"old_path": "src/commands/LsCommand.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -40,6 +40,9 @@ class UpdatedCommand extends Command {\n}\ninitialize() {\n+ // don't interrupt stdio\n+ this.logger.disableProgress();\n+\nthis.updates = collectUpdates(this);\nconst proceedWithUpdates = this.updates.length > 0;\n",
"new_path": "src/commands/UpdatedCommand.js",
"old_path": "src/commands/UpdatedCommand.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
fix: disable progress in commands that only output lists
| 1
|
fix
| null |
807,849
|
01.03.2018 18:12:15
| 28,800
|
cdedffa6bafeb4da977cb16da6823d5052119316
|
chore: alpha versions should be published to the 'next' dist-tag
|
[
{
"change_type": "MODIFY",
"diff": "\"bin\",\n\"src\"\n],\n+ \"publishConfig\": {\n+ \"tag\": \"next\"\n+ },\n\"scripts\": {\n\"ci\": \"npm test -- --ci --coverage --verbose && npm run integration -- --ci\",\n\"fix\": \"npm run lint -- --fix\",\n",
"new_path": "package.json",
"old_path": "package.json"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
chore: alpha versions should be published to the 'next' dist-tag
| 1
|
chore
| null |
807,849
|
01.03.2018 18:36:44
| 28,800
|
04760f381456c9987ba8b4418a4ea4ad597b9725
|
fix: Don't resolve relative links in private packages
refs
|
[
{
"change_type": "MODIFY",
"diff": "@@ -270,7 +270,8 @@ class PublishCommand extends Command {\nresolveLocalDependencyLinks() {\n// resolve relative file: links to their actual version range\nconst updatesWithLocalLinks = this.updates.filter(\n- ({ localDependencies }) =>\n+ ({ pkg, localDependencies }) =>\n+ !pkg.private &&\nlocalDependencies.size &&\nArray.from(localDependencies.values()).some(({ type }) => type === \"directory\")\n);\n",
"new_path": "src/commands/PublishCommand.js",
"old_path": "src/commands/PublishCommand.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -1123,6 +1123,10 @@ describe(\"PublishCommand\", () => {\n\"package-4\": \"^2.0.0\",\n\"package-6\": \"^1.0.0\", // FIXME: awkward... (_intentional_, for now)\n});\n+ // private packages do not need local version resolution\n+ expect(updatedPackageJSON(\"package-7\").dependencies).toMatchObject({\n+ \"package-1\": \"file:../package-1\",\n+ });\n});\nit(\"reverts overwritten link after publish\", async () => {\n",
"new_path": "test/PublishCommand.js",
"old_path": "test/PublishCommand.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -566,5 +566,6 @@ Object {\n\"packages/package-3\": \"2.0.0\",\n\"packages/package-4\": \"2.0.0\",\n\"packages/package-5\": \"2.0.0\",\n+ \"packages/package-7\": \"2.0.0\",\n}\n`;\n",
"new_path": "test/__snapshots__/PublishCommand.js.snap",
"old_path": "test/__snapshots__/PublishCommand.js.snap"
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"package-7\",\n+ \"version\": \"1.0.0\",\n+ \"private\": true,\n+ \"dependencies\": {\n+ \"package-1\": \"file:../package-1\"\n+ }\n+}\n",
"new_path": "test/fixtures/PublishCommand/relative-file-specs/packages/package-7/package.json",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -267,6 +267,13 @@ index SHA..SHA 100644\n- \"version\": \"1.0.0\",\n+ \"version\": \"2.0.0\",\n+diff --git a/packages/package-7/package.json b/packages/package-7/package.json\n+index SHA..SHA 100644\n+--- a/packages/package-7/package.json\n++++ b/packages/package-7/package.json\n+@@ -3 +3 @@\n+- \"version\": \"1.0.0\",\n++ \"version\": \"2.0.0\",\n`;\nexports[`lerna publish replaces file: specifier with local version before npm publish but after git commit: unstaged 1`] = `\n",
"new_path": "test/integration/__snapshots__/lerna-publish.test.js.snap",
"old_path": "test/integration/__snapshots__/lerna-publish.test.js.snap"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
fix: Don't resolve relative links in private packages
refs #1262
| 1
|
fix
| null |
679,913
|
01.03.2018 18:41:55
| 0
|
ae7c7f5d56f31551e61e5e8a386ed0029a160c32
|
docs(atom): update readme, add View examples
|
[
{
"change_type": "MODIFY",
"diff": "## About\nClojure inspired mutable wrappers for (usually) immutable values, with support\n-for watches, cursors (direct access to nested values), undo/redo history.\n+for watches, cursors (direct access to nested values), derived view\n+subscriptions and undo/redo history. Together these types act as building\n+blocks for various application state handling patterns, specifically aimed\n+(though not exclusively) at the concept of using a nested, immutable,\n+centralized atom as single source of truth within an application.\n## Installation\n@@ -23,6 +27,12 @@ directory.\n### Atom\n+An `Atom` is a mutable wrapper for immutable values. The wrapped value can be\n+obtained via `deref()`, replaced via `reset()` and updated using `swap()`. An\n+atom too supports the concept of watches, essentially `onchange` event handlers\n+which are called from `reset`/`swap` and receive both the old and new atom\n+values.\n+\n```typescript\nimport * as atom from \"@thi.ng/atom\";\n@@ -36,9 +46,17 @@ a.deref();\na.addWatch(\"foo\", (id, prev, curr) => console.log(`${id}: ${prev} -> ${curr}`));\n// true\n-a.swap((val)=> val + 1);\n+// example update function\n+const add = (x, y) => x + y;\n+\n+// apply given function to current value\n+// (incl. any additional arguments passed to swap)\n+// this is the same as:\n+// a.reset(adder(a.deref(), 1))\n+a.swap(add, 1);\n// foo: 23 -> 24\n+// reset atom's value\na.reset(42);\n// foo: 24 -> 42\n```\n@@ -46,8 +64,9 @@ a.reset(42);\n### Cursor\nCursors provide direct & immutable access to a nested value within a structured\n-atom. The path to the desired value must be provided when the cursor is\n-created. The path is then compiled into a [getter and setter](./src/path.ts) to\n+atom. The path to the desired value must be provided when the cursor is created\n+and cannot be changed later. The path is then compiled into a [getter and\n+setter](#getters--setters) to\nallow cursors to be used like atoms and update the parent state in an immutable\nmanner (i.e. producing an optimized copy with structural sharing of the\noriginal (as much as possible)) - see further details below.\n@@ -108,12 +127,144 @@ main.deref()\n// { a: { b: { c: 24 }, d: { e: 42 } }, f: 66 }\n```\n+### Derived views\n+\n+Whereas cursors provide read/write access to nested key paths within a state atom, there are many situations when one only requires read access and the ability to (optionally) produce transformed versions of such a value. The `View` type provides exactly this functionality:\n+\n+```typescript\n+db = new atom.Atom({a: 1, b: {c: 2}});\n+\n+// create a view for a's value\n+viewA = db.addView(\"a\");\n+\n+// create a view for c's value w/ transformer\n+viewC = db.addView(\"b.c\", (x) => x * 10);\n+\n+viewA.deref()\n+// 1\n+\n+viewC.deref()\n+// 20\n+\n+// update the atom\n+db.swap((state) => atom.setIn(state, \"b.c\", 3))\n+\n+// views can indicate if their value has changed\n+// (will be reset to `false` after each deref)\n+\n+// here viewA hasn't changed (we only updated `c`)\n+viewA.changed()\n+// false\n+viewC.changed()\n+// true\n+\n+// the transformer function is only executed once per value change\n+viewC.deref()\n+// 30\n+\n+// just returns current cached transformed value\n+viewC.deref()\n+// 30\n+\n+// discard views\n+viewA.release()\n+viewC.release()\n+```\n+\n+Atoms & views are useful tools for keeping state outside UI components. Here's\n+an example of a tiny\n+[@thi.ng/hiccup-dom](https://github.com/thi-ng/umbrella/tree/master/packages/hiccup-dom)\n+web app, demonstrating how to use derived views to switch the UI for different\n+application states / modules.\n+\n+Note: The constrained nature of this example doesn't really do justice to the powerful nature of the approach. Also stylistically, in a larger app we'd want to avoid the use of global variables (apart from `db`) as done here...\n+\n+This example is also available in standalone form:\n+\n+[Source](https://github.com/thi-ng/umbrella/tree/master/examples/login-form) | [Live demo](http://demo.thi.ng/umbrella/login-form/)\n+\n+```typescript\n+import { Atom, setIn } from \"@thi.ng/atom\";\n+import { start } from \"@thi.ng/hiccup-dom\";\n+\n+// central immutable app state\n+const db = new Atom({ state: \"login\" });\n+\n+// define views for different state values\n+const appState = db.addView<string>(\"state\");\n+const error = db.addView<string>(\"error\");\n+// specify a view transformer for the username value\n+const user = db.addView<string>(\n+ \"user.name\",\n+ (x) => x ? x.charAt(0).toUpperCase() + x.substr(1) : null\n+);\n+\n+// state update functions\n+const setValue = (path, val) => db.swap((state) => setIn(state, path, val));\n+const setState = (s) => setValue(appState.path, s);\n+const setError = (err) => setValue(error.path, err);\n+const setUser = (e) => setValue(user.path, e.target.value);\n+const loginUser = () => {\n+ if (user.deref() && user.deref().toLowerCase() === \"admin\") {\n+ setError(null);\n+ setState(\"main\");\n+ } else {\n+ setError(\"sorry, wrong username (try 'admin')\");\n+ }\n+};\n+const logoutUser = () => {\n+ setValue(user.path, null);\n+ setState(\"logout\");\n+};\n+\n+// components for different app states\n+// note how the value views are used here\n+const uiViews = {\n+ // dummy login form\n+ login: () =>\n+ [\"div#login\",\n+ [\"h1\", \"Login\"],\n+ error.deref() ? [\"div.error\", error.deref()] : undefined,\n+ [\"input\", { type: \"text\", onchange: setUser }],\n+ [\"button\", { onclick: loginUser }, \"Login\"]\n+ ],\n+ logout: () =>\n+ [\"div#logout\",\n+ [\"h1\", \"Good bye\"],\n+ \"You've been logged out. \",\n+ [\"a\",\n+ { href: \"#\", onclick: () => setState(\"login\") },\n+ \"Log back in?\"\n+ ]\n+ ],\n+ main: () =>\n+ [\"div#main\",\n+ [\"h1\", `Welcome, ${user.deref()}!`],\n+ [\"div\", \"Your current app state:\"],\n+ [\"div\",\n+ [\"textarea\",\n+ { cols: 40, rows: 10 },\n+ JSON.stringify(db.deref(), null, 2)]],\n+ [\"button\", { onclick: logoutUser }, \"Logout\"]\n+ ]\n+};\n+\n+// root component simply delegates to stored uiViews\n+// based on current `appState` value\n+const app = () =>\n+ uiViews[appState.deref()] ||\n+ [\"div\", [\"h1\", `No component for state: ${appState.deref()}`]];\n+\n+start(document.body, app);\n+```\n+\n### Undo history\n+The `History` type can be used with & behaves like an Atom or Cursor, but\n+creates snapshots of the current state before applying the new state. By\n+default history has length of 100 steps, but this is configurable.\n+\n```typescript\n-// the History can be used with & behaves like an Atom or Cursor\n-// but creates snapshots of current state before applying new state\n-// by default history has length of 100 steps, but is configurable\ndb = new atom.History(new atom.Atom({a: 1}))\ndb.deref()\n// {a: 1}\n@@ -149,13 +300,13 @@ db.canRedo()\nThe `getter()` and `setter()` functions transform a path like `a.b.c` into a\nfunction operating directly at the value the path points to in nested object.\n-For getters, this essentially compiles to `val = obj.a.b.c`.\n+For getters, this essentially compiles to `val = obj.a.b.c`, with the important difference that the function returns `undefined` if any intermediate values along the lookup path are undefined (and doesn't throw an error).\nThe resulting setter function too accepts a single object to operate on and\n-when called, **immutably** replaces the value at the given path, i.e. produces\n-a selective deep copy of obj up until given path. If any intermediate key is\n-not present in the given object, it creates a plain empty object for that\n-missing key and descends further along the path.\n+when called, **immutably** replaces the value at the given path, i.e. it\n+produces a selective deep copy of obj up until given path. If any intermediate\n+key is not present in the given object, it creates a plain empty object for\n+that missing key and descends further along the path.\n```typescript\ns = setter(\"a.b.c\");\n",
"new_path": "packages/atom/README.md",
"old_path": "packages/atom/README.md"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs(atom): update readme, add View examples
| 1
|
docs
|
atom
|
807,849
|
01.03.2018 18:44:06
| 28,800
|
453548bceec67aadb3db7456a62cdf52cb1fed30
|
chore: Update CHANGELOG for v3.0.0-alpha.2
|
[
{
"change_type": "MODIFY",
"diff": "+## v3.0.0-alpha.2 (2018-03-02)\n+\n+#### :bug: Bug Fix\n+\n+* Sort packages correctly ([2ead3107](https://github.com/lerna/lerna/commit/2ead3107))\n+* Don't resolve relative links in private packages ([04760f38](https://github.com/lerna/lerna/commit/04760f38))\n+\n+#### :nail_care: Polish\n+\n+* Disable progress in commands that only output lists ([e91c9f2c](https://github.com/lerna/lerna/commit/e91c9f2c))\n+\n## v3.0.0-alpha.1 (2018-02-28)\n#### :boom: Breaking Change\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
chore: Update CHANGELOG for v3.0.0-alpha.2
| 1
|
chore
| null |
679,913
|
01.03.2018 18:45:07
| 0
|
dd66592004f8ee6920be0cc229c7f22593aa7ab1
|
feat(examples): add login-form demo to illustrate state handling
|
[
{
"change_type": "ADD",
"diff": "+node_modules\n+yarn.lock\n+*.js\n",
"new_path": "examples/login-form/.gitignore",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+# login-form\n+\n+[Live demo](http://demo.thi.ng/umbrella/login-form/)\n+\n+```\n+git clone https://github.com/thi-ng/umbrella.git\n+cd umbrella/examples/login-form\n+yarn install\n+```\n+\n+Then\n+\n+```\n+\\# For Mac\n+yarn dev\n+```\n+\n+```\n+\\# For Debian, Ubuntu, Etc.\n+yarn debdev\n+```\n+\n+Once webpack has completed building, refresh your browser...\n",
"new_path": "examples/login-form/README.md",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"login-form\",\n+ \"version\": \"0.0.1\",\n+ \"repository\": \"https://github.com/thi-ng/umbrella\",\n+ \"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n+ \"license\": \"Apache-2.0\",\n+ \"scripts\": {\n+ \"build\": \"yarn clean && webpack\",\n+ \"clean\": \"rm -rf bundle.*\",\n+ \"dev\": \"open index.html && webpack -w\",\n+ \"debdev\": \"see index.html && webpack -w\"\n+ },\n+ \"devDependencies\": {\n+ \"ts-loader\": \"^3.3.1\",\n+ \"typescript\": \"^2.7.1\",\n+ \"webpack\": \"^3.10.0\"\n+ },\n+ \"dependencies\": {\n+ \"@thi.ng/atom\": \"^0.7.0\",\n+ \"@thi.ng/hiccup-dom\": \"^1.2.0\"\n+ }\n+}\n\\ No newline at end of file\n",
"new_path": "examples/login-form/package.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { Atom } from \"@thi.ng/atom/atom\";\n+import { setIn } from \"@thi.ng/atom/path\";\n+import { start } from \"@thi.ng/hiccup-dom/start\";\n+\n+// central immutable app state\n+const db = new Atom({ state: \"login\" });\n+\n+// define views for different state values\n+const appState = db.addView<string>(\"state\");\n+const error = db.addView<string>(\"error\");\n+// specify a view transformer for the username value\n+const user = db.addView<string>(\n+ \"user.name\",\n+ (x) => x ? x.charAt(0).toUpperCase() + x.substr(1) : null\n+);\n+\n+// state update functions\n+const setValue = (path, val) => db.swap((state) => setIn(state, path, val));\n+const setState = (s) => setValue(appState.path, s);\n+const setError = (err) => setValue(error.path, err);\n+const setUser = (e) => setValue(user.path, e.target.value);\n+const loginUser = () => {\n+ if (user.deref() && user.deref().toLowerCase() === \"admin\") {\n+ setError(null);\n+ setState(\"main\");\n+ } else {\n+ setError(\"sorry, wrong username (try 'admin')\");\n+ }\n+};\n+const logoutUser = () => {\n+ setValue(user.path, null);\n+ setState(\"logout\");\n+};\n+\n+// components for different app states\n+// note how the value views are used here\n+const uiViews = {\n+ // dummy login form\n+ login: () =>\n+ [\"div#login\",\n+ [\"h1\", \"Login\"],\n+ error.deref() ? [\"div.error\", error.deref()] : undefined,\n+ [\"input\", { type: \"text\", onchange: setUser }],\n+ [\"button\", { onclick: loginUser }, \"Login\"]\n+ ],\n+ logout: () =>\n+ [\"div#logout\",\n+ [\"h1\", \"Good bye\"],\n+ \"You've been logged out. \",\n+ [\"a\",\n+ { href: \"#\", onclick: () => setState(\"login\") },\n+ \"Log back in?\"\n+ ]\n+ ],\n+ main: () =>\n+ [\"div#main\",\n+ [\"h1\", `Welcome, ${user.deref()}!`],\n+ [\"div\", \"Your current app state:\"],\n+ [\"div\",\n+ [\"textarea\",\n+ { cols: 40, rows: 10 },\n+ JSON.stringify(db.deref(), null, 2)]],\n+ [\"button\", { onclick: logoutUser }, \"Logout\"]\n+ ]\n+};\n+\n+// root component simply delegates to stored uiViews\n+// based on current `appState` value\n+const app = () =>\n+ uiViews[appState.deref()] ||\n+ [\"div\", [\"h1\", `No component for state: ${appState.deref()}`]];\n+\n+start(document.body, app);\n",
"new_path": "examples/login-form/src/index.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"extends\": \"../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \".\"\n+ },\n+ \"include\": [\n+ \"./src/**/*.ts\"\n+ ]\n+}\n",
"new_path": "examples/login-form/tsconfig.json",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(examples): add login-form demo to illustrate state handling
| 1
|
feat
|
examples
|
679,913
|
01.03.2018 20:22:43
| 0
|
3dcc3cb818bef450c79f02543cac7c88839122c2
|
docs(atom): update example
|
[
{
"change_type": "MODIFY",
"diff": "@@ -55,7 +55,7 @@ const uiViews = {\nmain: () =>\n[\"div#main\",\n[\"h1\", `Welcome, ${user.deref()}!`],\n- [\"div\", \"Your current app state:\"],\n+ [\"div\", \"Current app state:\"],\n[\"div\",\n[\"textarea\",\n{ cols: 40, rows: 10 },\n@@ -64,10 +64,20 @@ const uiViews = {\n]\n};\n-// root component simply delegates to stored uiViews\n-// based on current `appState` value\n+// finally define another derived view including a transformer\n+// which maps the current app state value to its correct UI component\n+// (incl. a fallback for illegal app states)\n+const currView = db.addView(\n+ \"state\",\n+ (state) =>\n+ uiViews[state] ||\n+ [\"div\", [\"h1\", `No component for state: ${appState.deref()}`]]\n+);\n+\n+// root component simply returns the\nconst app = () =>\n- uiViews[appState.deref()] ||\n- [\"div\", [\"h1\", `No component for state: ${appState.deref()}`]];\n+ [\"div#app\",\n+ currView.deref(),\n+ [\"footer\", \"Made with @thi.ng/atom and @thi.ng/hiccup-dom\"]];\nstart(document.body, app);\n",
"new_path": "examples/login-form/src/index.ts",
"old_path": "examples/login-form/src/index.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -240,7 +240,7 @@ const uiViews = {\nmain: () =>\n[\"div#main\",\n[\"h1\", `Welcome, ${user.deref()}!`],\n- [\"div\", \"Your current app state:\"],\n+ [\"div\", \"Current app state:\"],\n[\"div\",\n[\"textarea\",\n{ cols: 40, rows: 10 },\n@@ -249,11 +249,21 @@ const uiViews = {\n]\n};\n-// root component simply delegates to stored uiViews\n-// based on current `appState` value\n+// finally define another derived view including a transformer\n+// which maps the current app state value to its correct UI component\n+// (incl. a fallback for illegal app states)\n+const currView = db.addView(\n+ \"state\",\n+ (state) =>\n+ uiViews[state] ||\n+ [\"div\", [\"h1\", `No component for state: ${appState.deref()}`]]\n+);\n+\n+// root component simply returns the\nconst app = () =>\n- uiViews[appState.deref()] ||\n- [\"div\", [\"h1\", `No component for state: ${appState.deref()}`]];\n+ [\"div#app\",\n+ currView.deref(),\n+ [\"footer\", \"Made with @thi.ng/atom and @thi.ng/hiccup-dom\"]];\nstart(document.body, app);\n```\n",
"new_path": "packages/atom/README.md",
"old_path": "packages/atom/README.md"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs(atom): update example
| 1
|
docs
|
atom
|
679,913
|
01.03.2018 20:57:37
| 0
|
befaceb0ca46ead3f516de9b28b9158c47cc7be3
|
docs(atom): update readme example
|
[
{
"change_type": "MODIFY",
"diff": "@@ -64,17 +64,17 @@ const uiViews = {\n]\n};\n-// finally define another derived view including a transformer\n-// which maps the current app state value to its correct UI component\n-// (incl. a fallback for illegal app states)\n+// finally define another derived view for the app state value\n+// including a transformer, which maps the current app state value\n+// to its correct UI component (incl. a fallback for illegal app states)\nconst currView = db.addView(\n- \"state\",\n+ appState.path,\n(state) =>\nuiViews[state] ||\n- [\"div\", [\"h1\", `No component for state: ${appState.deref()}`]]\n+ [\"div\", [\"h1\", `No component for state: ${state}`]]\n);\n-// root component simply returns the\n+// app root component\nconst app = () =>\n[\"div#app\",\ncurrView.deref(),\n",
"new_path": "examples/login-form/src/index.ts",
"old_path": "examples/login-form/src/index.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -249,17 +249,17 @@ const uiViews = {\n]\n};\n-// finally define another derived view including a transformer\n-// which maps the current app state value to its correct UI component\n-// (incl. a fallback for illegal app states)\n+// finally define another derived view for the app state value\n+// including a transformer, which maps the current app state value\n+// to its correct UI component (incl. a fallback for illegal app states)\nconst currView = db.addView(\n- \"state\",\n+ appState.path,\n(state) =>\nuiViews[state] ||\n- [\"div\", [\"h1\", `No component for state: ${appState.deref()}`]]\n+ [\"div\", [\"h1\", `No component for state: ${state}`]]\n);\n-// root component simply returns the\n+// app root component\nconst app = () =>\n[\"div#app\",\ncurrView.deref(),\n",
"new_path": "packages/atom/README.md",
"old_path": "packages/atom/README.md"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs(atom): update readme example
| 1
|
docs
|
atom
|
791,723
|
02.03.2018 08:44:01
| 28,800
|
231642d15eed35161b177e946cded0458411101a
|
core(http-redirect): drop use of getSecurityState() to gain Android support
|
[
{
"change_type": "MODIFY",
"diff": "@@ -312,17 +312,6 @@ class Driver {\n});\n}\n- getSecurityState() {\n- return new Promise((resolve, reject) => {\n- this.once('Security.securityStateChanged', data => {\n- this.sendCommand('Security.disable')\n- .then(_ => resolve(data), reject);\n- });\n-\n- this.sendCommand('Security.enable').catch(reject);\n- });\n- }\n-\ngetServiceWorkerVersions() {\nreturn new Promise((resolve, reject) => {\nconst versionUpdatedListener = data => {\n",
"new_path": "lighthouse-core/gather/driver.js",
"old_path": "lighthouse-core/gather/driver.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -27,36 +27,12 @@ class HTTPRedirect extends Gatherer {\n// Reset the options.\noptions.url = this._preRedirectURL;\n- // Allow override for faster testing.\n- const timeout = options._testTimeout || 10000;\n-\n- const securityPromise = options.driver.getSecurityState()\n- .then(state => {\n+ const expression = `new URL(window.location).protocol === 'https:'`;\n+ return options.driver.evaluateAsync(expression, {useIsolation: true}).then(returnedValue => {\nreturn {\n- value: state.schemeIsCryptographic,\n+ value: returnedValue,\n};\n});\n-\n- let noSecurityChangesTimeout;\n- const timeoutPromise = new Promise((resolve, reject) => {\n- // Set up a timeout for ten seconds in case we don't get any\n- // security events at all. If that happens, bail.\n- noSecurityChangesTimeout = setTimeout(_ => {\n- reject(new Error('Timed out waiting for HTTP redirection.'));\n- }, timeout);\n- });\n-\n- return Promise.race([\n- securityPromise,\n- timeoutPromise,\n- ]).then(result => {\n- // Clear timeout. No effect if it won, no need to wait if it lost.\n- clearTimeout(noSecurityChangesTimeout);\n- return result;\n- }).catch(err => {\n- clearTimeout(noSecurityChangesTimeout);\n- throw err;\n- });\n}\n}\n",
"new_path": "lighthouse-core/gather/gatherers/http-redirect.js",
"old_path": "lighthouse-core/gather/gatherers/http-redirect.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -62,11 +62,6 @@ module.exports = {\nendDevtoolsLog() {\nreturn require('../fixtures/perflog.json');\n},\n- getSecurityState() {\n- return Promise.resolve({\n- schemeIsCryptographic: true,\n- });\n- },\nblockUrlPatterns() {\nreturn Promise.resolve();\n},\n",
"new_path": "lighthouse-core/test/gather/fake-driver.js",
"old_path": "lighthouse-core/test/gather/fake-driver.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -29,10 +29,8 @@ describe('HTTP Redirect gatherer', () => {\nconst opts = {\nurl: 'https://example.com',\ndriver: {\n- getSecurityState() {\n- return Promise.resolve({\n- schemeIsCryptographic: true,\n- });\n+ evaluateAsync: function() {\n+ return Promise.resolve(true);\n},\n},\n};\n@@ -48,10 +46,8 @@ describe('HTTP Redirect gatherer', () => {\nit('returns an artifact', () => {\nreturn httpRedirectGather.afterPass({\ndriver: {\n- getSecurityState() {\n- return Promise.resolve({\n- schemeIsCryptographic: true,\n- });\n+ evaluateAsync: function() {\n+ return Promise.resolve(true);\n},\n},\n}).then(artifact => {\n@@ -59,36 +55,25 @@ describe('HTTP Redirect gatherer', () => {\n});\n});\n- it('throws an error on driver failure', () => {\n+ it('fails a non-redirecting page', () => {\nreturn httpRedirectGather.afterPass({\ndriver: {\n- getSecurityState() {\n- return Promise.reject('such a fail');\n+ evaluateAsync: function() {\n+ return Promise.resolve(false);\n},\n},\n- }).then(\n- _ => assert.ok(false),\n- _ => assert.ok(true));\n+ }).then(artifact => {\n+ assert.ok(artifact.value === false);\n+ });\n});\n- it('handles driver timeout', () => {\n- const fastTimeout = 50;\n- const slowResolve = 200;\n-\n+ it('throws an error on driver failure', () => {\nreturn httpRedirectGather.afterPass({\ndriver: {\n- getSecurityState() {\n- return new Promise((resolve, reject) => {\n- // Resolve slowly, after the timeout for waiting on the security\n- // state has fired.\n- setTimeout(_ => resolve({\n- schemeIsCryptographic: true,\n- }), slowResolve);\n- });\n+ evaluateAsync: function() {\n+ return Promise.reject(new Error('an unexpected driver error occurred'));\n},\n},\n-\n- _testTimeout: fastTimeout,\n}).then(\n_ => assert.ok(false),\n_ => assert.ok(true));\n",
"new_path": "lighthouse-core/test/gather/gatherers/http-redirect-test.js",
"old_path": "lighthouse-core/test/gather/gatherers/http-redirect-test.js"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
core(http-redirect): drop use of getSecurityState() to gain Android support (#4661)
| 1
|
core
|
http-redirect
|
807,849
|
02.03.2018 12:41:34
| 28,800
|
be1b4434e9cf840f88d6aa0552065fb9d19977e6
|
refactor(npm-install): pass Package as first parameter
|
[
{
"change_type": "MODIFY",
"diff": "@@ -162,9 +162,9 @@ class BootstrapCommand extends Command {\ninstallRootPackageOnly() {\nconst tracker = this.logger.newItem(\"install dependencies\");\n- return npmInstall(this.repository.rootPath, this.npmConfig).then(() => {\n+ return npmInstall(this.repository.package, this.npmConfig).then(() => {\ntracker.info(\"hoist\", \"Finished installing in root\");\n- tracker.completeWork(1);\n+ tracker.finish();\n});\n}\n",
"new_path": "src/commands/BootstrapCommand.js",
"old_path": "src/commands/BootstrapCommand.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -13,9 +13,9 @@ const getExecOpts = require(\"./get-npm-exec-opts\");\nmodule.exports = npmInstall;\nmodule.exports.dependencies = installInDir;\n-function npmInstall(directory, { registry, npmClient, npmClientArgs, npmGlobalStyle, mutex }) {\n+function npmInstall(pkg, { registry, npmClient, npmClientArgs, npmGlobalStyle, mutex }) {\n// build command, arguments, and options\n- const opts = getExecOpts(directory, registry);\n+ const opts = getExecOpts(pkg.location, registry);\nconst args = [\"install\"];\nlet cmd = npmClient || \"npm\";\n@@ -81,7 +81,7 @@ function installInDir(pkg, dependencies, config) {\n// Write out our temporary cooked up package.json and then install.\nreturn writePkg(pkg.manifestLocation, tempJson)\n- .then(() => npmInstall(pkg.location, config))\n+ .then(() => npmInstall(pkg, config))\n.then(() => done(), done);\n});\n}\n",
"new_path": "src/utils/npm-install.js",
"old_path": "src/utils/npm-install.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -399,7 +399,7 @@ describe(\"BootstrapCommand\", () => {\nexpect(npmInstall.dependencies).not.toBeCalled();\nexpect(npmInstall).lastCalledWith(\n- expect.any(String),\n+ expect.objectContaining({ name: \"root\" }),\nexpect.objectContaining({\nnpmClient: \"yarn\",\nmutex: expect.stringMatching(/^network:\\d+$/),\n",
"new_path": "test/BootstrapCommand.js",
"old_path": "test/BootstrapCommand.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -23,19 +23,23 @@ describe(\"npm-install\", () => {\nit(\"returns a promise for a non-mangling install\", async () => {\nexpect.assertions(1);\n- const directory = path.normalize(\"/test/npm/install\");\n+ const location = path.normalize(\"/test/npm/install\");\n+ const pkg = {\n+ name: \"test-npm-install\",\n+ location,\n+ };\nconst config = {\nnpmClient: \"yarn\",\nnpmClientArgs: [\"--no-optional\"],\nmutex: \"file:foo\",\n};\n- await npmInstall(directory, config);\n+ await npmInstall(pkg, config);\nexpect(ChildProcessUtilities.exec).lastCalledWith(\n\"yarn\",\n[\"install\", \"--mutex\", \"file:foo\", \"--non-interactive\", \"--no-optional\"],\n- { cwd: directory }\n+ { cwd: location }\n);\n});\n@@ -44,18 +48,22 @@ describe(\"npm-install\", () => {\nChildProcessUtilities.exec.mockRejectedValueOnce(new Error(\"whoopsy-doodle\"));\n- const directory = path.normalize(\"/test/npm/install/error\");\n+ const location = path.normalize(\"/test/npm/install/error\");\n+ const pkg = {\n+ name: \"test-npm-install-error\",\n+ location,\n+ };\nconst config = {\nnpmClient: \"yarn\",\n};\ntry {\n- await npmInstall(directory, config);\n+ await npmInstall(pkg, config);\n} catch (err) {\nexpect(err.message).toBe(\"whoopsy-doodle\");\nexpect(ChildProcessUtilities.exec).lastCalledWith(\"yarn\", [\"install\", \"--non-interactive\"], {\n- cwd: directory,\n+ cwd: location,\n});\n}\n});\n",
"new_path": "test/utils-npm-install.test.js",
"old_path": "test/utils-npm-install.test.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
refactor(npm-install): pass Package as first parameter
| 1
|
refactor
|
npm-install
|
807,849
|
02.03.2018 12:46:14
| 28,800
|
0cc3b5537ed914477b16f418ec8e101e2d07eaf9
|
refactor(utils/npm-*): pass Package to getExecOpts()
|
[
{
"change_type": "MODIFY",
"diff": "@@ -4,9 +4,9 @@ const log = require(\"npmlog\");\nmodule.exports = getExecOpts;\n-function getExecOpts(directory, registry) {\n+function getExecOpts(pkg, registry) {\nconst opts = {\n- cwd: directory,\n+ cwd: pkg.location,\n};\nif (registry) {\n",
"new_path": "src/utils/get-npm-exec-opts.js",
"old_path": "src/utils/get-npm-exec-opts.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -15,7 +15,7 @@ function add(pkg, version, tag, registry) {\nreturn ChildProcessUtilities.exec(\n\"npm\",\n[\"dist-tag\", \"add\", `${pkg.name}@${version}`, tag],\n- getExecOpts(pkg.location, registry)\n+ getExecOpts(pkg, registry)\n);\n}\n@@ -25,7 +25,7 @@ function check(pkg, tag, registry) {\nconst result = ChildProcessUtilities.execSync(\n\"npm\",\n[\"dist-tag\", \"ls\", pkg.name],\n- getExecOpts(pkg.location, registry)\n+ getExecOpts(pkg, registry)\n);\nreturn result.indexOf(tag) >= 0;\n@@ -34,9 +34,5 @@ function check(pkg, tag, registry) {\nfunction remove(pkg, tag, registry) {\nlog.silly(\"npmDistTag.remove\", tag, pkg.name);\n- return ChildProcessUtilities.exec(\n- \"npm\",\n- [\"dist-tag\", \"rm\", pkg.name, tag],\n- getExecOpts(pkg.location, registry)\n- );\n+ return ChildProcessUtilities.exec(\"npm\", [\"dist-tag\", \"rm\", pkg.name, tag], getExecOpts(pkg, registry));\n}\n",
"new_path": "src/utils/npm-dist-tag.js",
"old_path": "src/utils/npm-dist-tag.js"
},
{
"change_type": "MODIFY",
"diff": "const log = require(\"npmlog\");\nconst npa = require(\"npm-package-arg\");\nconst onExit = require(\"signal-exit\");\n-const path = require(\"path\");\nconst writePkg = require(\"write-pkg\");\nconst ChildProcessUtilities = require(\"../ChildProcessUtilities\");\n@@ -15,7 +14,7 @@ module.exports.dependencies = installInDir;\nfunction npmInstall(pkg, { registry, npmClient, npmClientArgs, npmGlobalStyle, mutex }) {\n// build command, arguments, and options\n- const opts = getExecOpts(pkg.location, registry);\n+ const opts = getExecOpts(pkg, registry);\nconst args = [\"install\"];\nlet cmd = npmClient || \"npm\";\n@@ -41,7 +40,7 @@ function npmInstall(pkg, { registry, npmClient, npmClientArgs, npmGlobalStyle, m\n}\nfunction installInDir(pkg, dependencies, config) {\n- log.silly(\"installInDir\", path.basename(pkg.location), dependencies);\n+ log.silly(\"installInDir\", pkg.name, dependencies);\n// Nothing to do if we weren't given any deps.\nif (!(dependencies && dependencies.length)) {\n",
"new_path": "src/utils/npm-install.js",
"old_path": "src/utils/npm-install.js"
},
{
"change_type": "MODIFY",
"diff": "\"use strict\";\nconst log = require(\"npmlog\");\n-const path = require(\"path\");\nconst ChildProcessUtilities = require(\"../ChildProcessUtilities\");\nconst getExecOpts = require(\"./get-npm-exec-opts\");\n@@ -9,11 +8,9 @@ const getExecOpts = require(\"./get-npm-exec-opts\");\nmodule.exports = npmPublish;\nfunction npmPublish(tag, pkg, { npmClient, registry }) {\n- const directory = pkg.location;\n+ log.silly(\"npmPublish\", tag, pkg.name);\n- log.silly(\"npmPublish\", tag, path.basename(directory));\n-\n- const opts = getExecOpts(directory, registry);\n+ const opts = getExecOpts(pkg, registry);\nconst args = [\"publish\", \"--tag\", tag.trim()];\nif (npmClient === \"yarn\") {\n",
"new_path": "src/utils/npm-publish.js",
"old_path": "src/utils/npm-publish.js"
},
{
"change_type": "MODIFY",
"diff": "\"use strict\";\nconst log = require(\"npmlog\");\n-const path = require(\"path\");\nconst ChildProcessUtilities = require(\"../ChildProcessUtilities\");\nconst getOpts = require(\"./get-npm-exec-opts\");\n@@ -10,18 +9,13 @@ module.exports = runScript;\nmodule.exports.stream = stream;\nfunction runScript(script, { args, npmClient, pkg }) {\n- log.silly(\"npmRunScript\", script, args, path.basename(pkg.location));\n+ log.silly(\"npmRunScript\", script, args, pkg.name);\n- return ChildProcessUtilities.exec(npmClient, [\"run\", script, ...args], getOpts(pkg.location));\n+ return ChildProcessUtilities.exec(npmClient, [\"run\", script, ...args], getOpts(pkg));\n}\nfunction stream(script, { args, npmClient, pkg }) {\nlog.silly(\"npmRunScript.stream\", [script, args, pkg.name]);\n- return ChildProcessUtilities.spawnStreaming(\n- npmClient,\n- [\"run\", script, ...args],\n- getOpts(pkg.location),\n- pkg.name\n- );\n+ return ChildProcessUtilities.spawnStreaming(npmClient, [\"run\", script, ...args], getOpts(pkg), pkg.name);\n}\n",
"new_path": "src/utils/npm-run-script.js",
"old_path": "src/utils/npm-run-script.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
refactor(utils/npm-*): pass Package to getExecOpts()
| 1
|
refactor
|
utils/npm-*
|
807,849
|
02.03.2018 12:47:27
| 28,800
|
aaac03071e31f1584eb27fe65313280126ef5b8d
|
fix: avoid redundant Object.assign() in execa
|
[
{
"change_type": "MODIFY",
"diff": "@@ -10,6 +10,7 @@ function getExecOpts(pkg, registry) {\n};\nif (registry) {\n+ opts.extendEnv = false;\nopts.env = Object.assign({}, process.env, {\nnpm_config_registry: registry,\n});\n",
"new_path": "src/utils/get-npm-exec-opts.js",
"old_path": "src/utils/get-npm-exec-opts.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -38,6 +38,7 @@ describe(\"dist-tag\", () => {\nenv: expect.objectContaining({\nnpm_config_registry: registry,\n}),\n+ extendEnv: false,\n});\n});\n});\n@@ -66,6 +67,7 @@ describe(\"dist-tag\", () => {\nenv: expect.objectContaining({\nnpm_config_registry: registry,\n}),\n+ extendEnv: false,\n});\n});\n});\n@@ -99,6 +101,7 @@ describe(\"dist-tag\", () => {\nenv: expect.objectContaining({\nnpm_config_registry: registry,\n}),\n+ extendEnv: false,\n});\n});\n});\n",
"new_path": "test/utils-npm-dist-tag.test.js",
"old_path": "test/utils-npm-dist-tag.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -169,6 +169,7 @@ describe(\"npm-install\", () => {\nenv: expect.objectContaining({\nnpm_config_registry: registry,\n}),\n+ extendEnv: false,\n});\n});\n",
"new_path": "test/utils-npm-install.test.js",
"old_path": "test/utils-npm-install.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -43,6 +43,7 @@ describe(\"npm-publish\", () => {\nenv: expect.objectContaining({\nnpm_config_registry: registry,\n}),\n+ extendEnv: false,\n});\n});\n",
"new_path": "test/utils-npm-publish.test.js",
"old_path": "test/utils-npm-publish.test.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
fix: avoid redundant Object.assign() in execa
| 1
|
fix
| null |
807,849
|
02.03.2018 12:47:51
| 28,800
|
a75fe7df9f905cf2e170e9a82aee1b3bf6b66f2a
|
refactor(npm-install): rename internal function
|
[
{
"change_type": "MODIFY",
"diff": "@@ -10,7 +10,7 @@ const FileSystemUtilities = require(\"../FileSystemUtilities\");\nconst getExecOpts = require(\"./get-npm-exec-opts\");\nmodule.exports = npmInstall;\n-module.exports.dependencies = installInDir;\n+module.exports.dependencies = npmInstallDependencies;\nfunction npmInstall(pkg, { registry, npmClient, npmClientArgs, npmGlobalStyle, mutex }) {\n// build command, arguments, and options\n@@ -39,23 +39,23 @@ function npmInstall(pkg, { registry, npmClient, npmClientArgs, npmGlobalStyle, m\nreturn ChildProcessUtilities.exec(cmd, args, opts);\n}\n-function installInDir(pkg, dependencies, config) {\n- log.silly(\"installInDir\", pkg.name, dependencies);\n+function npmInstallDependencies(pkg, dependencies, config) {\n+ log.silly(\"npmInstallDependencies\", pkg.name, dependencies);\n// Nothing to do if we weren't given any deps.\nif (!(dependencies && dependencies.length)) {\n- log.verbose(\"installInDir\", \"no dependencies to install\");\n+ log.verbose(\"npmInstallDependencies\", \"no dependencies to install\");\nreturn Promise.resolve();\n}\nconst packageJsonBkp = `${pkg.manifestLocation}.lerna_backup`;\n- log.silly(\"installInDir\", \"backup\", pkg.manifestLocation);\n+ log.silly(\"npmInstallDependencies\", \"backup\", pkg.manifestLocation);\nreturn FileSystemUtilities.rename(pkg.manifestLocation, packageJsonBkp).then(() => {\nconst cleanup = () => {\n- log.silly(\"installInDir\", \"cleanup\", pkg.manifestLocation);\n+ log.silly(\"npmInstallDependencies\", \"cleanup\", pkg.manifestLocation);\n// Need to do this one synchronously because we might be doing it on exit.\nFileSystemUtilities.renameSync(packageJsonBkp, pkg.manifestLocation);\n};\n@@ -76,7 +76,7 @@ function installInDir(pkg, dependencies, config) {\n// mutate a clone of the manifest with our new versions\nconst tempJson = transformManifest(pkg, dependencies);\n- log.silly(\"installInDir\", \"writing tempJson\", tempJson);\n+ log.silly(\"npmInstallDependencies\", \"writing tempJson\", tempJson);\n// Write out our temporary cooked up package.json and then install.\nreturn writePkg(pkg.manifestLocation, tempJson)\n@@ -91,9 +91,9 @@ function transformManifest(pkg, dependencies) {\n// a map of depName => depVersion (resolved by npm-package-arg)\nconst depMap = new Map(\ndependencies.map(dep => {\n- const result = npa(dep, pkg.location);\n+ const { name, rawSpec } = npa(dep, pkg.location);\n- return [result.name, result.rawSpec || \"*\"];\n+ return [name, rawSpec || \"*\"];\n})\n);\n",
"new_path": "src/utils/npm-install.js",
"old_path": "src/utils/npm-install.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
refactor(npm-install): rename internal function
| 1
|
refactor
|
npm-install
|
791,719
|
02.03.2018 13:12:10
| 28,800
|
c60efa4a2a8eb0f8c135973a142ed56d536f6e92
|
report(description): update helpText for document.title audit
|
[
{
"change_type": "MODIFY",
"diff": "@@ -20,10 +20,10 @@ class DocumentTitle extends AxeAudit {\nreturn {\nname: 'document-title',\ndescription: 'Document has a `<title>` element',\n- failureDescription: 'Document does not have a `<title>` element',\n- helpText: 'Screen reader users use page titles to get an overview of the contents of ' +\n- 'the page. ' +\n- '[Learn more](https://dequeuniversity.com/rules/axe/2.2/document-title?application=lighthouse).',\n+ failureDescription: 'Document doesn\\'t have a `<title>` element',\n+ helpText: 'The title gives screen reader users an overview of the page, and search ' +\n+ 'engine users rely on it heavily to determine if a page is relevant to their search. ' +\n+ '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/title).',\nrequiredArtifacts: ['Accessibility'],\n};\n}\n",
"new_path": "lighthouse-core/audits/accessibility/document-title.js",
"old_path": "lighthouse-core/audits/accessibility/document-title.js"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
report(description): update helpText for document.title audit (#4677)
| 1
|
report
|
description
|
679,913
|
02.03.2018 15:42:05
| 0
|
3d8aa324d0ad3f2f3c3f9031ff932b6b0f41466e
|
fix(transducers): flattenWith()
|
[
{
"change_type": "MODIFY",
"diff": "@@ -6,9 +6,9 @@ export function flattenWith<T>(fn: (x: T) => Iterable<T>): Transducer<T | Iterab\nreturn (rfn: Reducer<any, T>) => {\nconst r = rfn[2];\nconst flatten = (acc, x) => {\n- x = fn(x);\n- if (x) {\n- for (let y of x) {\n+ const xx = fn(x);\n+ if (xx) {\n+ for (let y of xx) {\nacc = flatten(acc, y);\nif (isReduced(acc)) {\nbreak;\n@@ -18,6 +18,6 @@ export function flattenWith<T>(fn: (x: T) => Iterable<T>): Transducer<T | Iterab\n}\nreturn r(acc, x);\n};\n- return compR(rfn, fn);\n+ return compR(rfn, flatten);\n};\n}\n",
"new_path": "packages/transducers/src/xform/flatten-with.ts",
"old_path": "packages/transducers/src/xform/flatten-with.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
fix(transducers): flattenWith()
| 1
|
fix
|
transducers
|
679,913
|
02.03.2018 15:46:09
| 0
|
2316d4d1bc2094fcd639a878c2f75f854948ad3e
|
test(transducers): add flatten() tests
|
[
{
"change_type": "ADD",
"diff": "+import * as tx from \"../src\";\n+\n+import * as assert from \"assert\";\n+\n+describe(\"flatten\", () => {\n+ it(\"empty arrays\", () => {\n+ assert.deepEqual(tx.transduce(tx.flatten(), tx.push(), []), []);\n+ assert.deepEqual(tx.transduce(tx.flatten(), tx.push(), [[], []]), []);\n+ });\n+ it(\"arrays\", () => {\n+ assert.deepEqual(tx.transduce(tx.flatten(), tx.push(), [undefined]), [undefined]);\n+ assert.deepEqual(tx.transduce(tx.flatten(), tx.push(), [[undefined], null]), [undefined, null]);\n+ });\n+ it(\"strings\", () => {\n+ assert.deepEqual(tx.transduce(tx.flatten(), tx.push(), [\"\", \"a\"]), [\"\", \"a\"]);\n+ assert.deepEqual(tx.transduce(tx.flatten(), tx.push(), [[], [\"a\"], \"\"]), [\"a\", \"\"]);\n+ });\n+ it(\"iterators\", () => {\n+ assert.deepEqual(tx.transduce(tx.flatten(), tx.push(), tx.range(0)), []);\n+ assert.deepEqual(tx.transduce(tx.flatten(), tx.push(), [tx.range(0)]), []);\n+ assert.deepEqual(tx.transduce(tx.flatten(), tx.push(), [tx.range(2), tx.range(0)]), [0, 1]);\n+ })\n+});\n",
"new_path": "packages/transducers/test/flatten.ts",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
test(transducers): add flatten() tests
| 1
|
test
|
transducers
|
807,849
|
02.03.2018 16:23:47
| 28,800
|
49289078c3da073d0de56cd1de788bbb57a69aa7
|
chore: remove double-dash workaround
Jest 22.4+ fixed the underlying problem.
|
[
{
"change_type": "MODIFY",
"diff": "@@ -14,7 +14,6 @@ module.exports = commandRunner;\n*/\nfunction commandRunner(commandModule) {\nconst cmd = commandModule.command.split(\" \")[0];\n- const hackDoubleDash = makeWorkAround();\nreturn cwd => {\n// create a _new_ yargs instance every time cwd changes to avoid singleton pollution\n@@ -50,9 +49,6 @@ function commandRunner(commandModule) {\nObject.assign(yargsMeta, { parsedArgv, yargsOutput });\n};\n- // workaround wonky yargs-parser configuration not being read during tests\n- hackDoubleDash(args, context);\n-\ncli\n.fail((msg, err) => {\n// since yargs 10.1.0, this is the only way to catch handler rejection\n@@ -66,21 +62,3 @@ function commandRunner(commandModule) {\n});\n};\n}\n-\n-function makeWorkAround() {\n- let hasWarned;\n-\n- return (args, context) => {\n- const doubleDashed = args.indexOf(\"--\");\n-\n- if (doubleDashed > -1) {\n- if (!hasWarned) {\n- console.warn(\"TODO: remove yargs require.main workaround\");\n- hasWarned = true;\n- }\n-\n- // eslint-disable-next-line no-param-reassign\n- context[\"--\"] = args.slice(doubleDashed + 1);\n- }\n- };\n-}\n",
"new_path": "test/helpers/command-runner.js",
"old_path": "test/helpers/command-runner.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
chore: remove double-dash workaround
Jest 22.4+ fixed the underlying problem.
| 1
|
chore
| null |
807,849
|
02.03.2018 16:36:12
| 28,800
|
a4ce01bd88986c100f3a74e94e1b016f519bbc7f
|
chore: Update CHANGELOG for v3.0.0-alpha.3
|
[
{
"change_type": "MODIFY",
"diff": "+## v3.0.0-alpha.3 (2018-03-03)\n+\n+#### :bug: Bug Fix\n+\n+* [#1302](https://github.com/lerna/lerna/pull/1302) Use npm-lifecycle to run solitary lifecycle phases. ([@evocateur](https://github.com/evocateur))\n+\n+#### :nail_care: Polish\n+\n+* [#1300](https://github.com/lerna/lerna/pull/1300) Disable all non-error logging when stdout is piped. ([@evocateur](https://github.com/evocateur))\n+\n+#### Committers: 1\n+\n+* Daniel Stockman ([evocateur](https://github.com/evocateur))\n+\n## v3.0.0-alpha.2 (2018-03-02)\n#### :bug: Bug Fix\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
chore: Update CHANGELOG for v3.0.0-alpha.3
| 1
|
chore
| null |
679,913
|
02.03.2018 18:44:52
| 0
|
91938edeeca3efb037a009c64e08ef7db37bde19
|
feat(transducers): add permutations()/permutationsN() generators
|
[
{
"change_type": "MODIFY",
"diff": "@@ -108,6 +108,7 @@ export * from \"./iter/cycle\";\nexport * from \"./iter/iterate\";\nexport * from \"./iter/keys\";\nexport * from \"./iter/pairs\";\n+export * from \"./iter/permutations\";\nexport * from \"./iter/range\";\nexport * from \"./iter/range2d\";\nexport * from \"./iter/range3d\";\n",
"new_path": "packages/transducers/src/index.ts",
"old_path": "packages/transducers/src/index.ts"
},
{
"change_type": "ADD",
"diff": "+import { range } from \"./range\";\n+import { repeatedly } from \"./repeatedly\";\n+\n+/**\n+ * Iterator yielding the Cartesian Product of the given iterables.\n+ * All iterables MUST be finite!\n+ *\n+ * ```\n+ * [...permutations(range(3), \"ab\")]\n+ * // [ ['a', 0], ['a', 1], ['a', 2],\n+ * // ['b', 0], ['b', 1], ['b', 2] ]\n+ *\n+ * [...iterator(map((x) => x.join(\"\")), permutations(\"ab\", \"-\", tx.range(3)))]\n+ * // ['a-0', 'a-1', 'a-2', 'b-0', 'b-1', 'b-2']\n+ * ```\n+ *\n+ * @param src\n+ */\n+export function permutations<A>(a: Iterable<A>): IterableIterator<[A]>;\n+export function permutations<A, B>(a: Iterable<A>, b: Iterable<B>): IterableIterator<[A, B]>;\n+export function permutations<A, B, C>(a: Iterable<A>, b: Iterable<B>, c: Iterable<C>): IterableIterator<[A, B, C]>;\n+export function permutations<A, B, C, D>(a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>): IterableIterator<[A, B, C, D]>;\n+export function* permutations(...src: Iterable<any>[]): IterableIterator<any[]> {\n+ const n = src.length - 1;\n+ const step = new Array(n + 1).fill(0);\n+ const realized = src.map((s) => [...s]);\n+ const total = realized.reduce((acc, x) => acc * x.length, 1);\n+ for (let i = 0; i < total; i++) {\n+ const tuple = [];\n+ for (let j = n; j >= 0; j--) {\n+ const r = realized[j];\n+ let s = step[j];\n+ if (s === r.length) {\n+ step[j] = s = 0;\n+ j > 0 && (step[j - 1]++);\n+ }\n+ tuple[j] = r[s];\n+ }\n+ step[n]++;\n+ yield tuple;\n+ }\n+}\n+\n+/**\n+ * Iterator yielding the Cartesian Product for `n` items of `m` values each.\n+ * If `m` is not given, defaults to value of `n`. The range of `m` is `0..m-1`.\n+ *\n+ * ```\n+ * [...permutationsN(2)]\n+ * // [ [0, 0], [0, 1], [1, 0], [1, 1] ]\n+ *\n+ * [...permutationsN(2, 3)]\n+ * // [ [0, 0], [0, 1], [0, 2],\n+ * // [1, 0], [1, 1], [1, 2],\n+ * // [2, 0], [2, 1], [2, 2] ]\n+ * ```\n+ *\n+ * @param n\n+ * @param m\n+ */\n+export function permutationsN(n: number, m = n): IterableIterator<number[]> {\n+ return permutations.apply(null, [...repeatedly(() => range(m), n)]);\n+}\n",
"new_path": "packages/transducers/src/iter/permutations.ts",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(transducers): add permutations()/permutationsN() generators
| 1
|
feat
|
transducers
|
679,913
|
02.03.2018 21:08:37
| 0
|
488462e1dc7443cf3021c7530eb26c65029962f0
|
refactor(transducers): update permutations()/permutationsN(), add tests
|
[
{
"change_type": "MODIFY",
"diff": "import { range } from \"./range\";\n-import { repeatedly } from \"./repeatedly\";\n+import { isArray } from \"@thi.ng/checks/is-array\";\n+import { isString } from \"@thi.ng/checks/is-string\";\n/**\n* Iterator yielding the Cartesian Product of the given iterables.\n- * All iterables MUST be finite!\n+ * All iterables MUST be finite! If any of the given iterables is\n+ * empty the iterator yields no values.\n*\n* ```\n* [...permutations(range(3), \"ab\")]\n* // [ ['a', 0], ['a', 1], ['a', 2],\n* // ['b', 0], ['b', 1], ['b', 2] ]\n*\n- * [...iterator(map((x) => x.join(\"\")), permutations(\"ab\", \"-\", tx.range(3)))]\n+ * [...iterator(map((x: any[]) => x.join(\"\")), permutations(\"ab\", \"-\", tx.range(3)))]\n* // ['a-0', 'a-1', 'a-2', 'b-0', 'b-1', 'b-2']\n+ *\n+ * [...permutations([], \"\", range(0))]\n+ * // []\n* ```\n*\n* @param src\n@@ -22,8 +27,11 @@ export function permutations<A, B, C>(a: Iterable<A>, b: Iterable<B>, c: Iterabl\nexport function permutations<A, B, C, D>(a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>): IterableIterator<[A, B, C, D]>;\nexport function* permutations(...src: Iterable<any>[]): IterableIterator<any[]> {\nconst n = src.length - 1;\n+ if (n < 0) {\n+ return;\n+ }\nconst step = new Array(n + 1).fill(0);\n- const realized = src.map((s) => [...s]);\n+ const realized = src.map((s: any) => isArray(s) || isString(s) ? s : [...s]);\nconst total = realized.reduce((acc, x) => acc * x.length, 1);\nfor (let i = 0; i < total; i++) {\nconst tuple = [];\n@@ -58,6 +66,14 @@ export function* permutations(...src: Iterable<any>[]): IterableIterator<any[]>\n* @param n\n* @param m\n*/\n-export function permutationsN(n: number, m = n): IterableIterator<number[]> {\n- return permutations.apply(null, [...repeatedly(() => range(m), n)]);\n+export function permutationsN(n: number, m = n, offsets?: number[]): IterableIterator<number[]> {\n+ if (offsets && offsets.length < n) {\n+ throw new Error(\"not sufficient offsets given\");\n+ }\n+ const seqs = [];\n+ while (--n >= 0) {\n+ const o = offsets ? offsets[n] : 0;\n+ seqs[n] = range(o, o + m);\n+ }\n+ return permutations.apply(null, seqs);\n}\n",
"new_path": "packages/transducers/src/iter/permutations.ts",
"old_path": "packages/transducers/src/iter/permutations.ts"
},
{
"change_type": "ADD",
"diff": "+import { swizzler } from \"../src/func/swizzler\";\n+import { permutations, permutationsN } from \"../src/iter/permutations\";\n+import { range } from \"../src/iter/range\";\n+import { iterator } from \"../src/iterator\";\n+import { map } from \"../src/xform/map\";\n+\n+import * as assert from \"assert\";\n+\n+describe(\"permutations\", () => {\n+ it(\"empty\", () => {\n+ assert.deepEqual([...permutations([])], []);\n+ assert.deepEqual([...permutations(\"\")], []);\n+ assert.deepEqual([...permutations(range(0))], []);\n+ assert.deepEqual([...permutations([], [])], []);\n+ assert.deepEqual([...permutations([], \"\")], []);\n+ assert.deepEqual([...permutations(range(0), \"\")], []);\n+ assert.deepEqual([...permutations([], \"a\")], []);\n+ assert.deepEqual([...permutations(\"\", \"a\")], []);\n+ assert.deepEqual([...permutations(\"\", \"ab\")], []);\n+ assert.deepEqual([...permutations.apply(null, [])], []);\n+ });\n+ it(\"single\", () => {\n+ assert.deepEqual(\n+ [...permutations(\"a\", \"-\", range(1))],\n+ [[\"a\", \"-\", 0]]\n+ );\n+ assert.deepEqual(\n+ [...permutations(\"a\", \"-\", range(2))],\n+ [[\"a\", \"-\", 0], [\"a\", \"-\", 1]]\n+ );\n+ assert.deepEqual(\n+ [...permutations(\"a\", \"-+\", range(2))],\n+ [[\"a\", \"-\", 0], [\"a\", \"-\", 1], [\"a\", \"+\", 0], [\"a\", \"+\", 1]]\n+ );\n+ });\n+ it(\"transformed\", () => {\n+ assert.deepEqual(\n+ [...iterator(map((x: any[]) => x.join(\"\")), permutations(\"ab\", \"-\", range(2)))],\n+ ['a-0', 'a-1', 'b-0', 'b-1']\n+ );\n+ });\n+ it(\"swizzle\", () => {\n+ assert.deepEqual(\n+ [...iterator(map((x: string[]) => swizzler(x)({ x: 0, y: 1, z: 2 })), permutations(\"xyz\", \"xyz\", \"xyz\"))],\n+ [...permutationsN(3)]\n+ );\n+ });\n+});\n+\n+describe(\"permutationsN\", () => {\n+ it(\"empty\", () => {\n+ assert.deepEqual([...permutationsN(0)], []);\n+ });\n+ it(\"one\", () => {\n+ assert.deepEqual([...permutationsN(1)], [[0]]);\n+ });\n+ it(\"two\", () => {\n+ assert.deepEqual([...permutationsN(2)], [[0, 0], [0, 1], [1, 0], [1, 1]]);\n+ });\n+ it(\"two/three\", () => {\n+ assert.deepEqual(\n+ [...permutationsN(2, 3)],\n+ [\n+ [0, 0], [0, 1], [0, 2],\n+ [1, 0], [1, 1], [1, 2],\n+ [2, 0], [2, 1], [2, 2]\n+ ]\n+ );\n+ });\n+ it(\"with offsets\", () => {\n+ assert.deepEqual([...permutationsN(2, 2, [100, 1000])], [[100, 1000], [100, 1001], [101, 1000], [101, 1001]]);\n+ });\n+ it(\"insufficient offsets\", () => {\n+ assert.throws(() => permutationsN(2, 2, [0]));\n+ });\n+});\n\\ No newline at end of file\n",
"new_path": "packages/transducers/test/permutations.ts",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(transducers): update permutations()/permutationsN(), add tests
| 1
|
refactor
|
transducers
|
679,913
|
02.03.2018 21:09:29
| 0
|
2f5abce3dc77801e9964ad09baa5e91abaa40203
|
refactor(transducers): update swizzler() arg types
|
[
{
"change_type": "MODIFY",
"diff": "* swizzler([1, 1, 3, 3])([1, 2, 3, 4]) // [ 2, 2, 4, 4 ]\n* swizzler([2, 0])([1, 2, 3]) // [ 3, 1 ]\n* ```\n- * Even though, any object can be used as input, the returned\n- * values will always be in array form.\n+ * Even though, any object can be used as input to the generated\n+ * function, the returned values will always be in array form.\n*\n* ```\n* swizzler([\"a\", \"c\", \"b\"])({a: 1, b: 2, c: 3}) // [ 1, 3, 2 ]\n*\n* @param order indices\n*/\n-export function swizzler<T>(order: PropertyKey[]): (x: T) => any[] {\n+export function swizzler<T>(order: string | PropertyKey[]): (x: T) => any[] {\nconst [a, b, c, d, e, f, g, h] = order;\nswitch (order.length) {\ncase 0:\n",
"new_path": "packages/transducers/src/func/swizzler.ts",
"old_path": "packages/transducers/src/func/swizzler.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(transducers): update swizzler() arg types
| 1
|
refactor
|
transducers
|
791,813
|
03.03.2018 00:20:45
| -3,600
|
fd750fc20cc8dc0f07c73ba8da996f88869509b6
|
core(is-crawlable): determine if page indexing is blocked by robots.txt
|
[
{
"change_type": "MODIFY",
"diff": "'use strict';\nconst Audit = require('../audit');\n+const robotsParser = require('robots-parser');\n+const URL = require('../../lib/url-shim');\nconst BLOCKLIST = new Set([\n'noindex',\n'none',\n@@ -65,7 +67,7 @@ class IsCrawlable extends Audit {\nfailureDescription: 'Page is blocked from indexing',\nhelpText: 'The \"Robots\" directives tell crawlers how your content should be indexed. ' +\n'[Learn more](https://developers.google.com/search/reference/robots_meta_tag).',\n- requiredArtifacts: ['MetaRobots'],\n+ requiredArtifacts: ['MetaRobots', 'RobotsTxt'],\n};\n}\n@@ -96,8 +98,22 @@ class IsCrawlable extends Audit {\nhasBlockingDirective(h.value))\n.forEach(h => blockingDirectives.push({source: `${h.name}: ${h.value}`}));\n+ if (artifacts.RobotsTxt.content) {\n+ const robotsFileUrl = new URL('/robots.txt', mainResource.url);\n+ const robotsTxt = robotsParser(robotsFileUrl.href, artifacts.RobotsTxt.content);\n+\n+ if (!robotsTxt.isAllowed(mainResource.url)) {\n+ blockingDirectives.push({\n+ source: {\n+ type: 'url',\n+ text: robotsFileUrl.href,\n+ },\n+ });\n+ }\n+ }\n+\nconst headings = [\n- {key: 'source', itemType: 'code', text: 'Source'},\n+ {key: 'source', itemType: 'code', text: 'Blocking Directive Source'},\n];\nconst details = Audit.makeTableDetails(headings, blockingDirectives);\n",
"new_path": "lighthouse-core/audits/seo/is-crawlable.js",
"old_path": "lighthouse-core/audits/seo/is-crawlable.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -45,6 +45,7 @@ module.exports = {\n'seo/hreflang',\n'seo/embedded-content',\n'seo/canonical',\n+ 'seo/robots-txt',\n'fonts',\n],\n},\n",
"new_path": "lighthouse-core/config/default.js",
"old_path": "lighthouse-core/config/default.js"
},
{
"change_type": "ADD",
"diff": "+/**\n+ * @license Copyright 2018 Google Inc. All Rights Reserved.\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n+ */\n+'use strict';\n+\n+const Gatherer = require('../gatherer');\n+\n+/* global fetch, URL, location */\n+\n+function getRobotsTxtContent() {\n+ return fetch(new URL('/robots.txt', location.href))\n+ .then(response => {\n+ if (!response.ok) {\n+ return {status: response.status, content: null};\n+ }\n+\n+ return response.text()\n+ .then(content => ({status: response.status, content}));\n+ })\n+ .catch(_ => ({status: null, content: null}));\n+}\n+\n+\n+class RobotsTxt extends Gatherer {\n+ /**\n+ * @param {{driver: !Driver}} options Run options\n+ * @return {!Promise<!{code: number, content: string}>}\n+ */\n+ afterPass(options) {\n+ return options.driver.evaluateAsync(`(${getRobotsTxtContent.toString()}())`);\n+ }\n+}\n+\n+module.exports = RobotsTxt;\n",
"new_path": "lighthouse-core/gather/gatherers/seo/robots-txt.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -30,6 +30,7 @@ describe('SEO: Is page crawlable audit', () => {\ndevtoolsLogs: {[IsCrawlableAudit.DEFAULT_PASS]: []},\nrequestMainResource: () => Promise.resolve(mainResource),\nMetaRobots: robotsValue,\n+ RobotsTxt: {},\n};\nreturn IsCrawlableAudit.audit(artifacts).then(auditResult => {\n@@ -49,6 +50,7 @@ describe('SEO: Is page crawlable audit', () => {\ndevtoolsLogs: {[IsCrawlableAudit.DEFAULT_PASS]: []},\nrequestMainResource: () => Promise.resolve(mainResource),\nMetaRobots: 'all, noarchive',\n+ RobotsTxt: {},\n};\nreturn IsCrawlableAudit.audit(artifacts).then(auditResult => {\n@@ -64,6 +66,7 @@ describe('SEO: Is page crawlable audit', () => {\ndevtoolsLogs: {[IsCrawlableAudit.DEFAULT_PASS]: []},\nrequestMainResource: () => Promise.resolve(mainResource),\nMetaRobots: null,\n+ RobotsTxt: {},\n};\nreturn IsCrawlableAudit.audit(artifacts).then(auditResult => {\n@@ -102,6 +105,7 @@ describe('SEO: Is page crawlable audit', () => {\ndevtoolsLogs: {[IsCrawlableAudit.DEFAULT_PASS]: []},\nrequestMainResource: () => Promise.resolve(mainResource),\nMetaRobots: null,\n+ RobotsTxt: {},\n};\nreturn IsCrawlableAudit.audit(artifacts).then(auditResult => {\n@@ -124,6 +128,7 @@ describe('SEO: Is page crawlable audit', () => {\ndevtoolsLogs: {[IsCrawlableAudit.DEFAULT_PASS]: []},\nrequestMainResource: () => Promise.resolve(mainResource),\nMetaRobots: null,\n+ RobotsTxt: {},\n};\nreturn IsCrawlableAudit.audit(artifacts).then(auditResult => {\n@@ -131,7 +136,7 @@ describe('SEO: Is page crawlable audit', () => {\n});\n});\n- it('succeeds when there is no robots header', () => {\n+ it('succeeds when there is no robots header and robots.txt is unavailable', () => {\nconst mainResource = {\nresponseHeaders: [],\n};\n@@ -139,6 +144,7 @@ describe('SEO: Is page crawlable audit', () => {\ndevtoolsLogs: {[IsCrawlableAudit.DEFAULT_PASS]: []},\nrequestMainResource: () => Promise.resolve(mainResource),\nMetaRobots: null,\n+ RobotsTxt: {},\n};\nreturn IsCrawlableAudit.audit(artifacts).then(auditResult => {\n@@ -157,6 +163,7 @@ describe('SEO: Is page crawlable audit', () => {\ndevtoolsLogs: {[IsCrawlableAudit.DEFAULT_PASS]: []},\nrequestMainResource: () => Promise.resolve(mainResource),\nMetaRobots: null,\n+ RobotsTxt: {},\n};\nreturn IsCrawlableAudit.audit(artifacts).then(auditResult => {\n@@ -164,22 +171,112 @@ describe('SEO: Is page crawlable audit', () => {\n});\n});\n+ it('fails when page is blocked from indexing by robots.txt', () => {\n+ const robotsTxts = [\n+ {\n+ content: `User-agent: *\n+ Disallow: /`,\n+ },\n+ {\n+ content: `User-agent: *\n+ Disallow: /test/page.html`,\n+ },\n+ {\n+ content: `User-agent: *\n+ Disallow:\n+\n+ User-agent: *\n+ Disallow: /`,\n+ },\n+ {\n+ content: `User-agent: *\n+ Disallow: /one/\n+ Disallow: /two/\n+ Disallow: /test/\n+ Allow: page.html\n+ # Allow: /test/page.html\n+ Allow: /test/page.html /someother/url.html`,\n+ },\n+ ];\n+\n+ const allRuns = robotsTxts.map(robotsTxt => {\n+ const mainResource = {\n+ url: 'http://example.com/test/page.html',\n+ responseHeaders: [],\n+ };\n+ const artifacts = {\n+ devtoolsLogs: {[IsCrawlableAudit.DEFAULT_PASS]: []},\n+ requestMainResource: () => Promise.resolve(mainResource),\n+ MetaRobots: null,\n+ RobotsTxt: robotsTxt,\n+ };\n+\n+ return IsCrawlableAudit.audit(artifacts).then(auditResult => {\n+ assert.equal(auditResult.rawValue, false);\n+ assert.equal(auditResult.details.items.length, 1);\n+ });\n+ });\n+\n+ return Promise.all(allRuns);\n+ });\n+\n+ it('succeeds when page is allowed by robots.txt', () => {\n+ const robotsTxts = [\n+ {\n+ content: `User-agent: SomeBot\n+ Disallow: /`,\n+ },\n+ {\n+ content: `User-agent: *\n+ Disallow: /_/\n+ Disallow: /search?q=*\n+ Disallow: /test/\n+ Allow: /test/page.html`,\n+ },\n+ ];\n+\n+ const allRuns = robotsTxts.map(robotsTxt => {\n+ const mainResource = {\n+ url: 'http://example.com/test/page.html',\n+ responseHeaders: [],\n+ };\n+ const artifacts = {\n+ devtoolsLogs: {[IsCrawlableAudit.DEFAULT_PASS]: []},\n+ requestMainResource: () => Promise.resolve(mainResource),\n+ MetaRobots: null,\n+ RobotsTxt: robotsTxt,\n+ };\n+\n+ return IsCrawlableAudit.audit(artifacts).then(auditResult => {\n+ assert.equal(auditResult.rawValue, true);\n+ });\n+ });\n+\n+ return Promise.all(allRuns);\n+ });\n+\nit('returns all failing items', () => {\nconst mainResource = {\n+ url: 'http://example.com/test/page.html',\nresponseHeaders: [\n{name: 'x-robots-tag', value: 'none'},\n{name: 'x-robots-tag', value: 'noindex'},\n],\n};\n+ const robotsTxt = {\n+ content: `User-agent: *\n+ Disallow: /`,\n+ };\nconst artifacts = {\ndevtoolsLogs: {[IsCrawlableAudit.DEFAULT_PASS]: []},\nrequestMainResource: () => Promise.resolve(mainResource),\nMetaRobots: 'noindex',\n+ RobotsTxt: robotsTxt,\n};\nreturn IsCrawlableAudit.audit(artifacts).then(auditResult => {\nassert.equal(auditResult.rawValue, false);\n- assert.equal(auditResult.details.items.length, 3);\n+ assert.equal(auditResult.details.items.length, 4);\n});\n});\n});\n",
"new_path": "lighthouse-core/test/audits/seo/is-crawlable-test.js",
"old_path": "lighthouse-core/test/audits/seo/is-crawlable-test.js"
},
{
"change_type": "MODIFY",
"diff": "\"parse-cache-control\": \"1.0.1\",\n\"raven\": \"^2.2.1\",\n\"rimraf\": \"^2.6.1\",\n+ \"robots-parser\": \"^1.0.2\",\n\"semver\": \"^5.3.0\",\n\"speedline\": \"1.3.0\",\n\"update-notifier\": \"^2.1.0\",\n",
"new_path": "package.json",
"old_path": "package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -3606,6 +3606,10 @@ rimraf@~2.2.6:\nversion \"2.2.8\"\nresolved \"https://registry.yarnpkg.com/rimraf/-/rimraf-2.2.8.tgz#e439be2aaee327321952730f99a8929e4fc50582\"\n+robots-parser@^1.0.2:\n+ version \"1.0.2\"\n+ resolved \"https://registry.npmjs.org/robots-parser/-/robots-parser-1.0.2.tgz#9ebe25b1a2c52773cbe6f1dbe90ebc9518089009\"\n+\nrun-async@^2.2.0:\nversion \"2.3.0\"\nresolved \"https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0\"\n",
"new_path": "yarn.lock",
"old_path": "yarn.lock"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
core(is-crawlable): determine if page indexing is blocked by robots.txt (#4548)
| 1
|
core
|
is-crawlable
|
679,913
|
03.03.2018 03:22:24
| 0
|
f1c53150b19d768a2c7a4a8f34a1a53eabf3f32e
|
refactor(hdom): rename package hiccup-dom => hdom
|
[
{
"change_type": "RENAME",
"diff": "",
"new_path": "packages/hdom/.npmignore",
"old_path": "packages/hiccup-dom/.npmignore"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "packages/hdom/CHANGELOG.md",
"old_path": "packages/hiccup-dom/CHANGELOG.md"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "packages/hdom/LICENSE",
"old_path": "packages/hiccup-dom/LICENSE"
},
{
"change_type": "RENAME",
"diff": "-# @thi.ng/hiccup-dom\n+# @thi.ng/hdom\n-[](https://www.npmjs.com/package/@thi.ng/hiccup-dom)\n+[](https://www.npmjs.com/package/@thi.ng/hdom)\n+\n+**As of 2018-03-03 this package is now called @thi.ng/hdom, formerly @thi.ng/hiccup-dom**\n## About\n@@ -24,7 +26,7 @@ Benefits:\n```typescript\nimport * as hiccup from \"@thi.ng/hiccup\";\n-import * as hdom from \"@thi.ng/hiccup-dom\";\n+import * as hdom from \"@thi.ng/hdom\";\n// stateless component w/ params\nconst greeter = (name) => [\"h1.title\", \"hello \", name];\n@@ -53,7 +55,7 @@ console.log(hiccup.serialize(app()));\n// <div id=\"app\"><h1 class=\"title\">hello world</h1><button>clicks: 0</button><button>clicks: 100</button></div>\n```\n-[Live demo](http://demo.thi.ng/umbrella/hiccup-dom/basics/) | [standalone example](../../examples/hdom-basics)\n+[Live demo](http://demo.thi.ng/umbrella/hdom/basics/) | [standalone example](../../examples/hdom-basics)\nNo template engine & no precompilation steps needed, just use the full\nexpressiveness of ES6/TypeScript to define your DOM tree. The additional\n@@ -87,7 +89,7 @@ This project is currently still in BETA. The overall \"API\" is stable, but there'\n## Installation\n```\n-yarn add @thi.ng/hiccup-dom\n+yarn add @thi.ng/hdom\n```\n## Usage examples\n@@ -112,7 +114,7 @@ This is a preview of the upcoming [@thi.ng/estuary](https://github.com/thi-ng/um\nA fully documented todo list app with undo / redo feature is here:\n-[Source](https://github.com/thi-ng/umbrella/tree/master/examples/todo-list) | [Live demo](http://demo.thi.ng/umbrella/hiccup-dom/todo-list/)\n+[Source](https://github.com/thi-ng/umbrella/tree/master/examples/todo-list) | [Live demo](http://demo.thi.ng/umbrella/hdom/todo-list/)\n### Cellular automata\n@@ -120,20 +122,20 @@ A fully documented todo list app with undo / redo feature is here:\n### SVG particles\n-[Source](https://github.com/thi-ng/umbrella/tree/master/examples/svg-particles) | [Live demo](http://demo.thi.ng/umbrella/hiccup-dom/svg-particles/)\n+[Source](https://github.com/thi-ng/umbrella/tree/master/examples/svg-particles) | [Live demo](http://demo.thi.ng/umbrella/hdom/svg-particles/)\n### JSON based components\n-[Source](https://github.com/thi-ng/umbrella/tree/master/examples/json-components) | [Live demo](http://demo.thi.ng/umbrella/hiccup-dom/json-components/)\n+[Source](https://github.com/thi-ng/umbrella/tree/master/examples/json-components) | [Live demo](http://demo.thi.ng/umbrella/hdom/json-components/)\n### Basic usage patterns\nThe code below is also available as standalone project in: [/examples/dashboard](https://github.com/thi-ng/umbrella/tree/master/examples/dashboard)\n-[Live demo here](http://demo.thi.ng/umbrella/hiccup-dom/dashboard/)\n+[Live demo here](http://demo.thi.ng/umbrella/hdom/dashboard/)\n```typescript\n-import { start } from \"@thi.ng/hiccup-dom\";\n+import { start } from \"@thi.ng/hdom\";\n// static component function to create styled box\nconst box = (prefix, body) =>\n@@ -177,7 +179,7 @@ TODO example forthcoming...\nA stress test benchmark is here: [/examples/benchmark](https://github.com/thi-ng/umbrella/tree/master/examples/hdom-benchmark)\n-[Live demo here](http://demo.thi.ng/umbrella/hiccup-dom/benchmark/)\n+[Live demo here](http://demo.thi.ng/umbrella/hdom/benchmark/)\nBased on [user feedback collected via\nTwitter](https://twitter.com/toxi/status/959246871339454464), performance\n",
"new_path": "packages/hdom/README.md",
"old_path": "packages/hiccup-dom/README.md"
},
{
"change_type": "RENAME",
"diff": "{\n- \"name\": \"@thi.ng/hiccup-dom\",\n+ \"name\": \"@thi.ng/hdom\",\n\"version\": \"1.2.1\",\n\"description\": \"TODO\",\n\"main\": \"./index.js\",\n",
"new_path": "packages/hdom/package.json",
"old_path": "packages/hiccup-dom/package.json"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "packages/hdom/src/api.ts",
"old_path": "packages/hiccup-dom/src/api.ts"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "packages/hdom/src/diff.ts",
"old_path": "packages/hiccup-dom/src/diff.ts"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "packages/hdom/src/dom.ts",
"old_path": "packages/hiccup-dom/src/dom.ts"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "packages/hdom/src/index.ts",
"old_path": "packages/hiccup-dom/src/index.ts"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "packages/hdom/src/normalize.ts",
"old_path": "packages/hiccup-dom/src/normalize.ts"
},
{
"change_type": "RENAME",
"diff": "@@ -10,7 +10,7 @@ import { normalizeTree } from \"./normalize\";\n*\n* Important: The parent element given is assumed to have NO\n* children at the time when `start()` is called. Since\n- * hiccup-dom does NOT track the real DOM, the resulting\n+ * hdom does NOT track the real DOM, the resulting\n* changes will result in potentially undefined behavior\n* if the parent element wasn't empty.\n*\n",
"new_path": "packages/hdom/src/start.ts",
"old_path": "packages/hiccup-dom/src/start.ts"
},
{
"change_type": "RENAME",
"diff": "// import * as hdom from \"../src/index\";\n-describe(\"hiccup-dom\", function () {\n+describe(\"hdom\", function () {\nit(\"tests pending\");\n});\n",
"new_path": "packages/hdom/test/index.ts",
"old_path": "packages/hiccup-dom/test/index.ts"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "packages/hdom/test/tsconfig.json",
"old_path": "packages/hiccup-dom/test/tsconfig.json"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "packages/hdom/tsconfig.json",
"old_path": "packages/hiccup-dom/tsconfig.json"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(hdom): rename package hiccup-dom => hdom
| 1
|
refactor
|
hdom
|
679,913
|
03.03.2018 03:25:25
| 0
|
79e1b0978f65a0f7817cf993c865d1fa62cd9e42
|
docs(hdom): update readme
BREAKING CHANGE: rename package hiccup-dom => hdom
|
[
{
"change_type": "MODIFY",
"diff": "@@ -17,7 +17,7 @@ Benefits:\n- No pre-processing / pre-compilation steps\n- No string parsing / interpolation steps\n- Less verbose than HTML, resulting in smaller file sizes\n-- Static components can be distributed as JSON (or [dynamically compose components, based on JSON data](../../examples/json-components))\n+- Static components can be distributed as JSON (or [dynamically compose components, based on JSON data](https://github.com/thi-ng/umbrella/tree/master/examples/json-components))\n- Supports SVG, arbitrary elements, attributes, events\n- CSS conversion from JS objects\n- Suitable for server side rendering (by passing the same data structure to @thi.ng/hiccup's `serialize()`)\n@@ -55,7 +55,7 @@ console.log(hiccup.serialize(app()));\n// <div id=\"app\"><h1 class=\"title\">hello world</h1><button>clicks: 0</button><button>clicks: 100</button></div>\n```\n-[Live demo](http://demo.thi.ng/umbrella/hdom/basics/) | [standalone example](../../examples/hdom-basics)\n+[Live demo](http://demo.thi.ng/umbrella/hdom-basics/) | [standalone example](https://github.com/thi-ng/umbrella/tree/master/examples/hdom-basics)\nNo template engine & no precompilation steps needed, just use the full\nexpressiveness of ES6/TypeScript to define your DOM tree. The additional\n@@ -68,7 +68,7 @@ difference between the old and new DOM trees (both nested JS arrays).\nComponents can be defined as static arrays, closures or objects with life cycle\nhooks (init, render, release).\n-\n+\nThe syntax is inspired by Clojure's\n[Hiccup](https://github.com/weavejester/hiccup) and\n@@ -84,7 +84,7 @@ subscriptions. More examples are forthcoming...\n## Status\n-This project is currently still in BETA. The overall \"API\" is stable, but there's still further work planned on optimization and generalization beyond the standard browser DOM use cases (see #4). Furthermore, the project has been used for several projects in production since 2016.\n+This project is currently still in BETA. The overall \"API\" is stable, but there's still further work planned on optimization and generalization beyond the standard browser DOM use cases. Furthermore, the project has been used for several projects in production since 2016.\n## Installation\n@@ -114,7 +114,7 @@ This is a preview of the upcoming [@thi.ng/estuary](https://github.com/thi-ng/um\nA fully documented todo list app with undo / redo feature is here:\n-[Source](https://github.com/thi-ng/umbrella/tree/master/examples/todo-list) | [Live demo](http://demo.thi.ng/umbrella/hdom/todo-list/)\n+[Source](https://github.com/thi-ng/umbrella/tree/master/examples/todo-list) | [Live demo](http://demo.thi.ng/umbrella/todo-list/)\n### Cellular automata\n@@ -122,17 +122,17 @@ A fully documented todo list app with undo / redo feature is here:\n### SVG particles\n-[Source](https://github.com/thi-ng/umbrella/tree/master/examples/svg-particles) | [Live demo](http://demo.thi.ng/umbrella/hdom/svg-particles/)\n+[Source](https://github.com/thi-ng/umbrella/tree/master/examples/svg-particles) | [Live demo](http://demo.thi.ng/umbrella/svg-particles/)\n### JSON based components\n-[Source](https://github.com/thi-ng/umbrella/tree/master/examples/json-components) | [Live demo](http://demo.thi.ng/umbrella/hdom/json-components/)\n+[Source](https://github.com/thi-ng/umbrella/tree/master/examples/json-components) | [Live demo](http://demo.thi.ng/umbrella/json-components/)\n### Basic usage patterns\nThe code below is also available as standalone project in: [/examples/dashboard](https://github.com/thi-ng/umbrella/tree/master/examples/dashboard)\n-[Live demo here](http://demo.thi.ng/umbrella/hdom/dashboard/)\n+[Live demo here](http://demo.thi.ng/umbrella/dashboard/)\n```typescript\nimport { start } from \"@thi.ng/hdom\";\n@@ -179,7 +179,7 @@ TODO example forthcoming...\nA stress test benchmark is here: [/examples/benchmark](https://github.com/thi-ng/umbrella/tree/master/examples/hdom-benchmark)\n-[Live demo here](http://demo.thi.ng/umbrella/hdom/benchmark/)\n+[Live demo here](http://demo.thi.ng/umbrella/hdom-benchmark/)\nBased on [user feedback collected via\nTwitter](https://twitter.com/toxi/status/959246871339454464), performance\n",
"new_path": "packages/hdom/README.md",
"old_path": "packages/hdom/README.md"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs(hdom): update readme
BREAKING CHANGE: rename package hiccup-dom => hdom
| 1
|
docs
|
hdom
|
679,913
|
03.03.2018 03:27:09
| 0
|
752a78bba4411c7efeb6e314d8d68fca4bf5b710
|
feat(hdom-components): rename package hiccup-dom-component => hdom-components
BREAKING CHANGE: rename package hiccup-dom-component => hdom-components
|
[
{
"change_type": "RENAME",
"diff": "",
"new_path": "packages/hdom-components/.npmignore",
"old_path": "packages/hiccup-dom-components/.npmignore"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "packages/hdom-components/CHANGELOG.md",
"old_path": "packages/hiccup-dom-components/CHANGELOG.md"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "packages/hdom-components/LICENSE",
"old_path": "packages/hiccup-dom-components/LICENSE"
},
{
"change_type": "RENAME",
"diff": "-# @thi.ng/hiccup-dom-components\n+# @thi.ng/hdom-components\n-[](https://www.npmjs.com/package/@thi.ng/hiccup-dom-components)\n+[](https://www.npmjs.com/package/@thi.ng/hdom-components)\n+\n+**As of 2018-03-03 this package is now called @thi.ng/hdom-components, formerly @thi.ng/hiccup-dom-components**\n## About\nA growing collection of unstyled, re-usable & customizable components for use\nwith\n-[@thi.ng/hiccup-dom](https://github.com/thi-ng/umbrella/tree/master/packages/hiccup-dom)\n+[@thi.ng/hdom](https://github.com/thi-ng/umbrella/tree/master/packages/hdom)\n&\n[@thi.ng/hiccup](https://github.com/thi-ng/umbrella/tree/master/packages/hiccup).\n@@ -15,13 +17,13 @@ with\n## Installation\n```\n-yarn add @thi.ng/hiccup-dom-components\n+yarn add @thi.ng/hdom-components\n```\n## Usage examples\n```typescript\n-import * as hdc from \"@thi.ng/hiccup-dom-components\";\n+import * as hdc from \"@thi.ng/hdom-components\";\n```\n### Canvas\n",
"new_path": "packages/hdom-components/README.md",
"old_path": "packages/hiccup-dom-components/README.md"
},
{
"change_type": "RENAME",
"diff": "{\n- \"name\": \"@thi.ng/hiccup-dom-components\",\n+ \"name\": \"@thi.ng/hdom-components\",\n\"version\": \"0.2.2\",\n\"description\": \"TODO\",\n\"main\": \"./index.js\",\n",
"new_path": "packages/hdom-components/package.json",
"old_path": "packages/hiccup-dom-components/package.json"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "packages/hdom-components/src/canvas.ts",
"old_path": "packages/hiccup-dom-components/src/canvas.ts"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "packages/hdom-components/src/dropdown.ts",
"old_path": "packages/hiccup-dom-components/src/dropdown.ts"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "packages/hdom-components/src/index.ts",
"old_path": "packages/hiccup-dom-components/src/index.ts"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "packages/hdom-components/src/link.ts",
"old_path": "packages/hiccup-dom-components/src/link.ts"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "packages/hdom-components/src/svg.ts",
"old_path": "packages/hiccup-dom-components/src/svg.ts"
},
{
"change_type": "RENAME",
"diff": "// import * as assert from \"assert\";\n// import * as hc from \"../src/index\";\n-describe(\"hiccup-dom-components\", () => {\n+describe(\"hdom-components\", () => {\nit(\"tests pending\");\n});\n",
"new_path": "packages/hdom-components/test/index.ts",
"old_path": "packages/hiccup-dom-components/test/index.ts"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "packages/hdom-components/test/tsconfig.json",
"old_path": "packages/hiccup-dom-components/test/tsconfig.json"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "packages/hdom-components/tsconfig.json",
"old_path": "packages/hiccup-dom-components/tsconfig.json"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(hdom-components): rename package hiccup-dom-component => hdom-components
BREAKING CHANGE: rename package hiccup-dom-component => hdom-components
| 1
|
feat
|
hdom-components
|
679,913
|
03.03.2018 03:49:52
| 0
|
db98e5e56e0a881ce9f7007d2a98924858713a2d
|
chore: update make-example
|
[
{
"change_type": "MODIFY",
"diff": "@@ -31,10 +31,10 @@ cat << EOF > $MODULE/package.json\n\"webpack\": \"^3.10.0\"\n},\n\"dependencies\": {\n- \"@thi.ng/api\": \"^2.0.0\",\n- \"@thi.ng/hiccup-dom\": \"^1.0.5\",\n+ \"@thi.ng/api\": \"^2.0.3\",\n+ \"@thi.ng/hdom\": \"^2.0.0\",\n\"@thi.ng/rstream\": \"^1.0.0\",\n- \"@thi.ng/transducers\": \"^1.3.0\"\n+ \"@thi.ng/transducers\": \"^1.6.1\"\n}\n}\nEOF\n@@ -112,12 +112,10 @@ yarn install\nThen\n\\`\\`\\`\n-\\# For Mac\n+# For Mac\nyarn dev\n-\\`\\`\\`\n-\\`\\`\\`\n-\\# For Debian, Ubuntu, Etc.\n+# For Debian, Ubuntu, Etc.\nyarn debdev\n\\`\\`\\`\n",
"new_path": "scripts/make-example",
"old_path": "scripts/make-example"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
chore: update make-example
| 1
|
chore
| null |
679,913
|
03.03.2018 03:57:08
| 0
|
6c628213654a78269fbafa6f6dfe2d79854a3930
|
docs(hdom): fix diagram link
|
[
{
"change_type": "MODIFY",
"diff": "@@ -68,7 +68,7 @@ difference between the old and new DOM trees (both nested JS arrays).\nComponents can be defined as static arrays, closures or objects with life cycle\nhooks (init, render, release).\n-\n+\nThe syntax is inspired by Clojure's\n[Hiccup](https://github.com/weavejester/hiccup) and\n",
"new_path": "packages/hdom/README.md",
"old_path": "packages/hdom/README.md"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs(hdom): fix diagram link
| 1
|
docs
|
hdom
|
679,913
|
03.03.2018 04:36:08
| 0
|
92fb7b071db01feb82e1f0a8a3dd7f57c329edba
|
chore(examples): update links in html files
|
[
{
"change_type": "MODIFY",
"diff": "<footer>\nMade with\n<a href=\"https://github.com/thi-ng/umbrella/tree/master/packages/transducers\">@thi.ng/transducers</a> and\n- <a href=\"https://github.com/thi-ng/umbrella/tree/master/packages/hiccup-dom\">@thi.ng/hiccup-dom</a>.\n+ <a href=\"https://github.com/thi-ng/umbrella/tree/master/packages/hdom\">@thi.ng/hdom</a>.\n</footer>\n<script type=\"text/javascript\" src=\"bundle.js\"></script>\n</body>\n",
"new_path": "examples/cellular-automata/index.html",
"old_path": "examples/cellular-automata/index.html"
},
{
"change_type": "MODIFY",
"diff": "<div id=\"app\"></div>\n<footer>\nMade with\n- <a href=\"https://github.com/thi-ng/umbrella/tree/master/packages/hiccup-dom\">@thi.ng/hiccup-dom</a>.\n+ <a href=\"https://github.com/thi-ng/umbrella/tree/master/packages/hdom\">@thi.ng/hdom</a>.\n</footer>\n<script type=\"text/javascript\" src=\"bundle.js\"></script>\n</body>\n",
"new_path": "examples/hdom-benchmark/index.html",
"old_path": "examples/hdom-benchmark/index.html"
},
{
"change_type": "MODIFY",
"diff": "<div id=\"app\"></div>\n<footer>\nMade with\n- <a href=\"https://github.com/thi-ng/umbrella/tree/master/packages/hiccup-dom\">@thi.ng/hiccup-dom</a>.\n+ <a href=\"https://github.com/thi-ng/umbrella/tree/master/packages/hdom\">@thi.ng/hdom</a>.\n</footer>\n<script type=\"text/javascript\" src=\"bundle.js\"></script>\n</body>\n",
"new_path": "examples/json-components/index.html",
"old_path": "examples/json-components/index.html"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
chore(examples): update links in html files
| 1
|
chore
|
examples
|
679,913
|
03.03.2018 06:07:34
| 0
|
3a4cf1e67f6f27a605e8b40abcb64ec31e00dce6
|
feat(hiccup-css): add package
|
[
{
"change_type": "ADD",
"diff": "+node_modules\n+yarn.lock\n+*.js\n",
"new_path": "packages/hiccup-css/.gitignore",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+# @thi.ng/hiccup-css\n+\n+[](https://www.npmjs.com/package/@thi.ng/hiccup-css)\n+\n+## About\n+\n+CSS as nested data structures.\n+\n+## Installation\n+\n+```\n+yarn add @thi.ng/hiccup-css\n+```\n+\n+## Usage examples\n+\n+```typescript\n+import { css, FORMATS } from \"@thi.ng/hiccup-css\";\n+\n+css([\"#foo\",\n+ { background: \"#eee\" },\n+ [\"h1\", { \"font-size\": \"2em\" }, [\"small\", { color: \"#999\"}]],\n+ [\"h2\", \"h3\", [\".title\", { \"font-weight\": 700 }]]],\n+ FORMATS.pretty);\n+```\n+\n+```css\n+#foo h1 small {\n+ color:#999;\n+}\n+#foo h1 {\n+ font-size:2em;\n+}\n+#foo h2 .title, #foo h3 .title {\n+ font-weight:700;\n+}\n+#foo {\n+ background:#eee;\n+}\n+```\n+\n+## Authors\n+\n+- Karsten Schmidt\n+\n+## License\n+\n+© 2018 Karsten Schmidt // Apache Software License 2.0\n\\ No newline at end of file\n",
"new_path": "packages/hiccup-css/README.md",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"@thi.ng/hiccup-css\",\n+ \"version\": \"0.0.1\",\n+ \"description\": \"CSS as nested data structures\",\n+ \"main\": \"./index.js\",\n+ \"typings\": \"./index.d.ts\",\n+ \"repository\": \"https://github.com/thi-ng/umbrella\",\n+ \"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n+ \"license\": \"Apache-2.0\",\n+ \"scripts\": {\n+ \"build\": \"yarn clean && tsc --declaration\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build coverage doc\",\n+ \"cover\": \"yarn test && nyc report --reporter=lcov\",\n+ \"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n+ \"pub\": \"yarn build && yarn publish --access public\",\n+ \"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n+ },\n+ \"devDependencies\": {\n+ \"@types/mocha\": \"^2.2.48\",\n+ \"@types/node\": \"^9.4.6\",\n+ \"mocha\": \"^5.0.0\",\n+ \"nyc\": \"^11.4.1\",\n+ \"ts-loader\": \"^3.5.0\",\n+ \"typedoc\": \"^0.10.0\",\n+ \"typescript\": \"^2.7.2\",\n+ \"webpack\": \"^3.11.0\"\n+ },\n+ \"dependencies\": {\n+ \"@thi.ng/api\": \"^2.0.3\",\n+ \"@thi.ng/transducers\": \"^1.6.1\"\n+ },\n+ \"keywords\": [\n+ \"clojure\",\n+ \"components\",\n+ \"ES6\",\n+ \"hiccup\",\n+ \"html\",\n+ \"iterators\",\n+ \"json\",\n+ \"serialization\",\n+ \"svg\",\n+ \"template\",\n+ \"typescript\",\n+ \"xml\"\n+ ],\n+ \"publishConfig\": {\n+ \"access\": \"public\"\n+ }\n+}\n\\ No newline at end of file\n",
"new_path": "packages/hiccup-css/package.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { IObjectOf } from \"@thi.ng/api/api\";\n+import { isArray } from \"@thi.ng/checks/is-array\";\n+import { isPlainObject } from \"@thi.ng/checks/is-plain-object\";\n+import { transduce } from \"@thi.ng/transducers/transduce\";\n+import { permutations } from \"@thi.ng/transducers/iter/permutations\";\n+import { str } from \"@thi.ng/transducers/rfn/str\";\n+import { flatten } from \"@thi.ng/transducers/xform/flatten\";\n+import { map } from \"@thi.ng/transducers/xform/map\";\n+\n+export interface Format {\n+ rules: string;\n+ ruleSep: string;\n+ decls: string;\n+ declsStart: string;\n+ declEnd: string;\n+ indent: string;\n+}\n+\n+const NO_SPACES = \":[\";\n+\n+export const FORMATS: IObjectOf<Format> = {\n+ min: { rules: \"\", ruleSep: \",\", decls: \"\", declsStart: \"{\", declEnd: \"}\", indent: \"\" },\n+ pretty: { rules: \"\\n\", ruleSep: \", \", decls: \"\\n\", declsStart: \" {\\n\", declEnd: \"\\n}\", indent: \" \" },\n+};\n+\n+const xfSel = ((a, b) => (x) => a(b(x)))(\n+ flatten(),\n+ map((x: string) => NO_SPACES.indexOf(x.charAt(0)) >= 0 ? x : \" \" + x)\n+);\n+\n+export function css(rules: any, fmt = FORMATS.min) {\n+ if (isArray(rules)) {\n+ return _css([], [], rules, fmt).join(fmt.rules);\n+ }\n+ if (isPlainObject(rules)) {\n+ return format(rules, fmt);\n+ }\n+}\n+\n+function _css(acc: string[], parent: any[], rules: any[], fmt: Format) {\n+ const n = rules.length;\n+ const sel: string[] = [];\n+ let curr: any;\n+ for (let i = 0; i < n; i++) {\n+ const r = rules[i];\n+ if (isArray(r)) {\n+ _css(acc, makeSelector(parent, sel), r, fmt);\n+ } else if (isPlainObject(r)) {\n+ curr = Object.assign(curr || {}, r);\n+ } else {\n+ sel.push(r);\n+ }\n+ }\n+ if (curr) {\n+ acc.push(formatRule(parent, sel, curr, fmt));\n+ }\n+ return acc;\n+}\n+\n+function format(rules: any, fmt: Format) {\n+ const acc = [];\n+ for (let r in rules) {\n+ if (rules.hasOwnProperty(r)) {\n+ acc.push(`${fmt.indent}${r}:${rules[r]};`);\n+ }\n+ }\n+ return acc.join(fmt.decls);\n+}\n+\n+function makeSelector(parent: any[], curr: any[]) {\n+ return parent.length ? [...permutations(parent, curr)] : curr;\n+}\n+\n+function formatRule(parent: any[], sel: any[], curr: any, fmt: Format) {\n+ return transduce(\n+ map((sel: any[]) => transduce(xfSel, str(), isArray(sel) ? sel : [sel]).trim()),\n+ str(fmt.ruleSep),\n+ makeSelector(parent, sel))\n+ + fmt.declsStart\n+ + format(curr, fmt)\n+ + fmt.declEnd;\n+}\n",
"new_path": "packages/hiccup-css/src/index.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import * as assert from \"assert\";\n+\n+import { css, FORMATS } from \"../src\";\n+\n+const rules = {\n+ a: { color: \"red\" },\n+ b: { border: 0 },\n+};\n+\n+describe(\"hiccup-css\", () => {\n+\n+ it(\"rules only\", () => {\n+ assert.equal(css(\"a\"), undefined);\n+ assert.equal(css({}), \"\");\n+ assert.equal(css(rules.a), \"color:red;\");\n+ });\n+\n+ it(\"simple\", () => {\n+ assert.equal(css([\"a\"]), \"\");\n+ assert.equal(css([\"a\", rules.a]), \"a{color:red;}\");\n+ assert.equal(\n+ css([[\"a\", rules.a], [\"b\", rules.b]]),\n+ \"a{color:red;}b{border:0;}\"\n+ );\n+ assert.equal(\n+ css([\"a\", \"b\", rules.a, rules.b]),\n+ \"a,b{color:red;border:0;}\"\n+ );\n+ });\n+\n+ it(\"nested\", () => {\n+ assert.equal(\n+ css([\"a\", [\":link\", rules.a], [\":visited\", rules.b]]),\n+ \"a:link{color:red;}a:visited{border:0;}\"\n+ );\n+ assert.equal(\n+ css([\"p\", [\"a\", [\":link\", rules.a], [\":visited\", rules.b]]]),\n+ \"p a:link{color:red;}p a:visited{border:0;}\"\n+ );\n+ assert.equal(\n+ css(\n+ [\"#id\",\n+ [\"h1\", {}, {}],\n+ [\"h2\", \"h3\",\n+ [\"div\", {}],\n+ [\"[attr]\",\n+ [\"span\", rules.a]]]]\n+ ),\n+ \"#id h1{}#id h2 div,#id h3 div{}#id h2[attr] span,#id h3[attr] span{color:red;}\"\n+ );\n+ });\n+\n+ it(\"pretty\", () => {\n+ assert.equal(\n+ css(\n+ [\"#id\",\n+ [\"h1\", {}, {}],\n+ [\"h2\", \"h3\",\n+ [\"div\", {}],\n+ [\"[attr]\",\n+ [\"span\", rules.a]]]],\n+ FORMATS.pretty),\n+ \"#id h1 {\\n\\n}\\n#id h2 div, #id h3 div {\\n\\n}\\n#id h2[attr] span, #id h3[attr] span {\\n color:red;\\n}\"\n+ );\n+ });\n+});\n",
"new_path": "packages/hiccup-css/test/index.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"extends\": \"../../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \"../build\"\n+ },\n+ \"include\": [\n+ \"./**/*.ts\",\n+ \"../src/**/*.ts\"\n+ ]\n+}\n\\ No newline at end of file\n",
"new_path": "packages/hiccup-css/test/tsconfig.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"extends\": \"../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \".\"\n+ },\n+ \"include\": [\n+ \"./src/**/*.ts\"\n+ ]\n+}\n",
"new_path": "packages/hiccup-css/tsconfig.json",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(hiccup-css): add package @thi.ng/hiccup-css
| 1
|
feat
|
hiccup-css
|
679,913
|
03.03.2018 06:15:05
| 0
|
5247b8f4b31dabeadfcdb49be550750bd4b25303
|
feat(hiccup-css): add/fix class handling, update Format
|
[
{
"change_type": "MODIFY",
"diff": "@@ -10,17 +10,18 @@ import { map } from \"@thi.ng/transducers/xform/map\";\nexport interface Format {\nrules: string;\nruleSep: string;\n+ valSep: string;\ndecls: string;\ndeclsStart: string;\ndeclEnd: string;\nindent: string;\n}\n-const NO_SPACES = \":[\";\n+const NO_SPACES = \".:[\";\nexport const FORMATS: IObjectOf<Format> = {\n- min: { rules: \"\", ruleSep: \",\", decls: \"\", declsStart: \"{\", declEnd: \"}\", indent: \"\" },\n- pretty: { rules: \"\\n\", ruleSep: \", \", decls: \"\\n\", declsStart: \" {\\n\", declEnd: \"\\n}\", indent: \" \" },\n+ min: { rules: \"\", ruleSep: \",\", valSep: \"\", decls: \"\", declsStart: \"{\", declEnd: \"}\", indent: \"\" },\n+ pretty: { rules: \"\\n\", ruleSep: \", \", valSep: \" \", decls: \"\\n\", declsStart: \" {\\n\", declEnd: \"\\n}\", indent: \" \" },\n};\nconst xfSel = ((a, b) => (x) => a(b(x)))(\n@@ -61,7 +62,7 @@ function format(rules: any, fmt: Format) {\nconst acc = [];\nfor (let r in rules) {\nif (rules.hasOwnProperty(r)) {\n- acc.push(`${fmt.indent}${r}:${rules[r]};`);\n+ acc.push(`${fmt.indent}${r}:${fmt.valSep}${rules[r]};`);\n}\n}\nreturn acc.join(fmt.decls);\n",
"new_path": "packages/hiccup-css/src/index.ts",
"old_path": "packages/hiccup-css/src/index.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(hiccup-css): add/fix class handling, update Format
| 1
|
feat
|
hiccup-css
|
791,707
|
03.03.2018 09:29:28
| -39,600
|
54225c419f3c41f04af186465cf47949dd790378
|
deps(axe-core): update axe-core to 3.0.0-beta.2 release
|
[
{
"change_type": "MODIFY",
"diff": "\"zone.js\": \"^0.7.3\"\n},\n\"dependencies\": {\n- \"axe-core\": \"2.6.1\",\n+ \"axe-core\": \"3.0.0-beta.2\",\n\"chrome-devtools-frontend\": \"1.0.422034\",\n\"chrome-launcher\": \"^0.10.2\",\n\"configstore\": \"^3.1.1\",\n",
"new_path": "package.json",
"old_path": "package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -335,9 +335,9 @@ aws4@^1.2.1:\nversion \"1.4.1\"\nresolved \"https://registry.yarnpkg.com/aws4/-/aws4-1.4.1.tgz#fde7d5292466d230e5ee0f4e038d9dfaab08fc61\"\n-axe-core@2.6.1:\n- version \"2.6.1\"\n- resolved \"https://registry.yarnpkg.com/axe-core/-/axe-core-2.6.1.tgz#28772c4f76966d373acda35b9a409299dc00d1b5\"\n+axe-core@3.0.0-beta.2:\n+ version \"3.0.0-beta.2\"\n+ resolved \"https://registry.yarnpkg.com/axe-core/-/axe-core-3.0.0-beta.2.tgz#82a13d371268034352bba2bcb263c5625b3e4a09\"\naxios@0.15.3:\nversion \"0.15.3\"\n",
"new_path": "yarn.lock",
"old_path": "yarn.lock"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
deps(axe-core): update axe-core to 3.0.0-beta.2 release (#4595)
| 1
|
deps
|
axe-core
|
679,913
|
03.03.2018 14:13:42
| 0
|
d837199ddb7ce2aaf966eaa7bbf2f7675723b510
|
feat(hiccup-css): add CSSOpts, mediaQuery(), fn expansion
add CSSOpts w/ autoprefix & vendor config
split FORMATS => COMPACT, PRETTY consts
update css() to accept options arg
update css() to accept function as rules
update formatDecls() to accept fns as attrib values
add nested indentation support for pretty printing
|
[
{
"change_type": "MODIFY",
"diff": "-import { IObjectOf } from \"@thi.ng/api/api\";\nimport { isArray } from \"@thi.ng/checks/is-array\";\n+import { isFunction } from \"@thi.ng/checks/is-function\";\nimport { isPlainObject } from \"@thi.ng/checks/is-plain-object\";\nimport { transduce } from \"@thi.ng/transducers/transduce\";\nimport { permutations } from \"@thi.ng/transducers/iter/permutations\";\n+import { repeat } from \"@thi.ng/transducers/iter/repeat\";\nimport { str } from \"@thi.ng/transducers/rfn/str\";\nimport { flatten } from \"@thi.ng/transducers/xform/flatten\";\nimport { map } from \"@thi.ng/transducers/xform/map\";\n@@ -12,40 +13,58 @@ export interface Format {\nruleSep: string;\nvalSep: string;\ndecls: string;\n- declsStart: string;\n+ declStart: string;\ndeclEnd: string;\nindent: string;\n}\n+export interface CSSOpts {\n+ format: Format;\n+ autoprefix: string[] | Set<string>;\n+ vendors: string[];\n+ depth: number;\n+}\n+\nconst NO_SPACES = \".:[\";\n-export const FORMATS: IObjectOf<Format> = {\n- min: { rules: \"\", ruleSep: \",\", valSep: \"\", decls: \"\", declsStart: \"{\", declEnd: \"}\", indent: \"\" },\n- pretty: { rules: \"\\n\", ruleSep: \", \", valSep: \" \", decls: \"\\n\", declsStart: \" {\\n\", declEnd: \"\\n}\", indent: \" \" },\n-};\n+export const COMPACT: Format = { rules: \"\", ruleSep: \",\", valSep: \"\", decls: \"\", declStart: \"{\", declEnd: \"}\", indent: \"\" };\n+export const PRETTY: Format = { rules: \"\\n\", ruleSep: \", \", valSep: \" \", decls: \"\\n\", declStart: \" {\\n\", declEnd: \"}\\n\", indent: \" \" };\nconst xfSel = ((a, b) => (x) => a(b(x)))(\nflatten(),\nmap((x: string) => NO_SPACES.indexOf(x.charAt(0)) >= 0 ? x : \" \" + x)\n);\n-export function css(rules: any, fmt = FORMATS.min) {\n+export function css(rules: any, opts?: Partial<CSSOpts>) {\n+ opts = { format: COMPACT, autoprefix: new Set(), vendors: [], depth: 0, ...opts };\n+ if (isArray(opts.autoprefix)) {\n+ opts.autoprefix = new Set(opts.autoprefix);\n+ }\nif (isArray(rules)) {\n- return _css([], [], rules, fmt).join(fmt.rules);\n+ return _css([], [], rules, <CSSOpts>opts).join(opts.format.rules);\n+ }\n+ if (isFunction(rules)) {\n+ return rules([], opts).join(opts.format.rules);\n}\nif (isPlainObject(rules)) {\n- return format(rules, fmt);\n+ return formatDecls(rules, <CSSOpts>opts);\n}\n}\n-function _css(acc: string[], parent: any[], rules: any[], fmt: Format) {\n+function _css(acc: string[], parent: any[], rules: any[], opts: CSSOpts) {\nconst n = rules.length;\nconst sel: string[] = [];\nlet curr: any;\nfor (let i = 0; i < n; i++) {\nconst r = rules[i];\nif (isArray(r)) {\n- _css(acc, makeSelector(parent, sel), r, fmt);\n+ _css(acc, makeSelector(parent, sel), r, opts);\n+ } else if (isFunction(r)) {\n+ if (parent.length === 0) {\n+ r(acc, opts);\n+ } else {\n+ sel.push(r());\n+ }\n} else if (isPlainObject(r)) {\ncurr = Object.assign(curr || {}, r);\n} else {\n@@ -53,31 +72,63 @@ function _css(acc: string[], parent: any[], rules: any[], fmt: Format) {\n}\n}\nif (curr) {\n- acc.push(formatRule(parent, sel, curr, fmt));\n+ acc.push(formatRule(parent, sel, curr, opts));\n}\nreturn acc;\n}\n-function format(rules: any, fmt: Format) {\n+export function mediaQuery(cond, rules: any[]) {\n+ return (acc: string[], opts: CSSOpts) => {\n+ const space = indent(opts);\n+ acc.push(`${space}@media(${cond})${opts.format.declStart}`);\n+ opts.depth++;\n+ _css(acc, [], rules, opts);\n+ opts.depth--;\n+ acc.push(space + opts.format.declEnd);\n+ return acc;\n+ };\n+}\n+\n+function formatDecls(rules: any, opts: CSSOpts) {\n+ const f = opts.format;\n+ const space = indent(opts, opts.depth + 1);\nconst acc = [];\nfor (let r in rules) {\nif (rules.hasOwnProperty(r)) {\n- acc.push(`${fmt.indent}${r}:${fmt.valSep}${rules[r]};`);\n+ let val = rules[r];\n+ if (isFunction(val)) {\n+ val = val(rules);\n+ }\n+ if ((<Set<string>>opts.autoprefix).has(r)) {\n+ for (let v of opts.vendors) {\n+ acc.push(`${space}${v}-${r}:${f.valSep}${val};`);\n+ }\n+ } else {\n+ acc.push(`${space}${r}:${f.valSep}${val};`);\n+ }\n}\n}\n- return acc.join(fmt.decls);\n+ return acc.join(f.decls) + f.decls;\n}\nfunction makeSelector(parent: any[], curr: any[]) {\nreturn parent.length ? [...permutations(parent, curr)] : curr;\n}\n-function formatRule(parent: any[], sel: any[], curr: any, fmt: Format) {\n- return transduce(\n+function formatRule(parent: any[], sel: any[], curr: any, opts: CSSOpts) {\n+ const f = opts.format;\n+ const space = indent(opts);\n+ return space\n+ + transduce(\nmap((sel: any[]) => transduce(xfSel, str(), isArray(sel) ? sel : [sel]).trim()),\n- str(fmt.ruleSep),\n+ str(f.ruleSep),\nmakeSelector(parent, sel))\n- + fmt.declsStart\n- + format(curr, fmt)\n- + fmt.declEnd;\n+ + f.declStart\n+ + formatDecls(curr, opts)\n+ + space\n+ + f.declEnd;\n+}\n+\n+function indent(opts: CSSOpts, d = opts.depth) {\n+ return d > 1 ? [...repeat(opts.format.indent, d)].join(\"\") : d > 0 ? opts.format.indent : \"\";\n}\n",
"new_path": "packages/hiccup-css/src/index.ts",
"old_path": "packages/hiccup-css/src/index.ts"
},
{
"change_type": "MODIFY",
"diff": "import * as assert from \"assert\";\n-import { css, FORMATS } from \"../src\";\n+import { css, PRETTY } from \"../src\";\nconst rules = {\na: { color: \"red\" },\n@@ -59,8 +59,8 @@ describe(\"hiccup-css\", () => {\n[\"div\", {}],\n[\"[attr]\",\n[\"span\", rules.a]]]],\n- FORMATS.pretty),\n- \"#id h1 {\\n\\n}\\n#id h2 div, #id h3 div {\\n\\n}\\n#id h2[attr] span, #id h3[attr] span {\\n color:red;\\n}\"\n+ { format: PRETTY }),\n+ \"#id h1 {\\n\\n}\\n\\n#id h2 div, #id h3 div {\\n\\n}\\n\\n#id h2[attr] span, #id h3[attr] span {\\n color: red;\\n}\\n\"\n);\n});\n});\n",
"new_path": "packages/hiccup-css/test/index.ts",
"old_path": "packages/hiccup-css/test/index.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(hiccup-css): add CSSOpts, mediaQuery(), fn expansion
- add CSSOpts w/ autoprefix & vendor config
- split FORMATS => COMPACT, PRETTY consts
- update css() to accept options arg
- update css() to accept function as rules
- update formatDecls() to accept fns as attrib values
- add nested indentation support for pretty printing
| 1
|
feat
|
hiccup-css
|
679,913
|
03.03.2018 14:40:41
| 0
|
a53d2a5f704e3b8df2faf9ec988e12bab6917877
|
feat(hiccup-css): add keyframes(), split module into separate src files
|
[
{
"change_type": "ADD",
"diff": "+export interface Format {\n+ rules: string;\n+ ruleSep: string;\n+ valSep: string;\n+ decls: string;\n+ declStart: string;\n+ declEnd: string;\n+ indent: string;\n+}\n+\n+export interface CSSOpts {\n+ format: Format;\n+ autoprefix: string[] | Set<string>;\n+ vendors: string[];\n+ depth: number;\n+}\n+\n+export const COMPACT: Format = { rules: \"\", ruleSep: \",\", valSep: \"\", decls: \"\", declStart: \"{\", declEnd: \"}\", indent: \"\" };\n+export const PRETTY: Format = { rules: \"\\n\", ruleSep: \", \", valSep: \" \", decls: \"\\n\", declStart: \" {\\n\", declEnd: \"}\\n\", indent: \" \" };\n",
"new_path": "packages/hiccup-css/src/api.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { isArray } from \"@thi.ng/checks/is-array\";\n+import { isFunction } from \"@thi.ng/checks/is-function\";\n+import { isPlainObject } from \"@thi.ng/checks/is-plain-object\";\n+import { transduce } from \"@thi.ng/transducers/transduce\";\n+import { permutations } from \"@thi.ng/transducers/iter/permutations\";\n+import { str } from \"@thi.ng/transducers/rfn/str\";\n+import { flatten } from \"@thi.ng/transducers/xform/flatten\";\n+import { map } from \"@thi.ng/transducers/xform/map\";\n+\n+import { CSSOpts, COMPACT } from \"./api\";\n+import { indent } from \"./utils\";\n+\n+const NO_SPACES = \".:[\";\n+\n+const xfSel = ((a, b) => (x) => a(b(x)))(\n+ flatten(),\n+ map((x: string) => NO_SPACES.indexOf(x.charAt(0)) >= 0 ? x : \" \" + x)\n+);\n+\n+export function css(rules: any, opts?: Partial<CSSOpts>) {\n+ opts = { format: COMPACT, autoprefix: new Set(), vendors: [], depth: 0, ...opts };\n+ if (isArray(opts.autoprefix)) {\n+ opts.autoprefix = new Set(opts.autoprefix);\n+ }\n+ if (isArray(rules)) {\n+ return _css([], [], rules, <CSSOpts>opts).join(opts.format.rules);\n+ }\n+ if (isFunction(rules)) {\n+ return rules([], opts).join(opts.format.rules);\n+ }\n+ if (isPlainObject(rules)) {\n+ return formatDecls(rules, <CSSOpts>opts);\n+ }\n+}\n+\n+export function _css(acc: string[], parent: any[], rules: any[], opts: CSSOpts) {\n+ const n = rules.length;\n+ const sel: string[] = [];\n+ let curr: any;\n+ for (let i = 0; i < n; i++) {\n+ const r = rules[i];\n+ if (isArray(r)) {\n+ _css(acc, makeSelector(parent, sel), r, opts);\n+ } else if (isFunction(r)) {\n+ if (parent.length === 0) {\n+ r(acc, opts);\n+ } else {\n+ sel.push(r());\n+ }\n+ } else if (isPlainObject(r)) {\n+ curr = Object.assign(curr || {}, r);\n+ } else {\n+ sel.push(r);\n+ }\n+ }\n+ if (curr) {\n+ acc.push(formatRule(parent, sel, curr, opts));\n+ }\n+ return acc;\n+}\n+\n+export function formatDecls(rules: any, opts: CSSOpts) {\n+ const f = opts.format;\n+ const space = indent(opts, opts.depth + 1);\n+ const acc = [];\n+ for (let r in rules) {\n+ if (rules.hasOwnProperty(r)) {\n+ let val = rules[r];\n+ if (isFunction(val)) {\n+ val = val(rules);\n+ }\n+ if ((<Set<string>>opts.autoprefix).has(r)) {\n+ for (let v of opts.vendors) {\n+ acc.push(`${space}${v}-${r}:${f.valSep}${val};`);\n+ }\n+ } else {\n+ acc.push(`${space}${r}:${f.valSep}${val};`);\n+ }\n+ }\n+ }\n+ return acc.join(f.decls) + f.decls;\n+}\n+\n+function makeSelector(parent: any[], curr: any[]) {\n+ return parent.length ? [...permutations(parent, curr)] : curr;\n+}\n+\n+function formatRule(parent: any[], sel: any[], curr: any, opts: CSSOpts) {\n+ const f = opts.format;\n+ const space = indent(opts);\n+ return space\n+ + transduce(\n+ map((sel: any[]) => transduce(xfSel, str(), isArray(sel) ? sel : [sel]).trim()),\n+ str(f.ruleSep),\n+ makeSelector(parent, sel))\n+ + f.declStart\n+ + formatDecls(curr, opts)\n+ + space\n+ + f.declEnd;\n+}\n+\n",
"new_path": "packages/hiccup-css/src/css.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "-import { isArray } from \"@thi.ng/checks/is-array\";\n-import { isFunction } from \"@thi.ng/checks/is-function\";\n-import { isPlainObject } from \"@thi.ng/checks/is-plain-object\";\n-import { transduce } from \"@thi.ng/transducers/transduce\";\n-import { permutations } from \"@thi.ng/transducers/iter/permutations\";\n-import { repeat } from \"@thi.ng/transducers/iter/repeat\";\n-import { str } from \"@thi.ng/transducers/rfn/str\";\n-import { flatten } from \"@thi.ng/transducers/xform/flatten\";\n-import { map } from \"@thi.ng/transducers/xform/map\";\n-\n-export interface Format {\n- rules: string;\n- ruleSep: string;\n- valSep: string;\n- decls: string;\n- declStart: string;\n- declEnd: string;\n- indent: string;\n-}\n-\n-export interface CSSOpts {\n- format: Format;\n- autoprefix: string[] | Set<string>;\n- vendors: string[];\n- depth: number;\n-}\n-\n-const NO_SPACES = \".:[\";\n-\n-export const COMPACT: Format = { rules: \"\", ruleSep: \",\", valSep: \"\", decls: \"\", declStart: \"{\", declEnd: \"}\", indent: \"\" };\n-export const PRETTY: Format = { rules: \"\\n\", ruleSep: \", \", valSep: \" \", decls: \"\\n\", declStart: \" {\\n\", declEnd: \"}\\n\", indent: \" \" };\n-\n-const xfSel = ((a, b) => (x) => a(b(x)))(\n- flatten(),\n- map((x: string) => NO_SPACES.indexOf(x.charAt(0)) >= 0 ? x : \" \" + x)\n-);\n-\n-export function css(rules: any, opts?: Partial<CSSOpts>) {\n- opts = { format: COMPACT, autoprefix: new Set(), vendors: [], depth: 0, ...opts };\n- if (isArray(opts.autoprefix)) {\n- opts.autoprefix = new Set(opts.autoprefix);\n- }\n- if (isArray(rules)) {\n- return _css([], [], rules, <CSSOpts>opts).join(opts.format.rules);\n- }\n- if (isFunction(rules)) {\n- return rules([], opts).join(opts.format.rules);\n- }\n- if (isPlainObject(rules)) {\n- return formatDecls(rules, <CSSOpts>opts);\n- }\n-}\n-\n-function _css(acc: string[], parent: any[], rules: any[], opts: CSSOpts) {\n- const n = rules.length;\n- const sel: string[] = [];\n- let curr: any;\n- for (let i = 0; i < n; i++) {\n- const r = rules[i];\n- if (isArray(r)) {\n- _css(acc, makeSelector(parent, sel), r, opts);\n- } else if (isFunction(r)) {\n- if (parent.length === 0) {\n- r(acc, opts);\n- } else {\n- sel.push(r());\n- }\n- } else if (isPlainObject(r)) {\n- curr = Object.assign(curr || {}, r);\n- } else {\n- sel.push(r);\n- }\n- }\n- if (curr) {\n- acc.push(formatRule(parent, sel, curr, opts));\n- }\n- return acc;\n-}\n-\n-export function mediaQuery(cond, rules: any[]) {\n- return (acc: string[], opts: CSSOpts) => {\n- const space = indent(opts);\n- acc.push(`${space}@media(${cond})${opts.format.declStart}`);\n- opts.depth++;\n- _css(acc, [], rules, opts);\n- opts.depth--;\n- acc.push(space + opts.format.declEnd);\n- return acc;\n- };\n-}\n-\n-function formatDecls(rules: any, opts: CSSOpts) {\n- const f = opts.format;\n- const space = indent(opts, opts.depth + 1);\n- const acc = [];\n- for (let r in rules) {\n- if (rules.hasOwnProperty(r)) {\n- let val = rules[r];\n- if (isFunction(val)) {\n- val = val(rules);\n- }\n- if ((<Set<string>>opts.autoprefix).has(r)) {\n- for (let v of opts.vendors) {\n- acc.push(`${space}${v}-${r}:${f.valSep}${val};`);\n- }\n- } else {\n- acc.push(`${space}${r}:${f.valSep}${val};`);\n- }\n- }\n- }\n- return acc.join(f.decls) + f.decls;\n-}\n-\n-function makeSelector(parent: any[], curr: any[]) {\n- return parent.length ? [...permutations(parent, curr)] : curr;\n-}\n-\n-function formatRule(parent: any[], sel: any[], curr: any, opts: CSSOpts) {\n- const f = opts.format;\n- const space = indent(opts);\n- return space\n- + transduce(\n- map((sel: any[]) => transduce(xfSel, str(), isArray(sel) ? sel : [sel]).trim()),\n- str(f.ruleSep),\n- makeSelector(parent, sel))\n- + f.declStart\n- + formatDecls(curr, opts)\n- + space\n- + f.declEnd;\n-}\n-\n-function indent(opts: CSSOpts, d = opts.depth) {\n- return d > 1 ? [...repeat(opts.format.indent, d)].join(\"\") : d > 0 ? opts.format.indent : \"\";\n-}\n+export * from \"./api\";\n+export * from \"./css\";\n+export * from \"./keyframes\";\n+export * from \"./media-query\";\n",
"new_path": "packages/hiccup-css/src/index.ts",
"old_path": "packages/hiccup-css/src/index.ts"
},
{
"change_type": "ADD",
"diff": "+import { CSSOpts } from \"./api\";\n+import { formatDecls } from \"./css\";\n+import { indent } from \"./utils\";\n+\n+export function keyframes(id: string, stops: any);\n+export function keyframes(id: string, from: any, to: any);\n+export function keyframes(id: string, ...args: any[]) {\n+ const stops = args.length === 1 ? args[0] : { from: args[0], to: args[1] };\n+ return (acc: string[], opts: CSSOpts) => {\n+ const outer = indent(opts);\n+ opts.depth++;\n+ const inner = indent(opts);\n+ acc.push(`${outer}@keyframes ${id}${opts.format.declStart}`);\n+ for (let s in stops) {\n+ if (stops.hasOwnProperty(s)) {\n+ acc.push(\n+ inner + s + opts.format.declStart\n+ + formatDecls(stops[s], opts)\n+ + inner + opts.format.declEnd\n+ );\n+ }\n+ }\n+ opts.depth--;\n+ acc.push(outer + opts.format.declEnd);\n+ return acc;\n+ };\n+}\n",
"new_path": "packages/hiccup-css/src/keyframes.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { CSSOpts } from \"./api\";\n+import { _css } from \"./css\";\n+import { indent } from \"./utils\";\n+\n+export function mediaQuery(cond, rules: any[]) {\n+ return (acc: string[], opts: CSSOpts) => {\n+ const space = indent(opts);\n+ acc.push(`${space}@media(${cond})${opts.format.declStart}`);\n+ opts.depth++;\n+ _css(acc, [], rules, opts);\n+ opts.depth--;\n+ acc.push(space + opts.format.declEnd);\n+ return acc;\n+ };\n+}\n",
"new_path": "packages/hiccup-css/src/media-query.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { repeat } from \"@thi.ng/transducers/iter/repeat\";\n+\n+import { CSSOpts } from \"./api\";\n+\n+export function indent(opts: CSSOpts, d = opts.depth) {\n+ return d > 1 ? [...repeat(opts.format.indent, d)].join(\"\") : d > 0 ? opts.format.indent : \"\";\n+}\n\\ No newline at end of file\n",
"new_path": "packages/hiccup-css/src/utils.ts",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(hiccup-css): add keyframes(), split module into separate src files
| 1
|
feat
|
hiccup-css
|
679,913
|
03.03.2018 14:49:29
| 0
|
e687230c69180e14c0e1f3fe69f184b680f11e31
|
feat(hiccup-css): add default vendor prefixes
|
[
{
"change_type": "MODIFY",
"diff": "@@ -15,5 +15,12 @@ export interface CSSOpts {\ndepth: number;\n}\n+export const DEFAULT_VENDORS = [\n+ \"-moz-\",\n+ \"-ms-\",\n+ \"-o-\",\n+ \"-webkit-\"\n+];\n+\nexport const COMPACT: Format = { rules: \"\", ruleSep: \",\", valSep: \"\", decls: \"\", declStart: \"{\", declEnd: \"}\", indent: \"\" };\nexport const PRETTY: Format = { rules: \"\\n\", ruleSep: \", \", valSep: \" \", decls: \"\\n\", declStart: \" {\\n\", declEnd: \"}\\n\", indent: \" \" };\n",
"new_path": "packages/hiccup-css/src/api.ts",
"old_path": "packages/hiccup-css/src/api.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -7,7 +7,7 @@ import { str } from \"@thi.ng/transducers/rfn/str\";\nimport { flatten } from \"@thi.ng/transducers/xform/flatten\";\nimport { map } from \"@thi.ng/transducers/xform/map\";\n-import { CSSOpts, COMPACT } from \"./api\";\n+import { CSSOpts, COMPACT, DEFAULT_VENDORS } from \"./api\";\nimport { indent } from \"./utils\";\nconst NO_SPACES = \".:[\";\n@@ -18,7 +18,7 @@ const xfSel = ((a, b) => (x) => a(b(x)))(\n);\nexport function css(rules: any, opts?: Partial<CSSOpts>) {\n- opts = { format: COMPACT, autoprefix: new Set(), vendors: [], depth: 0, ...opts };\n+ opts = { format: COMPACT, autoprefix: new Set(), vendors: DEFAULT_VENDORS, depth: 0, ...opts };\nif (isArray(opts.autoprefix)) {\nopts.autoprefix = new Set(opts.autoprefix);\n}\n@@ -71,7 +71,7 @@ export function formatDecls(rules: any, opts: CSSOpts) {\n}\nif ((<Set<string>>opts.autoprefix).has(r)) {\nfor (let v of opts.vendors) {\n- acc.push(`${space}${v}-${r}:${f.valSep}${val};`);\n+ acc.push(`${space}${v}${r}:${f.valSep}${val};`);\n}\n} else {\nacc.push(`${space}${r}:${f.valSep}${val};`);\n",
"new_path": "packages/hiccup-css/src/css.ts",
"old_path": "packages/hiccup-css/src/css.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(hiccup-css): add default vendor prefixes
| 1
|
feat
|
hiccup-css
|
815,802
|
03.03.2018 20:14:39
| 0
|
c5164403f605e2dc4da1ec66a2e5e010230e005f
|
fix(scrollToEnd): fire when scroll equal to clientHeight.
|
[
{
"change_type": "MODIFY",
"diff": "@@ -218,7 +218,7 @@ export class NgDropdownPanelComponent implements OnDestroy {\nthis.paddingElementRef.nativeElement :\nthis.contentElementRef.nativeElement;\n- if (scroll.scrollTop + panel.clientHeight > padding.clientHeight) {\n+ if (scroll.scrollTop + panel.clientHeight >= padding.clientHeight) {\nthis.scrollToEnd.emit();\nthis._scrollToEndFired = true;\n}\n",
"new_path": "src/ng-select/ng-dropdown-panel.component.ts",
"old_path": "src/ng-select/ng-dropdown-panel.component.ts"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
fix(scrollToEnd): fire when scroll equal to clientHeight. (#318)
| 1
|
fix
|
scrollToEnd
|
679,913
|
03.03.2018 22:00:44
| 0
|
6de6b279340c8f160c36aabebb6bd38882a0ed9e
|
perf(hiccup-dom): minor optimizations
|
[
{
"change_type": "MODIFY",
"diff": "export function at_import(url: string, ...queries: string[]) {\n- return (acc, _) => {\n- if (queries.length === 0) {\n- acc.push(`@import url(${url});`);\n- } else {\n- acc.push(`@import url(${url}) ${queries.join(\" \")};`);\n- }\n- return acc;\n- }\n+ return (acc, _) => (\n+ acc.push(\n+ queries.length ?\n+ `@import url(${url}) ${queries.join(\" \")};` :\n+ `@import url(${url});`\n+ ),\n+ acc\n+ );\n}\n",
"new_path": "packages/hiccup-css/src/import.ts",
"old_path": "packages/hiccup-css/src/import.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -13,11 +13,11 @@ export function at_keyframes(id: string, ...args: any[]) {\nacc.push(`${outer}@keyframes ${id}${opts.format.declStart}`);\nfor (let s in stops) {\nif (stops.hasOwnProperty(s)) {\n- acc.push(\n- inner + s + opts.format.declStart\n- + formatDecls(stops[s], opts)\n- + inner + opts.format.declEnd\n- );\n+ acc.push([\n+ inner, s, opts.format.declStart,\n+ formatDecls(stops[s], opts),\n+ inner, opts.format.declEnd\n+ ].join(\"\"));\n}\n}\nopts.depth--;\n",
"new_path": "packages/hiccup-css/src/keyframes.ts",
"old_path": "packages/hiccup-css/src/keyframes.ts"
},
{
"change_type": "MODIFY",
"diff": "export function at_namespace(url: string);\nexport function at_namespace(prefix: string, url: string);\nexport function at_namespace(...args: string[]) {\n- return (acc, _) => {\n- if (args.length === 1) {\n- acc.push(`@namespace url(${args[0]});`);\n- } else {\n- acc.push(`@namespace ${args[0]} url(${args[1]});`);\n- }\n- return acc;\n- }\n+ return (acc, _) => (\n+ acc.push(\n+ args.length > 1 ?\n+ `@namespace ${args[0]} url(${args[1]});` :\n+ `@namespace url(${args[0]});`\n+ ),\n+ acc\n+ );\n}\n",
"new_path": "packages/hiccup-css/src/namespace.ts",
"old_path": "packages/hiccup-css/src/namespace.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
perf(hiccup-dom): minor optimizations
| 1
|
perf
|
hiccup-dom
|
743,951
|
04.03.2018 12:04:37
| 21,600
|
11691a670b384e3dce2ee61fc92e6b6965079708
|
feat: extend *.rc files in addition to json
|
[
{
"change_type": "MODIFY",
"diff": "@@ -21,7 +21,7 @@ function applyExtends (config, cwd) {\nif (config.hasOwnProperty('extends')) {\nif (typeof config.extends !== 'string') return defaultConfig\n- const isPath = /\\.json$/.test(config.extends)\n+ const isPath = /\\.json|\\..*rc$/.test(config.extends)\nlet pathToDefault = null\nif (!isPath) {\ntry {\n",
"new_path": "lib/apply-extends.js",
"old_path": "lib/apply-extends.js"
},
{
"change_type": "ADD",
"diff": "+{\n+ \"extends\": \"./config_1.json\",\n+ \"c\": 201\n+}\n\\ No newline at end of file\n",
"new_path": "test/fixtures/extends/.myotherrc",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"extends\": \"./.myotherrc\",\n+ \"a\": 5\n+}\n\\ No newline at end of file\n",
"new_path": "test/fixtures/extends/.myrc",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -1284,6 +1284,20 @@ describe('yargs dsl tests', () => {\nargv.a.should.equal(2)\nargv.extends.should.equal('batman')\n})\n+\n+ it('allows files with .*rc extension to be extended', () => {\n+ const argv = yargs()\n+ .config({\n+ extends: './test/fixtures/extends/.myrc',\n+ a: 3\n+ })\n+ .argv\n+\n+ argv.a.should.equal(3)\n+ argv.b.should.equal(22)\n+ argv.c.should.equal(201)\n+ argv.z.should.equal(15)\n+ })\n})\n})\n",
"new_path": "test/yargs.js",
"old_path": "test/yargs.js"
}
] |
JavaScript
|
MIT License
|
yargs/yargs
|
feat: extend *.rc files in addition to json (#1080)
| 1
|
feat
| null |
743,863
|
04.03.2018 12:46:03
| 28,800
|
bee18a4e49439a6f091ad23e0ec3134229201cc1
|
docs: slight copy-edit nit
|
[
{
"change_type": "MODIFY",
"diff": "@@ -812,7 +812,7 @@ var yargs = require(\"yargs\")(['--info'])\nConfigure the `--show-hidden` option that displays the hidden keys (see [`hide()`](#hide)).\n-If the first argument is a boolean, it enables/disables this option altogether. I.e. hidden keys will be permanently hidden if first argument is `false`.\n+If the first argument is a boolean, it enables/disables this option altogether. i.e. hidden keys will be permanently hidden if first argument is `false`.\nIf the first argument is a string it changes the key name (\"--show-hidden\").\n",
"new_path": "docs/api.md",
"old_path": "docs/api.md"
}
] |
JavaScript
|
MIT License
|
yargs/yargs
|
docs: slight copy-edit nit
| 1
|
docs
| null |
679,913
|
04.03.2018 18:54:49
| 0
|
428de3c78b7be879f8352585d97e3e94e251091e
|
feat(hiccup-css): update fn handling, add iterator support, units, comment
update fn exec rules (now only head pos vs. other pos in array)
add comment() fn
add Format.comments flag
update COMPACT preset to omit comments
add unit format wrappers
rename attribIncl() => attribContains()
rename attribContains() => attribMatches()
|
[
{
"change_type": "MODIFY",
"diff": "@@ -8,6 +8,7 @@ export interface Format {\ndeclStart: string;\ndeclEnd: string;\nindent: string;\n+ comments: boolean;\n}\nexport interface CSSOpts {\n@@ -25,5 +26,24 @@ export const DEFAULT_VENDORS = [\n\"-webkit-\"\n];\n-export const COMPACT: Format = { rules: \"\", ruleSep: \",\", valSep: \"\", decls: \"\", declStart: \"{\", declEnd: \"}\", indent: \"\" };\n-export const PRETTY: Format = { rules: \"\\n\", ruleSep: \", \", valSep: \" \", decls: \"\\n\", declStart: \" {\\n\", declEnd: \"}\\n\", indent: \" \" };\n+export const COMPACT: Format = {\n+ rules: \"\",\n+ ruleSep: \",\",\n+ valSep: \"\",\n+ decls: \"\",\n+ declStart: \"{\",\n+ declEnd: \"}\",\n+ indent: \"\",\n+ comments: false,\n+};\n+\n+export const PRETTY: Format = {\n+ rules: \"\\n\",\n+ ruleSep: \", \",\n+ valSep: \" \",\n+ decls: \"\\n\",\n+ declStart: \" {\\n\",\n+ declEnd: \"}\\n\",\n+ indent: \" \",\n+ comments: true,\n+};\n",
"new_path": "packages/hiccup-css/src/api.ts",
"old_path": "packages/hiccup-css/src/api.ts"
},
{
"change_type": "MODIFY",
"diff": "const $ = (op) => (id: string, x: string | number, caseSensitve = false) => `[${id}${op}=\"${x}\"${caseSensitve ? \" i\" : \"\"}]`;\nexport const withAttrib = (id: string) => `[${id}]`;\nexport const attribEq = $(\"\");\n-export const attribIncl = $(\"~\");\n+export const attribContains = $(\"~\");\nexport const attribPrefix = $(\"^\");\nexport const attribSuffix = $(\"$\");\n-export const attribContains = $(\"*\");\n+export const attribMatches = $(\"*\");\n",
"new_path": "packages/hiccup-css/src/attribs.ts",
"old_path": "packages/hiccup-css/src/attribs.ts"
},
{
"change_type": "ADD",
"diff": "+export function comment(body: string, force = false) {\n+ return (acc, opts) =>\n+ (opts.format.comments || force ?\n+ (Array.prototype.push.apply(acc, [\"/* \", body, \" */\"]), acc) :\n+ acc);\n+}\n",
"new_path": "packages/hiccup-css/src/comment.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "import { isArray } from \"@thi.ng/checks/is-array\";\nimport { isFunction } from \"@thi.ng/checks/is-function\";\n+import { isIterable } from \"@thi.ng/checks/is-iterable\";\nimport { isPlainObject } from \"@thi.ng/checks/is-plain-object\";\n+import { isString } from \"@thi.ng/checks/is-string\";\nimport { transduce } from \"@thi.ng/transducers/transduce\";\nimport { permutations } from \"@thi.ng/transducers/iter/permutations\";\nimport { str } from \"@thi.ng/transducers/rfn/str\";\n@@ -10,7 +12,7 @@ import { map } from \"@thi.ng/transducers/xform/map\";\nimport { CSSOpts, COMPACT, DEFAULT_VENDORS } from \"./api\";\nimport { indent } from \"./utils\";\n-const NO_SPACES = \".:[\";\n+const NO_SPACES = \":[\";\nconst xfSel = ((a, b) => (x) => a(b(x)))(\nflatten(),\n@@ -48,15 +50,17 @@ export function _css(acc: string[], parent: any[], rules: any[], opts: CSSOpts)\nconst r = rules[i];\nif (isArray(r)) {\n_css(acc, makeSelector(parent, sel), r, opts);\n+ } else if (isIterable(r) && !isString(r)) {\n+ _css(acc, makeSelector(parent, sel), [...r], opts);\n} else if ((isFn = isFunction(r)) || opts.fns[r]) {\n- if (parent.length === 0) {\n+ if (i === 0) {\nreturn opts.fns[r] ?\nopts.fns[r].apply(null, rules.slice(i + 1))(acc, opts) :\nr(acc, opts);\n} else if (isFn) {\nsel.push(r());\n} else {\n- throw new Error(`quoted fn ('${r}') only allowed @ root level`);\n+ throw new Error(`quoted fn ('${r}') only allowed at head position`);\n}\n} else if (isPlainObject(r)) {\ncurr = Object.assign(curr || {}, r);\n@@ -103,14 +107,16 @@ function makeSelector(parent: any[], curr: any[]) {\nfunction formatRule(parent: any[], sel: any[], curr: any, opts: CSSOpts) {\nconst f = opts.format;\nconst space = indent(opts);\n- return space\n- + transduce(\n+ return [\n+ space,\n+ transduce(\nmap((sel: any[]) => transduce(xfSel, str(), isArray(sel) ? sel : [sel]).trim()),\nstr(f.ruleSep),\n- makeSelector(parent, sel))\n- + f.declStart\n- + formatDecls(curr, opts)\n- + space\n- + f.declEnd;\n+ makeSelector(parent, sel)),\n+ f.declStart,\n+ formatDecls(curr, opts),\n+ space,\n+ f.declEnd\n+ ].join(\"\");\n}\n",
"new_path": "packages/hiccup-css/src/css.ts",
"old_path": "packages/hiccup-css/src/css.ts"
},
{
"change_type": "MODIFY",
"diff": "-export function at_import(url: string, ...queries: string[]) {\n+import { RuleFn } from \"./api\";\n+\n+export function at_import(url: string, ...queries: string[]): RuleFn {\nreturn (acc, _) => (\nacc.push(\nqueries.length ?\n",
"new_path": "packages/hiccup-css/src/import.ts",
"old_path": "packages/hiccup-css/src/import.ts"
},
{
"change_type": "MODIFY",
"diff": "export * from \"./api\";\nexport * from \"./attribs\";\n+export * from \"./comment\";\nexport * from \"./conditional\";\nexport * from \"./css\";\nexport * from \"./import\";\n@@ -8,3 +9,4 @@ export * from \"./media\";\nexport * from \"./namespace\";\nexport * from \"./quoted-functions\";\nexport * from \"./supports\";\n+export * from \"./units\";\n",
"new_path": "packages/hiccup-css/src/index.ts",
"old_path": "packages/hiccup-css/src/index.ts"
},
{
"change_type": "MODIFY",
"diff": "-import { CSSOpts } from \"./api\";\n+import { CSSOpts, RuleFn } from \"./api\";\nimport { formatDecls } from \"./css\";\nimport { indent } from \"./utils\";\n-export function at_keyframes(id: string, stops: any);\n-export function at_keyframes(id: string, from: any, to: any);\n-export function at_keyframes(id: string, ...args: any[]) {\n+/**\n+ * Rule function for `@keyframes`. If a single declaration object is given,\n+ * it's keys are used as keyframe stops and their values as their declarations\n+ * objects. This way any number of stops can be specified.\n+ *\n+ * ```\n+ * css(at_keyframes(\"fadein\", {\"0%\": {opacity: 0}, \"100%\": {opacity: 1}}))\n+ * // @keyframes fadein {\n+ * //\n+ * // 0% {\n+ * // opacity: 0;\n+ * // }\n+ * //\n+ * // 100% {\n+ * // opacity: 1;\n+ * // }\n+ * //\n+ * // }\n+ * ```\n+ *\n+ * If called with two objects, the first one provides the declarations for the\n+ * `from` keyframe and the 2nd for the `to` keyframe.\n+ *\n+ * ```\n+ * css(at_keyframes(\"fadein\", {opacity: 0}, {opacity: 1}));\n+ * // @keyframes fadein {\n+ * //\n+ * // from {\n+ * // opacity: 0;\n+ * // }\n+ * //\n+ * // to {\n+ * // opacity: 1;\n+ * // }\n+ * //\n+ * // }\n+ * ```\n+ *\n+ * @param id\n+ * @param stops\n+ */\n+export function at_keyframes(id: string, stops: any): RuleFn;\n+export function at_keyframes(id: string, from: any, to: any): RuleFn;\n+export function at_keyframes(id: string, ...args: any[]): RuleFn {\nconst stops = args.length === 1 ? args[0] : { from: args[0], to: args[1] };\nreturn (acc: string[], opts: CSSOpts) => {\nconst outer = indent(opts);\n",
"new_path": "packages/hiccup-css/src/keyframes.ts",
"old_path": "packages/hiccup-css/src/keyframes.ts"
},
{
"change_type": "MODIFY",
"diff": "-export function at_namespace(url: string);\n-export function at_namespace(prefix: string, url: string);\n-export function at_namespace(...args: string[]) {\n+import { RuleFn } from \"./api\";\n+\n+export function at_namespace(url: string): RuleFn;\n+export function at_namespace(prefix: string, url: string): RuleFn;\n+export function at_namespace(...args: string[]): RuleFn {\nreturn (acc, _) => (\nacc.push(\nargs.length > 1 ?\n",
"new_path": "packages/hiccup-css/src/namespace.ts",
"old_path": "packages/hiccup-css/src/namespace.ts"
},
{
"change_type": "MODIFY",
"diff": "+import { comment } from \"./comment\";\nimport { at_import } from \"./import\";\nimport { at_keyframes } from \"./keyframes\";\nimport { at_media } from \"./media\";\n@@ -5,6 +6,7 @@ import { at_namespace } from \"./namespace\";\nimport { at_supports } from \"./supports\";\nexport const QUOTED_FNS = {\n+ \"@comment\": comment,\n\"@import\": at_import,\n\"@keyframes\": at_keyframes,\n\"@media\": at_media,\n",
"new_path": "packages/hiccup-css/src/quoted-functions.ts",
"old_path": "packages/hiccup-css/src/quoted-functions.ts"
},
{
"change_type": "ADD",
"diff": "+export const em = (x: number) => `${x}em`;\n+export const ex = (x: number) => `${x}ex`;\n+export const rem = (x: number) => `${x}rem`;\n+export const perc = (x: number) => `${x}%`;\n+export const px = (x: number) => `${x}px`;\n+export const vh = (x: number) => `${x}vh`;\n+export const vw = (x: number) => `${x}vw`;\n+\n+export const ms = (x: number) => `${x}ms`;\n+export const sec = (x: number) => `${x}s`;\n+\n+export const deg = (x: number) => `${x}deg`;\n",
"new_path": "packages/hiccup-css/src/units.ts",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(hiccup-css): update fn handling, add iterator support, units, comment
- update fn exec rules (now only head pos vs. other pos in array)
- add comment() fn
- add Format.comments flag
- update COMPACT preset to omit comments
- add unit format wrappers
- rename attribIncl() => attribContains()
- rename attribContains() => attribMatches()
| 1
|
feat
|
hiccup-css
|
679,913
|
04.03.2018 20:18:29
| 0
|
57533c76dfe153103268bab0368c86c24010ed4d
|
feat(hiccup-css): update conditional handling, add formatCond()
|
[
{
"change_type": "MODIFY",
"diff": "+import { IObjectOf } from \"@thi.ng/api/api\";\n+\nexport type RuleFn = (acc: string[], opts: CSSOpts) => string[];\n+export type Conditional = string | IObjectOf<boolean | number | string>;\n+\nexport interface Format {\nrules: string;\nruleSep: string;\n",
"new_path": "packages/hiccup-css/src/api.ts",
"old_path": "packages/hiccup-css/src/api.ts"
},
{
"change_type": "MODIFY",
"diff": "-import { CSSOpts, RuleFn } from \"./api\";\n+import { isString } from \"@thi.ng/checks/is-string\";\n+import { Conditional, CSSOpts, RuleFn } from \"./api\";\nimport { _css } from \"./css\";\nimport { indent } from \"./utils\";\n-export function conditional(type: string, cond: string, rules: any[]): RuleFn {\n+export function conditional(type: string, cond: Conditional, rules: any[]): RuleFn {\nreturn (acc: string[], opts: CSSOpts) => {\nconst space = indent(opts);\n- acc.push(`${space}${type}(${cond})${opts.format.declStart}`);\n+ acc.push(`${space}${type} ${formatCond(cond)}${opts.format.declStart}`);\nopts.depth++;\n_css(acc, [], rules, opts);\nopts.depth--;\n@@ -13,3 +14,26 @@ export function conditional(type: string, cond: string, rules: any[]): RuleFn {\nreturn acc;\n};\n}\n+\n+function formatCond(cond: any) {\n+ if (isString(cond)) {\n+ return cond;\n+ }\n+ const acc = [];\n+ for (let c in cond) {\n+ if (cond.hasOwnProperty(c)) {\n+ let v = cond[c];\n+ if (v === true) {\n+ v = c;\n+ } else if (v === false) {\n+ v = \"not \" + c;\n+ } else if (v === \"only\") {\n+ v += \" \" + c;\n+ } else {\n+ v = `(${c}:${v})`;\n+ }\n+ acc.push(v);\n+ }\n+ }\n+ return acc.join(\" and \");\n+}\n",
"new_path": "packages/hiccup-css/src/conditional.ts",
"old_path": "packages/hiccup-css/src/conditional.ts"
},
{
"change_type": "MODIFY",
"diff": "-import { RuleFn } from \"./api\";\n+import { RuleFn, Conditional } from \"./api\";\nimport { conditional } from \"./conditional\";\n-export function at_media(cond, rules: any[]): RuleFn {\n+export function at_media(cond: Conditional, rules: any[]): RuleFn {\nreturn conditional(\"@media\", cond, rules);\n}\n",
"new_path": "packages/hiccup-css/src/media.ts",
"old_path": "packages/hiccup-css/src/media.ts"
},
{
"change_type": "MODIFY",
"diff": "-import { RuleFn } from \"./api\";\n+import { RuleFn, Conditional } from \"./api\";\nimport { conditional } from \"./conditional\";\n-export function at_supports(cond, rules: any[]): RuleFn {\n+export function at_supports(cond: Conditional, rules: any[]): RuleFn {\nreturn conditional(\"@supports\", cond, rules);\n}\n",
"new_path": "packages/hiccup-css/src/supports.ts",
"old_path": "packages/hiccup-css/src/supports.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(hiccup-css): update conditional handling, add formatCond()
| 1
|
feat
|
hiccup-css
|
679,913
|
04.03.2018 20:19:02
| 0
|
e347c2924e3fedf00b6de59e30cd42bbd0f7880d
|
fix(hiccup-css): query separator
|
[
{
"change_type": "MODIFY",
"diff": "import { RuleFn } from \"./api\";\nexport function at_import(url: string, ...queries: string[]): RuleFn {\n- return (acc, _) => (\n+ return (acc, opts) => (\nacc.push(\nqueries.length ?\n- `@import url(${url}) ${queries.join(\" \")};` :\n+ `@import url(${url}) ${queries.join(opts.format.ruleSep)};` :\n`@import url(${url});`\n),\nacc\n",
"new_path": "packages/hiccup-css/src/import.ts",
"old_path": "packages/hiccup-css/src/import.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
fix(hiccup-css): @import query separator
| 1
|
fix
|
hiccup-css
|
679,913
|
04.03.2018 20:20:38
| 0
|
a623117247ec3bb180129188c874fc6e1bd6a1be
|
refactor(hiccup-css): format stops, rename perc() => percent()
|
[
{
"change_type": "MODIFY",
"diff": "import { CSSOpts, RuleFn } from \"./api\";\nimport { formatDecls } from \"./css\";\n+import { percent } from \"./units\";\nimport { indent } from \"./utils\";\n/**\n@@ -8,7 +9,7 @@ import { indent } from \"./utils\";\n* objects. This way any number of stops can be specified.\n*\n* ```\n- * css(at_keyframes(\"fadein\", {\"0%\": {opacity: 0}, \"100%\": {opacity: 1}}))\n+ * css(at_keyframes(\"fadein\", {0: {opacity: 0}, 100: {opacity: 1}}))\n* // @keyframes fadein {\n* //\n* // 0% {\n@@ -23,17 +24,17 @@ import { indent } from \"./utils\";\n* ```\n*\n* If called with two objects, the first one provides the declarations for the\n- * `from` keyframe and the 2nd for the `to` keyframe.\n+ * 0% keyframe and the 2nd for the 100% keyframe.\n*\n* ```\n* css(at_keyframes(\"fadein\", {opacity: 0}, {opacity: 1}));\n* // @keyframes fadein {\n* //\n- * // from {\n+ * // 0% {\n* // opacity: 0;\n* // }\n* //\n- * // to {\n+ * // 100% {\n* // opacity: 1;\n* // }\n* //\n@@ -46,7 +47,7 @@ import { indent } from \"./utils\";\nexport function at_keyframes(id: string, stops: any): RuleFn;\nexport function at_keyframes(id: string, from: any, to: any): RuleFn;\nexport function at_keyframes(id: string, ...args: any[]): RuleFn {\n- const stops = args.length === 1 ? args[0] : { from: args[0], to: args[1] };\n+ const stops = args.length === 1 ? args[0] : { 0: args[0], 100: args[1] };\nreturn (acc: string[], opts: CSSOpts) => {\nconst outer = indent(opts);\nopts.depth++;\n@@ -55,7 +56,7 @@ export function at_keyframes(id: string, ...args: any[]): RuleFn {\nfor (let s in stops) {\nif (stops.hasOwnProperty(s)) {\nacc.push([\n- inner, s, opts.format.declStart,\n+ inner, percent(<any>s), opts.format.declStart,\nformatDecls(stops[s], opts),\ninner, opts.format.declEnd\n].join(\"\"));\n",
"new_path": "packages/hiccup-css/src/keyframes.ts",
"old_path": "packages/hiccup-css/src/keyframes.ts"
},
{
"change_type": "MODIFY",
"diff": "export const em = (x: number) => `${x}em`;\nexport const ex = (x: number) => `${x}ex`;\nexport const rem = (x: number) => `${x}rem`;\n-export const perc = (x: number) => `${x}%`;\n+export const percent = (x: number) => `${x}%`;\nexport const px = (x: number) => `${x}px`;\nexport const vh = (x: number) => `${x}vh`;\nexport const vw = (x: number) => `${x}vw`;\n",
"new_path": "packages/hiccup-css/src/units.ts",
"old_path": "packages/hiccup-css/src/units.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(hiccup-css): format @keyframe stops, rename perc() => percent()
| 1
|
refactor
|
hiccup-css
|
679,913
|
04.03.2018 20:20:56
| 0
|
cbb9b7f07e6024ece0d2b3cd429b627d58d71956
|
test(hiccup-css): add/update tests
|
[
{
"change_type": "MODIFY",
"diff": "import * as assert from \"assert\";\n-import { css, PRETTY } from \"../src\";\n+import { css, PRETTY, at_import, at_keyframes, at_media } from \"../src\";\nconst rules = {\na: { color: \"red\" },\nb: { border: 0 },\n- f: { foo: (rules) => rules.bar, bar: 1 }\n+ c: { font: [[\"14px\", \"Inconsolata\"], \"monospace\"] },\n+ f: { foo: (rules) => rules.bar, bar: 1 },\n};\ndescribe(\"hiccup-css\", () => {\n@@ -14,6 +15,8 @@ describe(\"hiccup-css\", () => {\nassert.equal(css(\"a\"), undefined);\nassert.equal(css({}), \"\");\nassert.equal(css(rules.a), \"color:red;\");\n+ assert.equal(css(rules.b), \"border:0;\");\n+ assert.equal(css(rules.c), \"font:14px Inconsolata,monospace;\");\nassert.equal(css(rules.f), \"foo:1;bar:1;\");\n});\n@@ -65,4 +68,64 @@ describe(\"hiccup-css\", () => {\n\"#id h1 {\\n color: red;\\n border: 0;\\n}\\n\\n#id h2 div, #id h3 div {\\n border: 0;\\n}\\n\\n#id h2[attr] span, #id h3[attr] span {\\n color: red;\\n}\\n\"\n);\n});\n+\n+ it(\"@import\", () => {\n+ assert.equal(\n+ css(at_import(\"foo.css\")),\n+ \"@import url(foo.css);\"\n+ );\n+ assert.equal(\n+ css([at_import(\"foo.css\"), /* will be ignored */[\"div\", {}]]),\n+ \"@import url(foo.css);\"\n+ );\n+ assert.equal(\n+ css([[at_import(\"foo.css\")], [\"div\", {}]]),\n+ \"@import url(foo.css);div{}\"\n+ );\n+ assert.equal(\n+ css(at_import(\"foo.css\", \"screen\", \"print\")),\n+ \"@import url(foo.css) screen,print;\"\n+ );\n+ });\n+\n+ it(\"@keyframes\", () => {\n+ assert.equal(\n+ css(at_keyframes(\"fadein\", { 0: { opacity: 0 }, 100: { opacity: 1 } })),\n+ \"@keyframes fadein{0%{opacity:0;}100%{opacity:1;}}\"\n+ );\n+ assert.equal(\n+ css(at_keyframes(\"fadein\", { opacity: 0 }, { opacity: 1 })),\n+ \"@keyframes fadein{0%{opacity:0;}100%{opacity:1;}}\"\n+ );\n+ });\n+\n+ it(\"@media\", () => {\n+ assert.equal(\n+ css(at_media({ screen: true }, [])),\n+ \"@media screen{}\"\n+ );\n+ assert.equal(\n+ css(at_media({ screen: false }, [])),\n+ \"@media not screen{}\"\n+ );\n+ assert.equal(\n+ css(at_media({ screen: false, print: true }, [])),\n+ \"@media not screen and print{}\"\n+ );\n+ assert.equal(\n+ css(at_media({ screen: \"only\" }, [])),\n+ \"@media only screen{}\"\n+ );\n+ assert.equal(\n+ css(at_media({ \"min-width\": \"10rem\" }, [\"div\", [\".foo\", rules.a]])),\n+ \"@media (min-width:10rem){div .foo{color:red;}}\"\n+ );\n+ assert.equal(\n+ css(at_media({ screen: true, print: true }, [\n+ [\"div\", [\".foo\", rules.a]],\n+ [at_media({ print: true, \"max-width\": \"20rem\" }, [\"div\", rules.b])]\n+ ])),\n+ \"@media screen and print{div .foo{color:red;}@media print and (max-width:20rem){div{border:0;}}}\"\n+ );\n+ });\n});\n",
"new_path": "packages/hiccup-css/test/index.ts",
"old_path": "packages/hiccup-css/test/index.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
test(hiccup-css): add/update tests
| 1
|
test
|
hiccup-css
|
743,872
|
04.03.2018 23:38:57
| -3,600
|
32f6a620103433fa7dc312a3197a396fd165c33d
|
docs: add tip regarding using -- in conjunction with array()
|
[
{
"change_type": "MODIFY",
"diff": "@@ -61,6 +61,16 @@ Tell the parser to interpret `key` as an array. If `.array('foo')` is set,\nAlso, if you use the option multiple times all the values will be flattened in one array\nso `--foo foo --foo bar` will be parsed as `['foo', 'bar']`\n+When the option is used with a positional, use `--` to tell `yargs` to stop adding values to the array.\n+\n+For example: `--foo foo bar -- val` will be parsed as\n+```javascript\n+{\n+ _: ['val'],\n+ foo: ['foo', 'bar']\n+}\n+```\n+\n<a name=\"boolean\"></a>.boolean(key)\n-------------\n",
"new_path": "docs/api.md",
"old_path": "docs/api.md"
}
] |
JavaScript
|
MIT License
|
yargs/yargs
|
docs: add tip regarding using -- in conjunction with array() (#1057)
| 1
|
docs
| null |
679,913
|
05.03.2018 01:40:21
| 0
|
02bff871bddae1cb390e2b12f0ad98a465878dba
|
feat(hiccup-css): add support for iterators as arg type to css()
|
[
{
"change_type": "MODIFY",
"diff": "@@ -31,6 +31,9 @@ export function css(rules: any, opts?: Partial<CSSOpts>) {\nif (isArray(opts.autoprefix)) {\nopts.autoprefix = new Set(opts.autoprefix);\n}\n+ if (isIterable(rules) && !isString(rules)) {\n+ rules = [...rules];\n+ }\nif (isArray(rules)) {\nreturn _css([], [], rules, <CSSOpts>opts).join(opts.format.rules);\n}\n@@ -64,7 +67,7 @@ export function _css(acc: string[], parent: any[], rules: any[], opts: CSSOpts)\n}\n} else if (isPlainObject(r)) {\ncurr = Object.assign(curr || {}, r);\n- } else {\n+ } else if (r != null) {\nsel.push(r);\n}\n}\n",
"new_path": "packages/hiccup-css/src/css.ts",
"old_path": "packages/hiccup-css/src/css.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(hiccup-css): add support for iterators as arg type to css()
| 1
|
feat
|
hiccup-css
|
679,913
|
05.03.2018 01:41:41
| 0
|
787d0aba676a41a2f224f31883c980818b17d004
|
feat(hiccup-css): add more unit types, update px/ms
add rad(), turn()
force int values for px()/ms()
|
[
{
"change_type": "MODIFY",
"diff": "@@ -2,11 +2,13 @@ export const em = (x: number) => `${x}em`;\nexport const ex = (x: number) => `${x}ex`;\nexport const rem = (x: number) => `${x}rem`;\nexport const percent = (x: number) => `${x}%`;\n-export const px = (x: number) => `${x}px`;\n+export const px = (x: number) => `${x >>> 0}px`;\nexport const vh = (x: number) => `${x}vh`;\nexport const vw = (x: number) => `${x}vw`;\n-export const ms = (x: number) => `${x}ms`;\n+export const ms = (x: number) => `${x >>> 0}ms`;\nexport const sec = (x: number) => `${x}s`;\nexport const deg = (x: number) => `${x}deg`;\n+export const rad = (x: number) => `${x}rad`;\n+export const turn = (x: number) => `${x}turn`;\n",
"new_path": "packages/hiccup-css/src/units.ts",
"old_path": "packages/hiccup-css/src/units.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(hiccup-css): add more unit types, update px/ms
- add rad(), turn()
- force int values for px()/ms()
| 1
|
feat
|
hiccup-css
|
743,891
|
05.03.2018 02:02:06
| -19,080
|
ea862ae551b8e973534c1fc0248bc85fd8a01c7a
|
feat: allow hidden options to be displayed with --show-hidden
|
[
{
"change_type": "MODIFY",
"diff": "@@ -576,6 +576,11 @@ Describe a `key` for the generated usage information.\nOptionally `.describe()` can take an object that maps keys to descriptions.\n+<a name=\"hide\"></a>.hide(key)\n+--------------------\n+\n+Hides a `key` from the generated usage information. Unless a `--show-hidden` option is also passed with `--help` (see [`showHidden()`](#showHidden)).\n+\n.detectLocale(boolean)\n-----------\n@@ -798,6 +803,29 @@ var yargs = require(\"yargs\")(['--info'])\n.argv\n```\n+<a name=\"showHidden\"></a>.showHidden()\n+-----------------------------------------\n+.showHidden([option | boolean])\n+-----------------------------------------\n+.showHidden([option, [description]])\n+-----------------------------------------\n+\n+Configure the `--show-hidden` option that displays the hidden keys (see [`hide()`](#hide)).\n+\n+If the first argument is a boolean, it enables/disables this option altogether. I.e. hidden keys will be permanently hidden if first argument is `false`.\n+\n+If the first argument is a string it changes the key name (\"--show-hidden\").\n+\n+Second argument changes the default description (\"Show hidden options\")\n+\n+Example:\n+\n+```js\n+var yargs = require(\"yargs\")(['--help'])\n+ .showHidden('show-hidden', 'Show hidden options')\n+ .argv\n+```\n+\n<a name=\"implies\"></a>.implies(x, y)\n--------------\n",
"new_path": "docs/api.md",
"old_path": "docs/api.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -152,16 +152,23 @@ module.exports = function usage (yargs, y18n) {\nconst demandedCommands = yargs.getDemandedCommands()\nconst groups = yargs.getGroups()\nconst options = yargs.getOptions()\n- let keys = Object.keys(\n- Object.keys(descriptions)\n- .concat(Object.keys(demandedOptions))\n- .concat(Object.keys(demandedCommands))\n- .concat(Object.keys(options.default))\n- .reduce((acc, key) => {\n+\n+ let keys = []\n+ keys = keys.concat(Object.keys(descriptions))\n+ keys = keys.concat(Object.keys(demandedOptions))\n+ keys = keys.concat(Object.keys(demandedCommands))\n+ keys = keys.concat(Object.keys(options.default))\n+ keys = keys.filter(key => {\n+ if (options.hiddenOptions.indexOf(key) < 0) {\n+ return true\n+ } else if (yargs.parsed.argv[options.showHiddenOpt]) {\n+ return true\n+ }\n+ })\n+ keys = Object.keys(keys.reduce((acc, key) => {\nif (key !== '_') acc[key] = true\nreturn acc\n- }, {})\n- )\n+ }, {}))\nconst theWrap = getWrap()\nconst ui = require('cliui')({\n",
"new_path": "lib/usage.js",
"old_path": "lib/usage.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -2887,5 +2887,83 @@ describe('usage tests', () => {\n''\n])\n})\n+ it('--help should display all options (including hidden ones) with --show-hidden', () => {\n+ const r = checkUsage(() => yargs('--help --show-hidden --mama ama')\n+ .options({\n+ foo: {\n+ describe: 'FOO'\n+ },\n+ bar: {},\n+ baz: {\n+ describe: 'BAZ',\n+ hidden: true\n+ }\n+ })\n+ .argv\n+ )\n+\n+ r.logs[0].split('\\n').should.deep.equal([\n+ 'Options:',\n+ ' --help Show help [boolean]',\n+ ' --version Show version number [boolean]',\n+ ' --foo FOO',\n+ ' --bar',\n+ ' --baz BAZ',\n+ ''\n+ ])\n+ })\n+ it('--help should display --custom-show-hidden', () => {\n+ const r = checkUsage(() => yargs('--help')\n+ .options({\n+ foo: {\n+ describe: 'FOO'\n+ },\n+ bar: {},\n+ baz: {\n+ describe: 'BAZ',\n+ hidden: true\n+ }\n+ })\n+ .showHidden('custom-show-hidden')\n+ .argv\n+ )\n+\n+ r.logs[0].split('\\n').should.deep.equal([\n+ 'Options:',\n+ ' --help Show help [boolean]',\n+ ' --version Show version number [boolean]',\n+ ' --foo FOO',\n+ ' --bar',\n+ ' --custom-show-hidden Show hidden options [boolean]',\n+ ''\n+ ])\n+ })\n+ it('--help should display all options with --custom-show-hidden', () => {\n+ const r = checkUsage(() => yargs('--help --custom-show-hidden')\n+ .options({\n+ foo: {\n+ describe: 'FOO'\n+ },\n+ bar: {},\n+ baz: {\n+ describe: 'BAZ',\n+ hidden: true\n+ }\n+ })\n+ .showHidden('custom-show-hidden')\n+ .argv\n+ )\n+\n+ r.logs[0].split('\\n').should.deep.equal([\n+ 'Options:',\n+ ' --help Show help [boolean]',\n+ ' --version Show version number [boolean]',\n+ ' --foo FOO',\n+ ' --bar',\n+ ' --baz BAZ',\n+ ' --custom-show-hidden Show hidden options [boolean]',\n+ ''\n+ ])\n+ })\n})\n})\n",
"new_path": "test/usage.js",
"old_path": "test/usage.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -129,6 +129,42 @@ describe('yargs dsl tests', () => {\nexpect(r.errors).to.deep.equal([])\n})\n+ describe('hide', () => {\n+ it('should add the key to hiddenOptions', () => {\n+ const options = yargs('')\n+ .hide('someKey')\n+ .getOptions()\n+ options.should.have.property('hiddenOptions')\n+ options.hiddenOptions.should.include('someKey')\n+ })\n+ })\n+\n+ describe('showHidden', () => {\n+ it('should have a default show-hidden private option pre-configured', () => {\n+ const options = yargs('').getOptions()\n+ options.should.have.property('showHiddenOpt')\n+ options.showHiddenOpt.should.eql('show-hidden')\n+ })\n+ it('should not have show-hidden as an actual option described by default', () => {\n+ const options = yargs('').getOptions()\n+ options.key.should.not.have.property('show-hidden')\n+ })\n+ it('should set show-hidden option', () => {\n+ const options = yargs('')\n+ .showHidden()\n+ .getOptions()\n+ options.key.should.have.property('show-hidden')\n+ })\n+ it('should set custom-show-hidden option', () => {\n+ const options = yargs('')\n+ .showHidden('custom-show-hidden')\n+ .getOptions()\n+ options.key.should.have.property('custom-show-hidden')\n+ options.should.have.property('showHiddenOpt')\n+ options.showHiddenOpt.should.eql('custom-show-hidden')\n+ })\n+ })\n+\ndescribe('showHelpOnFail', () => {\nit('should display custom failure message, if string is provided as first argument', () => {\nconst r = checkOutput(() => yargs([])\n@@ -233,6 +269,7 @@ describe('yargs dsl tests', () => {\nconfig: {},\nconfigObjects: [],\nenvPrefix: 'YARGS', // preserved as global\n+ hiddenOptions: [],\ndemandedCommands: {},\ndemandedOptions: {},\nlocal: [\n",
"new_path": "test/yargs.js",
"old_path": "test/yargs.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -93,7 +93,8 @@ function Yargs (processArgs, cwd, parentRequire) {\nconst arrayOptions = [\n'array', 'boolean', 'string', 'skipValidation',\n- 'count', 'normalize', 'number'\n+ 'count', 'normalize', 'number',\n+ 'hiddenOptions'\n]\nconst objectOptions = [\n@@ -657,8 +658,9 @@ function Yargs (processArgs, cwd, parentRequire) {\n}\nconst desc = opt.describe || opt.description || opt.desc\n- if (!opt.hidden) {\nself.describe(key, desc)\n+ if (opt.hidden) {\n+ self.hide(key)\n}\nif (opt.requiresArg) {\n@@ -824,6 +826,28 @@ function Yargs (processArgs, cwd, parentRequire) {\nreturn self\n}\n+ const defaultShowHiddenOpt = 'show-hidden'\n+ options.showHiddenOpt = defaultShowHiddenOpt\n+ self.addShowHiddenOpt = self.showHidden = function addShowHiddenOpt (opt, msg) {\n+ argsert('[string|boolean] [string]', [opt, msg], arguments.length)\n+\n+ if (arguments.length === 1) {\n+ if (opt === false) return self\n+ }\n+\n+ const showHiddenOpt = typeof opt === 'string' ? opt : defaultShowHiddenOpt\n+ self.boolean(showHiddenOpt)\n+ self.describe(showHiddenOpt, msg || usage.deferY18nLookup('Show hidden options'))\n+ options.showHiddenOpt = showHiddenOpt\n+ return self\n+ }\n+\n+ self.hide = function hide (key) {\n+ argsert('<string|object>', [key], arguments.length)\n+ options.hiddenOptions.push(key)\n+ return self\n+ }\n+\nself.showHelpOnFail = function showHelpOnFail (enabled, message) {\nargsert('[boolean|string] [string]', [enabled, message], arguments.length)\nusage.showHelpOnFail(enabled, message)\n",
"new_path": "yargs.js",
"old_path": "yargs.js"
}
] |
JavaScript
|
MIT License
|
yargs/yargs
|
feat: allow hidden options to be displayed with --show-hidden (#1061)
| 1
|
feat
| null |
743,966
|
05.03.2018 02:14:33
| -19,080
|
9fd4da4223802e6ce1aafe9b0995098bebc6c321
|
docs: restructured the contents of readme
|
[
{
"change_type": "MODIFY",
"diff": "-# Yargs\n+<p align=\"center\">\n+ <img width=\"250\" src=\"/yargs-logo.png\">\n+</p>\n+<h1 align=\"center\"> Yargs </h1>\n+<p align=\"center\">\n+ <b >Yargs be a node.js library fer hearties tryin' ter parse optstrings</b>\n+</p>\n+<br>\n[![Build Status][travis-image]][travis-url]\n[![Coverage Status][coveralls-image]][coveralls-url]\n[![Conventional Commits][conventional-commits-image]][conventional-commits-url]\n[![Slack][slack-image]][slack-url]\n-_Having problems? want to contribute? join our [community slack](http://devtoolscommunity.herokuapp.com)_.\n-\n-> Yargs be a node.js library fer hearties tryin' ter parse optstrings.\n-\n-<img width=\"250\" src=\"/yargs-logo.png\">\n+## Description :\n+Yargs helps you build interactive command line tools, by parsing arguments and generating an elegant user interface.\n-Yargs helps you build interactive command line tools, by parsing arguments and generating an elegant user interface. It gives you:\n+It gives you:\n* commands and (grouped) options (`my-program.js serve --port=5000`).\n* a dynamically generated help menu based on your arguments.\n@@ -30,7 +34,9 @@ Yargs helps you build interactive command line tools, by parsing arguments and g\nnpm i yargs --save\n```\n-## Simple Example\n+## Usage :\n+\n+### Simple Example\n````javascript\n#!/usr/bin/env node\n@@ -51,9 +57,9 @@ $ ./plunder.js --ships 12 --distance 98.7\nRetreat from the xupptumblers!\n```\n-## Complex Example\n+### Complex Example\n-```js\n+```javascript\n#!/usr/bin/env node\nrequire('yargs') // eslint-disable-line\n.command('serve [port]', 'start the server', (yargs) => {\n@@ -75,7 +81,13 @@ require('yargs') // eslint-disable-line\nRun the example above with `--help` to see the help for the application.\n-## Table of Contents\n+## Community :\n+\n+Having problems? want to contribute? join our [community slack](http://devtoolscommunity.herokuapp.com).\n+\n+## Documentation :\n+\n+### Table of Contents\n* [Yargs' API](/docs/api.md)\n* [Examples](/docs/examples.md)\n",
"new_path": "README.md",
"old_path": "README.md"
}
] |
JavaScript
|
MIT License
|
yargs/yargs
|
docs: restructured the contents of readme (#1082)
| 1
|
docs
| null |
679,913
|
05.03.2018 04:02:42
| 0
|
f3190fff9194950ef954ac0f19cdb62dfa0b1d26
|
fix(hiccup-css): fn & auto-prefix handling
|
[
{
"change_type": "MODIFY",
"diff": "@@ -49,19 +49,21 @@ export function _css(acc: string[], parent: any[], rules: any[], opts: CSSOpts)\nconst n = rules.length;\nconst sel: string[] = [];\nlet curr: any, isFn;\n- for (let i = 0; i < n; i++) {\n- const r = rules[i];\n+\n+ function process(i, r) {\nif (isArray(r)) {\n_css(acc, makeSelector(parent, sel), r, opts);\n} else if (isIterable(r) && !isString(r)) {\n_css(acc, makeSelector(parent, sel), [...r], opts);\n} else if ((isFn = isFunction(r)) || opts.fns[r]) {\nif (i === 0) {\n- return opts.fns[r] ?\n- opts.fns[r].apply(null, rules.slice(i + 1))(acc, opts) :\n+ if (opts.fns[r]) {\n+ opts.fns[r].apply(null, rules.slice(i + 1))(acc, opts);\n+ return true;\n+ }\nr(acc, opts);\n} else if (isFn) {\n- sel.push(r());\n+ process(i, r());\n} else {\nthrow new Error(`quoted fn ('${r}') only allowed at head position`);\n}\n@@ -71,6 +73,12 @@ export function _css(acc: string[], parent: any[], rules: any[], opts: CSSOpts)\nsel.push(r);\n}\n}\n+\n+ for (let i = 0; i < n; i++) {\n+ if (process(i, rules[i])) {\n+ return acc;\n+ }\n+ }\nif (curr) {\nacc.push(formatRule(parent, sel, curr, opts));\n}\n@@ -95,9 +103,8 @@ export function formatDecls(rules: any, opts: CSSOpts) {\nfor (let v of opts.vendors) {\nacc.push(`${space}${v}${r}:${f.valSep}${val};`);\n}\n- } else {\n- acc.push(`${space}${r}:${f.valSep}${val};`);\n}\n+ acc.push(`${space}${r}:${f.valSep}${val};`);\n}\n}\nreturn acc.join(f.decls) + f.decls;\n",
"new_path": "packages/hiccup-css/src/css.ts",
"old_path": "packages/hiccup-css/src/css.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
fix(hiccup-css): fn & auto-prefix handling
| 1
|
fix
|
hiccup-css
|
679,913
|
05.03.2018 04:03:25
| 0
|
0f416efea2648f88779f7b6730daec8da077158b
|
feat(hiccup-css): add comment() indentation support
|
[
{
"change_type": "MODIFY",
"diff": "-export function comment(body: string, force = false) {\n- return (acc, opts) =>\n- (opts.format.comments || force ?\n- (Array.prototype.push.apply(acc, [\"/* \", body, \" */\"]), acc) :\n- acc);\n+import { RuleFn } from \"./api\";\n+import { indent } from \"./utils\";\n+\n+export function comment(body: string, force = false): RuleFn {\n+ return (acc, opts) => {\n+ const space = indent(opts);\n+ const inner = indent(opts, opts.depth + 1);\n+ if (opts.format.comments || force) {\n+ Array.prototype.push.apply(\n+ acc,\n+ [space + \"/*\", body.split(\"\\n\").map((l) => inner + l).join(\"\\n\"), space + \"*/\"]\n+ );\n+ }\n+ return acc;\n+ };\n}\n",
"new_path": "packages/hiccup-css/src/comment.ts",
"old_path": "packages/hiccup-css/src/comment.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(hiccup-css): add comment() indentation support
| 1
|
feat
|
hiccup-css
|
679,913
|
05.03.2018 04:05:02
| 0
|
24983d376721c44913723f37cba407a34254e83c
|
test(hiccup-css): update tests
|
[
{
"change_type": "MODIFY",
"diff": "@@ -75,8 +75,8 @@ describe(\"hiccup-css\", () => {\n\"@import url(foo.css);\"\n);\nassert.equal(\n- css([at_import(\"foo.css\"), /* will be ignored */[\"div\", {}]]),\n- \"@import url(foo.css);\"\n+ css([at_import(\"foo.css\"), [\"div\", {}]]),\n+ \"@import url(foo.css);div{}\"\n);\nassert.equal(\ncss([[at_import(\"foo.css\")], [\"div\", {}]]),\n",
"new_path": "packages/hiccup-css/test/index.ts",
"old_path": "packages/hiccup-css/test/index.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
test(hiccup-css): update tests
| 1
|
test
|
hiccup-css
|
679,913
|
05.03.2018 04:35:53
| 0
|
69036ad1e803b64ae936df5a95e4a4ce34ce988b
|
minor(hiccup-css): update package desc
|
[
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@thi.ng/hiccup-css\",\n\"version\": \"0.0.1\",\n- \"description\": \"CSS as nested data structures\",\n+ \"description\": \"CSS from nested JS data structures\",\n\"main\": \"./index.js\",\n\"typings\": \"./index.d.ts\",\n\"repository\": \"https://github.com/thi-ng/umbrella\",\n",
"new_path": "packages/hiccup-css/package.json",
"old_path": "packages/hiccup-css/package.json"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
minor(hiccup-css): update package desc
| 1
|
minor
|
hiccup-css
|
815,746
|
05.03.2018 08:37:05
| -7,200
|
a497f0569761154ac1dc2d575d9ed7c365e73ced
|
fix: hide placeholder when value is selected
fixes
|
[
{
"change_type": "MODIFY",
"diff": "-<div (click)=\"searchable ? open() : toggle()\" class=\"ng-control\">\n+<div (click)=\"searchable ? open() : toggle()\" [class.ng-has-value]=\"hasValue\" class=\"ng-control\">\n<div class=\"ng-value-container\">\n<div class=\"ng-placeholder\">{{placeholder}}</div>\n<div [class.disabled]=\"item.disabled\" class=\"ng-value\" *ngFor=\"let item of selectedItems\">\n",
"new_path": "src/ng-select/ng-select.component.html",
"old_path": "src/ng-select/ng-select.component.html"
},
{
"change_type": "MODIFY",
"diff": "cursor: default;\n}\n}\n- &.ng-selected,\n+ .ng-has-value,\n&.filtered {\n- .ng-control .ng-value-container .ng-placeholder {\n+ .ng-placeholder {\ndisplay: none;\n}\n}\n",
"new_path": "src/ng-select/ng-select.component.scss",
"old_path": "src/ng-select/ng-select.component.scss"
},
{
"change_type": "MODIFY",
"diff": "@@ -374,7 +374,37 @@ describe('NgSelectComponent', function () {\nvalue: { id: 2, name: 'Kaunas' },\nselected: true\n})];\n- expect(fixture.componentInstance.select.selectedItems).toEqual(result);\n+ const select = fixture.componentInstance.select;\n+ expect(select.selectedItems).toEqual(result);\n+ }));\n+\n+ it('should apply host css classes', fakeAsync(() => {\n+ const fixture = createTestingModule(\n+ NgSelectSelectedSimpleCmp,\n+ `<ng-select [items]=\"cities\"\n+ bindLabel=\"name\"\n+ bindValue=\"id\"\n+ placeholder=\"select value\"\n+ [(ngModel)]=\"selectedCity\">\n+ </ng-select>`);\n+\n+ tickAndDetectChanges(fixture);\n+\n+ const select = fixture.componentInstance.select;\n+ const selectEl: HTMLElement = select.elementRef.nativeElement;\n+ // tslint:disable-next-line:max-line-length\n+ const classes = ['ng-select', 'bottom', 'ng-single', 'searchable', 'ng-untouched', 'ng-pristine', 'ng-valid'];\n+ for (const c of classes) {\n+ expect(selectEl.classList.contains(c)).toBeTruthy(`expected to contain \"${c}\" class`);\n+ }\n+ let control = selectEl.querySelector('.ng-control');\n+ expect(control.classList.contains('ng-has-value')).toBeTruthy();\n+\n+\n+ fixture.componentInstance.selectedCity = null;\n+ tickAndDetectChanges(fixture);\n+ control = selectEl.querySelector('.ng-control');\n+ expect(control.classList.contains('ng-has-value')).toBeFalsy();\n}));\nit('should select by bindValue ', fakeAsync(() => {\n@@ -1216,10 +1246,34 @@ describe('NgSelectComponent', function () {\nit('should be visible when no value selected', async(() => {\nfixture.detectChanges();\nfixture.whenStable().then(() => {\n- const el = fixture.debugElement.query(By.css('.ng-placeholder')).nativeElement;\n- expect(el.innerText).toBe('select value');\n+ const selectEl: HTMLElement = fixture.componentInstance.select.elementRef.nativeElement;\n+ const placeholder: any = selectEl.querySelector('.ng-placeholder');\n+ expect(placeholder.innerText).toBe('select value');\n+ expect(getComputedStyle(placeholder).display).toBe('block');\n});\n}));\n+\n+ it('should be visible when value was cleared', fakeAsync(() => {\n+ const select = fixture.componentInstance.select;\n+ fixture.componentInstance.selectedCity = fixture.componentInstance.cities[0];\n+ tickAndDetectChanges(fixture);\n+ const selectEl: HTMLElement = select.elementRef.nativeElement;\n+ const placeholder = selectEl.querySelector('.ng-placeholder')\n+ expect(getComputedStyle(placeholder).display).toBe('none');\n+\n+ select.handleClearClick(<any>{ stopPropagation: () => { } });\n+ tickAndDetectChanges(fixture);\n+\n+ expect(getComputedStyle(placeholder).display).toBe('block');\n+ }));\n+\n+ it('should not be visible when value was selected', fakeAsync(() => {\n+ tickAndDetectChanges(fixture);\n+ const selectEl: HTMLElement = fixture.componentInstance.select.elementRef.nativeElement;\n+ const placeholder = selectEl.querySelector('.ng-placeholder')\n+ selectOption(fixture, KeyCode.ArrowDown, 2);\n+ expect(getComputedStyle(placeholder).display).toBe('none');\n+ }));\n});\ndescribe('Filter', () => {\n",
"new_path": "src/ng-select/ng-select.component.spec.ts",
"old_path": "src/ng-select/ng-select.component.spec.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -59,7 +59,6 @@ export type DropdownPosition = 'bottom' | 'top' | 'auto';\n'[class.top]': 'currentDropdownPosition === \"top\"',\n'[class.bottom]': 'currentDropdownPosition === \"bottom\"',\n'[class.ng-single]': '!multiple',\n- '[class.ng-selected]': 'hasValue'\n}\n})\nexport class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, ControlValueAccessor {\n@@ -135,7 +134,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n};\nconstructor( @Inject(NG_SELECT_DEFAULT_CONFIG) config: NgSelectConfig,\n- private changeDetectorRef: ChangeDetectorRef,\n+ private _cd: ChangeDetectorRef,\npublic elementRef: ElementRef\n) {\nthis._mergeGlobalConfig(config);\n@@ -399,8 +398,8 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\ndetectChanges() {\n- if (!(<any>this.changeDetectorRef).destroyed) {\n- this.changeDetectorRef.detectChanges();\n+ if (!(<any>this._cd).destroyed) {\n+ this._cd.detectChanges();\n}\n}\n@@ -450,7 +449,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n.subscribe(option => {\nconst item = this.itemsList.findItem(option.value);\nitem.disabled = option.disabled;\n- this.changeDetectorRef.markForCheck();\n+ this._cd.markForCheck();\n});\n}\n@@ -526,7 +525,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\nthis._ngModel = ngModel;\nthis.changeEvent.emit(this._value);\n- this.changeDetectorRef.markForCheck();\n+ this._cd.markForCheck();\n}\nprivate _clearSearch() {\n",
"new_path": "src/ng-select/ng-select.component.ts",
"old_path": "src/ng-select/ng-select.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -38,15 +38,15 @@ $highlight-color: #3f51b5;\n}\n}\n}\n- &.ng-selected,\n+ .ng-has-value,\n&.filtered {\n- .ng-control .ng-value-container .ng-placeholder {\n+ .ng-placeholder {\ndisplay: initial;\n}\n}\n- &.ng-selected,\n+ .ng-has-value,\n&.opened {\n- .ng-control .ng-value-container .ng-placeholder {\n+ .ng-placeholder {\ntransform: translateY(-1.28125em) scale(.75) perspective(100px) translateZ(.001px);\n}\n}\n@@ -119,9 +119,8 @@ $highlight-color: #3f51b5;\nline-height: 1.375em;\n}\n}\n- }\n- &.ng-selected {\n- .ng-control {\n+\n+ &.ng-has-value {\nalign-items: center;\n.ng-value-container {\npadding-bottom: 0;\n",
"new_path": "src/themes/material.theme.scss",
"old_path": "src/themes/material.theme.scss"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
fix: hide placeholder when value is selected (#314)
fixes #297
| 1
|
fix
| null |
815,746
|
05.03.2018 08:41:13
| -7,200
|
53e48194a0eb12c6c7fef100fea680c8eb84efa2
|
feat: group by
closes
|
[
{
"change_type": "MODIFY",
"diff": "@@ -23,8 +23,9 @@ import { VirtualScrollComponent } from './examples/virtual-scroll.component';\nimport { DataService } from './shared/data.service';\nimport { AppendToComponent } from './examples/append-to.component';\nimport { DataSourceComponent } from './examples/data-source.component';\n+import { SelectGroupsComponent } from './examples/groups.component';\n-const appRoutes: Routes = [\n+export const appRoutes: Routes = [\n{\npath: '',\nredirectTo: '/data-sources',\n@@ -41,6 +42,7 @@ const appRoutes: Routes = [\n{ path: 'virtual-scroll', component: VirtualScrollComponent, data: { title: 'Virtual scroll'} },\n{ path: 'dropdown-position', component: DropdownPositionsComponent, data: { title: 'Dropdown position'} },\n{ path: 'append-to-element', component: AppendToComponent, data: { title: 'Append to element'} },\n+ { path: 'grouping', component: SelectGroupsComponent, data: { title: 'Grouping'} },\n];\n@NgModule({\n@@ -86,7 +88,8 @@ const appRoutes: Routes = [\nDropdownPositionsComponent,\nVirtualScrollComponent,\nAppendToComponent,\n- DataSourceComponent\n+ DataSourceComponent,\n+ SelectGroupsComponent\n],\nbootstrap: [AppComponent]\n})\n",
"new_path": "demo/app/app.module.ts",
"old_path": "demo/app/app.module.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -46,15 +46,18 @@ import { DataService } from '../shared/data.service';\n</p>\n<hr>\n- <label>Custom label and option</label>\n+ <label>Custom label and option and optgroup</label>\n---html,true\n- <ng-select [items]=\"cities3\" [(ngModel)]=\"selectedCity3\" bindLabel=\"name\" bindValue=\"name\">\n+ <ng-select [items]=\"cities3\" groupBy=\"avatar\" [(ngModel)]=\"selectedCity3\" bindLabel=\"name\" bindValue=\"name\">\n<ng-template ng-label-tmp let-item=\"item\">\n<img height=\"15\" width=\"15\" [src]=\"item.avatar\"/>\n<b>{{item.name}}</b>\n</ng-template>\n- <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\n+ <ng-template ng-optgroup-tmp let-item=\"item\" let-index=\"index\">\n<img height=\"15\" width=\"15\" [src]=\"item.avatar\"/>\n+ <b [innerHTML]=\"item.name\"></b>\n+ </ng-template>\n+ <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\n<b [innerHTML]=\"item.name\" [ngOptionHighlight]=\"search\"></b>\n</ng-template>\n</ng-select>\n",
"new_path": "demo/app/examples/custom-templates.component.ts",
"old_path": "demo/app/examples/custom-templates.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -2,7 +2,7 @@ import { Component, ChangeDetectionStrategy } from '@angular/core';\n@Component({\nselector: 'select-tags',\n- changeDetection: ChangeDetectionStrategy.OnPush,\n+ changeDetection: ChangeDetectionStrategy.Default,\ntemplate: `\n<label>Default tags</label>\n---html,true\n",
"new_path": "demo/app/examples/tags.component.ts",
"old_path": "demo/app/examples/tags.component.ts"
},
{
"change_type": "MODIFY",
"diff": "import { Component } from '@angular/core';\n+import { appRoutes } from '../app.module';\n@Component({\nselector: 'layout-sidenav',\ntemplate: `\n<ul class=\"nav nav-pills flex-column\">\n- <li class=\"nav-item\" routerLinkActive=\"active\">\n- <a class=\"nav-link\" routerLink=\"/data-sources\" routerLinkActive=\"active\">Data sources</a>\n- </li>\n- <li class=\"nav-item\" routerLinkActive=\"active\">\n- <a class=\"nav-link\" routerLink=\"/forms\" routerLinkActive=\"active\">Reactive forms</a>\n- </li>\n- <li class=\"nav-item\" routerLinkActive=\"active\">\n- <a class=\"nav-link\" routerLink=\"/virtual-scroll\" routerLinkActive=\"active\">Virtual scroll</a>\n- </li>\n- <li class=\"nav-item\" routerLinkActive=\"active\">\n- <a class=\"nav-link\" routerLink=\"/filter\" routerLinkActive=\"active\">Filter and autocomplete</a>\n- </li>\n- <li class=\"nav-item\" routerLinkActive=\"active\">\n- <a class=\"nav-link\" routerLink=\"/tags\" routerLinkActive=\"active\">Tags</a>\n- </li>\n- <li class=\"nav-item\" routerLinkActive=\"active\">\n- <a class=\"nav-link\" routerLink=\"/multiselect\" routerLinkActive=\"active\">Multiselect</a>\n- </li>\n- <li class=\"nav-item\" routerLinkActive=\"active\">\n- <a class=\"nav-link\" routerLink=\"/bindings\" routerLinkActive=\"active\">Data bindings</a>\n- </li>\n- <li class=\"nav-item\" routerLinkActive=\"active\">\n- <a class=\"nav-link\" routerLink=\"/templates\" routerLinkActive=\"active\">Templates</a>\n- </li>\n- <li class=\"nav-item\" routerLinkActive=\"active\">\n- <a class=\"nav-link\" routerLink=\"/events\" routerLinkActive=\"active\">Output events</a>\n- </li>\n- <li class=\"nav-item\" routerLinkActive=\"active\">\n- <a class=\"nav-link\" routerLink=\"/dropdown-position\" routerLinkActive=\"active\">Dropdown position</a>\n- </li>\n- <li class=\"nav-item\" routerLinkActive=\"active\">\n- <a class=\"nav-link\" routerLink=\"/append-to-element\" routerLinkActive=\"active\">Append to element</a>\n+ <li class=\"nav-item\" routerLinkActive=\"active\" *ngFor=\"let route of routes\">\n+ <a class=\"nav-link\" routerLink=\"{{route.url}}\" routerLinkActive=\"active\">{{route.title}}</a>\n</li>\n</ul>\n`\n})\nexport class LayoutSidenavComponent {\n+ routes = [];\n+\n+ constructor() {\n+ this.routes = appRoutes.filter(route => route.component)\n+ .map(route => ({\n+ title: route.data.title,\n+ url: `/${route.path}`\n+ }));\n+ }\n}\n",
"new_path": "demo/app/layout/sidenav-component.ts",
"old_path": "demo/app/layout/sidenav-component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -6,6 +6,7 @@ export class ItemsList {\nprivate _items: NgOption[] = [];\nprivate _filteredItems: NgOption[] = [];\n+ private _groups: { [index: string]: NgOption[] };\nprivate _markedIndex = -1;\nprivate _selected: NgOption[] = [];\n@@ -33,6 +34,12 @@ export class ItemsList {\nsetItems(items: any[], simple = false) {\nthis._items = items.map((item, index) => this.mapItem(item, simple, index));\n+ if (this._ngSelect.groupBy) {\n+ this._groups = this._groupBy(this._items, this._ngSelect.groupBy);\n+ this._items = this._flatten(this._groups);\n+ } else {\n+ this._groups = { undefined: this._items };\n+ }\nthis._filteredItems = [...this._items];\n}\n@@ -53,11 +60,11 @@ export class ItemsList {\nfindItem(value: any): NgOption {\nif (this._ngSelect.bindValue) {\n- return this._items.find(item => this.resolveNested(item.value, this._ngSelect.bindValue) === value);\n+ return this._items.find(item => !item.hasChildren && this.resolveNested(item.value, this._ngSelect.bindValue) === value);\n}\nconst index = this._items.findIndex(x => x.value === value);\nreturn index > -1 ? this._items[index] :\n- this._items.find(item => item.label && item.label === this.resolveNested(value, this._ngSelect.bindLabel));\n+ this._items.find(item => !item.hasChildren && item.label && item.label === this.resolveNested(value, this._ngSelect.bindLabel));\n}\nunselect(item: NgOption) {\n@@ -94,8 +101,31 @@ export class ItemsList {\n}\nfilter(term: string) {\n- const filterFuncVal = this._getDefaultFilterFunc(term);\n- this._filteredItems = term ? this._items.filter(val => filterFuncVal(val)) : this._items;\n+ if (!term) {\n+ this._filteredItems = this._items;\n+ return;\n+ }\n+\n+ this._filteredItems = [];\n+ term = searchHelper.stripSpecialChars(term).toLocaleLowerCase();\n+\n+ for (const key of Object.keys(this._groups)) {\n+ const matchedItems = [];\n+ for (const item of this._groups[key]) {\n+ const label = searchHelper.stripSpecialChars(item.label).toLocaleLowerCase();\n+ if (label.indexOf(term) > -1) {\n+ matchedItems.push(item);\n+ }\n+ }\n+ if (matchedItems.length > 0) {\n+ const [last] = matchedItems.slice(-1);\n+ if (last.parent) {\n+ const head = this._items.find(x => x === last.parent);\n+ this._filteredItems.push(head);\n+ }\n+ this._filteredItems.push(...matchedItems);\n+ }\n+ }\n}\nclearFilter() {\n@@ -157,7 +187,7 @@ export class ItemsList {\n}\nreturn {\nindex: index,\n- label: label,\n+ label: label || '',\nvalue: option,\ndisabled: option.disabled,\n};\n@@ -181,15 +211,42 @@ export class ItemsList {\n}\n}\n- private _getDefaultFilterFunc(term: string) {\n- return (option: NgOption) => {\n- return searchHelper.stripSpecialChars(option.label ? option.label.toString() : '')\n- .toLowerCase()\n- .indexOf(searchHelper.stripSpecialChars(term).toLowerCase()) > -1;\n- };\n- }\n-\nprivate get _lastSelectedItem() {\nreturn this._selected[this._selected.length - 1];\n}\n+\n+ private _groupBy(items: NgOption[], prop: string): { [index: string]: NgOption[] } {\n+ const groups = items.reduce((grouped, item) => {\n+ const key = item.value[prop];\n+ grouped[key] = grouped[key] || [];\n+ grouped[key].push(item);\n+ return grouped;\n+ }, {});\n+ return groups;\n+ }\n+\n+ private _flatten(groups: { [index: string]: NgOption[] }) {\n+ let i = 0;\n+ return Object.keys(groups).reduce((items: NgOption[], key: string) => {\n+ const parent: NgOption = {\n+ label: key,\n+ hasChildren: true,\n+ index: i,\n+ disabled: true\n+ };\n+ parent.value = {};\n+ parent.value[this._ngSelect.groupBy] = key;\n+ items.push(parent);\n+ i++\n+\n+ const children = groups[key].map(x => {\n+ x.parent = parent;\n+ x.hasChildren = false;\n+ i++;\n+ return x;\n+ });\n+ items.push(...children)\n+ return items;\n+ }, []);\n+ }\n}\n",
"new_path": "src/ng-select/items-list.ts",
"old_path": "src/ng-select/items-list.ts"
},
{
"change_type": "MODIFY",
"diff": "+@mixin wrapt-text() {\n+ white-space: nowrap;\n+ overflow: hidden;\n+ text-overflow: ellipsis;\n+}\n+\n.ng-dropdown-panel {\nbox-sizing: border-box;\nposition: absolute;\nbox-sizing: border-box;\nmax-height: 240px;\noverflow-y: auto;\n+\n+ .ng-optgroup {\n+ @include wrapt-text();\n+ }\n+\n.ng-option {\nbox-sizing: border-box;\ncursor: pointer;\ndisplay: block;\n+ @include wrapt-text();\n+\n.highlighted {\nfont-weight: bold;\ntext-decoration: underline;\n",
"new_path": "src/ng-select/ng-dropdown-panel.component.scss",
"old_path": "src/ng-select/ng-dropdown-panel.component.scss"
},
{
"change_type": "MODIFY",
"diff": "autocomplete=\"off\"\n[readOnly]=\"!searchable\"\n[value]=\"filterValue\"\n- (input)=\"onFilter(filterInput.value)\"\n+ (input)=\"filter(filterInput.value)\"\n(focus)=\"onInputFocus()\"\n(blur)=\"onInputBlur()\"\n(change)=\"$event.stopPropagation()\"\n*ngFor=\"let item of viewPortItems\"\n[class.disabled]=\"item.disabled\"\n[class.selected]=\"item.selected\"\n+ [class.ng-optgroup]=\"item.hasChildren\"\n+ [class.ng-option]=\"!item.hasChildren\"\n+ [class.ng-option-child]=\"!!item.parent\"\n[class.marked]=\"item === itemsList.markedItem\">\n<ng-template #defaultOptionTemplate>\n<span class=\"ng-option-label\" [innerHTML]=\"item.label\" [ngOptionHighlight]=\"filterValue\"></span>\n</ng-template>\n+ <ng-template #defaultOptGroupTemplate>\n+ <span class=\"ng-option-label\" [innerHTML]=\"item.label\" [ngOptionHighlight]=\"filterValue\"></span>\n+ </ng-template>\n+\n<ng-template\n- [ngTemplateOutlet]=\"optionTemplate || defaultOptionTemplate\"\n+ [ngTemplateOutlet]=\"item.hasChildren ? (optgroupTemplate || defaultOptGroupTemplate) : (optionTemplate || defaultOptionTemplate)\"\n[ngTemplateOutletContext]=\"{ item: item.value, index: item.index, searchTerm: filterValue }\">\n</ng-template>\n</div>\n",
"new_path": "src/ng-select/ng-select.component.html",
"old_path": "src/ng-select/ng-select.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -31,7 +31,8 @@ import {\nNgOptionTemplateDirective,\nNgLabelTemplateDirective,\nNgHeaderTemplateDirective,\n- NgFooterTemplateDirective\n+ NgFooterTemplateDirective,\n+ NgOptgroupTemplateDirective\n} from './ng-templates.directive';\nimport { NgOption, KeyCode, NgSelectConfig } from './ng-select.types';\n@@ -80,6 +81,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n@Input() loading = false;\n@Input() closeOnSelect = true;\n@Input() maxSelectedItems: number;\n+ @Input() groupBy: string;\n@Input() bufferAmount = 4;\n@Input() virtualScroll = false;\n@Input() @HostBinding('class.typeahead') typeahead: Subject<string>;\n@@ -101,6 +103,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n// custom templates\n@ContentChild(NgOptionTemplateDirective, { read: TemplateRef }) optionTemplate: TemplateRef<any>;\n+ @ContentChild(NgOptgroupTemplateDirective, { read: TemplateRef }) optgroupTemplate: TemplateRef<any>;\n@ContentChild(NgLabelTemplateDirective, { read: TemplateRef }) labelTemplate: TemplateRef<any>;\n@ContentChild(NgHeaderTemplateDirective, { read: TemplateRef }) headerTemplate: TemplateRef<any>;\n@ContentChild(NgFooterTemplateDirective, { read: TemplateRef }) footerTemplate: TemplateRef<any>;\n@@ -361,7 +364,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nreturn empty && this._isTypeahead && !this.filterValue && !this.isLoading;\n}\n- onFilter(term: string) {\n+ filter(term: string) {\nif (!this.searchable) {\nreturn;\n}\n",
"new_path": "src/ng-select/ng-select.component.ts",
"old_path": "src/ng-select/ng-select.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,7 +5,8 @@ import {\nNgOptionTemplateDirective,\nNgLabelTemplateDirective,\nNgHeaderTemplateDirective,\n- NgFooterTemplateDirective\n+ NgFooterTemplateDirective,\n+ NgOptgroupTemplateDirective\n} from './ng-templates.directive';\nimport { NgOptionComponent } from './ng-option.component';\nimport { NgOptionHighlightDirective } from './ng-option-highlight.directive' ;\n@@ -19,6 +20,7 @@ import { VirtualScrollService } from './virtual-scroll.service';\nNgOptionComponent,\nNgSelectComponent,\nNgOptionHighlightDirective,\n+ NgOptgroupTemplateDirective,\nNgOptionTemplateDirective,\nNgLabelTemplateDirective,\nNgHeaderTemplateDirective,\n@@ -31,6 +33,7 @@ import { VirtualScrollService } from './virtual-scroll.service';\nNgSelectComponent,\nNgOptionComponent,\nNgOptionHighlightDirective,\n+ NgOptgroupTemplateDirective,\nNgOptionTemplateDirective,\nNgLabelTemplateDirective,\nNgHeaderTemplateDirective,\n",
"new_path": "src/ng-select/ng-select.module.ts",
"old_path": "src/ng-select/ng-select.module.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -6,6 +6,8 @@ export interface NgOption {\nmarked?: boolean;\nlabel?: string;\nvalue?: string | Object;\n+ parent?: NgOption;\n+ hasChildren?: boolean;\n}\nexport enum KeyCode {\n",
"new_path": "src/ng-select/ng-select.types.ts",
"old_path": "src/ng-select/ng-select.types.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -6,6 +6,12 @@ export class NgOptionTemplateDirective {\n}\n}\n+@Directive({ selector: '[ng-optgroup-tmp]' })\n+export class NgOptgroupTemplateDirective {\n+ constructor(public template: TemplateRef<any>) {\n+ }\n+}\n+\n@Directive({ selector: '[ng-label-tmp]' })\nexport class NgLabelTemplateDirective {\nconstructor(public template: TemplateRef<any>) {\n",
"new_path": "src/ng-select/ng-templates.directive.ts",
"old_path": "src/ng-select/ng-templates.directive.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -193,10 +193,19 @@ $color-selected: #f5faff;\n}\n.ng-dropdown-panel-items {\nmargin-bottom: 1px;\n+\n+ .ng-optgroup {\n+ user-select: none;\n+ cursor: default;\n+ padding: 8px 10px;\n+ color: rgba(0,0,0,.54);\n+ }\n+\n.ng-option {\nbackground-color: #fff;\n- color: #666666;\n+ color: rgba(0,0,0,.87);\npadding: 8px 10px;\n+\n&.selected {\nbackground-color: $color-selected;\n.ng-option-label {\n@@ -213,6 +222,10 @@ $color-selected: #f5faff;\n&.disabled {\ncolor: #cccccc;\n}\n+ &.ng-option-child {\n+ padding-left: 22px;\n+ }\n+\n.ng-tag-label {\npadding-right: 5px;\nfont-size: 80%;\n",
"new_path": "src/themes/default.theme.scss",
"old_path": "src/themes/default.theme.scss"
},
{
"change_type": "MODIFY",
"diff": "@@ -186,6 +186,17 @@ $highlight-color: #3f51b5;\n}\n}\n}\n+\n+ .ng-dropdown-panel-items {\n+ .ng-optgroup {\n+ user-select: none;\n+ cursor: default;\n+ color: rgba(0,0,0,.54);\n+ line-height: 3em;\n+ height: 3em;\n+ padding: 0 16px;\n+ }\n+\n.ng-option {\nline-height: 3em;\nheight: 3em;\n@@ -196,6 +207,8 @@ $highlight-color: #3f51b5;\ntext-align: left;\ntext-decoration: none;\nposition: relative;\n+ color: rgba(0,0,0,.87);\n+\n&.marked {\nbackground: rgba(0, 0, 0, .04);\ncolor: rgba(0, 0, 0, .87);\n@@ -207,6 +220,10 @@ $highlight-color: #3f51b5;\n&.disabled {\ncolor: rgba(0, 0, 0, 0.38);\n}\n+ &.ng-option-child {\n+ padding-left: 32px;\n+ }\n+\n.ng-tag-label {\npadding-right: 5px;\nfont-size: 80%;\n@@ -215,3 +232,5 @@ $highlight-color: #3f51b5;\n}\n}\n}\n+\n+}\n",
"new_path": "src/themes/material.theme.scss",
"old_path": "src/themes/material.theme.scss"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
feat: group by (#317)
closes #263
| 1
|
feat
| null |
791,901
|
05.03.2018 09:24:13
| -3,600
|
bfb9bb513f25a12cf67303c9a193e78dda2030fd
|
docs(contributing): fix link for closure annotations
[skip ci]
|
[
{
"change_type": "MODIFY",
"diff": "@@ -4,7 +4,7 @@ We'd love your help! This doc covers how to become a contributor and submit code\n## Follow the coding style\n-The `.eslintrc` file defines all. We use [JSDoc](http://usejsdoc.org/) along with [closure annotations](https://developers.google.com/closure/compiler/docs/js-for-compiler). Annotations are encouraged for all contributions.\n+The `.eslintrc` file defines all. We use [JSDoc](http://usejsdoc.org/) along with [closure annotations](https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler). Annotations are encouraged for all contributions.\n## Pull request titles\n",
"new_path": "CONTRIBUTING.md",
"old_path": "CONTRIBUTING.md"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
docs(contributing): fix link for closure annotations (#4680)
[skip ci]
| 1
|
docs
|
contributing
|
679,913
|
05.03.2018 14:25:23
| 0
|
105bbf4e0c1babe01a5838ba5f930f20e0812aea
|
perf(hiccup-css): no empty Set() creation, change type check order in css()
|
[
{
"change_type": "MODIFY",
"diff": "@@ -14,6 +14,8 @@ import { indent } from \"./utils\";\nconst NO_SPACES = \":[\";\n+const EMPTY = new Set<string>();\n+\nconst xfSel = ((a, b) => (x) => a(b(x)))(\nflatten(),\nmap((x: string) => NO_SPACES.indexOf(x.charAt(0)) >= 0 ? x : \" \" + x)\n@@ -22,12 +24,14 @@ const xfSel = ((a, b) => (x) => a(b(x)))(\nexport function css(rules: any, opts?: Partial<CSSOpts>) {\nopts = {\nformat: COMPACT,\n- autoprefix: new Set(),\nvendors: DEFAULT_VENDORS,\nfns: {},\ndepth: 0,\n...opts\n};\n+ if (isPlainObject(rules)) {\n+ return formatDecls(rules, <CSSOpts>opts);\n+ }\nif (isArray(opts.autoprefix)) {\nopts.autoprefix = new Set(opts.autoprefix);\n}\n@@ -40,9 +44,6 @@ export function css(rules: any, opts?: Partial<CSSOpts>) {\nif (isFunction(rules)) {\nreturn rules([], opts).join(opts.format.rules);\n}\n- if (isPlainObject(rules)) {\n- return formatDecls(rules, <CSSOpts>opts);\n- }\n}\nexport function _css(acc: string[], parent: any[], rules: any[], opts: CSSOpts) {\n@@ -87,7 +88,7 @@ export function _css(acc: string[], parent: any[], rules: any[], opts: CSSOpts)\nexport function formatDecls(rules: any, opts: CSSOpts) {\nconst f = opts.format;\n- const prefixes = <Set<string>>opts.autoprefix;\n+ const prefixes = <Set<string>>(opts.autoprefix || EMPTY);\nconst space = indent(opts, opts.depth + 1);\nconst acc = [];\nfor (let r in rules) {\n@@ -129,4 +130,3 @@ function formatRule(parent: any[], sel: any[], curr: any, opts: CSSOpts) {\nf.declEnd\n].join(\"\");\n}\n-\n",
"new_path": "packages/hiccup-css/src/css.ts",
"old_path": "packages/hiccup-css/src/css.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
perf(hiccup-css): no empty Set() creation, change type check order in css()
| 1
|
perf
|
hiccup-css
|
679,913
|
05.03.2018 14:25:57
| 0
|
2e3942ac605613c9450ca02947646ecc187c8d7b
|
docs(hiccup-css): add doc strings, update readme
|
[
{
"change_type": "MODIFY",
"diff": "@@ -32,6 +32,12 @@ functions, iterators.\n- Unit formatting wrappers (no conversions yet)\n- Customizable formatting (2 defaults for compact & pretty printing)\n+## Use cases\n+\n+- Same as LESS / SASS etc., but enables full use of ES6 to define style rules\n+- CSS framework & theme generators\n+- Dynamic CSS generation for components\n+\nThe overall approach of using S-expressions was inspired by these Clojure projects:\n- [hiccup](https://github.com/weavejester/hiccup)\n@@ -43,12 +49,25 @@ The overall approach of using S-expressions was inspired by these Clojure projec\nyarn add @thi.ng/hiccup-css\n```\n-## Usage examples\n+## API & usage examples\n```typescript\nimport * as css from \"@thi.ng/hiccup-css\";\n```\n+### `css(rules: any, opts?: CSSOpts)`\n+\n+This is the main function exposed by this module. It accepts a JS data\n+structure (array, object, iterator or function) and returns a CSS string. The\n+optional `opts` arg is used to control formatting, auto-prefixing and other\n+conversion options. See\n+[api.ts](https://github.com/thi-ng/umbrella/tree/master/packages/hiccup-css/src/api.ts)\n+for reference.\n+\n+By default the generated CSS uses the `css.COMPACT` format, causing \"minimized\"\n+outputs. Pretty printing is supported via the `css.PRETTY` format preset, see\n+examples further below.\n+\n### Property formatting only\nThis feature is only intended for setting an element's `.style` attrib:\n@@ -367,10 +386,10 @@ Also see the section on [Quoted functions](#quoted-functions) below...\n#### Functions in scope head position\nIf a function is given as arg to `css()` or is in the head position (first\n-element) of a rule scope, the function is considered a higher-order function\n-and the returned function is called with an empty result accumulator array and the\n-`CSSOpts` object passed to `css()`. This form is mainly used by the various\n-`at_*()` functions provided (e.g. `at_media()` example above).\n+element) of a rule scope, the function is expected to produce output directly\n+and is called with an empty result accumulator array and the `CSSOpts` object\n+passed to `css()`. This form is mainly used by the various `at_*()` functions\n+provided (e.g. `at_media()` example above).\n```typescript\ncss.css(at_import(\"foo.css\", \"screen\"));\n@@ -380,25 +399,14 @@ css.css(at_import(\"foo.css\", \"screen\"));\nThe following example illustrates the head position placement, using the\n`comment()` function to emit CSS comments.\n-**IMPORTANT:** any other items given in the same scope *after* the function\n-will be ignored.\n-\n```typescript\ncss.css([\n// comments are usually omitted with the default format (css.COMPACT)\n// pass `true` as 2nd arg to force inclusion\n- [css.comment(\"generated, please don't edit\", true)],\n- // the following `div` rule is in its own scope, so okay\n+ css.comment(\"generated, please don't edit\", true),\n[\"div\", { margin: 0 }]\n]);\n// \"/*generated, don't edit*/div{margin:0;}\"\n-\n-css.css([\n- css.comment(\"generated, please don't edit\", true),\n- // here the `div` rule is part of the same scope and will be omitted\n- [\"div\", { margin: 0 }]\n-])\n-// \"/* generated, don't edit */\"\n```\n#### Functions in other positions\n@@ -421,6 +429,8 @@ The quoted function name is looked up in a dictionary and if found, called with\nall remaining elements in the same array. I.e. `[\"@import\", \"foo.css\"]` will be\nthe same result as `at_import(\"foo.css\")`.\n+**IMPORTANT:** Quoted functions are only supported in the head position of a scope.\n+\n```typescript\nconst styles = [\n[\"@comment\", \" CSS from JSON\"],\n",
"new_path": "packages/hiccup-css/README.md",
"old_path": "packages/hiccup-css/README.md"
},
{
"change_type": "MODIFY",
"diff": "import { IObjectOf } from \"@thi.ng/api/api\";\n+/**\n+ * Function type used by `at_xxx()` functions or any\n+ * other function in the head position of a rule scope array.\n+ *\n+ * These fns have special behavior and are resonsible to\n+ * append their results to the CSS output string accumulator\n+ * directly.\n+ */\nexport type RuleFn = (acc: string[], opts: CSSOpts) => string[];\n+/**\n+ * Configuration type for conditional rule functions\n+ * (i.e. `at_media()`, `at_supports()`)\n+ */\nexport type Conditional = string | IObjectOf<boolean | number | string>;\n+/**\n+ * Format\n+*/\nexport interface Format {\nrules: string;\nruleSep: string;\n@@ -15,11 +30,37 @@ export interface Format {\ncomments: boolean;\n}\n+/**\n+ * Config options supported by `css()` and its helper functions.\n+ */\nexport interface CSSOpts {\n+ /**\n+ * CSS output format config.\n+ * Two presets are included: COMPACT (default), PRETTY\n+ */\nformat: Format;\n- fns: any;\n+ /**\n+ * Dictionary object for JSON->CSS conversion\n+ * Maps keys to rule functions.\n+ * See quoted-functions.ts\n+ */\n+ fns: IObjectOf<RuleFn>;\n+ /**\n+ * Array or set of properties to prefix automatically.\n+ * If given, each listed property will be prefixed\n+ * with values given under `vendors`.\n+ *\n+ * By default, no properties are prefixed.\n+ */\nautoprefix: string[] | Set<string>;\n+ /**\n+ * Prefix strings for props under `autoprefix`\n+ * Defaults to `DEFAULT_VENDORS` object.\n+ */\nvendors: string[];\n+ /**\n+ * Current tree depth. Internal use only. Ignore.\n+ */\ndepth: number;\n}\n@@ -30,6 +71,11 @@ export const DEFAULT_VENDORS = [\n\"-webkit-\"\n];\n+/**\n+ * Default format config used by `css()` function.\n+ * Forms \"minimized\" CSS without obsolete white space\n+ * and omits comments unless they were forced.\n+ */\nexport const COMPACT: Format = {\nrules: \"\",\nruleSep: \",\",\n@@ -41,6 +87,10 @@ export const COMPACT: Format = {\ncomments: false,\n};\n+/**\n+ * Pretty printing format config with line breaks\n+ * and indentation.\n+ */\nexport const PRETTY: Format = {\nrules: \"\\n\",\nruleSep: \", \",\n",
"new_path": "packages/hiccup-css/src/api.ts",
"old_path": "packages/hiccup-css/src/api.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs(hiccup-css): add doc strings, update readme
| 1
|
docs
|
hiccup-css
|
679,913
|
05.03.2018 14:52:25
| 0
|
34d699fc3c1d32291483f21b9f1168734476e156
|
chore: update issue tpl instructions
|
[
{
"change_type": "MODIFY",
"diff": "<!--\n-1. Please use labels to tag your issue (especially \"package:*\")\n+1. Please use this format for the issue subject: `[package-name] issue title`\n2. If possible (or relevant), please include a minimum reproducable code example.\n-->\n",
"new_path": ".github/issue_template.md",
"old_path": ".github/issue_template.md"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
chore: update issue tpl instructions
| 1
|
chore
| null |
679,913
|
05.03.2018 17:44:23
| 0
|
721583a72489964b6173fe69f8c8a868d642ecb6
|
refactor(hiccup-css): internal restructure
migrate internal implementation fns to src/impl.ts
remove utils.ts
|
[
{
"change_type": "MODIFY",
"diff": "import { RuleFn } from \"./api\";\n-import { indent } from \"./utils\";\n+import { indent } from \"./impl\";\nexport function comment(body: string, force = false): RuleFn {\nreturn (acc, opts) => {\n",
"new_path": "packages/hiccup-css/src/comment.ts",
"old_path": "packages/hiccup-css/src/comment.ts"
},
{
"change_type": "MODIFY",
"diff": "import { isString } from \"@thi.ng/checks/is-string\";\nimport { Conditional, CSSOpts, RuleFn } from \"./api\";\n-import { _css } from \"./css\";\n-import { indent } from \"./utils\";\n+import { expand, indent } from \"./impl\";\nexport function conditional(type: string, cond: Conditional, rules: any[]): RuleFn {\nreturn (acc: string[], opts: CSSOpts) => {\nconst space = indent(opts);\nacc.push(`${space}${type} ${formatCond(cond)}${opts.format.declStart}`);\nopts.depth++;\n- _css(acc, [], rules, opts);\n+ expand(acc, [], rules, opts);\nopts.depth--;\nacc.push(space + opts.format.declEnd);\nreturn acc;\n",
"new_path": "packages/hiccup-css/src/conditional.ts",
"old_path": "packages/hiccup-css/src/conditional.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -3,23 +3,9 @@ import { isFunction } from \"@thi.ng/checks/is-function\";\nimport { isIterable } from \"@thi.ng/checks/is-iterable\";\nimport { isPlainObject } from \"@thi.ng/checks/is-plain-object\";\nimport { isString } from \"@thi.ng/checks/is-string\";\n-import { transduce } from \"@thi.ng/transducers/transduce\";\n-import { permutations } from \"@thi.ng/transducers/iter/permutations\";\n-import { str } from \"@thi.ng/transducers/rfn/str\";\n-import { flatten } from \"@thi.ng/transducers/xform/flatten\";\n-import { map } from \"@thi.ng/transducers/xform/map\";\nimport { CSSOpts, COMPACT, DEFAULT_VENDORS } from \"./api\";\n-import { indent } from \"./utils\";\n-\n-const NO_SPACES = \":[\";\n-\n-const EMPTY = new Set<string>();\n-\n-const xfSel = ((a, b) => (x) => a(b(x)))(\n- flatten(),\n- map((x: string) => NO_SPACES.indexOf(x.charAt(0)) >= 0 ? x : \" \" + x)\n-);\n+import { expand, formatDecls } from \"./impl\";\nexport function css(rules: any, opts?: Partial<CSSOpts>) {\nopts = {\n@@ -39,94 +25,9 @@ export function css(rules: any, opts?: Partial<CSSOpts>) {\nrules = [...rules];\n}\nif (isArray(rules)) {\n- return _css([], [], rules, <CSSOpts>opts).join(opts.format.rules);\n+ return expand([], [], rules, <CSSOpts>opts).join(opts.format.rules);\n}\nif (isFunction(rules)) {\nreturn rules([], opts).join(opts.format.rules);\n}\n}\n-\n-export function _css(acc: string[], parent: any[], rules: any[], opts: CSSOpts) {\n- const n = rules.length;\n- const sel: string[] = [];\n- let curr: any, isFn;\n-\n- function process(i, r) {\n- if (isArray(r)) {\n- _css(acc, makeSelector(parent, sel), r, opts);\n- } else if (isIterable(r) && !isString(r)) {\n- _css(acc, makeSelector(parent, sel), [...r], opts);\n- } else if ((isFn = isFunction(r)) || opts.fns[r]) {\n- if (i === 0) {\n- if (opts.fns[r]) {\n- opts.fns[r].apply(null, rules.slice(i + 1))(acc, opts);\n- return true;\n- }\n- r(acc, opts);\n- } else if (isFn) {\n- process(i, r());\n- } else {\n- throw new Error(`quoted fn ('${r}') only allowed at head position`);\n- }\n- } else if (isPlainObject(r)) {\n- curr = Object.assign(curr || {}, r);\n- } else if (r != null) {\n- sel.push(r);\n- }\n- }\n-\n- for (let i = 0; i < n; i++) {\n- if (process(i, rules[i])) {\n- return acc;\n- }\n- }\n- if (curr) {\n- acc.push(formatRule(parent, sel, curr, opts));\n- }\n- return acc;\n-}\n-\n-export function formatDecls(rules: any, opts: CSSOpts) {\n- const f = opts.format;\n- const prefixes = <Set<string>>(opts.autoprefix || EMPTY);\n- const space = indent(opts, opts.depth + 1);\n- const acc = [];\n- for (let r in rules) {\n- if (rules.hasOwnProperty(r)) {\n- let val = rules[r];\n- if (isFunction(val)) {\n- val = val(rules);\n- }\n- if (isArray(val)) {\n- val = val.map((v) => isArray(v) ? v.join(\" \") : v).join(f.ruleSep);\n- }\n- if (prefixes.has(r)) {\n- for (let v of opts.vendors) {\n- acc.push(`${space}${v}${r}:${f.valSep}${val};`);\n- }\n- }\n- acc.push(`${space}${r}:${f.valSep}${val};`);\n- }\n- }\n- return acc.join(f.decls) + f.decls;\n-}\n-\n-function makeSelector(parent: any[], curr: any[]) {\n- return parent.length ? [...permutations(parent, curr)] : curr;\n-}\n-\n-function formatRule(parent: any[], sel: any[], curr: any, opts: CSSOpts) {\n- const f = opts.format;\n- const space = indent(opts);\n- return [\n- space,\n- transduce(\n- map((sel: any[]) => transduce(xfSel, str(), isArray(sel) ? sel : [sel]).trim()),\n- str(f.ruleSep),\n- makeSelector(parent, sel)),\n- f.declStart,\n- formatDecls(curr, opts),\n- space,\n- f.declEnd\n- ].join(\"\");\n-}\n",
"new_path": "packages/hiccup-css/src/css.ts",
"old_path": "packages/hiccup-css/src/css.ts"
},
{
"change_type": "ADD",
"diff": "+import { isArray } from \"@thi.ng/checks/is-array\";\n+import { isFunction } from \"@thi.ng/checks/is-function\";\n+import { isIterable } from \"@thi.ng/checks/is-iterable\";\n+import { isPlainObject } from \"@thi.ng/checks/is-plain-object\";\n+import { isString } from \"@thi.ng/checks/is-string\";\n+import { transduce } from \"@thi.ng/transducers/transduce\";\n+import { permutations } from \"@thi.ng/transducers/iter/permutations\";\n+import { repeat } from \"@thi.ng/transducers/iter/repeat\";\n+import { str } from \"@thi.ng/transducers/rfn/str\";\n+import { flatten } from \"@thi.ng/transducers/xform/flatten\";\n+import { map } from \"@thi.ng/transducers/xform/map\";\n+\n+import { CSSOpts } from \"./api\";\n+\n+const EMPTY = new Set<string>();\n+\n+const NO_SPACES = \":[\";\n+\n+// like tx.comp(), but avoiding import to save space\n+const xfSel = ((a, b) => (x) => a(b(x)))(\n+ flatten(),\n+ map((x: string) => NO_SPACES.indexOf(x.charAt(0)) >= 0 ? x : \" \" + x)\n+);\n+\n+export function expand(acc: string[], parent: any[], rules: any[], opts: CSSOpts) {\n+ const n = rules.length;\n+ const sel: string[] = [];\n+ let curr: any, isFn;\n+\n+ function process(i, r) {\n+ if (isArray(r)) {\n+ expand(acc, makeSelector(parent, sel), r, opts);\n+ } else if (isIterable(r) && !isString(r)) {\n+ expand(acc, makeSelector(parent, sel), [...r], opts);\n+ } else if ((isFn = isFunction(r)) || opts.fns[r]) {\n+ if (i === 0) {\n+ if (opts.fns[r]) {\n+ opts.fns[r].apply(null, rules.slice(i + 1))(acc, opts);\n+ return true;\n+ }\n+ r(acc, opts);\n+ } else if (isFn) {\n+ process(i, r());\n+ } else {\n+ throw new Error(`quoted fn ('${r}') only allowed at head position`);\n+ }\n+ } else if (isPlainObject(r)) {\n+ curr = Object.assign(curr || {}, r);\n+ } else if (r != null) {\n+ sel.push(r);\n+ }\n+ }\n+\n+ for (let i = 0; i < n; i++) {\n+ if (process(i, rules[i])) {\n+ return acc;\n+ }\n+ }\n+ if (curr) {\n+ acc.push(formatRule(parent, sel, curr, opts));\n+ }\n+ return acc;\n+}\n+\n+function makeSelector(parent: any[], curr: any[]) {\n+ return parent.length ? [...permutations(parent, curr)] : curr;\n+}\n+\n+function formatRule(parent: any[], sel: any[], curr: any, opts: CSSOpts) {\n+ const f = opts.format;\n+ const space = indent(opts);\n+ return [\n+ space,\n+ transduce(\n+ map((sel: any[]) => transduce(xfSel, str(), isArray(sel) ? sel : [sel]).trim()),\n+ str(f.ruleSep),\n+ makeSelector(parent, sel)),\n+ f.declStart,\n+ formatDecls(curr, opts),\n+ space,\n+ f.declEnd\n+ ].join(\"\");\n+}\n+\n+export function formatDecls(rules: any, opts: CSSOpts) {\n+ const f = opts.format;\n+ const prefixes = <Set<string>>(opts.autoprefix || EMPTY);\n+ const space = indent(opts, opts.depth + 1);\n+ const acc = [];\n+ for (let r in rules) {\n+ if (rules.hasOwnProperty(r)) {\n+ let val = rules[r];\n+ if (isFunction(val)) {\n+ val = val(rules);\n+ }\n+ if (isArray(val)) {\n+ val = val.map((v) => isArray(v) ? v.join(\" \") : v).join(f.ruleSep);\n+ }\n+ if (prefixes.has(r)) {\n+ for (let v of opts.vendors) {\n+ acc.push(`${space}${v}${r}:${f.valSep}${val};`);\n+ }\n+ }\n+ acc.push(`${space}${r}:${f.valSep}${val};`);\n+ }\n+ }\n+ return acc.join(f.decls) + f.decls;\n+}\n+\n+export function indent(opts: CSSOpts, d = opts.depth) {\n+ return d > 1 ? [...repeat(opts.format.indent, d)].join(\"\") : d > 0 ? opts.format.indent : \"\";\n+}\n\\ No newline at end of file\n",
"new_path": "packages/hiccup-css/src/impl.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "import { CSSOpts, RuleFn } from \"./api\";\n-import { formatDecls } from \"./css\";\n+import { formatDecls, indent } from \"./impl\";\nimport { percent } from \"./units\";\n-import { indent } from \"./utils\";\n/**\n* Rule function for `@keyframes`. If a single declaration object is given,\n",
"new_path": "packages/hiccup-css/src/keyframes.ts",
"old_path": "packages/hiccup-css/src/keyframes.ts"
},
{
"change_type": "DELETE",
"diff": "-import { repeat } from \"@thi.ng/transducers/iter/repeat\";\n-\n-import { CSSOpts } from \"./api\";\n-\n-export function indent(opts: CSSOpts, d = opts.depth) {\n- return d > 1 ? [...repeat(opts.format.indent, d)].join(\"\") : d > 0 ? opts.format.indent : \"\";\n-}\n\\ No newline at end of file\n",
"new_path": null,
"old_path": "packages/hiccup-css/src/utils.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(hiccup-css): internal restructure
- migrate internal implementation fns to src/impl.ts
- remove utils.ts
| 1
|
refactor
|
hiccup-css
|
679,913
|
05.03.2018 17:45:14
| 0
|
22bc29c9fda32814080ae5924b79f0e55dd32f64
|
docs(hiccup-css): add doc strings for attrib fns
|
[
{
"change_type": "MODIFY",
"diff": "const $ = (op) => (id: string, x: string | number, caseSensitve = false) => `[${id}${op}=\"${x}\"${caseSensitve ? \" i\" : \"\"}]`;\n+\n+/**\n+ * Returns attrib selector: `[id]`\n+ *\n+ * @param id\n+ */\nexport const withAttrib = (id: string) => `[${id}]`;\n+\n+/**\n+ * Returns attrib selector `[id=x]`\n+ *\n+ * @param id\n+ * @param x\n+ * @param caseSensitive\n+ */\nexport const attribEq = $(\"\");\n+\n+/**\n+ * Returns attrib selector `[id~=x]`\n+ *\n+ * @param id\n+ * @param x\n+ * @param caseSensitive\n+ */\nexport const attribContains = $(\"~\");\n+\n+/**\n+ * Returns attrib selector `[id^=x]`\n+ *\n+ * @param id\n+ * @param x\n+ * @param caseSensitive\n+ */\nexport const attribPrefix = $(\"^\");\n+\n+/**\n+ * Returns attrib selector `[id$=x]`\n+ *\n+ * @param id\n+ * @param x\n+ * @param caseSensitive\n+ */\nexport const attribSuffix = $(\"$\");\n+\n+/**\n+ * Returns attrib selector `[id*=x]`\n+ * @param id\n+ * @param x\n+ * @param caseSensitive\n+ */\nexport const attribMatches = $(\"*\");\n",
"new_path": "packages/hiccup-css/src/attribs.ts",
"old_path": "packages/hiccup-css/src/attribs.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs(hiccup-css): add doc strings for attrib fns
| 1
|
docs
|
hiccup-css
|
679,913
|
05.03.2018 22:46:25
| 0
|
a7e61a4e47efa12e912abac67f8c9e2ca6740198
|
feat(atom): update IAtom, add resetIn() & swapIn() impls
|
[
{
"change_type": "MODIFY",
"diff": "@@ -21,10 +21,12 @@ export interface IAtom<T> extends\nexport interface IReset<T> {\nreset(val: T): T;\n+ resetIn<V>(path: Path, val: V): T;\n}\nexport interface ISwap<T> {\nswap(fn: SwapFn<T>, ...args: any[]): T;\n+ swapIn<V>(path: Path, fn: SwapFn<V>, ...args: any[]): T;\n}\nexport interface IView<T> extends\n",
"new_path": "packages/atom/src/api.ts",
"old_path": "packages/atom/src/api.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -2,6 +2,7 @@ import { IEquiv, Watch } from \"@thi.ng/api/api\";\nimport { IWatch } from \"@thi.ng/api/mixins/iwatch\";\nimport { IAtom, IView, Path, SwapFn, ViewTransform } from \"./api\";\n+import { setIn, updateIn } from \"./path\";\nimport { View } from \"./view\";\n/**\n@@ -31,6 +32,13 @@ export class Atom<T> implements\nconst old = this.value;\nthis.value = val;\nthis.notifyWatches(old, val);\n+ return val;\n+ }\n+\n+ resetIn<V>(path: Path, val: V) {\n+ const old = this.value;\n+ this.value = setIn(this.value, path, val);\n+ this.notifyWatches(old, this.value);\nreturn this.value;\n}\n@@ -42,6 +50,13 @@ export class Atom<T> implements\nreturn this.value;\n}\n+ swapIn<V>(path: Path, fn: SwapFn<V>, ...args: any[]) {\n+ const old = this.value;\n+ this.value = updateIn(this.value, path, fn, ...args);\n+ this.notifyWatches(old, this.value);\n+ return this.value;\n+ }\n+\n// mixin stub\n/* istanbul ignore next */\naddWatch(id: string, fn: Watch<T>) {\n",
"new_path": "packages/atom/src/atom.ts",
"old_path": "packages/atom/src/atom.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -75,8 +75,16 @@ export class Cursor<T> implements\nreturn this.local.reset(val);\n}\n+ resetIn<V>(path: Path, val: V) {\n+ return this.local.resetIn(path, val);\n+ }\n+\nswap(fn: SwapFn<T>, ...args: any[]): T {\n- return this.local.swap.apply(this.local, [fn, ...args]);\n+ return this.local.swap(fn, ...args);\n+ }\n+\n+ swapIn<V>(path: Path, fn: SwapFn<V>, ...args: any[]) {\n+ return this.local.swapIn(path, fn, ...args);\n}\naddWatch(id: string, fn: Watch<T>) {\n",
"new_path": "packages/atom/src/cursor.ts",
"old_path": "packages/atom/src/cursor.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -2,6 +2,7 @@ import { Predicate2, Watch } from \"@thi.ng/api/api\";\nimport { equiv } from \"@thi.ng/api/equiv\";\nimport { IAtom, SwapFn, IView, Path, ViewTransform } from \"./api\";\n+import { getIn, setIn, updateIn } from \"./path\";\nimport { View } from \"./view\";\n/**\n@@ -91,6 +92,15 @@ export class History<T> implements\nreturn val;\n}\n+ resetIn<V>(path: Path, val: V): T {\n+ const prev = this.state.deref();\n+ const prevV = getIn(prev, path);\n+ const curr = setIn(prev, path, val);\n+ this.changed(prevV, getIn(curr, path)) && this.record(prev);\n+ this.state.reset(curr);\n+ return curr;\n+ }\n+\n/**\n* `IAtom.swap()` implementation. Delegates to wrapped atom/cursor,\n* but too applies `changed` predicate to determine if there was a\n@@ -99,7 +109,11 @@ export class History<T> implements\n* @param val\n*/\nswap(fn: SwapFn<T>, ...args: any[]): T {\n- return this.reset(fn.apply(null, [this.state.deref(), ...args]));\n+ return this.reset(fn(this.state.deref(), ...args));\n+ }\n+\n+ swapIn<V>(path: Path, fn: SwapFn<V>, ...args: any[]) {\n+ return this.reset(updateIn(this.state.deref(), path, fn, ...args));\n}\n/**\n",
"new_path": "packages/atom/src/history.ts",
"old_path": "packages/atom/src/history.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(atom): update IAtom, add resetIn() & swapIn() impls
| 1
|
feat
|
atom
|
679,913
|
05.03.2018 22:47:04
| 0
|
a200beb88199066c97c8f1e3f059e2f132d09fad
|
feat(hdom): add support for frame skipping, add docs
|
[
{
"change_type": "MODIFY",
"diff": "@@ -8,6 +8,18 @@ import { normalizeTree } from \"./normalize\";\n* computing diff to previous frame's tree and applying\n* any changes to the real DOM.\n*\n+ * **Selective updates**: No updates will be applied\n+ * if the given hiccup tree is `undefined` or `null` or\n+ * a root component function returns no value. This way\n+ * a given root function can do some state handling of its own\n+ * and implement fail-fast checks to determine no DOM updates\n+ * are necessary, save effort re-creating a new hiccup tree and\n+ * request skipping DOM updates via this function. In this case,\n+ * the previous DOM tree is kept around until the root function\n+ * returns a tree again, which then is diffed and applied against\n+ * the previous tree kept as usual. Any number of frames can be\n+ * skipped this way.\n+ *\n* Important: The parent element given is assumed to have NO\n* children at the time when `start()` is called. Since\n* hdom does NOT track the real DOM, the resulting\n@@ -29,7 +41,11 @@ export function start(parent: Element | string, tree: any, spans = true) {\nparent;\nfunction update() {\nif (isActive) {\n- diffElement(<Element>parent, prev, prev = normalizeTree(tree, [0], true, spans));\n+ const curr = normalizeTree(tree, [0], true, spans);\n+ if (curr != null) {\n+ diffElement(<Element>parent, prev, curr);\n+ prev = curr;\n+ }\n// check again in case one of the components called cancel\nisActive && requestAnimationFrame(update);\n}\n",
"new_path": "packages/hdom/src/start.ts",
"old_path": "packages/hdom/src/start.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(hdom): add support for frame skipping, add docs
| 1
|
feat
|
hdom
|
679,913
|
05.03.2018 22:47:41
| 0
|
1041d90ccd85a7caa21ffe6d80fc90bd82bfabd2
|
feat(examples): add devcards example
|
[
{
"change_type": "ADD",
"diff": "+node_modules\n+yarn.lock\n+*.js\n",
"new_path": "examples/devcards/.gitignore",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+# multiple-states\n+\n+[Live demo](http://demo.thi.ng/umbrella/multiple-states/)\n+\n+```\n+git clone https://github.com/thi-ng/umbrella.git\n+cd umbrella/examples/multiple-states\n+yarn install\n+```\n+Then\n+\n+```\n+# For Mac\n+yarn dev\n+\n+# For Debian, Ubuntu, Etc.\n+yarn debdev\n+```\n+\n+Once webpack has completed building, refresh your browser...\n",
"new_path": "examples/devcards/README.md",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"multiple-states\",\n+ \"version\": \"0.0.1\",\n+ \"repository\": \"https://github.com/thi-ng/umbrella\",\n+ \"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n+ \"license\": \"Apache-2.0\",\n+ \"scripts\": {\n+ \"build\": \"yarn clean && webpack\",\n+ \"clean\": \"rm -rf bundle.*\",\n+ \"dev\": \"open index.html && webpack -w\",\n+ \"debdev\": \"see index.html && webpack -w\"\n+ },\n+ \"devDependencies\": {\n+ \"ts-loader\": \"^3.3.1\",\n+ \"typescript\": \"^2.7.1\",\n+ \"webpack\": \"^3.10.0\"\n+ },\n+ \"dependencies\": {\n+ \"@thi.ng/api\": \"^2.0.3\",\n+ \"@thi.ng/atom\": \"^0.7.3\",\n+ \"@thi.ng/hdom\": \"^2.0.0\",\n+ \"@thi.ng/rstream\": \"^1.0.8\",\n+ \"@thi.ng/transducers\": \"^1.6.1\"\n+ }\n+}\n\\ No newline at end of file\n",
"new_path": "examples/devcards/package.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { IAtom } from \"@thi.ng/atom/api\";\n+import { Atom } from \"@thi.ng/atom/atom\";\n+import { Cursor } from \"@thi.ng/atom/cursor\";\n+import { start } from \"@thi.ng/hdom\";\n+\n+type CardFn = (state: IAtom<any>) => any;\n+\n+// counter for untitled cards\n+let CARD_ID = 1;\n+\n+/**\n+ * Inspired by Bruce Haumann's Devcards project:\n+ * https://github.com/bhauman/devcards/\n+ *\n+ * This function takes a component initializer function, an optional\n+ * pre-initialized state atom, card title and DOM parent element.\n+ * It then initializes any missing args and kicks off a new hdom\n+ * render loop to run as self-contained app.\n+ *\n+ * If no state is given, a new atom is created automatically.\n+ * The supplied component function should accept this state as sole argument,\n+ * do any necessary initialization of sub-components and then return\n+ * the actual root component (or function) for this app.\n+ *\n+ * As with the original Devcards, the client root component is wrapped\n+ * in a card container, which too displays the app state in JSON format.\n+ *\n+ * @param card\n+ * @param state\n+ * @param title\n+ * @param parent\n+ */\n+function defcard(card: CardFn, state?: IAtom<any>, title?: string, parent?: string | Element) {\n+ state = state || new Atom({});\n+ title = title || `devcard-${CARD_ID++}`;\n+\n+ // create new parent element if not provided\n+ if (!parent) {\n+ parent = document.createElement(\"div\");\n+ document.body.appendChild(parent);\n+ }\n+\n+ // Create a derived view for entire atom (using empty path `[]`)\n+ // this updates the JSON body only when state has changed\n+ const json = state.addView([], (state) => JSON.stringify(state, null, 2));\n+\n+ // instantiate the component with supplied state\n+ const root = card(state);\n+\n+ // kick off hdom renderloop\n+ start(parent, () => [\"div.card\", [\"h3\", title], [\"div.body\", root, [\"pre\", json.deref()]]]);\n+}\n+\n+/**\n+ * Value slider component options (see function below)\n+ */\n+interface SliderOpts {\n+ min: number;\n+ max: number;\n+ step?: number;\n+ label: (val) => any;\n+ onchange?: (e) => void;\n+}\n+\n+/**\n+ * Standalone slider component.\n+ * Takes an IAtom instance (here usually a Cursor)\n+ * and slider options, returns component function.\n+ * When the slider value is changed, automatically\n+ * resets cursor's value and calls user `onchange`\n+ * function (if provided).\n+ *\n+ * @param state\n+ * @param opts\n+ */\n+function slider(state: IAtom<any>, opts: SliderOpts) {\n+ // prep attribs to avoid extra work during render\n+ const attribs = {\n+ ...opts,\n+ type: \"range\",\n+ oninput: (e) => {\n+ state.reset(e.target.value);\n+ opts.onchange && opts.onchange(e);\n+ }\n+ };\n+ return () =>\n+ [\"div\",\n+ [\"div\", opts.label(state.deref())],\n+ [\"input\", { ...attribs, value: state.deref() }]];\n+}\n+\n+/**\n+ * This function is a self contained app to be used with\n+ * the above `defcard()` factory. It receives a state atom\n+ * for storing its internal state, initializes the different\n+ * slider components used and finally return a component\n+ * function to be shown in the card wrapper.\n+ *\n+ * @param state\n+ */\n+function bmi(state: IAtom<any>) {\n+ // state update function\n+ // computes new BMI value (if weight was changed) or\n+ // new weight value (if BMI was changed by user)\n+ const calc = (updateWeight = false) => {\n+ let { height, weight, bmi } = <any>(state.deref() || {});\n+ height *= 0.01;\n+ if (updateWeight) {\n+ state.resetIn(\"weight\", bmi * height * height);\n+ } else {\n+ state.resetIn(\"bmi\", weight / (height * height));\n+ }\n+ };\n+ // derived view of bmi value to translate it into english\n+ const bmiClass = state.addView(\n+ \"bmi\",\n+ (bmi: number) =>\n+ bmi < 18.5 ? \"underweight\" :\n+ bmi < 25 ? \"normal\" :\n+ bmi < 30 ? \"overweight\" : \"obese\"\n+ );\n+ // define slider components\n+ // note how each uses a cursor to their respective\n+ // target values in the app state\n+ const height = slider(\n+ new Cursor(state, \"height\"),\n+ {\n+ min: 100, max: 220,\n+ label: (v) => `Height: ${~~v}cm`,\n+ onchange: () => calc()\n+ }\n+ );\n+ const weight = slider(\n+ new Cursor(state, \"weight\"),\n+ {\n+ min: 10, max: 200,\n+ label: (v) => `Weight: ${~~v}kg`,\n+ onchange: () => calc()\n+ }\n+ );\n+ const bmi = slider(\n+ new Cursor(state, \"bmi\"),\n+ {\n+ min: 10, max: 50,\n+ label: (v) => [\"span\", { class: bmiClass.deref() }, `BMI: ${~~v} (${bmiClass.deref()})`],\n+ onchange: () => calc(true)\n+ }\n+ );\n+\n+ // perform initial calculation\n+ calc();\n+\n+ return () => [\"div\", height, weight, bmi];\n+}\n+\n+/**\n+ * All what's left to do here is to instantiate a bunch of cards (apps):\n+ *\n+ * Option 1: Two defcard() instances, each with their own, individual state atom\n+ */\n+defcard(bmi, new Atom({ weight: 75, height: 194 }), \"BMI calculator\");\n+defcard(bmi);\n+\n+\n+defcard(() => \"The cards below are all attached to the same atom, but use cursors to subscribe to different branches within the nested state.\");\n+\n+/**\n+ * Option 2: defcard() instances using shared central state\n+ */\n+const db = new Atom({ card1: { weight: 75, height: 194 } });\n+\n+defcard(bmi, new Cursor(db, \"card1\"), \"BMI calculator (shared)\");\n+defcard(bmi, new Cursor(db, \"card2\"));\n+\n+defcard(() => {\n+ // just some random task to populate another part of the app state\n+ setInterval(() => db.resetIn(\"stats.now\", new Date().toISOString()), 1000);\n+ return [\"div\", \"The full shared state:\"];\n+}, db);\n",
"new_path": "examples/devcards/src/index.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"extends\": \"../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \".\"\n+ },\n+ \"include\": [\n+ \"./src/**/*.ts\"\n+ ]\n+}\n",
"new_path": "examples/devcards/tsconfig.json",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(examples): add devcards example
| 1
|
feat
|
examples
|
679,913
|
05.03.2018 22:55:48
| 0
|
8019df8203d89ecd6fd45b8ff6dc7cf4f97feadd
|
build(examples): add missing html/webpack files, update deps
|
[
{
"change_type": "ADD",
"diff": "+<!DOCTYPE html>\n+<html>\n+\n+<head>\n+ <style>\n+ html {\n+ font: 100%/1.2 Helvetica, Arial, sans-serif;\n+ }\n+\n+ body {\n+ max-width: 40rem;\n+ }\n+\n+ div.card {\n+ background: #eee;\n+ }\n+\n+ div.card h3 {\n+ background: #333;\n+ color: #fff;\n+ padding: 0.5rem;\n+ margin: 0.25em 0;\n+ font-weight: 400;\n+ }\n+\n+ div.card div.body {\n+ padding: 0.25rem;\n+ }\n+\n+ div.card pre {\n+ border-top: 1px #ccc solid;\n+ border-bottom: 1px #ccc solid;\n+ padding: 1rem 0;\n+ color: #666;\n+ font-family: Menlo, monospace;\n+ }\n+\n+ div.card input[type=\"range\"] {\n+ width: 100%;\n+ }\n+\n+ .underweight,\n+ .overweight {\n+ color: orange;\n+ }\n+\n+ .obese {\n+ color: red;\n+ }\n+ </style>\n+</head>\n+\n+<body>\n+ <p>This example demonstrates different component state handling options provided by @thi.ng/atom and uses @thi.ng/hdom for\n+ rendering.\n+ </p>\n+ <p>The idea of \"Devcards\" is originally by Bruce Haumann and this implementation is in no way meant to be comparable...</p>\n+ <p>The BMI calculator example too was taken from Devcards (and by extension from Reagent Project examples).</p>\n+ <p>Total filesize: 18.5KB (6.6KB gzip'd) - see\n+ <a href=\"\">source</a> for more information.</p>\n+ <script type=\"text/javascript\" src=\"bundle.js\"></script>\n+</body>\n+\n+</html>\n\\ No newline at end of file\n",
"new_path": "examples/devcards/index.html",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "},\n\"dependencies\": {\n\"@thi.ng/api\": \"^2.0.3\",\n- \"@thi.ng/atom\": \"^0.7.3\",\n- \"@thi.ng/hdom\": \"^2.0.0\",\n- \"@thi.ng/rstream\": \"^1.0.8\",\n+ \"@thi.ng/atom\": \"^0.8.0\",\n+ \"@thi.ng/hdom\": \"^2.1.0\",\n+ \"@thi.ng/rstream\": \"^1.0.9\",\n\"@thi.ng/transducers\": \"^1.6.1\"\n}\n}\n\\ No newline at end of file\n",
"new_path": "examples/devcards/package.json",
"old_path": "examples/devcards/package.json"
},
{
"change_type": "ADD",
"diff": "+module.exports = {\n+ entry: \"./src/index.ts\",\n+ output: {\n+ path: __dirname,\n+ filename: \"bundle.js\"\n+ },\n+ resolve: {\n+ extensions: [\".ts\", \".js\"]\n+ },\n+ module: {\n+ loaders: [{ test: /\\.ts$/, loader: \"ts-loader\" }]\n+ },\n+ node: {\n+ process: false,\n+ setImmediate: false\n+ }\n+};\n",
"new_path": "examples/devcards/webpack.config.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+module.exports = {\n+ entry: \"./src/index.ts\",\n+ output: {\n+ path: __dirname,\n+ filename: \"bundle.js\"\n+ },\n+ resolve: {\n+ extensions: [\".ts\", \".js\"]\n+ },\n+ module: {\n+ loaders: [{ test: /\\.ts$/, loader: \"ts-loader\" }]\n+ },\n+ node: {\n+ process: false,\n+ setImmediate: false\n+ }\n+};\n",
"new_path": "examples/lifecycle-hooks/webpack.config.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+<!DOCTYPE html>\n+<html>\n+\n+<head>\n+ <style>\n+ html {\n+ font: 100%/1.2 Helvetica, Arial, sans-serif;\n+ }\n+\n+ .error {\n+ background: #fbb;\n+ color: #900;\n+ padding: 0.5em 1em;\n+ margin-bottom: 1em;\n+ }\n+\n+ footer {\n+ position: fixed;\n+ bottom: 1em;\n+ left: 1em;\n+ }\n+ </style>\n+</head>\n+\n+<body>\n+ <div id=\"app\"></div>\n+ <script type=\"text/javascript\" src=\"bundle.js\"></script>\n+</body>\n+\n+</html>\n\\ No newline at end of file\n",
"new_path": "examples/login-form/index.html",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+module.exports = {\n+ entry: \"./src/index.ts\",\n+ output: {\n+ path: __dirname,\n+ filename: \"bundle.js\"\n+ },\n+ resolve: {\n+ extensions: [\".ts\", \".js\"]\n+ },\n+ module: {\n+ loaders: [{ test: /\\.ts$/, loader: \"ts-loader\" }]\n+ },\n+ node: {\n+ process: false,\n+ setImmediate: false\n+ }\n+};\n",
"new_path": "examples/login-form/webpack.config.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+<!DOCTYPE html>\n+<html>\n+\n+<head>\n+ <style>\n+ html {\n+ font: 100%/1.2 Helvetica, Arial, sans-serif;\n+ }\n+\n+ body {\n+ margin: 0;\n+ }\n+\n+ footer {\n+ position: absolute;\n+ left: 20px;\n+ bottom: 20px;\n+ z-index: 1;\n+ }\n+ </style>\n+</head>\n+\n+<body>\n+ <div id=\"app\"></div>\n+ <footer>\n+ Made with\n+ <a href=\"https://github.com/thi-ng/umbrella/tree/master/packages/hdom\">@thi.ng/hdom</a>.\n+ </footer>\n+ <script type=\"text/javascript\" src=\"bundle.js\"></script>\n+</body>\n+\n+</html>\n\\ No newline at end of file\n",
"new_path": "examples/svg-particles/index.html",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+module.exports = {\n+ entry: \"./src/index.ts\",\n+ output: {\n+ path: __dirname,\n+ filename: \"bundle.js\"\n+ },\n+ resolve: {\n+ extensions: [\".ts\", \".js\"]\n+ },\n+ module: {\n+ loaders: [{ test: /\\.ts$/, loader: \"ts-loader\" }]\n+ },\n+ node: {\n+ process: false,\n+ setImmediate: false\n+ }\n+};\n",
"new_path": "examples/svg-particles/webpack.config.js",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
build(examples): add missing html/webpack files, update deps
| 1
|
build
|
examples
|
679,913
|
05.03.2018 22:59:42
| 0
|
f40143bed665ed18e16cdcb126e00c35ffacdb78
|
fix(examples): add/update devcard links
|
[
{
"change_type": "MODIFY",
"diff": "-# multiple-states\n+# devcards\n-[Live demo](http://demo.thi.ng/umbrella/multiple-states/)\n+[Live demo](http://demo.thi.ng/umbrella/devcards/)\n```\ngit clone https://github.com/thi-ng/umbrella.git\n-cd umbrella/examples/multiple-states\n+cd umbrella/examples/devcards\nyarn install\n```\nThen\n",
"new_path": "examples/devcards/README.md",
"old_path": "examples/devcards/README.md"
},
{
"change_type": "MODIFY",
"diff": "<p>The idea of \"Devcards\" is originally by Bruce Haumann and this implementation is in no way meant to be comparable...</p>\n<p>The BMI calculator example too was taken from Devcards (and by extension from Reagent Project examples).</p>\n<p>Total filesize: 18.5KB (6.6KB gzip'd) - see\n- <a href=\"\">source</a> for more information.</p>\n+ <a href=\"https://github.com/thi-ng/umbrella/tree/master/examples/devcards/\">source</a> for more information.</p>\n<script type=\"text/javascript\" src=\"bundle.js\"></script>\n</body>\n",
"new_path": "examples/devcards/index.html",
"old_path": "examples/devcards/index.html"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
fix(examples): add/update devcard links
| 1
|
fix
|
examples
|
807,849
|
06.03.2018 09:10:02
| 28,800
|
924c115f2723a66d5ef5f3cf7e3f221b38adc1b7
|
refactor: Share options between publish and changed as a builder function
|
[
{
"change_type": "MODIFY",
"diff": "@@ -10,16 +10,14 @@ exports.aliases = [\"updated\"];\nexports.describe = \"Check which packages have changed since the last publish.\";\nexports.builder = yargs =>\n- yargs.options(\n- Object.assign({}, publishOptions, {\n+ publishOptions(yargs).options({\njson: {\ndescribe: \"Show information in JSON format\",\ngroup: \"Command Options:\",\ntype: \"boolean\",\ndefault: undefined,\n},\n- })\n- );\n+ });\nexports.handler = function handler(argv) {\nreturn new ChangedCommand(argv);\n",
"new_path": "commands/changed/command.js",
"old_path": "commands/changed/command.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -9,15 +9,15 @@ exports.command = \"publish\";\nexports.describe = \"Publish packages in the current project.\";\n+exports.builder = yargs => {\nconst cdVersionOptions = [\"major\", \"minor\", \"patch\", \"premajor\", \"preminor\", \"prepatch\", \"prerelease\"];\n-\nconst cdVersionOptionString = `'${cdVersionOptions.slice(0, -1).join(\"', '\")}', or '${\ncdVersionOptions[cdVersionOptions.length - 1]\n}'.`;\n-exports.builder = {\n+ // TODO: share only relevant options with `lerna changed`\n+ const opts = {\ncanary: {\n- group: \"Command Options:\",\ndefaultDescription: \"alpha\",\ndescribe: \"Publish packages after every successful merge using the sha as part of the tag.\",\nalias: \"c\",\n@@ -25,7 +25,6 @@ exports.builder = {\n// type: \"string\",\n},\n\"cd-version\": {\n- group: \"Command Options:\",\ndescribe: `Skip the version selection prompt and increment semver: ${cdVersionOptionString}`,\ntype: \"string\",\nrequiresArg: true,\n@@ -37,98 +36,86 @@ exports.builder = {\n},\n},\n\"conventional-commits\": {\n- group: \"Command Options:\",\ndescribe: \"Use angular conventional-commit format to determine version bump and generate CHANGELOG.\",\ntype: \"boolean\",\ndefault: undefined,\n},\n\"changelog-preset\": {\n- group: \"Command Options:\",\ndescribe: \"Use another conventional-changelog preset rather than angular.\",\ntype: \"string\",\ndefault: undefined,\n},\nexact: {\n- group: \"Command Options:\",\ndescribe: \"Specify cross-dependency version numbers exactly rather than with a caret (^).\",\ntype: \"boolean\",\ndefault: undefined,\n},\n\"git-remote\": {\n- group: \"Command Options:\",\ndefaultDescription: \"origin\",\ndescribe: \"Push git changes to the specified remote instead of 'origin'.\",\ntype: \"string\",\nrequiresArg: true,\n},\nyes: {\n- group: \"Command Options:\",\ndescribe: \"Skip all confirmation prompts.\",\ntype: \"boolean\",\ndefault: undefined,\n},\nmessage: {\n- group: \"Command Options:\",\ndescribe: \"Use a custom commit message when creating the publish commit.\",\nalias: \"m\",\ntype: \"string\",\nrequiresArg: true,\n},\n\"npm-tag\": {\n- group: \"Command Options:\",\ndescribe: \"Publish packages with the specified npm dist-tag\",\ntype: \"string\",\nrequiresArg: true,\n},\n\"npm-client\": {\n- group: \"Command Options:\",\ndescribe: \"Executable used to publish dependencies (npm, yarn, pnpm, ...)\",\ntype: \"string\",\nrequiresArg: true,\n},\nregistry: {\n- group: \"Command Options:\",\ndescribe: \"Use the specified registry for all npm client operations.\",\ntype: \"string\",\nrequiresArg: true,\n},\npreid: {\n- group: \"Command Options:\",\ndescribe: \"Specify the prerelease identifier (major.minor.patch-pre).\",\ntype: \"string\",\nrequiresArg: true,\n},\n\"repo-version\": {\n- group: \"Command Options:\",\ndescribe: \"Specify repo version to publish.\",\ntype: \"string\",\nrequiresArg: true,\n},\n\"skip-git\": {\n- group: \"Command Options:\",\ndescribe: \"Skip commiting, tagging, and pushing git changes.\",\ntype: \"boolean\",\ndefault: undefined,\n},\n\"skip-npm\": {\n- group: \"Command Options:\",\ndescribe: \"Stop before actually publishing change to npm.\",\ntype: \"boolean\",\ndefault: undefined,\n},\n\"temp-tag\": {\n- group: \"Command Options:\",\ndescribe: \"Create a temporary tag while publishing.\",\ntype: \"boolean\",\ndefault: undefined,\n},\n\"allow-branch\": {\n- group: \"Command Options:\",\ndescribe: \"Specify which branches to allow publishing from.\",\ntype: \"array\",\n},\n};\n+ return yargs.options(opts).group(Object.keys(opts), \"Command Options:\");\n+};\n+\nexports.handler = function handler(argv) {\n// eslint-disable-next-line no-use-before-define\nreturn new PublishCommand(argv);\n",
"new_path": "commands/publish/command.js",
"old_path": "commands/publish/command.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
refactor: Share options between publish and changed as a builder function
| 1
|
refactor
| null |
807,849
|
06.03.2018 09:25:22
| 28,800
|
a48255ac0873823b4672e34ebb27708f7a989ffd
|
refactor(core/command): Split helper functions into lib
|
[
{
"change_type": "MODIFY",
"diff": "@@ -4,7 +4,6 @@ const _ = require(\"lodash\");\nconst dedent = require(\"dedent\");\nconst log = require(\"npmlog\");\n-const ChildProcessUtilities = require(\"@lerna/child-process\");\nconst GitUtilities = require(\"@lerna/git-utils\");\nconst PackageGraph = require(\"@lerna/package-graph\");\nconst Project = require(\"@lerna/project\");\n@@ -14,6 +13,10 @@ const collectUpdates = require(\"@lerna/collect-updates\");\nconst filterPackages = require(\"@lerna/filter-packages\");\nconst ValidationError = require(\"@lerna/validation-error\");\n+const cleanStack = require(\"./lib/clean-stack\");\n+const logPackageError = require(\"./lib/log-package-error\");\n+const warnIfHanging = require(\"./lib/warn-if-hanging\");\n+\n// handle log.success()\nlog.addLevel(\"success\", 3001, { fg: \"green\", bold: true });\n@@ -98,7 +101,7 @@ class Command {\nget name() {\n// For a class named \"FooCommand\" this returns \"foo\".\n- return commandNameFromClassName(this.className);\n+ return this.className.replace(/Command$/, \"\").toLowerCase();\n}\nget className() {\n@@ -286,47 +289,4 @@ class Command {\n}\n}\n-function commandNameFromClassName(className) {\n- return className.replace(/Command$/, \"\").toLowerCase();\n-}\n-\n-function cleanStack(err, className) {\n- const lines = err.stack ? err.stack.split(\"\\n\") : err.split(\"\\n\");\n- const cutoff = new RegExp(`^ at ${className}.runCommand .*$`);\n- const relevantIndex = lines.findIndex(line => cutoff.test(line));\n- return lines.slice(0, relevantIndex).join(\"\\n\");\n-}\n-\n-function logPackageError(err) {\n- log.error(`Error occured in '${err.pkg.name}' while running '${err.cmd}'`);\n-\n- const pkgPrefix = `${err.cmd} [${err.pkg.name}]`;\n- log.error(pkgPrefix, `Output from stdout:`);\n- log.pause();\n- console.error(err.stdout); // eslint-disable-line no-console\n-\n- log.resume();\n- log.error(pkgPrefix, `Output from stderr:`);\n- log.pause();\n- console.error(err.stderr); // eslint-disable-line no-console\n-\n- // Below is just to ensure something sensible is printed after the long\n- // stream of logs\n- log.resume();\n- log.error(`Error occured in '${err.pkg.name}' while running '${err.cmd}'`);\n-}\n-\n-function warnIfHanging() {\n- const childProcessCount = ChildProcessUtilities.getChildProcessCount();\n-\n- if (childProcessCount > 0) {\n- log.warn(\n- \"complete\",\n- `Waiting for ${childProcessCount} child ` +\n- `process${childProcessCount === 1 ? \"\" : \"es\"} to exit. ` +\n- \"CTRL-C to exit immediately.\"\n- );\n- }\n-}\n-\nmodule.exports = Command;\n",
"new_path": "core/command/index.js",
"old_path": "core/command/index.js"
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+module.exports = cleanStack;\n+\n+function cleanStack(err, className) {\n+ const lines = err.stack ? err.stack.split(\"\\n\") : err.split(\"\\n\");\n+ const cutoff = new RegExp(`^ at ${className}.runCommand .*$`);\n+ const relevantIndex = lines.findIndex(line => cutoff.test(line));\n+\n+ return lines.slice(0, relevantIndex).join(\"\\n\");\n+}\n",
"new_path": "core/command/lib/clean-stack.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+const log = require(\"npmlog\");\n+\n+module.exports = logPackageError;\n+\n+function logPackageError(err) {\n+ log.error(`Error occured in '${err.pkg.name}' while running '${err.cmd}'`);\n+\n+ const pkgPrefix = `${err.cmd} [${err.pkg.name}]`;\n+ log.error(pkgPrefix, `Output from stdout:`);\n+ log.pause();\n+ console.error(err.stdout); // eslint-disable-line no-console\n+\n+ log.resume();\n+ log.error(pkgPrefix, `Output from stderr:`);\n+ log.pause();\n+ console.error(err.stderr); // eslint-disable-line no-console\n+\n+ // Below is just to ensure something sensible is printed after the long stream of logs\n+ log.resume();\n+ log.error(`Error occured in '${err.pkg.name}' while running '${err.cmd}'`);\n+}\n",
"new_path": "core/command/lib/log-package-error.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+const log = require(\"npmlog\");\n+const ChildProcessUtilities = require(\"@lerna/child-process\");\n+\n+module.exports = warnIfHanging;\n+\n+function warnIfHanging() {\n+ const childProcessCount = ChildProcessUtilities.getChildProcessCount();\n+\n+ if (childProcessCount > 0) {\n+ log.warn(\n+ \"complete\",\n+ `Waiting for ${childProcessCount} child ` +\n+ `process${childProcessCount === 1 ? \"\" : \"es\"} to exit. ` +\n+ \"CTRL-C to exit immediately.\"\n+ );\n+ }\n+}\n",
"new_path": "core/command/lib/warn-if-hanging.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "\"url\": \"https://github.com/evocateur\"\n},\n\"files\": [\n- \"index.js\"\n+ \"index.js\",\n+ \"lib\"\n],\n\"main\": \"index.js\",\n\"engines\": {\n",
"new_path": "core/command/package.json",
"old_path": "core/command/package.json"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
refactor(core/command): Split helper functions into lib
| 1
|
refactor
|
core/command
|
807,849
|
06.03.2018 09:59:50
| 28,800
|
1476e1578000f5167cf61a331447b6f4ae804efc
|
refactor(core/command): Proactively configure options and class properties
|
[
{
"change_type": "MODIFY",
"diff": "@@ -213,7 +213,7 @@ describe(\"core-command\", () => {\n});\n});\n- describe(\"get .packages\", () => {\n+ describe(\".packages\", () => {\nit(\"returns the list of packages\", async () => {\nconst command = testFactory();\nawait command;\n@@ -222,7 +222,7 @@ describe(\"core-command\", () => {\n});\n});\n- describe(\"get .packageGraph\", () => {\n+ describe(\".packageGraph\", () => {\nit(\"returns the graph of packages\", async () => {\nconst command = testFactory();\nawait command;\n@@ -318,7 +318,7 @@ describe(\"core-command\", () => {\n});\n});\n- describe(\"get .options\", () => {\n+ describe(\".options\", () => {\nclass TestACommand extends Command {}\nclass TestBCommand extends Command {}\nclass TestCCommand extends Command {\n@@ -335,13 +335,6 @@ describe(\"core-command\", () => {\n}\n}\n- it(\"is a lazy getter\", async () => {\n- const instance = new TestACommand({ cwd: testDir, onRejected });\n- await instance;\n-\n- expect(instance.options).toBe(instance.options);\n- });\n-\nit(\"should pick up global options\", async () => {\nconst instance = new TestACommand({ cwd: testDir, onRejected });\nawait instance;\n",
"new_path": "core/command/__tests__/command.test.js",
"old_path": "core/command/__tests__/command.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -17,9 +17,6 @@ const cleanStack = require(\"./lib/clean-stack\");\nconst logPackageError = require(\"./lib/log-package-error\");\nconst warnIfHanging = require(\"./lib/warn-if-hanging\");\n-// handle log.success()\n-log.addLevel(\"success\", 3001, { fg: \"green\", bold: true });\n-\nconst DEFAULT_CONCURRENCY = 4;\nconst LERNA_VERSION = require(\"./package.json\").version; // FIXME: this is wrong now\n@@ -34,6 +31,9 @@ class Command {\nthis.lernaVersion = LERNA_VERSION;\nlog.info(\"version\", this.lernaVersion);\n+ // \"FooCommand\" => \"foo\"\n+ this.name = this.constructor.name.replace(/Command$/, \"\").toLowerCase();\n+\n// launch the command\nlet runner = new Promise((resolve, reject) => {\n// run everything inside a Promise chain\n@@ -42,6 +42,8 @@ class Command {\nchain = chain.then(() => {\nthis.repository = new Project(argv.cwd);\n});\n+ chain = chain.then(() => this.configureOptions());\n+ chain = chain.then(() => this.configureProperties());\nchain = chain.then(() => this.configureLogging());\nchain = chain.then(() => this.runValidations());\nchain = chain.then(() => this.runPreparations());\n@@ -60,7 +62,7 @@ class Command {\n} else if (err.name !== \"ValidationError\") {\n// npmlog does some funny stuff to the stack by default,\n// so pass it directly to avoid duplication.\n- log.error(\"\", cleanStack(err, this.className));\n+ log.error(\"\", cleanStack(err, this.constructor.name));\n}\n// ValidationError does not trigger a log dump\n@@ -84,56 +86,24 @@ class Command {\nthis.catch = onRejected => runner.catch(onRejected);\n}\n- get concurrency() {\n- if (!this._concurrency) {\n- const { concurrency } = this.options;\n- this._concurrency = Math.max(1, +concurrency || DEFAULT_CONCURRENCY);\n- }\n-\n- return this._concurrency;\n- }\n-\n- get toposort() {\n- const { sort } = this.options;\n- // If the option isn't present then the default is to sort.\n- return sort === undefined || sort;\n- }\n-\n- get name() {\n- // For a class named \"FooCommand\" this returns \"foo\".\n- return this.className.replace(/Command$/, \"\").toLowerCase();\n- }\n-\n- get className() {\n- return this.constructor.name;\n- }\n-\n- get execOpts() {\n- if (!this._execOpts) {\n- this._execOpts = {\n- cwd: this.repository.rootPath,\n- };\n-\n- if (this.options.maxBuffer) {\n- this._execOpts.maxBuffer = this.options.maxBuffer;\n- }\n- }\n-\n- return this._execOpts;\n- }\n-\nget requiresGit() {\nreturn true;\n}\n// Override this to inherit config from another command.\n- // For example `updated` inherits config from `publish`.\n+ // For example `changed` inherits config from `publish`.\nget otherCommandConfigs() {\nreturn [];\n}\n- get options() {\n- if (!this._options) {\n+ get defaultOptions() {\n+ return {\n+ concurrency: DEFAULT_CONCURRENCY,\n+ sort: true,\n+ };\n+ }\n+\n+ configureOptions() {\n// Command config object is either \"commands\" or \"command\".\nconst { commands, command } = this.repository.lernaJson;\n@@ -142,7 +112,7 @@ class Command {\nname => (commands || command || {})[name]\n);\n- this._options = _.defaults(\n+ this.options = _.defaults(\n{},\n// CLI flags, which if defined overrule subsequent values\nthis._argv,\n@@ -157,24 +127,27 @@ class Command {\n);\n}\n- return this._options;\n- }\n+ configureProperties() {\n+ const { concurrency, sort, maxBuffer } = this.options;\n- get defaultOptions() {\n- return {\n- concurrency: DEFAULT_CONCURRENCY,\n- sort: true,\n+ this.concurrency = Math.max(1, +concurrency || DEFAULT_CONCURRENCY);\n+ this.toposort = sort === undefined || sort;\n+ this.execOpts = {\n+ cwd: this.repository.rootPath,\n+ maxBuffer,\n};\n}\nconfigureLogging() {\n- // this.options getter might throw (invalid JSON in lerna.json)\nconst { loglevel } = this.options;\nif (loglevel) {\nlog.level = loglevel;\n}\n+ // handle log.success()\n+ log.addLevel(\"success\", 3001, { fg: \"green\", bold: true });\n+\n// create logger that subclasses use\nthis.logger = log.newGroup(this.name);\n",
"new_path": "core/command/index.js",
"old_path": "core/command/index.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
refactor(core/command): Proactively configure options and class properties
| 1
|
refactor
|
core/command
|
807,849
|
06.03.2018 10:04:04
| 28,800
|
76e1c04314359f664347676342ac5a5ee70178ca
|
feat(core/command): Configure infinite maxBuffer
BREAKING CHANGE:
This removes the --max-buffer flag, which will now throw if passed.
All subprocesses will now have infinite buffer, which means it could
freeze your machine if processes invoked by lerna spam dozens of
gigabytes of logs. In practice, this is extremely rare.
|
[
{
"change_type": "MODIFY",
"diff": "@@ -942,13 +942,6 @@ What level of logs to report. On failure, all logs are written to lerna-debug.lo\nAny logs of a higher level than the setting are shown. The default is \"info\".\n-#### --max-buffer [in-bytes]\n-\n-Set a max buffer length for each underlying process call. Useful for example\n-when someone wants to import a repo with a larger amount of commits while\n-running `lerna import`. In that case the built-in buffer length might not\n-be sufficient.\n-\n#### --no-sort\nBy default, all tasks execute on packages in topologically sorted order as to respect the dependency relationships of the packages in question. Cycles are broken on a best-effort basis in a way not guaranteed to be consistent across Lerna invocations.\n",
"new_path": "README.md",
"old_path": "README.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -104,13 +104,11 @@ describe(\"core-command\", () => {\n});\ndescribe(\".execOpts\", () => {\n- const ONE_HUNDRED_MEGABYTES = 1000 * 1000 * 100;\n-\n- it(\"has maxBuffer\", async () => {\n- const command = testFactory({ maxBuffer: ONE_HUNDRED_MEGABYTES });\n+ it(\"has maxBuffer Infinity\", async () => {\n+ const command = testFactory();\nawait command;\n- expect(command.execOpts.maxBuffer).toBe(ONE_HUNDRED_MEGABYTES);\n+ expect(command.execOpts.maxBuffer).toBe(Infinity);\n});\nit(\"has repo path\", async () => {\n",
"new_path": "core/command/__tests__/command.test.js",
"old_path": "core/command/__tests__/command.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -128,13 +128,13 @@ class Command {\n}\nconfigureProperties() {\n- const { concurrency, sort, maxBuffer } = this.options;\n+ const { concurrency, sort } = this.options;\nthis.concurrency = Math.max(1, +concurrency || DEFAULT_CONCURRENCY);\nthis.toposort = sort === undefined || sort;\nthis.execOpts = {\ncwd: this.repository.rootPath,\n- maxBuffer,\n+ maxBuffer: Infinity,\n};\n}\n",
"new_path": "core/command/index.js",
"old_path": "core/command/index.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -57,11 +57,6 @@ function globalOptions(yargs) {\ntype: \"boolean\",\ndefault: undefined,\n},\n- \"max-buffer\": {\n- describe: \"Set max-buffer(bytes) for Command execution\",\n- type: \"number\",\n- requiresArg: true,\n- },\n};\n// group options under \"Global Options:\" header\n",
"new_path": "core/global-options/index.js",
"old_path": "core/global-options/index.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -25,27 +25,6 @@ If `lerna bootstrap` is failing because you have repositories on a private serve\n## Import Command\n-### Buffer problems during import\n-\n-When you try to import a repository which has many commits in it there is a\n-chance that you get an error such as:\n-\n-```\n-DeprecationWarning: Unhandled promise rejections are deprecated\n-```\n-\n-or\n-\n-```\n-Error: spawnSync /bin/sh ENOBUFS during ImportCommand.execute\n-```\n-\n-#### Solution:\n-\n-Run `lerna import` with the `--max-buffer` flag and provide a large enough\n-number (in bytes). At the writing of this entry the underlying default is\n-10MB, so you should keep this in mind.\n-\n### Merge conflict commits cannot be imported\nWhen you try to import a repository that contains merge commits that needed\n",
"new_path": "doc/troubleshooting.md",
"old_path": "doc/troubleshooting.md"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
feat(core/command): Configure infinite maxBuffer
BREAKING CHANGE:
This removes the --max-buffer flag, which will now throw if passed.
All subprocesses will now have infinite buffer, which means it could
freeze your machine if processes invoked by lerna spam dozens of
gigabytes of logs. In practice, this is extremely rare.
| 1
|
feat
|
core/command
|
807,849
|
06.03.2018 10:29:48
| 28,800
|
4d26a45ea2a2b318cb25272758f6786f850a4d1f
|
chore(jest): Simplify modulePathIgnorePatterns
|
[
{
"change_type": "MODIFY",
"diff": "module.exports = {\nclearMocks: true,\ncollectCoverageFrom: [\"{commands,core,utils}/**/*.js\"],\n- modulePathIgnorePatterns: [\"<rootDir>/.*/__fixtures__\"],\n+ modulePathIgnorePatterns: [\"/__fixtures__/\"],\nroots: [\"<rootDir>/commands\", \"<rootDir>/core\", \"<rootDir>/utils\"],\nsetupFiles: [\"@lerna-test/silence-logging\"],\ntestEnvironment: \"node\",\n",
"new_path": "jest.config.js",
"old_path": "jest.config.js"
},
{
"change_type": "MODIFY",
"diff": "module.exports = {\nbail: true,\n- modulePathIgnorePatterns: [\"<rootDir>/.*/__fixtures__\"],\n+ modulePathIgnorePatterns: [\"/__fixtures__/\"],\nroots: [\"<rootDir>/integration\"],\nsetupTestFrameworkScriptFile: \"<rootDir>/setup-integration-timeout.js\",\nsnapshotSerializers: [\"@lerna-test/serialize-placeholders\"],\n",
"new_path": "jest.integration.js",
"old_path": "jest.integration.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
chore(jest): Simplify modulePathIgnorePatterns
| 1
|
chore
|
jest
|
807,849
|
06.03.2018 11:21:22
| 28,800
|
10df2738e14d2343f7f8d09800b9798647af3b55
|
fix: Restore 'npm link'-ability to root manifest
|
[
{
"change_type": "MODIFY",
"diff": "{\n- \"name\": \"lerna-root\",\n- \"version\": \"3.0.0-alpha.3\",\n+ \"name\": \"lerna\",\n+ \"version\": \"3.0.0-monorepo\",\n\"lockfileVersion\": 1,\n\"requires\": true,\n\"dependencies\": {\n",
"new_path": "package-lock.json",
"old_path": "package-lock.json"
},
{
"change_type": "MODIFY",
"diff": "{\n- \"name\": \"lerna-root\",\n- \"version\": \"3.0.0-alpha.3\",\n+ \"name\": \"lerna\",\n+ \"version\": \"3.0.0-monorepo\",\n\"description\": \"lerna dog-fooding lerna\",\n\"private\": true,\n\"scripts\": {\n},\n\"license\": \"MIT\",\n\"homepage\": \"https://lernajs.io/\",\n+ \"bin\": {\n+ \"lerna\": \"core/lerna/cli.js\"\n+ },\n\"dependencies\": {\n\"lerna\": \"file:core/lerna\"\n},\n",
"new_path": "package.json",
"old_path": "package.json"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
fix: Restore 'npm link'-ability to root manifest
| 1
|
fix
| null |
807,849
|
06.03.2018 11:21:51
| 28,800
|
31e339b5434a2f5a524280b373974ad1cb5661f2
|
docs: Update paths and flags in contributor guide
|
[
{
"change_type": "MODIFY",
"diff": "@@ -11,12 +11,12 @@ $ npm i\n## Code Structure\n-Currently, the [source](https://github.com/lerna/lerna/tree/master/src) is split up into a few categories:\n+Currently, the [source](https://github.com/lerna/lerna/tree/master) is split up into a few categories:\n-* Utilities: methods to run git, npm, fs, and more.\n-* Abstractions for packages\n-* [Lerna Commands](https://github.com/lerna/lerna/tree/master/src/commands): each command has an `initialize` and `execute` function.\n- * These commands are consumed as yargs subcommands in [src/cli.js](https://github.com/lerna/lerna/blob/master/src/cli.js), which is called from the executable [`bin/lerna.js`](https://github.com/lerna/lerna/blob/master/bin/lerna.js).\n+* [utils](https://github.com/lerna/lerna/tree/master/utils): shared packages to run git, npm, fs, and more.\n+* [core](https://github.com/lerna/lerna/tree/master/core): basic building blocks, including Package-related abstractions and the command superclass.\n+* [commands](https://github.com/lerna/lerna/tree/master/commands): each command has an `initialize` and `execute` function.\n+ * These commands are consumed as yargs subcommands in [core/cli/index.js](https://github.com/lerna/lerna/blob/master/core/cli/index.js), which is required from the executable [`core/lerna/cli.js`](https://github.com/lerna/lerna/blob/master/core/lerna/cli.js).\n## Commands\n@@ -26,10 +26,10 @@ Currently, the [source](https://github.com/lerna/lerna/tree/master/src) is split\n$ npm test\n# watch for changes\n-$ npm run test:watch\n+$ npm test -- --watch\n-# For a specific file (e.g., in test/Command.js)\n-$ npm run test:watch -- Command.js\n+# For a specific file (e.g., in core/command/__tests__/command.test.js)\n+$ npm test -- --watch core/command\n```\nBy default, `npm test` also runs the linter.\n@@ -38,6 +38,7 @@ You can skip this by calling `jest` directly:\n```sh\n$ npx jest\n$ npx jest --watch\n+$ npx jest --config jest.integration.js\n# etc\n```\n@@ -46,11 +47,14 @@ $ npx jest --watch\n```sh\n$ npm run integration\n+# test a specific file\n+$ npm run integration -- lerna-publish\n+\n# watch for changes\n-$ npm run test:watch-integration\n+$ npm run integration -- --watch\n-# For a specific file\n-$ npm run test:watch-integration -- lerna-publish\n+# watch a specific file\n+$ npm run integration -- --watch lerna-publish\n```\n### Linting\n",
"new_path": "CONTRIBUTING.md",
"old_path": "CONTRIBUTING.md"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
docs: Update paths and flags in contributor guide
| 1
|
docs
| null |
807,849
|
06.03.2018 11:35:07
| 28,800
|
9a1df41d98817a13c8aa1102c38710f5caa2e2ee
|
chore: run prettier on markdown
|
[
{
"change_type": "MODIFY",
"diff": "@@ -20,7 +20,7 @@ directory instead.\nthat ideally does not require any other modifications to a project.\nWhen the `--hoist` flag is used:\n-* Common dependencies will be installed *only* to the top-level\n+* Common dependencies will be installed _only_ to the top-level\n`node_modules`, and omitted from individual package `node_modules`.\n* Mostly-common dependencies are still hoisted, but outlier packages\nwith different versions will get a normal, local `node_modules`\n",
"new_path": "doc/hoist.md",
"old_path": "doc/hoist.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -53,19 +53,18 @@ tagged with the Github web ui.\nFor example if the publish history was as follows:\n-- v1.1.0 was published and tagged with `lerna publish`\n-- v1.2.0 was manually published and tagged with the Github web ui\n-- v1.2.1 was manually published and tagged with the Github web ui\n+* v1.1.0 was published and tagged with `lerna publish`\n+* v1.2.0 was manually published and tagged with the Github web ui\n+* v1.2.1 was manually published and tagged with the Github web ui\nRunning `lerna publish` now would detect v1.1.0 instead of v1.2.1 as the last released tag.\nThe implications of this depends on your usage of `lerna publish`:\n-- The publish prompt would use v1.1.0 as the base for major/minor/patch suggestions.\n-- When using the --conventional-commit flag:\n- - would suggest a semver increment based on all the commits since v1.1.0 (including commits from v1.2.0, v1.2.1 etc)\n- - The generated CHANGELOG.md files will repeat all the commits that have already been released in v1.2.0, v1.2.1 etc\n-\n+* The publish prompt would use v1.1.0 as the base for major/minor/patch suggestions.\n+* When using the --conventional-commit flag:\n+ * would suggest a semver increment based on all the commits since v1.1.0 (including commits from v1.2.0, v1.2.1 etc)\n+ * The generated CHANGELOG.md files will repeat all the commits that have already been released in v1.2.0, v1.2.1 etc\n#### Solution:\n",
"new_path": "doc/troubleshooting.md",
"old_path": "doc/troubleshooting.md"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
chore: run prettier on markdown
| 1
|
chore
| null |
448,039
|
06.03.2018 12:45:01
| -3,600
|
eef143755c3a96acdac80d2ea8f22166102c1fec
|
release: cut v2.2.0
|
[
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"2.2.0\"></a>\n+# [2.2.0](https://github.com/dherges/ng-packagr/compare/v2.1.0...v2.2.0) (2018-03-06)\n+\n+\n+### Bug Fixes\n+\n+* add `chalk` to dependencies ([#647](https://github.com/dherges/ng-packagr/issues/647)) ([e8aa93f](https://github.com/dherges/ng-packagr/commit/e8aa93f))\n+* lock rollup-plugin-commonjs dependency at 8.3.0 ([#658](https://github.com/dherges/ng-packagr/issues/658)) ([59d0c3b](https://github.com/dherges/ng-packagr/commit/59d0c3b)), closes [#657](https://github.com/dherges/ng-packagr/issues/657)\n+* update rollup-plugin-license to version ^0.6.0 ([#664](https://github.com/dherges/ng-packagr/issues/664)) ([2a21d7e](https://github.com/dherges/ng-packagr/commit/2a21d7e))\n+\n+\n+### Features\n+\n+* add `deleteDestPath` option ([#655](https://github.com/dherges/ng-packagr/issues/655)) ([61922c1](https://github.com/dherges/ng-packagr/commit/61922c1)), closes [#632](https://github.com/dherges/ng-packagr/issues/632)\n+* add Graph and Node API for angular transforms ([#644](https://github.com/dherges/ng-packagr/issues/644)) ([92e6082](https://github.com/dherges/ng-packagr/commit/92e6082))\n+* add update notifier to cli ([#649](https://github.com/dherges/ng-packagr/issues/649)) ([f5c4afc](https://github.com/dherges/ng-packagr/commit/f5c4afc))\n+* analyse typescript dependencies of an entry point ([#648](https://github.com/dherges/ng-packagr/issues/648)) ([749d48b](https://github.com/dherges/ng-packagr/commit/749d48b))\n+* reduce library bundle size by clean-css ([#563](https://github.com/dherges/ng-packagr/issues/563)) ([65386c2](https://github.com/dherges/ng-packagr/commit/65386c2)), closes [#614](https://github.com/dherges/ng-packagr/issues/614)\n+\n+\n+### Performance Improvements\n+\n+* re-use postcss processor instance per entry point ([#645](https://github.com/dherges/ng-packagr/issues/645)) ([f70985b](https://github.com/dherges/ng-packagr/commit/f70985b))\n+\n+\n+\n<a name=\"2.1.0\"></a>\n# [2.1.0](https://github.com/dherges/ng-packagr/compare/v2.0.0-rc.13...v2.1.0) (2018-02-21)\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"ng-packagr\",\n- \"version\": \"2.1.0\",\n+ \"version\": \"2.2.0\",\n\"description\": \"Compile and package a TypeScript library to Angular Package Format\",\n\"keywords\": [\n\"angular\",\n\"publish:ci\": \"yarn prerelease && yarn postrelease\",\n\"integration:samples\": \"integration/samples.sh\",\n\"integration:samples:dev\": \"ts-node --project src/tsconfig.packagr.json ./integration/samples.dev.ts\",\n- \"integration:specs\":\n- \"cross-env TS_NODE_PROJECT=integration/tsconfig.specs.json mocha --require ts-node/register integration/samples/*/specs/**/*.ts\",\n+ \"integration:specs\": \"cross-env TS_NODE_PROJECT=integration/tsconfig.specs.json mocha --require ts-node/register integration/samples/*/specs/**/*.ts\",\n\"integration:consumers\": \"integration/consumers.sh\",\n\"integration:consumers:ngc\": \"ngc -p integration/consumers/tsc/tsconfig.json\",\n- \"test:specs\":\n- \"cross-env TS_NODE_PROJECT=src/tsconfig.specs.json mocha --require ts-node/register \\\"src/**/*.spec.ts\\\"\",\n- \"test\":\n- \"yarn build && yarn test:specs && yarn integration:samples && yarn integration:specs && yarn integration:consumers\",\n+ \"test:specs\": \"cross-env TS_NODE_PROJECT=src/tsconfig.specs.json mocha --require ts-node/register \\\"src/**/*.spec.ts\\\"\",\n+ \"test\": \"yarn build && yarn test:specs && yarn integration:samples && yarn integration:specs && yarn integration:consumers\",\n\"commitmsg\": \"commitlint -e\",\n\"precommit\": \"pretty-quick --staged\",\n\"gh-pages\": \"gh-pages -d docs/ghpages\"\n",
"new_path": "package.json",
"old_path": "package.json"
}
] |
TypeScript
|
MIT License
|
ng-packagr/ng-packagr
|
release: cut v2.2.0
| 1
|
release
| null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.