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
⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
807,849
|
17.03.2018 14:14:07
| 25,200
|
92492219cac5bd63b4abec0a35a2dba618e8264e
|
fix: Use correct instance property override
|
[
{
"change_type": "MODIFY",
"diff": "@@ -14,7 +14,7 @@ const getRangeToReference = require(\"./lib/get-range-to-reference\");\nconst notSatisfiedMessage = require(\"./lib/not-satisfied-message\");\nclass AddCommand extends Command {\n- get requireGit() {\n+ get requiresGit() {\nreturn false;\n}\n",
"new_path": "commands/add/index.js",
"old_path": "commands/add/index.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
fix: Use correct instance property override
| 1
|
fix
| null |
815,745
|
17.03.2018 17:41:52
| -7,200
|
98889819b30076d962f9082799a1d190fdf7d081
|
fix: break loop while marking items
fixes
|
[
{
"change_type": "MODIFY",
"diff": "@@ -232,12 +232,12 @@ export class ItemsList {\n}\nprivate _stepToItem(steps: number) {\n- if (this._filteredItems.length === 0) {\n+ if (this._filteredItems.length === 0 || this._filteredItems.every(x => x.disabled)) {\nreturn;\n}\nthis._markedIndex = this._getNextItemIndex(steps);\n- while (this.markedItem.disabled) {\n+ if (this.markedItem.disabled) {\nthis._stepToItem(steps);\n}\n}\n",
"new_path": "src/ng-select/items-list.ts",
"old_path": "src/ng-select/items-list.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -820,6 +820,7 @@ describe('NgSelectComponent', function () {\ndescribe('Keyboard events', () => {\nlet fixture: ComponentFixture<NgSelectBasicTestCmp>;\n+ let select: NgSelectComponent;\nbeforeEach(() => {\nfixture = createTestingModule(\n@@ -830,12 +831,13 @@ describe('NgSelectComponent', function () {\n[multiple]=\"multiple\"\n[(ngModel)]=\"selectedCity\">\n</ng-select>`);\n+ select = fixture.componentInstance.select;\n});\ndescribe('space', () => {\nit('should open dropdown', () => {\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\n- expect(fixture.componentInstance.select.isOpen).toBe(true);\n+ expect(select.isOpen).toBe(true);\n});\nit('should open empty dropdown if no items', fakeAsync(() => {\n@@ -861,7 +863,7 @@ describe('NgSelectComponent', function () {\nit('should open dropdown and mark first item', () => {\nconst result = { value: fixture.componentInstance.cities[0] };\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\n- expect(fixture.componentInstance.select.itemsList.markedItem).toEqual(jasmine.objectContaining(result));\n+ expect(select.itemsList.markedItem).toEqual(jasmine.objectContaining(result));\n});\nit('should open dropdown and mark first not disabled item', fakeAsync(() => {\n@@ -870,13 +872,13 @@ describe('NgSelectComponent', function () {\ntickAndDetectChanges(fixture);\nconst result = { value: fixture.componentInstance.cities[1] };\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\n- expect(fixture.componentInstance.select.itemsList.markedItem).toEqual(jasmine.objectContaining(result));\n+ expect(select.itemsList.markedItem).toEqual(jasmine.objectContaining(result));\n}));\nit('should open dropdown without marking first item', () => {\n- fixture.componentInstance.select.markFirst = false;\n+ select.markFirst = false;\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\n- expect(fixture.componentInstance.select.itemsList.markedItem).toEqual(undefined);\n+ expect(select.itemsList.markedItem).toEqual(undefined);\n});\n});\n@@ -886,9 +888,19 @@ describe('NgSelectComponent', function () {\nconst result = [jasmine.objectContaining({\nvalue: fixture.componentInstance.cities[1]\n})];\n- expect(fixture.componentInstance.select.selectedItems).toEqual(result);\n+ expect(select.selectedItems).toEqual(result);\n});\n+ it('should stop marked loop if all items disabled', fakeAsync(() => {\n+ fixture.componentInstance.cities[0].disabled = true;\n+ fixture.componentInstance.cities = [...fixture.componentInstance.cities]\n+ tickAndDetectChanges(fixture);\n+ select.filter('vil');\n+ tickAndDetectChanges(fixture);\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.ArrowDown);\n+ expect(select.itemsList.markedItem).toBeUndefined();\n+ }));\n+\nit('should select first value on arrow down when current value is last', fakeAsync(() => {\nfixture.componentInstance.selectedCity = fixture.componentInstance.cities[2];\ntickAndDetectChanges(fixture);\n@@ -897,7 +909,7 @@ describe('NgSelectComponent', function () {\nconst result = [jasmine.objectContaining({\nvalue: fixture.componentInstance.cities[0]\n})];\n- expect(fixture.componentInstance.select.selectedItems).toEqual(result);\n+ expect(select.selectedItems).toEqual(result);\n}));\nit('should skip disabled option and select next one', fakeAsync(() => {\n@@ -908,7 +920,7 @@ describe('NgSelectComponent', function () {\nconst result = [jasmine.objectContaining({\nvalue: fixture.componentInstance.cities[1]\n})];\n- expect(fixture.componentInstance.select.selectedItems).toEqual(result);\n+ expect(select.selectedItems).toEqual(result);\n}));\nit('should select previous value on arrow up', fakeAsync(() => {\n@@ -919,7 +931,7 @@ describe('NgSelectComponent', function () {\nconst result = [jasmine.objectContaining({\nvalue: fixture.componentInstance.cities[0]\n})];\n- expect(fixture.componentInstance.select.selectedItems).toEqual(result);\n+ expect(select.selectedItems).toEqual(result);\n}));\nit('should select last value on arrow up', () => {\n@@ -927,32 +939,32 @@ describe('NgSelectComponent', function () {\nconst result = [jasmine.objectContaining({\nvalue: fixture.componentInstance.cities[2]\n})];\n- expect(fixture.componentInstance.select.selectedItems).toEqual(result);\n+ expect(select.selectedItems).toEqual(result);\n});\n});\ndescribe('esc', () => {\nit('should close opened dropdown', () => {\n- fixture.componentInstance.select.isOpen = true;\n+ select.isOpen = true;\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Esc);\n- expect(fixture.componentInstance.select.isOpen).toBe(false);\n+ expect(select.isOpen).toBe(false);\n});\n});\ndescribe('tab', () => {\nit('should close dropdown when there are no items', fakeAsync(() => {\n- fixture.componentInstance.select.filter('random stuff');\n+ select.filter('random stuff');\ntick(200);\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Tab);\n- expect(fixture.componentInstance.select.isOpen).toBeFalsy()\n+ expect(select.isOpen).toBeFalsy()\n}));\nit('should close dropdown', () => {\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Tab);\n- expect(fixture.componentInstance.select.selectedItems).toEqual([]);\n- expect(fixture.componentInstance.select.isOpen).toBeFalsy()\n+ expect(select.selectedItems).toEqual([]);\n+ expect(select.isOpen).toBeFalsy()\n});\nit('should close dropdown and keep selected value', fakeAsync(() => {\n@@ -964,8 +976,8 @@ describe('NgSelectComponent', function () {\nconst result = [jasmine.objectContaining({\nvalue: fixture.componentInstance.cities[0]\n})];\n- expect(fixture.componentInstance.select.selectedItems).toEqual(result);\n- expect(fixture.componentInstance.select.isOpen).toBeFalsy()\n+ expect(select.selectedItems).toEqual(result);\n+ expect(select.isOpen).toBeFalsy()\n}));\n});\n@@ -974,33 +986,33 @@ describe('NgSelectComponent', function () {\nfixture.componentInstance.selectedCity = fixture.componentInstance.cities[0];\ntickAndDetectChanges(fixture);\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Backspace);\n- expect(fixture.componentInstance.select.selectedItems).toEqual([]);\n+ expect(select.selectedItems).toEqual([]);\n}));\nit('should not remove selected value if filter is set', fakeAsync(() => {\n- fixture.componentInstance.select.filterValue = 'a';\n+ select.filterValue = 'a';\nfixture.componentInstance.selectedCity = fixture.componentInstance.cities[0];\ntickAndDetectChanges(fixture);\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Backspace);\nconst result = [jasmine.objectContaining({\nvalue: fixture.componentInstance.cities[0]\n})];\n- expect(fixture.componentInstance.select.selectedItems).toEqual(result);\n+ expect(select.selectedItems).toEqual(result);\n}));\nit('should not remove selected value when clearable is false', fakeAsync(() => {\n- fixture.componentInstance.select.clearable = false;\n+ select.clearable = false;\nfixture.componentInstance.selectedCity = fixture.componentInstance.cities[0];\ntickAndDetectChanges(fixture);\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Backspace);\nconst result = [jasmine.objectContaining({\nvalue: fixture.componentInstance.cities[0]\n})];\n- expect(fixture.componentInstance.select.selectedItems).toEqual(result);\n+ expect(select.selectedItems).toEqual(result);\n}));\nit('should do nothing when there is no selection', fakeAsync(() => {\n- const clear = spyOn(fixture.componentInstance.select, 'clearModel');\n+ const clear = spyOn(select, 'clearModel');\ntickAndDetectChanges(fixture);\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Backspace);\nexpect(clear).not.toHaveBeenCalled();\n@@ -1017,7 +1029,7 @@ describe('NgSelectComponent', function () {\nconst result = [jasmine.objectContaining({\nvalue: fixture.componentInstance.cities[1]\n})];\n- expect(fixture.componentInstance.select.selectedItems).toEqual(result);\n+ expect(select.selectedItems).toEqual(result);\n}));\n});\n});\n@@ -2262,7 +2274,7 @@ class NgSelectBasicTestCmp {\ndropdownPosition = 'bottom';\ncitiesLoading = false;\ncities: any[] = [\n- { id: 1, name: 'Vilnius', disabled: false },\n+ { id: 1, name: 'Vilnius' },\n{ id: 2, name: 'Kaunas' },\n{ id: 3, name: 'Pabrade' },\n];\n",
"new_path": "src/ng-select/ng-select.component.spec.ts",
"old_path": "src/ng-select/ng-select.component.spec.ts"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
fix: break loop while marking items (#363)
fixes #361
| 1
|
fix
| null |
573,201
|
17.03.2018 18:15:56
| 18,000
|
e2b96e0ce66b060d45aec60910ffe126aa0a46b2
|
chore: staticServer doc fix
Fixes invalid regular expression for serveStatic example which was missing a closing `/`
|
[
{
"change_type": "MODIFY",
"diff": "@@ -534,7 +534,7 @@ _The serveStatic module is different than most of the other plugins, in that\nit is expected that you are going to map it to a route, as below:_\n```javascript\n-server.get(/\\/docs\\/current\\/?.*\\/, restify.plugins.serveStatic({\n+server.get(/\\/docs\\/current\\/?.*\\//, restify.plugins.serveStatic({\ndirectory: './documentation/v1',\ndefault: 'index.html'\n}));\n",
"new_path": "docs/_api/plugins.md",
"old_path": "docs/_api/plugins.md"
}
] |
JavaScript
|
MIT License
|
restify/node-restify
|
chore: staticServer doc fix (#1618)
Fixes invalid regular expression for serveStatic example which was missing a closing `/`
| 1
|
chore
| null |
679,913
|
17.03.2018 22:58:29
| 0
|
422c2c4e68b4f5b337b552d43645465684558afe
|
feat(resolve-map): add package
|
[
{
"change_type": "ADD",
"diff": "+build\n+coverage\n+dev\n+doc\n+src*\n+test\n+.nyc_output\n+tsconfig.json\n+*.tgz\n+*.html\n",
"new_path": "packages/resolve-map/.npmignore",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+ Apache License\n+ Version 2.0, January 2004\n+ http://www.apache.org/licenses/\n+\n+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n+\n+ 1. Definitions.\n+\n+ \"License\" shall mean the terms and conditions for use, reproduction,\n+ and distribution as defined by Sections 1 through 9 of this document.\n+\n+ \"Licensor\" shall mean the copyright owner or entity authorized by\n+ the copyright owner that is granting the License.\n+\n+ \"Legal Entity\" shall mean the union of the acting entity and all\n+ other entities that control, are controlled by, or are under common\n+ control with that entity. For the purposes of this definition,\n+ \"control\" means (i) the power, direct or indirect, to cause the\n+ direction or management of such entity, whether by contract or\n+ otherwise, or (ii) ownership of fifty percent (50%) or more of the\n+ outstanding shares, or (iii) beneficial ownership of such entity.\n+\n+ \"You\" (or \"Your\") shall mean an individual or Legal Entity\n+ exercising permissions granted by this License.\n+\n+ \"Source\" form shall mean the preferred form for making modifications,\n+ including but not limited to software source code, documentation\n+ source, and configuration files.\n+\n+ \"Object\" form shall mean any form resulting from mechanical\n+ transformation or translation of a Source form, including but\n+ not limited to compiled object code, generated documentation,\n+ and conversions to other media types.\n+\n+ \"Work\" shall mean the work of authorship, whether in Source or\n+ Object form, made available under the License, as indicated by a\n+ copyright notice that is included in or attached to the work\n+ (an example is provided in the Appendix below).\n+\n+ \"Derivative Works\" shall mean any work, whether in Source or Object\n+ form, that is based on (or derived from) the Work and for which the\n+ editorial revisions, annotations, elaborations, or other modifications\n+ represent, as a whole, an original work of authorship. For the purposes\n+ of this License, Derivative Works shall not include works that remain\n+ separable from, or merely link (or bind by name) to the interfaces of,\n+ the Work and Derivative Works thereof.\n+\n+ \"Contribution\" shall mean any work of authorship, including\n+ the original version of the Work and any modifications or additions\n+ to that Work or Derivative Works thereof, that is intentionally\n+ submitted to Licensor for inclusion in the Work by the copyright owner\n+ or by an individual or Legal Entity authorized to submit on behalf of\n+ the copyright owner. For the purposes of this definition, \"submitted\"\n+ means any form of electronic, verbal, or written communication sent\n+ to the Licensor or its representatives, including but not limited to\n+ communication on electronic mailing lists, source code control systems,\n+ and issue tracking systems that are managed by, or on behalf of, the\n+ Licensor for the purpose of discussing and improving the Work, but\n+ excluding communication that is conspicuously marked or otherwise\n+ designated in writing by the copyright owner as \"Not a Contribution.\"\n+\n+ \"Contributor\" shall mean Licensor and any individual or Legal Entity\n+ on behalf of whom a Contribution has been received by Licensor and\n+ subsequently incorporated within the Work.\n+\n+ 2. Grant of Copyright License. Subject to the terms and conditions of\n+ this License, each Contributor hereby grants to You a perpetual,\n+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n+ copyright license to reproduce, prepare Derivative Works of,\n+ publicly display, publicly perform, sublicense, and distribute the\n+ Work and such Derivative Works in Source or Object form.\n+\n+ 3. Grant of Patent License. Subject to the terms and conditions of\n+ this License, each Contributor hereby grants to You a perpetual,\n+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n+ (except as stated in this section) patent license to make, have made,\n+ use, offer to sell, sell, import, and otherwise transfer the Work,\n+ where such license applies only to those patent claims licensable\n+ by such Contributor that are necessarily infringed by their\n+ Contribution(s) alone or by combination of their Contribution(s)\n+ with the Work to which such Contribution(s) was submitted. If You\n+ institute patent litigation against any entity (including a\n+ cross-claim or counterclaim in a lawsuit) alleging that the Work\n+ or a Contribution incorporated within the Work constitutes direct\n+ or contributory patent infringement, then any patent licenses\n+ granted to You under this License for that Work shall terminate\n+ as of the date such litigation is filed.\n+\n+ 4. Redistribution. You may reproduce and distribute copies of the\n+ Work or Derivative Works thereof in any medium, with or without\n+ modifications, and in Source or Object form, provided that You\n+ meet the following conditions:\n+\n+ (a) You must give any other recipients of the Work or\n+ Derivative Works a copy of this License; and\n+\n+ (b) You must cause any modified files to carry prominent notices\n+ stating that You changed the files; and\n+\n+ (c) You must retain, in the Source form of any Derivative Works\n+ that You distribute, all copyright, patent, trademark, and\n+ attribution notices from the Source form of the Work,\n+ excluding those notices that do not pertain to any part of\n+ the Derivative Works; and\n+\n+ (d) If the Work includes a \"NOTICE\" text file as part of its\n+ distribution, then any Derivative Works that You distribute must\n+ include a readable copy of the attribution notices contained\n+ within such NOTICE file, excluding those notices that do not\n+ pertain to any part of the Derivative Works, in at least one\n+ of the following places: within a NOTICE text file distributed\n+ as part of the Derivative Works; within the Source form or\n+ documentation, if provided along with the Derivative Works; or,\n+ within a display generated by the Derivative Works, if and\n+ wherever such third-party notices normally appear. The contents\n+ of the NOTICE file are for informational purposes only and\n+ do not modify the License. You may add Your own attribution\n+ notices within Derivative Works that You distribute, alongside\n+ or as an addendum to the NOTICE text from the Work, provided\n+ that such additional attribution notices cannot be construed\n+ as modifying the License.\n+\n+ You may add Your own copyright statement to Your modifications and\n+ may provide additional or different license terms and conditions\n+ for use, reproduction, or distribution of Your modifications, or\n+ for any such Derivative Works as a whole, provided Your use,\n+ reproduction, and distribution of the Work otherwise complies with\n+ the conditions stated in this License.\n+\n+ 5. Submission of Contributions. Unless You explicitly state otherwise,\n+ any Contribution intentionally submitted for inclusion in the Work\n+ by You to the Licensor shall be under the terms and conditions of\n+ this License, without any additional terms or conditions.\n+ Notwithstanding the above, nothing herein shall supersede or modify\n+ the terms of any separate license agreement you may have executed\n+ with Licensor regarding such Contributions.\n+\n+ 6. Trademarks. This License does not grant permission to use the trade\n+ names, trademarks, service marks, or product names of the Licensor,\n+ except as required for reasonable and customary use in describing the\n+ origin of the Work and reproducing the content of the NOTICE file.\n+\n+ 7. Disclaimer of Warranty. Unless required by applicable law or\n+ agreed to in writing, Licensor provides the Work (and each\n+ Contributor provides its Contributions) on an \"AS IS\" BASIS,\n+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n+ implied, including, without limitation, any warranties or conditions\n+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n+ PARTICULAR PURPOSE. You are solely responsible for determining the\n+ appropriateness of using or redistributing the Work and assume any\n+ risks associated with Your exercise of permissions under this License.\n+\n+ 8. Limitation of Liability. In no event and under no legal theory,\n+ whether in tort (including negligence), contract, or otherwise,\n+ unless required by applicable law (such as deliberate and grossly\n+ negligent acts) or agreed to in writing, shall any Contributor be\n+ liable to You for damages, including any direct, indirect, special,\n+ incidental, or consequential damages of any character arising as a\n+ result of this License or out of the use or inability to use the\n+ Work (including but not limited to damages for loss of goodwill,\n+ work stoppage, computer failure or malfunction, or any and all\n+ other commercial damages or losses), even if such Contributor\n+ has been advised of the possibility of such damages.\n+\n+ 9. Accepting Warranty or Additional Liability. While redistributing\n+ the Work or Derivative Works thereof, You may choose to offer,\n+ and charge a fee for, acceptance of support, warranty, indemnity,\n+ or other liability obligations and/or rights consistent with this\n+ License. However, in accepting such obligations, You may act only\n+ on Your own behalf and on Your sole responsibility, not on behalf\n+ of any other Contributor, and only if You agree to indemnify,\n+ defend, and hold each Contributor harmless for any liability\n+ incurred by, or claims asserted against, such Contributor by reason\n+ of your accepting any such warranty or additional liability.\n+\n+ END OF TERMS AND CONDITIONS\n+\n+ APPENDIX: How to apply the Apache License to your work.\n+\n+ To apply the Apache License to your work, attach the following\n+ boilerplate notice, with the fields enclosed by brackets \"{}\"\n+ replaced with your own identifying information. (Don't include\n+ the brackets!) The text should be enclosed in the appropriate\n+ comment syntax for the file format. We also recommend that a\n+ file or class name and description of purpose be included on the\n+ same \"printed page\" as the copyright notice for easier\n+ identification within third-party archives.\n+\n+ Copyright {yyyy} {name of copyright owner}\n+\n+ Licensed under the Apache License, Version 2.0 (the \"License\");\n+ you may not use this file except in compliance with the License.\n+ You may obtain a copy of the License at\n+\n+ http://www.apache.org/licenses/LICENSE-2.0\n+\n+ Unless required by applicable law or agreed to in writing, software\n+ distributed under the License is distributed on an \"AS IS\" BASIS,\n+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ See the License for the specific language governing permissions and\n+ limitations under the License.\n",
"new_path": "packages/resolve-map/LICENSE",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+# @thi.ng/resolve-map\n+\n+[](https://www.npmjs.com/package/@thi.ng/resolve-map)\n+\n+## About\n+\n+DAG resolution of vanilla objects & arrays with internally linked\n+values.\n+\n+It's common practice to use nested JS objects for configuration\n+purposes. Frequently some values in the object are copies or\n+derivatives of other values, which can lead to mistakes during\n+refactoring and/or duplication of effort.\n+\n+To avoid these issues, this library provides the ability to define\n+single sources of truth, create references (links) to these values and a\n+provide a resolution mechanism to recursively expand their real values\n+and/or compute derived values. Both absolute & relative references are\n+supported.\n+\n+See\n+[source](https://github.com/thi-ng/umbrella/tree/master/packages/resolve-map/src/index.ts#L8)\n+&\n+[tests](https://github.com/thi-ng/umbrella/tree/master/packages/resolve-map/tests/index.ts)\n+for further details.\n+\n+## Installation\n+\n+```\n+yarn add @thi.ng/resolve-map\n+```\n+\n+## Usage examples\n+\n+```typescript\n+import { resolveMap } from \"@thi.ng/resolve-map\";\n+\n+resolveMap({\n+ colors: {\n+ bg: \"white\",\n+ text: \"black\",\n+ selected: \"red\",\n+ },\n+ main: {\n+ fontsizes: [12, 16, 20]\n+ },\n+ button: {\n+ bg: \"->/colors.text\",\n+ label: \"->/colors.bg\",\n+ fontsize: (resolve) => `${resolve(\"main.fontsizes.0\")}px`,\n+ },\n+ buttonPrimary: {\n+ bg: \"->/colors.selected\",\n+ label: \"->/button.label\",\n+ fontsize: (resolve) => `${resolve(\"main.fontsizes.2\")}px`,\n+ }\n+})\n+// {\n+// colors: {\n+// bg: \"white\",\n+// text: \"black\",\n+// selected: \"red\"\n+// },\n+// main: {\n+// fontsizes: [ 12, 16, 20 ]\n+// },\n+// button: {\n+// \"bg\": \"black\",\n+// \"label\": \"white\",\n+// \"fontsize\": \"12px\"\n+// },\n+// buttonPrimary: {\n+// bg: \"red\",\n+// label: \"black\",\n+// fontsize: \"20px\"\n+// }\n+// }\n+```\n+\n+## Authors\n+\n+- Karsten Schmidt\n+\n+## License\n+\n+© 2018 Karsten Schmidt // Apache Software License 2.0\n",
"new_path": "packages/resolve-map/README.md",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"@thi.ng/resolve-map\",\n+ \"version\": \"0.0.1\",\n+ \"description\": \"DAG resolution of vanilla objects & arrays with internally linked values\",\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 run clean && tsc --declaration\",\n+ \"clean\": \"rm -rf *.js *.d.ts build doc\",\n+ \"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n+ \"pub\": \"yarn run build && yarn publish --access public\",\n+ \"test\": \"rm -rf build && tsc -p test && 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+ \"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/checks\": \"^1.3.0\",\n+ \"@thi.ng/paths\": \"^1.0.0\"\n+ },\n+ \"keywords\": [\n+ \"configuration\",\n+ \"data structure\",\n+ \"ES6\",\n+ \"DAG\",\n+ \"graph\",\n+ \"JSON\",\n+ \"typescript\"\n+ ],\n+ \"publishConfig\": {\n+ \"access\": \"public\"\n+ }\n+}\n\\ No newline at end of file\n",
"new_path": "packages/resolve-map/package.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { Path, getIn, toPath } from \"@thi.ng/paths\";\n+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 { isString } from \"@thi.ng/checks/is-string\";\n+\n+/**\n+ * Visits all key-value pairs in depth-first order for given object and\n+ * expands any reference values. Cyclic references are not allowed or\n+ * checked for and if present will cause a stack overflow error.\n+ * However, refs pointing to other refs are recursively resolved (again,\n+ * provided there are no cycles).\n+ *\n+ * Reference values are special strings representing lookup paths of\n+ * other values in the object and are prefixed with `->` for relative\n+ * refs or `->/` for absolute refs. Relative refs are resolved from\n+ * currently visited object and only support child access (no\n+ * ancestors). Absolute refs are resolved from root level (the original\n+ * object passed to this function).\n+ *\n+ * ```\n+ * resolveMap({a: 1, b: {c: \"->d\", d: \"->/a\"} })\n+ * // { a: 1, b: { c: 1, d: 1 } }\n+ * ```\n+ *\n+ * If a value is a function, it is called with a single arg `resolve`, a\n+ * function which accepts an *absolute* path to look up other values.\n+ * The return value of the (value) function is used as final value for\n+ * that key. This mechanism can be used to compute derived values of\n+ * other values stored in the object.\n+ *\n+ * ```\n+ * // the value of `a` is derived from 1st array element in `b.d`\n+ * resolveMap({\n+ * a: (resolve) => resolve(\"b.c\") * 10,\n+ * b: { c: \"->d.0\", d: [2, 3] }\n+ * })\n+ * // { a: 20, b: { c: 2, d: [ 2, 3 ] } }\n+ * ```\n+ *\n+ * The function mutates the original object and returns it. User code\n+ * should never provide the optional `root` arg (only used for internal\n+ * recursion purposes).\n+ *\n+ * @param obj\n+ * @param root\n+ */\n+export function resolveMap(obj: any, root?: any) {\n+ for (let k in obj) {\n+ obj[k] = _resolve(k, obj, root);\n+ }\n+ return obj;\n+}\n+\n+/**\n+ * Same as `resolveMap`, but for arrays.\n+ *\n+ * @param arr\n+ * @param root\n+ */\n+export function resolveArray(arr: any[], root?: any) {\n+ for (let i = 0, n = arr.length; i < n; i++) {\n+ arr[i] = _resolve(i, arr, root);\n+ }\n+ return arr;\n+}\n+\n+function _resolve(k: Path, obj: any, root?: any, makeAbs = false) {\n+ root = root || obj;\n+ const v = getIn(obj, k);\n+ if (isString(v) && v.indexOf(\"->\") === 0) {\n+ if (v.charAt(2) === \"/\") {\n+ return _resolve(v.substr(3), root, root);\n+ } else {\n+ if (makeAbs) {\n+ const path = toPath(k);\n+ return _resolve([...path.slice(0, path.length - 1), ...toPath(v.substr(2))], root);\n+ }\n+ return _resolve(v.substr(2), obj, root);\n+ }\n+ } else if (isPlainObject(v)) {\n+ return resolveMap(v, root);\n+ } else if (isArray(v)) {\n+ return resolveArray(v, root);\n+ } else if (isFunction(v)) {\n+ return v((x) => _resolve(x, root, root, true));\n+ } else {\n+ return v;\n+ }\n+}\n",
"new_path": "packages/resolve-map/src/index.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import * as assert from \"assert\";\n+import { resolveMap } from \"../src/index\";\n+\n+describe(\"resolve-map\", () => {\n+\n+ it(\"simple\", () => {\n+ assert.deepEqual(\n+ resolveMap({ a: 1, b: \"->a\" }),\n+ { a: 1, b: 1 }\n+ );\n+ });\n+\n+ it(\"linked refs\", () => {\n+ assert.deepEqual(\n+ resolveMap({ a: \"->c\", b: \"->a\", c: 1 }),\n+ { a: 1, b: 1, c: 1 }\n+ );\n+ });\n+\n+ it(\"array refs\", () => {\n+ assert.deepEqual(\n+ resolveMap({ a: \"->c.1\", b: \"->a\", c: [1, 2] }),\n+ { a: 2, b: 2, c: [1, 2] }\n+ );\n+ });\n+\n+ it(\"abs vs rel refs\", () => {\n+ assert.deepEqual(\n+ resolveMap({ a1: { b: 1, c: \"->b\" }, a2: { b: 2, c: \"->b\" }, a3: { b: 3, c: \"->/a1.b\" } }),\n+ { a1: { b: 1, c: 1 }, a2: { b: 2, c: 2 }, a3: { b: 3, c: 1 } }\n+ );\n+ });\n+\n+ it(\"cycles\", () => {\n+ assert.throws(() => resolveMap({ a: \"->a\" }));\n+ assert.throws(() => resolveMap({ a: { b: \"->b\" } }));\n+ assert.throws(() => resolveMap({ a: { b: \"->/a.b\" } }));\n+ assert.throws(() => resolveMap({ a: \"->b\", b: \"->a\" }));\n+ });\n+\n+ it(\"function refs\", () => {\n+ assert.deepEqual(\n+ resolveMap({ a: (x) => x(\"b.c\") * 10, b: { c: \"->d\", d: \"->/e\" }, e: () => 1 }),\n+ { a: 10, b: { c: 1, d: 1 }, e: 1 }\n+ );\n+ });\n+});\n",
"new_path": "packages/resolve-map/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",
"new_path": "packages/resolve-map/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/resolve-map/tsconfig.json",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(resolve-map): add @thi.ng/resolve-map package
| 1
|
feat
|
resolve-map
|
679,913
|
17.03.2018 23:10:07
| 0
|
d34bd146c43c360fecb8f2ea2eb3cb326064fa28
|
build: update make-module script (deps)
|
[
{
"change_type": "MODIFY",
"diff": "@@ -15,13 +15,11 @@ cp packages/api/LICENSE $MODULE/\necho \"writing test skeleton...\"\ncat << EOF > $MODULE/test/index.ts\n-import * as assert from \"assert\";\n-import * as $1 from \"../src/index\";\n+// import * as assert from \"assert\";\n+// import * as $1 from \"../src/index\";\n-describe(\"$1\", function() {\n- it(\"feature\", () => {\n- assert(false, \"TODO\");\n- });\n+describe(\"$1\", () => {\n+ it(\"tests pending\");\n});\nEOF\n@@ -44,16 +42,16 @@ cat << EOF > $MODULE/package.json\n\"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n},\n\"devDependencies\": {\n- \"@types/mocha\": \"^2.2.46\",\n- \"@types/node\": \"^9.3.0\",\n+ \"@types/mocha\": \"^2.2.48\",\n+ \"@types/node\": \"^9.4.6\",\n\"mocha\": \"^5.0.0\",\n- \"ts-loader\": \"^3.3.1\",\n+ \"ts-loader\": \"^3.5.0\",\n\"typedoc\": \"^0.10.0\",\n- \"typescript\": \"^2.7.1\",\n- \"webpack\": \"^3.10.0\"\n+ \"typescript\": \"^2.7.2\",\n+ \"webpack\": \"^3.11.0\"\n},\n\"dependencies\": {\n- \"@thi.ng/api\": \"^1.5.0\"\n+ \"@thi.ng/api\": \"^2.0.4\"\n},\n\"keywords\": [\n\"ES6\",\n",
"new_path": "scripts/make-module",
"old_path": "scripts/make-module"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
build: update make-module script (deps)
| 1
|
build
| null |
679,913
|
17.03.2018 23:47:14
| 0
|
8281609c11a5197d8c2b25439b3467f4221fb7da
|
minor(atom): fix typo in package
|
[
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@thi.ng/atom\",\n\"version\": \"1.0.0\",\n- \"description\": \"Mutable wrapper for a immutable values\",\n+ \"description\": \"Mutable wrapper for immutable values\",\n\"main\": \"./index.js\",\n\"typings\": \"./index.d.ts\",\n\"repository\": \"https://github.com/thi-ng/umbrella\",\n",
"new_path": "packages/atom/package.json",
"old_path": "packages/atom/package.json"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
minor(atom): fix typo in package
| 1
|
minor
|
atom
|
679,913
|
17.03.2018 23:50:44
| 0
|
1e7ef2b63f12a75bc27d799ad31f9065f9cdd997
|
build: fix atom deps in downstream packages
|
[
{
"change_type": "MODIFY",
"diff": "\"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n},\n\"devDependencies\": {\n- \"@thi.ng/atom\": \"^0.13.0\",\n+ \"@thi.ng/atom\": \"^1.0.0\",\n\"@types/mocha\": \"^2.2.48\",\n\"@types/node\": \"^9.4.6\",\n\"mocha\": \"^5.0.0\",\n",
"new_path": "packages/hdom/package.json",
"old_path": "packages/hdom/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n},\n\"devDependencies\": {\n- \"@thi.ng/atom\": \"^0.13.0\",\n+ \"@thi.ng/atom\": \"^1.0.0\",\n\"@types/mocha\": \"^2.2.48\",\n\"@types/node\": \"^9.4.6\",\n\"mocha\": \"^5.0.0\",\n",
"new_path": "packages/hiccup/package.json",
"old_path": "packages/hiccup/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"webpack\": \"^3.11.0\"\n},\n\"dependencies\": {\n- \"@thi.ng/atom\": \"^0.13.0\",\n+ \"@thi.ng/atom\": \"^1.0.0\",\n\"@thi.ng/paths\": \"^1.0.0\"\n},\n\"keywords\": [\n",
"new_path": "packages/interceptors/package.json",
"old_path": "packages/interceptors/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"webpack\": \"^3.11.0\"\n},\n\"dependencies\": {\n- \"@thi.ng/atom\": \"^0.13.0\",\n+ \"@thi.ng/atom\": \"^1.0.0\",\n\"@thi.ng/transducers\": \"^1.6.2\"\n},\n\"keywords\": [\n",
"new_path": "packages/rstream/package.json",
"old_path": "packages/rstream/package.json"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
build: fix atom deps in downstream packages
| 1
|
build
| null |
807,849
|
18.03.2018 08:52:47
| 25,200
|
89f9d3b4acb029bf4e21fa7b49f0fd90876bfe04
|
fix(clean-stack): Try to avoid causing errors during error cleanup
|
[
{
"change_type": "MODIFY",
"diff": "module.exports = cleanStack;\nfunction cleanStack(err, className) {\n- const lines = err.stack ? err.stack.split(\"\\n\") : err.split(\"\\n\");\n+ const lines = err.stack ? err.stack.split(\"\\n\") : String(err).split(\"\\n\");\nconst cutoff = new RegExp(`^ at ${className}.runCommand .*$`);\nconst relevantIndex = lines.findIndex(line => cutoff.test(line));\n+ if (relevantIndex) {\nreturn lines.slice(0, relevantIndex).join(\"\\n\");\n}\n+\n+ // nothing matched, just return original error\n+ return err;\n+}\n",
"new_path": "core/command/lib/clean-stack.js",
"old_path": "core/command/lib/clean-stack.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
fix(clean-stack): Try to avoid causing errors during error cleanup
| 1
|
fix
|
clean-stack
|
807,849
|
18.03.2018 09:16:01
| 25,200
|
ed5d2ba9f5503b0a986c755467887a82388efefa
|
test(windows): Avoid uncaught mocked rejection
|
[
{
"change_type": "MODIFY",
"diff": "@@ -12,9 +12,11 @@ const createSymlink = require(\"..\");\nconst linkRelative = (from, to) => path.relative(path.dirname(to), from);\ndescribe(\"create-symlink\", () => {\n- fs.lstat.mockRejectedValue(\"ENOENT\");\n+ fs.lstat.mockImplementation(() => Promise.reject(new Error(\"MOCK\")));\nfs.unlink.mockResolvedValue();\nfs.symlink.mockResolvedValue();\n+ // cmdShim is a traditional errback\n+ cmdShim.mockImplementation(callsBack());\nif (process.platform !== \"win32\") {\nit(\"creates relative symlink to a directory\", async () => {\n@@ -44,7 +46,7 @@ describe(\"create-symlink\", () => {\nconst dst = path.resolve(\"./packages/package-1/node_modules/package-2\");\nconst type = \"junction\"; // even in posix environments :P\n- fs.lstat.mockResolvedValueOnce(); // something _does_ exist at destination\n+ fs.lstat.mockImplementationOnce(() => Promise.resolve()); // something _does_ exist at destination\nawait createSymlink(src, dst, type);\n@@ -57,21 +59,28 @@ describe(\"create-symlink\", () => {\nconst dst = path.resolve(\"./packages/package-1/node_modules/.bin/package-2\");\nconst type = \"exec\";\n- // cmdShim is a traditional errback\n- cmdShim.mockImplementationOnce(callsBack());\n-\nawait createSymlink(src, dst, type);\nexpect(fs.lstat).not.toBeCalled();\nexpect(cmdShim).lastCalledWith(src, dst, expect.any(Function));\n});\n+ it(\"rejects when cmd-shim errors\", async () => {\n+ cmdShim.mockImplementationOnce(callsBack(new Error(\"yikes\")));\n+\n+ try {\n+ await createSymlink(\"src\", \"dst\", \"exec\");\n+ } catch (err) {\n+ expect(err.message).toBe(\"yikes\");\n+ }\n+ });\n+\nit(\"always uses absolute paths when creating symlinks\", async () => {\nconst src = path.resolve(\"./packages/package-2\");\nconst dst = path.resolve(\"./packages/package-1/node_modules/package-2\");\nconst type = \"junction\"; // only _actually_ matters in windows\n- fs.lstat.mockResolvedValueOnce(); // something _does_ exist at destination\n+ fs.lstat.mockImplementationOnce(() => Promise.resolve()); // something _does_ exist at destination\nawait createSymlink(src, dst, type);\n",
"new_path": "utils/create-symlink/__tests__/create-symlink.test.js",
"old_path": "utils/create-symlink/__tests__/create-symlink.test.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
test(windows): Avoid uncaught mocked rejection
| 1
|
test
|
windows
|
679,913
|
18.03.2018 12:13:31
| 0
|
2376e02f8a884be1acbb0578e662bff489fe1b2f
|
build: fix changelogs for atom/interceptors/paths
|
[
{
"change_type": "MODIFY",
"diff": "@@ -11,6 +11,22 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline\n**Note:** Version bump only for package @thi.ng/atom\n+<a name=\"1.0.0\"></a>\n+# 1.0.0 (2018-03-17)\n+\n+\n+### Documentation\n+\n+* **atom:** extract @thi.ng/paths & @thi.ng/interceptors functionality ([1273efb](https://github.com/thi-ng/umbrella/commit/1273efb))\n+\n+\n+### BREAKING CHANGES\n+\n+* **atom:** extract @thi.ng/paths & @thi.ng/interceptors functionality\n+\n+\n+\n+\n<a name=\"0.13.0\"></a>\n# [0.13.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/atom@0.12.1...@thi.ng/atom@0.13.0) (2018-03-16)\n",
"new_path": "packages/atom/CHANGELOG.md",
"old_path": "packages/atom/CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -10,3 +10,14 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline\n**Note:** Version bump only for package @thi.ng/interceptors\n+\n+\n+\n+\n+<a name=\"1.0.0\"></a>\n+# 1.0.0 (2018-03-17)\n+\n+\n+### Documentation\n+\n+* **interceptors:** add/extract @thi.ng/interceptors package from @th.ng/atom ([195a6ff](https://github.com/thi-ng/umbrella/commit/195a6ff))\n\\ No newline at end of file\n",
"new_path": "packages/interceptors/CHANGELOG.md",
"old_path": "packages/interceptors/CHANGELOG.md"
},
{
"change_type": "ADD",
"diff": "+# Change Log\n+\n+All notable changes to this project will be documented in this file.\n+See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n+\n+<a name=\"1.0.0\"></a>\n+# 1.0.0 (2018-03-17)\n+\n+\n+### Documentation\n+\n+* **paths:** add/extract @thi.ng/paths from @thi.ng/atom ([f9f6eb1](https://github.com/thi-ng/umbrella/commit/f9f6eb1))\n\\ No newline at end of file\n",
"new_path": "packages/paths/CHANGELOG.md",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
build: fix changelogs for atom/interceptors/paths
| 1
|
build
| null |
679,913
|
18.03.2018 14:15:18
| 0
|
92f0e27ed62e28256c4b29314287b35da66f045b
|
fix(paths): fix setIn fast paths for path length 3/4
|
[
{
"change_type": "MODIFY",
"diff": "@@ -136,7 +136,6 @@ export function getter(path: Path) {\n*/\nexport function setter(path: Path) {\nconst ks = toPath(path);\n- // (s, v) => ({ ...s, [k]: f((s || {})[k], v) });\nlet [a, b, c, d] = ks;\nswitch (ks.length) {\ncase 0:\n@@ -146,9 +145,9 @@ export function setter(path: Path) {\ncase 2:\nreturn (s, v) => ({ ...s, [a]: { ...s[a], [b]: v } });\ncase 3:\n- return (s, v) => ({ ...s, [a]: { ...s[a], [b]: { ...s[b], [c]: v } } });\n+ return (s, v) => ({ ...s, [a]: { ...(s = s[a]), [b]: { ...s[b], [c]: v } } });\ncase 4:\n- return (s, v) => ({ ...s, [a]: { ...s[a], [b]: { ...s[b], [c]: { ...s[c], [d]: v } } } });\n+ return (s, v) => ({ ...s, [a]: { ...(s = s[a]), [b]: { ...(s = s[b]), [c]: { ...s[c], [d]: v } } } });\ndefault:\nconst kl = ks[ks.length - 1];\nlet f = (s, v) => ({ ...(s || {}), [kl]: v });\n",
"new_path": "packages/paths/src/index.ts",
"old_path": "packages/paths/src/index.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
fix(paths): fix setIn fast paths for path length 3/4
| 1
|
fix
|
paths
|
679,913
|
18.03.2018 16:17:06
| 0
|
eaeccf471a4410b0165b1e7f2c429cc707b791a4
|
fix(paths): fix setter fast paths
|
[
{
"change_type": "MODIFY",
"diff": "@@ -143,11 +143,11 @@ export function setter(path: Path) {\ncase 1:\nreturn (s, v) => ({ ...s, [a]: v });\ncase 2:\n- return (s, v) => ({ ...s, [a]: { ...s[a], [b]: v } });\n+ return (s, v) => ({ ...(s = s || {}), [a]: { ...s[a], [b]: v } });\ncase 3:\n- return (s, v) => ({ ...s, [a]: { ...(s = s[a]), [b]: { ...s[b], [c]: v } } });\n+ return (s, v) => ({ ...(s = s || {}), [a]: { ...(s = s[a] || {}), [b]: { ...s[b], [c]: v } } });\ncase 4:\n- return (s, v) => ({ ...s, [a]: { ...(s = s[a]), [b]: { ...(s = s[b]), [c]: { ...s[c], [d]: v } } } });\n+ return (s, v) => ({ ...(s = s || {}), [a]: { ...(s = s[a] || {}), [b]: { ...(s = s[b] || {}), [c]: { ...s[c], [d]: v } } } });\ndefault:\nconst kl = ks[ks.length - 1];\nlet f = (s, v) => ({ ...(s || {}), [kl]: v });\n",
"new_path": "packages/paths/src/index.ts",
"old_path": "packages/paths/src/index.ts"
},
{
"change_type": "MODIFY",
"diff": "-// import * as assert from \"assert\";\n-// import * as paths from \"../src/index\";\n+import * as assert from \"assert\";\n+import { setIn } from \"../src/index\";\ndescribe(\"paths\", () => {\n- it(\"tests pending\");\n+ it(\"setIn (len = 0)\", () => {\n+ assert.deepEqual(\n+ setIn({ a: { b: { c: 23 } } }, \"\", 1),\n+ 1\n+ );\n+ assert.deepEqual(\n+ setIn({ a: { b: { c: 23 } } }, [], 1),\n+ 1\n+ );\n+ assert.deepEqual(\n+ setIn(null, [], 1),\n+ 1\n+ );\n+ });\n+\n+ it(\"setIn (len = 1)\", () => {\n+ assert.deepEqual(\n+ setIn({ a: { b: { c: 23 } } }, \"a\", 24),\n+ { a: 24 }\n+ );\n+ assert.deepEqual(\n+ setIn({ a: { b: { c: 23 } } }, \"d\", 24),\n+ { a: { b: { c: 23 } }, d: 24 }\n+ );\n+ assert.deepEqual(\n+ setIn({ x: 23 }, \"a\", 24),\n+ { x: 23, a: 24 }\n+ );\n+ assert.deepEqual(\n+ setIn(null, \"a\", 24),\n+ { a: 24 }\n+ );\n+ });\n+\n+ it(\"setIn (len = 2)\", () => {\n+ assert.deepEqual(\n+ setIn({ a: { b: { c: 23 } } }, \"a.b\", 24),\n+ { a: { b: 24 } }\n+ );\n+ assert.deepEqual(\n+ setIn({ a: { b: { c: 23 } } }, \"a.d\", 24),\n+ { a: { b: { c: 23 }, d: 24 } }\n+ );\n+ assert.deepEqual(\n+ setIn({ x: 23 }, \"a.b\", 24),\n+ { x: 23, a: { b: 24 } }\n+ );\n+ assert.deepEqual(\n+ setIn(null, \"a.b\", 24),\n+ { a: { b: 24 } }\n+ );\n+ });\n+\n+ it(\"setIn (len = 3)\", () => {\n+ assert.deepEqual(\n+ setIn({ a: { b: { c: 23 } } }, \"a.b.c\", 24),\n+ { a: { b: { c: 24 } } }\n+ );\n+ assert.deepEqual(\n+ setIn({ a: { b: { c: 23 } } }, \"a.b.d\", 24),\n+ { a: { b: { c: 23, d: 24 } } }\n+ );\n+ assert.deepEqual(\n+ setIn({ x: 23 }, \"a.b.c\", 24),\n+ { x: 23, a: { b: { c: 24 } } }\n+ );\n+ assert.deepEqual(\n+ setIn(null, \"a.b.c\", 24),\n+ { a: { b: { c: 24 } } }\n+ );\n+ });\n+\n+ it(\"setIn (len = 4)\", () => {\n+ assert.deepEqual(\n+ setIn({ a: { b: { c: { d: 23 } } } }, \"a.b.c.d\", 24),\n+ { a: { b: { c: { d: 24 } } } }\n+ );\n+ assert.deepEqual(\n+ setIn({ a: { b: { c: 23 } } }, \"a.b.d.e\", 24),\n+ { a: { b: { c: 23, d: { e: 24 } } } }\n+ );\n+ assert.deepEqual(\n+ setIn({ x: 23 }, \"a.b.c.d\", 24),\n+ { x: 23, a: { b: { c: { d: 24 } } } }\n+ );\n+ assert.deepEqual(\n+ setIn(null, \"a.b.c.d\", 24),\n+ { a: { b: { c: { d: 24 } } } }\n+ );\n+ });\n+\n+ it(\"immutable\", () => {\n+ const a = { x: { y: { z: 1 } }, u: { v: 2 } };\n+ const b = setIn(a, \"a.b.c\", 3);\n+ assert.deepEqual(\n+ b,\n+ { x: { y: { z: 1 } }, u: { v: 2 }, a: { b: { c: 3 } } }\n+ );\n+ assert.deepEqual(\n+ a,\n+ { x: { y: { z: 1 } }, u: { v: 2 } }\n+ );\n+ assert(a.x === b.x);\n+ assert(a.x.y === b.x.y);\n+ assert(a.u === b.u);\n+ });\n});\n",
"new_path": "packages/paths/test/index.ts",
"old_path": "packages/paths/test/index.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
fix(paths): fix setter fast paths
| 1
|
fix
|
paths
|
679,913
|
18.03.2018 16:25:51
| 0
|
f295a47531f69842eee0827fe95b1f172c2ae2db
|
build(examples): update all deps to use "latest"
|
[
{
"change_type": "MODIFY",
"diff": "\"webpack\": \"^3.10.0\"\n},\n\"dependencies\": {\n- \"@thi.ng/api\": \"^2.0.4\",\n- \"@thi.ng/atom\": \"^1.0.1\",\n- \"@thi.ng/hdom\": \"^2.2.0\",\n- \"@thi.ng/interceptors\": \"^1.0.1\"\n+ \"@thi.ng/api\": \"latest\",\n+ \"@thi.ng/atom\": \"latest\",\n+ \"@thi.ng/hdom\": \"latest\",\n+ \"@thi.ng/interceptors\": \"latest\"\n}\n}\n\\ No newline at end of file\n",
"new_path": "examples/async-effect/package.json",
"old_path": "examples/async-effect/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"webpack\": \"^3.11.0\"\n},\n\"dependencies\": {\n- \"@thi.ng/api\": \"^2.0.4\",\n- \"@thi.ng/hdom\": \"^2.2.0\",\n- \"@thi.ng/hdom-components\": \"^1.0.4\",\n- \"@thi.ng/transducers\": \"^1.6.2\"\n+ \"@thi.ng/api\": \"latest\",\n+ \"@thi.ng/hdom\": \"latest\",\n+ \"@thi.ng/hdom-components\": \"latest\",\n+ \"@thi.ng/transducers\": \"latest\"\n}\n}\n\\ No newline at end of file\n",
"new_path": "examples/cellular-automata/package.json",
"old_path": "examples/cellular-automata/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"webpack\": \"^3.11.0\"\n},\n\"dependencies\": {\n- \"@thi.ng/hdom\": \"^2.2.0\"\n+ \"@thi.ng/hdom\": \"latest\"\n}\n}\n\\ No newline at end of file\n",
"new_path": "examples/dashboard/package.json",
"old_path": "examples/dashboard/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"webpack\": \"^3.10.0\"\n},\n\"dependencies\": {\n- \"@thi.ng/api\": \"^2.0.4\",\n- \"@thi.ng/atom\": \"^1.0.1\",\n- \"@thi.ng/hdom\": \"^2.2.0\"\n+ \"@thi.ng/api\": \"latest\",\n+ \"@thi.ng/atom\": \"latest\",\n+ \"@thi.ng/hdom\": \"latest\"\n}\n}\n\\ No newline at end of file\n",
"new_path": "examples/devcards/package.json",
"old_path": "examples/devcards/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"webpack\": \"^3.11.0\"\n},\n\"dependencies\": {\n- \"@thi.ng/hdom\": \"^2.2.0\"\n+ \"@thi.ng/hdom\": \"latest\"\n}\n}\n\\ No newline at end of file\n",
"new_path": "examples/hdom-basics/package.json",
"old_path": "examples/hdom-basics/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"webpack\": \"^3.11.0\"\n},\n\"dependencies\": {\n- \"@thi.ng/api\": \"^2.0.4\",\n- \"@thi.ng/hdom\": \"^2.2.0\",\n- \"@thi.ng/rstream\": \"^1.0.18\",\n- \"@thi.ng/transducers\": \"^1.6.2\"\n+ \"@thi.ng/api\": \"latest\",\n+ \"@thi.ng/hdom\": \"latest\",\n+ \"@thi.ng/rstream\": \"latest\",\n+ \"@thi.ng/transducers\": \"latest\"\n}\n}\n\\ No newline at end of file\n",
"new_path": "examples/hdom-benchmark/package.json",
"old_path": "examples/hdom-benchmark/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"webpack\": \"^3.11.0\"\n},\n\"dependencies\": {\n- \"@thi.ng/api\": \"^2.0.4\",\n- \"@thi.ng/atom\": \"^1.0.1\",\n- \"@thi.ng/hdom\": \"^2.2.0\"\n+ \"@thi.ng/api\": \"latest\",\n+ \"@thi.ng/atom\": \"latest\",\n+ \"@thi.ng/hdom\": \"latest\"\n}\n}\n\\ No newline at end of file\n",
"new_path": "examples/interceptor-basics/package.json",
"old_path": "examples/interceptor-basics/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"webpack\": \"^3.11.0\"\n},\n\"dependencies\": {\n- \"@thi.ng/hdom\": \"^2.2.0\",\n- \"@thi.ng/transducers\": \"^1.6.2\"\n+ \"@thi.ng/hdom\": \"latest\",\n+ \"@thi.ng/transducers\": \"latest\"\n}\n}\n\\ No newline at end of file\n",
"new_path": "examples/json-components/package.json",
"old_path": "examples/json-components/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"webpack\": \"^3.10.0\"\n},\n\"dependencies\": {\n- \"@thi.ng/atom\": \"^1.0.1\",\n- \"@thi.ng/hdom\": \"^2.2.0\"\n+ \"@thi.ng/atom\": \"latest\",\n+ \"@thi.ng/hdom\": \"latest\"\n}\n}\n\\ No newline at end of file\n",
"new_path": "examples/login-form/package.json",
"old_path": "examples/login-form/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"start\": \"webpack-dev-server --open --mode development --devtool inline-source-map\"\n},\n\"dependencies\": {\n- \"@thi.ng/atom\": \"^1.0.1\",\n- \"@thi.ng/interceptors\": \"^1.0.1\",\n- \"@thi.ng/hdom\": \"^2.2.0\",\n- \"@thi.ng/router\": \"^0.1.0\"\n+ \"@thi.ng/atom\": \"latest\",\n+ \"@thi.ng/interceptors\": \"latest\",\n+ \"@thi.ng/hdom\": \"latest\",\n+ \"@thi.ng/router\": \"latest\"\n},\n\"devDependencies\": {\n\"ts-loader\": \"^4.0.1\",\n",
"new_path": "examples/router-basics/package.json",
"old_path": "examples/router-basics/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"webpack\": \"^3.11.0\"\n},\n\"dependencies\": {\n- \"@thi.ng/hdom\": \"^2.2.0\",\n- \"@thi.ng/transducers\": \"^1.6.2\"\n+ \"@thi.ng/hdom\": \"latest\",\n+ \"@thi.ng/transducers\": \"latest\"\n}\n}\n\\ No newline at end of file\n",
"new_path": "examples/svg-particles/package.json",
"old_path": "examples/svg-particles/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"webpack\": \"^3.11.0\"\n},\n\"dependencies\": {\n- \"@thi.ng/atom\": \"^1.0.1\",\n- \"@thi.ng/hdom\": \"^2.2.0\",\n- \"@thi.ng/paths\": \"^1.0.0\",\n- \"@thi.ng/transducers\": \"^1.6.2\"\n+ \"@thi.ng/atom\": \"latest\",\n+ \"@thi.ng/hdom\": \"latest\",\n+ \"@thi.ng/paths\": \"latest\",\n+ \"@thi.ng/transducers\": \"latest\"\n}\n}\n\\ No newline at end of file\n",
"new_path": "examples/todo-list/package.json",
"old_path": "examples/todo-list/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"webpack\": \"^3.11.0\"\n},\n\"dependencies\": {\n- \"@thi.ng/hdom\": \"^2.2.0\",\n- \"@thi.ng/hdom-components\": \"^1.0.4\"\n+ \"@thi.ng/hdom\": \"latest\",\n+ \"@thi.ng/hdom-components\": \"latest\"\n}\n}\n\\ No newline at end of file\n",
"new_path": "examples/webgl/package.json",
"old_path": "examples/webgl/package.json"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
build(examples): update all @thi.ng deps to use "latest"
| 1
|
build
|
examples
|
679,913
|
18.03.2018 21:40:58
| 0
|
c0ec2745691cd5b77ccc6f4369229b98a9e3cbae
|
feat(atom): add optional support for eager views, update tests/readme
|
[
{
"change_type": "MODIFY",
"diff": "@@ -200,6 +200,41 @@ viewA.release()\nviewC.release()\n```\n+Since v1.1.0 views can also be configured to be eager, instead of the\n+\"lazy\" default behavior. If the optional `lazy` arg is true (default),\n+the view's transformer will only be executed with the first `deref()`\n+after each value change. If `lazy` is false, the transformer function\n+will be executed immediately after a value change occurred and so can be\n+used like a selective watch which only triggers if there was an actual\n+value change (in contrast to normal watches, which execute with each\n+update, regardless of value change).\n+\n+Related, the actual value change predicate can be customized. If not\n+given, the default `@thi.ng/api/equiv` will be used.\n+\n+```typescript\n+let x;\n+let a = new Atom({value: 1})\n+\n+// create an eager view by passing `false` as last arg\n+view = a.addView(\"value\", (y) => (x = y, y * 10), false);\n+\n+// check `x` to verify that transformer already has run\n+x === 1\n+// true\n+\n+// reset x\n+x = null\n+\n+// verify transformed value\n+view.deref() === 10\n+// true\n+\n+// verify transformer hasn't rerun because of deref()\n+x === null\n+// true\n+```\n+\nAtoms & views are useful tools for keeping state outside UI components. Here's\nan example of a tiny\n[@thi.ng/hdom](https://github.com/thi-ng/umbrella/tree/master/packages/hdom)\n",
"new_path": "packages/atom/README.md",
"old_path": "packages/atom/README.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -41,5 +41,5 @@ export interface IView<T> extends\n};\nexport interface IViewable {\n- addView<T>(path: Path, tx?: ViewTransform<T>): IView<T>;\n+ addView<T>(path: Path, tx?: ViewTransform<T>, lazy?: boolean): IView<T>;\n}\n",
"new_path": "packages/atom/src/api.ts",
"old_path": "packages/atom/src/api.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -74,8 +74,8 @@ export class Atom<T> implements\n/* istanbul ignore next */\nnotifyWatches(oldState: T, newState: T) { }\n- addView<V>(path: Path, tx?: ViewTransform<V>): IView<V> {\n- return new View<V>(this, path, tx);\n+ addView<V>(path: Path, tx?: ViewTransform<V>, lazy = true): IView<V> {\n+ return new View<V>(this, path, tx, lazy);\n}\nrelease() {\n",
"new_path": "packages/atom/src/atom.ts",
"old_path": "packages/atom/src/atom.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -100,7 +100,7 @@ export class Cursor<T> implements\nreturn this.local.notifyWatches(oldState, newState);\n}\n- addView<V>(path: Path, tx?: ViewTransform<V>): IView<V> {\n- return new View<V>(this, path, tx);\n+ addView<V>(path: Path, tx?: ViewTransform<V>, lazy = true): IView<V> {\n+ return new View<V>(this, path, tx, lazy);\n}\n}\n",
"new_path": "packages/atom/src/cursor.ts",
"old_path": "packages/atom/src/cursor.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -177,8 +177,8 @@ export class History<T> implements\nreturn this.state.notifyWatches(oldState, newState);\n}\n- addView<V>(path: Path, tx?: ViewTransform<V>): IView<V> {\n- return new View<V>(this, path, tx);\n+ addView<V>(path: Path, tx?: ViewTransform<V>, lazy = true): IView<V> {\n+ return new View<V>(this, path, tx, lazy);\n}\nrelease() {\n",
"new_path": "packages/atom/src/history.ts",
"old_path": "packages/atom/src/history.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -13,6 +13,17 @@ import { IView, ReadonlyAtom, ViewTransform } from \"./api\";\n* transformer is only applied once per value change and its result\n* cached until the next change.\n*\n+ * If the optional `lazy` is true (default), the transformer will only\n+ * be executed with the first `deref()` after each value change. If\n+ * `lazy` is false, the transformer function will be executed\n+ * immediately after a value change occurred and so can be used like a\n+ * watch which only triggers if there was an actual value change (in\n+ * contrast to normal watches, which execute with each update,\n+ * regardless of value change).\n+ *\n+ * Related, the actual value change predicate can be customized. If not\n+ * given, the default `@thi.ng/api/equiv` will be used.\n+ *\n* ```\n* a = new Atom({a: {b: 1}});\n* v = a.addView(\"a.b\", (x) => x * 10);\n@@ -47,35 +58,57 @@ export class View<T> implements\nprotected tx: ViewTransform<T>;\nprotected unprocessed: any;\nprotected isDirty: boolean;\n+ protected isLazy: boolean;\n- constructor(parent: ReadonlyAtom<any>, path: Path, tx?: ViewTransform<T>, equiv = _equiv) {\n+ constructor(parent: ReadonlyAtom<any>, path: Path, tx?: ViewTransform<T>, lazy = true, equiv = _equiv) {\nthis.parent = parent;\nthis.id = `view-${View.NEXT_ID++}`;\nthis.tx = tx || ((x: any) => x);\nthis.path = toPath(path);\nthis.isDirty = true;\n+ this.isLazy = lazy;\nconst lookup = getter(this.path);\nconst state = this.parent.deref();\nthis.unprocessed = state ? lookup(state) : undefined;\n+ if (!lazy) {\n+ this.state = this.tx(this.unprocessed);\n+ this.unprocessed = undefined;\n+ }\nparent.addWatch(this.id, (_, prev, curr) => {\nconst pval: T = prev ? lookup(prev) : prev;\nconst val: T = curr ? lookup(curr) : curr;\nif (!equiv(val, pval)) {\n+ if (lazy) {\nthis.unprocessed = val;\n+ } else {\n+ this.state = this.tx(val);\n+ }\nthis.isDirty = true;\n}\n});\n}\n+ /**\n+ * Returns view's value. If the view has a transformer, the\n+ * transformed value is returned. The transformer is only run once\n+ * per value change. See class comments about difference between\n+ * lazy/eager behaviors.\n+ */\nderef() {\nif (this.isDirty) {\n+ if (this.isLazy) {\nthis.state = this.tx(this.unprocessed);\nthis.unprocessed = undefined;\n+ }\nthis.isDirty = false;\n}\nreturn this.state;\n}\n+ /**\n+ * Returns true, if the view's value has changed since last\n+ * `deref()`.\n+ */\nchanged() {\nreturn this.isDirty;\n}\n@@ -91,11 +124,18 @@ export class View<T> implements\n* behavior when calling `view()` or `deref()` subsequently.\n*/\nview() {\n- return this.isDirty ? this.tx(this.unprocessed) : this.state;\n+ return this.isDirty && this.isLazy ? this.tx(this.unprocessed) : this.state;\n}\n+ /**\n+ * Disconnects this view from parent state, marks itself\n+ * dirty/changed and sets its unprocessed raw value to `undefined`.\n+ */\nrelease() {\nthis.unprocessed = undefined;\n+ if (!this.isLazy) {\n+ this.state = this.tx(undefined);\n+ }\nthis.isDirty = true;\nreturn this.parent.removeWatch(this.id);\n}\n",
"new_path": "packages/atom/src/view.ts",
"old_path": "packages/atom/src/view.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -7,7 +7,7 @@ import { Atom } from \"../src/atom\";\nimport { Cursor } from \"../src/cursor\";\nimport { View } from \"../src/view\";\n-describe(\"subscription\", () => {\n+describe(\"view\", () => {\nlet a: Atom<any>;\nlet s: IView<number>;\n@@ -77,4 +77,25 @@ describe(\"subscription\", () => {\nassert(!s.changed(), \"changed #2\");\nassert.equal(s.deref(), undefined);\n});\n+\n+ it(\"is lazy by default\", () => {\n+ let x;\n+ s = a.addView(\"b.c\", (y) => (x = y, y * 10));\n+ assert.equal(x, undefined);\n+ assert.equal(s.deref(), 20);\n+ assert.equal(x, 2);\n+ x = undefined;\n+ assert.equal(s.deref(), 20);\n+ assert.equal(x, undefined);\n+ });\n+\n+ it(\"can be eager\", () => {\n+ let x;\n+ s = a.addView(\"b.c\", (y) => (x = y, y * 10), false);\n+ assert.equal(x, 2);\n+ assert.equal(s.deref(), 20);\n+ x = undefined;\n+ assert.equal(s.deref(), 20);\n+ assert.equal(x, undefined);\n+ });\n});\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 optional support for eager views, update tests/readme
| 1
|
feat
|
atom
|
679,913
|
19.03.2018 00:24:03
| 0
|
76c5e0a487d5f5268630cd9bd747242eac489eaf
|
fix(interceptors): InterceptorPredicate args
last arg is bus, same as w/ InterceptorFn
|
[
{
"change_type": "MODIFY",
"diff": "import { ReadonlyAtom } from \"@thi.ng/atom/api\";\nexport type InterceptorFn = (state: any, e: Event, bus?: IDispatch) => InterceptorContext | void;\n-export type InterceptorPredicate = (state: any, e: Event, fx?: any) => boolean;\n+export type InterceptorPredicate = (state: any, e: Event, bus?: IDispatch) => boolean;\nexport type SideEffect = (x: any, bus?: IDispatch) => any;\nexport type EventDef = Interceptor | InterceptorFn | (Interceptor | InterceptorFn)[];\n",
"new_path": "packages/interceptors/src/api.ts",
"old_path": "packages/interceptors/src/api.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -59,9 +59,9 @@ export function forwardSideFx(id: string) {\n* @param err interceptor triggered on predicate failure\n*/\nexport function ensurePred(pred: InterceptorPredicate, err?: InterceptorFn): InterceptorFn {\n- return (state, e, fx) => {\n- if (!pred(state, e, fx)) {\n- return { [FX_CANCEL]: true, ...(err ? err(state, e, fx) : null) };\n+ return (state, e, bus) => {\n+ if (!pred(state, e, bus)) {\n+ return { [FX_CANCEL]: true, ...(err ? err(state, e, bus) : null) };\n}\n};\n}\n",
"new_path": "packages/interceptors/src/interceptors.ts",
"old_path": "packages/interceptors/src/interceptors.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
fix(interceptors): InterceptorPredicate args
- last arg is bus, same as w/ InterceptorFn
| 1
|
fix
|
interceptors
|
730,429
|
19.03.2018 09:08:56
| 14,400
|
88731332470e0dcada9d4593ccef686f16df53ac
|
chore(package): stick postcss-loader to 2.1.1 due to release issues
|
[
{
"change_type": "MODIFY",
"diff": "\"postcss\": \"^6.0.3\",\n\"postcss-cli\": \"^4.1.0\",\n\"postcss-cssnext\": \"^3.0.2\",\n- \"postcss-loader\": \"^2.0.5\",\n+ \"postcss-loader\": \"2.1.1\",\n\"postcss-modules\": \"^0.8.0\",\n\"postcss-reporter\": \"^5.0.0\",\n\"react-test-renderer\": \"^16.1.0\",\n",
"new_path": "package.json",
"old_path": "package.json"
}
] |
JavaScript
|
MIT License
|
webex/react-widgets
|
chore(package): stick postcss-loader to 2.1.1 due to release issues
https://github.com/postcss/postcss-loader/issues/347
| 1
|
chore
|
package
|
807,849
|
19.03.2018 10:04:45
| 25,200
|
399fb1752ca442931cd6cad23dd20cc8d905ca79
|
test(helpers): add set-npm-userconfig
|
[
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+// Overwrite npm userconfig to avoid test pollution\n+// https://docs.npmjs.com/misc/config#npmrc-files\n+process.env.npm_config_userconfig = require(\"path\").resolve(__dirname, \"test-user.ini\");\n",
"new_path": "helpers/set-npm-userconfig/index.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"@lerna-test/set-npm-userconfig\",\n+ \"version\": \"0.0.0-test-only\",\n+ \"description\": \"A local test helper\",\n+ \"private\": true,\n+ \"license\": \"MIT\"\n+}\n",
"new_path": "helpers/set-npm-userconfig/package.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+init-author-name=Tester McPerson\n+init-author-email=test@example.com\n+init-author-url=http://example.com\n+registry = https://registry.npmjs.org/\n",
"new_path": "helpers/set-npm-userconfig/test-user.ini",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -5,6 +5,6 @@ module.exports = {\ncollectCoverageFrom: [\"{commands,core,utils}/**/*.js\"],\nmodulePathIgnorePatterns: [\"/__fixtures__/\"],\nroots: [\"<rootDir>/commands\", \"<rootDir>/core\", \"<rootDir>/utils\"],\n- setupFiles: [\"@lerna-test/silence-logging\"],\n+ setupFiles: [\"@lerna-test/silence-logging\", \"@lerna-test/set-npm-userconfig\"],\ntestEnvironment: \"node\",\n};\n",
"new_path": "jest.config.js",
"old_path": "jest.config.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -4,6 +4,7 @@ module.exports = {\nbail: true,\nmodulePathIgnorePatterns: [\"/__fixtures__/\"],\nroots: [\"<rootDir>/integration\"],\n+ setupFiles: [\"@lerna-test/set-npm-userconfig\"],\nsetupTestFrameworkScriptFile: \"<rootDir>/setup-integration-timeout.js\",\nsnapshotSerializers: [\"@lerna-test/serialize-placeholders\"],\ntestEnvironment: \"node\",\n",
"new_path": "jest.integration.js",
"old_path": "jest.integration.js"
},
{
"change_type": "MODIFY",
"diff": "\"normalize-newline\": \"3.0.0\"\n}\n},\n+ \"@lerna-test/set-npm-userconfig\": {\n+ \"version\": \"file:helpers/set-npm-userconfig\",\n+ \"dev\": true\n+ },\n\"@lerna-test/silence-logging\": {\n\"version\": \"file:helpers/silence-logging\",\n\"dev\": true,\n",
"new_path": "package-lock.json",
"old_path": "package-lock.json"
},
{
"change_type": "MODIFY",
"diff": "\"@lerna-test/serialize-changelog\": \"file:helpers/serialize-changelog\",\n\"@lerna-test/serialize-git-sha\": \"file:helpers/serialize-git-sha\",\n\"@lerna-test/serialize-placeholders\": \"file:helpers/serialize-placeholders\",\n+ \"@lerna-test/set-npm-userconfig\": \"file:helpers/set-npm-userconfig\",\n\"@lerna-test/silence-logging\": \"file:helpers/silence-logging\",\n\"@lerna-test/update-lerna-config\": \"file:helpers/update-lerna-config\",\n\"cross-env\": \"^5.1.4\",\n",
"new_path": "package.json",
"old_path": "package.json"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
test(helpers): add set-npm-userconfig
| 1
|
test
|
helpers
|
791,690
|
19.03.2018 10:59:20
| 25,200
|
a21e3cd3cd815fdf2de87b22dfc550b5d440d6de
|
core: convert diagnostics to numeric scores
|
[
{
"change_type": "MODIFY",
"diff": "'use strict';\nconst statistics = require('../lib/statistics');\n+const Util = require('../report/v2/renderer/util');\nconst DEFAULT_PASS = 'defaultPass';\n@@ -148,7 +149,7 @@ class Audit {\nlet auditDescription = audit.meta.description;\nif (audit.meta.failureDescription) {\n- if (score < 1) {\n+ if (score < Util.PASS_THRESHOLD) {\nauditDescription = audit.meta.failureDescription;\n}\n}\n",
"new_path": "lighthouse-core/audits/audit.js",
"old_path": "lighthouse-core/audits/audit.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -11,6 +11,11 @@ const Util = require('../report/v2/renderer/util');\nconst {groupIdToName, taskToGroup} = require('../lib/task-groups');\nconst THRESHOLD_IN_MS = 10;\n+// Parameters for log-normal CDF scoring. See https://www.desmos.com/calculator/rkphawothk\n+// <500ms ~= 100, >2s is yellow, >3.5s is red\n+const SCORING_POINT_OF_DIMINISHING_RETURNS = 600;\n+const SCORING_MEDIAN = 3500;\n+\nclass BootupTime extends Audit {\n/**\n* @return {!AuditMeta}\n@@ -21,6 +26,7 @@ class BootupTime extends Audit {\nname: 'bootup-time',\ndescription: 'JavaScript boot-up time',\nfailureDescription: 'JavaScript boot-up time is too high',\n+ scoreDisplayMode: Audit.SCORING_MODES.NUMERIC,\nhelpText: 'Consider reducing the time spent parsing, compiling, and executing JS. ' +\n'You may find delivering smaller JS payloads helps with this. [Learn ' +\n'more](https://developers.google.com/web/lighthouse/audits/bootup).',\n@@ -98,8 +104,14 @@ class BootupTime extends Audit {\nconst summary = {wastedMs: totalBootupTime};\nconst details = BootupTime.makeTableDetails(headings, results, summary);\n+ const score = Audit.computeLogNormalScore(\n+ totalBootupTime,\n+ SCORING_POINT_OF_DIMINISHING_RETURNS,\n+ SCORING_MEDIAN\n+ );\n+\nreturn {\n- score: Number(totalBootupTime < 2000),\n+ score,\nrawValue: totalBootupTime,\ndisplayValue: Util.formatMilliseconds(totalBootupTime),\ndetails,\n",
"new_path": "lighthouse-core/audits/bootup-time.js",
"old_path": "lighthouse-core/audits/bootup-time.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -15,7 +15,12 @@ const Util = require('../report/v2/renderer/util');\n// We group all trace events into groups to show a highlevel breakdown of the page\nconst {taskToGroup} = require('../lib/task-groups');\n-class PageExecutionTimings extends Audit {\n+// Parameters for log-normal CDF scoring. See https://www.desmos.com/calculator/s2eqcifkum\n+// <1s ~= 100, >3s is yellow, >4s is red\n+const SCORING_POINT_OF_DIMINISHING_RETURNS = 1500;\n+const SCORING_MEDIAN = 4000;\n+\n+class MainThreadWorkBreakdown extends Audit {\n/**\n* @return {!AuditMeta}\n*/\n@@ -23,8 +28,9 @@ class PageExecutionTimings extends Audit {\nreturn {\ncategory: 'Performance',\nname: 'mainthread-work-breakdown',\n- description: 'Main thread work breakdown',\n- informative: true,\n+ description: 'Minimizes main thread work',\n+ failureDescription: 'Has significant main thread work',\n+ scoreDisplayMode: Audit.SCORING_MODES.NUMERIC,\nhelpText: 'Consider reducing the time spent parsing, compiling and executing JS.' +\n'You may find delivering smaller JS payloads helps with this.',\nrequiredArtifacts: ['traces'],\n@@ -50,11 +56,11 @@ class PageExecutionTimings extends Audit {\n* @return {!AuditResult}\n*/\nstatic audit(artifacts) {\n- const trace = artifacts.traces[PageExecutionTimings.DEFAULT_PASS];\n+ const trace = artifacts.traces[MainThreadWorkBreakdown.DEFAULT_PASS];\nreturn artifacts.requestDevtoolsTimelineModel(trace)\n.then(devtoolsTimelineModel => {\n- const executionTimings = PageExecutionTimings.getExecutionTimingsByCategory(\n+ const executionTimings = MainThreadWorkBreakdown.getExecutionTimingsByCategory(\ndevtoolsTimelineModel\n);\nlet totalExecutionTime = 0;\n@@ -82,10 +88,16 @@ class PageExecutionTimings extends Audit {\n{key: 'duration', itemType: 'text', text: 'Time spent'},\n];\nresults.stableSort((a, b) => categoryTotals[b.group] - categoryTotals[a.group]);\n- const tableDetails = PageExecutionTimings.makeTableDetails(headings, results);\n+ const tableDetails = MainThreadWorkBreakdown.makeTableDetails(headings, results);\n+\n+ const score = Audit.computeLogNormalScore(\n+ totalExecutionTime,\n+ SCORING_POINT_OF_DIMINISHING_RETURNS,\n+ SCORING_MEDIAN\n+ );\nreturn {\n- score: Number(totalExecutionTime < 3000),\n+ score,\nrawValue: totalExecutionTime,\ndisplayValue: Util.formatMilliseconds(totalExecutionTime),\ndetails: tableDetails,\n@@ -97,4 +109,4 @@ class PageExecutionTimings extends Audit {\n}\n}\n-module.exports = PageExecutionTimings;\n+module.exports = MainThreadWorkBreakdown;\n",
"new_path": "lighthouse-core/audits/mainthread-work-breakdown.js",
"old_path": "lighthouse-core/audits/mainthread-work-breakdown.js"
},
{
"change_type": "MODIFY",
"diff": "const ELLIPSIS = '\\u2026';\nconst NBSP = '\\xa0';\n+const PASS_THRESHOLD = 0.75;\nconst RATINGS = {\n- PASS: {label: 'pass', minScore: 0.75},\n+ PASS: {label: 'pass', minScore: PASS_THRESHOLD},\nAVERAGE: {label: 'average', minScore: 0.45},\nFAIL: {label: 'fail'},\n};\n+/**\n+ * @fileoverview\n+ * @suppress {reportUnknownTypes} see https://github.com/GoogleChrome/lighthouse/pull/4778#issuecomment-373549391\n+ */\nclass Util {\n+ static get PASS_THRESHOLD() {\n+ return PASS_THRESHOLD;\n+ }\n+\n/**\n* Convert a score to a rating label.\n* @param {number} score\n",
"new_path": "lighthouse-core/report/v2/renderer/util.js",
"old_path": "lighthouse-core/report/v2/renderer/util.js"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
core: convert diagnostics to numeric scores (#4778)
| 1
|
core
| null |
217,922
|
19.03.2018 11:47:31
| -3,600
|
af3877fc7431ad2d34097dc305151aa8b08ba5b4
|
chore: fix deprecated import
|
[
{
"change_type": "MODIFY",
"diff": "@@ -19,7 +19,7 @@ import {CustomLinkPopupComponent} from './custom-link-popup/custom-link-popup.co\nimport {FormsModule} from '@angular/forms';\nimport {CommonComponentsModule} from '../../modules/common-components/common-components.module';\nimport {TranslateModule} from '@ngx-translate/core';\n-import {ClipboardModule} from 'ngx-clipboard/dist';\n+import {ClipboardModule} from 'ngx-clipboard';\nconst routes: Routes = [{\npath: 'custom-links',\n",
"new_path": "src/app/pages/custom-links/custom-links.module.ts",
"old_path": "src/app/pages/custom-links/custom-links.module.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore: fix deprecated import
| 1
|
chore
| null |
815,746
|
19.03.2018 12:26:09
| -7,200
|
81bfcab0c20c19329d8012a65635e1565a5b3ff6
|
fix: remove appended dropdown node
|
[
{
"change_type": "MODIFY",
"diff": "@@ -138,6 +138,7 @@ import { delay } from 'rxjs/operators';\nbindLabel=\"title\"\nbindValue=\"thumbnailUrl\"\nplaceholder=\"Select photo\"\n+ appendTo=\"body\"\n[virtualScroll]=\"true\"\nformControlName=\"photo\">\n<ng-template ng-label-tmp let-item=\"item\">\n",
"new_path": "demo/app/examples/reactive-forms.component.ts",
"old_path": "demo/app/examples/reactive-forms.component.ts"
},
{
"change_type": "MODIFY",
"diff": "box-sizing: border-box;\nposition: absolute;\nwidth: 100%;\n- z-index: 1000;\n+ z-index: 1050;\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": "@@ -114,6 +114,9 @@ export class NgDropdownPanelComponent implements OnDestroy {\nngOnDestroy() {\nthis._disposeDocumentResizeListener();\nthis._disposeScrollListener();\n+ if (this.appendTo) {\n+ this._renderer.removeChild(this._elementRef.nativeElement.parentNode, this._elementRef.nativeElement);\n+ }\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 appended dropdown node (#366)
| 1
|
fix
| null |
679,913
|
19.03.2018 12:36:15
| 0
|
bebd1186a2e39537dc6ccd4ff5006104f489f6bc
|
feat(transducers): add partitionSync() xform
|
[
{
"change_type": "MODIFY",
"diff": "@@ -605,7 +605,7 @@ reducer and optional initial accumulator/result.\n#### `keep<T>(f?: ((x: T) => any)): Transducer<T, T>`\n-#### `labeled<L, T>(id: L): Transducer<T, [L, T]>`\n+#### `labeled<L, T>(id: L | ((x: T) => L)): Transducer<T, [L, T]>`\n#### `map<A, B>(fn: (x: A) => B): Transducer<A, B>`\n@@ -613,7 +613,7 @@ reducer and optional initial accumulator/result.\n#### `mapDeep(spec: TransformSpec): Transducer<any, any>`\n-#### `mapIndexed<A, B>(fn: (i: number, x: A) => B): Transducer<A, B>`\n+#### `mapIndexed<A, B>(fn: (i: number, x: A) => B, offset = 0): Transducer<A, B>`\n#### `mapKeys(keys: IObjectOf<(x: any) => any>, copy?: boolean): Transducer<any, any>`\n@@ -641,6 +641,8 @@ reducer and optional initial accumulator/result.\n#### `partitionSort<A, B>(n: number, key?: ((x: A) => B), cmp?: Comparator<B>): Transducer<A, A>`\n+#### `partitionSync<T>(keys: PropertyKey[] | Set<PropertyKey>, keyfn: (x: T) => PropertyKey, reset = true, all = true): Transducer<T, IObjectOf<T>>`\n+\n#### `pluck<A, B>(key: PropertyKey): Transducer<A, B>`\n#### `rename<A, B>(kmap: IObjectOf<PropertyKey>, rfn?: Reducer<B, [PropertyKey, A]>): Transducer<A[], B>`\n",
"new_path": "packages/transducers/README.md",
"old_path": "packages/transducers/README.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -66,6 +66,7 @@ export * from \"./xform/page\";\nexport * from \"./xform/partition-by\";\nexport * from \"./xform/partition-of\";\nexport * from \"./xform/partition-sort\";\n+export * from \"./xform/partition-sync\";\nexport * from \"./xform/partition\";\nexport * from \"./xform/pluck\";\nexport * from \"./xform/rename\";\n",
"new_path": "packages/transducers/src/index.ts",
"old_path": "packages/transducers/src/index.ts"
},
{
"change_type": "ADD",
"diff": "+import { isArray } from \"@thi.ng/checks/is-array\";\n+\n+import { IObjectOf } from \"@thi.ng/api/api\";\n+import { Reducer, Transducer } from \"../api\";\n+\n+/**\n+ * This transducer is intended for synchronization and provenance\n+ * tracking of possibly previously merged inputs. It partitions the\n+ * input into labeled tuple objects with the object keys obtained from\n+ * the user provided `keyfn`. A new result is only produced once values\n+ * from **all** given labeled sources have been consumed. Only labels\n+ * contained in the provided key set are allowed, others are skipped.\n+ * The tuples will contain the most recent consumed value from each\n+ * labeled input. In dataflow scenarios this can be used to ensure a\n+ * subsequent operation consuming these tuples has all necessary inputs,\n+ * regardless of the individual rates of change of each original\n+ * (pre-merge) input.\n+ *\n+ * ```\n+ * src = [\n+ * [\"a\", 1], [\"a\", 2], [\"d\", 100], [\"b\", 10],\n+ * [\"b\", 11], [\"c\", 0], [\"a\", 3]\n+ * ];\n+ * // form tuples for values only from sources \"a\" & \"b\"\n+ * // here the label is the first element of each input item\n+ * [...iterator(partitionSync([\"a\", \"b\"], (x) => x[0]), src)]\n+ * // [ { a: [\"a\", 2], b: [\"b\", 10] },\n+ * // { b: [\"b\", 11], a: [\"a\", 3] } ]\n+ * ```\n+ *\n+ * In addition to the default mode of operation, i.e. waiting for new\n+ * values from *all* named inputs before a new tuple is produced, the\n+ * behavior for *all but the first tuple* can be changed to emit new\n+ * tuples as soon as a new value with a qualifying label has become\n+ * available (with other values in the tuple remaining). Compare with\n+ * above example:\n+ *\n+ * ```\n+ * // passing `false` to disable tuple reset\n+ * [...tx.iterator(tx.partitionSync([\"a\", \"b\"], (x) => x[0], false), src)]\n+ * // [ { a: [\"a\", 2], b: [\"b\", 10] },\n+ * // { a: [\"a\", 2], b: [\"b\", 11] },\n+ * // { a: [\"a\", 3], b: [\"b\", 11] } ]\n+ *\n+ * By default, the last emitted tuple is allowed to be incomplete (in\n+ * case the input closed). To only allow complete tuples, set the\n+ * optional `all` arg to false.\n+ *\n+ * Note: If the `keys` set of allowed labels is modified externally, the\n+ * tuple size will adjust accordingly (only if given as set, will not work\n+ * if keys are provided as array).\n+ *\n+ * @param keys allowed label set\n+ * @param keyfn label extraction function\n+ * @param reset true if each tuple should contain only new values\n+ * @param all true if last tuple is allowed to be incomplete\n+ */\n+export function partitionSync<T>(keys: PropertyKey[] | Set<PropertyKey>, keyfn: (x: T) => PropertyKey, reset = true, all = true): Transducer<T, IObjectOf<T>> {\n+ return ([init, complete, reduce]: Reducer<any, IObjectOf<T>>) => {\n+ let curr = {};\n+ let first = true;\n+ const currKeys = new Set<PropertyKey>();\n+ const ks = isArray(keys) ? new Set(keys) : keys;\n+ return [\n+ init,\n+ (acc) => {\n+ if ((reset && all && currKeys.size > 0) || (!reset && first)) {\n+ acc = reduce(acc, curr);\n+ curr = undefined;\n+ currKeys.clear();\n+ first = false;\n+ }\n+ return complete(acc);\n+ },\n+ (acc, x: T) => {\n+ const k = keyfn(x);\n+ if (ks.has(k)) {\n+ curr[k] = x;\n+ currKeys.add(k);\n+ if (currKeys.size >= ks.size) {\n+ acc = reduce(acc, curr);\n+ first = false;\n+ if (reset) {\n+ curr = {};\n+ currKeys.clear();\n+ } else {\n+ curr = { ...curr };\n+ }\n+ }\n+ }\n+ return acc;\n+ }];\n+ };\n+}\n\\ No newline at end of file\n",
"new_path": "packages/transducers/src/xform/partition-sync.ts",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(transducers): add partitionSync() xform
| 1
|
feat
|
transducers
|
679,913
|
19.03.2018 12:38:21
| 0
|
3bc8d54a1e656d761344308ae2385c80375f6471
|
refactor(transducers): update labeled(), mapIndexed(), partition()
labeled() - add support for label fn instead of just static label
mapIndexed() - add optional start index arg
partition() - minor update in completing reducer
|
[
{
"change_type": "MODIFY",
"diff": "+import { isFunction } from \"@thi.ng/checks/is-function\";\n+\nimport { Transducer } from \"../api\";\nimport { map } from \"./map\";\n-export function labeled<L, T>(id: L): Transducer<T, [L, T]> {\n- return map((x) => [id, x]);\n+export function labeled<L, T>(id: L | ((x: T) => L)): Transducer<T, [L, T]> {\n+ return map(\n+ isFunction(id) ?\n+ (x) => [id(x), x] :\n+ (x) => [id, x]\n+ );\n}\n",
"new_path": "packages/transducers/src/xform/labeled.ts",
"old_path": "packages/transducers/src/xform/labeled.ts"
},
{
"change_type": "MODIFY",
"diff": "import { Reducer, Transducer } from \"../api\";\nimport { compR } from \"../func/compr\";\n-export function mapIndexed<A, B>(fn: (i: number, x: A) => B): Transducer<A, B> {\n+export function mapIndexed<A, B>(fn: (i: number, x: A) => B, offset = 0): Transducer<A, B> {\nreturn (rfn: Reducer<any, B>) => {\nconst r = rfn[2];\n- let i = 0;\n+ let i = offset;\nreturn compR(rfn,\n(acc, x: A) => r(acc, fn(i++, x)));\n};\n",
"new_path": "packages/transducers/src/xform/map-indexed.ts",
"old_path": "packages/transducers/src/xform/map-indexed.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -19,7 +19,7 @@ export function partition<T>(...args: any[]): Transducer<T, T[]> {\nreturn [\ninit,\n(acc) => {\n- if (buf.length && (all || buf.length === size)) {\n+ if (all && buf.length > 0) {\nacc = reduce(acc, buf);\nbuf = [];\n}\n",
"new_path": "packages/transducers/src/xform/partition.ts",
"old_path": "packages/transducers/src/xform/partition.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(transducers): update labeled(), mapIndexed(), partition()
- labeled() - add support for label fn instead of just static label
- mapIndexed() - add optional start index arg
- partition() - minor update in completing reducer
| 1
|
refactor
|
transducers
|
815,746
|
19.03.2018 12:45:04
| -7,200
|
934da338a66c1b48e51047efef642c00c8903772
|
chore(release): 0.30.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.30.1\"></a>\n+## [0.30.1](https://github.com/ng-select/ng-select/compare/v0.30.0...v0.30.1) (2018-03-19)\n+\n+\n+### Bug Fixes\n+\n+* break loop while marking items ([#363](https://github.com/ng-select/ng-select/issues/363)) ([9888981](https://github.com/ng-select/ng-select/commit/9888981)), closes [#361](https://github.com/ng-select/ng-select/issues/361)\n+* remove appended dropdown node ([#366](https://github.com/ng-select/ng-select/issues/366)) ([81bfcab](https://github.com/ng-select/ng-select/commit/81bfcab))\n+\n+\n+\n<a name=\"0.30.0\"></a>\n# [0.30.0](https://github.com/ng-select/ng-select/compare/v0.29.1...v0.30.0) (2018-03-15)\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.30.0\",\n+ \"version\": \"0.30.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.30.1
| 1
|
chore
|
release
|
791,723
|
19.03.2018 12:55:20
| 25,200
|
0cddcd38a62757abc63baf577f1ea6a55945763c
|
core(domstats): useIsolation within domstats
|
[
{
"change_type": "MODIFY",
"diff": "@@ -138,7 +138,7 @@ class DOMStats extends Gatherer {\nreturn (${getDOMStats.toString()}(document.documentElement));\n})()`;\nreturn options.driver.sendCommand('DOM.enable')\n- .then(() => options.driver.evaluateAsync(expression))\n+ .then(() => options.driver.evaluateAsync(expression, {useIsolation: true}))\n.then(results => options.driver.getElementsInDocument().then(allNodes => {\nresults.totalDOMNodes = allNodes.length;\nreturn options.driver.sendCommand('DOM.disable').then(() => results);\n",
"new_path": "lighthouse-core/gather/gatherers/dobetterweb/domstats.js",
"old_path": "lighthouse-core/gather/gatherers/dobetterweb/domstats.js"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
core(domstats): useIsolation within domstats (#4811)
| 1
|
core
|
domstats
|
791,723
|
19.03.2018 13:06:36
| 25,200
|
0206170281957905e4e16433b4badc9fc07e1bf1
|
core(img-usage): handle invalid images within determineNaturalSize
|
[
{
"change_type": "MODIFY",
"diff": "@@ -96,7 +96,7 @@ function collectImageElementInfo() {\nfunction determineNaturalSize(url) {\nreturn new Promise((resolve, reject) => {\nconst img = new Image();\n- img.addEventListener('error', reject);\n+ img.addEventListener('error', _ => reject(new Error('determineNaturalSize failed img load')));\nimg.addEventListener('load', () => {\nresolve({\nnaturalWidth: img.naturalWidth,\n@@ -118,6 +118,9 @@ class ImageUsage extends Gatherer {\nreturn this.driver.evaluateAsync(`(${determineNaturalSize.toString()})(${url})`)\n.then(size => {\nreturn Object.assign(element, size);\n+ }).catch(_ => {\n+ // determineNaturalSize fails on invalid images, which we treat as non-visible\n+ return Object.assign(element, {naturalWidth: 0, naturalHeight: 0});\n});\n}\n",
"new_path": "lighthouse-core/gather/gatherers/image-usage.js",
"old_path": "lighthouse-core/gather/gatherers/image-usage.js"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
core(img-usage): handle invalid images within determineNaturalSize (#4812)
| 1
|
core
|
img-usage
|
791,690
|
19.03.2018 13:06:56
| 25,200
|
941b0148e9837a2dd2a534935da1d178bf618ecb
|
tests(smokehouse): adjust byte efficiency CPU multiplier
|
[
{
"change_type": "MODIFY",
"diff": "@@ -136,6 +136,8 @@ class UnusedBytes extends Audit {\n*/\nstatic createAuditResult(result, graph) {\nconst simulatorOptions = PredictivePerf.computeRTTAndServerResponseTime(graph);\n+ // TODO: calibrate multipliers, see https://github.com/GoogleChrome/lighthouse/issues/820\n+ Object.assign(simulatorOptions, {cpuTaskMultiplier: 1, layoutTaskMultiplier: 1});\nconst simulator = new LoadSimulator(graph, simulatorOptions);\nconst debugString = result.debugString;\n",
"new_path": "lighthouse-core/audits/byte-efficiency/byte-efficiency-audit.js",
"old_path": "lighthouse-core/audits/byte-efficiency/byte-efficiency-audit.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -36,7 +36,7 @@ describe('Byte efficiency base audit', () => {\ngraph = new NetworkNode(networkRecord);\n// add a CPU node to force improvement to TTI\n- graph.addDependent(new CPUNode({tid: 1, ts: 0, dur: 50 * 1000}));\n+ graph.addDependent(new CPUNode({tid: 1, ts: 0, dur: 100 * 1000}));\n});\nconst baseHeadings = [\n@@ -188,7 +188,7 @@ describe('Byte efficiency base audit', () => {\ngraph\n);\n- assert.equal(result.rawValue, 420);\n+ assert.equal(result.rawValue, 300);\n});\n});\n});\n",
"new_path": "lighthouse-core/test/audits/byte-efficiency/byte-efficiency-audit-test.js",
"old_path": "lighthouse-core/test/audits/byte-efficiency/byte-efficiency-audit-test.js"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
tests(smokehouse): adjust byte efficiency CPU multiplier (#4809)
| 1
|
tests
|
smokehouse
|
217,922
|
19.03.2018 13:58:11
| -3,600
|
5d35b8f7facac0a9bce054050986c00760afcd01
|
feat: show closest aetheryte to TP in the same map for gatherable items
|
[
{
"change_type": "MODIFY",
"diff": "@@ -36,6 +36,7 @@ import {WorkshopService} from './database/workshop.service';\nimport {VenturesExtractor} from './list/data/extractor/ventures-extractor';\nimport {CustomLinksService} from './database/custom-links/custom-links.service';\nimport {PatreonGuard} from './guard/patreon.guard';\n+import {MathToolsService} from './tools/math-tools';\nconst dataExtractorProviders: Provider[] = [\n@@ -82,6 +83,7 @@ const dataExtractorProviders: Provider[] = [\nWorkshopService,\nCustomLinksService,\nPatreonGuard,\n+ MathToolsService,\n],\ndeclarations: [\nI18nPipe,\n",
"new_path": "src/app/core/core.module.ts",
"old_path": "src/app/core/core.module.ts"
},
{
"change_type": "ADD",
"diff": "+import {Injectable} from '@angular/core';\n+import {Vector2} from './vector2';\n+\n+@Injectable()\n+export class MathToolsService {\n+\n+ public distance(start: Vector2, target: Vector2): number {\n+ return Math.sqrt(Math.pow((target.x - start.x), 2) + Math.pow((target.y - start.y), 2))\n+ }\n+}\n",
"new_path": "src/app/core/tools/math-tools.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+export interface Vector2 {\n+ x: number;\n+ y: number;\n+}\n",
"new_path": "src/app/core/tools/vector2.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "<p mat-line>\n{{node.areaid | placeName | i18n}}\n</p>\n+ <app-map-position mat-line *ngIf=\"node.coords !== undefined\" [zoneId]=\"node.zoneid\"\n+ [marker]=\"{x:node.coords[0], y:node.coords[1]}\"></app-map-position>\n+ <span mat-line *ngIf=\"getClosestAetheryte(node) | async as aetheryte\" class=\"closest-tp\">\n+ <img src=\"/assets/icons/Aetheryte.png\" alt=\"\" class=\"aetheryte-icon\">\n+ {{aetheryte.nameid | placeName | i18n}}\n+ </span>\n<mat-chip-list>\n<mat-chip *ngIf=\"node.limitType !== undefined\" selected=\"true\" color=\"primary\">\n{{node.limitType | i18n}}\n</mat-chip>\n</mat-chip-list>\n- <app-map-position mat-line *ngIf=\"node.coords !== undefined\" [zoneId]=\"node.zoneid\"\n- [marker]=\"{x:node.coords[0], y:node.coords[1]}\"></app-map-position>\n<span>\n<b mat-line *ngIf=\"node.slot !== undefined\" selected=\"true\" color=\"accent\">Slot:{{node.slot}}</b>\n<span mat-line *ngIf=\"node.time !== undefined\">\n",
"new_path": "src/app/modules/item/gathered-by-popup/gathered-by-popup.component.html",
"old_path": "src/app/modules/item/gathered-by-popup/gathered-by-popup.component.html"
},
{
"change_type": "MODIFY",
"diff": "mat-chip-list {\nmargin: 0 50px;\n}\n+\n+.closest-tp {\n+ display: flex !important;\n+ align-items: center;\n+}\n",
"new_path": "src/app/modules/item/gathered-by-popup/gathered-by-popup.component.scss",
"old_path": "src/app/modules/item/gathered-by-popup/gathered-by-popup.component.scss"
},
{
"change_type": "MODIFY",
"diff": "-import {Component, Inject} from '@angular/core';\n+import {ChangeDetectionStrategy, Component, Inject} from '@angular/core';\nimport {MAT_DIALOG_DATA} from '@angular/material';\nimport {ListRow} from '../../../model/list/list-row';\n+import {Aetheryte} from '../../../core/data/aetheryte';\n+import {Observable} from 'rxjs/Observable';\n+import {StoredNode} from '../../../model/list/stored-node';\n+import {MapService} from '../../map/map.service';\n@Component({\nselector: 'app-gathered-by-popup',\ntemplateUrl: './gathered-by-popup.component.html',\n- styleUrls: ['./gathered-by-popup.component.scss']\n+ styleUrls: ['./gathered-by-popup.component.scss'],\n+ changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GatheredByPopupComponent {\n- constructor(@Inject(MAT_DIALOG_DATA) public data: ListRow) {\n+ constructor(@Inject(MAT_DIALOG_DATA) public data: ListRow, private mapService: MapService) {\n+ }\n+\n+ getClosestAetheryte(node: StoredNode): Observable<Aetheryte> {\n+ return this.mapService.getMapById(node.zoneid).map((map) => {\n+ return this.mapService.getNearestAetheryte(map, {x: node.coords[0], y: node.coords[1]});\n+ });\n}\ngetDespawnTime(time: number, uptime: number): string {\n",
"new_path": "src/app/modules/item/gathered-by-popup/gathered-by-popup.component.ts",
"old_path": "src/app/modules/item/gathered-by-popup/gathered-by-popup.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -3,6 +3,7 @@ import {MapService} from '../map.service';\nimport {MapData} from '../map-data';\nimport {MAT_DIALOG_DATA} from '@angular/material';\nimport {Observable} from 'rxjs/Observable';\n+import {Vector2} from '../../../core/tools/vector2';\n@Component({\nselector: 'app-map-popup',\n@@ -13,7 +14,7 @@ export class MapPopupComponent implements OnInit {\nmapData: Observable<MapData>;\n- constructor(@Inject(MAT_DIALOG_DATA) public data: { coords: { x: number, y: number }, id: number }, private mapService: MapService) {\n+ constructor(@Inject(MAT_DIALOG_DATA) public data: { coords: Vector2, id: number }, private mapService: MapService) {\n}\nngOnInit() {\n",
"new_path": "src/app/modules/map/map-popup/map-popup.component.ts",
"old_path": "src/app/modules/map/map-popup/map-popup.component.ts"
},
{
"change_type": "MODIFY",
"diff": "import {Component, Input} from '@angular/core';\nimport {MatDialog} from '@angular/material';\nimport {MapPopupComponent} from '../map-popup/map-popup.component';\n+import {Vector2} from '../../../core/tools/vector2';\n@Component({\nselector: 'app-map-position',\n@@ -10,7 +11,7 @@ import {MapPopupComponent} from '../map-popup/map-popup.component';\nexport class MapPositionComponent {\n@Input()\n- marker: { x: number, y: number };\n+ marker: Vector2;\n@Input()\nzoneId: number;\n@@ -18,7 +19,7 @@ export class MapPositionComponent {\nconstructor(private dialog: MatDialog) {\n}\n- getMarker(): { x: number, y: number } {\n+ getMarker(): Vector2 {\nreturn {\nx: Math.round(this.marker.x),\ny: Math.round(this.marker.y)\n",
"new_path": "src/app/modules/map/map-position/map-position.component.ts",
"old_path": "src/app/modules/map/map-position/map-position.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -4,13 +4,15 @@ import {Observable} from 'rxjs/Observable';\nimport {MapData} from './map-data';\nimport {Aetheryte} from '../../core/data/aetheryte';\nimport {aetherytes} from '../../core/data/sources/aetherytes';\n+import {Vector2} from '../../core/tools/vector2';\n+import {MathToolsService} from '../../core/tools/math-tools';\n@Injectable()\nexport class MapService {\ndata: Observable<MapData[]>;\n- constructor(private http: HttpClient) {\n+ constructor(private http: HttpClient, private mathService: MathToolsService) {\nthis.data = this.http.get<any>('https://api.xivdb.com/maps/get/layers/id')\n.map(res => {\nreturn Object.keys(res.data).map(key => res.data[key]).map(row => row[0]) as MapData[];\n@@ -35,7 +37,17 @@ export class MapService {\nreturn aetherytes.filter(aetheryte => aetheryte.placenameid === id);\n}\n- getPositionOnMap(map: MapData, position: { x: number, y: number }): { x: number, y: number } {\n+ public getNearestAetheryte(map: MapData, coords: Vector2): Aetheryte {\n+ let nearest = map.aetherytes[0];\n+ for (const aetheryte of map.aetherytes.filter(ae => ae.type === 0)) {\n+ if (this.mathService.distance(aetheryte, coords) < this.mathService.distance(nearest, coords)) {\n+ nearest = aetheryte;\n+ }\n+ }\n+ return nearest;\n+ }\n+\n+ getPositionOnMap(map: MapData, position: Vector2): Vector2 {\nconst scale = map.size_factor / 100;\nconst offset = 1;\n",
"new_path": "src/app/modules/map/map.service.ts",
"old_path": "src/app/modules/map/map.service.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -2,7 +2,7 @@ import {Component, Input, OnInit} from '@angular/core';\nimport {MapData} from '../map-data';\nimport {Observable} from 'rxjs/Observable';\nimport {MapService} from '../map.service';\n-import {MathTools} from '../../../tools/math-tools';\n+import {Vector2} from '../../../core/tools/vector2';\n@Component({\nselector: 'app-map',\n@@ -15,7 +15,7 @@ export class MapComponent implements OnInit {\nmapId: number;\n@Input()\n- markers: { x: number, y: number }[] = [];\n+ markers: Vector2[] = [];\nmapData: Observable<MapData>;\n@@ -26,7 +26,7 @@ export class MapComponent implements OnInit {\nthis.mapData = this.mapService.getMapById(this.mapId)\n}\n- getPosition(map: MapData, marker: { x: number, y: number }, offset = { x: 0, y: 0 }): { top: string, left: string } {\n+ getPosition(map: MapData, marker: Vector2, offset = {x: 0, y: 0}): { top: string, left: string } {\nconst positionPercents = this.mapService.getPositionOnMap(map, marker);\nreturn {top: `${positionPercents.y + offset.y}%`, left: `${positionPercents.x + offset.y}%`};\n}\n",
"new_path": "src/app/modules/map/map/map.component.ts",
"old_path": "src/app/modules/map/map/map.component.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
feat: show closest aetheryte to TP in the same map for gatherable items
#185
| 1
|
feat
| null |
791,723
|
19.03.2018 14:20:36
| 25,200
|
ab5071ef62453bb86586235c6886f9607f60ebf6
|
deps(browserify): update deep transitive dep to use recent acorn
|
[
{
"change_type": "MODIFY",
"diff": "\"run-sequence\": \"^1.1.5\",\n\"through2\": \"^2.0.1\"\n},\n+ \"resolutions\": {\n+ \"browserify/insert-module-globals/lexical-scope/astw\": \"2.2.0\"\n+ },\n\"dependencies\": {}\n}\n",
"new_path": "lighthouse-extension/package.json",
"old_path": "lighthouse-extension/package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -22,10 +22,6 @@ acorn-node@^1.3.0:\nacorn \"^5.4.1\"\nxtend \"^4.0.1\"\n-acorn@^1.0.3:\n- version \"1.2.2\"\n- resolved \"https://registry.yarnpkg.com/acorn/-/acorn-1.2.2.tgz#c8ce27de0acc76d896d2b1fad3df588d9e82f014\"\n-\nacorn@^2.7.0:\nversion \"2.7.0\"\nresolved \"https://registry.yarnpkg.com/acorn/-/acorn-2.7.0.tgz#ab6e7d9d886aaca8b085bc3312b79a198433f0e7\"\n@@ -34,6 +30,10 @@ acorn@^3.0.4:\nversion \"3.3.0\"\nresolved \"https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a\"\n+acorn@^4.0.3:\n+ version \"4.0.13\"\n+ resolved \"https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787\"\n+\nacorn@^5.0.0, acorn@^5.4.1:\nversion \"5.5.3\"\nresolved \"https://registry.yarnpkg.com/acorn/-/acorn-5.5.3.tgz#f473dd47e0277a08e28e9bec5aeeb04751f0b8c9\"\n@@ -185,11 +185,11 @@ assign-symbols@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367\"\n-astw@^2.0.0:\n- version \"2.0.0\"\n- resolved \"https://registry.yarnpkg.com/astw/-/astw-2.0.0.tgz#08121ac8288d35611c0ceec663f6cd545604897d\"\n+astw@2.2.0, astw@^2.0.0:\n+ version \"2.2.0\"\n+ resolved \"https://registry.yarnpkg.com/astw/-/astw-2.2.0.tgz#7bd41784d32493987aeb239b6b4e1c57a873b917\"\ndependencies:\n- acorn \"^1.0.3\"\n+ acorn \"^4.0.3\"\nbabel-code-frame@^6.22.0:\nversion \"6.26.0\"\n",
"new_path": "lighthouse-extension/yarn.lock",
"old_path": "lighthouse-extension/yarn.lock"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
deps(browserify): update deep transitive dep to use recent acorn (#4813)
| 1
|
deps
|
browserify
|
807,849
|
19.03.2018 14:24:57
| 25,200
|
20816401313f32ba9e10b3f6fa505685a7beb6ff
|
fix: Respect durable hoist configuration
fixes
|
[
{
"change_type": "MODIFY",
"diff": "@@ -17,6 +17,7 @@ const createSymlink = require(\"@lerna/create-symlink\");\n// helpers\nconst initFixture = require(\"@lerna-test/init-fixture\")(__dirname);\nconst normalizeRelativeDir = require(\"@lerna-test/normalize-relative-dir\");\n+const updateLernaConfig = require(\"@lerna-test/update-lerna-config\");\n// file under test\nconst lernaBootstrap = require(\"@lerna-test/command-runner\")(require(\"../command\"));\n@@ -282,7 +283,10 @@ describe(\"BootstrapCommand\", () => {\nit(\"hoists appropriately\", async () => {\nconst testDir = await initFixture(\"cold\");\n- await lernaBootstrap(testDir)(\"--hoist\");\n+ await updateLernaConfig(testDir, {\n+ hoist: true,\n+ });\n+ await lernaBootstrap(testDir)();\nexpect(installedPackagesInDirectories(testDir)).toMatchSnapshot();\nexpect(symlinkedDirectories(testDir)).toMatchSnapshot();\n@@ -301,7 +305,15 @@ describe(\"BootstrapCommand\", () => {\nit(\"hoists appropriately\", async () => {\nconst testDir = await initFixture(\"warm\");\n- await lernaBootstrap(testDir)(\"--hoist\");\n+ await updateLernaConfig(testDir, {\n+ command: {\n+ // \"commands\" also supported\n+ bootstrap: {\n+ hoist: true,\n+ },\n+ },\n+ });\n+ await lernaBootstrap(testDir)();\nexpect(installedPackagesInDirectories(testDir)).toMatchSnapshot();\nexpect(symlinkedDirectories(testDir)).toMatchSnapshot();\n",
"new_path": "commands/bootstrap/__tests__/bootstrap-command.test.js",
"old_path": "commands/bootstrap/__tests__/bootstrap-command.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -212,7 +212,19 @@ class BootstrapCommand extends Command {\nlet hoisting;\nif (hoist) {\n- hoisting = [].concat(hoist, nohoist || []);\n+ if (hoist === true) {\n+ // lerna.json `hoist: true`\n+ hoisting = [\"**\"];\n+ } else {\n+ // `--hoist ...` or lerna.json `hoist: [...]`\n+ hoisting = [].concat(hoist);\n+ }\n+\n+ if (nohoist) {\n+ // `--nohoist ...` or lerna.json `nohoist: [...]`\n+ hoisting = hoisting.concat(nohoist);\n+ }\n+\ntracker.verbose(\"hoist\", \"using globs %j\", hoisting);\n}\n",
"new_path": "commands/bootstrap/index.js",
"old_path": "commands/bootstrap/index.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
fix: Respect durable hoist configuration
fixes #1325
| 1
|
fix
| null |
217,922
|
19.03.2018 14:44:12
| -3,600
|
eea0aa30ce6f9bf43410d1d8849a59ea8cbe9950
|
fix(beta): unable to link nickname to profile
closes
|
[
{
"change_type": "MODIFY",
"diff": "@@ -29,10 +29,13 @@ export class NicknamePopupComponent {\nconst user = this.data.user;\nuser.nickname = this.nickname;\nthis.linkService.getAllByAuthor(user.$key).mergeMap(links => {\n+ if (links.length > 0) {\nreturn Observable.combineLatest(links.map(link => {\nlink.authorNickname = user.nickname;\nreturn this.linkService.set(link.$key, link);\n}));\n+ }\n+ return Observable.of(null);\n})\n.mergeMap(() => this.userService.set(user.$key, user))\n.first()\n",
"new_path": "src/app/pages/profile/nickname-popup/nickname-popup.component.ts",
"old_path": "src/app/pages/profile/nickname-popup/nickname-popup.component.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
fix(beta): unable to link nickname to profile
closes #280
| 1
|
fix
|
beta
|
217,922
|
19.03.2018 14:45:43
| -3,600
|
8fc3077f9727c71189ba5c5ae8544b00af992233
|
fix(beta): patreon email linking is case-sensitive (not anymore)
|
[
{
"change_type": "MODIFY",
"diff": "@@ -88,7 +88,7 @@ export class UserService extends FirebaseStorage<AppUser> {\nreturn Observable.of(u);\n}\nreturn this.firebase.list('/patreon/supporters').valueChanges().map((supporters: { email: string }[]) => {\n- u.patron = supporters.find(s => s.email === u.patreonEmail) !== undefined;\n+ u.patron = supporters.find(s => s.email.toLowerCase() === u.patreonEmail.toLowerCase()) !== undefined;\nreturn u;\n});\n});\n",
"new_path": "src/app/core/database/user.service.ts",
"old_path": "src/app/core/database/user.service.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
fix(beta): patreon email linking is case-sensitive (not anymore)
| 1
|
fix
|
beta
|
807,849
|
19.03.2018 16:29:22
| 25,200
|
8877aa0fe63da49cee5e1c02f0ec3b4d34494f0b
|
fix(bootstrap): Move --hoist/--nohoist coerce into class
Fixes
|
[
{
"change_type": "MODIFY",
"diff": "@@ -144,6 +144,21 @@ Array [\n]\n`;\n+exports[`BootstrapCommand with hoisting should not hoist when disallowed from lerna.json 1`] = `\n+Object {\n+ \"ROOT\": Array [\n+ \"bar@^2.0.0\",\n+ \"foo@^1.0.0\",\n+ ],\n+ \"packages/package-3\": Array [\n+ \"foo@0.1.12\",\n+ ],\n+ \"packages/package-4\": Array [\n+ \"@test/package-1@^0.0.0\",\n+ ],\n+}\n+`;\n+\nexports[`BootstrapCommand with local package dependencies should bootstrap packages 1`] = `\nObject {\n\"packages/package-1\": Array [\n",
"new_path": "commands/bootstrap/__tests__/__snapshots__/bootstrap-command.test.js.snap",
"old_path": "commands/bootstrap/__tests__/__snapshots__/bootstrap-command.test.js.snap"
},
{
"change_type": "MODIFY",
"diff": "@@ -136,6 +136,18 @@ describe(\"BootstrapCommand\", () => {\nexpect(installedPackagesInDirectories(testDir)).toMatchSnapshot();\nexpect(removedDirectories(testDir)).toMatchSnapshot();\n});\n+\n+ it(\"should not hoist when disallowed from lerna.json\", async () => {\n+ const testDir = await initFixture(\"basic\");\n+\n+ await updateLernaConfig(testDir, {\n+ hoist: true,\n+ nohoist: [\"@test/package-1\"],\n+ });\n+ await lernaBootstrap(testDir)();\n+\n+ expect(installedPackagesInDirectories(testDir)).toMatchSnapshot();\n+ });\n});\ndescribe(\"with --npm-client and --hoist\", () => {\n",
"new_path": "commands/bootstrap/__tests__/bootstrap-command.test.js",
"old_path": "commands/bootstrap/__tests__/bootstrap-command.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -21,32 +21,12 @@ exports.builder = yargs => {\ngroup: \"Command Options:\",\ndescribe: \"Install external dependencies matching [glob] to the repo root\",\ndefaultDescription: \"'**'\",\n- coerce: arg => {\n- // `--hoist` is equivalent to `--hoist=**`.\n- if (arg === true) {\n- return [\"**\"];\n- }\n-\n- if (arg && !Array.isArray(arg)) {\n- return [arg];\n- }\n-\n- return arg;\n- },\n},\nnohoist: {\ngroup: \"Command Options:\",\ndescribe: \"Don't hoist external dependencies matching [glob] to the repo root\",\ntype: \"string\",\nrequiresArg: true,\n- coerce: arg => {\n- // negate any globs passed\n- if (!Array.isArray(arg)) {\n- return [`!${arg}`];\n- }\n-\n- return arg.map(str => `!${str}`);\n- },\n},\nmutex: {\nhidden: true,\n",
"new_path": "commands/bootstrap/command.js",
"old_path": "commands/bootstrap/command.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -221,8 +221,13 @@ class BootstrapCommand extends Command {\n}\nif (nohoist) {\n- // `--nohoist ...` or lerna.json `nohoist: [...]`\n- hoisting = hoisting.concat(nohoist);\n+ if (!Array.isArray(nohoist)) {\n+ // `--nohoist` single\n+ hoisting = hoisting.concat(`!${nohoist}`);\n+ } else {\n+ // `--nohoist` multiple or lerna.json `nohoist: [...]`\n+ hoisting = hoisting.concat(nohoist.map(str => `!${str}`));\n+ }\n}\ntracker.verbose(\"hoist\", \"using globs %j\", hoisting);\n",
"new_path": "commands/bootstrap/index.js",
"old_path": "commands/bootstrap/index.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
fix(bootstrap): Move --hoist/--nohoist coerce into class
Fixes #1337
| 1
|
fix
|
bootstrap
|
679,913
|
19.03.2018 16:30:55
| 0
|
abc195a4024576497d9e253b1aab10675107e482
|
feat(transducers): add mapVals() xform
|
[
{
"change_type": "MODIFY",
"diff": "@@ -619,6 +619,9 @@ reducer and optional initial accumulator/result.\n#### `mapNth<A, B>(n: number, offset: number, fn: (x: A) => B): Transducer<A, B>`\n+#### `mapVals<A, B>(fn: (v: A) => B, copy = true): Transducer<IObjectOf<A>, IObjectOf<B>>`\n+\n+\n#### `movingAverage(n: number): Transducer<number, number>`\n#### `movingMedian<A, B>(n: number, key?: ((x: A) => B), cmp?: Comparator<B>): Transducer<A, A>`\n",
"new_path": "packages/transducers/README.md",
"old_path": "packages/transducers/README.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -50,12 +50,13 @@ export * from \"./xform/interleave\";\nexport * from \"./xform/interpose\";\nexport * from \"./xform/keep\";\nexport * from \"./xform/labeled\";\n+export * from \"./xform/map-deep\";\nexport * from \"./xform/map-indexed\";\nexport * from \"./xform/map-keys\";\nexport * from \"./xform/map-nth\";\n+export * from \"./xform/map-vals\";\nexport * from \"./xform/map\";\nexport * from \"./xform/mapcat\";\n-export * from \"./xform/map-deep\";\nexport * from \"./xform/moving-average\";\nexport * from \"./xform/moving-median\";\nexport * from \"./xform/multiplex\";\n",
"new_path": "packages/transducers/src/index.ts",
"old_path": "packages/transducers/src/index.ts"
},
{
"change_type": "ADD",
"diff": "+import { IObjectOf } from \"@thi.ng/api/api\";\n+import { Transducer } from \"../api\";\n+import { map } from \"./map\";\n+\n+export function mapVals<A, B>(fn: (v: A) => B, copy = true): Transducer<IObjectOf<A>, IObjectOf<B>> {\n+ return map((x) => {\n+ const res: any = copy ? { ...x } : x;\n+ for (let k in x) {\n+ res[k] = fn(x[k]);\n+ }\n+ return <any>res;\n+ });\n+}\n",
"new_path": "packages/transducers/src/xform/map-vals.ts",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(transducers): add mapVals() xform
| 1
|
feat
|
transducers
|
807,849
|
19.03.2018 16:32:07
| 25,200
|
19774fe32bb33544f6971e8586a37744c8be40e7
|
refactor(bootstrap): Use read-package-tree to determine installed status
|
[
{
"change_type": "MODIFY",
"diff": "@@ -90,7 +90,11 @@ class BootstrapCommand extends Command {\nreturn this.installRootPackageOnly();\n}\n- const tasks = [() => this.installExternalDependencies(), () => this.symlinkPackages()];\n+ const tasks = [\n+ () => this.getDependenciesToInstall(),\n+ result => this.installExternalDependencies(result),\n+ () => this.symlinkPackages(),\n+ ];\nif (!this.options.ignoreScripts) {\ntasks.unshift(() => this.preinstallPackages());\n@@ -203,7 +207,7 @@ class BootstrapCommand extends Command {\n* Return a object of root and leaf dependencies to install\n* @returns {Object}\n*/\n- getDependenciesToInstall(tracker) {\n+ getDependenciesToInstall() {\n// Configuration for what packages to hoist may be in lerna.json or it may\n// come in as command line options.\nconst { hoist, nohoist } = this.options;\n@@ -230,7 +234,7 @@ class BootstrapCommand extends Command {\n}\n}\n- tracker.verbose(\"hoist\", \"using globs %j\", hoisting);\n+ this.logger.verbose(\"hoist\", \"using globs %j\", hoisting);\n}\n// This will contain entries for each hoistable dependency.\n@@ -290,6 +294,9 @@ class BootstrapCommand extends Command {\n}\n}\n+ const rootActions = [];\n+ const leafActions = [];\n+\n// determine where each dependency will be installed\nfor (const [externalName, externalDependents] of depsToInstall) {\nlet rootVersion;\n@@ -305,7 +312,7 @@ class BootstrapCommand extends Command {\nrootVersion = rootExternalVersions.get(externalName) || commonVersion;\nif (rootVersion !== commonVersion) {\n- tracker.warn(\n+ this.logger.warn(\n\"EHOIST_ROOT_VERSION\",\n`The repository root depends on ${externalName}@${rootVersion}, ` +\n`which differs from the more common ${externalName}@${commonVersion}.`\n@@ -322,19 +329,23 @@ class BootstrapCommand extends Command {\n// Install the best version we can in the repo root.\n// Even if it's already installed there we still need to make sure any\n// binaries are linked to the packages that depend on them.\n+ rootActions.push(() =>\n+ hasDependencyInstalled(rootPkg, externalName, rootVersion).then(isSatisfied => {\nrootSet.add({\nname: externalName,\ndependents,\ndependency: `${externalName}@${rootVersion}`,\n- isSatisfied: hasDependencyInstalled(rootPkg, externalName, rootVersion),\n+ isSatisfied,\n});\n+ })\n+ );\n}\n// Add less common versions to package installs.\nfor (const [leafVersion, leafDependents] of externalDependents) {\nfor (const leafName of leafDependents) {\nif (rootVersion) {\n- tracker.warn(\n+ this.logger.warn(\n\"EHOIST_PKG_VERSION\",\n`\"${leafName}\" package depends on ${externalName}@${leafVersion}, ` +\n`which differs from the hoisted ${externalName}@${rootVersion}.`\n@@ -345,28 +356,32 @@ class BootstrapCommand extends Command {\nconst leafRecord = leaves.get(leafNode) || leaves.set(leafNode, new Set()).get(leafNode);\n// only install dependency if it's not already installed\n+ leafActions.push(() =>\n+ hasDependencyInstalled(leafNode.pkg, externalName, leafVersion).then(isSatisfied => {\nleafRecord.add({\ndependency: `${externalName}@${leafVersion}`,\n- isSatisfied: hasDependencyInstalled(leafNode.pkg, externalName, leafVersion),\n+ isSatisfied,\n});\n+ })\n+ );\n}\n}\n}\n- tracker.silly(\"root dependencies\", JSON.stringify(rootSet, null, 2));\n- tracker.silly(\"leaf dependencies\", JSON.stringify(leaves, null, 2));\n+ return pMapSeries([...rootActions, ...leafActions], el => el()).then(() => {\n+ this.logger.silly(\"root dependencies\", JSON.stringify(rootSet, null, 2));\n+ this.logger.silly(\"leaf dependencies\", JSON.stringify(leaves, null, 2));\nreturn { rootSet, leaves };\n+ });\n}\n/**\n* Install external dependencies for all packages\n* @returns {Promise}\n*/\n- installExternalDependencies() {\n+ installExternalDependencies({ leaves, rootSet }) {\nconst tracker = this.logger.newItem(\"install dependencies\");\n-\n- const { leaves, rootSet } = this.getDependenciesToInstall(tracker);\nconst rootPkg = this.repository.package;\nconst actions = [];\n",
"new_path": "commands/bootstrap/index.js",
"old_path": "commands/bootstrap/index.js"
},
{
"change_type": "MODIFY",
"diff": "\"use strict\";\nconst log = require(\"npmlog\");\n-const loadJsonFile = require(\"load-json-file\");\n-const path = require(\"path\");\n+const readPackageTree = require(\"read-package-tree\");\nconst semver = require(\"semver\");\n+// cache installed lookups\n+const cache = new Map();\n+\nmodule.exports = hasDependencyInstalled;\n/**\n@@ -17,15 +19,38 @@ module.exports = hasDependencyInstalled;\nfunction hasDependencyInstalled(pkg, depName, needVersion) {\nlog.silly(\"hasDependencyInstalled\", pkg.name, depName);\n- let retVal;\n- try {\n- const manifestLocation = path.join(pkg.nodeModulesLocation, depName, \"package.json\");\n- const dependency = loadJsonFile.sync(manifestLocation);\n+ return getInstalled(pkg).then(\n+ versions => versions.has(depName) && semver.satisfies(versions.get(depName), needVersion)\n+ );\n+}\n+\n+function getInstalled(pkg) {\n+ return new Promise((resolve, reject) => {\n+ if (cache.has(pkg)) {\n+ return resolve(cache.get(pkg));\n+ }\n+\n+ readPackageTree(pkg.location, filterTopLevel, (err, { children }) => {\n+ if (err) {\n+ return reject(err);\n+ }\n+\n+ const deps = new Map(children.map(({ package: { name, version } }) => [name, version]));\n+ cache.set(pkg, deps);\n+ resolve(deps);\n+ });\n+ });\n+}\n- retVal = semver.satisfies(dependency.version, needVersion);\n- } catch (e) {\n- retVal = false;\n+function filterTopLevel(node, kidName) {\n+ if (node.parent) {\n+ return false;\n}\n- return retVal;\n+ return (\n+ (node.package.dependencies && node.package.dependencies[kidName]) ||\n+ (node.package.devDependencies && node.package.devDependencies[kidName]) ||\n+ (node.package.peerDependencies && node.package.peerDependencies[kidName]) ||\n+ (node.package.optionalDependencies && node.package.optionalDependencies[kidName])\n+ );\n}\n",
"new_path": "commands/bootstrap/lib/has-dependency-installed.js",
"old_path": "commands/bootstrap/lib/has-dependency-installed.js"
},
{
"change_type": "MODIFY",
"diff": "\"@lerna/validation-error\": \"file:../../core/validation-error\",\n\"dedent\": \"^0.7.0\",\n\"get-port\": \"^3.2.0\",\n- \"load-json-file\": \"^4.0.0\",\n\"multimatch\": \"^2.1.0\",\n\"npmlog\": \"^4.1.2\",\n\"p-finally\": \"^1.0.0\",\n\"p-map\": \"^1.2.0\",\n\"p-map-series\": \"^1.0.0\",\n\"p-waterfall\": \"^1.0.0\",\n+ \"read-package-tree\": \"^5.1.6\",\n\"semver\": \"^5.5.0\"\n}\n}\n",
"new_path": "commands/bootstrap/package.json",
"old_path": "commands/bootstrap/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"@lerna/validation-error\": \"file:core/validation-error\",\n\"dedent\": \"0.7.0\",\n\"get-port\": \"3.2.0\",\n- \"load-json-file\": \"4.0.0\",\n\"multimatch\": \"2.1.0\",\n\"npmlog\": \"4.1.2\",\n\"p-finally\": \"1.0.0\",\n\"p-map\": \"1.2.0\",\n\"p-map-series\": \"1.0.0\",\n\"p-waterfall\": \"1.0.0\",\n+ \"read-package-tree\": \"5.1.6\",\n\"semver\": \"5.5.0\"\n}\n},\n\"resolved\": \"https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz\",\n\"integrity\": \"sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=\"\n},\n+ \"asap\": {\n+ \"version\": \"2.0.6\",\n+ \"resolved\": \"https://registry.npmjs.org/asap/-/asap-2.0.6.tgz\",\n+ \"integrity\": \"sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=\"\n+ },\n\"asn1\": {\n\"version\": \"0.2.3\",\n\"resolved\": \"https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz\",\n\"ms\": \"2.0.0\"\n}\n},\n+ \"debuglog\": {\n+ \"version\": \"1.0.1\",\n+ \"resolved\": \"https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz\",\n+ \"integrity\": \"sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI=\"\n+ },\n\"decamelize\": {\n\"version\": \"1.2.0\",\n\"resolved\": \"https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz\",\n\"integrity\": \"sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=\",\n\"dev\": true\n},\n+ \"dezalgo\": {\n+ \"version\": \"1.0.3\",\n+ \"resolved\": \"https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.3.tgz\",\n+ \"integrity\": \"sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY=\",\n+ \"requires\": {\n+ \"asap\": \"2.0.6\",\n+ \"wrappy\": \"1.0.2\"\n+ }\n+ },\n\"diff\": {\n\"version\": \"3.4.0\",\n\"resolved\": \"https://registry.npmjs.org/diff/-/diff-3.4.0.tgz\",\n\"slash\": \"1.0.0\"\n}\n},\n+ \"read-package-tree\": {\n+ \"version\": \"5.1.6\",\n+ \"resolved\": \"https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.1.6.tgz\",\n+ \"integrity\": \"sha512-FCX1aT3GWyY658wzDICef4p+n0dB+ENRct8E/Qyvppj6xVpOYerBHfUu7OP5Rt1/393Tdglguf5ju5DEX4wZNg==\",\n+ \"requires\": {\n+ \"debuglog\": \"1.0.1\",\n+ \"dezalgo\": \"1.0.3\",\n+ \"once\": \"1.4.0\",\n+ \"read-package-json\": \"2.0.13\",\n+ \"readdir-scoped-modules\": \"1.0.2\"\n+ }\n+ },\n\"read-pkg\": {\n\"version\": \"3.0.0\",\n\"resolved\": \"https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz\",\n\"util-deprecate\": \"1.0.2\"\n}\n},\n+ \"readdir-scoped-modules\": {\n+ \"version\": \"1.0.2\",\n+ \"resolved\": \"https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.0.2.tgz\",\n+ \"integrity\": \"sha1-n6+jfShr5dksuuve4DDcm19AZ0c=\",\n+ \"requires\": {\n+ \"debuglog\": \"1.0.1\",\n+ \"dezalgo\": \"1.0.3\",\n+ \"graceful-fs\": \"4.1.11\",\n+ \"once\": \"1.4.0\"\n+ }\n+ },\n\"realpath-native\": {\n\"version\": \"1.0.0\",\n\"resolved\": \"https://registry.npmjs.org/realpath-native/-/realpath-native-1.0.0.tgz\",\n",
"new_path": "package-lock.json",
"old_path": "package-lock.json"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
refactor(bootstrap): Use read-package-tree to determine installed status
| 1
|
refactor
|
bootstrap
|
807,849
|
19.03.2018 16:36:02
| 25,200
|
8797b075fcc5a55415149f2b6fb4ca4ae618d9d0
|
chore(release): durable --git-remote upstream
|
[
{
"change_type": "MODIFY",
"diff": "\"allowBranch\": \"master\",\n\"cdVersion\": \"prerelease\",\n\"conventionalCommits\": true,\n+ \"gitRemote\": \"upstream\",\n\"preid\": \"beta\",\n\"message\": \"chore(release): publish %s\"\n}\n",
"new_path": "lerna.json",
"old_path": "lerna.json"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
chore(release): durable --git-remote upstream
| 1
|
chore
|
release
|
679,913
|
19.03.2018 16:36:28
| 0
|
c736433439efbe6a5aeca08c4a8df1e17d8ea066
|
refactor(rstream): add/update Stream ctor arities
|
[
{
"change_type": "MODIFY",
"diff": "@@ -2,6 +2,7 @@ import { Transducer } from \"@thi.ng/transducers/api\";\nimport { DEBUG, IStream, ISubscriber, StreamCancel, StreamSource } from \"./api\";\nimport { Subscription } from \"./subscription\";\n+import { isString } from \"util\";\nexport class Stream<T> extends Subscription<T, T>\nimplements IStream<T> {\n@@ -12,7 +13,28 @@ export class Stream<T> extends Subscription<T, T>\nprotected _cancel: StreamCancel;\n- constructor(src?: StreamSource<T>, id?: string) {\n+ constructor();\n+ constructor(id: string);\n+ constructor(src: StreamSource<T>);\n+ constructor(src: StreamSource<T>, id: string);\n+ constructor(...args: any[]) {\n+ let src, id;\n+ switch (args.length) {\n+ case 0:\n+ break;\n+ case 1:\n+ if (isString(args[0])) {\n+ id = args[0];\n+ } else {\n+ src = args[0];\n+ }\n+ break;\n+ case 2:\n+ [src, id] = args;\n+ break;\n+ default:\n+ throw new Error(`illegal arity: ${args.length}`);\n+ }\nsuper(null, null, null, id || `stream-${Stream.NEXT_ID++}`);\nthis.src = src;\n}\n",
"new_path": "packages/rstream/src/stream.ts",
"old_path": "packages/rstream/src/stream.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(rstream): add/update Stream ctor arities
| 1
|
refactor
|
rstream
|
679,913
|
19.03.2018 16:36:50
| 0
|
791a993f1d83cc21e504bbba1cf7224e6854d04e
|
feat(rstream): add StreamSync
|
[
{
"change_type": "MODIFY",
"diff": "export * from \"./api\";\nexport * from \"./stream\";\nexport * from \"./stream-merge\";\n+export * from \"./stream-sync\";\nexport * from \"./subscription\";\nexport * from \"./from/atom\";\n",
"new_path": "packages/rstream/src/index.ts",
"old_path": "packages/rstream/src/index.ts"
},
{
"change_type": "ADD",
"diff": "+import { IObjectOf, IID } from \"@thi.ng/api/api\";\n+import { Transducer } from \"@thi.ng/transducers/api\";\n+import { comp } from \"@thi.ng/transducers/func/comp\";\n+import { labeled } from \"@thi.ng/transducers/xform/labeled\";\n+import { mapVals } from \"@thi.ng/transducers/xform/map-vals\";\n+import { partitionSync } from \"@thi.ng/transducers/xform/partition-sync\";\n+\n+import { ISubscribable, State } from \"./api\";\n+import { Subscription } from \"./subscription\";\n+\n+export interface StreamSyncOpts<A, B> extends IID<string> {\n+ src: Iterable<ISubscribable<A>>;\n+ xform: Transducer<IObjectOf<A>, B>;\n+ reset: boolean;\n+ all: boolean;\n+ close: boolean;\n+}\n+\n+/**\n+ * Similar to `StreamMerge`, but with extra synchronization of inputs.\n+ * Before emitting any new values, `StreamSync` collects values until at\n+ * least one has been received from *all* inputs. Once that's the case,\n+ * the collected values are sent as labeled tuple object to downstream\n+ * subscribers and the process repeats until all inputs are exhausted.\n+ *\n+ * In addition to the default mode of operation, i.e. waiting for new\n+ * values from *all* inputs before another tuple is produced, the\n+ * behavior for *all but the first tuple* can be changed to emit new\n+ * tuples as soon as a new value from any input has become available\n+ * (with other values in the tuple remaining). This behavior can be\n+ * achieved by setting the `reset` ctor option to `false`.\n+ *\n+ * Each value in the emitted tuple objects is stored under their input\n+ * stream ID. Only the last value received from each input is passed on.\n+ *\n+ * ```\n+ * sync = StreamSync({src: [a=new Stream(\"a\"), b=new Stream(\"b\")]});\n+ * sync.subscribe(trace());\n+ *\n+ * a.next(1);\n+ * b.next(2);\n+ * // { a: 1, b: 2 }\n+ * ```\n+ *\n+ * Input streams can be added and removed dynamically and the emitted\n+ * tuple size adjusts to the current number of inputs. By default,\n+ * `StreamSync` calls `done()` when the last active input is done, but\n+ * this behavior can be overridden via the `close` constructor option\n+ * (set to `false`).\n+ *\n+ * By default, the last emitted tuple is allowed to be incomplete (in\n+ * case the input closed). To only allow complete tuples, set the\n+ * optional `all` ctor option to `false`.\n+ *\n+ * The synchronization is done via the `partitionSync()` transducer from\n+ * the @thi.ng/transducers package. See this function's docs for further\n+ * details.\n+ */\n+export class StreamSync<A, B> extends Subscription<A, B> {\n+\n+ sources: Map<ISubscribable<A>, Subscription<A, [string, A]>>;\n+ sourceIDs: Set<string>;\n+ autoClose: boolean;\n+\n+ constructor(opts: Partial<StreamSyncOpts<A, B>>) {\n+ let srcIDs = new Set<string>();\n+ let xform: Transducer<any, any> = comp(\n+ partitionSync<A>(srcIDs, (x) => x[0], opts.reset !== false, opts.all !== false),\n+ mapVals((x) => x[1])\n+ );\n+ if (opts.xform) {\n+ xform = comp(xform, opts.xform);\n+ }\n+ super(null, xform, null, opts.id || `streamsync-${Subscription.NEXT_ID++}`);\n+ this.sources = new Map();\n+ this.sourceIDs = srcIDs;\n+ this.autoClose = opts.close !== false;\n+ if (opts.src) {\n+ this.addAll(opts.src);\n+ }\n+ }\n+\n+ add(src: ISubscribable<A>) {\n+ this.ensureState();\n+ this.sourceIDs.add(src.id);\n+ this.sources.set(\n+ src,\n+ src.subscribe(\n+ {\n+ next: (x) => this.next(x),\n+ done: () => this.markDone(src)\n+ },\n+ labeled<string, A>(src.id)\n+ )\n+ );\n+ }\n+\n+ addAll(src: Iterable<ISubscribable<A>>) {\n+ for (let s of src) {\n+ this.add(s);\n+ }\n+ }\n+\n+ remove(src: ISubscribable<A>) {\n+ const sub = this.sources.get(src);\n+ if (sub) {\n+ this.sourceIDs.delete(src.id);\n+ this.sources.delete(src);\n+ sub.unsubscribe();\n+ }\n+ }\n+\n+ removeAll(src: Iterable<ISubscribable<A>>) {\n+ for (let s of src) {\n+ this.remove(s);\n+ }\n+ }\n+\n+ unsubscribe(sub?: Subscription<B, any>) {\n+ if (!sub) {\n+ for (let s of this.sources.keys()) {\n+ s.unsubscribe();\n+ }\n+ this.state = State.DONE;\n+ delete this.sources;\n+ return true;\n+ }\n+ if (super.unsubscribe(sub)) {\n+ if (!this.subs.length) {\n+ return this.unsubscribe();\n+ }\n+ return true;\n+ }\n+ return false;\n+ }\n+\n+ done() {\n+ super.done();\n+ }\n+\n+ protected markDone(src: ISubscribable<A>) {\n+ this.remove(src);\n+ if (this.autoClose && !this.sources.size) {\n+ this.done();\n+ }\n+ }\n+}\n",
"new_path": "packages/rstream/src/stream-sync.ts",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(rstream): add StreamSync
| 1
|
feat
|
rstream
|
807,849
|
19.03.2018 16:37:32
| 25,200
|
903e922289e37d2a5f322a8536ee246a732cab51
|
chore(release): publish v3.0.0-beta.5
|
[
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n+<a name=\"3.0.0-beta.5\"></a>\n+# [3.0.0-beta.5](https://github.com/lerna/lerna/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2018-03-19)\n+\n+\n+### Bug Fixes\n+\n+* **bootstrap:** Move --hoist/--nohoist coerce into class ([8877aa0](https://github.com/lerna/lerna/commit/8877aa0)), closes [#1337](https://github.com/lerna/lerna/issues/1337)\n+\n+\n+\n+\n+\n<a name=\"3.0.0-beta.4\"></a>\n# [3.0.0-beta.4](https://github.com/lerna/lerna/compare/v3.0.0-beta.3...v3.0.0-beta.4) (2018-03-19)\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n+<a name=\"3.0.0-beta.5\"></a>\n+# [3.0.0-beta.5](https://github.com/lerna/lerna/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2018-03-19)\n+\n+**Note:** Version bump only for package @lerna/add\n+\n+\n+\n+\n+\n<a name=\"3.0.0-beta.4\"></a>\n# [3.0.0-beta.4](https://github.com/lerna/lerna/compare/v3.0.0-beta.3...v3.0.0-beta.4) (2018-03-19)\n",
"new_path": "commands/add/CHANGELOG.md",
"old_path": "commands/add/CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@lerna/add\",\n- \"version\": \"3.0.0-beta.4\",\n+ \"version\": \"3.0.0-beta.5\",\n\"description\": \"TODO\",\n\"keywords\": [\n\"lerna\",\n",
"new_path": "commands/add/package.json",
"old_path": "commands/add/package.json"
},
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n+<a name=\"3.0.0-beta.5\"></a>\n+# [3.0.0-beta.5](https://github.com/lerna/lerna/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2018-03-19)\n+\n+\n+### Bug Fixes\n+\n+* **bootstrap:** Move --hoist/--nohoist coerce into class ([8877aa0](https://github.com/lerna/lerna/commit/8877aa0)), closes [#1337](https://github.com/lerna/lerna/issues/1337)\n+\n+\n+\n+\n+\n<a name=\"3.0.0-beta.4\"></a>\n# [3.0.0-beta.4](https://github.com/lerna/lerna/compare/v3.0.0-beta.3...v3.0.0-beta.4) (2018-03-19)\n",
"new_path": "commands/bootstrap/CHANGELOG.md",
"old_path": "commands/bootstrap/CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@lerna/bootstrap\",\n- \"version\": \"3.0.0-beta.4\",\n+ \"version\": \"3.0.0-beta.5\",\n\"description\": \"TODO\",\n\"keywords\": [\n\"lerna\",\n",
"new_path": "commands/bootstrap/package.json",
"old_path": "commands/bootstrap/package.json"
},
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n+<a name=\"3.0.0-beta.5\"></a>\n+# [3.0.0-beta.5](https://github.com/lerna/lerna/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2018-03-19)\n+\n+**Note:** Version bump only for package @lerna/cli\n+\n+\n+\n+\n+\n<a name=\"3.0.0-beta.4\"></a>\n# [3.0.0-beta.4](https://github.com/lerna/lerna/compare/v3.0.0-beta.3...v3.0.0-beta.4) (2018-03-19)\n",
"new_path": "core/cli/CHANGELOG.md",
"old_path": "core/cli/CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@lerna/cli\",\n- \"version\": \"3.0.0-beta.4\",\n+ \"version\": \"3.0.0-beta.5\",\n\"description\": \"TODO\",\n\"keywords\": [\n\"lerna\",\n",
"new_path": "core/cli/package.json",
"old_path": "core/cli/package.json"
},
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n+<a name=\"3.0.0-beta.5\"></a>\n+# [3.0.0-beta.5](https://github.com/lerna/lerna/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2018-03-19)\n+\n+**Note:** Version bump only for package lerna\n+\n+\n+\n+\n+\n<a name=\"3.0.0-beta.4\"></a>\n# [3.0.0-beta.4](https://github.com/lerna/lerna/compare/v3.0.0-beta.3...v3.0.0-beta.4) (2018-03-19)\n",
"new_path": "core/lerna/CHANGELOG.md",
"old_path": "core/lerna/CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"lerna\",\n- \"version\": \"3.0.0-beta.4\",\n+ \"version\": \"3.0.0-beta.5\",\n\"description\": \"A tool for managing JavaScript projects with multiple packages.\",\n\"keywords\": [\n\"lerna\",\n",
"new_path": "core/lerna/package.json",
"old_path": "core/lerna/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"**/__tests__/**\",\n\"**/*.md\"\n],\n- \"version\": \"3.0.0-beta.4\"\n+ \"version\": \"3.0.0-beta.5\"\n}\n",
"new_path": "lerna.json",
"old_path": "lerna.json"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
chore(release): publish v3.0.0-beta.5
| 1
|
chore
|
release
|
217,922
|
19.03.2018 16:47:05
| -3,600
|
c28cab3e36e69e628610569340887468313333fa
|
chore: add navigation optimized path implementation
TODO: design for that
|
[
{
"change_type": "MODIFY",
"diff": "@@ -6,10 +6,17 @@ import {Aetheryte} from '../../core/data/aetheryte';\nimport {aetherytes} from '../../core/data/sources/aetherytes';\nimport {Vector2} from '../../core/tools/vector2';\nimport {MathToolsService} from '../../core/tools/math-tools';\n+import {NavigationStep} from './navigation-step';\n@Injectable()\nexport class MapService {\n+ // Flying mount speed, used as reference for TP over mount comparison, needs a precise recording.\n+ private static readonly MOUNT_SPEED = 5;\n+\n+ // TP duration on the same map, this is an average.\n+ private static readonly TP_DURATION = 8;\n+\ndata: Observable<MapData[]>;\nconstructor(private http: HttpClient, private mathService: MathToolsService) {\n@@ -47,6 +54,99 @@ export class MapService {\nreturn nearest;\n}\n+ public getOptimizedPath(mapId: number, points: Vector2[]): Observable<NavigationStep[]> {\n+ return this.getMapById(mapId)\n+ .map(mapData => {\n+ // We only want big aetherytes.\n+ const bigAetherytes = mapData.aetherytes.filter(ae => ae.type === 0);\n+ const paths = bigAetherytes.map(aetheryte => this.getShortestPath(aetheryte, points, bigAetherytes));\n+ return paths.sort((a, b) => this.totalDuration(a) - this.totalDuration(b))[0];\n+ });\n+ }\n+\n+ private totalDuration(path: NavigationStep[]): number {\n+ let duration = 0;\n+ path.forEach((step, index) => {\n+ // Don't take the first tp into consideration.\n+ if (index === 0) {\n+ return;\n+ }\n+ if (step.isTeleport) {\n+ duration += MapService.TP_DURATION;\n+ } else {\n+ const previousStep = path[index - 1];\n+ duration += this.mathService.distance(previousStep, step) / MapService.MOUNT_SPEED;\n+ }\n+ });\n+ return duration;\n+ }\n+\n+ private getShortestPath(start: Aetheryte, points: Vector2[], availableAetherytes: Aetheryte[]): NavigationStep[] {\n+ // First of all, compile all steps we have available\n+ let availablePoints: NavigationStep[] =\n+ points.map(point => ({\n+ x: point.x,\n+ y: point.y,\n+ isTeleport: false\n+ }));\n+ const availableAetherytesPoints: NavigationStep[] = availableAetherytes.map(aetheryte => ({\n+ x: aetheryte.x,\n+ y: aetheryte.y,\n+ isTeleport: true\n+ }));\n+ const steps: NavigationStep[] = [];\n+ steps.push({x: start.x, y: start.y, isTeleport: true});\n+ // While there's more steps to add\n+ while (availablePoints.length > 0) {\n+ // First of all, fill with dummy values to start the comparison\n+ let closestTpPlusMove = {tp: availableAetherytesPoints[0], moveTo: availablePoints[0]};\n+ // First of all, compute teleport + travel times\n+ for (const tp of availableAetherytesPoints) {\n+ let closest = availablePoints[0];\n+ let closestDistance = this.mathService.distance(tp, closest);\n+ for (const step of availablePoints) {\n+ if (this.mathService.distance(tp, step) < closestDistance) {\n+ closest = step;\n+ closestDistance = this.mathService.distance(tp, closest);\n+ }\n+ }\n+ if (closestDistance < this.mathService.distance(closestTpPlusMove.tp, closestTpPlusMove.moveTo)) {\n+ closestTpPlusMove = {tp: tp, moveTo: closest};\n+ }\n+ }\n+ // This is the fastest tp + move combination duration.\n+ const tpPlusMoveDuration = MapService.TP_DURATION +\n+ (this.mathService.distance(closestTpPlusMove.tp, closestTpPlusMove.moveTo) / MapService.MOUNT_SPEED);\n+\n+ // Now check the closest point without TP.\n+ // Use our current position as reference\n+ const currentPosition = steps[steps.length - 1];\n+ // Fill with the first value to start the comparison.\n+ let closestPoint = availablePoints[0];\n+ let closestPointDistance = this.mathService.distance(currentPosition, closestPoint);\n+ for (const point of availablePoints) {\n+ if (this.mathService.distance(currentPosition, point) < closestPointDistance) {\n+ closestPoint = point;\n+ closestPointDistance = this.mathService.distance(currentPosition, closestPoint);\n+ }\n+ }\n+\n+ // This is the fastest mount travel duration to any of the points.\n+ const closestPointMountDuration = closestPointDistance / MapService.MOUNT_SPEED;\n+\n+ // If the closest point can be reached using a mount (or is equal to TP, but in this case we'll use mount).\n+ if (closestPointMountDuration <= tpPlusMoveDuration) {\n+ steps.push(closestPoint);\n+ availablePoints = availablePoints.filter(point => point !== closestPoint);\n+ } else {\n+ // Else, add aetheryte step plus move step\n+ steps.push(closestTpPlusMove.tp, closestTpPlusMove.moveTo);\n+ availablePoints = availablePoints.filter(point => point !== closestTpPlusMove.moveTo);\n+ }\n+ }\n+ return steps;\n+ }\n+\ngetPositionOnMap(map: MapData, position: Vector2): Vector2 {\nconst scale = map.size_factor / 100;\n",
"new_path": "src/app/modules/map/map.service.ts",
"old_path": "src/app/modules/map/map.service.ts"
},
{
"change_type": "ADD",
"diff": "+import {Vector2} from '../../core/tools/vector2';\n+\n+export interface NavigationStep extends Vector2 {\n+ isTeleport: boolean;\n+}\n",
"new_path": "src/app/modules/map/navigation-step.ts",
"old_path": null
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore: add navigation optimized path implementation
TODO: design for that
| 1
|
chore
| null |
807,849
|
19.03.2018 16:52:01
| 25,200
|
df5b91083ef8e27c7ea18bbddc028bec7624ca54
|
chore(release): publish v3.0.0-beta.6
|
[
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n+<a name=\"3.0.0-beta.6\"></a>\n+# [3.0.0-beta.6](https://github.com/lerna/lerna/compare/v3.0.0-beta.5...v3.0.0-beta.6) (2018-03-19)\n+\n+**Note:** Version bump only for package lerna\n+\n+\n+\n+\n+\n<a name=\"3.0.0-beta.5\"></a>\n# [3.0.0-beta.5](https://github.com/lerna/lerna/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2018-03-19)\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n+<a name=\"3.0.0-beta.6\"></a>\n+# [3.0.0-beta.6](https://github.com/lerna/lerna/compare/v3.0.0-beta.5...v3.0.0-beta.6) (2018-03-19)\n+\n+**Note:** Version bump only for package @lerna/add\n+\n+\n+\n+\n+\n<a name=\"3.0.0-beta.5\"></a>\n# [3.0.0-beta.5](https://github.com/lerna/lerna/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2018-03-19)\n",
"new_path": "commands/add/CHANGELOG.md",
"old_path": "commands/add/CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@lerna/add\",\n- \"version\": \"3.0.0-beta.5\",\n+ \"version\": \"3.0.0-beta.6\",\n\"description\": \"TODO\",\n\"keywords\": [\n\"lerna\",\n",
"new_path": "commands/add/package.json",
"old_path": "commands/add/package.json"
},
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n+<a name=\"3.0.0-beta.6\"></a>\n+# [3.0.0-beta.6](https://github.com/lerna/lerna/compare/v3.0.0-beta.5...v3.0.0-beta.6) (2018-03-19)\n+\n+**Note:** Version bump only for package @lerna/bootstrap\n+\n+\n+\n+\n+\n<a name=\"3.0.0-beta.5\"></a>\n# [3.0.0-beta.5](https://github.com/lerna/lerna/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2018-03-19)\n",
"new_path": "commands/bootstrap/CHANGELOG.md",
"old_path": "commands/bootstrap/CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@lerna/bootstrap\",\n- \"version\": \"3.0.0-beta.5\",\n+ \"version\": \"3.0.0-beta.6\",\n\"description\": \"TODO\",\n\"keywords\": [\n\"lerna\",\n",
"new_path": "commands/bootstrap/package.json",
"old_path": "commands/bootstrap/package.json"
},
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n+<a name=\"3.0.0-beta.6\"></a>\n+# [3.0.0-beta.6](https://github.com/lerna/lerna/compare/v3.0.0-beta.5...v3.0.0-beta.6) (2018-03-19)\n+\n+**Note:** Version bump only for package @lerna/cli\n+\n+\n+\n+\n+\n<a name=\"3.0.0-beta.5\"></a>\n# [3.0.0-beta.5](https://github.com/lerna/lerna/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2018-03-19)\n",
"new_path": "core/cli/CHANGELOG.md",
"old_path": "core/cli/CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@lerna/cli\",\n- \"version\": \"3.0.0-beta.5\",\n+ \"version\": \"3.0.0-beta.6\",\n\"description\": \"TODO\",\n\"keywords\": [\n\"lerna\",\n",
"new_path": "core/cli/package.json",
"old_path": "core/cli/package.json"
},
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n+<a name=\"3.0.0-beta.6\"></a>\n+# [3.0.0-beta.6](https://github.com/lerna/lerna/compare/v3.0.0-beta.5...v3.0.0-beta.6) (2018-03-19)\n+\n+**Note:** Version bump only for package lerna\n+\n+\n+\n+\n+\n<a name=\"3.0.0-beta.5\"></a>\n# [3.0.0-beta.5](https://github.com/lerna/lerna/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2018-03-19)\n",
"new_path": "core/lerna/CHANGELOG.md",
"old_path": "core/lerna/CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"lerna\",\n- \"version\": \"3.0.0-beta.5\",\n+ \"version\": \"3.0.0-beta.6\",\n\"description\": \"A tool for managing JavaScript projects with multiple packages.\",\n\"keywords\": [\n\"lerna\",\n",
"new_path": "core/lerna/package.json",
"old_path": "core/lerna/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"**/__tests__/**\",\n\"**/*.md\"\n],\n- \"version\": \"3.0.0-beta.5\"\n+ \"version\": \"3.0.0-beta.6\"\n}\n",
"new_path": "lerna.json",
"old_path": "lerna.json"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
chore(release): publish v3.0.0-beta.6
| 1
|
chore
|
release
|
679,913
|
19.03.2018 16:59:49
| 0
|
f7029efd4acf1ac045b1a70a77ae528cb985a7dc
|
refactor(rstream): minor cleanup/perf StreamSync
|
[
{
"change_type": "MODIFY",
"diff": "@@ -66,7 +66,7 @@ export class StreamSync<A, B> extends Subscription<A, B> {\nlet srcIDs = new Set<string>();\nlet xform: Transducer<any, any> = comp(\npartitionSync<A>(srcIDs, (x) => x[0], opts.reset !== false, opts.all !== false),\n- mapVals((x) => x[1])\n+ mapVals((x) => x[1], false)\n);\nif (opts.xform) {\nxform = comp(xform, opts.xform);\n@@ -134,10 +134,6 @@ export class StreamSync<A, B> extends Subscription<A, B> {\nreturn false;\n}\n- done() {\n- super.done();\n- }\n-\nprotected markDone(src: ISubscribable<A>) {\nthis.remove(src);\nif (this.autoClose && !this.sources.size) {\n",
"new_path": "packages/rstream/src/stream-sync.ts",
"old_path": "packages/rstream/src/stream-sync.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(rstream): minor cleanup/perf StreamSync
| 1
|
refactor
|
rstream
|
679,913
|
19.03.2018 17:04:08
| 0
|
ff802a45273a8dc53a1487d8dae3ca446573aacc
|
refactor(rstream): simplify StreamMerge source handling
|
[
{
"change_type": "MODIFY",
"diff": "@@ -19,15 +19,13 @@ export interface StreamMergeOpts<A, B> extends IID<string> {\n*/\nexport class StreamMerge<A, B> extends Subscription<A, B> {\n- sources: ISubscribable<A>[];\n- wrappedSources: Subscription<A, any>[];\n+ sources: Map<ISubscribable<A>, Subscription<A, any>>;\nautoClose: boolean;\nconstructor(opts?: Partial<StreamMergeOpts<A, B>>) {\nopts = opts || {};\nsuper(null, opts.xform, null, opts.id || `streammerge-${Subscription.NEXT_ID++}`);\n- this.sources = [];\n- this.wrappedSources = [];\n+ this.sources = new Map();\nthis.autoClose = opts.close !== false;\nif (opts.src) {\nthis.addAll(opts.src);\n@@ -36,12 +34,12 @@ export class StreamMerge<A, B> extends Subscription<A, B> {\nadd(src: ISubscribable<A>) {\nthis.ensureState();\n- this.wrappedSources.push(\n+ this.sources.set(\n+ src,\nsrc.subscribe({\nnext: (x) => this.next(x),\ndone: () => this.markDone(src)\n}));\n- this.sources.push(src);\n}\naddAll(src: Iterable<ISubscribable<A>>) {\n@@ -51,10 +49,9 @@ export class StreamMerge<A, B> extends Subscription<A, B> {\n}\nremove(src: ISubscribable<A>) {\n- const idx = this.sources.indexOf(src);\n- if (idx >= 0) {\n- this.sources.splice(idx, 1);\n- const sub = this.wrappedSources.splice(idx, 1)[0];\n+ const sub = this.sources.get(src);\n+ if (sub) {\n+ this.sources.delete(src);\nsub.unsubscribe();\n}\n}\n@@ -67,12 +64,11 @@ export class StreamMerge<A, B> extends Subscription<A, B> {\nunsubscribe(sub?: Subscription<B, any>) {\nif (!sub) {\n- for (let s of this.wrappedSources) {\n+ for (let s of this.sources.keys()) {\ns.unsubscribe();\n}\nthis.state = State.DONE;\ndelete this.sources;\n- delete this.wrappedSources;\nreturn true;\n}\nif (super.unsubscribe(sub)) {\n@@ -84,14 +80,9 @@ export class StreamMerge<A, B> extends Subscription<A, B> {\nreturn false;\n}\n- done() {\n- super.done();\n- delete this.wrappedSources;\n- }\n-\nprotected markDone(src: ISubscribable<A>) {\nthis.remove(src);\n- if (this.autoClose && !this.sources.length) {\n+ if (this.autoClose && !this.sources.size) {\nthis.done();\n}\n}\n",
"new_path": "packages/rstream/src/stream-merge.ts",
"old_path": "packages/rstream/src/stream-merge.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(rstream): simplify StreamMerge source handling
| 1
|
refactor
|
rstream
|
791,723
|
19.03.2018 17:13:09
| 25,200
|
8b02a903d6a293754705cc41a4c784de331d6b9e
|
core(runner): add custom folder support to -G/-A
|
[
{
"change_type": "MODIFY",
"diff": "@@ -73,8 +73,8 @@ function getFlags(manualArgv) {\n'disable-cpu-throttling': 'Disable CPU throttling',\n'disable-network-throttling': 'Disable network throttling',\n'gather-mode':\n- 'Collect artifacts from a connected browser and save to disk. If audit-mode is not also enabled, the run will quit early.',\n- 'audit-mode': 'Process saved artifacts from disk',\n+ 'Collect artifacts from a connected browser and save to disk. (Artifacts folder path may optionally be provided). If audit-mode is not also enabled, the run will quit early.',\n+ 'audit-mode': 'Process saved artifacts from disk. (Artifacts folder path may be provided, otherwise defaults to ./latest-run/)',\n'save-assets': 'Save the trace contents & screenshots to disk',\n'list-all-audits': 'Prints a list of all available audits and exits',\n'list-trace-categories': 'Prints a list of all required trace categories and exits',\n@@ -111,7 +111,7 @@ function getFlags(manualArgv) {\n'disable-storage-reset', 'disable-device-emulation', 'disable-cpu-throttling',\n'disable-network-throttling', 'save-assets', 'list-all-audits',\n'list-trace-categories', 'perf', 'view', 'verbose', 'quiet', 'help',\n- 'gather-mode', 'audit-mode', 'mixed-content',\n+ 'mixed-content',\n])\n.choices('output', printer.getValidOutputOptions())\n// force as an array\n",
"new_path": "lighthouse-cli/cli-flags.js",
"old_path": "lighthouse-cli/cli-flags.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -18,8 +18,6 @@ const path = require('path');\nconst URL = require('./lib/url-shim');\nconst Sentry = require('./lib/sentry');\n-const basePath = path.join(process.cwd(), 'latest-run');\n-\nclass Runner {\nstatic run(connection, opts) {\n// Clean opts input.\n@@ -68,11 +66,20 @@ class Runner {\n// Gather phase\n// Either load saved artifacts off disk, from config, or get from the browser\nif (opts.flags.auditMode && !opts.flags.gatherMode) {\n- run = run.then(_ => Runner._loadArtifactsFromDisk());\n+ const path = Runner._getArtifactsPath(opts.flags);\n+ run = run.then(_ => Runner._loadArtifactsFromDisk(path));\n} else if (opts.config.artifacts) {\nrun = run.then(_ => opts.config.artifacts);\n} else {\nrun = run.then(_ => Runner._gatherArtifactsFromBrowser(opts, connection));\n+ // -G means save these to ./latest-run, etc.\n+ if (opts.flags.gatherMode) {\n+ run = run.then(async artifacts => {\n+ const path = Runner._getArtifactsPath(opts.flags);\n+ await Runner._saveArtifacts(artifacts, path);\n+ return artifacts;\n+ });\n+ }\n}\n// Potentially quit early\n@@ -123,10 +130,11 @@ class Runner {\n/**\n* No browser required, just load the artifacts from disk\n+ * @param {string} path\n* @return {!Promise<!Artifacts>}\n*/\n- static _loadArtifactsFromDisk() {\n- return assetSaver.loadArtifacts(basePath);\n+ static _loadArtifactsFromDisk(path) {\n+ return assetSaver.loadArtifacts(path);\n}\n/**\n@@ -135,27 +143,23 @@ class Runner {\n* @param {*} connection\n* @return {!Promise<!Artifacts>}\n*/\n- static _gatherArtifactsFromBrowser(opts, connection) {\n+ static async _gatherArtifactsFromBrowser(opts, connection) {\nif (!opts.config.passes) {\nreturn Promise.reject(new Error('No browser artifacts are either provided or requested.'));\n}\nopts.driver = opts.driverMock || new Driver(connection);\n- return GatherRunner.run(opts.config.passes, opts).then(artifacts => {\n- const flags = opts.flags;\n- const shouldSave = flags.gatherMode;\n- const p = shouldSave ? Runner._saveArtifacts(artifacts): Promise.resolve();\n- return p.then(_ => artifacts);\n- });\n+ return GatherRunner.run(opts.config.passes, opts);\n}\n/**\n* Save collected artifacts to disk\n* @param {!Artifacts} artifacts\n+ * @param {string} path\n* @return {!Promise>}\n*/\n- static _saveArtifacts(artifacts) {\n- return assetSaver.saveArtifacts(artifacts, basePath);\n+ static _saveArtifacts(artifacts, path) {\n+ return assetSaver.saveArtifacts(artifacts, path);\n}\n/**\n@@ -410,6 +414,18 @@ class Runner {\nextraHeaders: flags.extraHeaders || {},\n};\n}\n+\n+ /**\n+ * Get path to use for -G and -A modes. Defaults to $CWD/latest-run\n+ * @param {Flags} flags\n+ * @return {string}\n+ */\n+ static _getArtifactsPath(flags) {\n+ // This enables usage like: -GA=./custom-folder\n+ if (typeof flags.auditMode === 'string') return path.resolve(process.cwd(), flags.auditMode);\n+ if (typeof flags.gatherMode === 'string') return path.resolve(process.cwd(), flags.gatherMode);\n+ return path.join(process.cwd(), 'latest-run');\n+ }\n}\nmodule.exports = Runner;\n",
"new_path": "lighthouse-core/runner.js",
"old_path": "lighthouse-core/runner.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -11,9 +11,11 @@ const driverMock = require('./gather/fake-driver');\nconst Config = require('../config/config');\nconst Audit = require('../audits/audit');\nconst assetSaver = require('../lib/asset-saver');\n+const fs = require('fs');\nconst assert = require('assert');\nconst path = require('path');\nconst sinon = require('sinon');\n+const rimraf = require('rimraf');\nconst computedArtifacts = Runner.instantiateComputedArtifacts();\n@@ -44,9 +46,15 @@ describe('Runner', () => {\n}],\naudits: ['content-width'],\n});\n+ const artifactsPath = '.tmp/test_artifacts';\n+ const resolvedPath = path.resolve(process.cwd(), artifactsPath);\n+\n+ after(() => {\n+ rimraf.sync(resolvedPath);\n+ });\nit('-G gathers, quits, and doesn\\'t run audits', () => {\n- const opts = {url, config: generateConfig(), driverMock, flags: {gatherMode: true}};\n+ const opts = {url, config: generateConfig(), driverMock, flags: {gatherMode: artifactsPath}};\nreturn Runner.run(null, opts).then(_ => {\nassert.equal(loadArtifactsSpy.called, false, 'loadArtifacts was called');\n@@ -57,12 +65,15 @@ describe('Runner', () => {\nassert.equal(gatherRunnerRunSpy.called, true, 'GatherRunner.run was not called');\nassert.equal(runAuditSpy.called, false, '_runAudit was called');\n+\n+ assert.ok(fs.existsSync(resolvedPath));\n+ assert.ok(fs.existsSync(`${resolvedPath}/artifacts.json`));\n});\n});\n// uses the files on disk from the -G test. ;)\nit('-A audits from saved artifacts and doesn\\'t gather', () => {\n- const opts = {url, config: generateConfig(), driverMock, flags: {auditMode: true}};\n+ const opts = {url, config: generateConfig(), driverMock, flags: {auditMode: artifactsPath}};\nreturn Runner.run(null, opts).then(_ => {\nassert.equal(loadArtifactsSpy.called, true, 'loadArtifacts was not called');\nassert.equal(gatherRunnerRunSpy.called, false, 'GatherRunner.run was called');\n@@ -73,7 +84,7 @@ describe('Runner', () => {\nit('-GA is a normal run but it saves artifacts to disk', () => {\nconst opts = {url, config: generateConfig(), driverMock,\n- flags: {auditMode: true, gatherMode: true}};\n+ flags: {auditMode: artifactsPath, gatherMode: artifactsPath}};\nreturn Runner.run(null, opts).then(_ => {\nassert.equal(loadArtifactsSpy.called, false, 'loadArtifacts was called');\nassert.equal(gatherRunnerRunSpy.called, true, 'GatherRunner.run was not called');\n",
"new_path": "lighthouse-core/test/runner-test.js",
"old_path": "lighthouse-core/test/runner-test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -141,6 +141,10 @@ lighthouse -A http://example.com\nlighthouse -GA http://example.com\n# Normal gather + audit run, but also saves collected artifacts to disk for subsequent -A runs.\n+\n+\n+# You can optionally provide a custom folder destination to -G/-A/-GA. Without a value, the default will be `$PWD/latest-run`.\n+lighthouse -GA=./gmailartifacts https://gmail.com\n```\n",
"new_path": "readme.md",
"old_path": "readme.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -22,8 +22,8 @@ declare namespace LH {\nenableErrorReporting: boolean;\nlistAllAudits: boolean;\nlistTraceCategories: boolean;\n- auditMode: boolean;\n- gatherMode: boolean;\n+ auditMode: boolean|string;\n+ gatherMode: boolean|string;\nconfigPath?: string;\nperf: boolean;\nmixedContent: boolean;\n",
"new_path": "typings/externs.d.ts",
"old_path": "typings/externs.d.ts"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
core(runner): add custom folder support to -G/-A (#4792)
| 1
|
core
|
runner
|
807,849
|
19.03.2018 17:39:47
| 25,200
|
bb2c5e86e37f3526e28b317e2fbd848f172a561b
|
fix(cli): Retrieve correct version
|
[
{
"change_type": "MODIFY",
"diff": "@@ -6,12 +6,13 @@ const tempy = require(\"tempy\");\n// helpers\nconst initFixture = require(\"@lerna-test/init-fixture\")(__dirname);\n-const lernaVersion = require(\"../package.json\").version;\n// file under test\nconst lernaInit = require(\"@lerna-test/command-runner\")(require(\"../command\"));\ndescribe(\"InitCommand\", () => {\n+ const lernaVersion = \"__TEST_VERSION__\";\n+\ndescribe(\"in an empty directory\", () => {\nit(\"initializes git repo with lerna files\", async () => {\nconst testDir = tempy.directory();\n",
"new_path": "commands/init/__tests__/init-command.test.js",
"old_path": "commands/init/__tests__/init-command.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -47,7 +47,7 @@ describe(\"core-command\", () => {\ndescribe(\".lernaVersion\", () => {\nit(\"should be added to the instance\", async () => {\n- expect(testFactory().lernaVersion).toEqual(LERNA_VERSION);\n+ expect(testFactory({ lernaVersion: \"__TEST__\" }).lernaVersion).toBe(\"__TEST__\");\n});\n});\n",
"new_path": "core/command/__tests__/command.test.js",
"old_path": "core/command/__tests__/command.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -18,7 +18,6 @@ const logPackageError = require(\"./lib/log-package-error\");\nconst warnIfHanging = require(\"./lib/warn-if-hanging\");\nconst DEFAULT_CONCURRENCY = 4;\n-const LERNA_VERSION = require(\"./package.json\").version; // FIXME: this is wrong now\nclass Command {\nconstructor(argv) {\n@@ -28,7 +27,7 @@ class Command {\nthis._argv = argv;\nlog.silly(\"argv\", argv);\n- this.lernaVersion = LERNA_VERSION;\n+ this.lernaVersion = argv.lernaVersion;\nlog.info(\"version\", this.lernaVersion);\n// \"FooCommand\" => \"foo\"\n",
"new_path": "core/command/index.js",
"old_path": "core/command/index.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -8,5 +8,7 @@ const importLocal = require(\"import-local\");\nif (importLocal(__filename)) {\nrequire(\"npmlog\").info(\"cli\", \"using local version of lerna\");\n} else {\n- require(\"@lerna/cli\")(process.argv.slice(2)).parse();\n+ const pkg = require(\"./package.json\");\n+\n+ require(\"@lerna/cli\")().parse(process.argv.slice(2), { lernaVersion: pkg.version });\n}\n",
"new_path": "core/lerna/cli.js",
"old_path": "core/lerna/cli.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -33,6 +33,7 @@ function commandRunner(commandModule) {\nconst context = {\ncwd,\n+ lernaVersion: \"__TEST_VERSION__\",\nonResolved: result => {\n// success resolves the result, if any, returned from execute()\nresolve(Object.assign({}, result, yargsMeta));\n",
"new_path": "helpers/command-runner/index.js",
"old_path": "helpers/command-runner/index.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
fix(cli): Retrieve correct version
| 1
|
fix
|
cli
|
807,849
|
19.03.2018 17:44:07
| 25,200
|
7c1b1ce9b1ef1aa2f981b727d78d1e335578dead
|
test: fix lint error
|
[
{
"change_type": "MODIFY",
"diff": "@@ -18,8 +18,6 @@ const gitCommit = require(\"@lerna-test/git-commit\");\nconst gitTag = require(\"@lerna-test/git-tag\");\nconst updateLernaConfig = require(\"@lerna-test/update-lerna-config\");\n-const LERNA_VERSION = require(\"../package.json\").version;\n-\n// file under test\nconst Command = require(\"..\");\n",
"new_path": "core/command/__tests__/command.test.js",
"old_path": "core/command/__tests__/command.test.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
test: fix lint error
| 1
|
test
| null |
791,834
|
19.03.2018 18:07:14
| 25,200
|
adf4f86dcef08d263bb6d77e117659a53d3c2002
|
core(tsc): add type defs for Chrome Remote Debugging Protocol
|
[
{
"change_type": "MODIFY",
"diff": "\"npm-run-posix-or-windows\": \"^2.0.2\",\n\"sinon\": \"^2.3.5\",\n\"typescript\": \"^2.8.0-rc\",\n+ \"vscode-chrome-debug-core\": \"^3.23.8\",\n\"zone.js\": \"^0.7.3\"\n},\n\"dependencies\": {\n",
"new_path": "package.json",
"old_path": "package.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-declare namespace LH.Audit {\n+declare global {\n+ module LH.Audit {\nexport interface ScoringModes {\nNUMERIC: 'numeric';\nBINARY: 'binary';\n@@ -86,3 +87,7 @@ declare namespace LH.Audit {\n[metric: string]: Result;\n}\n}\n+}\n+\n+// empty export to keep file a module\n+export {}\n",
"new_path": "typings/audit.d.ts",
"old_path": "typings/audit.d.ts"
},
{
"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-declare namespace LH {\n+import _Crdp from \"../node_modules/vscode-chrome-debug-core/lib/crdp/crdp\";\n+\n+declare global {\n+ module LH {\n+ export import Crdp = _Crdp;\nexport interface Flags {\n_: string[];\n@@ -35,7 +39,7 @@ declare namespace LH {\nexport interface Results {\nurl: string;\n- audits: LH.Audit.Results;\n+ audits: Audit.Results;\nlighthouseVersion: string;\nartifacts?: Object;\ninitialUrl: string;\n@@ -111,3 +115,4 @@ declare namespace LH {\nwebSocketDebuggerUrl: string;\n}\n}\n+}\n",
"new_path": "typings/externs.d.ts",
"old_path": "typings/externs.d.ts"
},
{
"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-declare namespace LH.Gatherer {\n+declare global {\n+ module LH.Gatherer {\nexport interface PassContext {\noptions: object;\n}\nexport interface LoadData {\n- networkRecords: Array<LH.NetworkRequest>;\n+ networkRecords: Array<void>;\ndevtoolsLog: Array<void>;\n- trace: {trraceEvents: Array<LH.TraceEvent>}\n+ trace: {traceEvents: Array<TraceEvent>}\n}\n}\n+}\n+\n+// empty export to keep file a module\n+export {}\n",
"new_path": "typings/gatherer.d.ts",
"old_path": "typings/gatherer.d.ts"
},
{
"change_type": "MODIFY",
"diff": "\"@types/rx-lite-time\" \"*\"\n\"@types/rx-lite-virtualtime\" \"*\"\n+\"@types/source-map@^0.1.27\":\n+ version \"0.1.29\"\n+ resolved \"https://registry.yarnpkg.com/@types/source-map/-/source-map-0.1.29.tgz#d7048a60180b09f8aa6d53bda311c6b51cbd7018\"\n+\n\"@types/through@*\":\nversion \"0.0.29\"\nresolved \"https://registry.yarnpkg.com/@types/through/-/through-0.0.29.tgz#72943aac922e179339c651fa34a4428a4d722f93\"\n@@ -1811,7 +1815,7 @@ glob@^5.0.15:\nonce \"^1.3.0\"\npath-is-absolute \"^1.0.0\"\n-glob@^7.0.0, glob@^7.0.3, glob@^7.1.2:\n+glob@^7.0.0, glob@^7.0.3, glob@^7.0.6, glob@^7.1.2:\nversion \"7.1.2\"\nresolved \"https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15\"\ndependencies:\n@@ -2992,6 +2996,10 @@ node-uuid@~1.4.7:\nversion \"1.4.7\"\nresolved \"https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.7.tgz#6da5a17668c4b3dd59623bda11cf7fa4c1f60a6f\"\n+noice-json-rpc@1.0.1:\n+ version \"1.0.1\"\n+ resolved \"https://registry.yarnpkg.com/noice-json-rpc/-/noice-json-rpc-1.0.1.tgz#5e7289a60a1c20880489cb15101552bac392266e\"\n+\nnopt@3.x:\nversion \"3.0.6\"\nresolved \"https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9\"\n@@ -3762,6 +3770,10 @@ source-map@^0.5.0, source-map@^0.5.1, source-map@^0.5.3, source-map@~0.5.1:\nversion \"0.5.6\"\nresolved \"https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412\"\n+source-map@^0.6.1:\n+ version \"0.6.1\"\n+ resolved \"https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263\"\n+\nsource-map@~0.2.0:\nversion \"0.2.0\"\nresolved \"https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d\"\n@@ -4244,6 +4256,38 @@ vinyl@^2.0.1:\nremove-trailing-separator \"^1.0.1\"\nreplace-ext \"^1.0.0\"\n+vscode-chrome-debug-core@^3.23.8:\n+ version \"3.23.8\"\n+ resolved \"https://registry.yarnpkg.com/vscode-chrome-debug-core/-/vscode-chrome-debug-core-3.23.8.tgz#f0fd1582b6d7653d327171104b9c8e2eebb6bf41\"\n+ dependencies:\n+ \"@types/source-map\" \"^0.1.27\"\n+ glob \"^7.0.6\"\n+ noice-json-rpc \"1.0.1\"\n+ source-map \"^0.6.1\"\n+ vscode-debugadapter \"^1.28.0-pre.2\"\n+ vscode-debugprotocol \"^1.28.0-pre.1\"\n+ vscode-nls \"^3.2.1\"\n+ ws \"^3.3.2\"\n+\n+vscode-debugadapter@^1.28.0-pre.2:\n+ version \"1.28.0-pre.2\"\n+ resolved \"https://registry.yarnpkg.com/vscode-debugadapter/-/vscode-debugadapter-1.28.0-pre.2.tgz#165ccd179f5a43319c8d6a3dc77832e9392ae254\"\n+ dependencies:\n+ vscode-debugprotocol \"1.28.0-pre.1\"\n+ vscode-uri \"1.0.1\"\n+\n+vscode-debugprotocol@1.28.0-pre.1, vscode-debugprotocol@^1.28.0-pre.1:\n+ version \"1.28.0-pre.1\"\n+ resolved \"https://registry.yarnpkg.com/vscode-debugprotocol/-/vscode-debugprotocol-1.28.0-pre.1.tgz#2641b753cbb78416e897a2f1653e7bc391d2db0b\"\n+\n+vscode-nls@^3.2.1:\n+ version \"3.2.2\"\n+ resolved \"https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.2.tgz#3817eca5b985c2393de325197cf4e15eb2aa5350\"\n+\n+vscode-uri@1.0.1:\n+ version \"1.0.1\"\n+ resolved \"https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-1.0.1.tgz#11a86befeac3c4aa3ec08623651a3c81a6d0bbc8\"\n+\nwebidl-conversions@^3.0.0:\nversion \"3.0.1\"\nresolved \"https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871\"\n@@ -4353,6 +4397,14 @@ ws@3.3.2:\nsafe-buffer \"~5.1.0\"\nultron \"~1.1.0\"\n+ws@^3.3.2:\n+ version \"3.3.3\"\n+ resolved \"https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2\"\n+ dependencies:\n+ async-limiter \"~1.0.0\"\n+ safe-buffer \"~5.1.0\"\n+ ultron \"~1.1.0\"\n+\nxdg-basedir@^3.0.0:\nversion \"3.0.0\"\nresolved \"https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4\"\n",
"new_path": "yarn.lock",
"old_path": "yarn.lock"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
core(tsc): add type defs for Chrome Remote Debugging Protocol (#4816)
| 1
|
core
|
tsc
|
573,195
|
19.03.2018 18:09:07
| 25,200
|
8b11b71b487d0001c96312519298f7f85b196471
|
fix: server should fire not acceptable event
|
[
{
"change_type": "MODIFY",
"diff": "@@ -48,12 +48,9 @@ function acceptParser(accepts) {\nfunction parseAccept(req, res, next) {\nif (req.accepts(acceptable)) {\n- next();\n- return;\n+ return next();\n}\n-\n- res.json(e);\n- next(false);\n+ return next(e);\n}\nreturn parseAccept;\n",
"new_path": "lib/plugins/accept.js",
"old_path": "lib/plugins/accept.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -68,4 +68,27 @@ describe('accept parser', function() {\ndone();\n});\n});\n+\n+ it('GH-1619: should fire NotAcceptable event on server', function(done) {\n+ var opts = {\n+ path: '/',\n+ headers: {\n+ accept: 'foo/bar'\n+ }\n+ };\n+ var evtFired = false;\n+\n+ SERVER.on('NotAcceptable', function(req, res, err, cb) {\n+ evtFired = true;\n+ return cb();\n+ });\n+\n+ CLIENT.get(opts, function(err, _, res) {\n+ assert.ok(err);\n+ assert.equal(err.name, 'NotAcceptableError');\n+ assert.equal(res.statusCode, 406);\n+ assert.isTrue(evtFired);\n+ return done();\n+ });\n+ });\n});\n",
"new_path": "test/plugins/accept.test.js",
"old_path": "test/plugins/accept.test.js"
}
] |
JavaScript
|
MIT License
|
restify/node-restify
|
fix: server should fire not acceptable event (#1627)
| 1
|
fix
| null |
679,913
|
20.03.2018 01:02:48
| 0
|
47b6a924d007dfd3429ab2a9fa3e8b0932167f64
|
refactor(rstream): simplify Subscription, update all impls
use Set for storing child subs
update Stream, StreamMerge, StreamSync
only clean sources in StreamMerge/Sync.unsubscribe()
|
[
{
"change_type": "MODIFY",
"diff": "@@ -68,11 +68,11 @@ export class StreamMerge<A, B> extends Subscription<A, B> {\ns.unsubscribe();\n}\nthis.state = State.DONE;\n- delete this.sources;\n+ this.sources.clear();\nreturn true;\n}\nif (super.unsubscribe(sub)) {\n- if (!this.subs.length) {\n+ if (!this.subs.size) {\nreturn this.unsubscribe();\n}\nreturn true;\n",
"new_path": "packages/rstream/src/stream-merge.ts",
"old_path": "packages/rstream/src/stream-merge.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -122,11 +122,11 @@ export class StreamSync<A, B> extends Subscription<A, B> {\ns.unsubscribe();\n}\nthis.state = State.DONE;\n- delete this.sources;\n+ this.sources.clear();\nreturn true;\n}\nif (super.unsubscribe(sub)) {\n- if (!this.subs.length) {\n+ if (!this.subs.size) {\nreturn this.unsubscribe();\n}\nreturn true;\n",
"new_path": "packages/rstream/src/stream-sync.ts",
"old_path": "packages/rstream/src/stream-sync.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -44,7 +44,7 @@ export class Stream<T> extends Subscription<T, T>\nsubscribe<C>(sub: Partial<ISubscriber<C>>, xform: Transducer<T, C>, id?: string): Subscription<T, C>\nsubscribe(...args: any[]) {\nconst wrapped = super.subscribe.apply(this, args);\n- if (this.subs.length === 1) {\n+ if (this.subs.size === 1) {\nthis._cancel = (this.src && this.src(this)) || (() => void 0);\n}\nreturn wrapped;\n@@ -52,7 +52,7 @@ export class Stream<T> extends Subscription<T, T>\nunsubscribe(sub?: Subscription<T, any>) {\nconst res = super.unsubscribe(sub);\n- if (res && (!this.subs || !this.subs.length)) {\n+ if (res && (!this.subs || !this.subs.size)) {\nthis.done();\n}\nreturn res;\n",
"new_path": "packages/rstream/src/stream.ts",
"old_path": "packages/rstream/src/stream.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -15,15 +15,16 @@ export class Subscription<A, B> implements\nid: string;\nprotected parent: ISubscribable<A>;\n- protected subs: ISubscriber<B>[] = [];\n+ protected subs: Set<ISubscriber<B>>;\nprotected xform: Reducer<B[], A>;\nprotected state: State = State.IDLE;\nconstructor(sub?: ISubscriber<B>, xform?: Transducer<A, B>, parent?: ISubscribable<A>, id?: string) {\nthis.parent = parent;\nthis.id = id || `sub-${Subscription.NEXT_ID++}`;\n+ this.subs = new Set();\nif (sub) {\n- this.subs.push(<ISubscriber<B>>sub);\n+ this.subs.add(<ISubscriber<B>>sub);\n}\nif (xform) {\nthis.xform = xform(push());\n@@ -86,9 +87,8 @@ export class Subscription<A, B> implements\n}\nif (this.subs) {\nDEBUG && console.log(this.id, \"unsub\", sub.id);\n- const idx = this.subs.indexOf(sub);\n- if (idx >= 0) {\n- this.subs.splice(idx, 1);\n+ if (this.subs.has(sub)) {\n+ this.subs.delete(sub);\nreturn true;\n}\nreturn false;\n@@ -97,7 +97,8 @@ export class Subscription<A, B> implements\n}\nnext(x: A) {\n- this.ensureState();\n+ // this.ensureState();\n+ if (this.state < State.DONE) {\nif (this.xform) {\nconst acc = this.xform[2]([], x);\nconst uacc = unreduced(acc);\n@@ -112,6 +113,7 @@ export class Subscription<A, B> implements\nthis.dispatch(<any>x);\n}\n}\n+ }\ndone() {\nif (this.state < State.DONE) {\n@@ -138,7 +140,7 @@ export class Subscription<A, B> implements\nerror(e: any) {\nthis.state = State.ERROR;\nlet notified = false;\n- if (this.subs && this.subs.length) {\n+ if (this.subs && this.subs.size) {\nfor (let s of [...this.subs]) {\nif (s.error) {\ns.error(e);\n@@ -156,15 +158,13 @@ export class Subscription<A, B> implements\n}\nprotected addWrapped(wrapped: Subscription<any, any>) {\n- this.subs.push(wrapped);\n+ this.subs.add(wrapped);\nthis.state = State.ACTIVE;\nreturn wrapped;\n}\nprotected dispatch(x: B) {\n- let subs = this.subs;\n- for (let i = 0, n = subs.length; i < n; i++) {\n- const s = subs[i];\n+ for (let s of this.subs) {\ntry {\ns.next && s.next(x);\n} catch (e) {\n",
"new_path": "packages/rstream/src/subscription.ts",
"old_path": "packages/rstream/src/subscription.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(rstream): simplify Subscription, update all impls
- use Set for storing child subs
- update Stream, StreamMerge, StreamSync
- only clean sources in StreamMerge/Sync.unsubscribe()
| 1
|
refactor
|
rstream
|
724,219
|
20.03.2018 01:55:57
| 18,000
|
93c6ba5826e33dd019a3ce84e0a2a66701818b49
|
fix: add isVisible type
|
[
{
"change_type": "MODIFY",
"diff": "@@ -45,6 +45,7 @@ type RefSelector = {\ninterface BaseWrapper {\ncontains (selector: Selector): boolean\nexists (): boolean\n+ isVisible (): boolean\nvisible (): boolean\nattributes(): { [name: string]: string }\n",
"new_path": "packages/test-utils/types/index.d.ts",
"old_path": "packages/test-utils/types/index.d.ts"
}
] |
JavaScript
|
MIT License
|
vuejs/vue-test-utils
|
fix: add isVisible type (#478)
| 1
|
fix
| null |
679,913
|
20.03.2018 08:28:06
| 0
|
6f5ec04044bec31830a5e1137e80741be5d3fa43
|
test(rstream): remove obsolete fromPromise error test case
|
[
{
"change_type": "MODIFY",
"diff": "@@ -61,7 +61,8 @@ describe(\"fromPromise()\", () => {\n});\nsetTimeout(() => {\nassert(called, \"not called\");\n- assert.throws(() => src.next(Promise.resolve()), \"no next() allowed\");\n+ // TODO remove, next() doesn't throw error anymore if already in done or error state\n+ // assert.throws(() => src.next(Promise.resolve()), \"no next() allowed\");\nsrc.done();\nassert.equal(src.getState(), rs.State.ERROR, \"src not ERROR\");\ndone();\n",
"new_path": "packages/rstream/test/from-promise.ts",
"old_path": "packages/rstream/test/from-promise.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
test(rstream): remove obsolete fromPromise error test case
| 1
|
test
|
rstream
|
807,849
|
20.03.2018 10:17:28
| 25,200
|
7b80e0798c4ea118fd8bfbd5dc550a98bfa4d74b
|
feat(init): Improve ex-nihilo output
Create package.json with 2-space indent
Add stub name and "private": true when creating root package.json
Detect indent of existing lerna.json
sync -> async
|
[
{
"change_type": "MODIFY",
"diff": "\"use strict\";\nconst fs = require(\"fs-extra\");\n+const pMap = require(\"p-map\");\nconst writeJsonFile = require(\"write-json-file\");\nconst writePkg = require(\"write-pkg\");\n@@ -34,23 +35,37 @@ class InitCommand extends Command {\n}\nexecute() {\n- this.ensurePackageJSON();\n- this.ensureLernaJson();\n- this.ensurePackagesDir();\n+ let chain = Promise.resolve();\n+\n+ chain = chain.then(() => this.ensurePackageJSON());\n+ chain = chain.then(() => this.ensureLernaJson());\n+ chain = chain.then(() => this.ensurePackagesDir());\n+\n+ return chain.then(() => {\nthis.logger.success(\"\", \"Initialized Lerna files\");\n+ });\n}\nensurePackageJSON() {\n+ const { packageJsonLocation } = this.repository;\nlet { packageJson } = this.repository;\n+ let chain = Promise.resolve();\nif (!packageJson) {\n- packageJson = {};\n+ packageJson = {\n+ name: \"root\",\n+ private: true,\n+ };\nthis.logger.info(\"\", \"Creating package.json\");\n+\n+ // initialize with default indentation so write-pkg doesn't screw it up with tabs\n+ chain = chain.then(() => writeJsonFile(packageJsonLocation, packageJson, { indent: 2 }));\n} else {\nthis.logger.info(\"\", \"Updating package.json\");\n}\nlet targetDependencies;\n+\nif (packageJson.dependencies && packageJson.dependencies.lerna) {\n// lerna is a dependency in the current project\ntargetDependencies = packageJson.dependencies;\n@@ -59,17 +74,20 @@ class InitCommand extends Command {\nif (!packageJson.devDependencies) {\npackageJson.devDependencies = {};\n}\n+\ntargetDependencies = packageJson.devDependencies;\n}\ntargetDependencies.lerna = this.exact ? this.lernaVersion : `^${this.lernaVersion}`;\n- writePkg.sync(this.repository.packageJsonLocation, packageJson);\n+ chain = chain.then(() => writePkg(packageJsonLocation, packageJson));\n+\n+ return chain;\n}\nensureLernaJson() {\n// lernaJson already defaulted to empty object in Repository constructor\n- const { lernaJson, version: repositoryVersion } = this.repository;\n+ const { lernaJson, lernaJsonLocation, version: repositoryVersion } = this.repository;\nlet version;\n@@ -81,7 +99,7 @@ class InitCommand extends Command {\nversion = \"0.0.0\";\n}\n- if (!this.repository.version) {\n+ if (!repositoryVersion) {\nthis.logger.info(\"\", \"Creating lerna.json\");\n} else {\nthis.logger.info(\"\", \"Updating lerna.json\");\n@@ -102,12 +120,13 @@ class InitCommand extends Command {\ninitConfig.exact = true;\n}\n- writeJsonFile.sync(this.repository.lernaJsonLocation, lernaJson, { indent: 2 });\n+ return writeJsonFile(lernaJsonLocation, lernaJson, { indent: 2, detectIndent: true });\n}\nensurePackagesDir() {\nthis.logger.info(\"\", \"Creating packages directory\");\n- this.repository.packageParentDirs.map(dir => fs.mkdirpSync(dir));\n+\n+ return pMap(this.repository.packageParentDirs, dir => fs.mkdirp(dir));\n}\n}\n",
"new_path": "commands/init/index.js",
"old_path": "commands/init/index.js"
},
{
"change_type": "MODIFY",
"diff": "\"@lerna/command\": \"file:../../core/command\",\n\"@lerna/git-utils\": \"file:../../core/git-utils\",\n\"fs-extra\": \"^5.0.0\",\n+ \"p-map\": \"^1.2.0\",\n\"write-json-file\": \"^2.3.0\",\n\"write-pkg\": \"^3.1.0\"\n}\n",
"new_path": "commands/init/package.json",
"old_path": "commands/init/package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -14,6 +14,8 @@ Object {\ndevDependencies: Object {\nlerna: \"^__TEST_VERSION__\",\n},\n+ name: root,\n+ private: true,\n}\n`;\n",
"new_path": "integration/__snapshots__/lerna-init.test.js.snap",
"old_path": "integration/__snapshots__/lerna-init.test.js.snap"
},
{
"change_type": "MODIFY",
"diff": "\"@lerna/command\": \"file:core/command\",\n\"@lerna/git-utils\": \"file:core/git-utils\",\n\"fs-extra\": \"5.0.0\",\n+ \"p-map\": \"1.2.0\",\n\"write-json-file\": \"2.3.0\",\n\"write-pkg\": \"3.1.0\"\n}\n",
"new_path": "package-lock.json",
"old_path": "package-lock.json"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
feat(init): Improve ex-nihilo output
- Create package.json with 2-space indent
- Add stub name and "private": true when creating root package.json
- Detect indent of existing lerna.json
- sync -> async
| 1
|
feat
|
init
|
807,849
|
20.03.2018 10:31:06
| 25,200
|
98c8be60ae0c2abdaafe208daf78c94f6f9cdaa3
|
fix(create): Skip repository property when git remote is missing
|
[
{
"change_type": "MODIFY",
"diff": "@@ -340,4 +340,12 @@ describe(\"CreateCommand\", () => {\ntag: \"next\",\n});\n});\n+\n+ it(\"skips repository field when git remote is missing\", async () => {\n+ const cwd = await initFixture(\"basic\");\n+\n+ await lernaCreate(cwd)(\"a-pkg\");\n+\n+ expect(await manifestCreated(cwd)).not.toHaveProperty(\"repository\");\n+ });\n});\n",
"new_path": "commands/create/__tests__/create-command.test.js",
"old_path": "commands/create/__tests__/create-command.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -335,10 +335,13 @@ class CreateCommand extends Command {\n}\nsetRepository() {\n- this.conf.set(\n- \"repository\",\n- ChildProcessUtilities.execSync(\"git\", [\"remote\", \"get-url\", \"origin\"], this.execOpts)\n- );\n+ try {\n+ const url = ChildProcessUtilities.execSync(\"git\", [\"remote\", \"get-url\", \"origin\"], this.execOpts);\n+\n+ this.conf.set(\"repository\", url);\n+ } catch (err) {\n+ this.logger.warn(\"ENOREMOTE\", \"No git remote found, skipping repository property\");\n+ }\n}\nwriteReadme() {\n",
"new_path": "commands/create/index.js",
"old_path": "commands/create/index.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
fix(create): Skip repository property when git remote is missing
| 1
|
fix
|
create
|
679,913
|
20.03.2018 10:48:16
| 0
|
2ad2f485b37c14683b1186391a6d5051d62b4594
|
fix(rstream): bisect() add downstream impl checks, add tests
|
[
{
"change_type": "MODIFY",
"diff": "@@ -2,15 +2,15 @@ import { Predicate } from \"@thi.ng/api/api\";\nimport { ISubscriber } from \"../api\";\nimport { Subscription } from \"../subscription\";\n-// TODO wrap A & B and attach as children? else, how to propagate teardown?\nexport function bisect<T>(pred: Predicate<T>, a?: ISubscriber<T>, b?: ISubscriber<T>) {\nreturn new Subscription<T, T>({\nnext(x) {\n- (pred(x) ? a : b).next(x);\n+ const sub = pred(x) ? a : b;\n+ sub.next && sub.next(x);\n},\ndone() {\n- a.done();\n- b.done();\n+ a.done && a.done();\n+ b.done && b.done();\n}\n});\n}\n",
"new_path": "packages/rstream/src/subs/bisect.ts",
"old_path": "packages/rstream/src/subs/bisect.ts"
},
{
"change_type": "ADD",
"diff": "+import * as tx from \"@thi.ng/transducers\";\n+import * as assert from \"assert\";\n+\n+import * as rs from \"../src/index\";\n+import { Subscription } from \"../src/index\";\n+\n+describe(\"bisect\", () => {\n+ let src: rs.Stream<number>;\n+\n+ beforeEach(() => {\n+ src = rs.fromIterable([1, 2, 3, 4]);\n+ });\n+\n+ it(\"raw subscribers\", (done) => {\n+ const odds = [], evens = [];\n+ src.subscribe(\n+ rs.bisect((x) => !!(x & 1),\n+ { next(x) { odds.push(x) } },\n+ { next(x) { evens.push(x) } }\n+ )\n+ ).subscribe({\n+ done() {\n+ assert.deepEqual(odds, [1, 3]);\n+ assert.deepEqual(evens, [2, 4]);\n+ done();\n+ }\n+ });\n+ });\n+\n+ it(\"subs\", (done) => {\n+ const odds = [], evens = [];\n+ const subo = new Subscription<number, number>(\n+ { next(x) { odds.push(x) }, done() { doneCount++; } },\n+ tx.map<number, number>(x => x * 10)\n+ );\n+ const sube = new Subscription<number, number>(\n+ { next(x) { evens.push(x) }, done() { doneCount++; } },\n+ tx.map<number, number>(x => x * 100)\n+ );\n+ let doneCount = 0;\n+ src.subscribe(rs.bisect((x) => !!(x & 1), subo, sube))\n+ .subscribe({\n+ done() {\n+ assert.deepEqual(odds, [10, 30]);\n+ assert.deepEqual(evens, [200, 400]);\n+ assert.equal(doneCount, 2);\n+ done();\n+ }\n+ });\n+ });\n+});\n\\ No newline at end of file\n",
"new_path": "packages/rstream/test/bisect.ts",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
fix(rstream): bisect() add downstream impl checks, add tests
| 1
|
fix
|
rstream
|
573,227
|
20.03.2018 11:10:28
| 25,200
|
09b46dc196e073e51df83d30d7f36e55f6dfb4d9
|
docs(api): regenerate
|
[
{
"change_type": "MODIFY",
"diff": "@@ -31,6 +31,7 @@ permalink: /docs/plugins-api/\n- [Using an external storage mechanism for key/bucket mappings.](#using-an-external-storage-mechanism-for-keybucket-mappings)\n- [inflightRequestThrottle](#inflightrequestthrottle)\n- [cpuUsageThrottle](#cpuusagethrottle)\n+ - [conditionalHandler](#conditionalhandler)\n- [conditionalRequest](#conditionalrequest)\n- [auditLogger](#auditlogger)\n- [metrics](#metrics)\n@@ -534,7 +535,7 @@ _The serveStatic module is different than most of the other plugins, in that\nit is expected that you are going to map it to a route, as below:_\n```javascript\n-server.get(/\\/docs\\/current\\/?.*\\//, restify.plugins.serveStatic({\n+server.get('/docs/current/*', restify.plugins.serveStatic({\ndirectory: './documentation/v1',\ndefault: 'index.html'\n}));\n@@ -562,7 +563,12 @@ serveStatic method as an option. The following will serve index.html from\nthe documentation/v1/ directory anytime a client requests `/home/`._\n```javascript\n-server.get(/\\/home\\//, restify.plugins.serveStatic({\n+server.get('/home/*', restify.plugins.serveStatic({\n+ directory: './documentation/v1',\n+ file: 'index.html'\n+}));\n+// or\n+server.get('/home/([a-z]+[.]html)', restify.plugins.serveStatic({\ndirectory: './documentation/v1',\nfile: 'index.html'\n}));\n@@ -853,6 +859,66 @@ plugin.update({ limit: .4, halfLife: 5000 });\nReturns **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** middleware to be registered on server.pre\n+### conditionalHandler\n+\n+Runs first handler that matches to the condition\n+\n+**Parameters**\n+\n+- `candidates` **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) \\| [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>)** candidates\n+ - `candidates.handler` **([Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) \\| [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)>)** handler(s)\n+ - `candidates.version` **([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \\| [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>)?** '1.1.0', ['1.1.0', '1.2.0']\n+ - `candidates.contentType` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** accepted content type, '\\*\\\\/json'\n+\n+**Examples**\n+\n+```javascript\n+server.use(restify.plugins.conditionalHandler({\n+ contentType: 'application/json',\n+ version: '1.0.0',\n+ handler: function (req, res, next) {\n+ next();\n+ })\n+});\n+\n+server.get('/hello/:name', restify.plugins.conditionalHandler([\n+ {\n+ version: '1.0.0',\n+ handler: function(req, res, next) { res.send('1.x'); }\n+ },\n+ {\n+ version: ['1.5.0', '2.0.0'],\n+ handler: function(req, res, next) { res.send('1.5.x, 2.x'); }\n+ },\n+ {\n+ version: '3.0.0',\n+ contentType: ['text/html', 'text/html']\n+ handler: function(req, res, next) { res.send('3.x, text'); }\n+ },\n+ {\n+ version: '3.0.0',\n+ contentType: 'application/json'\n+ handler: function(req, res, next) { res.send('3.x, json'); }\n+ },\n+ // Array of handlers\n+ {\n+ version: '4.0.0',\n+ handler: [\n+ function(req, res, next) { next(); },\n+ function(req, res, next) { next(); },\n+ function(req, res, next) { res.send('4.x') }\n+ ]\n+ },\n+]);\n+// 'accept-version': '^1.1.0' => 1.5.x, 2.x'\n+// 'accept-version': '3.x', accept: 'application/json' => '3.x, json'\n+```\n+\n+- Throws **InvalidVersionError**\n+- Throws **UnsupportedMediaTypeError**\n+\n+Returns **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Handler\n+\n### conditionalRequest\nReturns a set of plugins that will compare an already set `ETag` header with\n@@ -1079,16 +1145,21 @@ Type: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Sta\n- `metrics.statusCode` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** status code of the response. can be\nundefined in the case of an uncaughtException\n- `metrics.method` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** http request verb\n- - `metrics.latency` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** request latency\n+ - `metrics.totalLatency` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** latency includes both request is flushed\n+ and all handlers finished\n+ - `metrics.latency` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** latency when request is flushed\n+ - `metrics.preLatency` **([Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) | null)** pre handlers latency\n+ - `metrics.useLatency` **([Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) | null)** use handlers latency\n+ - `metrics.routeLatency` **([Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) | null)** route handlers latency\n- `metrics.path` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** `req.path()` value\n- `metrics.inflightRequests` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Number of inflight requests pending\nin restify.\n- `metrics.unifinishedRequests` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Same as `inflightRequests`\n- - `metrics.connectionState` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** can be either `'close'`,\n- `'aborted'`, or `undefined`. If this value is set, err will be a\n- corresponding `RequestCloseError` or `RequestAbortedError`.\n+ - `metrics.connectionState` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** can be either `'close'` or\n+ `undefined`. If this value is set, err will be a\n+ corresponding `RequestCloseError`.\nIf connectionState is either\n- `'close'` or `'aborted'`, then the `statusCode` is not applicable since the\n+ `'close'`, then the `statusCode` is not applicable since the\nconnection was severed before a response was written.\n- `req` **[Request](https://developer.mozilla.org/Add-ons/SDK/High-Level_APIs/request)** the request obj\n- `res` **[Response](https://developer.mozilla.org/docs/Web/Guide/HTML/HTML5)** the response obj\n",
"new_path": "docs/_api/plugins.md",
"old_path": "docs/_api/plugins.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -356,9 +356,8 @@ Returns **[undefined](https://developer.mozilla.org/docs/Web/JavaScript/Referenc\nReturns the connection state of the request. Current possible values are:\n- `close` - when the request has been closed by the clien\n-- `aborted` - when the socket was closed unexpectedly\n-Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** connection state (`\"closed\"`, `\"aborted\"`)\n+Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** connection state (`\"close\"`)\n### getRoute\n",
"new_path": "docs/_api/request.md",
"old_path": "docs/_api/request.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -21,7 +21,6 @@ permalink: /docs/server-api/\n- [pre](#pre)\n- [use](#use)\n- [param](#param)\n- - [versionedUse](#versioneduse)\n- [rm](#rm)\n- [address](#address)\n- [inflightRequests](#inflightrequests)\n@@ -39,12 +38,11 @@ routes and handlers for incoming requests.\n**Parameters**\n-- `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** an options object\n+- `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** an options object\n- `options.name` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Name of the server. (optional, default `\"restify\"`)\n+ - `options.dtrace` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** enable DTrace support (optional, default `false`)\n- `options.router` **Router** Router (optional, default `newRouter(opts)`)\n- `options.log` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** [bunyan](https://github.com/trentm/node-bunyan) instance. (optional, default `bunyan.createLogger(options.name||\"restify\")`)\n- - `options.version` **([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \\| [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array))?** Default version(s) to use in all\n- routes.\n- `options.acceptable` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** String)|List of content-types this\nserver can respond with.\n- `options.url` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Once listen() is called, this will be filled\n@@ -59,7 +57,8 @@ routes and handlers for incoming requests.\nwill use a domain to catch and respond to any uncaught\nexceptions that occur in it's handler stack.\n[bunyan](https://github.com/trentm/node-bunyan) instance.\n- response header, default is `restify`. Pass empty string to unset the header. (optional, default `false`)\n+ response header, default is `restify`. Pass empty string to unset the header.\n+ Comes with significant negative performance impact. (optional, default `false`)\n- `options.spdy` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Any options accepted by\n[node-spdy](https://github.com/indutny/node-spdy).\n- `options.http2` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Any options accepted by\n@@ -96,11 +95,10 @@ Creates a new Server.\n- `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** an options object\n- `options.name` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Name of the server.\n+ - `options.dtrace` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** enable DTrace support (optional, default `false`)\n- `options.router` **Router** Router\n- `options.log` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** [bunyan](https://github.com/trentm/node-bunyan)\ninstance.\n- - `options.version` **([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \\| [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array))?** Default version(s) to use in all\n- routes.\n- `options.acceptable` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>?** List of content-types this\nserver can respond with.\n- `options.url` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Once listen() is called, this will be filled\n@@ -114,6 +112,7 @@ Creates a new Server.\n- `options.handleUncaughtExceptions` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** When true restify\nwill use a domain to catch and respond to any uncaught\nexceptions that occur in it's handler stack.\n+ Comes with significant negative performance impact.\n[bunyan](https://github.com/trentm/node-bunyan) instance.\nresponse header, default is `restify`. Pass empty string to unset the header. (optional, default `false`)\n- `options.spdy` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Any options accepted by\n@@ -123,13 +122,17 @@ Creates a new Server.\n- `options.handleUpgrades` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Hook the `upgrade` event\nfrom the node HTTP server, pushing `Connection: Upgrade` requests through the\nregular request handling chain. (optional, default `false`)\n+ - `options.onceNext` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Prevents calling next multiple\n+ times (optional, default `false`)\n+ - `options.strictNext` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Throws error when next() is\n+ called more than once, enabled onceNext option (optional, default `false`)\n- `options.httpsServerOptions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Any options accepted by\n[node-https Server](http://nodejs.org/api/https.html#https_https).\nIf provided the following restify server options will be ignored:\nspdy, ca, certificate, key, passphrase, rejectUnauthorized, requestCert and\nciphers; however these can all be specified on httpsServerOptions.\n- - `options.strictRouting` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** If set, Restify\n- will treat \"/foo\" and \"/foo/\" as different paths. (optional, default `false`)\n+ - `options.noWriteContinue` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** prevents\n+ `res.writeContinue()` in `server.on('checkContinue')` when proxing (optional, default `false`)\n**Examples**\n@@ -340,29 +343,6 @@ Exposes an API:\nReturns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** returns self\n-### versionedUse\n-\n-Piggy-backs on the `server.use` method. It attaches a new middleware\n-function that only fires if the specified version matches the request.\n-\n-Note that if the client does not request a specific version, the middleware\n-function always fires. If you don't want this set a default version with a\n-pre handler on requests where the client omits one.\n-\n-Exposes an API:\n- server.versionedUse(\"version\", function (req, res, next, ver) {\n- // do stuff that only applies to routes of this API version\n- });\n-\n-**Parameters**\n-\n-- `versions` **([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \\| [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array))** the version(s) the URL to respond to\n-- `fn` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** the middleware function to execute, the\n- fourth parameter will be the selected\n- version\n-\n-Returns **[undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined)** no return value\n-\n### rm\nRemoves a route from the server.\n@@ -370,7 +350,7 @@ You pass in the route 'blob' you got from a mount call.\n**Parameters**\n-- `route` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** the route name.\n+- `routeName` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** the route name.\n- Throws **[TypeError](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypeError)** on bad input.\n@@ -424,7 +404,6 @@ _Output:_\ninput: '/',\ncompiledRegex: /^[\\/]*$/,\ncompiledUrlParams: null,\n- versions: null,\nhandlers: [Array]\n}\n],\n@@ -770,8 +749,8 @@ Type: ([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Glob\n**Properties**\n- `name` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** a name for the route\n-- `path` **([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \\| [Regexp](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp))** a string or regex matching the route\n-- `version` **([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \\| [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>)** versions supported by this route\n+- `path` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** can be any String accepted by\n+ [find-my-way](https://github.com/delvedor/find-my-way)\n**Examples**\n@@ -781,10 +760,9 @@ server.get('/foo', function(req, res, next) {});\n// a parameterized route\nserver.get('/foo/:bar', function(req, res, next) {});\n// a regular expression\n-server.get(/^\\/([a-zA-Z0-9_\\.~-]+)\\/(.*)/, function(req, res, next) {});\n+server.get('/example/:file(^\\\\d+).png', function(req, res, next) {});\n// an options object\nserver.get({\npath: '/foo',\n- version: ['1.0.0', '2.0.0']\n}, function(req, res, next) {});\n```\n",
"new_path": "docs/_api/server.md",
"old_path": "docs/_api/server.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -64,8 +64,7 @@ describe('dedupe forward slashes in URL', function() {\n});\n// eslint-disable-next-line\n- it('should remove duplicate slashes including trailing slashes',\n- function(done) {\n+ it('should remove duplicate slashes including trailing slashes', function(done) {\nCLIENT.get('//foo//bar//', function(err, _, res, data) {\nassert.ifError(err);\nassert.equal(res.statusCode, 200);\n",
"new_path": "test/plugins/dedupeSlashes.test.js",
"old_path": "test/plugins/dedupeSlashes.test.js"
}
] |
JavaScript
|
MIT License
|
restify/node-restify
|
docs(api): regenerate
| 1
|
docs
|
api
|
730,429
|
20.03.2018 11:21:16
| 14,400
|
d76944deadeb5e2aaec7cd55edce76ad11f62cd9
|
chore(tooling): add .env.default support
CISCOSPARK_APPID_ORGID is needed for guest tokens
|
[
{
"change_type": "ADD",
"diff": "+CISCOSPARK_APPID_ORGID=Y2lzY29zcGFyazovL3VzL09SR0FOSVpBVElPTi80MjFhMWY4OC0zM2ViLTQ3MTUtOTY1ZS0zYzE5ZDYyZDJjMDk\n",
"new_path": ".env.default",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "-require('dotenv').config();\nrequire('babel-register');\n-\nconst os = require('os');\n+const dotenv = require('dotenv');\n+\n+dotenv.config();\n+dotenv.config({path: '.env.default'});\n+\n+\n// eslint-disable-next-line prefer-destructuring\nconst argv = require('yargs').argv;\n",
"new_path": "wdio.conf.js",
"old_path": "wdio.conf.js"
}
] |
JavaScript
|
MIT License
|
webex/react-widgets
|
chore(tooling): add .env.default support
CISCOSPARK_APPID_ORGID is needed for guest tokens
| 1
|
chore
|
tooling
|
679,913
|
20.03.2018 12:55:44
| 0
|
01a751e2c0826d68278a0e3e5f3245b63924b748
|
feat(rstream): update Subscription.unsubscribe()
switch to DONE state if unsubscribing itself from parent
unsubscribe itself from parent after last child sub unsubscribed
(effect propagates upstream until no more parent)
|
[
{
"change_type": "MODIFY",
"diff": "@@ -81,23 +81,27 @@ export class Subscription<A, B> implements\nunsubscribe(sub?: Subscription<B, any>) {\nif (!sub) {\nif (this.parent) {\n- return this.parent.unsubscribe(this);\n+ const res = this.parent.unsubscribe(this);\n+ this.state = State.DONE;\n+ delete this.parent;\n+ return res;\n}\n- return true;\n+ return false;\n}\nif (this.subs) {\nDEBUG && console.log(this.id, \"unsub\", sub.id);\nif (this.subs.has(sub)) {\nthis.subs.delete(sub);\n+ if (!this.subs.size) {\n+ this.unsubscribe();\n+ }\nreturn true;\n}\n- return false;\n}\n- return true;\n+ return false;\n}\nnext(x: A) {\n- // this.ensureState();\nif (this.state < State.DONE) {\nif (this.xform) {\nconst acc = this.xform[2]([], x);\n@@ -129,8 +133,7 @@ export class Subscription<A, B> implements\nfor (let s of [...this.subs]) {\ns.done && s.done();\n}\n- this.parent && this.parent.unsubscribe(this);\n- delete this.parent;\n+ this.unsubscribe();\ndelete this.subs;\ndelete this.xform;\nDEBUG && console.log(this.id, \"done\");\n",
"new_path": "packages/rstream/src/subscription.ts",
"old_path": "packages/rstream/src/subscription.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(rstream): update Subscription.unsubscribe()
- switch to DONE state if unsubscribing itself from parent
- unsubscribe itself from parent after last child sub unsubscribed
(effect propagates upstream until no more parent)
| 1
|
feat
|
rstream
|
679,913
|
20.03.2018 12:56:15
| 0
|
41bb385fae2d836c43e107a1719ad11461a730ec
|
feat(rstream): add fromView(), update fromAtom() docs, update re-exports
|
[
{
"change_type": "MODIFY",
"diff": "@@ -3,14 +3,16 @@ import { ReadonlyAtom } from \"@thi.ng/atom/api\";\nimport { Stream } from \"../stream\";\n/**\n- * Yields stream of value changes in given atom / cursor.\n- * Attaches watch to atom and checks for value changes with given `changed`\n- * predicate (`!==` by default). If the predicate returns truthy result,\n- * the atom change is emitted on the stream.\n- * If `emitFirst` is true (default), also emits atom's current value\n- * when first subscriber attaches to stream.\n+ * Yields stream of value changes in given atom / cursor. Attaches watch\n+ * to atom and checks for value changes with given `changed` predicate\n+ * (`!==` by default). If the predicate returns truthy result, the new\n+ * value is emitted on the stream. If `emitFirst` is true (default),\n+ * also emits atom's current value when first subscriber attaches to\n+ * stream.\n*\n- * See: @thi.ng/atom\n+ * See:\n+ * - fromView()\n+ * - @thi.ng/atom\n*\n* ```\n* db = new Atom({a: 23, b: 88});\n",
"new_path": "packages/rstream/src/from/atom.ts",
"old_path": "packages/rstream/src/from/atom.ts"
},
{
"change_type": "ADD",
"diff": "+import { ReadonlyAtom, ViewTransform } from \"@thi.ng/atom/api\";\n+import { View } from \"@thi.ng/atom/view\";\n+import { Stream } from \"../stream\";\n+import { Path } from \"@thi.ng/paths\";\n+import { Predicate2 } from \"@thi.ng/api/api\";\n+\n+/**\n+ * Similar to `fromAtom()`, but creates an eager derived view for a\n+ * nested value in atom / cursor and yields stream of its value changes.\n+ * Views are readonly versions of Cursors and more lightweight. The view\n+ * checks for value changes with given `equiv` predicate\n+ * (`@thi.ng/api/equiv` by default). If the predicate returns a falsy\n+ * result, the new value is emitted on the stream. The first value\n+ * emitted is always the (possibly transformed) current value at the\n+ * stream's start time (i.e. when the first subscriber attaches).\n+ *\n+ * If the optional `tx` is given, the raw value is first passed to this\n+ * transformer function and its result emitted on the stream.\n+ *\n+ * When the stream is cancelled the view is destroyed as well.\n+ *\n+ * See:\n+ * - fromAtom()\n+ * - @thi.ng/atom\n+ *\n+ * ```\n+ * db = new Atom({a: 1, b: {c: 2}});\n+ *\n+ * fromView(db, \"b.c\", (x) => x != null ? x : \"n/a\").subscribe(trace(\"view:\"))\n+ * // view: 2\n+ *\n+ * db.swapIn(\"b.c\", (x: number) => x + 1);\n+ * // view: 3\n+ *\n+ * db.reset({a: 10});\n+ * // view: n/a\n+ * ```\n+ *\n+ * @param atom\n+ * @param path\n+ * @param tx\n+ */\n+export function fromView<T>(atom: ReadonlyAtom<any>, path: Path, tx?: ViewTransform<T>, equiv?: Predicate2<any>): Stream<T> {\n+ return new Stream<T>((stream) => {\n+ let isActive = true;\n+ const view = new View<T>(\n+ atom,\n+ path,\n+ tx ?\n+ (x) => isActive && (x = tx(x), stream.next(x), x) :\n+ (x) => isActive && (stream.next(x), x),\n+ false,\n+ equiv\n+ );\n+ return () => (isActive = false, view.release());\n+ });\n+}\n",
"new_path": "packages/rstream/src/from/view.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -11,6 +11,7 @@ export * from \"./from/iterable\";\nexport * from \"./from/promise\";\nexport * from \"./from/promises\";\nexport * from \"./from/raf\";\n+export * from \"./from/view\";\nexport * from \"./from/worker\";\nexport * from \"./subs/bisect\";\n",
"new_path": "packages/rstream/src/index.ts",
"old_path": "packages/rstream/src/index.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(rstream): add fromView(), update fromAtom() docs, update re-exports
| 1
|
feat
|
rstream
|
679,913
|
20.03.2018 13:04:35
| 0
|
7dce160ca4840939d60d1a49a867bd82c8e0a7a3
|
minor(rstream): fromPromise()
|
[
{
"change_type": "MODIFY",
"diff": "@@ -29,7 +29,6 @@ export class Resolver<T> extends Subscription<Promise<T>, T> {\ndone() {\nif (this.parent.getState() === State.DONE && this.outstanding === 0) {\nsuper.done();\n- delete this.outstanding;\n}\n}\n}\n",
"new_path": "packages/rstream/src/subs/resolve.ts",
"old_path": "packages/rstream/src/subs/resolve.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
minor(rstream): fromPromise()
| 1
|
minor
|
rstream
|
679,913
|
20.03.2018 13:07:45
| 0
|
d18a11588f4b530c7cf2fb0c1b4e06a47c353b6f
|
feat(rstream): update Sidechain*.next(), add unsubscribe()
don't throw errors in next() if state >= DONE
unsub sidechain when unsubscribing SidechainPartition/Toggle itself
|
[
{
"change_type": "MODIFY",
"diff": "@@ -30,11 +30,17 @@ export class SidechainPartition<A, B> extends Subscription<A, A[]> {\n});\n}\n+ unsubscribe(sub?: Subscription<any, any>) {\n+ const res = super.unsubscribe(sub);\n+ if (!sub || !this.subs.size) {\n+ this.sideSub.unsubscribe();\n+ }\n+ return res;\n+ }\n+\nnext(x: A) {\nif (this.state < State.DONE) {\nthis.buf.push(x);\n- } else {\n- throw new Error(`called next() in ${State[this.state]} state`);\n}\n}\n",
"new_path": "packages/rstream/src/subs/sidechain-partition.ts",
"old_path": "packages/rstream/src/subs/sidechain-partition.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -25,6 +25,14 @@ export class SidechainToggle<A, B> extends Subscription<A, A> {\n});\n}\n+ unsubscribe(sub?: Subscription<any, any>) {\n+ const res = super.unsubscribe(sub);\n+ if (!sub || !this.subs.size) {\n+ this.sideSub.unsubscribe();\n+ }\n+ return res;\n+ }\n+\nnext(x: A) {\nif (this.isActive) {\nsuper.next(x);\n@@ -34,7 +42,6 @@ export class SidechainToggle<A, B> extends Subscription<A, A> {\ndone() {\nsuper.done();\nthis.sideSub.unsubscribe();\n- delete this.isActive;\n}\n}\n",
"new_path": "packages/rstream/src/subs/sidechain-toggle.ts",
"old_path": "packages/rstream/src/subs/sidechain-toggle.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(rstream): update Sidechain*.next(), add unsubscribe()
- don't throw errors in next() if state >= DONE
- unsub sidechain when unsubscribing SidechainPartition/Toggle itself
| 1
|
feat
|
rstream
|
679,913
|
20.03.2018 13:08:18
| 0
|
db61b0bda92f4ca646094fdb74e143d9819be632
|
test(rstream): add/update sidechain* tests
|
[
{
"change_type": "MODIFY",
"diff": "@@ -4,10 +4,15 @@ import * as rs from \"../src/index\";\ndescribe(\"SidechainPartition\", function () {\n+ let src, side, buf;\n+\n+ beforeEach(() => {\n+ src = new rs.Stream();\n+ side = new rs.Stream();\n+ buf = [];\n+ });\n+\nit(\"partitions (manual)\", (done) => {\n- let src = new rs.Stream();\n- let side = new rs.Stream();\n- let buf = [];\nsrc.subscribe(rs.sidechainPartition(side))\n.subscribe({\nnext(x) { buf.push(x); },\n@@ -22,17 +27,16 @@ describe(\"SidechainPartition\", function () {\nsrc.next(1);\nsrc.next(2);\nside.next(1);\n+\nsrc.next(3);\nsrc.next(4);\nsrc.next(5);\nside.next(false);\n+\nside.done();\n});\nit(\"partitions w/ predicate\", (done) => {\n- let src = new rs.Stream();\n- let side = new rs.Stream();\n- let buf = [];\nsrc.subscribe(rs.sidechainPartition(side, (x) => x === 1))\n.subscribe({\nnext(x) { buf.push(x); },\n@@ -54,4 +58,13 @@ describe(\"SidechainPartition\", function () {\nside.done();\n});\n+ it(\"unsubscribe chain (from child)\", () => {\n+ const part = src.subscribe(rs.sidechainPartition(side));\n+ const sub = part.subscribe({});\n+ sub.unsubscribe();\n+ assert.equal(src.getState(), rs.State.DONE);\n+ assert.equal(side.getState(), rs.State.DONE);\n+ assert.equal(part.getState(), rs.State.DONE);\n+ assert.equal(sub.getState(), rs.State.DONE);\n+ });\n});\n",
"new_path": "packages/rstream/test/sidechain-partition.ts",
"old_path": "packages/rstream/test/sidechain-partition.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -4,10 +4,16 @@ import * as rs from \"../src/index\";\ndescribe(\"SidechainToggle\", () => {\n+\n+ let src, side, buf;\n+\n+ beforeEach(() => {\n+ src = new rs.Stream();\n+ side = new rs.Stream();\n+ buf = [];\n+ });\n+\nlet check = (initial, pred, expect, done) => {\n- let src = new rs.Stream();\n- let side = new rs.Stream();\n- let buf = [];\nsrc.subscribe(rs.sidechainToggle(side, initial, pred))\n.subscribe({\nnext(x) {\n@@ -40,4 +46,13 @@ describe(\"SidechainToggle\", () => {\ncheck(true, (x) => x === 0, [1, 2], done);\n});\n+ it(\"unsubscribe chain (from child)\", () => {\n+ const part = src.subscribe(rs.sidechainToggle(side));\n+ const sub = part.subscribe({});\n+ sub.unsubscribe();\n+ assert.equal(src.getState(), rs.State.DONE);\n+ assert.equal(side.getState(), rs.State.DONE);\n+ assert.equal(part.getState(), rs.State.DONE);\n+ assert.equal(sub.getState(), rs.State.DONE);\n+ });\n});\n",
"new_path": "packages/rstream/test/sidechain-toggle.ts",
"old_path": "packages/rstream/test/sidechain-toggle.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
test(rstream): add/update sidechain* tests
| 1
|
test
|
rstream
|
679,913
|
20.03.2018 13:36:20
| 0
|
80264093cfea9a80d541adae970204dde95da6b3
|
feat(rstream): fix update StreamMerge to support transduced input streams
any Subscription values (incl. Streams) sent by inputs are added
to the set of inputs themselves and not passed downstream
add test case
|
[
{
"change_type": "MODIFY",
"diff": "@@ -37,7 +37,13 @@ export class StreamMerge<A, B> extends Subscription<A, B> {\nthis.sources.set(\nsrc,\nsrc.subscribe({\n- next: (x) => this.next(x),\n+ next: (x) => {\n+ if (x instanceof Subscription) {\n+ this.add(x);\n+ } else {\n+ this.next(x);\n+ }\n+ },\ndone: () => this.markDone(src)\n}));\n}\n",
"new_path": "packages/rstream/src/stream-merge.ts",
"old_path": "packages/rstream/src/stream-merge.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -72,4 +72,22 @@ describe(\"StreamMerge\", () => {\nsrc.subscribe(check([1, 2, 2, 3, 10, 11, 20, 21], done));\n});\n+ it(\"transducer streams\", (done) => {\n+ const sources = [\n+ rs.fromIterable([1, 2, 3]),\n+ rs.fromIterable([4, 5, 6]),\n+ ].map(\n+ (s) => s.subscribe(tx.map(x => rs.fromIterable([x, x, x])))\n+ );\n+ const merge = new rs.StreamMerge({ src: sources });\n+ const histogram = tx.frequencies();\n+ let acc: any = histogram[0]();\n+ merge.subscribe({\n+ next(x) { acc = histogram[2](acc, x) },\n+ done() {\n+ assert.deepEqual(acc, new Map([[1, 3], [2, 3], [3, 3], [4, 3], [5, 3], [6, 3]]));\n+ done();\n+ }\n+ })\n+ });\n});\n",
"new_path": "packages/rstream/test/stream-merge.ts",
"old_path": "packages/rstream/test/stream-merge.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(rstream): fix #6 update StreamMerge to support transduced input streams
- any Subscription values (incl. Streams) sent by inputs are added
to the set of inputs themselves and not passed downstream
- add test case
| 1
|
feat
|
rstream
|
217,922
|
20.03.2018 14:37:52
| -3,600
|
b13add1b4841db6e56f3338c3837b7c098ee05ab
|
fix: little issue with the recipe addition to a list not in workshop
|
[
{
"change_type": "MODIFY",
"diff": "<mat-icon>add</mat-icon>\n<span>{{'New_List' | translate}}</span></button>\n<button mat-menu-item *ngFor=\"let list of lists.basicLists\"\n- (click)=\"addAllRecipes(list, list.$key)\">\n+ (click)=\"addRecipe(recipe, list, list.$key, amount.value, collectible.checked)\">\n<mat-icon>playlist_play</mat-icon>\n<span>{{list.name}}</span>\n</button>\n",
"new_path": "src/app/pages/recipes/recipes/recipes.component.html",
"old_path": "src/app/pages/recipes/recipes/recipes.component.html"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
fix: little issue with the recipe addition to a list not in workshop
| 1
|
fix
| null |
679,913
|
20.03.2018 15:02:29
| 0
|
ebe222c90ff4c49f2f83a1a0a8496d2d1bacdfa2
|
refactor(rstream): update & StreamMerge/SyncOpts, minor fixes StreamSync
only allow arrays for sources
pre-add/remove source IDs in StreamSync.addAll/removeAll()
update mapVals() xform to use copies
|
[
{
"change_type": "MODIFY",
"diff": "@@ -5,7 +5,7 @@ import { ISubscribable, State } from \"./api\";\nimport { Subscription } from \"./subscription\";\nexport interface StreamMergeOpts<A, B> extends IID<string> {\n- src: Iterable<ISubscribable<A>>;\n+ src: ISubscribable<A>[];\nxform: Transducer<A, B>;\nclose: boolean;\n}\n@@ -48,7 +48,7 @@ export class StreamMerge<A, B> extends Subscription<A, B> {\n}));\n}\n- addAll(src: Iterable<ISubscribable<A>>) {\n+ addAll(src: ISubscribable<A>[]) {\nfor (let s of src) {\nthis.add(s);\n}\n@@ -62,7 +62,7 @@ export class StreamMerge<A, B> extends Subscription<A, B> {\n}\n}\n- removeAll(src: Iterable<ISubscribable<A>>) {\n+ removeAll(src: ISubscribable<A>[]) {\nfor (let s of src) {\nthis.remove(s);\n}\n",
"new_path": "packages/rstream/src/stream-merge.ts",
"old_path": "packages/rstream/src/stream-merge.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -9,7 +9,7 @@ import { ISubscribable, State } from \"./api\";\nimport { Subscription } from \"./subscription\";\nexport interface StreamSyncOpts<A, B> extends IID<string> {\n- src: Iterable<ISubscribable<A>>;\n+ src: ISubscribable<A>[];\nxform: Transducer<IObjectOf<A>, B>;\nreset: boolean;\nall: boolean;\n@@ -34,7 +34,7 @@ export interface StreamSyncOpts<A, B> extends IID<string> {\n* stream ID. Only the last value received from each input is passed on.\n*\n* ```\n- * sync = StreamSync({src: [a=new Stream(\"a\"), b=new Stream(\"b\")]});\n+ * sync = new StreamSync({src: [a=new Stream(\"a\"), b=new Stream(\"b\")]});\n* sync.subscribe(trace());\n*\n* a.next(1);\n@@ -66,7 +66,7 @@ export class StreamSync<A, B> extends Subscription<A, B> {\nlet srcIDs = new Set<string>();\nlet xform: Transducer<any, any> = comp(\npartitionSync<A>(srcIDs, (x) => x[0], opts.reset !== false, opts.all !== false),\n- mapVals((x) => x[1], false)\n+ mapVals((x) => x[1])\n);\nif (opts.xform) {\nxform = comp(xform, opts.xform);\n@@ -95,7 +95,11 @@ export class StreamSync<A, B> extends Subscription<A, B> {\n);\n}\n- addAll(src: Iterable<ISubscribable<A>>) {\n+ addAll(src: ISubscribable<A>[]) {\n+ // pre-add all source ids for partitionSync\n+ for (let s of src) {\n+ this.sourceIDs.add(s.id);\n+ }\nfor (let s of src) {\nthis.add(s);\n}\n@@ -110,7 +114,11 @@ export class StreamSync<A, B> extends Subscription<A, B> {\n}\n}\n- removeAll(src: Iterable<ISubscribable<A>>) {\n+ removeAll(src: ISubscribable<A>[]) {\n+ // pre-remove all source ids for partitionSync\n+ for (let s of src) {\n+ this.sourceIDs.delete(s.id);\n+ }\nfor (let s of src) {\nthis.remove(s);\n}\n",
"new_path": "packages/rstream/src/stream-sync.ts",
"old_path": "packages/rstream/src/stream-sync.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(rstream): update & StreamMerge/SyncOpts, minor fixes StreamSync
- only allow arrays for sources
- pre-add/remove source IDs in StreamSync.addAll/removeAll()
- update mapVals() xform to use copies
| 1
|
refactor
|
rstream
|
217,922
|
20.03.2018 15:30:39
| -3,600
|
ae0b5e6491369ec35d5872686496fda18d332c10
|
fix: list author avatar hidden in list panel
|
[
{
"change_type": "MODIFY",
"diff": "<div class=\"description\">\n<img *ngIf=\"author | async as authorData\" [src]=\"authorData?.avatar\" class=\"author-avatar\"\n[matTooltip]=\"authorData?.name\" matTooltipPosition=\"above\"\n- hidden=\"{{authorData?.name === 'Anonymous'}}\"\n+ [hidden]=\"authorData?.name === 'Anonymous'\"\nrouterLink=\"/profile/{{list.authorId}}\">\n<div class=\"tags\">\n<mat-chip-list class=\"inline-chips\">\n",
"new_path": "src/app/modules/common-components/list-panel/list-panel.component.html",
"old_path": "src/app/modules/common-components/list-panel/list-panel.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -109,7 +109,11 @@ export class ListPanelComponent extends ComponentWithSubscriptions implements On\n}\nngOnInit(): void {\n- this.author = this.userService.getCharacter(this.list.authorId).catch(err => Observable.of(null));\n+ this.author = this.userService.getCharacter(this.list.authorId)\n+ .catch(err => {\n+ console.error(err);\n+ return Observable.of(null);\n+ });\n}\npublic isMobile(): boolean {\n",
"new_path": "src/app/modules/common-components/list-panel/list-panel.component.ts",
"old_path": "src/app/modules/common-components/list-panel/list-panel.component.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
fix: list author avatar hidden in list panel
| 1
|
fix
| null |
217,922
|
20.03.2018 15:35:34
| -3,600
|
501652fded0c92a81b3d646df7a559033890a1ee
|
chore(release): 3.4.0-beta.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=\"3.4.0-beta.3\"></a>\n+# [3.4.0-beta.3](https://github.com/Supamiu/ffxiv-teamcraft/compare/v3.4.0-beta.2...v3.4.0-beta.3) (2018-03-20)\n+\n+\n+### Bug Fixes\n+\n+* \"NaN to reach total\" sometimes shown on amount input fields ([1f05c42](https://github.com/Supamiu/ffxiv-teamcraft/commit/1f05c42))\n+* **beta:** patreon email linking is case-sensitive (not anymore) ([8fc3077](https://github.com/Supamiu/ffxiv-teamcraft/commit/8fc3077))\n+* **beta:** unable to link nickname to profile ([eea0aa3](https://github.com/Supamiu/ffxiv-teamcraft/commit/eea0aa3)), closes [#280](https://github.com/Supamiu/ffxiv-teamcraft/issues/280)\n+* list author avatar hidden in list panel ([ae0b5e6](https://github.com/Supamiu/ffxiv-teamcraft/commit/ae0b5e6))\n+* little issue with the recipe addition to a list not in workshop ([b13add1](https://github.com/Supamiu/ffxiv-teamcraft/commit/b13add1))\n+\n+\n+### Features\n+\n+* optimized navigation map for zone breakdown ([fe1438b](https://github.com/Supamiu/ffxiv-teamcraft/commit/fe1438b)), closes [#185](https://github.com/Supamiu/ffxiv-teamcraft/issues/185)\n+* show closest aetheryte to TP in the same map for gatherable items ([5d35b8f](https://github.com/Supamiu/ffxiv-teamcraft/commit/5d35b8f)), closes [#185](https://github.com/Supamiu/ffxiv-teamcraft/issues/185)\n+\n+\n+\n<a name=\"3.4.0-beta.2\"></a>\n# [3.4.0-beta.2](https://github.com/Supamiu/ffxiv-teamcraft/compare/v3.4.0-beta.1...v3.4.0-beta.2) (2018-03-16)\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"teamcraft\",\n- \"version\": \"3.4.0-beta.2\",\n+ \"version\": \"3.4.0-beta.3\",\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\": \"teamcraft\",\n- \"version\": \"3.4.0-beta.2\",\n+ \"version\": \"3.4.0-beta.3\",\n\"license\": \"MIT\",\n\"scripts\": {\n\"ng\": \"ng\",\n",
"new_path": "package.json",
"old_path": "package.json"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore(release): 3.4.0-beta.3
| 1
|
chore
|
release
|
679,913
|
20.03.2018 16:14:32
| 0
|
6b87bca42c7db1f5ce9bbde1017295a1912ad7df
|
feat(rstream): Subscription stores last value and passes to new subs
|
[
{
"change_type": "MODIFY",
"diff": "import { isFunction } from \"@thi.ng/checks/is-function\";\nimport { implementsFunction } from \"@thi.ng/checks/implements-function\";\n-import { Reducer, Transducer } from \"@thi.ng/transducers/api\";\n+import { Reducer, Transducer, SEMAPHORE } from \"@thi.ng/transducers/api\";\nimport { push } from \"@thi.ng/transducers/rfn/push\";\nimport { isReduced, unreduced } from \"@thi.ng/transducers/reduced\";\n@@ -19,9 +19,12 @@ export class Subscription<A, B> implements\nprotected xform: Reducer<B[], A>;\nprotected state: State = State.IDLE;\n+ protected last: any;\n+\nconstructor(sub?: ISubscriber<B>, xform?: Transducer<A, B>, parent?: ISubscribable<A>, id?: string) {\nthis.parent = parent;\nthis.id = id || `sub-${Subscription.NEXT_ID++}`;\n+ this.last = SEMAPHORE;\nthis.subs = new Set();\nif (sub) {\nthis.subs.add(<ISubscriber<B>>sub);\n@@ -67,6 +70,9 @@ export class Subscription<A, B> implements\n} else {\nsub = new Subscription(sub, xform, this, id);\n}\n+ if (this.last !== SEMAPHORE) {\n+ sub.next(this.last);\n+ }\nreturn <Subscription<B, B>>this.addWrapped(sub);\n}\n@@ -83,6 +89,7 @@ export class Subscription<A, B> implements\nif (this.parent) {\nconst res = this.parent.unsubscribe(this);\nthis.state = State.DONE;\n+ delete this.last;\ndelete this.parent;\nreturn res;\n}\n@@ -167,6 +174,7 @@ export class Subscription<A, B> implements\n}\nprotected dispatch(x: B) {\n+ this.last = x;\nfor (let s of this.subs) {\ntry {\ns.next && s.next(x);\n",
"new_path": "packages/rstream/src/subscription.ts",
"old_path": "packages/rstream/src/subscription.ts"
},
{
"change_type": "ADD",
"diff": "+// import * as tx from \"@thi.ng/transducers\";\n+import * as assert from \"assert\";\n+\n+import * as rs from \"../src/index\";\n+\n+describe(\"Subscription\", () => {\n+ let src: rs.Stream<number>;\n+\n+ beforeEach(() => {\n+ });\n+\n+ it(\"new sub receives last\", (done) => {\n+ let buf = [];\n+ src = rs.fromIterable([1, 2, 3], 10);\n+ src.subscribe({ next(x) { buf.push(x); } });\n+ setTimeout(() =>\n+ src.subscribe({\n+ next(x) { buf.push(x); },\n+ done() {\n+ assert.deepEqual(buf, [1, 2, 2, 3, 3]);\n+ done();\n+ }\n+ }),\n+ 25);\n+ });\n+});\n\\ No newline at end of file\n",
"new_path": "packages/rstream/test/subscription.ts",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(rstream): Subscription stores last value and passes to new subs
| 1
|
feat
|
rstream
|
679,913
|
20.03.2018 16:15:02
| 0
|
a1c58418ad89e78d968fea938310d7948cda6201
|
docs(rstream): add Cache deprecation docstring
|
[
{
"change_type": "MODIFY",
"diff": "@@ -3,6 +3,11 @@ import { Transducer } from \"@thi.ng/transducers/api\";\nimport { Subscription } from \"../subscription\";\n+/**\n+ * Deprecated since v1.1.0. Subscriptions now store last received value\n+ * and new subs will receive the last value stored in parent as their\n+ * first value (if there is one).\n+ */\nexport class Cache<T> extends Subscription<any, T> implements\nIDeref<T> {\n",
"new_path": "packages/rstream/src/subs/cache.ts",
"old_path": "packages/rstream/src/subs/cache.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs(rstream): add Cache deprecation docstring
| 1
|
docs
|
rstream
|
217,922
|
20.03.2018 16:21:52
| -3,600
|
13753a01e9d2fe8776d9e497c898913bc210fe4c
|
chore: hotfix for navigation map
|
[
{
"change_type": "MODIFY",
"diff": "@@ -10,9 +10,12 @@ export class ZoneBreakdown {\nif (row.gatheredBy !== undefined && row.gatheredBy.nodes !== undefined && row.gatheredBy.nodes.length !== 0) {\nrow.gatheredBy.nodes.forEach(node => {\nif (node.coords !== undefined) {\n- row.coords = {x: node.coords[0], y: node.coords[1]};\n- }\n+ const rowClone = JSON.parse(JSON.stringify(row));\n+ rowClone.coords = {x: node.coords[0], y: node.coords[1]};\n+ this.addToBreakdown(node.zoneid, rowClone);\n+ } else {\nthis.addToBreakdown(node.zoneid, row);\n+ }\n});\n} else if (row.drops !== undefined && row.drops.length > 0) {\nrow.drops.forEach(drop => {\n",
"new_path": "src/app/model/list/zone-breakdown.ts",
"old_path": "src/app/model/list/zone-breakdown.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -14,7 +14,7 @@ import {NavigationObjective} from './navigation-objective';\nexport class MapService {\n// Flying mount speed, used as reference for TP over mount comparison, needs a precise recording.\n- private static readonly MOUNT_SPEED = 5;\n+ private static readonly MOUNT_SPEED = 2.5;\n// TP duration on the same map, this is an average.\nprivate static readonly TP_DURATION = 8;\n",
"new_path": "src/app/modules/map/map.service.ts",
"old_path": "src/app/modules/map/map.service.ts"
},
{
"change_type": "MODIFY",
"diff": "</button>\n</div>\n<mat-divider class=\"zone-divider\"></mat-divider>\n- <div *ngFor=\"let item of row.items; trackBy: trackByFn; let i = index\"\n+ <div *ngFor=\"let item of uniquify(row.items); trackBy: trackByFn; let i = index\"\n[ngClass]=\"{compact: settings.compactLists}\">\n<app-item [list]=\"list\"\n[user]=\"user\"\n",
"new_path": "src/app/pages/list/list-details-panel/list-details-panel.component.html",
"old_path": "src/app/pages/list/list-details-panel/list-details-panel.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -81,6 +81,10 @@ export class ListDetailsPanelComponent implements OnChanges, OnInit {\n}\n}\n+ public uniquify(items: ListRow[]): ListRow[] {\n+ return items.filter((value, index, array) => array.filter(row => row.id === value.id).length === 1);\n+ }\n+\npublic getLocation(id: number): I18nName {\nif (id === -1) {\nreturn {fr: 'Autre', de: 'Anderes', ja: 'Other', en: 'Other'};\n",
"new_path": "src/app/pages/list/list-details-panel/list-details-panel.component.ts",
"old_path": "src/app/pages/list/list-details-panel/list-details-panel.component.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore: hotfix for navigation map
| 1
|
chore
| null |
791,723
|
20.03.2018 16:41:02
| 25,200
|
f092a8ad4363bca3c5897a1f756a75a3333be2f5
|
docs: update docker image id
|
[
{
"change_type": "MODIFY",
"diff": "@@ -54,7 +54,7 @@ You can do a local docker image install of Travis to better inspect a travis bui\n* [Common Build Problems - Travis CI](https://docs.travis-ci.com/user/common-build-problems/#Troubleshooting-Locally-in-a-Docker-Image)\n```sh\n-docker run --name travis-debug -dit travisci/ci-garnet:packer-1496954857 /sbin/init\n+docker run --name travis-debug -dit travisci/ci-garnet:packer-1512502276-986baf0 /sbin/init\ndocker exec -it travis-debug bash -l\n# once inside, change to travis user, rather than root\n",
"new_path": "docs/hacking-tips.md",
"old_path": "docs/hacking-tips.md"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
docs: update docker image id
| 1
|
docs
| null |
217,922
|
20.03.2018 16:47:15
| -3,600
|
dfc379f54ce1ace616085ef9d10cf2c2a22cc2c9
|
chore: hotfix for navigation map (uniquify missing on some calls)
|
[
{
"change_type": "MODIFY",
"diff": "@@ -150,7 +150,7 @@ export class ListDetailsPanelComponent implements OnChanges, OnInit {\npublic openNavigationMap(zoneBreakdownRow: ZoneBreakdownRow): void {\nconst data: { mapId: number, points: NavigationObjective[] } = {\nmapId: zoneBreakdownRow.zoneId,\n- points: zoneBreakdownRow.items\n+ points: this.uniquify(zoneBreakdownRow.items)\n.map(item => {\nif (item.coords === undefined) {\nreturn undefined;\n@@ -163,7 +163,7 @@ export class ListDetailsPanelComponent implements OnChanges, OnInit {\n}\npublic hasNavigationMap(zoneBreakdownRow: ZoneBreakdownRow): boolean {\n- return zoneBreakdownRow.items\n+ return this.uniquify(zoneBreakdownRow.items)\n.map(item => {\nif (item.coords === undefined) {\nreturn undefined;\n",
"new_path": "src/app/pages/list/list-details-panel/list-details-panel.component.ts",
"old_path": "src/app/pages/list/list-details-panel/list-details-panel.component.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore: hotfix for navigation map (uniquify missing on some calls)
| 1
|
chore
| null |
791,813
|
20.03.2018 16:55:29
| -3,600
|
32fd61fee406fe6556c09c382ef82d03f08a84a4
|
core(is-crawlable): fix empty row in the details table
|
[
{
"change_type": "MODIFY",
"diff": "@@ -107,7 +107,7 @@ class IsCrawlable extends Audit {\nblockingDirectives.push({\nsource: {\ntype: 'url',\n- text: robotsFileUrl.href,\n+ value: robotsFileUrl.href,\n},\n});\n}\n",
"new_path": "lighthouse-core/audits/seo/is-crawlable.js",
"old_path": "lighthouse-core/audits/seo/is-crawlable.js"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
core(is-crawlable): fix empty row in the details table (#4820)
| 1
|
core
|
is-crawlable
|
217,922
|
20.03.2018 17:06:18
| -3,600
|
7bfea30d0ad64e7c65d3424498b137ca6ca5cdc9
|
chore: adjust mount speed
|
[
{
"change_type": "MODIFY",
"diff": "@@ -14,7 +14,7 @@ import {NavigationObjective} from './navigation-objective';\nexport class MapService {\n// Flying mount speed, used as reference for TP over mount comparison, needs a precise recording.\n- private static readonly MOUNT_SPEED = 2.5;\n+ private static readonly MOUNT_SPEED = 1;\n// TP duration on the same map, this is an average.\nprivate static readonly TP_DURATION = 8;\n",
"new_path": "src/app/modules/map/map.service.ts",
"old_path": "src/app/modules/map/map.service.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore: adjust mount speed
| 1
|
chore
| null |
791,813
|
20.03.2018 19:39:02
| -3,600
|
5192079f232359496281922cf06978a5e64d08bd
|
deps(robots-parser): patch robots-parser to work in browser env
|
[
{
"change_type": "MODIFY",
"diff": "\"plots-smoke\": \"bash plots/test/smoke.sh\",\n\"changelog\": \"conventional-changelog --config ./build/changelog-generator/index.js --infile changelog.md --same-file\",\n\"type-check\": \"tsc -p .\",\n- \"mixed-content\": \"./lighthouse-cli/index.js --chrome-flags='--headless' --config-path=./lighthouse-core/config/mixed-content.js\"\n+ \"mixed-content\": \"./lighthouse-cli/index.js --chrome-flags='--headless' --config-path=./lighthouse-core/config/mixed-content.js\",\n+ \"prepare\": \"patch-package\"\n},\n\"devDependencies\": {\n\"@types/chrome\": \"^0.0.60\",\n\"jsdom\": \"^9.12.0\",\n\"mocha\": \"^3.2.0\",\n\"npm-run-posix-or-windows\": \"^2.0.2\",\n+ \"postinstall-prepare\": \"^1.0.1\",\n\"sinon\": \"^2.3.5\",\n\"typescript\": \"^2.8.0-rc\",\n\"vscode-chrome-debug-core\": \"^3.23.8\",\n\"mkdirp\": \"0.5.1\",\n\"opn\": \"4.0.2\",\n\"parse-cache-control\": \"1.0.1\",\n+ \"patch-package\": \"^5.1.1\",\n\"raven\": \"^2.2.1\",\n\"rimraf\": \"^2.6.1\",\n\"robots-parser\": \"^1.0.2\",\n",
"new_path": "package.json",
"old_path": "package.json"
},
{
"change_type": "ADD",
"diff": "+patch-package\n+--- a/node_modules/robots-parser/Robots.js\n++++ b/node_modules/robots-parser/Robots.js\n+@@ -1,4 +1,4 @@\n+-var libUrl = require('url');\n++var URL = (typeof self !== 'undefined' && self.URL) || require('url').URL;\n+ var punycode = require('punycode');\n+\n+ /**\n+@@ -176,7 +176,7 @@ function isPathAllowed(path, rules) {\n+\n+\n+ function Robots(url, contents) {\n+- this._url = libUrl.parse(url);\n++ this._url = new URL(url);\n+ this._url.port = this._url.port || 80;\n+ this._url.hostname = punycode.toUnicode(this._url.hostname);\n+\n+@@ -262,7 +262,7 @@ Robots.prototype.setPreferredHost = function (url) {\n+ * @return {boolean?}\n+ */\n+ Robots.prototype.isAllowed = function (url, ua) {\n+- var parsedUrl = libUrl.parse(url);\n++ var parsedUrl = new URL(url);\n+ var userAgent = formatUserAgent(ua || '*');\n+\n+ parsedUrl.port = parsedUrl.port || 80;\n+@@ -277,7 +277,7 @@ Robots.prototype.isAllowed = function (url, ua) {\n+\n+ var rules = this._rules[userAgent] || this._rules['*'] || [];\n+\n+- return isPathAllowed(parsedUrl.path, rules);\n++ return isPathAllowed(parsedUrl.pathname + parsedUrl.search, rules);\n+ };\n+\n+ /**\n",
"new_path": "patches/robots-parser+1.0.2.patch",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -242,6 +242,12 @@ ansi-align@^1.1.0:\ndependencies:\nstring-width \"^1.0.1\"\n+ansi-align@^2.0.0:\n+ version \"2.0.0\"\n+ resolved \"https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz#c36aeccba563b89ceb556f3690f0b1d9e3547f7f\"\n+ dependencies:\n+ string-width \"^2.0.0\"\n+\nansi-escapes@^1.1.0:\nversion \"1.4.0\"\nresolved \"https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e\"\n@@ -268,6 +274,12 @@ ansi-styles@^3.1.0:\ndependencies:\ncolor-convert \"^1.9.0\"\n+ansi-styles@^3.2.1:\n+ version \"3.2.1\"\n+ resolved \"https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d\"\n+ dependencies:\n+ color-convert \"^1.9.0\"\n+\narchy@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40\"\n@@ -559,6 +571,18 @@ boxen@^1.0.0:\nterm-size \"^0.1.0\"\nwidest-line \"^1.0.0\"\n+boxen@^1.2.1:\n+ version \"1.3.0\"\n+ resolved \"https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz#55c6c39a8ba58d9c61ad22cd877532deb665a20b\"\n+ dependencies:\n+ ansi-align \"^2.0.0\"\n+ camelcase \"^4.0.0\"\n+ chalk \"^2.0.1\"\n+ cli-boxes \"^1.0.0\"\n+ string-width \"^2.0.0\"\n+ term-size \"^1.2.0\"\n+ widest-line \"^2.0.0\"\n+\nbrace-expansion@^1.0.0:\nversion \"1.1.6\"\nresolved \"https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.6.tgz#7197d7eaa9b87e648390ea61fc66c84427420df9\"\n@@ -679,6 +703,14 @@ chalk@2.1.0, chalk@^2.0.0, chalk@^2.1.0:\nescape-string-regexp \"^1.0.5\"\nsupports-color \"^4.0.0\"\n+chalk@^2.0.1:\n+ version \"2.3.2\"\n+ resolved \"https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz#250dc96b07491bfd601e648d66ddf5f60c7a5c65\"\n+ dependencies:\n+ ansi-styles \"^3.2.1\"\n+ escape-string-regexp \"^1.0.5\"\n+ supports-color \"^5.3.0\"\n+\nchrome-devtools-frontend@1.0.401423:\nversion \"1.0.401423\"\nresolved \"https://registry.yarnpkg.com/chrome-devtools-frontend/-/chrome-devtools-frontend-1.0.401423.tgz#32a89b8d04e378a494be3c8d63271703be1c04ea\"\n@@ -1065,7 +1097,7 @@ cross-spawn-async@^2.1.1:\nlru-cache \"^4.0.0\"\nwhich \"^1.2.8\"\n-cross-spawn@^5.1.0:\n+cross-spawn@^5.0.1, cross-spawn@^5.1.0:\nversion \"5.1.0\"\nresolved \"https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449\"\ndependencies:\n@@ -1417,6 +1449,18 @@ execa@^0.4.0:\npath-key \"^1.0.0\"\nstrip-eof \"^1.0.0\"\n+execa@^0.7.0:\n+ version \"0.7.0\"\n+ resolved \"https://registry.npmjs.org/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777\"\n+ dependencies:\n+ cross-spawn \"^5.0.1\"\n+ get-stream \"^3.0.0\"\n+ is-stream \"^1.1.0\"\n+ npm-run-path \"^2.0.0\"\n+ p-finally \"^1.0.0\"\n+ signal-exit \"^3.0.0\"\n+ strip-eof \"^1.0.0\"\n+\nexit-hook@^1.0.0:\nversion \"1.1.1\"\nresolved \"https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8\"\n@@ -1654,6 +1698,14 @@ fs-extra@^1.0.0:\njsonfile \"^2.1.0\"\nklaw \"^1.0.0\"\n+fs-extra@^4.0.1:\n+ version \"4.0.3\"\n+ resolved \"https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94\"\n+ dependencies:\n+ graceful-fs \"^4.1.2\"\n+ jsonfile \"^4.0.0\"\n+ universalify \"^0.1.0\"\n+\nfs.realpath@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f\"\n@@ -1834,6 +1886,12 @@ glob@~3.1.21:\ninherits \"1\"\nminimatch \"~0.2.11\"\n+global-dirs@^0.1.0:\n+ version \"0.1.1\"\n+ resolved \"https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445\"\n+ dependencies:\n+ ini \"^1.3.4\"\n+\nglobal-modules@^0.2.3:\nversion \"0.2.3\"\nresolved \"https://registry.yarnpkg.com/global-modules/-/global-modules-0.2.3.tgz#ea5a3bed42c6d6ce995a4f8a1269b5dae223828d\"\n@@ -2037,6 +2095,10 @@ has-flag@^2.0.0:\nversion \"2.0.0\"\nresolved \"https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51\"\n+has-flag@^3.0.0:\n+ version \"3.0.0\"\n+ resolved \"https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd\"\n+\nhas-gulplog@^0.1.0:\nversion \"0.1.0\"\nresolved \"https://registry.yarnpkg.com/has-gulplog/-/has-gulplog-0.1.0.tgz#6414c82913697da51590397dafb12f22967811ce\"\n@@ -2101,6 +2163,10 @@ image-ssim@^0.2.0:\nversion \"0.2.0\"\nresolved \"https://registry.yarnpkg.com/image-ssim/-/image-ssim-0.2.0.tgz#83b42c7a2e6e4b85505477fe6917f5dbc56420e5\"\n+import-lazy@^2.1.0:\n+ version \"2.1.0\"\n+ resolved \"https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43\"\n+\nimurmurhash@^0.1.4:\nversion \"0.1.4\"\nresolved \"https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea\"\n@@ -2243,6 +2309,13 @@ is-glob@^2.0.0, is-glob@^2.0.1:\ndependencies:\nis-extglob \"^1.0.0\"\n+is-installed-globally@^0.1.0:\n+ version \"0.1.0\"\n+ resolved \"https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz#0dfd98f5a9111716dd535dda6492f67bf3d25a80\"\n+ dependencies:\n+ global-dirs \"^0.1.0\"\n+ is-path-inside \"^1.0.0\"\n+\nis-my-json-valid@^2.12.4:\nversion \"2.15.0\"\nresolved \"https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz#936edda3ca3c211fd98f3b2d3e08da43f7b2915b\"\n@@ -2514,6 +2587,12 @@ jsonfile@^2.1.0:\noptionalDependencies:\ngraceful-fs \"^4.1.6\"\n+jsonfile@^4.0.0:\n+ version \"4.0.0\"\n+ resolved \"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb\"\n+ optionalDependencies:\n+ graceful-fs \"^4.1.6\"\n+\njsonify@~0.0.0:\nversion \"0.0.0\"\nresolved \"https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73\"\n@@ -3034,6 +3113,12 @@ npm-run-path@^1.0.0:\ndependencies:\npath-key \"^1.0.0\"\n+npm-run-path@^2.0.0:\n+ version \"2.0.2\"\n+ resolved \"https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f\"\n+ dependencies:\n+ path-key \"^2.0.0\"\n+\nnpm-run-posix-or-windows@^2.0.2:\nversion \"2.0.2\"\nresolved \"https://registry.yarnpkg.com/npm-run-posix-or-windows/-/npm-run-posix-or-windows-2.0.2.tgz#74e894702ae34ea338502d04b500c1dec836736e\"\n@@ -3149,6 +3234,10 @@ osenv@^0.1.3:\nos-homedir \"^1.0.0\"\nos-tmpdir \"^1.0.0\"\n+p-finally@^1.0.0:\n+ version \"1.0.0\"\n+ resolved \"https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae\"\n+\np-limit@^1.1.0:\nversion \"1.1.0\"\nresolved \"https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc\"\n@@ -3209,6 +3298,19 @@ parse5@^1.5.1:\nversion \"1.5.1\"\nresolved \"https://registry.yarnpkg.com/parse5/-/parse5-1.5.1.tgz#9b7f3b0de32be78dc2401b17573ccaf0f6f59d94\"\n+patch-package@^5.1.1:\n+ version \"5.1.1\"\n+ resolved \"https://registry.npmjs.org/patch-package/-/patch-package-5.1.1.tgz#e5e82fe08bed760b773b8eb73a7bcb7c1634f802\"\n+ dependencies:\n+ chalk \"^1.1.3\"\n+ cross-spawn \"^5.1.0\"\n+ fs-extra \"^4.0.1\"\n+ minimist \"^1.2.0\"\n+ rimraf \"^2.6.1\"\n+ slash \"^1.0.0\"\n+ tmp \"^0.0.31\"\n+ update-notifier \"^2.2.0\"\n+\npath-exists@2.1.0, path-exists@^2.0.0:\nversion \"2.1.0\"\nresolved \"https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b\"\n@@ -3235,6 +3337,10 @@ path-key@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/path-key/-/path-key-1.0.0.tgz#5d53d578019646c0d68800db4e146e6bdc2ac7af\"\n+path-key@^2.0.0:\n+ version \"2.0.1\"\n+ resolved \"https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40\"\n+\npath-root-regex@^0.1.0:\nversion \"0.1.2\"\nresolved \"https://registry.yarnpkg.com/path-root-regex/-/path-root-regex-0.1.2.tgz#bfccdc8df5b12dc52c8b43ec38d18d72c04ba96d\"\n@@ -3287,6 +3393,10 @@ pluralize@^7.0.0:\nversion \"7.0.0\"\nresolved \"https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777\"\n+postinstall-prepare@^1.0.1:\n+ version \"1.0.1\"\n+ resolved \"https://registry.npmjs.org/postinstall-prepare/-/postinstall-prepare-1.0.1.tgz#dac9b5d91b054389141b13c0192eb68a0aa002b5\"\n+\nprelude-ls@~1.1.2:\nversion \"1.1.2\"\nresolved \"https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54\"\n@@ -3959,6 +4069,12 @@ supports-color@^4.0.0:\ndependencies:\nhas-flag \"^2.0.0\"\n+supports-color@^5.3.0:\n+ version \"5.3.0\"\n+ resolved \"https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz#5b24ac15db80fa927cf5227a4a33fd3c4c7676c0\"\n+ dependencies:\n+ has-flag \"^3.0.0\"\n+\nsymbol-tree@^3.2.1:\nversion \"3.2.2\"\nresolved \"https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6\"\n@@ -3994,6 +4110,12 @@ term-size@^0.1.0:\ndependencies:\nexeca \"^0.4.0\"\n+term-size@^1.2.0:\n+ version \"1.2.0\"\n+ resolved \"https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz#458b83887f288fc56d6fffbfad262e26638efa69\"\n+ dependencies:\n+ execa \"^0.7.0\"\n+\ntext-encoding@0.6.4:\nversion \"0.6.4\"\nresolved \"https://registry.yarnpkg.com/text-encoding/-/text-encoding-0.6.4.tgz#e399a982257a276dae428bb92845cb71bdc26d19\"\n@@ -4055,6 +4177,12 @@ tmp@^0.0.29:\ndependencies:\nos-tmpdir \"~1.0.1\"\n+tmp@^0.0.31:\n+ version \"0.0.31\"\n+ resolved \"https://registry.npmjs.org/tmp/-/tmp-0.0.31.tgz#8f38ab9438e17315e5dbd8b3657e8bfb277ae4a7\"\n+ dependencies:\n+ os-tmpdir \"~1.0.1\"\n+\ntmp@^0.0.33:\nversion \"0.0.33\"\nresolved \"https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9\"\n@@ -4144,6 +4272,10 @@ unique-string@^1.0.0:\ndependencies:\ncrypto-random-string \"^1.0.0\"\n+universalify@^0.1.0:\n+ version \"0.1.1\"\n+ resolved \"https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz#fa71badd4437af4c148841e3b3b165f9e9e590b7\"\n+\nunzip-response@^2.0.1:\nversion \"2.0.1\"\nresolved \"https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97\"\n@@ -4161,6 +4293,20 @@ update-notifier@^2.1.0:\nsemver-diff \"^2.0.0\"\nxdg-basedir \"^3.0.0\"\n+update-notifier@^2.2.0:\n+ version \"2.3.0\"\n+ resolved \"https://registry.npmjs.org/update-notifier/-/update-notifier-2.3.0.tgz#4e8827a6bb915140ab093559d7014e3ebb837451\"\n+ dependencies:\n+ boxen \"^1.2.1\"\n+ chalk \"^2.0.1\"\n+ configstore \"^3.0.0\"\n+ import-lazy \"^2.1.0\"\n+ is-installed-globally \"^0.1.0\"\n+ is-npm \"^1.0.0\"\n+ latest-version \"^3.0.0\"\n+ semver-diff \"^2.0.0\"\n+ xdg-basedir \"^3.0.0\"\n+\nurl-parse-lax@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73\"\n@@ -4321,6 +4467,12 @@ widest-line@^1.0.0:\ndependencies:\nstring-width \"^1.0.1\"\n+widest-line@^2.0.0:\n+ version \"2.0.0\"\n+ resolved \"https://registry.npmjs.org/widest-line/-/widest-line-2.0.0.tgz#0142a4e8a243f8882c0233aa0e0281aa76152273\"\n+ dependencies:\n+ string-width \"^2.1.1\"\n+\nwindow-size@0.1.0:\nversion \"0.1.0\"\nresolved \"https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d\"\n",
"new_path": "yarn.lock",
"old_path": "yarn.lock"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
deps(robots-parser): patch robots-parser to work in browser env (#4819)
| 1
|
deps
|
robots-parser
|
791,759
|
20.03.2018 19:54:11
| -3,600
|
7a1fb93328a45051f1cbf29ee69060314d8d909b
|
core(runner): rename generatedTime to fetchedAt
|
[
{
"change_type": "MODIFY",
"diff": "@@ -11,7 +11,7 @@ The top-level Lighthouse Results object (LHR) is what the lighthouse node module\n| Name | Description |\n| - | - |\n| lighthouseVersion | The version of Lighthouse with which these results were generated. |\n-| generatedTime | The ISO-8601 timestamp of when the results were generated. |\n+| fetchedAt | The ISO-8601 timestamp of when the results were generated. |\n| userAgent | The user agent string of the version of Chrome that was used by Lighthouse. |\n| initialUrl | The URL that was supplied to Lighthouse and initially navigated to. |\n| url | The URL that Lighthouse ended up auditing after redirects were followed. |\n@@ -26,7 +26,7 @@ The top-level Lighthouse Results object (LHR) is what the lighthouse node module\n```json\n{\n\"lighthouseVersion\": \"2.4.0\",\n- \"generatedTime\": \"2017-10-05T20:50:54.185Z\",\n+ \"fetchedAt\": \"2017-10-05T20:50:54.185Z\",\n\"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3233.0 Safari/537.36\",\n\"initialUrl\": \"http://example.com\",\n\"url\": \"https://www.example.com/\",\n",
"new_path": "docs/understanding-results.md",
"old_path": "docs/understanding-results.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -33,7 +33,7 @@ describe('CLI run', function() {\nassert.equal(results.audits.viewport.rawValue, false);\n// passed results match saved results\n- assert.strictEqual(results.generatedTime, passedResults.generatedTime);\n+ assert.strictEqual(results.fetchedAt, passedResults.fetchedAt);\nassert.strictEqual(results.url, passedResults.url);\nassert.strictEqual(results.audits.viewport.rawValue, passedResults.audits.viewport.rawValue);\nassert.strictEqual(\n",
"new_path": "lighthouse-cli/test/cli/run-test.js",
"old_path": "lighthouse-cli/test/cli/run-test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -104,6 +104,7 @@ class GatherRunner {\n.then(userAgent => {\ngathererResults.UserAgent = [userAgent];\nGatherRunner.warnOnHeadless(userAgent, gathererResults);\n+ gathererResults.fetchedAt = [(new Date()).toJSON()];\n})\n.then(_ => driver.beginEmulation(options.flags))\n.then(_ => driver.enableRuntimeEvents())\n",
"new_path": "lighthouse-core/gather/gather-runner.js",
"old_path": "lighthouse-core/gather/gather-runner.js"
},
{
"change_type": "MODIFY",
"diff": "* Generate a filenamePrefix of hostname_YYYY-MM-DD_HH-MM-SS\n* Date/time uses the local timezone, however Node has unreliable ICU\n* support, so we must construct a YYYY-MM-DD date format manually. :/\n- * @param {{url: string, generatedTime: string}} results\n+ * @param {{url: string, fetchedAt: string}} results\n* @return {string}\n*/\nfunction getFilenamePrefix(results) {\nconst hostname = new (URLConstructor || URL)(results.url).hostname;\n- const date = (results.generatedTime && new Date(results.generatedTime)) || new Date();\n+ const date = (results.fetchedAt && new Date(results.fetchedAt)) || new Date();\nconst timeStr = date.toLocaleTimeString('en-US', {hour12: false});\nconst dateParts = date.toLocaleDateString('en-US', {\n",
"new_path": "lighthouse-core/lib/file-namer.js",
"old_path": "lighthouse-core/lib/file-namer.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -57,7 +57,7 @@ class ReportRenderer {\n_renderReportHeader(report) {\nconst header = this._dom.cloneTemplate('#tmpl-lh-heading', this._templateContext);\nthis._dom.find('.lh-config__timestamp', header).textContent =\n- Util.formatDateTime(report.generatedTime);\n+ Util.formatDateTime(report.fetchedAt);\nconst url = this._dom.find('.lh-metadata__url', header);\nurl.href = report.url;\nurl.textContent = report.url;\n@@ -85,7 +85,7 @@ class ReportRenderer {\nconst footer = this._dom.cloneTemplate('#tmpl-lh-footer', this._templateContext);\nthis._dom.find('.lh-footer__version', footer).textContent = report.lighthouseVersion;\nthis._dom.find('.lh-footer__timestamp', footer).textContent =\n- Util.formatDateTime(report.generatedTime);\n+ Util.formatDateTime(report.fetchedAt);\nreturn footer;\n}\n@@ -252,6 +252,7 @@ ReportRenderer.GroupJSON; // eslint-disable-line no-unused-expressions\n* @typedef {{\n* lighthouseVersion: string,\n* userAgent: string,\n+ * fetchedAt: string,\n* generatedTime: string,\n* timing: {total: number},\n* initialUrl: string,\n",
"new_path": "lighthouse-core/report/v2/renderer/report-renderer.js",
"old_path": "lighthouse-core/report/v2/renderer/report-renderer.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -332,7 +332,7 @@ class ReportUIFeatures {\n_saveFile(blob) {\nconst filename = getFilenamePrefix({\nurl: this.json.url,\n- generatedTime: this.json.generatedTime,\n+ fetchedAt: this.json.fetchedAt,\n});\nconst ext = blob.type.match('json') ? '.json' : '.html';\n",
"new_path": "lighthouse-core/report/v2/renderer/report-ui-features.js",
"old_path": "lighthouse-core/report/v2/renderer/report-ui-features.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -105,11 +105,11 @@ class Runner {\nRunner._scoreAndCategorize(opts, resultsById);\ncategories = Object.values(opts.config.categories);\n}\n-\nreturn {\nuserAgent: runResults.artifacts.UserAgent,\nlighthouseVersion: require('../package').version,\n- generatedTime: (new Date()).toJSON(),\n+ fetchedAt: runResults.artifacts.fetchedAt,\n+ generatedTime: 'Please use .fetchedAt instead',\ninitialUrl: opts.initialUrl,\nurl: opts.url,\nrunWarnings: lighthouseRunWarnings,\n",
"new_path": "lighthouse-core/runner.js",
"old_path": "lighthouse-core/runner.js"
},
{
"change_type": "MODIFY",
"diff": "{\n\"userAgent\": \"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5 Build/MRA58N) AppleWebKit/537.36(KHTML, like Gecko) Chrome/59.0.3033.0 Mobile Safari/537.36\",\n\"lighthouseVersion\": \"2.0.0-alpha.4\",\n- \"generatedTime\": \"2017-05-11T17:17:14.282Z\",\n+ \"fetchedAt\": \"2017-05-11T17:17:14.282Z\",\n\"initialUrl\": \"http://localhost:10200/dobetterweb/dbw_tester.html\",\n\"url\": \"http://localhost:10200/dobetterweb/dbw_tester.html\",\n\"audits\": {\n",
"new_path": "lighthouse-core/test/fixtures/dbw_tester-perf-results.json",
"old_path": "lighthouse-core/test/fixtures/dbw_tester-perf-results.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -101,7 +101,7 @@ describe('Module Tests', function() {\n}],\n}).then(results => {\nassert.ok(results.lighthouseVersion);\n- assert.ok(results.generatedTime);\n+ assert.ok(results.fetchedAt);\nassert.equal(results.url, exampleUrl);\nassert.equal(results.initialUrl, exampleUrl);\nassert.ok(Array.isArray(results.reportCategories));\n",
"new_path": "lighthouse-core/test/index-test.js",
"old_path": "lighthouse-core/test/index-test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -13,7 +13,7 @@ describe('file-namer helper', () => {\nit('generates filename prefixes', () => {\nconst results = {\nurl: 'https://testexample.com',\n- generatedTime: '2017-01-06T02:34:56.217Z',\n+ fetchedAt: '2017-01-06T02:34:56.217Z',\n};\nconst str = getFilenamePrefix(results);\n// we want the filename to match user timezone, however these tests will run on multiple TZs\n",
"new_path": "lighthouse-core/test/lib/file-namer-test.js",
"old_path": "lighthouse-core/test/lib/file-namer-test.js"
},
{
"change_type": "MODIFY",
"diff": "{\n\"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3358.0 Safari/537.36\",\n\"lighthouseVersion\": \"2.9.1\",\n- \"generatedTime\": \"2018-03-13T00:55:45.840Z\",\n+ \"fetchedAt\": \"2018-03-13T00:55:45.840Z\",\n\"initialUrl\": \"http://localhost:10200/dobetterweb/dbw_tester.html\",\n\"url\": \"http://localhost:10200/dobetterweb/dbw_tester.html\",\n\"runWarnings\": [],\n",
"new_path": "lighthouse-core/test/results/sample_v2.json",
"old_path": "lighthouse-core/test/results/sample_v2.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -422,7 +422,7 @@ describe('Runner', () => {\nreturn Runner.run(null, {url, config, driverMock}).then(results => {\nassert.ok(results.lighthouseVersion);\n- assert.ok(results.generatedTime);\n+ assert.ok(results.fetchedAt);\nassert.equal(results.initialUrl, url);\nassert.equal(gatherRunnerRunSpy.called, true, 'GatherRunner.run was not called');\nassert.equal(results.audits['content-width'].name, 'content-width');\n@@ -452,7 +452,7 @@ describe('Runner', () => {\nreturn Runner.run(null, {url, config, driverMock}).then(results => {\nassert.ok(results.lighthouseVersion);\n- assert.ok(results.generatedTime);\n+ assert.ok(results.fetchedAt);\nassert.equal(results.initialUrl, url);\nassert.equal(gatherRunnerRunSpy.called, true, 'GatherRunner.run was not called');\nassert.equal(results.audits['content-width'].name, 'content-width');\n",
"new_path": "lighthouse-core/test/runner-test.js",
"old_path": "lighthouse-core/test/runner-test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -37,7 +37,7 @@ class GithubApi {\n.then(accessToken => {\nconst filename = getFilenamePrefix({\nurl: jsonFile.url,\n- generatedTime: jsonFile.generatedTime,\n+ fetchedAt: jsonFile.fetchedAt,\n});\nconst body = {\ndescription: 'Lighthouse json report',\n",
"new_path": "lighthouse-viewer/app/src/github-api.js",
"old_path": "lighthouse-viewer/app/src/github-api.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -43,7 +43,7 @@ declare global {\nlighthouseVersion: string;\nartifacts?: Object;\ninitialUrl: string;\n- generatedTime: string;\n+ fetchedAt: string;\n}\nexport interface LaunchedChrome {\n",
"new_path": "typings/externs.d.ts",
"old_path": "typings/externs.d.ts"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
core(runner): rename generatedTime to fetchedAt (#4783)
| 1
|
core
|
runner
|
679,913
|
20.03.2018 20:37:05
| 0
|
26f15b238af2c72ea0de18e081a3348ccc8804a0
|
refactor(rstream): simplify unsubscribe() logic
add Subscription.cleanup()
update unsub for Stream, Subscription, StreamMerge/Sync
no more calling of done() as part of unsub process
(strictly unidirectional teardown from child -> parent)
fix input unsubs for StreamMerge/Sync
|
[
{
"change_type": "MODIFY",
"diff": "@@ -70,20 +70,13 @@ export class StreamMerge<A, B> extends Subscription<A, B> {\nunsubscribe(sub?: Subscription<B, any>) {\nif (!sub) {\n- for (let s of this.sources.keys()) {\n+ for (let s of this.sources.values()) {\ns.unsubscribe();\n}\nthis.state = State.DONE;\nthis.sources.clear();\n- return true;\n}\n- if (super.unsubscribe(sub)) {\n- if (!this.subs.size) {\n- return this.unsubscribe();\n- }\n- return true;\n- }\n- return false;\n+ return super.unsubscribe(sub);\n}\nprotected markDone(src: ISubscribable<A>) {\n",
"new_path": "packages/rstream/src/stream-merge.ts",
"old_path": "packages/rstream/src/stream-merge.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -87,7 +87,13 @@ export class StreamSync<A, B> extends Subscription<A, B> {\nsrc,\nsrc.subscribe(\n{\n- next: (x) => this.next(x),\n+ next: (x) => {\n+ if (x instanceof Subscription) {\n+ this.add(x);\n+ } else {\n+ this.next(x);\n+ }\n+ },\ndone: () => this.markDone(src)\n},\nlabeled<string, A>(src.id)\n@@ -126,20 +132,14 @@ export class StreamSync<A, B> extends Subscription<A, B> {\nunsubscribe(sub?: Subscription<B, any>) {\nif (!sub) {\n- for (let s of this.sources.keys()) {\n+ for (let s of this.sources.values()) {\ns.unsubscribe();\n}\nthis.state = State.DONE;\nthis.sources.clear();\n- return true;\n- }\n- if (super.unsubscribe(sub)) {\n- if (!this.subs.size) {\n- return this.unsubscribe();\n- }\n- return true;\n+ this.sourceIDs.clear();\n}\n- return false;\n+ return super.unsubscribe(sub);\n}\nprotected markDone(src: ISubscribable<A>) {\n",
"new_path": "packages/rstream/src/stream-sync.ts",
"old_path": "packages/rstream/src/stream-sync.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -52,8 +52,8 @@ export class Stream<T> extends Subscription<T, T>\nunsubscribe(sub?: Subscription<T, any>) {\nconst res = super.unsubscribe(sub);\n- if (res && (!this.subs || !this.subs.size)) {\n- this.done();\n+ if (res && (!sub || (!this.subs || !this.subs.size))) {\n+ this.cancel();\n}\nreturn res;\n}\n",
"new_path": "packages/rstream/src/stream.ts",
"old_path": "packages/rstream/src/stream.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -84,19 +84,28 @@ export class Subscription<A, B> implements\nreturn wrapped;\n}\n+ /**\n+ * If called without arg, removes this subscription from parent (if\n+ * any), cleans up internal state and goes into DONE state. If\n+ * called with arg, removes the sub from internal pool and if no\n+ * other subs are remaining also cleans up itself and goes into DONE\n+ * state.\n+ *\n+ * @param sub\n+ */\nunsubscribe(sub?: Subscription<B, any>) {\n+ DEBUG && console.log(this.id, \"unsub start\", sub ? sub.id : \"self\");\nif (!sub) {\n+ let res = true;\nif (this.parent) {\n- const res = this.parent.unsubscribe(this);\n+ res = this.parent.unsubscribe(this);\n+ }\nthis.state = State.DONE;\n- delete this.last;\n- delete this.parent;\n+ this.cleanup();\nreturn res;\n}\n- return false;\n- }\nif (this.subs) {\n- DEBUG && console.log(this.id, \"unsub\", sub.id);\n+ DEBUG && console.log(this.id, \"unsub child\", sub.id);\nif (this.subs.has(sub)) {\nthis.subs.delete(sub);\nif (!this.subs.size) {\n@@ -127,6 +136,7 @@ export class Subscription<A, B> implements\n}\ndone() {\n+ DEBUG && console.log(this.id, \"done start\");\nif (this.state < State.DONE) {\nif (this.xform) {\nconst acc = this.xform[1]([]);\n@@ -141,8 +151,6 @@ export class Subscription<A, B> implements\ns.done && s.done();\n}\nthis.unsubscribe();\n- delete this.subs;\n- delete this.xform;\nDEBUG && console.log(this.id, \"done\");\n}\n}\n@@ -163,6 +171,7 @@ export class Subscription<A, B> implements\nif (this.parent) {\nDEBUG && console.log(this.id, \"unsubscribing...\");\nthis.unsubscribe();\n+ this.state = State.ERROR;\n}\n}\n}\n@@ -174,6 +183,7 @@ export class Subscription<A, B> implements\n}\nprotected dispatch(x: B) {\n+ DEBUG && console.log(this.id, \"dispatch\", x);\nthis.last = x;\nfor (let s of this.subs) {\ntry {\n@@ -189,4 +199,12 @@ export class Subscription<A, B> implements\nthrow new Error(`operation not allowed in ${State[this.state]} state`);\n}\n}\n+\n+ protected cleanup() {\n+ DEBUG && console.log(this.id, \"cleanup\");\n+ this.subs.clear();\n+ delete this.parent;\n+ delete this.xform;\n+ delete this.last;\n+ }\n}\n",
"new_path": "packages/rstream/src/subscription.ts",
"old_path": "packages/rstream/src/subscription.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(rstream): simplify unsubscribe() logic
- add Subscription.cleanup()
- update unsub for Stream, Subscription, StreamMerge/Sync
- no more calling of done() as part of unsub process
(strictly unidirectional teardown from child -> parent)
- fix input unsubs for StreamMerge/Sync
| 1
|
refactor
|
rstream
|
679,913
|
20.03.2018 20:41:03
| 0
|
42b343aaec935de16132f60861c02a78f7ec5ff1
|
test(rstream): add StreamSync & Subscription tests
|
[
{
"change_type": "ADD",
"diff": "+import * as assert from \"assert\";\n+\n+import { Atom } from \"@thi.ng/atom\";\n+import * as tx from \"@thi.ng/transducers\";\n+\n+import * as rs from \"../src/index\";\n+\n+describe(\"StreamSync\", () => {\n+\n+ function adder() {\n+ return tx.map(\n+ (ports) => {\n+ let sum = 0;\n+ for (let p in ports) {\n+ sum += ports[p];\n+ }\n+ return sum;\n+ }\n+ );\n+ }\n+\n+ it(\"dataflow & teardown\", () => {\n+ let a, b, c;\n+ let a1done = false, a2done = false;\n+ let a1buf, a2buf;\n+ const db = new Atom<any>({\n+ a1: { ins: { a: 1, b: 2 } },\n+ a2: { ins: { b: 10 } },\n+ });\n+ const a1 = new rs.StreamSync({\n+ src: [\n+ a = rs.fromView(db, \"a1.ins.a\"),\n+ b = rs.fromView(db, \"a1.ins.b\"),\n+ ],\n+ xform: adder(),\n+ reset: false\n+ });\n+ const a1res = a1.subscribe({\n+ next(x) { a1buf = x; },\n+ done() { a1done = true; }\n+ });\n+ const a2 = new rs.StreamSync({\n+ src: [\n+ a1,\n+ c = rs.fromView(db, \"a2.ins.b\"),\n+ ],\n+ xform: adder(),\n+ reset: false\n+ });\n+ const res = a2.subscribe({\n+ next(x) { a2buf = x; },\n+ done() { a2done = true; }\n+ });\n+ assert.equal(a1buf, 3);\n+ assert.equal(a2buf, 13);\n+ db.reset({ a1: { ins: { a: 100, b: 200 } }, a2: { ins: { b: 1000 } } });\n+ assert.equal(a1buf, 300);\n+ assert.equal(a2buf, 1300);\n+ // teardown from end result\n+ res.unsubscribe();\n+ assert(!a1done);\n+ assert(!a2done);\n+ assert.equal(a.getState(), rs.State.ACTIVE, \"a != ACTIVE\");\n+ assert.equal(b.getState(), rs.State.ACTIVE, \"b != ACTIVE\");\n+ assert.equal(a1.getState(), rs.State.ACTIVE, \"a1 != ACTIVE\");\n+ assert.equal(a1res.getState(), rs.State.IDLE, \"a1res != IDLE\");\n+ assert.equal(c.getState(), rs.State.DONE, \"c != DONE\");\n+ assert.equal(a2.getState(), rs.State.DONE, \"a2 != DONE\");\n+ assert.equal(res.getState(), rs.State.DONE, \"res != DONE\");\n+ // teardown from a1 result\n+ a1res.unsubscribe();\n+ assert.equal(a.getState(), rs.State.DONE, \"a != DONE\");\n+ assert.equal(b.getState(), rs.State.DONE, \"b != DONE\");\n+ assert.equal(a1.getState(), rs.State.DONE, \"a1 != DONE\");\n+ assert.equal(a1res.getState(), rs.State.DONE, \"a1res != DONE\");\n+ assert(!a1done);\n+ assert(!a2done);\n+ });\n+});\n",
"new_path": "packages/rstream/test/stream-sync.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "-// import * as tx from \"@thi.ng/transducers\";\n+import * as tx from \"@thi.ng/transducers\";\nimport * as assert from \"assert\";\nimport * as rs from \"../src/index\";\n@@ -23,4 +23,57 @@ describe(\"Subscription\", () => {\n}),\n25);\n});\n+\n+ it(\"unsub does not trigger Subscription.done()\", (done) => {\n+ let buf = [];\n+ let called = false;\n+ src = rs.fromIterable([1, 2, 3], 10);\n+ const sub = src.subscribe({\n+ next(x) { buf.push(x); },\n+ done() { called = true; }\n+ });\n+ setTimeout(() => sub.unsubscribe(), 15);\n+ setTimeout(() => {\n+ assert.deepEqual(buf, [1]);\n+ assert.equal(src.getState(), rs.State.DONE);\n+ assert(!called);\n+ done();\n+ }, 30);\n+ });\n+\n+ it(\"no new values after unsub\", (done) => {\n+ let buf = [];\n+ let called = false;\n+ src = rs.fromIterable([1, 2, 3], 10);\n+ const sub = src.subscribe(\n+ {\n+ next(x) { buf.push(x); },\n+ done() { called = true; }\n+ },\n+ tx.partition(2, true)\n+ );\n+ setTimeout(() => sub.unsubscribe(), 25);\n+ setTimeout(() => {\n+ assert.deepEqual(buf, [[1, 2]]);\n+ assert.equal(src.getState(), rs.State.DONE);\n+ assert(!called);\n+ done();\n+ }, 50);\n+ });\n+\n+ it(\"completing transducer sends all values\", (done) => {\n+ let buf = [];\n+ src = rs.fromIterable([1, 2, 3], 10);\n+ src.subscribe(\n+ {\n+ next(x) { buf.push(x); },\n+ done() {\n+ assert.deepEqual(buf, [[1, 2], [3]]);\n+ assert.equal(src.getState(), rs.State.DONE);\n+ done();\n+ }\n+ },\n+ tx.partition(2, true)\n+ );\n+ });\n});\n",
"new_path": "packages/rstream/test/subscription.ts",
"old_path": "packages/rstream/test/subscription.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
test(rstream): add StreamSync & Subscription tests
| 1
|
test
|
rstream
|
679,913
|
20.03.2018 22:35:48
| 0
|
eec56dec5d42c754c6c7d2032ae29aab8d4dfbac
|
feat(rstream): add transduce(), update re-exports
|
[
{
"change_type": "MODIFY",
"diff": "@@ -21,5 +21,6 @@ export * from \"./subs/resolve\";\nexport * from \"./subs/sidechain-partition\";\nexport * from \"./subs/sidechain-toggle\";\nexport * from \"./subs/trace\";\n+export * from \"./subs/transduce\";\nexport * from \"./utils/worker\";\n",
"new_path": "packages/rstream/src/index.ts",
"old_path": "packages/rstream/src/index.ts"
},
{
"change_type": "ADD",
"diff": "+import { Reducer, Transducer } from \"@thi.ng/transducers/api\";\n+import { isReduced } from \"@thi.ng/transducers/reduced\";\n+\n+import { Subscription } from \"../subscription\";\n+\n+export function transduce<A, B, C>(src: Subscription<any, A>, tx: Transducer<A, B>, rfn: Reducer<C, B>, init?: C): Promise<C> {\n+ let acc = init !== undefined ? init : rfn[0]();\n+ return new Promise((resolve, reject) => {\n+ const sub = src.subscribe({\n+ next(x) {\n+ const _acc = rfn[2](acc, x);\n+ if (isReduced(_acc)) {\n+ sub.unsubscribe();\n+ resolve(_acc.deref());\n+ } else {\n+ acc = _acc;\n+ }\n+ },\n+ done() {\n+ sub.unsubscribe();\n+ resolve(acc);\n+ },\n+ error(e) {\n+ reject(e);\n+ }\n+ }, tx);\n+ });\n+}\n",
"new_path": "packages/rstream/src/subs/transduce.ts",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(rstream): add transduce(), update re-exports
| 1
|
feat
|
rstream
|
679,913
|
20.03.2018 22:36:33
| 0
|
1fee7d5cad70e266b20d353360a1d63c41662ca2
|
feat(rstream): add merge()/sync() ctor wrappers
|
[
{
"change_type": "MODIFY",
"diff": "@@ -86,3 +86,7 @@ export class StreamMerge<A, B> extends Subscription<A, B> {\n}\n}\n}\n+\n+export function merge<A, B>(opts: Partial<StreamMergeOpts<A, B>>) {\n+ return new StreamMerge(opts);\n+}\n",
"new_path": "packages/rstream/src/stream-merge.ts",
"old_path": "packages/rstream/src/stream-merge.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -149,3 +149,7 @@ export class StreamSync<A, B> extends Subscription<A, B> {\n}\n}\n}\n+\n+export function sync<A, B>(opts: Partial<StreamSyncOpts<A, B>>) {\n+ return new StreamSync(opts);\n+}\n",
"new_path": "packages/rstream/src/stream-sync.ts",
"old_path": "packages/rstream/src/stream-sync.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(rstream): add merge()/sync() ctor wrappers
| 1
|
feat
|
rstream
|
679,913
|
20.03.2018 22:37:22
| 0
|
907d5995399b19b31afb88b2e5213b53829e72c1
|
feat(rstream): add IDeref impl for Subscription
|
[
{
"change_type": "MODIFY",
"diff": "@@ -5,8 +5,10 @@ import { push } from \"@thi.ng/transducers/rfn/push\";\nimport { isReduced, unreduced } from \"@thi.ng/transducers/reduced\";\nimport { DEBUG, ISubscribable, ISubscriber, State } from \"./api\";\n+import { IDeref } from \"@thi.ng/api/api\";\nexport class Subscription<A, B> implements\n+ IDeref<B>,\nISubscriber<A>,\nISubscribable<B> {\n@@ -34,6 +36,10 @@ export class Subscription<A, B> implements\n}\n}\n+ deref() {\n+ return this.last !== SEMAPHORE ? this.last : undefined;\n+ }\n+\ngetState() {\nreturn this.state;\n}\n",
"new_path": "packages/rstream/src/subscription.ts",
"old_path": "packages/rstream/src/subscription.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(rstream): add IDeref impl for Subscription
| 1
|
feat
|
rstream
|
679,913
|
21.03.2018 00:02:44
| 0
|
deb59a154615aa0ab573ee75a7a3b539958e70e5
|
docs(rstream): update readme, add dataflow example
|
[
{
"change_type": "MODIFY",
"diff": "@@ -43,7 +43,7 @@ are provided too:\n- [merge](https://github.com/thi-ng/umbrella/tree/master/packages/rstream/src/stream-merge.ts) - unsorted merge from multiple inputs (dynamic add/remove)\n- [sync](https://github.com/thi-ng/umbrella/tree/master/packages/rstream/src/stream-sync.ts) - synchronized merge and labeled tuple objects\n-### Useful subscription handlers\n+### Useful subscription ops\n- [bisect](https://github.com/thi-ng/umbrella/tree/master/packages/rstream/src/subs/bisect.ts) - split via predicate\n- [postWorker](https://github.com/thi-ng/umbrella/tree/master/packages/rstream/src/subs/post-worker.ts) - send values to workers (incl. optional worker instantiation)\n@@ -53,6 +53,12 @@ are provided too:\n- [trace](https://github.com/thi-ng/umbrella/tree/master/packages/rstream/src/subs/trace.ts) - debug helper\n- [transduce](https://github.com/thi-ng/umbrella/tree/master/packages/rstream/src/subs/transduce.ts) - transduce or just reduce an entire stream into a promise\n+### Miscellaneous\n+\n+- Subscriptions implement @thi.ng/api's `IDeref` interface and therefore\n+ can be used directly in UI components based on\n+ [@thi.ng/hdom](https://github.com/thi-ng/umbrella/tree/master/packages/hdom).\n+\nFurthermore, the\n[@thi.ng/rstream-log](https://github.com/thi-ng/umbrella/tree/master/packages/rstream-log)\npackage provides an extensible multi-level, multi-target logging\n@@ -60,12 +66,15 @@ solution based on this library.\n## Conceptual differences to RxJS\n+(No value judgements implied - there's room for both approaches!)\n+\n- Streams are not the same as Observables: I.e. stream sources are NOT\n(often just cannot) re-run for each new sub added. Only the first sub\nis guaranteed to receive **all** values. Subs added at a later time\n- MIGHT not receive earlier emitted values, only the most recent emitted\n- and any future ones)\n-- Every subscription supports any number of subscribers\n+ MIGHT not receive earlier emitted values, but only the most recent\n+ emitted and any future values)\n+- Every subscription supports any number of subscribers, which can be\n+ added/removed at any time\n- Every unsubscription recursively triggers upstream unsubscriptions\n(provided a parent has no other active child subscriptions)\n- Every subscription can have its own transducer transforming\n@@ -75,12 +84,14 @@ solution based on this library.\n- Transducers can cause early stream termination and subsequent unwinding\n- Values can be manually injected into the stream pipeline / graph at\nany point\n-- Every Stream is a subscription\n-- Unhandled errors in user subscriptions will move subscription into\n- error state and cause unsubscription from parent\n+- Every Stream also is a subscription\n+- Unhandled errors in subscriptions will move subscription into error\n+ state and cause unsubscription from parent (if any). Unhandled errors\n+ in stream sources will cancel the stream.\n- *Much* smaller API surface since most common & custom operations can\n- be solved via transducers, so less need to provide specialized\n- functions (map / filter etc.)\n+ be solved via available transducers. Therefore less need to provide\n+ specialized functions (map / filter etc.) and more flexibility in\n+ terms of composing new operations.\n- IMHO less confusing naming / terminology (only streams (producers) &\nsubscriptions (consumers))\n@@ -151,10 +162,72 @@ new rs.StreamMerge({\n### Dataflow graph example\n-TODO see [test](https://github.com/thi-ng/umbrella/tree/master/packages/rstream/test/stream-sync.ts) for now...\n+This example uses [synchronized stream merging](https://github.com/thi-ng/umbrella/tree/master/packages/rstream/src/stream-sync.ts#L19) to implement a dataflow graph whose leaf inputs (and their changes) are sourced from a central immutable [atom](https://github.com/thi-ng/umbrella/tree/master/packages/).\n```typescript\n+import { Atom } from \"@thi.ng/atom/atom\";\n+import { map } from \"@thi.ng/transducers\";\n+import * as rs from \"@thi.ng/rstream\";\n+// create mutable/watchable container for graph inputs\n+const graph = new Atom<any>({\n+ a1: { ports: { a: 1, b: 2 } },\n+ a2: { ports: { b: 10 } },\n+ a3: { ports: { c: 0 } },\n+});\n+\n+// create a synchronized stream merge from given inputs\n+const adder = (src) =>\n+ rs.sync({\n+ src,\n+ // define transducer for merged tuple objects\n+ // summing all values in each tuple\n+ // (i.e. the values from the input streams)\n+ xform: map((ports) => {\n+ let sum = 0;\n+ for (let p in ports) {\n+ sum += ports[p];\n+ }\n+ return sum;\n+ }),\n+ // reset=false will only synchronize *all* inputs for the\n+ // very 1st merged tuple, then emit updated ones when *any*\n+ // input has changed with other input values in the tuple\n+ // remaining the same\n+ reset: false\n+ });\n+\n+// define first dataflow node\n+// `fromView()` creates a stream of value changes\n+// for given value path in the above atom\n+const a1 = adder([\n+ rs.fromView(graph, \"a1.ports.a\"),\n+ rs.fromView(graph, \"a1.ports.b\"),\n+]);\n+\n+// this node computes sum of:\n+// - prev node\n+// - view of a2.ports.b value in atom\n+// - for fun, another external stream (iterable)\n+const a2 = adder([\n+ a1,\n+ rs.fromView(graph, \"a2.ports.b\"),\n+ rs.fromIterable([0, 1, 2]),\n+]);\n+\n+// last node computes sum of the other 2 nodes\n+const a3 = adder([a1, a2]);\n+\n+// add a console.log sub to see results\n+a3.subscribe(rs.trace(\"result:\"));\n+// result: 16\n+// result: 17\n+// result: 18\n+\n+// value update in atom triggers recomputation\n+// of impacted graph nodes (and only those!)\n+setTimeout(() => graph.resetIn(\"a2.ports.b\", 100), 100);\n+// result: 108\n```\n### Central app state atom with reactive undo / redo\n",
"new_path": "packages/rstream/README.md",
"old_path": "packages/rstream/README.md"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs(rstream): update readme, add dataflow example
| 1
|
docs
|
rstream
|
679,913
|
21.03.2018 00:22:07
| 0
|
2a1264a2e7f4393d27b88f8761eb1ddcf9dcffdd
|
refactor(rstream-log): update Logger ctor arg handling
|
[
{
"change_type": "MODIFY",
"diff": "-import { isNumber } from \"@thi.ng/checks/is-number\";\n-\nimport { ISubscribable } from \"@thi.ng/rstream/api\";\nimport { StreamMerge } from \"@thi.ng/rstream/stream-merge\";\nimport { Subscription } from \"@thi.ng/rstream/subscription\";\n@@ -16,15 +14,24 @@ export class Logger extends StreamMerge<LogEntry, LogEntry> implements\nconstructor(id: string, level: Level);\nconstructor(id: string, sources: Iterable<ISubscribable<LogEntry>>, level?: Level);\nconstructor(...args: any[]) {\n- let id = args[0] || `logger-${Subscription.NEXT_ID++}`;\n+ let id;\nlet level = Level.FINE;\nlet src;\n- if (isNumber(args[1])) {\n- level = args[1];\n- } else {\n- src = args[1];\n- level = args[2] !== undefined ? args[2] : level;\n+ switch (args.length) {\n+ case 0:\n+ case 1:\n+ break;\n+ case 2:\n+ [id, level] = args;\n+ break;\n+ case 3:\n+ [id, src, level] = args;\n+ src = [...src];\n+ break;\n+ default:\n+ throw new Error(`illegal arity: ${args.length}`);\n}\n+ id = id || `logger-${Subscription.NEXT_ID++}`;\nsuper({ src, id, close: false });\nthis.level = level;\n}\n",
"new_path": "packages/rstream-log/src/logger.ts",
"old_path": "packages/rstream-log/src/logger.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(rstream-log): update Logger ctor arg handling
| 1
|
refactor
|
rstream-log
|
791,676
|
21.03.2018 00:24:09
| -3,600
|
e90f9acb894906951f3bb5fa19eb3298f5593143
|
extension(tests): add extension pptr smoketest
|
[
{
"change_type": "MODIFY",
"diff": "@@ -17,17 +17,20 @@ cache:\n- lighthouse-viewer/node_modules\n- /home/travis/.rvm/gems/\ninstall:\n+ # if our e2e tests fail in the future it might be that we are not compatible\n+ # with the latest puppeteer api so we probably need to run on chromimum\n+ # @see https://github.com/GoogleChrome/lighthouse/pull/4640/files#r171425004\n+ - export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1\n- yarn\n# travis can't handle the parallel install (without caches)\n- yarn run install-all:task:windows\nbefore_script:\n- export DISPLAY=:99.0\n- - export CHROME_PATH=\"$(pwd)/chrome-linux/chrome\"\n+ # see comment above about puppeteer\n+ - export CHROME_PATH=\"$(which google-chrome-stable)\"\n- sh -e /etc/init.d/xvfb start\n- yarn build-all\nscript:\n- - echo $TRAVIS_EVENT_TYPE;\n- - echo $TRAVIS_BRANCH\n- yarn bundlesize\n- yarn lint\n- yarn unit\n@@ -35,6 +38,7 @@ script:\n- yarn closure\n- yarn smoke\n- yarn smokehouse\n+ - yarn test-extension\n# _JAVA_OPTIONS is breaking parsing of compiler output. See #3338.\n- unset _JAVA_OPTIONS\n- yarn compile-devtools\n",
"new_path": ".travis.yml",
"old_path": ".travis.yml"
},
{
"change_type": "MODIFY",
"diff": "},\n\"scripts\": {\n\"watch\": \"gulp watch\",\n- \"build\": \"gulp build:production\"\n+ \"build\": \"gulp build:production\",\n+ \"test\": \"mocha test/extension-test.js\"\n},\n\"devDependencies\": {\n\"brfs\": \"^1.5.0\",\n",
"new_path": "lighthouse-extension/package.json",
"old_path": "lighthouse-extension/package.json"
},
{
"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+/* eslint-env mocha */\n+\n+const path = require('path');\n+const assert = require('assert');\n+const fs = require('fs');\n+const puppeteer = require('../../node_modules/puppeteer/index.js');\n+\n+const lighthouseExtensionPath = path.resolve(__dirname, '../dist');\n+const config = require(path.resolve(__dirname, '../../lighthouse-core/config/default.js'));\n+\n+const getAuditsOfCategory = category => config.categories[category].audits;\n+\n+describe('Lighthouse chrome extension', function() {\n+ const manifestLocation = path.join(lighthouseExtensionPath, 'manifest.json');\n+ const lighthouseCategories = Object.keys(config.categories);\n+ let browser;\n+ let extensionPage;\n+ let originalManifest;\n+\n+ function getAuditElementsCount({category, selector}) {\n+ return extensionPage.evaluate(\n+ ({category, selector}) =>\n+ document.querySelector(`#${category}`).parentNode.querySelectorAll(selector).length,\n+ {category, selector}\n+ );\n+ }\n+\n+ before(async function() {\n+ // eslint-disable-next-line\n+ this.timeout(90 * 1000);\n+\n+ // read original manifest\n+ originalManifest = fs.readFileSync(manifestLocation);\n+\n+ const manifest = JSON.parse(originalManifest);\n+ // add tabs permision to the manifest\n+ manifest.permissions.push('tabs');\n+ // write new file to document\n+ fs.writeFileSync(manifestLocation, JSON.stringify(manifest, null, 2));\n+\n+ // start puppeteer\n+ browser = await puppeteer.launch({\n+ headless: false,\n+ executablePath: process.env.CHROME_PATH,\n+ args: [\n+ `--disable-extensions-except=${lighthouseExtensionPath}`,\n+ `--load-extension=${lighthouseExtensionPath}`,\n+ ],\n+ });\n+\n+ const page = await browser.newPage();\n+ await page.goto('https://www.paulirish.com', {waitUntil: 'networkidle2'});\n+ const targets = await browser.targets();\n+ const extensionTarget = targets.find(({_targetInfo}) => {\n+ return _targetInfo.title === 'Lighthouse' && _targetInfo.type === 'background_page';\n+ });\n+\n+ if (!extensionTarget) {\n+ return await browser.close();\n+ }\n+\n+ const client = await extensionTarget.createCDPSession();\n+ const lighthouseResult = await client.send('Runtime.evaluate', {\n+ expression: `runLighthouseInExtension({\n+ restoreCleanState: true,\n+ }, ${JSON.stringify(lighthouseCategories)})`,\n+ awaitPromise: true,\n+ returnByValue: true,\n+ });\n+\n+ if (lighthouseResult.exceptionDetails) {\n+ if (lighthouseResult.exceptionDetails.exception) {\n+ throw new Error(lighthouseResult.exceptionDetails.exception.description);\n+ }\n+\n+ throw new Error(lighthouseResult.exceptionDetails.text);\n+ }\n+\n+ extensionPage = (await browser.pages()).find(page =>\n+ page.url().includes('blob:chrome-extension://')\n+ );\n+ });\n+\n+ after(async () => {\n+ // put the default manifest back\n+ fs.writeFileSync(manifestLocation, originalManifest);\n+\n+ if (browser) {\n+ await browser.close();\n+ }\n+ });\n+\n+\n+ const selectors = {\n+ audits: '.lh-audit,.lh-timeline-metric,.lh-perf-hint',\n+ titles: '.lh-score__title, .lh-perf-hint__title, .lh-timeline-metric__title',\n+ };\n+\n+ it('should contain all categories', async () => {\n+ const categories = await extensionPage.$$(`#${lighthouseCategories.join(',#')}`);\n+ assert.equal(\n+ categories.length,\n+ lighthouseCategories.length,\n+ `${categories.join(' ')} does not match ${lighthouseCategories.join(' ')}`\n+ );\n+ });\n+\n+ it('should contain audits of all categories', async () => {\n+ for (const category of lighthouseCategories) {\n+ let expected = getAuditsOfCategory(category).length;\n+ if (category === 'performance') {\n+ expected = getAuditsOfCategory(category).filter(a => !!a.group).length;\n+ }\n+\n+ const elementCount = await getAuditElementsCount({category, selector: selectors.audits});\n+\n+ assert.equal(\n+ expected,\n+ elementCount,\n+ `${category} does not have the correct amount of audits`\n+ );\n+ }\n+ });\n+\n+ it('should contain a filmstrip', async () => {\n+ const filmstrip = await extensionPage.$('.lh-filmstrip');\n+\n+ assert.ok(!!filmstrip, `filmstrip is not available`);\n+ });\n+\n+ it('should not have any audit errors', async () => {\n+ function getDebugStrings(elems, selectors) {\n+ return elems.map(el => {\n+ const audit = el.closest(selectors.audits);\n+ const auditTitle = audit && audit.querySelector(selectors.titles);\n+ return {\n+ debugString: el.textContent,\n+ title: auditTitle ? auditTitle.textContent : 'Audit title unvailable',\n+ };\n+ });\n+ }\n+\n+ const auditErrors = await extensionPage.$$eval('.lh-debug', getDebugStrings, selectors);\n+ const errors = auditErrors.filter(\n+ item =>\n+ item.debugString.includes('Audit error:') &&\n+ // FIXME(phulce): fix timing failing on travis.\n+ !item.debugString.includes('No timing information available')\n+ );\n+ assert.deepStrictEqual(errors, [], 'Audit errors found within the report');\n+ });\n+});\n",
"new_path": "lighthouse-extension/test/extension-test.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "\"debug\": \"node --inspect-brk ./lighthouse-cli/index.js\",\n\"start\": \"node ./lighthouse-cli/index.js\",\n\"test\": \"yarn lint --quiet && yarn unit && yarn type-check && yarn closure\",\n+ \"test-extension\": \"cd lighthouse-extension && yarn test\",\n\"unit-core\": \"bash lighthouse-core/scripts/run-mocha.sh --core\",\n\"unit-cli\": \"bash lighthouse-core/scripts/run-mocha.sh --cli\",\n\"unit-viewer\": \"bash lighthouse-core/scripts/run-mocha.sh --viewer\",\n\"mocha\": \"^3.2.0\",\n\"npm-run-posix-or-windows\": \"^2.0.2\",\n\"postinstall-prepare\": \"^1.0.1\",\n+ \"puppeteer\": \"^1.1.1\",\n\"sinon\": \"^2.3.5\",\n\"typescript\": \"^2.8.0-rc\",\n\"vscode-chrome-debug-core\": \"^3.23.8\",\n",
"new_path": "package.json",
"old_path": "package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -211,6 +211,12 @@ add-stream@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/add-stream/-/add-stream-1.0.0.tgz#6a7990437ca736d5e1288db92bd3266d5f5cb2aa\"\n+agent-base@^4.1.0:\n+ version \"4.2.0\"\n+ resolved \"https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.0.tgz#9838b5c3392b962bad031e6a4c5e1024abec45ce\"\n+ dependencies:\n+ es6-promisify \"^5.0.0\"\n+\najv-keywords@^2.1.0:\nversion \"2.1.0\"\nresolved \"https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.0.tgz#a296e17f7bfae7c1ce4f7e0de53d29cb32162df0\"\n@@ -887,7 +893,7 @@ concat-map@0.0.1:\nversion \"0.0.1\"\nresolved \"https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b\"\n-concat-stream@^1.4.7, concat-stream@^1.6.0:\n+concat-stream@1.6.0, concat-stream@^1.4.7, concat-stream@^1.6.0:\nversion \"1.6.0\"\nresolved \"https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7\"\ndependencies:\n@@ -1182,13 +1188,19 @@ debug@2.2.0:\ndependencies:\nms \"0.7.1\"\n+debug@2.6.9:\n+ version \"2.6.9\"\n+ resolved \"https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f\"\n+ dependencies:\n+ ms \"2.0.0\"\n+\ndebug@^2.1.1, debug@^2.2.0, debug@^2.4.5, debug@^2.6.8:\nversion \"2.6.8\"\nresolved \"https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc\"\ndependencies:\nms \"2.0.0\"\n-debug@^3.0.1:\n+debug@^3.0.1, debug@^3.1.0:\nversion \"3.1.0\"\nresolved \"https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261\"\ndependencies:\n@@ -1326,6 +1338,16 @@ error-ex@^1.2.0:\ndependencies:\nis-arrayish \"^0.2.1\"\n+es6-promise@^4.0.3:\n+ version \"4.2.4\"\n+ resolved \"https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.4.tgz#dc4221c2b16518760bd8c39a52d8f356fc00ed29\"\n+\n+es6-promisify@^5.0.0:\n+ version \"5.0.0\"\n+ resolved \"https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203\"\n+ dependencies:\n+ es6-promise \"^4.0.3\"\n+\nescape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.3, escape-string-regexp@^1.0.5:\nversion \"1.0.5\"\nresolved \"https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4\"\n@@ -1509,6 +1531,15 @@ extglob@^0.3.1:\ndependencies:\nis-extglob \"^1.0.0\"\n+extract-zip@^1.6.5:\n+ version \"1.6.6\"\n+ resolved \"https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.6.6.tgz#1290ede8d20d0872b429fd3f351ca128ec5ef85c\"\n+ dependencies:\n+ concat-stream \"1.6.0\"\n+ debug \"2.6.9\"\n+ mkdirp \"0.5.0\"\n+ yauzl \"2.4.1\"\n+\nextsprintf@1.0.2:\nversion \"1.0.2\"\nresolved \"https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550\"\n@@ -1532,6 +1563,12 @@ fast-levenshtein@~2.0.4:\nversion \"2.0.5\"\nresolved \"https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.5.tgz#bd33145744519ab1c36c3ee9f31f08e9079b67f2\"\n+fd-slicer@~1.0.1:\n+ version \"1.0.1\"\n+ resolved \"https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.0.1.tgz#8b5bcbd9ec327c5041bf9ab023fd6750f1177e65\"\n+ dependencies:\n+ pend \"~1.2.0\"\n+\nfigures@^1.3.5:\nversion \"1.7.0\"\nresolved \"https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e\"\n@@ -2147,6 +2184,13 @@ http-signature@~1.1.0:\njsprim \"^1.2.2\"\nsshpk \"^1.7.0\"\n+https-proxy-agent@^2.1.0:\n+ version \"2.2.0\"\n+ resolved \"https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.0.tgz#7fbba856be8cd677986f42ebd3664f6317257887\"\n+ dependencies:\n+ agent-base \"^4.1.0\"\n+ debug \"^3.1.0\"\n+\niconv-lite@0.4.13:\nversion \"0.4.13\"\nresolved \"https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2\"\n@@ -2974,6 +3018,10 @@ mime-types@^2.1.11, mime-types@^2.1.12, mime-types@~2.1.7:\ndependencies:\nmime-db \"~1.24.0\"\n+mime@^1.3.4:\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@@ -3011,6 +3059,12 @@ minimist@1.2.0, minimist@^1.1.0, minimist@^1.1.3, minimist@^1.2.0:\nversion \"1.2.0\"\nresolved \"https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284\"\n+mkdirp@0.5.0:\n+ version \"0.5.0\"\n+ resolved \"https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.0.tgz#1d73076a6df986cd9344e15e71fcc05a4c9abf12\"\n+ dependencies:\n+ minimist \"0.0.8\"\n+\nmkdirp@0.5.1, mkdirp@0.5.x, mkdirp@^0.5.0, mkdirp@^0.5.1:\nversion \"0.5.1\"\nresolved \"https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903\"\n@@ -3371,6 +3425,10 @@ path-type@^2.0.0:\ndependencies:\npify \"^2.0.0\"\n+pend@~1.2.0:\n+ version \"1.2.0\"\n+ resolved \"https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50\"\n+\npify@^2.0.0, pify@^2.3.0:\nversion \"2.3.0\"\nresolved \"https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c\"\n@@ -3431,6 +3489,10 @@ progress@^2.0.0:\nversion \"2.0.0\"\nresolved \"https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f\"\n+proxy-from-env@^1.0.0:\n+ version \"1.0.0\"\n+ resolved \"https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee\"\n+\npseudomap@^1.0.2:\nversion \"1.0.2\"\nresolved \"https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3\"\n@@ -3439,6 +3501,19 @@ punycode@^1.4.1:\nversion \"1.4.1\"\nresolved \"https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e\"\n+puppeteer@^1.1.1:\n+ version \"1.1.1\"\n+ resolved \"https://registry.yarnpkg.com/puppeteer/-/puppeteer-1.1.1.tgz#adbf25e49f5ef03443c10ab8e09a954ca0c7bfee\"\n+ dependencies:\n+ debug \"^2.6.8\"\n+ extract-zip \"^1.6.5\"\n+ https-proxy-agent \"^2.1.0\"\n+ mime \"^1.3.4\"\n+ progress \"^2.0.0\"\n+ proxy-from-env \"^1.0.0\"\n+ rimraf \"^2.6.1\"\n+ ws \"^3.0.0\"\n+\nq@^1.4.1:\nversion \"1.5.1\"\nresolved \"https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7\"\n@@ -4549,7 +4624,7 @@ ws@3.3.2:\nsafe-buffer \"~5.1.0\"\nultron \"~1.1.0\"\n-ws@^3.3.2:\n+ws@^3.0.0, ws@^3.3.2:\nversion \"3.3.3\"\nresolved \"https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2\"\ndependencies:\n@@ -4604,6 +4679,12 @@ yargs@~3.10.0:\ndecamelize \"^1.0.0\"\nwindow-size \"0.1.0\"\n+yauzl@2.4.1:\n+ version \"2.4.1\"\n+ resolved \"https://registry.yarnpkg.com/yauzl/-/yauzl-2.4.1.tgz#9528f442dab1b2284e58b4379bb194e22e0c4005\"\n+ dependencies:\n+ fd-slicer \"~1.0.1\"\n+\nzone.js@^0.7.3:\nversion \"0.7.3\"\nresolved \"https://registry.yarnpkg.com/zone.js/-/zone.js-0.7.3.tgz#d91432b6584f73c2c9e03ce4bb0870becc45d445\"\n",
"new_path": "yarn.lock",
"old_path": "yarn.lock"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
extension(tests): add extension pptr smoketest (#4640)
| 1
|
extension
|
tests
|
217,922
|
21.03.2018 00:34:41
| -3,600
|
4d42c48d4c39a8e888695e509ee48e0084b68506
|
chore(release): 3.4.0-beta.4
|
[
{
"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=\"3.4.0-beta.4\"></a>\n+# [3.4.0-beta.4](https://github.com/Supamiu/ffxiv-teamcraft/compare/v3.4.0-beta.3...v3.4.0-beta.4) (2018-03-20)\n+\n+\n+### Features\n+\n+* ability to search for a gathering to see its position on the map ([cd60ae1](https://github.com/Supamiu/ffxiv-teamcraft/commit/cd60ae1)), closes [#203](https://github.com/Supamiu/ffxiv-teamcraft/issues/203)\n+\n+\n+\n<a name=\"3.4.0-beta.3\"></a>\n# [3.4.0-beta.3](https://github.com/Supamiu/ffxiv-teamcraft/compare/v3.4.0-beta.2...v3.4.0-beta.3) (2018-03-20)\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"teamcraft\",\n- \"version\": \"3.4.0-beta.3\",\n+ \"version\": \"3.4.0-beta.4\",\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\": \"teamcraft\",\n- \"version\": \"3.4.0-beta.3\",\n+ \"version\": \"3.4.0-beta.4\",\n\"license\": \"MIT\",\n\"scripts\": {\n\"ng\": \"ng\",\n",
"new_path": "package.json",
"old_path": "package.json"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore(release): 3.4.0-beta.4
| 1
|
chore
|
release
|
679,913
|
21.03.2018 03:29:27
| 0
|
fbb19acd0a4a542129b358c209aef865693ce1c7
|
refactor(api): update mixins, IEnable / INotify return types
|
[
{
"change_type": "MODIFY",
"diff": "@@ -127,7 +127,7 @@ export interface IEnable {\n* @param opts optional implementation specific arg\n*/\nenable(opts?: any);\n- toggle?();\n+ toggle?(): boolean;\n}\nexport interface IEquiv {\n@@ -170,9 +170,9 @@ export type Listener = (e: Event) => void;\n* Also see `@INotify` decorator mixin\n*/\nexport interface INotify {\n- addListener(id: string, fn: Listener, scope?: any);\n- removeListener(id: string, fn: Listener, scope?: any);\n- notify(event: Event);\n+ addListener(id: string, fn: Listener, scope?: any): boolean;\n+ removeListener(id: string, fn: Listener, scope?: any): boolean;\n+ notify(event: Event): void;\n}\n/**\n@@ -293,5 +293,5 @@ export type Watch<T> = (id: string, oldState: T, newState: T) => void;\nexport interface IWatch<T> {\naddWatch(id: string, fn: Watch<T>): boolean;\nremoveWatch(id: string): boolean;\n- notifyWatches(oldState: T, newState: T);\n+ notifyWatches(oldState: T, newState: T): void;\n}\n",
"new_path": "packages/api/src/api.ts",
"old_path": "packages/api/src/api.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -2,31 +2,36 @@ import * as api from \"../api\";\nimport { mixin } from \"../mixin\";\n/**\n- * Mixin class decorator, injects IEnable default implementation,\n- * incl. a `_enabled` property. If the target also implements the\n- * `INotify` interface, `enable()` and `disable()` will automatically\n- * the respective emit events.\n+ * Mixin class decorator, injects IEnable default implementation, incl.\n+ * a `_enabled` property. If the target also implements the `INotify`\n+ * interface, `enable()` and `disable()` will automatically emit the\n+ * respective events.\n*/\n-// tslint:disable-next-line\n-export const IEnable = mixin(\n- <api.IEnable>{\n+export const IEnable = mixin(<api.IEnable>{\n+\n_enabled: true,\n+\nisEnabled() {\nreturn this._enabled;\n},\n+\nenable() {\nthis._enabled = true;\nif (this.notify) {\nthis.notify(<api.Event>{ id: api.EVENT_ENABLE, target: this });\n}\n},\n+\ndisable() {\nthis._enabled = false;\nif (this.notify) {\nthis.notify(<api.Event>{ id: api.EVENT_DISABLE, target: this });\n}\n},\n+\ntoggle() {\nthis._enabled ? this.disable() : this.enable();\n- },\n+ return this._enabled;\n+ }\n+\n});\n",
"new_path": "packages/api/src/mixins/ienable.ts",
"old_path": "packages/api/src/mixins/ienable.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -2,57 +2,57 @@ import * as api from \"../api\";\nimport { mixin } from \"../mixin\";\nexport function inotify_dispatch(listeners: any[][], e: api.Event) {\n- if (listeners) {\n+ if (!listeners) return;\nconst n = listeners.length;\n- for (let i = 0; i < n; i++) {\n- const l = listeners[i];\n+ let i = 0, l;\n+ for (i = 0; i < n; i++) {\n+ l = listeners[i];\nl[0].call(l[1], e);\nif (e.canceled) {\nreturn;\n}\n}\n}\n-}\n/**\n- * Mixin class decorator, injects INotify default implementation,\n- * incl. a lazily instantiated `_listeners` property object, storing\n- * registered listeners in ES6 sets (one set per event type).\n+ * Mixin class decorator, injects INotify default implementation, incl.\n+ * a lazily instantiated `_listeners` property object, storing\n+ * registered listeners.\n*/\n-// tslint:disable-next-line\n-export const INotify = mixin(\n- <api.INotify>{\n+export const INotify = mixin(<api.INotify>{\n+\naddListener(id: PropertyKey, fn: api.Listener, scope?: any) {\n- this._listeners = this._listeners || {};\n- let l = this._listeners[id];\n+ let l = (this._listeners = this._listeners || {})[id];\nif (!l) {\nl = this._listeners[id] = [];\n}\nif (this.__listener(l, fn, scope) === -1) {\nl.push([fn, scope]);\n+ return true;\n}\n+ return false;\n},\n+\nremoveListener(id: PropertyKey, fn: api.Listener, scope?: any) {\n- this._listeners = this._listeners || {};\n+ if (!this._listeners) return false;\nconst l: any[][] = this._listeners[id];\nif (l) {\nconst idx = this.__listener(l, fn, scope);\n- if (idx === -1) {\n- console.log(`attempt to remove unknown listener for \"${id}\": ${fn}`);\n- } else {\n+ if (idx !== -1) {\nl.splice(idx, 1);\n- console.log(`removed listener for \"${id}\": ${fn}`);\n+ return true;\n}\n}\n+ return false;\n},\n+\nnotify(e: api.Event) {\n- this._listeners = this._listeners || {};\n- if (e.target === undefined) {\n- e.target = this;\n- }\n+ if (!this._listeners) return;\n+ e.target === undefined && (e.target = this);\ninotify_dispatch(this._listeners[e.id], e);\ninotify_dispatch(this._listeners[api.EVENT_ALL], e);\n},\n+\n__listener(listeners: any[][], f: api.Listener, scope: any) {\nlet i = listeners.length;\nwhile (--i >= 0) {\n@@ -62,5 +62,6 @@ export const INotify = mixin(\n}\n}\nreturn i;\n- },\n+ }\n+\n});\n",
"new_path": "packages/api/src/mixins/inotify.ts",
"old_path": "packages/api/src/mixins/inotify.ts"
},
{
"change_type": "MODIFY",
"diff": "+import * as api from \"../api\";\nimport { mixin } from \"../mixin\";\n-// tslint:disable-next-line\n-export const IWatch = mixin({\n+export const IWatch = mixin(<api.IWatch<any>>{\n+\naddWatch(id: string, fn: (id: string, oldState: any, newState: any) => void) {\nthis._watches = this._watches || {};\nif (this._watches[id]) {\n@@ -10,20 +11,22 @@ export const IWatch = mixin({\nthis._watches[id] = fn;\nreturn true;\n},\n+\nremoveWatch(id: string) {\n- this._watches = this._watches || {};\n+ if (!this._watches) return;\nif (this._watches[id]) {\ndelete this._watches[id];\nreturn true;\n}\nreturn false;\n},\n+\nnotifyWatches(oldState: any, newState: any) {\n- const w = (this._watches = this._watches || {});\n- const keys = Object.keys(w);\n- for (let i = keys.length - 1; i >= 0; i--) {\n- const id = keys[i];\n+ if (!this._watches) return;\n+ const w = this._watches;\n+ for (let id in w) {\nw[id](id, oldState, newState);\n}\n- },\n+ }\n+\n});\n",
"new_path": "packages/api/src/mixins/iwatch.ts",
"old_path": "packages/api/src/mixins/iwatch.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(api): update mixins, IEnable / INotify return types
| 1
|
refactor
|
api
|
679,913
|
21.03.2018 03:30:32
| 0
|
b3287808a0aadc126b7ff73e359e50cbf599ba2c
|
refactor(router): update INotify dummy impl
reflecting INotify updates in
|
[
{
"change_type": "MODIFY",
"diff": "@@ -22,8 +22,8 @@ export class BasicRouter implements\n}\n// mixin\n- public addListener(_: string, __: Listener, ___?: any) { }\n- public removeListener(_: string, __: Listener, ___?: any) { }\n+ public addListener(_: string, __: Listener, ___?: any) { return false; }\n+ public removeListener(_: string, __: Listener, ___?: any) { return false; }\npublic notify(_: Event) { }\nstart() {\n",
"new_path": "packages/router/src/basic.ts",
"old_path": "packages/router/src/basic.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(router): update INotify dummy impl
- reflecting INotify updates in @thi.ng/api
| 1
|
refactor
|
router
|
679,913
|
21.03.2018 03:31:08
| 0
|
47643f96ad089905e810c3c4202f8f403d6cc965
|
test(api): add INotify tests
|
[
{
"change_type": "ADD",
"diff": "+import * as assert from \"assert\";\n+\n+import { Event, INotify, EVENT_ALL } from \"../src/api\";\n+import * as mixins from \"../src/mixins\";\n+\n+describe(\"mixins\", () => {\n+\n+ it(\"INotify\", () => {\n+\n+ @mixins.INotify\n+ class Foo implements INotify {\n+ addListener(_: string, __: (e: Event) => void, ___?: any): boolean {\n+ throw new Error();\n+ }\n+ removeListener(_: string, __: (e: Event) => void, ___?: any): boolean {\n+ throw new Error();\n+ }\n+ notify(_: Event) {\n+ throw new Error();\n+ }\n+ }\n+\n+ const res: any = {};\n+ const foo = new Foo();\n+ const l = (e) => res[e.id] = e.value;\n+ const lall = (e) => res[EVENT_ALL] = e.value;\n+ assert.doesNotThrow(() => foo.addListener(\"x\", l));\n+ assert.doesNotThrow(() => foo.addListener(EVENT_ALL, lall));\n+ foo.notify({ id: \"x\", value: 1 });\n+ assert.deepEqual(res, { x: 1, [EVENT_ALL]: 1 });\n+ assert.doesNotThrow(() => foo.removeListener(\"x\", l));\n+ foo.notify({ id: \"x\", value: 2 });\n+ assert.deepEqual(res, { x: 1, [EVENT_ALL]: 2 });\n+ assert.doesNotThrow(() => foo.removeListener(EVENT_ALL, lall));\n+ foo.notify({ id: \"x\", value: 3 });\n+ assert.deepEqual(res, { x: 1, [EVENT_ALL]: 2 });\n+ });\n+});\n\\ No newline at end of file\n",
"new_path": "packages/api/test/mixins.ts",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
test(api): add INotify tests
| 1
|
test
|
api
|
679,913
|
21.03.2018 04:27:32
| 0
|
bae1647c8521cb0deec80cb3c553c26ecef93bb0
|
feat(atom): add optional validation predicate for Atom, add tests
|
[
{
"change_type": "MODIFY",
"diff": "-import { IEquiv, Watch } from \"@thi.ng/api/api\";\n+import { IEquiv, Watch, Predicate } from \"@thi.ng/api/api\";\nimport { IWatch } from \"@thi.ng/api/mixins/iwatch\";\nimport { Path, setIn, updateIn } from \"@thi.ng/paths\";\n@@ -15,10 +15,15 @@ export class Atom<T> implements\nIEquiv {\nprotected value: T;\n+ protected valid: Predicate<T>;\nprotected _watches: any;\n- constructor(val?: T) {\n+ constructor(val?: T, valid?: Predicate<T>) {\n+ if (valid && !valid(val)) {\n+ throw new Error(\"initial state did not validate\");\n+ }\nthis.value = val;\n+ this.valid = valid;\n}\nderef() {\n@@ -31,31 +36,24 @@ export class Atom<T> implements\nreset(val: T) {\nconst old = this.value;\n+ if (this.valid && !this.valid(val)) {\n+ return old;\n+ }\nthis.value = val;\nthis.notifyWatches(old, val);\nreturn val;\n}\nresetIn<V>(path: Path, val: V) {\n- const old = this.value;\n- this.value = setIn(this.value, path, val);\n- this.notifyWatches(old, this.value);\n- return this.value;\n+ return this.reset(setIn(this.value, path, val));\n}\nswap(fn: SwapFn<T>, ...args: any[]) {\n- const old = this.value;\n- args.unshift(old);\n- this.value = fn.apply(null, args);\n- this.notifyWatches(old, this.value);\n- return this.value;\n+ return this.reset(fn.apply(null, [this.value, ...args]));\n}\nswapIn<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+ return this.reset(updateIn(this.value, path, fn, ...args));\n}\n// mixin stub\n",
"new_path": "packages/atom/src/atom.ts",
"old_path": "packages/atom/src/atom.ts"
},
{
"change_type": "MODIFY",
"diff": "import * as assert from \"assert\";\nimport { Atom } from \"../src/index\";\n+import { isNumber } from \"@thi.ng/checks/is-number\";\ndescribe(\"atom\", function () {\n@@ -44,4 +45,13 @@ describe(\"atom\", function () {\na.swap((x) => x + 1);\n});\n+ it(\"can be validated\", () => {\n+ assert.throws(() => new Atom(\"\", isNumber));\n+ a = new Atom(1, isNumber);\n+ assert.equal(a.reset(2), 2);\n+ assert.equal(a.reset(\"3\"), 2);\n+ assert.equal(a.reset(null), 2);\n+ assert.equal(a.swap((x) => \"3\"), 2);\n+ assert.equal(a.swap((x) => null), 2);\n+ });\n});\n",
"new_path": "packages/atom/test/atom.ts",
"old_path": "packages/atom/test/atom.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(atom): add optional validation predicate for Atom, add tests
| 1
|
feat
|
atom
|
217,922
|
21.03.2018 10:20:55
| -3,600
|
b0255473466d8ed8b479e93beb761bc8a838ac16
|
fix: instance returned by gathering search causing strange results
|
[
{
"change_type": "MODIFY",
"diff": "<div class=\"timed\" *ngIf=\"node.timed\">\n<mat-icon>access_alarm</mat-icon>\n<div class=\"spawns\">\n- <span *ngFor=\"let spawn of getSpawns(node)\">{{spawn}}</span>\n+ <span *ngFor=\"let spawn of getSpawns(node); let first = first\">\n+ <span *ngIf=\"!first\"> / </span>\n+ {{spawn}}\n+ </span>\n</div>\n</div>\n<div class=\"spacer\" *ngIf=\"!node.timed\"></div>\n",
"new_path": "src/app/pages/gathering-location/gathering-location/gathering-location.component.html",
"old_path": "src/app/pages/gathering-location/gathering-location/gathering-location.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -33,12 +33,10 @@ mat-card {\ndisplay: flex;\nflex-direction: row;\nalign-items: center;\n+ margin: 5px 0;\n.spawns {\nflex: 1 1 auto;\n- display: flex;\n- flex-direction: column;\n- align-items: center;\n- justify-content: center;\n+ text-align: center;\n.spawn-row {\nmargin: 2px 0;\n}\n",
"new_path": "src/app/pages/gathering-location/gathering-location/gathering-location.component.scss",
"old_path": "src/app/pages/gathering-location/gathering-location/gathering-location.component.scss"
},
{
"change_type": "MODIFY",
"diff": "@@ -34,6 +34,8 @@ export class GatheringLocationComponent implements OnInit {\n.mergeMap(name => this.dataService.searchGathering(name))\n.map(items => {\nreturn items\n+ // Only use item results\n+ .filter(item => item.type === 'item')\n// First of all, add node informations\n.map(item => {\nitem.nodes = Object.keys(nodePositions)\n",
"new_path": "src/app/pages/gathering-location/gathering-location/gathering-location.component.ts",
"old_path": "src/app/pages/gathering-location/gathering-location/gathering-location.component.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
fix: instance returned by gathering search causing strange results
| 1
|
fix
| null |
807,849
|
21.03.2018 10:56:17
| 25,200
|
ad20d8af74a8474e7ab8cb656ab36c480677a70b
|
feat(npm-conf): Add get/setCredentialsByURI() methods
|
[
{
"change_type": "MODIFY",
"diff": "\"use strict\";\n+const assert = require(\"assert\");\nconst fs = require(\"fs\");\nconst path = require(\"path\");\nconst { ConfigChain } = require(\"config-chain\");\nconst findPrefix = require(\"./find-prefix\");\nconst parseField = require(\"./parse-field\");\n+const toNerfDart = require(\"./nerf-dart\");\nclass Conf extends ConfigChain {\n// https://github.com/npm/npm/blob/latest/lib/config/core.js#L208-L222\n@@ -166,6 +168,113 @@ class Conf extends ConfigChain {\nthrow err;\n}\n}\n+\n+ // https://github.com/npm/npm/blob/24ec9f2/lib/config/get-credentials-by-uri.js\n+ getCredentialsByURI(uri) {\n+ assert(uri && typeof uri === \"string\", \"registry URL is required\");\n+\n+ const nerfed = toNerfDart(uri);\n+ const defnerf = toNerfDart(this.get(\"registry\"));\n+\n+ // hidden class micro-optimization\n+ const c = {\n+ scope: nerfed,\n+ token: undefined,\n+ password: undefined,\n+ username: undefined,\n+ email: undefined,\n+ auth: undefined,\n+ alwaysAuth: undefined,\n+ };\n+\n+ // used to override scope matching for tokens as well as legacy auth\n+ if (this.get(`${nerfed}:always-auth`) !== undefined) {\n+ const val = this.get(`${nerfed}:always-auth`);\n+\n+ c.alwaysAuth = val === \"false\" ? false : !!val;\n+ } else if (this.get(\"always-auth\") !== undefined) {\n+ c.alwaysAuth = this.get(\"always-auth\");\n+ }\n+\n+ if (this.get(`${nerfed}:_authToken`)) {\n+ c.token = this.get(`${nerfed}:_authToken`);\n+\n+ // the bearer token is enough, don't confuse things\n+ return c;\n+ }\n+\n+ // Handle the old-style _auth=<base64> style for the default registry, if set.\n+ let authDef = this.get(\"_auth\");\n+ let userDef = this.get(\"username\");\n+ let passDef = this.get(\"_password\");\n+\n+ if (authDef && !(userDef && passDef)) {\n+ authDef = Buffer.from(authDef, \"base64\").toString();\n+ authDef = authDef.split(\":\");\n+ userDef = authDef.shift();\n+ passDef = authDef.join(\":\");\n+ }\n+\n+ if (this.get(`${nerfed}:_password`)) {\n+ c.password = Buffer.from(this.get(`${nerfed}:_password`), \"base64\").toString(\"utf8\");\n+ } else if (nerfed === defnerf && passDef) {\n+ c.password = passDef;\n+ }\n+\n+ if (this.get(`${nerfed}:username`)) {\n+ c.username = this.get(`${nerfed}:username`);\n+ } else if (nerfed === defnerf && userDef) {\n+ c.username = userDef;\n+ }\n+\n+ if (this.get(`${nerfed}:email`)) {\n+ c.email = this.get(`${nerfed}:email`);\n+ } else if (this.get(\"email\")) {\n+ c.email = this.get(\"email\");\n+ }\n+\n+ if (c.username && c.password) {\n+ c.auth = Buffer.from(`${c.username}:${c.password}`).toString(\"base64\");\n+ }\n+\n+ return c;\n+ }\n+\n+ // https://github.com/npm/npm/blob/24ec9f2/lib/config/set-credentials-by-uri.js\n+ setCredentialsByURI(uri, c) {\n+ assert(uri && typeof uri === \"string\", \"registry URL is required\");\n+ assert(c && typeof c === \"object\", \"credentials are required\");\n+\n+ const nerfed = toNerfDart(uri);\n+\n+ if (c.token) {\n+ this.set(`${nerfed}:_authToken`, c.token, \"user\");\n+ this.del(`${nerfed}:_password`, \"user\");\n+ this.del(`${nerfed}:username`, \"user\");\n+ this.del(`${nerfed}:email`, \"user\");\n+ this.del(`${nerfed}:always-auth`, \"user\");\n+ } else if (c.username || c.password || c.email) {\n+ assert(c.username, \"must include username\");\n+ assert(c.password, \"must include password\");\n+ assert(c.email, \"must include email address\");\n+\n+ this.del(`${nerfed}:_authToken`, \"user\");\n+\n+ const encoded = Buffer.from(c.password, \"utf8\").toString(\"base64\");\n+\n+ this.set(`${nerfed}:_password`, encoded, \"user\");\n+ this.set(`${nerfed}:username`, c.username, \"user\");\n+ this.set(`${nerfed}:email`, c.email, \"user\");\n+\n+ if (c.alwaysAuth !== undefined) {\n+ this.set(`${nerfed}:always-auth`, c.alwaysAuth, \"user\");\n+ } else {\n+ this.del(`${nerfed}:always-auth`, \"user\");\n+ }\n+ } else {\n+ throw new Error(\"No credentials to set.\");\n+ }\n+ }\n}\nmodule.exports = Conf;\n",
"new_path": "utils/npm-conf/lib/conf.js",
"old_path": "utils/npm-conf/lib/conf.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
feat(npm-conf): Add get/setCredentialsByURI() methods
| 1
|
feat
|
npm-conf
|
821,196
|
21.03.2018 11:48:34
| 25,200
|
06e2c4615151abf37b30d4ff20b1f9b2e476ace8
|
fix: remove noUnusedLocals and noUnusedParameters as these are checked with tslint
|
[
{
"change_type": "MODIFY",
"diff": "\"forceConsistentCasingInFileNames\": true,\n\"importHelpers\": true,\n\"module\": \"commonjs\",\n- \"noUnusedLocals\": true,\n- \"noUnusedParameters\": true,\n\"outDir\": \"./lib\",\n\"pretty\": true,\n\"rootDirs\": [\n",
"new_path": "templates/tsconfig.json",
"old_path": "templates/tsconfig.json"
},
{
"change_type": "MODIFY",
"diff": "\"forceConsistentCasingInFileNames\": true,\n\"importHelpers\": true,\n\"module\": \"commonjs\",\n- \"noUnusedLocals\": true,\n- \"noUnusedParameters\": true,\n\"outDir\": \"./lib\",\n\"pretty\": true,\n\"rootDirs\": [\n",
"new_path": "tsconfig.json",
"old_path": "tsconfig.json"
}
] |
TypeScript
|
MIT License
|
oclif/oclif
|
fix: remove noUnusedLocals and noUnusedParameters as these are checked with tslint
| 1
|
fix
| null |
821,196
|
21.03.2018 11:49:23
| 25,200
|
526742b20961a3d04c8ad7f4367eb3d6213e4ba6
|
docs: add nested topic example
|
[
{
"change_type": "MODIFY",
"diff": "@@ -417,7 +417,8 @@ The help descriptions will be the description of the first command within a dire\n{\n\"oclif\": {\n\"topics\": {\n- \"config\": { \"description\": \"manage heroku config variables\" }\n+ \"apps:favorites\": { \"description\": \"manage favorite apps\" },\n+ \"config\": { \"description\": \"manage heroku config variables\" },\n}\n}\n}\n",
"new_path": "README.md",
"old_path": "README.md"
}
] |
TypeScript
|
MIT License
|
oclif/oclif
|
docs: add nested topic example
| 1
|
docs
| null |
791,690
|
21.03.2018 12:37:56
| 25,200
|
1c23205c843242775ec8105fc4722ade8c1cbf8b
|
core(network-analyzer): more distrustful of chrome connection info
|
[
{
"change_type": "MODIFY",
"diff": "@@ -185,6 +185,23 @@ class NetworkAnalyzer {\n});\n}\n+ /**\n+ * @param {LH.NetworkRequest[]} records\n+ * @return {boolean}\n+ */\n+ static canTrustConnectionInformation(records) {\n+ const connectionIdWasStarted = new Map();\n+ for (const record of records) {\n+ const started = connectionIdWasStarted.get(record.connectionId) || !record.connectionReused;\n+ connectionIdWasStarted.set(record.connectionId, started);\n+ }\n+\n+ // We probably can't trust the network information if all the connection IDs were the same\n+ if (connectionIdWasStarted.size <= 1) return false;\n+ // Or if there were connections that were always reused (a connection had to have started at some point)\n+ return Array.from(connectionIdWasStarted.values()).every(started => started);\n+ }\n+\n/**\n* Returns a map of requestId -> connectionReused, estimating the information if the information\n* available in the records themselves appears untrustworthy.\n@@ -196,9 +213,8 @@ class NetworkAnalyzer {\nstatic estimateIfConnectionWasReused(records, options) {\noptions = Object.assign({forceCoarseEstimates: false}, options);\n- const connectionIds = new Set(records.map(record => record.connectionId));\n- // If the records actually have distinct connectionIds we can reuse these.\n- if (!options.forceCoarseEstimates && connectionIds.size > 1) {\n+ // Check if we can trust the connection information coming from the protocol\n+ if (!options.forceCoarseEstimates && NetworkAnalyzer.canTrustConnectionInformation(records)) {\n// @ts-ignore\nreturn new Map(records.map(record => [record.requestId, !!record.connectionReused]));\n}\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": "@@ -67,7 +67,7 @@ describe('DependencyGraph/Simulator/NetworkAnalyzer', () => {\nassert.deepStrictEqual(result, expected);\n});\n- it('should estimate values when not trustworthy', () => {\n+ it('should estimate values when not trustworthy (duplicate IDs)', () => {\nconst records = [\ncreateRecord({requestId: 1, startTime: 0, endTime: 15}),\ncreateRecord({requestId: 2, startTime: 10, endTime: 25}),\n@@ -80,6 +80,43 @@ describe('DependencyGraph/Simulator/NetworkAnalyzer', () => {\nassert.deepStrictEqual(result, expected);\n});\n+ it('should estimate values when not trustworthy (connectionReused nonsense)', () => {\n+ const records = [\n+ createRecord({\n+ requestId: 1,\n+ connectionId: 1,\n+ connectionReused: true,\n+ startTime: 0,\n+ endTime: 15,\n+ }),\n+ createRecord({\n+ requestId: 2,\n+ connectionId: 1,\n+ connectionReused: true,\n+ startTime: 10,\n+ endTime: 25,\n+ }),\n+ createRecord({\n+ requestId: 3,\n+ connectionId: 1,\n+ connectionReused: true,\n+ startTime: 20,\n+ endTime: 40,\n+ }),\n+ createRecord({\n+ requestId: 4,\n+ connectionId: 2,\n+ connectionReused: false,\n+ startTime: 30,\n+ endTime: 40,\n+ }),\n+ ];\n+\n+ const result = NetworkAnalyzer.estimateIfConnectionWasReused(records);\n+ const expected = new Map([[1, false], [2, false], [3, true], [4, true]]);\n+ assert.deepStrictEqual(result, expected);\n+ });\n+\nit('should estimate with earliest allowed reuse', () => {\nconst records = [\ncreateRecord({requestId: 1, startTime: 0, endTime: 40}),\n@@ -134,6 +171,23 @@ describe('DependencyGraph/Simulator/NetworkAnalyzer', () => {\nassert.deepStrictEqual(result.get('https://example.com'), expected);\n});\n+ it('should handle untrustworthy connection information', () => {\n+ const timing = {sendStart: 100};\n+ const recordA = createRecord({startTime: 0, endTime: 1, timing, connectionReused: true});\n+ const recordB = createRecord({\n+ startTime: 0,\n+ endTime: 1,\n+ timing,\n+ connectionId: 2,\n+ connectionReused: true,\n+ });\n+ const result = NetworkAnalyzer.estimateRTTByOrigin([recordA, recordB], {\n+ coarseEstimateMultiplier: 1,\n+ });\n+ const expected = {min: 50, max: 50, avg: 50, median: 50};\n+ assert.deepStrictEqual(result.get('https://example.com'), expected);\n+ });\n+\nit('should work on a real devtoolsLog', () => {\nreturn computedArtifacts.requestNetworkRecords(devtoolsLog).then(records => {\nrecords.forEach(addOriginToRecord);\n",
"new_path": "lighthouse-core/test/lib/dependency-graph/simulator/network-analyzer-test.js",
"old_path": "lighthouse-core/test/lib/dependency-graph/simulator/network-analyzer-test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -148,12 +148,7 @@ describe('Lighthouse chrome extension', function() {\n}\nconst auditErrors = await extensionPage.$$eval('.lh-debug', getDebugStrings, selectors);\n- const errors = auditErrors.filter(\n- item =>\n- item.debugString.includes('Audit error:') &&\n- // FIXME(phulce): fix timing failing on travis.\n- !item.debugString.includes('No timing information available')\n- );\n+ const errors = auditErrors.filter(item => item.debugString.includes('Audit error:'));\nassert.deepStrictEqual(errors, [], 'Audit errors found within the report');\n});\n});\n",
"new_path": "lighthouse-extension/test/extension-test.js",
"old_path": "lighthouse-extension/test/extension-test.js"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
core(network-analyzer): more distrustful of chrome connection info (#4828)
| 1
|
core
|
network-analyzer
|
679,913
|
21.03.2018 13:05:32
| 0
|
3b1d563a98457734eb4a081a14e2260b00408e08
|
feat(atom): add CursorOpts and cursor validation, update ctor, add tests
|
[
{
"change_type": "MODIFY",
"diff": "import * as api from \"@thi.ng/api/api\";\n-import { IDeref, IID, IRelease } from \"@thi.ng/api/api\";\nimport { Path } from \"@thi.ng/paths\";\nexport type SwapFn<T> = (curr: T, ...args: any[]) => T;\n@@ -30,9 +29,9 @@ export interface ISwap<T> {\n}\nexport interface IView<T> extends\n- IDeref<T>,\n- IID<string>,\n- IRelease {\n+ api.IDeref<T>,\n+ api.IID<string>,\n+ api.IRelease {\nreadonly path: PropertyKey[];\n@@ -43,3 +42,10 @@ export interface IView<T> extends\nexport interface IViewable {\naddView<T>(path: Path, tx?: ViewTransform<T>, lazy?: boolean): IView<T>;\n}\n+\n+export interface CursorOpts<T> {\n+ parent: IAtom<any>;\n+ path: Path | [(s: any) => T, (s: any, v: T) => any];\n+ validate?: api.Predicate<T>;\n+ id?: string;\n+}\n\\ No newline at end of file\n",
"new_path": "packages/atom/src/api.ts",
"old_path": "packages/atom/src/api.ts"
},
{
"change_type": "MODIFY",
"diff": "import { IID, IRelease, Watch } from \"@thi.ng/api/api\";\nimport { isArray } from \"@thi.ng/checks/is-array\";\nimport { isFunction } from \"@thi.ng/checks/is-function\";\n-import { isNumber } from \"@thi.ng/checks/is-number\";\n-import { isString } from \"@thi.ng/checks/is-string\";\n-import { isSymbol } from \"@thi.ng/checks/is-symbol\";\nimport { Path, getter, setter } from \"@thi.ng/paths\";\n-import { IAtom, SwapFn, IView, ViewTransform } from \"./api\";\n+import { IAtom, SwapFn, IView, ViewTransform, CursorOpts } from \"./api\";\nimport { Atom } from \"./atom\";\nimport { View } from \"./view\";\n+/**\n+ * A cursor provides read/write access to a path location within a\n+ * nested parent state (Atom or another Cursor). Cursors behave like\n+ * Atoms for all practical purposes, i.e. support `deref()`, `reset()`,\n+ * `swap()`, `addWatch()` etc. However, when updating a cursor's value,\n+ * the parent state will be updated at the cursor's path as well (incl.\n+ * triggering any watches and/or validators) attached to the parent.\n+ * Likewise, when the parent state is modified externally, the cursor's\n+ * value will automatically update as well. The update order of cursor's\n+ * sharing a common parent is undefined, but can be overridden by\n+ * extending this class with a custom `notifyWatches()` implementation.\n+ *\n+ * If creating multiple cursors w/ a shared parent and each cursor\n+ * configured with a custom ID (provided via config object to ctor),\n+ * it's the user's responsibility to ensure the given IDs are unique.\n+ * Cursors are implemented by attaching a watch to the parent and the ID\n+ * is used to identify each watch.\n+ *\n+ * When using the optional validator predicate (also specified via\n+ * config object to ctor), the cursor's validator MUST NOT conflict with\n+ * the one assigned to the parent or else both will go out-of-sync.\n+ * Therefore, when requiring validation and updating values via cursors\n+ * it's recommended to only specify validators for leaf-level cursors in\n+ * the hierarchy.\n+ */\nexport class Cursor<T> implements\nIAtom<T>,\nIID<string>,\n@@ -24,24 +46,46 @@ export class Cursor<T> implements\nprotected lookup: (s: any) => T;\nprotected selfUpdate: boolean;\n- constructor(parent: IAtom<any>, path: PropertyKey | PropertyKey[]);\n+ constructor(opts: CursorOpts<T>);\n+ constructor(parent: IAtom<any>, path: Path);\nconstructor(parent: IAtom<any>, lookup: (s: any) => T, update: (s: any, v: T) => any);\n- constructor(parent: IAtom<any>, ...opts: any[]) {\n+ constructor(...args: any[]) {\n+ let parent, id, lookup, update, validate, opts: CursorOpts<T>;\n+ switch (args.length) {\n+ case 1:\n+ opts = args[0];\n+ id = opts.id;\n+ parent = opts.parent;\n+ validate = opts.validate;\n+ if (opts.path) {\n+ if (isArray(opts.path) && isFunction(opts.path[0])) {\n+ [lookup, update] = opts.path;\n+ } else {\n+ lookup = getter(<Path>opts.path);\n+ update = setter(<Path>opts.path);\n+ }\n+ } else {\n+ throw new Error(\"missing path config\");\n+ }\n+ break;\n+ case 2:\n+ parent = args[0];\n+ lookup = getter(args[1]);\n+ update = setter(args[1]);\n+ break;\n+ case 3:\n+ [parent, lookup, update] = args;\n+ break;\n+ default:\n+ throw new Error(`illegal arity: ${args.length}`);\n+ }\nthis.parent = parent;\n- this.id = `cursor-${Cursor.NEXT_ID++}`;\n+ this.id = id || `cursor-${Cursor.NEXT_ID++}`;\nthis.selfUpdate = false;\n- let [a, b] = opts, lookup, update;\n- if (isString(a) || isArray(a) || isNumber(a) || isSymbol(a)) {\n- lookup = getter(<any>a);\n- update = setter(<any>a);\n- } else if (isFunction(a) && isFunction(b)) {\n- lookup = a;\n- update = b;\n- } else {\n- /* istanbul ignore next */\n+ if (!lookup || !update) {\nthrow new Error(\"illegal args\");\n}\n- this.local = new Atom<T>(lookup(parent.deref()));\n+ this.local = new Atom<T>(lookup(parent.deref()), validate);\nthis.local.addWatch(this.id, (_, prev, curr) => {\nif (prev !== curr) {\nthis.selfUpdate = true;\n",
"new_path": "packages/atom/src/cursor.ts",
"old_path": "packages/atom/src/cursor.ts"
},
{
"change_type": "MODIFY",
"diff": "import * as assert from \"assert\";\n+import { getIn } from \"@thi.ng/paths\";\n+\nimport { Atom, Cursor } from \"../src/index\";\n+import { isNumber } from \"@thi.ng/checks/is-number\";\n-describe(\"cursor w/ path\", function () {\n+describe(\"cursor\", function () {\nlet a: Atom<any>;\nlet c: Cursor<any>;\n@@ -42,10 +45,39 @@ describe(\"cursor w/ path\", function () {\nassert.strictEqual(c.deref(), undefined);\n});\n- it(\"can be deref'd w/ getter\", () => {\n+ it(\"works with get/set\", () => {\nc = new Cursor(a, (s) => s.a.b, (s, x) => ({ ...s, a: { ...s.a, b: x } }));\nassert.strictEqual(c.deref(), src.a.b);\n+ c.reset(42);\n+ assert.equal(c.deref(), 42);\n+ assert.equal(c.deref(), getIn(a.deref(), \"a.b\"));\n+ });\n+\n+ it(\"works with get/set opts\", () => {\n+ c = new Cursor({\n+ parent: a,\n+ path: [\n+ (s) => s.a.b,\n+ (s, x) => ({ ...s, a: { ...s.a, b: x } })\n+ ]\n});\n+ assert.strictEqual(c.deref(), src.a.b);\n+ c.reset(42);\n+ assert.equal(c.deref(), 42);\n+ assert.equal(c.deref(), getIn(a.deref(), \"a.b\"));\n+ });\n+\n+ it(\"can be validated\", () => {\n+ c = new Cursor({\n+ parent: a,\n+ path: \"a.b.c\",\n+ validate: isNumber,\n+ });\n+ assert.equal(c.reset(42), 42);\n+ assert.equal(c.reset(\"a\"), 42);\n+ assert.equal(c.reset(null), 42);\n+ assert.throws(() => new Cursor({ parent: a, path: \"x\", validate: isNumber }));\n+ })\nit(\"can be swapped'd (a.b.c)\", () => {\nc = new Cursor(a, \"a.b.c\");\n",
"new_path": "packages/atom/test/cursor.ts",
"old_path": "packages/atom/test/cursor.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(atom): add CursorOpts and cursor validation, update ctor, add tests
| 1
|
feat
|
atom
|
679,913
|
21.03.2018 13:34:01
| 0
|
d93940a47b18a24a7094a270ce07e91c82612eea
|
feat(atom): consider parent validators in History update fns
|
[
{
"change_type": "MODIFY",
"diff": "@@ -81,14 +81,17 @@ export class History<T> implements\n/**\n* `IAtom.reset()` implementation. Delegates to wrapped atom/cursor,\n* but too applies `changed` predicate to determine if there was a\n- * change and previous value should be recorded.\n+ * change and if the previous value should be recorded.\n*\n* @param val\n*/\nreset(val: T) {\nconst prev = this.state.deref();\n- this.changed(prev, val) && this.record(prev);\nthis.state.reset(val);\n+ const changed = this.changed(prev, this.state.deref());\n+ if (changed) {\n+ this.record(prev);\n+ }\nreturn val;\n}\n@@ -96,15 +99,15 @@ export class History<T> implements\nconst prev = this.state.deref();\nconst prevV = getIn(prev, path);\nconst curr = setIn(prev, path, val);\n- this.changed(prevV, getIn(curr, path)) && this.record(prev);\nthis.state.reset(curr);\n+ this.changed(prevV, getIn(curr, path)) && this.record(prev);\nreturn curr;\n}\n/**\n* `IAtom.swap()` implementation. Delegates to wrapped atom/cursor,\n* but too applies `changed` predicate to determine if there was a\n- * change and previous value should be recorded.\n+ * change and if the previous value should be recorded.\n*\n* @param val\n*/\n@@ -113,7 +116,12 @@ export class History<T> implements\n}\nswapIn<V>(path: Path, fn: SwapFn<V>, ...args: any[]) {\n- return this.reset(updateIn(this.state.deref(), path, fn, ...args));\n+ const prev = this.state.deref();\n+ const prevV = getIn(prev, path);\n+ const curr = updateIn(this.state.deref(), path, fn, ...args);\n+ this.state.reset(curr);\n+ this.changed(prevV, getIn(curr, path)) && this.record(prev);\n+ return curr;\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): consider parent validators in History update fns
| 1
|
feat
|
atom
|
807,849
|
21.03.2018 13:45:06
| 25,200
|
ce72828416d86789b87633ad0db3d091fa8c4f89
|
feat(utils): Add
|
[
{
"change_type": "ADD",
"diff": "+# `@lerna/map-to-registry`\n+\n+> Produce registry uri and auth of package name from npm config\n+\n+## Usage\n+\n+This is an extraction of an internal npm [utility](https://github.com/npm/npm/blob/f644018/lib/utils/map-to-registry.js). Caveat emptor.\n+\n+```js\n+'use strict';\n+\n+const mapToRegistry = require('@lerna/map-to-registry');\n+const npmConf = require('@lerna/npm-conf');\n+\n+const config = npmConf();\n+const { uri, auth } = mapToRegistry(\"my-package\", config);\n+```\n+\n+`uri` and `auth` are suitable for arguments to [npm-registry-client](https://www.npmjs.com/package/npm-registry-client) instance method parameters.\n",
"new_path": "utils/map-to-registry/README.md",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+const npmConf = require(\"@lerna/npm-conf\");\n+const mapToRegistry = require(\"..\");\n+\n+describe(\"@lerna/map-to-registry\", () => {\n+ describe(\"uri\", () => {\n+ test(\"package name\", () => {\n+ const config = npmConf();\n+ const result = mapToRegistry(\"foo\", config);\n+\n+ expect(result).toMatchObject({\n+ uri: \"https://registry.npmjs.org/foo\",\n+ auth: {\n+ scope: \"//registry.npmjs.org/\",\n+ alwaysAuth: false,\n+ },\n+ });\n+ });\n+\n+ test(\"scoped package name\", () => {\n+ const config = npmConf();\n+ const result = mapToRegistry(\"@scope/bar\", config);\n+\n+ expect(result).toMatchObject({\n+ uri: \"https://registry.npmjs.org/@scope%2fbar\",\n+ });\n+ });\n+\n+ test(\"scoped package name with scoped registry\", () => {\n+ const config = npmConf({\n+ \"@scope:registry\": \"https://private.npm-enterprise.com:1234/\",\n+ });\n+ const result = mapToRegistry(\"@scope/bar\", config);\n+\n+ expect(result).toMatchObject({\n+ uri: \"https://private.npm-enterprise.com:1234/@scope%2fbar\",\n+ auth: {\n+ scope: \"//private.npm-enterprise.com:1234/\",\n+ },\n+ });\n+ });\n+\n+ test(\"scoped config\", () => {\n+ const config = npmConf({\n+ scope: \"@scope\",\n+ \"@scope:registry\": \"https://private.npm-enterprise.com:1234/\",\n+ });\n+ const result = mapToRegistry(\"foo\", config);\n+\n+ expect(result).toMatchObject({\n+ uri: \"https://private.npm-enterprise.com:1234/foo\",\n+ });\n+ });\n+\n+ test(\"remote package\", () => {\n+ const config = npmConf();\n+ const result = mapToRegistry(\"http://foo.com/bar.tgz\", config);\n+\n+ expect(result).toMatchObject({\n+ uri: \"http://foo.com/bar.tgz\",\n+ auth: {\n+ scope: \"//registry.npmjs.org/\",\n+ },\n+ });\n+ });\n+ });\n+\n+ describe(\"auth\", () => {\n+ test(\"always-auth = true\", () => {\n+ const config = npmConf({\n+ \"always-auth\": \"true\",\n+ });\n+ const result = mapToRegistry(\"foo\", config);\n+ const nerfed = mapToRegistry(\"foo\", config.set(\"//registry.npmjs.org/:always-auth\", true));\n+\n+ expect(result.auth).toMatchObject({\n+ alwaysAuth: true,\n+ });\n+ expect(nerfed.auth).toEqual(result.auth);\n+ });\n+\n+ test(\"bearer token\", () => {\n+ const config = npmConf({\n+ \"//registry.npmjs.org/:_authToken\": \"deadbeef\",\n+ });\n+ const result = mapToRegistry(\"foo\", config);\n+\n+ expect(result.auth).toMatchObject({\n+ token: \"deadbeef\",\n+ });\n+ });\n+\n+ test(\"otp\", () => {\n+ const config = npmConf({\n+ \"//registry.npmjs.org/:_authToken\": \"deadbeef\",\n+ otp: \"123456\",\n+ });\n+ const result = mapToRegistry(\"foo\", config);\n+\n+ expect(result.auth).toMatchObject({\n+ otp: \"123456\",\n+ });\n+ });\n+\n+ test(\"username + password\", () => {\n+ const config = npmConf({\n+ username: \"dead\",\n+ _password: \"beef\",\n+ });\n+ const result = mapToRegistry(\"foo\", config);\n+ const nerfed = mapToRegistry(\n+ \"foo\",\n+ config\n+ .set(\"//registry.npmjs.org/:username\", \"dead\")\n+ .set(\"//registry.npmjs.org/:_password\", \"YmVlZg==\")\n+ );\n+\n+ expect(result.auth).toMatchObject({\n+ auth: \"ZGVhZDpiZWVm\",\n+ username: \"dead\",\n+ password: \"beef\",\n+ });\n+ expect(nerfed.auth).toEqual(result.auth);\n+ });\n+\n+ test(\"email\", () => {\n+ const config = npmConf({\n+ email: \"beef@cow.org\",\n+ });\n+ const result = mapToRegistry(\"foo\", config);\n+ const nerfed = mapToRegistry(\"foo\", config.set(\"//registry.npmjs.org/:email\", \"beef@cow.org\"));\n+\n+ expect(result.auth).toMatchObject({\n+ email: \"beef@cow.org\",\n+ });\n+ expect(nerfed.auth).toEqual(result.auth);\n+ });\n+\n+ test(\"legacy _auth=<base64>\", () => {\n+ const config = npmConf({\n+ _auth: \"ZGVhZDpiZWVm\",\n+ });\n+ const result = mapToRegistry(\"foo\", config);\n+ const ignore = mapToRegistry(\"foo\", config.set(\"username\", \"cafe\"));\n+\n+ expect(result.auth).toMatchObject({\n+ auth: \"ZGVhZDpiZWVm\",\n+ username: \"dead\",\n+ password: \"beef\",\n+ });\n+ expect(ignore.auth).toEqual(result.auth);\n+ });\n+\n+ test(\"differing request and registry host\", () => {\n+ const config = npmConf({\n+ \"//registry.npmjs.org/:_authToken\": \"deadbeef\",\n+ });\n+ const result = mapToRegistry(\"http://foo.com/bar.tgz\", config);\n+ const always = mapToRegistry(\"http://foo.com/bar.tgz\", config.set(\"always-auth\", true));\n+\n+ expect(result.auth).toMatchObject({\n+ scope: \"//registry.npmjs.org/\",\n+ token: undefined,\n+ });\n+ expect(always.auth).toMatchObject({\n+ token: \"deadbeef\",\n+ });\n+ });\n+\n+ test(\"username _without_ password\", () => {\n+ const config = npmConf({\n+ username: \"no-auth-for-you\",\n+ });\n+ const result = mapToRegistry(\"foo\", config);\n+\n+ expect(result.auth).toEqual({\n+ scope: \"//registry.npmjs.org/\",\n+ email: undefined,\n+ alwaysAuth: false,\n+ token: undefined,\n+ username: undefined,\n+ password: undefined,\n+ auth: undefined,\n+ });\n+ });\n+ });\n+\n+ describe(\"normalizes\", () => {\n+ test(\"registry trailing slash\", () => {\n+ const config = npmConf({\n+ registry: \"http://no-trailing-slash.com\",\n+ });\n+ const result = mapToRegistry(\"foo\", config);\n+\n+ expect(result).toMatchObject({\n+ uri: \"http://no-trailing-slash.com/foo\",\n+ });\n+ });\n+\n+ test(\"--scope argument\", () => {\n+ const config = npmConf({\n+ scope: \"scope\",\n+ // scoped registry is missing, however\n+ });\n+ const result = mapToRegistry(\"foo\", config);\n+\n+ expect(result).toMatchObject({\n+ uri: \"https://registry.npmjs.org/foo\",\n+ });\n+ });\n+ });\n+});\n",
"new_path": "utils/map-to-registry/__tests__/map-to-registry.test.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+const log = require(\"npmlog\");\n+const npa = require(\"npm-package-arg\");\n+const url = require(\"url\");\n+\n+module.exports = mapToRegistry;\n+\n+// https://github.com/npm/npm/blob/f644018/lib/utils/map-to-registry.js\n+function mapToRegistry(name, config) {\n+ log.silly(\"mapToRegistry\", \"name\", name);\n+ let registry;\n+\n+ // the name itself takes precedence\n+ const data = npa(name);\n+\n+ if (data.scope) {\n+ // the name is definitely scoped, so escape now\n+ name = name.replace(\"/\", \"%2f\"); // eslint-disable-line no-param-reassign\n+\n+ log.silly(\"mapToRegistry\", \"scope (from package name)\", data.scope);\n+\n+ registry = config.get(`${data.scope}:registry`);\n+\n+ if (!registry) {\n+ log.verbose(\"mapToRegistry\", \"no registry URL found in name for scope\", data.scope);\n+ }\n+ }\n+\n+ // ...then --scope=@scope or --scope=scope\n+ let scope = config.get(\"scope\");\n+\n+ if (!registry && scope) {\n+ // I'm an enabler, sorry\n+ if (scope.charAt(0) !== \"@\") {\n+ scope = `@${scope}`;\n+ }\n+\n+ log.silly(\"mapToRegistry\", \"scope (from config)\", scope);\n+\n+ registry = config.get(`${scope}:registry`);\n+\n+ if (!registry) {\n+ log.verbose(\"mapToRegistry\", \"no registry URL found in config for scope\", scope);\n+ }\n+ }\n+\n+ // ...and finally use the default registry\n+ if (!registry) {\n+ log.silly(\"mapToRegistry\", \"using default registry\");\n+ registry = config.get(\"registry\");\n+ }\n+\n+ log.silly(\"mapToRegistry\", \"registry\", registry);\n+\n+ const credentials = config.getCredentialsByURI(registry);\n+\n+ // normalize registry URL so resolution doesn't drop a piece of registry URL\n+ const normalized = registry.slice(-1) !== \"/\" ? `${registry}/` : registry;\n+ let uri;\n+\n+ log.silly(\"mapToRegistry\", \"data\", data);\n+\n+ if (data.type === \"remote\") {\n+ uri = data.fetchSpec;\n+ } else {\n+ uri = url.resolve(normalized, name);\n+ }\n+\n+ log.silly(\"mapToRegistry\", \"uri\", uri);\n+\n+ const auth = scopeAuth(uri, registry, credentials, config);\n+\n+ return { uri, auth };\n+}\n+\n+function scopeAuth(uri, registry, auth, config) {\n+ const cleaned = {\n+ scope: auth.scope,\n+ email: auth.email,\n+ alwaysAuth: auth.alwaysAuth,\n+ token: undefined,\n+ username: undefined,\n+ password: undefined,\n+ auth: undefined,\n+ };\n+\n+ if (auth.token || auth.auth || (auth.username && auth.password)) {\n+ const requestHost = url.parse(uri).hostname;\n+ const registryHost = url.parse(registry).hostname;\n+\n+ if (requestHost === registryHost) {\n+ cleaned.token = auth.token;\n+ cleaned.auth = auth.auth;\n+ cleaned.username = auth.username;\n+ cleaned.password = auth.password;\n+ } else if (auth.alwaysAuth) {\n+ log.verbose(\"scopeAuth\", \"alwaysAuth set for\", registry);\n+ cleaned.token = auth.token;\n+ cleaned.auth = auth.auth;\n+ cleaned.username = auth.username;\n+ cleaned.password = auth.password;\n+ } else {\n+ log.silly(\"scopeAuth\", uri, \"doesn't share host with registry\", registry);\n+ }\n+\n+ if (config.get(\"otp\")) {\n+ cleaned.otp = config.get(\"otp\");\n+ }\n+ }\n+\n+ return cleaned;\n+}\n",
"new_path": "utils/map-to-registry/lib/map-to-registry.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"@lerna/map-to-registry\",\n+ \"version\": \"3.0.0-beta.7\",\n+ \"description\": \"Produce registry uri and auth of package name from npm config\",\n+ \"keywords\": [\n+ \"lerna\",\n+ \"npm\",\n+ \"config\",\n+ \"registry\"\n+ ],\n+ \"homepage\": \"https://github.com/lerna/lerna\",\n+ \"license\": \"MIT\",\n+ \"author\": {\n+ \"name\": \"Daniel Stockman\",\n+ \"url\": \"https://github.com/evocateur\"\n+ },\n+ \"main\": \"lib/map-to-registry.js\",\n+ \"directories\": {\n+ \"lib\": \"lib\",\n+ \"test\": \"__tests__\"\n+ },\n+ \"files\": [\n+ \"lib\"\n+ ],\n+ \"engines\": {\n+ \"node\": \">= 6.9.0\"\n+ },\n+ \"publishConfig\": {\n+ \"access\": \"public\"\n+ },\n+ \"repository\": {\n+ \"type\": \"git\",\n+ \"url\": \"git+https://github.com/lerna/lerna.git\"\n+ },\n+ \"scripts\": {\n+ \"test\": \"echo \\\"Error: run tests from root\\\" && exit 1\"\n+ },\n+ \"dependencies\": {\n+ \"npm-package-arg\": \"^6.0.0\",\n+ \"npmlog\": \"^4.1.2\"\n+ }\n+}\n",
"new_path": "utils/map-to-registry/package.json",
"old_path": null
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
feat(utils): Add @lerna/map-to-registry
| 1
|
feat
|
utils
|
807,849
|
21.03.2018 13:45:55
| 25,200
|
a391cc590b012dcd026713fded1a1e3c7251782b
|
chore(config): add durable options for lerna create
|
[
{
"change_type": "MODIFY",
"diff": "\"cacheDir\": \".changelog\"\n},\n\"command\": {\n+ \"create\": {\n+ \"homepage\": \"https://github.com/lerna/lerna\",\n+ \"license\": \"MIT\"\n+ },\n\"publish\": {\n\"allowBranch\": \"master\",\n\"cdVersion\": \"prerelease\",\n",
"new_path": "lerna.json",
"old_path": "lerna.json"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
chore(config): add durable options for lerna create
| 1
|
chore
|
config
|
217,922
|
21.03.2018 14:03:27
| -3,600
|
f05dfe38f1abd32bcaa46704c6a8169efa4ab4fe
|
style: no more <br> in about copyright notice
|
[
{
"change_type": "MODIFY",
"diff": "<br>\n<br>\n<h2>{{'ABOUT.Copyright_notice_title' | translate}}</h2>\n-<p>{{'ABOUT.Copyright_notice_content' | translate}}</p>\n+<p [innerHtml]=\"'ABOUT.Copyright_notice_content' | translate\"></p>\n<h2>{{'ABOUT.Thanks_title' | translate}}</h2>\n<div>\n",
"new_path": "src/app/pages/about/about/about.component.html",
"old_path": "src/app/pages/about/about/about.component.html"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
style: no more <br> in about copyright notice
| 1
|
style
| null |
821,205
|
21.03.2018 14:10:36
| 10,800
|
e3a7943855ffbe96de697541025a90cf59194076
|
feat: add tslint component option
|
[
{
"change_type": "MODIFY",
"diff": "@@ -491,7 +491,7 @@ USAGE\nOPTIONS\n--defaults use defaults for every setting\n--force overwrite existing files\n- --options=options (typescript|semantic-release|mocha)\n+ --options=options (typescript|tslint|semantic-release|mocha)\n```\n_See code: [src/commands/multi.ts](https://github.com/oclif/oclif/blob/v1.3.13/src/commands/multi.ts)_\n@@ -507,7 +507,7 @@ USAGE\nOPTIONS\n--defaults use defaults for every setting\n--force overwrite existing files\n- --options=options (typescript|semantic-release|mocha)\n+ --options=options (typescript|tslint|semantic-release|mocha)\n```\n_See code: [src/commands/plugin.ts](https://github.com/oclif/oclif/blob/v1.3.13/src/commands/plugin.ts)_\n@@ -523,7 +523,7 @@ USAGE\nOPTIONS\n--defaults use defaults for every setting\n--force overwrite existing files\n- --options=options (typescript|semantic-release|mocha)\n+ --options=options (typescript|tslint|semantic-release|mocha)\n```\n_See code: [src/commands/single.ts](https://github.com/oclif/oclif/blob/v1.3.13/src/commands/single.ts)_\n",
"new_path": "README.md",
"old_path": "README.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,7 +5,7 @@ import Base from './command_base'\nexport default abstract class AppCommand extends Base {\nstatic flags = {\ndefaults: flags.boolean({description: 'use defaults for every setting'}),\n- options: flags.string({description: '(typescript|semantic-release|mocha)'}),\n+ options: flags.string({description: '(typescript|tslint|semantic-release|mocha)'}),\nforce: flags.boolean({description: 'overwrite existing files'}),\n}\nstatic args = [\n",
"new_path": "src/app_command.ts",
"old_path": "src/app_command.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -33,6 +33,7 @@ class App extends Generator {\nmocha: boolean\n'semantic-release': boolean\ntypescript: boolean\n+ tslint: boolean\n}\nargs!: {[k: string]: string}\ntype: 'single' | 'multi' | 'plugin' | 'base'\n@@ -52,12 +53,14 @@ class App extends Generator {\noptions: {\nmocha: boolean\ntypescript: boolean\n+ tslint: boolean\n'semantic-release': boolean\n}\n}\nmocha!: boolean\nsemantic_release!: boolean\nts!: boolean\n+ tslint!: boolean\nget _ext() { return this.ts ? 'ts' : 'js' }\nget _bin() {\nlet bin = this.pjson.oclif && (this.pjson.oclif.bin || this.pjson.oclif.dirname) || this.pjson.name\n@@ -76,6 +79,7 @@ class App extends Generator {\nmocha: opts.options.includes('mocha'),\n'semantic-release': opts.options.includes('semantic-release'),\ntypescript: opts.options.includes('typescript'),\n+ tslint: opts.options.includes('tslint'),\n}\n}\n@@ -204,6 +208,7 @@ class App extends Generator {\nchoices: [\n{name: 'mocha (testing framework)', value: 'mocha', checked: true},\n{name: 'typescript (static typing for javascript)', value: 'typescript', checked: true},\n+ {name: 'tslint (static analysis tool for typescript)', value: 'tslint', checked: true},\n{name: 'semantic-release (automated version management)', value: 'semantic-release', checked: this.options['semantic-release']}\n],\nfilter: ((arr: string[]) => _.keyBy(arr)) as any,\n@@ -220,6 +225,7 @@ class App extends Generator {\ndebug(this.answers)\nthis.options = this.answers.options\nthis.ts = this.options.typescript\n+ this.tslint = this.options.tslint\nthis.mocha = this.options.mocha\nthis.semantic_release = this.options['semantic-release']\n@@ -233,10 +239,10 @@ class App extends Generator {\nthis.pjson.repository = this.answers.github ? `${this.answers.github.user}/${this.answers.github.repo}` : defaults.repository\nthis.pjson.scripts.posttest = 'yarn run lint'\n// this.pjson.scripts.precommit = 'yarn run lint'\n- if (this.ts && this.mocha) {\n- this.pjson.scripts.lint = 'tsc -p test --noEmit && tslint -p test -t stylish'\n- } else if (this.ts) {\n- this.pjson.scripts.lint = 'tsc -p . --noEmit && tslint -p . -t stylish'\n+ if (this.ts) {\n+ const tsProject = this.mocha ? 'test' : '.'\n+ this.pjson.scripts.lint = `tsc -p ${tsProject} --noEmit`\n+ if (this.tslint) this.pjson.scripts.lint += ` && tslint -p ${tsProject} -t stylish`\n} else {\nthis.pjson.scripts.lint = 'eslint .'\n}\n@@ -307,7 +313,9 @@ class App extends Generator {\n}\nif (this.ts) {\n+ if (this.tslint) {\nthis.fs.copyTpl(this.templatePath('tslint.json'), this.destinationPath('tslint.json'), this)\n+ }\nthis.fs.copyTpl(this.templatePath('tsconfig.json'), this.destinationPath('tsconfig.json'), this)\nif (this.mocha) {\nthis.fs.copyTpl(this.templatePath('test/tsconfig.json'), this.destinationPath('test/tsconfig.json'), this)\n@@ -420,9 +428,14 @@ class App extends Generator {\n// '@types/supports-color',\n'typescript',\n'ts-node@5',\n+ 'tslib',\n+ )\n+ if (this.tslint) {\n+ devDependencies.push(\n'@oclif/tslint',\n'tslint',\n)\n+ }\n} else {\ndevDependencies.push(\n'eslint',\n",
"new_path": "src/generators/app.ts",
"old_path": "src/generators/app.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -21,7 +21,7 @@ function generate(args) {\nfunction build(type, features) {\nlet options = ''\n- if (features === 'everything') options = '--options=typescript,mocha,semantic-release'\n+ if (features === 'everything') options = '--options=typescript,tslint,mocha,semantic-release'\nif (features === 'typescript') options = '--options=typescript'\nif (features === 'mocha') options = '--options=mocha'\nlet dir = CI ? tmp.tmpNameSync() : path.join(__dirname, '../tmp')\n",
"new_path": "test/run.js",
"old_path": "test/run.js"
}
] |
TypeScript
|
MIT License
|
oclif/oclif
|
feat: add tslint component option (#63)
| 1
|
feat
| null |
679,913
|
21.03.2018 14:24:18
| 0
|
4d3785f98f597101b529995ea8013d9df4f2c40e
|
feat(api): add error types & ctor fns
|
[
{
"change_type": "MODIFY",
"diff": "+import { illegalArgs } from \"../error\";\n+\n/**\n* Method property decorator factory. Augments original method with\n* deprecation message (via console), shown when method is invoked.\n@@ -11,7 +13,7 @@ export function deprecated(msg?: string, log = console.log): MethodDecorator {\nconst signature = `${target.constructor.name}#${prop}`;\nconst fn = descriptor.value;\nif (typeof fn !== \"function\") {\n- throw new Error(`${signature} is not a function`);\n+ illegalArgs(`${signature} is not a function`);\n}\ndescriptor.value = function () {\nlog(`DEPRECATED ${signature}: ${msg || \"will be removed soon\"}`);\n",
"new_path": "packages/api/src/decorators/deprecated.ts",
"old_path": "packages/api/src/decorators/deprecated.ts"
},
{
"change_type": "ADD",
"diff": "+export class IllegalArityError extends Error {\n+ constructor(n: number) {\n+ super(`illegal arity: ${n}`);\n+ }\n+}\n+\n+export class IllegalArgumentError extends Error {\n+ constructor(msg?: any) {\n+ super(\"illegal argument(s)\" + (msg !== undefined ? \": \" + msg : \"\"));\n+ }\n+}\n+\n+export class IllegalStateError extends Error {\n+ constructor(msg?: any) {\n+ super(\"illegal state\" + (msg !== undefined ? \": \" + msg : \"\"));\n+ }\n+}\n+\n+export class UnsupportedOperationError extends Error {\n+ constructor(msg?: any) {\n+ super(\"unsupported operation\" + (msg !== undefined ? \": \" + msg : \"\"));\n+ }\n+}\n+\n+export function illegalArity(n) {\n+ throw new IllegalArityError(n);\n+}\n+\n+export function illegalArgs(msg?: any) {\n+ throw new IllegalArgumentError(msg);\n+}\n+\n+export function illegalState(msg?: any) {\n+ throw new IllegalArgumentError(msg);\n+}\n+\n+export function unsupported(msg?: any) {\n+ throw new UnsupportedOperationError(msg);\n+}\n",
"new_path": "packages/api/src/error.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -3,6 +3,7 @@ import * as mixins from \"./mixins\";\nexport * from \"./api\";\nexport * from \"./compare\";\n+export * from \"./error\";\nexport * from \"./equiv\";\nexport {\n",
"new_path": "packages/api/src/index.ts",
"old_path": "packages/api/src/index.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(api): add error types & ctor fns
| 1
|
feat
|
api
|
679,913
|
21.03.2018 14:24:48
| 0
|
ea7b17520ac2521ffc696e00ee9d9e11b671a359
|
refactor(atom): update error handling
|
[
{
"change_type": "MODIFY",
"diff": "import { IEquiv, Watch, Predicate } from \"@thi.ng/api/api\";\n+import { illegalState } from \"@thi.ng/api/error\";\nimport { IWatch } from \"@thi.ng/api/mixins/iwatch\";\nimport { Path, setIn, updateIn } from \"@thi.ng/paths\";\n@@ -20,7 +21,7 @@ export class Atom<T> implements\nconstructor(val?: T, valid?: Predicate<T>) {\nif (valid && !valid(val)) {\n- throw new Error(\"initial state did not validate\");\n+ illegalState(\"initial state value did not validate\");\n}\nthis.value = val;\nthis.valid = valid;\n",
"new_path": "packages/atom/src/atom.ts",
"old_path": "packages/atom/src/atom.ts"
},
{
"change_type": "MODIFY",
"diff": "import { IID, IRelease, Watch } from \"@thi.ng/api/api\";\n+import { illegalArity, illegalArgs } from \"@thi.ng/api/error\";\nimport { isArray } from \"@thi.ng/checks/is-array\";\nimport { isFunction } from \"@thi.ng/checks/is-function\";\nimport { Path, getter, setter } from \"@thi.ng/paths\";\n@@ -65,7 +66,7 @@ export class Cursor<T> implements\nupdate = setter(<Path>opts.path);\n}\n} else {\n- throw new Error(\"missing path config\");\n+ illegalArgs(\"missing path config\");\n}\nbreak;\ncase 2:\n@@ -77,13 +78,13 @@ export class Cursor<T> implements\n[parent, lookup, update] = args;\nbreak;\ndefault:\n- throw new Error(`illegal arity: ${args.length}`);\n+ illegalArity(args.length);\n}\nthis.parent = parent;\nthis.id = id || `cursor-${Cursor.NEXT_ID++}`;\nthis.selfUpdate = false;\nif (!lookup || !update) {\n- throw new Error(\"illegal args\");\n+ illegalArgs();\n}\nthis.local = new Atom<T>(lookup(parent.deref()), validate);\nthis.local.addWatch(this.id, (_, prev, curr) => {\n",
"new_path": "packages/atom/src/cursor.ts",
"old_path": "packages/atom/src/cursor.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(atom): update error handling
| 1
|
refactor
|
atom
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.