author int64 4.98k 943k | date stringdate 2017-04-15 16:45:02 2022-02-25 15:32:15 | timezone int64 -46,800 39.6k | hash stringlengths 40 40 | message stringlengths 8 468 | mods listlengths 1 16 | language stringclasses 9 values | license stringclasses 2 values | repo stringclasses 119 values | original_message stringlengths 12 491 | is_CCS int64 1 1 | commit_type stringclasses 129 values | commit_scope stringlengths 1 44 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
807,849 | 19.07.2018 16:17:23 | 25,200 | bcc5e0f03eba1c684e421000dfb66769531faad6 | chore(helpers): add format option to getCommitMessage() | [
{
"change_type": "MODIFY",
"diff": "@@ -4,6 +4,6 @@ const execa = require(\"execa\");\nmodule.exports = getCommitMessage;\n-function getCommitMessage(cwd) {\n- return execa(\"git\", [\"show\", \"--no-patch\", \"--pretty=%B\"], { cwd }).then(result => result.stdout.trim());\n+function getCommitMessage(cwd, format = \"%B\") {\n+ return execa.stdout(\"git\", [\"log\", \"-1\", `--pretty=format:${format}`], { cwd });\n}\n",
"new_path": "helpers/get-commit-message/index.js",
"old_path": "helpers/get-commit-message/index.js"
}
] | JavaScript | MIT License | lerna/lerna | chore(helpers): add format option to getCommitMessage() | 1 | chore | helpers |
791,690 | 19.07.2018 19:33:00 | 25,200 | b38ecab3277cb8207847e7adf4a1a7e420b11d90 | core(network-analyzer): infer RTT from receiveHeadersEnd | [
{
"change_type": "MODIFY",
"diff": "const INITIAL_CWD = 14 * 1024;\nconst NetworkRequest = require('../../network-request');\n+// Assume that 40% of TTFB was server response time by default for static assets\n+const DEFAULT_SERVER_RESPONSE_PERCENTAGE = 0.4;\n+\n+// For certain resource types, server response time takes up a greater percentage of TTFB (dynamic\n+// assets like HTML documents, XHR/API calls, etc)\n+const SERVER_RESPONSE_PERCENTAGE_OF_TTFB = {\n+ Document: 0.9,\n+ XHR: 0.9,\n+ Fetch: 0.9,\n+};\n+\nclass NetworkAnalyzer {\n/**\n* @return {string}\n@@ -149,7 +160,7 @@ class NetworkAnalyzer {\n* Estimates the observed RTT to each origin based on how long it took until Chrome could\n* start sending the actual request when a new connection was required.\n* NOTE: this will tend to overestimate the actual RTT as the request can be delayed for other\n- * reasons as well such as DNS lookup.\n+ * reasons as well such as more SSL handshakes if TLS False Start is not enabled.\n*\n* @param {LH.Artifacts.NetworkRequest[]} records\n* @return {Map<string, number[]>}\n@@ -159,14 +170,48 @@ class NetworkAnalyzer {\nif (connectionReused) return;\nif (!Number.isFinite(timing.sendStart) || timing.sendStart < 0) return;\n- // Assume everything before sendStart was just a TCP handshake\n- // 1 RT needed for http, 2 RTs for https\n- let roundTrips = 1;\n+ // Assume everything before sendStart was just DNS + (SSL)? + TCP handshake\n+ // 1 RT for DNS, 1 RT (maybe) for SSL, 1 RT for TCP\n+ let roundTrips = 2;\nif (record.parsedURL.scheme === 'https') roundTrips += 1;\nreturn timing.sendStart / roundTrips;\n});\n}\n+ /**\n+ * Estimates the observed RTT to each origin based on how long it took until Chrome received the\n+ * headers of the response (~TTFB).\n+ * NOTE: this is the most inaccurate way to estimate the RTT, but in some environments it's all\n+ * we have access to :(\n+ *\n+ * @param {LH.Artifacts.NetworkRequest[]} records\n+ * @return {Map<string, number[]>}\n+ */\n+ static _estimateRTTByOriginViaHeadersEndTiming(records) {\n+ return NetworkAnalyzer._estimateValueByOrigin(records, ({record, timing, connectionReused}) => {\n+ if (!Number.isFinite(timing.receiveHeadersEnd) || timing.receiveHeadersEnd < 0) return;\n+\n+ const serverResponseTimePercentage = SERVER_RESPONSE_PERCENTAGE_OF_TTFB[record.resourceType]\n+ || DEFAULT_SERVER_RESPONSE_PERCENTAGE;\n+ const estimatedServerResponseTime = timing.receiveHeadersEnd * serverResponseTimePercentage;\n+\n+ // When connection was reused...\n+ // TTFB = 1 RT for request + server response time\n+ let roundTrips = 1;\n+\n+ // When connection was fresh...\n+ // TTFB = DNS + (SSL)? + TCP handshake + 1 RT for request + server response time\n+ if (!connectionReused) {\n+ roundTrips += 1; // DNS\n+ if (record.parsedURL.scheme === 'https') roundTrips += 1; // SSL\n+ roundTrips += 1; // TCP handshake\n+ }\n+\n+ // subtract out our estimated server response time\n+ return Math.max((timing.receiveHeadersEnd - estimatedServerResponseTime) / roundTrips, 3);\n+ });\n+ }\n+\n/**\n* Given the RTT to each origin, estimates the observed server response times.\n*\n@@ -264,7 +309,11 @@ class NetworkAnalyzer {\nforceCoarseEstimates: false,\n// coarse estimates include lots of extra time and noise\n// multiply by some factor to deflate the estimates a bit\n- coarseEstimateMultiplier: 0.5,\n+ coarseEstimateMultiplier: 0.3,\n+ // useful for testing to isolate the different methods of estimation\n+ useDownloadEstimates: true,\n+ useSendStartEstimates: true,\n+ useHeadersEndEstimates: true,\n},\noptions\n);\n@@ -274,12 +323,21 @@ class NetworkAnalyzer {\nestimatesByOrigin = new Map();\nconst estimatesViaDownload = NetworkAnalyzer._estimateRTTByOriginViaDownloadTiming(records);\nconst estimatesViaSendStart = NetworkAnalyzer._estimateRTTByOriginViaSendStartTiming(records);\n+ const estimatesViaTTFB = NetworkAnalyzer._estimateRTTByOriginViaHeadersEndTiming(records);\nfor (const [origin, estimates] of estimatesViaDownload.entries()) {\n+ if (!options.useDownloadEstimates) continue;\nestimatesByOrigin.set(origin, estimates);\n}\nfor (const [origin, estimates] of estimatesViaSendStart.entries()) {\n+ if (!options.useSendStartEstimates) continue;\n+ const existing = estimatesByOrigin.get(origin) || [];\n+ estimatesByOrigin.set(origin, existing.concat(estimates));\n+ }\n+\n+ for (const [origin, estimates] of estimatesViaTTFB.entries()) {\n+ if (!options.useHeadersEndEstimates) continue;\nconst existing = estimatesByOrigin.get(origin) || [];\nestimatesByOrigin.set(origin, existing.concat(estimates));\n}\n",
"new_path": "lighthouse-core/lib/dependency-graph/simulator/network-analyzer.js",
"old_path": "lighthouse-core/lib/dependency-graph/simulator/network-analyzer.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -144,10 +144,10 @@ describe('DependencyGraph/Simulator/NetworkAnalyzer', () => {\n});\nit('should infer from sendStart when available', () => {\n- const timing = {sendStart: 100};\n- // this record took 100ms before Chrome could send the request\n+ const timing = {sendStart: 150};\n+ // this record took 150ms before Chrome could send the request\n// i.e. DNS (maybe) + queuing (maybe) + TCP handshake took ~100ms\n- // 100ms / 2 round trips ~= 50ms RTT\n+ // 150ms / 3 round trips ~= 50ms RTT\nconst record = createRecord({startTime: 0, endTime: 1, timing});\nconst result = NetworkAnalyzer.estimateRTTByOrigin([record], {coarseEstimateMultiplier: 1});\nconst expected = {min: 50, max: 50, avg: 50, median: 50};\n@@ -160,13 +160,31 @@ describe('DependencyGraph/Simulator/NetworkAnalyzer', () => {\n// i.e. it took at least one full additional roundtrip after first byte to download the rest\n// 1000ms / 1 round trip ~= 1000ms RTT\nconst record = createRecord({startTime: 0, endTime: 1.1, transferSize: 28 * 1024, timing});\n- const result = NetworkAnalyzer.estimateRTTByOrigin([record], {coarseEstimateMultiplier: 1});\n+ const result = NetworkAnalyzer.estimateRTTByOrigin([record], {\n+ coarseEstimateMultiplier: 1,\n+ useHeadersEndEstimates: false,\n+ });\nconst expected = {min: 1000, max: 1000, avg: 1000, median: 1000};\nassert.deepStrictEqual(result.get('https://example.com'), expected);\n});\n+ it('should infer from TTFB when available', () => {\n+ const timing = {receiveHeadersEnd: 1000};\n+ const record = createRecord({startTime: 0, endTime: 1, timing});\n+ const result = NetworkAnalyzer.estimateRTTByOrigin([record], {\n+ coarseEstimateMultiplier: 1,\n+ });\n+\n+ // this record's TTFB was 1000ms, it used SSL and was a fresh connection requiring a handshake\n+ // which needs ~4 RTs. We don't know its resource type so it'll be assumed that 40% of it was\n+ // server response time.\n+ // 600 ms / 4 = 150ms\n+ const expected = {min: 150, max: 150, avg: 150, median: 150};\n+ assert.deepStrictEqual(result.get('https://example.com'), expected);\n+ });\n+\nit('should handle untrustworthy connection information', () => {\n- const timing = {sendStart: 100};\n+ const timing = {sendStart: 150};\nconst recordA = createRecord({startTime: 0, endTime: 1, timing, connectionReused: true});\nconst recordB = createRecord({\nstartTime: 0,\n",
"new_path": "lighthouse-core/test/lib/dependency-graph/simulator/network-analyzer-test.js",
"old_path": "lighthouse-core/test/lib/dependency-graph/simulator/network-analyzer-test.js"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | core(network-analyzer): infer RTT from receiveHeadersEnd (#5694) | 1 | core | network-analyzer |
679,913 | 19.07.2018 21:12:55 | -3,600 | 7df3ce04d5d851b1bbe31c8fb240586c175f8ad7 | feat(transducers-stats): add other xforms
bollinger()
donchian()
hma()
rsi()
sd() | [
{
"change_type": "ADD",
"diff": "+import { Transducer } from \"@thi.ng/transducers/api\";\n+import { comp } from \"@thi.ng/transducers/func/comp\";\n+import { drop } from \"@thi.ng/transducers/xform/drop\";\n+import { map } from \"@thi.ng/transducers/xform/map\";\n+import { multiplex } from \"@thi.ng/transducers/xform/multiplex\";\n+import { partition } from \"@thi.ng/transducers/xform/partition\";\n+\n+import { mse } from \"./mse\";\n+import { sma } from \"./sma\";\n+\n+/**\n+ * Computes Bollinger bands using sliding window.\n+ *\n+ * https://en.wikipedia.org/wiki/Bollinger_Bands\n+ *\n+ * Note: the number of results will be `period-1` less than the\n+ * number of processed inputs and no outputs will be produced if there\n+ * were less than `period` input values.\n+ *\n+ * @param period\n+ */\n+export function bollinger(period = 20, sd = 2): Transducer<number, any> {\n+ return comp(\n+ multiplex(partition(period, 1), sma(period)),\n+ drop(period - 1),\n+ map(([window, mean]) => {\n+ const std = Math.sqrt(mse(window, mean) / period) * sd;\n+ const min = mean - std;\n+ const max = mean + std;\n+ const pb = (window[period - 1] - min) / (max - min);\n+ return { min, max, mean, pb };\n+ })\n+ );\n+};\n",
"new_path": "packages/transducers-stats/src/bollinger.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -4,7 +4,7 @@ import { partition } from \"@thi.ng/transducers/xform/partition\";\nimport { map } from \"@thi.ng/transducers/xform/map\";\n/**\n- * Computes min/max values for sliding window.\n+ * Computes Donchian channel, i.e. min/max values for sliding window.\n*\n* https://en.wikipedia.org/wiki/Donchian_channel\n*\n",
"new_path": "packages/transducers-stats/src/donchian.ts",
"old_path": "packages/transducers-stats/src/donchian.ts"
},
{
"change_type": "ADD",
"diff": "+import { Transducer } from \"@thi.ng/transducers/api\";\n+import { comp } from \"@thi.ng/transducers/func/comp\";\n+import { drop } from \"@thi.ng/transducers/xform/drop\";\n+import { map } from \"@thi.ng/transducers/xform/map\";\n+import { multiplex } from \"@thi.ng/transducers/xform/multiplex\";\n+\n+import { wma } from \"./wma\";\n+\n+/**\n+ * https://www.fidelity.com/learning-center/trading-investing/technical-analysis/technical-indicator-guide/hull-moving-average\n+ *\n+ * Note: the number of results will be:\n+ *\n+ * `period + floor(sqrt(period)) - 2`\n+ *\n+ * less than the number of processed inputs.\n+ *\n+ * @param weights period or array of weights\n+ */\n+export function hma(period: number): Transducer<number, any> {\n+ return comp(\n+ multiplex(wma(period / 2 | 0), wma(period)),\n+ drop(period - 1),\n+ map((w) => 2 * w[0] - w[1]),\n+ wma(Math.sqrt(period))\n+ );\n+};\n",
"new_path": "packages/transducers-stats/src/hma.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "+export * from \"./bollinger\";\nexport * from \"./donchian\";\nexport * from \"./ema\";\n+export * from \"./hma\";\nexport * from \"./momentum\";\nexport * from \"./roc\";\n+export * from \"./rsi\";\n+export * from \"./sd\";\nexport * from \"./sma\";\nexport * from \"./trix\";\nexport * from \"./wma\";\n",
"new_path": "packages/transducers-stats/src/index.ts",
"old_path": "packages/transducers-stats/src/index.ts"
},
{
"change_type": "ADD",
"diff": "+import { Transducer } from \"@thi.ng/transducers/api\";\n+import { comp } from \"@thi.ng/transducers/func/comp\";\n+import { drop } from \"@thi.ng/transducers/xform/drop\";\n+import { map } from \"@thi.ng/transducers/xform/map\";\n+import { multiplex } from \"@thi.ng/transducers/xform/multiplex\";\n+import { momentum } from \"./momentum\";\n+import { sma } from \"./sma\";\n+\n+/**\n+ * https://en.wikipedia.org/wiki/Relative_strength_index\n+ *\n+ * Note: the number of results will be `period` less than the\n+ * number of processed inputs and no outputs will be produced if there\n+ * were less than `period` input values.\n+ *\n+ * @param period\n+ */\n+export function rsi(period: number): Transducer<number, number> {\n+ return comp(\n+ momentum(1),\n+ multiplex(\n+ comp(map((x) => x > 0 ? x : 0), sma(period)),\n+ comp(map((x) => x < 0 ? -x : 0), sma(period)),\n+ ),\n+ drop(period - 1),\n+ map((hl) => 100 - 100 / (1 + hl[0] / Math.max(1e-6, hl[1])))\n+ );\n+};\n",
"new_path": "packages/transducers-stats/src/rsi.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { Transducer } from \"@thi.ng/transducers/api\";\n+import { comp } from \"@thi.ng/transducers/func/comp\";\n+import { drop } from \"@thi.ng/transducers/xform/drop\";\n+import { map } from \"@thi.ng/transducers/xform/map\";\n+import { multiplex } from \"@thi.ng/transducers/xform/multiplex\";\n+import { partition } from \"@thi.ng/transducers/xform/partition\";\n+\n+import { mse } from \"./mse\";\n+import { sma } from \"./sma\";\n+\n+/**\n+ * Moving standard deviation, calculates mean square error to SMA and\n+ * yields sequence of `sqrt(error / period)`.\n+ *\n+ * https://en.wikipedia.org/wiki/Bollinger_Bands\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 sd(period = 20, scale = 1): Transducer<number, any> {\n+ return comp(\n+ multiplex(partition(period, 1), sma(period)),\n+ drop(period - 1),\n+ map(([window, mean]) => Math.sqrt(mse(window, mean) / period) * scale)\n+ );\n+};\n",
"new_path": "packages/transducers-stats/src/sd.ts",
"old_path": null
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | feat(transducers-stats): add other xforms
- bollinger()
- donchian()
- hma()
- rsi()
- sd() | 1 | feat | transducers-stats |
679,913 | 19.07.2018 21:31:14 | -3,600 | e8009a68ceb83e136115ecf43b3437eded807c7e | docs(transducers-stats): update readme links | [
{
"change_type": "MODIFY",
"diff": "@@ -23,21 +23,21 @@ This package provides a set of\nfor [technical\n(financial)](https://en.wikipedia.org/wiki/Technical_indicator) and\nstatistical analysis and replaces the older\n-[@thi.ng/indicators](https://github.com/thi-ng/indicators).\n+[@thi.ng/indicators](https://github.com/thi-ng/indicators) package.\n## Supported indicators\n-- [Bollinger Bands](https://github.com/thi-ng/indicators/blob/master/src/bollinger.ts)\n-- [Donchian Channel](https://github.com/thi-ng/indicators/blob/master/src/donchian.ts)\n-- [EMA (Exponential Moving Average)](https://github.com/thi-ng/indicators/blob/master/src/ema.ts)\n-- [HMA (Hull Moving Average)](https://www.fidelity.com/learning-center/trading-investing/technical-analysis/technical-indicator-guide/hull-moving-average)\n-- [Momentum](https://github.com/thi-ng/indicators/blob/master/src/momentum.ts)\n-- [ROC (Rate of change)](https://github.com/thi-ng/indicators/blob/master/src/roc.ts)\n-- [RSI (Relative Strength Index)](https://github.com/thi-ng/indicators/blob/master/src/rsi.ts)\n-- [SD (Standard Deviation)](https://github.com/thi-ng/indicators/blob/master/src/sd.ts)\n-- [SMA (Simple Moving Average)](https://github.com/thi-ng/indicators/blob/master/src/sma.ts)\n-- [TRIX (Triple smoothed EMA)](https://github.com/thi-ng/indicators/blob/master/src/trix.ts)\n-- [WMA (Weighted Moving Average)](https://github.com/thi-ng/indicators/blob/master/src/wma.ts)\n+- [Bollinger Bands](./src/bollinger.ts)\n+- [Donchian Channel](./src/donchian.ts)\n+- [EMA (Exponential Moving Average)](./src/ema.ts)\n+- [HMA (Hull Moving Average)](./src/hma.ts)\n+- [Momentum](./src/momentum.ts)\n+- [ROC (Rate of change)](./src/roc.ts)\n+- [RSI (Relative Strength Index)](./src/rsi.ts)\n+- [SD (Standard Deviation)](./src/sd.ts)\n+- [SMA (Simple Moving Average)](./src/sma.ts)\n+- [TRIX (Triple smoothed EMA)](./src/trix.ts)\n+- [WMA (Weighted Moving Average)](./src/wma.ts)\n## Installation\n",
"new_path": "packages/transducers-stats/README.md",
"old_path": "packages/transducers-stats/README.md"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | docs(transducers-stats): update readme links | 1 | docs | transducers-stats |
217,927 | 19.07.2018 22:17:14 | 0 | f1e654734753c82be5254450a4127c3023923b7c | feat: add HQ material cost to total price popup
Displays a cost range where applicable, from the cost for all NQ mats to
the cost for all HQ mats. A single cost value is displayed for materials
that cannot be purchased as HQ. Fixed up change detection and console log. | [
{
"change_type": "MODIFY",
"diff": "@@ -388,7 +388,6 @@ export class List extends DataWithPermissions {\nhasAllBaseIngredients(item: ListRow, amount = item.amount): boolean {\n// If it's not a craft, break recursion\nif (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.\nreturn item.done >= amount;\n}\n",
"new_path": "src/app/model/list/list.ts",
"old_path": "src/app/model/list/list.ts"
},
{
"change_type": "MODIFY",
"diff": "mat-list-avatar>\n<app-item-icon [item]=\"{icon: row.currencyIcon, id: row.currencyId}\" mat-list-avatar\n*ngIf=\"row.currencyId > -1\"></app-item-icon>\n- <p matLine>{{row.amount}}</p>\n+ <p matLine>\n+ {{row.costs[0]}}\n+ <span *ngIf=\"row.costs.length > 1\">\n+ (NQ) - {{row.costs[1]}} (HQ)\n+ </span>\n+ </p>\n</mat-list-item>\n</mat-list>\n</div>\n",
"new_path": "src/app/pages/list/total-price-popup/total-price-popup.component.html",
"old_path": "src/app/pages/list/total-price-popup/total-price-popup.component.html"
},
{
"change_type": "MODIFY",
"diff": "+h3.mat-dialog-title {\n+ margin-bottom: 0;\n+}\n",
"new_path": "src/app/pages/list/total-price-popup/total-price-popup.component.scss",
"old_path": "src/app/pages/list/total-price-popup/total-price-popup.component.scss"
},
{
"change_type": "MODIFY",
"diff": "-import {Component, Inject, OnInit} from '@angular/core';\n+import {ChangeDetectionStrategy, Component, Inject, OnInit} from '@angular/core';\nimport {ListRow} from '../../../model/list/list-row';\nimport {MAT_DIALOG_DATA} from '@angular/material';\nimport {TradeSource} from '../../../model/list/trade-source';\n@@ -7,7 +7,8 @@ import {ItemComponent} from '../../../modules/item/item/item.component';\n@Component({\nselector: 'app-total-price-popup',\ntemplateUrl: './total-price-popup.component.html',\n- styleUrls: ['./total-price-popup.component.scss']\n+ styleUrls: ['./total-price-popup.component.scss'],\n+ changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TotalPricePopupComponent implements OnInit {\n@@ -30,25 +31,31 @@ export class TotalPricePopupComponent implements OnInit {\n// We'll use -1 as currencyId for gil.\nconst gilsRow = result.find(r => r.currencyId === -1);\nif (gilsRow === undefined) {\n- result.push({currencyId: -1, currencyIcon: -1, amount: vendor.price * (row.amount - row.done)});\n+ result.push({currencyId: -1, currencyIcon: -1, costs: [vendor.price * (row.amount - row.done)]});\n} else {\n- gilsRow.amount += vendor.price * (row.amount - row.done);\n+ gilsRow.costs[0] += vendor.price * (row.amount - row.done);\n}\n});\n} else if (row.tradeSources !== undefined && row.tradeSources.length > 0) {\nconst tradeSource = this.getTradeSourceByPriority(row.tradeSources);\n- const trade = tradeSource.trades.sort((ta, tb) => ta.currencyAmount / ta.itemAmount - tb.currencyAmount / tb.itemAmount)[0];\n+ const trade = tradeSource.trades[0];\n+ const costs = tradeSource.trades.sort((ta, tb) => ta.itemHQ ? 1 : 0).map(t => {\n+ return t.currencyAmount * (row.amount - row.done);\n+ });\nconst tradeRow = result.find(r => r.currencyId === trade.currencyId);\n+\nif (tradeRow === undefined) {\nresult.push({\ncurrencyId: trade.currencyId,\ncurrencyIcon: trade.currencyIcon,\n- amount: trade.currencyAmount * (row.amount - row.done)\n+ costs: costs\n});\n} else {\n- tradeRow.amount += trade.currencyAmount * (row.amount - row.done);\n+ tradeRow.costs[0] += costs[0];\n+ tradeRow.costs[1] += costs[1];\n}\n}\n+\nreturn result;\n}, []);\n}\n",
"new_path": "src/app/pages/list/total-price-popup/total-price-popup.component.ts",
"old_path": "src/app/pages/list/total-price-popup/total-price-popup.component.ts"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | feat: add HQ material cost to total price popup
Displays a cost range where applicable, from the cost for all NQ mats to
the cost for all HQ mats. A single cost value is displayed for materials
that cannot be purchased as HQ. Fixed up change detection and console log. | 1 | feat | null |
217,927 | 19.07.2018 22:31:44 | 0 | 9b517c569c2bb7ae57bc83521b215e208eae90e4 | refactor: list and simulator tweaks
Updates the venture amounts logic to handle cases where the amounts are
present in the GT API but the required stats are not. Previously this
failed and the venture level/job were not displayed. Updates the change
recipe button in the simulator to disable instead of being hidden. | [
{
"change_type": "MODIFY",
"diff": "@@ -20,12 +20,16 @@ export class VentureDetailsPopupComponent {\n}\nventureAmounts(venture: Venture): any[] {\n+ let amounts = [];\n+\nif (venture.amounts !== undefined) {\nconst stats = venture.ilvl || venture.gathering;\nconst name = venture.ilvl ? 'filters/ilvl' : 'Gathering';\n- return stats.map((stat, i) => ({ name: name, stat: stat, quantity: venture.amounts[i]}));\n- } else {\n- return [];\n+ if (stats) {\n+ amounts = stats.map((stat, i) => ({ name: name, stat: stat, quantity: venture.amounts[i]}));\n+ }\n}\n+\n+ return amounts;\n}\n}\n",
"new_path": "src/app/modules/item/venture-details-popup/venture-details-popup.component.ts",
"old_path": "src/app/modules/item/venture-details-popup/venture-details-popup.component.ts"
},
{
"change_type": "MODIFY",
"diff": "</a>\n<mat-card-title *ngIf=\"itemId !== undefined\">\n{{itemId | itemName | i18n}}\n- <button mat-icon-button (click)=\"changeRecipe()\" *ngIf=\"rotation !== undefined && !dirty\">\n+ <button mat-icon-button (click)=\"changeRecipe()\" [disabled]=\"rotation === undefined || dirty\">\n<mat-icon>swap_horiz</mat-icon>\n</button>\n</mat-card-title>\n",
"new_path": "src/app/pages/simulator/components/simulator/simulator.component.html",
"old_path": "src/app/pages/simulator/components/simulator/simulator.component.html"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | refactor: list and simulator tweaks
Updates the venture amounts logic to handle cases where the amounts are
present in the GT API but the required stats are not. Previously this
failed and the venture level/job were not displayed. Updates the change
recipe button in the simulator to disable instead of being hidden. | 1 | refactor | null |
807,849 | 20.07.2018 10:19:17 | 25,200 | f4430a345f9df16d3bc8b365c03da81bb93cacda | refactor(publish): rootPkg -> this.project.manifest | [
{
"change_type": "MODIFY",
"diff": "@@ -675,13 +675,12 @@ class PublishCommand extends Command {\nconst tracker = this.logger.newItem(\"npmPublish\");\n// if we skip temp tags we should tag with the proper value immediately\nconst distTag = this.options.tempTag ? \"lerna-temp\" : this.getDistTag();\n- const rootPkg = this.project.manifest;\nlet chain = Promise.resolve();\nchain = chain.then(() => createTempLicenses(this.project.licensePath, this.packagesToBeLicensed));\n- chain = chain.then(() => this.runPrepublishScripts(rootPkg));\n+ chain = chain.then(() => this.runPrepublishScripts(this.project.manifest));\nchain = chain.then(() =>\npMap(this.updates, ({ pkg }) => {\nif (this.options.requireScripts) {\n@@ -710,7 +709,7 @@ class PublishCommand extends Command {\n};\nchain = chain.then(() => runParallelBatches(this.batchedPackages, this.concurrency, mapPackage));\n- chain = chain.then(() => this.runPackageLifecycle(rootPkg, \"postpublish\"));\n+ chain = chain.then(() => this.runPackageLifecycle(this.project.manifest, \"postpublish\"));\nchain = chain.then(() => removeTempLicenses(this.packagesToBeLicensed));\n// remove temporary license files if _any_ error occurs _anywhere_ in the promise chain\n",
"new_path": "commands/publish/index.js",
"old_path": "commands/publish/index.js"
}
] | JavaScript | MIT License | lerna/lerna | refactor(publish): rootPkg -> this.project.manifest | 1 | refactor | publish |
807,849 | 20.07.2018 12:55:25 | 25,200 | 488f98d9734987dd2e0c2c0fca3caf973378f26a | feat(run-lifecycle): Encapsulate npm-conf with createRunner() factory | [
{
"change_type": "MODIFY",
"diff": "\"use strict\";\nconst mockRunLifecycle = jest.fn(() => Promise.resolve());\n+const mockCreateRunner = jest.fn(() => (pkg, stage) => {\n+ if (pkg.scripts[stage]) {\n+ return mockRunLifecycle(pkg, stage);\n+ }\n+\n+ return Promise.resolve();\n+});\nfunction getOrderedCalls() {\nreturn mockRunLifecycle.mock.calls.map(([pkg, script]) => [pkg.name, script]);\n}\nmodule.exports = mockRunLifecycle;\n+module.exports.createRunner = mockCreateRunner;\nmodule.exports.getOrderedCalls = getOrderedCalls;\n",
"new_path": "commands/__mocks__/@lerna/run-lifecycle.js",
"old_path": "commands/__mocks__/@lerna/run-lifecycle.js"
},
{
"change_type": "MODIFY",
"diff": "\"@lerna/run-lifecycle\": {\n\"version\": \"file:utils/run-lifecycle\",\n\"requires\": {\n+ \"@lerna/npm-conf\": \"file:utils/npm-conf\",\n\"npm-lifecycle\": \"^2.0.0\",\n\"npmlog\": \"^4.1.2\"\n}\n",
"new_path": "package-lock.json",
"old_path": "package-lock.json"
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+jest.mock(\"npm-lifecycle\", () => jest.fn(() => Promise.resolve()));\n+\n+const loggingOutput = require(\"@lerna-test/logging-output\");\n+const npmLifecycle = require(\"npm-lifecycle\");\n+const npmConf = require(\"@lerna/npm-conf\");\n+const runLifecycle = require(\"../run-lifecycle\");\n+\n+describe(\"default export\", () => {\n+ it(\"calls npm-lifecycle with prepared arguments\", async () => {\n+ const pkg = {\n+ name: \"test-name\",\n+ version: \"1.0.0-test\",\n+ location: \"test-location\",\n+ };\n+ const stage = \"preversion\";\n+ const config = npmConf({ \"custom-cli-flag\": true });\n+\n+ await runLifecycle(pkg, stage, config);\n+\n+ expect(npmLifecycle).lastCalledWith(\n+ expect.objectContaining({\n+ name: pkg.name,\n+ version: pkg.version,\n+ location: pkg.location,\n+ _id: `${pkg.name}@${pkg.version}`,\n+ }),\n+ stage,\n+ pkg.location,\n+ expect.objectContaining({\n+ config: expect.objectContaining({\n+ prefix: pkg.location,\n+ \"custom-cli-flag\": true,\n+ }),\n+ dir: pkg.location,\n+ failOk: false,\n+ log: expect.any(Object),\n+ unsafePerm: true,\n+ })\n+ );\n+ });\n+});\n+\n+describe(\"createRunner\", () => {\n+ const runPackageLifecycle = runLifecycle.createRunner({ \"other-cli-flag\": 0 });\n+\n+ it(\"creates partially-applied function with npm conf\", async () => {\n+ const pkg = {\n+ name: \"partially-applied\",\n+ version: \"1.2.3\",\n+ location: \"test\",\n+ scripts: { version: \"echo yay\" },\n+ };\n+ const stage = \"version\";\n+\n+ await runPackageLifecycle(pkg, stage);\n+\n+ expect(npmLifecycle).lastCalledWith(\n+ expect.any(Object),\n+ stage,\n+ pkg.location,\n+ expect.objectContaining({\n+ config: expect.objectContaining({\n+ \"other-cli-flag\": 0,\n+ }),\n+ })\n+ );\n+ });\n+\n+ it(\"skips missing scripts block\", async () => {\n+ const pkg = {\n+ name: \"missing-scripts-block\",\n+ version: \"1.0.0\",\n+ location: \"test\",\n+ };\n+\n+ await runPackageLifecycle(pkg, \"prepare\");\n+ expect(npmLifecycle).not.toBeCalled();\n+ });\n+\n+ it(\"skips missing script\", async () => {\n+ const pkg = {\n+ name: \"missing-script\",\n+ version: \"1.0.0\",\n+ location: \"test\",\n+ scripts: { test: \"echo foo\" },\n+ };\n+\n+ await runPackageLifecycle(pkg, \"prepare\");\n+ expect(npmLifecycle).not.toBeCalled();\n+ });\n+\n+ it(\"logs script error instead of rejecting\", async () => {\n+ npmLifecycle.mockImplementationOnce(() => Promise.reject(new Error(\"boom\")));\n+\n+ const pkg = {\n+ name: \"has-script-error\",\n+ version: \"1.0.0\",\n+ location: \"test\",\n+ scripts: { prepublishOnly: \"exit 1\" },\n+ };\n+\n+ await runPackageLifecycle(pkg, \"prepublishOnly\");\n+\n+ const [errorLog] = loggingOutput(\"error\");\n+ expect(errorLog).toMatch(\"error running prepublishOnly in has-script-error\");\n+ expect(errorLog).toMatch(\"boom\");\n+ });\n+});\n",
"new_path": "utils/run-lifecycle/__tests__/run-lifecycle.test.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "\"test\": \"echo \\\"Run tests from root\\\" && exit 1\"\n},\n\"dependencies\": {\n+ \"@lerna/npm-conf\": \"file:../npm-conf\",\n\"npm-lifecycle\": \"^2.0.0\",\n\"npmlog\": \"^4.1.2\"\n}\n",
"new_path": "utils/run-lifecycle/package.json",
"old_path": "utils/run-lifecycle/package.json"
},
{
"change_type": "MODIFY",
"diff": "const log = require(\"npmlog\");\nconst npmLifecycle = require(\"npm-lifecycle\");\n+const npmConf = require(\"@lerna/npm-conf\");\nmodule.exports = runLifecycle;\n+module.exports.createRunner = createRunner;\nfunction runLifecycle(pkg, stage, opts) {\nlog.silly(\"run-lifecycle\", stage, pkg.name);\n@@ -34,3 +36,17 @@ function runLifecycle(pkg, stage, opts) {\nunsafePerm: true,\n});\n}\n+\n+function createRunner(commandOptions) {\n+ const cfg = npmConf(commandOptions);\n+\n+ return (pkg, stage) => {\n+ if (pkg.scripts && pkg.scripts[stage]) {\n+ return runLifecycle(pkg, stage, cfg).catch(err => {\n+ log.error(\"lifecycle\", `error running ${stage} in ${pkg.name}\\n`, err.stack || err);\n+ });\n+ }\n+\n+ return Promise.resolve();\n+ };\n+}\n",
"new_path": "utils/run-lifecycle/run-lifecycle.js",
"old_path": "utils/run-lifecycle/run-lifecycle.js"
}
] | JavaScript | MIT License | lerna/lerna | feat(run-lifecycle): Encapsulate npm-conf with createRunner() factory | 1 | feat | run-lifecycle |
217,922 | 20.07.2018 14:31:45 | -7,200 | 4163eb69c00e111f9ee0d22a5f96bf72d606852c | feat: notification now shown when public list is commented
closes | [
{
"change_type": "MODIFY",
"diff": "# Translation completion report\n-**Global completion** : 77%\n+**Global completion** : 76%\nde | es | fr | ja | pt |\n:---: | :---: | :---: | :---: | :---: |\n-92% | 97% | 98% | 28% | 69% |\n+91% | 96% | 97% | 27% | 69% |\n## Categories details :\n@@ -38,6 +38,7 @@ HOME_PAGE | 100% | 100% | 100% | 4% | 100% |\nPRICING | 0% | 100% | 100% | 0% | 0% |\nCOMMISSION_BOARD | 98% | 94% | 98% | 0% | 0% |\nNOTIFICATIONS | 0% | 0% | 0% | 0% | 0% |\n+TEAMS | 0% | 0% | 0% | 0% | 0% |\n## Detailed report\n### de :\n@@ -82,7 +83,13 @@ NOTIFICATIONS | 0% | 0% | 0% | 0% | 0% |\n* `NOTIFICATIONS.List_progress` : `{{author}} added {{amount}} {{itemName}} to list \"{{listName}}\"`\n* `NOTIFICATIONS.Team_invite` : `{{invitedBy}} invited you to team {{teamName}}`\n* `NOTIFICATIONS.Item_assigned` : `{{itemName}} has been assigned to you on list \"{{listName}}\"`\n+ * `NOTIFICATIONS.List_commented` : `{{userName}} commented on list {{listName}}: \"{{content}}\"`\n* `NOTIFICATIONS.Mark_all_as_read` : `Mark all as read`\n+ * `TEAMS.Title` : `Teams`\n+ * `TEAMS.Create_team` : `Create a team`\n+ * `TEAMS.Add_user` : `Add a user`\n+ * `TEAMS.No_teams` : `No Teams`\n+ * `TEAMS.Pending` : `Pending`\n### es :\n@@ -102,7 +109,13 @@ NOTIFICATIONS | 0% | 0% | 0% | 0% | 0% |\n* `NOTIFICATIONS.List_progress` : `{{author}} added {{amount}} {{itemName}} to list \"{{listName}}\"`\n* `NOTIFICATIONS.Team_invite` : `{{invitedBy}} invited you to team {{teamName}}`\n* `NOTIFICATIONS.Item_assigned` : `{{itemName}} has been assigned to you on list \"{{listName}}\"`\n+ * `NOTIFICATIONS.List_commented` : `{{userName}} commented on list {{listName}}: \"{{content}}\"`\n* `NOTIFICATIONS.Mark_all_as_read` : `Mark all as read`\n+ * `TEAMS.Title` : `Teams`\n+ * `TEAMS.Create_team` : `Create a team`\n+ * `TEAMS.Add_user` : `Add a user`\n+ * `TEAMS.No_teams` : `No Teams`\n+ * `TEAMS.Pending` : `Pending`\n### fr :\n@@ -115,7 +128,13 @@ NOTIFICATIONS | 0% | 0% | 0% | 0% | 0% |\n* `NOTIFICATIONS.List_progress` : `{{author}} added {{amount}} {{itemName}} to list \"{{listName}}\"`\n* `NOTIFICATIONS.Team_invite` : `{{invitedBy}} invited you to team {{teamName}}`\n* `NOTIFICATIONS.Item_assigned` : `{{itemName}} has been assigned to you on list \"{{listName}}\"`\n+ * `NOTIFICATIONS.List_commented` : `{{userName}} commented on list {{listName}}: \"{{content}}\"`\n* `NOTIFICATIONS.Mark_all_as_read` : `Mark all as read`\n+ * `TEAMS.Title` : `Teams`\n+ * `TEAMS.Create_team` : `Create a team`\n+ * `TEAMS.Add_user` : `Add a user`\n+ * `TEAMS.No_teams` : `No Teams`\n+ * `TEAMS.Pending` : `Pending`\n### ja :\n@@ -508,7 +527,13 @@ NOTIFICATIONS | 0% | 0% | 0% | 0% | 0% |\n* `NOTIFICATIONS.List_progress` : `{{author}} added {{amount}} {{itemName}} to list \"{{listName}}\"`\n* `NOTIFICATIONS.Team_invite` : `{{invitedBy}} invited you to team {{teamName}}`\n* `NOTIFICATIONS.Item_assigned` : `{{itemName}} has been assigned to you on list \"{{listName}}\"`\n+ * `NOTIFICATIONS.List_commented` : `{{userName}} commented on list {{listName}}: \"{{content}}\"`\n* `NOTIFICATIONS.Mark_all_as_read` : `Mark all as read`\n+ * `TEAMS.Title` : `Teams`\n+ * `TEAMS.Create_team` : `Create a team`\n+ * `TEAMS.Add_user` : `Add a user`\n+ * `TEAMS.No_teams` : `No Teams`\n+ * `TEAMS.Pending` : `Pending`\n### pt :\n@@ -676,6 +701,12 @@ NOTIFICATIONS | 0% | 0% | 0% | 0% | 0% |\n* `NOTIFICATIONS.List_progress` : `{{author}} added {{amount}} {{itemName}} to list \"{{listName}}\"`\n* `NOTIFICATIONS.Team_invite` : `{{invitedBy}} invited you to team {{teamName}}`\n* `NOTIFICATIONS.Item_assigned` : `{{itemName}} has been assigned to you on list \"{{listName}}\"`\n+ * `NOTIFICATIONS.List_commented` : `{{userName}} commented on list {{listName}}: \"{{content}}\"`\n* `NOTIFICATIONS.Mark_all_as_read` : `Mark all as read`\n+ * `TEAMS.Title` : `Teams`\n+ * `TEAMS.Create_team` : `Create a team`\n+ * `TEAMS.Add_user` : `Add a user`\n+ * `TEAMS.No_teams` : `No Teams`\n+ * `TEAMS.Pending` : `Pending`\n",
"new_path": "TRANSLATION_COMPLETION.md",
"old_path": "TRANSLATION_COMPLETION.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -49,6 +49,7 @@ import {NotificationService} from './notification/notification.service';\nimport {TeamInviteNotification} from '../model/notification/team-invite-notification';\nimport {TeamExclusionNotification} from '../model/notification/team-exclusion-notification';\nimport {ItemAssignedNotification} from '../model/notification/item-assigned-notification';\n+import {ListCommentNotification} from '../model/notification/list-comment-notification';\nexport const DATA_EXTRACTORS: Provider[] = [\n@@ -76,6 +77,7 @@ export const DATA_EXTRACTORS: Provider[] = [\nTEAM_INVITE: TeamInviteNotification,\nTEAM_EXCLUSION: TeamExclusionNotification,\nITEM_ASSIGNED: ItemAssignedNotification,\n+ LIST_COMMENT: ListCommentNotification,\n}\n}\n]),\n",
"new_path": "src/app/core/core.module.ts",
"old_path": "src/app/core/core.module.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -3,4 +3,5 @@ export enum NotificationType {\nTEAM_INVITE = 'TEAM_INVITE',\nTEAM_EXCLUSION = 'TEAM_EXCLUSION',\nITEM_ASSIGNED = 'ITEM_ASSIGNED',\n+ LIST_COMMENT = 'LIST_COMMENT',\n}\n",
"new_path": "src/app/core/notification/notification-type.ts",
"old_path": "src/app/core/notification/notification-type.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -3,4 +3,5 @@ export interface ModificationEntry {\namount: number;\nitemId: number;\nisPreCraft: boolean;\n+ date: number;\n}\n",
"new_path": "src/app/model/list/modification-entry.ts",
"old_path": "src/app/model/list/modification-entry.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 ListCommentNotification extends AbstractNotification {\n+\n+ constructor(private userName: string, private comment: string, private listName: string) {\n+ super(NotificationType.LIST_COMMENT);\n+ }\n+\n+ getContent(translate: TranslateService, l12n: LocalizedDataService, i18nTools: I18nToolsService): string {\n+ return translate.instant('NOTIFICATIONS.List_commented', {\n+ userName: this.userName,\n+ content: this.comment,\n+ listName: this.listName,\n+ });\n+ }\n+\n+ getIcon(): string {\n+ return 'add_comment';\n+ }\n+\n+ getTargetRoute(): string[] {\n+ return ['/lists'];\n+ }\n+\n+}\n",
"new_path": "src/app/model/notification/list-comment-notification.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "<div mat-dialog-content>\n<mat-list>\n<app-comment-row *ngFor=\"let comment of comments\" [comment]=\"comment\"\n- [canDelete]=\"comment.authorId === userId || data.isOwnList\"\n+ [canDelete]=\"comment.authorId === characterId || data.isOwnList\"\n(delete)=\"deleteComment(comment)\"></app-comment-row>\n</mat-list>\n<form (submit)=\"addComment()\" [formGroup]=\"control\" #f=\"ngForm\">\n",
"new_path": "src/app/modules/comments/comments-popup/comments-popup.component.html",
"old_path": "src/app/modules/comments/comments-popup/comments-popup.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -7,6 +7,8 @@ import {ListRow} from '../../../model/list/list-row';\nimport {ListService} from '../../../core/database/list.service';\nimport {List} from 'app/model/list/list';\nimport {first} from 'rxjs/operators';\n+import {NotificationService} from '../../../core/notification/notification.service';\n+import {ListCommentNotification} from '../../../model/notification/list-comment-notification';\n@Component({\nselector: 'app-comments-popup',\n@@ -17,18 +19,27 @@ export class CommentsPopupComponent {\ncontrol: FormGroup = new FormGroup({comment: new FormControl('', [Validators.required, Validators.maxLength(140)])});\n- userId: number;\n+ characterId: number;\n+\n+ userId: string;\n@ViewChild('f') myNgForm;\n+ private readonly isListComment: boolean;\n+\n+ private userName: string;\n+\nconstructor(private service: ListService,\n@Inject(MAT_DIALOG_DATA) public data: { row: ListRow, list: List, name: string, isOwnList: boolean },\n- private userService: UserService) {\n- this.userService.getUserData().subscribe(user => {\n- if (user.name === 'Anonymous') {\n- this.userId = -1;\n+ private userService: UserService, private notificationService: NotificationService) {\n+ this.isListComment = this.data.row === undefined;\n+ this.userService.getCharacter().subscribe(character => {\n+ this.userName = character.name;\n+ this.userId = character.user.$key;\n+ if (character.name === 'Anonymous') {\n+ this.characterId = -1;\n} else {\n- this.userId = +user.lodestoneId;\n+ this.characterId = +character.user.lodestoneId;\n}\n});\n}\n@@ -37,10 +48,15 @@ export class CommentsPopupComponent {\nconst comment: ResourceComment = new ResourceComment();\ncomment.date = new Date().toISOString();\ncomment.content = this.control.value.comment;\n- comment.authorId = this.userId;\n+ comment.authorId = this.characterId;\nconst comments = this.comments;\ncomments.push(comment);\nthis.comments = comments;\n+ if (this.isListComment && this.userId !== this.data.list.authorId) {\n+ // If this is a comment on a list, notify the author of the list.\n+ const notification = new ListCommentNotification(this.userName, comment.content, this.data.list.name);\n+ this.notificationService.add(this.notificationService.prepareNotification(this.data.list.authorId, notification));\n+ }\nthis.service.set(this.data.list.$key, this.data.list).pipe(first()).subscribe(() => {\nthis.control.reset();\nthis.myNgForm.resetForm();\n@@ -55,11 +71,11 @@ export class CommentsPopupComponent {\n}\npublic get comments(): ResourceComment[] {\n- return (this.data.row === undefined ? this.data.list.comments : this.data.row.comments) || [];\n+ return (this.isListComment ? this.data.list.comments : this.data.row.comments) || [];\n}\npublic set comments(comments: ResourceComment[]) {\n- if (this.data.row === undefined) {\n+ if (this.isListComment) {\nthis.data.list.comments = comments\n} else {\nthis.data.row.comments = comments;\n",
"new_path": "src/app/modules/comments/comments-popup/comments-popup.component.ts",
"old_path": "src/app/modules/comments/comments-popup/comments-popup.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -420,7 +420,8 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\namount: data.row.done - doneBefore,\nisPreCraft: data.preCraft,\nitemId: data.row.id,\n- userId: this.userData.$key\n+ userId: this.userData.$key,\n+ date: Date.now()\n});\nthis.listService.set(list.$key, list).pipe(\nmap(() => list),\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": "</ng-template>\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+ {{'TEAMS.Add_user' | translate}}\n</button>\n</mat-expansion-panel>\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": "\"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+ \"List_commented\": \"{{userName}} commented on list {{listName}}: \\\"{{content}}\\\"\",\n\"Mark_all_as_read\": \"Mark all as read\"\n+ },\n+ \"TEAMS\": {\n+ \"Title\": \"Teams\",\n+ \"Create_team\": \"Create a team\",\n+ \"Add_user\": \"Add a user\",\n+ \"No_teams\": \"No Teams\",\n+ \"Pending\": \"Pending\"\n}\n}\n",
"new_path": "src/assets/i18n/en.json",
"old_path": "src/assets/i18n/en.json"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | feat: notification now shown when public list is commented
closes #279 | 1 | feat | null |
807,849 | 20.07.2018 16:11:52 | 25,200 | 92ee4ee6521eaca0062450ee3028eb2a694e8f37 | chore(mocks): Add npmPublish.order() helper | [
{
"change_type": "MODIFY",
"diff": "@@ -9,10 +9,16 @@ const mockNpmPublish = jest.fn((pkg, tag) => {\nreturn Promise.resolve();\n});\n+// a convenient format for assertions\n+function order() {\n+ return Array.from(registry.keys());\n+}\n+\n// keep test data isolated\nafterEach(() => {\nregistry.clear();\n});\nmodule.exports = mockNpmPublish;\n+module.exports.order = order;\nmodule.exports.registry = registry;\n",
"new_path": "commands/__mocks__/@lerna/npm-publish.js",
"old_path": "commands/__mocks__/@lerna/npm-publish.js"
}
] | JavaScript | MIT License | lerna/lerna | chore(mocks): Add npmPublish.order() helper | 1 | chore | mocks |
679,913 | 20.07.2018 17:40:33 | -3,600 | a59c5c9404b2e493ce93a001bc96f67748183bbb | perf(rstream): optimize dispatch if only single child
replace Subscription.subs with array (was Set)
update Subscription.dispatch()
update call sites
add tests | [
{
"change_type": "MODIFY",
"diff": "@@ -53,7 +53,7 @@ export class Stream<T> extends Subscription<T, T>\nsubscribe(sub: Partial<ISubscriber<T>>, id?: string): Subscription<T, T>;\nsubscribe(...args: any[]) {\nconst wrapped = super.subscribe.apply(this, args);\n- if (this.subs.size === 1) {\n+ if (this.subs.length === 1) {\nthis._cancel = (this.src && this.src(this)) || (() => void 0);\n}\nreturn wrapped;\n@@ -61,7 +61,7 @@ export class Stream<T> extends Subscription<T, T>\nunsubscribe(sub?: Subscription<T, any>) {\nconst res = super.unsubscribe(sub);\n- if (res && (!sub || (!this.subs || !this.subs.size))) {\n+ if (res && (!sub || (!this.subs || !this.subs.length))) {\nthis.cancel();\n}\nreturn res;\n",
"new_path": "packages/rstream/src/stream.ts",
"old_path": "packages/rstream/src/stream.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -33,7 +33,7 @@ export class SidechainPartition<A, B> extends Subscription<A, A[]> {\nunsubscribe(sub?: Subscription<any, any>) {\nconst res = super.unsubscribe(sub);\n- if (!sub || !this.subs.size) {\n+ if (!sub || !this.subs.length) {\nthis.sideSub.unsubscribe();\n}\nreturn res;\n",
"new_path": "packages/rstream/src/subs/sidechain-partition.ts",
"old_path": "packages/rstream/src/subs/sidechain-partition.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -28,7 +28,7 @@ export class SidechainToggle<A, B> extends Subscription<A, A> {\nunsubscribe(sub?: Subscription<any, any>) {\nconst res = super.unsubscribe(sub);\n- if (!sub || !this.subs.size) {\n+ if (!sub || !this.subs.length) {\nthis.sideSub.unsubscribe();\n}\nreturn res;\n",
"new_path": "packages/rstream/src/subs/sidechain-toggle.ts",
"old_path": "packages/rstream/src/subs/sidechain-toggle.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -26,7 +26,7 @@ export class Subscription<A, B> implements\nid: string;\nprotected parent: ISubscribable<A>;\n- protected subs: Set<ISubscriber<B>>;\n+ protected subs: ISubscriber<B>[];\nprotected xform: Reducer<B[], A>;\nprotected state: State = State.IDLE;\n@@ -36,9 +36,9 @@ export class Subscription<A, B> implements\nthis.parent = parent;\nthis.id = id || `sub-${Subscription.NEXT_ID++}`;\nthis.last = SEMAPHORE;\n- this.subs = new Set();\n+ this.subs = [];\nif (sub) {\n- this.subs.add(<ISubscriber<B>>sub);\n+ this.subs.push(<ISubscriber<B>>sub);\n}\nif (xform) {\nthis.xform = xform(push());\n@@ -154,9 +154,10 @@ export class Subscription<A, B> implements\n}\nif (this.subs) {\nDEBUG && console.log(this.id, \"unsub child\", sub.id);\n- if (this.subs.has(sub)) {\n- this.subs.delete(sub);\n- if (!this.subs.size) {\n+ const idx = this.subs.indexOf(sub);\n+ if (idx >= 0) {\n+ this.subs.splice(idx, 1);\n+ if (!this.subs.length) {\nthis.unsubscribe();\n}\nreturn true;\n@@ -206,8 +207,8 @@ export class Subscription<A, B> implements\nerror(e: any) {\nthis.state = State.ERROR;\nlet notified = false;\n- if (this.subs && this.subs.size) {\n- for (let s of [...this.subs]) {\n+ if (this.subs && this.subs.length) {\n+ for (let s of this.subs.slice()) {\nif (s.error) {\ns.error(e);\nnotified = true;\n@@ -225,7 +226,7 @@ export class Subscription<A, B> implements\n}\nprotected addWrapped(wrapped: Subscription<any, any>) {\n- this.subs.add(wrapped);\n+ this.subs.push(wrapped);\nthis.state = State.ACTIVE;\nreturn wrapped;\n}\n@@ -233,7 +234,18 @@ export class Subscription<A, B> implements\nprotected dispatch(x: B) {\nDEBUG && console.log(this.id, \"dispatch\", x);\nthis.last = x;\n- for (let s of this.subs) {\n+ const subs = this.subs;\n+ let s: ISubscriber<B>;\n+ if (subs.length == 1) {\n+ s = subs[0];\n+ try {\n+ s.next && s.next(x);\n+ } catch (e) {\n+ s.error ? s.error(e) : this.error(e);\n+ }\n+ } else {\n+ for (let i = subs.length - 1; i >= 0; i--) {\n+ s = subs[i];\ntry {\ns.next && s.next(x);\n} catch (e) {\n@@ -241,6 +253,7 @@ export class Subscription<A, B> implements\n}\n}\n}\n+ }\nprotected ensureState() {\nif (this.state >= State.DONE) {\n@@ -250,7 +263,7 @@ export class Subscription<A, B> implements\nprotected cleanup() {\nDEBUG && console.log(this.id, \"cleanup\");\n- this.subs.clear();\n+ this.subs.length = 0;\ndelete this.parent;\ndelete this.xform;\ndelete this.last;\n",
"new_path": "packages/rstream/src/subscription.ts",
"old_path": "packages/rstream/src/subscription.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -36,6 +36,7 @@ describe(\"Subscription\", () => {\nsetTimeout(() => {\nassert.deepEqual(buf, [1]);\nassert.equal(src.getState(), rs.State.DONE);\n+ assert.equal((<any>src).subs.length, 0);\nassert(!called);\ndone();\n}, 30);\n",
"new_path": "packages/rstream/test/subscription.ts",
"old_path": "packages/rstream/test/subscription.ts"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | perf(rstream): optimize dispatch if only single child
- replace Subscription.subs with array (was Set)
- update Subscription.dispatch()
- update call sites
- add tests | 1 | perf | rstream |
679,913 | 20.07.2018 17:46:04 | -3,600 | 7cfb8e5a18ea1becb1852ae0eb5104f5f64db378 | minor(rstream): remove obsolete args (pubsub) | [
{
"change_type": "MODIFY",
"diff": "@@ -63,20 +63,16 @@ export class PubSub<A, B> extends Subscription<A, B> {\n/**\n* Unsupported. Use `subscribeTopic()` instead.\n- *\n- * @param _\n*/\n- subscribe(..._: any[]): Subscription<B, any> {\n+ subscribe(): Subscription<B, any> {\nunsupported(`use subscribeTopic() instead`);\nreturn null;\n}\n/**\n* Unsupported. Use `subscribeTopic()` instead.\n- *\n- * @param _\n*/\n- transform(..._: any[]): Subscription<B, any> {\n+ transform(): Subscription<B, any> {\nunsupported(`use subscribeTopic() instead`);\nreturn null;\n}\n",
"new_path": "packages/rstream/src/pubsub.ts",
"old_path": "packages/rstream/src/pubsub.ts"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | minor(rstream): remove obsolete args (pubsub) | 1 | minor | rstream |
791,690 | 20.07.2018 19:07:27 | 25,200 | 0265569b1970aa7383c4e12909205e1c8d8f3d6a | core(ttfb): reuse requestMainResource | [
{
"change_type": "MODIFY",
"diff": "@@ -35,26 +35,13 @@ class TTFBMetric extends Audit {\n* @param {LH.Artifacts} artifacts\n* @return {Promise<LH.Audit.Product>}\n*/\n- static audit(artifacts) {\n- const devtoolsLogs = artifacts.devtoolsLogs[Audit.DEFAULT_PASS];\n+ static async audit(artifacts) {\n+ const devtoolsLog = artifacts.devtoolsLogs[Audit.DEFAULT_PASS];\n+ const mainResource = await artifacts.requestMainResource({devtoolsLog, URL: artifacts.URL});\n- return artifacts.requestNetworkRecords(devtoolsLogs)\n- .then((networkRecords) => {\n- /** @type {LH.Audit.DisplayValue} */\n- let displayValue = '';\n-\n- const finalUrl = artifacts.URL.finalUrl;\n- const finalUrlRequest = networkRecords.find(record => record.url === finalUrl);\n- if (!finalUrlRequest) {\n- throw new Error(`finalUrl '${finalUrl} not found in network records.`);\n- }\n- const ttfb = TTFBMetric.caclulateTTFB(finalUrlRequest);\n+ const ttfb = TTFBMetric.caclulateTTFB(mainResource);\nconst passed = ttfb < TTFB_THRESHOLD;\n- if (!passed) {\n- displayValue = ['Root document took %10d', ttfb];\n- }\n-\n/** @type {LH.Result.Audit.OpportunityDetails} */\nconst details = {\ntype: 'opportunity',\n@@ -66,7 +53,7 @@ class TTFBMetric extends Audit {\nreturn {\nrawValue: ttfb,\nscore: Number(passed),\n- displayValue,\n+ displayValue: passed ? '' : ['Root document took %10d', ttfb],\ndetails,\nextendedInfo: {\nvalue: {\n@@ -74,7 +61,6 @@ class TTFBMetric extends Audit {\n},\n},\n};\n- });\n}\n}\n",
"new_path": "lighthouse-core/audits/time-to-first-byte.js",
"old_path": "lighthouse-core/audits/time-to-first-byte.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -11,14 +11,15 @@ const assert = require('assert');\n/* eslint-env jest */\ndescribe('Performance: time-to-first-byte audit', () => {\nit('fails when ttfb of root document is higher than 600ms', () => {\n- const networkRecords = [\n- {url: 'https://example.com/', requestId: '0', timing: {receiveHeadersEnd: 830, sendEnd: 200}},\n- {url: 'https://google.com/styles.css', requestId: '1', timing: {receiveHeadersEnd: 450, sendEnd: 200}},\n- {url: 'https://google.com/image.jpg', requestId: '2', timing: {receiveHeadersEnd: 600, sendEnd: 400}},\n- ];\n+ const mainResource = {\n+ url: 'https://example.com/',\n+ requestId: '0',\n+ timing: {receiveHeadersEnd: 830, sendEnd: 200},\n+ };\n+\nconst artifacts = {\ndevtoolsLogs: {[TimeToFirstByte.DEFAULT_PASS]: []},\n- requestNetworkRecords: () => Promise.resolve(networkRecords),\n+ requestMainResource: () => Promise.resolve(mainResource),\nURL: {finalUrl: 'https://example.com/'},\n};\n@@ -29,14 +30,15 @@ describe('Performance: time-to-first-byte audit', () => {\n});\nit('succeeds when ttfb of root document is lower than 600ms', () => {\n- const networkRecords = [\n- {url: 'https://example.com/', requestId: '0', timing: {receiveHeadersEnd: 400, sendEnd: 200}},\n- {url: 'https://google.com/styles.css', requestId: '1', timing: {receiveHeadersEnd: 850, sendEnd: 200}},\n- {url: 'https://google.com/image.jpg', requestId: '2', timing: {receiveHeadersEnd: 1000, sendEnd: 400}},\n- ];\n+ const mainResource = {\n+ url: 'https://example.com/',\n+ requestId: '0',\n+ timing: {receiveHeadersEnd: 400, sendEnd: 200},\n+ };\n+\nconst artifacts = {\ndevtoolsLogs: {[TimeToFirstByte.DEFAULT_PASS]: []},\n- requestNetworkRecords: () => Promise.resolve(networkRecords),\n+ requestMainResource: () => Promise.resolve(mainResource),\nURL: {finalUrl: 'https://example.com/'},\n};\n@@ -45,25 +47,4 @@ describe('Performance: time-to-first-byte audit', () => {\nassert.strictEqual(result.score, 1);\n});\n});\n-\n- it('throws when somehow finalUrl is not in network records', async () => {\n- const networkRecords = [\n- {url: 'https://example.com/', requestId: '0', timing: {receiveHeadersEnd: 400, sendEnd: 200}},\n- {url: 'https://google.com/styles.css', requestId: '1', timing: {receiveHeadersEnd: 850, sendEnd: 200}},\n- {url: 'https://google.com/image.jpg', requestId: '2', timing: {receiveHeadersEnd: 1000, sendEnd: 400}},\n- ];\n- const badFinalUrl = 'https://badexample.com/';\n- const artifacts = {\n- devtoolsLogs: {[TimeToFirstByte.DEFAULT_PASS]: []},\n- requestNetworkRecords: () => Promise.resolve(networkRecords),\n- URL: {finalUrl: badFinalUrl},\n- };\n-\n- try {\n- await TimeToFirstByte.audit(artifacts);\n- throw new Error('TimeToFirstByte did not throw');\n- } catch (e) {\n- assert.ok(e.message.includes(badFinalUrl));\n- }\n- });\n});\n",
"new_path": "lighthouse-core/test/audits/time-to-first-byte-test.js",
"old_path": "lighthouse-core/test/audits/time-to-first-byte-test.js"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | core(ttfb): reuse requestMainResource (#5657) | 1 | core | ttfb |
791,719 | 20.07.2018 19:08:12 | 25,200 | c4e41fa069eba2fc1269aabe60da37d430928047 | report: link to our own "unused css" reference doc | [
{
"change_type": "MODIFY",
"diff": "@@ -23,7 +23,7 @@ class UnusedCSSRules extends ByteEfficiencyAudit {\nscoreDisplayMode: ByteEfficiencyAudit.SCORING_MODES.NUMERIC,\ndescription: 'Remove unused rules from stylesheets to reduce unnecessary ' +\n'bytes consumed by network activity. ' +\n- '[Learn more](https://developers.google.com/speed/docs/insights/OptimizeCSSDelivery).',\n+ '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/unused-css).',\nrequiredArtifacts: ['CSSUsage', 'URL', 'devtoolsLogs'],\n};\n}\n",
"new_path": "lighthouse-core/audits/byte-efficiency/unused-css-rules.js",
"old_path": "lighthouse-core/audits/byte-efficiency/unused-css-rules.js"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | report: link to our own "unused css" reference doc (#5698) | 1 | report | null |
679,913 | 21.07.2018 01:48:04 | -3,600 | 76dc450d34dfe3e038fd4588a170ae7d7f2c03b0 | feat(range-coder): re-import package from MB2010 | [
{
"change_type": "ADD",
"diff": "+bench/*\n+build/*\n+dev/*\n+node_modules\n+src*\n+test*\n+bundle.*\n+tsconfig.json\n+webpack.config.js\n+*.html\n+*.tgz\n+!doc/*\n+!*.d.ts\n+!*.js\n",
"new_path": "packages/range-coder/.npmignore",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+# @thi.ng/range-coder\n+\n+[](https://www.npmjs.com/package/@thi.ng/range-coder)\n+\n+This project is part of the\n+[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.\n+\n+## About\n+\n+Range encoder / decoder for binary data, based on [Java implementation\n+by Joe Halliwell](https://www.winterwell.com/software/compressor.php).\n+\n+## Installation\n+\n+```bash\n+yarn add @thi.ng/range-coder\n+```\n+\n+## Dependencies\n+\n+- [@thi.ng/bitstream](https://github.com/thi-ng/umbrella/tree/master/packages/bitstream)\n+\n+## API\n+\n+```ts\n+import * as rc \"@thi.ng/range-coder\";\n+```\n+\n+```ts\n+// prepare dummy data\n+src = new Uint8Array(1024);\n+src.set([1,1,1,1,1,2,2,2,2,3,3,3,4,4,5,4,4,3,3,3,2,2,2,2,1,1,1,1,1], 512);\n+\n+// pack data\n+packed = rc.encodeBytes(src);\n+\n+packed.length\n+// 146\n+\n+packed.length/src.length\n+// 0.142578125\n+\n+// unpack\n+dest = rc.decodeBytes(packed);\n+```\n+\n+## Authors\n+\n+- Karsten Schmidt\n+\n+## License\n+\n+© 2017 Karsten Schmidt // Apache Software License 2.0\n",
"new_path": "packages/range-coder/README.md",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"@thi.ng/range-coder\",\n+ \"version\": \"0.0.1\",\n+ \"description\": \"Binary data range encoder / decoder\",\n+ \"main\": \"./index.js\",\n+ \"typings\": \"./index.d.ts\",\n+ \"repository\": {\n+ \"type\": \"git\",\n+ \"url\": \"https://github.com/thi-ng/umbrella.git\"\n+ },\n+ \"homepage\": \"https://github.com/thi-ng/umbrella/tree/master/packages/rstream\",\n+ \"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n+ \"license\": \"Apache-2.0\",\n+ \"scripts\": {\n+ \"build\": \"yarn clean && tsc --declaration\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build coverage doc\",\n+ \"cover\": \"yarn test && nyc report --reporter=lcov\",\n+ \"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n+ \"pub\": \"yarn build && yarn publish --access public\",\n+ \"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n+ },\n+ \"devDependencies\": {\n+ \"@thi.ng/transducers\": \"1.14.1\",\n+ \"@types/mocha\": \"^5.2.0\",\n+ \"@types/node\": \"^10.0.6\",\n+ \"mocha\": \"^5.1.1\",\n+ \"nyc\": \"^11.7.1\",\n+ \"typedoc\": \"^0.11.1\",\n+ \"typescript\": \"^2.8.3\"\n+ },\n+ \"dependencies\": {\n+ \"@thi.ng/bitstream\": \"0.4.14\"\n+ },\n+ \"keywords\": [\n+ \"ES6\",\n+ \"binary\",\n+ \"entropy\",\n+ \"packer\",\n+ \"range encoding\",\n+ \"typescript\"\n+ ],\n+ \"publishConfig\": {\n+ \"access\": \"public\"\n+ }\n+}\n\\ No newline at end of file\n",
"new_path": "packages/range-coder/package.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { BitInputStream, BitOutputStream } from \"@thi.ng/bitstream\";\n+\n+const HIGH = 0x7fffff;\n+const HALF = 0x400000;\n+const QUARTER = 0x200000;\n+const THREE_QUARTER = 0x600000;\n+const INITIAL_READ = 23;\n+const FREQ = 257;\n+\n+export const encodeBytes = (src: Uint8Array) => {\n+ const freq = new Uint32Array(FREQ).fill(1);\n+ const out = new BitOutputStream(Math.max(src.length >> 1, 1));\n+ const len = src.length;\n+ let total = FREQ;\n+ let lo = 0;\n+ let hi = HIGH;\n+ let _lo = lo;\n+ let _hi = hi;\n+ let step;\n+ let scale = 0;\n+ let curr = 0;\n+ let i, j;\n+\n+ for (i = 0; i <= len; i++) {\n+ if (i === len) {\n+ lo = total - 1;\n+ hi = total;\n+ } else {\n+ curr = src[i];\n+ lo = 0;\n+ for (j = 0; j < curr; j++) {\n+ lo += freq[j];\n+ }\n+ hi = lo + freq[curr];\n+ }\n+\n+ step = ((_hi - _lo + 1) / total) >>> 0;\n+ _hi = _lo + step * hi - 1;\n+ _lo += step * lo;\n+\n+ while (true) {\n+ if (_hi < HALF) {\n+ out.writeBit(0);\n+ _lo <<= 1;\n+ _hi = (_hi << 1) + 1;\n+ scale && out.write(HIGH, scale);\n+ } else if (_lo >= HALF) {\n+ out.writeBit(1);\n+ _lo = (_lo - HALF) << 1;\n+ _hi = ((_hi - HALF) << 1) + 1;\n+ scale && out.write(0, scale);\n+ } else {\n+ break;\n+ }\n+ scale = 0;\n+ }\n+\n+ while (_lo > QUARTER && _hi < THREE_QUARTER) {\n+ scale++;\n+ _lo = (_lo - QUARTER) << 1;\n+ _hi = ((_hi - QUARTER) << 1) + 1;\n+ }\n+\n+ freq[curr]++;\n+ total++;\n+ }\n+ if (_lo < QUARTER) {\n+ out.writeBit(0);\n+ out.write(HIGH, scale + 1);\n+ } else {\n+ out.writeBit(1);\n+ }\n+ return out.bytes();\n+};\n+\n+export const decodeBytes = (src: Uint8Array) => {\n+ const freq = new Uint32Array(FREQ).fill(1);\n+ const input = new BitInputStream(src)\n+ const nbits = input.length\n+ const out = []\n+ let total = FREQ\n+ let current = 0\n+ let lo = 0\n+ let hi = HIGH\n+ let _lo = lo\n+ let _hi = hi\n+ let step = 0\n+ let buf = input.read(INITIAL_READ)\n+ let val;\n+\n+ const read = () => input.position < nbits ? input.readBit() : 0;\n+\n+ while (true) {\n+ step = ((_hi - _lo + 1) / total) >>> 0;\n+ val = ((buf - _lo) / step) >>> 0;\n+ lo = 0;\n+ for (current = 0; current < 256 && lo + freq[current] <= val; current++) {\n+ lo += freq[current];\n+ }\n+ if (current === 256) break;\n+\n+ out.push(current);\n+ hi = lo + freq[current];\n+\n+ _hi = _lo + step * hi - 1;\n+ _lo += step * lo;\n+\n+ while (true) {\n+ if (_hi < HALF) {\n+ buf <<= 1;\n+ _lo <<= 1;\n+ _hi = (_hi << 1) + 1;\n+ } else if (_lo >= HALF) {\n+ buf = (buf - HALF) << 1;\n+ _lo = (_lo - HALF) << 1;\n+ _hi = ((_hi - HALF) << 1) + 1;\n+ } else {\n+ break;\n+ }\n+ buf += read();\n+ }\n+\n+ while (_lo > QUARTER && _hi < THREE_QUARTER) {\n+ _lo = (_lo - QUARTER) << 1;\n+ _hi = ((_hi - QUARTER) << 1) + 1;\n+ buf = (buf - QUARTER) << 1;\n+ buf += read();\n+ }\n+\n+ freq[current]++;\n+ total++;\n+ }\n+\n+ return new Uint8Array(out);\n+};\n",
"new_path": "packages/range-coder/src/index.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { repeat, repeatedly } from \"@thi.ng/transducers\";\n+import * as assert from \"assert\";\n+import { decodeBytes, encodeBytes } from \"../src\";\n+\n+describe(\"range-coder\", () => {\n+\n+ it(\"fixed\", () => {\n+ const src = new Uint8Array([10, 20, 30, 10, 10, 10]);\n+ const dest = encodeBytes(src);\n+ assert.deepEqual(dest, [10, 10, 224, 160, 49, 91, 88]);\n+ assert.deepEqual(src, decodeBytes(dest));\n+ });\n+\n+ it(\"fuzz\", () => {\n+ for (let i = 0; i < 10; i++) {\n+ const src = randomArray(640, 1024);\n+ const dest = encodeBytes(src);\n+ console.log(`${(dest.length / src.length * 100).toFixed(2)}%`);\n+ assert.deepEqual(src, decodeBytes(dest));\n+ }\n+ });\n+});\n+\n+function randomArray(n: number, len: number) {\n+ return new Uint8Array([...repeatedly(() => ~~(Math.random() * 256), n), ...repeat(0, len - n)]);\n+}\n",
"new_path": "packages/range-coder/test/index.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"extends\": \"../../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \"../build\"\n+ },\n+ \"include\": [\n+ \"./**/*.ts\",\n+ \"../src/**/*.ts\"\n+ ]\n+}\n\\ No newline at end of file\n",
"new_path": "packages/range-coder/test/tsconfig.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"extends\": \"../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \".\"\n+ },\n+ \"include\": [\n+ \"./src/**/*.ts\",\n+ ]\n+}\n\\ No newline at end of file\n",
"new_path": "packages/range-coder/tsconfig.json",
"old_path": null
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | feat(range-coder): re-import @thi.ng/range-coder package from MB2010 | 1 | feat | range-coder |
679,913 | 21.07.2018 02:00:55 | -3,600 | e3def294d26e13e2ee0cb37b31ae0bf943691e8c | refactor(examples): switch to WMA plots in crypto-chart demo | [
{
"change_type": "MODIFY",
"diff": "@@ -10,9 +10,9 @@ 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+constructs to create a basic crypto-currency candle chart with multiple\n+moving averages plots. Unlike most other examples in this repo, there's\n+no additional state handling used (e.g. via\n[@thi.ng/atom](https://github.com/thi-ng/umbrella/tree/master/packages/atom)\nconstructs) and the entire app largely relies on various stream\ncombinators & transformers. Furthermore, this approach only triggers UI\n",
"new_path": "examples/crypto-chart/README.md",
"old_path": "examples/crypto-chart/README.md"
},
{
"change_type": "MODIFY",
"diff": "\"@thi.ng/hiccup-svg\": \"latest\",\n\"@thi.ng/resolve-map\": \"latest\",\n\"@thi.ng/rstream\": \"latest\",\n- \"@thi.ng/transducers\": \"latest\"\n+ \"@thi.ng/transducers\": \"latest\",\n+ \"@thi.ng/transducers-stats\": \"latest\"\n}\n}\n\\ No newline at end of file\n",
"new_path": "examples/crypto-chart/package.json",
"old_path": "examples/crypto-chart/package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -15,6 +15,7 @@ import { Stream } from \"@thi.ng/rstream/stream\";\nimport { sync } from \"@thi.ng/rstream/stream-sync\";\nimport { resolve as resolvePromise } from \"@thi.ng/rstream/subs/resolve\";\nimport { trace } from \"@thi.ng/rstream/subs/trace\";\n+import { wma } from \"@thi.ng/transducers-stats/wma\";\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@@ -28,7 +29,6 @@ import { filter } from \"@thi.ng/transducers/xform/filter\";\nimport { map } from \"@thi.ng/transducers/xform/map\";\nimport { mapIndexed } from \"@thi.ng/transducers/xform/map-indexed\";\nimport { mapcat } from \"@thi.ng/transducers/xform/mapcat\";\n-import { movingAverage } from \"@thi.ng/transducers/xform/moving-average\";\nimport { pluck } from \"@thi.ng/transducers/xform/pluck\";\nimport { scan } from \"@thi.ng/transducers/xform/scan\";\n@@ -183,7 +183,7 @@ const data = sync({\nmax: ({ ohlc }) => transduce(pluck(\"high\"), max(), ohlc),\ntbounds: ({ ohlc }) => [ohlc[0].time, ohlc[ohlc.length - 1].time],\nsma: ({ ohlc }) => transduce(\n- map((period: number) => [period, transduce(comp(pluck(\"close\"), movingAverage(period)), push(), ohlc)]),\n+ map((period: number) => [period, transduce(comp(pluck(\"close\"), wma(period)), push(), ohlc)]),\npush(),\n[12, 24, 50, 72]\n),\n@@ -210,9 +210,9 @@ const chart = sync({\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\n- const sma = (data: number[], smaPeriod: number, col: string) =>\n+ const sma = (vals: number[], col: string) =>\npolyline(\n- data.map((y, x) => [mapX(x + smaPeriod + 0.5), mapY(y)]),\n+ vals.map((y, x) => [mapX(x + (ohlc.length - vals.length) + 0.5), mapY(y)]),\n{ stroke: col, fill: \"none\" }\n);\n@@ -266,7 +266,7 @@ const chart = sync({\n),\n// moving averages\n...iterator(\n- map(([period, vals]) => sma(vals, period, theme.chart[`sma${period}`])),\n+ map(([period, vals]) => sma(vals, theme.chart[`sma${period}`])),\ndata.sma\n),\n// candles\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 | refactor(examples): switch to WMA plots in crypto-chart demo | 1 | refactor | examples |
791,723 | 21.07.2018 08:42:51 | -28,800 | 5579378c4fe5081fce7cc07d7856243ec97e8f6e | misc(asset-saver): tweak output format of logAssets | [
{
"change_type": "MODIFY",
"diff": "@@ -326,13 +326,16 @@ async function saveAssets(artifacts, audits, pathWithBasename) {\nasync function logAssets(artifacts, audits) {\nconst allAssets = await prepareAssets(artifacts, audits);\nallAssets.map(passAssets => {\n- log.log(`devtoolslog-${passAssets.passName}.json`, JSON.stringify(passAssets.devtoolsLog));\n+ const dtlogdata=JSON.stringify(passAssets.devtoolsLog);\n+ // eslint-disable-next-line no-console\n+ console.log(`loggedAsset %%% devtoolslog-${passAssets.passName}.json %%% ${dtlogdata}`);\nconst traceIter = traceJsonGenerator(passAssets.traceData);\nlet traceJson = '';\nfor (const trace of traceIter) {\ntraceJson += trace;\n}\n- log.log(`trace-${passAssets.passName}.json`, traceJson);\n+ // eslint-disable-next-line no-console\n+ console.log(`loggedAsset %%% trace-${passAssets.passName}.json %%% ${traceJson}`);\n});\n}\n",
"new_path": "lighthouse-core/lib/asset-saver.js",
"old_path": "lighthouse-core/lib/asset-saver.js"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | misc(asset-saver): tweak output format of logAssets (#5696) | 1 | misc | asset-saver |
679,913 | 21.07.2018 13:47:08 | -3,600 | 2953caaa17d7c929cfb459bc666a330e9aa12a58 | feat(examples): add MA mode dropdown, update crypto-chart dataflow | [
{
"change_type": "MODIFY",
"diff": "<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n-->\n<!-- Title: g Pages: 1 -->\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+<svg width=\"650pt\" height=\"281pt\"\n+ viewBox=\"0.00 0.00 650.17 281.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 277)\">\n<title>g</title>\n-<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-238 542.0703,-238 542.0703,4 -4,4\"/>\n+<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-277 646.1672,-277 646.1672,4 -4,4\"/>\n<!-- market -->\n<g id=\"node1\" class=\"node\">\n<title>market</title>\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+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"195.1078\" cy=\"-90\" rx=\"29.3416\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"195.1078\" y=\"-86.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">market</text>\n</g>\n-<!-- data -->\n+<!-- response -->\n<g id=\"node2\" class=\"node\">\n-<title>data</title>\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+<title>response</title>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"195.1078\" cy=\"-18\" rx=\"35.9388\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"195.1078\" y=\"-14.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">response</text>\n</g>\n-<!-- market->data -->\n+<!-- market->response -->\n<g id=\"edge1\" class=\"edge\">\n-<title>market->data</title>\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+<title>market->response</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M195.1078,-71.8594C195.1078,-63.2681 195.1078,-54.6768 195.1078,-46.0854\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"198.6079,-46 195.1078,-36 191.6079,-46 198.6079,-46\"/>\n</g>\n-<!-- chart -->\n-<g id=\"node6\" class=\"node\">\n-<title>chart</title>\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+<!-- data -->\n+<g id=\"node7\" class=\"node\">\n+<title>data</title>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"296.9969\" cy=\"-94\" rx=\"27\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"296.9969\" y=\"-90.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">data</text>\n</g>\n-<!-- data->chart -->\n+<!-- response->data -->\n<g id=\"edge5\" class=\"edge\">\n-<title>data->chart</title>\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+<title>response->data</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M215.2378,-33.0152C231.1865,-44.9114 253.5892,-61.6218 270.9119,-74.543\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"268.8488,-77.3705 278.9571,-80.544 273.0341,-71.7595 268.8488,-77.3705\"/>\n</g>\n<!-- symbol -->\n<g id=\"node3\" class=\"node\">\n<title>symbol</title>\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+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"195.1078\" cy=\"-255\" rx=\"29.3416\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"195.1078\" y=\"-251.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">symbol</text>\n</g>\n-<!-- symbol->data -->\n+<!-- symbol->response -->\n<g id=\"edge2\" class=\"edge\">\n-<title>symbol->data</title>\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+<title>symbol->response</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M166.797,-249.8214C147.7766,-244.7117 124.0827,-234.8115 112.1391,-216 77.8349,-161.9701 81.6294,-128.2597 112.1391,-72 121.6788,-54.4087 139.7046,-41.6485 156.5235,-32.9638\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"158.1905,-36.0458 165.6816,-28.5535 155.1533,-29.739 158.1905,-36.0458\"/>\n</g>\n<!-- ui -->\n-<g id=\"node9\" class=\"node\">\n+<g id=\"node11\" class=\"node\">\n<title>ui</title>\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+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"507.1672\" cy=\"-179\" rx=\"27\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"507.1672\" y=\"-175.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">ui</text>\n</g>\n<!-- symbol->ui -->\n-<g id=\"edge8\" class=\"edge\">\n+<g id=\"edge10\" class=\"edge\">\n<title>symbol->ui</title>\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+<path fill=\"none\" stroke=\"#000000\" d=\"M223.9193,-251.1309C270.3294,-244.6985 364.4114,-230.8326 443.1672,-214 451.7063,-212.1749 454.2036,-212.5818 462.1672,-209 468.611,-206.1018 475.1547,-202.3153 481.1828,-198.4131\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"483.2756,-201.2226 489.5741,-192.7033 479.3376,-195.4353 483.2756,-201.2226\"/>\n</g>\n<!-- period -->\n<g id=\"node4\" class=\"node\">\n<title>period</title>\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+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"195.1078\" cy=\"-198\" rx=\"29.3416\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"195.1078\" y=\"-194.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">period</text>\n</g>\n-<!-- period->data -->\n+<!-- period->response -->\n<g id=\"edge3\" class=\"edge\">\n-<title>period->data</title>\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+<title>period->response</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M166.461,-193.7492C147.5443,-189.2929 124.1128,-180.2478 112.1391,-162 90.1945,-128.557 93.0705,-107.1623 112.1391,-72 121.6788,-54.4087 139.7046,-41.6485 156.5235,-32.9638\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"158.1905,-36.0458 165.6816,-28.5535 155.1533,-29.739 158.1905,-36.0458\"/>\n</g>\n<!-- period->ui -->\n-<g id=\"edge9\" class=\"edge\">\n+<g id=\"edge11\" class=\"edge\">\n<title>period->ui</title>\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+<path fill=\"none\" stroke=\"#000000\" d=\"M224.1854,-196.2296C280.9689,-192.7723 406.5467,-185.1264 469.5602,-181.2897\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"470.0741,-184.765 479.8428,-180.6637 469.6486,-177.778 470.0741,-184.765\"/>\n</g>\n-<!-- refresh -->\n+<!-- avgmode -->\n<g id=\"node5\" class=\"node\">\n+<title>avgmode</title>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"195.1078\" cy=\"-144\" rx=\"32.3892\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"195.1078\" y=\"-140.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">avgmode</text>\n+</g>\n+<!-- avgmode->data -->\n+<g id=\"edge6\" class=\"edge\">\n+<title>avgmode->data</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M219.5128,-132.0238C233.4215,-125.1983 250.992,-116.576 265.8836,-109.2682\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"267.7818,-112.2355 275.2172,-104.6879 264.698,-105.9513 267.7818,-112.2355\"/>\n+</g>\n+<!-- refresh -->\n+<g id=\"node6\" 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+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"32.4445\" cy=\"-18\" rx=\"32.3892\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"32.4445\" y=\"-14.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">refresh</text>\n</g>\n-<!-- refresh->data -->\n+<!-- refresh->response -->\n<g id=\"edge4\" class=\"edge\">\n-<title>refresh->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+<title>refresh->response</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M64.9709,-18C89.0344,-18 122.143,-18 148.9425,-18\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"149.2455,-21.5001 159.2455,-18 149.2455,-14.5001 149.2455,-21.5001\"/>\n+<text text-anchor=\"middle\" x=\"112.1391\" y=\"-20.241\" font-family=\"Inconsolata\" font-size=\"9.00\" fill=\"#000000\">every 60 secs</text>\n+</g>\n+<!-- chart -->\n+<g id=\"node8\" class=\"node\">\n+<title>chart</title>\n+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"416.1672\" cy=\"-91\" rx=\"27\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"416.1672\" y=\"-87.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">chart</text>\n+</g>\n+<!-- data->chart -->\n+<g id=\"edge7\" class=\"edge\">\n+<title>data->chart</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M324.0384,-93.3193C340.2269,-92.9117 361.0383,-92.3878 378.7841,-91.9411\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"378.9114,-95.4391 388.8201,-91.6884 378.7351,-88.4413 378.9114,-95.4391\"/>\n</g>\n<!-- chart->ui -->\n-<g id=\"edge10\" class=\"edge\">\n+<g id=\"edge12\" class=\"edge\">\n<title>chart->ui</title>\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+<path fill=\"none\" stroke=\"#000000\" d=\"M433.651,-104.9543C442.4351,-112.1802 453.1087,-121.2937 462.1672,-130 470.4971,-138.0061 479.188,-147.237 486.6859,-155.5131\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"484.1827,-157.9644 493.4584,-163.0842 489.4,-153.2974 484.1827,-157.9644\"/>\n</g>\n<!-- window -->\n-<g id=\"node7\" class=\"node\">\n+<g id=\"node9\" class=\"node\">\n<title>window</title>\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+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"296.9969\" cy=\"-40\" rx=\"29.3416\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"296.9969\" y=\"-36.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">window</text>\n</g>\n<!-- window->chart -->\n-<g id=\"edge6\" class=\"edge\">\n+<g id=\"edge8\" class=\"edge\">\n<title>window->chart</title>\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+<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M321.1127,-50.3206C339.2315,-58.0747 364.2298,-68.7729 384.043,-77.2522\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"382.7295,-80.4971 393.3001,-81.2138 385.4837,-74.0616 382.7295,-80.4971\"/>\n+<text text-anchor=\"middle\" x=\"357.6672\" y=\"-73.241\" font-family=\"Inconsolata\" font-size=\"9.00\" fill=\"#000000\">resize</text>\n</g>\n<!-- theme -->\n-<g id=\"node8\" class=\"node\">\n+<g id=\"node10\" class=\"node\">\n<title>theme</title>\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+<ellipse fill=\"none\" stroke=\"#000000\" cx=\"615.1672\" cy=\"-155\" rx=\"27\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"615.1672\" y=\"-151.9695\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">theme</text>\n</g>\n<!-- theme->chart -->\n-<g id=\"edge7\" class=\"edge\">\n+<g id=\"edge9\" class=\"edge\">\n<title>theme->chart</title>\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+<path fill=\"none\" stroke=\"#000000\" d=\"M590.5663,-147.0882C555.2437,-135.7281 490.0298,-114.7548 450.1327,-101.9236\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"451.1599,-98.5774 440.5685,-98.8477 449.0167,-105.2413 451.1599,-98.5774\"/>\n</g>\n<!-- theme->ui -->\n-<g id=\"edge11\" class=\"edge\">\n+<g id=\"edge13\" class=\"edge\">\n<title>theme->ui</title>\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+<path fill=\"none\" stroke=\"#000000\" d=\"M589.5096,-160.7017C575.652,-163.7812 558.3193,-167.6329 543.1354,-171.0071\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"542.0384,-167.6654 533.0359,-173.2514 543.557,-174.4987 542.0384,-167.6654\"/>\n</g>\n<!-- ui->symbol -->\n-<g id=\"edge12\" class=\"edge\">\n+<g id=\"edge14\" class=\"edge\">\n<title>ui->symbol</title>\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+<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M494.4085,-194.9392C482.709,-208.1274 464.0648,-225.8178 443.1672,-233 361.0557,-261.2204 336.5614,-257.0318 249.8265,-261 244.5908,-261.2395 239.087,-261.1011 233.6703,-260.7356\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"233.734,-257.2267 223.4546,-259.7925 233.0905,-264.197 233.734,-257.2267\"/>\n+<text text-anchor=\"middle\" x=\"357.6672\" y=\"-258.241\" font-family=\"Inconsolata\" font-size=\"9.00\" fill=\"#000000\">user</text>\n</g>\n<!-- ui->period -->\n-<g id=\"edge13\" class=\"edge\">\n+<g id=\"edge15\" class=\"edge\">\n<title>ui->period</title>\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+<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M483.5998,-188.3037C476.7658,-190.7483 469.2386,-193.2011 462.1672,-195 453.882,-197.1077 451.6738,-197.1494 443.1672,-198 357.1937,-206.5962 335.1357,-207.0081 248.8265,-203 244.0489,-202.7781 239.04,-202.4459 234.0821,-202.056\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"234.3314,-198.5646 224.0676,-201.192 233.7297,-205.5387 234.3314,-198.5646\"/>\n+<text text-anchor=\"middle\" x=\"357.6672\" y=\"-207.241\" font-family=\"Inconsolata\" font-size=\"9.00\" fill=\"#000000\">user</text>\n+</g>\n+<!-- ui->avgmode -->\n+<g id=\"edge17\" class=\"edge\">\n+<title>ui->avgmode</title>\n+<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M480.4521,-176.0037C426.0722,-169.9045 302.1633,-156.0071 236.9755,-148.6958\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"237.3649,-145.2176 227.0371,-147.5811 236.5847,-152.174 237.3649,-145.2176\"/>\n+<text text-anchor=\"middle\" x=\"357.6672\" y=\"-165.241\" font-family=\"Inconsolata\" font-size=\"9.00\" fill=\"#000000\">user</text>\n</g>\n<!-- ui->theme -->\n-<g id=\"edge14\" class=\"edge\">\n+<g id=\"edge16\" class=\"edge\">\n<title>ui->theme</title>\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+<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M526.5203,-166.3677C534.1851,-162.0618 543.2785,-157.7772 552.1672,-155.559 560.391,-153.5068 569.4087,-152.6458 577.9862,-152.4428\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"578.1327,-155.9434 588.1475,-152.4858 578.1624,-148.9434 578.1327,-155.9434\"/>\n+<text text-anchor=\"middle\" x=\"561.1672\" y=\"-157.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": "@@ -15,6 +15,9 @@ import { Stream } from \"@thi.ng/rstream/stream\";\nimport { sync } from \"@thi.ng/rstream/stream-sync\";\nimport { resolve as resolvePromise } from \"@thi.ng/rstream/subs/resolve\";\nimport { trace } from \"@thi.ng/rstream/subs/trace\";\n+import { ema } from \"@thi.ng/transducers-stats/ema\";\n+import { hma } from \"@thi.ng/transducers-stats/hma\";\n+import { sma } from \"@thi.ng/transducers-stats/sma\";\nimport { wma } from \"@thi.ng/transducers-stats/wma\";\nimport { comp } from \"@thi.ng/transducers/func/comp\";\nimport { pairs } from \"@thi.ng/transducers/iter/pairs\";\n@@ -59,9 +62,16 @@ const SYMBOL_PAIRS: DropDownOption[] = [\n[\"XMRUSD\", \"XMR-USD\"],\n];\n+const MA_MODES = {\n+ ema: { fn: ema, label: \"Exponential\" },\n+ hma: { fn: hma, label: \"Hull\" },\n+ sma: { fn: sma, label: \"Simple\" },\n+ wma: { fn: wma, label: \"Weighted\" },\n+};\n+\n// chart settings\nconst MARGIN_X = 80;\n-const MARGIN_Y = 50;\n+const MARGIN_Y = 60;\nconst DAY = 60 * 60 * 24;\nconst TIME_TICKS = {\n@@ -89,6 +99,7 @@ const TIME_FORMATS = {\nconst THEMES = {\nlight: {\nid: \"light\",\n+ label: \"Light\",\nbg: \"white\",\nbody: \"black\",\nchart: {\n@@ -107,6 +118,7 @@ const THEMES = {\n},\ndark: {\nid: \"dark\",\n+ label: \"Dark\",\nbg: \"black\",\nbody: \"white\",\nchart: {\n@@ -144,13 +156,24 @@ const Z2 = padl(2, \"0\");\nconst emitOnStream = (stream) => (e) => stream.next(e.target.value);\n+const menu = (stream, title, items) =>\n+ map((x: any) =>\n+ dropdown(\n+ null,\n+ { class: \"w-100\", onchange: emitOnStream(stream) },\n+ [[, title, true], ...items],\n+ String(x)\n+ )\n+ );\n+\n// stream definitions\n-const market = new Stream();\n-const symbol = new Stream();\n-const period = new Stream();\n-const theme = new Stream().transform(map((id: string) => THEMES[id]));\n-const error = new Stream();\n+const market = new Stream<string>();\n+const symbol = new Stream<string>();\n+const period = new Stream<number>();\n+const avgMode = new Stream<string>();\n+const theme = new Stream<string>().transform(map((id) => THEMES[id]));\n+const error = new Stream<any>();\n// I/O error handler\nerror.subscribe({ next: (e) => alert(`An error occurred:\\n${e}`) });\n@@ -159,8 +182,7 @@ error.subscribe({ next: (e) => alert(`An error occurred:\\n${e}`) });\nconst refresh = fromInterval(60000).subscribe(trace(\"refresh\"));\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+const response = sync({\nsrc: { market, symbol, period, refresh },\nreset: false,\nxform: map((inst) =>\n@@ -171,24 +193,39 @@ const data = sync({\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+}).subscribe(\n+ resolvePromise({ fail: (e) => error.next(e.message) })\n+);\n+\n+// this stream combinator computes a number of statistics on incoming OHLC data\n+// including calculation of moving averages (based on current mode selection)\n+const data = sync({\n+ src: {\n+ response,\n+ avg: avgMode.transform(map((id: string) => MA_MODES[id].fn)),\n+ },\n+ xform: comp(\n+ // bail if response value has no OHLC data\n+ filter(({ response }) => !!response.ohlc),\n// use @thi.ng/resolve-map to compute bounds & moving averages\n- map((inst: any) => resolve({\n- ...inst,\n+ map(({ response, avg }: any) => resolve({\n+ ...response,\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- sma: ({ ohlc }) => transduce(\n- map((period: number) => [period, transduce(comp(pluck(\"close\"), wma(period)), push(), ohlc)]),\n+ sma: ({ ohlc }) =>\n+ transduce(\n+ map((period: number) => [\n+ period,\n+ transduce(comp(pluck(\"close\"), avg(period)), push(), ohlc)\n+ ]),\npush(),\n[12, 24, 50, 72]\n),\n}))\n- );\n+ ),\n+ reset: false,\n+});\n// this stream combinator (re)computes the SVG chart\n// updates whenever data, theme or window size has changed\n@@ -293,7 +330,7 @@ const chart = sync({\n),\n// price line\nline([MARGIN_X, closeY], [closeX, closeY], { stroke: theme.chart.price }),\n- // tag\n+ // closing price tag\npolygon(\n[[closeX, closeY], [closeX + 10, closeY - 8], [width, closeY - 8], [width, closeY + 8], [closeX + 10, closeY + 8]],\n{ fill: theme.chart.price }\n@@ -308,49 +345,56 @@ sync({\nsrc: {\nchart,\ntheme,\n- // transform symbol stream into dropdown component\n- symbol: symbol.transform(\n- map((x: string) =>\n- dropdown(\n- null,\n- { class: \"w3 w4-ns mr2\", 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: \"w3 w4-ns mr2\", onchange: emitOnStream(period) },\n- [...pairs(TIMEFRAMES)],\n- String(x)\n- )\n+ // the following input streams are each transformed\n+ // into a dropdown component\n+ symbol: symbol.transform(menu(symbol, \"Symbol pair\", SYMBOL_PAIRS)),\n+ period: period.transform(menu(period, \"Time frame\", [...pairs(TIMEFRAMES)])),\n+ avg: avgMode.transform(\n+ menu(avgMode, \"Moving average\",\n+ [...iterator(\n+ map(([id, mode]) => <DropDownOption>[id, mode.label]),\n+ pairs(MA_MODES))]\n)\n),\nthemeSel: theme.transform(\n- map((sel) =>\n- dropdown(\n- null,\n- { class: \"w3 w4-ns\", onchange: emitOnStream(theme) },\n- Object.keys(THEMES).map((k) => <DropDownOption>[k, k]),\n- sel.id\n- )\n+ map((x) => x.id),\n+ menu(theme, \"Theme\",\n+ [...iterator(\n+ map(([id, theme]) => <DropDownOption>[id, theme.label]),\n+ pairs(THEMES))]\n)\n)\n},\nreset: false,\nxform: comp(\n// combines all inputs into a single root component\n- map(({ theme, themeSel, chart, symbol, period }) =>\n+ map(({ theme, themeSel, chart, symbol, period, avg }) =>\n[\"div\",\n- { class: `sans-serif bg-${theme.bg} ${theme.body}` },\n+ { class: `sans-serif f7 bg-${theme.bg} ${theme.body}` },\nchart,\n- [\"div.fixed.f7\",\n- { style: { top: `10px`, right: `${MARGIN_X}px` } },\n- [\"span.dn.dib-l\",\n+ [\"div.fixed\",\n+ {\n+ style: {\n+ top: `1rem`,\n+ right: `${MARGIN_X}px`,\n+ width: `calc(100vw - 2 * ${MARGIN_X}px)`\n+ }\n+ },\n+ [\"div.flex\",\n+ ...iterator(\n+ map((x) => [\"div.w-25.ph2\", x]),\n+ [symbol, period, avg, themeSel]\n+ ),\n+ ]\n+ ],\n+ [\"div.fixed.tc\",\n+ {\n+ style: {\n+ bottom: `1rem`,\n+ left: `${MARGIN_X}px`,\n+ width: `calc(100vw - 2 * ${MARGIN_X}px)`\n+ }\n+ },\n[\"a\",\n{\nclass: `mr3 b link ${theme.body}`,\n@@ -362,10 +406,6 @@ sync({\nclass: `mr3 b link ${theme.body}`,\nhref: \"https://github.com/thi-ng/umbrella/tree/master/examples/crypto-chart/\"\n}, \"Source code\"]\n- ],\n- symbol,\n- period,\n- themeSel,\n]\n]\n),\n@@ -387,6 +427,7 @@ sync({\nmarket.next(\"CCCAGG\");\nsymbol.next(\"BTCUSD\");\nperiod.next(60);\n+avgMode.next(\"wma\");\ntheme.next(\"dark\");\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 MA mode dropdown, update crypto-chart dataflow | 1 | feat | examples |
217,922 | 21.07.2018 15:08:13 | -7,200 | 41527d783af9ab546ea6aa88844388263054cac6 | feat: new history system for lists to see who added/removed things
closes | [
{
"change_type": "MODIFY",
"diff": "@@ -75,7 +75,7 @@ export class UserService extends FirebaseStorage<AppUser> {\nreturn c;\n}));\n} else {\n- return of({name: 'Anonymous'});\n+ return of({name: 'Anonymous', user: u});\n}\n}),\nshareReplay()\n",
"new_path": "src/app/core/database/user.service.ts",
"old_path": "src/app/core/database/user.service.ts"
},
{
"change_type": "MODIFY",
"diff": "export interface ModificationEntry {\n- userId: string;\n+ characterId: number;\namount: number;\nitemId: number;\nisPreCraft: boolean;\n+ itemIcon: number;\n+ date: number;\n}\n",
"new_path": "src/app/model/list/modification-entry.ts",
"old_path": "src/app/model/list/modification-entry.ts"
},
{
"change_type": "MODIFY",
"diff": "*ngFor=\"let timer of timers | async; trackBy: trackByTimers\">\n<mat-menu #addAlarmMenu=\"matMenu\">\n<button (click)=\"addAlarm(timer.itemId, timer.type, group.name)\" mat-menu-item\n- *ngFor=\"let group of user.alarmGroups\">{{group.name}}\n+ *ngFor=\"let group of user?.alarmGroups\">{{group.name}}\n</button>\n</mat-menu>\n<button mat-raised-button\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": "<button mat-mini-fab\n[disabled]=\"user.isAnonymous\"\n[matTooltip]=\"'PERMISSIONS.Title' | translate\"\n- (click)=\"openPermissionsPopup()\" *ngIf=\"listData.authorId === userData.$key\">\n+ (click)=\"openPermissionsPopup()\" *ngIf=\"listData.authorId === userData?.$key\">\n<mat-icon>security</mat-icon>\n</button>\n</span>\nmatTooltip=\"{{'LIST_DETAILS.Inventory_breakdown' | translate}}\">\n<mat-icon>apps</mat-icon>\n</button>\n+\n+ <button mat-mini-fab color=\"accent\" *ngIf=\"listData !== null\"\n+ (click)=\"openHistoryPopup()\"\n+ matTooltip=\"{{'LIST.History' | translate}}\">\n+ <mat-icon>history</mat-icon>\n+ </button>\n</div>\n<div class=\"header\">\n<span class=\"list-name\">{{listData?.name}}</span>\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": "@@ -42,6 +42,7 @@ 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 {ListHistoryPopupComponent} from '../list-history-popup/list-history-popup.component';\ndeclare const ga: Function;\n@@ -282,8 +283,9 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\nthis.subscriptions.push(this.auth.authState.subscribe(user => {\nthis.user = user;\n}));\n- this.subscriptions.push(this.userService.getUserData()\n- .subscribe(user => {\n+ this.subscriptions.push(this.userService.getCharacter()\n+ .subscribe(character => {\n+ const user = character.user;\nthis.userData = user;\nthis.hideUsed = user.listDetailsFilters !== undefined ? user.listDetailsFilters.hideUsed : false;\nthis.hideCompleted = user.listDetailsFilters !== undefined ? user.listDetailsFilters.hideCompleted : false;\n@@ -379,12 +381,16 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\npublic setDone(list: List, data: { row: ListRow, amount: number, preCraft: boolean }): void {\nconst doneBefore = data.row.done;\nlist.setDone(data.row, data.amount, data.preCraft);\n+ if (data.amount !== 0) {\nlist.modificationsHistory.push({\namount: data.row.done - doneBefore,\nisPreCraft: data.preCraft,\nitemId: data.row.id,\n- userId: this.userData.$key\n+ characterId: this.userData.lodestoneId,\n+ itemIcon: data.row.icon,\n+ date: Date.now()\n});\n+ }\nthis.listService.set(list.$key, list).pipe(\nmap(() => list),\ntap((l: List) => {\n@@ -527,6 +533,13 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\n});\n}\n+ public openHistoryPopup(): void {\n+ this.dialog.open(ListHistoryPopupComponent, {\n+ data: this.listData.modificationsHistory\n+ .sort((a, b) => a.date > b.date ? -1 : 1)\n+ });\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": "ADD",
"diff": "+<h3 mat-dialog-title>{{'LIST.History' | translate}}</h3>\n+<mat-list>\n+ <mat-list-item *ngFor=\"let entry of listHistory\">\n+ <img src=\"{{entry.itemIcon | icon}}\" alt=\"\" mat-list-avatar>\n+ <span matLine>{{entry.amount > 0 ? '+' : ''}}{{entry.amount}} {{entry.itemId | itemName | i18n}}</span>\n+ <span matLine class=\"user-and-date\">{{getCharacterName(entry.characterId) | async}} - {{entry.date | date: 'medium'}}</span>\n+ </mat-list-item>\n+</mat-list>\n+<div mat-dialog-actions>\n+ <button mat-button mat-dialog-close>{{'Ok' | translate}}</button>\n+</div>\n",
"new_path": "src/app/pages/list/list-history-popup/list-history-popup.component.html",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+.user-and-date {\n+ opacity: .7;\n+}\n",
"new_path": "src/app/pages/list/list-history-popup/list-history-popup.component.scss",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import {Component, Inject} from '@angular/core';\n+import {MAT_DIALOG_DATA} from '@angular/material';\n+import {ModificationEntry} from '../../../model/list/modification-entry';\n+import {Observable} from 'rxjs/Observable';\n+import {DataService} from '../../../core/api/data.service';\n+import {pluck} from 'rxjs/operators';\n+\n+@Component({\n+ selector: 'app-list-history-popup',\n+ templateUrl: './list-history-popup.component.html',\n+ styleUrls: ['./list-history-popup.component.scss']\n+})\n+export class ListHistoryPopupComponent {\n+\n+ characters: { [index: number]: Observable<string> } = {};\n+\n+ public listHistory: ModificationEntry[] = [];\n+\n+ constructor(@Inject(MAT_DIALOG_DATA) public entries: ModificationEntry[], private dataService: DataService) {\n+ // Filter the old entries before trying to display things.\n+ this.listHistory = entries.filter(entry => entry.characterId !== undefined);\n+ }\n+\n+ public getCharacterName(lodestoneId: number): Observable<string> {\n+ if (this.characters[lodestoneId] === undefined) {\n+ this.characters[lodestoneId] = this.dataService.getCharacter(lodestoneId).pipe(pluck('name'));\n+ }\n+ return this.characters[lodestoneId];\n+ }\n+\n+}\n",
"new_path": "src/app/pages/list/list-history-popup/list-history-popup.component.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -43,6 +43,7 @@ import {NavigationMapPopupComponent} from './navigation-map-popup/navigation-map\nimport {MapModule} from '../../modules/map/map.module';\nimport {ListFinishedPopupComponent} from './list-finished-popup/list-finished-popup.component';\nimport {TotalPricePopupComponent} from './total-price-popup/total-price-popup.component';\n+import { ListHistoryPopupComponent } from './list-history-popup/list-history-popup.component';\nconst routes: Routes = [\n{\n@@ -111,6 +112,7 @@ const routes: Routes = [\nNavigationMapPopupComponent,\nListFinishedPopupComponent,\nTotalPricePopupComponent,\n+ ListHistoryPopupComponent,\n],\nentryComponents: [\nRegenerationPopupComponent,\n@@ -122,6 +124,7 @@ const routes: Routes = [\nNavigationMapPopupComponent,\nListFinishedPopupComponent,\nTotalPricePopupComponent,\n+ ListHistoryPopupComponent,\n]\n})\nexport class ListModule {\n",
"new_path": "src/app/pages/list/list.module.ts",
"old_path": "src/app/pages/list/list.module.ts"
},
{
"change_type": "MODIFY",
"diff": "\"Enable_crystals_tracking\": \"Enable crystals tracking\",\n\"Copy_as_text\": \"Copy as text\",\n\"Total_price\": \"Total trades (gils and currencies)\",\n+ \"History\": \"History\",\n\"BUTTONS\": {\n\"Add_link_description\": \"Create a custom link for this list\",\n\"Create_template_description\": \"Create a template link for this list, which will create a copy of the list for whoever opens it\",\n",
"new_path": "src/assets/i18n/en.json",
"old_path": "src/assets/i18n/en.json"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | feat: new history system for lists to see who added/removed things
closes #435 | 1 | feat | null |
679,913 | 21.07.2018 16:32:11 | -3,600 | 0b0a7ca9784c6ca7f606856bded77a2f19b2245d | feat(transducers-stats): add stochastic oscillator, refactor
refactor donchian()
add bounds() helper fn | [
{
"change_type": "MODIFY",
"diff": "@@ -36,6 +36,7 @@ statistical analysis and replaces the older\n- [RSI (Relative Strength Index)](./src/rsi.ts)\n- [SD (Standard Deviation)](./src/sd.ts)\n- [SMA (Simple Moving Average)](./src/sma.ts)\n+- [Stochastic oscillator](./src/stochastic.ts)\n- [TRIX (Triple smoothed EMA)](./src/trix.ts)\n- [WMA (Weighted Moving Average)](./src/wma.ts)\n",
"new_path": "packages/transducers-stats/README.md",
"old_path": "packages/transducers-stats/README.md"
},
{
"change_type": "ADD",
"diff": "+/**\n+ * Computes min / max values of given array.\n+ *\n+ * @param window\n+ */\n+export const bounds = (window: number[]) => {\n+ let min = window[0];\n+ let max = min;\n+ for (let i = window.length - 1; i > 0; i--) {\n+ const v = window[i];\n+ min = Math.min(min, v);\n+ max = Math.max(max, v);\n+ }\n+ return [min, max];\n+};\n",
"new_path": "packages/transducers-stats/src/bounds.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -3,6 +3,8 @@ import { comp } from \"@thi.ng/transducers/func/comp\";\nimport { partition } from \"@thi.ng/transducers/xform/partition\";\nimport { map } from \"@thi.ng/transducers/xform/map\";\n+import { bounds } from \"./bounds\";\n+\n/**\n* Computes Donchian channel, i.e. min/max values for sliding window.\n*\n@@ -15,17 +17,5 @@ import { map } from \"@thi.ng/transducers/xform/map\";\n* @param period\n*/\nexport function donchian(period: number): Transducer<number, [number, number]> {\n- return comp(\n- partition(period, 1),\n- map((window) => {\n- let min = window[0];\n- let max = min;\n- for (let i = 1; i < period; i++) {\n- const v = window[i];\n- min = Math.min(min, v);\n- max = Math.max(max, v);\n- }\n- return [min, max];\n- })\n- );\n+ return comp(partition(period, 1), map(bounds));\n};\n",
"new_path": "packages/transducers-stats/src/donchian.ts",
"old_path": "packages/transducers-stats/src/donchian.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -7,8 +7,10 @@ export * from \"./roc\";\nexport * from \"./rsi\";\nexport * from \"./sd\";\nexport * from \"./sma\";\n+export * from \"./stochastic\";\nexport * from \"./trix\";\nexport * from \"./wma\";\n+export * from \"./bounds\";\nexport * from \"./dot\";\nexport * from \"./mse\";\n",
"new_path": "packages/transducers-stats/src/index.ts",
"old_path": "packages/transducers-stats/src/index.ts"
},
{
"change_type": "ADD",
"diff": "+import { Reducer, Transducer } from \"@thi.ng/transducers/api\";\n+import { compR } from \"@thi.ng/transducers/func/compr\";\n+import { step } from \"@thi.ng/transducers/step\";\n+\n+import { donchian } from \"./donchian\";\n+import { sma } from \"./sma\";\n+\n+/**\n+ * Stochastic oscillator. Yields tuples of `[%K, %D1, %D2]`, where:\n+ *\n+ * - %K = (curr - L5) / (H5 - L5)\n+ * - %D1 = SMA(%K, periodD1)\n+ * - %D2 = SMA(%D1, periodD2)\n+ *\n+ * https://en.wikipedia.org/wiki/Stochastic_oscillator\n+ *\n+ * @param periodK\n+ * @param periodD1\n+ * @param periodD2\n+ */\n+export function stochastic(periodK: number, periodD1: number, periodD2: number): Transducer<number, any> {\n+ return (rfn: Reducer<any, number[]>) => {\n+ const reduce = rfn[2];\n+ const xfD = step(donchian(periodK));\n+ const ma1 = step(sma(periodD1));\n+ const ma2 = step(sma(periodD2));\n+ return compR(\n+ rfn,\n+ (acc, x) => {\n+ const b = <number[]>xfD(x);\n+ if (b == null) return acc;\n+ const k = (x - b[0]) / (b[1] - b[0]);\n+ const d1 = <number>ma1(k);\n+ if (d1 == null) return acc;\n+ const d2 = <number>ma2(d1);\n+ if (d2 == null) return acc;\n+ return reduce(acc, [k, d1, d2]);\n+ }\n+ );\n+ }\n+}\n",
"new_path": "packages/transducers-stats/src/stochastic.ts",
"old_path": null
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | feat(transducers-stats): add stochastic oscillator, refactor
- refactor donchian()
- add bounds() helper fn | 1 | feat | transducers-stats |
724,054 | 22.07.2018 00:01:44 | -28,800 | 2e6de7b052e41776e6503d62d581bcb93dc04af8 | feat: use setValue() on select element | [
{
"change_type": "MODIFY",
"diff": "@@ -82,7 +82,7 @@ The default test script will do the following: lint with ESLint -> type check wi\n- **`create-instance`**: private package that creates an instance and applies mounting options.\n- - **`shared`**: private package that contains utilities used by the other packzges.\n+ - **`shared`**: private package that contains utilities used by the other packages.\n- **`scripts`**: contains build-related scripts and configuration files. In most cases you don't need to touch them.\n",
"new_path": ".github/CONTRIBUTING.md",
"old_path": ".github/CONTRIBUTING.md"
},
{
"change_type": "MODIFY",
"diff": "## setValue(value)\n-Sets value of a text-control input element and updates `v-model` bound data.\n+Sets value of a text-control input or select element and updates `v-model` bound data.\n- **Arguments:**\n- `{any} value`\n@@ -12,15 +12,26 @@ import { mount } from '@vue/test-utils'\nimport Foo from './Foo.vue'\nconst wrapper = mount(Foo)\n+\nconst input = wrapper.find('input[type=\"text\"]')\ninput.setValue('some value')\n+\n+const select = wrapper.find('select')\n+select.setValue('option value')\n```\n- **Note:**\n-`textInput.setValue(value)` is an alias of the following code.\n+ - `textInput.setValue(value)` is an alias of the following code.\n```js\ntextInput.element.value = value\ntextInput.trigger('input')\n```\n+\n+ - `select.setValue(value)` is an alias of the following code.\n+\n+ ```js\n+ select.element.value = value\n+ select.trigger('change')\n+ ```\n",
"new_path": "docs/api/wrapper/setValue.md",
"old_path": "docs/api/wrapper/setValue.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -697,8 +697,12 @@ export default class Wrapper implements BaseWrapper {\nconst type = this.attributes().type\nif (tagName === 'SELECT') {\n+ // $FlowIgnore\n+ this.element.value = value\n+ this.trigger('change')\n+ } else if (tagName === 'OPTION') {\nthrowError(\n- `wrapper.setValue() cannot be called on a <select> ` +\n+ `wrapper.setValue() cannot be called on an <option> ` +\n`element. Use wrapper.setSelected() instead`\n)\n} else if (tagName === 'INPUT' && type === 'checkbox') {\n",
"new_path": "packages/test-utils/src/wrapper.js",
"old_path": "packages/test-utils/src/wrapper.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -18,19 +18,34 @@ describeWithShallowAndMount('setValue', mountingMethod => {\nexpect(textarea.element.value).to.equal('foo')\n})\n- it('updates dom with v-model', () => {\n+ it('updates dom with input v-model', () => {\nconst wrapper = mountingMethod(ComponentWithInput)\nconst input = wrapper.find('input[type=\"text\"]')\n-\ninput.setValue('input text awesome binding')\nexpect(wrapper.text()).to.contain('input text awesome binding')\n})\n- it('throws error if element is select', () => {\n+ it('sets element of select value', () => {\n+ const wrapper = mountingMethod(ComponentWithInput)\n+ const select = wrapper.find('select')\n+ select.setValue('selectB')\n+\n+ expect(select.element.value).to.equal('selectB')\n+ })\n+\n+ it('updates dom with select v-model', () => {\n+ const wrapper = mountingMethod(ComponentWithInput)\n+ const select = wrapper.find('select')\n+ select.setValue('selectB')\n+\n+ expect(wrapper.text()).to.contain('selectB')\n+ })\n+\n+ it('throws error if element is option', () => {\nconst message =\n- 'wrapper.setValue() cannot be called on a <select> element. Use wrapper.setSelected() instead'\n- shouldThrowErrorOnElement('select', message)\n+ 'wrapper.setValue() cannot be called on an <option> element. Use wrapper.setSelected() instead'\n+ shouldThrowErrorOnElement('option', message)\n})\nit('throws error if element is radio', () => {\n",
"new_path": "test/specs/wrapper/setValue.spec.js",
"old_path": "test/specs/wrapper/setValue.spec.js"
}
] | JavaScript | MIT License | vuejs/vue-test-utils | feat: use setValue() on select element (#837) | 1 | feat | null |
807,849 | 22.07.2018 11:18:00 | 25,200 | 0ad5fafa1534ea8b5db022fac2f04b5d6e5f2889 | feat(package-graph): Add `rawPackageList` getter | [
{
"change_type": "MODIFY",
"diff": "@@ -98,6 +98,10 @@ class PackageGraph extends Map {\n});\n}\n+ get rawPackageList() {\n+ return Array.from(this.values()).map(node => node.pkg);\n+ }\n+\n/**\n* Takes a list of Packages and returns a list of those same Packages with any Packages\n* they depend on. i.e if packageA depended on packageB `graph.addDependencies([packageA])`\n",
"new_path": "core/package-graph/index.js",
"old_path": "core/package-graph/index.js"
}
] | JavaScript | MIT License | lerna/lerna | feat(package-graph): Add `rawPackageList` getter | 1 | feat | package-graph |
807,849 | 22.07.2018 11:19:40 | 25,200 | b132c3ad93acfdac968cf67a93e868f50e6d7a1a | fix(changed): Clarify early exit log message | [
{
"change_type": "MODIFY",
"diff": "@@ -24,7 +24,7 @@ class ChangedCommand extends Command {\nconst proceedWithUpdates = this.count > 0;\nif (!proceedWithUpdates) {\n- this.logger.info(\"No packages need updating\");\n+ this.logger.info(\"\", \"No changed packages found\");\nprocess.exitCode = 1;\n}\n",
"new_path": "commands/changed/index.js",
"old_path": "commands/changed/index.js"
}
] | JavaScript | MIT License | lerna/lerna | fix(changed): Clarify early exit log message | 1 | fix | changed |
217,922 | 22.07.2018 12:15:58 | -7,200 | 95ce29c800660218cc51f36a91d20b28768dc237 | chore: ability to delete notifications in the notifications page | [
{
"change_type": "MODIFY",
"diff": "@@ -16,6 +16,8 @@ export abstract class AbstractNotification {\npublic alerted = false;\n+ public isQuestion = 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": "[routerLink]=\"notification.to.getTargetRoute()\">\n<mat-icon>open_in_new</mat-icon>\n</button>\n+ <button mat-icon-button color=\"warn\" (click)=\"remove(notification)\"\n+ *ngIf=\"!notification.to.isQuestion\">\n+ <mat-icon>delete</mat-icon>\n+ </button>\n</mat-list-item>\n</mat-list>\n</div>\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": "@@ -35,6 +35,10 @@ export class NotificationsComponent {\nthis.notificationService.set(notification.$key, notification);\n}\n+ public remove(notification: NotificationRelationship): void {\n+ this.notificationService.remove(notification.$key);\n+ }\n+\npublic answerQuestion(notification: NotificationRelationship, answer: boolean): void {\nswitch (notification.to.type) {\ncase 'TEAM_INVITE':\n",
"new_path": "src/app/pages/notifications/notifications/notifications.component.ts",
"old_path": "src/app/pages/notifications/notifications/notifications.component.ts"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | chore: ability to delete notifications in the notifications page | 1 | chore | null |
217,922 | 22.07.2018 12:22:19 | -7,200 | 0f77fd8a991643136ac0a5bc08082f1492bf23da | chore: hide lists you aren't the leader of in the team assignment menu | [
{
"change_type": "MODIFY",
"diff": "@@ -153,7 +153,12 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\nmap(layout => layout.recipeZoneBreakdown)\n);\n- this.teams$ = this.teamService.getUserTeams();\n+ this.teams$ = combineLatest(this.userService.getUserData(), this.teamService.getUserTeams())\n+ .pipe(\n+ map(([user, teams]) => {\n+ return teams.filter(team => team.leader === user.$key)\n+ })\n+ );\nthis.team$ = this.listData$\n.pipe(\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": "\"Create_team\": \"Create a team\",\n\"Add_user\": \"Add a user\",\n\"No_teams\": \"No Teams\",\n- \"Pending\": \"Pending\"\n+ \"Pending\": \"Pending\",\n+ \"Assign_list\": \"Assign this list to a team\",\n+ \"Detach_team\": \"Detach team\"\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: hide lists you aren't the leader of in the team assignment menu | 1 | chore | null |
679,913 | 23.07.2018 01:00:59 | -3,600 | e349cb6ab96ff3c0a337805ef6a62b1c89861c91 | docs(transducers): update readmes | [
{
"change_type": "MODIFY",
"diff": "@@ -48,8 +48,44 @@ yarn add @thi.ng/transducers-stats\n## Usage examples\n+For some realworld use, please see the [crypto\n+chart](https://github.com/thi-ng/umbrella/tree/master/examples/crypto-chart)\n+example.\n+\n```ts\n+import * as tx from \"@thi.ng/transducers\";\nimport * as stats from \"@thi.ng/transducers-stats\";\n+\n+// Simple moving average (SMA) (sliding window size 5)\n+[...tx.iterator(stats.sma(5), [1,2,3,4,5,10,11,12,13,14,9,8,7,6,5])]\n+// [ 3, 4.8, 6.6, 8.4, 10.2, 12, 11.8, 11.2, 10.2, 8.8, 7 ]\n+\n+// compute multiple stats at once\n+tx.transduce(\n+ tx.comp(\n+ tx.multiplexObj({\n+ sma: stats.sma(5),\n+ ema: stats.ema(5),\n+ wma: stats.wma(5)\n+ }),\n+ // ignore first `period-1` values\n+ // (because MAs require at least `period` inputs to warm up)\n+ tx.drop(4)\n+ ),\n+ tx.push(),\n+ [1,2,3,4,5,10,11,12,13,14,9,8,7,6,5]\n+);\n+// [ { wma: 3.6666666666666665, ema: 3, sma: 3 },\n+// { wma: 6, ema: 5.333333333333333, sma: 4.8 },\n+// { wma: 8.066666666666666, ema: 7.222222222222221, sma: 6.6 },\n+// { wma: 9.866666666666667, ema: 8.814814814814815, sma: 8.4 },\n+// { wma: 11.4, ema: 10.209876543209877, sma: 10.2 },\n+// { wma: 12.666666666666666, ema: 11.473251028806585, sma: 12 },\n+// { wma: 11.666666666666666, ema: 10.64883401920439, sma: 11.8 },\n+// { wma: 10.4, ema: 9.76588934613626, sma: 11.2 },\n+// { wma: 9, ema: 8.843926230757507, sma: 10.2 },\n+// { wma: 7.6, ema: 7.895950820505004, sma: 8.8 },\n+// { wma: 6.333333333333333, ema: 6.93063388033667, sma: 7 } ]\n```\n## Authors\n",
"new_path": "packages/transducers-stats/README.md",
"old_path": "packages/transducers-stats/README.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -29,20 +29,20 @@ though the implementation does heavily differ (also in contrast to some\nother JS based implementations) and dozens of less common, but generally\nhighly useful operators have been added. See full list below.\n-### Related functionality / packages\n+### Related packages\n+\n+#### Extended functionality\n+\n+- [@thi.ng/transducers-fsm](https://github.com/thi-ng/umbrella/tree/master/packages/transducers-fsm) - Fine State Machine transducer\n+- [@thi.ng/transducers-stats](https://github.com/thi-ng/umbrella/tree/master/packages/transducers-stats) - Technical / statistical analysis transducers\n+\n+#### Packages utilizing transducers\n- [@thi.ng/csp](https://github.com/thi-ng/umbrella/tree/master/packages/csp)\n- [@thi.ng/rstream](https://github.com/thi-ng/umbrella/tree/master/packages/rstream)\n- [@thi.ng/rstream-graph](https://github.com/thi-ng/umbrella/tree/master/packages/rstream-graph)\n- [@thi.ng/rstream-log](https://github.com/thi-ng/umbrella/tree/master/packages/rstream-log)\n- [@thi.ng/sax](https://github.com/thi-ng/umbrella/tree/master/packages/sax)\n-- [@thi.ng/transducers-fsm](https://github.com/thi-ng/umbrella/tree/master/packages/transducers-fsm)\n-\n-Since 0.8.0 this project largely supersedes the\n-[@thi.ng/iterators](https://github.com/thi-ng/umbrella/tree/master/packages/iterators)\n-library for most use cases and offers are more powerful API and\n-potentially faster execution of composed transformations (due to lack of\n-ES generator overheads).\n## Installation\n",
"new_path": "packages/transducers/README.md",
"old_path": "packages/transducers/README.md"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | docs(transducers): update readmes | 1 | docs | transducers |
807,849 | 23.07.2018 10:04:18 | 25,200 | 151363f63ec7a35390b83cd14b83c82cecaf63e0 | fix(command): Prevent premature resolution during tests from nested commands | [
{
"change_type": "MODIFY",
"diff": "@@ -77,8 +77,15 @@ class Command {\n});\n// passed via yargs context in tests, never actual CLI\n+ /* istanbul ignore else */\n+ if (argv.onResolved || argv.onRejected) {\nrunner = runner.then(argv.onResolved, argv.onRejected);\n+ // when nested, never resolve inner with outer callbacks\n+ delete argv.onResolved; // eslint-disable-line no-param-reassign\n+ delete argv.onRejected; // eslint-disable-line no-param-reassign\n+ }\n+\n// proxy \"Promise\" methods to \"private\" instance\nthis.then = (onResolved, onRejected) => runner.then(onResolved, onRejected);\nthis.catch = onRejected => runner.catch(onRejected);\n",
"new_path": "core/command/index.js",
"old_path": "core/command/index.js"
}
] | JavaScript | MIT License | lerna/lerna | fix(command): Prevent premature resolution during tests from nested commands | 1 | fix | command |
730,424 | 23.07.2018 10:11:51 | 25,200 | 01b2b183411cd680f7c2daec5efab6a0d50aa4f3 | style(widget-recents): fix eslint | [
{
"change_type": "MODIFY",
"diff": "@@ -104,6 +104,20 @@ 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@@ -182,20 +196,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-\n@autobind\ngetSpaceFromCall(call) {\nreturn this.props.spaces.get(call.instance.locus.conversationUrl.split('/').pop());\n",
"new_path": "packages/node_modules/@ciscospark/widget-recents/src/container.js",
"old_path": "packages/node_modules/@ciscospark/widget-recents/src/container.js"
}
] | JavaScript | MIT License | webex/react-widgets | style(widget-recents): fix eslint | 1 | style | widget-recents |
217,922 | 23.07.2018 13:32:01 | -7,200 | 75ff821a3f48d832f9560945e131282775490601 | feat: new team system with assignable items and notifications
closes | [
{
"change_type": "MODIFY",
"diff": "@@ -2,10 +2,10 @@ import {Relationship} from '../database/relational/relationship';\nimport {AbstractNotification} from './abstract-notification';\nimport {DeserializeAs} from '@kaiu/serializer';\n-export class NotificationRelationship extends Relationship<string, AbstractNotification> {\n+export class NotificationRelationship<T = AbstractNotification> extends Relationship<string, T> {\nfrom: string;\n@DeserializeAs(AbstractNotification)\n- to: AbstractNotification;\n+ to: T;\n}\n",
"new_path": "src/app/core/notification/notification-relationship.ts",
"old_path": "src/app/core/notification/notification-relationship.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -4,22 +4,23 @@ import {LocalizedDataService} from '../../core/data/localized-data.service';\nimport {TranslateService} from '@ngx-translate/core';\nimport {NotificationType} from '../../core/notification/notification-type';\nimport {Team} from '../other/team';\n-import {DeserializeAs} from '@kaiu/serializer';\nexport class TeamInviteNotification extends NotificationWithQuestion {\n- @DeserializeAs(Team)\n- public readonly team: Team;\n+ public teamName: string;\n+\n+ public teamId: string;\npublic constructor(private invitedBy: string, team: Team) {\nsuper(NotificationType.TEAM_INVITE);\n- this.team = team;\n+ this.teamName = team.name;\n+ this.teamId = team.$key;\n}\ngetContent(translate: TranslateService, l12n: LocalizedDataService, i18nTools: I18nToolsService): string {\nreturn translate.instant('NOTIFICATIONS.Team_invite', {\ninvitedBy: this.invitedBy,\n- teamName: this.team.name\n+ teamName: this.teamName\n});\n}\n",
"new_path": "src/app/model/notification/team-invite-notification.ts",
"old_path": "src/app/model/notification/team-invite-notification.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -8,6 +8,7 @@ import {TranslateService} from '@ngx-translate/core';\nimport {TeamService} from '../../../core/database/team.service';\nimport {TeamInviteNotification} from '../../../model/notification/team-invite-notification';\nimport {SettingsService} from '../../settings/settings.service';\n+import {first, map, mergeMap} from 'rxjs/operators';\n@Component({\nselector: 'app-notifications',\n@@ -39,16 +40,24 @@ export class NotificationsComponent {\nthis.notificationService.remove(notification.$key);\n}\n- public answerQuestion(notification: NotificationRelationship, answer: boolean): void {\n+ public answerQuestion(notification: NotificationRelationship<TeamInviteNotification>, answer: boolean): void {\nswitch (notification.to.type) {\ncase 'TEAM_INVITE':\n+ this.teamService.get(notification.to.teamId)\n+ .pipe(\n+ first(),\n+ map(team => {\nif (answer) {\n- (<TeamInviteNotification>notification.to).team.confirmMember(notification.from);\n+ team.confirmMember(notification.from);\n} else {\n- (<TeamInviteNotification>notification.to).team.removeMember(notification.from);\n+ team.removeMember(notification.from);\n}\n- this.teamService.set((<TeamInviteNotification>notification.to).team.$key, (<TeamInviteNotification>notification.to).team)\n- .subscribe();\n+ return team;\n+ }),\n+ mergeMap(team => {\n+ return this.teamService.set(team.$key, team);\n+ })\n+ ).subscribe();\nbreak;\ndefault:\nbreak;\n",
"new_path": "src/app/pages/notifications/notifications/notifications.component.ts",
"old_path": "src/app/pages/notifications/notifications/notifications.component.ts"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | feat: new team system with assignable items and notifications
closes #463 | 1 | feat | null |
217,922 | 23.07.2018 14:26:58 | -7,200 | ca9ee6a1db579da9e434e9b73874ee8aa85e0291 | feat: display amount of unread notifications in sidebar | [
{
"change_type": "MODIFY",
"diff": "matTooltipPosition=\"right\"\nmatTooltip=\"{{'NOTIFICATIONS.Title' | translate}}\"\n[matTooltipDisabled]=\"!settings.compactSidebar\">\n- <mat-icon matListIcon *ngIf=\"hasNotifications$ | async; else noNotifications\">\n+ <mat-icon matListIcon *ngIf=\"notifications$ | async as notifications; else noNotifications\"\n+ matBadge=\"{{notifications}}\"\n+ matBadgeColor=\"accent\">\nnotifications_active\n</mat-icon>\n<ng-template #noNotifications>\n",
"new_path": "src/app/app.component.html",
"old_path": "src/app/app.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -88,7 +88,7 @@ export class AppComponent implements OnInit {\nhasCommissionBadge$: Observable<boolean>;\n- hasNotifications$: Observable<boolean>;\n+ notifications$: Observable<number>;\nconstructor(private auth: AngularFireAuth,\nprivate router: Router,\n@@ -115,9 +115,9 @@ export class AppComponent implements OnInit {\nthis.notificationService.init();\n- this.hasNotifications$ = this.notificationService.notifications$.pipe(\n+ this.notifications$ = this.notificationService.notifications$.pipe(\nmap(relationships => relationships.filter(r => !r.to.read)),\n- map(relationships => relationships.length > 0)\n+ map(relationships => relationships.length)\n);\nsettings.themeChange$.subscribe(change => {\n",
"new_path": "src/app/app.component.ts",
"old_path": "src/app/app.component.ts"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | feat: display amount of unread notifications in sidebar | 1 | feat | null |
791,690 | 23.07.2018 16:44:14 | 25,200 | 4e11f2534ec4c27b1fc721eb37ee99175bdc97dd | core(i18n): localize strings at end of run | [
{
"change_type": "MODIFY",
"diff": "@@ -31,13 +31,9 @@ const UIStrings = {\ndescription: '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-const str_ = i18n.createStringFormatter(__filename, UIStrings);\n+const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);\n/**\n* Given a simulation's nodeTimings, return an object with the nodes/timing keyed by network URL\n@@ -210,14 +206,14 @@ class RenderBlockingResources extends Audit {\nlet displayValue = '';\nif (results.length > 0) {\n- displayValue = str_(UIStrings.displayValue, {timeInMs: wastedMs, itemCount: results.length});\n+ displayValue = str_(i18n.UIStrings.displayValueWastedMs, {wastedMs});\n}\n/** @type {LH.Result.Audit.OpportunityDetails['headings']} */\nconst headings = [\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+ {key: 'wastedMs', valueType: 'timespanMs', label: str_(i18n.UIStrings.columnWastedMs)},\n];\nconst details = Audit.makeOpportunityDetails(headings, results, wastedMs);\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": "@@ -14,7 +14,7 @@ const UIStrings = {\n'[Learn more](https://developers.google.com/web/tools/lighthouse/audits/consistently-interactive).',\n};\n-const str_ = i18n.createStringFormatter(__filename, UIStrings);\n+const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);\n/**\n* @fileoverview This audit identifies the time the page is \"consistently interactive\".\n",
"new_path": "lighthouse-core/audits/metrics/interactive.js",
"old_path": "lighthouse-core/audits/metrics/interactive.js"
},
{
"change_type": "MODIFY",
"diff": "*/\n'use strict';\n+/* eslint-disable max-len */\n+\nconst constants = require('./constants');\n+const i18n = require('../lib/i18n');\n-/* eslint-disable max-len */\n+const UIStrings = {\n+ performanceCategoryTitle: 'Performance',\n+ metricGroupTitle: 'Metrics',\n+ loadOpportunitiesGroupTitle: 'Opportunities',\n+ loadOpportunitiesGroupDescription: 'These are opportunities to speed up your application by optimizing the following resources.',\n+ diagnosticsGroupTitle: 'Diagnostics',\n+ diagnosticsGroupDescription: 'More information about the performance of your application.',\n+};\n+\n+const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);\nmodule.exports = {\nsettings: constants.defaultSettings,\n@@ -188,15 +200,15 @@ module.exports = {\ngroups: {\n'metrics': {\n- title: 'Metrics',\n+ title: str_(UIStrings.metricGroupTitle),\n},\n'load-opportunities': {\n- title: 'Opportunities',\n- description: 'These are opportunities to speed up your application by optimizing the following resources.',\n+ title: str_(UIStrings.loadOpportunitiesGroupTitle),\n+ description: str_(UIStrings.loadOpportunitiesGroupDescription),\n},\n'diagnostics': {\n- title: 'Diagnostics',\n- description: 'More information about the performance of your application.',\n+ title: str_(UIStrings.diagnosticsGroupTitle),\n+ description: str_(UIStrings.diagnosticsGroupDescription),\n},\n'a11y-color-contrast': {\ntitle: 'Color Contrast Is Satisfactory',\n@@ -246,7 +258,7 @@ module.exports = {\n},\ncategories: {\n'performance': {\n- title: 'Performance',\n+ title: str_(UIStrings.performanceCategoryTitle),\nauditRefs: [\n{id: 'first-contentful-paint', weight: 3, group: 'metrics'},\n{id: 'first-meaningful-paint', weight: 1, group: 'metrics'},\n@@ -409,3 +421,9 @@ module.exports = {\n},\n},\n};\n+\n+// Use `defineProperty` so that the strings are accesible from original but ignored when we copy it\n+Object.defineProperty(module.exports, 'UIStrings', {\n+ enumerable: false,\n+ get: () => UIStrings,\n+});\n",
"new_path": "lighthouse-core/config/default-config.js",
"old_path": "lighthouse-core/config/default-config.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@@ -35,7 +34,6 @@ 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": "MODIFY",
"diff": "'use strict';\nconst path = require('path');\n+const isDeepEqual = require('lodash.isequal');\n+const log = require('lighthouse-logger');\nconst MessageFormat = require('intl-messageformat').default;\nconst MessageParser = require('intl-messageformat-parser');\nconst LOCALES = require('./locales');\n-let locale = MessageFormat.defaultLocale;\n-\nconst LH_ROOT = path.join(__dirname, '../../');\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+ // Node usually doesn't come with the locales we want built-in, so load the polyfill if we can.\n+ try {\n// @ts-ignore\nconst IntlPolyfill = require('intl');\n+ // In browser environments where we don't need the polyfill, this won't exist\n+ if (!IntlPolyfill.NumberFormat) return;\n+\n// @ts-ignore\nIntl.NumberFormat = IntlPolyfill.NumberFormat;\n// @ts-ignore\nIntl.DateTimeFormat = IntlPolyfill.DateTimeFormat;\n-} catch (_) {}\n+ } catch (_) {\n+ log.warn('i18n', 'Failed to install `intl` polyfill');\n+ }\n+})();\n+\nconst UIStrings = {\nms: '{timeInMs, number, milliseconds}\\xa0ms',\ncolumnURL: 'URL',\ncolumnSize: 'Size (KB)',\n- columnWastedTime: 'Potential Savings (ms)',\n+ columnWastedMs: 'Potential Savings (ms)',\n+ displayValueWastedMs: 'Potential savings of {wastedMs, number, milliseconds}\\xa0ms',\n};\nconst formats = {\n@@ -42,58 +50,171 @@ const formats = {\n};\n/**\n- * @param {string} msg\n- * @param {Record<string, *>} values\n+ * @param {string} icuMessage\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+function _preprocessMessageValues(icuMessage, values) {\n+ if (!values) return;\n+\n+ const clonedValues = JSON.parse(JSON.stringify(values));\n+ const parsed = MessageParser.parse(icuMessage);\n+ // Round all milliseconds to the nearest 10\nparsed.elements\n.filter(el => el.format && el.format.style === 'milliseconds')\n- .forEach(el => (values[el.id] = Math.round(values[el.id] / 10) * 10));\n+ .forEach(el => (clonedValues[el.id] = Math.round(clonedValues[el.id] / 10) * 10));\n// Replace all the bytes with KB\nparsed.elements\n.filter(el => el.format && el.format.style === 'bytes')\n- .forEach(el => (values[el.id] = values[el.id] / 1024));\n+ .forEach(el => (clonedValues[el.id] = clonedValues[el.id] / 1024));\n+\n+ return clonedValues;\n}\n-module.exports = {\n- UIStrings,\n/**\n- * @param {string} filename\n- * @param {Record<string, string>} fileStrings\n+ * @typedef IcuMessageInstance\n+ * @prop {string} icuMessageId\n+ * @prop {string} icuMessage\n+ * @prop {*} [values]\n*/\n- createStringFormatter(filename, fileStrings) {\n- const mergedStrings = {...UIStrings, ...fileStrings};\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+/** @type {Map<string, IcuMessageInstance[]>} */\n+const _icuMessageInstanceMap = new Map();\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+/**\n+ *\n+ * @param {LH.Locale} locale\n+ * @param {string} icuMessageId\n+ * @param {string} icuMessage\n+ * @param {*} [values]\n+ * @return {{formattedString: string, icuMessage: string}}\n+ */\n+function _formatIcuMessage(locale, icuMessageId, icuMessage, values) {\n+ const localeMessages = LOCALES[locale] || {};\n+ const localeMessage = localeMessages[icuMessageId] && localeMessages[icuMessageId].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+ const messageForMessageFormat = localeMessage || icuMessage;\n// when using accented english, force the use of a different locale for number formatting\nconst localeForMessageFormat = locale === 'en-XA' ? 'de-DE' : locale;\n+ // pre-process values for the message format like KB and milliseconds\n+ const valuesForMessageFormat = _preprocessMessageValues(icuMessage, values);\nconst formatter = new MessageFormat(messageForMessageFormat, localeForMessageFormat, formats);\n- return formatter.format(values);\n+ const formattedString = formatter.format(valuesForMessageFormat);\n+\n+ return {formattedString, icuMessage: messageForMessageFormat};\n+}\n+\n+/** @param {string[]} pathInLHR */\n+function _formatPathAsString(pathInLHR) {\n+ let pathAsString = '';\n+ for (const property of pathInLHR) {\n+ if (/^[a-z]+$/i.test(property)) {\n+ if (pathAsString.length) pathAsString += '.';\n+ pathAsString += property;\n+ } else {\n+ if (/]|\"|'|\\s/.test(property)) throw new Error(`Cannot handle \"${property}\" in i18n`);\n+ pathAsString += `[${property}]`;\n+ }\n+ }\n+\n+ return pathAsString;\n+}\n+\n+/**\n+ * @return {LH.Locale}\n+ */\n+function getDefaultLocale() {\n+ const defaultLocale = MessageFormat.defaultLocale;\n+ if (defaultLocale in LOCALES) return /** @type {LH.Locale} */ (defaultLocale);\n+ return 'en-US';\n+}\n+\n+/**\n+ * @param {string} filename\n+ * @param {Record<string, string>} fileStrings\n+ */\n+function createMessageInstanceIdFn(filename, fileStrings) {\n+ const mergedStrings = {...UIStrings, ...fileStrings};\n+\n+ /** @param {string} icuMessage @param {*} [values] */\n+ const getMessageInstanceIdFn = (icuMessage, values) => {\n+ const keyname = Object.keys(mergedStrings).find(key => mergedStrings[key] === icuMessage);\n+ if (!keyname) throw new Error(`Could not locate: ${icuMessage}`);\n+\n+ const filenameToLookup = keyname in fileStrings ? filename : __filename;\n+ const unixStyleFilename = path.relative(LH_ROOT, filenameToLookup).replace(/\\\\/g, '/');\n+ const icuMessageId = `${unixStyleFilename} | ${keyname}`;\n+ const icuMessageInstances = _icuMessageInstanceMap.get(icuMessageId) || [];\n+\n+ let indexOfInstance = icuMessageInstances.findIndex(inst => isDeepEqual(inst.values, values));\n+ if (indexOfInstance === -1) {\n+ icuMessageInstances.push({icuMessageId, icuMessage, values});\n+ indexOfInstance = icuMessageInstances.length - 1;\n+ }\n+\n+ _icuMessageInstanceMap.set(icuMessageId, icuMessageInstances);\n+\n+ return `${icuMessageId} # ${indexOfInstance}`;\n};\n- return formatFn;\n- },\n+ return getMessageInstanceIdFn;\n+}\n+\n/**\n- * @param {LH.Locale|null} [newLocale]\n+ * @param {LH.Result} lhr\n+ * @param {LH.Locale} locale\n*/\n- setLocale(newLocale) {\n- if (!newLocale) return;\n- locale = newLocale;\n- },\n+function replaceIcuMessageInstanceIds(lhr, locale) {\n+ const MESSAGE_INSTANCE_ID_REGEX = /(.* \\| .*) # (\\d+)$/;\n+\n+ /**\n+ * @param {*} objectInLHR\n+ * @param {LH.I18NMessages} icuMessagePaths\n+ * @param {string[]} pathInLHR\n+ */\n+ function replaceInObject(objectInLHR, icuMessagePaths, pathInLHR = []) {\n+ if (typeof objectInLHR !== 'object' || !objectInLHR) return;\n+\n+ for (const [property, value] of Object.entries(objectInLHR)) {\n+ const currentPathInLHR = pathInLHR.concat([property]);\n+\n+ // Check to see if the value in the LHR looks like a string reference. If it is, replace it.\n+ if (typeof value === 'string' && MESSAGE_INSTANCE_ID_REGEX.test(value)) {\n+ // @ts-ignore - Guaranteed to match from .test call above\n+ const [_, icuMessageId, icuMessageInstanceIndex] = value.match(MESSAGE_INSTANCE_ID_REGEX);\n+ const messageInstancesInLHR = icuMessagePaths[icuMessageId] || [];\n+ const icuMessageInstances = _icuMessageInstanceMap.get(icuMessageId) || [];\n+ const icuMessageInstance = icuMessageInstances[Number(icuMessageInstanceIndex)];\n+ const currentPathAsString = _formatPathAsString(currentPathInLHR);\n+\n+ messageInstancesInLHR.push(\n+ icuMessageInstance.values ?\n+ {values: icuMessageInstance.values, path: currentPathAsString} :\n+ currentPathAsString\n+ );\n+\n+ const {formattedString} = _formatIcuMessage(locale, icuMessageId,\n+ icuMessageInstance.icuMessage, icuMessageInstance.values);\n+\n+ objectInLHR[property] = formattedString;\n+ icuMessagePaths[icuMessageId] = messageInstancesInLHR;\n+ } else {\n+ replaceInObject(value, icuMessagePaths, currentPathInLHR);\n+ }\n+ }\n+ }\n+\n+ const icuMessagePaths = {};\n+ replaceInObject(lhr, icuMessagePaths);\n+ lhr.i18n = {icuMessagePaths};\n+}\n+\n+module.exports = {\n+ _formatPathAsString,\n+ UIStrings,\n+ getDefaultLocale,\n+ createMessageInstanceIdFn,\n+ replaceIcuMessageInstanceIds,\n};\n",
"new_path": "lighthouse-core/lib/i18n.js",
"old_path": "lighthouse-core/lib/i18n.js"
},
{
"change_type": "MODIFY",
"diff": "'use strict';\nmodule.exports = {\n+ 'en-US': require('./en-US.json'),\n'en-XA': require('./en-XA.json'),\n};\n",
"new_path": "lighthouse-core/lib/locales/index.js",
"old_path": "lighthouse-core/lib/locales/index.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -11,6 +11,7 @@ const GatherRunner = require('./gather/gather-runner');\nconst ReportScoring = require('./scoring');\nconst Audit = require('./audits/audit');\nconst log = require('lighthouse-logger');\n+const i18n = require('./lib/i18n');\nconst assetSaver = require('./lib/asset-saver');\nconst fs = require('fs');\nconst path = require('path');\n@@ -31,6 +32,7 @@ class Runner {\ntry {\nconst startTime = Date.now();\nconst settings = opts.config.settings;\n+ settings.locale = settings.locale || i18n.getDefaultLocale();\n/**\n* List of top-level warnings for this Lighthouse run.\n@@ -135,6 +137,8 @@ class Runner {\ntiming: {total: Date.now() - startTime},\n};\n+ i18n.replaceIcuMessageInstanceIds(lhr, settings.locale);\n+\nconst report = generateReport(lhr, settings.output);\nreturn {lhr, artifacts, report};\n} catch (err) {\n",
"new_path": "lighthouse-core/runner.js",
"old_path": "lighthouse-core/runner.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -40,7 +40,7 @@ function collectAllStringsInDir(dir, strings = {}) {\nconst mod = require(fullPath);\nif (!mod.UIStrings) continue;\nfor (const [key, value] of Object.entries(mod.UIStrings)) {\n- strings[`${relativePath}!#${key}`] = value;\n+ strings[`${relativePath} | ${key}`] = value;\n}\n}\n}\n",
"new_path": "lighthouse-core/scripts/i18n/collect-strings.js",
"old_path": "lighthouse-core/scripts/i18n/collect-strings.js"
},
{
"change_type": "MODIFY",
"diff": "const Interactive = require('../../../audits/metrics/interactive.js');\nconst Runner = require('../../../runner.js');\n-const Util = require('../../../report/html/renderer/util');\nconst assert = require('assert');\nconst options = Interactive.defaultOptions;\n@@ -35,7 +34,7 @@ describe('Performance: interactive audit', () => {\nreturn Interactive.audit(artifacts, {options, settings}).then(output => {\nassert.equal(output.score, 1);\nassert.equal(Math.round(output.rawValue), 1582);\n- assert.equal(Util.formatDisplayValue(output.displayValue), '1,580\\xa0ms');\n+ assert.ok(output.displayValue);\n});\n});\n@@ -53,7 +52,7 @@ describe('Performance: interactive audit', () => {\nreturn Interactive.audit(artifacts, {options, settings}).then(output => {\nassert.equal(output.score, 0.97);\nassert.equal(Math.round(output.rawValue), 2712);\n- assert.equal(Util.formatDisplayValue(output.displayValue), '2,710\\xa0ms');\n+ assert.ok(output.displayValue);\n});\n});\n});\n",
"new_path": "lighthouse-core/test/audits/metrics/interactive-test.js",
"old_path": "lighthouse-core/test/audits/metrics/interactive-test.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 i18n = require('../../lib/i18n');\n+\n+/* eslint-env jest */\n+\n+describe('i18n', () => {\n+ describe('#_formatPathAsString', () => {\n+ it('handles simple paths', () => {\n+ expect(i18n._formatPathAsString(['foo'])).toBe('foo');\n+ expect(i18n._formatPathAsString(['foo', 'bar', 'baz'])).toBe('foo.bar.baz');\n+ });\n+\n+ it('handles array paths', () => {\n+ expect(i18n._formatPathAsString(['foo', 0])).toBe('foo[0]');\n+ });\n+\n+ it('handles complex paths', () => {\n+ const propertyPath = ['foo', 'what-the', 'bar', 0, 'no'];\n+ expect(i18n._formatPathAsString(propertyPath)).toBe('foo[what-the].bar[0].no');\n+ });\n+\n+ it('throws on unhandleable paths', () => {\n+ expect(() => i18n._formatPathAsString(['Bobby \"DROP TABLE'])).toThrow(/Cannot handle/);\n+ });\n+ });\n+\n+ describe('#createMessageInstanceIdFn', () => {\n+ it('returns a string reference', () => {\n+ const fakeFile = path.join(__dirname, 'fake-file.js');\n+ const templates = {daString: 'use me!'};\n+ const formatter = i18n.createMessageInstanceIdFn(fakeFile, templates);\n+\n+ const expected = 'lighthouse-core/test/lib/fake-file.js | daString # 0';\n+ expect(formatter(templates.daString, {x: 1})).toBe(expected);\n+ });\n+ });\n+\n+ describe('#replaceIcuMessageInstanceIds', () => {\n+ it('replaces the references in the LHR', () => {\n+ const templateID = 'lighthouse-core/test/lib/fake-file.js | daString';\n+ const reference = templateID + ' # 0';\n+ const lhr = {audits: {'fake-audit': {title: reference}}};\n+\n+ i18n.replaceIcuMessageInstanceIds(lhr, 'en-US');\n+ expect(lhr.audits['fake-audit'].title).toBe('use me!');\n+ expect(lhr.i18n.icuMessagePaths).toEqual({\n+ [templateID]: [{path: 'audits[fake-audit].title', values: {x: 1}}]});\n+ });\n+ });\n+});\n",
"new_path": "lighthouse-core/test/lib/i18n-test.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "const RawProtocol = require('../../../lighthouse-core/gather/connections/raw');\nconst Runner = require('../../../lighthouse-core/runner');\nconst Config = require('../../../lighthouse-core/config/config');\n+const i18n = require('../../../lighthouse-core/lib/i18n');\nconst defaultConfig = require('../../../lighthouse-core/config/default-config.js');\nconst log = require('lighthouse-logger');\n@@ -26,7 +27,10 @@ function runLighthouseForConnection(\nupdateBadgeFn = function() { }) {\nconst config = new Config({\nextends: 'lighthouse:default',\n- settings: {onlyCategories: categoryIDs},\n+ settings: {\n+ locale: i18n.getDefaultLocale(),\n+ onlyCategories: categoryIDs,\n+ },\n}, options.flags);\n// Add url and config to fresh options object.\n",
"new_path": "lighthouse-extension/app/src/lighthouse-background.js",
"old_path": "lighthouse-extension/app/src/lighthouse-background.js"
},
{
"change_type": "MODIFY",
"diff": "declare global {\nmodule LH {\n+ export type I18NMessageEntry = string | {path: string, values: any};\n+\n+ export interface I18NMessages {\n+ [templateID: string]: I18NMessageEntry[];\n+ }\n+\n/**\n* The full output of a Lighthouse run.\n*/\n@@ -35,6 +41,8 @@ declare global {\nuserAgent: string;\n/** Execution timings for the Lighthouse run */\ntiming: {total: number, [t: string]: number};\n+ /** The record of all formatted string locations in the LHR and their corresponding source values. */\n+ i18n?: {icuMessagePaths: I18NMessages};\n}\n// Result namespace\n",
"new_path": "typings/lhr.d.ts",
"old_path": "typings/lhr.d.ts"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | core(i18n): localize strings at end of run (#5655) | 1 | core | i18n |
217,922 | 23.07.2018 17:47:31 | -7,200 | 54b921def526fd83edfe4bd7fc20daec9b3dfda4 | chore: added thresholds binding to simulator component | [
{
"change_type": "MODIFY",
"diff": "@@ -3,6 +3,8 @@ import {I18nData} from '../list/i18n-data';\nimport {I18nDataRow} from '../list/i18n-data-row';\nimport {DeserializeFieldName} from '@kaiu/serializer';\nimport {Fish} from './fish';\n+import {SatisfactionData} from './satisfaction-data';\n+import {Masterpiece} from './masterpiece';\nexport class Item implements I18nData {\n@@ -37,6 +39,9 @@ export class Item implements I18nData {\nfishingSpots?: number[];\nfish?: Fish;\nseeds?: number[];\n+ collectable: 1 | 0;\n+ satisfaction: SatisfactionData[];\n+ masterpiece: Masterpiece;\npublic hasNodes(): boolean {\nreturn this.nodes !== undefined;\n",
"new_path": "src/app/model/garland-tools/item.ts",
"old_path": "src/app/model/garland-tools/item.ts"
},
{
"change_type": "ADD",
"diff": "+export interface Masterpiece {\n+ rating: number[];\n+ amount: number;\n+ stars: number;\n+ lvl: number[];\n+ xp: number[];\n+ reward: number;\n+ rewardAmount: number[];\n+}\n",
"new_path": "src/app/model/garland-tools/masterpiece.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+export interface SatisfactionData {\n+ level: number;\n+ npc: number;\n+ probability: number;\n+ rating: number[];\n+ satisfaction: number[];\n+ gil: number[];\n+ items: { id: number, amount: number[] }[];\n+}\n",
"new_path": "src/app/model/garland-tools/satisfaction-data.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "<app-simulator [recipe]=\"recipe\" [actions]=\"actions\" [itemId]=\"itemId\" [itemIcon]=\"itemIcon\" [canSave]=\"canSave\"\n(onsave)=\"save($event)\" [selectedFood]=\"selectedFood\" [selectedMedicine]=\"selectedMedicine\"\n[selectedFreeCompanyActions]=\"selectedFreeCompanyActions\"\n- [authorId]=\"authorId\" [rotation]=\"rotation\"></app-simulator>\n+ [authorId]=\"authorId\" [rotation]=\"rotation\" [thresholds]=\"thresholds\"></app-simulator>\n</div>\n</div>\n<ng-template #loading>\n",
"new_path": "src/app/pages/simulator/components/simulator-page/simulator-page.component.html",
"old_path": "src/app/pages/simulator/components/simulator-page/simulator-page.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -48,6 +48,8 @@ export class SimulatorPageComponent {\npublic rotation: CraftingRotation;\n+ public thresholds: number[] = [];\n+\nconstructor(private userService: UserService, private rotationsService: CraftingRotationService,\nprivate router: Router, activeRoute: ActivatedRoute, private registry: CraftingActionsRegistry,\nprivate data: DataService) {\n@@ -59,16 +61,31 @@ export class SimulatorPageComponent {\nmap(item => {\nthis.itemId = params.itemId;\nthis.itemIcon = item.item.icon;\n+\n+ let recipe: Craft;\n// If rotationId is only numbers, it's a recipeId\nif (params.rotationId !== undefined && /^\\d+$/.test(params.rotationId)) {\nthis.recipeId = params.rotationId;\n- return item.item.craft.find(craft => +craft.id === +this.recipeId);\n+ recipe = item.item.craft.find(craft => +craft.id === +this.recipeId);\n} else if (params.recipeId !== undefined) {\nthis.recipeId = params.recipeId;\n- return item.item.craft.find(craft => +craft.id === +this.recipeId);\n- }\n+ recipe = item.item.craft.find(craft => +craft.id === +this.recipeId);\n+ } else {\n// Because only crystals change between recipes, we take the first one.\n- return item.item.craft[0];\n+ recipe = item.item.craft[0];\n+ }\n+\n+ // If the item is collectable, we want to get thresholds\n+ if (item.item.collectable === 1) {\n+ // If it's a delivery item\n+ if (item.item.satisfaction !== undefined) {\n+ // We want thresholds on quality, not collectable score.\n+ this.thresholds = item.item.satisfaction[0].rating.map(r => r * 10);\n+ } else if (item.item.masterpiece !== undefined) {\n+ this.thresholds = item.item.masterpiece.rating.map(r => r * 10);\n+ }\n+ }\n+ return recipe;\n})\n);\n}),\n",
"new_path": "src/app/pages/simulator/components/simulator-page/simulator-page.component.ts",
"old_path": "src/app/pages/simulator/components/simulator-page/simulator-page.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -172,6 +172,9 @@ export class SimulatorComponent implements OnInit, OnDestroy {\n@Output()\npublic onsave: EventEmitter<Partial<CraftingRotation>> = new EventEmitter<Partial<CraftingRotation>>();\n+ @Input()\n+ public thresholds: number[];\n+\npublic simulation$: Observable<Simulation>;\npublic result$: Observable<SimulationResult>;\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 | chore: added thresholds binding to simulator component | 1 | chore | null |
724,111 | 24.07.2018 03:44:49 | -28,800 | 50c95987f22518a63bdd8bf05d6c88f639e7c50f | docs(zh): update | [
{
"change_type": "MODIFY",
"diff": "- `{Object} context`\n- `{Array<Component|Object>|Component} children`\n- `{Object} slots`\n- - `{Array<Componet|Object>|Component|String} default`\n- - `{Array<Componet|Object>|Component|String} named`\n+ - `{Array<Component|Object>|Component|String} default`\n+ - `{Array<Component|Object>|Component|String} named`\n- `{Object} mocks`\n- `{Object|Array<string>} stubs`\n- `{Vue} localVue`\n",
"new_path": "docs/zh/api/render.md",
"old_path": "docs/zh/api/render.md"
},
{
"change_type": "MODIFY",
"diff": "- `{Object} context`\n- `{Array<Component|Object>|Component} children`\n- `{Object} slots`\n- - `{Array<Componet|Object>|Component|String} default`\n- - `{Array<Componet|Object>|Component|String} named`\n+ - `{Array<Component|Object>|Component|String} default`\n+ - `{Array<Component|Object>|Component|String} named`\n- `{Object} mocks`\n- `{Object|Array<string>} stubs`\n- `{Vue} localVue`\n",
"new_path": "docs/zh/api/renderToString.md",
"old_path": "docs/zh/api/renderToString.md"
}
] | JavaScript | MIT License | vuejs/vue-test-utils | docs(zh): update (#848) | 1 | docs | zh |
217,922 | 24.07.2018 11:09:21 | -7,200 | 7e586757ec25cd8944fc0f753852f75da1350bcb | feat: you can now add all alarms for a given list using a single button
closes | [
{
"change_type": "MODIFY",
"diff": "@@ -5,13 +5,45 @@ import {combineLatest, Observable, of} from 'rxjs';\nimport {ListStore} from './storage/list/list-store';\nimport {Workshop} from '../../model/other/workshop';\nimport {catchError, map} from 'rxjs/operators';\n+import {ListRow} from '../../model/list/list-row';\n+import {BellNodesService} from '../data/bell-nodes.service';\n@Injectable()\nexport class ListService {\nconstructor(protected store: ListStore,\n- protected serializer: NgSerializerService) {\n+ protected serializer: NgSerializerService,\n+ private bellNodesService: BellNodesService) {\n+ }\n+\n+ /**\n+ * Checks if a given row in a list has timers available.\n+ * @param {ListRow} row\n+ * @returns {boolean}\n+ */\n+ public hasTimers(row: ListRow): boolean {\n+ const hasTimersFromNodes = row.gatheredBy !== undefined && row.gatheredBy.nodes !== undefined &&\n+ row.gatheredBy.nodes.filter(node => node.time !== undefined).length > 0;\n+ const hasTimersFromReductions = row.reducedFrom !== undefined && [].concat.apply([], row.reducedFrom\n+ .map(reduction => {\n+ if (reduction.obj !== undefined) {\n+ return reduction.obj.i;\n+ }\n+ return reduction;\n+ })\n+ .map(reduction => this.bellNodesService.getNodesByItemId(reduction))).length > 0;\n+ return hasTimersFromNodes || hasTimersFromReductions;\n+ }\n+\n+ public getTimedRows(list: List): ListRow[] {\n+ const timedRows = [];\n+ list.forEach(row => {\n+ if (this.hasTimers(row)) {\n+ timedRows.push(row);\n+ }\n+ });\n+ return timedRows;\n}\n/**\n",
"new_path": "src/app/core/database/list.service.ts",
"old_path": "src/app/core/database/list.service.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -50,6 +50,7 @@ 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 {ListService} from '../../../core/database/list.service';\n@Component({\nselector: 'app-item',\n@@ -306,7 +307,8 @@ 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 listService: ListService) {\nsuper();\nthis.rotations$ = this.userService.getUserData().pipe(\nmergeMap(user => {\n@@ -503,17 +505,7 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\n}\nupdateHasTimers(): void {\n- const hasTimersFromNodes = this.item.gatheredBy !== undefined && this.item.gatheredBy.nodes !== undefined &&\n- this.item.gatheredBy.nodes.filter(node => node.time !== undefined).length > 0;\n- const hasTimersFromReductions = this.item.reducedFrom !== undefined && [].concat.apply([], this.item.reducedFrom\n- .map(reduction => {\n- if (reduction.obj !== undefined) {\n- return reduction.obj.i;\n- }\n- return reduction;\n- })\n- .map(reduction => this.bellNodesService.getNodesByItemId(reduction))).length > 0;\n- this.hasTimers = hasTimersFromNodes || hasTimersFromReductions;\n+ this.hasTimers = this.listService.hasTimers(this.item);\n}\nopenRequirementsPopup(): void {\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": "matTooltip=\"{{'COMMISSION_BOARD.Create_commission' | translate}}\">\n<mat-icon>drafts</mat-icon>\n</button>\n+\n+ <button mat-mini-fab\n+ *ngIf=\"hasTimers\"\n+ (click)=\"createAllAlarms(listData)\"\n+ [matTooltip]=\"'LIST.Add_all_alarms' | translate\">\n+ <mat-icon>alarm_add</mat-icon>\n+ </button>\n+\n<div class=\"spacer\"></div>\n<button mat-mini-fab color=\"accent\"\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": "@@ -42,6 +42,7 @@ 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 {AlarmService} from '../../../core/time/alarm.service';\ndeclare const ga: Function;\n@@ -100,6 +101,8 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\n@Output()\nreload: EventEmitter<void> = new EventEmitter<void>();\n+ public hasTimers = false;\n+\nprivate completionDialogOpen = false;\nprivate upgradingList = false;\n@@ -113,7 +116,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 alarmService: AlarmService) {\nsuper();\nthis.initFilters();\nthis.listDisplay = this.listData$\n@@ -164,9 +168,20 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\nngOnChanges(changes: SimpleChanges): void {\nthis.updateDisplay();\n+ this.updateHasTimers();\nthis.listData$.next(this.listData);\n}\n+ private updateHasTimers(): void {\n+ if (this.listData !== undefined && this.listData !== null) {\n+ let hasTimers = false;\n+ this.listData.forEach(row => {\n+ hasTimers = hasTimers || this.listService.hasTimers(row);\n+ });\n+ this.hasTimers = hasTimers;\n+ }\n+ }\n+\nprivate updateDisplay(): void {\nif (this.listData !== undefined && this.listData !== null) {\n// We are using setTimeout here to avoid creating a new dialog box during change detection cycle.\n@@ -436,6 +451,29 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\n}\n}\n+ public createAllAlarms(list: List): void {\n+ this.userService.getUserData()\n+ .pipe(\n+ first(),\n+ map(user => {\n+ if (user.alarmGroups.find(group => group.name === list.name) === undefined) {\n+ user.alarmGroups.push({name: list.name, enabled: true});\n+ }\n+ return user;\n+ }),\n+ mergeMap(user => {\n+ return this.userService.set(user.$key, user);\n+ }),\n+ map(() => {\n+ const timedRows = this.listService.getTimedRows(list);\n+ timedRows.forEach(row => this.alarmService.register(row, list.name));\n+ })\n+ )\n+ .subscribe(() => {\n+ this.snack.open(this.translate.instant('ALARM.Alarms_created'), '', {duration: 3000});\n+ });\n+ }\n+\npublic forkList(list: List): void {\nconst fork: List = list.clone();\nthis.cd.detach();\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": "\"No_alarm\": \"No alarms set\",\n\"Add_alarm\": \"Add alarm\",\n\"Alarm_created\": \"Alarm created\",\n+ \"Alarms_created\": \"Alarms created\",\n\"Alarm_already_created\": \"Alarm already set\",\n\"Custom_sound\": \"Custom alarm sound\",\n\"New_group\": \"New alarm group\"\n\"Enable_crystals_tracking\": \"Enable crystals tracking\",\n\"Copy_as_text\": \"Copy as text\",\n\"Total_price\": \"Total trades (gils and currencies)\",\n+ \"Add_all_alarms\": \"Add all alarms for this list\",\n\"BUTTONS\": {\n\"Add_link_description\": \"Create a custom link for this list\",\n\"Create_template_description\": \"Create a template link for this list, which will create a copy of the list for whoever opens it\",\n",
"new_path": "src/assets/i18n/en.json",
"old_path": "src/assets/i18n/en.json"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | feat: you can now add all alarms for a given list using a single button
closes #465 | 1 | feat | null |
679,913 | 24.07.2018 12:29:16 | -3,600 | f7a084ae5b82c2c93d018f2aeae3f77333a98990 | feat(iges): add PolylineMode enum, update addPolyline2d()
add addPolygon2d() | [
{
"change_type": "MODIFY",
"diff": "@@ -87,6 +87,12 @@ export enum StatusHierarchy {\nUSE_PROP\n}\n+export enum PolylineMode {\n+ OPEN,\n+ CLOSED,\n+ FILLED\n+}\n+\n// spec page 24 (53)\nexport interface DictEntry {\ntype: number;\n",
"new_path": "packages/iges/src/api.ts",
"old_path": "packages/iges/src/api.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -20,6 +20,7 @@ import {\nGlobalParams,\nIGESDocument,\nParam,\n+ PolylineMode,\nType,\nUnit\n} from \"./api\";\n@@ -54,7 +55,7 @@ const $DATE = (d: Date) =>\n$Z2(d.getUTCSeconds())\n].join(\"\"));\n-export const newDocument = (g?: Partial<GlobalParams>): IGESDocument => {\n+export const newDocument = (g?: Partial<GlobalParams>, start?: string[]): IGESDocument => {\nconst globals = <GlobalParams>{ ...DEFAULT_GLOBALS, ...g };\nconst $FF = ff(globals.precision);\nconst $PARAM = defmulti<any[], string>((x) => x[1]);\n@@ -66,7 +67,7 @@ export const newDocument = (g?: Partial<GlobalParams>): IGESDocument => {\nreturn {\nglobals,\n- start: [\"Generated by @thi.ng/iges\"],\n+ start: start || [],\ndict: [],\nparam: [],\noffsets: {\n@@ -213,8 +214,8 @@ const formatParams = (doc: IGESDocument, params: Param[], fmtBody: (body: string\n// type table: page 38 (67)\n-// page 77 (106)\n-export const addPolyline2d = (doc: IGESDocument, pts: number[][], closed = false) => {\n+// sec 4.7, page 77 (106)\n+export const addPolyline2d = (doc: IGESDocument, pts: number[][], form: PolylineMode) => {\nconst did = doc.offsets.D;\nconst pid = doc.offsets.P;\nconst params = formatParams(\n@@ -222,13 +223,15 @@ export const addPolyline2d = (doc: IGESDocument, pts: number[][], closed = false\n[\n[106, Type.INT],\n[1, Type.INT],\n- [pts.length + (closed ? 1 : 0), Type.INT],\n+ [pts.length + (form === PolylineMode.CLOSED ? 1 : 0), Type.INT],\n[0, Type.FLOAT],\n...iterator(\nmapcat<number[], Param>(\n([x, y]) => [[x, Type.FLOAT], [y, Type.FLOAT]]\n),\n- closed ? wrap(pts, 1, false, true) : pts\n+ form === PolylineMode.CLOSED ?\n+ wrap(pts, 1, false, true) :\n+ pts\n)\n],\nformatParam(did, pid)\n@@ -237,7 +240,7 @@ export const addPolyline2d = (doc: IGESDocument, pts: number[][], closed = false\ndoc.offsets.D += 2;\ndoc.dict.push(...formatDictEntry(<DictEntry>{\ntype: 106,\n- form: 11,\n+ form: form === PolylineMode.FILLED ? 63 : 11,\nparam: pid,\nindex: did,\nlineCount: params.length,\n@@ -246,4 +249,12 @@ export const addPolyline2d = (doc: IGESDocument, pts: number[][], closed = false\nreturn doc;\n};\n+export const addPolygon2d = (doc: IGESDocument, pts: number[][]) =>\n+ addPolyline2d(doc, pts, PolylineMode.FILLED);\n+\n+// sec 4.23, page 123 (type 126)\n+// export const addNurbsCurve2d = (doc: IGESDocument, degree: number, pts: number[][], closed = false) => {\n+// doc; degree; pts; closed;\n+// };\n+\nexport * from \"./api\";\n\\ No newline at end of file\n",
"new_path": "packages/iges/src/index.ts",
"old_path": "packages/iges/src/index.ts"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | feat(iges): add PolylineMode enum, update addPolyline2d()
- add addPolygon2d() | 1 | feat | iges |
217,922 | 24.07.2018 13:37:24 | -7,200 | 81bad1bd7f8166b84889f809ad32c9c02bca7ccf | fix: deleted alarms wont be playing anymore
closes | [
{
"change_type": "MODIFY",
"diff": "@@ -68,7 +68,7 @@ export class AlarmService {\n*/\npublic unregister(id: number): void {\nthis.getAlarms(id).forEach((alarm) => {\n- this._alarms.get(alarm).next();\n+ this._alarms.get(alarm).next(null);\nthis._alarms.delete(alarm);\n});\nthis.persistAlarms();\n@@ -198,7 +198,6 @@ 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"
},
{
"change_type": "MODIFY",
"diff": "@@ -27,17 +27,17 @@ export class AlarmsSidebarComponent implements OnInit {\nngOnInit() {\nconst alarmGroups$ = combineLatest(this.etime.getEorzeanTime(), this.userService.getUserData())\n.pipe(\n- tap(([time, user]) => this.time = time),\n+ tap(([time]) => this.time = time),\nmap(([time, user]) => {\n- const result = user.alarmGroups.map(group => {\n+ const result = (user.alarmGroups || []).map(group => {\nreturn {groupName: group.name, enabled: group.enabled, alarms: []};\n});\nconst alarms: Alarm[] = [];\n- this.alarmService.alarms.forEach(alarm => {\n+ (user.alarms || []).forEach(alarm => {\nif (alarms.find(a => a.itemId === alarm.itemId) !== undefined) {\nreturn;\n}\n- const itemAlarms = this.alarmService.alarms.filter(a => a.itemId === alarm.itemId);\n+ const itemAlarms = user.alarms.filter(a => a.itemId === alarm.itemId);\nalarms.push(this.alarmService.closestAlarm(itemAlarms, time));\n});\nalarms.forEach(alarm => {\n",
"new_path": "src/app/modules/alarms-sidebar/alarms-sidebar/alarms-sidebar.component.ts",
"old_path": "src/app/modules/alarms-sidebar/alarms-sidebar/alarms-sidebar.component.ts"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | fix: deleted alarms wont be playing anymore
closes #514 | 1 | fix | null |
217,922 | 24.07.2018 14:03:14 | -7,200 | d4d5bdf258e63ef50f0f3c24e79cba29a7871103 | chore: updated README.md file with latest conventions | [
{
"change_type": "MODIFY",
"diff": "@@ -29,13 +29,22 @@ Simply run `npm start` to start a live server with file watcher.\n## Contributing\n+### Branch names\n+\n+When contributing to main repository, you'll notice that branche names follow a given pattern,\n+this pattern is the following: `<branch-type>/<short-description>`.\n+\n+Example: `feat/commission-history-tab` would be a branch that adds a commission history tab.\n+\n+We're using gitflow for this, more informations on [https://github.com/nvie/gitflow](https://github.com/nvie/gitflow)\n+\n### Commit Messages\nThe commit messages are checked by a pre-commit git hook, meaning that if they don't meet the requirements,\nyour commit will not be created.\nA commit message should follow this structure:\n```\n- <type>: <subject>\n+ <type>(<optional context>): <subject>\n<BLANK LINE>\n<body>\n<BLANK LINE>\n@@ -58,9 +67,23 @@ Simply run `npm start` to start a live server with file watcher.\n- **chore** - Changes that are not needed to be displayed in the changelog\n- **revert** - Commit reverts\n+ The optional context parameter (the part between parenthesis) is used to provide context\n+ easily inside the changelog, to avoid having to append \"inside page blabla\" at the end of the message.\n+\n+ Context values can be any of the major features:\n+\n+ - simulator\n+ - profile\n+ - search\n+ - commissions\n+ - alarms\n+ - gathering-locations\n+ - public-lists\n+ - pricing\n+\nExamples:\n- `chore: list menu not shown properly (#15)`\n+ `fix(simulator): byregots blessing now working as intended`\n```\nfix: need latest rxjs\n",
"new_path": "README.md",
"old_path": "README.md"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | chore: updated README.md file with latest conventions | 1 | chore | null |
807,849 | 24.07.2018 14:40:16 | 25,200 | 2fcac07fe4a677088fb88a77fa5b2e39716590cb | refactor(conventional-commits): split functions into modular lib/* | [
{
"change_type": "MODIFY",
"diff": "\"use strict\";\n-const conventionalChangelogCore = require(\"conventional-changelog-core\");\n-const conventionalRecommendedBump = require(\"conventional-recommended-bump\");\n-const dedent = require(\"dedent\");\n-const fs = require(\"fs-extra\");\n-const getStream = require(\"get-stream\");\n-const log = require(\"npmlog\");\n-const npa = require(\"npm-package-arg\");\n-const os = require(\"os\");\n-const path = require(\"path\");\n-const semver = require(\"semver\");\n-\n-const ValidationError = require(\"@lerna/validation-error\");\n-\n-const BLANK_LINE = os.EOL + os.EOL;\n-const CHANGELOG_HEADER = dedent`\n- # 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-\n-const cfgCache = new Map();\n-\n-function getChangelogConfig(changelogPreset = \"conventional-changelog-angular\", rootPath) {\n- let config = cfgCache.get(changelogPreset);\n-\n- if (!config) {\n- let presetPackageName = changelogPreset;\n-\n- // https://github.com/npm/npm-package-arg#result-object\n- const parsed = npa(presetPackageName, rootPath);\n-\n- if (parsed.type === \"directory\") {\n- if (parsed.raw[0] === \"@\") {\n- // npa parses scoped subpath reference as a directory\n- parsed.name = parsed.raw;\n- parsed.scope = parsed.raw.substring(0, parsed.raw.indexOf(\"/\"));\n- // un-scoped subpath shorthand handled in first catch block\n- } else {\n- presetPackageName = parsed.fetchSpec;\n- }\n- } else if (parsed.type === \"git\" && parsed.hosted && parsed.hosted.default === \"shortcut\") {\n- // probably a shorthand subpath, e.g. \"foo/bar\"\n- parsed.name = parsed.raw;\n- }\n-\n- // Maybe it doesn't need an implicit 'conventional-changelog-' prefix?\n- try {\n- // eslint-disable-next-line global-require, import/no-dynamic-require\n- config = require(presetPackageName);\n-\n- cfgCache.set(changelogPreset, config);\n-\n- // early exit, yay\n- return Promise.resolve(config);\n- } catch (err) {\n- log.verbose(\"getChangelogConfig\", err.message);\n- log.info(\"getChangelogConfig\", `Auto-prefixing conventional-commits preset '${changelogPreset}'`);\n-\n- // probably a deep shorthand subpath :P\n- parsed.name = parsed.raw;\n- }\n-\n- if (parsed.name.indexOf(\"conventional-changelog-\") < 0) {\n- // implicit 'conventional-changelog-' prefix\n- const parts = parsed.name.split(\"/\");\n- const start = parsed.scope ? 1 : 0;\n-\n- // foo => conventional-changelog-foo\n- // @scope/foo => @scope/conventional-changelog-foo\n- parts.splice(start, 1, `conventional-changelog-${parts[start]}`);\n-\n- // _technically_ supports 'foo/lib/bar.js', but that's gross\n- presetPackageName = parts.join(\"/\");\n- }\n-\n- try {\n- // eslint-disable-next-line global-require, import/no-dynamic-require\n- config = require(presetPackageName);\n-\n- cfgCache.set(changelogPreset, config);\n- } catch (err) {\n- log.warn(\"getChangelogConfig\", err.message);\n-\n- throw new ValidationError(\n- \"EPRESET\",\n- `Unable to load conventional-commits preset '${changelogPreset}'${\n- changelogPreset !== presetPackageName ? ` (${presetPackageName})` : \"\"\n- }`\n- );\n- }\n- }\n-\n- // the core presets are bloody Q.all() spreads\n- return Promise.resolve(config);\n-}\n-\n-function recommendVersion(pkg, type, { changelogPreset, rootPath }) {\n- log.silly(type, \"for %s at %s\", pkg.name, pkg.location);\n-\n- const options = {\n- path: pkg.location,\n- };\n-\n- if (type === \"independent\") {\n- options.lernaPackage = pkg.name;\n- }\n-\n- return getChangelogConfig(changelogPreset, rootPath).then(config => {\n- // \"new\" preset API\n- options.config = config;\n-\n- return new Promise((resolve, reject) => {\n- conventionalRecommendedBump(options, (err, data) => {\n- if (err) {\n- return reject(err);\n- }\n-\n- log.verbose(type, \"increment %s by %s\", pkg.version, data.releaseType);\n- resolve(semver.inc(pkg.version, data.releaseType));\n- });\n- });\n- });\n-}\n-\n-function makeBumpOnlyFilter(pkg) {\n- return newEntry => {\n- // When force publishing, it is possible that there will be no actual changes, only a version bump.\n- if (!newEntry.split(\"\\n\").some(line => line.startsWith(\"*\"))) {\n- // Add a note to indicate that only a version bump has occurred.\n- // TODO: actually list the dependencies that were bumped\n- const message = `**Note:** Version bump only for package ${pkg.name}`;\n-\n- // the extra blank lines preserve the whitespace delimiting releases\n- return [newEntry.trim(), message, BLANK_LINE].join(BLANK_LINE);\n- }\n-\n- return newEntry;\n- };\n-}\n-\n-function readExistingChangelog({ location }) {\n- const changelogFileLoc = path.join(location, \"CHANGELOG.md\");\n-\n- return Promise.resolve()\n- .then(() => fs.readFile(changelogFileLoc, \"utf8\"))\n- .catch(() => \"\") // allow missing file\n- .then(changelogContents => {\n- // CHANGELOG entries start with <a name=, we remove\n- // the header if it exists by starting at the first entry.\n- const firstEntryIndex = changelogContents.indexOf(\"<a name=\");\n-\n- if (firstEntryIndex !== -1) {\n- return changelogContents.substring(firstEntryIndex);\n- }\n-\n- return changelogContents;\n- })\n- .then(changelogContents => [changelogFileLoc, changelogContents]);\n-}\n-\n-function updateChangelog(pkg, type, { changelogPreset, rootPath, version }) {\n- log.silly(type, \"for %s at %s\", pkg.name, pkg.location);\n-\n- return getChangelogConfig(changelogPreset, rootPath).then(config => {\n- const options = {};\n- let context; // pass as positional because cc-core's merge-config is wack\n-\n- // cc-core mutates input :P\n- if (config.conventionalChangelog) {\n- // \"new\" preset API\n- options.config = Object.assign({}, config.conventionalChangelog);\n- } else {\n- // \"old\" preset API\n- options.config = Object.assign({}, config);\n- }\n-\n- // NOTE: must pass as positional argument due to weird bug in merge-config\n- const gitRawCommitsOpts = Object.assign({}, options.config.gitRawCommitsOpts);\n-\n- if (type === \"root\") {\n- context = { version };\n- } else {\n- // \"fixed\" or \"independent\"\n- gitRawCommitsOpts.path = pkg.location;\n- options.pkg = { path: pkg.manifestLocation };\n-\n- if (type === \"independent\") {\n- options.lernaPackage = pkg.name;\n- }\n- }\n-\n- // generate the markdown for the upcoming release.\n- const changelogStream = conventionalChangelogCore(options, context, gitRawCommitsOpts);\n-\n- return Promise.all([\n- getStream(changelogStream).then(makeBumpOnlyFilter(pkg)),\n- readExistingChangelog(pkg),\n- ]).then(([newEntry, [changelogFileLoc, changelogContents]]) => {\n- log.silly(type, \"writing new entry: %j\", newEntry);\n-\n- const content = [CHANGELOG_HEADER, newEntry, changelogContents].join(BLANK_LINE);\n-\n- return fs.writeFile(changelogFileLoc, content.trim() + os.EOL).then(() => {\n- log.verbose(type, \"wrote\", changelogFileLoc);\n-\n- return changelogFileLoc;\n- });\n- });\n- });\n-}\n+const recommendVersion = require(\"./lib/recommend-version\");\n+const updateChangelog = require(\"./lib/update-changelog\");\nexports.recommendVersion = recommendVersion;\nexports.updateChangelog = updateChangelog;\n",
"new_path": "core/conventional-commits/index.js",
"old_path": "core/conventional-commits/index.js"
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+const log = require(\"npmlog\");\n+const npa = require(\"npm-package-arg\");\n+const ValidationError = require(\"@lerna/validation-error\");\n+\n+module.exports = getChangelogConfig;\n+\n+const cfgCache = new Map();\n+\n+function getChangelogConfig(changelogPreset = \"conventional-changelog-angular\", rootPath) {\n+ let config = cfgCache.get(changelogPreset);\n+\n+ if (!config) {\n+ let presetPackageName = changelogPreset;\n+\n+ // https://github.com/npm/npm-package-arg#result-object\n+ const parsed = npa(presetPackageName, rootPath);\n+\n+ if (parsed.type === \"directory\") {\n+ if (parsed.raw[0] === \"@\") {\n+ // npa parses scoped subpath reference as a directory\n+ parsed.name = parsed.raw;\n+ parsed.scope = parsed.raw.substring(0, parsed.raw.indexOf(\"/\"));\n+ // un-scoped subpath shorthand handled in first catch block\n+ } else {\n+ presetPackageName = parsed.fetchSpec;\n+ }\n+ } else if (parsed.type === \"git\" && parsed.hosted && parsed.hosted.default === \"shortcut\") {\n+ // probably a shorthand subpath, e.g. \"foo/bar\"\n+ parsed.name = parsed.raw;\n+ }\n+\n+ // Maybe it doesn't need an implicit 'conventional-changelog-' prefix?\n+ try {\n+ // eslint-disable-next-line global-require, import/no-dynamic-require\n+ config = require(presetPackageName);\n+\n+ cfgCache.set(changelogPreset, config);\n+\n+ // early exit, yay\n+ return Promise.resolve(config);\n+ } catch (err) {\n+ log.verbose(\"getChangelogConfig\", err.message);\n+ log.info(\"getChangelogConfig\", `Auto-prefixing conventional-commits preset '${changelogPreset}'`);\n+\n+ // probably a deep shorthand subpath :P\n+ parsed.name = parsed.raw;\n+ }\n+\n+ if (parsed.name.indexOf(\"conventional-changelog-\") < 0) {\n+ // implicit 'conventional-changelog-' prefix\n+ const parts = parsed.name.split(\"/\");\n+ const start = parsed.scope ? 1 : 0;\n+\n+ // foo => conventional-changelog-foo\n+ // @scope/foo => @scope/conventional-changelog-foo\n+ parts.splice(start, 1, `conventional-changelog-${parts[start]}`);\n+\n+ // _technically_ supports 'foo/lib/bar.js', but that's gross\n+ presetPackageName = parts.join(\"/\");\n+ }\n+\n+ try {\n+ // eslint-disable-next-line global-require, import/no-dynamic-require\n+ config = require(presetPackageName);\n+\n+ cfgCache.set(changelogPreset, config);\n+ } catch (err) {\n+ log.warn(\"getChangelogConfig\", err.message);\n+\n+ throw new ValidationError(\n+ \"EPRESET\",\n+ `Unable to load conventional-commits preset '${changelogPreset}'${\n+ changelogPreset !== presetPackageName ? ` (${presetPackageName})` : \"\"\n+ }`\n+ );\n+ }\n+ }\n+\n+ // the core presets are bloody Q.all() spreads\n+ return Promise.resolve(config);\n+}\n",
"new_path": "core/conventional-commits/lib/get-changelog-config.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+const os = require(\"os\");\n+\n+module.exports = makeBumpOnlyFilter;\n+\n+const BLANK_LINE = os.EOL + os.EOL;\n+\n+function makeBumpOnlyFilter(pkg) {\n+ return newEntry => {\n+ // When force publishing, it is possible that there will be no actual changes, only a version bump.\n+ if (!newEntry.split(\"\\n\").some(line => line.startsWith(\"*\"))) {\n+ // Add a note to indicate that only a version bump has occurred.\n+ // TODO: actually list the dependencies that were bumped\n+ const message = `**Note:** Version bump only for package ${pkg.name}`;\n+\n+ // the extra blank lines preserve the whitespace delimiting releases\n+ return [newEntry.trim(), message, BLANK_LINE].join(BLANK_LINE);\n+ }\n+\n+ return newEntry;\n+ };\n+}\n",
"new_path": "core/conventional-commits/lib/make-bump-only-filter.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+const fs = require(\"fs-extra\");\n+const path = require(\"path\");\n+\n+module.exports = readExistingChangelog;\n+\n+function readExistingChangelog(pkg) {\n+ const changelogFileLoc = path.join(pkg.location, \"CHANGELOG.md\");\n+\n+ let chain = Promise.resolve();\n+\n+ // catch allows missing file to pass without breaking chain\n+ chain = chain.then(() => fs.readFile(changelogFileLoc, \"utf8\").catch(() => \"\"));\n+\n+ chain = chain.then(changelogContents => {\n+ // CHANGELOG entries start with <a name=, we remove\n+ // the header if it exists by starting at the first entry.\n+ const firstEntryIndex = changelogContents.indexOf(\"<a name=\");\n+\n+ if (firstEntryIndex !== -1) {\n+ return changelogContents.substring(firstEntryIndex);\n+ }\n+\n+ return changelogContents;\n+ });\n+\n+ // consumer expects resolved tuple\n+ chain = chain.then(changelogContents => [changelogFileLoc, changelogContents]);\n+\n+ return chain;\n+}\n",
"new_path": "core/conventional-commits/lib/read-existing-changelog.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+const conventionalRecommendedBump = require(\"conventional-recommended-bump\");\n+const log = require(\"npmlog\");\n+const semver = require(\"semver\");\n+const getChangelogConfig = require(\"./get-changelog-config\");\n+\n+module.exports = recommendVersion;\n+\n+function recommendVersion(pkg, type, { changelogPreset, rootPath }) {\n+ log.silly(type, \"for %s at %s\", pkg.name, pkg.location);\n+\n+ const options = {\n+ path: pkg.location,\n+ };\n+\n+ if (type === \"independent\") {\n+ options.lernaPackage = pkg.name;\n+ }\n+\n+ return getChangelogConfig(changelogPreset, rootPath).then(config => {\n+ // \"new\" preset API\n+ options.config = config;\n+\n+ return new Promise((resolve, reject) => {\n+ conventionalRecommendedBump(options, (err, data) => {\n+ if (err) {\n+ return reject(err);\n+ }\n+\n+ log.verbose(type, \"increment %s by %s\", pkg.version, data.releaseType);\n+ resolve(semver.inc(pkg.version, data.releaseType));\n+ });\n+ });\n+ });\n+}\n",
"new_path": "core/conventional-commits/lib/recommend-version.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+const conventionalChangelogCore = require(\"conventional-changelog-core\");\n+const dedent = require(\"dedent\");\n+const fs = require(\"fs-extra\");\n+const getStream = require(\"get-stream\");\n+const log = require(\"npmlog\");\n+const os = require(\"os\");\n+const getChangelogConfig = require(\"./get-changelog-config\");\n+const makeBumpOnlyFilter = require(\"./make-bump-only-filter\");\n+const readExistingChangelog = require(\"./read-existing-changelog\");\n+\n+module.exports = updateChangelog;\n+\n+const BLANK_LINE = os.EOL + os.EOL;\n+const CHANGELOG_HEADER = dedent`\n+ # 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+\n+function updateChangelog(pkg, type, { changelogPreset, rootPath, version }) {\n+ log.silly(type, \"for %s at %s\", pkg.name, pkg.location);\n+\n+ return getChangelogConfig(changelogPreset, rootPath).then(config => {\n+ const options = {};\n+ let context; // pass as positional because cc-core's merge-config is wack\n+\n+ // cc-core mutates input :P\n+ if (config.conventionalChangelog) {\n+ // \"new\" preset API\n+ options.config = Object.assign({}, config.conventionalChangelog);\n+ } else {\n+ // \"old\" preset API\n+ options.config = Object.assign({}, config);\n+ }\n+\n+ // NOTE: must pass as positional argument due to weird bug in merge-config\n+ const gitRawCommitsOpts = Object.assign({}, options.config.gitRawCommitsOpts);\n+\n+ if (type === \"root\") {\n+ context = { version };\n+ } else {\n+ // \"fixed\" or \"independent\"\n+ gitRawCommitsOpts.path = pkg.location;\n+ options.pkg = { path: pkg.manifestLocation };\n+\n+ if (type === \"independent\") {\n+ options.lernaPackage = pkg.name;\n+ }\n+ }\n+\n+ // generate the markdown for the upcoming release.\n+ const changelogStream = conventionalChangelogCore(options, context, gitRawCommitsOpts);\n+\n+ return Promise.all([\n+ getStream(changelogStream).then(makeBumpOnlyFilter(pkg)),\n+ readExistingChangelog(pkg),\n+ ]).then(([newEntry, [changelogFileLoc, changelogContents]]) => {\n+ log.silly(type, \"writing new entry: %j\", newEntry);\n+\n+ const content = [CHANGELOG_HEADER, newEntry, changelogContents].join(BLANK_LINE);\n+\n+ return fs.writeFile(changelogFileLoc, content.trim() + os.EOL).then(() => {\n+ log.verbose(type, \"wrote\", changelogFileLoc);\n+\n+ return changelogFileLoc;\n+ });\n+ });\n+ });\n+}\n",
"new_path": "core/conventional-commits/lib/update-changelog.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "\"url\": \"https://github.com/evocateur\"\n},\n\"files\": [\n+ \"lib\",\n\"index.js\"\n],\n\"main\": \"index.js\",\n",
"new_path": "core/conventional-commits/package.json",
"old_path": "core/conventional-commits/package.json"
}
] | JavaScript | MIT License | lerna/lerna | refactor(conventional-commits): split functions into modular lib/* | 1 | refactor | conventional-commits |
791,690 | 24.07.2018 17:20:12 | 25,200 | eda3a3e2e271249f261655f9504fd542d6acf0f8 | core(i18n): export rendererFormattedStrings | [
{
"change_type": "MODIFY",
"diff": "@@ -131,6 +131,22 @@ function getDefaultLocale() {\nreturn 'en-US';\n}\n+/**\n+ * @param {LH.Locale} locale\n+ * @return {LH.I18NRendererStrings}\n+ */\n+function getRendererFormattedStrings(locale) {\n+ const icuMessageIds = Object.keys(LOCALES[locale]).filter(f => f.includes('core/report/html/'));\n+ const strings = {};\n+ for (const icuMessageId of icuMessageIds) {\n+ const [filename, varName] = icuMessageId.split(' | ');\n+ if (!filename.endsWith('util.js')) throw new Error(`Unexpected message: ${icuMessageId}`);\n+ strings[varName] = LOCALES[locale][icuMessageId].message;\n+ }\n+\n+ return strings;\n+}\n+\n/**\n* @param {string} filename\n* @param {Record<string, string>} fileStrings\n@@ -208,13 +224,14 @@ function replaceIcuMessageInstanceIds(lhr, locale) {\nconst icuMessagePaths = {};\nreplaceInObject(lhr, icuMessagePaths);\n- lhr.i18n = {icuMessagePaths};\n+ return icuMessagePaths;\n}\nmodule.exports = {\n_formatPathAsString,\nUIStrings,\ngetDefaultLocale,\n+ getRendererFormattedStrings,\ncreateMessageInstanceIdFn,\nreplaceIcuMessageInstanceIds,\n};\n",
"new_path": "lighthouse-core/lib/i18n.js",
"old_path": "lighthouse-core/lib/i18n.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -75,10 +75,10 @@ class CategoryRenderer {\nif (audit.result.scoreDisplayMode === 'error') {\nauditEl.classList.add(`lh-audit--error`);\nconst textEl = this.dom.find('.lh-audit__display-text', auditEl);\n- textEl.textContent = 'Error!';\n+ textEl.textContent = Util.UIStrings.errorLabel;\ntextEl.classList.add('tooltip-boundary');\nconst tooltip = this.dom.createChildOf(textEl, 'div', 'tooltip tooltip--error');\n- tooltip.textContent = audit.result.errorMessage || 'Report error: no audit information';\n+ tooltip.textContent = audit.result.errorMessage || Util.UIStrings.errorMissingAuditInfo;\n} else if (audit.result.explanation) {\nconst explEl = this.dom.createChildOf(titleEl, 'div', 'lh-audit-explanation');\nexplEl.textContent = audit.result.explanation;\n@@ -89,9 +89,9 @@ class CategoryRenderer {\n// Add list of warnings or singular warning\nconst warningsEl = this.dom.createChildOf(titleEl, 'div', 'lh-warnings');\nif (warnings.length === 1) {\n- warningsEl.textContent = `Warning: ${warnings.join('')}`;\n+ warningsEl.textContent = `${Util.UIStrings.warningHeader} ${warnings.join('')}`;\n} else {\n- warningsEl.textContent = 'Warnings: ';\n+ warningsEl.textContent = Util.UIStrings.warningHeader;\nconst warningsUl = this.dom.createChildOf(warningsEl, 'ul');\nfor (const warning of warnings) {\nconst item = this.dom.createChildOf(warningsUl, 'li');\n@@ -158,7 +158,7 @@ class CategoryRenderer {\nconst itemCountEl = this.dom.createChildOf(summmaryEl, 'div', 'lh-audit-group__itemcount');\nif (expandable) {\nconst chevronEl = summmaryEl.appendChild(this._createChevron());\n- chevronEl.title = 'Show audits';\n+ chevronEl.title = Util.UIStrings.auditGroupExpandTooltip;\n}\nif (group.description) {\n@@ -169,6 +169,7 @@ class CategoryRenderer {\nheaderEl.textContent = group.title;\nif (opts.itemCount) {\n+ // TODO(i18n): support multiple locales here\nitemCountEl.textContent = `${opts.itemCount} audits`;\n}\nreturn groupEl;\n@@ -211,7 +212,7 @@ class CategoryRenderer {\n*/\nrenderPassedAuditsSection(elements) {\nconst passedElem = this.renderAuditGroup({\n- title: `Passed audits`,\n+ title: Util.UIStrings.passedAuditsGroupTitle,\n}, {expandable: true, itemCount: this._getTotalAuditsLength(elements)});\npassedElem.classList.add('lh-passed-audits');\nelements.forEach(elem => passedElem.appendChild(elem));\n@@ -224,7 +225,7 @@ class CategoryRenderer {\n*/\n_renderNotApplicableAuditsSection(elements) {\nconst notApplicableElem = this.renderAuditGroup({\n- title: `Not applicable`,\n+ title: Util.UIStrings.notApplicableAuditsGroupTitle,\n}, {expandable: true, itemCount: this._getTotalAuditsLength(elements)});\nnotApplicableElem.classList.add('lh-audit-group--not-applicable');\nelements.forEach(elem => notApplicableElem.appendChild(elem));\n@@ -237,7 +238,7 @@ class CategoryRenderer {\n* @return {Element}\n*/\n_renderManualAudits(manualAudits, manualDescription) {\n- const group = {title: 'Additional items to manually check', description: manualDescription};\n+ const group = {title: Util.UIStrings.manualAuditsGroupTitle, description: manualDescription};\nconst auditGroupElem = this.renderAuditGroup(group,\n{expandable: true, itemCount: manualAudits.length});\nauditGroupElem.classList.add('lh-audit-group--manual');\n@@ -282,7 +283,7 @@ class CategoryRenderer {\npercentageEl.textContent = scoreOutOf100.toString();\nif (category.score === null) {\npercentageEl.textContent = '?';\n- percentageEl.title = 'Errors occurred while auditing';\n+ percentageEl.title = Util.UIStrings.errorLabel;\n}\nthis.dom.find('.lh-gauge__label', tmpl).textContent = category.title;\n",
"new_path": "lighthouse-core/report/html/renderer/category-renderer.js",
"old_path": "lighthouse-core/report/html/renderer/category-renderer.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -128,7 +128,7 @@ class PerformanceCategoryRenderer extends CategoryRenderer {\n});\nconst estValuesEl = this.dom.createChildOf(metricsColumn2El, 'div',\n'lh-metrics__disclaimer lh-metrics__disclaimer');\n- estValuesEl.textContent = 'Values are estimated and may vary.';\n+ estValuesEl.textContent = Util.UIStrings.varianceDisclaimer;\nmetricAuditsEl.classList.add('lh-audit-group--metrics');\nelement.appendChild(metricAuditsEl);\n@@ -156,6 +156,12 @@ class PerformanceCategoryRenderer extends CategoryRenderer {\nconst scale = Math.max(Math.ceil(maxWaste / 1000) * 1000, minimumScale);\nconst groupEl = this.renderAuditGroup(groups['load-opportunities'], {expandable: false});\nconst tmpl = this.dom.cloneTemplate('#tmpl-lh-opportunity-header', this.templateContext);\n+\n+ this.dom.find('.lh-load-opportunity__col--one', tmpl).textContent =\n+ Util.UIStrings.opportunityResourceColumnLabel;\n+ this.dom.find('.lh-load-opportunity__col--two', tmpl).textContent =\n+ Util.UIStrings.opportunitySavingsColumnLabel;\n+\nconst headerEl = this.dom.find('.lh-load-opportunity__header', tmpl);\ngroupEl.appendChild(headerEl);\nopportunityAudits.forEach((item, i) =>\n",
"new_path": "lighthouse-core/report/html/renderer/performance-category-renderer.js",
"old_path": "lighthouse-core/report/html/renderer/performance-category-renderer.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -35,6 +35,11 @@ class ReportRenderer {\nrenderReport(report, container) {\n// If any mutations happen to the report within the renderers, we want the original object untouched\nconst clone = /** @type {LH.ReportResult} */ (JSON.parse(JSON.stringify(report)));\n+ // Mutate the UIStrings if necessary (while saving originals)\n+ const clonedStrings = JSON.parse(JSON.stringify(Util.UIStrings));\n+ if (clone.i18n && clone.i18n.rendererFormattedStrings) {\n+ ReportRenderer.updateAllUIStrings(clone.i18n.rendererFormattedStrings);\n+ }\n// TODO(phulce): we all agree this is technical debt we should fix\nif (typeof clone.categories !== 'object') throw new Error('No categories provided.');\n@@ -43,6 +48,10 @@ class ReportRenderer {\ncontainer.textContent = ''; // Remove previous report.\ncontainer.appendChild(this._renderReport(clone));\n+\n+ // put the UIStrings back into original state\n+ ReportRenderer.updateAllUIStrings(clonedStrings);\n+\nreturn /** @type {Element} **/ (container);\n}\n@@ -126,6 +135,9 @@ class ReportRenderer {\n}\nconst container = this._dom.cloneTemplate('#tmpl-lh-warnings--toplevel', this._templateContext);\n+ const message = this._dom.find('.lh-warnings__msg', container);\n+ message.textContent = Util.UIStrings.toplevelWarningsMessage;\n+\nconst warnings = this._dom.find('ul', container);\nfor (const warningString of report.runWarnings) {\nconst warning = warnings.appendChild(this._dom.createElement('li'));\n@@ -187,6 +199,8 @@ class ReportRenderer {\nif (scoreHeader) {\nconst scoreScale = this._dom.cloneTemplate('#tmpl-lh-scorescale', this._templateContext);\n+ this._dom.find('.lh-scorescale-label', scoreScale).textContent =\n+ Util.UIStrings.scorescaleLabel;\nscoresContainer.appendChild(scoreHeader);\nscoresContainer.appendChild(scoreScale);\n}\n@@ -213,7 +227,20 @@ class ReportRenderer {\n});\n}\n}\n+\n+ /**\n+ * @param {LH.I18NRendererStrings} rendererFormattedStrings\n+ */\n+ static updateAllUIStrings(rendererFormattedStrings) {\n+ // TODO(i18n): don't mutate these here but on the LHR and pass that around everywhere\n+ for (const [key, value] of Object.entries(rendererFormattedStrings)) {\n+ Util.UIStrings[key] = value;\n+ }\n}\n+}\n+\n+/** @type {LH.I18NRendererStrings} */\n+ReportRenderer._UIStringsStash = {};\nif (typeof module !== 'undefined' && module.exports) {\nmodule.exports = ReportRenderer;\n",
"new_path": "lighthouse-core/report/html/renderer/report-renderer.js",
"old_path": "lighthouse-core/report/html/renderer/report-renderer.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -378,6 +378,23 @@ class Util {\n}\n}\n+Util.UIStrings = {\n+ varianceDisclaimer: 'Values are estimated and may vary.',\n+ opportunityResourceColumnLabel: 'Resource to optimize',\n+ opportunitySavingsColumnLabel: 'Estimated Savings',\n+\n+ errorMissingAuditInfo: 'Report error: no audit information',\n+ errorLabel: 'Error!',\n+ warningHeader: 'Warnings: ',\n+ auditGroupExpandTooltip: 'Show audits',\n+ passedAuditsGroupTitle: 'Passed audits',\n+ notApplicableAuditsGroupTitle: 'Not applicable',\n+ manualAuditsGroupTitle: 'Additional items to manually check',\n+\n+ toplevelWarningsMessage: 'There were issues affecting this run of Lighthouse:',\n+ scorescaleLabel: 'Score scale:',\n+};\n+\nif (typeof module !== 'undefined' && module.exports) {\nmodule.exports = Util;\n} else {\n",
"new_path": "lighthouse-core/report/html/renderer/util.js",
"old_path": "lighthouse-core/report/html/renderer/util.js"
},
{
"change_type": "MODIFY",
"diff": "<!-- Lighthouse run warnings -->\n<template id=\"tmpl-lh-warnings--toplevel\">\n<div class=\"lh-warnings lh-warnings--toplevel\">\n- <strong>There were issues affecting this run of Lighthouse:</strong>\n+ <strong class=\"lh-warnings__msg\"></strong>\n<ul></ul>\n</div>\n</template>\n<!-- Lighthouse score scale -->\n<template id=\"tmpl-lh-scorescale\">\n<div class=\"lh-scorescale\">\n- <span class=\"lh-scorescale-label\">Score scale:</span>\n+ <span class=\"lh-scorescale-label\"></span>\n<span class=\"lh-scorescale-range lh-scorescale-range--fail\">0-44</span>\n<span class=\"lh-scorescale-range lh-scorescale-range--average\">45-74</span>\n<span class=\"lh-scorescale-range lh-scorescale-range--pass\">75-100</span>\n<!-- Lighthouse perf opportunity header -->\n<template id=\"tmpl-lh-opportunity-header\">\n<div class=\"lh-load-opportunity__header lh-load-opportunity__cols\">\n- <div class=\"lh-load-opportunity__col lh-load-opportunity__col--one\">\n- Resource to optimize\n- </div>\n- <div class=\"lh-load-opportunity__col lh-load-opportunity__col--two\">\n- Estimated Savings\n- </div>\n+ <div class=\"lh-load-opportunity__col lh-load-opportunity__col--one\"></div>\n+ <div class=\"lh-load-opportunity__col lh-load-opportunity__col--two\"></div>\n</div>\n</template>\n<div class=\"lh-export\">\n<button class=\"report-icon report-icon--share lh-export__button\" title=\"Export report\"></button>\n<div class=\"lh-export__dropdown\">\n+ <!-- TODO(i18n): localize export dropdown -->\n<a href=\"#\" class=\"report-icon report-icon--print\" data-action=\"print-summary\">Print Summary</a>\n<a href=\"#\" class=\"report-icon report-icon--print\" data-action=\"print-expanded\">Print Expanded</a>\n<a href=\"#\" class=\"report-icon report-icon--copy\" data-action=\"copy\">Copy JSON</a>\n}\n</style>\n<footer class=\"lh-footer\">\n+ <!-- TODO(i18n): localize runtime settings -->\n<div class=\"lh-env\">\n<div class=\"lh-env__title\">Runtime settings</div>\n<ul class=\"lh-env__items\">\n}\n</style>\n<div>\n+ <!-- TODO(i18n): remove CRC sentences or localize -->\nLongest chain: <b class=\"lh-crc__longest_duration\"><!-- fill me: longestChain.duration --></b>\nover <b class=\"lh-crc__longest_length\"><!-- fill me: longestChain.length --></b> requests, totalling\n<b class=\"lh-crc__longest_transfersize\"><!-- fill me: longestChain.length --></b>\n",
"new_path": "lighthouse-core/report/html/templates.html",
"old_path": "lighthouse-core/report/html/templates.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -137,7 +137,10 @@ class Runner {\ntiming: {total: Date.now() - startTime},\n};\n- i18n.replaceIcuMessageInstanceIds(lhr, settings.locale);\n+ lhr.i18n = {\n+ rendererFormattedStrings: i18n.getRendererFormattedStrings(settings.locale),\n+ icuMessagePaths: i18n.replaceIcuMessageInstanceIds(lhr, settings.locale),\n+ };\nconst report = generateReport(lhr, settings.output);\nreturn {lhr, artifacts, report};\n",
"new_path": "lighthouse-core/runner.js",
"old_path": "lighthouse-core/runner.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -17,9 +17,9 @@ const ignoredPathComponents = [\n'/.git',\n'/scripts',\n'/node_modules',\n- '/renderer',\n'/test/',\n'-test.js',\n+ '-renderer.js',\n];\n/**\n",
"new_path": "lighthouse-core/scripts/i18n/collect-strings.js",
"old_path": "lighthouse-core/scripts/i18n/collect-strings.js"
},
{
"change_type": "MODIFY",
"diff": "}\n},\n\"i18n\": {\n+ \"rendererFormattedStrings\": {\n+ \"varianceDisclaimer\": \"Values are estimated and may vary.\",\n+ \"opportunityResourceColumnLabel\": \"Resource to optimize\",\n+ \"opportunitySavingsColumnLabel\": \"Estimated Savings\",\n+ \"errorMissingAuditInfo\": \"Report error: no audit information\",\n+ \"errorLabel\": \"Error!\",\n+ \"warningHeader\": \"Warnings: \",\n+ \"auditGroupExpandTooltip\": \"Show audits\",\n+ \"passedAuditsGroupTitle\": \"Passed audits\",\n+ \"notApplicableAuditsGroupTitle\": \"Not applicable\",\n+ \"manualAuditsGroupTitle\": \"Additional items to manually check\",\n+ \"toplevelWarningsMessage\": \"There were issues affecting this run of Lighthouse:\",\n+ \"scorescaleLabel\": \"Score scale:\"\n+ },\n\"icuMessagePaths\": {\n\"lighthouse-core/audits/metrics/interactive.js | title\": [\n\"audits.interactive.title\"\n",
"new_path": "lighthouse-core/test/results/sample_v2.json",
"old_path": "lighthouse-core/test/results/sample_v2.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -9,7 +9,11 @@ declare global {\nexport type I18NMessageEntry = string | {path: string, values: any};\nexport interface I18NMessages {\n- [templateID: string]: I18NMessageEntry[];\n+ [icuMessageId: string]: I18NMessageEntry[];\n+ }\n+\n+ export interface I18NRendererStrings {\n+ [varName: string]: string;\n}\n/**\n@@ -42,7 +46,7 @@ declare global {\n/** Execution timings for the Lighthouse run */\ntiming: {total: number, [t: string]: number};\n/** The record of all formatted string locations in the LHR and their corresponding source values. */\n- i18n?: {icuMessagePaths: I18NMessages};\n+ i18n?: {rendererFormattedStrings: I18NRendererStrings, icuMessagePaths: I18NMessages};\n}\n// Result namespace\n",
"new_path": "typings/lhr.d.ts",
"old_path": "typings/lhr.d.ts"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | core(i18n): export rendererFormattedStrings (#5713) | 1 | core | i18n |
807,849 | 25.07.2018 10:05:57 | 25,200 | ef0d41d46827e3c4c98b6bd876e8b025d41faeb2 | refactor(link): Use package graph getter instead of instance.packages | [
{
"change_type": "MODIFY",
"diff": "@@ -19,13 +19,10 @@ class LinkCommand extends Command {\n}\ninitialize() {\n- let graph = this.packageGraph;\n-\n- if (this.options.forceLocal) {\n- graph = new PackageGraph(this.packages, \"allDependencies\", \"forceLocal\");\n- }\n-\n- this.targetGraph = graph;\n+ this.allPackages = this.packageGraph.rawPackageList;\n+ this.targetGraph = this.options.forceLocal\n+ ? new PackageGraph(this.allPackages, \"allDependencies\", \"forceLocal\")\n+ : this.packageGraph;\n}\nexecute() {\n@@ -33,7 +30,7 @@ class LinkCommand extends Command {\nreturn this.convertLinksToFileSpecs();\n}\n- return symlinkDependencies(this.packages, this.targetGraph, this.logger);\n+ return symlinkDependencies(this.allPackages, this.targetGraph, this.logger);\n}\nconvertLinksToFileSpecs() {\n",
"new_path": "commands/link/index.js",
"old_path": "commands/link/index.js"
}
] | JavaScript | MIT License | lerna/lerna | refactor(link): Use package graph getter instead of instance.packages | 1 | refactor | link |
807,849 | 25.07.2018 10:07:05 | 25,200 | 32a211ae14db2e2122f85efbd5e74b1d2494f7e5 | refactor(command): Do not store raw packages list as instance property
BREAKING CHANGE: `this.packages` no longer exists in Command subclasses, use `this.packageGraph.rawPackageList` | [
{
"change_type": "MODIFY",
"diff": "@@ -229,15 +229,6 @@ describe(\"core-command\", () => {\n});\n});\n- describe(\".packages\", () => {\n- it(\"returns the list of packages\", async () => {\n- const command = testFactory();\n- await command;\n-\n- expect(command.packages).toEqual([]);\n- });\n- });\n-\ndescribe(\".packageGraph\", () => {\nit(\"returns the graph of packages\", async () => {\nconst command = testFactory();\n",
"new_path": "core/command/__tests__/command.test.js",
"old_path": "core/command/__tests__/command.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -200,7 +200,6 @@ class Command {\nchain = chain.then(() => this.project.getPackages());\nchain = chain.then(packages => {\n- this.packages = packages;\nthis.packageGraph = new PackageGraph(packages);\nthis.filteredPackages = filterPackages(\npackages,\n",
"new_path": "core/command/index.js",
"old_path": "core/command/index.js"
}
] | JavaScript | MIT License | lerna/lerna | refactor(command): Do not store raw packages list as instance property
BREAKING CHANGE: `this.packages` no longer exists in Command subclasses, use `this.packageGraph.rawPackageList` | 1 | refactor | command |
791,723 | 25.07.2018 12:52:25 | 25,200 | 13fe26f4bc8fd080b189adcf98bf995a4aabb43f | docs(report): add a renderer readme | [
{
"change_type": "MODIFY",
"diff": "@@ -11,7 +11,7 @@ _Some incomplete notes_\n* **Artifacts** - output of a gatherer\n* **Audit** - Tests for a single feature/optimization/metric. Using the Artifacts as input, an audit evaluates a test and resolves to a numeric score. See [Understanding Results](./understanding-results.md) for details of the LHR (Lighthouse Result object).\n* **Computed Artifacts** - Generated on-demand from artifacts, these add additional meaning, and are often shared amongst multiple audits.\n-* **Report** - The report UI, created client-side from the LHR. See [HTML Report Generation Overview](./report.md) for details.\n+* **Report** - The report UI, created client-side from the LHR. See [HTML Report Generation Overview](../lighthouse-core/report/html/readme.md) for details.\n### Audit/Report terminology\n* **Category** - Roll-up collection of audits and audit groups into a user-facing section of the report (eg. `Best Practices`). Applies weighting and overall scoring to the section. Examples: PWA, Accessibility, Best Practices.\n",
"new_path": "docs/architecture.md",
"old_path": "docs/architecture.md"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | docs(report): add a renderer readme (#5725) | 1 | docs | report |
807,849 | 25.07.2018 13:01:24 | 25,200 | 08f096bfe7fb0082f3be61b7a4e738b4006f8310 | refactor(publish): Use runLifecycle.createRunner() | [
{
"change_type": "MODIFY",
"diff": "@@ -9,12 +9,10 @@ jest.mock(\"../lib/is-behind-upstream\");\nconst path = require(\"path\");\n// mocked modules\n-const writePkg = require(\"write-pkg\");\nconst runLifecycle = require(\"@lerna/run-lifecycle\");\n// helpers\nconst initFixture = require(\"@lerna-test/init-fixture\")(__dirname);\n-const loggingOutput = require(\"@lerna-test/logging-output\");\n// test command\nconst lernaPublish = require(\"@lerna-test/command-runner\")(require(\"../command\"));\n@@ -29,23 +27,14 @@ describe(\"lifecycle scripts\", () => {\n[\"preversion\", \"version\", \"postversion\"].forEach(script => {\n// \"lifecycle\" is the root manifest name\n- expect(runLifecycle).toHaveBeenCalledWith(\n- expect.objectContaining({ name: \"lifecycle\" }),\n- script,\n- expect.any(Object) // conf\n- );\n- expect(runLifecycle).toHaveBeenCalledWith(\n- expect.objectContaining({ name: \"package-1\" }),\n- script,\n- expect.any(Object) // conf\n- );\n+ expect(runLifecycle).toHaveBeenCalledWith(expect.objectContaining({ name: \"lifecycle\" }), script);\n+ expect(runLifecycle).toHaveBeenCalledWith(expect.objectContaining({ name: \"package-1\" }), script);\n});\n// package-2 lacks version lifecycle scripts\nexpect(runLifecycle).not.toHaveBeenCalledWith(\nexpect.objectContaining({ name: \"package-2\" }),\n- expect.any(String),\n- expect.any(Object) // conf\n+ expect.any(String)\n);\nexpect(runLifecycle.getOrderedCalls()).toEqual([\n@@ -64,23 +53,6 @@ describe(\"lifecycle scripts\", () => {\n]);\n});\n- it(\"logs lifecycle errors but preserves chain\", async () => {\n- const cwd = await initFixture(\"lifecycle\");\n-\n- runLifecycle.mockImplementationOnce(() => Promise.reject(new Error(\"boom\")));\n-\n- await lernaPublish(cwd)();\n-\n- expect(runLifecycle).toHaveBeenCalledTimes(12);\n- expect(writePkg.updatedVersions()).toEqual({\n- \"package-1\": \"1.0.1\",\n- \"package-2\": \"1.0.1\",\n- });\n-\n- const [errorLog] = loggingOutput(\"error\");\n- expect(errorLog).toMatch(\"error running preversion in lifecycle\");\n- });\n-\nit(\"defaults missing root package name\", async () => {\nconst cwd = await initFixture(\"lifecycle-no-root-name\");\n@@ -94,8 +66,7 @@ describe(\"lifecycle scripts\", () => {\n// defaulted from dirname, like npm init\nname: path.basename(cwd),\n}),\n- script,\n- expect.any(Object) // conf\n+ script\n);\n});\n});\n",
"new_path": "commands/publish/__tests__/publish-lifecycle-scripts.test.js",
"old_path": "commands/publish/__tests__/publish-lifecycle-scripts.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -16,10 +16,9 @@ const ConventionalCommitUtilities = require(\"@lerna/conventional-commits\");\nconst PromptUtilities = require(\"@lerna/prompt\");\nconst output = require(\"@lerna/output\");\nconst collectUpdates = require(\"@lerna/collect-updates\");\n-const npmConf = require(\"@lerna/npm-conf\");\nconst npmDistTag = require(\"@lerna/npm-dist-tag\");\nconst npmPublish = require(\"@lerna/npm-publish\");\n-const runLifecycle = require(\"@lerna/run-lifecycle\");\n+const { createRunner } = require(\"@lerna/run-lifecycle\");\nconst batchPackages = require(\"@lerna/batch-packages\");\nconst runParallelBatches = require(\"@lerna/run-parallel-batches\");\nconst ValidationError = require(\"@lerna/validation-error\");\n@@ -128,7 +127,6 @@ class PublishCommand extends Command {\n}\n}\n- this.conf = npmConf(this.options);\nthis.updates = collectUpdates(this.filteredPackages, this.packageGraph, this.execOpts, this.options);\nif (!this.updates.length) {\n@@ -138,6 +136,8 @@ class PublishCommand extends Command {\nreturn false;\n}\n+ this.runPackageLifecycle = createRunner(this.options);\n+\nthis.packagesToPublish = this.updates.map(({ pkg }) => pkg).filter(pkg => !pkg.private);\nthis.batchedPackages = this.toposort\n@@ -477,14 +477,6 @@ class PublishCommand extends Command {\nreturn PromptUtilities.confirm(\"Are you sure you want to publish the above changes?\");\n}\n- runPackageLifecycle(pkg, stage) {\n- if (pkg.scripts[stage]) {\n- return runLifecycle(pkg, stage, this.conf).catch(err => {\n- this.logger.error(\"lifecycle\", `error running ${stage} in ${pkg.name}\\n`, err.stack || err);\n- });\n- }\n- }\n-\nupdateUpdatedPackages() {\nconst { conventionalCommits, changelogPreset } = this.options;\nconst independentVersions = this.project.isIndependent();\n",
"new_path": "commands/publish/index.js",
"old_path": "commands/publish/index.js"
},
{
"change_type": "MODIFY",
"diff": "\"@lerna/collect-updates\": \"file:../../utils/collect-updates\",\n\"@lerna/command\": \"file:../../core/command\",\n\"@lerna/conventional-commits\": \"file:../../core/conventional-commits\",\n- \"@lerna/npm-conf\": \"file:../../utils/npm-conf\",\n\"@lerna/npm-dist-tag\": \"file:../../utils/npm-dist-tag\",\n\"@lerna/npm-publish\": \"file:../../utils/npm-publish\",\n\"@lerna/output\": \"file:../../utils/output\",\n",
"new_path": "commands/publish/package.json",
"old_path": "commands/publish/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"@lerna/collect-updates\": \"file:utils/collect-updates\",\n\"@lerna/command\": \"file:core/command\",\n\"@lerna/conventional-commits\": \"file:core/conventional-commits\",\n- \"@lerna/npm-conf\": \"file:utils/npm-conf\",\n\"@lerna/npm-dist-tag\": \"file:utils/npm-dist-tag\",\n\"@lerna/npm-publish\": \"file:utils/npm-publish\",\n\"@lerna/output\": \"file:utils/output\",\n",
"new_path": "package-lock.json",
"old_path": "package-lock.json"
}
] | JavaScript | MIT License | lerna/lerna | refactor(publish): Use runLifecycle.createRunner() | 1 | refactor | publish |
679,913 | 25.07.2018 15:18:52 | -3,600 | b92aaa584e8505bdac20f7a7f08d722b1703cbe2 | feat(transducers-stats): add MACD (fixes | [
{
"change_type": "MODIFY",
"diff": "@@ -2,6 +2,7 @@ export * from \"./bollinger\";\nexport * from \"./donchian\";\nexport * from \"./ema\";\nexport * from \"./hma\";\n+export * from \"./macd\";\nexport * from \"./momentum\";\nexport * from \"./roc\";\nexport * from \"./rsi\";\n",
"new_path": "packages/transducers-stats/src/index.ts",
"old_path": "packages/transducers-stats/src/index.ts"
},
{
"change_type": "ADD",
"diff": "+import { Reducer, Transducer } from \"@thi.ng/transducers/api\";\n+import { compR } from \"@thi.ng/transducers/func/compr\";\n+import { step } from \"@thi.ng/transducers/step\";\n+\n+import { ema } from \"./ema\";\n+\n+export interface MACD {\n+ /**\n+ * MACD signal: `ema(fast) - ema(slow)`\n+ */\n+ signal: number;\n+ /**\n+ * Smoothed MACD signal, i.e. EMA of `signal` value\n+ */\n+ smooth: number;\n+ /**\n+ * Divergence (histogram), i.e. `signal - smooth`\n+ */\n+ div: number;\n+ /**\n+ * Fast EMA value\n+ */\n+ fast: number;\n+ /**\n+ * Slow EMA value\n+ */\n+ slow: number;\n+}\n+\n+/**\n+ * Computes the Moving Average Convergence/Divergence (MACD) using given\n+ * periods.\n+ *\n+ * Note: the number of results will be `slow + smooth - 2` less than the\n+ * number of processed inputs.\n+ *\n+ * https://en.wikipedia.org/wiki/MACD\n+ *\n+ * @param fast fast EMA period\n+ * @param slow slow EMA period\n+ * @param smooth signal smoothing EMA period\n+ */\n+export const macd = (fast = 12, slow = 26, smooth = 9): Transducer<number, MACD> =>\n+ (rfn: Reducer<any, MACD>) => {\n+ const reduce = rfn[2];\n+ const maFast = step(ema(fast));\n+ const maSlow = step(ema(slow));\n+ const maSmooth = step(ema(smooth));\n+ return compR(\n+ rfn,\n+ (acc, x) => {\n+ const fast = <number>maFast(x);\n+ const slow = <number>maSlow(x);\n+ if (slow == null) return acc;\n+ const signal = fast - slow;\n+ const smooth = <number>maSmooth(signal);\n+ if (smooth == null) return acc;\n+ return reduce(acc, { signal, smooth, div: signal - smooth, fast, slow });\n+ }\n+ );\n+ };\n",
"new_path": "packages/transducers-stats/src/macd.ts",
"old_path": null
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | feat(transducers-stats): add MACD (fixes #31) | 1 | feat | transducers-stats |
679,913 | 25.07.2018 15:21:05 | -3,600 | c97cb75c4ee15451557f682cc00efcd1466e8322 | feat(transducers-stats): add BollingerBand value interface | [
{
"change_type": "MODIFY",
"diff": "@@ -8,18 +8,24 @@ import { partition } from \"@thi.ng/transducers/xform/partition\";\nimport { mse } from \"./mse\";\nimport { sma } from \"./sma\";\n+export interface BollingerBand {\n+ min: number;\n+ max: number;\n+ mean: number;\n+ pb: number;\n+}\n+\n/**\n* Computes Bollinger bands using sliding window.\n*\n* https://en.wikipedia.org/wiki/Bollinger_Bands\n*\n* Note: the number of results will be `period-1` less than the\n- * number of processed inputs and no outputs will be produced if there\n- * were less than `period` input values.\n+ * number of processed inputs.\n*\n* @param period\n*/\n-export function bollinger(period = 20, sd = 2): Transducer<number, any> {\n+export function bollinger(period = 20, sd = 2): Transducer<number, BollingerBand> {\nreturn comp(\nmultiplex(partition(period, 1), sma(period)),\ndrop(period - 1),\n",
"new_path": "packages/transducers-stats/src/bollinger.ts",
"old_path": "packages/transducers-stats/src/bollinger.ts"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | feat(transducers-stats): add BollingerBand value interface | 1 | feat | transducers-stats |
679,913 | 25.07.2018 15:21:38 | -3,600 | d967f94ee03d9ba1777e429e2fa15876c63b4406 | docs(transducers-stats): update docs & readme | [
{
"change_type": "MODIFY",
"diff": "@@ -31,6 +31,7 @@ statistical analysis and replaces the older\n- [Donchian Channel](./src/donchian.ts)\n- [EMA (Exponential Moving Average)](./src/ema.ts)\n- [HMA (Hull Moving Average)](./src/hma.ts)\n+- [MACD (Moving Average Convergence/Divergence)](./src/macd.ts)\n- [Momentum](./src/momentum.ts)\n- [ROC (Rate of change)](./src/roc.ts)\n- [RSI (Relative Strength Index)](./src/rsi.ts)\n",
"new_path": "packages/transducers-stats/README.md",
"old_path": "packages/transducers-stats/README.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -11,8 +11,7 @@ import { bounds } from \"./bounds\";\n* https://en.wikipedia.org/wiki/Donchian_channel\n*\n* Note: the number of results will be `period-1` less than the\n- * number of processed inputs and no outputs will be produced if there\n- * were less than `period` input values.\n+ * number of processed inputs.\n*\n* @param period\n*/\n",
"new_path": "packages/transducers-stats/src/donchian.ts",
"old_path": "packages/transducers-stats/src/donchian.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -6,8 +6,7 @@ import { compR } from \"@thi.ng/transducers/func/compr\";\n* https://en.wikipedia.org/wiki/Moving_average#Exponential_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+ * of processed inputs.\n*\n* @param period\n*/\n",
"new_path": "packages/transducers-stats/src/ema.ts",
"old_path": "packages/transducers-stats/src/ema.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -9,10 +9,7 @@ import { wma } from \"./wma\";\n/**\n* https://www.fidelity.com/learning-center/trading-investing/technical-analysis/technical-indicator-guide/hull-moving-average\n*\n- * Note: the number of results will be:\n- *\n- * `period + floor(sqrt(period)) - 2`\n- *\n+ * Note: the number of results will be `period + floor(sqrt(period)) - 2`\n* less than the number of processed inputs.\n*\n* @param weights period or array of weights\n",
"new_path": "packages/transducers-stats/src/hma.ts",
"old_path": "packages/transducers-stats/src/hma.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -6,9 +6,8 @@ import { compR } from \"@thi.ng/transducers/func/compr\";\n/**\n* https://en.wikipedia.org/wiki/Momentum_(technical_analysis)\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+ * Note: the number of results will be `period` less than the number\n+ * of processed inputs.\n*\n* @param period\n*/\n",
"new_path": "packages/transducers-stats/src/momentum.ts",
"old_path": "packages/transducers-stats/src/momentum.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -8,7 +8,7 @@ import { compR } from \"@thi.ng/transducers/func/compr\";\n*\n* https://en.wikipedia.org/wiki/Momentum_(technical_analysis)\n*\n- * Note: the number of results will be `period-1` less than the number\n+ * Note: the number of results will be `period` 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",
"new_path": "packages/transducers-stats/src/roc.ts",
"old_path": "packages/transducers-stats/src/roc.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -10,8 +10,7 @@ import { sma } from \"./sma\";\n* https://en.wikipedia.org/wiki/Relative_strength_index\n*\n* Note: the number of results will be `period` less than the\n- * number of processed inputs and no outputs will be produced if there\n- * were less than `period` input values.\n+ * number of processed inputs.\n*\n* @param period\n*/\n",
"new_path": "packages/transducers-stats/src/rsi.ts",
"old_path": "packages/transducers-stats/src/rsi.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -15,8 +15,7 @@ import { sma } from \"./sma\";\n* https://en.wikipedia.org/wiki/Bollinger_Bands\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+ * of processed inputs.\n*\n* @param period\n*/\n",
"new_path": "packages/transducers-stats/src/sd.ts",
"old_path": "packages/transducers-stats/src/sd.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -8,8 +8,7 @@ import { compR } from \"@thi.ng/transducers/func/compr\";\n* linked list as sliding window buffer.\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+ * of processed inputs.\n*\n* @param period\n*/\n",
"new_path": "packages/transducers-stats/src/sma.ts",
"old_path": "packages/transducers-stats/src/sma.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -6,9 +6,8 @@ import { roc } from \"./roc\";\n/**\n* https://en.wikipedia.org/wiki/Trix_(technical_analysis)\n*\n- * Note: the number of results will be `3 * (period - 1) + 1` less than the\n- * number of processed inputs and no outputs will be produced if there\n- * were less than `period` input values.\n+ * Note: the number of results will be `3 * (period - 1) + 1` less than\n+ * the number of processed inputs.\n*\n* @param period\n*/\n",
"new_path": "packages/transducers-stats/src/trix.ts",
"old_path": "packages/transducers-stats/src/trix.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -11,8 +11,7 @@ import { dot } from \"./dot\";\n* https://en.wikipedia.org/wiki/Moving_average#Weighted_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+ * of processed inputs.\n*\n* @param weights period or array of weights\n*/\n",
"new_path": "packages/transducers-stats/src/wma.ts",
"old_path": "packages/transducers-stats/src/wma.ts"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | docs(transducers-stats): update docs & readme | 1 | docs | transducers-stats |
679,913 | 25.07.2018 15:37:37 | -3,600 | a322e001b6317b81500e9574fa69a6708955f721 | fix(transducers-stats): fix naming of MACD results | [
{
"change_type": "MODIFY",
"diff": "@@ -6,15 +6,15 @@ import { ema } from \"./ema\";\nexport interface MACD {\n/**\n- * MACD signal: `ema(fast) - ema(slow)`\n+ * Main MACD value: `ema(fast) - ema(slow)`\n*/\n- signal: number;\n+ macd: number;\n/**\n- * Smoothed MACD signal, i.e. EMA of `signal` value\n+ * Smoothed MACD, i.e. EMA(smooth) of `macd` value\n*/\n- smooth: number;\n+ signal: number;\n/**\n- * Divergence (histogram), i.e. `signal - smooth`\n+ * Divergence (histogram), i.e. `macd - signal`\n*/\ndiv: number;\n/**\n@@ -52,10 +52,10 @@ export const macd = (fast = 12, slow = 26, smooth = 9): Transducer<number, MACD>\nconst fast = <number>maFast(x);\nconst slow = <number>maSlow(x);\nif (slow == null) return acc;\n- const signal = fast - slow;\n- const smooth = <number>maSmooth(signal);\n- if (smooth == null) return acc;\n- return reduce(acc, { signal, smooth, div: signal - smooth, fast, slow });\n+ const macd = fast - slow;\n+ const signal = <number>maSmooth(macd);\n+ if (signal == null) return acc;\n+ return reduce(acc, { macd, signal, div: macd - signal, fast, slow });\n}\n);\n};\n",
"new_path": "packages/transducers-stats/src/macd.ts",
"old_path": "packages/transducers-stats/src/macd.ts"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | fix(transducers-stats): fix naming of MACD results (#31) | 1 | fix | transducers-stats |
217,922 | 25.07.2018 15:51:12 | -7,200 | 7765d9ece86117f936cc1ac818503c94abe71f68 | fix: fixed some drag and drop issues, including timeline jitter in simulator
closes | [
{
"change_type": "MODIFY",
"diff": "\"balanced-match\": {\n\"version\": \"1.0.0\",\n\"bundled\": true,\n- \"dev\": true,\n- \"optional\": true\n+ \"dev\": true\n},\n\"brace-expansion\": {\n\"version\": \"1.1.11\",\n\"bundled\": true,\n\"dev\": true,\n- \"optional\": true,\n\"requires\": {\n\"balanced-match\": \"^1.0.0\",\n\"concat-map\": \"0.0.1\"\n\"code-point-at\": {\n\"version\": \"1.1.0\",\n\"bundled\": true,\n- \"dev\": true,\n- \"optional\": true\n+ \"dev\": true\n},\n\"concat-map\": {\n\"version\": \"0.0.1\",\n\"bundled\": true,\n- \"dev\": true,\n- \"optional\": true\n+ \"dev\": true\n},\n\"console-control-strings\": {\n\"version\": \"1.1.0\",\n\"bundled\": true,\n- \"dev\": true,\n- \"optional\": true\n+ \"dev\": true\n},\n\"core-util-is\": {\n\"version\": \"1.0.2\",\n\"inherits\": {\n\"version\": \"2.0.3\",\n\"bundled\": true,\n- \"dev\": true,\n- \"optional\": true\n+ \"dev\": true\n},\n\"ini\": {\n\"version\": \"1.3.5\",\n\"version\": \"1.0.0\",\n\"bundled\": true,\n\"dev\": true,\n- \"optional\": true,\n\"requires\": {\n\"number-is-nan\": \"^1.0.0\"\n}\n\"version\": \"3.0.4\",\n\"bundled\": true,\n\"dev\": true,\n- \"optional\": true,\n\"requires\": {\n\"brace-expansion\": \"^1.1.7\"\n}\n\"minimist\": {\n\"version\": \"0.0.8\",\n\"bundled\": true,\n- \"dev\": true,\n- \"optional\": true\n+ \"dev\": true\n},\n\"minipass\": {\n\"version\": \"2.2.4\",\n\"version\": \"0.5.1\",\n\"bundled\": true,\n\"dev\": true,\n- \"optional\": true,\n\"requires\": {\n\"minimist\": \"0.0.8\"\n}\n\"number-is-nan\": {\n\"version\": \"1.0.1\",\n\"bundled\": true,\n- \"dev\": true,\n- \"optional\": true\n+ \"dev\": true\n},\n\"object-assign\": {\n\"version\": \"4.1.1\",\n\"dev\": true\n},\n\"ng-drag-drop\": {\n- \"version\": \"4.0.1\",\n- \"resolved\": \"https://registry.npmjs.org/ng-drag-drop/-/ng-drag-drop-4.0.1.tgz\",\n- \"integrity\": \"sha1-tDSiJI3vk35Y6mrSQZivGJslks8=\"\n+ \"version\": \"5.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/ng-drag-drop/-/ng-drag-drop-5.0.0.tgz\",\n+ \"integrity\": \"sha1-rsRIMRQ6CVEC3CRQX3EqyInDuYw=\"\n},\n\"ng-push\": {\n\"version\": \"0.2.1\",\n",
"new_path": "package-lock.json",
"old_path": "package-lock.json"
},
{
"change_type": "MODIFY",
"diff": "\"firebase\": \"^5.0.2\",\n\"hammerjs\": \"^2.0.8\",\n\"jwt-decode\": \"^2.2.0\",\n- \"ng-drag-drop\": \"^4.0.1\",\n+ \"ng-drag-drop\": \"5.0.0\",\n\"ng-push\": \"^0.2.1\",\n\"ngx-clipboard\": \"11.0.0\",\n\"ngx-markdown\": \"^1.6.0\",\n",
"new_path": "package.json",
"old_path": "package.json"
},
{
"change_type": "MODIFY",
"diff": ".action-container {\nuser-select: none;\nposition: relative;\n- margin: 5px;\nheight: 40px;\n.action {\n&.disabled {\n",
"new_path": "src/app/pages/simulator/components/action/action.component.scss",
"old_path": "src/app/pages/simulator/components/action/action.component.scss"
},
{
"change_type": "MODIFY",
"diff": "<div *ngIf=\"rotations$ | async as rotations\">\n<div *ngIf=\"rotations.nofolder.length > 0 || rotations.folders.length > 0; else noRotations\">\n<div class=\"drop-zone\" droppable (onDrop)=\"removeFolder($event.dragData)\" [dropScope]=\"'rotation'\">\n- <div class=\"drop-overlay accent-background\">\n- <mat-icon>save_alt</mat-icon>\n- </div>\n<div *ngFor=\"let rotation of rotations.nofolder; trackBy: trackByRotation\"\ndraggable\n[dragScope]=\"'rotation'\"\n<div *ngFor=\"let folder of rotations.folders; trackBy: trackByFolder; let i = index\">\n<div class=\"drop-zone folder-zone\" droppable (onDrop)=\"setFolderIndex($event.dragData, i)\"\n[dropScope]=\"'folder'\">\n- <div class=\"drop-overlay accent-background\">\n- <mat-icon>save_alt</mat-icon>\n- </div>\n</div>\n<mat-expansion-panel class=\"folder\" draggable [dragData]=\"folder.name\" [dragScope]=\"'folder'\">\n<mat-expansion-panel-header>\n</mat-expansion-panel-header>\n<div class=\"drop-zone\" droppable (onDrop)=\"onFolderDrop(folder.name, $event.dragData)\"\n[dropScope]=\"'rotation'\">\n- <div class=\"drop-overlay accent-background\">\n- <mat-icon>save_alt</mat-icon>\n- </div>\n<div *ngFor=\"let rotation of folder.rotations; trackBy: trackByRotation\"\ndraggable\n[dragScope]=\"'rotation'\"\n<div class=\"drop-zone folder-zone\" droppable\n(onDrop)=\"setFolderIndex($event.dragData, rotations.folders.length - 1)\"\n[dropScope]=\"'folder'\">\n- <div class=\"drop-overlay accent-background\">\n- <mat-icon>save_alt</mat-icon>\n- </div>\n</div>\n</div>\n<ng-template #noRotations>\n",
"new_path": "src/app/pages/simulator/components/rotations-page/rotations-page.component.html",
"old_path": "src/app/pages/simulator/components/rotations-page/rotations-page.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -31,6 +31,10 @@ mat-panel-title {\nborder: 2px dashed;\n}\n+.drag-transit {\n+ opacity: 1;\n+}\n+\n.drop-zone {\nmin-height: 50px;\nposition: relative;\n",
"new_path": "src/app/pages/simulator/components/rotations-page/rotations-page.component.scss",
"old_path": "src/app/pages/simulator/components/rotations-page/rotations-page.component.scss"
},
{
"change_type": "MODIFY",
"diff": "</mat-card>\n<mat-card [class.failed]=\"actionFailed\">\n<div class=\"actions\">\n+ <div class=\"action-parent\" *ngFor=\"let step of resultData.simulation.steps; let index = index\">\n+ <div class=\"action-drag-zone\" droppable\n+ dragOverClass=\"drag-over\"\n+ (onDrop)=\"moveSkill($event.dragData, index); tooltipsDisabled = false\"></div>\n<app-action draggable\n- droppable\n(onDragStart)=\"step.action.canBeMoved()?null:$event.preventDefault()\"\n- dragOverClass=\"drag-over\"\n[disabled]=\"!step.success || step.skipped\"\n- (onDrop)=\"moveSkill($event.dragData, index)\"\n[dragData]=\"index\"\n- *ngFor=\"let step of resultData.simulation.steps; let index = index\"\n(actionclick)=\"removeAction(index)\"\n[action]=\"step.action\"\n[simulation]=\"resultData.simulation\"\n[failed]=\"!step.success\"\n(onDragStart)=\"tooltipsDisabled = true\"\n(onDragEnd)=\"tooltipsDisabled = false\"\n- (onDrop)=\"tooltipsDisabled = false\"\n[tooltipDisabled]=\"tooltipsDisabled\"></app-action>\n- <div class=\"end-drag-zone\" droppable\n+ </div>\n+ <div class=\"action-drag-zone\" droppable\ndragOverClass=\"drag-over\"\n- (onDrop)=\"moveSkill($event.dragData, resultData.simulation.steps.length - 1)\"></div>\n+ (onDrop)=\"moveSkill($event.dragData, resultData.simulation.steps.length - 1); tooltipsDisabled = false\"></div>\n</div>\n</mat-card>\n<mat-card>\n",
"new_path": "src/app/pages/simulator/components/simulator/simulator.component.html",
"old_path": "src/app/pages/simulator/components/simulator/simulator.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -247,33 +247,29 @@ mat-progress-bar {\nbackground-color: rgba(255, 0, 0, .3);\n}\n-.actions {\n- display: flex;\n- justify-content: flex-start;\n- flex-wrap: wrap;\n- min-height: 50px;\n- app-action {\n- display: flex;\n- &.drag-over::before {\n- content: \" \";\n- display: block;\n- margin-top: 5px;\n- width: 40px;\n- height: 40px;\n- border: 2px dashed rgba(0, 0, 0, 0.7);\n- border-radius: 5px;\n- }\n- }\n- .end-drag-zone {\n+.action-drag-zone {\ndisplay: block;\nmargin-top: 5px;\nopacity: 0;\n- width: 40px;\n+ width: 10px;\nheight: 40px;\n&.drag-over {\nopacity: 1;\nborder: 2px dashed rgba(0, 0, 0, 0.7);\nborder-radius: 5px;\n+ width: 40px;\n+ }\n+}\n+\n+.actions {\n+ display: flex;\n+ justify-content: flex-start;\n+ flex-wrap: wrap;\n+ min-height: 50px;\n+ .action-parent {\n+ display: flex;\n+ app-action {\n+ margin: 5px 0;\n}\n}\n}\n@@ -316,6 +312,9 @@ mat-progress-bar {\npadding: 5px;\nbackground: rgba(0, 0, 0, .3);\nmargin: 10px;\n+ app-action {\n+ margin: 5px;\n+ }\n}\n}\n",
"new_path": "src/app/pages/simulator/components/simulator/simulator.component.scss",
"old_path": "src/app/pages/simulator/components/simulator/simulator.component.scss"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | fix: fixed some drag and drop issues, including timeline jitter in simulator
closes #422 | 1 | fix | null |
679,913 | 25.07.2018 16:11:05 | -3,600 | 35af6a566a69cbea33a3adf5f5e3c597e0fe4d4d | feat(vectors): add minor/majorAxis(), minor/major2/3
add minXid / maxXid maths helpers | [
{
"change_type": "MODIFY",
"diff": "@@ -13,16 +13,6 @@ export const atan2Abs = (y: number, x: number) => {\nreturn theta < 0 ? TAU + theta : theta;\n};\n-/**\n- * Clamps value `x` to given closed interval.\n- *\n- * @param x value to clamp\n- * @param min lower bound\n- * @param max upper bound\n- */\n-export const clamp = (x: number, min: number, max: number) =>\n- x < min ? min : x > max ? max : x;\n-\n/**\n* Converts angle to degrees.\n*\n@@ -88,6 +78,48 @@ export const smoothStep = (edge: number, edge2: number, x: number) => {\nreturn (3 - 2 * t) * t * t;\n};\n+export const min2id = (a, b) => a <= b ? 0 : 1;\n+\n+export const min3id = (a, b, c) =>\n+ (a <= b) ?\n+ (a <= c ? 0 : 2) :\n+ (b <= c ? 1 : 2);\n+\n+export const min4id = (a, b, c, d) =>\n+ a <= b ?\n+ (a <= c ?\n+ (a <= d ? 0 : 3) :\n+ (c <= d ? 2 : 3)) :\n+ (b <= c ?\n+ (b <= d ? 1 : 3) :\n+ (c <= d ? 2 : 3));\n+\n+export const max2id = (a, b) => a >= b ? 0 : 1;\n+\n+export const max3id = (a, b, c) =>\n+ (a >= b) ?\n+ (a >= c ? 0 : 2) :\n+ (b >= c ? 1 : 2);\n+\n+export const max4id = (a, b, c, d) =>\n+ a >= b ?\n+ (a >= c ?\n+ (a >= d ? 0 : 3) :\n+ (c >= d ? 2 : 3)) :\n+ (b >= c ?\n+ (b >= d ? 1 : 3) :\n+ (c >= d ? 2 : 3));\n+\n+/**\n+ * Clamps value `x` to given closed interval.\n+ *\n+ * @param x value to clamp\n+ * @param min lower bound\n+ * @param max upper bound\n+ */\n+export const clamp = (x: number, min: number, max: number) =>\n+ x < min ? min : x > max ? max : x;\n+\nexport const fit = (x: number, a: number, b: number, c: number, d: number) =>\nc + (d - c) * (x - a) / (b - a);\n",
"new_path": "packages/vectors/src/math.ts",
"old_path": "packages/vectors/src/math.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -4,6 +4,8 @@ import {\natan2Abs,\nEPS,\neqDelta,\n+ max2id,\n+ min2id,\nsmoothStep,\nstep\n} from \"./math\";\n@@ -180,6 +182,12 @@ export const toCartesian2 = (a: Vec, b: ReadonlyVec = ZERO2, ia = 0, ib = 0, str\nreturn set2s(a, r * Math.cos(theta) + b[ib], r * Math.sin(theta) + b[ib + strideb], ia, stridea);\n};\n+export const minor2 = (a: Vec, ia = 0, stridea = 1) =>\n+ min2id(Math.abs(a[ia]), Math.abs(a[ia + stridea]));\n+\n+export const major2 = (a: Vec, ia = 0, stridea = 1) =>\n+ max2id(Math.abs(a[ia]), Math.abs(a[ia + stridea]));\n+\nexport const vec2 = (x = 0, y = 0) => new Vec2([x, y]);\nexport class Vec2 implements\n@@ -390,6 +398,14 @@ export class Vec2 implements\nreturn this;\n}\n+ minorAxis() {\n+ return minor2(this.buf, this.index, this.stride);\n+ }\n+\n+ majorAxis() {\n+ return major2(this.buf, this.index, this.stride);\n+ }\n+\nstep(e: Readonly<Vec2>) {\nstep2(this.buf, e.buf, this.index, e.index, this.stride, e.stride);\nreturn this;\n",
"new_path": "packages/vectors/src/vec2.ts",
"old_path": "packages/vectors/src/vec2.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -4,12 +4,13 @@ import {\natan2Abs,\nEPS,\neqDelta,\n+ max3id,\n+ min3id,\nsmoothStep,\nstep\n} from \"./math\";\nimport { heading2, rotate2 } from \"./vec2\";\n-\nexport const ZERO3 = Object.freeze([0, 0, 0]);\nexport const ONE3 = Object.freeze([1, 1, 1]);\n@@ -268,6 +269,12 @@ export const toCartesian3 = (a: Vec, b: ReadonlyVec = ZERO3, ia = 0, ib = 0, str\nreturn set3s(a, r * ct * cp + b[ib], r * ct * sp + b[ib + strideb], r * st + b[ib + 2 * strideb], ia, stridea);\n};\n+export const minor3 = (a: Vec, ia = 0, stridea = 1) =>\n+ min3id(Math.abs(a[ia]), Math.abs(a[ia + stridea]), Math.abs(a[ia + 2 * stridea]));\n+\n+export const major3 = (a: Vec, ia = 0, stridea = 1) =>\n+ max3id(Math.abs(a[ia]), Math.abs(a[ia + stridea]), Math.abs(a[ia + 2 * stridea]));\n+\nexport const vec3 = (x = 0, y = 0, z = 0) => new Vec3([x, y, z]);\nexport class Vec3 implements\n@@ -487,6 +494,14 @@ export class Vec3 implements\nreturn this;\n}\n+ minorAxis() {\n+ return minor3(this.buf, this.index, this.stride);\n+ }\n+\n+ majorAxis() {\n+ return major3(this.buf, this.index, this.stride);\n+ }\n+\nstep(e: Readonly<Vec3>) {\nstep3(this.buf, e.buf, this.index, e.index, this.stride, e.stride);\nreturn this;\n",
"new_path": "packages/vectors/src/vec3.ts",
"old_path": "packages/vectors/src/vec3.ts"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | feat(vectors): add minor/majorAxis(), minor/major2/3
- add minXid / maxXid maths helpers | 1 | feat | vectors |
791,690 | 25.07.2018 17:08:49 | 25,200 | 63df678302b3ebbfb9220273db65ec0946300809 | tests: better display value tests with i18n | [
{
"change_type": "MODIFY",
"diff": "@@ -14,6 +14,7 @@ module.exports = {\n'!**/test/',\n'!**/scripts/',\n],\n+ setupTestFrameworkScriptFile: './lighthouse-core/test/test-utils.js',\ntestEnvironment: 'node',\ntestMatch: [\n'**/lighthouse-core/**/*-test.js',\n",
"new_path": "jest.config.js",
"old_path": "jest.config.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -176,7 +176,7 @@ describe('Byte efficiency base audit', () => {\n],\n}, graph, simulator);\n- assert.ok(result.displayValue);\n+ expect(result.displayValue).toBeDisplayString(/savings of 2/);\n});\nit('should work on real graphs', async () => {\n",
"new_path": "lighthouse-core/test/audits/byte-efficiency/byte-efficiency-audit-test.js",
"old_path": "lighthouse-core/test/audits/byte-efficiency/byte-efficiency-audit-test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -46,7 +46,7 @@ describe('Cache headers audit', () => {\nassert.equal(items.length, 1);\nassert.equal(items[0].cacheLifetimeMs, 0);\nassert.equal(items[0].wastedBytes, 10000);\n- assert.ok(result.displayValue);\n+ expect(result.displayValue).toBeDisplayString('1 resource found');\n});\n});\n@@ -68,7 +68,7 @@ describe('Cache headers audit', () => {\nassert.equal(Math.round(items[1].wastedBytes), 8000);\nassert.equal(items[2].cacheLifetimeMs, 86400 * 1000);\nassert.equal(Math.round(items[2].wastedBytes), 4000);\n- assert.ok(result.displayValue);\n+ expect(result.displayValue).toBeDisplayString('3 resources found');\n});\n});\n",
"new_path": "lighthouse-core/test/audits/byte-efficiency/uses-long-cache-ttl-test.js",
"old_path": "lighthouse-core/test/audits/byte-efficiency/uses-long-cache-ttl-test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -86,7 +86,7 @@ const mockArtifacts = (mockChain) => {\ndescribe('Performance: critical-request-chains audit', () => {\nit('calculates the correct chain result for failing example', () => {\nreturn CriticalRequestChains.audit(mockArtifacts(FAILING_REQUEST_CHAIN)).then(output => {\n- assert.ok(output.displayValue);\n+ expect(output.displayValue).toBeDisplayString('2 chains found');\nassert.equal(output.rawValue, false);\nassert.ok(output.details);\n});\n",
"new_path": "lighthouse-core/test/audits/critical-request-chains-test.js",
"old_path": "lighthouse-core/test/audits/critical-request-chains-test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -16,7 +16,7 @@ describe('Appcache manifest audit', () => {\nAppCacheManifest: 'manifest-name',\n});\nassert.equal(auditResult.rawValue, false);\n- assert.ok(/manifest-name/.test(auditResult.displayValue));\n+ expect(auditResult.displayValue).toBeDisplayString(/manifest-name/);\n});\nit('passes when <html> does not contain a manifest attribute', () => {\n",
"new_path": "lighthouse-core/test/audits/dobetterweb/appcache-manifest-test.js",
"old_path": "lighthouse-core/test/audits/dobetterweb/appcache-manifest-test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -25,7 +25,7 @@ describe('Num DOM nodes audit', () => {\nconst auditResult = DOMSize.audit(artifact, {options});\nassert.equal(auditResult.score, 0.43);\nassert.equal(auditResult.rawValue, numNodes);\n- assert.ok(auditResult.displayValue);\n+ expect(auditResult.displayValue).toBeDisplayString('1,500 nodes');\nassert.equal(auditResult.details.items[0].totalNodes, numNodes.toLocaleString());\nassert.equal(auditResult.details.items[0].depth, '1');\nassert.equal(auditResult.details.items[0].width, '2');\n",
"new_path": "lighthouse-core/test/audits/dobetterweb/dom-size-test.js",
"old_path": "lighthouse-core/test/audits/dobetterweb/dom-size-test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -29,7 +29,7 @@ describe('Performance: estimated-input-latency audit', () => {\nreturn Audit.audit(artifacts, {options, settings}).then(output => {\nassert.equal(Math.round(output.rawValue * 10) / 10, 17.1);\nassert.equal(output.score, 1);\n- assert.ok(output.displayValue);\n+ expect(output.displayValue).toBeDisplayString('20\\xa0ms');\n});\n});\n});\n",
"new_path": "lighthouse-core/test/audits/metrics/estimated-input-latency-test.js",
"old_path": "lighthouse-core/test/audits/metrics/estimated-input-latency-test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -27,7 +27,7 @@ describe('Performance: first-meaningful-paint audit', () => {\nassert.equal(fmpResult.score, 1);\nassert.equal(fmpResult.rawValue, 783.328);\n- assert.ok(fmpResult.displayValue);\n+ expect(fmpResult.displayValue).toBeDisplayString('780\\xa0ms');\n});\nit('computes FMP correctly for simulated', async () => {\n",
"new_path": "lighthouse-core/test/audits/metrics/first-meaningful-paint-test.js",
"old_path": "lighthouse-core/test/audits/metrics/first-meaningful-paint-test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -34,7 +34,7 @@ describe('Performance: interactive audit', () => {\nreturn Interactive.audit(artifacts, {options, settings}).then(output => {\nassert.equal(output.score, 1);\nassert.equal(Math.round(output.rawValue), 1582);\n- assert.ok(output.displayValue);\n+ expect(output.displayValue).toBeDisplayString('1,580\\xa0ms');\n});\n});\n@@ -52,7 +52,7 @@ describe('Performance: interactive audit', () => {\nreturn Interactive.audit(artifacts, {options, settings}).then(output => {\nassert.equal(output.score, 0.97);\nassert.equal(Math.round(output.rawValue), 2712);\n- assert.ok(output.displayValue);\n+ expect(output.displayValue).toBeDisplayString('2,710\\xa0ms');\n});\n});\n});\n",
"new_path": "lighthouse-core/test/audits/metrics/interactive-test.js",
"old_path": "lighthouse-core/test/audits/metrics/interactive-test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -159,7 +159,7 @@ wrong\nassert.equal(auditResult.rawValue, false);\nassert.equal(auditResult.details.items.length, expectedErrors);\n- assert.ok(auditResult.displayValue);\n+ expect(auditResult.displayValue).toBeDisplayString(/\\d errors? found/);\n});\n});\n",
"new_path": "lighthouse-core/test/audits/seo/robots-txt-test.js",
"old_path": "lighthouse-core/test/audits/seo/robots-txt-test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -30,7 +30,7 @@ describe('Performance: user-timings audit', () => {\nassert.equal(blackListedUTs.length, 0, 'Blacklisted usertimings included in results');\nassert.equal(auditResult.rawValue, false);\n- assert.ok(auditResult.displayValue);\n+ expect(auditResult.displayValue).toBeDisplayString('2 user timings');\nassert.equal(auditResult.details.items[0].name, 'measure_test');\nassert.equal(auditResult.details.items[0].timingType, 'Measure');\n",
"new_path": "lighthouse-core/test/audits/user-timing-test.js",
"old_path": "lighthouse-core/test/audits/user-timing-test.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+/* eslint-env jest */\n+\n+const i18n = require('../lib/i18n');\n+\n+expect.extend({\n+ toBeDisplayString(received, expected) {\n+ const obj = {value: received};\n+ i18n.replaceIcuMessageInstanceIds(obj, 'en-US');\n+ const actual = obj.value;\n+ const pass = expected instanceof RegExp ?\n+ expected.test(actual) :\n+ actual === expected;\n+\n+ const message = () =>\n+ [\n+ `${this.utils.matcherHint('.toBeDisplayString')}\\n`,\n+ `Expected object to be a display string matching:`,\n+ ` ${this.utils.printExpected(expected)}`,\n+ `Received:`,\n+ ` ${this.utils.printReceived(actual)}`,\n+ ].join('\\n');\n+\n+ return {actual, message, pass};\n+ },\n+});\n",
"new_path": "lighthouse-core/test/test-utils.js",
"old_path": null
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | tests: better display value tests with i18n (#5720) | 1 | tests | null |
807,996 | 25.07.2018 20:00:32 | 14,400 | f3ffd333d19ad7bbe935d225a2efa5563ef2a268 | docs: Fix "Getting Started" code snippet [skip ci]
`$_` retrieves the last argument of the previous command.
`!$` retrieves the last argument of previous command in the shell
history. | [
{
"change_type": "MODIFY",
"diff": "@@ -84,7 +84,7 @@ The two primary commands in Lerna are `lerna bootstrap` and `lerna publish`.\nLet's start by installing Lerna as a dev dependency of your project with [npm](https://www.npmjs.com/).\n```sh\n-$ mkdir lerna-repo && cd !$\n+$ mkdir lerna-repo && cd $_\n$ npx lerna init\n```\n",
"new_path": "README.md",
"old_path": "README.md"
}
] | JavaScript | MIT License | lerna/lerna | docs: Fix "Getting Started" code snippet (#1519) [skip ci]
`$_` retrieves the last argument of the previous command.
`!$` retrieves the last argument of previous command in the shell
history.
https://unix.stackexchange.com/a/219627 | 1 | docs | null |
791,690 | 25.07.2018 21:37:29 | 25,200 | 6af477a706b616439006f895951e51f2f861d155 | core(i18n): always use english for status logs | [
{
"change_type": "MODIFY",
"diff": "@@ -13,6 +13,7 @@ const MessageParser = require('intl-messageformat-parser');\nconst LOCALES = require('./locales');\nconst LH_ROOT = path.join(__dirname, '../../');\n+const MESSAGE_INSTANCE_ID_REGEX = /(.* \\| .*) # (\\d+)$/;\n(() => {\n// Node usually doesn't come with the locales we want built-in, so load the polyfill if we can.\n@@ -196,13 +197,43 @@ function createMessageInstanceIdFn(filename, fileStrings) {\nreturn getMessageInstanceIdFn;\n}\n+/**\n+ * @param {string} icuMessageIdOrRawString\n+ * @param {LH.Locale} [locale]\n+ * @return {string}\n+ */\n+function getFormatted(icuMessageIdOrRawString, locale) {\n+ if (MESSAGE_INSTANCE_ID_REGEX.test(icuMessageIdOrRawString)) {\n+ return _resolveIcuMessageInstanceId(icuMessageIdOrRawString, locale).formattedString;\n+ }\n+\n+ return icuMessageIdOrRawString;\n+}\n+\n+/**\n+ * @param {string} icuMessageInstanceId\n+ * @param {LH.Locale} [locale]\n+ * @return {{icuMessageInstance: IcuMessageInstance, formattedString: string}}\n+ */\n+function _resolveIcuMessageInstanceId(icuMessageInstanceId, locale = 'en-US') {\n+ const matches = icuMessageInstanceId.match(MESSAGE_INSTANCE_ID_REGEX);\n+ if (!matches) throw new Error(`${icuMessageInstanceId} is not a valid message instance ID`);\n+\n+ const [_, icuMessageId, icuMessageInstanceIndex] = matches;\n+ const icuMessageInstances = _icuMessageInstanceMap.get(icuMessageId) || [];\n+ const icuMessageInstance = icuMessageInstances[Number(icuMessageInstanceIndex)];\n+\n+ const {formattedString} = _formatIcuMessage(locale, icuMessageId,\n+ icuMessageInstance.icuMessage, icuMessageInstance.values);\n+\n+ return {icuMessageInstance, formattedString};\n+}\n+\n/**\n* @param {LH.Result} lhr\n* @param {LH.Locale} locale\n*/\nfunction replaceIcuMessageInstanceIds(lhr, locale) {\n- const MESSAGE_INSTANCE_ID_REGEX = /(.* \\| .*) # (\\d+)$/;\n-\n/**\n* @param {*} objectInLHR\n* @param {LH.I18NMessages} icuMessagePaths\n@@ -216,11 +247,8 @@ function replaceIcuMessageInstanceIds(lhr, locale) {\n// Check to see if the value in the LHR looks like a string reference. If it is, replace it.\nif (typeof value === 'string' && MESSAGE_INSTANCE_ID_REGEX.test(value)) {\n- // @ts-ignore - Guaranteed to match from .test call above\n- const [_, icuMessageId, icuMessageInstanceIndex] = value.match(MESSAGE_INSTANCE_ID_REGEX);\n- const messageInstancesInLHR = icuMessagePaths[icuMessageId] || [];\n- const icuMessageInstances = _icuMessageInstanceMap.get(icuMessageId) || [];\n- const icuMessageInstance = icuMessageInstances[Number(icuMessageInstanceIndex)];\n+ const {icuMessageInstance, formattedString} = _resolveIcuMessageInstanceId(value, locale);\n+ const messageInstancesInLHR = icuMessagePaths[icuMessageInstance.icuMessageId] || [];\nconst currentPathAsString = _formatPathAsString(currentPathInLHR);\nmessageInstancesInLHR.push(\n@@ -229,11 +257,8 @@ function replaceIcuMessageInstanceIds(lhr, locale) {\ncurrentPathAsString\n);\n- const {formattedString} = _formatIcuMessage(locale, icuMessageId,\n- icuMessageInstance.icuMessage, icuMessageInstance.values);\n-\nobjectInLHR[property] = formattedString;\n- icuMessagePaths[icuMessageId] = messageInstancesInLHR;\n+ icuMessagePaths[icuMessageInstance.icuMessageId] = messageInstancesInLHR;\n} else {\nreplaceInObject(value, icuMessagePaths, currentPathInLHR);\n}\n@@ -251,5 +276,6 @@ module.exports = {\ngetDefaultLocale,\ngetRendererFormattedStrings,\ncreateMessageInstanceIdFn,\n+ getFormatted,\nreplaceIcuMessageInstanceIds,\n};\n",
"new_path": "lighthouse-core/lib/i18n.js",
"old_path": "lighthouse-core/lib/i18n.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -218,7 +218,7 @@ class Runner {\n*/\nstatic async _runAudit(auditDefn, artifacts, settings, runWarnings) {\nconst audit = auditDefn.implementation;\n- const status = `Evaluating: ${audit.meta.title}`;\n+ const status = `Evaluating: ${i18n.getFormatted(audit.meta.title)}`;\nlog.log('status', status);\nlet auditResult;\n",
"new_path": "lighthouse-core/runner.js",
"old_path": "lighthouse-core/runner.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -11,9 +11,7 @@ const i18n = require('../lib/i18n');\nexpect.extend({\ntoBeDisplayString(received, expected) {\n- const obj = {value: received};\n- i18n.replaceIcuMessageInstanceIds(obj, 'en-US');\n- const actual = obj.value;\n+ const actual = i18n.getFormatted(received, 'en-US');\nconst pass = expected instanceof RegExp ?\nexpected.test(actual) :\nactual === expected;\n",
"new_path": "lighthouse-core/test/test-utils.js",
"old_path": "lighthouse-core/test/test-utils.js"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | core(i18n): always use english for status logs (#5727) | 1 | core | i18n |
679,913 | 25.07.2018 22:25:47 | -3,600 | b59fadfd9de258153e5a834cb0492b6cdc4f1d53 | feat(vectors): add vec4 ops & class wrapper | [
{
"change_type": "MODIFY",
"diff": "export * from \"./api\";\n+export * from \"./common\";\n+export * from \"./math\";\nexport * from \"./vec2\";\nexport * from \"./vec3\";\n+export * from \"./vec4\";\n",
"new_path": "packages/vectors/src/index.ts",
"old_path": "packages/vectors/src/index.ts"
},
{
"change_type": "ADD",
"diff": "+import { ICopy, IEqualsDelta } from \"@thi.ng/api/api\";\n+import { ReadonlyVec, Vec } from \"./api\";\n+import {\n+ EPS,\n+ eqDelta,\n+ max4id,\n+ min4id,\n+ smoothStep,\n+ step\n+} from \"./math\";\n+\n+export const ZERO4 = Object.freeze([0, 0, 0, 0]);\n+export const ONE4 = Object.freeze([1, 1, 1, 1]);\n+\n+export const op4 = (fn: (x: number) => number, a: Vec, ia = 0, sa = 1) => (\n+ a[ia] = fn(a[ia]),\n+ a[ia + sa] = fn(a[ia + sa]),\n+ a[ia + 2 * sa] = fn(a[ia + 2 * sa]),\n+ a[ia + 3 * sa] = fn(a[ia + 3 * sa]),\n+ a\n+);\n+\n+export const op42 = (fn: (a: number, b: number) => number, a: Vec, b: ReadonlyVec, ia = 0, ib = 0, sa = 1, sb = 1) => (\n+ a[ia] = fn(a[ia], b[ib]),\n+ a[ia + sa] = fn(a[ia + sa], b[ib + sb]),\n+ a[ia + 2 * sa] = fn(a[ia + 2 * sa], b[ib + 2 * sb]),\n+ a[ia + 3 * sa] = fn(a[ia + 3 * sa], b[ib + 3 * sb]),\n+ a\n+);\n+\n+export const get4 = (a: ReadonlyVec, ia = 0, sa = 1) =>\n+ [a[ia], a[ia + sa], a[ia + 2 * sa], a[ia + 3 * sa]];\n+\n+export const set4 = (a: Vec, b: ReadonlyVec, ia = 0, ib = 0, sa = 1, sb = 1) => (\n+ a[ia] = b[ib],\n+ a[ia + sa] = b[ib + sb],\n+ a[ia + 2 * sa] = b[ib + 2 * sb],\n+ a[ia + 3 * sa] = b[ib + 3 * sb],\n+ a\n+);\n+\n+export const set4n = (a: Vec, n: number, ia = 0, sa = 1) => (\n+ a[ia] = n,\n+ a[ia + sa] = n,\n+ a[ia + 2 * sa] = n,\n+ a[ia + 3 * sa] = n,\n+ a\n+);\n+\n+export const set4s = (a: Vec, x: number, y: number, z: number, w: number, ia = 0, sa = 1) => (\n+ a[ia] = x,\n+ a[ia + sa] = y,\n+ a[ia + 2 * sa] = z,\n+ a[ia + 3 * sa] = w,\n+ a\n+);\n+\n+export const eqDelta4 = (a: ReadonlyVec, b: ReadonlyVec, eps = EPS, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+ eqDelta(a[ia], b[ib], eps) &&\n+ eqDelta(a[ia + sa], b[ib + sb], eps) &&\n+ eqDelta(a[ia + 2 * sa], b[ib + 2 * sb], eps) &&\n+ eqDelta(a[ia + 3 * sa], b[ib + 3 * sb], eps);\n+\n+export const add4 = (a: Vec, b: ReadonlyVec, ia = 0, ib = 0, sa = 1, sb = 1) => (\n+ a[ia] += b[ib],\n+ a[ia + sa] += b[ib + sb],\n+ a[ia + 2 * sa] += b[ib + 2 * sb],\n+ a[ia + 3 * sa] += b[ib + 3 * sb],\n+ a\n+);\n+\n+export const mul4 = (a: Vec, b: ReadonlyVec, ia = 0, ib = 0, sa = 1, sb = 1) => (\n+ a[ia] *= b[ib],\n+ a[ia + sa] *= b[ib + sb],\n+ a[ia + 2 * sa] *= b[ib + 2 * sb],\n+ a[ia + 3 * sa] *= b[ib + 3 * sb],\n+ a\n+);\n+\n+export const sub4 = (a: Vec, b: ReadonlyVec, ia = 0, ib = 0, sa = 1, sb = 1) => (\n+ a[ia] -= b[ib],\n+ a[ia + sa] -= b[ib + sb],\n+ a[ia + 2 * sa] -= b[ib + 2 * sb],\n+ a[ia + 3 * sa] -= b[ib + 3 * sb],\n+ a\n+);\n+\n+export const div4 = (a: Vec, b: ReadonlyVec, ia = 0, ib = 0, sa = 1, sb = 1) => (\n+ a[ia] /= b[ib],\n+ a[ia + sa] /= b[ib + sb],\n+ a[ia + 2 * sa] /= b[ib + 2 * sb],\n+ a[ia + 3 * sa] /= b[ib + 3 * sb],\n+ a\n+);\n+\n+export const add4n = (a: Vec, n: number, ia = 0, sa = 1) =>\n+ (a[ia] += n, a[ia + sa] += n, a[ia + 2 * sa] += n, a[ia + 3 * sa] += n, a);\n+\n+export const sub4n = (a: Vec, n: number, ia = 0, sa = 1) =>\n+ (a[ia] *= n, a[ia + sa] *= n, a[ia + 2 * sa] -= n, a[ia + 3 * sa] -= n, a);\n+\n+export const mul4n = (a: Vec, n: number, ia = 0, sa = 1) =>\n+ (a[ia] -= n, a[ia + sa] -= n, a[ia + 2 * sa] *= n, a[ia + 3 * sa] *= n, a);\n+\n+export const div4n = (a: Vec, n: number, ia = 0, sa = 1) =>\n+ (a[ia] /= n, a[ia + sa] /= n, a[ia + 2 * sa] /= n, a[ia + 3 * sa] /= n, a);\n+\n+export const neg4 = (a: Vec, ia = 0, sa = 1) =>\n+ mul4n(a, -1, ia, sa);\n+\n+export const abs4 = (a: Vec, ia = 0, sa = 1) =>\n+ op4(Math.abs, a, ia, sa);\n+\n+export const sign4 = (a: Vec, ia = 0, sa = 1) =>\n+ op4(Math.sign, a, ia, sa);\n+\n+export const floor4 = (a: Vec, ia = 0, sa = 1) =>\n+ op4(Math.floor, a, ia, sa);\n+\n+export const ceil4 = (a: Vec, ia = 0, sa = 1) =>\n+ op4(Math.ceil, a, ia, sa);\n+\n+export const sin4 = (a: Vec, ia = 0, sa = 1) =>\n+ op4(Math.sin, a, ia, sa);\n+\n+export const cos4 = (a: Vec, ia = 0, sa = 1) =>\n+ op4(Math.cos, a, ia, sa);\n+\n+export const sqrt4 = (a: Vec, ia = 0, sa = 1) =>\n+ op4(Math.sqrt, a, ia, sa);\n+\n+export const pow4 = (a: Vec, b: ReadonlyVec, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+ op42(Math.pow, a, b, ia, ib, sa, sb);\n+\n+export const pow4n = (a: Vec, n: number, ia = 0, sa = 1) =>\n+ op4((x) => Math.pow(x, n), a, ia, sa);\n+\n+export const madd4 = (a: Vec, b: ReadonlyVec, c: ReadonlyVec, ia = 0, ib = 0, ic = 0, sa = 1, sb = 1, sc = 1) => (\n+ a[ia] += b[ib] * c[ic],\n+ a[ia + sa] += b[ib + sb] * c[ic + sc],\n+ a[ia + 2 * sa] += b[ib + 2 * sb] * c[ic + 2 * sc],\n+ a\n+);\n+\n+export const madd4n = (a: Vec, b: ReadonlyVec, c: number, ia = 0, ib = 0, sa = 1, sb = 1) => (\n+ a[ia] += b[ib] * c,\n+ a[ia + sa] += b[ib + sb] * c,\n+ a[ia + 2 * sa] += b[ib + 2 * sb] * c,\n+ a\n+);\n+\n+export const dot4 = (a: ReadonlyVec, b: ReadonlyVec, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+ a[ia] * b[ib] +\n+ a[ia + sa] * b[ib + sb] +\n+ a[ia + 2 * sa] * b[ib + 2 * sb] +\n+ a[ia + 3 * sa] * b[ib + 3 * sb];\n+\n+export const mix4 = (a: Vec, b: ReadonlyVec, t: ReadonlyVec, ia = 0, ib = 0, it = 0, sa = 1, sb = 1, st = 1) => (\n+ a[ia] += (b[ib] - a[ia]) * t[it],\n+ a[ia + sa] += (b[ib + sb] - a[ia + sa]) * t[it + st],\n+ a[ia + 2 * sa] += (b[ib + 2 * sb] - a[ia + 2 * sa]) * t[it + 2 * st],\n+ a[ia + 3 * sa] += (b[ib + 3 * sb] - a[ia + 3 * sa]) * t[it + 3 * st],\n+ a\n+);\n+\n+export const mix4n = (a: Vec, b: ReadonlyVec, t: number, ia = 0, ib = 0, sa = 1, sb = 1) => (\n+ a[ia] += (b[ib] - a[ia]) * t,\n+ a[ia + sa] += (b[ib + sb] - a[ia + sa]) * t,\n+ a[ia + 2 * sa] += (b[ib + 2 * sb] - a[ia + 2 * sa]) * t,\n+ a[ia + 3 * sa] += (b[ib + 3 * sb] - a[ia + 3 * sa]) * t,\n+ a\n+);\n+\n+export const min4 = (a: Vec, b: ReadonlyVec, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+ op42(Math.min, a, b, ia, ib, sa, sb);\n+\n+export const max4 = (a: Vec, b: ReadonlyVec, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+ op42(Math.max, a, b, ia, ib, sa, sb);\n+\n+export const clamp4 = (a: Vec, min: ReadonlyVec, max: ReadonlyVec, ia = 0, imin = 0, imax = 0, sa = 1, smin = 1, smax = 1) =>\n+ max4(min4(a, max, ia, imax, sa, smax), min, ia, imin, sa, smin);\n+\n+export const step4 = (a: Vec, e: ReadonlyVec, ia = 0, ie = 0, sa = 1, se = 1) => (\n+ a[ia] = step(e[ie], a[ia]),\n+ a[ia + sa] = step(e[ie + se], a[ia + sa]),\n+ a[ia + 2 * sa] = step(e[ie + 2 * se], a[ia + 2 * sa]),\n+ a[ia + 3 * sa] = step(e[ie + 3 * se], a[ia + 3 * sa]),\n+ a\n+);\n+\n+export const smoothStep4 = (a: Vec, e1: ReadonlyVec, e2: ReadonlyVec, ia = 0, ie1 = 0, ie2 = 0, sa = 1, se1 = 1, se2 = 1) => (\n+ a[ia] = smoothStep(e1[ie1], e2[ie2], a[ia]),\n+ a[ia + sa] = smoothStep(e1[ie1 + se1], e2[ie2 + se2], a[ia + sa]),\n+ a[ia + 2 * sa] = smoothStep(e1[ie1 + 2 * se1], e2[ie2 + 2 * se2], a[ia + 2 * sa]),\n+ a[ia + 3 * sa] = smoothStep(e1[ie1 + 3 * se1], e2[ie2 + 2 * se2], a[ia + 3 * sa]),\n+ a\n+);\n+\n+export const mag4sq = (a: ReadonlyVec, ia = 0, sa = 1) => {\n+ const x = a[ia];\n+ const y = a[ia + sa];\n+ const z = a[ia + 2 * sa];\n+ const w = a[ia + 3 * sa];\n+ return x * x + y * y + z * z + w * w;\n+};\n+\n+export const mag4 = (a: ReadonlyVec, ia = 0, sa = 1) =>\n+ Math.sqrt(mag4sq(a, ia, sa));\n+\n+export const dist4sq = (a: ReadonlyVec, b: ReadonlyVec, ia = 0, ib = 0, sa = 1, sb = 1) => {\n+ const x = a[ia] - b[ib];\n+ const y = a[ia + sa] - b[ib + sb];\n+ const z = a[ia + 2 * sa] - b[ib + 2 * sb];\n+ const w = a[ia + 3 * sa] - b[ib + 3 * sb];\n+ return x * x + y * y + z * z + w * w;\n+};\n+\n+export const dist4 = (a: ReadonlyVec, b: ReadonlyVec, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+ Math.sqrt(dist4sq(a, b, ia, ib, sa, sb));\n+\n+export const distManhattan4 = (a: ReadonlyVec, b: ReadonlyVec, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+ Math.abs(a[ia] - b[ib]) +\n+ Math.abs(a[ia + sa] - b[ib + sb]) +\n+ Math.abs(a[ia + 2 * sa] - b[ib + 2 * sb]) +\n+ Math.abs(a[ia + 3 * sa] - b[ib + 3 * sb]);\n+\n+export const distChebyshev4 = (a: ReadonlyVec, b: ReadonlyVec, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+ Math.max(\n+ Math.abs(a[ia] - b[ib]),\n+ Math.abs(a[ia + sa] - b[ib + sb]),\n+ Math.abs(a[ia + 2 * sa] - b[ib + 2 * sb]),\n+ Math.abs(a[ia + 3 * sa] - b[ib + 3 * sb])\n+ );\n+\n+export const normalize4 = (a: Vec, n = 1, ia = 0, sa = 1) => {\n+ const m = mag4(a, ia, sa);\n+ m >= EPS && mul4n(a, n / m, ia, sa);\n+ return a;\n+};\n+\n+export const limit4 = (a: Vec, n: number, ia = 0, sa = 1) => {\n+ const m = mag4(a, ia, sa);\n+ m >= n && mul4n(a, n / m, ia, sa);\n+ return a;\n+};\n+\n+export const reflect4 = (a: Vec, b: ReadonlyVec, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+ madd4n(a, b, -2 * dot4(a, b, ia, ib, sa, sb), ia, ib, sa, sb);\n+\n+export const minor4 = (a: Vec, ia = 0, sa = 1) =>\n+ min4id(Math.abs(a[ia]), Math.abs(a[ia + sa]), Math.abs(a[ia + 2 * sa]), Math.abs(a[ia + 3 * sa]));\n+\n+export const major4 = (a: Vec, ia = 0, sa = 1) =>\n+ max4id(Math.abs(a[ia]), Math.abs(a[ia + sa]), Math.abs(a[ia + 2 * sa]), Math.abs(a[ia + 3 * sa]));\n+\n+export const vec4 = (x = 0, y = 0, z = 0, w = 0) =>\n+ new Vec4([x, y, z, w]);\n+\n+export class Vec4 implements\n+ ICopy<Vec4>,\n+ IEqualsDelta<Vec4> {\n+\n+ /**\n+ * Returns array of memory mapped `Vec4` instances using given\n+ * backing array and stride settings: The `cstride` is the step size\n+ * between individual XYZ vector components. `estride` is the step\n+ * size between successive vectors. This arrangement allows for\n+ * different storage approaches, including SOA, AOS, etc.\n+ *\n+ * @param buf backing array\n+ * @param n num vectors\n+ * @param start start index\n+ * @param cstride component stride\n+ * @param estride element stride\n+ */\n+ static mapBuffer(buf: Vec, n: number, start = 0, cstride = 1, estride = 4) {\n+ const res: Vec4[] = [];\n+ while (--n >= 0) {\n+ res.push(new Vec4(buf, start, cstride));\n+ start += estride;\n+ }\n+ return res;\n+ }\n+\n+ static ZERO = Object.freeze(new Vec4(<number[]>ZERO4));\n+ static ONE = Object.freeze(new Vec4(<number[]>ONE4));\n+\n+ buf: Vec;\n+ index: number;\n+ stride: number;\n+\n+ constructor(buf: Vec, index = 0, stride = 1) {\n+ this.buf = buf;\n+ this.index = index;\n+ this.stride = stride;\n+ }\n+\n+ *[Symbol.iterator]() {\n+ yield this.x;\n+ yield this.y;\n+ yield this.z;\n+ yield this.w;\n+ }\n+\n+ get x() {\n+ return this.buf[this.index];\n+ }\n+\n+ set x(x: number) {\n+ this.buf[this.index] = x;\n+ }\n+\n+ get y() {\n+ return this.buf[this.index + this.stride];\n+ }\n+\n+ set y(y: number) {\n+ this.buf[this.index + this.stride] = y;\n+ }\n+\n+ get z() {\n+ return this.buf[this.index + 2 * this.stride];\n+ }\n+\n+ set z(z: number) {\n+ this.buf[this.index + 2 * this.stride] = z;\n+ }\n+\n+ get w() {\n+ return this.buf[this.index + 3 * this.stride];\n+ }\n+\n+ set w(w: number) {\n+ this.buf[this.index + 3 * this.stride] = w;\n+ }\n+\n+ copy() {\n+ return new Vec4(get4(this.buf, this.index, this.stride));\n+ }\n+\n+ eqDelta(v: Readonly<Vec4>, eps = EPS) {\n+ return eqDelta4(this.buf, v.buf, eps, this.index, v.index, this.stride, v.stride);\n+ }\n+\n+ set(v: Readonly<Vec4>) {\n+ set4(this.buf, v.buf, this.index, v.index, this.stride, v.stride);\n+ return this;\n+ }\n+\n+ setN(n: number) {\n+ set4n(this.buf, n, this.index, this.stride);\n+ return this;\n+ }\n+\n+ setS(x: number, y: number, z: number, w: number) {\n+ set4s(this.buf, x, y, z, w, this.index, this.stride);\n+ return this;\n+ }\n+\n+ add(v: Readonly<Vec4>) {\n+ add4(this.buf, v.buf, this.index, v.index, this.stride, v.stride);\n+ return this;\n+ }\n+\n+ sub(v: Readonly<Vec4>) {\n+ sub4(this.buf, v.buf, this.index, v.index, this.stride, v.stride);\n+ return this;\n+ }\n+\n+ mul(v: Readonly<Vec4>) {\n+ mul4(this.buf, v.buf, this.index, v.index, this.stride, v.stride);\n+ return this;\n+ }\n+\n+ div(v: Readonly<Vec4>) {\n+ div4(this.buf, v.buf, this.index, v.index, this.stride, v.stride);\n+ return this;\n+ }\n+\n+ addN(n: number) {\n+ add4n(this.buf, n, this.index, this.stride);\n+ return this;\n+ }\n+\n+ subN(n: number) {\n+ sub4n(this.buf, n, this.index, this.stride);\n+ return this;\n+ }\n+\n+ mulN(n: number) {\n+ mul4n(this.buf, n, this.index, this.stride);\n+ return this;\n+ }\n+\n+ divN(n: number) {\n+ div4n(this.buf, n, this.index, this.stride);\n+ return this;\n+ }\n+\n+ neg() {\n+ mul4n(this.buf, -1, this.index, this.stride);\n+ return this;\n+ }\n+\n+ abs() {\n+ abs4(this.buf, this.index, this.stride);\n+ return this;\n+ }\n+\n+ sign() {\n+ sign4(this.buf, this.index, this.stride);\n+ return this;\n+ }\n+\n+ floor() {\n+ floor4(this.buf, this.index, this.stride);\n+ return this;\n+ }\n+\n+ ceil() {\n+ ceil4(this.buf, this.index, this.stride);\n+ return this;\n+ }\n+\n+ sqrt() {\n+ sqrt4(this.buf, this.index, this.stride);\n+ return this;\n+ }\n+\n+ pow(v: Readonly<Vec4>) {\n+ pow4(this.buf, v.buf, this.index, v.index, this.stride, v.stride);\n+ return this;\n+ }\n+\n+ powN(n: number) {\n+ pow4n(this.buf, n, this.index, this.stride);\n+ return this;\n+ }\n+\n+ sin() {\n+ sin4(this.buf, this.index, this.stride);\n+ return this;\n+ }\n+\n+ cos() {\n+ cos4(this.buf, this.index, this.stride);\n+ return this;\n+ }\n+\n+ madd(b: Readonly<Vec4>, c: Readonly<Vec4>) {\n+ madd4(this.buf, b.buf, c.buf, this.index, b.index, c.index, this.stride, b.stride, c.stride);\n+ return this;\n+ }\n+\n+ maddN(b: Readonly<Vec4>, n: number) {\n+ madd4n(this.buf, b.buf, n, this.index, b.index, this.stride, b.stride);\n+ return this;\n+ }\n+\n+ mix(b: Readonly<Vec4>, c: Readonly<Vec4>) {\n+ mix4(this.buf, b.buf, c.buf, this.index, b.index, c.index, this.stride, b.stride, c.stride);\n+ return this;\n+ }\n+\n+ mixN(b: Readonly<Vec4>, n: number) {\n+ mix4n(this.buf, b.buf, n, this.index, b.index, this.stride, b.stride);\n+ return this;\n+ }\n+\n+ min(v: Readonly<Vec4>) {\n+ min4(this.buf, v.buf, this.index, v.index, this.stride, v.stride);\n+ return this;\n+ }\n+\n+ max(v: Readonly<Vec4>) {\n+ max4(this.buf, v.buf, this.index, v.index, this.stride, v.stride);\n+ return this;\n+ }\n+\n+ clamp(min: Readonly<Vec4>, max: Readonly<Vec4>) {\n+ clamp4(this.buf, min.buf, max.buf, this.index, min.index, max.index, this.stride, min.stride, max.stride);\n+ return this;\n+ }\n+\n+ minorAxis() {\n+ return minor4(this.buf, this.index, this.stride);\n+ }\n+\n+ majorAxis() {\n+ return major4(this.buf, this.index, this.stride);\n+ }\n+\n+ step(e: Readonly<Vec4>) {\n+ step4(this.buf, e.buf, this.index, e.index, this.stride, e.stride);\n+ return this;\n+ }\n+\n+ smoothStep(e1: Readonly<Vec4>, e2: Readonly<Vec4>) {\n+ smoothStep4(this.buf, e1.buf, e2.buf, this.index, e1.index, e2.index, this.stride, e1.stride, e2.stride);\n+ return this;\n+ }\n+\n+ dot(v: Readonly<Vec4>) {\n+ return dot4(this.buf, v.buf, this.index, v.index, this.stride, v.stride);\n+ }\n+\n+ mag() {\n+ return mag4(this.buf, this.index, this.stride);\n+ }\n+\n+ magSq() {\n+ return mag4sq(this.buf, this.index, this.stride);\n+ }\n+\n+ dist(v: Readonly<Vec4>) {\n+ return dist4(this.buf, v.buf, this.index, v.index, this.stride, v.stride);\n+ }\n+\n+ distSq(v: Readonly<Vec4>) {\n+ return dist4sq(this.buf, v.buf, this.index, v.index, this.stride, v.stride);\n+ }\n+\n+ distManhattan(v: Readonly<Vec4>) {\n+ return distManhattan4(this.buf, v.buf, this.index, v.index, this.stride, v.stride);\n+ }\n+\n+ distChebyshev(v: Readonly<Vec4>) {\n+ return distChebyshev4(this.buf, v.buf, this.index, v.index, this.stride, v.stride);\n+ }\n+\n+ normalize(n = 1) {\n+ normalize4(this.buf, n, this.index, this.stride);\n+ return this;\n+ }\n+\n+ limit(n: number) {\n+ limit4(this.buf, n, this.index, this.stride);\n+ return this;\n+ }\n+\n+ reflect(n: Readonly<Vec4>) {\n+ reflect4(this.buf, n.buf, this.index, n.index, this.stride, n.stride);\n+ return this;\n+ }\n+\n+ toString() {\n+ return `[${this.buf[this.index]}, ${this.buf[this.index + this.stride]}, ${this.buf[this.index + 2 * this.stride]}, ${this.buf[this.index + 3 * this.stride]}]`;\n+ }\n+}\n",
"new_path": "packages/vectors/src/vec4.ts",
"old_path": null
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | feat(vectors): add vec4 ops & class wrapper | 1 | feat | vectors |
679,913 | 25.07.2018 22:53:28 | -3,600 | 2a5a744d4c41c04b64ddf87e3d96c15ffcd145f1 | fix(vectors): copy/paste mistakes, add tests | [
{
"change_type": "MODIFY",
"diff": "@@ -53,10 +53,10 @@ export const add2n = (a: Vec, n: number, ia = 0, sa = 1) =>\n(a[ia] += n, a[ia + sa] += n, a);\nexport const sub2n = (a: Vec, n: number, ia = 0, sa = 1) =>\n- (a[ia] *= n, a[ia + sa] *= n, a);\n+ (a[ia] -= n, a[ia + sa] -= n, a);\nexport const mul2n = (a: Vec, n: number, ia = 0, sa = 1) =>\n- (a[ia] -= n, a[ia + sa] -= n, a);\n+ (a[ia] *= n, a[ia + sa] *= n, a);\nexport const div2n = (a: Vec, n: number, ia = 0, sa = 1) =>\n(a[ia] /= n, a[ia + sa] /= n, a);\n",
"new_path": "packages/vectors/src/vec2.ts",
"old_path": "packages/vectors/src/vec2.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -85,10 +85,10 @@ export const add3n = (a: Vec, n: number, ia = 0, sa = 1) =>\n(a[ia] += n, a[ia + sa] += n, a[ia + 2 * sa] += n, a);\nexport const sub3n = (a: Vec, n: number, ia = 0, sa = 1) =>\n- (a[ia] *= n, a[ia + sa] *= n, a[ia + 2 * sa] -= n, a);\n+ (a[ia] -= n, a[ia + sa] -= n, a[ia + 2 * sa] -= n, a);\nexport const mul3n = (a: Vec, n: number, ia = 0, sa = 1) =>\n- (a[ia] -= n, a[ia + sa] -= n, a[ia + 2 * sa] *= n, a);\n+ (a[ia] *= n, a[ia + sa] *= n, a[ia + 2 * sa] *= n, a);\nexport const div3n = (a: Vec, n: number, ia = 0, sa = 1) =>\n(a[ia] /= n, a[ia + sa] /= n, a[ia + 2 * sa] /= n, a);\n",
"new_path": "packages/vectors/src/vec3.ts",
"old_path": "packages/vectors/src/vec3.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -97,10 +97,10 @@ export const add4n = (a: Vec, n: number, ia = 0, sa = 1) =>\n(a[ia] += n, a[ia + sa] += n, a[ia + 2 * sa] += n, a[ia + 3 * sa] += n, a);\nexport const sub4n = (a: Vec, n: number, ia = 0, sa = 1) =>\n- (a[ia] *= n, a[ia + sa] *= n, a[ia + 2 * sa] -= n, a[ia + 3 * sa] -= n, a);\n+ (a[ia] -= n, a[ia + sa] -= n, a[ia + 2 * sa] -= n, a[ia + 3 * sa] -= n, a);\nexport const mul4n = (a: Vec, n: number, ia = 0, sa = 1) =>\n- (a[ia] -= n, a[ia + sa] -= n, a[ia + 2 * sa] *= n, a[ia + 3 * sa] *= n, a);\n+ (a[ia] *= n, a[ia + sa] *= n, a[ia + 2 * sa] *= n, a[ia + 3 * sa] *= n, a);\nexport const div4n = (a: Vec, n: number, ia = 0, sa = 1) =>\n(a[ia] /= n, a[ia + sa] /= n, a[ia + 2 * sa] /= n, a[ia + 3 * sa] /= n, a);\n",
"new_path": "packages/vectors/src/vec4.ts",
"old_path": "packages/vectors/src/vec4.ts"
},
{
"change_type": "DELETE",
"diff": "-// import * as assert from \"assert\";\n-// import * as vectors from \"../src/index\";\n-\n-describe(\"vectors\", () => {\n- it(\"tests pending\");\n-});\n",
"new_path": null,
"old_path": "packages/vectors/test/index.ts"
},
{
"change_type": "ADD",
"diff": "+import * as assert from \"assert\";\n+import * as v from \"../src/index\";\n+\n+describe(\"vec2\", () => {\n+\n+ const op2 = (fn, x, y) => {\n+ assert.deepEqual(\n+ fn([1, 2], [10, 20]),\n+ [x, y]\n+ );\n+ assert.deepEqual(\n+ fn([0, 1, 0, 0, 0, 2, 0, 0], [0, 10, 0, 20, 0], 1, 1, 4, 2),\n+ [0, x, 0, 0, 0, y, 0, 0]\n+ );\n+ };\n+\n+ const opn = (fn, x, y) => {\n+ assert.deepEqual(\n+ fn([1, 2], 10),\n+ [x, y]\n+ );\n+ assert.deepEqual(\n+ fn([0, 1, 0, 0, 0, 2, 0, 0], 10, 1, 4),\n+ [0, x, 0, 0, 0, y, 0, 0]\n+ );\n+ };\n+\n+ it(\"add\", () => op2(v.add2, 11, 22));\n+ it(\"sub\", () => op2(v.sub2, -9, -18));\n+ it(\"mul\", () => op2(v.mul2, 10, 40));\n+ it(\"div\", () => op2(v.div2, 0.1, 0.1));\n+\n+ it(\"addn\", () => opn(v.add2n, 11, 12));\n+ it(\"subn\", () => opn(v.sub2n, -9, -8));\n+ it(\"muln\", () => opn(v.mul2n, 10, 20));\n+ it(\"divn\", () => opn(v.div2n, 0.1, 0.2));\n+});\n",
"new_path": "packages/vectors/test/vec2.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import * as assert from \"assert\";\n+import * as v from \"../src/index\";\n+\n+describe(\"vec3\", () => {\n+\n+ const op2 = (fn, x, y, z) => {\n+ assert.deepEqual(\n+ fn([1, 2, 3], [10, 20, 30]),\n+ [x, y, z]\n+ );\n+ assert.deepEqual(\n+ fn([0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0], [0, 10, 0, 20, 0, 30, 0], 1, 1, 4, 2),\n+ [0, x, 0, 0, 0, y, 0, 0, 0, z, 0, 0]\n+ );\n+ };\n+\n+ const opn = (fn, x, y, z) => {\n+ assert.deepEqual(\n+ fn([1, 2, 3], 10),\n+ [x, y, z]\n+ );\n+ assert.deepEqual(\n+ fn([0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0], 10, 1, 4),\n+ [0, x, 0, 0, 0, y, 0, 0, 0, z, 0, 0]\n+ );\n+ };\n+\n+ it(\"add\", () => op2(v.add3, 11, 22, 33));\n+ it(\"sub\", () => op2(v.sub3, -9, -18, -27));\n+ it(\"mul\", () => op2(v.mul3, 10, 40, 90));\n+ it(\"div\", () => op2(v.div3, 0.1, 0.1, 0.1));\n+\n+ it(\"addn\", () => opn(v.add3n, 11, 12, 13));\n+ it(\"subn\", () => opn(v.sub3n, -9, -8, -7));\n+ it(\"muln\", () => opn(v.mul3n, 10, 20, 30));\n+ it(\"divn\", () => opn(v.div3n, 0.1, 0.2, 0.3));\n+});\n",
"new_path": "packages/vectors/test/vec3.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import * as assert from \"assert\";\n+import * as v from \"../src/index\";\n+\n+describe(\"vec4\", () => {\n+\n+ const op2 = (fn, x, y, z, w) => {\n+ assert.deepEqual(\n+ fn([1, 2, 3, 4], [10, 20, 30, 40]),\n+ [x, y, z, w]\n+ );\n+ assert.deepEqual(\n+ fn([0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0], [0, 10, 0, 20, 0, 30, 0, 40, 0], 1, 1, 4, 2),\n+ [0, x, 0, 0, 0, y, 0, 0, 0, z, 0, 0, 0, w, 0, 0]\n+ );\n+ };\n+\n+ const opn = (fn, x, y, z, w) => {\n+ assert.deepEqual(\n+ fn([1, 2, 3, 4], 10),\n+ [x, y, z, w]\n+ );\n+ assert.deepEqual(\n+ fn([0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0], 10, 1, 4),\n+ [0, x, 0, 0, 0, y, 0, 0, 0, z, 0, 0, 0, w, 0, 0]\n+ );\n+ };\n+\n+ it(\"add\", () => op2(v.add4, 11, 22, 33, 44));\n+ it(\"sub\", () => op2(v.sub4, -9, -18, -27, -36));\n+ it(\"mul\", () => op2(v.mul4, 10, 40, 90, 160));\n+ it(\"div\", () => op2(v.div4, 0.1, 0.1, 0.1, 0.1));\n+\n+ it(\"addn\", () => opn(v.add4n, 11, 12, 13, 14));\n+ it(\"subn\", () => opn(v.sub4n, -9, -8, -7, -6));\n+ it(\"muln\", () => opn(v.mul4n, 10, 20, 30, 40));\n+ it(\"divn\", () => opn(v.div4n, 0.1, 0.2, 0.3, 0.4));\n+});\n",
"new_path": "packages/vectors/test/vec4.ts",
"old_path": null
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | fix(vectors): copy/paste mistakes, add tests | 1 | fix | vectors |
807,932 | 26.07.2018 01:58:40 | -7,200 | 8500aef6e5c3ac2636ff32883fdc78d670a01fac | docs(readme): document npmClientArgs on lerna.json [skip ci]
One small step towards | [
{
"change_type": "MODIFY",
"diff": "@@ -145,7 +145,8 @@ Running `lerna` without arguments will show all commands/options.\n]\n},\n\"bootstrap\": {\n- \"ignore\": \"component-*\"\n+ \"ignore\": \"component-*\",\n+ \"npmClientArgs\": [\"--no-package-lock\"]\n}\n},\n\"packages\": [\"packages/*\"]\n@@ -155,6 +156,7 @@ Running `lerna` without arguments will show all commands/options.\n* `version`: the current version of the repository.\n* `command.publish.ignoreChanges`: an array of globs that won't be included in `lerna changed/publish`. Use this to prevent publishing a new version unnecessarily for changes, such as fixing a `README.md` typo.\n* `command.bootstrap.ignore`: an array of globs that won't be bootstrapped when running the `lerna bootstrap` command.\n+* `command.bootstrap.npmClientArgs`: array of strings that will be passed as arguments directly to `npm install` during the `lerna bootstrap` command.\n* `command.bootstrap.scope`: an array of globs that restricts which packages will be bootstrapped when running the `lerna bootstrap` command.\n* `packages`: Array of globs to use as package locations.\n",
"new_path": "README.md",
"old_path": "README.md"
}
] | JavaScript | MIT License | lerna/lerna | docs(readme): document npmClientArgs on lerna.json (#1514) [skip ci]
One small step towards #1283 | 1 | docs | readme |
807,960 | 26.07.2018 07:58:52 | -28,800 | 878073ab43c77a34716606c4d6fc717f91ce4f9c | docs: Fix link to hoist docs in bootstrap README [skip ci] | [
{
"change_type": "MODIFY",
"diff": "@@ -49,7 +49,7 @@ the default is `**` (hoist everything). This option only affects the\n$ lerna bootstrap --hoist\n```\n-For background on `--hoist`, see the [hoist documentation](doc/hoist.md).\n+For background on `--hoist`, see the [hoist documentation](../../doc/hoist.md).\nNote: If packages depend on different _versions_ of an external dependency,\nthe most commonly used version will be hoisted, and a warning will be emitted.\n",
"new_path": "commands/bootstrap/README.md",
"old_path": "commands/bootstrap/README.md"
}
] | JavaScript | MIT License | lerna/lerna | docs: Fix link to hoist docs in bootstrap README (#1518) [skip ci] | 1 | docs | null |
217,922 | 26.07.2018 10:05:46 | -7,200 | 26bd117b554ea618a8ba3cf446ba8d24d1ad1ae8 | chore: fix for CI build on PR | [
{
"change_type": "MODIFY",
"diff": "@@ -605,6 +605,8 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\ndata: this.listData.modificationsHistory\n.sort((a, b) => a.date > b.date ? -1 : 1)\n});\n+ }\n+\npublic assignTeam(list: List, team: Team): void {\nlist.teamId = team.$key;\nthis.update(list);\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"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | chore: fix for CI build on PR | 1 | chore | null |
217,922 | 26.07.2018 10:32:10 | -7,200 | be0872bed61e7ee93a75fe8ae2738d3eb63e2bc8 | chore: updated translation report file | [
{
"change_type": "MODIFY",
"diff": "de | es | fr | ja | pt |\n:---: | :---: | :---: | :---: | :---: |\n-91% | 96% | 97% | 27% | 69% |\n+91% | 95% | 97% | 27% | 68% |\n## Categories details :\n@@ -21,7 +21,7 @@ ALARM | 67% | 67% | 100% | 0% | 67% |\nSETTINGS | 90% | 70% | 100% | 10% | 60% |\nPROFILE | 95% | 95% | 100% | 0% | 75% |\nLISTS | 93% | 100% | 100% | 13% | 93% |\n-LIST | 15% | 100% | 100% | 0% | 15% |\n+LIST | 14% | 93% | 100% | 0% | 14% |\nLIST_DETAILS | 100% | 100% | 100% | 0% | 98% |\nLIST_TAGS | 100% | 100% | 100% | 100% | 100% |\nRECIPES | 100% | 100% | 100% | 0% | 100% |\n@@ -56,6 +56,7 @@ TEAMS | 0% | 0% | 0% | 0% | 0% |\n* `LISTS.Add_selection` : `Add selection to a list`\n* `LIST.Copy_as_text` : `Copy as text`\n* `LIST.Total_price` : `Total trades (gils and currencies)`\n+ * `LIST.History` : `History`\n* `LIST.BUTTONS.Add_link_description` : `Create a custom link for this list`\n* `LIST.BUTTONS.Create_template_description` : `Create a template link for this list, which will create a copy of the list for whoever opens it`\n* `LIST.BUTTONS.Copy_template_url_description` : `Copy the template link for this list, which will create a copy of the list for whoever opens it`\n@@ -90,6 +91,8 @@ TEAMS | 0% | 0% | 0% | 0% | 0% |\n* `TEAMS.Add_user` : `Add a user`\n* `TEAMS.No_teams` : `No Teams`\n* `TEAMS.Pending` : `Pending`\n+ * `TEAMS.Assign_list` : `Assign this list to a team`\n+ * `TEAMS.Detach_team` : `Detach team`\n### es :\n@@ -99,6 +102,7 @@ TEAMS | 0% | 0% | 0% | 0% | 0% |\n* `SETTINGS.Downloading_update` : `Downloading update`\n* `SETTINGS.No_update_available` : `No update available`\n* `PROFILE.VERIFICATION.Title` : `Profile validation`\n+ * `LIST.History` : `History`\n* `SIMULATOR.STATS.CP` : `undefined`\n* `SIMULATOR.STATS.Craftsmanship` : `undefined`\n* `SIMULATOR.STATS.Control` : `undefined`\n@@ -116,6 +120,8 @@ TEAMS | 0% | 0% | 0% | 0% | 0% |\n* `TEAMS.Add_user` : `Add a user`\n* `TEAMS.No_teams` : `No Teams`\n* `TEAMS.Pending` : `Pending`\n+ * `TEAMS.Assign_list` : `Assign this list to a team`\n+ * `TEAMS.Detach_team` : `Detach team`\n### fr :\n@@ -135,6 +141,8 @@ TEAMS | 0% | 0% | 0% | 0% | 0% |\n* `TEAMS.Add_user` : `Add a user`\n* `TEAMS.No_teams` : `No Teams`\n* `TEAMS.Pending` : `Pending`\n+ * `TEAMS.Assign_list` : `Assign this list to a team`\n+ * `TEAMS.Detach_team` : `Detach team`\n### ja :\n@@ -321,6 +329,7 @@ TEAMS | 0% | 0% | 0% | 0% | 0% |\n* `LIST.Enable_crystals_tracking` : `Enable crystals tracking`\n* `LIST.Copy_as_text` : `Copy as text`\n* `LIST.Total_price` : `Total trades (gils and currencies)`\n+ * `LIST.History` : `History`\n* `LIST.BUTTONS.Add_link_description` : `Create a custom link for this list`\n* `LIST.BUTTONS.Create_template_description` : `Create a template link for this list, which will create a copy of the list for whoever opens it`\n* `LIST.BUTTONS.Copy_template_url_description` : `Copy the template link for this list, which will create a copy of the list for whoever opens it`\n@@ -534,6 +543,8 @@ TEAMS | 0% | 0% | 0% | 0% | 0% |\n* `TEAMS.Add_user` : `Add a user`\n* `TEAMS.No_teams` : `No Teams`\n* `TEAMS.Pending` : `Pending`\n+ * `TEAMS.Assign_list` : `Assign this list to a team`\n+ * `TEAMS.Detach_team` : `Detach team`\n### pt :\n@@ -561,6 +572,7 @@ TEAMS | 0% | 0% | 0% | 0% | 0% |\n* `LISTS.Add_selection` : `Add selection to a list`\n* `LIST.Copy_as_text` : `Copy as text`\n* `LIST.Total_price` : `Total trades (gils and currencies)`\n+ * `LIST.History` : `History`\n* `LIST.BUTTONS.Add_link_description` : `Create a custom link for this list`\n* `LIST.BUTTONS.Create_template_description` : `Create a template link for this list, which will create a copy of the list for whoever opens it`\n* `LIST.BUTTONS.Copy_template_url_description` : `Copy the template link for this list, which will create a copy of the list for whoever opens it`\n@@ -708,5 +720,7 @@ TEAMS | 0% | 0% | 0% | 0% | 0% |\n* `TEAMS.Add_user` : `Add a user`\n* `TEAMS.No_teams` : `No Teams`\n* `TEAMS.Pending` : `Pending`\n+ * `TEAMS.Assign_list` : `Assign this list to a team`\n+ * `TEAMS.Detach_team` : `Detach team`\n",
"new_path": "TRANSLATION_COMPLETION.md",
"old_path": "TRANSLATION_COMPLETION.md"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | chore: updated translation report file | 1 | chore | null |
217,922 | 26.07.2018 10:42:39 | -7,200 | a800061cda5db71de8702b9f09334044967d45d8 | chore: updated translation report file with a bug fix for SIMULATOR keys | [
{
"change_type": "MODIFY",
"diff": "de | es | fr | ja | pt |\n:---: | :---: | :---: | :---: | :---: |\n-91% | 95% | 97% | 27% | 68% |\n+91% | 96% | 97% | 28% | 68% |\n## Categories details :\n@@ -33,7 +33,7 @@ ANNOUNCEMENT | 100% | 100% | 100% | 50% | 100% |\nLIST_TEMPLATE | 100% | 100% | 100% | 0% | 100% |\nPERMISSIONS | 100% | 100% | 100% | 0% | 100% |\nWIKI | 100% | 100% | 100% | 33% | 100% |\n-SIMULATOR | 85% | 96% | 96% | 67% | 0% |\n+SIMULATOR | 89% | 100% | 100% | 71% | 0% |\nHOME_PAGE | 100% | 100% | 100% | 4% | 100% |\nPRICING | 0% | 100% | 100% | 0% | 0% |\nCOMMISSION_BOARD | 98% | 94% | 98% | 0% | 0% |\n@@ -74,9 +74,6 @@ TEAMS | 0% | 0% | 0% | 0% | 0% |\n* `SIMULATOR.Change_rotation` : `Change rotation`\n* `SIMULATOR.New_rotation_folder` : `New folder`\n* `SIMULATOR.CONFIGURATION.Reset_set` : `Reset these stats`\n- * `SIMULATOR.STATS.CP` : `undefined`\n- * `SIMULATOR.STATS.Craftsmanship` : `undefined`\n- * `SIMULATOR.STATS.Control` : `undefined`\n* `PRICING.From_vendor` : `Price from vendor`\n* `PRICING.Materials_have_cost` : `Materials for this craft have cost > 0, make sure you're not counting them twice`\n* `COMMISSION_BOARD.Negotiable_price` : `Negotiable`\n@@ -103,9 +100,6 @@ TEAMS | 0% | 0% | 0% | 0% | 0% |\n* `SETTINGS.No_update_available` : `No update available`\n* `PROFILE.VERIFICATION.Title` : `Profile validation`\n* `LIST.History` : `History`\n- * `SIMULATOR.STATS.CP` : `undefined`\n- * `SIMULATOR.STATS.Craftsmanship` : `undefined`\n- * `SIMULATOR.STATS.Control` : `undefined`\n* `COMMISSION_BOARD.Negotiable_price` : `Negotiable`\n* `COMMISSION_BOARD.FILTERS.Min_price` : `Min price`\n* `COMMISSION_BOARD.FILTERS.Max_price` : `Max price`\n@@ -126,9 +120,6 @@ TEAMS | 0% | 0% | 0% | 0% | 0% |\n### fr :\n- * `SIMULATOR.STATS.CP` : `undefined`\n- * `SIMULATOR.STATS.Craftsmanship` : `undefined`\n- * `SIMULATOR.STATS.Control` : `undefined`\n* `COMMISSION_BOARD.Negotiable_price` : `Negotiable`\n* `NOTIFICATIONS.Title` : `Notifications`\n* `NOTIFICATIONS.List_progress` : `{{author}} added {{amount}} {{itemName}} to list \"{{listName}}\"`\n@@ -454,9 +445,6 @@ TEAMS | 0% | 0% | 0% | 0% | 0% |\n* `SIMULATOR.Change_rotation` : `Change rotation`\n* `SIMULATOR.CONFIGURATION.Action` : `Choose free company actions`\n* `SIMULATOR.CONFIGURATION.Save_consumables` : `Save these consumables as default`\n- * `SIMULATOR.STATS.CP` : `undefined`\n- * `SIMULATOR.STATS.Craftsmanship` : `undefined`\n- * `SIMULATOR.STATS.Control` : `undefined`\n* `HOME_PAGE.title` : `Create lists, share, contribute, craft`\n* `HOME_PAGE.count` : `lists currently stored`\n* `HOME_PAGE.lists_created_count` : `lists created using FFXIV Teamcraft`\n@@ -655,9 +643,9 @@ TEAMS | 0% | 0% | 0% | 0% | 0% |\n* `SIMULATOR.CONFIGURATION.Save_set` : `Save these stats for this job`\n* `SIMULATOR.CONFIGURATION.Reset_set` : `Reset these stats`\n* `SIMULATOR.CONFIGURATION.Save_consumables` : `Save these consumables as default`\n- * `SIMULATOR.STATS.CP` : `undefined`\n- * `SIMULATOR.STATS.Craftsmanship` : `undefined`\n- * `SIMULATOR.STATS.Control` : `undefined`\n+ * `SIMULATOR.CONFIGURATION.STATS.CP` : `CP`\n+ * `SIMULATOR.CONFIGURATION.STATS.Craftsmanship` : `Craftsmanship`\n+ * `SIMULATOR.CONFIGURATION.STATS.Control` : `Control`\n* `PRICING.From_vendor` : `Price from vendor`\n* `PRICING.Materials_have_cost` : `Materials for this craft have cost > 0, make sure you're not counting them twice`\n* `COMMISSION_BOARD.Title` : `Commission board`\n",
"new_path": "TRANSLATION_COMPLETION.md",
"old_path": "TRANSLATION_COMPLETION.md"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | chore: updated translation report file with a bug fix for SIMULATOR keys | 1 | chore | null |
217,922 | 26.07.2018 11:12:44 | -7,200 | dd4c4ab55d1d6f2d2adbe27a7348c37b38d68522 | chore: added FR translations for 4.4 | [
{
"change_type": "MODIFY",
"diff": "# Translation completion report\n-**Global completion** : 76%\n+**Global completion** : 77%\nde | es | fr | ja | pt |\n:---: | :---: | :---: | :---: | :---: |\n-91% | 96% | 97% | 28% | 68% |\n+91% | 96% | 100% | 28% | 68% |\n## Categories details :\n@@ -36,9 +36,9 @@ WIKI | 100% | 100% | 100% | 33% | 100% |\nSIMULATOR | 89% | 100% | 100% | 71% | 0% |\nHOME_PAGE | 100% | 100% | 100% | 4% | 100% |\nPRICING | 0% | 100% | 100% | 0% | 0% |\n-COMMISSION_BOARD | 98% | 94% | 98% | 0% | 0% |\n-NOTIFICATIONS | 0% | 0% | 0% | 0% | 0% |\n-TEAMS | 0% | 0% | 0% | 0% | 0% |\n+COMMISSION_BOARD | 98% | 94% | 100% | 0% | 0% |\n+NOTIFICATIONS | 0% | 0% | 100% | 0% | 0% |\n+TEAMS | 0% | 0% | 100% | 0% | 0% |\n## Detailed report\n### de :\n@@ -120,20 +120,6 @@ TEAMS | 0% | 0% | 0% | 0% | 0% |\n### fr :\n- * `COMMISSION_BOARD.Negotiable_price` : `Negotiable`\n- * `NOTIFICATIONS.Title` : `Notifications`\n- * `NOTIFICATIONS.List_progress` : `{{author}} added {{amount}} {{itemName}} to list \"{{listName}}\"`\n- * `NOTIFICATIONS.Team_invite` : `{{invitedBy}} invited you to team {{teamName}}`\n- * `NOTIFICATIONS.Item_assigned` : `{{itemName}} has been assigned to you on list \"{{listName}}\"`\n- * `NOTIFICATIONS.List_commented` : `{{userName}} commented on list {{listName}}: \"{{content}}\"`\n- * `NOTIFICATIONS.Mark_all_as_read` : `Mark all as read`\n- * `TEAMS.Title` : `Teams`\n- * `TEAMS.Create_team` : `Create a team`\n- * `TEAMS.Add_user` : `Add a user`\n- * `TEAMS.No_teams` : `No Teams`\n- * `TEAMS.Pending` : `Pending`\n- * `TEAMS.Assign_list` : `Assign this list to a team`\n- * `TEAMS.Detach_team` : `Detach team`\n### ja :\n",
"new_path": "TRANSLATION_COMPLETION.md",
"old_path": "TRANSLATION_COMPLETION.md"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | chore: added FR translations for 4.4 | 1 | chore | null |
791,723 | 26.07.2018 11:50:03 | 25,200 | d666ad7d687249073b9b97fd81fdd1e564681e01 | report: (minor) add license to HTML files | [
{
"change_type": "MODIFY",
"diff": "<!--\n-Copyright 2017 Google Inc. All Rights Reserved.\n+@license Copyright 2017 Google Inc. All Rights Reserved.\nLicensed 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\nUnless 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",
"new_path": "lighthouse-core/report/html/report-template.html",
"old_path": "lighthouse-core/report/html/report-template.html"
},
{
"change_type": "MODIFY",
"diff": "+<!--\n+@license Copyright 2017 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+\n<!-- Lighthouse run warnings -->\n<template id=\"tmpl-lh-warnings--toplevel\">\n<div class=\"lh-warnings lh-warnings--toplevel\">\n",
"new_path": "lighthouse-core/report/html/templates.html",
"old_path": "lighthouse-core/report/html/templates.html"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | report: (minor) add license to HTML files (#5731) | 1 | report | null |
791,834 | 26.07.2018 13:35:56 | 25,200 | 0421b6cbe42d0a0a9fdfdb245d9d158c3ae9aa6d | core: adjust audit titles for consistency | [
{
"change_type": "MODIFY",
"diff": "@@ -12,7 +12,7 @@ const i18n = require('../lib/i18n');\nconst UIStrings = {\ntitle: 'JavaScript boot-up time',\n- failureTitle: 'JavaScript boot-up time is too high',\n+ failureTitle: 'Reduce JavaScript boot-up time',\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",
"new_path": "lighthouse-core/audits/bootup-time.js",
"old_path": "lighthouse-core/audits/bootup-time.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -10,7 +10,7 @@ const i18n = require('../../lib/i18n');\nconst UIStrings = {\ntitle: 'Avoids enormous network payloads',\n- failureTitle: 'Has enormous network payloads',\n+ failureTitle: 'Avoid enormous network payloads',\ndescription:\n'Large network payloads cost users real money and are highly correlated with ' +\n'long load times. [Learn ' +\n",
"new_path": "lighthouse-core/audits/byte-efficiency/total-byte-weight.js",
"old_path": "lighthouse-core/audits/byte-efficiency/total-byte-weight.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -16,7 +16,7 @@ const i18n = require('../../lib/i18n');\nconst UIStrings = {\ntitle: 'Uses efficient cache policy on static assets',\n- failureTitle: 'Uses inefficient cache policy on static assets',\n+ failureTitle: 'Serve static assets with an efficient cache policy',\ndescription:\n'A long cache lifetime can speed up repeat visits to your page. ' +\n'[Learn more](https://developers.google.com/web/tools/lighthouse/audits/cache-policy).',\n",
"new_path": "lighthouse-core/audits/byte-efficiency/uses-long-cache-ttl.js",
"old_path": "lighthouse-core/audits/byte-efficiency/uses-long-cache-ttl.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -9,7 +9,7 @@ const Audit = require('./audit');\nconst i18n = require('../lib/i18n');\nconst UIStrings = {\n- title: 'Critical Request Chains',\n+ title: 'Minimize Critical Request Chains',\ndescription: 'The Critical Request Chains below show you what resources are ' +\n'issued with a high priority. Consider reducing ' +\n'the length of chains, reducing the download size of resources, or ' +\n",
"new_path": "lighthouse-core/audits/critical-request-chains.js",
"old_path": "lighthouse-core/audits/critical-request-chains.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -22,7 +22,7 @@ const MAX_DOM_TREE_DEPTH = 32;\nconst UIStrings = {\ntitle: 'Avoids an excessive DOM size',\n- failureTitle: 'Uses an excessive DOM size',\n+ failureTitle: 'Avoid an excessive DOM size',\ndescription: 'Browser engineers recommend pages contain fewer than ' +\n`~${MAX_DOM_NODES.toLocaleString()} DOM nodes. The sweet spot is a tree ` +\n`depth < ${MAX_DOM_TREE_DEPTH} elements and fewer than ${MAX_DOM_TREE_WIDTH} ` +\n",
"new_path": "lighthouse-core/audits/dobetterweb/dom-size.js",
"old_path": "lighthouse-core/audits/dobetterweb/dom-size.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -12,7 +12,7 @@ const i18n = require('../lib/i18n');\nconst UIStrings = {\ntitle: 'All text remains visible during webfont loads',\n- failureTitle: 'Text is invisible while webfonts are loading',\n+ failureTitle: 'Ensure text remains visible during webfont load',\ndescription: 'Leverage the font-display CSS feature to ensure text is user-visible while ' +\n'webfonts are loading. ' +\n'[Learn more](https://developers.google.com/web/updates/2016/02/font-display).',\n",
"new_path": "lighthouse-core/audits/font-display.js",
"old_path": "lighthouse-core/audits/font-display.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -16,7 +16,7 @@ const i18n = require('../lib/i18n');\nconst UIStrings = {\ntitle: 'Minimizes main thread work',\n- failureTitle: 'Has significant main thread work',\n+ failureTitle: 'Minimize main thread work',\ndescription: 'Consider reducing the time spent parsing, compiling and executing JS. ' +\n'You may find delivering smaller JS payloads helps with this.',\ncolumnCategory: 'Category',\n",
"new_path": "lighthouse-core/audits/mainthread-work-breakdown.js",
"old_path": "lighthouse-core/audits/mainthread-work-breakdown.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -9,7 +9,8 @@ const Audit = require('./audit');\nconst i18n = require('../lib/i18n');\nconst UIStrings = {\n- title: 'Keep server response times low (TTFB)',\n+ title: 'Server response times are low (TTFB)',\n+ failureTitle: 'Reduce server response times (TTFB)',\ndescription: 'Time To First Byte identifies the time at which your server sends a response.' +\n' [Learn more](https://developers.google.com/web/tools/lighthouse/audits/ttfb).',\ndisplayValue: `Root document took {timeInMs, number, milliseconds}\\xa0ms`,\n@@ -27,6 +28,7 @@ class TTFBMetric extends Audit {\nreturn {\nid: 'time-to-first-byte',\ntitle: str_(UIStrings.title),\n+ failureTitle: str_(UIStrings.failureTitle),\ndescription: str_(UIStrings.description),\nrequiredArtifacts: ['devtoolsLogs', 'URL'],\n};\n",
"new_path": "lighthouse-core/audits/time-to-first-byte.js",
"old_path": "lighthouse-core/audits/time-to-first-byte.js"
},
{
"change_type": "MODIFY",
"diff": "\"message\": \"JavaScript boot-up time\"\n},\n\"lighthouse-core/audits/bootup-time.js | failureTitle\": {\n- \"message\": \"JavaScript boot-up time is too high\"\n+ \"message\": \"Reduce JavaScript boot-up time\"\n},\n\"lighthouse-core/audits/bootup-time.js | description\": {\n\"message\": \"Consider reducing the time spent parsing, compiling, and executing JS. You may find delivering smaller JS payloads helps with this. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/bootup).\"\n\"message\": \"Avoids enormous network payloads\"\n},\n\"lighthouse-core/audits/byte-efficiency/total-byte-weight.js | failureTitle\": {\n- \"message\": \"Has enormous network payloads\"\n+ \"message\": \"Avoid enormous network payloads\"\n},\n\"lighthouse-core/audits/byte-efficiency/total-byte-weight.js | description\": {\n\"message\": \"Large network payloads cost users real money and are highly correlated with long load times. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/network-payloads).\"\n\"message\": \"Uses efficient cache policy on static assets\"\n},\n\"lighthouse-core/audits/byte-efficiency/uses-long-cache-ttl.js | failureTitle\": {\n- \"message\": \"Uses inefficient cache policy on static assets\"\n+ \"message\": \"Serve static assets with an efficient cache policy\"\n},\n\"lighthouse-core/audits/byte-efficiency/uses-long-cache-ttl.js | description\": {\n\"message\": \"A long cache lifetime can speed up repeat visits to your page. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/cache-policy).\"\n\"message\": \"Image formats like JPEG 2000, JPEG XR, and WebP often provide better compression than PNG or JPEG, which means faster downloads and less data consumption. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/webp).\"\n},\n\"lighthouse-core/audits/critical-request-chains.js | title\": {\n- \"message\": \"Critical Request Chains\"\n+ \"message\": \"Minimize Critical Request Chains\"\n},\n\"lighthouse-core/audits/critical-request-chains.js | description\": {\n\"message\": \"The Critical Request Chains below show you what resources are issued with a high priority. Consider reducing the length of chains, reducing the download size of resources, or deferring the download of unnecessary resources to improve page load. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/critical-request-chains).\"\n\"message\": \"Avoids an excessive DOM size\"\n},\n\"lighthouse-core/audits/dobetterweb/dom-size.js | failureTitle\": {\n- \"message\": \"Uses an excessive DOM size\"\n+ \"message\": \"Avoid an excessive DOM size\"\n},\n\"lighthouse-core/audits/dobetterweb/dom-size.js | description\": {\n\"message\": \"Browser engineers recommend pages contain fewer than ~1,500 DOM nodes. The sweet spot is a tree depth < 32 elements and fewer than 60 children/parent element. A large DOM can increase memory usage, cause longer [style calculations](https://developers.google.com/web/fundamentals/performance/rendering/reduce-the-scope-and-complexity-of-style-calculations), and produce costly [layout reflows](https://developers.google.com/speed/articles/reflow). [Learn more](https://developers.google.com/web/tools/lighthouse/audits/dom-size).\"\n\"message\": \"All text remains visible during webfont loads\"\n},\n\"lighthouse-core/audits/font-display.js | failureTitle\": {\n- \"message\": \"Text is invisible while webfonts are loading\"\n+ \"message\": \"Ensure text remains visible during webfont load\"\n},\n\"lighthouse-core/audits/font-display.js | description\": {\n\"message\": \"Leverage the font-display CSS feature to ensure text is user-visible while webfonts are loading. [Learn more](https://developers.google.com/web/updates/2016/02/font-display).\"\n\"message\": \"Minimizes main thread work\"\n},\n\"lighthouse-core/audits/mainthread-work-breakdown.js | failureTitle\": {\n- \"message\": \"Has significant main thread work\"\n+ \"message\": \"Minimize main thread work\"\n},\n\"lighthouse-core/audits/mainthread-work-breakdown.js | description\": {\n\"message\": \"Consider reducing the time spent parsing, compiling and executing JS. You may find delivering smaller JS payloads helps with this.\"\n\"message\": \"Redirects introduce additional delays before the page can be loaded. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/redirects).\"\n},\n\"lighthouse-core/audits/time-to-first-byte.js | title\": {\n- \"message\": \"Keep server response times low (TTFB)\"\n+ \"message\": \"Server response times are low (TTFB)\"\n+ },\n+ \"lighthouse-core/audits/time-to-first-byte.js | failureTitle\": {\n+ \"message\": \"Reduce server response times (TTFB)\"\n},\n\"lighthouse-core/audits/time-to-first-byte.js | description\": {\n\"message\": \"Time To First Byte identifies the time at which your server sends a response. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/ttfb).\"\n",
"new_path": "lighthouse-core/lib/locales/en-US.json",
"old_path": "lighthouse-core/lib/locales/en-US.json"
},
{
"change_type": "MODIFY",
"diff": "},\n\"time-to-first-byte\": {\n\"id\": \"time-to-first-byte\",\n- \"title\": \"Keep server response times low (TTFB)\",\n+ \"title\": \"Server response times are low (TTFB)\",\n\"description\": \"Time To First Byte identifies the time at which your server sends a response. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/ttfb).\",\n\"score\": 1,\n\"scoreDisplayMode\": \"binary\",\n},\n\"critical-request-chains\": {\n\"id\": \"critical-request-chains\",\n- \"title\": \"Critical Request Chains\",\n+ \"title\": \"Minimize Critical Request Chains\",\n\"description\": \"The Critical Request Chains below show you what resources are issued with a high priority. Consider reducing the length of chains, reducing the download size of resources, or deferring the download of unnecessary resources to improve page load. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/critical-request-chains).\",\n\"score\": null,\n\"scoreDisplayMode\": \"informative\",\n},\n\"uses-long-cache-ttl\": {\n\"id\": \"uses-long-cache-ttl\",\n- \"title\": \"Uses inefficient cache policy on static assets\",\n+ \"title\": \"Serve static assets with an efficient cache policy\",\n\"description\": \"A long cache lifetime can speed up repeat visits to your page. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/cache-policy).\",\n\"score\": 0.58,\n\"scoreDisplayMode\": \"numeric\",\n",
"new_path": "lighthouse-core/test/results/sample_v2.json",
"old_path": "lighthouse-core/test/results/sample_v2.json"
},
{
"change_type": "MODIFY",
"diff": "\"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+ \"update:sample-json\": \"yarn i18n:collect-strings && 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\": \"yarn i18n:checks && bash lighthouse-core/scripts/assert-golden-lhr-unchanged.sh\",\n\"update:crdp-typings\": \"node lighthouse-core/scripts/extract-crdp-mapping.js\",\n\"mixed-content\": \"./lighthouse-cli/index.js --chrome-flags='--headless' --preset=mixed-content\",\n\"minify-latest-run\": \"./lighthouse-core/scripts/lantern/minify-trace.js ./latest-run/defaultPass.trace.json ./latest-run/defaultPass.trace.min.json && ./lighthouse-core/scripts/lantern/minify-devtoolslog.js ./latest-run/defaultPass.devtoolslog.json ./latest-run/defaultPass.devtoolslog.min.json\"\n",
"new_path": "package.json",
"old_path": "package.json"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | core: adjust audit titles for consistency (#5717) | 1 | core | null |
679,913 | 26.07.2018 15:29:30 | -3,600 | eb3f66fbe9274db282b1c4cd3a8d999d4d3d3243 | test(vectors): add tests | [
{
"change_type": "MODIFY",
"diff": "@@ -34,4 +34,9 @@ describe(\"vec2\", () => {\nit(\"subn\", () => opn(v.sub2n, -9, -8));\nit(\"muln\", () => opn(v.mul2n, 10, 20));\nit(\"divn\", () => opn(v.div2n, 0.1, 0.2));\n+\n+ it(\"eqdelta\", () => {\n+ assert(v.eqDelta2([0, 1.001, 0, 1.999, 0], [1, 2], 0.01, 1, 0, 2, 1));\n+ assert(!v.eqDelta2([0, 1.001, 0, 1.989, 0], [1, 2], 0.01, 1, 0, 2, 1));\n+ });\n});\n",
"new_path": "packages/vectors/test/vec2.ts",
"old_path": "packages/vectors/test/vec2.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -34,4 +34,9 @@ describe(\"vec3\", () => {\nit(\"subn\", () => opn(v.sub3n, -9, -8, -7));\nit(\"muln\", () => opn(v.mul3n, 10, 20, 30));\nit(\"divn\", () => opn(v.div3n, 0.1, 0.2, 0.3));\n+\n+ it(\"eqdelta\", () => {\n+ assert(v.eqDelta3([0, 1.001, 0, 1.999, 0, 3.0099], [1, 2, 3], 0.01, 1, 0, 2, 1));\n+ assert(!v.eqDelta3([0, 1.001, 0, 1.999, 0, 3.02], [1, 2, 3], 0.01, 1, 0, 2, 1));\n+ });\n});\n",
"new_path": "packages/vectors/test/vec3.ts",
"old_path": "packages/vectors/test/vec3.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -34,4 +34,9 @@ describe(\"vec4\", () => {\nit(\"subn\", () => opn(v.sub4n, -9, -8, -7, -6));\nit(\"muln\", () => opn(v.mul4n, 10, 20, 30, 40));\nit(\"divn\", () => opn(v.div4n, 0.1, 0.2, 0.3, 0.4));\n+\n+ it(\"eqdelta\", () => {\n+ assert(v.eqDelta4([0, 1.001, 0, 1.999, 0, 3.0099, 0, 3.991], [1, 2, 3, 4], 0.01, 1, 0, 2, 1));\n+ assert(!v.eqDelta4([0, 1.001, 0, 1.999, 0, 3.02, 0, 4], [1, 2, 3, 4], 0.01, 1, 0, 2, 1));\n+ });\n});\n",
"new_path": "packages/vectors/test/vec4.ts",
"old_path": "packages/vectors/test/vec4.ts"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | test(vectors): add tests | 1 | test | vectors |
791,690 | 26.07.2018 16:02:02 | 25,200 | 5633819f7f5ba8ab8ae8af5addca92dae367ffd9 | core(i18n): support descriptions | [
{
"change_type": "MODIFY",
"diff": "'use strict';\nconst ByteEfficiencyAudit = require('./byte-efficiency-audit');\n-// @ts-ignore - TODO: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/25410\nconst esprima = require('esprima');\nconst i18n = require('../../lib/i18n');\n@@ -54,7 +53,8 @@ class UnminifiedJavaScript extends ByteEfficiencyAudit {\nconst contentLength = scriptContent.length;\nlet totalTokenLength = 0;\n- const tokens = esprima.tokenize(scriptContent, {tolerant: true});\n+ /** @type {Array<esprima.Token> & {errors: Error[]}} */\n+ const tokens = (esprima.tokenize(scriptContent, {tolerant: true}));\nif (!tokens.length && tokens.errors && tokens.errors.length) {\nthrow tokens.errors[0];\n}\n",
"new_path": "lighthouse-core/audits/byte-efficiency/unminified-javascript.js",
"old_path": "lighthouse-core/audits/byte-efficiency/unminified-javascript.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -35,14 +35,23 @@ const MESSAGE_INSTANCE_ID_REGEX = /(.* \\| .*) # (\\d+)$/;\nconst UIStrings = {\n+ /** Used to show the duration in milliseconds that something lasted */\nms: '{timeInMs, number, milliseconds}\\xa0ms',\n+ /** Used to show how many bytes the user could reduce their page by if they implemented the suggestions */\ndisplayValueByteSavings: 'Potential savings of {wastedBytes, number, bytes}\\xa0KB',\n+ /** Used to show how many milliseconds the user could reduce page load by if they implemented the suggestions */\ndisplayValueMsSavings: 'Potential savings of {wastedMs, number, milliseconds}\\xa0ms',\n+ /** Label for the URL column in data tables, entries will be the URL of a web resource */\ncolumnURL: 'URL',\n+ /** Label for the size column in data tables, entries will be the size of a web resource in kilobytes */\ncolumnSize: 'Size (KB)',\n+ /** Label for the TTL column in data tables, entries will be the time to live value of the cache header on a web resource */\ncolumnCacheTTL: 'Cache TTL',\n+ /** Label for the wasted bytes column in data tables, entries will be the number of kilobytes the user could reduce their page by if they implemented the suggestions */\ncolumnWastedBytes: 'Potential Savings (KB)',\n+ /** Label for the wasted bytes column in data tables, entries will be the number of milliseconds the user could reduce page load by if they implemented the suggestions */\ncolumnWastedMs: 'Potential Savings (ms)',\n+ /** Label for the time spent column in data tables, entries will be the number of milliseconds the spent during a particular activity */\ncolumnTimeSpent: 'Time Spent',\n};\n",
"new_path": "lighthouse-core/lib/i18n.js",
"old_path": "lighthouse-core/lib/i18n.js"
},
{
"change_type": "MODIFY",
"diff": "const fs = require('fs');\nconst path = require('path');\n+const esprima = require('esprima');\nconst LH_ROOT = path.join(__dirname, '../../../');\n+const UISTRINGS_REGEX = /UIStrings = (.|\\s)*?\\};\\n/gim;\n+\n+/**\n+ * @typedef ICUMessageDefn\n+ * @property {string} message\n+ * @property {string} [description]\n+ */\nconst ignoredPathComponents = [\n'/.git',\n@@ -22,9 +30,25 @@ const ignoredPathComponents = [\n'-renderer.js',\n];\n+const defaultDescriptions = {\n+ failureTitle: 'Shown to users as the title of the audit when it is in a failing state.',\n+};\n+\n+// @ts-ignore - @types/esprima lacks all of these\n+function computeDescription(ast, property, startRange) {\n+ const endRange = property.range[0];\n+ for (const comment of ast.comments || []) {\n+ if (comment.range[0] < startRange) continue;\n+ if (comment.range[0] > endRange) continue;\n+ return comment.value.replace('*', '').trim();\n+ }\n+\n+ return defaultDescriptions[property.key.name];\n+}\n+\n/**\n* @param {string} dir\n- * @param {Record<string, string>} strings\n+ * @param {Record<string, ICUMessageDefn>} strings\n*/\nfunction collectAllStringsInDir(dir, strings = {}) {\nfor (const name of fs.readdirSync(dir)) {\n@@ -37,10 +61,38 @@ function collectAllStringsInDir(dir, strings = {}) {\n} else {\nif (name.endsWith('.js')) {\nconsole.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+ const content = fs.readFileSync(fullPath, 'utf8');\n+ const exportVars = require(fullPath);\n+ const regexMatches = !!UISTRINGS_REGEX.test(content);\n+ const exportsUIStrings = !!exportVars.UIStrings;\n+ if (!regexMatches && !exportsUIStrings) continue;\n+\n+ if (regexMatches && !exportsUIStrings) {\n+ throw new Error('UIStrings defined but not exported');\n+ }\n+\n+ if (exportsUIStrings && !regexMatches) {\n+ throw new Error('UIStrings exported but no definition found');\n+ }\n+\n+ // @ts-ignore regex just matched\n+ const justUIStrings = 'const ' + content.match(UISTRINGS_REGEX)[0];\n+ // just parse the UIStrings substring to avoid ES version issues, save time, etc\n+ // @ts-ignore - esprima's type definition is supremely lacking\n+ const ast = esprima.parse(justUIStrings, {comment: true, range: true});\n+\n+ for (const stmt of ast.body) {\n+ if (stmt.type !== 'VariableDeclaration') continue;\n+ if (stmt.declarations[0].id.name !== 'UIStrings') continue;\n+\n+ let lastPropertyEndIndex = 0;\n+ for (const property of stmt.declarations[0].init.properties) {\n+ const key = property.key.name;\n+ const message = exportVars.UIStrings[key];\n+ const description = computeDescription(ast, property, lastPropertyEndIndex);\n+ strings[`${relativePath} | ${key}`] = {message, description};\n+ lastPropertyEndIndex = property.range[1];\n+ }\n}\n}\n}\n@@ -50,16 +102,17 @@ function collectAllStringsInDir(dir, strings = {}) {\n}\n/**\n- * @param {Record<string, string>} strings\n+ * @param {Record<string, ICUMessageDefn>} strings\n*/\nfunction createPsuedoLocaleStrings(strings) {\nconst psuedoLocalizedStrings = {};\n- for (const [key, string] of Object.entries(strings)) {\n+ for (const [key, defn] of Object.entries(strings)) {\n+ const message = defn.message;\nconst psuedoLocalizedString = [];\nlet braceCount = 0;\nlet useHatForAccentMark = true;\n- for (let i = 0; i < string.length; i++) {\n- const char = string.substr(i, 1);\n+ for (let i = 0; i < message.length; i++) {\n+ const char = message.substr(i, 1);\npsuedoLocalizedString.push(char);\n// Don't touch the characters inside braces\nif (char === '{') {\n@@ -74,7 +127,7 @@ function createPsuedoLocaleStrings(strings) {\n}\n}\n- psuedoLocalizedStrings[key] = psuedoLocalizedString.join('');\n+ psuedoLocalizedStrings[key] = {message: psuedoLocalizedString.join('')};\n}\nreturn psuedoLocalizedStrings;\n@@ -82,13 +135,13 @@ function createPsuedoLocaleStrings(strings) {\n/**\n* @param {LH.Locale} locale\n- * @param {Record<string, string>} strings\n+ * @param {Record<string, ICUMessageDefn>} strings\n*/\nfunction writeStringsToLocaleFormat(locale, strings) {\nconst fullPath = path.join(LH_ROOT, `lighthouse-core/lib/locales/${locale}.json`);\nconst output = {};\n- for (const [key, message] of Object.entries(strings)) {\n- output[key] = {message};\n+ for (const [key, defn] of Object.entries(strings)) {\n+ output[key] = defn;\n}\nfs.writeFileSync(fullPath, JSON.stringify(output, null, 2) + '\\n');\n",
"new_path": "lighthouse-core/scripts/i18n/collect-strings.js",
"old_path": "lighthouse-core/scripts/i18n/collect-strings.js"
},
{
"change_type": "MODIFY",
"diff": "\"build-viewer\": \"cd ./lighthouse-viewer && yarn build\",\n\"clean\": \"rimraf *.report.html *.report.dom.html *.report.json *.screenshots.html *.screenshots.json *.devtoolslog.json *.trace.json || true\",\n\"lint\": \"[ \\\"$CI\\\" = true ] && eslint --quiet -f codeframe . || eslint .\",\n-\n\"smoke\": \"node lighthouse-cli/test/smokehouse/run-smoke.js\",\n-\n\"debug\": \"node --inspect-brk ./lighthouse-cli/index.js\",\n\"start\": \"node ./lighthouse-cli/index.js\",\n\"test\": \"yarn diff:sample-json && yarn lint --quiet && yarn unit && yarn type-check\",\n\"test-extension\": \"cd lighthouse-extension && yarn test\",\n\"test-viewer\": \"cd lighthouse-viewer && yarn pptr-test\",\n\"test-lantern\": \"bash lighthouse-core/scripts/test-lantern.sh\",\n-\n\"unit-core\": \"jest \\\"lighthouse-core/\\\"\",\n\"unit-core:ci\": \"jest --runInBand --coverage --ci \\\"lighthouse-core/\\\"\",\n\"unit-cli\": \"jest --runInBand \\\"lighthouse-cli/\\\"\",\n\"cli-unit\": \"yarn unit-cli\",\n\"viewer-unit\": \"yarn unit-viewer\",\n\"watch\": \"yarn unit-core --watch\",\n-\n\"unit:silentcoverage\": \"nyc --silent yarn unit:ci && nyc report --reporter text-lcov > unit-coverage.lcov\",\n\"coverage\": \"nyc yarn unit:ci && nyc report --reporter html\",\n\"smoke:silentcoverage\": \"nyc --silent yarn smoke && nyc report --reporter text-lcov > smoke-coverage.lcov\",\n\"coverage:smoke\": \"nyc yarn smoke && nyc report --reporter html\",\n\"coveralls\": \"cat unit-coverage.lcov | coveralls\",\n\"codecov\": \"codecov -f unit-coverage.lcov -F unit && codecov -f smoke-coverage.lcov -F smoke\",\n-\n\"devtools\": \"bash lighthouse-core/scripts/roll-to-devtools.sh\",\n\"compile-devtools\": \"bash lighthouse-core/scripts/compile-against-devtools.sh\",\n\"chrome\": \"node lighthouse-core/scripts/manual-chrome-launcher.js\",\n\"@types/chrome\": \"^0.0.60\",\n\"@types/configstore\": \"^2.1.1\",\n\"@types/css-font-loading-module\": \"^0.0.2\",\n+ \"@types/esprima\": \"^4.0.2\",\n\"@types/inquirer\": \"^0.0.35\",\n\"@types/intl-messageformat\": \"^1.3.0\",\n\"@types/jpeg-js\": \"^0.3.0\",\n\"chrome-launcher\": \"^0.10.2\",\n\"configstore\": \"^3.1.1\",\n\"devtools-timeline-model\": \"1.1.6\",\n- \"esprima\": \"^4.0.0\",\n+ \"esprima\": \"^4.0.1\",\n\"http-link-header\": \"^0.8.0\",\n\"inquirer\": \"^3.3.0\",\n\"intl-messageformat\": \"^2.2.0\",\n}\n],\n\"nyc\": {\n- \"reporter\": [\"lcov\", \"text\"],\n+ \"reporter\": [\n+ \"lcov\",\n+ \"text\"\n+ ],\n\"tempDirectory\": \"./coverage\",\n\"exclude\": [\n\"**/third_party/**\",\n",
"new_path": "package.json",
"old_path": "package.json"
},
{
"change_type": "MODIFY",
"diff": "version \"0.0.2\"\nresolved \"https://registry.yarnpkg.com/@types/css-font-loading-module/-/css-font-loading-module-0.0.2.tgz#09f1f1772975777e37851b7b7a4389d97c210add\"\n+\"@types/esprima@^4.0.2\":\n+ version \"4.0.2\"\n+ resolved \"https://registry.yarnpkg.com/@types/esprima/-/esprima-4.0.2.tgz#0303602d0644086d4802635d7abc9ac0eec57207\"\n+ dependencies:\n+ \"@types/estree\" \"*\"\n+\n+\"@types/estree@*\":\n+ version \"0.0.39\"\n+ resolved \"https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f\"\n+\n\"@types/events@*\":\nversion \"1.2.0\"\nresolved \"https://registry.yarnpkg.com/@types/events/-/events-1.2.0.tgz#81a6731ce4df43619e5c8c945383b3e62a89ea86\"\n@@ -1907,6 +1917,10 @@ esprima@^4.0.0:\nversion \"4.0.0\"\nresolved \"https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804\"\n+esprima@^4.0.1:\n+ version \"4.0.1\"\n+ resolved \"https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71\"\n+\nesquery@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa\"\n",
"new_path": "yarn.lock",
"old_path": "yarn.lock"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | core(i18n): support descriptions (#5718) | 1 | core | i18n |
791,723 | 26.07.2018 18:03:36 | 25,200 | 658a5e50a01000768f2506739bb90215902b1239 | core(i18n): add [ICU Syntax] label to relevant message descriptions | [
{
"change_type": "MODIFY",
"diff": "@@ -15,6 +15,7 @@ const UIStrings = {\n'Large network payloads cost users real money and are highly correlated with ' +\n'long load times. [Learn ' +\n'more](https://developers.google.com/web/tools/lighthouse/audits/network-payloads).',\n+ /** [ICU Syntax] Used to summarize the total byte size of the page and all its network requests */\ndisplayValue: 'Total size was {totalBytes, number, bytes}\\xa0KB',\n};\n",
"new_path": "lighthouse-core/audits/byte-efficiency/total-byte-weight.js",
"old_path": "lighthouse-core/audits/byte-efficiency/total-byte-weight.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -13,6 +13,7 @@ const UIStrings = {\nfailureTitle: 'Reduce server response times (TTFB)',\ndescription: 'Time To First Byte identifies the time at which your server sends a response.' +\n' [Learn more](https://developers.google.com/web/tools/lighthouse/audits/ttfb).',\n+ /** [ICU Syntax] Used to summarize the total Time to First Byte duration for the primary HTML response */\ndisplayValue: `Root document took {timeInMs, number, milliseconds}\\xa0ms`,\n};\n",
"new_path": "lighthouse-core/audits/time-to-first-byte.js",
"old_path": "lighthouse-core/audits/time-to-first-byte.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -35,11 +35,11 @@ const MESSAGE_INSTANCE_ID_REGEX = /(.* \\| .*) # (\\d+)$/;\nconst UIStrings = {\n- /** Used to show the duration in milliseconds that something lasted */\n+ /** [ICU Syntax] Used to show the duration in milliseconds that something lasted */\nms: '{timeInMs, number, milliseconds}\\xa0ms',\n- /** Used to show how many bytes the user could reduce their page by if they implemented the suggestions */\n+ /** [ICU Syntax] Used to show how many bytes the user could reduce their page by if they implemented the suggestions */\ndisplayValueByteSavings: 'Potential savings of {wastedBytes, number, bytes}\\xa0KB',\n- /** Used to show how many milliseconds the user could reduce page load by if they implemented the suggestions */\n+ /** [ICU Syntax] Used to show how many milliseconds the user could reduce page load by if they implemented the suggestions */\ndisplayValueMsSavings: 'Potential savings of {wastedMs, number, milliseconds}\\xa0ms',\n/** Label for the URL column in data tables, entries will be the URL of a web resource */\ncolumnURL: 'URL',\n",
"new_path": "lighthouse-core/lib/i18n.js",
"old_path": "lighthouse-core/lib/i18n.js"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | core(i18n): add [ICU Syntax] label to relevant message descriptions (#5736) | 1 | core | i18n |
679,913 | 26.07.2018 18:12:47 | -3,600 | 21b04f06366066680f4e0caafdf1dffa1bbcfd8c | feat(vectors): re-import updated mat44, add orthoNormal3 | [
{
"change_type": "MODIFY",
"diff": "@@ -127,7 +127,7 @@ export const invert23 = (m: Mat, i = 0) => {\nconst m21 = m[i + 5];\nlet det = m00 * m11 - m01 * m10;\nif (!det) {\n- return null;\n+ return;\n}\ndet = 1.0 / det;\nreturn set23s(\n",
"new_path": "packages/vectors/src/mat23.ts",
"old_path": "packages/vectors/src/mat23.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -165,7 +165,7 @@ export const invert33 = (m: Mat, i = 0) => {\nconst d21 = m21 * m10 - m11 * m20;\nlet det = m00 * d01 + m01 * d11 + m02 * d21;\nif (!det) {\n- return null;\n+ return;\n}\ndet = 1.0 / det;\nreturn set33s(\n",
"new_path": "packages/vectors/src/mat33.ts",
"old_path": "packages/vectors/src/mat33.ts"
},
{
"change_type": "MODIFY",
"diff": "import { isArrayLike } from \"@thi.ng/checks/is-arraylike\";\nimport { Mat, ReadonlyMat, Vec } from \"./api\";\n+import { rad } from \"./math\";\n+import {\n+ cross3,\n+ dot3,\n+ get3,\n+ normalize3,\n+ sub3\n+} from \"./vec3\";\nimport { dot4, set4s } from \"./vec4\";\nexport const set44 = (a: Mat, b: Mat, ia = 0, ib = 0) => (\n@@ -126,6 +134,66 @@ export const translation44s = (m: Mat, x: number, y: number, z: number, i = 0) =\ni\n);\n+export const frustum = (m: Mat, left: number, right: number, bottom: number, top: number, near: number, far: number, i = 0) => {\n+ const dx = 1 / (right - left);\n+ const dy = 1 / (top - bottom);\n+ const dz = 1 / (far - near);\n+ return set44s(m || [],\n+ near * 2 * dx, 0, 0, 0,\n+ 0, near * 2 * dy, 0, 0,\n+ (right + left) * dx, (top + bottom) * dy, -(far + near) * dz, -1,\n+ 0, 0, -(far * near * 2) * dz, 0,\n+ i\n+ );\n+};\n+\n+export const frustumBounds = (fovy: number, aspect: number, near: number, far: number) => {\n+ const top = near * Math.tan(rad(fovy) / 2);\n+ const right = top * aspect;\n+ return {\n+ left: -right,\n+ right,\n+ bottom: -top,\n+ top,\n+ near,\n+ far\n+ };\n+};\n+\n+export const perspective = (m: Mat, fov: number, aspect: number, near: number, far: number, i = 0) => {\n+ const f = frustumBounds(fov, aspect, near, far);\n+ return frustum(m || [], f.left, f.right, f.bottom, f.top, f.near, f.far, i);\n+};\n+\n+export const ortho = (m: Mat, left: number, right: number, bottom: number, top: number, near: number, far: number, i = 0) => {\n+ const dx = 1 / (right - left);\n+ const dy = 1 / (top - bottom);\n+ const dz = 1 / (far - near);\n+ return set44s(m || [],\n+ 2 * dx, 0, 0, 0,\n+ 0, 2 * dy, 0, 0,\n+ 0, 0, -2 * dz, 0,\n+ -(left + right) * dx, -(top + bottom) * dy, -(far + near) * dz, 1,\n+ i\n+ );\n+};\n+\n+export const lookAt = (m: Mat, eye: Vec, target: Vec, up: Vec, im = 0, ie = 0, it = 0, iu = 0, se = 1, st = 1, su = 1) => {\n+ eye = get3(eye, ie, se);\n+ target = get3(target, it, st);\n+ up = get3(up, iu, su);\n+ const z = normalize3(sub3([...eye], target));\n+ const x = normalize3(cross3(up, z));\n+ const y = normalize3(cross3([...z], x));\n+ return set44s(m || [],\n+ x[0], y[0], z[0], 0,\n+ x[1], y[1], z[1], 0,\n+ x[2], y[2], z[2], 0,\n+ -dot3(eye, x), -dot3(eye, y), -dot3(eye, z), 1,\n+ im\n+ );\n+}\n+\nexport const mul44 = (a: Mat, b: ReadonlyMat, ia = 0, ib = 0) =>\nset44s(\na,\n@@ -237,7 +305,7 @@ export const invert44 = (m: Mat, i = 0) => {\nconst d11 = d[11];\nlet det = (d00 * d11 - d01 * d10 + d02 * d09 + d03 * d08 - d04 * d07 + d05 * d06);\nif (!det) {\n- return null;\n+ return;\n}\ndet = 1.0 / det;\nreturn set44s(\n@@ -271,3 +339,33 @@ export const transpose44 = (m: Mat, i = 0) =>\nm[i + 3], m[i + 7], m[i + 11], m[i + 15],\ni\n);\n+\n+export const normal44 = (a: Mat, b: Mat, ia = 0, ib = 0) => {\n+ const m00 = b[ib];\n+ const m01 = b[ib + 1];\n+ const m02 = b[ib + 2];\n+ const m10 = b[ib + 4];\n+ const m11 = b[ib + 5];\n+ const m12 = b[ib + 6];\n+ const m20 = b[ib + 8];\n+ const m21 = b[ib + 9];\n+ const m22 = b[ib + 10];\n+ const d01 = m22 * m11 - m12 * m21;\n+ const d11 = -m22 * m10 + m12 * m20;\n+ const d21 = m21 * m10 - m11 * m20;\n+ let det = m00 * d01 + m01 * d11 + m02 * d21;\n+ if (!det) {\n+ return;\n+ }\n+ det = 1.0 / det;\n+ a[ia] = d01 * det;\n+ a[ia + 1] = d11 * det;\n+ a[ia + 2] = d21 * det;\n+ a[ia + 3] = (-m22 * m01 + m02 * m21) * det;\n+ a[ia + 4] = (m22 * m00 - m02 * m20) * det;\n+ a[ia + 5] = (-m21 * m00 + m01 * m20) * det;\n+ a[ia + 6] = (m12 * m01 - m02 * m11) * det;\n+ a[ia + 7] = (-m12 * m00 + m02 * m10) * det;\n+ a[ia + 8] = (m11 * m00 - m01 * m10) * det;\n+ return a;\n+};\n\\ No newline at end of file\n",
"new_path": "packages/vectors/src/mat44.ts",
"old_path": "packages/vectors/src/mat44.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -155,6 +155,12 @@ export const cross3 = (a: Vec, b: ReadonlyVec, ia = 0, ib = 0, sa = 1, sb = 1) =\nreturn a;\n};\n+export const orthoNormal3 = (a: Vec, b: Vec, c: Vec, ia = 0, ib = 0, ic = 0, sa = 1, sb = 1, sc = 1) =>\n+ cross3(\n+ sub3(get3(c, ic, sc), a, 0, ia, 1, sa),\n+ sub3(get3(b, ib, sb), a, 0, ia, 1, sa)\n+ );\n+\nexport const mix3 = (a: Vec, b: ReadonlyVec, t: ReadonlyVec, ia = 0, ib = 0, it = 0, sa = 1, sb = 1, st = 1) => (\na[ia] += (b[ib] - a[ia]) * t[it],\na[ia + sa] += (b[ib + sb] - a[ia + sa]) * t[it + st],\n@@ -311,6 +317,10 @@ export class Vec3 implements\nreturn res;\n}\n+ static orthoNormal3(a: Readonly<Vec3>, b: Readonly<Vec3>, c: Readonly<Vec3>) {\n+ return new Vec3(orthoNormal3(a.buf, b.buf, c.buf, a.index, b.index, c.index, a.stride, b.stride, c.stride));\n+ }\n+\nstatic ZERO = Object.freeze(new Vec3(<number[]>ZERO3));\nstatic ONE = Object.freeze(new Vec3(<number[]>ONE3));\n@@ -529,6 +539,10 @@ export class Vec3 implements\nreturn this;\n}\n+ orthoNormal(v: Readonly<Vec3>) {\n+ return this.cross(v).normalize();\n+ }\n+\nmag() {\nreturn mag3(this.buf, this.index, this.stride);\n}\n",
"new_path": "packages/vectors/src/vec3.ts",
"old_path": "packages/vectors/src/vec3.ts"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | feat(vectors): re-import updated mat44, add orthoNormal3 | 1 | feat | vectors |
807,849 | 26.07.2018 18:25:25 | 25,200 | ef1210e8fa7a497d7a47869dd4d1878c1f7c553f | docs(bootstrap): Make link to hoist docs absolute | [
{
"change_type": "MODIFY",
"diff": "@@ -49,7 +49,7 @@ the default is `**` (hoist everything). This option only affects the\n$ lerna bootstrap --hoist\n```\n-For background on `--hoist`, see the [hoist documentation](../../doc/hoist.md).\n+For background on `--hoist`, see the [hoist documentation](https://github.com/lerna/lerna/blob/master/doc/hoist.md).\nNote: If packages depend on different _versions_ of an external dependency,\nthe most commonly used version will be hoisted, and a warning will be emitted.\n",
"new_path": "commands/bootstrap/README.md",
"old_path": "commands/bootstrap/README.md"
}
] | JavaScript | MIT License | lerna/lerna | docs(bootstrap): Make link to hoist docs absolute | 1 | docs | bootstrap |
679,913 | 26.07.2018 18:44:12 | -3,600 | 29500b6db41063c4cdf1166d8de115ce78bffea6 | build: add babel-minify dev dependency | [
{
"change_type": "MODIFY",
"diff": "\"packages/*\"\n],\n\"devDependencies\": {\n+ \"babel-minify\": \"^0.4.3\",\n\"benchmark\": \"^2.1.4\",\n\"lerna\": \"^2.11.0\",\n\"mocha\": \"^5.1.1\",\n",
"new_path": "package.json",
"old_path": "package.json"
},
{
"change_type": "MODIFY",
"diff": "Binary files a/yarn.lock and b/yarn.lock differ\n",
"new_path": "yarn.lock",
"old_path": "yarn.lock"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | build: add babel-minify dev dependency | 1 | build | null |
217,927 | 26.07.2018 22:49:39 | 0 | 7a2160a91cc216485677390bfb6fb30eacd314f2 | refactor: list and workshop button order
Moves the open button to the far left and the security & delete
buttons to the far right. This should better order the buttons from
most to least used. Also colors the delete button red, since it is
destructive. | [
{
"change_type": "MODIFY",
"diff": "</mat-panel-description>\n</div>\n<div class=\"buttons\" *ngIf=\"!isMobile()\">\n+ <button mat-icon-button *ngIf=\"buttons\" routerLink=\"/list/{{list.$key}}\"\n+ matTooltip=\"{{'LIST.BUTTONS.Open' | translate}}\" matTooltipPosition=\"above\"\n+ (click)=\"$event.stopPropagation()\">\n+ <mat-icon>playlist_play</mat-icon>\n+ </button>\n<app-comments-button *ngIf=\"list.public\" [name]=\"list.name\" [list]=\"list\"\n[isOwnList]=\"list.authorId === authorUid\"\ncolor=\"null\" (click)=\"$event.stopPropagation()\">\n(cbOnSuccess)=\"showTemplateCopiedNotification()\">\n<mat-icon>content_paste</mat-icon>\n</button>\n- <span *ngIf=\"list.authorId === userUid && !list.isCommissionList\"\n- [matTooltipDisabled]=\"!anonymous\"\n- [matTooltip]=\"'PERMISSIONS.No_anonymous' | translate\"\n- matTooltipPosition=\"above\">\n- <button mat-icon-button\n- (click)=\"$event.stopPropagation();openPermissions(list)\"\n- [disabled]=\"anonymous\"\n- [matTooltip]=\"'PERMISSIONS.Title' | translate\"\n- matTooltipPosition=\"above\">\n- <mat-icon>security</mat-icon>\n- </button>\n- </span>\n<button mat-icon-button *ngIf=\"buttons\" ngxClipboard [cbContent]=\"getLink()\"\n(click)=\"$event.stopPropagation()\"\nmatTooltip=\"{{'Share' | translate}}\" matTooltipPosition=\"above\"\n*ngIf=\"list.authorId === userUid && !list.isCommissionList\">\n<mat-icon>label_outline</mat-icon>\n</button>\n-\n- <button mat-icon-button *ngIf=\"buttons\" routerLink=\"/list/{{list.$key}}\"\n- matTooltip=\"{{'LIST.BUTTONS.Open' | translate}}\" matTooltipPosition=\"above\"\n- (click)=\"$event.stopPropagation()\">\n- <mat-icon>playlist_play</mat-icon>\n+ <span *ngIf=\"list.authorId === userUid && !list.isCommissionList\"\n+ [matTooltipDisabled]=\"!anonymous\"\n+ [matTooltip]=\"'PERMISSIONS.No_anonymous' | translate\"\n+ matTooltipPosition=\"above\">\n+ <button mat-icon-button\n+ (click)=\"$event.stopPropagation();openPermissions(list)\"\n+ [disabled]=\"anonymous\"\n+ [matTooltip]=\"'PERMISSIONS.Title' | translate\"\n+ matTooltipPosition=\"above\">\n+ <mat-icon>security</mat-icon>\n</button>\n+ </span>\n+\n<button mat-icon-button *ngIf=\"!readonly && buttons && list.authorId === userUid\"\nmatTooltip=\"{{'LIST.BUTTONS.Delete' | translate}}\" matTooltipPosition=\"above\"\n(click)=\"ondelete.emit(); $event.stopPropagation()\">\n- <mat-icon>delete</mat-icon>\n+ <mat-icon color=\"warn\">delete</mat-icon>\n</button>\n<button mat-icon-button *ngIf=\"copyButton\" (click)=\"$event.stopPropagation();forkList()\"\n[matTooltip]=\"'LIST.Copied_x_times' | translate:{'count': list.forks}\"\n[isOwnList]=\"list.authorId === authorUid\"\ncolor=\"null\" (click)=\"$event.stopPropagation()\">\n</app-comments-button>\n+ <button mat-icon-button *ngIf=\"buttons\" routerLink=\"/list/{{list.$key}}\"\n+ matTooltip=\"{{'LIST.BUTTONS.Open' | translate}}\" matTooltipPosition=\"above\"\n+ (click)=\"$event.stopPropagation()\">\n+ <mat-icon>playlist_play</mat-icon>\n+ </button>\n<button mat-icon-button *ngIf=\"buttons && linkButton\"\nmatTooltip=\"{{'CUSTOM_LINKS.Add_link' | translate}}\" matTooltipPosition=\"above\"\n(click)=\"$event.stopPropagation(); openLinkPopup(list)\">\n(cbOnSuccess)=\"showTemplateCopiedNotification()\">\n<mat-icon>content_paste</mat-icon>\n</button>\n- <span *ngIf=\"list.authorId === userUid\"\n- [matTooltipDisabled]=\"!anonymous\"\n- [matTooltip]=\"'PERMISSIONS.No_anonymous' | translate\"\n- matTooltipPosition=\"above\">\n- <button mat-icon-button\n- (click)=\"$event.stopPropagation();openPermissions(list)\"\n- [disabled]=\"anonymous\"\n- [matTooltip]=\"'PERMISSIONS.Title' | translate\"\n- matTooltipPosition=\"above\">\n- <mat-icon>security</mat-icon>\n- </button>\n- </span>\n<button mat-icon-button *ngIf=\"buttons\" ngxClipboard [cbContent]=\"getLink()\"\n(click)=\"$event.stopPropagation()\"\nmatTooltip=\"{{'Share' | translate}}\" matTooltipPosition=\"above\"\n(click)=\"openTagsPopup()\" *ngIf=\"list.authorId === userUid\">\n<mat-icon>label_outline</mat-icon>\n</button>\n-\n- <button mat-icon-button *ngIf=\"buttons\" routerLink=\"/list/{{list.$key}}\"\n- matTooltip=\"{{'LIST.BUTTONS.Open' | translate}}\" matTooltipPosition=\"above\"\n- (click)=\"$event.stopPropagation()\">\n- <mat-icon>playlist_play</mat-icon>\n+ <span *ngIf=\"list.authorId === userUid\"\n+ [matTooltipDisabled]=\"!anonymous\"\n+ [matTooltip]=\"'PERMISSIONS.No_anonymous' | translate\"\n+ matTooltipPosition=\"above\">\n+ <button mat-icon-button\n+ (click)=\"$event.stopPropagation();openPermissions(list)\"\n+ [disabled]=\"anonymous\"\n+ [matTooltip]=\"'PERMISSIONS.Title' | translate\"\n+ matTooltipPosition=\"above\">\n+ <mat-icon>security</mat-icon>\n</button>\n+ </span>\n<button mat-icon-button *ngIf=\"!readonly && buttons && list.authorId === userUid\"\nmatTooltip=\"{{'LIST.BUTTONS.Delete' | translate}}\" matTooltipPosition=\"above\"\n(click)=\"ondelete.emit(); $event.stopPropagation()\">\n- <mat-icon>delete</mat-icon>\n+ <mat-icon color=\"warn\">delete</mat-icon>\n</button>\n<button mat-icon-button *ngIf=\"copyButton\" (click)=\"$event.stopPropagation();forkList()\"\n[matTooltip]=\"'LIST.Copied_x_times' | translate:{'count': list.forks}\"\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": "</button>\n</mat-panel-title>\n<div class=\"buttons\">\n+ <button mat-icon-button routerLink=\"/workshop/{{workshop.$key}}\"\n+ (click)=\"$event.stopPropagation()\">\n+ <mat-icon>playlist_play</mat-icon>\n+ </button>\n<button mat-icon-button *ngIf=\"userData?.patron || userData?.admin\"\nmatTooltip=\"{{'CUSTOM_LINKS.Add_link' | translate}}\" matTooltipPosition=\"above\"\n(click)=\"$event.stopPropagation(); openLinkPopup(workshop)\">\n<mat-icon>link</mat-icon>\n</button>\n+ <button mat-icon-button ngxClipboard [cbContent]=\"getLink(workshop)\"\n+ (click)=\"$event.stopPropagation()\"\n+ matTooltip=\"{{'Share' | translate}}\" matTooltipPosition=\"above\"\n+ (cbOnSuccess)=\"showCopiedNotification()\">\n+ <mat-icon>share</mat-icon>\n+ </button>\n<span *ngIf=\"workshop.authorId === userData.$key\"\n[matTooltipDisabled]=\"!anonymous\"\n[matTooltip]=\"'PERMISSIONS.No_anonymous' | translate\"\n<mat-icon>security</mat-icon>\n</button>\n</span>\n- <button mat-icon-button ngxClipboard [cbContent]=\"getLink(workshop)\"\n- (click)=\"$event.stopPropagation()\"\n- matTooltip=\"{{'Share' | translate}}\" matTooltipPosition=\"above\"\n- (cbOnSuccess)=\"showCopiedNotification()\">\n- <mat-icon>share</mat-icon>\n- </button>\n- <button mat-icon-button routerLink=\"/workshop/{{workshop.$key}}\"\n- (click)=\"$event.stopPropagation()\">\n- <mat-icon>playlist_play</mat-icon>\n- </button>\n<button mat-icon-button\n(click)=\"deleteWorkshop(workshop); $event.stopPropagation()\">\n- <mat-icon>delete</mat-icon>\n+ <mat-icon color=\"warn\">delete</mat-icon>\n</button>\n</div>\n</mat-expansion-panel-header>\n</button>\n</mat-panel-title>\n<div class=\"buttons\">\n+ <button mat-icon-button routerLink=\"/workshop/{{workshopData.workshop.$key}}\"\n+ (click)=\"$event.stopPropagation()\">\n+ <mat-icon>playlist_play</mat-icon>\n+ </button>\n<button mat-icon-button *ngIf=\"userData?.patron || userData?.admin\"\nmatTooltip=\"{{'CUSTOM_LINKS.Add_link' | translate}}\" matTooltipPosition=\"above\"\n(click)=\"$event.stopPropagation(); openLinkPopup(workshopData.workshop)\">\n<mat-icon>link</mat-icon>\n</button>\n+ <button mat-icon-button ngxClipboard [cbContent]=\"getLink(workshopData.workshop)\"\n+ (click)=\"$event.stopPropagation()\"\n+ matTooltip=\"{{'Share' | translate}}\" matTooltipPosition=\"above\"\n+ (cbOnSuccess)=\"showCopiedNotification()\">\n+ <mat-icon>share</mat-icon>\n+ </button>\n<span *ngIf=\"workshopData.workshop.authorId === userData.$key\"\n[matTooltipDisabled]=\"!anonymous\"\n[matTooltip]=\"'PERMISSIONS.No_anonymous' | translate\"\n<mat-icon>security</mat-icon>\n</button>\n</span>\n- <button mat-icon-button ngxClipboard [cbContent]=\"getLink(workshopData.workshop)\"\n- (click)=\"$event.stopPropagation()\"\n- matTooltip=\"{{'Share' | translate}}\" matTooltipPosition=\"above\"\n- (cbOnSuccess)=\"showCopiedNotification()\">\n- <mat-icon>share</mat-icon>\n- </button>\n- <button mat-icon-button routerLink=\"/workshop/{{workshopData.workshop.$key}}\"\n- (click)=\"$event.stopPropagation()\">\n- <mat-icon>playlist_play</mat-icon>\n- </button>\n</div>\n</mat-expansion-panel-header>\n<div class=\"row workshop-row\"\n",
"new_path": "src/app/pages/lists/lists/lists.component.html",
"old_path": "src/app/pages/lists/lists/lists.component.html"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | refactor: list and workshop button order
Moves the open button to the far left and the security & delete
buttons to the far right. This should better order the buttons from
most to least used. Also colors the delete button red, since it is
destructive. | 1 | refactor | null |
791,723 | 27.07.2018 10:58:56 | 25,200 | 56b7fbf9a87f85d5520d2238cb13a42f52b52743 | core(i18n): reframe the ICU message descriptions with placeholders | [
{
"change_type": "MODIFY",
"diff": "@@ -15,7 +15,7 @@ const UIStrings = {\n'Large network payloads cost users real money and are highly correlated with ' +\n'long load times. [Learn ' +\n'more](https://developers.google.com/web/tools/lighthouse/audits/network-payloads).',\n- /** [ICU Syntax] Used to summarize the total byte size of the page and all its network requests */\n+ /** Used to summarize the total byte size of the page and all its network requests. The `{totalBytes}` placeholder will be replaced with the total byte sizes, shown in kilobytes (e.g. 142 KB) */\ndisplayValue: 'Total size was {totalBytes, number, bytes}\\xa0KB',\n};\n",
"new_path": "lighthouse-core/audits/byte-efficiency/total-byte-weight.js",
"old_path": "lighthouse-core/audits/byte-efficiency/total-byte-weight.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -13,7 +13,7 @@ const UIStrings = {\nfailureTitle: 'Reduce server response times (TTFB)',\ndescription: 'Time To First Byte identifies the time at which your server sends a response.' +\n' [Learn more](https://developers.google.com/web/tools/lighthouse/audits/ttfb).',\n- /** [ICU Syntax] Used to summarize the total Time to First Byte duration for the primary HTML response */\n+ /** Used to summarize the total Time to First Byte duration for the primary HTML response. The `{timeInMs}` placeholder will be replaced with the time duration, shown in milliseconds (e.g. 210 ms) */\ndisplayValue: `Root document took {timeInMs, number, milliseconds}\\xa0ms`,\n};\n",
"new_path": "lighthouse-core/audits/time-to-first-byte.js",
"old_path": "lighthouse-core/audits/time-to-first-byte.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -35,11 +35,11 @@ const MESSAGE_INSTANCE_ID_REGEX = /(.* \\| .*) # (\\d+)$/;\nconst UIStrings = {\n- /** [ICU Syntax] Used to show the duration in milliseconds that something lasted */\n+ /** Used to show the duration in milliseconds that something lasted. The `{timeInMs}` placeholder will be replaced with the time duration, shown in milliseconds (e.g. 63 ms) */\nms: '{timeInMs, number, milliseconds}\\xa0ms',\n- /** [ICU Syntax] Used to show how many bytes the user could reduce their page by if they implemented the suggestions */\n+ /** Used to show how many bytes the user could reduce their page by if they implemented the suggestions. The `{wastedBytes}` placeholder will be replaced with the number of bytes, shown in kilobytes (e.g. 148 KB) */\ndisplayValueByteSavings: 'Potential savings of {wastedBytes, number, bytes}\\xa0KB',\n- /** [ICU Syntax] Used to show how many milliseconds the user could reduce page load by if they implemented the suggestions */\n+ /** Used to show how many milliseconds the user could reduce page load by if they implemented the suggestions. The `{wastedMs}` placeholder will be replaced with the time duration, shown in milliseconds (e.g. 140 ms) */\ndisplayValueMsSavings: 'Potential savings of {wastedMs, number, milliseconds}\\xa0ms',\n/** Label for the URL column in data tables, entries will be the URL of a web resource */\ncolumnURL: 'URL',\n",
"new_path": "lighthouse-core/lib/i18n.js",
"old_path": "lighthouse-core/lib/i18n.js"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | core(i18n): reframe the ICU message descriptions with placeholders (#5737) | 1 | core | i18n |
791,723 | 27.07.2018 17:15:37 | 25,200 | 65b2a1eff5182b5f2f0ed4e511b8aab3ca43533f | core(i18n): add strings of the opportunity group split (first paint, overall) | [
{
"change_type": "MODIFY",
"diff": "@@ -19,6 +19,14 @@ const UIStrings = {\nloadOpportunitiesGroupTitle: 'Opportunities',\n/** Description of the opportunity section of the Performance category. 'Optimizations' could also be 'recommendations' or 'suggestions'. Within this section are audits with imperative titles that suggest actions the user can take to improve the loading performance of their web page. */\nloadOpportunitiesGroupDescription: 'These optimizations can speed up your page load.',\n+ /** Title of an opportunity sub-section of the Performance category. Within this section are audits with imperative titles that suggest actions the user can take to improve the time of the first initial render of the webpage. */\n+ firstPaintImprovementsGroupTitle: 'First Paint Improvements',\n+ /** Description of an opportunity sub-section of the Performance category. Within this section are audits with imperative titles that suggest actions the user can take to improve the time of the first initial render of the webpage. */\n+ firstPaintImprovementsGroupDescription: 'The most critical aspect of performance is how quickly pixels are rendered onscreen. Key metrics: First Contentful Paint, First Meaningful Paint',\n+ /** Title of an opportunity sub-section of the Performance category. Within this section are audits with imperative titles that suggest actions the user can take to improve the overall loading performance of their web page. */\n+ overallImprovementsGroupTitle: 'Overall Improvements',\n+ /** Description of an opportunity sub-section of the Performance category. Within this section are audits with imperative titles that suggest actions the user can take to improve the overall loading performance of their web page. */\n+ overallImprovementsGroupDescription: 'Enhance the overall loading experience, so the page is responsive and ready to use as soon as possible. Key metrics: Time to Interactive, Speed Index',\n/** Title of the diagnostics section of the Performance category. Within this section are audits with non-imperative titles that provide more detail on the page's page load performance characteristics. Whereas the 'Opportunities' suggest an action along with expected time savings, diagnostics do not. Within this section, the user may read the details and deduce additional actions they could take. */\ndiagnosticsGroupTitle: 'Diagnostics',\n/** Description of the diagnostics section of the Performance category. Within this section are audits with non-imperative titles that provide more detail on the page's page load performance characteristics. Whereas the 'Opportunities' suggest an action along with expected time savings, diagnostics do not. Within this section, the user may read the details and deduce additional actions they could take. */\n",
"new_path": "lighthouse-core/config/default-config.js",
"old_path": "lighthouse-core/config/default-config.js"
},
{
"change_type": "MODIFY",
"diff": "\"message\": \"These optimizations can speed up your page load.\",\n\"description\": \"Description of the opportunity section of the Performance category. 'Optimizations' could also be 'recommendations' or 'suggestions'. Within this section are audits with imperative titles that suggest actions the user can take to improve the loading performance of their web page.\"\n},\n+ \"lighthouse-core/config/default-config.js | firstPaintImprovementsGroupTitle\": {\n+ \"message\": \"First Paint Improvements\",\n+ \"description\": \"Title of an opportunity sub-section of the Performance category. Within this section are audits with imperative titles that suggest actions the user can take to improve the time of the first initial render of the webpage.\"\n+ },\n+ \"lighthouse-core/config/default-config.js | firstPaintImprovementsGroupDescription\": {\n+ \"message\": \"The most critical aspect of performance is how quickly pixels are rendered onscreen. Key metrics: First Contentful Paint, First Meaningful Paint\",\n+ \"description\": \"Description of an opportunity sub-section of the Performance category. Within this section are audits with imperative titles that suggest actions the user can take to improve the time of the first initial render of the webpage.\"\n+ },\n+ \"lighthouse-core/config/default-config.js | overallImprovementsGroupTitle\": {\n+ \"message\": \"Overall Improvements\",\n+ \"description\": \"Title of an opportunity sub-section of the Performance category. Within this section are audits with imperative titles that suggest actions the user can take to improve the overall loading performance of their web page.\"\n+ },\n+ \"lighthouse-core/config/default-config.js | overallImprovementsGroupDescription\": {\n+ \"message\": \"Enhance the overall loading experience, so the page is responsive and ready to use as soon as possible. Key metrics: Time to Interactive, Speed Index\",\n+ \"description\": \"Description of an opportunity sub-section of the Performance category. Within this section are audits with imperative titles that suggest actions the user can take to improve the overall loading performance of their web page.\"\n+ },\n\"lighthouse-core/config/default-config.js | diagnosticsGroupTitle\": {\n\"message\": \"Diagnostics\",\n\"description\": \"Title of the diagnostics section of the Performance category. Within this section are audits with non-imperative titles that provide more detail on the page's page load performance characteristics. Whereas the 'Opportunities' suggest an action along with expected time savings, diagnostics do not. Within this section, the user may read the details and deduce additional actions they could take.\"\n",
"new_path": "lighthouse-core/lib/locales/en-US.json",
"old_path": "lighthouse-core/lib/locales/en-US.json"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | core(i18n): add strings of the opportunity group split (first paint, overall) (#5744) | 1 | core | i18n |
807,849 | 27.07.2018 18:54:44 | 25,200 | 8f4798a5f0d1f4280b31ca51976d48207563a147 | chore(run): Restore local file: specifier dependency | [
{
"change_type": "MODIFY",
"diff": "\"@lerna/npm-run-script\": \"file:../../utils/npm-run-script\",\n\"@lerna/output\": \"file:../../utils/output\",\n\"@lerna/run-parallel-batches\": \"file:../../utils/run-parallel-batches\",\n- \"@lerna/validation-error\": \"^3.0.0-rc.0\",\n+ \"@lerna/validation-error\": \"file:../../core/validation-error\",\n\"p-map\": \"^1.2.0\"\n}\n}\n",
"new_path": "commands/run/package.json",
"old_path": "commands/run/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"@lerna/npm-run-script\": \"file:utils/npm-run-script\",\n\"@lerna/output\": \"file:utils/output\",\n\"@lerna/run-parallel-batches\": \"file:utils/run-parallel-batches\",\n- \"@lerna/validation-error\": \"^3.0.0-beta.10\",\n+ \"@lerna/validation-error\": \"file:core/validation-error\",\n\"p-map\": \"^1.2.0\"\n}\n},\n",
"new_path": "package-lock.json",
"old_path": "package-lock.json"
}
] | JavaScript | MIT License | lerna/lerna | chore(run): Restore local file: specifier dependency | 1 | chore | run |
807,849 | 27.07.2018 19:02:44 | 25,200 | f1cb15e38951f12c10498c19df7697f696008e00 | chore(helpers): Extract serialize-tempdir | [
{
"change_type": "MODIFY",
"diff": "\"use strict\";\n-const fs = require(\"fs\");\n-const os = require(\"os\");\n-const path = require(\"path\");\n-const normalizePath = require(\"normalize-path\");\n-\n// mocked modules\nconst output = require(\"@lerna/output\");\n@@ -17,15 +12,8 @@ const lernaLs = require(\"@lerna-test/command-runner\")(require(\"../command\"));\n// remove quotes around strings\nexpect.addSnapshotSerializer({ test: val => typeof val === \"string\", print: val => val });\n-// TODO: extract root dir serializer?\n-const TEMP_DIR = fs.realpathSync(os.tmpdir());\n-const ROOT_DIR = new RegExp(path.join(TEMP_DIR, \"[0-9a-f]+\"), \"g\");\n-\n// normalize temp directory paths in snapshots\n-expect.addSnapshotSerializer({\n- test: val => typeof val === \"string\" && ROOT_DIR.test(val),\n- print: val => normalizePath(val.replace(ROOT_DIR, \"<PROJECT_ROOT>\")),\n-});\n+expect.addSnapshotSerializer(require(\"@lerna-test/serialize-tempdir\"));\ndescribe(\"lerna ls\", () => {\ndescribe(\"in a basic repo\", () => {\n",
"new_path": "commands/list/__tests__/list-command.test.js",
"old_path": "commands/list/__tests__/list-command.test.js"
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+const fs = require(\"fs\");\n+const os = require(\"os\");\n+const path = require(\"path\");\n+const normalizePath = require(\"normalize-path\");\n+\n+const TEMP_DIR = fs.realpathSync(os.tmpdir());\n+const ROOT_DIR = new RegExp(path.join(TEMP_DIR, \"[0-9a-f]+\"), \"g\");\n+\n+// expect.addSnapshotSerializer(require(\"@lerna-test/serialize-tempdir\"));\n+module.exports = {\n+ test(val) {\n+ return typeof val === \"string\" && ROOT_DIR.test(val);\n+ },\n+ print(val) {\n+ return normalizePath(val.replace(ROOT_DIR, \"<PROJECT_ROOT>\"));\n+ },\n+};\n",
"new_path": "helpers/serialize-tempdir/index.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"@lerna-test/serialize-tempdir\",\n+ \"version\": \"0.0.0-test-only\",\n+ \"description\": \"A local test helper\",\n+ \"main\": \"index.js\",\n+ \"private\": true,\n+ \"license\": \"MIT\",\n+ \"dependencies\": {\n+ \"normalize-path\": \"^2.1.1\"\n+ }\n+}\n",
"new_path": "helpers/serialize-tempdir/package.json",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -4,8 +4,8 @@ const cliRunner = require(\"@lerna-test/cli-runner\");\nconst initFixture = require(\"@lerna-test/init-fixture\")(__dirname);\nconst normalizeNewline = require(\"normalize-newline\");\n-// remove quotes around strings\n-expect.addSnapshotSerializer({ test: val => typeof val === \"string\", print: val => val });\n+// normalize temp directory paths in snapshots\n+expect.addSnapshotSerializer(require(\"@lerna-test/serialize-tempdir\"));\n// ls never makes changes to repo, so we only need one fixture + runner\nlet lerna;\n@@ -20,7 +20,7 @@ beforeAll(async () => {\nrun(...args).then(result =>\nnormalizeNewline(result.stdout)\n.split(\"\\n\")\n- .map(line => line.trimRight().replace(cwd, \"<PROJECT_ROOT>\"))\n+ .map(line => line.trimRight())\n.join(\"\\n\")\n);\n});\n",
"new_path": "integration/lerna-ls.test.js",
"old_path": "integration/lerna-ls.test.js"
},
{
"change_type": "MODIFY",
"diff": "\"normalize-newline\": \"^3.0.0\"\n}\n},\n+ \"@lerna-test/serialize-tempdir\": {\n+ \"version\": \"file:helpers/serialize-tempdir\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"normalize-path\": \"^2.1.1\"\n+ }\n+ },\n\"@lerna-test/set-npm-userconfig\": {\n\"version\": \"file:helpers/set-npm-userconfig\",\n\"dev\": true\n",
"new_path": "package-lock.json",
"old_path": "package-lock.json"
},
{
"change_type": "MODIFY",
"diff": "\"@lerna-test/serialize-changelog\": \"file:helpers/serialize-changelog\",\n\"@lerna-test/serialize-git-sha\": \"file:helpers/serialize-git-sha\",\n\"@lerna-test/serialize-placeholders\": \"file:helpers/serialize-placeholders\",\n+ \"@lerna-test/serialize-tempdir\": \"file:helpers/serialize-tempdir\",\n\"@lerna-test/set-npm-userconfig\": \"file:helpers/set-npm-userconfig\",\n\"@lerna-test/show-commit\": \"file:helpers/show-commit\",\n\"@lerna-test/silence-logging\": \"file:helpers/silence-logging\",\n",
"new_path": "package.json",
"old_path": "package.json"
}
] | JavaScript | MIT License | lerna/lerna | chore(helpers): Extract serialize-tempdir | 1 | chore | helpers |
807,849 | 27.07.2018 19:11:46 | 25,200 | 14892069bdc8850de02158a19f940f1f08626615 | chore(helpers): Extract multi-line-trim-right | [
{
"change_type": "MODIFY",
"diff": "\"use strict\";\nconst chalk = require(\"chalk\");\n-const normalizeNewline = require(\"normalize-newline\");\n+const multiLineTrimRight = require(\"@lerna-test/multi-line-trim-right\");\n// keep snapshots stable cross-platform\nchalk.enabled = false;\n@@ -10,14 +10,7 @@ chalk.enabled = false;\nconst mockOutput = jest.fn();\nfunction logged() {\n- return mockOutput.mock.calls\n- .map(args =>\n- normalizeNewline(args[0])\n- .split(\"\\n\")\n- .map(line => line.trimRight())\n- .join(\"\\n\")\n- )\n- .join(\"\\n\");\n+ return mockOutput.mock.calls.map(args => multiLineTrimRight(args[0])).join(\"\\n\");\n}\nmodule.exports = mockOutput;\n",
"new_path": "commands/__mocks__/@lerna/output.js",
"old_path": "commands/__mocks__/@lerna/output.js"
},
{
"change_type": "MODIFY",
"diff": "\"use strict\";\nconst log = require(\"npmlog\");\n-const normalizeNewline = require(\"normalize-newline\");\n+const multiLineTrimRight = require(\"@lerna-test/multi-line-trim-right\");\nmodule.exports = loggingOutput;\n@@ -17,11 +17,6 @@ function loggingOutput(minLevel = \"info\") {\n// select all non-empty info, warn, or error logs\n.filter(m => log.levels[m.level] >= log.levels[minLevel] && m.message)\n// return just the normalized message content\n- .map(m =>\n- normalizeNewline(m.message)\n- .split(\"\\n\")\n- .map(line => line.trimRight())\n- .join(\"\\n\")\n- )\n+ .map(m => multiLineTrimRight(m.message))\n);\n}\n",
"new_path": "helpers/logging-output/index.js",
"old_path": "helpers/logging-output/index.js"
},
{
"change_type": "MODIFY",
"diff": "\"private\": true,\n\"license\": \"MIT\",\n\"dependencies\": {\n- \"npmlog\": \"^4.1.2\",\n- \"normalize-newline\": \"^3.0.0\"\n+ \"@lerna-test/multi-line-trim-right\": \"file:../multi-line-trim-right\",\n+ \"npmlog\": \"^4.1.2\"\n}\n}\n",
"new_path": "helpers/logging-output/package.json",
"old_path": "helpers/logging-output/package.json"
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+const normalizeNewline = require(\"normalize-newline\");\n+\n+module.exports = multiLineTrimRight;\n+\n+// const multiLineTrimRight = require(\"@lerna-test/multi-line-trim-right\");\n+function multiLineTrimRight(str) {\n+ return normalizeNewline(str)\n+ .split(\"\\n\")\n+ .map(line => line.trimRight())\n+ .join(\"\\n\");\n+}\n",
"new_path": "helpers/multi-line-trim-right/index.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"@lerna-test/multi-line-trim-right\",\n+ \"version\": \"0.0.0-test-only\",\n+ \"description\": \"A local test helper\",\n+ \"main\": \"index.js\",\n+ \"private\": true,\n+ \"license\": \"MIT\",\n+ \"dependencies\": {\n+ \"normalize-newline\": \"^3.0.0\"\n+ }\n+}\n",
"new_path": "helpers/multi-line-trim-right/package.json",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "const cliRunner = require(\"@lerna-test/cli-runner\");\nconst initFixture = require(\"@lerna-test/init-fixture\")(__dirname);\n-const normalizeNewline = require(\"normalize-newline\");\n+const multiLineTrimRight = require(\"@lerna-test/multi-line-trim-right\");\n// normalize temp directory paths in snapshots\nexpect.addSnapshotSerializer(require(\"@lerna-test/serialize-tempdir\"));\n@@ -15,14 +15,7 @@ beforeAll(async () => {\nconst run = cliRunner(cwd);\n// wrap runner to remove trailing whitespace added by columnify\n- // and normalize temp directory roots\n- lerna = (...args) =>\n- run(...args).then(result =>\n- normalizeNewline(result.stdout)\n- .split(\"\\n\")\n- .map(line => line.trimRight())\n- .join(\"\\n\")\n- );\n+ lerna = (...args) => run(...args).then(result => multiLineTrimRight(result.stdout));\n});\ntest(\"lerna list\", async () => {\n",
"new_path": "integration/lerna-ls.test.js",
"old_path": "integration/lerna-ls.test.js"
},
{
"change_type": "MODIFY",
"diff": "\"version\": \"file:helpers/logging-output\",\n\"dev\": true,\n\"requires\": {\n- \"normalize-newline\": \"^3.0.0\",\n+ \"@lerna-test/multi-line-trim-right\": \"file:helpers/multi-line-trim-right\",\n\"npmlog\": \"^4.1.2\"\n}\n},\n+ \"@lerna-test/multi-line-trim-right\": {\n+ \"version\": \"file:helpers/multi-line-trim-right\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"normalize-newline\": \"^3.0.0\"\n+ }\n+ },\n\"@lerna-test/normalize-relative-dir\": {\n\"version\": \"file:helpers/normalize-relative-dir\",\n\"dev\": true,\n",
"new_path": "package-lock.json",
"old_path": "package-lock.json"
},
{
"change_type": "MODIFY",
"diff": "\"@lerna-test/init-fixture\": \"file:helpers/init-fixture\",\n\"@lerna-test/load-manifests\": \"file:helpers/load-manifests\",\n\"@lerna-test/logging-output\": \"file:helpers/logging-output\",\n+ \"@lerna-test/multi-line-trim-right\": \"file:helpers/multi-line-trim-right\",\n\"@lerna-test/normalize-relative-dir\": \"file:helpers/normalize-relative-dir\",\n\"@lerna-test/normalize-test-root\": \"file:helpers/normalize-test-root\",\n\"@lerna-test/pkg-matchers\": \"file:helpers/pkg-matchers\",\n",
"new_path": "package.json",
"old_path": "package.json"
}
] | JavaScript | MIT License | lerna/lerna | chore(helpers): Extract multi-line-trim-right | 1 | chore | helpers |
217,927 | 27.07.2018 22:09:59 | 0 | dde2d8a7973eefaf5ac5cd9a6ac10d79688c5cd8 | refactor: recipe search striping
Striping odd rows instead of even rows. Lowered the opacity of the
striping to provide a less harsh contrast, especially for light themes. | [
{
"change_type": "MODIFY",
"diff": "</div>\n<div *ngIf=\"results.length > 0 && !loading\">\n- <mat-list-item *ngFor=\"let item of results; let even = even\" class=\"recipes-list-row\" [class.even]=\"even\">\n+ <mat-list-item *ngFor=\"let item of results; let odd = odd\" class=\"recipes-list-row\" [class.odd]=\"odd\">\n<mat-checkbox [checked]=\"selectedItems.indexOf(item) > -1\"\n(change)=\"resultChecked(item, $event.checked)\"\nclass=\"selection-box\"></mat-checkbox>\n",
"new_path": "src/app/pages/recipes/recipes/recipes.component.html",
"old_path": "src/app/pages/recipes/recipes/recipes.component.html"
},
{
"change_type": "MODIFY",
"diff": "}\n}\n-.even {\n- background: rgba(0, 0, 0, .3);\n+.odd {\n+ background: rgba(0, 0, 0, .2);\n}\n.only-recipes {\n",
"new_path": "src/app/pages/recipes/recipes/recipes.component.scss",
"old_path": "src/app/pages/recipes/recipes/recipes.component.scss"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | refactor: recipe search striping
Striping odd rows instead of even rows. Lowered the opacity of the
striping to provide a less harsh contrast, especially for light themes. | 1 | refactor | null |
791,714 | 28.07.2018 02:28:04 | -32,400 | 2e2acf15d93f016086e275e9788f34a4f69b4fae | extension: remove X-UA-Compatible meta | [
{
"change_type": "MODIFY",
"diff": "@@ -8,7 +8,6 @@ Unless required by applicable law or agreed to in writing, software distributed\n<html>\n<head>\n<meta charset=\"utf-8\">\n- <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\n<meta name=\"author\" content=\"Lighthouse Team\">\n<meta name=\"viewport\" content=\"width=device-width\">\n<title>Lighthouse Report</title>\n",
"new_path": "lighthouse-extension/app/popup.html",
"old_path": "lighthouse-extension/app/popup.html"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | extension: remove X-UA-Compatible meta (#5739) | 1 | extension | null |
679,913 | 28.07.2018 11:30:36 | -3,600 | 1f0551d09941489fd10faf0469bca748fcbeecc3 | refactor(vectors): various small fixes/additions (matrices) | [
{
"change_type": "MODIFY",
"diff": "@@ -7,11 +7,33 @@ This project is part of the\n<!-- TOC depthFrom:2 depthTo:3 -->\n+- [About](#about)\n+- [Installation](#installation)\n+- [Usage examples](#usage-examples)\n+- [Authors](#authors)\n+- [License](#license)\n+\n<!-- /TOC -->\n## About\n-TODO...\n+Vector and matrix operations as plain functions and class wrappers with\n+fluid interface. All functions support any array/typed array storage,\n+incl. mapped views of larger buffers. Additionally, vectors can have\n+flexible data layouts, incl. AOS, SOA, striped / interleaved, useful in\n+combination with memory pools / arenas (e.g. WASM interop).\n+\n+Vectors:\n+\n+- [Vec2](https://github.com/thi-ng/umbrella/tree/master/packages/vectors/src/vec2.ts)\n+- [Vec3](https://github.com/thi-ng/umbrella/tree/master/packages/vectors/src/vec3.ts)\n+- [Vec4](https://github.com/thi-ng/umbrella/tree/master/packages/vectors/src/vec4.ts)\n+\n+Matrices:\n+\n+- [Mat23](https://github.com/thi-ng/umbrella/tree/master/packages/vectors/src/mat23.ts)\n+- [Mat33](https://github.com/thi-ng/umbrella/tree/master/packages/vectors/src/mat33.ts)\n+- [Mat44](https://github.com/thi-ng/umbrella/tree/master/packages/vectors/src/mat44.ts)\n## Installation\n@@ -22,7 +44,43 @@ yarn add @thi.ng/vectors\n## Usage examples\n```ts\n-import * as vectors from \"@thi.ng/vectors\";\n+import * as v from \"@thi.ng/vectors\";\n+\n+// raw vector addition\n+v.add4([1,2,3,4], [10,20,30,40]);\n+// [ 11, 22, 33, 44 ]\n+\n+// buffer of interleaved attributes\n+// element stride 3 + 2 + 4 = 9\n+buf = [\n+ // pos uv color (rgba)\n+ 0,0,0, 0,0, 1,0,0,1,\n+ 100,0,0, 1,0, 1,1,0,1,\n+ 100,100,0, 1,1, 1,0,1,1,\n+ 0,100,0, 0,1, 0,1,1,1,\n+];\n+\n+// created memory mapped vector instances\n+pos = v.Vec3.mapBuffer(buf, 4, 0, 1, 9);\n+uv = v.Vec2.mapBuffer(buf, 4, 3, 1, 9);\n+col = v.Vec4.mapBuffer(buf, 4, 5, 1, 9);\n+\n+console.log(`pos: ${pos[1]}, uv: ${uv[1]}, color: ${col[1]}`);\n+// pos: [100, 0, 0], uv: [1, 0], color: [1, 1, 0, 1]\n+\n+// compute centroid\n+centroid = pos.reduce((c, p) => c.add(p), v.vec3()).divN(pos.length);\n+// Vec3 { buf: [ 50, 50, 0 ], i: 0, s: 1 }\n+\n+// build matrix to transform geometry\n+tx = v.Mat44.concat(\n+ v.Mat44.scale(0.01),\n+ v.Mat44.translation(centroid.copy().neg()),\n+ v.Mat44.rotationZ(v.rad(90)),\n+);\n+\n+// apply transform to all positions\n+pos.forEach((p) => tx.mulV3(p));\n```\n## Authors\n@@ -31,4 +89,4 @@ import * as vectors from \"@thi.ng/vectors\";\n## License\n-© 2018 Karsten Schmidt // Apache Software License 2.0\n+© 2016 - 2018 Karsten Schmidt // Apache Software License 2.0\n",
"new_path": "packages/vectors/README.md",
"old_path": "packages/vectors/README.md"
},
{
"change_type": "MODIFY",
"diff": "import { ReadonlyVec, Vec, VecOp } from \"./api\";\n+import { EPS, eqDelta } from \"./math\";\nexport const x = (v: ReadonlyVec, i = 0, _?) => v[i];\nexport const y = (v: ReadonlyVec, i = 0, s = 1) => v[i + s];\n@@ -6,7 +7,6 @@ export const z = (v: ReadonlyVec, i = 0, s = 1) => v[i + 2 * s];\nexport const w = (v: ReadonlyVec, i = 0, s = 1) => v[i + 3 * s];\n/**\n- *\n* @param fn op\n* @param a array to process\n* @param b vector operand\n@@ -17,9 +17,37 @@ export const w = (v: ReadonlyVec, i = 0, s = 1) => v[i + 3 * s];\n* @param csb component stride `b`\n* @param esa element stride `a`\n*/\n-export const sliceOp1 = (fn: VecOp, a: Vec, b: ReadonlyVec, n: number, ia = 0, ib = 0, csa = 1, csb = 1, esa = 2) => {\n+export const sliceOp1 = (fn: VecOp, a: Vec, b: ReadonlyVec, n: number, ia: number, ib: number, csa: number, csb: number, esa: number) => {\nfor (let i = ia; n > 0; n-- , i += esa) {\nfn(a, b, i, ib, csa, csb);\n}\nreturn a;\n};\n+\n+/**\n+ * @param fn\n+ * @param a\n+ * @param b\n+ * @param n\n+ * @param ia\n+ * @param ib\n+ * @param csa\n+ * @param csb\n+ * @param esa\n+ * @param esb\n+ */\n+export const sliceOpN = (fn: VecOp, a: Vec, b: ReadonlyVec, n: number, ia: number, ib: number, csa: number, csb: number, esa: number, esb: number) => {\n+ for (let i = ia, j = ib; n > 0; n-- , i += esa, j += esb) {\n+ fn(a, b, i, j, csa, csb);\n+ }\n+ return a;\n+};\n+\n+export const eqDeltaN = (a: Vec, b: Vec, n: number, eps = EPS, ia = 0, ib = 0, sa = 1, sb = 1) => {\n+ for (; --n >= 0; ia += sa, ib += sb) {\n+ if (!eqDelta(a[ia], b[ib], eps)) {\n+ return false;\n+ }\n+ }\n+ return true;\n+};\n",
"new_path": "packages/vectors/src/common.ts",
"old_path": "packages/vectors/src/common.ts"
},
{
"change_type": "MODIFY",
"diff": "-import { ICopy } from \"@thi.ng/api/api\";\n+import { ICopy, IEqualsDelta } from \"@thi.ng/api/api\";\nimport { isArrayLike } from \"@thi.ng/checks/is-arraylike\";\nimport { Mat, ReadonlyMat, Vec } from \"./api\";\n+import { eqDeltaN } from \"./common\";\n+import { EPS } from \"./math\";\nimport {\ncross2,\ndot2,\n- set2,\nset2s,\nVec2\n} from \"./vec2\";\n-import { set3s } from \"./vec3\";\nexport const set23 = (a: Mat, b: Mat, ia = 0, ib = 0) => (\na[ia] = b[ib],\n@@ -150,16 +150,9 @@ export const invert23 = (m: Mat, i = 0) => {\n);\n}\n-export const mat23to33 = (m33: Mat, m23: Mat, ia = 0, ib = 0) => (\n- set2(m33, m23, ia, ib),\n- set2(m33, m23, ia + 3, ib + 2),\n- set2(m33, m23, ia + 6, ib + 4),\n- set3s(m33, 0, 0, 1, ia + 2, 3),\n- m33\n-);\n-\nexport class Mat23 implements\n- ICopy<Mat23> {\n+ ICopy<Mat23>,\n+ IEqualsDelta<Mat23> {\nstatic rotation(theta: number) {\nreturn new Mat23(rotation23([], theta));\n@@ -227,6 +220,10 @@ export class Mat23 implements\nreturn new Mat23(set23([], this.buf, 0, this.i));\n}\n+ eqDelta(m: Mat23, eps = EPS) {\n+ return eqDeltaN(this.buf, m.buf, 6, eps, this.i, m.i);\n+ }\n+\nidentity() {\nidentity23(this.buf, this.i);\nreturn this;\n@@ -248,7 +245,7 @@ export class Mat23 implements\n}\nmulV(v: Vec2) {\n- mulV23(this.buf, v.buf, this.i, v.i);\n+ mulV23(this.buf, v.buf, this.i, v.i, v.s);\nreturn v;\n}\n",
"new_path": "packages/vectors/src/mat23.ts",
"old_path": "packages/vectors/src/mat23.ts"
},
{
"change_type": "MODIFY",
"diff": "-import { ICopy } from \"@thi.ng/api/api\";\n+import { ICopy, IEqualsDelta } from \"@thi.ng/api/api\";\nimport { isArrayLike } from \"@thi.ng/checks/is-arraylike\";\nimport { Mat, ReadonlyMat, Vec } from \"./api\";\n-import { dot3, set3s, Vec3, set3 } from \"./vec3\";\n+import { eqDeltaN } from \"./common\";\n+import { EPS } from \"./math\";\n+import {\n+ dot3,\n+ set3,\n+ set3s,\n+ Vec3\n+} from \"./vec3\";\nimport { set4s } from \"./vec4\";\nexport const set33 = (a: Mat, b: Mat, ia = 0, ib = 0) => (\n@@ -204,7 +211,8 @@ export const mat33to44 = (m44: Mat, m33: Mat, ia = 0, ib = 0) => (\n);\nexport class Mat33 implements\n- ICopy<Mat33> {\n+ ICopy<Mat33>,\n+ IEqualsDelta<Mat33> {\nstatic rotationX(theta: number) {\nreturn new Mat33(rotationX33([], theta));\n@@ -246,6 +254,10 @@ export class Mat33 implements\nreturn new Mat33(set33([], this.buf, 0, this.i));\n}\n+ eqDelta(m: Mat33, eps = EPS) {\n+ return eqDeltaN(this.buf, m.buf, 9, eps, this.i, m.i);\n+ }\n+\nidentity() {\nidentity33(this.buf, this.i);\nreturn this;\n@@ -267,7 +279,7 @@ export class Mat33 implements\n}\nmulV(v: Vec3) {\n- mulV33(this.buf, v.buf, this.i, v.i);\n+ mulV33(this.buf, v.buf, this.i, v.i, v.s);\nreturn v;\n}\n",
"new_path": "packages/vectors/src/mat33.ts",
"old_path": "packages/vectors/src/mat33.ts"
},
{
"change_type": "MODIFY",
"diff": "-import { ICopy } from \"@thi.ng/api/api\";\n+import { ICopy, IEqualsDelta } from \"@thi.ng/api/api\";\nimport { isArrayLike } from \"@thi.ng/checks/is-arraylike\";\nimport { Mat, ReadonlyMat, Vec } from \"./api\";\n+import { eqDeltaN } from \"./common\";\nimport { Mat33 } from \"./mat33\";\n-import { rad } from \"./math\";\n+import { EPS, rad } from \"./math\";\nimport {\ncross3,\ndot3,\nget3,\nnormalize3,\nset3,\n+ set3s,\nsub3,\nVec3\n} from \"./vec3\";\nimport { dot4, set4s, Vec4 } from \"./vec4\";\n-export const set44 = (a: Mat, b: Mat, ia = 0, ib = 0) => (\n- a[ia] = b[ib],\n- a[ia + 1] = b[ib + 1],\n- a[ia + 2] = b[ib + 2],\n- a[ia + 3] = b[ib + 3],\n- a[ia + 4] = b[ib + 4],\n- a[ia + 5] = b[ib + 5],\n- a[ia + 6] = b[ib + 6],\n- a[ia + 7] = b[ib + 7],\n- a[ia + 8] = b[ib + 8],\n- a\n-);\n+export const set44 = (a: Mat, b: Mat, ia = 0, ib = 0) => {\n+ for (let i = 0; i < 16; i++) {\n+ a[ia + i] = b[ib + i];\n+ }\n+ return a;\n+};\n/**\n* ```\n@@ -229,7 +225,7 @@ export const concat44 = (a: Mat, ia: number, ...xs: (ReadonlyMat | [ReadonlyMat,\n);\nexport const mulV344 = (m: ReadonlyMat, v: Vec, im = 0, iv = 0, sv = 1) =>\n- set4s(\n+ set3s(\nv,\ndot3(m, v, im, iv, 4, sv) + m[12],\ndot3(m, v, im + 1, iv, 4, sv) + m[13],\n@@ -391,7 +387,8 @@ export const mat44to33 = (m33: Mat, m44: Mat, ia = 0, ib = 0) => (\n);\nexport class Mat44 implements\n- ICopy<Mat44> {\n+ ICopy<Mat44>,\n+ IEqualsDelta<Mat44> {\nstatic rotationX(theta: number) {\nreturn new Mat44(rotationX44([], theta));\n@@ -447,6 +444,10 @@ export class Mat44 implements\nreturn new Mat44(set44([], this.buf, 0, this.i));\n}\n+ eqDelta(m: Mat44, eps = EPS) {\n+ return eqDeltaN(this.buf, m.buf, 16, eps, this.i, m.i);\n+ }\n+\nidentity() {\nidentity44(this.buf, this.i);\nreturn this;\n@@ -471,12 +472,12 @@ export class Mat44 implements\n}\nmulV3(v: Vec3) {\n- mulV344(this.buf, v.buf, this.i, v.i);\n+ mulV344(this.buf, v.buf, this.i, v.i, v.s);\nreturn v;\n}\nmulV(v: Vec4) {\n- mulV44(this.buf, v.buf, this.i, v.i);\n+ mulV44(this.buf, v.buf, this.i, v.i, v.s);\nreturn v;\n}\n",
"new_path": "packages/vectors/src/mat44.ts",
"old_path": "packages/vectors/src/mat44.ts"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | refactor(vectors): various small fixes/additions (matrices) | 1 | refactor | vectors |
679,913 | 29.07.2018 02:07:13 | -3,600 | e3c616759228aa7952291643afb32e48687e3927 | feat(vectors): add generic vec fns & class wrapper | [
{
"change_type": "ADD",
"diff": "+import { ICopy, IEqualsDelta } from \"@thi.ng/api/api\";\n+import { ReadonlyVec, Vec } from \"./api\";\n+import { eqDelta } from \"./common\";\n+import {\n+ clamp1,\n+ EPS,\n+ sign1,\n+ smoothStep1,\n+ step1\n+} from \"./math\";\n+\n+export const opg1 = (fn: (x: number) => number, a: Vec, n: number, i = 0, s = 1) => {\n+ while (--n >= 0) {\n+ a[i + n * s] = fn(a[i + n * s]);\n+ }\n+ return a;\n+};\n+\n+export const opg2 = (fn: (x: number, y: number) => number, a: Vec, b: ReadonlyVec, n: number, ia = 0, ib = 0, sa = 1, sb = 1) => {\n+ while (--n >= 0) {\n+ a[ia + n * sa] = fn(a[ia + n * sa], b[ib + n * sb]);\n+ }\n+ return a;\n+};\n+\n+export const opg3 = (fn: (x: number, y: number, z: number) => number, a: Vec, b: ReadonlyVec, c: ReadonlyVec, n: number, ia = 0, ib = 0, ic = 0, sa = 1, sb = 1, sc = 1) => {\n+ while (--n >= 0) {\n+ a[ia + n * sa] = fn(a[ia + n * sa], b[ib + n * sb], c[ic + n * sc]);\n+ }\n+ return a;\n+};\n+\n+export const get = (a: ReadonlyVec, n: number, i = 0, s = 1) => {\n+ const res = [];\n+ for (; n > 0; n-- , i += s) {\n+ res.push(a[i]);\n+ }\n+ return res;\n+};\n+\n+export const set = (a: Vec, b: ReadonlyVec, num: number, ia = 0, ib = 0, sa = 1, sb = 1) => {\n+ while (--num >= 0) {\n+ a[ia + num * sa] = b[ib + num * sb];\n+ }\n+ return a;\n+};\n+\n+export const setN = (a: Vec, n: number, num: number, ia = 0, sa = 1) => {\n+ while (--num >= 0) {\n+ a[ia + n * sa] = n;\n+ }\n+ return a;\n+};\n+\n+export const add = (a: Vec, b: ReadonlyVec, num: number, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+ opg2((x, y) => x + y, a, b, num, ia, ib, sa, sb);\n+\n+export const sub = (a: Vec, b: ReadonlyVec, num: number, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+ opg2((x, y) => x - y, a, b, num, ia, ib, sa, sb);\n+\n+export const mul = (a: Vec, b: ReadonlyVec, num: number, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+ opg2((x, y) => x * y, a, b, num, ia, ib, sa, sb);\n+\n+export const div = (a: Vec, b: ReadonlyVec, num: number, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+ opg2((x, y) => x / y, a, b, num, ia, ib, sa, sb);\n+\n+export const addN = (a: Vec, n: number, num: number, i = 0, s = 1) =>\n+ opg1((x) => x + n, a, num, i, s);\n+\n+export const subN = (a: Vec, n: number, num: number, i = 0, s = 1) =>\n+ opg1((x) => x - n, a, num, i, s);\n+\n+export const mulN = (a: Vec, n: number, num: number, i = 0, s = 1) =>\n+ opg1((x) => x * n, a, num, i, s);\n+\n+export const divN = (a: Vec, n: number, num: number, i = 0, s = 1) =>\n+ opg1((x) => x / n, a, num, i, s);\n+\n+export const dot = (a: ReadonlyVec, b: ReadonlyVec, num: number, ia = 0, ib = 0, sa = 1, sb = 1) => {\n+ let res = 0;\n+ while (--num >= 0) {\n+ res += a[ia + num * sa] * b[ib + num * sb];\n+ }\n+ return res;\n+};\n+\n+export const madd = (a: Vec, b: ReadonlyVec, c: ReadonlyVec, num: number, ia = 0, ib = 0, ic = 0, sa = 1, sb = 1, sc = 1) =>\n+ opg3((x, y, z) => x + y * z, a, b, c, num, ia, ib, ic, sa, sb, sc);\n+\n+export const maddN = (a: Vec, b: ReadonlyVec, n: number, num: number, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+ opg2((x, y) => x + y * n, a, b, num, ia, ib, sa, sb);\n+\n+export const mix = (a: Vec, b: ReadonlyVec, c: ReadonlyVec, num: number, ia = 0, ib = 0, ic = 0, sa = 1, sb = 1, sc = 1) =>\n+ opg3((x, y, z) => x + (y - x) * z, a, b, c, num, ia, ib, ic, sa, sb, sc);\n+\n+export const mixN = (a: Vec, b: ReadonlyVec, n: number, num: number, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+ opg2((x, y) => x + (y - x) * n, a, b, num, ia, ib, sa, sb);\n+\n+export const magSq = (a: ReadonlyVec, num: number, i = 0, s = 1) =>\n+ dot(a, a, num, i, i, s, s);\n+\n+export const mag = (a: ReadonlyVec, num: number, i = 0, s = 1) =>\n+ Math.sqrt(magSq(a, num, i, s));\n+\n+export const distSq = (a: ReadonlyVec, b: ReadonlyVec, num: number, ia = 0, ib = 0, sa = 1, sb = 1) => {\n+ let res = 0;\n+ while (--num >= 0) {\n+ res += Math.pow(a[ia + num * sa] - b[ib + num * sb], 2);\n+ }\n+ return res;\n+};\n+\n+export const dist = (a: ReadonlyVec, b: ReadonlyVec, num: number, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+ Math.sqrt(distSq(a, b, num, ia, ib, sa, sb));\n+\n+export const normalize = (a: Vec, num: number, len: number, i = 0, s = 1) => {\n+ const m = mag(a, num, i, s);\n+ m >= EPS && mulN(a, len / m, num, i, s);\n+ return a;\n+};\n+\n+export const neg = (a: Vec, num: number, i = 0, s = 1) =>\n+ mulN(a, -1, num, i, s);\n+\n+export const abs = (a: Vec, num: number, i = 0, s = 1) =>\n+ opg1(Math.abs, a, num, i, s);\n+\n+export const sign = (a: Vec, num: number, eps = EPS, i = 0, s = 1) =>\n+ opg1((x) => sign1(x, eps), a, num, i, s);\n+\n+export const floor = (a: Vec, num: number, i = 0, s = 1) =>\n+ opg1(Math.floor, a, num, i, s);\n+\n+export const ceil = (a: Vec, num: number, i = 0, s = 1) =>\n+ opg1(Math.ceil, a, num, i, s);\n+\n+export const sin = (a: Vec, num: number, i = 0, s = 1) =>\n+ opg1(Math.sin, a, num, i, s);\n+\n+export const cos = (a: Vec, num: number, i = 0, s = 1) =>\n+ opg1(Math.cos, a, num, i, s);\n+\n+export const sqrt = (a: Vec, num: number, i = 0, s = 1) =>\n+ opg1(Math.sqrt, a, num, i, s);\n+\n+export const pow = (a: Vec, b: ReadonlyVec, num: number, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+ opg2(Math.pow, a, b, num, ia, ib, sa, sb);\n+\n+export const powN = (a: Vec, n: number, num: number, i = 0, s = 1) =>\n+ opg1((x) => Math.pow(x, n), a, num, i, s);\n+\n+export const min = (a: Vec, b: ReadonlyVec, num: number, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+ opg2(Math.min, a, b, num, ia, ib, sa, sb);\n+\n+export const max = (a: Vec, b: ReadonlyVec, num: number, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+ opg2(Math.max, a, b, num, ia, ib, sa, sb);\n+\n+export const clamp = (a: Vec, b: ReadonlyVec, c: ReadonlyVec, num: number, ia = 0, ib = 0, ic = 0, sa = 1, sb = 1, sc = 1) =>\n+ opg3(clamp1, a, b, c, num, ia, ib, ic, sa, sb, sc);\n+\n+export const step = (a: Vec, b: ReadonlyVec, num: number, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+ opg2((x, e) => step1(e, x), a, b, num, ia, ib, sa, sb);\n+\n+export const smoothStep = (a: Vec, b: ReadonlyVec, c: ReadonlyVec, num: number, ia = 0, ib = 0, ic = 0, sa = 1, sb = 1, sc = 1) =>\n+ opg3((x, e1, e2) => smoothStep1(e1, e2, x), a, b, c, num, ia, ib, ic, sa, sb, sc);\n+\n+export class GVec implements\n+ ICopy<GVec>,\n+ IEqualsDelta<GVec> {\n+\n+ buf: Vec;\n+ n: number;\n+ i: number;\n+ s: number;\n+\n+ constructor(buf: Vec, n = buf.length, i = 0, s = 1) {\n+ this.buf = buf;\n+ this.n = n;\n+ this.i = i;\n+ this.s = s;\n+ }\n+\n+ copy() {\n+ return new GVec(get(this.buf, this.n, this.i, this.s), this.n);\n+ }\n+\n+ eqDelta(v: GVec, eps = EPS) {\n+ return this.n === v.n && eqDelta(this.buf, v.buf, this.n, eps, this.i, v.i, this.s, v.s);\n+ }\n+\n+ set(v: GVec) {\n+ set(this.buf, v.buf, this.n, this.i, v.i, this.s, v.s);\n+ return this;\n+ }\n+\n+ setN(n: number) {\n+ setN(this.buf, n, this.n, this.i, this.s);\n+ return this;\n+ }\n+\n+ add(v: GVec) {\n+ add(this.buf, v.buf, this.n, this.i, v.i, this.s, v.s);\n+ return this;\n+ }\n+\n+ sub(v: GVec) {\n+ sub(this.buf, v.buf, this.n, this.i, v.i, this.s, v.s);\n+ return this;\n+ }\n+\n+ mul(v: GVec) {\n+ mul(this.buf, v.buf, this.n, this.i, v.i, this.s, v.s);\n+ return this;\n+ }\n+\n+ div(v: GVec) {\n+ div(this.buf, v.buf, this.n, this.i, v.i, this.s, v.s);\n+ return this;\n+ }\n+\n+ addN(n: number) {\n+ addN(this.buf, n, this.n, this.i, this.s);\n+ return this;\n+ }\n+\n+ subN(n: number) {\n+ subN(this.buf, n, this.n, this.i, this.s);\n+ return this;\n+ }\n+\n+ mulN(n: number) {\n+ mulN(this.buf, n, this.n, this.i, this.s);\n+ return this;\n+ }\n+\n+ divN(n: number) {\n+ divN(this.buf, n, this.n, this.i, this.s);\n+ return this;\n+ }\n+\n+ madd(b: Readonly<GVec>, c: Readonly<GVec>) {\n+ madd(this.buf, b.buf, c.buf, this.n, this.i, b.i, c.i, this.s, b.s, c.s);\n+ return this;\n+ }\n+\n+ maddN(b: Readonly<GVec>, n: number) {\n+ maddN(this.buf, b.buf, n, this.n, this.i, b.i, this.s, b.s);\n+ return this;\n+ }\n+\n+ mix(b: Readonly<GVec>, c: Readonly<GVec>) {\n+ mix(this.buf, b.buf, c.buf, this.n, this.i, b.i, c.i, this.s, b.s, c.s);\n+ return this;\n+ }\n+\n+ mixN(b: Readonly<GVec>, n: number) {\n+ mixN(this.buf, b.buf, n, this.n, this.i, b.i, this.s, b.s);\n+ return this;\n+ }\n+\n+ magSq() {\n+ return magSq(this.buf, this.n, this.i, this.s);\n+ }\n+\n+ mag() {\n+ return mag(this.buf, this.n, this.i, this.s);\n+ }\n+\n+ normalize(len = 1) {\n+ normalize(this.buf, this.n, len, this.i, this.s);\n+ return this;\n+ }\n+\n+ dot(v: GVec) {\n+ return dot(this.buf, v.buf, this.n, this.i, v.i, this.s, v.s);\n+ }\n+\n+ abs() {\n+ abs(this.buf, this.n, this.i, this.s);\n+ return this;\n+ }\n+\n+ sign() {\n+ sign(this.buf, this.n, this.i, this.s);\n+ return this;\n+ }\n+\n+ ceil() {\n+ ceil(this.buf, this.n, this.i, this.s);\n+ return this;\n+ }\n+\n+ floor() {\n+ floor(this.buf, this.n, this.i, this.s);\n+ return this;\n+ }\n+\n+ sin() {\n+ sin(this.buf, this.n, this.i, this.s);\n+ return this;\n+ }\n+\n+ cos() {\n+ cos(this.buf, this.n, this.i, this.s);\n+ return this;\n+ }\n+\n+ sqrt() {\n+ sqrt(this.buf, this.n, this.i, this.s);\n+ return this;\n+ }\n+\n+ pow(v: GVec) {\n+ pow(this.buf, v.buf, this.n, this.i, v.i, this.s, v.s);\n+ return this;\n+ }\n+\n+ powN(n: number) {\n+ powN(this.buf, n, this.n, this.i, this.s);\n+ return this;\n+ }\n+\n+ min(v: Readonly<GVec>) {\n+ min(this.buf, v.buf, this.n, this.i, v.i, this.s, v.s);\n+ return this;\n+ }\n+\n+ max(v: Readonly<GVec>) {\n+ max(this.buf, v.buf, this.n, this.i, v.i, this.s, v.s);\n+ return this;\n+ }\n+\n+ clamp(min: Readonly<GVec>, max: Readonly<GVec>) {\n+ clamp(this.buf, min.buf, max.buf, this.n, this.i, min.i, max.i, this.s, min.s, max.s);\n+ return this;\n+ }\n+\n+ step(e: Readonly<GVec>) {\n+ step(this.buf, e.buf, this.n, this.i, e.i, this.s, e.s);\n+ return this;\n+ }\n+\n+ smoothStep(e1: Readonly<GVec>, e2: Readonly<GVec>) {\n+ smoothStep(this.buf, e1.buf, e2.buf, this.n, this.i, e1.i, e2.i, this.s, e1.s, e2.s);\n+ return this;\n+ }\n+\n+ toString() {\n+ return `[${get(this.buf, this.n, this.i, this.s).join(\", \")}]`;\n+ }\n+}\n",
"new_path": "packages/vectors/src/gvec.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -4,6 +4,7 @@ export * from \"./mat23\";\nexport * from \"./mat33\";\nexport * from \"./mat44\";\nexport * from \"./math\";\n+export * from \"./gvec\";\nexport * from \"./vec2\";\nexport * from \"./vec3\";\nexport * from \"./vec4\";\n",
"new_path": "packages/vectors/src/index.ts",
"old_path": "packages/vectors/src/index.ts"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | feat(vectors): add generic vec fns & class wrapper | 1 | feat | vectors |
217,922 | 29.07.2018 14:56:50 | -7,200 | 935b223b352517cff12c2962bf44ab28651bfe32 | feat: add commission creation date in the commission panel and details | [
{
"change_type": "MODIFY",
"diff": "-Subproject commit 83f43d1dff3681a139d17d9f9b5e4f1740c1aae4\n+Subproject commit b352c0965f6537ee9181b55144377ada6309a4bb\n",
"new_path": "data-extraction/SaintCoinach",
"old_path": "data-extraction/SaintCoinach"
},
{
"change_type": "MODIFY",
"diff": "\"balanced-match\": {\n\"version\": \"1.0.0\",\n\"bundled\": true,\n- \"dev\": true\n+ \"dev\": true,\n+ \"optional\": true\n},\n\"brace-expansion\": {\n\"version\": \"1.1.11\",\n\"bundled\": true,\n\"dev\": true,\n+ \"optional\": true,\n\"requires\": {\n\"balanced-match\": \"^1.0.0\",\n\"concat-map\": \"0.0.1\"\n\"code-point-at\": {\n\"version\": \"1.1.0\",\n\"bundled\": true,\n- \"dev\": true\n+ \"dev\": true,\n+ \"optional\": true\n},\n\"concat-map\": {\n\"version\": \"0.0.1\",\n\"bundled\": true,\n- \"dev\": true\n+ \"dev\": true,\n+ \"optional\": true\n},\n\"console-control-strings\": {\n\"version\": \"1.1.0\",\n\"bundled\": true,\n- \"dev\": true\n+ \"dev\": true,\n+ \"optional\": true\n},\n\"core-util-is\": {\n\"version\": \"1.0.2\",\n\"inherits\": {\n\"version\": \"2.0.3\",\n\"bundled\": true,\n- \"dev\": true\n+ \"dev\": true,\n+ \"optional\": true\n},\n\"ini\": {\n\"version\": \"1.3.5\",\n\"version\": \"1.0.0\",\n\"bundled\": true,\n\"dev\": true,\n+ \"optional\": true,\n\"requires\": {\n\"number-is-nan\": \"^1.0.0\"\n}\n\"version\": \"3.0.4\",\n\"bundled\": true,\n\"dev\": true,\n+ \"optional\": true,\n\"requires\": {\n\"brace-expansion\": \"^1.1.7\"\n}\n\"number-is-nan\": {\n\"version\": \"1.0.1\",\n\"bundled\": true,\n- \"dev\": true\n+ \"dev\": true,\n+ \"optional\": true\n},\n\"object-assign\": {\n\"version\": \"4.1.1\",\n\"version\": \"1.4.0\",\n\"bundled\": true,\n\"dev\": true,\n+ \"optional\": true,\n\"requires\": {\n\"wrappy\": \"1\"\n}\n\"version\": \"1.0.2\",\n\"bundled\": true,\n\"dev\": true,\n+ \"optional\": true,\n\"requires\": {\n\"code-point-at\": \"^1.0.0\",\n\"is-fullwidth-code-point\": \"^1.0.0\",\n",
"new_path": "package-lock.json",
"old_path": "package-lock.json"
},
{
"change_type": "MODIFY",
"diff": "<mat-card>\n<mat-card-header>\n<mat-card-title>\n- {{commission.name}}\n+ {{commission.name}} - {{commission.createdAt | date: 'medium'}}\n</mat-card-title>\n<mat-card-subtitle>\n<app-rating [character]=\"author\"></app-rating>\n",
"new_path": "src/app/pages/commission-board/commission-details/commission-details.component.html",
"old_path": "src/app/pages/commission-board/commission-details/commission-details.component.html"
},
{
"change_type": "MODIFY",
"diff": "</mat-panel-title>\n<mat-panel-description>\n<span *ngIf=\"author$ | async as author\">\n- {{author.name}}\n+ {{author.name}} - <i>{{commission.createdAt | date: 'medium'}}</i>\n</span>\n</mat-panel-description>\n<mat-chip-list>\n",
"new_path": "src/app/pages/commission-board/commission-panel/commission-panel.component.html",
"old_path": "src/app/pages/commission-board/commission-panel/commission-panel.component.html"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | feat: add commission creation date in the commission panel and details | 1 | feat | null |
679,913 | 29.07.2018 18:36:58 | -3,600 | f99cf3dc52d2ac139c6fda5d05697f640765f8c6 | refactor(vectors): add gvec default length args | [
{
"change_type": "MODIFY",
"diff": "@@ -9,74 +9,74 @@ import {\nstep1\n} from \"./math\";\n-export const opg1 = (fn: (x: number) => number, a: Vec, n: number, i = 0, s = 1) => {\n- while (--n >= 0) {\n- a[i + n * s] = fn(a[i + n * s]);\n+export const opg1 = (fn: (x: number) => number, a: Vec, num = a.length, i = 0, s = 1) => {\n+ while (--num >= 0) {\n+ a[i + num * s] = fn(a[i + num * s]);\n}\nreturn a;\n};\n-export const opg2 = (fn: (x: number, y: number) => number, a: Vec, b: ReadonlyVec, n: number, ia = 0, ib = 0, sa = 1, sb = 1) => {\n- while (--n >= 0) {\n- a[ia + n * sa] = fn(a[ia + n * sa], b[ib + n * sb]);\n+export const opg2 = (fn: (x: number, y: number) => number, a: Vec, b: ReadonlyVec, num = a.length, ia = 0, ib = 0, sa = 1, sb = 1) => {\n+ while (--num >= 0) {\n+ a[ia + num * sa] = fn(a[ia + num * sa], b[ib + num * sb]);\n}\nreturn a;\n};\n-export const opg3 = (fn: (x: number, y: number, z: number) => number, a: Vec, b: ReadonlyVec, c: ReadonlyVec, n: number, ia = 0, ib = 0, ic = 0, sa = 1, sb = 1, sc = 1) => {\n- while (--n >= 0) {\n- a[ia + n * sa] = fn(a[ia + n * sa], b[ib + n * sb], c[ic + n * sc]);\n+export const opg3 = (fn: (x: number, y: number, z: number) => number, a: Vec, b: ReadonlyVec, c: ReadonlyVec, num = a.length, ia = 0, ib = 0, ic = 0, sa = 1, sb = 1, sc = 1) => {\n+ while (--num >= 0) {\n+ a[ia + num * sa] = fn(a[ia + num * sa], b[ib + num * sb], c[ic + num * sc]);\n}\nreturn a;\n};\n-export const get = (a: ReadonlyVec, n: number, i = 0, s = 1) => {\n- const res = [];\n- for (; n > 0; n-- , i += s) {\n- res.push(a[i]);\n+export const get = (a: ReadonlyVec, num = a.length, i = 0, s = 1) => {\n+ const res = new (<any>(a.constructor))(num);\n+ for (let j = 0; j < num; j++ , i += s) {\n+ res[j] = a[i];\n}\nreturn res;\n};\n-export const set = (a: Vec, b: ReadonlyVec, num: number, ia = 0, ib = 0, sa = 1, sb = 1) => {\n+export const set = (a: Vec, b: ReadonlyVec, num = a.length, ia = 0, ib = 0, sa = 1, sb = 1) => {\nwhile (--num >= 0) {\na[ia + num * sa] = b[ib + num * sb];\n}\nreturn a;\n};\n-export const setN = (a: Vec, n: number, num: number, ia = 0, sa = 1) => {\n+export const setN = (a: Vec, n: number, num = a.length, ia = 0, sa = 1) => {\nwhile (--num >= 0) {\n- a[ia + n * sa] = n;\n+ a[ia + num * sa] = n;\n}\nreturn a;\n};\n-export const add = (a: Vec, b: ReadonlyVec, num: number, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+export const add = (a: Vec, b: ReadonlyVec, num = a.length, ia = 0, ib = 0, sa = 1, sb = 1) =>\nopg2((x, y) => x + y, a, b, num, ia, ib, sa, sb);\n-export const sub = (a: Vec, b: ReadonlyVec, num: number, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+export const sub = (a: Vec, b: ReadonlyVec, num = a.length, ia = 0, ib = 0, sa = 1, sb = 1) =>\nopg2((x, y) => x - y, a, b, num, ia, ib, sa, sb);\n-export const mul = (a: Vec, b: ReadonlyVec, num: number, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+export const mul = (a: Vec, b: ReadonlyVec, num = a.length, ia = 0, ib = 0, sa = 1, sb = 1) =>\nopg2((x, y) => x * y, a, b, num, ia, ib, sa, sb);\n-export const div = (a: Vec, b: ReadonlyVec, num: number, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+export const div = (a: Vec, b: ReadonlyVec, num = a.length, ia = 0, ib = 0, sa = 1, sb = 1) =>\nopg2((x, y) => x / y, a, b, num, ia, ib, sa, sb);\n-export const addN = (a: Vec, n: number, num: number, i = 0, s = 1) =>\n+export const addN = (a: Vec, n: number, num = a.length, i = 0, s = 1) =>\nopg1((x) => x + n, a, num, i, s);\n-export const subN = (a: Vec, n: number, num: number, i = 0, s = 1) =>\n+export const subN = (a: Vec, n: number, num = a.length, i = 0, s = 1) =>\nopg1((x) => x - n, a, num, i, s);\n-export const mulN = (a: Vec, n: number, num: number, i = 0, s = 1) =>\n+export const mulN = (a: Vec, n: number, num = a.length, i = 0, s = 1) =>\nopg1((x) => x * n, a, num, i, s);\n-export const divN = (a: Vec, n: number, num: number, i = 0, s = 1) =>\n+export const divN = (a: Vec, n: number, num = a.length, i = 0, s = 1) =>\nopg1((x) => x / n, a, num, i, s);\n-export const dot = (a: ReadonlyVec, b: ReadonlyVec, num: number, ia = 0, ib = 0, sa = 1, sb = 1) => {\n+export const dot = (a: ReadonlyVec, b: ReadonlyVec, num = a.length, ia = 0, ib = 0, sa = 1, sb = 1) => {\nlet res = 0;\nwhile (--num >= 0) {\nres += a[ia + num * sa] * b[ib + num * sb];\n@@ -84,25 +84,25 @@ export const dot = (a: ReadonlyVec, b: ReadonlyVec, num: number, ia = 0, ib = 0,\nreturn res;\n};\n-export const madd = (a: Vec, b: ReadonlyVec, c: ReadonlyVec, num: number, ia = 0, ib = 0, ic = 0, sa = 1, sb = 1, sc = 1) =>\n+export const madd = (a: Vec, b: ReadonlyVec, c: ReadonlyVec, num = a.length, ia = 0, ib = 0, ic = 0, sa = 1, sb = 1, sc = 1) =>\nopg3((x, y, z) => x + y * z, a, b, c, num, ia, ib, ic, sa, sb, sc);\n-export const maddN = (a: Vec, b: ReadonlyVec, n: number, num: number, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+export const maddN = (a: Vec, b: ReadonlyVec, n: number, num = a.length, ia = 0, ib = 0, sa = 1, sb = 1) =>\nopg2((x, y) => x + y * n, a, b, num, ia, ib, sa, sb);\n-export const mix = (a: Vec, b: ReadonlyVec, c: ReadonlyVec, num: number, ia = 0, ib = 0, ic = 0, sa = 1, sb = 1, sc = 1) =>\n+export const mix = (a: Vec, b: ReadonlyVec, c: ReadonlyVec, num = a.length, ia = 0, ib = 0, ic = 0, sa = 1, sb = 1, sc = 1) =>\nopg3((x, y, z) => x + (y - x) * z, a, b, c, num, ia, ib, ic, sa, sb, sc);\n-export const mixN = (a: Vec, b: ReadonlyVec, n: number, num: number, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+export const mixN = (a: Vec, b: ReadonlyVec, n: number, num = a.length, ia = 0, ib = 0, sa = 1, sb = 1) =>\nopg2((x, y) => x + (y - x) * n, a, b, num, ia, ib, sa, sb);\n-export const magSq = (a: ReadonlyVec, num: number, i = 0, s = 1) =>\n+export const magSq = (a: ReadonlyVec, num = a.length, i = 0, s = 1) =>\ndot(a, a, num, i, i, s, s);\n-export const mag = (a: ReadonlyVec, num: number, i = 0, s = 1) =>\n+export const mag = (a: ReadonlyVec, num = a.length, i = 0, s = 1) =>\nMath.sqrt(magSq(a, num, i, s));\n-export const distSq = (a: ReadonlyVec, b: ReadonlyVec, num: number, ia = 0, ib = 0, sa = 1, sb = 1) => {\n+export const distSq = (a: ReadonlyVec, b: ReadonlyVec, num = a.length, ia = 0, ib = 0, sa = 1, sb = 1) => {\nlet res = 0;\nwhile (--num >= 0) {\nres += Math.pow(a[ia + num * sa] - b[ib + num * sb], 2);\n@@ -110,58 +110,58 @@ export const distSq = (a: ReadonlyVec, b: ReadonlyVec, num: number, ia = 0, ib =\nreturn res;\n};\n-export const dist = (a: ReadonlyVec, b: ReadonlyVec, num: number, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+export const dist = (a: ReadonlyVec, b: ReadonlyVec, num = a.length, ia = 0, ib = 0, sa = 1, sb = 1) =>\nMath.sqrt(distSq(a, b, num, ia, ib, sa, sb));\n-export const normalize = (a: Vec, num: number, len: number, i = 0, s = 1) => {\n+export const normalize = (a: Vec, num = a.length, len = 1, i = 0, s = 1) => {\nconst m = mag(a, num, i, s);\nm >= EPS && mulN(a, len / m, num, i, s);\nreturn a;\n};\n-export const neg = (a: Vec, num: number, i = 0, s = 1) =>\n+export const neg = (a: Vec, num = a.length, i = 0, s = 1) =>\nmulN(a, -1, num, i, s);\n-export const abs = (a: Vec, num: number, i = 0, s = 1) =>\n+export const abs = (a: Vec, num = a.length, i = 0, s = 1) =>\nopg1(Math.abs, a, num, i, s);\n-export const sign = (a: Vec, num: number, eps = EPS, i = 0, s = 1) =>\n+export const sign = (a: Vec, num = a.length, eps = EPS, i = 0, s = 1) =>\nopg1((x) => sign1(x, eps), a, num, i, s);\n-export const floor = (a: Vec, num: number, i = 0, s = 1) =>\n+export const floor = (a: Vec, num = a.length, i = 0, s = 1) =>\nopg1(Math.floor, a, num, i, s);\n-export const ceil = (a: Vec, num: number, i = 0, s = 1) =>\n+export const ceil = (a: Vec, num = a.length, i = 0, s = 1) =>\nopg1(Math.ceil, a, num, i, s);\n-export const sin = (a: Vec, num: number, i = 0, s = 1) =>\n+export const sin = (a: Vec, num = a.length, i = 0, s = 1) =>\nopg1(Math.sin, a, num, i, s);\n-export const cos = (a: Vec, num: number, i = 0, s = 1) =>\n+export const cos = (a: Vec, num = a.length, i = 0, s = 1) =>\nopg1(Math.cos, a, num, i, s);\n-export const sqrt = (a: Vec, num: number, i = 0, s = 1) =>\n+export const sqrt = (a: Vec, num = a.length, i = 0, s = 1) =>\nopg1(Math.sqrt, a, num, i, s);\n-export const pow = (a: Vec, b: ReadonlyVec, num: number, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+export const pow = (a: Vec, b: ReadonlyVec, num = a.length, ia = 0, ib = 0, sa = 1, sb = 1) =>\nopg2(Math.pow, a, b, num, ia, ib, sa, sb);\n-export const powN = (a: Vec, n: number, num: number, i = 0, s = 1) =>\n+export const powN = (a: Vec, n: number, num = a.length, i = 0, s = 1) =>\nopg1((x) => Math.pow(x, n), a, num, i, s);\n-export const min = (a: Vec, b: ReadonlyVec, num: number, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+export const min = (a: Vec, b: ReadonlyVec, num = a.length, ia = 0, ib = 0, sa = 1, sb = 1) =>\nopg2(Math.min, a, b, num, ia, ib, sa, sb);\n-export const max = (a: Vec, b: ReadonlyVec, num: number, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+export const max = (a: Vec, b: ReadonlyVec, num = a.length, ia = 0, ib = 0, sa = 1, sb = 1) =>\nopg2(Math.max, a, b, num, ia, ib, sa, sb);\n-export const clamp = (a: Vec, b: ReadonlyVec, c: ReadonlyVec, num: number, ia = 0, ib = 0, ic = 0, sa = 1, sb = 1, sc = 1) =>\n+export const clamp = (a: Vec, b: ReadonlyVec, c: ReadonlyVec, num = a.length, ia = 0, ib = 0, ic = 0, sa = 1, sb = 1, sc = 1) =>\nopg3(clamp1, a, b, c, num, ia, ib, ic, sa, sb, sc);\n-export const step = (a: Vec, b: ReadonlyVec, num: number, ia = 0, ib = 0, sa = 1, sb = 1) =>\n+export const step = (a: Vec, b: ReadonlyVec, num = a.length, ia = 0, ib = 0, sa = 1, sb = 1) =>\nopg2((x, e) => step1(e, x), a, b, num, ia, ib, sa, sb);\n-export const smoothStep = (a: Vec, b: ReadonlyVec, c: ReadonlyVec, num: number, ia = 0, ib = 0, ic = 0, sa = 1, sb = 1, sc = 1) =>\n+export const smoothStep = (a: Vec, b: ReadonlyVec, c: ReadonlyVec, num = a.length, ia = 0, ib = 0, ic = 0, sa = 1, sb = 1, sc = 1) =>\nopg3((x, e1, e2) => smoothStep1(e1, e2, x), a, b, c, num, ia, ib, ic, sa, sb, sc);\nexport class GVec implements\n",
"new_path": "packages/vectors/src/gvec.ts",
"old_path": "packages/vectors/src/gvec.ts"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | refactor(vectors): add gvec default length args | 1 | refactor | vectors |
679,913 | 29.07.2018 18:38:00 | -3,600 | 54b3db2d234fd7f217b1965d67adaace425e7cd8 | feat(vectors): update get & copy fns to retain buffer types | [
{
"change_type": "MODIFY",
"diff": "@@ -10,6 +10,9 @@ import {\nVec2\n} from \"./vec2\";\n+export const get23 = (a: Mat, i = 0) =>\n+ set23(new (<any>(a.constructor))(6), a, 0, i);\n+\nexport const set23 = (a: Mat, b: Mat, ia = 0, ib = 0) => (\na[ia] = b[ib],\na[ia + 1] = b[ib + 1],\n@@ -217,7 +220,7 @@ export class Mat23 implements\n}\ncopy() {\n- return new Mat23(set23([], this.buf, 0, this.i));\n+ return new Mat23(get23(this.buf, this.i));\n}\neqDelta(m: Mat23, eps = EPS) {\n",
"new_path": "packages/vectors/src/mat23.ts",
"old_path": "packages/vectors/src/mat23.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -11,6 +11,9 @@ import {\n} from \"./vec3\";\nimport { setS4 } from \"./vec4\";\n+export const get33 = (a: Mat, i = 0) =>\n+ set33(new (<any>(a.constructor))(9), a, 0, i);\n+\nexport const set33 = (a: Mat, b: Mat, ia = 0, ib = 0) => (\na[ia] = b[ib],\na[ia + 1] = b[ib + 1],\n@@ -251,7 +254,7 @@ export class Mat33 implements\n}\ncopy() {\n- return new Mat33(set33([], this.buf, 0, this.i));\n+ return new Mat33(get33(this.buf, this.i));\n}\neqDelta(m: Mat33, eps = EPS) {\n",
"new_path": "packages/vectors/src/mat33.ts",
"old_path": "packages/vectors/src/mat33.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -16,6 +16,9 @@ import {\n} from \"./vec3\";\nimport { dot4, setS4, Vec4 } from \"./vec4\";\n+export const get44 = (a: Mat, i = 0) =>\n+ set44(new (<any>(a.constructor))(16), a, 0, i);\n+\nexport const set44 = (a: Mat, b: Mat, ia = 0, ib = 0) => {\nfor (let i = 0; i < 16; i++) {\na[ia + i] = b[ib + i];\n@@ -441,7 +444,7 @@ export class Mat44 implements\n}\ncopy() {\n- return new Mat44(set44([], this.buf, 0, this.i));\n+ return new Mat44(get44(this.buf, this.i));\n}\neqDelta(m: Mat44, eps = EPS) {\n",
"new_path": "packages/vectors/src/mat44.ts",
"old_path": "packages/vectors/src/mat44.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -22,8 +22,12 @@ export const op22 = (fn: (a: number, b: number) => number, a: Vec, b: ReadonlyVe\na\n);\n-export const get2 = (a: ReadonlyVec, ia = 0, sa = 1) =>\n- [a[ia], a[ia + sa]];\n+export const get2 = (a: ReadonlyVec, ia = 0, sa = 1) => {\n+ const res = new (<any>(a.constructor))(2);\n+ res[0] = a[ia];\n+ res[1] = a[ia + sa];\n+ return res;\n+};\nexport const set2 = (a: Vec, b: ReadonlyVec, ia = 0, ib = 0, sa = 1, sb = 1) =>\n(a[ia] = b[ib], a[ia + sa] = b[ib + sb], a);\n",
"new_path": "packages/vectors/src/vec2.ts",
"old_path": "packages/vectors/src/vec2.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -29,8 +29,13 @@ export const op32 = (fn: (a: number, b: number) => number, a: Vec, b: ReadonlyVe\na\n);\n-export const get3 = (a: ReadonlyVec, ia = 0, sa = 1) =>\n- [a[ia], a[ia + sa], a[ia + 2 * sa]];\n+export const get3 = (a: ReadonlyVec, ia = 0, sa = 1) => {\n+ const res = new (<any>(a.constructor))(3);\n+ res[0] = a[ia];\n+ res[1] = a[ia + sa];\n+ res[2] = a[ia + 2 * sa];\n+ return res;\n+};\nexport const set3 = (a: Vec, b: ReadonlyVec, ia = 0, ib = 0, sa = 1, sb = 1) => (\na[ia] = b[ib],\n",
"new_path": "packages/vectors/src/vec3.ts",
"old_path": "packages/vectors/src/vec3.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -28,8 +28,14 @@ export const op42 = (fn: (a: number, b: number) => number, a: Vec, b: ReadonlyVe\na\n);\n-export const get4 = (a: ReadonlyVec, ia = 0, sa = 1) =>\n- [a[ia], a[ia + sa], a[ia + 2 * sa], a[ia + 3 * sa]];\n+export const get4 = (a: ReadonlyVec, ia = 0, sa = 1) => {\n+ const res = new (<any>(a.constructor))(4);\n+ res[0] = a[ia];\n+ res[1] = a[ia + sa];\n+ res[2] = a[ia + 2 * sa];\n+ res[3] = a[ia + 3 * sa];\n+ return res;\n+};\nexport const set4 = (a: Vec, b: ReadonlyVec, ia = 0, ib = 0, sa = 1, sb = 1) => (\na[ia] = b[ib],\n",
"new_path": "packages/vectors/src/vec4.ts",
"old_path": "packages/vectors/src/vec4.ts"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | feat(vectors): update get & copy fns to retain buffer types | 1 | feat | vectors |
679,913 | 29.07.2018 18:39:01 | -3,600 | d2bdf79ec38b54cad33b14be5e7042da14d739a3 | refactor(vector): update eqDelta impls, rename array transformers | [
{
"change_type": "MODIFY",
"diff": "@@ -7,18 +7,32 @@ export const z = (v: ReadonlyVec, i = 0, s = 1) => v[i + 2 * s];\nexport const w = (v: ReadonlyVec, i = 0, s = 1) => v[i + 3 * s];\n/**\n+ * Applies vector op `fn` to all raw vectors in array `a`, using raw\n+ * vector `b` as 2nd argument for each iteration. Assumes `fn` writes\n+ * results back into `a` and no copying is performed.\n+ *\n+ * ```\n+ * transformVectors1(\n+ * v.add3,\n+ * [1, 2, 3, 0, 4, 5, 6, 0],\n+ * [10, 20, 30],\n+ * 2, 0, 0, 1, 1, 4\n+ * )\n+ * // [ 11, 22, 33, 0, 14, 25, 36, 0 ]\n+ * ```\n+ *\n* @param fn op\n* @param a array to process\n* @param b vector operand\n- * @param n num elements\n+ * @param num num elements\n* @param ia start index `a`\n* @param ib start index `b`\n* @param csa component stride `a`\n* @param csb component stride `b`\n* @param esa element stride `a`\n*/\n-export const sliceOp1 = (fn: VecOp, a: Vec, b: ReadonlyVec, n: number, ia: number, ib: number, csa: number, csb: number, esa: number) => {\n- for (let i = ia; n > 0; n-- , i += esa) {\n+export const transformVectors1 = (fn: VecOp, a: Vec, b: ReadonlyVec, num: number, ia: number, ib: number, csa: number, csb: number, esa: number) => {\n+ for (let i = ia; num > 0; num-- , i += esa) {\nfn(a, b, i, ib, csa, csb);\n}\nreturn a;\n@@ -36,7 +50,7 @@ export const sliceOp1 = (fn: VecOp, a: Vec, b: ReadonlyVec, n: number, ia: numbe\n* @param esa\n* @param esb\n*/\n-export const sliceOpN = (fn: VecOp, a: Vec, b: ReadonlyVec, n: number, ia: number, ib: number, csa: number, csb: number, esa: number, esb: number) => {\n+export const transformVectors2 = (fn: VecOp, a: Vec, b: ReadonlyVec, n: number, ia: number, ib: number, csa: number, csb: number, esa: number, esb: number) => {\nfor (let i = ia, j = ib; n > 0; n-- , i += esa, j += esb) {\nfn(a, b, i, j, csa, csb);\n}\n@@ -44,6 +58,7 @@ export const sliceOpN = (fn: VecOp, a: Vec, b: ReadonlyVec, n: number, ia: numbe\n};\nexport const eqDelta = (a: Vec, b: Vec, n: number, eps = EPS, ia = 0, ib = 0, sa = 1, sb = 1) => {\n+ if (a === b) return true;\nfor (; --n >= 0; ia += sa, ib += sb) {\nif (!eqDelta1(a[ia], b[ib], eps)) {\nreturn false;\n",
"new_path": "packages/vectors/src/common.ts",
"old_path": "packages/vectors/src/common.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -39,7 +39,7 @@ export const rad = (x: number) => x * DEG2RAD;\n*/\nexport const eqDelta1 = (a: number, b: number, eps = EPS) => {\nconst d = a - b;\n- return (d * d) <= (eps * eps);\n+ return (d < 0 ? -d : d) <= eps;\n};\n/**\n",
"new_path": "packages/vectors/src/math.ts",
"old_path": "packages/vectors/src/math.ts"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | refactor(vector): update eqDelta impls, rename array transformers | 1 | refactor | vector |
679,913 | 29.07.2018 18:39:25 | -3,600 | 6571b8a3c89bc684412052baa62682adb2f363cc | test(vectors): add gvec tests | [
{
"change_type": "ADD",
"diff": "+import * as assert from \"assert\";\n+import * as v from \"../src/index\";\n+\n+describe(\"gvec\", () => {\n+\n+ const op2 = (fn, x, y, z, w) => {\n+ assert.deepEqual(\n+ fn([1, 2, 3, 4], [10, 20, 30, 40], 4),\n+ [x, y, z, w]\n+ );\n+ assert.deepEqual(\n+ fn([0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0], [0, 10, 0, 20, 0, 30, 0, 40, 0], 4, 1, 1, 4, 2),\n+ [0, x, 0, 0, 0, y, 0, 0, 0, z, 0, 0, 0, w, 0, 0]\n+ );\n+ };\n+\n+ const opn = (fn, x, y, z, w) => {\n+ assert.deepEqual(\n+ fn([1, 2, 3, 4], 10, 4),\n+ [x, y, z, w]\n+ );\n+ assert.deepEqual(\n+ fn([0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0], 10, 4, 1, 4),\n+ [0, x, 0, 0, 0, y, 0, 0, 0, z, 0, 0, 0, w, 0, 0]\n+ );\n+ };\n+\n+ it(\"add\", () => op2(v.add, 11, 22, 33, 44));\n+ it(\"sub\", () => op2(v.sub, -9, -18, -27, -36));\n+ it(\"mul\", () => op2(v.mul, 10, 40, 90, 160));\n+ it(\"div\", () => op2(v.div, 0.1, 0.1, 0.1, 0.1));\n+\n+ it(\"addn\", () => opn(v.addN, 11, 12, 13, 14));\n+ it(\"subn\", () => opn(v.subN, -9, -8, -7, -6));\n+ it(\"muln\", () => opn(v.mulN, 10, 20, 30, 40));\n+ it(\"divn\", () => opn(v.divN, 0.1, 0.2, 0.3, 0.4));\n+\n+ it(\"madd\", () => {\n+ assert.deepEqual(\n+ v.madd([1, 2, 3, 4], [10, 20, 30, 40], [0.5, 0.25, 0.75, 0.125], 4),\n+ [1 + 10 * 0.5, 2 + 20 * 0.25, 3 + 30 * 0.75, 4 + 40 * 0.125]\n+ );\n+ assert.deepEqual(\n+ v.madd([1, 2, 3, 4], [10, 0, 20, 0, 30, 0, 40], [0.5, 0, 0, 0.25, 0, 0, 0.75, 0, 0, 0.125], 4, 0, 0, 0, 1, 2, 3),\n+ [1 + 10 * 0.5, 2 + 20 * 0.25, 3 + 30 * 0.75, 4 + 40 * 0.125]\n+ );\n+ });\n+\n+ it(\"maddn\", () => {\n+ assert.deepEqual(\n+ v.maddN([1, 2, 3, 4], [10, 20, 30, 40], 0.5, 4),\n+ [1 + 10 * 0.5, 2 + 20 * 0.5, 3 + 30 * 0.5, 4 + 40 * 0.5]\n+ );\n+ assert.deepEqual(\n+ v.maddN([1, 2, 3, 4], [10, 0, 20, 0, 30, 0, 40], 0.5, 4, 0, 0, 1, 2),\n+ [1 + 10 * 0.5, 2 + 20 * 0.5, 3 + 30 * 0.5, 4 + 40 * 0.5]\n+ );\n+ });\n+\n+ it(\"eqdelta\", () => {\n+ assert(v.eqDelta([0, 1.001, 0, 1.999, 0, 3.0099, 0, 3.991], [1, 2, 3, 4], 4, 0.01, 1, 0, 2, 1));\n+ assert(!v.eqDelta([0, 1.001, 0, 1.999, 0, 3.02, 0, 4], [1, 2, 3, 4], 4, 0.01, 1, 0, 2, 1));\n+ });\n+});\n",
"new_path": "packages/vectors/test/gvec.ts",
"old_path": null
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | test(vectors): add gvec tests | 1 | test | vectors |
217,927 | 29.07.2018 20:29:11 | 0 | 18f21055cb56014da61192968046e8b7bdf42564 | refactor: crafting cost
Simplifies the logic for calculating the crafting cost now that the form
guarantees the sum of the NQ and HQ amounts is equal to the total
required amount. | [
{
"change_type": "MODIFY",
"diff": "@@ -70,7 +70,7 @@ export class PricingComponent {\n}\n/**\n- * Gets the minimum crafting cost of a given item.\n+ * Gets the crafting cost of a given item.\n* @param {ListRow} row\n* @returns {number}\n*/\n@@ -83,26 +83,7 @@ export class PricingComponent {\n}\nconst price = this.pricingService.getPrice(listRow);\nconst amount = this.pricingService.getAmount(this.list.$key, listRow);\n- // We're gona get the lowest possible price.\n- let needed = row.amount_needed * requirement.amount;\n- // First of all, we get the maximum of nq items;\n- if (needed <= amount.nq) {\n- total += needed * price.nq;\n- } else {\n- // If we don't have enough nq items, we take what we already have.\n- total += amount.nq * price.nq;\n- needed -= amount.nq;\n- // Then we check for hq items\n- if (needed <= amount.hq) {\n- // If we have enough of them, we can simply add them\n- total += needed * price.hq;\n- } else {\n- // Else, we assume that the crafter already has some items in his inventory,\n- // that's why he didn't add them in the pricing.\n- // So we'll assume the remaining items are free.\n- total += amount.hq * price.hq;\n- }\n- }\n+ total += amount.nq * price.nq + amount.hq * price.hq;\n});\nreturn total;\n}\n",
"new_path": "src/app/modules/pricing/pricing/pricing.component.ts",
"old_path": "src/app/modules/pricing/pricing/pricing.component.ts"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | refactor: crafting cost
Simplifies the logic for calculating the crafting cost now that the form
guarantees the sum of the NQ and HQ amounts is equal to the total
required amount. | 1 | refactor | null |
679,913 | 29.07.2018 21:13:29 | -3,600 | ae1da134bc989082779c84dfb6019f73843ec16b | docs(vectors): update readme & package info | [
{
"change_type": "MODIFY",
"diff": "@@ -13,7 +13,7 @@ This project is part of the\n- [Installation](#installation)\n- [Usage examples](#usage-examples)\n- [Basics](#basics)\n- - [Interleaved vectors in large buffer](#interleaved-vectors-in-large-buffer)\n+ - [Vector classes & interleaved vectors in large buffer](#vector-classes--interleaved-vectors-in-large-buffer)\n- [Image RGB grayscale conversion](#image-rgb-grayscale-conversion)\n- [Authors](#authors)\n- [License](#license)\n@@ -24,20 +24,35 @@ This project is part of the\nThis package provides vector and matrix operations as plain functions\nand class wrappers with fluid interface. All functions support any array\n-/ typed array storage, incl. mapped views of larger buffers (e.g. for WebGL / WASM interop, pixel buffers). Additionally, vectors support flexible data layouts,\n-incl. [AOS / SOA](https://en.wikipedia.org/wiki/AOS_and_SOA), striped /\n-interleaved etc.\n+/ typed array storage, incl. mapped views of larger buffers (e.g. for\n+WebGL / WASM interop, pixel buffers). Additionally, vectors support\n+flexible data layouts, incl. [AOS /\n+SOA](https://en.wikipedia.org/wiki/AOS_and_SOA), striped, interleaved,\n+aligned etc.\n### Vectors\nIn addition to [arbitrary sized\nvectors](https://github.com/thi-ng/umbrella/tree/master/packages/vectors/src/gvec.ts),\n-the library provides these optimized versions:\n+the library provides these optimized fixed-sized versions:\n- [Vec2](https://github.com/thi-ng/umbrella/tree/master/packages/vectors/src/vec2.ts)\n- [Vec3](https://github.com/thi-ng/umbrella/tree/master/packages/vectors/src/vec3.ts)\n- [Vec4](https://github.com/thi-ng/umbrella/tree/master/packages/vectors/src/vec4.ts)\n+#### Supported operations\n+\n+Note: Most functions are provided in different (optimized) versions,\n+depending on vector size. E.g. `add` performs vector addition for\n+arbitrary sizes, `add2` for 2D vectors, `add3` for 3D, `add4` for 4D...\n+\n+All vector operations (regardless of size) operate on any array-like\n+buffer and accept optional start indices and component strides (number\n+of elements (+1) between individual vector components). This allows for\n+zero-copy vector operations on sections of larger buffers. See examples\n+below and\n+[tests](https://github.com/thi-ng/umbrella/tree/master/packages/vectors/test/).\n+\n### Matrices\n- [Mat23](https://github.com/thi-ng/umbrella/tree/master/packages/vectors/src/mat23.ts)\n@@ -61,10 +76,39 @@ import * as v from \"@thi.ng/vectors\";\nv.add4([1, 2, 3, 4], [10, 20, 30, 40]);\n// [ 11, 22, 33, 44 ]\n+// with custom layout\n+// here 3x 3D vectors in SOA layout:\n+// [x, x, x, y, y, y, z, z, z]\n+points = [1, 4, 7, 2, 5, 8, 3, 6, 9];\n+\n+// specify start indices and stride lengths\n+// update 1st vector\n+v.add3(points, [100, 200, 300], 0, 0, 3, 1);\n+// [ 101, 4, 7, 202, 5, 8, 303, 6, 9 ]\n+\n+// update 2nd vector\n+v.add3(points, [100, 200, 300], 1, 0, 3, 1);\n+// [ 101, 104, 7, 202, 205, 8, 303, 306, 9 ]\n+\n+// update 3rd vector\n+v.add3(points, [100, 200, 300], 2, 0, 3, 1);\n+// [ 101, 104, 107, 202, 205, 208, 303, 306, 309 ]\n+\n+// add 1st and 3rd vector and extract result\n+v.get3(v.add3(points, points, 0, 2, 3, 3), 0, 3);\n+// [ 208, 410, 612 ]\n+\n// re-arrange vector components into new vector\n+// the last 4 args define component order:\n+\n+// YXWZ\nv.swizzle4([], [10, 20, 30, 40], 1, 0, 3, 2);\n// [ 20, 10, 40, 30 ]\n+// XXZZ\n+v.swizzle4([], [10, 20, 30, 40], 0, 0, 2, 2);\n+// [ 10, 10, 30, 30 ]\n+\n// arbitrary length vectors\nnorm = v.normalize([1, 2, 3, 4, 5, 6, 7, 8, 6, 4]);\n// [ 0.0625, 0.125, 0.1875, 0.25, 0.3125, 0.375, 0.4375, 0.5, 0.375, 0.25 ]\n@@ -73,7 +117,7 @@ v.mag(norm);\n// 1\n```\n-### Interleaved vectors in large buffer\n+### Vector classes & interleaved vectors in large buffer\n```ts\n// element stride 3 + 2 + 4 = 9\n@@ -85,7 +129,7 @@ buf = [\n0,100,0, 0,1, 0,1,1,1,\n];\n-// create memory mapped vector instances\n+// create memory mapped vector instances (using Vec3 class)\npos = v.Vec3.mapBuffer(buf, 4, 0, 1, 9); // offset = 0\nuv = v.Vec2.mapBuffer(buf, 4, 3, 1, 9); // offset = 3\ncol = v.Vec4.mapBuffer(buf, 4, 5, 1, 9); // offset = 5\n",
"new_path": "packages/vectors/README.md",
"old_path": "packages/vectors/README.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@thi.ng/vectors\",\n\"version\": \"0.0.1\",\n- \"description\": \"TODO\",\n+ \"description\": \"Vector algebra for fixed & variable sizes, memory mapped, flexible layouts\",\n\"main\": \"./index.js\",\n\"typings\": \"./index.d.ts\",\n\"repository\": {\n},\n\"keywords\": [\n\"ES6\",\n- \"typescript\"\n+ \"matrix\",\n+ \"memory mapped\",\n+ \"typescript\",\n+ \"webgl\",\n+ \"wasm\",\n+ \"vector algebra\"\n],\n\"publishConfig\": {\n\"access\": \"public\"\n",
"new_path": "packages/vectors/package.json",
"old_path": "packages/vectors/package.json"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | docs(vectors): update readme & package info | 1 | docs | vectors |
679,913 | 30.07.2018 00:32:11 | -3,600 | 3de5cea494f45e380c3e8db4f4a83b81e0830ba4 | fix(vectors): naming convention, add function overview tables | [
{
"change_type": "MODIFY",
"diff": "@@ -49,16 +49,103 @@ arbitrary sizes, `add2` for 2D vectors, `add3` for 3D, `add4` for 4D...\nAll vector operations (regardless of size) operate on any array-like\nbuffer and accept optional start indices and component strides (number\nof elements (+1) between individual vector components). This allows for\n-zero-copy vector operations on sections of larger buffers. See examples\n-below and\n+zero-copy vector operations on sections of larger buffers. The default\n+start index is 0, default stride 1. See examples below and\n[tests](https://github.com/thi-ng/umbrella/tree/master/packages/vectors/test/).\n+| Operation | GVec | Vec2 | Vec3 | Vec4 |\n+|---------------------------------|--------------|------------------|------------------|------------------|\n+| Get vector (dense copy) | `get` | `get2` | `get3` | `get4` |\n+| Set vector components (vector) | `set` | `set2` | `set3` | `set4` |\n+| Set vector components (uniform) | `setN` | `setN2` | `setN3` | `setN4` |\n+| Set vector components (scalars) | | `setS2` | `setS3` | `setS4` |\n+| Swizzle vector components | | `swizzle2` | `swizzle3` | `swizzle4` |\n+| Equality (w/ epsilon) | `eqDelta` | `eqDelta2` | `eqDelta3` | `eqDelta4` |\n+| Vector addition | `add` | `add2` | `add3` | `add4` |\n+| Vector subtraction | `sub` | `sub2` | `sub3` | `sub4` |\n+| Vector multiplication | `mul` | `mul2` | `mul3` | `mul4` |\n+| Vector division | `div` | `div2` | `div3` | `div4` |\n+| Uniform scalar addition | `addN` | `addN2` | `addN3` | `addN4` |\n+| Uniform scalar subtraction | `subN` | `subN2` | `subN3` | `subN4` |\n+| Uniform scalar multiply | `mulN` | `mulN2` | `mulN3` | `mulN4` |\n+| Uniform scalar multiply | `divN` | `divN2` | `divN3` | `divN4` |\n+| Vector negation | `neg` | `neg2` | `neg3` | `neg4` |\n+| Multiply-add vectors | `madd` | `madd2` | `madd3` | `madd4` |\n+| Multiply-add scalar | `maddN` | `maddN2` | `maddN3` | `maddN4` |\n+| Linear interpolation (vector) | `mix` | `mix2` | `mix3` | `mix4` |\n+| Linear interpolation (uniform) | `mixN` | `mixN2` | `mixN3` | `mixN4` |\n+| Dot product | `dot` | `dot2` | `dot3` | `dot4` |\n+| Cross product | | `cross2` | `cross3` | |\n+| Magnitude | `mag` | `mag2` | `mag3` | `mag4` |\n+| Magnitude (squared) | `magSq` | `magSq2` | `magSq3` | `magSq4` |\n+| Normalize (w/ opt length) | `normalize` | `normalize2` | `normalize3` | `normalize4` |\n+| Limit to length | | `limit2` | `limit3` | `limit4` |\n+| Distance | `dist` | `dist2` | `dist3` | `dist4` |\n+| Distance (squared) | `distSq` | `distSq2` | `distSq3` | `distSq4` |\n+| Manhattan distance | | `distManhattan2` | `distManhattan3` | `distManhattan4` |\n+| Chebyshev distance | | `distChebyshev2` | `distChebyshev3` | `distChebyshev4` |\n+| Reflection | | `reflect2` | `reflect3` | `reflect4` |\n+| RotationX | | | `rotateX3` | |\n+| RotationY | | | `rotateY3` | |\n+| RotationZ | | `rotate2` | `rotateZ3` | |\n+| Heading XY | | `heading2` | `headingXY3` | |\n+| Heading XZ | | | `headingXZ3` | |\n+| Heading YZ | | | `headingYZ3` | |\n+| Cartesian -> Polar | | `toPolar2` | `toSpherical3` | |\n+| Polar -> Cartesian | | `toCartesian2` | `toCartesian3` | |\n+| Minor axis | | `minorAxis2` | `minorAxis3` | `minorAxis4` |\n+| Major axis | | `majorAxis2` | `majorAxis3` | `majorAxis4` |\n+| Minimum | `min` | `min2` | `min3` | `min4` |\n+| Maximum | `max` | `max2` | `max3` | `max4` |\n+| Range clamping | `clamp` | `clamp2` | `clamp3` | `clamp4` |\n+| Step (like GLSL) | `step` | `step2` | `step3` | `step4` |\n+| SmoothStep (like GLSL) | `smoothStep` | `smoothStep2` | `smoothStep3` | `smoothStep4` |\n+| Absolute value | `abs` | `abs2` | `abs3` | `abs4` |\n+| Sign (w/ opt epsilon) | `sign` | `sign2` | `sign3` | `sign4` |\n+| Round down | `floor` | `floor2` | `floor3` | `floor4` |\n+| Round up | `ceil` | `ceil2` | `ceil3` | `ceil4` |\n+| Square root | `sqrt` | `sqrt2` | `sqrt3` | `sqrt4` |\n+| Power (vector) | `pow` | `pow2` | `pow3` | `pow4` |\n+| Power (uniform) | `powN` | `powN2` | `powN3` | `powN4` |\n+\n### Matrices\n+All matrix types are in WebGL layout (column major) and densely packed (stride always 1).\n+\n- [Mat23](https://github.com/thi-ng/umbrella/tree/master/packages/vectors/src/mat23.ts)\n- [Mat33](https://github.com/thi-ng/umbrella/tree/master/packages/vectors/src/mat33.ts)\n- [Mat44](https://github.com/thi-ng/umbrella/tree/master/packages/vectors/src/mat44.ts)\n+| Operation | Mat23 | Mat33 | Mat44 |\n+|-------------------------------------|-------------------------|---------------|---------------------|\n+| Set identity | `identity23` | `identity33` | `identity44` |\n+| Get matrix components (dense copy) | `get23` | `get33` | `get44` |\n+| Set matrix components (matrix) | `set23` | `set33` | `set44` |\n+| Set matrix components (scalars) | `setS23` | `setS33` | `setS44` |\n+| Create rotation matrix | | `rotationX33` | `rotationX44` |\n+| | | `rotationY33` | `rotationY44` |\n+| | `rotation23` | `rotationZ33` | `rotationZ44` |\n+| | `rotationAroundPoint23` | | |\n+| Create scale matrix (vector) | `scaleV23` | `scaleV33` | `scaleV44` |\n+| Create scale matrix (uniform) | `scaleN23` | `scaleN33` | `scaleN44` |\n+| Create scale matrix (scalars) | `scaleS23` | `scaleS33` | `scaleS44` |\n+| | `scaleWithCenter23` | | `scaleWithCenter44` |\n+| Create translation matrix (vector) | `translationV23` | | `translationV44` |\n+| Create translation matrix (scalars) | `translationS23` | | `translationS44` |\n+| Create skew matrix | `skewX23` / `shearX23` | | |\n+| | `skewY23` / `shearY23` | | |\n+| Create projection matrix | | | `projection` |\n+| | | | `ortho` |\n+| | | | `frustum` |\n+| Create camera matrix | | | `lookAt` |\n+| Matrix multiply | `mul23` | `mul33` | `mul44` |\n+| Matrix concatenation (multiple) | `concat23` | `concat33` | `concat44` |\n+| Matrix vector multiply | `mulV23` | `mulV33` | `mulV44` (Vec4) |\n+| | | | `mulV344` (Vec3) |\n+| Determinant | `det23` | `det33` | `det44` |\n+| Matrix inversion | `invert23` | `invert33` | `invert44` |\n+| Matrix transpose | | `transpose33` | `transpose44` |\n+\n## Installation\n```bash\n",
"new_path": "packages/vectors/README.md",
"old_path": "packages/vectors/README.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -203,7 +203,7 @@ export const rotate2 = (a: Vec, theta: number, ia = 0, sa = 1) => {\nexport const heading2 = (a: ReadonlyVec, ia = 0, sa = 1) =>\natan2Abs(a[ia + sa], a[ia]);\n-export const toPolar = (a: Vec, ia = 0, sa = 1) => {\n+export const toPolar2 = (a: Vec, ia = 0, sa = 1) => {\nconst x = a[ia], y = a[ia + sa];\nreturn setS2(a, Math.sqrt(x * x + y * y), atan2Abs(y, x), ia, sa);\n};\n@@ -218,10 +218,10 @@ export const toCartesian2 = (a: Vec, b: ReadonlyVec = ZERO2, ia = 0, ib = 0, sa\n);\n};\n-export const minor2 = (a: Vec, ia = 0, sa = 1) =>\n+export const minorAxis2 = (a: Vec, ia = 0, sa = 1) =>\nmin2id(Math.abs(a[ia]), Math.abs(a[ia + sa]));\n-export const major2 = (a: Vec, ia = 0, sa = 1) =>\n+export const majorAxis2 = (a: Vec, ia = 0, sa = 1) =>\nmax2id(Math.abs(a[ia]), Math.abs(a[ia + sa]));\nexport const vec2 = (x = 0, y = 0) =>\n@@ -442,11 +442,11 @@ export class Vec2 implements\n}\nminorAxis() {\n- return minor2(this.buf, this.i, this.s);\n+ return minorAxis2(this.buf, this.i, this.s);\n}\nmajorAxis() {\n- return major2(this.buf, this.i, this.s);\n+ return majorAxis2(this.buf, this.i, this.s);\n}\nstep(e: Readonly<Vec2>) {\n@@ -516,7 +516,7 @@ export class Vec2 implements\n}\ntoPolar() {\n- toPolar(this.buf, this.i, this.s);\n+ toPolar2(this.buf, this.i, this.s);\nreturn this;\n}\n",
"new_path": "packages/vectors/src/vec2.ts",
"old_path": "packages/vectors/src/vec2.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -298,10 +298,10 @@ export const toCartesian3 = (a: Vec, b: ReadonlyVec = ZERO3, ia = 0, ib = 0, sa\n);\n};\n-export const minor3 = (a: Vec, ia = 0, sa = 1) =>\n+export const minorAxis3 = (a: Vec, ia = 0, sa = 1) =>\nmin3id(Math.abs(a[ia]), Math.abs(a[ia + sa]), Math.abs(a[ia + 2 * sa]));\n-export const major3 = (a: Vec, ia = 0, sa = 1) =>\n+export const majorAxis3 = (a: Vec, ia = 0, sa = 1) =>\nmax3id(Math.abs(a[ia]), Math.abs(a[ia + sa]), Math.abs(a[ia + 2 * sa]));\nexport const vec3 = (x = 0, y = 0, z = 0) =>\n@@ -535,11 +535,11 @@ export class Vec3 implements\n}\nminorAxis() {\n- return minor3(this.buf, this.i, this.s);\n+ return minorAxis3(this.buf, this.i, this.s);\n}\nmajorAxis() {\n- return major3(this.buf, this.i, this.s);\n+ return majorAxis3(this.buf, this.i, this.s);\n}\nstep(e: Readonly<Vec3>) {\n",
"new_path": "packages/vectors/src/vec3.ts",
"old_path": "packages/vectors/src/vec3.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -267,10 +267,10 @@ export const limit4 = (a: Vec, n: number, ia = 0, sa = 1) => {\nexport const reflect4 = (a: Vec, b: ReadonlyVec, ia = 0, ib = 0, sa = 1, sb = 1) =>\nmaddN4(a, b, -2 * dot4(a, b, ia, ib, sa, sb), ia, ib, sa, sb);\n-export const minor4 = (a: Vec, ia = 0, sa = 1) =>\n+export const minorAxis4 = (a: Vec, ia = 0, sa = 1) =>\nmin4id(Math.abs(a[ia]), Math.abs(a[ia + sa]), Math.abs(a[ia + 2 * sa]), Math.abs(a[ia + 3 * sa]));\n-export const major4 = (a: Vec, ia = 0, sa = 1) =>\n+export const majorAxis4 = (a: Vec, ia = 0, sa = 1) =>\nmax4id(Math.abs(a[ia]), Math.abs(a[ia + sa]), Math.abs(a[ia + 2 * sa]), Math.abs(a[ia + 3 * sa]));\nexport const vec4 = (x = 0, y = 0, z = 0, w = 0) =>\n@@ -509,11 +509,11 @@ export class Vec4 implements\n}\nminorAxis() {\n- return minor4(this.buf, this.i, this.s);\n+ return minorAxis4(this.buf, this.i, this.s);\n}\nmajorAxis() {\n- return major4(this.buf, this.i, this.s);\n+ return majorAxis4(this.buf, this.i, this.s);\n}\nstep(e: Readonly<Vec4>) {\n",
"new_path": "packages/vectors/src/vec4.ts",
"old_path": "packages/vectors/src/vec4.ts"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | fix(vectors): naming convention, add function overview tables | 1 | fix | vectors |
679,913 | 30.07.2018 04:02:31 | -3,600 | 3534274aba1186db27f2dde5ba882a7fb43b303f | fix(vectors): get*() return types, refactor using set*() | [
{
"change_type": "MODIFY",
"diff": "@@ -30,13 +30,8 @@ export const opg3 = (fn: (x: number, y: number, z: number) => number, a: Vec, b:\nreturn a;\n};\n-export const get = (a: ReadonlyVec, num = a.length, i = 0, s = 1) => {\n- const res = new (<any>(a.constructor))(num);\n- for (let j = 0; j < num; j++ , i += s) {\n- res[j] = a[i];\n- }\n- return res;\n-};\n+export const get = (a: ReadonlyVec, num = a.length, i = 0, s = 1) =>\n+ set(new (<any>(a.constructor))(num), a, 0, i, 1, s);\nexport const set = (a: Vec, b: ReadonlyVec, num = a.length, ia = 0, ib = 0, sa = 1, sb = 1) => {\nwhile (--num >= 0) {\n",
"new_path": "packages/vectors/src/gvec.ts",
"old_path": "packages/vectors/src/gvec.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -22,12 +22,8 @@ export const op22 = (fn: (a: number, b: number) => number, a: Vec, b: ReadonlyVe\na\n);\n-export const get2 = (a: ReadonlyVec, ia = 0, sa = 1) => {\n- const res = new (<any>(a.constructor))(2);\n- res[0] = a[ia];\n- res[1] = a[ia + sa];\n- return res;\n-};\n+export const get2 = (a: ReadonlyVec, ia = 0, sa = 1) =>\n+ set2(new (<any>(a.constructor))(2), a, 0, ia, 1, sa);\nexport const set2 = (a: Vec, b: ReadonlyVec, ia = 0, ib = 0, sa = 1, sb = 1) =>\n(a[ia] = b[ib], a[ia + sa] = b[ib + sb], a);\n",
"new_path": "packages/vectors/src/vec2.ts",
"old_path": "packages/vectors/src/vec2.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -29,13 +29,8 @@ export const op32 = (fn: (a: number, b: number) => number, a: Vec, b: ReadonlyVe\na\n);\n-export const get3 = (a: ReadonlyVec, ia = 0, sa = 1) => {\n- const res = new (<any>(a.constructor))(3);\n- res[0] = a[ia];\n- res[1] = a[ia + sa];\n- res[2] = a[ia + 2 * sa];\n- return res;\n-};\n+export const get3 = (a: ReadonlyVec, ia = 0, sa = 1) =>\n+ set3(new (<any>(a.constructor))(3), a, 0, ia, 1, sa);\nexport const set3 = (a: Vec, b: ReadonlyVec, ia = 0, ib = 0, sa = 1, sb = 1) => (\na[ia] = b[ib],\n",
"new_path": "packages/vectors/src/vec3.ts",
"old_path": "packages/vectors/src/vec3.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -28,14 +28,8 @@ export const op42 = (fn: (a: number, b: number) => number, a: Vec, b: ReadonlyVe\na\n);\n-export const get4 = (a: ReadonlyVec, ia = 0, sa = 1) => {\n- const res = new (<any>(a.constructor))(4);\n- res[0] = a[ia];\n- res[1] = a[ia + sa];\n- res[2] = a[ia + 2 * sa];\n- res[3] = a[ia + 3 * sa];\n- return res;\n-};\n+export const get4 = (a: ReadonlyVec, ia = 0, sa = 1) =>\n+ set4(new (<any>(a.constructor))(4), a, 0, ia, 1, sa);\nexport const set4 = (a: Vec, b: ReadonlyVec, ia = 0, ib = 0, sa = 1, sb = 1) => (\na[ia] = b[ib],\n",
"new_path": "packages/vectors/src/vec4.ts",
"old_path": "packages/vectors/src/vec4.ts"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | fix(vectors): get*() return types, refactor using set*() | 1 | fix | vectors |
730,413 | 30.07.2018 09:42:41 | 14,400 | f9a5ba402547ae725310f372036d373b2807c8bc | feat(widget-recents): use new avatar design | [
{
"change_type": "MODIFY",
"diff": "\"<rootDir>/src/\"\n],\n\"testPathIgnorePatterns\": [\"<rootDir>/node_modules/\"],\n+ \"testURL\": \"http://localhost\",\n\"transformIgnorePatterns\": [\"<rootDir>/node_modules/\"],\n\"moduleNameMapper\": {\n\"^.+\\\\.(css|less)$\": \"identity-obj-proxy\",\n",
"new_path": "jest.config.json",
"old_path": "jest.config.json"
},
{
"change_type": "MODIFY",
"diff": "},\n\"contributors\": [\n\"Adam Weeks <adweeks@cisco.com>\",\n- \"Bernie Zang <nzang@cisco.com>\"\n+ \"Bernie Zang <nzang@cisco.com>\",\n+ \"Moriah Maney <momaney@cisco.com>\"\n],\n\"license\": \"MIT\",\n\"bugs\": {\n\"@ciscospark/spark-core\": \"1.32.22\",\n\"@ciscospark/storage-adapter-local-forage\": \"1.32.22\",\n\"@ciscospark/storage-adapter-local-storage\": \"1.32.22\",\n+ \"@collab-ui/react\": \"^8.0.2\",\n\"ampersand-events\": \"^2.0.2\",\n\"classnames\": \"^2.2.5\",\n\"core-decorators\": \"^0.20.0\",\n\"minimist\": \"^1.2.0\",\n\"mkdirp\": \"^0.5.1\",\n\"mockdate\": \"^2.0.1\",\n+ \"node-sass\": \"^4.9.2\",\n\"npm-check-updates\": \"^2.12.1\",\n\"postcss\": \"^6.0.3\",\n\"postcss-cli\": \"^4.1.0\",\n\"react-transform-hmr\": \"^1.0.4\",\n\"redux-mock-store\": \"^1.2.1\",\n\"rimraf\": \"^2.5.4\",\n+ \"sass-loader\": \"^7.0.3\",\n\"saucelabs\": \"^1.4.0\",\n\"semver\": \"^5.4.1\",\n\"sleep-ms\": \"^2.0.1\",\n",
"new_path": "package.json",
"old_path": "package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -27,7 +27,7 @@ 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';\nimport CallDataActivityMessage from '@ciscospark/react-component-call-data-activity';\n-import SpacesList from '@ciscospark/react-component-spaces-list';\n+import SpacesList from '@webex/react-component-spaces-list';\nimport messages from './messages';\nimport getRecentsWidgetProps from './selector';\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": "ADD",
"diff": "+{\n+ \"name\": \"@webex/react-component-space-item\",\n+ \"description\": \"Webex Teams React Space Item\",\n+ \"main\": \"./cjs/index.js\",\n+ \"src\": \"./src/index.js\",\n+ \"module\": \"./es/index.js\",\n+ \"keywords\": [],\n+ \"contributors\": [\n+ \"Adam Weeks <adweeks@cisco.com>\",\n+ \"Bernie Zang <nzang@cisco.com>\",\n+ \"Moriah Maney <momaney@cisco.com\"\n+ ],\n+ \"license\": \"MIT\",\n+ \"repository\": \"https://github.com/webex/react-ciscospark\",\n+ \"files\": [\n+ \"src\",\n+ \"dist\",\n+ \"cjs\",\n+ \"es\"\n+ ]\n+}\n",
"new_path": "packages/node_modules/@webex/react-component-space-item/package.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+$brand-font-folder: \"~@collab-ui/core/fonts\";\n+$icon-font-path: \"~@collab-ui/icons/fonts\";\n+$images-path: \"~@collab-ui/core/images\";\n+$docs-images-path: '~@collab-ui/core/docs/assets';\n+\n+@import \"~@collab-ui/core/scss/components/avatar\";\n",
"new_path": "packages/node_modules/@webex/react-component-space-item/src/avatar.scss",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import React from 'react';\n+import PropTypes from 'prop-types';\n+import classNames from 'classnames';\n+\n+import {ICONS} from '@ciscospark/react-component-icon';\n+import Button from '@ciscospark/react-component-button';\n+import JoinCallButton from '@ciscospark/react-component-join-call-button';\n+\n+import {Avatar} from '@collab-ui/react';\n+\n+import styles from './styles.css';\n+import './avatar.scss';\n+\n+const propTypes = {\n+ active: PropTypes.bool,\n+ activityText: PropTypes.oneOfType([\n+ PropTypes.string,\n+ PropTypes.element\n+ ]),\n+ avatarUrl: PropTypes.string,\n+ callStartTime: PropTypes.number,\n+ hasCalling: PropTypes.bool,\n+ id: PropTypes.string,\n+ isDecrypting: PropTypes.bool,\n+ isUnread: PropTypes.bool,\n+ lastActivityTime: PropTypes.string,\n+ name: PropTypes.string,\n+ onCallClick: PropTypes.func,\n+ onClick: PropTypes.func,\n+ teamColor: PropTypes.string,\n+ teamName: PropTypes.string,\n+ type: PropTypes.string\n+};\n+\n+const defaultProps = {\n+ active: false,\n+ activityText: '',\n+ avatarUrl: '',\n+ callStartTime: undefined,\n+ hasCalling: false,\n+ id: '',\n+ isDecrypting: false,\n+ isUnread: false,\n+ lastActivityTime: '',\n+ name: '',\n+ onCallClick: () => {},\n+ onClick: () => {},\n+ teamColor: '',\n+ teamName: '',\n+ type: ''\n+};\n+\n+function SpaceItem({\n+ active,\n+ activityText,\n+ avatarUrl,\n+ callStartTime,\n+ hasCalling,\n+ id,\n+ isUnread,\n+ lastActivityTime,\n+ name,\n+ onClick,\n+ onCallClick,\n+ teamName,\n+ teamColor,\n+ type,\n+ isDecrypting\n+}) {\n+ function handleClick() {\n+ return onClick(id);\n+ }\n+\n+ function handleKeyDown(e) {\n+ // If there is a keypress is Enter key\n+ if (e.keyCode && e.keyCode === 13) {\n+ return onClick(id);\n+ }\n+ return false;\n+ }\n+\n+\n+ function handleCallClick(e) {\n+ if (type === 'direct' || hasCalling) {\n+ e.stopPropagation();\n+ return onCallClick(id);\n+ }\n+ return false;\n+ }\n+\n+ // Show hover call and join in progress buttons\n+ const hasCallSupport = hasCalling && typeof onCallClick === 'function';\n+\n+ return (\n+ <div\n+ className={classNames('space-item', styles.item, {\n+ [styles.hasCallSupport]: !!hasCallSupport,\n+ [styles.isDecrypting]: !!isDecrypting,\n+ [styles.active]: !!active\n+ })}\n+ onKeyDown={handleKeyDown}\n+ onMouseDown={handleClick}\n+ role=\"button\"\n+ tabIndex=\"0\"\n+ >\n+ {\n+ isUnread &&\n+ <div className={classNames('space-unread-indicator', styles.unreadIndicator)} />\n+ }\n+\n+ <div className={classNames('space-avatar-wrapper', styles.avatarWrapper)}>\n+ <Avatar\n+ title={name}\n+ backgroundColor={teamColor}\n+ type={type === 'group' ? 'group' : ''}\n+ src={avatarUrl}\n+ />\n+ </div>\n+\n+ <div className={classNames('space-item-meta', styles.meta)}>\n+ {\n+ teamName &&\n+ <div\n+ className={classNames('space-team-name', styles.teamName)}\n+ style={active ? {color: '#f5f5f5'} : teamColor && {color: teamColor}}\n+ >\n+ {teamName}\n+ </div>\n+ }\n+ <div className={classNames('space-title', styles.title, isUnread ? styles.isUnread : '')}>\n+ {name}\n+ </div>\n+ <div className={classNames('space-last-activity', styles.lastActivity)}>\n+ {activityText}\n+ </div>\n+ </div>\n+ {\n+ (!hasCallSupport || !callStartTime) &&\n+ <div className={classNames('space-last-activity-time', styles.timestamp)}>\n+ {lastActivityTime}\n+ </div>\n+ }\n+ {\n+ // Join call in progress\n+ hasCallSupport && callStartTime &&\n+ <div className={classNames('space-join-call', styles.joinCall)}>\n+ <JoinCallButton callStartTime={callStartTime} onJoinClick={handleCallClick} />\n+ </div>\n+ }\n+ {\n+ // Hover display of \"call\" button\n+ hasCallSupport && !callStartTime &&\n+ <div className={classNames('space-actions', styles.actions, styles.hoverReveal)}>\n+ <Button\n+ accessibilityLabel=\"Call Space\"\n+ buttonClassName={classNames(styles.actionButton, styles.callButton)}\n+ iconType={ICONS.ICON_TYPE_VIDEO_OUTLINE}\n+ onClick={handleCallClick}\n+ />\n+ </div>\n+ }\n+ </div>\n+ );\n+}\n+\n+SpaceItem.propTypes = propTypes;\n+SpaceItem.defaultProps = defaultProps;\n+\n+export default SpaceItem;\n",
"new_path": "packages/node_modules/@webex/react-component-space-item/src/index.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+.item {\n+ position: relative;\n+ display: flex;\n+ padding: 10px 8px 10px 24px;\n+ cursor: pointer;\n+ outline: none;\n+}\n+\n+.item.active {\n+ background-color: #07c1e4;\n+ color: #f5f5f5;\n+}\n+\n+.item:hover {\n+ background: #efefef;\n+}\n+\n+.item.active:hover {\n+ background-color: #07c1e4;\n+}\n+\n+.actions {\n+ position: absolute;\n+ top: 10px;\n+ right: 16px;\n+ z-index: 10;\n+ display: none;\n+}\n+\n+.item:hover .actions {\n+ display: block;\n+}\n+\n+.callButton {\n+ background-color: #30d557;\n+}\n+\n+.callButton:hover {\n+ background-color: #2ecc52;\n+}\n+\n+.actionButton {\n+ width: 38px;\n+ height: 38px;\n+ color: #fff;\n+ border-radius: 50%;\n+}\n+\n+.avatarWrapper {\n+ display: flex;\n+ align-items: center;\n+}\n+\n+.avatarWrapper > div > div {\n+ width: 38px;\n+ height: 38px;\n+}\n+\n+.avatarGroup {\n+ border: 2px solid #ccc;\n+ border-radius: 50%;\n+}\n+\n+.avatarWrapper .avatarGroup > div {\n+ width: 28px;\n+ height: 28px;\n+ margin: 3px;\n+}\n+\n+.unreadIndicator {\n+ position: absolute;\n+ top: 46%; /* A bit of a hack but visually looks good */\n+ left: 8px;\n+ width: 6px;\n+ height: 6px;\n+ background-color: #07c1e4;\n+ border-radius: 50%;\n+}\n+\n+.teamName {\n+ font-size: 10px;\n+ text-transform: uppercase;\n+}\n+\n+.title {\n+ overflow: hidden;\n+ font-size: 14px;\n+ color: #4f5051;\n+ text-overflow: ellipsis;\n+ white-space: nowrap;\n+}\n+\n+.active .title {\n+ color: #f5f5f5;\n+}\n+\n+.title.isUnread {\n+ font-weight: 300;\n+}\n+\n+.meta {\n+ width: 100%;\n+ padding: 0 50px 0 8px;\n+ overflow: hidden;\n+ flex: 1 1 auto;\n+}\n+\n+.lastActivity {\n+ height: 16px;\n+ overflow: hidden;\n+ font-size: 12px;\n+ color: #999;\n+ text-overflow: ellipsis;\n+ white-space: nowrap;\n+}\n+\n+.active .lastActivity {\n+ color: #f5f5f5;\n+}\n+\n+.timestamp {\n+ font-size: 10px;\n+ color: #999;\n+ white-space: nowrap;\n+}\n+\n+.active .timestamp {\n+ color: #f5f5f5;\n+}\n+\n+.hasCallSupport:hover .timestamp {\n+ display: none;\n+}\n+\n+@keyframes placeHolderShimmer {\n+ 0% {\n+ background-position: -468px 0;\n+ }\n+\n+ 100% {\n+ background-position: 468px 0;\n+ }\n+}\n+\n+.isDecrypting .avatarWrapper,\n+.isDecrypting .teamName,\n+.isDecrypting .title,\n+.isDecrypting .timestamp,\n+.isDecrypting .lastActivity {\n+ position: relative;\n+ margin-bottom: 5px;\n+ line-height: 12px;\n+ color: transparent !important; /* stylelint-disable-line declaration-no-important */\n+ background: #efefef;\n+ background: linear-gradient(to right, #e0e0e0 0%, #ccc 12%, #e0e0e0 30%);\n+ background-size: 800px 104px;\n+ animation-duration: 1.5s;\n+ animation-iteration-count: infinite;\n+ animation-name: placeHolderShimmer;\n+ animation-timing-function: linear;\n+ animation-fill-mode: forwards;\n+}\n+\n+.isDecrypting .avatarGroup {\n+ visibility: hidden;\n+}\n",
"new_path": "packages/node_modules/@webex/react-component-space-item/src/styles.css",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"@webex/react-component-spaces-list\",\n+ \"description\": \"Webex Teams React Spaces List\",\n+ \"main\": \"./cjs/index.js\",\n+ \"src\": \"./src/index.js\",\n+ \"module\": \"./es/index.js\",\n+ \"keywords\": [],\n+ \"contributors\": [\n+ \"Adam Weeks <adweeks@cisco.com>\",\n+ \"Bernie Zang <nzang@cisco.com>\",\n+ \"Moriah Maney <momaney@cisco.com\"\n+ ],\n+ \"license\": \"MIT\",\n+ \"repository\": \"https://github.com/webex/react-ciscospark\",\n+ \"files\": [\n+ \"src\",\n+ \"dist\",\n+ \"cjs\",\n+ \"es\"\n+ ]\n+}\n",
"new_path": "packages/node_modules/@webex/react-component-spaces-list/package.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import React from 'react';\n+import PropTypes from 'prop-types';\n+import classNames from 'classnames';\n+import {AutoSizer, List} from 'react-virtualized';\n+\n+import Spinner from '@ciscospark/react-component-spinner';\n+\n+import SpaceItem from '@webex/react-component-space-item';\n+\n+\n+const propTypes = {\n+ activeSpaceId: PropTypes.string,\n+ hasCalling: PropTypes.bool,\n+ isLoadingMore: PropTypes.bool,\n+ onCallClick: PropTypes.func,\n+ onClick: PropTypes.func,\n+ spaces: PropTypes.arrayOf(\n+ PropTypes.shape({\n+ avatarUrl: PropTypes.string,\n+ activityText: PropTypes.oneOfType([\n+ PropTypes.string,\n+ PropTypes.element\n+ ]),\n+ callStartTime: PropTypes.number,\n+ id: PropTypes.string,\n+ isDecrypting: PropTypes.bool,\n+ isUnread: PropTypes.bool,\n+ lastActivityTime: PropTypes.string,\n+ name: PropTypes.string,\n+ teamColor: PropTypes.string,\n+ teamName: PropTypes.string,\n+ type: PropTypes.string\n+ })\n+ )\n+};\n+\n+const defaultProps = {\n+ activeSpaceId: '',\n+ hasCalling: false,\n+ isLoadingMore: false,\n+ onCallClick: () => {},\n+ onClick: () => {},\n+ spaces: []\n+};\n+\n+export default function SpacesList({\n+ activeSpaceId,\n+ hasCalling,\n+ isLoadingMore,\n+ onCallClick,\n+ onClick,\n+ spaces\n+}) {\n+ function rowRenderer(options) {\n+ const {\n+ key,\n+ index,\n+ style\n+ } = options;\n+ if (index >= spaces.length) {\n+ return (\n+ <div key={key} style={style}>\n+ <Spinner bright />\n+ </div>\n+ );\n+ }\n+ const space = spaces[index];\n+\n+ return (\n+ <div className={classNames(`ciscospark-spaces-list-item-${index}`)} key={key} style={style}>\n+ <SpaceItem\n+ active={space.id === activeSpaceId}\n+ hasCalling={hasCalling}\n+ key={key}\n+ onCallClick={onCallClick}\n+ onClick={onClick}\n+ {...space}\n+ />\n+ </div>\n+ );\n+ }\n+\n+ const rowCount = isLoadingMore ? spaces.length + 1 : spaces.length;\n+\n+ return (\n+ <div style={{height: '100%', width: '100%'}}>\n+ <AutoSizer>\n+ {({height, width}) => (\n+ <List\n+ className=\"ciscospark-spaces-list\"\n+ height={height}\n+ rowCount={rowCount}\n+ rowHeight={70}\n+ rowRenderer={rowRenderer}\n+ width={width}\n+ />\n+ )}\n+ </AutoSizer>\n+ </div>\n+ );\n+}\n+\n+SpacesList.propTypes = propTypes;\n+SpacesList.defaultProps = defaultProps;\n",
"new_path": "packages/node_modules/@webex/react-component-spaces-list/src/index.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -45,13 +45,16 @@ export default (options, env) => {\n},\ntarget: 'web',\nresolve: {\n+ alias: {\n+ node_modules: path.resolve(__dirname, '..', '..', 'node_modules')\n+ },\nmainFields: ['src', 'browser', 'module', 'main'],\nmodules: [\n'src',\npath.resolve(__dirname, '..', '..', 'packages', 'node_modules'),\n'node_modules'\n],\n- extensions: ['.js', '.css', '.json']\n+ extensions: ['.js', '.css', '.json', '.scss']\n},\nmodule: {\nrules: [\n@@ -100,6 +103,31 @@ export default (options, env) => {\ninclude: [path.resolve(__dirname, '..', '..', 'node_modules')],\nuse: ['style-loader', 'css-loader']\n},\n+ {\n+ test: /\\.scss$/,\n+ include: [\n+ path.resolve(__dirname, '..', '..', 'packages', 'node_modules'),\n+ path.resolve(__dirname, '..', '..', 'src'),\n+ path.resolve(__dirname, '..', '..', 'node_modules')\n+\n+ ],\n+ use: ExtractTextPlugin.extract({\n+ fallback: 'style-loader',\n+ use: [\n+ {\n+ loader: 'css-loader',\n+ options: {\n+ sourceMap: true\n+ }\n+ },\n+ {\n+ loader: 'sass-loader',\n+ options: {\n+ sourceMap: true\n+ }\n+ }]\n+ })\n+ },\n{\ntest: /\\.woff$/,\n// Inline small woff files and output them below font/.\n",
"new_path": "scripts/webpack/webpack.base.babel.js",
"old_path": "scripts/webpack/webpack.base.babel.js"
}
] | JavaScript | MIT License | webex/react-widgets | feat(widget-recents): use new avatar design | 1 | feat | widget-recents |
807,849 | 30.07.2018 10:45:20 | 25,200 | acfd48bd3d899965d27a79763bd2e50c2706e752 | fix(create): Use filename without scope when generating imports from test file | [
{
"change_type": "MODIFY",
"diff": "@@ -399,7 +399,7 @@ class CreateCommand extends Command {\nwriteTestFile() {\nconst testContent = this.options.esModule\n? dedent`\n- import ${this.camelName} from '../src/${this.pkgName}';\n+ import ${this.camelName} from '../src/${this.dirName}';\ndescribe('${this.pkgName}', () => {\nit('needs tests');\n@@ -424,7 +424,7 @@ class CreateCommand extends Command {\nthis.options.esModule\n? dedent`\nimport factory from 'yargs/yargs';\n- import ${this.camelName} from './${this.pkgName}';\n+ import ${this.camelName} from './${this.dirName}';\nexport default cli;\n`\n@@ -432,7 +432,7 @@ class CreateCommand extends Command {\n'use strict';\nconst yargs = require('yargs/yargs');\n- const ${this.camelName} = require('./${this.pkgName}');\n+ const ${this.camelName} = require('./${this.dirName}');\nmodule.exports = cli;\n`,\n",
"new_path": "commands/create/index.js",
"old_path": "commands/create/index.js"
}
] | JavaScript | MIT License | lerna/lerna | fix(create): Use filename without scope when generating imports from test file | 1 | fix | create |
815,745 | 30.07.2018 11:15:13 | -10,800 | 1bc3f02f6f4fae7ebbc499065b77aeca1b3a8078 | fix: focus select after unselecting single item
fixes | [
{
"change_type": "MODIFY",
"diff": "@@ -2615,9 +2615,9 @@ describe('NgSelectComponent', function () {\nexpect(select.isOpen).toBe(false);\n}));\n- it('should focus dropdown', fakeAsync(() => {\n+ it('should focus dropdown while unselecting', fakeAsync(() => {\nconst focus = spyOn(select, 'focus');\n- triggerMousedown();\n+ select.unselect(fixture.componentInstance.cities[0]);\ntickAndDetectChanges(fixture);\nexpect(focus).toHaveBeenCalled();\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": "@@ -261,14 +261,14 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nreturn;\n}\n- if (!this._focused) {\n- this.focus();\n- }\n-\nif (target.className.includes('ng-value-icon')) {\nreturn;\n}\n+ if (!this._focused) {\n+ this.focus();\n+ }\n+\nif (this.searchable) {\nthis.open();\n} else {\n@@ -395,6 +395,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nunselect(item: NgOption) {\nthis.itemsList.unselect(item);\n+ this.focus();\nthis._updateNgModel();\nthis.removeEvent.emit(item);\n}\n@@ -453,6 +454,10 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\nonInputFocus($event) {\n+ if (this._focused) {\n+ return;\n+ }\n+\n(<HTMLElement>this.elementRef.nativeElement).classList.add('ng-select-focused');\nthis.focusEvent.emit($event);\nthis._focused = true;\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: focus select after unselecting single item
fixes #661 | 1 | fix | null |
815,745 | 30.07.2018 12:33:20 | -10,800 | a7778ab0a76c1fcea4b28c239bf77844931793cf | chore(release): 2.3.6 | [
{
"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.6\"></a>\n+## [2.3.6](https://github.com/ng-select/ng-select/compare/v2.3.5...v2.3.6) (2018-07-30)\n+\n+\n+### Bug Fixes\n+\n+* focus select after unselecting single item ([1bc3f02](https://github.com/ng-select/ng-select/commit/1bc3f02)), closes [#661](https://github.com/ng-select/ng-select/issues/661)\n+\n+\n+\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",
"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.5\",\n+ \"version\": \"2.3.6\",\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.6 | 1 | chore | release |
807,849 | 30.07.2018 13:20:53 | 25,200 | bf56018f3bcf4db5b8ecc899c3afa32ec8bb2b17 | feat(list): Extract utility | [
{
"change_type": "MODIFY",
"diff": "\"use strict\";\nconst filterable = require(\"@lerna/filter-options\");\n+const listable = require(\"@lerna/listable\");\n/**\n* @see https://github.com/yargs/yargs/blob/master/docs/advanced.md#providing-a-command-module\n@@ -12,31 +13,7 @@ exports.aliases = [\"ls\", \"la\", \"ll\"];\nexports.describe = \"List local packages\";\nexports.builder = yargs => {\n- yargs.options({\n- json: {\n- group: \"Command Options:\",\n- describe: \"Show information as a JSON array\",\n- type: \"boolean\",\n- },\n- a: {\n- group: \"Command Options:\",\n- describe: \"Show private packages that are normally hidden\",\n- type: \"boolean\",\n- alias: \"all\",\n- },\n- l: {\n- group: \"Command Options:\",\n- describe: \"Show extended information\",\n- type: \"boolean\",\n- alias: \"long\",\n- },\n- p: {\n- group: \"Command Options:\",\n- describe: \"Show parseable output instead of columnified view\",\n- type: \"boolean\",\n- alias: \"parseable\",\n- },\n- });\n+ listable.options(yargs);\nreturn filterable(yargs);\n};\n",
"new_path": "commands/list/command.js",
"old_path": "commands/list/command.js"
},
{
"change_type": "MODIFY",
"diff": "\"use strict\";\n-const chalk = require(\"chalk\");\n-const columnify = require(\"columnify\");\n-const path = require(\"path\");\nconst Command = require(\"@lerna/command\");\n+const listable = require(\"@lerna/listable\");\nconst output = require(\"@lerna/output\");\nmodule.exports = factory;\n@@ -18,114 +16,18 @@ class ListCommand extends Command {\n}\ninitialize() {\n- const alias = this.options._[0];\n-\n- this.showAll = alias === \"la\" || this.options.all;\n- this.showLong = alias === \"la\" || alias === \"ll\" || this.options.long;\n-\n- this.resultList = this.showAll\n- ? this.filteredPackages\n- : this.filteredPackages.filter(pkg => !pkg.private);\n-\n- // logged after output\n- this.count = this.resultList.length;\n+ this.result = listable.format(this.filteredPackages, this.options);\n}\nexecute() {\n- let result;\n-\n- if (this.options.json) {\n- result = this.formatJSON();\n- } else if (this.options.parseable) {\n- result = this.formatParseable();\n- } else {\n- result = this.formatColumns();\n- }\n-\n- output(result);\n-\n- this.logger.success(\"found\", \"%d %s\", this.count, this.count === 1 ? \"package\" : \"packages\");\n- }\n-\n- formatJSON() {\n- // explicit re-mapping exposes non-enumerable properties\n- const data = this.resultList.map(pkg => ({\n- name: pkg.name,\n- version: pkg.version,\n- private: pkg.private,\n- location: pkg.location,\n- }));\n-\n- return JSON.stringify(data, null, 2);\n- }\n-\n- formatParseable() {\n- const mapper = this.showLong\n- ? pkg => {\n- const result = [pkg.location, pkg.name];\n-\n- // sometimes the version is inexplicably missing?\n- if (pkg.version) {\n- result.push(pkg.version);\n- } else {\n- result.push(\"MISSING\");\n- }\n-\n- if (pkg.private) {\n- result.push(\"PRIVATE\");\n- }\n-\n- return result.join(\":\");\n- }\n- : pkg => pkg.location;\n-\n- return this.resultList.map(mapper).join(\"\\n\");\n- }\n-\n- formatColumns() {\n- const formattedResults = this.resultList.map(result => {\n- const formatted = {\n- name: result.name,\n- };\n-\n- if (result.version) {\n- formatted.version = chalk.green(`v${result.version}`);\n- } else {\n- formatted.version = chalk.yellow(\"MISSING\");\n- }\n-\n- if (result.private) {\n- formatted.private = `(${chalk.red(\"PRIVATE\")})`;\n- }\n-\n- formatted.location = chalk.grey(path.relative(\".\", result.location));\n-\n- return formatted;\n- });\n-\n- return columnify(formattedResults, {\n- showHeaders: false,\n- columns: this.getColumnOrder(),\n- config: {\n- version: {\n- align: \"right\",\n- },\n- },\n- });\n- }\n-\n- getColumnOrder() {\n- const columns = [\"name\"];\n-\n- if (this.showLong) {\n- columns.push(\"version\", \"location\");\n- }\n-\n- if (this.showAll) {\n- columns.push(\"private\");\n- }\n-\n- return columns;\n+ output(this.result.text);\n+\n+ this.logger.success(\n+ \"found\",\n+ \"%d %s\",\n+ this.result.count,\n+ this.result.count === 1 ? \"package\" : \"packages\"\n+ );\n}\n}\n",
"new_path": "commands/list/index.js",
"old_path": "commands/list/index.js"
},
{
"change_type": "MODIFY",
"diff": "\"dependencies\": {\n\"@lerna/command\": \"file:../../core/command\",\n\"@lerna/filter-options\": \"file:../../core/filter-options\",\n- \"@lerna/output\": \"file:../../utils/output\",\n- \"chalk\": \"^2.3.1\",\n- \"columnify\": \"^1.5.4\"\n+ \"@lerna/listable\": \"file:../../utils/listable\",\n+ \"@lerna/output\": \"file:../../utils/output\"\n}\n}\n",
"new_path": "commands/list/package.json",
"old_path": "commands/list/package.json"
},
{
"change_type": "MODIFY",
"diff": "const cliRunner = require(\"@lerna-test/cli-runner\");\nconst initFixture = require(\"@lerna-test/init-fixture\")(__dirname);\n-const multiLineTrimRight = require(\"@lerna-test/multi-line-trim-right\");\n// normalize temp directory paths in snapshots\nexpect.addSnapshotSerializer(require(\"@lerna-test/serialize-tempdir\"));\n@@ -12,14 +11,12 @@ let lerna;\nbeforeAll(async () => {\nconst cwd = await initFixture(\"lerna-ls\");\n- const run = cliRunner(cwd);\n- // wrap runner to remove trailing whitespace added by columnify\n- lerna = (...args) => run(...args).then(result => multiLineTrimRight(result.stdout));\n+ lerna = cliRunner(cwd);\n});\ntest(\"lerna list\", async () => {\n- const stdout = await lerna(\"list\");\n+ const { stdout } = await lerna(\"list\");\nexpect(stdout).toMatchInlineSnapshot(`\npackage-1\n@test/package-2\n@@ -28,7 +25,7 @@ package-3\n});\ntest(\"lerna ls\", async () => {\n- const stdout = await lerna(\"ls\");\n+ const { stdout } = await lerna(\"ls\");\nexpect(stdout).toMatchInlineSnapshot(`\npackage-1\n@test/package-2\n@@ -37,7 +34,7 @@ package-3\n});\ntest(\"lerna ls --all\", async () => {\n- const stdout = await lerna(\"ls\", \"--all\");\n+ const { stdout } = await lerna(\"ls\", \"--all\");\nexpect(stdout).toMatchInlineSnapshot(`\npackage-1\n@test/package-2\n@@ -47,7 +44,7 @@ package-4 (PRIVATE)\n});\ntest(\"lerna ls --long\", async () => {\n- const stdout = await lerna(\"ls\", \"--long\");\n+ const { stdout } = await lerna(\"ls\", \"--long\");\nexpect(stdout).toMatchInlineSnapshot(`\npackage-1 v1.0.0 packages/pkg-1\n@test/package-2 v2.0.0 packages/pkg-2\n@@ -56,7 +53,7 @@ package-3 MISSING packages/pkg-3\n});\ntest(\"lerna ls --parseable\", async () => {\n- const stdout = await lerna(\"ls\", \"--parseable\");\n+ const { stdout } = await lerna(\"ls\", \"--parseable\");\nexpect(stdout).toMatchInlineSnapshot(`\n<PROJECT_ROOT>/packages/pkg-1\n<PROJECT_ROOT>/packages/pkg-2\n@@ -65,7 +62,7 @@ test(\"lerna ls --parseable\", async () => {\n});\ntest(\"lerna ls --all --long --parseable\", async () => {\n- const stdout = await lerna(\"ls\", \"-alp\");\n+ const { stdout } = await lerna(\"ls\", \"-alp\");\nexpect(stdout).toMatchInlineSnapshot(`\n<PROJECT_ROOT>/packages/pkg-1:package-1:1.0.0\n<PROJECT_ROOT>/packages/pkg-2:@test/package-2:2.0.0\n@@ -75,7 +72,7 @@ test(\"lerna ls --all --long --parseable\", async () => {\n});\ntest(\"lerna la\", async () => {\n- const stdout = await lerna(\"la\");\n+ const { stdout } = await lerna(\"la\");\nexpect(stdout).toMatchInlineSnapshot(`\npackage-1 v1.0.0 packages/pkg-1\n@test/package-2 v2.0.0 packages/pkg-2\n@@ -85,7 +82,7 @@ package-4 v4.0.0 packages/pkg-4 (PRIVATE)\n});\ntest(\"lerna ll\", async () => {\n- const stdout = await lerna(\"ll\");\n+ const { stdout } = await lerna(\"ll\");\nexpect(stdout).toMatchInlineSnapshot(`\npackage-1 v1.0.0 packages/pkg-1\n@test/package-2 v2.0.0 packages/pkg-2\n",
"new_path": "integration/lerna-ls.test.js",
"old_path": "integration/lerna-ls.test.js"
},
{
"change_type": "MODIFY",
"diff": "\"requires\": {\n\"@lerna/command\": \"file:core/command\",\n\"@lerna/filter-options\": \"file:core/filter-options\",\n- \"@lerna/output\": \"file:utils/output\",\n+ \"@lerna/listable\": \"file:utils/listable\",\n+ \"@lerna/output\": \"file:utils/output\"\n+ }\n+ },\n+ \"@lerna/listable\": {\n+ \"version\": \"file:utils/listable\",\n+ \"requires\": {\n\"chalk\": \"^2.3.1\",\n\"columnify\": \"^1.5.4\"\n}\n",
"new_path": "package-lock.json",
"old_path": "package-lock.json"
},
{
"change_type": "ADD",
"diff": "+# `@lerna/listable`\n+\n+> Shared logic for listing package information\n+\n+This is an internal package for [Lerna](https://github.com/lerna/lerna/#readme), YMMV.\n+\n+## Usage\n+\n+### `listable.format()`\n+\n+```js\n+const listable = require('@lerna/listable');\n+\n+const { text, count } = listable.format(packages, options);\n+```\n+\n+### `listable.options()`\n+\n+```js\n+const listable = require('@lerna/listable');\n+\n+exports.builder = yargs => {\n+ listable.options(yargs);\n+};\n+```\n",
"new_path": "utils/listable/README.md",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+const path = require(\"path\");\n+const tempy = require(\"tempy\");\n+const Package = require(\"@lerna/package\");\n+const listable = require(\"..\");\n+\n+// normalize temp directory paths in snapshots\n+expect.addSnapshotSerializer(require(\"@lerna-test/serialize-tempdir\"));\n+\n+describe(\"listable.format()\", () => {\n+ let packages;\n+\n+ const formatWithOptions = opts => listable.format(packages, Object.assign({ _: [\"ls\"] }, opts));\n+\n+ beforeAll(() => {\n+ const cwd = tempy.directory();\n+ process.chdir(cwd);\n+\n+ packages = [\n+ new Package({ name: \"pkg-1\", version: \"1.0.0\" }, path.join(cwd, \"/pkgs/pkg-1\")),\n+ new Package({ name: \"pkg-2\" }, path.join(cwd, \"/pkgs/pkg-2\")),\n+ new Package({ name: \"pkg-3\", version: \"3.0.0\", private: true }, path.join(cwd, \"/pkgs/pkg-3\")),\n+ ];\n+ });\n+\n+ describe(\"renders\", () => {\n+ test(\"all output\", () => {\n+ const { count, text } = formatWithOptions({ all: true });\n+\n+ expect(count).toBe(3);\n+ expect(text).toMatchInlineSnapshot(`\n+\"pkg-1\n+pkg-2\n+pkg-3 (\u001b[31mPRIVATE\u001b[39m)\"\n+`);\n+ });\n+\n+ test(\"long output\", () => {\n+ const { count, text } = formatWithOptions({ long: true });\n+\n+ expect(count).toBe(2);\n+ expect(text).toMatchInlineSnapshot(`\n+\"pkg-1 \u001b[32mv1.0.0\u001b[39m \u001b[90mpkgs/pkg-1\u001b[39m\n+pkg-2 \u001b[33mMISSING\u001b[39m \u001b[90mpkgs/pkg-2\u001b[39m\"\n+`);\n+ });\n+\n+ test(\"all long output\", () => {\n+ const { text } = formatWithOptions({ long: true, all: true });\n+\n+ expect(text).toMatchInlineSnapshot(`\n+\"pkg-1 \u001b[32mv1.0.0\u001b[39m \u001b[90mpkgs/pkg-1\u001b[39m\n+pkg-2 \u001b[33mMISSING\u001b[39m \u001b[90mpkgs/pkg-2\u001b[39m\n+pkg-3 \u001b[32mv3.0.0\u001b[39m \u001b[90mpkgs/pkg-3\u001b[39m (\u001b[31mPRIVATE\u001b[39m)\"\n+`);\n+ });\n+\n+ test(\"JSON output\", () => {\n+ const { text } = formatWithOptions({ json: true });\n+\n+ expect(text).toMatchInlineSnapshot(`\n+[\n+ {\n+ \"name\": \"pkg-1\",\n+ \"version\": \"1.0.0\",\n+ \"private\": false,\n+ \"location\": \"<PROJECT_ROOT>/pkgs/pkg-1\"\n+ },\n+ {\n+ \"name\": \"pkg-2\",\n+ \"private\": false,\n+ \"location\": \"<PROJECT_ROOT>/pkgs/pkg-2\"\n+ }\n+]\n+`);\n+ });\n+\n+ test(\"all JSON output\", () => {\n+ const { text } = formatWithOptions({ json: true, all: true });\n+\n+ expect(text).toMatchInlineSnapshot(`\n+[\n+ {\n+ \"name\": \"pkg-1\",\n+ \"version\": \"1.0.0\",\n+ \"private\": false,\n+ \"location\": \"<PROJECT_ROOT>/pkgs/pkg-1\"\n+ },\n+ {\n+ \"name\": \"pkg-2\",\n+ \"private\": false,\n+ \"location\": \"<PROJECT_ROOT>/pkgs/pkg-2\"\n+ },\n+ {\n+ \"name\": \"pkg-3\",\n+ \"version\": \"3.0.0\",\n+ \"private\": true,\n+ \"location\": \"<PROJECT_ROOT>/pkgs/pkg-3\"\n+ }\n+]\n+`);\n+ });\n+\n+ test(\"parseable output\", () => {\n+ const { text } = formatWithOptions({ parseable: true });\n+\n+ expect(text).toMatchInlineSnapshot(`\n+<PROJECT_ROOT>/pkgs/pkg-1\n+<PROJECT_ROOT>/pkgs/pkg-2\n+`);\n+ });\n+\n+ test(\"all parseable output\", () => {\n+ const { text } = formatWithOptions({ parseable: true, all: true });\n+\n+ expect(text).toMatchInlineSnapshot(`\n+<PROJECT_ROOT>/pkgs/pkg-1\n+<PROJECT_ROOT>/pkgs/pkg-2\n+<PROJECT_ROOT>/pkgs/pkg-3\n+`);\n+ });\n+\n+ test(\"long parseable output\", () => {\n+ const { text } = formatWithOptions({ parseable: true, long: true });\n+\n+ expect(text).toMatchInlineSnapshot(`\n+<PROJECT_ROOT>/pkgs/pkg-1:pkg-1:1.0.0\n+<PROJECT_ROOT>/pkgs/pkg-2:pkg-2:MISSING\n+`);\n+ });\n+\n+ test(\"all long parseable output\", () => {\n+ const { text } = formatWithOptions({ parseable: true, all: true, long: true });\n+\n+ expect(text).toMatchInlineSnapshot(`\n+<PROJECT_ROOT>/pkgs/pkg-1:pkg-1:1.0.0\n+<PROJECT_ROOT>/pkgs/pkg-2:pkg-2:MISSING\n+<PROJECT_ROOT>/pkgs/pkg-3:pkg-3:3.0.0:PRIVATE\n+`);\n+ });\n+ });\n+\n+ describe(\"aliases\", () => {\n+ test(\"la => ls -la\", () => {\n+ const { text } = formatWithOptions({ _: [\"la\"] });\n+\n+ expect(text).toMatchInlineSnapshot(`\n+\"pkg-1 \u001b[32mv1.0.0\u001b[39m \u001b[90mpkgs/pkg-1\u001b[39m\n+pkg-2 \u001b[33mMISSING\u001b[39m \u001b[90mpkgs/pkg-2\u001b[39m\n+pkg-3 \u001b[32mv3.0.0\u001b[39m \u001b[90mpkgs/pkg-3\u001b[39m (\u001b[31mPRIVATE\u001b[39m)\"\n+`);\n+ });\n+\n+ test(\"ll => ls -l\", () => {\n+ const { text } = formatWithOptions({ _: [\"ll\"] });\n+\n+ expect(text).toMatchInlineSnapshot(`\n+\"pkg-1 \u001b[32mv1.0.0\u001b[39m \u001b[90mpkgs/pkg-1\u001b[39m\n+pkg-2 \u001b[33mMISSING\u001b[39m \u001b[90mpkgs/pkg-2\u001b[39m\"\n+`);\n+ });\n+ });\n+});\n",
"new_path": "utils/listable/__tests__/listable-format.test.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+const yargs = require(\"yargs/yargs\");\n+const listable = require(\"..\");\n+\n+describe(\"listable.options()\", () => {\n+ const parsed = (...args) => listable.options(yargs()).parse(args.join(\" \"));\n+\n+ it(\"provides --json\", () => {\n+ expect(parsed(\"--json\")).toHaveProperty(\"json\", true);\n+ });\n+\n+ it(\"provides --all\", () => {\n+ expect(parsed(\"--all\")).toHaveProperty(\"all\", true);\n+ });\n+\n+ it(\"provides --all alias -a\", () => {\n+ expect(parsed(\"-a\")).toHaveProperty(\"all\", true);\n+ });\n+\n+ it(\"provides --long\", () => {\n+ expect(parsed(\"--long\")).toHaveProperty(\"long\", true);\n+ });\n+\n+ it(\"provides --long alias -l\", () => {\n+ expect(parsed(\"-l\")).toHaveProperty(\"long\", true);\n+ });\n+\n+ it(\"provides --parseable\", () => {\n+ expect(parsed(\"--parseable\")).toHaveProperty(\"parseable\", true);\n+ });\n+\n+ it(\"provides --parseable alias -p\", () => {\n+ expect(parsed(\"-p\")).toHaveProperty(\"parseable\", true);\n+ });\n+});\n",
"new_path": "utils/listable/__tests__/listable-options.test.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+exports.format = require(\"./lib/listable-format\");\n+exports.options = require(\"./lib/listable-options\");\n",
"new_path": "utils/listable/index.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+const chalk = require(\"chalk\");\n+const columnify = require(\"columnify\");\n+const path = require(\"path\");\n+\n+module.exports = listableFormat;\n+\n+function listableFormat(pkgList, options) {\n+ const viewOptions = parseViewOptions(options);\n+ const resultList = filterResultList(pkgList, viewOptions);\n+ const count = resultList.length;\n+\n+ let text;\n+\n+ if (viewOptions.showJSON) {\n+ text = formatJSON(resultList);\n+ } else if (viewOptions.showParseable) {\n+ text = formatParseable(resultList, viewOptions);\n+ } else {\n+ text = formatColumns(resultList, viewOptions);\n+ }\n+\n+ return { text, count };\n+}\n+\n+function parseViewOptions(options) {\n+ const alias = options._[0];\n+\n+ return {\n+ showAll: alias === \"la\" || options.all,\n+ showLong: alias === \"la\" || alias === \"ll\" || options.long,\n+ showJSON: options.json,\n+ showParseable: options.parseable,\n+ };\n+}\n+\n+function filterResultList(pkgList, viewOptions) {\n+ return viewOptions.showAll ? pkgList.slice() : pkgList.filter(pkg => !pkg.private);\n+}\n+\n+function formatJSON(resultList) {\n+ // explicit re-mapping exposes non-enumerable properties\n+ const data = resultList.map(pkg => ({\n+ name: pkg.name,\n+ version: pkg.version,\n+ private: pkg.private,\n+ location: pkg.location,\n+ }));\n+\n+ return JSON.stringify(data, null, 2);\n+}\n+\n+function makeParseable(pkg) {\n+ const result = [pkg.location, pkg.name];\n+\n+ // sometimes the version is inexplicably missing?\n+ if (pkg.version) {\n+ result.push(pkg.version);\n+ } else {\n+ result.push(\"MISSING\");\n+ }\n+\n+ if (pkg.private) {\n+ result.push(\"PRIVATE\");\n+ }\n+\n+ return result.join(\":\");\n+}\n+\n+function formatParseable(resultList, viewOptions) {\n+ return resultList.map(viewOptions.showLong ? makeParseable : pkg => pkg.location).join(\"\\n\");\n+}\n+\n+function getColumnOrder(viewOptions) {\n+ const columns = [\"name\"];\n+\n+ if (viewOptions.showLong) {\n+ columns.push(\"version\", \"location\");\n+ }\n+\n+ if (viewOptions.showAll) {\n+ columns.push(\"private\");\n+ }\n+\n+ return columns;\n+}\n+\n+function trimmedColumns(formattedResults, viewOptions) {\n+ const str = columnify(formattedResults, {\n+ showHeaders: false,\n+ columns: getColumnOrder(viewOptions),\n+ config: {\n+ version: {\n+ align: \"right\",\n+ },\n+ },\n+ });\n+\n+ // columnify leaves a lot of trailing space in the last column, remove that here\n+ return str\n+ .split(\"\\n\")\n+ .map(line => line.trimRight())\n+ .join(\"\\n\");\n+}\n+\n+function formatColumns(resultList, viewOptions) {\n+ const formattedResults = resultList.map(result => {\n+ const formatted = {\n+ name: result.name,\n+ };\n+\n+ if (result.version) {\n+ formatted.version = chalk.green(`v${result.version}`);\n+ } else {\n+ formatted.version = chalk.yellow(\"MISSING\");\n+ }\n+\n+ if (result.private) {\n+ formatted.private = `(${chalk.red(\"PRIVATE\")})`;\n+ }\n+\n+ formatted.location = chalk.grey(path.relative(\".\", result.location));\n+\n+ return formatted;\n+ });\n+\n+ return trimmedColumns(formattedResults, viewOptions);\n+}\n",
"new_path": "utils/listable/lib/listable-format.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+module.exports = listableOptions;\n+\n+function listableOptions(yargs) {\n+ return yargs.options({\n+ json: {\n+ group: \"Command Options:\",\n+ describe: \"Show information as a JSON array\",\n+ type: \"boolean\",\n+ },\n+ a: {\n+ group: \"Command Options:\",\n+ describe: \"Show private packages that are normally hidden\",\n+ type: \"boolean\",\n+ alias: \"all\",\n+ },\n+ l: {\n+ group: \"Command Options:\",\n+ describe: \"Show extended information\",\n+ type: \"boolean\",\n+ alias: \"long\",\n+ },\n+ p: {\n+ group: \"Command Options:\",\n+ describe: \"Show parseable output instead of columnified view\",\n+ type: \"boolean\",\n+ alias: \"parseable\",\n+ },\n+ });\n+}\n",
"new_path": "utils/listable/lib/listable-options.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"@lerna/listable\",\n+ \"version\": \"3.0.0-rc.0\",\n+ \"description\": \"Shared logic for listing package information\",\n+ \"keywords\": [\n+ \"lerna\",\n+ \"utils\"\n+ ],\n+ \"author\": \"Daniel Stockman <daniel.stockman@gmail.com>\",\n+ \"homepage\": \"https://github.com/lerna/lerna/tree/master/utils/listable#readme\",\n+ \"license\": \"MIT\",\n+ \"main\": \"index.js\",\n+ \"files\": [\n+ \"index.js\",\n+ \"lib\"\n+ ],\n+ \"engines\": {\n+ \"node\": \">= 6.9.0\"\n+ },\n+ \"publishConfig\": {\n+ \"access\": \"public\"\n+ },\n+ \"repository\": {\n+ \"type\": \"git\",\n+ \"url\": \"git+https://github.com/lerna/lerna.git\"\n+ },\n+ \"scripts\": {\n+ \"test\": \"echo \\\"Error: run tests from root\\\" && exit 1\"\n+ },\n+ \"dependencies\": {\n+ \"chalk\": \"^2.3.1\",\n+ \"columnify\": \"^1.5.4\"\n+ }\n+}\n",
"new_path": "utils/listable/package.json",
"old_path": null
}
] | JavaScript | MIT License | lerna/lerna | feat(list): Extract @lerna/listable utility | 1 | feat | list |
217,922 | 30.07.2018 13:29:40 | -7,200 | 0a9a69056133456a3b09dfbcec3845b897034b90 | fix: fixed an issue with change detection inside pricing mode
By using trackBy, the changes are now propagated properly without the need to re-create each row,
resulting in a performance gain and a way better UX when you check/uncheck an item. | [
{
"change_type": "MODIFY",
"diff": "<mat-panel-title>{{\"Crystals\" | translate}}</mat-panel-title>\n</mat-expansion-panel-header>\n<mat-list dense>\n- <app-pricing-row *ngFor=\"let item of list.crystals; let odd = odd\" (save)=\"save()\" [item]=\"item\"\n+ <app-pricing-row *ngFor=\"let item of list.crystals; trackBy: trackByItemFn; let odd = odd;\" (save)=\"save()\"\n+ [item]=\"item\"\n[listId]=\"list.$key\"\n[odd]=\"odd\"></app-pricing-row>\n</mat-list>\n<mat-panel-title>{{\"Gathering\" | translate}}</mat-panel-title>\n</mat-expansion-panel-header>\n<mat-list dense>\n- <app-pricing-row *ngFor=\"let item of list.gathers; let odd = odd\" (save)=\"save()\" [item]=\"item\"\n+ <app-pricing-row *ngFor=\"let item of list.gathers; trackBy: trackByItemFn; let odd = odd;\" (save)=\"save()\"\n+ [item]=\"item\"\n[listId]=\"list.$key\"\n[odd]=\"odd\"></app-pricing-row>\n</mat-list>\n<mat-panel-title>{{\"Other\" | translate}}</mat-panel-title>\n</mat-expansion-panel-header>\n<mat-list dense>\n- <app-pricing-row *ngFor=\"let item of list.others; let odd = odd\" (save)=\"save()\" [item]=\"item\"\n+ <app-pricing-row *ngFor=\"let item of list.others; trackBy: trackByItemFn; let odd = odd;\" (save)=\"save()\"\n+ [item]=\"item\"\n[listId]=\"list.$key\"\n[odd]=\"odd\"></app-pricing-row>\n</mat-list>\n<mat-panel-title>{{\"Pre_crafts\" | translate}}</mat-panel-title>\n</mat-expansion-panel-header>\n<mat-list dense>\n- <app-pricing-row *ngFor=\"let item of list.preCrafts; let odd = odd\" (save)=\"save()\" [item]=\"item\"\n+ <app-pricing-row *ngFor=\"let item of list.preCrafts; trackBy: trackByItemFn; let odd = odd;\" (save)=\"save()\"\n+ [item]=\"item\"\n[listId]=\"list.$key\"\n[odd]=\"odd\"\n[craftCost]=\"getCraftCost(item)\" [preCraft]=\"true\"></app-pricing-row>\n<mat-card-title>{{\"Earning\" | translate}}</mat-card-title>\n<mat-card-subtitle>{{getTotalEarnings(list.recipes).toLocaleString()}} gil</mat-card-subtitle>\n<mat-list dense>\n- <app-pricing-row *ngFor=\"let item of list.recipes; let odd = odd\" (save)=\"save()\" [item]=\"item\"\n+ <app-pricing-row *ngFor=\"let item of list.recipes; trackBy: trackByItemFn; let odd = odd;\" (save)=\"save()\"\n+ [item]=\"item\"\n[listId]=\"list.$key\" [odd]=\"odd\"\n[craftCost]=\"getCraftCost(item)\" [earning]=\"true\"></app-pricing-row>\n</mat-list>\n",
"new_path": "src/app/modules/pricing/pricing/pricing.component.html",
"old_path": "src/app/modules/pricing/pricing/pricing.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -92,4 +92,8 @@ export class PricingComponent {\ngetBenefits(): number {\nreturn this.getTotalEarnings(this.list.recipes) - this.getSpendingTotal();\n}\n+\n+ public trackByItemFn(index: number, item: ListRow): number {\n+ return item.id;\n+ }\n}\n",
"new_path": "src/app/modules/pricing/pricing/pricing.component.ts",
"old_path": "src/app/modules/pricing/pricing/pricing.component.ts"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | fix: fixed an issue with change detection inside pricing mode
By using trackBy, the changes are now propagated properly without the need to re-create each row,
resulting in a performance gain and a way better UX when you check/uncheck an item. | 1 | fix | null |
807,849 | 30.07.2018 13:51:40 | 25,200 | 41f231fd241fab02cc028db9d029e76e5ef3e994 | fix(add): Support explicit & implicit relative file: specifiers | [
{
"change_type": "MODIFY",
"diff": "@@ -11,6 +11,7 @@ const bootstrap = require(\"@lerna/bootstrap\");\n// helpers\nconst initFixture = require(\"@lerna-test/init-fixture\")(__dirname);\nconst pkgMatchers = require(\"@lerna-test/pkg-matchers\");\n+const { getPackages } = require(\"@lerna/project\");\n// file under test\nconst lernaAdd = require(\"@lerna-test/command-runner\")(require(\"../command\"));\n@@ -79,7 +80,7 @@ describe(\"AddCommand\", () => {\nexpect(await readPkg(testDir, \"packages/package-2\")).toDependOn(\"@test/package-1\", \"^1.0.0\");\n});\n- it(\"should reference specfied range\", async () => {\n+ it(\"should reference specified range\", async () => {\nconst testDir = await initFixture(\"basic\");\nawait lernaAdd(testDir)(\"@test/package-1@~1\");\n@@ -97,6 +98,26 @@ describe(\"AddCommand\", () => {\n});\n});\n+ it(\"adds explicit local file: specifier as file: specifier\", async () => {\n+ const testDir = await initFixture(\"basic\");\n+\n+ await lernaAdd(testDir)(\"@test/package-1@file:packages/package-1\");\n+\n+ expect(await readPkg(testDir, \"packages/package-2\")).toDependOn(\"@test/package-1\", \"file:../package-1\");\n+ });\n+\n+ it(\"adds local dep as file: specifier when existing relationships are file: specifiers\", async () => {\n+ const testDir = await initFixture(\"existing\");\n+ const [, , pkg3] = await getPackages(testDir);\n+\n+ pkg3.updateLocalDependency({ name: \"@test/package-2\", type: \"directory\" }, \"file:../package-2\", \"\");\n+ await pkg3.serialize();\n+\n+ await lernaAdd(testDir)(\"@test/package-1\");\n+\n+ expect(await readPkg(testDir, \"packages/package-2\")).toDependOn(\"@test/package-1\", \"file:../package-1\");\n+ });\n+\nit(\"should add target package to devDependencies\", async () => {\nconst testDir = await initFixture(\"basic\");\n",
"new_path": "commands/add/__tests__/add-command.test.js",
"old_path": "commands/add/__tests__/add-command.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -110,7 +110,7 @@ class AddCommand extends Command {\nreturn true;\n}\n- return getRangeToReference(this.spec, deps, this.savePrefix) !== deps[targetName];\n+ return getRangeToReference(this.spec, deps, pkg.location, this.savePrefix) !== deps[targetName];\n});\nreturn result;\n@@ -121,9 +121,9 @@ class AddCommand extends Command {\nreturn pMap(this.packagesToChange, pkg => {\nconst deps = this.getPackageDeps(pkg);\n- const range = getRangeToReference(this.spec, deps, this.savePrefix);\n+ const range = getRangeToReference(this.spec, deps, pkg.location, this.savePrefix);\n- this.logger.verbose(\"add\", `${targetName}@${range} as ${this.dependencyType} in ${pkg.name}`);\n+ this.logger.verbose(\"add\", `${targetName}@${range} to ${this.dependencyType} in ${pkg.name}`);\ndeps[targetName] = range;\nreturn pkg.serialize();\n@@ -145,7 +145,9 @@ class AddCommand extends Command {\nconst { name, fetchSpec } = this.spec;\nif (this.selfSatisfied) {\n- return Promise.resolve(this.packageGraph.get(name).version);\n+ const node = this.packageGraph.get(name);\n+\n+ return Promise.resolve(this.spec.saveRelativeFileSpec ? node.location : node.version);\n}\nreturn packageJson(name, { version: fetchSpec }).then(pkg => pkg.version);\n@@ -159,6 +161,20 @@ class AddCommand extends Command {\nreturn false;\n}\n+ // an explicit \"file:packages/foo\" always saves as a relative \"file:../foo\"\n+ if (this.spec.type === \"directory\" && fetchSpec === pkg.location) {\n+ this.spec.saveRelativeFileSpec = true;\n+\n+ return true;\n+ }\n+\n+ // existing relative file spec means local dep should be added the same way\n+ this.spec.saveRelativeFileSpec = Array.from(this.packageGraph.values()).some(\n+ node =>\n+ node.localDependencies.size &&\n+ Array.from(node.localDependencies.values()).some(resolved => resolved.type === \"directory\")\n+ );\n+\nif (fetchSpec === \"latest\") {\nreturn true;\n}\n",
"new_path": "commands/add/index.js",
"old_path": "commands/add/index.js"
},
{
"change_type": "MODIFY",
"diff": "\"use strict\";\n+const npa = require(\"npm-package-arg\");\n+const path = require(\"path\");\nconst semver = require(\"semver\");\nmodule.exports = getRangeToReference;\n-function getRangeToReference(spec, deps, prefix) {\n+function getRangeToReference(spec, deps, loc, prefix) {\nconst current = deps[spec.name];\nconst resolved = spec.type === \"tag\" ? `${prefix}${spec.version}` : spec.fetchSpec;\n+ if (spec.saveRelativeFileSpec) {\n+ // \"version\" has been resolved to pkg.location in getPackageVersion()\n+ return npa.resolve(spec.name, path.relative(loc, spec.version), loc).saveSpec;\n+ }\n+\nif (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": "@@ -92,7 +92,8 @@ const matchDependency = dependencyType => (manifest, pkg, range, options) => {\n}\nconst version = manifest[dependencyType][pkg];\n- const mismatchedDep = range ? !semver.intersects(version, range) : false;\n+ // we don't care about semver intersection, it's not always a semver range\n+ const mismatchedDep = range && version !== range;\nif (mismatchedDep) {\nreturn {\n",
"new_path": "helpers/pkg-matchers/index.js",
"old_path": "helpers/pkg-matchers/index.js"
}
] | JavaScript | MIT License | lerna/lerna | fix(add): Support explicit & implicit relative file: specifiers | 1 | fix | add |
791,723 | 30.07.2018 14:35:32 | 25,200 | cebdfae38946a93ac169870d9af5ac64ffe2364a | report: adopt 80-char line-length license | [
{
"change_type": "MODIFY",
"diff": "/**\n- * @license Copyright 2017 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+ * @license\n+ * Copyright 2017 Google Inc. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS-IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n*/\n'use strict';\n",
"new_path": "lighthouse-core/report/html/renderer/category-renderer.js",
"old_path": "lighthouse-core/report/html/renderer/category-renderer.js"
},
{
"change_type": "MODIFY",
"diff": "/**\n- * @license Copyright 2017 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+ * @license\n+ * Copyright 2017 Google Inc. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS-IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n*/\n'use strict';\n",
"new_path": "lighthouse-core/report/html/renderer/crc-details-renderer.js",
"old_path": "lighthouse-core/report/html/renderer/crc-details-renderer.js"
},
{
"change_type": "MODIFY",
"diff": "/**\n- * @license Copyright 2017 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+ * @license\n+ * Copyright 2017 Google Inc. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS-IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n*/\n'use strict';\n",
"new_path": "lighthouse-core/report/html/renderer/details-renderer.js",
"old_path": "lighthouse-core/report/html/renderer/details-renderer.js"
},
{
"change_type": "MODIFY",
"diff": "/**\n- * @license Copyright 2017 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+ * @license\n+ * Copyright 2017 Google Inc. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS-IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n*/\n'use strict';\n",
"new_path": "lighthouse-core/report/html/renderer/dom.js",
"old_path": "lighthouse-core/report/html/renderer/dom.js"
},
{
"change_type": "MODIFY",
"diff": "/**\n- * @license Copyright 2017 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+ * @license\n+ * Copyright 2017 Google Inc. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS-IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n*/\n'use strict';\n",
"new_path": "lighthouse-core/report/html/renderer/logger.js",
"old_path": "lighthouse-core/report/html/renderer/logger.js"
},
{
"change_type": "MODIFY",
"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+ * @license\n+ * Copyright 2018 Google Inc. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS-IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n*/\n'use strict';\n",
"new_path": "lighthouse-core/report/html/renderer/performance-category-renderer.js",
"old_path": "lighthouse-core/report/html/renderer/performance-category-renderer.js"
},
{
"change_type": "MODIFY",
"diff": "/**\n- * @license Copyright 2017 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+ * @license\n+ * Copyright 2017 Google Inc. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS-IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n*/\n'use strict';\n",
"new_path": "lighthouse-core/report/html/renderer/report-renderer.js",
"old_path": "lighthouse-core/report/html/renderer/report-renderer.js"
},
{
"change_type": "MODIFY",
"diff": "/**\n- * @license Copyright 2017 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+ * @license\n+ * Copyright 2017 Google Inc. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS-IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n*/\n'use strict';\n",
"new_path": "lighthouse-core/report/html/renderer/report-ui-features.js",
"old_path": "lighthouse-core/report/html/renderer/report-ui-features.js"
},
{
"change_type": "MODIFY",
"diff": "/**\n- * @license Copyright 2017 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+ * @license\n+ * Copyright 2017 Google Inc. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS-IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n*/\n'use strict';\n",
"new_path": "lighthouse-core/report/html/renderer/util.js",
"old_path": "lighthouse-core/report/html/renderer/util.js"
},
{
"change_type": "MODIFY",
"diff": "/**\n- * @license Copyright 2017 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+ * @license\n+ * Copyright 2017 Google Inc. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS-IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n*/\n.lh-vars {\n",
"new_path": "lighthouse-core/report/html/report-styles.css",
"old_path": "lighthouse-core/report/html/report-styles.css"
},
{
"change_type": "MODIFY",
"diff": "<!--\n-@license Copyright 2017 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+@license\n+Copyright 2018 Google Inc. All Rights Reserved.\n+\n+Licensed under the Apache License, Version 2.0 (the \"License\");\n+you may not use this file except in compliance with the License.\n+You may obtain a copy of the License at\n+\n+http://www.apache.org/licenses/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS-IS\" BASIS,\n+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n-->\n<!doctype html>\n<html lang=\"en\">\n",
"new_path": "lighthouse-core/report/html/report-template.html",
"old_path": "lighthouse-core/report/html/report-template.html"
},
{
"change_type": "MODIFY",
"diff": "<!--\n-@license Copyright 2017 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+@license\n+Copyright 2018 Google Inc. All Rights Reserved.\n+\n+Licensed under the Apache License, Version 2.0 (the \"License\");\n+you may not use this file except in compliance with the License.\n+You may obtain a copy of the License at\n+\n+http://www.apache.org/licenses/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS-IS\" BASIS,\n+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n-->\n<!-- Lighthouse run warnings -->\n",
"new_path": "lighthouse-core/report/html/templates.html",
"old_path": "lighthouse-core/report/html/templates.html"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | report: adopt 80-char line-length license (#5757) | 1 | report | null |
791,834 | 30.07.2018 14:47:19 | 25,200 | e367395c564878d396d9abbeb880c521581e3085 | core(i18n): add locale fallback when language not supported | [
{
"change_type": "MODIFY",
"diff": "const defaultConfigPath = './default-config.js';\nconst defaultConfig = require('./default-config.js');\nconst fullConfig = require('./full-config.js');\n-const constants = require('./constants');\n+const constants = require('./constants.js');\n+const i18n = require('./../lib/i18n.js');\nconst isDeepEqual = require('lodash.isequal');\nconst log = require('lighthouse-logger');\n@@ -401,18 +402,26 @@ class Config {\n}\n/**\n- * @param {LH.Config.SettingsJson=} settings\n+ * @param {LH.Config.SettingsJson=} settingsJson\n* @param {LH.Flags=} flags\n* @return {LH.Config.Settings}\n*/\n- static initSettings(settings = {}, flags) {\n+ static initSettings(settingsJson = {}, flags) {\n+ // If a locale is requested in flags or settings, use it. A typical CLI run will not have one,\n+ // however `lookupLocale` will always determine which of our supported locales to use (falling\n+ // back if necessary).\n+ const locale = i18n.lookupLocale((flags && flags.locale) || settingsJson.locale);\n+\n// Fill in missing settings with defaults\nconst {defaultSettings} = constants;\n- const settingWithDefaults = merge(deepClone(defaultSettings), settings, true);\n+ const settingWithDefaults = merge(deepClone(defaultSettings), settingsJson, true);\n// Override any applicable settings with CLI flags\nconst settingsWithFlags = merge(settingWithDefaults || {}, cleanFlagsForSettings(flags), true);\n+ // Locale is special and comes only from flags/settings/lookupLocale.\n+ settingsWithFlags.locale = locale;\n+\nreturn settingsWithFlags;\n}\n",
"new_path": "lighthouse-core/config/config.js",
"old_path": "lighthouse-core/config/config.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -39,7 +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\n+ locale: 'en-US', // actual default determined by Config using lib/i18n\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": "@@ -10,6 +10,7 @@ const isDeepEqual = require('lodash.isequal');\nconst log = require('lighthouse-logger');\nconst MessageFormat = require('intl-messageformat').default;\nconst MessageParser = require('intl-messageformat-parser');\n+const lookupClosestLocale = require('lookup-closest-locale');\nconst LOCALES = require('./locales');\nconst LH_ROOT = path.join(__dirname, '../../');\n@@ -66,6 +67,24 @@ const formats = {\n},\n};\n+/**\n+ * Look up the best available locale for the requested language through these fall backs:\n+ * - exact match\n+ * - progressively shorter prefixes (`de-CH-1996` -> `de-CH` -> `de`)\n+ * - the default locale ('en-US') if no match is found\n+ *\n+ * If `locale` isn't provided, the default is used.\n+ * @param {string=} locale\n+ * @return {LH.Locale}\n+ */\n+function lookupLocale(locale) {\n+ // TODO: could do more work to sniff out default locale\n+ const canonicalLocale = Intl.getCanonicalLocales(locale)[0];\n+\n+ const closestLocale = lookupClosestLocale(canonicalLocale, LOCALES);\n+ return closestLocale || 'en-US';\n+}\n+\n/**\n* @param {string} icuMessage\n* @param {Record<string, *>} [values]\n@@ -118,7 +137,7 @@ const _icuMessageInstanceMap = new Map();\n* @return {{formattedString: string, icuMessage: string}}\n*/\nfunction _formatIcuMessage(locale, icuMessageId, icuMessage, values) {\n- const localeMessages = LOCALES[locale] || {};\n+ const localeMessages = LOCALES[locale];\nconst localeMessage = localeMessages[icuMessageId] && localeMessages[icuMessageId].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@@ -150,15 +169,6 @@ function _formatPathAsString(pathInLHR) {\nreturn pathAsString;\n}\n-/**\n- * @return {LH.Locale}\n- */\n-function getDefaultLocale() {\n- const defaultLocale = MessageFormat.defaultLocale;\n- if (defaultLocale in LOCALES) return /** @type {LH.Locale} */ (defaultLocale);\n- return 'en-US';\n-}\n-\n/**\n* @param {LH.Locale} locale\n* @return {LH.I18NRendererStrings}\n@@ -208,7 +218,7 @@ function createMessageInstanceIdFn(filename, fileStrings) {\n/**\n* @param {string} icuMessageIdOrRawString\n- * @param {LH.Locale} [locale]\n+ * @param {LH.Locale} locale\n* @return {string}\n*/\nfunction getFormatted(icuMessageIdOrRawString, locale) {\n@@ -221,10 +231,10 @@ function getFormatted(icuMessageIdOrRawString, locale) {\n/**\n* @param {string} icuMessageInstanceId\n- * @param {LH.Locale} [locale]\n+ * @param {LH.Locale} locale\n* @return {{icuMessageInstance: IcuMessageInstance, formattedString: string}}\n*/\n-function _resolveIcuMessageInstanceId(icuMessageInstanceId, locale = 'en-US') {\n+function _resolveIcuMessageInstanceId(icuMessageInstanceId, locale) {\nconst matches = icuMessageInstanceId.match(MESSAGE_INSTANCE_ID_REGEX);\nif (!matches) throw new Error(`${icuMessageInstanceId} is not a valid message instance ID`);\n@@ -282,7 +292,7 @@ function replaceIcuMessageInstanceIds(lhr, locale) {\nmodule.exports = {\n_formatPathAsString,\nUIStrings,\n- getDefaultLocale,\n+ lookupLocale,\ngetRendererFormattedStrings,\ncreateMessageInstanceIdFn,\ngetFormatted,\n",
"new_path": "lighthouse-core/lib/i18n.js",
"old_path": "lighthouse-core/lib/i18n.js"
},
{
"change_type": "MODIFY",
"diff": "* 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-module.exports = {\n+/** @typedef {Record<string, {message: string}>} LocaleMessages */\n+\n+/** @type {Record<LH.Locale, LocaleMessages>} */\n+const locales = {\n+ 'ar': require('./ar-XB.json'), // TODO: fallback not needed when ar translation available\n+ 'ar-XB': require('./ar-XB.json'),\n+ 'en': require('./en-US.json'), // en-* fallback\n'en-US': require('./en-US.json'),\n'en-XA': require('./en-XA.json'),\n- 'ar-XB': require('./ar-XB.json'),\n};\n+\n+module.exports = locales;\n",
"new_path": "lighthouse-core/lib/locales/index.js",
"old_path": "lighthouse-core/lib/locales/index.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -32,7 +32,6 @@ class Runner {\ntry {\nconst startTime = Date.now();\nconst settings = opts.config.settings;\n- settings.locale = settings.locale || i18n.getDefaultLocale();\n/**\n* List of top-level warnings for this Lighthouse run.\n@@ -218,7 +217,7 @@ class Runner {\n*/\nstatic async _runAudit(auditDefn, artifacts, settings, runWarnings) {\nconst audit = auditDefn.implementation;\n- const status = `Evaluating: ${i18n.getFormatted(audit.meta.title)}`;\n+ const status = `Evaluating: ${i18n.getFormatted(audit.meta.title, 'en-US')}`;\nlog.log('status', status);\nlet auditResult;\n",
"new_path": "lighthouse-core/runner.js",
"old_path": "lighthouse-core/runner.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -12,6 +12,7 @@ const defaultConfig = require('../../config/default-config.js');\nconst log = require('lighthouse-logger');\nconst Gatherer = require('../../gather/gatherers/gatherer');\nconst Audit = require('../../audits/audit');\n+const i18n = require('../../lib/i18n');\n/* eslint-env jest */\n@@ -597,6 +598,29 @@ describe('Config', () => {\nassert.ok(typeof config.settings.maxWaitForLoad === 'number', 'missing setting from default');\n});\n+ describe('locale', () => {\n+ it('falls back to default locale if none specified', () => {\n+ const config = new Config({settings: undefined});\n+ // Don't assert specific locale so it isn't tied to where tests are run, but\n+ // check that it's valid and available.\n+ assert.ok(config.settings.locale);\n+ assert.strictEqual(config.settings.locale, i18n.lookupLocale(config.settings.locale));\n+ });\n+\n+ it('uses config setting for locale if set', () => {\n+ const locale = 'ar-XB';\n+ const config = new Config({settings: {locale}});\n+ assert.strictEqual(config.settings.locale, locale);\n+ });\n+\n+ it('uses flag setting for locale if set', () => {\n+ const settingsLocale = 'en-XA';\n+ const flagsLocale = 'ar-XB';\n+ const config = new Config({settings: {locale: settingsLocale}}, {locale: flagsLocale});\n+ assert.strictEqual(config.settings.locale, flagsLocale);\n+ });\n+ });\n+\nit('is idempotent when accepting a canonicalized Config as valid ConfigJson input', () => {\nconst config = new Config(defaultConfig);\nconst configAgain = new Config(config);\n",
"new_path": "lighthouse-core/test/config/config-test.js",
"old_path": "lighthouse-core/test/config/config-test.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 locales = require('../../../lib/locales/index.js');\n+const assert = require('assert');\n+\n+/* eslint-env jest */\n+\n+describe('locales', () => {\n+ it('has only canonical language tags', () => {\n+ for (const locale of Object.keys(locales)) {\n+ const canonicalLocale = Intl.getCanonicalLocales(locale)[0];\n+ assert.strictEqual(locale, canonicalLocale);\n+ }\n+ });\n+\n+ it('has a base language prefix fallback for all supported languages', () => {\n+ for (const locale of Object.keys(locales)) {\n+ const basePrefix = locale.split('-')[0];\n+ assert.ok(locales[basePrefix]);\n+ }\n+ });\n+});\n",
"new_path": "lighthouse-core/test/lib/locales/index-test.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "const RawProtocol = require('../../../lighthouse-core/gather/connections/raw');\nconst Runner = require('../../../lighthouse-core/runner');\nconst Config = require('../../../lighthouse-core/config/config');\n-const i18n = require('../../../lighthouse-core/lib/i18n');\nconst defaultConfig = require('../../../lighthouse-core/config/default-config.js');\nconst log = require('lighthouse-logger');\n@@ -28,7 +27,6 @@ function runLighthouseForConnection(\nconst config = new Config({\nextends: 'lighthouse:default',\nsettings: {\n- locale: i18n.getDefaultLocale(),\nonlyCategories: categoryIDs,\n},\n}, options.flags);\n",
"new_path": "lighthouse-extension/app/src/lighthouse-background.js",
"old_path": "lighthouse-extension/app/src/lighthouse-background.js"
},
{
"change_type": "MODIFY",
"diff": "\"js-library-detector\": \"^4.3.1\",\n\"lighthouse-logger\": \"^1.0.0\",\n\"lodash.isequal\": \"^4.5.0\",\n+ \"lookup-closest-locale\": \"6.0.4\",\n\"metaviewport-parser\": \"0.2.0\",\n\"mkdirp\": \"0.5.1\",\n\"opn\": \"4.0.2\",\n",
"new_path": "package.json",
"old_path": "package.json"
},
{
"change_type": "MODIFY",
"diff": "\"./typings\"\n],\n+ \"resolveJsonModule\": true,\n\"diagnostics\": true\n},\n\"include\": [\n",
"new_path": "tsconfig.json",
"old_path": "tsconfig.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -15,6 +15,12 @@ declare global {\ncode?: string;\n}\n+ // Augment Intl to include\n+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/getCanonicalLocales\n+ namespace Intl {\n+ var getCanonicalLocales: (locales?: string | Array<string>) => Array<string>;\n+ }\n+\n/** Make properties K in T optional. */\ntype MakeOptional<T, K extends keyof T> = {\n[P in Exclude<keyof T, K>]: T[P]\n@@ -52,13 +58,13 @@ declare global {\ncpuSlowdownMultiplier?: number\n}\n- export type Locale = 'en-US'|'en-XA'|'ar-XB';\n+ export type Locale = 'ar'|'ar-XB'|'en'|'en-US'|'en-XA';\nexport type OutputMode = 'json' | 'html' | 'csv';\ninterface SharedFlagsSettings {\noutput?: OutputMode|OutputMode[];\n- locale?: Locale | null;\n+ locale?: Locale;\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": "+/**\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+\n+declare module 'lookup-closest-locale' {\n+ function lookupClosestLocale(locale: string|undefined, available: Record<LH.Locale, any>): LH.Locale|undefined;\n+\n+ export = lookupClosestLocale;\n+}\n",
"new_path": "typings/lookup-closest-locale/index.d.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -4168,6 +4168,10 @@ longest@^1.0.1:\nversion \"1.0.1\"\nresolved \"https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097\"\n+lookup-closest-locale@6.0.4:\n+ version \"6.0.4\"\n+ resolved \"https://registry.yarnpkg.com/lookup-closest-locale/-/lookup-closest-locale-6.0.4.tgz#1279fed7546a601647bbc980f64423ee990a8590\"\n+\nloose-envify@^1.0.0:\nversion \"1.2.0\"\nresolved \"https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.2.0.tgz#69a65aad3de542cf4ee0f4fe74e8e33c709ccb0f\"\n",
"new_path": "yarn.lock",
"old_path": "yarn.lock"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | core(i18n): add locale fallback when language not supported (#5746) | 1 | core | i18n |
807,849 | 30.07.2018 15:17:08 | 25,200 | 6ecdd83d14f3b9d0cac62cc68b4066ec554e79ce | feat(changed): Support list output options
BREAKING CHANGE: The package names emitted to stdout are no longer prefixed by a "- ", and private packages are no longer displayed by default. | [
{
"change_type": "MODIFY",
"diff": "# `@lerna/changed`\n-> Check which packages have changed since the last publish\n+> List local packages that have changed since the last tagged release\n## Usage\n+The output of `lerna changed` is a list of packages that would be the subjects of the next `lerna version` or `lerna publish` execution.\n+\n```sh\n$ lerna changed\n+package-1\n+package-2\n```\n-Check which `packages` have changed since the last release (the last git tag).\n-\n-Lerna determines the last git tag created and runs `git diff --name-only v6.8.1` to get all files changed since that tag. It then returns an array of packages that have an updated file.\n-\n-**Note that configuration for the `publish` command _also_ affects the\n-`changed` command. For example `command.publish.ignoreChanges`**\n+**Note:** `lerna.json` configuration for `lerna publish` _and_ `lerna version` also affects\n+`lerna changed`, e.g. `command.publish.ignoreChanges`.\n## Options\n-### `--json`\n+`lerna changed` supports all of the flags supported by [`lerna ls`](https://github.com/lerna/lerna/tree/master/commands/list#options):\n-```sh\n-$ lerna changed --json\n-```\n-\n-When run with this flag, `changed` will return an array of objects in the following format:\n+* [`--json`](https://github.com/lerna/lerna/tree/master/commands/list#--json)\n+* [`-a`, `--all`](https://github.com/lerna/lerna/tree/master/commands/list#--all)\n+* [`-l`, `--long`](https://github.com/lerna/lerna/tree/master/commands/list#--long)\n+* [`-p`, `--parseable`](https://github.com/lerna/lerna/tree/master/commands/list#--parseable)\n-```json\n-[\n- {\n- \"name\": \"package\",\n- \"version\": \"1.0.0\",\n- \"private\": false\n- }\n-]\n-```\n+Unlike `lerna ls`, however, `lerna changed` **does not** support [filter options](https://www.npmjs.com/package/@lerna/filter-options), as filtering is not supported by `lerna version` or `lerna publish`.\n+`lerna changed` also supports all the flags supported by [`lerna version`](https://github.com/lerna/lerna/tree/master/commands/version#options), but the only relevant one is [`--ignore-changes`](https://github.com/lerna/lerna/tree/master/commands/version#--ignore-changes).\n",
"new_path": "commands/changed/README.md",
"old_path": "commands/changed/README.md"
},
{
"change_type": "DELETE",
"diff": "-// Jest Snapshot v1, https://goo.gl/fbAQLP\n-\n-exports[`ChangedCommand basic should list all packages when no tag is found 1`] = `\n-\"- package-1\n-- package-2\n-- package-3\n-- package-4\n-- package-5 (private)\"\n-`;\n-\n-exports[`ChangedCommand basic should list changes 1`] = `\n-\"- package-2\n-- package-3\"\n-`;\n-\n-exports[`ChangedCommand basic should list changes in private packages 1`] = `\"- package-5 (private)\"`;\n-\n-exports[`ChangedCommand basic should list changes with --force-publish 1`] = `\n-\"- package-1\n-- package-2\n-- package-3\n-- package-4\n-- package-5 (private)\"\n-`;\n-\n-exports[`ChangedCommand basic should list changes with --force-publish package-2 --force-publish package-4 1`] = `\n-\"- package-2\n-- package-3\n-- package-4\"\n-`;\n-\n-exports[`ChangedCommand basic should list changes with --force-publish package-2,package-4 1`] = `\n-\"- package-2\n-- package-3\n-- package-4\"\n-`;\n-\n-exports[`ChangedCommand basic should list changes without ignored files 1`] = `\"- package-3\"`;\n-\n-exports[`ChangedCommand circular should list changes 1`] = `\n-\"- package-3\n-- package-4\"\n-`;\n-\n-exports[`ChangedCommand circular should list changes with --force-publish * 1`] = `\n-\"- package-1\n-- package-2\n-- package-3\n-- package-4\n-- package-5 (private)\"\n-`;\n-\n-exports[`ChangedCommand circular should list changes with --force-publish package-2 1`] = `\n-\"- package-2\n-- package-3\n-- package-4\"\n-`;\n-\n-exports[`ChangedCommand circular should list changes without ignored files 1`] = `\n-\"- package-3\n-- package-4\"\n-`;\n-\n-exports[`ChangedCommand with --json should list changes as a json object 1`] = `\n-Array [\n- Object {\n- \"name\": \"package-2\",\n- \"private\": false,\n- \"version\": \"1.0.0\",\n- },\n- Object {\n- \"name\": \"package-3\",\n- \"private\": false,\n- \"version\": \"1.0.0\",\n- },\n-]\n-`;\n",
"new_path": null,
"old_path": "commands/changed/__tests__/__snapshots__/changed-command.test.js.snap"
},
{
"change_type": "MODIFY",
"diff": "@@ -19,11 +19,15 @@ const updateLernaConfig = require(\"@lerna-test/update-lerna-config\");\n// file under test\nconst lernaChanged = require(\"@lerna-test/command-runner\")(require(\"../command\"));\n-const touchFile = cwd => filePath => touch(path.join(cwd, filePath));\n+// remove quotes around strings\n+expect.addSnapshotSerializer({ test: val => typeof val === \"string\", print: val => val });\n+\n+// normalize temp directory paths in snapshots\n+expect.addSnapshotSerializer(require(\"@lerna-test/serialize-tempdir\"));\nconst setupGitChanges = async (cwd, filePaths) => {\nawait gitTag(cwd, \"v1.0.0\");\n- await Promise.all(filePaths.map(touchFile(cwd)));\n+ await Promise.all(filePaths.map(fp => touch(path.join(cwd, fp))));\nawait gitAdd(cwd, \"-A\");\nawait gitCommit(cwd, \"Commit\");\n};\n@@ -40,7 +44,10 @@ describe(\"ChangedCommand\", () => {\nawait setupGitChanges(testDir, [\"packages/package-2/random-file\"]);\nawait lernaChanged(testDir)();\n- expect(output.logged()).toMatchSnapshot();\n+ expect(output.logged()).toMatchInlineSnapshot(`\n+package-2\n+package-3\n+`);\n});\nit(\"should list all packages when no tag is found\", async () => {\n@@ -48,7 +55,12 @@ describe(\"ChangedCommand\", () => {\nawait lernaChanged(testDir)();\n- expect(output.logged()).toMatchSnapshot();\n+ expect(output.logged()).toMatchInlineSnapshot(`\n+package-1\n+package-2\n+package-3\n+package-4\n+`);\n});\nit(\"should list changes with --force-publish\", async () => {\n@@ -57,7 +69,12 @@ describe(\"ChangedCommand\", () => {\nawait setupGitChanges(testDir, [\"packages/package-2/random-file\"]);\nawait lernaChanged(testDir)(\"--force-publish\");\n- expect(output.logged()).toMatchSnapshot();\n+ expect(output.logged()).toMatchInlineSnapshot(`\n+package-1\n+package-2\n+package-3\n+package-4\n+`);\n});\nit(\"should list changes with --force-publish package-2,package-4\", async () => {\n@@ -66,7 +83,11 @@ describe(\"ChangedCommand\", () => {\nawait setupGitChanges(testDir, [\"packages/package-3/random-file\"]);\nawait lernaChanged(testDir)(\"--force-publish\", \"package-2,package-4\");\n- expect(output.logged()).toMatchSnapshot();\n+ expect(output.logged()).toMatchInlineSnapshot(`\n+package-2\n+package-3\n+package-4\n+`);\n});\nit(\"should list changes with --force-publish package-2 --force-publish package-4\", async () => {\n@@ -75,7 +96,11 @@ describe(\"ChangedCommand\", () => {\nawait setupGitChanges(testDir, [\"packages/package-3/random-file\"]);\nawait lernaChanged(testDir)(\"--force-publish\", \"package-2\", \"--force-publish\", \"package-4\");\n- expect(output.logged()).toMatchSnapshot();\n+ expect(output.logged()).toMatchInlineSnapshot(`\n+package-2\n+package-3\n+package-4\n+`);\n});\nit(\"should list changes without ignored files\", async () => {\n@@ -92,16 +117,16 @@ describe(\"ChangedCommand\", () => {\nawait setupGitChanges(testDir, [\"packages/package-2/ignored-file\", \"packages/package-3/random-file\"]);\nawait lernaChanged(testDir)();\n- expect(output.logged()).toMatchSnapshot();\n+ expect(output.logged()).toMatchInlineSnapshot(`package-3`);\n});\n- it(\"should list changes in private packages\", async () => {\n+ it(\"should list changes in private packages with --all\", async () => {\nconst testDir = await initFixture(\"basic\");\nawait setupGitChanges(testDir, [\"packages/package-5/random-file\"]);\n- await lernaChanged(testDir)();\n+ await lernaChanged(testDir)(\"--all\");\n- expect(output.logged()).toMatchSnapshot();\n+ expect(output.logged()).toMatchInlineSnapshot(`package-5 (PRIVATE)`);\n});\nit(\"should return a non-zero exit code when there are no changes\", async () => {\n@@ -115,6 +140,20 @@ describe(\"ChangedCommand\", () => {\n// reset exit code\nprocess.exitCode = undefined;\n});\n+\n+ it(\"supports all listable flags\", async () => {\n+ const testDir = await initFixture(\"basic\");\n+\n+ await lernaChanged(testDir)(\"-alp\");\n+\n+ expect(output.logged()).toMatchInlineSnapshot(`\n+<PROJECT_ROOT>/packages/package-1:package-1:1.0.0\n+<PROJECT_ROOT>/packages/package-2:package-2:1.0.0\n+<PROJECT_ROOT>/packages/package-3:package-3:1.0.0\n+<PROJECT_ROOT>/packages/package-4:package-4:1.0.0\n+<PROJECT_ROOT>/packages/package-5:package-5:1.0.0:PRIVATE\n+`);\n+ });\n});\n/** =========================================================================\n@@ -128,7 +167,10 @@ describe(\"ChangedCommand\", () => {\nawait setupGitChanges(testDir, [\"packages/package-3/random-file\"]);\nawait lernaChanged(testDir)();\n- expect(output.logged()).toMatchSnapshot();\n+ expect(output.logged()).toMatchInlineSnapshot(`\n+package-3\n+package-4\n+`);\n});\nit(\"should list changes with --force-publish *\", async () => {\n@@ -137,7 +179,12 @@ describe(\"ChangedCommand\", () => {\nawait setupGitChanges(testDir, [\"packages/package-2/random-file\"]);\nawait lernaChanged(testDir)(\"--force-publish\", \"*\");\n- expect(output.logged()).toMatchSnapshot();\n+ expect(output.logged()).toMatchInlineSnapshot(`\n+package-1\n+package-2\n+package-3\n+package-4\n+`);\n});\nit(\"should list changes with --force-publish package-2\", async () => {\n@@ -146,7 +193,11 @@ describe(\"ChangedCommand\", () => {\nawait setupGitChanges(testDir, [\"packages/package-4/random-file\"]);\nawait lernaChanged(testDir)(\"--force-publish\", \"package-2\");\n- expect(output.logged()).toMatchSnapshot();\n+ expect(output.logged()).toMatchInlineSnapshot(`\n+package-2\n+package-3\n+package-4\n+`);\n});\nit(\"should list changes without ignored files\", async () => {\n@@ -163,7 +214,10 @@ describe(\"ChangedCommand\", () => {\nawait setupGitChanges(testDir, [\"packages/package-2/ignored-file\", \"packages/package-3/random-file\"]);\nawait lernaChanged(testDir)();\n- expect(output.logged()).toMatchSnapshot();\n+ expect(output.logged()).toMatchInlineSnapshot(`\n+package-3\n+package-4\n+`);\n});\nit(\"should return a non-zero exit code when there are no changes\", async () => {\n@@ -192,7 +246,22 @@ describe(\"ChangedCommand\", () => {\n// Output should be a parseable string\nconst jsonOutput = JSON.parse(output.logged());\n- expect(jsonOutput).toMatchSnapshot();\n+ expect(jsonOutput).toMatchInlineSnapshot(`\n+Array [\n+ Object {\n+ location: <PROJECT_ROOT>/packages/package-2,\n+ name: package-2,\n+ private: false,\n+ version: 1.0.0,\n+ },\n+ Object {\n+ location: <PROJECT_ROOT>/packages/package-3,\n+ name: package-3,\n+ private: false,\n+ version: 1.0.0,\n+ },\n+]\n+`);\n});\n});\n});\n",
"new_path": "commands/changed/__tests__/changed-command.test.js",
"old_path": "commands/changed/__tests__/changed-command.test.js"
},
{
"change_type": "MODIFY",
"diff": "\"use strict\";\nconst versionOptions = require(\"@lerna/version/command\").builder;\n+const listable = require(\"@lerna/listable\");\n/**\n* @see https://github.com/yargs/yargs/blob/master/docs/advanced.md#providing-a-command-module\n@@ -9,16 +10,13 @@ exports.command = \"changed\";\nexports.aliases = [\"updated\"];\n-exports.describe = \"Check which packages have changed since the last release\";\n+exports.describe = \"List local packages that have changed since the last tagged release\";\n-exports.builder = yargs =>\n- versionOptions(yargs, true).options({\n- json: {\n- describe: \"Show information in JSON format\",\n- group: \"Command Options:\",\n- type: \"boolean\",\n- },\n- });\n+exports.builder = yargs => {\n+ listable.options(yargs);\n+\n+ return versionOptions(yargs, true);\n+};\nexports.handler = function handler(argv) {\nreturn require(\".\")(argv);\n",
"new_path": "commands/changed/command.js",
"old_path": "commands/changed/command.js"
},
{
"change_type": "MODIFY",
"diff": "\"use strict\";\n-const chalk = require(\"chalk\");\n-\nconst Command = require(\"@lerna/command\");\nconst collectUpdates = require(\"@lerna/collect-updates\");\n+const listable = require(\"@lerna/listable\");\nconst output = require(\"@lerna/output\");\nmodule.exports = factory;\n@@ -19,40 +18,28 @@ class ChangedCommand extends Command {\n}\ninitialize() {\n- this.updates = collectUpdates(this.filteredPackages, this.packageGraph, this.execOpts, this.options);\n- this.count = this.updates.length;\n+ const updates = collectUpdates(this.filteredPackages, this.packageGraph, this.execOpts, this.options);\n- const proceedWithUpdates = this.count > 0;\n+ this.result = listable.format(updates.map(node => node.pkg), this.options);\n- if (!proceedWithUpdates) {\n+ if (this.result.count === 0) {\nthis.logger.info(\"\", \"No changed packages found\");\nprocess.exitCode = 1;\n- }\n- return proceedWithUpdates;\n+ // prevents execute()\n+ return false;\n+ }\n}\nexecute() {\n- const updatedPackages = this.updates.map(({ pkg }) => ({\n- name: pkg.name,\n- version: pkg.version,\n- private: pkg.private,\n- }));\n-\n- const formattedUpdates = this.options.json\n- ? JSON.stringify(updatedPackages, null, 2)\n- : updatedPackages\n- .map(pkg => `- ${pkg.name}${pkg.private ? ` (${chalk.red(\"private\")})` : \"\"}`)\n- .join(\"\\n\");\n-\n- output(formattedUpdates);\n+ output(this.result.text);\nthis.logger.success(\n\"found\",\n\"%d %s ready to publish\",\n- this.count,\n- this.count === 1 ? \"package\" : \"packages\"\n+ this.result.count,\n+ this.result.count === 1 ? \"package\" : \"packages\"\n);\n}\n}\n",
"new_path": "commands/changed/index.js",
"old_path": "commands/changed/index.js"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@lerna/changed\",\n\"version\": \"3.0.0-rc.0\",\n- \"description\": \"Check which packages have changed since the last publish\",\n+ \"description\": \"List local packages that have changed since the last tagged release\",\n\"keywords\": [\n\"lerna\",\n\"command\"\n\"dependencies\": {\n\"@lerna/collect-updates\": \"file:../../utils/collect-updates\",\n\"@lerna/command\": \"file:../../core/command\",\n+ \"@lerna/listable\": \"file:../../utils/listable\",\n\"@lerna/output\": \"file:../../utils/output\",\n- \"@lerna/version\": \"file:../version\",\n- \"chalk\": \"^2.3.1\"\n+ \"@lerna/version\": \"file:../version\"\n}\n}\n",
"new_path": "commands/changed/package.json",
"old_path": "commands/changed/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"requires\": {\n\"@lerna/collect-updates\": \"file:utils/collect-updates\",\n\"@lerna/command\": \"file:core/command\",\n+ \"@lerna/listable\": \"file:utils/listable\",\n\"@lerna/output\": \"file:utils/output\",\n- \"@lerna/version\": \"file:commands/version\",\n- \"chalk\": \"^2.3.1\"\n+ \"@lerna/version\": \"file:commands/version\"\n}\n},\n\"@lerna/child-process\": {\n",
"new_path": "package-lock.json",
"old_path": "package-lock.json"
}
] | JavaScript | MIT License | lerna/lerna | feat(changed): Support list output options
BREAKING CHANGE: The package names emitted to stdout are no longer prefixed by a "- ", and private packages are no longer displayed by default. | 1 | feat | changed |
807,849 | 30.07.2018 15:18:48 | 25,200 | 84d961c2ef75b27bf88ab3373f52cf92d3971522 | docs: Add root link to version command | [
{
"change_type": "MODIFY",
"diff": "* [Troubleshooting](#troubleshooting)\n* Commands\n- [`lerna publish`](./commands/publish#readme)\n+ - [`lerna version`](./commands/version#readme)\n- [`lerna bootstrap`](./commands/bootstrap#readme)\n- [`lerna list`](./commands/list#readme)\n- [`lerna changed`](./commands/changed#readme)\n",
"new_path": "README.md",
"old_path": "README.md"
}
] | JavaScript | MIT License | lerna/lerna | docs: Add root link to version command | 1 | docs | null |
807,849 | 30.07.2018 15:19:50 | 25,200 | dff8176db77fe463025aadc7ec11821be8c53e5a | docs(list): Add options TOC, fix location format, tweak option headings | [
{
"change_type": "MODIFY",
"diff": "@@ -24,9 +24,14 @@ In any case, you can always pass `--loglevel silent` to create pristine chains o\n## Options\n+* [`--json`](#--json)\n+* [`-a`, `--all`](#--all)\n+* [`-l`, `--long`](#--long)\n+* [`-p`, `--parseable`](#--parseable)\n+\n`lerna ls` respects the `--ignore` and `--scope` flags (see [Filter Flags](https://www.npmjs.com/package/@lerna/filter-options)).\n-### --json\n+### `--json`\nShow information as a JSON array.\n@@ -37,13 +42,13 @@ $ lerna ls --json\n\"name\": \"package-1\",\n\"version\": \"1.0.0\",\n\"private\": false,\n- \"location\": \"/path/to/packages/pkg-1/\"\n+ \"location\": \"/path/to/packages/pkg-1\"\n},\n{\n\"name\": \"package-2\",\n\"version\": \"1.0.0\",\n\"private\": false,\n- \"location\": \"/path/to/packages/pkg-2/\"\n+ \"location\": \"/path/to/packages/pkg-2\"\n}\n]\n```\n@@ -55,7 +60,7 @@ $ lerna ls --json --all | json -a -c 'this.private === true' name\npackage-3\n```\n-### --all\n+### `--all`\nAlias: `-a`\n@@ -68,7 +73,7 @@ package-2\npackage-3 (private)\n```\n-### --long\n+### `--long`\nAlias: `-l`\n@@ -85,7 +90,7 @@ package-2 v1.0.2 packages/pkg-2\npackage-3 v1.0.3 packages/pkg-3 (private)\n```\n-### --parseable\n+### `--parseable`\nAlias: `-p`\n",
"new_path": "commands/list/README.md",
"old_path": "commands/list/README.md"
}
] | JavaScript | MIT License | lerna/lerna | docs(list): Add options TOC, fix location format, tweak option headings | 1 | docs | list |
807,849 | 30.07.2018 15:20:08 | 25,200 | aa6d3d02983f4a47fc92862cdb0fb9d3f4f7f723 | docs(version): Document --ignore-changes option | [
{
"change_type": "MODIFY",
"diff": "@@ -43,6 +43,7 @@ If you have any packages with a prerelease version number (e.g. `2.0.0-beta.3`)\n* [`--changelog-preset`](#--changelog-preset)\n* [`--exact`](#--exact)\n* [`--force-publish`](#--force-publish)\n+* [`--ignore-changes`](#--ignore-changes)\n* [`--git-remote`](#--git-remote-name)\n* [`--git-tag-version`](#--git-tag-version)\n* [`--message`](#--message-msg)\n@@ -153,6 +154,28 @@ When run with this flag, `lerna version` will force publish the specified packag\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+### `--ignore-changes`\n+\n+Ignore changes in files matched by glob(s) when detecting changed packages.\n+\n+```sh\n+lerna version --ignore-changes '**/*.md' '**/__tests__/**'\n+```\n+\n+This option is best specified as root `lerna.json` configuration, both to avoid premature shell evaluation of the globs and to share the config with `lerna diff` and `lerna changed`:\n+\n+```json\n+{\n+ \"ignoreChanges\": [\n+ \"**/__fixtures__/**\",\n+ \"**/__tests__/**\",\n+ \"**/*.md\"\n+ ]\n+}\n+```\n+\n+Pass `--no-ignore-changes` to disable any existing durable configuration.\n+\n### `--git-remote <name>`\n```sh\n",
"new_path": "commands/version/README.md",
"old_path": "commands/version/README.md"
}
] | JavaScript | MIT License | lerna/lerna | docs(version): Document --ignore-changes option | 1 | docs | version |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.