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
21.03.2018 14:25:21
0
0fc103884489108385433a7f838403c8fcdb4494
feat(bitstream): update error handling, add dep
[ { "change_type": "MODIFY", "diff": "\"pub\": \"yarn build && yarn publish --access public\",\n\"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n},\n+ \"dependencies\": {\n+ \"@thi.ng/api\": \"^2.0.4\"\n+ },\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.48\",\n\"@types/node\": \"^9.4.6\",\n", "new_path": "packages/bitstream/package.json", "old_path": "packages/bitstream/package.json" }, { "change_type": "MODIFY", "diff": "+import { illegalState, illegalArgs } from \"@thi.ng/api/error\";\n+\nconst U32 = Math.pow(2, 32);\nexport class BitInputStream {\n@@ -39,7 +41,7 @@ export class BitInputStream {\npublic seek(pos: number): BitInputStream {\nif (pos < this.start || pos >= this.limit) {\n- throw new Error(`seek pos out of bounds: ${pos}`);\n+ illegalArgs(`seek pos out of bounds: ${pos}`);\n}\nthis.pos = pos >>> 3;\nthis.bit = 8 - (pos & 0x7);\n@@ -116,7 +118,7 @@ export class BitInputStream {\nprotected checkLimit(requested: number) {\nif (this.bitPos + requested > this.limit) {\n- throw new Error(`attempt to read past EOF`);\n+ illegalState(`can't read past EOF`);\n}\n}\n}\n", "new_path": "packages/bitstream/src/input.ts", "old_path": "packages/bitstream/src/input.ts" }, { "change_type": "MODIFY", "diff": "+import { illegalArgs } from \"@thi.ng/api/error\";\n+\nimport { BitInputStream } from \"./input\";\nconst DEFAULT_BUF_SIZE = 0x10;\n@@ -28,7 +30,7 @@ export class BitOutputStream {\npublic seek(pos: number): BitOutputStream {\nif (pos < this.start || pos >= this.buffer.length << 3) {\n- throw new Error(`seek pos out of bounds: ${pos}`);\n+ illegalArgs(`seek pos out of bounds: ${pos}`);\n}\nthis.pos = pos >>> 3;\nthis.bit = 8 - (pos & 0x7);\n", "new_path": "packages/bitstream/src/output.ts", "old_path": "packages/bitstream/src/output.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(bitstream): update error handling, add @thi.ng/atom dep
1
feat
bitstream
679,913
21.03.2018 14:27:15
0
5087ffe33564cf902e92725176d8f61b6a295eef
refactor(cso): update error handling
[ { "change_type": "MODIFY", "diff": "import { Predicate } from \"@thi.ng/api/api\";\n+import { illegalArity } from \"@thi.ng/api/error\";\nimport { isFunction } from \"@thi.ng/checks/is-function\";\nimport { DCons } from \"@thi.ng/dcons\";\nimport { Reducer, Transducer } from \"@thi.ng/transducers/api\";\n@@ -99,7 +100,7 @@ export class Channel<T> implements\nclose = args[2];\nbreak;\ndefault:\n- throw new Error(`invalid arity ${args.length}`);\n+ illegalArity(args.length);\n}\nconst chan = new Channel<T>(tx);\nchan.into(args[0], close);\n@@ -300,7 +301,7 @@ export class Channel<T> implements\n[id, buf, tx, err] = args;\nbreak;\ndefault:\n- throw new Error(`invalid arity ${args.length}`);\n+ illegalArity(args.length);\n}\nthis.id = id || `chan-${Channel.NEXT_ID++}`;\nbuf = buf || 1;\n", "new_path": "packages/csp/src/channel.ts", "old_path": "packages/csp/src/channel.ts" }, { "change_type": "MODIFY", "diff": "+import { illegalArity } from \"@thi.ng/api/error\";\nimport { DCons } from \"@thi.ng/dcons\";\nimport { Transducer } from \"@thi.ng/transducers/api\";\n@@ -36,7 +37,7 @@ export class Mult<T> implements\nid = \"mult\" + Mult.nextID++;\nbreak;\ndefault:\n- throw new Error(`illegal arity: ${args.length}`);\n+ illegalArity(args.length);\n}\nif (src instanceof Channel) {\nthis.src = src;\n", "new_path": "packages/csp/src/mult.ts", "old_path": "packages/csp/src/mult.ts" }, { "change_type": "MODIFY", "diff": "import { IObjectOf } from \"@thi.ng/api/api\";\n+import { illegalArity } from \"@thi.ng/api/error\";\nimport { Transducer } from \"@thi.ng/transducers/api\";\nimport { IWriteableChannel, TopicFn } from \"./api\";\n@@ -27,7 +28,7 @@ export class PubSub<T> implements\nthis.fn = args[0];\nbreak;\ndefault:\n- throw new Error(`illegal arity: ${args.length}`);\n+ illegalArity(args.length);\n}\nthis.topics = {};\nthis.process();\n", "new_path": "packages/csp/src/pubsub.ts", "old_path": "packages/csp/src/pubsub.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(cso): update error handling
1
refactor
cso
679,913
21.03.2018 14:27:35
0
a046b285acda33c0943db41c2f28ed1335de4c1b
refactor(dcons): update error handling
[ { "change_type": "MODIFY", "diff": "import * as api from \"@thi.ng/api/api\";\n+import { illegalArgs, illegalState } from \"@thi.ng/api/error\";\nimport { compare } from \"@thi.ng/api/compare\";\nimport { equiv } from \"@thi.ng/api/equiv\";\nimport { isArrayLike } from \"@thi.ng/checks/is-arraylike\";\n@@ -124,7 +125,7 @@ export class DCons<T> implements\npublic insertBefore(cell: ConsCell<T>, value: T): DCons<T> {\nif (!cell) {\n- throw new Error(\"cell is undefined\");\n+ illegalArgs(\"cell is undefined\");\n}\nconst newCell = <ConsCell<T>>{ value, next: cell, prev: cell.prev };\nif (cell.prev) {\n@@ -139,7 +140,7 @@ export class DCons<T> implements\npublic insertAfter(cell: ConsCell<T>, value: T): DCons<T> {\nif (!cell) {\n- throw new Error(\"cell is undefined\");\n+ illegalArgs(\"cell is undefined\");\n}\nconst newCell = <ConsCell<T>>{ value, next: cell.next, prev: cell };\nif (cell.next) {\n@@ -224,7 +225,7 @@ export class DCons<T> implements\nlet a = from < 0 ? from + this._length : from;\nlet b = to < 0 ? to + this._length : to;\nif (a < 0 || b < 0) {\n- throw new Error(\"invalid indices: ${from} / ${to}\")\n+ illegalArgs(\"invalid indices: ${from} / ${to}\")\n}\nconst res = new DCons<T>();\nlet cell = this.nthCell(a);\n@@ -316,7 +317,7 @@ export class DCons<T> implements\n}\nthis._length--;\n} else {\n- throw new Error(\"can't pop, empty\");\n+ illegalState(\"can't pop, empty\");\n}\nreturn this;\n}\n@@ -348,7 +349,7 @@ export class DCons<T> implements\npublic setNth(n: number, v: T) {\nconst cell = this.nthCell(n);\nif (!cell) {\n- throw new Error(`index out of bounds: ${n}`);\n+ illegalArgs(`index out of bounds: ${n}`);\n}\ncell.value = v;\nreturn this;\n", "new_path": "packages/dcons/src/index.ts", "old_path": "packages/dcons/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(dcons): update error handling
1
refactor
dcons
679,913
21.03.2018 14:28:06
0
f5173f1da5e09109192529e329a450df2c3f0c5c
feat(hdom): update error handling, add dep
[ { "change_type": "MODIFY", "diff": "\"webpack\": \"^3.11.0\"\n},\n\"dependencies\": {\n+ \"@thi.ng/api\": \"^2.0.4\",\n\"@thi.ng/diff\": \"^1.0.1\",\n\"@thi.ng/hiccup\": \"^1.2.5\",\n\"@thi.ng/iterators\": \"^4.0.7\"\n", "new_path": "packages/hdom/package.json", "old_path": "packages/hdom/package.json" }, { "change_type": "MODIFY", "diff": "+import { illegalArgs } from \"@thi.ng/api/error\";\nimport { isArray } from \"@thi.ng/checks/is-array\";\nimport { implementsFunction } from \"@thi.ng/checks/implements-function\";\nimport { isFunction } from \"@thi.ng/checks/is-function\";\n@@ -11,7 +12,7 @@ export function normalizeElement(spec: any[], keys: boolean) {\nlet tag = spec[0];\nlet hasAttribs = isPlainObject(spec[1]) && !implementsFunction(spec[1], \"deref\");\nif (!isString(tag) || !(match = TAG_REGEXP.exec(tag))) {\n- throw new Error(`${tag} is not a valid tag name`);\n+ illegalArgs(`${tag} is not a valid tag name`);\n}\n// return orig if already normalized and satifies key requirement\nif (tag === match[1] && hasAttribs && (!keys || spec[1].key)) {\n", "new_path": "packages/hdom/src/normalize.ts", "old_path": "packages/hdom/src/normalize.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(hdom): update error handling, add @thi.ng/api dep
1
feat
hdom
679,913
21.03.2018 14:29:06
0
a3238abf7067404bccf0f6cac93a7551ecf9d749
feat(hiccup): update error handling, add dep
[ { "change_type": "MODIFY", "diff": "\"webpack\": \"^3.11.0\"\n},\n\"dependencies\": {\n+ \"@thi.ng/api\": \"^2.0.4\",\n\"@thi.ng/checks\": \"^1.3.0\"\n},\n\"keywords\": [\n", "new_path": "packages/hiccup/package.json", "old_path": "packages/hiccup/package.json" }, { "change_type": "MODIFY", "diff": "+import { illegalArgs } from \"@thi.ng/api/error\";\nimport { implementsFunction } from \"@thi.ng/checks/implements-function\";\nimport { isPlainObject } from \"@thi.ng/checks/is-plain-object\";\nimport { isFunction } from \"@thi.ng/checks/is-function\";\n@@ -113,7 +114,7 @@ const _serialize = (tree: any, esc: boolean) => {\n}\nif (body) {\nif (VOID_TAGS[tag]) {\n- throw new Error(`No body allowed in tag: ${tag}`);\n+ illegalArgs(`No body allowed in tag: ${tag}`);\n}\nres += \">\";\nfor (let i = 0, n = body.length; i < n; i++) {\n@@ -128,7 +129,7 @@ const _serialize = (tree: any, esc: boolean) => {\nif (iter(tree)) {\nreturn _serializeIter(tree, esc);\n}\n- throw new Error(`invalid tree node: ${tree}`);\n+ illegalArgs(`invalid tree node: ${tree}`);\n}\nif (isFunction(tree)) {\nreturn _serialize(tree(), esc);\n@@ -154,7 +155,7 @@ const normalize = (tag: any[]) => {\nlet el = tag[0], match, id, clazz;\nconst attribs: any = {};\nif (!isString(el) || !(match = TAG_REGEXP.exec(el))) {\n- throw new Error(`\"${el}\" is not a valid tag name`);\n+ illegalArgs(`\"${el}\" is not a valid tag name`);\n}\nel = match[1];\nid = match[2];\n", "new_path": "packages/hiccup/src/serialize.ts", "old_path": "packages/hiccup/src/serialize.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(hiccup): update error handling, add @thi.ng/api dep
1
feat
hiccup
679,913
21.03.2018 14:29:33
0
0cfc2270bd3bf32e75fe60ffd22f9156899400ad
refactor(hiccup-css): update error handling
[ { "change_type": "MODIFY", "diff": "+import { illegalArgs } from \"@thi.ng/api/error\";\nimport { isArray } from \"@thi.ng/checks/is-array\";\nimport { isFunction } from \"@thi.ng/checks/is-function\";\nimport { isIterable } from \"@thi.ng/checks/is-iterable\";\n@@ -42,7 +43,7 @@ export function expand(acc: string[], parent: any[], rules: any[], opts: CSSOpts\n} else if (isFn) {\nprocess(i, r());\n} else {\n- throw new Error(`quoted fn ('${r}') only allowed at head position`);\n+ illegalArgs(`quoted fn ('${r}') only allowed at head position`);\n}\n} else if (isPlainObject(r)) {\ncurr = Object.assign(curr || {}, r);\n", "new_path": "packages/hiccup-css/src/impl.ts", "old_path": "packages/hiccup-css/src/impl.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(hiccup-css): update error handling
1
refactor
hiccup-css
679,913
21.03.2018 14:30:04
0
501d56f810148f6252a53aba67de74094de5b781
feat(interceptors): update error handling, add dep
[ { "change_type": "MODIFY", "diff": "{\n\"name\": \"@thi.ng/interceptors\",\n\"version\": \"1.0.5\",\n- \"description\": \"Interceptor based event, side effect & immutable state handling\",\n+ \"description\": \"Interceptor based event bus, side effect & immutable state handling\",\n\"main\": \"./index.js\",\n\"typings\": \"./index.d.ts\",\n\"repository\": \"https://github.com/thi-ng/umbrella\",\n\"webpack\": \"^3.11.0\"\n},\n\"dependencies\": {\n+ \"@thi.ng/api\": \"^2.0.4\",\n\"@thi.ng/atom\": \"^1.1.0\",\n\"@thi.ng/paths\": \"^1.1.1\"\n},\n", "new_path": "packages/interceptors/package.json", "old_path": "packages/interceptors/package.json" }, { "change_type": "MODIFY", "diff": "import { IObjectOf, IDeref } from \"@thi.ng/api/api\";\n+import { illegalArgs } from \"@thi.ng/api/error\";\nimport { IAtom } from \"@thi.ng/atom/api\";\nimport { Atom } from \"@thi.ng/atom/atom\";\nimport { isArray } from \"@thi.ng/checks/is-array\";\n@@ -207,7 +208,7 @@ export class StatelessEventBus implements\n}\nthis.handlers[id] = iceps;\n} else {\n- throw new Error(`no handlers in spec for ID: ${id}`);\n+ illegalArgs(`no handlers in spec for ID: ${id}`);\n}\n}\n", "new_path": "packages/interceptors/src/event-bus.ts", "old_path": "packages/interceptors/src/event-bus.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(interceptors): update error handling, add @thi.ng/api dep
1
feat
interceptors
679,913
21.03.2018 14:32:39
0
9316a6ca9fb3ed88ba7cb8bac496ef2a1d186f0d
feat(iterators): update error handling, add dep
[ { "change_type": "MODIFY", "diff": "\"webpack\": \"^3.11.0\"\n},\n\"dependencies\": {\n+ \"@thi.ng/api\": \"^2.0.4\",\n\"@thi.ng/dcons\": \"^0.1.14\"\n},\n\"keywords\": [\n", "new_path": "packages/iterators/package.json", "old_path": "packages/iterators/package.json" }, { "change_type": "MODIFY", "diff": "+import { illegalArgs } from \"@thi.ng/api/error\";\n+\nimport { iterator } from \"./iterator\";\nexport function ensureIterable(x: any): IterableIterator<any> {\nif (!(x != null && x[Symbol.iterator])) {\n- throw new Error(`value is not iterable: ${x}`);\n+ illegalArgs(`value is not iterable: ${x}`);\n}\nreturn x;\n}\n", "new_path": "packages/iterators/src/ensure.ts", "old_path": "packages/iterators/src/ensure.ts" }, { "change_type": "MODIFY", "diff": "+import { illegalArity } from \"@thi.ng/api/error\";\n+\nexport function fnil(fn: (...args: any[]) => any, ...ctors: (() => any)[]) {\nlet [cta, ctb, ctc] = ctors;\nswitch (ctors.length) {\n@@ -32,6 +34,6 @@ export function fnil(fn: (...args: any[]) => any, ...ctors: (() => any)[]) {\nreturn fn.apply(null, args);\n};\ndefault:\n- throw new Error(\"unsupported arity\");\n+ illegalArity(ctors.length);\n}\n}\n", "new_path": "packages/iterators/src/fnil.ts", "old_path": "packages/iterators/src/fnil.ts" }, { "change_type": "MODIFY", "diff": "+import { illegalArity } from \"@thi.ng/api/error\";\n+\nimport { cycle } from \"./cycle\";\nimport { map } from \"./map\";\nimport { iterator } from \"./iterator\";\n@@ -5,7 +7,7 @@ import { iterator } from \"./iterator\";\nexport function* interleave(...inputs: Iterable<any>[]) {\nlet n = inputs.length;\nif (n === 0) {\n- throw new Error(`no inputs given`);\n+ illegalArity(0);\n}\nlet iter = cycle(map(iterator, inputs));\nlet chunk = [];\n", "new_path": "packages/iterators/src/interleave.ts", "old_path": "packages/iterators/src/interleave.ts" }, { "change_type": "MODIFY", "diff": "+import { illegalArgs } from \"@thi.ng/api/error\";\n+\nimport { consume } from \"./consume\";\nimport { iterator } from \"./iterator\";\nexport function* partition<T>(n: number, step: number, input: Iterable<T>, all = false) {\nif (n < 1) {\n- throw new Error(`invalid partition size: ${n}`);\n+ illegalArgs(`invalid partition size: ${n}`);\n}\nif (step < 1) {\n- throw new Error(`invalid step size: ${step}`);\n+ illegalArgs(`invalid step size: ${step}`);\n}\nlet iter = iterator(input);\nlet chunk: T[] = [];\n", "new_path": "packages/iterators/src/partition.ts", "old_path": "packages/iterators/src/partition.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(iterators): update error handling, add @thi.ng/api dep
1
feat
iterators
679,913
21.03.2018 14:33:43
0
adc559ae7479e87de8868296a2d957a2448b0561
refactor(router): update error handling
[ { "change_type": "MODIFY", "diff": "import { Event, INotify, IObjectOf, Listener } from \"@thi.ng/api/api\";\n+import { illegalArity, illegalArgs } from \"@thi.ng/api/error\";\nimport { equiv } from \"@thi.ng/api/equiv\";\nimport * as mixin from \"@thi.ng/api/mixins/inotify\";\nimport { isString } from \"@thi.ng/checks/is-string\";\n@@ -100,7 +101,7 @@ export class BasicRouter implements\nmatch = isString(id) ? { id } : id;\nbreak;\ndefault:\n- throw new Error(`illegal arity: ${args.length}`);\n+ illegalArity(args.length);\n}\nconst route = this.routeForID(match.id);\nif (route) {\n@@ -111,7 +112,7 @@ export class BasicRouter implements\n.map((x) => x.charAt(0) === \"?\" ? ((x = params[x.substr(1)]) != null ? x : \"NULL\") : x)\n.join(this.config.separator);\n} else {\n- throw new Error(`invalid route ID: ${match.id}`);\n+ illegalArgs(`invalid route ID: ${match.id}`);\n}\n}\n", "new_path": "packages/router/src/basic.ts", "old_path": "packages/router/src/basic.ts" }, { "change_type": "MODIFY", "diff": "+import { illegalArity } from \"@thi.ng/api/error\";\nimport { equiv } from \"@thi.ng/api/equiv\";\nimport { isString } from \"@thi.ng/checks/is-string\";\n@@ -84,7 +85,7 @@ export class HTMLRouter extends BasicRouter {\nmatch = isString(args[0]) ? { id: args[0] } : args[0];\nbreak;\ndefault:\n- throw new Error(`illegal arity: ${args.length}`);\n+ illegalArity(args.length);\n}\nreturn super.format(match, this.useFragment);\n}\n", "new_path": "packages/router/src/history.ts", "old_path": "packages/router/src/history.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(router): update error handling
1
refactor
router
679,913
21.03.2018 14:34:25
0
1ce7054f8c03719d258c9c7e56c62a2940f2419a
feat(rstream): update error handling, add dep
[ { "change_type": "MODIFY", "diff": "{\n\"name\": \"@thi.ng/rstream\",\n\"version\": \"1.1.0\",\n- \"description\": \"Reactive multi-tap streams & transformation pipeline constructs\",\n+ \"description\": \"Reactive multi-tap streams, dataflow & transformation pipeline constructs\",\n\"main\": \"./index.js\",\n\"typings\": \"./index.d.ts\",\n\"repository\": \"https://github.com/thi-ng/umbrella\",\n\"webpack\": \"^3.11.0\"\n},\n\"dependencies\": {\n+ \"@thi.ng/api\": \"^2.0.4\",\n\"@thi.ng/atom\": \"^1.1.0\",\n\"@thi.ng/transducers\": \"^1.7.0\"\n},\n", "new_path": "packages/rstream/package.json", "old_path": "packages/rstream/package.json" }, { "change_type": "MODIFY", "diff": "+import { illegalArity } from \"@thi.ng/api/error\";\nimport { Transducer } from \"@thi.ng/transducers/api\";\nimport { DEBUG, IStream, ISubscriber, StreamCancel, StreamSource } from \"./api\";\n@@ -33,7 +34,7 @@ export class Stream<T> extends Subscription<T, T>\n[src, id] = args;\nbreak;\ndefault:\n- throw new Error(`illegal arity: ${args.length}`);\n+ illegalArity(args.length);\n}\nsuper(null, null, null, id || `stream-${Stream.NEXT_ID++}`);\nthis.src = src;\n", "new_path": "packages/rstream/src/stream.ts", "old_path": "packages/rstream/src/stream.ts" }, { "change_type": "MODIFY", "diff": "+import { illegalArity, illegalState } from \"@thi.ng/api/error\";\nimport { isFunction } from \"@thi.ng/checks/is-function\";\nimport { implementsFunction } from \"@thi.ng/checks/implements-function\";\nimport { Reducer, Transducer, SEMAPHORE } from \"@thi.ng/transducers/api\";\n@@ -69,7 +70,7 @@ export class Subscription<A, B> implements\n[sub, xform, id] = args;\nbreak;\ndefault:\n- throw new Error(`illegal arity: ${args.length}`);\n+ illegalArity(args.length);\n}\nif (implementsFunction(sub, \"subscribe\")) {\nsub.parent = this;\n@@ -202,7 +203,7 @@ export class Subscription<A, B> implements\nprotected ensureState() {\nif (this.state >= State.DONE) {\n- throw new Error(`operation not allowed in ${State[this.state]} state`);\n+ illegalState(`operation not allowed in ${State[this.state]} state`);\n}\n}\n", "new_path": "packages/rstream/src/subscription.ts", "old_path": "packages/rstream/src/subscription.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(rstream): update error handling, add @thi.ng/api dep
1
feat
rstream
679,913
21.03.2018 14:40:03
0
8a3e72eec49ada3c031ae7cd34f43243344d44a8
feat(rstream-log): update error handling, add dep
[ { "change_type": "MODIFY", "diff": "\"webpack\": \"^3.11.0\"\n},\n\"dependencies\": {\n+ \"@thi.ng/api\": \"^2.0.4\",\n\"@thi.ng/rstream\": \"^1.1.0\"\n},\n\"keywords\": [\n", "new_path": "packages/rstream-log/package.json", "old_path": "packages/rstream-log/package.json" }, { "change_type": "MODIFY", "diff": "+import { illegalArity } from \"@thi.ng/api/error\";\nimport { ISubscribable } from \"@thi.ng/rstream/api\";\nimport { StreamMerge } from \"@thi.ng/rstream/stream-merge\";\nimport { Subscription } from \"@thi.ng/rstream/subscription\";\n@@ -29,7 +30,7 @@ export class Logger extends StreamMerge<LogEntry, LogEntry> implements\nsrc = [...src];\nbreak;\ndefault:\n- throw new Error(`illegal arity: ${args.length}`);\n+ illegalArity(args.length);\n}\nid = id || `logger-${Subscription.NEXT_ID++}`;\nsuper({ src, id, close: false });\n", "new_path": "packages/rstream-log/src/logger.ts", "old_path": "packages/rstream-log/src/logger.ts" }, { "change_type": "MODIFY", "diff": "+import { unsupported } from \"@thi.ng/api/error\";\nimport { isNode } from \"@thi.ng/checks/is-node\";\nimport { ISubscriber } from \"@thi.ng/rstream/api\";\n@@ -14,5 +15,5 @@ export function writeFile(path: string): ISubscriber<string> {\n}\n};\n}\n- throw new Error(\"only available in NodeJS\");\n+ unsupported(\"only available in NodeJS\");\n}\n", "new_path": "packages/rstream-log/src/output/file.ts", "old_path": "packages/rstream-log/src/output/file.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(rstream-log): update error handling, add @thi.ng/api dep
1
feat
rstream-log
679,913
21.03.2018 14:40:30
0
ca099e57515fa37830bd98bac155d6c49e5b732e
refactor(transducers): update error handling
[ { "change_type": "MODIFY", "diff": "+import { illegalArity } from \"@thi.ng/api/error\";\nimport { Transducer } from \"../api\";\nexport function comp<A, B>(a: Transducer<A, B>): Transducer<A, B>;\n@@ -15,7 +16,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- throw new Error(\"no fn args given\");\n+ illegalArity(0);\ncase 1:\nreturn a;\ncase 2:\n", "new_path": "packages/transducers/src/func/comp.ts", "old_path": "packages/transducers/src/func/comp.ts" }, { "change_type": "MODIFY", "diff": "+import { illegalArgs } from \"@thi.ng/api/error\";\n+\nexport function ensureIterable(x: any): IterableIterator<any> {\nif (!(x != null && x[Symbol.iterator])) {\n- throw new Error(`value is not iterable: ${x}`);\n+ illegalArgs(`value is not iterable: ${x}`);\n}\nreturn x;\n}\n", "new_path": "packages/transducers/src/func/ensure-iterable.ts", "old_path": "packages/transducers/src/func/ensure-iterable.ts" }, { "change_type": "MODIFY", "diff": "-import { range } from \"./range\";\n+import { illegalArgs } from \"@thi.ng/api/error\";\nimport { isArray } from \"@thi.ng/checks/is-array\";\nimport { isString } from \"@thi.ng/checks/is-string\";\n+import { range } from \"./range\";\n+\n/**\n* Iterator yielding the Cartesian Product of the given iterables.\n* All iterables MUST be finite! If any of the given iterables is\n@@ -68,7 +70,7 @@ export function* permutations(...src: Iterable<any>[]): IterableIterator<any[]>\n*/\nexport function permutationsN(n: number, m = n, offsets?: number[]): IterableIterator<number[]> {\nif (offsets && offsets.length < n) {\n- throw new Error(\"not sufficient offsets given\");\n+ illegalArgs(`insufficient offsets, got ${offsets.length}, but needed ${n}`);\n}\nconst seqs = [];\nwhile (--n >= 0) {\n", "new_path": "packages/transducers/src/iter/permutations.ts", "old_path": "packages/transducers/src/iter/permutations.ts" }, { "change_type": "MODIFY", "diff": "+import { illegalArity } from \"@thi.ng/api/error\";\nimport { range } from \"./range\";\nexport function range2d(toX: number, toY: number): IterableIterator<[number, number]>;\n@@ -17,7 +18,7 @@ export function* range2d(...args: number[]) {\nfromX = fromY = 0;\nbreak;\ndefault:\n- throw new Error(`invalid arity: ${args.length}`);\n+ illegalArity(args.length);\n}\nfor (let y of range(fromY, toY, stepY)) {\nfor (let x of range(fromX, toX, stepX)) {\n", "new_path": "packages/transducers/src/iter/range2d.ts", "old_path": "packages/transducers/src/iter/range2d.ts" }, { "change_type": "MODIFY", "diff": "+import { illegalArity } from \"@thi.ng/api/error\";\nimport { range } from \"./range\";\nexport function range3d(toX: number, toY: number, toZ: number): IterableIterator<[number, number, number]>;\n@@ -18,7 +19,7 @@ export function* range3d(...args: number[]) {\nfromX = fromY = fromZ = 0;\nbreak;\ndefault:\n- throw new Error(`invalid arity: ${args.length}`);\n+ illegalArity(args.length);\n}\nfor (let z of range(fromZ, toZ, stepZ)) {\nfor (let y of range(fromY, toY, stepY)) {\n", "new_path": "packages/transducers/src/iter/range3d.ts", "old_path": "packages/transducers/src/iter/range3d.ts" }, { "change_type": "MODIFY", "diff": "+import { illegalArity } from \"@thi.ng/api/error\";\n+\nimport { Reducer } from \"./api\";\nimport { isReduced, unreduced } from \"./reduced\";\n@@ -14,7 +16,7 @@ export function reduce<A, B>(...args: any[]): A {\nxs = args[1];\nbreak;\ndefault:\n- throw new Error(`illegal arity ${args.length}`);\n+ illegalArity(args.length);\n}\nconst [init, complete, reduce] = args[0];\nacc = acc == null ? init() : acc;\n", "new_path": "packages/transducers/src/reduce.ts", "old_path": "packages/transducers/src/reduce.ts" }, { "change_type": "MODIFY", "diff": "+import { illegalArity } from \"@thi.ng/api/error\";\n+\nimport { Reducer, Transducer } from \"./api\";\nimport { reduce } from \"./reduce\";\nimport { map } from \"./xform/map\";\n@@ -18,7 +20,7 @@ export function transduce(...args: any[]): any {\ncase 2:\nreturn map((x: Iterable<any>) => transduce(args[0], args[1], x));\ndefault:\n- throw new Error(`illegal arity ${args.length}`);\n+ illegalArity(args.length);\n}\nconst _rfn: Reducer<any, any> = args[0](args[1]);\nreturn reduce(_rfn, acc, xs);\n", "new_path": "packages/transducers/src/transduce.ts", "old_path": "packages/transducers/src/transduce.ts" }, { "change_type": "MODIFY", "diff": "+import { illegalArity } from \"@thi.ng/api/error\";\n+\nimport { ConvolutionKernel2D, Transducer } from \"../api\";\nimport { transduce } from \"../transduce\";\nimport { range2d } from \"../iter/range2d\";\n@@ -41,7 +43,7 @@ export function convolve2d(src: number[], width: number, height: number, ...args\nkernel = buildKernel2d.apply(null, args);\nbreak;\ndefault:\n- throw new Error(`illegal arity: ${args.length + 3}`);\n+ illegalArity(args.length + 3);\n}\nreturn map(\n([x, y]) =>\n", "new_path": "packages/transducers/src/xform/convolve.ts", "old_path": "packages/transducers/src/xform/convolve.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(transducers): update error handling
1
refactor
transducers
217,922
21.03.2018 14:52:15
-3,600
ac6cfce6971146fec007f4bb51dd1bb661577ab0
style: change the way container handles the page for better scrolling management
[ { "change_type": "MODIFY", "diff": "min-height: 100%;\ndisplay: inline;\nmat-toolbar {\n+ position: fixed;\n+ top: 0;\ndisplay: flex;\nmin-height: 64px;\nmat-menu {\n}\n}\nmat-sidenav-container {\n- height: calc(100% - 64px);\n+ height: calc(100vh - 64px);\n.mat-sidenav {\nwidth: 10%;\nmin-width: 250px;\n", "new_path": "src/app/app.component.scss", "old_path": "src/app/app.component.scss" }, { "change_type": "MODIFY", "diff": "@import './theme.scss';\n-html, body {\n- width: 100%;\n- height: 100%;\n-}\n-\nbody {\n+ padding-top: 64px;\nbackground: map-get(map-get($dark-theme, background), background);\nmargin: 0;\nfont-family: Roboto, \"Helvetica Neue\", sans-serif;\n", "new_path": "src/styles.scss", "old_path": "src/styles.scss" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
style: change the way container handles the page for better scrolling management
1
style
null
217,922
21.03.2018 15:17:52
-3,600
0d5b4a64171fb1c8d4f0ed8f012939b48741a7ff
fix: comments not working in zone breakdown closes
[ { "change_type": "MODIFY", "diff": "@@ -43,7 +43,4 @@ export class ListRow extends DataModel {\ncomments?: ResourceComment[];\nhidden?: boolean;\n-\n- // Property used and set by zoneBreakdown\n- coords?: Vector2;\n}\n", "new_path": "src/app/model/list/list-row.ts", "old_path": "src/app/model/list/list-row.ts" }, { "change_type": "MODIFY", "diff": "@@ -9,13 +9,7 @@ export class ZoneBreakdown {\nrows.forEach(row => {\nif (row.gatheredBy !== undefined && row.gatheredBy.nodes !== undefined && row.gatheredBy.nodes.length !== 0) {\nrow.gatheredBy.nodes.forEach(node => {\n- if (node.coords !== undefined) {\n- const rowClone = JSON.parse(JSON.stringify(row));\n- rowClone.coords = {x: node.coords[0], y: node.coords[1]};\n- this.addToBreakdown(node.zoneid, rowClone);\n- } else {\nthis.addToBreakdown(node.zoneid, row);\n- }\n});\n} else if (row.drops !== undefined && row.drops.length > 0) {\nrow.drops.forEach(drop => {\n", "new_path": "src/app/model/list/zone-breakdown.ts", "old_path": "src/app/model/list/zone-breakdown.ts" }, { "change_type": "MODIFY", "diff": "@@ -10,6 +10,7 @@ import {AppUser} from '../../../model/list/app-user';\nimport {MatDialog} from '@angular/material';\nimport {NavigationMapPopupComponent} from '../navigation-map-popup/navigation-map-popup.component';\nimport {NavigationObjective} from '../../../modules/map/navigation-objective';\n+import {Vector2} from '../../../core/tools/vector2';\n@Component({\nselector: 'app-list-details-panel',\n@@ -152,23 +153,33 @@ export class ListDetailsPanelComponent implements OnChanges, OnInit {\nmapId: zoneBreakdownRow.zoneId,\npoints: this.uniquify(zoneBreakdownRow.items)\n.map(item => {\n- if (item.coords === undefined) {\n- return undefined;\n+ const coords = this.getCoords(item, zoneBreakdownRow);\n+ if (coords !== undefined) {\n+ return {x: coords.x, y: coords.y, name: this.l12n.getItem(item.id), iconid: item.icon}\n}\n- return {x: item.coords.x, y: item.coords.y, name: this.l12n.getItem(item.id), iconid: item.icon}\n+ return undefined;\n})\n.filter(row => row !== undefined)\n};\nthis.dialog.open(NavigationMapPopupComponent, {data: data});\n}\n+ public getCoords(item: ListRow, zoneBreakdownRow: ZoneBreakdownRow): Vector2 {\n+ if (item.gatheredBy !== undefined) {\n+ const node = item.gatheredBy.nodes.find(n => n.zoneid === zoneBreakdownRow.zoneId);\n+ return {x: node.coords[0], y: node.coords[1]};\n+ }\n+ return undefined;\n+ }\n+\npublic hasNavigationMap(zoneBreakdownRow: ZoneBreakdownRow): boolean {\nreturn this.uniquify(zoneBreakdownRow.items)\n.map(item => {\n- if (item.coords === undefined) {\n+ const coords = this.getCoords(item, zoneBreakdownRow);\n+ if (coords === undefined) {\nreturn undefined;\n}\n- return {x: item.coords.x, y: item.coords.y, name: this.l12n.getItem(item.id), iconid: item.icon}\n+ return {x: coords.x, y: coords.y, name: this.l12n.getItem(item.id), iconid: item.icon}\n})\n.filter(row => row !== undefined).length >= 2;\n}\n", "new_path": "src/app/pages/list/list-details-panel/list-details-panel.component.ts", "old_path": "src/app/pages/list/list-details-panel/list-details-panel.component.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix: comments not working in zone breakdown closes #281
1
fix
null
217,922
21.03.2018 15:43:41
-3,600
00d593902fd838482459ef6f2d26966e90a66283
fix: comments amount not updated when commenting an item
[ { "change_type": "MODIFY", "diff": "-import {ChangeDetectionStrategy, Component, Input, OnInit} from '@angular/core';\n+import {ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges} from '@angular/core';\nimport {MatDialog} from '@angular/material';\nimport {CommentsPopupComponent} from '../comments-popup/comments-popup.component';\nimport {ListRow} from '../../../model/list/list-row';\n@@ -12,7 +12,7 @@ import {SettingsService} from '../../../pages/settings/settings.service';\nstyleUrls: ['./comments-button.component.scss'],\nchangeDetection: ChangeDetectionStrategy.OnPush\n})\n-export class CommentsButtonComponent implements OnInit {\n+export class CommentsButtonComponent implements OnInit, OnChanges {\n@Input()\nrow: ListRow;\n@@ -29,23 +29,37 @@ export class CommentsButtonComponent implements OnInit {\n@Input()\ncolor = 'accent';\n+ @Output()\n+ updated: EventEmitter<void> = new EventEmitter<void>();\n+\namount: number;\nconstructor(private dialog: MatDialog, private media: ObservableMedia, public settings: SettingsService) {\n}\nopenPopup(): void {\n- this.dialog.open(CommentsPopupComponent, {data: {name: this.name, row: this.row, list: this.list, isOwnList: this.isOwnList}});\n+ this.dialog\n+ .open(CommentsPopupComponent, {data: {name: this.name, row: this.row, list: this.list, isOwnList: this.isOwnList}})\n+ .afterClosed()\n+ .first()\n+ .subscribe(() => this.updated.emit());\n}\nngOnInit(): void {\n+ this.processAmount();\n+ }\n+\n+ ngOnChanges(changes: SimpleChanges): void {\n+ this.processAmount();\n+ }\n+\n+ private processAmount(): void {\n// If we don't have a row defined, that's because it's a list comments button.\nif (this.row !== undefined) {\nthis.amount = this.row.comments === undefined ? 0 : this.row.comments.length;\n} else {\nthis.amount = this.list.comments === undefined ? 0 : this.list.comments.length;\n}\n-\n}\nisMobile(): boolean {\n", "new_path": "src/app/modules/comments/comments-button/comments-button.component.ts", "old_path": "src/app/modules/comments/comments-button/comments-button.component.ts" }, { "change_type": "MODIFY", "diff": "[ngClass]=\"{'strike': item.done >= item.amount, 'compact': settings.compactLists, 'craftable': canBeCrafted}\">{{item.id | itemName | i18n}}</span>\n</div>\n<app-comments-button [name]=\"item.id | itemName | i18n\" [row]=\"item\" [list]=\"list\"\n- [isOwnList]=\"user?.$key === list?.authorId\"></app-comments-button>\n+ [isOwnList]=\"user?.$key === list?.authorId\" (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": "@@ -197,10 +197,10 @@ export class ListDetailsPanelComponent implements OnChanges, OnInit {\n}\nngOnChanges(changes: SimpleChanges): void {\n- if (this.showTier && changes.list !== undefined && changes.list.previousValue !== changes.list.currentValue) {\n+ if (this.showTier) {\nthis.generateTiers();\n}\n- if (this.zoneBreakdown && changes.list !== undefined && changes.list.previousValue !== changes.list.currentValue) {\n+ if (this.zoneBreakdown) {\nthis.zoneBreakdownData = new ZoneBreakdown(this.data);\n}\n}\n", "new_path": "src/app/pages/list/list-details-panel/list-details-panel.component.ts", "old_path": "src/app/pages/list/list-details-panel/list-details-panel.component.ts" }, { "change_type": "MODIFY", "diff": "@@ -237,8 +237,9 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\n}\nupdate(list: List): void {\n+ console.log('update', list);\nthis.listService.update(this.listData.$key, list).first().subscribe(() => {\n- // Ignored.\n+ this.reload.emit();\n});\n}\n", "new_path": "src/app/pages/list/list-details/list-details.component.ts", "old_path": "src/app/pages/list/list-details/list-details.component.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix: comments amount not updated when commenting an item
1
fix
null
217,922
21.03.2018 16:43:20
-3,600
f697d96a3ffedc34ebc1571ffc3430d36c4079ed
feat: new announcement box closes TODO: DE translations
[ { "change_type": "MODIFY", "diff": "</button>\n<span class=\"version\">{{version}}</span>\n</mat-toolbar>\n- <mat-card class=\"announcement\" *ngIf=\"showAnnouncement()\">\n- <mat-grid-list cols=\"5\" rowHeight=\"35px\">\n- <mat-grid-tile colspan=\"4\">\n- <p [innerHTML]=\"announcement\"></p>\n- </mat-grid-tile>\n- <mat-grid-tile>\n- <button mat-icon-button color=\"accent\" (click)=\"dismissAnnouncement()\">\n- <mat-icon>clear</mat-icon>\n- </button>\n- </mat-grid-tile>\n- </mat-grid-list>\n- </mat-card>\n<mat-sidenav-container>\n<mat-sidenav mode=\"{{mobile ? 'over':'side' }}\" opened=\"{{!mobile}}\" #sidenav [disableClose]=\"!mobile\">\n<div class=\"accent-background\">\n", "new_path": "src/app/app.component.html", "old_path": "src/app/app.component.html" }, { "change_type": "MODIFY", "diff": "@@ -23,6 +23,8 @@ import {faDiscord, faFacebookF, faGithub} from '@fortawesome/fontawesome-free-br\nimport {faBell, faCalculator, faMap} from '@fortawesome/fontawesome-free-solid';\nimport {PushNotificationsService} from 'ng-push';\nimport {OverlayContainer} from '@angular/cdk/overlay';\n+import {AnnouncementPopupComponent} from './modules/common-components/announcement-popup/announcement-popup.component';\n+import {Announcement} from './modules/common-components/announcement-popup/announcement';\ndeclare const ga: Function;\n@@ -124,12 +126,15 @@ export class AppComponent implements OnInit {\n// Annoucement\ndata.object('/announcement')\n.valueChanges()\n- .subscribe((announcement: string) => {\n- if (announcement !== localStorage.getItem('announcement:last')) {\n- localStorage.setItem('announcement:last', announcement);\n- localStorage.setItem('announcement:hide', 'false');\n+ .subscribe((announcement: Announcement) => {\n+ if (JSON.stringify(announcement) !== localStorage.getItem('announcement:last')) {\n+ this.dialog.open(AnnouncementPopupComponent, {data: announcement})\n+ .afterClosed()\n+ .first()\n+ .subscribe(() => {\n+ localStorage.setItem('announcement:last', JSON.stringify(announcement));\n+ });\n}\n- this.announcement = announcement;\n});\n}\n@@ -228,21 +233,6 @@ export class AppComponent implements OnInit {\n});\n}\n- /**\n- * Returns a boolean which is linked to announcement display.\n- * @returns {boolean}\n- */\n- showAnnouncement(): boolean {\n- return this.announcement !== undefined && localStorage.getItem('announcement:hide') !== 'true';\n- }\n-\n- /**\n- * Persists the dismissed announcement into localstorage.\n- */\n- dismissAnnouncement(): void {\n- localStorage.setItem('announcement:hide', 'true');\n- }\n-\nopenRegistrationPopup(): void {\nthis.isRegistering = true;\nthis.dialog.open(RegisterPopupComponent).afterClosed().subscribe(() => this.isRegistering = false);\n", "new_path": "src/app/app.component.ts", "old_path": "src/app/app.component.ts" }, { "change_type": "ADD", "diff": "+<h3 mat-dialog-title>{{'ANNOUNCEMENT.Title' | translate}}</h3>\n+<div mat-dialog-content>\n+ <p>{{data.text}}</p>\n+ <a mat-raised-button color=\"accent\" [href]=\"data.link\" target=\"_blank\"\n+ *ngIf=\"data.link !== undefined && data.link.length > 0\">\n+ {{\"ANNOUNCEMENT.Read_more\" | translate}}\n+ </a>\n+</div>\n+<div mat-dialog-actions>\n+ <button mat-button mat-dialog-close>{{\"Close\" | translate}}</button>\n+</div>\n+\n", "new_path": "src/app/modules/common-components/announcement-popup/announcement-popup.component.html", "old_path": null }, { "change_type": "ADD", "diff": "", "new_path": "src/app/modules/common-components/announcement-popup/announcement-popup.component.scss", "old_path": "src/app/modules/common-components/announcement-popup/announcement-popup.component.scss" }, { "change_type": "ADD", "diff": "+import {Component, Inject} from '@angular/core';\n+import {MAT_DIALOG_DATA} from '@angular/material';\n+import {Announcement} from './announcement';\n+\n+@Component({\n+ selector: 'app-announcement-popup',\n+ templateUrl: './announcement-popup.component.html',\n+ styleUrls: ['./announcement-popup.component.scss']\n+})\n+export class AnnouncementPopupComponent {\n+\n+ constructor(@Inject(MAT_DIALOG_DATA) public data: Announcement) {\n+ }\n+}\n", "new_path": "src/app/modules/common-components/announcement-popup/announcement-popup.component.ts", "old_path": null }, { "change_type": "ADD", "diff": "+export interface Announcement {\n+ text: string;\n+ link?: string;\n+}\n", "new_path": "src/app/modules/common-components/announcement-popup/announcement.ts", "old_path": null }, { "change_type": "MODIFY", "diff": "@@ -33,6 +33,7 @@ import {RegisterPopupComponent} from './register-popup/register-popup.component'\nimport {FlexLayoutModule} from '@angular/flex-layout';\nimport {CommentsModule} from '../comments/comments.module';\nimport { FfxivcraftingAmountInputComponent } from './ffxivcrafting-amount-input/ffxivcrafting-amount-input.component';\n+import { AnnouncementPopupComponent } from './announcement-popup/announcement-popup.component';\n@NgModule({\nimports: [\n@@ -77,6 +78,7 @@ import { FfxivcraftingAmountInputComponent } from './ffxivcrafting-amount-input/\nListNamePopupComponent,\nRegisterPopupComponent,\nFfxivcraftingAmountInputComponent,\n+ AnnouncementPopupComponent,\n],\nexports: [\nRandomGifComponent,\n@@ -101,6 +103,7 @@ import { FfxivcraftingAmountInputComponent } from './ffxivcrafting-amount-input/\nNameEditPopupComponent,\nListNamePopupComponent,\nRegisterPopupComponent,\n+ AnnouncementPopupComponent,\n]\n})\nexport class CommonComponentsModule {\n", "new_path": "src/app/modules/common-components/common-components.module.ts", "old_path": "src/app/modules/common-components/common-components.module.ts" }, { "change_type": "MODIFY", "diff": "\"Title\": \"Gathering items\",\n\"No_items\": \"No gathering node found\",\n\"Gathering_name\": \"Enter item name\"\n+ },\n+ \"ANNOUNCEMENT\":{\n+ \"Title\": \"Announcement\",\n+ \"Read_more\": \"Read more\"\n}\n}\n", "new_path": "src/assets/i18n/en.json", "old_path": "src/assets/i18n/en.json" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
feat: new announcement box closes #256 TODO: DE translations
1
feat
null
217,922
21.03.2018 16:56:56
-3,600
c6480aa019af3067539f36e8c3476a71e9563265
fix: items filtered and shown on wrong panel closes
[ { "change_type": "MODIFY", "diff": "@@ -48,7 +48,7 @@ export class LayoutService {\nif (a.filter.name === 'ANYTHING') {\nreturn 10000;\n}\n- return a.order - b.order;\n+ return a.index - b.index;\n});\n}\n", "new_path": "src/app/core/layout/layout.service.ts", "old_path": "src/app/core/layout/layout.service.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix: items filtered and shown on wrong panel closes #270
1
fix
null
821,218
21.03.2018 17:09:47
0
07fe19a1753632b7ec0aa1ca044d128e3ce195bb
docs: Minor example code correction Makes example invocation match code beneath
[ { "change_type": "MODIFY", "diff": "@@ -205,7 +205,7 @@ static args = [\nFlag options are non-positional arguments passed to the command. For example, if this command was run like this:\n```\n-$ mycli --force --output=./myfile\n+$ mycli --force --file=./myfile\n```\n_= is optional_\n", "new_path": "README.md", "old_path": "README.md" } ]
TypeScript
MIT License
oclif/oclif
docs: Minor example code correction (#64) Makes example invocation match code beneath
1
docs
null
807,849
21.03.2018 17:28:38
25,200
5df0fc87c17fb1b092a70c5a6c83f1b7aacc3737
fix(add): Support tag and version specifiers Fixes
[ { "change_type": "MODIFY", "diff": "@@ -51,12 +51,12 @@ describe(\"AddCommand\", () => {\nit(\"should reference remote dependencies\", async () => {\nconst testDir = await initFixture(\"basic\");\n- await lernaAdd(testDir)(\"lerna\");\n+ await lernaAdd(testDir)(\"tiny-tarball\");\n- expect(await readPkg(testDir, \"packages/package-1\")).toDependOn(\"lerna\");\n- expect(await readPkg(testDir, \"packages/package-2\")).toDependOn(\"lerna\");\n- expect(await readPkg(testDir, \"packages/package-3\")).toDependOn(\"lerna\");\n- expect(await readPkg(testDir, \"packages/package-4\")).toDependOn(\"lerna\");\n+ expect(await readPkg(testDir, \"packages/package-1\")).toDependOn(\"tiny-tarball\");\n+ expect(await readPkg(testDir, \"packages/package-2\")).toDependOn(\"tiny-tarball\");\n+ expect(await readPkg(testDir, \"packages/package-3\")).toDependOn(\"tiny-tarball\");\n+ expect(await readPkg(testDir, \"packages/package-4\")).toDependOn(\"tiny-tarball\");\n});\nit(\"should reference local dependencies\", async () => {\n@@ -143,6 +143,23 @@ describe(\"AddCommand\", () => {\nexpect(await readPkg(testDir, \"packages/package-2\")).toDevDependOn(\"file-url\");\n});\n+ it(\"supports tag specifiers\", async () => {\n+ const testDir = await initFixture(\"basic\");\n+\n+ // npm dist-tags for outdated versions _should_ stay stable\n+ await lernaAdd(testDir)(\"npm@next-3\");\n+\n+ expect(await readPkg(testDir, \"packages/package-1\")).toDependOn(\"npm\", \"^3.10.10\");\n+ });\n+\n+ it(\"supports version specifiers (exact)\", async () => {\n+ const testDir = await initFixture(\"basic\");\n+\n+ await lernaAdd(testDir)(\"tiny-tarball@1.0.0\");\n+\n+ expect(await readPkg(testDir, \"packages/package-1\")).toDependOn(\"tiny-tarball\", \"1.0.0\");\n+ });\n+\nit(\"should bootstrap changed packages\", async () => {\nconst testDir = await initFixture(\"basic\");\n", "new_path": "commands/add/__tests__/add-command.test.js", "old_path": "commands/add/__tests__/add-command.test.js" }, { "change_type": "MODIFY", "diff": "\"use strict\";\n-const path = require(\"path\");\n+const dedent = require(\"dedent\");\nconst npa = require(\"npm-package-arg\");\nconst packageJson = require(\"package-json\");\n-const readPkg = require(\"read-pkg\");\n+const pMap = require(\"p-map\");\nconst semver = require(\"semver\");\nconst writePkg = require(\"write-pkg\");\n@@ -11,7 +11,6 @@ const BootstrapCommand = require(\"@lerna/bootstrap/command\");\nconst Command = require(\"@lerna/command\");\nconst ValidationError = require(\"@lerna/validation-error\");\nconst getRangeToReference = require(\"./lib/get-range-to-reference\");\n-const notSatisfiedMessage = require(\"./lib/not-satisfied-message\");\nclass AddCommand extends Command {\nget requiresGit() {\n@@ -20,34 +19,36 @@ class AddCommand extends Command {\ninitialize() {\nthis.dependencyType = this.options.dev ? \"devDependencies\" : \"dependencies\";\n- this.targetPackages = this.options.pkgNames.map(input => {\n- const { name, fetchSpec: versionRange } = npa(input);\n+ this.specs = this.options.pkgNames.map(input => npa(input));\n- return { name, versionRange };\n- });\n-\n- if (this.targetPackages.length === 0) {\n+ if (this.specs.length === 0) {\nthrow new ValidationError(\"EINPUT\", \"Missing list of packages to add to your project.\");\n}\n- const unsatisfied = this.targetPackages\n- .filter(pkg => this.packageGraph.has(pkg.name))\n- .filter(a => !this.packageSatisfied(a.name, a.versionRange))\n- .map(u => ({\n- name: u.name,\n- versionRange: u.versionRange,\n- version: this.packageGraph.get(u.name).version,\n+ const unsatisfied = this.specs\n+ .filter(spec => this.packageGraph.has(spec.name))\n+ .filter(spec => !this.packageSatisfied(spec))\n+ .map(({ name, fetchSpec }) => ({\n+ name,\n+ fetchSpec,\n+ version: this.packageGraph.get(name).version,\n}));\nif (unsatisfied.length > 0) {\n- throw new ValidationError(\"ENOTSATISFIED\", notSatisfiedMessage(unsatisfied));\n+ throw new ValidationError(\n+ \"ENOTSATISFIED\",\n+ dedent`\n+ Requested range not satisfiable:\n+ ${unsatisfied.map(u => `${u.name}@${u.versionRange} (available: ${u.version})`).join(\", \")}\n+ `\n+ );\n}\nlet chain = Promise.resolve();\n- chain = chain.then(() => this.collectPackagesToInstall());\n- chain = chain.then(packagesToInstall => {\n- this.packagesToInstall = packagesToInstall;\n+ chain = chain.then(() => this.collectInstallSpecs());\n+ chain = chain.then(installSpecs => {\n+ this.installSpecs = installSpecs;\n});\nchain = chain.then(() => this.collectPackagesToChange());\n@@ -59,9 +60,11 @@ class AddCommand extends Command {\nconst proceed = this.packagesToChange.length > 0;\nif (!proceed) {\n- const packagesToInstallList = this.packagesToInstall.map(pkg => pkg.name).join(\", \");\n-\n- this.logger.warn(`No packages found in scope where ${packagesToInstallList} can be added.`);\n+ this.logger.warn(\n+ `No packages found in scope where ${this.installSpecs\n+ .map(spec => spec.name)\n+ .join(\", \")} can be added.`\n+ );\n}\nreturn proceed;\n@@ -72,57 +75,43 @@ class AddCommand extends Command {\nthis.logger.info(`Add ${this.dependencyType} in ${this.packagesToChange.length} packages`);\nreturn this.makeChanges().then(pkgs => {\n- const changedPkgs = pkgs.filter(p => p.changed);\n-\n- this.logger.info(`Changes require bootstrap in ${changedPkgs.length} packages`);\n+ this.logger.info(`Changes require bootstrap in ${pkgs.length} packages`);\n- const options = Object.assign({}, this.options, {\n+ return BootstrapCommand.handler(\n+ Object.assign({}, this.options, {\nargs: [],\ncwd: this.repository.rootPath,\n- scope: changedPkgs.map(p => p.name),\n- });\n-\n- return BootstrapCommand.handler(options);\n+ scope: pkgs,\n+ })\n+ );\n});\n}\n- collectPackagesToInstall() {\n- const mapper = ({ name, versionRange }) =>\n- this.getPackageVersion(name, versionRange).then(version => ({ name, version, versionRange }));\n-\n- return Promise.all(this.targetPackages.map(mapper));\n+ collectInstallSpecs() {\n+ return pMap(\n+ this.specs,\n+ spec => this.getPackageVersion(spec).then(version => Object.assign(spec, { version })),\n+ { concurrency: this.concurrency }\n+ );\n}\ncollectPackagesToChange() {\nlet result = this.filteredPackages;\n// Skip packages that only would install themselves\n- result = result.filter(filteredPackage => {\n- const addable = this.packagesToInstall.some(pkgToInstall => pkgToInstall.name !== filteredPackage.name);\n-\n- if (!addable) {\n- this.logger.warn(`Will not add ${filteredPackage.name} to itself.`);\n- }\n-\n- return addable;\n- });\n+ result = result.filter(pkg => this.installSpecs.some(spec => spec.name !== pkg.name));\n// Skip packages without actual changes to manifest\n- result = result.filter(filteredPackage => {\n- const deps = filteredPackage[this.dependencyType] || {};\n-\n- // Check if one of the packages to install necessiates a change to filteredPackage's manifest\n- return this.packagesToInstall\n- .filter(pkgToInstall => pkgToInstall.name !== filteredPackage.name)\n- .some(pkgToInstall => {\n- if (!(pkgToInstall.name in deps)) {\n+ result = result.filter(pkg => {\n+ const deps = this.getPackageDeps(pkg);\n+\n+ // Check if one of the packages to install necessitates a change to pkg's manifest\n+ return this.installSpecs.filter(spec => spec.name !== pkg.name).some(spec => {\n+ if (!(spec.name in deps)) {\nreturn true;\n}\n- const current = deps[pkgToInstall.name];\n- const range = getRangeToReference(current, pkgToInstall.version, pkgToInstall.versionRange);\n-\n- return range !== current;\n+ return getRangeToReference(spec, deps) !== deps[spec.name];\n});\n});\n@@ -130,68 +119,52 @@ class AddCommand extends Command {\n}\nmakeChanges() {\n- const mapper = pkgToChange => {\n- const manifestPath = path.join(pkgToChange.location, \"package.json\");\n-\n- const applicable = this.packagesToInstall\n- .filter(pkgToInstall => pkgToChange.name !== pkgToInstall.name)\n- .reduce((obj, pkgToInstall) => {\n- const deps = pkgToChange[this.dependencyType] || {};\n- const current = deps[pkgToInstall.name];\n- const range = getRangeToReference(current, pkgToInstall.version, pkgToInstall.versionRange);\n-\n- this.logger.verbose(\n- `Add ${pkgToInstall.name}@${range} as ${this.dependencyType} in ${pkgToChange.name}`\n- );\n+ const mapper = pkg => {\n+ const deps = this.getPackageDeps(pkg);\n- obj[pkgToInstall.name] = range;\n+ for (const spec of this.installSpecs) {\n+ if (spec.name !== pkg.name) {\n+ const range = getRangeToReference(spec, deps);\n- return obj;\n- }, {});\n+ this.logger.verbose(`Add ${spec.name}@${range} as ${this.dependencyType} in ${pkg.name}`);\n+ deps[spec.name] = range;\n+ }\n+ }\n- return readPkg(manifestPath, { normalize: false })\n- .then(a => {\n- const previous = a[this.dependencyType] || {};\n- const payload = Object.assign({}, previous, applicable);\n- const ammendment = { [this.dependencyType]: payload };\n+ return writePkg(pkg.manifestLocation, pkg.toJSON()).then(() => pkg.name);\n+ };\n- const b = Object.assign({}, a, ammendment);\n- return { a, b };\n- })\n- .then(({ a, b }) => {\n- const changed = JSON.stringify(a) !== JSON.stringify(b);\n- const exec = changed ? () => writePkg(manifestPath, b) : () => Promise.resolve();\n+ return pMap(this.packagesToChange, mapper);\n+ }\n- return exec().then(() => ({\n- name: pkgToChange.name,\n- changed,\n- }));\n- });\n- };\n+ getPackageDeps(pkg) {\n+ if (!pkg.json[this.dependencyType]) {\n+ pkg.json[this.dependencyType] = {};\n+ }\n- return Promise.all(this.packagesToChange.map(mapper));\n+ return pkg.json[this.dependencyType];\n}\n- getPackageVersion(name, versionRange) {\n- if (this.packageSatisfied(name, versionRange)) {\n- return Promise.resolve(this.packageGraph.get(name).version);\n+ getPackageVersion(spec) {\n+ if (this.packageSatisfied(spec)) {\n+ return Promise.resolve(this.packageGraph.get(spec.name).version);\n}\n- return packageJson(name, { version: versionRange }).then(pkg => pkg.version);\n+ return packageJson(spec.name, { version: spec.fetchSpec }).then(pkg => pkg.version);\n}\n- packageSatisfied(name, versionRange) {\n- const pkg = this.packageGraph.get(name);\n+ packageSatisfied(spec) {\n+ const pkg = this.packageGraph.get(spec.name);\nif (!pkg) {\nreturn false;\n}\n- if (versionRange === \"latest\") {\n+ if (spec.fetchSpec === \"latest\") {\nreturn true;\n}\n- return semver.intersects(pkg.version, versionRange);\n+ return semver.intersects(pkg.version, spec.fetchSpec);\n}\n}\n", "new_path": "commands/add/index.js", "old_path": "commands/add/index.js" }, { "change_type": "MODIFY", "diff": "@@ -4,8 +4,9 @@ const semver = require(\"semver\");\nmodule.exports = getRangeToReference;\n-function getRangeToReference(current, available, requested) {\n- const resolved = requested === \"latest\" ? `^${available}` : requested;\n+function getRangeToReference(spec, deps) {\n+ const current = deps[spec.name];\n+ const resolved = spec.type === \"tag\" ? `^${spec.version}` : spec.fetchSpec;\nif (current && semver.intersects(current, resolved)) {\nreturn current;\n", "new_path": "commands/add/lib/get-range-to-reference.js", "old_path": "commands/add/lib/get-range-to-reference.js" }, { "change_type": "DELETE", "diff": "-\"use strict\";\n-\n-const dedent = require(\"dedent\");\n-\n-module.exports = notSatisfiedMessage;\n-\n-function notSatisfiedMessage(unsatisfied) {\n- return dedent`\n- Requested range not satisfiable:\n- ${unsatisfied.map(u => `${u.name}@${u.versionRange} (available: ${u.version})`).join(\", \")}\n- `;\n-}\n", "new_path": null, "old_path": "commands/add/lib/not-satisfied-message.js" }, { "change_type": "MODIFY", "diff": "\"dedent\": \"^0.7.0\",\n\"npm-package-arg\": \"^6.0.0\",\n\"package-json\": \"^4.0.1\",\n- \"read-pkg\": \"^3.0.0\",\n+ \"p-map\": \"^1.2.0\",\n\"semver\": \"^5.5.0\",\n\"write-pkg\": \"^3.1.0\"\n}\n", "new_path": "commands/add/package.json", "old_path": "commands/add/package.json" }, { "change_type": "MODIFY", "diff": "\"@lerna/validation-error\": \"file:core/validation-error\",\n\"dedent\": \"0.7.0\",\n\"npm-package-arg\": \"6.0.0\",\n+ \"p-map\": \"1.2.0\",\n\"package-json\": \"4.0.1\",\n- \"read-pkg\": \"3.0.0\",\n\"semver\": \"5.5.0\",\n\"write-pkg\": \"3.1.0\"\n}\n", "new_path": "package-lock.json", "old_path": "package-lock.json" } ]
JavaScript
MIT License
lerna/lerna
fix(add): Support tag and version specifiers Fixes #1306
1
fix
add
791,813
21.03.2018 19:06:43
-3,600
dc3c21de4c93865e2c4b79b59db0edaedb5cde6f
report(font-size, link-text): update docs links
[ { "change_type": "MODIFY", "diff": "@@ -30,7 +30,7 @@ class LinkText extends Audit {\ndescription: 'Links have descriptive text',\nfailureDescription: 'Links do not have descriptive text',\nhelpText: 'Descriptive link text helps search engines understand your content. ' +\n- '[Learn more](https://webmasters.googleblog.com/2008/10/importance-of-link-architecture.html).',\n+ '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/descriptive-link-text).',\nrequiredArtifacts: ['URL', 'CrawlableLinks'],\n};\n}\n", "new_path": "lighthouse-core/audits/seo/link-text.js", "old_path": "lighthouse-core/audits/seo/link-text.js" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
report(font-size, link-text): update docs links (#4829)
1
report
font-size, link-text
821,196
21.03.2018 21:21:00
25,200
23323d306d46e76944fd99027d6dc24dd8c29721
docs: just use yarn in getting started guide
[ { "change_type": "MODIFY", "diff": "@@ -8,10 +8,6 @@ oclif is written in Node. You'll need Node as well as npm, which is a package ma\nIf you do not have them already, follow the instructions here to install npm and Node together: https://docs.npmjs.com/getting-started/installing-node\n-Next, install [Yarn](https://yarnpkg.com/en/) for dependency management.\n-\n-You can check it's installed by running `$ yarn`.\n-\n## Creating Your First CLI with oclif\nNow you're ready to create your first CLI with oclif. There are three stages: CLI creation, command development, and publishing to NPM.\n@@ -139,7 +135,7 @@ const location = flags.location || 'location'`\nTo publish to npm, just run:\n```sh-session\n-$ yarn publish\n+$ npm publish\n```\nYou'll need to [register with npm](https://www.npmjs.com/signup) and have verified your email address in order to publish.\n", "new_path": "GETTING_STARTED.md", "old_path": "GETTING_STARTED.md" } ]
TypeScript
MIT License
oclif/oclif
docs: just use yarn in getting started guide
1
docs
null
217,922
21.03.2018 22:05:42
-3,600
709138cd62e48c15ba95211b7c0d19925f58471f
feat: multiple list layout system closes closes
[ { "change_type": "MODIFY", "diff": "@@ -8,25 +8,42 @@ import {List} from '../../model/list/list';\nimport {FilterResult} from './filter-result';\nimport {ListLayout} from './list-layout';\nimport {LayoutOrderService} from './layout-order.service';\n+import {Observable} from 'rxjs/Observable';\n+import {UserService} from '../database/user.service';\n@Injectable()\nexport class LayoutService {\n- private _layout: ListLayout = new ListLayout();\n+ private _layouts: Observable<ListLayout[]>;\n- constructor(private serializer: NgSerializerService, private layoutOrder: LayoutOrderService) {\n- this.load();\n- if (this._layout.rows.length === 0) {\n- this._layout.rows = this.defaultLayout;\n+ constructor(private serializer: NgSerializerService, private layoutOrder: LayoutOrderService, private userService: UserService) {\n+ this._layouts =\n+ this.userService.getUserData()\n+ .map(userData => {\n+ const layouts = userData.layouts;\n+ if (layouts === undefined || layouts === null || layouts.length === 0) {\n+ return [new ListLayout('Default layout', this.defaultLayout)];\n}\n+ return layouts;\n+ })\n+ .map(layouts => {\n+ return layouts.map(layout => {\n+ if (layout.rows.length === 0) {\n+ layout.rows = this.defaultLayout;\n+ }\n+ return layout;\n+ });\n+ });\n}\n- public getDisplay(list: List): LayoutRowDisplay[] {\n- if (this.layoutRows.find(row => row.filter.name === 'ANYTHING') === undefined) {\n+ public getDisplay(list: List, index: number): Observable<LayoutRowDisplay[]> {\n+ return this.getLayoutRows(index)\n+ .map(layoutRows => {\n+ if (layoutRows.find(row => row.filter.name === 'ANYTHING') === undefined) {\nthrow new Error('List layoutRows has to contain an ANYTHING category');\n}\nlet unfilteredRows = list.items;\n- return this.layoutRows.map(row => {\n+ return layoutRows.map(row => {\nconst result: FilterResult = row.filter.filter(unfilteredRows);\nunfilteredRows = result.rejected;\nconst orderedAccepted = this.layoutOrder.order(result.accepted, row.orderBy, row.order);\n@@ -40,32 +57,39 @@ export class LayoutService {\nhideIfEmpty: row.hideIfEmpty,\n};\n}).sort((a, b) => a.index - b.index);\n+ });\n}\n- public get layoutRows(): LayoutRow[] {\n- return this._layout.rows.sort((a, b) => {\n+ public getLayoutRows(index: number): Observable<LayoutRow[]> {\n+ return this.getLayout(index).map(layout => {\n+ return layout.rows.sort((a, b) => {\n// ANYTHING has to be last filter applied, as it rejects nothing.\nif (a.filter.name === 'ANYTHING') {\n- return 10000;\n+ return 1;\n+ }\n+ if (b.filter.name === 'ANYTHING') {\n+ return -1;\n}\nreturn a.index - b.index;\n});\n+ });\n}\n- public get layout(): ListLayout {\n- return this._layout;\n+ public getLayout(index: number): Observable<ListLayout> {\n+ return this._layouts.map(layouts => layouts[index]);\n}\n- public persist(): void {\n- localStorage.setItem('layout', btoa(JSON.stringify(this._layout.rows)));\n+ public get layouts(): Observable<ListLayout[]> {\n+ return this._layouts;\n}\n- private load(): void {\n- if (localStorage.getItem('layout') !== null) {\n- this._layout.rows = this.serializer.deserialize<LayoutRow>(JSON.parse(atob(localStorage.getItem('layout'))), [LayoutRow]);\n- } else {\n- this._layout.rows = [];\n- }\n+ public persist(layouts: ListLayout[]): Observable<void> {\n+ return this.userService.getUserData()\n+ .first()\n+ .mergeMap(user => {\n+ user.layouts = layouts;\n+ return this.userService.set(user.$key, user);\n+ })\n}\npublic get defaultLayout(): LayoutRow[] {\n", "new_path": "src/app/core/layout/layout.service.ts", "old_path": "src/app/core/layout/layout.service.ts" }, { "change_type": "MODIFY", "diff": "import {LayoutRow} from './layout-row';\n+import {DeserializeAs} from '@kaiu/serializer';\nexport class ListLayout {\n- rows: LayoutRow[];\n+\n+ @DeserializeAs([LayoutRow])\n+ public rows: LayoutRow[];\n+\n+ constructor(public name: string, rows: LayoutRow[]) {\n+ this.rows = rows;\n+ }\nget base64(): string {\nreturn btoa(JSON.stringify(this.rows));\n", "new_path": "src/app/core/layout/list-layout.ts", "old_path": "src/app/core/layout/list-layout.ts" }, { "change_type": "MODIFY", "diff": "import {DataModel} from '../../core/database/storage/data-model';\n+import {ListLayout} from '../../core/layout/list-layout';\n+import {DeserializeAs} from '@kaiu/serializer';\nexport class AppUser extends DataModel {\nname?: string;\n@@ -15,4 +17,7 @@ export class AppUser extends DataModel {\n// Patron-only feature, nickname internal to teamcraft, must be unique.\nnickname?: string;\nadmin?: boolean;\n+ // List layouts are now stored inside firebase\n+ @DeserializeAs([ListLayout])\n+ layouts?: ListLayout[];\n}\n", "new_path": "src/app/model/list/app-user.ts", "old_path": "src/app/model/list/app-user.ts" }, { "change_type": "MODIFY", "diff": "<app-pricing [list]=\"listData\" *ngIf=\"pricingMode\" (close)=\"pricingMode = false\"></app-pricing>\n<div *ngIf=\"!pricingMode\">\n- <div *ngIf=\"listData\">\n+ <div *ngIf=\"listDisplay | async as display; else loading\">\n<div class=\"etime-container\">\n<app-eorzean-time class=\"etime\" [date]=\"etime\"></app-eorzean-time>\n</div>\n</div>\n</div>\n</mat-expansion-panel>\n- <div *ngFor=\"let displayRow of listDisplay; trackBy:displayTrackByFn\">\n+ <div *ngFor=\"let displayRow of display; trackBy:displayTrackByFn\">\n<app-list-details-panel\n[user]=\"userData\"\n*ngIf=\"displayRow.rows.length > 0 || !displayRow.hideIfEmpty\"\n</mat-checkbox>\n</div>\n<h4 class=\"not-found\" *ngIf=\"notFound\">{{\"List_not_found\" | translate}}</h4>\n- <div class=\"loader-container\" *ngIf=\"listData === null && !notFound\">\n+ <ng-template #loading>\n+ <div class=\"loader-container\" *ngIf=\"!notFound\">\n<mat-spinner></mat-spinner>\n</div>\n+ </ng-template>\n</div>\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": "display: flex;\nflex-direction: row;\nalign-items: center;\n+ margin-top: 15px;\nbutton {\nmargin-left: 10px;\n}\n", "new_path": "src/app/pages/list/list-details/list-details.component.scss", "old_path": "src/app/pages/list/list-details/list-details.component.scss" }, { "change_type": "MODIFY", "diff": "@@ -37,6 +37,8 @@ import {LayoutService} from '../../../core/layout/layout.service';\nimport {LayoutRowDisplay} from '../../../core/layout/layout-row-display';\nimport {ListLayoutPopupComponent} from '../list-layout-popup/list-layout-popup.component';\nimport {ComponentWithSubscriptions} from '../../../core/component/component-with-subscriptions';\n+import {Subject} from 'rxjs/Subject';\n+import {ReplaySubject} from 'rxjs/ReplaySubject';\ndeclare const ga: Function;\n@@ -54,7 +56,9 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\n@Input()\nnotFound = false;\n- listDisplay: LayoutRowDisplay[];\n+ listData$: ReplaySubject<List> = new ReplaySubject<List>();\n+\n+ listDisplay: Observable<LayoutRowDisplay[]>;\nuser: UserInfo;\n@@ -85,12 +89,21 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\n@Output()\nreload: EventEmitter<void> = new EventEmitter<void>();\n+ public get selectedIndex(): number {\n+ return +(localStorage.getItem('layout:selected') || 0);\n+ }\n+\nconstructor(private auth: AngularFireAuth, private userService: UserService, protected dialog: MatDialog,\nprivate listService: ListService, private listManager: ListManagerService, private snack: MatSnackBar,\nprivate translate: TranslateService, private router: Router, private eorzeanTimeService: EorzeanTimeService,\npublic settings: SettingsService, private layoutService: LayoutService, private cd: ChangeDetectorRef) {\nsuper();\nthis.initFilters();\n+ this.listDisplay = this.listData$\n+ .filter(data => data !== null)\n+ .mergeMap(data => {\n+ return this.layoutService.getDisplay(data, this.selectedIndex);\n+ });\n}\ndisplayTrackByFn(index: number, item: LayoutRowDisplay) {\n@@ -99,6 +112,7 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\nngOnChanges(changes: SimpleChanges): void {\nthis.updateDisplay();\n+ this.listData$.next(this.listData);\n}\nprivate updateDisplay(): void {\n@@ -130,7 +144,6 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\nif (this.accordionState === undefined) {\nthis.initAccordion(this.listData);\n}\n- this.listDisplay = this.layoutService.getDisplay(this.listData);\nthis.outdated = this.listData.isOutDated();\n}\n}\n@@ -211,6 +224,7 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\n.subscribe(user => {\nthis.userData = user;\n}));\n+ this.listData$.next(this.listData);\n}\nisOwnList(): boolean {\n@@ -232,7 +246,7 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\nopenLayoutOptions(): void {\nthis.dialog.open(ListLayoutPopupComponent).afterClosed().subscribe(() => {\nthis.reload.emit();\n- this.listDisplay = this.layoutService.getDisplay(this.listData);\n+ this.listDisplay = this.layoutService.getDisplay(this.listData, this.selectedIndex);\n});\n}\n", "new_path": "src/app/pages/list/list-details/list-details.component.ts", "old_path": "src/app/pages/list/list-details/list-details.component.ts" }, { "change_type": "MODIFY", "diff": "<div mat-dialog-content>\n<mat-input-container>\n<textarea type=\"text\" matInput placeholder=\"{{'LIST_DETAILS.LAYOUT_DIALOG.Import_string' | translate}}\"\n- #importString></textarea>\n+ [(ngModel)]=\"importString\"></textarea>\n</mat-input-container>\n+ <mat-error *ngIf=\"!importValid() && importString !== undefined && importString.length > 0\">\n+ {{'LIST_DETAILS.LAYOUT_DIALOG.Invalid_import' | translate }}\n+ </mat-error>\n</div>\n<div mat-dialog-actions>\n- <button mat-raised-button mat-dialog-close=\"{{importString.value}}\" color=\"accent\">{{\"Import\" | translate}}</button>\n+ <button mat-raised-button mat-dialog-close=\"{{importString}}\" color=\"accent\" [disabled]=\"!importValid()\">{{\"Import\"\n+ | translate}}\n+ </button>\n<button mat-button mat-dialog-close color=\"warn\">{{\"Cancel\" | translate}}</button>\n</div>\n", "new_path": "src/app/pages/list/list-layout-popup/import-input-box/import-input-box.component.html", "old_path": "src/app/pages/list/list-layout-popup/import-input-box/import-input-box.component.html" }, { "change_type": "MODIFY", "diff": "-import { Component, OnInit } from '@angular/core';\n+import {Component} from '@angular/core';\n@Component({\nselector: 'app-import-input-box',\ntemplateUrl: './import-input-box.component.html',\nstyleUrls: ['./import-input-box.component.scss']\n})\n-export class ImportInputBoxComponent implements OnInit {\n+export class ImportInputBoxComponent {\n- constructor() { }\n+ importString: string;\n- ngOnInit() {\n+ constructor() {\n+ }\n+\n+ importValid(): boolean {\n+ // First of all, the basics\n+ if (this.importString === undefined || this.importString.length === 0) {\n+ return false;\n+ }\n+ // Check if the string is a valid JSON\n+ try {\n+ const rows = JSON.parse(atob(this.importString));\n+ for (const row of rows) {\n+ if (row._filter === undefined || row._name === undefined) {\n+ return false;\n+ }\n+ }\n+ return true;\n+ } catch (ignored) {\n+ return false;\n+ }\n}\n}\n", "new_path": "src/app/pages/list/list-layout-popup/import-input-box/import-input-box.component.ts", "old_path": "src/app/pages/list/list-layout-popup/import-input-box/import-input-box.component.ts" }, { "change_type": "MODIFY", "diff": "<div class=\"container\">\n<h3 mat-dialog-title>{{\"LIST_DETAILS.LAYOUT_DIALOG.Title\" | translate}}</h3>\n- <div mat-dialog-content>\n- <div class=\"import-export\">\n+ <div class=\"content\" *ngIf=\"availableLayouts !== undefined\">\n+ <div class=\"selection\">\n+ <mat-form-field>\n+ <mat-select [placeholder]=\"'LIST_DETAILS.LAYOUT_DIALOG.Title' | translate\"\n+ [(value)]=\"selectedIndex\">\n+ <mat-option\n+ *ngFor=\"let layout of availableLayouts; trackBy: trackByLayout; let i = index\"\n+ [value]=\"i\">{{layout.name}}\n+ </mat-option>\n+ </mat-select>\n+ </mat-form-field>\n+ </div>\n+ <div class=\"controls\">\n+ <mat-form-field>\n+ <input type=\"text\" matInput [(ngModel)]=\"availableLayouts[selectedIndex].name\"\n+ [placeholder]=\"'LIST_DETAILS.LAYOUT_DIALOG.Layout_name' | translate\">\n+ </mat-form-field>\n+ <button mat-icon-button color=\"accent\" (click)=\"newLayout()\">\n+ <mat-icon>add</mat-icon>\n+ </button>\n+ <button mat-icon-button color=\"warn\" (click)=\"deleteLayout()\" [disabled]=\"availableLayouts.length <= 1\">\n+ <mat-icon>delete</mat-icon>\n+ </button>\n<button mat-icon-button ngxClipboard [cbContent]=\"export()\" (cbOnSuccess)=\"afterCopy()\" matTooltip=\"Export\"\nmatTooltipPosition=\"above\">\n<mat-icon>file_upload</mat-icon>\n<mat-icon>file_download</mat-icon>\n</button>\n</div>\n+ <div mat-dialog-content>\n<div class=\"rows\">\n- <div *ngFor=\"let row of rows; let i = index\"\n+ <div *ngFor=\"let row of availableLayouts[selectedIndex].rows; let i = index\"\nclass=\"mat-elevation-z10\">\n- <app-list-layout-row [(row)]=\"rows[i]\"\n+ <app-list-layout-row [(row)]=\"availableLayouts[selectedIndex].rows[i]\"\n(up)=\"updateIndex(i, -1)\"\n(down)=\"updateIndex(i, 1)\"\n(delete)=\"deleteRow(row)\"\n[first]=\"i === 0\"\n- [last]=\"i === rows.length - 1\"\n+ [last]=\"i === availableLayouts[selectedIndex].rows.length - 1\"\nreadonly=\"{{row.filterName === 'ANYTHING'}}\"></app-list-layout-row>\n</div>\n<button mat-raised-button color=\"accent\" (click)=\"addRow()\">\n</button>\n</div>\n</div>\n+ </div>\n<div mat-dialog-actions>\n<button mat-raised-button color=\"primary\" (click)=\"save()\">{{\"Save\" | translate}}</button>\n<button mat-button color=\"warn\" mat-dialog-close>{{\"Cancel\" | translate}}</button>\n- <div class=\"spacer\"></div>\n- <button mat-raised-button color=\"warn\" (click)=\"reset()\">{{\"COMMON.Reset\" | translate}}</button>\n</div>\n</div>\n", "new_path": "src/app/pages/list/list-layout-popup/list-layout-popup.component.html", "old_path": "src/app/pages/list/list-layout-popup/list-layout-popup.component.html" }, { "change_type": "MODIFY", "diff": ".container {\n- position: relative;\n- .import-export {\n- position: absolute;\n- display: inline-flex;\n- top: 5px;\n- right: 5px;\n+ .selection {\n+ width: 100%;\n+ mat-form-field {\n+ width: 100%;\n+ }\n+ }\n+ .controls {\n+ display: flex;\n+ justify-content: flex-end;\n+ mat-form-field {\n+ flex: 1 1 auto;\n+ }\n}\n.rows {\ndisplay: flex;\n", "new_path": "src/app/pages/list/list-layout-popup/list-layout-popup.component.scss", "old_path": "src/app/pages/list/list-layout-popup/list-layout-popup.component.scss" }, { "change_type": "MODIFY", "diff": "@@ -6,6 +6,8 @@ import {LayoutRowOrder} from '../../../core/layout/layout-row-order.enum';\nimport {ImportInputBoxComponent} from './import-input-box/import-input-box.component';\nimport {TranslateService} from '@ngx-translate/core';\nimport {NgSerializerService} from '@kaiu/ng-serializer';\n+import {ListLayout} from '../../../core/layout/list-layout';\n+import {ConfirmationPopupComponent} from '../../../modules/common-components/confirmation-popup/confirmation-popup.component';\n@Component({\nselector: 'app-list-layout-popup',\n@@ -14,36 +16,62 @@ import {NgSerializerService} from '@kaiu/ng-serializer';\n})\nexport class ListLayoutPopupComponent {\n- public rows: LayoutRow[] = [];\n+ public availableLayouts: ListLayout[];\n+\n+ public get selectedIndex(): number {\n+ return +(localStorage.getItem('layout:selected') || 0);\n+ }\n+\n+ public set selectedIndex(index: number) {\n+ localStorage.setItem('layout:selected', index.toString());\n+ }\nconstructor(public layoutService: LayoutService, private dialogRef: MatDialogRef<ListLayoutPopupComponent>,\nprivate dialog: MatDialog, private snackBar: MatSnackBar, private translator: TranslateService,\nprivate serializer: NgSerializerService) {\n- this.rows = layoutService.layout.rows.slice().sort((a, b) => a.index - b.index);\n+ this.layoutService.layouts.subscribe(layouts => {\n+ this.availableLayouts = layouts;\n+ });\n+ }\n+\n+ public newLayout(): void {\n+ this.availableLayouts.push(new ListLayout('New layout', this.layoutService.defaultLayout));\n+ this.selectedIndex = this.availableLayouts.length - 1;\n+ }\n+\n+ public deleteLayout(): void {\n+ this.dialog.open(ConfirmationPopupComponent)\n+ .afterClosed()\n+ .filter(res => res === true)\n+ .subscribe(() => {\n+ this.availableLayouts.splice(this.selectedIndex, 1);\n+ this.selectedIndex = 0;\n+ });\n}\npublic save(): void {\n- this.layoutService.layout.rows = this.rows;\n- this.layoutService.persist();\n+ this.layoutService.persist(this.availableLayouts).subscribe(() => {\nthis.dialogRef.close();\n+ });\n}\nupdateIndex(index: number, modifier: -1 | 1): void {\n- this.rows[index + modifier].index -= modifier;\n- this.rows[index].index += modifier;\n- this.rows = this.rows.sort((a, b) => a.index - b.index);\n+ this.availableLayouts[this.selectedIndex].rows[index + modifier].index -= modifier;\n+ this.availableLayouts[this.selectedIndex].rows[index].index += modifier;\n+ this.availableLayouts[this.selectedIndex].rows = this.availableLayouts[this.selectedIndex].rows.sort((a, b) => a.index - b.index);\n}\ndeleteRow(row: LayoutRow): void {\n- this.rows = this.rows.filter(r => r !== row);\n+ this.availableLayouts[this.selectedIndex].rows = this.availableLayouts[this.selectedIndex].rows.filter(r => r !== row);\n}\naddRow(): void {\n- this.rows.push(new LayoutRow('', 'NAME', LayoutRowOrder.DESC, 'NONE', this.rows.length));\n+ this.availableLayouts[this.selectedIndex].rows\n+ .push(new LayoutRow('', 'NAME', LayoutRowOrder.DESC, 'NONE', this.availableLayouts[this.selectedIndex].rows.length));\n}\npublic export(): string {\n- return btoa(JSON.stringify(this.rows));\n+ return btoa(JSON.stringify(this.availableLayouts[this.selectedIndex].rows));\n}\npublic afterCopy(): void {\n@@ -57,16 +85,19 @@ export class ListLayoutPopupComponent {\n);\n}\n- public reset(): void {\n- this.rows = this.layoutService.defaultLayout.slice().sort((a, b) => a.index - b.index);\n- }\n-\npublic import(): void {\nthis.dialog.open(ImportInputBoxComponent).afterClosed().subscribe(importString => {\nif (importString !== undefined) {\n- this.rows = this.serializer.deserialize<LayoutRow>(JSON.parse(atob(importString)), [LayoutRow]);\n+ const newLayout = new ListLayout('Imported layout',\n+ this.serializer.deserialize<LayoutRow>(JSON.parse(atob(importString)), [LayoutRow]));\n+ this.availableLayouts.push(newLayout);\n+ this.selectedIndex = this.availableLayouts.length - 1;\n}\n});\n}\n+ public trackByLayout(index: number, layout: ListLayout): string {\n+ return layout.base64;\n+ }\n+\n}\n", "new_path": "src/app/pages/list/list-layout-popup/list-layout-popup.component.ts", "old_path": "src/app/pages/list/list-layout-popup/list-layout-popup.component.ts" }, { "change_type": "MODIFY", "diff": "\"Title\": \"Layout\",\n\"Add_panel\": \"Add Panel\",\n\"Import_layout\": \"Import a layout\",\n- \"Import_string\": \"Layout import string\"\n+ \"Import_string\": \"Layout import code\",\n+ \"Import_string_copied\": \"Layout import code copied !\",\n+ \"Layout_name\": \"Layout name\",\n+ \"Invalid_import\": \"Invalid import code\"\n},\n\"LAYOUT\": {\n\"Filter\": \"Filter\",\n", "new_path": "src/assets/i18n/en.json", "old_path": "src/assets/i18n/en.json" }, { "change_type": "MODIFY", "diff": "\"Title\": \"Layout\",\n\"Add_panel\": \"Add Panel\",\n\"Import_layout\": \"Import a layout\",\n- \"Import_string\": \"Import string\"\n+ \"Import_string\": \"Import string\",\n+ \"Import_string_copied\": \"Layout import string copied !\",\n+ \"Layout_name\": \"Layout name\",\n+ \"Invalid_import\": \"Invalid import code\"\n},\n\"LAYOUT\": {\n\"Filter\": \"Filter\",\n", "new_path": "src/assets/i18n/ja.json", "old_path": "src/assets/i18n/ja.json" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
feat: multiple list layout system closes #244, closes #230
1
feat
null
217,879
21.03.2018 22:07:42
-3,600
a0fa34200586adb1747c2f2f9c82d421db1df0e2
style: Fix feature page
[ { "change_type": "MODIFY", "diff": "mat-expansion-panel {\nmargin-bottom: 10px;\n+ mat-panel-description {\n+ white-space: nowrap;\n+ text-overflow: ellipsis;\n+ overflow: hidden;\n+ display: block;\n+ font-size: 14px;\n+ }\n+ mat-expansion-panel-header.mat-expanded mat-panel-description{\n+ white-space: normal;\n+ }\nimg {\nheight: auto;\nwidth: 100%;\n}\n}\n+\n", "new_path": "src/app/pages/features/features/features.component.scss", "old_path": "src/app/pages/features/features/features.component.scss" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
style: Fix feature page
1
style
null
821,196
21.03.2018 22:32:00
25,200
241741aedd890b37be615972da35f02596cde082
fix: build manifest
[ { "change_type": "MODIFY", "diff": "\"postpublish\": \"rm .oclif.manifest.json\",\n\"posttest\": \"yarn run lint\",\n\"prepublishOnly\": \"yarn run build && oclif-dev manifest\",\n- \"version\": \"oclif-dev readme && git add README.md\",\n+ \"version\": \"oclif-dev readme && oclif-dev manifest && git add README.md\",\n\"test\": \"nps test\"\n},\n\"types\": \"lib/index.d.ts\"\n", "new_path": "package.json", "old_path": "package.json" } ]
TypeScript
MIT License
oclif/oclif
fix: build manifest
1
fix
null
217,922
21.03.2018 22:39:38
-3,600
fcf31c16e8f9afc14926c4ee74ff53e28a712b00
chore: typos in some themes
[ { "change_type": "MODIFY", "diff": "@@ -18,7 +18,7 @@ export class SettingsComponent {\nthemes = ['dark-orange', 'light-orange', 'light-teal', 'dark-teal', 'light-brown',\n'light-amber', 'dark-amber', 'light-green', 'dark-lime', 'light-lime',\n- 'dark-cyan', 'light-cyan', 'dark-indigo', 'dark-indigo', 'dark-blue', 'light-blue',\n+ 'dark-cyan', 'light-cyan', 'dark-indigo', 'light-indigo', 'dark-blue', 'light-blue',\n'dark-deep-purple', 'light-deep-purple', 'dark-red', 'light-red', 'dark-pink', 'light-pink'];\nlocale: string;\n", "new_path": "src/app/pages/settings/settings/settings.component.ts", "old_path": "src/app/pages/settings/settings/settings.component.ts" }, { "change_type": "MODIFY", "diff": "@@ -274,7 +274,7 @@ $light-pink-theme: mat-light-theme($primary-pink, $accent-pink, $warn);\n}\n// Light indigo theme class\n-.dark-indigo-theme {\n+.light-indigo-theme {\n@include angular-material-theme($light-indigo-theme);\n@include theme-background($light-indigo-theme);\n@include expansion-panel-accent($light-indigo-theme);\n", "new_path": "src/theme.scss", "old_path": "src/theme.scss" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: typos in some themes
1
chore
null
217,922
21.03.2018 22:41:27
-3,600
2fdf2c0c1e5b714853db2cafeb3728f37b99c21a
chore(release): 3.4.0-beta.5
[ { "change_type": "MODIFY", "diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"3.4.0-beta.5\"></a>\n+# [3.4.0-beta.5](https://github.com/Supamiu/ffxiv-teamcraft/compare/v3.4.0-beta.4...v3.4.0-beta.5) (2018-03-21)\n+\n+\n+### Bug Fixes\n+\n+* comments amount not updated when commenting an item ([00d5939](https://github.com/Supamiu/ffxiv-teamcraft/commit/00d5939))\n+* comments not working in zone breakdown ([0d5b4a6](https://github.com/Supamiu/ffxiv-teamcraft/commit/0d5b4a6)), closes [#281](https://github.com/Supamiu/ffxiv-teamcraft/issues/281)\n+* instance returned by gathering search causing strange results ([b025547](https://github.com/Supamiu/ffxiv-teamcraft/commit/b025547))\n+* items filtered and shown on wrong panel ([c6480aa](https://github.com/Supamiu/ffxiv-teamcraft/commit/c6480aa)), closes [#270](https://github.com/Supamiu/ffxiv-teamcraft/issues/270)\n+\n+\n+### Features\n+\n+* multiple list layout system ([709138c](https://github.com/Supamiu/ffxiv-teamcraft/commit/709138c)), closes [#244](https://github.com/Supamiu/ffxiv-teamcraft/issues/244) [#230](https://github.com/Supamiu/ffxiv-teamcraft/issues/230)\n+* new announcement box ([f697d96](https://github.com/Supamiu/ffxiv-teamcraft/commit/f697d96)), closes [#256](https://github.com/Supamiu/ffxiv-teamcraft/issues/256)\n+\n+\n+\n<a name=\"3.4.0-beta.4\"></a>\n# [3.4.0-beta.4](https://github.com/Supamiu/ffxiv-teamcraft/compare/v3.4.0-beta.3...v3.4.0-beta.4) (2018-03-20)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"teamcraft\",\n- \"version\": \"3.4.0-beta.4\",\n+ \"version\": \"3.4.0-beta.5\",\n\"lockfileVersion\": 1,\n\"requires\": true,\n\"dependencies\": {\n", "new_path": "package-lock.json", "old_path": "package-lock.json" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"teamcraft\",\n- \"version\": \"3.4.0-beta.4\",\n+ \"version\": \"3.4.0-beta.5\",\n\"license\": \"MIT\",\n\"scripts\": {\n\"ng\": \"ng\",\n", "new_path": "package.json", "old_path": "package.json" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore(release): 3.4.0-beta.5
1
chore
release
217,922
21.03.2018 23:16:22
-3,600
a975deb5fbb7a014a4b79c60c21f3166006c4582
chore: better announcement detection
[ { "change_type": "MODIFY", "diff": "@@ -128,7 +128,12 @@ export class AppComponent implements OnInit {\ndata.object('/announcement')\n.valueChanges()\n.subscribe((announcement: Announcement) => {\n- if (JSON.stringify(announcement) !== localStorage.getItem('announcement:last')) {\n+ let lastLS = localStorage.getItem('announcement:last');\n+ if (!lastLS.startsWith('{')) {\n+ lastLS = '{}';\n+ }\n+ const last = JSON.parse(lastLS || '{}');\n+ if (last.text !== announcement.text && last.link !== announcement.link) {\nthis.dialog.open(AnnouncementPopupComponent, {data: announcement})\n.afterClosed()\n.first()\n", "new_path": "src/app/app.component.ts", "old_path": "src/app/app.component.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: better announcement detection
1
chore
null
821,196
22.03.2018 00:34:58
25,200
c37e72480dcf740dc1ef1708ad09552672238208
fix: add path argument description
[ { "change_type": "MODIFY", "diff": "@@ -9,7 +9,7 @@ export default abstract class AppCommand extends Base {\nforce: flags.boolean({description: 'overwrite existing files'}),\n}\nstatic args = [\n- {name: 'path', required: false}\n+ {name: 'path', required: false, description: 'path to project, defaults to current directory'}\n]\nabstract type: string\n", "new_path": "src/app_command.ts", "old_path": "src/app_command.ts" } ]
TypeScript
MIT License
oclif/oclif
fix: add path argument description
1
fix
null
821,196
22.03.2018 01:19:43
25,200
5ef966fc1f4165983c9ff6ca8250e7e5d61c79bf
fix: only need 1 example
[ { "change_type": "MODIFY", "diff": "@@ -11,9 +11,6 @@ export default class <%- klass %> extends Command {\nstatic examples = [\n`$ <%- cmd %>\nhello world from ./src/<%- name %>.ts!\n-`,\n- `$ <%- cmd %> --name myname\n-hello myname from .src/<%- name %>.ts!\n`,\n]\n", "new_path": "templates/src/command.ts.ejs", "old_path": "templates/src/command.ts.ejs" } ]
TypeScript
MIT License
oclif/oclif
fix: only need 1 example
1
fix
null
573,227
22.03.2018 07:51:26
25,200
d6536252c7e62257f90045b6ea5e1c468a8537b0
docs(guide): document metrics.totalLatency in 6to7 guide
[ { "change_type": "MODIFY", "diff": "@@ -168,6 +168,7 @@ fully flushed. Earlier it was calculated when the last handler finished.\nTo address the previous use-cases, new timings were added to the metrics plugin:\n+ - `metrics.totalLatency` both request is flushed and all handlers finished\n- `metrics.preLatency` pre handlers latency\n- `metrics.useLatency` use handlers latency\n- `metrics.routeLatency` route handlers latency\n", "new_path": "docs/guides/6to7guide.md", "old_path": "docs/guides/6to7guide.md" } ]
JavaScript
MIT License
restify/node-restify
docs(guide): document metrics.totalLatency in 6to7 guide (#1628)
1
docs
guide
791,690
22.03.2018 09:41:30
25,200
d9dace56c09827a97473485201c5a9bef7cc622d
report(is-crawlable): fix broken learn more link
[ { "change_type": "MODIFY", "diff": "@@ -67,7 +67,7 @@ class IsCrawlable extends Audit {\nfailureDescription: 'Page is blocked from indexing',\nhelpText: 'Search engines are unable to include your pages in search results ' +\n'if they don\\'t have permission to crawl them. [Learn ' +\n- 'more](https://developers.google.com/lighthouse/audits/indexing).',\n+ 'more](https://developers.google.com/web/tools/lighthouse/audits/indexing).',\nrequiredArtifacts: ['MetaRobots', 'RobotsTxt'],\n};\n}\n", "new_path": "lighthouse-core/audits/seo/is-crawlable.js", "old_path": "lighthouse-core/audits/seo/is-crawlable.js" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
report(is-crawlable): fix broken learn more link (#4844)
1
report
is-crawlable
217,922
22.03.2018 11:13:49
-3,600
7a69d6006b0682178e5a6833a2640738a270d9cd
chore: missing translate pipe
[ { "change_type": "MODIFY", "diff": "<h2>{{'CUSTOM_LINKS.Title' | translate}}</h2>\n<div *ngIf=\"links | async as linksData\">\n<div class=\"no-links\" *ngIf=\"linksData.length === 0\">\n- <h3>{{\"CUSTOM_LINKS.No_links\"}}</h3>\n+ <h3>{{\"CUSTOM_LINKS.No_links\" | translate}}</h3>\n</div>\n<mat-list *ngIf=\"linksData.length > 0\">\n<mat-list-item *ngFor=\"let link of linksData; trackBy: trackByLink\" class=\"mat-elevation-z2 list-row\">\n", "new_path": "src/app/pages/custom-links/custom-links/custom-links.component.html", "old_path": "src/app/pages/custom-links/custom-links/custom-links.component.html" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: missing translate pipe
1
chore
null
791,723
22.03.2018 11:33:00
25,200
fcec593425fe11fc94e73a463dba0dbd9df29742
docs(releasing): updates
[ { "change_type": "MODIFY", "diff": "@@ -31,6 +31,8 @@ We follow [semver](https://semver.org/) versioning semantics (`vMajor.Minor.Patc\n## Release Process\n```sh\n+# use a custom lighthouse-pristine checkout to make sure your dev files aren't involved.\n+\n# * Install the latest. This also builds the cli, extension, and viewer *\nyarn install-all\n@@ -50,18 +52,18 @@ echo \"Test the extension\"\n# ...\necho \"Test a fresh local install\"\n-# (starting from lighthouse root...)\n-# npm pack\n-# cd ..; rm -rf tmp; mkdir tmp; cd tmp\n-# npm init -y\n-# npm install ../lighthouse/lighthouse-<version>.tgz\n-# npm explore lighthouse -- npm run smoke\n-# npm explore lighthouse -- npm run smokehouse\n-# npm explore lighthouse -- npm run chrome # try the manual launcher\n-# npm explore lighthouse -- npm run fast -- http://example.com\n-# cd ..; rm -rf ./tmp;\n-\n-# delete that lighthouse-<version>.tgz\n+# (starting from lighthouse-pristine root...)\n+yarn pack\n+cd ..; rm -rf tmp; mkdir tmp; cd tmp\n+npm init -y\n+npm install ../lighthouse-pristine/lighthouse-*.tgz\n+npm explore lighthouse -- npm run smoke\n+npm explore lighthouse -- npm run smokehouse\n+npm explore lighthouse -- npm run chrome # try the manual launcher\n+npm explore lighthouse -- npm run fast -- http://example.com\n+cd ..; rm -rf ./tmp;\n+\n+cd lighthouse-pristine; command rm -f lighthouse-*.tgz\necho \"Test the lighthouse-viewer build\"\n# Manual test for now:\n@@ -89,15 +91,16 @@ git push --tags\n# * Deploy-time *\necho \"Rebuild extension and viewer to get the latest, tagged master commit\"\n-yarn build-viewer; yarn build-extension;\n+yarn build-all;\n-cd lighthouse-extension; gulp package; cd ..\n+# zip the extension files, but remove lh-background as it's not needed\n+cd lighthouse-extension; command rm -f dist/scripts/lighthouse-background.js; gulp package; cd ..\necho \"Go here: https://chrome.google.com/webstore/developer/edit/blipmdconlkpinefehnmjammfjpmpbjk \"\necho \"Upload the package zip to CWS dev dashboard\"\necho \"Verify the npm package won't include unncessary files\"\n-yarn global add irish-pub pkgfiles\n-irish-pub; pkgfiles;\n+yarn global add pkgfiles\n+pkgfiles # publishable size should be ~2MB\necho \"ship it\"\nnpm publish\n", "new_path": "docs/releasing.md", "old_path": "docs/releasing.md" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
docs(releasing): updates
1
docs
releasing
217,922
22.03.2018 11:35:15
-3,600
73ace863a5301d569549e40c07d28def35e7d08b
chore: theme fixes
[ { "change_type": "MODIFY", "diff": "@@ -90,13 +90,13 @@ $primary-brown: mat-palette($mat-brown, 500);\n$accent-brown: mat-palette($mat-brown, 200);\n// amber\n$primary-amber: mat-palette($mat-amber, 500);\n-$accent-amber: mat-palette($mat-amber, 100);\n+$accent-amber: mat-palette($mat-brown, 400);\n// green\n$primary-green: mat-palette($mat-green, 800);\n$accent-green: mat-palette($mat-green, 400);\n// lime\n$primary-lime: mat-palette($mat-lime, 800);\n-$accent-lime: mat-palette($mat-lime, 500);\n+$accent-lime: mat-palette($mat-brown, 300);\n// cyan\n$primary-cyan: mat-palette($mat-cyan, 700);\n$accent-cyan: mat-palette($mat-cyan, 300);\n@@ -112,7 +112,7 @@ $accent-deep-purple: mat-palette($mat-deep-purple, 200);\n// red\n$primary-red: mat-palette($mat-red, 900);\n$accent-red: mat-palette($mat-red, 600);\n-$warn-red: mat-palette($mat-deep-purple, 900);\n+$warn-red: mat-palette($mat-light-blue, 500);\n// pink\n$primary-pink: mat-palette($mat-pink, 500);\n$accent-pink: mat-palette($mat-pink, 300);\n", "new_path": "src/theme.scss", "old_path": "src/theme.scss" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: theme fixes
1
chore
null
217,922
22.03.2018 12:08:28
-3,600
b0716a137bef6884b89838a0c7fce5962f00d085
chore: more space in sidebar
[ { "change_type": "MODIFY", "diff": "flex-shrink: 0;\ndisplay: flex;\nflex-direction: column;\n- margin-top: 80px;\n+ margin-top: 20px;\n.bottom-button {\nflex: 1 1 auto;\nmargin-bottom: 5px;\n", "new_path": "src/app/app.component.scss", "old_path": "src/app/app.component.scss" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: more space in sidebar
1
chore
null
821,196
22.03.2018 13:55:28
25,200
71576609c182f8fbffbffdf408671c5cb9c4a0b6
fix: make yarn optional
[ { "change_type": "MODIFY", "diff": "\"@oclif/plugin-not-found\": \"^1.0.3\",\n\"debug\": \"^3.1.0\",\n\"fixpack\": \"^2.3.1\",\n+ \"has-yarn\": \"^1.0.0\",\n\"lodash\": \"^4.17.5\",\n\"nps-utils\": \"^1.5.0\",\n\"sort-pjson\": \"^1.0.2\",\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "@@ -7,6 +7,7 @@ import * as path from 'path'\nimport * as Generator from 'yeoman-generator'\nimport yosay = require('yosay')\n+const hasYarn = require('has-yarn')()\nconst nps = require('nps-utils')\nconst sortPjson = require('sort-pjson')\nconst fixpack = require('fixpack')\n@@ -34,6 +35,7 @@ class App extends Generator {\n'semantic-release': boolean\ntypescript: boolean\ntslint: boolean\n+ yarn: boolean\n}\nargs!: {[k: string]: string}\ntype: 'single' | 'multi' | 'plugin' | 'base'\n@@ -54,6 +56,7 @@ class App extends Generator {\nmocha: boolean\ntypescript: boolean\ntslint: boolean\n+ yarn: boolean\n'semantic-release': boolean\n}\n}\n@@ -61,6 +64,7 @@ class App extends Generator {\nsemantic_release!: boolean\nts!: boolean\ntslint!: boolean\n+ yarn!: boolean\nget _ext() { return this.ts ? 'ts' : 'js' }\nget _bin() {\nlet bin = this.pjson.oclif && (this.pjson.oclif.bin || this.pjson.oclif.dirname) || this.pjson.name\n@@ -80,6 +84,7 @@ class App extends Generator {\n'semantic-release': opts.options.includes('semantic-release'),\ntypescript: opts.options.includes('typescript'),\ntslint: opts.options.includes('tslint'),\n+ yarn: opts.options.includes('yarn'),\n}\n}\n@@ -209,6 +214,7 @@ class App extends Generator {\n{name: 'mocha (testing framework)', value: 'mocha', checked: true},\n{name: 'typescript (static typing for javascript)', value: 'typescript', checked: true},\n{name: 'tslint (static analysis tool for typescript)', value: 'tslint', checked: true},\n+ {name: 'yarn', value: 'yarn (npm alternative)', checked: this.options.yarn || hasYarn},\n{name: 'semantic-release (automated version management)', value: 'semantic-release', checked: this.options['semantic-release']}\n],\nfilter: ((arr: string[]) => _.keyBy(arr)) as any,\n@@ -226,6 +232,7 @@ class App extends Generator {\nthis.options = this.answers.options\nthis.ts = this.options.typescript\nthis.tslint = this.options.tslint\n+ this.yarn = this.options.yarn\nthis.mocha = this.options.mocha\nthis.semantic_release = this.options['semantic-release']\n@@ -444,9 +451,11 @@ class App extends Generator {\n}\nlet yarnOpts = {} as any\nif (process.env.YARN_MUTEX) yarnOpts.mutex = process.env.YARN_MUTEX\n+ const install = (deps: string[], opts: object) => this.yarn ? this.yarnInstall(deps, opts) : this.npmInstall(deps, opts)\n+ const dev = this.yarn ? {dev: true} : {only: 'dev'}\nPromise.all([\n- this.yarnInstall(devDependencies, {...yarnOpts, dev: true, ignoreScripts: true}),\n- this.yarnInstall(dependencies, yarnOpts),\n+ install(devDependencies, {...yarnOpts, ...dev, ignoreScripts: true}),\n+ install(dependencies, yarnOpts),\n]).then(() => {\nif (['plugin', 'multi'].includes(this.type)) {\nthis.spawnCommandSync(path.join('.', 'node_modules/.bin/oclif-dev'), ['readme'])\n", "new_path": "src/generators/app.ts", "old_path": "src/generators/app.ts" }, { "change_type": "MODIFY", "diff": "@@ -21,9 +21,9 @@ function generate(args) {\nfunction build(type, features) {\nlet options = ''\n- if (features === 'everything') options = '--options=typescript,tslint,mocha,semantic-release'\n- if (features === 'typescript') options = '--options=typescript'\n- if (features === 'mocha') options = '--options=mocha'\n+ if (features === 'everything') options = '--options=yarn,typescript,tslint,mocha,semantic-release'\n+ if (features === 'typescript') options = '--options=yarn,typescript'\n+ if (features === 'mocha') options = '--options=yarn,mocha'\nlet dir = CI ? tmp.tmpNameSync() : path.join(__dirname, '../tmp')\ndir = path.join(dir, type, features)\nsh.rm('-rf', dir)\n", "new_path": "test/run.js", "old_path": "test/run.js" }, { "change_type": "MODIFY", "diff": "@@ -1485,6 +1485,10 @@ has-values@^1.0.0:\nis-number \"^3.0.0\"\nkind-of \"^4.0.0\"\n+has-yarn@^1.0.0:\n+ version \"1.0.0\"\n+ resolved \"https://registry.yarnpkg.com/has-yarn/-/has-yarn-1.0.0.tgz#89e25db604b725c8f5976fff0addc921b828a5a7\"\n+\nhe@1.1.1:\nversion \"1.1.1\"\nresolved \"https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd\"\n", "new_path": "yarn.lock", "old_path": "yarn.lock" } ]
TypeScript
MIT License
oclif/oclif
fix: make yarn optional (#76)
1
fix
null
217,922
22.03.2018 14:05:25
-3,600
9d2c641e76d5a12edd3c9744fb40e9f0a8745ee7
chore: switch requirements popup button back to accent
[ { "change_type": "MODIFY", "diff": "matTooltip=\"{{'Requirements_for_craft' | translate}}\"\nmatTooltipPosition=\"above\" [ngClass]=\"{'requirements-button':true, 'compact': settings.compactLists}\"\n(click)=\"openRequirementsPopup()\">\n- <mat-icon color=\"primary\">assignment</mat-icon>\n+ <mat-icon color=\"accent\">assignment</mat-icon>\n</button>\n<mat-icon *ngIf=\"!hasBook()\" matTooltip=\"{{'LIST_DETAILS.No_book' | translate}}\" matTooltipPosition=\"above\"\ncolor=\"warn\">\n", "new_path": "src/app/modules/item/item/item.component.html", "old_path": "src/app/modules/item/item/item.component.html" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: switch requirements popup button back to accent
1
chore
null
821,196
22.03.2018 14:06:59
25,200
01370d252da66e25b80a2947ec38e4db21101a61
fix: use npm for scripts if not yarn
[ { "change_type": "MODIFY", "diff": "@@ -211,10 +211,10 @@ class App extends Generator {\nname: 'options',\nmessage: 'optional components to include',\nchoices: [\n+ {name: 'yarn (npm alternative)', value: 'yarn', checked: this.options.yarn || hasYarn},\n{name: 'mocha (testing framework)', value: 'mocha', checked: true},\n{name: 'typescript (static typing for javascript)', value: 'typescript', checked: true},\n{name: 'tslint (static analysis tool for typescript)', value: 'tslint', checked: true},\n- {name: 'yarn', value: 'yarn (npm alternative)', checked: this.options.yarn || hasYarn},\n{name: 'semantic-release (automated version management)', value: 'semantic-release', checked: this.options['semantic-release']}\n],\nfilter: ((arr: string[]) => _.keyBy(arr)) as any,\n@@ -244,7 +244,8 @@ class App extends Generator {\nthis.pjson.files = this.answers.files || defaults.files || [(this.ts ? '/lib' : '/src')]\nthis.pjson.license = this.answers.license || defaults.license\nthis.pjson.repository = this.answers.github ? `${this.answers.github.user}/${this.answers.github.repo}` : defaults.repository\n- this.pjson.scripts.posttest = 'yarn run lint'\n+ let npm = this.yarn ? 'yarn' : 'npm'\n+ this.pjson.scripts.posttest = `${npm} run lint`\n// this.pjson.scripts.precommit = 'yarn run lint'\nif (this.ts) {\nconst tsProject = this.mocha ? 'test' : '.'\n@@ -260,14 +261,14 @@ class App extends Generator {\n}\nif (this.ts) {\nthis.pjson.scripts.build = 'rm -rf lib && tsc'\n- this.pjson.scripts.prepublishOnly = 'yarn run build'\n+ this.pjson.scripts.prepublishOnly = `${npm} run build`\n}\nif (['plugin', 'multi'].includes(this.type)) {\nthis.pjson.scripts.prepublishOnly = nps.series(this.pjson.scripts.prepublishOnly, 'oclif-dev manifest')\nif (this.semantic_release) this.pjson.scripts.prepublishOnly = nps.series(this.pjson.scripts.prepublishOnly, 'oclif-dev readme')\nthis.pjson.scripts.version = nps.series('oclif-dev readme', 'git add README.md')\nthis.pjson.scripts.clean = 'rm -f .oclif.manifest.json'\n- this.pjson.scripts.postpublish = this.pjson.scripts.preversion = 'yarn run clean'\n+ this.pjson.scripts.postpublish = this.pjson.scripts.preversion = `${npm} run clean`\nthis.pjson.files.push('.oclif.manifest.json')\n}\nthis.pjson.keywords = defaults.keywords || [this.type === 'plugin' ? 'oclif-plugin' : 'oclif']\n", "new_path": "src/generators/app.ts", "old_path": "src/generators/app.ts" } ]
TypeScript
MIT License
oclif/oclif
fix: use npm for scripts if not yarn
1
fix
null
217,922
22.03.2018 14:34:28
-3,600
725aedddb58213a847fe727dd771537d015da336
chore: small edge case on coords information
[ { "change_type": "MODIFY", "diff": "@@ -167,8 +167,10 @@ export class ListDetailsPanelComponent implements OnChanges, OnInit {\npublic getCoords(item: ListRow, zoneBreakdownRow: ZoneBreakdownRow): Vector2 {\nif (item.gatheredBy !== undefined) {\nconst node = item.gatheredBy.nodes.find(n => n.zoneid === zoneBreakdownRow.zoneId);\n+ if (node !== undefined) {\nreturn {x: node.coords[0], y: node.coords[1]};\n}\n+ }\nreturn undefined;\n}\n", "new_path": "src/app/pages/list/list-details-panel/list-details-panel.component.ts", "old_path": "src/app/pages/list/list-details-panel/list-details-panel.component.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: small edge case on coords information
1
chore
null
807,849
22.03.2018 15:11:56
25,200
d305a38f7228a43dd04200b928462de315c311ba
feat(command): Remove legacy config handling BREAKING CHANGE: lerna.json `bootstrapConfig` and `publishConfig` namespaces are no longer honored. These config blocks should be moved to `command.bootstrap` and `command.publish`, respectively.
[ { "change_type": "MODIFY", "diff": "@@ -399,70 +399,6 @@ describe(\"core-command\", () => {\n});\n});\n- describe(\"legacy options\", () => {\n- let cwd;\n-\n- beforeAll(async () => {\n- cwd = await initFixture(\"legacy\");\n- });\n-\n- class TestCommand extends Command {}\n-\n- describe(\"bootstrapConfig\", () => {\n- class BootstrapCommand extends Command {}\n-\n- it(\"should provide a correct value\", async () => {\n- const instance = new BootstrapCommand({ onRejected, cwd });\n- await instance;\n-\n- expect(instance.options.ignore).toBe(\"package-a\");\n- });\n-\n- it(\"should not warn with other commands\", async () => {\n- const instance = new TestCommand({ onRejected, cwd });\n- await instance;\n-\n- instance.options; // eslint-disable-line no-unused-expressions\n-\n- expect(loggingOutput(\"warn\")).toHaveLength(0);\n- });\n-\n- it(\"should not provide a value to other commands\", async () => {\n- const instance = new TestCommand({ onRejected, cwd });\n- await instance;\n-\n- expect(instance.options.ignore).toBe(undefined);\n- });\n- });\n-\n- describe(\"publishConfig\", () => {\n- class PublishCommand extends Command {}\n-\n- it(\"should provide a correct value\", async () => {\n- const instance = new PublishCommand({ onRejected, cwd });\n- await instance;\n-\n- expect(instance.options.ignore).toBe(\"package-b\");\n- });\n-\n- it(\"should not warn with other commands\", async () => {\n- const instance = new TestCommand({ onRejected, cwd });\n- await instance;\n-\n- instance.options; // eslint-disable-line no-unused-expressions\n-\n- expect(loggingOutput(\"warn\")).toHaveLength(0);\n- });\n-\n- it(\"should not provide a value to other commands\", async () => {\n- const instance = new TestCommand({ onRejected, cwd });\n- await instance;\n-\n- expect(instance.options.ignore).toBe(undefined);\n- });\n- });\n- });\n-\ndescribe(\"subclass implementation\", () => {\n[\"initialize\", \"execute\"].forEach(method => {\nit(`throws if ${method}() is not overridden`, () => {\n", "new_path": "core/command/__tests__/command.test.js", "old_path": "core/command/__tests__/command.test.js" }, { "change_type": "MODIFY", "diff": "@@ -120,9 +120,7 @@ class Command {\n// Global options from `lerna.json`\nthis.repository.lernaJson,\n// Command specific defaults\n- this.defaultOptions,\n- // Deprecated legacy options in `lerna.json`\n- this._legacyOptions()\n+ this.defaultOptions\n);\n}\n@@ -230,20 +228,6 @@ class Command {\n});\n}\n- _legacyOptions() {\n- return [\"bootstrap\", \"publish\"].reduce((obj, command) => {\n- if (this.name === command && this.repository.lernaJson[`${command}Config`]) {\n- log.warn(\n- \"deprecated\",\n- `\\`${command}Config.ignore\\` has been replaced by \\`command.${command}.ignore\\`.`\n- );\n- obj.ignore = this.repository.lernaJson[`${command}Config`].ignore;\n- }\n-\n- return obj;\n- }, {});\n- }\n-\ninitialize() {\nthrow new Error(\"command.initialize() needs to be implemented.\");\n}\n", "new_path": "core/command/index.js", "old_path": "core/command/index.js" } ]
JavaScript
MIT License
lerna/lerna
feat(command): Remove legacy config handling BREAKING CHANGE: lerna.json `bootstrapConfig` and `publishConfig` namespaces are no longer honored. These config blocks should be moved to `command.bootstrap` and `command.publish`, respectively.
1
feat
command
791,723
22.03.2018 15:46:25
25,200
5d4b61db0c169dee16e8462379066b1105e4c64d
tests: rename seo test files
[ { "change_type": "RENAME", "diff": "@@ -45,7 +45,7 @@ describe('SEO: Document has valid canonical link', () => {\nreturn CanonicalAudit.audit(artifacts).then(auditResult => {\nassert.equal(auditResult.rawValue, false);\n- assert.ok(auditResult.debugString.includes('multiple'));\n+ assert.ok(auditResult.debugString.includes('Multiple'), auditResult.debugString);\n});\n});\n@@ -63,7 +63,7 @@ describe('SEO: Document has valid canonical link', () => {\nreturn CanonicalAudit.audit(artifacts).then(auditResult => {\nassert.equal(auditResult.rawValue, false);\n- assert.ok(auditResult.debugString.includes('invalid'));\n+ assert.ok(auditResult.debugString.includes('Invalid'), auditResult.debugString);\n});\n});\n@@ -81,7 +81,7 @@ describe('SEO: Document has valid canonical link', () => {\nreturn CanonicalAudit.audit(artifacts).then(auditResult => {\nassert.equal(auditResult.rawValue, false);\n- assert.ok(auditResult.debugString.includes('relative'));\n+ assert.ok(auditResult.debugString.includes('Relative'), auditResult.debugString);\n});\n});\n@@ -102,7 +102,7 @@ describe('SEO: Document has valid canonical link', () => {\nreturn CanonicalAudit.audit(artifacts).then(auditResult => {\nassert.equal(auditResult.rawValue, false);\n- assert.ok(auditResult.debugString.includes('hreflang'));\n+ assert.ok(auditResult.debugString.includes('hreflang'), auditResult.debugString);\n});\n});\n@@ -120,7 +120,7 @@ describe('SEO: Document has valid canonical link', () => {\nreturn CanonicalAudit.audit(artifacts).then(auditResult => {\nassert.equal(auditResult.rawValue, false);\n- assert.ok(auditResult.debugString.includes('domain'));\n+ assert.ok(auditResult.debugString.includes('domain'), auditResult.debugString);\n});\n});\n@@ -138,7 +138,7 @@ describe('SEO: Document has valid canonical link', () => {\nreturn CanonicalAudit.audit(artifacts).then(auditResult => {\nassert.equal(auditResult.rawValue, false);\n- assert.ok(auditResult.debugString.includes('root'));\n+ assert.ok(auditResult.debugString.includes('root'), auditResult.debugString);\n});\n});\n", "new_path": "lighthouse-core/test/audits/seo/canonical-test.js", "old_path": "lighthouse-core/test/audits/seo/canonical.js" }, { "change_type": "RENAME", "diff": "", "new_path": "lighthouse-core/test/audits/seo/hreflang-test.js", "old_path": "lighthouse-core/test/audits/seo/hreflang.js" }, { "change_type": "RENAME", "diff": "", "new_path": "lighthouse-core/test/audits/seo/plugins-test.js", "old_path": "lighthouse-core/test/audits/seo/plugins.js" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
tests: rename seo test files (#4853)
1
tests
null
217,922
22.03.2018 16:20:47
-3,600
54f3dc59dae3855c3fcb7e3c2a35ae267865398e
chore: broken layouts with fishing items
[ { "change_type": "MODIFY", "diff": "@@ -167,7 +167,7 @@ export class ListDetailsPanelComponent implements OnChanges, OnInit {\npublic getCoords(item: ListRow, zoneBreakdownRow: ZoneBreakdownRow): Vector2 {\nif (item.gatheredBy !== undefined) {\nconst node = item.gatheredBy.nodes.find(n => n.zoneid === zoneBreakdownRow.zoneId);\n- if (node !== undefined) {\n+ if (node !== undefined && node.coords !== undefined) {\nreturn {x: node.coords[0], y: node.coords[1]};\n}\n}\n", "new_path": "src/app/pages/list/list-details-panel/list-details-panel.component.ts", "old_path": "src/app/pages/list/list-details-panel/list-details-panel.component.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: broken layouts with fishing items
1
chore
null
807,849
22.03.2018 16:22:39
25,200
b8c278940a7b6bef4bf9a9f19f4cf5dbf350496f
feat(project): Use cosmiconfig to locate and read lerna.json
[ { "change_type": "MODIFY", "diff": "@@ -232,7 +232,7 @@ describe(\"InitCommand\", () => {\nawait lernaInit(testDir)(\"--exact\");\n- expect(await fs.readJSON(lernaJsonPath)).toMatchObject({\n+ expect(await fs.readJSON(lernaJsonPath)).toEqual({\ncommands: {\nbootstrap: {\nhoist: true,\n@@ -241,6 +241,8 @@ describe(\"InitCommand\", () => {\nexact: true,\n},\n},\n+ packages: [\"packages/*\"],\n+ version: \"1.2.3\",\n});\n});\n});\n", "new_path": "commands/init/__tests__/init-command.test.js", "old_path": "commands/init/__tests__/init-command.test.js" }, { "change_type": "MODIFY", "diff": "@@ -38,7 +38,7 @@ class InitCommand extends Command {\nlet chain = Promise.resolve();\nchain = chain.then(() => this.ensurePackageJSON());\n- chain = chain.then(() => this.ensureLernaJson());\n+ chain = chain.then(() => this.ensureLernaConfig());\nchain = chain.then(() => this.ensurePackagesDir());\nreturn chain.then(() => {\n@@ -47,7 +47,6 @@ class InitCommand extends Command {\n}\nensurePackageJSON() {\n- const { packageJsonLocation } = this.repository;\nlet { packageJson } = this.repository;\nlet chain = Promise.resolve();\n@@ -59,7 +58,9 @@ class InitCommand extends Command {\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(packageJsonLocation, packageJson, { indent: 2 }));\n+ chain = chain.then(() =>\n+ writeJsonFile(this.repository.packageJsonLocation, packageJson, { indent: 2 })\n+ );\n} else {\nthis.logger.info(\"\", \"Updating package.json\");\n}\n@@ -80,47 +81,47 @@ class InitCommand extends Command {\ntargetDependencies.lerna = this.exact ? this.lernaVersion : `^${this.lernaVersion}`;\n- chain = chain.then(() => writePkg(packageJsonLocation, packageJson));\n+ chain = chain.then(() => writePkg(this.repository.packageJsonLocation, packageJson));\nreturn chain;\n}\n- ensureLernaJson() {\n- // lernaJson already defaulted to empty object in Repository constructor\n- const { lernaJson, lernaJsonLocation, version: repositoryVersion } = this.repository;\n+ ensureLernaConfig() {\n+ // config already defaulted to empty object in Project constructor\n+ const { config, version: projectVersion } = this.repository;\nlet version;\nif (this.options.independent) {\nversion = \"independent\";\n- } else if (repositoryVersion) {\n- version = repositoryVersion;\n+ } else if (projectVersion) {\n+ version = projectVersion;\n} else {\nversion = \"0.0.0\";\n}\n- if (!repositoryVersion) {\n+ if (!projectVersion) {\nthis.logger.info(\"\", \"Creating lerna.json\");\n} else {\nthis.logger.info(\"\", \"Updating lerna.json\");\n}\n- Object.assign(lernaJson, {\n- packages: this.repository.packageConfigs,\n- version,\n- });\n-\n- delete lernaJson.lerna; // no longer relevant\n+ delete config.lerna; // no longer relevant\nif (this.exact) {\n// ensure --exact is preserved for future init commands\n- const commandConfig = lernaJson.commands || lernaJson.command || (lernaJson.command = {});\n+ const commandConfig = config.commands || config.command || (config.command = {});\nconst initConfig = commandConfig.init || (commandConfig.init = {});\ninitConfig.exact = true;\n}\n- return writeJsonFile(lernaJsonLocation, lernaJson, { indent: 2, detectIndent: true });\n+ Object.assign(config, {\n+ packages: this.repository.packageConfigs,\n+ version,\n+ });\n+\n+ return this.repository.serializeConfig();\n}\nensurePackagesDir() {\n", "new_path": "commands/init/index.js", "old_path": "commands/init/index.js" }, { "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 writeJsonFile = require(\"write-json-file\");\nconst writePkg = require(\"write-pkg\");\nconst Command = require(\"@lerna/command\");\n@@ -403,15 +402,13 @@ class PublishCommand extends Command {\n}\nupdateVersionInLernaJson() {\n- this.repository.lernaJson.version = this.globalVersion;\n+ this.repository.version = this.globalVersion;\n- return writeJsonFile(this.repository.lernaJsonLocation, this.repository.lernaJson, { indent: 2 }).then(\n- () => {\n+ return this.repository.serializeConfig().then(lernaConfigLocation => {\nif (!this.options.skipGit) {\n- return GitUtilities.addFiles([this.repository.lernaJsonLocation], this.execOpts);\n+ return GitUtilities.addFiles([lernaConfigLocation], this.execOpts);\n}\n- }\n- );\n+ });\n}\nrunPackageLifecycle(pkg, stage) {\n", "new_path": "commands/publish/index.js", "old_path": "commands/publish/index.js" }, { "change_type": "MODIFY", "diff": "@@ -104,7 +104,7 @@ class Command {\nconfigureOptions() {\n// Command config object is either \"commands\" or \"command\".\n- const { commands, command } = this.repository.lernaJson;\n+ const { commands, command } = this.repository.config;\n// The current command always overrides otherCommandConfigs\nconst lernaCommandOverrides = [this.name, ...this.otherCommandConfigs].map(\n@@ -118,7 +118,7 @@ class Command {\n// Namespaced command options from `lerna.json`\n...lernaCommandOverrides,\n// Global options from `lerna.json`\n- this.repository.lernaJson,\n+ this.repository.config,\n// Command specific defaults\nthis.defaultOptions\n);\n", "new_path": "core/command/index.js", "old_path": "core/command/index.js" }, { "change_type": "ADD", "diff": "+{\n+ \"name\": \"test\",\n+ \"devDependencies\": {\n+ \"lerna\": \"500.0.0\"\n+ }\n+}\n", "new_path": "core/project/__fixtures__/no-lerna-config/package.json", "old_path": null }, { "change_type": "MODIFY", "diff": "const path = require(\"path\");\n// mocked or stubbed modules\n-const findUp = require(\"find-up\");\nconst loadJsonFile = require(\"load-json-file\");\n// helpers\n@@ -20,36 +19,28 @@ describe(\"Project\", () => {\n});\ndescribe(\".rootPath\", () => {\n- const findUpSync = findUp.sync;\n-\n- afterEach(() => {\n- findUp.sync = findUpSync;\n- });\n-\nit(\"should be added to the instance\", () => {\nconst repo = new Project(testDir);\nexpect(repo.rootPath).toBe(testDir);\n});\n- it(\"resolves to CWD when lerna.json missing\", () => {\n- findUp.sync = jest.fn(() => null);\n+ it(\"resolves to CWD when lerna.json missing\", async () => {\n+ const cwd = await initFixture(\"no-lerna-config\");\n+ const repo = new Project(cwd);\n- const repo = new Project(testDir);\n- expect(repo.rootPath).toBe(testDir);\n+ expect(repo.rootPath).toBe(cwd);\n});\nit(\"defaults CWD to '.' when constructor argument missing\", () => {\n- findUp.sync = jest.fn(() => null);\n-\nconst repo = new Project();\nexpect(repo.rootPath).toBe(path.resolve(__dirname, \"..\", \"..\", \"..\"));\n});\n});\n- describe(\".lernaJsonLocation\", () => {\n+ describe(\".lernaConfigLocation\", () => {\nit(\"should be added to the instance\", () => {\nconst repo = new Project(testDir);\n- expect(repo.lernaJsonLocation).toBe(path.join(testDir, \"lerna.json\"));\n+ expect(repo.lernaConfigLocation).toBe(path.join(testDir, \"lerna.json\"));\n});\n});\n@@ -60,37 +51,28 @@ describe(\"Project\", () => {\n});\n});\n- describe(\"get .lernaJson\", () => {\n- const loadJsonFileSync = loadJsonFile.sync;\n-\n- afterEach(() => {\n- loadJsonFile.sync = loadJsonFileSync;\n- });\n-\n+ describe(\".config\", () => {\nit(\"returns parsed lerna.json\", () => {\nconst repo = new Project(testDir);\n- expect(repo.lernaJson).toEqual({\n+ expect(repo.config).toEqual({\nversion: \"1.0.0\",\n});\n});\n- it(\"defaults to an empty object\", () => {\n- loadJsonFile.sync = jest.fn(() => {\n- throw new Error(\"File not found\");\n- });\n+ it(\"defaults to an empty object\", async () => {\n+ const cwd = await initFixture(\"no-lerna-config\");\n+ const repo = new Project(cwd);\n- const repo = new Project(testDir);\n- expect(repo.lernaJson).toEqual({});\n+ expect(repo.config).toEqual({});\n});\nit(\"errors when lerna.json is not valid JSON\", async () => {\nexpect.assertions(2);\nconst cwd = await initFixture(\"invalid-json\");\n- const repo = new Project(cwd);\ntry {\n- repo.lernaJson; // eslint-disable-line no-unused-expressions\n+ const repo = new Project(cwd); // eslint-disable-line no-unused-vars\n} catch (err) {\nexpect(err.name).toBe(\"ValidationError\");\nexpect(err.prefix).toBe(\"JSONError\");\n@@ -99,12 +81,20 @@ describe(\"Project\", () => {\n});\ndescribe(\"get .version\", () => {\n- it(\"reads the `version` key from lerna.json\", () => {\n+ it(\"reads the `version` key from internal config\", () => {\nconst repo = new Project(testDir);\nexpect(repo.version).toBe(\"1.0.0\");\n});\n});\n+ describe(\"set .version\", () => {\n+ it(\"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+ });\n+ });\n+\ndescribe(\"get .packageConfigs\", () => {\nit(\"returns the default packageConfigs\", () => {\nconst repo = new Project(testDir);\n@@ -114,7 +104,7 @@ describe(\"Project\", () => {\nit(\"returns custom packageConfigs\", () => {\nconst repo = new Project(testDir);\nconst customPackages = [\".\", \"my-packages/*\"];\n- repo.lernaJson.packages = customPackages;\n+ repo.config.packages = customPackages;\nexpect(repo.packageConfigs).toBe(customPackages);\n});\n@@ -126,7 +116,7 @@ describe(\"Project\", () => {\nit(\"throws with friendly error if workspaces are not configured\", () => {\nconst repo = new Project(testDir);\n- repo.lernaJson.useWorkspaces = true;\n+ repo.config.useWorkspaces = true;\nexpect(() => repo.packageConfigs).toThrow(/workspaces need to be defined/);\n});\n});\n@@ -134,7 +124,7 @@ describe(\"Project\", () => {\ndescribe(\"get .packageParentDirs\", () => {\nit(\"returns a list of package parent directories\", () => {\nconst repo = new Project(testDir);\n- repo.lernaJson.packages = [\".\", \"packages/*\", \"dir/nested/*\", \"globstar/**\"];\n+ repo.config.packages = [\".\", \"packages/*\", \"dir/nested/*\", \"globstar/**\"];\nexpect(repo.packageParentDirs).toEqual([\ntestDir,\npath.join(testDir, \"packages\"),\n@@ -183,10 +173,9 @@ describe(\"Project\", () => {\nexpect.assertions(2);\nconst cwd = await initFixture(\"invalid-json\");\n- const repo = new Project(cwd);\ntry {\n- repo.packageJson; // eslint-disable-line no-unused-expressions\n+ const repo = new Project(cwd); // eslint-disable-line no-unused-vars\n} catch (err) {\nexpect(err.name).toBe(\"ValidationError\");\nexpect(err.prefix).toBe(\"JSONError\");\n@@ -213,7 +202,7 @@ describe(\"Project\", () => {\nconst repo = new Project(testDir);\nexpect(repo.isIndependent()).toBe(false);\n- repo.lernaJson.version = \"independent\";\n+ repo.version = \"independent\";\nexpect(repo.isIndependent()).toBe(true);\n});\n});\n", "new_path": "core/project/__tests__/project.test.js", "old_path": "core/project/__tests__/project.test.js" }, { "change_type": "MODIFY", "diff": "\"use strict\";\n+const cosmiconfig = require(\"cosmiconfig\");\nconst dedent = require(\"dedent\");\n-const findUp = require(\"find-up\");\nconst globParent = require(\"glob-parent\");\nconst loadJsonFile = require(\"load-json-file\");\nconst log = require(\"npmlog\");\nconst path = require(\"path\");\n+const writeJsonFile = require(\"write-json-file\");\nconst ValidationError = require(\"@lerna/validation-error\");\nconst Package = require(\"@lerna/package\");\n@@ -14,43 +15,51 @@ const DEFAULT_PACKAGE_GLOB = \"packages/*\";\nclass Project {\nconstructor(cwd) {\n- const lernaJsonLocation =\n- // findUp returns null when not found\n- findUp.sync(\"lerna.json\", { cwd }) ||\n- // path.resolve(\".\", ...) starts from process.cwd()\n- path.resolve(cwd || \".\", \"lerna.json\");\n-\n- this.rootPath = path.dirname(lernaJsonLocation);\n- log.verbose(\"rootPath\", this.rootPath);\n+ const explorer = cosmiconfig(\"lerna\", {\n+ js: false, // not unless we store version somewhere else...\n+ rc: \"lerna.json\",\n+ rcStrictJson: true,\n+ sync: true,\n+ });\n- this.lernaJsonLocation = lernaJsonLocation;\n- this.packageJsonLocation = path.join(this.rootPath, \"package.json\");\n- }\n+ let loaded;\n- get lernaJson() {\n- if (!this._lernaJson) {\ntry {\n- this._lernaJson = loadJsonFile.sync(this.lernaJsonLocation);\n+ loaded = explorer.load(cwd);\n} catch (err) {\n// don't swallow syntax errors\nif (err.name === \"JSONError\") {\nthrow new ValidationError(err.name, err.message);\n}\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- this._lernaJson = {};\n- }\n- }\n+ config: {},\n+ // path.resolve(\".\", ...) starts from process.cwd()\n+ filepath: path.resolve(cwd || \".\", \"lerna.json\"),\n+ };\n- return this._lernaJson;\n+ this.config = loaded.config;\n+ this.rootPath = path.dirname(loaded.filepath);\n+ log.verbose(\"rootPath\", this.rootPath);\n+\n+ this.lernaConfigLocation = loaded.filepath;\n+ this.packageJsonLocation = path.join(this.rootPath, \"package.json\");\n}\nget version() {\n- return this.lernaJson.version;\n+ return this.config.version;\n+ }\n+\n+ set version(val) {\n+ this.config.version = val;\n}\nget packageConfigs() {\n- if (this.lernaJson.useWorkspaces) {\n+ if (this.config.useWorkspaces) {\nif (!this.packageJson.workspaces) {\nthrow new ValidationError(\n\"EWORKSPACES\",\n@@ -63,7 +72,8 @@ class Project {\nreturn this.packageJson.workspaces.packages || this.packageJson.workspaces;\n}\n- return this.lernaJson.packages || [DEFAULT_PACKAGE_GLOB];\n+\n+ return this.config.packages || [DEFAULT_PACKAGE_GLOB];\n}\nget packageParentDirs() {\n@@ -103,6 +113,13 @@ class Project {\nisIndependent() {\nreturn this.version === \"independent\";\n}\n+\n+ serializeConfig() {\n+ // TODO: might be package.json prop\n+ return writeJsonFile(this.lernaConfigLocation, this.config, { indent: 2, detectIndent: true }).then(\n+ () => this.lernaConfigLocation\n+ );\n+ }\n}\nmodule.exports = Project;\n", "new_path": "core/project/index.js", "old_path": "core/project/index.js" }, { "change_type": "MODIFY", "diff": "\"dependencies\": {\n\"@lerna/package\": \"file:../package\",\n\"@lerna/validation-error\": \"file:../validation-error\",\n+ \"cosmiconfig\": \"^4.0.0\",\n\"dedent\": \"^0.7.0\",\n- \"find-up\": \"^2.1.0\",\n\"glob-parent\": \"^3.1.0\",\n\"load-json-file\": \"^4.0.0\",\n- \"npmlog\": \"^4.1.2\"\n+ \"npmlog\": \"^4.1.2\",\n+ \"write-json-file\": \"^2.3.0\"\n}\n}\n", "new_path": "core/project/package.json", "old_path": "core/project/package.json" }, { "change_type": "MODIFY", "diff": "\"use strict\";\n-const fs = require(\"fs-extra\");\n-const path = require(\"path\");\n+const Project = require(\"@lerna/project\");\nmodule.exports = updateLernaConfig;\n/**\n- * Update a fixture lerna.json inside a test case.\n- *\n- * This method does not use load-json-file or write-json-file\n- * to avoid any mocks that may be in use on those modules.\n+ * Update lerna config inside a test case.\n*\n* @param {String} testDir where target lerna.json exists\n* @param {Object} updates mixed into existing JSON via Object.assign\n*/\nfunction updateLernaConfig(testDir, updates) {\n- const lernaJsonLocation = path.join(testDir, \"lerna.json\");\n+ const project = new Project(testDir);\n+\n+ Object.assign(project.config, updates);\n- return Promise.resolve()\n- .then(() => fs.readJSON(lernaJsonLocation))\n- .then(lernaJson => Object.assign(lernaJson, updates))\n- .then(lernaJson => fs.writeJSON(lernaJsonLocation, lernaJson, { spaces: 2 }));\n+ return project.serializeConfig();\n}\n", "new_path": "helpers/update-lerna-config/index.js", "old_path": "helpers/update-lerna-config/index.js" }, { "change_type": "MODIFY", "diff": "\"private\": true,\n\"license\": \"MIT\",\n\"dependencies\": {\n+ \"@lerna/project\": \"file:../../core/project\",\n\"fs-extra\": \"^5.0.0\"\n}\n}\n", "new_path": "helpers/update-lerna-config/package.json", "old_path": "helpers/update-lerna-config/package.json" }, { "change_type": "MODIFY", "diff": "\"version\": \"file:helpers/update-lerna-config\",\n\"dev\": true,\n\"requires\": {\n+ \"@lerna/project\": \"file:core/project\",\n\"fs-extra\": \"5.0.0\"\n}\n},\n\"requires\": {\n\"@lerna/package\": \"file:core/package\",\n\"@lerna/validation-error\": \"file:core/validation-error\",\n+ \"cosmiconfig\": \"4.0.0\",\n\"dedent\": \"0.7.0\",\n- \"find-up\": \"2.1.0\",\n\"glob-parent\": \"3.1.0\",\n\"load-json-file\": \"4.0.0\",\n- \"npmlog\": \"4.1.2\"\n+ \"npmlog\": \"4.1.2\",\n+ \"write-json-file\": \"2.3.0\"\n}\n},\n\"@lerna/prompt\": {\n\"version\": \"1.0.10\",\n\"resolved\": \"https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz\",\n\"integrity\": \"sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==\",\n- \"dev\": true,\n\"requires\": {\n\"sprintf-js\": \"1.0.3\"\n}\n\"resolved\": \"https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz\",\n\"integrity\": \"sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=\"\n},\n+ \"cosmiconfig\": {\n+ \"version\": \"4.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-4.0.0.tgz\",\n+ \"integrity\": \"sha512-6e5vDdrXZD+t5v0L8CrurPeybg4Fmf+FCSYxXKYVAqLUtyCSbuyqE059d0kDthTNRzKVjL7QMgNpEUlsoYH3iQ==\",\n+ \"requires\": {\n+ \"is-directory\": \"0.3.1\",\n+ \"js-yaml\": \"3.10.0\",\n+ \"parse-json\": \"4.0.0\",\n+ \"require-from-string\": \"2.0.1\"\n+ },\n+ \"dependencies\": {\n+ \"parse-json\": {\n+ \"version\": \"4.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz\",\n+ \"integrity\": \"sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=\",\n+ \"requires\": {\n+ \"error-ex\": \"1.3.1\",\n+ \"json-parse-better-errors\": \"1.0.1\"\n+ }\n+ }\n+ }\n+ },\n\"create-error-class\": {\n\"version\": \"3.0.2\",\n\"resolved\": \"https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz\",\n\"esprima\": {\n\"version\": \"4.0.0\",\n\"resolved\": \"https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz\",\n- \"integrity\": \"sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==\",\n- \"dev\": true\n+ \"integrity\": \"sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==\"\n},\n\"esquery\": {\n\"version\": \"1.0.0\",\n}\n}\n},\n+ \"is-directory\": {\n+ \"version\": \"0.3.1\",\n+ \"resolved\": \"https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz\",\n+ \"integrity\": \"sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=\"\n+ },\n\"is-dotfile\": {\n\"version\": \"1.0.3\",\n\"resolved\": \"https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz\",\n\"version\": \"3.10.0\",\n\"resolved\": \"https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz\",\n\"integrity\": \"sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==\",\n- \"dev\": true,\n\"requires\": {\n\"argparse\": \"1.0.10\",\n\"esprima\": \"4.0.0\"\n\"resolved\": \"https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz\",\n\"integrity\": \"sha1-jGStX9MNqxyXbiNE/+f3kqam30I=\"\n},\n+ \"require-from-string\": {\n+ \"version\": \"2.0.1\",\n+ \"resolved\": \"https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.1.tgz\",\n+ \"integrity\": \"sha1-xUUjPp19pmFunVmt+zn8n1iGdv8=\"\n+ },\n\"require-main-filename\": {\n\"version\": \"1.0.1\",\n\"resolved\": \"https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz\",\n\"sprintf-js\": {\n\"version\": \"1.0.3\",\n\"resolved\": \"https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz\",\n- \"integrity\": \"sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=\",\n- \"dev\": true\n+ \"integrity\": \"sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=\"\n},\n\"sshpk\": {\n\"version\": \"1.13.1\",\n", "new_path": "package-lock.json", "old_path": "package-lock.json" } ]
JavaScript
MIT License
lerna/lerna
feat(project): Use cosmiconfig to locate and read lerna.json
1
feat
project
807,849
22.03.2018 16:24:39
25,200
f1b578a8387d331519a41db4022a71703e7df1f5
docs(publish): update --ignore-changes references
[ { "change_type": "MODIFY", "diff": "@@ -300,7 +300,7 @@ More specifically, this command will:\n**Note:** to publish scoped packages, you need to add the following to each `package.json`:\n-```js\n+```json\n\"publishConfig\": {\n\"access\": \"public\"\n}\n@@ -533,7 +533,7 @@ Check which `packages` have changed since the last release (the last git tag).\nLerna determines the last git tag created and runs `git diff --name-only v6.8.1` to get all files changed since that tag. It then returns an array of packages that have an updated file.\n**Note that configuration for the `publish` command _also_ affects the\n-`updated` command. For example `config.publish.ignore`**\n+`updated` command. For example `command.publish.ignoreChanges`**\n#### --json\n@@ -722,12 +722,12 @@ Running `lerna` without arguments will show all commands/options.\n### lerna.json\n-```js\n+```json\n{\n\"version\": \"1.1.3\",\n\"commands\": {\n\"publish\": {\n- \"ignore\": [\n+ \"ignoreChanges\": [\n\"ignored-file\",\n\"*.md\"\n]\n@@ -740,9 +740,8 @@ Running `lerna` without arguments will show all commands/options.\n}\n```\n-* `lerna`: the current version of Lerna being used.\n* `version`: the current version of the repository.\n-* `commands.publish.ignore`: an array of globs that won't be included in `lerna updated/publish`. Use this to prevent publishing a new version unnecessarily for changes, such as fixing a `README.md` typo.\n+* `commands.publish.ignoreChanges`: an array of globs that won't be included in `lerna changed/publish`. Use this to prevent publishing a new version unnecessarily for changes, such as fixing a `README.md` typo.\n* `commands.bootstrap.ignore`: an array of globs that won't be bootstrapped when running the `lerna bootstrap` command.\n* `commands.bootstrap.scope`: an array of globs that restricts which packages will be bootstrapped when running the `lerna bootstrap` command.\n* `packages`: Array of globs to use as package locations.\n@@ -893,7 +892,7 @@ The `ignore` flag, when used with the `bootstrap` command, can also be set in `l\n**Example**\n-```javascript\n+```json\n{\n\"version\": \"0.0.0\",\n\"commands\": {\n", "new_path": "README.md", "old_path": "README.md" }, { "change_type": "MODIFY", "diff": "@@ -80,7 +80,7 @@ describe(\"ChangedCommand\", () => {\ncommands: {\n// \"command\" also supported\npublish: {\n- ignore: [\"ignored-file\"],\n+ ignoreChanges: [\"ignored-file\"],\n},\n},\n});\n", "new_path": "commands/changed/__tests__/changed-command.test.js", "old_path": "commands/changed/__tests__/changed-command.test.js" } ]
JavaScript
MIT License
lerna/lerna
docs(publish): update --ignore-changes references
1
docs
publish
807,849
22.03.2018 16:30:08
25,200
24e55e3e1a08bb5ef9c7d63fc2b749d15d61efac
feat(project): Normalize config.commands -> config.command
[ { "change_type": "MODIFY", "diff": "@@ -172,7 +172,7 @@ It will configure `lerna.json` to enforce exact match for all subsequent executi\n```json\n{\n- \"commands\": {\n+ \"command\": {\n\"init\": {\n\"exact\": true\n}\n@@ -482,7 +482,7 @@ This can be configured in lerna.json, as well:\n```json\n{\n- \"commands\": {\n+ \"command\": {\n\"publish\": {\n\"message\": \"chore(release): publish %s\"\n}\n@@ -498,7 +498,7 @@ If your `lerna.json` contains something like this:\n```json\n{\n- \"commands\": {\n+ \"command\": {\n\"publish\": {\n\"allowBranch\": \"master\"\n}\n@@ -725,7 +725,7 @@ Running `lerna` without arguments will show all commands/options.\n```json\n{\n\"version\": \"1.1.3\",\n- \"commands\": {\n+ \"command\": {\n\"publish\": {\n\"ignoreChanges\": [\n\"ignored-file\",\n@@ -741,9 +741,9 @@ Running `lerna` without arguments will show all commands/options.\n```\n* `version`: the current version of the repository.\n-* `commands.publish.ignoreChanges`: an array of globs that won't be included in `lerna changed/publish`. Use this to prevent publishing a new version unnecessarily for changes, such as fixing a `README.md` typo.\n-* `commands.bootstrap.ignore`: an array of globs that won't be bootstrapped when running the `lerna bootstrap` command.\n-* `commands.bootstrap.scope`: an array of globs that restricts which packages will be bootstrapped when running the `lerna bootstrap` command.\n+* `command.publish.ignoreChanges`: an array of globs that won't be included in `lerna changed/publish`. Use this to prevent publishing a new version unnecessarily for changes, such as fixing a `README.md` typo.\n+* `command.bootstrap.ignore`: an array of globs that won't be bootstrapped when running the `lerna bootstrap` command.\n+* `command.bootstrap.scope`: an array of globs that restricts which packages will be bootstrapped when running the `lerna bootstrap` command.\n* `packages`: Array of globs to use as package locations.\n### Common `devDependencies`\n@@ -816,7 +816,7 @@ Example:\n{\n\"version\": \"1.2.0\",\n\"exampleOption\": \"foo\",\n- \"commands\": {\n+ \"command\": {\n\"init\": {\n\"exampleOption\": \"bar\"\n}\n@@ -888,14 +888,14 @@ Excludes a subset of packages when running a command.\n$ lerna bootstrap --ignore component-*\n```\n-The `ignore` flag, when used with the `bootstrap` command, can also be set in `lerna.json` under the `commands.bootstrap` key. The command-line flag will take precedence over this option.\n+The `ignore` flag, when used with the `bootstrap` command, can also be set in `lerna.json` under the `command.bootstrap` key. The command-line flag will take precedence over this option.\n**Example**\n```json\n{\n\"version\": \"0.0.0\",\n- \"commands\": {\n+ \"command\": {\n\"bootstrap\": {\n\"ignore\": \"component-*\"\n}\n", "new_path": "README.md", "old_path": "README.md" }, { "change_type": "MODIFY", "diff": "@@ -319,7 +319,6 @@ describe(\"BootstrapCommand\", () => {\nawait updateLernaConfig(testDir, {\ncommand: {\n- // \"commands\" also supported\nbootstrap: {\nhoist: true,\n},\n", "new_path": "commands/bootstrap/__tests__/bootstrap-command.test.js", "old_path": "commands/bootstrap/__tests__/bootstrap-command.test.js" }, { "change_type": "MODIFY", "diff": "@@ -77,8 +77,7 @@ describe(\"ChangedCommand\", () => {\nconst testDir = await initFixture(\"basic\");\nawait updateLernaConfig(testDir, {\n- commands: {\n- // \"command\" also supported\n+ command: {\npublish: {\nignoreChanges: [\"ignored-file\"],\n},\n@@ -150,7 +149,6 @@ describe(\"ChangedCommand\", () => {\nawait updateLernaConfig(testDir, {\ncommand: {\n- // \"commands\" also supported\npublish: {\nignore: [\"ignored-file\"],\n},\n", "new_path": "commands/changed/__tests__/changed-command.test.js", "old_path": "commands/changed/__tests__/changed-command.test.js" }, { "change_type": "MODIFY", "diff": "@@ -210,7 +210,7 @@ describe(\"InitCommand\", () => {\n});\ndescribe(\"when re-initializing with --exact\", () => {\n- it(\"sets lerna.json commands.init.exact to true\", async () => {\n+ it(\"sets lerna.json command.init.exact to true\", async () => {\nconst testDir = await initFixture(\"updates\");\nconst lernaJsonPath = path.join(testDir, \"lerna.json\");\nconst pkgJsonPath = path.join(testDir, \"package.json\");\n@@ -233,7 +233,7 @@ describe(\"InitCommand\", () => {\nawait lernaInit(testDir)(\"--exact\");\nexpect(await fs.readJSON(lernaJsonPath)).toEqual({\n- commands: {\n+ command: {\nbootstrap: {\nhoist: true,\n},\n", "new_path": "commands/init/__tests__/init-command.test.js", "old_path": "commands/init/__tests__/init-command.test.js" }, { "change_type": "MODIFY", "diff": "@@ -110,7 +110,7 @@ class InitCommand extends Command {\nif (this.exact) {\n// ensure --exact is preserved for future init commands\n- const commandConfig = config.commands || config.command || (config.command = {});\n+ const commandConfig = config.command || (config.command = {});\nconst initConfig = commandConfig.init || (commandConfig.init = {});\ninitConfig.exact = true;\n", "new_path": "commands/init/index.js", "old_path": "commands/init/index.js" }, { "change_type": "MODIFY", "diff": "@@ -103,20 +103,18 @@ class Command {\n}\nconfigureOptions() {\n- // Command config object is either \"commands\" or \"command\".\n- const { commands, command } = this.repository.config;\n+ // Command config object normalized to \"command\" namespace\n+ const commandConfig = this.repository.config.command || {};\n// The current command always overrides otherCommandConfigs\n- const lernaCommandOverrides = [this.name, ...this.otherCommandConfigs].map(\n- name => (commands || command || {})[name]\n- );\n+ const overrides = [this.name, ...this.otherCommandConfigs].map(key => commandConfig[key]);\nthis.options = _.defaults(\n{},\n// CLI flags, which if defined overrule subsequent values\nthis._argv,\n// Namespaced command options from `lerna.json`\n- ...lernaCommandOverrides,\n+ ...overrides,\n// Global options from `lerna.json`\nthis.repository.config,\n// Command specific defaults\n", "new_path": "core/command/index.js", "old_path": "core/command/index.js" }, { "change_type": "MODIFY", "diff": "@@ -20,6 +20,15 @@ class Project {\nrc: \"lerna.json\",\nrcStrictJson: true,\nsync: true,\n+ transform: obj => {\n+ // normalize command-specific config namespace\n+ if (obj.config.commands) {\n+ obj.config.command = obj.config.commands;\n+ delete obj.config.commands;\n+ }\n+\n+ return obj;\n+ },\n});\nlet loaded;\n", "new_path": "core/project/index.js", "old_path": "core/project/index.js" }, { "change_type": "MODIFY", "diff": "@@ -30,7 +30,7 @@ lerna success Initialized Lerna files\nexports[`lerna init updates existing metadata: lerna.json 1`] = `\nObject {\n- commands: Object {\n+ command: Object {\nbootstrap: Object {\nhoist: true,\n},\n", "new_path": "integration/__snapshots__/lerna-init.test.js.snap", "old_path": "integration/__snapshots__/lerna-init.test.js.snap" } ]
JavaScript
MIT License
lerna/lerna
feat(project): Normalize config.commands -> config.command
1
feat
project
807,849
22.03.2018 17:05:32
25,200
43e98a0292dba6257071a2b2d595747fcbbf3c6f
feat(command): Rename this.repository -> this.project
[ { "change_type": "MODIFY", "diff": "@@ -80,7 +80,7 @@ class AddCommand extends Command {\nreturn BootstrapCommand.handler(\nObject.assign({}, this.options, {\nargs: [],\n- cwd: this.repository.rootPath,\n+ cwd: this.project.rootPath,\nscope: pkgs,\n})\n);\n", "new_path": "commands/add/index.js", "old_path": "commands/add/index.js" }, { "change_type": "MODIFY", "diff": "@@ -39,11 +39,7 @@ class BootstrapCommand extends Command {\n);\n}\n- if (\n- npmClient === \"yarn\" &&\n- this.repository.packageJson.workspaces &&\n- this.options.useWorkspaces !== true\n- ) {\n+ if (npmClient === \"yarn\" && this.project.packageJson.workspaces && this.options.useWorkspaces !== true) {\nthrow new ValidationError(\n\"EWORKSPACES\",\ndedent`\n@@ -115,7 +111,7 @@ class BootstrapCommand extends Command {\ninstallRootPackageOnly() {\nconst tracker = this.logger.newItem(\"install dependencies\");\n- return npmInstall(this.repository.package, this.npmConfig).then(() => {\n+ return npmInstall(this.project.package, this.npmConfig).then(() => {\ntracker.info(\"hoist\", \"Finished installing in root\");\ntracker.finish();\n});\n@@ -190,7 +186,7 @@ class BootstrapCommand extends Command {\n}\nhoistedDirectory(dependency) {\n- return path.join(this.repository.rootPath, \"node_modules\", dependency);\n+ return path.join(this.project.rootPath, \"node_modules\", dependency);\n}\nhoistedPackageJson(dependency) {\n@@ -211,7 +207,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.repository.package;\n+ const rootPkg = this.project.package;\nlet hoisting;\n@@ -382,7 +378,7 @@ class BootstrapCommand extends Command {\n*/\ninstallExternalDependencies({ leaves, rootSet }) {\nconst tracker = this.logger.newItem(\"install dependencies\");\n- const rootPkg = this.repository.package;\n+ const rootPkg = this.project.package;\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": "@@ -22,7 +22,7 @@ class CleanCommand extends Command {\nthis.logger.info(\"\", \"Removing the following directories:\");\nthis.logger.info(\n\"clean\",\n- this.directoriesToDelete.map(dir => path.relative(this.repository.rootPath, dir)).join(\"\\n\")\n+ this.directoriesToDelete.map(dir => path.relative(this.project.rootPath, dir)).join(\"\\n\")\n);\nreturn PromptUtilities.confirm(\"Proceed?\");\n", "new_path": "commands/clean/index.js", "old_path": "commands/clean/index.js" }, { "change_type": "MODIFY", "diff": "@@ -53,8 +53,8 @@ class CreateCommand extends Command {\nthis.dirName = scope ? name.split(\"/\").pop() : name;\nthis.pkgName = name;\nthis.pkgsDir =\n- this.repository.packageParentDirs.find(pd => pd.indexOf(pkgLocation) > -1) ||\n- this.repository.packageParentDirs[0];\n+ this.project.packageParentDirs.find(pd => pd.indexOf(pkgLocation) > -1) ||\n+ this.project.packageParentDirs[0];\nthis.camelName = camelCase(this.dirName);\n@@ -90,8 +90,8 @@ class CreateCommand extends Command {\n}\n// allow default init-version when independent versioning enabled\n- if (!this.repository.isIndependent()) {\n- this.conf.set(\"init-version\", this.repository.version);\n+ if (!this.project.isIndependent()) {\n+ this.conf.set(\"init-version\", this.project.version);\n}\n// default author metadata with git config\n@@ -282,7 +282,7 @@ class CreateCommand extends Command {\nsetHomepage() {\n// allow --homepage override, but otherwise use root pkg.homepage, if it exists\n- let { homepage = this.repository.package.json.homepage } = this.options;\n+ let { homepage = this.project.package.json.homepage } = this.options;\nif (!homepage) {\n// normalize-package-data will backfill from hosted-git-info, if possible\n@@ -295,7 +295,7 @@ class CreateCommand extends Command {\n}\nconst hurl = new URL(homepage);\n- const relativeTarget = path.relative(this.repository.rootPath, this.targetDir);\n+ const relativeTarget = path.relative(this.project.rootPath, this.targetDir);\nif (hurl.hostname.match(\"github\")) {\nhurl.pathname = path.posix.join(hurl.pathname, \"tree/master\", relativeTarget);\n", "new_path": "commands/create/index.js", "old_path": "commands/create/index.js" }, { "change_type": "MODIFY", "diff": "@@ -32,7 +32,7 @@ class DiffCommand extends Command {\nif (targetPackage) {\nargs.push(\"--\", targetPackage.location);\n} else {\n- args.push(\"--\", ...this.repository.packageParentDirs);\n+ args.push(\"--\", ...this.project.packageParentDirs);\n}\nif (this.options.ignoreChanges) {\n", "new_path": "commands/diff/index.js", "old_path": "commands/diff/index.js" }, { "change_type": "MODIFY", "diff": "@@ -61,7 +61,7 @@ class ExecCommand extends Command {\nshell: true,\nenv: Object.assign({}, process.env, {\nLERNA_PACKAGE_NAME: pkg.name,\n- LERNA_ROOT_PATH: this.repository.rootPath,\n+ LERNA_ROOT_PATH: this.project.rootPath,\n}),\nreject: this.options.bail,\n};\n", "new_path": "commands/exec/index.js", "old_path": "commands/exec/index.js" }, { "change_type": "MODIFY", "diff": "@@ -55,17 +55,17 @@ class ImportCommand extends Command {\nthrow new Error(`No package name specified in \"${packageJson}\"`);\n}\n- const targetBase = getTargetBase(this.repository.packageConfigs);\n+ const targetBase = getTargetBase(this.project.packageConfigs);\n// Compute a target directory relative to the Lerna root\nconst targetDir = path.join(targetBase, externalRepoBase);\n// Compute a target directory relative to the Git root\nconst gitRepoRoot = GitUtilities.getWorkspaceRoot(this.execOpts);\n- const lernaRootRelativeToGitRoot = path.relative(gitRepoRoot, this.repository.rootPath);\n+ const lernaRootRelativeToGitRoot = path.relative(gitRepoRoot, this.project.rootPath);\nthis.targetDirRelativeToGitRoot = path.join(lernaRootRelativeToGitRoot, targetDir);\n- if (fs.existsSync(path.resolve(this.repository.rootPath, targetDir))) {\n+ if (fs.existsSync(path.resolve(this.project.rootPath, targetDir))) {\nthrow new Error(`Target directory already exists \"${targetDir}\"`);\n}\n", "new_path": "commands/import/index.js", "old_path": "commands/import/index.js" }, { "change_type": "MODIFY", "diff": "@@ -47,7 +47,7 @@ class InitCommand extends Command {\n}\nensurePackageJSON() {\n- let { packageJson } = this.repository;\n+ let { packageJson } = this.project;\nlet chain = Promise.resolve();\nif (!packageJson) {\n@@ -58,9 +58,7 @@ class InitCommand extends Command {\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(() =>\n- writeJsonFile(this.repository.packageJsonLocation, packageJson, { indent: 2 })\n- );\n+ chain = chain.then(() => writeJsonFile(this.project.packageJsonLocation, packageJson, { indent: 2 }));\n} else {\nthis.logger.info(\"\", \"Updating package.json\");\n}\n@@ -81,14 +79,14 @@ class InitCommand extends Command {\ntargetDependencies.lerna = this.exact ? this.lernaVersion : `^${this.lernaVersion}`;\n- chain = chain.then(() => writePkg(this.repository.packageJsonLocation, packageJson));\n+ chain = chain.then(() => writePkg(this.project.packageJsonLocation, packageJson));\nreturn chain;\n}\nensureLernaConfig() {\n// config already defaulted to empty object in Project constructor\n- const { config, version: projectVersion } = this.repository;\n+ const { config, version: projectVersion } = this.project;\nlet version;\n@@ -117,17 +115,17 @@ class InitCommand extends Command {\n}\nObject.assign(config, {\n- packages: this.repository.packageConfigs,\n+ packages: this.project.packageConfigs,\nversion,\n});\n- return this.repository.serializeConfig();\n+ return this.project.serializeConfig();\n}\nensurePackagesDir() {\nthis.logger.info(\"\", \"Creating packages directory\");\n- return pMap(this.repository.packageParentDirs, dir => fs.mkdirp(dir));\n+ return pMap(this.project.packageParentDirs, dir => fs.mkdirp(dir));\n}\n}\n", "new_path": "commands/init/index.js", "old_path": "commands/init/index.js" }, { "change_type": "MODIFY", "diff": "@@ -57,8 +57,8 @@ class PublishCommand extends Command {\nthis.shortHash = GitUtilities.getShortSHA(this.execOpts);\n}\n- if (!this.repository.isIndependent()) {\n- this.logger.info(\"current version\", this.repository.version);\n+ if (!this.project.isIndependent()) {\n+ this.logger.info(\"current version\", this.project.version);\n}\n// git validation, if enabled, should happen before updates are calculated and versions picked\n@@ -145,7 +145,7 @@ class PublishCommand extends Command {\nexecute() {\nconst tasks = [];\n- if (!this.repository.isIndependent() && !this.options.canary) {\n+ if (!this.project.isIndependent() && !this.options.canary) {\ntasks.push(() => this.updateVersionInLernaJson());\n}\n@@ -211,7 +211,7 @@ class PublishCommand extends Command {\n// reset since the package.json files are changed (by gitHead if not --canary)\nchain = chain.then(() =>\n- pReduce(this.repository.packageConfigs, (_, pkgGlob) =>\n+ pReduce(this.project.packageConfigs, (_, pkgGlob) =>\nGitUtilities.checkoutChanges(`${pkgGlob}/package.json`, this.execOpts)\n)\n);\n@@ -266,8 +266,8 @@ class PublishCommand extends Command {\npredicate = this.promptVersion;\n}\n- if (!this.repository.isIndependent()) {\n- predicate = Promise.resolve(predicate({ version: this.repository.version })).then(\n+ if (!this.project.isIndependent()) {\n+ predicate = Promise.resolve(predicate({ version: this.project.version })).then(\nmakeGlobalVersionPredicate\n);\n}\n@@ -283,7 +283,7 @@ class PublishCommand extends Command {\n}\nrecommendVersions() {\n- const independentVersions = this.repository.isIndependent();\n+ const independentVersions = this.project.isIndependent();\nconst { changelogPreset } = this.options;\nconst opts = { changelogPreset };\nconst type = independentVersions ? \"independent\" : \"fixed\";\n@@ -292,7 +292,7 @@ class PublishCommand extends Command {\nif (type === \"fixed\") {\nchain = chain.then(() => {\n- const globalVersion = this.repository.version;\n+ const globalVersion = this.project.version;\nfor (const { pkg } of this.updates) {\nif (semver.lt(pkg.version, globalVersion)) {\n@@ -313,7 +313,7 @@ class PublishCommand extends Command {\nif (type === \"fixed\") {\nchain = chain.then(versions => {\n- let highestVersion = this.repository.version;\n+ let highestVersion = this.project.version;\nversions.forEach(bump => {\nif (semver.gt(bump, highestVersion)) {\n@@ -402,9 +402,9 @@ class PublishCommand extends Command {\n}\nupdateVersionInLernaJson() {\n- this.repository.version = this.globalVersion;\n+ this.project.version = this.globalVersion;\n- return this.repository.serializeConfig().then(lernaConfigLocation => {\n+ return this.project.serializeConfig().then(lernaConfigLocation => {\nif (!this.options.skipGit) {\nreturn GitUtilities.addFiles([lernaConfigLocation], this.execOpts);\n}\n@@ -421,8 +421,8 @@ class PublishCommand extends Command {\nupdateUpdatedPackages() {\nconst { conventionalCommits, changelogPreset } = this.options;\n- const independentVersions = this.repository.isIndependent();\n- const rootPkg = this.repository.package;\n+ const independentVersions = this.project.isIndependent();\n+ const rootPkg = this.project.package;\nconst changedFiles = new Set();\n// my kingdom for async await :(\n@@ -513,7 +513,7 @@ class PublishCommand extends Command {\ncommitAndTagUpdates() {\nlet chain = Promise.resolve();\n- if (this.repository.isIndependent()) {\n+ if (this.project.isIndependent()) {\nchain = chain.then(() => this.gitCommitAndTagVersionForUpdates());\n} else {\nchain = chain.then(() => this.gitCommitAndTagVersion());\n@@ -527,7 +527,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.repository.package, \"postversion\"));\n+ chain = chain.then(() => this.runPackageLifecycle(this.project.package, \"postversion\"));\nreturn chain;\n}\n", "new_path": "commands/publish/index.js", "old_path": "commands/publish/index.js" }, { "change_type": "MODIFY", "diff": "@@ -39,7 +39,7 @@ class Command {\nlet chain = Promise.resolve();\nchain = chain.then(() => {\n- this.repository = new Project(argv.cwd);\n+ this.project = new Project(argv.cwd);\n});\nchain = chain.then(() => this.configureOptions());\nchain = chain.then(() => this.configureProperties());\n@@ -66,7 +66,7 @@ class Command {\n// ValidationError does not trigger a log dump\nif (err.name !== \"ValidationError\") {\n- writeLogFile(this.repository.rootPath);\n+ writeLogFile(this.project.rootPath);\n}\nwarnIfHanging();\n@@ -104,7 +104,7 @@ class Command {\nconfigureOptions() {\n// Command config object normalized to \"command\" namespace\n- const commandConfig = this.repository.config.command || {};\n+ const commandConfig = this.project.config.command || {};\n// The current command always overrides otherCommandConfigs\nconst overrides = [this.name, ...this.otherCommandConfigs].map(key => commandConfig[key]);\n@@ -116,7 +116,7 @@ class Command {\n// Namespaced command options from `lerna.json`\n...overrides,\n// Global options from `lerna.json`\n- this.repository.config,\n+ this.project.config,\n// Command specific defaults\nthis.defaultOptions\n);\n@@ -128,7 +128,7 @@ class Command {\nthis.concurrency = Math.max(1, +concurrency || DEFAULT_CONCURRENCY);\nthis.toposort = sort === undefined || sort;\nthis.execOpts = {\n- cwd: this.repository.rootPath,\n+ cwd: this.project.rootPath,\nmaxBuffer,\n};\n}\n@@ -158,15 +158,15 @@ class Command {\nthrow new ValidationError(\"ENOGIT\", \"The git binary was not found, or this is not a git repository.\");\n}\n- if (!this.repository.packageJson) {\n+ if (!this.project.packageJson) {\nthrow new ValidationError(\"ENOPKG\", \"`package.json` does not exist, have you run `lerna init`?\");\n}\n- if (!this.repository.version) {\n+ if (!this.project.version) {\nthrow new ValidationError(\"ENOLERNA\", \"`lerna.json` does not exist, have you run `lerna init`?\");\n}\n- if (this.options.independent && !this.repository.isIndependent()) {\n+ if (this.options.independent && !this.project.isIndependent()) {\nthrow new ValidationError(\n\"EVERSIONMODE\",\ndedent`\n@@ -179,11 +179,11 @@ class Command {\n}\nrunPreparations() {\n- if (this.repository.isIndependent()) {\n+ if (this.project.isIndependent()) {\nlog.info(\"versioning\", \"independent\");\n}\n- const { rootPath, packageConfigs } = this.repository;\n+ const { rootPath, packageConfigs } = this.project;\nconst { scope: include, ignore: exclude } = this.options;\nlet chain = Promise.resolve();\n", "new_path": "core/command/index.js", "old_path": "core/command/index.js" } ]
JavaScript
MIT License
lerna/lerna
feat(command): Rename this.repository -> this.project
1
feat
command
217,922
22.03.2018 17:07:54
-3,600
0e72803af568085c4786c1978394d493c91300ad
fix: error when creating a new layout and cancelling the dialog box
[ { "change_type": "MODIFY", "diff": "@@ -18,13 +18,7 @@ export class ListLayoutPopupComponent {\npublic availableLayouts: ListLayout[];\n- public get selectedIndex(): number {\n- return +(localStorage.getItem('layout:selected') || 0);\n- }\n-\n- public set selectedIndex(index: number) {\n- localStorage.setItem('layout:selected', index.toString());\n- }\n+ public selectedIndex = 0;\nconstructor(public layoutService: LayoutService, private dialogRef: MatDialogRef<ListLayoutPopupComponent>,\nprivate dialog: MatDialog, private snackBar: MatSnackBar, private translator: TranslateService,\n@@ -32,6 +26,7 @@ export class ListLayoutPopupComponent {\nthis.layoutService.layouts.subscribe(layouts => {\nthis.availableLayouts = layouts;\n});\n+ this.selectedIndex = +(localStorage.getItem('layout:selected') || 0);\n}\npublic newLayout(): void {\n@@ -50,6 +45,7 @@ export class ListLayoutPopupComponent {\n}\npublic save(): void {\n+ localStorage.setItem('layout:selected', this.selectedIndex.toString());\nthis.layoutService.persist(this.availableLayouts).subscribe(() => {\nthis.dialogRef.close();\n});\n", "new_path": "src/app/pages/list/list-layout-popup/list-layout-popup.component.ts", "old_path": "src/app/pages/list/list-layout-popup/list-layout-popup.component.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix: error when creating a new layout and cancelling the dialog box
1
fix
null
821,196
22.03.2018 17:50:47
25,200
f8337999b5a22cbe9bfa90a7d7a026a1a15a333b
fix: document yarn flag
[ { "change_type": "MODIFY", "diff": "@@ -5,7 +5,7 @@ import Base from './command_base'\nexport default abstract class AppCommand extends Base {\nstatic flags = {\ndefaults: flags.boolean({description: 'use defaults for every setting'}),\n- options: flags.string({description: '(typescript|tslint|semantic-release|mocha)'}),\n+ options: flags.string({description: '(yarn|typescript|tslint|semantic-release|mocha)'}),\nforce: flags.boolean({description: 'overwrite existing files'}),\n}\nstatic args = [\n", "new_path": "src/app_command.ts", "old_path": "src/app_command.ts" } ]
TypeScript
MIT License
oclif/oclif
fix: document yarn flag
1
fix
null
821,196
22.03.2018 18:18:46
25,200
6e4cdc24039e3f9eb8cc67f612eac996ccd67a97
docs: update getting started links
[ { "change_type": "MODIFY", "diff": "-Moved to https://oclif.io/docs/introduction.html\n+Moved to http://oclif.io/docs/introduction.html\n", "new_path": "GETTING_STARTED.md", "old_path": "GETTING_STARTED.md" } ]
TypeScript
MIT License
oclif/oclif
docs: update getting started links
1
docs
null
807,849
22.03.2018 18:25:34
25,200
503251d37857bec886698008e0d9d6f5f64d76e1
fix(filter-options): Move include/exclude validation into filter-packages
[ { "change_type": "MODIFY", "diff": "@@ -10,28 +10,10 @@ function filterOptions(yargs) {\nscope: {\ndescribe: \"Include only packages with names matching the given glob.\",\ntype: \"string\",\n- requiresArg: true,\n- coerce: arg => {\n- // always return a list of globs\n- if (!Array.isArray(arg)) {\n- return [arg];\n- }\n-\n- return arg;\n- },\n},\nignore: {\ndescribe: \"Exclude packages with names matching the given glob.\",\ntype: \"string\",\n- requiresArg: true,\n- coerce: arg => {\n- // negate any globs passed\n- if (!Array.isArray(arg)) {\n- return [`!${arg}`];\n- }\n-\n- return arg.map(str => `!${str}`);\n- },\n},\nprivate: {\ndescribe: \"Include private packages. Pass --no-private to exclude private packages.\",\n", "new_path": "core/filter-options/index.js", "old_path": "core/filter-options/index.js" }, { "change_type": "MODIFY", "diff": "@@ -21,7 +21,7 @@ module.exports = filterPackages;\n*/\nfunction filterPackages(packagesToFilter, include = [], exclude = [], showPrivate) {\nconst filtered = new Set(packagesToFilter);\n- const patterns = [].concat(include, exclude);\n+ const patterns = [].concat(arrify(include), negate(exclude));\nif (showPrivate === false) {\nfor (const pkg of filtered) {\n@@ -56,3 +56,19 @@ function filterPackages(packagesToFilter, include = [], exclude = [], showPrivat\nreturn Array.from(filtered);\n}\n+\n+function arrify(thing) {\n+ if (!thing) {\n+ return [];\n+ }\n+\n+ if (!Array.isArray(thing)) {\n+ return [thing];\n+ }\n+\n+ return thing;\n+}\n+\n+function negate(patterns) {\n+ return arrify(patterns).map(pattern => `!${pattern}`);\n+}\n", "new_path": "utils/filter-packages/filter-packages.js", "old_path": "utils/filter-packages/filter-packages.js" } ]
JavaScript
MIT License
lerna/lerna
fix(filter-options): Move include/exclude validation into filter-packages
1
fix
filter-options
217,922
22.03.2018 20:09:11
-3,600
d97bc193f4555741569128b4e599a7b3e9bb44ff
fix: list page slower with zone breakdown
[ { "change_type": "MODIFY", "diff": "(click)=\"openRequirementsPopup()\">\n<mat-icon color=\"accent\">assignment</mat-icon>\n</button>\n- <mat-icon *ngIf=\"!hasBook()\" matTooltip=\"{{'LIST_DETAILS.No_book' | translate}}\" matTooltipPosition=\"above\"\n+ <mat-icon *ngIf=\"!hasBook\" matTooltip=\"{{'LIST_DETAILS.No_book' | translate}}\" matTooltipPosition=\"above\"\ncolor=\"warn\">\nwarning\n</mat-icon>\n(cbOnSuccess)=\"afterNameCopy(item.id)\">{{item.id | itemName | i18n}}</span>\n<app-comments-button [name]=\"item.id | itemName | i18n\" [row]=\"item\" [list]=\"list\"\n[isOwnList]=\"user?.$key === list?.authorId\"></app-comments-button>\n- <mat-icon *ngIf=\"!hasBook()\" matTooltip=\"{{'LIST_DETAILS.No_book' | translate}}\" matTooltipPosition=\"above\"\n+ <mat-icon *ngIf=\"!hasBook\" matTooltip=\"{{'LIST_DETAILS.No_book' | translate}}\" matTooltipPosition=\"above\"\ncolor=\"warn\">\nwarning\n</mat-icon>\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": "@@ -249,6 +249,8 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\nhasTimers = false;\n+ hasBook = true;\n+\n/**\n* Expansion is the state of the \"add amount\" input field (shown or not).\n*/\n@@ -301,6 +303,7 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\nthis.updateHasTimers();\nthis.updateMasterBooks();\nthis.updateTimers();\n+ this.updateHasBook();\nif (this.item.workingOnIt !== undefined) {\nthis.userService.get(this.item.workingOnIt)\n.mergeMap(user => this.dataService.getCharacter(user.lodestoneId)).subscribe(char => {\n@@ -310,6 +313,18 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\n}\n}\n+ ngOnChanges(changes: SimpleChanges): void {\n+ this.updateCanBeCrafted();\n+ this.updateHasTimers();\n+ this.updateMasterBooks();\n+ this.updateTimers();\n+ this.updateHasBook();\n+ if (this.item.workingOnIt !== undefined && this.worksOnIt === undefined) {\n+ this.userService.get(this.item.workingOnIt)\n+ .mergeMap(user => this.dataService.getCharacter(user.lodestoneId)).subscribe(char => this.worksOnIt = char);\n+ }\n+ }\n+\npublic workOnIt(): void {\nthis.item.workingOnIt = this.user.$key;\nthis.update.emit();\n@@ -339,7 +354,6 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\n* Adds addition value to current done amount.\n*/\npublic addAddition() {\n-\nthis.setDone(this.item, this.item.done + this.addition, this.item.done);\nthis.expanded = !this.expanded;\nthis.addition = 0;\n@@ -366,17 +380,6 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\n})\n}\n- ngOnChanges(changes: SimpleChanges): void {\n- this.updateCanBeCrafted();\n- this.updateHasTimers();\n- this.updateMasterBooks();\n- this.updateTimers();\n- if (this.item.workingOnIt !== undefined && this.worksOnIt === undefined) {\n- this.userService.get(this.item.workingOnIt)\n- .mergeMap(user => this.dataService.getCharacter(user.lodestoneId)).subscribe(char => this.worksOnIt = char);\n- }\n- }\n-\nupdateCanBeCrafted(): void {\n// this.item.done < this.item.amount check is made to avoid item being cmarked as craftable while you already crafted it.\nthis.canBeCrafted = this.list.canBeCrafted(this.item) && this.item.done < this.item.amount;\n@@ -435,26 +438,30 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\nthis.masterbooks = res;\n}\n- public hasBook(): boolean {\n+ public updateHasBook(): boolean {\n// If we're loading the user or he's undefined, we can't provide this service so we assume he can craft it.\nif (this.user === undefined || this.user.anonymous) {\n- return true;\n+ this.hasBook = true;\n+ return;\n}\n// If this is a craft\nif (this.item.craftedBy !== undefined) {\nconst books = this.masterbooks;\n// If there's no book for this item, it means that the user can craft it for sure.\nif (books.length === 0) {\n- return true;\n+ this.hasBook = true;\n+ return;\n}\n// If the user has at least one of the required books, it's okay.\nfor (const book of books) {\nif ((this.user.masterbooks || []).indexOf(book.id) > -1 || book.id.toString().indexOf('draft') > -1) {\n- return true;\n+ this.hasBook = true;\n+ return;\n}\n}\n// Else, he can't craft the item, put a warning on it.\n- return false;\n+ this.hasBook = false;\n+ return;\n}\n// If this is a gathering\nif (this.item.gatheredBy !== undefined && this.item.gatheredBy.nodes.length > 0) {\n@@ -464,12 +471,14 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\nif (node.limitType !== undefined) {\nconst folkloreId = Object.keys(folklores).find(id => folklores[id].indexOf(this.item.id) > -1);\nif (folkloreId !== undefined) {\n- return (this.user.masterbooks || []).indexOf(+folkloreId) > -1;\n+ this.hasBook = (this.user.masterbooks || []).indexOf(+folkloreId) > -1;\n+ return;\n}\n}\n}\n}\n- return true;\n+ this.hasBook = true;\n+ return;\n}\npublic setDone(row: ListRow, amount: number, done: number) {\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": "</button>\n</div>\n<mat-divider class=\"zone-divider\"></mat-divider>\n- <div *ngFor=\"let item of uniquify(row.items); trackBy: trackByFn; let i = index\"\n+ <div *ngFor=\"let item of row.items; trackBy: trackByFn; let i = index\"\n[ngClass]=\"{compact: settings.compactLists}\">\n<app-item [list]=\"list\"\n[user]=\"user\"\n", "new_path": "src/app/pages/list/list-details-panel/list-details-panel.component.html", "old_path": "src/app/pages/list/list-details-panel/list-details-panel.component.html" }, { "change_type": "MODIFY", "diff": "@@ -82,10 +82,6 @@ export class ListDetailsPanelComponent implements OnChanges, OnInit {\n}\n}\n- public uniquify(items: ListRow[]): ListRow[] {\n- return items.filter((value, index, array) => array.filter(row => row.id === value.id).length === 1);\n- }\n-\npublic getLocation(id: number): I18nName {\nif (id === -1) {\nreturn {fr: 'Autre', de: 'Anderes', ja: 'Other', en: 'Other'};\n@@ -151,7 +147,7 @@ export class ListDetailsPanelComponent implements OnChanges, OnInit {\npublic openNavigationMap(zoneBreakdownRow: ZoneBreakdownRow): void {\nconst data: { mapId: number, points: NavigationObjective[] } = {\nmapId: zoneBreakdownRow.zoneId,\n- points: this.uniquify(zoneBreakdownRow.items)\n+ points: zoneBreakdownRow.items\n.map(item => {\nconst coords = this.getCoords(item, zoneBreakdownRow);\nif (coords !== undefined) {\n@@ -175,7 +171,7 @@ export class ListDetailsPanelComponent implements OnChanges, OnInit {\n}\npublic hasNavigationMap(zoneBreakdownRow: ZoneBreakdownRow): boolean {\n- return this.uniquify(zoneBreakdownRow.items)\n+ return zoneBreakdownRow.items\n.map(item => {\nconst coords = this.getCoords(item, zoneBreakdownRow);\nif (coords === undefined) {\n", "new_path": "src/app/pages/list/list-details-panel/list-details-panel.component.ts", "old_path": "src/app/pages/list/list-details-panel/list-details-panel.component.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix: list page slower with zone breakdown
1
fix
null
217,922
22.03.2018 20:12:00
-3,600
fbef7f1407b8a7788053fb9d43bcf10441df714e
chore: zone breakdown on default layout
[ { "change_type": "MODIFY", "diff": "@@ -94,7 +94,7 @@ export class LayoutService {\npublic get defaultLayout(): LayoutRow[] {\nreturn [\n- new LayoutRow('Gathering', 'NAME', LayoutRowOrder.DESC, LayoutRowFilter.IS_GATHERING.name, 0),\n+ new LayoutRow('Gathering', 'NAME', LayoutRowOrder.DESC, LayoutRowFilter.IS_GATHERING.name, 0, true),\nnew LayoutRow('Pre_crafts', 'NAME', LayoutRowOrder.DESC, LayoutRowFilter.IS_CRAFT.name, 3),\nnew LayoutRow('Other', 'NAME', LayoutRowOrder.DESC, LayoutRowFilter.ANYTHING.name, 2),\n]\n", "new_path": "src/app/core/layout/layout.service.ts", "old_path": "src/app/core/layout/layout.service.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: zone breakdown on default layout
1
chore
null
217,922
22.03.2018 23:36:16
-3,600
f0a31c6402a7511069384a4b0d950abb7e97a8f3
fix: cloning a list resets its progression
[ { "change_type": "MODIFY", "diff": "@@ -53,7 +53,7 @@ export class List extends DataModel {\nconst clone = new List();\nfor (const prop of Object.keys(this)) {\nif (['recipes', 'preCrafts', 'gathers', 'others', 'crystals', 'note'].indexOf(prop) > -1) {\n- clone[prop] = this[prop];\n+ clone[prop] = JSON.parse(JSON.stringify(this[prop]));\n}\n}\nclone.name = this.name;\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: cloning a list resets its progression
1
fix
null
679,913
23.03.2018 01:54:04
0
58f5716cde6537b6536d5c985734f4c387361b62
feat(pointfree): add dropIf, neg, nop, update cond,condM, add docs/readme
[ { "change_type": "MODIFY", "diff": "## About\n-Super-lightweight (1.5KB gzipped) Forth style stack execution engine\n-using vanilla JS functions as words and arbitrary stack values (incl.\n-other stack functions / words) and supporting nested execution\n-environments. Includes several dozen common / useful stack operators,\n+[Pointfree](https://en.wikipedia.org/wiki/Concatenative_programming_language),\n+functional composition via lightweight (1.8KB gzipped) Forth style stack\n+execution engine using vanilla JS functions as words and arbitrary stack\n+values (incl. other stack functions / words). Supports nested execution\n+environments and currently includes approx. 50 stack operators,\nconditionals, looping constructs, math & logic ops etc.\n-Originally, this project started out as precursor for the [CharlieREPL\n-Forth VM](http://forth.thi.ng) (JS) and\n+Originally, this project started out as precursor of the [Charlie Forth\n+VM/REPL](http://forth.thi.ng) (JS) and\n[@thi.ng/synstack](http://thi.ng/synstack) (C11), but has since been\nrefactored to be more generally useful as environment for building data\nprocessing pipelines in a [pointfree / concatenative programming\nstyle](https://en.wikipedia.org/wiki/Concatenative_programming_language)\n-rather than acting as VM.\n+rather than acting as fullblown VM.\n+\n+In terms of processing pipeline composition, this approach is somewhat\n+related to\n+[transducers](https://github.com/thi-ng/umbrella/tree/master/packages/transducers),\n+however the pointfree method and stack as communication medium between\n+different sub-processes *can* be more powerful, since each sub-process\n+(\"words\" in Forth-speak) can consume or produce any number of\n+intermediate values from/to the stack and stack programs can have any number of nested [conditionals](#control-flow).\n+\n+## Status\n+\n+ALPHA\n+\n+- [ ] support literal numbers, strings, arrays, objects in program\n+- [ ] execution context wrapper for stack(s), env, error traps\n+- [ ] env stack & more env accessors\n+- [ ] more string, array & object words\n+- [ ] full stack consumer / transformer\n+- [ ] transducer wrapper\n+- [ ] more (useful) examples\n+- [ ] string definitions / program parsing\n## Installation\n@@ -26,21 +48,276 @@ yarn add @thi.ng/pointfree\n## Usage examples\n+#### About stack effects\n+\n+(Note: TOS = Top Of Stack)\n+\n+```\n+( x y -- x )\n+```\n+\n+The items in front of the `--` describe the relevant state of the stack\n+before the execution of a word (the args expected/consumed by the word);\n+the part after the `--' is the state of the stack after execution (the\n+results). Thhis is the standard approach to document the effect a word\n+has on the stack structure.\n+\n+#### `run(stack: Stack, program: StackProgram, env?: StackEnv, onerror?: Trap)`\n+\n+`run()` takes an initial stack, a pointfree stack program and optional environment (an arbitrary object), executes program and then returns tuple of: `[status, stack, env]`\n+\n+A stack program consists of an array of functions with this signature:\n+\n+```\n+type Stack = any[];\n+type StackEnv = any;\n+type StackFn = (stack: Stack, env?: StackEnv) => void;\n+```\n+\n+Each program function can arbitrarily modify both the stack and/or environment.`\n+\n```typescript\nimport * as pf from \"@thi.ng/pointfree\";\n-// run() takes an initial stack, a pointfree stack program and optional env\n-// executes program and then returns tuple of:\n-// [ status, stack, env]\n-pf.run([1, 2], [\n- pf.add, // add 2 top most stack items\n- pf.push(\"result\"), // push the string \"result\" on the stack\n- pf.store // store value under key in env\n+// calculate (1 + 2 + 3) * 10\n+pf.run(\n+ // the initial stack\n+ [10, 1, 2, 3],\n+ // a pointfree stack program w/ stack effects\n+ [\n+ pf.add, // ( 10 1 2 3 -- 10 1 5 )\n+ pf.add, // ( 10 1 5 -- 10 6 )\n+ pf.mul, // ( 10 6 -- 60 )\n])\n-// [ true, [], {result: 3}]\n+// [ true, [6], {}]\n+```\n+\n+### Custom word definitions\n+\n+```typescript\n+// define new word to compute multiply-add:\n+// ( x y z -- x*y+z )\n+const madd = pf.word([pf.invrot, pf.mul, pf.add]);\n+\n+// compute 3 * 5 + 10\n+madd([3, 5, 10]);\n+// [ true, [25], {}]\n+```\n+\n+### Vanilla JS words\n+\n+```typescript\n+// compute square of x\n+// ( x -- x*x )\n+const pow2 = pf.word([pf.dup, pf.mul]);\n+\n+// test word with given stack\n+pow2([10])\n+// [true, [100], {}]\n+\n+// compute magnitude of 2d vector\n+// ( x y -- mag )\n+const mag2 = pf.word([\n+ pow2, // ( x y -- x y^2 )\n+ pf.swap, // ( x y^2 -- y^2 x )\n+ pow2, // ( y^2 x -- y^2 x^2 )\n+ pf.add, // ( y^2 x^2 -- sum )\n+ pf.map((x)=> Math.sqrt(x))\n+]);\n+\n+mag2([-10, 10])[1];\n+// [ 14.142135623730951 ]\n+```\n+\n+### Conditionals\n+\n+See `cond` documentation further below...\n+\n+```typescript\n+// negate TOS item ONLY if negative, else do nothing\n+const abs = pf.word([pf.dup, pf.isNeg, pf.cond(pf.neg)]);\n+\n+abs([-42], abs)[1]\n+// [ 42 ]\n+\n+abs([42], abs)[1]\n+// [ 42 ]\n+```\n+\n+```typescript\n+// `condM` is similar to JS `switch() { case ... }`\n+const classify = pf.condM({\n+ 0: pf.push(\"zero\"),\n+ 1: pf.push(\"one\"),\n+ default: [\n+ pf.dup,\n+ pf.isPos,\n+ pf.cond(pf.push(\"many\"), pf.push(\"invalid\"))\n+ ]\n+});\n+\n+classify([0])[1]\n+// [ \"zero\" ]\n+classify([1])[1]\n+// [ \"one\" ]\n+classify([100])[1]\n+// [ \"many\" ]\n+classify([-100])[1]\n+// [ \"invalid\" ]\n+```\n+\n+### Loops\n+\n+```typescript\n+// print countdown from 3\n+pf.run([3], [pf.loop(pf.isPos, [pf.dup, pf.print, pf.dec])])\n+// 3\n+// 2\n+// 1\n+// [ true, [ 0 ], undefined ]\n+```\n+\n+### Environment accumulator\n+\n+```typescript\n+makeIDObject = (k) => pf.word([\n+ // this inner word uses a blank environment\n+ // to create new objects of `{id: <TOS>}\n+ pf.word([pf.push(\"id\"), pf.store, pf.pushEnv], {}),\n+ pf.push(k),\n+ pf.store\n+]);\n+// transform stack into result object\n+pf.run([1, 2], [makeIDObject(\"a\"), makeIDObject(\"b\")])[2]\n+// { a: { id: 2 }, b: { id: 1 } }\n```\n-TODO examples forthcoming\n+TODO more examples forthcoming\n+\n+## Core vocabulary\n+\n+By default, each word checks for stack underflow and throws an error if\n+there are insufficient values on the stack.\n+\n+Note: Some of the words are higher-order functions, accepting arguments\n+at word construction time and return a pre-configured stack function.\n+\n+### Stack modification\n+\n+| Word | Stack effect |\n+| --- | --- |\n+| `drop` | `( x -- )` |\n+| `drop2` | `( x y -- )` |\n+| `dropIf` | If TOS is truthy: `( x -- )` |\n+| `dup` | `( x -- x x )` |\n+| `dup2` | `( x y -- x y x y )` |\n+| `dupIf` | If TOS is truthy: `( x -- x x )` |\n+| `map(fn)` | `( x -- f(x) )` |\n+| `map2(fn)` | `( x y -- f(x,y) )` |\n+| `nip` | `( x y -- y )` |\n+| `over` | `( x y -- x y x )` |\n+| `pick` | `( x -- stack[x] )` |\n+| `push(...args)` | `( -- ...args )` |\n+| `rot` | `( x y z -- y z x )` |\n+| `invrot` | `( x y z -- z x y )` |\n+| `swap` | `( x y -- y x )` |\n+| `swap2` | `( a b c d -- c d a b )` |\n+| `tuck` | `( x y -- y x y )` |\n+| `depth` | `( -- stack.length )` |\n+\n+### Math\n+\n+| Word | Stack effect |\n+| --- | --- |\n+| `add` | `( x y -- x+y )` |\n+| `sub` | `( x y -- x-y )` |\n+| `mul` | `( x y -- x*y )` |\n+| `div` | `( x y -- x/y )` |\n+| `mod` | `( x y -- x%y )` |\n+| `inc` | `( x -- x+1 )` |\n+| `dec` | `( x -- x-1 )` |\n+| `neg` | `( x -- -x )` |\n+\n+### Logic\n+\n+| Word | Stack effect |\n+| --- | --- |\n+| `eq` | `( x y -- x===y )` |\n+| `equiv` | `( x y -- equiv(x,y) )` |\n+| `neq` | `( x y -- x!==y )` |\n+| `and` | `( x y -- x&&y )` |\n+| `or` | `( x y -- x||y )` |\n+| `not` | `( x -- !x )` |\n+| `lt` | `( x y -- x<y )` |\n+| `gt` | `( x y -- x>y )` |\n+| `lteq` | `( x y -- x<=y )` |\n+| `gteq` | `( x y -- x>=y )` |\n+| `isZero` | `( x -- x===0 )` |\n+| `isPos` | `( x -- x>0 )` |\n+| `isNeg` | `( x -- x<0 )` |\n+| `isNull` | `( x -- x==null )` |\n+\n+### Environment\n+\n+| Word | Stack effect |\n+| --- | --- |\n+| `load` | `( k -- env[k] )` |\n+| `store` | `( x k -- )` |\n+| `loadKey(k)` | `( -- env[k] )` |\n+| `storeKey(k)` | `( x -- )` |\n+| `pushEnv` | `( -- env )` |\n+\n+### Misc\n+\n+| Word | Stack effect |\n+| --- | --- |\n+| `length` | `( x -- x.length )` |\n+| `print` | `( x -- )` |\n+\n+### Control flow\n+\n+#### `cond(_then: StackFn | StackProgram, _else?: StackFn | StackProgram)`\n+\n+Higher order word. Takes two stack programs: truthy and falsey branches,\n+respectively. When executed, pops TOS and runs only one of the branches\n+depending if TOS was truthy or not.\n+\n+Note: Unlike JS `if() {...} else {...}` constructs, the actual\n+conditional is NOT part of this word (only the branches are).\n+\n+#### `condM(cases: IObjectOf<StackFn | StackProgram>)`\n+\n+Higher order word. Essentially like JS `switch`. Takes an object of\n+stack programs with keys in the object being used to check for equality\n+with TOS. If a match is found, executes corresponding stack program. If\n+a default key is specified and no other cases matched, run default\n+program. In all other cases throws an error.\n+\n+**Important:** The default case has the original TOS re-added to the stack\n+before execution.\n+\n+#### `loop = (test: StackFn | StackProgram, body: StackFn | StackProgram)`\n+\n+Takes a `test` and `body` stack program. Applies test to copy of TOS and\n+executes body. Repeats while test is truthy.\n+\n+### Word creation and indirect execution\n+\n+#### `word(prog: StackProgram, env?: StackEnv)`\n+\n+Higher order word. Takes a StackProgram and returns it as StackFn to be\n+used like any other word.\n+\n+If the optional `env` is given, uses a shallow copy of that environment\n+(one per invocation) instead of the main one passed by `run()` at\n+runtime. This is useful in conjunction with `pushEnv` and `store` or\n+`storeKey` to save results of sub procedures in the main env.\n+\n+#### `exec`\n+\n+Executes TOS as stack function and places result back on stack. Useful\n+for dynamic function dispatch (e.g. based on conditionals or config\n+loaded from env).\n## Authors\n", "new_path": "packages/pointfree/README.md", "old_path": "packages/pointfree/README.md" }, { "change_type": "MODIFY", "diff": "@@ -9,10 +9,20 @@ export type Stack = any[];\nexport type StackEnv = any;\nexport type StackFn = (stack: Stack, env?: StackEnv) => void;\nexport type StackProgram = StackFn[];\n+export type StackProc = StackFn | StackProgram;\nexport type Trap = (e: Error, stack: Stack, program: StackProgram, i: number) => boolean;\n-export const run = (stack: Stack, program: StackProgram, env: StackEnv = {}, onerror?: Trap) => {\n+/**\n+ * Executes program with given initial stack and optional environment.\n+ *\n+ * @param stack\n+ * @param prog\n+ * @param env\n+ * @param onerror\n+ */\n+export const run = (stack: Stack, prog: StackProc, env: StackEnv = {}, onerror?: Trap) => {\nstack = stack || [];\n+ const program = isArray(prog) ? prog : [prog];\nfor (let i = 0, n = program.length; i < n; i++) {\ntry {\nprogram[i](stack, env);\n@@ -28,7 +38,7 @@ export const run = (stack: Stack, program: StackProgram, env: StackEnv = {}, one\nreturn [true, stack, env];\n};\n-export const $ = DEBUG ?\n+const $ = DEBUG ?\n(stack: Stack, n: number) => {\nif (stack.length < n) {\nillegalState(`stack underflow`);\n@@ -36,7 +46,7 @@ export const $ = DEBUG ?\n} :\n() => { };\n-export const $n = DEBUG ?\n+const $n = DEBUG ?\n(m: number, n: number) => {\nif (m < n) {\nillegalState(`stack underflow`);\n@@ -44,7 +54,7 @@ export const $n = DEBUG ?\n} :\n() => { };\n-export const ensureStackFn = (f: StackFn | StackProgram) =>\n+const $stackFn = (f: StackProc) =>\nisArray(f) ? word(f) : f;\n/**\n@@ -54,7 +64,7 @@ export const ensureStackFn = (f: StackFn | StackProgram) =>\n*\n* @param op\n*/\n-export const op1 = (op: (x) => any) => {\n+const op1 = (op: (x) => any) => {\nreturn (stack: Stack) => {\nconst n = stack.length - 1;\n$n(n, 0);\n@@ -70,14 +80,14 @@ export const op1 = (op: (x) => any) => {\n*\n* @param op\n*/\n-export const op2 = (op: (b, a) => any) => {\n+const op2 = (op: (b, a) => any) => {\nreturn (stack: Stack) => {\n$(stack, 2);\nstack.push(op(stack.pop(), stack.pop()));\n}\n};\n-export const tos = (stack: Stack) => stack[stack.length - 1];\n+const tos = (stack: Stack) => stack[stack.length - 1];\n/**\n* Pushes current stack size on stack.\n@@ -87,6 +97,8 @@ export const tos = (stack: Stack) => stack[stack.length - 1];\n*/\nexport const depth = (stack: Stack) => stack.push(stack.length);\n+export const nop = () => { };\n+\n/**\n* ( ... x -- ... stack[x] )\n*\n@@ -119,6 +131,22 @@ export const drop2 = (stack: Stack) => {\nstack.length -= 2;\n};\n+/**\n+ * If TOS is truthy then drop it:\n+ *\n+ * ( x -- )\n+ *\n+ * Else, no effect:\n+ *\n+ * ( x -- x )\n+ */\n+export const dropIf = (stack: Stack) => {\n+ $(stack, 1);\n+ if (tos(stack)) {\n+ stack.length--;\n+ }\n+};\n+\n/**\n* Higher order word.\n*\n@@ -133,6 +161,8 @@ export const push = (...args: any[]) => {\n/**\n* Pushes current env onto stack.\n*\n+ * ( -- env )\n+ *\n* @param stack\n* @param env\n*/\n@@ -330,6 +360,13 @@ export const dec = (stack: Stack) => {\nstack[stack.length - 1]--;\n};\n+/**\n+ * ( x -- -x )\n+ *\n+ * @param stack\n+ */\n+export const neg = op1((x) => -x);\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@@ -354,17 +391,18 @@ export const word = (prog: StackProgram, env?: StackEnv) =>\n* branches, respectively. When executed, pops TOS and runs only one of\n* the branches depending if TOS was truthy or not.\n*\n+ * Note: Unlike JS `if() {...} else {...}` constructs, the actual\n+ * conditional is NOT part of this word.\n+ *\n* ( x -- ? )\n*\n* @param _then\n* @param _else\n*/\n-export const cond = (_then: StackFn | StackProgram, _else: StackFn | StackProgram) => {\n- _then = ensureStackFn(_then);\n- _else = ensureStackFn(_else);\n+export const cond = (_then: StackProc, _else: StackProc = []) => {\nreturn (stack: Stack, env: StackEnv) => {\n$(stack, 1);\n- (stack.pop() ? <StackFn>_then : <StackFn>_else)(stack, env);\n+ $stackFn(stack.pop() ? _then : _else)(stack, env);\n};\n};\n@@ -375,20 +413,24 @@ export const cond = (_then: StackFn | StackProgram, _else: StackFn | StackProgra\n* specified and no other cases matched, run `default` program. In all\n* other cases throws an error.\n*\n+ * Important: The default case has the original TOS re-added to the\n+ * stack before execution.\n+ *\n* @param cases\n*/\n-export const condM = (cases: IObjectOf<StackFn | StackProgram>) =>\n+export const condM = (cases: IObjectOf<StackProc>) =>\n(stack: Stack, env: StackEnv) => {\n$(stack, 1);\nconst tos = stack.pop();\nfor (let k in cases) {\nif (tos == k) {\n- ensureStackFn(cases[k])(stack, env);\n+ $stackFn(cases[k])(stack, env);\nreturn;\n}\n}\nif (cases.default) {\n- ensureStackFn(cases.default)(stack, env);\n+ stack.push(tos);\n+ $stackFn(cases.default)(stack, env);\nreturn;\n}\nillegalState(`no matching case for: ${tos}`);\n@@ -410,9 +452,9 @@ export const condM = (cases: IObjectOf<StackFn | StackProgram>) =>\n* @param test\n* @param body\n*/\n-export const loop = (test: StackFn | StackProgram, body: StackFn | StackProgram) => {\n- const _test = ensureStackFn(test);\n- const _body = ensureStackFn(body);\n+export const loop = (test: StackProc, body: StackProc) => {\n+ const _test = $stackFn(test);\n+ const _body = $stackFn(body);\nreturn (stack: Stack, env: StackEnv) => {\nwhile (true) {\ndup(stack);\n@@ -607,3 +649,8 @@ export const storeKey = (key: PropertyKey) =>\n$(stack, 1);\nenv[key] = stack.pop();\n};\n+\n+export {\n+ op1 as map,\n+ op2 as map2\n+}\n\\ No newline at end of file\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 dropIf, neg, nop, update cond,condM, add docs/readme
1
feat
pointfree
679,913
23.03.2018 01:56:54
0
6aef880757b38b2a0ff68944cb82afa14474c14f
build(pointfree): update package info
[ { "change_type": "MODIFY", "diff": "{\n\"name\": \"@thi.ng/pointfree\",\n\"version\": \"0.0.1\",\n- \"description\": \"TODO\",\n+ \"description\": \"Pointfree functional composition / Forth style stack execution engine\",\n\"main\": \"./index.js\",\n\"typings\": \"./index.d.ts\",\n\"repository\": \"https://github.com/thi-ng/umbrella\",\n},\n\"keywords\": [\n\"ES6\",\n+ \"Forth\",\n+ \"functional\",\n+ \"composition\",\n+ \"pipeline\",\n+ \"stack\",\n\"typescript\"\n],\n\"publishConfig\": {\n", "new_path": "packages/pointfree/package.json", "old_path": "packages/pointfree/package.json" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
build(pointfree): update package info
1
build
pointfree
679,913
23.03.2018 02:04:00
0
884a8bfa32342ffa18a2ab60d6c5f3592ead1a50
docs: update main readme/depgraph
[ { "change_type": "MODIFY", "diff": "@@ -7,7 +7,7 @@ Mono-repository for thi.ng TypeScript/ES6 projects, a collection of largely\ndata / transformation oriented packages and building blocks reactive\napplications, components (not just UI related), dataflow.\n-All packages:\n+All/most packages:\n- have detailed, individual README files w/ small usage examples\n- versioned independently\n@@ -45,6 +45,7 @@ difficulties, many combining functionality from several packages) in the\n| [`@thi.ng/interceptors`](./packages/interceptors) | [![npm (scoped)](https://img.shields.io/npm/v/@thi.ng/interceptors.svg)](https://www.npmjs.com/package/@thi.ng/interceptors) | [changelog](./packages/interceptors/CHANGELOG.md) |\n| [`@thi.ng/iterators`](./packages/iterators) | [![npm (scoped)](https://img.shields.io/npm/v/@thi.ng/iterators.svg)](https://www.npmjs.com/package/@thi.ng/iterators) | [changelog](./packages/iterators/CHANGELOG.md) |\n| [`@thi.ng/paths`](./packages/paths) | [![npm (scoped)](https://img.shields.io/npm/v/@thi.ng/paths.svg)](https://www.npmjs.com/package/@thi.ng/paths) | [changelog](./packages/paths/CHANGELOG.md) |\n+| [`@thi.ng/pointfree`](./packages/pointfree) | [![npm (scoped)](https://img.shields.io/npm/v/@thi.ng/pointfree.svg)](https://www.npmjs.com/package/@thi.ng/pointfree) | [changelog](./packages/pointfree/CHANGELOG.md) |\n| [`@thi.ng/rle-pack`](./packages/rle-pack) | [![npm (scoped)](https://img.shields.io/npm/v/@thi.ng/rle-pack.svg)](https://www.npmjs.com/package/@thi.ng/rle-pack) | [changelog](./packages/rle-pack/CHANGELOG.md) |\n| [`@thi.ng/resolve-map`](./packages/resolve-map) | [![npm (scoped)](https://img.shields.io/npm/v/@thi.ng/resolve-map.svg)](https://www.npmjs.com/package/@thi.ng/resolve-map) | [changelog](./packages/resolve-map/CHANGELOG.md) |\n| [`@thi.ng/router`](./packages/router) | [![npm (scoped)](https://img.shields.io/npm/v/@thi.ng/router.svg)](https://www.npmjs.com/package/@thi.ng/router) | [changelog](./packages/router/CHANGELOG.md) |\n", "new_path": "README.md", "old_path": "README.md" }, { "change_type": "MODIFY", "diff": "Binary files a/assets/deps.png and b/assets/deps.png differ\n", "new_path": "assets/deps.png", "old_path": "assets/deps.png" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
docs: update main readme/depgraph
1
docs
null
217,922
23.03.2018 10:35:31
-3,600
87068dc14ec8e3f96db928b31b96e3f5b8f92efc
fix: errors in the console on a fresh new session
[ { "change_type": "MODIFY", "diff": "@@ -129,7 +129,7 @@ export class AppComponent implements OnInit {\n.valueChanges()\n.subscribe((announcement: Announcement) => {\nlet lastLS = localStorage.getItem('announcement:last');\n- if (!lastLS.startsWith('{')) {\n+ if (lastLS !== null && !lastLS.startsWith('{')) {\nlastLS = '{}';\n}\nconst last = JSON.parse(lastLS || '{}');\n@@ -159,6 +159,15 @@ export class AppComponent implements OnInit {\nthis.push.requestPermission();\nlocalStorage.setItem('push:authorization:asked', 'true');\n}\n+ // Do this later to avoid change detection conflict\n+ setTimeout(() => {\n+ this.firebase.object('/giveway').valueChanges().subscribe((givewayActivated: boolean) => {\n+ if (localStorage.getItem('giveway') === null && givewayActivated) {\n+ this.showGiveway();\n+ }\n+ this.givewayRunning = givewayActivated;\n+ });\n+\n// Check if it's beta/dev mode and the disclaimer has not been displayed yet.\nif (!environment.production && localStorage.getItem('beta-disclaimer') === null) {\n// Open beta disclaimer popup.\n@@ -168,13 +177,6 @@ export class AppComponent implements OnInit {\n});\n}\n- this.firebase.object('/giveway').valueChanges().subscribe((givewayActivated: boolean) => {\n- if (localStorage.getItem('giveway') === null && givewayActivated) {\n- this.showGiveway();\n- }\n- this.givewayRunning = givewayActivated;\n- });\n-\n// Patreon popup.\nif (this.router.url.indexOf('home') === -1) {\nthis.firebase\n@@ -230,6 +232,8 @@ export class AppComponent implements OnInit {\nthis.username = character.name;\nthis.userIcon = character.avatar;\n});\n+ }, 15);\n+\n}\nshowGiveway(): void {\n", "new_path": "src/app/app.component.ts", "old_path": "src/app/app.component.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix: errors in the console on a fresh new session
1
fix
null
217,922
23.03.2018 11:05:51
-3,600
259522815d29314f042cb0e6703e1db66cb38009
fix: error when canceling login oauth dialog box
[ { "change_type": "MODIFY", "diff": "@@ -99,10 +99,12 @@ export class LoginPopupComponent {\nthis.listService.add(list);\n});\nthis.notVerified = true;\n+ this.userService.reload();\n});\n});\n} else {\nthis.login(auth).then(() => {\n+ this.userService.reload();\nthis.dialogRef.close();\n}).catch(() => {\nthis.errorState(listsBackup);\n@@ -121,6 +123,7 @@ export class LoginPopupComponent {\nthis.listService.add(list);\n});\nthis.error = true;\n+ this.userService.reload();\n});\n});\n}\n@@ -134,10 +137,15 @@ export class LoginPopupComponent {\n}\nthis.af.auth.signInWithPopup(provider).then((oauth) => {\nthis.login(oauth.user).then(() => {\n+ this.userService.reload();\nthis.dialogRef.close();\n}).catch(() => {\n+ this.userService.reload();\nthis.errorState(lists);\n});\n+ this.userService.reload();\n+ }).catch(() => {\n+ this.userService.reload();\n});\n});\n}\n", "new_path": "src/app/modules/common-components/login-popup/login-popup.component.ts", "old_path": "src/app/modules/common-components/login-popup/login-popup.component.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix: error when canceling login oauth dialog box
1
fix
null
730,424
23.03.2018 11:08:11
14,400
8a3b7ccd6411bcaacc15ff6dd8dc86b7c4a2bcd8
fix(redux-module-media): Prevent overwriting call record on connect
[ { "change_type": "MODIFY", "diff": "@@ -138,6 +138,7 @@ Array [\n\"sendingVideo\": \"\",\n\"status\": \"\",\n},\n+ \"isActive\": undefined,\n\"isCall\": undefined,\n\"isConnected\": false,\n\"isIncoming\": false,\n@@ -208,6 +209,7 @@ Array [\n\"sendingVideo\": \"\",\n\"status\": \"\",\n},\n+ \"isActive\": undefined,\n\"isCall\": undefined,\n\"isConnected\": false,\n\"isIncoming\": false,\n@@ -248,6 +250,70 @@ Array [\n]\n`;\n+exports[`redux-module-media actions #connectCall connects a call 1`] = `\n+Array [\n+ Object {\n+ \"payload\": Object {\n+ \"call\": Object {\n+ \"activeParticipantsCount\": 0,\n+ \"direction\": \"\",\n+ \"hasJoinedOnThisDevice\": \"\",\n+ \"id\": undefined,\n+ \"instance\": Object {\n+ \"acknowledge\": [MockFunction],\n+ \"answer\": [MockFunction],\n+ \"direction\": \"\",\n+ \"hangup\": [MockFunction],\n+ \"joined\": \"\",\n+ \"joinedOnThisDevice\": \"\",\n+ \"localMediaStream\": \"\",\n+ \"locus\": Object {\n+ \"fullState\": Object {\n+ \"lastActive\": \"Sun Feb 18 2018 18:21:05 GMT\",\n+ },\n+ \"url\": \"https://locusUrl\",\n+ },\n+ \"off\": [MockFunction],\n+ \"on\": [MockFunction],\n+ \"once\": [MockFunction],\n+ \"receivingAudio\": \"\",\n+ \"reject\": [MockFunction],\n+ \"remoteAudioMuted\": \"\",\n+ \"remoteAudioStream\": \"\",\n+ \"remoteMediaStream\": \"\",\n+ \"remoteVideoMuted\": \"\",\n+ \"remoteVideoStream\": \"\",\n+ \"sendingAudio\": \"\",\n+ \"sendingVideo\": \"\",\n+ \"status\": \"\",\n+ },\n+ \"isActive\": undefined,\n+ \"isCall\": undefined,\n+ \"isConnected\": false,\n+ \"isIncoming\": false,\n+ \"isInitiated\": false,\n+ \"isReceivingAudio\": \"\",\n+ \"isReceivingVideo\": undefined,\n+ \"isRinging\": undefined,\n+ \"isSendingAudio\": \"\",\n+ \"isSendingVideo\": \"\",\n+ \"localMediaStream\": \"\",\n+ \"locusUrl\": undefined,\n+ \"memberships\": Array [],\n+ \"remoteAudioMuted\": \"\",\n+ \"remoteAudioStream\": null,\n+ \"remoteMediaStream\": \"\",\n+ \"remoteVideoMuted\": \"\",\n+ \"remoteVideoStream\": null,\n+ \"startTime\": undefined,\n+ },\n+ \"id\": \"https://locusUrl\",\n+ },\n+ \"type\": \"media/CONNECT_CALL\",\n+ },\n+]\n+`;\n+\nexports[`redux-module-media actions #declineIncomingCall can successfully decline an incoming call 1`] = `\nArray [\nObject {\n@@ -348,6 +414,7 @@ Array [\n\"sendingVideo\": \"\",\n\"status\": \"\",\n},\n+ \"isActive\": undefined,\n\"isCall\": undefined,\n\"isConnected\": false,\n\"isIncoming\": false,\n@@ -442,6 +509,7 @@ Array [\n\"sendingVideo\": \"\",\n\"status\": \"\",\n},\n+ \"isActive\": undefined,\n\"isCall\": undefined,\n\"isConnected\": false,\n\"isIncoming\": false,\n@@ -481,6 +549,70 @@ Array [\n]\n`;\n+exports[`redux-module-media actions #storeCall stores a call 1`] = `\n+Array [\n+ Object {\n+ \"payload\": Object {\n+ \"call\": Object {\n+ \"activeParticipantsCount\": 0,\n+ \"direction\": \"\",\n+ \"hasJoinedOnThisDevice\": \"\",\n+ \"id\": undefined,\n+ \"instance\": Object {\n+ \"acknowledge\": [MockFunction],\n+ \"answer\": [MockFunction],\n+ \"direction\": \"\",\n+ \"hangup\": [MockFunction],\n+ \"joined\": \"\",\n+ \"joinedOnThisDevice\": \"\",\n+ \"localMediaStream\": \"\",\n+ \"locus\": Object {\n+ \"fullState\": Object {\n+ \"lastActive\": \"Sun Feb 18 2018 18:21:05 GMT\",\n+ },\n+ \"url\": \"https://locusUrl\",\n+ },\n+ \"off\": [MockFunction],\n+ \"on\": [MockFunction],\n+ \"once\": [MockFunction],\n+ \"receivingAudio\": \"\",\n+ \"reject\": [MockFunction],\n+ \"remoteAudioMuted\": \"\",\n+ \"remoteAudioStream\": \"\",\n+ \"remoteMediaStream\": \"\",\n+ \"remoteVideoMuted\": \"\",\n+ \"remoteVideoStream\": \"\",\n+ \"sendingAudio\": \"\",\n+ \"sendingVideo\": \"\",\n+ \"status\": \"\",\n+ },\n+ \"isActive\": undefined,\n+ \"isCall\": undefined,\n+ \"isConnected\": false,\n+ \"isIncoming\": false,\n+ \"isInitiated\": false,\n+ \"isReceivingAudio\": \"\",\n+ \"isReceivingVideo\": undefined,\n+ \"isRinging\": undefined,\n+ \"isSendingAudio\": \"\",\n+ \"isSendingVideo\": \"\",\n+ \"localMediaStream\": \"\",\n+ \"locusUrl\": undefined,\n+ \"memberships\": Array [],\n+ \"remoteAudioMuted\": \"\",\n+ \"remoteAudioStream\": null,\n+ \"remoteMediaStream\": \"\",\n+ \"remoteVideoMuted\": \"\",\n+ \"remoteVideoStream\": null,\n+ \"startTime\": undefined,\n+ },\n+ \"id\": \"https://locusUrl\",\n+ },\n+ \"type\": \"media/STORE_CALL\",\n+ },\n+]\n+`;\n+\nexports[`redux-module-media actions has exported actions 1`] = `\nObject {\n\"ANSWERED_INCOMING_CALL\": \"media/ANSWERED_INCOMING_CALL\",\n@@ -496,12 +628,14 @@ Object {\n\"acceptIncomingCall\": [Function],\n\"checkCurrentCalls\": [Function],\n\"checkWebRTCSupport\": [Function],\n+ \"connectCall\": [Function],\n\"declineIncomingCall\": [Function],\n\"dismissIncomingCall\": [Function],\n\"hangupCall\": [Function],\n\"listenForCalls\": [Function],\n\"placeCall\": [Function],\n\"registerClient\": [Function],\n+ \"storeCall\": [Function],\n\"storeExternalCall\": [Function],\n}\n`;\n", "new_path": "packages/node_modules/@ciscospark/redux-module-media/src/__snapshots__/actions.test.js.snap", "old_path": "packages/node_modules/@ciscospark/redux-module-media/src/__snapshots__/actions.test.js.snap" }, { "change_type": "MODIFY", "diff": "@@ -17,6 +17,7 @@ Immutable.Record {\n\"locusUrl\": \"\",\n\"id\": \"http://abc-123.gov\",\n\"isCall\": false,\n+ \"isActive\": false,\n\"isIncoming\": true,\n\"isInitiated\": false,\n\"isConnected\": false,\n@@ -63,15 +64,62 @@ Immutable.Record {\nexports[`redux-module-media reducer should handle CONNECT_CALL 1`] = `\nImmutable.Record {\n\"byId\": Immutable.Map {\n- \"http://abc-123.gov\": Object {\n- \"connected\": true,\n- \"locus\": Object {\n- \"fullState\": Object {\n- \"lastActive\": \"2018-02-13T14:46:59.874Z\",\n+ \"http://abc-123.gov\": Immutable.Record {\n+ \"instance\": Immutable.Map {\n+ \"sendingVideo\": \"\",\n+ \"once\": [MockFunction],\n+ \"joined\": \"\",\n+ \"hangup\": [MockFunction],\n+ \"off\": [MockFunction],\n+ \"remoteAudioStream\": \"\",\n+ \"status\": \"\",\n+ \"remoteVideoStream\": \"\",\n+ \"receivingAudio\": \"\",\n+ \"remoteVideoMuted\": \"\",\n+ \"localMediaStream\": \"\",\n+ \"remoteAudioMuted\": \"\",\n+ \"sendingAudio\": \"\",\n+ \"acknowledge\": [MockFunction],\n+ \"joinedOnThisDevice\": \"\",\n+ \"remoteMediaStream\": \"\",\n+ \"locus\": Immutable.Map {\n+ \"url\": \"https://locusUrl\",\n+ \"fullState\": Immutable.Map {\n+ \"lastActive\": \"Sun Feb 18 2018 18:21:05 GMT\",\n+ },\n},\n- \"url\": \"http://abc-123.gov\",\n+ \"answer\": [MockFunction],\n+ \"on\": [MockFunction],\n+ \"direction\": \"\",\n+ \"reject\": [MockFunction],\n},\n- \"mock\": true,\n+ \"activeParticipantsCount\": 0,\n+ \"direction\": \"\",\n+ \"startTime\": undefined,\n+ \"remoteAudioStream\": null,\n+ \"remoteVideoStream\": null,\n+ \"remoteMediaStream\": \"\",\n+ \"localMediaStream\": \"\",\n+ \"error\": null,\n+ \"memberships\": Immutable.List [],\n+ \"locusUrl\": undefined,\n+ \"id\": undefined,\n+ \"isCall\": undefined,\n+ \"isActive\": undefined,\n+ \"isIncoming\": false,\n+ \"isInitiated\": false,\n+ \"isConnected\": false,\n+ \"isAnswered\": false,\n+ \"isDismissed\": false,\n+ \"isRinging\": undefined,\n+ \"isReceivingAudio\": \"\",\n+ \"isReceivingVideo\": undefined,\n+ \"isSendingAudio\": \"\",\n+ \"isSendingVideo\": \"\",\n+ \"remoteAudioMuted\": \"\",\n+ \"remoteVideoMuted\": \"\",\n+ \"hasJoinedOnThisDevice\": \"\",\n+ \"hasError\": false,\n},\n},\n\"webRTC\": Immutable.Record {\n@@ -103,6 +151,7 @@ Immutable.Record {\n\"locusUrl\": \"\",\n\"id\": \"http://abc-123.gov\",\n\"isCall\": false,\n+ \"isActive\": false,\n\"isIncoming\": true,\n\"isInitiated\": false,\n\"isConnected\": false,\n@@ -178,6 +227,7 @@ Immutable.Record {\n\"locusUrl\": \"\",\n\"id\": \"http://abc-123.gov\",\n\"isCall\": false,\n+ \"isActive\": false,\n\"isIncoming\": false,\n\"isInitiated\": false,\n\"isConnected\": false,\n", "new_path": "packages/node_modules/@ciscospark/redux-module-media/src/__snapshots__/reducer.test.js.snap", "old_path": "packages/node_modules/@ciscospark/redux-module-media/src/__snapshots__/reducer.test.js.snap" }, { "change_type": "MODIFY", "diff": "@@ -32,7 +32,7 @@ function checkingWebRTCSupport() {\n};\n}\n-function connectCall(call) {\n+export function connectCall(call) {\nreturn {\ntype: CONNECT_CALL,\npayload: {\n@@ -56,7 +56,7 @@ function removeCall(callOrId) {\n};\n}\n-function storeCall(call) {\n+export function storeCall(call) {\nreturn {\ntype: STORE_CALL,\npayload: {\n@@ -222,9 +222,9 @@ export function listenForCalls(sparkInstance) {\n* Call a user with an email address or userId\n*\n* @export\n+ * @param {Object} sparkInstance\n* @param {String} data.destination\n* @param {Object} data.constraints\n- * @param {Object} sparkInstance\n* @returns {Promise}\n*/\nexport function placeCall(sparkInstance, {\n", "new_path": "packages/node_modules/@ciscospark/redux-module-media/src/actions.js", "old_path": "packages/node_modules/@ciscospark/redux-module-media/src/actions.js" }, { "change_type": "MODIFY", "diff": "@@ -172,4 +172,18 @@ describe('redux-module-media actions ', () => {\n});\n});\n});\n+\n+ describe('#connectCall', () => {\n+ it('connects a call', () => {\n+ store.dispatch(actions.connectCall(call));\n+ expect(store.getActions()).toMatchSnapshot();\n+ });\n+ });\n+\n+ describe('#storeCall', () => {\n+ it('stores a call', () => {\n+ store.dispatch(actions.storeCall(call));\n+ expect(store.getActions()).toMatchSnapshot();\n+ });\n+ });\n});\n", "new_path": "packages/node_modules/@ciscospark/redux-module-media/src/actions.test.js", "old_path": "packages/node_modules/@ciscospark/redux-module-media/src/actions.test.js" }, { "change_type": "MODIFY", "diff": "@@ -59,6 +59,7 @@ function constructCallStatus(call) {\nreturn {\nisCall: call.isCall,\n+ isActive: call.isActive,\nhasJoinedOnThisDevice: call.joinedOnThisDevice,\nisReceivingAudio: call.receivingAudio,\nisReceivingVideo: call.receivingVideo,\n", "new_path": "packages/node_modules/@ciscospark/redux-module-media/src/helpers.js", "old_path": "packages/node_modules/@ciscospark/redux-module-media/src/helpers.js" }, { "change_type": "MODIFY", "diff": "@@ -36,6 +36,7 @@ export const CallRecord = Record({\nlocusUrl: '',\nid: '',\nisCall: false,\n+ isActive: false,\nisIncoming: false,\nisInitiated: false,\nisConnected: false,\n@@ -121,7 +122,7 @@ export default function reducer(state = initialState, action) {\nid\n} = action.payload;\nif (id) {\n- return state.setIn(['byId', id], call);\n+ return state.mergeDeepIn(['byId', id], call);\n}\nreturn state;\n}\n", "new_path": "packages/node_modules/@ciscospark/redux-module-media/src/reducer.js", "old_path": "packages/node_modules/@ciscospark/redux-module-media/src/reducer.js" }, { "change_type": "MODIFY", "diff": "import reducer, {initialState, CallRecord} from './reducer';\n+import {constructCallObject} from './helpers';\nimport {\nANSWERED_INCOMING_CALL,\nDISMISS_INCOMING_CALL,\n@@ -11,7 +12,40 @@ import {\nUPDATE_WEBRTC_SUPPORT\n} from './actions';\n+let call;\n+\ndescribe('redux-module-media reducer', () => {\n+ beforeEach(() => {\n+ call = {\n+ hangup: jest.fn(() => Promise.resolve()),\n+ acknowledge: jest.fn(() => Promise.resolve()),\n+ reject: jest.fn(() => Promise.resolve()),\n+ answer: jest.fn(() => Promise.resolve()),\n+ once: jest.fn(),\n+ on: jest.fn((eventName, callback) => Promise.resolve({eventName, callback})),\n+ off: jest.fn(),\n+ locus: {\n+ url: 'https://locusUrl',\n+ fullState: {\n+ lastActive: 'Sun Feb 18 2018 18:21:05 GMT'\n+ }\n+ },\n+ direction: '',\n+ joined: '',\n+ joinedOnThisDevice: '',\n+ status: '',\n+ receivingAudio: '',\n+ sendingAudio: '',\n+ sendingVideo: '',\n+ remoteMediaStream: '',\n+ localMediaStream: '',\n+ remoteAudioMuted: '',\n+ remoteVideoMuted: '',\n+ remoteAudioStream: '',\n+ remoteVideoStream: ''\n+ };\n+ });\n+\nit('should return an initial state', () => {\nexpect(reducer(undefined, {}))\n.toMatchSnapshot();\n@@ -89,16 +123,7 @@ describe('redux-module-media reducer', () => {\nexpect(reducer(updatedState, {\ntype: CONNECT_CALL,\npayload: {\n- call: {\n- locus: {\n- fullState: {\n- lastActive: '2018-02-13T14:46:59.874Z'\n- },\n- url\n- },\n- mock: true,\n- connected: true\n- },\n+ call: constructCallObject(call),\nid: url\n}\n})).toMatchSnapshot();\n", "new_path": "packages/node_modules/@ciscospark/redux-module-media/src/reducer.test.js", "old_path": "packages/node_modules/@ciscospark/redux-module-media/src/reducer.test.js" }, { "change_type": "MODIFY", "diff": "@@ -71,7 +71,7 @@ export class MeetWidget extends Component {\nisActive={isActive}\nlocalVideoPosition={localVideoPosition}\nonHangupClick={handleHangup}\n- {...call}\n+ {...call.toJS()}\n/>\n<Ringtone play={status.isRinging} type={RINGTONE_TYPE_RINGBACK} />\n</div>\n", "new_path": "packages/node_modules/@ciscospark/widget-meet/src/container.js", "old_path": "packages/node_modules/@ciscospark/widget-meet/src/container.js" } ]
JavaScript
MIT License
webex/react-widgets
fix(redux-module-media): Prevent overwriting call record on connect
1
fix
redux-module-media
217,922
23.03.2018 11:34:52
-3,600
76aa591f432e4eed5353339c553e1dee5c7f1c48
chore: add sentry for bug tracking
[ { "change_type": "MODIFY", "diff": "\"version\": \"3.2.0\",\n\"resolved\": \"https://registry.npmjs.org/jasmine-spec-reporter/-/jasmine-spec-reporter-3.2.0.tgz\",\n\"integrity\": \"sha1-/b6FqAzN07J2dGvHf96Dwc53Pv8=\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"colors\": \"1.1.2\"\n+ },\n+ \"dependencies\": {\n+ \"colors\": {\n+ \"version\": \"1.1.2\",\n+ \"resolved\": \"https://registry.npmjs.org/colors/-/colors-1.1.2.tgz\",\n+ \"integrity\": \"sha1-FopHAXVran9RoSzgyXv6KMCE7WM=\",\n\"dev\": true\n+ }\n+ }\n},\n\"jasminewd2\": {\n\"version\": \"2.2.0\",\n\"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": "\"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 {NgModule} from '@angular/core';\n+import {ErrorHandler, NgModule} from '@angular/core';\nimport {FormsModule, ReactiveFormsModule} from '@angular/forms';\nimport {AppComponent} from './app.component';\nimport {BrowserAnimationsModule} from '@angular/platform-browser/animations';\n@@ -55,8 +55,19 @@ 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';\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+ Raven.captureException(err);\n+ }\n+}\n+\nexport function HttpLoaderFactory(http: HttpClient) {\nreturn new TranslateHttpLoader(http);\n}\n@@ -137,6 +148,7 @@ export function HttpLoaderFactory(http: HttpClient) {\nGatheringLocationModule,\nWorkshopModule,\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,6 +9,7 @@ import {NgSerializerService} from '@kaiu/ng-serializer';\nimport {FirebaseStorage} from './storage/firebase/firebase-storage';\nimport {AngularFireDatabase} from 'angularfire2/database';\nimport {DiffService} from './diff/diff.service';\n+import * as Raven from 'raven-js';\n@Injectable()\nexport class UserService extends FirebaseStorage<AppUser> {\n@@ -72,10 +73,16 @@ 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: add sentry for bug tracking
1
chore
null
217,922
23.03.2018 11:55:47
-3,600
6c4bb9a189df50a7f8374124f474664a00ee1667
fix: IS_GATHERED_BY_FSH doesn't do anything closes
[ { "change_type": "MODIFY", "diff": "@@ -140,7 +140,7 @@ export class LayoutRowFilter {\nstatic IS_GATHERED_BY_FSH = LayoutRowFilter.IS_GATHERING\n._and(new LayoutRowFilter((row: ListRow) => {\n- return row.gatheredBy.type === 4;\n+ return row.gatheredBy.icon.indexOf('FSH') > -1;\n}, 'IS_GATHERED_BY_FSH'));\nstatic ANYTHING = new LayoutRowFilter(() => true, 'ANYTHING');\n", "new_path": "src/app/core/layout/layout-row-filter.ts", "old_path": "src/app/core/layout/layout-row-filter.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix: IS_GATHERED_BY_FSH doesn't do anything closes #290
1
fix
null
217,922
23.03.2018 13:11:00
-3,600
b0e449ae76adb09d9232ad24ffab41a4e9656f24
fix: alternating line colours do not work as expected when lines are hidden by a filter. closes closes
[ { "change_type": "MODIFY", "diff": "@@ -42,7 +42,7 @@ export class LayoutService {\nif (layoutRows.find(row => row.filter.name === 'ANYTHING') === undefined) {\nthrow new Error('List layoutRows has to contain an ANYTHING category');\n}\n- let unfilteredRows = list.items;\n+ let unfilteredRows = list.items.filter(row => row.hidden !== true);\nreturn layoutRows.map(row => {\nconst result: FilterResult = row.filter.filter(unfilteredRows);\nunfilteredRows = result.rejected;\n", "new_path": "src/app/core/layout/layout.service.ts", "old_path": "src/app/core/layout/layout.service.ts" }, { "change_type": "MODIFY", "diff": "@@ -141,6 +141,7 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\nitem.hidden = true;\n}\n});\n+ this.listData$.next(this.listData);\nif (this.accordionState === undefined) {\nthis.initAccordion(this.listData);\n}\n", "new_path": "src/app/pages/list/list-details/list-details.component.ts", "old_path": "src/app/pages/list/list-details/list-details.component.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix: alternating line colours do not work as expected when lines are hidden by a filter. closes #288, closes #287
1
fix
null
807,849
23.03.2018 13:12:44
25,200
3e00d7a6af8704f6b5b78d879de1336af78234bd
fix(git-utils): Remove unused methods, stop mocking tests
[ { "change_type": "ADD", "diff": "+{\n+ \"name\": \"git-utils-basic\",\n+ \"version\": \"0.0.0-ignored\",\n+ \"description\": \"Just here to create empty git repos\"\n+}\n", "new_path": "core/git-utils/__tests__/__fixtures__/basic/package.json", "old_path": null }, { "change_type": "MODIFY", "diff": "\"use strict\";\n-jest.mock(\"temp-write\");\n-jest.mock(\"@lerna/child-process\");\n-\n+const execa = require(\"execa\");\n+const fs = require(\"fs-extra\");\nconst { EOL } = require(\"os\");\nconst path = require(\"path\");\n+const slash = require(\"slash\");\n+const tempy = require(\"tempy\");\n-// mocked modules\n-const tempWrite = require(\"temp-write\");\n-const ChildProcessUtilities = require(\"@lerna/child-process\");\n+// helpers\n+const initFixture = require(\"@lerna-test/init-fixture\")(__dirname);\n+const cloneFixture = require(\"@lerna-test/clone-fixture\")(__dirname);\n// file under test\nconst GitUtilities = require(\"..\");\ndescribe(\"GitUtilities\", () => {\n- ChildProcessUtilities.exec.mockResolvedValue();\n-\ndescribe(\".isDetachedHead()\", () => {\n- const originalGetCurrentBranch = GitUtilities.getCurrentBranch;\n-\n- afterEach(() => {\n- GitUtilities.getCurrentBranch = originalGetCurrentBranch;\n- });\n-\n- it(\"returns true when branchName is HEAD\", () => {\n- GitUtilities.getCurrentBranch = jest.fn(() => \"HEAD\");\n-\n- expect(GitUtilities.isDetachedHead()).toBe(true);\n- });\n-\n- it(\"returns false when branchName is not HEAD\", () => {\n- GitUtilities.getCurrentBranch = jest.fn(() => \"master\");\n+ it(\"returns true when branchName is HEAD\", async () => {\n+ const cwd = await initFixture(\"basic\");\n- expect(GitUtilities.isDetachedHead()).toBe(false);\n- });\n-\n- it(\"passes opts to getCurrentBranch()\", () => {\n- const opts = { cwd: \"test\" };\n+ expect(GitUtilities.isDetachedHead({ cwd })).toBe(false);\n- GitUtilities.getCurrentBranch = jest.fn();\n+ const sha = await execa.stdout(\"git\", [\"rev-parse\", \"HEAD\"], { cwd });\n+ await execa(\"git\", [\"checkout\", sha], { cwd }); // detach head\n- GitUtilities.isDetachedHead(opts);\n- expect(GitUtilities.getCurrentBranch).lastCalledWith(opts);\n+ expect(GitUtilities.isDetachedHead({ cwd })).toBe(true);\n});\n});\ndescribe(\".isInitialized()\", () => {\n- it(\"returns true when git command succeeds\", () => {\n- expect(GitUtilities.isInitialized({ cwd: \"test\" })).toBe(true);\n- expect(ChildProcessUtilities.execSync).lastCalledWith(\"git\", [\"rev-parse\"], {\n- cwd: \"test\",\n- stdio: \"ignore\",\n- });\n- });\n+ it(\"returns true when git command succeeds\", async () => {\n+ const cwd = await initFixture(\"basic\");\n- it(\"returns false when git command fails\", () => {\n- ChildProcessUtilities.execSync.mockImplementationOnce(() => {\n- throw new Error(\"fatal: Not a git repository\");\n- });\n+ expect(GitUtilities.isInitialized({ cwd })).toBe(true);\n- expect(GitUtilities.isInitialized()).toBe(false);\n+ await fs.remove(path.join(cwd, \".git\"));\n+ expect(GitUtilities.isInitialized({ cwd })).toBe(false);\n});\n});\ndescribe(\".addFiles()\", () => {\nit(\"calls git add with files argument\", async () => {\n- const opts = { cwd: \"test\" };\n-\n- await GitUtilities.addFiles([\"foo\", \"bar\"], opts);\n-\n- expect(ChildProcessUtilities.exec).lastCalledWith(\"git\", [\"add\", \"--\", \"foo\", \"bar\"], opts);\n- });\n+ const cwd = await initFixture(\"basic\");\n+ const file = path.join(\"packages\", \"pkg-1\", \"index.js\");\n- it(\"works with absolute path for cwd\", async () => {\n- const cwd = path.resolve(\"test\");\n- const file = \"foo\";\n- const opts = { cwd };\n+ await fs.outputFile(path.join(cwd, file), \"hello\");\n+ await GitUtilities.addFiles([file], { cwd });\n- await GitUtilities.addFiles([file], opts);\n-\n- expect(ChildProcessUtilities.exec).lastCalledWith(\"git\", [\"add\", \"--\", \"foo\"], opts);\n- });\n-\n- it(\"works with absolute paths for file and cwd\", async () => {\n- const cwd = path.resolve(\"test\");\n- const file = path.resolve(cwd, \"foo\");\n- const opts = { cwd };\n-\n- await GitUtilities.addFiles([file], opts);\n-\n- expect(ChildProcessUtilities.exec).lastCalledWith(\"git\", [\"add\", \"--\", \"foo\"], opts);\n+ const list = await execa.stdout(\"git\", [\"diff\", \"--cached\", \"--name-only\"], { cwd });\n+ expect(slash(list)).toBe(\"packages/pkg-1/index.js\");\n});\n- it(\"uses a POSIX path in the Git command, given a Windows file path\", async () => {\n- const opts = { cwd: \"test\" };\n+ it(\"works with absolute path for files\", async () => {\n+ const cwd = await initFixture(\"basic\");\n+ const file = path.join(cwd, \"packages\", \"pkg-2\", \"index.js\");\n- await GitUtilities.addFiles([\"foo\\\\bar\"], opts);\n+ await fs.outputFile(file, \"hello\");\n+ await GitUtilities.addFiles([file], { cwd });\n- expect(ChildProcessUtilities.exec).lastCalledWith(\"git\", [\"add\", \"--\", \"foo/bar\"], opts);\n+ const list = await execa.stdout(\"git\", [\"diff\", \"--cached\", \"--name-only\"], { cwd });\n+ expect(slash(list)).toBe(\"packages/pkg-2/index.js\");\n});\n});\ndescribe(\".commit()\", () => {\nit(\"calls git commit with message\", async () => {\n- const opts = { cwd: \"oneline\" };\n+ const cwd = await initFixture(\"basic\");\n- await GitUtilities.commit(\"foo\", opts);\n+ await fs.outputFile(path.join(cwd, \"packages\", \"pkg-3\", \"index.js\"), \"hello\");\n+ await execa(\"git\", [\"add\", \".\"], { cwd });\n+ await GitUtilities.commit(\"foo\", { cwd });\n- expect(ChildProcessUtilities.exec).lastCalledWith(\"git\", [\"commit\", \"--no-verify\", \"-m\", \"foo\"], opts);\n- expect(tempWrite.sync).not.toBeCalled();\n+ const message = await execa.stdout(\"git\", [\"log\", \"-1\", \"--pretty=format:%B\"], { cwd });\n+ expect(message).toBe(\"foo\");\n});\nit(\"allows multiline message\", async () => {\n- const opts = { cwd: \"multiline\" };\n+ const cwd = await initFixture(\"basic\");\n+\n+ await fs.outputFile(path.join(cwd, \"packages\", \"pkg-4\", \"index.js\"), \"hello\");\n+ await execa(\"git\", [\"add\", \".\"], { cwd });\n+ await GitUtilities.commit(`foo${EOL}${EOL}bar`, { cwd });\n- tempWrite.sync = jest.fn(() => \"TEMPFILE\");\n+ const subject = await execa.stdout(\"git\", [\"log\", \"-1\", \"--pretty=format:%s\"], { cwd });\n+ const body = await execa.stdout(\"git\", [\"log\", \"-1\", \"--pretty=format:%b\"], { cwd });\n- await GitUtilities.commit(`foo${EOL}bar`, opts);\n- expect(ChildProcessUtilities.exec).lastCalledWith(\n- \"git\",\n- [\"commit\", \"--no-verify\", \"-F\", \"TEMPFILE\"],\n- opts\n- );\n- expect(tempWrite.sync).lastCalledWith(`foo${EOL}bar`, \"lerna-commit.txt\");\n+ expect(subject).toBe(\"foo\");\n+ expect(body).toBe(\"bar\");\n});\n});\ndescribe(\".addTag()\", () => {\nit(\"creates annotated git tag\", async () => {\n- const opts = { cwd: \"test\" };\n- await GitUtilities.addTag(\"foo\", opts);\n- expect(ChildProcessUtilities.exec).lastCalledWith(\"git\", [\"tag\", \"foo\", \"-m\", \"foo\"], opts);\n- });\n- });\n+ const cwd = await initFixture(\"basic\");\n- describe(\".hasTags()\", () => {\n- it(\"returns true when one or more git tags exist\", () => {\n- const opts = { cwd: \"test\" };\n-\n- ChildProcessUtilities.execSync.mockReturnValueOnce(\"v1.0.0\");\n-\n- expect(GitUtilities.hasTags(opts)).toBe(true);\n- expect(ChildProcessUtilities.execSync).lastCalledWith(\"git\", [\"tag\"], opts);\n- });\n+ await GitUtilities.addTag(\"v1.2.3\", { cwd });\n- it(\"returns false when no git tags exist\", () => {\n- ChildProcessUtilities.execSync.mockReturnValueOnce(\"\");\n-\n- expect(GitUtilities.hasTags()).toBe(false);\n+ const list = await execa.stdout(\"git\", [\"tag\", \"--list\"], { cwd });\n+ expect(list).toMatch(\"v1.2.3\");\n});\n});\n- describe(\".getLastTaggedCommit()\", () => {\n- it(\"returns SHA of closest git tag\", () => {\n- const opts = { cwd: \"test\" };\n+ describe(\".hasTags()\", () => {\n+ it(\"returns true when one or more git tags exist\", async () => {\n+ const cwd = await initFixture(\"basic\");\n- ChildProcessUtilities.execSync.mockReturnValueOnce(\"deadbeef\");\n+ expect(GitUtilities.hasTags({ cwd })).toBe(false);\n- expect(GitUtilities.getLastTaggedCommit(opts)).toBe(\"deadbeef\");\n- expect(ChildProcessUtilities.execSync).lastCalledWith(\n- \"git\",\n- [\"rev-list\", \"--tags\", \"--max-count=1\"],\n- opts\n- );\n- });\n+ await execa(\"git\", [\"tag\", \"v1.2.3\", \"-m\", \"v1.2.3\"], { cwd });\n+ expect(GitUtilities.hasTags({ cwd })).toBe(true);\n});\n-\n- describe(\".getLastTaggedCommitInBranch()\", () => {\n- const getLastTagOriginal = GitUtilities.getLastTag;\n-\n- afterEach(() => {\n- GitUtilities.getLastTag = getLastTagOriginal;\n});\n- it(\"returns SHA of closest git tag in branch\", () => {\n- const opts = { cwd: \"test\" };\n+ describe(\".getLastTaggedCommit()\", () => {\n+ it(\"returns SHA of closest git tag\", async () => {\n+ const cwd = await initFixture(\"basic\");\n- GitUtilities.getLastTag = jest.fn(() => \"v1.0.0\");\n- ChildProcessUtilities.execSync.mockReturnValueOnce(\"deadbeef\");\n+ await execa(\"git\", [\"tag\", \"v1.2.3\", \"-m\", \"v1.2.3\"], { cwd });\n- expect(GitUtilities.getLastTaggedCommitInBranch(opts)).toBe(\"deadbeef\");\n- expect(ChildProcessUtilities.execSync).lastCalledWith(\"git\", [\"rev-list\", \"-n\", \"1\", \"v1.0.0\"], opts);\n+ expect(GitUtilities.getLastTaggedCommit({ cwd })).toMatch(/^[0-9a-f]{40}$/);\n});\n});\ndescribe(\".getFirstCommit()\", () => {\n- it(\"returns SHA of first commit\", () => {\n- const opts = { cwd: \"test\" };\n-\n- ChildProcessUtilities.execSync.mockReturnValueOnce(\"beefcafe\");\n+ it(\"returns SHA of first commit\", async () => {\n+ const cwd = await initFixture(\"basic\");\n- expect(GitUtilities.getFirstCommit(opts)).toBe(\"beefcafe\");\n- expect(ChildProcessUtilities.execSync).lastCalledWith(\n- \"git\",\n- [\"rev-list\", \"--max-parents=0\", \"HEAD\"],\n- opts\n- );\n+ expect(GitUtilities.getFirstCommit({ cwd })).toMatch(/^[0-9a-f]{40}$/);\n});\n});\ndescribe(\".pushWithTags()\", () => {\n- const getCurrentBranchOriginal = GitUtilities.getCurrentBranch;\n- afterEach(() => {\n- GitUtilities.getCurrentBranch = getCurrentBranchOriginal;\n- });\n-\nit(\"pushes current branch and specified tag(s) to origin\", async () => {\n- const opts = { cwd: \"test\" };\n-\n- GitUtilities.getCurrentBranch = jest.fn(() => \"master\");\n-\n- await GitUtilities.pushWithTags(\"origin\", [\"foo@1.0.1\", \"foo-bar@1.0.0\"], opts);\n- expect(ChildProcessUtilities.exec).toBeCalledWith(\"git\", [\"push\", \"origin\", \"master\"], opts);\n- expect(ChildProcessUtilities.exec).lastCalledWith(\n- \"git\",\n- [\"push\", \"origin\", \"foo@1.0.1\", \"foo-bar@1.0.0\"],\n- opts\n- );\n- });\n- });\n+ const { cwd } = await cloneFixture(\"basic\");\n- describe(\".getLastTag()\", () => {\n- it(\"returns the closest tag\", () => {\n- const opts = { cwd: \"test\" };\n+ await execa(\"git\", [\"commit\", \"--allow-empty\", \"-m\", \"change\"], { cwd });\n+ await execa(\"git\", [\"tag\", \"v1.2.3\", \"-m\", \"v1.2.3\"], { cwd });\n- ChildProcessUtilities.execSync.mockReturnValueOnce(\"v1.0.0\");\n+ await GitUtilities.pushWithTags(\"origin\", [\"v1.2.3\"], { cwd });\n- expect(GitUtilities.getLastTag(opts)).toBe(\"v1.0.0\");\n- expect(ChildProcessUtilities.execSync).lastCalledWith(\n- \"git\",\n- [\"describe\", \"--tags\", \"--abbrev=0\"],\n- opts\n- );\n+ const list = await execa.stdout(\"git\", [\"ls-remote\", \"--tags\", \"--refs\", \"--quiet\"], { cwd });\n+ expect(list).toMatch(\"v1.2.3\");\n});\n});\n- describe(\".describeTag()\", () => {\n- it(\"returns description of specified tag\", () => {\n- const opts = { cwd: \"test\" };\n+ describe(\".getLastTag()\", () => {\n+ it(\"returns the closest tag\", async () => {\n+ const cwd = await initFixture(\"basic\");\n- ChildProcessUtilities.execSync.mockReturnValueOnce(\"foo@1.0.0\");\n+ await execa(\"git\", [\"tag\", \"v1.2.3\", \"-m\", \"v1.2.3\"], { cwd });\n- expect(GitUtilities.describeTag(\"deadbeef\", opts)).toBe(\"foo@1.0.0\");\n- expect(ChildProcessUtilities.execSync).lastCalledWith(\"git\", [\"describe\", \"--tags\", \"deadbeef\"], opts);\n+ expect(GitUtilities.getLastTag({ cwd })).toBe(\"v1.2.3\");\n});\n});\ndescribe(\".diffSinceIn()\", () => {\n- it(\"returns list of files changed since commit at location\", () => {\n- const opts = { cwd: process.cwd() };\n+ it(\"omits location filter when location is current working directory\", async () => {\n+ const cwd = await initFixture(\"basic\");\n+ const file = path.join(cwd, \"packages\", \"pkg-5\", \"index.js\");\n- ChildProcessUtilities.execSync.mockReturnValueOnce(\"files\");\n+ await execa(\"git\", [\"tag\", \"v1.2.3\", \"-m\", \"v1.2.3\"], { cwd });\n- expect(GitUtilities.diffSinceIn(\"v1.0.0\", \"packages/foo\", opts)).toBe(\"files\");\n- expect(ChildProcessUtilities.execSync).lastCalledWith(\n- \"git\",\n- [\"diff\", \"--name-only\", \"v1.0.0\", \"--\", \"packages/foo\"],\n- opts\n- );\n- });\n+ await fs.outputFile(file, \"hello\");\n+ await fs.writeJSON(path.join(cwd, \"package.json\"), { foo: \"bar\" });\n- it(\"omits location filter when location is current working directory\", () => {\n- const opts = { cwd: process.cwd() };\n+ await execa(\"git\", [\"add\", \".\"], { cwd });\n+ await execa(\"git\", [\"commit\", \"-m\", \"change\"], { cwd });\n- GitUtilities.diffSinceIn(\"v2.0.0\", opts.cwd, opts);\n+ const rootDiff = GitUtilities.diffSinceIn(\"v1.2.3\", cwd, { cwd });\n+ const fileDiff = GitUtilities.diffSinceIn(\"v1.2.3\", path.dirname(file), { cwd });\n- expect(ChildProcessUtilities.execSync).lastCalledWith(\"git\", [\"diff\", \"--name-only\", \"v2.0.0\"], opts);\n+ expect(rootDiff).toMatch(\"package.json\");\n+ expect(fileDiff).toBe(path.relative(cwd, file));\n});\n});\ndescribe(\".getWorkspaceRoot()\", () => {\n- it(\"calls `git rev-parse --show-toplevel`\", () => {\n- const opts = { cwd: \"test\" };\n-\n- ChildProcessUtilities.execSync.mockReturnValueOnce(\"master\");\n+ it(\"calls `git rev-parse --show-toplevel`\", async () => {\n+ const topLevel = await initFixture(\"basic\");\n+ const cwd = path.join(topLevel, \"foo\");\n- expect(GitUtilities.getWorkspaceRoot(opts)).toBe(\"master\");\n- expect(ChildProcessUtilities.execSync).lastCalledWith(\"git\", [\"rev-parse\", \"--show-toplevel\"], opts);\n+ await fs.mkdirp(cwd);\n+ expect(GitUtilities.getWorkspaceRoot({ cwd })).toBe(topLevel);\n});\n});\ndescribe(\".getCurrentBranch()\", () => {\n- it(\"calls `git rev-parse --abbrev-ref HEAD`\", () => {\n- const opts = { cwd: \"test\" };\n+ it(\"calls `git rev-parse --abbrev-ref HEAD`\", async () => {\n+ const cwd = await initFixture(\"basic\");\n- ChildProcessUtilities.execSync.mockReturnValueOnce(\"master\");\n-\n- expect(GitUtilities.getCurrentBranch(opts)).toBe(\"master\");\n- expect(ChildProcessUtilities.execSync).lastCalledWith(\n- \"git\",\n- [\"rev-parse\", \"--abbrev-ref\", \"HEAD\"],\n- opts\n- );\n+ expect(GitUtilities.getCurrentBranch({ cwd })).toBe(\"master\");\n});\n});\ndescribe(\".getCurrentSHA()\", () => {\n- it(\"returns SHA of current ref\", () => {\n- const opts = { cwd: \"test\" };\n-\n- ChildProcessUtilities.execSync.mockReturnValueOnce(\"deadcafe\");\n+ it(\"returns full SHA of current ref\", async () => {\n+ const cwd = await initFixture(\"basic\");\n- expect(GitUtilities.getCurrentSHA(opts)).toBe(\"deadcafe\");\n- expect(ChildProcessUtilities.execSync).lastCalledWith(\"git\", [\"rev-parse\", \"HEAD\"], opts);\n+ expect(GitUtilities.getCurrentSHA({ cwd })).toMatch(/^[0-9a-f]{40}$/);\n});\n});\ndescribe(\".getShortSHA()\", () => {\n- it(\"returns short SHA of current ref\", () => {\n- const opts = { cwd: \"test\" };\n+ it(\"returns short SHA of current ref\", async () => {\n+ const cwd = await initFixture(\"basic\");\n- ChildProcessUtilities.execSync.mockReturnValueOnce(\"deadbee\");\n-\n- expect(GitUtilities.getShortSHA(opts)).toBe(\"deadbee\");\n- expect(ChildProcessUtilities.execSync).lastCalledWith(\"git\", [\"rev-parse\", \"--short\", \"HEAD\"], opts);\n+ expect(GitUtilities.getShortSHA({ cwd })).toMatch(/^[0-9a-f]{7,8}$/);\n});\n});\ndescribe(\".checkoutChanges()\", () => {\nit(\"calls git checkout with specified arg\", async () => {\n- const opts = { cwd: \"test\" };\n+ const cwd = await initFixture(\"basic\");\n+\n+ await fs.writeJSON(path.join(cwd, \"package.json\"), { foo: \"bar\" });\n+ await GitUtilities.checkoutChanges(\"package.json\", { cwd });\n- await GitUtilities.checkoutChanges(\"packages/*/package.json\", opts);\n- expect(ChildProcessUtilities.exec).lastCalledWith(\n- \"git\",\n- [\"checkout\", \"--\", \"packages/*/package.json\"],\n- opts\n- );\n+ const modified = await execa.stdout(\"git\", [\"ls-files\", \"--modified\"], { cwd });\n+ expect(modified).toBe(\"\");\n});\n});\ndescribe(\".init()\", () => {\n- it(\"calls git init\", () => {\n- const opts = { cwd: \"test\" };\n+ it(\"calls git init\", async () => {\n+ const cwd = tempy.directory();\n- GitUtilities.init(opts);\n- expect(ChildProcessUtilities.execSync).lastCalledWith(\"git\", [\"init\"], opts);\n+ GitUtilities.init({ cwd });\n+\n+ const { code } = await execa(\"git\", [\"status\"], { cwd });\n+ expect(code).toBe(0);\n});\n});\ndescribe(\".hasCommit()\", () => {\n- it(\"returns true when git command succeeds\", () => {\n- const opts = { cwd: \"test\" };\n-\n- expect(GitUtilities.hasCommit(opts)).toBe(true);\n- expect(ChildProcessUtilities.execSync).lastCalledWith(\"git\", [\"log\"], opts);\n- });\n+ it(\"returns true when git command succeeds\", async () => {\n+ const cwd = await initFixture(\"basic\");\n- it(\"returns false when git command fails\", () => {\n- ChildProcessUtilities.execSync.mockImplementationOnce(() => {\n- throw new Error(\"fatal: your current branch 'master' does not have any commits yet\");\n- });\n+ expect(GitUtilities.hasCommit({ cwd })).toBe(true);\n- expect(GitUtilities.hasCommit()).toBe(false);\n+ await fs.remove(path.join(cwd, \".git\"));\n+ expect(GitUtilities.hasCommit({ cwd })).toBe(false);\n});\n});\ndescribe(\".isBehindUpstream()\", () => {\n- const aheadBehindCountOriginal = GitUtilities.aheadBehindCount;\n- afterEach(() => {\n- GitUtilities.aheadBehindCount = aheadBehindCountOriginal;\n- });\n-\n- it(\"returns true when behind upstream\", () => {\n- const opts = { cwd: \"test\" };\n- GitUtilities.aheadBehindCount = jest.fn(() => ({ ahead: 0, behind: 1 }));\n- expect(GitUtilities.isBehindUpstream(\"origin\", opts)).toBe(true);\n- });\n-\n- it(\"returns false when not behind upstream\", () => {\n- const opts = { cwd: \"test\" };\n- GitUtilities.aheadBehindCount = jest.fn(() => ({ ahead: 0, behind: 0 }));\n- expect(GitUtilities.isBehindUpstream(\"origin\", opts)).toBe(false);\n- });\n- });\n+ it(\"returns true when behind upstream\", async () => {\n+ const { cwd } = await cloneFixture(\"basic\");\n- describe(\".aheadBehindCount()\", () => {\n- const getCurrentBranchOriginal = GitUtilities.getCurrentBranch;\n- afterEach(() => {\n- GitUtilities.getCurrentBranch = getCurrentBranchOriginal;\n- });\n-\n- it(\"returns the number of commits the local repo is behind upstream\", () => {\n- const opts = { cwd: \"test\" };\n- GitUtilities.getCurrentBranch = jest.fn(() => \"master\");\n- ChildProcessUtilities.execSync.mockReturnValueOnce(\"5\\t0\");\n-\n- const aheadBehindCount = GitUtilities.aheadBehindCount(\"origin\", opts);\n- expect(aheadBehindCount.behind).toBe(5);\n- });\n+ expect(GitUtilities.isBehindUpstream(\"origin\", { cwd })).toBe(false);\n- it(\"returns the number of commits the local repo is ahead upstream\", () => {\n- const opts = { cwd: \"test\" };\n- GitUtilities.getCurrentBranch = jest.fn(() => \"master\");\n- ChildProcessUtilities.execSync.mockReturnValueOnce(\"0\\t2\");\n+ await execa(\"git\", [\"commit\", \"--allow-empty\", \"-m\", \"change\"], { cwd });\n+ await execa(\"git\", [\"push\", \"origin\", \"master\"], { cwd });\n+ await execa(\"git\", [\"reset\", \"--hard\", \"HEAD^\"], { cwd });\n- const aheadBehindCount = GitUtilities.aheadBehindCount(\"origin\", opts);\n- expect(aheadBehindCount.ahead).toBe(2);\n+ expect(GitUtilities.isBehindUpstream(\"origin\", { cwd })).toBe(true);\n});\n});\n});\n", "new_path": "core/git-utils/__tests__/git-utils.test.js", "old_path": "core/git-utils/__tests__/git-utils.test.js" }, { "change_type": "MODIFY", "diff": "@@ -86,16 +86,6 @@ function getLastTaggedCommit(opts) {\nreturn taggedCommit;\n}\n-function getLastTaggedCommitInBranch(opts) {\n- log.silly(\"getLastTaggedCommitInBranch\");\n-\n- const tagName = exports.getLastTag(opts);\n- const commitInBranch = ChildProcessUtilities.execSync(\"git\", [\"rev-list\", \"-n\", \"1\", tagName], opts);\n- log.verbose(\"getLastTaggedCommitInBranch\", commitInBranch);\n-\n- return commitInBranch;\n-}\n-\nfunction getFirstCommit(opts) {\nlog.silly(\"getFirstCommit\");\n@@ -124,15 +114,6 @@ function getLastTag(opts) {\nreturn lastTag;\n}\n-function describeTag(ref, opts) {\n- log.silly(\"describeTag\", ref);\n-\n- const description = ChildProcessUtilities.execSync(\"git\", [\"describe\", \"--tags\", ref], opts);\n- log.silly(\"describeTag\", description);\n-\n- return description;\n-}\n-\nfunction diffSinceIn(committish, location, opts) {\nconst args = [\"diff\", \"--name-only\", committish];\nconst formattedLocation = slash(path.relative(opts.cwd, location));\n@@ -211,40 +192,26 @@ function hasCommit(opts) {\nreturn retVal;\n}\n-function fetchGitRemote(opts) {\n- log.silly(\"fetchGitRemote\");\n- ChildProcessUtilities.execSync(\"git\", [\"remote\", \"update\"], opts);\n-}\n-\nfunction isBehindUpstream(gitRemote, opts) {\nlog.silly(\"isBehindUpstream\");\n- exports.fetchGitRemote(opts);\n- const status = exports.aheadBehindCount(gitRemote, opts);\n- const behind = status.behind >= 1;\n-\n- log.verbose(\"isBehindUpstream\", behind);\n- return behind;\n-}\n+ // git fetch, but for everything\n+ ChildProcessUtilities.execSync(\"git\", [\"remote\", \"update\"], opts);\n-function aheadBehindCount(gitRemote, opts) {\n- const branchName = exports.getCurrentBranch(opts);\n- const branchComparator = `${gitRemote}/${branchName}...${branchName}`;\n- const rawAheadBehind = ChildProcessUtilities.execSync(\n+ const branch = exports.getCurrentBranch(opts);\n+ const countLeftRight = ChildProcessUtilities.execSync(\n\"git\",\n- [\"rev-list\", \"--left-right\", \"--count\", branchComparator],\n+ [\"rev-list\", \"--left-right\", \"--count\", `${gitRemote}/${branch}...${branch}`],\nopts\n);\n-\n- const aheadBehind = rawAheadBehind.split(\"\\t\");\n- const behind = parseInt(aheadBehind[0], 10);\n- const ahead = parseInt(aheadBehind[1], 10);\n+ const [behind, ahead] = countLeftRight.split(\"\\t\").map(val => parseInt(val, 10));\nlog.silly(\n- \"aheadBehindCount\",\n- `behind ${gitRemote}/${branchName} by ${behind} commits; ${branchName} is ahead by ${ahead} commits`\n+ \"isBehindUpstream\",\n+ `${branch} is behind ${gitRemote}/${branch} by ${behind} commit(s) and ahead by ${ahead}`\n);\n- return { ahead, behind };\n+\n+ return Boolean(behind);\n}\nexports.isDetachedHead = isDetachedHead;\n@@ -254,11 +221,9 @@ exports.commit = commit;\nexports.addTag = addTag;\nexports.hasTags = hasTags;\nexports.getLastTaggedCommit = getLastTaggedCommit;\n-exports.getLastTaggedCommitInBranch = getLastTaggedCommitInBranch;\nexports.getFirstCommit = getFirstCommit;\nexports.pushWithTags = pushWithTags;\nexports.getLastTag = getLastTag;\n-exports.describeTag = describeTag;\nexports.diffSinceIn = diffSinceIn;\nexports.getWorkspaceRoot = getWorkspaceRoot;\nexports.getCurrentBranch = getCurrentBranch;\n@@ -267,6 +232,4 @@ exports.getShortSHA = getShortSHA;\nexports.checkoutChanges = checkoutChanges;\nexports.init = init;\nexports.hasCommit = hasCommit;\n-exports.fetchGitRemote = fetchGitRemote;\nexports.isBehindUpstream = isBehindUpstream;\n-exports.aheadBehindCount = aheadBehindCount;\n", "new_path": "core/git-utils/index.js", "old_path": "core/git-utils/index.js" } ]
JavaScript
MIT License
lerna/lerna
fix(git-utils): Remove unused methods, stop mocking tests
1
fix
git-utils
807,849
23.03.2018 14:06:13
25,200
ae537e3ae6562f97b39cbbce861adc8f98e378b2
test(git-utils): fix windows garbage
[ { "change_type": "MODIFY", "diff": "@@ -171,7 +171,7 @@ describe(\"GitUtilities\", () => {\nconst fileDiff = GitUtilities.diffSinceIn(\"v1.2.3\", path.dirname(file), { cwd });\nexpect(rootDiff).toMatch(\"package.json\");\n- expect(fileDiff).toBe(path.relative(cwd, file));\n+ expect(fileDiff).toBe(\"packages/pkg-5/index.js\");\n});\n});\n@@ -181,7 +181,7 @@ describe(\"GitUtilities\", () => {\nconst cwd = path.join(topLevel, \"foo\");\nawait fs.mkdirp(cwd);\n- expect(GitUtilities.getWorkspaceRoot({ cwd })).toBe(topLevel);\n+ expect(GitUtilities.getWorkspaceRoot({ cwd })).toBe(slash(topLevel));\n});\n});\n", "new_path": "core/git-utils/__tests__/git-utils.test.js", "old_path": "core/git-utils/__tests__/git-utils.test.js" } ]
JavaScript
MIT License
lerna/lerna
test(git-utils): fix windows garbage
1
test
git-utils
807,849
23.03.2018 14:12:57
25,200
34f3b5885ced0ce95bf186a14b84dbb94b4d9f0e
refactor(publish): Move shortHash to predicate conditional
[ { "change_type": "MODIFY", "diff": "@@ -54,7 +54,6 @@ class PublishCommand extends Command {\nif (this.options.canary) {\nthis.logger.info(\"canary\", \"enabled\");\n- this.shortHash = GitUtilities.getShortSHA(this.execOpts);\n}\nif (!this.project.isIndependent()) {\n@@ -255,8 +254,9 @@ class PublishCommand extends Command {\nconst release = cdVersion || \"minor\";\n// FIXME: this complicated defaulting should be done in yargs option.coerce()\nconst keyword = typeof canary !== \"string\" ? preid || \"alpha\" : canary;\n+ const shortHash = GitUtilities.getShortSHA(this.execOpts);\n- predicate = ({ version }) => `${semver.inc(version, release)}-${keyword}.${this.shortHash}`;\n+ predicate = ({ version }) => `${semver.inc(version, release)}-${keyword}.${shortHash}`;\n} else if (cdVersion) {\npredicate = ({ version }) => semver.inc(version, cdVersion, preid);\n} else if (conventionalCommits) {\n@@ -503,7 +503,6 @@ class PublishCommand extends Command {\nchain = chain.then(() => this.runPackageLifecycle(rootPkg, \"version\"));\nif (this.gitEnabled) {\n- // chain = chain.then(() => GitUtilities.addFiles(changedFiles, this.execOpts));\nchain = chain.then(() => GitUtilities.addFiles(Array.from(changedFiles), this.execOpts));\n}\n", "new_path": "commands/publish/index.js", "old_path": "commands/publish/index.js" } ]
JavaScript
MIT License
lerna/lerna
refactor(publish): Move shortHash to predicate conditional
1
refactor
publish
217,922
23.03.2018 14:26:00
-3,600
7ed7f4bd6f0a543036bfc9b5232d3ae5083e37c9
fix: various minor bugs reported by sentry
[ { "change_type": "MODIFY", "diff": "@@ -64,8 +64,11 @@ Raven\nexport class RavenErrorHandler implements ErrorHandler {\nhandleError(err: any): void {\n+ if (err.message !== 'Not found') {\nRaven.captureException(err);\n}\n+ console.error(err);\n+ }\n}\nexport function HttpLoaderFactory(http: HttpClient) {\n", "new_path": "src/app/app.module.ts", "old_path": "src/app/app.module.ts" }, { "change_type": "MODIFY", "diff": "@@ -229,6 +229,9 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\n}\nisOwnList(): boolean {\n+ if(this.listData === null){\n+ return false;\n+ }\nreturn this.user !== undefined && this.user !== null && this.user.uid === this.listData.authorId;\n}\n", "new_path": "src/app/pages/list/list-details/list-details.component.ts", "old_path": "src/app/pages/list/list-details/list-details.component.ts" }, { "change_type": "MODIFY", "diff": "@@ -57,11 +57,13 @@ export class MacroTranslationComponent {\ntry {\n// If there's no skill match with the first regex, try the second one (for auto translated skills)\nmatch = this.findActionsAutoTranslatedRegex.exec(line);\n+ if (match !== null) {\nconst translatedSkill = this.localizedDataService.getCraftingActionByName(match[2], this.macroLanguage);\n// Push translated line to each language\nObject.keys(macroTranslated).forEach(key => {\nmacroTranslated[key].push(line.replace(match[2], `\"${translatedSkill[key]}\" `));\n});\n+ }\n} catch (ignoredAgain) {\nthis.invalidInputs = true;\nbreak;\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: various minor bugs reported by sentry
1
fix
null
679,913
23.03.2018 14:49:53
0
f75486d4983727cfae075c2a336769b4773c1b86
feat(pointfree): add unwrap, quatations, math/bitops, array/obj access add runU(), wordU() & unwrap() add execQ() for running quotations add more math ops add at(), storeAt() add mapN() various small optimizations / refactorings
[ { "change_type": "MODIFY", "diff": "functional composition via lightweight (1.8KB gzipped) Forth style stack\nexecution engine using vanilla JS functions as words and arbitrary stack\nvalues (incl. other stack functions / words). Supports nested execution\n-environments and currently includes approx. 50 stack operators,\n-conditionals, looping constructs, math & logic ops etc.\n+environments, quotations, stack mapping and currently includes 60+ stack\n+operators, conditionals, looping constructs, math, binary & logic ops etc.\nOriginally, this project started out as precursor of the [Charlie Forth\nVM/REPL](http://forth.thi.ng) (JS) and\n@@ -64,7 +64,12 @@ has on the stack structure.\n#### `run(stack: Stack, program: StackProgram, env?: StackEnv, onerror?: Trap)`\n-`run()` takes an initial stack, a pointfree stack program and optional environment (an arbitrary object), executes program and then returns tuple of: `[status, stack, env]`\n+`run()` is the main function of this library. It takes an initial stack,\n+a pointfree stack program and optional environment (an arbitrary\n+object), executes program and then returns tuple of: `[status, stack,\n+env]`.\n+\n+Alternatively, we can use `runU()` to return an unwrapped section of the result stack. We use this for some of the examples below.\nA stack program consists of an array of functions with this signature:\n@@ -94,6 +99,10 @@ pf.run(\n### Custom word definitions\n+Custom 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+\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@@ -102,9 +111,20 @@ const madd = pf.word([pf.invrot, pf.mul, pf.add]);\n// compute 3 * 5 + 10\nmadd([3, 5, 10]);\n// [ true, [25], {}]\n+\n+// unwrapped version\n+const maddU = pf.wordU([pf.invrot, pf.mul, pf.add]);\n+\n+// compute 3 * 5 + 10\n+maddU([3, 5, 10]);\n+// 25\n```\n-### Vanilla JS words\n+### Factoring\n+\n+Factoring is a crucial aspect of developing programs in concatenative\n+languages. The general idea is to decompose a larger solution into\n+smaller re-usable words.\n```typescript\n// compute square of x\n@@ -112,7 +132,7 @@ madd([3, 5, 10]);\nconst pow2 = pf.word([pf.dup, pf.mul]);\n// test word with given stack\n-pow2([10])\n+pow2([-10])\n// [true, [100], {}]\n// compute magnitude of 2d vector\n@@ -122,26 +142,46 @@ const mag2 = pf.word([\npf.swap, // ( x y^2 -- y^2 x )\npow2, // ( y^2 x -- y^2 x^2 )\npf.add, // ( y^2 x^2 -- sum )\n- pf.map((x)=> Math.sqrt(x))\n+ pf.sqrt\n]);\nmag2([-10, 10])[1];\n// [ 14.142135623730951 ]\n```\n+### Quotations\n+\n+Quoatations are programs stored on the stack and enable a form of\n+dynamic meta programming. Quotations are executed via `execQ`. This\n+example uses a quoted form of above `pow2` word:\n+\n+```typescript\n+pf.runU([10], [\n+ // push quotation on stack\n+ pf.push([pf.dup, pf.mul])\n+ // execute\n+ pf.execQ,\n+ // output result\n+ pf.print\n+]);\n+// 100\n+```\n+\n### Conditionals\nSee `cond` documentation further below...\n```typescript\n// negate TOS item ONLY if negative, else do nothing\n-const abs = pf.word([pf.dup, pf.isNeg, pf.cond(pf.neg)]);\n+const abs = pf.wordU([pf.dup, pf.isNeg, pf.cond(pf.neg)]);\n-abs([-42], abs)[1]\n-// [ 42 ]\n+// test w/ negative inputs\n+abs([-42])\n+// 42\n-abs([42], abs)[1]\n-// [ 42 ]\n+// test w/ positive inputs\n+abs([42])\n+// 42\n```\n```typescript\n@@ -170,21 +210,53 @@ classify([-100])[1]\n```typescript\n// print countdown from 3\n-pf.run([3], [pf.loop(pf.isPos, [pf.dup, pf.print, pf.dec])])\n+pf.run([3], pf.loop(pf.isPos, [pf.dup, pf.print, pf.dec]))\n// 3\n// 2\n// 1\n// [ true, [ 0 ], undefined ]\n```\n-### Environment accumulator\n+### In-place stack value transformation\n+\n+The `map()`, `map2()`, `mapN()` higher order words can be used to transform stack items in place using vanilla JS functions:\n+\n+- `map(f)` - map TOS\n+- `map2(f)` - pops top 2 stack items, pushes result back on stack\n+- `mapN(f)` - map stack item @ TOS - n (see stack effects further below)\n+\n+```typescript\n+pf.run(\n+ // data items, num items\n+ [10,20,30,40, 4],\n+ [\n+ pf.loop(\n+ // test predicate\n+ pf.isPos,\n+ [\n+ // duplicate counter\n+ pf.dup,\n+ // map item @ TOS - curr counter\n+ pf.mapN(x => x * 10),\n+ // decrease counter\n+ pf.dec\n+ ]),\n+ // remove counter from stack\n+ pf.drop\n+ ]);\n+// [ true, [ 100, 200, 300, 400 ], {} ]\n+```\n+\n+### Environment as accumulator\n```typescript\nmakeIDObject = (k) => pf.word([\n// this inner word uses a blank environment\n// to create new objects of `{id: <TOS>}\npf.word([pf.push(\"id\"), pf.store, pf.pushEnv], {}),\n+ // push given key `k` on stack\npf.push(k),\n+ // store env returned from inner word under `k` in curr env\npf.store\n]);\n// transform stack into result object\n@@ -214,6 +286,7 @@ at word construction time and return a pre-configured stack function.\n| `dupIf` | If TOS is truthy: `( x -- x x )` |\n| `map(fn)` | `( x -- f(x) )` |\n| `map2(fn)` | `( x y -- f(x,y) )` |\n+| `mapN(fn)` | `( n -- f(stack[-n]) )` |\n| `nip` | `( x y -- y )` |\n| `over` | `( x y -- x y x )` |\n| `pick` | `( x -- stack[x] )` |\n@@ -225,6 +298,13 @@ at word construction time and return a pre-configured stack function.\n| `tuck` | `( x y -- y x y )` |\n| `depth` | `( -- stack.length )` |\n+### Dynamic execution\n+\n+| Word | Stack effect |\n+| --- | --- |\n+| `exec` | ` ( w -- ? )` |\n+| `execQ` | ` ( q -- ? )` |\n+\n### Math\n| Word | Stack effect |\n@@ -237,6 +317,13 @@ at word construction time and return a pre-configured stack function.\n| `inc` | `( x -- x+1 )` |\n| `dec` | `( x -- x-1 )` |\n| `neg` | `( x -- -x )` |\n+| `lsl` | `( x y -- x<<y )` |\n+| `lsr` | `( x y -- x>>y )` |\n+| `lsru` | `( x y -- x>>>y )` |\n+| `bitAnd` | `( x y -- x&y )` |\n+| `bitOr` | `( x y -- x|y )` |\n+| `bitXor` | `( x y -- x^y )` |\n+| `bitNot` | `( x -- ~x )` |\n### Logic\n@@ -267,10 +354,12 @@ at word construction time and return a pre-configured stack function.\n| `storeKey(k)` | `( x -- )` |\n| `pushEnv` | `( -- env )` |\n-### Misc\n+### Arrays, objects, strings\n| Word | Stack effect |\n| --- | --- |\n+| `at` | `( obj k -- obj[k] )` |\n+| `storeAt` | `( val obj k -- )` |\n| `length` | `( x -- x.length )` |\n| `print` | `( x -- )` |\n", "new_path": "packages/pointfree/README.md", "old_path": "packages/pointfree/README.md" }, { "change_type": "MODIFY", "diff": "@@ -11,6 +11,7 @@ export type StackFn = (stack: Stack, env?: StackEnv) => void;\nexport type StackProgram = StackFn[];\nexport type StackProc = StackFn | StackProgram;\nexport type Trap = (e: Error, stack: Stack, program: StackProgram, i: number) => boolean;\n+export type RunResult = [boolean, Stack, StackEnv];\n/**\n* Executes program with given initial stack and optional environment.\n@@ -20,24 +21,34 @@ export type Trap = (e: Error, stack: Stack, program: StackProgram, i: number) =>\n* @param env\n* @param onerror\n*/\n-export const run = (stack: Stack, prog: StackProc, env: StackEnv = {}, onerror?: Trap) => {\n+export const run = (stack: Stack, prog: StackProc, env: StackEnv = {}, onerror?: Trap): RunResult => {\nstack = stack || [];\nconst program = isArray(prog) ? prog : [prog];\nfor (let i = 0, n = program.length; i < n; i++) {\ntry {\nprogram[i](stack, env);\n} catch (e) {\n- if (!onerror) {\n+ if (!onerror || !onerror(e, stack, program, i)) {\nconsole.error(`${e.message} @ word #${i}`);\nreturn [false, stack, env];\n- } else if (!onerror(e, stack, program, i)) {\n- return [false, stack, env];\n}\n}\n}\nreturn [true, stack, env];\n};\n+/**\n+ * Like `run()`, but returns unwrapped result. See `unwrap()`.\n+ *\n+ * @param stack\n+ * @param prog\n+ * @param n\n+ * @param env\n+ * @param onerror\n+ */\n+export const runU = (stack: Stack, prog: StackProc, n = 1, env: StackEnv = {}, onerror?: Trap) =>\n+ unwrap(run(stack, prog, env, onerror), n);\n+\nconst $ = DEBUG ?\n(stack: Stack, n: number) => {\nif (stack.length < n) {\n@@ -57,6 +68,19 @@ const $n = DEBUG ?\nconst $stackFn = (f: StackProc) =>\nisArray(f) ? word(f) : f;\n+/**\n+ * Takes a result tuple returned by `run()` and unwraps one or more\n+ * items from result stack. If no `n` is given, default to single value\n+ * (TOS) and returns it as is. Returns an array for all other `n`.\n+ *\n+ * @param param0\n+ * @param n\n+ */\n+export const unwrap = ([_, stack]: RunResult, n = 1) =>\n+ n === 1 ?\n+ tos(stack) :\n+ stack.slice(Math.max(0, stack.length - n));\n+\n/**\n* Higher order word. Replaces TOS with result of given op.\n*\n@@ -80,11 +104,11 @@ const op1 = (op: (x) => any) => {\n*\n* @param op\n*/\n-const op2 = (op: (b, a) => any) => {\n- return (stack: Stack) => {\n- $(stack, 2);\n- stack.push(op(stack.pop(), stack.pop()));\n- }\n+const op2 = (op: (b, a) => any) =>\n+ (stack: Stack) => {\n+ const n = stack.length - 2;\n+ $n(n, 0);\n+ stack[n] = op(stack.pop(), stack[n]);\n};\nconst tos = (stack: Stack) => stack[stack.length - 1];\n@@ -154,9 +178,7 @@ export const dropIf = (stack: Stack) => {\n*\n* @param args\n*/\n-export const push = (...args: any[]) => {\n- return (stack: Stack) => stack.push(...args);\n-};\n+export const push = (...args: any[]) => (stack: Stack) => stack.push(...args);\n/**\n* Pushes current env onto stack.\n@@ -216,8 +238,8 @@ export const dupIf = (stack: Stack) => {\n* @param stack\n*/\nexport const swap = (stack: Stack) => {\n- $(stack, 2);\nconst n = stack.length - 1;\n+ $n(n, 1);\nconst a = stack[n - 1];\nstack[n - 1] = stack[n];\nstack[n] = a;\n@@ -231,8 +253,8 @@ export const swap = (stack: Stack) => {\n* @param stack\n*/\nexport const swap2 = (stack: Stack) => {\n- $(stack, 4);\nconst n = stack.length - 1;\n+ $n(n, 3);\nconst d = stack[n];\nconst c = stack[n - 1];\nstack[n - 1] = stack[n - 3];\n@@ -249,9 +271,9 @@ export const swap2 = (stack: Stack) => {\n* @param stack\n*/\nexport const nip = (stack: Stack) => {\n- $(stack, 2);\n- const a = stack.pop();\n- stack[stack.length - 1] = a;\n+ const n = stack.length - 2;\n+ $n(n, 0);\n+ stack[n] = stack.pop();\n};\n/**\n@@ -263,9 +285,8 @@ export const nip = (stack: Stack) => {\n*/\nexport const tuck = (stack: Stack) => {\n$(stack, 2);\n- const b = stack.pop();\nconst a = stack.pop();\n- stack.push(b, a, b);\n+ stack.push(a, stack.pop(), a);\n};\n/**\n@@ -276,8 +297,8 @@ export const tuck = (stack: Stack) => {\n* @param stack\n*/\nexport const rot = (stack: Stack) => {\n- $(stack, 3);\nconst n = stack.length - 1;\n+ $n(n, 2);\nconst c = stack[n - 2];\nstack[n - 2] = stack[n - 1];\nstack[n - 1] = stack[n];\n@@ -292,8 +313,8 @@ export const rot = (stack: Stack) => {\n* @param stack\n*/\nexport const invrot = (stack: Stack) => {\n- $(stack, 3);\nconst n = stack.length - 1;\n+ $n(n, 2);\nconst c = stack[n];\nstack[n] = stack[n - 1];\nstack[n - 1] = stack[n - 2];\n@@ -308,8 +329,9 @@ export const invrot = (stack: Stack) => {\n* @param stack\n*/\nexport const over = (stack: Stack) => {\n- $(stack, 2);\n- stack.push(stack[stack.length - 2]);\n+ const n = stack.length - 2;\n+ $n(n, 0);\n+ stack.push(stack[n]);\n}\n/**\n@@ -340,6 +362,76 @@ export const sub = op2((b, a) => a - b);\n*/\nexport const div = op2((b, a) => a / b);\n+/**\n+ * ( x y -- x%y )\n+ *\n+ * @param stack\n+ */\n+export const mod = op2((b, a) => a % b);\n+\n+/**\n+ * ( x y -- pow(x,y) )\n+ *\n+ * @param stack\n+ */\n+export const pow = op2((b, a) => Math.pow(a, b));\n+\n+/**\n+ * ( x -- sqrt(x) )\n+ *\n+ * @param stack\n+ */\n+export const sqrt = op1(Math.sqrt);\n+\n+/**\n+ * ( x y -- x&y )\n+ *\n+ * @param stack\n+ */\n+export const bitAnd = op2((b, a) => a & b);\n+\n+/**\n+ * ( x y -- x|y )\n+ *\n+ * @param stack\n+ */\n+export const bitOr = op2((b, a) => a | b);\n+\n+/**\n+ * ( x y -- x^y )\n+ *\n+ * @param stack\n+ */\n+export const bitXor = op2((b, a) => a ^ b);\n+\n+/**\n+ * ( x -- ~x )\n+ *\n+ * @param stack\n+ */\n+export const bitNot = op1((x) => ~x);\n+\n+/**\n+ * ( x y -- x<<y )\n+ *\n+ * @param stack\n+ */\n+export const lsl = op2((b, a) => a << b);\n+\n+/**\n+ * ( x y -- x>>y )\n+ *\n+ * @param stack\n+ */\n+export const lsr = op2((b, a) => a >> b);\n+\n+/**\n+ * ( x y -- x>>>y )\n+ *\n+ * @param stack\n+ */\n+export const lsru = op2((b, a) => a >>> b);\n+\n/**\n* ( x -- x+1 )\n*\n@@ -386,6 +478,10 @@ export const word = (prog: StackProgram, env?: StackEnv) =>\n(stack: Stack, _env: StackEnv) =>\nrun(stack, prog, env ? { ...env } : _env);\n+export const wordU = (prog: StackProgram, env?: StackEnv, n = 1) =>\n+ (stack: Stack, _env: StackEnv) =>\n+ runU(stack, prog, n, env ? { ...env } : _env);\n+\n/**\n* Higher order word. Takes two stack programs: truthy and falsey\n* branches, respectively. When executed, pops TOS and runs only one of\n@@ -480,6 +576,19 @@ export const exec = (stack: Stack, env: StackEnv) => {\nstack.pop()(stack, env);\n};\n+/**\n+ * Pops TOS and executes it as stack program. TOS MUST be an array of\n+ * words, i.e. an quotation).\n+ *\n+ * ( x -- ? )\n+ *\n+ * @param stack\n+ */\n+export const execQ = (stack: Stack, env: StackEnv) => {\n+ $(stack, 1);\n+ run(stack, stack.pop(), env);\n+};\n+\n/**\n* ( x y -- x===y )\n*\n@@ -599,10 +708,34 @@ export const print = (stack: Stack) => {\nconsole.log(stack.pop());\n};\n+/**\n+ * Reads key/index from object/array.\n+ *\n+ * ( obj k -- obj[k] )\n+ *\n+ * @param stack\n+ */\n+export const at = op2((b, a) => a[b]);\n+\n+/**\n+ * Writes `val` at key/index in object/array.\n+ *\n+ * ( val obj k -- )\n+ *\n+ * @param stack\n+ */\n+export const storeAt = (stack: Stack) => {\n+ const n = stack.length - 3;\n+ $n(n, 0);\n+ stack[n + 1][stack[n + 2]] = stack[n];\n+ stack.length = n;\n+};\n+\n/**\n* Loads value for `key` from env and pushes it on stack.\n*\n* ( key -- env[key] )\n+ *\n* @param stack\n* @param env\n*/\n@@ -650,6 +783,23 @@ export const storeKey = (key: PropertyKey) =>\nenv[key] = stack.pop();\n};\n+/**\n+ * Higher order word. Pops TOS and uses it as index to transform stack\n+ * item @ `stack[TOS]` w/ given transformation.\n+ *\n+ * ( x -- )\n+ *\n+ * @param op\n+ */\n+export const mapN = (op: (x) => any) =>\n+ (stack: Stack) => {\n+ let n = stack.length - 1;\n+ $n(n, 0);\n+ n -= stack.pop() + 1;\n+ $n(n, 0);\n+ stack[n] = op(stack[n]);\n+ };\n+\nexport {\nop1 as map,\nop2 as map2\n", "new_path": "packages/pointfree/src/index.ts", "old_path": "packages/pointfree/src/index.ts" }, { "change_type": "MODIFY", "diff": "-// import * as assert from \"assert\";\n-// import * as pointfree from \"../src/index\";\n+import * as assert from \"assert\";\n+import * as pf from \"../src/index\";\ndescribe(\"pointfree\", () => {\n- it(\"tests pending\");\n+\n+ it(\"unwrap\", () => {\n+ const res: pf.RunResult = [true, [1, 2, 3], {}];\n+ assert.equal(pf.unwrap(<any>[, []]), undefined);\n+ assert.equal(pf.unwrap(res), 3);\n+ assert.deepEqual(pf.unwrap(res, 2), [2, 3]);\n+ assert.deepEqual(pf.unwrap(res, 3), [1, 2, 3]);\n+ assert.deepEqual(pf.unwrap(res, 4), [1, 2, 3]);\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 unwrap, quatations, math/bitops, array/obj access - add runU(), wordU() & unwrap() - add execQ() for running quotations - add more math ops - add at(), storeAt() - add mapN() - various small optimizations / refactorings
1
feat
pointfree
821,196
23.03.2018 15:56:56
25,200
4106708e3fa2332fcada0361c76a1071f61315a8
feat: add hook generator
[ { "change_type": "MODIFY", "diff": "@@ -67,6 +67,17 @@ jobs:\n- run: .circleci/setup_git\n- run: yarn exec nps test.command\n- store_test_results: *store_test_results\n+ node-latest-hook:\n+ <<: *lint\n+ docker:\n+ - image: node:8\n+ steps: &hook_steps\n+ - checkout\n+ - restore_cache: *restore_cache\n+ - attach_workspace: {at: node_modules}\n+ - run: .circleci/setup_git\n+ - run: yarn exec nps test.hook\n+ - store_test_results: *store_test_results\nnode-8-base: &node_8\n<<: *lint\ndocker:\n@@ -87,6 +98,9 @@ jobs:\nnode-8-command:\n<<: *node_8\nsteps: *command_steps\n+ node-8-hook:\n+ <<: *node_8\n+ steps: *hook_steps\ncache:\n<<: *lint\n@@ -149,8 +163,10 @@ workflows:\n- node-latest-plugin: {requires: [lint] }\n- node-latest-multi: {requires: [lint] }\n- node-latest-command: {requires: [lint] }\n+ - node-latest-hook: {requires: [lint] }\n- node-8-base: {requires: [lint] }\n- node-8-single: {requires: [lint] }\n- node-8-plugin: {requires: [lint] }\n- node-8-multi: {requires: [lint] }\n- node-8-command: {requires: [lint] }\n+ - node-8-hook: {requires: [lint] }\n", "new_path": ".circleci/config.yml", "old_path": ".circleci/config.yml" }, { "change_type": "MODIFY", "diff": "@@ -7,6 +7,7 @@ environment:\n- TEST_TYPE: plugin\n- TEST_TYPE: multi\n- TEST_TYPE: command\n+ - TEST_TYPE: hook\ncache:\n- '%LOCALAPPDATA%\\Yarn -> appveyor.yml'\n- node_modules -> yarn.lock\n", "new_path": "appveyor.yml", "old_path": "appveyor.yml" }, { "change_type": "MODIFY", "diff": "@@ -15,7 +15,7 @@ sh.set('-e')\nsetColors(['dim'])\n-const testTypes = ['base', 'plugin', 'single', 'multi', 'command']\n+const testTypes = ['base', 'plugin', 'single', 'multi', 'command', 'hook']\nconst tests = testTypes.map(cmd => {\nconst {silent} = sh.config\nsh.config.silent = true\n", "new_path": "package-scripts.js", "old_path": "package-scripts.js" }, { "change_type": "MODIFY", "diff": "\"devDependencies\": {\n\"@oclif/dev-cli\": \"^1.3.1\",\n\"@oclif/tslint\": \"^1.0.2\",\n- \"@types/lodash\": \"^4.14.105\",\n+ \"@types/lodash\": \"^4.14.106\",\n\"@types/read-pkg\": \"^3.0.0\",\n\"@types/shelljs\": \"^0.7.8\",\n\"@types/yeoman-generator\": \"^2.0.1\",\n\"fancy-test\": \"^1.0.1\",\n\"fs-extra\": \"^5.0.0\",\n\"globby\": \"^8.0.1\",\n- \"mocha\": \"^5.0.4\",\n+ \"mocha\": \"^5.0.5\",\n\"npm-run-path\": \"^2.0.2\",\n\"nps\": \"^5.8.2\",\n\"shelljs\": \"^0.8.1\",\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "@@ -25,6 +25,6 @@ export default abstract class AppCommand extends Base {\nname: args.name,\ndefaults: flags.defaults,\nforce: flags.force\n- })\n+ } as Options)\n}\n}\n", "new_path": "src/commands/command.ts", "old_path": "src/commands/command.ts" }, { "change_type": "ADD", "diff": "+import {flags} from '@oclif/command'\n+\n+import Base from '../command_base'\n+\n+export interface Options {\n+ name: string\n+ defaults?: boolean\n+ force?: boolean\n+ event: string\n+}\n+\n+export default abstract class HookCommand extends Base {\n+ static description = 'add a hook to an existing CLI or plugin'\n+\n+ static flags = {\n+ defaults: flags.boolean({description: 'use defaults for every setting'}),\n+ force: flags.boolean({description: 'overwrite existing files'}),\n+ event: flags.string({description: 'event to run hook on', default: 'init'}),\n+ }\n+ static args = [\n+ {name: 'name', description: 'name of hook (snake_case)', required: true}\n+ ]\n+\n+ async run() {\n+ const {flags, args} = this.parse(HookCommand)\n+ await super.generate('hook', {\n+ name: args.name,\n+ event: flags.event,\n+ defaults: flags.defaults,\n+ force: flags.force,\n+ } as Options)\n+ }\n+}\n", "new_path": "src/commands/hook.ts", "old_path": null }, { "change_type": "ADD", "diff": "+// tslint:disable no-floating-promises\n+// tslint:disable no-console\n+\n+import * as _ from 'lodash'\n+import * as path from 'path'\n+import * as Generator from 'yeoman-generator'\n+import yosay = require('yosay')\n+\n+import {Options} from '../commands/hook'\n+\n+const {version} = require('../../package.json')\n+\n+class HookGenerator extends Generator {\n+ pjson!: any\n+\n+ get _path() { return this.options.name.split(':').join('/') }\n+ get _ts() { return this.pjson.devDependencies.typescript }\n+ get _ext() { return this._ts ? 'ts' : 'js' }\n+ get _mocha() { return this.pjson.devDependencies.mocha }\n+\n+ constructor(args: any, public options: Options) {\n+ super(args, options)\n+ }\n+\n+ async prompting() {\n+ this.pjson = this.fs.readJSON('package.json')\n+ this.pjson.oclif = this.pjson.oclif || {}\n+ if (!this.pjson) throw new Error('not in a project directory')\n+ this.log(yosay(`Adding a ${this.options.event} hook to ${this.pjson.name} Version: ${version}`))\n+ }\n+\n+ writing() {\n+ this.sourceRoot(path.join(__dirname, '../../templates'))\n+ this.fs.copyTpl(this.templatePath(`src/hook.${this._ext}.ejs`), this.destinationPath(`src/hooks/${this.options.event}/${this.options.name}.${this._ext}`), this)\n+ if (this._mocha) {\n+ this.fs.copyTpl(this.templatePath(`test/hook.test.${this._ext}.ejs`), this.destinationPath(`test/commands/${this._path}.test.${this._ext}`), this)\n+ }\n+ this.pjson.oclif = this.pjson.oclif || {}\n+ let hooks = this.pjson.oclif.hooks = this.pjson.oclif.hooks || {}\n+ let p = `./${this._ts ? 'lib' : 'src'}/hooks/${this.options.event}/${this.options.name}.js`\n+ if (hooks[this.options.event]) {\n+ hooks[this.options.event] = _.castArray(hooks[this.options.event])\n+ hooks[this.options.event].push(p)\n+ } else {\n+ this.pjson.oclif.hooks[this.options.event] = p\n+ }\n+ this.fs.writeJSON(this.destinationPath('./package.json'), this.pjson)\n+ }\n+}\n+\n+export = HookGenerator\n", "new_path": "src/generators/hook.ts", "old_path": null }, { "change_type": "DELETE", "diff": "-const {expect, test} = require('@oclif/test')\n-\n-describe('hooks', () => {\n- test\n- .stdout()\n- .hook('init', {id: 'mycommand'})\n- .do(output => expect(output.stdout).to.contain('example hook running mycommand'))\n- .it('shows a message')\n-})\n", "new_path": null, "old_path": "templates/plugin/test/hooks/init.test.js" }, { "change_type": "ADD", "diff": "+module.exports = async function (opts) {\n+ process.stdout.write(`example hook running ${opts.id}\\n`)\n+}\n", "new_path": "templates/src/hook.js.ejs", "old_path": null }, { "change_type": "ADD", "diff": "+import {Hook} from '@oclif/config'\n+\n+const hook: Hook<'<%- options.event %>'> = async function (opts) {\n+ process.stdout.write(`example hook running ${opts.id}\\n`)\n+}\n+\n+export default hook\n", "new_path": "templates/src/hook.ts.ejs", "old_path": null }, { "change_type": "ADD", "diff": "+const {expect, test} = require('@oclif/test')\n+\n+describe('hooks', () => {\n+ test\n+ .stdout()\n+ .hook('init', {id: 'mycommand'})\n+ .do(output => expect(output.stdout).to.contain('example hook running mycommand'))\n+ .it('shows a message')\n+})\n", "new_path": "templates/test/hook.test.js.ejs", "old_path": null }, { "change_type": "RENAME", "diff": "", "new_path": "templates/test/hook.test.ts.ejs", "old_path": "templates/plugin/test/hooks/init.test.ts" }, { "change_type": "ADD", "diff": "+require('../../run')(module.filename)\n", "new_path": "test/commands/hook/everything.test.js", "old_path": null }, { "change_type": "ADD", "diff": "+require('../../run')(module.filename)\n", "new_path": "test/commands/hook/mocha.test.js", "old_path": null }, { "change_type": "MODIFY", "diff": "@@ -84,6 +84,15 @@ module.exports = file => {\nsh.exec('node ./bin/run foo:bar:baz --help')\nsh.exec('yarn run prepublishOnly')\nbreak\n+ case 'hook':\n+ build('plugin', name)\n+ generate('hook myhook --defaults --force')\n+ // TODO: remove this compilation step\n+ sh.exec('tsc')\n+ sh.exec('yarn test')\n+ sh.exec('node ./bin/run hello')\n+ sh.exec('yarn run prepublishOnly')\n+ break\n}\n})\n.it([cmd, name].join(':'))\n", "new_path": "test/run.js", "old_path": "test/run.js" }, { "change_type": "MODIFY", "diff": "\"@types/rx\" \"*\"\n\"@types/through\" \"*\"\n-\"@types/lodash@^4.14.105\":\n- version \"4.14.105\"\n- resolved \"https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.105.tgz#9fcc4627a1f98f8f8fce79ddb2bff4afd97e959b\"\n+\"@types/lodash@^4.14.106\":\n+ version \"4.14.106\"\n+ resolved \"https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.106.tgz#6093e9a02aa567ddecfe9afadca89e53e5dce4dd\"\n\"@types/minimatch@*\":\nversion \"3.0.3\"\n@@ -2073,9 +2073,9 @@ mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1:\ndependencies:\nminimist \"0.0.8\"\n-mocha@^5.0.4:\n- version \"5.0.4\"\n- resolved \"https://registry.yarnpkg.com/mocha/-/mocha-5.0.4.tgz#6b7aa328472da1088e69d47e75925fd3a3bb63c6\"\n+mocha@^5.0.5:\n+ version \"5.0.5\"\n+ resolved \"https://registry.yarnpkg.com/mocha/-/mocha-5.0.5.tgz#e228e3386b9387a4710007a641f127b00be44b52\"\ndependencies:\nbrowser-stdout \"1.3.1\"\ncommander \"2.11.0\"\n", "new_path": "yarn.lock", "old_path": "yarn.lock" } ]
TypeScript
MIT License
oclif/oclif
feat: add hook generator (#77)
1
feat
null
217,922
23.03.2018 16:05:27
-3,600
2f149048d2232d1cdbfe8a2067eb094be0005144
fix: list layout broken with listData is null
[ { "change_type": "MODIFY", "diff": "<mat-icon>label_outline</mat-icon>\n</button>\n- <button mat-mini-fab color=\"accent\" [routerLink]=\"['/list-inventory', listData.$key]\"\n+ <button mat-mini-fab color=\"accent\" *ngIf=\"listData !== null\" [routerLink]=\"['/list-inventory', listData?.$key]\"\nmatTooltip=\"{{'LIST_DETAILS.Inventory_breakdown' | translate}}\">\n<mat-icon>apps</mat-icon>\n</button>\n<mat-icon *ngIf=\"isFavorite()\">favorite</mat-icon>\n</button>\n- <button mat-mini-fab *ngIf=\"listData !== undefined && user !== undefined && !listData.ephemeral\"\n+ <button mat-mini-fab *ngIf=\"listData !== undefined && user !== undefined && !listData?.ephemeral\"\n(click)=\"forkList(listData)\"\nmatTooltip=\"{{'List_fork' | translate}}\">\n<mat-icon>content_copy</mat-icon>\n<mat-icon>update</mat-icon>\n{{\"Own_list_outdated_after_button\"| translate}}\n</mat-error>\n- <mat-error *ngIf=\"listData.public && (listData.tags === undefined || listData.tags.length === 0)\">\n+ <mat-error *ngIf=\"listData?.public && (listData?.tags === undefined || listData?.tags.length === 0)\">\n{{\"LIST_DETAILS.Missing_tags_before_button\" | translate}}\n<mat-icon>label_outline</mat-icon>\n{{\"LIST_DETAILS.Missing_tags_after_button\" | translate}}\n</mat-error>\n- <div *ngIf=\"listData.note !== undefined && listData.note !== '' || isOwnList()\">\n+ <div *ngIf=\"listData?.note !== undefined && listData?.note !== '' || isOwnList()\">\n<mat-divider class=\"top-divider\"></mat-divider>\n- <app-list-note [list]=\"listData\" [readonly]=\"!isOwnList()\" *ngIf=\"!listData.ephemeral\"></app-list-note>\n+ <app-list-note [list]=\"listData\" [readonly]=\"!isOwnList()\" *ngIf=\"!listData?.ephemeral\"></app-list-note>\n</div>\n<mat-divider class=\"top-divider\"></mat-divider>\n<div class=\"options\">\n<mat-divider></mat-divider>\n- <mat-checkbox [checked]=\"listData?.public\" *ngIf=\"isOwnList() && !listData.ephemeral\" (change)=\"togglePublic()\"\n+ <mat-checkbox [checked]=\"listData?.public\" *ngIf=\"isOwnList() && !listData?.ephemeral\" (change)=\"togglePublic()\"\nclass=\"public-list-toggle\">\n{{'Public_list' | translate}}\n</mat-checkbox>\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" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix: list layout broken with listData is null
1
fix
null
821,196
23.03.2018 16:08:42
25,200
d24456ba28f0ea2d4e392dda30a4543a461fc6c5
fix: add usage/command headers explicitly
[ { "change_type": "MODIFY", "diff": "\"yosay\": \"^2.0.1\"\n},\n\"devDependencies\": {\n- \"@oclif/dev-cli\": \"^1.3.1\",\n+ \"@oclif/dev-cli\": \"^1.4.0\",\n\"@oclif/tslint\": \"^1.0.2\",\n\"@types/lodash\": \"^4.14.106\",\n\"@types/read-pkg\": \"^3.0.0\",\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "[![License](https://img.shields.io/npm/l/<%= pjson.name %>.svg)](https://github.com/<%= repository %>/blob/master/package.json)\n<!-- toc -->\n+# Usage\n<!-- usage -->\n+# Commands\n<!-- commands -->\n", "new_path": "templates/README.md.ejs", "old_path": "templates/README.md.ejs" }, { "change_type": "MODIFY", "diff": "version \"1.3.59\"\nresolved \"https://registry.yarnpkg.com/@oclif/config/-/config-1.3.59.tgz#10cc39757654850458b2d3f899155af2e069deb5\"\n-\"@oclif/dev-cli@^1.3.1\":\n- version \"1.3.1\"\n- resolved \"https://registry.yarnpkg.com/@oclif/dev-cli/-/dev-cli-1.3.1.tgz#6b8c7cfb38b14168e698192e6e4483c943b6a2a7\"\n+\"@oclif/dev-cli@^1.4.0\":\n+ version \"1.4.0\"\n+ resolved \"https://registry.yarnpkg.com/@oclif/dev-cli/-/dev-cli-1.4.0.tgz#b8513caf54f42e1e7dabf5238ca22b3b7d3fdeab\"\ndependencies:\n\"@oclif/command\" \"^1.4.2\"\n\"@oclif/config\" \"^1.3.59\"\n", "new_path": "yarn.lock", "old_path": "yarn.lock" } ]
TypeScript
MIT License
oclif/oclif
fix: add usage/command headers explicitly
1
fix
null
791,723
23.03.2018 16:20:29
25,200
48792ae7da52594d4e01c86dadc75bba8f4529b2
tests: disable compile-devtools on travis
[ { "change_type": "MODIFY", "diff": "@@ -41,7 +41,8 @@ script:\n- yarn test-extension\n# _JAVA_OPTIONS is breaking parsing of compiler output. See #3338.\n- unset _JAVA_OPTIONS\n- - yarn compile-devtools\n+ # FIXME(paulirish): re-enable after a roll of LH->CDT\n+ # - yarn compile-devtools\nbefore_cache:\n# the `yarn compile-devtools` task adds these to node_modules, which slows down caching\n- rm -rf ./node_modules/temp-devtoolsfrontend/\n", "new_path": ".travis.yml", "old_path": ".travis.yml" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
tests: disable compile-devtools on travis
1
tests
null
791,723
23.03.2018 16:21:05
25,200
f7efaa5468f0ab939259d3b742930125119c0957
report: add jsdoc for lhr.artifacts
[ { "change_type": "MODIFY", "diff": "@@ -258,6 +258,7 @@ ReportRenderer.GroupJSON; // eslint-disable-line no-unused-expressions\n* initialUrl: string,\n* url: string,\n* runWarnings: (!Array<string>|undefined),\n+ * artifacts: {traces: {defaultPass: {traceEvents: !Array}}},\n* audits: !Object<string, !ReportRenderer.AuditResultJSON>,\n* reportCategories: !Array<!ReportRenderer.CategoryJSON>,\n* reportGroups: !Object<string, !ReportRenderer.GroupJSON>,\n", "new_path": "lighthouse-core/report/v2/renderer/report-renderer.js", "old_path": "lighthouse-core/report/v2/renderer/report-renderer.js" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
report: add jsdoc for lhr.artifacts (#4859)
1
report
null
217,922
23.03.2018 16:46:29
-3,600
1dff6ecd61cefc0c5f225bab44ebee0166c57fd9
chore: more filters for errors reporting
[ { "change_type": "MODIFY", "diff": "@@ -64,7 +64,7 @@ Raven\nexport class RavenErrorHandler implements ErrorHandler {\nhandleError(err: any): void {\n- if (err.message !== 'Not found') {\n+ if (err.message !== 'Not found' && err.message.indexOf('permissions') === -1 && err.message.indexOf('is null') === -1) {\nRaven.captureException(err);\n}\nconsole.error(err);\n", "new_path": "src/app/app.module.ts", "old_path": "src/app/app.module.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: more filters for errors reporting
1
chore
null
217,922
23.03.2018 16:58:49
-3,600
b1f4eb7d23ea3d52ca3e3faf311d22f0efd28cd8
chore: minor bug fixes
[ { "change_type": "MODIFY", "diff": "@@ -64,7 +64,7 @@ Raven\nexport class RavenErrorHandler implements ErrorHandler {\nhandleError(err: any): void {\n- if (err.message !== 'Not found' && err.message.indexOf('permissions') === -1 && err.message.indexOf('is null') === -1) {\n+ if (err.message !== 'Not found' && err.message.indexOf('permission') === -1 && err.message.indexOf('is null') === -1) {\nRaven.captureException(err);\n}\nconsole.error(err);\n", "new_path": "src/app/app.module.ts", "old_path": "src/app/app.module.ts" }, { "change_type": "MODIFY", "diff": "@@ -38,6 +38,7 @@ export class LayoutService {\npublic getDisplay(list: List, index: number): Observable<LayoutRowDisplay[]> {\nreturn this.getLayoutRows(index)\n+ .catch(() => Observable.of(this.defaultLayout))\n.map(layoutRows => {\nif (layoutRows.find(row => row.filter.name === 'ANYTHING') === undefined) {\nthrow new Error('List layoutRows has to contain an ANYTHING category');\n@@ -62,6 +63,9 @@ export class LayoutService {\npublic getLayoutRows(index: number): Observable<LayoutRow[]> {\nreturn this.getLayout(index).map(layout => {\n+ if (layout === undefined) {\n+ layout = new ListLayout('Default layout', this.defaultLayout);\n+ }\nreturn layout.rows.sort((a, b) => {\n// ANYTHING has to be last filter applied, as it rejects nothing.\nif (a.filter.name === 'ANYTHING') {\n", "new_path": "src/app/core/layout/layout.service.ts", "old_path": "src/app/core/layout/layout.service.ts" }, { "change_type": "MODIFY", "diff": "<app-pricing [list]=\"listData\" *ngIf=\"pricingMode\" (close)=\"pricingMode = false\"></app-pricing>\n-<div *ngIf=\"!pricingMode\">\n+<div *ngIf=\"!pricingMode && listData !== null\">\n<div *ngIf=\"listDisplay | async as display; else loading\">\n<div class=\"etime-container\">\n<app-eorzean-time class=\"etime\" [date]=\"etime\"></app-eorzean-time>\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" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: minor bug fixes
1
chore
null
679,913
23.03.2018 17:59:00
0
6cac0c7d27949b0385f5cf6a1d96ae7168ed9c01
feat(pointfree): support data vals in program, add collect(), update readme any non-function values in program place themselves on stack update StackProgram type alias add collect() to create stack partitions
[ { "change_type": "MODIFY", "diff": "## About\n[Pointfree](https://en.wikipedia.org/wiki/Concatenative_programming_language),\n-functional composition via lightweight (1.8KB gzipped) Forth style stack\n+functional composition via lightweight (2KB gzipped) Forth style stack\nexecution engine using vanilla JS functions as words and arbitrary stack\nvalues (incl. other stack functions / words). Supports nested execution\nenvironments, quotations, stack mapping and currently includes 60+ stack\n@@ -31,13 +31,13 @@ intermediate values from/to the stack and stack programs can have any number of\nALPHA\n-- [ ] support literal numbers, strings, arrays, objects in program\n+- [x] support literal numbers, strings, arrays, objects in program\n- [ ] execution context wrapper for stack(s), env, error traps\n- [ ] env stack & more env accessors\n- [ ] more string, array & object words\n- [ ] full stack consumer / transformer\n- [ ] transducer wrapper\n-- [ ] more (useful) examples\n+- [x] more (useful) examples\n- [ ] string definitions / program parsing\n## Installation\n@@ -71,7 +71,7 @@ env]`.\nAlternatively, we can use `runU()` to return an unwrapped section of the result stack. We use this for some of the examples below.\n-A stack program consists of an array of functions with this signature:\n+A stack program consists of an array of any values and functions with this signature:\n```\ntype Stack = any[];\n@@ -79,7 +79,9 @@ type StackEnv = any;\ntype StackFn = (stack: Stack, env?: StackEnv) => void;\n```\n-Each program function can arbitrarily modify both the stack and/or environment.`\n+Each program function can arbitrarily modify both the stack and/or environment.\n+\n+Any non-function value in the program is placed on the stack as is.\n```typescript\nimport * as pf from \"@thi.ng/pointfree\";\n@@ -137,7 +139,7 @@ pow2([-10])\n// compute magnitude of 2d vector\n// ( x y -- mag )\n-const mag2 = pf.word([\n+const mag2 = pf.wordU([\npow2, // ( x y -- x y^2 )\npf.swap, // ( x y^2 -- y^2 x )\npow2, // ( y^2 x -- y^2 x^2 )\n@@ -145,28 +147,44 @@ const mag2 = pf.word([\npf.sqrt\n]);\n-mag2([-10, 10])[1];\n-// [ 14.142135623730951 ]\n+mag2([-10, 10])\n+// 14.142135623730951\n```\n### Quotations\n-Quoatations are programs stored on the stack and enable a form of\n-dynamic meta programming. Quotations are executed via `execQ`. This\n-example uses a quoted form of above `pow2` word:\n+Quoatations 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```typescript\npf.runU([10], [\n// push quotation on stack\n- pf.push([pf.dup, pf.mul])\n+ [pf.dup, pf.mul],\n// execute\npf.execQ,\n- // output result\n- pf.print\n]);\n// 100\n```\n+```typescript\n+// a quotation is just an array of values/words\n+// this function is a quotation generator\n+const tupleQ = (n) => [n, pf.collect];\n+// predefine fixed size tuples\n+const pair = tupleQ(2);\n+const triple = tupleQ(3);\n+// define word which takes an id & tuple quotation\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+\n+// transform stack into tuples, stored in env\n+pf.run([1,2,3,4,5], [storeTuple(\"a\", pair), storeTuple(\"b\", triple)])[2];\n+// { a: [ 4, 5 ], b: [ 1, 2, 3 ] }\n+```\n+\n+\n### Conditionals\nSee `cond` documentation further below...\n@@ -186,24 +204,27 @@ abs([42])\n```typescript\n// `condM` is similar to JS `switch() { case ... }`\n-const classify = pf.condM({\n- 0: pf.push(\"zero\"),\n- 1: pf.push(\"one\"),\n+const classify = (x) =>\n+ pf.runU([x],\n+ pf.condM({\n+ 0: [\"zero\"],\n+ 1: [\"one\"],\ndefault: [\npf.dup,\npf.isPos,\n- pf.cond(pf.push(\"many\"), pf.push(\"invalid\"))\n+ pf.cond([\"many\"], [\"invalid\"])\n]\n-});\n-\n-classify([0])[1]\n-// [ \"zero\" ]\n-classify([1])[1]\n-// [ \"one\" ]\n-classify([100])[1]\n-// [ \"many\" ]\n-classify([-100])[1]\n-// [ \"invalid\" ]\n+ })\n+ );\n+\n+classify(0);\n+// \"zero\"\n+classify(1);\n+// \"one\"\n+classify(100);\n+// \"many\"\n+classify(-1);\n+// \"invalid\"\n```\n### Loops\n@@ -226,17 +247,21 @@ The `map()`, `map2()`, `mapN()` higher order words can be used to transform stac\n- `mapN(f)` - map stack item @ TOS - n (see stack effects further below)\n```typescript\n+// full stack transformation\npf.run(\n- // data items, num items\n- [10,20,30,40, 4],\n+ // data items\n+ [10,20,30,40],\n[\n+ // push stack depth (i.e. number of items) on stack\n+ pf.depth,\n+ // define loop construct\npf.loop(\n// test predicate\npf.isPos,\n[\n// duplicate counter\npf.dup,\n- // map item @ TOS - curr counter\n+ // map item @ stack[TOS - counter]\npf.mapN(x => x * 10),\n// decrease counter\npf.dec\n@@ -247,23 +272,6 @@ pf.run(\n// [ true, [ 100, 200, 300, 400 ], {} ]\n```\n-### Environment as accumulator\n-\n-```typescript\n-makeIDObject = (k) => pf.word([\n- // this inner word uses a blank environment\n- // to create new objects of `{id: <TOS>}\n- pf.word([pf.push(\"id\"), pf.store, pf.pushEnv], {}),\n- // push given key `k` on stack\n- pf.push(k),\n- // store env returned from inner word under `k` in curr env\n- pf.store\n-]);\n-// transform stack into result object\n-pf.run([1, 2], [makeIDObject(\"a\"), makeIDObject(\"b\")])[2]\n-// { a: { id: 2 }, b: { id: 1 } }\n-```\n-\nTODO more examples forthcoming\n## Core vocabulary\n@@ -278,6 +286,8 @@ at word construction time and return a pre-configured stack function.\n| Word | Stack effect |\n| --- | --- |\n+| `collect` | `( n -- [...] )` |\n+| `depth` | `( -- stack.length )` |\n| `drop` | `( x -- )` |\n| `drop2` | `( x y -- )` |\n| `dropIf` | If TOS is truthy: `( x -- )` |\n@@ -296,7 +306,6 @@ at word construction time and return a pre-configured stack function.\n| `swap` | `( x y -- y x )` |\n| `swap2` | `( a b c d -- c d a b )` |\n| `tuck` | `( x y -- y x y )` |\n-| `depth` | `( -- stack.length )` |\n### Dynamic execution\n", "new_path": "packages/pointfree/README.md", "old_path": "packages/pointfree/README.md" }, { "change_type": "MODIFY", "diff": "@@ -2,13 +2,14 @@ import { IObjectOf } from \"@thi.ng/api/api\";\nimport { illegalState } from \"@thi.ng/api/error\";\nimport { equiv as _equiv } from \"@thi.ng/api/equiv\";\nimport { isArray } from \"@thi.ng/checks/is-array\";\n+import { isFunction } from \"@thi.ng/checks/is-function\";\nconst DEBUG = true;\nexport type Stack = any[];\nexport type StackEnv = any;\nexport type StackFn = (stack: Stack, env?: StackEnv) => void;\n-export type StackProgram = StackFn[];\n+export type StackProgram = any[];\nexport type StackProc = StackFn | StackProgram;\nexport type Trap = (e: Error, stack: Stack, program: StackProgram, i: number) => boolean;\nexport type RunResult = [boolean, Stack, StackEnv];\n@@ -26,7 +27,12 @@ export const run = (stack: Stack, prog: StackProc, env: StackEnv = {}, onerror?:\nconst program = isArray(prog) ? prog : [prog];\nfor (let i = 0, n = program.length; i < n; i++) {\ntry {\n- program[i](stack, env);\n+ const p = program[i];\n+ if (isFunction(p)) {\n+ p(stack, env);\n+ } else {\n+ stack.push(p);\n+ }\n} catch (e) {\nif (!onerror || !onerror(e, stack, program, i)) {\nconsole.error(`${e.message} @ word #${i}`);\n@@ -121,21 +127,29 @@ const tos = (stack: Stack) => stack[stack.length - 1];\n*/\nexport const depth = (stack: Stack) => stack.push(stack.length);\n+/**\n+ * Utility word w/ no stack nor side effect.\n+ */\nexport const nop = () => { };\n/**\n+ * Uses TOS as index to look up a deeper stack value, then places it as\n+ * new TOS.\n+ *\n* ( ... x -- ... stack[x] )\n*\n* @param stack\n*/\nexport const pick = (stack: Stack) => {\n- $(stack, 1);\n- const n = stack.pop();\n- $(stack, n + 1);\n- stack.push(stack[stack.length - 1 - n]);\n+ let n = stack.length - 1;\n+ $n(n, 0);\n+ $n(n -= stack.pop() + 1, 0);\n+ stack.push(stack[n]);\n};\n/**\n+ * Removes TOS from stack.\n+ *\n* ( x -- )\n*\n* @param stack\n@@ -146,6 +160,8 @@ export const drop = (stack: Stack) => {\n};\n/**\n+ * Removes top 2 vals from stack.\n+ *\n* ( x y -- )\n*\n* @param stack\n@@ -191,6 +207,8 @@ export const push = (...args: any[]) => (stack: Stack) => stack.push(...args);\nexport const pushEnv = (stack: Stack, env: StackEnv) => stack.push(env);\n/**\n+ * Duplicates TOS on stack.\n+ *\n* ( x -- x x )\n*\n* @param stack\n@@ -201,6 +219,8 @@ export const dup = (stack: Stack) => {\n};\n/**\n+ * Duplicates top 2 vals on stack.\n+ *\n* ( x y -- x y x y )\n*\n* @param stack\n@@ -653,7 +673,7 @@ export const gt = op2((b, a) => a > b);\nexport const lteq = op2((b, a) => a <= b);\n/**\n- * ( x y -- x=>y )\n+ * ( x y -- x>=y )\n*\n* @param stack\n*/\n@@ -795,11 +815,26 @@ export const mapN = (op: (x) => any) =>\n(stack: Stack) => {\nlet n = stack.length - 1;\n$n(n, 0);\n- n -= stack.pop() + 1;\n- $n(n, 0);\n+ $n(n -= stack.pop() + 1, 0);\nstack[n] = op(stack[n]);\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+ * are removed from stack.\n+ *\n+ * ( ... n --- ... [...] )\n+ *\n+ * @param stack\n+ */\n+export const collect = (stack: Stack) => {\n+ let n = stack.length - 1, m;\n+ $n(n, 0);\n+ $n(n -= (m = stack.pop()), 0);\n+ stack.push(stack.splice(n, m));\n+};\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): support data vals in program, add collect(), update readme - any non-function values in program place themselves on stack - update StackProgram type alias - add collect() to create stack partitions
1
feat
pointfree
821,196
23.03.2018 18:23:43
25,200
c82d5f484a425261cbe28692aabc3c30b5827550
fix: no longer directly required
[ { "change_type": "MODIFY", "diff": "@@ -389,7 +389,6 @@ class App extends Generator {\ndependencies.push(\n'@oclif/config',\n'@oclif/command',\n- '@oclif/errors',\n'@oclif/plugin-help',\n)\nbreak\n@@ -397,7 +396,6 @@ class App extends Generator {\ndependencies.push(\n'@oclif/command',\n'@oclif/config',\n- '@oclif/errors',\n)\ndevDependencies.push(\n'@oclif/dev-cli',\n@@ -409,7 +407,6 @@ class App extends Generator {\ndependencies.push(\n'@oclif/config',\n'@oclif/command',\n- '@oclif/errors',\n'@oclif/plugin-help',\n'globby',\n)\n", "new_path": "src/generators/app.ts", "old_path": "src/generators/app.ts" } ]
TypeScript
MIT License
oclif/oclif
fix: @oclif/errors no longer directly required
1
fix
null
821,196
23.03.2018 18:29:18
25,200
9f07b248cc0c481a3b96961a04ec2f511f76268d
fix: move globby to devDependencies
[ { "change_type": "MODIFY", "diff": "@@ -408,10 +408,10 @@ class App extends Generator {\n'@oclif/config',\n'@oclif/command',\n'@oclif/plugin-help',\n- 'globby',\n)\ndevDependencies.push(\n'@oclif/dev-cli',\n+ 'globby',\n)\n}\nif (this.mocha) {\n", "new_path": "src/generators/app.ts", "old_path": "src/generators/app.ts" } ]
TypeScript
MIT License
oclif/oclif
fix: move globby to devDependencies
1
fix
null
821,196
23.03.2018 18:29:35
25,200
19579350dadf5007c5155cd9c41834345acb17f3
fix: fixed npm devDependencies
[ { "change_type": "MODIFY", "diff": "@@ -450,7 +450,7 @@ class App extends Generator {\nlet yarnOpts = {} as any\nif (process.env.YARN_MUTEX) yarnOpts.mutex = process.env.YARN_MUTEX\nconst install = (deps: string[], opts: object) => this.yarn ? this.yarnInstall(deps, opts) : this.npmInstall(deps, opts)\n- const dev = this.yarn ? {dev: true} : {only: 'dev'}\n+ const dev = this.yarn ? {dev: true} : {'save-dev': true}\nPromise.all([\ninstall(devDependencies, {...yarnOpts, ...dev, ignoreScripts: true}),\ninstall(dependencies, yarnOpts),\n", "new_path": "src/generators/app.ts", "old_path": "src/generators/app.ts" } ]
TypeScript
MIT License
oclif/oclif
fix: fixed npm devDependencies
1
fix
null
821,196
23.03.2018 18:43:28
25,200
e6446ca65238f4ab21f3e30f0391bf4e49cc6f95
fix: updated command/config
[ { "change_type": "MODIFY", "diff": "\"bin\": \"./bin/run\",\n\"bugs\": \"https://github.com/oclif/oclif/issues\",\n\"dependencies\": {\n- \"@oclif/command\": \"^1.4.2\",\n- \"@oclif/config\": \"^1.3.59\",\n+ \"@oclif/command\": \"^1.4.4\",\n+ \"@oclif/config\": \"^1.3.60\",\n\"@oclif/errors\": \"^1.0.2\",\n\"@oclif/plugin-help\": \"^1.1.7\",\n\"@oclif/plugin-not-found\": \"^1.0.4\",\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "\"@oclif/parser\" \"^3.2.9\"\nsemver \"^5.5.0\"\n+\"@oclif/command@^1.4.4\":\n+ version \"1.4.4\"\n+ resolved \"https://registry.yarnpkg.com/@oclif/command/-/command-1.4.4.tgz#12188c81ac11cd74c30aeba4b3c57380f15d8d54\"\n+ dependencies:\n+ \"@oclif/errors\" \"^1.0.2\"\n+ \"@oclif/parser\" \"^3.2.9\"\n+ debug \"^3.1.0\"\n+ semver \"^5.5.0\"\n+\n\"@oclif/config@^1.3.59\":\nversion \"1.3.59\"\nresolved \"https://registry.yarnpkg.com/@oclif/config/-/config-1.3.59.tgz#10cc39757654850458b2d3f899155af2e069deb5\"\n+\"@oclif/config@^1.3.60\":\n+ version \"1.3.60\"\n+ resolved \"https://registry.yarnpkg.com/@oclif/config/-/config-1.3.60.tgz#e5e1b1cf14d68dd55c489bc5f76594073dec0568\"\n+ dependencies:\n+ debug \"^3.1.0\"\n+\n\"@oclif/dev-cli@^1.4.2\":\nversion \"1.4.2\"\nresolved \"https://registry.yarnpkg.com/@oclif/dev-cli/-/dev-cli-1.4.2.tgz#cd849b2f634606c9dda71caf6d32e5bf31611c6a\"\n", "new_path": "yarn.lock", "old_path": "yarn.lock" } ]
TypeScript
MIT License
oclif/oclif
fix: updated command/config
1
fix
null
679,913
23.03.2018 19:19:38
0
f211c3978807fdd4ecea899c3c052581c8bec2cf
fix(pointfree): fix readme/docs
[ { "change_type": "MODIFY", "diff": "@@ -242,9 +242,11 @@ pf.run([3], pf.loop(pf.isPos, [pf.dup, pf.print, pf.dec]))\nThe `map()`, `map2()`, `mapN()` higher order words can be used to transform stack items in place using vanilla JS functions:\n-- `map(f)` - map TOS\n-- `map2(f)` - pops top 2 stack items, pushes result back on stack\n-- `mapN(f)` - map stack item @ TOS - n (see stack effects further below)\n+- `map(f)` - replaces TOS with result of given function.\n+- `map2(f)` - takes top 2 values from stack, calls function and writes\n+ back result. The arg order is (TOS, TOS-1)\n+- `mapN(f)` - pops TOS and uses it as index to transform stack item @\n+ `stack[TOS]` w/ given transformation fn.\n```typescript\n// full stack transformation\n@@ -296,10 +298,10 @@ at word construction time and return a pre-configured stack function.\n| `dupIf` | If TOS is truthy: `( x -- x x )` |\n| `map(fn)` | `( x -- f(x) )` |\n| `map2(fn)` | `( x y -- f(x,y) )` |\n-| `mapN(fn)` | `( n -- f(stack[-n]) )` |\n+| `mapN(fn)` | `( n -- )`, and `stack[n]) = f(stack[n])` |\n| `nip` | `( x y -- y )` |\n| `over` | `( x y -- x y x )` |\n-| `pick` | `( x -- stack[x] )` |\n+| `pick` | `( n -- stack[n] )` |\n| `push(...args)` | `( -- ...args )` |\n| `rot` | `( x y z -- y z x )` |\n| `invrot` | `( x y z -- z x y )` |\n@@ -330,7 +332,7 @@ at word construction time and return a pre-configured stack function.\n| `lsr` | `( x y -- x>>y )` |\n| `lsru` | `( x y -- x>>>y )` |\n| `bitAnd` | `( x y -- x&y )` |\n-| `bitOr` | `( x y -- x|y )` |\n+| `bitOr` | `( x y -- x\\|y )` |\n| `bitXor` | `( x y -- x^y )` |\n| `bitNot` | `( x -- ~x )` |\n@@ -342,7 +344,7 @@ at word construction time and return a pre-configured stack function.\n| `equiv` | `( x y -- equiv(x,y) )` |\n| `neq` | `( x y -- x!==y )` |\n| `and` | `( x y -- x&&y )` |\n-| `or` | `( x y -- x||y )` |\n+| `or` | `( x y -- x\\|\\|y )` |\n| `not` | `( x -- !x )` |\n| `lt` | `( x y -- x<y )` |\n| `gt` | `( x y -- x>y )` |\n@@ -411,12 +413,33 @@ 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+\n+Like `word()`, but uses `runU()` for execution and returns `n` unwrapped values from result stack.\n+\n+#### `unwrap(res: RunResult)`\n+\n+Takes a result tuple returned by `run()` and unwraps one or more items\n+from result stack. If no n is given, defaults to single value (TOS) and\n+returns it as is. Returns an array for all other n.\n+\n#### `exec`\nExecutes TOS as stack function and places result back on stack. Useful\nfor dynamic function dispatch (e.g. based on conditionals or config\nloaded from env).\n+#### `execQ`\n+\n+Pops TOS and executes it as stack program. TOS MUST be an array of\n+values/words, i.e. an quotation).\n+\n+#### `collect`\n+\n+Pops TOS (a number) and then forms a tuple of the top `n` remaining\n+stack values and pushes it as new TOS. The original collected stack\n+values are removed from stack.\n+\n## Authors\n- Karsten Schmidt\n", "new_path": "packages/pointfree/README.md", "old_path": "packages/pointfree/README.md" }, { "change_type": "MODIFY", "diff": "@@ -76,7 +76,7 @@ const $stackFn = (f: StackProc) =>\n/**\n* Takes a result tuple returned by `run()` and unwraps one or more\n- * items from result stack. If no `n` is given, default to single value\n+ * items from result stack. If no `n` is given, defaults to single value\n* (TOS) and returns it as is. Returns an array for all other `n`.\n*\n* @param param0\n", "new_path": "packages/pointfree/src/index.ts", "old_path": "packages/pointfree/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
fix(pointfree): fix readme/docs
1
fix
pointfree
821,196
23.03.2018 19:44:35
25,200
214be061c7f17287a12474e0dff4d39cc63e8109
fix: fixed yarn detection
[ { "change_type": "MODIFY", "diff": "\"@oclif/plugin-not-found\": \"^1.0.4\",\n\"debug\": \"^3.1.0\",\n\"fixpack\": \"^2.3.1\",\n- \"has-yarn\": \"^1.0.0\",\n\"lodash\": \"^4.17.5\",\n\"nps-utils\": \"^1.5.0\",\n\"sort-pjson\": \"^1.0.2\",\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "// tslint:disable no-floating-promises\n// tslint:disable no-console\n+import {execSync} from 'child_process'\nimport * as fs from 'fs'\nimport * as _ from 'lodash'\nimport * as path from 'path'\nimport * as Generator from 'yeoman-generator'\nimport yosay = require('yosay')\n-const hasYarn = require('has-yarn')()\nconst nps = require('nps-utils')\nconst sortPjson = require('sort-pjson')\nconst fixpack = require('fixpack')\nconst debug = require('debug')('generator-oclif')\nconst {version} = require('../../package.json')\n+let hasYarn = false\n+try {\n+ execSync('yarn -v')\n+ hasYarn = true\n+} catch {}\n// function stringToArray(s: string) {\n// const keywords: string[] = []\n", "new_path": "src/generators/app.ts", "old_path": "src/generators/app.ts" } ]
TypeScript
MIT License
oclif/oclif
fix: fixed yarn detection
1
fix
null
821,196
23.03.2018 19:59:08
25,200
e117a8559b1ad84c8110df71906ca4c975ab529f
fix: fix hooks to work with ts-node Fixes
[ { "change_type": "MODIFY", "diff": "@@ -37,7 +37,7 @@ class HookGenerator extends Generator {\n}\nthis.pjson.oclif = this.pjson.oclif || {}\nlet hooks = this.pjson.oclif.hooks = this.pjson.oclif.hooks || {}\n- let p = `./${this._ts ? 'lib' : 'src'}/hooks/${this.options.event}/${this.options.name}.js`\n+ let p = `./${this._ts ? 'lib' : 'src'}/hooks/${this.options.event}/${this.options.name}`\nif (hooks[this.options.event]) {\nhooks[this.options.event] = _.castArray(hooks[this.options.event])\nhooks[this.options.event].push(p)\n", "new_path": "src/generators/hook.ts", "old_path": "src/generators/hook.ts" }, { "change_type": "MODIFY", "diff": "@@ -87,8 +87,6 @@ module.exports = file => {\ncase 'hook':\nbuild('plugin', name)\ngenerate('hook myhook --defaults --force')\n- // TODO: remove this compilation step\n- sh.exec('tsc')\nsh.exec('yarn test')\nsh.exec('node ./bin/run hello')\nsh.exec('yarn run prepublishOnly')\n", "new_path": "test/run.js", "old_path": "test/run.js" } ]
TypeScript
MIT License
oclif/oclif
fix: fix hooks to work with ts-node Fixes #78
1
fix
null
217,922
23.03.2018 20:18:38
-3,600
b98853d007993d3ed81f437ff074964797a76c50
chore: better error management
[ { "change_type": "MODIFY", "diff": "@@ -37,7 +37,6 @@ import {LayoutService} from '../../../core/layout/layout.service';\nimport {LayoutRowDisplay} from '../../../core/layout/layout-row-display';\nimport {ListLayoutPopupComponent} from '../list-layout-popup/list-layout-popup.component';\nimport {ComponentWithSubscriptions} from '../../../core/component/component-with-subscriptions';\n-import {Subject} from 'rxjs/Subject';\nimport {ReplaySubject} from 'rxjs/ReplaySubject';\ndeclare const ga: Function;\n@@ -280,7 +279,7 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\n}\nisFavorite(): boolean {\n- if (this.userData === undefined || this.userData.favorites === undefined) {\n+ if (this.userData === undefined || this.userData.favorites === undefined || this.listData === null) {\nreturn false;\n}\nreturn Object.keys(this.userData.favorites)\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": "@@ -23,8 +23,10 @@ export class PublicProfileComponent {\nconstructor(route: ActivatedRoute, dataService: DataService, userService: UserService, listService: ListService,\nprivate media: ObservableMedia) {\nthis.ingameCharacter = route.params.mergeMap(params => userService.get(params.id))\n- .mergeMap(user => dataService.getCharacter(user.lodestoneId));\n- this.freeCompany = this.ingameCharacter.mergeMap(character => dataService.getFreeCompany(character.free_company));\n+ .mergeMap(user => dataService.getCharacter(user.lodestoneId))\n+ .catch(() => Observable.of(1));\n+ this.freeCompany = this.ingameCharacter.filter(val => val !== null)\n+ .mergeMap(character => dataService.getFreeCompany(character.free_company));\nthis.publicLists = route.params.mergeMap(params => listService.getPublicListsByAuthor(params.id));\n}\n", "new_path": "src/app/pages/profile/public-profile/public-profile.component.ts", "old_path": "src/app/pages/profile/public-profile/public-profile.component.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: better error management
1
chore
null
311,007
24.03.2018 03:35:15
-32,400
46d3812c8801e5b43fe40be6bac1f222fdef6b4a
fix(generate): import local
[ { "change_type": "ADD", "diff": "+import { compileNodeModulesPaths, resolve } from '@ionic/cli-framework/utils/npm';\n+\n+export async function importNgSchematics(projectDir: string): Promise<any> {\n+ const appScriptsPath = resolve('@angular-devkit/schematics', { paths: compileNodeModulesPaths(projectDir) });\n+\n+ return require(appScriptsPath);\n+}\n+\n+export async function importNgSchematicsTools(projectDir: string): Promise<any> {\n+ const appScriptsPath = resolve('@angular-devkit/schematics/tools', { paths: compileNodeModulesPaths(projectDir) });\n+\n+ return require(appScriptsPath);\n+}\n", "new_path": "packages/@ionic/cli-utils/src/lib/project/angular/app-scripts.ts", "old_path": null }, { "change_type": "MODIFY", "diff": "@@ -8,6 +8,7 @@ import { contains, unparseArgs, validators } from '@ionic/cli-framework';\nimport { columnar } from '@ionic/cli-framework/utils/format';\nimport { onBeforeExit } from '@ionic/cli-framework/utils/process';\n+import { importNgSchematics, importNgSchematicsTools } from './app-scripts';\nimport * as schematicsToolsLibType from '@angular-devkit/schematics/tools';\nimport { AngularGenerateOptions, CommandLineInputs, CommandLineOptions, CommandMetadata } from '../../../definitions';\n@@ -208,8 +209,9 @@ ${chalk.cyan('[1]')}: ${chalk.bold('https://ionicframework.com/docs/cli/projects\nprivate async getSchematics(): Promise<Schematic[]> {\nif (!this.schematics) {\ntry {\n- const { SchematicEngine } = await import('@angular-devkit/schematics');\n- const { NodeModulesEngineHost } = await import('@angular-devkit/schematics/tools');\n+\n+ const { SchematicEngine } = await importNgSchematics(this.project.directory);\n+ const { NodeModulesEngineHost } = await importNgSchematicsTools(this.project.directory);\nconst engineHost = new NodeModulesEngineHost();\nconst engine = new SchematicEngine(engineHost);\n", "new_path": "packages/@ionic/cli-utils/src/lib/project/angular/generate.ts", "old_path": "packages/@ionic/cli-utils/src/lib/project/angular/generate.ts" } ]
TypeScript
MIT License
ionic-team/ionic-cli
fix(generate): import local @angular-devkit/schematics (#3027)
1
fix
generate
821,196
24.03.2018 10:39:02
25,200
b5c6327dac2afe91957c8add54b56ad83c58837d
fix: remove commitlint it is confusing for contributors and I can edit the commit message when I squash anyways
[ { "change_type": "MODIFY", "diff": "@@ -110,7 +110,7 @@ jobs:\nkeys:\n- v3-{{checksum \".circleci/config.yml\"}}-{{checksum \"yarn.lock\"}}\n- run: yarn global add greenkeeper-lockfile@1\n- - run: yarn add -D mocha-junit-reporter@1 @commitlint/cli@6 @commitlint/config-conventional@6\n+ - run: yarn add -D mocha-junit-reporter@1\n- run: yarn exec nps test.command\n- save_cache:\nkey: v3-{{checksum \".circleci/config.yml\"}}-{{checksum \"yarn.lock\"}}\n", "new_path": ".circleci/config.yml", "old_path": ".circleci/config.yml" }, { "change_type": "MODIFY", "diff": "@@ -365,10 +365,6 @@ class App extends Generator {\nthis.fs.copyTpl(this.templatePath('eslintrc'), this.destinationPath('.eslintrc'), this)\nconst eslintignore = this._eslintignore()\nif (eslintignore.trim()) this.fs.write(this.destinationPath('.eslintignore'), this._eslintignore())\n- // this.fs.copyTpl(this.templatePath('package-scripts.js.ejs'), this.destinationPath('package-scripts.js'), this)\n- // if (this.semantic_release) {\n- // this.fs.copyTpl(this.templatePath('.commitlintrc.js'), this.destinationPath('.commitlintrc.js'), this)\n- // }\nswitch (this.type) {\ncase 'single':\n", "new_path": "src/generators/app.ts", "old_path": "src/generators/app.ts" }, { "change_type": "MODIFY", "diff": "-<%_\n-let deps = [\n- 'nyc@11',\n- '@oclif/nyc-config@1',\n- 'mocha-junit-reporter@1',\n-]\n-if (semantic_release) deps.push('@commitlint/cli@6', '@commitlint/config-conventional@6')\n-deps = deps.join(' ')\n-_%>\n---\nversion: 2\njobs:\n@@ -26,7 +17,7 @@ jobs:\n- v1-yarn-{{checksum \".circleci/config.yml\"}}-{{ checksum \"yarn.lock\"}}\n- v1-yarn-{{checksum \".circleci/config.yml\"}}\n- run: .circleci/greenkeeper\n- - run: yarn add -D <%- deps %>\n+ - run: yarn add -D nyc@11 @oclif/nyc-config@1 mocha-junit-reporter@1\n<%_ if (['single', 'multi'].includes(type)) { _%>\n- run: ./bin/run --version\n<%_ } _%>\n@@ -42,9 +33,6 @@ jobs:\n<%_ } else { _%>\n- run: yarn test\n<%_ } _%>\n- <%_ if (semantic_release) { _%>\n- - run: yarn exec commitlint -- -x @commitlint/config-conventional --from origin/master\n- <%_ } _%>\n- store_test_results: &store_test_results\npath: ~/cli/reports\nnode-8:\n", "new_path": "templates/circle.yml.ejs", "old_path": "templates/circle.yml.ejs" }, { "change_type": "MODIFY", "diff": "@@ -1526,10 +1526,6 @@ has-values@^1.0.0:\nis-number \"^3.0.0\"\nkind-of \"^4.0.0\"\n-has-yarn@^1.0.0:\n- version \"1.0.0\"\n- resolved \"https://registry.yarnpkg.com/has-yarn/-/has-yarn-1.0.0.tgz#89e25db604b725c8f5976fff0addc921b828a5a7\"\n-\nhe@1.1.1:\nversion \"1.1.1\"\nresolved \"https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd\"\n", "new_path": "yarn.lock", "old_path": "yarn.lock" } ]
TypeScript
MIT License
oclif/oclif
fix: remove commitlint (#83) it is confusing for contributors and I can edit the commit message when I squash anyways
1
fix
null
821,196
24.03.2018 11:09:58
25,200
b4cd8b3ce32bf2a4a6af6eb3c3ecdb4ebb4d9259
fix: add yarn to examples
[ { "change_type": "MODIFY", "diff": "@@ -26,8 +26,8 @@ module.exports = (_, options) => {\nconst [, type, format] = example.split('-')\nconst options = format === 'ts' ?\n- '--options=typescript,mocha,semantic-release' :\n- '--options=mocha,semantic-release'\n+ '--options=yarn,typescript,mocha,semantic-release' :\n+ '--options=yarn,mocha,semantic-release'\nconst d = path.join(__dirname, '../tmp/examples', example)\nsh.mkdir('-p', path.dirname(d))\n", "new_path": "scripts/release_example.js", "old_path": "scripts/release_example.js" } ]
TypeScript
MIT License
oclif/oclif
fix: add yarn to examples
1
fix
null
821,196
24.03.2018 11:49:07
25,200
3f4ab928546aa5bd33c4eccc4b698a3c7b289b81
fix: fixed hook circle config test
[ { "change_type": "MODIFY", "diff": "@@ -136,6 +136,7 @@ workflows:\n- node-latest-plugin: {requires: [lint] }\n- node-latest-multi: {requires: [lint] }\n- node-latest-command: {requires: [lint] }\n+ - node-latest-hook: {requires: [lint] }\n- cache: {requires: [release] }\n- release:\ncontext: org-global\n", "new_path": ".circleci/config.yml", "old_path": ".circleci/config.yml" } ]
TypeScript
MIT License
oclif/oclif
fix: fixed hook circle config test
1
fix
null
821,196
24.03.2018 11:49:32
25,200
bf62e28df370a88f582db66bf7f9fdee5bc2b806
chore: bust circle cache
[ { "change_type": "MODIFY", "diff": "@@ -11,9 +11,9 @@ jobs:\n- checkout\n- restore_cache: &restore_cache\nkeys:\n- - v3-{{checksum \".circleci/config.yml\"}}-{{ checksum \"yarn.lock\"}}\n- - v3-{{checksum \".circleci/config.yml\"}}\n- - v3\n+ - v4-{{checksum \".circleci/config.yml\"}}-{{ checksum \"yarn.lock\"}}\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@@ -108,12 +108,12 @@ jobs:\n- checkout\n- restore_cache:\nkeys:\n- - v3-{{checksum \".circleci/config.yml\"}}-{{checksum \"yarn.lock\"}}\n+ - v4-{{checksum \".circleci/config.yml\"}}-{{checksum \"yarn.lock\"}}\n- run: yarn global add greenkeeper-lockfile@1\n- run: yarn add -D mocha-junit-reporter@1\n- run: yarn exec nps test.command\n- save_cache:\n- key: v3-{{checksum \".circleci/config.yml\"}}-{{checksum \"yarn.lock\"}}\n+ key: v4-{{checksum \".circleci/config.yml\"}}-{{checksum \"yarn.lock\"}}\npaths:\n- /usr/local/share/.cache/yarn\n- /usr/local/share/.config/yarn\n", "new_path": ".circleci/config.yml", "old_path": ".circleci/config.yml" } ]
TypeScript
MIT License
oclif/oclif
chore: bust circle cache
1
chore
null
821,220
24.03.2018 11:57:03
18,000
c45448e97858b789a91f765c631c91c7f8263f9f
feat: removes greenkeeper readme template badge fixes oclif/oclif#70
[ { "change_type": "MODIFY", "diff": "[![CircleCI](https://circleci.com/gh/<%= repository %>/tree/master.svg?style=shield)](https://circleci.com/gh/<%= repository %>/tree/master)\n[![Appveyor CI](https://ci.appveyor.com/api/projects/status/github/<%= repository %>?branch=master&svg=true)](https://ci.appveyor.com/project/<%= repository %>/branch/master)\n[![Codecov](https://codecov.io/gh/<%= repository %>/branch/master/graph/badge.svg)](https://codecov.io/gh/<%= repository %>)\n-[![Greenkeeper](https://badges.greenkeeper.io/<%= repository %>.svg)](https://greenkeeper.io/)\n[![Known Vulnerabilities](https://snyk.io/test/github/<%- repository %>/badge.svg)](https://snyk.io/test/github/<%- repository %>)\n[![Downloads/week](https://img.shields.io/npm/dw/<%= pjson.name %>.svg)](https://npmjs.org/package/<%= pjson.name %>)\n[![License](https://img.shields.io/npm/l/<%= pjson.name %>.svg)](https://github.com/<%= repository %>/blob/master/package.json)\n", "new_path": "templates/README.md.ejs", "old_path": "templates/README.md.ejs" } ]
TypeScript
MIT License
oclif/oclif
feat: removes greenkeeper readme template badge (#81) fixes oclif/oclif#70
1
feat
null
821,220
24.03.2018 12:22:56
18,000
7b683610ea2e5f16d622a0b7ebb6b9d2ee484b07
feat: removes snyk readme template badge fixes oclif/oclif#69
[ { "change_type": "MODIFY", "diff": "[![CircleCI](https://circleci.com/gh/<%= repository %>/tree/master.svg?style=shield)](https://circleci.com/gh/<%= repository %>/tree/master)\n[![Appveyor CI](https://ci.appveyor.com/api/projects/status/github/<%= repository %>?branch=master&svg=true)](https://ci.appveyor.com/project/<%= repository %>/branch/master)\n[![Codecov](https://codecov.io/gh/<%= repository %>/branch/master/graph/badge.svg)](https://codecov.io/gh/<%= repository %>)\n-[![Known Vulnerabilities](https://snyk.io/test/github/<%- repository %>/badge.svg)](https://snyk.io/test/github/<%- repository %>)\n[![Downloads/week](https://img.shields.io/npm/dw/<%= pjson.name %>.svg)](https://npmjs.org/package/<%= pjson.name %>)\n[![License](https://img.shields.io/npm/l/<%= pjson.name %>.svg)](https://github.com/<%= repository %>/blob/master/package.json)\n", "new_path": "templates/README.md.ejs", "old_path": "templates/README.md.ejs" } ]
TypeScript
MIT License
oclif/oclif
feat: removes snyk readme template badge (#80) fixes oclif/oclif#69
1
feat
null
821,196
24.03.2018 14:06:36
25,200
fa5ed182599da48c2002fecf7feedf241444797c
fix: add warning if CLI is out of date
[ { "change_type": "MODIFY", "diff": "\"dependencies\": {\n\"@oclif/command\": \"^1.4.5\",\n\"@oclif/config\": \"^1.3.60\",\n- \"@oclif/errors\": \"^1.0.2\",\n+ \"@oclif/errors\": \"^1.0.3\",\n\"@oclif/plugin-help\": \"^1.2.1\",\n\"@oclif/plugin-not-found\": \"^1.0.5\",\n+ \"@oclif/plugin-warn-if-update-available\": \"^1.0.2\",\n\"debug\": \"^3.1.0\",\n\"fixpack\": \"^2.3.1\",\n\"lodash\": \"^4.17.5\",\n\"commands\": \"./lib/commands\",\n\"plugins\": [\n\"@oclif/plugin-help\",\n+ \"@oclif/plugin-warn-if-update-available\",\n\"@oclif/plugin-not-found\"\n],\n\"bin\": \"oclif\"\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "strip-ansi \"^4.0.0\"\nwrap-ansi \"^3.0.1\"\n+\"@oclif/errors@^1.0.3\":\n+ version \"1.0.3\"\n+ resolved \"https://registry.yarnpkg.com/@oclif/errors/-/errors-1.0.3.tgz#f23c024075855c7d116d041ee158f99bd51175af\"\n+ dependencies:\n+ clean-stack \"^1.3.0\"\n+ fs-extra \"^5.0.0\"\n+ indent-string \"^3.2.0\"\n+ strip-ansi \"^4.0.0\"\n+ wrap-ansi \"^3.0.1\"\n+\n\"@oclif/parser@^3.2.9\":\nversion \"3.2.9\"\nresolved \"https://registry.yarnpkg.com/@oclif/parser/-/parser-3.2.9.tgz#76d01106971e20dfcfec5be276c4e6e9edfee9ec\"\n\"@oclif/command\" \"^1.4.4\"\nstring-similarity \"^1.2.0\"\n+\"@oclif/plugin-warn-if-update-available@^1.0.2\":\n+ version \"1.0.2\"\n+ resolved \"https://registry.yarnpkg.com/@oclif/plugin-warn-if-update-available/-/plugin-warn-if-update-available-1.0.2.tgz#10a4cc123ed208977c7c68f1ed6fa95d98304765\"\n+ dependencies:\n+ \"@oclif/command\" \"^1.4.5\"\n+ \"@oclif/config\" \"^1.3.60\"\n+ \"@oclif/errors\" \"^1.0.3\"\n+ debug \"^3.1.0\"\n+ fs-extra \"^5.0.0\"\n+ http-call \"^5.1.0\"\n+ semver \"^5.5.0\"\n+\n\"@oclif/tslint@^1.0.2\":\nversion \"1.0.2\"\nresolved \"https://registry.yarnpkg.com/@oclif/tslint/-/tslint-1.0.2.tgz#793d39758082f359469dba8ce5cfba041d7a7847\"\n@@ -747,6 +769,10 @@ concurrently@^3.4.0:\nsupports-color \"^3.2.3\"\ntree-kill \"^1.1.0\"\n+content-type@^1.0.4:\n+ version \"1.0.4\"\n+ resolved \"https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b\"\n+\ncopy-descriptor@^0.1.0:\nversion \"0.1.1\"\nresolved \"https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d\"\n@@ -1543,6 +1569,17 @@ hosted-git-info@^2.1.4:\nversion \"2.5.0\"\nresolved \"https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c\"\n+http-call@^5.1.0:\n+ version \"5.1.0\"\n+ resolved \"https://registry.yarnpkg.com/http-call/-/http-call-5.1.0.tgz#699847d9bcd635eb4e3fdfe3084456a9c89d716d\"\n+ dependencies:\n+ content-type \"^1.0.4\"\n+ debug \"^3.1.0\"\n+ is-retry-allowed \"^1.1.0\"\n+ is-stream \"^1.1.0\"\n+ tslib \"^1.9.0\"\n+ tunnel-agent \"^0.6.0\"\n+\niconv-lite@^0.4.17:\nversion \"0.4.19\"\nresolved \"https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b\"\n@@ -1751,7 +1788,7 @@ is-resolvable@^1.0.0:\nversion \"1.1.0\"\nresolved \"https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88\"\n-is-retry-allowed@^1.0.0:\n+is-retry-allowed@^1.0.0, is-retry-allowed@^1.1.0:\nversion \"1.1.0\"\nresolved \"https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34\"\n@@ -3119,7 +3156,7 @@ ts-node@^5.0.1:\nsource-map-support \"^0.5.3\"\nyn \"^2.0.0\"\n-tslib@^1.0.0, tslib@^1.7.1, tslib@^1.8.0, tslib@^1.8.1:\n+tslib@^1.0.0, tslib@^1.7.1, tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0:\nversion \"1.9.0\"\nresolved \"https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8\"\n@@ -3179,6 +3216,12 @@ tsutils@^2.12.1, tsutils@^2.21.0:\ndependencies:\ntslib \"^1.8.1\"\n+tunnel-agent@^0.6.0:\n+ version \"0.6.0\"\n+ resolved \"https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd\"\n+ dependencies:\n+ safe-buffer \"^5.0.1\"\n+\ntype-check@~0.3.2:\nversion \"0.3.2\"\nresolved \"https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72\"\n", "new_path": "yarn.lock", "old_path": "yarn.lock" } ]
TypeScript
MIT License
oclif/oclif
fix: add warning if CLI is out of date
1
fix
null
821,196
24.03.2018 14:37:56
25,200
db21fcab9426f322ad642fe04b8b9f072d135354
fix: updated config and warn-if-update-available
[ { "change_type": "MODIFY", "diff": "\"bugs\": \"https://github.com/oclif/oclif/issues\",\n\"dependencies\": {\n\"@oclif/command\": \"^1.4.5\",\n- \"@oclif/config\": \"^1.3.60\",\n+ \"@oclif/config\": \"^1.3.61\",\n\"@oclif/errors\": \"^1.0.3\",\n\"@oclif/plugin-help\": \"^1.2.1\",\n\"@oclif/plugin-not-found\": \"^1.0.5\",\n- \"@oclif/plugin-warn-if-update-available\": \"^1.0.2\",\n+ \"@oclif/plugin-warn-if-update-available\": \"^1.2.1\",\n\"debug\": \"^3.1.0\",\n\"fixpack\": \"^2.3.1\",\n\"lodash\": \"^4.17.5\",\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "dependencies:\ndebug \"^3.1.0\"\n+\"@oclif/config@^1.3.61\":\n+ version \"1.3.61\"\n+ resolved \"https://registry.yarnpkg.com/@oclif/config/-/config-1.3.61.tgz#1d2293d1c78dc9d88e408afd35dea9a6dccecf84\"\n+ dependencies:\n+ debug \"^3.1.0\"\n+\n\"@oclif/dev-cli@^1.4.2\":\nversion \"1.4.2\"\nresolved \"https://registry.yarnpkg.com/@oclif/dev-cli/-/dev-cli-1.4.2.tgz#cd849b2f634606c9dda71caf6d32e5bf31611c6a\"\n\"@oclif/command\" \"^1.4.4\"\nstring-similarity \"^1.2.0\"\n-\"@oclif/plugin-warn-if-update-available@^1.0.2\":\n- version \"1.0.2\"\n- resolved \"https://registry.yarnpkg.com/@oclif/plugin-warn-if-update-available/-/plugin-warn-if-update-available-1.0.2.tgz#10a4cc123ed208977c7c68f1ed6fa95d98304765\"\n+\"@oclif/plugin-warn-if-update-available@^1.2.1\":\n+ version \"1.2.1\"\n+ resolved \"https://registry.yarnpkg.com/@oclif/plugin-warn-if-update-available/-/plugin-warn-if-update-available-1.2.1.tgz#34799ccbea901b41bc49e0f7ab50ce5596ddaabb\"\ndependencies:\n\"@oclif/command\" \"^1.4.5\"\n\"@oclif/config\" \"^1.3.60\"\n\"@oclif/errors\" \"^1.0.3\"\n+ chalk \"^2.3.2\"\ndebug \"^3.1.0\"\nfs-extra \"^5.0.0\"\nhttp-call \"^5.1.0\"\n", "new_path": "yarn.lock", "old_path": "yarn.lock" } ]
TypeScript
MIT License
oclif/oclif
fix: updated config and warn-if-update-available
1
fix
null
807,849
24.03.2018 16:58:26
25,200
b939b23abbc75dbf0d153dbab379f7e9ea8cdef3
deps: bump eslint
[ { "change_type": "MODIFY", "diff": "\"requires\": {\n\"globby\": \"5.0.0\",\n\"is-path-cwd\": \"1.0.0\",\n- \"is-path-in-cwd\": \"1.0.0\",\n+ \"is-path-in-cwd\": \"1.0.1\",\n\"object-assign\": \"4.1.1\",\n\"pify\": \"2.3.0\",\n\"pinkie-promise\": \"2.0.1\",\n}\n},\n\"eslint\": {\n- \"version\": \"4.18.2\",\n- \"resolved\": \"https://registry.npmjs.org/eslint/-/eslint-4.18.2.tgz\",\n- \"integrity\": \"sha512-qy4i3wODqKMYfz9LUI8N2qYDkHkoieTbiHpMrYUI/WbjhXJQr7lI4VngixTgaG+yHX+NBCv7nW4hA0ShbvaNKw==\",\n+ \"version\": \"4.19.1\",\n+ \"resolved\": \"https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz\",\n+ \"integrity\": \"sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==\",\n\"dev\": true,\n\"requires\": {\n\"ajv\": \"5.5.2\",\n\"doctrine\": \"2.1.0\",\n\"eslint-scope\": \"3.7.1\",\n\"eslint-visitor-keys\": \"1.0.0\",\n- \"espree\": \"3.5.3\",\n+ \"espree\": \"3.5.4\",\n\"esquery\": \"1.0.0\",\n\"esutils\": \"2.0.2\",\n\"file-entry-cache\": \"2.0.0\",\n\"functional-red-black-tree\": \"1.0.1\",\n\"glob\": \"7.1.2\",\n- \"globals\": \"11.3.0\",\n+ \"globals\": \"11.4.0\",\n\"ignore\": \"3.3.7\",\n\"imurmurhash\": \"0.1.4\",\n\"inquirer\": \"3.3.0\",\n\"path-is-inside\": \"1.0.2\",\n\"pluralize\": \"7.0.0\",\n\"progress\": \"2.0.0\",\n+ \"regexpp\": \"1.0.1\",\n\"require-uncached\": \"1.0.3\",\n\"semver\": \"5.5.0\",\n\"strip-ansi\": \"4.0.0\",\n\"dev\": true\n},\n\"espree\": {\n- \"version\": \"3.5.3\",\n- \"resolved\": \"https://registry.npmjs.org/espree/-/espree-3.5.3.tgz\",\n- \"integrity\": \"sha512-Zy3tAJDORxQZLl2baguiRU1syPERAIg0L+JB2MWorORgTu/CplzvxS9WWA7Xh4+Q+eOQihNs/1o1Xep8cvCxWQ==\",\n+ \"version\": \"3.5.4\",\n+ \"resolved\": \"https://registry.npmjs.org/espree/-/espree-3.5.4.tgz\",\n+ \"integrity\": \"sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==\",\n\"dev\": true,\n\"requires\": {\n\"acorn\": \"5.5.0\",\n\"integrity\": \"sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=\"\n},\n\"globals\": {\n- \"version\": \"11.3.0\",\n- \"resolved\": \"https://registry.npmjs.org/globals/-/globals-11.3.0.tgz\",\n- \"integrity\": \"sha512-kkpcKNlmQan9Z5ZmgqKH/SMbSmjxQ7QjyNqfXVc8VJcoBV2UEg+sxQD15GQofGRh2hfpwUb70VC31DR7Rq5Hdw==\",\n+ \"version\": \"11.4.0\",\n+ \"resolved\": \"https://registry.npmjs.org/globals/-/globals-11.4.0.tgz\",\n+ \"integrity\": \"sha512-Dyzmifil8n/TmSqYDEXbm+C8yitzJQqQIlJQLNRMwa+BOUJpRC19pyVeN12JAjt61xonvXjtff+hJruTRXn5HA==\",\n\"dev\": true\n},\n\"globby\": {\n\"dev\": true\n},\n\"is-path-in-cwd\": {\n- \"version\": \"1.0.0\",\n- \"resolved\": \"https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz\",\n- \"integrity\": \"sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=\",\n+ \"version\": \"1.0.1\",\n+ \"resolved\": \"https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz\",\n+ \"integrity\": \"sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==\",\n\"dev\": true,\n\"requires\": {\n\"is-path-inside\": \"1.0.1\"\n\"safe-regex\": \"1.1.0\"\n}\n},\n+ \"regexpp\": {\n+ \"version\": \"1.0.1\",\n+ \"resolved\": \"https://registry.npmjs.org/regexpp/-/regexpp-1.0.1.tgz\",\n+ \"integrity\": \"sha512-8Ph721maXiOYSLtaDGKVmDn5wdsNaF6Px85qFNeMPQq0r8K5Y10tgP6YuR65Ws35n4DvzFcCxEnRNBIXQunzLw==\",\n+ \"dev\": true\n+ },\n\"registry-auth-token\": {\n\"version\": \"3.3.2\",\n\"resolved\": \"https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.3.2.tgz\",\n", "new_path": "package-lock.json", "old_path": "package-lock.json" }, { "change_type": "MODIFY", "diff": "\"@lerna-test/silence-logging\": \"file:helpers/silence-logging\",\n\"@lerna-test/update-lerna-config\": \"file:helpers/update-lerna-config\",\n\"cross-env\": \"^5.1.4\",\n- \"eslint\": \"^4.18.2\",\n+ \"eslint\": \"^4.19.1\",\n\"eslint-config-airbnb-base\": \"^12.1.0\",\n\"eslint-config-prettier\": \"^2.9.0\",\n\"eslint-plugin-babel\": \"^4.1.2\",\n", "new_path": "package.json", "old_path": "package.json" } ]
JavaScript
MIT License
lerna/lerna
deps: bump eslint
1
deps
null
807,849
24.03.2018 19:09:14
25,200
dbfc8916e34621c06b9f9a0c0d6fd44d38886bc3
fix(add): Use bootstrap factory, not handler
[ { "change_type": "MODIFY", "diff": "\"use strict\";\n-jest.mock(\"@lerna/bootstrap/command\");\n+jest.mock(\"@lerna/bootstrap\");\nconst fs = require(\"fs-extra\");\nconst path = require(\"path\");\n// mocked or stubbed modules\n-const BootstrapCommand = require(\"@lerna/bootstrap/command\");\n+const bootstrap = require(\"@lerna/bootstrap\");\n// helpers\nconst initFixture = require(\"@lerna-test/init-fixture\")(__dirname);\n@@ -22,7 +22,7 @@ const readPkg = (testDir, pkg) => fs.readJSON(path.join(testDir, pkg, \"package.j\ndescribe(\"AddCommand\", () => {\n// we already have enough tests of BootstrapCommand\n- BootstrapCommand.handler.mockResolvedValue();\n+ bootstrap.mockResolvedValue();\nit(\"should throw without packages\", async () => {\nexpect.assertions(1);\n@@ -165,7 +165,7 @@ describe(\"AddCommand\", () => {\nawait lernaAdd(testDir)(\"@test/package-1\");\n- expect(BootstrapCommand.handler).lastCalledWith(\n+ expect(bootstrap).lastCalledWith(\nexpect.objectContaining({\nscope: [\"@test/package-2\", \"package-3\", \"package-4\"],\n})\n@@ -177,7 +177,7 @@ describe(\"AddCommand\", () => {\nawait lernaAdd(testDir)(\"@test/package-1\", \"--scope\", \"@test/package-2\", \"--scope\", \"package-3\");\n- expect(BootstrapCommand.handler).lastCalledWith(\n+ expect(bootstrap).lastCalledWith(\nexpect.objectContaining({\nscope: [\"@test/package-2\", \"package-3\"],\n})\n@@ -189,7 +189,7 @@ describe(\"AddCommand\", () => {\nawait lernaAdd(testDir)(\"@test/package-1\", \"--ignore\", \"@test/package-2\");\n- expect(BootstrapCommand.handler).lastCalledWith(\n+ expect(bootstrap).lastCalledWith(\nexpect.objectContaining({\nscope: [\"package-3\", \"package-4\"],\n})\n@@ -201,7 +201,7 @@ describe(\"AddCommand\", () => {\nawait lernaAdd(testDir)(\"@test/package-1\");\n- expect(BootstrapCommand.handler).not.toHaveBeenCalled();\n+ expect(bootstrap).not.toHaveBeenCalled();\n});\nit(\"bootstraps mixed local and external dependencies\", async () => {\n@@ -221,7 +221,7 @@ describe(\"AddCommand\", () => {\nexpect(pkg3).toDependOn(\"pify\", \"^3.0.0\");\nexpect(pkg3).toDependOn(\"@test/package-2\"); // existing, but should stay\n- expect(BootstrapCommand.handler).lastCalledWith(\n+ expect(bootstrap).lastCalledWith(\nexpect.objectContaining({\nscope: [\"@test/package-1\", \"@test/package-2\", \"@test/package-3\"],\n})\n", "new_path": "commands/add/__tests__/add-command.test.js", "old_path": "commands/add/__tests__/add-command.test.js" }, { "change_type": "MODIFY", "diff": "@@ -7,8 +7,8 @@ const pMap = require(\"p-map\");\nconst semver = require(\"semver\");\nconst writePkg = require(\"write-pkg\");\n-const BootstrapCommand = require(\"@lerna/bootstrap/command\");\nconst Command = require(\"@lerna/command\");\n+const bootstrap = require(\"@lerna/bootstrap\");\nconst ValidationError = require(\"@lerna/validation-error\");\nconst getRangeToReference = require(\"./lib/get-range-to-reference\");\n@@ -83,7 +83,7 @@ class AddCommand extends Command {\nreturn this.makeChanges().then(pkgs => {\nthis.logger.info(`Changes require bootstrap in ${pkgs.length} packages`);\n- return BootstrapCommand.handler(\n+ return bootstrap(\nObject.assign({}, this.options, {\nargs: [],\ncwd: this.project.rootPath,\n", "new_path": "commands/add/index.js", "old_path": "commands/add/index.js" } ]
JavaScript
MIT License
lerna/lerna
fix(add): Use bootstrap factory, not handler
1
fix
add
807,849
24.03.2018 19:17:36
25,200
bef1ec5cbd159d0fd65ffa26fa0b4ce3737d969c
chore(ci): Replace cipm with npm ci
[ { "change_type": "MODIFY", "diff": "@@ -22,10 +22,9 @@ cache:\nbefore_install:\n- npm config set loglevel warn\n- - npm install --global npm@latest cipm\n+ - npm install --global npm@latest\n-install: cipm\n-# use cipm until `npm ci` is fixed\n+install: npm ci\nbefore_script:\n- git config --global user.email test@example.com\n", "new_path": ".travis.yml", "old_path": ".travis.yml" }, { "change_type": "MODIFY", "diff": "@@ -18,10 +18,9 @@ cache:\ninstall:\n- ps: Install-Product node $env:nodejs_version\n- npm config set loglevel warn\n- - npm install --global npm@latest cipm\n+ - npm install --global npm@latest\n- set PATH=%APPDATA%\\npm;%PATH%\n- - cipm\n- # use cipm until `npm ci` is fixed\n+ - npm ci\nbefore_test:\n- git config --global user.email test@example.com\n", "new_path": "appveyor.yml", "old_path": "appveyor.yml" } ]
JavaScript
MIT License
lerna/lerna
chore(ci): Replace cipm with npm ci
1
chore
ci
807,849
24.03.2018 19:20:59
25,200
58fba36e7f6867a2097b15ec03b964f11f562e80
chore(helpers): Remove generated comments from exclude template
[ { "change_type": "MODIFY", "diff": "# git ls-files --others --exclude-from=.git/info/exclude\n-# Lines that start with '#' are comments.\n-# For a project mostly in C, the following would be a good set of\n-# exclude patterns (uncomment them if you want to use them):\nnode_modules\n-\n", "new_path": "helpers/git-init/template/info/exclude", "old_path": "helpers/git-init/template/info/exclude" } ]
JavaScript
MIT License
lerna/lerna
chore(helpers): Remove generated comments from exclude template
1
chore
helpers
807,849
24.03.2018 19:21:31
25,200
929e0c259c81222b57484835a3d14a267b1ef56c
chore(ci): Remove global git config handled by template
[ { "change_type": "MODIFY", "diff": "@@ -26,10 +26,6 @@ before_install:\ninstall: npm ci\n-before_script:\n- - git config --global user.email test@example.com\n- - git config --global user.name \"Tester McPerson\"\n-\nscript: npm run ci\nnotifications:\n", "new_path": ".travis.yml", "old_path": ".travis.yml" }, { "change_type": "MODIFY", "diff": "@@ -22,10 +22,6 @@ install:\n- set PATH=%APPDATA%\\npm;%PATH%\n- npm ci\n-before_test:\n- - git config --global user.email test@example.com\n- - git config --global user.name \"Tester McPerson\"\n-\ntest_script:\n- npm run ci\n", "new_path": "appveyor.yml", "old_path": "appveyor.yml" } ]
JavaScript
MIT License
lerna/lerna
chore(ci): Remove global git config handled by template
1
chore
ci
821,196
24.03.2018 21:21:49
25,200
bffcc902704876c3cbfe3cf942e8e5f206c872d9
fix: automate create-oclif publishing
[ { "change_type": "MODIFY", "diff": "@@ -9,3 +9,5 @@ PATH=/usr/local/share/.config/yarn/global/node_modules/.bin:$PATH\nyarn global add @oclif/semantic-release@2 semantic-release@15\nyarn install --frozen-lockfile\nsemantic-release -e @oclif/semantic-release\n+\n+./scripts/release_create_oclif.js\n", "new_path": ".circleci/release", "old_path": ".circleci/release" }, { "change_type": "ADD", "diff": "+#!/usr/bin/env node\n+\n+const fs = require('fs-extra')\n+const {execSync} = require('child_process')\n+\n+const pjson = fs.readJSONSync('package.json')\n+pjson.name = 'create-oclif'\n+fs.outputJSONSync('package.json', pjson, {spaces: 2})\n+\n+function x(cmd) {\n+ execSync(cmd, {stdio: 'inherit'})\n+}\n+\n+x('npm publish')\n", "new_path": "scripts/release_create_oclif.js", "old_path": null } ]
TypeScript
MIT License
oclif/oclif
fix: automate create-oclif publishing
1
fix
null
821,196
24.03.2018 21:29:44
25,200
020e633eab2e7133a2526bfef8fe5c6fc54dfb4a
fix: move release script into semantic-release
[ { "change_type": "MODIFY", "diff": "@@ -9,5 +9,3 @@ PATH=/usr/local/share/.config/yarn/global/node_modules/.bin:$PATH\nyarn global add @oclif/semantic-release@2 semantic-release@15\nyarn install --frozen-lockfile\nsemantic-release -e @oclif/semantic-release\n-\n-./scripts/release_create_oclif.js\n", "new_path": ".circleci/release", "old_path": ".circleci/release" }, { "change_type": "MODIFY", "diff": "@@ -24,4 +24,12 @@ module.exports = {\nassets: ['package.json', 'CHANGELOG.md', 'README.md', 'docs'],\n},\n],\n+ publish: [\n+ '@semantic-release/npm',\n+ '@semantic-release/github',\n+ {\n+ path: '@semantic-release/exec',\n+ cmd: './scripts/release_create_oclif.js',\n+ },\n+ ],\n}\n", "new_path": "release.config.js", "old_path": "release.config.js" } ]
TypeScript
MIT License
oclif/oclif
fix: move release script into semantic-release
1
fix
null
807,849
24.03.2018 22:41:38
25,200
6495b5c3f1c0be463f9bbf7230e1f2164faed6a4
test: Pre-cache command module to fix CI
[ { "change_type": "MODIFY", "diff": "\"use strict\";\n+const path = require(\"path\");\nconst yargs = require(\"yargs/yargs\");\nconst globalOptions = require(\"@lerna/global-options\");\n@@ -13,8 +14,12 @@ module.exports = commandRunner;\n* @return {Function} with partially-applied yargs config\n*/\nfunction commandRunner(commandModule) {\n+ /* eslint-disable import/no-dynamic-require, global-require */\nconst cmd = commandModule.command.split(\" \")[0];\n+ // prime the pump so slow-as-molasses CI doesn't fail with delayed require()\n+ require(path.resolve(require.main.filename, \"../..\"));\n+\nreturn cwd => {\n// create a _new_ yargs instance every time cwd changes to avoid singleton pollution\nconst cli = yargs([], cwd)\n", "new_path": "helpers/command-runner/index.js", "old_path": "helpers/command-runner/index.js" } ]
JavaScript
MIT License
lerna/lerna
test: Pre-cache command module to fix CI
1
test
null