author
int64
4.98k
943k
date
stringdate
2017-04-15 16:45:02
2022-02-25 15:32:15
timezone
int64
-46,800
39.6k
hash
stringlengths
40
40
message
stringlengths
8
468
mods
listlengths
1
16
language
stringclasses
9 values
license
stringclasses
2 values
repo
stringclasses
119 values
original_message
stringlengths
12
491
is_CCS
int64
1
1
commit_type
stringclasses
129 values
commit_scope
stringlengths
1
44
679,913
24.03.2018 23:02:53
0
f3f0bec14eefb89f0acc18431fbb5bfae38316fd
feat(pointfree): update word/wordU, add append(), tuple(), join()
[ { "change_type": "MODIFY", "diff": "@@ -103,8 +103,6 @@ pf.run(\nCustom words can be defined via the `word()` and `wordU()` functions. The latter uses `runU()` to execute the word and returns unwrapped value(s) from result.\n-*Important*: Unwrapped words CANNOT be used as part of larger stack programs. Their use case is purely for standalone application.\n-\n```typescript\n// define new word to compute multiply-add:\n// ( x y z -- x*y+z )\n@@ -126,7 +124,7 @@ maddU([3, 5, 10]);\nFactoring is a crucial aspect of developing programs in concatenative\nlanguages. The general idea is to decompose a larger solution into\n-smaller re-usable words.\n+smaller re-usable words and/or quotations.\n```typescript\n// compute square of x\n@@ -154,8 +152,10 @@ mag2([-10, 10])\n### Quotations\nQuoatations are programs (arrays) stored on the stack itself and enable\n-a form of dynamic meta programming. Quotations are executed via `execQ`.\n-This example uses a quoted form of above `pow2` word:\n+a form of dynamic meta programming. Quoations also can be used like\n+Lambdas in functional programming, though they're not Closures.\n+Quotations are executed via `execQ`. This example uses a quoted form of\n+above `pow2` word:\n```typescript\npf.runU([10], [\n@@ -167,6 +167,9 @@ pf.runU([10], [\n// 100\n```\n+Since quoatation are just arrays, we can use the ES6 spread operator to\n+resolve them in a larger word/program (a form of inlining code).\n+\n```typescript\n// a quotation is just an array of values/words\n// this function is a quotation generator\n@@ -174,16 +177,26 @@ const tupleQ = (n) => [n, pf.collect];\n// predefine fixed size tuples\nconst pair = tupleQ(2);\nconst triple = tupleQ(3);\n-// define word which takes an id & tuple quotation\n+\n+// define quotation which takes an id and when executed\n+// stores TOS under id in current environment\n+const storeQ = (id) => [id, pf.store]\n+\n+// define word which combines tupleQ & storeQ using inlining\n// when executed first builds tuple on stack\n// then stores it under `id` in current environment\n-const storeTuple = (id, tuple) => pf.word([tuple, pf.execQ, id, pf.store]);\n+const storeTuple = (id, tuple) => pf.word([...tuple, ...storeQ(id)]);\n+// alternatively we could write:\n+pf.word([tuple, pf.execQ, storeQ(id), pf.execQ]);\n// transform stack into tuples, stored in env\npf.run([1,2,3,4,5], [storeTuple(\"a\", pair), storeTuple(\"b\", triple)])[2];\n// { a: [ 4, 5 ], b: [ 1, 2, 3 ] }\n-```\n+// same again without quotations\n+pf.run([1,2,3,4,5], [2, pf.collect, \"a\", pf.store, 3, pf.collect, \"b\", pf.store])[2]\n+// { a: [ 4, 5 ], b: [ 1, 2, 3 ] }\n+```\n### Conditionals\n@@ -371,6 +384,7 @@ at word construction time and return a pre-configured stack function.\n| --- | --- |\n| `at` | `( obj k -- obj[k] )` |\n| `storeAt` | `( val obj k -- )` |\n+| `append` | `( val arr -- )` |\n| `length` | `( x -- x.length )` |\n| `print` | `( x -- )` |\n@@ -403,7 +417,7 @@ executes body. Repeats while test is truthy.\n### Word creation and indirect execution\n-#### `word(prog: StackProgram, env?: StackEnv)`\n+#### `word(prog: StackProgram, env?: StackEnv, mergeEnv = false)`\nHigher order word. Takes a StackProgram and returns it as StackFn to be\nused like any other word.\n@@ -413,7 +427,7 @@ If the optional `env` is given, uses a shallow copy of that environment\nruntime. This is useful in conjunction with `pushEnv` and `store` or\n`storeKey` to save results of sub procedures in the main env.\n-#### `wordU(prog: StackProgram, env?: StackEnv, n = 1)`\n+#### `wordU(prog: StackProgram, n = 1, env?: StackEnv, mergeEnv = false)`\nLike `word()`, but uses `runU()` for execution and returns `n` unwrapped values from result stack.\n@@ -432,7 +446,7 @@ loaded from env).\n#### `execQ`\nPops TOS and executes it as stack program. TOS MUST be an array of\n-values/words, i.e. an quotation).\n+values/words, i.e. a quotation).\n#### `collect`\n", "new_path": "packages/pointfree/README.md", "old_path": "packages/pointfree/README.md" }, { "change_type": "MODIFY", "diff": "@@ -4,7 +4,7 @@ import { equiv as _equiv } from \"@thi.ng/api/equiv\";\nimport { isArray } from \"@thi.ng/checks/is-array\";\nimport { isFunction } from \"@thi.ng/checks/is-function\";\n-const DEBUG = true;\n+const SAFE = true;\nexport type Stack = any[];\nexport type StackEnv = any;\n@@ -55,20 +55,12 @@ export const run = (stack: Stack, prog: StackProc, env: StackEnv = {}, onerror?:\nexport const runU = (stack: Stack, prog: StackProc, n = 1, env: StackEnv = {}, onerror?: Trap) =>\nunwrap(run(stack, prog, env, onerror), n);\n-const $ = DEBUG ?\n- (stack: Stack, n: number) => {\n- if (stack.length < n) {\n- illegalState(`stack underflow`);\n- }\n- } :\n+const $n = SAFE ?\n+ (m: number, n: number) => (m < n) && illegalState(`stack underflow`) :\n() => { };\n-const $n = DEBUG ?\n- (m: number, n: number) => {\n- if (m < n) {\n- illegalState(`stack underflow`);\n- }\n- } :\n+const $ = SAFE ?\n+ (stack: Stack, n: number) => $n(stack.length, n) :\n() => { };\nconst $stackFn = (f: StackProc) =>\n@@ -484,23 +476,25 @@ export const neg = op1((x) => -x);\n* be used like any word. Unknown stack effect.\n*\n* If the optional `env` is given, uses a shallow copy of that\n- * environment (one per invocation) instead of the main one passed by\n- * `run()` at runtime. This is useful in conjunction with `pushEnv()`\n- * and `store()` or `storeKey()` to save results of sub procedures in\n- * the main env.\n+ * environment (one per invocation) instead of the current one passed by\n+ * `run()` at runtime. If `mergeEnv` is true, the user provided env will\n+ * be merged with the current env (also shallow copies). This is useful in\n+ * conjunction with `pushEnv()` and `store()` or `storeKey()` to save\n+ * results of sub procedures in the main env.\n*\n* ( ? -- ? )\n*\n* @param prog\n* @param env\n+ * @param mergeEnv\n*/\n-export const word = (prog: StackProgram, env?: StackEnv) =>\n+export const word = (prog: StackProgram, env?: StackEnv, mergeEnv = false) =>\n(stack: Stack, _env: StackEnv) =>\n- run(stack, prog, env ? { ...env } : _env);\n+ run(stack, prog, env ? mergeEnv ? { ..._env, ...env } : { ...env } : _env);\n-export const wordU = (prog: StackProgram, env?: StackEnv, n = 1) =>\n+export const wordU = (prog: StackProgram, n = 1, env?: StackEnv, mergeEnv = false) =>\n(stack: Stack, _env: StackEnv) =>\n- runU(stack, prog, n, env ? { ...env } : _env);\n+ runU(stack, prog, n, env ? mergeEnv ? { ..._env, ...env } : { ...env } : _env);\n/**\n* Higher order word. Takes two stack programs: truthy and falsey\n@@ -597,8 +591,8 @@ export const exec = (stack: Stack, env: StackEnv) => {\n};\n/**\n- * Pops TOS and executes it as stack program. TOS MUST be an array of\n- * words, i.e. an quotation).\n+ * Pops TOS and executes it as stack program. TOS MUST be a valid\n+ * StackProgram (array of values/words, i.e. a quotation).\n*\n* ( x -- ? )\n*\n@@ -751,6 +745,20 @@ export const storeAt = (stack: Stack) => {\nstack.length = n;\n};\n+/**\n+ * Pushes `val` into array @ TOS.\n+ *\n+ * ( val arr -- )\n+ *\n+ * @param stack\n+ */\n+export const append = (stack: Stack) => {\n+ const n = stack.length - 2;\n+ $n(n, 0);\n+ stack[n + 1].push(stack[n]);\n+ stack.length = n;\n+};\n+\n/**\n* Loads value for `key` from env and pushes it on stack.\n*\n@@ -835,6 +843,25 @@ export const collect = (stack: Stack) => {\nstack.push(stack.splice(n, m));\n};\n+/**\n+ * Higher order helper word to `collect()` tuples of pre-defined size\n+ * `n`. The size can be given as number or a stack function producing a\n+ * number.\n+ *\n+ * ( ... -- [...])\n+ *\n+ * @param n\n+ */\n+export const tuple = (n: number | StackFn) => word([n, collect]);\n+\n+/**\n+ * Higher order helper word to convert a TOS tuple/array into a string\n+ * using `Array.join()` with given `sep`arator.\n+ *\n+ * @param sep\n+ */\n+export const join = (sep = \"\") => op1((x) => x.join(sep));\n+\nexport {\nop1 as map,\nop2 as map2\n", "new_path": "packages/pointfree/src/index.ts", "old_path": "packages/pointfree/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(pointfree): update word/wordU, add append(), tuple(), join()
1
feat
pointfree
217,880
24.03.2018 23:32:27
-3,600
2b5b68a87e91d55d5e792ac08ed013d97c6a10e8
feat: Made 'Reset progression' more user-friendly
[ { "change_type": "MODIFY", "diff": "-<h2 mat-dialog-title>{{'Confirmation'| translate}}</h2>\n+<h2 mat-dialog-title>{{'Do you really want to reset the list?'| translate}}</h2>\n<mat-dialog-actions>\n<button mat-raised-button [mat-dialog-close]=\"true\" color=\"primary\">{{'Yes'| translate}}</button>\n<button mat-raised-button mat-dialog-close color=\"warning\">{{'No'| translate}}</button>\n", "new_path": "src/app/modules/common-components/confirmation-popup/confirmation-popup.component.html", "old_path": "src/app/modules/common-components/confirmation-popup/confirmation-popup.component.html" }, { "change_type": "MODIFY", "diff": "<button mat-mini-fab color=\"accent\" matTooltip=\"{{'Reset_progression' | translate}}\"\n(click)=\"resetProgression()\">\n- <mat-icon>refresh</mat-icon>\n+ <mat-icon>replay</mat-icon>\n</button>\n<button mat-mini-fab color=\"accent\" *ngIf=\"isOwnList()\"\n", "new_path": "src/app/pages/list/list-details/list-details.component.html", "old_path": "src/app/pages/list/list-details/list-details.component.html" }, { "change_type": "MODIFY", "diff": "\"Item_name\": \"Item name\",\n\"No_items_found\": \"No item found\",\n\"Select_all\": \"Select all\",\n- \"Confirmation\": \"Confirmation\",\n+ \"Do you really want to reset the list?\": \"Do you really want to reset the list?\",\n\"Yes\": \"Yes\",\n\"No\": \"No\",\n\"Crystals\": \"Crystals\",\n", "new_path": "src/assets/i18n/en.json", "old_path": "src/assets/i18n/en.json" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
feat: Made 'Reset progression' more user-friendly
1
feat
null
679,913
25.03.2018 04:16:08
-3,600
79b4ce32cfc3a85140cb8fa2f5fac45366dd4b2c
feat(pointfree): update all words to return stack
[ { "change_type": "MODIFY", "diff": "@@ -8,7 +8,7 @@ const SAFE = true;\nexport type Stack = any[];\nexport type StackEnv = any;\n-export type StackFn = (stack: Stack, env?: StackEnv) => void;\n+export type StackFn = (stack: Stack, env?: StackEnv) => Stack;\nexport type StackProgram = any[];\nexport type StackProc = StackFn | StackProgram;\nexport type Trap = (e: Error, stack: Stack, program: StackProgram, i: number) => boolean;\n@@ -66,6 +66,8 @@ const $ = SAFE ?\nconst $stackFn = (f: StackProc) =>\nisArray(f) ? word(f) : f;\n+const tos = (stack: Stack) => stack[stack.length - 1];\n+\n/**\n* Takes a result tuple returned by `run()` and unwraps one or more\n* items from result stack. If no `n` is given, defaults to single value\n@@ -91,6 +93,7 @@ const op1 = (op: (x) => any) => {\nconst n = stack.length - 1;\n$n(n, 0);\nstack[n] = op(stack[n]);\n+ return stack;\n}\n};\n@@ -107,22 +110,22 @@ const op2 = (op: (b, a) => any) =>\nconst n = stack.length - 2;\n$n(n, 0);\nstack[n] = op(stack.pop(), stack[n]);\n+ return stack;\n};\n-const tos = (stack: Stack) => stack[stack.length - 1];\n-\n/**\n* Pushes current stack size on stack.\n*\n* ( -- n )\n* @param stack\n*/\n-export const depth = (stack: Stack) => stack.push(stack.length);\n+export const depth = (stack: Stack) =>\n+ (stack.push(stack.length), stack);\n/**\n* Utility word w/ no stack nor side effect.\n*/\n-export const nop = () => { };\n+export const nop = (stack: Stack) => stack;\n/**\n* Uses TOS as index to look up a deeper stack value, then places it as\n@@ -137,6 +140,7 @@ export const pick = (stack: Stack) => {\n$n(n, 0);\n$n(n -= stack.pop() + 1, 0);\nstack.push(stack[n]);\n+ return stack;\n};\n/**\n@@ -146,10 +150,8 @@ export const pick = (stack: Stack) => {\n*\n* @param stack\n*/\n-export const drop = (stack: Stack) => {\n- $(stack, 1);\n- stack.length--;\n-};\n+export const drop = (stack: Stack) =>\n+ ($(stack, 1), stack.length-- , stack);\n/**\n* Removes top 2 vals from stack.\n@@ -158,10 +160,8 @@ export const drop = (stack: Stack) => {\n*\n* @param stack\n*/\n-export const drop2 = (stack: Stack) => {\n- $(stack, 2);\n- stack.length -= 2;\n-};\n+export const drop2 = (stack: Stack) =>\n+ ($(stack, 2), stack.length -= 2, stack);\n/**\n* If TOS is truthy then drop it:\n@@ -172,12 +172,8 @@ export const drop2 = (stack: Stack) => {\n*\n* ( x -- x )\n*/\n-export const dropIf = (stack: Stack) => {\n- $(stack, 1);\n- if (tos(stack)) {\n- stack.length--;\n- }\n-};\n+export const dropIf = (stack: Stack) =>\n+ ($(stack, 1), tos(stack) && stack.length-- , stack);\n/**\n* Higher order word.\n@@ -186,7 +182,8 @@ export const dropIf = (stack: Stack) => {\n*\n* @param args\n*/\n-export const push = (...args: any[]) => (stack: Stack) => stack.push(...args);\n+export const push = (...args: any[]) =>\n+ (stack: Stack) => (stack.push(...args), stack);\n/**\n* Pushes current env onto stack.\n@@ -196,7 +193,8 @@ export const push = (...args: any[]) => (stack: Stack) => stack.push(...args);\n* @param stack\n* @param env\n*/\n-export const pushEnv = (stack: Stack, env: StackEnv) => stack.push(env);\n+export const pushEnv = (stack: Stack, env: StackEnv) =>\n+ (stack.push(env), stack);\n/**\n* Duplicates TOS on stack.\n@@ -205,10 +203,8 @@ export const pushEnv = (stack: Stack, env: StackEnv) => stack.push(env);\n*\n* @param stack\n*/\n-export const dup = (stack: Stack) => {\n- $(stack, 1);\n- stack.push(tos(stack));\n-};\n+export const dup = (stack: Stack) =>\n+ ($(stack, 1), stack.push(tos(stack)), stack);\n/**\n* Duplicates top 2 vals on stack.\n@@ -218,9 +214,10 @@ export const dup = (stack: Stack) => {\n* @param stack\n*/\nexport const dup2 = (stack: Stack) => {\n- $(stack, 2);\n- stack.push(stack[stack.length - 2]);\n- stack.push(stack[stack.length - 2]);\n+ let n = stack.length - 2;\n+ $n(n, 0);\n+ stack.push(stack[n], stack[n + 1]);\n+ return stack;\n};\n/**\n@@ -237,9 +234,8 @@ export const dup2 = (stack: Stack) => {\nexport const dupIf = (stack: Stack) => {\n$(stack, 1);\nconst x = tos(stack);\n- if (x) {\n- stack.push(x);\n- }\n+ x && stack.push(x);\n+ return stack;\n};\n/**\n@@ -255,6 +251,7 @@ export const swap = (stack: Stack) => {\nconst a = stack[n - 1];\nstack[n - 1] = stack[n];\nstack[n] = a;\n+ return stack;\n};\n/**\n@@ -273,6 +270,7 @@ export const swap2 = (stack: Stack) => {\nstack[n] = stack[n - 2];\nstack[n - 3] = c;\nstack[n - 2] = d;\n+ return stack;\n};\n/**\n@@ -286,6 +284,7 @@ export const nip = (stack: Stack) => {\nconst n = stack.length - 2;\n$n(n, 0);\nstack[n] = stack.pop();\n+ return stack;\n};\n/**\n@@ -299,6 +298,7 @@ export const tuck = (stack: Stack) => {\n$(stack, 2);\nconst a = stack.pop();\nstack.push(a, stack.pop(), a);\n+ return stack;\n};\n/**\n@@ -315,6 +315,7 @@ export const rot = (stack: Stack) => {\nstack[n - 2] = stack[n - 1];\nstack[n - 1] = stack[n];\nstack[n] = c;\n+ return stack;\n};\n/**\n@@ -331,6 +332,7 @@ export const invrot = (stack: Stack) => {\nstack[n] = stack[n - 1];\nstack[n - 1] = stack[n - 2];\nstack[n - 2] = c;\n+ return stack;\n};\n/**\n@@ -344,6 +346,7 @@ export const over = (stack: Stack) => {\nconst n = stack.length - 2;\n$n(n, 0);\nstack.push(stack[n]);\n+ return stack;\n}\n/**\n@@ -449,20 +452,16 @@ export const lsru = op2((b, a) => a >>> b);\n*\n* @param stack\n*/\n-export const inc = (stack: Stack) => {\n- $(stack, 1);\n- stack[stack.length - 1]++;\n-};\n+export const inc = (stack: Stack) =>\n+ ($(stack, 1), stack[stack.length - 1]++ , stack);\n/**\n* ( x -- x-1 )\n*\n* @param stack\n*/\n-export const dec = (stack: Stack) => {\n- $(stack, 1);\n- stack[stack.length - 1]--;\n-};\n+export const dec = (stack: Stack) =>\n+ ($(stack, 1), stack[stack.length - 1]-- , stack);\n/**\n* ( x -- -x )\n@@ -490,7 +489,7 @@ export const neg = op1((x) => -x);\n*/\nexport const word = (prog: StackProgram, env?: StackEnv, mergeEnv = false) =>\n(stack: Stack, _env: StackEnv) =>\n- run(stack, prog, env ? mergeEnv ? { ..._env, ...env } : { ...env } : _env);\n+ run(stack, prog, env ? mergeEnv ? { ..._env, ...env } : { ...env } : _env)[1];\nexport const wordU = (prog: StackProgram, n = 1, env?: StackEnv, mergeEnv = false) =>\n(stack: Stack, _env: StackEnv) =>\n@@ -512,7 +511,7 @@ export const wordU = (prog: StackProgram, n = 1, env?: StackEnv, mergeEnv = fals\nexport const cond = (_then: StackProc, _else: StackProc = []) => {\nreturn (stack: Stack, env: StackEnv) => {\n$(stack, 1);\n- $stackFn(stack.pop() ? _then : _else)(stack, env);\n+ return $stackFn(stack.pop() ? _then : _else)(stack, env);\n};\n};\n@@ -534,16 +533,14 @@ export const condM = (cases: IObjectOf<StackProc>) =>\nconst tos = stack.pop();\nfor (let k in cases) {\nif (tos == k) {\n- $stackFn(cases[k])(stack, env);\n- return;\n+ return $stackFn(cases[k])(stack, env);\n}\n}\n- if (cases.default) {\n- stack.push(tos);\n- $stackFn(cases.default)(stack, env);\n- return;\n- }\n+ if (!cases.default) {\nillegalState(`no matching case for: ${tos}`);\n+ }\n+ stack.push(tos);\n+ return $stackFn(cases.default)(stack, env);\n};\n/**\n@@ -571,7 +568,7 @@ export const loop = (test: StackProc, body: StackProc) => {\n_test(stack, env);\n$(stack, 1);\nif (!stack.pop()) {\n- break;\n+ return stack;\n}\n_body(stack, env);\n}\n@@ -585,10 +582,8 @@ export const loop = (test: StackProc, body: StackProc) => {\n*\n* @param stack\n*/\n-export const exec = (stack: Stack, env: StackEnv) => {\n- $(stack, 1);\n- stack.pop()(stack, env);\n-};\n+export const exec = (stack: Stack, env: StackEnv) =>\n+ ($(stack, 1), stack.pop()(stack, env));\n/**\n* Pops TOS and executes it as stack program. TOS MUST be a valid\n@@ -598,10 +593,8 @@ export const exec = (stack: Stack, env: StackEnv) => {\n*\n* @param stack\n*/\n-export const execQ = (stack: Stack, env: StackEnv) => {\n- $(stack, 1);\n- run(stack, stack.pop(), env);\n-};\n+export const execQ = (stack: Stack, env: StackEnv) =>\n+ ($(stack, 1), run(stack, stack.pop(), env)[1]);\n/**\n* ( x y -- x===y )\n@@ -717,10 +710,8 @@ export const length = op1((x) => x.length);\n*\n* @param stack\n*/\n-export const print = (stack: Stack) => {\n- $(stack, 1);\n- console.log(stack.pop());\n-};\n+export const print = (stack: Stack) =>\n+ ($(stack, 1), console.log(stack.pop()), stack);\n/**\n* Reads key/index from object/array.\n@@ -743,22 +734,62 @@ export const storeAt = (stack: Stack) => {\n$n(n, 0);\nstack[n + 1][stack[n + 2]] = stack[n];\nstack.length = n;\n+ return stack;\n+};\n+\n+/**\n+ * Pushes new empty array on stack.\n+ *\n+ * @param stack\n+ */\n+export const list = (stack: Stack) =>\n+ (stack.push([]), stack);\n+\n+/**\n+ * Pushes `val` on the LHS of array.\n+ *\n+ * ( val arr -- arr )\n+ *\n+ * @param stack\n+ */\n+export const pushl = (stack: Stack) => {\n+ $(stack, 2);\n+ const a = stack.pop();\n+ a.unshift(stack.pop());\n+ stack.push(a);\n+ return stack;\n};\n/**\n- * Pushes `val` into array @ TOS.\n+ * Pushes `val` on the RHS of array.\n*\n- * ( val arr -- )\n+ * ( arr val -- arr )\n*\n* @param stack\n*/\n-export const append = (stack: Stack) => {\n+export const pushr = (stack: Stack) => {\nconst n = stack.length - 2;\n$n(n, 0);\n- stack[n + 1].push(stack[n]);\n- stack.length = n;\n+ stack[n].push(stack[n + 1]);\n+ stack.length--;\n+ return stack;\n};\n+/**\n+ * Removes RHS from array as new TOS.\n+ *\n+ * ( arr -- arr arr[-1] )\n+ *\n+ * @param stack\n+ */\n+export const popr = (stack: Stack) =>\n+ (stack.push(stack[stack.length - 1].pop()), stack);\n+\n+const pullq = [popr, swap];\n+export const pull = word(pullq);\n+export const pull2 = word([...pullq, ...pullq]);\n+export const pull3 = word([...pullq, ...pullq, ...pullq]);\n+\n/**\n* Loads value for `key` from env and pushes it on stack.\n*\n@@ -767,10 +798,8 @@ export const append = (stack: Stack) => {\n* @param stack\n* @param env\n*/\n-export const load = (stack: Stack, env: any) => {\n- $(stack, 1);\n- stack.push(env[stack.pop()]);\n-};\n+export const load = (stack: Stack, env: any) =>\n+ ($(stack, 1), stack.push(env[stack.pop()]), stack);\n/**\n* Stores `val` under `key` in env.\n@@ -780,10 +809,8 @@ export const load = (stack: Stack, env: any) => {\n* @param stack\n* @param env\n*/\n-export const store = (stack: Stack, env: any) => {\n- $(stack, 2);\n- env[stack.pop()] = stack.pop();\n-};\n+export const store = (stack: Stack, env: any) =>\n+ ($(stack, 2), env[stack.pop()] = stack.pop(), stack);\n/**\n* Higher order word. Similar to `load`, but always uses given\n@@ -794,7 +821,7 @@ export const store = (stack: Stack, env: any) => {\n* @param env\n*/\nexport const loadKey = (key: PropertyKey) =>\n- (stack: Stack, env: any) => stack.push(env[key]);\n+ (stack: Stack, env: any) => (stack.push(env[key]), stack);\n/**\n* Higher order word. Similar to `store`, but always uses given\n@@ -806,10 +833,8 @@ export const loadKey = (key: PropertyKey) =>\n* @param env\n*/\nexport const storeKey = (key: PropertyKey) =>\n- (stack: Stack, env: any) => {\n- $(stack, 1);\n- env[key] = stack.pop();\n- };\n+ (stack: Stack, env: any) =>\n+ ($(stack, 1), env[key] = stack.pop(), stack);\n/**\n* Higher order word. Pops TOS and uses it as index to transform stack\n@@ -825,6 +850,7 @@ export const mapN = (op: (x) => any) =>\n$n(n, 0);\n$n(n -= stack.pop() + 1, 0);\nstack[n] = op(stack[n]);\n+ return stack;\n};\n/**\n@@ -841,6 +867,7 @@ export const collect = (stack: Stack) => {\n$n(n, 0);\n$n(n -= (m = stack.pop()), 0);\nstack.push(stack.splice(n, m));\n+ return stack;\n};\n/**\n", "new_path": "packages/pointfree/src/index.ts", "old_path": "packages/pointfree/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(pointfree): update all words to return stack
1
feat
pointfree
311,007
25.03.2018 04:34:03
-32,400
d63f3f82ca1a337c2ea0dc45807577f1a586e031
fix(generate): add path index.js
[ { "change_type": "MODIFY", "diff": "@@ -9,7 +9,7 @@ export async function importNgSchematics(projectDir: string): Promise<typeof Ang\n}\nexport async function importNgSchematicsTools(projectDir: string): Promise<typeof AngularDevKitSchematicsToolsType> {\n- const p = resolve('@angular-devkit/schematics/tools', { paths: compileNodeModulesPaths(projectDir) });\n+ const p = resolve('@angular-devkit/schematics/tools/index.js', { paths: compileNodeModulesPaths(projectDir) });\nreturn require(p);\n}\n", "new_path": "packages/@ionic/cli-utils/src/lib/project/angular/angular-devkit.ts", "old_path": "packages/@ionic/cli-utils/src/lib/project/angular/angular-devkit.ts" } ]
TypeScript
MIT License
ionic-team/ionic-cli
fix(generate): add path index.js (#3030)
1
fix
generate
679,913
26.03.2018 03:16:57
-3,600
1a01f9a0b521980e6379d18fc426f4636eaf1339
fix(pointfree): wordU(), add tests
[ { "change_type": "MODIFY", "diff": "@@ -659,9 +659,9 @@ export const wordU = (prog: StackProgram, n = 1, env?: StackEnv, mergeEnv = fals\nconst w: StackFn = compile(prog);\nreturn env ?\nmergeEnv ?\n- (ctx: StackContext) => unwrap([w([ctx[0], { ...ctx[1], ...env }]), true], n) :\n- (ctx: StackContext) => unwrap([w([ctx[0], { ...env }]), true], n) :\n- (ctx: StackContext) => unwrap([w(ctx), true], n);\n+ (ctx: StackContext) => unwrap(w([ctx[0], { ...ctx[1], ...env }]), n) :\n+ (ctx: StackContext) => unwrap(w([ctx[0], { ...env }]), n) :\n+ (ctx: StackContext) => unwrap(w(ctx), n);\n};\n/**\n@@ -757,7 +757,7 @@ export const loop = (test: StackProc, body: StackProc) => {\nreturn (ctx: StackContext) => {\nwhile (true) {\ndup(ctx);\n- _test(ctx);\n+ ctx = _test(ctx);\n$(ctx, 1);\nif (!ctx[0].pop()) {\nreturn ctx;\n", "new_path": "packages/pointfree/src/index.ts", "old_path": "packages/pointfree/src/index.ts" }, { "change_type": "MODIFY", "diff": "@@ -4,6 +4,12 @@ import { StackContext } from \"../src/api\";\ndescribe(\"pointfree\", () => {\n+ it(\"depth\", () => {\n+ assert.deepEqual(pf.depth([[]])[0], [0]);\n+ assert.deepEqual(pf.depth([[10]])[0], [10, 1]);\n+ assert.deepEqual(pf.depth([[10, 20]])[0], [10, 20, 2]);\n+ });\n+\nit(\"push\", () => {\nassert.deepEqual(pf.push()([[]])[0], []);\nassert.deepEqual(pf.push(1)([[]])[0], [1]);\n@@ -408,6 +414,13 @@ describe(\"pointfree\", () => {\nassert.deepEqual(pf.tuple(2)([[1, 2]])[0], [[1, 2]]);\n});\n+ it(\"length\", () => {\n+ assert.throws(() => pf.length([[]]));\n+ assert.deepEqual(pf.length([[[10]]])[0], [1]);\n+ assert.deepEqual(pf.length([[[10, 20]]])[0], [2]);\n+ assert.deepEqual(pf.length([[\"a\"]])[0], [1]);\n+ });\n+\nit(\"join\", () => {\nassert.throws(() => pf.join()([[]]));\nassert.deepEqual(pf.join()([[[\"a\", 1]]])[0], [\"a1\"]);\n@@ -497,21 +510,42 @@ describe(\"pointfree\", () => {\n});\nit(\"condM\", () => {\n- const classify = (x) =>\n- pf.runU([[x], {}],\n+ let classify = (x) =>\npf.condM({\n0: [\"zero\"],\n1: [\"one\"],\ndefault: [\n- pf.dup,\npf.isPos,\npf.cond([\"many\"], [\"invalid\"])\n]\n- }));\n+ })([[x]])[0];\nassert.equal(classify(0), \"zero\");\nassert.equal(classify(1), \"one\");\nassert.equal(classify(100), \"many\");\nassert.equal(classify(-1), \"invalid\");\n+ assert.throws(() => pf.condM({})([[0]]));\n+ });\n+\n+ it(\"word\", () => {\n+ assert.deepEqual(pf.word([pf.dup, pf.mul])([[2]])[0], [4]);\n+ assert.deepEqual(pf.word([pf.pushEnv], { a: 1 })([[0]])[0], [0, { a: 1 }]);\n+ assert.deepEqual(pf.word([pf.pushEnv], { a: 1 }, true)([[0], { b: 2 }])[0], [0, { a: 1, b: 2 }]);\n+ assert.deepEqual(pf.word([pf.add, pf.mul])([[1, 2, 3]])[0], [5]);\n+ assert.deepEqual(pf.word([pf.add, pf.mul, pf.add])([[1, 2, 3, 4]])[0], [15]);\n+ assert.deepEqual(pf.word([pf.add, pf.mul, pf.add, pf.mul])([[1, 2, 3, 4, 5]])[0], [29]);\n+ assert.deepEqual(pf.word([pf.add, pf.mul, pf.add, pf.mul, pf.add])([[1, 2, 3, 4, 5, 6]])[0], [95]);\n+ assert.deepEqual(pf.word([pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul])([[1, 2, 3, 4, 5, 6, 7]])[0], [209]);\n+ assert.deepEqual(pf.word([pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add])([[1, 2, 3, 4, 5, 6, 7, 8]])[0], [767]);\n+ assert.deepEqual(pf.word([pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul])([[1, 2, 3, 4, 5, 6, 7, 8, 9]])[0], [1889]);\n+ assert.deepEqual(pf.word([pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add])([[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]])[0], [7679]);\n+ assert.deepEqual(pf.word([pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul])([[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])[0], [20789]);\n+ assert.deepEqual(pf.word([pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add])([[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]])[0], [92159]);\n+ });\n+\n+ it(\"wordU\", () => {\n+ assert.deepEqual(pf.wordU([pf.dup, pf.mul])([[2]]), 4);\n+ assert.deepEqual(pf.wordU([pf.pushEnv], 1, { a: 1 })([[]]), { a: 1 });\n+ assert.deepEqual(pf.wordU([pf.pushEnv], 1, { a: 1 }, true)([[], { b: 2 }]), { a: 1, b: 2 });\n});\n});\n", "new_path": "packages/pointfree/test/index.ts", "old_path": "packages/pointfree/test/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
fix(pointfree): wordU(), add tests
1
fix
pointfree
679,913
26.03.2018 03:18:11
-3,600
2b7e99b9f527c14fe54e51a5e1bf23813178338a
fix(api): illegalState() creates IllegalStateError
[ { "change_type": "MODIFY", "diff": "@@ -31,7 +31,7 @@ export function illegalArgs(msg?: any) {\n}\nexport function illegalState(msg?: any) {\n- throw new IllegalArgumentError(msg);\n+ throw new IllegalStateError(msg);\n}\nexport function unsupported(msg?: any) {\n", "new_path": "packages/api/src/error.ts", "old_path": "packages/api/src/error.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
fix(api): illegalState() creates IllegalStateError
1
fix
api
679,913
26.03.2018 03:25:49
-3,600
50cc65fee6f80f7b616f9d668806a67a1d47715e
build: update yarn scripts / add missing nyc dev dep
[ { "change_type": "MODIFY", "diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn run clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build doc\",\n+ \"cover\": \"yarn test && nyc report --reporter=lcov\",\n\"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n\"pub\": \"yarn run build && yarn publish --access public\",\n- \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n+ \"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.48\",\n\"@types/node\": \"^9.4.6\",\n\"mocha\": \"^5.0.1\",\n+ \"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.5.0\",\n\"typedoc\": \"^0.10.0\",\n\"typescript\": \"^2.7.2\",\n", "new_path": "packages/hdom-components/package.json", "old_path": "packages/hdom-components/package.json" }, { "change_type": "MODIFY", "diff": "\"@types/mocha\": \"^2.2.48\",\n\"@types/node\": \"^9.4.6\",\n\"mocha\": \"^5.0.0\",\n+ \"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.5.0\",\n\"typedoc\": \"^0.10.0\",\n\"typescript\": \"^2.7.2\",\n", "new_path": "packages/hdom/package.json", "old_path": "packages/hdom/package.json" }, { "change_type": "MODIFY", "diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn run clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build doc\",\n+ \"cover\": \"yarn test && nyc report --reporter=lcov\",\n\"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n\"pub\": \"yarn run build && yarn publish --access public\",\n- \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n+ \"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.48\",\n\"@types/node\": \"^9.4.6\",\n\"mocha\": \"^5.0.0\",\n+ \"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.5.0\",\n\"typedoc\": \"^0.10.0\",\n\"typescript\": \"^2.7.2\",\n", "new_path": "packages/interceptors/package.json", "old_path": "packages/interceptors/package.json" }, { "change_type": "MODIFY", "diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn run clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build doc\",\n+ \"cover\": \"yarn test && nyc report --reporter=lcov\",\n\"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n\"pub\": \"yarn run build && yarn publish --access public\",\n- \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n+ \"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.48\",\n\"@types/node\": \"^9.4.6\",\n\"mocha\": \"^5.0.0\",\n+ \"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.5.0\",\n\"typedoc\": \"^0.10.0\",\n\"typescript\": \"^2.7.2\",\n", "new_path": "packages/paths/package.json", "old_path": "packages/paths/package.json" }, { "change_type": "MODIFY", "diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn run clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build doc\",\n+ \"cover\": \"yarn test && nyc report --reporter=lcov\",\n\"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n\"pub\": \"yarn run build && yarn publish --access public\",\n- \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n+ \"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.48\",\n\"@types/node\": \"^9.4.6\",\n\"mocha\": \"^5.0.0\",\n+ \"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.5.0\",\n\"typedoc\": \"^0.10.0\",\n\"typescript\": \"^2.7.2\",\n\"@thi.ng/api\": \"^2.1.0\"\n},\n\"keywords\": [\n+ \"composition\",\n+ \"concatenative\",\n\"ES6\",\n\"Forth\",\n\"functional\",\n- \"composition\",\n\"pipeline\",\n\"stack\",\n\"typescript\"\n", "new_path": "packages/pointfree/package.json", "old_path": "packages/pointfree/package.json" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
build: update yarn scripts / add missing nyc dev dep
1
build
null
807,849
26.03.2018 11:38:54
25,200
74d1415a938c8db80a68809313f1ef84ea999253
test(init-fixture): process.chdir() after creating temp directory
[ { "change_type": "MODIFY", "diff": "@@ -28,6 +28,14 @@ describe(\"core-command\", () => {\ntestDir = await initFixture(\"basic\");\n});\n+ afterEach(() => {\n+ // ensure common CWD is restored when individual tests\n+ // initialize their own fixture (which changes CWD)\n+ if (process.cwd() !== testDir) {\n+ process.chdir(testDir);\n+ }\n+ });\n+\nChildProcessUtilities.getChildProcessCount = jest.fn(() => 0);\n// swallow errors when passed in argv\n", "new_path": "core/command/__tests__/command.test.js", "old_path": "core/command/__tests__/command.test.js" }, { "change_type": "MODIFY", "diff": "@@ -17,15 +17,6 @@ const { recommendVersion, updateChangelog } = require(\"..\");\nexpect.addSnapshotSerializer(require(\"@lerna-test/serialize-changelog\"));\ndescribe(\"conventional-commits\", () => {\n- const currentDirectory = process.cwd();\n-\n- afterEach(() => {\n- // conventional-recommended-bump is incapable of accepting cwd config :P\n- if (process.cwd() !== currentDirectory) {\n- process.chdir(currentDirectory);\n- }\n- });\n-\ndescribe(\"recommendVersion()\", () => {\nit(\"returns next version bump\", async () => {\nconst cwd = await initFixture(\"fixed\");\n@@ -37,9 +28,6 @@ describe(\"conventional-commits\", () => {\nawait gitAdd(cwd, pkg1.manifestLocation);\nawait gitCommit(cwd, \"feat: changed 1\");\n- // conventional-recommended-bump does not accept cwd config\n- process.chdir(cwd);\n-\nawait expect(recommendVersion(pkg1, \"fixed\", {})).resolves.toBe(\"1.1.0\");\n});\n@@ -62,9 +50,6 @@ describe(\"conventional-commits\", () => {\nawait gitAdd(cwd, pkg2.manifestLocation);\nawait gitCommit(cwd, \"feat: changed 2\");\n- // conventional-recommended-bump does not accept cwd config\n- process.chdir(cwd);\n-\nawait expect(recommendVersion(pkg1, \"independent\", opts)).resolves.toBe(\"1.0.1\");\nawait expect(recommendVersion(pkg2, \"independent\", opts)).resolves.toBe(\"1.1.0\");\n});\n@@ -76,9 +61,6 @@ describe(\"conventional-commits\", () => {\nit(\"creates files if they do not exist\", async () => {\nconst cwd = await initFixture(\"changelog-missing\");\n- // conventional-changelog does not accept cwd config\n- process.chdir(cwd);\n-\nconst [pkg1] = await collectPackages(cwd);\nconst rootPkg = {\nname: \"root\", // TODO: no name\n@@ -113,8 +95,6 @@ describe(\"conventional-commits\", () => {\nlocation: cwd,\n};\n- // conventional-changelog does not accept cwd config\n- process.chdir(cwd);\nawait gitTag(cwd, \"v1.0.0\");\nconst [pkg1] = await collectPackages(cwd);\n@@ -141,8 +121,6 @@ describe(\"conventional-commits\", () => {\nit(\"appends version bump message if no commits have been recorded\", async () => {\nconst cwd = await initFixture(\"fixed\");\n- // conventional-changelog does not accept cwd config\n- process.chdir(cwd);\nawait gitTag(cwd, \"v1.0.0\");\nconst [pkg1, pkg2] = await collectPackages(cwd);\n@@ -165,9 +143,6 @@ describe(\"conventional-commits\", () => {\nit(\"updates independent changelogs\", async () => {\nconst cwd = await initFixture(\"independent\");\n- // conventional-changelog does not accept cwd config\n- process.chdir(cwd);\n-\nawait Promise.all([gitTag(cwd, \"package-1@1.0.0\"), gitTag(cwd, \"package-2@1.0.0\")]);\nconst [pkg1, pkg2] = await collectPackages(cwd);\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": "@@ -18,6 +18,14 @@ describe(\"Project\", () => {\ntestDir = await initFixture(\"basic\");\n});\n+ afterEach(() => {\n+ // ensure common CWD is restored when individual tests\n+ // initialize their own fixture (which changes CWD)\n+ if (process.cwd() !== testDir) {\n+ process.chdir(testDir);\n+ }\n+ });\n+\ndescribe(\".rootPath\", () => {\nit(\"should be added to the instance\", () => {\nconst repo = new Project(testDir);\n@@ -33,7 +41,7 @@ describe(\"Project\", () => {\nit(\"defaults CWD to '.' when constructor argument missing\", () => {\nconst repo = new Project();\n- expect(repo.rootPath).toBe(path.resolve(__dirname, \"..\", \"..\", \"..\"));\n+ expect(repo.rootPath).toBe(testDir);\n});\n});\n", "new_path": "core/project/__tests__/project.test.js", "old_path": "core/project/__tests__/project.test.js" }, { "change_type": "MODIFY", "diff": "@@ -13,6 +13,7 @@ function initFixture(startDir) {\nconst cwd = tempy.directory();\nreturn Promise.resolve()\n+ .then(() => process.chdir(cwd))\n.then(() => copyFixture(cwd, fixtureName, startDir))\n.then(() => gitInit(cwd, \".\"))\n.then(() => gitAdd(cwd, \"-A\"))\n", "new_path": "helpers/init-fixture/index.js", "old_path": "helpers/init-fixture/index.js" }, { "change_type": "MODIFY", "diff": "@@ -37,15 +37,6 @@ async function commitChangeToPackage(cwd, packageName, commitMsg, data) {\n}\ndescribe(\"lerna publish\", () => {\n- const currentDirectory = process.cwd();\n-\n- afterEach(() => {\n- // conventional-recommended-bump is incapable of accepting cwd config :P\n- if (process.cwd() !== currentDirectory) {\n- process.chdir(currentDirectory);\n- }\n- });\n-\ntest(\"exit 0 when no updates\", async () => {\nconst { cwd } = await cloneFixture(\"normal\");\nconst args = [\"publish\"];\n@@ -119,9 +110,6 @@ describe(\"lerna publish\", () => {\n{ baz: true }\n);\n- // conventional-recommended-bump is incapable of accepting cwd config :P\n- process.chdir(cwd);\n-\nconst { stdout } = await cliRunner(cwd)(...args);\nexpect(stdout).toMatchSnapshot();\n", "new_path": "integration/lerna-publish.test.js", "old_path": "integration/lerna-publish.test.js" } ]
JavaScript
MIT License
lerna/lerna
test(init-fixture): process.chdir() after creating temp directory
1
test
init-fixture
807,849
26.03.2018 12:21:32
25,200
58644ff2eb899030807e7d28f1fd620d1bf9c627
refactor(project): Expose default package glob as static property
[ { "change_type": "MODIFY", "diff": "@@ -11,8 +11,6 @@ const writeJsonFile = require(\"write-json-file\");\nconst ValidationError = require(\"@lerna/validation-error\");\nconst Package = require(\"@lerna/package\");\n-const DEFAULT_PACKAGE_GLOB = \"packages/*\";\n-\nclass Project {\nconstructor(cwd) {\nconst explorer = cosmiconfig(\"lerna\", {\n@@ -82,7 +80,7 @@ class Project {\nreturn this.packageJson.workspaces.packages || this.packageJson.workspaces;\n}\n- return this.config.packages || [DEFAULT_PACKAGE_GLOB];\n+ return this.config.packages || [Project.DEFAULT_PACKAGE_GLOB];\n}\nget packageParentDirs() {\n@@ -131,4 +129,6 @@ class Project {\n}\n}\n+Project.DEFAULT_PACKAGE_GLOB = \"packages/*\";\n+\nmodule.exports = Project;\n", "new_path": "core/project/index.js", "old_path": "core/project/index.js" } ]
JavaScript
MIT License
lerna/lerna
refactor(project): Expose default package glob as static property
1
refactor
project
807,849
26.03.2018 12:22:42
25,200
67daff4ea567ee2624d8e08183bd6d2748c1d2e3
test(project): Remove load-json-file stub
[ { "change_type": "MODIFY", "diff": "\"use strict\";\n+const fs = require(\"fs-extra\");\nconst path = require(\"path\");\n-// mocked or stubbed modules\n-const loadJsonFile = require(\"load-json-file\");\n-\n// helpers\nconst initFixture = require(\"@lerna-test/init-fixture\")(__dirname);\n@@ -143,12 +141,6 @@ describe(\"Project\", () => {\n});\ndescribe(\"get .packageJson\", () => {\n- const loadJsonFileSync = loadJsonFile.sync;\n-\n- afterEach(() => {\n- loadJsonFile.sync = loadJsonFileSync;\n- });\n-\nit(\"returns parsed package.json\", () => {\nconst repo = new Project(testDir);\nexpect(repo.packageJson).toMatchObject({\n@@ -165,15 +157,15 @@ describe(\"Project\", () => {\nexpect(repo.packageJson).toBe(repo.packageJson);\n});\n- it(\"does not cache failures\", () => {\n- loadJsonFile.sync = jest.fn(() => {\n- throw new Error(\"File not found\");\n- });\n+ it(\"does not cache failures\", async () => {\n+ const cwd = await initFixture(\"basic\");\n- const repo = new Project(testDir);\n- expect(repo.packageJson).toBe(null);\n+ await fs.remove(path.join(cwd, \"package.json\"));\n+\n+ const repo = new Project(cwd);\n+ expect(repo.packageJson).toBe(undefined);\n- loadJsonFile.sync = loadJsonFileSync;\n+ await fs.writeJSON(repo.packageJsonLocation, { name: \"test\" }, { spaces: 2 });\nexpect(repo.packageJson).toHaveProperty(\"name\", \"test\");\n});\n", "new_path": "core/project/__tests__/project.test.js", "old_path": "core/project/__tests__/project.test.js" } ]
JavaScript
MIT License
lerna/lerna
test(project): Remove load-json-file stub
1
test
project
807,849
26.03.2018 12:24:26
25,200
ebe26c5795403d85357e667079376064fc9e6c11
refactor(project): Cache lazy properties with Object.defineProperty()
[ { "change_type": "MODIFY", "diff": "@@ -88,33 +88,40 @@ class Project {\n}\nget packageJson() {\n- if (!this._packageJson) {\n+ let packageJson;\n+\ntry {\n- this._packageJson = loadJsonFile.sync(this.packageJsonLocation);\n+ packageJson = loadJsonFile.sync(this.packageJsonLocation);\n- if (!this._packageJson.name) {\n+ if (!packageJson.name) {\n// npm-lifecycle chokes if this is missing, so default like npm init does\n- this._packageJson.name = path.basename(path.dirname(this.packageJsonLocation));\n+ packageJson.name = path.basename(path.dirname(this.packageJsonLocation));\n}\n+\n+ // redefine getter to lazy-loaded value\n+ Object.defineProperty(this, \"packageJson\", {\n+ value: packageJson,\n+ });\n} catch (err) {\n// don't swallow syntax errors\nif (err.name === \"JSONError\") {\nthrow new ValidationError(err.name, err.message);\n}\n// try again next time\n- this._packageJson = null;\n- }\n}\n- return this._packageJson;\n+ return packageJson;\n}\nget package() {\n- if (!this._package) {\n- this._package = new Package(this.packageJson, this.rootPath);\n- }\n+ const pkg = new Package(this.packageJson, this.rootPath);\n+\n+ // redefine getter to lazy-loaded value\n+ Object.defineProperty(this, \"package\", {\n+ value: pkg,\n+ });\n- return this._package;\n+ return pkg;\n}\nisIndependent() {\n", "new_path": "core/project/index.js", "old_path": "core/project/index.js" } ]
JavaScript
MIT License
lerna/lerna
refactor(project): Cache lazy properties with Object.defineProperty()
1
refactor
project
724,000
26.03.2018 13:31:09
-3,600
0c8345d16047beb204292b8d40a8bf262c449678
build: 1.0.0-beta.13
[ { "change_type": "MODIFY", "diff": "{\n\"name\": \"@vue/test-utils\",\n- \"version\": \"1.0.0-beta.12\",\n+ \"version\": \"1.0.0-beta.13\",\n\"description\": \"Utilities for testing Vue components.\",\n\"main\": \"dist/vue-test-utils.js\",\n\"types\": \"types/index.d.ts\",\n", "new_path": "packages/test-utils/package.json", "old_path": "packages/test-utils/package.json" } ]
JavaScript
MIT License
vuejs/vue-test-utils
build: 1.0.0-beta.13
1
build
null
807,849
26.03.2018 15:55:10
25,200
6201d0b73a735372f093b43b40fd02ed0ae0e24e
refactor(validation-error): Pass along remaining arguments to logger
[ { "change_type": "MODIFY", "diff": "const log = require(\"npmlog\");\nclass ValidationError extends Error {\n- constructor(prefix, message) {\n+ constructor(prefix, message, ...rest) {\nsuper(message);\nthis.name = \"ValidationError\";\nthis.prefix = prefix;\nlog.resume(); // might be paused, noop otherwise\n- log.error(prefix, message);\n+ log.error(prefix, message, ...rest);\n}\n}\n", "new_path": "core/validation-error/validation-error.js", "old_path": "core/validation-error/validation-error.js" } ]
JavaScript
MIT License
lerna/lerna
refactor(validation-error): Pass along remaining arguments to logger
1
refactor
validation-error
807,849
26.03.2018 16:09:16
25,200
9de2362ee80a6495165403c7911e5bf481e6e8cc
refactor(project): Move default into transform, clear up error handling
[ { "change_type": "MODIFY", "diff": "@@ -18,7 +18,18 @@ class Project {\nrc: \"lerna.json\",\nrcStrictJson: true,\nsync: true,\n- transform: obj => {\n+ transform(obj) {\n+ // cosmiconfig returns null when nothing is found\n+ if (!obj) {\n+ return {\n+ // No need to distinguish between missing and empty,\n+ // saves a lot of noisy guards elsewhere\n+ config: {},\n+ // path.resolve(\".\", ...) starts from process.cwd()\n+ filepath: path.resolve(cwd || \".\", \"lerna.json\"),\n+ };\n+ }\n+\n// normalize command-specific config namespace\nif (obj.config.commands) {\nobj.config.command = obj.config.commands;\n@@ -34,20 +45,14 @@ class Project {\ntry {\nloaded = explorer.load(cwd);\n} catch (err) {\n- // don't swallow syntax errors\n+ // redecorate JSON syntax errors, avoid debug dump\nif (err.name === \"JSONError\") {\nthrow new ValidationError(err.name, err.message);\n}\n- }\n- // cosmiconfig returns null when nothing is found\n- loaded = loaded || {\n- // No need to distinguish between missing and empty,\n- // saves a lot of noisy guards elsewhere\n- config: {},\n- // path.resolve(\".\", ...) starts from process.cwd()\n- filepath: path.resolve(cwd || \".\", \"lerna.json\"),\n- };\n+ // re-throw other errors, could be ours or third-party\n+ throw err;\n+ }\nthis.config = loaded.config;\nthis.rootPath = path.dirname(loaded.filepath);\n@@ -103,10 +108,7 @@ class Project {\nvalue: packageJson,\n});\n} catch (err) {\n- // don't swallow syntax errors\n- if (err.name === \"JSONError\") {\n- throw new ValidationError(err.name, err.message);\n- }\n+ // syntax errors are already caught and reported by constructor\n// try again next time\n}\n", "new_path": "core/project/index.js", "old_path": "core/project/index.js" } ]
JavaScript
MIT License
lerna/lerna
refactor(project): Move default into transform, clear up error handling
1
refactor
project
807,849
26.03.2018 16:16:49
25,200
d4b2df288cbb739344f709b7339a11166bfa1822
test(project): Rename instance variable
[ { "change_type": "MODIFY", "diff": "@@ -26,41 +26,41 @@ describe(\"Project\", () => {\ndescribe(\".rootPath\", () => {\nit(\"should be added to the instance\", () => {\n- const repo = new Project(testDir);\n- expect(repo.rootPath).toBe(testDir);\n+ const project = new Project(testDir);\n+ expect(project.rootPath).toBe(testDir);\n});\nit(\"resolves to CWD when lerna.json missing\", async () => {\nconst cwd = await initFixture(\"no-lerna-config\");\n- const repo = new Project(cwd);\n+ const project = new Project(cwd);\n- expect(repo.rootPath).toBe(cwd);\n+ expect(project.rootPath).toBe(cwd);\n});\nit(\"defaults CWD to '.' when constructor argument missing\", () => {\n- const repo = new Project();\n- expect(repo.rootPath).toBe(testDir);\n+ const project = new Project();\n+ expect(project.rootPath).toBe(testDir);\n});\n});\ndescribe(\".lernaConfigLocation\", () => {\nit(\"should be added to the instance\", () => {\n- const repo = new Project(testDir);\n- expect(repo.lernaConfigLocation).toBe(path.join(testDir, \"lerna.json\"));\n+ const project = new Project(testDir);\n+ expect(project.lernaConfigLocation).toBe(path.join(testDir, \"lerna.json\"));\n});\n});\ndescribe(\".packageJsonLocation\", () => {\nit(\"should be added to the instance\", () => {\n- const repo = new Project(testDir);\n- expect(repo.packageJsonLocation).toBe(path.join(testDir, \"package.json\"));\n+ const project = new Project(testDir);\n+ expect(project.packageJsonLocation).toBe(path.join(testDir, \"package.json\"));\n});\n});\ndescribe(\".config\", () => {\nit(\"returns parsed lerna.json\", () => {\n- const repo = new Project(testDir);\n- expect(repo.config).toEqual({\n+ const project = new Project(testDir);\n+ expect(project.config).toEqual({\nversion: \"1.0.0\",\n});\n});\n@@ -77,7 +77,7 @@ describe(\"Project\", () => {\nconst cwd = await initFixture(\"invalid-json\");\ntry {\n- const repo = new Project(cwd); // eslint-disable-line no-unused-vars\n+ const project = new Project(cwd); // eslint-disable-line no-unused-vars\n} catch (err) {\nexpect(err.name).toBe(\"ValidationError\");\nexpect(err.prefix).toBe(\"JSONError\");\n@@ -172,50 +172,50 @@ describe(\"Project\", () => {\ndescribe(\"get .version\", () => {\nit(\"reads the `version` key from internal config\", () => {\n- const repo = new Project(testDir);\n- expect(repo.version).toBe(\"1.0.0\");\n+ const project = new Project(testDir);\n+ expect(project.version).toBe(\"1.0.0\");\n});\n});\ndescribe(\"set .version\", () => {\nit(\"sets the `version` key of internal config\", () => {\n- const repo = new Project(testDir);\n- repo.version = \"2.0.0\";\n- expect(repo.config.version).toBe(\"2.0.0\");\n+ const project = new Project(testDir);\n+ project.version = \"2.0.0\";\n+ expect(project.config.version).toBe(\"2.0.0\");\n});\n});\ndescribe(\"get .packageConfigs\", () => {\nit(\"returns the default packageConfigs\", () => {\n- const repo = new Project(testDir);\n- expect(repo.packageConfigs).toEqual([\"packages/*\"]);\n+ const project = new Project(testDir);\n+ expect(project.packageConfigs).toEqual([\"packages/*\"]);\n});\nit(\"returns custom packageConfigs\", () => {\n- const repo = new Project(testDir);\n+ const project = new Project(testDir);\nconst customPackages = [\".\", \"my-packages/*\"];\n- repo.config.packages = customPackages;\n- expect(repo.packageConfigs).toBe(customPackages);\n+ project.config.packages = customPackages;\n+ expect(project.packageConfigs).toBe(customPackages);\n});\nit(\"returns workspace packageConfigs\", async () => {\n- const testDirWithWorkspaces = await initFixture(\"yarn-workspaces\");\n- const repo = new Project(testDirWithWorkspaces);\n- expect(repo.packageConfigs).toEqual([\"packages/*\"]);\n+ const cwd = await initFixture(\"yarn-workspaces\");\n+ const project = new Project(cwd);\n+ expect(project.packageConfigs).toEqual([\"packages/*\"]);\n});\nit(\"throws with friendly error if workspaces are not configured\", () => {\n- const repo = new Project(testDir);\n- repo.config.useWorkspaces = true;\n- expect(() => repo.packageConfigs).toThrow(/workspaces need to be defined/);\n+ const project = new Project(testDir);\n+ project.config.useWorkspaces = true;\n+ expect(() => project.packageConfigs).toThrow(/workspaces need to be defined/);\n});\n});\ndescribe(\"get .packageParentDirs\", () => {\nit(\"returns a list of package parent directories\", () => {\n- const repo = new Project(testDir);\n- repo.config.packages = [\".\", \"packages/*\", \"dir/nested/*\", \"globstar/**\"];\n- expect(repo.packageParentDirs).toEqual([\n+ const project = new Project(testDir);\n+ project.config.packages = [\".\", \"packages/*\", \"dir/nested/*\", \"globstar/**\"];\n+ expect(project.packageParentDirs).toEqual([\ntestDir,\npath.join(testDir, \"packages\"),\npath.join(testDir, \"dir/nested\"),\n@@ -226,8 +226,7 @@ describe(\"Project\", () => {\ndescribe(\"get .packageJson\", () => {\nit(\"returns parsed package.json\", () => {\n- const repo = new Project(testDir);\n- expect(repo.packageJson).toMatchObject({\n+ expect(new Project(testDir).packageJson).toMatchObject({\nname: \"test\",\ndevDependencies: {\nlerna: \"500.0.0\",\n@@ -237,8 +236,8 @@ describe(\"Project\", () => {\n});\nit(\"caches the first successful value\", () => {\n- const repo = new Project(testDir);\n- expect(repo.packageJson).toBe(repo.packageJson);\n+ const project = new Project(testDir);\n+ expect(project.packageJson).toBe(project.packageJson);\n});\nit(\"does not cache failures\", async () => {\n@@ -246,11 +245,11 @@ describe(\"Project\", () => {\nawait fs.remove(path.join(cwd, \"package.json\"));\n- const repo = new Project(cwd);\n- expect(repo.packageJson).toBe(undefined);\n+ const project = new Project(cwd);\n+ expect(project.packageJson).toBe(undefined);\n- await fs.writeJSON(repo.packageJsonLocation, { name: \"test\" }, { spaces: 2 });\n- expect(repo.packageJson).toHaveProperty(\"name\", \"test\");\n+ await fs.writeJSON(project.packageJsonLocation, { name: \"test\" }, { spaces: 2 });\n+ expect(project.packageJson).toHaveProperty(\"name\", \"test\");\n});\nit(\"errors when root package.json is not valid JSON\", async () => {\n@@ -259,7 +258,7 @@ describe(\"Project\", () => {\nconst cwd = await initFixture(\"invalid-json\");\ntry {\n- const repo = new Project(cwd); // eslint-disable-line no-unused-vars\n+ const project = new Project(cwd); // eslint-disable-line no-unused-vars\n} catch (err) {\nexpect(err.name).toBe(\"ValidationError\");\nexpect(err.prefix).toBe(\"JSONError\");\n@@ -269,25 +268,25 @@ describe(\"Project\", () => {\ndescribe(\"get .package\", () => {\nit(\"returns a Package instance\", () => {\n- const repo = new Project(testDir);\n- expect(repo.package).toBeDefined();\n- expect(repo.package.name).toBe(\"test\");\n- expect(repo.package.location).toBe(testDir);\n+ const project = new Project(testDir);\n+ expect(project.package).toBeDefined();\n+ expect(project.package.name).toBe(\"test\");\n+ expect(project.package.location).toBe(testDir);\n});\nit(\"caches the initial value\", () => {\n- const repo = new Project(testDir);\n- expect(repo.package).toBe(repo.package);\n+ const project = new Project(testDir);\n+ expect(project.package).toBe(project.package);\n});\n});\ndescribe(\"isIndependent()\", () => {\nit(\"returns if the repository versioning is independent\", () => {\n- const repo = new Project(testDir);\n- expect(repo.isIndependent()).toBe(false);\n+ const project = new Project(testDir);\n+ expect(project.isIndependent()).toBe(false);\n- repo.version = \"independent\";\n- expect(repo.isIndependent()).toBe(true);\n+ project.version = \"independent\";\n+ expect(project.isIndependent()).toBe(true);\n});\n});\n});\n", "new_path": "core/project/__tests__/project.test.js", "old_path": "core/project/__tests__/project.test.js" } ]
JavaScript
MIT License
lerna/lerna
test(project): Rename instance variable
1
test
project
573,227
26.03.2018 16:45:23
25,200
4a2e5ccdb27a15f5b3b6d4e9c98f4e751e97c7de
docs(server): document ignoreTrailingSlash
[ { "change_type": "MODIFY", "diff": "@@ -73,6 +73,8 @@ routes and handlers for incoming requests.\nciphers; however these can all be specified on httpsServerOptions.\n- `options.strictRouting` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** If set, Restify\nwill treat \"/foo\" and \"/foo/\" as different paths. (optional, default `false`)\n+ - `options.ignoreTrailingSlash` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** ignore trailing slash\n+ on paths (optional, default `false`)\n**Examples**\n@@ -133,6 +135,8 @@ Creates a new Server.\nciphers; however these can all be specified on httpsServerOptions.\n- `options.noWriteContinue` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** prevents\n`res.writeContinue()` in `server.on('checkContinue')` when proxing (optional, default `false`)\n+ - `options.ignoreTrailingSlash` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** ignore trailing slash\n+ on paths (optional, default `false`)\n**Examples**\n", "new_path": "docs/_api/server.md", "old_path": "docs/_api/server.md" }, { "change_type": "MODIFY", "diff": "@@ -25,6 +25,12 @@ The new version of restify never returns `RequestAbortedError`.\nOption `strictRouting` is removed `createServer({ strictRouting: false })`.\nStrict routing is the new default.\n+### Path trailing slash at the end\n+\n+`/path` and `/path/` are not the same thing in restify `v7.x`.\n+Use `ignoreTrailingSlash: true` server option if you don't want to differentiate\n+them from each other.\n+\n### Different `RegExp` usage in router path and wildcards\nrestify's new router backend\n", "new_path": "docs/guides/6to7guide.md", "old_path": "docs/guides/6to7guide.md" }, { "change_type": "MODIFY", "diff": "@@ -55,6 +55,8 @@ require('./errorTypes');\n* ciphers; however these can all be specified on httpsServerOptions.\n* @param {Boolean} [options.strictRouting=false] - If set, Restify\n* will treat \"/foo\" and \"/foo/\" as different paths.\n+ * @param {Boolean} [options.ignoreTrailingSlash=false] - ignore trailing slash\n+ * on paths\n* @example\n* var restify = require('restify');\n* var server = restify.createServer();\n", "new_path": "lib/index.js", "old_path": "lib/index.js" }, { "change_type": "MODIFY", "diff": "@@ -33,8 +33,8 @@ var ResourceNotFoundError = errors.ResourceNotFoundError;\n* @param {Boolean} [options.strictNext=false] - Throws error when next() is\n* called more than once, enabled onceNext option\n* @param {Object} [options.registry] - route registry\n- * @param {Object} [options.ignoreTrailingSlash] - ignore trailing slash on\n- * paths\n+ * @param {Boolean} [options.ignoreTrailingSlash=false] - ignore trailing slash\n+ * on paths\n*/\nfunction Router(options) {\nassert.object(options, 'options');\n", "new_path": "lib/router.js", "old_path": "lib/router.js" }, { "change_type": "MODIFY", "diff": "@@ -90,6 +90,8 @@ var PROXY_EVENTS = [\n* ciphers; however these can all be specified on httpsServerOptions.\n* @param {Boolean} [options.noWriteContinue=false] - prevents\n* `res.writeContinue()` in `server.on('checkContinue')` when proxing\n+ * @param {Boolean} [options.ignoreTrailingSlash=false] - ignore trailing slash\n+ * on paths\n* @example\n* var restify = require('restify');\n* var server = restify.createServer();\n", "new_path": "lib/server.js", "old_path": "lib/server.js" } ]
JavaScript
MIT License
restify/node-restify
docs(server): document ignoreTrailingSlash (#1633)
1
docs
server
573,227
26.03.2018 16:52:12
25,200
a97c15027b58f7b73e0a6e30a23f0fe7a760413e
docs(guides): path must start with / in 7.x
[ { "change_type": "MODIFY", "diff": "@@ -31,6 +31,14 @@ Strict routing is the new default.\nUse `ignoreTrailingSlash: true` server option if you don't want to differentiate\nthem from each other.\n+### Path must to start with `/`\n+\n+In restify 7.x path must start with a `/`.\n+For example `server.get('foo')` is invalid, change it to `server.get('/foo')`.\n+\n+If you use [enroute](https://github.com/restify/enroute) be sure\n+that you updated it to the latest version.\n+\n### Different `RegExp` usage in router path and wildcards\nrestify's new router backend\n", "new_path": "docs/guides/6to7guide.md", "old_path": "docs/guides/6to7guide.md" } ]
JavaScript
MIT License
restify/node-restify
docs(guides): path must start with / in 7.x (#1630)
1
docs
guides
807,849
26.03.2018 17:01:42
25,200
4ac80623af7a7c067d7a6bc8f3f09cb208709f01
docs(project): Add a brief description and somewhat longer nesting example
[ { "change_type": "MODIFY", "diff": "# `@lerna/project`\n-> description TODO\n+> Lerna project configuration\n-## Usage\n+## Configuration Resolution\n-TODO\n+Lerna's file-based configuration is located in `lerna.json` or the `lerna` property of `package.json`.\n+Wherever this configuration is found is considered the \"root\" of the lerna-managed multi-package repository.\n+A minimum-viable configuration only needs a `version` property; the following examples are equivalent:\n+\n+```json\n+{\n+ \"version\": \"1.2.3\"\n+}\n+```\n+```json\n+{\n+ \"name\": \"my-monorepo\",\n+ \"version\": \"0.0.0-root\",\n+ \"private\": true,\n+ \"lerna\": {\n+ \"version\": \"1.2.3\"\n+ }\n+}\n+```\n+\n+Any other properties on this configuration object will be used as defaults for CLI options of _all_ lerna subcommands. That is to say, CLI options _always_ override values found in configuration files (a standard practice for CLI applications).\n+\n+### Command-Specific Configuration\n+\n+To focus configuration on a particular subcommand, use the `command` subtree. Each subproperty of `command` corresponds to a lerna subcommand (`publish`, `create`, `run`, `exec`, etc).\n+\n+```json\n+{\n+ \"version\": \"1.2.3\",\n+ \"command\": {\n+ \"publish\": {\n+ \"loglevel\": \"verbose\"\n+ }\n+ },\n+ \"loglevel\": \"success\"\n+}\n+```\n+\n+In the example above, `lerna publish` will act as if `--loglevel verbose` was passed.\n+All other subcommands will receive the equivalent of `--loglevel success` (much much quieter).\n", "new_path": "core/project/README.md", "old_path": "core/project/README.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"@lerna/project\",\n\"version\": \"3.0.0-beta.9\",\n- \"description\": \"TODO\",\n+ \"description\": \"Lerna project configuration\",\n\"keywords\": [\n\"lerna\",\n\"core\"\n", "new_path": "core/project/package.json", "old_path": "core/project/package.json" } ]
JavaScript
MIT License
lerna/lerna
docs(project): Add a brief description and somewhat longer nesting example
1
docs
project
217,922
26.03.2018 22:48:30
-7,200
fa84dca115a43485aae1566f58cbc4decbe75e8e
chore: fix issue made by with some translations
[ { "change_type": "MODIFY", "diff": "-<h2 mat-dialog-title>{{'Do you really want to reset the list?'| translate}}</h2>\n+<h2 mat-dialog-title>{{ (message || 'Confirmation') | translate}}</h2>\n<mat-dialog-actions>\n<button mat-raised-button [mat-dialog-close]=\"true\" color=\"primary\">{{'Yes'| translate}}</button>\n<button mat-raised-button mat-dialog-close color=\"warning\">{{'No'| translate}}</button>\n", "new_path": "src/app/modules/common-components/confirmation-popup/confirmation-popup.component.html", "old_path": "src/app/modules/common-components/confirmation-popup/confirmation-popup.component.html" }, { "change_type": "MODIFY", "diff": "-import {Component} from '@angular/core';\n+import {Component, Inject} from '@angular/core';\n+import {MAT_DIALOG_DATA} from '@angular/material';\n@Component({\nselector: 'app-confirmation-popup',\n@@ -7,7 +8,7 @@ import {Component} from '@angular/core';\n})\nexport class ConfirmationPopupComponent {\n- constructor() {\n+ constructor(@Inject(MAT_DIALOG_DATA) public message: string) {\n}\n}\n", "new_path": "src/app/modules/common-components/confirmation-popup/confirmation-popup.component.ts", "old_path": "src/app/modules/common-components/confirmation-popup/confirmation-popup.component.ts" }, { "change_type": "MODIFY", "diff": "@@ -321,7 +321,7 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\npublic resetProgression(): void {\nthis.subscriptions.push(\n- this.dialog.open(ConfirmationPopupComponent).afterClosed()\n+ this.dialog.open(ConfirmationPopupComponent, {data: 'Do you really want to reset the list?'}).afterClosed()\n.filter(r => r)\n.map(() => {\nreturn this.listData;\n", "new_path": "src/app/pages/list/list-details/list-details.component.ts", "old_path": "src/app/pages/list/list-details/list-details.component.ts" }, { "change_type": "MODIFY", "diff": "{\n+ \"Confirmation\": \"Confirmation\",\n\"Is_working_on_it\": \"{{name}} is working on it\",\n\"Work_on_it\": \"I'm working on it\",\n\"Add_as_collectible\": \"Add as collectable\",\n", "new_path": "src/assets/i18n/en.json", "old_path": "src/assets/i18n/en.json" }, { "change_type": "MODIFY", "diff": "{\n+ \"Confirmation\": \"Confirmation\",\n\"Is_working_on_it\": \"{{name}} travaille dessus\",\n\"Work_on_it\": \"Je m'en occupe\",\n\"Add_as_collectible\": \"Ajouter en collectionnable\",\n", "new_path": "src/assets/i18n/fr.json", "old_path": "src/assets/i18n/fr.json" }, { "change_type": "MODIFY", "diff": "{\n+ \"Confirmation\": \"Confirmation\",\n\"Is_working_on_it\": \"{{name}} is working on it\",\n\"Work_on_it\": \"I'm working on it\",\n\"Add_as_collectible\": \"Add as collectable\",\n", "new_path": "src/assets/i18n/ja.json", "old_path": "src/assets/i18n/ja.json" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: fix issue made by #297 with some translations
1
chore
null
311,007
27.03.2018 02:40:18
-32,400
0f937b4ad7ae365169b6ec9e376425db1c3be553
chore(lab): ignore generated lerna files after failure
[ { "change_type": "MODIFY", "diff": "@@ -79,6 +79,7 @@ Each `packages/*` folder represents a package on npm.\n1. TypeScript source files are in `packages/**/src`.\n1. Good luck! :muscle: Please open an issue if you have questions or something\nis unclear.\n+1. If node-sass error occurs, you should add permission `npm`. ex) `sudo chown -R $(whoami) ~/.npm`\n#### Running Dev CLI\n", "new_path": "CONTRIBUTING.md", "old_path": "CONTRIBUTING.md" }, { "change_type": "MODIFY", "diff": "www\n+bin/ionic-lab.*\n\\ No newline at end of file\n", "new_path": "packages/@ionic/lab/.gitignore", "old_path": "packages/@ionic/lab/.gitignore" } ]
TypeScript
MIT License
ionic-team/ionic-cli
chore(lab): ignore generated lerna files after failure (#3028)
1
chore
lab
311,007
27.03.2018 02:41:01
-32,400
b5bc37ea976022735e52e12c880484b7cd231707
fix(generate): change default styleext scss
[ { "change_type": "MODIFY", "diff": "\"styleext\": {\n\"type\": \"string\",\n\"description\": \"The file extension of the style file for the page\",\n- \"default\": \"css\"\n+ \"default\": \"scss\"\n},\n\"spec\": {\n\"type\": \"boolean\",\n", "new_path": "packages/@ionic/schematics-angular/page/schema.json", "old_path": "packages/@ionic/schematics-angular/page/schema.json" } ]
TypeScript
MIT License
ionic-team/ionic-cli
fix(generate): change default styleext scss (#3032)
1
fix
generate
730,429
27.03.2018 09:45:57
14,400
7a3508ddfdff8f04aec712c5001a2c663874946e
chore(Jenkinsfile): add app id to secrets
[ { "change_type": "MODIFY", "diff": "@@ -107,6 +107,7 @@ ansiColor('xterm') {\nwithCredentials([\nstring(credentialsId: 'ddfd04fb-e00a-4df0-9250-9a7cb37bce0e', variable: 'CISCOSPARK_CLIENT_SECRET'),\nusernamePassword(credentialsId: 'SAUCE_LABS_VALIDATED_MERGE_CREDENTIALS', passwordVariable: 'SAUCE_ACCESS_KEY', usernameVariable: 'SAUCE_USERNAME'),\n+ string(credentialsId: 'CISCOSPARK_APPID_SECRET', variable: 'CISCOSPARK_APPID_SECRET'),\n]) {\nsh '''#!/bin/bash -ex\nsource ~/.nvm/nvm.sh\n", "new_path": "Jenkinsfile", "old_path": "Jenkinsfile" } ]
JavaScript
MIT License
webex/react-widgets
chore(Jenkinsfile): add app id to secrets
1
chore
Jenkinsfile
815,746
27.03.2018 11:03:51
-10,800
0dd11c485583195e1a03fa56eb42d1bddbb570a3
feat: allow group by expression closes
[ { "change_type": "MODIFY", "diff": "@@ -131,7 +131,7 @@ map: {\n| [clearable] | `boolean` | `true` | no | Allow to clear selected value. Default `true`|\n| clearAllText | `string` | `Clear all` | no | Set custom text for clear all icon title |\n| dropdownPosition | `bottom`,`top`,`auto` | `bottom` | no | Set the dropdown position on open |\n-| [groupBy] | `string` | null | no | Allow to group items by key |\n+| [groupBy] | `string` or `Function` | null | no | Allow to group items by key or function expression |\n| [selectableGroup] | `boolean` | false | no | Allow to select group when groupBy is used |\n| [items] | `Array<NgOption>` | `[]` | yes | Items array |\n| loading | `boolean` | `-` | no | You can set the loading state from the outside (e.g. async items loading) |\n", "new_path": "README.md", "old_path": "README.md" }, { "change_type": "ADD", "diff": "+#!/bin/bash\n+BASE_DIR=./integration/node_modules\n+yarn clean\n+yarn build\n+mkdir -p $BASE_DIR\n+mkdir -p ${BASE_DIR}/@ng-select\n+mkdir -p ${BASE_DIR}/@ng-select/ng-select\n+cp -R ./dist ${BASE_DIR}/@ng-select/ng-select\n+cd ./integration\n+yarn install\n+yarn build\n+yarn e2e\n", "new_path": "integration_test.sh", "old_path": null }, { "change_type": "MODIFY", "diff": "\"npm\": \">= 3.0.0\"\n},\n\"scripts\": {\n- \"clean\": \"rimraf out-tsc dist/*\",\n- \"prebuild\": \"npm run clean\",\n- \"build\": \"ng-packagr -p ./src/package.json && npm run build:themes\",\n+ \"clean\": \"rimraf out-tsc dist/* integration/node_modules/@ng-select\",\n+ \"prebuild\": \"yarn clean\",\n+ \"build\": \"ng-packagr -p ./src/package.json && yarn build:themes\",\n\"build:demo\": \"rimraf dist && webpack --config ./scripts/webpack.dev.js --progress --profile --bail\",\n\"build:themes\": \"node-sass --output-style compressed src/themes/ -o dist/themes\",\n\"prestart\": \"yarn install\",\n\"test:watch\": \"karma start ./scripts/karma.conf.js --no-single-run --auto-watch\",\n\"test\": \"karma start ./scripts/karma.conf.js --single-run\",\n\"coveralls\": \"cat ./coverage/lcov/lcov.info | ./node_modules/coveralls/bin/coveralls.js\",\n- \"preintegration\": \"npm run clean && npm run build && cd integration && yarn\",\n- \"integration\": \"npm run integration:aot && npm run integration:jit\",\n- \"integration:jit\": \"cd integration && npm run e2e\",\n- \"integration:aot\": \"cd integration && npm run build\",\n+ \"integration\": \"./integration_test.sh\",\n\"lint\": \"tslint --type-check --project ./src/tsconfig.json\",\n\"release\": \"sh ./release.sh\"\n},\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "@@ -246,9 +246,10 @@ export class ItemsList {\nreturn this._selected[this._selected.length - 1];\n}\n- private _groupBy(items: NgOption[], prop: string): { [index: string]: NgOption[] } {\n+ private _groupBy(items: NgOption[], prop: string | Function): { [index: string]: NgOption[] } {\n+ const isPropFn = prop instanceof Function;\nconst groups = items.reduce((grouped, item) => {\n- const key = item.value[prop];\n+ const key = isPropFn ? (<Function>prop).apply(this, [item.value]) : item.value[<string>prop];\ngrouped[key] = grouped[key] || [];\ngrouped[key].push(item);\nreturn grouped;\n", "new_path": "src/ng-select/items-list.ts", "old_path": "src/ng-select/items-list.ts" }, { "change_type": "MODIFY", "diff": "\"member-access\": false,\n\"member-ordering\": [\ntrue,\n- \"static-before-instance\",\n- \"variables-before-functions\"\n+ \"static-before-instance\"\n],\n\"no-arg\": true,\n\"no-bitwise\": true,\n", "new_path": "tslint.json", "old_path": "tslint.json" } ]
TypeScript
MIT License
ng-select/ng-select
feat: allow group by expression (#385) closes #375
1
feat
null
815,746
27.03.2018 11:04:15
-10,800
37f13ab6b16e7fce7559ddc8b53aaea6f7e6836b
chore(release): 0.31.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.31.0\"></a>\n+# [0.31.0](https://github.com/ng-select/ng-select/compare/v0.30.1...v0.31.0) (2018-03-27)\n+\n+\n+### Features\n+\n+* allow group by expression ([#385](https://github.com/ng-select/ng-select/issues/385)) ([0dd11c4](https://github.com/ng-select/ng-select/commit/0dd11c4)), closes [#375](https://github.com/ng-select/ng-select/issues/375)\n+\n+\n+\n<a name=\"0.30.1\"></a>\n## [0.30.1](https://github.com/ng-select/ng-select/compare/v0.30.0...v0.30.1) (2018-03-19)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"$schema\": \"../node_modules/ng-packagr/package.schema.json\",\n\"name\": \"@ng-select/ng-select\",\n- \"version\": \"0.30.1\",\n+ \"version\": \"0.31.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.31.0
1
chore
release
815,800
27.03.2018 16:07:44
-7,200
8bcfe56ea8e05b346f6c0ec6e1bb6ac2c408922c
fix: incorrect border on multiple default theme closes
[ { "change_type": "MODIFY", "diff": "@@ -96,9 +96,11 @@ $color-selected: #f5faff;\nborder: 1px solid #e3e3e3;\n}\n.ng-value-label {\n+ display: inline-block;\npadding: 2px 5px 2px 1px;\n}\n.ng-value-icon {\n+ display: inline-block;\npadding: 3px 5px;\n&:hover {\nbackground-color: #d8eafd;\n", "new_path": "src/themes/default.theme.scss", "old_path": "src/themes/default.theme.scss" } ]
TypeScript
MIT License
ng-select/ng-select
fix: incorrect border on multiple default theme (#354) (#386) closes #354
1
fix
null
217,922
27.03.2018 16:39:51
-7,200
52c59f1a0cf4ad696c8984e5eb3f1909fe3b63f3
feat: compact view for sidebar menu closes
[ { "change_type": "MODIFY", "diff": "{\n\"name\": \"teamcraft\",\n- \"version\": \"3.4.2\",\n+ \"version\": \"3.4.3\",\n\"lockfileVersion\": 1,\n\"requires\": true,\n\"dependencies\": {\n", "new_path": "package-lock.json", "old_path": "package-lock.json" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"teamcraft\",\n- \"version\": \"3.4.2\",\n+ \"version\": \"3.4.3\",\n\"license\": \"MIT\",\n\"scripts\": {\n\"ng\": \"ng\",\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "</button>\n<span class=\"version\">{{version}}</span>\n</mat-toolbar>\n- <mat-sidenav-container>\n- <mat-sidenav mode=\"{{mobile ? 'over':'side' }}\" opened=\"{{!mobile}}\" #sidenav [disableClose]=\"!mobile\">\n- <div class=\"accent-background\">\n+ <mat-sidenav-container [autosize]=\"true\">\n+ <mat-sidenav mode=\"{{mobile ? 'over':'side' }}\" opened=\"{{!mobile}}\" #sidenav [disableClose]=\"!mobile\"\n+ [ngClass]=\"{'compact': settings.compactSidebar}\">\n+ <div class=\"accent-background\" *ngIf=\"!settings.compactSidebar\">\n<div class=\"user\">\n<mat-icon *ngIf=\"(authState | async)?.isAnonymous\">person</mat-icon>\n<img *ngIf=\"!((authState | async)?.isAnonymous)\" src=\"{{userIcon}}\"\n<button mat-raised-button *ngIf=\"!(authState | async)?.isAnonymous\" (click)=\"disconnect()\">\n{{'Disconnect' | translate}}\n</button>\n+ <button mat-icon-button matTooltip=\"{{'Compact_sidebar_toggle' | translate}}\"\n+ matTooltipPosition=\"right\" (click)=\"settings.compactSidebar = true; detectChanges()\">\n+ <mat-icon>keyboard_arrow_left</mat-icon>\n+ </button>\n+ </div>\n+ <div class=\"accent-background\" *ngIf=\"settings.compactSidebar\">\n+ <div class=\"user\">\n+ <mat-icon *ngIf=\"(authState | async)?.isAnonymous\">person</mat-icon>\n+ <img *ngIf=\"!((authState | async)?.isAnonymous)\" src=\"{{userIcon}}\"\n+ routerLink=\"/profile/{{(authState | async)?.uid}}\">\n+ </div>\n</div>\n<mat-divider></mat-divider>\n<mat-nav-list>\n+ <mat-list-item *ngIf=\"settings.compactSidebar\">\n+ <button mat-icon-button matTooltip=\"{{'Compact_sidebar_toggle' | translate}}\"\n+ matTooltipPosition=\"right\" (click)=\"settings.compactSidebar = false; detectChanges()\">\n+ <mat-icon>keyboard_arrow_right</mat-icon>\n+ </button>\n+ </mat-list-item>\n<mat-list-item routerLink=\"/home\" (click)=\"mobile ? sidenav.close() : null\">\n<mat-icon matListIcon>home</mat-icon>\n- <span matLine>{{'Home' | translate}}</span>\n+ <span matLine *ngIf=\"!settings.compactSidebar\">{{'Home' | translate}}</span>\n</mat-list-item>\n<mat-list-item routerLink=\"/profile\" (click)=\"mobile ? sidenav.close() : null\"\n*ngIf=\"!(authState | async)?.isAnonymous\">\n<mat-icon matListIcon>person</mat-icon>\n- <span matLine>{{'Profile' | translate}}</span>\n+ <span matLine *ngIf=\"!settings.compactSidebar\">{{'Profile' | translate}}</span>\n</mat-list-item>\n<mat-list-item routerLink=\"/custom-links\" (click)=\"mobile ? sidenav.close() : null\"\n*ngIf=\"customLinksEnabled\">\n<mat-icon matListIcon>link</mat-icon>\n- <span matLine>{{'CUSTOM_LINKS.Title' | translate}}</span>\n+ <span matLine *ngIf=\"!settings.compactSidebar\">{{'CUSTOM_LINKS.Title' | translate}}</span>\n</mat-list-item>\n<mat-list-item routerLink=\"/recipes\" (click)=\"mobile ? sidenav.close() : null\">\n<mat-icon matListIcon>search</mat-icon>\n- <span matLine>{{'Recipes' | translate}}</span>\n+ <span matLine *ngIf=\"!settings.compactSidebar\">{{'Recipes' | translate}}</span>\n</mat-list-item>\n<mat-list-item routerLink=\"/lists\" (click)=\"mobile ? sidenav.close() : null\">\n<mat-icon matListIcon>view_list</mat-icon>\n- <span matLine>{{'Lists' | translate}}</span>\n+ <span matLine *ngIf=\"!settings.compactSidebar\">{{'Lists' | translate}}</span>\n</mat-list-item>\n<mat-list-item routerLink=\"/public-lists\" (click)=\"mobile ? sidenav.close() : null\">\n<mat-icon matListIcon>public</mat-icon>\n- <span matLine>{{'Public_lists' | translate}}</span>\n+ <span matLine *ngIf=\"!settings.compactSidebar\">{{'Public_lists' | translate}}</span>\n</mat-list-item>\n<mat-list-item routerLink=\"/alarms\" (click)=\"mobile ? sidenav.close() : null\">\n<mat-icon matListIcon>alarm</mat-icon>\n- <span matLine>{{'HOME_PAGE.FEATURES.alarms_title' | translate}}</span>\n+ <span matLine\n+ *ngIf=\"!settings.compactSidebar\">{{'HOME_PAGE.FEATURES.alarms_title' | translate}}</span>\n</mat-list-item>\n<mat-list-item routerLink=\"/gathering-location\" (click)=\"mobile ? sidenav.close() : null\">\n<mat-icon matListIcon>location_on</mat-icon>\n- <span matLine>{{'GATHERING_LOCATIONS.Title' | translate}}</span>\n+ <span matLine *ngIf=\"!settings.compactSidebar\">{{'GATHERING_LOCATIONS.Title' | translate}}</span>\n</mat-list-item>\n<mat-list-item routerLink=\"/macro-translation\" (click)=\"mobile ? sidenav.close() : null\">\n<mat-icon matListIcon>translate</mat-icon>\n- <span matLine>{{'MACRO_TRANSLATION.Title' | translate}}</span>\n+ <span matLine *ngIf=\"!settings.compactSidebar\">{{'MACRO_TRANSLATION.Title' | translate}}</span>\n</mat-list-item>\n<mat-list-item routerLink=\"/favorites\" (click)=\"mobile ? sidenav.close() : null\">\n<mat-icon matListIcon>favorite</mat-icon>\n- <span matLine>{{'Favorites' | translate}}</span>\n+ <span matLine *ngIf=\"!settings.compactSidebar\">{{'Favorites' | translate}}</span>\n</mat-list-item>\n<mat-list-item routerLink=\"/settings\" (click)=\"mobile ? sidenav.close() : null\">\n<mat-icon matListIcon>settings</mat-icon>\n- <span matLine>{{'SETTINGS.title' | translate}}</span>\n+ <span matLine *ngIf=\"!settings.compactSidebar\">{{'SETTINGS.title' | translate}}</span>\n</mat-list-item>\n<mat-list-item routerLink=\"/features\" (click)=\"mobile ? sidenav.close() : null\">\n<mat-icon matListIcon>help_outline</mat-icon>\n- <span matLine>{{'HOME_PAGE.features' | translate}}</span>\n+ <span matLine *ngIf=\"!settings.compactSidebar\">{{'HOME_PAGE.features' | translate}}</span>\n</mat-list-item>\n<mat-list-item routerLink=\"/about\" (click)=\"mobile ? sidenav.close() : null\">\n<mat-icon matListIcon>info_outline</mat-icon>\n- <span matLine>{{'ABOUT.title' | translate}}</span>\n+ <span matLine *ngIf=\"!settings.compactSidebar\">{{'ABOUT.title' | translate}}</span>\n</mat-list-item>\n</mat-nav-list>\n- <button mat-button [matMenuTriggerFor]=\"langMenu\" fxHide fxShow.lt-md>\n+ <button mat-button [matMenuTriggerFor]=\"langMenu\" fxHide fxShow.lt-md *ngIf=\"!settings.compactSidebar\">\n{{locale | uppercase}}\n</button>\n<div class=\"spacer\"></div>\n{{\"GIVEWAY.Title\" |\ntranslate}}\n</button>\n- <div class=\"social-fabs bottom-button\">\n+ <div class=\"social-fabs bottom-button\" *ngIf=\"!settings.compactSidebar\">\n<div class=\"fab-container\"><a href=\"https://facebook.com/ffxivteamcraft\" mat-mini-fab\nclass=\"social-fab facebook\" target=\"\n_blank\"><i class=\"fab fa-facebook-f\"></i></a></div>\n</div>\n<a mat-raised-button href=\"https://github.com/supamiu/ffxiv-teamcraft/issues\" target=\"_blank\"\nclass=\"bottom-button\"\n- color=\"warn\">Report\n- a bug</a>\n+ color=\"warn\" *ngIf=\"!settings.compactSidebar\">Report a bug\n+ </a>\n</div>\n</mat-sidenav>\n<div class=\"content\">\n", "new_path": "src/app/app.component.html", "old_path": "src/app/app.component.html" }, { "change_type": "MODIFY", "diff": "mat-sidenav-container {\nheight: calc(100vh - 64px);\n.mat-sidenav {\n+ &.compact {\n+ width: 68px;\n+ min-width: unset;\n+ .mat-list-item-content {\n+ padding-right: 0;\n+ }\n+ .accent-background {\n+ padding: 10px;\n+ .user {\n+ margin-bottom: 0;\n+ }\n+ }\n+ }\nwidth: 10%;\nmin-width: 250px;\nmax-width: 350px;\nflex-shrink: 0;\ndisplay: flex;\nflex-direction: column;\n+ justify-content: center;\n+ align-items: center;\nmargin-top: 20px;\n.bottom-button {\nflex: 1 1 auto;\n", "new_path": "src/app/app.component.scss", "old_path": "src/app/app.component.scss" }, { "change_type": "MODIFY", "diff": "-import {Component, OnInit} from '@angular/core';\n+import {ChangeDetectorRef, Component, OnInit} from '@angular/core';\nimport {AngularFireAuth} from 'angularfire2/auth';\nimport {TranslateService} from '@ngx-translate/core';\nimport {NavigationEnd, Router} from '@angular/router';\n@@ -75,7 +75,8 @@ export class AppComponent implements OnInit {\npublic settings: SettingsService,\npublic helpService: HelpService,\nprivate push: PushNotificationsService,\n- overlayContainer: OverlayContainer) {\n+ overlayContainer: OverlayContainer,\n+ public cd: ChangeDetectorRef) {\nsettings.themeChange$.subscribe(change => {\noverlayContainer.getContainerElement().classList.remove(`${change.previous}-theme`);\n@@ -144,6 +145,10 @@ export class AppComponent implements OnInit {\n});\n}\n+ detectChanges(): void {\n+ this.cd.detectChanges();\n+ }\n+\ncloseSnack(): void {\nif (this.registrationSnackRef !== undefined) {\nthis.registrationSnackRef.dismiss();\n", "new_path": "src/app/app.component.ts", "old_path": "src/app/app.component.ts" }, { "change_type": "MODIFY", "diff": "@@ -28,6 +28,14 @@ export class SettingsService {\nthis.setSetting('compact-lists', compact.toString());\n}\n+ public get compactSidebar(): boolean {\n+ return this.getSetting('compact-sidebar', 'false') === 'true';\n+ }\n+\n+ public set compactSidebar(compact: boolean) {\n+ this.setSetting('compact-sidebar', compact.toString());\n+ }\n+\npublic get compactAlarms(): boolean {\nreturn this.getSetting('compact-alarms', 'false') === 'true';\n}\n", "new_path": "src/app/pages/settings/settings.service.ts", "old_path": "src/app/pages/settings/settings.service.ts" }, { "change_type": "MODIFY", "diff": "{\n+ \"Compact_sidebar_toggle\": \"Toggle compact sidebar\",\n\"Confirmation\": \"Confirmation\",\n\"Is_working_on_it\": \"{{name}} is working on it\",\n\"Work_on_it\": \"I'm working on it\",\n", "new_path": "src/assets/i18n/en.json", "old_path": "src/assets/i18n/en.json" }, { "change_type": "MODIFY", "diff": "{\n+ \"Compact_sidebar_toggle\": \"Toggle compact sidebar\",\n\"Confirmation\": \"Confirmation\",\n\"Is_working_on_it\": \"{{name}} is working on it\",\n\"Work_on_it\": \"I'm working on it\",\n", "new_path": "src/assets/i18n/ja.json", "old_path": "src/assets/i18n/ja.json" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
feat: compact view for sidebar menu closes #294
1
feat
null
815,746
27.03.2018 17:08:14
-10,800
fa06772ee427e37c4fc06c7883f5d5db871978ef
chore(release): 0.31.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.31.1\"></a>\n+## [0.31.1](https://github.com/ng-select/ng-select/compare/v0.31.0...v0.31.1) (2018-03-27)\n+\n+\n+### Bug Fixes\n+\n+* incorrect border on multiple default theme ([#354](https://github.com/ng-select/ng-select/issues/354)) ([#386](https://github.com/ng-select/ng-select/issues/386)) ([8bcfe56](https://github.com/ng-select/ng-select/commit/8bcfe56))\n+\n+\n+\n<a name=\"0.31.0\"></a>\n# [0.31.0](https://github.com/ng-select/ng-select/compare/v0.30.1...v0.31.0) (2018-03-27)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"$schema\": \"../node_modules/ng-packagr/package.schema.json\",\n\"name\": \"@ng-select/ng-select\",\n- \"version\": \"0.31.0\",\n+ \"version\": \"0.31.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.31.1
1
chore
release
679,913
27.03.2018 19:24:48
-3,600
ba0bcc219f119e7add1e305373409d94349c6e3b
refactor(pointfree): rename core words & change case runU => runu map => maptos mapN => mapnth dropIf/dupIf => dropif/dupif condM => cases bitAnd/Or/Not => bitand/or/not isPos/Neg/Null/Zero => ispos/neg/null/zero execQ => execq storeAt => storeat pushEnv => pushenv loadKey/storeKey => loadkey/storekey
[ { "change_type": "MODIFY", "diff": "+bench\nbuild\ncoverage\ndev\n", "new_path": "packages/pointfree/.npmignore", "old_path": "packages/pointfree/.npmignore" }, { "change_type": "MODIFY", "diff": "@@ -43,7 +43,7 @@ export const run = (prog: StackProc, ctx: StackContext = [[], [], {}]): StackCon\n* @param ctx\n* @param n\n*/\n-export const runU = (prog: StackProc, ctx?: StackContext, n = 1) =>\n+export const runu = (prog: StackProc, ctx?: StackContext, n = 1) =>\nunwrap(run(prog, ctx), n);\n/**\n@@ -125,7 +125,7 @@ const op2 = (op: (b, a) => any) =>\n};\nexport {\n- op1 as map,\n+ op1 as maptos,\nop2 as map2\n}\n@@ -231,7 +231,7 @@ export const drop2 = (ctx: StackContext) =>\n*\n* ( x -- x )\n*/\n-export const dropIf = (ctx: StackContext) =>\n+export const dropif = (ctx: StackContext) =>\n($(ctx[0], 1), tos(ctx[0]) && ctx[0].length-- , ctx);\n/**\n@@ -280,14 +280,14 @@ export const dup2 = (ctx: StackContext) => {\n*\n* @param ctx\n*/\n-export const dupIf = (ctx: StackContext) => {\n+export const dupif = (ctx: StackContext) => {\n$(ctx[0], 1);\nconst x = tos(ctx[0]);\nx && ctx[0].push(x);\nreturn ctx;\n};\n-const _swap = (i) => (ctx: StackContext) => {\n+const _swap = (i: number) => (ctx: StackContext) => {\nconst stack = ctx[i];\nconst n = stack.length - 2;\n$n(n, 0);\n@@ -297,7 +297,7 @@ const _swap = (i) => (ctx: StackContext) => {\nreturn ctx;\n};\n-const _swap2 = (i) => (ctx: StackContext) => {\n+const _swap2 = (i: number) => (ctx: StackContext) => {\nconst stack = ctx[i];\nlet n = stack.length - 1;\n$n(n, 3);\n@@ -411,14 +411,14 @@ export const over = (ctx: StackContext) => {\n}\n/**\n- * Higher order word. Pops TOS and uses it as index to transform d-stack\n- * item @ `stack[TOS]` w/ given transformation.\n+ * Higher order word. Pops TOS and uses it as index `n` to transform d-stack\n+ * item @ `stack[-n]` w/ given transformation.\n*\n* ( x -- )\n*\n* @param op\n*/\n-export const mapN = (f: (x) => any) =>\n+export const mapnth = (f: (x) => any) =>\n(ctx: StackContext) => {\nconst stack = ctx[0];\nlet n = stack.length - 1;\n@@ -606,28 +606,28 @@ export const sqrt = op1(Math.sqrt);\n*\n* @param ctx\n*/\n-export const bitAnd = op2((b, a) => a & b);\n+export const bitand = op2((b, a) => a & b);\n/**\n* ( x y -- x|y )\n*\n* @param ctx\n*/\n-export const bitOr = op2((b, a) => a | b);\n+export const bitor = op2((b, a) => a | b);\n/**\n* ( x y -- x^y )\n*\n* @param ctx\n*/\n-export const bitXor = op2((b, a) => a ^ b);\n+export const bitxor = op2((b, a) => a ^ b);\n/**\n* ( x -- ~x )\n*\n* @param ctx\n*/\n-export const bitNot = op1((x) => ~x);\n+export const bitnot = op1((x) => ~x);\n/**\n* ( x y -- x<<y )\n@@ -727,28 +727,28 @@ export const gteq = op2((b, a) => a >= b);\n*\n* @param ctx\n*/\n-export const isZero = op1((x) => x === 0);\n+export const iszero = op1((x) => x === 0);\n/**\n* ( x -- x>0 )\n*\n* @param ctx\n*/\n-export const isPos = op1((x) => x > 0);\n+export const ispos = op1((x) => x > 0);\n/**\n* ( x -- x<0 )\n*\n* @param ctx\n*/\n-export const isNeg = op1((x) => x < 0);\n+export const isneg = op1((x) => x < 0);\n/**\n* ( x -- x==null )\n*\n* @param ctx\n*/\n-export const isNull = op1((x) => x == null);\n+export const isnull = op1((x) => x == null);\n//////////////////// Dynamic words & quotations ////////////////////\n@@ -760,7 +760,7 @@ export const isNull = op1((x) => x == null);\n* environment (one per invocation) instead of the current one passed by\n* `run()` at runtime. If `mergeEnv` is true, the user provided env will\n* be merged with the current env (also shallow copies). This is useful in\n- * conjunction with `pushEnv()` and `store()` or `storeKey()` to save\n+ * conjunction with `pushenv()` and `store()` or `storekey()` to save\n* results of sub procedures in the main env.\n*\n* ( ? -- ? )\n@@ -805,7 +805,7 @@ export const exec = (ctx: StackContext) =>\n*\n* @param ctx\n*/\n-export const execQ = (ctx: StackContext) =>\n+export const execq = (ctx: StackContext) =>\n($(ctx[0], 1), run(ctx[0].pop(), ctx));\n//////////////////// Conditionals ////////////////////\n@@ -839,7 +839,7 @@ export const cond = (_then: StackProc, _else: StackProc = nop) =>\n*\n* @param cases\n*/\n-export const condM = (cases: IObjectOf<StackProc>) =>\n+export const cases = (cases: IObjectOf<StackProc>) =>\n(ctx: StackContext) => {\n$(ctx[0], 1);\nconst stack = ctx[0];\n@@ -864,7 +864,7 @@ export const condM = (cases: IObjectOf<StackProc>) =>\n* ( -- ? )\n*\n* ```\n- * run([loop([dup, isPos], [dup, print, dec])], [[3]])\n+ * run([loop([dup, ispos], [dup, print, dec])], [[3]])\n* // 3\n* // 2\n* // 1\n@@ -904,16 +904,16 @@ export const loop = (test: StackProc, body: StackProc) => {\n* ```\n* // using array literal within word definition\n* foo = pf.word([ [], 1, pf.pushr ])\n- * pf.runU(null, foo)\n+ * pf.runu(null, foo)\n* // [ 1 ]\n- * pf.runU(null, foo)\n+ * pf.runu(null, foo)\n* // [ 1, 1 ] // wrong!\n*\n* // using `list` instead\n* bar = pf.word([ pf.list, 1, pf.pushr ])\n- * pf.runU(null, bar)\n+ * pf.runu(null, bar)\n* // [ 1 ]\n- * pf.runU(null, bar)\n+ * pf.runu(null, bar)\n* // [ 1 ] // correct!\n* ```\n*\n@@ -1103,7 +1103,7 @@ export const at = op2((b, a) => a[b]);\n*\n* @param ctx\n*/\n-export const storeAt = (ctx: StackContext) => {\n+export const storeat = (ctx: StackContext) => {\nconst stack = ctx[0];\nconst n = stack.length - 3;\n$n(n, 0);\n@@ -1122,7 +1122,7 @@ export const storeAt = (ctx: StackContext) => {\n* @param ctx\n* @param env\n*/\n-export const pushEnv = (ctx: StackContext) =>\n+export const pushenv = (ctx: StackContext) =>\n(ctx[0].push(ctx[2]), ctx);\n/**\n@@ -1156,7 +1156,7 @@ export const store = (ctx: StackContext) =>\n* @param ctx\n* @param env\n*/\n-export const loadKey = (key: PropertyKey) =>\n+export const loadkey = (key: PropertyKey) =>\n(ctx: StackContext) => (ctx[0].push(ctx[2][key]), ctx);\n/**\n@@ -1169,7 +1169,7 @@ export const loadKey = (key: PropertyKey) =>\n* @param ctx\n* @param env\n*/\n-export const storeKey = (key: PropertyKey) =>\n+export const storekey = (key: PropertyKey) =>\n(ctx: StackContext) =>\n($(ctx[0], 1), ctx[2][key] = ctx[0].pop(), ctx);\n", "new_path": "packages/pointfree/src/index.ts", "old_path": "packages/pointfree/src/index.ts" }, { "change_type": "MODIFY", "diff": "@@ -49,9 +49,9 @@ describe(\"pointfree\", () => {\n});\nit(\"dupIf\", () => {\n- assert.throws(() => pf.dupIf($([])));\n- assert.deepEqual(pf.dupIf($([0]))[0], [0]);\n- assert.deepEqual(pf.dupIf($([1]))[0], [1, 1]);\n+ assert.throws(() => pf.dupif($([])));\n+ assert.deepEqual(pf.dupif($([0]))[0], [0]);\n+ assert.deepEqual(pf.dupif($([1]))[0], [1, 1]);\n});\nit(\"drop\", () => {\n@@ -67,9 +67,9 @@ describe(\"pointfree\", () => {\n});\nit(\"dropIf\", () => {\n- assert.throws(() => pf.dropIf($([])));\n- assert.deepEqual(pf.dropIf($([0]))[0], [0]);\n- assert.deepEqual(pf.dropIf($([1]))[0], []);\n+ assert.throws(() => pf.dropif($([])));\n+ assert.deepEqual(pf.dropif($([0]))[0], [0]);\n+ assert.deepEqual(pf.dropif($([1]))[0], []);\n});\nit(\"swap\", () => {\n@@ -130,11 +130,11 @@ describe(\"pointfree\", () => {\nit(\"mapN\", () => {\nlet f = x => x + 10;\n- assert.throws(() => pf.mapN(f)($([])));\n- assert.throws(() => pf.mapN(f)($([0])));\n- assert.throws(() => pf.mapN(f)($([0, 1])));\n- assert.deepEqual(pf.mapN(f)($([0, 1, 0]))[0], [0, 11]);\n- assert.deepEqual(pf.mapN(f)($([0, 1, 1]))[0], [10, 1]);\n+ assert.throws(() => pf.mapnth(f)($([])));\n+ assert.throws(() => pf.mapnth(f)($([0])));\n+ assert.throws(() => pf.mapnth(f)($([0, 1])));\n+ assert.deepEqual(pf.mapnth(f)($([0, 1, 0]))[0], [0, 11]);\n+ assert.deepEqual(pf.mapnth(f)($([0, 1, 1]))[0], [10, 1]);\n});\nit(\"add\", () => {\n@@ -193,23 +193,23 @@ describe(\"pointfree\", () => {\n});\nit(\"bitAnd\", () => {\n- assert.throws(() => pf.bitAnd($([0])));\n- assert.deepEqual(pf.bitAnd($([0x1a, 0xfc]))[0], [0x18]);\n+ assert.throws(() => pf.bitand($([0])));\n+ assert.deepEqual(pf.bitand($([0x1a, 0xfc]))[0], [0x18]);\n});\nit(\"bitOr\", () => {\n- assert.throws(() => pf.bitOr($([0])));\n- assert.deepEqual(pf.bitOr($([0xf0, 0x1]))[0], [0xf1]);\n+ assert.throws(() => pf.bitor($([0])));\n+ assert.deepEqual(pf.bitor($([0xf0, 0x1]))[0], [0xf1]);\n});\nit(\"bitXor\", () => {\n- assert.throws(() => pf.bitXor($([0])));\n- assert.deepEqual(pf.bitXor($([0xff, 0xaa]))[0], [0x55]);\n+ assert.throws(() => pf.bitxor($([0])));\n+ assert.deepEqual(pf.bitxor($([0xff, 0xaa]))[0], [0x55]);\n});\nit(\"bitNot\", () => {\n- assert.throws(() => pf.bitNot($()));\n- assert.deepEqual(pf.bitNot($([0x7f]))[0], [-0x80]);\n+ assert.throws(() => pf.bitnot($()));\n+ assert.deepEqual(pf.bitnot($([0x7f]))[0], [-0x80]);\n});\nit(\"lsl\", () => {\n@@ -302,37 +302,37 @@ describe(\"pointfree\", () => {\n});\nit(\"isZero\", () => {\n- assert.throws(() => pf.isZero($()));\n- assert.deepEqual(pf.isZero($([0]))[0], [true]);\n- assert.deepEqual(pf.isZero($([0.0]))[0], [true]);\n- assert.deepEqual(pf.isZero($([1]))[0], [false]);\n- assert.deepEqual(pf.isZero($([null]))[0], [false]);\n+ assert.throws(() => pf.iszero($()));\n+ assert.deepEqual(pf.iszero($([0]))[0], [true]);\n+ assert.deepEqual(pf.iszero($([0.0]))[0], [true]);\n+ assert.deepEqual(pf.iszero($([1]))[0], [false]);\n+ assert.deepEqual(pf.iszero($([null]))[0], [false]);\n});\nit(\"isPos\", () => {\n- assert.throws(() => pf.isPos($()));\n- assert.deepEqual(pf.isPos($([0]))[0], [false]);\n- assert.deepEqual(pf.isPos($([0.0]))[0], [false]);\n- assert.deepEqual(pf.isPos($([1]))[0], [true]);\n- assert.deepEqual(pf.isPos($([-1]))[0], [false]);\n- assert.deepEqual(pf.isPos($([null]))[0], [false]);\n+ assert.throws(() => pf.ispos($()));\n+ assert.deepEqual(pf.ispos($([0]))[0], [false]);\n+ assert.deepEqual(pf.ispos($([0.0]))[0], [false]);\n+ assert.deepEqual(pf.ispos($([1]))[0], [true]);\n+ assert.deepEqual(pf.ispos($([-1]))[0], [false]);\n+ assert.deepEqual(pf.ispos($([null]))[0], [false]);\n});\nit(\"isNeg\", () => {\n- assert.throws(() => pf.isNeg($()));\n- assert.deepEqual(pf.isNeg($([0]))[0], [false]);\n- assert.deepEqual(pf.isNeg($([0.0]))[0], [false]);\n- assert.deepEqual(pf.isNeg($([1]))[0], [false]);\n- assert.deepEqual(pf.isNeg($([-1]))[0], [true]);\n- assert.deepEqual(pf.isNeg($([null]))[0], [false]);\n+ assert.throws(() => pf.isneg($()));\n+ assert.deepEqual(pf.isneg($([0]))[0], [false]);\n+ assert.deepEqual(pf.isneg($([0.0]))[0], [false]);\n+ assert.deepEqual(pf.isneg($([1]))[0], [false]);\n+ assert.deepEqual(pf.isneg($([-1]))[0], [true]);\n+ assert.deepEqual(pf.isneg($([null]))[0], [false]);\n});\nit(\"isNull\", () => {\n- assert.throws(() => pf.isNull($()));\n- assert.deepEqual(pf.isNull($([0]))[0], [false]);\n- assert.deepEqual(pf.isNull($([1]))[0], [false]);\n- assert.deepEqual(pf.isNull($([null]))[0], [true]);\n- assert.deepEqual(pf.isNull($([undefined]))[0], [true]);\n+ assert.throws(() => pf.isnull($()));\n+ assert.deepEqual(pf.isnull($([0]))[0], [false]);\n+ assert.deepEqual(pf.isnull($([1]))[0], [false]);\n+ assert.deepEqual(pf.isnull($([null]))[0], [true]);\n+ assert.deepEqual(pf.isnull($([undefined]))[0], [true]);\n});\nit(\"list\", () => {\n@@ -467,15 +467,15 @@ describe(\"pointfree\", () => {\n});\nit(\"storeAt\", () => {\n- assert.throws(() => pf.storeAt($([1, 2])));\n+ assert.throws(() => pf.storeat($([1, 2])));\nlet a: any = [10, 20];\n- assert.deepEqual(pf.storeAt($([30, a, 0]))[0], []);\n+ assert.deepEqual(pf.storeat($([30, a, 0]))[0], []);\nassert.deepEqual(a, [30, 20]);\na = [10, 20];\n- assert.deepEqual(pf.storeAt($([30, a, 3]))[0], []);\n+ assert.deepEqual(pf.storeat($([30, a, 3]))[0], []);\nassert.deepEqual(a, [10, 20, , 30]);\na = {};\n- assert.deepEqual(pf.storeAt($([30, a, \"a\"]))[0], []);\n+ assert.deepEqual(pf.storeat($([30, a, \"a\"]))[0], []);\nassert.deepEqual(a, { a: 30 });\n});\n@@ -492,18 +492,18 @@ describe(\"pointfree\", () => {\n});\nit(\"loadKey\", () => {\n- assert.deepEqual(pf.loadKey(\"a\")([[0], [], { a: 1 }])[0], [0, 1]);\n- assert.deepEqual(pf.loadKey(\"b\")([[0], [], { a: 1 }])[0], [0, undefined]);\n+ assert.deepEqual(pf.loadkey(\"a\")([[0], [], { a: 1 }])[0], [0, 1]);\n+ assert.deepEqual(pf.loadkey(\"b\")([[0], [], { a: 1 }])[0], [0, undefined]);\n});\nit(\"storeKey\", () => {\n- assert.throws(() => pf.storeKey(\"a\")($()));\n- assert.deepEqual(pf.storeKey(\"a\")([[10], [], {}]), [[], [], { a: 10 }]);\n- assert.deepEqual(pf.storeKey(\"b\")([[10], [], { a: 1 }]), [[], [], { a: 1, b: 10 }]);\n+ assert.throws(() => pf.storekey(\"a\")($()));\n+ assert.deepEqual(pf.storekey(\"a\")([[10], [], {}]), [[], [], { a: 10 }]);\n+ assert.deepEqual(pf.storekey(\"b\")([[10], [], { a: 1 }]), [[], [], { a: 1, b: 10 }]);\n});\nit(\"pushEnv\", () => {\n- assert.deepEqual(pf.pushEnv([[0], [], { a: 10 }]), [[0, { a: 10 }], [], { a: 10 }]);\n+ assert.deepEqual(pf.pushenv([[0], [], { a: 10 }]), [[0, { a: 10 }], [], { a: 10 }]);\n});\nit(\"unwrap\", () => {\n@@ -523,10 +523,10 @@ describe(\"pointfree\", () => {\n});\nit(\"execQ\", () => {\n- assert.throws(() => pf.execQ($()));\n- assert.throws(() => pf.execQ($([[pf.add]])));\n- assert.throws(() => pf.execQ($([[1, pf.add]])));\n- assert.deepEqual(pf.execQ($([[1, 2, pf.add]]))[0], [3]);\n+ assert.throws(() => pf.execq($()));\n+ assert.throws(() => pf.execq($([[pf.add]])));\n+ assert.throws(() => pf.execq($([[1, pf.add]])));\n+ assert.deepEqual(pf.execq($([[1, 2, pf.add]]))[0], [3]);\n});\nit(\"cond\", () => {\n@@ -542,11 +542,11 @@ describe(\"pointfree\", () => {\nit(\"condM\", () => {\nlet classify = (x) =>\n- pf.condM({\n+ pf.cases({\n0: [\"zero\"],\n1: [\"one\"],\ndefault: [\n- pf.isPos,\n+ pf.ispos,\npf.cond([\"many\"], [\"invalid\"])\n]\n})($([x]))[0];\n@@ -555,13 +555,13 @@ describe(\"pointfree\", () => {\nassert.equal(classify(1), \"one\");\nassert.equal(classify(100), \"many\");\nassert.equal(classify(-1), \"invalid\");\n- assert.throws(() => pf.condM({})($([0])));\n+ assert.throws(() => pf.cases({})($([0])));\n});\nit(\"word\", () => {\nassert.deepEqual(pf.word([pf.dup, pf.mul])($([2]))[0], [4]);\n- assert.deepEqual(pf.word([pf.pushEnv], { a: 1 })($([0]))[0], [0, { a: 1 }]);\n- assert.deepEqual(pf.word([pf.pushEnv], { a: 1 }, true)([[0], [], { b: 2 }])[0], [0, { a: 1, b: 2 }]);\n+ assert.deepEqual(pf.word([pf.pushenv], { a: 1 })($([0]))[0], [0, { a: 1 }]);\n+ assert.deepEqual(pf.word([pf.pushenv], { a: 1 }, true)([[0], [], { b: 2 }])[0], [0, { a: 1, b: 2 }]);\nassert.deepEqual(pf.word([pf.add, pf.mul])($([1, 2, 3]))[0], [5]);\nassert.deepEqual(pf.word([pf.add, pf.mul, pf.add])($([1, 2, 3, 4]))[0], [15]);\nassert.deepEqual(pf.word([pf.add, pf.mul, pf.add, pf.mul])($([1, 2, 3, 4, 5]))[0], [29]);\n@@ -576,7 +576,7 @@ describe(\"pointfree\", () => {\nit(\"wordU\", () => {\nassert.deepEqual(pf.wordU([pf.dup, pf.mul])($([2])), 4);\n- assert.deepEqual(pf.wordU([pf.pushEnv], 1, { a: 1 })($()), { a: 1 });\n- assert.deepEqual(pf.wordU([pf.pushEnv], 1, { a: 1 }, true)([[], [], { b: 2 }]), { a: 1, b: 2 });\n+ assert.deepEqual(pf.wordU([pf.pushenv], 1, { a: 1 })($()), { a: 1 });\n+ assert.deepEqual(pf.wordU([pf.pushenv], 1, { a: 1 }, true)([[], [], { b: 2 }]), { a: 1, b: 2 });\n});\n});\n", "new_path": "packages/pointfree/test/index.ts", "old_path": "packages/pointfree/test/index.ts" }, { "change_type": "MODIFY", "diff": "@@ -54,15 +54,15 @@ const makeids = (i: number, j: number, sep: string, id1: StackFn = pf.nop, id2 =\n// helper word which looks up TOS in given string/array/object, i.e. to\n// transform a number into another value (e.g. string)\n-const idgen = (ids) => pf.map((x) => ids[x]);\n+const idgen = (ids) => pf.maptos((x) => ids[x]);\n-console.log(pf.runU(grid(4, 4)));\n-console.log(pf.runU(makeids(4, 4, \"\", idgen(\"abcd\"))));\n-console.log(pf.runU(makeids(4, 4, \"-\", idgen([\"alpha\", \"beta\", \"gamma\", \"delta\"]), pf.nop)));\n+console.log(pf.runu(grid(4, 4)));\n+console.log(pf.runu(makeids(4, 4, \"\", idgen(\"abcd\"))));\n+console.log(pf.runu(makeids(4, 4, \"-\", idgen([\"alpha\", \"beta\", \"gamma\", \"delta\"]), pf.nop)));\nconsole.log(\n- pf.runU([\n+ pf.runu([\nmakeids(4, 4, \"\", idgen(\"abcd\")),\n- pf.map(id => pf.runU(makeids(4, 4, \"/\", idgen(id)))),\n- pf.map(id => pf.runU(makeids(4, 4, \"-\", idgen(id))))\n+ pf.maptos(id => pf.runu(makeids(4, 4, \"/\", idgen(id)))),\n+ pf.maptos(id => pf.runu(makeids(4, 4, \"-\", idgen(id))))\n]));\n\\ No newline at end of file\n", "new_path": "packages/pointfree/test/loop.ts", "old_path": "packages/pointfree/test/loop.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(pointfree): rename core words & change case - runU => runu - map => maptos - mapN => mapnth - dropIf/dupIf => dropif/dupif - condM => cases - bitAnd/Or/Not => bitand/or/not - isPos/Neg/Null/Zero => ispos/neg/null/zero - execQ => execq - storeAt => storeat - pushEnv => pushenv - loadKey/storeKey => loadkey/storekey
1
refactor
pointfree
217,922
27.03.2018 21:05:32
-7,200
441844558c79f66196e7ea3c45b003ba7bfe7cb7
chore: tooltips for compact sidebar
[ { "change_type": "MODIFY", "diff": "<mat-icon>keyboard_arrow_right</mat-icon>\n</button>\n</mat-list-item>\n- <mat-list-item routerLink=\"/home\" (click)=\"mobile ? sidenav.close() : null\">\n+ <mat-list-item routerLink=\"/home\" (click)=\"mobile ? sidenav.close() : null\"\n+ matTooltipPosition=\"right\"\n+ matTooltip=\"{{'Home' | translate}}\"\n+ [matTooltipDisabled]=\"!settings.compactSidebar\">\n<mat-icon matListIcon>home</mat-icon>\n<span matLine *ngIf=\"!settings.compactSidebar\">{{'Home' | translate}}</span>\n</mat-list-item>\n<mat-list-item routerLink=\"/profile\" (click)=\"mobile ? sidenav.close() : null\"\n- *ngIf=\"!(authState | async)?.isAnonymous\">\n+ *ngIf=\"!(authState | async)?.isAnonymous\"\n+ matTooltipPosition=\"right\"\n+ matTooltip=\"{{'Profile' | translate}}\"\n+ [matTooltipDisabled]=\"!settings.compactSidebar\">\n<mat-icon matListIcon>person</mat-icon>\n<span matLine *ngIf=\"!settings.compactSidebar\">{{'Profile' | translate}}</span>\n</mat-list-item>\n<mat-list-item routerLink=\"/custom-links\" (click)=\"mobile ? sidenav.close() : null\"\n- *ngIf=\"customLinksEnabled\">\n+ *ngIf=\"customLinksEnabled\"\n+ matTooltipPosition=\"right\"\n+ matTooltip=\"{{'CUSTOM_LINKS.Title' | translate}}\"\n+ [matTooltipDisabled]=\"!settings.compactSidebar\">\n<mat-icon matListIcon>link</mat-icon>\n<span matLine *ngIf=\"!settings.compactSidebar\">{{'CUSTOM_LINKS.Title' | translate}}</span>\n</mat-list-item>\n- <mat-list-item routerLink=\"/recipes\" (click)=\"mobile ? sidenav.close() : null\">\n+ <mat-list-item routerLink=\"/recipes\" (click)=\"mobile ? sidenav.close() : null\"\n+ matTooltipPosition=\"right\"\n+ matTooltip=\"{{'CUSTOM_LINKS.Title' | translate}}\"\n+ [matTooltipDisabled]=\"!settings.compactSidebar\">\n<mat-icon matListIcon>search</mat-icon>\n<span matLine *ngIf=\"!settings.compactSidebar\">{{'Recipes' | translate}}</span>\n</mat-list-item>\n- <mat-list-item routerLink=\"/lists\" (click)=\"mobile ? sidenav.close() : null\">\n+ <mat-list-item routerLink=\"/lists\" (click)=\"mobile ? sidenav.close() : null\"\n+ matTooltipPosition=\"right\"\n+ matTooltip=\"{{'Lists' | translate}}\"\n+ [matTooltipDisabled]=\"!settings.compactSidebar\">\n<mat-icon matListIcon>view_list</mat-icon>\n<span matLine *ngIf=\"!settings.compactSidebar\">{{'Lists' | translate}}</span>\n</mat-list-item>\n- <mat-list-item routerLink=\"/public-lists\" (click)=\"mobile ? sidenav.close() : null\">\n+ <mat-list-item routerLink=\"/public-lists\" (click)=\"mobile ? sidenav.close() : null\"\n+ matTooltipPosition=\"right\"\n+ matTooltip=\"{{'Public_lists' | translate}}\"\n+ [matTooltipDisabled]=\"!settings.compactSidebar\">\n<mat-icon matListIcon>public</mat-icon>\n<span matLine *ngIf=\"!settings.compactSidebar\">{{'Public_lists' | translate}}</span>\n</mat-list-item>\n- <mat-list-item routerLink=\"/alarms\" (click)=\"mobile ? sidenav.close() : null\">\n+ <mat-list-item routerLink=\"/alarms\" (click)=\"mobile ? sidenav.close() : null\"\n+ matTooltipPosition=\"right\"\n+ matTooltip=\"{{'HOME_PAGE.FEATURES.alarms_title' | translate}}\"\n+ [matTooltipDisabled]=\"!settings.compactSidebar\">\n<mat-icon matListIcon>alarm</mat-icon>\n<span matLine\n*ngIf=\"!settings.compactSidebar\">{{'HOME_PAGE.FEATURES.alarms_title' | translate}}</span>\n</mat-list-item>\n- <mat-list-item routerLink=\"/gathering-location\" (click)=\"mobile ? sidenav.close() : null\">\n+ <mat-list-item routerLink=\"/gathering-location\" (click)=\"mobile ? sidenav.close() : null\"\n+ matTooltipPosition=\"right\"\n+ matTooltip=\"{{'GATHERING_LOCATIONS.Title' | translate}}\"\n+ [matTooltipDisabled]=\"!settings.compactSidebar\">\n<mat-icon matListIcon>location_on</mat-icon>\n<span matLine *ngIf=\"!settings.compactSidebar\">{{'GATHERING_LOCATIONS.Title' | translate}}</span>\n</mat-list-item>\n- <mat-list-item routerLink=\"/macro-translation\" (click)=\"mobile ? sidenav.close() : null\">\n+ <mat-list-item routerLink=\"/macro-translation\" (click)=\"mobile ? sidenav.close() : null\"\n+ matTooltipPosition=\"right\"\n+ matTooltip=\"{{'MACRO_TRANSLATION.Title' | translate}}\"\n+ [matTooltipDisabled]=\"!settings.compactSidebar\">\n<mat-icon matListIcon>translate</mat-icon>\n<span matLine *ngIf=\"!settings.compactSidebar\">{{'MACRO_TRANSLATION.Title' | translate}}</span>\n</mat-list-item>\n- <mat-list-item routerLink=\"/favorites\" (click)=\"mobile ? sidenav.close() : null\">\n+ <mat-list-item routerLink=\"/favorites\" (click)=\"mobile ? sidenav.close() : null\"\n+ matTooltipPosition=\"right\"\n+ matTooltip=\"{{'Favorites' | translate}}\"\n+ [matTooltipDisabled]=\"!settings.compactSidebar\">\n<mat-icon matListIcon>favorite</mat-icon>\n<span matLine *ngIf=\"!settings.compactSidebar\">{{'Favorites' | translate}}</span>\n</mat-list-item>\n- <mat-list-item routerLink=\"/settings\" (click)=\"mobile ? sidenav.close() : null\">\n+ <mat-list-item routerLink=\"/settings\" (click)=\"mobile ? sidenav.close() : null\"\n+ matTooltipPosition=\"right\"\n+ matTooltip=\"{{'SETTINGS.title' | translate}}\"\n+ [matTooltipDisabled]=\"!settings.compactSidebar\">\n<mat-icon matListIcon>settings</mat-icon>\n<span matLine *ngIf=\"!settings.compactSidebar\">{{'SETTINGS.title' | translate}}</span>\n</mat-list-item>\n- <mat-list-item routerLink=\"/features\" (click)=\"mobile ? sidenav.close() : null\">\n+ <mat-list-item routerLink=\"/features\" (click)=\"mobile ? sidenav.close() : null\"\n+ matTooltipPosition=\"right\"\n+ matTooltip=\"{{'HOME_PAGE.features' | translate}}\"\n+ [matTooltipDisabled]=\"!settings.compactSidebar\">\n<mat-icon matListIcon>help_outline</mat-icon>\n<span matLine *ngIf=\"!settings.compactSidebar\">{{'HOME_PAGE.features' | translate}}</span>\n</mat-list-item>\n- <mat-list-item routerLink=\"/about\" (click)=\"mobile ? sidenav.close() : null\">\n+ <mat-list-item routerLink=\"/about\" (click)=\"mobile ? sidenav.close() : null\"\n+ matTooltipPosition=\"right\"\n+ matTooltip=\"{{'ABOUT.title' | translate}}\"\n+ [matTooltipDisabled]=\"!settings.compactSidebar\">\n<mat-icon matListIcon>info_outline</mat-icon>\n<span matLine *ngIf=\"!settings.compactSidebar\">{{'ABOUT.title' | translate}}</span>\n</mat-list-item>\n", "new_path": "src/app/app.component.html", "old_path": "src/app/app.component.html" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: tooltips for compact sidebar
1
chore
null
217,922
27.03.2018 22:02:48
-7,200
ea6efb438646448ecb0c2a21ea5099806c2b9f3b
chore: wrong tooltip for recipes
[ { "change_type": "MODIFY", "diff": "</mat-list-item>\n<mat-list-item routerLink=\"/recipes\" (click)=\"mobile ? sidenav.close() : null\"\nmatTooltipPosition=\"right\"\n- matTooltip=\"{{'CUSTOM_LINKS.Title' | translate}}\"\n+ matTooltip=\"{{'Recipes' | translate}}\"\n[matTooltipDisabled]=\"!settings.compactSidebar\">\n<mat-icon matListIcon>search</mat-icon>\n<span matLine *ngIf=\"!settings.compactSidebar\">{{'Recipes' | translate}}</span>\n", "new_path": "src/app/app.component.html", "old_path": "src/app/app.component.html" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: wrong tooltip for recipes
1
chore
null
217,922
27.03.2018 22:15:35
-7,200
e91ba363122b08000c58cb9c719843beed4e742e
fix: "working on it" avatar no longer wrong after some manipulations
[ { "change_type": "MODIFY", "diff": "@@ -306,7 +306,7 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\nthis.updateHasBook();\nif (this.item.workingOnIt !== undefined) {\nthis.userService.get(this.item.workingOnIt)\n- .mergeMap(user => this.dataService.getCharacter(user.lodestoneId)).subscribe(char => {\n+ .mergeMap(user => this.dataService.getCharacter(user.lodestoneId)).first().subscribe(char => {\nthis.worksOnIt = char;\nthis.cd.detectChanges();\n});\n@@ -319,9 +319,9 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\nthis.updateMasterBooks();\nthis.updateTimers();\nthis.updateHasBook();\n- if (this.item.workingOnIt !== undefined && this.worksOnIt === undefined) {\n+ if (this.item.workingOnIt !== undefined && (this.worksOnIt === undefined || this.worksOnIt.id !== this.item.workingOnIt)) {\nthis.userService.get(this.item.workingOnIt)\n- .mergeMap(user => this.dataService.getCharacter(user.lodestoneId)).subscribe(char => this.worksOnIt = char);\n+ .mergeMap(user => this.dataService.getCharacter(user.lodestoneId)).first().subscribe(char => this.worksOnIt = char);\n}\n}\n@@ -329,7 +329,7 @@ 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)).subscribe(char => {\n+ .mergeMap(user => this.dataService.getCharacter(user.lodestoneId)).first().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" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix: "working on it" avatar no longer wrong after some manipulations
1
fix
null
311,007
28.03.2018 03:16:13
-32,400
cc3c2d95bd331e1953192234b66f8557d1b83e0c
feat(info): add version to info
[ { "change_type": "MODIFY", "diff": "@@ -23,12 +23,14 @@ export class Project extends BaseProject {\nconst [\nionicAngularVersion,\nionicCoreVersion,\n+ ionicSchematicsAngularVersion,\nangularCLIVersion,\nangularDevKitCoreVersion,\nangularDevKitSchematicsVersion,\n] = await Promise.all([\nthis.getFrameworkVersion(),\nthis.getCoreVersion(),\n+ this.getIonicSchematicsAngularVersion(),\nthis.getAngularCLIVersion(),\nthis.getAngularDevKitCoreVersion(),\nthis.getAngularDevKitCoreVersion(),\n@@ -38,6 +40,7 @@ export class Project extends BaseProject {\n...(await super.getInfo()),\n{ type: 'local-packages', key: 'Ionic Framework', value: ionicAngularVersion ? `@ionic/angular ${ionicAngularVersion}` : 'not installed' },\n{ type: 'local-packages', key: '@ionic/core', value: ionicCoreVersion ? ionicCoreVersion : 'not installed' },\n+ { type: 'local-packages', key: '@ionic/schematics-angular', value: ionicSchematicsAngularVersion ? ionicSchematicsAngularVersion : 'not installed' },\n{ type: 'local-packages', key: '@angular/cli', value: angularCLIVersion ? angularCLIVersion : 'not installed' },\n{ type: 'local-packages', key: '@angular-devkit/core', value: angularDevKitCoreVersion ? angularDevKitCoreVersion : 'not installed' },\n{ type: 'local-packages', key: '@angular-devkit/schematics', value: angularDevKitSchematicsVersion ? angularDevKitSchematicsVersion : 'not installed' },\n@@ -145,4 +148,16 @@ export class Project extends BaseProject {\nthis.log.error(`Error loading ${chalk.bold(pkgName)} package: ${e}`);\n}\n}\n+\n+ async getIonicSchematicsAngularVersion() {\n+ const pkgName = '@ionic/schematics-angular';\n+\n+ try {\n+ const pkgPath = resolve(`${pkgName}/package`, { paths: compileNodeModulesPaths(this.directory) });\n+ const pkg = await readPackageJsonFile(pkgPath);\n+ return pkg.version;\n+ } catch (e) {\n+ this.log.error(`Error loading ${chalk.bold(pkgName)} package: ${e}`);\n+ }\n+ }\n}\n", "new_path": "packages/@ionic/cli-utils/src/lib/project/angular/index.ts", "old_path": "packages/@ionic/cli-utils/src/lib/project/angular/index.ts" } ]
TypeScript
MIT License
ionic-team/ionic-cli
feat(info): add @ionic/schematics-angular version to info (#3042)
1
feat
info
821,196
28.03.2018 10:23:29
25,200
beb4b4ee29528602305a4e9f61de062c3d80fb85
fix: remove commitlint from this project
[ { "change_type": "MODIFY", "diff": "@@ -15,8 +15,7 @@ jobs:\n- v4-{{checksum \".circleci/config.yml\"}}\n- v4\n- run: .circleci/greenkeeper\n- - run: yarn add -D mocha-junit-reporter@1 @commitlint/cli@6 @commitlint/config-conventional@6\n- - run: yarn exec commitlint -- -x @commitlint/config-conventional --from origin/master\n+ - run: yarn add -D mocha-junit-reporter@1\n- run: yarn exec nps lint\n- persist_to_workspace: {root: node_modules, paths: [\"*\"]}\nnode-latest-multi:\n", "new_path": ".circleci/config.yml", "old_path": ".circleci/config.yml" }, { "change_type": "DELETE", "diff": "-module.exports = {extends: ['@commitlint/config-conventional']}\n", "new_path": null, "old_path": "templates/.commitlintrc.js" } ]
TypeScript
MIT License
oclif/oclif
fix: remove commitlint from this project (#87)
1
fix
null
217,922
28.03.2018 10:48:21
-7,200
6630587eb51d5e526a248a03d1fc306ba9c609e8
chore: remove sentry as it's spamming for minor issues
[ { "change_type": "MODIFY", "diff": "\"jwt-decode\": \"^2.2.0\",\n\"ng-push\": \"^0.2.1\",\n\"ngx-clipboard\": \"10.0.0\",\n- \"raven-js\": \"^3.24.0\",\n\"rxjs\": \"^5.4.3\",\n\"semver\": \"^5.4.1\",\n\"web-animations-js\": \"^2.3.1\",\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "import {BrowserModule} from '@angular/platform-browser';\n-import {ErrorHandler, NgModule} from '@angular/core';\n+import {NgModule} from '@angular/core';\nimport {FormsModule, ReactiveFormsModule} from '@angular/forms';\nimport {AppComponent} from './app.component';\nimport {BrowserAnimationsModule} from '@angular/platform-browser/animations';\n@@ -55,23 +55,8 @@ import {GatheringLocationModule} from './pages/gathering-location/gathering-loca\nimport {WorkshopModule} from './pages/workshop/workshop.module';\nimport {CustomLinksModule} from './pages/custom-links/custom-links.module';\nimport {LinkModule} from './pages/link/link.module';\n-import * as Raven from 'raven-js';\nimport {TemplateModule} from './pages/template/template.module';\n-\n-Raven\n- .config(environment.production ? 'https://759388ec3a3a4868b36832ea92a5afac@sentry.io/481146' : '')\n- .install();\n-\n-export class RavenErrorHandler implements ErrorHandler {\n- handleError(err: any): void {\n- if (err.message !== 'Not found' && err.message.indexOf('permission') === -1 && err.message.indexOf('is null') === -1) {\n- Raven.captureException(err);\n- }\n- console.error(err);\n- }\n-}\n-\nexport function HttpLoaderFactory(http: HttpClient) {\nreturn new TranslateHttpLoader(http);\n}\n@@ -153,7 +138,6 @@ export function HttpLoaderFactory(http: HttpClient) {\nWorkshopModule,\nTemplateModule,\n],\n- providers: [{provide: ErrorHandler, useClass: RavenErrorHandler}],\nbootstrap: [AppComponent]\n})\nexport class AppModule {\n", "new_path": "src/app/app.module.ts", "old_path": "src/app/app.module.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: remove sentry as it's spamming for minor issues
1
chore
null
217,922
28.03.2018 10:54:27
-7,200
6ae437ba811a734b844f921847c6bfde553dd60a
chore: remove sentry from user.service
[ { "change_type": "MODIFY", "diff": "@@ -9,7 +9,6 @@ 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 * as Raven from 'raven-js';\n@Injectable()\nexport class UserService extends FirebaseStorage<AppUser> {\n@@ -73,16 +72,10 @@ export class UserService extends FirebaseStorage<AppUser> {\n}\nif (user === null || user.isAnonymous) {\nreturn this.get(user.uid).catch(() => {\n- Raven.setUserContext({\n- id: user.uid\n- });\nreturn Observable.of(<AppUser>{$key: user.uid, name: 'Anonymous', anonymous: true});\n});\n} else {\nreturn this.get(user.uid).map(u => {\n- Raven.setUserContext({\n- id: user.uid\n- });\nu.providerId = user.providerId;\nreturn u;\n});\n", "new_path": "src/app/core/database/user.service.ts", "old_path": "src/app/core/database/user.service.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: remove sentry from user.service
1
chore
null
807,849
28.03.2018 12:38:11
25,200
fd84013f7e671d36cec66674e17c705464911998
feat(child-process): Allow exec() opts.stdio override
[ { "change_type": "MODIFY", "diff": "@@ -12,8 +12,7 @@ const colorWheel = [\"cyan\", \"magenta\", \"blue\", \"yellow\", \"green\", \"red\"];\nconst NUM_COLORS = colorWheel.length;\nfunction exec(command, args, opts) {\n- const options = Object.assign({}, opts);\n- options.stdio = \"pipe\"; // node default\n+ const options = Object.assign({ stdio: \"pipe\" }, opts);\nreturn _spawn(command, args, options);\n}\n", "new_path": "core/child-process/index.js", "old_path": "core/child-process/index.js" } ]
JavaScript
MIT License
lerna/lerna
feat(child-process): Allow exec() opts.stdio override
1
feat
child-process
807,849
28.03.2018 12:45:01
25,200
4ba5e74a1835ead7e15e1f38974b84ee236e92f3
feat(npm-install): Allow opts.stdio override
[ { "change_type": "MODIFY", "diff": "@@ -39,10 +39,30 @@ describe(\"npm-install\", () => {\nexpect(ChildProcessUtilities.exec).lastCalledWith(\n\"yarn\",\n[\"install\", \"--mutex\", \"file:foo\", \"--non-interactive\", \"--no-optional\"],\n- { cwd: location }\n+ { cwd: location, stdio: \"pipe\" }\n);\n});\n+ it(\"allows override of opts.stdio\", async () => {\n+ expect.assertions(1);\n+\n+ const location = path.normalize(\"/test/npm/install\");\n+ const pkg = {\n+ name: \"test-npm-install\",\n+ location,\n+ };\n+ const config = {\n+ stdio: \"inherit\",\n+ };\n+\n+ await npmInstall(pkg, config);\n+\n+ expect(ChildProcessUtilities.exec).lastCalledWith(\"npm\", [\"install\"], {\n+ cwd: location,\n+ stdio: \"inherit\",\n+ });\n+ });\n+\nit(\"does not swallow errors\", async () => {\nexpect.assertions(2);\n@@ -64,6 +84,7 @@ describe(\"npm-install\", () => {\nexpect(ChildProcessUtilities.exec).lastCalledWith(\"yarn\", [\"install\", \"--non-interactive\"], {\ncwd: location,\n+ stdio: \"pipe\",\n});\n}\n});\n@@ -119,6 +140,7 @@ describe(\"npm-install\", () => {\n});\nexpect(ChildProcessUtilities.exec).lastCalledWith(\"npm\", [\"install\"], {\ncwd: location,\n+ stdio: \"pipe\",\n});\n});\n@@ -165,6 +187,7 @@ describe(\"npm-install\", () => {\nnpm_config_registry: registry,\n}),\nextendEnv: false,\n+ stdio: \"pipe\",\n});\n});\n@@ -206,6 +229,7 @@ describe(\"npm-install\", () => {\n});\nexpect(ChildProcessUtilities.exec).lastCalledWith(\"npm\", [\"install\", \"--global-style\"], {\ncwd: location,\n+ stdio: \"pipe\",\n});\n});\n@@ -243,7 +267,7 @@ describe(\"npm-install\", () => {\nexpect(ChildProcessUtilities.exec).lastCalledWith(\n\"yarn\",\n[\"install\", \"--mutex\", \"network:12345\", \"--non-interactive\"],\n- { cwd: location }\n+ { cwd: location, stdio: \"pipe\" }\n);\n});\n@@ -285,6 +309,7 @@ describe(\"npm-install\", () => {\n});\nexpect(ChildProcessUtilities.exec).lastCalledWith(\"npm\", [\"install\", \"--production\", \"--no-optional\"], {\ncwd: location,\n+ stdio: \"pipe\",\n});\n});\n@@ -328,6 +353,7 @@ describe(\"npm-install\", () => {\n});\nexpect(ChildProcessUtilities.exec).lastCalledWith(\"npm\", [\"install\", \"--global-style\"], {\ncwd: location,\n+ stdio: \"pipe\",\n});\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,7 +12,7 @@ const getExecOpts = require(\"@lerna/get-npm-exec-opts\");\nmodule.exports = npmInstall;\nmodule.exports.dependencies = npmInstallDependencies;\n-function npmInstall(pkg, { registry, npmClient, npmClientArgs, npmGlobalStyle, mutex }) {\n+function npmInstall(pkg, { registry, npmClient, npmClientArgs, npmGlobalStyle, mutex, stdio = \"pipe\" }) {\n// build command, arguments, and options\nconst opts = getExecOpts(pkg, registry);\nconst args = [\"install\"];\n@@ -35,6 +35,9 @@ function npmInstall(pkg, { registry, npmClient, npmClientArgs, npmGlobalStyle, m\nargs.push(...npmClientArgs);\n}\n+ // potential override, e.g. \"inherit\" in root-only bootstrap\n+ opts.stdio = stdio;\n+\nlog.silly(\"npmInstall\", [cmd, args]);\nreturn ChildProcessUtilities.exec(cmd, args, opts);\n}\n", "new_path": "utils/npm-install/npm-install.js", "old_path": "utils/npm-install/npm-install.js" } ]
JavaScript
MIT License
lerna/lerna
feat(npm-install): Allow opts.stdio override
1
feat
npm-install
807,849
28.03.2018 12:48:59
25,200
fd8c39141fb779688df4ea18c9d666e27dcfbefd
feat(bootstrap): Inherit stdio during root-only install
[ { "change_type": "MODIFY", "diff": "@@ -86,12 +86,12 @@ class BootstrapCommand extends Command {\n}\nexecute() {\n- this.logger.info(\"\", `Bootstrapping ${this.filteredPackages.length} packages`);\n-\nif (this.options.useWorkspaces) {\nreturn this.installRootPackageOnly();\n}\n+ this.logger.info(\"\", `Bootstrapping ${this.filteredPackages.length} packages`);\n+\nconst tasks = [\n() => this.getDependenciesToInstall(),\nresult => this.installExternalDependencies(result),\n@@ -115,12 +115,13 @@ class BootstrapCommand extends Command {\n}\ninstallRootPackageOnly() {\n- const tracker = this.logger.newItem(\"install dependencies\");\n+ this.logger.disableProgress();\n+ this.logger.info(\"bootstrap\", \"root only\");\n- return npmInstall(this.project.package, this.npmConfig).then(() => {\n- tracker.info(\"hoist\", \"Finished installing in root\");\n- tracker.finish();\n- });\n+ // don't hide yarn or npm output\n+ this.npmConfig.stdio = \"inherit\";\n+\n+ return npmInstall(this.project.package, this.npmConfig);\n}\nrunLifecycleInPackages(stage) {\n", "new_path": "commands/bootstrap/index.js", "old_path": "commands/bootstrap/index.js" } ]
JavaScript
MIT License
lerna/lerna
feat(bootstrap): Inherit stdio during root-only install
1
feat
bootstrap
807,849
28.03.2018 13:04:30
25,200
d8a8f0386b92175b6052ac6cfe35c238e3653834
feat(bootstrap): Short-circuit when local file: specifiers are detected in the root
[ { "change_type": "ADD", "diff": "+node_modules\n", "new_path": "commands/bootstrap/__tests__/__fixtures__/relative-file-specs/.gitignore", "old_path": null }, { "change_type": "ADD", "diff": "+registry = https://registry.npmjs.org/\n\\ No newline at end of file\n", "new_path": "commands/bootstrap/__tests__/__fixtures__/relative-file-specs/.npmrc", "old_path": null }, { "change_type": "ADD", "diff": "+{\n+ \"version\": \"1.0.0\"\n+}\n", "new_path": "commands/bootstrap/__tests__/__fixtures__/relative-file-specs/lerna.json", "old_path": null }, { "change_type": "ADD", "diff": "+{\n+ \"name\": \"relative-file-specs\",\n+ \"version\": \"0.0.0-lerna\",\n+ \"lockfileVersion\": 1,\n+ \"requires\": true,\n+ \"dependencies\": {\n+ \"package-1\": {\n+ \"version\": \"file:packages/package-1\",\n+ \"requires\": {\n+ \"tiny-tarball\": \"1.0.0\"\n+ }\n+ },\n+ \"package-2\": {\n+ \"version\": \"file:packages/package-2\",\n+ \"requires\": {\n+ \"package-1\": \"file:packages/package-1\"\n+ }\n+ },\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__/relative-file-specs/package-lock.json", "old_path": null }, { "change_type": "ADD", "diff": "+{\n+ \"name\": \"relative-file-specs\",\n+ \"description\": \"file: specifiers in dependencies should trigger root-only bootstrap\",\n+ \"private\": true,\n+ \"version\": \"0.0.0-lerna\",\n+ \"dependencies\": {\n+ \"package-2\": \"file:packages/package-2\"\n+ }\n+}\n", "new_path": "commands/bootstrap/__tests__/__fixtures__/relative-file-specs/package.json", "old_path": null }, { "change_type": "ADD", "diff": "+{\n+ \"name\": \"package-1\",\n+ \"version\": \"1.0.0\",\n+ \"changed\": false,\n+ \"dependencies\": {\n+ \"tiny-tarball\": \"^1.0.0\"\n+ }\n+}\n", "new_path": "commands/bootstrap/__tests__/__fixtures__/relative-file-specs/packages/package-1/package.json", "old_path": null }, { "change_type": "ADD", "diff": "+{\n+ \"name\": \"package-2\",\n+ \"version\": \"1.0.0\",\n+ \"dependencies\": {\n+ \"package-1\": \"file:../package-1\"\n+ }\n+}\n", "new_path": "commands/bootstrap/__tests__/__fixtures__/relative-file-specs/packages/package-2/package.json", "old_path": null }, { "change_type": "MODIFY", "diff": "@@ -438,6 +438,23 @@ describe(\"BootstrapCommand\", () => {\n});\n});\n+ describe(\"with relative file: specifiers in root dependencies\", () => {\n+ it(\"only installs in the root\", async () => {\n+ const testDir = await initFixture(\"relative-file-specs\");\n+\n+ await lernaBootstrap(testDir)();\n+\n+ expect(npmInstall.dependencies).not.toBeCalled();\n+ expect(npmInstall).lastCalledWith(\n+ expect.objectContaining({ name: \"relative-file-specs\" }),\n+ expect.objectContaining({\n+ npmClient: \"npm\",\n+ stdio: \"inherit\",\n+ })\n+ );\n+ });\n+ });\n+\ndescribe(\"with duplicate package names\", () => {\nit(\"throws an error\", async () => {\nexpect.assertions(1);\n", "new_path": "commands/bootstrap/__tests__/bootstrap-command.test.js", "old_path": "commands/bootstrap/__tests__/bootstrap-command.test.js" }, { "change_type": "MODIFY", "diff": "const dedent = require(\"dedent\");\nconst getPort = require(\"get-port\");\n+const npa = require(\"npm-package-arg\");\nconst path = require(\"path\");\nconst pFinally = require(\"p-finally\");\nconst pMap = require(\"p-map\");\n@@ -86,7 +87,7 @@ class BootstrapCommand extends Command {\n}\nexecute() {\n- if (this.options.useWorkspaces) {\n+ if (this.options.useWorkspaces || this.rootHasLocalFileDependencies()) {\nreturn this.installRootPackageOnly();\n}\n@@ -124,6 +125,22 @@ class BootstrapCommand extends Command {\nreturn npmInstall(this.project.package, this.npmConfig);\n}\n+ /**\n+ * If the root manifest has local dependencies with `file:` specifiers,\n+ * all the complicated bootstrap logic should be skipped in favor of\n+ * npm5's package-locked auto-hoisting.\n+ * @returns {Boolean}\n+ */\n+ rootHasLocalFileDependencies() {\n+ const rootDependencies = Object.assign({}, this.project.package.dependencies);\n+\n+ return Object.keys(rootDependencies).some(\n+ name =>\n+ this.packageGraph.has(name) &&\n+ npa.resolve(name, rootDependencies[name], this.project.rootPath).type === \"directory\"\n+ );\n+ }\n+\nrunLifecycleInPackages(stage) {\nthis.logger.verbose(\"lifecycle\", stage);\n", "new_path": "commands/bootstrap/index.js", "old_path": "commands/bootstrap/index.js" }, { "change_type": "MODIFY", "diff": "\"dedent\": \"^0.7.0\",\n\"get-port\": \"^3.2.0\",\n\"multimatch\": \"^2.1.0\",\n+ \"npm-package-arg\": \"^6.0.0\",\n\"npmlog\": \"^4.1.2\",\n\"p-finally\": \"^1.0.0\",\n\"p-map\": \"^1.2.0\",\n", "new_path": "commands/bootstrap/package.json", "old_path": "commands/bootstrap/package.json" }, { "change_type": "MODIFY", "diff": "\"dedent\": \"0.7.0\",\n\"get-port\": \"3.2.0\",\n\"multimatch\": \"2.1.0\",\n+ \"npm-package-arg\": \"6.0.0\",\n\"npmlog\": \"4.1.2\",\n\"p-finally\": \"1.0.0\",\n\"p-map\": \"1.2.0\",\n", "new_path": "package-lock.json", "old_path": "package-lock.json" } ]
JavaScript
MIT License
lerna/lerna
feat(bootstrap): Short-circuit when local file: specifiers are detected in the root
1
feat
bootstrap
807,849
28.03.2018 13:40:47
25,200
6abae766f8146286b2574aac0cd72f1b20bdf9b1
fix(publish): Write temporary annotations once, not repeatedly
[ { "change_type": "MODIFY", "diff": "@@ -201,7 +201,7 @@ class PublishCommand extends Command {\npkg.updateLocalDependency(resolved, depVersion, this.savePrefix);\n}\n- return writePkg(pkg.manifestLocation, pkg.toJSON());\n+ // writing changes to disk handled in annotateGitHead()\n});\n}\n", "new_path": "commands/publish/index.js", "old_path": "commands/publish/index.js" } ]
JavaScript
MIT License
lerna/lerna
fix(publish): Write temporary annotations once, not repeatedly
1
fix
publish
724,178
28.03.2018 14:45:55
-7,200
92c00ee99e7a982ec3cfaa02d3ebff2fa77bea1c
docs: fix evenOrOdd test description
[ { "change_type": "MODIFY", "diff": "@@ -265,7 +265,7 @@ describe('Modules.vue', () => {\nThere are two approaches to testing a Vuex store. The first approach is to unit test the getters, mutations, and actions separately. The second approach is to create a store and test against that. We'll look at both approaches.\n-To see how to test a Vuex store, we're going to create a simple counter store. The store will have an `increment` mutation and a `counter` getter.\n+To see how to test a Vuex store, we're going to create a simple counter store. The store will have an `increment` mutation and an `evenOrOdd` getter.\n```js\n// mutations.js\n@@ -321,7 +321,7 @@ test('evenOrOdd returns even if state.count is even', () => {\nexpect(getters.evenOrOdd(state)).toBe('even')\n})\n-test('evenOrOdd returns odd if state.count is even', () => {\n+test('evenOrOdd returns odd if state.count is odd', () => {\nconst state = {\ncount: 1\n}\n", "new_path": "docs/en/guides/using-with-vuex.md", "old_path": "docs/en/guides/using-with-vuex.md" } ]
JavaScript
MIT License
vuejs/vue-test-utils
docs: fix evenOrOdd test description (#492)
1
docs
null
807,849
28.03.2018 15:19:32
25,200
b73e19dfb072dc62ccdbc7e6b67704b1bdf08586
feat: Support `optionalDependencies` Fixes
[ { "change_type": "MODIFY", "diff": "@@ -287,7 +287,12 @@ class BootstrapCommand extends Command {\n);\n// collect root dependency versions\n- const mergedRootDeps = Object.assign({}, rootPkg.devDependencies, rootPkg.dependencies);\n+ const mergedRootDeps = Object.assign(\n+ {},\n+ rootPkg.optionalDependencies,\n+ rootPkg.devDependencies,\n+ rootPkg.dependencies\n+ );\nconst rootExternalVersions = new Map(\nObject.keys(mergedRootDeps).map(externalName => [externalName, mergedRootDeps[externalName]])\n);\n", "new_path": "commands/bootstrap/index.js", "old_path": "commands/bootstrap/index.js" }, { "change_type": "MODIFY", "diff": "\"dependencies\": {\n\"package-1\": \"^1.0.0\"\n},\n+ \"optionalDependencies\": {\n+ \"package-3\": \"^1.0.0\"\n+ },\n\"private\": true,\n\"version\": \"1.0.0\"\n}\n", "new_path": "commands/publish/__tests__/__fixtures__/normal/packages/package-5/package.json", "old_path": "commands/publish/__tests__/__fixtures__/normal/packages/package-5/package.json" }, { "change_type": "MODIFY", "diff": "@@ -139,6 +139,9 @@ describe(\"PublishCommand\", () => {\nexpect(updatedPackageJSON(\"package-5\").dependencies).toMatchObject({\n\"package-1\": \"^1.0.1\",\n});\n+ expect(updatedPackageJSON(\"package-5\").optionalDependencies).toMatchObject({\n+ \"package-3\": \"^1.0.1\",\n+ });\nexpect(gitAddedFiles(testDir)).toMatchSnapshot(\"git added files\");\nexpect(gitCommitMessage()).toEqual(\"v1.0.1\");\n", "new_path": "commands/publish/__tests__/publish-command.test.js", "old_path": "commands/publish/__tests__/publish-command.test.js" }, { "change_type": "MODIFY", "diff": "@@ -66,7 +66,12 @@ class PackageGraph extends Map {\nconst graphDependencies =\ngraphType === \"dependencies\"\n? Object.assign({}, currentNode.pkg.dependencies)\n- : Object.assign({}, currentNode.pkg.devDependencies, currentNode.pkg.dependencies);\n+ : Object.assign(\n+ {},\n+ currentNode.pkg.optionalDependencies,\n+ currentNode.pkg.devDependencies,\n+ currentNode.pkg.dependencies\n+ );\nObject.keys(graphDependencies).forEach(depName => {\nconst depNode = this.get(depName);\n", "new_path": "core/package-graph/index.js", "old_path": "core/package-graph/index.js" }, { "change_type": "MODIFY", "diff": "@@ -96,6 +96,15 @@ describe(\"Package\", () => {\n});\n});\n+ describe(\"get .optionalDependencies\", () => {\n+ it(\"should return the optionalDependencies\", () => {\n+ const pkg = factory({\n+ optionalDependencies: { \"my-optional-dependency\": \"^1.0.0\" },\n+ });\n+ expect(pkg.optionalDependencies).toEqual({ \"my-optional-dependency\": \"^1.0.0\" });\n+ });\n+ });\n+\ndescribe(\"get .peerDependencies\", () => {\nit(\"should return the peerDependencies\", () => {\nconst pkg = factory({\n", "new_path": "core/package/__tests__/core-package.test.js", "old_path": "core/package/__tests__/core-package.test.js" }, { "change_type": "MODIFY", "diff": "@@ -65,6 +65,11 @@ class Package {\nreturn pkg.devDependencies;\n},\n},\n+ optionalDependencies: {\n+ get() {\n+ return pkg.optionalDependencies;\n+ },\n+ },\npeerDependencies: {\nget() {\nreturn pkg.peerDependencies;\n@@ -106,7 +111,12 @@ class Package {\n// first, try runtime dependencies\nlet depCollection = this.json.dependencies;\n- // fall back to devDependencies (it will always be one of these two)\n+ // try optionalDependencies if that didn't work\n+ if (!depCollection || !depCollection[depName]) {\n+ depCollection = this.json.optionalDependencies;\n+ }\n+\n+ // fall back to devDependencies\nif (!depCollection || !depCollection[depName]) {\ndepCollection = this.json.devDependencies;\n}\n", "new_path": "core/package/index.js", "old_path": "core/package/index.js" }, { "change_type": "MODIFY", "diff": "},\n\"dependencies\": {\n\"pify\": \"^2.0.0\"\n+ },\n+ \"optionalDependencies\": {\n+ \"tiny-tarball\": \"^1.0.0\"\n}\n}\n", "new_path": "integration/__fixtures__/lerna-bootstrap/package-1/package.json", "old_path": "integration/__fixtures__/lerna-bootstrap/package-1/package.json" }, { "change_type": "MODIFY", "diff": "@@ -411,6 +411,9 @@ Array [\npackage-1: ^1.0.1,\n},\nname: package-5,\n+ optionalDependencies: Object {\n+ package-3: ^1.0.1,\n+ },\nprivate: true,\nversion: 1.0.1,\n},\n", "new_path": "integration/__snapshots__/lerna-publish.test.js.snap", "old_path": "integration/__snapshots__/lerna-publish.test.js.snap" }, { "change_type": "MODIFY", "diff": "@@ -25,7 +25,13 @@ describe(\"lerna bootstrap\", () => {\nexpect(lock1).toMatchObject({\nname: \"@integration/package-1\",\nversion: \"1.0.0\",\n- dependencies: { pify: expect.any(Object) },\n+ dependencies: {\n+ pify: expect.any(Object),\n+ \"tiny-tarball\": {\n+ version: \"1.0.0\",\n+ optional: true,\n+ },\n+ },\n});\nexpect(lock2).toMatchObject({\nname: \"@integration/package-2\",\n@@ -65,8 +71,15 @@ describe(\"lerna bootstrap\", () => {\nexpect(rootLock).toMatchObject({\nname: \"integration\",\nversion: \"0.0.0\",\n- dependencies: { pify: expect.any(Object) },\n+ dependencies: {\n+ pify: expect.any(Object),\n+ \"tiny-tarball\": {\n+ version: \"1.0.0\",\n+ // root hoist does not preserve optional\n+ },\n+ },\n});\n+ expect(rootLock).not.toHaveProperty(\"dependencies.tiny-tarball.optional\");\n});\ntest(\"--npm-client yarn\", async () => {\n", "new_path": "integration/lerna-bootstrap.test.js", "old_path": "integration/lerna-bootstrap.test.js" } ]
JavaScript
MIT License
lerna/lerna
feat: Support `optionalDependencies` Fixes #121
1
feat
null
807,849
28.03.2018 15:46:21
25,200
0574e85ca124d12566b297d5314d436413f955de
refactor(publish): Minor tweaks
[ { "change_type": "MODIFY", "diff": "@@ -579,23 +579,24 @@ class PublishCommand extends Command {\n}\nrunPrepublishScripts(pkg) {\n- return Promise.resolve(this.runPackageLifecycle(pkg, \"prepare\")).then(() =>\n- this.runPackageLifecycle(pkg, \"prepublishOnly\")\n- );\n+ return Promise.resolve()\n+ .then(() => this.runPackageLifecycle(pkg, \"prepare\"))\n+ .then(() => this.runPackageLifecycle(pkg, \"prepublishOnly\"));\n}\nnpmPublish() {\nconst tracker = this.logger.newItem(\"npmPublish\");\n// if we skip temp tags we should tag with the proper value immediately\nconst distTag = this.options.tempTag ? \"lerna-temp\" : this.getDistTag();\n-\nconst rootPkg = this.project.package;\n- let chain = this.runPrepublishScripts(rootPkg);\n+ let chain = Promise.resolve();\n+ chain = chain.then(() => this.runPrepublishScripts(rootPkg));\nchain = chain.then(() =>\npMap(this.updates, ({ pkg }) => {\nthis.execScript(pkg, \"prepublish\");\n+\nreturn this.runPrepublishScripts(pkg);\n})\n);\n@@ -610,7 +611,8 @@ class PublishCommand extends Command {\ntracker.completeWork(1);\nthis.execScript(pkg, \"postpublish\");\n- this.runPackageLifecycle(pkg, \"postpublish\");\n+\n+ return this.runPackageLifecycle(pkg, \"postpublish\");\n});\n};\n", "new_path": "commands/publish/index.js", "old_path": "commands/publish/index.js" } ]
JavaScript
MIT License
lerna/lerna
refactor(publish): Minor tweaks
1
refactor
publish
807,849
28.03.2018 16:06:33
25,200
7c5a79157fd1719cb3c9c38e3a8cd7d0fc2f19b2
feat(npm-run-script): Accept opts.reject
[ { "change_type": "MODIFY", "diff": "@@ -27,6 +27,26 @@ describe(\"npm-run-script\", () => {\nexpect(ChildProcessUtilities.exec).lastCalledWith(\"npm\", [\"run\", script, \"--bar\", \"baz\"], {\ncwd: config.pkg.location,\n+ reject: true,\n+ });\n+ });\n+\n+ it(\"accepts opts.reject\", async () => {\n+ const script = \"foo\";\n+ const config = {\n+ args: [],\n+ pkg: {\n+ location: \"/test/npm/run/script\",\n+ },\n+ npmClient: \"npm\",\n+ reject: false,\n+ };\n+\n+ await npmRunScript(script, config);\n+\n+ expect(ChildProcessUtilities.exec).lastCalledWith(\"npm\", [\"run\", script], {\n+ cwd: config.pkg.location,\n+ reject: false,\n});\n});\n@@ -44,6 +64,7 @@ describe(\"npm-run-script\", () => {\nexpect(ChildProcessUtilities.exec).lastCalledWith(\"yarn\", [\"run\", script, \"--bar\", \"baz\"], {\ncwd: config.pkg.location,\n+ reject: true,\n});\n});\n});\n@@ -67,6 +88,32 @@ describe(\"npm-run-script\", () => {\n[\"run\", script, \"--bar\", \"baz\"],\n{\ncwd: config.pkg.location,\n+ reject: true,\n+ },\n+ config.pkg.name\n+ );\n+ });\n+\n+ it(\"accepts opts.reject\", async () => {\n+ const script = \"foo\";\n+ const config = {\n+ args: [],\n+ pkg: {\n+ name: \"qux\",\n+ location: \"/test/npm/run/script/stream\",\n+ },\n+ npmClient: \"npm\",\n+ reject: false,\n+ };\n+\n+ await npmRunScript.stream(script, config);\n+\n+ expect(ChildProcessUtilities.spawnStreaming).lastCalledWith(\n+ \"npm\",\n+ [\"run\", script],\n+ {\n+ cwd: config.pkg.location,\n+ reject: false,\n},\nconfig.pkg.name\n);\n", "new_path": "utils/npm-run-script/__tests__/npm-run-script.test.js", "old_path": "utils/npm-run-script/__tests__/npm-run-script.test.js" }, { "change_type": "MODIFY", "diff": "@@ -8,14 +8,26 @@ const getOpts = require(\"@lerna/get-npm-exec-opts\");\nmodule.exports = runScript;\nmodule.exports.stream = stream;\n-function runScript(script, { args, npmClient, pkg }) {\n+function runScript(script, { args, npmClient, pkg, reject = true }) {\nlog.silly(\"npmRunScript\", script, args, pkg.name);\n- return ChildProcessUtilities.exec(npmClient, [\"run\", script, ...args], getOpts(pkg));\n+ const argv = [\"run\", script, ...args];\n+ const opts = makeOpts(pkg, reject);\n+\n+ return ChildProcessUtilities.exec(npmClient, argv, opts);\n}\n-function stream(script, { args, npmClient, pkg }) {\n+function stream(script, { args, npmClient, pkg, reject = true }) {\nlog.silly(\"npmRunScript.stream\", [script, args, pkg.name]);\n- return ChildProcessUtilities.spawnStreaming(npmClient, [\"run\", script, ...args], getOpts(pkg), pkg.name);\n+ const argv = [\"run\", script, ...args];\n+ const opts = makeOpts(pkg, reject);\n+\n+ return ChildProcessUtilities.spawnStreaming(npmClient, argv, opts, pkg.name);\n+}\n+\n+function makeOpts(pkg, reject) {\n+ return Object.assign(getOpts(pkg), {\n+ reject,\n+ });\n}\n", "new_path": "utils/npm-run-script/npm-run-script.js", "old_path": "utils/npm-run-script/npm-run-script.js" } ]
JavaScript
MIT License
lerna/lerna
feat(npm-run-script): Accept opts.reject
1
feat
npm-run-script
807,849
28.03.2018 17:55:32
25,200
6e4c6fdc8a04ba9d7bc28daa5a755f6f54772834
fix(exec): Clarify --no-bail option
[ { "change_type": "MODIFY", "diff": "@@ -24,7 +24,8 @@ exports.builder = yargs => {\n.options({\nbail: {\ngroup: \"Command Options:\",\n- describe: \"Bail on exec execution when the command fails within a package\",\n+ describe: \"Stop when the command fails in a package.\\nPass --no-bail to continue despite failure.\",\n+ defaultDescription: \"true\",\ntype: \"boolean\",\ndefault: undefined,\n},\n", "new_path": "commands/exec/command.js", "old_path": "commands/exec/command.js" } ]
JavaScript
MIT License
lerna/lerna
fix(exec): Clarify --no-bail option
1
fix
exec
217,922
28.03.2018 18:10:34
-7,200
85fba3831f4b83b72234489aa37275225115513a
fix: tags now copy over lists closes
[ { "change_type": "MODIFY", "diff": "@@ -58,6 +58,7 @@ export class List extends DataModel {\n}\nclone.name = this.name;\nclone.version = this.version || '1.0.0';\n+ clone.tags = this.tags;\ndelete clone.$key;\nga('send', 'event', 'List', 'creation');\nga('send', 'event', 'List', 'clone');\n", "new_path": "src/app/model/list/list.ts", "old_path": "src/app/model/list/list.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix: tags now copy over lists closes #304
1
fix
null
807,849
28.03.2018 18:33:30
25,200
893fcc8b423ec11759a453f11751852344a77bcd
feat(run): Add --no-bail option Fixes
[ { "change_type": "MODIFY", "diff": "\"name\": \"package-1\",\n\"version\": \"1.0.0\",\n\"scripts\": {\n+ \"fail\": \"exit 1\",\n\"my-script\": \"echo package-1\"\n}\n}\n", "new_path": "commands/run/__tests__/__fixtures__/basic/packages/package-1/package.json", "old_path": "commands/run/__tests__/__fixtures__/basic/packages/package-1/package.json" }, { "change_type": "MODIFY", "diff": "\"name\": \"package-2\",\n\"version\": \"1.0.0\",\n\"dependencies\": {\n+ \"fail\": \"exit 1\",\n\"package-1\": \"^1.0.0\"\n}\n}\n", "new_path": "commands/run/__tests__/__fixtures__/basic/packages/package-2/package.json", "old_path": "commands/run/__tests__/__fixtures__/basic/packages/package-2/package.json" }, { "change_type": "MODIFY", "diff": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n-exports[`RunCommand in a basic repo always runs env script 1`] = `\n-Array [\n- \"packages/package-1 npm run env\",\n- \"packages/package-4 npm run env\",\n- \"packages/package-2 npm run env\",\n- \"packages/package-3 npm run env\",\n-]\n-`;\n-\n-exports[`RunCommand in a basic repo does not run a script in ignored packages 1`] = `\n-Array [\n- \"packages/package-1 npm run my-script\",\n-]\n-`;\n-\nexports[`RunCommand in a basic repo runs a script in all packages with --parallel 1`] = `\nArray [\n\"packages/package-1 npm run env\",\n@@ -24,57 +9,9 @@ Array [\n]\n`;\n-exports[`RunCommand in a basic repo runs a script in packages 1`] = `\n-Array [\n- \"packages/package-1 npm run my-script\",\n- \"packages/package-3 npm run my-script\",\n-]\n-`;\n-\nexports[`RunCommand in a basic repo runs a script in packages with --stream 1`] = `\nArray [\n\"packages/package-1 npm run my-script\",\n\"packages/package-3 npm run my-script\",\n]\n`;\n-\n-exports[`RunCommand in a basic repo runs a script only in scoped packages 1`] = `\n-Array [\n- \"packages/package-1 npm run my-script\",\n-]\n-`;\n-\n-exports[`RunCommand in a basic repo should filter packages that are not updated with --since 1`] = `\n-Array [\n- \"packages/package-3 npm run my-script\",\n-]\n-`;\n-\n-exports[`RunCommand in a basic repo supports alternate npmClient configuration 1`] = `\n-Array [\n- \"packages/package-1 yarn run env\",\n- \"packages/package-4 yarn run env\",\n- \"packages/package-2 yarn run env\",\n- \"packages/package-3 yarn run env\",\n-]\n-`;\n-\n-exports[`RunCommand in a cyclical repo warns when cycles are encountered 1`] = `\n-Array [\n- \"packages/package-dag-1 npm run env\",\n- \"packages/package-standalone npm run env\",\n- \"packages/package-dag-2a npm run env\",\n- \"packages/package-dag-2b npm run env\",\n- \"packages/package-dag-3 npm run env\",\n- \"packages/package-cycle-1 npm run env\",\n- \"packages/package-cycle-2 npm run env\",\n- \"packages/package-cycle-extraneous npm run env\",\n-]\n-`;\n-\n-exports[`RunCommand with --include-filtered-dependencies runs scoped command including filtered deps 1`] = `\n-Array [\n- \"packages/package-1 npm run my-script\",\n- \"packages/package-2 npm run my-script\",\n-]\n-`;\n", "new_path": "commands/run/__tests__/__snapshots__/run-command.test.js.snap", "old_path": "commands/run/__tests__/__snapshots__/run-command.test.js.snap" }, { "change_type": "MODIFY", "diff": "@@ -21,14 +21,6 @@ const normalizeRelativeDir = require(\"@lerna-test/normalize-relative-dir\");\nconst lernaRun = require(\"@lerna-test/command-runner\")(require(\"../command\"));\n// assertion helpers\n-const ranInPackages = testDir =>\n- npmRunScript.mock.calls.reduce((arr, [script, { args, npmClient, pkg }]) => {\n- const dir = normalizeRelativeDir(testDir, pkg.location);\n- const record = [dir, npmClient, \"run\", script].concat(args);\n- arr.push(record.join(\" \"));\n- return arr;\n- }, []);\n-\nconst ranInPackagesStreaming = testDir =>\nnpmRunScript.stream.mock.calls.reduce((arr, [script, { args, npmClient, pkg }]) => {\nconst dir = normalizeRelativeDir(testDir, pkg.location);\n@@ -38,8 +30,8 @@ const ranInPackagesStreaming = testDir =>\n}, []);\ndescribe(\"RunCommand\", () => {\n- npmRunScript.mockResolvedValue({ stdout: \"stdout\" });\n- npmRunScript.stream.mockResolvedValue();\n+ npmRunScript.mockImplementation((script, { pkg }) => Promise.resolve({ stdout: pkg.name }));\n+ npmRunScript.stream.mockImplementation(() => Promise.resolve());\ndescribe(\"in a basic repo\", () => {\nit(\"runs a script in packages\", async () => {\n@@ -47,8 +39,9 @@ describe(\"RunCommand\", () => {\nawait lernaRun(testDir)(\"my-script\");\n- expect(ranInPackages(testDir)).toMatchSnapshot();\n- expect(consoleOutput()).toMatch(\"stdout\\nstdout\");\n+ const output = consoleOutput().split(\"\\n\");\n+ expect(output).toContain(\"package-1\");\n+ expect(output).toContain(\"package-3\");\n});\nit(\"runs a script in packages with --stream\", async () => {\n@@ -64,7 +57,7 @@ describe(\"RunCommand\", () => {\nawait lernaRun(testDir)(\"env\");\n- expect(ranInPackages(testDir)).toMatchSnapshot();\n+ expect(consoleOutput().split(\"\\n\")).toEqual([\"package-1\", \"package-4\", \"package-2\", \"package-3\"]);\n});\nit(\"runs a script only in scoped packages\", async () => {\n@@ -72,7 +65,7 @@ describe(\"RunCommand\", () => {\nawait lernaRun(testDir)(\"my-script\", \"--scope\", \"package-1\");\n- expect(ranInPackages(testDir)).toMatchSnapshot();\n+ expect(consoleOutput()).toBe(\"package-1\");\n});\nit(\"does not run a script in ignored packages\", async () => {\n@@ -80,7 +73,7 @@ describe(\"RunCommand\", () => {\nawait lernaRun(testDir)(\"my-script\", \"--ignore\", \"package-@(2|3|4)\");\n- expect(ranInPackages(testDir)).toMatchSnapshot();\n+ expect(consoleOutput()).toBe(\"package-1\");\n});\nit(\"should filter packages that are not updated with --since\", async () => {\n@@ -103,7 +96,7 @@ describe(\"RunCommand\", () => {\nawait lernaRun(testDir)(\"my-script\", \"--since\", \"master\");\n- expect(ranInPackages(testDir)).toMatchSnapshot();\n+ expect(consoleOutput()).toBe(\"package-3\");\n});\nit(\"requires a git repo when using --since\", async () => {\n@@ -125,7 +118,6 @@ describe(\"RunCommand\", () => {\nawait lernaRun(testDir)(\"missing-script\");\n- expect(npmRunScript).not.toBeCalled();\nexpect(consoleOutput()).toBe(\"\");\n});\n@@ -142,16 +134,39 @@ describe(\"RunCommand\", () => {\nawait lernaRun(testDir)(\"env\", \"--npm-client\", \"yarn\");\n- expect(ranInPackages(testDir)).toMatchSnapshot();\n+ expect(consoleOutput().split(\"\\n\")).toEqual([\"package-1\", \"package-4\", \"package-2\", \"package-3\"]);\n+ });\n+\n+ it(\"reports script errors with early exit\", async () => {\n+ expect.assertions(2);\n+ npmRunScript.mockImplementationOnce((script, { pkg }) => Promise.reject(new Error(pkg.name)));\n+\n+ const testDir = await initFixture(\"basic\");\n+\n+ try {\n+ await lernaRun(testDir)(\"fail\");\n+ } catch (err) {\n+ expect(err.message).toMatch(\"package-1\");\n+ expect(err.message).not.toMatch(\"package-2\");\n+ }\n});\n});\ndescribe(\"with --include-filtered-dependencies\", () => {\nit(\"runs scoped command including filtered deps\", async () => {\nconst testDir = await initFixture(\"include-filtered-dependencies\");\n- await lernaRun(testDir)(\"my-script\", \"--scope\", \"@test/package-2\", \"--include-filtered-dependencies\");\n+ await lernaRun(testDir)(\n+ \"my-script\",\n+ \"--scope\",\n+ \"@test/package-2\",\n+ \"--include-filtered-dependencies\",\n+ \"--\",\n+ \"--silent\"\n+ );\n- expect(ranInPackages(testDir)).toMatchSnapshot();\n+ const output = consoleOutput().split(\"\\n\");\n+ expect(output).toContain(\"@test/package-1\");\n+ expect(output).toContain(\"@test/package-2\");\n});\n});\n@@ -169,7 +184,16 @@ describe(\"RunCommand\", () => {\n\"package-cycle-extraneous -> package-cycle-1 -> package-cycle-2 -> package-cycle-1\"\n);\n- expect(ranInPackages(testDir)).toMatchSnapshot();\n+ expect(consoleOutput().split(\"\\n\")).toEqual([\n+ \"package-dag-1\",\n+ \"package-standalone\",\n+ \"package-dag-2a\",\n+ \"package-dag-2b\",\n+ \"package-dag-3\",\n+ \"package-cycle-1\",\n+ \"package-cycle-2\",\n+ \"package-cycle-extraneous\",\n+ ]);\n});\nit(\"should throw an error with --reject-cycles\", async () => {\n", "new_path": "commands/run/__tests__/run-command.test.js", "old_path": "commands/run/__tests__/run-command.test.js" }, { "change_type": "MODIFY", "diff": "@@ -17,6 +17,13 @@ exports.builder = yargs => {\ntype: \"string\",\n})\n.options({\n+ bail: {\n+ group: \"Command Options:\",\n+ describe: \"Stop when the script fails in a package.\\nPass --no-bail to continue despite failure.\",\n+ defaultDescription: \"true\",\n+ type: \"boolean\",\n+ default: undefined,\n+ },\nstream: {\ngroup: \"Command Options:\",\ndescribe: \"Stream output with lines prefixed by package.\",\n", "new_path": "commands/run/command.js", "old_path": "commands/run/command.js" }, { "change_type": "MODIFY", "diff": "@@ -21,6 +21,7 @@ class RunCommand extends Command {\nget defaultOptions() {\nreturn Object.assign({}, super.defaultOptions, {\n+ bail: true,\nparallel: false,\nstream: false,\n});\n@@ -77,6 +78,15 @@ class RunCommand extends Command {\n});\n}\n+ getOpts(pkg) {\n+ return {\n+ args: this.args,\n+ npmClient: this.npmClient,\n+ reject: this.options.bail,\n+ pkg,\n+ };\n+ }\n+\nrunScriptInPackagesBatched() {\nconst runner = this.options.stream\n? pkg => this.runScriptInPackageStreaming(pkg)\n@@ -97,19 +107,11 @@ class RunCommand extends Command {\n}\nrunScriptInPackageStreaming(pkg) {\n- return npmRunScript.stream(this.script, {\n- args: this.args,\n- npmClient: this.npmClient,\n- pkg,\n- });\n+ return npmRunScript.stream(this.script, this.getOpts(pkg));\n}\nrunScriptInPackageCapturing(pkg) {\n- return npmRunScript(this.script, {\n- args: this.args,\n- npmClient: this.npmClient,\n- pkg,\n- })\n+ return npmRunScript(this.script, this.getOpts(pkg))\n.then(result => {\noutput(result.stdout);\n})\n", "new_path": "commands/run/index.js", "old_path": "commands/run/index.js" }, { "change_type": "MODIFY", "diff": "\"package-3\": \"^1.0.0\"\n},\n\"scripts\": {\n+ \"prefail\": \"echo package-1\",\n+ \"fail\": \"exit 1\",\n\"my-script\": \"echo package-1\",\n\"test\": \"echo package-1\"\n}\n", "new_path": "integration/__fixtures__/lerna-run/packages/package-1/package.json", "old_path": "integration/__fixtures__/lerna-run/packages/package-1/package.json" }, { "change_type": "MODIFY", "diff": "\"name\": \"package-3\",\n\"version\": \"1.0.0\",\n\"scripts\": {\n+ \"prefail\": \"echo package-3\",\n+ \"fail\": \"exit 1\",\n\"my-script\": \"echo package-3\",\n\"test\": \"echo package-3\"\n}\n", "new_path": "integration/__fixtures__/lerna-run/packages/package-3/package.json", "old_path": "integration/__fixtures__/lerna-run/packages/package-3/package.json" }, { "change_type": "MODIFY", "diff": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n-exports[`lerna run my-script --parallel: stderr 1`] = `\n-lerna info version __TEST_VERSION__\n-lerna info run in 2 package(s): npm run my-script --silent\n-lerna success run Ran npm script 'my-script' in packages:\n-lerna success - package-1\n-lerna success - package-3\n-`;\n-\n-exports[`lerna run my-script --scope: stderr 1`] = `\n-lerna info version __TEST_VERSION__\n-lerna info filter [ 'package-1' ]\n-lerna success run Ran npm script 'my-script' in packages:\n-lerna success - package-1\n-`;\n-\n-exports[`lerna run test --ignore: stderr 1`] = `\n-lerna info version __TEST_VERSION__\n-lerna info filter [ '!package-@(1|2|3)' ]\n-lerna success run Ran npm script 'test' in packages:\n-lerna success - package-4\n-`;\n-\nexports[`lerna run test --parallel: stderr 1`] = `\nlerna info version __TEST_VERSION__\nlerna info run in 4 package(s): npm run test --silent\n", "new_path": "integration/__snapshots__/lerna-run.test.js.snap", "old_path": "integration/__snapshots__/lerna-run.test.js.snap" }, { "change_type": "MODIFY", "diff": "@@ -8,37 +8,25 @@ const initFixture = require(\"@lerna-test/init-fixture\")(__dirname);\n* because Windows makes the snapshots impossible to stabilize.\n*/\ndescribe(\"lerna run\", () => {\n- test(\"my-script --scope\", async () => {\n+ test(\"fail\", async () => {\nconst cwd = await initFixture(\"lerna-run\");\n- const args = [\n- \"run\",\n- \"my-script\",\n- \"--scope=package-1\",\n- \"--concurrency=1\",\n- // args below tell npm to be quiet\n- \"--\",\n- \"--silent\",\n- ];\n- const { stdout, stderr } = await cliRunner(cwd)(...args);\n- expect(stdout).toBe(\"package-1\");\n- expect(stderr).toMatchSnapshot(\"stderr\");\n+ const args = [\"run\", \"fail\", \"--\", \"--silent\"];\n+\n+ try {\n+ await cliRunner(cwd)(...args);\n+ } catch (err) {\n+ expect(err.message).toMatch(\"Errored while running script in 'package-3'\");\n+ }\n});\n- test(\"test --ignore\", async () => {\n+ test(\"fail --no-bail\", async () => {\nconst cwd = await initFixture(\"lerna-run\");\n- const args = [\n- \"run\",\n- \"--concurrency=1\",\n- \"test\",\n- \"--ignore\",\n- \"package-@(1|2|3)\",\n- // args below tell npm to be quiet\n- \"--\",\n- \"--silent\",\n- ];\n- const { stdout, stderr } = await cliRunner(cwd)(...args);\n- expect(stdout).toBe(\"package-4\");\n- expect(stderr).toMatchSnapshot(\"stderr\");\n+ const args = [\"run\", \"fail\", \"--no-bail\", \"--\", \"--silent\"];\n+\n+ const { stdout } = await cliRunner(cwd)(...args);\n+\n+ expect(stdout).toMatch(\"package-3\");\n+ expect(stdout).toMatch(\"package-1\");\n});\ntest(\"test --stream\", async () => {\n@@ -76,24 +64,4 @@ describe(\"lerna run\", () => {\nexpect(stdout).toMatch(\"package-3: package-3\");\nexpect(stdout).toMatch(\"package-4: package-4\");\n});\n-\n- test(\"my-script --parallel\", async () => {\n- const cwd = await initFixture(\"lerna-run\");\n- const args = [\n- \"run\",\n- \"--parallel\",\n- \"my-script\",\n- // args below tell npm to be quiet\n- \"--\",\n- \"--silent\",\n- ];\n- const { stdout, stderr } = await cliRunner(cwd)(...args);\n- expect(stderr).toMatchSnapshot(\"stderr\");\n-\n- // order is non-deterministic, so assert each item seperately\n- expect(stdout).toMatch(\"package-1: package-1\");\n- expect(stdout).not.toMatch(\"package-2\");\n- expect(stdout).toMatch(\"package-3: package-3\");\n- expect(stdout).not.toMatch(\"package-4\");\n- });\n});\n", "new_path": "integration/lerna-run.test.js", "old_path": "integration/lerna-run.test.js" }, { "change_type": "MODIFY", "diff": "\"node-int64\": \"0.4.0\"\n}\n},\n+ \"buffer-from\": {\n+ \"version\": \"1.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/buffer-from/-/buffer-from-1.0.0.tgz\",\n+ \"integrity\": \"sha512-83apNb8KK0Se60UE1+4Ukbe3HbfELJ6UlI4ldtOGs7So4KD26orJM8hIY9lxdzP+UpItH1Yh/Y8GUvNFWFFRxA==\"\n+ },\n\"builtin-modules\": {\n\"version\": \"1.1.1\",\n\"resolved\": \"https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz\",\n\"integrity\": \"sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=\"\n},\n\"concat-stream\": {\n- \"version\": \"1.6.0\",\n- \"resolved\": \"https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz\",\n- \"integrity\": \"sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=\",\n+ \"version\": \"1.6.2\",\n+ \"resolved\": \"https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz\",\n+ \"integrity\": \"sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==\",\n\"requires\": {\n+ \"buffer-from\": \"1.0.0\",\n\"inherits\": \"2.0.3\",\n\"readable-stream\": \"2.3.4\",\n\"typedarray\": \"0.0.6\"\n\"resolved\": \"https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-2.0.6.tgz\",\n\"integrity\": \"sha512-deb55+yFNqNjWvIU8Xe6EJZnp09/Q014rmJmGX3VtnIczyb8rD+RhGXpV5Mene6BFrlGuyHRlsn5e6kYXoIyOw==\",\n\"requires\": {\n- \"concat-stream\": \"1.6.0\",\n+ \"concat-stream\": \"1.6.2\",\n\"conventional-changelog-preset-loader\": \"1.1.6\",\n\"conventional-commits-filter\": \"1.1.5\",\n\"conventional-commits-parser\": \"2.1.5\",\n\"ajv\": \"5.5.2\",\n\"babel-code-frame\": \"6.26.0\",\n\"chalk\": \"2.3.2\",\n- \"concat-stream\": \"1.6.0\",\n+ \"concat-stream\": \"1.6.2\",\n\"cross-spawn\": \"5.1.0\",\n\"debug\": \"3.1.0\",\n\"doctrine\": \"2.1.0\",\n", "new_path": "package-lock.json", "old_path": "package-lock.json" } ]
JavaScript
MIT License
lerna/lerna
feat(run): Add --no-bail option Fixes #1351
1
feat
run
724,096
28.03.2018 19:45:18
-25,200
dabb2fdc4fe8fa7e4bd3ab0ce7ec6d81bc61d74c
types: expose wrapper and wraperarray
[ { "change_type": "MODIFY", "diff": "@@ -70,7 +70,7 @@ interface BaseWrapper {\ndestroy (): void\n}\n-interface Wrapper<V extends Vue> extends BaseWrapper {\n+export interface Wrapper<V extends Vue> extends BaseWrapper {\nreadonly vm: V\nreadonly element: HTMLElement\nreadonly options: WrapperOptions\n@@ -95,7 +95,7 @@ interface Wrapper<V extends Vue> extends BaseWrapper {\nemittedByOrder (): Array<{ name: string, args: Array<any> }>\n}\n-interface WrapperArray<V extends Vue> extends BaseWrapper {\n+export interface WrapperArray<V extends Vue> extends BaseWrapper {\nreadonly length: number\nreadonly wrappers: Array<Wrapper<V>>\n", "new_path": "packages/test-utils/types/index.d.ts", "old_path": "packages/test-utils/types/index.d.ts" } ]
JavaScript
MIT License
vuejs/vue-test-utils
types: expose wrapper and wraperarray (#491)
1
types
null
217,922
28.03.2018 22:15:06
-7,200
f456443383b661f57b72f0d167de9173277f13b3
fix: macro translation is now working properly with non-skill lines
[ { "change_type": "MODIFY", "diff": "@@ -55,23 +55,8 @@ import {GatheringLocationModule} from './pages/gathering-location/gathering-loca\nimport {WorkshopModule} from './pages/workshop/workshop.module';\nimport {CustomLinksModule} from './pages/custom-links/custom-links.module';\nimport {LinkModule} from './pages/link/link.module';\n-import * as Raven from 'raven-js';\nimport {TemplateModule} from './pages/template/template.module';\n-\n-Raven\n- .config(environment.production ? 'https://759388ec3a3a4868b36832ea92a5afac@sentry.io/481146' : '')\n- .install();\n-\n-export class RavenErrorHandler implements ErrorHandler {\n- handleError(err: any): void {\n- if (err.message !== 'Not found' && err.message.indexOf('permission') === -1 && err.message.indexOf('is null') === -1) {\n- Raven.captureException(err);\n- }\n- console.error(err);\n- }\n-}\n-\nexport function HttpLoaderFactory(http: HttpClient) {\nreturn new TranslateHttpLoader(http);\n}\n@@ -153,7 +138,6 @@ export function HttpLoaderFactory(http: HttpClient) {\nWorkshopModule,\nTemplateModule,\n],\n- providers: [{provide: ErrorHandler, useClass: RavenErrorHandler}],\nbootstrap: [AppComponent]\n})\nexport class AppModule {\n", "new_path": "src/app/app.module.ts", "old_path": "src/app/app.module.ts" }, { "change_type": "MODIFY", "diff": "@@ -9,7 +9,6 @@ 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 * as Raven from 'raven-js';\n@Injectable()\nexport class UserService extends FirebaseStorage<AppUser> {\n@@ -73,16 +72,10 @@ export class UserService extends FirebaseStorage<AppUser> {\n}\nif (user === null || user.isAnonymous) {\nreturn this.get(user.uid).catch(() => {\n- Raven.setUserContext({\n- id: user.uid\n- });\nreturn Observable.of(<AppUser>{$key: user.uid, name: 'Anonymous', anonymous: true});\n});\n} else {\nreturn this.get(user.uid).map(u => {\n- Raven.setUserContext({\n- id: user.uid\n- });\nu.providerId = user.providerId;\nreturn u;\n});\n", "new_path": "src/app/core/database/user.service.ts", "old_path": "src/app/core/database/user.service.ts" }, { "change_type": "MODIFY", "diff": "@@ -38,11 +38,11 @@ export class MacroTranslationComponent {\nja: [],\n};\n- let match;\nthis.translationDone = false;\nthis.invalidInputs = false;\nfor (const line of this.macroToTranslate.split('\\n')) {\n- if ((match = this.findActionsRegex.exec(line)) !== null !== null) {\n+ let match = this.findActionsRegex.exec(line);\n+ if (match !== null && match !== undefined) {\nconst skillName = match[2].replace(/\"/g, '');\n// Get translated skill\ntry {\n", "new_path": "src/app/pages/macro-translation/macro-translation/macro-translation.component.ts", "old_path": "src/app/pages/macro-translation/macro-translation/macro-translation.component.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix: macro translation is now working properly with non-skill lines
1
fix
null
679,913
28.03.2018 22:30:43
-3,600
10d5a34799c1a0fce513e676a70d0e8e70e5c3bd
fix(pointfree): add 0-arity comp() (identity fn)
[ { "change_type": "MODIFY", "diff": "-import { illegalArity } from \"@thi.ng/api/error\";\nimport { StackFn } from \"./api\";\n/**\n* Similar to (and ported from @thi.ng/transducers/func/comp), but uses\n* inverted composition order (right-to-left).\n*/\n+export function comp(): StackFn;\nexport function comp(a: StackFn): StackFn;\nexport function comp(a: StackFn, b: StackFn): StackFn;\nexport function comp(a: StackFn, b: StackFn, c: StackFn): StackFn;\n@@ -20,7 +20,7 @@ export function comp(...fns: ((x: any) => any)[]) {\nlet [a, b, c, d, e, f, g, h, i, j] = fns;\nswitch (fns.length) {\ncase 0:\n- illegalArity(0);\n+ return (x) => x;\ncase 1:\nreturn a;\ncase 2:\n", "new_path": "packages/pointfree/src/comp.ts", "old_path": "packages/pointfree/src/comp.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
fix(pointfree): add 0-arity comp() (identity fn)
1
fix
pointfree
679,913
28.03.2018 22:34:13
-3,600
0f0c382fd69e58ae57acc1b8c5e0f7fef8341086
feat(pointfree): add new words, rename words, remove mapnth, pushl2 add mapl(), mapll() array transformers refactor foldl() in terms of mapl() add even/odd() rename ladd etc. vadd... revert op2v to produce new result arrays add runE() syntax sugar update tests
[ { "change_type": "MODIFY", "diff": "@@ -36,19 +36,30 @@ export const run = (prog: StackProc, ctx: StackContext = [[], [], {}]): StackCon\n};\n/**\n- * Like `run()`, but returns unwrapped result. Short version for:\n- * `unwrap(run(),n)`\n+ * Like `run()`, but returns unwrapped result. Syntax sugar for:\n+ * `unwrap(run(...),n)`\n*\n* @param prog\n* @param ctx\n* @param n\n*/\n-export const runu = (prog: StackProc, ctx?: StackContext, n = 1) =>\n+export const runU = (prog: StackProc, ctx?: StackContext, n = 1) =>\nunwrap(run(prog, ctx), n);\n/**\n- * Creates a new StackContext tuple from given optional d-stack and\n- * environment only (no r-stack arg, always empty).\n+ * Like `run()`, but returns result environment. Syntax sugar for:\n+ * `run(...)[2]`\n+ *\n+ * @param prog\n+ * @param ctx\n+ * @param n\n+ */\n+export const runE = (prog: StackProc, ctx?: StackContext) =>\n+ run(prog, ctx)[2];\n+\n+/**\n+ * Creates a new StackContext tuple from given d-stack and/or\n+ * environment only (the r-stack is always initialized empty).\n*\n* @param stack initial d-stack\n* @param env initial environment\n@@ -130,15 +141,17 @@ export {\n}\n/**\n- * Similar to `op2`, but for array operators. Mutates first array in\n- * place. Use `dupl` prior to the op to create a shallow copy.\n+ * Similar to `op2`, but for array operators. Either `a` or `b` can be a\n+ * non-array value, but not both. Creates new array of result values.\n+ * The result will have the same length as the shortest arg (if `a` and\n+ * `b` have different lengths).\n*\n* - ( a b -- a ), if `a` is an array\n* - ( a b -- b ), if `a` is not an array\n*\n* @param f\n*/\n-export const op2l = (f: (b, a) => any) =>\n+export const op2v = (f: (b, a) => any) =>\n(ctx: StackContext): StackContext => {\n$(ctx[0], 2);\nconst stack = ctx[0];\n@@ -147,24 +160,28 @@ export const op2l = (f: (b, a) => any) =>\nconst a = stack[n];\nconst isa = isArray(a);\nconst isb = isArray(b);\n+ let c: any[];\nif (isa && isb) {\n- for (let i = a.length - 1; i >= 0; i--) {\n- a[i] = f(b[i], a[i]);\n+ c = new Array(Math.min(a.length, b.length));\n+ for (let i = c.length - 1; i >= 0; i--) {\n+ c[i] = f(b[i], a[i]);\n}\n} else {\nif (isb && !isa) {\n- for (let i = b.length - 1; i >= 0; i--) {\n- b[i] = f(b[i], a);\n+ c = new Array(b.length);\n+ for (let i = c.length - 1; i >= 0; i--) {\n+ c[i] = f(b[i], a);\n}\n- stack[n] = b;\n} else if (isa && !isb) {\n- for (let i = a.length - 1; i >= 0; i--) {\n- a[i] = f(b, a[i]);\n+ c = new Array(a.length);\n+ for (let i = c.length - 1; i >= 0; i--) {\n+ c[i] = f(b, a[i]);\n}\n} else {\nillegalArgs(\"at least one arg must be an array\");\n}\n}\n+ stack[n] = c;\nreturn ctx;\n};\n@@ -187,7 +204,7 @@ export const dsp = (ctx: StackContext) =>\n/**\n* Uses TOS as index to look up a deeper d-stack value, then places it\n- * as new TOS.\n+ * as new TOS. Throws error if stack depth is < `x`.\n*\n* ( ... x -- ... stack[x] )\n*\n@@ -345,7 +362,7 @@ export const nip = (ctx: StackContext) => {\n};\n/**\n- * Inserts copy of TOS as TOS-2 on d-stack.\n+ * Inserts copy of TOS @ TOS-2 in d-stack.\n*\n* ( x y -- y x y )\n*\n@@ -410,24 +427,6 @@ export const over = (ctx: StackContext) => {\nreturn ctx;\n}\n-/**\n- * Higher order word. Pops TOS and uses it as index `n` to transform d-stack\n- * item @ `stack[-n]` w/ given transformation.\n- *\n- * ( x -- )\n- *\n- * @param op\n- */\n-export const mapnth = (f: (x) => any) =>\n- (ctx: StackContext) => {\n- const stack = ctx[0];\n- let n = stack.length - 1;\n- $n(n, 0);\n- $n(n -= stack.pop() + 1, 0);\n- stack[n] = f(stack[n]);\n- return ctx;\n- };\n-\n//////////////////// R-Stack ops ////////////////////\n/**\n@@ -599,6 +598,20 @@ export const pow = op2((b, a) => Math.pow(a, b));\n*/\nexport const sqrt = op1(Math.sqrt);\n+/**\n+ * ( x -- bool )\n+ *\n+ * @param ctx\n+ */\n+export const even = op1((x) => !(x & 1));\n+\n+/**\n+ * ( x -- bool )\n+ *\n+ * @param ctx\n+ */\n+export const odd = op1((x) => !!(x & 1));\n+\n//////////////////// Binary ops ////////////////////\n/**\n@@ -758,10 +771,13 @@ export const isnull = op1((x) => x == null);\n*\n* If the optional `env` is given, uses a shallow copy of that\n* environment (one per invocation) instead of the current one passed by\n- * `run()` at runtime. If `mergeEnv` is true, the user provided env will\n- * be merged with the current env (also shallow copies). This is useful in\n- * conjunction with `pushenv()` and `store()` or `storekey()` to save\n- * results of sub procedures in the main env.\n+ * `run()` at runtime. If `mergeEnv` is true (default), the user\n+ * provided env will be merged with the current env (also shallow\n+ * copies). This is useful in conjunction with `pushenv()` and `store()`\n+ * or `storekey()` to save results of sub procedures in the main env.\n+ *\n+ * Note: The provided (or merged) env is only active within the\n+ * execution scope of the word.\n*\n* ( ? -- ? )\n*\n@@ -769,16 +785,28 @@ export const isnull = op1((x) => x == null);\n* @param env\n* @param mergeEnv\n*/\n-export const word = (prog: StackProgram, env?: StackEnv, mergeEnv = false) => {\n+export const word = (prog: StackProgram, env?: StackEnv, mergeEnv = true) => {\nconst w: StackFn = compile(prog);\nreturn env ?\nmergeEnv ?\n- (ctx: StackContext) => w([ctx[0], ctx[1], { ...ctx[2], ...env }]) :\n- (ctx: StackContext) => w([ctx[0], ctx[1], { ...env }]) :\n+ (ctx: StackContext) => (w([ctx[0], ctx[1], { ...ctx[2], ...env }]), ctx) :\n+ (ctx: StackContext) => (w([ctx[0], ctx[1], { ...env }]), ctx) :\nw;\n};\n-export const wordU = (prog: StackProgram, n = 1, env?: StackEnv, mergeEnv = false) => {\n+/**\n+ * Like `word()`, but automatically calls `unwrap()` on result context\n+ * to produced unwrapped value/tuple.\n+ *\n+ * **Importatant:** Words defined with this function CANNOT be used as\n+ * part of a larger stack program, only for standalone use.\n+ *\n+ * @param prog\n+ * @param n\n+ * @param env\n+ * @param mergeEnv\n+ */\n+export const wordU = (prog: StackProgram, n = 1, env?: StackEnv, mergeEnv = true) => {\nconst w: StackFn = compile(prog);\nreturn env ?\nmergeEnv ?\n@@ -903,17 +931,17 @@ export const loop = (test: StackProc, body: StackProc) => {\n*\n* ```\n* // using array literal within word definition\n- * foo = pf.word([ [], 1, pf.pushr ])\n- * pf.runu(null, foo)\n+ * foo = pf.word([ [], 1, pf.pushl ])\n+ * pf.runU(foo)\n* // [ 1 ]\n- * pf.runu(null, foo)\n+ * pf.runU(foo)\n* // [ 1, 1 ] // wrong!\n*\n* // using `list` instead\n- * bar = pf.word([ pf.list, 1, pf.pushr ])\n- * pf.runu(null, bar)\n+ * bar = pf.word([ pf.list, 1, pf.pushl ])\n+ * pf.runU(bar)\n* // [ 1 ]\n- * pf.runu(null, bar)\n+ * pf.runU(bar)\n* // [ 1 ] // correct!\n* ```\n*\n@@ -940,20 +968,6 @@ export const pushl = (ctx: StackContext) => {\nreturn ctx;\n};\n-/**\n- * ( a b arr -- arr )\n- * @param ctx\n- */\n-export const pushl2 = (ctx: StackContext) => {\n- $(ctx[0], 3);\n- const stack = ctx[0];\n- const a: any[] = stack.pop();\n- a.unshift(stack.pop());\n- a.unshift(stack.pop());\n- stack.push(a);\n- return ctx;\n-};\n-\n/**\n* Pushes `val` on the RHS of array.\n*\n@@ -972,6 +986,7 @@ export const pushr = (ctx: StackContext) => {\n/**\n* Removes RHS from array as new TOS on d-stack.\n+ * Throws error is `arr` is empty.\n*\n* ( arr -- arr arr[-1] )\n*\n@@ -992,17 +1007,19 @@ export const pull2 = word([pull, pull]);\nexport const pull3 = word([pull2, pull]);\nexport const pull4 = word([pull2, pull2]);\n-export const ladd = op2l((b, a) => a + b);\n-export const lsub = op2l((b, a) => a - b);\n-export const lmul = op2l((b, a) => a * b);\n-export const ldiv = op2l((b, a) => a / b);\n+export const vadd = op2v((b, a) => a + b);\n+export const vsub = op2v((b, a) => a - b);\n+export const vmul = op2v((b, a) => a * b);\n+export const vdiv = op2v((b, a) => a / b);\n/**\n- * ( list x -- [...] [...] )\n+ * Splits vector / array at given index `x`.\n+ *\n+ * ( arr x -- [...] [...] )\n*\n* @param ctx\n*/\n-export const lsplit = (ctx: StackContext) => {\n+export const split = (ctx: StackContext) => {\nconst stack = ctx[0];\nconst n = stack.length - 2;\n$n(n, 0);\n@@ -1012,6 +1029,13 @@ export const lsplit = (ctx: StackContext) => {\nreturn ctx;\n};\n+/**\n+ * Concatenates two arrays on d-stack:\n+ *\n+ * ( arr1 arr2 -- arr )\n+ *\n+ * @param ctx\n+ */\nexport const cat = (ctx: StackContext) => {\nconst stack = ctx[0];\nconst n = stack.length - 2;\n@@ -1021,26 +1045,124 @@ export const cat = (ctx: StackContext) => {\n};\n/**\n- * ( list init q -- res )\n+ * Generic array transformer.\n+ *\n+ * ( arr q -- ? )\n+ *\n+ * Pops both args from d-stack, then executes quotation for each array\n+ * item (each pushed on d-stack prior to calling quotation). Can produce\n+ * any number of results and therefore also be used as filter, mapcat,\n+ * reduce...\n+ *\n+ * ```\n+ * // each item times 10\n+ * run([[1, 2, 3, 4], [10, mul], mapl])\n+ * // [ [ 10, 20, 30, 40 ], [], {} ]\n+ * ```\n+ *\n+ * Use for filtering:\n*\n- * For each iteration the stack effect should be:\n+ * ```\n+ * // drop even numbers, duplicate odd ones\n+ * run([[1, 2, 3, 4], [dup, even, cond(drop, dup)], mapl])\n+ * // [ [ 1, 1, 3, 3 ], [], {} ]\n+ * ```\n+ *\n+ * Reduction:\n+ *\n+ * ```\n+ * // the `0` is the initial reduction result\n+ * runU([0, [1, 2, 3, 4], [add], mapl])\n+ * // 10\n+ * ```\n+ *\n+ * **Important**: `mapl` does not produce a result array. However,\n+ * there're several options to collect results as array, e.g.\n+ *\n+ * Use `mapll()` to transform:\n+ *\n+ * ```\n+ * runU([[1, 2, 3, 4], [10, mul], mapll])\n+ * // [ 10, 20, 30, 40]\n+ * ```\n+ *\n+ * Collecting results as array is a form of reduction, so we can use\n+ * `list` to produce an initial new array and `pushr` to push each new\n+ * interim value into the result:\n+ *\n+ * ```\n+ * runU([list, [1, 2, 3, 4], [10, mul, pushr], mapl])\n+ * // [ 10, 20, 30, 40 ]\n+ * ```\n+ *\n+ * If the array size is known & not changed by transformation:\n+ *\n+ * ```\n+ * runU([[1, 2, 3, 4], [10, mul], mapl, 4, collect])\n+ * // [ 10, 20, 30, 40 ]\n+ * ```\n*\n- * ( acc x -- q(acc,x) )\n+ * @param ctx\n*/\n-export const foldl = (ctx: StackContext) => {\n- $(ctx[0], 3);\n+export const mapl = (ctx: StackContext) => {\n+ $(ctx[0], 2);\nconst stack = ctx[0];\nconst w = $stackFn(stack.pop());\n- const init = stack.pop();\nconst list = stack.pop();\n- stack.push(init);\n- for (let i = 0, n = list.length; i < n; i++) {\n+ const n = list.length;\n+ for (let i = 0; i < n; i++) {\nctx[0].push(list[i]);\nctx = w(ctx);\n}\nreturn ctx;\n};\n+/**\n+ * Similar to `mapl()`, but produces new array of transformed values.\n+ *\n+ * ( arr q -- arr )\n+ *\n+ * ```\n+ * runU([[1, 2, 3, 4], [10, mul], mapll])\n+ * // [ 10, 20, 30, 40]\n+ * ```\n+ *\n+ * Filter / mapcat:\n+ *\n+ * ```\n+ * // drop even numbers, duplicate odd ones\n+ * run([[1, 2, 3, 4], [dup, even, cond(drop, dup)], mapll])\n+ * // [ [ [ 1, 1, 3, 3 ] ], [], {} ]\n+ * ```\n+ *\n+ * @param ctx\n+ */\n+export const mapll = (ctx: StackContext) => {\n+ $(ctx[0], 2);\n+ let stack = ctx[0];\n+ const w = $stackFn(stack.pop());\n+ const list = stack.pop();\n+ const n = list.length;\n+ let r = 0;\n+ for (let i = 0; i < n; i++) {\n+ let m = stack.length;\n+ stack.push(list[i]);\n+ ctx = w(ctx);\n+ stack = ctx[0];\n+ r += stack.length - m;\n+ }\n+ stack.push(stack.splice(stack.length - r, r));\n+ return ctx;\n+};\n+\n+/**\n+ * Convenience wrapper for `mapl` to provide an alternative stack layout\n+ * for reduction purposes:\n+ *\n+ * ( arr q init -- reduction )\n+ */\n+export const foldl = word([invrot, mapl]);\n+\n/**\n* Pops TOS (a number) and then forms a tuple of the top `n` remaining\n* values and pushes it as new TOS. The original collected stack values\n", "new_path": "packages/pointfree/src/index.ts", "old_path": "packages/pointfree/src/index.ts" }, { "change_type": "MODIFY", "diff": "@@ -128,15 +128,6 @@ describe(\"pointfree\", () => {\nassert.deepEqual(pf.pick($([0, 1, 1]))[0], [0, 1, 0]);\n});\n- it(\"mapN\", () => {\n- let f = x => x + 10;\n- assert.throws(() => pf.mapnth(f)($([])));\n- assert.throws(() => pf.mapnth(f)($([0])));\n- assert.throws(() => pf.mapnth(f)($([0, 1])));\n- assert.deepEqual(pf.mapnth(f)($([0, 1, 0]))[0], [0, 11]);\n- assert.deepEqual(pf.mapnth(f)($([0, 1, 1]))[0], [10, 1]);\n- });\n-\nit(\"add\", () => {\nassert.throws(() => pf.add($([1])));\nassert.deepEqual(pf.add($([1, 2]))[0], [3]);\n@@ -385,44 +376,44 @@ describe(\"pointfree\", () => {\nassert.deepEqual(pf.pull4($([[1, 2, 3, 4]]))[0], [4, 3, 2, 1, []]);\n});\n- it(\"ladd\", () => {\n- assert.throws(() => pf.ladd($([[]])));\n- assert.deepEqual(pf.ladd($([[1, 2, 3], [10, 20, 30]]))[0], [[11, 22, 33]]);\n- assert.deepEqual(pf.ladd($([[1, 2, 3], 10]))[0], [[11, 12, 13]]);\n- assert.deepEqual(pf.ladd($([10, [1, 2, 3]]))[0], [[11, 12, 13]]);\n+ it(\"vadd\", () => {\n+ assert.throws(() => pf.vadd($([[]])));\n+ assert.deepEqual(pf.vadd($([[1, 2, 3], [10, 20, 30]]))[0], [[11, 22, 33]]);\n+ assert.deepEqual(pf.vadd($([[1, 2, 3], 10]))[0], [[11, 12, 13]]);\n+ assert.deepEqual(pf.vadd($([10, [1, 2, 3]]))[0], [[11, 12, 13]]);\n});\n- it(\"lmul\", () => {\n- assert.throws(() => pf.lmul($([[]])));\n- assert.deepEqual(pf.lmul($([[1, 2, 3], [10, 20, 30]]))[0], [[10, 40, 90]]);\n- assert.deepEqual(pf.lmul($([[1, 2, 3], 10]))[0], [[10, 20, 30]]);\n- assert.deepEqual(pf.lmul($([10, [1, 2, 3]]))[0], [[10, 20, 30]]);\n+ it(\"vmul\", () => {\n+ assert.throws(() => pf.vmul($([[]])));\n+ assert.deepEqual(pf.vmul($([[1, 2, 3], [10, 20, 30]]))[0], [[10, 40, 90]]);\n+ assert.deepEqual(pf.vmul($([[1, 2, 3], 10]))[0], [[10, 20, 30]]);\n+ assert.deepEqual(pf.vmul($([10, [1, 2, 3]]))[0], [[10, 20, 30]]);\n});\n- it(\"lsub\", () => {\n- assert.throws(() => pf.lsub($([[]])));\n- assert.deepEqual(pf.lsub($([[1, 2, 3], [10, 20, 30]]))[0], [[-9, -18, -27]]);\n- assert.deepEqual(pf.lsub($([[1, 2, 3], 10]))[0], [[-9, -8, -7]]);\n- assert.deepEqual(pf.lsub($([10, [1, 2, 3]]))[0], [[9, 8, 7]]);\n+ it(\"vsub\", () => {\n+ assert.throws(() => pf.vsub($([[]])));\n+ assert.deepEqual(pf.vsub($([[1, 2, 3], [10, 20, 30]]))[0], [[-9, -18, -27]]);\n+ assert.deepEqual(pf.vsub($([[1, 2, 3], 10]))[0], [[-9, -8, -7]]);\n+ assert.deepEqual(pf.vsub($([10, [1, 2, 3]]))[0], [[9, 8, 7]]);\n});\n- it(\"ldiv\", () => {\n- assert.throws(() => pf.ldiv($([[]])));\n- assert.deepEqual(pf.ldiv($([[1, 2, 3], [10, 20, 30]]))[0], [[0.1, 0.1, 0.1]]);\n- assert.deepEqual(pf.ldiv($([[1, 2, 3], 10]))[0], [[0.1, 0.2, 0.3]]);\n- assert.deepEqual(pf.ldiv($([10, [1, 2, 3]]))[0], [[10, 5, 10 / 3]]);\n+ it(\"vdiv\", () => {\n+ assert.throws(() => pf.vdiv($([[]])));\n+ assert.deepEqual(pf.vdiv($([[1, 2, 3], [10, 20, 30]]))[0], [[0.1, 0.1, 0.1]]);\n+ assert.deepEqual(pf.vdiv($([[1, 2, 3], 10]))[0], [[0.1, 0.2, 0.3]]);\n+ assert.deepEqual(pf.vdiv($([10, [1, 2, 3]]))[0], [[10, 5, 10 / 3]]);\n});\n- it(\"lsplit\", () => {\n- assert.throws(() => pf.lsplit($()));\n- assert.deepEqual(pf.lsplit($([[1, 2, 3, 4], 2]))[0], [[1, 2], [3, 4]]);\n- assert.deepEqual(pf.lsplit($([[1, 2, 3, 4], 4]))[0], [[1, 2, 3, 4], []]);\n- assert.deepEqual(pf.lsplit($([[1, 2, 3, 4], -1]))[0], [[1, 2, 3], [4]]);\n+ it(\"vsplit\", () => {\n+ assert.throws(() => pf.split($()));\n+ assert.deepEqual(pf.split($([[1, 2, 3, 4], 2]))[0], [[1, 2], [3, 4]]);\n+ assert.deepEqual(pf.split($([[1, 2, 3, 4], 4]))[0], [[1, 2, 3, 4], []]);\n+ assert.deepEqual(pf.split($([[1, 2, 3, 4], -1]))[0], [[1, 2, 3], [4]]);\n});\n- it(\"foldl\", () => {\n- assert.throws(() => pf.foldl($([[], 0])));\n- assert.deepEqual(pf.foldl($([[1, 2, 3, 4], 0, [pf.add]]))[0], [10]);\n+ it(\"mapl (reduce)\", () => {\n+ assert.throws(() => pf.mapl($([[]])));\n+ assert.deepEqual(pf.mapl($([0, [1, 2, 3, 4], [pf.add]]))[0], [10]);\n});\nit(\"collect\", () => {\n@@ -466,7 +457,7 @@ describe(\"pointfree\", () => {\nassert.deepEqual(pf.at($([{ id: 42 }, \"id\"]))[0], [42]);\n});\n- it(\"storeAt\", () => {\n+ it(\"storeat\", () => {\nassert.throws(() => pf.storeat($([1, 2])));\nlet a: any = [10, 20];\nassert.deepEqual(pf.storeat($([30, a, 0]))[0], []);\n@@ -491,18 +482,18 @@ describe(\"pointfree\", () => {\nassert.deepEqual(pf.store([[10, \"b\"], [], { a: 1 }]), [[], [], { a: 1, b: 10 }]);\n});\n- it(\"loadKey\", () => {\n+ it(\"loadkey\", () => {\nassert.deepEqual(pf.loadkey(\"a\")([[0], [], { a: 1 }])[0], [0, 1]);\nassert.deepEqual(pf.loadkey(\"b\")([[0], [], { a: 1 }])[0], [0, undefined]);\n});\n- it(\"storeKey\", () => {\n+ it(\"storekey\", () => {\nassert.throws(() => pf.storekey(\"a\")($()));\nassert.deepEqual(pf.storekey(\"a\")([[10], [], {}]), [[], [], { a: 10 }]);\nassert.deepEqual(pf.storekey(\"b\")([[10], [], { a: 1 }]), [[], [], { a: 1, b: 10 }]);\n});\n- it(\"pushEnv\", () => {\n+ it(\"pushenv\", () => {\nassert.deepEqual(pf.pushenv([[0], [], { a: 10 }]), [[0, { a: 10 }], [], { a: 10 }]);\n});\n@@ -522,7 +513,7 @@ describe(\"pointfree\", () => {\nassert.deepEqual(pf.exec($([1, 2, pf.add]))[0], [3]);\n});\n- it(\"execQ\", () => {\n+ it(\"execq\", () => {\nassert.throws(() => pf.execq($()));\nassert.throws(() => pf.execq($([[pf.add]])));\nassert.throws(() => pf.execq($([[1, pf.add]])));\n@@ -540,7 +531,7 @@ describe(\"pointfree\", () => {\nassert.deepEqual(pf.cond([1, pf.dup], [2, pf.dup])($([0]))[0], [2, 2]);\n});\n- it(\"condM\", () => {\n+ it(\"cases\", () => {\nlet classify = (x) =>\npf.cases({\n0: [\"zero\"],\n@@ -560,8 +551,8 @@ describe(\"pointfree\", () => {\nit(\"word\", () => {\nassert.deepEqual(pf.word([pf.dup, pf.mul])($([2]))[0], [4]);\n- assert.deepEqual(pf.word([pf.pushenv], { a: 1 })($([0]))[0], [0, { a: 1 }]);\n- assert.deepEqual(pf.word([pf.pushenv], { a: 1 }, true)([[0], [], { b: 2 }])[0], [0, { a: 1, b: 2 }]);\n+ assert.deepEqual(pf.word([pf.pushenv], { a: 1 }, false)([[0], [], { b: 2 }])[0], [0, { a: 1 }]);\n+ assert.deepEqual(pf.word([pf.pushenv], { a: 1 })([[0], [], { b: 2 }])[0], [0, { a: 1, b: 2 }]);\nassert.deepEqual(pf.word([pf.add, pf.mul])($([1, 2, 3]))[0], [5]);\nassert.deepEqual(pf.word([pf.add, pf.mul, pf.add])($([1, 2, 3, 4]))[0], [15]);\nassert.deepEqual(pf.word([pf.add, pf.mul, pf.add, pf.mul])($([1, 2, 3, 4, 5]))[0], [29]);\n@@ -574,7 +565,7 @@ describe(\"pointfree\", () => {\nassert.deepEqual(pf.word([pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add])($([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]))[0], [92159]);\n});\n- it(\"wordU\", () => {\n+ it(\"wordu\", () => {\nassert.deepEqual(pf.wordU([pf.dup, pf.mul])($([2])), 4);\nassert.deepEqual(pf.wordU([pf.pushenv], 1, { a: 1 })($()), { a: 1 });\nassert.deepEqual(pf.wordU([pf.pushenv], 1, { a: 1 }, true)([[], [], { b: 2 }]), { a: 1, b: 2 });\n", "new_path": "packages/pointfree/test/index.ts", "old_path": "packages/pointfree/test/index.ts" }, { "change_type": "MODIFY", "diff": "@@ -56,13 +56,13 @@ const makeids = (i: number, j: number, sep: string, id1: StackFn = pf.nop, id2 =\n// transform a number into another value (e.g. string)\nconst idgen = (ids) => pf.maptos((x) => ids[x]);\n-console.log(pf.runu(grid(4, 4)));\n-console.log(pf.runu(makeids(4, 4, \"\", idgen(\"abcd\"))));\n-console.log(pf.runu(makeids(4, 4, \"-\", idgen([\"alpha\", \"beta\", \"gamma\", \"delta\"]), pf.nop)));\n+console.log(pf.runU(grid(4, 4)));\n+console.log(pf.runU(makeids(4, 4, \"\", idgen(\"abcd\"))));\n+console.log(pf.runU(makeids(4, 4, \"-\", idgen([\"alpha\", \"beta\", \"gamma\", \"delta\"]), pf.nop)));\nconsole.log(\n- pf.runu([\n+ pf.runU([\nmakeids(4, 4, \"\", idgen(\"abcd\")),\n- pf.maptos(id => pf.runu(makeids(4, 4, \"/\", idgen(id)))),\n- pf.maptos(id => pf.runu(makeids(4, 4, \"-\", idgen(id))))\n+ pf.maptos(id => pf.runU(makeids(4, 4, \"/\", idgen(id)))),\n+ pf.maptos(id => pf.runU(makeids(4, 4, \"-\", idgen(id))))\n]));\n\\ No newline at end of file\n", "new_path": "packages/pointfree/test/loop.ts", "old_path": "packages/pointfree/test/loop.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(pointfree): add new words, rename words, remove mapnth, pushl2 - add mapl(), mapll() array transformers - refactor foldl() in terms of mapl() - add even/odd() - rename ladd etc. vadd... - revert op2v to produce new result arrays - add runE() syntax sugar - update tests
1
feat
pointfree
679,913
28.03.2018 22:35:45
-3,600
e35a2ca1278165e0c2f8209263943680fb47510c
build(paths): update package
[ { "change_type": "MODIFY", "diff": "{\n\"name\": \"@thi.ng/paths\",\n\"version\": \"1.1.1\",\n- \"description\": \"immutable, optimized path-based object accessors\",\n+ \"description\": \"immutable, optimized path-based object property / array accessors\",\n\"main\": \"./index.js\",\n\"typings\": \"./index.d.ts\",\n\"repository\": \"https://github.com/thi-ng/umbrella\",\n\"@thi.ng/checks\": \"^1.3.0\"\n},\n\"keywords\": [\n- \"data structure\",\n+ \"accessors\",\n+ \"array\",\n\"ES6\",\n\"getter\",\n+ \"immutable\",\n\"nested\",\n\"object\",\n\"path\",\n+ \"property\",\n\"setter\",\n\"typescript\"\n],\n", "new_path": "packages/paths/package.json", "old_path": "packages/paths/package.json" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
build(paths): update package
1
build
paths
679,913
29.03.2018 01:23:11
-3,600
221ece65670823594602006ce966f64b6da3092d
build: update make-module/make-example scripts
[ { "change_type": "MODIFY", "diff": "@@ -26,15 +26,15 @@ cat << EOF > $MODULE/package.json\n\"debdev\": \"see index.html && webpack -w\"\n},\n\"devDependencies\": {\n- \"ts-loader\": \"^3.3.1\",\n- \"typescript\": \"^2.7.1\",\n- \"webpack\": \"^3.10.0\"\n+ \"ts-loader\": \"^3.5.0\",\n+ \"typescript\": \"^2.7.2\",\n+ \"webpack\": \"^3.11.0\"\n},\n\"dependencies\": {\n- \"@thi.ng/api\": \"^2.0.3\",\n- \"@thi.ng/hdom\": \"^2.0.0\",\n- \"@thi.ng/rstream\": \"^1.0.0\",\n- \"@thi.ng/transducers\": \"^1.6.1\"\n+ \"@thi.ng/api\": \"latest\",\n+ \"@thi.ng/hdom\": \"latest\",\n+ \"@thi.ng/rstream\": \"latest\",\n+ \"@thi.ng/transducers\": \"latest\"\n}\n}\nEOF\n", "new_path": "scripts/make-example", "old_path": "scripts/make-example" }, { "change_type": "MODIFY", "diff": "@@ -37,9 +37,10 @@ cat << EOF > $MODULE/package.json\n\"scripts\": {\n\"build\": \"yarn run clean && tsc --declaration\",\n\"clean\": \"rm -rf *.js *.d.ts build doc\",\n+ \"cover\": \"yarn test && nyc report --reporter=lcov\",\n\"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n\"pub\": \"yarn run build && yarn publish --access public\",\n- \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n+ \"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.48\",\n", "new_path": "scripts/make-module", "old_path": "scripts/make-module" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
build: update make-module/make-example scripts
1
build
null
807,890
29.03.2018 01:34:07
-10,800
45efa2404933e890e5561ac4c3e0dd0c4c08cb04
feat: Execute atomic publish lifecycle during lerna publish
[ { "change_type": "MODIFY", "diff": "\"scripts\": {\n\"preversion\": \"echo preversion-root\",\n\"version\": \"echo version-root\",\n- \"postversion\": \"echo postversion-root\"\n+ \"postversion\": \"echo postversion-root\",\n+ \"prepublish\": \"echo prepublish-root\",\n+ \"prepare\": \"echo prepare-root\",\n+ \"prepublishOnly\": \"echo prepublishOnly-root\",\n+ \"postpublish\": \"echo postpublish-root\"\n}\n}\n", "new_path": "commands/publish/__tests__/__fixtures__/lifecycle/package.json", "old_path": "commands/publish/__tests__/__fixtures__/lifecycle/package.json" }, { "change_type": "MODIFY", "diff": "\"scripts\": {\n\"preversion\": \"echo preversion-package-1\",\n\"version\": \"echo version-package-1\",\n- \"postversion\": \"echo postversion-package-1\"\n+ \"postversion\": \"echo postversion-package-1\",\n+ \"prepublish\": \"echo prepublish-package-1\",\n+ \"prepare\": \"echo prepare-package-1\",\n+ \"prepublishOnly\": \"echo prepublish-package-1\",\n+ \"postpublish\": \"echo postpublish-package-1\"\n}\n}\n", "new_path": "commands/publish/__tests__/__fixtures__/lifecycle/packages/package-1/package.json", "old_path": "commands/publish/__tests__/__fixtures__/lifecycle/packages/package-1/package.json" }, { "change_type": "MODIFY", "diff": "@@ -1113,11 +1113,11 @@ describe(\"PublishCommand\", () => {\n* ======================================================================= */\ndescribe(\"lifecycle scripts\", () => {\n- it(\"calls version lifecycle scripts for root and packages\", async () => {\n+ it(\"calls version and publish lifecycle scripts for root and packages\", async () => {\nconst testDir = await initFixture(\"lifecycle\");\nawait lernaPublish(testDir)();\n- expect(runLifecycle).toHaveBeenCalledTimes(6);\n+ expect(runLifecycle).toHaveBeenCalledTimes(12);\n[\"preversion\", \"version\", \"postversion\"].forEach(script => {\nexpect(runLifecycle).toHaveBeenCalledWith(\n@@ -1146,6 +1146,12 @@ describe(\"PublishCommand\", () => {\n[\"lifecycle\", \"version\"],\n[\"package-1\", \"postversion\"],\n[\"lifecycle\", \"postversion\"],\n+ [\"lifecycle\", \"prepare\"],\n+ [\"lifecycle\", \"prepublishOnly\"],\n+ [\"package-1\", \"prepare\"],\n+ [\"package-1\", \"prepublishOnly\"],\n+ [\"package-1\", \"postpublish\"],\n+ [\"lifecycle\", \"postpublish\"],\n]);\n});\n@@ -1156,7 +1162,7 @@ describe(\"PublishCommand\", () => {\nawait lernaPublish(testDir)();\n- expect(runLifecycle).toHaveBeenCalledTimes(6);\n+ expect(runLifecycle).toHaveBeenCalledTimes(12);\nexpect(updatedPackageVersions(testDir)).toMatchSnapshot(\"updated packages\");\nconst [errorLog] = loggingOutput(\"error\");\n", "new_path": "commands/publish/__tests__/publish-command.test.js", "old_path": "commands/publish/__tests__/publish-command.test.js" }, { "change_type": "MODIFY", "diff": "@@ -578,12 +578,27 @@ class PublishCommand extends Command {\n}\n}\n+ runPrepublishScripts(pkg) {\n+ return Promise.resolve(this.runPackageLifecycle(pkg, \"prepare\")).then(() =>\n+ this.runPackageLifecycle(pkg, \"prepublishOnly\")\n+ );\n+ }\n+\nnpmPublish() {\nconst tracker = this.logger.newItem(\"npmPublish\");\n// if we skip temp tags we should tag with the proper value immediately\nconst distTag = this.options.tempTag ? \"lerna-temp\" : this.getDistTag();\n- this.updates.forEach(({ pkg }) => this.execScript(pkg, \"prepublish\"));\n+ const rootPkg = this.project.package;\n+\n+ let chain = this.runPrepublishScripts(rootPkg);\n+\n+ chain = chain.then(() =>\n+ pMap(this.updates, ({ pkg }) => {\n+ this.execScript(pkg, \"prepublish\");\n+ return this.runPrepublishScripts(pkg);\n+ })\n+ );\ntracker.addWork(this.packagesToPublish.length);\n@@ -595,12 +610,14 @@ class PublishCommand extends Command {\ntracker.completeWork(1);\nthis.execScript(pkg, \"postpublish\");\n+ this.runPackageLifecycle(pkg, \"postpublish\");\n});\n};\n- return pFinally(runParallelBatches(this.batchedPackages, this.concurrency, mapPackage), () =>\n- tracker.finish()\n- );\n+ chain = chain.then(() => runParallelBatches(this.batchedPackages, this.concurrency, mapPackage));\n+ chain = chain.then(() => this.runPackageLifecycle(rootPkg, \"postpublish\"));\n+\n+ return pFinally(chain, () => tracker.finish());\n}\nnpmUpdateAsLatest() {\n", "new_path": "commands/publish/index.js", "old_path": "commands/publish/index.js" }, { "change_type": "MODIFY", "diff": "@@ -20,15 +20,19 @@ describe(\"npm-publish\", () => {\nit(\"runs npm publish in a directory with --tag support\", async () => {\nawait npmPublish(pkg, \"published-tag\", { npmClient: \"npm\" });\n- expect(ChildProcessUtilities.exec).lastCalledWith(\"npm\", [\"publish\", \"--tag\", \"published-tag\"], {\n+ expect(ChildProcessUtilities.exec).lastCalledWith(\n+ \"npm\",\n+ [\"publish\", \"--ignore-scripts\", \"--tag\", \"published-tag\"],\n+ {\ncwd: pkg.location,\n- });\n+ }\n+ );\n});\nit(\"does not pass --tag when none present (npm default)\", async () => {\nawait npmPublish(pkg, undefined, { npmClient: \"npm\" });\n- expect(ChildProcessUtilities.exec).lastCalledWith(\"npm\", [\"publish\"], {\n+ expect(ChildProcessUtilities.exec).lastCalledWith(\"npm\", [\"publish\", \"--ignore-scripts\"], {\ncwd: pkg.location,\n});\n});\n@@ -36,9 +40,13 @@ describe(\"npm-publish\", () => {\nit(\"trims trailing whitespace in tag parameter\", async () => {\nawait npmPublish(pkg, \"trailing-tag \", { npmClient: \"npm\" });\n- expect(ChildProcessUtilities.exec).lastCalledWith(\"npm\", [\"publish\", \"--tag\", \"trailing-tag\"], {\n+ expect(ChildProcessUtilities.exec).lastCalledWith(\n+ \"npm\",\n+ [\"publish\", \"--ignore-scripts\", \"--tag\", \"trailing-tag\"],\n+ {\ncwd: pkg.location,\n- });\n+ }\n+ );\n});\nit(\"supports custom registry\", async () => {\n@@ -46,13 +54,17 @@ describe(\"npm-publish\", () => {\nawait npmPublish(pkg, \"custom-registry\", { npmClient: \"npm\", registry });\n- expect(ChildProcessUtilities.exec).lastCalledWith(\"npm\", [\"publish\", \"--tag\", \"custom-registry\"], {\n+ expect(ChildProcessUtilities.exec).lastCalledWith(\n+ \"npm\",\n+ [\"publish\", \"--ignore-scripts\", \"--tag\", \"custom-registry\"],\n+ {\ncwd: pkg.location,\nenv: expect.objectContaining({\nnpm_config_registry: registry,\n}),\nextendEnv: false,\n- });\n+ }\n+ );\n});\ndescribe(\"with npmClient yarn\", () => {\n@@ -61,7 +73,15 @@ describe(\"npm-publish\", () => {\nexpect(ChildProcessUtilities.exec).lastCalledWith(\n\"yarn\",\n- [\"publish\", \"--tag\", \"yarn-publish\", \"--new-version\", pkg.version, \"--non-interactive\"],\n+ [\n+ \"publish\",\n+ \"--ignore-scripts\",\n+ \"--tag\",\n+ \"yarn-publish\",\n+ \"--new-version\",\n+ pkg.version,\n+ \"--non-interactive\",\n+ ],\n{\ncwd: pkg.location,\n}\n", "new_path": "utils/npm-publish/__tests__/npm-publish.test.js", "old_path": "utils/npm-publish/__tests__/npm-publish.test.js" }, { "change_type": "MODIFY", "diff": "@@ -12,7 +12,7 @@ function npmPublish(pkg, tag, { npmClient, registry }) {\nconst distTag = tag && tag.trim();\nconst opts = getExecOpts(pkg, registry);\n- const args = [\"publish\"];\n+ const args = [\"publish\", \"--ignore-scripts\"];\nif (distTag) {\nargs.push(\"--tag\", distTag);\n", "new_path": "utils/npm-publish/npm-publish.js", "old_path": "utils/npm-publish/npm-publish.js" } ]
JavaScript
MIT License
lerna/lerna
feat: Execute atomic publish lifecycle during lerna publish (#1348)
1
feat
null
791,813
29.03.2018 01:40:38
-7,200
2200c7851e5f7c361b545dd9fdacfa630fe5cf9e
extension: use browserify url library Also bumps robots-parser dependency to 2.0.1
[ { "change_type": "MODIFY", "diff": "@@ -121,7 +121,6 @@ gulp.task('browserify-lighthouse', () => {\n// to the modified version internal to Lighthouse.\nbundle.transform('./dtm-transform.js', {global: true})\n.ignore('source-map')\n- .ignore('url')\n.ignore('debug/node')\n.ignore('raven')\n.ignore('mkdirp')\n", "new_path": "lighthouse-extension/gulpfile.js", "old_path": "lighthouse-extension/gulpfile.js" }, { "change_type": "MODIFY", "diff": "\"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- \"mixed-content\": \"./lighthouse-cli/index.js --chrome-flags='--headless' --config-path=./lighthouse-core/config/mixed-content.js\",\n- \"prepare\": \"patch-package\"\n+ \"mixed-content\": \"./lighthouse-cli/index.js --chrome-flags='--headless' --config-path=./lighthouse-core/config/mixed-content.js\"\n},\n\"devDependencies\": {\n\"@types/chrome\": \"^0.0.60\",\n\"mkdirp\": \"0.5.1\",\n\"opn\": \"4.0.2\",\n\"parse-cache-control\": \"1.0.1\",\n- \"patch-package\": \"^5.1.1\",\n\"raven\": \"^2.2.1\",\n\"rimraf\": \"^2.6.1\",\n- \"robots-parser\": \"^1.0.2\",\n+ \"robots-parser\": \"^2.0.1\",\n\"semver\": \"^5.3.0\",\n\"speedline\": \"1.3.0\",\n\"update-notifier\": \"^2.1.0\",\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "DELETE", "diff": "-patch-package\n---- a/node_modules/robots-parser/Robots.js\n-+++ b/node_modules/robots-parser/Robots.js\n-@@ -1,4 +1,4 @@\n--var libUrl = require('url');\n-+var URL = (typeof self !== 'undefined' && self.URL) || require('url').URL;\n- var punycode = require('punycode');\n-\n- /**\n-@@ -176,7 +176,7 @@ function isPathAllowed(path, rules) {\n-\n-\n- function Robots(url, contents) {\n-- this._url = libUrl.parse(url);\n-+ this._url = new URL(url);\n- this._url.port = this._url.port || 80;\n- this._url.hostname = punycode.toUnicode(this._url.hostname);\n-\n-@@ -262,7 +262,7 @@ Robots.prototype.setPreferredHost = function (url) {\n- * @return {boolean?}\n- */\n- Robots.prototype.isAllowed = function (url, ua) {\n-- var parsedUrl = libUrl.parse(url);\n-+ var parsedUrl = new URL(url);\n- var userAgent = formatUserAgent(ua || '*');\n-\n- parsedUrl.port = parsedUrl.port || 80;\n-@@ -277,7 +277,7 @@ Robots.prototype.isAllowed = function (url, ua) {\n-\n- var rules = this._rules[userAgent] || this._rules['*'] || [];\n-\n-- return isPathAllowed(parsedUrl.path, rules);\n-+ return isPathAllowed(parsedUrl.pathname + parsedUrl.search, rules);\n- };\n-\n- /**\n", "new_path": null, "old_path": "patches/robots-parser+1.0.2.patch" }, { "change_type": "MODIFY", "diff": "@@ -248,12 +248,6 @@ ansi-align@^1.1.0:\ndependencies:\nstring-width \"^1.0.1\"\n-ansi-align@^2.0.0:\n- version \"2.0.0\"\n- resolved \"https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz#c36aeccba563b89ceb556f3690f0b1d9e3547f7f\"\n- dependencies:\n- string-width \"^2.0.0\"\n-\nansi-escapes@^1.1.0:\nversion \"1.4.0\"\nresolved \"https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e\"\n@@ -280,12 +274,6 @@ ansi-styles@^3.1.0:\ndependencies:\ncolor-convert \"^1.9.0\"\n-ansi-styles@^3.2.1:\n- version \"3.2.1\"\n- resolved \"https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d\"\n- dependencies:\n- color-convert \"^1.9.0\"\n-\narchy@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40\"\n@@ -577,18 +565,6 @@ boxen@^1.0.0:\nterm-size \"^0.1.0\"\nwidest-line \"^1.0.0\"\n-boxen@^1.2.1:\n- version \"1.3.0\"\n- resolved \"https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz#55c6c39a8ba58d9c61ad22cd877532deb665a20b\"\n- dependencies:\n- ansi-align \"^2.0.0\"\n- camelcase \"^4.0.0\"\n- chalk \"^2.0.1\"\n- cli-boxes \"^1.0.0\"\n- string-width \"^2.0.0\"\n- term-size \"^1.2.0\"\n- widest-line \"^2.0.0\"\n-\nbrace-expansion@^1.0.0:\nversion \"1.1.6\"\nresolved \"https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.6.tgz#7197d7eaa9b87e648390ea61fc66c84427420df9\"\n@@ -709,14 +685,6 @@ chalk@2.1.0, chalk@^2.0.0, chalk@^2.1.0:\nescape-string-regexp \"^1.0.5\"\nsupports-color \"^4.0.0\"\n-chalk@^2.0.1:\n- version \"2.3.2\"\n- resolved \"https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz#250dc96b07491bfd601e648d66ddf5f60c7a5c65\"\n- dependencies:\n- ansi-styles \"^3.2.1\"\n- escape-string-regexp \"^1.0.5\"\n- supports-color \"^5.3.0\"\n-\nchrome-devtools-frontend@1.0.401423:\nversion \"1.0.401423\"\nresolved \"https://registry.yarnpkg.com/chrome-devtools-frontend/-/chrome-devtools-frontend-1.0.401423.tgz#32a89b8d04e378a494be3c8d63271703be1c04ea\"\n@@ -1103,7 +1071,7 @@ cross-spawn-async@^2.1.1:\nlru-cache \"^4.0.0\"\nwhich \"^1.2.8\"\n-cross-spawn@^5.0.1, cross-spawn@^5.1.0:\n+cross-spawn@^5.1.0:\nversion \"5.1.0\"\nresolved \"https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449\"\ndependencies:\n@@ -1471,18 +1439,6 @@ execa@^0.4.0:\npath-key \"^1.0.0\"\nstrip-eof \"^1.0.0\"\n-execa@^0.7.0:\n- version \"0.7.0\"\n- resolved \"https://registry.npmjs.org/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777\"\n- dependencies:\n- cross-spawn \"^5.0.1\"\n- get-stream \"^3.0.0\"\n- is-stream \"^1.1.0\"\n- npm-run-path \"^2.0.0\"\n- p-finally \"^1.0.0\"\n- signal-exit \"^3.0.0\"\n- strip-eof \"^1.0.0\"\n-\nexit-hook@^1.0.0:\nversion \"1.1.1\"\nresolved \"https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8\"\n@@ -1735,14 +1691,6 @@ fs-extra@^1.0.0:\njsonfile \"^2.1.0\"\nklaw \"^1.0.0\"\n-fs-extra@^4.0.1:\n- version \"4.0.3\"\n- resolved \"https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94\"\n- dependencies:\n- graceful-fs \"^4.1.2\"\n- jsonfile \"^4.0.0\"\n- universalify \"^0.1.0\"\n-\nfs.realpath@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f\"\n@@ -1923,12 +1871,6 @@ glob@~3.1.21:\ninherits \"1\"\nminimatch \"~0.2.11\"\n-global-dirs@^0.1.0:\n- version \"0.1.1\"\n- resolved \"https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445\"\n- dependencies:\n- ini \"^1.3.4\"\n-\nglobal-modules@^0.2.3:\nversion \"0.2.3\"\nresolved \"https://registry.yarnpkg.com/global-modules/-/global-modules-0.2.3.tgz#ea5a3bed42c6d6ce995a4f8a1269b5dae223828d\"\n@@ -2132,10 +2074,6 @@ has-flag@^2.0.0:\nversion \"2.0.0\"\nresolved \"https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51\"\n-has-flag@^3.0.0:\n- version \"3.0.0\"\n- resolved \"https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd\"\n-\nhas-gulplog@^0.1.0:\nversion \"0.1.0\"\nresolved \"https://registry.yarnpkg.com/has-gulplog/-/has-gulplog-0.1.0.tgz#6414c82913697da51590397dafb12f22967811ce\"\n@@ -2207,10 +2145,6 @@ image-ssim@^0.2.0:\nversion \"0.2.0\"\nresolved \"https://registry.yarnpkg.com/image-ssim/-/image-ssim-0.2.0.tgz#83b42c7a2e6e4b85505477fe6917f5dbc56420e5\"\n-import-lazy@^2.1.0:\n- version \"2.1.0\"\n- resolved \"https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43\"\n-\nimurmurhash@^0.1.4:\nversion \"0.1.4\"\nresolved \"https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea\"\n@@ -2353,13 +2287,6 @@ is-glob@^2.0.0, is-glob@^2.0.1:\ndependencies:\nis-extglob \"^1.0.0\"\n-is-installed-globally@^0.1.0:\n- version \"0.1.0\"\n- resolved \"https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz#0dfd98f5a9111716dd535dda6492f67bf3d25a80\"\n- dependencies:\n- global-dirs \"^0.1.0\"\n- is-path-inside \"^1.0.0\"\n-\nis-my-json-valid@^2.12.4:\nversion \"2.15.0\"\nresolved \"https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz#936edda3ca3c211fd98f3b2d3e08da43f7b2915b\"\n@@ -2631,12 +2558,6 @@ jsonfile@^2.1.0:\noptionalDependencies:\ngraceful-fs \"^4.1.6\"\n-jsonfile@^4.0.0:\n- version \"4.0.0\"\n- resolved \"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb\"\n- optionalDependencies:\n- graceful-fs \"^4.1.6\"\n-\njsonify@~0.0.0:\nversion \"0.0.0\"\nresolved \"https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73\"\n@@ -3167,12 +3088,6 @@ npm-run-path@^1.0.0:\ndependencies:\npath-key \"^1.0.0\"\n-npm-run-path@^2.0.0:\n- version \"2.0.2\"\n- resolved \"https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f\"\n- dependencies:\n- path-key \"^2.0.0\"\n-\nnpm-run-posix-or-windows@^2.0.2:\nversion \"2.0.2\"\nresolved \"https://registry.yarnpkg.com/npm-run-posix-or-windows/-/npm-run-posix-or-windows-2.0.2.tgz#74e894702ae34ea338502d04b500c1dec836736e\"\n@@ -3288,10 +3203,6 @@ osenv@^0.1.3:\nos-homedir \"^1.0.0\"\nos-tmpdir \"^1.0.0\"\n-p-finally@^1.0.0:\n- version \"1.0.0\"\n- resolved \"https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae\"\n-\np-limit@^1.1.0:\nversion \"1.1.0\"\nresolved \"https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc\"\n@@ -3352,19 +3263,6 @@ parse5@^1.5.1:\nversion \"1.5.1\"\nresolved \"https://registry.yarnpkg.com/parse5/-/parse5-1.5.1.tgz#9b7f3b0de32be78dc2401b17573ccaf0f6f59d94\"\n-patch-package@^5.1.1:\n- version \"5.1.1\"\n- resolved \"https://registry.npmjs.org/patch-package/-/patch-package-5.1.1.tgz#e5e82fe08bed760b773b8eb73a7bcb7c1634f802\"\n- dependencies:\n- chalk \"^1.1.3\"\n- cross-spawn \"^5.1.0\"\n- fs-extra \"^4.0.1\"\n- minimist \"^1.2.0\"\n- rimraf \"^2.6.1\"\n- slash \"^1.0.0\"\n- tmp \"^0.0.31\"\n- update-notifier \"^2.2.0\"\n-\npath-exists@2.1.0, path-exists@^2.0.0:\nversion \"2.1.0\"\nresolved \"https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b\"\n@@ -3391,10 +3289,6 @@ path-key@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/path-key/-/path-key-1.0.0.tgz#5d53d578019646c0d68800db4e146e6bdc2ac7af\"\n-path-key@^2.0.0:\n- version \"2.0.1\"\n- resolved \"https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40\"\n-\npath-root-regex@^0.1.0:\nversion \"0.1.2\"\nresolved \"https://registry.yarnpkg.com/path-root-regex/-/path-root-regex-0.1.2.tgz#bfccdc8df5b12dc52c8b43ec38d18d72c04ba96d\"\n@@ -3818,9 +3712,9 @@ rimraf@~2.2.6:\nversion \"2.2.8\"\nresolved \"https://registry.yarnpkg.com/rimraf/-/rimraf-2.2.8.tgz#e439be2aaee327321952730f99a8929e4fc50582\"\n-robots-parser@^1.0.2:\n- version \"1.0.2\"\n- resolved \"https://registry.npmjs.org/robots-parser/-/robots-parser-1.0.2.tgz#9ebe25b1a2c52773cbe6f1dbe90ebc9518089009\"\n+robots-parser@^2.0.1:\n+ version \"2.1.0\"\n+ resolved \"https://registry.npmjs.org/robots-parser/-/robots-parser-2.1.0.tgz#d16b78ce34e861ab6afbbf0aac65974dbe01566e\"\nrun-async@^2.2.0:\nversion \"2.3.0\"\n@@ -4144,12 +4038,6 @@ supports-color@^4.0.0:\ndependencies:\nhas-flag \"^2.0.0\"\n-supports-color@^5.3.0:\n- version \"5.3.0\"\n- resolved \"https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz#5b24ac15db80fa927cf5227a4a33fd3c4c7676c0\"\n- dependencies:\n- has-flag \"^3.0.0\"\n-\nsymbol-tree@^3.2.1:\nversion \"3.2.2\"\nresolved \"https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6\"\n@@ -4185,12 +4073,6 @@ term-size@^0.1.0:\ndependencies:\nexeca \"^0.4.0\"\n-term-size@^1.2.0:\n- version \"1.2.0\"\n- resolved \"https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz#458b83887f288fc56d6fffbfad262e26638efa69\"\n- dependencies:\n- execa \"^0.7.0\"\n-\ntext-encoding@0.6.4:\nversion \"0.6.4\"\nresolved \"https://registry.yarnpkg.com/text-encoding/-/text-encoding-0.6.4.tgz#e399a982257a276dae428bb92845cb71bdc26d19\"\n@@ -4252,12 +4134,6 @@ tmp@^0.0.29:\ndependencies:\nos-tmpdir \"~1.0.1\"\n-tmp@^0.0.31:\n- version \"0.0.31\"\n- resolved \"https://registry.npmjs.org/tmp/-/tmp-0.0.31.tgz#8f38ab9438e17315e5dbd8b3657e8bfb277ae4a7\"\n- dependencies:\n- os-tmpdir \"~1.0.1\"\n-\ntmp@^0.0.33:\nversion \"0.0.33\"\nresolved \"https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9\"\n@@ -4347,10 +4223,6 @@ unique-string@^1.0.0:\ndependencies:\ncrypto-random-string \"^1.0.0\"\n-universalify@^0.1.0:\n- version \"0.1.1\"\n- resolved \"https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz#fa71badd4437af4c148841e3b3b165f9e9e590b7\"\n-\nunzip-response@^2.0.1:\nversion \"2.0.1\"\nresolved \"https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97\"\n@@ -4368,20 +4240,6 @@ update-notifier@^2.1.0:\nsemver-diff \"^2.0.0\"\nxdg-basedir \"^3.0.0\"\n-update-notifier@^2.2.0:\n- version \"2.3.0\"\n- resolved \"https://registry.npmjs.org/update-notifier/-/update-notifier-2.3.0.tgz#4e8827a6bb915140ab093559d7014e3ebb837451\"\n- dependencies:\n- boxen \"^1.2.1\"\n- chalk \"^2.0.1\"\n- configstore \"^3.0.0\"\n- import-lazy \"^2.1.0\"\n- is-installed-globally \"^0.1.0\"\n- is-npm \"^1.0.0\"\n- latest-version \"^3.0.0\"\n- semver-diff \"^2.0.0\"\n- xdg-basedir \"^3.0.0\"\n-\nurl-parse-lax@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73\"\n@@ -4542,12 +4400,6 @@ widest-line@^1.0.0:\ndependencies:\nstring-width \"^1.0.1\"\n-widest-line@^2.0.0:\n- version \"2.0.0\"\n- resolved \"https://registry.npmjs.org/widest-line/-/widest-line-2.0.0.tgz#0142a4e8a243f8882c0233aa0e0281aa76152273\"\n- dependencies:\n- string-width \"^2.1.1\"\n-\nwindow-size@0.1.0:\nversion \"0.1.0\"\nresolved \"https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d\"\n", "new_path": "yarn.lock", "old_path": "yarn.lock" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
extension: use browserify url library (#4875) Also bumps robots-parser dependency to 2.0.1
1
extension
null
311,007
29.03.2018 03:05:29
-32,400
539be952ad217be6f6ca55db7be09ccc2bf3634f
fix(generate): change selector for angular rule
[ { "change_type": "MODIFY", "diff": "import { Component, OnInit } from '@angular/core';\n@Component({\n- selector: '<%= kebabCase(name) %>-page',\n+ selector: 'app-page-<%= kebabCase(name) %>',\ntemplateUrl: './<%= kebabCase(name) %>.page.html',\nstyleUrls: ['./<%= kebabCase(name) %>.page.<%= styleext %>'],\n})\n", "new_path": "packages/@ionic/schematics-angular/page/files/__path__/__name@kebabCase@if-flat__/__name@kebabCase__.page.ts", "old_path": "packages/@ionic/schematics-angular/page/files/__path__/__name@kebabCase@if-flat__/__name@kebabCase__.page.ts" } ]
TypeScript
MIT License
ionic-team/ionic-cli
fix(generate): change selector for angular rule (#3031)
1
fix
generate
679,913
29.03.2018 05:02:03
-3,600
943b4f9c8e7be7f4055c9cb44baad4058e9cb699
feat(pointfree): add new words, constructs, aliases, fix re-exports add dotimes() loop construct add obj(), bindkeys() object words add rinc/rdec() r-stack words add sin/cos/atan2/rand/log math ops add vec2/3/4 tuple aliases add API types & comp() to re-exports
[ { "change_type": "MODIFY", "diff": "@@ -510,6 +510,23 @@ export const rswap = _swap(1);\n*/\nexport const rswap2 = _swap2(1);\n+/**\n+ * Like `inc`, but applies to r-stack TOS.\n+ *\n+ * @param ctx\n+ */\n+export const rinc = (ctx: StackContext) =>\n+ ($(ctx[1], 1), ctx[1][ctx[1].length - 1]++ , ctx);\n+\n+/**\n+ * Like `dec`, but applies to r-stack TOS.\n+ *\n+ * @param ctx\n+ */\n+export const rdec = (ctx: StackContext) =>\n+ ($(ctx[1], 1), ctx[1][ctx[1].length - 1]-- , ctx);\n+\n+\n//////////////////// Math ops ////////////////////\n/**\n@@ -598,6 +615,17 @@ export const pow = op2((b, a) => Math.pow(a, b));\n*/\nexport const sqrt = op1(Math.sqrt);\n+export const log = op1(Math.log);\n+\n+export const sin = op1(Math.sin);\n+\n+export const cos = op1(Math.cos);\n+\n+export const atan2 = op2(Math.atan2);\n+\n+export const rand = (ctx: StackContext) =>\n+ (ctx[0].push(Math.random()), ctx);\n+\n/**\n* ( x -- bool )\n*\n@@ -916,6 +944,44 @@ export const loop = (test: StackProc, body: StackProc) => {\n}\n};\n+/**\n+ * Pops TOS and executes given `body` word/quotation `n` times. In each\n+ * iteration pushes current counter on d-stack prior to executing body.\n+ *\n+ * ```\n+ * pf.run([3, pf.dotimes(\"i=\", pf.swap, pf.add, pf.print)])\n+ * // i=0\n+ * // i=1\n+ * // i=2\n+ * ```\n+ *\n+ * With empty body acts as finite range generator 0 .. n:\n+ *\n+ * ```\n+ * // range gen\n+ * pf.run([3, pf.dotimes()])\n+ * [ [ 0, 1, 2 ], [], {} ]\n+ *\n+ * // range gen (as array)\n+ * pf.runU([3, pf.cpdr, pf.dotimes(), pf.movrd, pf.collect])\n+ * // [ 0, 1, 2 ]\n+ * ```\n+ *\n+ * ( n -- ? )\n+ *\n+ * @param body\n+ */\n+export const dotimes = (body: StackProc = []) => {\n+ const w = $stackFn(body);\n+ return (ctx: StackContext) => {\n+ $(ctx[0], 1);\n+ for (let i = 0, n = ctx[0].pop(); i < n; i++) {\n+ ctx[0].push(i);\n+ ctx = w(ctx);\n+ }\n+ return ctx;\n+ };\n+};\n//////////////////// Array / list ops ////////////////////\n@@ -952,6 +1018,17 @@ export const loop = (test: StackProc, body: StackProc) => {\nexport const list = (ctx: StackContext) =>\n(ctx[0].push([]), ctx);\n+/**\n+ * Pushes new empty JS object on d-stack.\n+ * Same reasoning as for `list`.\n+ *\n+ * ( -- {} )\n+ *\n+ * @param ctx\n+ */\n+export const obj = (ctx: StackContext) =>\n+ (ctx[0].push({}), ctx);\n+\n/**\n* Pushes `val` on the LHS of array.\n*\n@@ -1192,6 +1269,10 @@ export const collect = (ctx: StackContext) => {\n*/\nexport const tuple = (n: number | StackFn) => word([n, collect]);\n+export const vec2 = tuple(2);\n+export const vec3 = tuple(3);\n+export const vec4 = tuple(4);\n+\n/**\n* Higher order helper word to convert a TOS tuple/array into a string\n* using `Array.join()` with given `sep`arator.\n@@ -1234,6 +1315,36 @@ export const storeat = (ctx: StackContext) => {\nreturn ctx;\n};\n+//////////////////// Objects ////////////////////\n+\n+/**\n+ * Takes an array of keys and target object, then pops & binds deeper\n+ * stack values to respective keys in object. Pushes result object back\n+ * on stack at the end. Throws error if there're less stack values than\n+ * keys in given array.\n+ *\n+ * ```\n+ * runU([1,2,3, [\"a\",\"b\",\"c\"], {}, bindkeys])\n+ * // { c: 3, b: 2, a: 1 }\n+ * ```\n+ *\n+ * (v1 v2 .. [k1 k2 ..] obj -- obj )\n+ *\n+ * @param ctx\n+ */\n+export const bindkeys = (ctx: StackContext) => {\n+ const stack = ctx[0];\n+ $(stack, 2);\n+ const obj = stack.pop();\n+ const keys = stack.pop();\n+ $(stack, keys.length);\n+ for (let i = keys.length - 1; i >= 0; i--) {\n+ obj[keys[i]] = stack.pop();\n+ }\n+ stack.push(obj);\n+ return ctx;\n+};\n+\n//////////////////// Environment ////////////////////\n/**\n@@ -1313,3 +1424,6 @@ export const printds = (ctx: StackContext) =>\nexport const printrs = (ctx: StackContext) =>\n(console.log(ctx[1]), ctx);\n+\n+export * from \"./api\";\n+export * from \"./comp\";\n", "new_path": "packages/pointfree/src/index.ts", "old_path": "packages/pointfree/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(pointfree): add new words, constructs, aliases, fix re-exports - add dotimes() loop construct - add obj(), bindkeys() object words - add rinc/rdec() r-stack words - add sin/cos/atan2/rand/log math ops - add vec2/3/4 tuple aliases - add API types & comp() to re-exports
1
feat
pointfree
679,913
29.03.2018 05:14:46
-3,600
0baf1f8aa78dccb783056cdef487c61ca7336023
docs(pointfree): update readme & package
[ { "change_type": "MODIFY", "diff": "@@ -45,7 +45,7 @@ inspired DSL:\n- dual stack (main & stash/scratch space)\n- nested execution environments (scopes)\n- arbitrary stack values\n-- quotations (static or dynamically generated programs stored on stack)\n+- nested quotations (static or dynamically generated programs stored on stack)\n- includes ~85 stack operators:\n- conditionals\n- looping constructs\n@@ -172,7 +172,10 @@ tuple and can arbitrarily modify both its stacks and/or environment and\nreturns the updated context (usually the same instance as passed in, but\ncould also produce a new one). Any side effects are allowed.\n-A `StackProgram` is an array of stack functions and non-function values. The latter are replaced by calls to `push` which pushes the given value on the stack as is. Therefore, a stack program like: `[1, 2, pf.add]` compiles to:\n+A `StackProgram` is an array of stack functions and non-function values.\n+The latter are replaced by calls to `push` which pushes the given value\n+on the stack as is. Therefore, a stack program like: `[1, 2, pf.add]`\n+compiles to:\n```\npf.add(pf.push(2)(pf.push(1)(<initial context>)))\n@@ -190,7 +193,8 @@ approach to document the effect a word has on the stack structure.\nThe items in front of the `--` describe the relevant state of the stack\nbefore the execution of a word (the args expected/consumed by the word).\nThe part after the `--` is the state of the stack after execution (the\n-results). If no args are given on the LHS, the word consumes no args. If no args are given on the RHS, no result values are produced.\n+results). If no args are given on the LHS, the word consumes no args. If\n+no args are given on the RHS, no result values are produced.\n(Note: **TOS** = Top Of Stack)\n@@ -284,7 +288,8 @@ A `StackProgram` residing as data on the stack is called a quotation.\nQuoatations enable a form of dynamic meta programming and are used by\nseveral built-in words. Quoations are used like lambdas / anonymous\nfunctions in traditional functional programming, though **they're not\n-closures**. Quotations are executed via `execq`.\n+closures** nor do they need to be complete. Quotations can be nested and\n+are executed via `execq`.\nThis example uses a quoted form of the above `pow2` word:\n@@ -370,9 +375,16 @@ pf.runE(\n### Array transformations\n-The DSL includes several array transforming words and constructs, incl. array/vector math ops, splitting, deconstructing, push/pull (both LHS/RHS) and the `mapl` & `mapll` words, both of which act as generalization for `map`, `filter`, `mapcat` and `reduce`. The only difference between `mapl` and `mapll` is that the former does **not** produce a result array (only flat results pushed on stack), whereas `mapll` always produces a new array.\n+The DSL includes several array transforming words and constructs, incl.\n+array/vector math ops, splitting, deconstructing, push/pull (both\n+LHS/RHS) and the `mapl` & `mapll` words, both of which act as\n+generalization for `map`, `filter`, `mapcat` and `reduce`. The only\n+difference between `mapl` and `mapll` is that the former does **not**\n+produce a result array (only flat results pushed on stack), whereas\n+`mapll` always produces a new array.\n-`mapl` takes an array and a quotation. Loops over array, pushes each value on the stack and applies quotation for each.\n+`mapl` takes an array and a quotation. Loops over array, pushes each\n+value on the stack and applies quotation for each.\n```typescript\n// multiply each array item * 10\n@@ -394,6 +406,20 @@ pf.runU([[1, 2, 3, 4], [pf.add], 0, pf.foldl])\n// 10\n```\n+#### Bind stack values to object keys\n+\n+`bindkeys` takes an array of keys and target object, then pops & binds\n+deeper stack values to their respective keys in object. Pushes result\n+object back on stack at the end. Throws error if there're less stack\n+values than keys in given array.\n+\n+```typescript\n+runU([1,2,3, [\"a\",\"b\",\"c\"], {}, bindkeys])\n+// { c: 3, b: 2, a: 1 }\n+```\n+\n+#### Combine array transform op with other stack values\n+\n```typescript\n// helper word to extract a 8bit range from a 32bit int\n// ( x s -- x (x>>s)&0xff )\n@@ -411,7 +437,6 @@ const extractByte = pf.word([\nconst splitBytes = pf.word([[24, 16, 8, 0], [extractByte, pf.swap], pf.mapl, pf.drop]);\n// decompose the number 0xdecafbad into 4 bytes\n-// the array defines the bitshift offsets for each byte\nsplitBytes([[0xdecafbad]]);\n// [ [ 222, 202, 251, 173 ] ]\n// in hex: [ [ 0xde, 0xca, 0xfb, 0xad ] ]\n@@ -480,6 +505,16 @@ pf.run(\n// [ [ 0 ] ]\n```\n+Alternatively, the `dotimes` construct is more suitable for simple\n+counter based iterations:\n+\n+```typescript\n+pf.run([3, pf.dotimes([\"i=\", pf.swap, pf.add, pf.print])])\n+// i=0\n+// i=1\n+// i=2\n+```\n+\n### In-place stack value transformation\nThe `maptos()`, `map2()` higher order words can be used to transform\n@@ -496,7 +531,10 @@ stack items in place using vanilla JS functions:\n### R-stack usage\n-The second stack (\"R-stack\") is useful to store interim processing state without having to resort to complex stack shuffling ops. There're several words available for moving data between main (\"D-stack\") and the r-stack and to manipulate the structure of the R-stack itself.\n+The second stack (\"R-stack\") is useful to store interim processing state\n+without having to resort to complex stack shuffling ops. There're\n+several words available for moving data between main (\"D-stack\") and the\n+r-stack and to manipulate the structure of the R-stack itself.\n```typescript\n// this example partitions the main stack into triples\n@@ -546,13 +584,13 @@ pf.runU([\n// [ [ 1, 2 ], [ 3, 4, 5 ], [ 6, 7, 8 ] ]\n```\n-\nTODO more examples forthcoming\n## Core vocabulary\nBy default, each word checks for stack underflow and throws an error if\n-there are insufficient values on the stack. These checks can be disabled by calling `pf.safeMode(false)`.\n+there are insufficient values on the stack. These checks can be disabled\n+by calling `pf.safeMode(false)`.\nNote: Some of the words are higher-order functions, accepting arguments\nat word construction time and return a pre-configured stack function.\n@@ -617,8 +655,13 @@ at word construction time and return a pre-configured stack function.\n| `odd` | `( x -- bool )` | true, if `x` is odd |\n| `min` | `( x y -- min(x, y) )` |\n| `max` | `( x y -- max(x, y) )` |\n+| `log` | `( x -- log(x) )` |\n| `pow` | `( x y -- pow(x, y) )` |\n+| `rand` | `( -- Math.random() )` |\n| `sqrt` | `( x -- sqrt(x) )` |\n+| `sin` | `( x -- sin(x) )` |\n+| `cos` | `( x -- cos(x) )` |\n+| `atan2` | `( x y -- atan2(y, x) )` |\n| `lsl` | `( x y -- x<<y )` |\n| `lsr` | `( x y -- x>>y )` |\n| `lsru` | `( x y -- x>>>y )` |\n@@ -661,12 +704,14 @@ at word construction time and return a pre-configured stack function.\n| Word | Stack effect | Description |\n| --- | --- | --- |\n| `at` | `( obj k -- obj[k] )` | `obj` can be array/obj/string |\n+| `bindkeys` | `(v1 v2 .. [k1 k2 ..] obj -- obj )` | bind key/value pairs in `obj` |\n| `collect` | `( ... n -- [...] )` | tuple of top `n` vals |\n| `foldl` | `( arr q init -- x )` | like `mapl`, but w/ `init` val for reduction |\n| `length` | `( x -- x.length )` | length of arraylike |\n+| `list` | `( -- [] )` | create new empty array |\n| `mapl` | `( arr q -- ? )` | transform array w/ quotation (no explicit result array) |\n| `mapll` | `( arr q -- ? )` | transform array w/ quotation |\n-| `storeAt` | `( val obj k -- )` | `obj` can be array/obj |\n+| `obj` | `( -- {} )` | create new empty object |\n| `pushl` | `( x arr -- arr )` | push `x` on LHS of array |\n| `pushr` | `( arr x -- arr )` | push `x` on RHS of array |\n| `popr` | `( arr -- arr arr[-1] )` | extract RHS of array as new TOS |\n@@ -675,19 +720,24 @@ at word construction time and return a pre-configured stack function.\n| `pull3` | `( arr -- x y z arr )` | short for: `[pull2, pull]` |\n| `pull4` | `( arr -- a b c d arr )` | short for: `[pull2, pull2]` |\n| `split` | `( arr x -- [...] [...] )` | split array at index `x` |\n+| `storeat` | `( val obj k -- )` | `obj` can be array/obj |\n| `tuple(n)` | `( ... -- [...] )` | HOF, like `collect`, but w/ predefined size |\n+| `vec2` | `( x y -- [x, y] )` | same as `tuple(2)` |\n+| `vec3` | `( x y z -- [x, y, z] )` | same as `tuple(3)` |\n+| `vec4` | `( x y z w -- [x, y, z, w] )` | same as `tuple(4)` |\n| `vadd` | `( a b -- c )` | add 2 arrays (or array + scalar) |\n| `vsub` | `( a b -- c )` | subtract 2 arrays (or array + scalar) |\n| `vmul` | `( a b -- c )` | multiply 2 arrays (or array + scalar) |\n| `vdiv` | `( a b -- c )` | divide 2 arrays (or array + scalar) |\n| `op2v(f)` | `( a b -- c )` | HOF word gen, e.g. `vadd` is based on |\n+\n### I/O\n| Word | Stack effect | Description |\n| --- | --- | --- |\n| `print` | `( x -- )` | `console.log(x)` |\n| `printds` | `( -- )` | print out D-stack |\n-| `printrs` | `( -- )` | print out R-stack\n+| `printrs` | `( -- )` | print out R-stack |\n### Control flow\n@@ -716,6 +766,12 @@ the stack before execution.\nTakes a `test` and `body` stack program. Applies test to TOS and\nexecutes body. Repeats while test is truthy.\n+#### `dotimes(body: StackProc = [])`\n+\n+Pops TOS and executes given `body` word/quotation `n` times. In each\n+iteration pushes current counter on d-stack prior to executing body.\n+With empty body acts as finite range generator 0 .. n.\n+\n### Word creation and execution\n#### `word(prog: StackProgram, env?: StackEnv, mergeEnv = false)`\n", "new_path": "packages/pointfree/README.md", "old_path": "packages/pointfree/README.md" }, { "change_type": "MODIFY", "diff": "\"Forth\",\n\"functional\",\n\"pipeline\",\n+ \"pointfree\",\n\"stack\",\n\"data transformation\",\n\"typescript\"\n", "new_path": "packages/pointfree/package.json", "old_path": "packages/pointfree/package.json" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
docs(pointfree): update readme & package
1
docs
pointfree
679,913
29.03.2018 05:15:21
-3,600
6cbacec75794003a935b065ab9cff84bb36c19a6
feat(hdom-components): add svg line()
[ { "change_type": "MODIFY", "diff": "@@ -43,6 +43,17 @@ export const rect = (p: ArrayLike<number>, width = 1, height = 1, attr?) =>\n}, attr)\n];\n+export const line = (a: ArrayLike<number>, b: ArrayLike<number>, attr?) =>\n+ [\n+ \"line\",\n+ Object.assign({\n+ x1: ff(a[0]),\n+ y1: ff(a[1]),\n+ x2: ff(b[0]),\n+ y2: ff(b[1]),\n+ }, attr)\n+ ];\n+\nexport const polyline = (points: ArrayLike<number>[], attr?) =>\n[\n\"polyline\",\n", "new_path": "packages/hdom-components/src/svg.ts", "old_path": "packages/hdom-components/src/svg.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(hdom-components): add svg line()
1
feat
hdom-components
815,746
29.03.2018 08:09:09
-10,800
c75595dba06e9365557254d3bcdc4426118c8965
feat: auto position dropdown by default fixes fixes fixes
[ { "change_type": "MODIFY", "diff": "@@ -130,7 +130,7 @@ map: {\n| closeOnSelect | `boolean` | true | no | Whether to close the menu when a value is selected |\n| [clearable] | `boolean` | `true` | no | Allow to clear selected value. Default `true`|\n| clearAllText | `string` | `Clear all` | no | Set custom text for clear all icon title |\n-| dropdownPosition | `bottom`,`top`,`auto` | `bottom` | no | Set the dropdown position on open |\n+| dropdownPosition | `bottom`,`top`,`auto` | `auto` | no | Set the dropdown position on open |\n| [groupBy] | `string` \\| `Function` | null | no | Allow to group items by key or function expression |\n| [selectableGroup] | `boolean` | false | no | Allow to select group when groupBy is used |\n| [items] | `Array<NgOption>` | `[]` | yes | Items array |\n", "new_path": "README.md", "old_path": "README.md" }, { "change_type": "MODIFY", "diff": "@@ -5,38 +5,20 @@ import { Component, ChangeDetectionStrategy } from '@angular/core';\nchangeDetection: ChangeDetectionStrategy.Default,\ntemplate: `\n<p>\n- By default the dropdown is displayed below the ng-select.\n- You can change the default position by setting dropdownPosition to top or bottom.\n+ By default the dropdown position is set to auto and will be shown above if there is not space placing it at the bottom.\n</p>\n---html,true\n- <ng-select [dropdownPosition]=\"dropdownPosition\"\n- [searchable]=\"false\"\n- [items]=\"cities\">\n+ <ng-select [items]=\"cities\">\n</ng-select>\n---\n-\n- <br>\n-\n- <label>\n- <input [(ngModel)]=\"dropdownPosition\" type=\"radio\" [value]=\"'top'\">\n- top\n- </label>\n- <br>\n-\n- <label>\n- <input [(ngModel)]=\"dropdownPosition\" type=\"radio\" [value]=\"'bottom'\">\n- bottom\n- </label>\n-\n<hr>\n<p>\n- Using \"Auto\" it still defaults to bottom, but if the dropdown would be out of view,\n- it will automatically change the dropdownPosition to top.\n+ You can change force position to always to bottom or top by setting <b>dropdownPosition</b>\n</p>\n---html,true\n- <ng-select [dropdownPosition]=\"'auto'\"\n+ <ng-select [dropdownPosition]=\"'top'\"\n[searchable]=\"false\"\n[items]=\"cities\">\n</ng-select>\n", "new_path": "demo/app/examples/dropdown-positions.component.ts", "old_path": "demo/app/examples/dropdown-positions.component.ts" }, { "change_type": "MODIFY", "diff": ".ng-dropdown-panel {\nbox-sizing: border-box;\nposition: absolute;\n+ opacity: 0;\nwidth: 100%;\nz-index: 1050;\n-webkit-overflow-scrolling: touch;\n", "new_path": "src/ng-select/ng-dropdown-panel.component.scss", "old_path": "src/ng-select/ng-dropdown-panel.component.scss" }, { "change_type": "MODIFY", "diff": "@@ -14,6 +14,9 @@ import {\nInject,\nViewEncapsulation,\nChangeDetectionStrategy,\n+ AfterContentInit,\n+ OnInit,\n+ OnChanges\n} from '@angular/core';\nimport { NgOption } from './ng-select.types';\n@@ -22,6 +25,9 @@ import { ItemsList } from './items-list';\nimport { WindowService } from './window.service';\nimport { VirtualScrollService } from './virtual-scroll.service';\n+const TOP_CSS_CLASS = 'top';\n+const BOTTOM_CSS_CLASS = 'bottom';\n+\n@Component({\nchangeDetection: ChangeDetectionStrategy.OnPush,\nencapsulation: ViewEncapsulation.None,\n@@ -40,16 +46,12 @@ import { VirtualScrollService } from './virtual-scroll.service';\n<ng-container [ngTemplateOutlet]=\"footerTemplate\"></ng-container>\n</div>\n`,\n- styleUrls: ['./ng-dropdown-panel.component.scss'],\n- host: {\n- '[class.top]': 'currentPosition === \"top\"',\n- '[class.bottom]': 'currentPosition === \"bottom\"',\n- }\n+ styleUrls: ['./ng-dropdown-panel.component.scss']\n})\n-export class NgDropdownPanelComponent implements OnDestroy {\n+export class NgDropdownPanelComponent implements OnInit, OnChanges, OnDestroy, AfterContentInit {\n@Input() items: NgOption[] = [];\n- @Input() position: DropdownPosition;\n+ @Input() position: DropdownPosition = 'auto';\n@Input() appendTo: string;\n@Input() bufferAmount = 4;\n@Input() virtualScroll = false;\n@@ -58,14 +60,11 @@ export class NgDropdownPanelComponent implements OnDestroy {\n@Output() update = new EventEmitter<any[]>();\n@Output() scrollToEnd = new EventEmitter<{ start: number; end: number }>();\n- @Output() positionChange = new EventEmitter();\n@ViewChild('content', { read: ElementRef }) contentElementRef: ElementRef;\n@ViewChild('scroll', { read: ElementRef }) scrollElementRef: ElementRef;\n@ViewChild('padding', { read: ElementRef }) paddingElementRef: ElementRef;\n- currentPosition: DropdownPosition = 'bottom';\n-\nprivate _selectElementRef: ElementRef;\nprivate _previousStart: number;\nprivate _previousEnd: number;\n@@ -73,6 +72,7 @@ export class NgDropdownPanelComponent implements OnDestroy {\nprivate _isScrolledToMarked = false;\nprivate _scrollToEndFired = false;\nprivate _itemsList: ItemsList;\n+ private _currentPosition: 'bottom' | 'top';\nprivate _disposeScrollListener = () => { };\nprivate _disposeDocumentResizeListener = () => { };\n@@ -90,22 +90,9 @@ export class NgDropdownPanelComponent implements OnDestroy {\nngOnInit() {\nthis._handleScroll();\n- if (this.appendTo) {\n- this._handleAppendTo();\n- }\n}\nngOnChanges(changes: SimpleChanges) {\n- if (changes.position && changes.position.currentValue) {\n- this.currentPosition = changes.position.currentValue;\n- if (this.currentPosition === 'auto') {\n- this._autoPositionDropdown();\n- }\n- if (this.appendTo) {\n- this._updateDropdownPosition();\n- }\n- }\n-\nif (changes.items) {\nthis._handleItemsChange(changes.items);\n}\n@@ -119,10 +106,20 @@ export class NgDropdownPanelComponent implements OnDestroy {\n}\n}\n- refresh() {\n+ ngAfterContentInit() {\n+ this._whenContentReady().then(() => {\n+ this._handleDropdownPosition();\n+ });\n+ }\n+\n+ refresh(): Promise<void> {\n+ return new Promise((resolve) => {\nthis._zone.runOutsideAngular(() => {\n- this._window.requestAnimationFrame(() => this._updateItems());\n+ this._window.requestAnimationFrame(() => {\n+ this._updateItems().then(resolve);\n+ });\n});\n+ })\n}\nscrollInto(item: NgOption) {\n@@ -168,10 +165,14 @@ export class NgDropdownPanelComponent implements OnDestroy {\nthis._startupLoop = true;\n}\nthis.items = items.currentValue || [];\n- this.refresh();\n+ this.refresh().then(() => {\n+ if (this.appendTo && this._currentPosition === 'top') {\n+ this._updateAppendedDropdownPosition();\n+ }\n+ });\n}\n- private _updateItems(): void {\n+ private _updateItems(): Promise<void> {\nNgZone.assertNotInAngularZone();\nif (!this.virtualScroll) {\n@@ -179,10 +180,10 @@ export class NgDropdownPanelComponent implements OnDestroy {\nthis.update.emit(this.items.slice());\nthis._scrollToMarked();\n});\n- return;\n+ return Promise.resolve();\n}\n- const loop = () => {\n+ const loop = (resolve) => {\nconst d = this._calculateDimensions();\nconst res = this._virtualScrollService.calculateItems(d, this.scrollElementRef.nativeElement, this.bufferAmount || 0);\n@@ -198,17 +199,16 @@ export class NgDropdownPanelComponent implements OnDestroy {\nthis._previousEnd = res.end;\nif (this._startupLoop === true) {\n- loop()\n+ loop(resolve)\n}\n} else if (this._startupLoop === true) {\nthis._startupLoop = false;\nthis._scrollToMarked();\n- return\n+ resolve();\n}\n};\n-\n- loop();\n+ return new Promise((resolve) => loop(resolve))\n}\nprivate _fireScrollToEnd() {\n@@ -241,7 +241,7 @@ export class NgDropdownPanelComponent implements OnDestroy {\nreturn;\n}\nthis._disposeDocumentResizeListener = this._renderer.listen('window', 'resize', () => {\n- this._updateDropdownPosition();\n+ this._updateAppendedDropdownPosition();\n});\n}\n@@ -254,47 +254,87 @@ export class NgDropdownPanelComponent implements OnDestroy {\nthis.scrollInto(this._itemsList.markedItem)\n}\n- private _handleAppendTo() {\n+ private _handleDropdownPosition() {\n+ if (this.appendTo) {\n+ this._appendDropdown();\n+ this._handleDocumentResize();\n+ }\n+\n+ const dropdownEl: HTMLElement = this._elementRef.nativeElement;\n+ this._currentPosition = this._calculateCurrentPosition(dropdownEl);\n+ const selectEl: HTMLElement = this._selectElementRef.nativeElement;\n+ if (this._currentPosition === 'top') {\n+ this._renderer.addClass(dropdownEl, TOP_CSS_CLASS)\n+ this._renderer.removeClass(dropdownEl, BOTTOM_CSS_CLASS)\n+ this._renderer.addClass(selectEl, TOP_CSS_CLASS)\n+ this._renderer.removeClass(selectEl, BOTTOM_CSS_CLASS)\n+ } else {\n+ this._renderer.addClass(dropdownEl, BOTTOM_CSS_CLASS)\n+ this._renderer.removeClass(dropdownEl, TOP_CSS_CLASS)\n+ this._renderer.addClass(selectEl, BOTTOM_CSS_CLASS)\n+ this._renderer.removeClass(selectEl, TOP_CSS_CLASS)\n+ }\n+\n+ if (this.appendTo) {\n+ this._updateAppendedDropdownPosition();\n+ }\n+\n+ dropdownEl.style.opacity = '1';\n+ }\n+\n+ private _calculateCurrentPosition(dropdownEl: HTMLElement) {\n+ if (this.position !== 'auto') {\n+ return this.position;\n+ }\n+ const selectRect: ClientRect = this._selectElementRef.nativeElement.getBoundingClientRect();\n+ const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;\n+ const offsetTop = selectRect.top + window.pageYOffset;\n+ const height = selectRect.height;\n+ const dropdownHeight = dropdownEl.getBoundingClientRect().height;\n+ if (offsetTop + height + dropdownHeight > scrollTop + document.documentElement.clientHeight) {\n+ return 'top';\n+ } else {\n+ return 'bottom';\n+ }\n+ }\n+\n+ private _appendDropdown() {\nconst parent = document.querySelector(this.appendTo);\nif (!parent) {\nthrow new Error(`appendTo selector ${this.appendTo} did not found any parent element`)\n}\n- this._updateDropdownPosition();\nparent.appendChild(this._elementRef.nativeElement);\n- this._handleDocumentResize();\n}\n- private _updateDropdownPosition() {\n+ private _updateAppendedDropdownPosition() {\nconst parent = document.querySelector(this.appendTo) || document.body;\nconst selectRect: ClientRect = this._selectElementRef.nativeElement.getBoundingClientRect();\nconst dropdownPanel: HTMLElement = this._elementRef.nativeElement;\nconst boundingRect = parent.getBoundingClientRect();\nconst offsetTop = selectRect.top - boundingRect.top;\nconst offsetLeft = selectRect.left - boundingRect.left;\n- const topDelta = this.currentPosition === 'bottom' ? selectRect.height : -dropdownPanel.clientHeight;\n+ const topDelta = this._currentPosition === 'bottom' ? selectRect.height : -dropdownPanel.clientHeight;\ndropdownPanel.style.top = offsetTop + topDelta + 'px';\ndropdownPanel.style.bottom = 'auto';\ndropdownPanel.style.left = offsetLeft + 'px';\ndropdownPanel.style.width = selectRect.width + 'px';\n}\n- private _autoPositionDropdown() {\n- const ngOption = this._elementRef.nativeElement.querySelector('.ng-option');\n- if (this.items.length > 0 && !ngOption) {\n- setTimeout(() => { this._autoPositionDropdown(); }, 50);\n- return;\n+ private _whenContentReady(): Promise<void> {\n+ if (this.items.length === 0) {\n+ return Promise.resolve();\n}\n-\n- const selectRect: ClientRect = this._selectElementRef.nativeElement.getBoundingClientRect();\n- const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;\n- const offsetTop = selectRect.top + window.pageYOffset;\n- const height = selectRect.height;\n- const dropdownHeight = this._elementRef.nativeElement.getBoundingClientRect().height;\n- if (offsetTop + height + dropdownHeight > scrollTop + document.documentElement.clientHeight) {\n- this.currentPosition = 'top';\n- } else {\n- this.currentPosition = 'bottom';\n+ const dropdownEl: HTMLElement = this._elementRef.nativeElement;\n+ const ready = (resolve) => {\n+ const ngOption = dropdownEl.querySelector('.ng-option');\n+ if (ngOption) {\n+ resolve();\n+ return;\n}\n- this.positionChange.emit(this.currentPosition);\n+ this._zone.runOutsideAngular(() => {\n+ setTimeout(() => ready(resolve), 5);\n+ });\n+ };\n+ return new Promise((resolve) => ready(resolve))\n}\n}\n", "new_path": "src/ng-select/ng-dropdown-panel.component.ts", "old_path": "src/ng-select/ng-dropdown-panel.component.ts" }, { "change_type": "MODIFY", "diff": "[footerTemplate]=\"footerTemplate\"\n[items]=\"itemsList.filteredItems\"\n(update)=\"viewPortItems = $event\"\n- (positionChange)=\"currentDropdownPosition = $event\"\n(scrollToEnd)=\"scrollToEnd.emit($event)\"\n[ngClass]=\"{'multiple': multiple}\">\n", "new_path": "src/ng-select/ng-select.component.html", "old_path": "src/ng-select/ng-select.component.html" }, { "change_type": "MODIFY", "diff": "@@ -556,7 +556,7 @@ describe('NgSelectComponent', function () {\ntickAndDetectChanges(fixture);\ntickAndDetectChanges(fixture);\n- const classes = ['ng-select', 'bottom', 'ng-single', 'searchable', 'ng-untouched', 'ng-pristine', 'ng-valid'];\n+ const classes = ['ng-select', 'ng-single', 'searchable', 'ng-untouched', 'ng-pristine', 'ng-valid'];\nconst selectEl = fixture.nativeElement.querySelector('ng-select');\nfor (const c of classes) {\nexpect(selectEl.classList.contains(c)).toBeTruthy(`expected to contain \"${c}\" class`);\n@@ -1086,47 +1086,58 @@ describe('NgSelectComponent', function () {\n});\ndescribe('Dropdown position', () => {\n- it('should be set to `bottom` by default', fakeAsync(() => {\n+ it('should autoposition dropdown to bottom by default', fakeAsync(() => {\nconst fixture = createTestingModule(\nNgSelectTestCmp,\n- `<ng-select id=\"select\"></ng-select>`);\n+ `<ng-select [items]=\"cities\"></ng-select>`);\n- const classes = fixture.debugElement.query(By.css('ng-select')).classes;\n- expect(classes.bottom).toBeTruthy();\n- expect(classes.top).toBeFalsy();\n+ const select = fixture.componentInstance.select;\n+ select.open();\n+ tickAndDetectChanges(fixture);\n+\n+ const selectClasses = (<HTMLElement>fixture.nativeElement).querySelector('.ng-select').classList;\n+ const panelClasses = (<HTMLElement>fixture.nativeElement).querySelector('.ng-dropdown-panel').classList;\n+ expect(select.dropdownPosition).toBe('auto');\n+ expect(selectClasses.contains('bottom')).toBeTruthy();\n+ expect(panelClasses.contains('bottom')).toBeTruthy();\n+ expect(selectClasses.contains('top')).toBeFalsy();\n+ expect(panelClasses.contains('top')).toBeFalsy();\n}));\n- it('should allow changing dropdown position to top', fakeAsync(() => {\n+ it('should autoposition dropdown to top if position input is set', fakeAsync(() => {\nconst fixture = createTestingModule(\nNgSelectTestCmp,\n- `<ng-select id=\"select\" [dropdownPosition]=\"dropdownPosition\"></ng-select>`);\n+ `<ng-select dropdownPosition=\"top\" [items]=\"cities\"></ng-select>`);\n- fixture.componentInstance.dropdownPosition = 'top';\n- tickAndDetectChanges(fixture);\n-\n- fixture.componentInstance.select.open();\n+ const select = fixture.componentInstance.select;\n+ select.open();\ntickAndDetectChanges(fixture);\n-\n- const classes = fixture.debugElement.query(By.css('ng-select')).classes;\n- expect(classes.bottom).toBeFalsy();\n- expect(classes.top).toBeTruthy();\n+ const selectClasses = (<HTMLElement>fixture.nativeElement).querySelector('.ng-select').classList;\n+ const panelClasses = (<HTMLElement>fixture.nativeElement).querySelector('.ng-dropdown-panel').classList;\n+ expect(select.dropdownPosition).toBe('top');\n+ expect(selectClasses.contains('bottom')).toBeFalsy();\n+ expect(panelClasses.contains('bottom')).toBeFalsy();\n+ expect(selectClasses.contains('top')).toBeTruthy();\n+ expect(panelClasses.contains('top')).toBeTruthy();\n}));\n- it('should allow changing dropdown position to auto', fakeAsync(() => {\n+ it('should autoposition appended to body dropdown to bottom', fakeAsync(() => {\nconst fixture = createTestingModule(\nNgSelectTestCmp,\n- `<ng-select id=\"select\" [dropdownPosition]=\"dropdownPosition\"></ng-select>`);\n-\n- fixture.componentInstance.dropdownPosition = 'auto';\n- tickAndDetectChanges(fixture);\n+ `<ng-select [items]=\"cities\" appendTo=\"body\"></ng-select>`);\n- fixture.componentInstance.select.open();\n+ const select = fixture.componentInstance.select;\n+ select.open();\ntickAndDetectChanges(fixture);\n- const classes = fixture.debugElement.query(By.css('ng-select')).classes;\n- expect(classes.bottom).toBeTruthy()\n- expect(classes.top).toBeFalsy();\n+ const selectClasses = (<HTMLElement>fixture.nativeElement).querySelector('.ng-select').classList;\n+ const panelClasses = document.querySelector('.ng-dropdown-panel').classList;\n+ expect(select.dropdownPosition).toBe('auto');\n+ expect(selectClasses.contains('bottom')).toBeTruthy();\n+ expect(panelClasses.contains('bottom')).toBeTruthy();\n+ expect(selectClasses.contains('top')).toBeFalsy();\n+ expect(panelClasses.contains('top')).toBeFalsy();\n}));\n});\n", "new_path": "src/ng-select/ng-select.component.spec.ts", "old_path": "src/ng-select/ng-select.component.spec.ts" }, { "change_type": "MODIFY", "diff": "@@ -64,8 +64,6 @@ export type AddTagFn = ((term: string) => any | Promise<any>);\nhost: {\n'role': 'dropdown',\n'class': 'ng-select',\n- '[class.top]': 'currentDropdownPosition === \"top\"',\n- '[class.bottom]': 'currentDropdownPosition === \"bottom\"',\n'[class.ng-single]': '!multiple',\n}\n})\n@@ -83,7 +81,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n@Input() addTagText: string;\n@Input() loadingText: string;\n@Input() clearAllText: string;\n- @Input() dropdownPosition: DropdownPosition;\n+ @Input() dropdownPosition: DropdownPosition = 'auto';\n@Input() appendTo: string;\n@Input() loading = false;\n@Input() closeOnSelect = true;\n@@ -133,7 +131,6 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nitemsList = new ItemsList(this);\nviewPortItems: NgOption[] = [];\nfilterValue: string = null;\n- currentDropdownPosition: DropdownPosition = 'bottom';\nprivate _defaultLabel = 'label';\nprivate _defaultValue = 'value';\n@@ -180,9 +177,6 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nif (changes.items) {\nthis._setItems(changes.items.currentValue || []);\n}\n- if (changes.dropdownPosition) {\n- this.currentDropdownPosition = changes.dropdownPosition.currentValue;\n- }\n}\nngAfterViewInit() {\n", "new_path": "src/ng-select/ng-select.component.ts", "old_path": "src/ng-select/ng-select.component.ts" }, { "change_type": "MODIFY", "diff": "@@ -76,7 +76,7 @@ $color-selected: #f5faff;\nbackground-color: #f9f9f9;\nborder: 1px solid #e3e3e3;\n.ng-value-label {\n- padding: 2px 5px;\n+ padding: 0px 5px;\n}\n}\n}\n@@ -97,11 +97,11 @@ $color-selected: #f5faff;\n}\n.ng-value-label {\ndisplay: inline-block;\n- padding: 2px 5px 2px 1px;\n+ padding: 0px 5px 0px 1px;\n}\n.ng-value-icon {\ndisplay: inline-block;\n- padding: 3px 5px;\n+ padding: 0px 5px;\n&:hover {\nbackground-color: #d8eafd;\n}\n", "new_path": "src/themes/default.theme.scss", "old_path": "src/themes/default.theme.scss" } ]
TypeScript
MIT License
ng-select/ng-select
feat: auto position dropdown by default (#382) fixes #367 fixes #256 fixes #306
1
feat
null
815,746
29.03.2018 08:11:10
-10,800
dd7e035903b57f4744a9fb8ab35d866427e1d5c7
chore(release): 0.32.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.32.0\"></a>\n+# [0.32.0](https://github.com/ng-select/ng-select/compare/v0.31.1...v0.32.0) (2018-03-29)\n+\n+\n+### Features\n+\n+* auto position dropdown by default ([#382](https://github.com/ng-select/ng-select/issues/382)) ([c75595d](https://github.com/ng-select/ng-select/commit/c75595d)), closes [#367](https://github.com/ng-select/ng-select/issues/367) [#256](https://github.com/ng-select/ng-select/issues/256) [#306](https://github.com/ng-select/ng-select/issues/306)\n+\n+\n+\n<a name=\"0.31.1\"></a>\n## [0.31.1](https://github.com/ng-select/ng-select/compare/v0.31.0...v0.31.1) (2018-03-27)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"$schema\": \"../node_modules/ng-packagr/package.schema.json\",\n\"name\": \"@ng-select/ng-select\",\n- \"version\": \"0.31.1\",\n+ \"version\": \"0.32.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.32.0
1
chore
release
730,429
29.03.2018 11:34:22
14,400
8271005a9132b1cdcefe0034ae901046521b8c4a
fix(journeys): removing phone plugin from tests plugin isn't needed during node tests and causes webrtc errors
[ { "change_type": "MODIFY", "diff": "import testUsers from '@ciscospark/test-helper-test-users';\n-import '@ciscospark/plugin-phone';\nimport {switchToMeet} from '../../../lib/test-helpers/space-widget/main';\nimport {elements, hangupBeforeAnswerTest, declineIncomingCallTest, hangupDuringCallTest} from '../../../lib/test-helpers/space-widget/meet';\n", "new_path": "test/journeys/specs/oneOnOne/dataApi/meet.js", "old_path": "test/journeys/specs/oneOnOne/dataApi/meet.js" }, { "change_type": "MODIFY", "diff": "import testUsers from '@ciscospark/test-helper-test-users';\n-import '@ciscospark/plugin-phone';\nimport {switchToMeet} from '../../../lib/test-helpers/space-widget/main';\nimport {clearEventLog} from '../../../lib/events';\n", "new_path": "test/journeys/specs/oneOnOne/global/meet.js", "old_path": "test/journeys/specs/oneOnOne/global/meet.js" }, { "change_type": "MODIFY", "diff": "@@ -2,7 +2,6 @@ import {assert} from 'chai';\nimport testUsers from '@ciscospark/test-helper-test-users';\nimport '@ciscospark/plugin-logger';\n-import '@ciscospark/plugin-phone';\nimport '@ciscospark/internal-plugin-feature';\nimport CiscoSpark from '@ciscospark/spark-core';\nimport '@ciscospark/internal-plugin-conversation';\n@@ -82,7 +81,7 @@ describe('Widget Recents', () => {\n}\n}\n});\n- return lorraine.spark.phone.register();\n+ return lorraine.spark.internal.mercury.connect();\n}));\nbefore('pause to let test users establish', () => browser.pause(5000));\n@@ -251,7 +250,7 @@ describe('Widget Recents', () => {\nafter('disconnect', () => Promise.all([\nmarty.spark.internal.mercury.disconnect(),\n- lorraine.spark.phone.deregister(),\n+ lorraine.spark.internal.mercury.disconnect(),\ndocbrown.spark.internal.mercury.disconnect()\n]));\n});\n", "new_path": "test/journeys/specs/recents/global/basic.js", "old_path": "test/journeys/specs/recents/global/basic.js" } ]
JavaScript
MIT License
webex/react-widgets
fix(journeys): removing phone plugin from tests plugin isn't needed during node tests and causes webrtc errors
1
fix
journeys
730,429
29.03.2018 11:35:11
14,400
aa281a97c82f35ca07f39f2dab30cd2a0f56c275
chore(wdio): add guest tests
[ { "change_type": "MODIFY", "diff": "@@ -123,11 +123,13 @@ exports.config = {\n'./test/journeys/specs/multiple/index.js',\n'./test/journeys/specs/oneOnOne/dataApi/basic.js',\n'./test/journeys/specs/oneOnOne/dataApi/features.js',\n+ './test/journeys/specs/oneOnOne/dataApi/guest.js',\n'./test/journeys/specs/oneOnOne/dataApi/meet.js',\n'./test/journeys/specs/oneOnOne/dataApi/messaging.js',\n'./test/journeys/specs/oneOnOne/dataApi/startup-settings.js',\n'./test/journeys/specs/oneOnOne/global/basic.js',\n'./test/journeys/specs/oneOnOne/global/features.js',\n+ './test/journeys/specs/oneOnOne/global/guest.js',\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@@ -140,6 +142,10 @@ 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+ guest: [\n+ './test/journeys/specs/oneOnOne/dataApi/guest.js',\n+ './test/journeys/specs/oneOnOne/global/guest.js'\n]\n},\n// Patterns to exclude.\n", "new_path": "wdio.conf.js", "old_path": "wdio.conf.js" } ]
JavaScript
MIT License
webex/react-widgets
chore(wdio): add guest tests
1
chore
wdio
807,849
29.03.2018 12:25:17
25,200
9d95fb8e0adc125288b26739ce282c665a1a82e6
refactor(import): Move helper function into instance method
[ { "change_type": "MODIFY", "diff": "@@ -10,7 +10,6 @@ const Command = require(\"@lerna/command\");\nconst GitUtilities = require(\"@lerna/git-utils\");\nconst PromptUtilities = require(\"@lerna/prompt\");\nconst ValidationError = require(\"@lerna/validation-error\");\n-const getTargetBase = require(\"./lib/get-target-base\");\nmodule.exports = factory;\n@@ -61,10 +60,8 @@ class ImportCommand extends Command {\nthrow new Error(`No package name specified in \"${packageJson}\"`);\n}\n- const targetBase = getTargetBase(this.project.packageConfigs);\n-\n// Compute a target directory relative to the Lerna root\n- const targetDir = path.join(targetBase, externalRepoBase);\n+ const targetDir = path.join(this.getTargetBase(), externalRepoBase);\n// Compute a target directory relative to the Git root\nconst gitRepoRoot = GitUtilities.getWorkspaceRoot(this.execOpts);\n@@ -109,6 +106,15 @@ class ImportCommand extends Command {\nreturn PromptUtilities.confirm(\"Are you sure you want to import these commits onto the current branch?\");\n}\n+ getTargetBase() {\n+ return (\n+ this.project.packageConfigs\n+ .filter(p => path.basename(p) === \"*\")\n+ .map(p => path.dirname(p))\n+ .shift() || \"packages\"\n+ );\n+ }\n+\nexternalExecSync(cmd, args) {\nreturn ChildProcessUtilities.execSync(cmd, args, this.externalExecOpts);\n}\n", "new_path": "commands/import/index.js", "old_path": "commands/import/index.js" }, { "change_type": "DELETE", "diff": "-\"use strict\";\n-\n-const path = require(\"path\");\n-\n-module.exports = getTargetBase;\n-\n-function getTargetBase(packageConfigs) {\n- const straightPackageDirectories = packageConfigs\n- .filter(p => path.basename(p) === \"*\")\n- .map(p => path.dirname(p));\n-\n- return straightPackageDirectories[0] || \"packages\";\n-}\n", "new_path": null, "old_path": "commands/import/lib/get-target-base.js" }, { "change_type": "MODIFY", "diff": "},\n\"files\": [\n\"command.js\",\n- \"index.js\",\n- \"lib\"\n+ \"index.js\"\n],\n\"main\": \"index.js\",\n\"engines\": {\n", "new_path": "commands/import/package.json", "old_path": "commands/import/package.json" } ]
JavaScript
MIT License
lerna/lerna
refactor(import): Move helper function into instance method
1
refactor
import
807,849
29.03.2018 13:28:06
25,200
9a47ff7162a9f1851694b698de155f8a75432faa
feat(project): Merge `package` and `packageJson` into `manifest`
[ { "change_type": "MODIFY", "diff": "@@ -46,7 +46,11 @@ class BootstrapCommand extends Command {\n);\n}\n- if (npmClient === \"yarn\" && this.project.packageJson.workspaces && this.options.useWorkspaces !== true) {\n+ if (\n+ npmClient === \"yarn\" &&\n+ this.project.manifest.json.workspaces &&\n+ this.options.useWorkspaces !== true\n+ ) {\nthrow new ValidationError(\n\"EWORKSPACES\",\ndedent`\n@@ -122,7 +126,7 @@ class BootstrapCommand extends Command {\n// don't hide yarn or npm output\nthis.npmConfig.stdio = \"inherit\";\n- return npmInstall(this.project.package, this.npmConfig);\n+ return npmInstall(this.project.manifest, this.npmConfig);\n}\n/**\n@@ -132,7 +136,7 @@ class BootstrapCommand extends Command {\n* @returns {Boolean}\n*/\nrootHasLocalFileDependencies() {\n- const rootDependencies = Object.assign({}, this.project.package.dependencies);\n+ const rootDependencies = Object.assign({}, this.project.manifest.dependencies);\nreturn Object.keys(rootDependencies).some(\nname =>\n@@ -231,7 +235,7 @@ class BootstrapCommand extends Command {\n// Configuration for what packages to hoist may be in lerna.json or it may\n// come in as command line options.\nconst { hoist, nohoist } = this.options;\n- const rootPkg = this.project.package;\n+ const rootPkg = this.project.manifest;\nlet hoisting;\n@@ -407,7 +411,7 @@ class BootstrapCommand extends Command {\n*/\ninstallExternalDependencies({ leaves, rootSet }) {\nconst tracker = this.logger.newItem(\"install dependencies\");\n- const rootPkg = this.project.package;\n+ const rootPkg = this.project.manifest;\nconst actions = [];\n// Start root install first, if any, since it's likely to take the longest.\n", "new_path": "commands/bootstrap/index.js", "old_path": "commands/bootstrap/index.js" }, { "change_type": "MODIFY", "diff": "@@ -288,7 +288,7 @@ class CreateCommand extends Command {\nsetHomepage() {\n// allow --homepage override, but otherwise use root pkg.homepage, if it exists\n- let { homepage = this.project.package.json.homepage } = this.options;\n+ let { homepage = this.project.manifest.json.homepage } = this.options;\nif (!homepage) {\n// normalize-package-data will backfill from hosted-git-info, if possible\n", "new_path": "commands/create/index.js", "old_path": "commands/create/index.js" }, { "change_type": "MODIFY", "diff": "\"use strict\";\nconst fs = require(\"fs-extra\");\n+const path = require(\"path\");\nconst pMap = require(\"p-map\");\nconst writeJsonFile = require(\"write-json-file\");\nconst writePkg = require(\"write-pkg\");\n@@ -53,39 +54,48 @@ class InitCommand extends Command {\n}\nensurePackageJSON() {\n- let { packageJson } = this.project;\nlet chain = Promise.resolve();\n- if (!packageJson) {\n- packageJson = {\n- name: \"root\",\n- private: true,\n- };\n+ if (!this.project.manifest) {\nthis.logger.info(\"\", \"Creating package.json\");\n// initialize with default indentation so write-pkg doesn't screw it up with tabs\n- chain = chain.then(() => writeJsonFile(this.project.packageJsonLocation, packageJson, { indent: 2 }));\n+ chain = chain.then(() =>\n+ writeJsonFile(\n+ path.join(this.project.rootPath, \"package.json\"),\n+ {\n+ name: \"root\",\n+ private: true,\n+ },\n+ { indent: 2 }\n+ )\n+ );\n} else {\nthis.logger.info(\"\", \"Updating package.json\");\n}\n+ chain = chain.then(() => {\n+ const rootPkg = this.project.manifest;\n+\nlet targetDependencies;\n- if (packageJson.dependencies && packageJson.dependencies.lerna) {\n+ if (rootPkg.dependencies && rootPkg.dependencies.lerna) {\n// lerna is a dependency in the current project\n- targetDependencies = packageJson.dependencies;\n+ targetDependencies = rootPkg.dependencies;\n} else {\n// lerna is a devDependency or no dependency, yet\n- if (!packageJson.devDependencies) {\n- packageJson.devDependencies = {};\n+ if (!rootPkg.devDependencies) {\n+ // mutate raw JSON object\n+ rootPkg.json.devDependencies = {};\n}\n- targetDependencies = packageJson.devDependencies;\n+ targetDependencies = rootPkg.devDependencies;\n}\ntargetDependencies.lerna = this.exact ? this.lernaVersion : `^${this.lernaVersion}`;\n- chain = chain.then(() => writePkg(this.project.packageJsonLocation, packageJson));\n+ return writePkg(rootPkg.manifestLocation, rootPkg.toJSON());\n+ });\nreturn chain;\n}\n", "new_path": "commands/init/index.js", "old_path": "commands/init/index.js" }, { "change_type": "MODIFY", "diff": "@@ -434,7 +434,7 @@ class PublishCommand extends Command {\nupdateUpdatedPackages() {\nconst { conventionalCommits, changelogPreset } = this.options;\nconst independentVersions = this.project.isIndependent();\n- const rootPkg = this.project.package;\n+ const rootPkg = this.project.manifest;\nconst changedFiles = new Set();\n// my kingdom for async await :(\n@@ -538,7 +538,7 @@ class PublishCommand extends Command {\nchain = chain.then(() => pMap(this.updates, ({ pkg }) => this.runPackageLifecycle(pkg, \"postversion\")));\n// run postversion, if set, in the root directory\n- chain = chain.then(() => this.runPackageLifecycle(this.project.package, \"postversion\"));\n+ chain = chain.then(() => this.runPackageLifecycle(this.project.manifest, \"postversion\"));\nreturn chain;\n}\n@@ -588,7 +588,7 @@ class PublishCommand extends Command {\nconst tracker = this.logger.newItem(\"npmPublish\");\n// if we skip temp tags we should tag with the proper value immediately\nconst distTag = this.options.tempTag ? \"lerna-temp\" : this.getDistTag();\n- const rootPkg = this.project.package;\n+ const rootPkg = this.project.manifest;\nlet chain = Promise.resolve();\n", "new_path": "commands/publish/index.js", "old_path": "commands/publish/index.js" }, { "change_type": "MODIFY", "diff": "@@ -158,7 +158,7 @@ class Command {\nthrow new ValidationError(\"ENOGIT\", \"The git binary was not found, or this is not a git repository.\");\n}\n- if (!this.project.packageJson) {\n+ if (!this.project.manifest) {\nthrow new ValidationError(\"ENOPKG\", \"`package.json` does not exist, have you run `lerna init`?\");\n}\n", "new_path": "core/command/index.js", "old_path": "core/command/index.js" }, { "change_type": "MODIFY", "diff": "@@ -43,20 +43,6 @@ describe(\"Project\", () => {\n});\n});\n- describe(\".lernaConfigLocation\", () => {\n- it(\"should be added to the instance\", () => {\n- const project = new Project(testDir);\n- expect(project.lernaConfigLocation).toBe(path.join(testDir, \"lerna.json\"));\n- });\n- });\n-\n- describe(\".packageJsonLocation\", () => {\n- it(\"should be added to the instance\", () => {\n- const project = new Project(testDir);\n- expect(project.packageJsonLocation).toBe(path.join(testDir, \"package.json\"));\n- });\n- });\n-\ndescribe(\".config\", () => {\nit(\"returns parsed lerna.json\", () => {\nconst project = new Project(testDir);\n@@ -224,32 +210,30 @@ describe(\"Project\", () => {\n});\n});\n- describe(\"get .packageJson\", () => {\n- it(\"returns parsed package.json\", () => {\n- expect(new Project(testDir).packageJson).toMatchObject({\n- name: \"test\",\n- devDependencies: {\n- lerna: \"500.0.0\",\n- external: \"^1.0.0\",\n- },\n- });\n+ describe(\"get .manifest\", () => {\n+ it(\"returns a Package instance\", () => {\n+ const project = new Project(testDir);\n+ expect(project.manifest).toBeDefined();\n+ expect(project.manifest.name).toBe(\"test\");\n+ expect(project.manifest.location).toBe(testDir);\n});\nit(\"caches the first successful value\", () => {\nconst project = new Project(testDir);\n- expect(project.packageJson).toBe(project.packageJson);\n+ expect(project.manifest).toBe(project.manifest);\n});\nit(\"does not cache failures\", async () => {\nconst cwd = await initFixture(\"basic\");\n+ const manifestLocation = path.join(cwd, \"package.json\");\n- await fs.remove(path.join(cwd, \"package.json\"));\n+ await fs.remove(manifestLocation);\nconst project = new Project(cwd);\n- expect(project.packageJson).toBe(undefined);\n+ expect(project.manifest).toBe(undefined);\n- await fs.writeJSON(project.packageJsonLocation, { name: \"test\" }, { spaces: 2 });\n- expect(project.packageJson).toHaveProperty(\"name\", \"test\");\n+ await fs.writeJSON(manifestLocation, { name: \"test\" }, { spaces: 2 });\n+ expect(project.manifest).toHaveProperty(\"name\", \"test\");\n});\nit(\"errors when root package.json is not valid JSON\", async () => {\n@@ -266,20 +250,6 @@ describe(\"Project\", () => {\n});\n});\n- describe(\"get .package\", () => {\n- it(\"returns a Package instance\", () => {\n- const project = new Project(testDir);\n- expect(project.package).toBeDefined();\n- expect(project.package.name).toBe(\"test\");\n- expect(project.package.location).toBe(testDir);\n- });\n-\n- it(\"caches the initial value\", () => {\n- const project = new Project(testDir);\n- expect(project.package).toBe(project.package);\n- });\n- });\n-\ndescribe(\"isIndependent()\", () => {\nit(\"returns if the repository versioning is independent\", () => {\nconst project = new Project(testDir);\n", "new_path": "core/project/__tests__/project.test.js", "old_path": "core/project/__tests__/project.test.js" }, { "change_type": "MODIFY", "diff": "@@ -58,11 +58,10 @@ class Project {\n}\nthis.config = loaded.config;\n+ this.rootConfigLocation = loaded.filepath;\nthis.rootPath = path.dirname(loaded.filepath);\n- log.verbose(\"rootPath\", this.rootPath);\n- this.lernaConfigLocation = loaded.filepath;\n- this.packageJsonLocation = path.join(this.rootPath, \"package.json\");\n+ log.verbose(\"rootPath\", this.rootPath);\n}\nget version() {\n@@ -75,7 +74,9 @@ class Project {\nget packageConfigs() {\nif (this.config.useWorkspaces) {\n- if (!this.packageJson.workspaces) {\n+ const workspaces = this.manifest.json.workspaces;\n+\n+ if (!workspaces) {\nthrow new ValidationError(\n\"EWORKSPACES\",\ndedent`\n@@ -85,7 +86,7 @@ class Project {\n);\n}\n- return this.packageJson.workspaces.packages || this.packageJson.workspaces;\n+ return workspaces.packages || workspaces;\n}\nreturn this.config.packages || [Project.DEFAULT_PACKAGE_GLOB];\n@@ -95,38 +96,31 @@ class Project {\nreturn this.packageConfigs.map(globParent).map(parentDir => path.resolve(this.rootPath, parentDir));\n}\n- get packageJson() {\n- let packageJson;\n+ get manifest() {\n+ let manifest;\ntry {\n- packageJson = loadJsonFile.sync(this.packageJsonLocation);\n+ const manifestLocation = path.join(this.rootPath, \"package.json\");\n+ const packageJson = loadJsonFile.sync(manifestLocation);\nif (!packageJson.name) {\n// npm-lifecycle chokes if this is missing, so default like npm init does\n- packageJson.name = path.basename(path.dirname(this.packageJsonLocation));\n+ packageJson.name = path.basename(path.dirname(manifestLocation));\n}\n+ // Encapsulate raw JSON in Package instance\n+ manifest = new Package(packageJson, this.rootPath);\n+\n// redefine getter to lazy-loaded value\n- Object.defineProperty(this, \"packageJson\", {\n- value: packageJson,\n+ Object.defineProperty(this, \"manifest\", {\n+ value: manifest,\n});\n} catch (err) {\n// syntax errors are already caught and reported by constructor\n// try again next time\n}\n- return packageJson;\n- }\n-\n- get package() {\n- const pkg = new Package(this.packageJson, this.rootPath);\n-\n- // redefine getter to lazy-loaded value\n- Object.defineProperty(this, \"package\", {\n- value: pkg,\n- });\n-\n- return pkg;\n+ return manifest;\n}\nisIndependent() {\n@@ -135,8 +129,8 @@ class Project {\nserializeConfig() {\n// TODO: might be package.json prop\n- return writeJsonFile(this.lernaConfigLocation, this.config, { indent: 2, detectIndent: true }).then(\n- () => this.lernaConfigLocation\n+ return writeJsonFile(this.rootConfigLocation, this.config, { indent: 2, detectIndent: true }).then(\n+ () => this.rootConfigLocation\n);\n}\n}\n", "new_path": "core/project/index.js", "old_path": "core/project/index.js" } ]
JavaScript
MIT License
lerna/lerna
feat(project): Merge `package` and `packageJson` into `manifest`
1
feat
project
807,849
29.03.2018 13:56:33
25,200
707d1f041f8041dd3e0f55c2830b8319c24eb6a6
feat(package): Add Map-like get/set methods, remove raw json getter BREAKING CHANGE: The `Package` class no longer provides direct access to the JSON object used to construct the instance. Map-like `get()`/`set(val)` methods are available to modify the internal representation.
[ { "change_type": "MODIFY", "diff": "@@ -144,11 +144,14 @@ class AddCommand extends Command {\n}\ngetPackageDeps(pkg) {\n- if (!pkg.json[this.dependencyType]) {\n- pkg.json[this.dependencyType] = {};\n+ let deps = pkg.get(this.dependencyType);\n+\n+ if (!deps) {\n+ deps = {};\n+ pkg.set(this.dependencyType, deps);\n}\n- return pkg.json[this.dependencyType];\n+ return deps;\n}\ngetPackageVersion(spec) {\n", "new_path": "commands/add/index.js", "old_path": "commands/add/index.js" }, { "change_type": "MODIFY", "diff": "@@ -48,7 +48,7 @@ class BootstrapCommand extends Command {\nif (\nnpmClient === \"yarn\" &&\n- this.project.manifest.json.workspaces &&\n+ this.project.manifest.get(\"workspaces\") &&\nthis.options.useWorkspaces !== true\n) {\nthrow new ValidationError(\n", "new_path": "commands/bootstrap/index.js", "old_path": "commands/bootstrap/index.js" }, { "change_type": "MODIFY", "diff": "@@ -288,7 +288,7 @@ class CreateCommand extends Command {\nsetHomepage() {\n// allow --homepage override, but otherwise use root pkg.homepage, if it exists\n- let { homepage = this.project.manifest.json.homepage } = this.options;\n+ let { homepage = this.project.manifest.get(\"homepage\") } = this.options;\nif (!homepage) {\n// normalize-package-data will backfill from hosted-git-info, if possible\n", "new_path": "commands/create/index.js", "old_path": "commands/create/index.js" }, { "change_type": "MODIFY", "diff": "@@ -32,9 +32,7 @@ describe(\"DiffCommand\", () => {\nconst [pkg1] = await collectPackages(cwd);\nconst rootReadme = path.join(cwd, \"README.md\");\n- pkg1.json.changed += 1;\n-\n- await writeManifest(pkg1);\n+ await writeManifest(pkg1.set(\"changed\", 1));\nawait fs.outputFile(rootReadme, \"change outside packages glob\");\nawait gitAdd(cwd, \"-A\");\nawait gitCommit(cwd, \"changed\");\n@@ -47,16 +45,12 @@ describe(\"DiffCommand\", () => {\nconst cwd = await initFixture(\"basic\");\nconst [pkg1] = await collectPackages(cwd);\n- pkg1.json.changed += 1;\n-\n- await writeManifest(pkg1);\n+ await writeManifest(pkg1.set(\"changed\", 1));\nawait gitAdd(cwd, \"-A\");\nawait gitCommit(cwd, \"changed\");\nawait gitTag(cwd, \"v1.0.1\");\n- pkg1.json.sinceLastTag = true;\n-\n- await writeManifest(pkg1);\n+ await writeManifest(pkg1.set(\"sinceLastTag\", true));\nawait gitAdd(cwd, \"-A\");\nawait gitCommit(cwd, \"changed\");\n@@ -68,10 +62,7 @@ describe(\"DiffCommand\", () => {\nconst cwd = await initFixture(\"basic\");\nconst [pkg1, pkg2] = await collectPackages(cwd);\n- pkg1.json.changed += 1;\n- pkg2.json.changed += 1;\n-\n- await Promise.all([writeManifest(pkg1), writeManifest(pkg2)]);\n+ await Promise.all([writeManifest(pkg1.set(\"changed\", 1)), writeManifest(pkg2.set(\"changed\", 1))]);\nawait gitAdd(cwd, \"-A\");\nawait gitCommit(cwd, \"changed\");\n@@ -83,9 +74,7 @@ describe(\"DiffCommand\", () => {\nconst cwd = await initFixture(\"basic\");\nconst [pkg1] = await collectPackages(cwd);\n- pkg1.json.changed += 1;\n-\n- await writeManifest(pkg1);\n+ await writeManifest(pkg1.set(\"changed\", 1));\nawait fs.outputFile(path.join(pkg1.location, \"README.md\"), \"ignored change\");\nawait gitAdd(cwd, \"-A\");\nawait gitCommit(cwd, \"changed\");\n", "new_path": "commands/diff/__tests__/diff-command.test.js", "old_path": "commands/diff/__tests__/diff-command.test.js" }, { "change_type": "MODIFY", "diff": "@@ -86,7 +86,7 @@ class InitCommand extends Command {\n// lerna is a devDependency or no dependency, yet\nif (!rootPkg.devDependencies) {\n// mutate raw JSON object\n- rootPkg.json.devDependencies = {};\n+ rootPkg.set(\"devDependencies\", {});\n}\ntargetDependencies = rootPkg.devDependencies;\n", "new_path": "commands/init/index.js", "old_path": "commands/init/index.js" }, { "change_type": "MODIFY", "diff": "@@ -211,7 +211,7 @@ class PublishCommand extends Command {\nreturn pMap(this.updates, ({ pkg }) => {\nif (!pkg.private) {\n// provide gitHead property that is normally added during npm publish\n- pkg.json.gitHead = gitHead;\n+ pkg.set(\"gitHead\", gitHead);\nreturn writePkg(pkg.manifestLocation, pkg.toJSON());\n}\n", "new_path": "commands/publish/index.js", "old_path": "commands/publish/index.js" }, { "change_type": "MODIFY", "diff": "@@ -16,6 +16,8 @@ const { recommendVersion, updateChangelog } = require(\"..\");\n// stabilize changelog commit SHA and datestamp\nexpect.addSnapshotSerializer(require(\"@lerna-test/serialize-changelog\"));\n+const writeManifest = pkg => fs.writeJSON(pkg.manifestLocation, pkg, { spaces: 2 });\n+\ndescribe(\"conventional-commits\", () => {\ndescribe(\"recommendVersion()\", () => {\nit(\"returns next version bump\", async () => {\n@@ -23,8 +25,7 @@ describe(\"conventional-commits\", () => {\nconst [pkg1] = await collectPackages(cwd);\n// make a change in package-1\n- pkg1.json.changed = 1;\n- await fs.writeJSON(pkg1.manifestLocation, pkg1);\n+ await writeManifest(pkg1.set(\"changed\", 1));\nawait gitAdd(cwd, pkg1.manifestLocation);\nawait gitCommit(cwd, \"feat: changed 1\");\n@@ -37,12 +38,7 @@ describe(\"conventional-commits\", () => {\nconst opts = { changelogPreset: \"angular\" };\n// make a change in package-1 and package-2\n- pkg1.json.changed = 1;\n- pkg2.json.changed = 2;\n- await Promise.all([\n- fs.writeJSON(pkg1.manifestLocation, pkg1),\n- fs.writeJSON(pkg2.manifestLocation, pkg2),\n- ]);\n+ await Promise.all([writeManifest(pkg1.set(\"changed\", 1)), writeManifest(pkg2.set(\"changed\", 2))]);\nawait gitAdd(cwd, pkg1.manifestLocation);\nawait gitCommit(cwd, \"fix: changed 1\");\n@@ -68,14 +64,13 @@ describe(\"conventional-commits\", () => {\n};\n// make a change in package-1\n- pkg1.json.changed = 1;\n- await fs.writeJSON(pkg1.manifestLocation, pkg1);\n+ await writeManifest(pkg1.set(\"changed\", 1));\nawait gitAdd(cwd, pkg1.manifestLocation);\nawait gitCommit(cwd, \"feat: I should be placed in the CHANGELOG\");\n// update version\npkg1.version = \"1.1.0\";\n- await fs.writeJSON(pkg1.manifestLocation, pkg1);\n+ await writeManifest(pkg1);\nconst changelogLocation = await updateChangelog(pkg1, \"fixed\", {\nchangelogPreset: \"angular\",\n@@ -100,14 +95,13 @@ describe(\"conventional-commits\", () => {\nconst [pkg1] = await collectPackages(cwd);\n// make a change in package-1\n- pkg1.json.changed = 1;\n- await fs.writeJSON(pkg1.manifestLocation, pkg1);\n+ await writeManifest(pkg1.set(\"changed\", 1));\nawait gitAdd(cwd, pkg1.manifestLocation);\nawait gitCommit(cwd, \"fix: A second commit for our CHANGELOG\");\n// update version\npkg1.version = \"1.0.1\";\n- await fs.writeJSON(pkg1.manifestLocation, pkg1);\n+ await writeManifest(pkg1);\nawait expect(\nupdateChangelog(pkg1, \"fixed\", /* default preset */ {}).then(getFileContent)\n@@ -126,14 +120,13 @@ describe(\"conventional-commits\", () => {\nconst [pkg1, pkg2] = await collectPackages(cwd);\n// make a change in package-1\n- pkg1.json.changed = 1;\n- await fs.writeJSON(pkg1.manifestLocation, pkg1);\n+ await writeManifest(pkg1.set(\"changed\", 1));\nawait gitAdd(cwd, pkg1.manifestLocation);\nawait gitCommit(cwd, \"fix(pkg1): A dependency-triggered bump\");\n// update version\npkg2.version = \"1.0.1\";\n- await fs.writeJSON(pkg2.manifestLocation, pkg2);\n+ await writeManifest(pkg2);\nawait expect(\nupdateChangelog(pkg2, \"fixed\", { changelogPreset: \"angular\" }).then(getFileContent)\n@@ -148,12 +141,7 @@ describe(\"conventional-commits\", () => {\nconst [pkg1, pkg2] = await collectPackages(cwd);\n// make a change in package-1 and package-2\n- pkg1.json.changed = 1;\n- pkg2.json.changed = 2;\n- await Promise.all([\n- fs.writeJSON(pkg1.manifestLocation, pkg1),\n- fs.writeJSON(pkg2.manifestLocation, pkg2),\n- ]);\n+ await Promise.all([writeManifest(pkg1.set(\"changed\", 1)), writeManifest(pkg2.set(\"changed\", 2))]);\nawait gitAdd(cwd, pkg1.manifestLocation);\nawait gitCommit(cwd, \"fix(stuff): changed\");\n@@ -164,10 +152,7 @@ describe(\"conventional-commits\", () => {\n// update versions\npkg1.version = \"1.0.1\";\npkg2.version = \"1.1.0\";\n- await Promise.all([\n- fs.writeJSON(pkg1.manifestLocation, pkg1),\n- fs.writeJSON(pkg2.manifestLocation, pkg2),\n- ]);\n+ await Promise.all([writeManifest(pkg1), writeManifest(pkg2)]);\nconst opts = {\nchangelogPreset: \"angular\",\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": "@@ -146,15 +146,16 @@ describe(\"Package\", () => {\ndescribe(\".toJSON()\", () => {\nit(\"should return clone of internal package for serialization\", () => {\n- const pkg = factory({\n+ const json = {\nname: \"is-cloned\",\n- });\n+ };\n+ const pkg = factory(json);\n- expect(pkg.toJSON()).not.toBe(pkg.json);\n- expect(pkg.toJSON()).toEqual(pkg.json);\n+ expect(pkg.toJSON()).not.toBe(json);\n+ expect(pkg.toJSON()).toEqual(json);\nconst implicit = JSON.stringify(pkg, null, 2);\n- const explicit = JSON.stringify(pkg.json, null, 2);\n+ const explicit = JSON.stringify(json, null, 2);\nexpect(implicit).toBe(explicit);\n});\n", "new_path": "core/package/__tests__/core-package.test.js", "old_path": "core/package/__tests__/core-package.test.js" }, { "change_type": "MODIFY", "diff": "@@ -96,12 +96,21 @@ class Package {\nbinLocation: {\nvalue: path.join(location, \"node_modules\", \".bin\"),\n},\n- // \"private\"\n- json: {\n- get() {\n- return pkg;\n+ // Map-like retrieval and storage of arbitrary values\n+ get: {\n+ value: key => pkg[key],\n+ },\n+ set: {\n+ value: (key, val) => {\n+ pkg[key] = val;\n+\n+ return this;\n},\n},\n+ // serialize\n+ toJSON: {\n+ value: () => shallowCopy(pkg),\n+ },\n});\n}\n@@ -109,16 +118,16 @@ class Package {\nconst depName = resolved.name;\n// first, try runtime dependencies\n- let depCollection = this.json.dependencies;\n+ let depCollection = this.dependencies;\n// try optionalDependencies if that didn't work\nif (!depCollection || !depCollection[depName]) {\n- depCollection = this.json.optionalDependencies;\n+ depCollection = this.optionalDependencies;\n}\n// fall back to devDependencies\nif (!depCollection || !depCollection[depName]) {\n- depCollection = this.json.devDependencies;\n+ depCollection = this.devDependencies;\n}\nif (resolved.registry || resolved.type === \"directory\") {\n@@ -143,10 +152,6 @@ class Package {\ndepCollection[depName] = hosted.sshurl({ noGitPlus: false, noCommittish: false });\n}\n}\n-\n- toJSON() {\n- return shallowCopy(this.json);\n- }\n}\nmodule.exports = Package;\n", "new_path": "core/package/index.js", "old_path": "core/package/index.js" }, { "change_type": "MODIFY", "diff": "@@ -74,7 +74,7 @@ class Project {\nget packageConfigs() {\nif (this.config.useWorkspaces) {\n- const workspaces = this.manifest.json.workspaces;\n+ const workspaces = this.manifest.get(\"workspaces\");\nif (!workspaces) {\nthrow new ValidationError(\n", "new_path": "core/project/index.js", "old_path": "core/project/index.js" } ]
JavaScript
MIT License
lerna/lerna
feat(package): Add Map-like get/set methods, remove raw json getter BREAKING CHANGE: The `Package` class no longer provides direct access to the JSON object used to construct the instance. Map-like `get()`/`set(val)` methods are available to modify the internal representation.
1
feat
package
807,849
29.03.2018 16:04:43
25,200
fdec3ac39f434f1b2cb8db447711d8e580c2bae2
feat(package): Add `serialize()` method
[ { "change_type": "MODIFY", "diff": "@@ -5,7 +5,6 @@ const npa = require(\"npm-package-arg\");\nconst packageJson = require(\"package-json\");\nconst pMap = require(\"p-map\");\nconst semver = require(\"semver\");\n-const writePkg = require(\"write-pkg\");\nconst Command = require(\"@lerna/command\");\nconst bootstrap = require(\"@lerna/bootstrap\");\n@@ -137,7 +136,7 @@ class AddCommand extends Command {\n}\n}\n- return writePkg(pkg.manifestLocation, pkg.toJSON()).then(() => pkg.name);\n+ return pkg.serialize().then(() => pkg.name);\n};\nreturn pMap(this.packagesToChange, mapper);\n", "new_path": "commands/add/index.js", "old_path": "commands/add/index.js" }, { "change_type": "MODIFY", "diff": "\"npm-package-arg\": \"^6.0.0\",\n\"p-map\": \"^1.2.0\",\n\"package-json\": \"^4.0.1\",\n- \"semver\": \"^5.5.0\",\n- \"write-pkg\": \"^3.1.0\"\n+ \"semver\": \"^5.5.0\"\n}\n}\n", "new_path": "commands/add/package.json", "old_path": "commands/add/package.json" }, { "change_type": "MODIFY", "diff": "@@ -21,8 +21,6 @@ const lernaDiff = require(\"@lerna-test/command-runner\")(require(\"../command\"));\n// stabilize commit SHA\nexpect.addSnapshotSerializer(require(\"@lerna-test/serialize-git-sha\"));\n-const writeManifest = pkg => fs.writeJSON(pkg.manifestLocation, pkg, { spaces: 2 });\n-\ndescribe(\"DiffCommand\", () => {\n// overwrite spawn so we get piped stdout, not inherited\nChildProcessUtilities.spawn = jest.fn((...args) => execa(...args));\n@@ -32,7 +30,7 @@ describe(\"DiffCommand\", () => {\nconst [pkg1] = await collectPackages(cwd);\nconst rootReadme = path.join(cwd, \"README.md\");\n- await writeManifest(pkg1.set(\"changed\", 1));\n+ await pkg1.set(\"changed\", 1).serialize();\nawait fs.outputFile(rootReadme, \"change outside packages glob\");\nawait gitAdd(cwd, \"-A\");\nawait gitCommit(cwd, \"changed\");\n@@ -45,12 +43,12 @@ describe(\"DiffCommand\", () => {\nconst cwd = await initFixture(\"basic\");\nconst [pkg1] = await collectPackages(cwd);\n- await writeManifest(pkg1.set(\"changed\", 1));\n+ await pkg1.set(\"changed\", 1).serialize();\nawait gitAdd(cwd, \"-A\");\nawait gitCommit(cwd, \"changed\");\nawait gitTag(cwd, \"v1.0.1\");\n- await writeManifest(pkg1.set(\"sinceLastTag\", true));\n+ await pkg1.set(\"sinceLastTag\", true).serialize();\nawait gitAdd(cwd, \"-A\");\nawait gitCommit(cwd, \"changed\");\n@@ -62,7 +60,8 @@ describe(\"DiffCommand\", () => {\nconst cwd = await initFixture(\"basic\");\nconst [pkg1, pkg2] = await collectPackages(cwd);\n- await Promise.all([writeManifest(pkg1.set(\"changed\", 1)), writeManifest(pkg2.set(\"changed\", 1))]);\n+ await pkg1.set(\"changed\", 1).serialize();\n+ await pkg2.set(\"changed\", 1).serialize();\nawait gitAdd(cwd, \"-A\");\nawait gitCommit(cwd, \"changed\");\n@@ -74,7 +73,7 @@ describe(\"DiffCommand\", () => {\nconst cwd = await initFixture(\"basic\");\nconst [pkg1] = await collectPackages(cwd);\n- await writeManifest(pkg1.set(\"changed\", 1));\n+ await pkg1.set(\"changed\", 1).serialize();\nawait fs.outputFile(path.join(pkg1.location, \"README.md\"), \"ignored change\");\nawait gitAdd(cwd, \"-A\");\nawait gitCommit(cwd, \"changed\");\n", "new_path": "commands/diff/__tests__/diff-command.test.js", "old_path": "commands/diff/__tests__/diff-command.test.js" }, { "change_type": "MODIFY", "diff": "@@ -4,7 +4,6 @@ const fs = require(\"fs-extra\");\nconst path = require(\"path\");\nconst pMap = require(\"p-map\");\nconst writeJsonFile = require(\"write-json-file\");\n-const writePkg = require(\"write-pkg\");\nconst Command = require(\"@lerna/command\");\nconst GitUtilities = require(\"@lerna/git-utils\");\n@@ -94,7 +93,7 @@ class InitCommand extends Command {\ntargetDependencies.lerna = this.exact ? this.lernaVersion : `^${this.lernaVersion}`;\n- return writePkg(rootPkg.manifestLocation, rootPkg.toJSON());\n+ return rootPkg.serialize();\n});\nreturn chain;\n", "new_path": "commands/init/index.js", "old_path": "commands/init/index.js" }, { "change_type": "MODIFY", "diff": "\"@lerna/git-utils\": \"file:../../core/git-utils\",\n\"fs-extra\": \"^5.0.0\",\n\"p-map\": \"^1.2.0\",\n- \"write-json-file\": \"^2.3.0\",\n- \"write-pkg\": \"^3.1.0\"\n+ \"write-json-file\": \"^2.3.0\"\n}\n}\n", "new_path": "commands/init/package.json", "old_path": "commands/init/package.json" }, { "change_type": "MODIFY", "diff": "@@ -10,7 +10,6 @@ const pMap = require(\"p-map\");\nconst pReduce = require(\"p-reduce\");\nconst pWaterfall = require(\"p-waterfall\");\nconst semver = require(\"semver\");\n-const writePkg = require(\"write-pkg\");\nconst Command = require(\"@lerna/command\");\nconst ConventionalCommitUtilities = require(\"@lerna/conventional-commits\");\n@@ -213,7 +212,7 @@ class PublishCommand extends Command {\n// provide gitHead property that is normally added during npm publish\npkg.set(\"gitHead\", gitHead);\n- return writePkg(pkg.manifestLocation, pkg.toJSON());\n+ return pkg.serialize();\n}\n});\n}\n@@ -468,10 +467,7 @@ class PublishCommand extends Command {\n}\n}\n- // NOTE: Object.prototype.toJSON() is normally called when passed to\n- // JSON.stringify(), but write-pkg iterates Object.keys() before serializing\n- // so it has to be explicit here (otherwise it mangles the instance properties)\n- return writePkg(pkg.manifestLocation, pkg.toJSON()).then(() => {\n+ return pkg.serialize().then(() => {\n// commit the updated manifest\nchangedFiles.add(pkg.manifestLocation);\n});\n", "new_path": "commands/publish/index.js", "old_path": "commands/publish/index.js" }, { "change_type": "MODIFY", "diff": "\"p-reduce\": \"^1.0.0\",\n\"p-waterfall\": \"^1.0.0\",\n\"semver\": \"^5.5.0\",\n- \"write-json-file\": \"^2.3.0\",\n- \"write-pkg\": \"^3.1.0\"\n+ \"write-json-file\": \"^2.3.0\"\n}\n}\n", "new_path": "commands/publish/package.json", "old_path": "commands/publish/package.json" }, { "change_type": "MODIFY", "diff": "@@ -16,8 +16,6 @@ const { recommendVersion, updateChangelog } = require(\"..\");\n// stabilize changelog commit SHA and datestamp\nexpect.addSnapshotSerializer(require(\"@lerna-test/serialize-changelog\"));\n-const writeManifest = pkg => fs.writeJSON(pkg.manifestLocation, pkg, { spaces: 2 });\n-\ndescribe(\"conventional-commits\", () => {\ndescribe(\"recommendVersion()\", () => {\nit(\"returns next version bump\", async () => {\n@@ -25,7 +23,7 @@ describe(\"conventional-commits\", () => {\nconst [pkg1] = await collectPackages(cwd);\n// make a change in package-1\n- await writeManifest(pkg1.set(\"changed\", 1));\n+ await pkg1.set(\"changed\", 1).serialize();\nawait gitAdd(cwd, pkg1.manifestLocation);\nawait gitCommit(cwd, \"feat: changed 1\");\n@@ -38,7 +36,8 @@ describe(\"conventional-commits\", () => {\nconst opts = { changelogPreset: \"angular\" };\n// make a change in package-1 and package-2\n- await Promise.all([writeManifest(pkg1.set(\"changed\", 1)), writeManifest(pkg2.set(\"changed\", 2))]);\n+ await pkg1.set(\"changed\", 1).serialize();\n+ await pkg2.set(\"changed\", 2).serialize();\nawait gitAdd(cwd, pkg1.manifestLocation);\nawait gitCommit(cwd, \"fix: changed 1\");\n@@ -59,18 +58,17 @@ describe(\"conventional-commits\", () => {\nconst [pkg1] = await collectPackages(cwd);\nconst rootPkg = {\n- name: \"root\", // TODO: no name\n+ name: \"root\",\nlocation: cwd,\n};\n// make a change in package-1\n- await writeManifest(pkg1.set(\"changed\", 1));\n+ await pkg1.set(\"changed\", 1).serialize();\nawait gitAdd(cwd, pkg1.manifestLocation);\nawait gitCommit(cwd, \"feat: I should be placed in the CHANGELOG\");\n// update version\n- pkg1.version = \"1.1.0\";\n- await writeManifest(pkg1);\n+ await pkg1.set(\"version\", \"1.1.0\").serialize();\nconst changelogLocation = await updateChangelog(pkg1, \"fixed\", {\nchangelogPreset: \"angular\",\n@@ -86,7 +84,7 @@ describe(\"conventional-commits\", () => {\nit(\"updates fixed changelogs\", async () => {\nconst cwd = await initFixture(\"fixed\");\nconst rootPkg = {\n- name: \"root\", // TODO: no name\n+ // no name\nlocation: cwd,\n};\n@@ -95,13 +93,12 @@ describe(\"conventional-commits\", () => {\nconst [pkg1] = await collectPackages(cwd);\n// make a change in package-1\n- await writeManifest(pkg1.set(\"changed\", 1));\n+ await pkg1.set(\"changed\", 1).serialize();\nawait gitAdd(cwd, pkg1.manifestLocation);\nawait gitCommit(cwd, \"fix: A second commit for our CHANGELOG\");\n// update version\n- pkg1.version = \"1.0.1\";\n- await writeManifest(pkg1);\n+ await pkg1.set(\"version\", \"1.0.1\").serialize();\nawait expect(\nupdateChangelog(pkg1, \"fixed\", /* default preset */ {}).then(getFileContent)\n@@ -120,13 +117,12 @@ describe(\"conventional-commits\", () => {\nconst [pkg1, pkg2] = await collectPackages(cwd);\n// make a change in package-1\n- await writeManifest(pkg1.set(\"changed\", 1));\n+ await pkg1.set(\"changed\", 1).serialize();\nawait gitAdd(cwd, pkg1.manifestLocation);\nawait gitCommit(cwd, \"fix(pkg1): A dependency-triggered bump\");\n// update version\n- pkg2.version = \"1.0.1\";\n- await writeManifest(pkg2);\n+ await pkg2.set(\"version\", \"1.0.1\").serialize();\nawait expect(\nupdateChangelog(pkg2, \"fixed\", { changelogPreset: \"angular\" }).then(getFileContent)\n@@ -136,12 +132,14 @@ describe(\"conventional-commits\", () => {\nit(\"updates independent changelogs\", async () => {\nconst cwd = await initFixture(\"independent\");\n- await Promise.all([gitTag(cwd, \"package-1@1.0.0\"), gitTag(cwd, \"package-2@1.0.0\")]);\n+ await gitTag(cwd, \"package-1@1.0.0\");\n+ await gitTag(cwd, \"package-2@1.0.0\");\nconst [pkg1, pkg2] = await collectPackages(cwd);\n// make a change in package-1 and package-2\n- await Promise.all([writeManifest(pkg1.set(\"changed\", 1)), writeManifest(pkg2.set(\"changed\", 2))]);\n+ await pkg1.set(\"changed\", 1).serialize();\n+ await pkg2.set(\"changed\", 2).serialize();\nawait gitAdd(cwd, pkg1.manifestLocation);\nawait gitCommit(cwd, \"fix(stuff): changed\");\n@@ -150,9 +148,8 @@ describe(\"conventional-commits\", () => {\nawait gitCommit(cwd, \"feat(thing): added\");\n// update versions\n- pkg1.version = \"1.0.1\";\n- pkg2.version = \"1.1.0\";\n- await Promise.all([writeManifest(pkg1), writeManifest(pkg2)]);\n+ await pkg1.set(\"version\", \"1.0.1\").serialize();\n+ await pkg2.set(\"version\", \"1.1.0\").serialize();\nconst opts = {\nchangelogPreset: \"angular\",\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": "const npa = require(\"npm-package-arg\");\nconst path = require(\"path\");\n+const writePkg = require(\"write-pkg\");\nfunction binSafeName({ name, scope }) {\nreturn scope ? name.substring(scope.length + 1) : name;\n@@ -107,10 +108,14 @@ class Package {\nreturn this;\n},\n},\n- // serialize\n+ // provide copy of internal pkg for munging\ntoJSON: {\nvalue: () => shallowCopy(pkg),\n},\n+ // write changes to disk\n+ serialize: {\n+ value: () => writePkg(this.manifestLocation, pkg),\n+ },\n});\n}\n", "new_path": "core/package/index.js", "old_path": "core/package/index.js" }, { "change_type": "MODIFY", "diff": "\"test\": \"echo \\\"Run tests from root\\\" && exit 1\"\n},\n\"dependencies\": {\n- \"npm-package-arg\": \"^6.0.0\"\n+ \"npm-package-arg\": \"^6.0.0\",\n+ \"write-pkg\": \"^3.1.0\"\n}\n}\n", "new_path": "core/package/package.json", "old_path": "core/package/package.json" }, { "change_type": "MODIFY", "diff": "\"npm-package-arg\": \"6.0.0\",\n\"p-map\": \"1.2.0\",\n\"package-json\": \"4.0.1\",\n- \"semver\": \"5.5.0\",\n- \"write-pkg\": \"3.1.0\"\n+ \"semver\": \"5.5.0\"\n}\n},\n\"@lerna/batch-packages\": {\n\"@lerna/git-utils\": \"file:core/git-utils\",\n\"fs-extra\": \"5.0.0\",\n\"p-map\": \"1.2.0\",\n- \"write-json-file\": \"2.3.0\",\n- \"write-pkg\": \"3.1.0\"\n+ \"write-json-file\": \"2.3.0\"\n}\n},\n\"@lerna/link\": {\n\"@lerna/package\": {\n\"version\": \"file:core/package\",\n\"requires\": {\n- \"npm-package-arg\": \"6.0.0\"\n+ \"npm-package-arg\": \"6.0.0\",\n+ \"write-pkg\": \"3.1.0\"\n}\n},\n\"@lerna/package-graph\": {\n\"p-reduce\": \"1.0.0\",\n\"p-waterfall\": \"1.0.0\",\n\"semver\": \"5.5.0\",\n- \"write-json-file\": \"2.3.0\",\n- \"write-pkg\": \"3.1.0\"\n+ \"write-json-file\": \"2.3.0\"\n}\n},\n\"@lerna/resolve-symlink\": {\n", "new_path": "package-lock.json", "old_path": "package-lock.json" }, { "change_type": "MODIFY", "diff": "@@ -11,6 +11,9 @@ const fs = require(\"fs-extra\");\nconst writePkg = require(\"write-pkg\");\nconst ChildProcessUtilities = require(\"@lerna/child-process\");\n+// helpers\n+const Package = require(\"@lerna/package\");\n+\n// file under test\nconst npmInstall = require(\"..\");\n@@ -23,42 +26,42 @@ describe(\"npm-install\", () => {\nit(\"returns a promise for a non-mangling install\", async () => {\nexpect.assertions(1);\n- const location = path.normalize(\"/test/npm/install\");\n- const pkg = {\n+ const pkg = new Package(\n+ {\nname: \"test-npm-install\",\n- location,\n- };\n- const config = {\n+ },\n+ path.normalize(\"/test/npm-install-deps\")\n+ );\n+\n+ await npmInstall(pkg, {\nnpmClient: \"yarn\",\nnpmClientArgs: [\"--no-optional\"],\nmutex: \"file:foo\",\n- };\n-\n- await npmInstall(pkg, config);\n+ });\nexpect(ChildProcessUtilities.exec).lastCalledWith(\n\"yarn\",\n[\"install\", \"--mutex\", \"file:foo\", \"--non-interactive\", \"--no-optional\"],\n- { cwd: location, stdio: \"pipe\" }\n+ { cwd: pkg.location, stdio: \"pipe\" }\n);\n});\nit(\"allows override of opts.stdio\", async () => {\nexpect.assertions(1);\n- const location = path.normalize(\"/test/npm/install\");\n- const pkg = {\n+ const pkg = new Package(\n+ {\nname: \"test-npm-install\",\n- location,\n- };\n- const config = {\n- stdio: \"inherit\",\n- };\n+ },\n+ path.normalize(\"/test/npm-install-deps\")\n+ );\n- await npmInstall(pkg, config);\n+ await npmInstall(pkg, {\n+ stdio: \"inherit\",\n+ });\nexpect(ChildProcessUtilities.exec).lastCalledWith(\"npm\", [\"install\"], {\n- cwd: location,\n+ cwd: pkg.location,\nstdio: \"inherit\",\n});\n});\n@@ -68,22 +71,22 @@ describe(\"npm-install\", () => {\nChildProcessUtilities.exec.mockRejectedValueOnce(new Error(\"whoopsy-doodle\"));\n- const location = path.normalize(\"/test/npm/install/error\");\n- const pkg = {\n+ const pkg = new Package(\n+ {\nname: \"test-npm-install-error\",\n- location,\n- };\n- const config = {\n- npmClient: \"yarn\",\n- };\n+ },\n+ path.normalize(\"/test/npm/install/error\")\n+ );\ntry {\n- await npmInstall(pkg, config);\n+ await npmInstall(pkg, {\n+ npmClient: \"yarn\",\n+ });\n} catch (err) {\nexpect(err.message).toBe(\"whoopsy-doodle\");\nexpect(ChildProcessUtilities.exec).lastCalledWith(\"yarn\", [\"install\", \"--non-interactive\"], {\n- cwd: location,\n+ cwd: pkg.location,\nstdio: \"pipe\",\n});\n}\n@@ -92,13 +95,8 @@ describe(\"npm-install\", () => {\ndescribe(\"npmInstall.dependencies()\", () => {\nit(\"installs dependencies in targeted directory\", async () => {\n- const location = path.normalize(\"/test/npm-install-deps\");\n- const manifestLocation = path.join(location, \"package.json\");\n- const backupManifest = `${manifestLocation}.lerna_backup`;\n- const pkg = {\n- location,\n- manifestLocation,\n- toJSON: () => ({\n+ const pkg = new Package(\n+ {\nname: \"npm-install-deps\",\nversion: \"1.0.0\",\nscripts: {\n@@ -115,16 +113,17 @@ describe(\"npm-install\", () => {\nexact: \"1.0.0\", // will be removed\n\"local-dev-dependency\": \"^1.0.0\",\n},\n- }),\n- };\n+ },\n+ path.normalize(\"/test/npm-install-deps\")\n+ );\n+ const backupManifest = `${pkg.manifestLocation}.lerna_backup`;\nconst dependencies = [\"@scoped/caret@^2.0.0\", \"@scoped/exact@2.0.0\", \"caret@^1.0.0\", \"exact@1.0.0\"];\n- const config = {};\n- await npmInstall.dependencies(pkg, dependencies, config);\n+ await npmInstall.dependencies(pkg, dependencies, {});\n- expect(fs.rename).lastCalledWith(manifestLocation, backupManifest);\n- expect(fs.renameSync).lastCalledWith(backupManifest, manifestLocation);\n- expect(writePkg).lastCalledWith(manifestLocation, {\n+ expect(fs.rename).lastCalledWith(pkg.manifestLocation, backupManifest);\n+ expect(fs.renameSync).lastCalledWith(backupManifest, pkg.manifestLocation);\n+ expect(writePkg).lastCalledWith(pkg.manifestLocation, {\nname: \"npm-install-deps\",\nversion: \"1.0.0\",\ndependencies: {\n@@ -139,19 +138,14 @@ describe(\"npm-install\", () => {\n},\n});\nexpect(ChildProcessUtilities.exec).lastCalledWith(\"npm\", [\"install\"], {\n- cwd: location,\n+ cwd: pkg.location,\nstdio: \"pipe\",\n});\n});\nit(\"supports custom registry\", async () => {\n- const registry = \"https://custom-registry/npm-install-deps\";\n- const location = path.normalize(\"/test/npm-install-deps\");\n- const manifestLocation = path.join(location, \"package.json\");\n- const pkg = {\n- location,\n- manifestLocation,\n- toJSON: () => ({\n+ const pkg = new Package(\n+ {\nname: \"npm-install-deps\",\nversion: \"1.0.0\",\ndependencies: {\n@@ -162,16 +156,17 @@ describe(\"npm-install\", () => {\ntagged: \"next\",\n\"local-dev-dependency\": \"file:../local-dev-dependency\",\n},\n- }),\n- };\n+ },\n+ path.normalize(\"/test/npm-install-deps\")\n+ );\nconst dependencies = [\"@scoped/tagged@next\", \"tagged@next\"];\nconst config = {\n- registry,\n+ registry: \"https://custom-registry/npm-install-deps\",\n};\nawait npmInstall.dependencies(pkg, dependencies, config);\n- expect(writePkg).lastCalledWith(manifestLocation, {\n+ expect(writePkg).lastCalledWith(pkg.manifestLocation, {\nname: \"npm-install-deps\",\nversion: \"1.0.0\",\ndependencies: {\n@@ -182,9 +177,9 @@ describe(\"npm-install\", () => {\n},\n});\nexpect(ChildProcessUtilities.exec).lastCalledWith(\"npm\", [\"install\"], {\n- cwd: location,\n+ cwd: pkg.location,\nenv: expect.objectContaining({\n- npm_config_registry: registry,\n+ npm_config_registry: config.registry,\n}),\nextendEnv: false,\nstdio: \"pipe\",\n@@ -192,12 +187,8 @@ describe(\"npm-install\", () => {\n});\nit(\"supports npm install --global-style\", async () => {\n- const location = path.normalize(\"/test/npm-install-deps\");\n- const manifestLocation = path.join(location, \"package.json\");\n- const pkg = {\n- location,\n- manifestLocation,\n- toJSON: () => ({\n+ const pkg = new Package(\n+ {\nname: \"npm-install-deps\",\nversion: \"1.0.0\",\ndependencies: {\n@@ -207,16 +198,16 @@ describe(\"npm-install\", () => {\ncaret: \"^1.0.0\",\n\"local-dev-dependency\": \"^1.0.0\",\n},\n- }),\n- };\n+ },\n+ path.normalize(\"/test/npm-install-deps\")\n+ );\nconst dependencies = [\"@scoped/foo@latest\", \"foo@latest\", \"caret@^1.0.0\"];\n- const config = {\n- npmGlobalStyle: true,\n- };\n- await npmInstall.dependencies(pkg, dependencies, config);\n+ await npmInstall.dependencies(pkg, dependencies, {\n+ npmGlobalStyle: true,\n+ });\n- expect(writePkg).lastCalledWith(manifestLocation, {\n+ expect(writePkg).lastCalledWith(pkg.manifestLocation, {\nname: \"npm-install-deps\",\nversion: \"1.0.0\",\ndependencies: {\n@@ -228,35 +219,31 @@ describe(\"npm-install\", () => {\n},\n});\nexpect(ChildProcessUtilities.exec).lastCalledWith(\"npm\", [\"install\", \"--global-style\"], {\n- cwd: location,\n+ cwd: pkg.location,\nstdio: \"pipe\",\n});\n});\nit(\"supports custom npmClient\", async () => {\n- const location = path.normalize(\"/test/npm-install-deps\");\n- const manifestLocation = path.join(location, \"package.json\");\n- const pkg = {\n- location,\n- manifestLocation,\n- toJSON: () => ({\n+ const pkg = new Package(\n+ {\nname: \"npm-install-deps\",\nversion: \"1.0.0\",\ndependencies: {\n\"@scoped/something\": \"^2.0.0\",\n\"local-dependency\": \"^1.0.0\",\n},\n- }),\n- };\n+ },\n+ path.normalize(\"/test/npm-install-deps\")\n+ );\nconst dependencies = [\"@scoped/something@^2.0.0\", \"something@^1.0.0\"];\n- const config = {\n+\n+ await npmInstall.dependencies(pkg, dependencies, {\nnpmClient: \"yarn\",\nmutex: \"network:12345\",\n- };\n-\n- await npmInstall.dependencies(pkg, dependencies, config);\n+ });\n- expect(writePkg).lastCalledWith(manifestLocation, {\n+ expect(writePkg).lastCalledWith(pkg.manifestLocation, {\nname: \"npm-install-deps\",\nversion: \"1.0.0\",\ndependencies: {\n@@ -267,17 +254,13 @@ describe(\"npm-install\", () => {\nexpect(ChildProcessUtilities.exec).lastCalledWith(\n\"yarn\",\n[\"install\", \"--mutex\", \"network:12345\", \"--non-interactive\"],\n- { cwd: location, stdio: \"pipe\" }\n+ { cwd: pkg.location, stdio: \"pipe\" }\n);\n});\nit(\"supports custom npmClientArgs\", async () => {\n- const location = path.normalize(\"/test/npm-install-deps\");\n- const manifestLocation = path.join(location, \"package.json\");\n- const pkg = {\n- location,\n- manifestLocation,\n- toJSON: () => ({\n+ const pkg = new Package(\n+ {\nname: \"npm-install-deps\",\nversion: \"1.0.0\",\noptionalDependencies: {\n@@ -288,16 +271,16 @@ describe(\"npm-install\", () => {\nsomething: \"github:foo/foo\",\n\"local-dev-dependency\": \"^1.0.0\",\n},\n- }),\n- };\n+ },\n+ path.normalize(\"/test/npm-install-deps\")\n+ );\nconst dependencies = [\"@scoped/something@github:foo/bar\", \"something@github:foo/foo\"];\n- const config = {\n- npmClientArgs: [\"--production\", \"--no-optional\"],\n- };\n- await npmInstall.dependencies(pkg, dependencies, config);\n+ await npmInstall.dependencies(pkg, dependencies, {\n+ npmClientArgs: [\"--production\", \"--no-optional\"],\n+ });\n- expect(writePkg).lastCalledWith(manifestLocation, {\n+ expect(writePkg).lastCalledWith(pkg.manifestLocation, {\nname: \"npm-install-deps\",\nversion: \"1.0.0\",\noptionalDependencies: {\n@@ -308,18 +291,14 @@ describe(\"npm-install\", () => {\n},\n});\nexpect(ChildProcessUtilities.exec).lastCalledWith(\"npm\", [\"install\", \"--production\", \"--no-optional\"], {\n- cwd: location,\n+ cwd: pkg.location,\nstdio: \"pipe\",\n});\n});\nit(\"overrides custom npmClient when using global style\", async () => {\n- const location = path.normalize(\"/test/npm-install-deps\");\n- const manifestLocation = path.join(location, \"package.json\");\n- const pkg = {\n- location,\n- manifestLocation,\n- toJSON: () => ({\n+ const pkg = new Package(\n+ {\nname: \"npm-install-deps\",\nversion: \"1.0.0\",\ndependencies: {\n@@ -330,18 +309,18 @@ describe(\"npm-install\", () => {\nsomething: \"github:foo/foo\",\n\"local-dev-dependency\": \"^1.0.0\",\n},\n- }),\n- };\n+ },\n+ path.normalize(\"/test/npm-install-deps\")\n+ );\nconst dependencies = [\"@scoped/something@github:foo/bar\", \"something@github:foo/foo\"];\n- const config = {\n+\n+ await npmInstall.dependencies(pkg, dependencies, {\nnpmClient: \"yarn\",\nnpmGlobalStyle: true,\nmutex: \"network:12345\",\n- };\n-\n- await npmInstall.dependencies(pkg, dependencies, config);\n+ });\n- expect(writePkg).lastCalledWith(manifestLocation, {\n+ expect(writePkg).lastCalledWith(pkg.manifestLocation, {\nname: \"npm-install-deps\",\nversion: \"1.0.0\",\ndependencies: {\n@@ -352,37 +331,29 @@ describe(\"npm-install\", () => {\n},\n});\nexpect(ChildProcessUtilities.exec).lastCalledWith(\"npm\", [\"install\", \"--global-style\"], {\n- cwd: location,\n+ cwd: pkg.location,\nstdio: \"pipe\",\n});\n});\nit(\"finishes early when no dependencies exist\", async () => {\n- const location = path.normalize(\"/test/npm-install-deps\");\n- const manifestLocation = path.join(location, \"package.json\");\n- const pkg = {\n- location,\n- manifestLocation,\n- toJSON: () => ({\n+ const pkg = new Package(\n+ {\nname: \"npm-install-deps\",\nversion: \"1.0.0\",\n- }),\n- };\n+ },\n+ path.normalize(\"/test/npm-install-deps\")\n+ );\nconst dependencies = [];\n- const config = {};\n- await npmInstall.dependencies(pkg, dependencies, config);\n+ await npmInstall.dependencies(pkg, dependencies, {});\nexpect(ChildProcessUtilities.exec).not.toBeCalled();\n});\nit(\"defaults temporary dependency versions to '*'\", async () => {\n- const location = path.normalize(\"/test/npm-install-deps\");\n- const manifestLocation = path.join(location, \"package.json\");\n- const pkg = {\n- location,\n- manifestLocation,\n- toJSON: () => ({\n+ const pkg = new Package(\n+ {\nname: \"npm-install-deps\",\nversion: \"1.0.0\",\ndependencies: {\n@@ -391,17 +362,17 @@ describe(\"npm-install\", () => {\ndevDependencies: {\n\"local-dev-dependency\": \"^1.0.0\",\n},\n- }),\n- };\n+ },\n+ path.normalize(\"/test/npm-install-deps\")\n+ );\nconst dependencies = [\n\"noversion\",\n\"@scoped/noversion\", // sorted by write-pkg\n];\n- const config = {};\n- await npmInstall.dependencies(pkg, dependencies, config);\n+ await npmInstall.dependencies(pkg, dependencies, {});\n- expect(writePkg).lastCalledWith(manifestLocation, {\n+ expect(writePkg).lastCalledWith(pkg.manifestLocation, {\nname: \"npm-install-deps\",\nversion: \"1.0.0\",\ndependencies: {\n@@ -413,75 +384,63 @@ describe(\"npm-install\", () => {\n});\nit(\"rejects with rename error\", async () => {\n- const location = path.normalize(\"/test/npm-install-deps/renameError\");\n- const manifestLocation = path.join(location, \"package.json\");\n- const pkg = {\n- location,\n- manifestLocation,\n- toJSON: () => ({\n- name: \"npm-install-deps/renameError\",\n+ const pkg = new Package(\n+ {\n+ name: \"npm-install-deps-rename-error\",\nversion: \"1.0.0\",\n- }),\n- };\n+ },\n+ path.normalize(\"/test/npm-install-deps/renameError\")\n+ );\nconst dependencies = [\"I'm just here so we don't exit early\"];\n- const config = {};\nfs.rename.mockRejectedValueOnce(new Error(\"Unable to rename file\"));\ntry {\n- await npmInstall.dependencies(pkg, dependencies, config);\n+ await npmInstall.dependencies(pkg, dependencies, {});\n} catch (err) {\nexpect(err.message).toBe(\"Unable to rename file\");\n}\n});\nit(\"cleans up synchronously after writeFile error\", async () => {\n- const location = path.normalize(\"/test/npm-install-deps/writeError\");\n- const manifestLocation = path.join(location, \"package.json\");\n- const backupManifest = `${manifestLocation}.lerna_backup`;\n- const pkg = {\n- location,\n- manifestLocation,\n- toJSON: () => ({\n- name: \"npm-install-deps/writeError\",\n+ const pkg = new Package(\n+ {\n+ name: \"npm-install-deps-write-error\",\nversion: \"1.0.0\",\n- }),\n- };\n+ },\n+ path.normalize(\"/test/npm-install-deps/writeError\")\n+ );\n+ const backupManifest = `${pkg.manifestLocation}.lerna_backup`;\nconst dependencies = [\"just-here-so-we-dont-exit-early\"];\n- const config = {};\nwritePkg.mockRejectedValueOnce(new Error(\"Unable to write file\"));\ntry {\n- await npmInstall.dependencies(pkg, dependencies, config);\n+ await npmInstall.dependencies(pkg, dependencies, {});\n} catch (err) {\nexpect(err.message).toBe(\"Unable to write file\");\n- expect(fs.renameSync).lastCalledWith(backupManifest, manifestLocation);\n+ expect(fs.renameSync).lastCalledWith(backupManifest, pkg.manifestLocation);\n}\n});\nit(\"cleans up synchronously after client install error\", async () => {\n- const location = path.normalize(\"/test/npm-install-deps/clientError\");\n- const manifestLocation = path.join(location, \"package.json\");\n- const backupManifest = `${manifestLocation}.lerna_backup`;\n- const pkg = {\n- location,\n- manifestLocation,\n- toJSON: () => ({\n- name: \"npm-install-deps/clientError\",\n+ const pkg = new Package(\n+ {\n+ name: \"npm-install-deps-client-error\",\nversion: \"1.0.0\",\n- }),\n- };\n+ },\n+ path.normalize(\"/test/npm-install-deps/clientError\")\n+ );\n+ const backupManifest = `${pkg.manifestLocation}.lerna_backup`;\nconst dependencies = [\"just-here-so-we-dont-exit-early\"];\n- const config = {};\nChildProcessUtilities.exec.mockRejectedValueOnce(new Error(\"Unable to install dependency\"));\ntry {\n- await npmInstall.dependencies(pkg, dependencies, config);\n+ await npmInstall.dependencies(pkg, dependencies, {});\n} catch (err) {\nexpect(err.message).toBe(\"Unable to install dependency\");\n- expect(fs.renameSync).lastCalledWith(backupManifest, manifestLocation);\n+ expect(fs.renameSync).lastCalledWith(backupManifest, pkg.manifestLocation);\n}\n});\n});\n", "new_path": "utils/npm-install/__tests__/npm-install.test.js", "old_path": "utils/npm-install/__tests__/npm-install.test.js" } ]
JavaScript
MIT License
lerna/lerna
feat(package): Add `serialize()` method
1
feat
package
807,849
29.03.2018 16:06:25
25,200
9371020d1aa088c08139b5343d77778824ebdd76
refactor(add): Map scope names after makeChanges()
[ { "change_type": "MODIFY", "diff": "@@ -79,14 +79,14 @@ class AddCommand extends Command {\nexecute() {\nthis.logger.info(`Add ${this.dependencyType} in ${this.packagesToChange.length} packages`);\n- return this.makeChanges().then(pkgs => {\n- this.logger.info(`Changes require bootstrap in ${pkgs.length} packages`);\n+ return this.makeChanges().then(() => {\n+ this.logger.info(`Changes require bootstrap in ${this.packagesToChange.length} packages`);\nreturn bootstrap(\nObject.assign({}, this.options, {\nargs: [],\ncwd: this.project.rootPath,\n- scope: pkgs,\n+ scope: this.packagesToChange.map(pkg => pkg.name),\n})\n);\n});\n@@ -136,7 +136,7 @@ class AddCommand extends Command {\n}\n}\n- return pkg.serialize().then(() => pkg.name);\n+ return pkg.serialize();\n};\nreturn pMap(this.packagesToChange, mapper);\n", "new_path": "commands/add/index.js", "old_path": "commands/add/index.js" } ]
JavaScript
MIT License
lerna/lerna
refactor(add): Map scope names after makeChanges()
1
refactor
add
791,690
29.03.2018 16:10:59
25,200
467453d2c15a4d3c111328a8fbfd65e3d5b052d0
core(config): switch to throttling settings object
[ { "change_type": "MODIFY", "diff": "@@ -137,7 +137,7 @@ class UnusedBytes extends Audit {\nstatic createAuditResult(result, graph) {\nconst simulatorOptions = PredictivePerf.computeRTTAndServerResponseTime(graph);\n// TODO: calibrate multipliers, see https://github.com/GoogleChrome/lighthouse/issues/820\n- Object.assign(simulatorOptions, {cpuTaskMultiplier: 1, layoutTaskMultiplier: 1});\n+ Object.assign(simulatorOptions, {cpuSlowdownMultiplier: 1, layoutTaskMultiplier: 1});\nconst simulator = new LoadSimulator(graph, simulatorOptions);\nconst debugString = result.debugString;\n", "new_path": "lighthouse-core/audits/byte-efficiency/byte-efficiency-audit.js", "old_path": "lighthouse-core/audits/byte-efficiency/byte-efficiency-audit.js" }, { "change_type": "MODIFY", "diff": "@@ -80,7 +80,7 @@ class LoadFastEnough4Pwa extends Audit {\n});\nlet firstRequestLatencies = Array.from(firstRequestLatenciesByOrigin.values());\n- const latency3gMin = Emulation.settings.TYPICAL_MOBILE_THROTTLING_METRICS.targetLatency - 10;\n+ const latency3gMin = Emulation.settings.MOBILE_3G_THROTTLING.targetLatencyMs - 10;\nconst areLatenciesAll3G = firstRequestLatencies.every(val => val.latency > latency3gMin);\nfirstRequestLatencies = firstRequestLatencies.map(item => ({\nurl: item.url,\n", "new_path": "lighthouse-core/audits/load-fast-enough-for-pwa.js", "old_path": "lighthouse-core/audits/load-fast-enough-for-pwa.js" }, { "change_type": "MODIFY", "diff": "'use strict';\nconst Driver = require('../gather/driver');\n+const emulation = require('../lib/emulation').settings;\n/* eslint-disable max-len */\nmodule.exports = {\nsettings: {\nmaxWaitForLoad: Driver.MAX_WAIT_FOR_FULLY_LOADED,\n+ throttlingMethod: 'devtools',\n+ throttling: {\n+ requestLatencyMs: emulation.MOBILE_3G_THROTTLING.adjustedLatencyMs,\n+ downloadThroughputKbps: emulation.MOBILE_3G_THROTTLING.adjustedDownloadThroughputKbps,\n+ uploadThroughputKbps: emulation.MOBILE_3G_THROTTLING.adjustedUploadThroughputKbps,\n+ cpuSlowdownMultiplier: emulation.CPU_THROTTLE_METRICS.rate,\n+ },\n},\npasses: [{\npassName: 'defaultPass',\n", "new_path": "lighthouse-core/config/default.js", "old_path": "lighthouse-core/config/default.js" }, { "change_type": "MODIFY", "diff": "@@ -1033,14 +1033,16 @@ class Driver {\n* @return {Promise<void>}\n*/\nasync setThrottling(settings, passConfig) {\n- const throttleCpu = passConfig.useThrottling && !settings.disableCpuThrottling;\n- const throttleNetwork = passConfig.useThrottling && !settings.disableNetworkThrottling;\n- const cpuPromise = throttleCpu ?\n- emulation.enableCPUThrottling(this) :\n+ if (settings.throttlingMethod !== 'devtools') {\n+ return emulation.clearAllNetworkEmulation(this);\n+ }\n+\n+ const cpuPromise = passConfig.useThrottling ?\n+ emulation.enableCPUThrottling(this, settings.throttling) :\nemulation.disableCPUThrottling(this);\n- const networkPromise = throttleNetwork ?\n- emulation.enableNetworkThrottling(this) :\n- emulation.disableNetworkThrottling(this);\n+ const networkPromise = passConfig.useThrottling ?\n+ emulation.enableNetworkThrottling(this, settings.throttling) :\n+ emulation.clearAllNetworkEmulation(this);\nawait Promise.all([cpuPromise, networkPromise]);\n}\n@@ -1056,8 +1058,7 @@ class Driver {\n}\n/**\n- * Enable internet connection, using emulated mobile settings if\n- * `options.settings.disableNetworkThrottling` is false.\n+ * Enable internet connection, using emulated mobile settings if applicable.\n* @param {{settings: LH.ConfigSettings, passConfig: LH.ConfigPass}} options\n* @return {Promise<void>}\n*/\n", "new_path": "lighthouse-core/gather/driver.js", "old_path": "lighthouse-core/gather/driver.js" }, { "change_type": "MODIFY", "diff": "@@ -16,13 +16,13 @@ const emulation = require('../../emulation').settings;\nconst DEFAULT_MAXIMUM_CONCURRENT_REQUESTS = 10;\n// Fast 3G emulation target from DevTools, WPT 3G - Fast setting\n-const DEFAULT_RTT = emulation.TYPICAL_MOBILE_THROTTLING_METRICS.targetLatency;\n-const DEFAULT_THROUGHPUT = emulation.TYPICAL_MOBILE_THROTTLING_METRICS.targetDownloadThroughput * 8; // 1.6 Mbps\n+const DEFAULT_RTT = emulation.MOBILE_3G_THROTTLING.targetLatencyMs;\n+const DEFAULT_THROUGHPUT = emulation.MOBILE_3G_THROTTLING.targetDownloadThroughputKbps * 1024; // 1.6 Mbps\n// same multiplier as Lighthouse uses for CPU emulation\nconst DEFAULT_CPU_TASK_MULTIPLIER = emulation.CPU_THROTTLE_METRICS.rate;\n// layout tasks tend to be less CPU-bound and do not experience the same increase in duration\n-const DEFAULT_LAYOUT_TASK_MULTIPLIER = DEFAULT_CPU_TASK_MULTIPLIER / 2;\n+const DEFAULT_LAYOUT_TASK_MULTIPLIER = 0.5;\n// if a task takes more than 10 seconds it's usually a sign it isn't actually CPU bound and we're overestimating\nconst DEFAULT_MAXIMUM_CPU_TASK_DURATION = 10000;\n@@ -45,7 +45,7 @@ class Simulator {\nrtt: DEFAULT_RTT,\nthroughput: DEFAULT_THROUGHPUT,\nmaximumConcurrentRequests: DEFAULT_MAXIMUM_CONCURRENT_REQUESTS,\n- cpuTaskMultiplier: DEFAULT_CPU_TASK_MULTIPLIER,\n+ cpuSlowdownMultiplier: DEFAULT_CPU_TASK_MULTIPLIER,\nlayoutTaskMultiplier: DEFAULT_LAYOUT_TASK_MULTIPLIER,\n},\noptions\n@@ -57,8 +57,8 @@ class Simulator {\nTcpConnection.maximumSaturatedConnections(this._rtt, this._throughput),\nthis._options.maximumConcurrentRequests\n);\n- this._cpuTaskMultiplier = this._options.cpuTaskMultiplier;\n- this._layoutTaskMultiplier = this._options.layoutTaskMultiplier;\n+ this._cpuSlowdownMultiplier = this._options.cpuSlowdownMultiplier;\n+ this._layoutTaskMultiplier = this._cpuSlowdownMultiplier * this._options.layoutTaskMultiplier;\nthis._nodeTiming = new Map();\nthis._numberInProgressByType = new Map();\n@@ -206,7 +206,7 @@ class Simulator {\nconst timingData = this._nodeTiming.get(node);\nconst multiplier = (/** @type {CpuNode} */ (node)).didPerformLayout()\n? this._layoutTaskMultiplier\n- : this._cpuTaskMultiplier;\n+ : this._cpuSlowdownMultiplier;\nconst totalDuration = Math.min(\nMath.round((/** @type {CpuNode} */ (node)).event.dur / 1000 * multiplier),\nDEFAULT_MAXIMUM_CPU_TASK_DURATION\n@@ -360,7 +360,7 @@ module.exports = Simulator;\n* @property {number} [throughput]\n* @property {number} [fallbackTTFB]\n* @property {number} [maximumConcurrentRequests]\n- * @property {number} [cpuTaskMultiplier]\n+ * @property {number} [cpuSlowdownMultiplier]\n* @property {number} [layoutTaskMultiplier]\n*/\n", "new_path": "lighthouse-core/lib/dependency-graph/simulator/simulator.js", "old_path": "lighthouse-core/lib/dependency-graph/simulator/simulator.js" }, { "change_type": "MODIFY", "diff": "* Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n*/\n-// @ts-nocheck\n'use strict';\n+const Driver = require('../gather/driver'); // eslint-disable-line no-unused-vars\n+\n+const NBSP = '\\xa0';\n+\n/**\n* Nexus 5X metrics adapted from emulated_devices/module.json\n*/\n@@ -40,17 +43,16 @@ const LATENCY_FACTOR = 3.75;\nconst THROUGHPUT_FACTOR = 0.9;\nconst TARGET_LATENCY = 150; // 150ms\n-const TARGET_DOWNLOAD_THROUGHPUT = Math.floor(1.6 * 1024 * 1024 / 8); // 1.6Mbps\n-const TARGET_UPLOAD_THROUGHPUT = Math.floor(750 * 1024 / 8); // 750Kbps\n-\n-const TYPICAL_MOBILE_THROTTLING_METRICS = {\n- targetLatency: TARGET_LATENCY,\n- latency: TARGET_LATENCY * LATENCY_FACTOR,\n- targetDownloadThroughput: TARGET_DOWNLOAD_THROUGHPUT,\n- downloadThroughput: TARGET_DOWNLOAD_THROUGHPUT * THROUGHPUT_FACTOR,\n- targetUploadThroughput: TARGET_UPLOAD_THROUGHPUT,\n- uploadThroughput: TARGET_UPLOAD_THROUGHPUT * THROUGHPUT_FACTOR,\n- offline: false,\n+const TARGET_DOWNLOAD_THROUGHPUT = Math.floor(1.6 * 1024); // 1.6Mbps\n+const TARGET_UPLOAD_THROUGHPUT = Math.floor(750); // 750Kbps\n+\n+const MOBILE_3G_THROTTLING = {\n+ targetLatencyMs: TARGET_LATENCY,\n+ adjustedLatencyMs: TARGET_LATENCY * LATENCY_FACTOR,\n+ targetDownloadThroughputKbps: TARGET_DOWNLOAD_THROUGHPUT,\n+ adjustedDownloadThroughputKbps: TARGET_DOWNLOAD_THROUGHPUT * THROUGHPUT_FACTOR,\n+ targetUploadThroughputKbps: TARGET_UPLOAD_THROUGHPUT,\n+ adjustedUploadThroughputKbps: TARGET_UPLOAD_THROUGHPUT * THROUGHPUT_FACTOR,\n};\nconst OFFLINE_METRICS = {\n@@ -75,34 +77,10 @@ const CPU_THROTTLE_METRICS = {\nrate: 4,\n};\n-function enableNexus5X(driver) {\n- // COMPAT FIMXE\n- // Injecting this function clientside is no longer neccessary as of m62. This is done\n- // on the backend when `Emulation.setTouchEmulationEnabled` is set.\n- // https://bugs.chromium.org/p/chromium/issues/detail?id=133915#c63\n- // Once m62 hits stable (~Oct 20th) we can nuke this entirely\n/**\n- * Finalizes touch emulation by enabling `\"ontouchstart\" in window` feature detect\n- * to work. Messy hack, though copied verbatim from DevTools' emulation/TouchModel.js\n- * where it's been working for years. addScriptToEvaluateOnLoad runs before any of the\n- * page's JavaScript executes.\n+ * @param {Driver} driver\n*/\n- /* eslint-disable no-proto */ /* global window, document */ /* istanbul ignore next */\n- const injectedTouchEventsFunction = function() {\n- const touchEvents = ['ontouchstart', 'ontouchend', 'ontouchmove', 'ontouchcancel'];\n- const recepients = [window.__proto__, document.__proto__];\n- for (let i = 0; i < touchEvents.length; ++i) {\n- for (let j = 0; j < recepients.length; ++j) {\n- if (!(touchEvents[i] in recepients[j])) {\n- Object.defineProperty(recepients[j], touchEvents[i], {\n- value: null, writable: true, configurable: true, enumerable: true,\n- });\n- }\n- }\n- }\n- };\n- /* eslint-enable */\n-\n+function enableNexus5X(driver) {\nreturn Promise.all([\ndriver.sendCommand('Emulation.setDeviceMetricsOverride', NEXUS5X_EMULATION_METRICS),\n// Network.enable must be called for UA overriding to work\n@@ -112,47 +90,122 @@ function enableNexus5X(driver) {\nenabled: true,\nconfiguration: 'mobile',\n}),\n- driver.sendCommand('Page.addScriptToEvaluateOnLoad', {\n- scriptSource: '(' + injectedTouchEventsFunction.toString() + ')()',\n- }),\n]);\n}\n-function enableNetworkThrottling(driver) {\n- return driver.sendCommand('Network.emulateNetworkConditions', TYPICAL_MOBILE_THROTTLING_METRICS);\n+/**\n+ * @param {Driver} driver\n+ * @param {LH.ThrottlingSettings|undefined} throttlingSettings\n+ * @return {Promise<void>}\n+ */\n+function enableNetworkThrottling(driver, throttlingSettings) {\n+ /** @type {LH.Crdp.Network.EmulateNetworkConditionsRequest} */\n+ let conditions;\n+ if (throttlingSettings) {\n+ conditions = {\n+ offline: false,\n+ latency: throttlingSettings.requestLatencyMs || 0,\n+ downloadThroughput: throttlingSettings.downloadThroughputKbps || 0,\n+ uploadThroughput: throttlingSettings.uploadThroughputKbps || 0,\n+ };\n+ } else {\n+ conditions = {\n+ offline: false,\n+ latency: MOBILE_3G_THROTTLING.adjustedLatencyMs,\n+ downloadThroughput: MOBILE_3G_THROTTLING.adjustedDownloadThroughputKbps,\n+ uploadThroughput: MOBILE_3G_THROTTLING.adjustedUploadThroughputKbps,\n+ };\n}\n-function disableNetworkThrottling(driver) {\n+ // DevTools expects throughput in bytes per second rather than kbps\n+ conditions.downloadThroughput = Math.floor(conditions.downloadThroughput * 1024 / 8);\n+ conditions.uploadThroughput = Math.floor(conditions.uploadThroughput * 1024 / 8);\n+ return driver.sendCommand('Network.emulateNetworkConditions', conditions);\n+}\n+\n+/**\n+ * @param {Driver} driver\n+ * @return {Promise<void>}\n+ */\n+function clearAllNetworkEmulation(driver) {\nreturn driver.sendCommand('Network.emulateNetworkConditions', NO_THROTTLING_METRICS);\n}\n+/**\n+ * @param {Driver} driver\n+ * @return {Promise<void>}\n+ */\nfunction goOffline(driver) {\nreturn driver.sendCommand('Network.emulateNetworkConditions', OFFLINE_METRICS);\n}\n-function enableCPUThrottling(driver) {\n- return driver.sendCommand('Emulation.setCPUThrottlingRate', CPU_THROTTLE_METRICS);\n+/**\n+ * @param {Driver} driver\n+ * @param {LH.ThrottlingSettings|undefined} throttlingSettings\n+ * @return {Promise<void>}\n+ */\n+function enableCPUThrottling(driver, throttlingSettings) {\n+ const rate = throttlingSettings\n+ ? throttlingSettings.cpuSlowdownMultiplier\n+ : CPU_THROTTLE_METRICS.rate;\n+ return driver.sendCommand('Emulation.setCPUThrottlingRate', {rate});\n}\n+/**\n+ * @param {Driver} driver\n+ * @return {Promise<void>}\n+ */\nfunction disableCPUThrottling(driver) {\nreturn driver.sendCommand('Emulation.setCPUThrottlingRate', NO_CPU_THROTTLE_METRICS);\n}\n-function getEmulationDesc() {\n- const {latency, downloadThroughput, uploadThroughput} = TYPICAL_MOBILE_THROTTLING_METRICS;\n- const byteToMbit = bytes => (bytes / 1024 / 1024 * 8).toFixed(1);\n+/**\n+ * @param {LH.ConfigSettings} settings\n+ * @return {{deviceEmulation: string, cpuThrottling: string, networkThrottling: string}}\n+ */\n+function getEmulationDesc(settings) {\n+ let cpuThrottling;\n+ let networkThrottling;\n+\n+ /** @type {LH.ThrottlingSettings} */\n+ const throttling = settings.throttling || {};\n+\n+ switch (settings.throttlingMethod) {\n+ case 'provided':\n+ cpuThrottling = 'Provided by environment';\n+ networkThrottling = 'Provided by environment';\n+ break;\n+ case 'devtools': {\n+ const {cpuSlowdownMultiplier, requestLatencyMs} = throttling;\n+ cpuThrottling = `${cpuSlowdownMultiplier}x slowdown (DevTools)`;\n+ networkThrottling = `${requestLatencyMs}${NBSP}ms HTTP RTT, ` +\n+ `${throttling.downloadThroughputKbps}${NBSP}Kbps down, ` +\n+ `${throttling.uploadThroughputKbps}${NBSP}Kbps up (DevTools)`;\n+ break;\n+ }\n+ case 'simulate': {\n+ const {cpuSlowdownMultiplier, rttMs, throughputKbps} = throttling;\n+ cpuThrottling = `${cpuSlowdownMultiplier}x slowdown (Simulated)`;\n+ networkThrottling = `${rttMs}${NBSP}ms TCP RTT, ` +\n+ `${throughputKbps}${NBSP}Kbps throughput (Simulated)`;\n+ break;\n+ }\n+ default:\n+ cpuThrottling = 'Unknown';\n+ networkThrottling = 'Unknown';\n+ }\n+\nreturn {\n- 'deviceEmulation': 'Nexus 5X',\n- 'cpuThrottling': `${CPU_THROTTLE_METRICS.rate}x slowdown`,\n- 'networkThrottling': `${latency}ms RTT, ${byteToMbit(downloadThroughput)}Mbps down, ` +\n- `${byteToMbit(uploadThroughput)}Mbps up`,\n+ deviceEmulation: settings.disableDeviceEmulation ? 'Disabled' : 'Nexus 5X',\n+ cpuThrottling,\n+ networkThrottling,\n};\n}\nmodule.exports = {\nenableNexus5X,\nenableNetworkThrottling,\n- disableNetworkThrottling,\n+ clearAllNetworkEmulation,\nenableCPUThrottling,\ndisableCPUThrottling,\ngoOffline,\n@@ -160,7 +213,7 @@ module.exports = {\nsettings: {\nNEXUS5X_EMULATION_METRICS,\nNEXUS5X_USERAGENT,\n- TYPICAL_MOBILE_THROTTLING_METRICS,\n+ MOBILE_3G_THROTTLING,\nOFFLINE_METRICS,\nNO_THROTTLING_METRICS,\nNO_CPU_THROTTLE_METRICS,\n", "new_path": "lighthouse-core/lib/emulation.js", "old_path": "lighthouse-core/lib/emulation.js" }, { "change_type": "MODIFY", "diff": "@@ -82,12 +82,11 @@ sentryDelegate.init = function init(opts) {\n);\n}\n- const context = {\n+ const context = Object.assign({\nurl: opts.url,\ndeviceEmulation: !opts.flags.disableDeviceEmulation,\n- networkThrottling: !opts.flags.disableNetworkThrottling,\n- cpuThrottling: !opts.flags.disableCpuThrottling,\n- };\n+ throttlingMethod: opts.flags.throttlingMethod,\n+ }, opts.flags.throttling);\nsentryDelegate.mergeContext({extra: Object.assign({}, environmentData.extra, context)});\nreturn context;\n", "new_path": "lighthouse-core/lib/sentry.js", "old_path": "lighthouse-core/lib/sentry.js" }, { "change_type": "MODIFY", "diff": "@@ -69,8 +69,6 @@ class ReportRenderer {\nconst item = this._dom.cloneTemplate('#tmpl-lh-env__items', env);\nthis._dom.find('.lh-env__name', item).textContent = runtime.name;\nthis._dom.find('.lh-env__description', item).textContent = runtime.description;\n- this._dom.find('.lh-env__enabled', item).textContent =\n- runtime.enabled ? 'Enabled' : 'Disabled';\nenv.appendChild(item);\n});\n", "new_path": "lighthouse-core/report/v2/renderer/report-renderer.js", "old_path": "lighthouse-core/report/v2/renderer/report-renderer.js" }, { "change_type": "MODIFY", "diff": "</li>\n<template id=\"tmpl-lh-env__items\">\n<li class=\"lh-env__item\">\n- <span class=\"lh-env__name\"><!-- fill me --></span>\n- <span class=\"lh-env__description\"><!-- fill me --></span>:\n- <b class=\"lh-env__enabled\"><!-- fill me --></b>\n+ <span class=\"lh-env__name\"><!-- fill me --></span>:\n+ <span class=\"lh-env__description\"><!-- fill me --></span>\n</li>\n</template>\n</ul>\n", "new_path": "lighthouse-core/report/v2/templates.html", "old_path": "lighthouse-core/report/v2/templates.html" }, { "change_type": "MODIFY", "diff": "@@ -389,21 +389,18 @@ class Runner {\n* @return {!Object} runtime config\n*/\nstatic getRuntimeConfig(settings) {\n- const emulationDesc = emulation.getEmulationDesc();\n+ const emulationDesc = emulation.getEmulationDesc(settings);\nconst environment = [\n{\nname: 'Device Emulation',\n- enabled: !settings.disableDeviceEmulation,\ndescription: emulationDesc['deviceEmulation'],\n},\n{\nname: 'Network Throttling',\n- enabled: !settings.disableNetworkThrottling,\ndescription: emulationDesc['networkThrottling'],\n},\n{\nname: 'CPU Throttling',\n- enabled: !settings.disableCpuThrottling,\ndescription: emulationDesc['cpuThrottling'],\n},\n];\n", "new_path": "lighthouse-core/runner.js", "old_path": "lighthouse-core/runner.js" }, { "change_type": "MODIFY", "diff": "@@ -79,10 +79,13 @@ connection.sendCommand = function(command, params) {\ncase 'Network.getResponseBody':\nreturn new Promise(res => setTimeout(res, MAX_WAIT_FOR_PROTOCOL + 20));\ncase 'Page.enable':\n+ case 'Network.enable':\ncase 'Tracing.start':\ncase 'ServiceWorker.enable':\ncase 'ServiceWorker.disable':\ncase 'Network.setExtraHTTPHeaders':\n+ case 'Network.emulateNetworkConditions':\n+ case 'Emulation.setCPUThrottlingRate':\nreturn Promise.resolve({});\ncase 'Tracing.end':\nreturn Promise.reject(new Error('tracing not started'));\n@@ -401,4 +404,88 @@ describe('Multiple tab check', () => {\nreturn driverStub.assertNoSameOriginServiceWorkerClients(pageUrl);\n});\n+\n+ describe('.goOnline', () => {\n+ it('re-establishes previous throttling settings', async () => {\n+ await driverStub.goOnline({\n+ passConfig: {useThrottling: true},\n+ settings: {\n+ throttlingMethod: 'devtools',\n+ throttling: {\n+ requestLatencyMs: 500,\n+ downloadThroughputKbps: 1000,\n+ uploadThroughputKbps: 1000,\n+ },\n+ },\n+ });\n+\n+ const emulateCommand = sendCommandParams\n+ .find(item => item.command === 'Network.emulateNetworkConditions');\n+ assert.ok(emulateCommand, 'did not call emulate network');\n+ assert.deepStrictEqual(emulateCommand.params, {\n+ offline: false,\n+ latency: 500,\n+ downloadThroughput: 1000 * 1024 / 8,\n+ uploadThroughput: 1000 * 1024 / 8,\n+ });\n+ });\n+\n+ it('clears network emulation when throttling is not devtools', async () => {\n+ await driverStub.goOnline({\n+ passConfig: {useThrottling: true},\n+ settings: {\n+ throttlingMethod: 'provided',\n+ },\n+ });\n+\n+ const emulateCommand = sendCommandParams\n+ .find(item => item.command === 'Network.emulateNetworkConditions');\n+ assert.ok(emulateCommand, 'did not call emulate network');\n+ assert.deepStrictEqual(emulateCommand.params, {\n+ offline: false,\n+ latency: 0,\n+ downloadThroughput: 0,\n+ uploadThroughput: 0,\n+ });\n+ });\n+\n+ it('clears network emulation when useThrottling is false', async () => {\n+ await driverStub.goOnline({\n+ passConfig: {useThrottling: false},\n+ settings: {\n+ throttlingMethod: 'devtools',\n+ throttling: {\n+ requestLatencyMs: 500,\n+ downloadThroughputKbps: 1000,\n+ uploadThroughputKbps: 1000,\n+ },\n+ },\n+ });\n+\n+ const emulateCommand = sendCommandParams\n+ .find(item => item.command === 'Network.emulateNetworkConditions');\n+ assert.ok(emulateCommand, 'did not call emulate network');\n+ assert.deepStrictEqual(emulateCommand.params, {\n+ offline: false,\n+ latency: 0,\n+ downloadThroughput: 0,\n+ uploadThroughput: 0,\n+ });\n+ });\n+ });\n+\n+ describe('.goOffline', () => {\n+ it('should send offline emulation', async () => {\n+ await driverStub.goOffline();\n+ const emulateCommand = sendCommandParams\n+ .find(item => item.command === 'Network.emulateNetworkConditions');\n+ assert.ok(emulateCommand, 'did not call emulate network');\n+ assert.deepStrictEqual(emulateCommand.params, {\n+ offline: true,\n+ latency: 0,\n+ downloadThroughput: 0,\n+ uploadThroughput: 0,\n+ });\n+ });\n+ });\n});\n", "new_path": "lighthouse-core/test/gather/driver-test.js", "old_path": "lighthouse-core/test/gather/driver-test.js" }, { "change_type": "MODIFY", "diff": "@@ -134,8 +134,8 @@ describe('GatherRunner', function() {\ncalledNetworkEmulation: false,\ncalledCpuEmulation: false,\n};\n- const createEmulationCheck = variable => () => {\n- tests[variable] = true;\n+ const createEmulationCheck = variable => (arg) => {\n+ tests[variable] = arg;\nreturn true;\n};\n@@ -148,9 +148,11 @@ describe('GatherRunner', function() {\nreturn GatherRunner.setupDriver(driver, {}, {\nsettings: {},\n}).then(_ => {\n- assert.equal(tests.calledDeviceEmulation, true);\n- assert.equal(tests.calledNetworkEmulation, true);\n- assert.equal(tests.calledCpuEmulation, true);\n+ assert.ok(tests.calledDeviceEmulation, 'did not call device emulation');\n+ assert.deepEqual(tests.calledNetworkEmulation, {\n+ latency: 0, downloadThroughput: 0, uploadThroughput: 0, offline: false,\n+ });\n+ assert.ok(!tests.calledCpuEmulation, 'called cpu emulation');\n});\n});\n@@ -173,6 +175,8 @@ describe('GatherRunner', function() {\nreturn GatherRunner.setupDriver(driver, {}, {\nsettings: {\ndisableDeviceEmulation: true,\n+ throttlingMethod: 'devtools',\n+ throttling: {},\n},\n}).then(_ => {\nassert.equal(tests.calledDeviceEmulation, false);\n@@ -181,7 +185,7 @@ describe('GatherRunner', function() {\n});\n});\n- it('stops network throttling when disableNetworkThrottling flag is true', () => {\n+ it('stops throttling when not devtools', () => {\nconst tests = {\ncalledDeviceEmulation: false,\ncalledNetworkEmulation: false,\n@@ -199,18 +203,18 @@ describe('GatherRunner', function() {\nreturn GatherRunner.setupDriver(driver, {}, {\nsettings: {\n- disableNetworkThrottling: true,\n+ throttlingMethod: 'provided',\n},\n}).then(_ => {\n- assert.ok(tests.calledDeviceEmulation, 'called device emulation');\n+ assert.ok(tests.calledDeviceEmulation, 'did not call device emulation');\nassert.deepEqual(tests.calledNetworkEmulation, [{\nlatency: 0, downloadThroughput: 0, uploadThroughput: 0, offline: false,\n}]);\n- assert.ok(tests.calledCpuEmulation, 'called CPU emulation');\n+ assert.ok(!tests.calledCpuEmulation, 'called CPU emulation');\n});\n});\n- it('stops cpu throttling when disableCpuThrottling flag is true', () => {\n+ it('sets throttling according to settings', () => {\nconst tests = {\ncalledDeviceEmulation: false,\ncalledNetworkEmulation: false,\n@@ -228,11 +232,19 @@ describe('GatherRunner', function() {\nreturn GatherRunner.setupDriver(driver, {}, {\nsettings: {\n- disableCpuThrottling: true,\n+ throttlingMethod: 'devtools',\n+ throttling: {\n+ requestLatencyMs: 100,\n+ downloadThroughputKbps: 8,\n+ uploadThroughputKbps: 8,\n+ cpuSlowdownMultiplier: 1,\n+ },\n},\n}).then(_ => {\n- assert.ok(tests.calledDeviceEmulation, 'called device emulation');\n- assert.ok(tests.calledNetworkEmulation, 'called network emulation');\n+ assert.ok(tests.calledDeviceEmulation, 'did not call device emulation');\n+ assert.deepEqual(tests.calledNetworkEmulation, [{\n+ latency: 100, downloadThroughput: 1024, uploadThroughput: 1024, offline: false,\n+ }]);\nassert.deepEqual(tests.calledCpuEmulation, [{rate: 1}]);\n});\n});\n", "new_path": "lighthouse-core/test/gather/gather-runner-test.js", "old_path": "lighthouse-core/test/gather/gather-runner-test.js" }, { "change_type": "MODIFY", "diff": "@@ -61,7 +61,10 @@ describe('DependencyGraph/Simulator', () => {\nconst cpuNode = new CpuNode(cpuTask({duration: 200}));\ncpuNode.addDependency(rootNode);\n- const simulator = new Simulator(rootNode, {serverResponseTimeByOrigin, cpuTaskMultiplier: 5});\n+ const simulator = new Simulator(rootNode, {\n+ serverResponseTimeByOrigin,\n+ cpuSlowdownMultiplier: 5,\n+ });\nconst result = simulator.simulate();\n// should be 2 RTTs and 500ms for the server response time + 200 CPU\nassert.equal(result.timeInMs, 300 + 500 + 200);\n@@ -99,7 +102,10 @@ describe('DependencyGraph/Simulator', () => {\nnodeA.addDependent(nodeC);\nnodeA.addDependent(nodeD);\n- const simulator = new Simulator(nodeA, {serverResponseTimeByOrigin, cpuTaskMultiplier: 5});\n+ const simulator = new Simulator(nodeA, {\n+ serverResponseTimeByOrigin,\n+ cpuSlowdownMultiplier: 5,\n+ });\nconst result = simulator.simulate();\n// should be 800ms A, then 1000 ms total for B, C, D in serial\nassert.equal(result.timeInMs, 1800);\n@@ -123,7 +129,10 @@ describe('DependencyGraph/Simulator', () => {\nnodeC.addDependent(nodeD);\nnodeC.addDependent(nodeF); // finishes 400 ms after D\n- const simulator = new Simulator(nodeA, {serverResponseTimeByOrigin, cpuTaskMultiplier: 5});\n+ const simulator = new Simulator(nodeA, {\n+ serverResponseTimeByOrigin,\n+ cpuSlowdownMultiplier: 5,\n+ });\nconst result = simulator.simulate();\n// should be 800ms each for A, B, C, D, with F finishing 400 ms after D\nassert.equal(result.timeInMs, 3600);\n", "new_path": "lighthouse-core/test/lib/dependency-graph/simulator/simulator-test.js", "old_path": "lighthouse-core/test/lib/dependency-graph/simulator/simulator-test.js" }, { "change_type": "MODIFY", "diff": "@@ -105,11 +105,9 @@ describe('ReportRenderer V2', () => {\nassert.equal(userAgent.textContent, sampleResults.userAgent, 'user agent populated');\n// Check runtime settings were populated.\n- const enables = header.querySelectorAll('.lh-env__enabled');\nconst names = Array.from(header.querySelectorAll('.lh-env__name')).slice(1);\nconst descriptions = header.querySelectorAll('.lh-env__description');\nsampleResults.runtimeConfig.environment.forEach((env, i) => {\n- assert.equal(enables[i].textContent, env.enabled ? 'Enabled' : 'Disabled');\nassert.equal(names[i].textContent, env.name);\nassert.equal(descriptions[i].textContent, env.description);\n});\n", "new_path": "lighthouse-core/test/report/v2/renderer/report-renderer-test.js", "old_path": "lighthouse-core/test/report/v2/renderer/report-renderer-test.js" }, { "change_type": "MODIFY", "diff": "\"lighthouse-cli/**/*.js\",\n\"lighthouse-core/audits/audit.js\",\n\"lighthouse-core/lib/dependency-graph/**/*.js\",\n+ \"lighthouse-core/lib/emulation.js\",\n\"lighthouse-core/gather/connections/**/*.js\",\n\"lighthouse-core/gather/gatherers/gatherer.js\",\n\"lighthouse-core/scripts/*.js\",\n", "new_path": "tsconfig.json", "old_path": "tsconfig.json" }, { "change_type": "MODIFY", "diff": "@@ -10,6 +10,18 @@ declare global {\nmodule LH {\nexport import Crdp = _Crdp;\n+ interface ThrottlingSettings {\n+ // simulation settings\n+ rttMs?: number;\n+ throughputKbps?: number;\n+ // devtools settings\n+ requestLatencyMs?: number;\n+ downloadThroughputKbps?: number;\n+ uploadThroughputKbps?: number;\n+ // used by both\n+ cpuSlowdownMultiplier?: number\n+ }\n+\ninterface SharedFlagsSettings {\nmaxWaitForLoad?: number;\nblockedUrlPatterns?: string[];\n@@ -18,8 +30,8 @@ declare global {\ngatherMode?: boolean | string;\ndisableStorageReset?: boolean;\ndisableDeviceEmulation?: boolean;\n- disableCpuThrottling?: boolean;\n- disableNetworkThrottling?: boolean;\n+ throttlingMethod?: 'devtools'|'simulate'|'provided';\n+ throttling?: ThrottlingSettings;\nonlyAudits?: string[];\nonlyCategories?: string[];\nskipAudits?: string[];\n", "new_path": "typings/externs.d.ts", "old_path": "typings/externs.d.ts" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
core(config): switch to throttling settings object (#4879)
1
core
config
679,913
29.03.2018 16:48:27
-3,600
3dc30a8eee86f336a3d4ce8171044f115ee69428
feat(pointfree): add combinators, update controlflow words, remove execq add condq(), loopq() update dotimes() to use quotations from stack, no more HOF add dip/2/3/4 combinators add keep/2/3 combinators add bi/2/3 combinators add dup3 refactor exec to work w/ quotations, remove execq add/update tests
[ { "change_type": "MODIFY", "diff": "\"keywords\": [\n\"composition\",\n\"concatenative\",\n+ \"dataflow\",\n\"DSL\",\n\"ES6\",\n\"Forth\",\n", "new_path": "packages/pointfree/package.json", "old_path": "packages/pointfree/package.json" }, { "change_type": "MODIFY", "diff": "@@ -286,6 +286,21 @@ export const dup2 = (ctx: StackContext) => {\nreturn ctx;\n};\n+/**\n+ * Duplicates top 3 vals on d-stack.\n+ *\n+ * ( x y -- x y x y )\n+ *\n+ * @param ctx\n+ */\n+export const dup3 = (ctx: StackContext) => {\n+ const stack = ctx[0];\n+ let n = stack.length - 3;\n+ $n(n, 0);\n+ stack.push(stack[n], stack[n + 1], stack[n + 2]);\n+ return ctx;\n+};\n+\n/**\n* If TOS is truthy then push copy of it on d-stack:\n*\n@@ -844,25 +859,110 @@ export const wordU = (prog: StackProgram, n = 1, env?: StackEnv, mergeEnv = true\n};\n/**\n- * Executes TOS as stack function and places result back on d-stack.\n+ * Executes TOS as stack function and places result back on d-stack. TOS\n+ * MUST be a valid word or quotation.\n*\n* ( x -- x() )\n*\n* @param ctx\n*/\nexport const exec = (ctx: StackContext) =>\n- ($(ctx[0], 1), ctx[0].pop()(ctx));\n+ ($(ctx[0], 1), $stackFn(ctx[0].pop())(ctx));\n+\n+//////////////////// Dataflow combinators ////////////////////\n/**\n- * Pops TOS and executes it as stack program. TOS MUST be a valid\n- * StackProgram (array of values/words, i.e. a quotation).\n+ * Removes `x` from d-stack, calls `q` and restores `x` to the top of\n+ * the d-stack after quotation is finished.\n+ *\n+ * ( x q -- x )\n*\n- * ( x -- ? )\n+ * Same behavior as: `[swap, movdr, exec, movrd]`, only the current\n+ * implementation doesn't use r-stack.\n*\n* @param ctx\n*/\n-export const execq = (ctx: StackContext) =>\n- ($(ctx[0], 1), run(ctx[0].pop(), ctx));\n+export const dip = (ctx: StackContext) => {\n+ const stack = ctx[0];\n+ $(stack, 2);\n+ const q = stack.pop();\n+ const x = stack.pop();\n+ ctx = $stackFn(q)(ctx);\n+ ctx[0].push(x);\n+ return ctx;\n+};\n+\n+/**\n+ * Removes `x y` from d-stack, calls `q` and restores removed vals\n+ * to the top of the d-stack after quotation is finished.\n+ *\n+ * ( x y q -- x y )\n+ */\n+export const dip2 = word([swap, [dip], dip]);\n+\n+/**\n+ * Removes `x y z` from d-stack, calls `q` and restores removed\n+ * vals to the top of the d-stack after quotation is finished.\n+ *\n+ * ( x y z q -- x y z )\n+ */\n+export const dip3 = word([swap, [dip2], dip]);\n+\n+/**\n+ * Removes `x y z w` from d-stack, calls `q` and restores removed\n+ * vals to the top of the d-stack after quotation is finished.\n+ *\n+ * ( x y z w q -- x y z w )\n+ */\n+export const dip4 = word([swap, [dip3], dip]);\n+\n+/**\n+ * Calls a quotation with a value on the d-stack, restoring the value\n+ * after quotation finished.\n+ *\n+ * ( x q -- .. x )\n+ */\n+export const keep = word([over, [exec], dip]);\n+\n+/**\n+ * Call a quotation with two values on the stack, restoring the values\n+ * after quotation finished.\n+ *\n+ * ( x y q -- .. x y )\n+ */\n+export const keep2 = word([[dup2], dip, dip2]);\n+\n+/**\n+ * Call a quotation with two values on the stack, restoring the values\n+ * after quotation finished.\n+ *\n+ * ( x y z q -- .. x y z )\n+ */\n+export const keep3 = word([[dup3], dip, dip3]);\n+\n+/**\n+ * First applies `p` to the value `x`, then applies `q` to the same\n+ * value.\n+ *\n+ * ( x p q -- pres qres )\n+ */\n+export const bi = word([[keep], dip, exec]);\n+\n+/**\n+ * First applies `p` to the two input values `x y`, then applies `q` to\n+ * the same values.\n+ *\n+ * ( x y p q -- pres qres )\n+ */\n+export const bi2 = word([[keep2], dip, exec]);\n+\n+/**\n+ * First applies `p` to the three input values `x y z`, then applies `q`\n+ * to the same values.\n+ *\n+ * ( x y z p q -- pres qres )\n+ */\n+export const bi3 = word([[keep3], dip, exec]);\n//////////////////// Conditionals ////////////////////\n@@ -874,7 +974,7 @@ export const execq = (ctx: StackContext) =>\n* Note: Unlike JS `if() {...} else {...}` constructs, the actual\n* conditional is NOT part of this word.\n*\n- * ( x -- ? )\n+ * ( bool -- ? )\n*\n* @param _then\n* @param _else\n@@ -883,6 +983,23 @@ export const cond = (_then: StackProc, _else: StackProc = nop) =>\n(ctx: StackContext) =>\n($(ctx[0], 1), $stackFn(ctx[0].pop() ? _then : _else)(ctx));\n+/**\n+ * Non-HOF version of `cond`, expects `test` result and both branches on\n+ * d-stack. Executes `thenq` word/quotation if `test` is truthy, else\n+ * runs `elseq`.\n+ *\n+ * ( test thenq elseq -- ? )\n+ *\n+ * @param ctx\n+ */\n+export const condq = (ctx: StackContext) => {\n+ const stack = ctx[0];\n+ $(stack, 3);\n+ const _else = stack.pop();\n+ const _then = stack.pop();\n+ return $stackFn(stack.pop() ? _then : _else)(ctx);\n+};\n+\n/**\n* Higher order word. Takes an object of stack programs with keys in the\n* object being used to check for equality with TOS. If a match is\n@@ -914,8 +1031,8 @@ export const cases = (cases: IObjectOf<StackProc>) =>\n//////////////////// Loop constructs ////////////////////\n/**\n- * Takes a `test` and `body` stack program. Applies test to\n- * copy of TOS and executes body. Repeats while test is truthy.\n+ * Higher order word. Takes a `test` and `body` stack program. Applies\n+ * test to copy of TOS and executes body. Repeats while test is truthy.\n*\n* ( -- ? )\n*\n@@ -945,11 +1062,26 @@ export const loop = (test: StackProc, body: StackProc) => {\n};\n/**\n- * Pops TOS and executes given `body` word/quotation `n` times. In each\n- * iteration pushes current counter on d-stack prior to executing body.\n+ * Non-HOF version of `loop`. Expects test and body quotations/words on\n+ * d-stack.\n+ *\n+ * ( testq bodyq -- ? )\n+ *\n+ * @param ctx\n+ */\n+export const loopq = (ctx: StackContext) => {\n+ const stack = ctx[0];\n+ $(stack, 2);\n+ const body = stack.pop();\n+ return loop(stack.pop(), body)(ctx);\n+};\n+\n+/**\n+ * Executes given `body` word/quotation `n` times. In each iteration\n+ * pushes current counter on d-stack prior to executing body.\n*\n* ```\n- * pf.run([3, pf.dotimes(\"i=\", pf.swap, pf.add, pf.print)])\n+ * pf.run([3, [\"i=\", pf.swap, pf.add, pf.print], pf.dotimes])\n* // i=0\n* // i=1\n* // i=2\n@@ -959,29 +1091,28 @@ export const loop = (test: StackProc, body: StackProc) => {\n*\n* ```\n* // range gen\n- * pf.run([3, pf.dotimes()])\n+ * pf.run([3, [], pf.dotimes])\n* [ [ 0, 1, 2 ], [], {} ]\n*\n- * // range gen (as array)\n- * pf.runU([3, pf.cpdr, pf.dotimes(), pf.movrd, pf.collect])\n+ * // range gen (collect results as array)\n+ * pf.runU([3, pf.cpdr, [], pf.dotimes, pf.movrd, pf.collect])\n* // [ 0, 1, 2 ]\n* ```\n*\n- * ( n -- ? )\n+ * ( n body -- ? )\n*\n* @param body\n*/\n-export const dotimes = (body: StackProc = []) => {\n- const w = $stackFn(body);\n- return (ctx: StackContext) => {\n- $(ctx[0], 1);\n- for (let i = 0, n = ctx[0].pop(); i < n; i++) {\n+export const dotimes = (ctx: StackContext) => {\n+ let stack = ctx[0];\n+ $(stack, 2);\n+ const w = $stackFn(stack.pop());\n+ for (let i = 0, n = stack.pop(); i < n; i++) {\nctx[0].push(i);\nctx = w(ctx);\n}\nreturn ctx;\n};\n-};\n//////////////////// Array / list ops ////////////////////\n", "new_path": "packages/pointfree/src/index.ts", "old_path": "packages/pointfree/src/index.ts" }, { "change_type": "MODIFY", "diff": "@@ -513,11 +513,11 @@ describe(\"pointfree\", () => {\nassert.deepEqual(pf.exec($([1, 2, pf.add]))[0], [3]);\n});\n- it(\"execq\", () => {\n- assert.throws(() => pf.execq($()));\n- assert.throws(() => pf.execq($([[pf.add]])));\n- assert.throws(() => pf.execq($([[1, pf.add]])));\n- assert.deepEqual(pf.execq($([[1, 2, pf.add]]))[0], [3]);\n+ it(\"exec (quot)\", () => {\n+ assert.throws(() => pf.exec($()));\n+ assert.throws(() => pf.exec($([[pf.add]])));\n+ assert.throws(() => pf.exec($([[1, pf.add]])));\n+ assert.deepEqual(pf.exec($([[1, 2, pf.add]]))[0], [3]);\n});\nit(\"cond\", () => {\n@@ -575,4 +575,48 @@ describe(\"pointfree\", () => {\nassert.throws(() => pf.run([1, [\"a\", \"b\"], {}, pf.bindkeys]));\nassert.deepEqual(pf.run([1, 2, 3, [\"a\", \"b\", \"c\"], {}, pf.bindkeys]), [[{ a: 1, b: 2, c: 3 }], [], {}]);\n});\n+\n+ it(\"dip\", () => {\n+ assert.deepEqual(pf.run([1, [10], pf.dip])[0], [10, 1]);\n+ assert.deepEqual(pf.run([1, 2, [10, pf.add], pf.dip])[0], [11, 2]);\n+ });\n+\n+ it(\"dip2\", () => {\n+ assert.deepEqual(pf.run([1, 2, [10], pf.dip2])[0], [10, 1, 2]);\n+ assert.deepEqual(pf.run([1, 2, 3, [10, pf.add], pf.dip2])[0], [11, 2, 3]);\n+ });\n+\n+ it(\"dip3\", () => {\n+ assert.deepEqual(pf.run([1, 2, 3, [10], pf.dip3])[0], [10, 1, 2, 3]);\n+ assert.deepEqual(pf.run([1, 2, 3, 4, [10, pf.add], pf.dip3])[0], [11, 2, 3, 4]);\n+ });\n+\n+ it(\"dip4\", () => {\n+ assert.deepEqual(pf.run([1, 2, 3, 4, [10], pf.dip4])[0], [10, 1, 2, 3, 4]);\n+ assert.deepEqual(pf.run([1, 2, 3, 4, 5, [10, pf.add], pf.dip4])[0], [11, 2, 3, 4, 5]);\n+ });\n+\n+ it(\"keep\", () => {\n+ assert.deepEqual(pf.run([1, [10, pf.add], pf.keep])[0], [11, 1]);\n+ });\n+\n+ it(\"keep2\", () => {\n+ assert.deepEqual(pf.run([1, 2, [pf.add], pf.keep2])[0], [3, 1, 2]);\n+ });\n+\n+ it(\"keep3\", () => {\n+ assert.deepEqual(pf.run([1, 2, 3, [pf.add, pf.add], pf.keep3])[0], [6, 1, 2, 3]);\n+ });\n+\n+ it(\"bi\", () => {\n+ assert.deepEqual(pf.run([2, [10, pf.add], [10, pf.mul], pf.bi])[0], [12, 20]);\n+ });\n+\n+ it(\"bi2\", () => {\n+ assert.deepEqual(pf.run([2, 10, [pf.add], [pf.mul], pf.bi2])[0], [12, 20]);\n+ });\n+\n+ it(\"bi3\", () => {\n+ assert.deepEqual(pf.run([2, 10, 100, [pf.add, pf.add], [pf.mul, pf.mul], pf.bi3])[0], [112, 2000]);\n+ });\n});\n", "new_path": "packages/pointfree/test/index.ts", "old_path": "packages/pointfree/test/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(pointfree): add combinators, update controlflow words, remove execq - add condq(), loopq() - update dotimes() to use quotations from stack, no more HOF - add dip/2/3/4 combinators - add keep/2/3 combinators - add bi/2/3 combinators - add dup3 - refactor exec to work w/ quotations, remove execq - add/update tests
1
feat
pointfree
791,723
29.03.2018 17:04:33
25,200
73918f1a634f2a4462f069dbb4bbb247dc4e7dc9
misc(eslint): add no-floating-decimal (leading zero) rule
[ { "change_type": "MODIFY", "diff": "@@ -28,6 +28,7 @@ module.exports = {\n'CallExpression > ArrowFunctionExpression > :expression.body',\n],\n}],\n+ 'no-floating-decimal': 2,\n'max-len': [2, 100, {\nignoreComments: true,\nignoreUrls: true,\n", "new_path": ".eslintrc.js", "old_path": ".eslintrc.js" }, { "change_type": "MODIFY", "diff": "@@ -84,7 +84,7 @@ class LoadFastEnough4Pwa extends Audit {\nconst areLatenciesAll3G = firstRequestLatencies.every(val => val.latency > latency3gMin);\nfirstRequestLatencies = firstRequestLatencies.map(item => ({\nurl: item.url,\n- latency: Util.formatNumber(item.latency, .01),\n+ latency: Util.formatNumber(item.latency, 0.01),\n}));\nconst trace = artifacts.traces[Audit.DEFAULT_PASS];\n", "new_path": "lighthouse-core/audits/load-fast-enough-for-pwa.js", "old_path": "lighthouse-core/audits/load-fast-enough-for-pwa.js" }, { "change_type": "MODIFY", "diff": "@@ -371,7 +371,7 @@ class GatherRunner {\n});\n}, Promise.resolve()).then(_ => {\n// Fail the run if more than 50% of all artifacts failed due to page load failure.\n- if (pageLoadFailures.length > Object.keys(artifacts).length * .5) {\n+ if (pageLoadFailures.length > Object.keys(artifacts).length * 0.5) {\nthrow pageLoadFailures[0];\n}\n", "new_path": "lighthouse-core/gather/gather-runner.js", "old_path": "lighthouse-core/gather/gather-runner.js" }, { "change_type": "MODIFY", "diff": "@@ -117,7 +117,7 @@ class CriticalRequestChainRenderer {\nspan.textContent = ' - ' + Util.chainDuration(\nsegment.node.request.startTime, segment.node.request.endTime) + 'ms, ';\nconst span2 = dom.createElement('span', 'crc-node__chain-duration');\n- span2.textContent = Util.formatBytesToKB(segment.node.request.transferSize, .01);\n+ span2.textContent = Util.formatBytesToKB(segment.node.request.transferSize, 0.01);\ntreevalEl.appendChild(span);\ntreevalEl.appendChild(span2);\n", "new_path": "lighthouse-core/report/v2/renderer/crc-details-renderer.js", "old_path": "lighthouse-core/report/v2/renderer/crc-details-renderer.js" }, { "change_type": "MODIFY", "diff": "@@ -57,7 +57,7 @@ class Util {\n* @param {number=} granularity Controls how coarse the displayed value is, defaults to .01\n* @return {string}\n*/\n- static formatBytesToKB(size, granularity = .1) {\n+ static formatBytesToKB(size, granularity = 0.1) {\nconst kbs = (Math.round(size / 1024 / granularity) * granularity).toLocaleString();\nreturn `${kbs}${NBSP}KB`;\n}\n", "new_path": "lighthouse-core/report/v2/renderer/util.js", "old_path": "lighthouse-core/report/v2/renderer/util.js" }, { "change_type": "MODIFY", "diff": "@@ -39,7 +39,7 @@ describe('Script Block First Paint audit', () => {\n{\ntag: scriptDetails,\ntransferSize: 50,\n- startTime: .95,\n+ startTime: 0.95,\nendTime: 1,\n},\n{\n", "new_path": "lighthouse-core/test/audits/dobetterweb/script-blocking-first-paint-test.js", "old_path": "lighthouse-core/test/audits/dobetterweb/script-blocking-first-paint-test.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 + .1;\n+ const endTime = startTime + 0.1;\nreturn {requestId, url, startTime, endTime, _initiator, _resourceType};\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
misc(eslint): add no-floating-decimal (leading zero) rule (#4893)
1
misc
eslint
807,849
29.03.2018 17:18:18
25,200
b5e61bfdfab7c151caa025d2f6b35aa1a69ab163
refactor(npm-conf): Split envReplace() into its own file
[ { "change_type": "ADD", "diff": "+\"use strict\";\n+\n+module.exports = envReplace;\n+\n+// https://github.com/npm/npm/blob/latest/lib/config/core.js#L409-L423\n+function envReplace(str) {\n+ if (typeof str !== \"string\" || !str) {\n+ return str;\n+ }\n+\n+ // Replace any ${ENV} values with the appropriate environment\n+ const regex = /(\\\\*)\\$\\{([^}]+)\\}/g;\n+\n+ return str.replace(regex, (orig, esc, name) => {\n+ // eslint-disable-next-line no-param-reassign\n+ esc = esc.length > 0 && esc.length % 2;\n+\n+ if (esc) {\n+ return orig;\n+ }\n+\n+ if (process.env[name] === undefined) {\n+ throw new Error(`Failed to replace env in config: ${orig}`);\n+ }\n+\n+ return process.env[name];\n+ });\n+}\n", "new_path": "utils/npm-conf/lib/env-replace.js", "old_path": null }, { "change_type": "MODIFY", "diff": "\"use strict\";\nconst path = require(\"path\");\n+const envReplace = require(\"./env-replace\");\nconst types = require(\"./types\");\nmodule.exports = parseField;\n@@ -67,28 +68,3 @@ function parseField(input, key) {\nreturn field;\n}\n-\n-// https://github.com/npm/npm/blob/latest/lib/config/core.js#L409-L423\n-function envReplace(str) {\n- if (typeof str !== \"string\" || !str) {\n- return str;\n- }\n-\n- // Replace any ${ENV} values with the appropriate environment\n- const regex = /(\\\\*)\\$\\{([^}]+)\\}/g;\n-\n- return str.replace(regex, (orig, esc, name) => {\n- // eslint-disable-next-line no-param-reassign\n- esc = esc.length > 0 && esc.length % 2;\n-\n- if (esc) {\n- return orig;\n- }\n-\n- if (process.env[name] === undefined) {\n- throw new Error(`Failed to replace env in config: ${orig}`);\n- }\n-\n- return process.env[name];\n- });\n-}\n", "new_path": "utils/npm-conf/lib/parse-field.js", "old_path": "utils/npm-conf/lib/parse-field.js" } ]
JavaScript
MIT License
lerna/lerna
refactor(npm-conf): Split envReplace() into its own file
1
refactor
npm-conf
807,849
29.03.2018 17:19:39
25,200
3c9a5dedb330bc5c0a3ad42ef301d859c05e57b2
fix(npm-conf): Replace env vars even in config keys
[ { "change_type": "MODIFY", "diff": "@@ -4,6 +4,7 @@ const assert = require(\"assert\");\nconst fs = require(\"fs\");\nconst path = require(\"path\");\nconst { ConfigChain } = require(\"config-chain\");\n+const envReplace = require(\"./env-replace\");\nconst findPrefix = require(\"./find-prefix\");\nconst parseField = require(\"./parse-field\");\nconst toNerfDart = require(\"./nerf-dart\");\n@@ -18,10 +19,16 @@ class Conf extends ConfigChain {\n// https://github.com/npm/npm/blob/latest/lib/config/core.js#L332-L342\nadd(data, marker) {\ntry {\n+ /* eslint-disable no-param-reassign */\nfor (const x of Object.keys(data)) {\n- // eslint-disable-next-line no-param-reassign\n- data[x] = parseField(data[x], x);\n+ // https://github.com/npm/npm/commit/f0e998d\n+ const newKey = envReplace(x);\n+ const newField = parseField(data[x], newKey);\n+\n+ delete data[x];\n+ data[newKey] = newField;\n}\n+ /* eslint-enable no-param-reassign */\n} catch (err) {\nthrow err;\n}\n", "new_path": "utils/npm-conf/lib/conf.js", "old_path": "utils/npm-conf/lib/conf.js" } ]
JavaScript
MIT License
lerna/lerna
fix(npm-conf): Replace env vars even in config keys
1
fix
npm-conf
807,849
29.03.2018 17:33:00
25,200
1523520874d1c83b64b92665e26e55589bd8a869
fix(create): Silently ignore missing builtin npmrc Fixes
[ { "change_type": "MODIFY", "diff": "@@ -6,8 +6,17 @@ const path = require(\"path\");\nmodule.exports = builtinNpmrc;\nfunction builtinNpmrc() {\n- const globalNpmBin = path.resolve(path.dirname(process.execPath), \"npm\");\n+ let resolvedPath = \"\";\n+ try {\n// e.g., /usr/local/lib/node_modules/npm/npmrc\n- return path.resolve(fs.realpathSync(globalNpmBin), \"../../npmrc\");\n+ resolvedPath = path.resolve(\n+ fs.realpathSync(path.join(path.dirname(process.execPath), \"npm\")),\n+ \"../../npmrc\"\n+ );\n+ } catch (err) {\n+ // ignore\n+ }\n+\n+ return resolvedPath;\n}\n", "new_path": "commands/create/lib/builtin-npmrc.js", "old_path": "commands/create/lib/builtin-npmrc.js" } ]
JavaScript
MIT License
lerna/lerna
fix(create): Silently ignore missing builtin npmrc Fixes #1353
1
fix
create
807,849
29.03.2018 18:24:49
25,200
36c1fad745f9978b09006145988478e660812a1f
feat: Add --no-prefix for streaming output Credit:
[ { "change_type": "MODIFY", "diff": "@@ -22,9 +22,9 @@ const calledInPackages = () =>\nChildProcessUtilities.spawn.mock.calls.map(([, , opts]) => path.basename(opts.cwd));\nconst execInPackagesStreaming = testDir =>\n- ChildProcessUtilities.spawnStreaming.mock.calls.reduce((arr, [command, params, opts]) => {\n+ ChildProcessUtilities.spawnStreaming.mock.calls.reduce((arr, [command, params, opts, prefix]) => {\nconst dir = normalizeRelativeDir(testDir, opts.cwd);\n- arr.push([dir, command].concat(params).join(\" \"));\n+ arr.push([dir, command, `(prefix: ${prefix})`].concat(params).join(\" \"));\nreturn arr;\n}, []);\n@@ -181,7 +181,21 @@ describe(\"ExecCommand\", () => {\nawait lernaExec(testDir)(\"--parallel\", \"ls\");\n- expect(execInPackagesStreaming(testDir)).toEqual([\"packages/package-1 ls\", \"packages/package-2 ls\"]);\n+ expect(execInPackagesStreaming(testDir)).toEqual([\n+ \"packages/package-1 ls (prefix: package-1)\",\n+ \"packages/package-2 ls (prefix: package-2)\",\n+ ]);\n+ });\n+\n+ it(\"omits package prefix with --parallel --no-prefix\", async () => {\n+ const testDir = await initFixture(\"basic\");\n+\n+ await lernaExec(testDir)(\"--parallel\", \"--no-prefix\", \"ls\");\n+\n+ expect(execInPackagesStreaming(testDir)).toEqual([\n+ \"packages/package-1 ls (prefix: false)\",\n+ \"packages/package-2 ls (prefix: false)\",\n+ ]);\n});\nit(\"executes a command in all packages with --stream\", async () => {\n@@ -189,7 +203,21 @@ describe(\"ExecCommand\", () => {\nawait lernaExec(testDir)(\"--stream\", \"ls\");\n- expect(execInPackagesStreaming(testDir)).toEqual([\"packages/package-1 ls\", \"packages/package-2 ls\"]);\n+ expect(execInPackagesStreaming(testDir)).toEqual([\n+ \"packages/package-1 ls (prefix: package-1)\",\n+ \"packages/package-2 ls (prefix: package-2)\",\n+ ]);\n+ });\n+\n+ it(\"omits package prefix with --stream --no-prefix\", async () => {\n+ const testDir = await initFixture(\"basic\");\n+\n+ await lernaExec(testDir)(\"--stream\", \"--no-prefix\", \"ls\");\n+\n+ expect(execInPackagesStreaming(testDir)).toEqual([\n+ \"packages/package-1 ls (prefix: false)\",\n+ \"packages/package-2 ls (prefix: false)\",\n+ ]);\n});\n});\n", "new_path": "commands/exec/__tests__/exec-command.test.js", "old_path": "commands/exec/__tests__/exec-command.test.js" }, { "change_type": "MODIFY", "diff": "@@ -41,6 +41,15 @@ exports.builder = yargs => {\ntype: \"boolean\",\ndefault: undefined,\n},\n+ // This option controls prefix for stream output so that it can be disabled to be friendly\n+ // to tools like Visual Studio Code to highlight the raw results\n+ prefix: {\n+ group: \"Command Options:\",\n+ describe: \"Pass --no-prefix to disable prefixing of streamed output.\",\n+ defaultDescription: \"true\",\n+ type: \"boolean\",\n+ default: undefined,\n+ },\n});\nreturn filterable(yargs);\n", "new_path": "commands/exec/command.js", "old_path": "commands/exec/command.js" }, { "change_type": "MODIFY", "diff": "@@ -21,6 +21,7 @@ class ExecCommand extends Command {\nreturn Object.assign({}, super.defaultOptions, {\nbail: true,\nparallel: false,\n+ prefix: true,\n});\n}\n@@ -83,14 +84,24 @@ class ExecCommand extends Command {\nreturn Promise.all(\nthis.filteredPackages.map(pkg =>\n- ChildProcessUtilities.spawnStreaming(this.command, this.args, this.getOpts(pkg), pkg.name)\n+ ChildProcessUtilities.spawnStreaming(\n+ this.command,\n+ this.args,\n+ this.getOpts(pkg),\n+ this.options.prefix && pkg.name\n+ )\n)\n);\n}\nrunCommandInPackage(pkg) {\nif (this.options.stream) {\n- return ChildProcessUtilities.spawnStreaming(this.command, this.args, this.getOpts(pkg), pkg.name);\n+ return ChildProcessUtilities.spawnStreaming(\n+ this.command,\n+ this.args,\n+ this.getOpts(pkg),\n+ this.options.prefix && pkg.name\n+ );\n}\nreturn ChildProcessUtilities.spawn(this.command, this.args, this.getOpts(pkg));\n", "new_path": "commands/exec/index.js", "old_path": "commands/exec/index.js" }, { "change_type": "MODIFY", "diff": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n+exports[`RunCommand in a basic repo omits package prefix with --parallel --no-prefix 1`] = `\n+Array [\n+ \"packages/package-1 npm run env (prefixed: false)\",\n+ \"packages/package-2 npm run env (prefixed: false)\",\n+ \"packages/package-3 npm run env (prefixed: false)\",\n+ \"packages/package-4 npm run env (prefixed: false)\",\n+]\n+`;\n+\n+exports[`RunCommand in a basic repo omits package prefix with --stream --no-prefix 1`] = `\n+Array [\n+ \"packages/package-1 npm run my-script (prefixed: false)\",\n+ \"packages/package-3 npm run my-script (prefixed: false)\",\n+]\n+`;\n+\nexports[`RunCommand in a basic repo runs a script in all packages with --parallel 1`] = `\nArray [\n- \"packages/package-1 npm run env\",\n- \"packages/package-2 npm run env\",\n- \"packages/package-3 npm run env\",\n- \"packages/package-4 npm run env\",\n+ \"packages/package-1 npm run env (prefixed: true)\",\n+ \"packages/package-2 npm run env (prefixed: true)\",\n+ \"packages/package-3 npm run env (prefixed: true)\",\n+ \"packages/package-4 npm run env (prefixed: true)\",\n]\n`;\nexports[`RunCommand in a basic repo runs a script in packages with --stream 1`] = `\nArray [\n- \"packages/package-1 npm run my-script\",\n- \"packages/package-3 npm run my-script\",\n+ \"packages/package-1 npm run my-script (prefixed: true)\",\n+ \"packages/package-3 npm run my-script (prefixed: true)\",\n]\n`;\n", "new_path": "commands/run/__tests__/__snapshots__/run-command.test.js.snap", "old_path": "commands/run/__tests__/__snapshots__/run-command.test.js.snap" }, { "change_type": "MODIFY", "diff": "@@ -22,9 +22,9 @@ const lernaRun = require(\"@lerna-test/command-runner\")(require(\"../command\"));\n// assertion helpers\nconst ranInPackagesStreaming = testDir =>\n- npmRunScript.stream.mock.calls.reduce((arr, [script, { args, npmClient, pkg }]) => {\n+ npmRunScript.stream.mock.calls.reduce((arr, [script, { args, npmClient, pkg, prefix }]) => {\nconst dir = normalizeRelativeDir(testDir, pkg.location);\n- const record = [dir, npmClient, \"run\", script].concat(args);\n+ const record = [dir, npmClient, \"run\", script, `(prefixed: ${prefix})`].concat(args);\narr.push(record.join(\" \"));\nreturn arr;\n}, []);\n@@ -52,6 +52,14 @@ describe(\"RunCommand\", () => {\nexpect(ranInPackagesStreaming(testDir)).toMatchSnapshot();\n});\n+ it(\"omits package prefix with --stream --no-prefix\", async () => {\n+ const testDir = await initFixture(\"basic\");\n+\n+ await lernaRun(testDir)(\"my-script\", \"--stream\", \"--no-prefix\");\n+\n+ expect(ranInPackagesStreaming(testDir)).toMatchSnapshot();\n+ });\n+\nit(\"always runs env script\", async () => {\nconst testDir = await initFixture(\"basic\");\n@@ -129,6 +137,14 @@ describe(\"RunCommand\", () => {\nexpect(ranInPackagesStreaming(testDir)).toMatchSnapshot();\n});\n+ it(\"omits package prefix with --parallel --no-prefix\", async () => {\n+ const testDir = await initFixture(\"basic\");\n+\n+ await lernaRun(testDir)(\"env\", \"--parallel\", \"--no-prefix\");\n+\n+ expect(ranInPackagesStreaming(testDir)).toMatchSnapshot();\n+ });\n+\nit(\"supports alternate npmClient configuration\", async () => {\nconst testDir = await initFixture(\"basic\");\n", "new_path": "commands/run/__tests__/run-command.test.js", "old_path": "commands/run/__tests__/run-command.test.js" }, { "change_type": "MODIFY", "diff": "@@ -36,6 +36,15 @@ exports.builder = yargs => {\ntype: \"boolean\",\ndefault: undefined,\n},\n+ // This option controls prefix for stream output so that it can be disabled to be friendly\n+ // to tools like Visual Studio Code to highlight the raw results\n+ prefix: {\n+ group: \"Command Options:\",\n+ describe: \"Pass --no-prefix to disable prefixing of streamed output.\",\n+ defaultDescription: \"true\",\n+ type: \"boolean\",\n+ default: undefined,\n+ },\n\"npm-client\": {\ngroup: \"Command Options:\",\ndescribe: \"Executable used to run scripts (npm, yarn, pnpm, ...).\",\n", "new_path": "commands/run/command.js", "old_path": "commands/run/command.js" }, { "change_type": "MODIFY", "diff": "@@ -23,6 +23,7 @@ class RunCommand extends Command {\nreturn Object.assign({}, super.defaultOptions, {\nbail: true,\nparallel: false,\n+ prefix: true,\nstream: false,\n});\n}\n@@ -82,6 +83,7 @@ class RunCommand extends Command {\nreturn {\nargs: this.args,\nnpmClient: this.npmClient,\n+ prefix: this.options.prefix,\nreject: this.options.bail,\npkg,\n};\n", "new_path": "commands/run/index.js", "old_path": "commands/run/index.js" }, { "change_type": "MODIFY", "diff": "@@ -37,8 +37,11 @@ function spawnStreaming(command, args, opts, prefix) {\nconst color = chalk[colorName];\nconst spawned = _spawn(command, args, options);\n- const prefixedStdout = logTransformer({ tag: `${color.bold(prefix)}:` });\n- const prefixedStderr = logTransformer({ tag: `${color(prefix)}:`, mergeMultiline: true });\n+ const stdoutTag = prefix ? `${color.bold(prefix)}:` : \"\";\n+ const stderrTag = prefix ? `${color(prefix)}:` : \"\";\n+\n+ const prefixedStdout = logTransformer({ tag: stdoutTag });\n+ const prefixedStderr = logTransformer({ tag: stderrTag, mergeMultiline: true });\n// Avoid \"Possible EventEmitter memory leak detected\" warning due to piped stdio\nif (children > process.stdout.listenerCount(\"close\")) {\n", "new_path": "core/child-process/index.js", "old_path": "core/child-process/index.js" }, { "change_type": "MODIFY", "diff": "@@ -10,6 +10,22 @@ lerna success - package-3\nlerna success - package-4\n`;\n+exports[`lerna run test --stream --no-prefix: stderr 1`] = `\n+lerna info version __TEST_VERSION__\n+lerna success run Ran npm script 'test' in packages:\n+lerna success - package-1\n+lerna success - package-2\n+lerna success - package-3\n+lerna success - package-4\n+`;\n+\n+exports[`lerna run test --stream --no-prefix: stdout 1`] = `\n+package-3\n+package-4\n+package-1\n+package-2\n+`;\n+\nexports[`lerna run test --stream: stderr 1`] = `\nlerna info version __TEST_VERSION__\nlerna success run Ran npm script 'test' in packages:\n", "new_path": "integration/__snapshots__/lerna-run.test.js.snap", "old_path": "integration/__snapshots__/lerna-run.test.js.snap" }, { "change_type": "MODIFY", "diff": "@@ -59,7 +59,7 @@ describe(\"lerna exec\", () => {\nexpect(stdout).toMatchSnapshot();\n});\n- test(\"<cmd> --parallel\", async () => {\n+ test(\"--parallel\", async () => {\nconst cwd = await initFixture(\"lerna-exec\");\nconst args = [\n\"exec\",\n@@ -80,21 +80,19 @@ describe(\"lerna exec\", () => {\nexpect(stdout).toMatch(\"package-2: package.json\");\n});\n- test(\"--parallel <cmd>\", async () => {\n+ test(\"--parallel --no-prefix\", async () => {\nconst cwd = await initFixture(\"lerna-exec\");\n- const args = [\"exec\", \"--parallel\", EXEC_TEST_COMMAND];\n+ const args = [\"exec\", \"--parallel\", \"--no-prefix\", EXEC_TEST_COMMAND];\nconst { stdout, stderr } = await cliRunner(cwd, env)(...args);\nexpect(stderr).toMatch(EXEC_TEST_COMMAND);\n// order is non-deterministic, so assert individually\n- expect(stdout).toMatch(\"package-1: file-1.js\");\n- expect(stdout).toMatch(\"package-1: package.json\");\n- expect(stdout).toMatch(\"package-2: file-2.js\");\n- expect(stdout).toMatch(\"package-2: package.json\");\n+ expect(stdout).toMatch(\"file-1.js\");\n+ expect(stdout).toMatch(\"file-2.js\");\n});\n- test(\"<cmd> --stream\", async () => {\n+ test(\"--stream\", async () => {\nconst cwd = await initFixture(\"lerna-exec\");\nconst args = [\n\"exec\",\n@@ -114,30 +112,18 @@ describe(\"lerna exec\", () => {\nexpect(stdout).toMatch(\"package-2: package.json\");\n});\n- test(\"--stream <cmd>\", async () => {\n+ test(\"--stream --no-prefix\", async () => {\nconst cwd = await initFixture(\"lerna-exec\");\n- const args = [\"exec\", \"--stream\", EXEC_TEST_COMMAND];\n+ const args = [\"exec\", \"--stream\", \"--no-prefix\", EXEC_TEST_COMMAND];\nconst { stdout } = await cliRunner(cwd, env)(...args);\n// order is non-deterministic, so assert individually\n- expect(stdout).toMatch(\"package-1: file-1.js\");\n- expect(stdout).toMatch(\"package-1: package.json\");\n- expect(stdout).toMatch(\"package-2: file-2.js\");\n- expect(stdout).toMatch(\"package-2: package.json\");\n- });\n-\n- test(\"--bail=false <cmd>\", async () => {\n- const cwd = await initFixture(\"lerna-exec\");\n- const args = [\"exec\", \"--bail=false\", \"--concurrency=1\", \"--\", \"npm\", \"run\", \"fail-or-succeed\"];\n-\n- const { stdout, stderr } = await cliRunner(cwd)(...args);\n- expect(stderr).toMatch(\"Failed at the package-1@1.0.0 fail-or-succeed script\");\n- expect(stdout).toMatch(\"failure!\");\n- expect(stdout).toMatch(\"success!\");\n+ expect(stdout).toMatch(\"file-1.js\");\n+ expect(stdout).toMatch(\"file-2.js\");\n});\n- test(\"--no-bail <cmd>\", async () => {\n+ test(\"--no-bail\", async () => {\nconst cwd = await initFixture(\"lerna-exec\");\nconst args = [\"exec\", \"--no-bail\", \"--concurrency=1\", \"--\", \"npm\", \"run\", \"fail-or-succeed\"];\n", "new_path": "integration/lerna-exec.test.js", "old_path": "integration/lerna-exec.test.js" }, { "change_type": "MODIFY", "diff": "@@ -45,6 +45,23 @@ describe(\"lerna run\", () => {\nexpect(stderr).toMatchSnapshot(\"stderr\");\n});\n+ test(\"test --stream --no-prefix\", async () => {\n+ const cwd = await initFixture(\"lerna-run\");\n+ const args = [\n+ \"run\",\n+ \"--stream\",\n+ \"--no-prefix\",\n+ \"test\",\n+ \"--concurrency=1\",\n+ // args below tell npm to be quiet\n+ \"--\",\n+ \"--silent\",\n+ ];\n+ const { stdout, stderr } = await cliRunner(cwd)(...args);\n+ expect(stdout).toMatchSnapshot(\"stdout\");\n+ expect(stderr).toMatchSnapshot(\"stderr\");\n+ });\n+\ntest(\"test --parallel\", async () => {\nconst cwd = await initFixture(\"lerna-run\");\nconst args = [\n", "new_path": "integration/lerna-run.test.js", "old_path": "integration/lerna-run.test.js" }, { "change_type": "MODIFY", "diff": "@@ -78,6 +78,7 @@ describe(\"npm-run-script\", () => {\nname: \"qux\",\nlocation: \"/test/npm/run/script/stream\",\n},\n+ prefix: true,\nnpmClient: \"npm\",\n};\n@@ -115,7 +116,7 @@ describe(\"npm-run-script\", () => {\ncwd: config.pkg.location,\nreject: false,\n},\n- config.pkg.name\n+ undefined\n);\n});\n});\n", "new_path": "utils/npm-run-script/__tests__/npm-run-script.test.js", "old_path": "utils/npm-run-script/__tests__/npm-run-script.test.js" }, { "change_type": "MODIFY", "diff": "@@ -17,13 +17,13 @@ function runScript(script, { args, npmClient, pkg, reject = true }) {\nreturn ChildProcessUtilities.exec(npmClient, argv, opts);\n}\n-function stream(script, { args, npmClient, pkg, reject = true }) {\n+function stream(script, { args, npmClient, pkg, prefix, reject = true }) {\nlog.silly(\"npmRunScript.stream\", [script, args, pkg.name]);\nconst argv = [\"run\", script, ...args];\nconst opts = makeOpts(pkg, reject);\n- return ChildProcessUtilities.spawnStreaming(npmClient, argv, opts, pkg.name);\n+ return ChildProcessUtilities.spawnStreaming(npmClient, argv, opts, prefix && pkg.name);\n}\nfunction makeOpts(pkg, reject) {\n", "new_path": "utils/npm-run-script/npm-run-script.js", "old_path": "utils/npm-run-script/npm-run-script.js" } ]
JavaScript
MIT License
lerna/lerna
feat: Add --no-prefix for streaming output (#1352) Credit: @raymondfeng
1
feat
null
679,913
29.03.2018 22:53:56
-3,600
b096e436c7e20c49df151929d3d1faf8ec91c1e7
feat(pointfree): add more dataflow combinators, words & tests add tri/2/3 add bis/2, tris/2 add bia/2, tria/2 add both, either add oneover
[ { "change_type": "MODIFY", "diff": "@@ -99,6 +99,69 @@ export const unwrap = ([stack]: StackContext, n = 1) =>\ntos(stack) :\nstack.slice(Math.max(0, stack.length - n));\n+//////////////////// Dynamic words & quotations ////////////////////\n+\n+/**\n+ * Higher order word. Takes a StackProgram and returns it as StackFn to\n+ * be used like any word. Unknown stack effect.\n+ *\n+ * If the optional `env` is given, uses a shallow copy of that\n+ * environment (one per invocation) instead of the current one passed by\n+ * `run()` at runtime. If `mergeEnv` is true (default), the user\n+ * provided env will be merged with the current env (also shallow\n+ * copies). This is useful in conjunction with `pushenv()` and `store()`\n+ * or `storekey()` to save results of sub procedures in the main env.\n+ *\n+ * Note: The provided (or merged) env is only active within the\n+ * execution scope of the word.\n+ *\n+ * ( ? -- ? )\n+ *\n+ * @param prog\n+ * @param env\n+ * @param mergeEnv\n+ */\n+export const word = (prog: StackProgram, env?: StackEnv, mergeEnv = true) => {\n+ const w: StackFn = compile(prog);\n+ return env ?\n+ mergeEnv ?\n+ (ctx: StackContext) => (w([ctx[0], ctx[1], { ...ctx[2], ...env }]), ctx) :\n+ (ctx: StackContext) => (w([ctx[0], ctx[1], { ...env }]), ctx) :\n+ w;\n+};\n+\n+/**\n+ * Like `word()`, but automatically calls `unwrap()` on result context\n+ * to produced unwrapped value/tuple.\n+ *\n+ * **Importatant:** Words defined with this function CANNOT be used as\n+ * part of a larger stack program, only for standalone use.\n+ *\n+ * @param prog\n+ * @param n\n+ * @param env\n+ * @param mergeEnv\n+ */\n+export const wordU = (prog: StackProgram, n = 1, env?: StackEnv, mergeEnv = true) => {\n+ const w: StackFn = compile(prog);\n+ return env ?\n+ mergeEnv ?\n+ (ctx: StackContext) => unwrap(w([ctx[0], ctx[1], { ...ctx[2], ...env }]), n) :\n+ (ctx: StackContext) => unwrap(w([ctx[0], ctx[1], { ...env }]), n) :\n+ (ctx: StackContext) => unwrap(w(ctx), n);\n+};\n+\n+/**\n+ * Executes TOS as stack function and places result back on d-stack. TOS\n+ * MUST be a valid word or quotation.\n+ *\n+ * ( x -- x() )\n+ *\n+ * @param ctx\n+ */\n+export const exec = (ctx: StackContext) =>\n+ ($(ctx[0], 1), $stackFn(ctx[0].pop())(ctx));\n+\n//////////////////// Operator generators ////////////////////\n/**\n@@ -572,6 +635,13 @@ export const sub = op2((b, a) => a - b);\n*/\nexport const div = op2((b, a) => a / b);\n+/**\n+ * ( x -- 1/x )\n+ *\n+ * @param ctx\n+ */\n+export const oneover = word([1, swap, div]);\n+\n/**\n* ( x y -- x%y )\n*\n@@ -806,71 +876,11 @@ export const isneg = op1((x) => x < 0);\n*/\nexport const isnull = op1((x) => x == null);\n-//////////////////// Dynamic words & quotations ////////////////////\n-\n-/**\n- * Higher order word. Takes a StackProgram and returns it as StackFn to\n- * be used like any word. Unknown stack effect.\n- *\n- * If the optional `env` is given, uses a shallow copy of that\n- * environment (one per invocation) instead of the current one passed by\n- * `run()` at runtime. If `mergeEnv` is true (default), the user\n- * provided env will be merged with the current env (also shallow\n- * copies). This is useful in conjunction with `pushenv()` and `store()`\n- * or `storekey()` to save results of sub procedures in the main env.\n- *\n- * Note: The provided (or merged) env is only active within the\n- * execution scope of the word.\n- *\n- * ( ? -- ? )\n- *\n- * @param prog\n- * @param env\n- * @param mergeEnv\n- */\n-export const word = (prog: StackProgram, env?: StackEnv, mergeEnv = true) => {\n- const w: StackFn = compile(prog);\n- return env ?\n- mergeEnv ?\n- (ctx: StackContext) => (w([ctx[0], ctx[1], { ...ctx[2], ...env }]), ctx) :\n- (ctx: StackContext) => (w([ctx[0], ctx[1], { ...env }]), ctx) :\n- w;\n-};\n-\n-/**\n- * Like `word()`, but automatically calls `unwrap()` on result context\n- * to produced unwrapped value/tuple.\n- *\n- * **Importatant:** Words defined with this function CANNOT be used as\n- * part of a larger stack program, only for standalone use.\n- *\n- * @param prog\n- * @param n\n- * @param env\n- * @param mergeEnv\n- */\n-export const wordU = (prog: StackProgram, n = 1, env?: StackEnv, mergeEnv = true) => {\n- const w: StackFn = compile(prog);\n- return env ?\n- mergeEnv ?\n- (ctx: StackContext) => unwrap(w([ctx[0], ctx[1], { ...ctx[2], ...env }]), n) :\n- (ctx: StackContext) => unwrap(w([ctx[0], ctx[1], { ...env }]), n) :\n- (ctx: StackContext) => unwrap(w(ctx), n);\n-};\n-\n-/**\n- * Executes TOS as stack function and places result back on d-stack. TOS\n- * MUST be a valid word or quotation.\n- *\n- * ( x -- x() )\n- *\n- * @param ctx\n- */\n-export const exec = (ctx: StackContext) =>\n- ($(ctx[0], 1), $stackFn(ctx[0].pop())(ctx));\n-\n//////////////////// Dataflow combinators ////////////////////\n+// these combinators have been ported from Factor:\n+// http://docs.factorcode.org:8080/content/article-dataflow-combinators.html\n+\n/**\n* Removes `x` from d-stack, calls `q` and restores `x` to the top of\n* the d-stack after quotation is finished.\n@@ -878,7 +888,7 @@ export const exec = (ctx: StackContext) =>\n* ( x q -- x )\n*\n* Same behavior as: `[swap, movdr, exec, movrd]`, only the current\n- * implementation doesn't use r-stack.\n+ * implementation doesn't use r-stack and stashes `x` off stack.\n*\n* @param ctx\n*/\n@@ -944,7 +954,7 @@ export const keep3 = word([[dup3], dip, dip3]);\n* First applies `p` to the value `x`, then applies `q` to the same\n* value.\n*\n- * ( x p q -- pres qres )\n+ * ( x p q -- px qx )\n*/\nexport const bi = word([[keep], dip, exec]);\n@@ -952,7 +962,7 @@ export const bi = word([[keep], dip, exec]);\n* First applies `p` to the two input values `x y`, then applies `q` to\n* the same values.\n*\n- * ( x y p q -- pres qres )\n+ * ( x y p q -- pxy qxy )\n*/\nexport const bi2 = word([[keep2], dip, exec]);\n@@ -960,10 +970,107 @@ export const bi2 = word([[keep2], dip, exec]);\n* First applies `p` to the three input values `x y z`, then applies `q`\n* to the same values.\n*\n- * ( x y z p q -- pres qres )\n+ * ( x y z p q -- pxyz qxyz )\n*/\nexport const bi3 = word([[keep3], dip, exec]);\n+/**\n+ * Applies `p` to `x`, then `q` to `x`, and finally `r` to `x`\n+ *\n+ * ( x p q r -- px qx rx )\n+ */\n+export const tri = word([[[keep], dip, keep], dip, exec]);\n+\n+/**\n+ * Applies `p` to the two input values `x y`, then same with `q`, and\n+ * finally with `r`.\n+ *\n+ * ( x y p q r -- pxy qxy rxy )\n+ */\n+export const tri2 = word([[[keep2], dip, keep2], dip, exec]);\n+\n+/**\n+ * Applies `p` to the three input values `x y z`, then same with `q`,\n+ * and finally with `r`.\n+ *\n+ * ( x y z p q r -- pxyz qxyz rxyz )\n+ */\n+export const tri3 = word([[[keep3], dip, keep3], dip, exec]);\n+\n+/**\n+ * Applies `p` to `x`, then applies `q` to `y`.\n+ *\n+ * ( x y p q -- px qy )\n+ */\n+export const bis = word([[dip], dip, exec]);\n+\n+/**\n+ * Applies `p` to `a b`, then applies `q` to `c d`.\n+ *\n+ * ( a b c d p q -- pab qcd )\n+ */\n+export const bis2 = word([[dip2], dip, exec]);\n+\n+/**\n+ * Applies `p` to `x`, then `q` to `y`, and finally `r` to `z`.\n+ *\n+ * ( x y z p q r -- )\n+ */\n+export const tris = word([[[dip2], dip, dip], dip, exec]);\n+\n+/**\n+ * Applies `p` to `u v`, then `q` to `w x`, and finally `r` to `y z`.\n+ *\n+ * ( u v w x y z p q r -- puv qwx ryz )\n+ */\n+export const tris2 = word([[dip4], dip2, bis2]);\n+\n+/**\n+ * Applies the quotation `q` to `x`, then to `y`.\n+ *\n+ * ( x y q -- qx qy )\n+ */\n+export const bia = word([dup, bis]);\n+\n+/**\n+ * Applies the quotation `q` to `x y`, then to `z w`.\n+ *\n+ * ( x y z w q -- qxy qzw )\n+ */\n+export const bia2 = word([dup, bis2]);\n+\n+/**\n+ * Applies the `q` to `x`, then to `y`, and finally to `z`.\n+ *\n+ * ( x y z q -- qx qy qz )\n+ */\n+export const tria = word([dup, dup, tris]);\n+\n+/**\n+ * Applies the quotation to `u v`, then to `w x`, and then to `y z`.\n+ *\n+ * ( u v w x y z q -- quv qwx qyz )\n+ */\n+export const tria2 = word([dup, dup, tris2]);\n+\n+/**\n+ * Applies `q` individually to both input vals `x y` and combines\n+ * results with `and`. The final result will be true if both interim\n+ * results were truthy.\n+ *\n+ * ( x y q -- qx && qy )\n+ */\n+export const both = word([bia, and]);\n+\n+/**\n+ * Applies `q` individually to both input vals `x y` and combines results with `or`.\n+ * The final result will be true if at least one of the interim results\n+ * was truthy.\n+ *\n+ * ( x y q -- qx || qy )\n+ */\n+export const either = word([bia, or]);\n+\n//////////////////// Conditionals ////////////////////\n/**\n", "new_path": "packages/pointfree/src/index.ts", "old_path": "packages/pointfree/src/index.ts" }, { "change_type": "MODIFY", "diff": "@@ -619,4 +619,64 @@ describe(\"pointfree\", () => {\nit(\"bi3\", () => {\nassert.deepEqual(pf.run([2, 10, 100, [pf.add, pf.add], [pf.mul, pf.mul], pf.bi3])[0], [112, 2000]);\n});\n+\n+ it(\"tri\", () => {\n+ assert.deepEqual(pf.run([10, [pf.dec], [pf.dup, pf.mul], [pf.inc], pf.tri])[0], [9, 100, 11]);\n+ });\n+\n+ it(\"tri2\", () => {\n+ assert.deepEqual(pf.run([10, 20, [pf.add], [pf.mul], [pf.sub], pf.tri2])[0], [30, 200, -10]);\n+ });\n+\n+ it(\"tri3\", () => {\n+ assert.deepEqual(pf.run([10, 20, 30, [pf.add, pf.add], [pf.mul, pf.mul], [pf.sub, pf.sub], pf.tri3])[0], [60, 6000, 20]);\n+ });\n+\n+ it(\"bis\", () => {\n+ assert.deepEqual(pf.run([10, 20, [pf.inc], [pf.dec], pf.bis])[0], [11, 19]);\n+ });\n+\n+ it(\"bis2\", () => {\n+ assert.deepEqual(pf.run([10, 20, 30, 40, [pf.add], [pf.sub], pf.bis2])[0], [30, -10]);\n+ });\n+\n+ it(\"tris\", () => {\n+ assert.deepEqual(pf.run([10, 20, 30, [pf.inc], [pf.dup, pf.mul], [pf.dec], pf.tris])[0], [11, 400, 29]);\n+ });\n+\n+ it(\"tris2\", () => {\n+ assert.deepEqual(pf.run([10, 20, 30, 40, 50, 60, [pf.add], [pf.mul], [pf.sub], pf.tris2])[0], [30, 1200, -10]);\n+ });\n+\n+ it(\"bia\", () => {\n+ assert.deepEqual(pf.run([10, 20, [pf.inc], pf.bia])[0], [11, 21]);\n+ });\n+\n+ it(\"bia2\", () => {\n+ assert.deepEqual(pf.run([10, 20, 30, 40, [pf.add], pf.bia2])[0], [30, 70]);\n+ });\n+\n+ it(\"tria\", () => {\n+ assert.deepEqual(pf.run([10, 20, 30, [pf.inc], pf.tria])[0], [11, 21, 31]);\n+ });\n+\n+ it(\"tria2\", () => {\n+ assert.deepEqual(pf.run([10, 20, 30, 40, 50, 60, [pf.add], pf.tria2])[0], [30, 70, 110]);\n+ });\n+\n+ it(\"both\", () => {\n+ assert.deepEqual(pf.run([10, 20, [pf.even], pf.both])[0], [true]);\n+ assert.deepEqual(pf.run([11, 20, [pf.even], pf.both])[0], [false]);\n+ assert.deepEqual(pf.run([10, 21, [pf.even], pf.both])[0], [false]);\n+ assert.deepEqual(pf.run([11, 21, [pf.even], pf.both])[0], [false]);\n+ });\n+\n+ it(\"either\", () => {\n+ assert.deepEqual(pf.run([10, 20, [pf.even], pf.either])[0], [true]);\n+ assert.deepEqual(pf.run([11, 20, [pf.even], pf.either])[0], [true]);\n+ assert.deepEqual(pf.run([10, 21, [pf.even], pf.either])[0], [true]);\n+ assert.deepEqual(pf.run([11, 21, [pf.even], pf.either])[0], [false]);\n+ });\n+\n+\n});\n", "new_path": "packages/pointfree/test/index.ts", "old_path": "packages/pointfree/test/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(pointfree): add more dataflow combinators, words & tests - add tri/2/3 - add bis/2, tris/2 - add bia/2, tria/2 - add both, either - add oneover
1
feat
pointfree
815,746
30.03.2018 09:40:24
-10,800
8830eb61681b48f0c53110f733eb74a5a6b7f701
feat: allow to select on tab closes
[ { "change_type": "MODIFY", "diff": "@@ -143,6 +143,7 @@ map: {\n| notFoundText | `string` | `No items found` | no | Set custom text when filter returns empty result |\n| placeholder | `string` | `-` | no | Placeholder text. |\n| [searchable] | `boolean` | `true` | no | Allow to search for value. Default `true`|\n+| [selectOnTab] | `boolean` | `true` | no | Select marked dropdown item using tab. Default `true`|\n| [typeahead] | `Subject` | `-` | no | Custom autocomplete or filter. |\n| typeToSearchText | `string` | `Type to search` | no | Set custom text when using Typeahead |\n| [virtualScroll] | `boolean` | false | no | Enable virtual scroll for better performance when rendering a lot of data |\n", "new_path": "README.md", "old_path": "README.md" }, { "change_type": "MODIFY", "diff": "@@ -835,6 +835,7 @@ describe('NgSelectComponent', function () {\n`<ng-select [items]=\"cities\"\nbindLabel=\"name\"\n[loading]=\"citiesLoading\"\n+ [selectOnTab]=\"selectOnTab\"\n[multiple]=\"multiple\"\n[(ngModel)]=\"selectedCity\">\n</ng-select>`);\n@@ -967,12 +968,14 @@ describe('NgSelectComponent', function () {\nexpect(select.isOpen).toBeFalsy()\n}));\n- it('should close dropdown', () => {\n+ it('should close dropdown when [selectOnTab]=\"false\"', fakeAsync(() => {\n+ fixture.componentInstance.selectOnTab = false;\n+ tickAndDetectChanges(fixture);\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Tab);\nexpect(select.selectedItems).toEqual([]);\n- expect(select.isOpen).toBeFalsy()\n- });\n+ expect(select.isOpen).toBeFalsy();\n+ }));\nit('should close dropdown and keep selected value', fakeAsync(() => {\nfixture.componentInstance.selectedCity = fixture.componentInstance.cities[0];\n@@ -986,6 +989,19 @@ describe('NgSelectComponent', function () {\nexpect(select.selectedItems).toEqual(result);\nexpect(select.isOpen).toBeFalsy()\n}));\n+\n+ it('should mark first item on filter when tab', fakeAsync(() => {\n+ tick(200);\n+ fixture.componentInstance.select.filter('pab');\n+ tick(200);\n+\n+ const result = jasmine.objectContaining({\n+ value: fixture.componentInstance.cities[2]\n+ });\n+ expect(fixture.componentInstance.select.itemsList.markedItem).toEqual(result)\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Tab);\n+ expect(fixture.componentInstance.select.selectedItems).toEqual([result]);\n+ }));\n});\ndescribe('backspace', () => {\n@@ -1537,6 +1553,22 @@ describe('NgSelectComponent', function () {\nexpect(fixture.componentInstance.selectedCity).toBe(<any>'Copenhagen');\n}));\n+ it('should add tag as string when tab pressed', fakeAsync(() => {\n+ let fixture = createTestingModule(\n+ NgSelectTestCmp,\n+ `<ng-select [items]=\"citiesNames\"\n+ [addTag]=\"true\"\n+ placeholder=\"select value\"\n+ [(ngModel)]=\"selectedCity\">\n+ </ng-select>`);\n+\n+ tickAndDetectChanges(fixture);\n+ fixture.componentInstance.select.filter('Copenhagen');\n+ tickAndDetectChanges(fixture);\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Tab);\n+ expect(fixture.componentInstance.selectedCity).toBe(<any>'Copenhagen');\n+ }));\n+\nit('should select tag even if there are filtered items that matches search term', fakeAsync(() => {\nlet fixture = createTestingModule(\nNgSelectTestCmp,\n@@ -2283,6 +2315,7 @@ class NgSelectTestCmp {\ndropdownPosition = 'bottom';\nvisible = true;\nfilter = new Subject<string>();\n+ selectOnTab = true;\ncitiesLoading = false;\nselectedCityId: number;\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": "@@ -86,6 +86,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n@Input() loading = false;\n@Input() closeOnSelect = true;\n@Input() hideSelected = false;\n+ @Input() selectOnTab = true;\n@Input() maxSelectedItems: number;\n@Input() groupBy: string;\n@Input() bufferAmount = 4;\n@@ -584,8 +585,21 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nthis.dropdownPanel.scrollIntoTag();\n}\n- private _handleTab(_: KeyboardEvent) {\n- if (this.isOpen) {\n+ private _handleTab($event: KeyboardEvent) {\n+ if (!this.isOpen) {\n+ return;\n+ }\n+ if (this.selectOnTab) {\n+ if (this.itemsList.markedItem) {\n+ this.toggleItem(this.itemsList.markedItem);\n+ $event.preventDefault();\n+ } else if (this.showAddTag()) {\n+ this.selectTag();\n+ $event.preventDefault();\n+ } else {\n+ this.close();\n+ }\n+ } else {\nthis.close();\n}\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
feat: allow to select on tab (#397) closes #370
1
feat
null
815,746
30.03.2018 09:40:49
-10,800
532e332d235cf80c8dc3627e1638f322015e7bf4
chore(release): 0.33.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.33.0\"></a>\n+# [0.33.0](https://github.com/ng-select/ng-select/compare/v0.32.0...v0.33.0) (2018-03-30)\n+\n+\n+### Features\n+\n+* allow to select on tab ([#397](https://github.com/ng-select/ng-select/issues/397)) ([8830eb6](https://github.com/ng-select/ng-select/commit/8830eb6)), closes [#370](https://github.com/ng-select/ng-select/issues/370)\n+\n+\n+\n<a name=\"0.32.0\"></a>\n# [0.32.0](https://github.com/ng-select/ng-select/compare/v0.31.1...v0.32.0) (2018-03-29)\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.32.0\",\n+ \"version\": \"0.33.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.33.0
1
chore
release
807,849
30.03.2018 11:40:19
25,200
59dc2d456a9342b002fc8bf0558af147344037c6
fix(child-process): Do not merge lines of streaming stderr Fixes
[ { "change_type": "MODIFY", "diff": "@@ -37,11 +37,13 @@ function spawnStreaming(command, args, opts, prefix) {\nconst color = chalk[colorName];\nconst spawned = _spawn(command, args, options);\n- const stdoutTag = prefix ? `${color.bold(prefix)}:` : \"\";\n- const stderrTag = prefix ? `${color(prefix)}:` : \"\";\n+ const stdoutOpts = {};\n+ const stderrOpts = {}; // mergeMultiline causes escaped newlines :P\n- const prefixedStdout = logTransformer({ tag: stdoutTag });\n- const prefixedStderr = logTransformer({ tag: stderrTag, mergeMultiline: true });\n+ if (prefix) {\n+ stdoutOpts.tag = `${color.bold(prefix)}:`;\n+ stderrOpts.tag = `${color(prefix)}:`;\n+ }\n// Avoid \"Possible EventEmitter memory leak detected\" warning due to piped stdio\nif (children > process.stdout.listenerCount(\"close\")) {\n@@ -49,8 +51,8 @@ function spawnStreaming(command, args, opts, prefix) {\nprocess.stderr.setMaxListeners(children);\n}\n- spawned.stdout.pipe(prefixedStdout).pipe(process.stdout);\n- spawned.stderr.pipe(prefixedStderr).pipe(process.stderr);\n+ spawned.stdout.pipe(logTransformer(stdoutOpts)).pipe(process.stdout);\n+ spawned.stderr.pipe(logTransformer(stderrOpts)).pipe(process.stderr);\nreturn spawned;\n}\n", "new_path": "core/child-process/index.js", "old_path": "core/child-process/index.js" } ]
JavaScript
MIT License
lerna/lerna
fix(child-process): Do not merge lines of streaming stderr Fixes #994
1
fix
child-process
807,849
30.03.2018 12:14:46
25,200
bea6bc39cadffc5715bc624f32ff69ad97ac6064
fix: Use ValidationError instead of Error
[ { "change_type": "MODIFY", "diff": "@@ -33,7 +33,7 @@ class ExecCommand extends Command {\nthis.args = (args || []).concat(dashedArgs);\nif (!this.command) {\n- throw new ValidationError(\"exec\", \"A command to execute is required\");\n+ throw new ValidationError(\"ENOCOMMAND\", \"A command to execute is required\");\n}\n// don't interrupt spawned or streaming stdio\n", "new_path": "commands/exec/index.js", "old_path": "commands/exec/index.js" }, { "change_type": "MODIFY", "diff": "@@ -42,14 +42,14 @@ class ImportCommand extends Command {\nstats = fs.statSync(externalRepoPath);\n} catch (e) {\nif (e.code === \"ENOENT\") {\n- throw new Error(`No repository found at \"${inputPath}\"`);\n+ throw new ValidationError(\"ENOENT\", `No repository found at \"${inputPath}\"`);\n}\nthrow e;\n}\nif (!stats.isDirectory()) {\n- throw new Error(`Input path \"${inputPath}\" is not a directory`);\n+ throw new ValidationError(\"ENODIR\", `Input path \"${inputPath}\" is not a directory`);\n}\nconst packageJson = path.join(externalRepoPath, \"package.json\");\n@@ -57,7 +57,7 @@ class ImportCommand extends Command {\nconst packageName = require(packageJson).name;\nif (!packageName) {\n- throw new Error(`No package name specified in \"${packageJson}\"`);\n+ throw new ValidationError(\"ENOPKG\", `No package name specified in \"${packageJson}\"`);\n}\n// Compute a target directory relative to the Lerna root\n@@ -69,7 +69,7 @@ class ImportCommand extends Command {\nthis.targetDirRelativeToGitRoot = path.join(lernaRootRelativeToGitRoot, targetDir);\nif (fs.existsSync(path.resolve(this.project.rootPath, targetDir))) {\n- throw new Error(`Target directory already exists \"${targetDir}\"`);\n+ throw new ValidationError(\"EEXISTS\", `Target directory already exists \"${targetDir}\"`);\n}\nthis.commits = this.externalExecSync(\"git\", this.gitParamsForTargetCommits())\n@@ -84,14 +84,14 @@ class ImportCommand extends Command {\n// ]).split(\"\\n\");\nif (!this.commits.length) {\n- throw new Error(`No git commits to import at \"${inputPath}\"`);\n+ throw new ValidationError(\"NOCOMMITS\", `No git commits to import at \"${inputPath}\"`);\n}\n// Stash the repo's pre-import head away in case something goes wrong.\nthis.preImportHead = GitUtilities.getCurrentSHA(this.execOpts);\nif (ChildProcessUtilities.execSync(\"git\", [\"diff-index\", \"HEAD\"], this.execOpts)) {\n- throw new Error(\"Local repository has un-committed changes\");\n+ throw new ValidationError(\"ECHANGES\", \"Local repository has un-committed changes\");\n}\nthis.logger.info(\n", "new_path": "commands/import/index.js", "old_path": "commands/import/index.js" }, { "change_type": "MODIFY", "diff": "@@ -7,6 +7,7 @@ const npmRunScript = require(\"@lerna/npm-run-script\");\nconst batchPackages = require(\"@lerna/batch-packages\");\nconst runParallelBatches = require(\"@lerna/run-parallel-batches\");\nconst output = require(\"@lerna/output\");\n+const ValidationError = require(\"@lerna/validation-error\");\nmodule.exports = factory;\n@@ -29,23 +30,20 @@ class RunCommand extends Command {\n}\ninitialize() {\n- const { script } = this.options;\n+ const { script, npmClient = \"npm\", parallel, stream } = this.options;\n+\nthis.script = script;\nthis.args = this.options[\"--\"] || [];\n+ this.npmClient = npmClient;\nif (!script) {\n- throw new Error(\"You must specify which npm script to run.\");\n+ throw new ValidationError(\"ENOSCRIPT\", \"You must specify a lifecycle script to run\");\n}\n- const { parallel, stream, npmClient } = this.options;\n- this.npmClient = npmClient || \"npm\";\n-\n- const { filteredPackages } = this;\n-\nif (script === \"env\") {\n- this.packagesWithScript = filteredPackages;\n+ this.packagesWithScript = this.filteredPackages;\n} else {\n- this.packagesWithScript = filteredPackages.filter(pkg => pkg.scripts && pkg.scripts[script]);\n+ this.packagesWithScript = this.filteredPackages.filter(pkg => pkg.scripts && pkg.scripts[script]);\n}\nif (!this.packagesWithScript.length) {\n", "new_path": "commands/run/index.js", "old_path": "commands/run/index.js" }, { "change_type": "MODIFY", "diff": "\"@lerna/npm-run-script\": \"file:../../utils/npm-run-script\",\n\"@lerna/output\": \"file:../../utils/output\",\n\"@lerna/run-parallel-batches\": \"file:../../utils/run-parallel-batches\",\n+ \"@lerna/validation-error\": \"^3.0.0-beta.10\",\n\"p-map\": \"^1.2.0\"\n}\n}\n", "new_path": "commands/run/package.json", "old_path": "commands/run/package.json" }, { "change_type": "MODIFY", "diff": "\"@lerna/npm-run-script\": \"file:utils/npm-run-script\",\n\"@lerna/output\": \"file:utils/output\",\n\"@lerna/run-parallel-batches\": \"file:utils/run-parallel-batches\",\n+ \"@lerna/validation-error\": \"file:core/validation-error\",\n\"p-map\": \"1.2.0\"\n}\n},\n", "new_path": "package-lock.json", "old_path": "package-lock.json" } ]
JavaScript
MIT License
lerna/lerna
fix: Use ValidationError instead of Error
1
fix
null
807,849
30.03.2018 12:39:26
25,200
c8a5526d7a4ff4d5ef49a818d1c7935a08f6f48a
fix(run): Exit early when no packages contain the targeted lifecycle
[ { "change_type": "MODIFY", "diff": "@@ -126,7 +126,9 @@ describe(\"RunCommand\", () => {\nawait lernaRun(testDir)(\"missing-script\");\n- expect(consoleOutput()).toBe(\"\");\n+ expect(loggingOutput(\"success\")).toContain(\n+ \"No packages found with the lifecycle script 'missing-script'\"\n+ );\n});\nit(\"runs a script in all packages with --parallel\", async () => {\n", "new_path": "commands/run/__tests__/run-command.test.js", "old_path": "commands/run/__tests__/run-command.test.js" }, { "change_type": "MODIFY", "diff": "@@ -47,7 +47,10 @@ class RunCommand extends Command {\n}\nif (!this.packagesWithScript.length) {\n- this.logger.warn(`No packages found with the npm script '${script}'`);\n+ this.logger.success(\"run\", `No packages found with the lifecycle script '${script}'`);\n+\n+ // still exits zero, aka \"ok\"\n+ return false;\n}\nif (parallel || stream) {\n@@ -70,10 +73,8 @@ class RunCommand extends Command {\n}\nreturn chain.then(() => {\n- if (this.packagesWithScript.length) {\nthis.logger.success(\"run\", `Ran npm script '${this.script}' in packages:`);\nthis.logger.success(\"\", this.packagesWithScript.map(pkg => `- ${pkg.name}`).join(\"\\n\"));\n- }\n});\n}\n", "new_path": "commands/run/index.js", "old_path": "commands/run/index.js" } ]
JavaScript
MIT License
lerna/lerna
fix(run): Exit early when no packages contain the targeted lifecycle
1
fix
run
815,745
30.03.2018 15:12:14
-10,800
e9e66524702025689d92ba6869a7041eeff6b17b
chore(release): 0.34.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.34.0\"></a>\n+# [0.34.0](https://github.com/ng-select/ng-select/compare/v0.33.0...v0.34.0) (2018-03-30)\n+\n+\n+### Features\n+\n+* support compareWith ([#398](https://github.com/ng-select/ng-select/issues/398)) ([d195ccc](https://github.com/ng-select/ng-select/commit/d195ccc))\n+\n+\n+\n<a name=\"0.33.0\"></a>\n# [0.33.0](https://github.com/ng-select/ng-select/compare/v0.32.0...v0.33.0) (2018-03-30)\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.33.0\",\n+ \"version\": \"0.34.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.34.0
1
chore
release
217,922
30.03.2018 16:05:51
-7,200
1e11c8cce3dc98d1e426189c22733aee9dcd7491
feat: show indicator for items used for final crafts The idea is to show a HQ mark on items needed for final crafts, as they are often interesting to have HQ. The amount needed for final crafts is shown when hovering the icon.
[ { "change_type": "MODIFY", "diff": "\"integrity\": \"sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=\",\n\"dev\": true\n},\n- \"raven-js\": {\n- \"version\": \"3.24.0\",\n- \"resolved\": \"https://registry.npmjs.org/raven-js/-/raven-js-3.24.0.tgz\",\n- \"integrity\": \"sha512-+/ygcWib8PXAE7Xq53j1tYxCgkzFyp9z05LYAKp2PA9KwO4Ek74q1tkGwZyPWI/FoXOgas6jNtQ7O3tdPif6uA==\"\n- },\n\"raw-body\": {\n\"version\": \"2.3.2\",\n\"resolved\": \"https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz\",\n", "new_path": "package-lock.json", "old_path": "package-lock.json" }, { "change_type": "MODIFY", "diff": "mat-icon-button ngxClipboard [cbContent]=\"item.id | itemName | i18n\"\n(cbOnSuccess)=\"afterNameCopy(item.id)\">\n<span\n- [ngClass]=\"{'strike': item.done >= item.amount, 'compact': settings.compactLists, 'craftable': canBeCrafted}\">{{item.id | itemName | i18n}}</span>\n+ [ngClass]=\"{'strike': item.done >= item.amount, 'compact': settings.compactLists, 'craftable': canBeCrafted}\">\n+ {{item.id | itemName | i18n}}\n+ </span>\n</div>\n+ <img src=\"https://ffxiv.gamerescape.com/w/images/thumb/1/18/HQ_Icon.png/14px-HQ_Icon.png\" alt=\"\"\n+ matTooltip=\"{{'Required_for_final_craft' | translate: { amount: requiredForFinalCraft } }}\"\n+ matTooltipPosition=\"above\" *ngIf=\"requiredForFinalCraft>0 && !recipe\">\n<app-comments-button [name]=\"item.id | itemName | i18n\" [row]=\"item\" [list]=\"list\"\n- [isOwnList]=\"user?.$key === list?.authorId\" (updated)=\"update.emit()\"></app-comments-button>\n+ [isOwnList]=\"user?.$key === list?.authorId\"\n+ (updated)=\"update.emit()\"></app-comments-button>\n<button mat-icon-button\nmatTooltip=\"{{'Requirements_for_craft' | translate}}\"\nmatTooltipPosition=\"above\" [ngClass]=\"{'requirements-button':true, 'compact': settings.compactLists}\"\n", "new_path": "src/app/modules/item/item/item.component.html", "old_path": "src/app/modules/item/item/item.component.html" }, { "change_type": "MODIFY", "diff": "@@ -243,6 +243,8 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\n@Input()\nuser: AppUser;\n+ requiredForFinalCraft = 0;\n+\nslot: number;\ncanBeCrafted = false;\n@@ -304,6 +306,7 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\nthis.updateMasterBooks();\nthis.updateTimers();\nthis.updateHasBook();\n+ this.updateRequiredForEndCraft();\nif (this.item.workingOnIt !== undefined) {\nthis.userService.get(this.item.workingOnIt)\n.mergeMap(user => this.dataService.getCharacter(user.lodestoneId)).first().subscribe(char => {\n@@ -319,6 +322,7 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\nthis.updateMasterBooks();\nthis.updateTimers();\nthis.updateHasBook();\n+ this.updateRequiredForEndCraft();\nif (this.item.workingOnIt !== undefined && (this.worksOnIt === undefined || this.worksOnIt.id !== this.item.workingOnIt)) {\nthis.userService.get(this.item.workingOnIt)\n.mergeMap(user => this.dataService.getCharacter(user.lodestoneId)).first().subscribe(char => this.worksOnIt = char);\n@@ -385,6 +389,20 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\nthis.canBeCrafted = this.list.canBeCrafted(this.item) && this.item.done < this.item.amount;\n}\n+ updateRequiredForEndCraft(): void {\n+ const recipesNeedingItem = this.list.recipes\n+ .filter(recipe => recipe.requires.find(req => req.id === this.item.id) !== undefined);\n+ if (recipesNeedingItem.length === 0) {\n+ this.requiredForFinalCraft = 0;\n+ } else {\n+ let count = 0;\n+ recipesNeedingItem.forEach(recipe => {\n+ count += recipe.requires.find(req => req.id === this.item.id).amount * recipe.amount;\n+ });\n+ this.requiredForFinalCraft = count;\n+ }\n+ }\n+\ntoggleAlarm(id: number, type?: number): void {\nif (this.alarmService.hasAlarm(id)) {\nthis.alarmService.unregister(id);\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": "{\n+ \"Required_for_final_craft\": \"{{amount}} needed for final items\",\n\"Compact_sidebar_toggle\": \"Toggle compact sidebar\",\n\"Confirmation\": \"Confirmation\",\n\"Is_working_on_it\": \"{{name}} is working on it\",\n", "new_path": "src/assets/i18n/en.json", "old_path": "src/assets/i18n/en.json" }, { "change_type": "MODIFY", "diff": "{\n+ \"Required_for_final_craft\": \"{{amount}} needed for final items\",\n\"Compact_sidebar_toggle\": \"Toggle compact sidebar\",\n\"Confirmation\": \"Confirmation\",\n\"Is_working_on_it\": \"{{name}} is working on it\",\n", "new_path": "src/assets/i18n/ja.json", "old_path": "src/assets/i18n/ja.json" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
feat: show indicator for items used for final crafts The idea is to show a HQ mark on items needed for final crafts, as they are often interesting to have HQ. The amount needed for final crafts is shown when hovering the icon.
1
feat
null
815,745
30.03.2018 16:17:56
-10,800
ec56c645028856422346580b6c4cb17152ebe0a9
fix: remove default compareWith
[ { "change_type": "MODIFY", "diff": "@@ -69,13 +69,14 @@ export class ItemsList {\nfindItem(value: any): NgOption {\nif (this._ngSelect.bindValue) {\n- return this._items.find(item => !item.hasChildren &&\n- this._ngSelect.compareWith(this.resolveNested(item.value, this._ngSelect.bindValue), value));\n+ return this._items.find(item => !item.hasChildren && this.resolveNested(item.value, this._ngSelect.bindValue) === value);\n}\n- const index = this._items.findIndex(x => this._ngSelect.compareWith(x.value, value));\n- return index > -1 ?\n- this._items[index] :\n- this._items.find(item => !item.hasChildren && item.label && item.label === this.resolveNested(value, this._ngSelect.bindLabel));\n+ const option = this._items.find(x => x.value === value);\n+ const findBy = this._ngSelect.compareWith ?\n+ (item: NgOption) => this._ngSelect.compareWith(item.value, value) :\n+ (item: NgOption) => !item.hasChildren && item.label && item.label === this.resolveNested(value, this._ngSelect.bindLabel);\n+\n+ return option || this._items.find(item => findBy(item));\n}\nunselect(item: NgOption) {\n", "new_path": "src/ng-select/items-list.ts", "old_path": "src/ng-select/items-list.ts" }, { "change_type": "MODIFY", "diff": "@@ -187,7 +187,7 @@ describe('NgSelectComponent', function () {\nexpect(vilnius.selected).toBeTruthy();\n}));\n- it('should set items correctly after ngModel set first when typeahead and multiselect is used', fakeAsync(() => {\n+ it('should set items correctly after ngModel set first when typeahead and multi-select is used', fakeAsync(() => {\nconst fixture = createTestingModule(\nNgSelectTestCmp,\n`<ng-select [items]=\"cities\"\n@@ -2367,7 +2367,9 @@ class NgSelectTestCmp {\n});\n}\n- compareWith = (a, b) => a.name === b.name && a.district === b.district;\n+ compareWith(a, b) {\n+ return a.name === b.name && a.district === b.district\n+ }\ntoggleVisible() {\nthis.visible = !this.visible;\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": "@@ -147,9 +147,9 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nprivate _defaultValue = 'value';\nprivate _typeaheadLoading = false;\nprivate _primitive: boolean;\n+ private _compareWith: CompareWithFn;\nprivate readonly _destroy$ = new Subject<void>();\n- private _compareWith = (a: any, b: any) => a === b;\nprivate _onChange = (_: NgOption) => { };\nprivate _onTouched = () => { };\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 default compareWith
1
fix
null
815,745
30.03.2018 16:19:35
-10,800
1cd0bee8c96a487bdbf4f27718843f012fa9c2fb
chore(release): 0.34.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.34.1\"></a>\n+## [0.34.1](https://github.com/ng-select/ng-select/compare/v0.34.0...v0.34.1) (2018-03-30)\n+\n+\n+### Bug Fixes\n+\n+* remove default compareWith ([ec56c64](https://github.com/ng-select/ng-select/commit/ec56c64))\n+\n+\n+\n<a name=\"0.34.0\"></a>\n# [0.34.0](https://github.com/ng-select/ng-select/compare/v0.33.0...v0.34.0) (2018-03-30)\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.34.0\",\n+ \"version\": \"0.34.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.34.1
1
chore
release
815,746
30.03.2018 16:37:22
-10,800
2fca92820c01167784319a58d7255d67637b2df3
chore(release): 0.34.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.34.2\"></a>\n+## [0.34.2](https://github.com/ng-select/ng-select/compare/v0.34.1...v0.34.2) (2018-03-30)\n+\n+\n+\n<a name=\"0.34.1\"></a>\n## [0.34.1](https://github.com/ng-select/ng-select/compare/v0.34.0...v0.34.1) (2018-03-30)\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.34.1\",\n+ \"version\": \"0.34.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.34.2
1
chore
release
807,849
30.03.2018 16:54:07
25,200
cd787648fea6b78a06ea4c39c141fd748783c64d
test(helpers): Add sawmill ...geddit?!
[ { "change_type": "ADD", "diff": "+\"use strict\";\n+\n+const concat = require(\"concat-stream\");\n+const log = require(\"npmlog\");\n+\n+module.exports = sawmill;\n+\n+function sawmill() {\n+ // https://en.wikipedia.org/wiki/Log_flume\n+ const flume = new Promise((finish, fouled) => {\n+ // overrides default process.stderr, hiding logs during test execution\n+ log.stream = concat(finish).on(\"error\", fouled);\n+ });\n+\n+ return () => {\n+ // resolves the logs in flume\n+ log.stream.end();\n+\n+ return flume;\n+ };\n+}\n", "new_path": "helpers/sawmill/index.js", "old_path": null }, { "change_type": "ADD", "diff": "+{\n+ \"name\": \"@lerna-test/sawmill\",\n+ \"version\": \"0.0.0-test-only\",\n+ \"description\": \"A local test helper\",\n+ \"main\": \"index.js\",\n+ \"private\": true,\n+ \"license\": \"MIT\",\n+ \"dependencies\": {\n+ \"concat-stream\": \"^1.6.2\",\n+ \"npmlog\": \"^4.1.2\"\n+ }\n+}\n", "new_path": "helpers/sawmill/package.json", "old_path": null }, { "change_type": "MODIFY", "diff": "\"semver\": \"5.5.0\"\n}\n},\n+ \"@lerna-test/sawmill\": {\n+ \"version\": \"file:helpers/sawmill\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"concat-stream\": \"1.6.2\",\n+ \"npmlog\": \"4.1.2\"\n+ }\n+ },\n\"@lerna-test/serialize-changelog\": {\n\"version\": \"file:helpers/serialize-changelog\",\n\"dev\": true,\n", "new_path": "package-lock.json", "old_path": "package-lock.json" }, { "change_type": "MODIFY", "diff": "\"@lerna-test/normalize-relative-dir\": \"file:helpers/normalize-relative-dir\",\n\"@lerna-test/normalize-test-root\": \"file:helpers/normalize-test-root\",\n\"@lerna-test/pkg-matchers\": \"file:helpers/pkg-matchers\",\n+ \"@lerna-test/sawmill\": \"file:helpers/sawmill\",\n\"@lerna-test/serialize-changelog\": \"file:helpers/serialize-changelog\",\n\"@lerna-test/serialize-git-sha\": \"file:helpers/serialize-git-sha\",\n\"@lerna-test/serialize-placeholders\": \"file:helpers/serialize-placeholders\",\n", "new_path": "package.json", "old_path": "package.json" } ]
JavaScript
MIT License
lerna/lerna
test(helpers): Add sawmill ...geddit?!
1
test
helpers
807,849
30.03.2018 17:12:49
25,200
5242b510f21c6cca16989c5acfebf9637a60b53a
test(command-runner): Silence logging with streams
[ { "change_type": "ADD", "diff": "+// Jest Snapshot v1, https://goo.gl/fbAQLP\n+\n+exports[`ExecCommand in a cyclical repo warns when cycles are encountered 1`] = `\n+\"lerna WARN ECYCLE Dependency cycles detected, you should fix these!\n+lerna WARN ECYCLE package-cycle-1 -> package-cycle-2 -> package-cycle-1\n+lerna WARN ECYCLE package-cycle-2 -> package-cycle-1 -> package-cycle-2\n+lerna WARN ECYCLE package-cycle-extraneous -> package-cycle-1 -> package-cycle-2 -> package-cycle-1 -> package-cycle-1@1.0.0\n+\"\n+`;\n", "new_path": "commands/exec/__tests__/__snapshots__/exec-command.test.js.snap", "old_path": null }, { "change_type": "MODIFY", "diff": "@@ -11,7 +11,6 @@ const initFixture = require(\"@lerna-test/init-fixture\")(__dirname);\nconst gitAdd = require(\"@lerna-test/git-add\");\nconst gitCommit = require(\"@lerna-test/git-commit\");\nconst gitTag = require(\"@lerna-test/git-tag\");\n-const loggingOutput = require(\"@lerna-test/logging-output\");\nconst normalizeRelativeDir = require(\"@lerna-test/normalize-relative-dir\");\n// file under test\n@@ -225,16 +224,9 @@ describe(\"ExecCommand\", () => {\nit(\"warns when cycles are encountered\", async () => {\nconst testDir = await initFixture(\"toposort\");\n- await lernaExec(testDir)(\"ls\");\n-\n- const [logMessage] = loggingOutput(\"warn\");\n- expect(logMessage).toMatch(\"Dependency cycles detected, you should fix these!\");\n- expect(logMessage).toMatch(\"package-cycle-1 -> package-cycle-2 -> package-cycle-1\");\n- expect(logMessage).toMatch(\"package-cycle-2 -> package-cycle-1 -> package-cycle-2\");\n- expect(logMessage).toMatch(\n- \"package-cycle-extraneous -> package-cycle-1 -> package-cycle-2 -> package-cycle-1\"\n- );\n+ const { logs } = await lernaExec(testDir)(\"ls\", \"--loglevel=warn\");\n+ expect(logs).toMatchSnapshot();\nexpect(calledInPackages()).toEqual([\n\"package-dag-1\",\n\"package-standalone\",\n", "new_path": "commands/exec/__tests__/exec-command.test.js", "old_path": "commands/exec/__tests__/exec-command.test.js" }, { "change_type": "MODIFY", "diff": "@@ -26,7 +26,6 @@ const runLifecycle = require(\"@lerna/run-lifecycle\");\n// helpers\nconst consoleOutput = require(\"@lerna-test/console-output\");\n-const loggingOutput = require(\"@lerna-test/logging-output\");\nconst initFixture = require(\"@lerna-test/init-fixture\")(__dirname);\nconst normalizeRelativeDir = require(\"@lerna-test/normalize-relative-dir\");\n@@ -370,10 +369,9 @@ describe(\"PublishCommand\", () => {\nit(\"should display a message that git is skipped\", async () => {\nconst testDir = await initFixture(\"normal\");\n- await lernaPublish(testDir)(\"--skip-git\");\n+ const { logs } = await lernaPublish(testDir)(\"--skip-git\");\n- const logMessages = loggingOutput(\"info\");\n- expect(logMessages).toContain(\"Skipping git commit/push\");\n+ expect(logs).toMatch(\"Skipping git commit/push\");\n});\n});\n@@ -405,10 +403,9 @@ describe(\"PublishCommand\", () => {\nit(\"should display a message that npm is skipped\", async () => {\nconst testDir = await initFixture(\"normal\");\n- await lernaPublish(testDir)(\"--skip-npm\");\n+ const { logs } = await lernaPublish(testDir)(\"--skip-npm\");\n- const logMessages = loggingOutput(\"info\");\n- expect(logMessages).toContain(\"Skipping publish to registry\");\n+ expect(logs).toMatch(\"Skipping publish to registry\");\n});\n});\n@@ -450,11 +447,10 @@ describe(\"PublishCommand\", () => {\nit(\"should display a message that npm and git are skipped\", async () => {\nconst testDir = await initFixture(\"normal\");\n- await lernaPublish(testDir)(\"--skip-git\", \"--skip-npm\");\n+ const { logs } = await lernaPublish(testDir)(\"--skip-git\", \"--skip-npm\");\n- const logMessages = loggingOutput(\"info\");\n- expect(logMessages).toContain(\"Skipping git commit/push\");\n- expect(logMessages).toContain(\"Skipping publish to registry\");\n+ expect(logs).toMatch(\"Skipping git commit/push\");\n+ expect(logs).toMatch(\"Skipping publish to registry\");\n});\n});\n@@ -1100,11 +1096,10 @@ describe(\"PublishCommand\", () => {\nGitUtilities.isBehindUpstream.mockReturnValueOnce(true);\n- await lernaPublish(testDir)(\"--ci\");\n+ const { logs } = await lernaPublish(testDir)(\"--ci\", \"--loglevel\", \"warn\");\n- const [warning] = loggingOutput(\"warn\");\n- expect(warning).toMatch(\"behind remote upstream\");\n- expect(warning).toMatch(\"exiting\");\n+ expect(logs).toMatch(\"behind remote upstream\");\n+ expect(logs).toMatch(\"exiting\");\n});\n});\n@@ -1160,13 +1155,12 @@ describe(\"PublishCommand\", () => {\nrunLifecycle.mockImplementationOnce(() => Promise.reject(new Error(\"boom\")));\n- await lernaPublish(testDir)();\n+ const { logs } = await lernaPublish(testDir)(\"--loglevel\", \"error\");\nexpect(runLifecycle).toHaveBeenCalledTimes(12);\nexpect(updatedPackageVersions(testDir)).toMatchSnapshot(\"updated packages\");\n- const [errorLog] = loggingOutput(\"error\");\n- expect(errorLog).toMatch(\"error running preversion in lifecycle\");\n+ expect(logs).toMatch(\"error running preversion in lifecycle\");\n});\nit(\"adapts to missing root package name\", async () => {\n", "new_path": "commands/publish/__tests__/publish-command.test.js", "old_path": "commands/publish/__tests__/publish-command.test.js" }, { "change_type": "MODIFY", "diff": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n+exports[`RunCommand in a basic repo does not error when no packages match 1`] = `\n+\"lerna success run No packages found with the lifecycle script 'missing-script'\n+\"\n+`;\n+\nexports[`RunCommand in a basic repo omits package prefix with --parallel --no-prefix 1`] = `\nArray [\n\"packages/package-1 npm run env (prefixed: false)\",\n@@ -31,3 +36,11 @@ Array [\n\"packages/package-3 npm run my-script (prefixed: true)\",\n]\n`;\n+\n+exports[`RunCommand in a cyclical repo warns when cycles are encountered 1`] = `\n+\"lerna WARN ECYCLE Dependency cycles detected, you should fix these!\n+lerna WARN ECYCLE package-cycle-1 -> package-cycle-2 -> package-cycle-1\n+lerna WARN ECYCLE package-cycle-2 -> package-cycle-1 -> package-cycle-2\n+lerna WARN ECYCLE package-cycle-extraneous -> package-cycle-1 -> package-cycle-2 -> package-cycle-1 -> package-cycle-1@1.0.0\n+\"\n+`;\n", "new_path": "commands/run/__tests__/__snapshots__/run-command.test.js.snap", "old_path": "commands/run/__tests__/__snapshots__/run-command.test.js.snap" }, { "change_type": "MODIFY", "diff": "@@ -12,7 +12,6 @@ const npmRunScript = require(\"@lerna/npm-run-script\");\n// helpers\nconst initFixture = require(\"@lerna-test/init-fixture\")(__dirname);\nconst consoleOutput = require(\"@lerna-test/console-output\");\n-const loggingOutput = require(\"@lerna-test/logging-output\");\nconst gitAdd = require(\"@lerna-test/git-add\");\nconst gitCommit = require(\"@lerna-test/git-commit\");\nconst normalizeRelativeDir = require(\"@lerna-test/normalize-relative-dir\");\n@@ -124,11 +123,9 @@ describe(\"RunCommand\", () => {\nit(\"does not error when no packages match\", async () => {\nconst testDir = await initFixture(\"basic\");\n- await lernaRun(testDir)(\"missing-script\");\n+ const { logs } = await lernaRun(testDir)(\"missing-script\", \"--loglevel=success\");\n- expect(loggingOutput(\"success\")).toContain(\n- \"No packages found with the lifecycle script 'missing-script'\"\n- );\n+ expect(logs).toMatchSnapshot();\n});\nit(\"runs a script in all packages with --parallel\", async () => {\n@@ -192,16 +189,9 @@ describe(\"RunCommand\", () => {\nit(\"warns when cycles are encountered\", async () => {\nconst testDir = await initFixture(\"toposort\");\n- await lernaRun(testDir)(\"env\");\n-\n- const [logMessage] = loggingOutput(\"warn\");\n- expect(logMessage).toMatch(\"Dependency cycles detected, you should fix these!\");\n- expect(logMessage).toMatch(\"package-cycle-1 -> package-cycle-2 -> package-cycle-1\");\n- expect(logMessage).toMatch(\"package-cycle-2 -> package-cycle-1 -> package-cycle-2\");\n- expect(logMessage).toMatch(\n- \"package-cycle-extraneous -> package-cycle-1 -> package-cycle-2 -> package-cycle-1\"\n- );\n+ const { logs } = await lernaRun(testDir)(\"env\", \"--loglevel=warn\");\n+ expect(logs).toMatchSnapshot();\nexpect(consoleOutput().split(\"\\n\")).toEqual([\n\"package-dag-1\",\n\"package-standalone\",\n", "new_path": "commands/run/__tests__/run-command.test.js", "old_path": "commands/run/__tests__/run-command.test.js" }, { "change_type": "MODIFY", "diff": "\"use strict\";\n+// silence logs outside of command runner\n+require(\"@lerna-test/silence-logging\");\n+\nconst fs = require(\"fs-extra\");\nconst execa = require(\"execa\");\nconst log = require(\"npmlog\");\n", "new_path": "core/command/__tests__/command.test.js", "old_path": "core/command/__tests__/command.test.js" }, { "change_type": "MODIFY", "diff": "\"use strict\";\n+// silence logs outside of command runner\n+require(\"@lerna-test/silence-logging\");\n+\nconst fs = require(\"fs-extra\");\nconst path = require(\"path\");\n", "new_path": "core/project/__tests__/project.test.js", "old_path": "core/project/__tests__/project.test.js" }, { "change_type": "MODIFY", "diff": "const path = require(\"path\");\nconst yargs = require(\"yargs/yargs\");\nconst globalOptions = require(\"@lerna/global-options\");\n+const sawmill = require(\"@lerna-test/sawmill\");\nmodule.exports = commandRunner;\n@@ -35,19 +36,26 @@ function commandRunner(commandModule) {\nreturn (...args) =>\nnew Promise((resolve, reject) => {\nconst yargsMeta = {};\n+ const sluice = sawmill();\nconst context = {\ncwd,\nlernaVersion: \"__TEST_VERSION__\",\nonResolved: result => {\n+ sluice().then(logs => {\n// success resolves the result, if any, returned from execute()\n- resolve(Object.assign({}, result, yargsMeta));\n+ resolve(Object.assign({ logs }, result, yargsMeta));\n+ });\n},\nonRejected: result => {\n- Object.assign(result, yargsMeta);\n+ sluice().then(logs => {\n+ // result must stay an Error, not arbitrary object\n+ Object.assign(result, yargsMeta, { logs });\n+\n// tests expect errors thrown to indicate failure,\n// _not_ just non-zero exitCode\nreject(result);\n+ });\n},\n};\n", "new_path": "helpers/command-runner/index.js", "old_path": "helpers/command-runner/index.js" }, { "change_type": "MODIFY", "diff": "\"private\": true,\n\"license\": \"MIT\",\n\"dependencies\": {\n+ \"@lerna-test/sawmill\": \"file:../sawmill\",\n\"@lerna/global-options\": \"file:../../core/global-options\",\n\"yargs\": \"^11.0.0\"\n}\n", "new_path": "helpers/command-runner/package.json", "old_path": "helpers/command-runner/package.json" }, { "change_type": "MODIFY", "diff": "@@ -5,6 +5,6 @@ module.exports = {\ncollectCoverageFrom: [\"{commands,core,utils}/**/*.js\", \"!commands/create/lerna-module-data.js\"],\nmodulePathIgnorePatterns: [\"/__fixtures__/\"],\nroots: [\"<rootDir>/commands\", \"<rootDir>/core\", \"<rootDir>/utils\"],\n- setupFiles: [\"@lerna-test/silence-logging\", \"@lerna-test/set-npm-userconfig\"],\n+ setupFiles: [\"@lerna-test/set-npm-userconfig\"],\ntestEnvironment: \"node\",\n};\n", "new_path": "jest.config.js", "old_path": "jest.config.js" }, { "change_type": "MODIFY", "diff": "\"version\": \"file:helpers/command-runner\",\n\"dev\": true,\n\"requires\": {\n+ \"@lerna-test/sawmill\": \"file:helpers/sawmill\",\n\"@lerna/global-options\": \"file:core/global-options\",\n\"yargs\": \"11.0.0\"\n}\n", "new_path": "package-lock.json", "old_path": "package-lock.json" } ]
JavaScript
MIT License
lerna/lerna
test(command-runner): Silence logging with streams
1
test
command-runner
807,849
30.03.2018 17:53:29
25,200
b766c836a27e504ae639b6d00eae52ab5c4ff7a0
feat: Enable progress bars only when necessary This inverts the previous pattern, where they were always enabled for TTYs, but rarely used. Also supports --no-progress and durable configuration.
[ { "change_type": "MODIFY", "diff": "@@ -95,6 +95,8 @@ class BootstrapCommand extends Command {\nreturn this.installRootPackageOnly();\n}\n+ // root install does not need progress bar\n+ this.enableProgressBar();\nthis.logger.info(\"\", `Bootstrapping ${this.filteredPackages.length} packages`);\nconst tasks = [\n@@ -120,7 +122,6 @@ class BootstrapCommand extends Command {\n}\ninstallRootPackageOnly() {\n- this.logger.disableProgress();\nthis.logger.info(\"bootstrap\", \"root only\");\n// don't hide yarn or npm output\n", "new_path": "commands/bootstrap/index.js", "old_path": "commands/bootstrap/index.js" }, { "change_type": "MODIFY", "diff": "@@ -24,9 +24,6 @@ class ChangedCommand extends Command {\n}\ninitialize() {\n- // don't interrupt stdio\n- this.logger.disableProgress();\n-\nthis.updates = collectUpdates(this);\nconst proceedWithUpdates = this.updates.length > 0;\n", "new_path": "commands/changed/index.js", "old_path": "commands/changed/index.js" }, { "change_type": "MODIFY", "diff": "@@ -35,6 +35,8 @@ class CleanCommand extends Command {\n}\nexecute() {\n+ this.enableProgressBar();\n+\nconst tracker = this.logger.newItem(\"clean\");\nconst mapper = dirPath => {\ntracker.info(\"clean\", \"removing\", dirPath);\n", "new_path": "commands/clean/index.js", "old_path": "commands/clean/index.js" }, { "change_type": "MODIFY", "diff": "@@ -49,9 +49,6 @@ class CreateCommand extends Command {\nyes,\n} = this.options;\n- // disable progress so promzard doesn't get ganked\n- this.logger.disableProgress();\n-\n// npm-package-arg handles all the edge-cases with scopes\nconst { name, scope } = npa(pkgName);\n", "new_path": "commands/create/index.js", "old_path": "commands/create/index.js" }, { "change_type": "MODIFY", "diff": "@@ -16,9 +16,6 @@ class DiffCommand extends Command {\ninitialize() {\nconst packageName = this.options.pkgName;\n- // don't interrupt spawned or streaming stdio\n- this.logger.disableProgress();\n-\nlet targetPackage;\nif (packageName) {\n", "new_path": "commands/diff/index.js", "old_path": "commands/diff/index.js" }, { "change_type": "MODIFY", "diff": "@@ -36,9 +36,6 @@ class ExecCommand extends Command {\nthrow new ValidationError(\"ENOCOMMAND\", \"A command to execute is required\");\n}\n- // don't interrupt spawned or streaming stdio\n- this.logger.disableProgress();\n-\nconst { filteredPackages } = this;\nthis.batchedPackages = this.toposort\n", "new_path": "commands/exec/index.js", "old_path": "commands/exec/index.js" }, { "change_type": "MODIFY", "diff": "@@ -156,6 +156,8 @@ class ImportCommand extends Command {\n}\nexecute() {\n+ this.enableProgressBar();\n+\nconst tracker = this.logger.newItem(\"execute\");\nconst mapper = sha => {\ntracker.info(sha);\n", "new_path": "commands/import/index.js", "old_path": "commands/import/index.js" }, { "change_type": "MODIFY", "diff": "@@ -24,9 +24,6 @@ class ListCommand extends Command {\n}\ninitialize() {\n- // don't interrupt stdio\n- this.logger.disableProgress();\n-\nthis.resultList = this.filteredPackages.map(pkg => ({\nname: pkg.name,\nversion: pkg.version,\n", "new_path": "commands/list/index.js", "old_path": "commands/list/index.js" }, { "change_type": "MODIFY", "diff": "@@ -147,6 +147,8 @@ class PublishCommand extends Command {\n}\nexecute() {\n+ this.enableProgressBar();\n+\nconst tasks = [];\nif (!this.project.isIndependent() && !this.options.canary) {\n", "new_path": "commands/publish/index.js", "old_path": "commands/publish/index.js" }, { "change_type": "MODIFY", "diff": "@@ -30,7 +30,7 @@ class RunCommand extends Command {\n}\ninitialize() {\n- const { script, npmClient = \"npm\", parallel, stream } = this.options;\n+ const { script, npmClient = \"npm\" } = this.options;\nthis.script = script;\nthis.args = this.options[\"--\"] || [];\n@@ -53,11 +53,6 @@ class RunCommand extends Command {\nreturn false;\n}\n- if (parallel || stream) {\n- // don't interrupt streaming stdio\n- this.logger.disableProgress();\n- }\n-\nthis.batchedPackages = this.toposort\n? batchPackages(this.packagesWithScript, this.options.rejectCycles)\n: [this.packagesWithScript];\n", "new_path": "commands/run/index.js", "old_path": "commands/run/index.js" }, { "change_type": "MODIFY", "diff": "@@ -32,13 +32,14 @@ module.exports = lernaCLI;\n*/\nfunction lernaCLI(argv, cwd) {\nconst cli = yargs(argv, cwd);\n+ let progress; // --no-progress always disables\nif (isCI || !process.stderr.isTTY) {\nlog.disableColor();\n- log.disableProgress();\n+ progress = false;\n} else if (!process.stdout.isTTY) {\n// stdout is being piped, don't log non-errors or progress bars\n- log.disableProgress();\n+ progress = false;\ncli.check(parsedArgv => {\n// eslint-disable-next-line no-param-reassign\n@@ -50,12 +51,11 @@ function lernaCLI(argv, cwd) {\n} else if (process.stderr.isTTY) {\nlog.enableColor();\nlog.enableUnicode();\n- log.enableProgress();\n}\nreturn globalOptions(cli)\n.usage(\"Usage: $0 <command> [options]\")\n- .config({ ci: isCI })\n+ .config({ ci: isCI, progress })\n.command(addCmd)\n.command(bootstrapCmd)\n.command(changedCmd)\n", "new_path": "core/cli/index.js", "old_path": "core/cli/index.js" }, { "change_type": "MODIFY", "diff": "@@ -98,6 +98,7 @@ class Command {\nget defaultOptions() {\nreturn {\nconcurrency: DEFAULT_CONCURRENCY,\n+ progress: true,\nsort: true,\n};\n}\n@@ -150,6 +151,13 @@ class Command {\nlog.resume();\n}\n+ enableProgressBar() {\n+ // istanbul ignore else\n+ if (this.options.progress) {\n+ this.logger.enableProgress();\n+ }\n+ }\n+\nrunValidations() {\nif (\n(this.options.since !== undefined || this.requiresGit) &&\n", "new_path": "core/command/index.js", "old_path": "core/command/index.js" }, { "change_type": "MODIFY", "diff": "@@ -20,6 +20,12 @@ function globalOptions(yargs) {\ntype: \"boolean\",\ndefault: undefined,\n},\n+ progress: {\n+ defaultDescription: \"true\",\n+ describe: \"Enable progress bars. Pass --no-progress to disable. (Always off in CI)\",\n+ type: \"boolean\",\n+ default: undefined,\n+ },\nsort: {\ndefaultDescription: \"true\",\ndescribe: \"Sort packages topologically (all dependencies before dependents).\",\n", "new_path": "core/global-options/index.js", "old_path": "core/global-options/index.js" } ]
JavaScript
MIT License
lerna/lerna
feat: Enable progress bars only when necessary This inverts the previous pattern, where they were always enabled for TTYs, but rarely used. Also supports --no-progress and durable configuration.
1
feat
null
791,790
30.03.2018 23:00:10
-7,200
65dbd14fcccc0e6cf9181790a980dba8fa7d8189
docs: remove dated domhtml reference from README
[ { "change_type": "MODIFY", "diff": "@@ -70,7 +70,7 @@ Configuration:\n--audit-mode, -A Process saved artifacts from disk [boolean]\nOutput:\n- --output Reporter for the results, supports multiple values [choices: \"json\", \"html\", \"domhtml\"] [default: \"domhtml\"]\n+ --output Reporter for the results, supports multiple values [choices: \"json\", \"html\"] [default: \"html\"]\n--output-path The file path to output the results. Use 'stdout' to write to stdout.\nIf using JSON 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.\n", "new_path": "readme.md", "old_path": "readme.md" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
docs: remove dated domhtml reference from README (#4900)
1
docs
null
724,210
31.03.2018 02:07:33
-32,400
1d531aa029a3e40fc364c6a986ce760e04a550d5
docs: replace from mapCoverage to collectCoverage in Jest sample.
[ { "change_type": "MODIFY", "diff": "@@ -48,8 +48,7 @@ Next, create a `jest` block in `package.json`:\n\"transform\": {\n// process `*.vue` files with `vue-jest`\n\".*\\\\.(vue)$\": \"<rootDir>/node_modules/vue-jest\"\n- },\n- \"mapCoverage\": true\n+ }\n}\n}\n```\n@@ -159,7 +158,7 @@ Jest recommends creating a `__tests__` directory right next to the code being te\nJest can be used to generate coverage reports in multiple formats. The following is a simple example to get started with:\n-Extend your `jest` config (usually in `package.json` or `jest.config.js`) with the [`collectCoverage`](https://facebook.github.io/jest/docs/en/configuration.html#collectcoverage-boolean) option, and then add the [`collectCoverageFrom`](https://facebook.github.io/jest/docs/en/configuration.html#collectcoveragefrom-array) array to define the files for which coverage information should be collected. You'll also want [`mapCoverage`](https://facebook.github.io/jest/docs/en/configuration.html#mapcoverage-boolean) to be `true`, for coverage data to be accurate.\n+Extend your `jest` config (usually in `package.json` or `jest.config.js`) with the [`collectCoverage`](https://facebook.github.io/jest/docs/en/configuration.html#collectcoverage-boolean) option, and then add the [`collectCoverageFrom`](https://facebook.github.io/jest/docs/en/configuration.html#collectcoveragefrom-array) array to define the files for which coverage information should be collected.\n```json\n{\n@@ -169,8 +168,7 @@ Extend your `jest` config (usually in `package.json` or `jest.config.js`) with t\n\"collectCoverageFrom\": [\n\"**/*.{js,vue}\",\n\"!**/node_modules/**\"\n- ],\n- \"mapCoverage\": true\n+ ]\n}\n}\n```\n", "new_path": "docs/en/guides/testing-SFCs-with-jest.md", "old_path": "docs/en/guides/testing-SFCs-with-jest.md" } ]
JavaScript
MIT License
vuejs/vue-test-utils
docs: replace from mapCoverage to collectCoverage in Jest sample. (#493)
1
docs
null
724,111
31.03.2018 03:13:52
-28,800
3e50827926ed9bda36e58697def49711a6e576cf
docs: synced sync option
[ { "change_type": "MODIFY", "diff": "@@ -172,6 +172,8 @@ Pass properties for components to use in injection. See [provide/inject](https:/\n- type: `boolean`\n- default: `true`\n+Sets all watchers to run synchronously.\n+\nWhen `sync` is `true`, the Vue component is rendered synchronously.\nWhen `sync` is `false`, the Vue component is rendered asynchronously.\n", "new_path": "docs/en/api/options.md", "old_path": "docs/en/api/options.md" } ]
JavaScript
MIT License
vuejs/vue-test-utils
docs: synced sync option (#474) (#482)
1
docs
null
679,913
31.03.2018 04:46:45
-3,600
5db90c538ffd8ae46517f822b14c08b226309463
feat(pointfree): add caseq()
[ { "change_type": "MODIFY", "diff": "@@ -1135,6 +1135,12 @@ export const cases = (cases: IObjectOf<StackProc>) =>\nillegalState(`no matching case for: ${tos}`);\n};\n+export const casesq = (ctx: StackContext) => {\n+ const stack = ctx[0];\n+ $(stack, 2);\n+ return cases(stack.pop())(ctx);\n+};\n+\n//////////////////// Loop constructs ////////////////////\n/**\n", "new_path": "packages/pointfree/src/index.ts", "old_path": "packages/pointfree/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(pointfree): add caseq()
1
feat
pointfree
679,913
31.03.2018 05:18:31
-3,600
9e43405a9a49de327da6d570729d430341702620
docs: update pointfree readme's
[ { "change_type": "MODIFY", "diff": "@@ -60,8 +60,6 @@ import * as pf from \"@thi.ng/pointfree-lang\";\n## Usage examples\n```ts\n-import * as pf from \"../src\";\n-\n// DSL source code (syntax described further below)\nconst src = `\n@@ -131,9 +129,13 @@ env.height = 480;\n// now actually call the `hairx` word with args pulled from env\n// words prefixed w/ `@` are variable lookups\npf.run(`@mouseX @mouseY @width @height hairx`, env);\n+// draw line: 100,0 -> 100,480\n+// draw line: 0,200 -> 640,200\n// or call precompiled word/function directly w/ given initial stack\npf.runWord(\"hairx\", env, [100, 200, 640, 480]);\n+// draw line: 100,0 -> 100,480\n+// draw line: 0,200 -> 640,200\n```\n## Language & Syntax\n", "new_path": "packages/pointfree-lang/README.md", "old_path": "packages/pointfree-lang/README.md" }, { "change_type": "MODIFY", "diff": "[![npm (scoped)](https://img.shields.io/npm/v/@thi.ng/pointfree.svg)](https://www.npmjs.com/package/@thi.ng/pointfree)\n+This project is part of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.\n+\n<!-- TOC depthFrom:2 depthTo:3 -->\n- [About](#about)\n## About\n[Pointfree](https://en.wikipedia.org/wiki/Concatenative_programming_language)\n-functional composition via lightweight (~3KB gzipped), stack-based DSL:\n+functional composition via lightweight (~3KB gzipped), stack-based embedded DSL.\n+\n+This module implements the language's core components in vanilla ES6 and\n+is perfectly usable like that. **The related [@thi.ng/pointfree-lang](https://github.com/thi-ng/umbrella/tree/master/packages/pointfree-lang)\n+module defines an actual language with a powerful and more concise\n+syntax around this module and might be better suited for some use\n+cases.**\n+\n+Current features:\n-- powerful, concise syntax\n- words implemented as tiny vanilla JS functions (easily extensible)\n- optimized pre-composition/compilation of custom user defined words (see [comp.ts](https://github.com/thi-ng/umbrella/tree/master/packages/pointfree/src/comp.ts))\n- dual stack (main & stash/scratch space)\n", "new_path": "packages/pointfree/README.md", "old_path": "packages/pointfree/README.md" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
docs: update pointfree readme's
1
docs
null
679,913
31.03.2018 05:34:16
-3,600
fbb17957094d5352c4d80c6c0ecad142c73f91a3
docs(pointfree-lang): fix grammar link
[ { "change_type": "MODIFY", "diff": "@@ -34,7 +34,7 @@ Experimental, small DSL with compact [Forth]() style syntax for\n[@thi.ng/pointfree](https://github.com/thi-ng/umbrella/tree/master/packages/pointfree):\n- [PegJS](https://pegjs.org/) based\n- [grammar](https://github.com/thi-ng/umbrella/tree/master/packages/pointfree/src/grammar.pegjs)\n+ [grammar](https://github.com/thi-ng/umbrella/tree/master/packages/pointfree-lang/src/grammar.pegjs)\n& parser\n- untyped, interpreted, but with AOT compilation of user defined words\n- support for custom / externally defined vocabularies (word sets)\n", "new_path": "packages/pointfree-lang/README.md", "old_path": "packages/pointfree-lang/README.md" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
docs(pointfree-lang): fix grammar link
1
docs
pointfree-lang
679,913
31.03.2018 05:46:52
-3,600
b16c85000309b3021a76b5d16b1629907d26638f
docs(pointfree-lang): fix readme link
[ { "change_type": "MODIFY", "diff": "@@ -30,7 +30,9 @@ This project is part of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrell\n## About\n-Experimental, small DSL with compact [Forth]() style syntax for\n+Experimental, small DSL with compact\n+[Forth](https://en.wikipedia.org/wiki/Forth_(programming_language))\n+style syntax for\n[@thi.ng/pointfree](https://github.com/thi-ng/umbrella/tree/master/packages/pointfree):\n- [PegJS](https://pegjs.org/) based\n@@ -257,7 +259,8 @@ The symbol `T` evaluates as `true` and `F` as `false`.\n### Quotations (Arrays)\n-Arrays can be contain any valid data literal or symbol and can be arbitrarily nested. Commas optional.\n+Arrays can be contain any valid data literal or symbol and can be\n+arbitrarily nested. Commas optional.\n`[\"result: \" [2, 3, *] exec +]`\n", "new_path": "packages/pointfree-lang/README.md", "old_path": "packages/pointfree-lang/README.md" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
docs(pointfree-lang): fix readme link
1
docs
pointfree-lang
815,745
31.03.2018 11:40:41
-10,800
1e16f98423b9b207bcdcfc158424fc0027400778
fix: keep placeholder visible in material theme fixes
[ { "change_type": "MODIFY", "diff": "@@ -198,7 +198,7 @@ export class ReactiveFormsComponent {\nheroId: 'hero1',\nagree: null,\nselectedCitiesIds: [],\n- age: ['', Validators.required],\n+ age: [null, Validators.required],\nalbum: '',\nphoto: ''\n});\n", "new_path": "demo/app/examples/reactive-forms.component.ts", "old_path": "demo/app/examples/reactive-forms.component.ts" }, { "change_type": "MODIFY", "diff": "cursor: default;\n}\n}\n- .ng-has-value,\n&.filtered {\n.ng-placeholder {\ndisplay: none;\n", "new_path": "src/ng-select/ng-select.component.scss", "old_path": "src/ng-select/ng-select.component.scss" }, { "change_type": "MODIFY", "diff": "@@ -40,6 +40,9 @@ $color-selected: #f5faff;\nbackground-color: #f9f9f9;\n}\n}\n+ .ng-has-value .ng-placeholder {\n+ display: none;\n+ }\n.ng-control {\nbackground-color: #fff;\nborder-radius: 4px;\n@@ -195,7 +198,6 @@ $color-selected: #f5faff;\n}\n.ng-dropdown-panel-items {\nmargin-bottom: 1px;\n-\n.ng-optgroup {\nuser-select: none;\ncursor: default;\n@@ -213,12 +215,10 @@ $color-selected: #f5faff;\nfont-weight: 600;\n}\n}\n-\n.ng-option {\nbackground-color: #fff;\ncolor: rgba(0, 0, 0, .87);\npadding: 8px 10px;\n-\n&.selected {\ncolor: #333;\nbackground-color: $color-selected;\n@@ -236,7 +236,6 @@ $color-selected: #f5faff;\n&.ng-option-child {\npadding-left: 22px;\n}\n-\n.ng-tag-label {\npadding-right: 5px;\nfont-size: 80%;\n", "new_path": "src/themes/default.theme.scss", "old_path": "src/themes/default.theme.scss" } ]
TypeScript
MIT License
ng-select/ng-select
fix: keep placeholder visible in material theme fixes #358
1
fix
null
815,745
31.03.2018 12:58:44
-10,800
8138c73ea113ba6a18d9ffdb1118f105792d3ebe
fix: hide IE input clear icon closes
[ { "change_type": "MODIFY", "diff": "outline: none;\ncursor: default;\nwidth: 100%;\n+ &::-ms-clear {\n+ display: none;\n+ }\n}\n}\n}\n", "new_path": "src/ng-select/ng-select.component.scss", "old_path": "src/ng-select/ng-select.component.scss" } ]
TypeScript
MIT License
ng-select/ng-select
fix: hide IE input clear icon closes #401
1
fix
null
815,745
31.03.2018 13:08:52
-10,800
e55b67497ff2adab64c36fb8d48518fa6a1e5f1f
fix: use correct aria role closes
[ { "change_type": "MODIFY", "diff": "@@ -63,7 +63,7 @@ export type CompareWithFn = (a: any, b: any) => boolean;\nencapsulation: ViewEncapsulation.None,\nchangeDetection: ChangeDetectionStrategy.OnPush,\nhost: {\n- 'role': 'dropdown',\n+ 'role': 'listbox',\n'class': 'ng-select',\n'[class.ng-single]': '!multiple',\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: use correct aria role closes #403
1
fix
null
815,745
31.03.2018 13:32:27
-10,800
ff917910fab515c2d073cfd867c55a7219d26778
chore(release): 0.34.3
[ { "change_type": "MODIFY", "diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"0.34.3\"></a>\n+## [0.34.3](https://github.com/ng-select/ng-select/compare/v0.34.2...v0.34.3) (2018-03-31)\n+\n+\n+### Bug Fixes\n+\n+* hide IE input clear icon ([8138c73](https://github.com/ng-select/ng-select/commit/8138c73)), closes [#401](https://github.com/ng-select/ng-select/issues/401)\n+* keep placeholder visible in material theme ([1e16f98](https://github.com/ng-select/ng-select/commit/1e16f98)), closes [#358](https://github.com/ng-select/ng-select/issues/358)\n+* use correct aria role ([e55b674](https://github.com/ng-select/ng-select/commit/e55b674)), closes [#403](https://github.com/ng-select/ng-select/issues/403)\n+\n+\n+\n<a name=\"0.34.2\"></a>\n## [0.34.2](https://github.com/ng-select/ng-select/compare/v0.34.1...v0.34.2) (2018-03-30)\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.34.2\",\n+ \"version\": \"0.34.3\",\n\"description\": \"Angular ng-select - All in One UI Select, Multiselect and Autocomplete\",\n\"author\": \"@ng-select/ng-select\",\n\"license\": \"MIT\",\n", "new_path": "src/package.json", "old_path": "src/package.json" } ]
TypeScript
MIT License
ng-select/ng-select
chore(release): 0.34.3
1
chore
release