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
⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
730,413
|
08.04.2018 13:52:54
| 14,400
|
a6cbcc6a19d0fb4cd73122a80614dfce2ef6b946
|
refactor(journeys): use consistent style across data api space widget tests
|
[
{
"change_type": "MODIFY",
"diff": "@@ -15,8 +15,7 @@ import {\nFEATURE_FLAG_ROSTER\n} from '../../../lib/test-helpers/space-widget/roster';\n-describe('Widget Space', () => {\n- describe('Data API', () => {\n+describe('Widget Space: Data API', () => {\nconst browserLocal = browser.select('browserLocal');\nconst browserName = process.env.BROWSER || 'chrome';\nconst platform = process.env.PLATFORM || 'mac 10.12';\n@@ -39,11 +38,7 @@ describe('Widget Space', () => {\n});\nbefore('load browsers', () => {\n- browser\n- .url('/data-api/space.html')\n- .execute(() => {\n- localStorage.clear();\n- });\n+ browser.url('/data-api/space.html');\n});\nbefore('create marty', () => testUsers.create({count: 1, config: {displayName: 'Marty McFly'}})\n@@ -111,8 +106,6 @@ describe('Widget Space', () => {\nbefore('pause to let test users establish', () => browser.pause(5000));\n- after('disconnect', () => marty.spark.internal.mercury.disconnect());\n-\nbefore('create space', () => marty.spark.internal.conversation.create({\ndisplayName: 'Test Widget Space',\nparticipants: [marty, docbrown, lorraine]\n@@ -132,6 +125,7 @@ describe('Widget Space', () => {\ndocument.getElementById('ciscospark-widget').appendChild(csmmDom);\nwindow.loadBundle('/dist-space/bundle.js');\n}, marty.token.access_token, conversation.id);\n+ browserLocal.waitForVisible(elements.messageWidget);\n});\nit('loads the test page', () => {\n@@ -167,16 +161,16 @@ describe('Widget Space', () => {\nit('closes the menu with the exit button', () => {\nbrowserLocal.click(elements.exitButton);\n- browserLocal.waitForVisible(elements.activityMenu, 1500, true);\n+ browserLocal.waitForVisible(elements.activityMenu, 60000, true);\n});\nit('has a message button', () => {\nbrowserLocal.click(elements.menuButton);\n- browserLocal.element(elements.controlsContainer).element(elements.messageButton).waitForVisible();\n+ browserLocal.waitForVisible(elements.messageButton);\n});\nit('has a files button', () => {\n- browserLocal.element(elements.controlsContainer).element(elements.filesButton).waitForVisible();\n+ browserLocal.waitForVisible(elements.filesButton);\n});\nit('switches to files widget', () => {\n@@ -188,8 +182,8 @@ describe('Widget Space', () => {\n});\nit('hides menu and switches to message widget', () => {\n- browserLocal.element(elements.controlsContainer).element(elements.messageButton).click();\n- browserLocal.waitForVisible(elements.activityMenu, 1500, true);\n+ browserLocal.click(elements.messageButton);\n+ browserLocal.waitForVisible(elements.activityMenu, 60000, true);\nassert.isTrue(browserLocal.isVisible(elements.messageWidget));\n});\n});\n@@ -201,15 +195,11 @@ describe('Widget Space', () => {\n});\nit('has a close button', () => {\n- assert.isTrue(\n- browserLocal.element(rosterElements.rosterWidget)\n- .element(rosterElements.closeButton)\n- .isVisible()\n- );\n+ assert.isTrue(browserLocal.isVisible(rosterElements.closeButton));\n});\nit('has the total count of participants', () => {\n- assert.equal(browserLocal.element(rosterElements.rosterTitle).getText(), 'People (3)');\n+ assert.equal(browserLocal.getText(rosterElements.rosterTitle), 'People (3)');\n});\nit('has the participants listed', () => {\n@@ -222,22 +212,22 @@ describe('Widget Space', () => {\nit('searches and adds person to space', () => {\nsearchForPerson(browserLocal, biff.displayName, true);\n- browserLocal.element(rosterElements.rosterList).waitForVisible();\n+ browserLocal.waitForVisible(rosterElements.rosterList);\nbrowserLocal.waitUntil(() => {\n- const participantsText = browserLocal.element(rosterElements.rosterList).getText();\n+ const participantsText = browserLocal.getText(rosterElements.rosterList);\nreturn participantsText.includes(biff.displayName);\n- }, 15000, 'added person not found in participant list');\n+ }, 60000, 'added person not found in participant list');\nbrowserLocal.waitUntil(() => {\n- const rosterTitle = browserLocal.element(rosterElements.rosterTitle).getText();\n+ const rosterTitle = browserLocal.getText(rosterElements.rosterTitle);\nreturn rosterTitle === 'People (4)';\n- }, 15000, 'Participant count should update once user is added');\n+ }, 60000, 'Participant count should update once user is added');\n});\nit('closes the people roster widget', () => {\n- browserLocal.element(rosterElements.rosterWidget).element(rosterElements.closeButton).click();\n- browserLocal.element(rosterElements.rosterWidget).waitForVisible(1500, true);\n- });\n+ browserLocal.click(rosterElements.closeButton);\n+ browserLocal.waitForVisible(rosterElements.rosterWidget, 60000, true);\n});\n});\n});\n+ after('disconnect', () => marty.spark.internal.mercury.disconnect());\n});\n",
"new_path": "test/journeys/specs/space/dataApi/basic.js",
"old_path": "test/journeys/specs/space/dataApi/basic.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -7,18 +7,14 @@ import {switchToMeet} from '../../../lib/test-helpers/space-widget/main';\nimport {FEATURE_FLAG_ROSTER} from '../../../lib/test-helpers/space-widget/roster';\nimport {elements, declineIncomingCallTest, hangupDuringCallTest, FEATURE_FLAG_GROUP_CALLING} from '../../../lib/test-helpers/space-widget/meet';\n-describe('Widget Space', () => {\n+describe('Widget Space: Data API', () => {\nconst browserLocal = browser.select('browserLocal');\nconst browserRemote = browser.select('browserRemote');\nlet docbrown, lorraine, marty;\nlet conversation, local, remote;\nbefore('load browsers', () => {\n- browser\n- .url('/data-api/space.html')\n- .execute(() => {\n- localStorage.clear();\n- });\n+ browser.url('/data-api/space.html');\n});\nbefore('create marty', () => testUsers.create({count: 1, config: {displayName: 'Marty McFly'}})\n@@ -75,11 +71,6 @@ describe('Widget Space', () => {\nbefore('pause to let test users establish', () => browser.pause(5000));\n- after('disconnect', () => Promise.all([\n- marty.spark.internal.mercury.disconnect(),\n- lorraine.spark.internal.mercury.disconnect()\n- ]));\n-\nbefore('create space', () => marty.spark.internal.conversation.create({\ndisplayName: 'Test Widget Space',\nparticipants: [marty, docbrown, lorraine]\n@@ -122,7 +113,7 @@ describe('Widget Space', () => {\ndescribe('pre call experience', () => {\nit('has a call button', () => {\nswitchToMeet(browserLocal);\n- browserLocal.element(elements.meetWidget).element(elements.callButton).waitForVisible();\n+ browserLocal.waitForVisible(elements.callButton);\n});\n});\n@@ -140,4 +131,9 @@ describe('Widget Space', () => {\n});\n});\n});\n+\n+ after('disconnect', () => Promise.all([\n+ marty.spark.internal.mercury.disconnect(),\n+ lorraine.spark.internal.mercury.disconnect()\n+ ]));\n});\n",
"new_path": "test/journeys/specs/space/dataApi/meet.js",
"old_path": "test/journeys/specs/space/dataApi/meet.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -16,19 +16,15 @@ import {\nverifyMessageReceipt\n} from '../../../lib/test-helpers/space-widget/messaging';\n-describe('Widget Space', () => {\n- describe('Data API', () => {\n+describe('Widget Space: Data API', () => {\nconst browserLocal = browser.select('browserLocal');\nconst browserRemote = browser.select('browserRemote');\n+ const spaceWidget = '.ciscospark-space-widget';\nlet docbrown, lorraine, marty;\nlet conversation, local, remote;\nbefore('load browsers', () => {\n- browser\n- .url('/data-api/space.html')\n- .execute(() => {\n- localStorage.clear();\n- });\n+ browser.url('/data-api/space.html');\n});\nbefore('create marty', () => testUsers.create({count: 1, config: {displayName: 'Marty McFly'}})\n@@ -80,11 +76,6 @@ describe('Widget Space', () => {\nbefore('pause to let test users establish', () => browser.pause(5000));\n- after('disconnect', () => Promise.all([\n- marty.spark.internal.mercury.disconnect(),\n- lorraine.spark.internal.mercury.disconnect()\n- ]));\n-\nbefore('create space', () => marty.spark.internal.conversation.create({\ndisplayName: 'Test Widget Space',\nparticipants: [marty, docbrown, lorraine]\n@@ -105,7 +96,6 @@ describe('Widget Space', () => {\ndocument.getElementById('ciscospark-widget').appendChild(csmmDom);\nwindow.loadBundle('/dist-space/bundle.js');\n}, marty.token.access_token, conversation.id);\n- const spaceWidget = '.ciscospark-space-widget';\nlocal.browser.waitForVisible(spaceWidget);\n});\n@@ -121,6 +111,7 @@ describe('Widget Space', () => {\ndocument.getElementById('ciscospark-widget').appendChild(csmmDom);\nwindow.loadBundle('/dist-space/bundle.js');\n}, docbrown.token.access_token, conversation.id);\n+ remote.browser.waitForVisible(spaceWidget);\n});\ndescribe('messaging', () => {\n@@ -286,5 +277,10 @@ describe('Widget Space', () => {\n});\n});\n});\n+\n+ after('disconnect', () => Promise.all([\n+ marty.spark.internal.mercury.disconnect(),\n+ lorraine.spark.internal.mercury.disconnect()\n+ ]));\n});\n-});\n+\n",
"new_path": "test/journeys/specs/space/dataApi/messaging.js",
"old_path": "test/journeys/specs/space/dataApi/messaging.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -9,19 +9,14 @@ import {elements as messageElements} from '../../../lib/test-helpers/space-widge\nimport {answer, hangup, elements as meetElements} from '../../../lib/test-helpers/space-widget/meet';\nimport {constructHydraId} from '../../../lib/hydra';\n-describe('Widget Space', () => {\n- describe('Data API Settings', () => {\n+describe('Widget Space: Data API Settings', () => {\nconst browserLocal = browser.select('browserLocal');\nconst browserRemote = browser.select('browserRemote');\nlet docbrown, lorraine, marty;\nlet conversation;\nbefore('load browsers', () => {\n- browser\n- .url('/data-api/space.html')\n- .execute(() => {\n- localStorage.clear();\n- });\n+ browser.url('/data-api/space.html');\n});\nbefore('create marty', () => testUsers.create({count: 1, config: {displayName: 'Marty McFly'}})\n@@ -73,11 +68,6 @@ describe('Widget Space', () => {\nbefore('pause to let test users establish', () => browser.pause(5000));\n- after('disconnect', () => Promise.all([\n- marty.spark.internal.mercury.disconnect(),\n- lorraine.spark.internal.mercury.disconnect()\n- ]));\n-\nbefore('create space', () => marty.spark.internal.conversation.create({\ndisplayName: 'Test Widget Space',\nparticipants: [marty, docbrown, lorraine]\n@@ -106,9 +96,8 @@ describe('Widget Space', () => {\nit('opens meet widget', () => {\nbrowserLocal.waitForVisible(elements.meetWidget);\nbrowserLocal.waitForVisible(elements.meetButton);\n+ browserLocal.refresh();\n});\n-\n- after('refresh browsers to remove widgets', browser.refresh);\n});\ndescribe('initial activity setting: message', () => {\n@@ -130,9 +119,8 @@ describe('Widget Space', () => {\nit('opens message widget', () => {\nbrowserLocal.waitForVisible(elements.messageWidget);\nbrowserLocal.waitForVisible(`[placeholder=\"Send a message to ${conversation.displayName}\"]`);\n+ browserLocal.refresh();\n});\n-\n- after('refresh browsers to remove widgets', browser.refresh);\n});\ndescribe('start call setting', () => {\n@@ -147,8 +135,6 @@ describe('Widget Space', () => {\ndocument.getElementById('ciscospark-widget').appendChild(csmmDom);\nwindow.loadBundle('/dist-space/bundle.js');\n}, docbrown.token.access_token, conversation.id);\n- const spaceWidget = '.ciscospark-space-widget';\n- browserRemote.waitForVisible(spaceWidget);\n});\nbefore('inject marty token', () => {\n@@ -173,17 +159,10 @@ describe('Widget Space', () => {\nhangup(browserLocal);\nhangup(browserRemote);\n// Wait for end of locus session before continuing\n- browserLocal.waitUntil(\n- () => {\n- const message = browserLocal.getText(`${messageElements.lastActivity} ${messageElements.systemMessage}`);\n- return message.includes('You had a meeting');\n- },\n- 25000,\n- 'end of call message never posted to space'\n- );\n+ browserLocal.waitUntil(() => browserLocal.getText(`${messageElements.lastActivity} ${messageElements.systemMessage}`).includes('You had a meeting'));\n+ browserLocal.refresh();\n+ browserRemote.refresh();\n});\n-\n- after('refresh browsers to remove widgets', browser.refresh);\n});\ndescribe('opens using hydra id ', () => {\n@@ -219,8 +198,10 @@ describe('Widget Space', () => {\nbrowser.waitForVisible(elements.messageWidget);\nbrowser.waitForVisible(`[placeholder=\"Send a message to ${conversation.displayName}\"]`);\n});\n-\n- after('refresh browsers to remove widgets', browser.refresh);\n- });\n});\n+\n+ after('disconnect', () => Promise.all([\n+ marty.spark.internal.mercury.disconnect(),\n+ lorraine.spark.internal.mercury.disconnect()\n+ ]));\n});\n",
"new_path": "test/journeys/specs/space/dataApi/startup-settings.js",
"old_path": "test/journeys/specs/space/dataApi/startup-settings.js"
}
] |
JavaScript
|
MIT License
|
webex/react-widgets
|
refactor(journeys): use consistent style across data api space widget tests
| 1
|
refactor
|
journeys
|
217,922
|
08.04.2018 14:07:05
| -7,200
|
46b2f827a3233762c69253fa640112e2120e35f2
|
chore: forgot to change button location when alarms panel is opened
|
[
{
"change_type": "MODIFY",
"diff": "bottom: 5px;\ntransition: right .4s cubic-bezier(0.25, 0.8, 0.25, 1);\n&.opened {\n- right: 255px;\n+ right: 275px;\n}\n}\n.content-middle {\n",
"new_path": "src/app/app.component.scss",
"old_path": "src/app/app.component.scss"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore: forgot to change button location when alarms panel is opened
#310
| 1
|
chore
| null |
679,913
|
08.04.2018 14:23:57
| -3,600
|
4a18e8846cf518eb11137729a4906103e13c615d
|
refactor(examples): update webgl demo to use new canvas component
|
[
{
"change_type": "MODIFY",
"diff": "},\n\"dependencies\": {\n\"@thi.ng/hdom\": \"latest\",\n- \"@thi.ng/hdom-components\": \"latest\"\n+ \"@thi.ng/hdom-components\": \"latest\",\n+ \"@thi.ng/transducers\": \"latest\"\n}\n}\n\\ No newline at end of file\n",
"new_path": "examples/webgl/package.json",
"old_path": "examples/webgl/package.json"
},
{
"change_type": "MODIFY",
"diff": "import { start } from \"@thi.ng/hdom\";\nimport { canvasWebGL } from \"@thi.ng/hdom-components/canvas\";\n+import { repeatedly } from \"@thi.ng/transducers/iter/repeatedly\";\n// canvas init hook\nconst initGL = (_: HTMLCanvasElement, __: WebGLRenderingContext) => {\n+ console.log(\"init webgl canvas\");\n// GL context initialization steps\n// ...\n};\n-// canvas render hook closure\n-const updateGL = (offset, freq) =>\n- (_: HTMLCanvasElement, gl: WebGLRenderingContext, __, frame: number) => {\n- const f = offset + frame * freq;\n+/**\n+ * WebGL canvas update/render hook\n+ *\n+ * @param el canvas element\n+ * @param gl GL context\n+ * @param ctx hdom user context\n+ * @param time ms since init\n+ * @param frame current frame\n+ * @param args component args\n+ */\n+const updateGL = (el: HTMLCanvasElement, gl: WebGLRenderingContext, ctx: any, time: number, frame: number, ...args: any[]) => {\n+ // destructure args passed to component (see below in `app()`)\n+ // (ignore 1st arg, i.e. canvas attribs)\n+ const [_, phase, freq] = args;\n+ const f = phase + frame * freq;\nconst red = Math.sin(f) * 0.5 + 0.5;\nconst green = Math.sin(f + Math.PI * 1 / 3) * 0.5 + 0.5;\nconst blue = Math.sin(f + Math.PI * 2 / 3) * 0.5 + 0.5;\n@@ -18,11 +31,14 @@ const updateGL = (offset, freq) =>\ngl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n};\n-start(\n- document.getElementById(\"app\"),\n- // instantiate multiple canvases w/ different configs\n- [\"div\",\n- canvasWebGL(initGL, updateGL(0, 0.01), { width: 100, height: 100 }),\n- canvasWebGL(initGL, updateGL(200, 0.025), { width: 100, height: 100 }),\n- canvasWebGL(initGL, updateGL(400, 0.05), { width: 100, height: 100 })]\n-);\n+const app = () => {\n+ const attribs = { width: 100, height: 100 };\n+ const [c1, c2, c3] = repeatedly(() => canvasWebGL({ init: initGL, update: updateGL }), 3);\n+ return [\"div\",\n+ [\"p\", \"3 WebGL canvas component instances\"],\n+ [c1, attribs, 0, 0.01],\n+ [c2, attribs, 200, 0.025],\n+ [c3, attribs, 400, 0.05]];\n+};\n+\n+start(\"app\", app());\n",
"new_path": "examples/webgl/src/index.ts",
"old_path": "examples/webgl/src/index.ts"
},
{
"change_type": "MODIFY",
"diff": "\"extends\": \"../../tsconfig.json\",\n\"compilerOptions\": {\n\"outDir\": \"build\",\n- \"sourceMap\": true\n+ \"sourceMap\": true,\n+ \"noUnusedLocals\": false,\n+ \"noUnusedParameters\": false\n},\n\"include\": [\n\"./src/**/*.ts\"\n",
"new_path": "examples/webgl/tsconfig.json",
"old_path": "examples/webgl/tsconfig.json"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(examples): update webgl demo to use new canvas component
| 1
|
refactor
|
examples
|
821,196
|
08.04.2018 14:31:27
| 25,200
|
016849f9df6bce63aff7faaf4c09aaa5330300d3
|
fix: remove unneeded script
|
[
{
"change_type": "MODIFY",
"diff": "@@ -263,8 +263,7 @@ class App extends Generator {\nthis.pjson.scripts.test = 'echo NO TESTS'\n}\nif (this.ts) {\n- this.pjson.scripts.build = 'rm -rf lib && tsc'\n- this.pjson.scripts.prepack = `${npm} run build`\n+ this.pjson.scripts.prepack = `rm -rf lib && tsc`\n}\nif (['plugin', 'multi'].includes(this.type)) {\nthis.pjson.scripts.prepack = nps.series(this.pjson.scripts.prepack, 'oclif-dev manifest')\n",
"new_path": "src/generators/app.ts",
"old_path": "src/generators/app.ts"
}
] |
TypeScript
|
MIT License
|
oclif/oclif
|
fix: remove unneeded script
| 1
|
fix
| null |
730,413
|
08.04.2018 14:44:43
| 14,400
|
72aa817fa0f5b6b9523bae9eda9eb9faf7171d68
|
chore(tooling): add feature flags spec to space suite and ssl bump no domains
|
[
{
"change_type": "MODIFY",
"diff": "@@ -103,7 +103,8 @@ exports.config = {\n'./test/journeys/specs/space/dataApi/startup-settings.js',\n'./test/journeys/specs/space/global/basic.js',\n'./test/journeys/specs/space/global/meet.js',\n- './test/journeys/specs/space/global/messaging.js'\n+ './test/journeys/specs/space/global/messaging.js',\n+ './test/journeys/specs/space/featureFlags.js'\n],\nrecents: [\n'./test/journeys/specs/recents/dataApi/basic.js',\n@@ -315,12 +316,7 @@ if (process.env.SAUCE) {\nsauceConnect: !process.env.TAP,\nsauceConnectOpts: {\nnoSslBumpDomains: [\n- '*.wbx2.com',\n- '*.ciscospark.com',\n- '*.webex.com',\n- '127.0.0.1',\n- 'localhost',\n- '*.clouddrive.com'\n+ 'all'\n],\ntunnelDomains: [\n'127.0.0.1',\n",
"new_path": "wdio.conf.js",
"old_path": "wdio.conf.js"
}
] |
JavaScript
|
MIT License
|
webex/react-widgets
|
chore(tooling): add feature flags spec to space suite and ssl bump no domains
| 1
|
chore
|
tooling
|
679,913
|
08.04.2018 14:51:56
| -3,600
|
0873832d4f7594efc7bce2f1f1a403351d128e19
|
refactor(hdom-components): update dropdown components
BREAKING CHANGE: add hdom context arg as first arg to `dropdown` and
`groupedDropdown`
|
[
{
"change_type": "MODIFY",
"diff": "export interface DropDownOption extends Array<any> {\n[0]: string | number;\n- [1]: string;\n+ [1]: string | number;\n[2]?: boolean\n};\n@@ -19,18 +19,18 @@ export const option = ([value, label, disabled]: DropDownOption, sel: string | n\nexport const optgroup = (attribs: any, options: DropDownOption[], sel?: string | number) =>\n[\n\"optgroup\",\n- (attribs.label = attribs.label || \"--\", attribs),\n+ { ...attribs, label: attribs.label || \"--\" },\n...options.map((o) => option(o, sel))\n];\n-export const dropdown = (attribs: any, options: DropDownOption[], sel?: string | number) =>\n+export const dropdown = (_: any, attribs: any, options: DropDownOption[], sel?: string | number) =>\n[\n\"select\",\nattribs,\n...options.map((o) => option(o, sel))\n];\n-export const groupedDropdown = (attribs: any, groups: DropDownOptionGroup[], sel?: string | number) =>\n+export const groupedDropdown = (_: any, attribs: any, groups: DropDownOptionGroup[], sel?: string | number) =>\n[\n\"select\",\nattribs,\n",
"new_path": "packages/hdom-components/src/dropdown.ts",
"old_path": "packages/hdom-components/src/dropdown.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(hdom-components): update dropdown components
BREAKING CHANGE: add hdom context arg as first arg to `dropdown` and
`groupedDropdown`
| 1
|
refactor
|
hdom-components
|
679,913
|
08.04.2018 14:53:05
| -3,600
|
905467c11bb6e0b50602f94cdad7015efe183d2e
|
refactor(examples): update cellular-automata & hdom-benchmark
update dropdown usage
|
[
{
"change_type": "MODIFY",
"diff": "@@ -121,7 +121,7 @@ start(\"app\", () => {\n[\"div\",\n[\"button\", { onclick: () => randomizeRules() }, \"randomize rules\"],\n[\"button\", { onclick: () => randomizeGrid() }, \"reset grid\"],\n- dropdown({ onchange: (e) => applyRules(e.target.value) }, presets, location.hash.substr(1))\n+ [dropdown, { onchange: (e) => applyRules(e.target.value) }, presets, location.hash.substr(1)]\n],\n[\"pre\", format(grid = convolve(grid, rules, W, H), W)]\n];\n",
"new_path": "examples/cellular-automata/src/index.ts",
"old_path": "examples/cellular-automata/src/index.ts"
},
{
"change_type": "MODIFY",
"diff": "\"dependencies\": {\n\"@thi.ng/api\": \"latest\",\n\"@thi.ng/hdom\": \"latest\",\n+ \"@thi.ng/hdom-components\": \"latest\",\n\"@thi.ng/rstream\": \"latest\",\n\"@thi.ng/transducers\": \"latest\"\n}\n",
"new_path": "examples/hdom-benchmark/package.json",
"old_path": "examples/hdom-benchmark/package.json"
},
{
"change_type": "MODIFY",
"diff": "import { start } from \"@thi.ng/hdom\";\n+import { dropdown } from \"@thi.ng/hdom-components/dropdown\";\nimport { fromRAF } from \"@thi.ng/rstream/from/raf\";\nimport { Stream } from \"@thi.ng/rstream/stream\";\nimport { comp } from \"@thi.ng/transducers/func/comp\";\nimport { hex } from \"@thi.ng/transducers/func/hex\";\nimport { range } from \"@thi.ng/transducers/iter/range\";\nimport { iterator } from \"@thi.ng/transducers/iterator\";\n-import { transduce } from \"@thi.ng/transducers/transduce\";\n-import { push } from \"@thi.ng/transducers/rfn/push\";\nimport { benchmark } from \"@thi.ng/transducers/xform/benchmark\";\nimport { map } from \"@thi.ng/transducers/xform/map\";\nimport { mapIndexed } from \"@thi.ng/transducers/xform/map-indexed\";\n@@ -18,8 +17,8 @@ const hex4 = hex(4);\nconst hex6 = hex(6);\n/**\n- * Single box component. Uses given id to switch between using\n- * `div` or `box` element types, compute color and body text.\n+ * Single box component. Uses given id to switch between using `div` or\n+ * `box` element types, computes color and body text.\n*\n* @param id\n*/\n@@ -30,24 +29,10 @@ const box = (index: number, id: number) => [\n];\n/**\n- * Simple generic drop down component.\n- *\n- * @param change onchange listener\n- * @param items drop down options `[value, label]`\n- */\n-const dropdown = (onchange: (e: Event) => void, items: [any, any][]) =>\n- transduce(\n- map(([value, label]) => <any>[\"option\", { value }, label]),\n- push(),\n- [\"select\", { onchange }],\n- items\n- );\n-\n-/**\n- * Re-usable FPS stats canvas component, displaying graph of\n- * simple moving avarage of the past `period` frames.\n- * If `stream` is given, uses the time interval between received\n- * values. If not given, attaches itself to a RAF event stream.\n+ * Re-usable FPS stats canvas component, displaying graph of simple\n+ * moving avarage of the past `period` frames. If `stream` is given,\n+ * uses the time interval between received values. If not given,\n+ * attaches itself to a new RAF event stream.\n*\n* @param src\n* @param width\n@@ -100,8 +85,8 @@ const app = () => {\n// initialize local state\nlet i = 0, num = 128;\nconst fps = fpsCounter(null, 100, 60);\n- const menu = dropdown(\n- (e) => { num = parseInt((<HTMLInputElement>e.target).value); },\n+ const menu = dropdown(null,\n+ { onchange: (e) => { num = parseInt((<HTMLInputElement>e.target).value); } },\n[[128, 128], [192, 192], [256, 256], [384, 384], [512, 512]]\n);\n@@ -114,4 +99,4 @@ const app = () => {\n};\n};\n-start(document.getElementById(\"app\"), app(), null, false);\n+start(\"app\", app(), null, false);\n",
"new_path": "examples/hdom-benchmark/src/index.ts",
"old_path": "examples/hdom-benchmark/src/index.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(examples): update cellular-automata & hdom-benchmark
- update dropdown usage
| 1
|
refactor
|
examples
|
821,196
|
08.04.2018 15:06:46
| 25,200
|
3048e069a714ff32c197d3f467e04235c0663e95
|
fix: fixed lint issues
|
[
{
"change_type": "MODIFY",
"diff": "@@ -249,7 +249,6 @@ class App extends Generator {\nthis.pjson.files = this.answers.files || defaults.files || [(this.ts ? '/lib' : '/src')]\nthis.pjson.license = this.answers.license || defaults.license\nthis.repository = this.pjson.repository = this.answers.github ? `${this.answers.github.user}/${this.answers.github.repo}` : defaults.repository\n- let npm = this.yarn ? 'yarn' : 'npm'\nif (this.ts) {\nconst tsProject = this.mocha ? 'test' : '.'\nthis.pjson.scripts.posttest = `tsc -p ${tsProject} --noEmit`\n@@ -263,7 +262,7 @@ class App extends Generator {\nthis.pjson.scripts.test = 'echo NO TESTS'\n}\nif (this.ts) {\n- this.pjson.scripts.prepack = `rm -rf lib && tsc`\n+ this.pjson.scripts.prepack = 'rm -rf lib && tsc'\n}\nif (['plugin', 'multi'].includes(this.type)) {\nthis.pjson.scripts.prepack = nps.series(this.pjson.scripts.prepack, 'oclif-dev manifest')\n",
"new_path": "src/generators/app.ts",
"old_path": "src/generators/app.ts"
}
] |
TypeScript
|
MIT License
|
oclif/oclif
|
fix: fixed lint issues
| 1
|
fix
| null |
821,196
|
08.04.2018 15:35:42
| 25,200
|
612f401aa2f4a4915b2dd46b6f57cc6ceff0e213
|
fix: command path on windows
|
[
{
"change_type": "MODIFY",
"diff": "@@ -503,8 +503,9 @@ class App extends Generator {\nconst opts = {...this as any, _, bin, cmd}\nthis.fs.copyTpl(this.templatePath('plugin/bin/run'), this.destinationPath('bin/run'), opts)\nthis.fs.copyTpl(this.templatePath('bin/run.cmd'), this.destinationPath('bin/run.cmd'), opts)\n+ const commandPath = this.destinationPath(`src/commands/hello.${this._ext}`)\nif (!fs.existsSync('src/commands')) {\n- this.fs.copyTpl(this.templatePath(`src/command.${this._ext}.ejs`), this.destinationPath(`src/commands/hello.${this._ext}`), {...opts, name: 'hello'})\n+ this.fs.copyTpl(this.templatePath(`src/command.${this._ext}.ejs`), commandPath, {...opts, name: 'hello', path: commandPath.replace(process.cwd(), '.')})\n}\nif (this.ts && this.type !== 'multi') {\nthis.fs.copyTpl(this.templatePath('plugin/src/index.ts'), this.destinationPath('src/index.ts'), opts)\n@@ -519,8 +520,9 @@ class App extends Generator {\nconst opts = {...this as any, _, bin, cmd: bin, name: this.pjson.name}\nthis.fs.copyTpl(this.templatePath(`single/bin/run.${this._ext}`), this.destinationPath('bin/run'), opts)\nthis.fs.copyTpl(this.templatePath('bin/run.cmd'), this.destinationPath('bin/run.cmd'), opts)\n+ const commandPath = this.destinationPath(`src/index.${this._ext}`)\nif (!this.fs.exists(`src/index.${this._ext}`)) {\n- this.fs.copyTpl(this.templatePath(`src/command.${this._ext}.ejs`), this.destinationPath(`src/index.${this._ext}`), opts)\n+ this.fs.copyTpl(this.templatePath(`src/command.${this._ext}.ejs`), this.destinationPath(`src/index.${this._ext}`), {...opts, path: commandPath.replace(process.cwd(), '.')})\n}\nif (this.mocha && !this.fs.exists(`test/index.test.${this._ext}`)) {\nthis.fs.copyTpl(this.templatePath(`test/command.test.${this._ext}.ejs`), this.destinationPath(`test/index.test.${this._ext}`), opts)\n",
"new_path": "src/generators/app.ts",
"old_path": "src/generators/app.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -34,8 +34,9 @@ class CommandGenerator extends Generator {\nlet bin = this.pjson.oclif.bin || this.pjson.oclif.dirname || this.pjson.name\nif (bin.includes('/')) bin = bin.split('/').pop()\nconst cmd = `${bin} ${this.options.name}`\n- const opts = {...this.options, bin, cmd, _, type: 'command', path: this._path}\n- this.fs.copyTpl(this.templatePath(`src/command.${this._ext}.ejs`), this.destinationPath(`src/commands/${this._path}.${this._ext}`), opts)\n+ const commandPath = this.destinationPath(`src/commands/${this._path}.${this._ext}`)\n+ const opts = {...this.options, bin, cmd, _, type: 'command', path: commandPath}\n+ this.fs.copyTpl(this.templatePath(`src/command.${this._ext}.ejs`), commandPath, opts)\n// this.fs.copyTpl(this.templatePath(`plugin/src/hooks/init.${this._ext}`), this.destinationPath(`src/hooks/init.${this._ext}`), this)\nif (this._mocha) {\n// this.fs.copyTpl(this.templatePath(`plugin/test/hooks/init.test.${this._ext}`), this.destinationPath(`test/hooks/init.test.${this._ext}`), this)\n",
"new_path": "src/generators/command.ts",
"old_path": "src/generators/command.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,7 +5,7 @@ class <%- klass %> extends Command {\nasync run() {\nconst {flags} = this.parse(<%- klass %>)\nconst name = flags.name || 'world'\n- this.log(`hello ${name} from ${__filename}!`)\n+ this.log(`hello ${name} from <%- path.replace(/\\\\/g, '\\\\\\\\') %>`)\n}\n}\n",
"new_path": "templates/src/command.js.ejs",
"old_path": "templates/src/command.js.ejs"
},
{
"change_type": "MODIFY",
"diff": "@@ -34,7 +34,7 @@ hello world from ./src/<%- name %>.ts!\nconst {args, flags} = this.parse(<%- klass %>)\nconst name = flags.name || 'world'\n- this.log(`hello ${name} from ./src/commands/<%- path %>.ts!`)\n+ this.log(`hello ${name} from <%- path.replace(/\\\\/g, '\\\\\\\\') %>`)\nif (args.file && flags.force) {\nthis.log(`you input --force and --file: ${args.file}`)\n}\n",
"new_path": "templates/src/command.ts.ejs",
"old_path": "templates/src/command.ts.ejs"
}
] |
TypeScript
|
MIT License
|
oclif/oclif
|
fix: command path on windows (#96)
| 1
|
fix
| null |
821,196
|
08.04.2018 15:39:21
| 25,200
|
ceb13f28369d2651a467ea769d1fdf94731f1111
|
fix: ignore any node_modules directories
|
[
{
"change_type": "MODIFY",
"diff": "@@ -463,7 +463,7 @@ class App extends Generator {\n'.oclif.manifest.json',\n'*-debug.log',\n'*-error.log',\n- '/node_modules',\n+ 'node_modules',\n'/tmp',\n'/dist',\nthis.yarn ? '/package-lock.json' : '/yarn.lock',\n",
"new_path": "src/generators/app.ts",
"old_path": "src/generators/app.ts"
}
] |
TypeScript
|
MIT License
|
oclif/oclif
|
fix: ignore any node_modules directories
| 1
|
fix
| null |
821,196
|
08.04.2018 15:42:15
| 25,200
|
7dec822dda4b56e626b078a93c595c45e0b0cc10
|
fix: skip eslint files when using typescript
|
[
{
"change_type": "MODIFY",
"diff": "@@ -327,6 +327,10 @@ class App extends Generator {\nif (this.mocha) {\nthis.fs.copyTpl(this.templatePath('test/tsconfig.json'), this.destinationPath('test/tsconfig.json'), this)\n}\n+ } else {\n+ this.fs.copyTpl(this.templatePath('eslintrc'), this.destinationPath('.eslintrc'), this)\n+ const eslintignore = this._eslintignore()\n+ if (eslintignore.trim()) this.fs.write(this.destinationPath('.eslintignore'), this._eslintignore())\n}\nif (this.mocha && !this.fs.exists('test')) {\nthis.fs.copyTpl(this.templatePath('test/helpers/init.js'), this.destinationPath('test/helpers/init.js'), this)\n@@ -356,9 +360,6 @@ class App extends Generator {\nthis.fs.copyTpl(this.templatePath('gitattributes'), this.destinationPath('.gitattributes'), this)\nthis.fs.write(this.destinationPath('.gitignore'), this._gitignore())\n- this.fs.copyTpl(this.templatePath('eslintrc'), this.destinationPath('.eslintrc'), this)\n- const eslintignore = this._eslintignore()\n- if (eslintignore.trim()) this.fs.write(this.destinationPath('.eslintignore'), this._eslintignore())\nswitch (this.type) {\ncase 'single':\n",
"new_path": "src/generators/app.ts",
"old_path": "src/generators/app.ts"
}
] |
TypeScript
|
MIT License
|
oclif/oclif
|
fix: skip eslint files when using typescript
| 1
|
fix
| null |
821,196
|
08.04.2018 15:51:17
| 25,200
|
ac95a07286e902fceed384694a8d56a70d75cb51
|
fix: lock down deps
|
[
{
"change_type": "MODIFY",
"diff": "@@ -383,64 +383,61 @@ class App extends Generator {\ncase 'base': break\ncase 'single':\ndependencies.push(\n- '@oclif/config',\n- '@oclif/command',\n- '@oclif/plugin-help',\n+ '@oclif/config@1',\n+ '@oclif/command@1',\n+ '@oclif/plugin-help@1',\n)\nbreak\ncase 'plugin':\ndependencies.push(\n- '@oclif/command',\n- '@oclif/config',\n+ '@oclif/command@1',\n+ '@oclif/config@1',\n)\ndevDependencies.push(\n- '@oclif/dev-cli',\n- '@oclif/plugin-help',\n- 'globby',\n+ '@oclif/dev-cli@1',\n+ '@oclif/plugin-help@1',\n+ 'globby@8',\n)\nbreak\ncase 'multi':\ndependencies.push(\n- '@oclif/config',\n- '@oclif/command',\n- '@oclif/plugin-help',\n+ '@oclif/config@1',\n+ '@oclif/command@1',\n+ '@oclif/plugin-help@1',\n)\ndevDependencies.push(\n- '@oclif/dev-cli',\n- 'globby',\n+ '@oclif/dev-cli@1',\n+ 'globby@8',\n)\n}\nif (this.mocha) {\ndevDependencies.push(\n- 'mocha',\n- 'chai',\n+ 'mocha@5',\n+ 'chai@4',\n)\nif (this.type !== 'base') devDependencies.push(\n- '@oclif/test',\n+ '@oclif/test@1',\n)\n}\nif (this.ts) {\ndevDependencies.push(\n- // '@types/ansi-styles',\n- '@types/chai',\n- '@types/mocha',\n- '@types/node',\n- // '@types/strip-ansi',\n- // '@types/supports-color',\n- 'typescript',\n+ '@types/chai@4',\n+ '@types/mocha@5',\n+ '@types/node@9',\n+ 'typescript@2.8',\n'ts-node@5',\n- 'tslib',\n+ 'tslib@1',\n)\nif (this.tslint) {\ndevDependencies.push(\n- '@oclif/tslint',\n- 'tslint',\n+ '@oclif/tslint@1',\n+ 'tslint@5',\n)\n}\n} else {\ndevDependencies.push(\n- 'eslint',\n- 'eslint-config-oclif',\n+ 'eslint@4',\n+ 'eslint-config-oclif@1',\n)\n}\nlet yarnOpts = {} as any\n",
"new_path": "src/generators/app.ts",
"old_path": "src/generators/app.ts"
}
] |
TypeScript
|
MIT License
|
oclif/oclif
|
fix: lock down deps
| 1
|
fix
| null |
724,212
|
08.04.2018 17:04:10
| -7,200
|
e9aadad97942684240252d677ee4a9d4581181d8
|
docs: extend examples in find api
|
[
{
"change_type": "MODIFY",
"diff": "@@ -17,10 +17,18 @@ import Foo from './Foo.vue'\nimport Bar from './Bar.vue'\nconst wrapper = mount(Foo)\n+\nconst div = wrapper.find('div')\nexpect(div.is('div')).toBe(true)\n+\nconst bar = wrapper.find(Bar)\nexpect(bar.is(Bar)).toBe(true)\n+\n+const barByName = wrapper.find({ name: 'bar' })\n+expect(barByName.is(Bar)).toBe(true)\n+\n+const fooRef = wrapper.find({ ref: 'foo' })\n+expect(fooRef.is(Foo)).toBe(true)\n```\n- **See also:** [Wrapper](README.md)\n",
"new_path": "docs/en/api/wrapper/find.md",
"old_path": "docs/en/api/wrapper/find.md"
}
] |
JavaScript
|
MIT License
|
vuejs/vue-test-utils
|
docs: extend examples in find api (#473) (#511)
| 1
|
docs
| null |
730,413
|
08.04.2018 18:12:50
| 14,400
|
91796c9c07953e44978ee343164a326b1b1e1591
|
refactor(journeys): use consistent style across space widget tests
|
[
{
"change_type": "MODIFY",
"diff": "@@ -213,14 +213,8 @@ describe('Widget Space: Data API', () => {\nit('searches and adds person to space', () => {\nsearchForPerson(browserLocal, biff.displayName, true);\nbrowserLocal.waitForVisible(rosterElements.rosterList);\n- browserLocal.waitUntil(() => {\n- const participantsText = browserLocal.getText(rosterElements.rosterList);\n- return participantsText.includes(biff.displayName);\n- }, 60000, 'added person not found in participant list');\n- browserLocal.waitUntil(() => {\n- const rosterTitle = browserLocal.getText(rosterElements.rosterTitle);\n- return rosterTitle === 'People (4)';\n- }, 60000, 'Participant count should update once user is added');\n+ browserLocal.waitUntil(() => browserLocal.getText(rosterElements.rosterList).includes(biff.displayName));\n+ browserLocal.waitUntil(() => browserLocal.getText(rosterElements.rosterTitle) === 'People (4)');\n});\nit('closes the people roster widget', () => {\n",
"new_path": "test/journeys/specs/space/dataApi/basic.js",
"old_path": "test/journeys/specs/space/dataApi/basic.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -65,11 +65,7 @@ describe('Widget Space Feature Flags', () => {\ndescribe('Browser Global', () => {\nbefore('load browsers', () => {\n- browser\n- .url('/space.html?basic')\n- .execute(() => {\n- localStorage.clear();\n- });\n+ browser.url('/space.html?basic');\n});\nbefore('open widget local', () => {\n@@ -81,7 +77,7 @@ describe('Widget Space Feature Flags', () => {\n};\nwindow.openSpaceWidget(options);\n}, userWithAllTheFeatures.token.access_token, conversation.id);\n- browserLocal.waitForVisible(`[placeholder=\"Send a message to ${conversation.displayName}\"]`, 30000);\n+ browserLocal.waitForVisible(`[placeholder=\"Send a message to ${conversation.displayName}\"]`);\n});\nbefore('open widget remote', () => {\n@@ -93,7 +89,7 @@ describe('Widget Space Feature Flags', () => {\n};\nwindow.openSpaceWidget(options);\n}, userWithNoFeatures1.token.access_token, conversation.id);\n- browserRemote.waitForVisible(`[placeholder=\"Send a message to ${conversation.displayName}\"]`, 30000);\n+ browserRemote.waitForVisible(`[placeholder=\"Send a message to ${conversation.displayName}\"]`);\n});\ndescribe('Feature Flag Tests', () => {\n@@ -103,11 +99,7 @@ describe('Widget Space Feature Flags', () => {\ndescribe('Data API', () => {\nbefore('load browsers', () => {\n- browser\n- .url('/data-api/space.html')\n- .execute(() => {\n- localStorage.clear();\n- });\n+ browser.url('/data-api/space.html');\n});\nbefore('open widget local', () => {\n@@ -121,7 +113,7 @@ describe('Widget Space Feature Flags', () => {\ndocument.getElementById('ciscospark-widget').appendChild(csmmDom);\nwindow.loadBundle('/dist-space/bundle.js');\n}, userWithAllTheFeatures.token.access_token, conversation.id);\n- browserLocal.waitForVisible(`[placeholder=\"Send a message to ${conversation.displayName}\"]`, 30000);\n+ browserLocal.waitForVisible(`[placeholder=\"Send a message to ${conversation.displayName}\"]`);\n});\nbefore('open widget remote', () => {\n@@ -135,7 +127,7 @@ describe('Widget Space Feature Flags', () => {\ndocument.getElementById('ciscospark-widget').appendChild(csmmDom);\nwindow.loadBundle('/dist-space/bundle.js');\n}, userWithNoFeatures1.token.access_token, conversation.id);\n- browserRemote.waitForVisible(`[placeholder=\"Send a message to ${conversation.displayName}\"]`, 30000);\n+ browserRemote.waitForVisible(`[placeholder=\"Send a message to ${conversation.displayName}\"]`);\n});\ndescribe('Feature Flag Tests', () => {\n",
"new_path": "test/journeys/specs/space/featureFlags.js",
"old_path": "test/journeys/specs/space/featureFlags.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -16,17 +16,12 @@ import {\nimport {elements, openMenuAndClickButton} from '../../../lib/test-helpers/space-widget/main';\ndescribe('Widget Space', () => {\n- describe('Global', () => {\nconst browserLocal = browser.select('browserLocal');\nlet biff, docbrown, lorraine, marty;\nlet conversation;\nbefore('load browsers', () => {\n- browser\n- .url('/space.html')\n- .execute(() => {\n- localStorage.clear();\n- });\n+ browser.url('/space.html');\n});\nbefore('create marty', () => testUsers.create({count: 1, config: {displayName: 'Marty McFly'}})\n@@ -94,8 +89,6 @@ describe('Widget Space', () => {\nbefore('pause to let test users establish', () => browser.pause(5000));\n- after('disconnect', () => marty.spark.internal.mercury.disconnect());\n-\nbefore('create space', () => marty.spark.internal.conversation.create({\ndisplayName: 'Test Widget Space',\nparticipants: [marty, docbrown, lorraine]\n@@ -147,16 +140,16 @@ describe('Widget Space', () => {\nit('closes the menu with the exit button', () => {\nbrowserLocal.click(elements.exitButton);\n- browserLocal.waitForVisible(elements.activityMenu, 1500, true);\n+ browserLocal.waitForVisible(elements.activityMenu, 60000, true);\n});\nit('has a message button', () => {\nbrowserLocal.click(elements.menuButton);\n- browserLocal.element(elements.controlsContainer).element(elements.messageButton).waitForVisible();\n+ browserLocal.waitForVisible(elements.messageButton);\n});\nit('has a files button', () => {\n- browserLocal.element(elements.controlsContainer).element(elements.filesButton).waitForVisible();\n+ browserLocal.waitForVisible(elements.filesButton);\n});\nit('switches to files widget', () => {\n@@ -168,8 +161,8 @@ describe('Widget Space', () => {\n});\nit('hides menu and switches to message widget', () => {\n- browserLocal.element(elements.controlsContainer).element(elements.messageButton).click();\n- browserLocal.waitForVisible(elements.activityMenu, 1500, true);\n+ browserLocal.click(elements.messageButton);\n+ browserLocal.waitForVisible(elements.activityMenu, 60000, true);\nassert.isTrue(browserLocal.isVisible(elements.messageWidget));\n});\n});\n@@ -181,16 +174,11 @@ describe('Widget Space', () => {\n});\nit('has a close button', () => {\n- assert.isTrue(\n- browserLocal\n- .element(rosterElements.rosterWidget)\n- .element(rosterElements.closeButton)\n- .isVisible()\n- );\n+ assert.isTrue(browserLocal.isVisible(rosterElements.closeButton));\n});\nit('has the total count of participants', () => {\n- assert.equal(browserLocal.element(rosterElements.rosterTitle).getText(), 'People (3)');\n+ assert.equal(browserLocal.getText(rosterElements.rosterTitle), 'People (3)');\n});\nit('has the participants listed', () => {\n@@ -205,20 +193,14 @@ describe('Widget Space', () => {\nopenMenuAndClickButton(browserLocal, rosterElements.peopleButton);\nbrowserLocal.waitForVisible(rosterElements.rosterWidget);\nsearchForPerson(browserLocal, biff.displayName, true);\n- browserLocal.element(rosterElements.rosterList).waitForVisible();\n- browserLocal.waitUntil(() => {\n- const participantsText = browserLocal.element(rosterElements.rosterList).getText();\n- return participantsText.includes(biff.displayName);\n- }, 15000, 'added person not found in participant list');\n- browserLocal.waitUntil(() => {\n- const rosterTitle = browserLocal.element(rosterElements.rosterTitle).getText();\n- return rosterTitle === 'People (4)';\n- }, 15000, 'Participant count should update once user is added');\n+ browserLocal.waitForVisible(rosterElements.rosterList);\n+ browserLocal.waitUntil(() => browserLocal.getText(rosterElements.rosterList).includes(biff.displayName));\n+ browserLocal.waitUntil(() => browserLocal.getText(rosterElements.rosterTitle) === 'People (4)');\n});\nit('closes the people roster widget', () => {\n- browserLocal.element(rosterElements.rosterWidget).element(rosterElements.closeButton).click();\n- browserLocal.element(rosterElements.rosterWidget).waitForVisible(1500, true);\n+ browserLocal.click(rosterElements.closeButton);\n+ browserLocal.waitForVisible(rosterElements.rosterWidget, 60000, true);\n});\n});\n@@ -230,5 +212,7 @@ describe('Widget Space', () => {\n}));\n});\n});\n+\n+ after('disconnect', () => marty.spark.internal.mercury.disconnect());\n});\n-});\n+\n",
"new_path": "test/journeys/specs/space/global/basic.js",
"old_path": "test/journeys/specs/space/global/basic.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -15,11 +15,7 @@ describe('Widget Space', () => {\nlet conversation, local, remote;\nbefore('load browsers', () => {\n- browser\n- .url('/space.html')\n- .execute(() => {\n- localStorage.clear();\n- });\n+ browser.url('/space.html');\n});\nbefore('create marty', () => testUsers.create({count: 1, config: {displayName: 'Marty McFly'}})\n@@ -76,11 +72,6 @@ describe('Widget Space', () => {\nbefore('pause to let test users establish', () => browser.pause(5000));\n- after('disconnect', () => Promise.all([\n- marty.spark.internal.mercury.disconnect(),\n- lorraine.spark.internal.mercury.disconnect()\n- ]));\n-\nbefore('create space', () => marty.spark.internal.conversation.create({\ndisplayName: 'Test Widget Space',\nparticipants: [marty, docbrown, lorraine]\n@@ -121,7 +112,7 @@ describe('Widget Space', () => {\ndescribe('pre call experience', () => {\nit('has a call button', () => {\nswitchToMeet(browserLocal);\n- browserLocal.element(elements.meetWidget).element(elements.callButton).waitForVisible();\n+ browserLocal.waitForVisible(elements.callButton);\n});\n});\n@@ -145,4 +136,9 @@ describe('Widget Space', () => {\n});\n});\n});\n+\n+ after('disconnect', () => Promise.all([\n+ marty.spark.internal.mercury.disconnect(),\n+ lorraine.spark.internal.mercury.disconnect()\n+ ]));\n});\n",
"new_path": "test/journeys/specs/space/global/meet.js",
"old_path": "test/journeys/specs/space/global/meet.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -23,11 +23,7 @@ describe('Widget Space', () => {\nlet conversation, local, remote;\nbefore('load browsers', () => {\n- browser\n- .url('/space.html')\n- .execute(() => {\n- localStorage.clear();\n- });\n+ browser.url('/space.html');\n});\nbefore('create marty', () => testUsers.create({count: 1, config: {displayName: 'Marty McFly'}})\n@@ -79,11 +75,6 @@ describe('Widget Space', () => {\nbefore('pause to let test users establish', () => browser.pause(5000));\n- after('disconnect', () => Promise.all([\n- marty.spark.internal.mercury.disconnect(),\n- lorraine.spark.internal.mercury.disconnect()\n- ]));\n-\nbefore('create space', () => marty.spark.internal.conversation.create({\ndisplayName: 'Test Widget Space',\nparticipants: [marty, docbrown, lorraine]\n@@ -118,6 +109,7 @@ describe('Widget Space', () => {\n};\nwindow.openSpaceWidget(options);\n}, docbrown.token.access_token, conversation.id);\n+ remote.browser.waitForVisible(`[placeholder=\"Send a message to ${local.displayName}\"]`);\n});\ndescribe('messaging', () => {\n@@ -287,4 +279,9 @@ describe('Widget Space', () => {\n});\n});\n});\n+\n+ after('disconnect', () => Promise.all([\n+ marty.spark.internal.mercury.disconnect(),\n+ lorraine.spark.internal.mercury.disconnect()\n+ ]));\n});\n",
"new_path": "test/journeys/specs/space/global/messaging.js",
"old_path": "test/journeys/specs/space/global/messaging.js"
}
] |
JavaScript
|
MIT License
|
webex/react-widgets
|
refactor(journeys): use consistent style across space widget tests
| 1
|
refactor
|
journeys
|
730,413
|
08.04.2018 18:14:44
| 14,400
|
9a539811c29810e6320b5850c9a5b2dfccc2f307
|
refactor(journey): remove nested element calls from meet helper file
|
[
{
"change_type": "MODIFY",
"diff": "@@ -33,7 +33,7 @@ export const elements = {\n*/\nexport function answer(aBrowser) {\naBrowser.waitForVisible(elements.answerButton);\n- aBrowser.element(elements.meetWidget).element(elements.answerButton).click();\n+ aBrowser.click(elements.answerButton);\naBrowser.waitForVisible(elements.remoteVideo);\n// Let call elapse 5 seconds before hanging up\naBrowser.pause(5000);\n@@ -46,8 +46,8 @@ export function answer(aBrowser) {\n* @returns {void}\n*/\nexport function call(caller, reciever) {\n- caller.element(elements.meetWidget).element(elements.callButton).waitForVisible();\n- caller.element(elements.meetWidget).element(elements.callButton).click();\n+ caller.waitForVisible(elements.callButton);\n+ caller.click(elements.callButton);\n// wait for call to establish\nreciever.waitForVisible(elements.answerButton);\n}\n@@ -59,7 +59,8 @@ export function call(caller, reciever) {\n*/\nexport function decline(aBrowser) {\naBrowser.waitForVisible(elements.declineButton);\n- aBrowser.element(elements.meetWidget).element(elements.declineButton).click();\n+ aBrowser.click(elements.declineButton);\n+ aBrowser.waitForVisible(elements.messageWidget);\n}\n/**\n@@ -71,8 +72,9 @@ export function hangup(aBrowser) {\n// Call controls currently has a hover state\nmoveMouse(aBrowser, elements.callContainer);\naBrowser.waitForVisible(elements.callControls);\n- aBrowser.element(elements.meetWidget).element(elements.hangupButton).waitForVisible();\n- aBrowser.element(elements.meetWidget).element(elements.hangupButton).click();\n+ aBrowser.waitForVisible(elements.hangupButton);\n+ aBrowser.click(elements.hangupButton);\n+ aBrowser.waitForVisible(elements.messageWidget);\n}\n/**\n",
"new_path": "test/journeys/lib/test-helpers/space-widget/meet.js",
"old_path": "test/journeys/lib/test-helpers/space-widget/meet.js"
}
] |
JavaScript
|
MIT License
|
webex/react-widgets
|
refactor(journey): remove nested element calls from meet helper file
| 1
|
refactor
|
journey
|
730,413
|
08.04.2018 18:17:59
| 14,400
|
be8980f9c6cd4e7fb81157988702ed27b4749692
|
refactor(journeys): remove nested element calls from messaging helper file
|
[
{
"change_type": "MODIFY",
"diff": "@@ -64,9 +64,9 @@ export function sendMessage(sender, receiver, message) {\n*/\nexport function verifyMessageReceipt(receiver, sender, message) {\nreceiver.browser.waitForVisible(`[placeholder=\"Send a message to ${sender.displayName}\"]`);\n- receiver.browser.waitForExist(elements.pendingActivity, 15000, true);\n- receiver.browser.waitForExist(elements.lastActivityText, 15000);\n- receiver.browser.waitUntil(() => receiver.browser.element(elements.lastActivityText).getText() === message);\n+ receiver.browser.waitForExist(elements.pendingActivity, 60000, true);\n+ receiver.browser.waitForExist(elements.lastActivityText);\n+ receiver.browser.waitUntil(() => receiver.browser.getText(elements.lastActivityText) === message);\n// Move mouse to send read receipt\nmoveMouse(receiver.browser, elements.lastActivityText);\n// Verify read receipt comes across\n@@ -93,7 +93,7 @@ export function verifyFilesActivityTab(aBrowser, fileName, hasThumbnail) {\naBrowser.waitForVisible(mainElements.filesButton);\naBrowser.click(mainElements.filesButton);\naBrowser.waitForVisible(mainElements.filesWidget);\n- aBrowser.element(`${mainElements.filesWidget}${fileTitle}`).waitForExist();\n+ aBrowser.waitForExist(`${mainElements.filesWidget}${fileTitle}`);\nif (hasThumbnail) {\naBrowser.waitForVisible(fileThumbnail);\n}\n@@ -108,29 +108,17 @@ export function verifyFilesActivityTab(aBrowser, fileName, hasThumbnail) {\n* @returns {void}\n*/\nexport function flagMessage(testObject, messageToFlag) {\n- testObject.browser.waitForExist(elements.pendingActivity, 15000, true);\n- testObject.browser.waitUntil(() =>\n- testObject.browser.element(elements.lastActivityText).getText() === messageToFlag);\n+ testObject.browser.waitForExist(elements.pendingActivity, 60000, true);\n+ testObject.browser.waitUntil(() => testObject.browser.getText(elements.lastActivityText) === messageToFlag);\nmoveMouse(testObject.browser, elements.lastActivityText);\n- testObject.browser.waitUntil(() =>\n- testObject.browser\n- .element(`${elements.lastActivity} ${elements.flagButton}`)\n- .isVisible(),\n- 1500, 'flag button is not visible when hovering');\n-\n- testObject.browser\n- .element(`${elements.lastActivity} ${elements.flagButton}`)\n- .click();\n+ testObject.browser.waitForVisible(`${elements.lastActivity} ${elements.flagButton}`);\n+ testObject.browser.click(`${elements.lastActivity} ${elements.flagButton}`);\n// Verify it is highlighted, showing it was flagged\n- testObject.browser.waitUntil(() => testObject.browser\n- .element(`${elements.lastActivity} ${elements.highlighted} ${elements.flagButton}`)\n- .isVisible(), 1500, 'flag button did not highlight');\n+ testObject.browser.waitForVisible(`${elements.lastActivity} ${elements.highlighted} ${elements.flagButton}`);\n// Remove pending flag\n- testObject.browser.waitUntil(() => testObject.browser\n- .element(`${elements.lastActivity} ${elements.highlighted}${elements.pendingAction} ${elements.flagButton}`)\n- .isVisible() === false, 7500, 'flag button did not remove pending state');\n+ testObject.browser.waitForVisible(`${elements.lastActivity} ${elements.highlighted}${elements.pendingAction} ${elements.flagButton}`, 60000, true);\n}\n/**\n@@ -140,21 +128,14 @@ export function flagMessage(testObject, messageToFlag) {\n* @returns {void}\n*/\nexport function removeFlagMessage(testObject, messageToUnflag) {\n- testObject.browser.waitForExist(elements.pendingActivity, 15000, true);\n- testObject.browser.waitUntil(() =>\n- testObject.browser.element(elements.lastActivityText).getText() === messageToUnflag, 1500, 'message was not found');\n+ testObject.browser.waitForExist(elements.pendingActivity, 60000, true);\n+ testObject.browser.waitUntil(() => testObject.browser.getText(elements.lastActivityText) === messageToUnflag);\n- testObject.browser.waitUntil(() => testObject.browser\n- .element(`${elements.lastActivity} ${elements.highlighted} ${elements.flagButton}`)\n- .isVisible(), 1500, 'message was not flagged');\n+ testObject.browser.waitForVisible(`${elements.lastActivity} ${elements.highlighted} ${elements.flagButton}`);\n- testObject.browser\n- .element(`${elements.lastActivity} ${elements.flagButton}`)\n- .click();\n+ testObject.browser.click(`${elements.lastActivity} ${elements.flagButton}`);\n- testObject.browser.waitUntil(() => testObject.browser\n- .element(`${elements.lastActivity} ${elements.highlighted}`)\n- .isVisible() === false, 3500, 'message was still flagged');\n+ testObject.browser.waitForVisible(`${elements.lastActivity} ${elements.highlighted}`, 60000, true);\n}\n/**\n@@ -164,15 +145,9 @@ export function removeFlagMessage(testObject, messageToUnflag) {\n* @returns {boolean}\n*/\nexport function canDeleteMessage(testObject, messageToDelete) {\n- testObject.browser.waitForExist(elements.pendingActivity, 15000, true);\n- testObject.browser.waitUntil(() =>\n- // Text matches message to delete\n- testObject.browser.element(elements.lastActivityText).getText() === messageToDelete);\n-\n- return testObject.browser\n- .element(`${elements.lastActivity} ${elements.deleteMessageButton}`)\n- // Delete button is hidden but still exists\n- .isExisting();\n+ testObject.browser.waitForExist(elements.pendingActivity, 60000, true);\n+ testObject.browser.waitUntil(() => testObject.browser.getText(elements.lastActivityText) === messageToDelete);\n+ return testObject.browser.isExisting(`${elements.lastActivity} ${elements.deleteMessageButton}`);\n}\n/**\n@@ -185,31 +160,16 @@ export function deleteMessage(testObject, messageToDelete) {\nmoveMouse(testObject.browser, elements.lastActivityText);\n- testObject.browser.waitUntil(() =>\n- testObject.browser\n- .element(`${elements.lastActivity} ${elements.deleteMessageButton}`)\n- .isVisible(),\n- 1500, 'delete button is not visible when hovering');\n-\n- testObject.browser\n- .element(`${elements.lastActivity} ${elements.deleteMessageButton}`)\n- .click();\n+ testObject.browser.waitForVisible(`${elements.lastActivity} ${elements.deleteMessageButton}`);\n+ testObject.browser.click(`${elements.lastActivity} ${elements.deleteMessageButton}`);\n// Click modal confirm\n- testObject.browser.waitUntil(() =>\n- testObject.browser\n- .element(elements.modalWindow)\n- .isVisible(),\n- 3500, 'delete modal window is not visible after clicking delete button');\n- assert.isTrue(testObject.browser.element(elements.modalDeleteButton).isVisible(), 'modal delete button is not visible');\n- testObject.browser.element(elements.modalDeleteButton).click();\n+ testObject.browser.waitForVisible(elements.modalWindow);\n+ testObject.browser.waitForVisible(elements.modalDeleteButton);\n+ testObject.browser.click(elements.modalDeleteButton);\ntestObject.browser.waitForVisible(`${elements.lastActivity} ${elements.systemMessage}`);\n-\n- testObject.browser.waitUntil(() => {\n- const text = testObject.browser.element(`${elements.lastActivity} ${elements.systemMessage}`).getText();\n- return text.includes(messages.youDeleted);\n- }, 3500, 'message was not deleted');\n+ testObject.browser.waitUntil(() => testObject.browser.getText(`${elements.lastActivity} ${elements.systemMessage}`).includes(messages.youDeleted));\n}\n@@ -226,13 +186,15 @@ const sendFileTest = (sender, receiver, fileName, fileSizeVerify = true) => {\nconst filePath = path.join(uploadDir, fileName);\nconst fileTitle = `//div[text()=\"${fileName}\"]`;\nsender.browser.chooseFile(elements.inputFile, filePath);\n+ sender.browser.waitForVisible(elements.shareButton);\nsender.browser.click(elements.shareButton);\n- receiver.browser.waitForExist(fileTitle, 30000);\n+ sender.browser.waitForVisible(elements.shareButton, 120000, true);\n+ receiver.browser.waitForExist(fileTitle);\nreceiver.browser.scroll(fileTitle);\n- const localSize = sender.browser.element(`${elements.lastActivity} .ciscospark-share-file-size`).getText();\n- const remoteSize = receiver.browser.element(`${elements.lastActivity} .ciscospark-share-file-size`).getText();\n// Some files are embedded and don't display file sizes\nif (fileSizeVerify) {\n+ const localSize = sender.browser.getText(`${elements.lastActivity} .ciscospark-share-file-size`);\n+ const remoteSize = receiver.browser.getText(`${elements.lastActivity} .ciscospark-share-file-size`);\nassert.equal(localSize, remoteSize);\n}\n// Send receipt acknowledgement and verify before moving on\n",
"new_path": "test/journeys/lib/test-helpers/space-widget/messaging.js",
"old_path": "test/journeys/lib/test-helpers/space-widget/messaging.js"
}
] |
JavaScript
|
MIT License
|
webex/react-widgets
|
refactor(journeys): remove nested element calls from messaging helper file
| 1
|
refactor
|
journeys
|
730,413
|
08.04.2018 18:18:42
| 14,400
|
89d98c181e7d773bcd1ad16e6a2f86e213cf141a
|
chore(tooling): add space spec files to integration suite
|
[
{
"change_type": "MODIFY",
"diff": "@@ -126,7 +126,15 @@ exports.config = {\n'./test/journeys/specs/oneOnOne/global/meet.js',\n'./test/journeys/specs/oneOnOne/global/messaging.js',\n'./test/journeys/specs/recents/dataApi/basic.js',\n- './test/journeys/specs/recents/global/basic.js'\n+ './test/journeys/specs/recents/global/basic.js',\n+ './test/journeys/specs/space/dataApi/basic.js',\n+ './test/journeys/specs/space/dataApi/meet.js',\n+ './test/journeys/specs/space/dataApi/messaging.js',\n+ './test/journeys/specs/space/dataApi/startup-settings.js',\n+ './test/journeys/specs/space/global/basic.js',\n+ './test/journeys/specs/space/global/meet.js',\n+ './test/journeys/specs/space/global/messaging.js',\n+ './test/journeys/specs/space/featureFlags.js'\n]\n},\n",
"new_path": "wdio.conf.js",
"old_path": "wdio.conf.js"
}
] |
JavaScript
|
MIT License
|
webex/react-widgets
|
chore(tooling): add space spec files to integration suite
| 1
|
chore
|
tooling
|
679,913
|
08.04.2018 18:34:08
| -3,600
|
d832c9d2b691f64f5f94381c061b98a6aa05a2c7
|
docs(hdom): update readme & doc strings
|
[
{
"change_type": "MODIFY",
"diff": "This project is part of the\n[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.\n-**As of 2018-03-03 this package is now called @thi.ng/hdom, formerly\n-@thi.ng/hiccup-dom**\n+<!-- TOC depthFrom:2 -->\n+\n+- [About](#about)\n+ - [Component tree translation](#component-tree-translation)\n+ - [Event & state handling options](#event--state-handling-options)\n+ - [Reusable components](#reusable-components)\n+- [Status](#status)\n+- [Installation](#installation)\n+- [Usage](#usage)\n+ - [`start(parent: Element | string, tree: any, ctx?: any, path?: number[], keys?: boolean, span?: boolean): () => boolean`](#startparent-element--string-tree-any-ctx-any-path-number-keys-boolean-span-boolean---boolean)\n+ - [`normalizeTree(tree: any, ctx?: any): any`](#normalizetreetree-any-ctx-any-any)\n+ - [`diffElement(parent: Element, prev: any, curr: any): void`](#diffelementparent-element-prev-any-curr-any-void)\n+ - [`createDOM(parent: Element, tag: any, insert?: number): any`](#createdomparent-element-tag-any-insert-number-any)\n+- [Example projects](#example-projects)\n+ - [Dataflow graph SVG components](#dataflow-graph-svg-components)\n+ - [SPA with router and event bus](#spa-with-router-and-event-bus)\n+ - [Multiple apps with & without shared state](#multiple-apps-with--without-shared-state)\n+ - [Interceptor based event handling](#interceptor-based-event-handling)\n+ - [Todo list](#todo-list)\n+ - [Cellular automata](#cellular-automata)\n+ - [SVG particles](#svg-particles)\n+ - [JSON based components](#json-based-components)\n+ - [@thi.ng/rstream dataflow graph](#thingrstream-dataflow-graph)\n+ - [Basic usage patterns](#basic-usage-patterns)\n+ - [Benchmark](#benchmark)\n+- [Authors](#authors)\n+- [License](#license)\n+\n+<!-- /TOC -->\n## About\n@@ -14,26 +41,26 @@ Lightweight reactive DOM components using only vanilla JS data\nstructures (arrays, objects, closures, iterators), based on\n[@thi.ng/hiccup](https://github.com/thi-ng/umbrella/tree/master/packages/hiccup).\n-Benefits:\n-\n- Use the full expressiveness of ES6/TypeScript to define, annotate &\ndocument components\n- Clean, functional component composition and reuse\n- No pre-processing / pre-compilation steps\n-- No string parsing / interpolation steps\n-- Less verbose than HTML, resulting in smaller file sizes\n-- Static components can be distributed as JSON (or [dynamically compose\n- components, based on JSON\n- data](https://github.com/thi-ng/umbrella/tree/master/examples/json-components))\n- Supports SVG, arbitrary elements, attributes, events\n-- CSS conversion from JS objects\n+- Less verbose than HTML/JSX, resulting in smaller file sizes\n+- Static components can be distributed as JSON (or [transform JSON\n+ into components](https://github.com/thi-ng/umbrella/tree/master/examples/json-components))\n+- Optional user context injection (an arbitrary object passed to all\n+ component functions)\n+- auto-deref of embedded value wrappers which implement the\n+ `@thi.ng/api/IDeref` interface (e.g. atoms, cursors, derived views,\n+ streams etc.)\n+- CSS conversion from JS objects for `style` attribs\n- Suitable for server side rendering (by passing the same data structure\nto @thi.ng/hiccup's `serialize()`)\n- Fairly fast (see benchmark example below)\n-- Only ~10KB minified\n+- Only ~4.4KB gzipped\n```typescript\n-import * as hiccup from \"@thi.ng/hiccup\";\nimport * as hdom from \"@thi.ng/hdom\";\n// stateless component w/ params\n@@ -56,25 +83,34 @@ hdom.start(document.body, app());\n// alternatively apply DOM tree only once\n// (stateful components won't update though)\nhdom.createDOM(document.body, hdom.normalizeTree(app()));\n+```\n+\n+Alternatively, use the same component function for browser or server\n+side HTML serialization (Note: does not emit attributes w/ functions as\n+values, e.g. a button's `onclick` attrib).\n-// alternatively browser or server side HTML serialization\n-// (note: does not emit attributes w/ functions as values, i.e. the button \"onclick\" attribs)\n-console.log(hiccup.serialize(app()));\n+```ts\n+import { serialize } from \"@thi.ng/hiccup\";\n+\n+console.log(serialize(app()));\n// <div id=\"app\"><h1 class=\"title\">hello world</h1><button>clicks: 0</button><button>clicks: 100</button></div>\n```\n[Live demo](http://demo.thi.ng/umbrella/hdom-basics/) | [standalone example](https://github.com/thi-ng/umbrella/tree/master/examples/hdom-basics)\n-No template engine & no precompilation steps needed, just use the full\n-expressiveness of ES6/TypeScript to define your DOM tree. The additional\n-benefit of using TypeScript is that your UI components can become\n-strongly typed, since they're just normal functions, can use generics,\n+No template engine & no pre-compilation steps needed, just use the full\n+expressiveness of ES6/TypeScript to define your DOM tree. Using\n+TypeScript gives the additional benefit of making UI components strongly\n+typed, and since they're just normal functions, can use generics,\noverrides, varargs etc.\n+### Component tree translation\n+\nThe actual DOM update is based on the minimal edit set of the recursive\n-difference between the old and new DOM trees (both nested JS arrays).\n-Components can be defined as static arrays, closures or objects with\n-life cycle hooks (init, render, release).\n+difference between the old and new DOM trees (both expressed as nested\n+JS arrays). Components can be defined as static arrays, closures or\n+objects with [life cycle methods](#lifecycle-methods) (init, render,\n+release).\n\n@@ -82,22 +118,36 @@ The syntax is inspired by Clojure's\n[Hiccup](https://github.com/weavejester/hiccup) and\n[Reagent](http://reagent-project.github.io/) projects, however the\nlatter is a wrapper around React, whereas this library is standalone,\n-more lowlevel & less opinionated.\n+more low-level & less opinionated.\n+\n+### Event & state handling options\n+\n+Since this package is purely dealing with the translation of DOM trees,\n+any form of state / event handling or routing required by a full app is\n+out of scope. These features are provided by the following packages and\n+can be used in a mix & match manner:\n+\n+- [@thi.ng/atom](https://github.com/thi-ng/umbrella/tree/master/packages/atom)\n+- [@thi.ng/interceptors](https://github.com/thi-ng/umbrella/tree/master/packages/interceptors)\n+- [@thi.ng/router](https://github.com/thi-ng/umbrella/tree/master/packages/router)\n+- [@thi.ng/rstream](https://github.com/thi-ng/umbrella/tree/master/packages/rstream)\n+- [@thi.ng/transducers](https://github.com/thi-ng/umbrella/tree/master/packages/transducers)\n+\n+### Reusable components\n-If you're interested in using this, please also consider the\n-[@thi.ng/atom](https://github.com/thi-ng/umbrella/tree/master/packages/atom)\n-and\n-[@thi.ng/rstream](https://github.com/thi-ng/umbrella/tree/master/packages/rstream)\n-packages to integrate app state handling, event streams & reactive value\n-subscriptions. More examples are forthcoming...\n+A currently small (but growing) number of reusable components are\n+provided by these packages:\n+\n+- [@thi.ng/hdom-components](https://github.com/thi-ng/umbrella/tree/master/packages/hdom-components)\n+- [@thi.ng/hiccup-svg](https://github.com/thi-ng/umbrella/tree/master/packages/hiccup-svg)\n## Status\n-This project is currently still in BETA. The overall \"API\" is stable,\n-but there's still work planned on further optimization (see\n-[benchmark](#benchmark)) and generalization beyond the standard browser\n-DOM use cases. Furthermore, the project has been used for several\n-projects in production since 2016.\n+The overall \"API\" is stable, but there's further work planned on\n+generalizing the approach beyond standard browser DOM use cases (planned\n+for v4.0.0). The project has been used for several projects in\n+production since 2016.\n+\n## Installation\n@@ -105,10 +155,10 @@ projects in production since 2016.\nyarn add @thi.ng/hdom\n```\n-**New since 2018-03-15: You can now create a preconfigured app skeleton\n-using @thi.ng/atom, @thi.ng/hdom & @thi.ng/router using the\n+Use the customizable\n[create-hdom-app](https://github.com/thi-ng/create-hdom-app) project\n-generator:**\n+generator to create a pre-configured app skeleton using @thi.ng/atom,\n+@thi.ng/hdom, @thi.ng/interceptors & @thi.ng/router:\n```\nyarn create hdom-app my-app\n@@ -118,24 +168,109 @@ yarn install\nyarn start\n```\n-## Usage examples\n-\n-**Most of the\n-[examples](https://github.com/thi-ng/umbrella/tree/master/examples)\n-included in the umbrella repo are using this package in one way or\n-another. Please check them out to learn more. Each is heavily commented,\n-incl. best practice notes.**\n+## Usage\nEven though the overall approach should be obvious from the code\n-examples below, it's recommended to first study the\n+examples in this document, it's recommended to first study the\n[@thi.ng/hiccup](https://github.com/thi-ng/umbrella/tree/master/packages/hiccup)\n-reference. It's also important to point out, that this project\n-**currently** has some differences as to how some attribute and\n-iterables are treated and/or are supported in general. Furthermore, this\n-project has additional features (e.g. life cycle hooks), which aren't\n-needed for the static serialization use cases of @thi.ng/hiccup. Both\n-projects started in early 2016, but have somewhat evolved independently\n-and require some conceptional synchronization.\n+reference to learn about the basics of the approach and syntax used.\n+Compared to @thi.ng/hiccup, this project has additional features (e.g.\n+life cycle hooks), which aren't needed for the static serialization use\n+cases of @thi.ng/hiccup. Both projects started in early 2016, but have\n+somewhat evolved independently.\n+\n+#### `start(parent: Element | string, tree: any, ctx?: any, path?: number[], keys?: boolean, span?: boolean): () => boolean`\n+\n+Main user function of this package. For simple use cases, this function\n+should be the only one required. Takes a parent DOM element (or ID),\n+hiccup tree (array, function or component object w/ lifecycle methods)\n+and an optional arbitrary context object. Starts RAF update loop, in\n+each iteration first normalizing given tree, then computing diff to\n+previous frame's tree and applying any changes to the real DOM. The\n+optional `context` arg can be used for passing global config data or\n+state down into the hiccup component tree. Any embedded component\n+function in the tree will receive this context object as first argument,\n+as will life cycle methods in component objects. See [context\n+description](#user-context) further below.\n+\n+**Selective updates**: No updates will be applied if the given hiccup\n+tree is `undefined` or `null` or a root component function returns no\n+value. This way a given root function can do some state handling of its\n+own and implement fail-fast checks to determine no DOM updates are\n+necessary, saving effort re-creating a new hiccup tree and request\n+skipping DOM updates via this function. In this case, the previous DOM\n+tree is kept around until the root function returns a tree again, which\n+then is diffed and applied against the previous tree kept as usual. Any\n+number of frames may be skipped this way.\n+\n+Important: The parent element given is assumed to have NO children at\n+the time when `start()` is called. Since hdom does NOT track the real\n+DOM, the resulting changes will result in potentially undefined behavior\n+if the parent element wasn't empty.\n+\n+Returns a function, which when called, immediately cancels the update\n+loop.\n+\n+#### `normalizeTree(tree: any, ctx?: any): any`\n+\n+Calling this function is a prerequisite before passing a component tree\n+to `diffElement`. Recursively expands given hiccup component tree into\n+its canonical form by:\n+\n+- resolving Emmet-style tags (e.g. from `div#id.foo.bar`)\n+- evaluating embedded functions and replacing them with their result\n+- calling `render` life cycle method on component objects and using\n+ result\n+- consuming iterables and normalizing results\n+- calling `deref()` on elements implementing `IDeref` interface and\n+ using returned result\n+- calling `.toString()` on any other non-component value `x` and by\n+ default wrapping it in `[\"span\", x]`. The only exceptions to this are:\n+ `option`, `textarea` and SVG `text` elements, for which spans are\n+ always skipped.\n+\n+Additionally, unless `keys` is set to false, an unique `key` attribute\n+is created for each node in the tree. This attribute is used by\n+`diffElement` to determine if a changed node can be patched or will need\n+to be replaced/removed. The `key` values are defined by the `path` array\n+arg.\n+\n+For normal usage only the first 2 args should be specified and the rest\n+kept at their defaults.\n+\n+#### `diffElement(parent: Element, prev: any, curr: any): void`\n+\n+Takes a DOM root element and two hiccup trees, `prev` and `curr`.\n+Recursively computes diff between both trees and applies any necessary\n+changes to reflect `curr` tree in real DOM.\n+\n+For newly added components, calls `init` with created DOM element (plus\n+user provided context and any other args) for any components with `init`\n+life cycle method. Likewise, calls `release` on components with\n+`release` method when the DOM element is removed.\n+\n+Important: The actual DOM element given is assumed to exactly represent\n+the state of the `prev` tree. Since this function does NOT track the\n+real DOM at all, the resulting changes will result in potentially\n+undefined behavior if there're discrepancies.\n+\n+#### `createDOM(parent: Element, tag: any, insert?: number): any`\n+\n+Creates an actual DOM tree from given hiccup component and `parent`\n+element. Calls `init` with created element (user provided context and\n+other args) for any components with `init` life cycle method. Returns\n+created root element(s) - usually only a single one, but can be an array\n+of elements, if the provided tree is an iterable. Creates DOM text nodes\n+for non-component values. Returns `parent` if tree is `null` or\n+`undefined`.\n+\n+## Example projects\n+\n+Most of the\n+[examples](https://github.com/thi-ng/umbrella/tree/master/examples)\n+included in this repo are using this package in one way or another.\n+Please check them out to learn more. Each is heavily commented, incl.\n+best practice notes.\n### Dataflow graph SVG components\n@@ -143,41 +278,43 @@ This is a preview of the upcoming\n[@thi.ng/estuary](https://github.com/thi-ng/umbrella/tree/feature/estuary/packages/estuary)\npackage:\n-[Source](https://github.com/thi-ng/umbrella/tree/feature/estuary/packages/estuary) | [Live demo](http://demo.thi.ng/umbrella/estuary/)\n+[Source](https://github.com/thi-ng/umbrella/tree/feature/estuary/packages/estuary) | [Live version](http://demo.thi.ng/umbrella/estuary/)\n### SPA with router and event bus\n-One of the more advanced demos, combining functionality of several other @thi.ng packages.\n+Based on the `create-hdom-app` project scaffolding, this is one of the\n+more advanced demos, combining functionality of several other @thi.ng\n+packages.\n-[Source](https://github.com/thi-ng/umbrella/tree/master/examples/router-basics) | [Live demo](http://demo.thi.ng/umbrella/router-basics/)\n+[Source](https://github.com/thi-ng/umbrella/tree/master/examples/router-basics) | [Live version](http://demo.thi.ng/umbrella/router-basics/)\n### Multiple apps with & without shared state\nDevcards style BMI calculator(s) with basic SVG viz.\n-[Source](https://github.com/thi-ng/umbrella/tree/master/examples/devcards) | [Live demo](http://demo.thi.ng/umbrella/devcards/)\n+[Source](https://github.com/thi-ng/umbrella/tree/master/examples/devcards) | [Live version](http://demo.thi.ng/umbrella/devcards/)\n### Interceptor based event handling\n-[Source](https://github.com/thi-ng/umbrella/tree/master/examples/interceptor-basics) | [Live demo](http://demo.thi.ng/umbrella/interceptor-basics/)\n+[Source](https://github.com/thi-ng/umbrella/tree/master/examples/interceptor-basics) | [Live version](http://demo.thi.ng/umbrella/interceptor-basics/)\n### Todo list\n-A fully documented todo list app with undo / redo feature is here:\n+A fully documented, obligatory todo list app with undo / redo.\n-[Source](https://github.com/thi-ng/umbrella/tree/master/examples/todo-list) | [Live demo](http://demo.thi.ng/umbrella/todo-list/)\n+[Source](https://github.com/thi-ng/umbrella/tree/master/examples/todo-list) | [Live version](http://demo.thi.ng/umbrella/todo-list/)\n### Cellular automata\n-[Source](https://github.com/thi-ng/umbrella/tree/master/examples/cellular-automata) | [Live demo](http://demo.thi.ng/umbrella/cellular-automata/)\n+[Source](https://github.com/thi-ng/umbrella/tree/master/examples/cellular-automata) | [Live version](http://demo.thi.ng/umbrella/cellular-automata/)\n### SVG particles\n-[Source](https://github.com/thi-ng/umbrella/tree/master/examples/svg-particles) | [Live demo](http://demo.thi.ng/umbrella/svg-particles/)\n+[Source](https://github.com/thi-ng/umbrella/tree/master/examples/svg-particles) | [Live version](http://demo.thi.ng/umbrella/svg-particles/)\n### JSON based components\n-[Source](https://github.com/thi-ng/umbrella/tree/master/examples/json-components) | [Live demo](http://demo.thi.ng/umbrella/json-components/)\n+[Source](https://github.com/thi-ng/umbrella/tree/master/examples/json-components) | [Live version](http://demo.thi.ng/umbrella/json-components/)\n### @thi.ng/rstream dataflow graph\n@@ -189,44 +326,7 @@ A small, interactive dataflow graph example:\nThe code below is also available as standalone project in: [/examples/dashboard](https://github.com/thi-ng/umbrella/tree/master/examples/dashboard)\n-[Live demo here](http://demo.thi.ng/umbrella/dashboard/)\n-\n-```typescript\n-import { start } from \"@thi.ng/hdom\";\n-\n-// static component function to create styled box\n-const box = (prefix, body) =>\n- [\"div\",\n- {\n- style: {\n- display: \"inline-block\",\n- background: \"#ccc\",\n- width: \"30%\",\n- height: \"40px\",\n- padding: \"4px\",\n- margin: \"2px\",\n- \"text-align\": \"center\"\n- }\n- },\n- [\"strong\", prefix], [\"br\"], body];\n-\n-// stateful component function\n-const counter = (id, from = 0, step = 1) => () => box(id, (from += step).toLocaleString());\n-\n-// dynamic component function (external state, i.e. date)\n-const timer = () => box(\"time\", new Date().toLocaleTimeString());\n-\n-// application root component closure\n-// initializes stateful components\n-const app = (() => {\n- const users = counter(\"users\");\n- const profits = counter(\"$$$\", 1e6, 99);\n- return () => [\"div\", [\"h1\", \"Dashboard\"], users, profits, timer];\n-})();\n-\n-// start update loop (RAF)\n-window.addEventListener(\"load\", () => start(\"app\", app));\n-```\n+[Source](https://github.com/thi-ng/umbrella/tree/master/examples/dashboard) | [Live version](http://demo.thi.ng/umbrella/dashboard/)\n### Benchmark\n@@ -239,9 +339,10 @@ Based on [user feedback collected via\nTwitter](https://twitter.com/toxi/status/959246871339454464),\nperformance should be more than acceptable for even quite demanding UIs.\nIn the 192 / 256 cells configurations **this stress test causes approx.\n-600/800 DOM every single frame**, something very unlikely for a typical\n-web app. In Chrome 64 on a MBP2016 this still runs at a pretty stable\n-60fps (192 cells) 30fps (256 cells). Both using the 50 frame [SMA](https://en.wikipedia.org/wiki/Moving_average#Simple_moving_average).\n+600 / 800 DOM every single frame**, very unlikely for a typical web app.\n+In Chrome 64 on a MBP2016 this still runs at a stable 60fps (192 cells)\n+/ 32fps (256 cells). Both FPS readings based the 50 frame\n+[SMA](https://en.wikipedia.org/wiki/Moving_average#Simple_moving_average).\n## Authors\n",
"new_path": "packages/hdom/README.md",
"old_path": "packages/hdom/README.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -8,8 +8,27 @@ import { createDOM, removeAttribs, setAttrib, removeChild } from \"./dom\";\nconst diffArray = diff.diffArray;\nconst diffObject = diff.diffObject;\n-export function diffElement(parent: Element, prev: any, curr: any) {\n- _diffElement(parent, prev, curr, 0);\n+/**\n+ * Takes a DOM root element and two hiccup trees, `prev` and `curr`.\n+ * Recursively computes diff between both trees and applies any\n+ * necessary changes to reflect `curr` tree in real DOM.\n+ *\n+ * For newly added components, calls `init` with created DOM element\n+ * (plus user provided context and any other args) for any components\n+ * with `init` life cycle method. Likewise, calls `release` on\n+ * components with `release` method when the DOM element is removed.\n+ *\n+ * Important: The actual DOM element given is assumed to exactly\n+ * represent the state of the `prev` tree. Since this function does NOT\n+ * track the real DOM at all, the resulting changes will result in\n+ * potentially undefined behavior if there're discrepancies.\n+ *\n+ * @param root\n+ * @param prev previous tree\n+ * @param curr current tree\n+ */\n+export function diffElement(root: Element, prev: any, curr: any) {\n+ _diffElement(root, prev, curr, 0);\n}\nfunction _diffElement(parent: Element, prev: any, curr: any, child: number) {\n",
"new_path": "packages/hdom/src/diff.ts",
"old_path": "packages/hdom/src/diff.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -10,10 +10,10 @@ import { map } from \"@thi.ng/iterators/map\";\n* Creates an actual DOM tree from given hiccup component and `parent`\n* element. Calls `init` with created element (user provided context and\n* other args) for any components with `init` lifecycle method. Returns\n- * created root element(s), usually only one, but an array of elements\n- * if the provided tree is an iterable. Creates DOM text node for\n- * non-component values. Returns `parent` if tree is `null` or\n- * `undefined`.\n+ * created root element(s) - usually only a single one, but can be an\n+ * array of elements, if the provided tree is an iterable. Creates DOM\n+ * text nodes for non-component values. Returns `parent` if tree is\n+ * `null` or `undefined`.\n*\n* @param parent\n* @param tag\n",
"new_path": "packages/hdom/src/dom.ts",
"old_path": "packages/hdom/src/dom.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -82,40 +82,40 @@ const NO_SPANS = {\n*\n* Additionally, unless `keys` is set to false, an unique `key`\n* attribute is created for each node in the tree. This attribute is\n- * used by `diffElement` to figure out if a changed node can be just\n- * patched or will need to be replaced/removed. The `key` values are\n- * defined by the `path` array arg.\n+ * used by `diffElement` to determine if a changed node can be patched\n+ * or will need to be replaced/removed. The `key` values are defined by\n+ * the `path` array arg.\n*\n* For normal usage only the first 2 args should be specified and the\n* rest kept at their defaults.\n*\n* See `normalizeElement` for further details about canonical form.\n*\n- * @param el\n+ * @param tree\n* @param ctx\n* @param path\n* @param keys\n* @param span\n*/\n-export function normalizeTree(el: any, ctx: any, path = [0], keys = true, span = true) {\n- if (el == null) {\n+export function normalizeTree(tree: any, ctx?: any, path = [0], keys = true, span = true) {\n+ if (tree == null) {\nreturn;\n}\n- if (isArray(el)) {\n- if (el.length === 0) {\n+ if (isArray(tree)) {\n+ if (tree.length === 0) {\nreturn;\n}\n- const tag = el[0];\n+ const tag = tree[0];\nlet norm, nattribs;\n// use result of function call\n// pass ctx as first arg and remaining array elements as rest args\nif (isFunction(tag)) {\n- return normalizeTree(tag.apply(null, [ctx, ...el.slice(1)]), ctx, path.slice(), keys, span);\n+ return normalizeTree(tag.apply(null, [ctx, ...tree.slice(1)]), ctx, path.slice(), keys, span);\n}\n// component object w/ life cycle methods\n// (render() is the only required hook)\nif (implementsFunction(tag, \"render\")) {\n- const args = [ctx, ...el.slice(1)];\n+ const args = [ctx, ...tree.slice(1)];\nnorm = normalizeTree(tag.render.apply(null, args), ctx, path.slice(), keys, span);\nif (norm !== undefined) {\nnattribs = norm[1];\n@@ -128,7 +128,7 @@ export function normalizeTree(el: any, ctx: any, path = [0], keys = true, span =\n}\nreturn norm;\n}\n- norm = normalizeElement(el, keys);\n+ norm = normalizeElement(tree, keys);\nnattribs = norm[1];\nif (keys && nattribs.key === undefined) {\nnattribs.key = path.join(\"-\");\n@@ -162,13 +162,13 @@ export function normalizeTree(el: any, ctx: any, path = [0], keys = true, span =\n}\nreturn norm;\n}\n- if (isFunction(el)) {\n- return normalizeTree(el(ctx), ctx, path, keys, span);\n+ if (isFunction(tree)) {\n+ return normalizeTree(tree(ctx), ctx, path, keys, span);\n}\n- if (implementsFunction(el, \"deref\")) {\n- return normalizeTree(el.deref(), ctx, path.slice(), keys, span);\n+ if (implementsFunction(tree, \"deref\")) {\n+ return normalizeTree(tree.deref(), ctx, path.slice(), keys, span);\n}\nreturn span ?\n- [\"span\", keys ? { key: path.join(\"-\") } : {}, el.toString()] :\n- el.toString();\n+ [\"span\", keys ? { key: path.join(\"-\") } : {}, tree.toString()] :\n+ tree.toString();\n}\n",
"new_path": "packages/hdom/src/normalize.ts",
"old_path": "packages/hdom/src/normalize.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -11,27 +11,7 @@ import { normalizeTree } from \"./normalize\";\n* The optional `context` arg can be used for passing global config data\n* or state down into the hiccup component tree. Any embedded component\n* function in the tree will receive this context object as first\n- * argument, as will life cycle methods in component objects:\n- *\n- * ```\n- * const link = (ctx, evt, ...body) =>\n- * [\"a\",\n- * {...ctx.ui.link, onclick: () => ctx.app.dispatch(evt) },\n- * body];\n- *\n- * const foo = {\n- * init: (ctx, el) => { ... },\n- * render: (ctx, ...args) => [\"section\", ctx.ui.foo, args.map(x => [link, x])],\n- * release: (ctx) => { ... }\n- * };\n- *\n- * const ctx = {\n- * app: ...\n- * ui: { link: ..., foo: ...},\n- * };\n- *\n- * start(\"app\", foo, ctx)\n- * ```\n+ * argument, as will life cycle methods in component objects.\n*\n* **Selective updates**: No updates will be applied if the given hiccup\n* tree is `undefined` or `null` or a root component function returns no\n",
"new_path": "packages/hdom/src/start.ts",
"old_path": "packages/hdom/src/start.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs(hdom): update readme & doc strings
| 1
|
docs
|
hdom
|
679,913
|
08.04.2018 18:36:52
| -3,600
|
a904599c243412cdf507e127ea3ccb4ff6d89af1
|
docs(hdom): update/fix readme
|
[
{
"change_type": "MODIFY",
"diff": "This project is part of the\n[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.\n-<!-- TOC depthFrom:2 -->\n+<!-- TOC depthFrom:2 depthTo:3 -->\n- [About](#about)\n- [Component tree translation](#component-tree-translation)\n@@ -14,10 +14,6 @@ This project is part of the\n- [Status](#status)\n- [Installation](#installation)\n- [Usage](#usage)\n- - [`start(parent: Element | string, tree: any, ctx?: any, path?: number[], keys?: boolean, span?: boolean): () => boolean`](#startparent-element--string-tree-any-ctx-any-path-number-keys-boolean-span-boolean---boolean)\n- - [`normalizeTree(tree: any, ctx?: any): any`](#normalizetreetree-any-ctx-any-any)\n- - [`diffElement(parent: Element, prev: any, curr: any): void`](#diffelementparent-element-prev-any-curr-any-void)\n- - [`createDOM(parent: Element, tag: any, insert?: number): any`](#createdomparent-element-tag-any-insert-number-any)\n- [Example projects](#example-projects)\n- [Dataflow graph SVG components](#dataflow-graph-svg-components)\n- [SPA with router and event bus](#spa-with-router-and-event-bus)\n@@ -203,7 +199,7 @@ tree is kept around until the root function returns a tree again, which\nthen is diffed and applied against the previous tree kept as usual. Any\nnumber of frames may be skipped this way.\n-Important: The parent element given is assumed to have NO children at\n+**Important:** The parent element given is assumed to have NO children at\nthe time when `start()` is called. Since hdom does NOT track the real\nDOM, the resulting changes will result in potentially undefined behavior\nif the parent element wasn't empty.\n@@ -249,10 +245,10 @@ user provided context and any other args) for any components with `init`\nlife cycle method. Likewise, calls `release` on components with\n`release` method when the DOM element is removed.\n-Important: The actual DOM element given is assumed to exactly represent\n-the state of the `prev` tree. Since this function does NOT track the\n-real DOM at all, the resulting changes will result in potentially\n-undefined behavior if there're discrepancies.\n+**Important:** The actual DOM element/subtree given is assumed to\n+exactly represent the state of the `prev` tree. Since this function does\n+NOT track the real DOM at all, the resulting changes will result in\n+potentially undefined behavior if there're discrepancies.\n#### `createDOM(parent: Element, tag: any, insert?: number): any`\n",
"new_path": "packages/hdom/README.md",
"old_path": "packages/hdom/README.md"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs(hdom): update/fix readme
| 1
|
docs
|
hdom
|
730,413
|
08.04.2018 19:01:30
| 14,400
|
43ffbbab17b188b7eb0efbeebcd47543360485e3
|
refactor(journeys): remove nested element calls in feature flag helper file
|
[
{
"change_type": "MODIFY",
"diff": "@@ -17,24 +17,14 @@ export default function featureFlagTests(browserWithAllTheFeatures, browserWithN\nit('has a roster for user with feature flag', () => {\nbrowserWithAllTheFeatures.click(mainElements.menuButton);\nbrowserWithAllTheFeatures.waitForVisible(mainElements.activityMenu);\n- assert.isTrue(\n- browserWithAllTheFeatures\n- .element(mainElements.controlsContainer)\n- .element(rosterElements.peopleButton)\n- .isVisible()\n- );\n+ assert.isTrue(browserWithAllTheFeatures.isVisible(rosterElements.peopleButton));\nbrowserWithAllTheFeatures.click(mainElements.exitButton);\n});\nit('does not have a roster for user without flag', () => {\nbrowserWithNoFeatures.click(mainElements.menuButton);\nbrowserWithNoFeatures.waitForVisible(mainElements.activityMenu);\n- assert.isFalse(\n- browserWithNoFeatures\n- .element(mainElements.controlsContainer)\n- .element(rosterElements.peopleButton)\n- .isVisible()\n- );\n+ assert.isFalse(browserWithNoFeatures.isVisible(rosterElements.peopleButton));\nbrowserWithNoFeatures.click(mainElements.exitButton);\n});\n});\n@@ -43,24 +33,14 @@ export default function featureFlagTests(browserWithAllTheFeatures, browserWithN\nit('has a call option for user with feature flag', () => {\nbrowserWithAllTheFeatures.click(mainElements.menuButton);\nbrowserWithAllTheFeatures.waitForVisible(mainElements.activityMenu);\n- assert.isTrue(\n- browserWithAllTheFeatures\n- .element(mainElements.controlsContainer)\n- .element(meetElements.callButton)\n- .isVisible()\n- );\n+ assert.isTrue(browserWithAllTheFeatures.isVisible(meetElements.callButton));\nbrowserWithAllTheFeatures.click(mainElements.exitButton);\n});\nit('does not have a call option for user without flag', () => {\nbrowserWithNoFeatures.click(mainElements.menuButton);\nbrowserWithNoFeatures.waitForVisible(mainElements.activityMenu);\n- assert.isFalse(\n- browserWithNoFeatures\n- .element(mainElements.controlsContainer)\n- .element(meetElements.callButton)\n- .isVisible()\n- );\n+ assert.isFalse(browserWithNoFeatures.isVisible(meetElements.callButton));\nbrowserWithNoFeatures.click(mainElements.exitButton);\n});\n});\n",
"new_path": "test/journeys/lib/test-helpers/space-widget/featureFlags.js",
"old_path": "test/journeys/lib/test-helpers/space-widget/featureFlags.js"
}
] |
JavaScript
|
MIT License
|
webex/react-widgets
|
refactor(journeys): remove nested element calls in feature flag helper file
| 1
|
refactor
|
journeys
|
730,413
|
08.04.2018 19:01:54
| 14,400
|
5e3e630cc7c9a3c05f3af06c4f253ee15dcb6fa3
|
refactor(journeys): remove nested element calls in main helper file
|
[
{
"change_type": "MODIFY",
"diff": "@@ -23,7 +23,7 @@ export function switchToMessage(aBrowser) {\naBrowser.click(elements.menuButton);\naBrowser.waitForVisible(elements.activityMenu);\n}\n- aBrowser.element(elements.controlsContainer).element(elements.messageButton).waitForVisible();\n+ aBrowser.waitForVisible(elements.messageButton);\naBrowser.click(elements.messageButton);\n}\n@@ -38,7 +38,7 @@ export function switchToMeet(aBrowser) {\naBrowser.click(elements.menuButton);\naBrowser.waitForVisible(elements.activityMenu);\n}\n- aBrowser.element(elements.controlsContainer).element(elements.meetButton).waitForVisible();\n+ aBrowser.waitForVisible(elements.meetButton);\naBrowser.click(elements.meetButton);\n}\n@@ -50,5 +50,5 @@ export function switchToMeet(aBrowser) {\nexport function openMenuAndClickButton(aBrowser, buttonToClick) {\naBrowser.click(elements.menuButton);\naBrowser.waitForVisible(elements.activityMenu);\n- aBrowser.element(elements.controlsContainer).element(buttonToClick).click();\n+ aBrowser.click(buttonToClick);\n}\n",
"new_path": "test/journeys/lib/test-helpers/space-widget/main.js",
"old_path": "test/journeys/lib/test-helpers/space-widget/main.js"
}
] |
JavaScript
|
MIT License
|
webex/react-widgets
|
refactor(journeys): remove nested element calls in main helper file
| 1
|
refactor
|
journeys
|
730,413
|
08.04.2018 19:02:16
| 14,400
|
4ea50602e2954572da479a11a0b266e134db570c
|
refactor(journeys): remove nested function calls in roster helper file
|
[
{
"change_type": "MODIFY",
"diff": "@@ -11,7 +11,7 @@ export const elements = {\nrosterList: '.ciscospark-roster-scrolling-list',\naddParticipantArea: '.ciscospark-roster-add-participant',\naddParticipantResultsArea: '.ciscospark-roster-add-participant-results',\n- addParticipantResultItem: '.ciscospark-people-list-item',\n+ addParticipantResultItem: '.ciscospark-people-list-item:nth-child(1)',\naddPeopleButton: '.ciscospark-roster-add-people',\nsearchInput: '.ciscospark-roster-add-participant-search-input',\ncloseSearchButton: 'button[aria-label=\"Close Search\"]'\n@@ -40,8 +40,8 @@ function closeSearch(aBrowser) {\n* @returns {Array}\n*/\nexport function hasParticipants(aBrowser, participants) {\n- aBrowser.element(elements.rosterList).waitForVisible();\n- const participantsText = aBrowser.element(elements.rosterList).getText();\n+ aBrowser.waitForVisible(elements.rosterList);\n+ const participantsText = aBrowser.getText(elements.rosterList);\nreturn participants.map((participant) => assert.isTrue(participantsText.includes(participant.displayName)));\n}\n@@ -70,12 +70,12 @@ export function searchForPerson(aBrowser, searchString, doAdd = false, searchRes\naBrowser.setValue(elements.searchInput, searchString);\naBrowser.waitForVisible(elements.addParticipantResultsArea);\naBrowser.waitForVisible(elements.addParticipantResultItem);\n- const resultsText = aBrowser.element(elements.addParticipantResultItem).getText();\n+ const resultsText = aBrowser.getText(elements.addParticipantResultItem);\nassert.isTrue(resultsText.includes(searchResult), 'matching search result is not found in results');\nif (doAdd) {\naBrowser.click(elements.addParticipantResultItem);\n// Adding a participant immediately takes you back to roster\n- aBrowser.waitForVisible(elements.addParticipantArea, 3000, true);\n+ aBrowser.waitForVisible(elements.addParticipantArea, 60000, true);\n}\nelse {\ncloseSearch(aBrowser);\n",
"new_path": "test/journeys/lib/test-helpers/space-widget/roster.js",
"old_path": "test/journeys/lib/test-helpers/space-widget/roster.js"
}
] |
JavaScript
|
MIT License
|
webex/react-widgets
|
refactor(journeys): remove nested function calls in roster helper file
| 1
|
refactor
|
journeys
|
730,413
|
08.04.2018 19:12:56
| 14,400
|
88703ad458751157cb6145901096b093e5685198
|
fix(journeys): revert to nested elements where required
|
[
{
"change_type": "MODIFY",
"diff": "@@ -33,7 +33,12 @@ export default function featureFlagTests(browserWithAllTheFeatures, browserWithN\nit('has a call option for user with feature flag', () => {\nbrowserWithAllTheFeatures.click(mainElements.menuButton);\nbrowserWithAllTheFeatures.waitForVisible(mainElements.activityMenu);\n- assert.isTrue(browserWithAllTheFeatures.isVisible(meetElements.callButton));\n+ assert.isTrue(\n+ browserWithAllTheFeatures\n+ .element(mainElements.controlsContainer)\n+ .element(meetElements.callButton)\n+ .isVisible()\n+ );\nbrowserWithAllTheFeatures.click(mainElements.exitButton);\n});\n",
"new_path": "test/journeys/lib/test-helpers/space-widget/featureFlags.js",
"old_path": "test/journeys/lib/test-helpers/space-widget/featureFlags.js"
}
] |
JavaScript
|
MIT License
|
webex/react-widgets
|
fix(journeys): revert to nested elements where required
| 1
|
fix
|
journeys
|
217,922
|
08.04.2018 20:18:15
| -7,200
|
3b918f5bc358bddbd4ade52dc0f4b4ef1a7751a4
|
feat: a dialog box will now show if you leave/reload the page while changes are saving
closes
|
[
{
"change_type": "MODIFY",
"diff": "-import {ChangeDetectorRef, Component, OnInit, ViewChild} from '@angular/core';\n+import {ChangeDetectorRef, Component, HostListener, OnInit, ViewChild} from '@angular/core';\nimport {AngularFireAuth} from 'angularfire2/auth';\nimport {TranslateService} from '@ngx-translate/core';\nimport {NavigationEnd, Router} from '@angular/router';\n@@ -25,6 +25,7 @@ import {PushNotificationsService} from 'ng-push';\nimport {OverlayContainer} from '@angular/cdk/overlay';\nimport {AnnouncementPopupComponent} from './modules/common-components/announcement-popup/announcement-popup.component';\nimport {Announcement} from './modules/common-components/announcement-popup/announcement';\n+import {PendingChangesService} from './core/database/pending-changes/pending-changes.service';\ndeclare const ga: Function;\n@@ -79,7 +80,8 @@ export class AppComponent implements OnInit {\npublic helpService: HelpService,\nprivate push: PushNotificationsService,\noverlayContainer: OverlayContainer,\n- public cd: ChangeDetectorRef) {\n+ public cd: ChangeDetectorRef,\n+ private pendingChangesService: PendingChangesService) {\nsettings.themeChange$.subscribe(change => {\noverlayContainer.getContainerElement().classList.remove(`${change.previous}-theme`);\n@@ -162,6 +164,13 @@ export class AppComponent implements OnInit {\nthis.dialog.open(this.helpService.currentHelp);\n}\n+ @HostListener('window:beforeunload', ['$event'])\n+ onBeforeUnload($event) {\n+ if (this.pendingChangesService.hasPendingChanges()) {\n+ $event.returnValue = true;\n+ }\n+ }\n+\nngOnInit(): void {\nif (localStorage.getItem('push:authorization:asked') === null) {\nthis.push.requestPermission();\n",
"new_path": "src/app/app.component.ts",
"old_path": "src/app/app.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -37,6 +37,7 @@ import {VenturesExtractor} from './list/data/extractor/ventures-extractor';\nimport {CustomLinksService} from './database/custom-links/custom-links.service';\nimport {PatreonGuard} from './guard/patreon.guard';\nimport {MathToolsService} from './tools/math-tools';\n+import {PendingChangesService} from './database/pending-changes/pending-changes.service';\nconst dataExtractorProviders: Provider[] = [\n@@ -84,6 +85,7 @@ const dataExtractorProviders: Provider[] = [\nCustomLinksService,\nPatreonGuard,\nMathToolsService,\n+ PendingChangesService,\n],\ndeclarations: [\nI18nPipe,\n",
"new_path": "src/app/core/core.module.ts",
"old_path": "src/app/core/core.module.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,6 +5,7 @@ import {NgSerializerService} from '@kaiu/ng-serializer';\nimport {AngularFireDatabase} from 'angularfire2/database';\nimport {DiffService} from '../diff/diff.service';\nimport {Observable} from 'rxjs/Observable';\n+import {PendingChangesService} from '../pending-changes/pending-changes.service';\n@Injectable()\nexport class CustomLinksService<T extends CustomLink = CustomLink> extends FirebaseStorage<T> {\n@@ -12,8 +13,9 @@ export class CustomLinksService<T extends CustomLink = CustomLink> extends Fireb\nconstructor(protected database: AngularFireDatabase,\nprotected serializer: NgSerializerService,\nprotected diffService: DiffService,\n- protected zone: NgZone) {\n- super(database, serializer, diffService, zone);\n+ protected zone: NgZone,\n+ protected pendingChangesService: PendingChangesService) {\n+ super(database, serializer, diffService, zone, pendingChangesService);\n}\npublic getAllByAuthor(userKey: string): Observable<T[]> {\n",
"new_path": "src/app/core/database/custom-links/custom-links.service.ts",
"old_path": "src/app/core/database/custom-links/custom-links.service.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,6 +5,7 @@ import {NgSerializerService} from '@kaiu/ng-serializer';\nimport {DiffService} from '../diff/diff.service';\nimport {Observable} from 'rxjs/Observable';\nimport {ListTemplate} from './list-template';\n+import {PendingChangesService} from '../pending-changes/pending-changes.service';\n@Injectable()\nexport class ListTemplateService extends CustomLinksService<ListTemplate> {\n@@ -12,8 +13,9 @@ export class ListTemplateService extends CustomLinksService<ListTemplate> {\nconstructor(protected database: AngularFireDatabase,\nprotected serializer: NgSerializerService,\nprotected diffService: DiffService,\n- protected zone: NgZone) {\n- super(database, serializer, diffService, zone);\n+ protected zone: NgZone,\n+ protected pendingChangesService: PendingChangesService) {\n+ super(database, serializer, diffService, zone, pendingChangesService);\n}\ngetByListId(listId: string): Observable<ListTemplate> {\n",
"new_path": "src/app/core/database/list-template/list-template.service.ts",
"old_path": "src/app/core/database/list-template/list-template.service.ts"
},
{
"change_type": "ADD",
"diff": "+import {Injectable} from '@angular/core';\n+\n+@Injectable()\n+export class PendingChangesService {\n+\n+ public pendingChanges: string[] = [];\n+\n+ public hasPendingChanges(): boolean {\n+ return this.pendingChanges.length > 0;\n+ }\n+\n+ public addPendingChange(id: string): void {\n+ this.pendingChanges.push(id);\n+ }\n+\n+ public removePendingChange(id: string): void {\n+ this.pendingChanges = this.pendingChanges.filter(row => row !== id);\n+ }\n+}\n",
"new_path": "src/app/core/database/pending-changes/pending-changes.service.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -6,22 +6,26 @@ import {NgSerializerService} from '@kaiu/ng-serializer';\nimport {DiffService} from 'app/core/database/diff/diff.service';\nimport {NgZone} from '@angular/core';\nimport 'rxjs/add/operator/takeWhile';\n+import {PendingChangesService} from '../../pending-changes/pending-changes.service';\nexport abstract class FirebaseStorage<T extends DataModel> extends DataStore<T> {\nprotected cache: { [index: string]: T } = {};\nconstructor(protected firebase: AngularFireDatabase, protected serializer: NgSerializerService,\n- protected diffService: DiffService, protected zone: NgZone) {\n+ protected diffService: DiffService, protected zone: NgZone,\n+ protected pendingChangesService: PendingChangesService) {\nsuper();\n}\nadd(data: T): Observable<string> {\n+ this.pendingChangesService.addPendingChange(`add ${this.getBaseUri()}`);\ndelete data.$key;\nreturn Observable.fromPromise(this.firebase.list<T>(this.getBaseUri()).push(data))\n.map(pushResult => pushResult.key)\n.do(key => {\nthis.cache[key] = JSON.parse(JSON.stringify(data));\n+ this.pendingChangesService.removePendingChange(`add ${this.getBaseUri()}`);\n});\n}\n@@ -70,6 +74,7 @@ export abstract class FirebaseStorage<T extends DataModel> extends DataStore<T>\n}\nupdate(uid: string, data: T): Observable<void> {\n+ this.pendingChangesService.addPendingChange(`update ${this.getBaseUri()}/${uid}`);\nreturn this.zone.runOutsideAngular(() => {\nif (uid === undefined || uid === null || uid === '') {\nthrow new Error('Empty uid');\n@@ -88,11 +93,14 @@ export abstract class FirebaseStorage<T extends DataModel> extends DataStore<T>\n});\n// We map the result of the combine to a void function, because we want to convert void[] to void.\nreturn Observable.combineLatest(batch, () => {\n+ }).do(() => {\n+ this.pendingChangesService.removePendingChange(`update ${this.getBaseUri()}/${uid}`);\n});\n});\n}\nset(uid: string, data: T): Observable<void> {\n+ this.pendingChangesService.addPendingChange(`set ${this.getBaseUri()}/${uid}`);\nreturn this.zone.runOutsideAngular(() => {\nif (uid === undefined || uid === null || uid === '') {\nthis.firebase.list('logs').push('Empty uid');\n@@ -100,11 +108,14 @@ export abstract class FirebaseStorage<T extends DataModel> extends DataStore<T>\n}\nconst clone = JSON.parse(JSON.stringify(data));\ndelete clone.$key;\n- return Observable.fromPromise(this.firebase.object(`${this.getBaseUri()}/${uid}`).set(clone));\n+ return Observable.fromPromise(this.firebase.object(`${this.getBaseUri()}/${uid}`).set(clone)).do(() => {\n+ this.pendingChangesService.removePendingChange(`set ${this.getBaseUri()}/${uid}`);\n+ });\n});\n}\nremove(uid: string): Observable<void> {\n+ this.pendingChangesService.addPendingChange(`remove ${this.getBaseUri()}/${uid}`);\nif (uid === undefined || uid === null || uid === '') {\nthis.firebase.list('logs').push('Empty uid');\nthrow new Error('Empty uid');\n@@ -112,6 +123,7 @@ export abstract class FirebaseStorage<T extends DataModel> extends DataStore<T>\nreturn Observable.fromPromise(this.firebase.object(`${this.getBaseUri()}/${uid}`).remove())\n.do(() => {\ndelete this.cache[uid];\n+ this.pendingChangesService.removePendingChange(`remove ${this.getBaseUri()}/${uid}`);\n});\n}\n",
"new_path": "src/app/core/database/storage/firebase/firebase-storage.ts",
"old_path": "src/app/core/database/storage/firebase/firebase-storage.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -14,16 +14,19 @@ import 'rxjs/add/operator/mergeMap';\nimport 'rxjs/add/observable/throw';\nimport DocumentReference = firebase.firestore.DocumentReference;\nimport DocumentSnapshot = firebase.firestore.DocumentSnapshot;\n+import {PendingChangesService} from '../../pending-changes/pending-changes.service';\nexport abstract class FirestoreStorage<T extends DataModel> extends DataStore<T> {\nprotected cache: { [index: string]: { subject: Subject<DataResponse<T>>, subscription: Subscription } } = {};\n- constructor(protected firestore: AngularFirestore, protected serializer: NgSerializerService, protected zone: NgZone) {\n+ constructor(protected firestore: AngularFirestore, protected serializer: NgSerializerService, protected zone: NgZone,\n+ protected pendingChangesService: PendingChangesService) {\nsuper();\n}\nadd(data: T): Observable<string> {\n+ this.pendingChangesService.addPendingChange(`add ${this.getBaseUri()}`);\nconst toAdd = JSON.parse(JSON.stringify(data));\ndelete toAdd.$key;\nreturn Observable.fromPromise(this.firestore.collection(this.getBaseUri()).add(toAdd))\n@@ -32,6 +35,7 @@ export abstract class FirestoreStorage<T extends DataModel> extends DataStore<T>\n}).do((uid: string) => {\n// In order to enable cache for this newly created element.\nthis.get(uid);\n+ this.pendingChangesService.removePendingChange(`add ${this.getBaseUri()}`);\n});\n}\n@@ -68,6 +72,7 @@ export abstract class FirestoreStorage<T extends DataModel> extends DataStore<T>\n}\nupdate(uid: string, data: T): Observable<void> {\n+ this.pendingChangesService.addPendingChange(`update ${this.getBaseUri()}/${uid}`);\nconst toUpdate = JSON.parse(JSON.stringify(data));\ndelete toUpdate.$key;\n// Optimistic update for better UX with large lists\n@@ -78,11 +83,14 @@ export abstract class FirestoreStorage<T extends DataModel> extends DataStore<T>\nif (uid === undefined || uid === null || uid === '') {\nthrow new Error('Empty uid');\n}\n- return Observable.fromPromise(this.firestore.collection(this.getBaseUri()).doc(uid).update(toUpdate));\n+ return Observable.fromPromise(this.firestore.collection(this.getBaseUri()).doc(uid).update(toUpdate)).do(() => {\n+ this.pendingChangesService.removePendingChange(`update ${this.getBaseUri()}/${uid}`);\n+ });\n});\n}\nset(uid: string, data: T): Observable<void> {\n+ this.pendingChangesService.addPendingChange(`set ${this.getBaseUri()}/${uid}`);\nconst toSet = JSON.parse(JSON.stringify(data));\ndelete toSet.$key;\n// Optimistic update for better UX with large lists\n@@ -93,11 +101,14 @@ export abstract class FirestoreStorage<T extends DataModel> extends DataStore<T>\nif (uid === undefined || uid === null || uid === '') {\nthrow new Error('Empty uid');\n}\n- return Observable.fromPromise(this.firestore.collection(this.getBaseUri()).doc(uid).set(toSet));\n+ return Observable.fromPromise(this.firestore.collection(this.getBaseUri()).doc(uid).set(toSet)).do(() => {\n+ this.pendingChangesService.removePendingChange(`set ${this.getBaseUri()}/${uid}`);\n+ });\n});\n}\nremove(uid: string): Observable<void> {\n+ this.pendingChangesService.addPendingChange(`remove ${this.getBaseUri()}/${uid}`);\nif (uid === undefined || uid === null || uid === '') {\nthrow new Error('Empty uid');\n}\n@@ -109,6 +120,7 @@ export abstract class FirestoreStorage<T extends DataModel> extends DataStore<T>\nthis.cache[uid].subject.next(null);\ndelete this.cache[uid];\n}\n+ this.pendingChangesService.removePendingChange(`remove ${this.getBaseUri()}/${uid}`);\n});\n}\n",
"new_path": "src/app/core/database/storage/firebase/firestore-storage.ts",
"old_path": "src/app/core/database/storage/firebase/firestore-storage.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,12 +5,14 @@ import {Observable} from 'rxjs/Observable';\nimport {NgSerializerService} from '@kaiu/ng-serializer';\nimport {FirestoreStorage} from '../firebase/firestore-storage';\nimport {AngularFirestore} from 'angularfire2/firestore';\n+import {PendingChangesService} from '../../pending-changes/pending-changes.service';\n@Injectable()\nexport class FirestoreListStorage extends FirestoreStorage<List> implements ListStore {\n- constructor(protected firestore: AngularFirestore, protected serializer: NgSerializerService, protected zone: NgZone) {\n- super(firestore, serializer, zone);\n+ constructor(protected firestore: AngularFirestore, protected serializer: NgSerializerService, protected zone: NgZone,\n+ protected pendingChangesService: PendingChangesService) {\n+ super(firestore, serializer, zone, pendingChangesService);\n}\ngetPublicLists(): Observable<List[]> {\n",
"new_path": "src/app/core/database/storage/list/firestore-list-storage.ts",
"old_path": "src/app/core/database/storage/list/firestore-list-storage.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -9,6 +9,7 @@ import {NgSerializerService} from '@kaiu/ng-serializer';\nimport {FirebaseStorage} from './storage/firebase/firebase-storage';\nimport {AngularFireDatabase} from 'angularfire2/database';\nimport {DiffService} from './diff/diff.service';\n+import {PendingChangesService} from './pending-changes/pending-changes.service';\n@Injectable()\nexport class UserService extends FirebaseStorage<AppUser> {\n@@ -23,8 +24,9 @@ export class UserService extends FirebaseStorage<AppUser> {\nprivate listService: ListService,\nprotected serializer: NgSerializerService,\nprotected diffService: DiffService,\n- protected zone: NgZone) {\n- super(database, serializer, diffService, zone);\n+ protected zone: NgZone,\n+ protected pendingChangesService: PendingChangesService) {\n+ super(database, serializer, diffService, zone, pendingChangesService);\n}\npublic set(uid: string, user: AppUser): Observable<void> {\n",
"new_path": "src/app/core/database/user.service.ts",
"old_path": "src/app/core/database/user.service.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -6,12 +6,14 @@ import {AngularFirestore} from 'angularfire2/firestore';\nimport {Observable} from 'rxjs/Observable';\nimport {DocumentChangeAction} from 'angularfire2/firestore/interfaces';\nimport {List} from '../../model/list/list';\n+import {PendingChangesService} from './pending-changes/pending-changes.service';\n@Injectable()\nexport class WorkshopService extends FirestoreStorage<Workshop> {\n- constructor(protected firestore: AngularFirestore, protected serializer: NgSerializerService, protected zone: NgZone) {\n- super(firestore, serializer, zone);\n+ constructor(protected firestore: AngularFirestore, protected serializer: NgSerializerService, protected zone: NgZone,\n+ protected pendingChangesService: PendingChangesService) {\n+ super(firestore, serializer, zone, pendingChangesService);\n}\ngetUserWorkshops(uid: string): Observable<Workshop[]> {\n",
"new_path": "src/app/core/database/workshop.service.ts",
"old_path": "src/app/core/database/workshop.service.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -345,7 +345,9 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\nthis.item.workingOnIt = this.user.$key;\nthis.update.emit();\nthis.userService.get(this.item.workingOnIt)\n- .mergeMap(user => this.dataService.getCharacter(user.lodestoneId)).first().subscribe(char => {\n+ .mergeMap(user => this.dataService.getCharacter(user.lodestoneId))\n+ .first()\n+ .subscribe(char => {\nthis.worksOnIt = char;\nthis.cd.detectChanges();\n});\n",
"new_path": "src/app/modules/item/item/item.component.ts",
"old_path": "src/app/modules/item/item/item.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -254,7 +254,6 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\n}\nupdate(list: List): void {\n- console.log('update', list);\nthis.listService.update(this.listData.$key, list).first().subscribe(() => {\nthis.reload.emit();\n});\n@@ -262,6 +261,7 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\nset(list: List): void {\nthis.listService.set(this.listData.$key, list).first().subscribe(() => {\n+ this.reload.emit();\n});\n}\n",
"new_path": "src/app/pages/list/list-details/list-details.component.ts",
"old_path": "src/app/pages/list/list-details/list-details.component.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
feat: a dialog box will now show if you leave/reload the page while changes are saving
closes #309
| 1
|
feat
| null |
679,913
|
08.04.2018 22:15:44
| -3,600
|
fcf1404e795f42d0caf373153ff8faca06922743
|
refactor(hiccup): remove obsolete deref check
|
[
{
"change_type": "MODIFY",
"diff": "@@ -169,7 +169,7 @@ const normalize = (tag: any[]) => {\nif (tag.length > 1) {\nlet i = 1;\nconst att = tag[1];\n- if (isPlainObject(att) && !implementsFunction(att, \"deref\")) {\n+ if (isPlainObject(att)) {\nObject.assign(attribs, att);\ni++;\n}\n",
"new_path": "packages/hiccup/src/serialize.ts",
"old_path": "packages/hiccup/src/serialize.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(hiccup): remove obsolete deref check
| 1
|
refactor
|
hiccup
|
679,913
|
08.04.2018 22:48:26
| -3,600
|
2458b15f4c94b280a31a700b9d022ebd5aeb1fc8
|
docs(hiccup-svg): update readme
|
[
{
"change_type": "MODIFY",
"diff": "@@ -26,6 +26,17 @@ yarn add @thi.ng/hiccup-svg\n```typescript\nimport * as svg from \"@thi.ng/hiccup-svg\";\n+import { serialize } from \"@thi.ng/hiccup\";\n+import * as fs from \"fs\";\n+\n+fs.writeFileSync(\"hello.svg\",\n+ serialize(\n+ svg.svgdoc({width: 100, height: 100},\n+ svg.defs(svg.linearGradient(\"grad\", 0, 0, 0, 1, [[0, \"red\"], [1, \"blue\"]])),\n+ svg.circle([50, 50], 50, {fill: \"url(#grad)\"}),\n+ svg.text(\"Hello\", [50, 55], { fill: \"white\", \"text-anchor\": \"middle\"})\n+ )\n+ ));\n```\n## Authors\n",
"new_path": "packages/hiccup-svg/README.md",
"old_path": "packages/hiccup-svg/README.md"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs(hiccup-svg): update readme
| 1
|
docs
|
hiccup-svg
|
821,196
|
09.04.2018 00:27:04
| 25,200
|
fe9be07cf22d70741a5e28a7d5b2c147b18d64ff
|
fix: generate readme before packing
|
[
{
"change_type": "MODIFY",
"diff": "@@ -265,7 +265,7 @@ class App extends Generator {\nthis.pjson.scripts.prepack = 'rm -rf lib && tsc'\n}\nif (['plugin', 'multi'].includes(this.type)) {\n- this.pjson.scripts.prepack = nps.series(this.pjson.scripts.prepack, 'oclif-dev manifest')\n+ this.pjson.scripts.prepack = nps.series(this.pjson.scripts.prepack, 'oclif-dev manifest', 'oclif-dev readme')\nthis.pjson.scripts.postpack = nps.series(this.pjson.scripts.postpack, 'rm -f .oclif.manifest.json')\nthis.pjson.scripts.version = nps.series('oclif-dev readme', 'git add README.md')\nthis.pjson.files.push('.oclif.manifest.json')\n",
"new_path": "src/generators/app.ts",
"old_path": "src/generators/app.ts"
}
] |
TypeScript
|
MIT License
|
oclif/oclif
|
fix: generate readme before packing
| 1
|
fix
| null |
821,196
|
09.04.2018 01:18:36
| 25,200
|
3fc97ec33bbbb008b25fd48e4e08b099ff989d64
|
fix: add another command to multi examples
|
[
{
"change_type": "MODIFY",
"diff": "@@ -48,6 +48,9 @@ module.exports = (_, options) => {\n})\nsh.exec(`oclif ${type} --force --defaults ${options}`)\n+ if (type === 'multi') {\n+ sh.exec(`oclif command goodbye --force --defaults ${options}`)\n+ }\nsh.exec('git add -A')\ntry {\nexeca.sync('git', ['commit', '-m', `${releaseType === 'patch' ? 'fix' : 'feat'}: oclif v${version}\\n\\n${notes}`], {stdio: 'inherit'})\n",
"new_path": "scripts/release_example.js",
"old_path": "scripts/release_example.js"
}
] |
TypeScript
|
MIT License
|
oclif/oclif
|
fix: add another command to multi examples
| 1
|
fix
| null |
821,196
|
09.04.2018 01:25:02
| 25,200
|
41c00cabef73e10268d3d48b74c875715ef6bc2d
|
fix: command example generation
|
[
{
"change_type": "MODIFY",
"diff": "@@ -49,7 +49,7 @@ module.exports = (_, options) => {\nsh.exec(`oclif ${type} --force --defaults ${options}`)\nif (type === 'multi') {\n- sh.exec(`oclif command goodbye --force --defaults ${options}`)\n+ sh.exec(`oclif command goodbye --force --defaults`)\n}\nsh.exec('git add -A')\ntry {\n",
"new_path": "scripts/release_example.js",
"old_path": "scripts/release_example.js"
}
] |
TypeScript
|
MIT License
|
oclif/oclif
|
fix: command example generation
| 1
|
fix
| null |
821,196
|
09.04.2018 01:26:51
| 25,200
|
48ea0fe35a579f3b4498cdd44d4689e90b5f19d6
|
test: lint fix
|
[
{
"change_type": "MODIFY",
"diff": "@@ -49,7 +49,7 @@ module.exports = (_, options) => {\nsh.exec(`oclif ${type} --force --defaults ${options}`)\nif (type === 'multi') {\n- sh.exec(`oclif command goodbye --force --defaults`)\n+ sh.exec('oclif command goodbye --force --defaults')\n}\nsh.exec('git add -A')\ntry {\n",
"new_path": "scripts/release_example.js",
"old_path": "scripts/release_example.js"
}
] |
TypeScript
|
MIT License
|
oclif/oclif
|
test: lint fix
| 1
|
test
| null |
815,746
|
09.04.2018 09:37:05
| -10,800
|
c834a7880d0092cc9d2f9de0a86a15cda74067e5
|
fit: do not blink input on clcik
fixes
|
[
{
"change_type": "MODIFY",
"diff": "@@ -24,7 +24,7 @@ import { ConsoleService } from './console.service';\ndescribe('NgSelectComponent', function () {\n- describe('init', () => {\n+ describe('Init', () => {\nit('should map items correctly', fakeAsync(() => {\nconst fixture = createTestingModule(\nNgSelectTestCmp,\n@@ -1753,12 +1753,12 @@ describe('NgSelectComponent', function () {\nconst selectInput = fixture.debugElement.query(By.css('.ng-control'));\n// open\n- selectInput.triggerEventHandler('click', { stopPropagation: () => { } });\n+ selectInput.triggerEventHandler('mousedown', { stopPropagation: () => { } });\ntickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.isOpen).toBe(true);\n// close\n- selectInput.triggerEventHandler('click', { stopPropagation: () => { } });\n+ selectInput.triggerEventHandler('mousedown', { stopPropagation: () => { } });\ntickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.isOpen).toBe(false);\n}));\n@@ -2171,7 +2171,7 @@ describe('NgSelectComponent', function () {\n}));\nit('should toggle dropdown', fakeAsync(() => {\n- const clickArrow = () => arrowIcon.triggerEventHandler('click', { stopPropagation: () => { } });\n+ const clickArrow = () => arrowIcon.triggerEventHandler('mousedown', { stopPropagation: () => { } });\n// open\nclickArrow();\ntickAndDetectChanges(fixture);\n",
"new_path": "src/ng-select/ng-select.component.spec.ts",
"old_path": "src/ng-select/ng-select.component.spec.ts"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
fit: do not blink input on clcik (#415)
fixes #368
| 1
|
fit
| null |
815,746
|
09.04.2018 09:39:34
| -10,800
|
ccfc73d4dc085ca90f15f4ce6c62c76d83b99c80
|
chore(release): 0.35.2
|
[
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"0.35.2\"></a>\n+## [0.35.2](https://github.com/ng-select/ng-select/compare/v0.35.1...v0.35.2) (2018-04-09)\n+\n+\n+\n<a name=\"0.35.1\"></a>\n## [0.35.1](https://github.com/ng-select/ng-select/compare/v0.35.0...v0.35.1) (2018-04-06)\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"$schema\": \"../node_modules/ng-packagr/package.schema.json\",\n\"name\": \"@ng-select/ng-select\",\n- \"version\": \"0.35.1\",\n+ \"version\": \"0.35.2\",\n\"description\": \"Angular ng-select - All in One UI Select, Multiselect and Autocomplete\",\n\"author\": \"@ng-select/ng-select\",\n\"license\": \"MIT\",\n",
"new_path": "src/package.json",
"old_path": "src/package.json"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
chore(release): 0.35.2
| 1
|
chore
|
release
|
730,413
|
09.04.2018 13:06:24
| 14,400
|
a7d78145746017d228e3b09bd464b1188be45b17
|
fix(journeys): open meet widget in remote browser for data api calling test
|
[
{
"change_type": "MODIFY",
"diff": "@@ -74,11 +74,11 @@ describe('Widget Space: One on One: Data API Settings', () => {\ncsmmDom.setAttribute('data-toggle', 'ciscospark-space');\ncsmmDom.setAttribute('data-access-token', localAccessToken);\ncsmmDom.setAttribute('data-to-person-email', localToUserEmail);\n- csmmDom.setAttribute('data-initial-activity', 'message');\n+ csmmDom.setAttribute('data-initial-activity', 'meet');\ndocument.getElementById('ciscospark-widget').appendChild(csmmDom);\nwindow.loadBundle('/dist-space/bundle.js');\n}, mccoy.token.access_token, spock.email);\n- browserRemote.waitForVisible(elements.messageWidget);\n+ browserRemote.waitForVisible(elements.meetWidget);\n});\nbefore('inject token', () => {\n",
"new_path": "test/journeys/specs/oneOnOne/dataApi/startup-settings.js",
"old_path": "test/journeys/specs/oneOnOne/dataApi/startup-settings.js"
}
] |
JavaScript
|
MIT License
|
webex/react-widgets
|
fix(journeys): open meet widget in remote browser for data api calling test
| 1
|
fix
|
journeys
|
807,849
|
09.04.2018 15:52:51
| 25,200
|
a1bff40e65cb29b06aecbcafb3a9b4d0176b58cf
|
feat(conventional-commits): Support local file presets
Dramatically improves test coverage, as well.
|
[
{
"change_type": "MODIFY",
"diff": "@@ -852,19 +852,19 @@ describe(\"PublishCommand\", () => {\nexpect(ConventionalCommitUtilities.recommendVersion).toBeCalledWith(\nexpect.objectContaining({ name }),\n\"independent\",\n- { changelogPreset: undefined }\n+ { changelogPreset: undefined, rootPath: testDir }\n);\nexpect(ConventionalCommitUtilities.updateChangelog).toBeCalledWith(\nexpect.objectContaining({ name, version: versionBumps[idx] }),\n\"independent\",\n- { changelogPreset: undefined }\n+ { changelogPreset: undefined, rootPath: testDir }\n);\n});\n});\nit(\"accepts --changelog-preset option\", async () => {\nconst testDir = await initFixture(\"independent\");\n- const changelogOpts = { changelogPreset: \"foo-bar\" };\n+ const changelogOpts = { changelogPreset: \"foo-bar\", rootPath: testDir };\nawait lernaPublish(testDir)(\"--conventional-commits\", \"--changelog-preset\", \"foo-bar\");\n@@ -905,13 +905,13 @@ describe(\"PublishCommand\", () => {\nexpect(ConventionalCommitUtilities.recommendVersion).toBeCalledWith(\nexpect.objectContaining({ name, location }),\n\"fixed\",\n- { changelogPreset: undefined }\n+ { changelogPreset: undefined, rootPath: testDir }\n);\nexpect(ConventionalCommitUtilities.updateChangelog).toBeCalledWith(\nexpect.objectContaining({ name, version: \"2.0.0\" }),\n\"fixed\",\n- { changelogPreset: undefined }\n+ { changelogPreset: undefined, rootPath: testDir }\n);\n});\n@@ -921,13 +921,13 @@ describe(\"PublishCommand\", () => {\nlocation: testDir,\n}),\n\"root\",\n- { changelogPreset: undefined, version: \"2.0.0\" }\n+ { changelogPreset: undefined, rootPath: testDir, version: \"2.0.0\" }\n);\n});\nit(\"accepts --changelog-preset option\", async () => {\nconst testDir = await initFixture(\"normal\");\n- const changelogOpts = { changelogPreset: \"baz-qux\" };\n+ const changelogOpts = { changelogPreset: \"baz-qux\", rootPath: testDir };\nawait lernaPublish(testDir)(\"--conventional-commits\", \"--changelog-preset\", \"baz-qux\");\n",
"new_path": "commands/publish/__tests__/publish-command.test.js",
"old_path": "commands/publish/__tests__/publish-command.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -298,7 +298,7 @@ class PublishCommand extends Command {\nrecommendVersions() {\nconst independentVersions = this.project.isIndependent();\nconst { changelogPreset } = this.options;\n- const opts = { changelogPreset };\n+ const rootPath = this.project.manifest.location;\nconst type = independentVersions ? \"independent\" : \"fixed\";\nlet chain = Promise.resolve();\n@@ -321,7 +321,12 @@ class PublishCommand extends Command {\n}\nchain = chain.then(() =>\n- this.reduceVersions(pkg => ConventionalCommitUtilities.recommendVersion(pkg, type, opts))\n+ this.reduceVersions(pkg =>\n+ ConventionalCommitUtilities.recommendVersion(pkg, type, {\n+ changelogPreset,\n+ rootPath,\n+ })\n+ )\n);\nif (type === \"fixed\") {\n@@ -436,6 +441,7 @@ class PublishCommand extends Command {\nconst { conventionalCommits, changelogPreset } = this.options;\nconst independentVersions = this.project.isIndependent();\nconst rootPkg = this.project.manifest;\n+ const rootPath = rootPkg.location;\nconst changedFiles = new Set();\n// my kingdom for async await :(\n@@ -484,12 +490,13 @@ class PublishCommand extends Command {\n// the updated version that we're about to release.\nconst type = independentVersions ? \"independent\" : \"fixed\";\n- return ConventionalCommitUtilities.updateChangelog(pkg, type, { changelogPreset }).then(\n- changelogLocation => {\n+ return ConventionalCommitUtilities.updateChangelog(pkg, type, {\n+ changelogPreset,\n+ rootPath,\n+ }).then(changelogLocation => {\n// commit the updated changelog\nchangedFiles.add(changelogLocation);\n- }\n- );\n+ });\n}\n}),\n// TODO: tune the concurrency\n@@ -501,6 +508,7 @@ class PublishCommand extends Command {\nchain = chain.then(() =>\nConventionalCommitUtilities.updateChangelog(rootPkg, \"root\", {\nchangelogPreset,\n+ rootPath,\nversion: this.globalVersion,\n}).then(changelogLocation => {\n// commit the updated changelog\n",
"new_path": "commands/publish/index.js",
"old_path": "commands/publish/index.js"
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+module.exports = {\n+ recommendedBumpOpts: {\n+ whatBump: \"I should be a function\",\n+ },\n+};\n",
"new_path": "core/conventional-commits/__tests__/__fixtures__/fixed/scripts/erroring-preset.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+// https://git.io/vx5iq (conventional-changelog-angular/conventional-recommended-bump.js, etc)\n+const parserOpts = require(\"./parser-opts\");\n+const writerOpts = require(\"./writer-opts\");\n+const whatBump = require(\"./what-bump\");\n+\n+module.exports = {\n+ conventionalChangelog: {\n+ parserOpts,\n+ writerOpts,\n+ },\n+ recommendedBumpOpts: {\n+ parserOpts,\n+ whatBump,\n+ },\n+};\n",
"new_path": "core/conventional-commits/__tests__/__fixtures__/fixed/scripts/local-preset.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+// https://git.io/vx5iq (conventional-changelog-angular/conventional-recommended-bump.js, etc)\n+const parserOpts = require(\"./parser-opts\");\n+const writerOpts = require(\"./writer-opts\");\n+const whatBump = require(\"./what-bump\");\n+\n+module.exports = {\n+ parserOpts,\n+ writerOpts,\n+ whatBump,\n+};\n",
"new_path": "core/conventional-commits/__tests__/__fixtures__/fixed/scripts/old-api-preset.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+module.exports = {\n+ headerPattern: /^(\\w*)(?:\\((.*)\\))?: (.*)$/,\n+ headerCorrespondence: [`type`, `scope`, `subject`],\n+ noteKeywords: [`BREAKING CHANGE`],\n+ revertPattern: /^revert:\\s([\\s\\S]*?)\\s*This reverts commit (\\w*)\\./,\n+ revertCorrespondence: [`header`, `hash`],\n+};\n",
"new_path": "core/conventional-commits/__tests__/__fixtures__/fixed/scripts/parser-opts.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+module.exports = whatBump;\n+\n+function whatBump(commits) {\n+ let level = 2;\n+ let breakings = 0;\n+ let features = 0;\n+\n+ commits.forEach(commit => {\n+ if (commit.notes.length > 0) {\n+ breakings += commit.notes.length;\n+ level = 0;\n+ } else if (commit.type === `feat`) {\n+ features += 1;\n+ if (level === 2) {\n+ level = 1;\n+ }\n+ }\n+ });\n+\n+ return {\n+ level,\n+ reason:\n+ breakings === 1\n+ ? `There are ${breakings} BREAKING CHANGE and ${features} features`\n+ : `There are ${breakings} BREAKING CHANGES and ${features} features`,\n+ };\n+}\n",
"new_path": "core/conventional-commits/__tests__/__fixtures__/fixed/scripts/what-bump.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+module.exports = {\n+ transform: (commit, context) => {\n+ /* eslint-disable no-param-reassign */\n+ let discard = true;\n+ const issues = [];\n+\n+ commit.notes.forEach(note => {\n+ note.title = `BREAKING CHANGES`;\n+ discard = false;\n+ });\n+\n+ if (commit.type === `feat`) {\n+ commit.type = `Features`;\n+ } else if (commit.type === `fix`) {\n+ commit.type = `Bug Fixes`;\n+ } else if (commit.type === `perf`) {\n+ commit.type = `Performance Improvements`;\n+ } else if (commit.type === `revert`) {\n+ commit.type = `Reverts`;\n+ } else if (discard) {\n+ return;\n+ } else if (commit.type === `docs`) {\n+ commit.type = `Documentation`;\n+ } else if (commit.type === `style`) {\n+ commit.type = `Styles`;\n+ } else if (commit.type === `refactor`) {\n+ commit.type = `Code Refactoring`;\n+ } else if (commit.type === `test`) {\n+ commit.type = `Tests`;\n+ } else if (commit.type === `build`) {\n+ commit.type = `Build System`;\n+ } else if (commit.type === `ci`) {\n+ commit.type = `Continuous Integration`;\n+ }\n+\n+ if (commit.scope === `*`) {\n+ commit.scope = ``;\n+ }\n+\n+ if (typeof commit.hash === `string`) {\n+ commit.hash = commit.hash.substring(0, 7);\n+ }\n+\n+ if (typeof commit.subject === `string`) {\n+ let url = context.repository\n+ ? `${context.host}/${context.owner}/${context.repository}`\n+ : context.repoUrl;\n+ if (url) {\n+ url = `${url}/issues/`;\n+ // Issue URLs.\n+ commit.subject = commit.subject.replace(/#([0-9]+)/g, (_, issue) => {\n+ issues.push(issue);\n+ return `[#${issue}](${url}${issue})`;\n+ });\n+ }\n+ if (context.host) {\n+ // User URLs.\n+ commit.subject = commit.subject.replace(\n+ /\\B@([a-z0-9](?:-?[a-z0-9]){0,38})/g,\n+ `[@$1](${context.host}/$1)`\n+ );\n+ }\n+ }\n+\n+ // remove references that already appear in the subject\n+ commit.references = commit.references.filter(reference => {\n+ if (issues.indexOf(reference.issue) === -1) {\n+ return true;\n+ }\n+\n+ return false;\n+ });\n+\n+ return commit;\n+ /* eslint-enable no-param-reassign */\n+ },\n+ groupBy: `type`,\n+ commitGroupsSort: `title`,\n+ commitsSort: [`scope`, `subject`],\n+ noteGroupsSort: `title`,\n+ // notesSort: compareFunc,\n+ mainTemplate: [\n+ \"{{> header}}\",\n+ \"\",\n+ \"{{#each commitGroups}}\",\n+ \"{{#each commits}}\",\n+ \"{{> commit root=@root}}\",\n+ \"{{/each}}\",\n+ \"{{/each}}\",\n+ \"\",\n+ \"{{> footer}}\",\n+ ].join(\"\\n\"),\n+ headerPartial: [\n+ '<a name=\"{{version}}\"></a>',\n+ \"## {{#if isPatch~}} <small>\",\n+ \"{{~/if~}} {{version}}\",\n+ '{{~#if title}} \"{{title}}\"',\n+ \"{{~/if~}}\",\n+ \"{{~#if date}} ({{date}})\",\n+ \"{{~/if~}}\",\n+ \"{{~#if isPatch~}} </small>\",\n+ \"{{~/if}}\",\n+ \"\",\n+ ].join(\"\\n\"),\n+ commitPartial: \"* {{header}}\",\n+ footerPartial: [\n+ \"{{#if noteGroups}}\",\n+ \"{{#each noteGroups}}\",\n+ \"\",\n+ \"### {{title}}\",\n+ \"\",\n+ \"{{#each notes}}\",\n+ \"* {{text}}\",\n+ \"{{/each}}\",\n+ \"{{/each}}\",\n+ \"{{/if}}\",\n+ ].join(\"\\n\"),\n+};\n",
"new_path": "core/conventional-commits/__tests__/__fixtures__/fixed/scripts/writer-opts.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -7,7 +7,7 @@ All notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n<a name=\"1.0.1\"></a>\n-## [1.0.1](https://github.com/lerna/conventional-commits-fixed/compare/v1.0.0...v1.0.1) (YYYY-MM-DD)\n+## <small>1.0.1 (YYYY-MM-DD)</small>\n**Note:** Version bump only for package package-2\n@@ -57,6 +57,27 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline\n`;\n+exports[`conventional-commits updateChangelog() supports old preset API 1`] = `\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+<a name=\"1.0.1\"></a>\n+## <small>1.0.1 (YYYY-MM-DD)</small>\n+* fix(pkg1): A commit using the old preset API\n+\n+\n+<a name=\"1.0.0\"></a>\n+\n+# 1.0.0 (YYYY-MM-DD)\n+\n+### Features\n+\n+* I should be placed in the CHANGELOG\n+\n+`;\n+\nexports[`conventional-commits updateChangelog() updates fixed changelogs 1`] = `\n# Change Log\n",
"new_path": "core/conventional-commits/__tests__/__snapshots__/conventional-commits.test.js.snap",
"old_path": "core/conventional-commits/__tests__/__snapshots__/conventional-commits.test.js.snap"
},
{
"change_type": "MODIFY",
"diff": "@@ -48,6 +48,107 @@ describe(\"conventional-commits\", () => {\nawait expect(recommendVersion(pkg1, \"independent\", opts)).resolves.toBe(\"1.0.1\");\nawait expect(recommendVersion(pkg2, \"independent\", opts)).resolves.toBe(\"1.1.0\");\n});\n+\n+ it(\"supports local preset paths\", async () => {\n+ const cwd = await initFixture(\"fixed\");\n+ const [pkg1] = await collectPackages(cwd);\n+\n+ // make a change in package-1\n+ await pkg1.set(\"changed\", 1).serialize();\n+ await gitAdd(cwd, pkg1.manifestLocation);\n+ await gitCommit(cwd, \"feat: changed 1\");\n+\n+ const bump = await recommendVersion(pkg1, \"fixed\", {\n+ changelogPreset: \"./scripts/local-preset.js\",\n+ });\n+ expect(bump).toBe(\"1.1.0\");\n+ });\n+\n+ it(\"propagates errors from callback\", async () => {\n+ const cwd = await initFixture(\"fixed\");\n+ const [pkg1] = await collectPackages(cwd);\n+\n+ try {\n+ await recommendVersion(pkg1, \"fixed\", { changelogPreset: \"./scripts/erroring-preset.js\" });\n+ } catch (err) {\n+ expect(err.message).toBe(\"whatBump must be a function\");\n+ }\n+\n+ expect.hasAssertions();\n+ });\n+\n+ it(\"throws an error when an implicit changelog preset cannot be loaded\", async () => {\n+ const cwd = await initFixture(\"fixed\");\n+ const [pkg1] = await collectPackages(cwd);\n+\n+ try {\n+ await recommendVersion(pkg1, \"fixed\", { changelogPreset: \"garbage\" });\n+ } catch (err) {\n+ expect(err.message).toBe(\n+ \"Unable to load conventional-commits preset 'garbage' (conventional-changelog-garbage)\"\n+ );\n+ }\n+\n+ expect.hasAssertions();\n+ });\n+\n+ it(\"throws an error when an implicit changelog preset with scope cannot be loaded\", async () => {\n+ const cwd = await initFixture(\"fixed\");\n+ const [pkg1] = await collectPackages(cwd);\n+\n+ try {\n+ await recommendVersion(pkg1, \"fixed\", { changelogPreset: \"@scope/garbage\" });\n+ } catch (err) {\n+ expect(err.message).toMatch(\"preset '@scope/garbage' (@scope/conventional-changelog-garbage)\");\n+ }\n+\n+ expect.hasAssertions();\n+ });\n+\n+ it(\"throws an error when an implicit changelog preset with scoped subpath cannot be loaded\", async () => {\n+ const cwd = await initFixture(\"fixed\");\n+ const [pkg1] = await collectPackages(cwd);\n+\n+ try {\n+ await recommendVersion(pkg1, \"fixed\", { changelogPreset: \"@scope/garbage/pail\" });\n+ } catch (err) {\n+ expect(err.message).toMatch(\n+ \"preset '@scope/garbage/pail' (@scope/conventional-changelog-garbage/pail)\"\n+ );\n+ }\n+\n+ expect.hasAssertions();\n+ });\n+\n+ it(\"throws an error when an explicit changelog preset cannot be loaded\", async () => {\n+ const cwd = await initFixture(\"fixed\");\n+ const [pkg1] = await collectPackages(cwd);\n+\n+ try {\n+ await recommendVersion(pkg1, \"fixed\", { changelogPreset: \"conventional-changelog-garbage\" });\n+ } catch (err) {\n+ expect(err.message).toBe(\n+ \"Unable to load conventional-commits preset 'conventional-changelog-garbage'\"\n+ );\n+ }\n+\n+ expect.hasAssertions();\n+ });\n+\n+ it(\"throws an error when an explicit changelog preset with subpath cannot be loaded\", async () => {\n+ const cwd = await initFixture(\"fixed\");\n+ const [pkg1] = await collectPackages(cwd);\n+\n+ try {\n+ await recommendVersion(pkg1, \"fixed\", { changelogPreset: \"conventional-changelog-garbage/pail\" });\n+ } catch (err) {\n+ expect(err.message).toMatch(\n+ \"Unable to load conventional-commits preset 'conventional-changelog-garbage/pail'\"\n+ );\n+ }\n+\n+ expect.hasAssertions();\n+ });\n});\ndescribe(\"updateChangelog()\", () => {\n@@ -125,7 +226,27 @@ describe(\"conventional-commits\", () => {\nawait pkg2.set(\"version\", \"1.0.1\").serialize();\nawait expect(\n- updateChangelog(pkg2, \"fixed\", { changelogPreset: \"angular\" }).then(getFileContent)\n+ updateChangelog(pkg2, \"fixed\", { changelogPreset: \"./scripts/local-preset\" }).then(getFileContent)\n+ ).resolves.toMatchSnapshot();\n+ });\n+\n+ it(\"supports old preset API\", async () => {\n+ const cwd = await initFixture(\"fixed\");\n+\n+ await gitTag(cwd, \"v1.0.0\");\n+\n+ const [pkg1] = await collectPackages(cwd);\n+\n+ // make a change in package-1\n+ await pkg1.set(\"changed\", 1).serialize();\n+ await gitAdd(cwd, pkg1.manifestLocation);\n+ await gitCommit(cwd, \"fix(pkg1): A commit using the old preset API\");\n+\n+ // update version\n+ await pkg1.set(\"version\", \"1.0.1\").serialize();\n+\n+ await expect(\n+ updateChangelog(pkg1, \"fixed\", { changelogPreset: \"./scripts/old-api-preset\" }).then(getFileContent)\n).resolves.toMatchSnapshot();\n});\n@@ -152,7 +273,7 @@ describe(\"conventional-commits\", () => {\nawait pkg2.set(\"version\", \"1.1.0\").serialize();\nconst opts = {\n- changelogPreset: \"angular\",\n+ changelogPreset: \"conventional-changelog-angular\",\n};\nconst [changelogOne, changelogTwo] = await Promise.all([\nupdateChangelog(pkg1, \"independent\", opts).then(getFileContent),\n",
"new_path": "core/conventional-commits/__tests__/conventional-commits.test.js",
"old_path": "core/conventional-commits/__tests__/conventional-commits.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -23,25 +23,47 @@ const CHANGELOG_HEADER = dedent`\nconst cfgCache = new Map();\n-function getChangelogConfig(changelogPreset = \"conventional-changelog-angular\") {\n+function getChangelogConfig(changelogPreset = \"conventional-changelog-angular\", rootPath) {\nlet config = cfgCache.get(changelogPreset);\nif (!config) {\nlet presetPackageName = changelogPreset;\n- if (presetPackageName.indexOf(\"conventional-changelog-\") < 0) {\n// https://github.com/npm/npm-package-arg#result-object\n- const parsed = npa(presetPackageName);\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- if (!parsed.name && parsed.raw[0] === \"@\") {\n- // npa parses sub-path reference as a directory,\n- // which results in an undefined \"name\" property\n- throw new ValidationError(\n- \"ESCOPE\",\n- \"A scoped conventional-changelog preset must use the full package name to reference subpaths\"\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+ if (parsed.name.indexOf(\"conventional-changelog-\") < 0) {\n// implicit 'conventional-changelog-' prefix\nconst parts = parsed.name.split(\"/\");\nconst start = parsed.scope ? 1 : 0;\n@@ -60,9 +82,14 @@ function getChangelogConfig(changelogPreset = \"conventional-changelog-angular\")\ncfgCache.set(changelogPreset, config);\n} catch (err) {\n- log.silly(\"getChangelogConfig\", err);\n+ log.warn(\"getChangelogConfig\", err.message);\n- throw new ValidationError(\"EPRESET\", `Unable to load conventional-commits preset '${changelogPreset}'`);\n+ throw new ValidationError(\n+ \"EPRESET\",\n+ `Unable to load conventional-commits preset '${changelogPreset}'${\n+ changelogPreset !== presetPackageName ? ` (${presetPackageName})` : \"\"\n+ }`\n+ );\n}\n}\n@@ -70,7 +97,7 @@ function getChangelogConfig(changelogPreset = \"conventional-changelog-angular\")\nreturn Promise.resolve(config);\n}\n-function recommendVersion(pkg, type, { changelogPreset }) {\n+function recommendVersion(pkg, type, { changelogPreset, rootPath }) {\nlog.silly(type, \"for %s at %s\", pkg.name, pkg.location);\nconst options = {\n@@ -81,7 +108,7 @@ function recommendVersion(pkg, type, { changelogPreset }) {\noptions.lernaPackage = pkg.name;\n}\n- return getChangelogConfig(changelogPreset).then(config => {\n+ return getChangelogConfig(changelogPreset, rootPath).then(config => {\n// \"new\" preset API\noptions.config = config;\n@@ -134,10 +161,10 @@ function readExistingChangelog({ location }) {\n.then(changelogContents => [changelogFileLoc, changelogContents]);\n}\n-function updateChangelog(pkg, type, { changelogPreset, version }) {\n+function updateChangelog(pkg, type, { changelogPreset, rootPath, version }) {\nlog.silly(type, \"for %s at %s\", pkg.name, pkg.location);\n- return getChangelogConfig(changelogPreset).then(config => {\n+ return getChangelogConfig(changelogPreset, rootPath).then(config => {\nconst options = {};\nlet context; // pass as positional because cc-core's merge-config is wack\n",
"new_path": "core/conventional-commits/index.js",
"old_path": "core/conventional-commits/index.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
feat(conventional-commits): Support local file presets
Dramatically improves test coverage, as well.
| 1
|
feat
|
conventional-commits
|
807,849
|
09.04.2018 16:10:21
| 25,200
|
32a38ad70e699d7339bb2462c1bb4d83dc71b7c8
|
fix(project): Pin --exact require-from-string v2.0.1 to avoid integrity error with v2.0.2
|
[
{
"change_type": "MODIFY",
"diff": "\"glob-parent\": \"^3.1.0\",\n\"load-json-file\": \"^4.0.0\",\n\"npmlog\": \"^4.1.2\",\n+ \"require-from-string\": \"2.0.1\",\n\"resolve-from\": \"^4.0.0\",\n\"write-json-file\": \"^2.3.0\"\n}\n",
"new_path": "core/project/package.json",
"old_path": "core/project/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"glob-parent\": \"3.1.0\",\n\"load-json-file\": \"4.0.0\",\n\"npmlog\": \"4.1.2\",\n+ \"require-from-string\": \"2.0.1\",\n\"resolve-from\": \"4.0.0\",\n\"write-json-file\": \"2.3.0\"\n}\n",
"new_path": "package-lock.json",
"old_path": "package-lock.json"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
fix(project): Pin --exact require-from-string v2.0.1 to avoid integrity error with v2.0.2
https://github.com/floatdrop/require-from-string/issues/21
| 1
|
fix
|
project
|
791,690
|
09.04.2018 17:55:53
| 25,200
|
a6a9fc117708cf96e1a7ff3ada90d181d9c12173
|
core(lantern): more flexible graph edge creation
Also disable CPU throttling for Appveyor
|
[
{
"change_type": "MODIFY",
"diff": "@@ -72,4 +72,4 @@ function aUsedFunction () {\n}\naUsedFunction();\n-longTask();\n+longTask(175);\n",
"new_path": "lighthouse-cli/test/fixtures/byte-efficiency/script.js",
"old_path": "lighthouse-cli/test/fixtures/byte-efficiency/script.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -32,9 +32,9 @@ function generateInlineStyleWithSize(sizeInBytes, firstContent = '', used = fals\ndocument.head.appendChild(style);\n}\n-function longTask() {\n+function longTask(length = 75) {\nconst start = Date.now();\n- while (Date.now() < start + 100) ;\n+ while (Date.now() < start + length) ;\n}\n// Add a long task to delay FI\n@@ -53,6 +53,7 @@ setTimeout(() => {\nleft: 0;\n}\n</style>\n+<script src=\"script.js\"></script>\n</head>\n<body>\n@@ -165,7 +166,6 @@ generateInlineStyleWithSize(24000, '.definitely-unused { background: none; }\\n')\n<!-- Ensure the page takes at least 7 seconds and we don't exit before the lazily loaded image -->\n<script src=\"delay-complete.js?delay=7000\" async></script>\n-<script src=\"script.js\"></script>\n<script>\n// Used block #1\n// FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES -- FILLER DATA JUST TO OCCUPY BYTES\n",
"new_path": "lighthouse-cli/test/fixtures/byte-efficiency/tester.html",
"old_path": "lighthouse-cli/test/fixtures/byte-efficiency/tester.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -53,7 +53,7 @@ module.exports = [\nextendedInfo: {\nvalue: {\nwastedKb: '>=25',\n- wastedMs: '>500',\n+ wastedMs: '>300',\nresults: {\nlength: 2,\n},\n@@ -61,7 +61,6 @@ module.exports = [\n},\n},\n'offscreen-images': {\n- score: '<1', // big enough savings to interfere with download of script.js\nextendedInfo: {\nvalue: {\nresults: [\n@@ -79,11 +78,9 @@ module.exports = [\n},\n},\n'uses-webp-images': {\n- score: '<1', // big enough savings to interfere with download of script.js\nextendedInfo: {\nvalue: {\nwastedKb: '>60',\n- wastedMs: '>200',\nresults: {\nlength: 4,\n},\n@@ -91,6 +88,7 @@ module.exports = [\n},\n},\n'uses-text-compression': {\n+ score: '<1',\nextendedInfo: {\nvalue: {\nwastedMs: '>700',\n@@ -115,7 +113,6 @@ module.exports = [\nextendedInfo: {\nvalue: {\nwastedKb: '>50',\n- wastedMs: '>100',\nresults: {\nlength: 3,\n},\n",
"new_path": "lighthouse-cli/test/smokehouse/byte-efficiency/expectations.js",
"old_path": "lighthouse-cli/test/smokehouse/byte-efficiency/expectations.js"
},
{
"change_type": "MODIFY",
"diff": "/* eslint-disable no-console */\n+const fs = require('fs');\nconst path = require('path');\nconst spawnSync = require('child_process').spawnSync;\nconst yargs = require('yargs');\n@@ -43,19 +44,34 @@ function resolveLocalOrCwd(payloadPath) {\n* Launch Chrome and do a full Lighthouse run.\n* @param {string} url\n* @param {string} configPath\n+ * @param {boolean=} isDebug\n* @return {!LighthouseResults}\n*/\n-function runLighthouse(url, configPath) {\n+function runLighthouse(url, configPath, isDebug) {\n+ isDebug = isDebug || process.env.SMOKEHOUSE_DEBUG;\n+\nconst command = 'node';\n+ const outputPath = `smokehouse-${Math.round(Math.random() * 100000)}.report.json`;\nconst args = [\n'lighthouse-cli/index.js',\nurl,\n`--config-path=${configPath}`,\n+ `--output-path=${outputPath}`,\n'--output=json',\n'--quiet',\n'--port=0',\n];\n+ if (isDebug) {\n+ args.push('-GA');\n+ }\n+\n+ if (process.env.APPVEYOR) {\n+ // Appveyor is hella slow already, disable CPU throttling so we're not 16x slowdown\n+ // see https://github.com/GoogleChrome/lighthouse/issues/4891\n+ args.push('--disable-cpu-throttling');\n+ }\n+\n// Lighthouse sometimes times out waiting to for a connection to Chrome in CI.\n// Watch for this error and retry relaunching Chrome and running Lighthouse up\n// to RETRIES times. See https://github.com/GoogleChrome/lighthouse/issues/833\n@@ -80,7 +96,19 @@ function runLighthouse(url, configPath) {\nprocess.exit(runResults.status);\n}\n- return JSON.parse(runResults.stdout);\n+ if (isDebug) {\n+ console.log(`STDOUT: ${runResults.stdout}`);\n+ console.error(`STDERR: ${runResults.stderr}`);\n+ }\n+\n+ const lhr = fs.readFileSync(outputPath, 'utf8');\n+ if (isDebug) {\n+ console.log('LHR output available at: ', outputPath);\n+ } else {\n+ fs.unlinkSync(outputPath);\n+ }\n+\n+ return JSON.parse(lhr);\n}\n/**\n@@ -275,6 +303,7 @@ const cli = yargs\n.describe({\n'config-path': 'The path to the config JSON file',\n'expectations-path': 'The path to the expected audit results file',\n+ 'debug': 'Save the artifacts along with the output',\n})\n.default('config-path', DEFAULT_CONFIG_PATH)\n.default('expectations-path', DEFAULT_EXPECTATIONS_PATH)\n@@ -289,7 +318,7 @@ let passingCount = 0;\nlet failingCount = 0;\nexpectations.forEach(expected => {\nconsole.log(`Checking '${expected.initialUrl}'...`);\n- const results = runLighthouse(expected.initialUrl, configPath);\n+ const results = runLighthouse(expected.initialUrl, configPath, cli.debug);\nconst collated = collateResults(results, expected);\nconst counts = report(collated);\npassingCount += counts.passed;\n",
"new_path": "lighthouse-cli/test/smokehouse/smokehouse.js",
"old_path": "lighthouse-cli/test/smokehouse/smokehouse.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -145,20 +145,31 @@ class PageDependencyGraphArtifact extends ComputedArtifact {\nfunction addDependentNetworkRequest(cpuNode, reqId) {\nconst networkNode = networkNodeOutput.idToNodeMap.get(reqId);\nif (!networkNode ||\n- networkNode.record._resourceType !== WebInspector.resourceTypes.XHR) return;\n+ // Ignore all non-XHRs\n+ networkNode.record._resourceType !== WebInspector.resourceTypes.XHR ||\n+ // Ignore all network nodes that started before this CPU task started\n+ // A network request that started earlier could not possibly have been started by this task\n+ networkNode.startTime <= cpuNode.startTime) return;\ncpuNode.addDependent(networkNode);\n}\nfunction addDependencyOnUrl(cpuNode, url) {\nif (!url) return;\n+ // Allow network requests that end up to 100ms before the task started\n+ // Some script evaluations can start before the script finishes downloading\n+ const minimumAllowableTimeSinceNetworkNodeEnd = -100 * 1000;\nconst candidates = networkNodeOutput.urlToNodeMap.get(url) || [];\nlet minCandidate = null;\nlet minDistance = Infinity;\n// Find the closest request that finished before this CPU task started\ncandidates.forEach(candidate => {\n+ // Explicitly ignore all requests that started after this CPU node\n+ // A network request that started after this task started cannot possibly be a dependency\n+ if (cpuNode.startTime <= candidate.startTime) return;\n+\nconst distance = cpuNode.startTime - candidate.endTime;\n- if (distance > 0 && distance < minDistance) {\n+ if (distance >= minimumAllowableTimeSinceNetworkNodeEnd && distance < minDistance) {\nminCandidate = candidate;\nminDistance = distance;\n}\n",
"new_path": "lighthouse-core/gather/computed/page-dependency-graph.js",
"old_path": "lighthouse-core/gather/computed/page-dependency-graph.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -17,7 +17,7 @@ const assert = require('assert');\nfunction createRequest(requestId, url, startTime = 0, _initiator = null, _resourceType = null) {\nstartTime = startTime / 1000;\n- const endTime = startTime + 0.1;\n+ const endTime = startTime + 0.05;\nreturn {requestId, url, startTime, endTime, _initiator, _resourceType};\n}\n@@ -207,5 +207,47 @@ describe('PageDependencyGraph computed artifact:', () => {\nassert.deepEqual(nodes[2].getDependencies(), [nodes[0]]);\nassert.deepEqual(nodes[3].getDependencies(), [nodes[0]]); // should depend on rootNode instead\n});\n+\n+ it('should be forgiving without cyclic dependencies', () => {\n+ const request1 = createRequest(1, '1', 0);\n+ const request2 = createRequest(2, '2', 250, null, WebInspector.resourceTypes.XHR);\n+ const request3 = createRequest(3, '3', 210);\n+ const request4 = createRequest(4, '4', 590);\n+ const request5 = createRequest(5, '5', 595, null, WebInspector.resourceTypes.XHR);\n+ const networkRecords = [request1, request2, request3, request4, request5];\n+\n+ addTaskEvents(200, 200, [\n+ // CPU 1.2 should depend on Network 1\n+ {name: 'EvaluateScript', data: {url: '1'}},\n+\n+ // Network 2 should depend on CPU 1.2, but 1.2 should not depend on Network 1\n+ {name: 'ResourceSendRequest', data: {requestId: 2}},\n+ {name: 'XHRReadyStateChange', data: {readyState: 4, url: '2'}},\n+\n+ // CPU 1.2 should not depend on Network 3 because it starts after CPU 1.2\n+ {name: 'EvaluateScript', data: {url: '3'}},\n+ ]);\n+\n+ addTaskEvents(600, 150, [\n+ // CPU 1.4 should depend on Network 4 even though it ends at 410ms\n+ {name: 'InvalidateLayout', data: {stackTrace: [{url: '4'}]}},\n+ // Network 5 should not depend on CPU 1.4 because it started before CPU 1.4\n+ {name: 'ResourceSendRequest', data: {requestId: 5}},\n+ ]);\n+\n+ const graph = PageDependencyGraph.createGraph(traceOfTab, networkRecords);\n+ const nodes = [];\n+ graph.traverse(node => nodes.push(node));\n+\n+ const getDependencyIds = node => node.getDependencies().map(node => node.id);\n+\n+ assert.deepEqual(getDependencyIds(nodes[0]), []);\n+ assert.deepEqual(getDependencyIds(nodes[1]), [1, '1.200000']);\n+ assert.deepEqual(getDependencyIds(nodes[2]), [1]);\n+ assert.deepEqual(getDependencyIds(nodes[3]), [1]);\n+ assert.deepEqual(getDependencyIds(nodes[4]), [1]);\n+ assert.deepEqual(getDependencyIds(nodes[5]), [1]);\n+ assert.deepEqual(getDependencyIds(nodes[6]), [4]);\n+ });\n});\n});\n",
"new_path": "lighthouse-core/test/gather/computed/page-dependency-graph-test.js",
"old_path": "lighthouse-core/test/gather/computed/page-dependency-graph-test.js"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
core(lantern): more flexible graph edge creation (#4933)
Also disable CPU throttling for Appveyor
| 1
|
core
|
lantern
|
807,918
|
09.04.2018 18:16:27
| 18,000
|
d7e33c6e422934a37302f5e78e226423e3abcf04
|
feat(bootstrap): Use `npm ci` with `--ci` option
|
[
{
"change_type": "MODIFY",
"diff": "@@ -215,6 +215,10 @@ May also be configured in `lerna.json`:\n}\n```\n+#### --ci\n+\n+This runs `lerna bootstrap` with `npm ci` as opposed to `npm install`. The specifics of this command can be found in the NPM documentation [here](https://docs.npmjs.com/cli/ci)\n+\n#### How `bootstrap` works\nLet's use `babel` as an example.\n",
"new_path": "README.md",
"old_path": "README.md"
},
{
"change_type": "ADD",
"diff": "+{\n+ \"version\": \"1.0.0\"\n+}\n",
"new_path": "commands/bootstrap/__tests__/__fixtures__/ci/lerna.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"vi\",\n+ \"version\": \"0.0.0-lerna\",\n+ \"private\": true\n+}\n",
"new_path": "commands/bootstrap/__tests__/__fixtures__/ci/package.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"package-1\",\n+ \"version\": \"1.0.0\",\n+ \"lockfileVersion\": 1,\n+ \"requires\": true,\n+ \"dependencies\": {\n+ \"tiny-tarball\": {\n+ \"version\": \"1.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/tiny-tarball/-/tiny-tarball-1.0.0.tgz\",\n+ \"integrity\": \"sha1-u/EC1a5zr+LFUyleD7AiMCFvZbE=\"\n+ }\n+ }\n+}\n",
"new_path": "commands/bootstrap/__tests__/__fixtures__/ci/packages/package-1/package-lock.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"package-1\",\n+ \"version\": \"1.0.0\",\n+ \"scripts\": {\n+ \"test\": \"echo package-1\"\n+ },\n+ \"dependencies\": {\n+ \"tiny-tarball\": \"^1.0.0\"\n+ }\n+}\n",
"new_path": "commands/bootstrap/__tests__/__fixtures__/ci/packages/package-1/package.json",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -166,6 +166,44 @@ describe(\"BootstrapCommand\", () => {\n});\n});\n+ describe(\"with --ci\", async () => {\n+ const originalNpmUserAgent = process.env.npm_config_user_agent;\n+\n+ afterEach(() => {\n+ process.env.npm_config_user_agent = originalNpmUserAgent;\n+ });\n+\n+ it(\"should call npmInstall with ci subCommand if on npm 5.7.0 or later\", async () => {\n+ const testDir = await initFixture(\"ci\");\n+ process.env.npm_config_user_agent = \"npm/5.7.0 node/v9.9.0 darwin x64\";\n+\n+ await lernaBootstrap(testDir)(\"--ci\");\n+\n+ expect(npmInstall.dependencies.mock.calls[0][2]).toMatchObject({\n+ subCommand: \"ci\",\n+ registry: undefined,\n+ npmClient: \"npm\",\n+ npmGlobalStyle: false,\n+ npmClientArgs: undefined,\n+ mutex: undefined,\n+ });\n+ });\n+\n+ it(\"should not pass subCommand to npmInstall if on npm version earlier than 5.7.0\", async () => {\n+ const testDir = await initFixture(\"ci\");\n+ process.env.npm_config_user_agent = \"npm/5.6.0 node/v9.9.0 darwin x64\";\n+\n+ await lernaBootstrap(testDir)(\"--ci\");\n+\n+ expect(npmInstall.dependencies.mock.calls[0][2]).toMatchObject({\n+ registry: undefined,\n+ npmClient: \"npm\",\n+ npmClientArgs: undefined,\n+ mutex: undefined,\n+ });\n+ });\n+ });\n+\ndescribe(\"with local package dependencies\", () => {\nit(\"should bootstrap packages\", async () => {\nconst testDir = await initFixture(\"basic\");\n",
"new_path": "commands/bootstrap/__tests__/bootstrap-command.test.js",
"old_path": "commands/bootstrap/__tests__/bootstrap-command.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -21,6 +21,7 @@ const symlinkBinary = require(\"@lerna/symlink-binary\");\nconst symlinkDependencies = require(\"@lerna/symlink-dependencies\");\nconst ValidationError = require(\"@lerna/validation-error\");\nconst isHoistedPackage = require(\"./lib/is-hoisted-package\");\n+const makeNpmFeaturePredicate = require(\"./lib/make-npm-feature-predicate\");\nmodule.exports = factory;\n@@ -68,6 +69,12 @@ class BootstrapCommand extends Command {\nmutex,\n};\n+ const hasNpmCI = makeNpmFeaturePredicate(\">=5.7.0\");\n+\n+ if (npmClient === \"npm\" && this.options.ci && hasNpmCI()) {\n+ this.npmConfig.subCommand = \"ci\";\n+ }\n+\n// lerna bootstrap ... -- <input>\nconst doubleDashArgs = this.options[\"--\"] || [];\nif (doubleDashArgs.length) {\n",
"new_path": "commands/bootstrap/index.js",
"old_path": "commands/bootstrap/index.js"
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+const semver = require(\"semver\");\n+\n+module.exports = makeNpmFeaturePredicate;\n+\n+function makeNpmFeaturePredicate(range) {\n+ return () => Boolean(semver.satisfies(getNpmVersion(), range));\n+}\n+\n+function getNpmVersion() {\n+ const userAgent = process.env.npm_config_user_agent;\n+\n+ return (/npm\\/(\\d+\\.\\d+\\.\\d+)/.exec(userAgent) || [\"\"]).pop();\n+}\n",
"new_path": "commands/bootstrap/lib/make-npm-feature-predicate.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n+exports[`lerna bootstrap --ci: stderr 1`] = `\n+lerna info version __TEST_VERSION__\n+lerna info Bootstrapping 1 packages\n+lerna info Installing external dependencies\n+lerna info Symlinking packages and binaries\n+lerna success Bootstrapped 1 packages\n+`;\n+\n+exports[`lerna bootstrap --ci: stdout 1`] = `package-1`;\n+\nexports[`lerna bootstrap --npm-client yarn: stderr 1`] = `\nlerna info version __TEST_VERSION__\nlerna info Bootstrapping 4 packages\n",
"new_path": "integration/__snapshots__/lerna-bootstrap.test.js.snap",
"old_path": "integration/__snapshots__/lerna-bootstrap.test.js.snap"
},
{
"change_type": "MODIFY",
"diff": "const fs = require(\"fs-extra\");\nconst globby = require(\"globby\");\nconst normalizePath = require(\"normalize-path\");\n+const path = require(\"path\");\n+const cloneFixture = require(\"@lerna-test/clone-fixture\")(\n+ path.resolve(__dirname, \"../commands/bootstrap/__tests__\")\n+);\nconst cliRunner = require(\"@lerna-test/cli-runner\");\nconst initFixture = require(\"@lerna-test/init-fixture\")(__dirname);\n@@ -12,7 +16,7 @@ describe(\"lerna bootstrap\", () => {\nconst cwd = await initFixture(\"lerna-bootstrap\");\nconst lerna = cliRunner(cwd);\n- const { stderr } = await lerna(\"bootstrap\");\n+ const { stderr } = await lerna(\"bootstrap\", \"--no-ci\");\nexpect(stderr).toMatchSnapshot(\"stderr\");\n// the \"--silent\" flag is passed to `npm run`\n@@ -49,7 +53,7 @@ describe(\"lerna bootstrap\", () => {\nconst cwd = await initFixture(\"lerna-bootstrap\");\nconst lerna = cliRunner(cwd);\n- const { stderr } = await lerna(\"bootstrap\", \"--hoist\");\n+ const { stderr } = await lerna(\"bootstrap\", \"--no-ci\", \"--hoist\");\nexpect(stderr).toMatchSnapshot(\"stderr\");\n// the \"--silent\" flag is passed to `npm run`\n@@ -100,4 +104,16 @@ describe(\"lerna bootstrap\", () => {\nconst { stdout } = await lerna(\"run\", \"test\", \"--\", \"--silent\");\nexpect(stdout).toMatchSnapshot(\"stdout\");\n});\n+\n+ test(\"--ci\", async () => {\n+ const { cwd } = await cloneFixture(\"ci\");\n+ const lerna = cliRunner(cwd);\n+\n+ const { stderr } = await lerna(\"bootstrap\", \"--ci\");\n+ expect(stderr).toMatchSnapshot(\"stderr\");\n+\n+ // the \"--silent\" flag is passed to `npm run`\n+ const { stdout } = await lerna(\"run\", \"test\", \"--\", \"--silent\");\n+ expect(stdout).toMatchSnapshot(\"stdout\");\n+ });\n});\n",
"new_path": "integration/lerna-bootstrap.test.js",
"old_path": "integration/lerna-bootstrap.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -336,6 +336,44 @@ describe(\"npm-install\", () => {\n});\n});\n+ it(\"calls npm ci instead of npm install when subCommand is ci\", async () => {\n+ const pkg = new Package(\n+ {\n+ name: \"npm-install-deps\",\n+ version: \"1.0.0\",\n+ dependencies: {\n+ \"@scoped/something\": \"github:foo/bar\",\n+ \"local-dependency\": \"^1.0.0\",\n+ },\n+ devDependencies: {\n+ something: \"github:foo/foo\",\n+ \"local-dev-dependency\": \"^1.0.0\",\n+ },\n+ },\n+ path.normalize(\"/test/npm-install-deps\")\n+ );\n+ const dependencies = [\"@scoped/something@github:foo/bar\", \"something@github:foo/foo\"];\n+\n+ await npmInstall.dependencies(pkg, dependencies, {\n+ subCommand: \"ci\",\n+ });\n+\n+ expect(writePkg).lastCalledWith(pkg.manifestLocation, {\n+ name: \"npm-install-deps\",\n+ version: \"1.0.0\",\n+ dependencies: {\n+ \"@scoped/something\": \"github:foo/bar\",\n+ },\n+ devDependencies: {\n+ something: \"github:foo/foo\",\n+ },\n+ });\n+ expect(ChildProcessUtilities.exec).lastCalledWith(\"npm\", [\"ci\"], {\n+ cwd: pkg.location,\n+ stdio: \"pipe\",\n+ });\n+ });\n+\nit(\"finishes early when no dependencies exist\", async () => {\nconst pkg = new Package(\n{\n",
"new_path": "utils/npm-install/__tests__/npm-install.test.js",
"old_path": "utils/npm-install/__tests__/npm-install.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -12,10 +12,13 @@ const getExecOpts = require(\"@lerna/get-npm-exec-opts\");\nmodule.exports = npmInstall;\nmodule.exports.dependencies = npmInstallDependencies;\n-function npmInstall(pkg, { registry, npmClient, npmClientArgs, npmGlobalStyle, mutex, stdio = \"pipe\" }) {\n+function npmInstall(\n+ pkg,\n+ { registry, npmClient, npmClientArgs, npmGlobalStyle, mutex, stdio = \"pipe\", subCommand = \"install\" }\n+) {\n// build command, arguments, and options\nconst opts = getExecOpts(pkg, registry);\n- const args = [\"install\"];\n+ const args = [subCommand];\nlet cmd = npmClient || \"npm\";\nif (npmGlobalStyle) {\n",
"new_path": "utils/npm-install/npm-install.js",
"old_path": "utils/npm-install/npm-install.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
feat(bootstrap): Use `npm ci` with `--ci` option (#1360)
| 1
|
feat
|
bootstrap
|
679,913
|
09.04.2018 18:23:22
| -3,600
|
acc9c13b6c5401065c7401e41a7fe7a48ad71906
|
refactor(examples): update router demo
extract event/effect IDs & route defs to separate files to
reflect changes in create-hdom-app
|
[
{
"change_type": "MODIFY",
"diff": "@@ -8,6 +8,8 @@ import { EVENT_ROUTE_CHANGED } from \"@thi.ng/router/api\";\nimport { HTMLRouter } from \"@thi.ng/router/history\";\nimport { AppConfig, ViewSpec, AppViews, AppContext } from \"./api\";\n+import * as ev from \"./events\";\n+import * as fx from \"./effects\";\nimport { nav } from \"./components/nav\";\nimport { debugContainer } from \"./components/debug-container\";\n@@ -27,9 +29,6 @@ import { debugContainer } from \"./components/debug-container\";\n*/\nexport class App {\n- static readonly EV_ROUTE_TO = \"route-to\";\n- static readonly FX_ROUTE_TO = \"route-to\";\n-\nconfig: AppConfig;\nctx: AppContext;\nstate: Atom<any>;\n@@ -51,10 +50,10 @@ export class App {\n);\nthis.ctx.bus.addHandlers({\n[EVENT_ROUTE_CHANGED]: valueSetter(\"route\"),\n- [App.EV_ROUTE_TO]: (_, [__, route]) => ({ [App.FX_ROUTE_TO]: route })\n+ [ev.ROUTE_TO]: (_, [__, route]) => ({ [ev.ROUTE_TO]: route })\n});\nthis.ctx.bus.addEffect(\n- App.FX_ROUTE_TO,\n+ fx.ROUTE_TO,\n([id, params]) => this.router.routeTo(this.router.format(id, params))\n);\nthis.addViews({\n@@ -63,7 +62,7 @@ export class App {\n\"route.id\",\n(id) =>\n(this.config.components[id] ||\n- (() => [\"div\", `missing component for route: ${id}`]))(this.ctx, this.config.ui)\n+ (() => [\"div\", `missing component for route: ${id}`]))(this.ctx)\n]\n});\n}\n@@ -75,12 +74,13 @@ export class App {\n* @param specs\n*/\naddViews(specs: IObjectOf<ViewSpec>) {\n+ const views = this.ctx.views;\nfor (let id in specs) {\nconst spec = specs[id];\nif (isArray(spec)) {\n- this.ctx.views[id] = this.state.addView(spec[0], spec[1]);\n+ views[id] = this.state.addView(spec[0], spec[1]);\n} else {\n- this.ctx.views[id] = this.state.addView(spec);\n+ views[id] = this.state.addView(spec);\n}\n}\n}\n",
"new_path": "examples/router-basics/src/app.ts",
"old_path": "examples/router-basics/src/app.ts"
},
{
"change_type": "MODIFY",
"diff": "import { AppContext, StatusType, User } from \"../api\";\n-import { EV_LOAD_USER_LIST, EV_SET_STATUS, ROUTE_USER_PROFILE } from \"../config\";\n+import { LOAD_USER_LIST, SET_STATUS } from \"../events\";\n+import { USER_PROFILE } from \"../routes\";\nimport { routeLink } from \"./route-link\";\nimport { status } from \"./status\";\n@@ -13,8 +14,8 @@ import { status } from \"./status\";\nexport function allUsers(ctx: AppContext) {\nctx.bus.dispatch(\nctx.views.userlist.deref().length ?\n- [EV_SET_STATUS, [StatusType.SUCCESS, \"list loaded from cache\", true]] :\n- [EV_LOAD_USER_LIST]\n+ [SET_STATUS, [StatusType.SUCCESS, \"list loaded from cache\", true]] :\n+ [LOAD_USER_LIST]\n);\nreturn [\"div\", status, userList];\n}\n@@ -49,7 +50,7 @@ function user(ctx: AppContext, user: User, cached: boolean) {\n[\"img\", { ...ui.thumb, src: user.img }]],\n[\"div\", ui.body,\n[\"h1\", ui.title,\n- [routeLink, ROUTE_USER_PROFILE.id, { id: user.id }, null, user.name]],\n+ [routeLink, USER_PROFILE.id, { id: user.id }, null, user.name]],\n[\"h2\", ui.subtitle, `@${user.alias}`]],\ncached ?\n[\"div\", ui.meta, \"cached\"] :\n",
"new_path": "examples/router-basics/src/components/all-users.ts",
"old_path": "examples/router-basics/src/components/all-users.ts"
},
{
"change_type": "MODIFY",
"diff": "import { AppContext } from \"../api\";\n-import { EV_TOGGLE_DEBUG } from \"../config\";\n+import { TOGGLE_DEBUG } from \"../events\";\nimport { eventLink } from \"./event-link\";\n/**\n- * Collapsable component showing stringified app state.\n+ * Collapsible component showing stringified app state.\n*\n* @param ctx injected context object\n* @param debug\n@@ -11,7 +11,7 @@ import { eventLink } from \"./event-link\";\n*/\nexport function debugContainer(ctx: AppContext, debug: any, json: string) {\nreturn [\"div#debug\", ctx.ui.column.debug[debug],\n- [eventLink, [EV_TOGGLE_DEBUG], ctx.ui.debugToggle,\n+ [eventLink, [TOGGLE_DEBUG], ctx.ui.debugToggle,\ndebug ? \"close \\u25bc\" : \"open \\u25b2\"],\n[\"pre\", ctx.ui.code, json]\n];\n",
"new_path": "examples/router-basics/src/components/debug-container.ts",
"old_path": "examples/router-basics/src/components/debug-container.ts"
},
{
"change_type": "MODIFY",
"diff": "import { AppContext } from \"../api\";\n-import { ROUTE_USER_LIST, ROUTE_HOME, ROUTE_CONTACT } from \"../config\";\n+import { USER_LIST, HOME, CONTACT } from \"../routes\";\nimport { routeLink } from \"./route-link\";\n@@ -13,9 +13,9 @@ export function nav(ctx: AppContext) {\nreturn [\"nav\",\n[\"h1\", ui.title, \"Demo app\"],\n[\"div\", ui.inner,\n- [routeLink, ROUTE_HOME.id, null, ui.link, \"Home\"],\n- [routeLink, ROUTE_USER_LIST.id, null, ui.link, \"Users\"],\n- [routeLink, ROUTE_CONTACT.id, null, ui.linkLast, \"Contact\"],\n+ [routeLink, HOME.id, null, ui.link, \"Home\"],\n+ [routeLink, USER_LIST.id, null, ui.link, \"Users\"],\n+ [routeLink, CONTACT.id, null, ui.linkLast, \"Contact\"],\n]\n];\n}\n",
"new_path": "examples/router-basics/src/components/nav.ts",
"old_path": "examples/router-basics/src/components/nav.ts"
},
{
"change_type": "MODIFY",
"diff": "-import { App } from \"../app\";\nimport { AppContext } from \"../api\";\n+import { ROUTE_TO } from \"../events\";\n/**\n* Customizable hyperlink component emitting EV_ROUTE_TO event when clicked.\n@@ -16,7 +16,7 @@ export function routeLink(ctx: AppContext, routeID: PropertyKey, routeParams: an\n...attribs,\nonclick: (e) => {\ne.preventDefault();\n- ctx.bus.dispatch([App.EV_ROUTE_TO, [routeID, routeParams]]);\n+ ctx.bus.dispatch([ROUTE_TO, [routeID, routeParams]]);\n}\n},\nbody];\n",
"new_path": "examples/router-basics/src/components/route-link.ts",
"old_path": "examples/router-basics/src/components/route-link.ts"
},
{
"change_type": "MODIFY",
"diff": "import { StatusType, AppContext } from \"../api\";\n-import { EV_LOAD_USER, EV_SET_STATUS } from \"../config\";\n+import { LOAD_USER, SET_STATUS } from \"../events\";\nimport { status } from \"./status\";\n@@ -13,8 +13,8 @@ export function userProfile(ctx: AppContext) {\nconst id = ctx.views.route.deref().params.id;\nctx.bus.dispatch(\nctx.views.users.deref()[id] ?\n- [EV_SET_STATUS, [StatusType.SUCCESS, \"loaded from cache\", true]] :\n- [EV_LOAD_USER, id]);\n+ [SET_STATUS, [StatusType.SUCCESS, \"loaded from cache\", true]] :\n+ [LOAD_USER, id]);\nreturn [\"div\", [status], [userCard, id]];\n}\n",
"new_path": "examples/router-basics/src/components/user-profile.ts",
"old_path": "examples/router-basics/src/components/user-profile.ts"
},
{
"change_type": "MODIFY",
"diff": "import { Event, FX_DISPATCH_ASYNC, FX_DISPATCH_NOW, EV_SET_VALUE, FX_DELAY } from \"@thi.ng/interceptors/api\";\n-import { valueSetter, valueUpdater, trace } from \"@thi.ng/interceptors/interceptors\";\n-import { Route, RouteMatch, EVENT_ROUTE_CHANGED } from \"@thi.ng/router/api\";\n+import { valueUpdater, trace } from \"@thi.ng/interceptors/interceptors\";\nimport { AppConfig, StatusType } from \"./api\";\n+import * as ev from \"./events\";\n+import * as fx from \"./effects\";\n+import * as routes from \"./routes\";\nimport { home } from \"./components/home\";\nimport { allUsers } from \"./components/all-users\";\nimport { userProfile } from \"./components/user-profile\";\nimport { contact } from \"./components/contact\";\n-import { App } from \"./app\";\n-\n-// route definitions:\n-// routes are 1st class objects and used directly throughout the app\n-// without ever referring to their specific string representation\n-\n-// the `match` arrays specify the individual route elements\n-// docs here:\n-// https://github.com/thi-ng/umbrella/blob/master/packages/router/\n-// https://github.com/thi-ng/umbrella/blob/master/packages/router/src/api.ts#L31\n-\n-export const ROUTE_HOME: Route = {\n- id: \"home\",\n- match: [\"home\"]\n-};\n-\n-export const ROUTE_CONTACT: Route = {\n- id: \"contact\",\n- match: [\"contact\"]\n-};\n-\n-export const ROUTE_USER_LIST: Route = {\n- id: \"user-list\",\n- match: [\"users\"],\n-};\n-\n-// this is a parametric route w/ parameter coercion & validation\n-// if coercion or validation fails, the route will not be matched\n-// if no other route matches, the configured default route will\n-// be used (see full router config further below)\n-\n-export const ROUTE_USER_PROFILE: Route = {\n- id: \"user-profile\",\n- match: [\"users\", \"?id\"],\n- validate: {\n- id: {\n- coerce: (x) => parseInt(x),\n- check: (x) => x > 0 && x < 100\n- }\n- }\n-};\n-\n-// best practice tip: define event & effect names as consts or enums and\n-// avoid hardcoded strings for more safety and easier refactoring\n-\n-export const EV_DONE = \"done\";\n-export const EV_ERROR = \"error\";\n-export const EV_LOAD_USER = \"load-user\";\n-export const EV_LOAD_USER_ERROR = \"load-user-error\"\n-export const EV_LOAD_USER_LIST = \"load-users\";\n-export const EV_RECEIVE_USER = \"receive-user\";\n-export const EV_RECEIVE_USERS = \"receive-users\";\n-export const EV_SET_STATUS = \"set-status\";\n-export const EV_TOGGLE_DEBUG = \"toggle-debug\";\n-\n-// side effect IDs (these don't / shouldn't need to be exported. other\n-// parts of the app should only use events)\n-\n-const FX_JSON = \"load-json\";\n// main App configuration\nexport const CONFIG: AppConfig = {\n@@ -77,14 +20,14 @@ export const CONFIG: AppConfig = {\n// use URI hash for routes (KISS)\nuseFragment: true,\n// route ID if no other matches (MUST be non-parametric!)\n- defaultRouteID: ROUTE_HOME.id,\n+ defaultRouteID: routes.HOME.id,\n// IMPORTANT: rules with common prefixes MUST be specified in\n// order of highest precision / longest path\nroutes: [\n- ROUTE_HOME,\n- ROUTE_CONTACT,\n- ROUTE_USER_PROFILE,\n- ROUTE_USER_LIST,\n+ routes.HOME,\n+ routes.CONTACT,\n+ routes.USER_PROFILE,\n+ routes.USER_LIST,\n]\n},\n@@ -101,77 +44,74 @@ export const CONFIG: AppConfig = {\nevents: {\n// sets status to \"done\"\n- [EV_DONE]: () => ({\n- [FX_DISPATCH_NOW]: [EV_SET_STATUS, [StatusType.DONE, \"done\"]]\n+ [ev.DONE]: () => ({\n+ [FX_DISPATCH_NOW]: [ev.SET_STATUS, [StatusType.DONE, \"done\"]]\n}),\n// sets status to thrown error's message\n- [EV_ERROR]: (_, [__, err]) => ({\n- [FX_DISPATCH_NOW]: [EV_SET_STATUS, [StatusType.ERROR, err.message]],\n+ [ev.ERROR]: (_, [__, err]) => ({\n+ [FX_DISPATCH_NOW]: [ev.SET_STATUS, [StatusType.ERROR, err.message]],\n}),\n// triggers loading of JSON for single user, sets status\n- [EV_LOAD_USER]: (_, [__, id]) => ({\n- [FX_DISPATCH_NOW]: [EV_SET_STATUS, [StatusType.INFO, `loading user data...`]],\n- [FX_DISPATCH_ASYNC]: [FX_JSON, `assets/user-${id}.json`, EV_RECEIVE_USER, EV_LOAD_USER_ERROR]\n+ [ev.LOAD_USER]: (_, [__, id]) => ({\n+ [FX_DISPATCH_NOW]: [ev.SET_STATUS, [StatusType.INFO, `loading user data...`]],\n+ [FX_DISPATCH_ASYNC]: [fx.JSON, `assets/user-${id}.json`, ev.RECEIVE_USER, ev.LOAD_USER_ERROR]\n}),\n// triggered after successful IO\n// stores received user data under `users.{id}`, sets status\n// note: we assign multiple value/events as array to the FX_DISPATCH_NOW side effect\n- [EV_RECEIVE_USER]: (_, [__, json]) => ({\n+ [ev.RECEIVE_USER]: (_, [__, json]) => ({\n[FX_DISPATCH_NOW]: [\n<Event>[EV_SET_VALUE, [[\"users\", json.id], json]],\n- <Event>[EV_SET_STATUS, [StatusType.SUCCESS, \"JSON succesfully loaded\", true]]\n+ <Event>[ev.SET_STATUS, [StatusType.SUCCESS, \"JSON successfully loaded\", true]]\n],\n}),\n// error event for user profile IO requests (i.e. in this demo for user ID 3)\n// set status, then redirects to /users after 1sec\n- [EV_LOAD_USER_ERROR]: (_, [__, err]) => ({\n- [FX_DISPATCH_NOW]: [EV_SET_STATUS, [StatusType.ERROR, err.message]],\n- [FX_DISPATCH_ASYNC]: [FX_DELAY, [1000, [ROUTE_USER_LIST.id]], App.EV_ROUTE_TO, EV_ERROR],\n+ [ev.LOAD_USER_ERROR]: (_, [__, err]) => ({\n+ [FX_DISPATCH_NOW]: [ev.SET_STATUS, [StatusType.ERROR, err.message]],\n+ [FX_DISPATCH_ASYNC]: [FX_DELAY, [1000, [routes.USER_LIST.id]], ev.ROUTE_TO, ev.ERROR],\n}),\n// triggers loading of JSON summary of all users, sets status\n- [EV_LOAD_USER_LIST]: () => ({\n- [FX_DISPATCH_NOW]: [EV_SET_STATUS, [StatusType.INFO, `loading user data...`]],\n- [FX_DISPATCH_ASYNC]: [FX_JSON, `assets/users.json`, EV_RECEIVE_USERS, EV_ERROR]\n+ [ev.LOAD_USER_LIST]: () => ({\n+ [FX_DISPATCH_NOW]: [ev.SET_STATUS, [StatusType.INFO, `loading user data...`]],\n+ [FX_DISPATCH_ASYNC]: [fx.JSON, `assets/users.json`, ev.RECEIVE_USERS, ev.ERROR]\n}),\n// triggered after successful IO\n// note: we assign multiple value/events as array to the FX_DISPATCH_NOW side effect\n- [EV_RECEIVE_USERS]: (_, [__, json]) => ({\n+ [ev.RECEIVE_USERS]: (_, [__, json]) => ({\n[FX_DISPATCH_NOW]: [\n<Event>[EV_SET_VALUE, [\"userlist\", json]],\n- <Event>[EV_SET_STATUS, [StatusType.SUCCESS, \"JSON succesfully loaded\", true]]\n+ <Event>[ev.SET_STATUS, [StatusType.SUCCESS, \"JSON successfully loaded\", true]]\n],\n}),\n- // stores current route details\n- [EVENT_ROUTE_CHANGED]: valueSetter<RouteMatch>(\"route\"),\n-\n// stores status (a tuple of `[type, message, done?]`) in app state\n// if status type != DONE & `done` == true, also triggers delayed EV_DONE\n// Note: we inject the `trace` interceptor to log the event to the console\n- [EV_SET_STATUS]: [\n+ [ev.SET_STATUS]: [\ntrace,\n(_, [__, status]) => ({\n[FX_DISPATCH_NOW]: [EV_SET_VALUE, [\"status\", status]],\n[FX_DISPATCH_ASYNC]: (status[0] !== StatusType.DONE && status[2]) ?\n- [FX_DELAY, [1000], EV_DONE, EV_ERROR] :\n+ [FX_DELAY, [1000], ev.DONE, ev.ERROR] :\nundefined\n})\n],\n// toggles debug state flag on/off\n- [EV_TOGGLE_DEBUG]: valueUpdater<number>(\"debug\", (x) => x ^ 1)\n+ [ev.TOGGLE_DEBUG]: valueUpdater<number>(\"debug\", (x) => x ^ 1)\n},\n// side effects\neffects: {\n// generic JSON loader via fetch()\n- [FX_JSON]: (req) =>\n+ [fx.JSON]: (req) =>\nfetch(req).then((resp) => {\nif (!resp.ok) {\nthrow new Error(resp.statusText);\n@@ -184,10 +124,10 @@ export const CONFIG: AppConfig = {\n// those functions are called automatically by the app's root component\n// base on the currently active route\ncomponents: {\n- [ROUTE_HOME.id]: home,\n- [ROUTE_CONTACT.id]: contact,\n- [ROUTE_USER_LIST.id]: allUsers,\n- [ROUTE_USER_PROFILE.id]: userProfile,\n+ [routes.HOME.id]: home,\n+ [routes.CONTACT.id]: contact,\n+ [routes.USER_LIST.id]: allUsers,\n+ [routes.USER_PROFILE.id]: userProfile,\n},\n// DOM root element (or ID)\n",
"new_path": "examples/router-basics/src/config.ts",
"old_path": "examples/router-basics/src/config.ts"
},
{
"change_type": "ADD",
"diff": "+// best practice tip: define event & effect names as consts or enums\n+// and avoid hardcoded strings for more safety and easier refactoring\n+// also see pre-defined event handlers & interceptors in @thi.ng/atom:\n+// https://github.com/thi-ng/umbrella/blob/master/packages/interceptors/src/api.ts#L14\n+\n+export const JSON = \"load-json\";\n+export const ROUTE_TO = \"route-to\";\n\\ No newline at end of file\n",
"new_path": "examples/router-basics/src/effects.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+// best practice tip: define event & effect names as consts or enums and\n+// avoid hardcoded strings for more safety and easier refactoring\n+\n+export const DONE = \"done\";\n+export const ERROR = \"error\";\n+export const LOAD_USER = \"load-user\";\n+export const LOAD_USER_ERROR = \"load-user-error\"\n+export const LOAD_USER_LIST = \"load-users\";\n+export const RECEIVE_USER = \"receive-user\";\n+export const RECEIVE_USERS = \"receive-users\";\n+export const ROUTE_TO = \"route-to\";\n+export const SET_STATUS = \"set-status\";\n+export const TOGGLE_DEBUG = \"toggle-debug\";\n",
"new_path": "examples/router-basics/src/events.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { Route } from \"@thi.ng/router/api\";\n+\n+// route definitions:\n+// routes are 1st class objects and used directly throughout the app\n+// without ever referring to their specific string representation\n+\n+// the `match` arrays specify the individual route elements\n+// docs here:\n+// https://github.com/thi-ng/umbrella/blob/master/packages/router/\n+// https://github.com/thi-ng/umbrella/blob/master/packages/router/src/api.ts#L31\n+\n+export const HOME: Route = {\n+ id: \"home\",\n+ match: [\"home\"]\n+};\n+\n+export const CONTACT: Route = {\n+ id: \"contact\",\n+ match: [\"contact\"]\n+};\n+\n+export const USER_LIST: Route = {\n+ id: \"user-list\",\n+ match: [\"users\"],\n+};\n+\n+// this is a parametric route w/ parameter coercion & validation\n+// if coercion or validation fails, the route will not be matched\n+// if no other route matches, the configured default route will\n+// be used (see full router config further below)\n+\n+export const USER_PROFILE: Route = {\n+ id: \"user-profile\",\n+ match: [\"users\", \"?id\"],\n+ validate: {\n+ id: {\n+ coerce: (x) => parseInt(x),\n+ check: (x) => x > 0 && x < 100\n+ }\n+ }\n+};\n",
"new_path": "examples/router-basics/src/routes.ts",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(examples): update router demo
- extract event/effect IDs & route defs to separate files to
reflect changes in create-hdom-app
| 1
|
refactor
|
examples
|
679,913
|
09.04.2018 18:27:10
| -3,600
|
b9d9a49346249a3f4bec6aac229a8b0d3b87e511
|
fix(hiccup-svg): path(), update add null check for points()
|
[
{
"change_type": "MODIFY",
"diff": "@@ -6,7 +6,7 @@ const ff = (x: number) => x.toFixed(PRECISION);\nconst point = (p: ArrayLike<number>) => ff(p[0]) + \",\" + ff(p[1]);\n-const points = (pts: ArrayLike<number>[], sep = \" \") => pts.map(point).join(sep);\n+const points = (pts: ArrayLike<number>[], sep = \" \") => pts ? pts.map(point).join(sep) : \"\";\nexport {\nff,\n",
"new_path": "packages/hiccup-svg/src/format.ts",
"old_path": "packages/hiccup-svg/src/format.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -6,6 +6,6 @@ export const path = (segments: PathSegment[], attr?) =>\n\"path\",\n{\n...attr,\n- d: segments.map((seg) => seg[0] + points(seg[1], \",\")),\n+ d: segments.map((seg) => seg[0] + points(seg[1], \",\")).join(\"\"),\n}\n];\n",
"new_path": "packages/hiccup-svg/src/path.ts",
"old_path": "packages/hiccup-svg/src/path.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
fix(hiccup-svg): path(), update add null check for points()
| 1
|
fix
|
hiccup-svg
|
217,922
|
09.04.2018 19:26:42
| -7,200
|
fcd9805323121f5d77515258ff2f6696f7a2fb22
|
chore: reverting mass rename error due to Webstorm
|
[
{
"change_type": "MODIFY",
"diff": "@@ -185,7 +185,7 @@ export class AlarmService {\n}\n/**\n- * Return the item_amount of minutes before the next alarm of the item.\n+ * Return the amount of minutes before the next alarm of the item.\n* @param {ListRow} item\n* @returns {Observable<number>}\n*/\n@@ -350,7 +350,7 @@ export class AlarmService {\n}\n/**\n- * Returns the item_amount of minutes before a given alarm.\n+ * Returns the amount of minutes before a given alarm.\n* @param {number} currentTime\n* @param hours\n* @param minutes\n",
"new_path": "src/app/core/time/alarm.service.ts",
"old_path": "src/app/core/time/alarm.service.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -25,7 +25,7 @@ export class EorzeanTimeService {\n}\n/**\n- * Converts an eorzean minutes item_amount to an earth seconds item_amount.\n+ * Converts an eorzean minutes amount to an earth seconds amount.\n* @returns {Date}\n* @param minutes\n*/\n",
"new_path": "src/app/core/time/eorzean-time.service.ts",
"old_path": "src/app/core/time/eorzean-time.service.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -178,19 +178,19 @@ export class List extends DataModel {\n}\n/**\n- * Cleans the list, checking amounts and removing useless rows (with item_amount <= 0).\n+ * Cleans the list, checking amounts and removing useless rows (with amount <= 0).\n* @returns {List}\n*/\npublic clean(): List {\nfor (const prop of Object.keys(this)) {\nif (['recipes', 'preCrafts', 'gathers', 'others', 'crystals'].indexOf(prop) > -1) {\n- // We don't want to check the item_amount of items required for recipes, as they can't be wrong (provided by the user only).\n+ // We don't want to check the amount of items required for recipes, as they can't be wrong (provided by the user only).\nif (prop !== 'recipes') {\nthis[prop].forEach(row => {\nif (prop !== 'preCrafts') {\n- row.item_amount = row.amount_needed = this.totalAmountRequired(<ListRow>row);\n+ row.amount = row.amount_needed = this.totalAmountRequired(<ListRow>row);\n} else {\n- row.item_amount = this.totalAmountRequired(<ListRow>row);\n+ row.amount = this.totalAmountRequired(<ListRow>row);\nrow.amount_needed = Math.ceil(row.amount / row.yield);\n}\n});\n@@ -202,7 +202,7 @@ export class List extends DataModel {\n}\n/**\n- * Gets the total item_amount needed for a given item based on requirements of the crafts in the list.\n+ * Gets the total amount needed for a given item based on requirements of the crafts in the list.\n* @param {ListRow} item\n* @returns {number}\n*/\n@@ -328,7 +328,7 @@ export class List extends DataModel {\nif (requirementItem.requires === undefined) {\nnextAmount = MathTools.absoluteCeil(nextAmount / requirementItem.yield);\n}\n- // If the item_amount of items we did in this iteration hasn't changed, no need to mark requirements as used,\n+ // If the amount of items we did in this iteration hasn't changed, no need to mark requirements as used,\n// as we didn't use more.\nthis.setDone(requirementItem, nextAmount, true, previousDone !== item.done);\n}\n",
"new_path": "src/app/model/list/list.ts",
"old_path": "src/app/model/list/list.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -254,7 +254,7 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\nhasBook = true;\n/**\n- * Expansion is the state of the \"add item_amount\" input field (shown or not).\n+ * Expansion is the state of the \"add amount\" input field (shown or not).\n*/\nexpanded = false;\n@@ -369,7 +369,7 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\n}\n/**\n- * Adds addition value to current done item_amount.\n+ * Adds addition value to current done amount.\n*/\npublic addAddition() {\nthis.setDone(this.item, this.item.done + this.addition, this.item.done);\n@@ -378,7 +378,7 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\n}\n/**\n- * Removes addition value to current done item_amount.\n+ * Removes addition value to current done amount.\n*/\npublic removeAddition() {\nthis.setDone(this.item, this.item.done - this.addition, this.item.done);\n@@ -399,7 +399,7 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\n}\nupdateCanBeCrafted(): void {\n- // this.item.done < this.item.item_amount check is made to avoid item being cmarked as craftable while you already crafted it.\n+ // this.item.done < this.item.amount check is made to avoid item being cmarked as craftable while you already crafted it.\nthis.canBeCrafted = this.list.canBeCrafted(this.item) && this.item.done < this.item.amount;\n}\n",
"new_path": "src/app/modules/item/item/item.component.ts",
"old_path": "src/app/modules/item/item/item.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -40,7 +40,7 @@ describe('PricingService', () => {\nexpect(service.getPrice(row).hq).toBe(0);\n}));\n- it('should be able to store item_amount', inject([PricingService], (service: PricingService) => {\n+ it('should be able to store amount', inject([PricingService], (service: PricingService) => {\nconst row = new ListRow();\nrow.id = 546898;\nservice.saveAmount('foo', row, {nq: 123, hq: 456});\n@@ -48,7 +48,7 @@ describe('PricingService', () => {\nexpect(service.getAmount('foo', row).hq).toBe(456);\n}));\n- it('should be able to return default item_amount', inject([PricingService], (service: PricingService) => {\n+ it('should be able to return default amount', inject([PricingService], (service: PricingService) => {\nconst row = new ListRow();\nrow.id = 546898;\nrow.amount = 123456;\n",
"new_path": "src/app/modules/pricing/pricing.service.spec.ts",
"old_path": "src/app/modules/pricing/pricing.service.spec.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -76,7 +76,7 @@ export class PricingService {\n}\n/**\n- * Saves a given item_amount to the storage system\n+ * Saves a given amount to the storage system\n* @param listUid\n* @param {ListRow} item\n* @param {Price} amount\n@@ -112,8 +112,8 @@ export class PricingService {\n}\n/**\n- * Gets the item_amount of nq and hq items used for a given list, if nothing is found in localStorage, returns a default object\n- * with item.item_amount as nq item_amount and 0 as hq item_amount.\n+ * Gets the amount of nq and hq items used for a given list, if nothing is found in localStorage, returns a default object\n+ * with item.amount as nq amount and 0 as hq amount.\n*\n* @param listUid\n* @param {ListRow} item\n",
"new_path": "src/app/modules/pricing/pricing.service.ts",
"old_path": "src/app/modules/pricing/pricing.service.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -46,7 +46,7 @@ export class PricingComponent {\nlet total = 0;\n// For each row of the list\nrows.forEach(row => {\n- // Get the item_amount of items required.\n+ // Get the amount of items required.\nconst amount = this.pricingService.getAmount(this.list.$key, row);\n// Get the price of the item.\nconst price = this.pricingService.getPrice(row);\n",
"new_path": "src/app/modules/pricing/pricing/pricing.component.ts",
"old_path": "src/app/modules/pricing/pricing/pricing.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -207,7 +207,7 @@ export class RecipesComponent extends PageComponent implements OnInit {\n* @param {Recipe} recipe The recipe we want to add\n* @param {List} list The list we want to add the recipe to\n* @param {string} key The database key of the list\n- * @param {string} amount The item_amount of items we want to add, this is handled as a string because a string is expected from the template\n+ * @param {string} amount The amount of items we want to add, this is handled as a string because a string is expected from the template\n* @param collectible\n*/\naddRecipe(recipe: Recipe, list: List, key: string, amount: string, collectible: boolean): void {\n",
"new_path": "src/app/pages/recipes/recipes/recipes.component.ts",
"old_path": "src/app/pages/recipes/recipes/recipes.component.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore: reverting mass rename error due to Webstorm
| 1
|
chore
| null |
217,922
|
09.04.2018 19:39:22
| -7,200
|
1cb8f6a683c5e75db82d8eecaad217030547fc2c
|
fix: help dialog is no longer opened at first page visit
|
[
{
"change_type": "MODIFY",
"diff": "@@ -29,15 +29,6 @@ export abstract class PageComponent extends ComponentWithSubscriptions implement\n* On Init, check if dialog has already been opened, if not, open it and add informations to the localstorage that it has been opened.\n*/\npublic ngOnInit(): void {\n- // setTimeout is here as a hotfix to an error happening if we create the dialog right on change detection timing\n- // (https://github.com/angular/angular/issues/15634)\n- setTimeout(() => {\nthis.helpService.currentHelp = this.getHelpDialog();\n- if (localStorage.getItem(`${this.constructor.name}:help`) !== 'true') {\n- this.dialog.open(this.getHelpDialog()).afterClosed().subscribe(() => {\n- localStorage.setItem(`${this.constructor.name}:help`, 'true');\n- });\n- }\n- }, 100);\n}\n}\n",
"new_path": "src/app/core/component/page-component.ts",
"old_path": "src/app/core/component/page-component.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
fix: help dialog is no longer opened at first page visit
| 1
|
fix
| null |
217,922
|
09.04.2018 20:01:58
| -7,200
|
2e71b70ac3e5feda01b974f8969697152c4df479
|
fix: You can now edit patreon email in your profile page
closes
|
[
{
"change_type": "MODIFY",
"diff": "@@ -14,12 +14,13 @@ export class PatreonLinkPopupComponent {\npatreonEmail: string;\n- email: FormControl = new FormControl('', [Validators.required, Validators.email]);\n+ email: FormControl;\nalreadyUsed = false;\nconstructor(private userService: UserService, private dialogRef: MatDialogRef<PatreonLinkPopupComponent>,\n@Inject(MAT_DIALOG_DATA) private user: AppUser) {\n+ this.email = new FormControl(user.patreonEmail, [Validators.required, Validators.email]);\n}\nsubmit(): void {\n",
"new_path": "src/app/pages/profile/patreon-link-popup/patreon-link-popup.component.ts",
"old_path": "src/app/pages/profile/patreon-link-popup/patreon-link-popup.component.ts"
},
{
"change_type": "MODIFY",
"diff": "character.patreonEmail === undefined\">\n{{\"PROFILE.Patreon_link_email\" | translate}}\n</button>\n+ <button mat-button color=\"accent\" class=\"patreon-badge patreon-button\"\n+ (click)=\"openPatreonLinkPopup()\" *ngIf=\"!character.patreon &&\n+ character.patreonEmail !== undefined\">\n+ {{\"PROFILE.Patreon_edit_email\" | translate}}\n+ </button>\n</mat-card-header>\n<mat-grid-list cols=\"{{getClassesCols()}}\" rowHeight=\"100px\">\n<mat-grid-tile *ngFor=\"let job of getJobs()\">\n",
"new_path": "src/app/pages/profile/profile/profile.component.html",
"old_path": "src/app/pages/profile/profile/profile.component.html"
},
{
"change_type": "MODIFY",
"diff": "\"Nickname\": \"Nickname\",\n\"No_nickname\": \"No nickname set\",\n\"Patreon_link_email\": \"Link patreon email\",\n+ \"Patreon_edit_email\": \"Edit patreon email\",\n\"Email_already_used\": \"Email already linked to another account\",\n\"Patreon_email\": \"Patreon Email\",\n\"HELP\": {\n",
"new_path": "src/assets/i18n/en.json",
"old_path": "src/assets/i18n/en.json"
},
{
"change_type": "MODIFY",
"diff": "\"Feature_requires_nickname\": \"This feature requires you to set a nickname\",\n\"Nickname\": \"Nickname\",\n\"No_nickname\": \"No nickname set\",\n- \"Patreon_link_email\": \"Link patreon email\",\n+ \"Patreon_link_email\": \"Link patreon email\",,\n+ \"Patreon_edit_email\": \"Edit patreon email\",\n\"Email_already_used\": \"Email already linked to another account\",\n\"Patreon_email\": \"Patreon Email\",\n\"HELP\": {\n",
"new_path": "src/assets/i18n/ja.json",
"old_path": "src/assets/i18n/ja.json"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
fix: You can now edit patreon email in your profile page
closes #291
| 1
|
fix
| null |
679,913
|
09.04.2018 22:33:06
| -3,600
|
2a91e302fddb57d676243b5aa7be99233cea96d6
|
perf(hdom): intern imported checks, update normalizeTree(), add docs, fix tests
avoid `path` copies in normalizeTree()
fix `render` life cycle return val handling
(must be array for init/release to be called)
|
[
{
"change_type": "MODIFY",
"diff": "-import { isArray } from \"@thi.ng/checks/is-array\";\n-import { isString } from \"@thi.ng/checks/is-string\";\n+import * as isa from \"@thi.ng/checks/is-array\";\n+import * as iss from \"@thi.ng/checks/is-string\";\nimport * as diff from \"@thi.ng/diff\";\n// import { DEBUG } from \"./api\";\nimport { createDOM, removeAttribs, setAttrib, removeChild } from \"./dom\";\n+const isArray = isa.isArray;\n+const isString = iss.isString;\nconst diffArray = diff.diffArray;\nconst diffObject = diff.diffObject;\n",
"new_path": "packages/hdom/src/diff.ts",
"old_path": "packages/hdom/src/diff.ts"
},
{
"change_type": "MODIFY",
"diff": "-import { isArray } from \"@thi.ng/checks/is-array\";\n-import { isFunction } from \"@thi.ng/checks/is-function\";\n-import { isIterable } from \"@thi.ng/checks/is-iterable\";\n-import { isString } from \"@thi.ng/checks/is-string\";\n+import * as isa from \"@thi.ng/checks/is-array\";\n+import * as isf from \"@thi.ng/checks/is-function\";\n+import * as isi from \"@thi.ng/checks/is-iterable\";\n+import * as iss from \"@thi.ng/checks/is-string\";\nimport { SVG_TAGS, SVG_NS } from \"@thi.ng/hiccup/api\";\nimport { css } from \"@thi.ng/hiccup/css\";\nimport { map } from \"@thi.ng/iterators/map\";\n+const isArray = isa.isArray;\n+const isFunction = isf.isFunction;\n+const isIterable = isi.isIterable\n+const isString = iss.isString;\n+\n/**\n* Creates an actual DOM tree from given hiccup component and `parent`\n* element. Calls `init` with created element (user provided context and\n",
"new_path": "packages/hdom/src/dom.ts",
"old_path": "packages/hdom/src/dom.ts"
},
{
"change_type": "MODIFY",
"diff": "import { illegalArgs } from \"@thi.ng/api/error\";\n-import { isArray } from \"@thi.ng/checks/is-array\";\n-import { implementsFunction } from \"@thi.ng/checks/implements-function\";\n-import { isFunction } from \"@thi.ng/checks/is-function\";\n-import { isIterable } from \"@thi.ng/checks/is-iterable\";\n-import { isPlainObject } from \"@thi.ng/checks/is-plain-object\";\n-import { isString } from \"@thi.ng/checks/is-string\";\n+import * as isa from \"@thi.ng/checks/is-array\";\n+import * as impf from \"@thi.ng/checks/implements-function\";\n+import * as isf from \"@thi.ng/checks/is-function\";\n+import * as isi from \"@thi.ng/checks/is-iterable\";\n+import * as iso from \"@thi.ng/checks/is-plain-object\";\n+import * as iss from \"@thi.ng/checks/is-string\";\nimport { TAG_REGEXP } from \"@thi.ng/hiccup/api\";\n+const isArray = isa.isArray;\n+const isFunction = isf.isFunction;\n+const implementsFunction = impf.implementsFunction;\n+const isIterable = isi.isIterable\n+const isPlainObject = iso.isPlainObject;\n+const isString = iss.isString;\n+\n/**\n* Expands single hiccup element/component into its canonical form:\n*\n@@ -36,7 +43,7 @@ export function normalizeElement(spec: any[], keys: boolean) {\nif (!isString(tag) || !(match = TAG_REGEXP.exec(tag))) {\nillegalArgs(`${tag} is not a valid tag name`);\n}\n- // return orig if already normalized and satifies key requirement\n+ // return orig if already normalized and satisfies key requirement\nif (tag === match[1] && hasAttribs && (!keys || spec[1].key)) {\nreturn spec;\n}\n@@ -86,6 +93,13 @@ const NO_SPANS = {\n* or will need to be replaced/removed. The `key` values are defined by\n* the `path` array arg.\n*\n+ * In terms of life cycle methods: `render` should ALWAYS return an\n+ * array or another function, else the component's `init` or `release`\n+ * fns will NOT be able to be called. E.g. If the return value of\n+ * `render` evaluates as a string or number, the return value should be\n+ * wrapped as `[\"span\", \"foo\"]`. If no `init` or `release` are used,\n+ * this requirement is relaxed.\n+ *\n* For normal usage only the first 2 args should be specified and the\n* rest kept at their defaults.\n*\n@@ -110,21 +124,17 @@ export function normalizeTree(tree: any, ctx?: any, path = [0], keys = true, spa\n// use result of function call\n// pass ctx as first arg and remaining array elements as rest args\nif (isFunction(tag)) {\n- return normalizeTree(tag.apply(null, [ctx, ...tree.slice(1)]), ctx, path.slice(), keys, span);\n+ return normalizeTree(tag.apply(null, [ctx, ...tree.slice(1)]), ctx, path, keys, span);\n}\n// component object w/ life cycle methods\n// (render() is the only required hook)\nif (implementsFunction(tag, \"render\")) {\nconst args = [ctx, ...tree.slice(1)];\n- norm = normalizeTree(tag.render.apply(null, args), ctx, path.slice(), keys, span);\n- if (norm !== undefined) {\n- nattribs = norm[1];\n- if (keys && nattribs.key === undefined) {\n- nattribs.key = path.join(\"-\");\n- }\n- norm.__init = tag.init;\n- norm.__release = tag.release;\n- norm.__args = args;\n+ norm = normalizeTree(tag.render.apply(null, args), ctx, path, keys, span);\n+ if (isArray(norm)) {\n+ (<any>norm).__init = tag.init;\n+ (<any>norm).__release = tag.release;\n+ (<any>norm).__args = args;\n}\nreturn norm;\n}\n@@ -166,7 +176,7 @@ export function normalizeTree(tree: any, ctx?: any, path = [0], keys = true, spa\nreturn normalizeTree(tree(ctx), ctx, path, keys, span);\n}\nif (implementsFunction(tree, \"deref\")) {\n- return normalizeTree(tree.deref(), ctx, path.slice(), keys, span);\n+ return normalizeTree(tree.deref(), ctx, path, keys, span);\n}\nreturn span ?\n[\"span\", keys ? { key: path.join(\"-\") } : {}, tree.toString()] :\n",
"new_path": "packages/hdom/src/normalize.ts",
"old_path": "packages/hdom/src/normalize.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,8 +5,8 @@ import { map } from \"@thi.ng/iterators/map\";\nimport { range } from \"@thi.ng/iterators/range\";\nimport { normalizeTree } from \"../src/normalize\";\n-function _check(a, b) {\n- assert.deepEqual(normalizeTree(a, [], false, false), b);\n+function _check(a, b, ctx = null) {\n+ assert.deepEqual(normalizeTree(a, ctx, [], false, false), b);\n}\nfunction check(id, a, b) {\n@@ -76,7 +76,7 @@ describe(\"hdom\", () => {\ncheck(\n\"tag fn w/ args\",\n- [(id, body) => [\"div#\" + id, body], \"foo\", \"bar\"],\n+ [(_, id, body) => [\"div#\" + id, body], \"foo\", \"bar\"],\n[\"div\", { id: \"foo\" }, \"bar\"]\n);\n@@ -111,11 +111,18 @@ describe(\"hdom\", () => {\n);\nit(\"life cycle\", () => {\n- const res: any = [\"div\", {}];\n+ let res: any = [\"div\", {}];\nres.__init = res.__release = undefined;\n- res.__args = [];\n+ res.__args = [null];\nassert.deepEqual(\n- normalizeTree([{ render: () => [\"div\"] }], [], false, false),\n+ normalizeTree([{ render: () => [\"div\"] }], null, [], false, false),\n+ res\n+ );\n+ res = [\"div\", { key: \"0\" }];\n+ res.__init = res.__release = undefined;\n+ res.__args = [null];\n+ assert.deepEqual(\n+ normalizeTree([{ render: () => [\"div\"] }], null, [0], true, false),\nres\n);\n});\n",
"new_path": "packages/hdom/test/index.ts",
"old_path": "packages/hdom/test/index.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
perf(hdom): intern imported checks, update normalizeTree(), add docs, fix tests
- avoid `path` copies in normalizeTree()
- fix `render` life cycle return val handling
(must be array for init/release to be called)
| 1
|
perf
|
hdom
|
815,742
|
09.04.2018 22:49:17
| 25,200
|
30201c000c50e9ae74addd11d549c58a970a2f1a
|
feat: adding basic support for Narrators on Dropdown
closes
|
[
{
"change_type": "ADD",
"diff": "+export function newId() {\n+ // First character is an 'a', it's good practice to tag id to begin with a letter\n+ return 'axxxxxxxxxxx'.replace(/[x]/g, function (_) {\n+ // tslint:disable-next-line:no-bitwise\n+ const val = Math.random() * 16 | 0;\n+ return val.toString(16);\n+ });\n+}\n",
"new_path": "src/ng-select/id.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -2,6 +2,7 @@ import { NgOption } from './ng-select.types';\nimport * as searchHelper from './search-helper';\nimport { NgSelectComponent } from './ng-select.component';\nimport { isObject, isDefined } from './value-utils';\n+import { newId } from './id';\ntype OptionGroups = Map<string, NgOption[]>;\n@@ -213,6 +214,7 @@ export class ItemsList {\nlabel: isDefined(label) ? label.toString() : '',\nvalue: item,\ndisabled: item.disabled,\n+ htmlId: newId()\n};\n}\n@@ -281,7 +283,8 @@ export class ItemsList {\nlabel: key,\nhasChildren: true,\nindex: i,\n- disabled: !this._ngSelect.selectableGroup\n+ disabled: !this._ngSelect.selectableGroup,\n+ htmlId: newId()\n};\nparent.value = {};\nparent.value[this._ngSelect.groupBy] = key;\n",
"new_path": "src/ng-select/items-list.ts",
"old_path": "src/ng-select/items-list.ts"
},
{
"change_type": "MODIFY",
"diff": "(focus)=\"onInputFocus()\"\n(blur)=\"onInputBlur()\"\n(change)=\"$event.stopPropagation()\"\n- role=\"combobox\">\n+ role=\"combobox\"\n+ [attr.aria-expanded]=\"isOpen\"\n+ [attr.aria-owns]=\"isOpen ? dropdownId : null\"\n+ [attr.aria-activedescendant]=\"isOpen ? itemsList?.markedItem?.htmlId : null\">\n</div>\n</div>\n[items]=\"itemsList.filteredItems\"\n(update)=\"viewPortItems = $event\"\n(scrollToEnd)=\"scrollToEnd.emit($event)\"\n- [ngClass]=\"{'multiple': multiple}\">\n+ [ngClass]=\"{'multiple': multiple}\"\n+ [id]=\"dropdownId\">\n<ng-container>\n- <div class=\"ng-option\" role=\"option\" (click)=\"toggleItem(item)\" (mousedown)=\"$event.preventDefault()\" (mouseover)=\"onItemHover(item)\"\n+ <div class=\"ng-option\" [attr.role]=\"item.hasChildren ? 'group' : 'option'\" (click)=\"toggleItem(item)\" (mousedown)=\"$event.preventDefault()\" (mouseover)=\"onItemHover(item)\"\n*ngFor=\"let item of viewPortItems\"\n[class.disabled]=\"item.disabled\"\n[class.selected]=\"item.selected\"\n[class.ng-optgroup]=\"item.hasChildren\"\n[class.ng-option]=\"!item.hasChildren\"\n[class.ng-option-child]=\"!!item.parent\"\n- [class.marked]=\"item === itemsList.markedItem\">\n+ [class.marked]=\"item === itemsList.markedItem\"\n+ id=\"{{item?.htmlId || null}}\">\n<ng-template #defaultOptionTemplate>\n<span class=\"ng-option-label\" [innerHTML]=\"item.label\" [ngOptionHighlight]=\"filterValue\"></span>\n",
"new_path": "src/ng-select/ng-select.component.html",
"old_path": "src/ng-select/ng-select.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -1967,6 +1967,84 @@ describe('NgSelectComponent', function () {\n});\n});\n+ describe('aria', () => {\n+ let fixture: ComponentFixture<NgSelectTestCmp>;\n+ let select: NgSelectComponent;\n+ let input: HTMLInputElement;\n+\n+ beforeEach(fakeAsync(() => {\n+ fixture = createTestingModule(\n+ NgSelectTestCmp,\n+ `<ng-select [items]=\"cities\"\n+ (change)=\"onChange($event)\"\n+ bindLabel=\"name\">\n+ </ng-select>`);\n+ select = fixture.componentInstance.select;\n+ input = fixture.debugElement.query(By.css('input')).nativeElement;\n+ }));\n+\n+ it('should set aria-activedescendant absent at start', fakeAsync(() => {\n+ expect(input.hasAttribute('aria-activedescendant'))\n+ .toBe(false);\n+ }));\n+\n+ it('should set aria-owns absent at start', fakeAsync(() => {\n+ expect(input.hasAttribute('aria-owns'))\n+ .toBe(false);\n+ }));\n+\n+ it('should set aria-owns be set to dropdownId on open', fakeAsync(() => {\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\n+ tickAndDetectChanges(fixture);\n+\n+ expect(input.getAttribute('aria-owns'))\n+ .toBe(select.dropdownId);\n+ }));\n+\n+ it('should set aria-activedecendant equal to chosen item on open', fakeAsync(() => {\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\n+ tickAndDetectChanges(fixture);\n+ expect(input.getAttribute('aria-activedescendant'))\n+ .toBe(select.itemsList.markedItem.htmlId);\n+ }));\n+\n+ it('should set aria-activedecendant equal to chosen item on arrow down', fakeAsync(() => {\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\n+ tickAndDetectChanges(fixture);\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.ArrowDown);\n+ tickAndDetectChanges(fixture);\n+ expect(input.getAttribute('aria-activedescendant'))\n+ .toBe(select.itemsList.markedItem.htmlId);\n+ }));\n+\n+ it('should set aria-activedecendant equal to chosen item on arrow up', fakeAsync(() => {\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\n+ tickAndDetectChanges(fixture);\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.ArrowUp);\n+ tickAndDetectChanges(fixture);\n+ expect(input.getAttribute('aria-activedescendant'))\n+ .toBe(select.itemsList.markedItem.htmlId);\n+ }));\n+\n+ it('should set aria-activedescendant absent on dropdown close', fakeAsync(() => {\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\n+ tickAndDetectChanges(fixture);\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Enter);\n+ tickAndDetectChanges(fixture);\n+ expect(input.hasAttribute('aria-activedescendant'))\n+ .toBe(false);\n+ }));\n+\n+ it('should set aria-owns absent on dropdown close', fakeAsync(() => {\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\n+ tickAndDetectChanges(fixture);\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Enter);\n+ tickAndDetectChanges(fixture);\n+ expect(input.hasAttribute('aria-owns'))\n+ .toBe(false);\n+ }));\n+ });\n+\ndescribe('Output events', () => {\nit('fire open event once', fakeAsync(() => {\nconst fixture = createTestingModule(\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": "@@ -45,6 +45,7 @@ import { NgOptionComponent } from './ng-option.component';\nimport { NgDropdownPanelComponent } from './ng-dropdown-panel.component';\nimport { isDefined, isFunction, isPromise, isObject } from './value-utils';\nimport { ConsoleService } from './console.service';\n+import { newId } from './id';\nexport const NG_SELECT_DEFAULT_CONFIG = new InjectionToken<NgSelectConfig>('ng-select-default-options');\nexport type DropdownPosition = 'bottom' | 'top' | 'auto';\n@@ -153,7 +154,8 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nprivate readonly _destroy$ = new Subject<void>();\nprivate _onChange = (_: NgOption) => { };\nprivate _onTouched = () => { };\n-\n+ dropdownId = newId();\n+ selectedItemId = 0;\nclearItem = (item: any) => {\nconst option = this.selectedItems.find(x => x.value === item);\nthis.unselect(option);\n",
"new_path": "src/ng-select/ng-select.component.ts",
"old_path": "src/ng-select/ng-select.component.ts"
},
{
"change_type": "MODIFY",
"diff": "export interface NgOption {\n[name: string]: any;\nindex?: number;\n+ htmlId?: string;\nselected?: boolean;\ndisabled?: boolean;\nmarked?: boolean;\n",
"new_path": "src/ng-select/ng-select.types.ts",
"old_path": "src/ng-select/ng-select.types.ts"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
feat: adding basic support for Narrators on Dropdown (#433)
closes #216
| 1
|
feat
| null |
791,790
|
10.04.2018 00:40:15
| -7,200
|
a031e466ee323369045aa555874a61daf9c1fa52
|
cli(output): Add ability to export results to CSV
|
[
{
"change_type": "MODIFY",
"diff": "@@ -13,15 +13,17 @@ const log = require('lighthouse-logger');\n* An enumeration of acceptable output modes:\n* 'json': JSON formatted results\n* 'html': An HTML report\n+ * 'csv': CSV formatted results\n*/\nconst OutputMode = {\njson: 'json',\nhtml: 'html',\n+ csv: 'csv',\n};\n/**\n* Verify output path to use, either stdout or a file path.\n- * @param {string=} path\n+ * @param {string} path\n* @return {string}\n*/\nfunction checkOutputPath(path) {\n@@ -32,6 +34,43 @@ function checkOutputPath(path) {\nreturn path;\n}\n+/**\n+ * Converts the results to a CSV formatted string\n+ * Each row describes the result of 1 audit with\n+ * - the name of the category the audit belongs to\n+ * - the name of the audit\n+ * - a description of the audit\n+ * - the score type that is used for the audit\n+ * - the score value of the audit\n+ *\n+ * @param {LH.Results} results\n+ * @returns {string}\n+ */\n+function toCSVReport(results) {\n+ // To keep things \"official\" we follow the CSV specification (RFC4180)\n+ // The document describes how to deal with escaping commas and quotes etc.\n+ const CRLF = '\\r\\n';\n+ const separator = ',';\n+ /** @param {string} value @returns {string} */\n+ const escape = (value) => `\"${value.replace(/\"/g, '\"\"')}\"`;\n+\n+\n+ // Possible TODO: tightly couple headers and row values\n+ const header = ['category', 'name', 'title', 'type', 'score'];\n+ const table = results.reportCategories.map(category => {\n+ return category.audits.map(catAudit => {\n+ const audit = results.audits[catAudit.id];\n+ return [category.name, audit.name, audit.description, audit.scoreDisplayMode, audit.score]\n+ .map(value => value.toString())\n+ .map(escape);\n+ });\n+ });\n+\n+ // @ts-ignore TS loses track of type Array\n+ const flattedTable = [].concat(...table);\n+ return [header, ...flattedTable].map(row => row.join(separator)).join(CRLF);\n+}\n+\n/**\n* Creates the results output in a format based on the `mode`.\n* @param {!LH.Results} results\n@@ -47,6 +86,10 @@ function createOutput(results, outputMode) {\nif (outputMode === OutputMode.json) {\nreturn JSON.stringify(results, null, 2);\n}\n+ // CSV report.\n+ if (outputMode === OutputMode.csv) {\n+ return toCSVReport(results);\n+ }\nthrow new Error('Invalid output mode: ' + outputMode);\n}\n",
"new_path": "lighthouse-cli/printer.js",
"old_path": "lighthouse-cli/printer.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -10,6 +10,7 @@ const Printer = require('../../printer.js');\nconst assert = require('assert');\nconst fs = require('fs');\nconst sampleResults = require('../../../lighthouse-core/test/results/sample_v2.json');\n+const csvValidator = require('csv-validator');\ndescribe('Printer', () => {\nit('accepts valid output paths', () => {\n@@ -35,6 +36,27 @@ describe('Printer', () => {\nassert.ok(/<html lang=\"en\"/gim.test(htmlOutput));\n});\n+ it('creates CSV for results', async () => {\n+ const mode = Printer.OutputMode.csv;\n+ const path = './.results-as-csv.csv';\n+ const headers = {\n+ category: '',\n+ name: '',\n+ title: '',\n+ type: '',\n+ score: 42,\n+ };\n+ await Printer.write(sampleResults, mode, path);\n+\n+ try {\n+ await csvValidator(path, headers);\n+ } catch (err) {\n+ assert.fail('CSV parser error:\\n' + err.join('\\n'));\n+ } finally {\n+ fs.unlinkSync(path);\n+ }\n+ });\n+\nit('writes file for results', () => {\nconst mode = 'html';\nconst path = './.test-file.html';\n",
"new_path": "lighthouse-cli/test/cli/printer-test.js",
"old_path": "lighthouse-cli/test/cli/printer-test.js"
},
{
"change_type": "MODIFY",
"diff": "\"commitizen\": \"^2.9.6\",\n\"conventional-changelog-cli\": \"^1.3.4\",\n\"coveralls\": \"^2.11.9\",\n+ \"csv-validator\": \"^0.0.3\",\n\"cz-customizable\": \"^5.2.0\",\n\"eslint\": \"^4.8.0\",\n\"eslint-config-google\": \"^0.9.1\",\n",
"new_path": "package.json",
"old_path": "package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -70,9 +70,9 @@ Configuration:\n--audit-mode, -A Process saved artifacts from disk [boolean]\nOutput:\n- --output Reporter for the results, supports multiple values [choices: \"json\", \"html\"] [default: \"html\"]\n+ --output Reporter for the results, supports multiple values [choices: \"csv\", \"json\", \"html\"] [default: \"html\"]\n--output-path The file path to output the results. Use 'stdout' to write to stdout.\n- If using JSON output, default is stdout.\n+ If using JSON or CSV output, default is stdout.\nIf using HTML output, default is a file in the working directory with a name based on the test URL and date.\nIf using multiple outputs, --output-path is ignored.\nExample: --output-path=./lighthouse-results.html\n",
"new_path": "readme.md",
"old_path": "readme.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -92,6 +92,19 @@ declare global {\nartifacts?: Object;\ninitialUrl: string;\nfetchedAt: string;\n+ reportCategories: ReportCategory[];\n+ }\n+\n+ export interface ReportCategory {\n+ name: string;\n+ description: string;\n+ audits: ReportAudit[];\n+ }\n+\n+ export interface ReportAudit {\n+ id: string;\n+ weight: number;\n+ group: string;\n}\nexport interface LaunchedChrome {\n",
"new_path": "typings/externs.d.ts",
"old_path": "typings/externs.d.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -1276,6 +1276,19 @@ cssom@0.3.x, \"cssom@>= 0.3.2 < 0.4.0\":\ndependencies:\ncssom \"0.3.x\"\n+csv-validator@^0.0.3:\n+ version \"0.0.3\"\n+ resolved \"https://registry.yarnpkg.com/csv-validator/-/csv-validator-0.0.3.tgz#b2acb8f46f197af44cc0a4992e63ef7b48279a2a\"\n+ dependencies:\n+ csvtojson \"^1.1.9\"\n+\n+csvtojson@^1.1.9:\n+ version \"1.1.9\"\n+ resolved \"https://registry.yarnpkg.com/csvtojson/-/csvtojson-1.1.9.tgz#e641ae72f7bc2fa3f9aaf127e021fc89447c1cd1\"\n+ dependencies:\n+ lodash \"^4.17.3\"\n+ strip-bom \"1.0.0\"\n+\ncurrently-unhandled@^0.4.1:\nversion \"0.4.1\"\nresolved \"https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea\"\n@@ -3265,6 +3278,10 @@ lodash@^4.0.0, lodash@^4.1.0, lodash@^4.17.4, lodash@^4.2.1, lodash@^4.3.0:\nversion \"4.17.4\"\nresolved \"https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae\"\n+lodash@^4.17.3:\n+ version \"4.17.5\"\n+ resolved \"https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511\"\n+\nlodash@^4.2.0:\nversion \"4.16.4\"\nresolved \"https://registry.yarnpkg.com/lodash/-/lodash-4.16.4.tgz#01ce306b9bad1319f2a5528674f88297aeb70127\"\n@@ -4722,7 +4739,7 @@ strip-ansi@^4.0.0:\ndependencies:\nansi-regex \"^3.0.0\"\n-strip-bom@^1.0.0:\n+strip-bom@1.0.0, strip-bom@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/strip-bom/-/strip-bom-1.0.0.tgz#85b8862f3844b5a6d5ec8467a93598173a36f794\"\ndependencies:\n",
"new_path": "yarn.lock",
"old_path": "yarn.lock"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
cli(output): Add ability to export results to CSV (#4912)
Co-authored-by: Michiel van Spaendonck <mvanspaendonck@users.noreply.github.com>
Co-authored-by: Kanav Anand <anandkanav92@users.noreply.github.com>
Co-authored-by: Ernst Mulders <ernstmul@users.noreply.github.com>
Co-authored-by: Paul Irish <paulirish@users.noreply.github.com>
| 1
|
cli
|
output
|
821,196
|
10.04.2018 02:20:50
| 25,200
|
1927369bcfd62d1ade4bbda7cd8ae32d1331331f
|
fix: remove junit reporter from circle
it hides the original output
|
[
{
"change_type": "MODIFY",
"diff": "@@ -20,7 +20,7 @@ jobs:\nname: Install dependencies\ncommand: |\n.circleci/greenkeeper\n- yarn add -D nyc@11 @oclif/nyc-config@1 mocha-junit-reporter@1\n+ yarn add -D nyc@11 @oclif/nyc-config@1\n<%_ if (['single', 'multi'].includes(type)) { _%>\n- run: ./bin/run --version\n<%_ } _%>\n@@ -32,7 +32,7 @@ jobs:\nname: Testing\ncommand: |\nmkdir -p reports\n- $NYC yarn test --reporter mocha-junit-reporter\n+ $NYC yarn test\n$NYC report --reporter text-lcov > coverage.lcov\ncurl -s https://codecov.io/bash | bash\n<%_ } else { _%>\n@@ -63,7 +63,7 @@ jobs:\nsemantic-release -e @oclif/semantic-release\n- run:\nname: Add dev packages to cache\n- command: yarn add -D nyc@11 @oclif/nyc-config@1 mocha-junit-reporter@1\n+ command: yarn add -D nyc@11 @oclif/nyc-config@1\n- save_cache:\nkey: v1-yarn-{{checksum \".circleci/config.yml\"}}-{{checksum \"yarn.lock\"}}\npaths:\n",
"new_path": "templates/circle.yml.ejs",
"old_path": "templates/circle.yml.ejs"
}
] |
TypeScript
|
MIT License
|
oclif/oclif
|
fix: remove junit reporter from circle
it hides the original output
| 1
|
fix
| null |
821,196
|
10.04.2018 02:21:53
| 25,200
|
a8e7518b94b1c7ce126feb2b3d55ab4a6659009b
|
chore: more junit removal
|
[
{
"change_type": "MODIFY",
"diff": "@@ -8,7 +8,6 @@ jobs:\nenvironment:\n<%_ if (mocha) { _%>\nNYC: \"yarn exec nyc -- --nycrc-path node_modules/@oclif/nyc-config/.nycrc\"\n- MOCHA_FILE: \"reports/mocha.xml\"\n<%_ } _%>\nsteps:\n- checkout\n@@ -31,15 +30,12 @@ jobs:\n- run:\nname: Testing\ncommand: |\n- mkdir -p reports\n$NYC yarn test\n$NYC report --reporter text-lcov > coverage.lcov\ncurl -s https://codecov.io/bash | bash\n<%_ } else { _%>\n- run: yarn test\n<%_ } _%>\n- - store_test_results: &store_test_results\n- path: ~/cli/reports\nnode-8:\n<<: *test\ndocker:\n",
"new_path": "templates/circle.yml.ejs",
"old_path": "templates/circle.yml.ejs"
}
] |
TypeScript
|
MIT License
|
oclif/oclif
|
chore: more junit removal
| 1
|
chore
| null |
821,196
|
10.04.2018 02:35:43
| 25,200
|
0f2ecaec84d0773f8b506feaf4bca05c63304d41
|
fix: break up code coverage into its own step
|
[
{
"change_type": "MODIFY",
"diff": "@@ -29,8 +29,10 @@ jobs:\n<%_ if (mocha) { _%>\n- run:\nname: Testing\n+ command: $NYC yarn test\n+ - run:\n+ name: Submitting code coverage to codecov\ncommand: |\n- $NYC yarn test\n$NYC report --reporter text-lcov > coverage.lcov\ncurl -s https://codecov.io/bash | bash\n<%_ } else { _%>\n",
"new_path": "templates/circle.yml.ejs",
"old_path": "templates/circle.yml.ejs"
}
] |
TypeScript
|
MIT License
|
oclif/oclif
|
fix: break up code coverage into its own step
| 1
|
fix
| null |
815,746
|
10.04.2018 08:49:36
| -10,800
|
5b3647bae90f0b264d484c2be6da403672ad6201
|
chore(release): 0.36.0
|
[
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"0.36.0\"></a>\n+# [0.36.0](https://github.com/ng-select/ng-select/compare/v0.35.2...v0.36.0) (2018-04-10)\n+\n+\n+### Features\n+\n+* adding basic support for Narrators on Dropdown ([#433](https://github.com/ng-select/ng-select/issues/433)) ([30201c0](https://github.com/ng-select/ng-select/commit/30201c0)), closes [#216](https://github.com/ng-select/ng-select/issues/216)\n+\n+\n+\n<a name=\"0.35.2\"></a>\n## [0.35.2](https://github.com/ng-select/ng-select/compare/v0.35.1...v0.35.2) (2018-04-09)\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"$schema\": \"../node_modules/ng-packagr/package.schema.json\",\n\"name\": \"@ng-select/ng-select\",\n- \"version\": \"0.35.2\",\n+ \"version\": \"0.36.0\",\n\"description\": \"Angular ng-select - All in One UI Select, Multiselect and Autocomplete\",\n\"author\": \"@ng-select/ng-select\",\n\"license\": \"MIT\",\n",
"new_path": "src/package.json",
"old_path": "src/package.json"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
chore(release): 0.36.0
| 1
|
chore
|
release
|
217,922
|
10.04.2018 10:24:40
| -7,200
|
1b11ed95d081d97ec330871258a3296048786be5
|
fix: no more <Indent/> in french item names
|
[
{
"change_type": "MODIFY",
"diff": "@@ -13,11 +13,15 @@ import {Language} from './language';\n@Injectable()\nexport class LocalizedDataService {\n+ indentRegexp = new RegExp('<Indent/>', 'i');\n+\nconstructor() {\n}\npublic getItem(id: number): I18nName {\n- return this.getRow(items, id);\n+ const row = this.getRow(items, id);\n+ row.fr = row.fr.replace(this.indentRegexp, '');\n+ return row;\n}\npublic getItemIdsByName(name: string, language: Language): number[] {\n",
"new_path": "src/app/core/data/localized-data.service.ts",
"old_path": "src/app/core/data/localized-data.service.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
fix: no more <Indent/> in french item names
| 1
|
fix
| null |
730,413
|
10.04.2018 10:58:07
| 14,400
|
3852bcba765a4357dbd44541cead4ea07e42527e
|
fix(journeys): create conversation before start call test and add wait
|
[
{
"change_type": "MODIFY",
"diff": "import testUsers from '@ciscospark/test-helper-test-users';\n+import CiscoSpark from '@ciscospark/spark-core';\n+import '@ciscospark/internal-plugin-conversation';\nimport {moveMouse} from '../../../lib/test-helpers';\nimport {elements} from '../../../lib/test-helpers/space-widget/main.js';\n@@ -7,7 +9,7 @@ import {answer, hangup, elements as meetElements} from '../../../lib/test-helper\ndescribe('Widget Space: One on One: Data API Settings', () => {\nconst browserLocal = browser.select('browserLocal');\nconst browserRemote = browser.select('browserRemote');\n- let mccoy, spock;\n+ let mccoy, spock, conversation;\nbefore('load browsers', () => {\nbrowser.url('/data-api/space.html');\n@@ -16,15 +18,45 @@ describe('Widget Space: One on One: Data API Settings', () => {\nbefore('create spock', () => testUsers.create({count: 1, config: {displayName: 'Mr Spock'}})\n.then((users) => {\n[spock] = users;\n+ spock.spark = new CiscoSpark({\n+ credentials: {\n+ authorization: spock.token\n+ },\n+ config: {\n+ logger: {\n+ level: 'error'\n+ }\n+ }\n+ });\n+ return spock.spark.internal.mercury.connect();\n}));\nbefore('create mccoy', () => testUsers.create({count: 1, config: {displayName: 'Bones Mccoy'}})\n.then((users) => {\n[mccoy] = users;\n+ mccoy.spark = new CiscoSpark({\n+ credentials: {\n+ authorization: mccoy.token\n+ },\n+ config: {\n+ logger: {\n+ level: 'error'\n+ }\n+ }\n+ });\n+ return mccoy.spark.internal.mercury.connect();\n}));\nbefore('pause to let test users establish', () => browser.pause(5000));\n+\n+ before('create space', () => mccoy.spark.internal.conversation.create({\n+ participants: [mccoy, spock]\n+ }).then((c) => {\n+ conversation = c;\n+ return conversation;\n+ }));\n+\ndescribe('initial activity setting: meet', () => {\nbefore('inject token', () => {\nbrowserLocal.execute((localAccessToken, localToUserEmail) => {\n@@ -62,6 +94,7 @@ describe('Widget Space: One on One: Data API Settings', () => {\nit('opens message widget', () => {\nbrowserLocal.waitForVisible(elements.messageWidget);\n+ browserLocal.waitForVisible(`[placeholder=\"Send a message to ${mccoy.displayName}\"]`);\nbrowserLocal.refresh();\n});\n});\n@@ -74,11 +107,12 @@ describe('Widget Space: One on One: Data API Settings', () => {\ncsmmDom.setAttribute('data-toggle', 'ciscospark-space');\ncsmmDom.setAttribute('data-access-token', localAccessToken);\ncsmmDom.setAttribute('data-to-person-email', localToUserEmail);\n- csmmDom.setAttribute('data-initial-activity', 'meet');\n+ csmmDom.setAttribute('data-initial-activity', 'message');\ndocument.getElementById('ciscospark-widget').appendChild(csmmDom);\nwindow.loadBundle('/dist-space/bundle.js');\n}, mccoy.token.access_token, spock.email);\n- browserRemote.waitForVisible(elements.meetWidget);\n+ browserRemote.waitForVisible(elements.messageWidget);\n+ browserRemote.waitForVisible(`[placeholder=\"Send a message to ${spock.displayName}\"]`);\n});\nbefore('inject token', () => {\n@@ -97,6 +131,7 @@ describe('Widget Space: One on One: Data API Settings', () => {\n});\nit('starts call when set to true', () => {\n+ browser.pause(5000);\nanswer(browserRemote);\nmoveMouse(browserLocal, meetElements.callContainer);\nhangup(browserLocal);\n",
"new_path": "test/journeys/specs/oneOnOne/dataApi/startup-settings.js",
"old_path": "test/journeys/specs/oneOnOne/dataApi/startup-settings.js"
}
] |
JavaScript
|
MIT License
|
webex/react-widgets
|
fix(journeys): create conversation before start call test and add wait
| 1
|
fix
|
journeys
|
791,834
|
10.04.2018 11:04:54
| 25,200
|
1de5667b1acca194203a517f4a743e484e9d7c7d
|
cli(chore): remove chrome-launcher stubs
|
[
{
"change_type": "DELETE",
"diff": "-# Chrome Launcher [](https://npmjs.org/package/chrome-launcher)\n-\n-Launch Google Chrome with ease from node. Package moved to https://npmjs.org/package/chrome-launcher.\n",
"new_path": null,
"old_path": "chrome-launcher/README.md"
},
{
"change_type": "DELETE",
"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-'use strict';\n-\n-/**\n- * chrome-launcher has moved to its own repository and npm package.\n- * https://github.com/GoogleChrome/chrome-launcher\n- * https://www.npmjs.com/package/chrome-launcher\n- * Forwarding stub provided here for users that have deep linked into this\n- * module, but file will be removed in next major release.\n- */\n-\n-module.exports = require('chrome-launcher');\n",
"new_path": null,
"old_path": "chrome-launcher/chrome-launcher.js"
},
{
"change_type": "DELETE",
"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-'use strict';\n-\n-/**\n- * chrome-launcher has moved to its own repository and npm package.\n- * https://github.com/GoogleChrome/chrome-launcher\n- * https://www.npmjs.com/package/chrome-launcher\n- * Forwarding stub provided here for users that have deep linked into this\n- * module, but file will be removed in next major release.\n- */\n-\n-module.exports = require('chrome-launcher');\n",
"new_path": null,
"old_path": "chrome-launcher/index.js"
},
{
"change_type": "RENAME",
"diff": "'use strict';\n-/**\n- * chrome-launcher has moved to its own repository and npm package.\n- * https://github.com/GoogleChrome/chrome-launcher\n- * https://www.npmjs.com/package/chrome-launcher\n- * This script preserved for Lighthouse's chrome-debug binary, but but file and\n- * bin entry will be removed in next major release.\n- */\n-\n/**\n* @fileoverview Script to launch a clean Chrome instance on-demand.\n*\n@@ -34,7 +26,7 @@ if (args.length) {\nchromeFlags = args.filter(flag => flag.startsWith('--'));\nconst portFlag = chromeFlags.find(flag => flag.startsWith('--port='));\n- port = portFlag && portFlag.replace('--port=', '');\n+ if (portFlag) port = parseInt(portFlag.replace('--port=', ''), 10);\nenableExtensions = !!chromeFlags.find(flag => flag === '--enable-extensions');\n",
"new_path": "lighthouse-core/scripts/manual-chrome-launcher.js",
"old_path": "chrome-launcher/manual-chrome-launcher.js"
},
{
"change_type": "MODIFY",
"diff": "\"main\": \"./lighthouse-core/index.js\",\n\"bin\": {\n\"lighthouse\": \"./lighthouse-cli/index.js\",\n- \"chrome-debug\": \"./chrome-launcher/manual-chrome-launcher.js\"\n+ \"chrome-debug\": \"./lighthouse-core/scripts/manual-chrome-launcher.js\"\n},\n\"engines\": {\n\"node\": \">=8\"\n\"closure\": \"cd lighthouse-core && node closure/closure-type-checking.js\",\n\"devtools\": \"bash lighthouse-core/scripts/roll-to-devtools.sh\",\n\"compile-devtools\": \"bash lighthouse-core/scripts/compile-against-devtools.sh\",\n- \"chrome\": \"node chrome-launcher/manual-chrome-launcher.js\",\n+ \"chrome\": \"node lighthouse-core/scripts/manual-chrome-launcher.js\",\n\"fast\": \"yarn start --disable-device-emulation --disable-cpu-throttling --disable-network-throttling\",\n\"smokehouse\": \"node lighthouse-cli/test/smokehouse/smokehouse.js\",\n\"deploy-viewer\": \"cd lighthouse-viewer && gulp deploy\",\n",
"new_path": "package.json",
"old_path": "package.json"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
cli(chore): remove chrome-launcher stubs (#4945)
| 1
|
cli
|
chore
|
573,227
|
10.04.2018 11:50:34
| 25,200
|
69f917a3db66fac58f01c9e16535c2e2fcf2172b
|
fix(plugins): save req._matchedVersion
|
[
{
"change_type": "MODIFY",
"diff": "@@ -321,9 +321,10 @@ function sendV2(req, res, next) {\nreturn next();\n}\n-var PATH = '/hello/:name';\n-server.get({path: PATH, version: '1.1.3'}, sendV1);\n-server.get({path: PATH, version: '2.0.0'}, sendV2);\n+server.get('/hello/:name', restify.plugins.conditionalHandler([\n+ { version: '1.1.3', handler: sendV1 },\n+ { version: '2.0.0', handler: sendV2 }\n+]));\nserver.listen(8080);\n```\n@@ -357,7 +358,9 @@ creation time. Lastly, you can support multiple versions in the API by using\nan array:\n```js\n-server.get({path: PATH, version: ['2.0.0', '2.1.0', '2.2.0']}, sendV2);\n+server.get('/hello/:name' restify.plugins.conditionalHandler([\n+ { version: ['2.0.0', '2.1.0', '2.2.0'], handler: sendV2 }\n+]));\n```\nIn this case you may need to know more information such as what the original\n@@ -366,16 +369,18 @@ supported version array was. Two methods make this info available:\n```js\nvar PATH = '/version/test';\n-server.get({\n- path: PATH,\n- version: ['2.0.0', '2.1.0', '2.2.0']\n-}, function (req, res, next) {\n+server.get('/version/test', restify.plugins.conditionalHandler([\n+ {\n+ version: ['2.0.0', '2.1.0', '2.2.0'],\n+ handler: function (req, res, next) {\nres.send(200, {\nrequestedVersion: req.version(),\nmatchedVersion: req.matchedVersion()\n});\nreturn next();\n-});\n+ }\n+ }\n+]));\n```\nHitting this route will respond as below:\n",
"new_path": "docs/index.md",
"old_path": "docs/index.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -174,7 +174,9 @@ function conditionalHandler(candidates) {\n// Add api-version response header\nres.header('api-version', maxVersion);\n-\n+ // Store matched version on request internal\n+ req._matchedVersion = maxVersion;\n+ // Run handler\nreqCandidates[maxVersionIndex].handler(req, res, next);\nreturn;\n}\n",
"new_path": "lib/plugins/conditionalHandler.js",
"old_path": "lib/plugins/conditionalHandler.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -14,9 +14,12 @@ var SERVER;\nvar CLIENT;\nvar PORT;\n-function handlerFactory(response) {\n+function handlerFactory(response, version) {\nreturn function handler(req, res, next) {\nres.send(response);\n+ if (version) {\n+ assert.equal(req.matchedVersion(), version);\n+ }\nnext();\n};\n}\n@@ -51,11 +54,11 @@ describe('conditional request', function() {\n'/',\nrestify.plugins.conditionalHandler([\n{\n- handler: handlerFactory('v1.1.0'),\n+ handler: handlerFactory('v1.1.0', 'v1.1.0'),\nversion: 'v1.1.0'\n},\n{\n- handler: handlerFactory('v1.2.0'),\n+ handler: handlerFactory('v1.2.0', 'v1.2.0'),\nversion: 'v1.2.0'\n}\n])\n",
"new_path": "test/plugins/conditionalHandler.test.js",
"old_path": "test/plugins/conditionalHandler.test.js"
}
] |
JavaScript
|
MIT License
|
restify/node-restify
|
fix(plugins): save req._matchedVersion (#1642)
| 1
|
fix
|
plugins
|
573,227
|
10.04.2018 11:57:11
| 25,200
|
0099b58265ed12d81db1964ba0d66b8ca6a42f42
|
chore(github): add stale config
|
[
{
"change_type": "ADD",
"diff": "+daysUntilStale: 60\n+daysUntilClose: 14\n+exemptLabels:\n+ - Critical\n+ - Serve\n+staleLabel: Stale\n+markComment: >\n+ This issue has been automatically marked as stale because it has not had\n+ recent activity. It will be closed if no further activity occurs. Thank you\n+ for your contributions.\n+closeComment: >\n+ This issue has been automatically closed as stale because it has not had\n+ recent activity.\n",
"new_path": ".github/stale.yml",
"old_path": null
}
] |
JavaScript
|
MIT License
|
restify/node-restify
|
chore(github): add stale config (#1643)
| 1
|
chore
|
github
|
807,849
|
10.04.2018 12:07:54
| 25,200
|
f6bae80ffc9f4f3e3370a491fe9af48a98947b8f
|
fix(import): Rebase patch copies, too
|
[
{
"change_type": "MODIFY",
"diff": "@@ -152,6 +152,7 @@ class ImportCommand extends Command {\n.replace(/^([-+]{3} [ab])/gm, replacement)\n.replace(/^(diff --git a)/gm, replacement)\n.replace(/^(diff --git \\S+ b)/gm, replacement)\n+ .replace(/^(copy (from|to)) /gm, `$1 ${formattedTarget}/`)\n.replace(/^(rename (from|to)) /gm, `$1 ${formattedTarget}/`);\n}\n",
"new_path": "commands/import/index.js",
"old_path": "commands/import/index.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
fix(import): Rebase patch copies, too
| 1
|
fix
|
import
|
807,849
|
10.04.2018 12:15:46
| 25,200
|
bbfec8aae4d50ad9ff4e2f99fc43037fef57d664
|
chore(release): publish v3.0.0-beta.16
|
[
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n+<a name=\"3.0.0-beta.16\"></a>\n+# [3.0.0-beta.16](https://github.com/lerna/lerna/compare/v3.0.0-beta.15...v3.0.0-beta.16) (2018-04-10)\n+\n+\n+### Bug Fixes\n+\n+* **import:** Rebase patch copies, too ([f6bae80](https://github.com/lerna/lerna/commit/f6bae80))\n+\n+\n+\n+\n+\n<a name=\"3.0.0-beta.15\"></a>\n# [3.0.0-beta.15](https://github.com/lerna/lerna/compare/v3.0.0-beta.14...v3.0.0-beta.15) (2018-04-09)\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n+<a name=\"3.0.0-beta.16\"></a>\n+# [3.0.0-beta.16](https://github.com/lerna/lerna/compare/v3.0.0-beta.15...v3.0.0-beta.16) (2018-04-10)\n+\n+\n+### Bug Fixes\n+\n+* **import:** Rebase patch copies, too ([f6bae80](https://github.com/lerna/lerna/commit/f6bae80))\n+\n+\n+\n+\n+\n<a name=\"3.0.0-beta.15\"></a>\n# [3.0.0-beta.15](https://github.com/lerna/lerna/compare/v3.0.0-beta.14...v3.0.0-beta.15) (2018-04-09)\n",
"new_path": "commands/import/CHANGELOG.md",
"old_path": "commands/import/CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@lerna/import\",\n- \"version\": \"3.0.0-beta.15\",\n+ \"version\": \"3.0.0-beta.16\",\n\"description\": \"TODO\",\n\"keywords\": [\n\"lerna\",\n",
"new_path": "commands/import/package.json",
"old_path": "commands/import/package.json"
},
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n+<a name=\"3.0.0-beta.16\"></a>\n+# [3.0.0-beta.16](https://github.com/lerna/lerna/compare/v3.0.0-beta.15...v3.0.0-beta.16) (2018-04-10)\n+\n+**Note:** Version bump only for package @lerna/cli\n+\n+\n+\n+\n+\n<a name=\"3.0.0-beta.15\"></a>\n# [3.0.0-beta.15](https://github.com/lerna/lerna/compare/v3.0.0-beta.14...v3.0.0-beta.15) (2018-04-09)\n",
"new_path": "core/cli/CHANGELOG.md",
"old_path": "core/cli/CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@lerna/cli\",\n- \"version\": \"3.0.0-beta.15\",\n+ \"version\": \"3.0.0-beta.16\",\n\"description\": \"TODO\",\n\"keywords\": [\n\"lerna\",\n",
"new_path": "core/cli/package.json",
"old_path": "core/cli/package.json"
},
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n+<a name=\"3.0.0-beta.16\"></a>\n+# [3.0.0-beta.16](https://github.com/lerna/lerna/compare/v3.0.0-beta.15...v3.0.0-beta.16) (2018-04-10)\n+\n+**Note:** Version bump only for package lerna\n+\n+\n+\n+\n+\n<a name=\"3.0.0-beta.15\"></a>\n# [3.0.0-beta.15](https://github.com/lerna/lerna/compare/v3.0.0-beta.14...v3.0.0-beta.15) (2018-04-09)\n",
"new_path": "core/lerna/CHANGELOG.md",
"old_path": "core/lerna/CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"lerna\",\n- \"version\": \"3.0.0-beta.15\",\n+ \"version\": \"3.0.0-beta.16\",\n\"description\": \"A tool for managing JavaScript projects with multiple packages.\",\n\"keywords\": [\n\"lerna\",\n",
"new_path": "core/lerna/package.json",
"old_path": "core/lerna/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"**/__tests__/**\",\n\"**/*.md\"\n],\n- \"version\": \"3.0.0-beta.15\"\n+ \"version\": \"3.0.0-beta.16\"\n}\n",
"new_path": "lerna.json",
"old_path": "lerna.json"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
chore(release): publish v3.0.0-beta.16
| 1
|
chore
|
release
|
217,922
|
10.04.2018 12:55:58
| -7,200
|
96bb43bacc414358e74a6fb5b68ac5e021bf0970
|
chore: better handling for older lists with monster location not extracted
|
[
{
"change_type": "MODIFY",
"diff": "<app-map-position mat-line *ngIf=\"drop.position !== undefined\"\n[zoneId]=\"drop.position.zoneid\"\n[marker]=\"drop.position\"></app-map-position>\n+ <span *ngIf=\"drop.position !== undefined\">\n<span mat-line *ngIf=\"getClosestAetheryte(drop) | async as aetheryte\" class=\"closest-tp\">\n<img src=\"/assets/icons/Aetheryte.png\" alt=\"\" class=\"aetheryte-icon\">\n{{aetheryte.nameid | placeName | i18n}}\n</span>\n+ </span>\n</mat-list-item>\n</mat-list>\n</div>\n",
"new_path": "src/app/modules/item/drops-details-popup/drops-details-popup.component.html",
"old_path": "src/app/modules/item/drops-details-popup/drops-details-popup.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -18,7 +18,11 @@ export class DropsDetailsPopupComponent {\ngetClosestAetheryte(drop: Drop): Observable<Aetheryte> {\nreturn this.mapService.getMapById(drop.position.zoneid).map((map) => {\n+ if (map !== undefined) {\nreturn this.mapService.getNearestAetheryte(map, drop.position);\n+ } else {\n+ return undefined;\n+ }\n});\n}\n}\n",
"new_path": "src/app/modules/item/drops-details-popup/drops-details-popup.component.ts",
"old_path": "src/app/modules/item/drops-details-popup/drops-details-popup.component.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore: better handling for older lists with monster location not extracted
| 1
|
chore
| null |
730,413
|
10.04.2018 13:39:15
| 14,400
|
4a41a604d2491238d17cdab73444a51e6edc6cfd
|
fix(journeys): add a pause for call to establish
|
[
{
"change_type": "MODIFY",
"diff": "@@ -49,6 +49,7 @@ export function call(caller, reciever) {\ncaller.waitForVisible(elements.callButton);\ncaller.click(elements.callButton);\n// wait for call to establish\n+ browser.pause(5000);\nreciever.waitForVisible(elements.answerButton);\n}\n",
"new_path": "test/journeys/lib/test-helpers/space-widget/meet.js",
"old_path": "test/journeys/lib/test-helpers/space-widget/meet.js"
}
] |
JavaScript
|
MIT License
|
webex/react-widgets
|
fix(journeys): add a pause for call to establish
| 1
|
fix
|
journeys
|
217,922
|
10.04.2018 14:24:40
| -7,200
|
bc915d822c971f371c45430fba292b60eef6b870
|
feat: outdated lists are now automatically regenerated when opened by the author
|
[
{
"change_type": "MODIFY",
"diff": "@@ -367,7 +367,7 @@ export class List extends DataModel {\n}\nlet res = false;\nres = res || (this.version === undefined);\n- res = res || semver.ltr(this.version, '3.3.0');\n+ res = res || semver.ltr(this.version, '3.4.5');\nreturn res;\n}\n",
"new_path": "src/app/model/list/list.ts",
"old_path": "src/app/model/list/list.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -88,6 +88,8 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\n@Output()\nreload: EventEmitter<void> = new EventEmitter<void>();\n+ private upgradingList = false;\n+\npublic get selectedIndex(): number {\nreturn +(localStorage.getItem('layout:selected') || 0);\n}\n@@ -116,6 +118,12 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\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+ setTimeout(() => {\n+ if (!this.upgradingList && this.listData.isOutDated() && this.listData.authorId === this.userData.$key) {\n+ this.upgradeList();\n+ }\n+ }, 50);\nthis.listData.forEachItem(item => {\nif (item.gatheredBy !== undefined) {\nconst filter = this.gatheringFilters.find(f => f.types.indexOf(item.gatheredBy.type) > -1);\n@@ -235,6 +243,7 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\n}\nupgradeList(): void {\n+ this.upgradingList = true;\nconst dialogRef = this.dialog.open(RegenerationPopupComponent, {disableClose: true});\nthis.cd.detach();\nthis.listManager.upgradeList(this.listData)\n@@ -243,6 +252,8 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\nthis.cd.reattach();\ndialogRef.close();\nthis.snack.open(this.translate.instant('List_recreated'), '', {duration: 2000});\n+ this.upgradingList = false;\n+ this.reload.emit();\n});\n}\n",
"new_path": "src/app/pages/list/list-details/list-details.component.ts",
"old_path": "src/app/pages/list/list-details/list-details.component.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
feat: outdated lists are now automatically regenerated when opened by the author
| 1
|
feat
| null |
791,690
|
10.04.2018 15:37:49
| 25,200
|
aec55bd59b39aeca7a84f51b760fcd4626897b25
|
core(metrics): add FCP metric
|
[
{
"change_type": "ADD",
"diff": "+/**\n+ * @license Copyright 2018 Google Inc. All Rights Reserved.\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n+ */\n+'use strict';\n+\n+const Audit = require('./audit');\n+const Util = require('../report/v2/renderer/util.js');\n+\n+class FirstContentfulPaint extends Audit {\n+ /**\n+ * @return {AuditMeta}\n+ */\n+ static get meta() {\n+ return {\n+ name: 'first-contentful-paint',\n+ description: 'First Contentful Paint',\n+ helpText: 'First contentful paint marks the time at which the first text/image is painted. ' +\n+ `[Learn more](https://developers.google.com/web/fundamentals/performance/user-centric-performance-metrics#first_paint_and_first_contentful_paint).`,\n+ scoreDisplayMode: Audit.SCORING_MODES.NUMERIC,\n+ requiredArtifacts: ['traces', 'devtoolsLogs'],\n+ };\n+ }\n+\n+ /**\n+ * @return {LH.Audit.ScoreOptions}\n+ */\n+ static get defaultOptions() {\n+ return {\n+ // see https://www.desmos.com/calculator/joz3pqttdq\n+ scorePODR: 1600,\n+ scoreMedian: 4000,\n+ };\n+ }\n+\n+ /**\n+ * @param {LH.Artifacts} artifacts\n+ * @param {LH.Audit.Context} context\n+ * @return {Promise<LH.Audit.Product>}\n+ */\n+ static async audit(artifacts, context) {\n+ const trace = artifacts.traces[Audit.DEFAULT_PASS];\n+ const devtoolsLog = artifacts.devtoolsLogs[Audit.DEFAULT_PASS];\n+ const metricComputationData = {trace, devtoolsLog, settings: context.settings};\n+ const metricResult = await artifacts.requestFirstContentfulPaint(metricComputationData);\n+\n+ return {\n+ score: Audit.computeLogNormalScore(\n+ metricResult.timing,\n+ context.options.scorePODR,\n+ context.options.scoreMedian\n+ ),\n+ rawValue: metricResult.timing,\n+ displayValue: Util.formatMilliseconds(metricResult.timing),\n+ };\n+ }\n+}\n+\n+module.exports = FirstContentfulPaint;\n",
"new_path": "lighthouse-core/audits/first-contentful-paint.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -75,6 +75,7 @@ module.exports = {\n'works-offline',\n'viewport',\n'without-javascript',\n+ 'first-contentful-paint',\n'first-meaningful-paint',\n'load-fast-enough-for-pwa',\n'speed-index-metric',\n@@ -262,7 +263,8 @@ module.exports = {\nname: 'Performance',\ndescription: 'These encapsulate your web app\\'s current performance and opportunities to improve it.',\naudits: [\n- {id: 'first-meaningful-paint', weight: 5, group: 'perf-metric'},\n+ {id: 'first-contentful-paint', weight: 5, group: 'perf-metric'},\n+ {id: 'first-meaningful-paint', weight: 3, group: 'perf-metric'},\n{id: 'first-interactive', weight: 5, group: 'perf-metric'},\n{id: 'consistently-interactive', weight: 5, group: 'perf-metric'},\n{id: 'speed-index-metric', weight: 1, group: 'perf-metric'},\n",
"new_path": "lighthouse-core/config/default-config.js",
"old_path": "lighthouse-core/config/default-config.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -137,10 +137,6 @@ class ConsistentlyInteractive extends MetricArtifact {\n*/\ncomputeObservedMetric(data) {\nconst {traceOfTab, networkRecords} = data;\n- if (!traceOfTab || !networkRecords) {\n- throw new Error('Missing required artifacts');\n- }\n-\nif (!traceOfTab.timestamps.firstMeaningfulPaint) {\nthrow new LHError(LHError.errors.NO_FMP);\n}\n",
"new_path": "lighthouse-core/gather/computed/metrics/consistently-interactive.js",
"old_path": "lighthouse-core/gather/computed/metrics/consistently-interactive.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 MetricArtifact = require('./metric');\n+const LHError = require('../../../lib/errors');\n+\n+class FirstContentfulPaint extends MetricArtifact {\n+ get name() {\n+ return 'FirstContentfulPaint';\n+ }\n+\n+ /**\n+ * @param {LH.Artifacts.MetricComputationData} data\n+ * @return {Promise<LH.Artifacts.Metric>}\n+ */\n+ computeObservedMetric(data) {\n+ const {traceOfTab} = data;\n+ if (!traceOfTab.timestamps.firstContentfulPaint) {\n+ throw new LHError(LHError.errors.NO_FCP);\n+ }\n+\n+ return Promise.resolve({\n+ timing: traceOfTab.timings.firstContentfulPaint,\n+ timestamp: traceOfTab.timestamps.firstContentfulPaint,\n+ });\n+ }\n+}\n+\n+module.exports = FirstContentfulPaint;\n",
"new_path": "lighthouse-core/gather/computed/metrics/first-contentful-paint.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -42,7 +42,7 @@ class ComputedMetric extends ComputedArtifact {\n}\n/**\n- * @param {LH.Artifacts.MetricComputationData} data\n+ * @param {LH.Artifacts.MetricComputationDataInput} data\n* @param {Object} artifacts\n* @return {Promise<LH.Artifacts.LanternMetric|LH.Artifacts.Metric>}\n*/\n",
"new_path": "lighthouse-core/gather/computed/metrics/metric.js",
"old_path": "lighthouse-core/gather/computed/metrics/metric.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -71,6 +71,7 @@ const ERRORS = {\n// Trace parsing errors\nNO_TRACING_STARTED: {message: strings.badTraceRecording},\nNO_NAVSTART: {message: strings.badTraceRecording},\n+ NO_FCP: {message: strings.badTraceRecording},\nNO_FMP: {message: strings.badTraceRecording},\nNO_DCL: {message: strings.badTraceRecording},\n",
"new_path": "lighthouse-core/lib/errors.js",
"old_path": "lighthouse-core/lib/errors.js"
},
{
"change_type": "ADD",
"diff": "+/**\n+ * @license Copyright 2018 Google Inc. All Rights Reserved.\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n+ */\n+'use strict';\n+\n+const Audit = require('../../audits/first-contentful-paint.js');\n+const Runner = require('../../runner.js');\n+const assert = require('assert');\n+const options = Audit.defaultOptions;\n+\n+const pwaTrace = require('../fixtures/traces/progressive-app-m60.json');\n+const pwaDevtoolsLog = require('../fixtures/traces/progressive-app-m60.devtools.log.json');\n+\n+/* eslint-env mocha */\n+\n+describe('Performance: first-contentful-paint audit', () => {\n+ it('evaluates valid input correctly', async () => {\n+ const artifacts = Object.assign({\n+ traces: {\n+ [Audit.DEFAULT_PASS]: pwaTrace,\n+ },\n+ devtoolsLogs: {\n+ [Audit.DEFAULT_PASS]: pwaDevtoolsLog,\n+ },\n+ }, Runner.instantiateComputedArtifacts());\n+\n+ const settings = {throttlingMethod: 'provided'};\n+ const result = await Audit.audit(artifacts, {settings, options});\n+ assert.equal(result.score, 1);\n+ assert.equal(result.rawValue, 498.87);\n+ });\n+});\n",
"new_path": "lighthouse-core/test/audits/first-contentful-paint-test.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+/**\n+ * @license Copyright 2018 Google Inc. All Rights Reserved.\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n+ */\n+'use strict';\n+\n+const Runner = require('../../../../runner');\n+const assert = require('assert');\n+\n+const trace = require('../../../fixtures/traces/progressive-app-m60.json');\n+const devtoolsLog = require('../../../fixtures/traces/progressive-app-m60.devtools.log.json');\n+\n+/* eslint-env mocha */\n+\n+describe('Metrics: FCP', () => {\n+ it('should compute a simulated value', async () => {\n+ const artifacts = Runner.instantiateComputedArtifacts();\n+ const settings = {throttlingMethod: 'simulate'};\n+ const result = await artifacts.requestFirstContentfulPaint({trace, devtoolsLog, settings});\n+\n+ assert.equal(Math.round(result.timing), 2038);\n+ assert.equal(Math.round(result.optimisticEstimate.timeInMs), 611);\n+ assert.equal(Math.round(result.pessimisticEstimate.timeInMs), 611);\n+ assert.equal(result.optimisticEstimate.nodeTiming.size, 2);\n+ assert.equal(result.pessimisticEstimate.nodeTiming.size, 2);\n+ assert.ok(result.optimisticGraph, 'should have created optimistic graph');\n+ assert.ok(result.pessimisticGraph, 'should have created pessimistic graph');\n+ });\n+\n+ it('should compute an observed value', async () => {\n+ const artifacts = Runner.instantiateComputedArtifacts();\n+ const settings = {throttlingMethod: 'provided'};\n+ const result = await artifacts.requestFirstContentfulPaint({trace, devtoolsLog, settings});\n+\n+ assert.equal(Math.round(result.timing), 499);\n+ assert.equal(result.timestamp, 225414670885);\n+ });\n+});\n",
"new_path": "lighthouse-core/test/gather/computed/metrics/first-contentful-paint-test.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -15,13 +15,15 @@ declare global {\n}\nmodule Artifacts {\n- export interface MetricComputationData {\n+ export interface MetricComputationDataInput {\ndevtoolsLog: Array<Protocol.RawEventMessage>;\ntrace: Trace;\nsettings: Config.Settings;\n+ }\n- networkRecords?: Array<WebInspector.NetworkRequest>;\n- traceOfTab?: TraceOfTab;\n+ export interface MetricComputationData extends MetricComputationDataInput {\n+ networkRecords: Array<WebInspector.NetworkRequest>;\n+ traceOfTab: TraceOfTab;\n}\nexport interface Metric {\n",
"new_path": "typings/artifacts.d.ts",
"old_path": "typings/artifacts.d.ts"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
core(metrics): add FCP metric (#4948)
| 1
|
core
|
metrics
|
791,834
|
10.04.2018 16:44:46
| 25,200
|
82c83813e77d096295f8badc089e97286bac38f3
|
core(tsc): add type checking to asset-saver
|
[
{
"change_type": "MODIFY",
"diff": "@@ -69,11 +69,10 @@ module.exports = {\n'arrow-parens': 0,\n},\nparserOptions: {\n- ecmaVersion: 2017,\n+ ecmaVersion: 2018,\necmaFeatures: {\nglobalReturn: true,\njsx: false,\n- experimentalObjectRestSpread: false,\n},\nsourceType: 'script',\n},\n",
"new_path": ".eslintrc.js",
"old_path": ".eslintrc.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -17,13 +17,13 @@ class DevtoolsLog {\nconstructor(regexFilter) {\nthis._filter = regexFilter;\n- /** @type {Array<LH.Protocol.RawEventMessage>} */\n+ /** @type {LH.DevtoolsLog} */\nthis._messages = [];\nthis._isRecording = false;\n}\n/**\n- * @return {Array<LH.Protocol.RawEventMessage>}\n+ * @return {LH.DevtoolsLog}\n*/\nget messages() {\nreturn this._messages;\n",
"new_path": "lighthouse-core/gather/devtools-log.js",
"old_path": "lighthouse-core/gather/devtools-log.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -729,7 +729,6 @@ class Driver {\nreturn new Promise((resolve, reject) => {\n// If this takes more than 1s, reject the Promise.\n// Why? Encoding issues can lead to hanging getResponseBody calls: https://github.com/GoogleChrome/lighthouse/pull/4718\n- // @ts-ignore TODO(bckenny): fix LHError constructor/errors mismatch\nconst err = new LHError(LHError.errors.REQUEST_CONTENT_TIMEOUT);\nconst asyncTimeout = setTimeout((_ => reject(err)), timeout);\n@@ -941,7 +940,7 @@ class Driver {\n/**\n* Stop recording to devtoolsLog and return log contents.\n- * @return {Array<LH.Protocol.RawEventMessage>}\n+ * @return {LH.DevtoolsLog}\n*/\nendDevtoolsLog() {\nthis._devtoolsLog.endRecording();\n",
"new_path": "lighthouse-core/gather/driver.js",
"old_path": "lighthouse-core/gather/driver.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -19,7 +19,7 @@ const Driver = require('../gather/driver.js'); // eslint-disable-line no-unused-\n* `collectArtifacts`.\n* @typedef {{LighthouseRunWarnings: Array<string>, [artifactName: string]: Array<*>}} GathererResults\n*/\n-/** @typedef {{traces: Object<string, LH.Trace>, devtoolsLogs: Object<string, Array<LH.Protocol.RawEventMessage>>}} TracingData */\n+/** @typedef {{traces: Object<string, LH.Trace>, devtoolsLogs: Object<string, LH.DevtoolsLog>}} TracingData */\n/**\n* Class that drives browser to load the page and runs gatherer lifecycle hooks.\n@@ -173,7 +173,6 @@ class GatherRunner {\n}\nif (errorCode) {\n- // @ts-ignore TODO(bckenny): fix LHError constructor/errors mismatch\nconst error = new LHError(errorCode, {reason: errorReason});\nlog.error('GatherRunner', error.message, url);\nreturn error;\n",
"new_path": "lighthouse-core/gather/gather-runner.js",
"old_path": "lighthouse-core/gather/gather-runner.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';\nconst fs = require('fs');\n@@ -15,10 +14,24 @@ const TraceParser = require('./traces/trace-parser');\nconst rimraf = require('rimraf');\nconst mkdirp = require('mkdirp');\n+const artifactsFilename = 'artifacts.json';\n+const traceSuffix = '.trace.json';\n+const devtoolsLogSuffix = '.devtoolslog.json';\n+\n+/** @typedef {{timestamp: number, datauri: string}} Screenshot */\n+/**\n+ * @typedef {object} PreparedAssets\n+ * @property {string} passName\n+ * @property {LH.Trace} traceData\n+ * @property {LH.DevtoolsLog} devtoolsLog\n+ * @property {string} screenshotsHTML\n+ * @property {Array<Screenshot>} screenshots\n+ */\n+\n/**\n* Generate basic HTML page of screenshot filmstrip\n- * @param {!Array<{timestamp: number, datauri: string}>} screenshots\n- * @return {!string}\n+ * @param {Array<Screenshot>} screenshots\n+ * @return {string}\n*/\nfunction screenshotDump(screenshots) {\nreturn `\n@@ -58,25 +71,20 @@ img {\n`;\n}\n-const artifactsFilename = 'artifacts.json';\n-const traceSuffix = '.trace.json';\n-const devtoolsLogSuffix = '.devtoolslog.json';\n-\n/**\n* Load artifacts object from files located within basePath\n* Also save the traces to their own files\n* @param {string} basePath\n- * @return {!Promise<!Artifacts>}\n+ * @return {Promise<LH.Artifacts>}\n*/\n-// Set to ignore because testing it would imply testing fs, which isn't strictly necessary.\n-/* istanbul ignore next */\n-function loadArtifacts(basePath) {\n+async function loadArtifacts(basePath) {\nlog.log('Reading artifacts from disk:', basePath);\nif (!fs.existsSync(basePath)) return Promise.reject(new Error('No saved artifacts found'));\n// load artifacts.json\nconst filenames = fs.readdirSync(basePath);\n+ /** @type {LH.Artifacts} */\nconst artifacts = JSON.parse(fs.readFileSync(path.join(basePath, artifactsFilename), 'utf8'));\n// load devtoolsLogs\n@@ -104,66 +112,66 @@ function loadArtifacts(basePath) {\n});\n});\n});\n- return Promise.all(promises).then(_ => artifacts);\n+ await Promise.all(promises);\n+\n+ return artifacts;\n}\n/**\n* Save artifacts object mostly to single file located at basePath/artifacts.log.\n* Also save the traces & devtoolsLogs to their own files\n- * @param {!Artifacts} artifacts\n+ * @param {LH.Artifacts} artifacts\n* @param {string} basePath\n+ * @return {Promise<void>}\n*/\n-// Set to ignore because testing it would imply testing fs, which isn't strictly necessary.\n-/* istanbul ignore next */\n-function saveArtifacts(artifacts, basePath) {\n+async function saveArtifacts(artifacts, basePath) {\nmkdirp.sync(basePath);\nrimraf.sync(`${basePath}/*${traceSuffix}`);\nrimraf.sync(`${basePath}/${artifactsFilename}`);\n- // We don't want to mutate the artifacts as provided\n- artifacts = Object.assign({}, artifacts);\n+ // TODO: when https://github.com/GoogleChrome/lighthouse/issues/4952 is fixed\n+ // const {traces, devtoolsLogs, ...restArtifacts} = artifacts;\n+ const traces = artifacts.traces;\n+ const devtoolsLogs = artifacts.devtoolsLogs;\n+ const restArtifacts = Object.assign({}, artifacts);\n+ delete restArtifacts.traces;\n+ delete restArtifacts.devtoolsLogs;\n// save traces\n- const traces = artifacts.traces;\n- let promise = Promise.all(Object.keys(traces).map(passName => {\n- return saveTrace(traces[passName], `${basePath}/${passName}${traceSuffix}`);\n- }));\n+ for (const [passName, trace] of Object.entries(traces)) {\n+ await saveTrace(trace, `${basePath}/${passName}${traceSuffix}`);\n+ }\n// save devtools log\n- const devtoolsLogs = artifacts.devtoolsLogs;\n- promise = promise.then(_ => {\n- Object.keys(devtoolsLogs).map(passName => {\n- const log = JSON.stringify(devtoolsLogs[passName]);\n+ for (const [passName, devtoolsLog] of Object.entries(devtoolsLogs)) {\n+ const log = JSON.stringify(devtoolsLog);\nfs.writeFileSync(`${basePath}/${passName}${devtoolsLogSuffix}`, log, 'utf8');\n- });\n- delete artifacts.traces;\n- delete artifacts.devtoolsLogs;\n- });\n+ }\n// save everything else\n- promise = promise.then(_ => {\n- fs.writeFileSync(`${basePath}/${artifactsFilename}`, JSON.stringify(artifacts, 0, 2), 'utf8');\n+ const restArtifactsString = JSON.stringify(restArtifacts, null, 2);\n+ fs.writeFileSync(`${basePath}/${artifactsFilename}`, restArtifactsString, 'utf8');\nlog.log('Artifacts saved to disk in folder:', basePath);\n- });\n- return promise;\n}\n/**\n* Filter traces and extract screenshots to prepare for saving.\n- * @param {!Artifacts} artifacts\n- * @param {!Audits} audits\n- * @return {!Promise<!Array<{traceData: !Object, html: string}>>}\n+ * @param {LH.Artifacts} artifacts\n+ * @param {LH.Audit.Results} [audits]\n+ * @return {Promise<Array<PreparedAssets>>}\n*/\n-function prepareAssets(artifacts, audits) {\n+async function prepareAssets(artifacts, audits) {\nconst passNames = Object.keys(artifacts.traces);\n+ /** @type {Array<PreparedAssets>} */\nconst assets = [];\n- return passNames.reduce((chain, passName) => {\n+ for (const passName of passNames) {\nconst trace = artifacts.traces[passName];\nconst devtoolsLog = artifacts.devtoolsLogs[passName];\n+ /** @type {Array<Screenshot>} */\n+ // @ts-ignore TODO(bckenny): need typed computed artifacts\n+ const screenshots = await artifacts.requestScreenshots(trace);\n- return chain.then(_ => artifacts.requestScreenshots(trace))\n- .then(screenshots => {\nconst traceData = Object.assign({}, trace);\nconst screenshotsHTML = screenshotDump(screenshots);\n@@ -179,16 +187,16 @@ function prepareAssets(artifacts, audits) {\nscreenshotsHTML,\nscreenshots,\n});\n- });\n- }, Promise.resolve())\n- .then(_ => assets);\n+ }\n+\n+ return assets;\n}\n/**\n* Generates a JSON representation of traceData line-by-line to avoid OOM due to\n* very large traces.\n- * @param {{traceEvents: !Array}} traceData\n- * @return {!Iterator<string>}\n+ * @param {LH.Trace} traceData\n+ * @return {IterableIterator<string>}\n*/\nfunction* traceJsonGenerator(traceData) {\nconst keys = Object.keys(traceData);\n@@ -222,9 +230,9 @@ function* traceJsonGenerator(traceData) {\n/**\n* Save a trace as JSON by streaming to disk at traceFilename.\n- * @param {{traceEvents: !Array}} traceData\n+ * @param {LH.Trace} traceData\n* @param {string} traceFilename\n- * @return {!Promise<undefined>}\n+ * @return {Promise<void>}\n*/\nfunction saveTrace(traceData, traceFilename) {\nreturn new Promise((resolve, reject) => {\n@@ -247,53 +255,52 @@ function saveTrace(traceData, traceFilename) {\n}\n/**\n- * Writes trace(s) and associated screenshot(s) to disk.\n- * @param {!Artifacts} artifacts\n- * @param {!Audits} audits\n+ * Writes trace(s) and associated asset(s) to disk.\n+ * @param {LH.Artifacts} artifacts\n+ * @param {LH.Audit.Results} audits\n* @param {string} pathWithBasename\n- * @return {!Promise}\n+ * @return {Promise<void>}\n*/\n-function saveAssets(artifacts, audits, pathWithBasename) {\n- return prepareAssets(artifacts, audits).then(assets => {\n- return Promise.all(assets.map((data, index) => {\n+async function saveAssets(artifacts, audits, pathWithBasename) {\n+ const allAssets = await prepareAssets(artifacts, audits);\n+ const saveAll = allAssets.map(async (passAssets, index) => {\nconst devtoolsLogFilename = `${pathWithBasename}-${index}${devtoolsLogSuffix}`;\n- fs.writeFileSync(devtoolsLogFilename, JSON.stringify(data.devtoolsLog, null, 2));\n+ fs.writeFileSync(devtoolsLogFilename, JSON.stringify(passAssets.devtoolsLog, null, 2));\nlog.log('saveAssets', 'devtools log saved to disk: ' + devtoolsLogFilename);\nconst screenshotsHTMLFilename = `${pathWithBasename}-${index}.screenshots.html`;\n- fs.writeFileSync(screenshotsHTMLFilename, data.screenshotsHTML);\n+ fs.writeFileSync(screenshotsHTMLFilename, passAssets.screenshotsHTML);\nlog.log('saveAssets', 'screenshots saved to disk: ' + screenshotsHTMLFilename);\nconst screenshotsJSONFilename = `${pathWithBasename}-${index}.screenshots.json`;\n- fs.writeFileSync(screenshotsJSONFilename, JSON.stringify(data.screenshots, null, 2));\n+ fs.writeFileSync(screenshotsJSONFilename, JSON.stringify(passAssets.screenshots, null, 2));\nlog.log('saveAssets', 'screenshots saved to disk: ' + screenshotsJSONFilename);\nconst streamTraceFilename = `${pathWithBasename}-${index}${traceSuffix}`;\nlog.log('saveAssets', 'streaming trace file to disk: ' + streamTraceFilename);\n- return saveTrace(data.traceData, streamTraceFilename).then(_ => {\n+ await saveTrace(passAssets.traceData, streamTraceFilename);\nlog.log('saveAssets', 'trace file streamed to disk: ' + streamTraceFilename);\n});\n- }));\n- });\n+\n+ await Promise.all(saveAll);\n}\n/**\n- * Log trace(s) and associated screenshot(s) to console.\n- * @param {!Artifacts} artifacts\n- * @param {!Audits} audits\n- * @return {!Promise}\n+ * Log trace(s) and associated devtoolsLog(s) to console.\n+ * @param {LH.Artifacts} artifacts\n+ * @param {LH.Audit.Results} audits\n+ * @return {Promise<void>}\n*/\n-function logAssets(artifacts, audits) {\n- return prepareAssets(artifacts, audits).then(assets => {\n- assets.map(data => {\n- log.log(`devtoolslog-${data.passName}.json`, JSON.stringify(data.devtoolsLog));\n- const traceIter = traceJsonGenerator(data.traceData);\n+async function logAssets(artifacts, audits) {\n+ const allAssets = await prepareAssets(artifacts, audits);\n+ allAssets.map(passAssets => {\n+ log.log(`devtoolslog-${passAssets.passName}.json`, JSON.stringify(passAssets.devtoolsLog));\n+ const traceIter = traceJsonGenerator(passAssets.traceData);\nlet traceJson = '';\nfor (const trace of traceIter) {\ntraceJson += trace;\n}\n- log.log(`trace-${data.passName}.json`, traceJson);\n- });\n+ log.log(`trace-${passAssets.passName}.json`, traceJson);\n});\n}\n",
"new_path": "lighthouse-core/lib/asset-saver.js",
"old_path": "lighthouse-core/lib/asset-saver.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -259,7 +259,7 @@ class NetworkRecorder extends EventEmitter {\n/**\n* Construct network records from a log of devtools protocol messages.\n- * @param {Array<LH.Protocol.RawEventMessage>} devtoolsLog\n+ * @param {LH.DevtoolsLog} devtoolsLog\n* @return {Array<LH.WebInspector.NetworkRequest>}\n*/\nstatic recordsFromLogs(devtoolsLog) {\n",
"new_path": "lighthouse-core/lib/network-recorder.js",
"old_path": "lighthouse-core/lib/network-recorder.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -235,7 +235,7 @@ class Metrics {\n}\n/**\n- * @returns {!Array} User timing raw trace event pairs\n+ * @returns {Array<LH.TraceEvent>} User timing raw trace event pairs\n*/\ngenerateFakeEvents() {\nconst fakeEvents = [];\n",
"new_path": "lighthouse-core/lib/traces/pwmetrics-events.js",
"old_path": "lighthouse-core/lib/traces/pwmetrics-events.js"
},
{
"change_type": "MODIFY",
"diff": "\"chrome-debug\": \"./lighthouse-core/scripts/manual-chrome-launcher.js\"\n},\n\"engines\": {\n- \"node\": \">=8\"\n+ \"node\": \">=8.9\"\n},\n\"scripts\": {\n\"install-all\": \"npm-run-posix-or-windows install-all:task\",\n\"coveralls\": \"^2.11.9\",\n\"csv-validator\": \"^0.0.3\",\n\"cz-customizable\": \"^5.2.0\",\n- \"eslint\": \"^4.8.0\",\n+ \"eslint\": \"^4.19.1\",\n\"eslint-config-google\": \"^0.9.1\",\n\"google-closure-compiler\": \"^20170521.0.0\",\n\"gulp\": \"^3.9.1\",\n",
"new_path": "package.json",
"old_path": "package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -11,12 +11,12 @@ declare global {\nLighthouseRunWarnings: string[];\nUserAgent: string;\ntraces: {[passName: string]: Trace};\n- devtoolsLogs: {[passName: string]: Protocol.RawEventMessage};\n+ devtoolsLogs: {[passName: string]: DevtoolsLog};\n}\nmodule Artifacts {\nexport interface MetricComputationDataInput {\n- devtoolsLog: Array<Protocol.RawEventMessage>;\n+ devtoolsLog: DevtoolsLog;\ntrace: Trace;\nsettings: Config.Settings;\n}\n",
"new_path": "typings/artifacts.d.ts",
"old_path": "typings/artifacts.d.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -102,8 +102,17 @@ declare global {\nfriendlyMessage?: string;\n}\n+ /**\n+ * A record of DevTools Debugging Protocol events.\n+ */\n+ export type DevtoolsLog = Array<Protocol.RawEventMessage>;\n+\nexport interface Trace {\ntraceEvents: TraceEvent[];\n+ metadata?: {\n+ 'cpu-family'?: number;\n+ };\n+ [futureProps: string]: any;\n}\nexport interface TraceEvent {\n",
"new_path": "typings/externs.d.ts",
"old_path": "typings/externs.d.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -22,7 +22,7 @@ declare global {\nexport interface LoadData {\nnetworkRecords: Array<WebInspector.NetworkRequest>;\n- devtoolsLog: Array<Protocol.RawEventMessage>;\n+ devtoolsLog: DevtoolsLog;\ntrace?: Trace;\n}\n",
"new_path": "typings/gatherer.d.ts",
"old_path": "typings/gatherer.d.ts"
},
{
"change_type": "MODIFY",
"diff": "resolved \"https://registry.yarnpkg.com/@types/mkdirp/-/mkdirp-0.3.29.tgz#7f2ad7ec55f914482fc9b1ec4bb1ae6028d46066\"\n\"@types/node@*\", \"@types/node@^9.3.0\":\n- version \"8.0.49\"\n- resolved \"https://registry.yarnpkg.com/@types/node/-/node-8.0.49.tgz#417f86ab4829c629fe561779ee48751e0fe2a11b\"\n+ version \"8.9.5\"\n+ resolved \"https://registry.yarnpkg.com/@types/node/-/node-8.9.5.tgz#162b864bc70be077e6db212b322754917929e976\"\n\"@types/opn@^3.0.28\":\nversion \"3.0.28\"\n@@ -199,9 +199,9 @@ acorn@^4.0.4:\nversion \"4.0.11\"\nresolved \"https://registry.yarnpkg.com/acorn/-/acorn-4.0.11.tgz#edcda3bd937e7556410d42ed5860f67399c794c0\"\n-acorn@^5.1.1:\n- version \"5.1.2\"\n- resolved \"https://registry.yarnpkg.com/acorn/-/acorn-5.1.2.tgz#911cb53e036807cf0fa778dc5d370fbd864246d7\"\n+acorn@^5.5.0:\n+ version \"5.5.3\"\n+ resolved \"https://registry.yarnpkg.com/acorn/-/acorn-5.5.3.tgz#f473dd47e0277a08e28e9bec5aeeb04751f0b8c9\"\nadd-stream@^1.0.0:\nversion \"1.0.0\"\n@@ -217,7 +217,7 @@ ajv-keywords@^2.1.0:\nversion \"2.1.0\"\nresolved \"https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.0.tgz#a296e17f7bfae7c1ce4f7e0de53d29cb32162df0\"\n-ajv@^5.2.0, ajv@^5.2.3:\n+ajv@^5.2.3:\nversion \"5.2.3\"\nresolved \"https://registry.yarnpkg.com/ajv/-/ajv-5.2.3.tgz#c06f598778c44c6b161abafe3466b81ad1814ed2\"\ndependencies:\n@@ -226,6 +226,15 @@ ajv@^5.2.0, ajv@^5.2.3:\njson-schema-traverse \"^0.3.0\"\njson-stable-stringify \"^1.0.1\"\n+ajv@^5.3.0:\n+ version \"5.5.2\"\n+ resolved \"https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965\"\n+ dependencies:\n+ co \"^4.6.0\"\n+ fast-deep-equal \"^1.0.0\"\n+ fast-json-stable-stringify \"^2.0.0\"\n+ json-schema-traverse \"^0.3.0\"\n+\nalign-text@^0.1.1, align-text@^0.1.3:\nversion \"0.1.4\"\nresolved \"https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117\"\n@@ -1362,7 +1371,7 @@ debug@^2.1.1, debug@^2.2.0, debug@^2.4.5, debug@^2.6.8:\ndependencies:\nms \"2.0.0\"\n-debug@^3.0.1, debug@^3.1.0:\n+debug@^3.1.0:\nversion \"3.1.0\"\nresolved \"https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261\"\ndependencies:\n@@ -1474,12 +1483,11 @@ diff@^3.1.0:\nversion \"3.4.0\"\nresolved \"https://registry.yarnpkg.com/diff/-/diff-3.4.0.tgz#b1d85507daf3964828de54b37d0d73ba67dda56c\"\n-doctrine@^2.0.0:\n- version \"2.0.0\"\n- resolved \"https://registry.yarnpkg.com/doctrine/-/doctrine-2.0.0.tgz#c73d8d2909d22291e1a007a395804da8b665fe63\"\n+doctrine@^2.1.0:\n+ version \"2.1.0\"\n+ resolved \"https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d\"\ndependencies:\nesutils \"^2.0.2\"\n- isarray \"^1.0.0\"\ndot-prop@^3.0.0:\nversion \"3.0.0\"\n@@ -1565,32 +1573,36 @@ eslint-scope@^3.7.1:\nesrecurse \"^4.1.0\"\nestraverse \"^4.1.1\"\n-eslint@^4.8.0:\n- version \"4.8.0\"\n- resolved \"https://registry.yarnpkg.com/eslint/-/eslint-4.8.0.tgz#229ef0e354e0e61d837c7a80fdfba825e199815e\"\n+eslint-visitor-keys@^1.0.0:\n+ version \"1.0.0\"\n+ resolved \"https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d\"\n+\n+eslint@^4.19.1:\n+ version \"4.19.1\"\n+ resolved \"https://registry.yarnpkg.com/eslint/-/eslint-4.19.1.tgz#32d1d653e1d90408854bfb296f076ec7e186a300\"\ndependencies:\n- ajv \"^5.2.0\"\n+ ajv \"^5.3.0\"\nbabel-code-frame \"^6.22.0\"\nchalk \"^2.1.0\"\nconcat-stream \"^1.6.0\"\ncross-spawn \"^5.1.0\"\n- debug \"^3.0.1\"\n- doctrine \"^2.0.0\"\n+ debug \"^3.1.0\"\n+ doctrine \"^2.1.0\"\neslint-scope \"^3.7.1\"\n- espree \"^3.5.1\"\n+ eslint-visitor-keys \"^1.0.0\"\n+ espree \"^3.5.4\"\nesquery \"^1.0.0\"\n- estraverse \"^4.2.0\"\nesutils \"^2.0.2\"\nfile-entry-cache \"^2.0.0\"\nfunctional-red-black-tree \"^1.0.1\"\nglob \"^7.1.2\"\n- globals \"^9.17.0\"\n+ globals \"^11.0.1\"\nignore \"^3.3.3\"\nimurmurhash \"^0.1.4\"\ninquirer \"^3.0.6\"\nis-resolvable \"^1.0.0\"\njs-yaml \"^3.9.1\"\n- json-stable-stringify \"^1.0.1\"\n+ json-stable-stringify-without-jsonify \"^1.0.1\"\nlevn \"^0.3.0\"\nlodash \"^4.17.4\"\nminimatch \"^3.0.2\"\n@@ -1600,18 +1612,19 @@ eslint@^4.8.0:\npath-is-inside \"^1.0.2\"\npluralize \"^7.0.0\"\nprogress \"^2.0.0\"\n+ regexpp \"^1.0.1\"\nrequire-uncached \"^1.0.3\"\nsemver \"^5.3.0\"\nstrip-ansi \"^4.0.0\"\nstrip-json-comments \"~2.0.1\"\n- table \"^4.0.1\"\n+ table \"4.0.2\"\ntext-table \"~0.2.0\"\n-espree@^3.5.1:\n- version \"3.5.1\"\n- resolved \"https://registry.yarnpkg.com/espree/-/espree-3.5.1.tgz#0c988b8ab46db53100a1954ae4ba995ddd27d87e\"\n+espree@^3.5.4:\n+ version \"3.5.4\"\n+ resolved \"https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7\"\ndependencies:\n- acorn \"^5.1.1\"\n+ acorn \"^5.5.0\"\nacorn-jsx \"^3.0.0\"\nesprima@^2.6.0, esprima@^2.7.1:\n@@ -1639,7 +1652,7 @@ estraverse@^1.9.1:\nversion \"1.9.3\"\nresolved \"https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44\"\n-estraverse@^4.0.0, estraverse@^4.1.1, estraverse@^4.2.0:\n+estraverse@^4.0.0, estraverse@^4.1.1:\nversion \"4.2.0\"\nresolved \"https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13\"\n@@ -1788,6 +1801,10 @@ fast-deep-equal@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff\"\n+fast-json-stable-stringify@^2.0.0:\n+ version \"2.0.0\"\n+ resolved \"https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2\"\n+\nfast-levenshtein@~2.0.4:\nversion \"2.0.5\"\nresolved \"https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.5.tgz#bd33145744519ab1c36c3ee9f31f08e9079b67f2\"\n@@ -2192,11 +2209,15 @@ global-prefix@^0.1.4:\nosenv \"^0.1.3\"\nwhich \"^1.2.10\"\n+globals@^11.0.1:\n+ version \"11.4.0\"\n+ resolved \"https://registry.yarnpkg.com/globals/-/globals-11.4.0.tgz#b85c793349561c16076a3c13549238a27945f1bc\"\n+\nglobals@^8.3.0:\nversion \"8.18.0\"\nresolved \"https://registry.yarnpkg.com/globals/-/globals-8.18.0.tgz#93d4a62bdcac38cfafafc47d6b034768cb0ffcb4\"\n-globals@^9.17.0, globals@^9.18.0:\n+globals@^9.18.0:\nversion \"9.18.0\"\nresolved \"https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a\"\n@@ -2806,7 +2827,7 @@ isarray@0.0.1:\nversion \"0.0.1\"\nresolved \"https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf\"\n-isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0:\n+isarray@1.0.0, isarray@~1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11\"\n@@ -2970,6 +2991,10 @@ json-schema@0.2.3:\nversion \"0.2.3\"\nresolved \"https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13\"\n+json-stable-stringify-without-jsonify@^1.0.1:\n+ version \"1.0.1\"\n+ resolved \"https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651\"\n+\njson-stable-stringify@^1.0.1:\nversion \"1.0.1\"\nresolved \"https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af\"\n@@ -4180,6 +4205,10 @@ regex-not@^1.0.0, regex-not@^1.0.2:\nextend-shallow \"^3.0.2\"\nsafe-regex \"^1.1.0\"\n+regexpp@^1.0.1:\n+ version \"1.1.0\"\n+ resolved \"https://registry.yarnpkg.com/regexpp/-/regexpp-1.1.0.tgz#0e3516dd0b7904f413d2d4193dce4618c3a689ab\"\n+\nregistry-auth-token@^3.0.1:\nversion \"3.1.0\"\nresolved \"https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.1.0.tgz#997c08256e0c7999837b90e944db39d8a790276b\"\n@@ -4796,7 +4825,7 @@ symbol-tree@^3.2.1:\nversion \"3.2.2\"\nresolved \"https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6\"\n-table@^4.0.1:\n+table@4.0.2:\nversion \"4.0.2\"\nresolved \"https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36\"\ndependencies:\n",
"new_path": "yarn.lock",
"old_path": "yarn.lock"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
core(tsc): add type checking to asset-saver (#4949)
| 1
|
core
|
tsc
|
791,690
|
10.04.2018 17:15:18
| 25,200
|
ff4f111c73d96d86d69ddec18f942343d6d18e62
|
core: de-dupe URLs in is-on-http, uses-http2
|
[
{
"change_type": "MODIFY",
"diff": "@@ -35,13 +35,13 @@ module.exports = [\nextendedInfo: {\nvalue: {\nresults: {\n- length: 18,\n+ length: 17,\n},\n},\n},\ndetails: {\nitems: {\n- length: 18,\n+ length: 17,\n},\n},\n},\n",
"new_path": "lighthouse-cli/test/smokehouse/dobetterweb/dbw-expectations.js",
"old_path": "lighthouse-cli/test/smokehouse/dobetterweb/dbw-expectations.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -39,6 +39,7 @@ class UsesHTTP2Audit extends Audit {\nreturn artifacts.requestNetworkRecords(devtoolsLogs).then(networkRecords => {\nconst finalHost = new URL(artifacts.URL.finalUrl).host;\n+ const seenURLs = new Set();\n// Filter requests that are on the same host as the page and not over h2.\nconst resources = networkRecords.filter(record => {\n// test the protocol first to avoid (potentially) expensive URL parsing\n@@ -49,8 +50,12 @@ class UsesHTTP2Audit extends Audit {\n}).map(record => {\nreturn {\nprotocol: record.protocol,\n- url: record.url, // .url is a getter and not copied over for the assign.\n+ url: record._url,\n};\n+ }).filter(record => {\n+ if (seenURLs.has(record.url)) return false;\n+ seenURLs.add(record.url);\n+ return true;\n});\nlet displayValue = '';\n",
"new_path": "lighthouse-core/audits/dobetterweb/uses-http2.js",
"old_path": "lighthouse-core/audits/dobetterweb/uses-http2.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -47,30 +47,28 @@ class HTTPS extends Audit {\nstatic audit(artifacts) {\nconst devtoolsLogs = artifacts.devtoolsLogs[Audit.DEFAULT_PASS];\nreturn artifacts.requestNetworkRecords(devtoolsLogs).then(networkRecords => {\n- const insecureRecords = networkRecords\n+ const insecureURLs = networkRecords\n.filter(record => !HTTPS.isSecureRecord(record))\n- .map(record => ({url: URL.elideDataURI(record.url)}));\n+ .map(record => URL.elideDataURI(record.url));\nlet displayValue = '';\n- if (insecureRecords.length > 1) {\n- displayValue = `${Util.formatNumber(insecureRecords.length)} insecure requests found`;\n- } else if (insecureRecords.length === 1) {\n- displayValue = `${insecureRecords.length} insecure request found`;\n+ if (insecureURLs.length > 1) {\n+ displayValue = `${Util.formatNumber(insecureURLs.length)} insecure requests found`;\n+ } else if (insecureURLs.length === 1) {\n+ displayValue = `${insecureURLs.length} insecure request found`;\n}\n- const items = insecureRecords.map(record => ({\n- url: record.url,\n- }));\n+ const items = Array.from(new Set(insecureURLs)).map(url => ({url}));\nconst headings = [\n{key: 'url', itemType: 'url', text: 'Insecure URL'},\n];\nreturn {\n- rawValue: insecureRecords.length === 0,\n+ rawValue: items.length === 0,\ndisplayValue,\nextendedInfo: {\n- value: insecureRecords,\n+ value: items,\n},\ndetails: Audit.makeTableDetails(headings, items),\n};\n",
"new_path": "lighthouse-core/audits/is-on-https.js",
"old_path": "lighthouse-core/audits/is-on-https.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -22,8 +22,9 @@ describe('Resources are fetched over http/2', () => {\nrequestNetworkRecords: () => Promise.resolve(networkRecords),\n}).then(auditResult => {\nassert.equal(auditResult.rawValue, false);\n- assert.ok(auditResult.displayValue.match('4 requests were not'));\n- assert.equal(auditResult.details.items.length, 4);\n+ assert.ok(auditResult.displayValue.match('3 requests were not'));\n+ assert.equal(auditResult.details.items.length, 3);\n+ assert.equal(auditResult.details.items[0].url, 'https://webtide.com/wp-content/plugins/wp-pagenavi/pagenavi-css.css?ver=2.70');\nconst headers = auditResult.details.headings;\nassert.equal(headers[0].text, 'URL', 'table headings are correct and in order');\nassert.equal(headers[1].text, 'Protocol', 'table headings are correct and in order');\n",
"new_path": "lighthouse-core/test/audits/dobetterweb/uses-http2-test.js",
"old_path": "lighthouse-core/test/audits/dobetterweb/uses-http2-test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -22,6 +22,7 @@ describe('Security: HTTPS audit', () => {\nreturn Audit.audit(getArtifacts([\n{url: 'https://google.com/', scheme: 'https', domain: 'google.com'},\n{url: 'http://insecure.com/image.jpeg', scheme: 'http', domain: 'insecure.com'},\n+ {url: 'http://insecure.com/image.jpeg', scheme: 'http', domain: 'insecure.com'}, // should be de-duped\n{url: 'http://insecure.com/image2.jpeg', scheme: 'http', domain: 'insecure.com'},\n{url: 'https://google.com/', scheme: 'https', domain: 'google.com'},\n])).then(result => {\n",
"new_path": "lighthouse-core/test/audits/is-on-https-test.js",
"old_path": "lighthouse-core/test/audits/is-on-https-test.js"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
core: de-dupe URLs in is-on-http, uses-http2 (#4950)
| 1
|
core
| null |
679,913
|
10.04.2018 18:09:20
| -3,600
|
10c089a37221eae104b90261f940025f9e9932b9
|
feat(dcons): add IEmpty impl, minor refactoring
add empty()
add clear()
remove obsolete `public` method prefixes
|
[
{
"change_type": "MODIFY",
"diff": "@@ -13,13 +13,14 @@ export interface ConsCell<T> {\nexport class DCons<T> implements\napi.ICompare<DCons<T>>,\napi.ICopy<DCons<T>>,\n+ api.IEmpty<DCons<T>>,\napi.IEquiv,\napi.ILength,\napi.IRelease,\napi.IStack<T, DCons<T>> {\n- public head: ConsCell<T>;\n- public tail: ConsCell<T>;\n+ head: ConsCell<T>;\n+ tail: ConsCell<T>;\nprotected _length: number = 0;\nconstructor(src?: Iterable<T>) {\n@@ -28,15 +29,23 @@ export class DCons<T> implements\n}\n}\n- public get length() {\n+ get length() {\nreturn this._length;\n}\n- public copy() {\n- return new DCons(this);\n+ copy() {\n+ return new DCons<T>(this);\n}\n- public release() {\n+ empty() {\n+ return new DCons<T>();\n+ }\n+\n+ clear() {\n+ this.release();\n+ }\n+\n+ release() {\nlet cell = this.head, next;\nwhile (cell) {\nnext = cell.next;\n@@ -51,7 +60,7 @@ export class DCons<T> implements\nreturn true;\n}\n- public compare(o: DCons<T>) {\n+ compare(o: DCons<T>) {\nif (this._length < o._length) {\nreturn -1;\n} else if (this._length > o._length) {\n@@ -69,7 +78,7 @@ export class DCons<T> implements\n}\n}\n- public equiv(o: any) {\n+ equiv(o: any) {\nif ((o instanceof DCons || isArrayLike(o)) && this._length === o.length) {\nlet cell = this.head;\nfor (let x of <any>o) {\n@@ -83,7 +92,7 @@ export class DCons<T> implements\nreturn false;\n}\n- public *[Symbol.iterator]() {\n+ *[Symbol.iterator]() {\nlet cell = this.head;\nwhile (cell) {\nyield cell.value;\n@@ -91,13 +100,13 @@ export class DCons<T> implements\n}\n}\n- public *cycle() {\n+ *cycle() {\nwhile (true) {\nyield* this;\n}\n}\n- public drop() {\n+ drop() {\nconst cell = this.head;\nif (cell) {\nthis.head = cell.next;\n@@ -111,7 +120,7 @@ export class DCons<T> implements\n}\n}\n- public cons(value: T): DCons<T> {\n+ cons(value: T): DCons<T> {\nconst cell = <ConsCell<T>>{ value, next: this.head };\nif (this.head) {\nthis.head.prev = cell;\n@@ -123,7 +132,7 @@ export class DCons<T> implements\nreturn this;\n}\n- public insertBefore(cell: ConsCell<T>, value: T): DCons<T> {\n+ insertBefore(cell: ConsCell<T>, value: T): DCons<T> {\nif (!cell) {\nillegalArgs(\"cell is undefined\");\n}\n@@ -138,7 +147,7 @@ export class DCons<T> implements\nreturn this;\n}\n- public insertAfter(cell: ConsCell<T>, value: T): DCons<T> {\n+ insertAfter(cell: ConsCell<T>, value: T): DCons<T> {\nif (!cell) {\nillegalArgs(\"cell is undefined\");\n}\n@@ -153,7 +162,7 @@ export class DCons<T> implements\nreturn this;\n}\n- public insertBeforeNth(n: number, x: T) {\n+ insertBeforeNth(n: number, x: T) {\nif (n < 0) {\nn += this._length;\n}\n@@ -164,7 +173,7 @@ export class DCons<T> implements\n}\n}\n- public insertAfterNth(n: number, x: T) {\n+ insertAfterNth(n: number, x: T) {\nif (n < 0) {\nn += this._length;\n}\n@@ -175,7 +184,7 @@ export class DCons<T> implements\n}\n}\n- public insertSorted(value: T, cmp?: api.Comparator<T>) {\n+ insertSorted(value: T, cmp?: api.Comparator<T>) {\ncmp = cmp || compare;\nlet cell = this.head;\nwhile (cell) {\n@@ -187,7 +196,7 @@ export class DCons<T> implements\nreturn this.push(value);\n}\n- public find(value: T) {\n+ find(value: T) {\nlet cell = this.head;\nwhile (cell) {\nif (cell.value === value) {\n@@ -197,7 +206,7 @@ export class DCons<T> implements\n}\n}\n- public findWith(fn: api.Predicate<T>) {\n+ findWith(fn: api.Predicate<T>) {\nlet cell = this.head;\nwhile (cell) {\nif (fn(cell.value)) {\n@@ -207,7 +216,7 @@ export class DCons<T> implements\n}\n}\n- public concat(...slices: Iterable<T>[]) {\n+ concat(...slices: Iterable<T>[]) {\nconst res = this.copy();\nfor (let slice of slices) {\nres.into(slice);\n@@ -215,13 +224,13 @@ export class DCons<T> implements\nreturn res;\n}\n- public into(src: Iterable<T>) {\n+ into(src: Iterable<T>) {\nfor (let x of src) {\nthis.push(x);\n}\n}\n- public slice(from = 0, to = this.length) {\n+ slice(from = 0, to = this.length) {\nlet a = from < 0 ? from + this._length : from;\nlet b = to < 0 ? to + this._length : to;\nif (a < 0 || b < 0) {\n@@ -236,7 +245,7 @@ export class DCons<T> implements\nreturn res;\n}\n- public splice(at: ConsCell<T> | number, del = 0, insert?: Iterable<T>): DCons<T> {\n+ splice(at: ConsCell<T> | number, del = 0, insert?: Iterable<T>): DCons<T> {\nlet cell: ConsCell<T>;\nif (typeof at === \"number\") {\nif (at < 0) {\n@@ -270,7 +279,7 @@ export class DCons<T> implements\nreturn res;\n}\n- public remove(cell: ConsCell<T>) {\n+ remove(cell: ConsCell<T>) {\nif (cell.prev) {\ncell.prev.next = cell.next;\n} else {\n@@ -285,7 +294,7 @@ export class DCons<T> implements\nreturn this;\n}\n- public swap(a: ConsCell<T>, b: ConsCell<T>): DCons<T> {\n+ swap(a: ConsCell<T>, b: ConsCell<T>): DCons<T> {\nif (a !== b) {\nconst t = a.value;\na.value = b.value;\n@@ -294,7 +303,7 @@ export class DCons<T> implements\nreturn this;\n}\n- public push(value: T): DCons<T> {\n+ push(value: T): DCons<T> {\nif (this.tail) {\nconst cell = <ConsCell<T>>{ value, prev: this.tail };\nthis.tail.next = cell;\n@@ -306,7 +315,7 @@ export class DCons<T> implements\n}\n}\n- public pop(): DCons<T> {\n+ pop(): DCons<T> {\nconst cell = this.tail;\nif (cell) {\nthis.tail = cell.prev;\n@@ -322,15 +331,15 @@ export class DCons<T> implements\nreturn this;\n}\n- public first() {\n+ first() {\nreturn this.head ? this.head.value : undefined;\n}\n- public peek() {\n+ peek() {\nreturn this.tail ? this.tail.value : undefined;\n}\n- public setHead(v: T) {\n+ setHead(v: T) {\nif (this.head) {\nthis.head.value = v;\nreturn this;\n@@ -338,7 +347,7 @@ export class DCons<T> implements\nreturn this.cons(v);\n}\n- public setTail(v: T) {\n+ setTail(v: T) {\nif (this.tail) {\nthis.tail.value = v;\nreturn this;\n@@ -346,7 +355,7 @@ export class DCons<T> implements\nreturn this.push(v);\n}\n- public setNth(n: number, v: T) {\n+ setNth(n: number, v: T) {\nconst cell = this.nthCell(n);\nif (!cell) {\nillegalArgs(`index out of bounds: ${n}`);\n@@ -355,12 +364,12 @@ export class DCons<T> implements\nreturn this;\n}\n- public nth(n: number, notFound?: T) {\n+ nth(n: number, notFound?: T) {\nconst cell = this.nthCell(n);\nreturn cell ? cell.value : notFound;\n}\n- public nthCell(n: number) {\n+ nthCell(n: number) {\nif (n < 0) {\nn += this._length;\n}\n@@ -382,7 +391,7 @@ export class DCons<T> implements\nreturn cell;\n}\n- public rotateLeft() {\n+ rotateLeft() {\nswitch (this._length) {\ncase 0:\ncase 1:\n@@ -394,7 +403,7 @@ export class DCons<T> implements\n}\n}\n- public rotateRight() {\n+ rotateRight() {\nswitch (this._length) {\ncase 0:\ncase 1:\n@@ -407,7 +416,7 @@ export class DCons<T> implements\n}\n}\n- public map<R>(fn: (x: T) => R) {\n+ map<R>(fn: (x: T) => R) {\nconst res = new DCons<R>();\nlet cell = this.head;\nwhile (cell) {\n@@ -417,7 +426,7 @@ export class DCons<T> implements\nreturn res;\n}\n- public filter(pred: api.Predicate<T>) {\n+ filter(pred: api.Predicate<T>) {\nconst res = new DCons<T>();\nlet cell = this.head;\nwhile (cell) {\n@@ -427,7 +436,7 @@ export class DCons<T> implements\nreturn res;\n}\n- public reduce<R>(rfn: (acc: R, x: T) => R, initial: R) {\n+ reduce<R>(rfn: (acc: R, x: T) => R, initial: R) {\nlet acc: R = initial;\nlet cell = this.head;\nwhile (cell) {\n@@ -438,7 +447,7 @@ export class DCons<T> implements\nreturn acc;\n}\n- public shuffle() {\n+ shuffle() {\nlet n = this._length;\nlet cell = this.tail;\nwhile (n > 0) {\n@@ -450,7 +459,7 @@ export class DCons<T> implements\nreturn this;\n}\n- public reverse() {\n+ reverse() {\nlet head = this.head;\nlet tail = this.tail;\nlet n = (this._length >>> 1) + (this._length & 1);\n@@ -465,7 +474,7 @@ export class DCons<T> implements\nreturn this;\n}\n- public toString() {\n+ toString() {\nlet res: any = [];\nlet cell = this.head;\nwhile (cell) {\n@@ -477,7 +486,7 @@ export class DCons<T> implements\nreturn res.join(\", \");\n}\n- public toJSON() {\n+ toJSON() {\nreturn [...this];\n}\n}\n",
"new_path": "packages/dcons/src/index.ts",
"old_path": "packages/dcons/src/index.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(dcons): add IEmpty impl, minor refactoring
- add empty()
- add clear()
- remove obsolete `public` method prefixes
| 1
|
feat
|
dcons
|
679,913
|
10.04.2018 21:12:31
| -3,600
|
e086be6b06d4e205104c5c14eefbbfcf9924f75a
|
feat(dgraph): re-import DGraph impl & tests, update readme
|
[
{
"change_type": "MODIFY",
"diff": "## About\n-Nothing to see here yet. Pls ignore for now.\n+Type-agnostic directed acyclic graph (DAG), using\n+[@thi.ng/associative](https://github.com/thi-ng/umbrella/tree/master/packages/associative)\n+maps & sets as backend.\n-TODO...\n+### Features\n+\n+- cycle detection\n+- accessors for direct & transitive dependencies / dependents\n+- topological sorting\n+- iterable\n## Installation\n@@ -17,7 +24,15 @@ yarn add @thi.ng/dgraph\n## Usage examples\n```typescript\n-import * as dgraph from \"@thi.ng/dgraph\";\n+import { DGraph } from \"@thi.ng/dgraph\";\n+\n+g = new DGraph();\n+g.addDependency([1, 2], [10, 20]);\n+g.addDependency([3, 4], [30, 40]);\n+g.addDependency([1, 2], [3, 4]);\n+\n+g.sort()\n+// [[30, 40], [3, 4], [10, 20], [1, 2]]\n```\n## Authors\n",
"new_path": "packages/dgraph/README.md",
"old_path": "packages/dgraph/README.md"
},
{
"change_type": "MODIFY",
"diff": "\"typescript\": \"^2.8.1\"\n},\n\"dependencies\": {\n- \"@thi.ng/api\": \"^2.2.0\"\n+ \"@thi.ng/api\": \"^2.2.0\",\n+ \"@thi.ng/associative\": \"^0.0.1\",\n+ \"@thi.ng/iterators\": \"^4.1.4\"\n},\n\"keywords\": [\n\"ES6\",\n",
"new_path": "packages/dgraph/package.json",
"old_path": "packages/dgraph/package.json"
},
{
"change_type": "MODIFY",
"diff": "-// TODO stub only\n-export class DGraph { }\n+import { ICopy } from \"@thi.ng/api/api\";\n+import { equiv } from \"@thi.ng/api/equiv\";\n+import { illegalArgs } from \"@thi.ng/api/error\";\n+import { EquivMap } from \"@thi.ng/associative/equiv-map\";\n+import { EquivSet } from \"@thi.ng/associative/equiv-set\";\n+import { union } from \"@thi.ng/associative/union\";\n+import { filter } from \"@thi.ng/iterators/filter\";\n+import { reduce } from \"@thi.ng/iterators/reduce\";\n+\n+export class DGraph<T> implements\n+ Iterable<T>,\n+ ICopy<DGraph<T>> {\n+\n+ dependencies: EquivMap<T, EquivSet<T>>;\n+ dependents: EquivMap<T, EquivSet<T>>;\n+\n+ constructor() {\n+ this.dependencies = new EquivMap<T, EquivSet<T>>();\n+ this.dependents = new EquivMap<T, EquivSet<T>>();\n+ }\n+\n+ *[Symbol.iterator]() {\n+ yield* this.sort();\n+ }\n+\n+ get [Symbol.species]() {\n+ return DGraph;\n+ }\n+\n+ copy() {\n+ const g = new DGraph<T>();\n+ for (let e of this.dependencies) {\n+ g.dependencies.set(e[0], e[1].copy());\n+ }\n+ for (let e of this.dependents) {\n+ g.dependents.set(e[0], e[1].copy());\n+ }\n+ return g;\n+ }\n+\n+ addDependency(node: T, dep: T) {\n+ if (equiv(node, dep) || this.depends(dep, node)) {\n+ illegalArgs(`Circular dependency between: ${node} & ${dep}`);\n+ }\n+ let d: EquivSet<T> = this.dependencies.get(node);\n+ this.dependencies.set(node, d ? d.add(dep) : new EquivSet<T>([dep]));\n+ d = this.dependents.get(dep);\n+ this.dependents.set(dep, d ? d.add(node) : new EquivSet<T>([node]));\n+ return this;\n+ }\n+\n+ removeEdge(node: T, dep: T) {\n+ let d = this.dependencies.get(node);\n+ if (d) {\n+ d.delete(dep);\n+ }\n+ d = this.dependents.get(dep);\n+ if (d) {\n+ d.delete(node);\n+ }\n+ return this;\n+ }\n+\n+ removeNode(x: T) {\n+ this.dependencies.delete(x);\n+ return this;\n+ }\n+\n+ depends(x: T, y: T) {\n+ return this.transitiveDependencies(x).has(y);\n+ }\n+\n+ dependent(x: T, y: T) {\n+ return this.transitiveDependents(x).has(y);\n+ }\n+\n+ immediateDependencies(x: T): Set<T> {\n+ return this.dependencies.get(x) || new EquivSet<T>();\n+ }\n+\n+ immediateDependents(x: T): Set<T> {\n+ return this.dependents.get(x) || new EquivSet<T>();\n+ }\n+\n+ isLeaf(x: T) {\n+ return this.immediateDependents(x).size === 0;\n+ }\n+\n+ isRoot(x: T) {\n+ return this.immediateDependencies(x).size === 0;\n+ }\n+\n+ nodes(): Set<T> {\n+ return union(\n+ new EquivSet<T>(this.dependencies.keys()),\n+ new EquivSet<T>(this.dependents.keys()),\n+ );\n+ }\n+\n+ transitiveDependencies(x: T) {\n+ return transitive(this.dependencies, x);\n+ }\n+\n+ transitiveDependents(x: T) {\n+ return transitive(this.dependents, x);\n+ }\n+\n+ sort() {\n+ const sorted: T[] = [];\n+ const g = this.copy();\n+ let queue = new EquivSet(filter((node: T) => g.isLeaf(node), g.nodes()));\n+ while (true) {\n+ if (!queue.size) {\n+ return sorted.reverse();\n+ }\n+ const node = queue.first();\n+ queue.delete(node);\n+ for (let d of (<EquivSet<T>>g.immediateDependencies(node)).copy()) {\n+ g.removeEdge(node, d);\n+ if (g.isLeaf(d)) {\n+ queue.add(d);\n+ }\n+ }\n+ sorted.push(node);\n+ g.removeNode(node);\n+ }\n+ }\n+}\n+\n+function transitive<T>(nodes: EquivMap<T, EquivSet<T>>, x: T): EquivSet<T> {\n+ const deps: EquivSet<T> = nodes.get(x);\n+ if (deps) {\n+ return reduce(\n+ (acc, k: T) => <EquivSet<T>>union(acc, transitive(nodes, k)),\n+ deps,\n+ deps\n+ );\n+ }\n+ return new EquivSet<T>();\n+}\n",
"new_path": "packages/dgraph/src/index.ts",
"old_path": "packages/dgraph/src/index.ts"
},
{
"change_type": "MODIFY",
"diff": "-// import * as assert from \"assert\";\n-// import * as dgraph from \"../src/index\";\n+import * as assert from \"assert\";\n+\n+import { DGraph } from \"../src/index\";\ndescribe(\"dgraph\", () => {\n- it(\"tests pending\");\n+\n+ let g: DGraph<any>;\n+\n+ beforeEach(() => {\n+ g = new DGraph();\n+ g.addDependency([1, 2], [10, 20]);\n+ g.addDependency([3, 4], [30, 40]);\n+ g.addDependency([1, 2], [3, 4]);\n+ });\n+\n+ it(\"depends\", () => {\n+ assert(g.depends([1, 2], [10, 20]));\n+ assert(!g.depends([10, 20], [1, 2]));\n+ });\n+\n+ it(\"dependent\", () => {\n+ assert(g.dependent([10, 20], [1, 2]));\n+ assert(!g.dependent([1, 2], [10, 20]));\n+ });\n+\n+ it(\"isLeaf\", () => {\n+ assert(g.isLeaf([1, 2]));\n+ assert(!g.isLeaf([10, 20]));\n+ assert(!g.isLeaf([3, 4]));\n+ });\n+\n+ it(\"isRoot\", () => {\n+ assert(g.isRoot([10, 20]));\n+ assert(g.isRoot([30, 40]));\n+ assert(!g.isRoot([3, 4]));\n+ });\n+\n+ it(\"cyclic\", () => {\n+ assert.throws(() => g.addDependency([10, 20], [1, 2]));\n+ assert.throws(() => g.addDependency([1, 2], [1, 2]));\n+ });\n+\n+ it(\"sort\", () => {\n+ assert.deepEqual(g.sort(), [[30, 40], [3, 4], [10, 20], [1, 2]]);\n+ g.addDependency([30, 40], [50, 60]);\n+ assert.deepEqual(g.sort(), [[50, 60], [30, 40], [3, 4], [10, 20], [1, 2]]);\n+ });\n+\n+ it(\"iterator\", () => {\n+ assert.deepEqual([...g], [[30, 40], [3, 4], [10, 20], [1, 2]]);\n+ assert.deepEqual([...g], [[30, 40], [3, 4], [10, 20], [1, 2]]);\n+ });\n});\n",
"new_path": "packages/dgraph/test/index.ts",
"old_path": "packages/dgraph/test/index.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(dgraph): re-import DGraph impl & tests, update readme
| 1
|
feat
|
dgraph
|
679,913
|
10.04.2018 21:13:03
| -3,600
|
0dc9f646a3d1deaf300660bb24965819f1635304
|
feat(associative): add EquivSet.first()
|
[
{
"change_type": "MODIFY",
"diff": "@@ -58,6 +58,12 @@ export class EquivSet<T> extends Set<T> implements\nthis._vals.clear();\n}\n+ first() {\n+ if (this.size) {\n+ return this._vals.head.value;\n+ }\n+ }\n+\nadd(x: T) {\n!this.has(x) && this._vals.push(x);\nreturn this;\n",
"new_path": "packages/associative/src/equiv-set.ts",
"old_path": "packages/associative/src/equiv-set.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(associative): add EquivSet.first()
| 1
|
feat
|
associative
|
679,913
|
10.04.2018 21:20:42
| -3,600
|
371cd42fd66e4fb000f0b806f83a880780e50e79
|
build(associative): update deps (dcons)
|
[
{
"change_type": "MODIFY",
"diff": "\"typescript\": \"^2.8.1\"\n},\n\"dependencies\": {\n- \"@thi.ng/api\": \"^2.1.0\"\n+ \"@thi.ng/api\": \"^2.1.0\",\n+ \"@thi.ng/dcons\": \"^0.1.19\"\n},\n\"keywords\": [\n\"ES6\",\n",
"new_path": "packages/associative/package.json",
"old_path": "packages/associative/package.json"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
build(associative): update deps (dcons)
| 1
|
build
|
associative
|
679,913
|
10.04.2018 21:24:55
| -3,600
|
e7a5c93e91b1a1dbb2fca79f2de3ede94561c753
|
build(associative): update package desc
|
[
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@thi.ng/associative\",\n\"version\": \"0.0.1\",\n- \"description\": \"TODO\",\n+ \"description\": \"Alternative Set & Map data type implementations with customizable equality semantics & supporting operations\",\n\"main\": \"./index.js\",\n\"typings\": \"./index.d.ts\",\n\"repository\": \"https://github.com/thi-ng/umbrella\",\n\"@thi.ng/dcons\": \"^0.1.19\"\n},\n\"keywords\": [\n+ \"data structures\",\n+ \"difference\",\n+ \"equality\",\n\"ES6\",\n- \"sets\",\n- \"typescript\"\n+ \"intersection\",\n+ \"join\",\n+ \"map\",\n+ \"set\",\n+ \"typescript\",\n+ \"union\"\n],\n\"publishConfig\": {\n\"access\": \"public\"\n",
"new_path": "packages/associative/package.json",
"old_path": "packages/associative/package.json"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
build(associative): update package desc
| 1
|
build
|
associative
|
679,913
|
10.04.2018 21:26:28
| -3,600
|
efe606e16923de30c13271ab7ef4ebadf6c8b757
|
build(dgraph): update package desc
|
[
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@thi.ng/dgraph\",\n\"version\": \"0.0.3\",\n- \"description\": \"TODO\",\n+ \"description\": \"Type-agnostic directed acyclic graph (DAG) & graph operations\",\n\"main\": \"./index.js\",\n\"typings\": \"./index.d.ts\",\n\"repository\": \"https://github.com/thi-ng/umbrella\",\n\"@thi.ng/iterators\": \"^4.1.4\"\n},\n\"keywords\": [\n+ \"data structure\",\n+ \"dependencies\",\n+ \"DAG\",\n\"ES6\",\n+ \"graph\",\n\"typescript\"\n],\n\"publishConfig\": {\n",
"new_path": "packages/dgraph/package.json",
"old_path": "packages/dgraph/package.json"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
build(dgraph): update package desc
| 1
|
build
|
dgraph
|
679,913
|
10.04.2018 21:36:09
| -3,600
|
675847b88f92108fc766d47661eefb98b9fc46ba
|
fix(dgraph): update corrupted deps
|
[
{
"change_type": "MODIFY",
"diff": "},\n\"dependencies\": {\n\"@thi.ng/api\": \"^2.2.0\",\n- \"@thi.ng/associative\": \"^0.0.1\",\n+ \"@thi.ng/associative\": \"^0.2.0\",\n\"@thi.ng/iterators\": \"^4.1.5\"\n},\n\"keywords\": [\n",
"new_path": "packages/dgraph/package.json",
"old_path": "packages/dgraph/package.json"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
fix(dgraph): update corrupted deps
| 1
|
fix
|
dgraph
|
807,849
|
11.04.2018 12:04:13
| 25,200
|
b4af3c9ebac8f7b4c22a0966c03b7e4fcfaed155
|
fix(bootstrap): Pass npm-conf to feature predicate instead of directly reading process.env
|
[
{
"change_type": "MODIFY",
"diff": "@@ -23,6 +23,8 @@ const ValidationError = require(\"@lerna/validation-error\");\nconst isHoistedPackage = require(\"./lib/is-hoisted-package\");\nconst makeNpmFeaturePredicate = require(\"./lib/make-npm-feature-predicate\");\n+const hasNpmCI = makeNpmFeaturePredicate(\">=5.7.0\");\n+\nmodule.exports = factory;\nfunction factory(argv) {\n@@ -69,9 +71,7 @@ class BootstrapCommand extends Command {\nmutex,\n};\n- const hasNpmCI = makeNpmFeaturePredicate(\">=5.7.0\");\n-\n- if (npmClient === \"npm\" && this.options.ci && hasNpmCI()) {\n+ if (npmClient === \"npm\" && this.options.ci && hasNpmCI(this.conf)) {\nthis.npmConfig.subCommand = \"ci\";\n}\n",
"new_path": "commands/bootstrap/index.js",
"old_path": "commands/bootstrap/index.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,11 +5,11 @@ const semver = require(\"semver\");\nmodule.exports = makeNpmFeaturePredicate;\nfunction makeNpmFeaturePredicate(range) {\n- return () => Boolean(semver.satisfies(getNpmVersion(), range));\n+ return conf => Boolean(semver.satisfies(getNpmVersion(conf), range));\n}\n-function getNpmVersion() {\n- const userAgent = process.env.npm_config_user_agent;\n+function getNpmVersion(conf) {\n+ const userAgent = conf.get(\"user-agent\");\nreturn (/npm\\/(\\d+\\.\\d+\\.\\d+)/.exec(userAgent) || [\"\"]).pop();\n}\n",
"new_path": "commands/bootstrap/lib/make-npm-feature-predicate.js",
"old_path": "commands/bootstrap/lib/make-npm-feature-predicate.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
fix(bootstrap): Pass npm-conf to feature predicate instead of directly reading process.env
| 1
|
fix
|
bootstrap
|
815,745
|
11.04.2018 12:36:57
| -10,800
|
1fbfd24bb482b6edf2c3012b59b2dc5f9b6e193e
|
fix: sanitize options
|
[
{
"change_type": "MODIFY",
"diff": "@@ -28,7 +28,7 @@ import { distinctUntilChanged, debounceTime, switchMap } from 'rxjs/operators'\n<div *ngIf=\"item.name === 'Kaunas'\">{{item.name}}</div>\n<div class=\"card\" *ngIf=\"item.name !== 'Kaunas'\">\n<div class=\"card-body\">\n- <h5 class=\"card-title\" [innerHTML]=\"item.name\" [ngOptionHighlight]=\"search\"></h5>\n+ <h5 class=\"card-title\" [ngOptionHighlight]=\"search\">{{item.name}}</h5>\n<h6 class=\"card-subtitle mb-2 text-muted\">Card subtitle</h6>\n<p class=\"card-text\">\n<img height=\"15\" width=\"15\" [src]=\"item.avatar\"/>\n@@ -59,7 +59,7 @@ import { distinctUntilChanged, debounceTime, switchMap } from 'rxjs/operators'\nCity group logo <img height=\"15\" width=\"15\" [src]=\"item.avatar\"/>\n</ng-template>\n<ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\n- <b [innerHTML]=\"item.name\" [ngOptionHighlight]=\"search\"></b>\n+ <b [ngOptionHighlight]=\"search\">{{item.name}}</b>\n</ng-template>\n</ng-select>\n---\n",
"new_path": "demo/app/examples/custom-templates.component.ts",
"old_path": "demo/app/examples/custom-templates.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -65,12 +65,13 @@ import { Observable } from 'rxjs/Observable';\n<p>\nIf you have simple use case, you can omit items array and bind options directly in html using <b>ng-option</b> component.\n</p>\n- <button type=\"button\" class=\"btn btn-secondary btn-sm\" (click)=\"disable = !disable\">Toggle disabled</button>\n+ <button type=\"button\" class=\"btn btn-secondary btn-sm\" (click)=\"toggleDisabled()\">Toggle disabled</button>\n<hr/>\n---html,true\n<ng-select [searchable]=\"false\" [(ngModel)]=\"selectedCarId\">\n<ng-option *ngFor=\"let car of cars\" [value]=\"car.id\" [disabled]=\"car.disabled\" >{{car.name}}</ng-option>\n<ng-option [value]=\"'custom'\">Custom</ng-option>\n+ <ng-option [value]=\"'html'\"><b>BMW</b></ng-option>\n</ng-select>\n---\n<br />Selected car ID: {{selectedCarId | json}}\n@@ -101,6 +102,11 @@ export class DataSourceComponent {\nthis.dataService.getPeople().subscribe(items => this.people = items);\nthis.simpleItems = [true, 'Two', 3];\n}\n+\n+ toggleDisabled() {\n+ const car: any = this.cars[1];\n+ car.disabled = !car.disabled;\n+ }\n}\n",
"new_path": "demo/app/examples/data-source.component.ts",
"old_path": "demo/app/examples/data-source.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -86,7 +86,7 @@ import { delay } from 'rxjs/operators';\n[virtualScroll]=\"true\"\nformControlName=\"album\">\n<ng-template ng-option-tmp let-item=\"item\" let-search=\"searchTerm\">\n- <div><span>Title: </span><span [innerHTML]=\"item.title\" [ngOptionHighlight]=\"search\"></span></div>\n+ <div><span>Title: </span><span [ngOptionHighlight]=\"search\">{{item.title}}</span></div>\n<small><b>Id:</b> {{item.id}} | <b>UserId:</b> {{item.userId}}</small>\n</ng-template>\n</ng-select>\n@@ -114,7 +114,7 @@ import { delay } from 'rxjs/operators';\n</ng-template>\n<ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\n<img height=\"15\" width=\"15\" [src]=\"item.thumbnailUrl\"/>\n- <span [innerHTML]=\"item.title\" [ngOptionHighlight]=\"search\"></span>\n+ <span [ngOptionHighlight]=\"search\">{{item.title}}</span>\n</ng-template>\n</ng-select>\n<small class=\"form-text text-muted\">5000 items with virtual scroll</small>\n",
"new_path": "demo/app/examples/reactive-forms.component.ts",
"old_path": "demo/app/examples/reactive-forms.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,47 +5,44 @@ import { By } from '@angular/platform-browser';\n@Component({\ntemplate: `\n- <span id=\"test1\" [innerHTML]=\"'My text is highlighted'\" [ngOptionHighlight]=\"'is high'\"></span>\n- <span id=\"test2\" [innerHTML]=\"'My text is not highlighted'\" [ngOptionHighlight]=\"'test'\"></span>\n- <span id=\"test3\" [innerHTML]=\"'My text is rich'\"></span>\n+ <span id=\"test1\" [innerHtml]=\"'My text is highlighted'\" [ngOptionHighlight]=\"term\"></span>\n+ <span id=\"test2\" [innerHtml]=\"'My text is not highlighted'\" [ngOptionHighlight]=\"term\"></span>\n`\n})\nclass TestComponent {\n+ term: string;\n}\n-describe('NgOptionHighlightDirective', function () {\n+describe('NgOptionHighlightDirective', () => {\nlet fixture: ComponentFixture<TestComponent>;\nbeforeEach(() => {\nfixture = TestBed.configureTestingModule({\ndeclarations: [NgOptionHighlightDirective, TestComponent]\n- })\n- .createComponent(TestComponent);\n+ }).createComponent(TestComponent);\nfixture.detectChanges();\n});\nit('should have two elements with highlight directive', () => {\n- let highlightDirectives = fixture.debugElement.queryAll(By.directive(NgOptionHighlightDirective));\n+ const highlightDirectives = fixture.debugElement.queryAll(By.directive(NgOptionHighlightDirective));\nexpect(highlightDirectives.length).toBe(2);\n});\nit('should have one element with highlighted text when term matching', () => {\n- let span1 = fixture.debugElement.query(By.css('#test1'));\n- expect(span1.nativeElement.querySelector('.highlighted').innerHTML).toBe('is high');\n- expect(span1.nativeElement.textContent).toBe('My text is highlighted');\n+ const span = fixture.debugElement.query(By.css('#test1'));\n+ fixture.componentInstance.term = 'is high';\n+ fixture.detectChanges();\n+ expect(span.nativeElement.querySelector('.highlighted').innerHTML).toBe('is high');\n+ expect(span.nativeElement.textContent).toBe('My text is highlighted');\n});\nit('should have one element with no highlighted text when term not matching', () => {\n- let span2 = fixture.debugElement.query(By.css('#test2'));\n- expect(span2.nativeElement.querySelector('.highlighted')).toBeNull();\n- expect(span2.nativeElement.innerHTML).toBe('My text is not highlighted');\n- });\n-\n- it('should have one element with no highlighted text when no highlight directive', () => {\n- let span3 = fixture.debugElement.query(By.css('#test3'));\n- expect(span3.nativeElement.querySelector('.highlighted')).toBeNull();\n- expect(span3.nativeElement.innerHTML).toBe('My text is rich');\n+ const span = fixture.debugElement.query(By.css('#test2'));\n+ fixture.componentInstance.term = 'non matching';\n+ fixture.detectChanges();\n+ expect(span.nativeElement.querySelector('.highlighted')).toBeNull();\n+ expect(span.nativeElement.innerHTML).toBe('My text is not highlighted');\n});\n});\n",
"new_path": "src/ng-select/ng-option-highlight.directive.spec.ts",
"old_path": "src/ng-select/ng-option-highlight.directive.spec.ts"
},
{
"change_type": "MODIFY",
"diff": "import * as searchHelper from './search-helper';\nimport {\n+ AfterViewInit,\nDirective,\nElementRef,\nInput,\nOnChanges,\n- Renderer2\n+ Renderer2,\n+ SimpleChanges\n} from '@angular/core';\n+import { isDefined } from './value-utils';\n@Directive({\nselector: '[ngOptionHighlight]'\n})\n-export class NgOptionHighlightDirective implements OnChanges {\n+export class NgOptionHighlightDirective implements OnChanges, AfterViewInit {\n@Input('ngOptionHighlight') term: string;\n- @Input('innerHTML') label: any;\n- constructor(private elementRef: ElementRef, private renderer: Renderer2) { }\n+ private element: HTMLElement;\n+ private label: string;\n- ngOnChanges(): void {\n+ constructor(\n+ private elementRef: ElementRef,\n+ private renderer: Renderer2) {\n+ this.element = this.elementRef.nativeElement;\n+ }\n+\n+ ngOnChanges(changes: SimpleChanges) {\n+ if (isDefined(changes.term.currentValue) && isDefined(this.label)) {\nthis._highlightLabelWithSearchTerm();\n}\n+ }\n+\n+ ngAfterViewInit() {\n+ this.label = this.element.innerHTML;\n+ }\n- private _highlightLabelWithSearchTerm(): void {\n- const label: string = this.label ? this.label.toString() : '';\n- if (!label || !this.term) {\n+ private _highlightLabelWithSearchTerm() {\n+ const label = this.label;\n+ if (!this.term) {\nthis._setInnerHtml(label);\nreturn;\n}\n@@ -34,14 +49,14 @@ export class NgOptionHighlightDirective implements OnChanges {\nif (indexOfTerm > -1) {\nthis._setInnerHtml(\nlabel.substring(0, indexOfTerm)\n- + '<span class=\\'highlighted\\'>' + label.substr(indexOfTerm, this.term.length) + '</span>'\n+ + `<span class=\"highlighted\">${label.substr(indexOfTerm, this.term.length)}</span>`\n+ label.substring(indexOfTerm + this.term.length, label.length));\n} else {\nthis._setInnerHtml(label);\n}\n}\n- private _setInnerHtml(html): void {\n+ private _setInnerHtml(html) {\nthis.renderer.setProperty(this.elementRef.nativeElement, 'innerHTML', html);\n}\n}\n",
"new_path": "src/ng-select/ng-option-highlight.directive.ts",
"old_path": "src/ng-select/ng-option-highlight.directive.ts"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
fix: sanitize options
| 1
|
fix
| null |
815,745
|
11.04.2018 12:38:58
| -10,800
|
2b841908d62f7c288226f5be9867d6429c4d5c58
|
fix: disable term highlighting by default
|
[
{
"change_type": "MODIFY",
"diff": "id=\"{{item?.htmlId || null}}\">\n<ng-template #defaultOptionTemplate>\n- <span class=\"ng-option-label\" [innerHtml]=\"item.label\" [ngOptionHighlight]=\"filterValue\"></span>\n+ <span class=\"ng-option-label\" [innerHtml]=\"item.label\"></span>\n</ng-template>\n<ng-template #defaultOptGroupTemplate>\n- <span class=\"ng-option-label\" [innerHtml]=\"item.label\" [ngOptionHighlight]=\"filterValue\"></span>\n+ <span class=\"ng-option-label\" [innerHtml]=\"item.label\"></span>\n</ng-template>\n<ng-template\n",
"new_path": "src/ng-select/ng-select.component.html",
"old_path": "src/ng-select/ng-select.component.html"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
fix: disable term highlighting by default
| 1
|
fix
| null |
815,745
|
11.04.2018 13:32:12
| -10,800
|
a301521863b2a43ad399fd32219f0d67d83bf748
|
chore(release): 0.36.1
|
[
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"0.36.1\"></a>\n+## [0.36.1](https://github.com/ng-select/ng-select/compare/v0.36.0...v0.36.1) (2018-04-11)\n+\n+\n+### Bug Fixes\n+\n+* disable term highlighting by default ([2b84190](https://github.com/ng-select/ng-select/commit/2b84190))\n+* sanitize options ([1fbfd24](https://github.com/ng-select/ng-select/commit/1fbfd24))\n+\n+\n+\n<a name=\"0.36.0\"></a>\n# [0.36.0](https://github.com/ng-select/ng-select/compare/v0.35.2...v0.36.0) (2018-04-10)\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"$schema\": \"../node_modules/ng-packagr/package.schema.json\",\n\"name\": \"@ng-select/ng-select\",\n- \"version\": \"0.36.0\",\n+ \"version\": \"0.36.1\",\n\"description\": \"Angular ng-select - All in One UI Select, Multiselect and Autocomplete\",\n\"author\": \"@ng-select/ng-select\",\n\"license\": \"MIT\",\n",
"new_path": "src/package.json",
"old_path": "src/package.json"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
chore(release): 0.36.1
| 1
|
chore
|
release
|
730,413
|
11.04.2018 14:30:14
| 14,400
|
b1b1c95ce4c4dfe97f6c7701fd986121d6e85fdc
|
fix(journeys): add a wait before moving mouse to call container
|
[
{
"change_type": "MODIFY",
"diff": "@@ -71,6 +71,7 @@ export function decline(aBrowser) {\n*/\nexport function hangup(aBrowser) {\n// Call controls currently has a hover state\n+ aBrowser.waitForVisible(elements.callContainer);\nmoveMouse(aBrowser, elements.callContainer);\naBrowser.waitForVisible(elements.callControls);\naBrowser.waitForVisible(elements.hangupButton);\n",
"new_path": "test/journeys/lib/test-helpers/space-widget/meet.js",
"old_path": "test/journeys/lib/test-helpers/space-widget/meet.js"
}
] |
JavaScript
|
MIT License
|
webex/react-widgets
|
fix(journeys): add a wait before moving mouse to call container
| 1
|
fix
|
journeys
|
791,834
|
11.04.2018 15:02:03
| 25,200
|
5bacdff524616b61b772f2870ad116a72f613cee
|
extension(compilation): add object rest support
|
[
{
"change_type": "MODIFY",
"diff": "@@ -129,13 +129,7 @@ async function saveArtifacts(artifacts, basePath) {\nrimraf.sync(`${basePath}/*${traceSuffix}`);\nrimraf.sync(`${basePath}/${artifactsFilename}`);\n- // TODO: when https://github.com/GoogleChrome/lighthouse/issues/4952 is fixed\n- // const {traces, devtoolsLogs, ...restArtifacts} = artifacts;\n- const traces = artifacts.traces;\n- const devtoolsLogs = artifacts.devtoolsLogs;\n- const restArtifacts = Object.assign({}, artifacts);\n- delete restArtifacts.traces;\n- delete restArtifacts.devtoolsLogs;\n+ const {traces, devtoolsLogs, ...restArtifacts} = artifacts;\n// save traces\nfor (const [passName, trace] of Object.entries(traces)) {\n",
"new_path": "lighthouse-core/lib/asset-saver.js",
"old_path": "lighthouse-core/lib/asset-saver.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -97,7 +97,7 @@ function applyBrowserifyTransforms(bundle) {\n// Fix an issue with imported speedline code that doesn't brfs well.\nreturn bundle.transform('./fs-transform', {global: true})\n// Transform the fs.readFile etc, but do so in all the modules.\n- .transform('brfs', {global: true})\n+ .transform('brfs', {global: true, parserOpts: {ecmaVersion: 9}})\n// Strip everything out of package.json includes except for the version.\n.transform('package-json-versionify');\n}\n@@ -170,6 +170,9 @@ gulp.task('compilejs', () => {\nretainLines: true, // Keep things on the same line (looks wonky but helps with stacktraces)\ncomments: false, // Don't output comments\nshouldPrintComment: _ => false, // Don't include @license or @preserve comments either\n+ plugins: [\n+ 'syntax-object-rest-spread',\n+ ],\n// sourceMaps: 'both'\n};\n",
"new_path": "lighthouse-extension/gulpfile.js",
"old_path": "lighthouse-extension/gulpfile.js"
},
{
"change_type": "MODIFY",
"diff": "\"test\": \"mocha test/extension-test.js\"\n},\n\"devDependencies\": {\n- \"brfs\": \"^1.5.0\",\n+ \"babel-plugin-syntax-object-rest-spread\": \"^6.13.0\",\n+ \"brfs\": \"^1.6.1\",\n\"browserify\": \"^16.1.1\",\n\"del\": \"^2.2.0\",\n\"gulp\": \"^3.9.1\",\n",
"new_path": "lighthouse-extension/package.json",
"old_path": "lighthouse-extension/package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -199,6 +199,10 @@ babel-code-frame@^6.22.0:\nesutils \"^2.0.2\"\njs-tokens \"^3.0.2\"\n+babel-plugin-syntax-object-rest-spread@^6.13.0:\n+ version \"6.13.0\"\n+ resolved \"https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5\"\n+\nbalanced-match@^0.4.1:\nversion \"0.4.2\"\nresolved \"https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838\"\n@@ -256,9 +260,9 @@ braces@^1.8.2:\npreserve \"^0.2.0\"\nrepeat-element \"^1.1.2\"\n-brfs@^1.5.0:\n- version \"1.5.0\"\n- resolved \"https://registry.yarnpkg.com/brfs/-/brfs-1.5.0.tgz#a3822ed7a65723e056f89ff4b58e8abc63658f03\"\n+brfs@^1.6.1:\n+ version \"1.6.1\"\n+ resolved \"https://registry.yarnpkg.com/brfs/-/brfs-1.6.1.tgz#b78ce2336d818e25eea04a0947cba6d4fb8849c3\"\ndependencies:\nquote-stream \"^1.0.1\"\nresolve \"^1.1.5\"\n",
"new_path": "lighthouse-extension/yarn.lock",
"old_path": "lighthouse-extension/yarn.lock"
},
{
"change_type": "MODIFY",
"diff": "\"@types/update-notifier\": \"^1.0.2\",\n\"@types/ws\": \"^4.0.1\",\n\"@types/yargs\": \"^8.0.2\",\n- \"babel-core\": \"^6.16.0\",\n+ \"babel-core\": \"^6.26.0\",\n\"bundlesize\": \"^0.14.4\",\n\"codecov\": \"^2.2.0\",\n\"commitizen\": \"^2.9.6\",\n",
"new_path": "package.json",
"old_path": "package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -446,45 +446,31 @@ babel-code-frame@^6.22.0, babel-code-frame@^6.26.0:\nesutils \"^2.0.2\"\njs-tokens \"^3.0.2\"\n-babel-core@^6.16.0:\n- version \"6.17.0\"\n- resolved \"https://registry.yarnpkg.com/babel-core/-/babel-core-6.17.0.tgz#6c4576447df479e241e58c807e4bc7da4db7f425\"\n+babel-core@^6.26.0:\n+ version \"6.26.0\"\n+ resolved \"https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.0.tgz#af32f78b31a6fcef119c87b0fd8d9753f03a0bb8\"\ndependencies:\n- babel-code-frame \"^6.16.0\"\n- babel-generator \"^6.17.0\"\n- babel-helpers \"^6.16.0\"\n- babel-messages \"^6.8.0\"\n- babel-register \"^6.16.0\"\n- babel-runtime \"^6.9.1\"\n- babel-template \"^6.16.0\"\n- babel-traverse \"^6.16.0\"\n- babel-types \"^6.16.0\"\n- babylon \"^6.11.0\"\n- convert-source-map \"^1.1.0\"\n- debug \"^2.1.1\"\n- json5 \"^0.4.0\"\n- lodash \"^4.2.0\"\n- minimatch \"^3.0.2\"\n- path-exists \"^1.0.0\"\n- path-is-absolute \"^1.0.0\"\n- private \"^0.1.6\"\n- shebang-regex \"^1.0.0\"\n+ babel-code-frame \"^6.26.0\"\n+ babel-generator \"^6.26.0\"\n+ babel-helpers \"^6.24.1\"\n+ babel-messages \"^6.23.0\"\n+ babel-register \"^6.26.0\"\n+ babel-runtime \"^6.26.0\"\n+ babel-template \"^6.26.0\"\n+ babel-traverse \"^6.26.0\"\n+ babel-types \"^6.26.0\"\n+ babylon \"^6.18.0\"\n+ convert-source-map \"^1.5.0\"\n+ debug \"^2.6.8\"\n+ json5 \"^0.5.1\"\n+ lodash \"^4.17.4\"\n+ minimatch \"^3.0.4\"\n+ path-is-absolute \"^1.0.1\"\n+ private \"^0.1.7\"\nslash \"^1.0.0\"\n- source-map \"^0.5.0\"\n-\n-babel-generator@^6.17.0:\n- version \"6.17.0\"\n- resolved \"https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.17.0.tgz#b894e3808beef7800f2550635bfe024b6226cf33\"\n- dependencies:\n- babel-messages \"^6.8.0\"\n- babel-runtime \"^6.9.0\"\n- babel-types \"^6.16.0\"\n- detect-indent \"^3.0.1\"\n- jsesc \"^1.3.0\"\n- lodash \"^4.2.0\"\n- source-map \"^0.5.0\"\n+ source-map \"^0.5.6\"\n-babel-generator@^6.18.0:\n+babel-generator@^6.18.0, babel-generator@^6.26.0:\nversion \"6.26.1\"\nresolved \"https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90\"\ndependencies:\n@@ -497,12 +483,12 @@ babel-generator@^6.18.0:\nsource-map \"^0.5.7\"\ntrim-right \"^1.0.1\"\n-babel-helpers@^6.16.0:\n- version \"6.16.0\"\n- resolved \"https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.16.0.tgz#1095ec10d99279460553e67eb3eee9973d3867e3\"\n+babel-helpers@^6.24.1:\n+ version \"6.24.1\"\n+ resolved \"https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2\"\ndependencies:\n- babel-runtime \"^6.0.0\"\n- babel-template \"^6.16.0\"\n+ babel-runtime \"^6.22.0\"\n+ babel-template \"^6.24.1\"\nbabel-messages@^6.23.0:\nversion \"6.23.0\"\n@@ -516,20 +502,19 @@ babel-messages@^6.8.0:\ndependencies:\nbabel-runtime \"^6.0.0\"\n-babel-register@^6.16.0:\n- version \"6.16.3\"\n- resolved \"https://registry.yarnpkg.com/babel-register/-/babel-register-6.16.3.tgz#7b0c0ca7bfdeb9188ba4c27e5fcb7599a497c624\"\n+babel-register@^6.26.0:\n+ version \"6.26.0\"\n+ resolved \"https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071\"\ndependencies:\n- babel-core \"^6.16.0\"\n- babel-runtime \"^6.11.6\"\n- core-js \"^2.4.0\"\n- home-or-tmp \"^1.0.0\"\n- lodash \"^4.2.0\"\n+ babel-core \"^6.26.0\"\n+ babel-runtime \"^6.26.0\"\n+ core-js \"^2.5.0\"\n+ home-or-tmp \"^2.0.0\"\n+ lodash \"^4.17.4\"\nmkdirp \"^0.5.1\"\n- path-exists \"^1.0.0\"\n- source-map-support \"^0.4.2\"\n+ source-map-support \"^0.4.15\"\n-babel-runtime@^6.0.0, babel-runtime@^6.11.6, babel-runtime@^6.9.0, babel-runtime@^6.9.1:\n+babel-runtime@^6.0.0, babel-runtime@^6.9.0, babel-runtime@^6.9.1:\nversion \"6.11.6\"\nresolved \"https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.11.6.tgz#6db707fef2d49c49bfa3cb64efdb436b518b8222\"\ndependencies:\n@@ -553,6 +538,16 @@ babel-template@^6.16.0:\nbabylon \"^6.11.0\"\nlodash \"^4.2.0\"\n+babel-template@^6.24.1, babel-template@^6.26.0:\n+ version \"6.26.0\"\n+ resolved \"https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02\"\n+ dependencies:\n+ babel-runtime \"^6.26.0\"\n+ babel-traverse \"^6.26.0\"\n+ babel-types \"^6.26.0\"\n+ babylon \"^6.18.0\"\n+ lodash \"^4.17.4\"\n+\nbabel-traverse@^6.16.0:\nversion \"6.16.0\"\nresolved \"https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.16.0.tgz#fba85ae1fd4d107de9ce003149cc57f53bef0c4f\"\n@@ -567,7 +562,7 @@ babel-traverse@^6.16.0:\ninvariant \"^2.2.0\"\nlodash \"^4.2.0\"\n-babel-traverse@^6.18.0:\n+babel-traverse@^6.18.0, babel-traverse@^6.26.0:\nversion \"6.26.0\"\nresolved \"https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee\"\ndependencies:\n@@ -1203,11 +1198,7 @@ conventional-commits-parser@^2.0.0:\nthrough2 \"^2.0.0\"\ntrim-off-newlines \"^1.0.0\"\n-convert-source-map@^1.1.0:\n- version \"1.3.0\"\n- resolved \"https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.3.0.tgz#e9f3e9c6e2728efc2676696a70eb382f73106a67\"\n-\n-convert-source-map@^1.5.1:\n+convert-source-map@^1.5.0, convert-source-map@^1.5.1:\nversion \"1.5.1\"\nresolved \"https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5\"\n@@ -1223,6 +1214,10 @@ core-js@^2.4.0:\nversion \"2.4.1\"\nresolved \"https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e\"\n+core-js@^2.5.0:\n+ version \"2.5.5\"\n+ resolved \"https://registry.yarnpkg.com/core-js/-/core-js-2.5.5.tgz#b14dde936c640c0579a6b50cabcc132dd6127e3b\"\n+\ncore-util-is@~1.0.0:\nversion \"1.0.2\"\nresolved \"https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7\"\n@@ -1365,7 +1360,7 @@ debug@2.6.9, debug@^2.3.3:\ndependencies:\nms \"2.0.0\"\n-debug@^2.1.1, debug@^2.2.0, debug@^2.4.5, debug@^2.6.8:\n+debug@^2.2.0, debug@^2.4.5, debug@^2.6.8:\nversion \"2.6.8\"\nresolved \"https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc\"\ndependencies:\n@@ -1460,14 +1455,6 @@ detect-indent@4.0.0, detect-indent@^4.0.0:\ndependencies:\nrepeating \"^2.0.0\"\n-detect-indent@^3.0.1:\n- version \"3.0.1\"\n- resolved \"https://registry.yarnpkg.com/detect-indent/-/detect-indent-3.0.1.tgz#9dc5e5ddbceef8325764b9451b02bc6d54084f75\"\n- dependencies:\n- get-stdin \"^4.0.1\"\n- minimist \"^1.1.0\"\n- repeating \"^1.1.0\"\n-\ndevtools-timeline-model@1.1.6:\nversion \"1.1.6\"\nresolved \"https://registry.yarnpkg.com/devtools-timeline-model/-/devtools-timeline-model-1.1.6.tgz#7be51a73b55d727b597bb30dd1ed2e8e210639a5\"\n@@ -2436,12 +2423,12 @@ hoek@2.x.x:\nversion \"2.16.3\"\nresolved \"https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed\"\n-home-or-tmp@^1.0.0:\n- version \"1.0.0\"\n- resolved \"https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-1.0.0.tgz#4b9f1e40800c3e50c6c27f781676afcce71f3985\"\n+home-or-tmp@^2.0.0:\n+ version \"2.0.0\"\n+ resolved \"https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8\"\ndependencies:\n+ os-homedir \"^1.0.0\"\nos-tmpdir \"^1.0.1\"\n- user-home \"^1.1.1\"\nhosted-git-info@^2.1.4:\nversion \"2.1.5\"\n@@ -3009,9 +2996,9 @@ json3@3.3.2:\nversion \"3.3.2\"\nresolved \"https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1\"\n-json5@^0.4.0:\n- version \"0.4.0\"\n- resolved \"https://registry.yarnpkg.com/json5/-/json5-0.4.0.tgz#054352e4c4c80c86c0923877d449de176a732c8d\"\n+json5@^0.5.1:\n+ version \"0.5.1\"\n+ resolved \"https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821\"\njsonfile@^2.1.0:\nversion \"2.4.0\"\n@@ -3892,15 +3879,11 @@ path-exists@2.1.0, path-exists@^2.0.0:\ndependencies:\npinkie-promise \"^2.0.0\"\n-path-exists@^1.0.0:\n- version \"1.0.0\"\n- resolved \"https://registry.yarnpkg.com/path-exists/-/path-exists-1.0.0.tgz#d5a8998eb71ef37a74c34eb0d9eba6e878eea081\"\n-\npath-exists@^3.0.0:\nversion \"3.0.0\"\nresolved \"https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515\"\n-path-is-absolute@^1.0.0:\n+path-is-absolute@^1.0.0, path-is-absolute@^1.0.1:\nversion \"1.0.1\"\nresolved \"https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f\"\n@@ -4012,9 +3995,9 @@ prettycli@^1.4.3:\ndependencies:\nchalk \"2.1.0\"\n-private@^0.1.6:\n- version \"0.1.6\"\n- resolved \"https://registry.yarnpkg.com/private/-/private-0.1.6.tgz#55c6a976d0f9bafb9924851350fe47b9b5fbb7c1\"\n+private@^0.1.7:\n+ version \"0.1.8\"\n+ resolved \"https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff\"\nprocess-nextick-args@^1.0.6, process-nextick-args@~1.0.6:\nversion \"1.0.7\"\n@@ -4237,12 +4220,6 @@ repeat-string@^1.6.1:\nversion \"1.6.1\"\nresolved \"https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637\"\n-repeating@^1.1.0:\n- version \"1.1.3\"\n- resolved \"https://registry.yarnpkg.com/repeating/-/repeating-1.1.3.tgz#3d4114218877537494f97f77f9785fab810fa4ac\"\n- dependencies:\n- is-finite \"^1.0.0\"\n-\nrepeating@^2.0.0:\nversion \"2.0.1\"\nresolved \"https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda\"\n@@ -4584,11 +4561,11 @@ source-map-resolve@^0.5.0:\nsource-map-url \"^0.4.0\"\nurix \"^0.1.0\"\n-source-map-support@^0.4.2:\n- version \"0.4.3\"\n- resolved \"https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.3.tgz#693c8383d4389a4569486987c219744dfc601685\"\n+source-map-support@^0.4.15:\n+ version \"0.4.18\"\n+ resolved \"https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f\"\ndependencies:\n- source-map \"^0.5.3\"\n+ source-map \"^0.5.6\"\nsource-map-url@^0.4.0:\nversion \"0.4.0\"\n@@ -4600,7 +4577,7 @@ source-map@^0.4.4:\ndependencies:\namdefine \">=0.0.4\"\n-source-map@^0.5.0, source-map@^0.5.1, source-map@^0.5.3, source-map@~0.5.1:\n+source-map@^0.5.1, source-map@^0.5.3, source-map@~0.5.1:\nversion \"0.5.6\"\nresolved \"https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412\"\n",
"new_path": "yarn.lock",
"old_path": "yarn.lock"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
extension(compilation): add object rest support (#4954)
| 1
|
extension
|
compilation
|
815,745
|
11.04.2018 16:08:58
| -10,800
|
79d555a44e4821f141ec189b42aab7b49f2019f3
|
fix: use interpolation instead of innerHTML
|
[
{
"change_type": "MODIFY",
"diff": "@@ -71,7 +71,6 @@ import { Observable } from 'rxjs/Observable';\n<ng-select [searchable]=\"false\" [(ngModel)]=\"selectedCarId\">\n<ng-option *ngFor=\"let car of cars\" [value]=\"car.id\" [disabled]=\"car.disabled\" >{{car.name}}</ng-option>\n<ng-option [value]=\"'custom'\">Custom</ng-option>\n- <ng-option [value]=\"'html'\"><b>BMW</b></ng-option>\n</ng-select>\n---\n<br />Selected car ID: {{selectedCarId | json}}\n",
"new_path": "demo/app/examples/data-source.component.ts",
"old_path": "demo/app/examples/data-source.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,8 +5,8 @@ import { By } from '@angular/platform-browser';\n@Component({\ntemplate: `\n- <span id=\"test1\" [innerHtml]=\"'My text is highlighted'\" [ngOptionHighlight]=\"term\"></span>\n- <span id=\"test2\" [innerHtml]=\"'My text is not highlighted'\" [ngOptionHighlight]=\"term\"></span>\n+ <span id=\"test1\" [ngOptionHighlight]=\"term\">My text is highlighted</span>\n+ <span id=\"test2\" [ngOptionHighlight]=\"term\">My text is not highlighted</span>\n`\n})\nclass TestComponent {\n",
"new_path": "src/ng-select/ng-option-highlight.directive.spec.ts",
"old_path": "src/ng-select/ng-option-highlight.directive.spec.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -144,6 +144,8 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nitemsList = new ItemsList(this);\nviewPortItems: NgOption[] = [];\nfilterValue: string = null;\n+ dropdownId = newId();\n+ selectedItemId = 0;\nprivate _defaultLabel = 'label';\nprivate _defaultValue = 'value';\n@@ -154,8 +156,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nprivate readonly _destroy$ = new Subject<void>();\nprivate _onChange = (_: NgOption) => { };\nprivate _onTouched = () => { };\n- dropdownId = newId();\n- selectedItemId = 0;\n+\nclearItem = (item: any) => {\nconst option = this.selectedItems.find(x => x.value === item);\nthis.unselect(option);\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: use interpolation instead of innerHTML
| 1
|
fix
| null |
815,745
|
11.04.2018 16:15:27
| -10,800
|
68b9a7e0394325c167011c06eeac2b6100e0259a
|
chore(release): 0.36.2
|
[
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"0.36.2\"></a>\n+## [0.36.2](https://github.com/ng-select/ng-select/compare/v0.36.1...v0.36.2) (2018-04-11)\n+\n+\n+### Bug Fixes\n+\n+* use interpolation instead of innerHTML ([79d555a](https://github.com/ng-select/ng-select/commit/79d555a))\n+\n+\n+\n<a name=\"0.36.1\"></a>\n## [0.36.1](https://github.com/ng-select/ng-select/compare/v0.36.0...v0.36.1) (2018-04-11)\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"$schema\": \"../node_modules/ng-packagr/package.schema.json\",\n\"name\": \"@ng-select/ng-select\",\n- \"version\": \"0.36.1\",\n+ \"version\": \"0.36.2\",\n\"description\": \"Angular ng-select - All in One UI Select, Multiselect and Autocomplete\",\n\"author\": \"@ng-select/ng-select\",\n\"license\": \"MIT\",\n",
"new_path": "src/package.json",
"old_path": "src/package.json"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
chore(release): 0.36.2
| 1
|
chore
|
release
|
679,913
|
11.04.2018 17:56:43
| -3,600
|
52c75085db1fd0b588937a5a16691fb41dfd25ba
|
feat(transducers): add run() for executing side effects only, update readme
|
[
{
"change_type": "MODIFY",
"diff": "@@ -572,6 +572,14 @@ accumulator/result.\nTransforms iterable using given transducer and combines results with\ngiven reducer and optional initial accumulator/result.\n+#### `run<A, B>(tx: Transducer<A, B>, fx: (x: B) => void, xs: Iterable<A>)`\n+\n+Transforms iterable with given transducer and optional side effect\n+without any reduction step. If `fx` is given it will be called with\n+every value produced by the transducer. If `fx` is *not* given, the\n+transducer is assumed to include at least one `sideEffect()` step\n+itself. Returns nothing.\n+\n### Transducers\n#### `base64Decode(): Transducer<string, number>`\n",
"new_path": "packages/transducers/README.md",
"old_path": "packages/transducers/README.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -2,6 +2,7 @@ export * from \"./api\";\nexport * from \"./iterator\";\nexport * from \"./reduce\";\nexport * from \"./reduced\";\n+export * from \"./run\";\nexport * from \"./step\";\nexport * from \"./transduce\";\n",
"new_path": "packages/transducers/src/index.ts",
"old_path": "packages/transducers/src/index.ts"
},
{
"change_type": "ADD",
"diff": "+import { Transducer } from \"./api\";\n+import { transduce } from \"./transduce\";\n+\n+const nop = () => { };\n+\n+/**\n+ * Transforms `xs` with given transducer and optional side effect\n+ * without any reduction step. If `fx` is given it will be called with\n+ * every value produced by the transducer. If `fx` is *not* given, the\n+ * transducer is assumed to include at least one `sideEffect()` step\n+ * itself. Returns nothing.\n+ *\n+ * @param tx\n+ * @param fx\n+ * @param xs\n+ */\n+export function run<A, B>(tx: Transducer<A, B>, xs: Iterable<A>): void;\n+export function run<A, B>(tx: Transducer<A, B>, fx: (x: B) => void, xs: Iterable<A>): void;\n+export function run<A, B>(tx: Transducer<A, B>, ...args: any[]) {\n+ if (args.length === 1) {\n+ transduce(tx, [nop, nop, nop], args[0]);\n+ } else {\n+ const fx = args[0];\n+ transduce(tx, [nop, nop, (_, x) => fx(x)], args[1]);\n+ }\n+}\n",
"new_path": "packages/transducers/src/run.ts",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(transducers): add run() for executing side effects only, update readme
| 1
|
feat
|
transducers
|
217,922
|
11.04.2018 19:20:08
| -7,200
|
b3c685d76704f3e5b25b13463587f1d70478d3b7
|
chore: fix for build
|
[
{
"change_type": "MODIFY",
"diff": "@@ -234,7 +234,7 @@ export class ListsComponent extends ComponentWithSubscriptions implements OnInit\n{\nlistName: this.newListFormControl.value,\nuserId: this.userData.$key\n- }\n+ },\ndisableClose: true\n});\n}\n",
"new_path": "src/app/pages/lists/lists/lists.component.ts",
"old_path": "src/app/pages/lists/lists/lists.component.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore: fix for build
| 1
|
chore
| null |
217,922
|
12.04.2018 11:38:51
| -7,200
|
616898a134915e640a9b2b33564887dfe992b30e
|
fix: external list import dialog box now has a cancel button in each step to close the dialog
|
[
{
"change_type": "MODIFY",
"diff": "<button mat-raised-button matStepperNext (click)=\"parseImportLink()\">{{'LISTS.IMPORT.Next' |\ntranslate}}\n</button>\n+ <button mat-button mat-dialog-close color=\"warn\">{{'Cancel' |\n+ translate}}\n+ </button>\n</div>\n</form>\n</mat-step>\n<div>\n<button mat-raised-button matStepperPrevious>{{'LISTS.IMPORT.Back' | translate}}</button>\n<button mat-raised-button matStepperNext>{{'LISTS.IMPORT.Next' | translate}}</button>\n+ <button mat-button mat-dialog-close color=\"warn\">{{'Cancel' |\n+ translate}}\n+ </button>\n</div>\n</form>\n</mat-step>\n",
"new_path": "src/app/pages/lists/external-list-import-popup/external-list-import-popup.component.html",
"old_path": "src/app/pages/lists/external-list-import-popup/external-list-import-popup.component.html"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
fix: external list import dialog box now has a cancel button in each step to close the dialog
| 1
|
fix
| null |
791,723
|
12.04.2018 13:14:08
| 25,200
|
8861386b40be478fde8d630ef2206a1a12c7afa0
|
docs: "LHR" is "Lighthouse Result"
|
[
{
"change_type": "MODIFY",
"diff": "# Understanding the Results\n-The results object contains all the audit information Lighthouse determined about the page. In fact, everything you see in the HTML report, even the screenshots, is a rendering of information contained in the results object. You might need to work directly with the results object if you use [Lighthouse programmatically](https://github.com/GoogleChrome/lighthouse/blob/master/docs/readme.md#using-programmatically), consume the JSON output of the [CLI](https://github.com/GoogleChrome/lighthouse#using-the-node-cli), explore [Lighthouse results in HTTPArchive](https://github.com/GoogleChrome/lighthouse#lighthouse-integrations), or work on the report generation code that reads the Lighthouse JSON and outputs HTML.\n+The result object contains all the audit information Lighthouse determined about the page. In fact, everything you see in the HTML report, even the screenshots, is a rendering of information contained in the result object. You might need to work directly with the result object if you use [Lighthouse programmatically](https://github.com/GoogleChrome/lighthouse/blob/master/docs/readme.md#using-programmatically), consume the JSON output of the [CLI](https://github.com/GoogleChrome/lighthouse#using-the-node-cli), explore [Lighthouse results in HTTPArchive](https://github.com/GoogleChrome/lighthouse#lighthouse-integrations), or work on the report generation code that reads the Lighthouse JSON and outputs HTML.\n-## Lighthouse Results Object (LHR)\n+## Lighthouse Result Object (LHR)\n-The top-level Lighthouse Results object (LHR) is what the lighthouse node module returns and the entirety of the JSON output of the CLI. It contains some metadata about the run and the results in the various subproperties below.\n+The top-level Lighthouse Result object (LHR) is what the lighthouse node module returns and the entirety of the JSON output of the CLI. It contains some metadata about the run and the results in the various subproperties below.\n### Properties\n| Name | Description |\n| - | - |\n-| lighthouseVersion | The version of Lighthouse with which these results were generated. |\n-| fetchedAt | The ISO-8601 timestamp of when the results were generated. |\n+| lighthouseVersion | The version of Lighthouse with which this result were generated. |\n+| fetchedAt | The ISO-8601 timestamp of when the result was generated. |\n| userAgent | The user agent string of the version of Chrome that was used by Lighthouse. |\n| initialUrl | The URL that was supplied to Lighthouse and initially navigated to. |\n| url | The URL that Lighthouse ended up auditing after redirects were followed. |\n",
"new_path": "docs/understanding-results.md",
"old_path": "docs/understanding-results.md"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
docs: "LHR" is "Lighthouse Result"
| 1
|
docs
| null |
679,913
|
12.04.2018 13:17:04
| -3,600
|
ae0eae8e78d7659796682cd110e5573a1cd42bb0
|
feat(associative): add SortedMap & tests, minor refactor EquivMap
|
[
{
"change_type": "MODIFY",
"diff": "},\n\"dependencies\": {\n\"@thi.ng/api\": \"^2.1.0\",\n- \"@thi.ng/dcons\": \"^0.2.0\"\n+ \"@thi.ng/dcons\": \"^0.2.0\",\n+ \"@thi.ng/iterators\": \"^4.1.5\"\n},\n\"keywords\": [\n\"data structures\",\n",
"new_path": "packages/associative/package.json",
"old_path": "packages/associative/package.json"
},
{
"change_type": "MODIFY",
"diff": "+export type Pair<K, V> = [K, V];\n+\nexport const SEMAPHORE = Symbol(\"SEMAPHORE\");\n",
"new_path": "packages/associative/src/api.ts",
"old_path": "packages/associative/src/api.ts"
},
{
"change_type": "MODIFY",
"diff": "import { ICopy, IEmpty, IEquiv, IObjectOf, Predicate2 } from \"@thi.ng/api/api\";\nimport { equiv } from \"@thi.ng/api/equiv\";\n-import { SEMAPHORE } from \"./api\";\n+import { SEMAPHORE, Pair } from \"./api\";\nimport { EquivSet } from \"./equiv-set\";\nexport class EquivMap<K, V> extends Map<K, V> implements\n- Iterable<[K, V]>,\n+ Iterable<Pair<K, V>>,\nICopy<EquivMap<K, V>>,\nIEmpty<EquivMap<K, V>>,\nIEquiv {\n@@ -23,7 +23,7 @@ export class EquivMap<K, V> extends Map<K, V> implements\nprotected _keys: EquivSet<K>;\nprotected _map: Map<K, V>;\n- constructor(pairs?: Iterable<[K, V]>, eq: Predicate2<K> = equiv) {\n+ constructor(pairs?: Iterable<Pair<K, V>>, eq: Predicate2<K> = equiv) {\nsuper();\nthis._keys = new EquivSet<K>(null, eq);\nthis._map = new Map<K, V>();\n@@ -128,7 +128,7 @@ export class EquivMap<K, V> extends Map<K, V> implements\nreturn this;\n}\n- into(pairs: Iterable<[K, V]>) {\n+ into(pairs: Iterable<Pair<K, V>>) {\nfor (let p of pairs) {\nthis.set(p[0], p[1]);\n}\n@@ -140,7 +140,7 @@ export class EquivMap<K, V> extends Map<K, V> implements\n}\nkeys() {\n- return this._keys.keys();\n+ return this._map.keys();\n}\nvalues() {\n",
"new_path": "packages/associative/src/equiv-map.ts",
"old_path": "packages/associative/src/equiv-map.ts"
},
{
"change_type": "MODIFY",
"diff": "export * from \"./equiv-map\";\nexport * from \"./equiv-set\";\n+export * from \"./sorted-map\";\nexport * from \"./difference\";\nexport * from \"./intersection\";\n",
"new_path": "packages/associative/src/index.ts",
"old_path": "packages/associative/src/index.ts"
},
{
"change_type": "ADD",
"diff": "+import { Predicate2, Comparator, IObjectOf, ICopy, IEmpty } from \"@thi.ng/api/api\";\n+import { compare } from \"@thi.ng/api/compare\";\n+import { equiv } from \"@thi.ng/api/equiv\";\n+import { isArray } from \"@thi.ng/checks/is-array\";\n+import { map } from \"@thi.ng/iterators/map\";\n+\n+import { Pair, SEMAPHORE } from \"./api\";\n+\n+// stores private properties for all instances\n+// http://fitzgeraldnick.com/2014/01/13/hiding-implementation-details-with-e6-weakmaps.html\n+const __private = new WeakMap<any, SkipListProps>();\n+\n+/**\n+ * SortedMapOpts implementation config settings.\n+ */\n+export interface SortedMapOpts<K> {\n+ /**\n+ * Key equivalence predicate. MUST return truthy result if given\n+ * keys are considered equal.\n+ *\n+ * Default: `@thi.ng/api/equiv`\n+ */\n+ equiv: Predicate2<K>;\n+ /**\n+ * Key comparison function. Must follow standard comparator contract\n+ * and return:\n+ * - negative if `a < b`\n+ * - positive if `a > b`\n+ * - `0` if `a == b`\n+ *\n+ * Note: The `SortedMap` implementation only uses `<` comparisons.\n+ *\n+ * Default: `@thi.ng/api/compare`\n+ */\n+ compare: Comparator<K>;\n+ /**\n+ * Initial capacity before resizing (doubling) occurs.\n+ * This value will be rounded up to next pow2.\n+ * Default: 16\n+ */\n+ capacity: number;\n+ /**\n+ * Probability for a value to exist in any express lane.\n+ * Default: `1 / Math.E`\n+ */\n+ probability: number;\n+}\n+\n+interface SkipListProps {\n+ head: any[];\n+ tail: any[];\n+ update: any[];\n+ nil: any[];\n+ equiv: Predicate2<any>;\n+ cmp: Comparator<any>;\n+ level: number;\n+ maxLevel: number;\n+ p: number;\n+ cap: number;\n+ length: number;\n+}\n+\n+const KEY = 0;\n+const VAL = 1;\n+const PREV = 2;\n+const NEXT = 3;\n+\n+const DEFAULT_CAP = 16;\n+const DEFAULT_P = 1 / Math.E;\n+\n+const makeNode = (level: number, key?, value?) => {\n+ const node = new Array(4 + level);\n+ node[KEY] = key;\n+ node[VAL] = value;\n+ return node;\n+}\n+\n+/**\n+ * This class is an alternative implementation of the ES6 Map API using\n+ * a Skip list as backing store and supports configurable key equality\n+ * and sorting semantics.\n+ *\n+ * William Pugh (creator of this data structure) description:\n+ *\n+ * \"Skip lists are a probabilistic data structures that have the same\n+ * asymptotic expected time bounds as balanced trees, are simpler,\n+ * faster and use less space.\"\n+ *\n+ * Adapted & refactored from Python version:\n+ * - http://pythonsweetness.tumblr.com/post/45227295342/fast-pypy-compatible-ordered-map-in-89-lines-of\n+ *\n+ * Data structure description:\n+ * - ftp://ftp.cs.umd.edu/pub/skipLists/skiplists.pdf\n+ * - https://en.wikipedia.org/wiki/Skip_list\n+ */\n+export class SortedMap<K, V> extends Map<K, V> implements\n+ ICopy<SortedMap<K, V>>,\n+ IEmpty<SortedMap<K, V>> {\n+\n+ static fromObject<T>(obj: IObjectOf<T>): SortedMap<PropertyKey, T> {\n+ const m = new SortedMap<PropertyKey, T>(null, { capacity: Object.keys(obj).length });\n+ for (let k in obj) {\n+ m.set(k, obj[k]);\n+ }\n+ return m;\n+ }\n+\n+ /**\n+ * Creates new instance with optional given key-value pairs and/or\n+ * implementation options.\n+ */\n+ constructor(values?: Iterable<Pair<K, V>>, opts: Partial<SortedMapOpts<K>> = {}) {\n+ super();\n+ values = this.init(values, opts);\n+ if (values) {\n+ this.into(values);\n+ }\n+ }\n+\n+ get [Symbol.species]() {\n+ return SortedMap;\n+ }\n+\n+ [Symbol.iterator]() {\n+ return this.entries();\n+ }\n+\n+ get size() {\n+ return __private.get(this).length;\n+ }\n+\n+ clear() {\n+ this.init(null, { ...this.getOpts(1), capacity: DEFAULT_CAP });\n+ }\n+\n+ empty(): SortedMap<K, V> {\n+ return new SortedMap<K, V>(null, { ...this.getOpts(1), capacity: DEFAULT_CAP });\n+ }\n+\n+ copy(): SortedMap<K, V> {\n+ return new SortedMap<K, V>(this, { ...this.getOpts(1), capacity: DEFAULT_CAP });\n+ }\n+\n+ forEach(fn: (val: V, key: K, map: Map<K, V>) => void, thisArg?: any) {\n+ for (let p of this) {\n+ fn.call(thisArg, p[1], p[0], this);\n+ }\n+ }\n+\n+ set(key: K, value: V) {\n+ let $this = __private.get(this);\n+ const update = $this.update.slice();\n+ let node = this.findLessAndUpdate(update, key);\n+ let prev = node;\n+ node = node[NEXT];\n+ if ($this.equiv(node[KEY], key))\n+ node[VAL] = value;\n+ else {\n+ if ($this.length >= $this.cap) {\n+ this.grow();\n+ $this = __private.get(this);\n+ prev = this.findLessAndUpdate(update, key);\n+ }\n+ const newLevel = this.randomLevel();\n+ $this.level = Math.max($this.level, newLevel);\n+ node = makeNode(newLevel, key, value);\n+ node[PREV] = prev;\n+ for (let i = 0; i <= newLevel; i++) {\n+ const j = i + NEXT;\n+ node[j] = update[i][j];\n+ update[i][j] = node;\n+ }\n+ if (node[NEXT] === $this.nil) {\n+ $this.tail = node;\n+ } else {\n+ node[NEXT][PREV] = node;\n+ }\n+ $this.length++;\n+ }\n+ return this;\n+ }\n+\n+ delete(key: K) {\n+ const $this = __private.get(this);\n+ const update = $this.update.slice();\n+ let node = this.findLessAndUpdate(update, key)[NEXT];\n+ if ($this.equiv(node[KEY], key)) {\n+ node[NEXT][PREV] = update[0];\n+ for (let i = 0; i <= $this.level; i++) {\n+ const j = i + NEXT;\n+ if (update[i][j] !== node) {\n+ break;\n+ }\n+ update[i][j] = node[j];\n+ }\n+ while ($this.level > 0 && $this.head[$this.level + NEXT][KEY] === undefined) {\n+ $this.level--;\n+ }\n+ if ($this.tail === node) {\n+ $this.tail = node[PREV];\n+ }\n+ $this.length--;\n+ return true;\n+ }\n+ return false;\n+ }\n+\n+ dissoc(...keys: K[]) {\n+ for (let k of keys) {\n+ this.delete(k);\n+ }\n+ return this;\n+ }\n+\n+ has(key: K) {\n+ return this.get(key, SEMAPHORE) !== SEMAPHORE;\n+ }\n+\n+ get(key: K, notFound?: any) {\n+ const $this = __private.get(this);\n+ const node = this.findLess(key)[NEXT];\n+ return $this.equiv(node[KEY], key) ?\n+ node[VAL] :\n+ notFound;\n+ }\n+\n+ into(pairs: Iterable<Pair<K, V>>) {\n+ for (let p of pairs) {\n+ this.set(p[0], p[1]);\n+ }\n+ return this;\n+ }\n+\n+ *entries(key?: K, reverse = false): IterableIterator<Pair<K, V>> {\n+ const $this = __private.get(this);\n+ const step = reverse ? PREV : NEXT;\n+ let node = reverse ? $this.tail : $this.head[NEXT];\n+ if (key !== undefined) {\n+ const found = this.findLess(key);\n+ // the original python impl doesn't handle unknown and out-of-range keys properly\n+ node = !reverse || (found[NEXT] != $this.nil && $this.equiv(found[NEXT][KEY], key)) ?\n+ found[NEXT] :\n+ found;\n+ }\n+ while (node[KEY] !== undefined) {\n+ yield [node[KEY], node[VAL]];\n+ node = node[step];\n+ }\n+ }\n+\n+ keys(): IterableIterator<K> {\n+ return map((p) => p[0], this.entries());\n+ }\n+\n+ values(): IterableIterator<V> {\n+ return map((p) => p[1], this.entries());\n+ }\n+\n+ protected init(values: Iterable<Pair<K, V>>, opts: Partial<SortedMapOpts<K>>) {\n+ let cap;\n+ if (values && !opts.capacity) {\n+ values = isArray(values) ? values : [...values];\n+ cap = (<any>values).length;\n+ }\n+ else {\n+ cap = opts.capacity || DEFAULT_CAP;\n+ }\n+ const maxLevel = Math.ceil(Math.log2(cap));\n+ const nil = makeNode(-1);\n+ const head = makeNode(maxLevel).fill(nil, 3);\n+ const update = new Array(maxLevel + 1).fill(head);\n+ __private.set(this, {\n+ head,\n+ update,\n+ nil,\n+ tail: nil,\n+ equiv: opts.equiv || equiv,\n+ cmp: opts.compare || compare,\n+ level: 0,\n+ maxLevel,\n+ p: opts.probability || DEFAULT_P,\n+ cap: Math.pow(2, maxLevel),\n+ length: 0\n+ });\n+ return values;\n+ }\n+\n+ /**\n+ * Recreates map with double capacity.\n+ */\n+ protected grow() {\n+ const tmp = new SortedMap(\n+ this.entries(),\n+ this.getOpts(2));\n+ __private.set(this, __private.get(tmp));\n+ __private.delete(tmp);\n+ }\n+\n+ protected getOpts(growFactor: number): SortedMapOpts<K> {\n+ const $this = __private.get(this);\n+ return {\n+ capacity: $this.cap * growFactor,\n+ equiv: $this.equiv,\n+ compare: $this.cmp,\n+ probability: $this.p,\n+ };\n+ }\n+\n+ protected randomLevel() {\n+ const $this = __private.get(this);\n+ const max = Math.min($this.maxLevel, $this.level + 1);\n+ const p = $this.p;\n+ let level = 0;\n+ while (Math.random() < p && level < max) {\n+ level++;\n+ }\n+ return level;\n+ }\n+\n+ protected findLess(key: K) {\n+ const $this = __private.get(this);\n+ const cmp = $this.cmp;\n+ let node = $this.head;\n+ for (let i = $this.level; i >= 0; i--) {\n+ const j = i + NEXT;\n+ let k = node[j][KEY];\n+ while (k !== undefined && cmp(k, key) < 0) {\n+ node = node[j];\n+ k = node[j][KEY];\n+ }\n+ }\n+ return node;\n+ }\n+\n+ /**\n+ * Like `findLess` but records node path in `update` array\n+ *\n+ * @param update\n+ * @param key\n+ */\n+ protected findLessAndUpdate(update, key: K) {\n+ const $this = __private.get(this);\n+ const cmp = $this.cmp;\n+ let node = $this.head;\n+ for (let i = $this.level; i >= 0; i--) {\n+ const j = i + NEXT;\n+ let k = node[j][KEY];\n+ while (k !== undefined && cmp(k, key) < 0) {\n+ node = node[j];\n+ k = node[j][KEY];\n+ }\n+ update[i] = node;\n+ }\n+ return node;\n+ }\n+}\n+/*\n+const m = SortedMap.fromObject({ a: 1, b: 2, c: 0 });\n+console.log(\"a\", [...m.entries(\"a\")]);\n+console.log(\"aa\", [...m.entries(\"aa\")]);\n+console.log(\"d\", [...m.entries(\"d\")]);\n+console.log(\"@\", [...m.entries(\"@\")]);\n+*/\n\\ No newline at end of file\n",
"new_path": "packages/associative/src/sorted-map.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import * as assert from \"assert\";\n+\n+import { SortedMap } from \"../src/sorted-map\";\n+\n+describe(\"SortedMap\", () => {\n+\n+ let m: SortedMap<any, any>;\n+\n+ beforeEach(() => {\n+ m = SortedMap.fromObject({ a: 1, b: 2, c: 3 });\n+ });\n+\n+\n+ it(\"size\", () => {\n+ assert.equal(m.size, 3);\n+ m.set(\"a\", 10);\n+ assert.equal(m.size, 3);\n+ m.set(\"d\", 10);\n+ assert.equal(m.size, 4);\n+ m.delete(\"d\");\n+ assert.equal(m.size, 3);\n+ m.delete(\"d\");\n+ assert.equal(m.size, 3);\n+ });\n+\n+ it(\"has\", () => {\n+ assert(m.has(\"a\"));\n+ assert(m.has(\"b\"));\n+ assert(m.has(\"c\"));\n+ assert(!m.has(\"aa\"));\n+ assert(!m.has(\"d\"));\n+ assert(!m.has(\"@\"));\n+ });\n+\n+ it(\"get\", () => {\n+ assert.strictEqual(m.get(\"a\"), 1);\n+ assert.strictEqual(m.get(\"b\"), 2);\n+ assert.strictEqual(m.get(\"c\"), 3);\n+ assert.strictEqual(m.get(\"aa\"), undefined);\n+ assert.strictEqual(m.get(\"d\"), undefined);\n+ assert.strictEqual(m.get(\"@\", -1), -1);\n+ });\n+\n+ it(\"entries\", () => {\n+ assert.deepEqual([...m], [[\"a\", 1], [\"b\", 2], [\"c\", 3]]);\n+ });\n+\n+ it(\"entries rev\", () => {\n+ assert.deepEqual([...m.entries(undefined, true)], [[\"c\", 3], [\"b\", 2], [\"a\", 1]]);\n+ });\n+\n+ it(\"entries a\", () => {\n+ assert.deepEqual([...m.entries(\"a\")], [[\"a\", 1], [\"b\", 2], [\"c\", 3]]);\n+ });\n+\n+ it(\"entries a rev\", () => {\n+ assert.deepEqual([...m.entries(\"a\", true)], [[\"a\", 1]]);\n+ });\n+\n+ it(\"entries aa\", () => {\n+ assert.deepEqual([...m.entries(\"aa\")], [[\"b\", 2], [\"c\", 3]]);\n+ });\n+\n+ it(\"entries aa rev\", () => {\n+ assert.deepEqual([...m.entries(\"aa\", true)], [[\"a\", 1]]);\n+ });\n+\n+ it(\"entries bb\", () => {\n+ assert.deepEqual([...m.entries(\"bb\")], [[\"c\", 3]]);\n+ });\n+\n+ it(\"entries bb rev\", () => {\n+ assert.deepEqual([...m.entries(\"bb\", true)], [[\"b\", 2], [\"a\", 1]]);\n+ });\n+\n+ it(\"entries c\", () => {\n+ assert.deepEqual([...m.entries(\"c\")], [[\"c\", 3]]);\n+ });\n+\n+ it(\"entries c rev\", () => {\n+ assert.deepEqual([...m.entries(\"c\", true)], [[\"c\", 3], [\"b\", 2], [\"a\", 1]]);\n+ });\n+\n+ it(\"entries 0\", () => {\n+ assert.deepEqual([...m.entries(\"0\")], [[\"a\", 1], [\"b\", 2], [\"c\", 3]]);\n+ });\n+\n+ it(\"entries 0 rev\", () => {\n+ assert.deepEqual([...m.entries(\"0\", true)], []);\n+ });\n+\n+ it(\"entries d\", () => {\n+ assert.deepEqual([...m.entries(\"d\")], []);\n+ });\n+\n+ it(\"entries d rev\", () => {\n+ assert.deepEqual([...m.entries(\"d\", true)], [[\"c\", 3], [\"b\", 2], [\"a\", 1]]);\n+ });\n+\n+ it(\"keys\", () => {\n+ assert.deepEqual([...m.keys()], [\"a\", \"b\", \"c\"]);\n+ m.set(\"aa\", 0);\n+ m.set(\"d\", 0);\n+ assert.deepEqual([...m.keys()], [\"a\", \"aa\", \"b\", \"c\", \"d\"]);\n+ });\n+\n+ it(\"values\", () => {\n+ assert.deepEqual([...m.values()], [1, 2, 3]);\n+ m.set(\"aa\", 0);\n+ m.set(\"d\", 0);\n+ assert.deepEqual([...m.values()], [1, 0, 2, 3, 0]);\n+ });\n+});\n",
"new_path": "packages/associative/test/sorted-map.ts",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(associative): add SortedMap & tests, minor refactor EquivMap
| 1
|
feat
|
associative
|
730,413
|
12.04.2018 14:59:17
| 14,400
|
a244542f1b088ee834e87c085542db0a0abfc594
|
refactor(journeys): remove browser.reload before hooks
|
[
{
"change_type": "MODIFY",
"diff": "\"react-transform-hmr\": \"^1.0.4\",\n\"redux-mock-store\": \"^1.2.1\",\n\"rimraf\": \"^2.5.4\",\n- \"saucelabs\": \"^1.4.0\",\n\"semver\": \"^5.4.1\",\n\"sleep-ms\": \"^2.0.1\",\n\"sri-toolbox\": \"^0.2.0\",\n",
"new_path": "package.json",
"old_path": "package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,7 +5,6 @@ import '@ciscospark/internal-plugin-feature';\nimport '@ciscospark/internal-plugin-conversation';\nimport CiscoSpark from '@ciscospark/spark-core';\nimport testUsers from '@ciscospark/test-helper-test-users';\n-import SauceLabs from 'saucelabs';\nimport waitForPromise from '../../lib/wait-for-promise';\nimport {moveMouse} from '../../lib/test-helpers';\n@@ -21,27 +20,11 @@ import {\ndescribe('Multiple Widgets', () => {\nconst browserLocal = browser.select('browserLocal');\nconst browserRemote = browser.select('browserRemote');\n- const browserName = process.env.BROWSER || 'chrome';\n- const platform = process.env.PLATFORM || 'mac 10.12';\nlet docbrown, lorraine, marty;\nlet conversation, oneOnOneConversation;\nlet local, remote;\n- before('update sauce job', () => {\n- if (process.env.SAUCE && process.env.INTEGRATION) {\n- const account = new SauceLabs({\n- username: process.env.SAUCE_USERNAME,\n- password: process.env.SAUCE_ACCESS_KEY\n- });\n- account.getJobs((err, jobs) => {\n- const widgetJobs = jobs.filter((job) => job.name === 'react-widget-integration' && job.consolidated_status === 'in progress'\n- && job.os.toLowerCase().includes(platform) && job.browser.toLowerCase().includes(browserName));\n- widgetJobs.forEach((job) => account.updateJob(job.id, {name: 'react-widget-multiple'}));\n- });\n- }\n- });\n-\nbefore('load browser', () => {\nbrowser.url('/multiple.html');\n});\n",
"new_path": "test/journeys/specs/multiple/index.js",
"old_path": "test/journeys/specs/multiple/index.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -4,7 +4,6 @@ import '@ciscospark/internal-plugin-feature';\nimport '@ciscospark/plugin-logger';\nimport CiscoSpark from '@ciscospark/spark-core';\nimport testUsers from '@ciscospark/test-helper-test-users';\n-import SauceLabs from 'saucelabs';\nimport {\nelements as rosterElements,\n@@ -15,28 +14,11 @@ import {elements, openMenuAndClickButton} from '../../../lib/test-helpers/space-\ndescribe('Widget Space: One on One: Data API', () => {\nconst browserLocal = browser.select('browserLocal');\n- const browserName = process.env.BROWSER || 'chrome';\n- const platform = process.env.PLATFORM || 'mac 10.12';\nlet mccoy, spock;\nconst mccoyName = 'Bones Mccoy';\nconst spockName = 'Mr Spock';\n- before('update sauce job', () => {\n- if (process.env.SAUCE && process.env.INTEGRATION) {\n- browser.reload();\n- const account = new SauceLabs({\n- username: process.env.SAUCE_USERNAME,\n- password: process.env.SAUCE_ACCESS_KEY\n- });\n- account.getJobs((err, jobs) => {\n- const widgetJobs = jobs.filter((job) => job.name === 'react-widget-integration' && job.consolidated_status === 'in progress'\n- && job.os.toLowerCase().includes(platform) && job.browser.toLowerCase().includes(browserName));\n- widgetJobs.forEach((job) => account.updateJob(job.id, {name: 'react-widget-oneOnOne'}));\n- });\n- }\n- });\n-\nbefore('load browsers', () => {\nbrowser.url('/data-api/space.html');\n});\n",
"new_path": "test/journeys/specs/oneOnOne/dataApi/basic.js",
"old_path": "test/journeys/specs/oneOnOne/dataApi/basic.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,7 +5,6 @@ import '@ciscospark/plugin-logger';\nimport '@ciscospark/internal-plugin-conversation';\nimport '@ciscospark/internal-plugin-feature';\nimport CiscoSpark from '@ciscospark/spark-core';\n-import SauceLabs from 'saucelabs';\nimport {moveMouse} from '../../../lib/test-helpers';\nimport {FEATURE_FLAG_GROUP_CALLING, elements as meetElements, hangup} from '../../../lib/test-helpers/space-widget/meet';\n@@ -19,27 +18,10 @@ import {\ndescribe('Widget Recents: Data API', () => {\nconst browserLocal = browser.select('browserLocal');\nconst browserRemote = browser.select('browserRemote');\n- const browserName = process.env.BROWSER || 'chrome';\n- const platform = process.env.PLATFORM || 'mac 10.12';\nlet docbrown, lorraine, marty;\nlet conversation, oneOnOneConversation;\n- before('update sauce job', () => {\n- if (process.env.SAUCE && process.env.INTEGRATION) {\n- browser.reload();\n- const account = new SauceLabs({\n- username: process.env.SAUCE_USERNAME,\n- password: process.env.SAUCE_ACCESS_KEY\n- });\n- account.getJobs((err, jobs) => {\n- const widgetJobs = jobs.filter((job) => job.name === 'react-widget-integration' && job.consolidated_status === 'in progress'\n- && job.os.toLowerCase().includes(platform) && job.browser.toLowerCase().includes(browserName));\n- widgetJobs.forEach((job) => account.updateJob(job.id, {name: 'react-widget-recents'}));\n- });\n- }\n- });\n-\nbefore('load browser', () => {\nbrowserLocal.url('/data-api/recents.html');\n});\n",
"new_path": "test/journeys/specs/recents/dataApi/basic.js",
"old_path": "test/journeys/specs/recents/dataApi/basic.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -4,7 +4,6 @@ import testUsers from '@ciscospark/test-helper-test-users';\nimport '@ciscospark/plugin-logger';\nimport CiscoSpark from '@ciscospark/spark-core';\nimport '@ciscospark/internal-plugin-conversation';\n-import SauceLabs from 'saucelabs';\nimport {elements, openMenuAndClickButton} from '../../../lib/test-helpers/space-widget/main';\nimport {\n@@ -17,26 +16,9 @@ import {\ndescribe('Widget Space: Data API', () => {\nconst browserLocal = browser.select('browserLocal');\n- const browserName = process.env.BROWSER || 'chrome';\n- const platform = process.env.PLATFORM || 'mac 10.12';\nlet biff, docbrown, lorraine, marty;\nlet conversation;\n- before('update sauce job', () => {\n- if (process.env.SAUCE && process.env.INTEGRATION) {\n- browser.reload();\n- const account = new SauceLabs({\n- username: process.env.SAUCE_USERNAME,\n- password: process.env.SAUCE_ACCESS_KEY\n- });\n- account.getJobs((err, jobs) => {\n- const widgetJobs = jobs.filter((job) => job.name === 'react-widget-integration' && job.consolidated_status === 'in progress'\n- && job.os.toLowerCase().includes(platform) && job.browser.toLowerCase().includes(browserName));\n- widgetJobs.forEach((job) => account.updateJob(job.id, {name: 'react-widget-space'}));\n- });\n- }\n- });\n-\nbefore('load browsers', () => {\nbrowser.url('/data-api/space.html');\n});\n",
"new_path": "test/journeys/specs/space/dataApi/basic.js",
"old_path": "test/journeys/specs/space/dataApi/basic.js"
}
] |
JavaScript
|
MIT License
|
webex/react-widgets
|
refactor(journeys): remove browser.reload before hooks
| 1
|
refactor
|
journeys
|
791,723
|
12.04.2018 16:08:26
| 25,200
|
0ab77758dfbbacab1d5151ebd5e3b072e71aeb4a
|
tests: fix run-smoke handoff of testResults
|
[
{
"change_type": "MODIFY",
"diff": "@@ -84,6 +84,7 @@ function displaySmokehouseOutput(result) {\n}\nconsole.timeEnd(`smoketest-${result.id}`);\nconsole.log(`${purpleify(result.id)} smoketest complete. \\n`);\n+ return result;\n}\n/**\n@@ -183,4 +184,7 @@ async function cli() {\nprocess.exit(0);\n}\n-cli();\n+cli().catch(e => {\n+ console.error(e);\n+ process.exit(1);\n+});\n",
"new_path": "lighthouse-cli/test/smokehouse/run-smoke.js",
"old_path": "lighthouse-cli/test/smokehouse/run-smoke.js"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
tests: fix run-smoke handoff of testResults (#4959)
| 1
|
tests
| null |
679,913
|
12.04.2018 16:45:47
| -3,600
|
cb4976fed3575599dfdaecc38524ae9be9db019c
|
feat(associative): add SortedSet, update SortedMap
add compare() & equiv() impls for SortedMap
|
[
{
"change_type": "MODIFY",
"diff": "export * from \"./equiv-map\";\nexport * from \"./equiv-set\";\nexport * from \"./sorted-map\";\n+export * from \"./sorted-set\";\nexport * from \"./difference\";\nexport * from \"./intersection\";\n",
"new_path": "packages/associative/src/index.ts",
"old_path": "packages/associative/src/index.ts"
},
{
"change_type": "MODIFY",
"diff": "-import { Predicate2, Comparator, IObjectOf, ICopy, IEmpty } from \"@thi.ng/api/api\";\n+import { Predicate2, Comparator, IObjectOf, ICompare, ICopy, IEmpty, IEquiv } from \"@thi.ng/api/api\";\nimport { compare } from \"@thi.ng/api/compare\";\nimport { equiv } from \"@thi.ng/api/equiv\";\n+import { illegalArgs } from \"@thi.ng/api/error\";\nimport { isArray } from \"@thi.ng/checks/is-array\";\nimport { map } from \"@thi.ng/iterators/map\";\n@@ -8,7 +9,7 @@ import { Pair, SEMAPHORE } from \"./api\";\n// stores private properties for all instances\n// http://fitzgeraldnick.com/2014/01/13/hiding-implementation-details-with-e6-weakmaps.html\n-const __private = new WeakMap<any, SkipListProps>();\n+const __private = new WeakMap<SortedMap<any, any>, SortedMapProps>();\n/**\n* SortedMapOpts implementation config settings.\n@@ -46,7 +47,7 @@ export interface SortedMapOpts<K> {\nprobability: number;\n}\n-interface SkipListProps {\n+interface SortedMapProps {\nhead: any[];\ntail: any[];\nupdate: any[];\n@@ -65,9 +66,6 @@ const VAL = 1;\nconst PREV = 2;\nconst NEXT = 3;\n-const DEFAULT_CAP = 16;\n-const DEFAULT_P = 1 / Math.E;\n-\nconst makeNode = (level: number, key?, value?) => {\nconst node = new Array(4 + level);\nnode[KEY] = key;\n@@ -95,7 +93,9 @@ const makeNode = (level: number, key?, value?) => {\n*/\nexport class SortedMap<K, V> extends Map<K, V> implements\nICopy<SortedMap<K, V>>,\n- IEmpty<SortedMap<K, V>> {\n+ ICompare<Map<K, V>>,\n+ IEmpty<SortedMap<K, V>>,\n+ IEquiv {\nstatic fromObject<T>(obj: IObjectOf<T>): SortedMap<PropertyKey, T> {\nconst m = new SortedMap<PropertyKey, T>(null, { capacity: Object.keys(obj).length });\n@@ -105,9 +105,15 @@ export class SortedMap<K, V> extends Map<K, V> implements\nreturn m;\n}\n+ static readonly DEFAULT_CAP = 16;\n+ static readonly DEFAULT_P = 1 / Math.E;\n+\n/**\n* Creates new instance with optional given key-value pairs and/or\n* implementation options.\n+ *\n+ * @param values\n+ * @param opts\n*/\nconstructor(values?: Iterable<Pair<K, V>>, opts: Partial<SortedMapOpts<K>> = {}) {\nsuper();\n@@ -130,15 +136,59 @@ export class SortedMap<K, V> extends Map<K, V> implements\n}\nclear() {\n- this.init(null, { ...this.getOpts(1), capacity: DEFAULT_CAP });\n+ this.init(null, { ...this.getOpts(), capacity: SortedMap.DEFAULT_CAP });\n}\nempty(): SortedMap<K, V> {\n- return new SortedMap<K, V>(null, { ...this.getOpts(1), capacity: DEFAULT_CAP });\n+ return new SortedMap<K, V>(null, { ...this.getOpts(), capacity: SortedMap.DEFAULT_CAP });\n}\ncopy(): SortedMap<K, V> {\n- return new SortedMap<K, V>(this, { ...this.getOpts(1), capacity: DEFAULT_CAP });\n+ return new SortedMap<K, V>(this, this.getOpts());\n+ }\n+\n+ compare(o: Map<K, V>) {\n+ const n = this.size, m = o.size;\n+ if (n < m) return -1;\n+ if (n > m) return 1;\n+ const i = this.entries();\n+ const j = o.entries();\n+ let x: IteratorResult<Pair<K, V>>, y: IteratorResult<Pair<K, V>>;\n+ let c: number;\n+ while ((x = i.next(), y = j.next(), !x.done && !y.done)) {\n+ if ((c = compare(x.value[0], y.value[0])) !== 0) {\n+ return c;\n+ }\n+ if ((c = compare(x.value[1], y.value[1])) !== 0) {\n+ return c;\n+ }\n+ }\n+ return 0;\n+ }\n+\n+ equiv(o: any) {\n+ if (this === o) {\n+ return true;\n+ }\n+ if (!(o instanceof Map)) {\n+ return false;\n+ }\n+ if (this.size !== o.size) {\n+ return false;\n+ }\n+ for (let x of this) {\n+ if (!equiv(x[1], o.get(x[0]))) {\n+ return false;\n+ }\n+ }\n+ return true;\n+ }\n+\n+ first(): Pair<K, V> {\n+ const node = __private.get(this).head[NEXT];\n+ if (node[KEY] !== undefined) {\n+ return [node[KEY], node[VAL]];\n+ }\n}\nforEach(fn: (val: V, key: K, map: Map<K, V>) => void, thisArg?: any) {\n@@ -248,23 +298,24 @@ export class SortedMap<K, V> extends Map<K, V> implements\n}\n}\n- keys(): IterableIterator<K> {\n- return map((p) => p[0], this.entries());\n+ keys(key?: K, reverse = false): IterableIterator<K> {\n+ return map((p) => p[0], this.entries(key, reverse));\n}\n- values(): IterableIterator<V> {\n- return map((p) => p[1], this.entries());\n+ values(key?: K, reverse = false): IterableIterator<V> {\n+ return map((p) => p[1], this.entries(key, reverse));\n}\nprotected init(values: Iterable<Pair<K, V>>, opts: Partial<SortedMapOpts<K>>) {\nlet cap;\nif (values && !opts.capacity) {\nvalues = isArray(values) ? values : [...values];\n- cap = (<any>values).length;\n+ cap = Math.max((<any>values).length, SortedMap.DEFAULT_CAP);\n}\nelse {\n- cap = opts.capacity || DEFAULT_CAP;\n+ cap = opts.capacity || SortedMap.DEFAULT_CAP;\n}\n+ cap < 1 && illegalArgs(`invalid capacity: ${cap}`);\nconst maxLevel = Math.ceil(Math.log2(cap));\nconst nil = makeNode(-1);\nconst head = makeNode(maxLevel).fill(nil, 3);\n@@ -278,13 +329,23 @@ export class SortedMap<K, V> extends Map<K, V> implements\ncmp: opts.compare || compare,\nlevel: 0,\nmaxLevel,\n- p: opts.probability || DEFAULT_P,\n+ p: opts.probability || SortedMap.DEFAULT_P,\ncap: Math.pow(2, maxLevel),\nlength: 0\n});\nreturn values;\n}\n+ getOpts(growFactor = 1): SortedMapOpts<K> {\n+ const $this = __private.get(this);\n+ return {\n+ capacity: $this.cap * growFactor,\n+ equiv: $this.equiv,\n+ compare: $this.cmp,\n+ probability: $this.p,\n+ };\n+ }\n+\n/**\n* Recreates map with double capacity.\n*/\n@@ -296,16 +357,6 @@ export class SortedMap<K, V> extends Map<K, V> implements\n__private.delete(tmp);\n}\n- protected getOpts(growFactor: number): SortedMapOpts<K> {\n- const $this = __private.get(this);\n- return {\n- capacity: $this.cap * growFactor,\n- equiv: $this.equiv,\n- compare: $this.cmp,\n- probability: $this.p,\n- };\n- }\n-\nprotected randomLevel() {\nconst $this = __private.get(this);\nconst max = Math.min($this.maxLevel, $this.level + 1);\n@@ -333,7 +384,7 @@ export class SortedMap<K, V> extends Map<K, V> implements\n}\n/**\n- * Like `findLess` but records node path in `update` array\n+ * Like `findLess`, but records path in `update` array\n*\n* @param update\n* @param key\n@@ -354,10 +405,3 @@ export class SortedMap<K, V> extends Map<K, V> implements\nreturn node;\n}\n}\n-/*\n-const m = SortedMap.fromObject({ a: 1, b: 2, c: 0 });\n-console.log(\"a\", [...m.entries(\"a\")]);\n-console.log(\"aa\", [...m.entries(\"aa\")]);\n-console.log(\"d\", [...m.entries(\"d\")]);\n-console.log(\"@\", [...m.entries(\"@\")]);\n-*/\n\\ No newline at end of file\n",
"new_path": "packages/associative/src/sorted-map.ts",
"old_path": "packages/associative/src/sorted-map.ts"
},
{
"change_type": "ADD",
"diff": "+import { ICopy, IEmpty, IEquiv, ICompare } from \"@thi.ng/api/api\";\n+import { map } from \"@thi.ng/iterators/map\";\n+\n+import { Pair } from \"./api\";\n+import { SortedMap, SortedMapOpts } from \"./sorted-map\";\n+import { compare } from \"@thi.ng/api/compare\";\n+\n+export type SortedSetOpts<T> = SortedMapOpts<T>;\n+\n+const __private = new WeakMap<SortedSet<any>, SortedMap<any, any>>();\n+\n+/**\n+ * Sorted set implementation with standard ES6 Set API, customizable\n+ * value equality and comparison semantics and additional functionality:\n+ *\n+ * - range queries (via `entries`, `keys`, `values`)\n+ * - multiple value addition/deletion via `into()` and `disj()`\n+ *\n+ * Furthermore, this class implements the `ICopy`, IEmpty`, `ICompare`\n+ * and `IEquiv` interfaces defined by `@thi.ng/api`. The latter two\n+ * allow instances to be used as keys themselves in other data types\n+ * defined in this (and other) package(s).\n+ *\n+ * This set uses a `SortedMap` as backing store and therefore has the\n+ * same resizing characteristics.\n+ */\n+export class SortedSet<T> extends Set<T> implements\n+ ICopy<SortedSet<T>>,\n+ ICompare<Set<T>>,\n+ IEmpty<SortedSet<T>>,\n+ IEquiv {\n+\n+ /**\n+ * Creates new instance with optional given values and/or\n+ * implementation options. The options are the same as used by\n+ * `SortedMap`.\n+ *\n+ * @param values\n+ * @param opts\n+ */\n+ constructor(values?: Iterable<T>, opts?: SortedSetOpts<T>) {\n+ super();\n+ __private.set(this, new SortedMap<T, T>(\n+ values ? map((x) => [x, x], values) : null,\n+ opts\n+ ));\n+ }\n+\n+ [Symbol.iterator](): IterableIterator<T> {\n+ return this.keys();\n+ }\n+\n+ get [Symbol.species]() {\n+ return SortedSet;\n+ }\n+\n+ get size() {\n+ return __private.get(this).size;\n+ }\n+\n+ copy(): SortedSet<T> {\n+ return new SortedSet<T>(this.keys(), this.getOpts());\n+ }\n+\n+ empty() {\n+ return new SortedSet<T>(null, { ...this.getOpts(), capacity: SortedMap.DEFAULT_CAP });\n+ }\n+\n+ compare(o: Set<T>) {\n+ const n = this.size, m = o.size;\n+ if (n < m) return -1;\n+ if (n > m) return 1;\n+ const i = this.entries();\n+ const j = o.entries();\n+ let x: IteratorResult<Pair<T, T>>, y: IteratorResult<Pair<T, T>>;\n+ let c: number;\n+ while ((x = i.next(), y = j.next(), !x.done && !y.done)) {\n+ if ((c = compare(x.value[0], y.value[0])) !== 0) {\n+ return c;\n+ }\n+ }\n+ return 0;\n+ }\n+\n+ equiv(o: any) {\n+ if (this === o) {\n+ return true;\n+ }\n+ if (!(o instanceof Set)) {\n+ return false;\n+ }\n+ if (this.size !== o.size) {\n+ return false;\n+ }\n+ for (let x of this) {\n+ if (!o.has(x)) {\n+ return false;\n+ }\n+ }\n+ return true;\n+ }\n+\n+ entries(): IterableIterator<Pair<T, T>> {\n+ return __private.get(this).entries();\n+ }\n+\n+ keys(): IterableIterator<T> {\n+ return __private.get(this).keys();\n+ }\n+\n+ values(): IterableIterator<T> {\n+ return __private.get(this).values();\n+ }\n+\n+ add(value: T) {\n+ __private.get(this).set(value, value);\n+ return this;\n+ }\n+\n+ clear(): void {\n+ __private.get(this).clear();\n+ }\n+\n+ first() {\n+ const first = __private.get(this).first();\n+ return first ? first[0] : undefined;\n+ }\n+\n+ delete(value: T): boolean {\n+ return __private.get(this).delete(value);\n+ }\n+\n+ forEach(fn: (val: T, val2: T, set: Set<T>) => void, thisArg?: any): void {\n+ for (let p of this) {\n+ fn.call(thisArg, p[0], p[0], this);\n+ }\n+ }\n+\n+ has(value: T): boolean {\n+ return __private.get(this).has(value);\n+ }\n+\n+ get(value: T, notFound?: any) {\n+ return __private.get(this).get(value, notFound);\n+ }\n+\n+ getOpts() {\n+ return __private.get(this).getOpts();\n+ }\n+}\n\\ No newline at end of file\n",
"new_path": "packages/associative/src/sorted-set.ts",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(associative): add SortedSet, update SortedMap
- add compare() & equiv() impls for SortedMap
| 1
|
feat
|
associative
|
791,723
|
12.04.2018 17:09:27
| 25,200
|
0db69e52c7c43db4f4255df43cf9af109cd82eb6
|
tests: add CI test to confirm sample_v2.json is up to date
|
[
{
"change_type": "MODIFY",
"diff": "@@ -36,6 +36,7 @@ script:\n- yarn unit:silentcoverage\n- yarn type-check\n- yarn closure\n+ - yarn diff:sample-json\n- yarn smoke\n- yarn test-extension\n# _JAVA_OPTIONS is breaking parsing of compiler output. See #3338.\n",
"new_path": ".travis.yml",
"old_path": ".travis.yml"
},
{
"change_type": "ADD",
"diff": "+#!/usr/bin/env node\n+\n+/**\n+ * @license Copyright 2018 Google Inc. All Rights Reserved.\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n+ */\n+'use strict';\n+\n+/** @fileoverview Read in a LHR JSON file, remove whatever shouldn't be compared, write it back. */\n+\n+const {readFileSync, writeFileSync} = require('fs');\n+\n+const filename = process.argv[2];\n+if (!filename) throw new Error('No filename provided.');\n+\n+const data = readFileSync(filename, 'utf8');\n+writeFileSync(filename, cleanAndFormatLHR(data), 'utf8');\n+\n+/**\n+ * @param {string} lhrString\n+ * @return {string}\n+ */\n+function cleanAndFormatLHR(lhrString) {\n+ const lhr = JSON.parse(lhrString);\n+ delete lhr.timing;\n+ return JSON.stringify(lhr, null, 2);\n+}\n",
"new_path": "lighthouse-core/scripts/cleanup-LHR-for-diff.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "\"debug\": \"node --inspect-brk ./lighthouse-cli/index.js\",\n\"start\": \"node ./lighthouse-cli/index.js\",\n- \"test\": \"yarn lint --quiet && yarn unit && yarn type-check && yarn closure\",\n+ \"test\": \"yarn lint --quiet && yarn unit && yarn type-check && yarn closure && yarn diff:sample-json\",\n\"test-extension\": \"cd lighthouse-extension && yarn test\",\n\"unit-core\": \"mocha --reporter dot \\\"lighthouse-core/test/**/*-test.js\\\"\",\n\"type-check\": \"tsc -p .\",\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 --output=json --output-path=./lighthouse-core/test/results/sample_v2.json http://localhost/dobetterweb/dbw_tester.html\",\n+ \"diff:sample-json\": \"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' --config-path=./lighthouse-core/config/mixed-content.js\"\n},\n",
"new_path": "package.json",
"old_path": "package.json"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
tests: add CI test to confirm sample_v2.json is up to date (#4956)
| 1
|
tests
| null |
730,413
|
12.04.2018 17:30:02
| 14,400
|
4673906fddecb63652e671ad25280c7032e2e236
|
chore(tooling): set selenium version for chrome
|
[
{
"change_type": "MODIFY",
"diff": "@@ -37,6 +37,7 @@ const chromeCapabilities = {\nidleTimeout: 300,\ncommandTimeout: 600,\nmaxDuration: 3600,\n+ seleniumVersion: '3.4.0',\nscreenResolution,\nplatform\n};\n@@ -135,7 +136,6 @@ exports.config = {\n'./test/journeys/specs/space/global/meet.js',\n'./test/journeys/specs/space/global/messaging.js',\n'./test/journeys/specs/space/featureFlags.js'\n-\n]\n},\n// Patterns to exclude.\n",
"new_path": "wdio.conf.js",
"old_path": "wdio.conf.js"
}
] |
JavaScript
|
MIT License
|
webex/react-widgets
|
chore(tooling): set selenium version for chrome
| 1
|
chore
|
tooling
|
815,746
|
12.04.2018 17:47:01
| -10,800
|
21495173eb69e39bc4a9bd5f04a5b59cfbb584a9
|
fix: remove input if searchable is false
|
[
{
"change_type": "MODIFY",
"diff": "[ngTemplateOutletContext]=\"{ items: selectedValues, clear: clearItem }\">\n</ng-template>\n- <div *ngIf=\"showFilter()\" class=\"ng-input\">\n+ <div *ngIf=\"!isDisabled\" class=\"ng-input\">\n+ <div *ngIf=\"!searchable\"\n+ tabindex=\"0\"\n+ (focus)=\"onInputFocus()\"\n+ (blur)=\"onInputBlur()\"\n+ role=\"combobox\"\n+ [attr.aria-expanded]=\"isOpen\"\n+ [attr.aria-owns]=\"isOpen ? dropdownId : null\"\n+ [attr.aria-activedescendant]=\"isOpen ? itemsList?.markedItem?.htmlId : null\">\n+ </div>\n<input #filterInput\n+ *ngIf=\"searchable\"\ntype=\"text\"\nautocomplete=\"off\"\n- [readOnly]=\"!searchable\"\n[value]=\"filterValue\"\n(input)=\"filter(filterInput.value)\"\n(focus)=\"onInputFocus()\"\n",
"new_path": "src/ng-select/ng-select.component.html",
"old_path": "src/ng-select/ng-select.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -1772,9 +1772,12 @@ describe('NgSelectComponent', function () {\n[(ngModel)]=\"selectedCity\">\n</ng-select>`);\n- fixture.componentInstance.select.filter('vilnius');\n+ const select = fixture.componentInstance.select;\n+ select.filter('vilnius');\ntickAndDetectChanges(fixture);\n- expect(fixture.componentInstance.select.filterValue).toBe(null);\n+ const filterInput = select.elementRef.nativeElement.querySelector('input');\n+ expect(select.filterValue).toBeNull();\n+ expect(filterInput).toBeNull();\n}));\nit('should mark first item on filter', fakeAsync(() => {\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": "@@ -377,10 +377,6 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n!this.isLoading;\n}\n- showFilter() {\n- return !this.isDisabled;\n- }\n-\nshowNoItemsFound() {\nconst empty = this.itemsList.filteredItems.length === 0;\nreturn ((empty && !this._isTypeahead && !this.loading) ||\n@@ -436,6 +432,9 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\nfocusSearchInput() {\n+ if (!this.filterInput) {\n+ return;\n+ }\nthis.filterInput.nativeElement.focus();\nthis.filterInput.nativeElement.select();\n}\n",
"new_path": "src/ng-select/ng-select.component.ts",
"old_path": "src/ng-select/ng-select.component.ts"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
fix: remove input if searchable is false (#442)
#390
| 1
|
fix
| null |
807,849
|
12.04.2018 18:17:43
| 25,200
|
39fa7b6436108c3e35a06f8fb96d0605b50f33bb
|
feat(add): Use directory globs to filter targeted packages
BREAKING CHANGE: `lerna add` now only supports adding one dependency at a time. It is much more valuable to filter by directory globs, anyway.
|
[
{
"change_type": "MODIFY",
"diff": "@@ -32,7 +32,7 @@ describe(\"AddCommand\", () => {\ntry {\nawait lernaAdd(testDir)();\n} catch (err) {\n- expect(err.message).toMatch(/^Missing list of packages/);\n+ expect(err.message).toMatch(/^Not enough non-option arguments/);\n}\n});\n@@ -69,23 +69,11 @@ describe(\"AddCommand\", () => {\nexpect(await readPkg(testDir, \"packages/package-4\")).toDependOn(\"@test/package-1\");\n});\n- it(\"should reference to multiple dependencies\", async () => {\n- const testDir = await initFixture(\"basic\");\n-\n- await lernaAdd(testDir)(\"@test/package-1\", \"@test/package-2\");\n-\n- expect(await readPkg(testDir, \"packages/package-1\")).toDependOn(\"@test/package-2\");\n- expect(await readPkg(testDir, \"packages/package-2\")).toDependOn(\"@test/package-1\");\n- expect(await readPkg(testDir, \"packages/package-3\")).toDependOn(\"@test/package-1\");\n- expect(await readPkg(testDir, \"packages/package-3\")).toDependOn(\"@test/package-2\");\n- expect(await readPkg(testDir, \"packages/package-4\")).toDependOn(\"@test/package-1\");\n- expect(await readPkg(testDir, \"packages/package-4\")).toDependOn(\"@test/package-2\");\n- });\n-\nit(\"should reference current caret range if unspecified\", async () => {\nconst testDir = await initFixture(\"basic\");\n- await lernaAdd(testDir)(\"@test/package-1\", \"@test/package-2\");\n+ await lernaAdd(testDir)(\"@test/package-1\");\n+ await lernaAdd(testDir)(\"@test/package-2\");\nexpect(await readPkg(testDir, \"packages/package-1\")).toDependOn(\"@test/package-2\", \"^2.0.0\");\nexpect(await readPkg(testDir, \"packages/package-2\")).toDependOn(\"@test/package-1\", \"^1.0.0\");\n@@ -117,10 +105,10 @@ describe(\"AddCommand\", () => {\nexpect(await readPkg(testDir, \"packages/package-1\")).not.toDependOn(\"@test/package-1\");\n});\n- it(\"should respect scopes\", async () => {\n+ it(\"filters targets by optional directory globs\", async () => {\nconst testDir = await initFixture(\"basic\");\n- await lernaAdd(testDir)(\"@test/package-1\", \"--scope=@test/package-2\");\n+ await lernaAdd(testDir)(\"@test/package-1\", \"packages/package-2\");\nexpect(await readPkg(testDir, \"packages/package-2\")).toDependOn(\"@test/package-1\");\nexpect(await readPkg(testDir, \"packages/package-3\")).not.toDevDependOn(\"@test/package-1\");\n@@ -203,28 +191,4 @@ describe(\"AddCommand\", () => {\nexpect(bootstrap).not.toHaveBeenCalled();\n});\n-\n- it(\"bootstraps mixed local and external dependencies\", async () => {\n- const testDir = await initFixture(\"existing\");\n-\n- await lernaAdd(testDir)(\"@test/package-2\", \"pify\");\n-\n- const pkg1 = await readPkg(testDir, \"packages/package-1\");\n- const pkg2 = await readPkg(testDir, \"packages/package-2\");\n- const pkg3 = await readPkg(testDir, \"packages/package-3\");\n-\n- expect(pkg1).toDependOn(\"pify\", \"^3.0.0\"); // overwrites ^2.0.0\n- expect(pkg1).toDependOn(\"@test/package-2\");\n-\n- expect(pkg2).toDependOn(\"pify\", \"^3.0.0\");\n-\n- expect(pkg3).toDependOn(\"pify\", \"^3.0.0\");\n- expect(pkg3).toDependOn(\"@test/package-2\"); // existing, but should stay\n-\n- expect(bootstrap).lastCalledWith(\n- expect.objectContaining({\n- scope: [\"@test/package-1\", \"@test/package-2\", \"@test/package-3\"],\n- })\n- );\n- });\n});\n",
"new_path": "commands/add/__tests__/add-command.test.js",
"old_path": "commands/add/__tests__/add-command.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,16 +5,20 @@ const filterable = require(\"@lerna/filter-options\");\n/**\n* @see https://github.com/yargs/yargs/blob/master/docs/advanced.md#providing-a-command-module\n*/\n-exports.command = \"add [pkgNames..]\";\n+exports.command = \"add <pkg> [globs..]\";\n-exports.describe = \"Add dependencies to matched packages\";\n+exports.describe = \"Add a dependency to matched packages\";\nexports.builder = yargs => {\nyargs\n- .positional(\"pkgNames\", {\n- describe: \"One or more package names to add as a dependency\",\n+ .positional(\"pkg\", {\n+ describe: \"Package name to add as a dependency\",\ntype: \"string\",\n})\n+ .positional(\"globs\", {\n+ describe: \"Optional package directory globs to match\",\n+ type: \"array\",\n+ })\n.options({\ndev: {\ngroup: \"Command Options:\",\n",
"new_path": "commands/add/command.js",
"old_path": "commands/add/command.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -4,6 +4,7 @@ const dedent = require(\"dedent\");\nconst npa = require(\"npm-package-arg\");\nconst packageJson = require(\"package-json\");\nconst pMap = require(\"p-map\");\n+const path = require(\"path\");\nconst semver = require(\"semver\");\nconst Command = require(\"@lerna/command\");\n@@ -24,36 +25,27 @@ class AddCommand extends Command {\ninitialize() {\nthis.dependencyType = this.options.dev ? \"devDependencies\" : \"dependencies\";\n- this.specs = this.options.pkgNames.map(input => npa(input));\n+ this.spec = npa(this.options.pkg);\n+ this.dirs = new Set(this.options.globs.map(fp => path.resolve(this.project.rootPath, fp)));\n+ this.selfSatisfied = this.packageSatisfied();\n- if (this.specs.length === 0) {\n- throw new ValidationError(\"EINPUT\", \"Missing list of packages to add to your project.\");\n- }\n-\n- const unsatisfied = this.specs\n- .filter(spec => this.packageGraph.has(spec.name))\n- .filter(spec => !this.packageSatisfied(spec))\n- .map(({ name, fetchSpec }) => ({\n- name,\n- fetchSpec,\n- version: this.packageGraph.get(name).version,\n- }));\n+ if (this.packageGraph.has(this.spec.name) && !this.selfSatisfied) {\n+ const available = this.packageGraph.get(this.spec.name).version;\n- if (unsatisfied.length > 0) {\nthrow new ValidationError(\n\"ENOTSATISFIED\",\ndedent`\nRequested range not satisfiable:\n- ${unsatisfied.map(u => `${u.name}@${u.versionRange} (available: ${u.version})`).join(\", \")}\n+ ${this.spec.name}@${this.spec.fetchSpec} (available: ${available})\n`\n);\n}\nlet chain = Promise.resolve();\n- chain = chain.then(() => this.collectInstallSpecs());\n- chain = chain.then(installSpecs => {\n- this.installSpecs = installSpecs;\n+ chain = chain.then(() => this.getPackageVersion());\n+ chain = chain.then(version => {\n+ this.spec.version = version;\n});\nchain = chain.then(() => this.collectPackagesToChange());\n@@ -65,11 +57,7 @@ class AddCommand extends Command {\nconst proceed = this.packagesToChange.length > 0;\nif (!proceed) {\n- this.logger.warn(\n- `No packages found in scope where ${this.installSpecs\n- .map(spec => spec.name)\n- .join(\", \")} can be added.`\n- );\n+ this.logger.warn(`No packages found where ${this.spec.name} can be added.`);\n}\nreturn proceed;\n@@ -77,10 +65,14 @@ class AddCommand extends Command {\n}\nexecute() {\n- this.logger.info(`Add ${this.dependencyType} in ${this.packagesToChange.length} packages`);\n+ const numberOfPackages = `${this.packagesToChange.length} package${\n+ this.packagesToChange.length > 1 ? \"s\" : \"\"\n+ }`;\n+\n+ this.logger.info(\"add\", `adding ${this.spec.name} in ${numberOfPackages}`);\nreturn this.makeChanges().then(() => {\n- this.logger.info(`Changes require bootstrap in ${this.packagesToChange.length} packages`);\n+ this.logger.info(\"add\", `Bootstrapping ${numberOfPackages}`);\nreturn bootstrap(\nObject.assign({}, this.options, {\n@@ -92,54 +84,47 @@ class AddCommand extends Command {\n});\n}\n- collectInstallSpecs() {\n- return pMap(\n- this.specs,\n- spec => this.getPackageVersion(spec).then(version => Object.assign(spec, { version })),\n- { concurrency: this.concurrency }\n- );\n- }\n-\ncollectPackagesToChange() {\n+ const { name: targetName } = this.spec;\nlet result = this.filteredPackages;\n// Skip packages that only would install themselves\n- result = result.filter(pkg => this.installSpecs.some(spec => spec.name !== pkg.name));\n+ if (this.packageGraph.has(targetName)) {\n+ result = result.filter(pkg => pkg.name !== targetName);\n+ }\n+\n+ // Skip packages that are not selected by dir globs\n+ if (this.dirs.size) {\n+ result = result.filter(pkg => this.dirs.has(pkg.location));\n+ }\n// Skip packages without actual changes to manifest\nresult = result.filter(pkg => {\nconst deps = this.getPackageDeps(pkg);\n// Check if one of the packages to install necessitates a change to pkg's manifest\n- return this.installSpecs.filter(spec => spec.name !== pkg.name).some(spec => {\n- if (!(spec.name in deps)) {\n+ if (!(targetName in deps)) {\nreturn true;\n}\n- return getRangeToReference(spec, deps) !== deps[spec.name];\n- });\n+ return getRangeToReference(this.spec, deps) !== deps[targetName];\n});\nreturn result;\n}\nmakeChanges() {\n- const mapper = pkg => {\n+ const { name: targetName } = this.spec;\n+\n+ return pMap(this.packagesToChange, pkg => {\nconst deps = this.getPackageDeps(pkg);\n+ const range = getRangeToReference(this.spec, deps);\n- for (const spec of this.installSpecs) {\n- if (spec.name !== pkg.name) {\n- const range = getRangeToReference(spec, deps);\n-\n- this.logger.verbose(`Add ${spec.name}@${range} as ${this.dependencyType} in ${pkg.name}`);\n- deps[spec.name] = range;\n- }\n- }\n+ this.logger.verbose(\"add\", `${targetName}@${range} as ${this.dependencyType} in ${pkg.name}`);\n+ deps[targetName] = range;\nreturn pkg.serialize();\n- };\n-\n- return pMap(this.packagesToChange, mapper);\n+ });\n}\ngetPackageDeps(pkg) {\n@@ -153,26 +138,29 @@ class AddCommand extends Command {\nreturn deps;\n}\n- getPackageVersion(spec) {\n- if (this.packageSatisfied(spec)) {\n- return Promise.resolve(this.packageGraph.get(spec.name).version);\n+ getPackageVersion() {\n+ const { name, fetchSpec } = this.spec;\n+\n+ if (this.selfSatisfied) {\n+ return Promise.resolve(this.packageGraph.get(name).version);\n}\n- return packageJson(spec.name, { version: spec.fetchSpec }).then(pkg => pkg.version);\n+ return packageJson(name, { version: fetchSpec }).then(pkg => pkg.version);\n}\n- packageSatisfied(spec) {\n- const pkg = this.packageGraph.get(spec.name);\n+ packageSatisfied() {\n+ const { name, fetchSpec } = this.spec;\n+ const pkg = this.packageGraph.get(name);\nif (!pkg) {\nreturn false;\n}\n- if (spec.fetchSpec === \"latest\") {\n+ if (fetchSpec === \"latest\") {\nreturn true;\n}\n- return semver.intersects(pkg.version, spec.fetchSpec);\n+ return semver.intersects(pkg.version, fetchSpec);\n}\n}\n",
"new_path": "commands/add/index.js",
"old_path": "commands/add/index.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
feat(add): Use directory globs to filter targeted packages
BREAKING CHANGE: `lerna add` now only supports adding one dependency at a time. It is much more valuable to filter by directory globs, anyway.
| 1
|
feat
|
add
|
807,849
|
12.04.2018 18:24:27
| 25,200
|
f59bf3cff4524e7d7fb9b6a154b32c3043242b7e
|
feat(link): Add 'convert' subcommand to aid migration to local file: specifiers
|
[
{
"change_type": "MODIFY",
"diff": "*/\nexports.command = \"link\";\n-exports.describe = \"Symlink together all packages which are dependencies of each other\";\n+exports.describe = \"Symlink together all packages that are dependencies of each other\";\n-exports.builder = {\n+exports.builder = yargs => {\n+ yargs.options({\n\"force-local\": {\ngroup: \"Command Options:\",\n- describe: \"Force local\",\n+ describe: \"Force local sibling links regardless of version range match\",\ntype: \"boolean\",\ndefault: undefined,\n},\n+ });\n+\n+ return yargs.command(\n+ \"convert\",\n+ \"Replace local sibling version ranges with relative file: specifiers\",\n+ () => {},\n+ handler\n+ );\n};\n-exports.handler = function handler(argv) {\n+exports.handler = handler;\n+function handler(argv) {\nreturn require(\".\")(argv);\n-};\n+}\n",
"new_path": "commands/link/command.js",
"old_path": "commands/link/command.js"
},
{
"change_type": "MODIFY",
"diff": "\"use strict\";\n+const path = require(\"path\");\n+const pMap = require(\"p-map\");\n+const slash = require(\"slash\");\nconst Command = require(\"@lerna/command\");\nconst PackageGraph = require(\"@lerna/package-graph\");\nconst symlinkDependencies = require(\"@lerna/symlink-dependencies\");\n@@ -32,8 +35,48 @@ class LinkCommand extends Command {\n}\nexecute() {\n+ if (this.options._.pop() === \"convert\") {\n+ return this.convertLinksToFileSpecs();\n+ }\n+\nreturn symlinkDependencies(this.packages, this.targetGraph, this.logger);\n}\n+\n+ convertLinksToFileSpecs() {\n+ const rootPkg = this.project.manifest;\n+ const rootDependencies = {};\n+ const hoisted = {};\n+ const changed = new Set();\n+ const savePrefix = \"file:\";\n+\n+ for (const targetNode of this.targetGraph.values()) {\n+ const resolved = { name: targetNode.name, type: \"directory\" };\n+\n+ // install root file: specifiers to avoid bootstrap\n+ rootDependencies[targetNode.name] = targetNode.pkg.resolved.saveSpec;\n+\n+ for (const depNode of targetNode.localDependents.values()) {\n+ const depVersion = slash(path.relative(depNode.pkg.location, targetNode.pkg.location));\n+ // console.log(\"\\n%s\\n %j: %j\", depNode.name, name, `${savePrefix}${depVersion}`);\n+\n+ depNode.pkg.updateLocalDependency(resolved, depVersion, savePrefix);\n+ changed.add(depNode);\n+ }\n+\n+ if (targetNode.pkg.devDependencies) {\n+ // hoist _all_ devDependencies to the root\n+ Object.assign(hoisted, targetNode.pkg.devDependencies);\n+ targetNode.pkg.set(\"devDependencies\", {});\n+ changed.add(targetNode);\n+ }\n+ }\n+\n+ // mutate project manifest, completely overwriting existing dependencies\n+ rootPkg.set(\"dependencies\", rootDependencies);\n+ rootPkg.set(\"devDependencies\", Object.assign(rootPkg.get(\"devDependencies\") || {}, hoisted));\n+\n+ return pMap(changed, node => node.pkg.serialize()).then(() => rootPkg.serialize());\n+ }\n}\nmodule.exports.LinkCommand = LinkCommand;\n",
"new_path": "commands/link/index.js",
"old_path": "commands/link/index.js"
},
{
"change_type": "MODIFY",
"diff": "\"dependencies\": {\n\"@lerna/command\": \"file:../../core/command\",\n\"@lerna/package-graph\": \"file:../../core/package-graph\",\n- \"@lerna/symlink-dependencies\": \"file:../../utils/symlink-dependencies\"\n+ \"@lerna/symlink-dependencies\": \"file:../../utils/symlink-dependencies\",\n+ \"p-map\": \"^1.2.0\",\n+ \"slash\": \"^1.0.0\"\n}\n}\n",
"new_path": "commands/link/package.json",
"old_path": "commands/link/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"requires\": {\n\"@lerna/command\": \"file:core/command\",\n\"@lerna/package-graph\": \"file:core/package-graph\",\n- \"@lerna/symlink-dependencies\": \"file:utils/symlink-dependencies\"\n+ \"@lerna/symlink-dependencies\": \"file:utils/symlink-dependencies\",\n+ \"p-map\": \"1.2.0\",\n+ \"slash\": \"1.0.0\"\n}\n},\n\"@lerna/list\": {\n",
"new_path": "package-lock.json",
"old_path": "package-lock.json"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
feat(link): Add 'convert' subcommand to aid migration to local file: specifiers
| 1
|
feat
|
link
|
807,849
|
12.04.2018 18:26:29
| 25,200
|
ec2b8f5b872bbcb41040d1738d1235a39e41666f
|
fix(package): Resolve correct relative spec
|
[
{
"change_type": "MODIFY",
"diff": "@@ -29,7 +29,7 @@ function shallowCopy(json) {\nclass Package {\nconstructor(pkg, location, rootPath = location) {\n// npa will throw an error if the name is invalid\n- const resolved = npa.resolve(pkg.name, path.relative(rootPath, location), rootPath);\n+ const resolved = npa.resolve(pkg.name, `file:${path.relative(rootPath, location)}`, rootPath);\nObject.defineProperties(this, {\n// read-only\n@@ -44,7 +44,7 @@ class Package {\nvalue: Boolean(pkg.private),\n},\nresolved: {\n- value: Object.assign({}, resolved),\n+ value: resolved,\n},\n// mutable\nversion: {\n",
"new_path": "core/package/index.js",
"old_path": "core/package/index.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
fix(package): Resolve correct relative spec
| 1
|
fix
|
package
|
815,746
|
12.04.2018 18:49:59
| -10,800
|
cb71544f6c86a5b53da5547caf55c5e5b089e57a
|
fix: rename focusSearchInput to focus
|
[
{
"change_type": "MODIFY",
"diff": "@@ -20,10 +20,12 @@ import { delay } from 'rxjs/operators';\n<div class=\"form-row\">\n<div class=\"form-group col-md-6\">\n<label for=\"yesno\">Not searchable</label>\n- <ng-select [searchable]=\"false\" formControlName=\"agree\">\n+ <ng-select #agreeSelect [searchable]=\"false\" formControlName=\"agree\">\n<ng-option [value]=\"true\">Yes</ng-option>\n<ng-option [value]=\"false\">No</ng-option>\n</ng-select>\n+ <br />\n+ <button (click)=\"agreeSelect.focus()\" class=\"btn btn-sm btn-secondary\">Focus select</button>\n</div>\n<div class=\"form-group col-md-6\">\n<label for=\"heroId\">Basic select</label>\n@@ -44,7 +46,7 @@ import { delay } from 'rxjs/operators';\n<div class=\"form-group\">\n<label for=\"state\">Single select</label>\n---html,true\n- <ng-select [items]=\"ages\"\n+ <ng-select #agesSelect [items]=\"ages\"\n[selectOnTab]=\"true\"\nbindValue=\"value\"\nplaceholder=\"Select age\"\n@@ -54,6 +56,7 @@ import { delay } from 'rxjs/operators';\n<small class=\"form-text text-muted\">With required validation</small>\n<br>\n<button class=\"btn btn-secondary btn-sm\" (click)=\"toggleAgeDisable()\">Toggle disabled</button>\n+ <button (click)=\"agesSelect.focus()\" class=\"btn btn-sm btn-secondary\">Focus select</button>\n</div>\n<hr>\n<div class=\"form-group\">\n",
"new_path": "demo/app/examples/reactive-forms.component.ts",
"old_path": "demo/app/examples/reactive-forms.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -35,10 +35,10 @@ const materialTheme = require('./../../../src/themes/material.theme.scss');\n<form class=\"form-inline my-2 my-lg-0\">\n<a class=\"github-button\"\nhref=\"https://github.com/ng-select/ng-select\"\n- data-icon=\"octicon-star\"\n+ data-icon=\"mark-github\"\ndata-size=\"large\"\ndata-show-count=\"true\"\n- aria-label=\"Star ng-select/ng-select on GitHub\">Star</a>\n+ aria-label=\"Visit ng-select/ng-select on GitHub\">Github</a>\n</form>\n</div>\n</nav>\n",
"new_path": "demo/app/layout/header.component.ts",
"old_path": "demo/app/layout/header.component.ts"
},
{
"change_type": "MODIFY",
"diff": "<div *ngIf=\"!isDisabled\" class=\"ng-input\">\n<div *ngIf=\"!searchable\"\n+ #filterInput\ntabindex=\"0\"\n(focus)=\"onInputFocus()\"\n(blur)=\"onInputBlur()\"\n",
"new_path": "src/ng-select/ng-select.component.html",
"old_path": "src/ng-select/ng-select.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -250,7 +250,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nthis.clearModel();\n}\nthis._clearSearch();\n- this.focusSearchInput();\n+ this.focus();\nif (this._isTypeahead) {\nthis.typeahead.next(null);\n}\n@@ -303,7 +303,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nthis.itemsList.markSelectedOrDefault(this.markFirst);\nthis.openEvent.emit();\nif (!this.filterValue) {\n- this.focusSearchInput();\n+ this.focus();\n}\nthis.detectChanges();\n}\n@@ -344,6 +344,13 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\n}\n+ focus() {\n+ if (!this.filterInput) {\n+ return;\n+ }\n+ this.filterInput.nativeElement.focus();\n+ }\n+\nunselect(item: NgOption) {\nthis.itemsList.unselect(item);\nthis._updateNgModel();\n@@ -431,14 +438,6 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\n}\n- focusSearchInput() {\n- if (!this.filterInput) {\n- return;\n- }\n- this.filterInput.nativeElement.focus();\n- this.filterInput.nativeElement.select();\n- }\n-\nprivate _setItems(items: any[]) {\nconst firstItem = items[0];\nthis.bindLabel = this.bindLabel || this._defaultLabel;\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: rename focusSearchInput to focus (#447)
| 1
|
fix
| null |
217,922
|
12.04.2018 20:15:54
| -7,200
|
a5efca7a2c592a8c52c061df5f74e7b5e777f07b
|
feat: alarms are now stored in your account so they are now cross-platform
closes
|
[
{
"change_type": "MODIFY",
"diff": "@@ -12,18 +12,18 @@ import {Timer} from 'app/core/time/timer';\nimport {MapPopupComponent} from '../../modules/map/map-popup/map-popup.component';\nimport {BellNodesService} from '../data/bell-nodes.service';\nimport {PushNotificationsService} from 'ng-push';\n+import {UserService} from '../database/user.service';\n@Injectable()\nexport class AlarmService {\n- private static LOCALSTORAGE_KEY = 'alarms';\n-\nprivate _alarms: Map<Alarm, Subscription> = new Map<Alarm, Subscription>();\nconstructor(private etime: EorzeanTimeService, private settings: SettingsService, private snack: MatSnackBar,\nprivate localizedData: LocalizedDataService, private translator: TranslateService, private dialog: MatDialog,\n- private bellNodesService: BellNodesService, private pushNotificationsService: PushNotificationsService) {\n- this.loadAlarms();\n+ private bellNodesService: BellNodesService, private pushNotificationsService: PushNotificationsService,\n+ private userService: UserService) {\n+ this.userService.getUserData().map(user => user.alarms || []).subscribe(alarms => this.loadAlarms(...alarms));\n}\n/**\n@@ -69,14 +69,26 @@ export class AlarmService {\n* @private\n*/\npublic registerAlarms(...alarms: Alarm[]): void {\n+ this.loadAlarms(...alarms);\n+ this.persistAlarms();\n+ }\n+\n+ /**\n+ * loads the alarms into the current alarms map\n+ * @param {Alarm} alarms\n+ */\n+ public loadAlarms(...alarms: Alarm[]): void {\nalarms.forEach(alarm => {\n+ if (Array.from(this._alarms.keys()).find(key => key.itemId === alarm.itemId\n+ && key.spawn === alarm.spawn) === undefined) {\nthis._alarms.set(alarm, this.etime.getEorzeanTime().subscribe(time => {\n- if (time.getUTCHours() === this.substractHours(alarm.spawn, this.settings.alarmHoursBefore) && time.getUTCMinutes() === 0) {\n+ if (time.getUTCHours() === this.substractHours(alarm.spawn, this.settings.alarmHoursBefore) &&\n+ time.getUTCMinutes() === 0) {\nthis.playAlarm(alarm);\n}\n}));\n+ }\n});\n- this.persistAlarms();\n}\n/**\n@@ -374,18 +386,14 @@ export class AlarmService {\nreturn resMinutes;\n}\n- /**\n- * Loads alarms fro the local storage of the browser.\n- */\n- private loadAlarms(): void {\n- this.registerAlarms(...(JSON.parse(localStorage.getItem(AlarmService.LOCALSTORAGE_KEY)) || []));\n- }\n-\n/**\n* Persist the current alarms into browser's localstorage.\n*/\nprivate persistAlarms(): void {\n- localStorage.setItem(AlarmService.LOCALSTORAGE_KEY, JSON.stringify(Array.from(this._alarms.keys())));\n+ this.userService.getUserData().first().mergeMap(user => {\n+ user.alarms = Array.from(this._alarms.keys());\n+ return this.userService.set(user.$key, user);\n+ }).first().subscribe();\n}\n/**\n",
"new_path": "src/app/core/time/alarm.service.ts",
"old_path": "src/app/core/time/alarm.service.ts"
},
{
"change_type": "MODIFY",
"diff": "import {DataModel} from '../../core/database/storage/data-model';\nimport {ListLayout} from '../../core/layout/list-layout';\nimport {DeserializeAs} from '@kaiu/serializer';\n+import {Alarm} from '../../core/time/alarm';\nexport class AppUser extends DataModel {\nname?: string;\n@@ -20,4 +21,6 @@ export class AppUser extends DataModel {\n// List layouts are now stored inside firebase\n@DeserializeAs([ListLayout])\nlayouts?: ListLayout[];\n+ // Alarms are now stored inside firebase\n+ alarms: Alarm[];\n}\n",
"new_path": "src/app/model/list/app-user.ts",
"old_path": "src/app/model/list/app-user.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
feat: alarms are now stored in your account so they are now cross-platform
closes #275
| 1
|
feat
| null |
724,056
|
12.04.2018 22:57:50
| 25,200
|
167927a8c96d3d27af161b792072c662c3c735ce
|
docs: update options.md
Fix typo
|
[
{
"change_type": "MODIFY",
"diff": "@@ -147,7 +147,7 @@ expect(wrapper.vm.$route).toBeInstanceOf(Object)\n- type: `boolean`\n- default: `false`\n-Component will be attach to DOM when rendered if set to `true`.\n+Component will be attached to DOM when rendered if set to `true`.\n### `attrs`\n",
"new_path": "docs/en/api/options.md",
"old_path": "docs/en/api/options.md"
}
] |
JavaScript
|
MIT License
|
vuejs/vue-test-utils
|
docs: update options.md (#527)
Fix typo
| 1
|
docs
| null |
679,913
|
13.04.2018 00:06:05
| -3,600
|
a769856345db7f6e5af7762006cfcb3e88ba2dde
|
refactor(associative): add private impls for EquivMap/Set
|
[
{
"change_type": "MODIFY",
"diff": "\"join\",\n\"map\",\n\"set\",\n+ \"skiplist\",\n+ \"sorted map\",\n+ \"sorted set\",\n\"typescript\",\n\"union\"\n],\n",
"new_path": "packages/associative/package.json",
"old_path": "packages/associative/package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -4,6 +4,17 @@ import { equiv } from \"@thi.ng/api/equiv\";\nimport { SEMAPHORE, Pair } from \"./api\";\nimport { EquivSet } from \"./equiv-set\";\n+interface EqMapProps<K, V> {\n+ keys: EquivSet<K>;\n+ map: Map<K, V>;\n+}\n+\n+export interface EqMapOpts<K> {\n+ equiv: Predicate2<K>;\n+}\n+\n+const __private = new WeakMap<EquivMap<any, any>, EqMapProps<any, any>>();\n+\nexport class EquivMap<K, V> extends Map<K, V> implements\nIterable<Pair<K, V>>,\nICopy<EquivMap<K, V>>,\n@@ -20,16 +31,11 @@ export class EquivMap<K, V> extends Map<K, V> implements\nreturn m;\n}\n- protected _keys: EquivSet<K>;\n- protected _map: Map<K, V>;\n-\nconstructor(pairs?: Iterable<Pair<K, V>>, eq: Predicate2<K> = equiv) {\nsuper();\n- this._keys = new EquivSet<K>(null, eq);\n- this._map = new Map<K, V>();\n- Object.defineProperties(this, {\n- _keys: { enumerable: false },\n- _map: { enumerable: false }\n+ __private.set(this, {\n+ keys: new EquivSet<K>(null, eq),\n+ map: new Map<K, V>(),\n});\nif (pairs) {\nthis.into(pairs);\n@@ -45,22 +51,26 @@ export class EquivMap<K, V> extends Map<K, V> implements\n}\nget size() {\n- return this._keys.size;\n+ return __private.get(this).keys.size;\n}\nclear() {\n- this._keys.clear();\n- this._map.clear();\n+ const $this = __private.get(this);\n+ $this.keys.clear();\n+ $this.map.clear();\n}\nempty() {\n- return new EquivMap<K, V>(null, (<any>this._keys)._equiv);\n+ return new EquivMap<K, V>(null, __private.get(this).keys.getOpts().equiv);\n}\ncopy() {\n- const m = new EquivMap<K, V>(null, (<any>this._keys)._equiv);\n- m._keys = this._keys.copy();\n- m._map = new Map<K, V>(this._map);\n+ const $this = __private.get(this);\n+ const m = new EquivMap<K, V>();\n+ __private.set(m, {\n+ keys: $this.keys.copy(),\n+ map: new Map<K, V>($this.map)\n+ });\nreturn m;\n}\n@@ -74,8 +84,8 @@ export class EquivMap<K, V> extends Map<K, V> implements\nif (this.size !== o.size) {\nreturn false;\n}\n- for (let k of this._map.keys()) {\n- if (!equiv(o.get(k), this._map.get(k))) {\n+ for (let k of __private.get(this).map.keys()) {\n+ if (!equiv(o.get(k), __private.get(this).map.get(k))) {\nreturn false;\n}\n}\n@@ -83,10 +93,11 @@ export class EquivMap<K, V> extends Map<K, V> implements\n}\ndelete(key: K) {\n- key = this._keys.get(key, SEMAPHORE);\n+ const $this = __private.get(this);\n+ key = $this.keys.get(key, SEMAPHORE);\nif (key !== <any>SEMAPHORE) {\n- this._map.delete(key);\n- this._keys.delete(key);\n+ $this.map.delete(key);\n+ $this.keys.delete(key);\nreturn true;\n}\nreturn false;\n@@ -100,30 +111,32 @@ export class EquivMap<K, V> extends Map<K, V> implements\n}\nforEach(fn: (val: V, key: K, map: Map<K, V>) => void, thisArg?: any) {\n- for (let pair of this._map) {\n+ for (let pair of __private.get(this).map) {\nfn.call(thisArg, pair[1], pair[0], this);\n}\n}\nget(key: K, notFound?: any) {\n- key = this._keys.get(key, SEMAPHORE);\n+ const $this = __private.get(this);\n+ key = $this.keys.get(key, SEMAPHORE);\nif (key !== <any>SEMAPHORE) {\n- return this._map.get(key);\n+ return $this.map.get(key);\n}\nreturn notFound;\n}\nhas(key: K) {\n- return this._keys.has(key);\n+ return __private.get(this).keys.has(key);\n}\nset(key: K, value: V) {\n- const k = this._keys.get(key, SEMAPHORE);\n+ const $this = __private.get(this);\n+ const k = $this.keys.get(key, SEMAPHORE);\nif (k !== <any>SEMAPHORE) {\n- this._map.set(k, value);\n+ $this.map.set(k, value);\n} else {\n- this._keys.add(key);\n- this._map.set(key, value);\n+ $this.keys.add(key);\n+ $this.map.set(key, value);\n}\nreturn this;\n}\n@@ -136,14 +149,18 @@ export class EquivMap<K, V> extends Map<K, V> implements\n}\nentries() {\n- return this._map.entries();\n+ return __private.get(this).map.entries();\n}\nkeys() {\n- return this._map.keys();\n+ return __private.get(this).map.keys();\n}\nvalues() {\n- return this._map.values();\n+ return __private.get(this).map.values();\n+ }\n+\n+ getOpts(): EqMapOpts<K> {\n+ return __private.get(this).keys.getOpts();\n}\n}\n\\ No newline at end of file\n",
"new_path": "packages/associative/src/equiv-map.ts",
"old_path": "packages/associative/src/equiv-map.ts"
},
{
"change_type": "MODIFY",
"diff": "import { ICopy, IEmpty, IEquiv, Predicate2 } from \"@thi.ng/api/api\";\nimport { equiv } from \"@thi.ng/api/equiv\";\nimport { DCons } from \"@thi.ng/dcons\";\n-import { SEMAPHORE } from \"./api\";\n+import { SEMAPHORE, Pair } from \"./api\";\n+\n+interface EqSetProps<T> {\n+ vals: DCons<T>;\n+ equiv: Predicate2<T>;\n+}\n+\n+export interface EqSetOpts<T> {\n+ equiv: Predicate2<T>;\n+}\n+\n+const __private = new WeakMap<EquivSet<any>, EqSetProps<any>>();\n/**\n* An alternative set implementation to the native ES6 Set type. Uses\n@@ -18,22 +29,14 @@ export class EquivSet<T> extends Set<T> implements\nIEmpty<EquivSet<T>>,\nIEquiv {\n- protected _vals: DCons<T>;\n- protected _equiv: Predicate2<T>;\n-\nconstructor(vals?: Iterable<T>, eq: Predicate2<T> = equiv) {\nsuper();\n- this._equiv = eq;\n- this._vals = new DCons<T>();\n- Object.defineProperties(this, {\n- _vals: { enumerable: false },\n- _equiv: { enumerable: false }\n- });\n+ __private.set(this, { equiv: eq, vals: new DCons<T>() });\nvals && this.into(vals);\n}\n*[Symbol.iterator]() {\n- yield* this._vals;\n+ yield* __private.get(this).vals;\n}\nget [Symbol.species]() {\n@@ -41,31 +44,32 @@ export class EquivSet<T> extends Set<T> implements\n}\nget size() {\n- return this._vals.length;\n+ return __private.get(this).vals.length;\n}\ncopy() {\n- const s = new EquivSet<T>(null, this._equiv);\n- s._vals = this._vals.copy();\n+ const $this = __private.get(this);\n+ const s = new EquivSet<T>(null, $this.equiv);\n+ __private.get(s).vals = $this.vals.copy();\nreturn s;\n}\nempty() {\n- return new EquivSet<T>(null, this._equiv);\n+ return new EquivSet<T>(null, __private.get(this).equiv);\n}\nclear() {\n- this._vals.clear();\n+ __private.get(this).vals.clear();\n}\nfirst() {\nif (this.size) {\n- return this._vals.head.value;\n+ return __private.get(this).vals.head.value;\n}\n}\nadd(x: T) {\n- !this.has(x) && this._vals.push(x);\n+ !this.has(x) && __private.get(this).vals.push(x);\nreturn this;\n}\n@@ -88,8 +92,9 @@ export class EquivSet<T> extends Set<T> implements\n* @param notFound\n*/\nget(x: T, notFound?: any) {\n- const eq = this._equiv;\n- let i = this._vals.head;\n+ const $this = __private.get(this);\n+ const eq = $this.equiv;\n+ let i = $this.vals.head;\nwhile (i) {\nif (eq(i.value, x)) {\nreturn i.value;\n@@ -100,11 +105,12 @@ export class EquivSet<T> extends Set<T> implements\n}\ndelete(x: T) {\n- const eq = this._equiv;\n- let i = this._vals.head;\n+ const $this = __private.get(this)\n+ const eq = $this.equiv;\n+ let i = $this.vals.head;\nwhile (i) {\nif (eq(i.value, x)) {\n- this._vals.splice(i, 1);\n+ $this.vals.splice(i, 1);\nreturn true;\n}\ni = i.next;\n@@ -129,7 +135,7 @@ export class EquivSet<T> extends Set<T> implements\nif (this.size !== o.size) {\nreturn false;\n}\n- let i = this._vals.head;\n+ let i = __private.get(this).vals.head;\nwhile (i) {\nif (!o.has(i.value)) {\nreturn false;\n@@ -140,24 +146,28 @@ export class EquivSet<T> extends Set<T> implements\n}\nforEach(fn: (val: T, val2: T, set: Set<T>) => void, thisArg?: any) {\n- let i = this._vals.head;\n+ let i = __private.get(this).vals.head;\nwhile (i) {\nfn.call(thisArg, i.value, i.value, this);\ni = i.next;\n}\n}\n- *entries(): IterableIterator<[T, T]> {\n- for (let v of this._vals) {\n+ *entries(): IterableIterator<Pair<T, T>> {\n+ for (let v of __private.get(this).vals) {\nyield [v, v];\n}\n}\n*keys() {\n- yield* this._vals;\n+ yield* __private.get(this).vals;\n}\n*values() {\n- yield* this._vals;\n+ yield* this.keys();\n+ }\n+\n+ getOpts(): EqSetOpts<T> {\n+ return { equiv: __private.get(this).equiv };\n}\n}\n",
"new_path": "packages/associative/src/equiv-set.ts",
"old_path": "packages/associative/src/equiv-set.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(associative): add private impls for EquivMap/Set
| 1
|
refactor
|
associative
|
679,913
|
13.04.2018 01:11:29
| -3,600
|
875602704caf34538e5f40569c37d7f7d8893079
|
refactor(associative): rename EquivMap/Set => ArrayMap/Set, export interfaces
|
[
{
"change_type": "MODIFY",
"diff": "+import { Predicate2, Comparator } from \"@thi.ng/api/api\";\n+\nexport type Pair<K, V> = [K, V];\nexport const SEMAPHORE = Symbol(\"SEMAPHORE\");\n+\n+export interface ArrayMapOpts<K> {\n+ equiv: Predicate2<K>;\n+}\n+\n+export interface ArraySetOpts<T> {\n+ equiv: Predicate2<T>;\n+}\n+\n+/**\n+ * SortedMapOpts implementation config settings.\n+ */\n+export interface SortedMapOpts<K> {\n+ /**\n+ * Key equivalence predicate. MUST return truthy result if given\n+ * keys are considered equal.\n+ *\n+ * Default: `@thi.ng/api/equiv`\n+ */\n+ equiv: Predicate2<K>;\n+ /**\n+ * Key comparison function. Must follow standard comparator contract\n+ * and return:\n+ * - negative if `a < b`\n+ * - positive if `a > b`\n+ * - `0` if `a == b`\n+ *\n+ * Note: The `SortedMap` implementation only uses `<` comparisons.\n+ *\n+ * Default: `@thi.ng/api/compare`\n+ */\n+ compare: Comparator<K>;\n+ /**\n+ * Initial capacity before resizing (doubling) occurs.\n+ * This value will be rounded up to next pow2.\n+ * Default: 16\n+ */\n+ capacity: number;\n+ /**\n+ * Probability for a value to exist in any express lane.\n+ * Default: `1 / Math.E`\n+ */\n+ probability: number;\n+}\n+\n+export type SortedSetOpts<T> = SortedMapOpts<T>;\n",
"new_path": "packages/associative/src/api.ts",
"old_path": "packages/associative/src/api.ts"
},
{
"change_type": "RENAME",
"diff": "import { ICopy, IEmpty, IEquiv, IObjectOf, Predicate2 } from \"@thi.ng/api/api\";\nimport { equiv } from \"@thi.ng/api/equiv\";\n-import { SEMAPHORE, Pair } from \"./api\";\n-import { EquivSet } from \"./equiv-set\";\n+import { ArrayMapOpts, Pair, SEMAPHORE } from \"./api\";\n+import { ArraySet } from \"./array-set\";\n-interface EqMapProps<K, V> {\n- keys: EquivSet<K>;\n+interface MapProps<K, V> {\n+ keys: ArraySet<K>;\nmap: Map<K, V>;\n}\n-export interface EqMapOpts<K> {\n- equiv: Predicate2<K>;\n-}\n-\n-const __private = new WeakMap<EquivMap<any, any>, EqMapProps<any, any>>();\n+const __private = new WeakMap<ArrayMap<any, any>, MapProps<any, any>>();\n-export class EquivMap<K, V> extends Map<K, V> implements\n+export class ArrayMap<K, V> extends Map<K, V> implements\nIterable<Pair<K, V>>,\n- ICopy<EquivMap<K, V>>,\n- IEmpty<EquivMap<K, V>>,\n+ ICopy<ArrayMap<K, V>>,\n+ IEmpty<ArrayMap<K, V>>,\nIEquiv {\n- static fromObject<T>(obj: IObjectOf<T>): EquivMap<PropertyKey, T> {\n- const m = new EquivMap<PropertyKey, T>();\n+ static fromObject<T>(obj: IObjectOf<T>): ArrayMap<PropertyKey, T> {\n+ const m = new ArrayMap<PropertyKey, T>();\nfor (let k in obj) {\nif (obj.hasOwnProperty(k)) {\nm.set(k, obj[k]);\n@@ -34,7 +30,7 @@ export class EquivMap<K, V> extends Map<K, V> implements\nconstructor(pairs?: Iterable<Pair<K, V>>, eq: Predicate2<K> = equiv) {\nsuper();\n__private.set(this, {\n- keys: new EquivSet<K>(null, eq),\n+ keys: new ArraySet<K>(null, eq),\nmap: new Map<K, V>(),\n});\nif (pairs) {\n@@ -47,7 +43,7 @@ export class EquivMap<K, V> extends Map<K, V> implements\n}\nget [Symbol.species]() {\n- return EquivMap;\n+ return ArrayMap;\n}\nget size() {\n@@ -61,12 +57,12 @@ export class EquivMap<K, V> extends Map<K, V> implements\n}\nempty() {\n- return new EquivMap<K, V>(null, __private.get(this).keys.getOpts().equiv);\n+ return new ArrayMap<K, V>(null, __private.get(this).keys.getOpts().equiv);\n}\ncopy() {\nconst $this = __private.get(this);\n- const m = new EquivMap<K, V>();\n+ const m = new ArrayMap<K, V>();\n__private.set(m, {\nkeys: $this.keys.copy(),\nmap: new Map<K, V>($this.map)\n@@ -160,7 +156,7 @@ export class EquivMap<K, V> extends Map<K, V> implements\nreturn __private.get(this).map.values();\n}\n- getOpts(): EqMapOpts<K> {\n+ getOpts(): ArrayMapOpts<K> {\nreturn __private.get(this).keys.getOpts();\n}\n}\n\\ No newline at end of file\n",
"new_path": "packages/associative/src/array-map.ts",
"old_path": "packages/associative/src/equiv-map.ts"
},
{
"change_type": "RENAME",
"diff": "import { ICopy, IEmpty, IEquiv, Predicate2 } from \"@thi.ng/api/api\";\nimport { equiv } from \"@thi.ng/api/equiv\";\nimport { DCons } from \"@thi.ng/dcons\";\n-import { SEMAPHORE, Pair } from \"./api\";\n-interface EqSetProps<T> {\n- vals: DCons<T>;\n- equiv: Predicate2<T>;\n-}\n+import { ArraySetOpts, Pair, SEMAPHORE } from \"./api\";\n-export interface EqSetOpts<T> {\n+interface SetProps<T> {\n+ vals: DCons<T>;\nequiv: Predicate2<T>;\n}\n-const __private = new WeakMap<EquivSet<any>, EqSetProps<any>>();\n+const __private = new WeakMap<ArraySet<any>, SetProps<any>>();\n/**\n* An alternative set implementation to the native ES6 Set type. Uses\n@@ -23,10 +20,10 @@ const __private = new WeakMap<EquivSet<any>, EqSetProps<any>>();\n* Additionally, the type also implements the `ICopy`, `IEmpty` and\n* `IEquiv` interfaces itself.\n*/\n-export class EquivSet<T> extends Set<T> implements\n+export class ArraySet<T> extends Set<T> implements\nIterable<T>,\n- ICopy<EquivSet<T>>,\n- IEmpty<EquivSet<T>>,\n+ ICopy<ArraySet<T>>,\n+ IEmpty<ArraySet<T>>,\nIEquiv {\nconstructor(vals?: Iterable<T>, eq: Predicate2<T> = equiv) {\n@@ -40,7 +37,7 @@ export class EquivSet<T> extends Set<T> implements\n}\nget [Symbol.species]() {\n- return EquivSet;\n+ return ArraySet;\n}\nget size() {\n@@ -49,13 +46,13 @@ export class EquivSet<T> extends Set<T> implements\ncopy() {\nconst $this = __private.get(this);\n- const s = new EquivSet<T>(null, $this.equiv);\n+ const s = new ArraySet<T>(null, $this.equiv);\n__private.get(s).vals = $this.vals.copy();\nreturn s;\n}\nempty() {\n- return new EquivSet<T>(null, __private.get(this).equiv);\n+ return new ArraySet<T>(null, __private.get(this).equiv);\n}\nclear() {\n@@ -167,7 +164,7 @@ export class EquivSet<T> extends Set<T> implements\nyield* this.keys();\n}\n- getOpts(): EqSetOpts<T> {\n+ getOpts(): ArraySetOpts<T> {\nreturn { equiv: __private.get(this).equiv };\n}\n}\n",
"new_path": "packages/associative/src/array-set.ts",
"old_path": "packages/associative/src/equiv-set.ts"
},
{
"change_type": "MODIFY",
"diff": "-export * from \"./equiv-map\";\n-export * from \"./equiv-set\";\n+export * from \"./array-map\";\n+export * from \"./array-set\";\nexport * from \"./sorted-map\";\nexport * from \"./sorted-set\";\n",
"new_path": "packages/associative/src/index.ts",
"old_path": "packages/associative/src/index.ts"
},
{
"change_type": "MODIFY",
"diff": "-import { EquivMap } from \"./equiv-map\";\n+import { ArrayMap } from \"./array-map\";\nimport { selectKeysObj } from \"./select-keys\";\n/**\n@@ -7,7 +7,7 @@ import { selectKeysObj } from \"./select-keys\";\n* @param ks keys used for indexing\n*/\nexport function indexed(records: Set<any>, ks: PropertyKey[]) {\n- const res = new EquivMap<any, Set<any>>();\n+ const res = new ArrayMap<any, Set<any>>();\nlet m, ik, rv;\nfor (m of records) {\nik = selectKeysObj(m, ks);\n",
"new_path": "packages/associative/src/indexed.ts",
"old_path": "packages/associative/src/indexed.ts"
},
{
"change_type": "MODIFY",
"diff": "import { IObjectOf } from \"@thi.ng/api/api\";\n-import { EquivSet } from \"./equiv-set\";\n+import { ArraySet } from \"./array-set\";\nimport { intersection } from \"./intersection\";\nimport { indexed } from \"./indexed\";\nimport { invertObj } from \"./invert\";\n@@ -24,7 +24,7 @@ export function join<A, B>(xrel: Set<A>, yrel: Set<B>) {\ns = xrel;\n}\nconst idx = indexed(r, ks);\n- const res = new EquivSet<any>();\n+ const res = new ArraySet<any>();\nfor (let x of s) {\nconst found = idx.get(selectKeysObj(x, ks));\nif (found) {\n@@ -53,7 +53,7 @@ export function joinWith<A, B>(xrel: Set<A>, yrel: Set<B>, km: IObjectOf<Propert\n}\nconst idx = indexed(r, objValues(k));\nconst ks = Object.keys(k);\n- const res = new EquivSet<any>();\n+ const res = new ArraySet<any>();\nfor (let x of s) {\nconst found = idx.get(renameKeysObj(selectKeysObj(x, ks), k));\nif (found) {\n",
"new_path": "packages/associative/src/join.ts",
"old_path": "packages/associative/src/join.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,48 +5,12 @@ import { illegalArgs } from \"@thi.ng/api/error\";\nimport { isArray } from \"@thi.ng/checks/is-array\";\nimport { map } from \"@thi.ng/iterators/map\";\n-import { Pair, SEMAPHORE } from \"./api\";\n+import { Pair, SEMAPHORE, SortedMapOpts } from \"./api\";\n// stores private properties for all instances\n// http://fitzgeraldnick.com/2014/01/13/hiding-implementation-details-with-e6-weakmaps.html\nconst __private = new WeakMap<SortedMap<any, any>, SortedMapProps>();\n-/**\n- * SortedMapOpts implementation config settings.\n- */\n-export interface SortedMapOpts<K> {\n- /**\n- * Key equivalence predicate. MUST return truthy result if given\n- * keys are considered equal.\n- *\n- * Default: `@thi.ng/api/equiv`\n- */\n- equiv: Predicate2<K>;\n- /**\n- * Key comparison function. Must follow standard comparator contract\n- * and return:\n- * - negative if `a < b`\n- * - positive if `a > b`\n- * - `0` if `a == b`\n- *\n- * Note: The `SortedMap` implementation only uses `<` comparisons.\n- *\n- * Default: `@thi.ng/api/compare`\n- */\n- compare: Comparator<K>;\n- /**\n- * Initial capacity before resizing (doubling) occurs.\n- * This value will be rounded up to next pow2.\n- * Default: 16\n- */\n- capacity: number;\n- /**\n- * Probability for a value to exist in any express lane.\n- * Default: `1 / Math.E`\n- */\n- probability: number;\n-}\n-\ninterface SortedMapProps {\nhead: any[];\ntail: any[];\n",
"new_path": "packages/associative/src/sorted-map.ts",
"old_path": "packages/associative/src/sorted-map.ts"
},
{
"change_type": "MODIFY",
"diff": "import { ICopy, IEmpty, IEquiv, ICompare } from \"@thi.ng/api/api\";\nimport { map } from \"@thi.ng/iterators/map\";\n-import { Pair } from \"./api\";\n-import { SortedMap, SortedMapOpts } from \"./sorted-map\";\n+import { Pair, SortedSetOpts } from \"./api\";\n+import { SortedMap } from \"./sorted-map\";\nimport { compare } from \"@thi.ng/api/compare\";\n-export type SortedSetOpts<T> = SortedMapOpts<T>;\n-\nconst __private = new WeakMap<SortedSet<any>, SortedMap<any, any>>();\n/**\n@@ -144,7 +142,7 @@ export class SortedSet<T> extends Set<T> implements\nreturn __private.get(this).get(value, notFound);\n}\n- getOpts() {\n+ getOpts(): SortedSetOpts<T> {\nreturn __private.get(this).getOpts();\n}\n}\n\\ No newline at end of file\n",
"new_path": "packages/associative/src/sorted-set.ts",
"old_path": "packages/associative/src/sorted-set.ts"
},
{
"change_type": "MODIFY",
"diff": "import * as assert from \"assert\";\n-import { EquivSet } from \"../src/equiv-set\";\n+import { ArraySet } from \"../src/array-set\";\nimport { difference } from \"../src/difference\";\ndescribe(\"difference\", () => {\n@@ -11,10 +11,10 @@ describe(\"difference\", () => {\nassert.deepEqual(difference(a, b), new Set([1, 2]));\n});\n- it(\"equiv (numbers)\", () => {\n- const a = new EquivSet([1, 2, 3, 4]);\n- const b = new EquivSet([3, 4, 5]);\n- assert.deepEqual(difference(a, b), new EquivSet([1, 2]));\n+ it(\"array (numbers)\", () => {\n+ const a = new ArraySet([1, 2, 3, 4]);\n+ const b = new ArraySet([3, 4, 5]);\n+ assert.deepEqual(difference(a, b), new ArraySet([1, 2]));\n});\nit(\"native (obj)\", () => {\n@@ -27,9 +27,9 @@ describe(\"difference\", () => {\nassert.notStrictEqual(d, b);\n});\n- it(\"equiv (obj)\", () => {\n- const a = new EquivSet([{ a: 1 }, { a: 2 }, { a: 3 }, { a: 4 }]);\n- const b = new EquivSet([{ a: 3 }, { a: 4 }, { a: 5 }]);\n+ it(\"array (obj)\", () => {\n+ const a = new ArraySet([{ a: 1 }, { a: 2 }, { a: 3 }, { a: 4 }]);\n+ const b = new ArraySet([{ a: 3 }, { a: 4 }, { a: 5 }]);\nconst d = difference(a, b);\nassert.equal(d.size, 2);\nassert.deepEqual(d, new Set([{ a: 1 }, { a: 2 }]));\n",
"new_path": "packages/associative/test/difference.ts",
"old_path": "packages/associative/test/difference.ts"
},
{
"change_type": "MODIFY",
"diff": "import * as assert from \"assert\";\n-import { EquivSet } from \"../src/equiv-set\";\n+import { ArraySet } from \"../src/array-set\";\nimport { intersection } from \"../src/intersection\";\ndescribe(\"intersection\", () => {\n@@ -11,10 +11,10 @@ describe(\"intersection\", () => {\nassert.deepEqual(intersection(a, b), new Set([3, 4]));\n});\n- it(\"equiv (numbers)\", () => {\n- const a = new EquivSet([1, 2, 3, 4]);\n- const b = new EquivSet([3, 4, 5, 6]);\n- assert.deepEqual(intersection(a, b), new EquivSet([3, 4]));\n+ it(\"array (numbers)\", () => {\n+ const a = new ArraySet([1, 2, 3, 4]);\n+ const b = new ArraySet([3, 4, 5, 6]);\n+ assert.deepEqual(intersection(a, b), new ArraySet([3, 4]));\n});\nit(\"native (obj)\", () => {\n@@ -26,10 +26,10 @@ describe(\"intersection\", () => {\nassert.notStrictEqual(i, b);\n});\n- it(\"equiv (obj)\", () => {\n- const a = new EquivSet([{ a: 1 }, { a: 2 }, { a: 3 }, { a: 4 }]);\n- const b = new EquivSet([{ a: 3 }, { a: 4 }, { a: 5 }]);\n+ it(\"array (obj)\", () => {\n+ const a = new ArraySet([{ a: 1 }, { a: 2 }, { a: 3 }, { a: 4 }]);\n+ const b = new ArraySet([{ a: 3 }, { a: 4 }, { a: 5 }]);\nconst i = intersection(a, b);\n- assert.deepEqual(i, new EquivSet([{ a: 3 }, { a: 4 }]));\n+ assert.deepEqual(i, new ArraySet([{ a: 3 }, { a: 4 }]));\n});\n});\n",
"new_path": "packages/associative/test/intersection.ts",
"old_path": "packages/associative/test/intersection.ts"
},
{
"change_type": "MODIFY",
"diff": "import * as assert from \"assert\";\n-import { EquivSet } from \"../src/equiv-set\";\n+import { ArraySet } from \"../src/array-set\";\nimport { join, joinWith } from \"../src/join\";\ndescribe(\"join\", () => {\nit(\"simple\", () => {\n- const a = new EquivSet([{ a: 1 }, { a: 2 }]);\n- const b = new EquivSet([{ b: 1 }, { b: 2 }]);\n- assert.deepEqual(join(a, b), new EquivSet([{ a: 1, b: 1 }, { a: 2, b: 1 }, { a: 1, b: 2 }, { a: 2, b: 2 }]));\n+ const a = new ArraySet([{ a: 1 }, { a: 2 }]);\n+ const b = new ArraySet([{ b: 1 }, { b: 2 }]);\n+ assert.deepEqual(join(a, b), new ArraySet([{ a: 1, b: 1 }, { a: 2, b: 1 }, { a: 1, b: 2 }, { a: 2, b: 2 }]));\n});\nit(\"simple isec\", () => {\n- const a = new EquivSet([{ id: \"a\", type: 1 }, { id: \"b\", type: 1 }, { id: \"c\", type: 2 }]);\n- const b = new EquivSet([{ type: 1, label: \"foo\" }, { type: 2, label: \"bar\" }, { type: 3, label: \"baz\" }]);\n+ const a = new ArraySet([{ id: \"a\", type: 1 }, { id: \"b\", type: 1 }, { id: \"c\", type: 2 }]);\n+ const b = new ArraySet([{ type: 1, label: \"foo\" }, { type: 2, label: \"bar\" }, { type: 3, label: \"baz\" }]);\nassert.deepEqual(\njoin(a, b),\n- new EquivSet([\n+ new ArraySet([\n{ id: \"a\", type: 1, label: \"foo\" },\n{ id: \"b\", type: 1, label: \"foo\" },\n{ id: \"c\", type: 2, label: \"bar\" }\n@@ -23,11 +23,11 @@ describe(\"join\", () => {\n});\nit(\"joinWith\", () => {\n- const a = new EquivSet([{ id: \"a\", type: 1 }, { id: \"b\", type: 1 }, { id: \"c\", type: 2 }]);\n- const b = new EquivSet([{ xyz: 1, label: \"foo\" }, { xyz: 2, label: \"bar\" }, { xyz: 3, label: \"baz\" }]);\n+ const a = new ArraySet([{ id: \"a\", type: 1 }, { id: \"b\", type: 1 }, { id: \"c\", type: 2 }]);\n+ const b = new ArraySet([{ xyz: 1, label: \"foo\" }, { xyz: 2, label: \"bar\" }, { xyz: 3, label: \"baz\" }]);\nassert.deepEqual(\njoinWith(a, b, { type: \"xyz\" }),\n- new EquivSet([\n+ new ArraySet([\n{ id: \"a\", type: 1, xyz: 1, label: \"foo\" },\n{ id: \"b\", type: 1, xyz: 1, label: \"foo\" },\n{ id: \"c\", type: 2, xyz: 2, label: \"bar\" }\n",
"new_path": "packages/associative/test/join.ts",
"old_path": "packages/associative/test/join.ts"
},
{
"change_type": "MODIFY",
"diff": "import * as assert from \"assert\";\n-import { EquivSet } from \"../src/equiv-set\";\n+import { ArraySet } from \"../src/array-set\";\nimport { union } from \"../src/union\";\ndescribe(\"union\", () => {\n@@ -12,9 +12,9 @@ describe(\"union\", () => {\n});\nit(\"equiv (numbers)\", () => {\n- const a = new EquivSet([1, 2, 3, 4]);\n- const b = new EquivSet([3, 4, 5, 6]);\n- assert.deepEqual(union(a, b), new EquivSet([1, 2, 3, 4, 5, 6]));\n+ const a = new ArraySet([1, 2, 3, 4]);\n+ const b = new ArraySet([3, 4, 5, 6]);\n+ assert.deepEqual(union(a, b), new ArraySet([1, 2, 3, 4, 5, 6]));\n});\nit(\"native (obj)\", () => {\n@@ -28,11 +28,11 @@ describe(\"union\", () => {\n});\nit(\"equiv (obj)\", () => {\n- const a = new EquivSet([{ a: 1 }, { a: 2 }]);\n- const b = new EquivSet([{ a: 2 }, { a: 3 }]);\n+ const a = new ArraySet([{ a: 1 }, { a: 2 }]);\n+ const b = new ArraySet([{ a: 2 }, { a: 3 }]);\nconst u = union(a, b);\nassert.equal(u.size, 3);\n- assert.deepEqual(u, new EquivSet([{ a: 1 }, { a: 2 }, { a: 3 }]));\n+ assert.deepEqual(u, new ArraySet([{ a: 1 }, { a: 2 }, { a: 3 }]));\nassert.notStrictEqual(u, a);\nassert.notStrictEqual(u, b);\n});\n",
"new_path": "packages/associative/test/union.ts",
"old_path": "packages/associative/test/union.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(associative): rename EquivMap/Set => ArrayMap/Set, export interfaces
| 1
|
refactor
|
associative
|
679,913
|
13.04.2018 02:08:46
| -3,600
|
26361437c6dca15619ef10b295cebf7e6535bfd0
|
refactor(dgraph): update ArrayMap/Set refs
|
[
{
"change_type": "MODIFY",
"diff": "import { ICopy } from \"@thi.ng/api/api\";\nimport { equiv } from \"@thi.ng/api/equiv\";\nimport { illegalArgs } from \"@thi.ng/api/error\";\n-import { EquivMap } from \"@thi.ng/associative/equiv-map\";\n-import { EquivSet } from \"@thi.ng/associative/equiv-set\";\n+import { ArrayMap } from \"@thi.ng/associative/array-map\";\n+import { ArraySet } from \"@thi.ng/associative/array-set\";\nimport { union } from \"@thi.ng/associative/union\";\nimport { filter } from \"@thi.ng/iterators/filter\";\nimport { reduce } from \"@thi.ng/iterators/reduce\";\n@@ -11,12 +11,12 @@ export class DGraph<T> implements\nIterable<T>,\nICopy<DGraph<T>> {\n- dependencies: EquivMap<T, EquivSet<T>>;\n- dependents: EquivMap<T, EquivSet<T>>;\n+ dependencies: ArrayMap<T, ArraySet<T>>;\n+ dependents: ArrayMap<T, ArraySet<T>>;\nconstructor() {\n- this.dependencies = new EquivMap<T, EquivSet<T>>();\n- this.dependents = new EquivMap<T, EquivSet<T>>();\n+ this.dependencies = new ArrayMap<T, ArraySet<T>>();\n+ this.dependents = new ArrayMap<T, ArraySet<T>>();\n}\n*[Symbol.iterator]() {\n@@ -42,10 +42,10 @@ export class DGraph<T> implements\nif (equiv(node, dep) || this.depends(dep, node)) {\nillegalArgs(`Circular dependency between: ${node} & ${dep}`);\n}\n- let d: EquivSet<T> = this.dependencies.get(node);\n- this.dependencies.set(node, d ? d.add(dep) : new EquivSet<T>([dep]));\n+ let d: ArraySet<T> = this.dependencies.get(node);\n+ this.dependencies.set(node, d ? d.add(dep) : new ArraySet<T>([dep]));\nd = this.dependents.get(dep);\n- this.dependents.set(dep, d ? d.add(node) : new EquivSet<T>([node]));\n+ this.dependents.set(dep, d ? d.add(node) : new ArraySet<T>([node]));\nreturn this;\n}\n@@ -75,11 +75,11 @@ export class DGraph<T> implements\n}\nimmediateDependencies(x: T): Set<T> {\n- return this.dependencies.get(x) || new EquivSet<T>();\n+ return this.dependencies.get(x) || new ArraySet<T>();\n}\nimmediateDependents(x: T): Set<T> {\n- return this.dependents.get(x) || new EquivSet<T>();\n+ return this.dependents.get(x) || new ArraySet<T>();\n}\nisLeaf(x: T) {\n@@ -92,8 +92,8 @@ export class DGraph<T> implements\nnodes(): Set<T> {\nreturn union(\n- new EquivSet<T>(this.dependencies.keys()),\n- new EquivSet<T>(this.dependents.keys()),\n+ new ArraySet<T>(this.dependencies.keys()),\n+ new ArraySet<T>(this.dependents.keys()),\n);\n}\n@@ -108,14 +108,14 @@ export class DGraph<T> implements\nsort() {\nconst sorted: T[] = [];\nconst g = this.copy();\n- let queue = new EquivSet(filter((node: T) => g.isLeaf(node), g.nodes()));\n+ let queue = new ArraySet(filter((node: T) => g.isLeaf(node), g.nodes()));\nwhile (true) {\nif (!queue.size) {\nreturn sorted.reverse();\n}\nconst node = queue.first();\nqueue.delete(node);\n- for (let d of (<EquivSet<T>>g.immediateDependencies(node)).copy()) {\n+ for (let d of (<ArraySet<T>>g.immediateDependencies(node)).copy()) {\ng.removeEdge(node, d);\nif (g.isLeaf(d)) {\nqueue.add(d);\n@@ -127,14 +127,14 @@ export class DGraph<T> implements\n}\n}\n-function transitive<T>(nodes: EquivMap<T, EquivSet<T>>, x: T): EquivSet<T> {\n- const deps: EquivSet<T> = nodes.get(x);\n+function transitive<T>(nodes: ArrayMap<T, ArraySet<T>>, x: T): ArraySet<T> {\n+ const deps: ArraySet<T> = nodes.get(x);\nif (deps) {\nreturn reduce(\n- (acc, k: T) => <EquivSet<T>>union(acc, transitive(nodes, k)),\n+ (acc, k: T) => <ArraySet<T>>union(acc, transitive(nodes, k)),\ndeps,\ndeps\n);\n}\n- return new EquivSet<T>();\n+ return new ArraySet<T>();\n}\n",
"new_path": "packages/dgraph/src/index.ts",
"old_path": "packages/dgraph/src/index.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(dgraph): update ArrayMap/Set refs
| 1
|
refactor
|
dgraph
|
679,913
|
13.04.2018 02:48:28
| -3,600
|
d1178acfdac0a34f8a48d83dba89ab4bd50c5c49
|
perf(associative): update equiv() impls
|
[
{
"change_type": "MODIFY",
"diff": "@@ -80,8 +80,8 @@ export class ArrayMap<K, V> extends Map<K, V> implements\nif (this.size !== o.size) {\nreturn false;\n}\n- for (let k of __private.get(this).map.keys()) {\n- if (!equiv(o.get(k), __private.get(this).map.get(k))) {\n+ for (let p of __private.get(this).map.entries()) {\n+ if (!equiv(o.get(p[0]), p[1])) {\nreturn false;\n}\n}\n",
"new_path": "packages/associative/src/array-map.ts",
"old_path": "packages/associative/src/array-map.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -140,8 +140,8 @@ export class SortedMap<K, V> extends Map<K, V> implements\nif (this.size !== o.size) {\nreturn false;\n}\n- for (let x of this) {\n- if (!equiv(x[1], o.get(x[0]))) {\n+ for (let p of this.entries()) {\n+ if (!equiv(o.get(p[0]), p[1])) {\nreturn false;\n}\n}\n",
"new_path": "packages/associative/src/sorted-map.ts",
"old_path": "packages/associative/src/sorted-map.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -90,8 +90,8 @@ export class SortedSet<T> extends Set<T> implements\nif (this.size !== o.size) {\nreturn false;\n}\n- for (let x of this) {\n- if (!o.has(x)) {\n+ for (let k of this.keys()) {\n+ if (!o.has(k)) {\nreturn false;\n}\n}\n",
"new_path": "packages/associative/src/sorted-set.ts",
"old_path": "packages/associative/src/sorted-set.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
perf(associative): update equiv() impls
| 1
|
perf
|
associative
|
807,838
|
13.04.2018 06:46:21
| -19,080
|
5c7476078b2665ec8f74fb1aa627f355c2a5cb7d
|
fix(bootstrap): Pluralize log text
|
[
{
"change_type": "MODIFY",
"diff": "@@ -38,6 +38,8 @@ class BootstrapCommand extends Command {\ninitialize() {\nconst { registry, rejectCycles, npmClient = \"npm\", npmClientArgs, mutex, hoist } = this.options;\n+ const filteredLength = this.filteredPackages.length;\n+ this.packageCountLabel = `${filteredLength} package${filteredLength > 1 ? \"s\" : \"\"}`;\nif (npmClient === \"yarn\" && hoist) {\nthrow new ValidationError(\n@@ -104,7 +106,7 @@ class BootstrapCommand extends Command {\n// root install does not need progress bar\nthis.enableProgressBar();\n- this.logger.info(\"\", `Bootstrapping ${this.filteredPackages.length} packages`);\n+ this.logger.info(\"\", `Bootstrapping ${this.packageCountLabel}`);\nconst tasks = [\n() => this.getDependenciesToInstall(),\n@@ -124,7 +126,7 @@ class BootstrapCommand extends Command {\n}\nreturn pWaterfall(tasks).then(() => {\n- this.logger.success(\"\", `Bootstrapped ${this.filteredPackages.length} packages`);\n+ this.logger.success(\"\", `Bootstrapped ${this.packageCountLabel}`);\n});\n}\n",
"new_path": "commands/bootstrap/index.js",
"old_path": "commands/bootstrap/index.js"
},
{
"change_type": "MODIFY",
"diff": "exports[`lerna bootstrap --ci: stderr 1`] = `\nlerna info version __TEST_VERSION__\n-lerna info Bootstrapping 1 packages\n+lerna info Bootstrapping 1 package\nlerna info Installing external dependencies\nlerna info Symlinking packages and binaries\n-lerna success Bootstrapped 1 packages\n+lerna success Bootstrapped 1 package\n`;\nexports[`lerna bootstrap --ci: stdout 1`] = `package-1`;\n",
"new_path": "integration/__snapshots__/lerna-bootstrap.test.js.snap",
"old_path": "integration/__snapshots__/lerna-bootstrap.test.js.snap"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
fix(bootstrap): Pluralize log text (#1232)
| 1
|
fix
|
bootstrap
|
807,849
|
13.04.2018 09:36:10
| 25,200
|
1d3249772d34449d5c2649e30307e67c34fa3b8b
|
chore: Remove defunct 'lerna-changelog' config
We use conventional-changelog now, via the `--conventional-commits` flag.
Closes
[skip ci]
|
[
{
"change_type": "MODIFY",
"diff": "\"core/*\",\n\"utils/*\"\n],\n- \"changelog\": {\n- \"repo\": \"lerna/lerna\",\n- \"labels\": {\n- \"Tag: Breaking Change\": \":boom: Breaking Change\",\n- \"Tag: Enhancement\": \":rocket: Enhancement\",\n- \"Tag: Bug Fix\": \":bug: Bug Fix\",\n- \"Tag: Polish\": \":nail_care: Polish\",\n- \"Tag: Documentation\": \":memo: Documentation\",\n- \"Tag: Internal\": \":house: Internal\"\n- },\n- \"cacheDir\": \".changelog\"\n- },\n\"command\": {\n\"create\": {\n\"homepage\": \"https://github.com/lerna/lerna\",\n",
"new_path": "lerna.json",
"old_path": "lerna.json"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
chore: Remove defunct 'lerna-changelog' config
We use conventional-changelog now, via the `--conventional-commits` flag.
Closes #1375
[skip ci]
| 1
|
chore
| null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.