author
int64
4.98k
943k
date
stringdate
2017-04-15 16:45:02
2022-02-25 15:32:15
timezone
int64
-46,800
39.6k
hash
stringlengths
40
40
message
stringlengths
8
468
mods
listlengths
1
16
language
stringclasses
9 values
license
stringclasses
2 values
repo
stringclasses
119 values
original_message
stringlengths
12
491
is_CCS
int64
1
1
commit_type
stringclasses
129 values
commit_scope
stringlengths
1
44
679,913
13.07.2018 02:21:33
-3,600
81223dcabc532d41dfe97bb3f9f10b7c50807e23
feat(transducers): add wordWrap() xform
[ { "change_type": "MODIFY", "diff": "@@ -90,6 +90,7 @@ export * from \"./xform/take\";\nexport * from \"./xform/throttle\";\nexport * from \"./xform/throttle-time\";\nexport * from \"./xform/utf8\";\n+export * from \"./xform/word-wrap\";\nexport * from \"./func/binary-search\";\nexport * from \"./func/comp\";\n", "new_path": "packages/transducers/src/index.ts", "old_path": "packages/transducers/src/index.ts" }, { "change_type": "ADD", "diff": "+import { Transducer } from \"../api\";\n+import { partitionBy } from \"./partition-by\";\n+\n+/**\n+ * Returns transducer partitioning words into variable sized arrays\n+ * based on given `lineLength` (default 80). The optional `delim` and\n+ * `alwaysDelim` args can be used to adjust the length and usage of\n+ * delimiters between each word. If `alwaysDelim` is true, the delimiter\n+ * length is added to each word, even near line endings. If false\n+ * (default), the last word on each line can still fit even if there's\n+ * no space for the delimiter.\n+ *\n+ * @param lineLength\n+ * @param delim\n+ * @param alwaysDelim\n+ */\n+export function wordWrap(lineLength = 80, delim = 1, alwaysDelim = false): Transducer<string, string[]> {\n+ return partitionBy(\n+ () => {\n+ let n = 0;\n+ let flag = false;\n+ return (w: string) => {\n+ n += w.length + delim;\n+ if (n > lineLength + (alwaysDelim ? 0 : delim)) {\n+ flag = !flag;\n+ n = w.length + delim;\n+ }\n+ return flag;\n+ };\n+ }, true);\n+}\n", "new_path": "packages/transducers/src/xform/word-wrap.ts", "old_path": null } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(transducers): add wordWrap() xform
1
feat
transducers
679,913
13.07.2018 02:24:10
-3,600
976a6d85117848b3bb7c1aa49218d7f4d1edc708
refactor(iges): update formatParams(), optimize iges file size
[ { "change_type": "MODIFY", "diff": "@@ -60,8 +60,8 @@ Defines single open 2D polyline (type 106) S 2\n106 1 0 0 0 0 0 000000000D 1\n106 0 0 3 11 0 0 0D 2\n106,1,9,0.000,0.000,0.000,0.000,100.000,50.000,150.000,100.000, 0000001P 1\n-100.000,0.000,100.000,100.000,0.000,0.000,0.000,100.000, 0000001P 2\n-100.000,100.000,0.000; 0000001P 3\n+100.000,0.000,100.000,100.000,0.000,0.000,0.000,100.000,100.000, 0000001P 2\n+100.000,0.000; 0000001P 3\nS0000002G0000003D0000002P0000003 T 1\n```\n", "new_path": "packages/iges/README.md", "old_path": "packages/iges/README.md" }, { "change_type": "MODIFY", "diff": "@@ -6,11 +6,11 @@ import {\nmapcat,\nmapIndexed,\npartition,\n+ push,\nstr,\ntransduce,\n- wrap,\n- partitionBy,\n- push\n+ wordWrap,\n+ wrap\n} from \"@thi.ng/transducers\";\nimport {\n@@ -19,9 +19,9 @@ import {\nEntityStatus,\nGlobalParams,\nIGESDocument,\n+ Param,\nType,\n- Unit,\n- Param\n+ Unit\n} from \"./api\";\nconst padl = (n: number, ch: string) => {\n@@ -195,18 +195,7 @@ const formatParams = (doc: IGESDocument, params: Param[], fmtBody: (body: string\nconst lines = transduce(\ncomp(\nmap(doc.$PARAM),\n- partitionBy(() => {\n- let w = 0;\n- let flag = false;\n- return (p) => {\n- w += p.length + 1;\n- if (w >= bodyWidth) {\n- flag = !flag;\n- w = p.length + 1;\n- }\n- return flag;\n- };\n- }, true),\n+ wordWrap(bodyWidth, 1, true),\nmap((p) => p.join(doc.globals.delimParam)),\n),\npush(),\n", "new_path": "packages/iges/src/index.ts", "old_path": "packages/iges/src/index.ts" }, { "change_type": "MODIFY", "diff": "@@ -37,8 +37,8 @@ describe(\"iges\", () => {\n106 1 0 0 0 0 0 000000000D 1\n106 0 0 3 11 0 0 0D 2\n106,1,9,0.000,0.000,0.000,0.000,100.000,50.000,150.000,100.000, 0000001P 1\n-100.000,0.000,100.000,100.000,0.000,0.000,0.000,100.000, 0000001P 2\n-100.000,100.000,0.000; 0000001P 3\n+100.000,0.000,100.000,100.000,0.000,0.000,0.000,100.000,100.000, 0000001P 2\n+100.000,0.000; 0000001P 3\nS0000001G0000003D0000002P0000003 T 1`\n);\n});\n", "new_path": "packages/iges/test/index.ts", "old_path": "packages/iges/test/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(iges): update formatParams(), optimize iges file size
1
refactor
iges
217,927
13.07.2018 06:59:20
0
9349580d0b1985e529bb9e3e5e4a3e03bd2d7bb9
chore: add change detection strategy for rating
[ { "change_type": "MODIFY", "diff": "-import {Component, Input} from '@angular/core';\n+import {ChangeDetectionStrategy, Component, Input} from '@angular/core';\nimport {AppUser} from '../../../model/list/app-user';\n@Component({\nselector: 'app-rating',\ntemplateUrl: './rating.component.html',\n- styleUrls: ['./rating.component.scss']\n+ styleUrls: ['./rating.component.scss'],\n+ changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class RatingComponent {\n", "new_path": "src/app/pages/commission-board/rating/rating.component.ts", "old_path": "src/app/pages/commission-board/rating/rating.component.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: add change detection strategy for rating
1
chore
null
217,922
13.07.2018 08:59:13
-7,200
3ef743565d5b603615a6684692af4f6d2fdc7f4f
fix: fixed public profile page rendering
[ { "change_type": "MODIFY", "diff": "@@ -25,8 +25,7 @@ export class PublicProfileComponent {\nprivate media: ObservableMedia) {\nthis.ingameCharacter = route.params\n.pipe(\n- mergeMap(params => userService.get(params.id)),\n- mergeMap(user => dataService.getCharacter(user.lodestoneId)),\n+ mergeMap(params => userService.getCharacter(params.id)),\ncatchError(() => of(1))\n);\nthis.freeCompany = this.ingameCharacter\n", "new_path": "src/app/pages/profile/public-profile/public-profile.component.ts", "old_path": "src/app/pages/profile/public-profile/public-profile.component.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix: fixed public profile page rendering
1
fix
null
679,913
13.07.2018 11:42:05
-3,600
ee48a94c17d9cd3a6fe7de25271d9d22fdb30728
fix(rstream-gestures): touchevent check in safari
[ { "change_type": "MODIFY", "diff": "@@ -103,14 +103,14 @@ export function gestureStream(el: Element, opts?: Partial<GestureStreamOpts>): S\nxform: map((e: MouseEvent | TouchEvent | WheelEvent) => {\nlet evt, type;\nopts.preventDefault && e.preventDefault();\n- if (e instanceof TouchEvent) {\n+ if ((<TouchEvent>e).touches) {\ntype = {\n\"touchstart\": GestureType.START,\n\"touchmove\": GestureType.DRAG,\n\"touchend\": GestureType.END,\n\"touchcancel\": GestureType.END\n}[e.type];\n- evt = e.changedTouches[0];\n+ evt = (<TouchEvent>e).changedTouches[0];\n} else {\ntype = {\n\"mousedown\": GestureType.START,\n", "new_path": "packages/rstream-gestures/src/index.ts", "old_path": "packages/rstream-gestures/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
fix(rstream-gestures): touchevent check in safari
1
fix
rstream-gestures
807,849
13.07.2018 13:35:21
25,200
05d7ca30acb548706804799f21451d36e071da21
chore: Fix conventional-commits test assertion order
[ { "change_type": "MODIFY", "diff": "@@ -21,10 +21,16 @@ const lernaPublish = require(\"@lerna-test/command-runner\")(require(\"../command\")\ndescribe(\"--conventional-commits\", () => {\ndescribe(\"independent\", () => {\n- const versionBumps = [\"1.0.1\", \"2.1.0\", \"4.0.0\", \"4.1.0\", \"5.0.1\"];\n+ const versionBumps = new Map([\n+ [\"package-1\", \"1.0.1\"],\n+ [\"package-2\", \"2.1.0\"],\n+ [\"package-3\", \"4.0.0\"],\n+ [\"package-4\", \"4.1.0\"],\n+ [\"package-5\", \"5.0.1\"],\n+ ]);\nbeforeEach(() => {\n- ConventionalCommitUtilities.mockBumps(...versionBumps);\n+ ConventionalCommitUtilities.mockBumps(...versionBumps.values());\n});\nit(\"should use conventional-commits utility to guess version bump and generate CHANGELOG\", async () => {\n@@ -35,14 +41,14 @@ describe(\"--conventional-commits\", () => {\nconst changedFiles = await showCommit(cwd, \"--name-only\");\nexpect(changedFiles).toMatchSnapshot();\n- [\"package-1\", \"package-2\", \"package-3\", \"package-4\", \"package-5\"].forEach((name, idx) => {\n+ versionBumps.forEach((version, name) => {\nexpect(ConventionalCommitUtilities.recommendVersion).toBeCalledWith(\nexpect.objectContaining({ name }),\n\"independent\",\n{ changelogPreset: undefined, rootPath: cwd }\n);\nexpect(ConventionalCommitUtilities.updateChangelog).toBeCalledWith(\n- expect.objectContaining({ name, version: versionBumps[idx] }),\n+ expect.objectContaining({ name, version }),\n\"independent\",\n{ changelogPreset: undefined, rootPath: cwd }\n);\n", "new_path": "commands/publish/__tests__/publish-conventional-commits.test.js", "old_path": "commands/publish/__tests__/publish-conventional-commits.test.js" } ]
JavaScript
MIT License
lerna/lerna
chore: Fix conventional-commits test assertion order
1
chore
null
217,922
13.07.2018 14:19:01
-7,200
87f1a90dd7508131c34cbd7f86564c53e8defc2d
chore: [WIP] new color for items that have all end ingredients available
[ { "change_type": "MODIFY", "diff": "@@ -51,7 +51,4 @@ export class ListRow extends DataModel {\n* @type {boolean}\n*/\nusePrice?: boolean = true;\n-\n- // noinspection TsLint\n- priority?: boolean = false;\n}\n", "new_path": "src/app/model/list/list-row.ts", "old_path": "src/app/model/list/list-row.ts" }, { "change_type": "MODIFY", "diff": "@@ -385,6 +385,27 @@ export class List extends DataWithPermissions {\nreturn canCraft;\n}\n+ hasAllBaseIngredients(item: ListRow, amount = item.amount): boolean {\n+ // If it's not a craft, break recursion\n+ if (item.craftedBy === undefined || item.craftedBy.length === 0 || item.requires === undefined) {\n+ console.log(item.id, item.done, amount, item.amount);\n+ // Simply return the amount of the item being equal to the amount needed.\n+ return item.done >= amount;\n+ }\n+ // If we already have the precraft done, don't go further into the requirements.\n+ if (item.done >= amount) {\n+ return true\n+ }\n+ // Don't mind crystals\n+ const requirements = item.requires.filter(req => req.id <= 1 || req.id > 20);\n+ return requirements.reduce((hasAllBaseIngredients, requirement) => {\n+ const requirementItem = this.getItemById(requirement.id, true);\n+ if (requirementItem !== undefined) {\n+ return this.hasAllBaseIngredients(requirementItem, requirement.amount * item.amount_needed) && hasAllBaseIngredients;\n+ }\n+ }, true);\n+ }\n+\n/**\n* Checks if the list is outdated, the implementation is meant to change.\n* @returns {boolean}\n", "new_path": "src/app/model/list/list.ts", "old_path": "src/app/model/list/list.ts" }, { "change_type": "MODIFY", "diff": "@@ -3,7 +3,6 @@ import {CommonModule} from '@angular/common';\nimport {ItemComponent} from './item/item.component';\nimport {\nMatButtonModule,\n- MatButtonToggleModule,\nMatCardModule,\nMatChipsModule,\nMatDialogModule,\n@@ -54,7 +53,6 @@ import {SimulatorLinkPipe} from 'app/modules/item/simulator-link.pipe';\nMatInputModule,\nMatCardModule,\nMatMenuModule,\n- MatButtonToggleModule,\nClipboardModule,\n", "new_path": "src/app/modules/item/item.module.ts", "old_path": "src/app/modules/item/item.module.ts" }, { "change_type": "MODIFY", "diff": "<!--Layout for desktop browsers-->\n<mat-list-item *ngIf=\"!(isMobile | async); else mobileLayout\"\n[ngClass]=\"{'even': even, 'auto-height':true, 'compact':settings.compactLists,\n- 'done-row': item.done >= item.amount, 'craftable-row': canBeCrafted}\">\n+ 'done-row': item.done >= item.amount, 'craftable-row': canBeCrafted, 'has-all-ingredients-row': hasAllIngredients}\">\n<div class=\"item-col-left\">\n- <button class=\"priority-toggle\" *ngIf=\"recipe\" mat-icon-button (click)=\"togglePriority()\">\n- <mat-icon color=\"{{item.priority?'primary':''}}\" [class.inactive]=\"!item.priority\">priority_high</mat-icon>\n- </button>\n<div matListAvatar [ngClass]=\"{'icon':true, 'compact': settings.compactLists}\"\n[appXivdbTooltip]=\"item.id\" [appXivdbTooltipDisabled]=\"isDraft()\">\n<a matListAvatar disabled=\"isDraft()\" href=\"{{item.id | itemLink | i18n}}\" target=\"_blank\">\n", "new_path": "src/app/modules/item/item/item.component.html", "old_path": "src/app/modules/item/item/item.component.html" }, { "change_type": "MODIFY", "diff": "}\n}\n- .priority-toggle {\n- position: absolute;\n- left: -24px;\n- }\n-\n.even {\nbackground-color: rgba(123, 123, 123, .2);\n&.done-row {\n&.craftable-row {\nbackground-color: rgba(19, 168, 255, .2);\n}\n+ &.has-all-ingredients-row {\n+ background-color: rgba(229, 3, 255, 0.1);\n+ }\n}\n.done-row {\nbackground-color: rgba(19, 168, 255, .3);\n}\n+ .has-all-ingredients-row {\n+ background-color: rgba(229, 3, 255, 0.3);\n+ }\n+\n.strike {\ncolor: #00E676;\n}\n", "new_path": "src/app/modules/item/item/item.component.scss", "old_path": "src/app/modules/item/item/item.component.scss" }, { "change_type": "MODIFY", "diff": "@@ -261,6 +261,8 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\ncanBeCrafted = false;\n+ hasAllIngredients = false;\n+\nhasTimers = false;\nhasBook = true;\n@@ -315,11 +317,6 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\n);\n}\n- togglePriority(): void {\n- this.item.priority = !this.item.priority;\n- this.update.emit();\n- }\n-\nisDraft(): boolean {\nreturn this.item.id.toString().indexOf('draft') > -1;\n}\n@@ -372,6 +369,7 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\nngOnChanges(changes: SimpleChanges): void {\nthis.updateCanBeCrafted();\n+ this.updateHasAllIngredients();\nthis.updateTradeIcon();\nthis.updateHasTimers();\nthis.updateMasterBooks();\n@@ -448,10 +446,17 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\n}\nupdateCanBeCrafted(): void {\n- // this.item.done < this.item.amount check is made to avoid item being cmarked as craftable while you already crafted it.\n+ // this.item.done < this.item.amount check is made to avoid item being marked as craftable while you already crafted it.\nthis.canBeCrafted = this.list.canBeCrafted(this.item) && this.item.done < this.item.amount;\n}\n+ updateHasAllIngredients(): void {\n+ const isCraft = this.item.craftedBy !== undefined && this.item.craftedBy.length > 0 && this.item.requires !== undefined;\n+ // Don't put the all ingredients flag if it can be crafted as colors would overlap each other.\n+ this.hasAllIngredients = isCraft && this.recipe && this.list.hasAllBaseIngredients(this.item)\n+ && this.item.done < this.item.amount && !this.canBeCrafted;\n+ }\n+\nupdateRequiredForEndCraft(): void {\nconst recipesNeedingItem = this.list.recipes\n.filter(recipe => recipe.requires !== undefined)\n", "new_path": "src/app/modules/item/item/item.component.ts", "old_path": "src/app/modules/item/item/item.component.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: [WIP] new color for items that have all end ingredients available
1
chore
null
807,849
13.07.2018 14:41:16
25,200
60ff432deec8f15681fb2a29d63cfd4668881086
fix(core/package): Serialize hosted git URLs with original protocol/shorthand Fixes
[ { "change_type": "ADD", "diff": "+{\n+ \"version\": \"1.0.0\"\n+}\n", "new_path": "commands/publish/__tests__/__fixtures__/git-hosted-sibling-gitlab/lerna.json", "old_path": null }, { "change_type": "ADD", "diff": "+{\n+ \"name\": \"git-hosted-sibling-gitlab\",\n+ \"description\": \"Recognizing sibling dependencies from gitlab\",\n+ \"version\": \"0.0.0-lerna\"\n+}\n", "new_path": "commands/publish/__tests__/__fixtures__/git-hosted-sibling-gitlab/package.json", "old_path": null }, { "change_type": "ADD", "diff": "+{\n+ \"name\": \"package-1\",\n+ \"version\": \"1.0.0\"\n+}\n", "new_path": "commands/publish/__tests__/__fixtures__/git-hosted-sibling-gitlab/packages/package-1/package.json", "old_path": null }, { "change_type": "ADD", "diff": "+{\n+ \"name\": \"package-2\",\n+ \"version\": \"1.0.0\",\n+ \"dependencies\": {\n+ \"package-1\": \"gitlab:user/package-1#v1.0.0\"\n+ }\n+}\n", "new_path": "commands/publish/__tests__/__fixtures__/git-hosted-sibling-gitlab/packages/package-2/package.json", "old_path": null }, { "change_type": "ADD", "diff": "+{\n+ \"name\": \"package-3\",\n+ \"version\": \"1.0.0\",\n+ \"devDependencies\": {\n+ \"package-2\": \"git@gitlab.com:user/package-2#v1.0.0\"\n+ }\n+}\n", "new_path": "commands/publish/__tests__/__fixtures__/git-hosted-sibling-gitlab/packages/package-3/package.json", "old_path": null }, { "change_type": "ADD", "diff": "+{\n+ \"name\": \"package-4\",\n+ \"version\": \"1.0.0\",\n+ \"dependencies\": {\n+ \"package-1\": \"git+https://user:token@gitlab.com/user/package-1.git#v1.0.0\"\n+ }\n+}\n", "new_path": "commands/publish/__tests__/__fixtures__/git-hosted-sibling-gitlab/packages/package-4/package.json", "old_path": null }, { "change_type": "ADD", "diff": "+{\n+ \"name\": \"package-5\",\n+ \"version\": \"1.0.0\",\n+ \"dependencies\": {\n+ \"package-1\": \"ssh://git@gitlab.com:user/package-1.git#v1.0.0\"\n+ },\n+ \"private\": true\n+}\n", "new_path": "commands/publish/__tests__/__fixtures__/git-hosted-sibling-gitlab/packages/package-5/package.json", "old_path": null }, { "change_type": "MODIFY", "diff": "@@ -29,7 +29,7 @@ describe(\"git-hosted sibling specifiers\", () => {\n// package-1 doesn't have any dependencies\nexpect(writePkg.updatedManifest(\"package-2\").dependencies).toMatchObject({\n- \"package-1\": \"git+ssh://git@github.com/user/package-1.git#v1.1.0\",\n+ \"package-1\": \"github:user/package-1#v1.1.0\",\n});\nexpect(writePkg.updatedManifest(\"package-3\").devDependencies).toMatchObject({\n\"package-2\": \"git+ssh://git@github.com/user/package-2.git#v1.1.0\",\n@@ -57,7 +57,7 @@ describe(\"git-hosted sibling specifiers\", () => {\n// package-1 doesn't have any dependencies\nexpect(writePkg.updatedManifest(\"package-2\").dependencies).toMatchObject({\n- \"package-1\": \"git+ssh://git@github.com/user/package-1.git#semver:^1.0.1-beta.0\",\n+ \"package-1\": \"github:user/package-1#semver:^1.0.1-beta.0\",\n});\nexpect(writePkg.updatedManifest(\"package-3\").devDependencies).toMatchObject({\n\"package-2\": \"git+ssh://git@github.com/user/package-2.git#semver:^1.0.1-beta.0\",\n@@ -69,4 +69,32 @@ describe(\"git-hosted sibling specifiers\", () => {\n\"package-1\": \"git+ssh://git@github.com/user/package-1.git#semver:^1.0.1-beta.0\",\n});\n});\n+\n+ test(\"gitlab\", async () => {\n+ const cwd = await initFixture(\"git-hosted-sibling-gitlab\");\n+\n+ await lernaPublish(cwd)(\"--cd-version\", \"premajor\", \"--preid\", \"rc\");\n+\n+ expect(writePkg.updatedVersions()).toEqual({\n+ \"package-1\": \"2.0.0-rc.0\",\n+ \"package-2\": \"2.0.0-rc.0\",\n+ \"package-3\": \"2.0.0-rc.0\",\n+ \"package-4\": \"2.0.0-rc.0\",\n+ \"package-5\": \"2.0.0-rc.0\",\n+ });\n+\n+ // package-1 doesn't have any dependencies\n+ expect(writePkg.updatedManifest(\"package-2\").dependencies).toMatchObject({\n+ \"package-1\": \"gitlab:user/package-1#v2.0.0-rc.0\",\n+ });\n+ expect(writePkg.updatedManifest(\"package-3\").devDependencies).toMatchObject({\n+ \"package-2\": \"git+ssh://git@gitlab.com/user/package-2.git#v2.0.0-rc.0\",\n+ });\n+ expect(writePkg.updatedManifest(\"package-4\").dependencies).toMatchObject({\n+ \"package-1\": \"git+https://user:token@gitlab.com/user/package-1.git#v2.0.0-rc.0\",\n+ });\n+ expect(writePkg.updatedManifest(\"package-5\").dependencies).toMatchObject({\n+ \"package-1\": \"git+ssh://git@gitlab.com/user/package-1.git#v2.0.0-rc.0\",\n+ });\n+ });\n});\n", "new_path": "commands/publish/__tests__/publish-git-hosted-siblings.test.js", "old_path": "commands/publish/__tests__/publish-git-hosted-siblings.test.js" }, { "change_type": "MODIFY", "diff": "@@ -146,15 +146,15 @@ class Package {\nconst { hosted } = resolved; // take that, lint!\nhosted.committish = `${tagPrefix}${depVersion}`;\n- // always serialize the full git+ssh url (identical to previous resolved.saveSpec)\n- depCollection[depName] = hosted.sshurl({ noGitPlus: false, noCommittish: false });\n+ // always serialize the full url (identical to previous resolved.saveSpec)\n+ depCollection[depName] = hosted.toString({ noGitPlus: false, noCommittish: false });\n} else if (resolved.gitRange) {\n// a git url with matching gitRange (#semver:^1.2.3)\nconst { hosted } = resolved; // take that, lint!\nhosted.committish = `semver:${savePrefix}${depVersion}`;\n- // always serialize the full git+ssh url (identical to previous resolved.saveSpec)\n- depCollection[depName] = hosted.sshurl({ noGitPlus: false, noCommittish: false });\n+ // always serialize the full url (identical to previous resolved.saveSpec)\n+ depCollection[depName] = hosted.toString({ noGitPlus: false, noCommittish: false });\n}\n}\n}\n", "new_path": "core/package/index.js", "old_path": "core/package/index.js" } ]
JavaScript
MIT License
lerna/lerna
fix(core/package): Serialize hosted git URLs with original protocol/shorthand Fixes #1499
1
fix
core/package
807,849
13.07.2018 15:57:33
25,200
7b3817cc50dd23cf100c2a3090b044d83c26bfd4
fix(publish): Update lerna.json version after root preversion lifecycle Refs
[ { "change_type": "MODIFY", "diff": "@@ -191,10 +191,6 @@ class PublishCommand extends Command {\nconst tasks = [];\n- if (!this.project.isIndependent() && !this.options.canary) {\n- tasks.push(() => this.updateVersionInLernaJson());\n- }\n-\ntasks.push(() => this.updateUpdatedPackages());\nif (this.gitEnabled) {\n@@ -461,16 +457,6 @@ class PublishCommand extends Command {\nreturn PromptUtilities.confirm(\"Are you sure you want to publish the above changes?\");\n}\n- updateVersionInLernaJson() {\n- this.project.version = this.globalVersion;\n-\n- return this.project.serializeConfig().then(lernaConfigLocation => {\n- if (!this.options.skipGit) {\n- return gitAdd([lernaConfigLocation], this.execOpts);\n- }\n- });\n- }\n-\nrunPackageLifecycle(pkg, stage) {\nif (pkg.scripts[stage]) {\nreturn runLifecycle(pkg, stage, this.conf).catch(err => {\n@@ -489,6 +475,11 @@ class PublishCommand extends Command {\n// my kingdom for async await :(\nlet chain = Promise.resolve();\n+ // preversion: Run BEFORE bumping the package version.\n+ // version: Run AFTER bumping the package version, but BEFORE commit.\n+ // postversion: Run AFTER bumping the package version, and AFTER commit.\n+ // @see https://docs.npmjs.com/misc/scripts\n+\n// exec preversion lifecycle in root (before all updates)\nchain = chain.then(() => this.runPackageLifecycle(rootPkg, \"preversion\"));\n@@ -559,6 +550,17 @@ class PublishCommand extends Command {\n);\n}\n+ if (!independentVersions && !this.options.canary) {\n+ this.project.version = this.globalVersion;\n+\n+ chain = chain.then(() =>\n+ this.project.serializeConfig().then(lernaConfigLocation => {\n+ // commit the version update\n+ changedFiles.add(lernaConfigLocation);\n+ })\n+ );\n+ }\n+\n// exec version lifecycle in root (after all updates)\nchain = chain.then(() => this.runPackageLifecycle(rootPkg, \"version\"));\n", "new_path": "commands/publish/index.js", "old_path": "commands/publish/index.js" } ]
JavaScript
MIT License
lerna/lerna
fix(publish): Update lerna.json version after root preversion lifecycle Refs #1495
1
fix
publish
807,849
13.07.2018 15:58:58
25,200
2d497edfb2df60184a7aeae55765034f66e8c499
fix(publish): Do not leave unstaged changes with --skip-git
[ { "change_type": "MODIFY", "diff": "@@ -46,8 +46,7 @@ test(\"publish --skip-git\", async () => {\n]);\nconst unstaged = await listDirty(cwd);\n- // FIXME: lerna.json should not have unstaged changes\n- expect(unstaged).toEqual([\"lerna.json\"]);\n+ expect(unstaged).toEqual([]);\nconst logMessages = loggingOutput(\"info\");\nexpect(logMessages).toContain(\"Skipping git commit/push\");\n", "new_path": "commands/publish/__tests__/publish-skip-flags.test.js", "old_path": "commands/publish/__tests__/publish-skip-flags.test.js" }, { "change_type": "MODIFY", "diff": "@@ -255,11 +255,14 @@ class PublishCommand extends Command {\n});\n}\n- resetManifestChanges() {\n+ resetChanges() {\n// the package.json files are changed (by gitHead if not --canary)\n// and we should always leave the working tree clean\nreturn pReduce(this.project.packageConfigs, (_, pkgGlob) =>\ngitCheckout(`${pkgGlob}/package.json`, this.execOpts)\n+ ).then(() =>\n+ // --skip-git should not leave unstaged changes behind\n+ gitCheckout(this.project.manifest.location, this.execOpts)\n);\n}\n@@ -271,7 +274,7 @@ class PublishCommand extends Command {\nchain = chain.then(() => this.resolveLocalDependencyLinks());\nchain = chain.then(() => this.annotateGitHead());\nchain = chain.then(() => this.npmPublish());\n- chain = chain.then(() => this.resetManifestChanges());\n+ chain = chain.then(() => this.resetChanges());\nif (this.options.tempTag) {\nchain = chain.then(() => this.npmUpdateAsLatest());\n", "new_path": "commands/publish/index.js", "old_path": "commands/publish/index.js" } ]
JavaScript
MIT License
lerna/lerna
fix(publish): Do not leave unstaged changes with --skip-git
1
fix
publish
730,424
13.07.2018 16:09:51
14,400
23370ec006680a573047648e151e9e261d088d47
chore: remove metrics from widgets for now
[ { "change_type": "MODIFY", "diff": "@@ -70,12 +70,6 @@ export default function createSpark() {\nget: genMockFunction(),\nunassign: genMockFunction(),\nupdate: genMockFunction()\n- },\n-\n- metrics: {\n- sendUnstructured: genMockFunction(),\n- sendSemiStructured: genMockFunction(),\n- submitClientMetrics: genMockFunction()\n}\n},\n", "new_path": "packages/node_modules/@ciscospark/react-redux-spark-fixtures/src/__fixtures__/spark.js", "old_path": "packages/node_modules/@ciscospark/react-redux-spark-fixtures/src/__fixtures__/spark.js" }, { "change_type": "MODIFY", "diff": "@@ -10,21 +10,7 @@ import {\n} from './actions';\nimport createSpark, {createSparkJwt} from './spark';\n-const metricName = {\n- SPARK_AUTHENTICATED: {\n- resource: 'spark',\n- event: 'authentication',\n- action: 'authenticated'\n- },\n- DEVICE_REGISTERED: {\n- resource: 'device',\n- event: 'registration',\n- action: 'registered'\n- }\n-};\n-\nconst injectedPropTypes = {\n- metrics: PropTypes.object.isRequired,\nspark: PropTypes.object.isRequired,\nstoreSparkInstance: PropTypes.func.isRequired,\nupdateSparkStatus: PropTypes.func.isRequired\n@@ -43,11 +29,7 @@ const defaultProps = {\nclass SparkComponent extends Component {\nstatic listenToSparkEvents(spark, props) {\n- const {metrics} = props;\nspark.listenToAndRun(spark, 'change:canAuthorize', () => {\n- if (metrics && spark.canAuthorize) {\n- metrics.sendElapsedTime(metricName.SPARK_AUTHENTICATED, spark);\n- }\nprops.updateSparkStatus({authenticated: spark.canAuthorize});\n});\n@@ -56,9 +38,6 @@ class SparkComponent extends Component {\n});\nspark.listenToAndRun(spark.internal.device, 'change:registered', () => {\n- if (metrics && spark.internal.device.registered) {\n- metrics.sendElapsedTime(metricName.DEVICE_REGISTERED, spark);\n- }\nprops.updateSparkStatus({registered: spark.internal.device.registered});\n});\n", "new_path": "packages/node_modules/@ciscospark/react-redux-spark/src/component.js", "old_path": "packages/node_modules/@ciscospark/react-redux-spark/src/component.js" }, { "change_type": "MODIFY", "diff": "@@ -4,7 +4,6 @@ import '@ciscospark/internal-plugin-mercury';\nimport '@ciscospark/plugin-people';\nimport '@ciscospark/internal-plugin-conversation';\nimport '@ciscospark/plugin-phone';\n-import '@ciscospark/internal-plugin-metrics';\nimport '@ciscospark/internal-plugin-flag';\nimport '@ciscospark/internal-plugin-feature';\nimport '@ciscospark/internal-plugin-presence';\n", "new_path": "packages/node_modules/@ciscospark/react-redux-spark/src/spark.js", "old_path": "packages/node_modules/@ciscospark/react-redux-spark/src/spark.js" }, { "change_type": "MODIFY", "diff": "@@ -11,7 +11,6 @@ import thunk from 'redux-thunk';\nimport PropTypes from 'prop-types';\nimport sparkReducer from '@ciscospark/react-redux-spark';\nimport usersReducer from '@ciscospark/redux-module-users';\n-import metricsReducer from '@ciscospark/react-redux-spark-metrics';\nimport {REMOVE_WIDGET} from './withRemoveWidget';\n@@ -20,7 +19,6 @@ function constructReducers(reducers) {\nrootReducers.spark = sparkReducer;\nrootReducers.users = usersReducer;\n- rootReducers.metricsStore = metricsReducer;\nconst widgetReducer = combineReducers(rootReducers);\nreturn (state, action) => {\n", "new_path": "packages/node_modules/@ciscospark/spark-widget-base/src/enhancers/withInitialState.js", "old_path": "packages/node_modules/@ciscospark/spark-widget-base/src/enhancers/withInitialState.js" }, { "change_type": "MODIFY", "diff": "@@ -5,7 +5,6 @@ import {\n} from 'recompose';\nimport {withSpark} from '@ciscospark/react-redux-spark';\n-import {withSparkMetrics} from '@ciscospark/react-redux-spark-metrics';\nimport '@ciscospark/react-component-spark-fonts';\nimport {\n@@ -41,8 +40,6 @@ export function constructSparkEnhancer({\nwithInitialState({reducers, enhancers}),\n// Clears store on Remove\nwithRemoveWidget,\n- // Add Metrics mothods as props\n- withSparkMetrics(name),\n// Connects and Auths with Spark API\nwithSpark,\n// Retrieves and stores current user\n", "new_path": "packages/node_modules/@ciscospark/spark-widget-base/src/index.js", "old_path": "packages/node_modules/@ciscospark/spark-widget-base/src/index.js" }, { "change_type": "MODIFY", "diff": "@@ -22,7 +22,6 @@ import {\nimport {storeActivities} from '@ciscospark/redux-module-activities';\nimport {fetchAvatar} from '@ciscospark/redux-module-avatar';\nimport {fetchTeams} from '@ciscospark/redux-module-teams';\n-import {events as metricEvents} from '@ciscospark/react-redux-spark-metrics';\nimport LoadingScreen from '@webex/react-component-loading-screen';\nimport ErrorDisplay from '@ciscospark/react-component-error-display';\n@@ -48,7 +47,6 @@ const injectedPropTypes = {\nincomingCall: PropTypes.object,\nmedia: PropTypes.object.isRequired,\nmercuryStatus: PropTypes.object.isRequired,\n- metrics: PropTypes.object.isRequired,\nspaces: PropTypes.object.isRequired,\nspacesList: PropTypes.array.isRequired,\nsparkInstance: PropTypes.object,\n@@ -106,20 +104,6 @@ export class RecentsWidget extends Component {\n}\n}\n- componentWillReceiveProps(nextProps) {\n- RecentsWidget.checkForMercuryErrors(nextProps);\n- RecentsWidget.setup(nextProps);\n- this.addListeners(nextProps);\n- this.fetchAllAvatars(nextProps);\n- }\n-\n- shouldComponentUpdate(nextProps) {\n- return nextProps.spacesList !== this.props.spacesList\n- || nextProps.errors !== this.props.errors\n- || nextProps.widgetRecents !== this.props.widgetRecents\n- || nextProps.incomingCall !== this.props.incomingCall;\n- }\n-\nstatic setup(props) {\nconst {\nerrors,\n@@ -127,7 +111,6 @@ export class RecentsWidget extends Component {\nsparkInstance,\nsparkState,\nmercuryStatus,\n- metrics,\nwidgetStatus\n} = props;\n@@ -197,9 +180,20 @@ export class RecentsWidget extends Component {\n}\n}\n}\n- if (widgetStatus.hasFetchedRecentSpaces) {\n- metrics.sendEndMetric(metricEvents.WIDGET_LOAD);\n}\n+\n+ componentWillReceiveProps(nextProps) {\n+ RecentsWidget.checkForMercuryErrors(nextProps);\n+ RecentsWidget.setup(nextProps);\n+ this.addListeners(nextProps);\n+ this.fetchAllAvatars(nextProps);\n+ }\n+\n+ shouldComponentUpdate(nextProps) {\n+ return nextProps.spacesList !== this.props.spacesList\n+ || nextProps.errors !== this.props.errors\n+ || nextProps.widgetRecents !== this.props.widgetRecents\n+ || nextProps.incomingCall !== this.props.incomingCall;\n}\n@autobind\n", "new_path": "packages/node_modules/@ciscospark/widget-recents/src/container.js", "old_path": "packages/node_modules/@ciscospark/widget-recents/src/container.js" }, { "change_type": "MODIFY", "diff": "@@ -2,7 +2,6 @@ import {compose, lifecycle} from 'recompose';\nimport {connect} from 'react-redux';\nimport {bindActionCreators} from 'redux';\n-import {events as metricEvents} from '@ciscospark/react-redux-spark-metrics';\nimport {fetchAvatar} from '@ciscospark/redux-module-avatar';\nimport {resetErrors} from '@ciscospark/redux-module-errors';\nimport {constructHydraId, hydraTypes, isUuid} from '@ciscospark/react-component-utils';\n@@ -98,7 +97,6 @@ function setup(props, prevProps) {\nerrors,\nsparkInstance,\nsparkState,\n- metrics,\nspaceDetails,\nwidgetStatus\n} = props;\n@@ -152,7 +150,6 @@ function setup(props, prevProps) {\n}\nif (conversation.get('id')) {\n- metrics.sendEndMetric(metricEvents.WIDGET_LOAD);\nprops.fetchAvatar({space: conversation.toJS()}, sparkInstance);\n}\n}\n", "new_path": "packages/node_modules/@ciscospark/widget-space/src/enhancers/setup.js", "old_path": "packages/node_modules/@ciscospark/widget-space/src/enhancers/setup.js" } ]
JavaScript
MIT License
webex/react-widgets
chore: remove metrics from widgets for now
1
chore
null
730,424
13.07.2018 16:30:33
14,400
dc8f22861b5679b7d93178c7e15eb060c1bacc13
chore(tooling): update npm token to use env alias
[ { "change_type": "MODIFY", "diff": "@@ -55,6 +55,7 @@ jobs:\ndestination: npm-install\n- <<: *save\n+\nunit_tests_and_linting:\n<<: *job_common\nsteps:\n", "new_path": ".circleci/config.yml", "old_path": ".circleci/config.yml" }, { "change_type": "MODIFY", "diff": "@@ -252,7 +252,7 @@ ansiColor('xterm') {\nstage('Publish to NPM') {\nwithCredentials([\n- string(credentialsId: 'WIDGETS_NPM_TOKEN', variable: 'WIDGETS_NPM_TOKEN')\n+ string(credentialsId: 'WIDGETS_NPM_PUBLISH_TOKEN', variable: 'WIDGETS_NPM_TOKEN')\n]) {\ntry {\n// Copy & update config file\n", "new_path": "Jenkinsfile", "old_path": "Jenkinsfile" } ]
JavaScript
MIT License
webex/react-widgets
chore(tooling): update npm token to use env alias
1
chore
tooling
807,849
13.07.2018 16:46:00
25,200
272e9f19aa16e183fe2d65150468a4b0a6be8ad1
fix(publish): Pass --repo-version argument through semver.valid() This removes any preceding "v" or "=", as well as any trailing build metadata. Refs
[ { "change_type": "MODIFY", "diff": "@@ -118,3 +118,34 @@ index SHA..SHA 100644\n- \\\\\"version\\\\\": \\\\\"1.0.0\\\\\"\n+ \\\\\"version\\\\\": \\\\\"1.0.1\\\\\"\"\n`;\n+\n+exports[`publish --repo-version strips invalid semver information from option value 1`] = `\n+\"v1.2.0-beta.1\n+\n+HEAD -> master, tag: v1.2.0-beta.1\n+\n+diff --git a/lerna.json b/lerna.json\n+index SHA..SHA 100644\n+--- a/lerna.json\n++++ b/lerna.json\n+@@ -2 +2 @@\n+- \\\\\"version\\\\\": \\\\\"1.0.0\\\\\"\n++ \\\\\"version\\\\\": \\\\\"1.2.0-beta.1\\\\\"\n+diff --git a/packages/package-3/package.json b/packages/package-3/package.json\n+index SHA..SHA 100644\n+--- a/packages/package-3/package.json\n++++ b/packages/package-3/package.json\n+@@ -3 +3 @@\n+- \\\\\"version\\\\\": \\\\\"1.0.0\\\\\",\n++ \\\\\"version\\\\\": \\\\\"1.2.0-beta.1\\\\\",\n+diff --git a/packages/package-5/package.json b/packages/package-5/package.json\n+index SHA..SHA 100644\n+--- a/packages/package-5/package.json\n++++ b/packages/package-5/package.json\n+@@ -7 +7 @@\n+- \\\\\"package-3\\\\\": \\\\\"^1.0.0\\\\\"\n++ \\\\\"package-3\\\\\": \\\\\"^1.2.0-beta.1\\\\\"\n+@@ -10 +10 @@\n+- \\\\\"version\\\\\": \\\\\"1.0.0\\\\\"\n++ \\\\\"version\\\\\": \\\\\"1.2.0-beta.1\\\\\"\"\n+`;\n", "new_path": "commands/publish/__tests__/__snapshots__/publish-versioning-flags.test.js.snap", "old_path": "commands/publish/__tests__/__snapshots__/publish-versioning-flags.test.js.snap" }, { "change_type": "MODIFY", "diff": "@@ -6,6 +6,7 @@ jest.mock(\"../lib/is-behind-upstream\");\n// mocked modules\nconst PromptUtilities = require(\"@lerna/prompt\");\n+const collectUpdates = require(\"@lerna/collect-updates\");\n// helpers\nconst initFixture = require(\"@lerna-test/init-fixture\")(__dirname);\n@@ -29,6 +30,17 @@ describe(\"publish --repo-version\", () => {\nconst message = await getCommitMessage(testDir);\nexpect(message).toBe(\"v1.0.1-beta.25\");\n});\n+\n+ it(\"strips invalid semver information from option value\", async () => {\n+ const testDir = await initFixture(\"normal\");\n+\n+ collectUpdates.setUpdated(testDir, \"package-3\", \"package-5\");\n+\n+ await lernaPublish(testDir)(\"--repo-version\", \"v1.2.0-beta.1+deadbeef\");\n+\n+ const patch = await showCommit(testDir);\n+ expect(patch).toMatchSnapshot();\n+ });\n});\ndescribe(\"publish --exact\", () => {\n", "new_path": "commands/publish/__tests__/publish-versioning-flags.test.js", "old_path": "commands/publish/__tests__/publish-versioning-flags.test.js" }, { "change_type": "MODIFY", "diff": "@@ -301,7 +301,7 @@ class PublishCommand extends Command {\nlet predicate;\nif (repoVersion) {\n- predicate = makeGlobalVersionPredicate(repoVersion);\n+ predicate = makeGlobalVersionPredicate(semver.valid(repoVersion));\n} else if (canary) {\nconst release = cdVersion || \"minor\";\n// FIXME: this complicated defaulting should be done in yargs option.coerce()\n", "new_path": "commands/publish/index.js", "old_path": "commands/publish/index.js" } ]
JavaScript
MIT License
lerna/lerna
fix(publish): Pass --repo-version argument through semver.valid() This removes any preceding "v" or "=", as well as any trailing build metadata. Refs #1483
1
fix
publish
807,849
13.07.2018 17:19:29
25,200
ff4080416664213b8f2c5313323e5cc4c682d462
chore: Flesh out core/* documentation TODOs
[ { "change_type": "MODIFY", "diff": "# `@lerna/child-process`\n-> description TODO\n+> Lerna's internal child_process wrapper\n## Usage\n-TODO\n-\n+You probably shouldn't.\n", "new_path": "core/child-process/README.md", "old_path": "core/child-process/README.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"@lerna/child-process\",\n\"version\": \"3.0.0-beta.21\",\n- \"description\": \"TODO\",\n+ \"description\": \"Lerna's internal child_process wrapper\",\n\"keywords\": [\n\"lerna\",\n\"utils\"\n", "new_path": "core/child-process/package.json", "old_path": "core/child-process/package.json" }, { "change_type": "MODIFY", "diff": "# `@lerna/cli`\n-> description TODO\n+> Lerna's CLI\n## Usage\n-TODO\n+You probably shouldn't, at least directly.\n+Install [lerna](https://www.npmjs.com/package/lerna) for access to the `lerna` CLI.\n", "new_path": "core/cli/README.md", "old_path": "core/cli/README.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"@lerna/cli\",\n\"version\": \"3.0.0-beta.21\",\n- \"description\": \"TODO\",\n+ \"description\": \"Lerna's CLI\",\n\"keywords\": [\n\"lerna\",\n\"core\"\n", "new_path": "core/cli/package.json", "old_path": "core/cli/package.json" }, { "change_type": "MODIFY", "diff": "# `@lerna/command`\n-> description TODO\n+> Lerna's internal base class for commands\n## Usage\n-TODO\n+You probably shouldn't, at least directly.\n+\n+Install [lerna](https://www.npmjs.com/package/lerna) for access to the `lerna` CLI.\n+\n", "new_path": "core/command/README.md", "old_path": "core/command/README.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"@lerna/command\",\n\"version\": \"3.0.0-beta.21\",\n- \"description\": \"TODO\",\n+ \"description\": \"Lerna's internal base class for commands\",\n\"keywords\": [\n\"lerna\",\n\"core\"\n", "new_path": "core/command/package.json", "old_path": "core/command/package.json" }, { "change_type": "MODIFY", "diff": "# `@lerna/conventional-commits`\n-> description TODO\n+> Lerna's internal interface to conventional-changelog and friends\n## Usage\n-TODO\n+You probably shouldn't, at least directly.\n+Install [lerna](https://www.npmjs.com/package/lerna) for access to the `lerna` CLI.\n", "new_path": "core/conventional-commits/README.md", "old_path": "core/conventional-commits/README.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"@lerna/conventional-commits\",\n\"version\": \"3.0.0-beta.15\",\n- \"description\": \"TODO\",\n+ \"description\": \"Lerna's internal interface to conventional-changelog and friends\",\n\"keywords\": [\n\"lerna\",\n\"core\"\n", "new_path": "core/conventional-commits/package.json", "old_path": "core/conventional-commits/package.json" }, { "change_type": "MODIFY", "diff": "# `@lerna/package-graph`\n-> description TODO\n+> Lerna's internal representation of a package graph\n## Usage\n-TODO\n+You probably shouldn't, at least directly.\n+Install [lerna](https://www.npmjs.com/package/lerna) for access to the `lerna` CLI.\n", "new_path": "core/package-graph/README.md", "old_path": "core/package-graph/README.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"@lerna/package-graph\",\n\"version\": \"3.0.0-beta.18\",\n- \"description\": \"TODO\",\n+ \"description\": \"Lerna's internal representation of a package graph\",\n\"keywords\": [\n\"lerna\",\n\"core\"\n", "new_path": "core/package-graph/package.json", "old_path": "core/package-graph/package.json" }, { "change_type": "MODIFY", "diff": "# `@lerna/package`\n-> description TODO\n+> Lerna's internal representation of a package\n## Usage\n-TODO\n+You probably shouldn't, at least directly.\n+Install [lerna](https://www.npmjs.com/package/lerna) for access to the `lerna` CLI.\n", "new_path": "core/package/README.md", "old_path": "core/package/README.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"@lerna/package\",\n\"version\": \"3.0.0-beta.17\",\n- \"description\": \"TODO\",\n+ \"description\": \"Lerna's internal representation of a package\",\n\"keywords\": [\n\"lerna\",\n\"core\"\n", "new_path": "core/package/package.json", "old_path": "core/package/package.json" }, { "change_type": "MODIFY", "diff": "# `@lerna/prompt`\n-> description TODO\n+> An internal Lerna tool\n## Usage\n-TODO\n+You probably shouldn't, at least directly.\n+Install [lerna](https://www.npmjs.com/package/lerna) for access to the `lerna` CLI.\n", "new_path": "core/prompt/README.md", "old_path": "core/prompt/README.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"@lerna/prompt\",\n\"version\": \"3.0.0-beta.0\",\n- \"description\": \"TODO\",\n+ \"description\": \"An internal Lerna tool\",\n\"keywords\": [\n\"lerna\",\n\"utils\"\n", "new_path": "core/prompt/package.json", "old_path": "core/prompt/package.json" }, { "change_type": "MODIFY", "diff": "# `@lerna/validation-error`\n-> description TODO\n+> An internal Lerna tool\n## Usage\n-TODO\n+You probably shouldn't, at least directly.\n+Install [lerna](https://www.npmjs.com/package/lerna) for access to the `lerna` CLI.\n", "new_path": "core/validation-error/README.md", "old_path": "core/validation-error/README.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"@lerna/validation-error\",\n\"version\": \"3.0.0-beta.10\",\n- \"description\": \"TODO\",\n+ \"description\": \"An internal Lerna tool\",\n\"keywords\": [\n\"lerna\",\n\"core\"\n", "new_path": "core/validation-error/package.json", "old_path": "core/validation-error/package.json" } ]
JavaScript
MIT License
lerna/lerna
chore: Flesh out core/* documentation TODOs
1
chore
null
808,051
13.07.2018 19:07:57
14,400
9cd41fd2fc6c956b34e879571aa8e7a128686294
docs: Clarify `lerna clean` behaviour when using `--hoist` [skip ci]
[ { "change_type": "MODIFY", "diff": "@@ -592,6 +592,8 @@ Remove the `node_modules` directory from all packages.\n`lerna clean` respects the `--ignore`, `--scope`, and `--yes` flags (see [Flags](#flags)).\n+> If you have the `--hoist` option enabled this will not remove modules from the root `node_modules` directory.\n+\n### diff\n```sh\n", "new_path": "README.md", "old_path": "README.md" } ]
JavaScript
MIT License
lerna/lerna
docs: Clarify `lerna clean` behaviour when using `--hoist` (#1492) [skip ci]
1
docs
null
724,001
14.07.2018 02:11:01
18,000
65449b32cd13b4a150cd22e2c9e453b23585d363
fix: allow extended components as stubs
[ { "change_type": "MODIFY", "diff": "@@ -10,19 +10,20 @@ import {\n} from './util'\nimport {\ncomponentNeedsCompiling,\n- templateContainsComponent\n+ templateContainsComponent,\n+ isVueComponent\n} from './validators'\nimport { compileTemplate } from './compile-template'\n-function isVueComponent (comp): boolean {\n- return comp && (comp.render || comp.template || comp.options)\n+function isVueComponentStub (comp): boolean {\n+ return comp && comp.template || isVueComponent(comp)\n}\nfunction isValidStub (stub: any): boolean {\nreturn (\n(!!stub && typeof stub === 'string') ||\nstub === true ||\n- isVueComponent(stub)\n+ isVueComponentStub(stub)\n)\n}\n", "new_path": "packages/shared/stub-components.js", "old_path": "packages/shared/stub-components.js" }, { "change_type": "MODIFY", "diff": "@@ -33,13 +33,15 @@ describeWithMountingMethods('options.stub', mountingMethod => {\nit('accepts valid component stubs', () => {\nconst ComponentWithRender = { render: h => h('div') }\nconst ComponentWithoutRender = { template: '<div></div>' }\n- const ExtendedComponent = Vue.extend({ template: '<div></div>' })\n+ const ExtendedComponent = { extends: ComponentWithRender }\n+ const SubclassedComponent = Vue.extend({ template: '<div></div>' })\nmountingMethod(ComponentWithChild, {\nstubs: {\nChildComponent: ComponentAsAClass,\nChildComponent2: ComponentWithRender,\nChildComponent3: ComponentWithoutRender,\n- ChildComponent4: ExtendedComponent\n+ ChildComponent4: ExtendedComponent,\n+ ChildComponent5: SubclassedComponent\n}\n})\n})\n", "new_path": "test/specs/mounting-options/stubs.spec.js", "old_path": "test/specs/mounting-options/stubs.spec.js" } ]
JavaScript
MIT License
vuejs/vue-test-utils
fix: allow extended components as stubs (#825)
1
fix
null
217,927
14.07.2018 18:45:59
0
6e2541f75918769261e83dbc08c73d59b8d45430
chore: fix double subscription call in quickList
[ { "change_type": "MODIFY", "diff": "@@ -315,11 +315,15 @@ export class RecipesComponent extends PageComponent implements OnInit {\n}\nquickList(recipe: Recipe, amount: string, collectible: boolean): void {\n- this.subscriptions.push(this.createQuickList(recipe, amount, collectible).subscribe(list => {\n- this.listService.getRouterPath(list.$key).subscribe(path => {\n+ this.subscriptions.push(this.createQuickList(recipe, amount, collectible)\n+ .pipe(\n+ mergeMap(list => {\n+ return this.listService.getRouterPath(list.$key);\n+ })\n+ ).subscribe(path => {\nthis.router.navigate(path);\n- });\n- }));\n+ })\n+ );\n}\n/**\n", "new_path": "src/app/pages/recipes/recipes/recipes.component.ts", "old_path": "src/app/pages/recipes/recipes/recipes.component.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: fix double subscription call in quickList
1
chore
null
217,927
14.07.2018 18:51:49
0
a637c553d5efc76cb8fedd3cb81d3631cf4e7c4a
refactor: recipe popup search results into buttons Instead of having a button beside each search result to select the item, this transforms each individual search result into a selectable button.
[ { "change_type": "MODIFY", "diff": "</div>\n<mat-list *ngIf=\"results.length > 0\">\n- <mat-list-item *ngFor=\"let item of results\" class=\"recipes-list-row\">\n+ <mat-list-item class=\"mat-elevation-z5\" *ngFor=\"let item of results\" (click)=\"close(item)\">\n<a mat-list-avatar href=\"{{item.itemId | itemLink | i18n}}\" target=\"_blank\">\n<img mat-list-avatar [appXivdbTooltip]=\"item.itemId\" src=\"{{item.icon | icon}}\"\nalt=\"{{item.itemId | itemName | i18n}}\">\nalt=\"getJob(item.job)?.abbreviation\" class=\"crafted-by\"> {{item.lvl}} <span\n[innerHtml]=\"getStars(item.stars)\"></span>\n</p>\n- <button mat-mini-fab [mat-dialog-close]=\"{itemId: item.itemId, recipeId: item.recipeId}\" class=\"gavel-button\">\n- <mat-icon>gavel</mat-icon>\n- </button>\n</mat-list-item>\n</mat-list>\n", "new_path": "src/app/pages/simulator/components/recipe-choice-popup/recipe-choice-popup.component.html", "old_path": "src/app/pages/simulator/components/recipe-choice-popup/recipe-choice-popup.component.html" }, { "change_type": "MODIFY", "diff": "vertical-align: middle;\n}\n-.gavel-button {\n- margin-left: 15px;\n+.mat-list-item {\n+ margin-bottom: 10px;\n+\n+ &:hover {\n+ background: rgba(175, 175, 175, 0.04);\n+ cursor: pointer;\n+ }\n+}\n+\n+.mat-divider {\n+ margin-top: 20px;\n}\n", "new_path": "src/app/pages/simulator/components/recipe-choice-popup/recipe-choice-popup.component.scss", "old_path": "src/app/pages/simulator/components/recipe-choice-popup/recipe-choice-popup.component.scss" }, { "change_type": "MODIFY", "diff": "@@ -53,8 +53,12 @@ export class RecipeChoicePopupComponent implements OnDestroy, OnInit {\nreturn this.htmlTools.generateStars(nb);\n}\n- close(): void {\n+ close(item: Recipe = undefined): void {\n+ if (item === undefined) {\nthis.ref.close();\n+ } else {\n+ this.ref.close({ itemId: item.itemId, recipeId: item.recipeId });\n+ }\n}\nngOnDestroy(): void {\n", "new_path": "src/app/pages/simulator/components/recipe-choice-popup/recipe-choice-popup.component.ts", "old_path": "src/app/pages/simulator/components/recipe-choice-popup/recipe-choice-popup.component.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
refactor: recipe popup search results into buttons Instead of having a button beside each search result to select the item, this transforms each individual search result into a selectable button.
1
refactor
null
724,203
15.07.2018 06:46:08
-7,200
4916fed382788872bb602e30af1873763fc0700d
feat: enabled slots option to take class components
[ { "change_type": "MODIFY", "diff": "import { throwError } from 'shared/util'\nimport { compileToFunctions } from 'vue-template-compiler'\n+import { isVueComponent } from '../shared/validators'\nfunction isValidSlot (slot: any): boolean {\nreturn (\n- Array.isArray(slot) ||\n- (slot !== null && typeof slot === 'object') ||\n+ isVueComponent(slot) ||\ntypeof slot === 'string'\n)\n}\n@@ -23,16 +23,9 @@ function requiresTemplateCompiler (slot: any): void {\nexport function validateSlots (slots: SlotsObject): void {\nObject.keys(slots).forEach(key => {\n- if (!isValidSlot(slots[key])) {\n- throwError(\n- `slots[key] must be a Component, string or an array ` + `of Components`\n- )\n- }\n+ const slot = Array.isArray(slots[key]) ? slots[key] : [slots[key]]\n- requiresTemplateCompiler(slots[key])\n-\n- if (Array.isArray(slots[key])) {\n- slots[key].forEach(slotValue => {\n+ slot.forEach(slotValue => {\nif (!isValidSlot(slotValue)) {\nthrowError(\n`slots[key] must be a Component, string or an array ` +\n@@ -41,6 +34,5 @@ export function validateSlots (slots: SlotsObject): void {\n}\nrequiresTemplateCompiler(slotValue)\n})\n- }\n})\n}\n", "new_path": "packages/create-instance/validate-slots.js", "old_path": "packages/create-instance/validate-slots.js" }, { "change_type": "MODIFY", "diff": "@@ -546,4 +546,26 @@ describeWithMountingMethods('options.slots', mountingMethod => {\nwrapper.find('div').trigger('click')\n}\n)\n+\n+ it('mounts component with default slot if passed class component in slot object', () => {\n+ const wrapper = mountingMethod(ComponentWithSlots, {\n+ slots: { default: ComponentAsAClass }\n+ })\n+ if (mountingMethod.name === 'renderToString') {\n+ expect(wrapper).contains('<div></div>')\n+ } else {\n+ expect(wrapper.contains(ComponentAsAClass)).to.equal(true)\n+ }\n+ })\n+\n+ it('mounts component with default slot if passed class component in array in slot object', () => {\n+ const wrapper = mountingMethod(ComponentWithSlots, {\n+ slots: { default: [ComponentAsAClass] }\n+ })\n+ if (mountingMethod.name === 'renderToString') {\n+ expect(wrapper).contains('<div></div>')\n+ } else {\n+ expect(wrapper.contains(ComponentAsAClass)).to.equal(true)\n+ }\n+ })\n})\n", "new_path": "test/specs/mounting-options/slots.spec.js", "old_path": "test/specs/mounting-options/slots.spec.js" } ]
JavaScript
MIT License
vuejs/vue-test-utils
feat: enabled slots option to take class components (#826)
1
feat
null
679,913
15.07.2018 16:26:40
-3,600
a8487edc2db6b46702dcc46a1b7dfcc295828993
feat(examples): add crypto chart example
[ { "change_type": "ADD", "diff": "Binary files /dev/null and b/assets/crypto-chart.png differ\n", "new_path": "assets/crypto-chart.png", "old_path": "assets/crypto-chart.png" }, { "change_type": "ADD", "diff": "+node_modules\n+yarn.lock\n+*.js\n", "new_path": "examples/crypto-chart/.gitignore", "old_path": null }, { "change_type": "ADD", "diff": "+# crypto-chart\n+\n+[Live demo](http://demo.thi.ng/umbrella/crypto-chart/)\n+\n+This example demonstrates how to use\n+[@thi.ng/rstream](https://github.com/thi-ng/umbrella/tree/master/packages/rstream)\n+&\n+[@thi.ng/transducer](https://github.com/thi-ng/umbrella/tree/master/packages/transducer)\n+constructs to create a basic crypto-currency candle chart. Unlike most\n+other examples in this repo, there's no additional state handling used\n+(e.g. via\n+[@thi.ng/atom](https://github.com/thi-ng/umbrella/tree/master/packages/atom)\n+constructs) and the entire app largely relies on various stream\n+combinators & transformers. Furthermore, this approach only triggers UI\n+updates / diffs when there were any relevant upstream value changes.\n+\n+```\n+git clone https://github.com/thi-ng/umbrella.git\n+cd umbrella/examples/crypto-chart\n+yarn install\n+yarn start\n+```\n+\n+## Authors\n+\n+- Karsten Schmidt\n+\n+## License\n+\n+&copy; 2018 Karsten Schmidt // Apache Software License 2.0\n", "new_path": "examples/crypto-chart/README.md", "old_path": null }, { "change_type": "ADD", "diff": "+<!DOCTYPE html>\n+<html lang=\"en\">\n+<head>\n+ <meta charset=\"UTF-8\">\n+ <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n+ <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n+ <title>crypto-chart</title>\n+ <link href=\"https://unpkg.com/tachyons@4.9.1/css/tachyons.min.css\" rel=\"stylesheet\">\n+ <style>\n+ </style>\n+</head>\n+<body>\n+ <div id=\"app\"></div>\n+ <script type=\"text/javascript\" src=\"bundle.js\"></script>\n+</body>\n+</html>\n", "new_path": "examples/crypto-chart/index.html", "old_path": null }, { "change_type": "ADD", "diff": "+{\n+ \"name\": \"crypto-chart\",\n+ \"version\": \"0.0.1\",\n+ \"repository\": \"https://github.com/thi-ng/umbrella\",\n+ \"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n+ \"license\": \"Apache-2.0\",\n+ \"scripts\": {\n+ \"build\": \"webpack --mode production --display-reasons --display-modules\",\n+ \"start\": \"webpack-dev-server --open --mode development --devtool inline-source-map\"\n+ },\n+ \"devDependencies\": {\n+ \"ts-loader\": \"^4.3.0\",\n+ \"typescript\": \"^2.8.3\",\n+ \"webpack\": \"^4.8.1\",\n+ \"webpack-cli\": \"^2.1.3\",\n+ \"webpack-dev-server\": \"^3.1.4\"\n+ },\n+ \"dependencies\": {\n+ \"@thi.ng/api\": \"latest\",\n+ \"@thi.ng/hdom\": \"latest\",\n+ \"@thi.ng/hdom-components\": \"latest\",\n+ \"@thi.ng/hiccup-svg\": \"latest\",\n+ \"@thi.ng/resolve-map\": \"latest\",\n+ \"@thi.ng/rstream\": \"latest\",\n+ \"@thi.ng/transducers\": \"latest\"\n+ }\n+}\n\\ No newline at end of file\n", "new_path": "examples/crypto-chart/package.json", "old_path": null }, { "change_type": "ADD", "diff": "+import { diffElement, normalizeTree } from \"@thi.ng/hdom\";\n+import { dropdown, DropDownOption } from \"@thi.ng/hdom-components\";\n+import {\n+ group,\n+ line,\n+ polyline,\n+ rect,\n+ svg,\n+ text\n+} from \"@thi.ng/hiccup-svg\";\n+import { resolve } from \"@thi.ng/resolve-map\";\n+import {\n+ comp,\n+ filter,\n+ iterator,\n+ map,\n+ mapcat,\n+ mapIndexed,\n+ max,\n+ min,\n+ movingAverage,\n+ pairs,\n+ pluck,\n+ push,\n+ range,\n+ reducer,\n+ scan,\n+ transduce\n+} from \"@thi.ng/transducers\";\n+import {\n+ fromEvent,\n+ resolve as resolvePromise,\n+ Stream,\n+ sync,\n+} from \"@thi.ng/rstream\";\n+\n+// this example demonstrates how to use @thi.ng/rstream &\n+// @thi.ng/transducer constructs to create a basic cryptocurrency candle\n+// chart. unlike most other examples in this repo, there's no additional\n+// state handling used (e.g. via @thi.ng/atom constructs) and the entire\n+// app largely relies on various stream combinators & transformers.\n+// furthermore, this approach only triggers UI updates/diffs when there\n+// were any relevant upstream value changes.\n+\n+// constant definitions\n+\n+// supported chart (and API) timeframes\n+export const TIMEFRAMES = {\n+ 1: \"Minute\",\n+ 60: \"Hour\",\n+ 1440: \"Day\",\n+};\n+\n+// supported symbol pairs\n+const SYMBOL_PAIRS: DropDownOption[] = [\n+ [\"BTCUSD\", \"BTC-USD\"],\n+ [\"ETHUSD\", \"ETH-USD\"],\n+ [\"LTCUSD\", \"LTC-USD\"],\n+];\n+\n+// chart settings\n+const MARGIN_X = 60;\n+const MARGIN_Y = 50;\n+const DAY = 60 * 60 * 24;\n+\n+const PRICE_TICKS = {\n+ 1: 25,\n+ 60: 50,\n+ 1440: 250\n+};\n+\n+const TIME_TICKS = {\n+ 1: 15 * 60,\n+ 60: DAY,\n+ 1440: DAY * 7\n+};\n+\n+// constructs request URL from given inputs\n+const API_URL = (market, symbol, period) =>\n+ `https://min-api.cryptocompare.com/data/histo${TIMEFRAMES[period].toLowerCase()}?fsym=${symbol.substr(0, 3)}&tsym=${symbol.substr(3)}&limit=168&aggregate=1&e=${market}`;\n+\n+// stub for local testing\n+// const API_URL = (..._) => `ohlc.json`;\n+\n+// helper functions\n+const clamp = (x: number, min: number, max: number) => x < min ? min : x > max ? max : x;\n+const fit = (x, a, b, c, d) => c + (d - c) * clamp((x - a) / (b - a), 0, 1);\n+\n+const fmtTime = (t: number) => {\n+ const d = new Date(t * 1000);\n+ console.log(d);\n+ return `${d.getUTCFullYear()}-${d.getUTCMonth() + 1}-${d.getUTCDate()}`;\n+};\n+\n+const emitOnStream = (stream) => (e) => stream.next(e.target.value);\n+\n+// stream definitions\n+\n+const market = new Stream();\n+const symbol = new Stream();\n+const period = new Stream();\n+const error = new Stream();\n+\n+// I/O error handler\n+error.subscribe({ next: (e) => alert(`An error occurred:\\n${e}`) });\n+\n+// this stream combinator performs API requests to obtain OHLC data\n+// and if successful computes a number of statistics\n+const data = sync({\n+ src: { market, symbol, period },\n+ reset: false,\n+ xform: map((inst) =>\n+ fetch(API_URL(inst.market, inst.symbol, inst.period))\n+ .then(\n+ (res) => res.ok ? res.json() : error.next(\"error loading OHLC data\"),\n+ (e) => error.next(e.message)\n+ )\n+ .then((json) => ({ ...inst, ohlc: json ? json.Data : null }))\n+ )\n+})\n+ .subscribe(resolvePromise({ fail: (e) => error.next(e.message) }))\n+ .transform(\n+ // bail if stream value has no OHLC data\n+ filter((x) => !!x.ohlc),\n+ // use @thi.ng/resolve-map to compute bounds & moving averages\n+ map((inst: any) => resolve({\n+ ...inst,\n+ min: ({ ohlc }) => transduce(pluck(\"low\"), min(), ohlc),\n+ max: ({ ohlc }) => transduce(pluck(\"high\"), max(), ohlc),\n+ tbounds: ({ ohlc }) => [ohlc[0].time, ohlc[ohlc.length - 1].time],\n+ sma12: ({ ohlc }) => transduce(comp(pluck(\"close\"), movingAverage(12)), push(), ohlc),\n+ sma24: ({ ohlc }) => transduce(comp(pluck(\"close\"), movingAverage(24)), push(), ohlc),\n+ sma50: ({ ohlc }) => transduce(comp(pluck(\"close\"), movingAverage(50)), push(), ohlc)\n+ }))\n+ );\n+\n+// this stream combinator (re)computes the SVG chart\n+const chart = sync({\n+ src: {\n+ data,\n+ window: fromEvent(window, \"resize\").transform(\n+ map(() => [window.innerWidth, window.innerHeight])\n+ )\n+ },\n+ reset: false,\n+ xform: map(({ data, window }) => {\n+ let [width, height] = window;\n+ const ohlc = data.ohlc;\n+ const w = (width - MARGIN_X) / ohlc.length;\n+ const by = height - MARGIN_Y;\n+ const mapX = (x: number) => fit(x, 0, ohlc.length, MARGIN_X, width - MARGIN_X);\n+ const mapY = (y: number) => fit(y, data.min, data.max, by, MARGIN_Y);\n+ const tickX = TIME_TICKS[data.period];\n+ const tickY = PRICE_TICKS[data.period];\n+ return svg(\n+ { width, height, \"font-family\": \"Arial\", \"font-size\": \"10px\" },\n+ group({ stroke: \"black\", fill: \"black\", \"text-anchor\": \"end\" },\n+ line([MARGIN_X, MARGIN_Y], [MARGIN_X, by]),\n+ line([MARGIN_X, by], [width - MARGIN_X, by]),\n+ ...iterator(\n+ mapcat((price: number) => {\n+ const y = mapY(price);\n+ return [\n+ line([MARGIN_X - 10, y], [MARGIN_X, y]),\n+ line([MARGIN_X, y], [width - MARGIN_X, y], { stroke: (price % 100 < 1) ? \"#666\" : \"#ccc\", \"stroke-dasharray\": 2 }),\n+ text(price.toFixed(2), [MARGIN_X - 15, y + 4], { stroke: \"none\" })\n+ ];\n+ }),\n+ range(Math.ceil(data.min / tickY) * tickY, data.max, tickY)\n+ ),\n+ ...iterator(\n+ mapcat((t: number) => {\n+ const x = fit(t, data.tbounds[0], data.tbounds[1], MARGIN_X + w / 2, width - MARGIN_X - w / 2);\n+ return [\n+ line([x, by], [x, by + 10]),\n+ line([x, MARGIN_Y], [x, by], { stroke: \"#ccc\", \"stroke-dasharray\": 2 }),\n+ text(fmtTime(t), [x, by + 20], { stroke: \"none\", \"text-anchor\": \"middle\" })\n+ ];\n+ }),\n+ range(Math.ceil(data.tbounds[0] / tickX) * tickX, data.tbounds[1], tickX)\n+ ),\n+\n+ ),\n+ polyline(\n+ data.sma12.map((y, x) => [mapX(x + 12.5), mapY(y)]),\n+ { stroke: \"#00f\", fill: \"none\" }\n+ ),\n+ polyline(\n+ data.sma24.map((y, x) => [mapX(x + 24.5), mapY(y)]),\n+ { stroke: \"#07f\", fill: \"none\" }\n+ ),\n+ polyline(\n+ data.sma50.map((y, x) => [mapX(x + 50.5), mapY(y)]),\n+ { stroke: \"#0ff\", fill: \"none\" }\n+ ),\n+ ...iterator(\n+ mapIndexed((i, candle: any) => {\n+ const isBullish = candle.open < candle.close;\n+ let y, h;\n+ let col;\n+ if (isBullish) {\n+ col = \"#6c0\";\n+ y = mapY(candle.close);\n+ h = mapY(candle.open) - y;\n+ } else {\n+ col = \"#f04\";\n+ y = mapY(candle.open);\n+ h = mapY(candle.close) - y;\n+ }\n+ return group({ fill: col, stroke: col },\n+ line([mapX(i + 0.5), mapY(candle.low)], [mapX(i + 0.5), mapY(candle.high)]),\n+ rect([mapX(i) + 1, y], w - 2, h),\n+ );\n+ }),\n+ ohlc\n+ )\n+ )\n+ })\n+});\n+\n+// stream construct to perform UI update\n+sync({\n+ src: {\n+ chart,\n+ // transform symbol stream into dropdown component\n+ symbol: symbol.transform(\n+ map((x: string) =>\n+ dropdown(\n+ null,\n+ { class: \"w4 mr3\", onchange: emitOnStream(symbol) },\n+ SYMBOL_PAIRS,\n+ x\n+ )\n+ )\n+ ),\n+ // transform period stream into dropdown component\n+ period: period.transform(\n+ map((x: string) =>\n+ dropdown(\n+ null,\n+ { class: \"w4\", onchange: emitOnStream(period) },\n+ [...pairs(TIMEFRAMES)],\n+ String(x)\n+ )\n+ )\n+ )\n+ },\n+ reset: false,\n+ xform: comp(\n+ // combines all inputs into a single root component\n+ map(({ chart, symbol, period }) =>\n+ [\"div.sans-serif\",\n+ chart,\n+ [\"div.fixed\",\n+ { style: { top: `10px`, right: `${MARGIN_X}px` } },\n+ symbol,\n+ period\n+ ]\n+ ]\n+ ),\n+ // perform hdom update / diffing\n+ scan<any, any>(\n+ reducer(\n+ () => [],\n+ (prev, curr) => {\n+ curr = normalizeTree(curr, {});\n+ diffElement(document.getElementById(\"app\"), prev, curr);\n+ return curr;\n+ }\n+ )\n+ )\n+ )\n+});\n+\n+// kick off dataflow\n+market.next(\"CCCAGG\");\n+symbol.next(\"BTCUSD\");\n+period.next(60);\n+window.dispatchEvent(new CustomEvent(\"resize\"));\n", "new_path": "examples/crypto-chart/src/index.ts", "old_path": null }, { "change_type": "ADD", "diff": "+{\n+ \"extends\": \"../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \".\"\n+ },\n+ \"include\": [\n+ \"./src/**/*.ts\"\n+ ]\n+}\n", "new_path": "examples/crypto-chart/tsconfig.json", "old_path": null }, { "change_type": "ADD", "diff": "+module.exports = {\n+ entry: \"./src/index.ts\",\n+ output: {\n+ path: __dirname,\n+ filename: \"bundle.js\"\n+ },\n+ resolve: {\n+ extensions: [\".ts\", \".js\"]\n+ },\n+ module: {\n+ rules: [\n+ { test: /\\.ts$/, use: \"ts-loader\" }\n+ ]\n+ },\n+ devServer: {\n+ contentBase: \".\"\n+ }\n+};\n", "new_path": "examples/crypto-chart/webpack.config.js", "old_path": null } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(examples): add crypto chart example
1
feat
examples
679,913
15.07.2018 16:27:53
-3,600
c95a3701826573fff7bde961d78b4143240bc57e
docs(example): add API ref link, update readme
[ { "change_type": "MODIFY", "diff": "[Live demo](http://demo.thi.ng/umbrella/crypto-chart/)\n+![chart](../../assets/crypto-chart.png)\n+\nThis example demonstrates how to use\n[@thi.ng/rstream](https://github.com/thi-ng/umbrella/tree/master/packages/rstream)\n&\n", "new_path": "examples/crypto-chart/README.md", "old_path": "examples/crypto-chart/README.md" }, { "change_type": "MODIFY", "diff": "@@ -76,6 +76,7 @@ const TIME_TICKS = {\n};\n// constructs request URL from given inputs\n+// API docs: https://min-api.cryptocompare.com/\nconst API_URL = (market, symbol, period) =>\n`https://min-api.cryptocompare.com/data/histo${TIMEFRAMES[period].toLowerCase()}?fsym=${symbol.substr(0, 3)}&tsym=${symbol.substr(3)}&limit=168&aggregate=1&e=${market}`;\n", "new_path": "examples/crypto-chart/src/index.ts", "old_path": "examples/crypto-chart/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
docs(example): add API ref link, update readme
1
docs
example
679,913
15.07.2018 16:36:54
-3,600
08a7600aac341b38821201ef75cc57878575d3d8
build(hdom-components): update dep
[ { "change_type": "MODIFY", "diff": "\"@thi.ng/api\": \"^4.0.4\",\n\"@thi.ng/checks\": \"^1.5.5\",\n\"@thi.ng/iterators\": \"^4.1.18\",\n- \"@types/webgl2\": \"^0.0.3\"\n+ \"@types/webgl2\": \"^0.0.4\"\n},\n\"keywords\": [\n\"ES6\",\n", "new_path": "packages/hdom-components/package.json", "old_path": "packages/hdom-components/package.json" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
build(hdom-components): update @types/webgl dep
1
build
hdom-components
679,913
15.07.2018 16:38:44
-3,600
24829454594a82b7766df72d56e39772f1f9ff9c
fix(resolve-map): add support for alt ES6 destructure form `{a: b}` also fixes issue w/ minimized builds
[ { "change_type": "MODIFY", "diff": "@@ -7,7 +7,7 @@ import { getIn, mutIn } from \"@thi.ng/paths\";\nconst SEMAPHORE = Symbol(\"SEMAPHORE\");\n-const RE_ARGS = /^(function\\s+\\w+)?\\s*\\(\\{([\\w\\s,]+)\\}/\n+const RE_ARGS = /^(function\\s+\\w+)?\\s*\\(\\{([\\w\\s,:]+)\\}/\nexport type ResolveFn = (path: string) => any;\n@@ -212,6 +212,7 @@ const resolveFunction = (fn: (x: any, r?: ResolveFn) => any, resolve: ResolveFn,\nconst args = match[2]\n.replace(/\\s/g, \"\")\n.split(/,/g)\n+ .map((k) => k.split(\":\")[0])\n.reduce((acc, k) => (acc[k] = resolve(k), acc), {});\nres = fn(args, resolve);\n} else {\n", "new_path": "packages/resolve-map/src/index.ts", "old_path": "packages/resolve-map/src/index.ts" }, { "change_type": "MODIFY", "diff": "@@ -73,7 +73,7 @@ describe(\"resolve-map\", () => {\nit(\"destructure\", () => {\nconst stats = {\n// sequence average\n- mean: ({ src }) => tx.reduce(tx.mean(), src),\n+ mean: ({ src: a }) => tx.reduce(tx.mean(), a),\n// sequence range\nrange: ({ min, max }) => max - min,\n// computes sequence min val\n", "new_path": "packages/resolve-map/test/index.ts", "old_path": "packages/resolve-map/test/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
fix(resolve-map): add support for alt ES6 destructure form `{a: b}` - also fixes issue w/ minimized builds
1
fix
resolve-map
679,913
15.07.2018 16:53:58
-3,600
6989b8db48caf7384827ca36f180d0eb930cabd7
docs(examples): temp fix live demo link in readme
[ { "change_type": "MODIFY", "diff": "# crypto-chart\n-[Live demo](http://demo.thi.ng/umbrella/crypto-chart/)\n+[Live demo](https://s3.amazonaws.com/demo.thi.ng/umbrella/crypto-chart/index.html)\n![chart](../../assets/crypto-chart.png)\n@@ -16,7 +16,7 @@ constructs) and the entire app largely relies on various stream\ncombinators & transformers. Furthermore, this approach only triggers UI\nupdates / diffs when there were any relevant upstream value changes.\n-```\n+```bash\ngit clone https://github.com/thi-ng/umbrella.git\ncd umbrella/examples/crypto-chart\nyarn install\n", "new_path": "examples/crypto-chart/README.md", "old_path": "examples/crypto-chart/README.md" }, { "change_type": "MODIFY", "diff": "@@ -254,6 +254,7 @@ sync({\nchart,\n[\"div.fixed\",\n{ style: { top: `10px`, right: `${MARGIN_X}px` } },\n+ [\"a.mr3\", { href: \"https://github.com/thi-ng/umbrella/tree/master/examples/crypto-chart/\" }, \"Source code\"],\nsymbol,\nperiod\n]\n", "new_path": "examples/crypto-chart/src/index.ts", "old_path": "examples/crypto-chart/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
docs(examples): temp fix live demo link in readme
1
docs
examples
679,913
15.07.2018 17:17:03
-3,600
f1e3d0819e8db62f2e0dbdb9e8444f6384df865a
docs(examples): add dataflow graph to readme
[ { "change_type": "ADD", "diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n+<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n+ \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n+<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n+ -->\n+<!-- Title: g Pages: 1 -->\n+<svg width=\"456pt\" height=\"183pt\"\n+ viewBox=\"0.00 0.00 456.02 183.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n+<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 179)\">\n+<title>g</title>\n+<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-179 452.0219,-179 452.0219,4 -4,4\"/>\n+<!-- market -->\n+<g id=\"node1\" class=\"node\">\n+<title>market</title>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"29.1703\" cy=\"-94\" rx=\"29.3416\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"29.1703\" y=\"-90.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">market</text>\n+</g>\n+<!-- data -->\n+<g id=\"node2\" class=\"node\">\n+<title>data</title>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"124.5109\" cy=\"-94\" rx=\"27\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"124.5109\" y=\"-90.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">data</text>\n+</g>\n+<!-- market&#45;&gt;data -->\n+<g id=\"edge1\" class=\"edge\">\n+<title>market&#45;&gt;data</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M58.5536,-94C67.6343,-94 77.7586,-94 87.2956,-94\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"87.3367,-97.5001 97.3367,-94 87.3366,-90.5001 87.3367,-97.5001\"/>\n+</g>\n+<!-- chart -->\n+<g id=\"node5\" class=\"node\">\n+<title>chart</title>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"217.6812\" cy=\"-94\" rx=\"27\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"217.6812\" y=\"-90.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">chart</text>\n+</g>\n+<!-- data&#45;&gt;chart -->\n+<g id=\"edge4\" class=\"edge\">\n+<title>data&#45;&gt;chart</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M151.9612,-94C160.87,-94 170.9088,-94 180.4089,-94\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"180.4272,-97.5001 190.4272,-94 180.4272,-90.5001 180.4272,-97.5001\"/>\n+</g>\n+<!-- symbol -->\n+<g id=\"node3\" class=\"node\">\n+<title>symbol</title>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"418.8515\" cy=\"-76\" rx=\"29.3416\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"418.8515\" y=\"-72.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">symbol</text>\n+</g>\n+<!-- symbol&#45;&gt;data -->\n+<g id=\"edge2\" class=\"edge\">\n+<title>symbol&#45;&gt;data</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M390.7834,-70.7562C347.408,-63.5766 261.6779,-53.0727 190.6812,-67 178.6276,-69.3645 166.0008,-73.9381 155.0469,-78.6586\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"153.5763,-75.4823 145.9077,-82.7929 156.4614,-81.8601 153.5763,-75.4823\"/>\n+</g>\n+<!-- ui -->\n+<g id=\"node7\" class=\"node\">\n+<title>ui</title>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"308.6812\" cy=\"-100\" rx=\"27\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"308.6812\" y=\"-96.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">ui</text>\n+</g>\n+<!-- symbol&#45;&gt;ui -->\n+<g id=\"edge6\" class=\"edge\">\n+<title>symbol&#45;&gt;ui</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M391.2575,-82.0112C377.1262,-85.0896 359.7491,-88.8752 344.5871,-92.1781\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"343.5371,-88.8247 334.5113,-94.3731 345.0271,-95.6643 343.5371,-88.8247\"/>\n+</g>\n+<!-- period -->\n+<g id=\"node4\" class=\"node\">\n+<title>period</title>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"418.8515\" cy=\"-157\" rx=\"29.3416\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"418.8515\" y=\"-153.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">period</text>\n+</g>\n+<!-- period&#45;&gt;data -->\n+<g id=\"edge3\" class=\"edge\">\n+<title>period&#45;&gt;data</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M389.9056,-160.3542C378.5776,-161.1389 365.4919,-161.3933 353.6812,-160 279.705,-151.2732 261.594,-143.8039 190.6812,-121 179.2866,-117.3358 167.0834,-112.5991 156.299,-108.1185\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"157.4306,-104.7967 146.8578,-104.1139 154.6972,-111.241 157.4306,-104.7967\"/>\n+</g>\n+<!-- period&#45;&gt;ui -->\n+<g id=\"edge7\" class=\"edge\">\n+<title>period&#45;&gt;ui</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M389.7654,-154.2389C378.0502,-152.2562 364.7256,-148.8504 353.6812,-143 344.5651,-138.171 335.9899,-130.9636 328.8201,-123.8232\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"331.0447,-121.0815 321.6325,-116.2173 325.957,-125.8894 331.0447,-121.0815\"/>\n+</g>\n+<!-- chart&#45;&gt;ui -->\n+<g id=\"edge8\" class=\"edge\">\n+<title>chart&#45;&gt;ui</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M244.9842,-95.8002C253.3378,-96.351 262.6711,-96.9664 271.5621,-97.5526\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"271.5025,-101.0562 281.7111,-98.2217 271.9631,-94.0713 271.5025,-101.0562\"/>\n+</g>\n+<!-- window -->\n+<g id=\"node6\" class=\"node\">\n+<title>window</title>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"124.5109\" cy=\"-18\" rx=\"29.3416\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"124.5109\" y=\"-14.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">window</text>\n+</g>\n+<!-- window&#45;&gt;chart -->\n+<g id=\"edge5\" class=\"edge\">\n+<title>window&#45;&gt;chart</title>\n+<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M142.4751,-32.6536C156.7046,-44.2607 176.7508,-60.6126 192.5689,-73.5156\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"190.4409,-76.2965 200.4022,-79.9053 194.8656,-70.8722 190.4409,-76.2965\"/>\n+<text text-anchor=\"middle\" x=\"164.9751\" y=\"-34.8945\" font-family=\"Inconsolata\" font-size=\"9.00\" fill=\"#000000\"> &#160;&#160;&#160;resize</text>\n+</g>\n+<!-- ui&#45;&gt;symbol -->\n+<g id=\"edge9\" class=\"edge\">\n+<title>ui&#45;&gt;symbol</title>\n+<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M328.034,-87.3663C335.6988,-83.0602 344.7922,-78.7759 353.6812,-76.559 361.9545,-74.4957 371.0043,-73.5988 379.6565,-73.3602\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"379.9336,-76.8602 389.9342,-73.3617 379.9347,-69.8602 379.9336,-76.8602\"/>\n+<text text-anchor=\"middle\" x=\"362.6812\" y=\"-78.241\" font-family=\"Inconsolata\" font-size=\"9.00\" fill=\"#000000\">user</text>\n+</g>\n+<!-- ui&#45;&gt;period -->\n+<g id=\"edge10\" class=\"edge\">\n+<title>ui&#45;&gt;period</title>\n+<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M330.1847,-111.1255C346.3955,-119.5127 368.8809,-131.1461 387.1515,-140.599\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"385.7761,-143.8281 396.2661,-145.3147 388.9928,-137.6109 385.7761,-143.8281\"/>\n+<text text-anchor=\"middle\" x=\"362.6812\" y=\"-133.241\" font-family=\"Inconsolata\" font-size=\"9.00\" fill=\"#000000\">user</text>\n+</g>\n+</g>\n+</svg>\n", "new_path": "assets/crypto-dflow.svg", "old_path": null }, { "change_type": "MODIFY", "diff": "@@ -16,6 +16,12 @@ constructs) and the entire app largely relies on various stream\ncombinators & transformers. Furthermore, this approach only triggers UI\nupdates / diffs when there were any relevant upstream value changes.\n+The diagram below shows a schematic of the dataflow graph used:\n+\n+![dataflow](../../assets/crypto-dflow.svg)\n+\n+## Building\n+\n```bash\ngit clone https://github.com/thi-ng/umbrella.git\ncd umbrella/examples/crypto-chart\n", "new_path": "examples/crypto-chart/README.md", "old_path": "examples/crypto-chart/README.md" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
docs(examples): add dataflow graph to readme
1
docs
examples
679,913
15.07.2018 17:21:16
-3,600
9ff8d3522d3c7915885bb52bae651776b605ae13
docs(examples): update list of demos
[ { "change_type": "MODIFY", "diff": "@@ -5,22 +5,24 @@ This directory contains a growing number of standalone example projects, includi\nIf you want to [contribute](../CONTRIBUTING.md) an example, please get in touch via PR, issue tracker, email or twitter!\n| # | Name | Description | Packages of interest | Difficulty |\n-| ---: | --- | --- | --- | --- |\n+|----|----------------------------------------------|-----------------------------------------------------|-------------------------------------------------------------------|--------------|\n| 1 | [async-effect](./async-effect) | Async side effect handling (JSON I/O) | atom, hdom, interceptors | intermediate |\n| 2 | [cellular-automata](./cellular-automata) | Transducer based, customizable 2D cellular automata | hdom, hdom-components, transducers | basic |\n-| 3 | [dashboard](./cellular-automata) | Barebones components w/ local state | hdom, transducers | basic |\n-| 4 | [devcards](./devcards) | multiple app instances with/without shared state | atom, hdom | intermediate |\n-| 5 | [hdom-basics](./hdom-basics) | hello world | hdom, hiccup | basic |\n-| 6 | [hdom-benchmark](./hdom-benchmark) | hdom rendering perf / stress test, canvas FPS counter | hdom, rstream, transducers | intermediate |\n-| 7 | [hdom-theme-adr-0003](./hdom-theme-adr-0003) | hdom themed components proposal | hdom | intermediate |\n-| 8 | [interceptor-basics](./hdom-benchmark) | event handling w/ interceptors and side effects | atom, hdom, interceptors | intermediate |\n-| 9 | [json-components](./json-components) | JSON->component transformation, live editor | hdom, transducers | intermediate |\n-| 10 | [login-form](./login-form) | basic SPA without router | atom, hdom | intermediate |\n-| 11 | [pointfree-svg](./pointfree-svg) | generate SVG using pointfree DSL | hiccup, hiccup-svg, pointfree-lang | intermediate |\n-| 12 | [router-basics](./router-basics) | complete mini SPA | atom, hdom, interceptors, router | advanced |\n-| 13 | [rstream-dataflow](./rstream-dataflow) | dataflow graph | atom, hdom, rstream, rstream-gestures, rstream-graph, transducers | intermediate |\n-| 14 | [rstream-grid](./rstream-grid) | dataflow graph svg gen | atom, hdom, hiccup-svg, interceptors, rstream-graph, transducers | advanced |\n-| 15 | [svg-particles](./svg-particles) | hdom SVG generation / animation | hdom, transducers | basic |\n-| 16 | [svg-waveform](./svg-waveform) | hdom SVG generation / undo history | atom, hdom, hiccup-svg, interceptors, iterators | intermediate |\n-| 17 | [todo-list](./todo-list) | Canonical Todo list with undo/redo | atom, hdom, transducers | intermediate |\n-| 18 | [webgl](./webgl) | Canvas component handling | hdom, hdom-components | basic |\n+| 3 | [crypto-chart](./crypto-chart) | Interactive rstream & transducer based SVG chart | hdom, hiccup-svg, rstream, transducers | advanced |\n+| 4 | [dashboard](./cellular-automata) | Barebones components w/ local state | hdom, transducers | basic |\n+| 5 | [devcards](./devcards) | Multiple app instances with/without shared state | atom, hdom | intermediate |\n+| 6 | [hdom-basics](./hdom-basics) | Hello world | hdom, hiccup | basic |\n+| 7 | [hdom-benchmark](./hdom-benchmark) | hdom rendering perf / stress test, FPS counter | hdom, rstream, transducers | intermediate |\n+| 8 | [hdom-theme-adr-0003](./hdom-theme-adr-0003) | hdom themed components proposal | hdom | intermediate |\n+| 9 | [interceptor-basics](./hdom-benchmark) | Event handling w/ interceptors and side effects | atom, hdom, interceptors | intermediate |\n+| 10 | [json-components](./json-components) | JSON->component transformation, live editor | hdom, transducers | intermediate |\n+| 11 | [login-form](./login-form) | Basic SPA without router | atom, hdom | intermediate |\n+| 12 | [pointfree-svg](./pointfree-svg) | Generate SVG using pointfree DSL | hiccup, hiccup-svg, pointfree-lang | intermediate |\n+| 13 | [router-basics](./router-basics) | Complete mini SPA | atom, hdom, interceptors, router | advanced |\n+| 14 | [rstream-dataflow](./rstream-dataflow) | Dataflow graph | atom, hdom, rstream, rstream-gestures, rstream-graph, transducers | intermediate |\n+| 15 | [rstream-grid](./rstream-grid) | Dataflow graph SVG grid | atom, hdom, hiccup-svg, interceptors, rstream-graph, transducers | advanced |\n+| 16 | [rstream-hdom](./rstream-hdom) | rstream based UI updates | hdom, rstream, transducers | intermediate |\n+| 17 | [svg-particles](./svg-particles) | hdom SVG generation / animation | hdom, transducers | basic |\n+| 18 | [svg-waveform](./svg-waveform) | hdom SVG generation / undo history | atom, hdom, hiccup-svg, interceptors, iterators | intermediate |\n+| 19 | [todo-list](./todo-list) | Canonical Todo list with undo/redo | atom, hdom, transducers | intermediate |\n+| 20 | [webgl](./webgl) | Canvas component handling | hdom, hdom-components | basic |\n", "new_path": "examples/README.md", "old_path": "examples/README.md" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
docs(examples): update list of demos
1
docs
examples
679,913
15.07.2018 21:30:48
-3,600
7cd78e037e4c4fbc3bc306b07218906d7c94b31c
feat(examples): add theme support for crypto chart, update diagram
[ { "change_type": "MODIFY", "diff": "<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n-->\n<!-- Title: g Pages: 1 -->\n-<svg width=\"456pt\" height=\"183pt\"\n- viewBox=\"0.00 0.00 456.02 183.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n-<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 179)\">\n+<svg width=\"482pt\" height=\"230pt\"\n+ viewBox=\"0.00 0.00 482.02 230.01\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n+<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 226.0136)\">\n<title>g</title>\n-<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-179 452.0219,-179 452.0219,4 -4,4\"/>\n+<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-226.0136 478.0219,-226.0136 478.0219,4 -4,4\"/>\n<!-- market -->\n<g id=\"node1\" class=\"node\">\n<title>market</title>\n-<ellipse fill=\"none\" stroke=\"#000000\" cx=\"29.1703\" cy=\"-94\" rx=\"29.3416\" ry=\"18\"/>\n-<text text-anchor=\"middle\" x=\"29.1703\" y=\"-90.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">market</text>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"29.1703\" cy=\"-189\" rx=\"29.3416\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"29.1703\" y=\"-185.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">market</text>\n</g>\n<!-- data -->\n<g id=\"node2\" class=\"node\">\n<title>data</title>\n-<ellipse fill=\"none\" stroke=\"#000000\" cx=\"124.5109\" cy=\"-94\" rx=\"27\" ry=\"18\"/>\n-<text text-anchor=\"middle\" x=\"124.5109\" y=\"-90.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">data</text>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"124.5109\" cy=\"-189\" rx=\"27\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"124.5109\" y=\"-185.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">data</text>\n</g>\n<!-- market&#45;&gt;data -->\n<g id=\"edge1\" class=\"edge\">\n<title>market&#45;&gt;data</title>\n-<path fill=\"none\" stroke=\"#000000\" d=\"M58.5536,-94C67.6343,-94 77.7586,-94 87.2956,-94\"/>\n-<polygon fill=\"#000000\" stroke=\"#000000\" points=\"87.3367,-97.5001 97.3367,-94 87.3366,-90.5001 87.3367,-97.5001\"/>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M58.5536,-189C67.6343,-189 77.7586,-189 87.2956,-189\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"87.3367,-192.5001 97.3367,-189 87.3366,-185.5001 87.3367,-192.5001\"/>\n</g>\n<!-- chart -->\n<g id=\"node5\" class=\"node\">\n<title>chart</title>\n-<ellipse fill=\"none\" stroke=\"#000000\" cx=\"217.6812\" cy=\"-94\" rx=\"27\" ry=\"18\"/>\n-<text text-anchor=\"middle\" x=\"217.6812\" y=\"-90.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">chart</text>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"243.6812\" cy=\"-95\" rx=\"27\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"243.6812\" y=\"-91.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">chart</text>\n</g>\n<!-- data&#45;&gt;chart -->\n<g id=\"edge4\" class=\"edge\">\n<title>data&#45;&gt;chart</title>\n-<path fill=\"none\" stroke=\"#000000\" d=\"M151.9612,-94C160.87,-94 170.9088,-94 180.4089,-94\"/>\n-<polygon fill=\"#000000\" stroke=\"#000000\" points=\"180.4272,-97.5001 190.4272,-94 180.4272,-90.5001 180.4272,-97.5001\"/>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M142.0949,-175.13C162.1617,-159.3016 195.1595,-133.2733 218.0795,-115.1943\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"220.3412,-117.8681 226.0251,-108.9269 216.006,-112.3721 220.3412,-117.8681\"/>\n</g>\n<!-- symbol -->\n<g id=\"node3\" class=\"node\">\n<title>symbol</title>\n-<ellipse fill=\"none\" stroke=\"#000000\" cx=\"418.8515\" cy=\"-76\" rx=\"29.3416\" ry=\"18\"/>\n-<text text-anchor=\"middle\" x=\"418.8515\" y=\"-72.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">symbol</text>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"444.8515\" cy=\"-164\" rx=\"29.3416\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"444.8515\" y=\"-160.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">symbol</text>\n</g>\n<!-- symbol&#45;&gt;data -->\n<g id=\"edge2\" class=\"edge\">\n<title>symbol&#45;&gt;data</title>\n-<path fill=\"none\" stroke=\"#000000\" d=\"M390.7834,-70.7562C347.408,-63.5766 261.6779,-53.0727 190.6812,-67 178.6276,-69.3645 166.0008,-73.9381 155.0469,-78.6586\"/>\n-<polygon fill=\"#000000\" stroke=\"#000000\" points=\"153.5763,-75.4823 145.9077,-82.7929 156.4614,-81.8601 153.5763,-75.4823\"/>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M430.8646,-180.046C422.2715,-188.6446 410.4789,-198.3946 397.6812,-203 303.1701,-237.0109 271.0824,-217.4397 171.6812,-203 167.4016,-202.3783 162.9699,-201.455 158.6137,-200.3737\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"159.2642,-196.9223 148.6931,-197.6315 157.3991,-203.6693 159.2642,-196.9223\"/>\n</g>\n<!-- ui -->\n-<g id=\"node7\" class=\"node\">\n+<g id=\"node8\" class=\"node\">\n<title>ui</title>\n-<ellipse fill=\"none\" stroke=\"#000000\" cx=\"308.6812\" cy=\"-100\" rx=\"27\" ry=\"18\"/>\n-<text text-anchor=\"middle\" x=\"308.6812\" y=\"-96.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">ui</text>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"334.6812\" cy=\"-95\" rx=\"27\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"334.6812\" y=\"-91.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">ui</text>\n</g>\n<!-- symbol&#45;&gt;ui -->\n-<g id=\"edge6\" class=\"edge\">\n+<g id=\"edge7\" class=\"edge\">\n<title>symbol&#45;&gt;ui</title>\n-<path fill=\"none\" stroke=\"#000000\" d=\"M391.2575,-82.0112C377.1262,-85.0896 359.7491,-88.8752 344.5871,-92.1781\"/>\n-<polygon fill=\"#000000\" stroke=\"#000000\" points=\"343.5371,-88.8247 334.5113,-94.3731 345.0271,-95.6643 343.5371,-88.8247\"/>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M415.7126,-161.957C403.8585,-160.0893 390.4459,-156.5752 379.6812,-150 367.8365,-142.765 357.7118,-131.2674 350.0829,-120.6507\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"352.7747,-118.3827 344.2786,-112.0529 346.973,-122.2994 352.7747,-118.3827\"/>\n</g>\n<!-- period -->\n<g id=\"node4\" class=\"node\">\n<title>period</title>\n-<ellipse fill=\"none\" stroke=\"#000000\" cx=\"418.8515\" cy=\"-157\" rx=\"29.3416\" ry=\"18\"/>\n-<text text-anchor=\"middle\" x=\"418.8515\" y=\"-153.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">period</text>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"444.8515\" cy=\"-107\" rx=\"29.3416\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"444.8515\" y=\"-103.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">period</text>\n</g>\n<!-- period&#45;&gt;data -->\n<g id=\"edge3\" class=\"edge\">\n<title>period&#45;&gt;data</title>\n-<path fill=\"none\" stroke=\"#000000\" d=\"M389.9056,-160.3542C378.5776,-161.1389 365.4919,-161.3933 353.6812,-160 279.705,-151.2732 261.594,-143.8039 190.6812,-121 179.2866,-117.3358 167.0834,-112.5991 156.299,-108.1185\"/>\n-<polygon fill=\"#000000\" stroke=\"#000000\" points=\"157.4306,-104.7967 146.8578,-104.1139 154.6972,-111.241 157.4306,-104.7967\"/>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M430.6447,-122.7223C421.9782,-131.2964 410.1856,-141.2964 397.6812,-147 319.3056,-182.7496 216.5099,-189.0134 162.0916,-189.5657\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"161.8603,-186.0665 151.8746,-189.607 161.8887,-193.0664 161.8603,-186.0665\"/>\n</g>\n<!-- period&#45;&gt;ui -->\n-<g id=\"edge7\" class=\"edge\">\n+<g id=\"edge8\" class=\"edge\">\n<title>period&#45;&gt;ui</title>\n-<path fill=\"none\" stroke=\"#000000\" d=\"M389.7654,-154.2389C378.0502,-152.2562 364.7256,-148.8504 353.6812,-143 344.5651,-138.171 335.9899,-130.9636 328.8201,-123.8232\"/>\n-<polygon fill=\"#000000\" stroke=\"#000000\" points=\"331.0447,-121.0815 321.6325,-116.2173 325.957,-125.8894 331.0447,-121.0815\"/>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M416.1124,-103.8697C402.4885,-102.3857 386.0522,-100.5954 371.5242,-99.013\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"371.6706,-95.5083 361.3504,-97.9049 370.9126,-102.4672 371.6706,-95.5083\"/>\n</g>\n<!-- chart&#45;&gt;ui -->\n-<g id=\"edge8\" class=\"edge\">\n+<g id=\"edge9\" class=\"edge\">\n<title>chart&#45;&gt;ui</title>\n-<path fill=\"none\" stroke=\"#000000\" d=\"M244.9842,-95.8002C253.3378,-96.351 262.6711,-96.9664 271.5621,-97.5526\"/>\n-<polygon fill=\"#000000\" stroke=\"#000000\" points=\"271.5025,-101.0562 281.7111,-98.2217 271.9631,-94.0713 271.5025,-101.0562\"/>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M270.9842,-95C279.2625,-95 288.503,-95 297.3217,-95\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"297.3975,-98.5001 307.3975,-95 297.3975,-91.5001 297.3975,-98.5001\"/>\n</g>\n<!-- window -->\n<g id=\"node6\" class=\"node\">\n<title>window</title>\n-<ellipse fill=\"none\" stroke=\"#000000\" cx=\"124.5109\" cy=\"-18\" rx=\"29.3416\" ry=\"18\"/>\n-<text text-anchor=\"middle\" x=\"124.5109\" y=\"-14.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">window</text>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"124.5109\" cy=\"-95\" rx=\"29.3416\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"124.5109\" y=\"-91.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">window</text>\n</g>\n<!-- window&#45;&gt;chart -->\n<g id=\"edge5\" class=\"edge\">\n<title>window&#45;&gt;chart</title>\n-<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M142.4751,-32.6536C156.7046,-44.2607 176.7508,-60.6126 192.5689,-73.5156\"/>\n-<polygon fill=\"#000000\" stroke=\"#000000\" points=\"190.4409,-76.2965 200.4022,-79.9053 194.8656,-70.8722 190.4409,-76.2965\"/>\n-<text text-anchor=\"middle\" x=\"164.9751\" y=\"-34.8945\" font-family=\"Inconsolata\" font-size=\"9.00\" fill=\"#000000\"> &#160;&#160;&#160;resize</text>\n+<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M153.9688,-95C169.8367,-95 189.5729,-95 206.4905,-95\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"206.6001,-98.5001 216.6001,-95 206.6,-91.5001 206.6001,-98.5001\"/>\n+<text text-anchor=\"middle\" x=\"185.1812\" y=\"-97.241\" font-family=\"Inconsolata\" font-size=\"9.00\" fill=\"#000000\">resize</text>\n+</g>\n+<!-- theme -->\n+<g id=\"node7\" class=\"node\">\n+<title>theme</title>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"444.8515\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"444.8515\" y=\"-14.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">theme</text>\n+</g>\n+<!-- theme&#45;&gt;chart -->\n+<g id=\"edge6\" class=\"edge\">\n+<title>theme&#45;&gt;chart</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M417.7865,-16.543C405.9011,-16.5896 391.8997,-17.59 379.6812,-21 338.7416,-32.4255 296.4897,-57.9693 270.166,-75.8311\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"268.1102,-72.9973 261.8743,-81.5626 272.0906,-78.7555 268.1102,-72.9973\"/>\n+</g>\n+<!-- theme&#45;&gt;ui -->\n+<g id=\"edge10\" class=\"edge\">\n+<title>theme&#45;&gt;ui</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M417.765,-19.3701C405.3348,-21.0659 390.902,-24.6312 379.6812,-32 366.0297,-40.965 355.1996,-55.6126 347.588,-68.5287\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"344.392,-67.0759 342.6201,-77.5216 350.5193,-70.4608 344.392,-67.0759\"/>\n</g>\n<!-- ui&#45;&gt;symbol -->\n-<g id=\"edge9\" class=\"edge\">\n+<g id=\"edge11\" class=\"edge\">\n<title>ui&#45;&gt;symbol</title>\n-<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M328.034,-87.3663C335.6988,-83.0602 344.7922,-78.7759 353.6812,-76.559 361.9545,-74.4957 371.0043,-73.5988 379.6565,-73.3602\"/>\n-<polygon fill=\"#000000\" stroke=\"#000000\" points=\"379.9336,-76.8602 389.9342,-73.3617 379.9347,-69.8602 379.9336,-76.8602\"/>\n-<text text-anchor=\"middle\" x=\"362.6812\" y=\"-78.241\" font-family=\"Inconsolata\" font-size=\"9.00\" fill=\"#000000\">user</text>\n+<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M354.3775,-107.3358C371.3684,-117.9773 396.1491,-133.4975 415.4816,-145.6055\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"413.8713,-148.7267 424.2041,-151.0684 417.5869,-142.7942 413.8713,-148.7267\"/>\n+<text text-anchor=\"middle\" x=\"388.6812\" y=\"-136.241\" font-family=\"Inconsolata\" font-size=\"9.00\" fill=\"#000000\">user</text>\n</g>\n<!-- ui&#45;&gt;period -->\n-<g id=\"edge10\" class=\"edge\">\n+<g id=\"edge12\" class=\"edge\">\n<title>ui&#45;&gt;period</title>\n-<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M330.1847,-111.1255C346.3955,-119.5127 368.8809,-131.1461 387.1515,-140.599\"/>\n-<polygon fill=\"#000000\" stroke=\"#000000\" points=\"385.7761,-143.8281 396.2661,-145.3147 388.9928,-137.6109 385.7761,-143.8281\"/>\n-<text text-anchor=\"middle\" x=\"362.6812\" y=\"-133.241\" font-family=\"Inconsolata\" font-size=\"9.00\" fill=\"#000000\">user</text>\n+<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M359.6547,-87.7938C371.2798,-85.4241 385.255,-83.9824 397.6812,-86.559 402.7937,-87.6191 408.0328,-89.2621 413.0737,-91.1663\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"411.8608,-94.4525 422.4379,-95.0653 414.5515,-87.9903 411.8608,-94.4525\"/>\n+<text text-anchor=\"middle\" x=\"388.6812\" y=\"-89.241\" font-family=\"Inconsolata\" font-size=\"9.00\" fill=\"#000000\">user</text>\n+</g>\n+<!-- ui&#45;&gt;theme -->\n+<g id=\"edge13\" class=\"edge\">\n+<title>ui&#45;&gt;theme</title>\n+<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M353.3701,-81.938C371.0176,-69.6039 397.6858,-50.965 417.6826,-36.9888\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"419.8795,-39.7236 426.071,-31.1261 415.8694,-33.986 419.8795,-39.7236\"/>\n+<text text-anchor=\"middle\" x=\"388.6812\" y=\"-66.241\" font-family=\"Inconsolata\" font-size=\"9.00\" fill=\"#000000\">user</text>\n</g>\n</g>\n</svg>\n", "new_path": "assets/crypto-dflow.svg", "old_path": "assets/crypto-dflow.svg" }, { "change_type": "MODIFY", "diff": "-import { diffElement, normalizeTree } from \"@thi.ng/hdom\";\n-import { dropdown, DropDownOption } from \"@thi.ng/hdom-components\";\n-import {\n- group,\n- line,\n- polyline,\n- rect,\n- svg,\n- text\n-} from \"@thi.ng/hiccup-svg\";\n+import { dropdown, DropDownOption } from \"@thi.ng/hdom-components/dropdown\";\n+import { diffElement } from \"@thi.ng/hdom/diff\";\n+import { normalizeTree } from \"@thi.ng/hdom/normalize\";\n+import { group } from \"@thi.ng/hiccup-svg/group\";\n+import { line } from \"@thi.ng/hiccup-svg/line\";\n+import { polyline } from \"@thi.ng/hiccup-svg/polyline\";\n+import { rect } from \"@thi.ng/hiccup-svg/rect\";\n+import { svg } from \"@thi.ng/hiccup-svg/svg\";\n+import { text } from \"@thi.ng/hiccup-svg/text\";\nimport { resolve } from \"@thi.ng/resolve-map\";\n-import {\n- comp,\n- filter,\n- iterator,\n- map,\n- mapcat,\n- mapIndexed,\n- max,\n- min,\n- movingAverage,\n- pairs,\n- pluck,\n- push,\n- range,\n- reducer,\n- scan,\n- transduce\n-} from \"@thi.ng/transducers\";\n-import {\n- fromEvent,\n- resolve as resolvePromise,\n- Stream,\n- sync,\n-} from \"@thi.ng/rstream\";\n+import { fromEvent } from \"@thi.ng/rstream/from/event\";\n+import { Stream } from \"@thi.ng/rstream/stream\";\n+import { sync } from \"@thi.ng/rstream/stream-sync\";\n+import { resolve as resolvePromise } from \"@thi.ng/rstream/subs/resolve\";\n+import { comp } from \"@thi.ng/transducers/func/comp\";\n+import { pairs } from \"@thi.ng/transducers/iter/pairs\";\n+import { range } from \"@thi.ng/transducers/iter/range\";\n+import { iterator } from \"@thi.ng/transducers/iterator\";\n+import { reducer } from \"@thi.ng/transducers/reduce\";\n+import { max } from \"@thi.ng/transducers/rfn/max\";\n+import { min } from \"@thi.ng/transducers/rfn/min\";\n+import { push } from \"@thi.ng/transducers/rfn/push\";\n+import { transduce } from \"@thi.ng/transducers/transduce\";\n+import { filter } from \"@thi.ng/transducers/xform/filter\";\n+import { map } from \"@thi.ng/transducers/xform/map\";\n+import { mapIndexed } from \"@thi.ng/transducers/xform/map-indexed\";\n+import { mapcat } from \"@thi.ng/transducers/xform/mapcat\";\n+import { movingAverage } from \"@thi.ng/transducers/xform/moving-average\";\n+import { pluck } from \"@thi.ng/transducers/xform/pluck\";\n+import { scan } from \"@thi.ng/transducers/xform/scan\";\n// this example demonstrates how to use @thi.ng/rstream &\n// @thi.ng/transducer constructs to create a basic cryptocurrency candle\n@@ -63,18 +58,48 @@ const MARGIN_X = 60;\nconst MARGIN_Y = 50;\nconst DAY = 60 * 60 * 24;\n-const PRICE_TICKS = {\n- 1: 25,\n- 60: 50,\n- 1440: 250\n-};\n-\nconst TIME_TICKS = {\n1: 15 * 60,\n60: DAY,\n1440: DAY * 7\n};\n+// UI theme presets\n+const THEMES = {\n+ light: {\n+ id: \"light\",\n+ bg: \"white\",\n+ body: \"black\",\n+ chart: {\n+ axis: \"#000\",\n+ price: \"#333\",\n+ bull: \"#6c0\",\n+ bear: \"#f04\",\n+ sma12: \"#00f\",\n+ sma24: \"#07f\",\n+ sma50: \"#0ff\",\n+ gridMajor: \"#666\",\n+ gridMinor: \"#ccc\",\n+ }\n+ },\n+ dark: {\n+ id: \"dark\",\n+ bg: \"black\",\n+ body: \"white\",\n+ chart: {\n+ axis: \"#eee\",\n+ price: \"#09f\",\n+ bull: \"#6c0\",\n+ bear: \"#f04\",\n+ sma12: \"#ff0\",\n+ sma24: \"#f70\",\n+ sma50: \"#f07\",\n+ gridMajor: \"#666\",\n+ gridMinor: \"#333\",\n+ }\n+ },\n+};\n+\n// constructs request URL from given inputs\n// API docs: https://min-api.cryptocompare.com/\nconst API_URL = (market, symbol, period) =>\n@@ -89,7 +114,6 @@ const fit = (x, a, b, c, d) => c + (d - c) * clamp((x - a) / (b - a), 0, 1);\nconst fmtTime = (t: number) => {\nconst d = new Date(t * 1000);\n- console.log(d);\nreturn `${d.getUTCFullYear()}-${d.getUTCMonth() + 1}-${d.getUTCDate()}`;\n};\n@@ -100,6 +124,7 @@ const emitOnStream = (stream) => (e) => stream.next(e.target.value);\nconst market = new Stream();\nconst symbol = new Stream();\nconst period = new Stream();\n+const theme = new Stream().transform(map((id: string) => THEMES[id]));\nconst error = new Stream();\n// I/O error handler\n@@ -136,75 +161,86 @@ const data = sync({\n);\n// this stream combinator (re)computes the SVG chart\n+// updates whenever data, theme or window size has changed\nconst chart = sync({\nsrc: {\ndata,\n+ theme,\nwindow: fromEvent(window, \"resize\").transform(\nmap(() => [window.innerWidth, window.innerHeight])\n)\n},\nreset: false,\n- xform: map(({ data, window }) => {\n+ xform: map(({ data, window, theme }) => {\nlet [width, height] = window;\nconst ohlc = data.ohlc;\nconst w = (width - MARGIN_X) / ohlc.length;\nconst by = height - MARGIN_Y;\n+\nconst mapX = (x: number) => fit(x, 0, ohlc.length, MARGIN_X, width - MARGIN_X);\nconst mapY = (y: number) => fit(y, data.min, data.max, by, MARGIN_Y);\n+ const sma = (data: number[], smaPeriod: number, col: string) =>\n+ polyline(data.map((y, x) => [mapX(x + smaPeriod + 0.5), mapY(y)]), { stroke: col, fill: \"none\" });\n+\n+ // use preset time precisions based on current chart period\nconst tickX = TIME_TICKS[data.period];\n- const tickY = PRICE_TICKS[data.period];\n+ // price resolution estimation based on actual OHLC interval\n+ const tickY = Math.pow(10, Math.floor(Math.log(Math.round(data.max - data.min)) / Math.log(10))) / 2;\n+ const lastPrice = ohlc[ohlc.length - 1].close;\n+ const closeY = mapY(lastPrice);\n+ // inline definition of SVG chart\nreturn svg(\n{ width, height, \"font-family\": \"Arial\", \"font-size\": \"10px\" },\n- group({ stroke: \"black\", fill: \"black\", \"text-anchor\": \"end\" },\n+ // XY axes incl. tick markers & labels\n+ group({ stroke: theme.chart.axis, fill: theme.chart.axis, \"text-anchor\": \"end\" },\nline([MARGIN_X, MARGIN_Y], [MARGIN_X, by]),\nline([MARGIN_X, by], [width - MARGIN_X, by]),\n+ // Y axis ticks\n...iterator(\nmapcat((price: number) => {\nconst y = mapY(price);\nreturn [\nline([MARGIN_X - 10, y], [MARGIN_X, y]),\n- line([MARGIN_X, y], [width - MARGIN_X, y], { stroke: (price % 100 < 1) ? \"#666\" : \"#ccc\", \"stroke-dasharray\": 2 }),\n+ line([MARGIN_X, y], [width - MARGIN_X, y], {\n+ stroke: (price % 100 < 1) ?\n+ theme.chart.gridMajor :\n+ theme.chart.gridMinor,\n+ \"stroke-dasharray\": 2\n+ }),\ntext(price.toFixed(2), [MARGIN_X - 15, y + 4], { stroke: \"none\" })\n];\n}),\nrange(Math.ceil(data.min / tickY) * tickY, data.max, tickY)\n),\n+ // X axis ticks\n...iterator(\nmapcat((t: number) => {\nconst x = fit(t, data.tbounds[0], data.tbounds[1], MARGIN_X + w / 2, width - MARGIN_X - w / 2);\nreturn [\nline([x, by], [x, by + 10]),\n- line([x, MARGIN_Y], [x, by], { stroke: \"#ccc\", \"stroke-dasharray\": 2 }),\n+ line([x, MARGIN_Y], [x, by], { stroke: theme.chart.gridMinor, \"stroke-dasharray\": 2 }),\ntext(fmtTime(t), [x, by + 20], { stroke: \"none\", \"text-anchor\": \"middle\" })\n];\n}),\nrange(Math.ceil(data.tbounds[0] / tickX) * tickX, data.tbounds[1], tickX)\n),\n-\n- ),\n- polyline(\n- data.sma12.map((y, x) => [mapX(x + 12.5), mapY(y)]),\n- { stroke: \"#00f\", fill: \"none\" }\n- ),\n- polyline(\n- data.sma24.map((y, x) => [mapX(x + 24.5), mapY(y)]),\n- { stroke: \"#07f\", fill: \"none\" }\n- ),\n- polyline(\n- data.sma50.map((y, x) => [mapX(x + 50.5), mapY(y)]),\n- { stroke: \"#0ff\", fill: \"none\" }\n),\n+ // moving averages\n+ sma(data.sma12, 12, theme.chart.sma12),\n+ sma(data.sma24, 24, theme.chart.sma24),\n+ sma(data.sma50, 50, theme.chart.sma50),\n+ // candles\n...iterator(\nmapIndexed((i, candle: any) => {\nconst isBullish = candle.open < candle.close;\nlet y, h;\nlet col;\nif (isBullish) {\n- col = \"#6c0\";\n+ col = theme.chart.bull;\ny = mapY(candle.close);\nh = mapY(candle.open) - y;\n} else {\n- col = \"#f04\";\n+ col = theme.chart.bear;\ny = mapY(candle.open);\nh = mapY(candle.close) - y;\n}\n@@ -214,7 +250,10 @@ const chart = sync({\n);\n}),\nohlc\n- )\n+ ),\n+ // price line\n+ line([MARGIN_X, closeY], [width - MARGIN_X, closeY], { stroke: theme.chart.price }),\n+ text(lastPrice.toFixed(2), [width - MARGIN_X + 5, closeY + 4], { fill: theme.chart.price }),\n)\n})\n});\n@@ -223,6 +262,7 @@ const chart = sync({\nsync({\nsrc: {\nchart,\n+ theme,\n// transform symbol stream into dropdown component\nsymbol: symbol.transform(\nmap((x: string) =>\n@@ -239,24 +279,41 @@ sync({\nmap((x: string) =>\ndropdown(\nnull,\n- { class: \"w4\", onchange: emitOnStream(period) },\n+ { class: \"w4 mr3\", onchange: emitOnStream(period) },\n[...pairs(TIMEFRAMES)],\nString(x)\n)\n)\n+ ),\n+ themeSel: theme.transform(\n+ map((sel) =>\n+ dropdown(\n+ null,\n+ { class: \"w4\", onchange: emitOnStream(theme) },\n+ Object.keys(THEMES).map((k) => <DropDownOption>[k, k + \" theme\"]),\n+ sel.id\n+ )\n+ )\n)\n},\nreset: false,\nxform: comp(\n// combines all inputs into a single root component\n- map(({ chart, symbol, period }) =>\n- [\"div.sans-serif\",\n+ map(({ theme, themeSel, chart, symbol, period }) =>\n+ [\"div\",\n+ { class: `sans-serif bg-${theme.bg} ${theme.body}` },\nchart,\n- [\"div.fixed\",\n+ [\"div.fixed.f7\",\n{ style: { top: `10px`, right: `${MARGIN_X}px` } },\n- [\"a.mr3\", { href: \"https://github.com/thi-ng/umbrella/tree/master/examples/crypto-chart/\" }, \"Source code\"],\n+ \"Made with @thi.ng/umbrella / \",\n+ [\"a\",\n+ {\n+ class: `mr3 b link ${theme.body}`,\n+ href: \"https://github.com/thi-ng/umbrella/tree/master/examples/crypto-chart/\"\n+ }, \"Source code\"],\nsymbol,\n- period\n+ period,\n+ themeSel,\n]\n]\n),\n@@ -278,4 +335,6 @@ sync({\nmarket.next(\"CCCAGG\");\nsymbol.next(\"BTCUSD\");\nperiod.next(60);\n+theme.next(\"dark\");\n+\nwindow.dispatchEvent(new CustomEvent(\"resize\"));\n", "new_path": "examples/crypto-chart/src/index.ts", "old_path": "examples/crypto-chart/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(examples): add theme support for crypto chart, update diagram
1
feat
examples
807,849
16.07.2018 10:13:37
25,200
7082312e20eeaf778b112ffa7abb3aeade1850a1
docs: Point command links to #readme hash [skip ci]
[ { "change_type": "MODIFY", "diff": "* [How It Works](#how-it-works)\n* [Troubleshooting](#troubleshooting)\n* Commands\n- - [publish](./commands/publish)\n- - [bootstrap](./commands/bootstrap)\n- - [list](./commands/list)\n- - [changed](./commands/changed)\n- - [diff](./commands/diff)\n- - [exec](./commands/exec)\n- - [run](./commands/run)\n- - [init](./commands/init)\n- - [add](./commands/add)\n- - [clean](./commands/clean)\n- - [import](./commands/import)\n- - [link](./commands/link)\n+ - [`lerna publish`](./commands/publish#readme)\n+ - [`lerna bootstrap`](./commands/bootstrap#readme)\n+ - [`lerna list`](./commands/list#readme)\n+ - [`lerna changed`](./commands/changed#readme)\n+ - [`lerna diff`](./commands/diff#readme)\n+ - [`lerna exec`](./commands/exec#readme)\n+ - [`lerna run`](./commands/run#readme)\n+ - [`lerna init`](./commands/init#readme)\n+ - [`lerna add`](./commands/add#readme)\n+ - [`lerna clean`](./commands/clean#readme)\n+ - [`lerna import`](./commands/import#readme)\n+ - [`lerna link`](./commands/link#readme)\n* [Concepts](#concepts)\n* [Lerna.json](#lernajson)\n* [Global Flags](./core/global-options)\n", "new_path": "README.md", "old_path": "README.md" } ]
JavaScript
MIT License
lerna/lerna
docs: Point command links to #readme hash [skip ci]
1
docs
null
807,849
16.07.2018 10:15:17
25,200
6128989f43a0208a983b6fafb2963323528a74f1
docs: Edit command options, tweaking format and inverting some entries [skip ci]
[ { "change_type": "MODIFY", "diff": "## Usage\n-\n```sh\n$ lerna add <package>[@version] [--dev]\n```\n@@ -16,13 +15,28 @@ When run, this command will:\n1. Add `package` to each applicable package. Applicable are packages that are not `package` and are in scope\n2. Bootstrap packages with changes to their manifest file (`package.json`)\n+If no `version` specifier is provided, it defaults to the `latest` dist-tag, just like `npm install`.\n+\n+## Options\n+\n`lerna add` respects the `--ignore`, `--scope` and `--include-filtered-dependencies` flags (see [Filter Flags](https://www.npmjs.com/package/@lerna/filter-options)).\n+### `--dev`\n+\n+Add the new package to `devDependencies` instead of `dependencies`.\n+\n## Examples\n-```\n-lerna add module-1 --scope=module-2 # Install module-1 to module-2\n-lerna add module-1 --scope=module-2 --dev # Install module-1 to module-2 in devDependencies\n-lerna add module-1 # Install module-1 in all modules except module-1\n-lerna add babel-core # Install babel-core in all modules\n+```sh\n+# Install module-1 to module-2\n+lerna add module-1 --scope=module-2\n+\n+# Install module-1 to module-2 in devDependencies\n+lerna add module-1 --scope=module-2 --dev\n+\n+# Install module-1 in all modules except module-1\n+lerna add module-1\n+\n+# Install babel-core in all modules\n+lerna add babel-core\n```\n", "new_path": "commands/add/README.md", "old_path": "commands/add/README.md" }, { "change_type": "MODIFY", "diff": "@@ -87,7 +87,9 @@ The `--ignore` flag, when used with the `bootstrap` command, can also be set in\n> Hint: The glob is matched against the package name defined in `package.json`,\n> not the directory name the package lives in.\n-### --ignore-scripts\n+## Options\n+\n+### `--ignore-scripts`\nSkip any lifecycle scripts normally run (`prepare`, etc) in bootstrapped packages.\n@@ -95,7 +97,7 @@ Skip any lifecycle scripts normally run (`prepare`, etc) in bootstrapped package\n$ lerna bootstrap --ignore-scripts\n```\n-#### --registry [registry]\n+### `--registry <url>`\nWhen run with this flag, forwarded npm commands will use the specified registry for your package(s).\n@@ -103,9 +105,10 @@ This is useful if you do not want to explicitly set up your registry\nconfiguration in all of your package.json files individually when e.g. using\nprivate registries.\n-### --npm-client [client]\n+### `--npm-client <client>`\nMust be an executable that knows how to install npm package dependencies.\n+The default `--npm-client` is `npm`.\n```sh\n$ lerna bootstrap --npm-client=yarn\n@@ -120,7 +123,7 @@ May also be configured in `lerna.json`:\n}\n```\n-### --use-workspaces\n+### `--use-workspaces`\nEnables integration with [Yarn Workspaces](https://github.com/yarnpkg/rfcs/blob/master/implemented/0000-workspaces-install-phase-1.md) (available since yarn@0.27+).\nThe values in the array are the commands in which Lerna will delegate operation to Yarn (currently only bootstrapping).\n@@ -150,9 +153,21 @@ The root-level package.json must also include a `workspaces` array:\nThis list is broadly similar to lerna's `packages` config (a list of globs matching directories with a package.json),\nexcept it does not support recursive globs (`\"**\"`, a.k.a. \"globstars\").\n-### --ci\n+### `--no-ci`\n+\n+When using the default `--npm-client`, `lerna bootstrap` will call [`npm ci`](https://docs.npmjs.com/cli/ci) instead of `npm install` in CI environments.\n+To disable this behavior, pass `--no-ci`:\n+\n+```sh\n+$ lerna bootstrap --no-ci\n+```\n+\n+To _force_ it during a local install (where it is not automatically enabled), pass `--ci`:\n+```sh\n+$ lerna bootstrap --ci\n+```\n-This runs `lerna bootstrap` with `npm ci` as opposed to `npm install`. The specifics of this command can be found in the NPM documentation [here](https://docs.npmjs.com/cli/ci)\n+This can be useful for \"clean\" re-installs, or initial installations after fresh cloning.\n## How It Works\n", "new_path": "commands/bootstrap/README.md", "old_path": "commands/bootstrap/README.md" }, { "change_type": "MODIFY", "diff": "@@ -15,7 +15,9 @@ Lerna determines the last git tag created and runs `git diff --name-only v6.8.1`\n**Note that configuration for the `publish` command _also_ affects the\n`changed` command. For example `command.publish.ignoreChanges`**\n-#### --json\n+## Options\n+\n+### `--json`\n```sh\n$ lerna changed --json\n", "new_path": "commands/changed/README.md", "old_path": "commands/changed/README.md" }, { "change_type": "MODIFY", "diff": "## Usage\n```sh\n-$ lerna diff [package?]\n+$ lerna diff [package]\n$ lerna diff\n# diff a specific package\n", "new_path": "commands/diff/README.md", "old_path": "commands/diff/README.md" }, { "change_type": "MODIFY", "diff": "@@ -14,12 +14,6 @@ $ lerna exec -- protractor conf.js\nRun an arbitrary command in each package.\nA double-dash (`--`) is necessary to pass dashed flags to the spawned command, but is not necessary when all the arguments are positional.\n-`lerna exec` respects the `--concurrency`, `--scope`, and `--ignore` flags (see [Filter Flags](https://www.npmjs.com/package/@lerna/filter-options)).\n-\n-```sh\n-$ lerna exec --scope my-component -- ls -la\n-```\n-\nThe name of the current package is available through the environment variable `LERNA_PACKAGE_NAME`:\n```sh\n@@ -32,6 +26,14 @@ You may also run a script located in the root dir, in a complicated dir structur\n$ lerna exec -- node \\$LERNA_ROOT_PATH/scripts/some-script.js\n```\n+## Options\n+\n+`lerna exec` respects the `--concurrency`, `--scope`, and `--ignore` flags (see [Filter Flags](https://www.npmjs.com/package/@lerna/filter-options)).\n+\n+```sh\n+$ lerna exec --scope my-component -- ls -la\n+```\n+\n> The commands are spawned in parallel, using the concurrency given (except with `--parallel`).\n> The output is piped through, so not deterministic.\n> If you want to run the command in one package after another, use it like this:\n@@ -40,7 +42,7 @@ $ lerna exec -- node \\$LERNA_ROOT_PATH/scripts/some-script.js\n$ lerna exec --concurrency 1 -- ls -la\n```\n-#### --stream\n+### `--stream`\nStream output from child processes immediately, prefixed with the originating\npackage name. This allows output from different packages to be interleaved.\n@@ -49,7 +51,7 @@ package name. This allows output from different packages to be interleaved.\n$ lerna exec --stream -- babel src -d lib\n```\n-#### --parallel\n+### `--parallel`\nSimilar to `--stream`, but completely disregards concurrency and topological sorting, running a given command or script immediately in all matching packages with prefixed streaming output. This is the preferred flag for long-running processes such as `babel src -d lib -w` run over many packages.\n@@ -62,11 +64,12 @@ $ lerna exec --parallel -- babel src -d lib -w\n> harmful to your shell's equanimity (or maximum file descriptor limit,\n> for example). YMMV\n-### --bail\n+### `--no-bail`\n```sh\n# Run a command, ignoring non-zero (error) exit codes\n$ lerna exec --no-bail <command>\n```\n-This flag signifies whether or not the `exec` command should halt execution upon encountering an error thrown by one of the spawned subprocesses. Its default value is `true`.\n+By default, `lerna exec` will exit with an error if _any_ execution returns a non-zero exit code.\n+Pass `--no-bail` to disable this behavior, executing in _all_ packages regardless of exit code.\n", "new_path": "commands/exec/README.md", "old_path": "commands/exec/README.md" }, { "change_type": "MODIFY", "diff": "@@ -17,7 +17,9 @@ repo. Each commit is modified to make changes relative to the package\ndirectory. So, for example, the commit that added `package.json` will\ninstead add `packages/<directory-name>/package.json`.\n-### --flatten\n+## Options\n+\n+### `--flatten`\nWhen importing repositories with merge commits with conflicts, the import command will fail trying to apply all commits. The user can use this flag to ask for import of \"flat\" history, i.e. with each merge commit as a single change the merge introduced.\n", "new_path": "commands/import/README.md", "old_path": "commands/import/README.md" }, { "change_type": "MODIFY", "diff": "@@ -27,7 +27,9 @@ lerna info Creating lerna.json\nlerna success Initialized Lerna files\n```\n-### --independent, -i\n+## Options\n+\n+### `--independent`\n```sh\n$ lerna init --independent\n@@ -35,7 +37,7 @@ $ lerna init --independent\nThis flag tells Lerna to use independent versioning mode.\n-### --exact\n+### `--exact`\n```sh\n$ lerna init --exact\n", "new_path": "commands/init/README.md", "old_path": "commands/init/README.md" }, { "change_type": "MODIFY", "diff": "@@ -10,7 +10,9 @@ $ lerna link\nSymlink together all Lerna `packages` that are dependencies of each other in the current Lerna repo.\n-### --force-local\n+## Options\n+\n+### `--force-local`\n```sh\n$ lerna link --force-local\n", "new_path": "commands/link/README.md", "old_path": "commands/link/README.md" }, { "change_type": "MODIFY", "diff": "@@ -12,6 +12,8 @@ $ lerna ls\nList all of the public packages in the current Lerna repo.\n+## Options\n+\n`lerna ls` respects the `--ignore` and `--scope` flags (see [Filter Flags](https://www.npmjs.com/package/@lerna/filter-options)).\n### --json\n", "new_path": "commands/list/README.md", "old_path": "commands/list/README.md" }, { "change_type": "MODIFY", "diff": "@@ -16,7 +16,7 @@ Creates a new git commit/tag in the process of publishing to npm.\nMore specifically, this command will:\n-1. Run the equivalent of `lerna updated` to determine which packages need to be published.\n+1. Run the equivalent of `lerna changed` to determine which packages need to be published.\n2. If necessary, increment the `version` key in `lerna.json`.\n3. Update the `package.json` of all updated packages to their new versions.\n4. Update all dependencies of the updated packages with the new versions, specified with a [caret (^)](https://docs.npmjs.com/files/package.json#dependencies).\n@@ -33,7 +33,9 @@ More specifically, this command will:\n}\n```\n-### --exact\n+## Options\n+\n+### `--exact`\n```sh\n$ lerna publish --exact\n@@ -43,7 +45,7 @@ When run with this flag, `publish` will specify updated dependencies in updated\nFor more information, see the package.json [dependencies](https://docs.npmjs.com/files/package.json#dependencies) documentation.\n-#### --registry [registry]\n+### `--registry <url>`\nWhen run with this flag, forwarded npm commands will use the specified registry for your package(s).\n@@ -51,9 +53,10 @@ This is useful if you do not want to explicitly set up your registry\nconfiguration in all of your package.json files individually when e.g. using\nprivate registries.\n-### --npm-client [client]\n+### `--npm-client <client>`\nMust be an executable that knows how to publish packages to an npm registry.\n+The default `--npm-client` is `npm`.\n```sh\n$ lerna publish --npm-client=yarn\n@@ -71,7 +74,7 @@ May also be configured in `lerna.json`:\n}\n```\n-### --npm-tag [tagname]\n+### `--npm-tag <dist-tag>`\n```sh\n$ lerna publish --npm-tag=next\n@@ -84,7 +87,7 @@ This option can be used to publish a [`prerelease`](http://carrot.is/coding/npm_\n> Note: the `latest` tag is the one that is used when a user runs `npm install my-package`.\n> To install a different tag, a user can run `npm install my-package@prerelease`.\n-### --temp-tag\n+### `--temp-tag`\nWhen passed, this flag will alter the default publish process by first publishing\nall changed packages to a temporary dist-tag (`lerna-temp`) and then moving the\n@@ -93,7 +96,7 @@ new version(s) to the default [dist-tag](https://docs.npmjs.com/cli/dist-tag) (`\nThis is not generally necessary, as Lerna will publish packages in topological\norder (all dependencies before dependents) by default.\n-### --canary, -c\n+### `--canary`\n```sh\n$ lerna publish --canary\n@@ -104,7 +107,7 @@ When run with this flag, `publish` publishes packages in a more granular way (pe\n> The intended use case for this flag is a per commit level release or nightly release.\n-### --conventional-commits\n+### `--conventional-commits`\n```sh\n$ lerna publish --conventional-commits\n@@ -112,7 +115,7 @@ $ lerna publish --conventional-commits\nWhen run with this flag, `publish` will use the [Conventional Commits Specification](https://conventionalcommits.org/) to [determine the version bump](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-recommended-bump) and [generate CHANGELOG](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-cli)\n-### --changelog-preset\n+### `--changelog-preset`\n```sh\n$ lerna publish --conventional-commits --changelog-preset angular-bitbucket\n@@ -125,7 +128,7 @@ Presets are names of built-in or installable configuration for conventional chan\nPresets may be passed as the full name of the package, or the auto-expanded suffix\n(e.g., `angular` is expanded to `conventional-changelog-angular`).\n-### --git-remote [remote]\n+### `--git-remote <name>`\n```sh\n$ lerna publish --git-remote upstream\n@@ -133,17 +136,17 @@ $ lerna publish --git-remote upstream\nWhen run with this flag, `publish` will push the git changes to the specified remote instead of `origin`.\n-### --skip-git\n+### `--skip-git`\n```sh\n$ lerna publish --skip-git\n```\n-When run with this flag, `publish` will publish to npm without running any of the git commands.\n+When run with this flag, `publish` will publish to npm without generating a git commit, tag, or pushing changes to a remote.\n-> Only publish to npm; skip committing, tagging, and pushing git changes (this only affects publish).\n+> NOTE: This option **does not** restrict _all_ git commands from being executed. `git` is still required by `lerna publish`.\n-### --skip-npm\n+### `--skip-npm`\n```sh\n$ lerna publish --skip-npm\n@@ -156,21 +159,21 @@ packages to npm.\nThis flag can be combined with `--skip-git` to _just_ update versions and\ndependencies, without committing, tagging, pushing or publishing.\n-> Only update versions and dependencies; don't actually publish (this only affects publish).\n-\n-### --force-publish [packages]\n+### `--force-publish [package-names-or-globs]`\n```sh\n$ lerna publish --force-publish=package-2,package-4\n# force publish all packages\n$ lerna publish --force-publish=*\n+# same as previous\n+$ lerna publish --force-publish\n```\nWhen run with this flag, `publish` will force publish the specified packages (comma-separated) or all packages using `*`.\n-> This will skip the `lerna updated` check for changed packages and forces a package that didn't have a `git diff` change to be updated.\n+> This will skip the `lerna changed` check for changed packages and forces a package that didn't have a `git diff` change to be updated.\n-### --yes\n+### `--yes`\n```sh\n$ lerna publish --canary --yes\n@@ -180,7 +183,7 @@ $ lerna publish --canary --yes\nWhen run with this flag, `publish` will skip all confirmation prompts.\nUseful in [Continuous integration (CI)](https://en.wikipedia.org/wiki/Continuous_integration) to automatically answer the publish confirmation prompt.\n-### --cd-version\n+### `--cd-version`\n```sh\n$ lerna publish --cd-version (major | minor | patch | premajor | preminor | prepatch | prerelease)\n@@ -192,7 +195,7 @@ You must still use the `--yes` flag to avoid all prompts. This is useful when bu\nIf you have any packages with a prerelease version number (e.g. `2.0.0-beta.3`) and you run `lerna publish` with `--cd-version` and a non-prerelease version increment (major / minor / patch), it will publish those packages in addition to the packages that have changed since the last release.\n-### --preid\n+### `--preid`\n```sh\n$ lerna publish --cd-version=prerelease\n@@ -208,7 +211,7 @@ When run with this flag, `lerna publish --cd-version` will\nincrement `premajor`, `preminor`, `prepatch`, or `prerelease`\nversions using the specified [prerelease identifier](http://semver.org/#spec-item-9).\n-### --repo-version\n+### `--repo-version`\n```sh\n$ lerna publish --repo-version 1.0.1\n@@ -218,7 +221,9 @@ $ lerna publish --repo-version 1.0.1\nWhen run with this flag, `publish` will skip the version selection prompt and use the specified version.\nUseful for bypassing the user input prompt if you already know which version to publish.\n-### --message, -m [msg]\n+### `--message <msg>`\n+\n+This option is aliased to `-m` for parity with `git commit`.\n```sh\n$ lerna publish -m \"chore(release): publish %s\"\n@@ -254,24 +259,22 @@ This can be configured in lerna.json, as well:\n}\n```\n-### --amend\n+### `--amend`\n```sh\n$ lerna publish --amend\n# commit message is retained, and `git push` is skipped.\n```\n-When run with this flag, `publish` will perform all changes on the current commit, instead of adding a new one. This is\n-useful during [Continuous integration (CI)](https://en.wikipedia.org/wiki/Continuous_integration), to reduce the number\n-of commits in the projects' history.\n+When run with this flag, `publish` will perform all changes on the current commit, instead of adding a new one.\n+This is useful during [Continuous integration (CI)](https://en.wikipedia.org/wiki/Continuous_integration) to reduce the number of commits in the project's history.\nIn order to prevent unintended overwrites, this command will skip `git push`.\n-### --allow-branch [glob]\n+### `--allow-branch <glob>`\n-Lerna allows you to specify a glob or an array of globs in your `lerna.json` that your current branch needs to match to be publishable.\n-You can use this flag to override this setting.\n-If your `lerna.json` contains something like this:\n+A whitelist of globs that match git branches where `lerna publish` is enabled.\n+It is easiest (and recommended) to configure in `lerna.json`, but it is possible to pass as a CLI option as well.\n```json\n{\n@@ -283,6 +286,9 @@ If your `lerna.json` contains something like this:\n}\n```\n+With the configuration above, the `lerna publish` will fail when run from any branch other than `master`.\n+It is considered a best-practice to limit `lerna publish` to the primary branch alone.\n+\n```json\n{\n\"command\": {\n@@ -293,9 +299,13 @@ If your `lerna.json` contains something like this:\n}\n```\n-and you are not on the branch `master` lerna will prevent you from publishing. To force a publish despite this config, pass the `--allow-branch` flag:\n+With the preceding configuration, `lerna publish` will be allowed in any branch prefixed with `feature/`.\n+Please be aware that generating git tags in feature branches is fraught with potential errors as the branches are merged into the primary branch. If the tags are \"detached\" from their original context (perhaps through a squash merge or a conflicted merge commit), future `lerna publish` executions will have difficulty determining the correct \"diff since last release.\"\n+\n+It is always possible to override this \"durable\" config on the command-line.\n+Please use with caution.\n```sh\n-$ lerna publish --allow-branch my-new-feature\n+$ lerna publish --allow-branch hotfix/oops-fix-the-thing\n```\n", "new_path": "commands/publish/README.md", "old_path": "commands/publish/README.md" }, { "change_type": "MODIFY", "diff": "@@ -15,15 +15,18 @@ $ lerna run --parallel watch\nRun an [npm script](https://docs.npmjs.com/misc/scripts) in each package that contains that script. A double-dash (`--`) is necessary to pass dashed arguments to the script execution.\n+## Options\n+\n`lerna run` respects the `--concurrency`, `--scope`, and `--ignore` flags (see [Filter Flags](https://www.npmjs.com/package/@lerna/filter-options)).\n```sh\n$ lerna run --scope my-component test\n```\n-### --npm-client [client]\n+### `--npm-client <client>`\nMust be an executable that knows how to run npm lifecycle scripts.\n+The default `--npm-client` is `npm`.\n```sh\n$ lerna run build --npm-client=yarn\n@@ -41,7 +44,7 @@ May also be configured in `lerna.json`:\n}\n```\n-#### --stream\n+### `--stream`\nStream output from child processes immediately, prefixed with the originating\npackage name. This allows output from different packages to be interleaved.\n@@ -50,7 +53,7 @@ package name. This allows output from different packages to be interleaved.\n$ lerna run watch --stream\n```\n-#### --parallel\n+### `--parallel`\nSimilar to `--stream`, but completely disregards concurrency and topological sorting, running a given command or script immediately in all matching packages with prefixed streaming output. This is the preferred flag for long-running processes such as `npm run watch` run over many packages.\n@@ -62,3 +65,13 @@ $ lerna run watch --parallel\n> the `--parallel` flag, as spawning dozens of subprocesses may be\n> harmful to your shell's equanimity (or maximum file descriptor limit,\n> for example). YMMV\n+\n+### `--no-bail`\n+\n+```sh\n+# Run an npm script in all packages that contain it, ignoring non-zero (error) exit codes\n+$ lerna run --no-bail test\n+```\n+\n+By default, `lerna run` will exit with an error if _any_ script run returns a non-zero exit code.\n+Pass `--no-bail` to disable this behavior, running the script in _all_ packages that contain it regardless of exit code.\n", "new_path": "commands/run/README.md", "old_path": "commands/run/README.md" }, { "change_type": "MODIFY", "diff": "> Options for lerna sub-commands that need filtering\n+## Options\n+\n### `--scope <glob>`\nInclude only packages with names matching the given glob.\n@@ -61,6 +63,6 @@ $ lerna bootstrap --scope my-component --include-filtered-dependencies\n```sh\n$ lerna bootstrap --scope \"package-*\" --ignore \"package-util-*\" --include-filtered-dependencies\n-# all package-util's will be ignored unless they are depended upon by a\n-# package matched by \"package-*\"\n+# all packages matching \"package-util-*\" will be ignored unless they are\n+# depended upon by a package whose name matches \"package-*\"\n```\n", "new_path": "core/filter-options/README.md", "old_path": "core/filter-options/README.md" }, { "change_type": "MODIFY", "diff": "> Global options applicable to _every_ lerna sub-command\n-### --concurrency\n+## Options\n+\n+### `--concurrency`\nHow many threads to use when Lerna parallelizes the tasks (defaults to `4`)\n@@ -10,20 +12,20 @@ How many threads to use when Lerna parallelizes the tasks (defaults to `4`)\n$ lerna publish --concurrency 1\n```\n-### --loglevel [silent|error|warn|success|info|verbose|silly]\n+### `--loglevel <silent|error|warn|success|info|verbose|silly>`\nWhat level of logs to report. On failure, all logs are written to lerna-debug.log in the current working directory.\nAny logs of a higher level than the setting are shown. The default is \"info\".\n-### --max-buffer [in-bytes]\n+### `--max-buffer <bytes>`\nSet a max buffer length for each underlying process call. Useful for example\nwhen someone wants to import a repo with a larger amount of commits while\nrunning `lerna import`. In that case the built-in buffer length might not\nbe sufficient.\n-### --no-sort\n+### `--no-sort`\nBy default, all tasks execute on packages in topologically sorted order as to respect the dependency relationships of the packages in question. Cycles are broken on a best-effort basis in a way not guaranteed to be consistent across Lerna invocations.\n@@ -31,7 +33,7 @@ Topological sorting can cause concurrency bottlenecks if there are a small numbe\nThis option can also help if you run multiple \"watch\" commands. Since `lerna run` will execute commands in topologically sorted order, it can end up waiting for a command before moving on. This will block execution when you run \"watch\" commands, since they typically never end. An example of a \"watch\" command is [running `babel` with the `--watch` CLI flag](https://babeljs.io/docs/usage/cli/#babel-compile-files).\n-### --reject-cycles\n+### `--reject-cycles`\nFail immediately if a cycle is found (in `bootstrap`, `exec`, `publish` or `run`).\n", "new_path": "core/global-options/README.md", "old_path": "core/global-options/README.md" } ]
JavaScript
MIT License
lerna/lerna
docs: Edit command options, tweaking format and inverting some entries [skip ci]
1
docs
null
217,922
16.07.2018 10:50:38
-7,200
b173028d467f88c778d736035c67f5442cf51a81
fix: removed navigation buttons in overlay window
[ { "change_type": "MODIFY", "diff": "{{locale | uppercase}}\n</div>\n<div class=\"spacer draggable\"></div>\n- <mat-icon class=\"desktop-bar-button nav-button theme-text-color\" (click)=\"previousPage()\">arrow_back</mat-icon>\n+ <mat-icon class=\"desktop-bar-button nav-button theme-text-color\" (click)=\"previousPage()\" *ngIf=\"!overlay\">\n+ arrow_back\n+ </mat-icon>\n<mat-icon (click)=\"openingUrl = true\" class=\"desktop-bar-button open-url theme-text-color\" *ngIf=\"!overlay\"\nmatTooltip=\"{{'COMMON.Open_url' | translate}}\">\nopen_in_browser\n</mat-icon>\n- <mat-icon class=\"desktop-bar-button nav-button theme-text-color\" (click)=\"nextPage()\">arrow_forward</mat-icon>\n+ <mat-icon class=\"desktop-bar-button nav-button theme-text-color\" (click)=\"nextPage()\" *ngIf=\"!overlay\">\n+ arrow_forward\n+ </mat-icon>\n<div class=\"spacer draggable\"></div>\n<mat-icon class=\"desktop-bar-button theme-text-color\" (click)=\"minimize()\" *ngIf=\"!overlay\">minimize</mat-icon>\n<mat-icon class=\"desktop-bar-button theme-text-color\" (click)=\"toggleFullscreen()\" *ngIf=\"!overlay\">fullscreen\n", "new_path": "src/app/app.component.html", "old_path": "src/app/app.component.html" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix: removed navigation buttons in overlay window
1
fix
null
807,849
16.07.2018 13:14:22
25,200
7899ab8e77da08efeb4f99e4f8ff6ad6378f9c92
feat(cli): Upgrade to Yargs 12 It is no longer necessary to specify `default: undefined` for boolean options, as those keys are no longer automatically assigned to the parsed argv regardless of presence in process.argv.
[ { "change_type": "MODIFY", "diff": "@@ -35,7 +35,6 @@ exports.builder = yargs => {\ngroup: \"Command Options:\",\ndescribe: \"Don't run lifecycle scripts in bootstrapped packages\",\ntype: \"boolean\",\n- default: undefined,\n},\n\"npm-client\": {\ngroup: \"Command Options:\",\n", "new_path": "commands/bootstrap/command.js", "old_path": "commands/bootstrap/command.js" }, { "change_type": "MODIFY", "diff": "@@ -17,7 +17,6 @@ exports.builder = yargs =>\ndescribe: \"Show information in JSON format\",\ngroup: \"Command Options:\",\ntype: \"boolean\",\n- default: undefined,\n},\n});\n", "new_path": "commands/changed/command.js", "old_path": "commands/changed/command.js" }, { "change_type": "MODIFY", "diff": "@@ -14,6 +14,7 @@ exports.builder = yargs => {\nyes: {\ngroup: \"Command Options:\",\ndescribe: \"Skip all confirmation prompts\",\n+ type: \"boolean\",\n},\n});\n", "new_path": "commands/clean/command.js", "old_path": "commands/clean/command.js" }, { "change_type": "MODIFY", "diff": "@@ -42,7 +42,7 @@ exports.builder = yargs => {\n\"es-module\": {\ngroup: \"Command Options:\",\ndescribe: \"Initialize a transpiled ES Module\",\n- // type: \"boolean\",\n+ type: \"boolean\",\n},\nhomepage: {\ngroup: \"Command Options:\",\n@@ -63,7 +63,7 @@ exports.builder = yargs => {\nprivate: {\ngroup: \"Command Options:\",\ndescribe: \"Make the new package private, never published to any external registry\",\n- // type: \"boolean\",\n+ type: \"boolean\",\n},\nregistry: {\ngroup: \"Command Options:\",\n@@ -78,7 +78,7 @@ exports.builder = yargs => {\nyes: {\ngroup: \"Command Options:\",\ndescribe: \"Skip all prompts, accepting default values\",\n- // type: \"boolean\",\n+ type: \"boolean\",\n},\n});\n", "new_path": "commands/create/command.js", "old_path": "commands/create/command.js" }, { "change_type": "MODIFY", "diff": "@@ -25,30 +25,26 @@ exports.builder = yargs => {\nbail: {\ngroup: \"Command Options:\",\ndescribe: \"Stop when the command fails in a package.\\nPass --no-bail to continue despite failure.\",\n- defaultDescription: \"true\",\n+ default: true,\ntype: \"boolean\",\n- default: undefined,\n},\nstream: {\ngroup: \"Command Options:\",\ndescribe: \"Stream output with lines prefixed by package.\",\ntype: \"boolean\",\n- default: undefined,\n},\nparallel: {\ngroup: \"Command Options:\",\ndescribe: \"Run command in all packages with unlimited concurrency, streaming prefixed output\",\ntype: \"boolean\",\n- default: undefined,\n},\n// This option controls prefix for stream output so that it can be disabled to be friendly\n// to tools like Visual Studio Code to highlight the raw results\nprefix: {\ngroup: \"Command Options:\",\ndescribe: \"Pass --no-prefix to disable prefixing of streamed output.\",\n- defaultDescription: \"true\",\n+ default: true,\ntype: \"boolean\",\n- default: undefined,\n},\n});\n", "new_path": "commands/exec/command.js", "old_path": "commands/exec/command.js" }, { "change_type": "MODIFY", "diff": "@@ -14,10 +14,12 @@ exports.builder = yargs =>\nflatten: {\ngroup: \"Command Options:\",\ndescribe: \"Import each merge commit as a single change the merge introduced\",\n+ type: \"boolean\",\n},\nyes: {\ngroup: \"Command Options:\",\ndescribe: \"Skip all confirmation prompts\",\n+ type: \"boolean\",\n},\n});\n", "new_path": "commands/import/command.js", "old_path": "commands/import/command.js" }, { "change_type": "MODIFY", "diff": "@@ -11,13 +11,11 @@ exports.builder = {\nexact: {\ndescribe: \"Specify lerna dependency version in package.json without a caret (^)\",\ntype: \"boolean\",\n- default: undefined,\n},\nindependent: {\ndescribe: \"Version packages independently\",\nalias: \"i\",\ntype: \"boolean\",\n- default: undefined,\n},\n};\n", "new_path": "commands/init/command.js", "old_path": "commands/init/command.js" }, { "change_type": "MODIFY", "diff": "@@ -13,7 +13,6 @@ exports.builder = yargs => {\ngroup: \"Command Options:\",\ndescribe: \"Force local sibling links regardless of version range match\",\ntype: \"boolean\",\n- default: undefined,\n},\n});\n", "new_path": "commands/link/command.js", "old_path": "commands/link/command.js" }, { "change_type": "MODIFY", "diff": "@@ -17,7 +17,6 @@ exports.builder = yargs => {\ngroup: \"Command Options:\",\ndescribe: \"Show information in JSON format\",\ntype: \"boolean\",\n- default: undefined,\n},\n});\n", "new_path": "commands/list/command.js", "old_path": "commands/list/command.js" }, { "change_type": "MODIFY", "diff": "@@ -40,17 +40,14 @@ exports.builder = yargs => {\n\"conventional-commits\": {\ndescribe: \"Use angular conventional-commit format to determine version bump and generate CHANGELOG.\",\ntype: \"boolean\",\n- default: undefined,\n},\n\"changelog-preset\": {\ndescribe: \"Use another conventional-changelog preset rather than angular.\",\ntype: \"string\",\n- default: undefined,\n},\nexact: {\ndescribe: \"Specify cross-dependency version numbers exactly rather than with a caret (^).\",\ntype: \"boolean\",\n- default: undefined,\n},\n\"git-remote\": {\ndefaultDescription: \"origin\",\n@@ -71,7 +68,6 @@ exports.builder = yargs => {\namend: {\ndescribe: \"Amend the existing commit, instead of generating a new one.\",\ntype: \"boolean\",\n- default: false,\n},\n\"npm-tag\": {\ndescribe: \"Publish packages with the specified npm dist-tag\",\n@@ -101,22 +97,18 @@ exports.builder = yargs => {\n\"skip-git\": {\ndescribe: \"Skip commiting, tagging, and pushing git changes.\",\ntype: \"boolean\",\n- default: undefined,\n},\n\"skip-npm\": {\ndescribe: \"Stop before actually publishing change to npm.\",\ntype: \"boolean\",\n- default: undefined,\n},\n\"temp-tag\": {\ndescribe: \"Create a temporary tag while publishing.\",\ntype: \"boolean\",\n- default: undefined,\n},\nyes: {\ndescribe: \"Skip all confirmation prompts.\",\ntype: \"boolean\",\n- default: undefined,\n},\n};\n", "new_path": "commands/publish/command.js", "old_path": "commands/publish/command.js" }, { "change_type": "MODIFY", "diff": "@@ -20,30 +20,26 @@ exports.builder = yargs => {\nbail: {\ngroup: \"Command Options:\",\ndescribe: \"Stop when the script fails in a package.\\nPass --no-bail to continue despite failure.\",\n- defaultDescription: \"true\",\n+ default: true,\ntype: \"boolean\",\n- default: undefined,\n},\nstream: {\ngroup: \"Command Options:\",\ndescribe: \"Stream output with lines prefixed by package.\",\ntype: \"boolean\",\n- default: undefined,\n},\nparallel: {\ngroup: \"Command Options:\",\ndescribe: \"Run script in all packages with unlimited concurrency, streaming prefixed output.\",\ntype: \"boolean\",\n- default: undefined,\n},\n// This option controls prefix for stream output so that it can be disabled to be friendly\n// to tools like Visual Studio Code to highlight the raw results\nprefix: {\ngroup: \"Command Options:\",\ndescribe: \"Pass --no-prefix to disable prefixing of streamed output.\",\n- defaultDescription: \"true\",\n+ default: true,\ntype: \"boolean\",\n- default: undefined,\n},\n\"npm-client\": {\ngroup: \"Command Options:\",\n", "new_path": "commands/run/command.js", "old_path": "commands/run/command.js" }, { "change_type": "MODIFY", "diff": "\"dedent\": \"^0.7.0\",\n\"is-ci\": \"^1.0.10\",\n\"npmlog\": \"^4.1.2\",\n- \"yargs\": \"^11.0.0\"\n+ \"yargs\": \"^12.0.1\"\n}\n}\n", "new_path": "core/cli/package.json", "old_path": "core/cli/package.json" }, { "change_type": "MODIFY", "diff": "@@ -32,14 +32,14 @@ function filterOptions(yargs) {\nInclude all transitive dependents when running a command\nregardless of --scope, --ignore, or --since.\n`,\n- boolean: true,\n+ type: \"boolean\",\n},\n\"include-filtered-dependencies\": {\ndescribe: dedent`\nInclude all transitive dependencies when running a command\nregardless of --scope, --ignore, or --since.\n`,\n- boolean: true,\n+ type: \"boolean\",\n},\n};\n", "new_path": "core/filter-options/index.js", "old_path": "core/filter-options/index.js" }, { "change_type": "MODIFY", "diff": "@@ -18,22 +18,19 @@ function globalOptions(yargs) {\n\"reject-cycles\": {\ndescribe: \"Fail if a cycle is detected among dependencies.\",\ntype: \"boolean\",\n- default: undefined,\n},\nprogress: {\ndefaultDescription: \"true\",\ndescribe: \"Enable progress bars. Pass --no-progress to disable. (Always off in CI)\",\ntype: \"boolean\",\n- default: undefined,\n},\nsort: {\ndefaultDescription: \"true\",\ndescribe: \"Sort packages topologically (all dependencies before dependents).\",\ntype: \"boolean\",\n- default: undefined,\n},\n\"max-buffer\": {\n- describe: \"Set max-buffer(bytes) for Command execution\",\n+ describe: \"Set max-buffer (in bytes) for subcommand execution\",\ntype: \"number\",\nrequiresArg: true,\n},\n", "new_path": "core/global-options/index.js", "old_path": "core/global-options/index.js" }, { "change_type": "MODIFY", "diff": "\"license\": \"MIT\",\n\"dependencies\": {\n\"@lerna/global-options\": \"file:../../core/global-options\",\n- \"yargs\": \"^11.0.0\"\n+ \"yargs\": \"^12.0.1\"\n}\n}\n", "new_path": "helpers/command-runner/package.json", "old_path": "helpers/command-runner/package.json" }, { "change_type": "MODIFY", "diff": "\"requires\": true,\n\"dependencies\": {\n\"@babel/code-frame\": {\n- \"version\": \"7.0.0-beta.53\",\n- \"resolved\": \"https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.53.tgz\",\n- \"integrity\": \"sha1-mA0VYLhjV1v1o3eSUDfgEy71kh4=\",\n+ \"version\": \"7.0.0-beta.54\",\n+ \"resolved\": \"https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.54.tgz\",\n+ \"integrity\": \"sha1-ACT5b99wKKIdaOJzr9TpUyFKHq0=\",\n\"dev\": true,\n\"requires\": {\n- \"@babel/highlight\": \"7.0.0-beta.53\"\n+ \"@babel/highlight\": \"7.0.0-beta.54\"\n}\n},\n\"@babel/highlight\": {\n- \"version\": \"7.0.0-beta.53\",\n- \"resolved\": \"https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.53.tgz\",\n- \"integrity\": \"sha1-9OlS2tF4fSBeGI0+OEzc5JyjaPs=\",\n+ \"version\": \"7.0.0-beta.54\",\n+ \"resolved\": \"https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.54.tgz\",\n+ \"integrity\": \"sha1-FV1Qc1gym45waJcAF8P9dKmwhYQ=\",\n\"dev\": true,\n\"requires\": {\n\"chalk\": \"^2.0.0\",\n\"dev\": true,\n\"requires\": {\n\"@lerna/global-options\": \"file:core/global-options\",\n- \"yargs\": \"^11.0.0\"\n+ \"yargs\": \"^12.0.1\"\n}\n},\n\"@lerna-test/copy-fixture\": {\n\"dedent\": \"^0.7.0\",\n\"is-ci\": \"^1.0.10\",\n\"npmlog\": \"^4.1.2\",\n- \"yargs\": \"^11.0.0\"\n+ \"yargs\": \"^12.0.1\"\n}\n},\n\"@lerna/collect-packages\": {\n\"integrity\": \"sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=\"\n},\n\"cliui\": {\n- \"version\": \"2.1.0\",\n- \"resolved\": \"https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz\",\n- \"integrity\": \"sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=\",\n- \"optional\": true,\n+ \"version\": \"4.1.0\",\n+ \"resolved\": \"https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz\",\n+ \"integrity\": \"sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==\",\n\"requires\": {\n- \"center-align\": \"^0.1.1\",\n- \"right-align\": \"^0.1.1\",\n- \"wordwrap\": \"0.0.2\"\n+ \"string-width\": \"^2.1.1\",\n+ \"strip-ansi\": \"^4.0.0\",\n+ \"wrap-ansi\": \"^2.0.0\"\n},\n\"dependencies\": {\n- \"wordwrap\": {\n- \"version\": \"0.0.2\",\n- \"resolved\": \"https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz\",\n- \"integrity\": \"sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=\",\n- \"optional\": true\n+ \"ansi-regex\": {\n+ \"version\": \"3.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz\",\n+ \"integrity\": \"sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=\"\n+ },\n+ \"is-fullwidth-code-point\": {\n+ \"version\": \"2.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz\",\n+ \"integrity\": \"sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=\"\n+ },\n+ \"string-width\": {\n+ \"version\": \"2.1.1\",\n+ \"resolved\": \"https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz\",\n+ \"integrity\": \"sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==\",\n+ \"requires\": {\n+ \"is-fullwidth-code-point\": \"^2.0.0\",\n+ \"strip-ansi\": \"^4.0.0\"\n+ }\n+ },\n+ \"strip-ansi\": {\n+ \"version\": \"4.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz\",\n+ \"integrity\": \"sha1-qEeQIusaw2iocTibY1JixQXuNo8=\",\n+ \"requires\": {\n+ \"ansi-regex\": \"^3.0.0\"\n+ }\n}\n}\n},\n\"integrity\": \"sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=\"\n},\n\"escodegen\": {\n- \"version\": \"1.10.0\",\n- \"resolved\": \"https://registry.npmjs.org/escodegen/-/escodegen-1.10.0.tgz\",\n- \"integrity\": \"sha512-fjUOf8johsv23WuIKdNQU4P9t9jhQ4Qzx6pC2uW890OloK3Zs1ZAoCNpg/2larNF501jLl3UNy0kIRcF6VI22g==\",\n+ \"version\": \"1.11.0\",\n+ \"resolved\": \"https://registry.npmjs.org/escodegen/-/escodegen-1.11.0.tgz\",\n+ \"integrity\": \"sha512-IeMV45ReixHS53K/OmfKAIztN/igDHzTJUhZM3k1jMhIZWjk45SMwAtBsEXiJp3vSPmTcu6CXn7mDvFHRN66fw==\",\n\"dev\": true,\n\"requires\": {\n\"esprima\": \"^3.1.3\",\n}\n},\n\"get-caller-file\": {\n- \"version\": \"1.0.2\",\n- \"resolved\": \"https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz\",\n- \"integrity\": \"sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=\"\n+ \"version\": \"1.0.3\",\n+ \"resolved\": \"https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz\",\n+ \"integrity\": \"sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==\"\n},\n\"get-pkg-repo\": {\n\"version\": \"1.4.0\",\n\"integrity\": \"sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=\",\n\"dev\": true\n},\n+ \"is-fullwidth-code-point\": {\n+ \"version\": \"2.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz\",\n+ \"integrity\": \"sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=\",\n+ \"dev\": true\n+ },\n\"is-glob\": {\n\"version\": \"2.0.1\",\n\"resolved\": \"https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz\",\n\"regex-cache\": \"^0.4.2\"\n}\n},\n+ \"string-width\": {\n+ \"version\": \"2.1.1\",\n+ \"resolved\": \"https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz\",\n+ \"integrity\": \"sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"is-fullwidth-code-point\": \"^2.0.0\",\n+ \"strip-ansi\": \"^4.0.0\"\n+ }\n+ },\n\"strip-ansi\": {\n\"version\": \"4.0.0\",\n\"resolved\": \"https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz\",\n\"requires\": {\n\"ansi-regex\": \"^3.0.0\"\n}\n+ },\n+ \"y18n\": {\n+ \"version\": \"3.2.1\",\n+ \"resolved\": \"https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz\",\n+ \"integrity\": \"sha1-bRX7qITAhnnA136I53WegR4H+kE=\",\n+ \"dev\": true\n+ },\n+ \"yargs\": {\n+ \"version\": \"11.1.0\",\n+ \"resolved\": \"https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz\",\n+ \"integrity\": \"sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"cliui\": \"^4.0.0\",\n+ \"decamelize\": \"^1.1.1\",\n+ \"find-up\": \"^2.1.0\",\n+ \"get-caller-file\": \"^1.0.1\",\n+ \"os-locale\": \"^2.0.0\",\n+ \"require-directory\": \"^2.1.1\",\n+ \"require-main-filename\": \"^1.0.1\",\n+ \"set-blocking\": \"^2.0.0\",\n+ \"string-width\": \"^2.0.0\",\n+ \"which-module\": \"^2.0.0\",\n+ \"y18n\": \"^3.2.1\",\n+ \"yargs-parser\": \"^9.0.2\"\n+ }\n+ },\n+ \"yargs-parser\": {\n+ \"version\": \"9.0.2\",\n+ \"resolved\": \"https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz\",\n+ \"integrity\": \"sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"camelcase\": \"^4.1.0\"\n+ }\n}\n}\n},\n\"yargs\": \"^11.0.0\"\n},\n\"dependencies\": {\n+ \"ansi-regex\": {\n+ \"version\": \"3.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz\",\n+ \"integrity\": \"sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=\",\n+ \"dev\": true\n+ },\n\"arr-diff\": {\n\"version\": \"2.0.0\",\n\"resolved\": \"https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz\",\n\"integrity\": \"sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=\",\n\"dev\": true\n},\n+ \"is-fullwidth-code-point\": {\n+ \"version\": \"2.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz\",\n+ \"integrity\": \"sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=\",\n+ \"dev\": true\n+ },\n\"is-glob\": {\n\"version\": \"2.0.1\",\n\"resolved\": \"https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz\",\n\"parse-glob\": \"^3.0.4\",\n\"regex-cache\": \"^0.4.2\"\n}\n+ },\n+ \"string-width\": {\n+ \"version\": \"2.1.1\",\n+ \"resolved\": \"https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz\",\n+ \"integrity\": \"sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"is-fullwidth-code-point\": \"^2.0.0\",\n+ \"strip-ansi\": \"^4.0.0\"\n+ }\n+ },\n+ \"strip-ansi\": {\n+ \"version\": \"4.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz\",\n+ \"integrity\": \"sha1-qEeQIusaw2iocTibY1JixQXuNo8=\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"ansi-regex\": \"^3.0.0\"\n+ }\n+ },\n+ \"y18n\": {\n+ \"version\": \"3.2.1\",\n+ \"resolved\": \"https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz\",\n+ \"integrity\": \"sha1-bRX7qITAhnnA136I53WegR4H+kE=\",\n+ \"dev\": true\n+ },\n+ \"yargs\": {\n+ \"version\": \"11.1.0\",\n+ \"resolved\": \"https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz\",\n+ \"integrity\": \"sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"cliui\": \"^4.0.0\",\n+ \"decamelize\": \"^1.1.1\",\n+ \"find-up\": \"^2.1.0\",\n+ \"get-caller-file\": \"^1.0.1\",\n+ \"os-locale\": \"^2.0.0\",\n+ \"require-directory\": \"^2.1.1\",\n+ \"require-main-filename\": \"^1.0.1\",\n+ \"set-blocking\": \"^2.0.0\",\n+ \"string-width\": \"^2.0.0\",\n+ \"which-module\": \"^2.0.0\",\n+ \"y18n\": \"^3.2.1\",\n+ \"yargs-parser\": \"^9.0.2\"\n+ }\n+ },\n+ \"yargs-parser\": {\n+ \"version\": \"9.0.2\",\n+ \"resolved\": \"https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz\",\n+ \"integrity\": \"sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"camelcase\": \"^4.1.0\"\n+ }\n}\n}\n},\n\"integrity\": \"sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=\"\n},\n\"nwsapi\": {\n- \"version\": \"2.0.4\",\n- \"resolved\": \"https://registry.npmjs.org/nwsapi/-/nwsapi-2.0.4.tgz\",\n- \"integrity\": \"sha512-Zt6HRR6RcJkuj5/N9zeE7FN6YitRW//hK2wTOwX274IBphbY3Zf5+yn5mZ9v/SzAOTMjQNxZf9KkmPLWn0cV4g==\",\n+ \"version\": \"2.0.5\",\n+ \"resolved\": \"https://registry.npmjs.org/nwsapi/-/nwsapi-2.0.5.tgz\",\n+ \"integrity\": \"sha512-cqfA/wLUW6YbFQLkd5ZKq2SCaZkCoxehU9qt6ccMwH3fHbzUkcien9BzOgfBXfIkxeWnRFKb1ZKmjwaa9MYOMw==\",\n\"dev\": true\n},\n\"oauth-sign\": {\n\"integrity\": \"sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=\",\n\"optional\": true\n},\n+ \"wordwrap\": {\n+ \"version\": \"0.0.2\",\n+ \"resolved\": \"https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz\",\n+ \"integrity\": \"sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=\",\n+ \"optional\": true\n+ },\n\"yargs\": {\n\"version\": \"3.10.0\",\n\"resolved\": \"https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz\",\n\"cliui\": \"^2.1.0\",\n\"decamelize\": \"^1.0.0\",\n\"window-size\": \"0.1.0\"\n+ },\n+ \"dependencies\": {\n+ \"cliui\": {\n+ \"version\": \"2.1.0\",\n+ \"resolved\": \"https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz\",\n+ \"integrity\": \"sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=\",\n+ \"optional\": true,\n+ \"requires\": {\n+ \"center-align\": \"^0.1.1\",\n+ \"right-align\": \"^0.1.1\",\n+ \"wordwrap\": \"0.0.2\"\n+ }\n+ }\n}\n}\n}\n\"integrity\": \"sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==\",\n\"dev\": true\n},\n+ \"xregexp\": {\n+ \"version\": \"4.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/xregexp/-/xregexp-4.0.0.tgz\",\n+ \"integrity\": \"sha512-PHyM+sQouu7xspQQwELlGwwd05mXUFqwFYfqPO0cC7x4fxyHnnuetmQr6CjJiafIDoH4MogHb9dOoJzR/Y4rFg==\"\n+ },\n\"xtend\": {\n\"version\": \"4.0.1\",\n\"resolved\": \"https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz\",\n\"integrity\": \"sha1-pcbVMr5lbiPbgg77lDofBJmNY68=\"\n},\n\"y18n\": {\n- \"version\": \"3.2.1\",\n- \"resolved\": \"https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz\",\n- \"integrity\": \"sha1-bRX7qITAhnnA136I53WegR4H+kE=\"\n+ \"version\": \"4.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz\",\n+ \"integrity\": \"sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==\"\n},\n\"yallist\": {\n\"version\": \"2.1.2\",\n\"integrity\": \"sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=\"\n},\n\"yargs\": {\n- \"version\": \"11.1.0\",\n- \"resolved\": \"https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz\",\n- \"integrity\": \"sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==\",\n+ \"version\": \"12.0.1\",\n+ \"resolved\": \"https://registry.npmjs.org/yargs/-/yargs-12.0.1.tgz\",\n+ \"integrity\": \"sha512-B0vRAp1hRX4jgIOWFtjfNjd9OA9RWYZ6tqGA9/I/IrTMsxmKvtWy+ersM+jzpQqbC3YfLzeABPdeTgcJ9eu1qQ==\",\n\"requires\": {\n\"cliui\": \"^4.0.0\",\n- \"decamelize\": \"^1.1.1\",\n- \"find-up\": \"^2.1.0\",\n+ \"decamelize\": \"^2.0.0\",\n+ \"find-up\": \"^3.0.0\",\n\"get-caller-file\": \"^1.0.1\",\n\"os-locale\": \"^2.0.0\",\n\"require-directory\": \"^2.1.1\",\n\"set-blocking\": \"^2.0.0\",\n\"string-width\": \"^2.0.0\",\n\"which-module\": \"^2.0.0\",\n- \"y18n\": \"^3.2.1\",\n- \"yargs-parser\": \"^9.0.2\"\n+ \"y18n\": \"^3.2.1 || ^4.0.0\",\n+ \"yargs-parser\": \"^10.1.0\"\n},\n\"dependencies\": {\n\"ansi-regex\": {\n\"resolved\": \"https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz\",\n\"integrity\": \"sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=\"\n},\n- \"cliui\": {\n- \"version\": \"4.1.0\",\n- \"resolved\": \"https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz\",\n- \"integrity\": \"sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==\",\n+ \"decamelize\": {\n+ \"version\": \"2.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/decamelize/-/decamelize-2.0.0.tgz\",\n+ \"integrity\": \"sha512-Ikpp5scV3MSYxY39ymh45ZLEecsTdv/Xj2CaQfI8RLMuwi7XvjX9H/fhraiSuU+C5w5NTDu4ZU72xNiZnurBPg==\",\n\"requires\": {\n- \"string-width\": \"^2.1.1\",\n- \"strip-ansi\": \"^4.0.0\",\n- \"wrap-ansi\": \"^2.0.0\"\n+ \"xregexp\": \"4.0.0\"\n+ }\n+ },\n+ \"find-up\": {\n+ \"version\": \"3.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz\",\n+ \"integrity\": \"sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==\",\n+ \"requires\": {\n+ \"locate-path\": \"^3.0.0\"\n}\n},\n\"is-fullwidth-code-point\": {\n\"resolved\": \"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz\",\n\"integrity\": \"sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=\"\n},\n+ \"locate-path\": {\n+ \"version\": \"3.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz\",\n+ \"integrity\": \"sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==\",\n+ \"requires\": {\n+ \"p-locate\": \"^3.0.0\",\n+ \"path-exists\": \"^3.0.0\"\n+ }\n+ },\n+ \"p-limit\": {\n+ \"version\": \"2.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/p-limit/-/p-limit-2.0.0.tgz\",\n+ \"integrity\": \"sha512-fl5s52lI5ahKCernzzIyAP0QAZbGIovtVHGwpcu1Jr/EpzLVDI2myISHwGqK7m8uQFugVWSrbxH7XnhGtvEc+A==\",\n+ \"requires\": {\n+ \"p-try\": \"^2.0.0\"\n+ }\n+ },\n+ \"p-locate\": {\n+ \"version\": \"3.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz\",\n+ \"integrity\": \"sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==\",\n+ \"requires\": {\n+ \"p-limit\": \"^2.0.0\"\n+ }\n+ },\n+ \"p-try\": {\n+ \"version\": \"2.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz\",\n+ \"integrity\": \"sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==\"\n+ },\n\"string-width\": {\n\"version\": \"2.1.1\",\n\"resolved\": \"https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz\",\n}\n},\n\"yargs-parser\": {\n- \"version\": \"9.0.2\",\n- \"resolved\": \"https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz\",\n- \"integrity\": \"sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=\",\n+ \"version\": \"10.1.0\",\n+ \"resolved\": \"https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz\",\n+ \"integrity\": \"sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==\",\n\"requires\": {\n\"camelcase\": \"^4.1.0\"\n}\n", "new_path": "package-lock.json", "old_path": "package-lock.json" } ]
JavaScript
MIT License
lerna/lerna
feat(cli): Upgrade to Yargs 12 It is no longer necessary to specify `default: undefined` for boolean options, as those keys are no longer automatically assigned to the parsed argv regardless of presence in process.argv.
1
feat
cli
217,922
16.07.2018 13:27:20
-7,200
298eb71ac3647c17d865c97a69e0a713cad7b387
fix: fixed an issue with alarms not deleted properly closes
[ { "change_type": "MODIFY", "diff": "import {Injectable} from '@angular/core';\nimport {EorzeanTimeService} from './eorzean-time.service';\nimport {Alarm} from './alarm';\n-import {Observable, of, Subscription} from 'rxjs';\n+import {Observable, of, Subject} from 'rxjs';\nimport {ListRow} from '../../model/list/list-row';\nimport {SettingsService} from '../../pages/settings/settings.service';\nimport {MatDialog, MatSnackBar} from '@angular/material';\n@@ -12,7 +12,7 @@ import {MapPopupComponent} from '../../modules/map/map-popup/map-popup.component\nimport {BellNodesService} from '../data/bell-nodes.service';\nimport {PushNotificationsService} from 'ng-push';\nimport {UserService} from '../database/user.service';\n-import {first, map, mergeMap} from 'rxjs/operators';\n+import {filter, first, map, mergeMap, takeUntil} from 'rxjs/operators';\nimport {AppUser} from '../../model/list/app-user';\nimport {PlatformService} from '../tools/platform.service';\nimport {IpcService} from '../electron/ipc.service';\n@@ -22,7 +22,7 @@ import {I18nToolsService} from '../tools/i18n-tools.service';\n@Injectable()\nexport class AlarmService {\n- private _alarms: Map<Alarm, Subscription> = new Map<Alarm, Subscription>();\n+ private _alarms: Map<Alarm, Subject<void>> = new Map<Alarm, Subject<void>>();\nconstructor(private etime: EorzeanTimeService, private settings: SettingsService, private snack: MatSnackBar,\nprivate localizedData: LocalizedDataService, private translator: TranslateService, private dialog: MatDialog,\n@@ -68,7 +68,7 @@ export class AlarmService {\n*/\npublic unregister(id: number): void {\nthis.getAlarms(id).forEach((alarm) => {\n- this._alarms.get(alarm).unsubscribe();\n+ this._alarms.get(alarm).next();\nthis._alarms.delete(alarm);\n});\nthis.persistAlarms();\n@@ -97,12 +97,21 @@ export class AlarmService {\n.getNearestAetheryte(mapData, {x: alarm.coords[0], y: alarm.coords[1]})\n)\n);\n- this._alarms.set(alarm, this.etime.getEorzeanTime().subscribe(time => {\n- if (time.getUTCHours() === this.substractHours(alarm.spawn, this.settings.alarmHoursBefore) &&\n- time.getUTCMinutes() === 0) {\n+ const alarmStop$ = new Subject<void>();\n+ this._alarms.set(alarm, alarmStop$);\n+ this.etime.getEorzeanTime()\n+ .pipe(\n+ // Stop playing alarms for this item once the stop Subject emitted.\n+ takeUntil(alarmStop$),\n+ // Only go further if the alarm has to be played\n+ filter(time => {\n+ return time.getUTCHours() === this.substractHours(alarm.spawn, this.settings.alarmHoursBefore)\n+ && time.getUTCMinutes() === 0;\n+ })\n+ )\n+ .subscribe(() => {\nthis.playAlarm(alarm);\n- }\n- }));\n+ });\n}\n});\n}\n@@ -189,6 +198,7 @@ export class AlarmService {\n* @param {Alarm} alarm\n*/\nprivate playAlarm(alarm: Alarm): void {\n+ console.log('playing alarm for item', alarm.itemId);\nif (this.settings.alarmsMuted) {\nreturn;\n}\n", "new_path": "src/app/core/time/alarm.service.ts", "old_path": "src/app/core/time/alarm.service.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix: fixed an issue with alarms not deleted properly closes #499
1
fix
null
217,922
16.07.2018 13:27:46
-7,200
c113d0f556c5e2ffccd864ba19f9b20e5851f1f5
ci: added translation JSON validation inside travis process
[ { "change_type": "MODIFY", "diff": "@@ -10,9 +10,10 @@ before_install:\n- export CHROME_BIN=chromium-browser\n- export DISPLAY=:99.0\n- sh -e /etc/init.d/xvfb start\n- - npm i -g firebase-functions\n+ - npm i -g firebase-functions jsonlint-cli\nscript:\n+ - jsonlint-cli ./src/assets/i18n/*.json\n- npm test && npm run build:prod\nafter_success:\n", "new_path": ".travis.yml", "old_path": ".travis.yml" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
ci: added translation JSON validation inside travis process
1
ci
null
807,849
16.07.2018 13:59:35
25,200
cf4008a98dc8bdb4df2a2ef79628e56803d151b1
fix(cli): Pass global defaults into option factory instead of yargs.config() This change respects `--no-ci` when passed during CI execution, instead of clobbering it with `yargs.config()`. Fixes
[ { "change_type": "MODIFY", "diff": "@@ -32,30 +32,22 @@ module.exports = lernaCLI;\n*/\nfunction lernaCLI(argv, cwd) {\nconst cli = yargs(argv, cwd);\n- let progress; // --no-progress always disables\n+ const defaults = { ci: isCI };\n- if (isCI || !process.stderr.isTTY) {\n+ if (defaults.ci || !process.stderr.isTTY) {\nlog.disableColor();\n- progress = false;\n+ defaults.progress = false;\n} else if (!process.stdout.isTTY) {\n// stdout is being piped, don't log non-errors or progress bars\n- progress = false;\n-\n- cli.check(parsedArgv => {\n- // eslint-disable-next-line no-param-reassign\n- parsedArgv.loglevel = \"error\";\n-\n- // return truthy or else it blows up\n- return parsedArgv;\n- });\n+ defaults.progress = false;\n+ defaults.loglevel = \"error\";\n} else if (process.stderr.isTTY) {\nlog.enableColor();\nlog.enableUnicode();\n}\n- return globalOptions(cli)\n+ return globalOptions(cli, defaults)\n.usage(\"Usage: $0 <command> [options]\")\n- .config({ ci: isCI, progress })\n.command(addCmd)\n.command(bootstrapCmd)\n.command(changedCmd)\n", "new_path": "core/cli/index.js", "old_path": "core/cli/index.js" }, { "change_type": "MODIFY", "diff": "module.exports = globalOptions;\n-function globalOptions(yargs) {\n+function globalOptions(yargs, { ci = false, loglevel = \"info\", progress = true }) {\n// the global options applicable to _every_ command\nconst opts = {\nloglevel: {\n- defaultDescription: \"info\",\n+ default: loglevel,\ndescribe: \"What level of logs to report.\",\ntype: \"string\",\n},\nconcurrency: {\n+ defaultDescription: \"4\",\ndescribe: \"How many processes to use when lerna parallelizes tasks.\",\ntype: \"number\",\nrequiresArg: true,\n@@ -20,12 +21,12 @@ function globalOptions(yargs) {\ntype: \"boolean\",\n},\nprogress: {\n- defaultDescription: \"true\",\n+ default: !ci && progress,\ndescribe: \"Enable progress bars. Pass --no-progress to disable. (Always off in CI)\",\ntype: \"boolean\",\n},\nsort: {\n- defaultDescription: \"true\",\n+ default: true,\ndescribe: \"Sort packages topologically (all dependencies before dependents).\",\ntype: \"boolean\",\n},\n@@ -43,7 +44,7 @@ function globalOptions(yargs) {\n.options(opts)\n.group(globalKeys, \"Global Options:\")\n.option(\"ci\", {\n- // set in core/cli via .config()\n+ default: ci,\nhidden: true,\ntype: \"boolean\",\n});\n", "new_path": "core/global-options/index.js", "old_path": "core/global-options/index.js" }, { "change_type": "MODIFY", "diff": "@@ -30,7 +30,7 @@ function commandRunner(commandModule) {\n.wrap(null)\n.command(commandModule);\n- globalOptions(cli);\n+ globalOptions(cli, { loglevel: \"silent\", progress: false });\nreturn (...args) =>\nnew Promise((resolve, reject) => {\n", "new_path": "helpers/command-runner/index.js", "old_path": "helpers/command-runner/index.js" } ]
JavaScript
MIT License
lerna/lerna
fix(cli): Pass global defaults into option factory instead of yargs.config() This change respects `--no-ci` when passed during CI execution, instead of clobbering it with `yargs.config()`. Fixes #1449
1
fix
cli
807,849
16.07.2018 14:04:40
25,200
2b27a54ae9783dbcbfa058855de08498805ccf9c
feat(command): Remove .defaultOptions() from option resolution stack Yargs 12 no longer necessitates this repetitive workaround.
[ { "change_type": "MODIFY", "diff": "@@ -17,12 +17,6 @@ class ChangedCommand extends Command {\nreturn [\"publish\"];\n}\n- get defaultOptions() {\n- return Object.assign({}, super.defaultOptions, {\n- json: false,\n- });\n- }\n-\ninitialize() {\nthis.updates = collectUpdates(this);\n", "new_path": "commands/changed/index.js", "old_path": "commands/changed/index.js" }, { "change_type": "MODIFY", "diff": "@@ -17,14 +17,6 @@ class ExecCommand extends Command {\nreturn false;\n}\n- get defaultOptions() {\n- return Object.assign({}, super.defaultOptions, {\n- bail: true,\n- parallel: false,\n- prefix: true,\n- });\n- }\n-\ninitialize() {\nconst dashedArgs = this.options[\"--\"] || [];\n@@ -35,6 +27,10 @@ class ExecCommand extends Command {\nthrow new ValidationError(\"ENOCOMMAND\", \"A command to execute is required\");\n}\n+ // inverted boolean options\n+ this.bail = this.options.bail !== false;\n+ this.prefix = this.options.prefix !== false;\n+\n// accessing properties of process.env can be expensive,\n// so cache it here to reduce churn during tighter loops\nthis.env = Object.assign({}, process.env);\n@@ -65,7 +61,7 @@ class ExecCommand extends Command {\nLERNA_PACKAGE_NAME: pkg.name,\nLERNA_ROOT_PATH: this.project.rootPath,\n}),\n- reject: this.options.bail,\n+ reject: this.bail,\npkg,\n};\n}\n@@ -86,7 +82,7 @@ class ExecCommand extends Command {\nthis.command,\nthis.args,\nthis.getOpts(pkg),\n- this.options.prefix && pkg.name\n+ this.prefix && pkg.name\n);\n}\n", "new_path": "commands/exec/index.js", "old_path": "commands/exec/index.js" }, { "change_type": "MODIFY", "diff": "@@ -15,13 +15,6 @@ function factory(argv) {\n}\nclass InitCommand extends Command {\n- get defaultOptions() {\n- return {\n- exact: false,\n- independent: false,\n- };\n- }\n-\nget requiresGit() {\nreturn false;\n}\n", "new_path": "commands/init/index.js", "old_path": "commands/init/index.js" }, { "change_type": "MODIFY", "diff": "@@ -18,12 +18,6 @@ class LinkCommand extends Command {\nreturn false;\n}\n- get defaultOptions() {\n- return Object.assign({}, super.defaultOptions, {\n- forceLocal: false,\n- });\n- }\n-\ninitialize() {\nlet graph = this.packageGraph;\n", "new_path": "commands/link/index.js", "old_path": "commands/link/index.js" }, { "change_type": "MODIFY", "diff": "@@ -17,12 +17,6 @@ class ListCommand extends Command {\nreturn false;\n}\n- get defaultOptions() {\n- return Object.assign({}, super.defaultOptions, {\n- json: false,\n- });\n- }\n-\ninitialize() {\nthis.resultList = this.filteredPackages.map(pkg => ({\nname: pkg.name,\n", "new_path": "commands/list/index.js", "old_path": "commands/list/index.js" }, { "change_type": "MODIFY", "diff": "@@ -43,20 +43,6 @@ function factory(argv) {\n}\nclass PublishCommand extends Command {\n- get defaultOptions() {\n- return Object.assign({}, super.defaultOptions, {\n- conventionalCommits: false,\n- exact: false,\n- ignoreChanges: [],\n- skipGit: false,\n- skipNpm: false,\n- tempTag: false,\n- yes: false,\n- allowBranch: false,\n- amend: false,\n- });\n- }\n-\ninitialize() {\nthis.gitRemote = this.options.gitRemote || \"origin\";\nthis.gitEnabled = !(this.options.canary || this.options.skipGit);\n", "new_path": "commands/publish/index.js", "old_path": "commands/publish/index.js" }, { "change_type": "MODIFY", "diff": "@@ -20,15 +20,6 @@ class RunCommand extends Command {\nreturn false;\n}\n- get defaultOptions() {\n- return Object.assign({}, super.defaultOptions, {\n- bail: true,\n- parallel: false,\n- prefix: true,\n- stream: false,\n- });\n- }\n-\ninitialize() {\nconst { script, npmClient = \"npm\" } = this.options;\n@@ -40,6 +31,10 @@ class RunCommand extends Command {\nthrow new ValidationError(\"ENOSCRIPT\", \"You must specify a lifecycle script to run\");\n}\n+ // inverted boolean options\n+ this.bail = this.options.bail !== false;\n+ this.prefix = this.options.prefix !== false;\n+\nif (script === \"env\") {\nthis.packagesWithScript = this.filteredPackages;\n} else {\n@@ -77,8 +72,8 @@ class RunCommand extends Command {\nreturn {\nargs: this.args,\nnpmClient: this.npmClient,\n- prefix: this.options.prefix,\n- reject: this.options.bail,\n+ prefix: this.prefix,\n+ reject: this.bail,\npkg,\n};\n}\n", "new_path": "commands/run/index.js", "old_path": "commands/run/index.js" }, { "change_type": "MODIFY", "diff": "@@ -337,14 +337,6 @@ describe(\"core-command\", () => {\nclass TestACommand extends Command {}\nclass TestBCommand extends Command {}\nclass TestCCommand extends Command {\n- get defaultOptions() {\n- return {\n- testOption: \"a\",\n- testOption2: \"a\",\n- testOption3: \"a\",\n- };\n- }\n-\nget otherCommandConfigs() {\nreturn [\"testb\"];\n}\n@@ -399,19 +391,6 @@ describe(\"core-command\", () => {\nexpect(instance.options.testOption).toBe(\"b\");\n});\n-\n- it(\"should merge flags with defaultOptions\", async () => {\n- const instance = new TestCCommand({\n- cwd: testDir,\n- onRejected,\n- testOption: \"b\",\n- });\n- await instance;\n-\n- expect(instance.options.testOption).toBe(\"b\");\n- expect(instance.options.testOption2).toBe(\"c\");\n- expect(instance.options.testOption3).toBe(\"a\");\n- });\n});\ndescribe(\"subclass implementation\", () => {\n", "new_path": "core/command/__tests__/command.test.js", "old_path": "core/command/__tests__/command.test.js" }, { "change_type": "MODIFY", "diff": "@@ -95,14 +95,6 @@ class Command {\nreturn [];\n}\n- get defaultOptions() {\n- return {\n- concurrency: DEFAULT_CONCURRENCY,\n- progress: true,\n- sort: true,\n- };\n- }\n-\nconfigureOptions() {\n// Command config object normalized to \"command\" namespace\nconst commandConfig = this.project.config.command || {};\n@@ -117,9 +109,7 @@ class Command {\n// Namespaced command options from `lerna.json`\n...overrides,\n// Global options from `lerna.json`\n- this.project.config,\n- // Command specific defaults\n- this.defaultOptions\n+ this.project.config\n);\n}\n", "new_path": "core/command/index.js", "old_path": "core/command/index.js" } ]
JavaScript
MIT License
lerna/lerna
feat(command): Remove .defaultOptions() from option resolution stack Yargs 12 no longer necessitates this repetitive workaround.
1
feat
command
749,552
16.07.2018 14:07:04
25,200
ab36a0b06a664a25830d5cbebbaac25955a76e56
fix(notifications): default Close type to "button"
[ { "change_type": "MODIFY", "diff": "@@ -19,6 +19,7 @@ const COMPONENT_ID = 'notifications.close';\nconst Close = styled.button.attrs({\n'data-garden-id': COMPONENT_ID,\n'data-garden-version': PACKAGE_VERSION,\n+ type: 'button',\nclassName: props =>\nclassNames(CalloutStyles['c-callout__close'], {\n// State\n", "new_path": "packages/notifications/src/content/Close.js", "old_path": "packages/notifications/src/content/Close.js" }, { "change_type": "MODIFY", "diff": "@@ -5,6 +5,7 @@ exports[`Close renders default close styling 1`] = `\nclassName=\"c-callout__close \"\ndata-garden-id=\"notifications.close\"\ndata-garden-version=\"version\"\n+ type=\"button\"\n/>\n`;\n@@ -13,6 +14,7 @@ exports[`Close state renders focused styling correctly 1`] = `\nclassName=\"c-callout__close is-focused \"\ndata-garden-id=\"notifications.close\"\ndata-garden-version=\"version\"\n+ type=\"button\"\n/>\n`;\n@@ -21,5 +23,6 @@ exports[`Close state renders hovered styling correctly 1`] = `\nclassName=\"c-callout__close is-hovered \"\ndata-garden-id=\"notifications.close\"\ndata-garden-version=\"version\"\n+ type=\"button\"\n/>\n`;\n", "new_path": "packages/notifications/src/content/__snapshots__/Close.spec.js.snap", "old_path": "packages/notifications/src/content/__snapshots__/Close.spec.js.snap" } ]
TypeScript
Apache License 2.0
zendeskgarden/react-components
fix(notifications): default Close type to "button" (#57)
1
fix
notifications
217,922
16.07.2018 14:10:49
-7,200
3a71d7326e05a13ac2f8d715393604f175e92bbb
feat: new dashed border for items with all final ingredients available closes
[ { "change_type": "MODIFY", "diff": "@@ -51,7 +51,4 @@ export class ListRow extends DataModel {\n* @type {boolean}\n*/\nusePrice?: boolean = true;\n-\n- // noinspection TsLint\n- priority?: boolean = false;\n}\n", "new_path": "src/app/model/list/list-row.ts", "old_path": "src/app/model/list/list-row.ts" }, { "change_type": "MODIFY", "diff": "[ngClass]=\"{'even': even, 'auto-height':true, 'compact':settings.compactLists,\n'done-row': item.done >= item.amount, 'craftable-row': canBeCrafted, 'has-all-ingredients-row': hasAllIngredients}\">\n<div class=\"item-col-left\">\n- <button class=\"priority-toggle\" *ngIf=\"recipe\" mat-icon-button (click)=\"togglePriority()\">\n- <mat-icon color=\"{{item.priority?'primary':''}}\" [class.inactive]=\"!item.priority\">priority_high</mat-icon>\n- </button>\n<div matListAvatar [ngClass]=\"{'icon':true, 'compact': settings.compactLists}\"\n[appXivdbTooltip]=\"item.id\" [appXivdbTooltipDisabled]=\"isDraft()\">\n<a matListAvatar disabled=\"isDraft()\" href=\"{{item.id | itemLink | i18n}}\" target=\"_blank\">\n", "new_path": "src/app/modules/item/item/item.component.html", "old_path": "src/app/modules/item/item/item.component.html" }, { "change_type": "MODIFY", "diff": "&.craftable-row {\nbackground-color: rgba(19, 168, 255, .2);\n}\n- &.has-all-ingredients-row {\n- background-color: rgba(229, 3, 255, 0.1);\n- }\n}\n.done-row {\n}\n.has-all-ingredients-row {\n- background-color: rgba(229, 3, 255, 0.3);\n+ border: 2px dashed rgba(19, 168, 255, .3);\n}\n.strike {\n", "new_path": "src/app/modules/item/item/item.component.scss", "old_path": "src/app/modules/item/item/item.component.scss" }, { "change_type": "MODIFY", "diff": "@@ -317,11 +317,6 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\n);\n}\n- togglePriority(): void {\n- this.item.priority = !this.item.priority;\n- this.update.emit();\n- }\n-\nisDraft(): boolean {\nreturn this.item.id.toString().indexOf('draft') > -1;\n}\n", "new_path": "src/app/modules/item/item/item.component.ts", "old_path": "src/app/modules/item/item/item.component.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
feat: new dashed border for items with all final ingredients available closes #491
1
feat
null
217,922
16.07.2018 14:11:14
-7,200
f0ab2d91dee333b46dea86310bc70d7768a3aaed
chore: scss cleanup
[ { "change_type": "MODIFY", "diff": "}\n}\n- .priority-toggle {\n- position: absolute;\n- left: -24px;\n- }\n-\n.even {\nbackground-color: rgba(123, 123, 123, .2);\n&.done-row {\n", "new_path": "src/app/modules/item/item/item.component.scss", "old_path": "src/app/modules/item/item/item.component.scss" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: scss cleanup
1
chore
null
217,922
16.07.2018 14:32:06
-7,200
19e7500c65a323879731c37eb61f6db62ddfcfbd
fix: fixed an issue with small desktop window size hiding some buttons
[ { "change_type": "MODIFY", "diff": "@@ -277,7 +277,7 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\nfolkloreId: number;\nisMobile = this.media.asObservable().pipe(map(mediaChange =>\n- (mediaChange.mqAlias === 'xs' || mediaChange.mqAlias === 'sm') && !this.platformService.isDesktop()\n+ mediaChange.mqAlias === 'xs' || (mediaChange.mqAlias === 'sm' && !this.platformService.isDesktop())\n));\npublic timers: Observable<Timer[]>;\n", "new_path": "src/app/modules/item/item/item.component.ts", "old_path": "src/app/modules/item/item/item.component.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix: fixed an issue with small desktop window size hiding some buttons
1
fix
null
217,922
16.07.2018 15:30:32
-7,200
943de7d530ace45f649f10cf0e394ede5bd5e3ff
fix: fixed an issue withr ecipe swap in simulator not updating stats properly
[ { "change_type": "MODIFY", "diff": "@@ -346,8 +346,9 @@ export class SimulatorComponent implements OnInit, OnDestroy {\nthis.recipe$,\nthis.actions$,\nthis.crafterStats$,\n- this.hqIngredients$,\n- (recipe, actions, stats, hqIngredients) => new Simulation(recipe, actions, stats, hqIngredients)\n+ this.hqIngredients$)\n+ .pipe(\n+ map(([recipe, actions, stats, hqIngredients]) => new Simulation(recipe, actions, stats, hqIngredients))\n);\nthis.result$ = combineLatest(this.snapshotStep$, this.simulation$, (step, simulation) => {\n@@ -389,12 +390,15 @@ export class SimulatorComponent implements OnInit, OnDestroy {\n}\nngOnInit(): void {\n- combineLatest(this.recipe$, this.gearsets$, (recipe, gearsets) => {\n+ combineLatest(this.recipe$, this.gearsets$)\n+ .pipe(\n+ map(([recipe, gearsets]) => {\nreturn {\nset: gearsets.find(set => set.jobId === recipe.job),\nlevels: <CrafterLevels>gearsets.map(set => set.level)\n};\n- }).subscribe(res => {\n+ })\n+ ).subscribe(res => {\nthis.selectedSet = this.selectedSet || res.set;\nthis.applyStats(res.set, res.levels, false);\n});\n@@ -643,6 +647,7 @@ export class SimulatorComponent implements OnInit, OnDestroy {\nif (this.rotation.$key !== undefined) {\npath.push(this.rotation.$key);\n}\n+ this.selectedSet = undefined;\nthis.router.navigate(path);\n});\n}\n", "new_path": "src/app/pages/simulator/components/simulator/simulator.component.ts", "old_path": "src/app/pages/simulator/components/simulator/simulator.component.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix: fixed an issue withr ecipe swap in simulator not updating stats properly
1
fix
null
679,913
16.07.2018 17:19:30
-3,600
3c1c29ac483b224ecae4d148eb660ce0c7885e0d
refactor(examples): remove atom usage from rstream-hdom demo, update docs
[ { "change_type": "MODIFY", "diff": "@@ -21,7 +21,7 @@ If you want to [contribute](../CONTRIBUTING.md) an example, please get in touch\n| 13 | [router-basics](./router-basics) | Complete mini SPA | atom, hdom, interceptors, router | advanced |\n| 14 | [rstream-dataflow](./rstream-dataflow) | Dataflow graph | atom, hdom, rstream, rstream-gestures, rstream-graph, transducers | intermediate |\n| 15 | [rstream-grid](./rstream-grid) | Dataflow graph SVG grid | atom, hdom, hiccup-svg, interceptors, rstream-graph, transducers | advanced |\n-| 16 | [rstream-hdom](./rstream-hdom) | rstream based UI updates | hdom, rstream, transducers | intermediate |\n+| 16 | [rstream-hdom](./rstream-hdom) | rstream based UI updates & state handling | hdom, rstream, transducers | intermediate |\n| 17 | [svg-particles](./svg-particles) | hdom SVG generation / animation | hdom, transducers | basic |\n| 18 | [svg-waveform](./svg-waveform) | hdom SVG generation / undo history | atom, hdom, hiccup-svg, interceptors, iterators | intermediate |\n| 19 | [todo-list](./todo-list) | Canonical Todo list with undo/redo | atom, hdom, transducers | intermediate |\n", "new_path": "examples/README.md", "old_path": "examples/README.md" }, { "change_type": "MODIFY", "diff": "This example shows how\n[@thi.ng/rstream](https://github.com/thi-ng/umbrella/tree/master/packages/rstream)\n-can be used to reactively trigger\n+constructs can be used for state handling and reactively trigger\n[@thi.ng/hdom](https://github.com/thi-ng/umbrella/tree/master/packages/hdom)\n-updates only when the [central app state\n-atom](https://github.com/thi-ng/umbrella/tree/master/packages/atom/README.md#atom)\n-has changed.\n+updates only when any of the UI related streams have value changes.\n```\ngit clone https://github.com/thi-ng/umbrella.git\n", "new_path": "examples/rstream-hdom/README.md", "old_path": "examples/rstream-hdom/README.md" }, { "change_type": "MODIFY", "diff": "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n<meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n<title>rstream-hdom</title>\n- <!-- <link href=\"https://unpkg.com/tachyons@4.9.1/css/tachyons.min.css\" rel=\"stylesheet\"> -->\n+ <link href=\"https://unpkg.com/tachyons@4.9.1/css/tachyons.min.css\" rel=\"stylesheet\">\n+ <!-- <link href=\"tachyons.min.css\" rel=\"stylesheet\"> -->\n<style>\n</style>\n</head>\n", "new_path": "examples/rstream-hdom/index.html", "old_path": "examples/rstream-hdom/index.html" }, { "change_type": "MODIFY", "diff": "-import { Atom } from \"@thi.ng/atom\";\nimport { diffElement, normalizeTree } from \"@thi.ng/hdom\";\n-import { fromRAF, fromView, sidechainPartition } from \"@thi.ng/rstream\";\n-import { reducer, scan } from \"@thi.ng/transducers\";\n+import { fromRAF } from \"@thi.ng/rstream/from/raf\";\n+import { sync } from \"@thi.ng/rstream/stream-sync\";\n+import { sidechainPartition } from \"@thi.ng/rstream/subs/sidechain-partition\";\n+import { Subscription } from \"@thi.ng/rstream/subscription\";\n+import { vals } from \"@thi.ng/transducers/iter/vals\";\n+import { reducer } from \"@thi.ng/transducers/reduce\";\n+import { map } from \"@thi.ng/transducers/xform/map\";\n+import { scan } from \"@thi.ng/transducers/xform/scan\";\n+\n+// example user context object\n+// here only used to provide style / theme config using\n+// Tachyons CSS classes\n+const ctx = {\n+ ui: {\n+ root: {\n+ class: \"pa2\"\n+ },\n+ button: {\n+ class: \"w4 h2 bg-black white bn br2 mr2 pointer\"\n+ }\n+ }\n+};\n/**\n- * Reactively triggers DOM update whenever state atom embedded in given\n- * user context object has value changes (the context object is assumed\n- * to have a `state` key holding the atom). Additionally, a RAF side\n- * chain stream is used to synchronize DOM updates to be processed\n- * during RAF.\n+ * Takes a `parent` DOM element, a stream of `root` component values and\n+ * an arbitrary user context object which will be implicitly passed to\n+ * all component functions embedded in the root component. Subscribes to\n+ * `root` stream & performs DOM updates using incoming values (i.e. UI\n+ * components). Additionally, a RAF side chain stream is used to\n+ * synchronize DOM updates to be processed during RAF.\n*\n* Returns stream of hdom trees.\n*\n* @param parent root DOM element\n- * @param root root hdom component\n+ * @param root root hdom component stream\n* @param ctx user context object\n*/\nconst domUpdate = (parent, root, ctx) => {\n- return fromView(ctx.state, \"\")\n+ return root\n// use RAF stream as side chain trigger to\n// force DOM updates to execute during RAF\n.subscribe(sidechainPartition(fromRAF()))\n// transform atom value changes using transducers\n.transform(\n+ // first normalize/expand hdom component tree\n+ map((curr: any[]) => normalizeTree(curr[curr.length - 1], ctx)),\n+ // then perform diff & selective DOM update\nscan<any, any>(\nreducer(\n() => [],\n- (prev, curr) => {\n- curr = normalizeTree(root, ctx);\n- diffElement(parent, prev, curr);\n- return curr;\n- }\n+ (prev, curr) => (diffElement(parent, prev, curr), curr)\n)\n)\n);\n};\n/**\n- * Generic button\n+ * Generic button component.\n+ *\n* @param ctx hdom user context\n* @param onclick event handler\n* @param body button body\n@@ -46,41 +66,75 @@ const button = (ctx, onclick, body) =>\n[\"button\", { ...ctx.ui.button, onclick }, body];\n/**\n- * Specialized button for counters.\n+ * Specialized button component for counters.\n*\n- * @param ctx hdom user context\n- * @param idx index in `clicks` array\n- * @param val current click val\n+ * @param _ hdom user context (unused)\n+ * @param stream target stream\n+ * @param val current click value\n+ * @param step counter step value\n*/\n-const clickButton = (ctx, idx, val) =>\n- [button, () => ctx.state.swapIn([\"clicks\", idx], (n: number) => n + 1), `clicks: ${val}`];\n+const clickButton = (_, stream) =>\n+ [button, () => stream.next(true), stream.deref()];\n/**\n- * Root component function\n+ * Specialized button to reset all counters.\n*\n- * @param ctx\n+ * @param _ hdom user context (unused)\n+ * @param counters streams to reset\n*/\n-const root = (ctx) =>\n- [\"div\",\n- ctx.state.deref().clicks.map((x, i) => [clickButton, i, x]),\n- [button, () => ctx.state.resetIn(\"clicks\", [0, 0, 0]), \"reset\"]\n- ];\n+const resetButton = (_, counters) =>\n+ [button, () => counters.forEach((c) => c.next(false)), \"reset\"];\n-// example user context w/ embedded app state atom\n-const ctx = {\n- state: new Atom({ clicks: [0, 0, 0] }),\n- ui: {\n- button: {\n- style: {\n- background: \"yellow\",\n- margin: \"0.5rem\",\n- padding: \"0.5rem\"\n- }\n- }\n- }\n+/**\n+ * Creates a stream of counter values. Each time `true` is written to\n+ * the stream, the counter increases by given step value. If false is\n+ * written, the counter resets to the `start` value.\n+ *\n+ * @param start\n+ * @param step\n+ */\n+const counter = (start, step) => {\n+ const s = new Subscription<boolean, number>(\n+ null,\n+ // the `scan` transducer is used to provide counter functionality\n+ // see: https://github.com/thi-ng/umbrella/blob/master/packages/transducers/src/xform/scan.ts\n+ scan(reducer(() => start, (x, y) => y ? x + step : start))\n+ );\n+ s.next(false);\n+ return s;\n};\n-// start app\n-domUpdate(document.getElementById(\"app\"), root, ctx)\n- // attach debug subscription\n- .subscribe({ next(tree) { console.log(\"DOM updated\", tree); } });\n+/**\n+ * Root component stream factory. Accepts array of initial counter\n+ * values and their step values, creates streams for each and returns a\n+ * StreamSync instance, which merges and converts these streams into a\n+ * single component.\n+ *\n+ * @param initial initial counter configs\n+ */\n+const app = (ctx, initial: number[][]) => {\n+ const counters = initial.map(([start, step]) => counter(start, step));\n+ return sync({\n+ src: counters.map((c) => c.transform(map(() => [clickButton, c]))),\n+ xform: map(\n+ // build the app's actual root component\n+ (buttons) => [\"div\", ctx.ui.root, ...vals(buttons), [resetButton, counters]]\n+ ),\n+ // this config ensures that only at the very beginning *all*\n+ // inputs must have delivered a value (i.e. stream\n+ // synchronization) before this stream itself delivers a value.\n+ // however, by stating `reset: false` any subsequent changes to\n+ // any of the inputs will not be synchronized\n+ // see here for further details:\n+ // https://github.com/thi-ng/umbrella/blob/master/packages/rstream/src/stream-sync.ts#L21\n+ // https://github.com/thi-ng/umbrella/blob/master/packages/transducers/src/xform/partition-sync.ts#L7\n+ reset: false,\n+ });\n+};\n+\n+// start app & DOM updates\n+domUpdate(\n+ document.getElementById(\"app\"),\n+ app(ctx, [[10, 1], [20, 5], [30, 10]]),\n+ ctx\n+);\n", "new_path": "examples/rstream-hdom/src/index.ts", "old_path": "examples/rstream-hdom/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(examples): remove atom usage from rstream-hdom demo, update docs
1
refactor
examples
807,823
16.07.2018 17:31:29
14,400
346d156bd6e9936d0e2a22255eece1f2ca7d07c2
feat(add): Add `--exact` option to `lerna add` Closes
[ { "change_type": "MODIFY", "diff": "## Usage\n```sh\n-$ lerna add <package>[@version] [--dev]\n+$ lerna add <package>[@version] [--dev] [--exact]\n```\nAdd local or remote `package` as dependency to packages in the current Lerna repo.\n@@ -25,6 +25,14 @@ If no `version` specifier is provided, it defaults to the `latest` dist-tag, jus\nAdd the new package to `devDependencies` instead of `dependencies`.\n+### --exact\n+\n+```sh\n+$ lerna add --exact\n+```\n+\n+Add the new package with an exact version (e.g., `1.0.1`) rather than the default `^` semver range (e.g., `^1.0.1`).\n+\n## Examples\n```sh\n", "new_path": "commands/add/README.md", "old_path": "commands/add/README.md" }, { "change_type": "MODIFY", "diff": "@@ -87,6 +87,16 @@ describe(\"AddCommand\", () => {\nexpect(await readPkg(testDir, \"packages/package-2\")).toDependOn(\"@test/package-1\", \"~1\");\n});\n+ it(\"should reference exact version if --exact\", async () => {\n+ const testDir = await initFixture(\"basic\");\n+\n+ await lernaAdd(testDir)(\"@test/package-1\", \"--exact\");\n+\n+ expect(await readPkg(testDir, \"packages/package-2\")).toDependOn(\"@test/package-1\", \"1.0.0\", {\n+ exact: true,\n+ });\n+ });\n+\nit(\"should add target package to devDependencies\", async () => {\nconst testDir = await initFixture(\"basic\");\n@@ -153,7 +163,7 @@ describe(\"AddCommand\", () => {\nawait lernaAdd(testDir)(\"tiny-tarball@1.0.0\");\n- expect(await readPkg(testDir, \"packages/package-1\")).toDependOn(\"tiny-tarball\", \"1.0.0\");\n+ expect(await readPkg(testDir, \"packages/package-1\")).toDependOn(\"tiny-tarball\", \"1.0.0\", { exact: true });\n});\nit(\"should bootstrap changed packages\", async () => {\n@@ -199,4 +209,15 @@ describe(\"AddCommand\", () => {\nexpect(bootstrap).not.toHaveBeenCalled();\n});\n+\n+ it(\"should reset a dependency from caret to exact\", async () => {\n+ const testDir = await initFixture(\"basic\");\n+\n+ await lernaAdd(testDir)(\"@test/package-1\");\n+ await lernaAdd(testDir)(\"@test/package-1\", \"--exact\");\n+\n+ expect(await readPkg(testDir, \"packages/package-2\")).toDependOn(\"@test/package-1\", \"1.0.0\", {\n+ exact: true,\n+ });\n+ });\n});\n", "new_path": "commands/add/__tests__/add-command.test.js", "old_path": "commands/add/__tests__/add-command.test.js" }, { "change_type": "MODIFY", "diff": "@@ -26,6 +26,12 @@ exports.builder = yargs => {\nalias: \"D\",\ndescribe: \"Save to devDependencies\",\n},\n+ exact: {\n+ group: \"Command Options:\",\n+ type: \"boolean\",\n+ alias: \"E\",\n+ describe: \"Save version exactly\",\n+ },\n});\nreturn filterable(yargs);\n", "new_path": "commands/add/command.js", "old_path": "commands/add/command.js" }, { "change_type": "MODIFY", "diff": "@@ -29,6 +29,9 @@ class AddCommand extends Command {\nthis.dirs = new Set(this.options.globs.map(fp => path.resolve(this.project.rootPath, fp)));\nthis.selfSatisfied = this.packageSatisfied();\n+ // https://docs.npmjs.com/misc/config#save-prefix\n+ this.savePrefix = this.options.exact ? \"\" : \"^\";\n+\nif (this.packageGraph.has(this.spec.name) && !this.selfSatisfied) {\nconst available = this.packageGraph.get(this.spec.name).version;\n@@ -107,7 +110,7 @@ class AddCommand extends Command {\nreturn true;\n}\n- return getRangeToReference(this.spec, deps) !== deps[targetName];\n+ return getRangeToReference(this.spec, deps, this.savePrefix) !== deps[targetName];\n});\nreturn result;\n@@ -118,7 +121,7 @@ class AddCommand extends Command {\nreturn pMap(this.packagesToChange, pkg => {\nconst deps = this.getPackageDeps(pkg);\n- const range = getRangeToReference(this.spec, deps);\n+ const range = getRangeToReference(this.spec, deps, this.savePrefix);\nthis.logger.verbose(\"add\", `${targetName}@${range} as ${this.dependencyType} in ${pkg.name}`);\ndeps[targetName] = range;\n", "new_path": "commands/add/index.js", "old_path": "commands/add/index.js" }, { "change_type": "MODIFY", "diff": "@@ -4,11 +4,11 @@ const semver = require(\"semver\");\nmodule.exports = getRangeToReference;\n-function getRangeToReference(spec, deps) {\n+function getRangeToReference(spec, deps, prefix) {\nconst current = deps[spec.name];\n- const resolved = spec.type === \"tag\" ? `^${spec.version}` : spec.fetchSpec;\n+ const resolved = spec.type === \"tag\" ? `${prefix}${spec.version}` : spec.fetchSpec;\n- if (current && semver.intersects(current, resolved)) {\n+ if (prefix && current && semver.intersects(current, resolved)) {\nreturn current;\n}\n", "new_path": "commands/add/lib/get-range-to-reference.js", "old_path": "commands/add/lib/get-range-to-reference.js" }, { "change_type": "MODIFY", "diff": "@@ -21,7 +21,8 @@ const matchBinaryLinks = () => (pkgRef, raw) => {\n? inputs.reduce((acc, input) => [...acc, input, [input, \"cmd\"].join(\".\")], [])\n: inputs;\n- const expectation = `expected ${pkg.name} to link to ${links.join(\", \")}`;\n+ const expectedName = `expected ${pkg.name}`;\n+ const expectedAction = `to link to ${links.join(\", \")}`;\nlet found;\n@@ -29,7 +30,10 @@ const matchBinaryLinks = () => (pkgRef, raw) => {\nfound = fs.readdirSync(pkg.binLocation);\n} catch (err) {\nif (links.length === 0 && err.code === \"ENOENT\") {\n- return { message: \"expected no binary links\", pass: true };\n+ return {\n+ message: () => `${expectedName} to have binary links`,\n+ pass: true,\n+ };\n}\nthrow err;\n@@ -40,7 +44,8 @@ const matchBinaryLinks = () => (pkgRef, raw) => {\nif (missing.length > 0 || superfluous.length > 0) {\nconst message = [\n- expectation,\n+ expectedName,\n+ expectedAction,\nmissing.length > 0 ? `missing: ${missing.join(\", \")}` : \"\",\nsuperfluous.length > 0 ? `superfluous: ${superfluous.join(\", \")}` : \"\",\n]\n@@ -48,28 +53,31 @@ const matchBinaryLinks = () => (pkgRef, raw) => {\n.join(\"\\n\");\nreturn {\n- message,\n+ message: () => message,\npass: false,\n};\n}\nreturn {\n- message: expectation,\n+ message: () => `${expectedName} not ${expectedAction}`,\npass: true,\n};\n};\n-const matchDependency = dependencyType => (manifest, pkg, range) => {\n+const matchDependency = dependencyType => (manifest, pkg, range, options) => {\nconst noDeps = typeof manifest[dependencyType] !== \"object\";\nconst id = [pkg, range].filter(Boolean).join(\"@\");\nconst verb = dependencyType === \"dependencies\" ? \"depend\" : \"dev-depend\";\n+ const exact = options && options.exact;\n- const expectation = `expected ${manifest.name} to ${verb} on ${id}`;\n+ const expectedName = `expected ${manifest.name}`;\n+ const expectedAction = `to ${verb} on ${id}`;\n+ const expectation = `${expectedName} ${expectedAction}`;\nconst json = JSON.stringify(manifest[dependencyType], null, \" \");\nif (noDeps) {\nreturn {\n- message: `${expectation} but no .${dependencyType} specified`,\n+ message: () => `${expectation} but no .${dependencyType} specified`,\npass: false,\n};\n}\n@@ -78,7 +86,7 @@ const matchDependency = dependencyType => (manifest, pkg, range) => {\nif (missingDep) {\nreturn {\n- message: `${expectation} but it is missing from .${dependencyType}\\n${json}`,\n+ message: () => `${expectation} but it is missing from .${dependencyType}\\n${json}`,\npass: false,\n};\n}\n@@ -88,13 +96,30 @@ const matchDependency = dependencyType => (manifest, pkg, range) => {\nif (mismatchedDep) {\nreturn {\n- message: `${expectation} but ${version} does not satisfy ${range}\\n${json}`,\n+ message: () => `${expectation} but ${version} does not satisfy ${range}\\n${json}`,\n+ pass: false,\n+ };\n+ }\n+\n+ if (exact) {\n+ if (!semver.valid(version)) {\n+ return {\n+ message: () => `${expectation} but ${version} is not an exact version\\n${json}`,\npass: false,\n};\n}\n+ // semver.eq will throw a TypeError if range is not a valid exact version\n+ if (!semver.eq(version, range)) {\nreturn {\n- message: expectation,\n+ message: () => `${expectation} but ${version} is not ${range}\\n${json}`,\n+ pass: false,\n+ };\n+ }\n+ }\n+\n+ return {\n+ message: () => `${expectedName} not ${expectedAction}`,\npass: true,\n};\n};\n@@ -104,8 +129,9 @@ const X_OK = (fs.constants || fs).X_OK;\nconst matchExecutableFile = () => (pkgRef, raw) => {\nconst files = Array.isArray(raw) ? raw : [raw];\n- const expectation = `expected ${files.join(\", \")} to be executable`;\n-\n+ const expectedFiles = `expected ${files.join(\", \")}`;\n+ const expectedAction = \"to be executable\";\n+ const expectation = `${expectedFiles} ${expectedAction}`;\nconst pkg = toPackage(pkgRef);\nconst failed = files.filter(file => {\n@@ -120,11 +146,11 @@ const matchExecutableFile = () => (pkgRef, raw) => {\nconst verb = failed.length > 1 ? \"were\" : \"was\";\nconst message = pass\n- ? expectation\n+ ? `${expectedFiles} not ${expectedAction}`\n: `${expectation} while ${failed.join(\", \")} ${verb} found to be not executable.`;\nreturn {\n- message,\n+ message: () => message,\npass,\n};\n};\n", "new_path": "helpers/pkg-matchers/index.js", "old_path": "helpers/pkg-matchers/index.js" } ]
JavaScript
MIT License
lerna/lerna
feat(add): Add `--exact` option to `lerna add` (#1478) Closes #1470
1
feat
add
217,922
16.07.2018 17:37:16
-7,200
96fa48abe5b1541794988470b05af2678ce5bcfc
chore: [WIP] Flexible notification system
[ { "change_type": "MODIFY", "diff": "@@ -43,6 +43,8 @@ import {LinkToolsService} from './tools/link-tools.service';\nimport {PlatformService} from './tools/platform.service';\nimport {IpcService} from './electron/ipc.service';\nimport {SharedEntityService} from './database/shared-entity/shared-entity.service';\n+import {AbstractNotification} from './notification/abstract-notification';\n+import {ListProgressNotification} from '../model/notification/list-progress-notification';\nexport const DATA_EXTRACTORS: Provider[] = [\n@@ -62,7 +64,14 @@ export const DATA_EXTRACTORS: Provider[] = [\n@NgModule({\nimports: [\nHttpClientModule,\n- NgSerializerModule,\n+ NgSerializerModule.forChild([\n+ {\n+ parent: AbstractNotification,\n+ children: {\n+ LIST_UPDATE: ListProgressNotification,\n+ }\n+ }\n+ ]),\nTranslateModule,\nAngularFireModule,\nMatDialogModule,\n", "new_path": "src/app/core/core.module.ts", "old_path": "src/app/core/core.module.ts" }, { "change_type": "MODIFY", "diff": "@@ -8,6 +8,7 @@ import {FirestoreListStorage} from './storage/list/firestore-list-storage';\nimport {ListTemplateService} from './list-template/list-template.service';\nimport {CraftingRotationService} from './crafting-rotation.service';\nimport {CommissionService} from './commission/commission.service';\n+import {NotificationService} from './notification.service';\n@NgModule({\n@@ -22,6 +23,7 @@ import {CommissionService} from './commission/commission.service';\nListTemplateService,\nCraftingRotationService,\nCommissionService,\n+ NotificationService,\n]\n})\nexport class DatabaseModule {\n", "new_path": "src/app/core/database/database.module.ts", "old_path": "src/app/core/database/database.module.ts" }, { "change_type": "ADD", "diff": "+import {RelationshipService} from './relational/relationship.service';\n+import {NotificationRelationship} from '../notification/notification-relationship';\n+import {Injectable, NgZone} from '@angular/core';\n+import {NgSerializerService} from '@kaiu/ng-serializer';\n+import {AngularFirestore} from 'angularfire2/firestore';\n+import {PendingChangesService} from './pending-changes/pending-changes.service';\n+\n+@Injectable({\n+ providedIn: 'root'\n+})\n+export class NotificationService extends RelationshipService<NotificationRelationship> {\n+\n+ protected constructor(protected firestore: AngularFirestore, protected serializer: NgSerializerService, protected zone: NgZone,\n+ protected pendingChangesService: PendingChangesService) {\n+ super(firestore, serializer, zone, pendingChangesService);\n+ }\n+\n+ protected getRelationCollection(): string {\n+ return 'notifications';\n+ }\n+\n+ protected getClass(): any {\n+ return NotificationRelationship;\n+ }\n+\n+}\n", "new_path": "src/app/core/database/notification.service.ts", "old_path": null }, { "change_type": "ADD", "diff": "+import {FirestoreStorage} from '../storage/firebase/firestore-storage';\n+import {Relationship} from './relationship';\n+import {Observable} from 'rxjs/index';\n+import {NgSerializerService} from '@kaiu/ng-serializer';\n+import {AngularFirestore} from 'angularfire2/firestore';\n+import {NgZone} from '@angular/core';\n+import {PendingChangesService} from '../pending-changes/pending-changes.service';\n+import {map} from 'rxjs/operators';\n+\n+export abstract class RelationshipService<T extends Relationship<any, any>> extends FirestoreStorage<T> {\n+\n+ protected constructor(protected firestore: AngularFirestore, protected serializer: NgSerializerService, protected zone: NgZone,\n+ protected pendingChangesService: PendingChangesService) {\n+ super(firestore, serializer, zone, pendingChangesService);\n+ }\n+\n+ protected abstract getRelationCollection(): string;\n+\n+ public getByFrom(from: string): Observable<Relationship<any, any>[]> {\n+ return this.firestore.collection(this.getBaseUri(), ref => ref.where('from', '==', from))\n+ .snapshotChanges()\n+ .pipe(\n+ map((snaps: any[]) => snaps.map(snap => ({$key: snap.payload.doc.id, ...snap.payload.doc.data()}))),\n+ map((lists: any[]) => this.serializer.deserialize<Relationship<any, any>>(lists, [Relationship]))\n+ );\n+ }\n+\n+ public getByTo(to: string): Observable<Relationship<any, any>[]> {\n+ return this.firestore.collection(this.getBaseUri(), ref => ref.where('to', '==', to))\n+ .snapshotChanges()\n+ .pipe(\n+ map((snaps: any[]) => snaps.map(snap => ({$key: snap.payload.doc.id, ...snap.payload.doc.data()}))),\n+ map((lists: any[]) => this.serializer.deserialize<Relationship<any, any>>(lists, [Relationship]))\n+ );\n+ }\n+\n+ public getBaseUri(): string {\n+ return `relationships/${this.getRelationCollection()}`\n+ }\n+}\n", "new_path": "src/app/core/database/relational/relationship.service.ts", "old_path": null }, { "change_type": "ADD", "diff": "+import {DataModel} from '../storage/data-model';\n+\n+export abstract class Relationship<F, T> extends DataModel {\n+ from: F;\n+\n+ to: T;\n+}\n", "new_path": "src/app/core/database/relational/relationship.ts", "old_path": null }, { "change_type": "ADD", "diff": "+import {NotificationType} from './notification-type';\n+import {Parent} from '@kaiu/serializer';\n+\n+@Parent({\n+ allowSelf: false,\n+ discriminatorField: 'type'\n+})\n+export abstract class AbstractNotification {\n+\n+ protected constructor(public readonly type: NotificationType) {\n+ }\n+}\n", "new_path": "src/app/core/notification/abstract-notification.ts", "old_path": null }, { "change_type": "ADD", "diff": "+import {Relationship} from '../database/relational/relationship';\n+import {AbstractNotification} from './abstract-notification';\n+import {DeserializeAs} from '@kaiu/serializer';\n+\n+export class NotificationRelationship extends Relationship<string, AbstractNotification> {\n+\n+ from: string;\n+\n+ @DeserializeAs(AbstractNotification)\n+ to: AbstractNotification;\n+}\n", "new_path": "src/app/core/notification/notification-relationship.ts", "old_path": null }, { "change_type": "ADD", "diff": "+export enum NotificationType {\n+ LIST_PROGRESS = 'LIST_PROGRESS'\n+}\n", "new_path": "src/app/core/notification/notification-type.ts", "old_path": null }, { "change_type": "ADD", "diff": "+import {AbstractNotification} from '../../core/notification/abstract-notification';\n+import {NotificationType} from '../../core/notification/notification-type';\n+\n+/**\n+ * This class describes a notification for when a progress has been made on an item.\n+ *\n+ * Example: \"Miu Asakura added 3 Copper Ore to \"Copper ingot\" \"\n+ */\n+export class ListProgressNotification extends AbstractNotification {\n+\n+ constructor(public listName: string, public modificationAuthorName: string, public amount: number,\n+ public itemId: number) {\n+ super(NotificationType.LIST_PROGRESS);\n+ }\n+}\n", "new_path": "src/app/model/notification/list-progress-notification.ts", "old_path": null } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: [WIP] Flexible notification system
1
chore
null
679,913
16.07.2018 17:44:11
-3,600
694e6c6450ff834bcc512b6014eb6d27f386a000
feat(examples): improve time labels on crypto-chart
[ { "change_type": "MODIFY", "diff": "@@ -3,6 +3,7 @@ import { diffElement } from \"@thi.ng/hdom/diff\";\nimport { normalizeTree } from \"@thi.ng/hdom/normalize\";\nimport { group } from \"@thi.ng/hiccup-svg/group\";\nimport { line } from \"@thi.ng/hiccup-svg/line\";\n+import { polygon } from \"@thi.ng/hiccup-svg/polygon\";\nimport { polyline } from \"@thi.ng/hiccup-svg/polyline\";\nimport { rect } from \"@thi.ng/hiccup-svg/rect\";\nimport { svg } from \"@thi.ng/hiccup-svg/svg\";\n@@ -61,7 +62,22 @@ const DAY = 60 * 60 * 24;\nconst TIME_TICKS = {\n1: 15 * 60,\n60: DAY,\n- 1440: DAY * 7\n+ 1440: DAY * 14\n+};\n+\n+const TIME_FORMATS = {\n+ 1: (t: number) => {\n+ const d = new Date(t * 1000);\n+ return `${Z2(d.getUTCHours())}:${Z2(d.getUTCMinutes())}`;\n+ },\n+ 60: (t: number) => {\n+ const d = new Date(t * 1000);\n+ return `${d.getUTCFullYear()}-${Z2(d.getUTCMonth() + 1)}-${Z2(d.getUTCDate())}`;\n+ },\n+ 1440: (t: number) => {\n+ const d = new Date(t * 1000);\n+ return `${d.getUTCFullYear()}-${Z2(d.getUTCMonth() + 1)}-${Z2(d.getUTCDate())}`;\n+ }\n};\n// UI theme presets\n@@ -72,7 +88,8 @@ const THEMES = {\nbody: \"black\",\nchart: {\naxis: \"#000\",\n- price: \"#333\",\n+ price: \"#006\",\n+ pricelabel: \"#fff\",\nbull: \"#6c0\",\nbear: \"#f04\",\nsma12: \"#00f\",\n@@ -89,6 +106,7 @@ const THEMES = {\nchart: {\naxis: \"#eee\",\nprice: \"#09f\",\n+ pricelabel: \"#fff\",\nbull: \"#6c0\",\nbear: \"#f04\",\nsma12: \"#ff0\",\n@@ -111,11 +129,11 @@ const API_URL = (market, symbol, period) =>\n// helper functions\nconst clamp = (x: number, min: number, max: number) => x < min ? min : x > max ? max : x;\nconst fit = (x, a, b, c, d) => c + (d - c) * clamp((x - a) / (b - a), 0, 1);\n-\n-const fmtTime = (t: number) => {\n- const d = new Date(t * 1000);\n- return `${d.getUTCFullYear()}-${d.getUTCMonth() + 1}-${d.getUTCDate()}`;\n+const padl = (n: number, ch: string) => {\n+ const buf = new Array(n).fill(ch).join(\"\");\n+ return (x: any) => (x = x.toString(), x.length < n ? buf.substr(x.length) + x : x);\n};\n+const Z2 = padl(2, \"0\");\nconst emitOnStream = (stream) => (e) => stream.next(e.target.value);\n@@ -184,9 +202,11 @@ const chart = sync({\n// use preset time precisions based on current chart period\nconst tickX = TIME_TICKS[data.period];\n+ const fmtTime: (t: number) => string = TIME_FORMATS[data.period];\n// price resolution estimation based on actual OHLC interval\nconst tickY = Math.pow(10, Math.floor(Math.log(Math.round(data.max - data.min)) / Math.log(10))) / 2;\nconst lastPrice = ohlc[ohlc.length - 1].close;\n+ const closeX = width - MARGIN_X;\nconst closeY = mapY(lastPrice);\n// inline definition of SVG chart\nreturn svg(\n@@ -252,8 +272,13 @@ const chart = sync({\nohlc\n),\n// price line\n- line([MARGIN_X, closeY], [width - MARGIN_X, closeY], { stroke: theme.chart.price }),\n- text(lastPrice.toFixed(2), [width - MARGIN_X + 5, closeY + 4], { fill: theme.chart.price }),\n+ line([MARGIN_X, closeY], [closeX, closeY], { stroke: theme.chart.price }),\n+ // tag\n+ polygon(\n+ [[closeX, closeY], [closeX + 10, closeY - 8], [width, closeY - 8], [width, closeY + 8], [closeX + 10, closeY + 8]],\n+ { fill: theme.chart.price }\n+ ),\n+ text(lastPrice.toFixed(2), [closeX + 12, closeY + 4], { fill: theme.chart.pricelabel }),\n)\n})\n});\n@@ -305,7 +330,8 @@ sync({\nchart,\n[\"div.fixed.f7\",\n{ style: { top: `10px`, right: `${MARGIN_X}px` } },\n- \"Made with @thi.ng/umbrella / \",\n+ [\"span.dn.dib-l.mr2\",\n+ \"Made with @thi.ng/umbrella\"],\n[\"a\",\n{\nclass: `mr3 b link ${theme.body}`,\n", "new_path": "examples/crypto-chart/src/index.ts", "old_path": "examples/crypto-chart/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(examples): improve time labels on crypto-chart
1
feat
examples
679,913
16.07.2018 18:08:18
-3,600
0508e40adbcb2ec718d5806fa36df9dad81da245
docs(examples): add/update types in rstream-hdom
[ { "change_type": "MODIFY", "diff": "import { diffElement, normalizeTree } from \"@thi.ng/hdom\";\n+import { ISubscribable } from \"@thi.ng/rstream/api\";\nimport { fromRAF } from \"@thi.ng/rstream/from/raf\";\nimport { sync } from \"@thi.ng/rstream/stream-sync\";\nimport { sidechainPartition } from \"@thi.ng/rstream/subs/sidechain-partition\";\n@@ -36,7 +37,7 @@ const ctx = {\n* @param root root hdom component stream\n* @param ctx user context object\n*/\n-const domUpdate = (parent, root, ctx) => {\n+const domUpdate = (parent: HTMLElement, root: ISubscribable<any>, ctx: any) => {\nreturn root\n// use RAF stream as side chain trigger to\n// force DOM updates to execute during RAF\n@@ -44,6 +45,7 @@ const domUpdate = (parent, root, ctx) => {\n// transform atom value changes using transducers\n.transform(\n// first normalize/expand hdom component tree\n+ // only use very last received value\nmap((curr: any[]) => normalizeTree(curr[curr.length - 1], ctx)),\n// then perform diff & selective DOM update\nscan<any, any>(\n@@ -62,18 +64,16 @@ const domUpdate = (parent, root, ctx) => {\n* @param onclick event handler\n* @param body button body\n*/\n-const button = (ctx, onclick, body) =>\n+const button = (ctx: any, onclick: EventListener, body: any) =>\n[\"button\", { ...ctx.ui.button, onclick }, body];\n/**\n* Specialized button component for counters.\n*\n* @param _ hdom user context (unused)\n- * @param stream target stream\n- * @param val current click value\n- * @param step counter step value\n+ * @param stream counter stream\n*/\n-const clickButton = (_, stream) =>\n+const clickButton = (_, stream: Subscription<boolean, number>) =>\n[button, () => stream.next(true), stream.deref()];\n/**\n@@ -82,7 +82,7 @@ const clickButton = (_, stream) =>\n* @param _ hdom user context (unused)\n* @param counters streams to reset\n*/\n-const resetButton = (_, counters) =>\n+const resetButton = (_, counters: Subscription<boolean, number>[]) =>\n[button, () => counters.forEach((c) => c.next(false)), \"reset\"];\n/**\n@@ -93,7 +93,7 @@ const resetButton = (_, counters) =>\n* @param start\n* @param step\n*/\n-const counter = (start, step) => {\n+const counter = (start: number, step: number) => {\nconst s = new Subscription<boolean, number>(\nnull,\n// the `scan` transducer is used to provide counter functionality\n@@ -112,7 +112,7 @@ const counter = (start, step) => {\n*\n* @param initial initial counter configs\n*/\n-const app = (ctx, initial: number[][]) => {\n+const app = (ctx: any, initial: number[][]) => {\nconst counters = initial.map(([start, step]) => counter(start, step));\nreturn sync({\nsrc: counters.map((c) => c.transform(map(() => [clickButton, c]))),\n", "new_path": "examples/rstream-hdom/src/index.ts", "old_path": "examples/rstream-hdom/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
docs(examples): add/update types in rstream-hdom
1
docs
examples
730,412
16.07.2018 20:01:15
0
f93ab3100dc2957ebe3829cdfd3d346ad6daa275
chore(release): 0.1.320
[ { "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.1.320\"></a>\n+## [0.1.320](https://github.com/webex/react-ciscospark/compare/v0.1.319...v0.1.320) (2018-07-16)\n+\n+\n+### Features\n+\n+* **widget-recents:** use new webex teams loading screen ([4dc52e3](https://github.com/webex/react-ciscospark/commit/4dc52e3))\n+\n+\n+\n<a name=\"0.1.319\"></a>\n## [0.1.319](https://github.com/webex/react-ciscospark/compare/v0.1.318...v0.1.319) (2018-07-12)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"@ciscospark/react-ciscospark\",\n- \"version\": \"0.1.319\",\n+ \"version\": \"0.1.320\",\n\"description\": \"The Cisco Spark for React library allows developers to easily incorporate Spark functionality into an application.\",\n\"scripts\": {\n\"build\": \"./scripts/build/index.js\",\n", "new_path": "package.json", "old_path": "package.json" } ]
JavaScript
MIT License
webex/react-widgets
chore(release): 0.1.320
1
chore
release
217,922
16.07.2018 22:00:44
-7,200
7e5e5776032feab95dfcf89cec5203935a1ba1a9
chore: built the electron ipc communication for notifications system
[ { "change_type": "MODIFY", "diff": "@@ -30,6 +30,7 @@ import {PlatformService} from './core/tools/platform.service';\nimport {IpcService} from './core/electron/ipc.service';\nimport {GarlandToolsService} from './core/api/garland-tools.service';\nimport {CommissionService} from './core/database/commission/commission.service';\n+import {NotificationService} from './core/notification/notification.service';\ndeclare const ga: Function;\n@@ -105,10 +106,13 @@ export class AppComponent implements OnInit {\npublic platformService: PlatformService,\nprivate ipc: IpcService,\nprivate gt: GarlandToolsService,\n- private commissionService: CommissionService) {\n+ private commissionService: CommissionService,\n+ private notificationService: NotificationService) {\nthis.gt.preload();\n+ this.notificationService.init();\n+\nsettings.themeChange$.subscribe(change => {\noverlayContainer.getContainerElement().classList.remove(`${change.previous}-theme`);\noverlayContainer.getContainerElement().classList.add(`${change.next}-theme`);\n", "new_path": "src/app/app.component.ts", "old_path": "src/app/app.component.ts" }, { "change_type": "MODIFY", "diff": "@@ -45,6 +45,7 @@ import {IpcService} from './electron/ipc.service';\nimport {SharedEntityService} from './database/shared-entity/shared-entity.service';\nimport {AbstractNotification} from './notification/abstract-notification';\nimport {ListProgressNotification} from '../model/notification/list-progress-notification';\n+import {NotificationService} from './notification/notification.service';\nexport const DATA_EXTRACTORS: Provider[] = [\n@@ -105,6 +106,7 @@ export const DATA_EXTRACTORS: Provider[] = [\nPlatformService,\nIpcService,\nSharedEntityService,\n+ NotificationService,\n],\ndeclarations: [\nI18nPipe,\n", "new_path": "src/app/core/core.module.ts", "old_path": "src/app/core/core.module.ts" }, { "change_type": "MODIFY", "diff": "@@ -8,7 +8,6 @@ import {FirestoreListStorage} from './storage/list/firestore-list-storage';\nimport {ListTemplateService} from './list-template/list-template.service';\nimport {CraftingRotationService} from './crafting-rotation.service';\nimport {CommissionService} from './commission/commission.service';\n-import {NotificationService} from './notification.service';\n@NgModule({\n@@ -23,7 +22,6 @@ import {NotificationService} from './notification.service';\nListTemplateService,\nCraftingRotationService,\nCommissionService,\n- NotificationService,\n]\n})\nexport class DatabaseModule {\n", "new_path": "src/app/core/database/database.module.ts", "old_path": "src/app/core/database/database.module.ts" }, { "change_type": "DELETE", "diff": "-import {RelationshipService} from './relational/relationship.service';\n-import {NotificationRelationship} from '../notification/notification-relationship';\n-import {Injectable, NgZone} from '@angular/core';\n-import {NgSerializerService} from '@kaiu/ng-serializer';\n-import {AngularFirestore} from 'angularfire2/firestore';\n-import {PendingChangesService} from './pending-changes/pending-changes.service';\n-\n-@Injectable({\n- providedIn: 'root'\n-})\n-export class NotificationService extends RelationshipService<NotificationRelationship> {\n-\n- protected constructor(protected firestore: AngularFirestore, protected serializer: NgSerializerService, protected zone: NgZone,\n- protected pendingChangesService: PendingChangesService) {\n- super(firestore, serializer, zone, pendingChangesService);\n- }\n-\n- protected getRelationCollection(): string {\n- return 'notifications';\n- }\n-\n- protected getClass(): any {\n- return NotificationRelationship;\n- }\n-\n-}\n", "new_path": null, "old_path": "src/app/core/database/notification.service.ts" }, { "change_type": "MODIFY", "diff": "@@ -35,6 +35,6 @@ export abstract class RelationshipService<T extends Relationship<any, any>> exte\n}\npublic getBaseUri(): string {\n- return `relationships/${this.getRelationCollection()}`\n+ return `relationships/${this.getRelationCollection()}/registry`\n}\n}\n", "new_path": "src/app/core/database/relational/relationship.service.ts", "old_path": "src/app/core/database/relational/relationship.service.ts" }, { "change_type": "MODIFY", "diff": "import {NotificationType} from './notification-type';\nimport {Parent} from '@kaiu/serializer';\n+import {TranslateService} from '@ngx-translate/core';\n+import {LocalizedDataService} from '../data/localized-data.service';\n+import {I18nToolsService} from '../tools/i18n-tools.service';\n@Parent({\nallowSelf: false,\n@@ -9,4 +12,8 @@ export abstract class AbstractNotification {\nprotected constructor(public readonly type: NotificationType) {\n}\n+\n+ public abstract getContent(translate: TranslateService, l12n: LocalizedDataService, i18nTools: I18nToolsService): string;\n+\n+ public abstract getTargetRoute(): string[];\n}\n", "new_path": "src/app/core/notification/abstract-notification.ts", "old_path": "src/app/core/notification/abstract-notification.ts" }, { "change_type": "ADD", "diff": "+import {RelationshipService} from '../database/relational/relationship.service';\n+import {NotificationRelationship} from './notification-relationship';\n+import {Injectable, NgZone} from '@angular/core';\n+import {NgSerializerService} from '@kaiu/ng-serializer';\n+import {AngularFirestore} from 'angularfire2/firestore';\n+import {PendingChangesService} from '../database/pending-changes/pending-changes.service';\n+import {UserService} from '../database/user.service';\n+import {AbstractNotification} from './abstract-notification';\n+import {IpcService} from '../electron/ipc.service';\n+import {TranslateService} from '@ngx-translate/core';\n+import {LocalizedDataService} from '../data/localized-data.service';\n+import {map, mergeMap} from 'rxjs/operators';\n+import {I18nToolsService} from '../tools/i18n-tools.service';\n+\n+@Injectable({\n+ providedIn: 'root'\n+})\n+export class NotificationService extends RelationshipService<NotificationRelationship> {\n+\n+ constructor(protected firestore: AngularFirestore, protected serializer: NgSerializerService, protected zone: NgZone,\n+ protected pendingChangesService: PendingChangesService, private userService: UserService, private ipc: IpcService,\n+ private translateService: TranslateService, private localizedDataService: LocalizedDataService,\n+ private i18nTools: I18nToolsService) {\n+ super(firestore, serializer, zone, pendingChangesService);\n+ }\n+\n+ public init(): void {\n+ // Initialize notifications listener.\n+ this.userService.getUserData()\n+ .pipe(\n+ mergeMap(user => this.getByFrom(user.$key)),\n+ map(relationships => relationships.map(r => r.to))\n+ )\n+ .subscribe((notifications) => this.handleNotifications(notifications));\n+ }\n+\n+ handleNotifications(notifications: AbstractNotification[]): void {\n+ // If there's only one, handle it alone.\n+ if (notifications.length === 1) {\n+ this.ipc.send('notification:user', {\n+ title: 'FFXIV Teamcraft',\n+ content: notifications[0].getContent(this.translateService, this.localizedDataService, this.i18nTools),\n+ });\n+ } else {\n+ this.ipc.send('notification:user', {\n+ title: 'FFXIV Teamcraft',\n+ content: this.translateService.instant('NOTIFICATIONS.You_have_x_notifications', {amount: notifications.length})\n+ });\n+ }\n+ }\n+\n+ protected getRelationCollection(): string {\n+ return 'notifications';\n+ }\n+\n+ protected getClass(): any {\n+ return NotificationRelationship;\n+ }\n+\n+}\n", "new_path": "src/app/core/notification/notification.service.ts", "old_path": null }, { "change_type": "MODIFY", "diff": "import {AbstractNotification} from '../../core/notification/abstract-notification';\nimport {NotificationType} from '../../core/notification/notification-type';\n+import {TranslateService} from '@ngx-translate/core';\n+import {LocalizedDataService} from '../../core/data/localized-data.service';\n+import {I18nToolsService} from '../../core/tools/i18n-tools.service';\n/**\n* This class describes a notification for when a progress has been made on an item.\n@@ -9,7 +12,20 @@ import {NotificationType} from '../../core/notification/notification-type';\nexport class ListProgressNotification extends AbstractNotification {\nconstructor(public listName: string, public modificationAuthorName: string, public amount: number,\n- public itemId: number) {\n+ public itemId: number, public listId: string) {\nsuper(NotificationType.LIST_PROGRESS);\n}\n+\n+ getContent(translate: TranslateService, l12n: LocalizedDataService, i18nTools: I18nToolsService): string {\n+ return translate.instant('NOTIFICATIONS.List_progress', {\n+ author: this.modificationAuthorName,\n+ amount: this.amount,\n+ listName: this.listName,\n+ itemName: i18nTools.getName(l12n.getItem(this.itemId))\n+ });\n+ }\n+\n+ getTargetRoute(): string[] {\n+ return ['list', this.listId];\n+ }\n}\n", "new_path": "src/app/model/notification/list-progress-notification.ts", "old_path": "src/app/model/notification/list-progress-notification.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: built the electron ipc communication for notifications system
1
chore
null
217,922
16.07.2018 22:07:35
-7,200
d725863327d28e340cf8834eba19a13cc8a34721
chore: added date to the notification object
[ { "change_type": "MODIFY", "diff": "@@ -10,7 +10,10 @@ import {I18nToolsService} from '../tools/i18n-tools.service';\n})\nexport abstract class AbstractNotification {\n+ public readonly date: number;\n+\nprotected constructor(public readonly type: NotificationType) {\n+ this.date = Date.now();\n}\npublic abstract getContent(translate: TranslateService, l12n: LocalizedDataService, i18nTools: I18nToolsService): string;\n", "new_path": "src/app/core/notification/abstract-notification.ts", "old_path": "src/app/core/notification/abstract-notification.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: added date to the notification object
1
chore
null
217,922
16.07.2018 22:45:24
-7,200
d0b6c328b598e32d9bb02389c600717d22721ded
chore: add read flag on notification model
[ { "change_type": "MODIFY", "diff": "@@ -12,6 +12,8 @@ export abstract class AbstractNotification {\npublic readonly date: number;\n+ public read = false;\n+\nprotected constructor(public readonly type: NotificationType) {\nthis.date = Date.now();\n}\n", "new_path": "src/app/core/notification/abstract-notification.ts", "old_path": "src/app/core/notification/abstract-notification.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: add read flag on notification model
1
chore
null
679,913
16.07.2018 23:04:52
-3,600
9be20180ad09146a4d97c5dd3ce856afabc343c8
fix(rstream): emit first value immediately in fromInterval() previously first value was only emitted after `delay` ms
[ { "change_type": "MODIFY", "diff": "@@ -12,6 +12,7 @@ import { Stream } from \"../stream\";\nexport function fromInterval(delay: number, count = Number.POSITIVE_INFINITY) {\nreturn new Stream<number>((stream) => {\nlet i = 0;\n+ stream.next(i++);\nlet id = setInterval(() => {\nstream.next(i++);\nif (--count <= 0) {\n", "new_path": "packages/rstream/src/from/interval.ts", "old_path": "packages/rstream/src/from/interval.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
fix(rstream): emit first value immediately in fromInterval() - previously first value was only emitted after `delay` ms
1
fix
rstream
679,913
16.07.2018 23:06:35
-3,600
3edbaefc21b7544fedf29bd7c4b842d2ca56a745
feat(examples): add auto-refresh, add data credits
[ { "change_type": "MODIFY", "diff": "@@ -10,9 +10,11 @@ import { svg } from \"@thi.ng/hiccup-svg/svg\";\nimport { text } from \"@thi.ng/hiccup-svg/text\";\nimport { resolve } from \"@thi.ng/resolve-map\";\nimport { fromEvent } from \"@thi.ng/rstream/from/event\";\n+import { fromInterval } from \"@thi.ng/rstream/from/interval\";\nimport { Stream } from \"@thi.ng/rstream/stream\";\nimport { sync } from \"@thi.ng/rstream/stream-sync\";\nimport { resolve as resolvePromise } from \"@thi.ng/rstream/subs/resolve\";\n+import { trace } from \"@thi.ng/rstream/subs/trace\";\nimport { comp } from \"@thi.ng/transducers/func/comp\";\nimport { pairs } from \"@thi.ng/transducers/iter/pairs\";\nimport { range } from \"@thi.ng/transducers/iter/range\";\n@@ -142,6 +144,7 @@ const emitOnStream = (stream) => (e) => stream.next(e.target.value);\nconst market = new Stream();\nconst symbol = new Stream();\nconst period = new Stream();\n+const refresh = fromInterval(60000).subscribe(trace(\"refresh\"));\nconst theme = new Stream().transform(map((id: string) => THEMES[id]));\nconst error = new Stream();\n@@ -151,7 +154,7 @@ error.subscribe({ next: (e) => alert(`An error occurred:\\n${e}`) });\n// this stream combinator performs API requests to obtain OHLC data\n// and if successful computes a number of statistics\nconst data = sync({\n- src: { market, symbol, period },\n+ src: { market, symbol, period, refresh },\nreset: false,\nxform: map((inst) =>\nfetch(API_URL(inst.market, inst.symbol, inst.period))\n@@ -330,8 +333,12 @@ sync({\nchart,\n[\"div.fixed.f7\",\n{ style: { top: `10px`, right: `${MARGIN_X}px` } },\n- [\"span.dn.dib-l.mr2\",\n- \"Made with @thi.ng/umbrella\"],\n+ [\"a\",\n+ {\n+ class: `dn dib-l mr3 b link ${theme.body}`,\n+ href: \"https://min-api.cryptocompare.com/\"\n+ },\n+ \"Data by cyptocompare.com\"],\n[\"a\",\n{\nclass: `mr3 b link ${theme.body}`,\n", "new_path": "examples/crypto-chart/src/index.ts", "old_path": "examples/crypto-chart/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(examples): add auto-refresh, add data credits
1
feat
examples
679,913
16.07.2018 23:10:42
-3,600
732a0967a1f29f11831ccba4896c72eeab61c216
docs(examples): update readme & dataflow diagram
[ { "change_type": "MODIFY", "diff": "<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n-->\n<!-- Title: g Pages: 1 -->\n-<svg width=\"482pt\" height=\"230pt\"\n- viewBox=\"0.00 0.00 482.02 230.01\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n-<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 226.0136)\">\n+<svg width=\"546pt\" height=\"242pt\"\n+ viewBox=\"0.00 0.00 546.07 242.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n+<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 238)\">\n<title>g</title>\n-<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-226.0136 478.0219,-226.0136 478.0219,4 -4,4\"/>\n+<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-238 542.0703,-238 542.0703,4 -4,4\"/>\n<!-- market -->\n<g id=\"node1\" class=\"node\">\n<title>market</title>\n-<ellipse fill=\"none\" stroke=\"#000000\" cx=\"29.1703\" cy=\"-189\" rx=\"29.3416\" ry=\"18\"/>\n-<text text-anchor=\"middle\" x=\"29.1703\" y=\"-185.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">market</text>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"32.4445\" cy=\"-216\" rx=\"29.3416\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"32.4445\" y=\"-212.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">market</text>\n</g>\n<!-- data -->\n<g id=\"node2\" class=\"node\">\n<title>data</title>\n-<ellipse fill=\"none\" stroke=\"#000000\" cx=\"124.5109\" cy=\"-189\" rx=\"27\" ry=\"18\"/>\n-<text text-anchor=\"middle\" x=\"124.5109\" y=\"-185.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">data</text>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"188.5594\" cy=\"-189\" rx=\"27\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"188.5594\" y=\"-185.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">data</text>\n</g>\n<!-- market&#45;&gt;data -->\n<g id=\"edge1\" class=\"edge\">\n<title>market&#45;&gt;data</title>\n-<path fill=\"none\" stroke=\"#000000\" d=\"M58.5536,-189C67.6343,-189 77.7586,-189 87.2956,-189\"/>\n-<polygon fill=\"#000000\" stroke=\"#000000\" points=\"87.3367,-192.5001 97.3367,-189 87.3366,-185.5001 87.3367,-192.5001\"/>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M60.7157,-211.1105C86.3493,-206.6772 124.2768,-200.1176 152.1663,-195.2942\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"153.06,-198.6917 162.3172,-193.5386 151.867,-191.7941 153.06,-198.6917\"/>\n</g>\n<!-- chart -->\n-<g id=\"node5\" class=\"node\">\n+<g id=\"node6\" class=\"node\">\n<title>chart</title>\n-<ellipse fill=\"none\" stroke=\"#000000\" cx=\"243.6812\" cy=\"-95\" rx=\"27\" ry=\"18\"/>\n-<text text-anchor=\"middle\" x=\"243.6812\" y=\"-91.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">chart</text>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"307.7297\" cy=\"-95\" rx=\"27\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"307.7297\" y=\"-91.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">chart</text>\n</g>\n<!-- data&#45;&gt;chart -->\n-<g id=\"edge4\" class=\"edge\">\n+<g id=\"edge5\" class=\"edge\">\n<title>data&#45;&gt;chart</title>\n-<path fill=\"none\" stroke=\"#000000\" d=\"M142.0949,-175.13C162.1617,-159.3016 195.1595,-133.2733 218.0795,-115.1943\"/>\n-<polygon fill=\"#000000\" stroke=\"#000000\" points=\"220.3412,-117.8681 226.0251,-108.9269 216.006,-112.3721 220.3412,-117.8681\"/>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M206.1434,-175.13C226.2101,-159.3016 259.2079,-133.2733 282.1279,-115.1943\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"284.3897,-117.8681 290.0735,-108.9269 280.0545,-112.3721 284.3897,-117.8681\"/>\n</g>\n<!-- symbol -->\n<g id=\"node3\" class=\"node\">\n<title>symbol</title>\n-<ellipse fill=\"none\" stroke=\"#000000\" cx=\"444.8515\" cy=\"-164\" rx=\"29.3416\" ry=\"18\"/>\n-<text text-anchor=\"middle\" x=\"444.8515\" y=\"-160.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">symbol</text>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"508.9\" cy=\"-164\" rx=\"29.3416\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"508.9\" y=\"-160.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">symbol</text>\n</g>\n<!-- symbol&#45;&gt;data -->\n<g id=\"edge2\" class=\"edge\">\n<title>symbol&#45;&gt;data</title>\n-<path fill=\"none\" stroke=\"#000000\" d=\"M430.8646,-180.046C422.2715,-188.6446 410.4789,-198.3946 397.6812,-203 303.1701,-237.0109 271.0824,-217.4397 171.6812,-203 167.4016,-202.3783 162.9699,-201.455 158.6137,-200.3737\"/>\n-<polygon fill=\"#000000\" stroke=\"#000000\" points=\"159.2642,-196.9223 148.6931,-197.6315 157.3991,-203.6693 159.2642,-196.9223\"/>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M494.9131,-180.046C486.3199,-188.6446 474.5273,-198.3946 461.7297,-203 367.2186,-237.0109 335.1308,-217.4397 235.7297,-203 231.45,-202.3783 227.0183,-201.455 222.6621,-200.3737\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"223.3126,-196.9223 212.7416,-197.6315 221.4476,-203.6693 223.3126,-196.9223\"/>\n</g>\n<!-- ui -->\n-<g id=\"node8\" class=\"node\">\n+<g id=\"node9\" class=\"node\">\n<title>ui</title>\n-<ellipse fill=\"none\" stroke=\"#000000\" cx=\"334.6812\" cy=\"-95\" rx=\"27\" ry=\"18\"/>\n-<text text-anchor=\"middle\" x=\"334.6812\" y=\"-91.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">ui</text>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"398.7297\" cy=\"-95\" rx=\"27\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"398.7297\" y=\"-91.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">ui</text>\n</g>\n<!-- symbol&#45;&gt;ui -->\n-<g id=\"edge7\" class=\"edge\">\n+<g id=\"edge8\" class=\"edge\">\n<title>symbol&#45;&gt;ui</title>\n-<path fill=\"none\" stroke=\"#000000\" d=\"M415.7126,-161.957C403.8585,-160.0893 390.4459,-156.5752 379.6812,-150 367.8365,-142.765 357.7118,-131.2674 350.0829,-120.6507\"/>\n-<polygon fill=\"#000000\" stroke=\"#000000\" points=\"352.7747,-118.3827 344.2786,-112.0529 346.973,-122.2994 352.7747,-118.3827\"/>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M479.761,-161.957C467.9069,-160.0893 454.4943,-156.5752 443.7297,-150 431.885,-142.765 421.7603,-131.2674 414.1313,-120.6507\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"416.8232,-118.3827 408.327,-112.0529 411.0214,-122.2994 416.8232,-118.3827\"/>\n</g>\n<!-- period -->\n<g id=\"node4\" class=\"node\">\n<title>period</title>\n-<ellipse fill=\"none\" stroke=\"#000000\" cx=\"444.8515\" cy=\"-107\" rx=\"29.3416\" ry=\"18\"/>\n-<text text-anchor=\"middle\" x=\"444.8515\" y=\"-103.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">period</text>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"508.9\" cy=\"-107\" rx=\"29.3416\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"508.9\" y=\"-103.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">period</text>\n</g>\n<!-- period&#45;&gt;data -->\n<g id=\"edge3\" class=\"edge\">\n<title>period&#45;&gt;data</title>\n-<path fill=\"none\" stroke=\"#000000\" d=\"M430.6447,-122.7223C421.9782,-131.2964 410.1856,-141.2964 397.6812,-147 319.3056,-182.7496 216.5099,-189.0134 162.0916,-189.5657\"/>\n-<polygon fill=\"#000000\" stroke=\"#000000\" points=\"161.8603,-186.0665 151.8746,-189.607 161.8887,-193.0664 161.8603,-186.0665\"/>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M494.2047,-122.7005C485.5531,-130.9643 473.9355,-140.4979 461.7297,-146 383.1523,-181.4206 280.4378,-188.3087 226.0861,-189.2633\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"225.8407,-185.7658 215.882,-189.3818 225.922,-192.7653 225.8407,-185.7658\"/>\n</g>\n<!-- period&#45;&gt;ui -->\n-<g id=\"edge8\" class=\"edge\">\n+<g id=\"edge9\" class=\"edge\">\n<title>period&#45;&gt;ui</title>\n-<path fill=\"none\" stroke=\"#000000\" d=\"M416.1124,-103.8697C402.4885,-102.3857 386.0522,-100.5954 371.5242,-99.013\"/>\n-<polygon fill=\"#000000\" stroke=\"#000000\" points=\"371.6706,-95.5083 361.3504,-97.9049 370.9126,-102.4672 371.6706,-95.5083\"/>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M480.1608,-103.8697C466.537,-102.3857 450.1006,-100.5954 435.5727,-99.013\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"435.7191,-95.5083 425.3988,-97.9049 434.961,-102.4672 435.7191,-95.5083\"/>\n+</g>\n+<!-- refresh -->\n+<g id=\"node5\" class=\"node\">\n+<title>refresh</title>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"32.4445\" cy=\"-162\" rx=\"32.3892\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"32.4445\" y=\"-158.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">refresh</text>\n+</g>\n+<!-- refresh&#45;&gt;data -->\n+<g id=\"edge4\" class=\"edge\">\n+<title>refresh&#45;&gt;data</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M63.6615,-167.399C89.1914,-171.8143 125.3295,-178.0644 152.1695,-182.7064\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"151.8697,-186.2064 162.3199,-184.4619 153.0627,-179.3088 151.8697,-186.2064\"/>\n+<text text-anchor=\"middle\" x=\"112.1391\" y=\"-182.241\" font-family=\"Inconsolata\" font-size=\"9.00\" fill=\"#000000\">every 60 secs</text>\n</g>\n<!-- chart&#45;&gt;ui -->\n-<g id=\"edge9\" class=\"edge\">\n+<g id=\"edge10\" class=\"edge\">\n<title>chart&#45;&gt;ui</title>\n-<path fill=\"none\" stroke=\"#000000\" d=\"M270.9842,-95C279.2625,-95 288.503,-95 297.3217,-95\"/>\n-<polygon fill=\"#000000\" stroke=\"#000000\" points=\"297.3975,-98.5001 307.3975,-95 297.3975,-91.5001 297.3975,-98.5001\"/>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M335.0327,-95C343.311,-95 352.5514,-95 361.3702,-95\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"361.446,-98.5001 371.4459,-95 361.4459,-91.5001 361.446,-98.5001\"/>\n</g>\n<!-- window -->\n-<g id=\"node6\" class=\"node\">\n+<g id=\"node7\" class=\"node\">\n<title>window</title>\n-<ellipse fill=\"none\" stroke=\"#000000\" cx=\"124.5109\" cy=\"-95\" rx=\"29.3416\" ry=\"18\"/>\n-<text text-anchor=\"middle\" x=\"124.5109\" y=\"-91.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">window</text>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"188.5594\" cy=\"-95\" rx=\"29.3416\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"188.5594\" y=\"-91.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">window</text>\n</g>\n<!-- window&#45;&gt;chart -->\n-<g id=\"edge5\" class=\"edge\">\n+<g id=\"edge6\" class=\"edge\">\n<title>window&#45;&gt;chart</title>\n-<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M153.9688,-95C169.8367,-95 189.5729,-95 206.4905,-95\"/>\n-<polygon fill=\"#000000\" stroke=\"#000000\" points=\"206.6001,-98.5001 216.6001,-95 206.6,-91.5001 206.6001,-98.5001\"/>\n-<text text-anchor=\"middle\" x=\"185.1812\" y=\"-97.241\" font-family=\"Inconsolata\" font-size=\"9.00\" fill=\"#000000\">resize</text>\n+<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M218.0172,-95C233.8851,-95 253.6213,-95 270.5389,-95\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"270.6485,-98.5001 280.6485,-95 270.6485,-91.5001 270.6485,-98.5001\"/>\n+<text text-anchor=\"middle\" x=\"249.2297\" y=\"-97.241\" font-family=\"Inconsolata\" font-size=\"9.00\" fill=\"#000000\">resize</text>\n</g>\n<!-- theme -->\n-<g id=\"node7\" class=\"node\">\n+<g id=\"node8\" class=\"node\">\n<title>theme</title>\n-<ellipse fill=\"none\" stroke=\"#000000\" cx=\"444.8515\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n-<text text-anchor=\"middle\" x=\"444.8515\" y=\"-14.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">theme</text>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"508.9\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"508.9\" y=\"-14.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">theme</text>\n</g>\n<!-- theme&#45;&gt;chart -->\n-<g id=\"edge6\" class=\"edge\">\n+<g id=\"edge7\" class=\"edge\">\n<title>theme&#45;&gt;chart</title>\n-<path fill=\"none\" stroke=\"#000000\" d=\"M417.7865,-16.543C405.9011,-16.5896 391.8997,-17.59 379.6812,-21 338.7416,-32.4255 296.4897,-57.9693 270.166,-75.8311\"/>\n-<polygon fill=\"#000000\" stroke=\"#000000\" points=\"268.1102,-72.9973 261.8743,-81.5626 272.0906,-78.7555 268.1102,-72.9973\"/>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M481.835,-16.543C469.9495,-16.5896 455.9482,-17.59 443.7297,-21 402.7901,-32.4255 360.5381,-57.9693 334.2144,-75.8311\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"332.1586,-72.9973 325.9228,-81.5626 336.139,-78.7555 332.1586,-72.9973\"/>\n</g>\n<!-- theme&#45;&gt;ui -->\n-<g id=\"edge10\" class=\"edge\">\n+<g id=\"edge11\" class=\"edge\">\n<title>theme&#45;&gt;ui</title>\n-<path fill=\"none\" stroke=\"#000000\" d=\"M417.765,-19.3701C405.3348,-21.0659 390.902,-24.6312 379.6812,-32 366.0297,-40.965 355.1996,-55.6126 347.588,-68.5287\"/>\n-<polygon fill=\"#000000\" stroke=\"#000000\" points=\"344.392,-67.0759 342.6201,-77.5216 350.5193,-70.4608 344.392,-67.0759\"/>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M481.8134,-19.3701C469.3833,-21.0659 454.9504,-24.6312 443.7297,-32 430.0782,-40.965 419.248,-55.6126 411.6364,-68.5287\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"408.4405,-67.0759 406.6685,-77.5216 414.5677,-70.4608 408.4405,-67.0759\"/>\n</g>\n<!-- ui&#45;&gt;symbol -->\n-<g id=\"edge11\" class=\"edge\">\n+<g id=\"edge12\" class=\"edge\">\n<title>ui&#45;&gt;symbol</title>\n-<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M354.3775,-107.3358C371.3684,-117.9773 396.1491,-133.4975 415.4816,-145.6055\"/>\n-<polygon fill=\"#000000\" stroke=\"#000000\" points=\"413.8713,-148.7267 424.2041,-151.0684 417.5869,-142.7942 413.8713,-148.7267\"/>\n-<text text-anchor=\"middle\" x=\"388.6812\" y=\"-136.241\" font-family=\"Inconsolata\" font-size=\"9.00\" fill=\"#000000\">user</text>\n+<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M418.4259,-107.3358C435.4168,-117.9773 460.1976,-133.4975 479.53,-145.6055\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"477.9197,-148.7267 488.2525,-151.0684 481.6353,-142.7942 477.9197,-148.7267\"/>\n+<text text-anchor=\"middle\" x=\"452.7297\" y=\"-135.241\" font-family=\"Inconsolata\" font-size=\"9.00\" fill=\"#000000\">user</text>\n</g>\n<!-- ui&#45;&gt;period -->\n-<g id=\"edge12\" class=\"edge\">\n+<g id=\"edge13\" class=\"edge\">\n<title>ui&#45;&gt;period</title>\n-<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M359.6547,-87.7938C371.2798,-85.4241 385.255,-83.9824 397.6812,-86.559 402.7937,-87.6191 408.0328,-89.2621 413.0737,-91.1663\"/>\n-<polygon fill=\"#000000\" stroke=\"#000000\" points=\"411.8608,-94.4525 422.4379,-95.0653 414.5515,-87.9903 411.8608,-94.4525\"/>\n-<text text-anchor=\"middle\" x=\"388.6812\" y=\"-89.241\" font-family=\"Inconsolata\" font-size=\"9.00\" fill=\"#000000\">user</text>\n+<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M423.7032,-87.7938C435.3282,-85.4241 449.3035,-83.9824 461.7297,-86.559 466.8421,-87.6191 472.0812,-89.2621 477.1222,-91.1663\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"475.9092,-94.4525 486.4863,-95.0653 478.6,-87.9903 475.9092,-94.4525\"/>\n+<text text-anchor=\"middle\" x=\"452.7297\" y=\"-89.241\" font-family=\"Inconsolata\" font-size=\"9.00\" fill=\"#000000\">user</text>\n</g>\n<!-- ui&#45;&gt;theme -->\n-<g id=\"edge13\" class=\"edge\">\n+<g id=\"edge14\" class=\"edge\">\n<title>ui&#45;&gt;theme</title>\n-<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M353.3701,-81.938C371.0176,-69.6039 397.6858,-50.965 417.6826,-36.9888\"/>\n-<polygon fill=\"#000000\" stroke=\"#000000\" points=\"419.8795,-39.7236 426.071,-31.1261 415.8694,-33.986 419.8795,-39.7236\"/>\n-<text text-anchor=\"middle\" x=\"388.6812\" y=\"-66.241\" font-family=\"Inconsolata\" font-size=\"9.00\" fill=\"#000000\">user</text>\n+<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M417.4186,-81.938C435.066,-69.6039 461.7343,-50.965 481.7311,-36.9888\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"483.928,-39.7236 490.1194,-31.1261 479.9179,-33.986 483.928,-39.7236\"/>\n+<text text-anchor=\"middle\" x=\"452.7297\" y=\"-66.241\" font-family=\"Inconsolata\" font-size=\"9.00\" fill=\"#000000\">user</text>\n</g>\n</g>\n</svg>\n", "new_path": "assets/crypto-dflow.svg", "old_path": "assets/crypto-dflow.svg" }, { "change_type": "MODIFY", "diff": "![chart](../../assets/crypto-chart.png)\n+Price data provided by [cryptocompare.com](https://min-api.cryptocompare.com/).\n+\nThis example demonstrates how to use\n[@thi.ng/rstream](https://github.com/thi-ng/umbrella/tree/master/packages/rstream)\n&\n", "new_path": "examples/crypto-chart/README.md", "old_path": "examples/crypto-chart/README.md" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
docs(examples): update readme & dataflow diagram
1
docs
examples
217,922
16.07.2018 23:24:19
-7,200
b8b02495eea67a1aa875f3bce33bffc86f9c2a1f
chore: notification service now properly connected with the database and ipc
[ { "change_type": "MODIFY", "diff": "@@ -14,6 +14,8 @@ export abstract class AbstractNotification {\npublic read = false;\n+ public alerted = false;\n+\nprotected constructor(public readonly type: NotificationType) {\nthis.date = Date.now();\n}\n", "new_path": "src/app/core/notification/abstract-notification.ts", "old_path": "src/app/core/notification/abstract-notification.ts" }, { "change_type": "MODIFY", "diff": "@@ -5,12 +5,12 @@ import {NgSerializerService} from '@kaiu/ng-serializer';\nimport {AngularFirestore} from 'angularfire2/firestore';\nimport {PendingChangesService} from '../database/pending-changes/pending-changes.service';\nimport {UserService} from '../database/user.service';\n-import {AbstractNotification} from './abstract-notification';\nimport {IpcService} from '../electron/ipc.service';\nimport {TranslateService} from '@ngx-translate/core';\nimport {LocalizedDataService} from '../data/localized-data.service';\nimport {map, mergeMap} from 'rxjs/operators';\nimport {I18nToolsService} from '../tools/i18n-tools.service';\n+import {combineLatest} from 'rxjs';\n@Injectable({\nprovidedIn: 'root'\n@@ -29,24 +29,31 @@ export class NotificationService extends RelationshipService<NotificationRelatio\nthis.userService.getUserData()\n.pipe(\nmergeMap(user => this.getByFrom(user.$key)),\n- map(relationships => relationships.map(r => r.to))\n+ map(relationships => relationships.filter(r => !r.to.alerted))\n)\n- .subscribe((notifications) => this.handleNotifications(notifications));\n+ .subscribe((relationships) => this.handleNotifications(relationships));\n}\n- handleNotifications(notifications: AbstractNotification[]): void {\n+ handleNotifications(relationships: NotificationRelationship[]): void {\n// If there's only one, handle it alone.\n- if (notifications.length === 1) {\n+ if (relationships.length === 1) {\nthis.ipc.send('notification:user', {\ntitle: 'FFXIV Teamcraft',\n- content: notifications[0].getContent(this.translateService, this.localizedDataService, this.i18nTools),\n+ content: relationships[0].to.getContent(this.translateService, this.localizedDataService, this.i18nTools),\n});\n} else {\nthis.ipc.send('notification:user', {\ntitle: 'FFXIV Teamcraft',\n- content: this.translateService.instant('NOTIFICATIONS.You_have_x_notifications', {amount: notifications.length})\n+ content: this.translateService.instant('NOTIFICATIONS.You_have_x_notifications', {amount: relationships.length})\n});\n}\n+ // Save notifications changes.\n+ combineLatest(\n+ ...relationships.map(relationship => {\n+ relationship.to.alerted = true;\n+ return this.set(relationship.$key, relationship);\n+ })\n+ ).subscribe();\n}\nprotected getRelationCollection(): string {\n", "new_path": "src/app/core/notification/notification.service.ts", "old_path": "src/app/core/notification/notification.service.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: notification service now properly connected with the database and ipc
1
chore
null
730,412
16.07.2018 23:42:34
0
8a63b1d431086ef7d9e6c34b803f31fdab836c47
chore(release): 0.1.321
[ { "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.1.321\"></a>\n+## [0.1.321](https://github.com/webex/react-ciscospark/compare/v0.1.320...v0.1.321) (2018-07-16)\n+\n+\n+### Features\n+\n+* **widget-space:** use new webex teams loading screen ([f294ba3](https://github.com/webex/react-ciscospark/commit/f294ba3))\n+\n+\n+\n<a name=\"0.1.320\"></a>\n## [0.1.320](https://github.com/webex/react-ciscospark/compare/v0.1.319...v0.1.320) (2018-07-16)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"@ciscospark/react-ciscospark\",\n- \"version\": \"0.1.320\",\n+ \"version\": \"0.1.321\",\n\"description\": \"The Cisco Spark for React library allows developers to easily incorporate Spark functionality into an application.\",\n\"scripts\": {\n\"build\": \"./scripts/build/index.js\",\n", "new_path": "package.json", "old_path": "package.json" } ]
JavaScript
MIT License
webex/react-widgets
chore(release): 0.1.321
1
chore
release
749,547
17.07.2018 10:39:30
-36,000
160fc06fe1d9786755ed1df84475e1fe2a92c095
fix(autocomplete|menus|selection|theming): guard against `getDocument` being undefined.
[ { "change_type": "MODIFY", "diff": "@@ -156,7 +156,7 @@ class AutocompleteContainer extends ControlledComponent {\n* Side-effect of the `aria-activedescendant` accessibility strategy.\n*/\nif (typeof focusedKey !== 'undefined' && focusedKey !== previousFocusedKey) {\n- const doc = getDocument(this.props) || document;\n+ const doc = getDocument ? getDocument(this.props) : document;\nconst itemNode = doc.getElementById(this.getItemId(focusedKey));\n/* istanbul ignore if */\n", "new_path": "packages/autocomplete/src/containers/AutocompleteContainer.js", "old_path": "packages/autocomplete/src/containers/AutocompleteContainer.js" }, { "change_type": "MODIFY", "diff": "@@ -20,7 +20,7 @@ import {\nKEY_CODES\n} from '@zendeskgarden/react-selection';\nimport { getPopperPlacement, getRtlPopperPlacement } from '@zendeskgarden/react-tooltips';\n-import { withTheme, isRtl } from '@zendeskgarden/react-theming';\n+import { withTheme, isRtl, getDocument } from '@zendeskgarden/react-theming';\nimport { FocusJailContainer } from '@zendeskgarden/react-modals';\n/**\n@@ -151,11 +151,15 @@ class MenuContainer extends ControlledComponent {\n}\ncomponentDidMount() {\n- document.addEventListener('mousedown', this.handleOutsideMouseDown);\n+ const doc = getDocument ? getDocument(this.props) : document;\n+\n+ doc.addEventListener('mousedown', this.handleOutsideMouseDown);\n}\ncomponentWillUnmount() {\n- document.removeEventListener('mousedown', this.handleOutsideMouseDown);\n+ const doc = getDocument ? getDocument(this.props) : document;\n+\n+ doc.addEventListener('mousedown', this.handleOutsideMouseDown);\n}\ncomponentDidUpdate(prevProps, prevState) {\n", "new_path": "packages/menus/src/containers/MenuContainer.js", "old_path": "packages/menus/src/containers/MenuContainer.js" }, { "change_type": "MODIFY", "diff": "@@ -87,7 +87,7 @@ export class SelectionContainer extends ControlledComponent {\ncomponentDidUpdate(prevProps, prevState) {\nconst current = this.props.focusedKey === undefined ? this.state : this.props;\nconst prev = prevProps.focusedKey === undefined ? prevState : prevProps;\n- const doc = getDocument(this.props) || document;\n+ const doc = getDocument ? getDocument(this.props) : document;\n/**\n* We must programatically scroll the newly focused element into view.\n", "new_path": "packages/selection/src/containers/SelectionContainer.js", "old_path": "packages/selection/src/containers/SelectionContainer.js" }, { "change_type": "MODIFY", "diff": "/** @component */\nexport default function getDocument({ theme } = {}) {\n- return theme && theme.document;\n+ return (theme && theme.document) || document;\n}\n", "new_path": "packages/theming/src/utils/getDocument.js", "old_path": "packages/theming/src/utils/getDocument.js" }, { "change_type": "MODIFY", "diff": "@@ -20,19 +20,19 @@ describe('getDocument', () => {\n).toBe(doc);\n});\n- it('returns undefined if theme has no document prop passed', () => {\n+ it('returns `document` if theme has no document prop passed', () => {\nexpect(\ngetDocument({\ntheme: {}\n})\n- ).toBeUndefined();\n+ ).toBe(global.document);\n});\n- it('returns undefined if no theme is provided', () => {\n- expect(getDocument({})).toBeUndefined();\n+ it('returns `document` if no theme is provided', () => {\n+ expect(getDocument({})).toBe(global.document);\n});\n- it('returns undefined if no props are provided', () => {\n- expect(getDocument()).toBeUndefined();\n+ it('returns `document` if no props are provided', () => {\n+ expect(getDocument()).toBe(global.document);\n});\n});\n", "new_path": "packages/theming/src/utils/getDocument.spec.js", "old_path": "packages/theming/src/utils/getDocument.spec.js" } ]
TypeScript
Apache License 2.0
zendeskgarden/react-components
fix(autocomplete|menus|selection|theming): guard against `getDocument` being undefined. (#56)
1
fix
autocomplete|menus|selection|theming
217,922
17.07.2018 13:49:03
-7,200
f44b539aa82bddc824cfc4c29faac1bdae243703
chore: first implementation for notifications page
[ { "change_type": "MODIFY", "diff": "@@ -47,6 +47,10 @@ const routes: Routes = [\npath: 'macro-translation',\nloadChildren: 'app/pages/macro-translation/macro-translation.module#MacroTranslationModule'\n},\n+ {\n+ path: 'notifications',\n+ loadChildren: 'app/pages/notifications/notifications.module#NotificationsModule'\n+ },\n{\npath: 'profile',\nloadChildren: 'app/pages/profile/profile.module#ProfileModule'\n", "new_path": "src/app/app-routing.module.ts", "old_path": "src/app/app-routing.module.ts" }, { "change_type": "MODIFY", "diff": "<mat-icon matListIcon>home</mat-icon>\n<span matLine *ngIf=\"!settings.compactSidebar\">{{'Home' | translate}}</span>\n</mat-list-item>\n+ <mat-list-item routerLink=\"/notifications\" (click)=\"mobile ? sidenav.close() : null\"\n+ matTooltipPosition=\"right\"\n+ matTooltip=\"{{'NOTIFICATIONS.Title' | translate}}\"\n+ [matTooltipDisabled]=\"!settings.compactSidebar\">\n+ <mat-icon matListIcon *ngIf=\"hasNotifications$ | async; else noNotifications\">\n+ notifications_active\n+ </mat-icon>\n+ <ng-template #noNotifications>\n+ <mat-icon matListIcon>notifications_none</mat-icon>\n+ </ng-template>\n+ <span matLine *ngIf=\"!settings.compactSidebar\">{{'NOTIFICATIONS.Title' | translate}}</span>\n+ </mat-list-item>\n<mat-list-item routerLink=\"/profile\" (click)=\"mobile ? sidenav.close() : null\"\n*ngIf=\"!(authState | async)?.isAnonymous\"\nmatTooltipPosition=\"right\"\n", "new_path": "src/app/app.component.html", "old_path": "src/app/app.component.html" }, { "change_type": "MODIFY", "diff": "@@ -88,6 +88,8 @@ export class AppComponent implements OnInit {\nhasCommissionBadge$: Observable<boolean>;\n+ hasNotifications$: Observable<boolean>;\n+\nconstructor(private auth: AngularFireAuth,\nprivate router: Router,\nprivate translate: TranslateService,\n@@ -113,6 +115,11 @@ export class AppComponent implements OnInit {\nthis.notificationService.init();\n+ this.hasNotifications$ = this.notificationService.notifications$.pipe(\n+ map(relationships => relationships.filter(r => !r.to.read)),\n+ map(relationships => relationships.length > 0)\n+ );\n+\nsettings.themeChange$.subscribe(change => {\noverlayContainer.getContainerElement().classList.remove(`${change.previous}-theme`);\noverlayContainer.getContainerElement().classList.add(`${change.next}-theme`);\n", "new_path": "src/app/app.component.ts", "old_path": "src/app/app.component.ts" }, { "change_type": "MODIFY", "diff": "@@ -69,7 +69,7 @@ export const DATA_EXTRACTORS: Provider[] = [\n{\nparent: AbstractNotification,\nchildren: {\n- LIST_UPDATE: ListProgressNotification,\n+ LIST_PROGRESS: ListProgressNotification,\n}\n}\n]),\n", "new_path": "src/app/core/core.module.ts", "old_path": "src/app/core/core.module.ts" }, { "change_type": "MODIFY", "diff": "@@ -16,21 +16,21 @@ export abstract class RelationshipService<T extends Relationship<any, any>> exte\nprotected abstract getRelationCollection(): string;\n- public getByFrom(from: string): Observable<Relationship<any, any>[]> {\n+ public getByFrom(from: string): Observable<T[]> {\nreturn this.firestore.collection(this.getBaseUri(), ref => ref.where('from', '==', from))\n.snapshotChanges()\n.pipe(\nmap((snaps: any[]) => snaps.map(snap => ({$key: snap.payload.doc.id, ...snap.payload.doc.data()}))),\n- map((lists: any[]) => this.serializer.deserialize<Relationship<any, any>>(lists, [Relationship]))\n+ map((lists: any[]) => this.serializer.deserialize<T>(lists, [this.getClass()]))\n);\n}\n- public getByTo(to: string): Observable<Relationship<any, any>[]> {\n+ public getByTo(to: string): Observable<T[]> {\nreturn this.firestore.collection(this.getBaseUri(), ref => ref.where('to', '==', to))\n.snapshotChanges()\n.pipe(\nmap((snaps: any[]) => snaps.map(snap => ({$key: snap.payload.doc.id, ...snap.payload.doc.data()}))),\n- map((lists: any[]) => this.serializer.deserialize<Relationship<any, any>>(lists, [Relationship]))\n+ map((lists: any[]) => this.serializer.deserialize<T>(lists, [this.getClass()]))\n);\n}\n", "new_path": "src/app/core/database/relational/relationship.service.ts", "old_path": "src/app/core/database/relational/relationship.service.ts" }, { "change_type": "MODIFY", "diff": "@@ -23,4 +23,6 @@ export abstract class AbstractNotification {\npublic abstract getContent(translate: TranslateService, l12n: LocalizedDataService, i18nTools: I18nToolsService): string;\npublic abstract getTargetRoute(): string[];\n+\n+ public abstract getIcon(): string;\n}\n", "new_path": "src/app/core/notification/abstract-notification.ts", "old_path": "src/app/core/notification/abstract-notification.ts" }, { "change_type": "MODIFY", "diff": "@@ -8,27 +8,38 @@ import {UserService} from '../database/user.service';\nimport {IpcService} from '../electron/ipc.service';\nimport {TranslateService} from '@ngx-translate/core';\nimport {LocalizedDataService} from '../data/localized-data.service';\n-import {map, mergeMap} from 'rxjs/operators';\n+import {map, mergeMap, shareReplay} from 'rxjs/operators';\nimport {I18nToolsService} from '../tools/i18n-tools.service';\n-import {combineLatest} from 'rxjs';\n+import {combineLatest, Observable} from 'rxjs';\n@Injectable({\nprovidedIn: 'root'\n})\nexport class NotificationService extends RelationshipService<NotificationRelationship> {\n+ public readonly notifications$: Observable<NotificationRelationship[]>;\n+\nconstructor(protected firestore: AngularFirestore, protected serializer: NgSerializerService, protected zone: NgZone,\nprotected pendingChangesService: PendingChangesService, private userService: UserService, private ipc: IpcService,\nprivate translateService: TranslateService, private localizedDataService: LocalizedDataService,\nprivate i18nTools: I18nToolsService) {\nsuper(firestore, serializer, zone, pendingChangesService);\n+ this.notifications$ = this.userService.getUserData()\n+ .pipe(\n+ mergeMap(user => this.getByFrom(user.$key)),\n+ map(relationships => {\n+ return relationships.sort((a, b) => {\n+ return a.to.date > b.to.date ? -1 : 1;\n+ })\n+ }),\n+ shareReplay(),\n+ );\n}\npublic init(): void {\n// Initialize notifications listener.\n- this.userService.getUserData()\n+ this.notifications$\n.pipe(\n- mergeMap(user => this.getByFrom(user.$key)),\nmap(relationships => relationships.filter(r => !r.to.alerted))\n)\n.subscribe((relationships) => this.handleNotifications(relationships));\n@@ -54,6 +65,19 @@ export class NotificationService extends RelationshipService<NotificationRelatio\nreturn this.set(relationship.$key, relationship);\n})\n).subscribe();\n+\n+ // Clean notifications.\n+ combineLatest(\n+ ...relationships\n+ .filter(relationship => {\n+ // Get only notifications that are more than a week (8 days) old\n+ return (Date.now() - relationship.to.date) < 691200000\n+ })\n+ .map(relationship => {\n+ // delete these notifications\n+ return this.remove(relationship.$key);\n+ })\n+ ).subscribe();\n}\nprotected getRelationCollection(): string {\n", "new_path": "src/app/core/notification/notification.service.ts", "old_path": "src/app/core/notification/notification.service.ts" }, { "change_type": "MODIFY", "diff": "@@ -26,6 +26,10 @@ export class ListProgressNotification extends AbstractNotification {\n}\ngetTargetRoute(): string[] {\n- return ['list', this.listId];\n+ return ['/list', this.listId];\n+ }\n+\n+ getIcon(): string {\n+ return 'playlist_add_check';\n}\n}\n", "new_path": "src/app/model/notification/list-progress-notification.ts", "old_path": "src/app/model/notification/list-progress-notification.ts" }, { "change_type": "MODIFY", "diff": "@@ -42,6 +42,9 @@ import {I18nToolsService} from '../../../core/tools/i18n-tools.service';\nimport {LocalizedDataService} from '../../../core/data/localized-data.service';\nimport {CommissionCreationPopupComponent} from '../../commission-board/commission-creation-popup/commission-creation-popup.component';\nimport {CommissionService} from '../../../core/database/commission/commission.service';\n+import {NotificationService} from '../../../core/notification/notification.service';\n+import {ListProgressNotification} from '../../../model/notification/list-progress-notification';\n+import {NotificationRelationship} from '../../../core/notification/notification-relationship';\ndeclare const ga: Function;\n@@ -104,6 +107,8 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\nprivate upgradingList = false;\n+ private characterData: any;\n+\npublic get selectedIndex(): number {\nreturn +(localStorage.getItem('layout:selected') || 0);\n}\n@@ -113,7 +118,8 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\nprivate translate: TranslateService, private router: Router, private eorzeanTimeService: EorzeanTimeService,\npublic settings: SettingsService, private layoutService: LayoutService, private cd: ChangeDetectorRef,\npublic platform: PlatformService, private linkTools: LinkToolsService, private l12n: LocalizedDataService,\n- private i18nTools: I18nToolsService, private commissionService: CommissionService) {\n+ private i18nTools: I18nToolsService, private commissionService: CommissionService,\n+ private notificationService: NotificationService) {\nsuper();\nthis.initFilters();\nthis.listDisplay = this.listData$\n@@ -289,6 +295,10 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\nthis.hideCompleted = user.listDetailsFilters !== undefined ? user.listDetailsFilters.hideCompleted : false;\nthis.triggerFilter();\n}));\n+ this.subscriptions.push(\n+ this.userService.getCharacter()\n+ .subscribe(character => this.characterData = character)\n+ );\nthis.listData$.next(this.listData);\n}\n@@ -407,6 +417,13 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\n})\n).subscribe();\n}\n+ // If the modification isn't made by the author of the list, send him a notification.\n+ if (this.userData.$key !== this.listData.authorId) {\n+ const relationship = new NotificationRelationship();\n+ relationship.from = this.listData.authorId;\n+ relationship.to = new ListProgressNotification(list.name, this.characterData.name, data.amount, data.row.id, list.$key);\n+ this.notificationService.add(relationship);\n+ }\n}\nprivate onCompletion(list: List): void {\n", "new_path": "src/app/pages/list/list-details/list-details.component.ts", "old_path": "src/app/pages/list/list-details/list-details.component.ts" }, { "change_type": "ADD", "diff": "+import {NgModule} from '@angular/core';\n+import {CommonModule} from '@angular/common';\n+import {NotificationsComponent} from './notifications/notifications.component';\n+import {RouterModule, Routes} from '@angular/router';\n+import {MaintenanceGuard} from '../maintenance/maintenance.guard';\n+import {TranslateModule} from '@ngx-translate/core';\n+import {CoreModule} from '../../core/core.module';\n+import {MatButtonModule, MatIconModule, MatListModule, MatProgressSpinnerModule} from '@angular/material';\n+\n+const routes: Routes = [{\n+ path: '',\n+ component: NotificationsComponent,\n+ canActivate: [MaintenanceGuard]\n+}];\n+\n+\n+@NgModule({\n+ imports: [\n+ CommonModule,\n+\n+ TranslateModule,\n+ CoreModule,\n+\n+ RouterModule.forChild(routes),\n+\n+ MatProgressSpinnerModule,\n+ MatListModule,\n+ MatIconModule,\n+ MatButtonModule,\n+ ],\n+ declarations: [NotificationsComponent]\n+})\n+export class NotificationsModule {\n+}\n", "new_path": "src/app/pages/notifications/notifications.module.ts", "old_path": null }, { "change_type": "ADD", "diff": "+<h2>{{'NOTIFICATIONS.Title' | translate}}</h2>\n+<div *ngIf=\"notifications$ | async as notifications; else loading\">\n+ <div class=\"toolbar\">\n+ <button mat-raised-button (click)=\"markAllAsRead(notifications)\">\n+ <mat-icon>done_all</mat-icon>\n+ {{'NOTIFICATIONS.Mark_all_as_read' | translate}}\n+ </button>\n+ </div>\n+ <mat-list>\n+ <mat-list-item *ngFor=\"let notification of notifications\" [class.mat-elevation-z5]=\"!notification.to.read\"\n+ (click)=\"notification.to.read?null:markAsRead(notification)\">\n+ <mat-icon matListIcon>{{notification.to.getIcon()}}</mat-icon>\n+ <p matLine>{{notification.to.getContent(translate, l12n, i18nTools)}}</p>\n+ <i matLine class=\"date\">{{notification.to.date | date:'medium'}}</i>\n+ <button mat-icon-button [routerLink]=\"notification.to.getTargetRoute()\">\n+ <mat-icon>open_in_new</mat-icon>\n+ </button>\n+ </mat-list-item>\n+ </mat-list>\n+</div>\n+<ng-template #loading>\n+ <div class=\"loader-container\">\n+ <mat-spinner></mat-spinner>\n+ </div>\n+</ng-template>\n", "new_path": "src/app/pages/notifications/notifications/notifications.component.html", "old_path": null }, { "change_type": "ADD", "diff": "+.date {\n+ opacity: .7;\n+}\n", "new_path": "src/app/pages/notifications/notifications/notifications.component.scss", "old_path": null }, { "change_type": "ADD", "diff": "+import {ChangeDetectionStrategy, Component} from '@angular/core';\n+import {NotificationService} from '../../../core/notification/notification.service';\n+import {Observable} from 'rxjs/index';\n+import {NotificationRelationship} from '../../../core/notification/notification-relationship';\n+import {LocalizedDataService} from '../../../core/data/localized-data.service';\n+import {I18nToolsService} from '../../../core/tools/i18n-tools.service';\n+import {TranslateService} from '@ngx-translate/core';\n+\n+@Component({\n+ selector: 'app-notifications',\n+ templateUrl: './notifications.component.html',\n+ styleUrls: ['./notifications.component.scss'],\n+ changeDetection: ChangeDetectionStrategy.OnPush\n+})\n+export class NotificationsComponent {\n+\n+ public notifications$: Observable<NotificationRelationship[]>;\n+\n+ constructor(private notificationService: NotificationService,\n+ public l12n: LocalizedDataService, public i18nTools: I18nToolsService, public translate: TranslateService) {\n+ this.notifications$ = this.notificationService.notifications$;\n+ }\n+\n+ public markAllAsRead(notifications: NotificationRelationship[]): void {\n+ notifications.forEach(notification => this.markAsRead(notification));\n+ }\n+\n+ public markAsRead(notification: NotificationRelationship): void {\n+ notification.to.read = true;\n+ this.notificationService.set(notification.$key, notification);\n+ }\n+\n+}\n", "new_path": "src/app/pages/notifications/notifications/notifications.component.ts", "old_path": null }, { "change_type": "MODIFY", "diff": "\"Min_price\": \"Min price\",\n\"Max_price\": \"Max price\"\n}\n+ },\n+ \"NOTIFICATIONS\": {\n+ \"Title\": \"Notifications\",\n+ \"List_progress\": \"{{author}} added {{amount}} {{itemName}} to list \\\"{{listName}}\\\"\",\n+ \"Mark_all_as_read\": \"Mark all as read\"\n}\n}\n", "new_path": "src/assets/i18n/en.json", "old_path": "src/assets/i18n/en.json" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: first implementation for notifications page
1
chore
null
217,922
17.07.2018 14:53:52
-7,200
8e26a341efae53289cae6c9da0c684074828b0e1
chore: you can now assign a list to a team
[ { "change_type": "MODIFY", "diff": "@@ -44,7 +44,6 @@ import {AngularFirestoreModule} from 'angularfire2/firestore';\nimport {MaintenanceModule} from './pages/maintenance/maintenance.module';\nimport {GivewayPopupModule} from './modules/giveway-popup/giveway-popup.module';\nimport {WorkshopModule} from './pages/workshop/workshop.module';\n-import {LinkModule} from './pages/link/link.module';\nimport {TemplateModule} from './pages/template/template.module';\nimport {AlarmsSidebarModule} from './modules/alarms-sidebar/alarms-sidebar.module';\nimport {MarkdownModule} from 'ngx-markdown';\n@@ -129,7 +128,6 @@ export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {\nAlarmsSidebarModule,\n// Pages\n- LinkModule,\nWikiModule,\nListModule,\nMaintenanceModule,\n", "new_path": "src/app/app.module.ts", "old_path": "src/app/app.module.ts" }, { "change_type": "MODIFY", "diff": "@@ -47,6 +47,8 @@ export class List extends DataWithPermissions {\nmodificationsHistory: ModificationEntry[] = [];\n+ teamId: string;\n+\npublic get isCommissionList(): boolean {\nreturn this.commissionId !== undefined && this.commissionServer !== undefined;\n}\n", "new_path": "src/app/model/list/list.ts", "old_path": "src/app/model/list/list.ts" }, { "change_type": "MODIFY", "diff": "(click)=\"openPermissionsPopup()\" *ngIf=\"listData.authorId === userData.$key\">\n<mat-icon>security</mat-icon>\n</button>\n+ <mat-menu #teamList=\"matMenu\">\n+ <div *ngIf=\"teams$ | async as teams\">\n+ <button mat-menu-item *ngIf=\"teams.length === 0\"\n+ disabled>{{'TEAMS.No_teams' | translate}}</button>\n+ <button mat-menu-item (click)=\"assignTeam(listData, team)\"\n+ *ngFor=\"let team of teams\">{{team.name}}</button>\n+ </div>\n+ </mat-menu>\n+ <button mat-mini-fab\n+ [disabled]=\"user.isAnonymous\"\n+ [matTooltip]=\"'TEAMS.Assign_list' | translate\"\n+ [matMenuTriggerFor]=\"teamList\"\n+ *ngIf=\"listData.authorId === userData.$key && listData.teamId === undefined\">\n+ <mat-icon>people_outline</mat-icon>\n+ </button>\n+ <span class=\"team-fab\" *ngIf=\"team$ | async as team\">\n+ <button *ngIf=\"listData.teamId !== undefined\" mat-icon-button [matTooltip]=\"team.name\">\n+ <mat-icon *ngIf=\"listData.teamId !== undefined\">people</mat-icon>\n+ </button>\n+ <button *ngIf=\"listData.teamId !== undefined\" mat-icon-button class=\"remove-button\" color=\"warn\"\n+ (click)=\"removeTeam(listData)\"\n+ [matTooltip]=\"'TEAMS.Detach_team' | translate\">\n+ <mat-icon>close</mat-icon>\n+ </button>\n+ </span>\n</span>\n</div>\n<div class=\"right-fabs\">\n<mat-expansion-panel class=\"panel\" *ngIf=\"listData.crystals?.length > 0\">\n<mat-expansion-panel-header>\n<mat-panel-title>{{'Crystals'| translate}}</mat-panel-title>\n- <mat-checkbox [(ngModel)]=\"settings.crystalsTracking\" (click)=\"$event.stopPropagation()\" class=\"crystals-toggle\">\n+ <mat-checkbox [(ngModel)]=\"settings.crystalsTracking\" (click)=\"$event.stopPropagation()\"\n+ class=\"crystals-toggle\">\n{{'LIST.Enable_crystals_tracking' | translate}}\n</mat-checkbox>\n<button mat-icon-button ngxClipboard\n", "new_path": "src/app/pages/list/list-details/list-details.component.html", "old_path": "src/app/pages/list/list-details/list-details.component.html" }, { "change_type": "MODIFY", "diff": "+\n+.team-fab {\n+ .remove-button {\n+ visibility: hidden;\n+ }\n+ &:hover {\n+ .remove-button {\n+ visibility: visible;\n+ }\n+ }\n+}\n+\n.etime-container {\nwidth: 100%;\ndisplay: flex;\n", "new_path": "src/app/pages/list/list-details/list-details.component.scss", "old_path": "src/app/pages/list/list-details/list-details.component.scss" }, { "change_type": "MODIFY", "diff": "@@ -42,6 +42,9 @@ import {I18nToolsService} from '../../../core/tools/i18n-tools.service';\nimport {LocalizedDataService} from '../../../core/data/localized-data.service';\nimport {CommissionCreationPopupComponent} from '../../commission-board/commission-creation-popup/commission-creation-popup.component';\nimport {CommissionService} from '../../../core/database/commission/commission.service';\n+import {Team} from '../../../model/other/team';\n+import {TeamService} from '../../../core/database/team.service';\n+import {catchError} from 'rxjs/internal/operators';\ndeclare const ga: Function;\n@@ -104,6 +107,11 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\nprivate upgradingList = false;\n+ public teams$: Observable<Team[]>;\n+\n+ // Curren team assigned to this list.\n+ public team$: Observable<Team>;\n+\npublic get selectedIndex(): number {\nreturn +(localStorage.getItem('layout:selected') || 0);\n}\n@@ -113,7 +121,7 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\nprivate translate: TranslateService, private router: Router, private eorzeanTimeService: EorzeanTimeService,\npublic settings: SettingsService, private layoutService: LayoutService, private cd: ChangeDetectorRef,\npublic platform: PlatformService, private linkTools: LinkToolsService, private l12n: LocalizedDataService,\n- private i18nTools: I18nToolsService, private commissionService: CommissionService) {\n+ private i18nTools: I18nToolsService, private commissionService: CommissionService, private teamService: TeamService) {\nsuper();\nthis.initFilters();\nthis.listDisplay = this.listData$\n@@ -139,6 +147,26 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\nfilter(data => data !== null),\nmap(layout => layout.recipeZoneBreakdown)\n);\n+\n+ this.teams$ = this.teamService.getUserTeams();\n+\n+ this.team$ = this.listData$\n+ .pipe(\n+ filter(list => list.teamId !== undefined),\n+ mergeMap(list => {\n+ return this.teamService.get(list.teamId)\n+ .pipe(\n+ catchError(() => {\n+ delete list.teamId;\n+ return this.listService.set(list.$key, list)\n+ .pipe(\n+ map(() => null)\n+ );\n+ })\n+ )\n+ }),\n+ filter(res => res !== null)\n+ )\n}\npublic createCommission(list: List): void {\n@@ -527,6 +555,16 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\n});\n}\n+ public assignTeam(list: List, team: Team): void {\n+ list.teamId = team.$key;\n+ this.update(list);\n+ }\n+\n+ public removeTeam(list: List): void {\n+ delete list.teamId;\n+ this.update(list);\n+ }\n+\nprotected resetFilters(): void {\nthis.initFilters();\n", "new_path": "src/app/pages/list/list-details/list-details.component.ts", "old_path": "src/app/pages/list/list-details/list-details.component.ts" }, { "change_type": "MODIFY", "diff": "@@ -16,6 +16,7 @@ import {\nMatIconModule,\nMatInputModule,\nMatListModule,\n+ MatMenuModule,\nMatProgressSpinnerModule,\nMatSelectModule,\nMatSliderModule,\n@@ -83,6 +84,7 @@ const routes: Routes = [\nMatGridListModule,\nMatTooltipModule,\nMatSlideToggleModule,\n+ MatMenuModule,\nFlexLayoutModule,\nClipboardModule,\n", "new_path": "src/app/pages/list/list.module.ts", "old_path": "src/app/pages/list/list.module.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: you can now assign a list to a team
1
chore
null
791,690
17.07.2018 15:14:29
25,200
9d439622c310a8b8bc38b3e6fbf70d26c7f33f0b
core(response-compression): graceful recovery
[ { "change_type": "MODIFY", "diff": "@@ -41,6 +41,9 @@ class ResponsesAreCompressed extends ByteEfficiencyAudit {\n/** @type {Array<LH.Audit.ByteEfficiencyItem>} */\nconst items = [];\nuncompressedResponses.forEach(record => {\n+ // Ignore invalid GZIP size values (undefined, NaN, 0, -n, etc)\n+ if (!record.gzipSize || record.gzipSize < 0) return;\n+\nconst originalSize = record.resourceSize;\nconst gzipSize = record.gzipSize;\nconst gzipSavings = originalSize - gzipSize;\n", "new_path": "lighthouse-core/audits/byte-efficiency/uses-text-compression.js", "old_path": "lighthouse-core/audits/byte-efficiency/uses-text-compression.js" }, { "change_type": "MODIFY", "diff": "'use strict';\nconst Gatherer = require('../gatherer');\n+const URL = require('../../../lib/url-shim');\n+const Sentry = require('../../../lib/sentry');\nconst NetworkRequest = require('../../../lib/network-request');\nconst gzip = require('zlib').gzip;\n@@ -99,6 +101,16 @@ class ResponseCompression extends Gatherer {\nresolve(record);\n});\n});\n+ }).catch(err => {\n+ // @ts-ignore TODO(bckenny): Sentry type checking\n+ Sentry.captureException(err, {\n+ tags: {gatherer: 'ResponseCompression'},\n+ extra: {url: URL.elideDataURI(record.url)},\n+ level: 'warning',\n+ });\n+\n+ record.gzipSize = undefined;\n+ return record;\n});\n}));\n}\n", "new_path": "lighthouse-core/gather/gatherers/dobetterweb/response-compression.js", "old_path": "lighthouse-core/gather/gatherers/dobetterweb/response-compression.js" }, { "change_type": "MODIFY", "diff": "@@ -140,6 +140,16 @@ describe('Optimized responses', () => {\n});\n});\n+ it('recovers from driver errors', () => {\n+ options.driver.getRequestContent = () => Promise.reject(new Error('Failed'));\n+ return responseCompression.afterPass(options, createNetworkRequests(traceData))\n+ .then(artifact => {\n+ assert.equal(artifact.length, 2);\n+ assert.equal(artifact[0].resourceSize, 6);\n+ assert.equal(artifact[0].gzipSize, undefined);\n+ });\n+ });\n+\nit('ignores responses from installed Chrome extensions', () => {\nconst traceData = {\nnetworkRecords: [\n", "new_path": "lighthouse-core/test/gather/gatherers/dobetterweb/response-compression-test.js", "old_path": "lighthouse-core/test/gather/gatherers/dobetterweb/response-compression-test.js" }, { "change_type": "MODIFY", "diff": "@@ -94,7 +94,7 @@ declare global {\n/** HTML snippets from any password inputs that prevent pasting. */\nPasswordInputsWithPreventedPaste: {snippet: string}[];\n/** Size info of all network records sent without compression and their size after gzipping. */\n- ResponseCompression: {requestId: string, url: string, mimeType: string, transferSize: number, resourceSize: number, gzipSize: number}[];\n+ ResponseCompression: {requestId: string, url: string, mimeType: string, transferSize: number, resourceSize: number, gzipSize?: number}[];\n/** Information on fetching and the content of the /robots.txt file. */\nRobotsTxt: {status: number|null, content: string|null};\n/** Set of exceptions thrown during page load. */\n", "new_path": "typings/artifacts.d.ts", "old_path": "typings/artifacts.d.ts" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
core(response-compression): graceful recovery (#5578)
1
core
response-compression
807,849
17.07.2018 15:59:19
25,200
855fff61a13423e2ac1bb7cbd7a581562e5d84e6
feat(ls): Log number of packages listed
[ { "change_type": "MODIFY", "diff": "@@ -23,6 +23,9 @@ class ListCommand extends Command {\nversion: pkg.version,\nprivate: pkg.private,\n}));\n+\n+ // logged after output\n+ this.length = this.resultList.length;\n}\nexecute() {\n@@ -35,6 +38,8 @@ class ListCommand extends Command {\n}\noutput(result);\n+\n+ this.logger.info(\"list\", `found ${this.length} package${this.length === 1 ? \"\" : \"s\"}`);\n}\nformatJSON() {\n", "new_path": "commands/list/index.js", "old_path": "commands/list/index.js" } ]
JavaScript
MIT License
lerna/lerna
feat(ls): Log number of packages listed
1
feat
ls
791,690
17.07.2018 16:35:18
25,200
589162b69658c028b6481c34a80a2cb928a81aa0
core(i18n): initial utility library
[ { "change_type": "MODIFY", "diff": "@@ -64,6 +64,7 @@ function getFlags(manualArgv) {\n],\n'Configuration:')\n.describe({\n+ 'locale': 'The locale/language the report should be formatted in',\n'enable-error-reporting':\n'Enables error reporting, overriding any saved preference. --no-enable-error-reporting will do the opposite. More: https://git.io/vFFTO',\n'blocked-url-patterns': 'Block any network requests to the specified URL patterns',\n@@ -118,6 +119,10 @@ function getFlags(manualArgv) {\n'disable-storage-reset', 'disable-device-emulation', 'save-assets', 'list-all-audits',\n'list-trace-categories', 'view', 'verbose', 'quiet', 'help',\n])\n+ .choices('locale', [\n+ 'en-US', // English\n+ 'en-XA', // Accented English, good for testing\n+ ])\n.choices('output', printer.getValidOutputOptions())\n.choices('throttling-method', ['devtools', 'provided', 'simulate'])\n.choices('preset', ['full', 'perf', 'mixed-content'])\n", "new_path": "lighthouse-cli/cli-flags.js", "old_path": "lighthouse-cli/cli-flags.js" }, { "change_type": "MODIFY", "diff": "'use strict';\nconst Audit = require('../audit');\n+const i18n = require('../../lib/i18n');\nconst BaseNode = require('../../lib/dependency-graph/base-node');\nconst ByteEfficiencyAudit = require('./byte-efficiency-audit');\nconst UnusedCSS = require('./unused-css-rules');\n@@ -25,6 +26,19 @@ const NetworkRequest = require('../../lib/network-request');\n// to possibly be non-blocking (and they have minimal impact anyway).\nconst MINIMUM_WASTED_MS = 50;\n+const UIStrings = {\n+ title: 'Eliminate render-blocking resources',\n+ description: 'Resources are blocking the first paint of your page. Consider ' +\n+ 'delivering critical JS/CSS inline and deferring all non-critical ' +\n+ 'JS/styles. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/blocking-resources).',\n+ displayValue: `{itemCount, plural,\n+ one {1 resource}\n+ other {# resources}\n+ } delayed first paint by {timeInMs, number, milliseconds} ms`,\n+};\n+\n+const str_ = i18n.createStringFormatter(__filename, UIStrings);\n+\n/**\n* Given a simulation's nodeTimings, return an object with the nodes/timing keyed by network URL\n* @param {LH.Gatherer.Simulation.Result['nodeTimings']} nodeTimings\n@@ -52,12 +66,9 @@ class RenderBlockingResources extends Audit {\nstatic get meta() {\nreturn {\nid: 'render-blocking-resources',\n- title: 'Eliminate render-blocking resources',\n+ title: str_(UIStrings.title),\nscoreDisplayMode: Audit.SCORING_MODES.NUMERIC,\n- description:\n- 'Resources are blocking the first paint of your page. Consider ' +\n- 'delivering critical JS/CSS inline and deferring all non-critical ' +\n- 'JS/styles. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/blocking-resources).',\n+ description: str_(UIStrings.description),\n// This audit also looks at CSSUsage but has a graceful fallback if it failed, so do not mark\n// it as a \"requiredArtifact\".\n// TODO: look into adding an `optionalArtifacts` property that captures this\n@@ -198,17 +209,15 @@ class RenderBlockingResources extends Audit {\nconst {results, wastedMs} = await RenderBlockingResources.computeResults(artifacts, context);\nlet displayValue = '';\n- if (results.length > 1) {\n- displayValue = `${results.length} resources delayed first paint by ${wastedMs}ms`;\n- } else if (results.length === 1) {\n- displayValue = `${results.length} resource delayed first paint by ${wastedMs}ms`;\n+ if (results.length > 0) {\n+ displayValue = str_(UIStrings.displayValue, {timeInMs: wastedMs, itemCount: results.length});\n}\n/** @type {LH.Result.Audit.OpportunityDetails['headings']} */\nconst headings = [\n- {key: 'url', valueType: 'url', label: 'URL'},\n- {key: 'totalBytes', valueType: 'bytes', label: 'Size (KB)'},\n- {key: 'wastedMs', valueType: 'timespanMs', label: 'Download Time (ms)'},\n+ {key: 'url', valueType: 'url', label: str_(i18n.UIStrings.columnURL)},\n+ {key: 'totalBytes', valueType: 'bytes', label: str_(i18n.UIStrings.columnSize)},\n+ {key: 'wastedMs', valueType: 'timespanMs', label: str_(i18n.UIStrings.columnWastedTime)},\n];\nconst details = Audit.makeOpportunityDetails(headings, results, wastedMs);\n@@ -223,3 +232,4 @@ class RenderBlockingResources extends Audit {\n}\nmodule.exports = RenderBlockingResources;\n+module.exports.UIStrings = UIStrings;\n", "new_path": "lighthouse-core/audits/byte-efficiency/render-blocking-resources.js", "old_path": "lighthouse-core/audits/byte-efficiency/render-blocking-resources.js" }, { "change_type": "MODIFY", "diff": "'use strict';\nconst Audit = require('../audit');\n-const Util = require('../../report/html/renderer/util');\n+const i18n = require('../../lib/i18n');\n+\n+const UIStrings = {\n+ title: 'Time to Interactive',\n+ description: 'Interactive marks the time at which the page is fully interactive. ' +\n+ '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/consistently-interactive).',\n+};\n+\n+const str_ = i18n.createStringFormatter(__filename, UIStrings);\n/**\n* @fileoverview This audit identifies the time the page is \"consistently interactive\".\n@@ -21,9 +29,8 @@ class InteractiveMetric extends Audit {\nstatic get meta() {\nreturn {\nid: 'interactive',\n- title: 'Time to Interactive',\n- description: 'Interactive marks the time at which the page is fully interactive. ' +\n- '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/consistently-interactive).',\n+ title: str_(UIStrings.title),\n+ description: str_(UIStrings.description),\nscoreDisplayMode: Audit.SCORING_MODES.NUMERIC,\nrequiredArtifacts: ['traces', 'devtoolsLogs'],\n};\n@@ -69,7 +76,7 @@ class InteractiveMetric extends Audit {\ncontext.options.scoreMedian\n),\nrawValue: timeInMs,\n- displayValue: [Util.MS_DISPLAY_VALUE, timeInMs],\n+ displayValue: str_(i18n.UIStrings.ms, {timeInMs}),\nextendedInfo: {\nvalue: extendedInfo,\n},\n@@ -78,3 +85,4 @@ class InteractiveMetric extends Audit {\n}\nmodule.exports = InteractiveMetric;\n+module.exports.UIStrings = UIStrings;\n", "new_path": "lighthouse-core/audits/metrics/interactive.js", "old_path": "lighthouse-core/audits/metrics/interactive.js" }, { "change_type": "MODIFY", "diff": "@@ -39,6 +39,7 @@ const defaultSettings = {\n// the following settings have no defaults but we still want ensure that `key in settings`\n// in config will work in a typechecked way\n+ locale: null, // default determined by the intl library\nblockedUrlPatterns: null,\nadditionalTraceCategories: null,\nextraHeaders: null,\n", "new_path": "lighthouse-core/config/constants.js", "old_path": "lighthouse-core/config/constants.js" }, { "change_type": "MODIFY", "diff": "const Runner = require('./runner');\nconst log = require('lighthouse-logger');\nconst ChromeProtocol = require('./gather/connections/cri.js');\n+const i18n = require('./lib/i18n');\nconst Config = require('./config/config');\n/*\n@@ -34,6 +35,7 @@ const Config = require('./config/config');\nasync function lighthouse(url, flags, configJSON) {\n// TODO(bckenny): figure out Flags types.\nflags = flags || /** @type {LH.Flags} */ ({});\n+ i18n.setLocale(flags.locale);\n// set logging preferences, assume quiet\nflags.logLevel = flags.logLevel || 'error';\n", "new_path": "lighthouse-core/index.js", "old_path": "lighthouse-core/index.js" }, { "change_type": "ADD", "diff": "+/**\n+ * @license Copyright 2018 Google Inc. All Rights Reserved.\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n+ */\n+'use strict';\n+\n+const path = require('path');\n+const MessageFormat = require('intl-messageformat').default;\n+const MessageParser = require('intl-messageformat-parser');\n+const LOCALES = require('./locales');\n+\n+let locale = MessageFormat.defaultLocale;\n+\n+const LH_ROOT = path.join(__dirname, '../../');\n+\n+try {\n+ // Node usually doesn't come with the locales we want built-in, so load the polyfill.\n+ // In browser environments, we won't need the polyfill, and this will throw so wrap in try/catch.\n+\n+ // @ts-ignore\n+ const IntlPolyfill = require('intl');\n+ // @ts-ignore\n+ Intl.NumberFormat = IntlPolyfill.NumberFormat;\n+ // @ts-ignore\n+ Intl.DateTimeFormat = IntlPolyfill.DateTimeFormat;\n+} catch (_) {}\n+\n+const UIStrings = {\n+ ms: '{timeInMs, number, milliseconds}\\xa0ms',\n+ columnURL: 'URL',\n+ columnSize: 'Size (KB)',\n+ columnWastedTime: 'Potential Savings (ms)',\n+};\n+\n+const formats = {\n+ number: {\n+ milliseconds: {\n+ maximumFractionDigits: 0,\n+ },\n+ },\n+};\n+\n+/**\n+ * @param {string} msg\n+ * @param {Record<string, *>} values\n+ */\n+function preprocessMessageValues(msg, values) {\n+ const parsed = MessageParser.parse(msg);\n+ // Round all milliseconds to 10s place\n+ parsed.elements\n+ .filter(el => el.format && el.format.style === 'milliseconds')\n+ .forEach(el => (values[el.id] = Math.round(values[el.id] / 10) * 10));\n+\n+ // Replace all the bytes with KB\n+ parsed.elements\n+ .filter(el => el.format && el.format.style === 'bytes')\n+ .forEach(el => (values[el.id] = values[el.id] / 1024));\n+}\n+\n+module.exports = {\n+ UIStrings,\n+ /**\n+ * @param {string} filename\n+ * @param {Record<string, string>} fileStrings\n+ */\n+ createStringFormatter(filename, fileStrings) {\n+ const mergedStrings = {...UIStrings, ...fileStrings};\n+\n+ /** @param {string} msg @param {*} [values] */\n+ const formatFn = (msg, values) => {\n+ const keyname = Object.keys(mergedStrings).find(key => mergedStrings[key] === msg);\n+ if (!keyname) throw new Error(`Could not locate: ${msg}`);\n+ preprocessMessageValues(msg, values);\n+\n+ const filenameToLookup = keyname in UIStrings ? __filename : filename;\n+ const lookupKey = path.relative(LH_ROOT, filenameToLookup) + '!#' + keyname;\n+ const localeStrings = LOCALES[locale] || {};\n+ const localeString = localeStrings[lookupKey] && localeStrings[lookupKey].message;\n+ // fallback to the original english message if we couldn't find a message in the specified locale\n+ // better to have an english message than no message at all, in some number cases it won't even matter\n+ const messageForMessageFormat = localeString || msg;\n+ // when using accented english, force the use of a different locale for number formatting\n+ const localeForMessageFormat = locale === 'en-XA' ? 'de-DE' : locale;\n+\n+ const formatter = new MessageFormat(messageForMessageFormat, localeForMessageFormat, formats);\n+ return formatter.format(values);\n+ };\n+\n+ return formatFn;\n+ },\n+ /**\n+ * @param {LH.Locale|null} [newLocale]\n+ */\n+ setLocale(newLocale) {\n+ if (!newLocale) return;\n+ locale = newLocale;\n+ },\n+};\n", "new_path": "lighthouse-core/lib/i18n.js", "old_path": null }, { "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+// @ts-nocheck\n+'use strict';\n+\n+module.exports = {\n+ 'en-XA': require('./en-XA.json'),\n+};\n", "new_path": "lighthouse-core/lib/locales/index.js", "old_path": null }, { "change_type": "ADD", "diff": "+#!/usr/bin/env node\n+/**\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-disable no-console, max-len */\n+\n+const fs = require('fs');\n+const path = require('path');\n+\n+const LH_ROOT = path.join(__dirname, '../../../');\n+\n+const ignoredPathComponents = [\n+ '/.git',\n+ '/scripts',\n+ '/node_modules',\n+ '/renderer',\n+ '/test/',\n+ '-test.js',\n+];\n+\n+/**\n+ * @param {string} dir\n+ * @param {Record<string, string>} strings\n+ */\n+function collectAllStringsInDir(dir, strings = {}) {\n+ for (const name of fs.readdirSync(dir)) {\n+ const fullPath = path.join(dir, name);\n+ const relativePath = path.relative(LH_ROOT, fullPath);\n+ if (ignoredPathComponents.some(p => fullPath.includes(p))) continue;\n+\n+ if (fs.statSync(fullPath).isDirectory()) {\n+ collectAllStringsInDir(fullPath, strings);\n+ } else {\n+ if (name.endsWith('.js')) {\n+ console.log('Collecting from', relativePath);\n+ const mod = require(fullPath);\n+ if (!mod.UIStrings) continue;\n+ for (const [key, value] of Object.entries(mod.UIStrings)) {\n+ strings[`${relativePath}!#${key}`] = value;\n+ }\n+ }\n+ }\n+ }\n+\n+ return strings;\n+}\n+\n+/**\n+ * @param {Record<string, string>} strings\n+ */\n+function createPsuedoLocaleStrings(strings) {\n+ const psuedoLocalizedStrings = {};\n+ for (const [key, string] of Object.entries(strings)) {\n+ const psuedoLocalizedString = [];\n+ let braceCount = 0;\n+ let useHatForAccentMark = true;\n+ for (let i = 0; i < string.length; i++) {\n+ const char = string.substr(i, 1);\n+ psuedoLocalizedString.push(char);\n+ // Don't touch the characters inside braces\n+ if (char === '{') {\n+ braceCount++;\n+ } else if (char === '}') {\n+ braceCount--;\n+ } else if (braceCount === 0) {\n+ if (/[a-z]/i.test(char)) {\n+ psuedoLocalizedString.push(useHatForAccentMark ? `\\u0302` : `\\u0301`);\n+ useHatForAccentMark = !useHatForAccentMark;\n+ }\n+ }\n+ }\n+\n+ psuedoLocalizedStrings[key] = psuedoLocalizedString.join('');\n+ }\n+\n+ return psuedoLocalizedStrings;\n+}\n+\n+/**\n+ * @param {LH.Locale} locale\n+ * @param {Record<string, string>} strings\n+ */\n+function writeStringsToLocaleFormat(locale, strings) {\n+ const fullPath = path.join(LH_ROOT, `lighthouse-core/lib/locales/${locale}.json`);\n+ const output = {};\n+ for (const [key, message] of Object.entries(strings)) {\n+ output[key] = {message};\n+ }\n+\n+ fs.writeFileSync(fullPath, JSON.stringify(output, null, 2));\n+}\n+\n+const strings = collectAllStringsInDir(path.join(LH_ROOT, 'lighthouse-core'));\n+const psuedoLocalizedStrings = createPsuedoLocaleStrings(strings);\n+console.log('Collected!');\n+\n+writeStringsToLocaleFormat('en-US', strings);\n+writeStringsToLocaleFormat('en-XA', psuedoLocalizedStrings);\n+console.log('Written to disk!');\n", "new_path": "lighthouse-core/scripts/i18n/collect-strings.js", "old_path": null }, { "change_type": "MODIFY", "diff": "\"@types/configstore\": \"^2.1.1\",\n\"@types/css-font-loading-module\": \"^0.0.2\",\n\"@types/inquirer\": \"^0.0.35\",\n+ \"@types/intl-messageformat\": \"^1.3.0\",\n\"@types/jpeg-js\": \"^0.3.0\",\n\"@types/lodash.isequal\": \"^4.5.2\",\n\"@types/node\": \"*\",\n\"gulp\": \"^3.9.1\",\n\"gulp-replace\": \"^0.5.4\",\n\"gulp-util\": \"^3.0.7\",\n+ \"intl\": \"^1.2.5\",\n\"jest\": \"^23.2.0\",\n\"jsdom\": \"^9.12.0\",\n\"mocha\": \"^3.2.0\",\n\"esprima\": \"^4.0.0\",\n\"http-link-header\": \"^0.8.0\",\n\"inquirer\": \"^3.3.0\",\n+ \"intl-messageformat\": \"^2.2.0\",\n+ \"intl-messageformat-parser\": \"^1.4.0\",\n\"jpeg-js\": \"0.1.2\",\n\"js-library-detector\": \"^4.3.1\",\n\"lighthouse-logger\": \"^1.0.0\",\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "@@ -52,10 +52,13 @@ declare global {\ncpuSlowdownMultiplier?: number\n}\n+ export type Locale = 'en-US'|'en-XA';\n+\nexport type OutputMode = 'json' | 'html' | 'csv';\ninterface SharedFlagsSettings {\noutput?: OutputMode|OutputMode[];\n+ locale?: Locale | null;\nmaxWaitForLoad?: number;\nblockedUrlPatterns?: string[] | null;\nadditionalTraceCategories?: string | null;\n", "new_path": "typings/externs.d.ts", "old_path": "typings/externs.d.ts" }, { "change_type": "ADD", "diff": "+declare module 'intl-messageformat-parser' {\n+ interface Element {\n+ type: 'messageTextElement'|'argumentElement';\n+ id: string\n+ value?: string\n+ format?: null | {type: string; style?: string};\n+ }\n+ function parse(message: string): {elements: Element[]};\n+ export {parse};\n+}\n", "new_path": "typings/intl-messageformat-parser/index.d.ts", "old_path": null }, { "change_type": "MODIFY", "diff": "\"@types/rx\" \"*\"\n\"@types/through\" \"*\"\n+\"@types/intl-messageformat@^1.3.0\":\n+ version \"1.3.0\"\n+ resolved \"https://registry.yarnpkg.com/@types/intl-messageformat/-/intl-messageformat-1.3.0.tgz#6af7144802b13d62ade9ad68f8420cdb33b75916\"\n+\n\"@types/jpeg-js@^0.3.0\":\nversion \"0.3.0\"\nresolved \"https://registry.yarnpkg.com/@types/jpeg-js/-/jpeg-js-0.3.0.tgz#5971f0aa50900194e9565711c265c10027385e89\"\n@@ -2961,6 +2965,20 @@ interpret@^1.0.0:\nversion \"1.0.1\"\nresolved \"https://registry.yarnpkg.com/interpret/-/interpret-1.0.1.tgz#d579fb7f693b858004947af39fa0db49f795602c\"\n+intl-messageformat-parser@1.4.0, intl-messageformat-parser@^1.4.0:\n+ version \"1.4.0\"\n+ resolved \"https://registry.yarnpkg.com/intl-messageformat-parser/-/intl-messageformat-parser-1.4.0.tgz#b43d45a97468cadbe44331d74bb1e8dea44fc075\"\n+\n+intl-messageformat@^2.2.0:\n+ version \"2.2.0\"\n+ resolved \"https://registry.yarnpkg.com/intl-messageformat/-/intl-messageformat-2.2.0.tgz#345bcd46de630b7683330c2e52177ff5eab484fc\"\n+ dependencies:\n+ intl-messageformat-parser \"1.4.0\"\n+\n+intl@^1.2.5:\n+ version \"1.2.5\"\n+ resolved \"https://registry.yarnpkg.com/intl/-/intl-1.2.5.tgz#82244a2190c4e419f8371f5aa34daa3420e2abde\"\n+\ninvariant@^2.2.0:\nversion \"2.2.1\"\nresolved \"https://registry.yarnpkg.com/invariant/-/invariant-2.2.1.tgz#b097010547668c7e337028ebe816ebe36c8a8d54\"\n", "new_path": "yarn.lock", "old_path": "yarn.lock" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
core(i18n): initial utility library (#5644)
1
core
i18n
791,690
17.07.2018 17:08:59
25,200
098d28189ba33f292d4f06824d62116a372aa976
core: warn when extensions affected perf
[ { "change_type": "MODIFY", "diff": "@@ -23,7 +23,7 @@ class BootupTime extends Audit {\ndescription: '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/tools/lighthouse/audits/bootup).',\n- requiredArtifacts: ['traces'],\n+ requiredArtifacts: ['traces', 'LighthouseRunWarnings'],\n};\n}\n@@ -85,6 +85,7 @@ class BootupTime extends Audit {\n* @return {Promise<LH.Audit.Product>}\n*/\nstatic async audit(artifacts, context) {\n+ const runWarnings = artifacts.LighthouseRunWarnings;\nconst settings = context.settings || {};\nconst trace = artifacts.traces[BootupTime.DEFAULT_PASS];\nconst devtoolsLog = artifacts.devtoolsLogs[BootupTime.DEFAULT_PASS];\n@@ -96,6 +97,7 @@ class BootupTime extends Audit {\nconst jsURLs = BootupTime.getJavaScriptURLs(networkRecords);\nconst executionTimings = BootupTime.getExecutionTimingsByURL(tasks, jsURLs);\n+ let hadExcessiveChromeExtension = false;\nlet totalBootupTime = 0;\nconst results = Array.from(executionTimings)\n.map(([url, timingByGroupId]) => {\n@@ -114,6 +116,9 @@ class BootupTime extends Audit {\nconst scriptingTotal = timingByGroupId[taskGroups.scriptEvaluation.id] || 0;\nconst parseCompileTotal = timingByGroupId[taskGroups.scriptParseCompile.id] || 0;\n+ hadExcessiveChromeExtension = hadExcessiveChromeExtension ||\n+ (url.startsWith('chrome-extension:') && scriptingTotal > 100);\n+\nreturn {\nurl: url,\ntotal: bootupTimeForURL,\n@@ -125,6 +130,13 @@ class BootupTime extends Audit {\n.filter(result => result.total >= context.options.thresholdInMs)\n.sort((a, b) => b.total - a.total);\n+\n+ // TODO: consider moving this to core gathering so you don't need to run the audit for warning\n+ if (hadExcessiveChromeExtension) {\n+ runWarnings.push('Chrome extensions negatively affected this page\\'s load performance. ' +\n+ 'Try auditing the page in incognito mode or from a clean Chrome profile.');\n+ }\n+\nconst summary = {wastedMs: totalBootupTime};\nconst headings = [\n", "new_path": "lighthouse-core/audits/bootup-time.js", "old_path": "lighthouse-core/audits/bootup-time.js" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
core: warn when extensions affected perf (#5666)
1
core
null
807,849
17.07.2018 17:33:05
25,200
06b88d4a0fbc4a8fc1923f621725208fc85789bc
feat(project): Move collect-packages into getPackages() method The package configs are now always sorted before searched, yielding a list of packages that is ordered as one would expect from their filepaths. This includes a copypasta of `path-sort` with an important bugfix.
[ { "change_type": "MODIFY", "diff": "const execa = require(\"execa\");\nconst fs = require(\"fs-extra\");\nconst path = require(\"path\");\n-const collectPackages = require(\"@lerna/collect-packages\");\n+const { getPackages } = require(\"@lerna/project\");\n// mocked modules\nconst ChildProcessUtilities = require(\"@lerna/child-process\");\n@@ -27,7 +27,7 @@ describe(\"DiffCommand\", () => {\nit(\"should diff packages from the first commit\", async () => {\nconst cwd = await initFixture(\"basic\");\n- const [pkg1] = await collectPackages(cwd);\n+ const [pkg1] = await getPackages(cwd);\nconst rootReadme = path.join(cwd, \"README.md\");\nawait pkg1.set(\"changed\", 1).serialize();\n@@ -41,7 +41,7 @@ describe(\"DiffCommand\", () => {\nit(\"should diff packages from the most recent tag\", async () => {\nconst cwd = await initFixture(\"basic\");\n- const [pkg1] = await collectPackages(cwd);\n+ const [pkg1] = await getPackages(cwd);\nawait pkg1.set(\"changed\", 1).serialize();\nawait gitAdd(cwd, \"-A\");\n@@ -58,7 +58,7 @@ describe(\"DiffCommand\", () => {\nit(\"should diff a specific package\", async () => {\nconst cwd = await initFixture(\"basic\");\n- const [pkg1, pkg2] = await collectPackages(cwd);\n+ const [pkg1, pkg2] = await getPackages(cwd);\nawait pkg1.set(\"changed\", 1).serialize();\nawait pkg2.set(\"changed\", 1).serialize();\n@@ -71,7 +71,7 @@ describe(\"DiffCommand\", () => {\nit(\"passes diff exclude globs configured with --ignored-changes\", async () => {\nconst cwd = await initFixture(\"basic\");\n- const [pkg1] = await collectPackages(cwd);\n+ const [pkg1] = await getPackages(cwd);\nawait pkg1.set(\"changed\", 1).serialize();\nawait fs.outputFile(path.join(pkg1.location, \"README.md\"), \"ignored change\");\n", "new_path": "commands/diff/__tests__/diff-command.test.js", "old_path": "commands/diff/__tests__/diff-command.test.js" }, { "change_type": "MODIFY", "diff": "@@ -50,9 +50,9 @@ package-5 v1.0.0 (private)\"\n`;\nexports[`LsCommand in a repo with packages outside of packages/ should list packages 1`] = `\n-\"package-1 v1.0.0\n-package-2 v1.0.0\n-package-3 v1.0.0\"\n+\"package-3 v1.0.0\n+package-1 v1.0.0\n+package-2 v1.0.0\"\n`;\nexports[`LsCommand with --include-filtered-dependencies should list packages, including filtered ones 1`] = `\n", "new_path": "commands/list/__tests__/__snapshots__/list-command.test.js.snap", "old_path": "commands/list/__tests__/__snapshots__/list-command.test.js.snap" }, { "change_type": "MODIFY", "diff": "@@ -8,7 +8,6 @@ const log = require(\"npmlog\");\nconst PackageGraph = require(\"@lerna/package-graph\");\nconst Project = require(\"@lerna/project\");\nconst writeLogFile = require(\"@lerna/write-log-file\");\n-const collectPackages = require(\"@lerna/collect-packages\");\nconst collectUpdates = require(\"@lerna/collect-updates\");\nconst filterPackages = require(\"@lerna/filter-packages\");\nconst ValidationError = require(\"@lerna/validation-error\");\n@@ -190,16 +189,18 @@ class Command {\nlog.info(\"versioning\", \"independent\");\n}\n- const { rootPath, packageConfigs } = this.project;\n- const { scope: include, ignore: exclude } = this.options;\n-\nlet chain = Promise.resolve();\n- chain = chain.then(() => collectPackages(rootPath, packageConfigs));\n+ chain = chain.then(() => this.project.getPackages());\nchain = chain.then(packages => {\nthis.packages = packages;\nthis.packageGraph = new PackageGraph(packages);\n- this.filteredPackages = filterPackages(packages, include, exclude, this.options.private);\n+ this.filteredPackages = filterPackages(\n+ packages,\n+ this.options.scope,\n+ this.options.ignore,\n+ this.options.private\n+ );\n});\n// collectUpdates requires that filteredPackages be present prior to checking for\n", "new_path": "core/command/index.js", "old_path": "core/command/index.js" }, { "change_type": "MODIFY", "diff": "},\n\"dependencies\": {\n\"@lerna/child-process\": \"file:../child-process\",\n- \"@lerna/collect-packages\": \"file:../../utils/collect-packages\",\n\"@lerna/collect-updates\": \"file:../../utils/collect-updates\",\n\"@lerna/filter-packages\": \"file:../../utils/filter-packages\",\n\"@lerna/package-graph\": \"file:../package-graph\",\n", "new_path": "core/command/package.json", "old_path": "core/command/package.json" }, { "change_type": "MODIFY", "diff": "const fs = require(\"fs-extra\");\nconst path = require(\"path\");\n-const collectPackages = require(\"@lerna/collect-packages\");\n+const { getPackages } = require(\"@lerna/project\");\n// helpers\nconst initFixture = require(\"@lerna-test/init-fixture\")(__dirname);\n@@ -20,7 +20,7 @@ describe(\"conventional-commits\", () => {\ndescribe(\"recommendVersion()\", () => {\nit(\"returns next version bump\", async () => {\nconst cwd = await initFixture(\"fixed\");\n- const [pkg1] = await collectPackages(cwd);\n+ const [pkg1] = await getPackages(cwd);\n// make a change in package-1\nawait pkg1.set(\"changed\", 1).serialize();\n@@ -33,7 +33,7 @@ describe(\"conventional-commits\", () => {\nit(\"returns package-specific bumps in independent mode\", async () => {\nconst cwd = await initFixture(\"independent\");\n- const [pkg1, pkg2] = await collectPackages(cwd);\n+ const [pkg1, pkg2] = await getPackages(cwd);\nconst opts = { changelogPreset: \"angular\" };\n// make a change in package-1 and package-2\n@@ -56,7 +56,7 @@ describe(\"conventional-commits\", () => {\nit(\"supports local preset paths\", async () => {\nconst cwd = await initFixture(\"fixed\");\n- const [pkg1] = await collectPackages(cwd);\n+ const [pkg1] = await getPackages(cwd);\n// make a change in package-1\nawait pkg1.set(\"changed\", 1).serialize();\n@@ -71,7 +71,7 @@ describe(\"conventional-commits\", () => {\nit(\"propagates errors from callback\", async () => {\nconst cwd = await initFixture(\"fixed\");\n- const [pkg1] = await collectPackages(cwd);\n+ const [pkg1] = await getPackages(cwd);\ntry {\nawait recommendVersion(pkg1, \"fixed\", { changelogPreset: \"./scripts/erroring-preset.js\" });\n@@ -84,7 +84,7 @@ describe(\"conventional-commits\", () => {\nit(\"throws an error when an implicit changelog preset cannot be loaded\", async () => {\nconst cwd = await initFixture(\"fixed\");\n- const [pkg1] = await collectPackages(cwd);\n+ const [pkg1] = await getPackages(cwd);\ntry {\nawait recommendVersion(pkg1, \"fixed\", { changelogPreset: \"garbage\" });\n@@ -99,7 +99,7 @@ describe(\"conventional-commits\", () => {\nit(\"throws an error when an implicit changelog preset with scope cannot be loaded\", async () => {\nconst cwd = await initFixture(\"fixed\");\n- const [pkg1] = await collectPackages(cwd);\n+ const [pkg1] = await getPackages(cwd);\ntry {\nawait recommendVersion(pkg1, \"fixed\", { changelogPreset: \"@scope/garbage\" });\n@@ -112,7 +112,7 @@ describe(\"conventional-commits\", () => {\nit(\"throws an error when an implicit changelog preset with scoped subpath cannot be loaded\", async () => {\nconst cwd = await initFixture(\"fixed\");\n- const [pkg1] = await collectPackages(cwd);\n+ const [pkg1] = await getPackages(cwd);\ntry {\nawait recommendVersion(pkg1, \"fixed\", { changelogPreset: \"@scope/garbage/pail\" });\n@@ -127,7 +127,7 @@ describe(\"conventional-commits\", () => {\nit(\"throws an error when an explicit changelog preset cannot be loaded\", async () => {\nconst cwd = await initFixture(\"fixed\");\n- const [pkg1] = await collectPackages(cwd);\n+ const [pkg1] = await getPackages(cwd);\ntry {\nawait recommendVersion(pkg1, \"fixed\", { changelogPreset: \"conventional-changelog-garbage\" });\n@@ -142,7 +142,7 @@ describe(\"conventional-commits\", () => {\nit(\"throws an error when an explicit changelog preset with subpath cannot be loaded\", async () => {\nconst cwd = await initFixture(\"fixed\");\n- const [pkg1] = await collectPackages(cwd);\n+ const [pkg1] = await getPackages(cwd);\ntry {\nawait recommendVersion(pkg1, \"fixed\", { changelogPreset: \"conventional-changelog-garbage/pail\" });\n@@ -162,7 +162,7 @@ describe(\"conventional-commits\", () => {\nit(\"creates files if they do not exist\", async () => {\nconst cwd = await initFixture(\"changelog-missing\");\n- const [pkg1] = await collectPackages(cwd);\n+ const [pkg1] = await getPackages(cwd);\nconst rootPkg = {\nname: \"root\",\nlocation: cwd,\n@@ -202,7 +202,7 @@ describe(\"conventional-commits\", () => {\nawait gitTag(cwd, \"v1.0.0\");\n- const [pkg1] = await collectPackages(cwd);\n+ const [pkg1] = await getPackages(cwd);\n// make a change in package-1\nawait pkg1.set(\"changed\", 1).serialize();\n@@ -226,7 +226,7 @@ describe(\"conventional-commits\", () => {\nawait gitTag(cwd, \"v1.0.0\");\n- const [pkg1, pkg2] = await collectPackages(cwd);\n+ const [pkg1, pkg2] = await getPackages(cwd);\n// make a change in package-1\nawait pkg1.set(\"changed\", 1).serialize();\n@@ -248,7 +248,7 @@ describe(\"conventional-commits\", () => {\nawait gitTag(cwd, \"v1.0.0\");\n- const [pkg1] = await collectPackages(cwd);\n+ const [pkg1] = await getPackages(cwd);\n// make a change in package-1\nawait pkg1.set(\"changed\", 1).serialize();\n@@ -271,7 +271,7 @@ describe(\"conventional-commits\", () => {\nawait gitTag(cwd, \"package-1@1.0.0\");\nawait gitTag(cwd, \"package-2@1.0.0\");\n- const [pkg1, pkg2] = await collectPackages(cwd);\n+ const [pkg1, pkg2] = await getPackages(cwd);\n// make a change in package-1 and package-2\nawait pkg1.set(\"changed\", 1).serialize();\n", "new_path": "core/conventional-commits/__tests__/conventional-commits.test.js", "old_path": "core/conventional-commits/__tests__/conventional-commits.test.js" }, { "change_type": "MODIFY", "diff": "@@ -5,6 +5,7 @@ const dedent = require(\"dedent\");\nconst globParent = require(\"glob-parent\");\nconst loadJsonFile = require(\"load-json-file\");\nconst log = require(\"npmlog\");\n+const pMap = require(\"p-map\");\nconst path = require(\"path\");\nconst writeJsonFile = require(\"write-json-file\");\n@@ -12,6 +13,7 @@ const ValidationError = require(\"@lerna/validation-error\");\nconst Package = require(\"@lerna/package\");\nconst applyExtends = require(\"./lib/apply-extends\");\nconst deprecateConfig = require(\"./lib/deprecate-config\");\n+const makeFileFinder = require(\"./lib/make-file-finder\");\nclass Project {\nconstructor(cwd) {\n@@ -84,7 +86,7 @@ class Project {\nreturn workspaces.packages || workspaces;\n}\n- return this.config.packages || [Project.DEFAULT_PACKAGE_GLOB];\n+ return this.config.packages || [Project.PACKAGE_GLOB];\n}\nget packageParentDirs() {\n@@ -122,6 +124,33 @@ class Project {\nreturn manifest;\n}\n+ get fileFinder() {\n+ const finder = makeFileFinder(this.rootPath, this.packageConfigs);\n+\n+ // redefine getter to lazy-loaded value\n+ Object.defineProperty(this, \"fileFinder\", {\n+ value: finder,\n+ });\n+\n+ return finder;\n+ }\n+\n+ getPackages() {\n+ const mapper = filePath => {\n+ // https://github.com/isaacs/node-glob/blob/master/common.js#L104\n+ // glob always returns \"\\\\\" as \"/\" in windows, so everyone\n+ // gets normalized because we can't have nice things.\n+ const packageConfigPath = path.normalize(filePath);\n+ const packageDir = path.dirname(packageConfigPath);\n+\n+ return loadJsonFile(packageConfigPath).then(\n+ packageJson => new Package(packageJson, packageDir, this.rootPath)\n+ );\n+ };\n+\n+ return this.fileFinder(\"package.json\", filePaths => pMap(filePaths, mapper, { concurrency: 50 }));\n+ }\n+\nisIndependent() {\nreturn this.version === \"independent\";\n}\n@@ -134,6 +163,7 @@ class Project {\n}\n}\n-Project.DEFAULT_PACKAGE_GLOB = \"packages/*\";\n+Project.PACKAGE_GLOB = \"packages/*\";\nmodule.exports = Project;\n+module.exports.getPackages = cwd => new Project(cwd).getPackages();\n", "new_path": "core/project/index.js", "old_path": "core/project/index.js" }, { "change_type": "ADD", "diff": "+\"use strict\";\n+\n+const globby = require(\"globby\");\n+const pMap = require(\"p-map\");\n+const path = require(\"path\");\n+const ValidationError = require(\"@lerna/validation-error\");\n+const pathSort = require(\"./path-sort\");\n+\n+module.exports = makeFileFinder;\n+\n+function makeFileFinder(rootPath, packageConfigs) {\n+ const globOpts = {\n+ cwd: rootPath,\n+ absolute: true,\n+ case: false,\n+ followSymlinkedDirectories: false,\n+ };\n+\n+ if (packageConfigs.some(cfg => cfg.indexOf(\"**\") > -1)) {\n+ if (packageConfigs.some(cfg => cfg.indexOf(\"node_modules\") > -1)) {\n+ throw new ValidationError(\n+ \"EPKGCONFIG\",\n+ \"An explicit node_modules package path does not allow globstars (**)\"\n+ );\n+ }\n+\n+ globOpts.ignore = [\n+ // allow globs like \"packages/**\",\n+ // but avoid picking up node_modules/**/package.json\n+ \"**/node_modules/**\",\n+ ];\n+ }\n+\n+ return (fileName, fileMapper) =>\n+ pMap(\n+ pathSort(packageConfigs),\n+ globPath => {\n+ let chain = globby(path.join(globPath, fileName), globOpts);\n+\n+ // fast-glob does not respect pattern order, so we re-sort by absolute path\n+ chain = chain.then(filePaths => pathSort(filePaths));\n+\n+ if (fileMapper) {\n+ chain = chain.then(fileMapper);\n+ }\n+\n+ return chain;\n+ },\n+ { concurrency: 4 }\n+ )\n+ // flatten the results\n+ .then(results => results.reduce((acc, result) => acc.concat(result), []));\n+}\n", "new_path": "core/project/lib/make-file-finder.js", "old_path": null }, { "change_type": "ADD", "diff": "+\"use strict\";\n+\n+const path = require(\"path\");\n+\n+function sorter(a, b) {\n+ const l = Math.max(a.length, b.length);\n+\n+ for (let i = 0; i < l; i += 1) {\n+ if (!(i in a)) {\n+ return -1;\n+ }\n+ if (!(i in b)) {\n+ return +1;\n+ }\n+ if (a[i].toUpperCase() > b[i].toUpperCase()) {\n+ return +1;\n+ }\n+ if (a[i].toUpperCase() < b[i].toUpperCase()) {\n+ return -1;\n+ }\n+ }\n+\n+ if (a.length < b.length) {\n+ return -1;\n+ }\n+ if (a.length > b.length) {\n+ return +1;\n+ }\n+\n+ return 0;\n+}\n+\n+function pathsort(paths, sep = path.sep) {\n+ return paths\n+ .map(el => el.split(sep))\n+ .sort(sorter)\n+ .map(el => el.join(sep));\n+}\n+\n+function standalone(sep = path.sep) {\n+ return (a, b) => sorter(a.split(sep), b.split(sep));\n+}\n+\n+module.exports = pathsort;\n+module.exports.standalone = standalone;\n", "new_path": "core/project/lib/path-sort.js", "old_path": null }, { "change_type": "MODIFY", "diff": "\"dedent\": \"^0.7.0\",\n\"dot-prop\": \"^4.2.0\",\n\"glob-parent\": \"^3.1.0\",\n+ \"globby\": \"^8.0.1\",\n\"load-json-file\": \"^4.0.0\",\n\"npmlog\": \"^4.1.2\",\n+ \"p-map\": \"^1.2.0\",\n\"resolve-from\": \"^4.0.0\",\n\"write-json-file\": \"^2.3.0\"\n}\n", "new_path": "core/project/package.json", "old_path": "core/project/package.json" }, { "change_type": "MODIFY", "diff": "\"yargs\": \"^12.0.1\"\n}\n},\n- \"@lerna/collect-packages\": {\n- \"version\": \"file:utils/collect-packages\",\n- \"requires\": {\n- \"@lerna/package\": \"file:core/package\",\n- \"@lerna/validation-error\": \"file:core/validation-error\",\n- \"globby\": \"^8.0.1\",\n- \"load-json-file\": \"^4.0.0\",\n- \"p-map\": \"^1.2.0\"\n- }\n- },\n\"@lerna/collect-updates\": {\n\"version\": \"file:utils/collect-updates\",\n\"requires\": {\n\"version\": \"file:core/command\",\n\"requires\": {\n\"@lerna/child-process\": \"file:core/child-process\",\n- \"@lerna/collect-packages\": \"file:utils/collect-packages\",\n\"@lerna/collect-updates\": \"file:utils/collect-updates\",\n\"@lerna/filter-packages\": \"file:utils/filter-packages\",\n\"@lerna/package-graph\": \"file:core/package-graph\",\n\"dedent\": \"^0.7.0\",\n\"dot-prop\": \"^4.2.0\",\n\"glob-parent\": \"^3.1.0\",\n+ \"globby\": \"^8.0.1\",\n\"load-json-file\": \"^4.0.0\",\n\"npmlog\": \"^4.1.2\",\n+ \"p-map\": \"^1.2.0\",\n\"resolve-from\": \"^4.0.0\",\n\"write-json-file\": \"^2.3.0\"\n}\n", "new_path": "package-lock.json", "old_path": "package-lock.json" }, { "change_type": "DELETE", "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=\"3.0.0-beta.17\"></a>\n-# [3.0.0-beta.17](https://github.com/lerna/lerna/compare/v3.0.0-beta.16...v3.0.0-beta.17) (2018-04-13)\n-\n-**Note:** Version bump only for package @lerna/collect-packages\n-\n-\n-\n-\n-\n-<a name=\"3.0.0-beta.12\"></a>\n-# [3.0.0-beta.12](https://github.com/lerna/lerna/compare/v3.0.0-beta.11...v3.0.0-beta.12) (2018-03-30)\n-\n-**Note:** Version bump only for package @lerna/collect-packages\n-\n-\n-\n-\n-\n-<a name=\"3.0.0-beta.11\"></a>\n-# [3.0.0-beta.11](https://github.com/lerna/lerna/compare/v3.0.0-beta.10...v3.0.0-beta.11) (2018-03-29)\n-\n-**Note:** Version bump only for package @lerna/collect-packages\n-\n-\n-\n-\n-\n-<a name=\"3.0.0-beta.10\"></a>\n-# [3.0.0-beta.10](https://github.com/lerna/lerna/compare/v3.0.0-beta.9...v3.0.0-beta.10) (2018-03-27)\n-\n-**Note:** Version bump only for package @lerna/collect-packages\n-\n-\n-\n-\n-\n-<a name=\"3.0.0-beta.1\"></a>\n-# [3.0.0-beta.1](https://github.com/lerna/lerna/compare/v3.0.0-beta.0...v3.0.0-beta.1) (2018-03-09)\n-\n-\n-### Features\n-\n-* **collect-packages:** simplify signature ([39170cf](https://github.com/lerna/lerna/commit/39170cf))\n-\n-\n-### BREAKING CHANGES\n-\n-* **collect-packages:** Formerly a config object, it is now two parameters, only the first of\n-which (rootPath) is required. The second parameter is a list of package\n-location globs, defaulting to lerna's default of `[\"packages/*\"]`.\n", "new_path": null, "old_path": "utils/collect-packages/CHANGELOG.md" }, { "change_type": "DELETE", "diff": "-# `@lerna/collect-packages`\n-\n-> An internal Lerna tool\n-\n-## Usage\n-\n-You probably shouldn't, at least directly.\n-\n-Install [lerna](https://www.npmjs.com/package/lerna) for access to the `lerna` CLI.\n", "new_path": null, "old_path": "utils/collect-packages/README.md" }, { "change_type": "DELETE", "diff": "-\"use strict\";\n-\n-const globby = require(\"globby\");\n-const loadJsonFile = require(\"load-json-file\");\n-const path = require(\"path\");\n-const pMap = require(\"p-map\");\n-\n-const Package = require(\"@lerna/package\");\n-const ValidationError = require(\"@lerna/validation-error\");\n-\n-module.exports = collectPackages;\n-\n-function collectPackages(rootPath, packageConfigs = [\"packages/*\"]) {\n- const globOpts = {\n- cwd: rootPath,\n- absolute: true,\n- followSymlinkedDirectories: false,\n- };\n-\n- const hasNodeModules = packageConfigs.some(cfg => cfg.indexOf(\"node_modules\") > -1);\n- const hasGlobStar = packageConfigs.some(cfg => cfg.indexOf(\"**\") > -1);\n-\n- if (hasGlobStar) {\n- if (hasNodeModules) {\n- throw new ValidationError(\n- \"EPKGCONFIG\",\n- \"An explicit node_modules package path does not allow globstars (**)\"\n- );\n- }\n-\n- globOpts.ignore = [\n- // allow globs like \"packages/**\",\n- // but avoid picking up node_modules/**/package.json\n- \"**/node_modules/**\",\n- ];\n- }\n-\n- return pMap(\n- packageConfigs,\n- globPath =>\n- globby(path.join(globPath, \"package.json\"), globOpts).then(\n- globResults =>\n- pMap(globResults, globResult => {\n- // https://github.com/isaacs/node-glob/blob/master/common.js#L104\n- // glob always returns \"\\\\\" as \"/\" in windows, so everyone\n- // gets normalized because we can't have nice things.\n- const packageConfigPath = path.normalize(globResult);\n- const packageDir = path.dirname(packageConfigPath);\n-\n- return loadJsonFile(packageConfigPath).then(\n- packageJson => new Package(packageJson, packageDir, rootPath)\n- );\n- }),\n- { concurrency: 50 }\n- ),\n- { concurrency: 4 }\n- ).then(results => {\n- // fast-glob does not respect pattern order, so we re-sort by absolute path\n- const lexicalByLocation = (a, b) => a.location.localeCompare(b.location);\n-\n- return results.reduce((pkgs, result) => pkgs.concat(result.sort(lexicalByLocation)), []);\n- });\n-}\n", "new_path": null, "old_path": "utils/collect-packages/collect-packages.js" }, { "change_type": "DELETE", "diff": "-{\n- \"name\": \"@lerna/collect-packages\",\n- \"version\": \"3.0.0-beta.17\",\n- \"description\": \"An internal Lerna tool\",\n- \"keywords\": [\n- \"lerna\",\n- \"utils\"\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- \"files\": [\n- \"collect-packages.js\"\n- ],\n- \"main\": \"collect-packages.js\",\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 \\\"Run tests from root\\\" && exit 1\"\n- },\n- \"dependencies\": {\n- \"@lerna/package\": \"file:../../core/package\",\n- \"@lerna/validation-error\": \"file:../../core/validation-error\",\n- \"globby\": \"^8.0.1\",\n- \"load-json-file\": \"^4.0.0\",\n- \"p-map\": \"^1.2.0\"\n- }\n-}\n", "new_path": null, "old_path": "utils/collect-packages/package.json" } ]
JavaScript
MIT License
lerna/lerna
feat(project): Move collect-packages into getPackages() method The package configs are now always sorted before searched, yielding a list of packages that is ordered as one would expect from their filepaths. This includes a copypasta of `path-sort` with an important bugfix.
1
feat
project
217,922
17.07.2018 17:41:19
-7,200
e73418e9b1808096fb3d82a8ff68950493c6ea00
chore: proper teams invite system with notifications on premium team list progress
[ { "change_type": "MODIFY", "diff": "@@ -46,6 +46,8 @@ import {SharedEntityService} from './database/shared-entity/shared-entity.servic\nimport {AbstractNotification} from './notification/abstract-notification';\nimport {ListProgressNotification} from '../model/notification/list-progress-notification';\nimport {NotificationService} from './notification/notification.service';\n+import {TeamInviteNotification} from '../model/notification/team-invite-notification';\n+import {TeamExclusionNotification} from '../model/notification/team-exclusion-notification';\nexport const DATA_EXTRACTORS: Provider[] = [\n@@ -70,6 +72,8 @@ export const DATA_EXTRACTORS: Provider[] = [\nparent: AbstractNotification,\nchildren: {\nLIST_PROGRESS: ListProgressNotification,\n+ TEAM_INVITE: TeamInviteNotification,\n+ TEAM_EXCLUSION: TeamExclusionNotification,\n}\n}\n]),\n", "new_path": "src/app/core/core.module.ts", "old_path": "src/app/core/core.module.ts" }, { "change_type": "MODIFY", "diff": "@@ -5,7 +5,7 @@ import {NgSerializerService} from '@kaiu/ng-serializer';\nimport {AngularFirestore} from 'angularfire2/firestore';\nimport {PendingChangesService} from './pending-changes/pending-changes.service';\nimport {UserService} from './user.service';\n-import {Observable} from 'rxjs/index';\n+import {combineLatest, Observable} from 'rxjs/index';\nimport {map, mergeMap} from 'rxjs/operators';\n@Injectable({\n@@ -18,11 +18,21 @@ export class TeamService extends FirestoreStorage<Team> {\nsuper(firestore, serializer, zone, pendingChangesService);\n}\n+ public isPremium(team: Team): Observable<boolean> {\n+ const members = Object.keys(team.members).filter(userId => team.isConfirmed(userId));\n+ return combineLatest(members.map(member => this.userService.get(member)))\n+ .pipe(\n+ map(resultMembers => {\n+ return resultMembers.reduce((premium, m) => premium || m.patron || m.admin, false);\n+ })\n+ );\n+ }\n+\npublic getUserTeams(): Observable<Team[]> {\nreturn this.userService.getUserData().pipe(\nmergeMap(user => {\nreturn this.firestore\n- .collection(this.getBaseUri(), ref => ref.where(`members.${user.$key}`, '==', true))\n+ .collection(this.getBaseUri(), ref => ref.where(`members.${user.$key}`, '>=', -1))\n.snapshotChanges()\n.pipe(\nmap(snaps => snaps.map(snap => {\n", "new_path": "src/app/core/database/team.service.ts", "old_path": "src/app/core/database/team.service.ts" }, { "change_type": "MODIFY", "diff": "export enum NotificationType {\n- LIST_PROGRESS = 'LIST_PROGRESS'\n+ LIST_PROGRESS = 'LIST_PROGRESS',\n+ TEAM_INVITE = 'TEAM_INVITE',\n+ TEAM_EXCLUSION = 'TEAM_EXCLUSION'\n}\n", "new_path": "src/app/core/notification/notification-type.ts", "old_path": "src/app/core/notification/notification-type.ts" }, { "change_type": "ADD", "diff": "+import {AbstractNotification} from './abstract-notification';\n+import {NotificationType} from './notification-type';\n+\n+export abstract class NotificationWithQuestion extends AbstractNotification {\n+\n+ isQuestion = true;\n+\n+ protected constructor(public readonly type: NotificationType) {\n+ super(type);\n+ }\n+}\n", "new_path": "src/app/core/notification/notification-with-question.ts", "old_path": null }, { "change_type": "MODIFY", "diff": "@@ -11,6 +11,7 @@ import {LocalizedDataService} from '../data/localized-data.service';\nimport {map, mergeMap, shareReplay} from 'rxjs/operators';\nimport {I18nToolsService} from '../tools/i18n-tools.service';\nimport {combineLatest, Observable} from 'rxjs';\n+import {AbstractNotification} from './abstract-notification';\n@Injectable({\nprovidedIn: 'root'\n@@ -38,29 +39,26 @@ export class NotificationService extends RelationshipService<NotificationRelatio\npublic init(): void {\n// Initialize notifications listener.\n- this.notifications$\n- .pipe(\n- map(relationships => relationships.filter(r => !r.to.alerted))\n- )\n- .subscribe((relationships) => this.handleNotifications(relationships));\n+ this.notifications$.subscribe((relationships) => this.handleNotifications(relationships));\n}\nhandleNotifications(relationships: NotificationRelationship[]): void {\n+ const toAlert = relationships.filter(r => !r.to.alerted);\n// If there's only one, handle it alone.\n- if (relationships.length === 1) {\n+ if (toAlert.length === 1) {\nthis.ipc.send('notification:user', {\ntitle: 'FFXIV Teamcraft',\n- content: relationships[0].to.getContent(this.translateService, this.localizedDataService, this.i18nTools),\n+ content: toAlert[0].to.getContent(this.translateService, this.localizedDataService, this.i18nTools),\n});\n} else {\nthis.ipc.send('notification:user', {\ntitle: 'FFXIV Teamcraft',\n- content: this.translateService.instant('NOTIFICATIONS.You_have_x_notifications', {amount: relationships.length})\n+ content: this.translateService.instant('NOTIFICATIONS.You_have_x_notifications', {amount: toAlert.length})\n});\n}\n// Save notifications changes.\ncombineLatest(\n- ...relationships.map(relationship => {\n+ ...toAlert.map(relationship => {\nrelationship.to.alerted = true;\nreturn this.set(relationship.$key, relationship);\n})\n@@ -71,7 +69,7 @@ export class NotificationService extends RelationshipService<NotificationRelatio\n...relationships\n.filter(relationship => {\n// Get only notifications that are more than a week (8 days) old\n- return (Date.now() - relationship.to.date) < 691200000\n+ return (Date.now() - relationship.to.date) > 691200000\n})\n.map(relationship => {\n// delete these notifications\n@@ -80,6 +78,13 @@ export class NotificationService extends RelationshipService<NotificationRelatio\n).subscribe();\n}\n+ public prepareNotification(target: string, notification: AbstractNotification): NotificationRelationship {\n+ const relationship = new NotificationRelationship();\n+ relationship.from = target;\n+ relationship.to = notification;\n+ return relationship;\n+ }\n+\nprotected getRelationCollection(): string {\nreturn 'notifications';\n}\n", "new_path": "src/app/core/notification/notification.service.ts", "old_path": "src/app/core/notification/notification.service.ts" }, { "change_type": "ADD", "diff": "+import {AbstractNotification} from '../../core/notification/abstract-notification';\n+import {TranslateService} from '@ngx-translate/core';\n+import {LocalizedDataService} from '../../core/data/localized-data.service';\n+import {I18nToolsService} from '../../core/tools/i18n-tools.service';\n+import {NotificationType} from '../../core/notification/notification-type';\n+\n+export class TeamExclusionNotification extends AbstractNotification {\n+\n+ constructor(public teamName: string) {\n+ super(NotificationType.TEAM_EXCLUSION);\n+ }\n+\n+ getContent(translate: TranslateService, l12n: LocalizedDataService, i18nTools: I18nToolsService): string {\n+ return translate.instant('NOTIFICATIONS.Team_exclusion', {\n+ teamName: this.teamName\n+ });\n+ }\n+\n+ getIcon(): string {\n+ return 'person_add_disabled';\n+ }\n+\n+ getTargetRoute(): string[] {\n+ return undefined;\n+ }\n+\n+}\n", "new_path": "src/app/model/notification/team-exclusion-notification.ts", "old_path": null }, { "change_type": "ADD", "diff": "+import {NotificationWithQuestion} from '../../core/notification/notification-with-question';\n+import {I18nToolsService} from '../../core/tools/i18n-tools.service';\n+import {LocalizedDataService} from '../../core/data/localized-data.service';\n+import {TranslateService} from '@ngx-translate/core';\n+import {NotificationType} from '../../core/notification/notification-type';\n+import {Team} from '../other/team';\n+import {DeserializeAs} from '@kaiu/serializer';\n+\n+export class TeamInviteNotification extends NotificationWithQuestion {\n+\n+ @DeserializeAs(Team)\n+ public readonly team: Team;\n+\n+ public constructor(private invitedBy: string, team: Team) {\n+ super(NotificationType.TEAM_INVITE);\n+ this.team = team;\n+ }\n+\n+ getContent(translate: TranslateService, l12n: LocalizedDataService, i18nTools: I18nToolsService): string {\n+ return translate.instant('NOTIFICATIONS.Team_invite', {\n+ invitedBy: this.invitedBy,\n+ teamName: this.team.name\n+ });\n+ }\n+\n+ getIcon(): string {\n+ return 'person_add';\n+ }\n+\n+ getTargetRoute(): string[] {\n+ return undefined;\n+ }\n+\n+}\n", "new_path": "src/app/model/notification/team-invite-notification.ts", "old_path": null }, { "change_type": "MODIFY", "diff": "@@ -6,11 +6,22 @@ export class Team extends DataModel {\nleader: string;\n- // This is a string <=> boolean map because we need it indexed on userId for easy requests inside firestore.\n- members: { [index: string]: boolean } = {};\n+ // This is a string <=> number map because we need it indexed on userId for easy requests inside firestore.\n+ // If number is 0, then it's added but not confirmed, 1 is added and confirmed\n+ members: { [index: string]: number } = {};\npublic addMember(userId: string): void {\n- this.members[userId] = true;\n+ this.members[userId] = 0;\n+ }\n+\n+ public confirmMember(userId: string): void {\n+ if (this.members[userId] === 0) {\n+ this.members[userId] = 1;\n+ }\n+ }\n+\n+ public isConfirmed(userId: string): boolean {\n+ return this.members[userId] === 1;\n}\npublic removeMember(userId: string): void {\n", "new_path": "src/app/model/other/team.ts", "old_path": "src/app/model/other/team.ts" }, { "change_type": "MODIFY", "diff": "@@ -16,7 +16,7 @@ import {Router} from '@angular/router';\nimport {ListRow} from '../../../model/list/list-row';\nimport {MatDialog, MatSnackBar} from '@angular/material';\nimport {ConfirmationPopupComponent} from '../../../modules/common-components/confirmation-popup/confirmation-popup.component';\n-import {Observable, of, ReplaySubject} from 'rxjs';\n+import {combineLatest, Observable, of, ReplaySubject} from 'rxjs';\nimport {UserService} from 'app/core/database/user.service';\nimport {ListService} from '../../../core/database/list.service';\nimport {ListManagerService} from '../../../core/list/list-manager.service';\n@@ -44,7 +44,6 @@ import {CommissionCreationPopupComponent} from '../../commission-board/commissio\nimport {CommissionService} from '../../../core/database/commission/commission.service';\nimport {NotificationService} from '../../../core/notification/notification.service';\nimport {ListProgressNotification} from '../../../model/notification/list-progress-notification';\n-import {NotificationRelationship} from '../../../core/notification/notification-relationship';\nimport {Team} from '../../../model/other/team';\nimport {TeamService} from '../../../core/database/team.service';\nimport {catchError} from 'rxjs/internal/operators';\n@@ -445,12 +444,30 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\n})\n).subscribe();\n}\n- // If the modification isn't made by the author of the list, send him a notification.\n- if (this.userData.$key !== this.listData.authorId) {\n- const relationship = new NotificationRelationship();\n- relationship.from = this.listData.authorId;\n- relationship.to = new ListProgressNotification(list.name, this.characterData.name, data.amount, data.row.id, list.$key);\n- this.notificationService.add(relationship);\n+ // If this list belongs to a team\n+ if (list.teamId !== undefined) {\n+ this.team$\n+ .pipe(\n+ first(),\n+ mergeMap(team => this.teamService.isPremium(team)\n+ .pipe(\n+ map(res => (res ? team : null))\n+ )\n+ ),\n+ filter(res => res !== null),\n+ mergeMap((team: Team) => {\n+ const notification = new ListProgressNotification(list.name,\n+ this.characterData.name, data.amount, data.row.id, list.$key);\n+ const relevantMembers = Object.keys(team.members)\n+ .filter(member => team.isConfirmed(member) && member !== this.userData.$key);\n+ return combineLatest(relevantMembers.map(userId => {\n+ const preparedNotification = this.notificationService.prepareNotification(userId, notification);\n+ return this.notificationService.add(preparedNotification);\n+ }));\n+ })\n+ )\n+ .subscribe();\n+\n}\n}\n", "new_path": "src/app/pages/list/list-details/list-details.component.ts", "old_path": "src/app/pages/list/list-details/list-details.component.ts" }, { "change_type": "MODIFY", "diff": "</button>\n</div>\n<mat-list>\n- <mat-list-item *ngFor=\"let notification of notifications\" [class.mat-elevation-z5]=\"!notification.to.read\"\n+ <mat-list-item *ngFor=\"let notification of notifications; trackBy: trackByNotificationFn\"\n+ [class.mat-elevation-z5]=\"!notification.to.read\"\n(click)=\"notification.to.read?null:markAsRead(notification)\">\n<mat-icon matListIcon>{{notification.to.getIcon()}}</mat-icon>\n<p matLine>{{notification.to.getContent(translate, l12n, i18nTools)}}</p>\n<i matLine class=\"date\">{{notification.to.date | date:'medium'}}</i>\n- <button mat-icon-button [routerLink]=\"notification.to.getTargetRoute()\">\n+ <div *ngIf=\"notification.to.isQuestion === true\">\n+ <div matLine>\n+ <button mat-raised-button color=\"accent\"\n+ (click)=\"answerQuestion(notification, true)\">\n+ <mat-icon>check</mat-icon>\n+ </button>\n+ <button mat-button color=\"warn\" (click)=\"answerQuestion(notification, false)\">\n+ <mat-icon>close</mat-icon>\n+ </button>\n+ </div>\n+ </div>\n+ <button mat-icon-button *ngIf=\"notification.to.getTargetRoute() !== undefined\"\n+ [routerLink]=\"notification.to.getTargetRoute()\">\n<mat-icon>open_in_new</mat-icon>\n</button>\n</mat-list-item>\n", "new_path": "src/app/pages/notifications/notifications/notifications.component.html", "old_path": "src/app/pages/notifications/notifications/notifications.component.html" }, { "change_type": "MODIFY", "diff": "@@ -5,6 +5,8 @@ import {NotificationRelationship} from '../../../core/notification/notification-\nimport {LocalizedDataService} from '../../../core/data/localized-data.service';\nimport {I18nToolsService} from '../../../core/tools/i18n-tools.service';\nimport {TranslateService} from '@ngx-translate/core';\n+import {TeamService} from '../../../core/database/team.service';\n+import {TeamInviteNotification} from '../../../model/notification/team-invite-notification';\n@Component({\nselector: 'app-notifications',\n@@ -17,7 +19,8 @@ export class NotificationsComponent {\npublic notifications$: Observable<NotificationRelationship[]>;\nconstructor(private notificationService: NotificationService,\n- public l12n: LocalizedDataService, public i18nTools: I18nToolsService, public translate: TranslateService) {\n+ public l12n: LocalizedDataService, public i18nTools: I18nToolsService,\n+ public translate: TranslateService, private teamService: TeamService) {\nthis.notifications$ = this.notificationService.notifications$;\n}\n@@ -30,4 +33,25 @@ export class NotificationsComponent {\nthis.notificationService.set(notification.$key, notification);\n}\n+ public answerQuestion(notification: NotificationRelationship, answer: boolean): void {\n+ switch (notification.to.type) {\n+ case 'TEAM_INVITE':\n+ if (answer) {\n+ (<TeamInviteNotification>notification.to).team.confirmMember(notification.from);\n+ } else {\n+ (<TeamInviteNotification>notification.to).team.removeMember(notification.from);\n+ }\n+ this.teamService.set((<TeamInviteNotification>notification.to).team.$key, (<TeamInviteNotification>notification.to).team)\n+ .subscribe();\n+ break;\n+ default:\n+ break;\n+ }\n+ this.notificationService.remove(notification.$key).subscribe();\n+ }\n+\n+ public trackByNotificationFn(index: number, notification: NotificationRelationship): string {\n+ return notification.$key;\n+ }\n+\n}\n", "new_path": "src/app/pages/notifications/notifications/notifications.component.ts", "old_path": "src/app/pages/notifications/notifications/notifications.component.ts" }, { "change_type": "MODIFY", "diff": "<h2>{{'TEAMS.Title' | translate}}</h2>\n-<div *ngIf=\"user$ | async as user\">\n+<div *ngIf=\"user$ | async as character\">\n<div *ngIf=\"teams$ | async as teams; else loading\">\n<mat-expansion-panel *ngFor=\"let team of teams; trackBy: trackByTeamFn\" class=\"team-panel\">\n<mat-expansion-panel-header>\n</button>\n</span>\n</mat-panel-title>\n- <button mat-icon-button color=\"warn\" *ngIf=\"team.leader === user.$key\"\n+ <button mat-icon-button color=\"warn\" *ngIf=\"team.leader === character.user.$key\"\n(click)=\"$event.stopPropagation();deleteTeam(team)\">\n<mat-icon>delete</mat-icon>\n</button>\n<mat-list *ngIf=\"getTeamMembers(team) | async as members; else loadingMembers\">\n<mat-list-item *ngFor=\"let member of members\">\n<img src=\"{{member.avatar}}\" alt=\"\" mat-list-avatar>\n- <div matLine class=\"member-name\">\n+ <div matLine class=\"member-name\" [class.pending]=\"!team.isConfirmed(member.user.$key)\">\n{{member.name}}\n+ <mat-icon matTooltip=\"{{'TEAMS.Pending' | translate}}\"\n+ matTooltipPosition=\"above\"\n+ *ngIf=\"!team.isConfirmed(member.user.$key)\">\n+ hourglass_empty\n+ </mat-icon>\n<div matTooltip=\"{{'PROFILE.Patreon_supporter' | translate}}\"\nmatTooltipPosition=\"above\">\n<i class=\"fab fa-patreon\" *ngIf=\"member.user.patron || member.user.admin\"></i>\n<mat-icon *ngIf=\"member.user.$key === team.leader\">stars</mat-icon>\n</div>\n<button mat-icon-button color=\"warn\"\n- *ngIf=\"team.leader === user.$key && member.user.$key !== team.leader\"\n+ *ngIf=\"(team.leader === character.user.$key && member.user.$key !== team.leader) ||\n+ member.user.$key === character.user.$key\"\n(click)=\"removeUser(team, member.user)\">\n<mat-icon>close</mat-icon>\n</button>\n<mat-spinner></mat-spinner>\n</div>\n</ng-template>\n- <button mat-button (click)=\"addUser(team)\" color=\"accent\" class=\"large-button\">\n+ <button mat-button (click)=\"addUser(team, character)\" color=\"accent\" class=\"large-button\">\n<mat-icon class=\"button-icon\">person_add</mat-icon>\n{{'TEAMS.AddUser' | translate}}\n</button>\n", "new_path": "src/app/pages/team/team/team.component.html", "old_path": "src/app/pages/team/team/team.component.html" }, { "change_type": "MODIFY", "diff": "mat-icon {\nmargin-left: 5px;\n}\n+ &.pending {\n+ opacity: .7;\n+ }\n}\n.large-button {\n", "new_path": "src/app/pages/team/team/team.component.scss", "old_path": "src/app/pages/team/team/team.component.scss" }, { "change_type": "MODIFY", "diff": "@@ -13,6 +13,9 @@ import {faPatreon} from '@fortawesome/fontawesome-free-brands';\nimport fontawesome from '@fortawesome/fontawesome';\nimport {ConfirmationPopupComponent} from '../../../modules/common-components/confirmation-popup/confirmation-popup.component';\nimport {NameEditPopupComponent} from '../../../modules/common-components/name-edit-popup/name-edit-popup.component';\n+import {NotificationService} from '../../../core/notification/notification.service';\n+import {TeamInviteNotification} from '../../../model/notification/team-invite-notification';\n+import {TeamExclusionNotification} from '../../../model/notification/team-exclusion-notification';\n@Component({\nselector: 'app-team',\n@@ -25,12 +28,12 @@ export class TeamComponent {\npublic teamMembersObservables: { [index: string]: Observable<any[]> } = {};\n- public user$: Observable<AppUser>;\n+ public user$: Observable<any>;\nconstructor(private teamService: TeamService, private dialog: MatDialog, private userService: UserService,\n- private snack: MatSnackBar, private translate: TranslateService) {\n+ private snack: MatSnackBar, private translate: TranslateService, private notificationService: NotificationService) {\nthis.teams$ = this.teamService.getUserTeams();\n- this.user$ = this.userService.getUserData();\n+ this.user$ = this.userService.getCharacter();\nfontawesome.library.add(faPatreon);\n}\n@@ -49,15 +52,19 @@ export class TeamComponent {\n).subscribe();\n}\n- addUser(team: Team): void {\n+ addUser(team: Team, currentUser: any): void {\nthis.dialog.open(UserSelectionPopupComponent).afterClosed()\n.pipe(\nfilter(u => u !== ''),\n- map(user => {\n+ mergeMap((user) => {\nteam.addMember(user.$key);\n- return team;\n+ const notification = new TeamInviteNotification(currentUser.name, team);\n+ return this.notificationService.add(this.notificationService.prepareNotification(user.$key, notification))\n+ .pipe(\n+ map(() => team)\n+ );\n}),\n- mergeMap(updatedTeam => this.teamService.set(updatedTeam.$key, updatedTeam))\n+ mergeMap(updatedTeam => this.teamService.set(updatedTeam.$key, updatedTeam)),\n)\n.subscribe(() => {\n// Clear team members cache\n@@ -70,6 +77,16 @@ export class TeamComponent {\n.pipe(\nfilter(res => res),\nmergeMap(() => of(team)),\n+ mergeMap((t) => {\n+ if (t.isConfirmed(user.$key)) {\n+ const notification = new TeamExclusionNotification(team.name);\n+ return this.notificationService.add(this.notificationService.prepareNotification(user.$key, notification))\n+ .pipe(\n+ map(() => t)\n+ );\n+ }\n+ return of(t);\n+ }),\nmap((t) => {\nt.removeMember(user.$key);\nreturn t;\n@@ -96,6 +113,7 @@ export class TeamComponent {\nteam.name = teamName;\nteam.leader = user.$key;\nteam.addMember(user.$key);\n+ team.confirmMember(user.$key);\nreturn team;\n}),\nmergeMap(team => this.teamService.add(team)),\n", "new_path": "src/app/pages/team/team/team.component.ts", "old_path": "src/app/pages/team/team/team.component.ts" }, { "change_type": "MODIFY", "diff": "\"NOTIFICATIONS\": {\n\"Title\": \"Notifications\",\n\"List_progress\": \"{{author}} added {{amount}} {{itemName}} to list \\\"{{listName}}\\\"\",\n+ \"Team_invite\": \"{{invitedBy}} invited you to team {{teamName}}\",\n\"Mark_all_as_read\": \"Mark all as read\"\n}\n}\n", "new_path": "src/assets/i18n/en.json", "old_path": "src/assets/i18n/en.json" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: proper teams invite system with notifications on premium team list progress
1
chore
null
217,922
17.07.2018 19:15:09
-7,200
41e260d791b9ee7088ccee72de5795d4813281f3
chore: team member assignment system
[ { "change_type": "MODIFY", "diff": "@@ -48,6 +48,7 @@ import {ListProgressNotification} from '../model/notification/list-progress-noti\nimport {NotificationService} from './notification/notification.service';\nimport {TeamInviteNotification} from '../model/notification/team-invite-notification';\nimport {TeamExclusionNotification} from '../model/notification/team-exclusion-notification';\n+import {ItemAssignedNotification} from '../model/notification/item-assigned-notification';\nexport const DATA_EXTRACTORS: Provider[] = [\n@@ -74,6 +75,7 @@ export const DATA_EXTRACTORS: Provider[] = [\nLIST_PROGRESS: ListProgressNotification,\nTEAM_INVITE: TeamInviteNotification,\nTEAM_EXCLUSION: TeamExclusionNotification,\n+ ITEM_ASSIGNED: ItemAssignedNotification,\n}\n}\n]),\n", "new_path": "src/app/core/core.module.ts", "old_path": "src/app/core/core.module.ts" }, { "change_type": "MODIFY", "diff": "@@ -6,7 +6,7 @@ import {AngularFirestore} from 'angularfire2/firestore';\nimport {PendingChangesService} from './pending-changes/pending-changes.service';\nimport {UserService} from './user.service';\nimport {combineLatest, Observable} from 'rxjs/index';\n-import {map, mergeMap} from 'rxjs/operators';\n+import {map, mergeMap, shareReplay} from 'rxjs/operators';\n@Injectable({\nprovidedIn: 'root'\n@@ -40,7 +40,8 @@ export class TeamService extends FirestoreStorage<Team> {\ndelete data.$key;\nreturn (<Team>{$key: snap.payload.doc.id, ...data})\n})),\n- map(teams => this.serializer.deserialize<Team>(teams, [Team]))\n+ map(teams => this.serializer.deserialize<Team>(teams, [Team])),\n+ shareReplay(),\n);\n})\n);\n", "new_path": "src/app/core/database/team.service.ts", "old_path": "src/app/core/database/team.service.ts" }, { "change_type": "MODIFY", "diff": "export enum NotificationType {\nLIST_PROGRESS = 'LIST_PROGRESS',\nTEAM_INVITE = 'TEAM_INVITE',\n- TEAM_EXCLUSION = 'TEAM_EXCLUSION'\n+ TEAM_EXCLUSION = 'TEAM_EXCLUSION',\n+ ITEM_ASSIGNED = 'ITEM_ASSIGNED',\n}\n", "new_path": "src/app/core/notification/notification-type.ts", "old_path": "src/app/core/notification/notification-type.ts" }, { "change_type": "ADD", "diff": "+import {AbstractNotification} from '../../core/notification/abstract-notification';\n+import {TranslateService} from '@ngx-translate/core';\n+import {LocalizedDataService} from '../../core/data/localized-data.service';\n+import {I18nToolsService} from '../../core/tools/i18n-tools.service';\n+import {NotificationType} from '../../core/notification/notification-type';\n+\n+export class ItemAssignedNotification extends AbstractNotification {\n+\n+ constructor(private itemId: number, private listName: string, private listId: string) {\n+ super(NotificationType.ITEM_ASSIGNED);\n+ }\n+\n+ getContent(translate: TranslateService, l12n: LocalizedDataService, i18nTools: I18nToolsService): string {\n+ return translate.instant('NOTIFICATIONS.Item_assigned', {\n+ itemName: i18nTools.getName(l12n.getItem(this.itemId)),\n+ listName: this.listName\n+ });\n+ }\n+\n+ getIcon(): string {\n+ return 'assignment_ind';\n+ }\n+\n+ getTargetRoute(): string[] {\n+ return ['/list', this.listId];\n+ }\n+\n+}\n", "new_path": "src/app/model/notification/item-assigned-notification.ts", "old_path": null }, { "change_type": "MODIFY", "diff": "<mat-icon color=\"accent\">work</mat-icon>\n</button>\n</div>\n+ <div *ngIf=\"teamLeader$ | async as leader\">\n+ <div *ngIf=\"teamMembers$ | async as teamMembers\">\n+ <mat-menu #teamMembersMenu=\"matMenu\">\n+ <button mat-menu-item *ngFor=\"let member of teamMembers\" (click)=\"assign(member.user.$key)\">\n+ {{member.name}}\n+ </button>\n+ </mat-menu>\n+ <div *ngIf=\"!item.workingOnIt && !user?.anonymous\n+ && getAmount() > (item.done | ceil) && leader\">\n+ <button mat-icon-button matTooltip=\"{{'TEAMS.Assign_item' | translate}}\"\n+ matTooltipPosition=\"above\"\n+ [ngClass]=\"{'requirements-button':true, 'compact': settings.compactLists}\"\n+ [matMenuTriggerFor]=\"teamMembersMenu\">\n+ <mat-icon color=\"accent\">assignment_ind</mat-icon>\n+ </button>\n+ </div>\n+ </div>\n+ </div>\n</div>\n<div *ngIf=\"hasTimers\" class=\"timers-container\">\n", "new_path": "src/app/modules/item/item/item.component.html", "old_path": "src/app/modules/item/item/item.component.html" }, { "change_type": "MODIFY", "diff": "@@ -32,7 +32,7 @@ import {LocalizedDataService} from '../../../core/data/localized-data.service';\nimport {FishDetailsPopupComponent} from '../fish-details-popup/fish-details-popup.component';\nimport {TranslateService} from '@ngx-translate/core';\nimport {AlarmService} from '../../../core/time/alarm.service';\n-import {Observable} from 'rxjs';\n+import {combineLatest, Observable} from 'rxjs';\nimport {Timer} from '../../../core/time/timer';\nimport {SettingsService} from '../../../pages/settings/settings.service';\nimport {AppUser} from '../../../model/list/app-user';\n@@ -50,6 +50,9 @@ import {Permissions} from '../../../core/database/permissions/permissions';\nimport {CraftingRotationService} from '../../../core/database/crafting-rotation.service';\nimport {CraftingRotation} from '../../../model/other/crafting-rotation';\nimport {first, map, mergeMap, publishReplay, refCount, tap} from 'rxjs/operators';\n+import {TeamService} from '../../../core/database/team.service';\n+import {NotificationService} from '../../../core/notification/notification.service';\n+import {ItemAssignedNotification} from '../../../model/notification/item-assigned-notification';\n@Component({\nselector: 'app-item',\n@@ -290,6 +293,10 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\nhasAlarm: { [index: number]: boolean } = {};\n+ public teamMembers$: Observable<any[]>;\n+\n+ public teamLeader$: Observable<boolean>;\n+\nconstructor(private i18n: I18nToolsService,\nprivate dialog: MatDialog,\nprivate media: ObservableMedia,\n@@ -304,7 +311,9 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\nprivate userService: UserService,\nprivate platformService: PlatformService,\npublic cd: ChangeDetectorRef,\n- private rotationsService: CraftingRotationService) {\n+ private rotationsService: CraftingRotationService,\n+ private notificationService: NotificationService,\n+ private teamService: TeamService) {\nsuper();\nthis.rotations$ = this.userService.getUserData().pipe(\nmergeMap(user => {\n@@ -373,6 +382,21 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\nthis.updateTimers();\nthis.updateHasBook();\nthis.updateRequiredForEndCraft();\n+ if (this.list !== undefined && this.list.teamId !== undefined\n+ && this.teamMembers$ === undefined && this.teamLeader$ === undefined) {\n+ this.teamMembers$ = this.teamService.get(this.list.teamId)\n+ .pipe(\n+ mergeMap(team => {\n+ return combineLatest(Object.keys(team.members)\n+ .map(memberId => this.userService.getCharacter(memberId))\n+ );\n+ })\n+ );\n+ this.teamLeader$ = this.teamService.get(this.list.teamId)\n+ .pipe(\n+ map(team => team.leader === this.user.$key)\n+ );\n+ }\nif (this.item.workingOnIt !== undefined && (this.worksOnIt === undefined || this.worksOnIt.id !== this.item.workingOnIt)) {\nthis.userService.get(this.item.workingOnIt)\n.pipe(\n@@ -395,6 +419,21 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\n});\n}\n+ public assign(userId: string): void {\n+ this.item.workingOnIt = userId;\n+ this.update.emit();\n+ const notification = new ItemAssignedNotification(this.item.id, this.list.name, this.list.$key);\n+ this.notificationService.add(this.notificationService.prepareNotification(userId, notification)).subscribe();\n+ this.userService.get(this.item.workingOnIt)\n+ .pipe(\n+ mergeMap(user => this.dataService.getCharacter(user.lodestoneId)),\n+ first()\n+ ).subscribe(char => {\n+ this.worksOnIt = char;\n+ this.cd.detectChanges();\n+ });\n+ }\n+\npublic removeWorkingOnIt(): void {\ndelete this.item.workingOnIt;\nthis.update.emit();\n", "new_path": "src/app/modules/item/item/item.component.ts", "old_path": "src/app/modules/item/item/item.component.ts" }, { "change_type": "MODIFY", "diff": "\"Title\": \"Notifications\",\n\"List_progress\": \"{{author}} added {{amount}} {{itemName}} to list \\\"{{listName}}\\\"\",\n\"Team_invite\": \"{{invitedBy}} invited you to team {{teamName}}\",\n+ \"Item_assigned\": \"{{itemName}} has been assigned to you on list \\\"{{listName}}\\\"\",\n\"Mark_all_as_read\": \"Mark all as read\"\n}\n}\n", "new_path": "src/assets/i18n/en.json", "old_path": "src/assets/i18n/en.json" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: team member assignment system
1
chore
null
217,922
17.07.2018 20:05:54
-7,200
a53ee690965043eeda7c051459b51da12f55377d
chore: added possibility to mute notifications
[ { "change_type": "MODIFY", "diff": "@@ -12,6 +12,7 @@ import {map, mergeMap, shareReplay} from 'rxjs/operators';\nimport {I18nToolsService} from '../tools/i18n-tools.service';\nimport {combineLatest, Observable} from 'rxjs';\nimport {AbstractNotification} from './abstract-notification';\n+import {SettingsService} from '../../pages/settings/settings.service';\n@Injectable({\nprovidedIn: 'root'\n@@ -23,7 +24,7 @@ export class NotificationService extends RelationshipService<NotificationRelatio\nconstructor(protected firestore: AngularFirestore, protected serializer: NgSerializerService, protected zone: NgZone,\nprotected pendingChangesService: PendingChangesService, private userService: UserService, private ipc: IpcService,\nprivate translateService: TranslateService, private localizedDataService: LocalizedDataService,\n- private i18nTools: I18nToolsService) {\n+ private i18nTools: I18nToolsService, private settings: SettingsService) {\nsuper(firestore, serializer, zone, pendingChangesService);\nthis.notifications$ = this.userService.getUserData()\n.pipe(\n@@ -44,6 +45,7 @@ export class NotificationService extends RelationshipService<NotificationRelatio\nhandleNotifications(relationships: NotificationRelationship[]): void {\nconst toAlert = relationships.filter(r => !r.to.alerted);\n+ if (!this.settings.notificationsMuted) {\n// If there's only one, handle it alone.\nif (toAlert.length === 1) {\nthis.ipc.send('notification:user', {\n@@ -56,6 +58,7 @@ export class NotificationService extends RelationshipService<NotificationRelatio\ncontent: this.translateService.instant('NOTIFICATIONS.You_have_x_notifications', {amount: toAlert.length})\n});\n}\n+ }\n// Save notifications changes.\ncombineLatest(\n...toAlert.map(relationship => {\n", "new_path": "src/app/core/notification/notification.service.ts", "old_path": "src/app/core/notification/notification.service.ts" }, { "change_type": "MODIFY", "diff": "@@ -5,7 +5,9 @@ import {RouterModule, Routes} from '@angular/router';\nimport {MaintenanceGuard} from '../maintenance/maintenance.guard';\nimport {TranslateModule} from '@ngx-translate/core';\nimport {CoreModule} from '../../core/core.module';\n-import {MatButtonModule, MatIconModule, MatListModule, MatProgressSpinnerModule} from '@angular/material';\n+import {MatButtonModule, MatIconModule, MatListModule, MatProgressSpinnerModule, MatSlideToggleModule} from '@angular/material';\n+import {SettingsModule} from '../settings/settings.module';\n+import {FormsModule} from '@angular/forms';\nconst routes: Routes = [{\npath: '',\n@@ -17,6 +19,7 @@ const routes: Routes = [{\n@NgModule({\nimports: [\nCommonModule,\n+ FormsModule,\nTranslateModule,\nCoreModule,\n@@ -27,6 +30,9 @@ const routes: Routes = [{\nMatListModule,\nMatIconModule,\nMatButtonModule,\n+ MatSlideToggleModule,\n+\n+ SettingsModule,\n],\ndeclarations: [NotificationsComponent]\n})\n", "new_path": "src/app/pages/notifications/notifications.module.ts", "old_path": "src/app/pages/notifications/notifications.module.ts" }, { "change_type": "MODIFY", "diff": "<mat-icon>done_all</mat-icon>\n{{'NOTIFICATIONS.Mark_all_as_read' | translate}}\n</button>\n+ <div class=\"spacer\"></div>\n+ <mat-slide-toggle [(ngModel)]=\"settings.notificationsMuted\">\n+ <mat-icon>\n+ notifications_off\n+ </mat-icon>\n+ </mat-slide-toggle>\n</div>\n<mat-list>\n<mat-list-item *ngFor=\"let notification of notifications; trackBy: trackByNotificationFn\"\n", "new_path": "src/app/pages/notifications/notifications/notifications.component.html", "old_path": "src/app/pages/notifications/notifications/notifications.component.html" }, { "change_type": "MODIFY", "diff": ".date {\nopacity: .7;\n}\n+\n+.toolbar {\n+ display: flex;\n+ width: 100%;\n+}\n", "new_path": "src/app/pages/notifications/notifications/notifications.component.scss", "old_path": "src/app/pages/notifications/notifications/notifications.component.scss" }, { "change_type": "MODIFY", "diff": "@@ -7,6 +7,7 @@ import {I18nToolsService} from '../../../core/tools/i18n-tools.service';\nimport {TranslateService} from '@ngx-translate/core';\nimport {TeamService} from '../../../core/database/team.service';\nimport {TeamInviteNotification} from '../../../model/notification/team-invite-notification';\n+import {SettingsService} from '../../settings/settings.service';\n@Component({\nselector: 'app-notifications',\n@@ -20,7 +21,8 @@ export class NotificationsComponent {\nconstructor(private notificationService: NotificationService,\npublic l12n: LocalizedDataService, public i18nTools: I18nToolsService,\n- public translate: TranslateService, private teamService: TeamService) {\n+ public translate: TranslateService, private teamService: TeamService,\n+ public settings: SettingsService) {\nthis.notifications$ = this.notificationService.notifications$;\n}\n", "new_path": "src/app/pages/notifications/notifications/notifications.component.ts", "old_path": "src/app/pages/notifications/notifications/notifications.component.ts" }, { "change_type": "MODIFY", "diff": "@@ -60,6 +60,14 @@ export class SettingsService {\nthis.setSetting('compact-alarms', compact.toString());\n}\n+ public get notificationsMuted(): boolean {\n+ return this.getSetting('notifications-muted', 'false') === 'true';\n+ }\n+\n+ public set notificationsMuted(compact: boolean) {\n+ this.setSetting('notifications-muted', compact.toString());\n+ }\n+\npublic get theme(): string {\nreturn this.getSetting('theme', 'dark-orange');\n}\n", "new_path": "src/app/pages/settings/settings.service.ts", "old_path": "src/app/pages/settings/settings.service.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: added possibility to mute notifications
1
chore
null
217,927
17.07.2018 21:45:26
0
5bd7958c7cfa5842d8f90d758be2f9726f96c639
feat: show levels for retainer ventures Adds significantly more details to the venture details popup, including required level, venture name, and amount of items yielded. Introduces new JobCategory and Venture interfaces for the Garland Tools data, as well as functions for retrieving this information from the GT service. Resolves
[ { "change_type": "MODIFY", "diff": "import {Injectable} from '@angular/core';\nimport {GarlandToolsData} from '../../model/list/garland-tools-data';\nimport {Item} from '../../model/garland-tools/item';\n+import {JobCategory} from '../../model/garland-tools/job-category';\n+import {Venture} from '../../model/garland-tools/venture';\nimport {NgSerializerService} from '@kaiu/ng-serializer';\nimport {HttpClient} from '@angular/common/http';\n@@ -64,6 +66,15 @@ export class GarlandToolsService {\nreturn this.gt.bell.nodes.find(node => node.id === id);\n}\n+ /**\n+ * Gets details for a given job category in garlandtools data.\n+ * @param {number} id\n+ * @returns {JobCategory}\n+ */\n+ getJobCategory(id: number): JobCategory {\n+ return this.gt.jobCategories[id];\n+ }\n+\n/**\n* Gets a list of category ids for a given job, useful for search filters.\n* @param {number[]} jobs\n@@ -83,4 +94,26 @@ export class GarlandToolsService {\n// Then we convert the string array to a number array\n.map(key => +key);\n}\n+\n+ /**\n+ * Gets a list of ventures based on their ids in garlandtools data.\n+ * @param {number[]} ids\n+ * @returns {Venture[]}\n+ */\n+ getVentures(ids: number[]): Venture[] {\n+ return ids.map(id => {\n+ const venture = this.gt.ventureIndex[id];\n+ const category = this.getJobCategory(venture.jobs);\n+\n+ // Convert the jobCategory (jobs) to a job id\n+ if (category.jobs.length > 1) {\n+ // Custom id to represent the DoW/M \"hybrid\" job\n+ venture.job = 100;\n+ } else {\n+ venture.job = category.jobs[0];\n+ }\n+\n+ return venture;\n+ });\n+ }\n}\n", "new_path": "src/app/core/api/garland-tools.service.ts", "old_path": "src/app/core/api/garland-tools.service.ts" }, { "change_type": "ADD", "diff": "+export interface JobCategory {\n+ id: number;\n+ name: string;\n+ jobs: number[];\n+}\n", "new_path": "src/app/model/garland-tools/job-category.ts", "old_path": null }, { "change_type": "ADD", "diff": "+export interface Venture {\n+ id: number;\n+ job: number;\n+ jobs: number;\n+ lvl: number;\n+ cost: number;\n+ minutes: number;\n+ gathering?: number[];\n+ ilvl?: number[];\n+ amounts: number[];\n+ name?: string;\n+}\n", "new_path": "src/app/model/garland-tools/venture.ts", "old_path": null }, { "change_type": "MODIFY", "diff": "+import {JobCategory} from '../garland-tools/job-category';\n+import {Venture} from '../garland-tools/venture';\n+\nexport interface GarlandToolsData {\npatch: any;\nxp: number[];\n@@ -19,7 +22,8 @@ export interface GarlandToolsData {\ningredients: any[]\n};\ninstanceTypes: string[];\n- jobCategories: any;\n+ jobCategories: JobCategory[];\n+ ventureIndex: Venture[];\nbell: {\nnodes: any[]\n};\n", "new_path": "src/app/model/list/garland-tools-data.ts", "old_path": "src/app/model/list/garland-tools-data.ts" }, { "change_type": "MODIFY", "diff": "@@ -622,7 +622,7 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\npublic openVentureDetails(item: ListRow): void {\nthis.dialog.open(VentureDetailsPopupComponent, {\n- data: item\n+ data: item.ventures\n});\n}\n", "new_path": "src/app/modules/item/item/item.component.ts", "old_path": "src/app/modules/item/item/item.component.ts" }, { "change_type": "MODIFY", "diff": "-<h2 mat-dialog-title>{{data.id | itemName | i18n}}</h2>\n-<div mat-dialog-content>\n+<div mat-dialog-content class=\"content\">\n<mat-list>\n- <mat-list-item *ngFor=\"let venture of data.ventures\">\n- <mat-icon mat-list-icon>location_on</mat-icon>\n- <b mat-line>{{venture | ventureName | i18n}}</b>\n+ <mat-list-item *ngFor=\"let venture of ventures\" class=\"venture\">\n+ <h3 mat-line class=\"title\">\n+ Lv. {{venture.lvl}}\n+ {{venture.name ? (venture.id | ventureName | i18n) : (venture.job | jobAbbr:DOWM | i18n)}}\n+ </h3>\n+ <div mat-line *ngFor=\"let amount of ventureAmounts(venture)\" class=\"amount\">\n+ <div>{{amount.name | translate}} {{amount.stat}}:</div>\n+ <div>x{{amount.quantity}}</div>\n+ </div>\n</mat-list-item>\n</mat-list>\n</div>\n", "new_path": "src/app/modules/item/venture-details-popup/venture-details-popup.component.html", "old_path": "src/app/modules/item/venture-details-popup/venture-details-popup.component.html" }, { "change_type": "MODIFY", "diff": "+.content {\n+ margin-top: -16px;\n+ margin-bottom: -16px;\n+ min-width: 250px;\n+}\n+\n+.mat-line.title {\n+ font-weight: bold;\n+ margin-bottom: 10px;\n+}\n+\n+.mat-line.amount {\n+ display: flex;\n+ div {\n+ flex: 1;\n+ &:nth-child(2) {\n+ text-align: right;\n+ }\n+ }\n+}\n", "new_path": "src/app/modules/item/venture-details-popup/venture-details-popup.component.scss", "old_path": "src/app/modules/item/venture-details-popup/venture-details-popup.component.scss" }, { "change_type": "MODIFY", "diff": "@@ -7,8 +7,9 @@ import {I18nName} from '../model/list/i18n-name';\n})\nexport class JobAbbrIconPipe implements PipeTransform {\n+\ntransform(id: number, fallback?: string): I18nName {\n- return jobAbbrs[id];\n+ return jobAbbrs[id] || fallback;\n}\n}\n", "new_path": "src/app/pipes/job-abbr.pipe.ts", "old_path": "src/app/pipes/job-abbr.pipe.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
feat: show levels for retainer ventures Adds significantly more details to the venture details popup, including required level, venture name, and amount of items yielded. Introduces new JobCategory and Venture interfaces for the Garland Tools data, as well as functions for retrieving this information from the GT service. Resolves #315
1
feat
null
791,676
18.07.2018 00:03:59
-7,200
fd6de769371f293f5f054a129e21644a3e814943
misc: convert strings to NetworkRequest.TYPES
[ { "change_type": "MODIFY", "diff": "const Audit = require('./audit');\nconst Util = require('../report/html/renderer/util');\n+const NetworkRequest = require('../lib/network-request');\nconst {taskGroups} = require('../lib/task-groups');\nclass BootupTime extends Audit {\n@@ -46,7 +47,7 @@ class BootupTime extends Audit {\n/** @type {Set<string>} */\nconst urls = new Set();\nfor (const record of records) {\n- if (record.resourceType && record.resourceType === 'Script') {\n+ if (record.resourceType === NetworkRequest.TYPES.Script) {\nurls.add(record.url);\n}\n}\n", "new_path": "lighthouse-core/audits/bootup-time.js", "old_path": "lighthouse-core/audits/bootup-time.js" }, { "change_type": "MODIFY", "diff": "@@ -86,8 +86,7 @@ class OptimizedImages extends Gatherer {\n}\nseenUrls.add(record.url);\n- const isOptimizableImage = record.resourceType &&\n- record.resourceType === 'Image' &&\n+ const isOptimizableImage = record.resourceType === NetworkRequest.TYPES.Image &&\n/image\\/(png|bmp|jpeg)/.test(record.mimeType);\nconst isSameOrigin = URL.originsMatch(pageUrl, record.url);\nconst isBase64DataUri = /^data:.{2,40}base64\\s*,/.test(record.url);\n", "new_path": "lighthouse-core/gather/gatherers/dobetterweb/optimized-images.js", "old_path": "lighthouse-core/gather/gatherers/dobetterweb/optimized-images.js" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
misc: convert strings to NetworkRequest.TYPES (#5674)
1
misc
null
791,676
18.07.2018 01:29:32
-7,200
e94be2cb498ff4b368a8862730e306e08f2651e1
misc(sentry): lower "could not load stylesheet" sampling to 0.01
[ { "change_type": "MODIFY", "diff": "@@ -26,7 +26,7 @@ const SAMPLED_ERRORS = [\n{pattern: /(IDLE_PERIOD|FMP_TOO_LATE)/, rate: 0.1},\n{pattern: /^NO_.*/, rate: 0.1},\n// Message based sampling\n- {pattern: /Could not load stylesheet/, rate: 0.1},\n+ {pattern: /Could not load stylesheet/, rate: 0.01},\n{pattern: /Failed to decode/, rate: 0.1},\n{pattern: /All image optimizations failed/, rate: 0.1},\n{pattern: /No.*resource with given/, rate: 0.01},\n", "new_path": "lighthouse-core/lib/sentry.js", "old_path": "lighthouse-core/lib/sentry.js" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
misc(sentry): lower "could not load stylesheet" sampling to 0.01 (#5677)
1
misc
sentry
217,927
18.07.2018 02:52:11
0
e4fafe532a147938b2b5af22d856a83756568b7e
fix: list recipe simulator links Adds missing recipeId parameter to simulator links for list items, ensuring that the recipe with the proper job is loaded. This bug was an extension of that applied to the simulator links on the final products.
[ { "change_type": "MODIFY", "diff": "<div class=\"classes\">\n<div *ngIf=\"recipe\">\n<mat-menu #simulatorMenu=\"matMenu\">\n- <button mat-menu-item routerLink=\"/simulator/{{item.id}}\">{{'SIMULATOR.New_rotation' | translate}}\n+ <button mat-menu-item routerLink=\"/simulator/{{item.id}}/{{item.recipeId}}\">{{'SIMULATOR.New_rotation' | translate}}\n</button>\n<button mat-menu-item\n*ngFor=\"let rotation of rotations$ | async\"\n- routerLink=\"/simulator/{{item.id}}/{{rotation.$key}}\">{{rotation.getName()}}\n+ routerLink=\"/simulator/{{item.id}}/{{item.recipeId}}/{{rotation.$key}}\">{{rotation.getName()}}\n</button>\n<mat-divider></mat-divider>\n<a *ngIf=\"getCraft(item.recipeId) as craft\"\n", "new_path": "src/app/modules/item/item/item.component.html", "old_path": "src/app/modules/item/item/item.component.html" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix: list recipe simulator links Adds missing recipeId parameter to simulator links for list items, ensuring that the recipe with the proper job is loaded. This bug was an extension of #401 that applied to the simulator links on the final products.
1
fix
null
815,745
18.07.2018 10:33:49
-10,800
6c676c8ab837636bfcfaf92f748410624b259b17
fix: don't fail while resolving selected item using ng-option
[ { "change_type": "MODIFY", "diff": "@@ -51,24 +51,23 @@ describe('NgSelectComponent', function () {\n}));\n}));\n- it('should set ng-option dom elements', fakeAsync(() => {\n+ it('should create items from ng-option', fakeAsync(() => {\nconst fixture = createTestingModule(\nNgSelectTestCmp,\n- `<ng-select [(ngModel)]=\"selectedCityId\">\n- <ng-option [value]=\"'a'\">A</ng-option>\n- <ng-option [value]=\"'b'\">B</ng-option>\n+ `<ng-select [(ngModel)]=\"selectedCity\">\n+ <ng-option [value]=\"true\">Yes</ng-option>\n+ <ng-option [value]=\"false\">No</ng-option>\n</ng-select>`);\ntickAndDetectChanges(fixture);\n- const itemsList = fixture.componentInstance.select.itemsList;\n- expect(itemsList.items.length).toBe(2);\n- expect(itemsList.items[0]).toEqual(jasmine.objectContaining({\n- label: 'A',\n- value: 'a'\n+\n+ const items = fixture.componentInstance.select.itemsList.items;\n+ expect(items.length).toBe(2);\n+ expect(items[0]).toEqual(jasmine.objectContaining({\n+ label: 'Yes', value: true, disabled: false\n}));\n- expect(itemsList.items[1]).toEqual(jasmine.objectContaining({\n- label: 'B',\n- value: 'b'\n+ expect(items[1]).toEqual(jasmine.objectContaining({\n+ label: 'No', value: false, disabled: false\n}));\n}));\n});\n@@ -554,7 +553,8 @@ describe('NgSelectComponent', function () {\ndiscardPeriodicTasks();\n}));\n- it('bind to dom ng-option value object', fakeAsync(() => {\n+ describe('ng-option', () => {\n+ it('should bind value', fakeAsync(() => {\nconst fixture = createTestingModule(\nNgSelectTestCmp,\n`<ng-select [(ngModel)]=\"selectedCityId\">\n@@ -578,6 +578,26 @@ describe('NgSelectComponent', function () {\ndiscardPeriodicTasks();\n}));\n+ it('should not fail while resolving selected item from object', fakeAsync(() => {\n+ const fixture = createTestingModule(\n+ NgSelectTestCmp,\n+ `<ng-select [(ngModel)]=\"selectedCity\">\n+ <ng-option [value]=\"cities[0]\">Vilnius</ng-option>\n+ <ng-option [value]=\"cities[1]\">Kaunas</ng-option>\n+ </ng-select>`);\n+\n+ const selected = { name: 'Vilnius', id: 1 };\n+ fixture.componentInstance.selectedCity = selected;\n+ tickAndDetectChanges(fixture);\n+\n+ expect(fixture.componentInstance.select.selectedItems).toEqual([jasmine.objectContaining({\n+ value: selected,\n+ label: ''\n+ })]);\n+ }));\n+ });\n+\n+\nit('should not set internal model when single select ngModel is not valid', fakeAsync(() => {\nconst fixture = createTestingModule(\nNgSelectTestCmp,\n@@ -1532,26 +1552,6 @@ describe('NgSelectComponent', function () {\n});\n}));\n- it('should create items from ng-option', fakeAsync(() => {\n- const fixture = createTestingModule(\n- NgSelectTestCmp,\n- `<ng-select [(ngModel)]=\"selectedCity\">\n- <ng-option [value]=\"true\">Yes</ng-option>\n- <ng-option [value]=\"false\">No</ng-option>\n- </ng-select>`);\n-\n- tickAndDetectChanges(fixture);\n-\n- const items = fixture.componentInstance.select.itemsList.items;\n- expect(items.length).toBe(2);\n- expect(items[0]).toEqual(jasmine.objectContaining({\n- label: 'Yes', value: true, disabled: false\n- }));\n- expect(items[1]).toEqual(jasmine.objectContaining({\n- label: 'No', value: false, disabled: false\n- }));\n- }));\n-\nit('should update ng-option state', fakeAsync(() => {\nconst fixture = createTestingModule(\nNgSelectTestCmp,\n", "new_path": "src/ng-select/ng-select.component.spec.ts", "old_path": "src/ng-select/ng-select.component.spec.ts" }, { "change_type": "MODIFY", "diff": "@@ -528,8 +528,9 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n};\nthis.ngOptions.changes\n- .pipe(startWith(this.ngOptions), takeUntil(this._destroy$))\n+ .pipe(startWith(this.ngOptions), takeUntil(this._destroy$), filter((items: QueryList<any>) => !!items.length))\n.subscribe(options => {\n+ this.bindLabel = this._defaultLabel;\nhandleNgOptions(options);\nhandleOptionChange();\n});\n", "new_path": "src/ng-select/ng-select.component.ts", "old_path": "src/ng-select/ng-select.component.ts" } ]
TypeScript
MIT License
ng-select/ng-select
fix: don't fail while resolving selected item using ng-option #677
1
fix
null
815,745
18.07.2018 11:08:48
-10,800
3edb0df505f8f94faf42a03156a86a8f3cbe1679
fix: emit focus and blur events closes
[ { "change_type": "MODIFY", "diff": "[disabled]=\"disabled\"\n[value]=\"filterValue\"\n(input)=\"filter(filterInput.value)\"\n- (focus)=\"onInputFocus()\"\n- (blur)=\"onInputBlur()\"\n+ (focus)=\"onInputFocus($event)\"\n+ (blur)=\"onInputBlur($event)\"\n(change)=\"$event.stopPropagation()\"\nrole=\"combobox\"\n[attr.aria-expanded]=\"isOpen\"\n", "new_path": "src/ng-select/ng-select.component.html", "old_path": "src/ng-select/ng-select.component.html" }, { "change_type": "MODIFY", "diff": "@@ -452,15 +452,15 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\n}\n- onInputFocus() {\n+ onInputFocus($event) {\n(<HTMLElement>this.elementRef.nativeElement).classList.add('ng-select-focused');\n- this.focusEvent.emit(null);\n+ this.focusEvent.emit($event);\nthis._focused = true;\n}\n- onInputBlur() {\n+ onInputBlur($event) {\n(<HTMLElement>this.elementRef.nativeElement).classList.remove('ng-select-focused');\n- this.blurEvent.emit(null);\n+ this.blurEvent.emit($event);\nif (!this.isOpen && !this.disabled) {\nthis._onTouched();\n}\n", "new_path": "src/ng-select/ng-select.component.ts", "old_path": "src/ng-select/ng-select.component.ts" } ]
TypeScript
MIT License
ng-select/ng-select
fix: emit focus and blur events closes #690
1
fix
null
815,745
18.07.2018 12:26:55
-10,800
e1ab5aece5911e206241117a49bfebb2dbac4f29
chore(release): 2.3.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=\"2.3.4\"></a>\n+## [2.3.4](https://github.com/ng-select/ng-select/compare/v2.3.3...v2.3.4) (2018-07-18)\n+\n+\n+### Bug Fixes\n+\n+* don't fail while resolving selected item using ng-option ([6c676c8](https://github.com/ng-select/ng-select/commit/6c676c8)), closes [#677](https://github.com/ng-select/ng-select/issues/677)\n+* emit focus and blur events ([3edb0df](https://github.com/ng-select/ng-select/commit/3edb0df)), closes [#690](https://github.com/ng-select/ng-select/issues/690)\n+\n+\n+\n<a name=\"2.3.3\"></a>\n## [2.3.3](https://github.com/ng-select/ng-select/compare/v2.3.2...v2.3.3) (2018-07-10)\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\": \"2.3.3\",\n+ \"version\": \"2.3.4\",\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): 2.3.4
1
chore
release
679,913
18.07.2018 13:25:11
-3,600
9b07d12a45e512e73139f8f17d846cd6d9549b00
feat(transducers): add juxtR() for multiplexed reductions from same src add tests & docs
[ { "change_type": "ADD", "diff": "+import { Reducer } from \"../api\";\n+import { isReduced, unreduced, reduced } from \"../reduced\";\n+\n+/**\n+ * Composes a new reducer from the ones given, in order to produce\n+ * multiple reductions in parallel from the same input. The returned\n+ * reducer produces a result tuple of reduction results, one per\n+ * reducer. If any of the reducers returns a `reduced()` result, the\n+ * reduction process stops for all others too. `juxtR` produces\n+ * optimized versions for up to 3 reducer args, but can support any\n+ * number of reducers.\n+ *\n+ * ```\n+ * reduce(juxtR(add(), reductions(add()), str(\"-\")), [1, 2, 3, 4]);\n+ * // [ 10, [ 0, 1, 3, 6, 10 ], [ 1, 2, 3, 4 ] ]\n+ * ```\n+ */\n+export function juxtR<A1, B>(r1: Reducer<A1, B>): Reducer<[A1], B>;\n+export function juxtR<A1, A2, B>(r1: Reducer<A1, B>, r2: Reducer<A2, B>): Reducer<[A1, A2], B>;\n+export function juxtR<A1, A2, A3, B>(r1: Reducer<A1, B>, r2: Reducer<A2, B>, r3: Reducer<A3, B>): Reducer<[A1, A2, A3], B>;\n+export function juxtR<A1, A2, A3, B>(r1: Reducer<A1, B>, r2: Reducer<A2, B>, r3: Reducer<A3, B>, ...rs: Reducer<any, B>[]): Reducer<any[], B>;\n+export function juxtR<B>(...rs: Reducer<any, B>[]) {\n+ let [a, b, c] = rs;\n+ const n = rs.length;\n+ switch (n) {\n+ case 1: {\n+ const r = a[2];\n+ return [\n+ () => [a[0]()],\n+ (acc) => [a[1](acc[0])],\n+ (acc, x) => {\n+ const aa1 = r(acc[0], x);\n+ if (isReduced(aa1)) {\n+ return reduced([unreduced(aa1)]);\n+ }\n+ return [aa1];\n+ }\n+ ];\n+ }\n+ case 2: {\n+ const ra = a[2];\n+ const rb = b[2];\n+ return [\n+ () => [a[0](), b[0]()],\n+ (acc) => [a[1](acc[0]), b[1](acc[1])],\n+ (acc, x) => {\n+ const aa1 = ra(acc[0], x);\n+ const aa2 = rb(acc[1], x);\n+ if (isReduced(aa1) || isReduced(aa2)) {\n+ return reduced([unreduced(aa1), unreduced(aa2)]);\n+ }\n+ return [aa1, aa2];\n+ }\n+ ];\n+ }\n+ case 3: {\n+ const ra = a[2];\n+ const rb = b[2];\n+ const rc = c[2];\n+ return [\n+ () => [a[0](), b[0](), c[0]()],\n+ (acc) => [a[1](acc[0]), b[1](acc[1]), c[1](acc[2])],\n+ (acc, x) => {\n+ const aa1 = ra(acc[0], x);\n+ const aa2 = rb(acc[1], x);\n+ const aa3 = rc(acc[2], x);\n+ if (isReduced(aa1) || isReduced(aa2) || isReduced(aa3)) {\n+ return reduced([unreduced(aa1), unreduced(aa2), unreduced(aa3)]);\n+ }\n+ return [aa1, aa2, aa3];\n+ }\n+ ];\n+ }\n+ default:\n+ return [\n+ () => rs.map((r) => r[0]()),\n+ (acc) => rs.map((r, i) => r[1](acc[i])),\n+ (acc, x) => {\n+ let done = false;\n+ const res = [];\n+ for (let i = 0; i < n; i++) {\n+ let a = rs[i][2](acc[i], x);\n+ if (isReduced(a)) {\n+ done = true;\n+ a = unreduced(a);\n+ }\n+ res[i] = a;\n+ }\n+ return done ? reduced(res) : res;\n+ }\n+ ];\n+ }\n+}\n\\ No newline at end of file\n", "new_path": "packages/transducers/src/func/juxtr.ts", "old_path": null }, { "change_type": "MODIFY", "diff": "@@ -105,6 +105,7 @@ export * from \"./func/fuzzy-match\";\nexport * from \"./func/hex\";\nexport * from \"./func/identity\";\nexport * from \"./func/juxt\";\n+export * from \"./func/juxtr\";\nexport * from \"./func/key-selector\";\nexport * from \"./func/lookup\";\nexport * from \"./func/odd\";\n", "new_path": "packages/transducers/src/index.ts", "old_path": "packages/transducers/src/index.ts" }, { "change_type": "ADD", "diff": "+import * as tx from \"../src\";\n+\n+import * as assert from \"assert\";\n+\n+const src = [1, 2, 3, 4];\n+\n+const early = tx.reducer<number, number>(\n+ () => 0,\n+ (acc, x) => acc + x < 6 ? acc + x : tx.reduced(acc)\n+);\n+\n+describe(\"juxtR\", () => {\n+ it(\"arity-1\", () => {\n+ assert.deepEqual(\n+ tx.reduce(tx.juxtR(tx.str(\"-\")), src),\n+ [\"1-2-3-4\"]\n+ );\n+ assert.deepEqual(\n+ tx.reduce(tx.juxtR(early), src),\n+ [3]\n+ );\n+ assert.deepEqual(\n+ tx.transduce(tx.take(2), tx.juxtR(tx.str(\"-\")), src),\n+ [\"1-2\"]\n+ );\n+ });\n+ it(\"arity-2\", () => {\n+ assert.deepEqual(\n+ tx.reduce(tx.juxtR(tx.push(), tx.str(\"-\")), src),\n+ [[1, 2, 3, 4], \"1-2-3-4\"]\n+ );\n+ assert.deepEqual(\n+ tx.reduce(tx.juxtR(tx.push(), early), src),\n+ [[1, 2, 3], 3]\n+ );\n+ assert.deepEqual(\n+ tx.transduce(tx.take(2), tx.juxtR(early, tx.str(\"-\")), src),\n+ [3, \"1-2\"]\n+ );\n+ });\n+ it(\"arity-3\", () => {\n+ assert.deepEqual(\n+ tx.reduce(tx.juxtR(tx.add(), tx.reductions(tx.add()), tx.str(\"-\")), src),\n+ [10, [0, 1, 3, 6, 10], \"1-2-3-4\"]\n+ );\n+ assert.deepEqual(\n+ tx.reduce(tx.juxtR(tx.add(), tx.reductions(tx.add()), early), src),\n+ [6, [0, 1, 3, 6], 3]\n+ );\n+ assert.deepEqual(\n+ tx.transduce(tx.take(2), tx.juxtR(early, tx.push(), tx.str(\"-\")), src),\n+ [3, [1, 2], \"1-2\"]\n+ );\n+ });\n+ it(\"arity-4\", () => {\n+ assert.deepEqual(\n+ tx.reduce(tx.juxtR(tx.add(), tx.reductions(tx.add()), tx.push(), tx.str(\"-\")), src),\n+ [10, [0, 1, 3, 6, 10], [1, 2, 3, 4], \"1-2-3-4\"]\n+ );\n+ assert.deepEqual(\n+ tx.reduce(tx.juxtR(tx.add(), tx.reductions(tx.add()), tx.str(\"-\"), early), src),\n+ [6, [0, 1, 3, 6], \"1-2-3\", 3]\n+ );\n+ assert.deepEqual(\n+ tx.transduce(tx.take(2), tx.juxtR(early, tx.add(), tx.push(), tx.str(\"-\")), src),\n+ [3, 3, [1, 2], \"1-2\"]\n+ );\n+ });\n+});\n", "new_path": "packages/transducers/test/juxtr.ts", "old_path": null } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(transducers): add juxtR() for multiplexed reductions from same src - add tests & docs
1
feat
transducers
807,849
18.07.2018 13:27:07
25,200
88eb039439bccb328e434a6429da786f31bb5a24
refactor(project): Just sort, no fancy path sorting required
[ { "change_type": "MODIFY", "diff": "@@ -4,7 +4,6 @@ const globby = require(\"globby\");\nconst pMap = require(\"p-map\");\nconst path = require(\"path\");\nconst ValidationError = require(\"@lerna/validation-error\");\n-const pathSort = require(\"./path-sort\");\nmodule.exports = makeFileFinder;\n@@ -33,7 +32,7 @@ function makeFileFinder(rootPath, packageConfigs) {\nreturn (fileName, fileMapper, customGlobOpts) => {\nconst options = Object.assign({}, customGlobOpts, globOpts);\nconst promise = pMap(\n- pathSort(packageConfigs),\n+ packageConfigs.sort(),\nglobPath => {\nlet chain = globby(path.join(globPath, fileName), options);\n@@ -56,7 +55,7 @@ function makeFileFinder(rootPath, packageConfigs) {\n}\nfunction sortNormalized(results) {\n- return pathSort(results.map(fp => path.normalize(fp)));\n+ return results.sort().map(fp => path.normalize(fp));\n}\nfunction flattenResults(results) {\n", "new_path": "core/project/lib/make-file-finder.js", "old_path": "core/project/lib/make-file-finder.js" }, { "change_type": "DELETE", "diff": "-\"use strict\";\n-\n-const path = require(\"path\");\n-\n-function sorter(a, b) {\n- const l = Math.max(a.length, b.length);\n-\n- for (let i = 0; i < l; i += 1) {\n- if (!(i in a)) {\n- return -1;\n- }\n- if (!(i in b)) {\n- return +1;\n- }\n- if (a[i].toUpperCase() > b[i].toUpperCase()) {\n- return +1;\n- }\n- if (a[i].toUpperCase() < b[i].toUpperCase()) {\n- return -1;\n- }\n- }\n-\n- if (a.length < b.length) {\n- return -1;\n- }\n- if (a.length > b.length) {\n- return +1;\n- }\n-\n- return 0;\n-}\n-\n-function pathsort(paths, sep = path.sep) {\n- return paths\n- .map(el => el.split(sep))\n- .sort(sorter)\n- .map(el => el.join(sep));\n-}\n-\n-function standalone(sep = path.sep) {\n- return (a, b) => sorter(a.split(sep), b.split(sep));\n-}\n-\n-module.exports = pathsort;\n-module.exports.standalone = standalone;\n", "new_path": null, "old_path": "core/project/lib/path-sort.js" } ]
JavaScript
MIT License
lerna/lerna
refactor(project): Just sort, no fancy path sorting required
1
refactor
project
217,922
18.07.2018 13:53:59
-7,200
bb2b025a6a23d7ef02c88194b5e4f4154dd7112e
chore: added translation completion report file
[ { "change_type": "ADD", "diff": "+# Translation completion report\n+\n+**Global completion** : 78%\n+\n+de | es | fr | ja | pt |\n+ :---: | :---: | :---: | :---: | :---: |\n+93% | 98% | 99% | 28% | 70% |\n+\n+## Categories details :\n+\n+**Category** | de | es | fr | ja | pt\n+ :--- | :---: | :---: | :---: | :---: | :---:\n+ITEMS | 100% | 100% | 100% | 50% | 75% |\n+UNCATEGORIZED | 99% | 100% | 100% | 28% | 97% |\n+WORKSHOP | 100% | 100% | 100% | 0% | 100% |\n+ABOUT | 100% | 100% | 100% | 29% | 100% |\n+GIVEWAY | 100% | 100% | 100% | 0% | 100% |\n+COMMON | 67% | 100% | 100% | 50% | 67% |\n+ALARMS | 50% | 100% | 100% | 0% | 50% |\n+ALARM | 67% | 67% | 100% | 0% | 67% |\n+SETTINGS | 90% | 70% | 100% | 10% | 60% |\n+PROFILE | 95% | 95% | 100% | 0% | 75% |\n+LISTS | 93% | 100% | 100% | 13% | 93% |\n+LIST | 15% | 100% | 100% | 0% | 15% |\n+LIST_DETAILS | 100% | 100% | 100% | 0% | 98% |\n+LIST_TAGS | 100% | 100% | 100% | 100% | 100% |\n+RECIPES | 100% | 100% | 100% | 0% | 100% |\n+MACRO_TRANSLATION | 100% | 100% | 100% | 40% | 100% |\n+CUSTOM_LINKS | 100% | 100% | 100% | 0% | 100% |\n+NAVIGATION | 100% | 100% | 100% | 0% | 100% |\n+GATHERING_LOCATIONS | 100% | 100% | 100% | 33% | 100% |\n+ANNOUNCEMENT | 100% | 100% | 100% | 50% | 100% |\n+LIST_TEMPLATE | 100% | 100% | 100% | 0% | 100% |\n+PERMISSIONS | 100% | 100% | 100% | 0% | 100% |\n+WIKI | 100% | 100% | 100% | 33% | 100% |\n+SIMULATOR | 85% | 96% | 96% | 67% | 0% |\n+HOME_PAGE | 100% | 100% | 100% | 4% | 100% |\n+PRICING | 0% | 100% | 100% | 0% | 0% |\n+COMMISSION_BOARD | 98% | 94% | 98% | 0% | 0% |\n+\n", "new_path": "TRANSLATION_COMPLETION.md", "old_path": null } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: added translation completion report file
1
chore
null
807,849
18.07.2018 13:55:37
25,200
e42033fb7d60273b3f2008605841e254984cd7df
test(windows): join paths, not posix regex
[ { "change_type": "MODIFY", "diff": "@@ -341,12 +341,12 @@ describe(\"Project\", () => {\nconst licensePaths = await project.getPackageLicensePaths();\nexpect(licensePaths).toEqual([\n- expect.stringMatching(/packages\\/package-1\\/LICENSE$/),\n- expect.stringMatching(/packages\\/package-2\\/licence$/),\n- expect.stringMatching(/packages\\/package-3\\/LiCeNSe$/),\n- expect.stringMatching(/packages\\/package-5\\/LICENCE$/),\n- // Ultimately, we do not care about duplicates, as they are weeded out elsewhere\n- expect.stringMatching(/packages\\/package-5\\/license$/),\n+ path.join(cwd, \"packages\", \"package-1\", \"LICENSE\"),\n+ path.join(cwd, \"packages\", \"package-2\", \"licence\"),\n+ path.join(cwd, \"packages\", \"package-3\", \"LiCeNSe\"),\n+ path.join(cwd, \"packages\", \"package-5\", \"LICENCE\"),\n+ // We do not care about duplicates, they are weeded out elsewhere\n+ path.join(cwd, \"packages\", \"package-5\", \"license\"),\n]);\n});\n});\n", "new_path": "core/project/__tests__/project.test.js", "old_path": "core/project/__tests__/project.test.js" } ]
JavaScript
MIT License
lerna/lerna
test(windows): join paths, not posix regex
1
test
windows
807,849
18.07.2018 14:33:20
25,200
62843b04e3a5a03012ceabe465519b39a09fbcc1
refactor(project): always normalize globby results
[ { "change_type": "MODIFY", "diff": "@@ -135,6 +135,8 @@ class Project {\ncase: false,\n// Project license is always a sibling of the root manifest\ndeep: false,\n+ // POSIX results always need to be normalized\n+ transform: fp => path.normalize(fp),\n});\nlicensePath = search.shift();\n", "new_path": "core/project/index.js", "old_path": "core/project/index.js" }, { "change_type": "MODIFY", "diff": "@@ -12,6 +12,8 @@ function makeFileFinder(rootPath, packageConfigs) {\ncwd: rootPath,\nabsolute: true,\nfollowSymlinkedDirectories: false,\n+ // POSIX results always need to be normalized\n+ transform: fp => path.normalize(fp),\n};\nif (packageConfigs.some(cfg => cfg.indexOf(\"**\") > -1)) {\n@@ -36,9 +38,8 @@ function makeFileFinder(rootPath, packageConfigs) {\nglobPath => {\nlet chain = globby(path.join(globPath, fileName), options);\n- // fast-glob does not respect pattern order, so we re-sort by normalized absolute path\n- // (glob results are always returned with POSIX paths, even on Windows)\n- chain = chain.then(sortNormalized);\n+ // fast-glob does not respect pattern order, so we re-sort by absolute path\n+ chain = chain.then(results => results.sort());\nif (fileMapper) {\nchain = chain.then(fileMapper);\n@@ -54,10 +55,6 @@ function makeFileFinder(rootPath, packageConfigs) {\n};\n}\n-function sortNormalized(results) {\n- return results.sort().map(fp => path.normalize(fp));\n-}\n-\nfunction flattenResults(results) {\nreturn results.reduce((acc, result) => acc.concat(result), []);\n}\n", "new_path": "core/project/lib/make-file-finder.js", "old_path": "core/project/lib/make-file-finder.js" } ]
JavaScript
MIT License
lerna/lerna
refactor(project): always normalize globby results
1
refactor
project
807,849
18.07.2018 14:40:30
25,200
5f5e5853443be1e5d11e21bf58dc752b76a283a1
feat: Count packages affected in command summary logging
[ { "change_type": "MODIFY", "diff": "@@ -19,8 +19,9 @@ class ChangedCommand extends Command {\ninitialize() {\nthis.updates = collectUpdates(this);\n+ this.count = this.updates.length;\n- const proceedWithUpdates = this.updates.length > 0;\n+ const proceedWithUpdates = this.count > 0;\nif (!proceedWithUpdates) {\nthis.logger.info(\"No packages need updating\");\n@@ -45,6 +46,13 @@ class ChangedCommand extends Command {\n.join(\"\\n\");\noutput(formattedUpdates);\n+\n+ this.logger.success(\n+ \"found\",\n+ \"%d %s ready to publish\",\n+ this.count,\n+ this.count === 1 ? \"package\" : \"packages\"\n+ );\n}\n}\n", "new_path": "commands/changed/index.js", "old_path": "commands/changed/index.js" }, { "change_type": "MODIFY", "diff": "@@ -27,6 +27,8 @@ class ExecCommand extends Command {\nthrow new ValidationError(\"ENOCOMMAND\", \"A command to execute is required\");\n}\n+ this.count = this.filteredPackages.length;\n+\n// inverted boolean options\nthis.bail = this.options.bail !== false;\nthis.prefix = this.options.prefix !== false;\n@@ -49,7 +51,15 @@ class ExecCommand extends Command {\n? pkg => this.runCommandInPackageStreaming(pkg)\n: pkg => this.runCommandInPackageCapturing(pkg);\n- return runParallelBatches(this.batchedPackages, this.concurrency, runner);\n+ return runParallelBatches(this.batchedPackages, this.concurrency, runner).then(() => {\n+ this.logger.success(\n+ \"exec\",\n+ \"Executed command in %d %s: %j\",\n+ this.count,\n+ this.count === 1 ? \"package\" : \"packages\",\n+ [this.command].concat(this.args).join(\" \")\n+ );\n+ });\n}\ngetOpts(pkg) {\n@@ -69,8 +79,9 @@ class ExecCommand extends Command {\nrunCommandInPackagesParallel() {\nthis.logger.info(\n\"exec\",\n- \"in %d package(s): %s\",\n- this.filteredPackages.length,\n+ \"in %d %s: %j\",\n+ this.count,\n+ this.count === 1 ? \"package\" : \"packages\",\n[this.command].concat(this.args).join(\" \")\n);\n", "new_path": "commands/exec/index.js", "old_path": "commands/exec/index.js" }, { "change_type": "MODIFY", "diff": "@@ -25,7 +25,7 @@ class ListCommand extends Command {\n}));\n// logged after output\n- this.length = this.resultList.length;\n+ this.count = this.resultList.length;\n}\nexecute() {\n@@ -39,7 +39,7 @@ class ListCommand extends Command {\noutput(result);\n- this.logger.info(\"list\", `found ${this.length} package${this.length === 1 ? \"\" : \"s\"}`);\n+ this.logger.success(\"found\", \"%d %s\", this.count, this.count === 1 ? \"package\" : \"packages\");\n}\nformatJSON() {\n", "new_path": "commands/list/index.js", "old_path": "commands/list/index.js" }, { "change_type": "MODIFY", "diff": "@@ -293,10 +293,13 @@ class PublishCommand extends Command {\n}\nreturn chain.then(() => {\n+ const count = this.packagesToPublish.length;\nconst message = this.packagesToPublish.map(pkg => ` - ${pkg.name}@${pkg.version}`);\noutput(\"Successfully published:\");\noutput(message.join(os.EOL));\n+\n+ this.logger.success(\"published\", \"%d %s\", count, count === 1 ? \"package\" : \"packages\");\n});\n}\n", "new_path": "commands/publish/index.js", "old_path": "commands/publish/index.js" }, { "change_type": "MODIFY", "diff": "@@ -41,7 +41,9 @@ class RunCommand extends Command {\nthis.packagesWithScript = this.filteredPackages.filter(pkg => pkg.scripts && pkg.scripts[script]);\n}\n- if (!this.packagesWithScript.length) {\n+ this.count = this.packagesWithScript.length;\n+\n+ if (!this.count) {\nthis.logger.success(\"run\", `No packages found with the lifecycle script '${script}'`);\n// still exits zero, aka \"ok\"\n@@ -63,7 +65,13 @@ class RunCommand extends Command {\n}\nreturn chain.then(() => {\n- this.logger.success(\"run\", `Ran npm script '${this.script}' in packages:`);\n+ this.logger.success(\n+ \"run\",\n+ \"Ran npm script '%s' in %d %s:\",\n+ this.script,\n+ this.count,\n+ this.count === 1 ? \"package\" : \"packages\"\n+ );\nthis.logger.success(\"\", this.packagesWithScript.map(pkg => `- ${pkg.name}`).join(\"\\n\"));\n});\n}\n@@ -89,8 +97,10 @@ class RunCommand extends Command {\nrunScriptInPackagesParallel() {\nthis.logger.info(\n\"run\",\n- \"in %d package(s): npm run %s\",\n- this.packagesWithScript.length,\n+ \"in %d %s: %s run %s\",\n+ this.count,\n+ this.count === 1 ? \"package\" : \"packages\",\n+ this.npmClient,\n[this.script].concat(this.args).join(\" \")\n);\n", "new_path": "commands/run/index.js", "old_path": "commands/run/index.js" }, { "change_type": "MODIFY", "diff": "exports[`lerna run test --parallel: stderr 1`] = `\nlerna info version __TEST_VERSION__\n-lerna info run in 4 package(s): npm run test --silent\n-lerna success run Ran npm script 'test' in packages:\n+lerna info run in 4 packages: npm run test --silent\n+lerna success run Ran npm script 'test' in 4 packages:\nlerna success - package-1\nlerna success - package-2\nlerna success - package-3\n@@ -12,7 +12,7 @@ lerna success - package-4\nexports[`lerna run test --stream --no-prefix: stderr 1`] = `\nlerna info version __TEST_VERSION__\n-lerna success run Ran npm script 'test' in packages:\n+lerna success run Ran npm script 'test' in 4 packages:\nlerna success - package-1\nlerna success - package-2\nlerna success - package-3\n@@ -28,7 +28,7 @@ package-2\nexports[`lerna run test --stream: stderr 1`] = `\nlerna info version __TEST_VERSION__\n-lerna success run Ran npm script 'test' in packages:\n+lerna success run Ran npm script 'test' in 4 packages:\nlerna success - package-1\nlerna success - package-2\nlerna success - package-3\n", "new_path": "integration/__snapshots__/lerna-run.test.js.snap", "old_path": "integration/__snapshots__/lerna-run.test.js.snap" } ]
JavaScript
MIT License
lerna/lerna
feat: Count packages affected in command summary logging
1
feat
null
807,849
18.07.2018 14:45:20
25,200
a4210e2bccfc2c4ad8c292e2e1bfaaabb4a5361a
chore: increase unit test timeout by 5s
[ { "change_type": "MODIFY", "diff": "\"use strict\";\n-// allow 10s timeout in an attempt to lessen flakiness of unit tests...\n-jasmine.DEFAULT_TIMEOUT_INTERVAL = 10e3;\n+// allow 15s timeout in an attempt to lessen flakiness of unit tests...\n+jasmine.DEFAULT_TIMEOUT_INTERVAL = 15e3;\n", "new_path": "setup-unit-test-timeout.js", "old_path": "setup-unit-test-timeout.js" } ]
JavaScript
MIT License
lerna/lerna
chore: increase unit test timeout by 5s
1
chore
null
679,913
18.07.2018 15:11:22
-3,600
092154c7498a3af4eb4214e4854b0ea05e6265d7
feat(transducers): allow key arrays for rename(), simplify call sites update multiplexObj() & struct() xforms
[ { "change_type": "MODIFY", "diff": "@@ -9,6 +9,6 @@ export function multiplexObj<A, B>(xforms: IObjectOf<Transducer<A, any>>, rfn?:\nconst ks = Object.keys(xforms);\nreturn comp(\nmultiplex.apply(null, ks.map((k) => xforms[k])),\n- rename(ks.reduce((acc, k, i) => (acc[k] = i, acc), {}), rfn)\n+ rename(ks, rfn)\n);\n}\n", "new_path": "packages/transducers/src/xform/multiplex-obj.ts", "old_path": "packages/transducers/src/xform/multiplex-obj.ts" }, { "change_type": "MODIFY", "diff": "import { IObjectOf } from \"@thi.ng/api/api\";\n+import { isArray } from \"@thi.ng/checks/is-array\";\nimport { Reducer, Transducer } from \"../api\";\nimport { comp } from \"../func/comp\";\n@@ -7,7 +8,10 @@ import { transduce } from \"../transduce\";\nimport { filter } from \"./filter\";\nimport { map } from \"./map\";\n-export function rename<A, B>(kmap: IObjectOf<PropertyKey>, rfn?: Reducer<B, [PropertyKey, A]>): Transducer<A[], B> {\n+export function rename<A, B>(kmap: IObjectOf<PropertyKey> | Array<PropertyKey>, rfn?: Reducer<B, [PropertyKey, A]>): Transducer<A[], B> {\n+ if (isArray(kmap)) {\n+ kmap = kmap.reduce((acc, k, i) => (acc[k] = i, acc), {});\n+ }\nif (rfn) {\nconst ks = Object.keys(kmap);\nreturn map(\n@@ -19,6 +23,6 @@ export function rename<A, B>(kmap: IObjectOf<PropertyKey>, rfn?: Reducer<B, [Pro\nrfn, ks)\n);\n} else {\n- return map(renamer(kmap));\n+ return map(renamer(<IObjectOf<PropertyKey>>kmap));\n}\n}\n", "new_path": "packages/transducers/src/xform/rename.ts", "old_path": "packages/transducers/src/xform/rename.ts" }, { "change_type": "MODIFY", "diff": "@@ -34,7 +34,7 @@ export function struct<T>(fields: StructField[]): Transducer<any, T> {\nreturn comp(\npartitionOf(fields.map((f) => f[1])),\npartition(fields.length),\n- rename(fields.reduce((acc, f, i) => (acc[f[0]] = i, acc), {})),\n+ rename(fields.map((f) => f[0])),\nmapKeys(fields.reduce((acc, f) => (f[2] ? (acc[f[0]] = f[2], acc) : acc), {}), false)\n);\n}\n", "new_path": "packages/transducers/src/xform/struct.ts", "old_path": "packages/transducers/src/xform/struct.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(transducers): allow key arrays for rename(), simplify call sites - update multiplexObj() & struct() xforms
1
feat
transducers
679,913
18.07.2018 15:13:02
-3,600
ccc37c67e54eba79eec5bbe6c5a38b150e3604d0
feat(transducer): add asIterable() helper
[ { "change_type": "MODIFY", "diff": "@@ -113,6 +113,7 @@ export * from \"./func/renamer\";\nexport * from \"./func/swizzler\";\nexport * from \"./func/weighted-random\";\n+export * from \"./iter/as-iterable\";\nexport * from \"./iter/choices\";\nexport * from \"./iter/concat\";\nexport * from \"./iter/cycle\";\n", "new_path": "packages/transducers/src/index.ts", "old_path": "packages/transducers/src/index.ts" }, { "change_type": "ADD", "diff": "+/**\n+ * Helper function to (re)provide given iterable in iterator form.\n+ *\n+ * @param src\n+ */\n+export function* asIterable<T>(src: Iterable<T>) {\n+ yield* src;\n+}\n", "new_path": "packages/transducers/src/iter/as-iterable.ts", "old_path": null } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(transducer): add asIterable() helper
1
feat
transducer
679,913
18.07.2018 15:14:35
-3,600
482943c89e8ec52fb67aa8661236cee5666489f7
docs(transducers): add/update doc strings
[ { "change_type": "MODIFY", "diff": "/**\n* Returns optimized function to select, repeat, reshape and / or\n- * reorder array/object values in the specified index order.\n- * The returned function can be used directly or as mapping\n- * function for the `map` transducer. Fast paths for up to 8\n- * indices are provided, before loop based approach is used.\n+ * reorder array/object values in the specified index order. The\n+ * returned function can be used directly or as mapping function for the\n+ * `map` transducer. Fast paths for up to 8 indices are provided, before\n+ * loop based approach is used.\n*\n* ```\n* swizzler([0, 0, 0])([1, 2, 3, 4]) // [ 1, 1, 1 ]\n* swizzler([1, 1, 3, 3])([1, 2, 3, 4]) // [ 2, 2, 4, 4 ]\n* swizzler([2, 0])([1, 2, 3]) // [ 3, 1 ]\n* ```\n- * Even though, any object can be used as input to the generated\n- * function, the returned values will always be in array form.\n+ *\n+ * Even though, objects can be used as input to the generated function,\n+ * the returned values will always be in array form.\n*\n* ```\n* swizzler([\"a\", \"c\", \"b\"])({a: 1, b: 2, c: 3}) // [ 1, 3, 2 ]\n", "new_path": "packages/transducers/src/func/swizzler.ts", "old_path": "packages/transducers/src/func/swizzler.ts" }, { "change_type": "MODIFY", "diff": "import { Reducer } from \"../api\";\nimport { reducer } from \"../reduce\";\n+/**\n+ * Reducer to compute sum of values.\n+ */\nexport function add(): Reducer<number, number> {\nreturn reducer(() => 0, (acc, x) => acc + x);\n}\n", "new_path": "packages/transducers/src/rfn/add.ts", "old_path": "packages/transducers/src/rfn/add.ts" }, { "change_type": "MODIFY", "diff": "import { Reducer } from \"../api\";\nimport { reducer } from \"../reduce\";\n+/**\n+ * Reducer accepting key-value pairs / tuples and transforming / adding\n+ * them to an ES6 Map.\n+ */\nexport function assocMap<A, B>(): Reducer<Map<A, B>, [A, B]> {\nreturn reducer(() => new Map(), (acc, [k, v]) => acc.set(k, v));\n}\n", "new_path": "packages/transducers/src/rfn/assoc-map.ts", "old_path": "packages/transducers/src/rfn/assoc-map.ts" }, { "change_type": "MODIFY", "diff": "@@ -3,6 +3,10 @@ import { IObjectOf } from \"@thi.ng/api/api\";\nimport { Reducer } from \"../api\";\nimport { reducer } from \"../reduce\";\n+/**\n+ * Reducer accepting key-value pairs / tuples and transforming / adding\n+ * them to an object.\n+ */\nexport function assocObj<T>(): Reducer<IObjectOf<T>, [PropertyKey, T]> {\nreturn reducer(() => <any>new Object(), (acc, [k, v]) => (acc[k] = v, acc));\n}\n", "new_path": "packages/transducers/src/rfn/assoc-obj.ts", "old_path": "packages/transducers/src/rfn/assoc-obj.ts" }, { "change_type": "MODIFY", "diff": "import { Reducer } from \"../api\";\nimport { reducer } from \"../reduce\";\n+/**\n+ * Reducer. Like `push()`, but for ES6 Sets.\n+ */\nexport function conj<T>(): Reducer<Set<T>, T> {\nreturn reducer(() => new Set(), (acc, x) => acc.add(x));\n}\n", "new_path": "packages/transducers/src/rfn/conj.ts", "old_path": "packages/transducers/src/rfn/conj.ts" }, { "change_type": "MODIFY", "diff": "import { Reducer } from \"../api\";\nimport { reducer } from \"../reduce\";\n+/**\n+ * Reducer which ignores incoming values and instead only counts them,\n+ * optionally using given `start` and `step` counter values.\n+ *\n+ * @param offset\n+ * @param step\n+ */\nexport function count(offset = 0, step = 1): Reducer<number, any> {\nreturn reducer(() => offset, (acc, _) => acc + step);\n}\n", "new_path": "packages/transducers/src/rfn/count.ts", "old_path": "packages/transducers/src/rfn/count.ts" }, { "change_type": "MODIFY", "diff": "@@ -4,6 +4,21 @@ import { Reducer } from \"../api\";\nimport { reducer } from \"../reduce\";\nimport { reduced } from \"../reduced\";\n+/**\n+ * Reducer which applies optional `pred` function to each value and\n+ * terminates early if the predicate returned a falsy result. If no\n+ * predicate is given the values are checked via JS native truthiness\n+ * rules (i.e. 0, \"\", false, null, undefined are all falsy).\n+ *\n+ * Returns true if *all* values passed test.\n+ *\n+ * ```\n+ * reduce(every((x)=> x > 0), [1,2,-1,3]);\n+ * // false\n+ * ```\n+ *\n+ * @param pred\n+ */\nexport function every<T>(pred?: Predicate<T>): Reducer<boolean, T> {\nreturn reducer(\n() => true,\n", "new_path": "packages/transducers/src/rfn/every.ts", "old_path": "packages/transducers/src/rfn/every.ts" }, { "change_type": "MODIFY", "diff": "@@ -4,6 +4,13 @@ import { Reducer } from \"../api\";\nimport { reducer } from \"../reduce\";\nimport { reduced } from \"../reduced\";\n+/**\n+ * Similar to `every()` reducer, but only requires at least 1 value to\n+ * succeed predicate test (and then immediately terminates with `true`\n+ * as result).\n+ *\n+ * @param pred\n+ */\nexport function some<T>(pred?: Predicate<T>): Reducer<boolean, T> {\nreturn reducer(\n() => false,\n", "new_path": "packages/transducers/src/rfn/some.ts", "old_path": "packages/transducers/src/rfn/some.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
docs(transducers): add/update doc strings
1
docs
transducers
807,849
18.07.2018 15:20:18
25,200
7b153c086d0609a000db613131b6448cfbb50901
build: Reduce concurrency of jest in CI to reduce resource contention
[ { "change_type": "MODIFY", "diff": "@@ -32,7 +32,9 @@ before_script:\n- git config --global user.email test@example.com\n- git config --global user.name \"Tester McPerson\"\n-script: npm run ci\n+script:\n+ - npm test -- --ci --coverage --maxWorkers=2 --verbose\n+ - npm run integration -- --ci --runInBand\nnotifications:\nslack: lernajs:qHyrojRoqBBu7OhDyX1OMiHQ\n", "new_path": ".travis.yml", "old_path": ".travis.yml" }, { "change_type": "MODIFY", "diff": "@@ -29,6 +29,7 @@ before_test:\n- git config --global user.name \"Tester McPerson\"\ntest_script:\n- - npm run ci\n+ - npm test -- --ci --coverage --maxWorkers=2 --verbose\n+ - npm run integration -- --ci --runInBand\nbuild: off\n", "new_path": "appveyor.yml", "old_path": "appveyor.yml" }, { "change_type": "MODIFY", "diff": "\"description\": \"lerna dog-fooding lerna\",\n\"private\": true,\n\"scripts\": {\n- \"ci\": \"npm test -- --ci --coverage --verbose && npm run integration -- --ci\",\n+ \"ci\": \"npm test -- --ci --coverage --maxWorkers=2 --verbose && npm run integration -- --ci --runInBand\",\n\"fix\": \"npm run lint -- --fix\",\n\"integration\": \"cross-env LC_ALL=en_US.UTF-8 NODE_ENV=test jest --config jest.integration.js\",\n\"lint\": \"eslint . --ignore-path .gitignore --cache\",\n", "new_path": "package.json", "old_path": "package.json" } ]
JavaScript
MIT License
lerna/lerna
build: Reduce concurrency of jest in CI to reduce resource contention
1
build
null
807,849
18.07.2018 15:33:08
25,200
e908d236af8c20d26e722121002af50cf07bf160
fix(publish): Avoid fs-extra warning on 32-bit machines
[ { "change_type": "MODIFY", "diff": "@@ -15,7 +15,8 @@ function createTempLicenses(srcLicensePath, packagesToBeLicensed) {\nconst licenseFileName = path.basename(srcLicensePath);\nconst options = {\n// make an effort to keep package contents stable over time\n- preserveTimestamps: true,\n+ preserveTimestamps: process.arch !== \"ia32\",\n+ // (give up on 32-bit architecture to avoid fs-extra warning)\n};\n// store target path for removal later\n", "new_path": "commands/publish/lib/create-temp-licenses.js", "old_path": "commands/publish/lib/create-temp-licenses.js" } ]
JavaScript
MIT License
lerna/lerna
fix(publish): Avoid fs-extra warning on 32-bit machines
1
fix
publish
807,849
18.07.2018 15:44:27
25,200
3d88a2b54caba77c3ecf57f39aee0a09c3650873
chore: remove references to jasmine global
[ { "change_type": "MODIFY", "diff": "@@ -10,8 +10,7 @@ const copyFixture = require(\"@lerna-test/copy-fixture\");\nconst CLI = path.join(__dirname, \"../cli.js\");\nconst bin = cwd => (...args) => execa(CLI, args, { cwd });\n-/* global jasmine */\n-jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000;\n+jest.setTimeout(30e3);\ndescribe(\"cli\", () => {\nit(\"should throw without command\", async () => {\n", "new_path": "core/lerna/__tests__/cli.test.js", "old_path": "core/lerna/__tests__/cli.test.js" }, { "change_type": "MODIFY", "diff": "\"use strict\";\n// allow CLI integration tests to run for awhile (300s)\n-jasmine.DEFAULT_TIMEOUT_INTERVAL = 300e3;\n+jest.setTimeout(300e3);\n", "new_path": "setup-integration-timeout.js", "old_path": "setup-integration-timeout.js" }, { "change_type": "MODIFY", "diff": "\"use strict\";\n// allow 15s timeout in an attempt to lessen flakiness of unit tests...\n-jasmine.DEFAULT_TIMEOUT_INTERVAL = 15e3;\n+jest.setTimeout(15e3);\n", "new_path": "setup-unit-test-timeout.js", "old_path": "setup-unit-test-timeout.js" } ]
JavaScript
MIT License
lerna/lerna
chore: remove references to jasmine global
1
chore
null
791,834
18.07.2018 15:47:43
25,200
8cee1138d75298418bbd413c01f52970084c97ab
core: expose LighthouseRunWarnings on audit context
[ { "change_type": "MODIFY", "diff": "@@ -23,7 +23,7 @@ class BootupTime extends Audit {\ndescription: '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/tools/lighthouse/audits/bootup).',\n- requiredArtifacts: ['traces', 'LighthouseRunWarnings'],\n+ requiredArtifacts: ['traces'],\n};\n}\n@@ -85,7 +85,6 @@ class BootupTime extends Audit {\n* @return {Promise<LH.Audit.Product>}\n*/\nstatic async audit(artifacts, context) {\n- const runWarnings = artifacts.LighthouseRunWarnings;\nconst settings = context.settings || {};\nconst trace = artifacts.traces[BootupTime.DEFAULT_PASS];\nconst devtoolsLog = artifacts.devtoolsLogs[BootupTime.DEFAULT_PASS];\n@@ -133,8 +132,8 @@ class BootupTime extends Audit {\n// TODO: consider moving this to core gathering so you don't need to run the audit for warning\nif (hadExcessiveChromeExtension) {\n- runWarnings.push('Chrome extensions negatively affected this page\\'s load performance. ' +\n- 'Try auditing the page in incognito mode or from a clean Chrome profile.');\n+ context.LighthouseRunWarnings.push('Chrome extensions negatively affected this page\\'s load' +\n+ ' performance. Try auditing the page in incognito mode or from a clean Chrome profile.');\n}\nconst summary = {wastedMs: totalBootupTime};\n", "new_path": "lighthouse-core/audits/bootup-time.js", "old_path": "lighthouse-core/audits/bootup-time.js" }, { "change_type": "MODIFY", "diff": "@@ -94,7 +94,8 @@ class Runner {\nif (!opts.config.audits) {\nthrow new Error('No audits to evaluate.');\n}\n- const auditResults = await Runner._runAudits(settings, opts.config.audits, artifacts);\n+ const auditResults = await Runner._runAudits(settings, opts.config.audits, artifacts,\n+ lighthouseRunWarnings);\n// LHR construction phase\nlog.log('status', 'Generating results...');\n@@ -166,13 +167,14 @@ class Runner {\n}\n/**\n- * Save collected artifacts to disk\n+ * Run all audits with specified settings and artifacts.\n* @param {LH.Config.Settings} settings\n* @param {Array<LH.Config.AuditDefn>} audits\n* @param {LH.Artifacts} artifacts\n+ * @param {Array<string>} runWarnings\n* @return {Promise<Array<LH.Audit.Result>>}\n*/\n- static async _runAudits(settings, audits, artifacts) {\n+ static async _runAudits(settings, audits, artifacts, runWarnings) {\nlog.log('status', 'Analyzing and running audits...');\nartifacts = Object.assign({}, Runner.instantiateComputedArtifacts(), artifacts);\n@@ -190,7 +192,7 @@ class Runner {\n// Run each audit sequentially\nconst auditResults = [];\nfor (const auditDefn of audits) {\n- const auditResult = await Runner._runAudit(auditDefn, artifacts, settings);\n+ const auditResult = await Runner._runAudit(auditDefn, artifacts, settings, runWarnings);\nauditResults.push(auditResult);\n}\n@@ -203,10 +205,11 @@ class Runner {\n* @param {LH.Config.AuditDefn} auditDefn\n* @param {LH.Artifacts} artifacts\n* @param {LH.Config.Settings} settings\n+ * @param {Array<string>} runWarnings\n* @return {Promise<LH.Audit.Result>}\n* @private\n*/\n- static async _runAudit(auditDefn, artifacts, settings) {\n+ static async _runAudit(auditDefn, artifacts, settings, runWarnings) {\nconst audit = auditDefn.implementation;\nconst status = `Evaluating: ${audit.meta.title}`;\n@@ -254,7 +257,13 @@ class Runner {\n// all required artifacts are in good shape, so we proceed\nconst auditOptions = Object.assign({}, audit.defaultOptions, auditDefn.options);\n- const product = await audit.audit(artifacts, {options: auditOptions, settings: settings});\n+ const auditContext = {\n+ options: auditOptions,\n+ settings,\n+ LighthouseRunWarnings: runWarnings,\n+ };\n+\n+ const product = await audit.audit(artifacts, auditContext);\nauditResult = Audit.generateAuditResult(audit, product);\n} catch (err) {\nlog.warn(audit.meta.id, `Caught exception: ${err.message}`);\n", "new_path": "lighthouse-core/runner.js", "old_path": "lighthouse-core/runner.js" }, { "change_type": "MODIFY", "diff": "@@ -36,6 +36,13 @@ describe('Runner', () => {\nresetSpies();\n});\n+ const basicAuditMeta = {\n+ id: 'test-audit',\n+ title: 'A test audit',\n+ description: 'An audit for testing',\n+ requiredArtifacts: [],\n+ };\n+\ndescribe('Gather Mode & Audit Mode', () => {\nconst url = 'https://example.com';\nconst generateConfig = settings => new Config({\n@@ -546,6 +553,58 @@ describe('Runner', () => {\n});\n});\n+ it('includes any LighthouseRunWarnings from audits in LHR', () => {\n+ const warningString = 'Really important audit warning!';\n+\n+ const config = new Config({\n+ settings: {\n+ auditMode: __dirname + '/fixtures/artifacts/empty-artifacts/',\n+ },\n+ audits: [\n+ class WarningAudit extends Audit {\n+ static get meta() {\n+ return basicAuditMeta;\n+ }\n+ static audit(artifacts, context) {\n+ context.LighthouseRunWarnings.push(warningString);\n+ return {\n+ rawValue: 5,\n+ };\n+ }\n+ },\n+ ],\n+ });\n+\n+ return Runner.run(null, {config, driverMock}).then(results => {\n+ assert.deepStrictEqual(results.lhr.runWarnings, [warningString]);\n+ });\n+ });\n+\n+ it('includes any LighthouseRunWarnings from errored audits in LHR', () => {\n+ const warningString = 'Audit warning just before a terrible error!';\n+\n+ const config = new Config({\n+ settings: {\n+ auditMode: __dirname + '/fixtures/artifacts/empty-artifacts/',\n+ },\n+ audits: [\n+ class WarningAudit extends Audit {\n+ static get meta() {\n+ return basicAuditMeta;\n+ }\n+ static audit(artifacts, context) {\n+ context.LighthouseRunWarnings.push(warningString);\n+ throw new Error('Terrible.');\n+ }\n+ },\n+ ],\n+ });\n+\n+ return Runner.run(null, {config, driverMock}).then(results => {\n+ assert.deepStrictEqual(results.lhr.runWarnings, [warningString]);\n+ });\n+ });\n+\nit('can handle array of outputs', async () => {\nconst url = 'https://example.com';\nconst config = new Config({\n", "new_path": "lighthouse-core/test/runner-test.js", "old_path": "lighthouse-core/test/runner-test.js" }, { "change_type": "MODIFY", "diff": "declare global {\nmodule LH.Audit {\nexport interface Context {\n- options: Record<string, any>; // audit options\n+ /** audit options */\n+ options: Record<string, any>;\nsettings: Config.Settings;\n+ /** Push to this array to add top-level warnings to the LHR. */\n+ LighthouseRunWarnings: Array<string>;\n}\nexport interface ScoreOptions {\n", "new_path": "typings/audit.d.ts", "old_path": "typings/audit.d.ts" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
core: expose LighthouseRunWarnings on audit context (#5684)
1
core
null
807,849
18.07.2018 15:51:15
25,200
57ff865c0839df75dbe1974971d7310f235e1109
chore: Use jest-circus
[ { "change_type": "MODIFY", "diff": "@@ -8,4 +8,5 @@ module.exports = {\nsetupFiles: [\"@lerna-test/silence-logging\", \"@lerna-test/set-npm-userconfig\"],\nsetupTestFrameworkScriptFile: \"<rootDir>/setup-unit-test-timeout.js\",\ntestEnvironment: \"node\",\n+ testRunner: \"jest-circus/runner\",\n};\n", "new_path": "jest.config.js", "old_path": "jest.config.js" }, { "change_type": "MODIFY", "diff": "@@ -8,5 +8,6 @@ module.exports = {\nsetupTestFrameworkScriptFile: \"<rootDir>/setup-integration-timeout.js\",\nsnapshotSerializers: [\"@lerna-test/serialize-placeholders\"],\ntestEnvironment: \"node\",\n+ testRunner: \"jest-circus/runner\",\nverbose: true,\n};\n", "new_path": "jest.integration.js", "old_path": "jest.integration.js" }, { "change_type": "MODIFY", "diff": "\"throat\": \"^4.0.0\"\n}\n},\n+ \"jest-circus\": {\n+ \"version\": \"23.4.1\",\n+ \"resolved\": \"https://registry.npmjs.org/jest-circus/-/jest-circus-23.4.1.tgz\",\n+ \"integrity\": \"sha512-Km8NNJ09nvP7+Pt3pY+au64ZxALubSKisoTFA3R4YFxIFxwO2ed5u0rBMh7Y8HAEg8kVyAkqOhIsqD+46y9r5w==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"chalk\": \"^2.0.1\",\n+ \"co\": \"^4.6.0\",\n+ \"expect\": \"^23.4.0\",\n+ \"is-generator-fn\": \"^1.0.0\",\n+ \"jest-diff\": \"^23.2.0\",\n+ \"jest-each\": \"^23.4.0\",\n+ \"jest-matcher-utils\": \"^23.2.0\",\n+ \"jest-message-util\": \"^23.4.0\",\n+ \"jest-snapshot\": \"^23.4.1\",\n+ \"jest-util\": \"^23.4.0\",\n+ \"pretty-format\": \"^23.2.0\",\n+ \"stack-utils\": \"^1.0.1\"\n+ }\n+ },\n\"jest-config\": {\n\"version\": \"23.4.1\",\n\"resolved\": \"https://registry.npmjs.org/jest-config/-/jest-config-23.4.1.tgz\",\n", "new_path": "package-lock.json", "old_path": "package-lock.json" }, { "change_type": "MODIFY", "diff": "\"eslint-plugin-prettier\": \"^2.6.2\",\n\"fast-async\": \"^6.3.7\",\n\"jest\": \"^23.4.1\",\n+ \"jest-circus\": \"^23.4.1\",\n\"normalize-newline\": \"^3.0.0\",\n\"normalize-path\": \"^2.1.1\",\n\"path-key\": \"^2.0.1\",\n", "new_path": "package.json", "old_path": "package.json" } ]
JavaScript
MIT License
lerna/lerna
chore: Use jest-circus
1
chore
null
791,690
18.07.2018 17:14:36
25,200
1f52fe710498f0c6f5944230234979dae049fc67
core(optimized-images): support non-standard mime types
[ { "change_type": "MODIFY", "diff": "@@ -21,6 +21,8 @@ const WEBP_QUALITY = 0.85;\nconst MINIMUM_IMAGE_SIZE = 4096; // savings of <4 KB will be ignored in the audit anyway\n+const IMAGE_REGEX = /^image\\/((x|ms|x-ms)-)?(png|bmp|jpeg)$/;\n+\n/** @typedef {{isSameOrigin: boolean, isBase64DataUri: boolean, requestId: string, url: string, mimeType: string, resourceSize: number}} SimplifiedNetworkRecord */\n/* global document, Image, atob */\n@@ -87,7 +89,7 @@ class OptimizedImages extends Gatherer {\nseenUrls.add(record.url);\nconst isOptimizableImage = record.resourceType === NetworkRequest.TYPES.Image &&\n- /image\\/(png|bmp|jpeg)/.test(record.mimeType);\n+ IMAGE_REGEX.test(record.mimeType);\nconst isSameOrigin = URL.originsMatch(pageUrl, record.url);\nconst isBase64DataUri = /^data:.{2,40}base64\\s*,/.test(record.url);\n", "new_path": "lighthouse-core/gather/gatherers/dobetterweb/optimized-images.js", "old_path": "lighthouse-core/gather/gatherers/dobetterweb/optimized-images.js" }, { "change_type": "MODIFY", "diff": "const Audit = require('../../../audits/dobetterweb/doctype.js');\nconst assert = require('assert');\n-/* eslint-env mocha */\n+/* eslint-env jest */\ndescribe('DOBETTERWEB: doctype audit', () => {\nit('fails when document does not contain a doctype', () => {\n", "new_path": "lighthouse-core/test/audits/dobetterweb/doctype-test.js", "old_path": "lighthouse-core/test/audits/dobetterweb/doctype-test.js" }, { "change_type": "MODIFY", "diff": "*/\n'use strict';\n-/* eslint-env mocha */\n+/* eslint-env jest */\nconst OptimizedImages =\nrequire('../../../../gather/gatherers/dobetterweb/optimized-images');\n@@ -185,4 +185,23 @@ describe('Optimized images', () => {\nassert.ok(/gmail.*image.jpg/.test(artifact[3].url));\n});\n});\n+\n+ it('handles non-standard mime types too', async () => {\n+ const traceData = {\n+ networkRecords: [\n+ {\n+ requestId: '1',\n+ url: 'http://google.com/image.bmp?x-ms',\n+ mimeType: 'image/x-ms-bmp',\n+ resourceSize: 12000,\n+ transferSize: 20000,\n+ resourceType: 'Image',\n+ finished: true,\n+ },\n+ ],\n+ };\n+\n+ const artifact = await optimizedImages.afterPass(options, traceData);\n+ expect(artifact).toHaveLength(1);\n+ });\n});\n", "new_path": "lighthouse-core/test/gather/gatherers/dobetterweb/optimized-images-test.js", "old_path": "lighthouse-core/test/gather/gatherers/dobetterweb/optimized-images-test.js" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
core(optimized-images): support non-standard mime types (#5688)
1
core
optimized-images
815,745
18.07.2018 17:30:05
-10,800
cf5a5c4195f1ecf902b847158d6a6328e731ba23
fix: increase arrow click area closes
[ { "change_type": "MODIFY", "diff": "text-align: center;\nuser-select: none;\n.ng-arrow {\n+ pointer-events: none;\ndisplay: inline-block;\nheight: 0;\nwidth: 0;\n", "new_path": "src/ng-select/ng-select.component.scss", "old_path": "src/ng-select/ng-select.component.scss" }, { "change_type": "MODIFY", "diff": "@@ -2636,7 +2636,7 @@ describe('NgSelectComponent', function () {\ntickAndDetectChanges(fixture);\ntriggerMousedown = () => {\nconst control = fixture.debugElement.query(By.css('.ng-select-container'));\n- control.triggerEventHandler('mousedown', createEvent({ target: { className: 'ng-arrow' } }));\n+ control.triggerEventHandler('mousedown', createEvent({ target: { className: 'ng-arrow-wrapper' } }));\n};\n}));\n", "new_path": "src/ng-select/ng-select.component.spec.ts", "old_path": "src/ng-select/ng-select.component.spec.ts" }, { "change_type": "MODIFY", "diff": "@@ -256,7 +256,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nthis.handleClearClick();\nreturn;\n}\n- if (target.className === 'ng-arrow') {\n+ if (target.className === 'ng-arrow-wrapper') {\nthis.handleArrowClick();\nreturn;\n}\n", "new_path": "src/ng-select/ng-select.component.ts", "old_path": "src/ng-select/ng-select.component.ts" }, { "change_type": "MODIFY", "diff": "@@ -146,13 +146,16 @@ $color-selected: #f5faff;\n.ng-arrow-wrapper {\npadding-right: 5px;\nwidth: 25px;\n+ &:hover {\n+ .ng-arrow {\n+ border-top-color: #666;\n+ }\n+ }\n.ng-arrow {\nborder-color: #999 transparent transparent;\nborder-style: solid;\nborder-width: 5px 5px 2.5px;\n- &:hover {\n- border-top-color: #666;\n- }\n+\n}\n}\n}\n", "new_path": "src/themes/default.theme.scss", "old_path": "src/themes/default.theme.scss" } ]
TypeScript
MIT License
ng-select/ng-select
fix: increase arrow click area closes #601
1
fix
null
815,745
18.07.2018 17:39:46
-10,800
cb64f459c213c8a7084f9449d4d986aeb887f49d
chore(release): 2.3.5
[ { "change_type": "MODIFY", "diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"2.3.5\"></a>\n+## [2.3.5](https://github.com/ng-select/ng-select/compare/v2.3.4...v2.3.5) (2018-07-18)\n+\n+\n+### Bug Fixes\n+\n+* increase arrow click area ([cf5a5c4](https://github.com/ng-select/ng-select/commit/cf5a5c4)), closes [#601](https://github.com/ng-select/ng-select/issues/601)\n+\n+\n+\n<a name=\"2.3.4\"></a>\n## [2.3.4](https://github.com/ng-select/ng-select/compare/v2.3.3...v2.3.4) (2018-07-18)\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\": \"2.3.4\",\n+ \"version\": \"2.3.5\",\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): 2.3.5
1
chore
release
791,690
19.07.2018 10:15:27
25,200
6e7db32a250444aa0013a491a8e4249dc2d9704f
misc(i18n): add assertion script
[ { "change_type": "MODIFY", "diff": "@@ -41,6 +41,7 @@ script:\n- yarn test-extension\n- yarn test-viewer\n- yarn test-lantern\n+ - yarn i18n:checks\n# _JAVA_OPTIONS is breaking parsing of compiler output. See #3338.\n- unset _JAVA_OPTIONS\n# FIXME(paulirish): re-enable after a roll of LH->CDT\n", "new_path": ".travis.yml", "old_path": ".travis.yml" }, { "change_type": "MODIFY", "diff": "@@ -91,7 +91,7 @@ function writeStringsToLocaleFormat(locale, strings) {\noutput[key] = {message};\n}\n- fs.writeFileSync(fullPath, JSON.stringify(output, null, 2));\n+ fs.writeFileSync(fullPath, JSON.stringify(output, null, 2) + '\\n');\n}\nconst strings = collectAllStringsInDir(path.join(LH_ROOT, 'lighthouse-core'));\n", "new_path": "lighthouse-core/scripts/i18n/collect-strings.js", "old_path": "lighthouse-core/scripts/i18n/collect-strings.js" }, { "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 . && cd ./lighthouse-viewer && yarn type-check\",\n+ \"i18n:checks\": \"./lighthouse-core/scripts/i18n/assert-strings-collected.sh\",\n+ \"i18n:collect-strings\": \"node lighthouse-core/scripts/i18n/collect-strings.js\",\n\"update:sample-artifacts\": \"node lighthouse-core/scripts/update-report-fixtures.js -G\",\n\"update:sample-json\": \"node ./lighthouse-cli -A=./lighthouse-core/test/results/artifacts --throttling-method=devtools --output=json --output-path=./lighthouse-core/test/results/sample_v2.json && node lighthouse-core/scripts/cleanup-LHR-for-diff.js ./lighthouse-core/test/results/sample_v2.json --only-remove-timing\",\n\"diff:sample-json\": \"bash lighthouse-core/scripts/assert-golden-lhr-unchanged.sh\",\n", "new_path": "package.json", "old_path": "package.json" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
misc(i18n): add assertion script (#5686)
1
misc
i18n
730,413
19.07.2018 10:31:59
14,400
8ba6b0f587f8429b7095eb1579a44c80ef4ca358
refactor(widget-recents-demo): update branding for widget recents demo
[ { "change_type": "MODIFY", "diff": "@@ -97,7 +97,7 @@ class DemoWidgetRecents extends Component {\n/* eslint-disable max-len */\nreturn (\n<div>\n- <AppBar title=\"Cisco Spark Recents Widget\" />\n+ <AppBar title=\"Webex Teams Recents Widget\" />\n<div className={classNames(componentContainerClassNames)}>\n<div id={widgetElementId} />\n</div>\n@@ -106,17 +106,17 @@ class DemoWidgetRecents extends Component {\n<CardTitle\nactAsExpander\nshowExpandableButton\n- title=\"Cisco Spark Recents Widget Demo\"\n+ title=\"Webex Teams Recents Widget Demo\"\n/>\n<CardText expandable>\n<p>\n- The Spark Recents widget allows developers to easily incorporate Cisco Spark Recents list and events into an application.\n+ The Webex Teams Recents widget allows developers to easily incorporate Webex Teams Recents list and events into an application.\n</p>\n<p>\n- This widget handles coordination between your application and the Spark APIs, and provides components of the Spark recents list experience without having to build all of the front end UI yourself.\n+ This widget handles coordination between your application and the Webex Teams APIs, and provides components of the Webex Teams recents list experience without having to build all of the front end UI yourself.\n</p>\n<p>\n- Our widget is built using <a href=\"https://github.com/facebook/react\">React</a>, <a href=\"https://github.com/reactjs/redux\">Redux</a>, and the <a href=\"https://github.com/webex/spark-js-sdk\">Spark Javascript SDK </a>.\n+ Our widget is built using <a href=\"https://github.com/facebook/react\">React</a>, <a href=\"https://github.com/reactjs/redux\">Redux</a>, and the <a href=\"https://github.com/webex/spark-js-sdk\">Webex Teams Javascript SDK </a>.\n</p>\n</CardText>\n<CardActions expandable>\n@@ -134,7 +134,7 @@ class DemoWidgetRecents extends Component {\n<CardTitle\nactAsExpander\nshowExpandableButton\n- subtitle=\"Cisco Spark Recents Widget can be implemented multiple ways.\"\n+ subtitle=\"Webex Teams Recents Widget can be implemented multiple ways.\"\ntitle=\"Widget Example Code\"\n/>\n<CardText expandable>\n", "new_path": "packages/node_modules/@ciscospark/widget-recents-demo/src/components/demo-widget-recents/index.js", "old_path": "packages/node_modules/@ciscospark/widget-recents-demo/src/components/demo-widget-recents/index.js" }, { "change_type": "MODIFY", "diff": "@@ -52,13 +52,13 @@ class TokenInput extends Component {\n<CardTitle\nactAsExpander\nshowExpandableButton\n- subtitle=\"Spark Widgets require an access token to identify the current user.\"\n- title=\"Cisco Spark Access Token\"\n+ subtitle=\"Webex Teams Widgets require an access token to identify the current user.\"\n+ title=\"Webex Teams Access Token\"\n/>\n{\n!this.state.tokenSaved &&\n<CardText expandable>\n- <p>You can get an access token from <a href=\"http://developer.ciscospark.com\">developer.ciscospark.com</a></p>\n+ <p>You can get an access token from <a href=\"https://developer.webex.com/\">developer.webex.com</a></p>\n<input\naria-label=\"Access Token\"\nclassName={style.textInput}\n", "new_path": "packages/node_modules/@ciscospark/widget-recents-demo/src/components/token-input/index.js", "old_path": "packages/node_modules/@ciscospark/widget-recents-demo/src/components/token-input/index.js" }, { "change_type": "MODIFY", "diff": "<!DOCTYPE html>\n<html>\n<head>\n- <title>Cisco Spark Recents Widget Demo</title>\n+ <title>Webex Teams Recents Widget Demo</title>\n<meta charset=\"utf8\"/>\n<style>\nbody {\n", "new_path": "packages/node_modules/@ciscospark/widget-recents-demo/src/index.html", "old_path": "packages/node_modules/@ciscospark/widget-recents-demo/src/index.html" } ]
JavaScript
MIT License
webex/react-widgets
refactor(widget-recents-demo): update branding for widget recents demo
1
refactor
widget-recents-demo
679,913
19.07.2018 11:15:54
-3,600
9874aceca6cbbcf005d63755003a458cfb4e0b72
perf(transducers): update movingAverage() xform, add docs
[ { "change_type": "MODIFY", "diff": "-import { Transducer } from \"../api\";\n-import { comp } from \"../func/comp\";\n-import { reduce } from \"../reduce\";\n-import { mean } from \"../rfn/mean\";\n-import { map } from \"./map\";\n-import { partition } from \"./partition\";\n+import { illegalArgs } from \"@thi.ng/errors/illegal-arguments\";\n-// TODO optimize, see @thi.ng/indicators/sma\n-export function movingAverage(n: number): Transducer<number, number> {\n- return comp(partition(n, 1, true), map((x) => reduce(mean(), x)));\n+import { Reducer, Transducer } from \"../api\";\n+import { compR } from \"../func/compr\";\n+\n+/**\n+ * Computes the Simple Moving Average of given period.\n+ * https://en.wikipedia.org/wiki/Moving_average#Simple_moving_average\n+ *\n+ * Note: the number of results will be `period-1` less than the number\n+ * of processed inputs and no outputs will be produced if there were\n+ * less than `period` input values.\n+ *\n+ * @param period\n+ */\n+export function movingAverage(period: number): Transducer<number, number> {\n+ period |= 0;\n+ period < 2 && illegalArgs(\"period must be >= 2\");\n+ return (rfn: Reducer<any, number>) => {\n+ const reduce = rfn[2];\n+ const window = [];\n+ let sum = 0;\n+ return compR(\n+ rfn,\n+ (acc, x) => {\n+ const n = window.push(x);\n+ sum += x;\n+ n > period && (sum -= window.shift());\n+ return n >= period ? reduce(acc, sum / period) : acc;\n+ }\n+ );\n}\n+};\n", "new_path": "packages/transducers/src/xform/moving-average.ts", "old_path": "packages/transducers/src/xform/moving-average.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
perf(transducers): update movingAverage() xform, add docs
1
perf
transducers
730,413
19.07.2018 11:23:11
14,400
c519c8e0815736078ede72be0bacf69c4a01d71d
refactor(widget-space-demo): update branding for widget space demo
[ { "change_type": "MODIFY", "diff": "@@ -191,7 +191,7 @@ class DemoWidgetSpace extends Component {\n/* eslint-disable max-len */\nreturn (\n<div>\n- <AppBar title=\"Cisco Spark Space Widget\" />\n+ <AppBar title=\"Webex Teams Space Widget\" />\n<div className={classNames('ciscospark-demo-wrapper', styles.demoWrapper)}>\n<div className={classNames(componentContainerClassNames)}>\n<div id={widgetElementId} />\n@@ -200,13 +200,13 @@ class DemoWidgetSpace extends Component {\n<CardTitle\nactAsExpander\nshowExpandableButton\n- subtitle=\"The Spark Space widget allows developers to easily incorporate Cisco Spark Space messaging into an application.\"\n- title=\"Cisco Spark Space Widget Demo\"\n+ subtitle=\"The Webex Teams Space widget allows developers to easily incorporate Webex Teams Space messaging into an application.\"\n+ title=\"Webex Teams Space Widget Demo\"\n/>\n<CardText expandable>\n- This widget handles coordination between your application and the Spark APIs, and provides components of the Spark space experience without having to build all of the front end UI yourself.\n+ This widget handles coordination between your application and the Webex Teams APIs, and provides components of the Webex Teams space experience without having to build all of the front end UI yourself.\n<br />\n- Our widget is built using <a href=\"https://github.com/facebook/react\">React</a>, <a href=\"https://github.com/reactjs/redux\">Redux</a>, and the <a href=\"https://github.com/webex/spark-js-sdk\">Spark Javascript SDK </a>.\n+ Our widget is built using <a href=\"https://github.com/facebook/react\">React</a>, <a href=\"https://github.com/reactjs/redux\">Redux</a>, and the <a href=\"https://github.com/webex/spark-js-sdk\">Webex Teams Javascript SDK </a>.\n</CardText>\n</Card>\n<TokenInput onLogin={this.handleAccessTokenChange} token={this.state.accessToken} />\n@@ -214,7 +214,7 @@ class DemoWidgetSpace extends Component {\n<CardTitle\nactAsExpander\nshowExpandableButton\n- subtitle=\"Cisco Spark Space Widget can open to a space or person.\"\n+ subtitle=\"Webex Teams Space Widget can open to a space or person.\"\ntitle=\"Choose Widget Destination\"\n/>\n<CardText expandable>\n@@ -300,7 +300,7 @@ class DemoWidgetSpace extends Component {\nclassName={styles.textInput}\nid=\"toSpaceId\"\nonChange={this.handleSpaceChange}\n- placeholder=\"Spark Space Id\"\n+ placeholder=\"Webex Teams Space Id\"\nvalue={this.state.spaceId}\n/>\n</div>\n@@ -313,7 +313,7 @@ class DemoWidgetSpace extends Component {\nclassName={styles.textInput}\nid=\"toUserEmail\"\nonChange={this.handleEmailChange}\n- placeholder=\"Spark User Email (For 1:1)\"\n+ placeholder=\"Webex Teams User Email (For 1:1)\"\nvalue={this.state.toPersonEmail}\n/>\n</div>\n@@ -343,7 +343,7 @@ class DemoWidgetSpace extends Component {\n<CardTitle\nactAsExpander\nshowExpandableButton\n- subtitle=\"Cisco Spark Space Widget can be implemented multiple ways.\"\n+ subtitle=\"Webex Teams Space Widget can be implemented multiple ways.\"\ntitle=\"Widget Example Code\"\n/>\n<CardText expandable>\n", "new_path": "packages/node_modules/@ciscospark/widget-space-demo/src/components/demo-widget-space/index.js", "old_path": "packages/node_modules/@ciscospark/widget-space-demo/src/components/demo-widget-space/index.js" }, { "change_type": "MODIFY", "diff": "@@ -53,12 +53,12 @@ class TokenInput extends Component {\n<CardTitle\nactAsExpander\nshowExpandableButton\n- subtitle=\"Spark Widgets require an access token to identify the current user.\"\n- title=\"Cisco Spark Access Token\"\n+ subtitle=\"Webex Teams Widgets require an access token to identify the current user.\"\n+ title=\"Webex Teams Access Token\"\n/>\n{!this.state.tokenSaved &&\n<CardText expandable>\n- <p>You can get an access token from <a href=\"http://developer.ciscospark.com\">developer.ciscospark.com</a></p>\n+ <p>You can get an access token from <a href=\"http://developer.webex.com\">developer.webex.com</a></p>\n<input\naria-label=\"Access Token\"\nclassName={style.textInput}\n", "new_path": "packages/node_modules/@ciscospark/widget-space-demo/src/components/token-input/index.js", "old_path": "packages/node_modules/@ciscospark/widget-space-demo/src/components/token-input/index.js" }, { "change_type": "MODIFY", "diff": "<!DOCTYPE html>\n<html>\n<head>\n- <title>Cisco Spark Space Widget Demo</title>\n+ <title>Webex Teams Space Widget Demo</title>\n<meta charset=\"utf8\"/>\n<style>\nbody {\n", "new_path": "packages/node_modules/@ciscospark/widget-space-demo/src/index.html", "old_path": "packages/node_modules/@ciscospark/widget-space-demo/src/index.html" } ]
JavaScript
MIT License
webex/react-widgets
refactor(widget-space-demo): update branding for widget space demo
1
refactor
widget-space-demo
807,849
19.07.2018 12:15:49
25,200
e6ba19f2cf8971794f48676144db3df238d8171d
refactor(collect-updates): Make argument signature explicit BREAKING CHANGE: Instead of an opaque command instance, distinct positional arguments are required.
[ { "change_type": "MODIFY", "diff": "// otherwise, enables everything\nconst updated = new Map();\n-const mockCollectUpdates = jest.fn(({ packageGraph, execOpts: { cwd } }) => {\n+const mockCollectUpdates = jest.fn((filteredPackages, packageGraph, { cwd }) => {\nconst targets = updated.get(cwd);\nconst updates = targets ? new Map(targets.map(name => [name, packageGraph.get(name)])) : packageGraph;\n", "new_path": "commands/__mocks__/@lerna/collect-updates.js", "old_path": "commands/__mocks__/@lerna/collect-updates.js" }, { "change_type": "MODIFY", "diff": "@@ -18,7 +18,7 @@ class ChangedCommand extends Command {\n}\ninitialize() {\n- this.updates = collectUpdates(this);\n+ this.updates = collectUpdates(this.filteredPackages, this.packageGraph, this.execOpts, this.options);\nthis.count = this.updates.length;\nconst proceedWithUpdates = this.count > 0;\n", "new_path": "commands/changed/index.js", "old_path": "commands/changed/index.js" }, { "change_type": "MODIFY", "diff": "@@ -125,7 +125,7 @@ class PublishCommand extends Command {\n}\nthis.conf = npmConf(this.options);\n- this.updates = collectUpdates(this);\n+ this.updates = collectUpdates(this.filteredPackages, this.packageGraph, this.execOpts, this.options);\nif (!this.updates.length) {\nthis.logger.success(\"No updated packages to publish\");\n", "new_path": "commands/publish/index.js", "old_path": "commands/publish/index.js" }, { "change_type": "MODIFY", "diff": "@@ -212,7 +212,9 @@ class Command {\n// collectUpdates requires that filteredPackages be present prior to checking for\n// updates. That's okay because it further filters based on what's already been filtered.\nif (this.options.since !== undefined) {\n- chain = chain.then(() => collectUpdates(this));\n+ chain = chain.then(() =>\n+ collectUpdates(this.filteredPackages, this.packageGraph, this.execOpts, this.options)\n+ );\nchain = chain.then(updates => {\nconst updated = new Set(updates.map(({ pkg }) => pkg.name));\n", "new_path": "core/command/index.js", "old_path": "core/command/index.js" }, { "change_type": "MODIFY", "diff": "\"use strict\";\n+const log = require(\"npmlog\");\nconst childProcess = require(\"@lerna/child-process\");\nconst semver = require(\"semver\");\n@@ -10,24 +11,16 @@ const makeDiffPredicate = require(\"./lib/make-diff-predicate\");\nmodule.exports = collectUpdates;\n-function collectUpdates({\n- filteredPackages,\n- packageGraph,\n- options: { canary, cdVersion, forcePublish, ignoreChanges, since },\n- execOpts,\n- logger,\n-}) {\n+function collectUpdates(filteredPackages, packageGraph, execOpts, commandOptions) {\nconst packages =\nfilteredPackages.length === packageGraph.size\n? packageGraph\n: new Map(filteredPackages.map(({ name }) => [name, packageGraph.get(name)]));\n- logger.info(\"\", \"Checking for updated packages...\");\n-\n- let committish = since;\n+ let committish = commandOptions.since;\nif (hasTags(execOpts)) {\n- if (canary) {\n+ if (commandOptions.canary) {\nconst sha = childProcess.execSync(\"git\", [\"rev-parse\", \"--short\", \"HEAD\"], execOpts);\n// if it's a merge commit, it will return all the commits that were part of the merge\n@@ -39,9 +32,9 @@ function collectUpdates({\n}\n}\n- logger.info(\"\", `Comparing with ${committish || \"initial commit\"}.`);\n+ log.info(\"\", `Looking for changed packages since ${committish || \"initial commit\"}.`);\n- const forced = getForcedPackages(forcePublish);\n+ const forced = getForcedPackages(commandOptions.forcePublish);\nlet candidates;\nif (!committish || forced.has(\"*\")) {\n@@ -49,8 +42,8 @@ function collectUpdates({\n} else {\ncandidates = new Set();\n- const hasDiff = makeDiffPredicate(committish, execOpts, ignoreChanges);\n- const needsBump = (cdVersion || \"\").startsWith(\"pre\")\n+ const hasDiff = makeDiffPredicate(committish, execOpts, commandOptions.ignoreChanges);\n+ const needsBump = (commandOptions.cdVersion || \"\").startsWith(\"pre\")\n? () => false\n: /* skip packages that have not been previously prereleased */\nnode => semver.prerelease(node.version);\n@@ -70,7 +63,7 @@ function collectUpdates({\npackages.forEach((node, name) => {\nif (candidates.has(node)) {\n- logger.verbose(\"updated\", name);\n+ log.verbose(\"updated\", name);\nupdates.push(node);\n}\n", "new_path": "utils/collect-updates/collect-updates.js", "old_path": "utils/collect-updates/collect-updates.js" } ]
JavaScript
MIT License
lerna/lerna
refactor(collect-updates): Make argument signature explicit BREAKING CHANGE: Instead of an opaque command instance, distinct positional arguments are required.
1
refactor
collect-updates
730,413
19.07.2018 12:37:21
14,400
63293f81e535de143900350ee0b6f4e02c49b981
refactor(widget-demo): update branding for widget demo
[ { "change_type": "MODIFY", "diff": "@@ -61,15 +61,15 @@ class DemoWidget extends Component {\nswitch (this.state.mode) {\ncase MODE_ONE_ON_ONE:\nariaLabel = 'To User Email';\n- placeholder = 'Spark User Email (For 1:1)';\n+ placeholder = 'Webex Teams User Email (For 1:1)';\nbreak;\ncase MODE_ONE_ON_ONE_ID:\nariaLabel = 'To User Id';\n- placeholder = 'Spark User Id (For 1:1)';\n+ placeholder = 'Webex Teams User Id (For 1:1)';\nbreak;\ncase MODE_SPACE:\nariaLabel = 'To Space ID';\n- placeholder = 'Spark Space Id';\n+ placeholder = 'Webex Teams Space Id';\nbreak;\ndefault: {\nariaLabel = 'unknown mode';\n@@ -248,17 +248,17 @@ class DemoWidget extends Component {\n/* eslint-disable max-len */\nreturn (\n<div>\n- <AppBar title=\"Cisco Spark Widget\" />\n+ <AppBar title=\"Webex Teams Widget\" />\n<div className={classNames('ciscospark-demo-wrapper', styles.demoWrapper)}>\n<Card initiallyExpanded style={{margin: '10px'}}>\n<CardTitle\nactAsExpander\nshowExpandableButton\n- subtitle=\"The Cisco Spark widgets allow developers to easily incorporate Cisco Spark Widgets into an application.\"\n- title=\"Cisco Spark Widget Demo\"\n+ subtitle=\"The Webex Teams widgets allow developers to easily incorporate Webex Teams Widgets into an application.\"\n+ title=\"Webex Teams Widget Demo\"\n/>\n<CardText expandable>\n- Our widgets are built using <a href=\"https://github.com/facebook/react\">React</a>, <a href=\"https://github.com/reactjs/redux\">Redux</a>, and the <a href=\"https://github.com/webex/spark-js-sdk\">Spark Javascript SDK </a>.\n+ Our widgets are built using <a href=\"https://github.com/facebook/react\">React</a>, <a href=\"https://github.com/reactjs/redux\">Redux</a>, and the <a href=\"https://github.com/webex/spark-js-sdk\">Webex Teams Javascript SDK </a>.\n</CardText>\n</Card>\n<TokenInput onLogin={this.handleAccessTokenChange} token={this.state.accessToken} tokenType={this.state.accessTokenType} />\n@@ -266,8 +266,8 @@ class DemoWidget extends Component {\n<CardTitle\nactAsExpander\nshowExpandableButton\n- subtitle=\"Cisco Spark Space Widget can open to a space or person.\"\n- title=\"Cisco Spark Space Widget\"\n+ subtitle=\"Webex Teams Space Widget can open to a space or person.\"\n+ title=\"Webex Teams Space Widget\"\n/>\n<CardText expandable>\n<h3> Widget Destination Type </h3>\n@@ -403,7 +403,7 @@ class DemoWidget extends Component {\n<CardTitle\nactAsExpander\nshowExpandableButton\n- title=\"Cisco Spark Recents Widget Demo\"\n+ title=\"Webex Teams Recents Widget Demo\"\n/>\n<CardActions expandable>\n<RaisedButton\n", "new_path": "packages/node_modules/@ciscospark/widget-demo/src/components/demo-widget/index.js", "old_path": "packages/node_modules/@ciscospark/widget-demo/src/components/demo-widget/index.js" }, { "change_type": "MODIFY", "diff": "@@ -63,8 +63,8 @@ class TokenInput extends Component {\n<CardTitle\nactAsExpander\nshowExpandableButton\n- subtitle=\"Spark Widgets require an access token to identify the current user.\"\n- title=\"Cisco Spark Access Token\"\n+ subtitle=\"Webex Teams Widgets require an access token to identify the current user.\"\n+ title=\"Webex Teams Access Token\"\n/>\n{!this.state.tokenSaved &&\n<CardText expandable>\n", "new_path": "packages/node_modules/@ciscospark/widget-demo/src/components/token-input/index.js", "old_path": "packages/node_modules/@ciscospark/widget-demo/src/components/token-input/index.js" }, { "change_type": "MODIFY", "diff": "<!DOCTYPE html>\n<html>\n<head>\n- <title>Cisco Spark Widget Demo</title>\n+ <title>Webex Teams Widget Demo</title>\n<meta charset=\"utf8\"/>\n<style>\nbody {\n", "new_path": "packages/node_modules/@ciscospark/widget-demo/src/index.html", "old_path": "packages/node_modules/@ciscospark/widget-demo/src/index.html" } ]
JavaScript
MIT License
webex/react-widgets
refactor(widget-demo): update branding for widget demo
1
refactor
widget-demo
807,849
19.07.2018 14:23:11
25,200
8b4c5de17e6d9d1472ab0556d9932783619163a1
refactor(publish): annotateGitHead() should map over packagesToPublish
[ { "change_type": "MODIFY", "diff": "@@ -257,13 +257,11 @@ class PublishCommand extends Command {\nannotateGitHead() {\nconst gitHead = getCurrentSHA(this.execOpts);\n- return pMap(this.updates, ({ pkg }) => {\n- if (!pkg.private) {\n+ return pMap(this.packagesToPublish, pkg => {\n// provide gitHead property that is normally added during npm publish\npkg.set(\"gitHead\", gitHead);\nreturn pkg.serialize();\n- }\n});\n}\n", "new_path": "commands/publish/index.js", "old_path": "commands/publish/index.js" } ]
JavaScript
MIT License
lerna/lerna
refactor(publish): annotateGitHead() should map over packagesToPublish
1
refactor
publish
679,913
19.07.2018 14:36:17
-3,600
787014938fd689cb716602e97a135d8818973473
feat(examples): update axis ticks, add more symbols, refactor SMAs
[ { "change_type": "MODIFY", "diff": "@@ -51,13 +51,16 @@ export const TIMEFRAMES = {\n// supported symbol pairs\nconst SYMBOL_PAIRS: DropDownOption[] = [\n+ [\"ADAUSD\", \"ADA-USD\"],\n[\"BTCUSD\", \"BTC-USD\"],\n[\"ETHUSD\", \"ETH-USD\"],\n[\"LTCUSD\", \"LTC-USD\"],\n+ [\"XLMUSD\", \"XLM-USD\"],\n+ [\"XMRUSD\", \"XMR-USD\"],\n];\n// chart settings\n-const MARGIN_X = 60;\n+const MARGIN_X = 80;\nconst MARGIN_Y = 50;\nconst DAY = 60 * 60 * 24;\n@@ -94,9 +97,10 @@ const THEMES = {\npricelabel: \"#fff\",\nbull: \"#6c0\",\nbear: \"#f04\",\n- sma12: \"#00f\",\n- sma24: \"#07f\",\n- sma50: \"#0ff\",\n+ sma12: \"#f90\",\n+ sma24: \"#0ff\",\n+ sma50: \"#06f\",\n+ sma72: \"#00f\",\ngridMajor: \"#666\",\ngridMinor: \"#ccc\",\n}\n@@ -107,13 +111,14 @@ const THEMES = {\nbody: \"white\",\nchart: {\naxis: \"#eee\",\n- price: \"#09f\",\n+ price: \"#f0f\",\npricelabel: \"#fff\",\n- bull: \"#6c0\",\n- bear: \"#f04\",\n+ bull: \"#0c4\",\n+ bear: \"#f02\",\nsma12: \"#ff0\",\n- sma24: \"#f70\",\n- sma50: \"#f07\",\n+ sma24: \"#0ff\",\n+ sma50: \"#06f\",\n+ sma72: \"#00f\",\ngridMajor: \"#666\",\ngridMinor: \"#333\",\n}\n@@ -144,13 +149,15 @@ const emitOnStream = (stream) => (e) => stream.next(e.target.value);\nconst market = new Stream();\nconst symbol = new Stream();\nconst period = new Stream();\n-const refresh = fromInterval(60000).subscribe(trace(\"refresh\"));\nconst theme = new Stream().transform(map((id: string) => THEMES[id]));\nconst error = new Stream();\n// I/O error handler\nerror.subscribe({ next: (e) => alert(`An error occurred:\\n${e}`) });\n+// data refresh trigger (once per minute)\n+const refresh = fromInterval(60000).subscribe(trace(\"refresh\"));\n+\n// this stream combinator performs API requests to obtain OHLC data\n// and if successful computes a number of statistics\nconst data = sync({\n@@ -175,9 +182,11 @@ const data = sync({\nmin: ({ ohlc }) => transduce(pluck(\"low\"), min(), ohlc),\nmax: ({ ohlc }) => transduce(pluck(\"high\"), max(), ohlc),\ntbounds: ({ ohlc }) => [ohlc[0].time, ohlc[ohlc.length - 1].time],\n- sma12: ({ ohlc }) => transduce(comp(pluck(\"close\"), movingAverage(12)), push(), ohlc),\n- sma24: ({ ohlc }) => transduce(comp(pluck(\"close\"), movingAverage(24)), push(), ohlc),\n- sma50: ({ ohlc }) => transduce(comp(pluck(\"close\"), movingAverage(50)), push(), ohlc)\n+ sma: ({ ohlc }) => transduce(\n+ map((period: number) => [period, transduce(comp(pluck(\"close\"), movingAverage(period)), push(), ohlc)]),\n+ push(),\n+ [12, 24, 50, 72]\n+ ),\n}))\n);\n@@ -195,19 +204,26 @@ const chart = sync({\nxform: map(({ data, window, theme }) => {\nlet [width, height] = window;\nconst ohlc = data.ohlc;\n- const w = (width - MARGIN_X) / ohlc.length;\n+ const w = Math.max(3, (width - 2 * MARGIN_X) / ohlc.length);\nconst by = height - MARGIN_Y;\nconst mapX = (x: number) => fit(x, 0, ohlc.length, MARGIN_X, width - MARGIN_X);\nconst mapY = (y: number) => fit(y, data.min, data.max, by, MARGIN_Y);\n+ // helper fn for plotting moving averages\nconst sma = (data: number[], smaPeriod: number, col: string) =>\n- polyline(data.map((y, x) => [mapX(x + smaPeriod + 0.5), mapY(y)]), { stroke: col, fill: \"none\" });\n+ polyline(\n+ data.map((y, x) => [mapX(x + smaPeriod + 0.5), mapY(y)]),\n+ { stroke: col, fill: \"none\" }\n+ );\n// use preset time precisions based on current chart period\nconst tickX = TIME_TICKS[data.period];\nconst fmtTime: (t: number) => string = TIME_FORMATS[data.period];\n// price resolution estimation based on actual OHLC interval\n- const tickY = Math.pow(10, Math.floor(Math.log(Math.round(data.max - data.min)) / Math.log(10))) / 2;\n+ let tickY = Math.pow(10, Math.floor(Math.log(data.max - data.min) / Math.log(10))) / 2;\n+ while (tickY < (data.max - data.min) / 20) {\n+ tickY *= 2;\n+ }\nconst lastPrice = ohlc[ohlc.length - 1].close;\nconst closeX = width - MARGIN_X;\nconst closeY = mapY(lastPrice);\n@@ -230,7 +246,7 @@ const chart = sync({\ntheme.chart.gridMinor,\n\"stroke-dasharray\": 2\n}),\n- text(price.toFixed(2), [MARGIN_X - 15, y + 4], { stroke: \"none\" })\n+ text(price.toFixed(4), [MARGIN_X - 15, y + 4], { stroke: \"none\" })\n];\n}),\nrange(Math.ceil(data.min / tickY) * tickY, data.max, tickY)\n@@ -249,9 +265,10 @@ const chart = sync({\n),\n),\n// moving averages\n- sma(data.sma12, 12, theme.chart.sma12),\n- sma(data.sma24, 24, theme.chart.sma24),\n- sma(data.sma50, 50, theme.chart.sma50),\n+ ...iterator(\n+ map(([period, vals]) => sma(vals, period, theme.chart[`sma${period}`])),\n+ data.sma\n+ ),\n// candles\n...iterator(\nmapIndexed((i, candle: any) => {\n@@ -281,7 +298,7 @@ const chart = sync({\n[[closeX, closeY], [closeX + 10, closeY - 8], [width, closeY - 8], [width, closeY + 8], [closeX + 10, closeY + 8]],\n{ fill: theme.chart.price }\n),\n- text(lastPrice.toFixed(2), [closeX + 12, closeY + 4], { fill: theme.chart.pricelabel }),\n+ text(lastPrice.toFixed(4), [closeX + 12, closeY + 4], { fill: theme.chart.pricelabel }),\n)\n})\n});\n@@ -296,7 +313,7 @@ sync({\nmap((x: string) =>\ndropdown(\nnull,\n- { class: \"w4 mr3\", onchange: emitOnStream(symbol) },\n+ { class: \"w3 w4-ns mr2\", onchange: emitOnStream(symbol) },\nSYMBOL_PAIRS,\nx\n)\n@@ -307,7 +324,7 @@ sync({\nmap((x: string) =>\ndropdown(\nnull,\n- { class: \"w4 mr3\", onchange: emitOnStream(period) },\n+ { class: \"w3 w4-ns mr2\", onchange: emitOnStream(period) },\n[...pairs(TIMEFRAMES)],\nString(x)\n)\n@@ -317,8 +334,8 @@ sync({\nmap((sel) =>\ndropdown(\nnull,\n- { class: \"w4\", onchange: emitOnStream(theme) },\n- Object.keys(THEMES).map((k) => <DropDownOption>[k, k + \" theme\"]),\n+ { class: \"w3 w4-ns\", onchange: emitOnStream(theme) },\n+ Object.keys(THEMES).map((k) => <DropDownOption>[k, k]),\nsel.id\n)\n)\n@@ -333,9 +350,10 @@ sync({\nchart,\n[\"div.fixed.f7\",\n{ style: { top: `10px`, right: `${MARGIN_X}px` } },\n+ [\"span.dn.dib-l\",\n[\"a\",\n{\n- class: `dn dib-l mr3 b link ${theme.body}`,\n+ class: `mr3 b link ${theme.body}`,\nhref: \"https://min-api.cryptocompare.com/\"\n},\n\"Data by cyptocompare.com\"],\n@@ -343,7 +361,8 @@ sync({\n{\nclass: `mr3 b link ${theme.body}`,\nhref: \"https://github.com/thi-ng/umbrella/tree/master/examples/crypto-chart/\"\n- }, \"Source code\"],\n+ }, \"Source code\"]\n+ ],\nsymbol,\nperiod,\nthemeSel,\n", "new_path": "examples/crypto-chart/src/index.ts", "old_path": "examples/crypto-chart/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(examples): update axis ticks, add more symbols, refactor SMAs
1
feat
examples
679,913
19.07.2018 14:47:01
-3,600
1fe612de8cb025ad816c4169d4b0ee2473c085f1
docs(transducers): reapply MD fixes
[ { "change_type": "MODIFY", "diff": "This project is part of the\n[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.\n-## TOC\n+<!-- TOC depthFrom:2 depthTo:2 -->\n+- [About](#about)\n- [Installation](#installation)\n+- [Dependencies](#dependencies)\n- [Usage examples](#usage-examples)\n- [API](#api)\n- - [Types](#types)\n- - [Transformations](#transformations)\n- - [Transducers](#transducers)\n- - [Reducers](#reducers)\n- - [Generators & iterators](#generators--iterators)\n+- [Authors](#authors)\n- [License](#license)\n+<!-- /TOC -->\n+\n## About\nThis library provides altogether 130+ transducers, reducers, sequence\n@@ -66,7 +66,7 @@ directory.**\nAlmost all functions can be imported selectively, but for development\npurposes full module re-exports are defined.\n-```typescript\n+```ts\n// full import\nimport * as tx from \"@thi.ng/transducers\";\n@@ -78,7 +78,7 @@ import { map } from \"@thi.ng/transducers/xforms/map\";\n### Basic usage patterns\n-```typescript\n+```ts\n// compose transducer\nxform = tx.comp(\ntx.filter(x => (x & 1) > 0), // odd numbers only\n@@ -136,7 +136,7 @@ f = tx.step(take)\n### Histogram generation & result grouping\n-```typescript\n+```ts\n// use the `frequencies` reducer to create\n// a map counting occurrence of each value\ntx.transduce(tx.map(x => x.toUpperCase()), tx.frequencies(), \"hello world\")\n@@ -169,7 +169,7 @@ tx.reduce(\n### Pagination\n-```typescript\n+```ts\n// extract only items for given page id & page length\n[...tx.iterator(tx.page(0, 5), tx.range(12))]\n// [ 0, 1, 2, 3, 4 ]\n@@ -194,7 +194,7 @@ tx.reduce(\nparallel using the provided transducers (which can be composed as usual)\nand results in a tuple or keyed object.\n-```typescript\n+```ts\ntx.transduce(\ntx.multiplex(\ntx.map(x => x.charAt(0)),\n@@ -222,7 +222,7 @@ tx.transduce(\n### Moving average using sliding window\n-```typescript\n+```ts\n// use nested reduce to compute window averages\ntx.transduce(\ntx.comp(\n@@ -245,7 +245,7 @@ tx.transduce(\n### Benchmark function execution time\n-```typescript\n+```ts\n// function to test\nfn = () => { for(i=0; i<1e6; i++) let x =Math.cos(i); return x; };\n@@ -260,7 +260,7 @@ tx.transduce(\n### Apply inspectors to debug transducer pipeline\n-```typescript\n+```ts\n// alternatively, use tx.sideEffect() for any side fx\ntx.transduce(\ntx.comp(\n@@ -290,7 +290,7 @@ The `struct` transducer is simply a composition of: `partitionOf ->\npartition -> rename -> mapKeys`. [See code\nhere](https://github.com/thi-ng/umbrella/tree/master/packages/transducers/src/xform/struct.ts).\n-```typescript\n+```ts\n// Higher-order transducer to convert linear input into structured objects\n// using given field specs and ordering. A single field spec is an array of\n// 2 or 3 items: `[name, size, transform?]`. If `transform` is given, it will\n@@ -311,7 +311,7 @@ here](https://github.com/thi-ng/umbrella/tree/master/packages/transducers/src/xf\n### CSV parsing\n-```typescript\n+```ts\ntx.transduce(\ntx.comp(\n// split into rows\n@@ -331,7 +331,7 @@ tx.transduce(\n### Early termination\n-```typescript\n+```ts\n// result is realized after max. 7 values, irrespective of nesting\ntx.transduce(\ntx.comp(tx.flatten(), tx.take(7)),\n@@ -343,7 +343,7 @@ tx.transduce(\n### Scan operator\n-```typescript\n+```ts\n// this transducer uses 2 scans (a scan = inner reducer per item)\n// 1) counts incoming values\n// 2) forms an array of the current counter value `x` & repeated `x` times\n@@ -374,7 +374,7 @@ This is a higher-order transducer, purely composed from other\ntransducers. [See code\nhere](https://github.com/thi-ng/umbrella/tree/master/packages/transducers/src/xform/hex-dump.ts).\n-```typescript\n+```ts\nsrc = [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 33, 48, 49, 50, 51, 126, 122, 121, 120]\n[...iterator(hexDump(8, 0x400), src)]\n@@ -385,7 +385,7 @@ src = [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 33, 48, 49, 50, 51, 126, 122, 121\n### Bitstream\n-```typescript\n+```ts\n[...tx.iterator(tx.bits(8), [ 0xf0, 0xaa ])]\n// [ 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0 ]\n@@ -409,7 +409,7 @@ src = [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 33, 48, 49, 50, 51, 126, 122, 121\n### Base64 & UTF-8 en/decoding\n-```typescript\n+```ts\n// add offset (0x80) to allow negative values to be encoded\n// (URL safe result can be produced via opt arg to `base64Encode`)\nenc = tx.transduce(\n@@ -445,7 +445,7 @@ tx.transduce(tx.comp(tx.base64Decode(), tx.utf8Decode()), tx.str(), buf)\n### Weighted random choices\n-```typescript\n+```ts\ntx.transduce(tx.take(10), tx.push(), tx.choices(\"abcd\", [1, 0.5, 0.25, 0.125]))\n// [ 'a', 'a', 'b', 'a', 'a', 'b', 'a', 'c', 'd', 'b' ]\n@@ -475,7 +475,7 @@ provide a uniform API (and some of them can be preconfigured and/or are\nstateful closures). However, it's fine to define stateless reducers as\nconstant arrays.\n-```typescript\n+```ts\ninterface Reducer<A, B> extends Array<any> {\n/**\n* Initialization, e.g. to provide a suitable accumulator value,\n@@ -510,7 +510,7 @@ of) transducers making use of their 1-arity completing function.\n#### Reduced\n-```typescript\n+```ts\nclass Reduced<T> implements IDeref<T> {\nprotected value: T;\nconstructor(val: T);\n@@ -540,7 +540,7 @@ As shown in the examples above, transducers can be dynamically composed\n(using `comp()`) to form arbitrary data transformation pipelines without\ncausing large overheads for intermediate collections.\n-```typescript\n+```ts\ntype Transducer<A, B> = (rfn: Reducer<any, B>) => Reducer<any, A>;\n// concrete example of stateless transducer (expanded for clarity)\n", "new_path": "packages/transducers/README.md", "old_path": "packages/transducers/README.md" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
docs(transducers): reapply MD fixes
1
docs
transducers
217,922
19.07.2018 15:24:02
-7,200
e9502f3901d705313ee4e50e14fdddbfde334b50
chore: added team icon when a list is attached to a given team.
[ { "change_type": "MODIFY", "diff": "<div class=\"header-container\">\n<div class=\"title-and-desc\">\n<mat-panel-title [ngClass]=\"{'mobile': isMobile()}\">\n- <span [ngClass]=\"{'title':true}\">\n+ <mat-icon *ngIf=\"team$ | async as team\"\n+ [matTooltip]=\"team.name\"\n+ matTooltipPosition=\"above\"\n+ class=\"team-icon\">people_outline\n+ </mat-icon>\n+ <span class=\"title\">\n{{list.name}} - {{list.recipes===undefined?0:list.recipes.length}}&nbsp;{{'items' | translate}}\n</span>\n<mat-icon *ngIf=\"list.ephemeral\" matTooltip=\"{{'Ephemeral_list' | translate}}\"\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": "white-space: nowrap;\nflex: 0 0 auto;\nwidth: 25%;\n+ .team-icon {\n+ margin-right: 5px;\n+ }\n.title {\noverflow: hidden;\ntext-overflow: ellipsis;\n", "new_path": "src/app/modules/common-components/list-panel/list-panel.component.scss", "old_path": "src/app/modules/common-components/list-panel/list-panel.component.scss" }, { "change_type": "MODIFY", "diff": "@@ -15,11 +15,13 @@ import {ListTemplate} from '../../../core/database/list-template/list-template';\nimport {ListTemplateService} from '../../../core/database/list-template/list-template.service';\nimport {TemplatePopupComponent} from '../../../pages/template/template-popup/template-popup.component';\nimport {PermissionsPopupComponent} from '../permissions-popup/permissions-popup.component';\n-import {catchError, filter, first, map, mergeMap} from 'rxjs/operators';\n+import {catchError, filter, first, map, mergeMap, shareReplay} from 'rxjs/operators';\nimport {ListRow} from '../../../model/list/list-row';\nimport {LinkToolsService} from '../../../core/tools/link-tools.service';\nimport {ListTag} from '../../../model/list/list-tag.enum';\nimport {ListTagsPopupComponent} from '../../../pages/list/list-tags-popup/list-tags-popup.component';\n+import {TeamService} from '../../../core/database/team.service';\n+import {Team} from '../../../model/other/team';\n@Component({\nselector: 'app-list-panel',\n@@ -82,10 +84,13 @@ export class ListPanelComponent extends ComponentWithSubscriptions implements On\npublic tags: ListTag[];\n+ public team$: Observable<Team>;\n+\nconstructor(private snack: MatSnackBar, private translator: TranslateService,\nprivate listService: ListService, private translate: TranslateService, private media: ObservableMedia,\nprivate router: Router, private auth: AngularFireAuth, private userService: UserService,\n- private dialog: MatDialog, private templateService: ListTemplateService, private linkTools: LinkToolsService) {\n+ private dialog: MatDialog, private templateService: ListTemplateService, private linkTools: LinkToolsService,\n+ private teamService: TeamService) {\nsuper();\n}\n@@ -197,6 +202,13 @@ export class ListPanelComponent extends ComponentWithSubscriptions implements On\nthis.userNickname = u.nickname;\nthis.anonymous = u.anonymous;\n});\n+\n+ this.team$ = of(this.list.teamId)\n+ .pipe(\n+ filter(teamId => teamId !== undefined),\n+ mergeMap(teamId => this.teamService.get(teamId)),\n+ shareReplay()\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
chore: added team icon when a list is attached to a given team.
1
chore
null