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
791,719
31.03.2018 13:37:48
25,200
b9fa76077b15e5b5a67b1b195f9843d4b393ec52
report: update SEO audit descriptions & links
[ { "change_type": "MODIFY", "diff": "@@ -60,9 +60,9 @@ class Hreflang extends Audit {\nname: 'hreflang',\ndescription: 'Document has a valid `hreflang`',\nfailureDescription: 'Document doesn\\'t have a valid `hreflang`',\n- helpText: 'hreflang allows crawlers to discover alternate translations of the ' +\n- 'page content. [Learn more]' +\n- '(https://support.google.com/webmasters/answer/189077).',\n+ helpText: 'hreflang links tell search engines what version of a page they should ' +\n+ 'list in search results for a given language or region. [Learn more]' +\n+ '(https://developers.google.com/web/tools/lighthouse/audits/hreflang).',\nrequiredArtifacts: ['Hreflang'],\n};\n}\n", "new_path": "lighthouse-core/audits/seo/hreflang.js", "old_path": "lighthouse-core/audits/seo/hreflang.js" }, { "change_type": "MODIFY", "diff": "@@ -69,8 +69,9 @@ class Plugins extends Audit {\nname: 'plugins',\ndescription: 'Document avoids plugins',\nfailureDescription: 'Document uses plugins',\n- helpText: 'Most mobile devices do not support plugins, and many desktop browsers restrict ' +\n- 'them.',\n+ helpText: 'Search engines can\\'t index plugin content, and ' +\n+ 'many devices restrict plugins or don\\'t support them. ' +\n+ '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/plugins).',\nrequiredArtifacts: ['EmbeddedContent'],\n};\n}\n", "new_path": "lighthouse-core/audits/seo/plugins.js", "old_path": "lighthouse-core/audits/seo/plugins.js" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
report: update SEO audit descriptions & links (#4903)
1
report
null
679,913
31.03.2018 16:25:34
-3,600
a0bf781087bac343627d250c5c35a57cb0ee432d
fix(pointfree): reexport ensureStack fns
[ { "change_type": "MODIFY", "diff": "@@ -75,6 +75,11 @@ const $ = SAFE ?\n(stack: Stack, n: number) => $n(stack.length, n) :\n() => { };\n+export {\n+ $ as ensureStack,\n+ $n as ensureStackN\n+}\n+\nconst $stackFn = (f: StackProc) =>\nisArray(f) ? word(f) : f;\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): reexport ensureStack fns
1
fix
pointfree
679,913
31.03.2018 16:28:14
-3,600
659cce91797762ea828f7d5867721319148558e1
fix(pointfree-lang): add ensureEnv, update re-exports, update readme add ensureEnv to avoid errors if `__words` key is missing minor formatting fix in grammar
[ { "change_type": "MODIFY", "diff": "This project is part of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.\n-<!-- TOC depthFrom:2 depthTo:3 -->\n+<!-- TOC depthFrom:2 depthTo:4 -->\n- [About](#about)\n- [Status](#status)\n@@ -14,6 +14,7 @@ This project is part of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrell\n- [Comments](#comments)\n- [Identifiers](#identifiers)\n- [Word definitions](#word-definitions)\n+ - [Hyperstatic words](#hyperstatic-words)\n- [Boolean](#boolean)\n- [Numbers](#numbers)\n- [Strings](#strings)\n@@ -30,17 +31,19 @@ This project is part of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrell\n## About\n-Experimental, small DSL with compact\n+Experimental language layer with compact\n[Forth](https://en.wikipedia.org/wiki/Forth_(programming_language))\n-style syntax for\n-[@thi.ng/pointfree](https://github.com/thi-ng/umbrella/tree/master/packages/pointfree):\n+style syntax for the\n+[@thi.ng/pointfree](https://github.com/thi-ng/umbrella/tree/master/packages/pointfree),\n+an ES6 embedded DSL for concatenative programming:\n- [PegJS](https://pegjs.org/) based\n[grammar](https://github.com/thi-ng/umbrella/tree/master/packages/pointfree-lang/src/grammar.pegjs)\n& parser\n- untyped, interpreted, but with AOT compilation of user defined words\n-- support for custom / externally defined vocabularies (word sets)\n-- lexically scoped variables\n+- hyperstatic word definitions\n+- support for custom / externally defined vocabularies (word sets / JS functions)\n+- scoped variables (stored in environment object)\n- nested quotations (code as data)\n- array & object literals (optionally w/ computed properties)\n- all other features of @thi.ng/pointfree (combinators, array/vector ops etc.)\n@@ -89,6 +92,9 @@ const src = `\nconst drawLine = (ctx) => {\nconst stack = ctx[0];\n+ // minimum stack depth guard\n+ pf.ensureStack(stack, 2);\n+ // pop top 2 values\nconst [x2, y2] = stack.pop();\nconst [x1, y1] = stack.pop();\nconsole.log(`draw line: ${x1},${y1} -> ${x2},${y2}`);\n@@ -160,7 +166,8 @@ drastically. In @thi.ng/pointfree (and therefore also in this DSL layer):\n- the DSL has syntax sugar for variable value lookups & assignments\n- the DSL allows nested quotations & object literals, optionally with\nlazily resolved computed properties and/or values\n-- all symbols are separated by whitespace (like in Clojure, commas are considered whitespace too)\n+- all symbols are separated by whitespace (like in Clojure, commas are\n+ considered whitespace too)\n### Comments\n@@ -188,8 +195,9 @@ ______ ____ |__| _____/ |__/ ____\\______ ____ ____\n### Identifiers\n-Word identifiers can contain any alhpanumeric character and these additional ones: `*?$%&/|~<>=._+-`.\n-Digits are not allowed as first char.\n+Word identifiers can contain any alhpanumeric character and these\n+additional ones: `*?$%&/|~<>=._+-`. Digits are not allowed as first\n+char.\nAll 100+ built-in words defined by\n[@thi.ng/pointfree](https://github.com/thi-ng/umbrella/tree/master/packages/pointfree)\n@@ -234,6 +242,34 @@ As in Forth, new words can be defined using the `: name ... ;` form.\n```\n: square ( x -- x*x ) dup * ;\n+\n+10 square .\n+```\n+\n+Will result in `100`.\n+\n+#### Hyperstatic words\n+\n+Unlike [variables](#variables), words are defined in a\n+[hyper-static](http://wiki.c2.com/?HyperStaticGlobalEnvironment)\n+environment, meaning new versions of existing words can be defined,\n+however any other word (incl. the new version of same word) which uses\n+the earlier version will continue to do so. By implication, this too\n+means that attempting to use undefined words inside a word definition\n+will fail, even if they'd be defined later on.\n+\n+```ts\n+pf.run(`\n+: foo \"foo1\" ;\n+: bar foo \"bar\" + ;\n+\n+( redefine foo, incl. use of existing version )\n+: foo foo \"foo2\" + ;\n+\n+( use words )\n+foo bar\n+`)[0];\n+// [ 'foo1foo2', 'foo1bar' ]\n```\nThere're no formatting rules enforced (yet, but under consideration).\n@@ -283,13 +319,18 @@ pf.runU(`@a @b +`, {a: 10, b: 20});\n// 30\n```\n-Storing a stack value in a variable is done via the `!` suffix:\n+Storing a stack value in a variable (in the the current environment) is\n+done via the `!` suffix:\n```ts\npf.runE(`1 2 + a!`)\n// {a: 3}\n```\n+Furthermore, readonly variables can be defined via words. In this case\n+no prefix must be used and these kind of variables are\n+[hyperstatic](#hyperstatic-words).\n+\nTODO add info about scoping and resolution in words / quotations...\n### Objects\n", "new_path": "packages/pointfree-lang/README.md", "old_path": "packages/pointfree-lang/README.md" }, { "change_type": "MODIFY", "diff": "@@ -172,30 +172,45 @@ const deferedPair = (res: any, k, v) => {\n(ctx: pf.StackContext) => (res[k] = resolveVar(v.id, ctx), ctx);\n};\n+export const ensureEnv = (env?: pf.StackEnv) => {\n+ env = env || {};\n+ if (!env.__words) {\n+ env.__words = {};\n+ }\n+ return env;\n+};\n+\nexport const run = (src: string, env?: pf.StackEnv, stack: pf.Stack = []) => {\n- let ctx = pf.ctx(stack, { __words: {}, ...env });\n+ let ctx = pf.ctx(stack, ensureEnv(env));\nfor (let node of parse(src)) {\nctx = visit(node, ctx);\n}\nreturn ctx;\n};\n-export const runU = (src: string, env?: pf.StackEnv, stack: pf.Stack = [], n = 1) =>\n+export const runU = (src: string, env?: pf.StackEnv, stack?: pf.Stack, n = 1) =>\npf.unwrap(run(src, env, stack), n);\n-export const runE = (src: string, env?: pf.StackEnv, stack: pf.Stack = []) =>\n+export const runE = (src: string, env?: pf.StackEnv, stack?: pf.Stack) =>\nrun(src, env, stack)[2];\nexport const runWord = (id: string, env?: pf.StackEnv, stack: pf.Stack = []) =>\n- env.__words[id](pf.ctx(stack, env));\n+ env.__words[id](pf.ctx(stack, ensureEnv(env)));\nexport const runWordU = (id: string, env?: pf.StackEnv, stack: pf.Stack = [], n = 1) =>\n- pf.unwrap(env.__words[id](pf.ctx(stack, env)), n);\n+ pf.unwrap(env.__words[id](pf.ctx(stack, ensureEnv(env))), n);\nexport const runWordE = (id: string, env?: pf.StackEnv, stack: pf.Stack = []) =>\n- env.__words[id](pf.ctx(stack, env))[2];\n+ env.__words[id](pf.ctx(stack, ensureEnv(env)))[2];\nexport const ffi = (env: any, words: IObjectOf<pf.StackFn>) => {\n+ env = ensureEnv(env);\nenv.__words = { ...env.__words, ...words };\nreturn env;\n};\n+\n+export {\n+ ensureStack,\n+ ensureStackN,\n+ unwrap,\n+} from \"@thi.ng/pointfree\";\n\\ No newline at end of file\n", "new_path": "packages/pointfree-lang/src/index.ts", "old_path": "packages/pointfree-lang/src/index.ts" }, { "change_type": "MODIFY", "diff": "@@ -20,6 +20,9 @@ const src = `\nconst drawLine = (ctx) => {\nconst stack = ctx[0];\n+ // minimum stack depth guard\n+ pf.ensureStack(stack, 2);\n+ // pop top 2 values\nconst [x2, y2] = stack.pop();\nconst [x1, y1] = stack.pop();\nconsole.log(`draw line: ${x1},${y1} -> ${x2},${y2}`);\n", "new_path": "packages/pointfree-lang/test/readme.ts", "old_path": "packages/pointfree-lang/test/readme.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
fix(pointfree-lang): add ensureEnv, update re-exports, update readme - add ensureEnv to avoid errors if `__words` key is missing - minor formatting fix in grammar
1
fix
pointfree-lang
679,913
31.03.2018 17:59:22
-3,600
910b7187a00f01ddf414c8b4af2dbfeede6f7303
feat(examples): add pointfree-svg demo
[ { "change_type": "ADD", "diff": "+node_modules\n+yarn.lock\n+*.js\n", "new_path": "examples/pointfree-svg/.gitignore", "old_path": null }, { "change_type": "ADD", "diff": "+# pointfree-svg\n+\n+This is a non-interactive demo combining the following packages to generate the SVG graphic below:\n+\n+- [@thi.ng/hiccup](https://github.com/thi-ng/umbrella/tree/master/packages/hiccup)\n+- [@thi.ng/hdom-components](https://github.com/thi-ng/umbrella/tree/master/packages/hdom-components)\n+- [@thi.ng/pointfree](https://github.com/thi-ng/umbrella/tree/master/packages/pointfree)\n+- [@thi.ng/pointfree-lang](https://github.com/thi-ng/umbrella/tree/master/packages/pointfree-lang)\n+\n+![generated result](./output.svg)\n+\n+The generated SVG file will be written in this example's directory...\n+\n+```\n+git clone https://github.com/thi-ng/umbrella.git\n+cd umbrella/examples/pointfree-svg\n+yarn start\n+```\n", "new_path": "examples/pointfree-svg/README.md", "old_path": null }, { "change_type": "ADD", "diff": "+<svg width=\"200\" height=\"200\" stroke=\"#f04\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><circle cx=\"200.00\" cy=\"200.00\" r=\"3.00\"/><circle cx=\"190.00\" cy=\"200.00\" r=\"3.00\"/><circle cx=\"180.00\" cy=\"200.00\" r=\"3.00\"/><circle cx=\"170.00\" cy=\"200.00\" r=\"3.00\"/><circle cx=\"160.00\" cy=\"200.00\" r=\"3.00\"/><circle cx=\"150.00\" cy=\"200.00\" r=\"3.00\"/><circle cx=\"140.00\" cy=\"200.00\" r=\"3.00\"/><circle cx=\"130.00\" cy=\"200.00\" r=\"3.00\"/><circle cx=\"120.00\" cy=\"200.00\" r=\"3.00\"/><circle cx=\"110.00\" cy=\"200.00\" r=\"3.00\"/><circle cx=\"100.00\" cy=\"200.00\" r=\"3.00\"/><circle cx=\"90.00\" cy=\"200.00\" r=\"3.00\"/><circle cx=\"80.00\" cy=\"200.00\" r=\"3.00\"/><circle cx=\"70.00\" cy=\"200.00\" r=\"3.00\"/><circle cx=\"60.00\" cy=\"200.00\" r=\"3.00\"/><circle cx=\"50.00\" cy=\"200.00\" r=\"3.00\"/><circle cx=\"40.00\" cy=\"200.00\" r=\"3.00\"/><circle cx=\"30.00\" cy=\"200.00\" r=\"3.00\"/><circle cx=\"20.00\" cy=\"200.00\" r=\"3.00\"/><circle cx=\"10.00\" cy=\"200.00\" r=\"3.00\"/><circle cx=\"0.00\" cy=\"200.00\" r=\"3.00\"/><circle cx=\"190.00\" cy=\"190.00\" r=\"3.00\"/><circle cx=\"180.00\" cy=\"190.00\" r=\"3.00\"/><circle cx=\"170.00\" cy=\"190.00\" r=\"3.00\"/><circle cx=\"160.00\" cy=\"190.00\" r=\"3.00\"/><circle cx=\"150.00\" cy=\"190.00\" r=\"3.00\"/><circle cx=\"140.00\" cy=\"190.00\" r=\"3.00\"/><circle cx=\"130.00\" cy=\"190.00\" r=\"3.00\"/><circle cx=\"120.00\" cy=\"190.00\" r=\"3.00\"/><circle cx=\"110.00\" cy=\"190.00\" r=\"3.00\"/><circle cx=\"100.00\" cy=\"190.00\" r=\"3.00\"/><circle cx=\"90.00\" cy=\"190.00\" r=\"3.00\"/><circle cx=\"80.00\" cy=\"190.00\" r=\"3.00\"/><circle cx=\"70.00\" cy=\"190.00\" r=\"3.00\"/><circle cx=\"60.00\" cy=\"190.00\" r=\"3.00\"/><circle cx=\"50.00\" cy=\"190.00\" r=\"3.00\"/><circle cx=\"40.00\" cy=\"190.00\" r=\"3.00\"/><circle cx=\"30.00\" cy=\"190.00\" r=\"3.00\"/><circle cx=\"20.00\" cy=\"190.00\" r=\"3.00\"/><circle cx=\"10.00\" cy=\"190.00\" r=\"3.00\"/><circle cx=\"0.00\" cy=\"190.00\" r=\"3.00\"/><circle cx=\"180.00\" cy=\"180.00\" r=\"3.00\"/><circle cx=\"170.00\" cy=\"180.00\" r=\"3.00\"/><circle cx=\"160.00\" cy=\"180.00\" r=\"3.00\"/><circle cx=\"150.00\" cy=\"180.00\" r=\"3.00\"/><circle cx=\"140.00\" cy=\"180.00\" r=\"3.00\"/><circle cx=\"130.00\" cy=\"180.00\" r=\"3.00\"/><circle cx=\"120.00\" cy=\"180.00\" r=\"3.00\"/><circle cx=\"110.00\" cy=\"180.00\" r=\"3.00\"/><circle cx=\"100.00\" cy=\"180.00\" r=\"3.00\"/><circle cx=\"90.00\" cy=\"180.00\" r=\"3.00\"/><circle cx=\"80.00\" cy=\"180.00\" r=\"3.00\"/><circle cx=\"70.00\" cy=\"180.00\" r=\"3.00\"/><circle cx=\"60.00\" cy=\"180.00\" r=\"3.00\"/><circle cx=\"50.00\" cy=\"180.00\" r=\"3.00\"/><circle cx=\"40.00\" cy=\"180.00\" r=\"3.00\"/><circle cx=\"30.00\" cy=\"180.00\" r=\"3.00\"/><circle cx=\"20.00\" cy=\"180.00\" r=\"3.00\"/><circle cx=\"10.00\" cy=\"180.00\" r=\"3.00\"/><circle cx=\"0.00\" cy=\"180.00\" r=\"3.00\"/><circle cx=\"170.00\" cy=\"170.00\" r=\"3.00\"/><circle cx=\"160.00\" cy=\"170.00\" r=\"3.00\"/><circle cx=\"150.00\" cy=\"170.00\" r=\"3.00\"/><circle cx=\"140.00\" cy=\"170.00\" r=\"3.00\"/><circle cx=\"130.00\" cy=\"170.00\" r=\"3.00\"/><circle cx=\"120.00\" cy=\"170.00\" r=\"3.00\"/><circle cx=\"110.00\" cy=\"170.00\" r=\"3.00\"/><circle cx=\"100.00\" cy=\"170.00\" r=\"3.00\"/><circle cx=\"90.00\" cy=\"170.00\" r=\"3.00\"/><circle cx=\"80.00\" cy=\"170.00\" r=\"3.00\"/><circle cx=\"70.00\" cy=\"170.00\" r=\"3.00\"/><circle cx=\"60.00\" cy=\"170.00\" r=\"3.00\"/><circle cx=\"50.00\" cy=\"170.00\" r=\"3.00\"/><circle cx=\"40.00\" cy=\"170.00\" r=\"3.00\"/><circle cx=\"30.00\" cy=\"170.00\" r=\"3.00\"/><circle cx=\"20.00\" cy=\"170.00\" r=\"3.00\"/><circle cx=\"10.00\" cy=\"170.00\" r=\"3.00\"/><circle cx=\"0.00\" cy=\"170.00\" r=\"3.00\"/><circle cx=\"160.00\" cy=\"160.00\" r=\"3.00\"/><circle cx=\"150.00\" cy=\"160.00\" r=\"3.00\"/><circle cx=\"140.00\" cy=\"160.00\" r=\"3.00\"/><circle cx=\"130.00\" cy=\"160.00\" r=\"3.00\"/><circle cx=\"120.00\" cy=\"160.00\" r=\"3.00\"/><circle cx=\"110.00\" cy=\"160.00\" r=\"3.00\"/><circle cx=\"100.00\" cy=\"160.00\" r=\"3.00\"/><circle cx=\"90.00\" cy=\"160.00\" r=\"3.00\"/><circle cx=\"80.00\" cy=\"160.00\" r=\"3.00\"/><circle cx=\"70.00\" cy=\"160.00\" r=\"3.00\"/><circle cx=\"60.00\" cy=\"160.00\" r=\"3.00\"/><circle cx=\"50.00\" cy=\"160.00\" r=\"3.00\"/><circle cx=\"40.00\" cy=\"160.00\" r=\"3.00\"/><circle cx=\"30.00\" cy=\"160.00\" r=\"3.00\"/><circle cx=\"20.00\" cy=\"160.00\" r=\"3.00\"/><circle cx=\"10.00\" cy=\"160.00\" r=\"3.00\"/><circle cx=\"0.00\" cy=\"160.00\" r=\"3.00\"/><circle cx=\"150.00\" cy=\"150.00\" r=\"3.00\"/><circle cx=\"140.00\" cy=\"150.00\" r=\"3.00\"/><circle cx=\"130.00\" cy=\"150.00\" r=\"3.00\"/><circle cx=\"120.00\" cy=\"150.00\" r=\"3.00\"/><circle cx=\"110.00\" cy=\"150.00\" r=\"3.00\"/><circle cx=\"100.00\" cy=\"150.00\" r=\"3.00\"/><circle cx=\"90.00\" cy=\"150.00\" r=\"3.00\"/><circle cx=\"80.00\" cy=\"150.00\" r=\"3.00\"/><circle cx=\"70.00\" cy=\"150.00\" r=\"3.00\"/><circle cx=\"60.00\" cy=\"150.00\" r=\"3.00\"/><circle cx=\"50.00\" cy=\"150.00\" r=\"3.00\"/><circle cx=\"40.00\" cy=\"150.00\" r=\"3.00\"/><circle cx=\"30.00\" cy=\"150.00\" r=\"3.00\"/><circle cx=\"20.00\" cy=\"150.00\" r=\"3.00\"/><circle cx=\"10.00\" cy=\"150.00\" r=\"3.00\"/><circle cx=\"0.00\" cy=\"150.00\" r=\"3.00\"/><circle cx=\"140.00\" cy=\"140.00\" r=\"3.00\"/><circle cx=\"130.00\" cy=\"140.00\" r=\"3.00\"/><circle cx=\"120.00\" cy=\"140.00\" r=\"3.00\"/><circle cx=\"110.00\" cy=\"140.00\" r=\"3.00\"/><circle cx=\"100.00\" cy=\"140.00\" r=\"3.00\"/><circle cx=\"90.00\" cy=\"140.00\" r=\"3.00\"/><circle cx=\"80.00\" cy=\"140.00\" r=\"3.00\"/><circle cx=\"70.00\" cy=\"140.00\" r=\"3.00\"/><circle cx=\"60.00\" cy=\"140.00\" r=\"3.00\"/><circle cx=\"50.00\" cy=\"140.00\" r=\"3.00\"/><circle cx=\"40.00\" cy=\"140.00\" r=\"3.00\"/><circle cx=\"30.00\" cy=\"140.00\" r=\"3.00\"/><circle cx=\"20.00\" cy=\"140.00\" r=\"3.00\"/><circle cx=\"10.00\" cy=\"140.00\" r=\"3.00\"/><circle cx=\"0.00\" cy=\"140.00\" r=\"3.00\"/><circle cx=\"130.00\" cy=\"130.00\" r=\"3.00\"/><circle cx=\"120.00\" cy=\"130.00\" r=\"3.00\"/><circle cx=\"110.00\" cy=\"130.00\" r=\"3.00\"/><circle cx=\"100.00\" cy=\"130.00\" r=\"3.00\"/><circle cx=\"90.00\" cy=\"130.00\" r=\"3.00\"/><circle cx=\"80.00\" cy=\"130.00\" r=\"3.00\"/><circle cx=\"70.00\" cy=\"130.00\" r=\"3.00\"/><circle cx=\"60.00\" cy=\"130.00\" r=\"3.00\"/><circle cx=\"50.00\" cy=\"130.00\" r=\"3.00\"/><circle cx=\"40.00\" cy=\"130.00\" r=\"3.00\"/><circle cx=\"30.00\" cy=\"130.00\" r=\"3.00\"/><circle cx=\"20.00\" cy=\"130.00\" r=\"3.00\"/><circle cx=\"10.00\" cy=\"130.00\" r=\"3.00\"/><circle cx=\"0.00\" cy=\"130.00\" r=\"3.00\"/><circle cx=\"120.00\" cy=\"120.00\" r=\"3.00\"/><circle cx=\"110.00\" cy=\"120.00\" r=\"3.00\"/><circle cx=\"100.00\" cy=\"120.00\" r=\"3.00\"/><circle cx=\"90.00\" cy=\"120.00\" r=\"3.00\"/><circle cx=\"80.00\" cy=\"120.00\" r=\"3.00\"/><circle cx=\"70.00\" cy=\"120.00\" r=\"3.00\"/><circle cx=\"60.00\" cy=\"120.00\" r=\"3.00\"/><circle cx=\"50.00\" cy=\"120.00\" r=\"3.00\"/><circle cx=\"40.00\" cy=\"120.00\" r=\"3.00\"/><circle cx=\"30.00\" cy=\"120.00\" r=\"3.00\"/><circle cx=\"20.00\" cy=\"120.00\" r=\"3.00\"/><circle cx=\"10.00\" cy=\"120.00\" r=\"3.00\"/><circle cx=\"0.00\" cy=\"120.00\" r=\"3.00\"/><circle cx=\"110.00\" cy=\"110.00\" r=\"3.00\"/><circle cx=\"100.00\" cy=\"110.00\" r=\"3.00\"/><circle cx=\"90.00\" cy=\"110.00\" r=\"3.00\"/><circle cx=\"80.00\" cy=\"110.00\" r=\"3.00\"/><circle cx=\"70.00\" cy=\"110.00\" r=\"3.00\"/><circle cx=\"60.00\" cy=\"110.00\" r=\"3.00\"/><circle cx=\"50.00\" cy=\"110.00\" r=\"3.00\"/><circle cx=\"40.00\" cy=\"110.00\" r=\"3.00\"/><circle cx=\"30.00\" cy=\"110.00\" r=\"3.00\"/><circle cx=\"20.00\" cy=\"110.00\" r=\"3.00\"/><circle cx=\"10.00\" cy=\"110.00\" r=\"3.00\"/><circle cx=\"0.00\" cy=\"110.00\" r=\"3.00\"/><circle cx=\"100.00\" cy=\"100.00\" r=\"3.00\"/><circle cx=\"90.00\" cy=\"100.00\" r=\"3.00\"/><circle cx=\"80.00\" cy=\"100.00\" r=\"3.00\"/><circle cx=\"70.00\" cy=\"100.00\" r=\"3.00\"/><circle cx=\"60.00\" cy=\"100.00\" r=\"3.00\"/><circle cx=\"50.00\" cy=\"100.00\" r=\"3.00\"/><circle cx=\"40.00\" cy=\"100.00\" r=\"3.00\"/><circle cx=\"30.00\" cy=\"100.00\" r=\"3.00\"/><circle cx=\"20.00\" cy=\"100.00\" r=\"3.00\"/><circle cx=\"10.00\" cy=\"100.00\" r=\"3.00\"/><circle cx=\"0.00\" cy=\"100.00\" r=\"3.00\"/><circle cx=\"90.00\" cy=\"90.00\" r=\"3.00\"/><circle cx=\"80.00\" cy=\"90.00\" r=\"3.00\"/><circle cx=\"70.00\" cy=\"90.00\" r=\"3.00\"/><circle cx=\"60.00\" cy=\"90.00\" r=\"3.00\"/><circle cx=\"50.00\" cy=\"90.00\" r=\"3.00\"/><circle cx=\"40.00\" cy=\"90.00\" r=\"3.00\"/><circle cx=\"30.00\" cy=\"90.00\" r=\"3.00\"/><circle cx=\"20.00\" cy=\"90.00\" r=\"3.00\"/><circle cx=\"10.00\" cy=\"90.00\" r=\"3.00\"/><circle cx=\"0.00\" cy=\"90.00\" r=\"3.00\"/><circle cx=\"80.00\" cy=\"80.00\" r=\"3.00\"/><circle cx=\"70.00\" cy=\"80.00\" r=\"3.00\"/><circle cx=\"60.00\" cy=\"80.00\" r=\"3.00\"/><circle cx=\"50.00\" cy=\"80.00\" r=\"3.00\"/><circle cx=\"40.00\" cy=\"80.00\" r=\"3.00\"/><circle cx=\"30.00\" cy=\"80.00\" r=\"3.00\"/><circle cx=\"20.00\" cy=\"80.00\" r=\"3.00\"/><circle cx=\"10.00\" cy=\"80.00\" r=\"3.00\"/><circle cx=\"0.00\" cy=\"80.00\" r=\"3.00\"/><circle cx=\"70.00\" cy=\"70.00\" r=\"3.00\"/><circle cx=\"60.00\" cy=\"70.00\" r=\"3.00\"/><circle cx=\"50.00\" cy=\"70.00\" r=\"3.00\"/><circle cx=\"40.00\" cy=\"70.00\" r=\"3.00\"/><circle cx=\"30.00\" cy=\"70.00\" r=\"3.00\"/><circle cx=\"20.00\" cy=\"70.00\" r=\"3.00\"/><circle cx=\"10.00\" cy=\"70.00\" r=\"3.00\"/><circle cx=\"0.00\" cy=\"70.00\" r=\"3.00\"/><circle cx=\"60.00\" cy=\"60.00\" r=\"3.00\"/><circle cx=\"50.00\" cy=\"60.00\" r=\"3.00\"/><circle cx=\"40.00\" cy=\"60.00\" r=\"3.00\"/><circle cx=\"30.00\" cy=\"60.00\" r=\"3.00\"/><circle cx=\"20.00\" cy=\"60.00\" r=\"3.00\"/><circle cx=\"10.00\" cy=\"60.00\" r=\"3.00\"/><circle cx=\"0.00\" cy=\"60.00\" r=\"3.00\"/><circle cx=\"50.00\" cy=\"50.00\" r=\"3.00\"/><circle cx=\"40.00\" cy=\"50.00\" r=\"3.00\"/><circle cx=\"30.00\" cy=\"50.00\" r=\"3.00\"/><circle cx=\"20.00\" cy=\"50.00\" r=\"3.00\"/><circle cx=\"10.00\" cy=\"50.00\" r=\"3.00\"/><circle cx=\"0.00\" cy=\"50.00\" r=\"3.00\"/><circle cx=\"40.00\" cy=\"40.00\" r=\"3.00\"/><circle cx=\"30.00\" cy=\"40.00\" r=\"3.00\"/><circle cx=\"20.00\" cy=\"40.00\" r=\"3.00\"/><circle cx=\"10.00\" cy=\"40.00\" r=\"3.00\"/><circle cx=\"0.00\" cy=\"40.00\" r=\"3.00\"/><circle cx=\"30.00\" cy=\"30.00\" r=\"3.00\"/><circle cx=\"20.00\" cy=\"30.00\" r=\"3.00\"/><circle cx=\"10.00\" cy=\"30.00\" r=\"3.00\"/><circle cx=\"0.00\" cy=\"30.00\" r=\"3.00\"/><circle cx=\"20.00\" cy=\"20.00\" r=\"3.00\"/><circle cx=\"10.00\" cy=\"20.00\" r=\"3.00\"/><circle cx=\"0.00\" cy=\"20.00\" r=\"3.00\"/><circle cx=\"10.00\" cy=\"10.00\" r=\"3.00\"/><circle cx=\"0.00\" cy=\"10.00\" r=\"3.00\"/><circle cx=\"0.00\" cy=\"0.00\" r=\"3.00\"/><line x1=\"200.00\" y1=\"0.00\" x2=\"200.00\" y2=\"100.00\"/><line x1=\"0.00\" y1=\"200.00\" x2=\"100.00\" y2=\"200.00\"/><line x1=\"190.00\" y1=\"0.00\" x2=\"190.00\" y2=\"100.00\"/><line x1=\"0.00\" y1=\"190.00\" x2=\"100.00\" y2=\"190.00\"/><line x1=\"180.00\" y1=\"0.00\" x2=\"180.00\" y2=\"100.00\"/><line x1=\"0.00\" y1=\"180.00\" x2=\"100.00\" y2=\"180.00\"/><line x1=\"170.00\" y1=\"0.00\" x2=\"170.00\" y2=\"100.00\"/><line x1=\"0.00\" y1=\"170.00\" x2=\"100.00\" y2=\"170.00\"/><line x1=\"160.00\" y1=\"0.00\" x2=\"160.00\" y2=\"100.00\"/><line x1=\"0.00\" y1=\"160.00\" x2=\"100.00\" y2=\"160.00\"/><line x1=\"150.00\" y1=\"0.00\" x2=\"150.00\" y2=\"100.00\"/><line x1=\"0.00\" y1=\"150.00\" x2=\"100.00\" y2=\"150.00\"/><line x1=\"140.00\" y1=\"0.00\" x2=\"140.00\" y2=\"100.00\"/><line x1=\"0.00\" y1=\"140.00\" x2=\"100.00\" y2=\"140.00\"/><line x1=\"130.00\" y1=\"0.00\" x2=\"130.00\" y2=\"100.00\"/><line x1=\"0.00\" y1=\"130.00\" x2=\"100.00\" y2=\"130.00\"/><line x1=\"120.00\" y1=\"0.00\" x2=\"120.00\" y2=\"100.00\"/><line x1=\"0.00\" y1=\"120.00\" x2=\"100.00\" y2=\"120.00\"/><line x1=\"110.00\" y1=\"0.00\" x2=\"110.00\" y2=\"100.00\"/><line x1=\"0.00\" y1=\"110.00\" x2=\"100.00\" y2=\"110.00\"/><line x1=\"100.00\" y1=\"0.00\" x2=\"100.00\" y2=\"100.00\"/><line x1=\"0.00\" y1=\"100.00\" x2=\"100.00\" y2=\"100.00\"/><line x1=\"90.00\" y1=\"0.00\" x2=\"90.00\" y2=\"100.00\"/><line x1=\"0.00\" y1=\"90.00\" x2=\"100.00\" y2=\"90.00\"/><line x1=\"80.00\" y1=\"0.00\" x2=\"80.00\" y2=\"100.00\"/><line x1=\"0.00\" y1=\"80.00\" x2=\"100.00\" y2=\"80.00\"/><line x1=\"70.00\" y1=\"0.00\" x2=\"70.00\" y2=\"100.00\"/><line x1=\"0.00\" y1=\"70.00\" x2=\"100.00\" y2=\"70.00\"/><line x1=\"60.00\" y1=\"0.00\" x2=\"60.00\" y2=\"100.00\"/><line x1=\"0.00\" y1=\"60.00\" x2=\"100.00\" y2=\"60.00\"/><line x1=\"50.00\" y1=\"0.00\" x2=\"50.00\" y2=\"100.00\"/><line x1=\"0.00\" y1=\"50.00\" x2=\"100.00\" y2=\"50.00\"/><line x1=\"40.00\" y1=\"0.00\" x2=\"40.00\" y2=\"100.00\"/><line x1=\"0.00\" y1=\"40.00\" x2=\"100.00\" y2=\"40.00\"/><line x1=\"30.00\" y1=\"0.00\" x2=\"30.00\" y2=\"100.00\"/><line x1=\"0.00\" y1=\"30.00\" x2=\"100.00\" y2=\"30.00\"/><line x1=\"20.00\" y1=\"0.00\" x2=\"20.00\" y2=\"100.00\"/><line x1=\"0.00\" y1=\"20.00\" x2=\"100.00\" y2=\"20.00\"/><line x1=\"10.00\" y1=\"0.00\" x2=\"10.00\" y2=\"100.00\"/><line x1=\"0.00\" y1=\"10.00\" x2=\"100.00\" y2=\"10.00\"/><line x1=\"0.00\" y1=\"0.00\" x2=\"0.00\" y2=\"100.00\"/><line x1=\"0.00\" y1=\"0.00\" x2=\"100.00\" y2=\"0.00\"/></svg>\n\\ No newline at end of file\n", "new_path": "examples/pointfree-svg/output.svg", "old_path": null }, { "change_type": "ADD", "diff": "+{\n+ \"name\": \"pointfree-svg\",\n+ \"version\": \"0.0.1\",\n+ \"repository\": \"https://github.com/thi-ng/umbrella\",\n+ \"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n+ \"license\": \"Apache-2.0\",\n+ \"scripts\": {\n+ \"build\": \"yarn clean && tsc && node index.js\",\n+ \"clean\": \"rm -rf *.js\"\n+ },\n+ \"dependencies\": {\n+ \"@thi.ng/hiccup\": \"latest\",\n+ \"@thi.ng/hdom-components\": \"latest\",\n+ \"@thi.ng/pointfree\": \"latest\",\n+ \"@thi.ng/pointfree-lang\": \"latest\"\n+ }\n+}\n\\ No newline at end of file\n", "new_path": "examples/pointfree-svg/package.json", "old_path": null }, { "change_type": "ADD", "diff": "+import * as fs from \"fs\";\n+\n+import * as svg from \"@thi.ng/hdom-components/svg\";\n+import { serialize } from \"@thi.ng/hiccup\";\n+import { ensureStack, maptos } from \"@thi.ng/pointfree\";\n+import { ffi, run } from \"@thi.ng/pointfree-lang\";\n+\n+/**\n+ * Graphics library / helper words\n+ */\n+const libsrc = `\n+( helper words for forming 2D vectors )\n+: xy ( x y -- [x y] ) vec2 ;\n+: yx ( x y -- [y x] ) swap vec2 ;\n+\n+( appends a hiccup shape element to @shapes array )\n+: addshape ( s -- )\n+ @shapes pushl drop ;\n+\n+( creates hiccup element with 2 args & shape type )\n+: shape2 ( a b type -- )\n+ -rot vec3 addshape;\n+\n+( transforms 2 points into a svg line )\n+: line ( a b -- )\n+@svg.line shape2 ;\n+\n+( transforms point and radius into a svg circle )\n+: circle ( p r -- )\n+ @svg.circle shape2 ;\n+\n+( creates a horizontal line )\n+: hline ( y width -- )\n+over 0 yx -rot yx line ;\n+\n+( creates a vertical line )\n+: vline ( x height -- )\n+ over 0 xy -rot xy line ;\n+\n+(\n+ 2D grid loop construct\n+ executes body quot for each iteration\n+)\n+: loop2 ( cols rows body -- )\n+ >r [ over [ over cprd exec ] dotimes drop ] dotimes\n+ drop rdrop ;\n+`;\n+\n+/**\n+ * User code to generate SVG graphic and write as file\n+ * The whole block has this stack effect:\n+ *\n+ * ( filename res -- )\n+ */\n+const usersrc = `\n+( creates grid of lines with given grid res )\n+: grid ( res -- )\n+ dup [10 * 100 dup2 hline vline] dotimes ;\n+\n+(\n+ creates triangular grid of circles with given grid res\n+ only creates circles for grid cells where x <= y\n+)\n+: circlegrid ( res -- )\n+ dup [dup2 lteq [xy 10 v* 3 circle] [drop2] if] loop2 ;\n+\n+grid circlegrid\n+\n+( create SVG root element in hiccup format )\n+@svg.svgdoc [{width: 200, height: 200, stroke: \"#f04\", fill: \"none\"}] pushl\n+( concat with generated shapes )\n+@shapes cat\n+( serialize hiccup format to SVG and write to disk )\n+serialize swap write-file\n+`;\n+\n+// initialize environment and pre-compile library source\n+const env = ffi(\n+ {\n+ \"svg.line\": svg.line,\n+ \"svg.circle\": svg.circle,\n+ \"svg.svgdoc\": svg.svgdoc,\n+ shapes: [],\n+ },\n+ {\n+ \"serialize\": maptos(serialize),\n+ \"write-file\": (ctx) => {\n+ const stack = ctx[0];\n+ ensureStack(stack, 2);\n+ fs.writeFileSync(stack.pop(), stack.pop());\n+ return ctx;\n+ }\n+ });\n+run(libsrc, env);\n+\n+// compile & execute user code with given stack params\n+run(usersrc, env, [\"output.svg\", 21]);\n", "new_path": "examples/pointfree-svg/src/index.ts", "old_path": null }, { "change_type": "ADD", "diff": "+{\n+ \"extends\": \"../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \".\",\n+ \"noUnusedLocals\": false,\n+ },\n+ \"include\": [\n+ \"./src/**/*.ts\"\n+ ]\n+}\n\\ No newline at end of file\n", "new_path": "examples/pointfree-svg/tsconfig.json", "old_path": null } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(examples): add pointfree-svg demo
1
feat
examples
679,913
31.03.2018 18:16:09
-3,600
3f33b651721f864b65eebe994fd66e38bdbfb418
refactor(examples): update pointfree-svg demo/readme
[ { "change_type": "MODIFY", "diff": "@@ -9,6 +9,12 @@ This is a non-interactive demo combining the following packages to generate the\n![generated result](./output.svg)\n+Most of the [source code](./src/index.ts) is written in the pointfree\n+DSL syntax and includes a rudimentary graphics lib to generate SVG\n+shapes in hiccup format (basically a DOM defined by nested arrays). The\n+example also demonstrates how to define custom words defined in JS to\n+easily extend the language.\n+\nThe generated SVG file will be written in this example's directory...\n```\n", "new_path": "examples/pointfree-svg/README.md", "old_path": "examples/pointfree-svg/README.md" }, { "change_type": "MODIFY", "diff": "@@ -5,37 +5,29 @@ import { serialize } from \"@thi.ng/hiccup\";\nimport { ensureStack, maptos } from \"@thi.ng/pointfree\";\nimport { ffi, run } from \"@thi.ng/pointfree-lang\";\n-/**\n- * Graphics library / helper words\n- */\n+// rudimentary generic graphics lib & helper words\nconst libsrc = `\n( helper words for forming 2D vectors )\n: xy ( x y -- [x y] ) vec2 ;\n: yx ( x y -- [y x] ) swap vec2 ;\n( appends a hiccup shape element to @shapes array )\n-: addshape ( s -- )\n- @shapes pushl drop ;\n+: addshape ( s -- ) @shapes pushl drop ;\n( creates hiccup element with 2 args & shape type )\n-: shape2 ( a b type -- )\n- -rot vec3 addshape;\n+: shape2 ( a b type -- ) -rot vec3 addshape;\n( transforms 2 points into a svg line )\n-: line ( a b -- )\n-@svg.line shape2 ;\n+: line ( a b -- ) @svg.line shape2 ;\n( transforms point and radius into a svg circle )\n-: circle ( p r -- )\n- @svg.circle shape2 ;\n+: circle ( p r -- ) @svg.circle shape2 ;\n( creates a horizontal line )\n-: hline ( y width -- )\n-over 0 yx -rot yx line ;\n+: hline ( y width -- ) over 0 yx -rot yx line ;\n( creates a vertical line )\n-: vline ( x height -- )\n- over 0 xy -rot xy line ;\n+: vline ( x height -- ) over 0 xy -rot xy line ;\n(\n2D grid loop construct\n@@ -46,12 +38,10 @@ over 0 yx -rot yx line ;\ndrop rdrop ;\n`;\n-/**\n- * User code to generate SVG graphic and write as file\n- * The whole block has this stack effect:\n- *\n- * ( filename res -- )\n- */\n+// user code to generate SVG graphic and write out as file\n+// the whole block has this stack effect:\n+//\n+// ( filename res -- )\nconst usersrc = `\n( creates grid of lines with given grid res )\n: grid ( res -- )\n@@ -76,14 +66,19 @@ serialize swap write-file\n// initialize environment and pre-compile library source\nconst env = ffi(\n+ // predefined variables\n{\n\"svg.line\": svg.line,\n\"svg.circle\": svg.circle,\n\"svg.svgdoc\": svg.svgdoc,\nshapes: [],\n},\n+ // foreign function interface (FFI)\n+ // custom words usable by the DSL\n{\n+ // ( svgdom -- svgstring )\n\"serialize\": maptos(serialize),\n+ // ( filename body -- )\n\"write-file\": (ctx) => {\nconst stack = ctx[0];\nensureStack(stack, 2);\n@@ -91,6 +86,7 @@ const env = ffi(\nreturn ctx;\n}\n});\n+// compile lib (resulting words are stored in env)\nrun(libsrc, env);\n// compile & execute user code with given stack params\n", "new_path": "examples/pointfree-svg/src/index.ts", "old_path": "examples/pointfree-svg/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(examples): update pointfree-svg demo/readme
1
refactor
examples
679,913
31.03.2018 18:18:08
-3,600
7b5a36fd3d697f65717776a2445e8fb665e65062
docs(examples): update example list
[ { "change_type": "MODIFY", "diff": "@@ -15,7 +15,8 @@ If you want to [contribute](../CONTRIBUTING.md) an example, please get in touch\n| 7 | [interceptor-basics](./hdom-benchmark) | event handling w/ interceptors and side effects | atom, hdom | intermediate |\n| 8 | [json-components](./json-components) | JSON->component transformation, live editor | hdom, transducers | intermediate |\n| 9 | [login-form](./login-form) | basic SPA without router | atom, hdom | intermediate |\n-| 10 | [router-basics](./router-basics) | complete mini SPA | atom, hdom, router | advanced |\n-| 11 | [svg-particles](./svg-particles) | hdom SVG generation / animation | hdom, transducers | basic |\n-| 12 | [todo-list](./todo-list) | Canonical Todo list with undo/redo | atom, hdom, transducers | intermediate |\n-| 13 | [webgl](./webgl) | Canvas component handling | hdom, hdom-components | basic |\n+| 10 | [pointfree-svg](./pointfree-svg) | generate SVG using pointfree DSL | hiccup, hdom-components, pointfree-lang | intermediate |\n+| 11 | [router-basics](./router-basics) | complete mini SPA | atom, hdom, router | advanced |\n+| 12 | [svg-particles](./svg-particles) | hdom SVG generation / animation | hdom, transducers | basic |\n+| 13 | [todo-list](./todo-list) | Canonical Todo list with undo/redo | atom, hdom, transducers | intermediate |\n+| 14 | [webgl](./webgl) | Canvas component handling | hdom, hdom-components | basic |\n", "new_path": "examples/README.md", "old_path": "examples/README.md" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
docs(examples): update example list
1
docs
examples
679,913
31.03.2018 18:23:09
-3,600
89ea63313a2002747b16a75a490c3c177f69b8ce
fix(examples): update readme (pf-svg)
[ { "change_type": "MODIFY", "diff": "@@ -20,5 +20,5 @@ The generated SVG file will be written in this example's directory...\n```\ngit clone https://github.com/thi-ng/umbrella.git\ncd umbrella/examples/pointfree-svg\n-yarn start\n+yarn build\n```\n", "new_path": "examples/pointfree-svg/README.md", "old_path": "examples/pointfree-svg/README.md" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
fix(examples): update readme (pf-svg)
1
fix
examples
679,913
31.03.2018 18:42:16
-3,600
1022ab67a20aa89ba5e4e6170f524d9cff2dcc58
fix(examples): update stack comment for write-file
[ { "change_type": "MODIFY", "diff": "@@ -78,7 +78,7 @@ const env = ffi(\n{\n// ( svgdom -- svgstring )\n\"serialize\": maptos(serialize),\n- // ( filename body -- )\n+ // ( body filename -- )\n\"write-file\": (ctx) => {\nconst stack = ctx[0];\nensureStack(stack, 2);\n", "new_path": "examples/pointfree-svg/src/index.ts", "old_path": "examples/pointfree-svg/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
fix(examples): update stack comment for write-file
1
fix
examples
679,913
31.03.2018 23:47:54
-3,600
bc264d39a988b9952ac72036dbc8c0deb9f6cbad
build(examples): update tsconfig for all examples
[ { "change_type": "MODIFY", "diff": "{\n\"extends\": \"../../tsconfig.json\",\n\"compilerOptions\": {\n- \"outDir\": \".\"\n+ \"outDir\": \"build\",\n+ \"sourceMap\": true\n},\n\"include\": [\n\"./src/**/*.ts\"\n", "new_path": "examples/async-effect/tsconfig.json", "old_path": "examples/async-effect/tsconfig.json" }, { "change_type": "MODIFY", "diff": "{\n\"extends\": \"../../tsconfig.json\",\n\"compilerOptions\": {\n- \"outDir\": \".\"\n+ \"outDir\": \"build\",\n+ \"sourceMap\": true\n},\n\"include\": [\n\"./src/**/*.ts\"\n", "new_path": "examples/cellular-automata/tsconfig.json", "old_path": "examples/cellular-automata/tsconfig.json" }, { "change_type": "MODIFY", "diff": "{\n\"extends\": \"../../tsconfig.json\",\n\"compilerOptions\": {\n- \"outDir\": \".\"\n+ \"outDir\": \"build\",\n+ \"sourceMap\": true\n},\n\"include\": [\n\"./src/**/*.ts\"\n", "new_path": "examples/dashboard/tsconfig.json", "old_path": "examples/dashboard/tsconfig.json" }, { "change_type": "MODIFY", "diff": "{\n\"extends\": \"../../tsconfig.json\",\n\"compilerOptions\": {\n- \"outDir\": \".\"\n+ \"outDir\": \"build\",\n+ \"sourceMap\": true\n},\n\"include\": [\n\"./src/**/*.ts\"\n", "new_path": "examples/devcards/tsconfig.json", "old_path": "examples/devcards/tsconfig.json" }, { "change_type": "MODIFY", "diff": "{\n\"extends\": \"../../tsconfig.json\",\n\"compilerOptions\": {\n- \"outDir\": \".\"\n+ \"outDir\": \"build\",\n+ \"sourceMap\": true\n},\n\"include\": [\n\"./src/**/*.ts\"\n", "new_path": "examples/hdom-basics/tsconfig.json", "old_path": "examples/hdom-basics/tsconfig.json" }, { "change_type": "MODIFY", "diff": "{\n\"extends\": \"../../tsconfig.json\",\n\"compilerOptions\": {\n- \"outDir\": \".\"\n+ \"outDir\": \"build\",\n+ \"sourceMap\": true\n},\n\"include\": [\n\"./src/**/*.ts\"\n", "new_path": "examples/hdom-benchmark/tsconfig.json", "old_path": "examples/hdom-benchmark/tsconfig.json" }, { "change_type": "MODIFY", "diff": "{\n\"extends\": \"../../tsconfig.json\",\n\"compilerOptions\": {\n- \"outDir\": \".\"\n+ \"outDir\": \"build\",\n+ \"sourceMap\": true\n},\n\"include\": [\n\"./src/**/*.ts\"\n", "new_path": "examples/interceptor-basics/tsconfig.json", "old_path": "examples/interceptor-basics/tsconfig.json" }, { "change_type": "MODIFY", "diff": "{\n\"extends\": \"../../tsconfig.json\",\n\"compilerOptions\": {\n- \"outDir\": \".\"\n+ \"outDir\": \"build\",\n+ \"sourceMap\": true\n},\n\"include\": [\n\"./src/**/*.ts\"\n", "new_path": "examples/json-components/tsconfig.json", "old_path": "examples/json-components/tsconfig.json" }, { "change_type": "MODIFY", "diff": "{\n\"extends\": \"../../tsconfig.json\",\n\"compilerOptions\": {\n- \"outDir\": \".\"\n+ \"outDir\": \"build\",\n+ \"sourceMap\": true\n},\n\"include\": [\n\"./src/**/*.ts\"\n", "new_path": "examples/login-form/tsconfig.json", "old_path": "examples/login-form/tsconfig.json" }, { "change_type": "MODIFY", "diff": "{\n+ \"extends\": \"../../tsconfig.json\",\n\"compilerOptions\": {\n- \"module\": \"commonjs\",\n- \"target\": \"ES6\",\n\"outDir\": \"build\",\n- \"experimentalDecorators\": true,\n- \"noUnusedParameters\": true,\n- \"noUnusedLocals\": true,\n- \"sourceMap\": true,\n+ \"sourceMap\": true\n},\n\"include\": [\n\"./src/**/*.ts\"\n- ],\n- \"exclude\": [\n- \"./**/node_modules\"\n]\n}\n\\ No newline at end of file\n", "new_path": "examples/router-basics/tsconfig.json", "old_path": "examples/router-basics/tsconfig.json" }, { "change_type": "MODIFY", "diff": "{\n\"extends\": \"../../tsconfig.json\",\n\"compilerOptions\": {\n- \"outDir\": \".\"\n+ \"outDir\": \"build\",\n+ \"sourceMap\": true\n},\n\"include\": [\n\"./src/**/*.ts\"\n", "new_path": "examples/svg-particles/tsconfig.json", "old_path": "examples/svg-particles/tsconfig.json" }, { "change_type": "MODIFY", "diff": "{\n\"extends\": \"../../tsconfig.json\",\n\"compilerOptions\": {\n- \"outDir\": \".\"\n+ \"outDir\": \"build\",\n+ \"sourceMap\": true\n},\n\"include\": [\n\"./src/**/*.ts\"\n", "new_path": "examples/todo-list/tsconfig.json", "old_path": "examples/todo-list/tsconfig.json" }, { "change_type": "MODIFY", "diff": "{\n\"extends\": \"../../tsconfig.json\",\n\"compilerOptions\": {\n- \"outDir\": \".\"\n+ \"outDir\": \"build\",\n+ \"sourceMap\": true\n},\n\"include\": [\n\"./src/**/*.ts\"\n", "new_path": "examples/webgl/tsconfig.json", "old_path": "examples/webgl/tsconfig.json" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
build(examples): update tsconfig for all examples
1
build
examples
679,913
01.04.2018 00:24:57
-3,600
c75219805e203014ade9131980d40a78945c1327
build: add missing package descriptions, update yarn.lock
[ { "change_type": "MODIFY", "diff": "{\n\"name\": \"@thi.ng/diff\",\n\"version\": \"1.0.3\",\n- \"description\": \"TODO\",\n+ \"description\": \"Array & object Diff\",\n\"main\": \"./index.js\",\n\"typings\": \"./index.d.ts\",\n\"repository\": \"https://github.com/thi-ng/umbrella\",\n", "new_path": "packages/diff/package.json", "old_path": "packages/diff/package.json" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"@thi.ng/hdom-components\",\n\"version\": \"1.1.0\",\n- \"description\": \"TODO\",\n+ \"description\": \"Raw, skinnable UI & SVG components for @thi.ng/hdom\",\n\"main\": \"./index.js\",\n\"typings\": \"./index.d.ts\",\n\"repository\": \"https://github.com/thi-ng/umbrella\",\n", "new_path": "packages/hdom-components/package.json", "old_path": "packages/hdom-components/package.json" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"@thi.ng/pointfree-lang\",\n\"version\": \"0.1.2\",\n- \"description\": \"TODO\",\n+ \"description\": \"Forth style syntax layer/compiler for the @thi.ng/pointfree DSL\",\n\"main\": \"./index.js\",\n\"typings\": \"./index.d.ts\",\n\"repository\": \"https://github.com/thi-ng/umbrella\",\n\"grammar\",\n\"PEG\",\n\"pointfree\",\n+ \"syntax\",\n\"typescript\"\n],\n\"publishConfig\": {\n", "new_path": "packages/pointfree-lang/package.json", "old_path": "packages/pointfree-lang/package.json" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"@thi.ng/rstream-csp\",\n\"version\": \"0.1.41\",\n- \"description\": \"TODO\",\n+ \"description\": \"@thi.ng/csp bridge module for @thi.ng/rstream\",\n\"main\": \"./index.js\",\n\"typings\": \"./index.d.ts\",\n\"repository\": \"https://github.com/thi-ng/umbrella\",\n", "new_path": "packages/rstream-csp/package.json", "old_path": "packages/rstream-csp/package.json" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"@thi.ng/rstream-log\",\n\"version\": \"0.6.1\",\n- \"description\": \"TODO\",\n+ \"description\": \"Structured, multilevel & hierarchical loggers based on @thi.ng/rstream\",\n\"main\": \"./index.js\",\n\"typings\": \"./index.d.ts\",\n\"repository\": \"https://github.com/thi-ng/umbrella\",\n", "new_path": "packages/rstream-log/package.json", "old_path": "packages/rstream-log/package.json" }, { "change_type": "MODIFY", "diff": "Binary files a/yarn.lock and b/yarn.lock differ\n", "new_path": "yarn.lock", "old_path": "yarn.lock" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
build: add missing package descriptions, update yarn.lock
1
build
null
679,913
01.04.2018 00:37:33
-3,600
d4951f5efd8bcb0a57784894a036d7b0f13a9c26
docs(examples): update all example readme's
[ { "change_type": "MODIFY", "diff": "git clone https://github.com/thi-ng/umbrella.git\ncd umbrella/examples/async-effect\nyarn install\n-yarn build\n+yarn start\n```\n-\n-Unlike other examples, this one requires a local webserver to function, for example:\n-\n-```\n-python -m SimpleHTTPServer\n-```\n-\n-Ps. You can also run the demo without server, but this only good for testing\n-the error event handling :)\n\\ No newline at end of file\n", "new_path": "examples/async-effect/README.md", "old_path": "examples/async-effect/README.md" }, { "change_type": "MODIFY", "diff": "git clone https://github.com/thi-ng/umbrella.git\ncd umbrella/examples/cellular-automata\nyarn install\n+yarn start\n```\n-Then...\n-\n-```\n-# For Mac\n-yarn dev\n-\n-# For Debian, Ubuntu, Etc.\n-yarn debdev\n-```\n-\n-Once webpack has completed building, refresh your browser...\n-\n## Example configurations\n- [Conway (default)](http://demo.thi.ng/umbrella/cellular-automata/#000100000-001100000)\n", "new_path": "examples/cellular-automata/README.md", "old_path": "examples/cellular-automata/README.md" }, { "change_type": "MODIFY", "diff": "git clone https://github.com/thi-ng/umbrella.git\ncd umbrella/examples/dashboard\nyarn install\n+yarn start\n```\n-\n-Then...\n-\n-```\n-# For Mac\n-yarn dev\n-\n-# For Debian, Ubuntu, Etc.\n-yarn debdev\n-```\n-\n-Once webpack has completed building, refresh your browser...\n", "new_path": "examples/dashboard/README.md", "old_path": "examples/dashboard/README.md" }, { "change_type": "MODIFY", "diff": "git clone https://github.com/thi-ng/umbrella.git\ncd umbrella/examples/devcards\nyarn install\n+yarn start\n```\n-Then\n-\n-```\n-# For Mac\n-yarn dev\n-\n-# For Debian, Ubuntu, Etc.\n-yarn debdev\n-```\n-\n-Once webpack has completed building, refresh your browser...\n", "new_path": "examples/devcards/README.md", "old_path": "examples/devcards/README.md" }, { "change_type": "MODIFY", "diff": "git clone https://github.com/thi-ng/umbrella.git\ncd umbrella/examples/hdom-basics\nyarn install\n+yarn start\n```\n-\n-Then...\n-\n-```\n-# For Mac\n-yarn dev\n-\n-# For Debian, Ubuntu, Etc.\n-yarn debdev\n-```\n-\n-Once webpack has completed building, refresh your browser...\n\\ No newline at end of file\n", "new_path": "examples/hdom-basics/README.md", "old_path": "examples/hdom-basics/README.md" }, { "change_type": "MODIFY", "diff": "git clone https://github.com/thi-ng/umbrella.git\ncd umbrella/examples/hdom-benchmark\nyarn install\n+yarn start\n```\n\\ No newline at end of file\n-\n-Then...\n-\n-```\n-# For Mac\n-yarn dev\n-\n-# For Debian, Ubuntu, Etc.\n-yarn debdev\n-```\n-\n-Once webpack has completed building, refresh your browser...\n", "new_path": "examples/hdom-benchmark/README.md", "old_path": "examples/hdom-benchmark/README.md" }, { "change_type": "MODIFY", "diff": "git clone https://github.com/thi-ng/umbrella.git\ncd umbrella/examples/interceptor-basics\nyarn install\n+yarn start\n```\n-Then\n-\n-```\n-# For Mac\n-yarn dev\n-```\n-\n-```\n-# For Debian, Ubuntu, Etc.\n-yarn debdev\n-```\n-\n-Once webpack has completed building, refresh your browser...\n", "new_path": "examples/interceptor-basics/README.md", "old_path": "examples/interceptor-basics/README.md" }, { "change_type": "MODIFY", "diff": "git clone https://github.com/thi-ng/umbrella.git\ncd umbrella/examples/json-components\nyarn install\n+yarn start\n```\n-\n-Then...\n-\n-```\n-# For Mac\n-yarn dev\n-\n-# For Debian, Ubuntu, Etc.\n-yarn debdev\n-```\n-\n-Once webpack has completed building, refresh your browser...\n", "new_path": "examples/json-components/README.md", "old_path": "examples/json-components/README.md" }, { "change_type": "MODIFY", "diff": "git clone https://github.com/thi-ng/umbrella.git\ncd umbrella/examples/login-form\nyarn install\n+yarn start\n```\n-\n-Then\n-\n-```\n-\\# For Mac\n-yarn dev\n-```\n-\n-```\n-\\# For Debian, Ubuntu, Etc.\n-yarn debdev\n-```\n-\n-Once webpack has completed building, refresh your browser...\n", "new_path": "examples/login-form/README.md", "old_path": "examples/login-form/README.md" }, { "change_type": "MODIFY", "diff": "@@ -15,7 +15,7 @@ Installs all dependencies, runs `webpack-dev-server` and opens the app in your b\nThis example is based on the\n[create-hdom-app](https://github.com/thi-ng/create-hdom-app) project\n-template and is the most advanced example in this repo thus far.\n+template and is one the most advanced example in this repo thus far.\nFeatures covered:\n- App & component configuration\n", "new_path": "examples/router-basics/README.md", "old_path": "examples/router-basics/README.md" }, { "change_type": "MODIFY", "diff": "git clone https://github.com/thi-ng/umbrella.git\ncd umbrella/examples/svg-particles\nyarn install\n+yarn start\n```\n-\n-Then...\n-\n-```\n-# For Mac\n-yarn dev\n-\n-# For Debian, Ubuntu, Etc.\n-yarn debdev\n-```\n-\n-Once webpack has completed building, refresh your browser...\n", "new_path": "examples/svg-particles/README.md", "old_path": "examples/svg-particles/README.md" }, { "change_type": "MODIFY", "diff": "git clone https://github.com/thi-ng/umbrella.git\ncd umbrella/examples/todo-list\nyarn install\n+yarn start\n```\n-\n-Then...\n-\n-```\n-# For Mac\n-yarn dev\n-\n-# For Debian, Ubuntu, Etc.\n-yarn debdev\n-```\n-\n-Once webpack has completed building, refresh your browser...\n", "new_path": "examples/todo-list/README.md", "old_path": "examples/todo-list/README.md" }, { "change_type": "MODIFY", "diff": "git clone https://github.com/thi-ng/umbrella.git\ncd umbrella/examples/webgl\nyarn install\n+yarn start\n```\n-\n-Then...\n-\n-```\n-# For Mac\n-yarn dev\n-\n-# For Debian, Ubuntu, Etc.\n-yarn debdev\n-```\n-\n-Once webpack has completed building, refresh your browser...\n", "new_path": "examples/webgl/README.md", "old_path": "examples/webgl/README.md" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
docs(examples): update all example readme's
1
docs
examples
679,913
01.04.2018 00:38:32
-3,600
cb7276e64f5db017effb2f68ff99e9fae7835863
chore: update make-module/example scripts
[ { "change_type": "MODIFY", "diff": "@@ -20,15 +20,15 @@ cat << EOF > $MODULE/package.json\n\"author\": \"$AUTHOR <$EMAIL>\",\n\"license\": \"Apache-2.0\",\n\"scripts\": {\n- \"build\": \"yarn clean && webpack\",\n- \"clean\": \"rm -rf bundle.*\",\n- \"dev\": \"open index.html && webpack -w\",\n- \"debdev\": \"see index.html && webpack -w\"\n+ \"build\": \"webpack --mode production\",\n+ \"start\": \"webpack-dev-server --open --mode development --devtool inline-source-map\"\n},\n\"devDependencies\": {\n- \"ts-loader\": \"^3.5.0\",\n- \"typescript\": \"^2.7.2\",\n- \"webpack\": \"^3.11.0\"\n+ \"ts-loader\": \"^4.1.0\",\n+ \"typescript\": \"^2.8.1\",\n+ \"webpack\": \"^4.4.1\",\n+ \"webpack-cli\": \"^2.0.13\",\n+ \"webpack-dev-server\": \"^3.1.1\"\n},\n\"dependencies\": {\n\"@thi.ng/api\": \"latest\",\n@@ -108,16 +108,14 @@ cat << EOF > $MODULE/README.md\ngit clone https://github.com/thi-ng/umbrella.git\ncd umbrella/examples/$1\nyarn install\n+yarn start\n\\`\\`\\`\n-Then\n-\\`\\`\\`\n-# For Mac\n-yarn dev\n+## Authors\n-# For Debian, Ubuntu, Etc.\n-yarn debdev\n-\\`\\`\\`\n+- $AUTHOR\n+\n+## License\n-Once webpack has completed building, refresh your browser...\n+&copy; 2018 $AUTHOR // Apache Software License 2.0\nEOF\n", "new_path": "scripts/make-example", "old_path": "scripts/make-example" }, { "change_type": "MODIFY", "diff": "@@ -43,16 +43,15 @@ cat << EOF > $MODULE/package.json\n\"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n},\n\"devDependencies\": {\n- \"@types/mocha\": \"^2.2.48\",\n- \"@types/node\": \"^9.4.6\",\n- \"mocha\": \"^5.0.0\",\n- \"ts-loader\": \"^3.5.0\",\n- \"typedoc\": \"^0.10.0\",\n- \"typescript\": \"^2.7.2\",\n- \"webpack\": \"^3.11.0\"\n+ \"@types/mocha\": \"^5.0.0\",\n+ \"@types/node\": \"^9.6.1\",\n+ \"mocha\": \"^5.0.5\",\n+ \"nyc\": \"^11.6.0\",\n+ \"typedoc\": \"^0.11.1\",\n+ \"typescript\": \"^2.8.1\"\n},\n\"dependencies\": {\n- \"@thi.ng/api\": \"^2.0.4\"\n+ \"@thi.ng/api\": \"^2.1.0\"\n},\n\"keywords\": [\n\"ES6\",\n@@ -125,7 +124,6 @@ yarn add @thi.ng/$1\n\\`\\`\\`typescript\nimport * as $1 from \"@thi.ng/$1\";\n-\n\\`\\`\\`\n## Authors\n", "new_path": "scripts/make-module", "old_path": "scripts/make-module" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
chore: update make-module/example scripts
1
chore
null
679,913
01.04.2018 13:25:04
-3,600
68a8dba616fa1261522e84a8a346fcaa805c5d32
feat(pointfree): add copy() word
[ { "change_type": "MODIFY", "diff": "@@ -3,6 +3,7 @@ import { illegalState, illegalArgs } from \"@thi.ng/api/error\";\nimport { equiv as _equiv } from \"@thi.ng/api/equiv\";\nimport { isArray } from \"@thi.ng/checks/is-array\";\nimport { isFunction } from \"@thi.ng/checks/is-function\";\n+import { isPlainObject } from \"@thi.ng/checks/is-plain-object\";\nimport { StackContext, StackProc, StackEnv, StackProgram, StackFn, Stack } from \"./api\";\nimport { comp } from \"./comp\";\n@@ -1539,6 +1540,17 @@ export const join = (sep = \"\") => op1((x) => x.join(sep));\n*/\nexport const length = op1((x) => x.length);\n+/**\n+ * Replaces TOS with its shallow copy. MUST be an array or plain object.\n+ *\n+ * ( x -- copy )\n+ */\n+export const copy = op1((x) =>\n+ isArray(x) ?\n+ [...x] :\n+ isPlainObject(x) ? { ...x } :\n+ illegalArgs(`can't copy type ${typeof x}`));\n+\n/**\n* Reads key/index from object/array.\n*\n", "new_path": "packages/pointfree/src/index.ts", "old_path": "packages/pointfree/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(pointfree): add copy() word
1
feat
pointfree
679,913
01.04.2018 13:40:27
-3,600
92d2d68537e55ca5764ec1771a38700acdcbc9b3
refactor(pointfree): update/rename storeat => setat, update tests change behavior to keep obj on stack
[ { "change_type": "MODIFY", "diff": "@@ -890,7 +890,7 @@ at word construction time and return a pre-configured stack function.\n| `pull3` | `( arr -- x y z arr )` | short for: `[pull2, pull]` |\n| `pull4` | `( arr -- a b c d arr )` | short for: `[pull2, pull2]` |\n| `split` | `( arr x -- [...] [...] )` | split array at index `x` |\n-| `storeat` | `( val obj k -- )` | `obj` can be array/obj |\n+| `setat` | `( val obj k -- obj )` | `obj` can be array/obj |\n| `tuple(n)` | `( ... -- [...] )` | HOF, like `collect`, but w/ predefined size |\n| `vec2` | `( x y -- [x, y] )` | same as `tuple(2)` |\n| `vec3` | `( x y z -- [x, y, z] )` | same as `tuple(3)` |\n", "new_path": "packages/pointfree/README.md", "old_path": "packages/pointfree/README.md" }, { "change_type": "MODIFY", "diff": "@@ -1563,16 +1563,17 @@ export const at = op2((b, a) => a[b]);\n/**\n* Writes `val` at key/index in object/array.\n*\n- * ( val obj k -- )\n+ * ( val obj k -- obj )\n*\n* @param ctx\n*/\n-export const storeat = (ctx: StackContext) => {\n+export const setat = (ctx: StackContext) => {\nconst stack = ctx[0];\nconst n = stack.length - 3;\n$n(n, 0);\nstack[n + 1][stack[n + 2]] = stack[n];\n- stack.length = n;\n+ stack[n] = stack[n + 1];\n+ stack.length -= 2;\nreturn ctx;\n};\n", "new_path": "packages/pointfree/src/index.ts", "old_path": "packages/pointfree/src/index.ts" }, { "change_type": "MODIFY", "diff": "@@ -457,16 +457,16 @@ describe(\"pointfree\", () => {\nassert.deepEqual(pf.at($([{ id: 42 }, \"id\"]))[0], [42]);\n});\n- it(\"storeat\", () => {\n- assert.throws(() => pf.storeat($([1, 2])));\n+ it(\"setat\", () => {\n+ assert.throws(() => pf.setat($([1, 2])));\nlet a: any = [10, 20];\n- assert.deepEqual(pf.storeat($([30, a, 0]))[0], []);\n+ assert.deepEqual(pf.setat($([30, a, 0]))[0], [a]);\nassert.deepEqual(a, [30, 20]);\na = [10, 20];\n- assert.deepEqual(pf.storeat($([30, a, 3]))[0], []);\n+ assert.deepEqual(pf.setat($([30, a, 3]))[0], [a]);\nassert.deepEqual(a, [10, 20, , 30]);\na = {};\n- assert.deepEqual(pf.storeat($([30, a, \"a\"]))[0], []);\n+ assert.deepEqual(pf.setat($([30, a, \"a\"]))[0], [a]);\nassert.deepEqual(a, { a: 30 });\n});\n", "new_path": "packages/pointfree/test/index.ts", "old_path": "packages/pointfree/test/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(pointfree): update/rename storeat => setat, update tests - change behavior to keep obj on stack
1
refactor
pointfree
217,922
01.04.2018 13:55:03
-7,200
d288a847fc26ae8677a83db1a87911bb5d5e5af2
feat: better seo configuration TODO: add proper meta settings in each major page
[ { "change_type": "MODIFY", "diff": "\"rewrites\": [\n{\n\"source\": \"**\",\n- \"destination\": \"/index.html\"\n+ \"function\": \"app\"\n}\n],\n\"headers\": [{\n", "new_path": "firebase.json", "old_path": "firebase.json" }, { "change_type": "MODIFY", "diff": "@@ -3,26 +3,100 @@ require('firebase/firestore');\nconst functions = require('firebase-functions');\nconst admin = require('firebase-admin');\nadmin.initializeApp(functions.config().firebase);\n+const express = require('express');\n+const fetch = require('node-fetch');\n+const url = require('url');\n+const app = express();\n-//Firebase counts\n-// exports.countlistsCreate = functions.database.ref('/lists/{uid}').onCreate(() => {\n-// const ref = admin.database().ref('/list_count');\n-// const creationsRef = admin.database().ref('/lists_created');\n-// // Increment the number of lists created using the tool.\n-// creationsRef.transaction(current => {\n-// return current + 1;\n-// }).then(() => null);\n-// return ref.transaction(current => {\n-// return current + 1;\n-// }).then(() => null);\n-// });\n-//\n-// exports.countlistsDelete = functions.database.ref('/lists/{uid}').onDelete(() => {\n-// const ref = admin.database().ref('/list_count');\n-// return ref.transaction(current => {\n-// return current - 1;\n-// }).then(() => null);\n-// });\n+const appUrl = 'beta.ffxivteamcraft.com';\n+const renderUrl = 'https://render-tron.appspot.com/render';\n+\n+function generateUrl(request) {\n+ return url.format({\n+ protocol: request.protocol,\n+ host: appUrl,\n+ pathname: request.originalUrl\n+ });\n+}\n+\n+\n+function isBot(bots, userAgent) {\n+ const agent = userAgent.toLowerCase();\n+ for (const bot of bots) {\n+ if (agent.indexOf(bot) > -1) {\n+ return true;\n+ }\n+ }\n+ return false;\n+}\n+\n+\n+function detectLinkBot(userAgent) {\n+ const bots = [\n+ 'twitterbot',\n+ 'facebookexternalhit',\n+ 'linkedinbot',\n+ 'embedly',\n+ 'baiduspider',\n+ 'pinterest',\n+ 'slackbot',\n+ 'discord',\n+ 'vkShare',\n+ 'facebot',\n+ 'outbrain',\n+ 'W3C_Validator'\n+ ];\n+ return isBot(bots, userAgent);\n+}\n+\n+function detectSEBot(userAgent) {\n+ const bots = [\n+ 'googlebot',\n+ 'bingbot',\n+ 'yandexbot',\n+ 'duckduckbot',\n+ 'slurp'\n+ ];\n+ return isBot(bots, userAgent);\n+}\n+\n+app.get('*', (req, res) => {\n+\n+ const isLinkBot = detectLinkBot(req.headers['user-agent']);\n+ const isSEBot = detectSEBot(req.headers['user-agent']);\n+ // If it's a bot, use rendertron\n+ if (isLinkBot) {\n+ const botUrl = generateUrl(req);\n+ fetch(`${renderUrl}/${botUrl}`)\n+ .then(res => res.text())\n+ .then(body => {\n+ res.set('Cache-Control', 'public, max-age=300, s-maxage=600');\n+ res.set('Vary', 'User-Agent');\n+\n+ res.send(body.toString());\n+ });\n+ } else if (isSEBot && req.originalUrl.indexOf('/list/') === -1) {\n+ const botUrl = generateUrl(req);\n+ fetch(`${renderUrl}/${botUrl}`)\n+ .then(res => res.text())\n+ .then(body => {\n+ res.set('Cache-Control', 'public, max-age=300, s-maxage=600');\n+ res.set('Vary', 'User-Agent');\n+\n+ res.send(body.toString());\n+ });\n+ } else {\n+ fetch(`https://${appUrl}`)\n+ .then(res => res.text())\n+ .then(body => {\n+ res.send(body);\n+ });\n+ }\n+\n+});\n+\n+//Rendertron SSR for bots\n+exports.app = functions.https.onRequest(app);\n// Firestore counts\nexports.firestoreCountlistsCreate = functions.firestore.document('/lists/{uid}').onCreate(() => {\n", "new_path": "functions/index.js", "old_path": "functions/index.js" }, { "change_type": "MODIFY", "diff": "}\n},\n\"accepts\": {\n- \"version\": \"1.3.4\",\n- \"resolved\": \"https://registry.npmjs.org/accepts/-/accepts-1.3.4.tgz\",\n- \"integrity\": \"sha1-hiRnWMfdbSGmR0/whKR0DsBesh8=\",\n+ \"version\": \"1.3.5\",\n+ \"resolved\": \"https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz\",\n+ \"integrity\": \"sha1-63d99gEXI6OxTopywIBcjoZ0a9I=\",\n\"requires\": {\n- \"mime-types\": \"2.1.17\",\n+ \"mime-types\": \"2.1.18\",\n\"negotiator\": \"0.6.1\"\n+ },\n+ \"dependencies\": {\n+ \"mime-db\": {\n+ \"version\": \"1.33.0\",\n+ \"resolved\": \"https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz\",\n+ \"integrity\": \"sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==\"\n+ },\n+ \"mime-types\": {\n+ \"version\": \"2.1.18\",\n+ \"resolved\": \"https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz\",\n+ \"integrity\": \"sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==\",\n+ \"requires\": {\n+ \"mime-db\": \"1.33.0\"\n+ }\n+ }\n}\n},\n\"acorn\": {\n\"content-type\": \"1.0.4\",\n\"debug\": \"2.6.9\",\n\"depd\": \"1.1.2\",\n- \"http-errors\": \"1.6.2\",\n+ \"http-errors\": \"1.6.3\",\n\"iconv-lite\": \"0.4.19\",\n\"on-finished\": \"2.3.0\",\n\"qs\": \"6.5.1\",\n\"raw-body\": \"2.3.2\",\n- \"type-is\": \"1.6.15\"\n+ \"type-is\": \"1.6.16\"\n}\n},\n\"boom\": {\n\"integrity\": \"sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=\"\n},\n\"express\": {\n- \"version\": \"4.16.2\",\n- \"resolved\": \"https://registry.npmjs.org/express/-/express-4.16.2.tgz\",\n- \"integrity\": \"sha1-41xt/i1kt9ygpc1PIXgb4ymeB2w=\",\n+ \"version\": \"4.16.3\",\n+ \"resolved\": \"https://registry.npmjs.org/express/-/express-4.16.3.tgz\",\n+ \"integrity\": \"sha1-avilAjUNsyRuzEvs9rWjTSL37VM=\",\n\"requires\": {\n- \"accepts\": \"1.3.4\",\n+ \"accepts\": \"1.3.5\",\n\"array-flatten\": \"1.1.1\",\n\"body-parser\": \"1.18.2\",\n\"content-disposition\": \"0.5.2\",\n\"encodeurl\": \"1.0.2\",\n\"escape-html\": \"1.0.3\",\n\"etag\": \"1.8.1\",\n- \"finalhandler\": \"1.1.0\",\n+ \"finalhandler\": \"1.1.1\",\n\"fresh\": \"0.5.2\",\n\"merge-descriptors\": \"1.0.1\",\n\"methods\": \"1.1.2\",\n\"on-finished\": \"2.3.0\",\n\"parseurl\": \"1.3.2\",\n\"path-to-regexp\": \"0.1.7\",\n- \"proxy-addr\": \"2.0.2\",\n+ \"proxy-addr\": \"2.0.3\",\n\"qs\": \"6.5.1\",\n\"range-parser\": \"1.2.0\",\n\"safe-buffer\": \"5.1.1\",\n- \"send\": \"0.16.1\",\n- \"serve-static\": \"1.13.1\",\n+ \"send\": \"0.16.2\",\n+ \"serve-static\": \"1.13.2\",\n\"setprototypeof\": \"1.1.0\",\n- \"statuses\": \"1.3.1\",\n- \"type-is\": \"1.6.15\",\n+ \"statuses\": \"1.4.0\",\n+ \"type-is\": \"1.6.16\",\n\"utils-merge\": \"1.0.1\",\n\"vary\": \"1.1.2\"\n}\n}\n},\n\"finalhandler\": {\n- \"version\": \"1.1.0\",\n- \"resolved\": \"https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz\",\n- \"integrity\": \"sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=\",\n+ \"version\": \"1.1.1\",\n+ \"resolved\": \"https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz\",\n+ \"integrity\": \"sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==\",\n\"requires\": {\n\"debug\": \"2.6.9\",\n\"encodeurl\": \"1.0.2\",\n\"escape-html\": \"1.0.3\",\n\"on-finished\": \"2.3.0\",\n\"parseurl\": \"1.3.2\",\n- \"statuses\": \"1.3.1\",\n+ \"statuses\": \"1.4.0\",\n\"unpipe\": \"1.0.0\"\n}\n},\n\"@types/jsonwebtoken\": \"7.2.5\",\n\"@types/lodash\": \"4.14.101\",\n\"@types/sha1\": \"1.1.1\",\n- \"express\": \"4.16.2\",\n+ \"express\": \"4.16.3\",\n\"jsonwebtoken\": \"7.4.3\",\n\"lodash\": \"4.17.5\",\n\"sha1\": \"1.1.1\"\n\"integrity\": \"sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=\"\n},\n\"http-errors\": {\n- \"version\": \"1.6.2\",\n- \"resolved\": \"https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz\",\n- \"integrity\": \"sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=\",\n+ \"version\": \"1.6.3\",\n+ \"resolved\": \"https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz\",\n+ \"integrity\": \"sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=\",\n\"requires\": {\n- \"depd\": \"1.1.1\",\n+ \"depd\": \"1.1.2\",\n\"inherits\": \"2.0.3\",\n- \"setprototypeof\": \"1.0.3\",\n- \"statuses\": \"1.3.1\"\n- },\n- \"dependencies\": {\n- \"depd\": {\n- \"version\": \"1.1.1\",\n- \"resolved\": \"https://registry.npmjs.org/depd/-/depd-1.1.1.tgz\",\n- \"integrity\": \"sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=\"\n- },\n- \"setprototypeof\": {\n- \"version\": \"1.0.3\",\n- \"resolved\": \"https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz\",\n- \"integrity\": \"sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=\"\n- }\n+ \"setprototypeof\": \"1.1.0\",\n+ \"statuses\": \"1.4.0\"\n}\n},\n\"http-parser-js\": {\n\"integrity\": \"sha1-EEqOSqym09jNFXqO+L+rLXo//bY=\"\n},\n\"ipaddr.js\": {\n- \"version\": \"1.5.2\",\n- \"resolved\": \"https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.5.2.tgz\",\n- \"integrity\": \"sha1-1LUFvemUaYfM8PxY2QEP+WB+P6A=\"\n+ \"version\": \"1.6.0\",\n+ \"resolved\": \"https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.6.0.tgz\",\n+ \"integrity\": \"sha1-4/o1e3c9phnybpXwSdBVxyeW+Gs=\"\n},\n\"is\": {\n\"version\": \"3.2.1\",\n\"resolved\": \"https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz\",\n\"integrity\": \"sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=\"\n},\n+ \"node-fetch\": {\n+ \"version\": \"2.1.2\",\n+ \"resolved\": \"https://registry.npmjs.org/node-fetch/-/node-fetch-2.1.2.tgz\",\n+ \"integrity\": \"sha1-q4hOjn5X44qUR1POxwb3iNF2i7U=\"\n+ },\n\"node-forge\": {\n\"version\": \"0.7.1\",\n\"resolved\": \"https://registry.npmjs.org/node-forge/-/node-forge-0.7.1.tgz\",\n}\n},\n\"proxy-addr\": {\n- \"version\": \"2.0.2\",\n- \"resolved\": \"https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.2.tgz\",\n- \"integrity\": \"sha1-ZXFQT0e7mI7IGAJT+F3X4UlSvew=\",\n+ \"version\": \"2.0.3\",\n+ \"resolved\": \"https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.3.tgz\",\n+ \"integrity\": \"sha512-jQTChiCJteusULxjBp8+jftSQE5Obdl3k4cnmLA6WXtK6XFuWRnvVL7aCiBqaLPM8c4ph0S4tKna8XvmIwEnXQ==\",\n\"requires\": {\n\"forwarded\": \"0.1.2\",\n- \"ipaddr.js\": \"1.5.2\"\n+ \"ipaddr.js\": \"1.6.0\"\n}\n},\n\"pump\": {\n\"http-errors\": \"1.6.2\",\n\"iconv-lite\": \"0.4.19\",\n\"unpipe\": \"1.0.0\"\n+ },\n+ \"dependencies\": {\n+ \"depd\": {\n+ \"version\": \"1.1.1\",\n+ \"resolved\": \"https://registry.npmjs.org/depd/-/depd-1.1.1.tgz\",\n+ \"integrity\": \"sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=\"\n+ },\n+ \"http-errors\": {\n+ \"version\": \"1.6.2\",\n+ \"resolved\": \"https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz\",\n+ \"integrity\": \"sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=\",\n+ \"requires\": {\n+ \"depd\": \"1.1.1\",\n+ \"inherits\": \"2.0.3\",\n+ \"setprototypeof\": \"1.0.3\",\n+ \"statuses\": \"1.4.0\"\n+ }\n+ },\n+ \"setprototypeof\": {\n+ \"version\": \"1.0.3\",\n+ \"resolved\": \"https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz\",\n+ \"integrity\": \"sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=\"\n+ }\n}\n},\n\"readable-stream\": {\n\"integrity\": \"sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==\"\n},\n\"send\": {\n- \"version\": \"0.16.1\",\n- \"resolved\": \"https://registry.npmjs.org/send/-/send-0.16.1.tgz\",\n- \"integrity\": \"sha512-ElCLJdJIKPk6ux/Hocwhk7NFHpI3pVm/IZOYWqUmoxcgeyM+MpxHHKhb8QmlJDX1pU6WrgaHBkVNm73Sv7uc2A==\",\n+ \"version\": \"0.16.2\",\n+ \"resolved\": \"https://registry.npmjs.org/send/-/send-0.16.2.tgz\",\n+ \"integrity\": \"sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==\",\n\"requires\": {\n\"debug\": \"2.6.9\",\n\"depd\": \"1.1.2\",\n\"escape-html\": \"1.0.3\",\n\"etag\": \"1.8.1\",\n\"fresh\": \"0.5.2\",\n- \"http-errors\": \"1.6.2\",\n+ \"http-errors\": \"1.6.3\",\n\"mime\": \"1.4.1\",\n\"ms\": \"2.0.0\",\n\"on-finished\": \"2.3.0\",\n\"range-parser\": \"1.2.0\",\n- \"statuses\": \"1.3.1\"\n+ \"statuses\": \"1.4.0\"\n}\n},\n\"serve-static\": {\n- \"version\": \"1.13.1\",\n- \"resolved\": \"https://registry.npmjs.org/serve-static/-/serve-static-1.13.1.tgz\",\n- \"integrity\": \"sha512-hSMUZrsPa/I09VYFJwa627JJkNs0NrfL1Uzuup+GqHfToR2KcsXFymXSV90hoyw3M+msjFuQly+YzIH/q0MGlQ==\",\n+ \"version\": \"1.13.2\",\n+ \"resolved\": \"https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz\",\n+ \"integrity\": \"sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==\",\n\"requires\": {\n\"encodeurl\": \"1.0.2\",\n\"escape-html\": \"1.0.3\",\n\"parseurl\": \"1.3.2\",\n- \"send\": \"0.16.1\"\n+ \"send\": \"0.16.2\"\n}\n},\n\"setprototypeof\": {\n}\n},\n\"statuses\": {\n- \"version\": \"1.3.1\",\n- \"resolved\": \"https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz\",\n- \"integrity\": \"sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=\"\n+ \"version\": \"1.4.0\",\n+ \"resolved\": \"https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz\",\n+ \"integrity\": \"sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==\"\n},\n\"stream-combiner\": {\n\"version\": \"0.0.4\",\n\"optional\": true\n},\n\"type-is\": {\n- \"version\": \"1.6.15\",\n- \"resolved\": \"https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz\",\n- \"integrity\": \"sha1-yrEPtJCeRByChC6v4a1kbIGARBA=\",\n+ \"version\": \"1.6.16\",\n+ \"resolved\": \"https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz\",\n+ \"integrity\": \"sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==\",\n\"requires\": {\n\"media-typer\": \"0.3.0\",\n- \"mime-types\": \"2.1.17\"\n+ \"mime-types\": \"2.1.18\"\n+ },\n+ \"dependencies\": {\n+ \"mime-db\": {\n+ \"version\": \"1.33.0\",\n+ \"resolved\": \"https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz\",\n+ \"integrity\": \"sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==\"\n+ },\n+ \"mime-types\": {\n+ \"version\": \"2.1.18\",\n+ \"resolved\": \"https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz\",\n+ \"integrity\": \"sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==\",\n+ \"requires\": {\n+ \"mime-db\": \"1.33.0\"\n+ }\n+ }\n}\n},\n\"type-name\": {\n", "new_path": "functions/package-lock.json", "old_path": "functions/package-lock.json" }, { "change_type": "MODIFY", "diff": "\"description\": \"Firebase cloud function to count the amount of list created\",\n\"private\": true,\n\"dependencies\": {\n+ \"express\": \"^4.16.3\",\n\"firebase\": \"4.6.2\",\n\"firebase-admin\": \"^5.4.2\",\n\"firebase-functions\": \"^0.8.1\",\n\"grpc\": \"1.9.0\",\n+ \"node-fetch\": \"^2.1.2\",\n\"protobufjs\": \"^6.8.4\"\n}\n}\n", "new_path": "functions/package.json", "old_path": "functions/package.json" }, { "change_type": "MODIFY", "diff": "@@ -37,6 +37,7 @@ import {VenturesExtractor} from './list/data/extractor/ventures-extractor';\nimport {CustomLinksService} from './database/custom-links/custom-links.service';\nimport {PatreonGuard} from './guard/patreon.guard';\nimport {MathToolsService} from './tools/math-tools';\n+import {SeoService} from './seo/seo.service';\nconst dataExtractorProviders: Provider[] = [\n@@ -84,6 +85,7 @@ const dataExtractorProviders: Provider[] = [\nCustomLinksService,\nPatreonGuard,\nMathToolsService,\n+ SeoService,\n],\ndeclarations: [\nI18nPipe,\n", "new_path": "src/app/core/core.module.ts", "old_path": "src/app/core/core.module.ts" }, { "change_type": "ADD", "diff": "+export interface SeoConfig {\n+ title: string;\n+ description: string;\n+ image: string;\n+ slug?: string;\n+}\n", "new_path": "src/app/core/seo/seo-config.ts", "old_path": null }, { "change_type": "ADD", "diff": "+import {Injectable} from '@angular/core';\n+import {Meta} from '@angular/platform-browser';\n+import {SeoConfig} from './seo-config';\n+\n+@Injectable()\n+export class SeoService {\n+\n+ constructor(private meta: Meta) {\n+ }\n+\n+ public setConfig(config: SeoConfig): void {\n+ this.meta.updateTag({name: 'twitter:card', content: 'FFXIV Teamcraft'});\n+ this.meta.updateTag({name: 'twitter:site', content: '@FlavienNormand'});\n+ this.meta.updateTag({name: 'twitter:title', content: config.title});\n+ this.meta.updateTag({name: 'twitter:description', content: config.description});\n+ this.meta.updateTag({name: 'twitter:image', content: config.image});\n+\n+ this.meta.updateTag({property: 'og:type', content: 'article'});\n+ this.meta.updateTag({property: 'og:site_name', content: 'AngularFirebase'});\n+ this.meta.updateTag({property: 'og:title', content: config.title});\n+ this.meta.updateTag({property: 'og:description', content: config.description});\n+ this.meta.updateTag({property: 'og:image', content: config.image});\n+ if (config.slug !== undefined) {\n+ this.meta.updateTag({property: 'og:url', content: `https://instafire-app.firebaseapp.com/${config.slug}`});\n+ }\n+ }\n+}\n", "new_path": "src/app/core/seo/seo.service.ts", "old_path": null }, { "change_type": "MODIFY", "diff": "import {Component} from '@angular/core';\nimport {AngularFireDatabase} from 'angularfire2/database';\nimport {ObservableMedia} from '@angular/flex-layout';\n+import {SeoService} from '../../../core/seo/seo.service';\n@Component({\nselector: 'app-home',\n@@ -13,7 +14,13 @@ export class HomeComponent {\nlists_created = this.firebase.object('lists_created').valueChanges();\n- constructor(private firebase: AngularFireDatabase, private media: ObservableMedia) {\n+ constructor(private firebase: AngularFireDatabase, private media: ObservableMedia, private seo: SeoService) {\n+ this.seo.setConfig({\n+ title: 'FFXIV Teamcraft - Home',\n+ description: 'Create lists, share, contribute, craft',\n+ image: '/assets/branding/logo.png',\n+ slug: 'home'\n+ });\n}\nisMobile(): boolean {\n", "new_path": "src/app/pages/home/home/home.component.ts", "old_path": "src/app/pages/home/home/home.component.ts" }, { "change_type": "ADD", "diff": "Binary files /dev/null and b/src/assets/branding/logo.png differ\n", "new_path": "src/assets/branding/logo.png", "old_path": "src/assets/branding/logo.png" }, { "change_type": "MODIFY", "diff": "<title>Teamcraft</title>\n<base href=\"/\">\n- <meta name=\"description\" content=\"Final Fantasy XIV collaborative crafting made easy.\" />\n+ <!-- twitter -->\n+ <meta name=\"twitter:card\" content=\"summary\">\n+ <meta name=\"twitter:site\" content=\"@FlavienNormand\">\n+ <meta name=\"twitter:title\" content=\"FFXIV Teamcraft\">\n+ <meta name=\"twitter:description\" content=\"Final Fantasy XIV collaborative crafting made easy.\">\n+ <meta name=\"twitter:image\" content=\"https://beta.ffxivteamcraft.com/assets/branding/logo.png\">\n+\n+ <!-- facebook and other social sites -->\n+ <meta property=\"og:type\" content=\"article\">\n+ <meta property=\"og:site_name\" content=\"FFXIV Teamcraft\">\n+ <meta property=\"og:title\" content=\"Home Page\">\n+ <meta property=\"og:description\" content=\"Final Fantasy XIV collaborative crafting made easy.\">\n+ <meta property=\"og:image\" content=\"https://beta.ffxivteamcraft.com/assets/branding/logo.png\">\n+ <meta property=\"og:url\" content=\"https://beta.ffxivteamcraft.com\">\n<meta name=\"viewport\" content=\"width=device-width,user-scalable=no\">\n<link rel=\"icon\" type=\"image/x-icon\" href=\"favicon.ico\">\n", "new_path": "src/index.html", "old_path": "src/index.html" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
feat: better seo configuration TODO: add proper meta settings in each major page #198
1
feat
null
217,922
01.04.2018 14:24:05
-7,200
dfb709106ed92cad903f759bd03bfe9f6114c260
chore: add proper tag settings in some main pages
[ { "change_type": "MODIFY", "diff": "@@ -13,6 +13,7 @@ import {Title} from '@angular/platform-browser';\nimport {TranslateService} from '@ngx-translate/core';\nimport {LocalizedDataService} from '../../../core/data/localized-data.service';\nimport {ObservableMedia} from '@angular/flex-layout';\n+import {SeoService} from '../../../core/seo/seo.service';\n@Component({\nselector: 'app-list',\n@@ -30,7 +31,7 @@ export class ListComponent extends PageComponent implements OnInit, OnDestroy {\nconstructor(protected dialog: MatDialog, help: HelpService, private route: ActivatedRoute,\nprivate listService: ListService, private title: Title, private translate: TranslateService,\n- private data: LocalizedDataService, protected media: ObservableMedia) {\n+ private data: LocalizedDataService, protected media: ObservableMedia, private seo: SeoService) {\nsuper(dialog, help, media);\n}\n@@ -61,6 +62,13 @@ export class ListComponent extends PageComponent implements OnInit, OnDestroy {\nthis.notFound = true;\nreturn Observable.of(null);\n});\n+ }).do(list => {\n+ this.seo.setConfig({\n+ title: 'FFXIV Teamcraft',\n+ description: list.name,\n+ image: '/assets/branding/logo.png',\n+ slug: '/list/' + list.$key\n+ })\n});\n}\n", "new_path": "src/app/pages/list/list/list.component.ts", "old_path": "src/app/pages/list/list/list.component.ts" }, { "change_type": "MODIFY", "diff": "@@ -9,6 +9,9 @@ import 'rxjs/add/operator/mergeMap';\nimport 'rxjs/add/operator/combineLatest';\nimport {UserService} from '../../../core/database/user.service';\nimport 'rxjs/add/observable/empty';\n+import {SeoService} from '../../../core/seo/seo.service';\n+import 'rxjs/add/observable/zip';\n+import {SeoConfig} from '../../../core/seo/seo-config';\n@Component({\nselector: 'app-workshop',\n@@ -26,7 +29,7 @@ export class WorkshopComponent implements OnInit {\nfavorite: Observable<boolean>;\nconstructor(private route: ActivatedRoute, private workshopService: WorkshopService, private listService: ListService,\n- private userService: UserService) {\n+ private userService: UserService, private seo: SeoService) {\n}\ntoggleFavorite(workshop: Workshop): void {\n@@ -64,6 +67,14 @@ export class WorkshopComponent implements OnInit {\n).map(lists => lists.filter(l => l !== null));\nthis.author = this.workshop.mergeMap(workshop => this.userService.getCharacter(workshop.authorId))\n.catch(() => Observable.of(null));\n+ Observable.zip(this.author, this.workshop, (author, ws) => {\n+ return <SeoConfig>{\n+ title: ws.name,\n+ description: 'Created by ' + author.name,\n+ image: 'assets/branding/logo.png',\n+ slug: 'workshop/' + ws.$key,\n+ };\n+ }).subscribe(this.seo.setConfig);\n}\ntrackByListsFn(index: number, item: List) {\n", "new_path": "src/app/pages/workshop/workshop/workshop.component.ts", "old_path": "src/app/pages/workshop/workshop/workshop.component.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: add proper tag settings in some main pages #198
1
chore
null
679,913
02.04.2018 00:03:47
-3,600
ee684c7be8759eb3ec30c092c4f5185e37f3d001
feat(pointfree-lang): update grammar, aliases, ASTNode, NodeType add VAR_DEREF_IMM node type (immediate/non-defered var deref) add node source location info add VarDerefImmediate and NonWordExpr grammar rules add more aliases for built-ins
[ { "change_type": "MODIFY", "diff": "@@ -4,15 +4,22 @@ import * as pf from \"@thi.ng/pointfree\";\nexport interface ASTNode {\ntype: NodeType;\nbody: any;\n+ loc: [number, number];\nid?: string;\n}\n+export interface VisitorState {\n+ quote: boolean;\n+ word: boolean;\n+}\n+\nexport enum NodeType {\nSYM = 1,\nWORD,\nQUOT,\nVAR_DEREF,\n+ VAR_DEREF_IMM,\nVAR_STORE,\nNIL,\n@@ -47,6 +54,16 @@ export const ALIASES: IObjectOf<pf.StackFn> = {\n\"v-\": pf.vsub,\n\"v*\": pf.vmul,\n\"v/\": pf.vdiv,\n+ \"=\": pf.eq,\n+ \"!=\": pf.gteq,\n+ \"<=\": pf.lteq,\n+ \">=\": pf.gteq,\n+ \"<\": pf.lteq,\n+ \">\": pf.gteq,\n+ \"pos?\": pf.ispos,\n+ \"neg?\": pf.isneg,\n+ \"nil?\": pf.isnull,\n+ \"zero?\": pf.iszero,\n\".\": pf.print,\n\".s\": pf.printds,\n\".r\": pf.printrs,\n", "new_path": "packages/pointfree-lang/src/api.ts", "old_path": "packages/pointfree-lang/src/api.ts" }, { "change_type": "MODIFY", "diff": "// NodeType[NodeType[\"WORD\"] = 2] = \"WORD\";\n// NodeType[NodeType[\"QUOT\"] = 3] = \"QUOT\";\n// NodeType[NodeType[\"VAR_DEREF\"] = 4] = \"VAR_DEREF\";\n- // NodeType[NodeType[\"VAR_STORE\"] = 5] = \"VAR_STORE\";\n- // NodeType[NodeType[\"NIL\"] = 6] = \"NIL\";\n- // NodeType[NodeType[\"NUMBER\"] = 7] = \"NUMBER\";\n- // NodeType[NodeType[\"BOOLEAN\"] = 8] = \"BOOLEAN\";\n- // NodeType[NodeType[\"STRING\"] = 9] = \"STRING\";\n- // NodeType[NodeType[\"MAP\"] = 10] = \"MAP\";\n- // NodeType[NodeType[\"SET\"] = 11] = \"SET\";\n- // NodeType[NodeType[\"COMMENT\"] = 12] = \"COMMENT\";\n- // NodeType[NodeType[\"STACK_COMMENT\"] = 13] = \"STACK_COMMENT\";\n+ // NodeType[NodeType[\"VAR_DEREF_IMM\"] = 5] = \"VAR_DEREF_IMM\";\n+ // NodeType[NodeType[\"VAR_STORE\"] = 6] = \"VAR_STORE\";\n+ // NodeType[NodeType[\"NIL\"] = 7] = \"NIL\";\n+ // NodeType[NodeType[\"NUMBER\"] = 8] = \"NUMBER\";\n+ // NodeType[NodeType[\"BOOLEAN\"] = 9] = \"BOOLEAN\";\n+ // NodeType[NodeType[\"STRING\"] = 10] = \"STRING\";\n+ // NodeType[NodeType[\"MAP\"] = 11] = \"MAP\";\n+ // NodeType[NodeType[\"SET\"] = 12] = \"SET\";\n+ // NodeType[NodeType[\"COMMENT\"] = 13] = \"COMMENT\";\n+ // NodeType[NodeType[\"STACK_COMMENT\"] = 14] = \"STACK_COMMENT\";\nconst ast = (node) => {\n- // const loc = location().start;\n- // node.loc = [loc.offset, loc.line, loc.column];\n+ const loc = location().start;\n+ node.loc = [loc.line, loc.column];\nreturn node;\n};\n}\nRoot\n- = exrp:Expr*\n+ = expr:Expr*\nExpr\n+ = _ expr:( Word / NonWordExpr ) _ {\n+ return ast(expr);\n+ }\n+\n+NonWordExpr\n= _ expr:(\n- Word\n- / Quot\n+ Quot\n/ LitQuote\n/ Var\n/ Comment\n@@ -39,17 +44,17 @@ Expr\n) _ { return ast(expr); }\nWord\n- = \":\" __ id:Sym body:Expr+ \";\" {\n+ = \":\" __ id:Sym body:NonWordExpr+ \";\" {\nreturn { type: NodeType.WORD, id: id.id, body};\n}\nQuot\n- = \"[\" body:Expr* \"]\" {\n+ = \"[\" body:NonWordExpr* \"]\" {\nreturn { type: NodeType.QUOT, body };\n}\nSet\n- = \"#{\" body:Expr* \"}\" {\n+ = \"#{\" body:NonWordExpr* \"}\" {\nreturn { type: NodeType.SET, body };\n}\n@@ -62,13 +67,20 @@ MapPair\n= k:MapKey v:MapVal { return [ k, v ]; }\nMapKey\n- = k:(String / Sym / Number / VarDeref) \":\" { return k; }\n+ = k:(\n+ String\n+ / Sym\n+ / Number\n+ / VarDerefImmediate\n+ / VarDeref\n+ ) \":\" { return k; }\nMapVal\n= _ val:(\nAtom\n/ Quot\n/ LitQuote\n+ / VarDerefImmediate\n/ VarDeref\n/ Map\n// / Set\n@@ -108,9 +120,15 @@ SymChars\n= [*?$%&/\\|~<>=._+\\-]\nVar\n- = VarDeref\n+ = VarDerefImmediate\n+ / VarDeref\n/ VarStore\n+VarDerefImmediate\n+ = \"@@\" id:Sym {\n+ return {type: NodeType.VAR_DEREF_IMM, id: id.id}\n+ }\n+\nVarDeref\n= \"@\" id:Sym {\nreturn {type: NodeType.VAR_DEREF, id: id.id}\n@@ -122,7 +140,7 @@ VarStore\n}\nLitQuote\n- = \"'\" body:Expr {\n+ = \"'\" body:NonWordExpr {\nreturn {type: NodeType.QUOT, body: [body]};\n}\n", "new_path": "packages/pointfree-lang/src/grammar.pegjs", "old_path": "packages/pointfree-lang/src/grammar.pegjs" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(pointfree-lang): update grammar, aliases, ASTNode, NodeType - add VAR_DEREF_IMM node type (immediate/non-defered var deref) - add node source location info - add VarDerefImmediate and NonWordExpr grammar rules - add more aliases for built-ins
1
feat
pointfree-lang
679,913
02.04.2018 00:04:41
-3,600
26905f099611e28483b2e4a685e8529cf8e99816
refactor(examples): update pf svg example
[ { "change_type": "MODIFY", "diff": "@@ -52,12 +52,12 @@ const usersrc = `\nonly creates circles for grid cells where x <= y\n)\n: circlegrid ( res -- )\n- dup [dup2 lteq [xy 10 v* 3 circle] [drop2] if] loop2 ;\n+ dup [dup2 <= [xy 10 v* 3 circle] [drop2] if] loop2 ;\ngrid circlegrid\n( create SVG root element in hiccup format )\n-@svg.svgdoc [{width: 200, height: 200, stroke: \"#f04\", fill: \"none\"}] pushl\n+[@@svg.svgdoc {width: 200, height: 200, stroke: \"#f04\", fill: \"none\"}]\n( concat with generated shapes )\n@shapes cat\n( serialize hiccup format to SVG and write to disk )\n", "new_path": "examples/pointfree-svg/src/index.ts", "old_path": "examples/pointfree-svg/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(examples): update pf svg example
1
refactor
examples
573,227
02.04.2018 07:25:40
25,200
a914bf654bea1d16a06d1ae5393f138717d4524a
docs(readme): update copyright to 2018
[ { "change_type": "MODIFY", "diff": "@@ -87,7 +87,7 @@ $ npm install restify\nThe MIT License (MIT)\n-Copyright (c) 2016 restify\n+Copyright (c) 2018 restify\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\n", "new_path": "README.md", "old_path": "README.md" }, { "change_type": "MODIFY", "diff": "-// Copyright 2016 Restify. All rights reserved.\n+// Copyright 2018 Restify. All rights reserved.\n'use strict';\n", "new_path": "lib/plugins/pre/context.js", "old_path": "lib/plugins/pre/context.js" } ]
JavaScript
MIT License
restify/node-restify
docs(readme): update copyright to 2018 (#1635)
1
docs
readme
573,227
02.04.2018 07:30:40
25,200
dc7336bf7b5e89150def2eeb1062d16ff26186a9
docs(server): update createServer JSDoc
[ { "change_type": "MODIFY", "diff": "@@ -71,8 +71,10 @@ routes and handlers for incoming requests.\nIf provided the following restify server options will be ignored:\nspdy, ca, certificate, key, passphrase, rejectUnauthorized, requestCert and\nciphers; however these can all be specified on httpsServerOptions.\n- - `options.strictRouting` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** If set, Restify\n- will treat \"/foo\" and \"/foo/\" as different paths. (optional, default `false`)\n+ - `options.onceNext` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Prevents calling next multiple\n+ times (optional, default `false`)\n+ - `options.strictNext` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Throws error when next() is\n+ called more than once, enabled onceNext option (optional, default `false`)\n- `options.ignoreTrailingSlash` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** ignore trailing slash\non paths (optional, default `false`)\n", "new_path": "docs/_api/server.md", "old_path": "docs/_api/server.md" }, { "change_type": "MODIFY", "diff": "@@ -53,8 +53,10 @@ require('./errorTypes');\n* If provided the following restify server options will be ignored:\n* spdy, ca, certificate, key, passphrase, rejectUnauthorized, requestCert and\n* ciphers; however these can all be specified on httpsServerOptions.\n- * @param {Boolean} [options.strictRouting=false] - If set, Restify\n- * will treat \"/foo\" and \"/foo/\" as different paths.\n+ * @param {Boolean} [options.onceNext=false] - Prevents calling next multiple\n+ * times\n+ * @param {Boolean} [options.strictNext=false] - Throws error when next() is\n+ * called more than once, enabled onceNext option\n* @param {Boolean} [options.ignoreTrailingSlash=false] - ignore trailing slash\n* on paths\n* @example\n", "new_path": "lib/index.js", "old_path": "lib/index.js" } ]
JavaScript
MIT License
restify/node-restify
docs(server): update createServer JSDoc (#1634)
1
docs
server
807,849
02.04.2018 10:10:35
25,200
8821ba3ab76c75ddd1b245a560b6414dd34cbe73
deps: remove unused eslint-plugin-babel
[ { "change_type": "MODIFY", "diff": "}\n}\n},\n- \"eslint-plugin-babel\": {\n- \"version\": \"4.1.2\",\n- \"resolved\": \"https://registry.npmjs.org/eslint-plugin-babel/-/eslint-plugin-babel-4.1.2.tgz\",\n- \"integrity\": \"sha1-eSAqDjV1fdkngJGbIzbx+i/lPB4=\",\n- \"dev\": true\n- },\n\"eslint-plugin-import\": {\n\"version\": \"2.9.0\",\n\"resolved\": \"https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.9.0.tgz\",\n", "new_path": "package-lock.json", "old_path": "package-lock.json" }, { "change_type": "MODIFY", "diff": "\"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\"eslint-plugin-import\": \"^2.9.0\",\n\"eslint-plugin-jest\": \"^21.15.0\",\n\"eslint-plugin-node\": \"^6.0.1\",\n", "new_path": "package.json", "old_path": "package.json" } ]
JavaScript
MIT License
lerna/lerna
deps: remove unused eslint-plugin-babel
1
deps
null
807,849
02.04.2018 10:12:10
25,200
3ac4e3e0e45f90f888895e090851bd053f5d201f
deps: bump eslint-plugin-import
[ { "change_type": "MODIFY", "diff": "}\n},\n\"eslint-module-utils\": {\n- \"version\": \"2.1.1\",\n- \"resolved\": \"https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.1.1.tgz\",\n- \"integrity\": \"sha512-jDI/X5l/6D1rRD/3T43q8Qgbls2nq5km5KSqiwlyUbGo5+04fXhMKdCPhjwbqAa6HXWaMxj8Q4hQDIh7IadJQw==\",\n+ \"version\": \"2.2.0\",\n+ \"resolved\": \"https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz\",\n+ \"integrity\": \"sha1-snA2LNiLGkitMIl2zn+lTphBF0Y=\",\n\"dev\": true,\n\"requires\": {\n\"debug\": \"2.6.9\",\n}\n},\n\"eslint-plugin-import\": {\n- \"version\": \"2.9.0\",\n- \"resolved\": \"https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.9.0.tgz\",\n- \"integrity\": \"sha1-JgAu+/ylmJtyiKwEdQi9JPIXsWk=\",\n+ \"version\": \"2.10.0\",\n+ \"resolved\": \"https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.10.0.tgz\",\n+ \"integrity\": \"sha1-+gkIPVp1KI35xsfQn+EiVZhWVec=\",\n\"dev\": true,\n\"requires\": {\n\"builtin-modules\": \"1.1.1\",\n\"debug\": \"2.6.9\",\n\"doctrine\": \"1.5.0\",\n\"eslint-import-resolver-node\": \"0.3.2\",\n- \"eslint-module-utils\": \"2.1.1\",\n+ \"eslint-module-utils\": \"2.2.0\",\n\"has\": \"1.0.1\",\n\"lodash\": \"4.17.5\",\n\"minimatch\": \"3.0.4\",\n", "new_path": "package-lock.json", "old_path": "package-lock.json" }, { "change_type": "MODIFY", "diff": "\"eslint\": \"^4.19.1\",\n\"eslint-config-airbnb-base\": \"^12.1.0\",\n\"eslint-config-prettier\": \"^2.9.0\",\n- \"eslint-plugin-import\": \"^2.9.0\",\n+ \"eslint-plugin-import\": \"^2.10.0\",\n\"eslint-plugin-jest\": \"^21.15.0\",\n\"eslint-plugin-node\": \"^6.0.1\",\n\"eslint-plugin-prettier\": \"^2.6.0\",\n", "new_path": "package.json", "old_path": "package.json" } ]
JavaScript
MIT License
lerna/lerna
deps: bump eslint-plugin-import
1
deps
null
730,414
02.04.2018 10:36:33
14,400
95ae702b31788e01cc37acb2e0a51ce205642a9e
docs(widgets): add instructions to avoid CORS error
[ { "change_type": "MODIFY", "diff": "@@ -131,6 +131,14 @@ If you're using our CDN, skip to the next section.\n- Add a `<script />` tag to your page to include the `bundle.js`\n- Add a `<link />` tag to include `main.css`\n+#### Browser\n+\n+If you're loading an HTML file directly in the browser, use Firefox to avoid a [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) error. If you prefer Chrome, you can start it with the *--allow-file-access-from-files* flag:\n+\n+```bash\n+open -a \"Google Chrome\" --args --allow-file-access-from-files\n+```\n+\n#### Browser Globals\nIf you need additional behaviors or need to do additional work before the widget loads, it may be useful for to programmatically instatiate the widget after the intial page loads.\n", "new_path": "packages/node_modules/@ciscospark/widget-space/README.md", "old_path": "packages/node_modules/@ciscospark/widget-space/README.md" } ]
JavaScript
MIT License
webex/react-widgets
docs(widgets): add instructions to avoid CORS error
1
docs
widgets
807,849
02.04.2018 11:55:55
25,200
436cfe1dd65dd865603c23e00b025e015f8d2060
fix(logging): Log failures from package scripts once, not twice
[ { "change_type": "MODIFY", "diff": "@@ -169,7 +169,13 @@ class BootstrapCommand extends Command {\ntracker.completeWork(1);\n})\n.catch(err => {\n+ this.logger.error(\"bootstrap\", `lifecycle '${stage}' errored in '${pkg.name}'`);\n+\n+ if (err.code) {\n+ // log non-lerna error cleanly\nerr.pkg = pkg;\n+ }\n+\nthrow err;\n});\n}\n", "new_path": "commands/bootstrap/index.js", "old_path": "commands/bootstrap/index.js" }, { "change_type": "MODIFY", "diff": "@@ -50,8 +50,11 @@ class ExecCommand extends Command {\nreturn runParallelBatches(this.batchedPackages, this.concurrency, pkg =>\nthis.runCommandInPackage(pkg).catch(err => {\n+ this.logger.error(\"exec\", `'${err.cmd}' errored in '${pkg.name}'`);\n+\nif (err.code) {\n- this.logger.error(\"exec\", `Errored while executing '${err.cmd}' in '${pkg.name}'`);\n+ // log non-lerna error cleanly\n+ err.pkg = pkg;\n}\nthrow err;\n", "new_path": "commands/exec/index.js", "old_path": "commands/exec/index.js" }, { "change_type": "MODIFY", "diff": "@@ -112,7 +112,12 @@ class RunCommand extends Command {\noutput(result.stdout);\n})\n.catch(err => {\n- this.logger.error(this.script, `Errored while running script in '${pkg.name}'`);\n+ this.logger.error(\"run\", `'${this.script}' errored in '${pkg.name}'`);\n+\n+ if (err.code) {\n+ // log non-lerna error cleanly\n+ err.pkg = pkg;\n+ }\nthrow err;\n});\n", "new_path": "commands/run/index.js", "old_path": "commands/run/index.js" }, { "change_type": "MODIFY", "diff": "@@ -76,17 +76,18 @@ function lernaCLI(argv, cwd) {\n// certain yargs validations throw strings :P\nconst actual = err || new Error(msg);\n- // ValidationErrors are already logged\n- if (actual.name !== \"ValidationError\") {\n+ // ValidationErrors are already logged, as are package errors\n+ if (actual.name !== \"ValidationError\" && !actual.pkg) {\n// the recommendCommands() message is too terse\nif (/Did you mean/.test(actual.message)) {\nlog.error(\"lerna\", `Unknown command \"${cli.parsed.argv._[0]}\"`);\n}\n+\nlog.error(\"lerna\", actual.message);\n}\n// exit non-zero so the CLI can be usefully chained\n- process.exitCode = 1;\n+ process.exitCode = actual.code || 1;\n})\n.alias(\"h\", \"help\")\n.alias(\"v\", \"version\")\n", "new_path": "core/cli/index.js", "old_path": "core/cli/index.js" }, { "change_type": "MODIFY", "diff": "@@ -64,8 +64,8 @@ class Command {\nlog.error(\"\", cleanStack(err, this.constructor.name));\n}\n- // ValidationError does not trigger a log dump\n- if (err.name !== \"ValidationError\") {\n+ // ValidationError does not trigger a log dump, nor do external package errors\n+ if (err.name !== \"ValidationError\" && !err.pkg) {\nwriteLogFile(this.project.rootPath);\n}\n", "new_path": "core/command/index.js", "old_path": "core/command/index.js" }, { "change_type": "MODIFY", "diff": "@@ -5,19 +5,24 @@ const log = require(\"npmlog\");\nmodule.exports = logPackageError;\nfunction logPackageError(err) {\n- log.error(`Error occured in '${err.pkg.name}' while running '${err.cmd}'`);\n+ log.error(err.cmd, `exited ${err.code} in '${err.pkg.name}'`);\n- const pkgPrefix = `${err.cmd} [${err.pkg.name}]`;\n- log.error(pkgPrefix, `Output from stdout:`);\n- log.pause();\n- console.error(err.stdout); // eslint-disable-line no-console\n+ if (err.stdout) {\n+ log.error(err.cmd, \"stdout:\");\n+ directLog(err.stdout);\n+ }\n- log.resume();\n- log.error(pkgPrefix, `Output from stderr:`);\n- log.pause();\n- console.error(err.stderr); // eslint-disable-line no-console\n+ if (err.stderr) {\n+ log.error(err.cmd, \"stderr:\");\n+ directLog(err.stderr);\n+ }\n// Below is just to ensure something sensible is printed after the long stream of logs\n+ log.error(err.cmd, `exited ${err.code} in '${err.pkg.name}'`);\n+}\n+\n+function directLog(message) {\n+ log.pause();\n+ console.error(message); // eslint-disable-line no-console\nlog.resume();\n- log.error(`Error occured in '${err.pkg.name}' while running '${err.cmd}'`);\n}\n", "new_path": "core/command/lib/log-package-error.js", "old_path": "core/command/lib/log-package-error.js" }, { "change_type": "MODIFY", "diff": "@@ -15,7 +15,7 @@ describe(\"lerna run\", () => {\ntry {\nawait cliRunner(cwd)(...args);\n} catch (err) {\n- expect(err.message).toMatch(\"Errored while running script in 'package-3'\");\n+ expect(err.message).toMatch(\"run 'fail' errored in 'package-3'\");\n}\n});\n", "new_path": "integration/lerna-run.test.js", "old_path": "integration/lerna-run.test.js" } ]
JavaScript
MIT License
lerna/lerna
fix(logging): Log failures from package scripts once, not twice
1
fix
logging
807,849
02.04.2018 13:39:02
25,200
d43b89ddb7af96013d476555f8e08430d2c7ccb3
refactor: optionalDependencies should overwrite devDependencies when merged
[ { "change_type": "MODIFY", "diff": "@@ -300,8 +300,8 @@ class BootstrapCommand extends Command {\n// collect root dependency versions\nconst mergedRootDeps = Object.assign(\n{},\n- rootPkg.optionalDependencies,\nrootPkg.devDependencies,\n+ rootPkg.optionalDependencies,\nrootPkg.dependencies\n);\nconst rootExternalVersions = new Map(\n", "new_path": "commands/bootstrap/index.js", "old_path": "commands/bootstrap/index.js" }, { "change_type": "MODIFY", "diff": "@@ -68,8 +68,8 @@ class PackageGraph extends Map {\n? Object.assign({}, currentNode.pkg.dependencies)\n: Object.assign(\n{},\n- currentNode.pkg.optionalDependencies,\ncurrentNode.pkg.devDependencies,\n+ currentNode.pkg.optionalDependencies,\ncurrentNode.pkg.dependencies\n);\n", "new_path": "core/package-graph/index.js", "old_path": "core/package-graph/index.js" } ]
JavaScript
MIT License
lerna/lerna
refactor: optionalDependencies should overwrite devDependencies when merged
1
refactor
null
807,849
02.04.2018 14:24:30
25,200
559b731285cbb9a767ce6257e1e7aab941ff4708
fix(publish): Ensure optionalDependencies are updated during publish to registry
[ { "change_type": "MODIFY", "diff": "{\n- \"name\": \"normal\",\n- \"version\": \"0.0.0-relative-file-specs\",\n+ \"name\": \"relative-file-specs\",\n+ \"version\": \"0.0.0-lerna\",\n\"lockfileVersion\": 1,\n\"requires\": true,\n\"dependencies\": {\n}\n},\n\"package-3\": {\n- \"version\": \"file:packages/package-3\"\n+ \"version\": \"file:packages/package-3\",\n+ \"optional\": true,\n+ \"requires\": {\n+ \"package-2\": \"file:packages/package-2\"\n+ }\n},\n\"package-4\": {\n\"version\": \"file:packages/package-4\",\n\"package-5\": {\n\"version\": \"file:packages/package-5\",\n\"requires\": {\n- \"package-4\": \"file:packages/package-4\"\n+ \"package-4\": \"file:packages/package-4\",\n+ \"package-6\": \"file:packages/package-6\"\n+ }\n+ },\n+ \"package-6\": {\n+ \"version\": \"file:packages/package-6\",\n+ \"requires\": {\n+ \"tiny-tarball\": \"1.0.0\"\n}\n},\n\"tiny-tarball\": {\n", "new_path": "commands/publish/__tests__/__fixtures__/relative-file-specs/package-lock.json", "old_path": "commands/publish/__tests__/__fixtures__/relative-file-specs/package-lock.json" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"package-4\",\n\"version\": \"1.0.0\",\n- \"dependencies\": {\n+ \"optionalDependencies\": {\n\"package-3\": \"file:../package-3\"\n}\n}\n", "new_path": "commands/publish/__tests__/__fixtures__/relative-file-specs/packages/package-4/package.json", "old_path": "commands/publish/__tests__/__fixtures__/relative-file-specs/packages/package-4/package.json" }, { "change_type": "MODIFY", "diff": "@@ -1268,7 +1268,7 @@ describe(\"PublishCommand\", () => {\nexpect(updatedPackageJSON(\"package-3\").dependencies).toMatchObject({\n\"package-2\": \"^2.0.0\",\n});\n- expect(updatedPackageJSON(\"package-4\").dependencies).toMatchObject({\n+ expect(updatedPackageJSON(\"package-4\").optionalDependencies).toMatchObject({\n\"package-3\": \"^2.0.0\",\n});\nexpect(updatedPackageJSON(\"package-5\").dependencies).toMatchObject({\n", "new_path": "commands/publish/__tests__/publish-command.test.js", "old_path": "commands/publish/__tests__/publish-command.test.js" }, { "change_type": "MODIFY", "diff": "@@ -65,7 +65,7 @@ class PackageGraph extends Map {\nthis.forEach((currentNode, currentName) => {\nconst graphDependencies =\ngraphType === \"dependencies\"\n- ? Object.assign({}, currentNode.pkg.dependencies)\n+ ? Object.assign({}, currentNode.pkg.optionalDependencies, currentNode.pkg.dependencies)\n: Object.assign(\n{},\ncurrentNode.pkg.devDependencies,\n", "new_path": "core/package-graph/index.js", "old_path": "core/package-graph/index.js" } ]
JavaScript
MIT License
lerna/lerna
fix(publish): Ensure optionalDependencies are updated during publish to registry
1
fix
publish
821,197
02.04.2018 19:39:04
-7,200
192f26851cc13ff4da292f06861ea9317f632ba6
fix(generators/command): assert cwd is a project
[ { "change_type": "MODIFY", "diff": "@@ -24,8 +24,8 @@ class CommandGenerator extends Generator {\nasync prompting() {\nthis.pjson = this.fs.readJSON('package.json')\n- this.pjson.oclif = this.pjson.oclif || {}\nif (!this.pjson) throw new Error('not in a project directory')\n+ this.pjson.oclif = this.pjson.oclif || {}\nthis.log(yosay(`Adding a command to ${this.pjson.name} Version: ${version}`))\n}\n", "new_path": "src/generators/command.ts", "old_path": "src/generators/command.ts" } ]
TypeScript
MIT License
oclif/oclif
fix(generators/command): assert cwd is a project (#94)
1
fix
generators/command
679,913
03.04.2018 03:11:21
-3,600
2101e9263c9eddb743f4709807d504b8d902188f
feat(pointfree): add math ops, update load/loadkey, update tests load/loadkey throws error if var doesn't exist
[ { "change_type": "MODIFY", "diff": "@@ -706,14 +706,81 @@ export const pow = op2((b, a) => Math.pow(a, b));\n*/\nexport const sqrt = op1(Math.sqrt);\n+/**\n+ * ( x -- exp(x) )\n+ *\n+ * @param ctx\n+ */\n+export const exp = op1(Math.exp);\n+\n+/**\n+ * ( x -- log(x) )\n+ *\n+ * @param ctx\n+ */\nexport const log = op1(Math.log);\n+/**\n+ * ( x -- sin(x) )\n+ *\n+ * @param ctx\n+ */\nexport const sin = op1(Math.sin);\n+/**\n+ * ( x -- cos(x) )\n+ *\n+ * @param ctx\n+ */\nexport const cos = op1(Math.cos);\n+/**\n+ * ( x -- tan(x) )\n+ *\n+ * @param ctx\n+ */\n+export const tan = op1(Math.tan);\n+\n+/**\n+ * ( x -- tanh(x) )\n+ *\n+ * @param ctx\n+ */\n+export const tanh = op1(Math.tanh);\n+\n+/**\n+ * ( x -- floor(x) )\n+ *\n+ * @param ctx\n+ */\n+export const floor = op1(Math.floor);\n+\n+/**\n+ * ( x -- ceil(x) )\n+ *\n+ * @param ctx\n+ */\n+export const ceil = op1(Math.ceil);\n+\n+/**\n+ * ( x y -- sqrt(x*x+y*y) )\n+ *\n+ * @param ctx\n+ */\n+export const hypot = op2(Math.hypot);\n+\n+/**\n+ * ( x y -- atan2(y,x) )\n+ *\n+ * @param ctx\n+ */\nexport const atan2 = op2(Math.atan2);\n+/**\n+ * ( -- Math.random() )\n+ *\n+ * @param ctx\n+ */\nexport const rand = (ctx: StackContext) =>\n(ctx[0].push(Math.random()), ctx);\n@@ -1621,15 +1688,22 @@ export const pushenv = (ctx: StackContext) =>\n(ctx[0].push(ctx[2]), ctx);\n/**\n- * Loads value for `key` from env and pushes it on d-stack.\n+ * Loads value for `key` from current env and pushes it on d-stack.\n+ * Throws error if var doesn't exist.\n*\n* ( key -- env[key] )\n*\n* @param ctx\n* @param env\n*/\n-export const load = (ctx: StackContext) =>\n- ($(ctx[0], 1), ctx[0].push(ctx[2][ctx[0].pop()]), ctx);\n+export const load = (ctx: StackContext) => {\n+ const stack = ctx[0];\n+ $(stack, 1);\n+ const id = stack.pop();\n+ !ctx[2].hasOwnProperty(id) && illegalArgs(`unknown var: ${id}`);\n+ stack.push(ctx[2][id]);\n+ return ctx;\n+};\n/**\n* Stores `val` under `key` in env.\n@@ -1644,20 +1718,24 @@ export const store = (ctx: StackContext) =>\n/**\n* Higher order word. Similar to `load`, but always uses given\n- * preconfigured `key` instead of reading it from d-stack at runtime (also\n- * slightly faster).\n+ * preconfigured `key` instead of reading it from d-stack at runtime\n+ * (also slightly faster). Throws error if var doesn't exist.\n*\n* ( -- env[key] )\n* @param ctx\n* @param env\n*/\nexport const loadkey = (key: PropertyKey) =>\n- (ctx: StackContext) => (ctx[0].push(ctx[2][key]), ctx);\n+ (ctx: StackContext) => {\n+ !ctx[2].hasOwnProperty(key) && illegalArgs(`unknown var: ${key}`);\n+ ctx[0].push(ctx[2][key]);\n+ return ctx;\n+ };\n/**\n* Higher order word. Similar to `store`, but always uses given\n- * preconfigure `key` instead of reading it from d-stack at runtime (also\n- * slightly faster).\n+ * preconfigure `key` instead of reading it from d-stack at runtime\n+ * (also slightly faster).\n*\n* ( val -- )\n*\n", "new_path": "packages/pointfree/src/index.ts", "old_path": "packages/pointfree/src/index.ts" }, { "change_type": "MODIFY", "diff": "@@ -473,7 +473,7 @@ describe(\"pointfree\", () => {\nit(\"load\", () => {\nassert.throws(() => pf.load($()));\nassert.deepEqual(pf.load([[\"a\"], [], { a: 1 }])[0], [1]);\n- assert.deepEqual(pf.load([[\"b\"], [], { a: 1 }])[0], [undefined]);\n+ assert.throws(() => pf.load([[\"b\"], [], { a: 1 }]));\n});\nit(\"store\", () => {\n@@ -484,7 +484,7 @@ describe(\"pointfree\", () => {\nit(\"loadkey\", () => {\nassert.deepEqual(pf.loadkey(\"a\")([[0], [], { a: 1 }])[0], [0, 1]);\n- assert.deepEqual(pf.loadkey(\"b\")([[0], [], { a: 1 }])[0], [0, undefined]);\n+ assert.throws(() => pf.loadkey(\"a\")(pf.ctx()));\n});\nit(\"storekey\", () => {\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 math ops, update load/loadkey, update tests - load/loadkey throws error if var doesn't exist
1
feat
pointfree
679,913
03.04.2018 03:17:31
-3,600
769e84da59ee606de78625c50b3d0521d3857390
feat(pointfree-lang): overhaul visitor quote/array & map handling, grammar revert / remove NodeType.VAR_DEREF_IMM add resolveNode, resolveArray, resolveMap update resolveVar to use hasOwnProperty() check simplify VisitorState and handling add source location handling (for improved error msg) update aliases
[ { "change_type": "MODIFY", "diff": "@@ -9,25 +9,22 @@ export interface ASTNode {\n}\nexport interface VisitorState {\n- quote: boolean;\nword: boolean;\n}\nexport enum NodeType {\nSYM = 1,\nWORD,\n- QUOT,\nVAR_DEREF,\n- VAR_DEREF_IMM,\nVAR_STORE,\nNIL,\nNUMBER,\nBOOLEAN,\nSTRING,\n+ ARRAY,\nMAP,\n- SET,\nCOMMENT,\nSTACK_COMMENT,\n@@ -48,8 +45,6 @@ export const ALIASES: IObjectOf<pf.StackFn> = {\n\"-\": pf.sub,\n\"*\": pf.mul,\n\"/\": pf.div,\n- \"1+\": pf.inc,\n- \"1-\": pf.dec,\n\"v+\": pf.vadd,\n\"v-\": pf.vsub,\n\"v*\": pf.vmul,\n@@ -64,6 +59,8 @@ export const ALIASES: IObjectOf<pf.StackFn> = {\n\"neg?\": pf.isneg,\n\"nil?\": pf.isnull,\n\"zero?\": pf.iszero,\n+ \"pi\": pf.push(Math.PI),\n+ \"tau\": pf.push(2 * Math.PI),\n\".\": pf.print,\n\".s\": pf.printds,\n\".r\": pf.printrs,\n", "new_path": "packages/pointfree-lang/src/api.ts", "old_path": "packages/pointfree-lang/src/api.ts" }, { "change_type": "MODIFY", "diff": "// const NodeType = {};\n// NodeType[NodeType[\"SYM\"] = 1] = \"SYM\";\n// NodeType[NodeType[\"WORD\"] = 2] = \"WORD\";\n- // NodeType[NodeType[\"QUOT\"] = 3] = \"QUOT\";\n- // NodeType[NodeType[\"VAR_DEREF\"] = 4] = \"VAR_DEREF\";\n- // NodeType[NodeType[\"VAR_DEREF_IMM\"] = 5] = \"VAR_DEREF_IMM\";\n- // NodeType[NodeType[\"VAR_STORE\"] = 6] = \"VAR_STORE\";\n- // NodeType[NodeType[\"NIL\"] = 7] = \"NIL\";\n- // NodeType[NodeType[\"NUMBER\"] = 8] = \"NUMBER\";\n- // NodeType[NodeType[\"BOOLEAN\"] = 9] = \"BOOLEAN\";\n- // NodeType[NodeType[\"STRING\"] = 10] = \"STRING\";\n- // NodeType[NodeType[\"MAP\"] = 11] = \"MAP\";\n- // NodeType[NodeType[\"SET\"] = 12] = \"SET\";\n- // NodeType[NodeType[\"COMMENT\"] = 13] = \"COMMENT\";\n- // NodeType[NodeType[\"STACK_COMMENT\"] = 14] = \"STACK_COMMENT\";\n+ // NodeType[NodeType[\"VAR_DEREF\"] = 3] = \"VAR_DEREF\";\n+ // NodeType[NodeType[\"VAR_STORE\"] = 4] = \"VAR_STORE\";\n+ // NodeType[NodeType[\"NIL\"] = 5] = \"NIL\";\n+ // NodeType[NodeType[\"NUMBER\"] = 6] = \"NUMBER\";\n+ // NodeType[NodeType[\"BOOLEAN\"] = 7] = \"BOOLEAN\";\n+ // NodeType[NodeType[\"STRING\"] = 8] = \"STRING\";\n+ // NodeType[NodeType[\"ARRAY\"] = 9] = \"ARRAY\";\n+ // NodeType[NodeType[\"MAP\"] = 10] = \"MAP\";\n+ // NodeType[NodeType[\"COMMENT\"] = 11] = \"COMMENT\";\n+ // NodeType[NodeType[\"STACK_COMMENT\"] = 12] = \"STACK_COMMENT\";\nconst ast = (node) => {\nconst loc = location().start;\n@@ -34,13 +32,12 @@ Expr\nNonWordExpr\n= _ expr:(\n- Quot\n- / LitQuote\n+ LitQuote\n/ Var\n/ Comment\n- / Atom\n+ / Array\n/ Map\n-// / Set\n+ / Atom\n) _ { return ast(expr); }\nWord\n@@ -48,14 +45,9 @@ Word\nreturn { type: NodeType.WORD, id: id.id, body};\n}\n-Quot\n+Array\n= \"[\" body:NonWordExpr* \"]\" {\n- return { type: NodeType.QUOT, body };\n- }\n-\n-Set\n- = \"#{\" body:NonWordExpr* \"}\" {\n- return { type: NodeType.SET, body };\n+ return { type: NodeType.ARRAY, body };\n}\nMap\n@@ -69,29 +61,26 @@ MapPair\nMapKey\n= k:(\nString\n- / Sym\n/ Number\n- / VarDerefImmediate\n/ VarDeref\n- ) \":\" { return k; }\n+ / Sym\n+ ) \":\" { return ast(k); }\nMapVal\n= _ val:(\nAtom\n- / Quot\n/ LitQuote\n- / VarDerefImmediate\n/ VarDeref\n+ / Array\n/ Map\n-// / Set\n- ) _ { return val; }\n+ ) _ { return ast(val); }\nAtom\n= String\n+ / Sym\n/ Number\n/ Boolean\n/ Nil\n- / Sym\nNil\n= \"nil\" {\n@@ -104,31 +93,23 @@ Boolean\n}\nSym\n- = id:$(SymInit SymRest*) {\n+ = id:$(SymV1) {\nreturn {type: NodeType.SYM, id};\n}\n-SymInit\n- = Alpha\n- / SymChars\n+SymV1\n+ = (Alpha / SymChars) (AlphaNum / SymChars / [.])*\n-SymRest\n- = AlphaNum\n- / SymChars\n+SymV2\n+ = Digit (AlphaNum / SymChars)+\nSymChars\n- = [*?$%&/\\|~<>=._+\\-]\n+ = [*?$%&/\\|~<>=_+\\-]\nVar\n- = VarDerefImmediate\n- / VarDeref\n+ = VarDeref\n/ VarStore\n-VarDerefImmediate\n- = \"@@\" id:Sym {\n- return {type: NodeType.VAR_DEREF_IMM, id: id.id}\n- }\n-\nVarDeref\n= \"@\" id:Sym {\nreturn {type: NodeType.VAR_DEREF, id: id.id}\n@@ -141,16 +122,20 @@ VarStore\nLitQuote\n= \"'\" body:NonWordExpr {\n- return {type: NodeType.QUOT, body: [body]};\n+ return {type: NodeType.ARRAY, body: [body]};\n}\nComment\n= \"(\"+ body:$(!\")\" .)* \")\" {\nreturn body.indexOf(\"--\") > 0 ?\n- { type: NodeType.STACK_COMMENT,\n- body: body.split(\"--\").map(x => x.trim().split(\" \"))\n+ {\n+ type: NodeType.STACK_COMMENT,\n+ body: body.split(\"--\").map(x => x.trim())\n} :\n- { type: NodeType.COMMENT, body: body.trim()};\n+ {\n+ type: NodeType.COMMENT,\n+ body: body.trim()\n+ };\n}\nString\n@@ -169,6 +154,7 @@ Binary\n= \"0b\" n:$[01]+ {\nreturn {type: NodeType.NUMBER, radix: 2, body: parseInt(n, 2)};\n}\n+\nHex\n= \"0x\" n:$[0-9a-fA-F]+ {\nreturn {type: NodeType.NUMBER, radix: 16, body: parseInt(n, 16)};\n", "new_path": "packages/pointfree-lang/src/grammar.pegjs", "old_path": "packages/pointfree-lang/src/grammar.pegjs" }, { "change_type": "MODIFY", "diff": "@@ -2,60 +2,116 @@ import { IObjectOf } from \"@thi.ng/api/api\";\nimport { illegalArgs, illegalState } from \"@thi.ng/api/error\";\nimport * as pf from \"@thi.ng/pointfree\";\n-import { ASTNode, NodeType, ALIASES } from \"./api\";\n-import { parse } from \"./parser\";\n+import { ASTNode, NodeType, ALIASES, VisitorState } from \"./api\";\n+import { parse, SyntaxError } from \"./parser\";\n-let DEBUG = false;\n+let DEBUG = true;\nexport const setDebug = (state: boolean) => DEBUG = state;\n+const nodeLoc = (node: ASTNode) =>\n+ node.loc ?\n+ `line ${node.loc.join(\":\")} -` :\n+ \"\";\n+\n+/**\n+ * Looks up given symbol (word name) in this order of priority:\n+ * - current `env.__words`\n+ * - `ALIASES`\n+ * - @thi.ng/pointfree built-ins\n+ *\n+ * Throws error if symbol can't be resolved.\n+ *\n+ * @param node\n+ * @param ctx\n+ */\nconst resolveSym = (node: ASTNode, ctx: pf.StackContext) => {\nconst id = node.id;\nlet w = (ctx[2].__words[id] || ALIASES[id] || pf[id]);\nif (!w) {\n- illegalArgs(`unknown symbol: ${id}`);\n+ illegalArgs(`${nodeLoc(node)} unknown symbol: ${id}`);\n}\nreturn w;\n};\n-const resolveVar = (id: string, ctx: pf.StackContext) => {\n- const w = ctx[2][id];\n- if (w === undefined) {\n- illegalArgs(`unknown var: ${id}`);\n+/**\n+ * Looks up given variable in current env and returns its value. Throws\n+ * error if var can't be resolved.\n+ *\n+ * @param id\n+ * @param ctx\n+ */\n+const resolveVar = (node: ASTNode, ctx: pf.StackContext) => {\n+ const id = node.id;\n+ if (!ctx[2].hasOwnProperty(id)) {\n+ illegalArgs(`${nodeLoc(node)} unknown var: ${id}`);\n}\n- return w;\n+ return ctx[2][id];\n};\n-const visit = (node: ASTNode, ctx: pf.StackContext, isQuote = false) => {\n- DEBUG && console.log(\"visit\", NodeType[node.type], node, ctx);\n+const resolveNode = (node: ASTNode, ctx: pf.StackContext) => {\nswitch (node.type) {\ncase NodeType.SYM:\n- return visitSym(node, ctx, isQuote);\n+ return resolveSym(node, ctx);\n+ case NodeType.VAR_DEREF:\n+ return resolveVar(node, ctx);\n+ case NodeType.VAR_STORE:\n+ return pf.storekey(node.id);\n+ case NodeType.ARRAY:\n+ return resolveArray(node, ctx);\n+ case NodeType.MAP:\n+ return resolveMap(node, ctx);\n+ default:\n+ return node.body;\n+ }\n+};\n+\n+const resolveArray = (node: ASTNode, ctx: pf.StackContext) => {\n+ const res = [];\n+ for (let n of node.body) {\n+ res.push(resolveNode(n, ctx));\n+ }\n+ return res;\n+};\n+\n+const resolveMap = (node: ASTNode, ctx: pf.StackContext) => {\n+ const res = {};\n+ for (let [k, v] of node.body) {\n+ res[k.type === NodeType.SYM ? k.id : resolveNode(k, ctx)] = resolveNode(v, ctx);\n+ }\n+ return res;\n+};\n+\n+const visit = (node: ASTNode, ctx: pf.StackContext, state: VisitorState) => {\n+ DEBUG && console.log(\"visit\", NodeType[node.type], node, ctx[0].toString());\n+ switch (node.type) {\n+ case NodeType.SYM:\n+ return visitSym(node, ctx, state);\ncase NodeType.NUMBER:\ncase NodeType.BOOLEAN:\ncase NodeType.STRING:\ncase NodeType.NIL:\nctx[0].push(node.body);\nreturn ctx;\n+ case NodeType.ARRAY:\n+ return visitArray(node, ctx, state);\ncase NodeType.MAP:\n- return visitMap(node, ctx, isQuote);\n- case NodeType.QUOT:\n- return visitQuot(node, ctx);\n+ return visitMap(node, ctx, state);\ncase NodeType.VAR_DEREF:\n- return visitDeref(node, ctx, isQuote);\n+ return visitDeref(node, ctx, state);\ncase NodeType.VAR_STORE:\n- return visitStore(node, ctx, isQuote);\n+ return visitStore(node, ctx, state);\ncase NodeType.WORD:\n- return visitWord(node, ctx, isQuote);\n+ return visitWord(node, ctx, state);\ndefault:\nDEBUG && console.log(\"skipping node...\");\n}\nreturn ctx;\n};\n-const visitSym = (node: ASTNode, ctx: pf.StackContext, isQuote: boolean) => {\n+const visitSym = (node: ASTNode, ctx: pf.StackContext, state: VisitorState) => {\nconst w = resolveSym(node, ctx);\n- if (isQuote) {\n+ if (state.word) {\nctx[0].push(w);\nreturn ctx;\n} else {\n@@ -63,24 +119,18 @@ const visitSym = (node: ASTNode, ctx: pf.StackContext, isQuote: boolean) => {\n}\n};\n-const visitQuot = (node: ASTNode, ctx: pf.StackContext) => {\n- let qctx = pf.ctx([], ctx[2]);\n- for (let n of node.body) {\n- qctx = visit(n, qctx, true);\n+const visitDeref = (node: ASTNode, ctx: pf.StackContext, state: VisitorState) => {\n+ if (state.word && node.type === NodeType.VAR_DEREF) {\n+ ctx[0].push(pf.loadkey(node.id));\n+ } else {\n+ ctx[0].push(resolveVar(node, ctx));\n}\n- ctx[0].push(qctx[0]);\n- return ctx;\n-};\n-\n-const visitDeref = (node: ASTNode, ctx: pf.StackContext, isQuote: boolean) => {\n- const id = node.id;\n- ctx[0].push(isQuote ? pf.loadkey(id) : resolveVar(id, ctx));\nreturn ctx;\n};\n-const visitStore = (node: ASTNode, ctx: pf.StackContext, isQuote: boolean) => {\n+const visitStore = (node: ASTNode, ctx: pf.StackContext, state: VisitorState) => {\nconst id = node.id;\n- if (isQuote) {\n+ if (state.word) {\nctx[0].push(pf.storekey(id));\nreturn ctx;\n} else {\n@@ -89,87 +139,43 @@ const visitStore = (node: ASTNode, ctx: pf.StackContext, isQuote: boolean) => {\n}\n};\n-const visitWord = (node: ASTNode, ctx: pf.StackContext, isQuote: boolean) => {\n+/**\n+ * @param node\n+ * @param ctx\n+ * @param state\n+ */\n+const visitWord = (node: ASTNode, ctx: pf.StackContext, state: VisitorState) => {\nconst id = node.id;\n- if (isQuote) {\n- illegalState(`can't define words inside quotations (${id})`);\n+ if (state.word) {\n+ illegalState(`${nodeLoc(node)}: can't define words inside quotations (${id})`);\n}\n- let wctx = pf.ctx([], { ...ctx[2] });\n+ let wctx = pf.ctx([], ctx[2]);\n+ state.word = true;\nfor (let n of node.body) {\n- wctx = visit(n, wctx, true);\n+ wctx = visit(n, wctx, state);\n}\n- const w = pf.word(wctx[0], wctx[2]);\n- // TODO add stack comment as meta\n+ const w = pf.word(wctx[0], ctx[2]);\nctx[2].__words[id] = w;\n+ state.word = false;\nreturn ctx;\n}\n-const visitMap = (node: ASTNode, ctx: pf.StackContext, isQuote: boolean) => {\n- const res = {};\n- let k, v;\n- for (let pair of node.body) {\n- [k, v] = pair;\n- let deferV: ASTNode, deferK: ASTNode;\n- switch (v.type) {\n- case NodeType.QUOT:\n- v = pf.unwrap(visitQuot(v, pf.ctx([], { ...ctx[2] })));\n- break;\n- case NodeType.MAP:\n- v = visitMap(v, pf.ctx([], { ...ctx[2] }), isQuote)[0];\n- if (isQuote) {\n- ctx[0].push(...v.slice(0, v.length - 1));\n- }\n- v = v[v.length - 1];\n- break;\n- case NodeType.SYM:\n- v = resolveSym(v, ctx);\n- break;\n- case NodeType.VAR_DEREF:\n- if (isQuote) {\n- deferV = v;\n- } else {\n- v = resolveVar(v.id, ctx);\n- }\n- break;\n- default:\n- v = v.body;\n- }\n- switch (k.type) {\n- case NodeType.VAR_DEREF:\n- if (isQuote) {\n- deferK = k;\n- } else {\n- res[resolveVar(k.id, ctx)] = v;\n- }\n- break;\n- case NodeType.SYM:\n- if (deferV) {\n- deferK = k.id;\n+const visitArray = (node: ASTNode, ctx: pf.StackContext, state: VisitorState) => {\n+ if (state.word) {\n+ ctx[0].push((_ctx) => (_ctx[0].push(resolveArray(node, _ctx)), _ctx));\n} else {\n- res[k.id] = v;\n+ ctx[0].push(resolveArray(node, ctx));\n}\n- break;\n- default:\n- if (deferV) {\n- deferK = k.body;\n- } else {\n- res[k.body] = v;\n- }\n- }\n- if (deferK !== undefined || deferV !== undefined) {\n- ctx[0].push(deferedPair(res, deferK, deferV || v));\n- }\n- }\n- ctx[0].push(res);\nreturn ctx;\n};\n-const deferedPair = (res: any, k, v) => {\n- return (k.type === NodeType.VAR_DEREF) ?\n- (v != null && v.type === NodeType.VAR_DEREF) ?\n- (ctx: pf.StackContext) => (res[resolveVar(k.id, ctx)] = resolveVar(v.id, ctx), ctx) :\n- (ctx: pf.StackContext) => (res[resolveVar(k.id, ctx)] = v, ctx) :\n- (ctx: pf.StackContext) => (res[k] = resolveVar(v.id, ctx), ctx);\n+const visitMap = (node: ASTNode, ctx: pf.StackContext, state: VisitorState) => {\n+ if (state.word) {\n+ ctx[0].push((_ctx) => (_ctx[0].push(resolveMap(node, _ctx)), _ctx));\n+ } else {\n+ ctx[0].push(resolveMap(node, ctx));\n+ }\n+ return ctx;\n};\nexport const ensureEnv = (env?: pf.StackEnv) => {\n@@ -182,10 +188,19 @@ export const ensureEnv = (env?: pf.StackEnv) => {\nexport const run = (src: string, env?: pf.StackEnv, stack: pf.Stack = []) => {\nlet ctx = pf.ctx(stack, ensureEnv(env));\n+ const state = { word: false };\n+ try {\nfor (let node of parse(src)) {\n- ctx = visit(node, ctx);\n+ ctx = visit(node, ctx, state);\n}\nreturn ctx;\n+ } catch (e) {\n+ if (e instanceof SyntaxError) {\n+ throw new Error(`line ${e.location.start.line}:${e.location.start.column}: ${e.message}`);\n+ } else {\n+ throw e;\n+ }\n+ }\n};\nexport const runU = (src: string, env?: pf.StackEnv, stack?: pf.Stack, n = 1) =>\n", "new_path": "packages/pointfree-lang/src/index.ts", "old_path": "packages/pointfree-lang/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(pointfree-lang): overhaul visitor quote/array & map handling, grammar - revert / remove NodeType.VAR_DEREF_IMM - add resolveNode, resolveArray, resolveMap - update resolveVar to use hasOwnProperty() check - simplify VisitorState and handling - add source location handling (for improved error msg) - update aliases
1
feat
pointfree-lang
311,007
03.04.2018 08:51:31
-32,400
926f4a6457447436b0a50b3d048881be243f826e
fix(generate): add page to entryComponents
[ { "change_type": "MODIFY", "diff": "@@ -15,13 +15,13 @@ import {\nurl,\n} from '@angular-devkit/schematics';\n-import { addDeclarationToModule } from '../utils/angular/ast-utils';\n+import { addDeclarationToModule, addEntryComponentsToModule } from '../utils/angular/ast-utils';\nimport { InsertChange } from '../utils/angular/change';\nimport { buildRelativePath, findModuleFromOptions } from '../utils/angular/find-module';\nimport { Schema as PageOptions } from './schema';\n-function addDeclarationToNgModule(options: PageOptions): Rule {\n+function addPageToNgModule(utils: 'Declaration'|'EntryComponents', options: PageOptions): Rule {\nconst { module } = options;\nif (!module) {\n@@ -46,16 +46,26 @@ function addDeclarationToNgModule(options: PageOptions): Rule {\nconst relativePath = buildRelativePath(module, pagePath);\nconst classifiedName = `${upperFirst(camelCase(options.name))}Page`;\n- const declarationChanges = addDeclarationToModule(source, module, classifiedName, relativePath);\n- const declarationRecorder = host.beginUpdate(module);\n- for (const change of declarationChanges) {\n+ let addNgModuleMethod: Function;\n+ if (utils === 'Declaration') {\n+ addNgModuleMethod = addDeclarationToModule;\n+ } else if (utils === 'EntryComponents') {\n+ addNgModuleMethod = addEntryComponentsToModule;\n+ } else {\n+ throw new SchematicsException('add module method is not found.');\n+ }\n+\n+ const Changes = addNgModuleMethod(source, module, classifiedName, relativePath);\n+ const Recorder = host.beginUpdate(module);\n+\n+ for (const change of Changes) {\nif (change instanceof InsertChange) {\n- declarationRecorder.insertLeft(change.pos, change.toAdd);\n+ Recorder.insertLeft(change.pos, change.toAdd);\n}\n}\n- host.commitUpdate(declarationRecorder);\n+ host.commitUpdate(Recorder);\nreturn host;\n};\n@@ -100,7 +110,8 @@ export default function (options: PageOptions): Rule {\nreturn chain([\nbranchAndMerge(chain([\n- addDeclarationToNgModule(options),\n+ addPageToNgModule('Declaration', options),\n+ addPageToNgModule('EntryComponents', options),\nmergeWith(templateSource),\n])),\n])(host, context);\n", "new_path": "packages/@ionic/schematics-angular/page/index.ts", "old_path": "packages/@ionic/schematics-angular/page/index.ts" }, { "change_type": "MODIFY", "diff": "@@ -387,6 +387,17 @@ export function addDeclarationToModule(source: ts.SourceFile,\nsource, modulePath, 'declarations', classifiedName, importPath);\n}\n+/**\n+ * Custom function to insert a entryComponents (page)\n+ * into NgModule declarations. It also imports the component.\n+ */\n+export function addEntryComponentsToModule(source: ts.SourceFile,\n+ modulePath: string, classifiedName: string,\n+ importPath: string): Change[] {\n+ return addSymbolToNgModuleMetadata(\n+ source, modulePath, 'entryComponents', classifiedName, importPath);\n+}\n+\n/**\n* Custom function to insert an NgModule into NgModule imports. It also imports the module.\n*/\n", "new_path": "packages/@ionic/schematics-angular/utils/angular/ast-utils.ts", "old_path": "packages/@ionic/schematics-angular/utils/angular/ast-utils.ts" } ]
TypeScript
MIT License
ionic-team/ionic-cli
fix(generate): add page to entryComponents (#3033)
1
fix
generate
679,913
03.04.2018 10:04:07
-3,600
5450e507a5ab40189d98493b2514ca9d43e303e2
fix(pointfree-lang): update grammar (parse order), add tests
[ { "change_type": "MODIFY", "diff": "@@ -77,10 +77,10 @@ MapVal\nAtom\n= String\n- / Sym\n/ Number\n/ Boolean\n/ Nil\n+ / Sym\nNil\n= \"nil\" {\n", "new_path": "packages/pointfree-lang/src/grammar.pegjs", "old_path": "packages/pointfree-lang/src/grammar.pegjs" }, { "change_type": "MODIFY", "diff": "@@ -9,6 +9,18 @@ describe(\"pointfree-lang\", () => {\nassert.deepEqual(run(`'nil dup`)[0], [[null], [null]]);\n});\n+ it(\"number (hex)\", () => {\n+ assert.deepEqual(run(`0x1 0xa 0xff 0xdecafbad`)[0], [1, 10, 255, 0xdecafbad]);\n+ });\n+\n+ it(\"number (decimal)\", () => {\n+ assert.deepEqual(run(`0 -1 +2`)[0], [0, -1, 2]);\n+ assert.deepEqual(run(`-123. +12.3`)[0], [-123, 12.3]);\n+ assert.deepEqual(run(`-123e4`)[0], [-1230000]);\n+ assert.deepEqual(run(`+1.23e-2`)[0], [0.0123]);\n+ assert.deepEqual(run(`+1.23e-2 0.0123 =`)[0], [true]);\n+ });\n+\nit(\"litquote\", () => {\nassert.deepEqual(runU(`'nil`), [null]);\nassert.deepEqual(runU(`'+`), [pf.add]);\n@@ -17,6 +29,23 @@ describe(\"pointfree-lang\", () => {\nassert.deepEqual(run(`1 2 '+ exec`)[0], [3]);\n});\n+ it(\"var deref (quote)\", () => {\n+ assert.deepEqual(runU(`[@a [@a {@a: @a} {@a: [@a]}]]`, { a: 1 }), [1, [1, { 1: 1 }, { 1: [1] }]]);\n+ });\n+\n+ it(\"var deref (litquote)\", () => {\n+ assert.deepEqual(runU(`'@a`, { a: 1 }), [1]);\n+ assert.deepEqual(runU(`'[@a]`, { a: 1 }), [[1]]);\n+ assert.deepEqual(runU(`''@a`, { a: 1 }), [[1]]);\n+ });\n+\n+ it(\"var deref (word)\", () => {\n+ assert.deepEqual(runU(`: foo [@a [@a {@a: @a} {@a: [@a]}]]; foo`, { a: 1 }), [1, [1, { 1: 1 }, { 1: [1] }]]);\n+ assert.deepEqual(\n+ run(`: foo [@a [@a {@a: @a} {@a: [@a]}]]; foo 2 a! foo`, { a: 1 })[0],\n+ [[1, [1, { 1: 1 }, { 1: [1] }]], [2, [2, { 2: 2 }, { 2: [2] }]]]);\n+ });\n+\n// setDebug(true);\n// console.log(run(`\"result: \" 1 2 + + .`));\n", "new_path": "packages/pointfree-lang/test/index.ts", "old_path": "packages/pointfree-lang/test/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
fix(pointfree-lang): update grammar (parse order), add tests
1
fix
pointfree-lang
679,913
03.04.2018 11:05:19
-3,600
1c899a181b9956908d1b5299eed1340ee891e7da
refactor(pointfree-lang): rename grammar rule / nodetype MAP=>OBJ, add docs rename resolveMap => resolveObject rename visitMap => visitObject
[ { "change_type": "MODIFY", "diff": "@@ -24,7 +24,7 @@ export enum NodeType {\nBOOLEAN,\nSTRING,\nARRAY,\n- MAP,\n+ OBJ,\nCOMMENT,\nSTACK_COMMENT,\n", "new_path": "packages/pointfree-lang/src/api.ts", "old_path": "packages/pointfree-lang/src/api.ts" }, { "change_type": "MODIFY", "diff": "// NodeType[NodeType[\"BOOLEAN\"] = 7] = \"BOOLEAN\";\n// NodeType[NodeType[\"STRING\"] = 8] = \"STRING\";\n// NodeType[NodeType[\"ARRAY\"] = 9] = \"ARRAY\";\n- // NodeType[NodeType[\"MAP\"] = 10] = \"MAP\";\n+ // NodeType[NodeType[\"OBJ\"] = 10] = \"OBJ\";\n// NodeType[NodeType[\"COMMENT\"] = 11] = \"COMMENT\";\n// NodeType[NodeType[\"STACK_COMMENT\"] = 12] = \"STACK_COMMENT\";\n@@ -36,7 +36,7 @@ NonWordExpr\n/ Var\n/ Comment\n/ Array\n- / Map\n+ / Obj\n/ Atom\n) _ { return ast(expr); }\n@@ -50,15 +50,15 @@ Array\nreturn { type: NodeType.ARRAY, body };\n}\n-Map\n- = \"{\" _ body:MapPair* \"}\" {\n- return { type: NodeType.MAP, body };\n+Obj\n+ = \"{\" _ body:ObjPair* \"}\" {\n+ return { type: NodeType.OBJ, body };\n}\n-MapPair\n- = k:MapKey v:MapVal { return [ k, v ]; }\n+ObjPair\n+ = k:ObjKey v:ObjVal { return [ k, v ]; }\n-MapKey\n+ObjKey\n= k:(\nString\n/ Number\n@@ -66,13 +66,13 @@ MapKey\n/ Sym\n) \":\" { return ast(k); }\n-MapVal\n+ObjVal\n= _ val:(\nAtom\n/ LitQuote\n/ VarDeref\n/ Array\n- / Map\n+ / Obj\n) _ { return ast(val); }\nAtom\n", "new_path": "packages/pointfree-lang/src/grammar.pegjs", "old_path": "packages/pointfree-lang/src/grammar.pegjs" }, { "change_type": "MODIFY", "diff": "@@ -5,7 +5,7 @@ import * as pf from \"@thi.ng/pointfree\";\nimport { ASTNode, NodeType, ALIASES, VisitorState } from \"./api\";\nimport { parse, SyntaxError } from \"./parser\";\n-let DEBUG = true;\n+let DEBUG = false;\nexport const setDebug = (state: boolean) => DEBUG = state;\n@@ -49,6 +49,13 @@ const resolveVar = (node: ASTNode, ctx: pf.StackContext) => {\nreturn ctx[2][id];\n};\n+/**\n+ * Resolves given node's value. Used by `resolveArray` & `resolveObject`\n+ * to process internal values (and in the latter case also their keys).\n+ *\n+ * @param node\n+ * @param ctx\n+ */\nconst resolveNode = (node: ASTNode, ctx: pf.StackContext) => {\nswitch (node.type) {\ncase NodeType.SYM:\n@@ -59,13 +66,19 @@ const resolveNode = (node: ASTNode, ctx: pf.StackContext) => {\nreturn pf.storekey(node.id);\ncase NodeType.ARRAY:\nreturn resolveArray(node, ctx);\n- case NodeType.MAP:\n- return resolveMap(node, ctx);\n+ case NodeType.OBJ:\n+ return resolveObject(node, ctx);\ndefault:\nreturn node.body;\n}\n};\n+/**\n+ * Constructs an array literal (quotation) from given AST node.\n+ *\n+ * @param node\n+ * @param ctx\n+ */\nconst resolveArray = (node: ASTNode, ctx: pf.StackContext) => {\nconst res = [];\nfor (let n of node.body) {\n@@ -74,7 +87,13 @@ const resolveArray = (node: ASTNode, ctx: pf.StackContext) => {\nreturn res;\n};\n-const resolveMap = (node: ASTNode, ctx: pf.StackContext) => {\n+/**\n+ * Constructs object literal from given AST node.\n+ *\n+ * @param node\n+ * @param ctx\n+ */\n+const resolveObject = (node: ASTNode, ctx: pf.StackContext) => {\nconst res = {};\nfor (let [k, v] of node.body) {\nres[k.type === NodeType.SYM ? k.id : resolveNode(k, ctx)] = resolveNode(v, ctx);\n@@ -82,6 +101,13 @@ const resolveMap = (node: ASTNode, ctx: pf.StackContext) => {\nreturn res;\n};\n+/**\n+ * Main AST node visitor dispatcher.\n+ *\n+ * @param node\n+ * @param ctx\n+ * @param state\n+ */\nconst visit = (node: ASTNode, ctx: pf.StackContext, state: VisitorState) => {\nDEBUG && console.log(\"visit\", NodeType[node.type], node, ctx[0].toString());\nswitch (node.type) {\n@@ -95,8 +121,8 @@ const visit = (node: ASTNode, ctx: pf.StackContext, state: VisitorState) => {\nreturn ctx;\ncase NodeType.ARRAY:\nreturn visitArray(node, ctx, state);\n- case NodeType.MAP:\n- return visitMap(node, ctx, state);\n+ case NodeType.OBJ:\n+ return visitObject(node, ctx, state);\ncase NodeType.VAR_DEREF:\nreturn visitDeref(node, ctx, state);\ncase NodeType.VAR_STORE:\n@@ -109,6 +135,15 @@ const visit = (node: ASTNode, ctx: pf.StackContext, state: VisitorState) => {\nreturn ctx;\n};\n+/**\n+ * SYM visitor. Looks up symbol (word name) and if `state.word` is true,\n+ * pushes word on (temp) stack (created by `visitWord`), else executes\n+ * word. Throws error if unknown word.\n+ *\n+ * @param node\n+ * @param ctx\n+ * @param state\n+ */\nconst visitSym = (node: ASTNode, ctx: pf.StackContext, state: VisitorState) => {\nconst w = resolveSym(node, ctx);\nif (state.word) {\n@@ -119,8 +154,17 @@ const visitSym = (node: ASTNode, ctx: pf.StackContext, state: VisitorState) => {\n}\n};\n+/**\n+ * VAR_DEREF visitor. If `state.word` is true, pushes `loadkey(id)` on\n+ * (temp) stack (created by `visitWord`), else attempts to resolve var\n+ * and pushes its value on stack. Throws error if unknown var.\n+ *\n+ * @param node\n+ * @param ctx\n+ * @param state\n+ */\nconst visitDeref = (node: ASTNode, ctx: pf.StackContext, state: VisitorState) => {\n- if (state.word && node.type === NodeType.VAR_DEREF) {\n+ if (state.word) {\nctx[0].push(pf.loadkey(node.id));\n} else {\nctx[0].push(resolveVar(node, ctx));\n@@ -128,6 +172,15 @@ const visitDeref = (node: ASTNode, ctx: pf.StackContext, state: VisitorState) =>\nreturn ctx;\n};\n+/**\n+ * VAR_STORE visitor. If `state.word` is true, pushes `storekey(id)` on\n+ * (temp) stack (created by `visitWord`), else pushes var name on stack\n+ * and calls `store` to save value in env.\n+ *\n+ * @param node\n+ * @param ctx\n+ * @param state\n+ */\nconst visitStore = (node: ASTNode, ctx: pf.StackContext, state: VisitorState) => {\nconst id = node.id;\nif (state.word) {\n@@ -140,6 +193,11 @@ const visitStore = (node: ASTNode, ctx: pf.StackContext, state: VisitorState) =>\n};\n/**\n+ * WORD visitor to create new word definition. Sets `state.word` to\n+ * true, builds temp stack context and calls `visit()` for all child\n+ * nodes. Then calls `word()` to compile function and stores it in\n+ * `env.__words` object.\n+ *\n* @param node\n* @param ctx\n* @param state\n@@ -160,6 +218,15 @@ const visitWord = (node: ASTNode, ctx: pf.StackContext, state: VisitorState) =>\nreturn ctx;\n}\n+/**\n+ * ARRAY visitor for arrays/quotations. If `state.word` is true, pushes\n+ * call to `resolveArray` on temp word stack, else calls `resolveArray`\n+ * and pushes result on stack.\n+ *\n+ * @param node\n+ * @param ctx\n+ * @param state\n+ */\nconst visitArray = (node: ASTNode, ctx: pf.StackContext, state: VisitorState) => {\nif (state.word) {\nctx[0].push((_ctx) => (_ctx[0].push(resolveArray(node, _ctx)), _ctx));\n@@ -169,11 +236,20 @@ const visitArray = (node: ASTNode, ctx: pf.StackContext, state: VisitorState) =>\nreturn ctx;\n};\n-const visitMap = (node: ASTNode, ctx: pf.StackContext, state: VisitorState) => {\n+/**\n+ * OBJ visitor for object literals. If `state.word` is true, pushes call\n+ * to `resolveObject` on temp word stack, else calls `resolveObject` and\n+ * pushes result on stack.\n+ *\n+ * @param node\n+ * @param ctx\n+ * @param state\n+ */\n+const visitObject = (node: ASTNode, ctx: pf.StackContext, state: VisitorState) => {\nif (state.word) {\n- ctx[0].push((_ctx) => (_ctx[0].push(resolveMap(node, _ctx)), _ctx));\n+ ctx[0].push((_ctx) => (_ctx[0].push(resolveObject(node, _ctx)), _ctx));\n} else {\n- ctx[0].push(resolveMap(node, ctx));\n+ ctx[0].push(resolveObject(node, ctx));\n}\nreturn ctx;\n};\n", "new_path": "packages/pointfree-lang/src/index.ts", "old_path": "packages/pointfree-lang/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(pointfree-lang): rename grammar rule / nodetype MAP=>OBJ, add docs - rename resolveMap => resolveObject - rename visitMap => visitObject
1
refactor
pointfree-lang
311,007
03.04.2018 11:20:23
-32,400
b26143e2ffd6e608901e12386b18f64469674bee
feat(ailments): add common version check ailment class
[ { "change_type": "MODIFY", "diff": "@@ -8,11 +8,65 @@ import { pkgFromRegistry, pkgManagerArgs } from '../../utils/npm';\nimport { Project as AngularProject } from './';\nexport function registerAilments(registry: IAilmentRegistry, deps: AutomaticallyTreatableAngularAilmentDeps) {\n- registry.register(new IonicForAngularUpdateAvailable(deps));\n- registry.register(new IonicForAngularMajorUpdateAvailable(deps));\n-\n- // TODO: @ionic/core update available\n- // TODO: Angular CLI update available\n+ // for @ionic/angular\n+ registry.register(new UpdateAvailable(deps, {\n+ id: 'ionic-for-angular-update-available',\n+ pkgName: '@ionic/angular',\n+ treatmentVisitURL: ['https://github.com/ionic-team/ionic/releases'],\n+ }));\n+ registry.register(new MajorUpdateAvailable(deps, {\n+ id: 'ionic-for-angular-major-update-available',\n+ pkgName: '@ionic/angular',\n+ treatmentVisitURL: ['https://blog.ionicframework.com', 'https://github.com/ionic-team/ionic/releases'],\n+ }));\n+\n+ // @ionic/schematics-angular\n+ registry.register(new UpdateAvailable(deps, {\n+ id: 'ionic-schematics-angular-update-available',\n+ pkgName: '@ionic/schematics-angular',\n+ treatmentVisitURL: ['https://github.com/ionic-team/ionic/releases'],\n+ }));\n+ registry.register(new MajorUpdateAvailable(deps, {\n+ id: 'ionic-schematics-angular-major-update-available',\n+ pkgName: '@ionic/schematics-angular',\n+ treatmentVisitURL: ['https://blog.ionicframework.com', 'https://github.com/ionic-team/ionic/releases'],\n+ }));\n+\n+ // @angular/cli\n+ registry.register(new UpdateAvailable(deps, {\n+ id: 'angular-cli-update-available',\n+ pkgName: '@angular/cli',\n+ treatmentVisitURL: ['https://github.com/angular/angular-cli/releases'],\n+ }));\n+ registry.register(new MajorUpdateAvailable(deps, {\n+ id: 'angular-cli-major-update-available',\n+ pkgName: '@angular/cli',\n+ treatmentVisitURL: ['https://blog.angular.io', 'https://github.com/angular/angular-cli/releases'],\n+ }));\n+\n+ // @angular-devkit/core\n+ registry.register(new UpdateAvailable(deps, {\n+ id: 'angular-devkit-core-update-available',\n+ pkgName: '@angular-devkit/core',\n+ treatmentVisitURL: ['https://github.com/angular/devkit/releases'],\n+ }));\n+ registry.register(new MajorUpdateAvailable(deps, {\n+ id: 'angular-devkit-core-major-update-available',\n+ pkgName: '@angular-devkit/core',\n+ treatmentVisitURL: ['https://blog.angular.io', 'https://github.com/angular/devkit/releases'],\n+ }));\n+\n+ // @angular-devkit/schematics\n+ registry.register(new UpdateAvailable(deps, {\n+ id: 'angular-devkit-schematics-update-available',\n+ pkgName: '@angular-devkit/schematics',\n+ treatmentVisitURL: ['https://github.com/angular/devkit/releases'],\n+ }));\n+ registry.register(new MajorUpdateAvailable(deps, {\n+ id: 'angular-devkit-schematics-major-update-available',\n+ pkgName: '@angular-devkit/schematics',\n+ treatmentVisitURL: ['https://blog.angular.io', 'https://github.com/angular/devkit/releases'],\n+ }));\n}\ninterface AngularAilmentDeps extends AilmentDeps {\n@@ -23,34 +77,31 @@ export interface AutomaticallyTreatableAngularAilmentDeps extends AutomaticallyT\nproject: AngularProject;\n}\n+export interface AilmentParams {\n+ id: string;\n+ pkgName: string;\n+ treatmentVisitURL: string[];\n+}\n+\nabstract class AngularAilment extends Ailment {\nprotected readonly project: AngularProject;\n+ protected readonly pkgParams: AilmentParams;\n+ currentVersion?: string;\n+ latestVersion?: string;\n- constructor(deps: AngularAilmentDeps) {\n+ constructor(deps: AngularAilmentDeps, pkgParams: AilmentParams) {\nsuper(deps);\n- }\n+ this.pkgParams = pkgParams;\n+ this.pkgParams.treatmentVisitURL = this.pkgParams.treatmentVisitURL.map(url => chalk.bold(url));\n}\n-// abstract class AutomaticallyTreatableAngularAilment extends AutomaticallyTreatableAilment {\n-// protected readonly project: AngularProject;\n-\n-// constructor(deps: AutomaticallyTreatableAngularAilmentDeps) {\n-// super(deps);\n-// }\n-// }\n-\n-class IonicForAngularUpdateAvailable extends AngularAilment {\n- id = 'ionic-for-angular-update-available';\n- currentVersion?: string;\n- latestVersion?: string;\n-\nasync getVersionPair(): Promise<[string, string]> {\nconst config = await this.config.load();\nconst { npmClient } = config;\nif (!this.currentVersion || !this.latestVersion) {\n- this.currentVersion = await this.project.getPackageVersion('@ionic/angular');\n- const pkg = await pkgFromRegistry(npmClient, { pkg: '@ionic/angular' });\n+ this.currentVersion = await this.project.getPackageVersion(this.pkgParams.pkgName);\n+ const pkg = await pkgFromRegistry(npmClient, { pkg: this.pkgParams.pkgName });\nthis.latestVersion = pkg ? pkg.version : undefined;\n}\n@@ -60,13 +111,25 @@ class IonicForAngularUpdateAvailable extends AngularAilment {\nreturn [ this.currentVersion, this.latestVersion ];\n}\n+}\n+\n+// abstract class AutomaticallyTreatableAngularAilment extends AutomaticallyTreatableAilment {\n+// protected readonly project: AngularProject;\n+\n+// constructor(deps: AutomaticallyTreatableAngularAilmentDeps) {\n+// super(deps);\n+// }\n+// }\n+\n+class UpdateAvailable extends AngularAilment {\n+ id = this.pkgParams.id;\nasync getMessage() {\nconst [ currentVersion, latestVersion ] = await this.getVersionPair();\nreturn (\n- `Update available for ${chalk.bold('@ionic/angular')}.\\n` +\n- `An update is available for ${chalk.bold('@ionic/angular')} (${chalk.cyan(currentVersion)} => ${chalk.cyan(latestVersion)}).\\n`\n+ `Update available for ${chalk.bold(this.pkgParams.pkgName)}.\\n` +\n+ `An update is available for ${chalk.bold(this.pkgParams.pkgName)} (${chalk.cyan(currentVersion)} => ${chalk.cyan(latestVersion)}).\\n`\n).trim();\n}\n@@ -81,44 +144,27 @@ class IonicForAngularUpdateAvailable extends AngularAilment {\nconst config = await this.config.load();\nconst { npmClient } = config;\nconst [ , latestVersion ] = await this.getVersionPair();\n- const args = await pkgManagerArgs(npmClient, { command: 'install', pkg: `@ionic/angular@${latestVersion ? latestVersion : 'latest'}` });\n+ const args = await pkgManagerArgs(npmClient, { command: 'install', pkg: this.pkgParams.pkgName + `@${latestVersion ? latestVersion : 'latest'}` });\nreturn [\n- { name: `Visit ${chalk.bold('https://github.com/ionic-team/ionic/releases')} for each upgrade's instructions` },\n+ { name: `Visit ${this.pkgParams.treatmentVisitURL.join(' and ')} for each upgrade's instructions` },\n{ name: `If no instructions, run: ${chalk.green(args.join(' '))}` },\n{ name: `Watch for npm warnings about peer dependencies--they may need manual updating` },\n];\n}\n}\n-class IonicForAngularMajorUpdateAvailable extends AngularAilment {\n- id = 'ionic-for-angular-major-update-available';\n+class MajorUpdateAvailable extends AngularAilment {\n+ id = this.pkgParams.id;\ncurrentVersion?: string;\nlatestVersion?: string;\n- async getVersionPair(): Promise<[string, string]> {\n- const config = await this.config.load();\n- const { npmClient } = config;\n-\n- if (!this.currentVersion || !this.latestVersion) {\n- this.currentVersion = await this.project.getPackageVersion('@ionic/angular');\n- const pkg = await pkgFromRegistry(npmClient, { pkg: '@ionic/angular' });\n- this.latestVersion = pkg ? pkg.version : undefined;\n- }\n-\n- if (!this.currentVersion || !this.latestVersion) {\n- return ['0.0.0', '0.0.0'];\n- }\n-\n- return [ this.currentVersion, this.latestVersion ];\n- }\n-\nasync getMessage() {\nconst [ currentVersion, latestVersion ] = await this.getVersionPair();\nreturn (\n- `Major update available for ${chalk.bold('@ionic/angular')}.\\n` +\n- `A major update is available for ${chalk.bold('@ionic/angular')} (${chalk.cyan(currentVersion)} => ${chalk.cyan(latestVersion)}).\\n`\n+ `Major update available for ${chalk.bold(this.pkgParams.pkgName)}.\\n` +\n+ `A major update is available for ${chalk.bold(this.pkgParams.pkgName)} (${chalk.cyan(currentVersion)} => ${chalk.cyan(latestVersion)}).\\n`\n).trim();\n}\n@@ -131,7 +177,7 @@ class IonicForAngularMajorUpdateAvailable extends AngularAilment {\nasync getTreatmentSteps() {\nreturn [\n- { name: `Visit ${chalk.bold('https://blog.ionicframework.com')} and ${chalk.bold('https://github.com/ionic-team/ionic/releases')} for upgrade instructions` },\n+ { name: `Visit ${this.pkgParams.treatmentVisitURL.join(' and ')} for upgrade instructions` },\n];\n}\n}\n", "new_path": "packages/@ionic/cli-utils/src/lib/project/angular/ailments.ts", "old_path": "packages/@ionic/cli-utils/src/lib/project/angular/ailments.ts" } ]
TypeScript
MIT License
ionic-team/ionic-cli
feat(ailments): add common version check ailment class (#3054)
1
feat
ailments
217,922
03.04.2018 11:56:50
-7,200
9b206cb9a20df71aa611a320ceda1f0dde060797
feat: you can now copy isearch macros for items using the new magnifying glass icon closes
[ { "change_type": "MODIFY", "diff": "{{item.id | itemName | i18n}}\n</span>\n</div>\n- <img src=\"https://ffxiv.gamerescape.com/w/images/thumb/1/18/HQ_Icon.png/14px-HQ_Icon.png\" alt=\"\"\n+ <img src=\"/assets/icons/HQ.png\" alt=\"\"\nmatTooltip=\"{{'Required_for_final_craft' | translate: { amount: requiredForFinalCraft } }}\"\nmatTooltipPosition=\"above\" *ngIf=\"requiredForFinalCraft>0 && !recipe\">\n+\n+ <button matTooltipPosition=\"above\"\n+ matTooltip=\"{{'Copy_isearch' | translate}}\"\n+ mat-icon-button ngxClipboard cbContent=\"/isearch {{item.id | itemName | i18n}}\"\n+ (cbOnSuccess)=\"afterNameCopy(item.id)\"><mat-icon>search</mat-icon></button>\n+\n<app-comments-button [name]=\"item.id | itemName | i18n\" [row]=\"item\" [list]=\"list\"\n[isOwnList]=\"user?.$key === list?.authorId\"\n(updated)=\"update.emit()\"></app-comments-button>\n", "new_path": "src/app/modules/item/item/item.component.html", "old_path": "src/app/modules/item/item/item.component.html" }, { "change_type": "MODIFY", "diff": "@@ -300,6 +300,18 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\n);\n}\n+ public afterIsearchCopy(id: number): void {\n+ this.snackBar.open(\n+ this.translator.instant('Isearch_copied',\n+ {itemname: this.localizedData.getItem(id)[this.translator.currentLang]}),\n+ '',\n+ {\n+ duration: 2000,\n+ extraClasses: ['snack']\n+ }\n+ );\n+ }\n+\nngOnInit(): void {\nthis.updateCanBeCrafted();\nthis.updateHasTimers();\n", "new_path": "src/app/modules/item/item/item.component.ts", "old_path": "src/app/modules/item/item/item.component.ts" }, { "change_type": "MODIFY", "diff": "{\n+ \"Copy_isearch\": \"Copy isearch macro\",\n+ \"Isearch_copied\": \"/isearch {{itemname}} copied to clipboard\",\n\"Required_for_final_craft\": \"{{amount}} needed for final items\",\n\"Compact_sidebar_toggle\": \"Toggle compact sidebar\",\n\"Confirmation\": \"Confirmation\",\n", "new_path": "src/assets/i18n/en.json", "old_path": "src/assets/i18n/en.json" }, { "change_type": "MODIFY", "diff": "{\n+ \"Copy_isearch\": \"Copy isearch macro\",\n+ \"Isearch_copied\": \"/isearch {{itemname}} copied to clipboard\",\n\"Required_for_final_craft\": \"{{amount}} needed for final items\",\n\"Compact_sidebar_toggle\": \"Toggle compact sidebar\",\n\"Confirmation\": \"Confirmation\",\n", "new_path": "src/assets/i18n/ja.json", "old_path": "src/assets/i18n/ja.json" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
feat: you can now copy isearch macros for items using the new magnifying glass icon closes #276
1
feat
null
217,922
03.04.2018 14:50:36
-7,200
ebaa7fe79aade1c58e741f658878f3b737d28fc4
feat: new right-side drawer to show alarm timers no matter which page you're on
[ { "change_type": "MODIFY", "diff": "</button>\n<span class=\"version\">{{version}}</span>\n</mat-toolbar>\n- <mat-sidenav-container [autosize]=\"true\">\n+ <mat-sidenav-container autosize=\"true\">\n<mat-sidenav mode=\"{{mobile ? 'over':'side' }}\" opened=\"{{!mobile}}\" #sidenav [disableClose]=\"!mobile\"\n[ngClass]=\"{'compact': settings.compactSidebar}\">\n<div class=\"accent-background\" *ngIf=\"!settings.compactSidebar\">\n</div>\n</mat-sidenav>\n<div class=\"content\">\n+ <button mat-mini-fab class=\"alarms-sidebar-trigger\"\n+ matTooltip=\"{{'Timers' | translate}}\"\n+ matTooltipPosition=\"left\"\n+ *ngIf=\"!mobile\" (click)=\"timersSidebar.toggle()\"\n+ [ngClass]=\"{'opened': timersSidebar?.opened}\">\n+ <mat-icon *ngIf=\"!timersSidebar?.opened\">alarm</mat-icon>\n+ <mat-icon *ngIf=\"timersSidebar?.opened\">keyboard_arrow_right</mat-icon>\n+ </button>\n<div class=\"content-middle\">\n<router-outlet></router-outlet>\n</div>\n</div>\n+ <mat-sidenav mode=\"side\" position=\"end\" *ngIf=\"!mobile\" #timers>\n+ <app-alarms-sidebar></app-alarms-sidebar>\n+ </mat-sidenav>\n</mat-sidenav-container>\n</div>\n", "new_path": "src/app/app.component.html", "old_path": "src/app/app.component.html" }, { "change_type": "MODIFY", "diff": "}\n.content {\noverflow: auto;\n+ position: relative;\n+ .alarms-sidebar-trigger {\n+ position: fixed;\n+ right: 5px;\n+ bottom: 5px;\n+ transition: right .4s cubic-bezier(0.25, 0.8, 0.25, 1);\n+ &.opened {\n+ right: 255px;\n+ }\n+ }\n.content-middle {\npadding: 10px;\nwidth: 90%;\n", "new_path": "src/app/app.component.scss", "old_path": "src/app/app.component.scss" }, { "change_type": "MODIFY", "diff": "-import {ChangeDetectorRef, Component, OnInit} from '@angular/core';\n+import {ChangeDetectorRef, Component, OnInit, ViewChild} from '@angular/core';\nimport {AngularFireAuth} from 'angularfire2/auth';\nimport {TranslateService} from '@ngx-translate/core';\nimport {NavigationEnd, Router} from '@angular/router';\nimport {AngularFireDatabase} from 'angularfire2/database';\nimport {Observable} from 'rxjs/Observable';\nimport {User} from 'firebase/app';\n-import {MatDialog, MatSnackBar, MatSnackBarRef, SimpleSnackBar} from '@angular/material';\n+import {MatDialog, MatSidenav, MatSnackBar, MatSnackBarRef, SimpleSnackBar} from '@angular/material';\nimport {RegisterPopupComponent} from './modules/common-components/register-popup/register-popup.component';\nimport {LoginPopupComponent} from './modules/common-components/login-popup/login-popup.component';\nimport {CharacterAddPopupComponent} from './modules/common-components/character-add-popup/character-add-popup.component';\n@@ -35,6 +35,9 @@ declare const ga: Function;\n})\nexport class AppComponent implements OnInit {\n+ @ViewChild('timers')\n+ timersSidebar: MatSidenav;\n+\nlocale: string;\nannouncement: string;\n", "new_path": "src/app/app.component.ts", "old_path": "src/app/app.component.ts" }, { "change_type": "MODIFY", "diff": "@@ -56,6 +56,7 @@ import {WorkshopModule} from './pages/workshop/workshop.module';\nimport {CustomLinksModule} from './pages/custom-links/custom-links.module';\nimport {LinkModule} from './pages/link/link.module';\nimport {TemplateModule} from './pages/template/template.module';\n+import {AlarmsSidebarModule} from './modules/alarms-sidebar/alarms-sidebar.module';\nexport function HttpLoaderFactory(http: HttpClient) {\nreturn new TranslateHttpLoader(http);\n@@ -116,6 +117,7 @@ export function HttpLoaderFactory(http: HttpClient) {\nItemModule,\nBetaDisclaimerModule,\nGivewayPopupModule,\n+ AlarmsSidebarModule,\n// Pages\nHomeModule,\n", "new_path": "src/app/app.module.ts", "old_path": "src/app/app.module.ts" }, { "change_type": "ADD", "diff": "+<mat-list-item [ngClass]=\"{'primary-background': spawned, 'accent-background': !spawned && alerted}\">\n+ <img mat-list-avatar src=\"{{alarm.icon | icon}}\" alt=\"\">\n+ <b mat-line>{{alarm.itemId | itemName | i18n}} <span *ngIf=\"alarm.slot\">({{alarm.slot}})</span> </b>\n+ <p mat-line>{{timer}}</p>\n+ <button mat-icon-button (click)=\"openMap()\"\n+ matTooltipPosition=\"above\"\n+ matTooltip=\"{{alarm.zoneId | placeName | i18n}}\">\n+ <mat-icon>my_location</mat-icon>\n+ </button>\n+</mat-list-item>\n", "new_path": "src/app/modules/alarms-sidebar/alarm-sidebar-row/alarm-sidebar-row.component.html", "old_path": null }, { "change_type": "ADD", "diff": "", "new_path": "src/app/modules/alarms-sidebar/alarm-sidebar-row/alarm-sidebar-row.component.scss", "old_path": "src/app/modules/alarms-sidebar/alarm-sidebar-row/alarm-sidebar-row.component.scss" }, { "change_type": "ADD", "diff": "+import {Component, Input} from '@angular/core';\n+import {Alarm} from '../../../core/time/alarm';\n+import {MatDialog} from '@angular/material';\n+import {MapPopupComponent} from '../../map/map-popup/map-popup.component';\n+\n+@Component({\n+ selector: 'app-alarm-sidebar-row',\n+ templateUrl: './alarm-sidebar-row.component.html',\n+ styleUrls: ['./alarm-sidebar-row.component.scss']\n+})\n+export class AlarmSidebarRowComponent {\n+\n+ @Input()\n+ alarm: Alarm;\n+\n+ @Input()\n+ alerted: boolean;\n+\n+ @Input()\n+ spawned: boolean;\n+\n+ @Input()\n+ timer: string;\n+\n+ constructor(private dialog: MatDialog) {\n+ }\n+\n+ openMap(): void {\n+ this.dialog.open(MapPopupComponent, {data: {coords: {x: this.alarm.coords[0], y: this.alarm.coords[1]}, id: this.alarm.zoneId}});\n+ }\n+}\n", "new_path": "src/app/modules/alarms-sidebar/alarm-sidebar-row/alarm-sidebar-row.component.ts", "old_path": null }, { "change_type": "ADD", "diff": "+import {NgModule} from '@angular/core';\n+import {CommonModule} from '@angular/common';\n+import {AlarmsSidebarComponent} from './alarms-sidebar/alarms-sidebar.component';\n+import {AlarmSidebarRowComponent} from './alarm-sidebar-row/alarm-sidebar-row.component';\n+import {CoreModule} from '../../core/core.module';\n+import {MatButtonModule, MatDialogModule, MatIconModule, MatListModule, MatTooltipModule} from '@angular/material';\n+import {CommonComponentsModule} from '../common-components/common-components.module';\n+import {PipesModule} from '../../pipes/pipes.module';\n+import {TranslateModule} from '@ngx-translate/core';\n+\n+@NgModule({\n+ imports: [\n+ CommonModule,\n+ TranslateModule,\n+\n+ CoreModule,\n+\n+ MatListModule,\n+ MatDialogModule,\n+ MatIconModule,\n+ MatButtonModule,\n+ MatTooltipModule,\n+\n+ CommonComponentsModule,\n+ PipesModule,\n+ ],\n+ declarations: [AlarmsSidebarComponent, AlarmSidebarRowComponent],\n+ exports: [AlarmsSidebarComponent]\n+})\n+export class AlarmsSidebarModule {\n+}\n", "new_path": "src/app/modules/alarms-sidebar/alarms-sidebar.module.ts", "old_path": null }, { "change_type": "ADD", "diff": "+<div class=\"title\">\n+ <h3>{{'Timers' | translate}}</h3>\n+</div>\n+<mat-list dense *ngIf=\"alarms$ | async as alarms; else noalarms\">\n+ <div *ngIf=\"alarms.length > 0; else noalarms\">\n+ <div *ngFor=\"let alarm of alarms; trackBy: trackByAlarm; let last = last\">\n+ <mat-divider></mat-divider>\n+ <app-alarm-sidebar-row [alarm]=\"alarm\"\n+ [alerted]=\"alarmService.isAlerted(alarm.itemId) | async\"\n+ [spawned]=\"alarmService.isAlarmSpawned(alarm, time)\"\n+ [timer]=\"alarmService.getAlarmTimerString(alarm, time)\"></app-alarm-sidebar-row>\n+ <mat-divider *ngIf=\"last\"></mat-divider>\n+ </div>\n+ </div>\n+</mat-list>\n+<ng-template #noalarms>\n+ <div class=\"no_alarms\">\n+ <h4>{{'ALARMS.No_alarm' | translate}}</h4>\n+ </div>\n+</ng-template>\n", "new_path": "src/app/modules/alarms-sidebar/alarms-sidebar/alarms-sidebar.component.html", "old_path": null }, { "change_type": "ADD", "diff": "+:host {\n+ .title {\n+ margin-top: 20px;\n+ width: 100%;\n+ text-align: center;\n+ h3{\n+ font-size: 28px;\n+ }\n+ font-size: 28px;\n+ }\n+ .no_alarms {\n+ height: 100%;\n+ width: 100%;\n+ display: flex;\n+ align-items: center;\n+ justify-content: center;\n+ h4 {\n+ font-size: 22px;\n+ opacity: .8;\n+ }\n+ }\n+}\n", "new_path": "src/app/modules/alarms-sidebar/alarms-sidebar/alarms-sidebar.component.scss", "old_path": null }, { "change_type": "ADD", "diff": "+import {Component, OnInit} from '@angular/core';\n+import {AlarmService} from '../../../core/time/alarm.service';\n+import {Alarm} from '../../../core/time/alarm';\n+import {Observable} from 'rxjs/Observable';\n+import {EorzeanTimeService} from '../../../core/time/eorzean-time.service';\n+\n+@Component({\n+ selector: 'app-alarms-sidebar',\n+ templateUrl: './alarms-sidebar.component.html',\n+ styleUrls: ['./alarms-sidebar.component.scss']\n+})\n+export class AlarmsSidebarComponent implements OnInit {\n+\n+ public alarms$: Observable<Alarm[]>;\n+\n+ public time: Date = new Date();\n+\n+ constructor(private alarmService: AlarmService, private etime: EorzeanTimeService) {\n+ }\n+\n+ trackByAlarm(index: number, alarm: Alarm): number {\n+ return alarm.itemId;\n+ }\n+\n+ ngOnInit() {\n+ this.alarms$ = this.etime.getEorzeanTime()\n+ .do(time => this.time = time)\n+ .map(time => {\n+ const alarms: Alarm[] = [];\n+ this.alarmService.alarms.forEach(alarm => {\n+ if (alarms.find(a => a.itemId === alarm.itemId) !== undefined) {\n+ return;\n+ }\n+ const itemAlarms = this.alarmService.alarms.filter(a => a.itemId === alarm.itemId);\n+ alarms.push(this.alarmService.closestAlarm(itemAlarms, time));\n+ });\n+ return alarms.sort((a, b) => {\n+ if (this.alarmService.isAlarmSpawned(a, time)) {\n+ return -1;\n+ }\n+ if (this.alarmService.isAlarmSpawned(b, time)) {\n+ return 1;\n+ }\n+ return this.alarmService.getMinutesBefore(time, a.spawn) < this.alarmService.getMinutesBefore(time, b.spawn) ? -1 : 1;\n+ });\n+ });\n+ }\n+\n+}\n", "new_path": "src/app/modules/alarms-sidebar/alarms-sidebar/alarms-sidebar.component.ts", "old_path": null }, { "change_type": "MODIFY", "diff": "{\n+ \"Timers\": \"Timers\",\n\"Copy_isearch\": \"Copy isearch macro\",\n\"Isearch_copied\": \"/isearch {{itemname}} copied to clipboard\",\n\"Required_for_final_craft\": \"{{amount}} needed for final items\",\n\"Total\": \"Total\"\n},\n\"ALARMS\": {\n- \"No_alarm\": \"No alarm set\",\n+ \"No_alarm\": \"No alarms set\",\n\"Add_alarm\": \"Add alarm\"\n},\n\"Item_name\": \"Item name\",\n", "new_path": "src/assets/i18n/en.json", "old_path": "src/assets/i18n/en.json" }, { "change_type": "MODIFY", "diff": "{\n+ \"Timers\": \"Timers\",\n\"Copy_isearch\": \"Copy isearch macro\",\n\"Isearch_copied\": \"/isearch {{itemname}} copied to clipboard\",\n\"Required_for_final_craft\": \"{{amount}} needed for final items\",\n", "new_path": "src/assets/i18n/ja.json", "old_path": "src/assets/i18n/ja.json" }, { "change_type": "ADD", "diff": "Binary files /dev/null and b/src/assets/icons/HQ.png differ\n", "new_path": "src/assets/icons/HQ.png", "old_path": "src/assets/icons/HQ.png" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
feat: new right-side drawer to show alarm timers no matter which page you're on
1
feat
null
217,922
03.04.2018 15:24:35
-7,200
ce1c7116234f5170aad2b984db21a2d41c7c34dc
chore: little announcement tweak
[ { "change_type": "MODIFY", "diff": "@@ -137,7 +137,7 @@ export class AppComponent implements OnInit {\nlastLS = '{}';\n}\nconst last = JSON.parse(lastLS || '{}');\n- if (last.text !== announcement.text && last.link !== announcement.link) {\n+ if (last.text !== announcement.text) {\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: little announcement tweak
1
chore
null
679,913
03.04.2018 17:12:42
-3,600
9c91dc3480469ca8b2205f17eee55c7f0d0aa2bd
fix(examples): minor update pointfree-svg example
[ { "change_type": "MODIFY", "diff": "@@ -57,7 +57,7 @@ const usersrc = `\ngrid circlegrid\n( create SVG root element in hiccup format )\n-[@@svg.svgdoc {width: 200, height: 200, stroke: \"#f04\", fill: \"none\"}]\n+[@svg.svgdoc {width: 200, height: 200, stroke: \"#f04\", fill: \"none\"}]\n( concat with generated shapes )\n@shapes cat\n( serialize hiccup format to SVG and write to disk )\n", "new_path": "examples/pointfree-svg/src/index.ts", "old_path": "examples/pointfree-svg/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
fix(examples): minor update pointfree-svg example
1
fix
examples
217,888
03.04.2018 18:34:53
-10,800
9e5001ad0d47adac063ddbb48ad8d946af8be47a
fix: isearch value quotes
[ { "change_type": "MODIFY", "diff": "<button matTooltipPosition=\"above\"\nmatTooltip=\"{{'Copy_isearch' | translate}}\"\n- mat-icon-button ngxClipboard cbContent=\"/isearch {{item.id | itemName | i18n}}\"\n+ mat-icon-button ngxClipboard cbContent=\"/isearch &quot;{{item.id | itemName | i18n}}&quot;\"\n(cbOnSuccess)=\"afterNameCopy(item.id)\"><mat-icon>search</mat-icon></button>\n<app-comments-button [name]=\"item.id | itemName | i18n\" [row]=\"item\" [list]=\"list\"\n", "new_path": "src/app/modules/item/item/item.component.html", "old_path": "src/app/modules/item/item/item.component.html" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix: isearch value quotes
1
fix
null
311,007
04.04.2018 06:49:45
-32,400
32a6baf2db98ed594c0d43cd0bfa0202317ed543
feat(info): remove from version check
[ { "change_type": "MODIFY", "diff": "@@ -21,14 +21,12 @@ export class Project extends BaseProject {\nasync getInfo(): Promise<InfoItem[]> {\nconst [\nionicAngularVersion,\n- ionicCoreVersion,\nionicSchematicsAngularVersion,\nangularCLIVersion,\nangularDevKitCoreVersion,\nangularDevKitSchematicsVersion,\n] = await Promise.all([\nthis.getPackageVersion('@ionic/angular'),\n- this.getPackageVersion('@ionic/core'),\nthis.getPackageVersion('@ionic/schematics-angular'),\nthis.getPackageVersion('@angular/cli'),\nthis.getPackageVersion('@angular-devkit/core'),\n@@ -38,7 +36,6 @@ export class Project extends BaseProject {\nreturn [\n...(await super.getInfo()),\n{ type: 'local-packages', key: 'Ionic Framework', value: ionicAngularVersion ? `@ionic/angular ${ionicAngularVersion}` : 'not installed' },\n- { type: 'local-packages', key: '@ionic/core', value: ionicCoreVersion ? ionicCoreVersion : 'not installed' },\n{ type: 'local-packages', key: '@ionic/schematics-angular', value: ionicSchematicsAngularVersion ? ionicSchematicsAngularVersion : 'not installed' },\n{ type: 'local-packages', key: '@angular/cli', value: angularCLIVersion ? angularCLIVersion : 'not installed' },\n{ type: 'local-packages', key: '@angular-devkit/core', value: angularDevKitCoreVersion ? angularDevKitCoreVersion : 'not installed' },\n", "new_path": "packages/@ionic/cli-utils/src/lib/project/angular/index.ts", "old_path": "packages/@ionic/cli-utils/src/lib/project/angular/index.ts" } ]
TypeScript
MIT License
ionic-team/ionic-cli
feat(info): remove @ionic/core from version check (#3057)
1
feat
info
821,196
04.04.2018 07:06:24
25,200
12869c4c0e66f7be8e9b1f70d06de71aa15e0b01
fix: show ts path in example command instead of js path
[ { "change_type": "MODIFY", "diff": "@@ -34,7 +34,7 @@ class CommandGenerator extends Generator {\nlet bin = this.pjson.oclif.bin || this.pjson.oclif.dirname || this.pjson.name\nif (bin.includes('/')) bin = bin.split('/').pop()\nconst cmd = `${bin} ${this.options.name}`\n- const opts = {...this.options, bin, cmd, _, type: 'command'}\n+ const opts = {...this.options, bin, cmd, _, type: 'command', path: this._path}\nthis.fs.copyTpl(this.templatePath(`src/command.${this._ext}.ejs`), this.destinationPath(`src/commands/${this._path}.${this._ext}`), opts)\n// this.fs.copyTpl(this.templatePath(`plugin/src/hooks/init.${this._ext}`), this.destinationPath(`src/hooks/init.${this._ext}`), this)\nif (this._mocha) {\n", "new_path": "src/generators/command.ts", "old_path": "src/generators/command.ts" }, { "change_type": "MODIFY", "diff": "@@ -33,7 +33,7 @@ hello world from ./src/<%- name %>.ts!\nconst {args, flags} = this.parse(<%- klass %>)\nconst name = flags.name || 'world'\n- this.log(`hello ${name} from ${__filename}!`)\n+ this.log(`hello ${name} from ./src/<%- path %>.ts!`)\nif (args.file && flags.force) {\nthis.log(`you input --force and --file: ${args.file}`)\n}\n", "new_path": "templates/src/command.ts.ejs", "old_path": "templates/src/command.ts.ejs" } ]
TypeScript
MIT License
oclif/oclif
fix: show ts path in example command instead of js path
1
fix
null
821,196
04.04.2018 07:07:11
25,200
147a317758f3dbc0101c5c2770f9cda09b6b6caf
fix: only show examples if generating hello command
[ { "change_type": "MODIFY", "diff": "@@ -8,12 +8,14 @@ export default class <%- klass %> extends Command {\n<%_ } _%>\nstatic description = 'describe the command here'\n+<%_ if (name === 'hello') { _%>\nstatic examples = [\n`$ <%- cmd %>\nhello world from ./src/<%- name %>.ts!\n`,\n]\n+<%_ } _%>\nstatic flags = {\n<%_ if (type === 'single') { _%>\n// add --version flag to show CLI version\n", "new_path": "templates/src/command.ts.ejs", "old_path": "templates/src/command.ts.ejs" } ]
TypeScript
MIT License
oclif/oclif
fix: only show examples if generating hello command
1
fix
null
821,196
04.04.2018 07:14:04
25,200
2d8b964a67420048779a92b35436a704fdd9f9ac
fix: fixed commands directory in example
[ { "change_type": "MODIFY", "diff": "@@ -35,7 +35,7 @@ hello world from ./src/<%- name %>.ts!\nconst {args, flags} = this.parse(<%- klass %>)\nconst name = flags.name || 'world'\n- this.log(`hello ${name} from ./src/<%- path %>.ts!`)\n+ this.log(`hello ${name} from ./src/commands/<%- path %>.ts!`)\nif (args.file && flags.force) {\nthis.log(`you input --force and --file: ${args.file}`)\n}\n", "new_path": "templates/src/command.ts.ejs", "old_path": "templates/src/command.ts.ejs" } ]
TypeScript
MIT License
oclif/oclif
fix: fixed commands directory in example
1
fix
null
815,746
04.04.2018 10:52:05
-10,800
b2c5cf3100c7d83db9a375695602b9e7105fb9e0
feat: searchFn support for multiple fields closes closes
[ { "change_type": "MODIFY", "diff": "@@ -144,6 +144,7 @@ map: {\n| notFoundText | `string` | `No items found` | no | Set custom text when filter returns empty result |\n| placeholder | `string` | `-` | no | Placeholder text. |\n| [searchable] | `boolean` | `true` | no | Allow to search for value. Default `true`|\n+| [searchFn] | `(term: string, item: any) => boolean` | `null` | no | Allow to search by custom search function expression |\n| [selectOnTab] | `boolean` | `false` | no | Select marked dropdown item using tab. Default `false`|\n| [typeahead] | `Subject` | `-` | no | Custom autocomplete or filter. |\n| typeToSearchText | `string` | `Type to search` | no | Set custom text when using Typeahead |\n", "new_path": "README.md", "old_path": "README.md" }, { "change_type": "MODIFY", "diff": "import { Component, EventEmitter, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';\nimport { distinctUntilChanged, debounceTime, switchMap } from 'rxjs/operators'\n-import { DataService } from '../shared/data.service';\n+import { DataService, Person } from '../shared/data.service';\n+\n@Component({\nselector: 'select-search',\n@@ -21,16 +22,20 @@ import { DataService } from '../shared/data.service';\n---\n<br/>\n- <h5>Search across multiple fields</h5>\n+ <h5>Search across multiple fields using <b>[searchFn]</b></h5>\n<hr>\n<p>Use <b>typeahead</b> to get search term and filter on custom fields. Type <b>female</b> to see only females.</p>\n---html,true\n<ng-select [items]=\"peopleFiltered\"\nbindLabel=\"name\"\n- [typeahead]=\"searchTerm\"\n+ [searchFn]=\"customSearchFn\"\n(close)=\"peopleFiltered = people\"\n[(ngModel)]=\"selectedCustom\">\n+ <ng-template ng-option-tmp let-item=\"item\">\n+ {{item.name}} <br />\n+ <small>{{item.gender}}</small>\n+ </ng-template>\n</ng-select>\n---\n<br/>\n@@ -58,15 +63,14 @@ import { DataService } from '../shared/data.service';\n})\nexport class SelectSearchComponent {\n- people = [];\n+ people: Person[] = [];\npeopleFiltered = [];\nserverSideFilterItems = [];\n- searchTerm = new EventEmitter<string>();\npeopleTypeahead = new EventEmitter<string>();\n- selectedPersons = [{name: 'Karyn Wright'}, {name: 'Other'}];\n- selectedPerson: any;\n- selectedCustom: any;\n+ selectedPersons: Person[] = <any>[{name: 'Karyn Wright'}, {name: 'Other'}];\n+ selectedPerson: Person;\n+ selectedCustom: Person;\npeopleLoading = false;\n@@ -75,12 +79,11 @@ export class SelectSearchComponent {\nngOnInit() {\nthis.loadPeopleForClientSide();\nthis.serverSideSearch();\n- this.searchTerm.subscribe(term => this.customSearch(term));\n}\n- private customSearch(searchTerm) {\n- const term = searchTerm.toUpperCase();\n- this.peopleFiltered = this.people.filter(item => item.name.toUpperCase().indexOf(term) > -1 || item.gender.toUpperCase() === term)\n+ customSearchFn(term: string, item: Person) {\n+ term = term.toLocaleLowerCase();\n+ return item.name.toLocaleLowerCase().indexOf(term) > -1 || item.gender.toLocaleLowerCase() === term;\n}\nprivate serverSideSearch() {\n", "new_path": "demo/app/examples/search.component.ts", "old_path": "demo/app/examples/search.component.ts" }, { "change_type": "MODIFY", "diff": "\"@angular/platform-browser\": \"^5.0.3\",\n\"@angular/platform-browser-dynamic\": \"^5.0.3\",\n\"@angular/router\": \"^5.0.3\",\n- \"tsickle\": \">=0.25.5\",\n- \"tslib\": \"^1.7.1\",\n- \"@ng-bootstrap/ng-bootstrap\": \"^1.0.0-beta.5\",\n+ \"@ng-bootstrap/ng-bootstrap\": \"^1.1.0\",\n\"@types/jasmine\": \"^2.5.36\",\n\"@types/node\": \"^6.0.87\",\n\"@types/selenium-webdriver\": \"2.53.39\",\n\"istanbul-instrumenter-loader\": \"^0.2.0\",\n\"jasmine-core\": \"^2.7.0\",\n\"jasmine-spec-reporter\": \"^3.2.0\",\n+ \"jquery\": \"^3.3.1\",\n\"json-loader\": \"^0.5.7\",\n\"karma\": \"^1.5.0\",\n\"karma-chrome-launcher\": \"^2.0.0\",\n\"ng-snippets-loader\": \"^0.2.5\",\n\"node-sass\": \"^4.0.0\",\n\"null-loader\": \"0.1.1\",\n+ \"popper.js\": \"^1.14.2\",\n\"postcss-loader\": \"^1.1.0\",\n\"protractor\": \"^4.0.10\",\n\"raw-loader\": \"0.5.1\",\n\"standard-version\": \"^4.2.0\",\n\"style-loader\": \"^0.13.0\",\n\"ts-helpers\": \"^1.1.1\",\n+ \"tsickle\": \">=0.25.5\",\n+ \"tslib\": \"^1.7.1\",\n\"tslint\": \"^5.6.0\",\n\"tslint-loader\": \"^3.5.3\",\n\"typedoc\": \"^0.5.1\",\n\"zone.js\": \"^0.8.16\"\n},\n\"dependencies\": {\n- \"bootstrap\": \"4.0.0-beta.2\"\n+ \"bootstrap\": \"^4.0.0\"\n}\n}\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "@@ -122,16 +122,17 @@ export class ItemsList {\n}\nthis._filteredItems = [];\n- term = searchHelper.stripSpecialChars(term).toLocaleLowerCase();\n+ term = this._ngSelect.searchFn ? term : searchHelper.stripSpecialChars(term).toLocaleLowerCase();\n+ const match = this._ngSelect.searchFn || this._defaultSearchFn;\nfor (const key of Object.keys(this._groups)) {\nconst matchedItems = [];\nfor (const item of this._groups[key]) {\n- const label = searchHelper.stripSpecialChars(item.label).toLocaleLowerCase();\nif (this._ngSelect.hideSelected && this._selected.indexOf(item) > -1) {\ncontinue;\n}\n- if (label.indexOf(term) > -1) {\n+ const searchItem = this._ngSelect.searchFn ? item.value : item;\n+ if (match(term, searchItem)) {\nmatchedItems.push(item);\n}\n}\n@@ -227,6 +228,11 @@ export class ItemsList {\n}\n}\n+ private _defaultSearchFn(search: string, opt: NgOption) {\n+ const label = searchHelper.stripSpecialChars(opt.label).toLocaleLowerCase();\n+ return label.indexOf(search) > -1\n+ }\n+\nprivate _getNextItemIndex(steps: number) {\nif (steps > 0) {\nreturn (this._markedIndex === this._filteredItems.length - 1) ? 0 : (this._markedIndex + 1);\n", "new_path": "src/ng-select/items-list.ts", "old_path": "src/ng-select/items-list.ts" }, { "change_type": "MODIFY", "diff": "@@ -1716,6 +1716,32 @@ describe('NgSelectComponent', function () {\nexpect(fixture.componentInstance.select.itemsList.filteredItems).toEqual(result);\n}));\n+ it('should filter using custom searchFn', fakeAsync(() => {\n+ const fixture = createTestingModule(\n+ NgSelectTestCmp,\n+ `<ng-select [items]=\"cities\"\n+ bindLabel=\"name\"\n+ [searchFn]=\"searchFn\"\n+ [(ngModel)]=\"selectedCity\">\n+ </ng-select>`);\n+\n+ fixture.componentInstance.searchFn = (term: string, item: any) => {\n+ return item.name.indexOf(term) > -1 || item.id === 2;\n+ };\n+ const select = fixture.componentInstance.select;\n+ tickAndDetectChanges(fixture);\n+ select.filter('Vilnius');\n+ tick(200);\n+\n+ expect(select.itemsList.filteredItems.length).toEqual(2);\n+ expect(select.itemsList.filteredItems[0]).toEqual(jasmine.objectContaining({\n+ value: { id: 1, name: 'Vilnius' }\n+ }));\n+ expect(select.itemsList.filteredItems[1]).toEqual(jasmine.objectContaining({\n+ value: { id: 2, name: 'Kaunas' }\n+ }));\n+ }));\n+\nit('should toggle dropdown when searchable false', fakeAsync(() => {\nconst fixture = createTestingModule(\nNgSelectTestCmp,\n@@ -2338,9 +2364,9 @@ class NgSelectTestCmp {\ndropdownPosition = 'bottom';\nvisible = true;\nfilter = new Subject<string>();\n+ searchFn: (term: string, item: any) => boolean = null;\nselectOnTab = true;\n-\ncitiesLoading = false;\nselectedCityId: number;\nselectedCityIds: number[];\n", "new_path": "src/ng-select/ng-select.component.spec.ts", "old_path": "src/ng-select/ng-select.component.spec.ts" }, { "change_type": "MODIFY", "diff": "@@ -93,6 +93,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n@Input() bufferAmount = 4;\n@Input() virtualScroll = false;\n@Input() selectableGroup = false;\n+ @Input() searchFn = null;\n@Input() @HostBinding('class.typeahead') typeahead: Subject<string>;\n@Input() @HostBinding('class.ng-multiple') multiple = false;\n@Input() @HostBinding('class.taggable') addTag: boolean | AddTagFn = false;\n", "new_path": "src/ng-select/ng-select.component.ts", "old_path": "src/ng-select/ng-select.component.ts" }, { "change_type": "MODIFY", "diff": "dependencies:\ntslib \"^1.7.1\"\n-\"@ng-bootstrap/ng-bootstrap@^1.0.0-beta.5\":\n- version \"1.0.0-beta.5\"\n- resolved \"https://registry.yarnpkg.com/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-1.0.0-beta.5.tgz#da2b9066b3701a284cac5a16168a77def947b4ab\"\n+\"@ng-bootstrap/ng-bootstrap@^1.1.0\":\n+ version \"1.1.0\"\n+ resolved \"https://registry.yarnpkg.com/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-1.1.0.tgz#75db728d168aeb0d1e0f4ecf17fcaec180dac0d3\"\n\"@ngtools/json-schema@^1.1.0\":\nversion \"1.1.0\"\n@@ -614,9 +614,9 @@ boom@5.x.x:\ndependencies:\nhoek \"4.x.x\"\n-bootstrap@4.0.0-beta.2:\n- version \"4.0.0-beta.2\"\n- resolved \"https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.0.0-beta.2.tgz#4d67d2aa2219f062cd90bc1247e6747b9e8fd051\"\n+bootstrap@^4.0.0:\n+ version \"4.0.0\"\n+ resolved \"https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.0.0.tgz#ceb03842c145fcc1b9b4e15da2a05656ba68469a\"\nbrace-expansion@^1.0.0, brace-expansion@^1.1.7:\nversion \"1.1.8\"\n@@ -3359,6 +3359,10 @@ jasminewd2@0.0.10:\nversion \"0.0.10\"\nresolved \"https://registry.yarnpkg.com/jasminewd2/-/jasminewd2-0.0.10.tgz#94f48ae2bc946cad643035467b4bb7ea9c1075ef\"\n+jquery@^3.3.1:\n+ version \"3.3.1\"\n+ resolved \"https://registry.yarnpkg.com/jquery/-/jquery-3.3.1.tgz#958ce29e81c9790f31be7792df5d4d95fc57fbca\"\n+\njs-base64@^2.1.8, js-base64@^2.1.9:\nversion \"2.3.2\"\nresolved \"https://registry.yarnpkg.com/js-base64/-/js-base64-2.3.2.tgz#a79a923666372b580f8e27f51845c6f7e8fbfbaf\"\n@@ -4671,6 +4675,10 @@ pinkie@^2.0.0:\nversion \"2.0.4\"\nresolved \"https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870\"\n+popper.js@^1.14.2:\n+ version \"1.14.2\"\n+ resolved \"https://registry.yarnpkg.com/popper.js/-/popper.js-1.14.2.tgz#066e8e1613e65e69ba050f4b78e7bd4c8d54e443\"\n+\nportfinder@^1.0.9:\nversion \"1.0.13\"\nresolved \"https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.13.tgz#bb32ecd87c27104ae6ee44b5a3ccbf0ebb1aede9\"\n", "new_path": "yarn.lock", "old_path": "yarn.lock" } ]
TypeScript
MIT License
ng-select/ng-select
feat: searchFn support for multiple fields (#410) closes #387 closes #167
1
feat
null
815,746
04.04.2018 13:10:37
-10,800
f9c3d3bbbddd385d78d75ab4496ed91d35c8f672
chore(release): 0.35.0
[ { "change_type": "MODIFY", "diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"0.35.0\"></a>\n+# [0.35.0](https://github.com/ng-select/ng-select/compare/v0.34.3...v0.35.0) (2018-04-04)\n+\n+\n+### Features\n+\n+* searchFn support for multiple fields ([#410](https://github.com/ng-select/ng-select/issues/410)) ([b2c5cf3](https://github.com/ng-select/ng-select/commit/b2c5cf3)), closes [#387](https://github.com/ng-select/ng-select/issues/387) [#167](https://github.com/ng-select/ng-select/issues/167)\n+\n+\n+\n<a name=\"0.34.3\"></a>\n## [0.34.3](https://github.com/ng-select/ng-select/compare/v0.34.2...v0.34.3) (2018-03-31)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"$schema\": \"../node_modules/ng-packagr/package.schema.json\",\n\"name\": \"@ng-select/ng-select\",\n- \"version\": \"0.34.3\",\n+ \"version\": \"0.35.0\",\n\"description\": \"Angular ng-select - All in One UI Select, Multiselect and Autocomplete\",\n\"author\": \"@ng-select/ng-select\",\n\"license\": \"MIT\",\n", "new_path": "src/package.json", "old_path": "src/package.json" } ]
TypeScript
MIT License
ng-select/ng-select
chore(release): 0.35.0
1
chore
release
679,913
04.04.2018 13:46:06
-3,600
bffc44306396ee55cb81514b50a70887877bdabe
fix(checks): add prototype check for isPlainObject(), add tests
[ { "change_type": "MODIFY", "diff": "+/**\n+ * Similar to `isObject()`, but also checks if prototype is that of\n+ * `Object` (or `null`).\n+ *\n+ * @param x\n+ */\nexport function isPlainObject(x: any): x is Object {\n- return Object.prototype.toString.call(x) === \"[object Object]\";\n+ let proto;\n+ return Object.prototype.toString.call(x) === \"[object Object]\" &&\n+ (proto = Object.getPrototypeOf(x), proto === null || proto === Object.getPrototypeOf({}));\n}\n", "new_path": "packages/checks/src/is-plain-object.ts", "old_path": "packages/checks/src/is-plain-object.ts" }, { "change_type": "MODIFY", "diff": "@@ -13,6 +13,7 @@ import { isTransferable } from \"../src/is-transferable\";\nimport { isTypedArray } from \"../src/is-typedarray\";\ndescribe(\"checks\", function () {\n+\nit(\"existsAndNotNull\", () => {\nassert(existsAndNotNull([]), \"empty array\");\nassert(existsAndNotNull(new Uint8Array(1)), \"typedarray\");\n@@ -23,6 +24,7 @@ describe(\"checks\", function () {\nassert(!existsAndNotNull(null), \"null\");\nassert(!existsAndNotNull(undefined), \"null\");\n});\n+\nit(\"isArray\", () => {\nassert(isArray([]), \"empty array\");\nassert(!isArray(new Uint8Array(1)), \"typedarray\");\n@@ -32,6 +34,7 @@ describe(\"checks\", function () {\nassert(!isArray(null), \"null\");\nassert(!isArray(undefined), \"null\");\n});\n+\nit(\"isTypedArray\", () => {\nassert(isTypedArray(new Uint8Array(1)), \"u8\");\nassert(isTypedArray(new Uint8ClampedArray(1)), \"u8c\");\n@@ -49,6 +52,7 @@ describe(\"checks\", function () {\nassert(!isTypedArray(null), \"null\");\nassert(!isTypedArray(undefined), \"null\");\n});\n+\nit(\"isArrayLike\", () => {\nassert(isArrayLike([]), \"empty array\");\nassert(isArrayLike(new Uint8Array(1)), \"typedarray\");\n@@ -59,18 +63,26 @@ describe(\"checks\", function () {\nassert(!isArrayLike(null), \"null\");\nassert(!isArrayLike(undefined), \"null\");\n});\n+\nit(\"isObject\", () => {\n+ function Foo() { };\nassert(isObject([]), \"empty array\");\nassert(isObject(new Uint8Array(1)), \"typedarray\");\nassert(isObject({}), \"obj\");\n+ assert(isObject(new Foo()), \"class\");\n+ assert(!isObject(Foo), \"fn\");\nassert(!isObject(\"[]\"), \"string\");\nassert(!isObject(0), \"zero\");\nassert(!isObject(null), \"null\");\nassert(!isObject(undefined), \"null\");\n});\n+\nit(\"isPlainObject\", () => {\n+ function Foo() { };\nassert(isPlainObject({}), \"obj\");\nassert(isPlainObject(new Object()), \"obj ctor\");\n+ assert(!isPlainObject(Foo), \"fn\");\n+ assert(!isPlainObject(new Foo()), \"class\");\nassert(!isPlainObject([]), \"empty array\");\nassert(!isPlainObject(new Uint8Array(1)), \"typedarray\");\nassert(!isPlainObject(\"[]\"), \"string\");\n@@ -78,6 +90,7 @@ describe(\"checks\", function () {\nassert(!isPlainObject(null), \"null\");\nassert(!isPlainObject(undefined), \"null\");\n});\n+\nit(\"isString\", () => {\nassert(isString(\"\"), \"empty string\");\nassert(isString(\"a\"), \"empty string\");\n@@ -88,6 +101,7 @@ describe(\"checks\", function () {\nassert(!isString(null), \"null\");\nassert(!isString(undefined), \"null\");\n});\n+\nit(\"isFunction\", () => {\nassert(isFunction((_) => null), \"fn\");\nassert(isFunction(Uint8Array), \"ctor\");\n@@ -100,6 +114,7 @@ describe(\"checks\", function () {\nassert(!isFunction(null), \"null\");\nassert(!isFunction(undefined), \"undefined\");\n});\n+\nit(\"implementsFunction\", () => {\nassert(implementsFunction({ a: () => true }, \"a\"), \"obj\");\nassert(implementsFunction([], Symbol.iterator), \"arr iterator\");\n@@ -108,6 +123,7 @@ describe(\"checks\", function () {\nassert(!implementsFunction(null, Symbol.iterator), \"null\");\nassert(!implementsFunction(undefined, Symbol.iterator), \"undefined\");\n});\n+\nit(\"isSymbol\", () => {\nassert(isSymbol(Symbol.iterator), \"iterator\");\nassert(!isSymbol(\"iterator\"), \"string\");\n@@ -115,6 +131,7 @@ describe(\"checks\", function () {\nassert(!isFunction(null), \"null\");\nassert(!isFunction(undefined), \"undefined\");\n});\n+\nit(\"isTransferable\", () => {\nassert(isTransferable(new ArrayBuffer(4)), \"arraybuffer\");\nassert(!isTransferable(new Uint8Array(4)), \"typedarray\");\n@@ -124,4 +141,5 @@ describe(\"checks\", function () {\nassert(!isTransferable(null), \"null\");\nassert(!isTransferable(undefined), \"undefined\");\n});\n+\n});\n", "new_path": "packages/checks/test/index.ts", "old_path": "packages/checks/test/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
fix(checks): add prototype check for isPlainObject(), add tests
1
fix
checks
791,875
04.04.2018 21:43:37
-10,800
90023e3d7badfde22afe8cfd7947fe4ce668ced8
report: fix audit description typos
[ { "change_type": "MODIFY", "diff": "@@ -22,7 +22,7 @@ class UnusedCSSRules extends ByteEfficiencyAudit {\nscoreDisplayMode: ByteEfficiencyAudit.SCORING_MODES.NUMERIC,\nhelpText: 'Remove unused rules from stylesheets to reduce unnecessary ' +\n'bytes consumed by network activity. ' +\n- '[Learn more](https://developers.google.com/speed/docs/insights/OptimizeCSSDelivery)',\n+ '[Learn more](https://developers.google.com/speed/docs/insights/OptimizeCSSDelivery).',\nrequiredArtifacts: ['CSSUsage', 'URL', 'devtoolsLogs'],\n};\n}\n", "new_path": "lighthouse-core/audits/byte-efficiency/unused-css-rules.js", "old_path": "lighthouse-core/audits/byte-efficiency/unused-css-rules.js" }, { "change_type": "MODIFY", "diff": "@@ -17,7 +17,7 @@ class PasswordInputsCanBePastedIntoAudit extends Audit {\ndescription: 'Allows users to paste into password fields',\nfailureDescription: 'Prevents users to paste into password fields',\nhelpText: 'Preventing password pasting undermines good security policy. ' +\n- '[Learn more](https://www.ncsc.gov.uk/blog-post/let-them-paste-passwords)',\n+ '[Learn more](https://www.ncsc.gov.uk/blog-post/let-them-paste-passwords).',\nrequiredArtifacts: ['PasswordInputsWithPreventedPaste'],\n};\n}\n", "new_path": "lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js", "old_path": "lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js" }, { "change_type": "MODIFY", "diff": "@@ -22,7 +22,7 @@ class UsesRelPreloadAudit extends Audit {\ndescription: 'Preload key requests',\ninformative: true,\nhelpText: 'Consider using <link rel=preload> to prioritize fetching late-discovered ' +\n- 'resources sooner [Learn more](https://developers.google.com/web/updates/2016/03/link-rel-preload).',\n+ 'resources sooner. [Learn more](https://developers.google.com/web/updates/2016/03/link-rel-preload).',\nrequiredArtifacts: ['devtoolsLogs', 'traces'],\nscoreDisplayMode: Audit.SCORING_MODES.NUMERIC,\n};\n", "new_path": "lighthouse-core/audits/uses-rel-preload.js", "old_path": "lighthouse-core/audits/uses-rel-preload.js" }, { "change_type": "MODIFY", "diff": "\"informative\": true,\n\"name\": \"uses-rel-preload\",\n\"description\": \"Preload key requests\",\n- \"helpText\": \"Consider using <link rel=preload> to prioritize fetching late-discovered resources sooner [Learn more](https://developers.google.com/web/updates/2016/03/link-rel-preload).\",\n+ \"helpText\": \"Consider using <link rel=preload> to prioritize fetching late-discovered resources sooner. [Learn more](https://developers.google.com/web/updates/2016/03/link-rel-preload).\",\n\"details\": {\n\"type\": \"table\",\n\"headings\": [],\n\"informative\": true,\n\"name\": \"unused-css-rules\",\n\"description\": \"Unused CSS rules\",\n- \"helpText\": \"Remove unused rules from stylesheets to reduce unnecessary bytes consumed by network activity. [Learn more](https://developers.google.com/speed/docs/insights/OptimizeCSSDelivery)\",\n+ \"helpText\": \"Remove unused rules from stylesheets to reduce unnecessary bytes consumed by network activity. [Learn more](https://developers.google.com/speed/docs/insights/OptimizeCSSDelivery).\",\n\"details\": {\n\"type\": \"table\",\n\"headings\": [],\n\"scoreDisplayMode\": \"binary\",\n\"name\": \"password-inputs-can-be-pasted-into\",\n\"description\": \"Prevents users to paste into password fields\",\n- \"helpText\": \"Preventing password pasting undermines good security policy. [Learn more](https://www.ncsc.gov.uk/blog-post/let-them-paste-passwords)\",\n+ \"helpText\": \"Preventing password pasting undermines good security policy. [Learn more](https://www.ncsc.gov.uk/blog-post/let-them-paste-passwords).\",\n\"details\": {\n\"type\": \"table\",\n\"headings\": [\n", "new_path": "lighthouse-core/test/results/sample_v2.json", "old_path": "lighthouse-core/test/results/sample_v2.json" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
report: fix audit description typos (#4882)
1
report
null
679,913
04.04.2018 21:57:26
-3,600
72a96130e49bd59600808fd3097476ae4b762606
feat(examples): add rstream-dataflow example
[ { "change_type": "ADD", "diff": "+node_modules\n+yarn.lock\n+*.js\n", "new_path": "examples/rstream-dataflow/.gitignore", "old_path": null }, { "change_type": "ADD", "diff": "+# rstream-dataflow\n+\n+[Live demo](http://demo.thi.ng/umbrella/rstream-dataflow/)\n+\n+```\n+git clone https://github.com/thi-ng/umbrella.git\n+cd umbrella/examples/rstream-dataflow\n+yarn install\n+yarn start\n+```\n", "new_path": "examples/rstream-dataflow/README.md", "old_path": null }, { "change_type": "ADD", "diff": "+<!DOCTYPE html>\n+<html lang=\"en\">\n+\n+<head>\n+ <meta charset=\"UTF-8\">\n+ <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=no\">\n+ <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n+ <title>rstream-dataflow</title>\n+ <link href=\"https://unpkg.com/tachyons@4.9.1/css/tachyons.min.css\" rel=\"stylesheet\">\n+ <style>\n+ * {\n+ user-select: none;\n+ }\n+\n+ *::selection {\n+ background: none;\n+ }\n+ </style>\n+</head>\n+\n+<body class=\"sans-serif\">\n+ <div id=\"app\" class=\"vw-100 vh-100 ma0 pa0\"></div>\n+ <div class=\"absolute bottom-1 right-1 lh-copy tr\">@thi.ng/rstream dataflow graph\n+ <br>Click & drag mouse / touch anywhere\n+ <br>\n+ <a href=\"https://github.com/thi-ng/umbrella/tree/master/examples/rstream-dataflow/\">Source</a>\n+ </div>\n+ <script type=\"text/javascript\" src=\"bundle.js\"></script>\n+</body>\n+\n+</html>\n\\ No newline at end of file\n", "new_path": "examples/rstream-dataflow/index.html", "old_path": null }, { "change_type": "ADD", "diff": "+{\n+ \"name\": \"rstream-dataflow\",\n+ \"version\": \"0.0.1\",\n+ \"repository\": \"https://github.com/thi-ng/umbrella\",\n+ \"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n+ \"license\": \"Apache-2.0\",\n+ \"scripts\": {\n+ \"build\": \"webpack --mode production\",\n+ \"start\": \"webpack-dev-server --open --mode development --devtool inline-source-map\"\n+ },\n+ \"devDependencies\": {\n+ \"ts-loader\": \"^4.1.0\",\n+ \"typescript\": \"^2.8.1\",\n+ \"webpack\": \"^4.4.1\",\n+ \"webpack-cli\": \"^2.0.13\",\n+ \"webpack-dev-server\": \"^3.1.1\"\n+ },\n+ \"dependencies\": {\n+ \"@thi.ng/api\": \"latest\",\n+ \"@thi.ng/atom\": \"latest\",\n+ \"@thi.ng/hdom\": \"latest\",\n+ \"@thi.ng/paths\": \"latest\",\n+ \"@thi.ng/resolve-map\": \"latest\",\n+ \"@thi.ng/rstream\": \"latest\",\n+ \"@thi.ng/transducers\": \"latest\"\n+ }\n+}\n\\ No newline at end of file\n", "new_path": "examples/rstream-dataflow/package.json", "old_path": null }, { "change_type": "ADD", "diff": "+import { ISubscribable } from \"@thi.ng/rstream/api\";\n+import { Transducer } from \"@thi.ng/transducers/api\";\n+\n+export interface NodeSpec {\n+ fn: (src: ISubscribable<any>[]) => ISubscribable<any>;\n+ ins: NodeInput[];\n+ out?: NodeOutput;\n+}\n+\n+export interface NodeInput {\n+ id?: string;\n+ path?: string;\n+ stream?: string | ((resolve) => ISubscribable<any>);\n+ const?: any;\n+ xform?: Transducer<any, any>;\n+}\n+\n+export type NodeOutput = string | ((node: ISubscribable<any>) => void);\n", "new_path": "examples/rstream-dataflow/src/api.ts", "old_path": null }, { "change_type": "ADD", "diff": "+// @thi.ng/hdom UI component function\n+export function circle(col: string, x: number, y: number, w: number, h = w) {\n+ return [\"div\", {\n+ class: \"absolute z-1 white f7 tc br-100 \" + col,\n+ style: {\n+ left: `${x - w / 2}px`,\n+ top: `${y - h / 2}px`,\n+ width: `${w}px`,\n+ height: `${h}px`,\n+ \"line-height\": `${h}px`,\n+ }\n+ }, `${x};${y}`];\n+}\n", "new_path": "examples/rstream-dataflow/src/circle.ts", "old_path": null }, { "change_type": "ADD", "diff": "+import { fromEvent } from \"@thi.ng/rstream/from/event\";\n+import { merge } from \"@thi.ng/rstream/stream-merge\";\n+import { map } from \"@thi.ng/transducers/xform/map\";\n+\n+export enum GestureType {\n+ START,\n+ MOVE,\n+ DRAG,\n+ END\n+}\n+\n+/**\n+ * Attaches mouse & touch event listeners to given DOM element and\n+ * returns a stream of custom \"gesture\" events in the form of tuples:\n+ *\n+ * ```\n+ * [type, [currpos, clickpos, delta]]\n+ * ```\n+ *\n+ * The `clickpos` and `delta` values are only present if `type ==\n+ * GestureType.DRAG`. Both (and `currpos` too) are 2-element arrays of\n+ * `[x,y]` coordinates.\n+ *\n+ * Note: For touch events `preventDefault()` is called automatically.\n+ * Since Chrome 56 (other browsers too), this means the event target\n+ * element cannot be `document.body` anymore.\n+ *\n+ * See: https://www.chromestatus.com/features/5093566007214080\n+ *\n+ * @param el\n+ */\n+export function gestureStream(el: Element) {\n+ let isDown = false,\n+ clickPos: number[];\n+ return merge({\n+ src: [\n+ \"mousedown\", \"mousemove\", \"mouseup\",\n+ \"touchstart\", \"touchmove\", \"touchend\", \"touchcancel\"\n+ ].map((e) => fromEvent(el, e)),\n+\n+ xform: map((e: MouseEvent | TouchEvent) => {\n+ let evt, type;\n+ if (e instanceof TouchEvent) {\n+ e.preventDefault();\n+ type = {\n+ \"touchstart\": GestureType.START,\n+ \"touchmove\": GestureType.DRAG,\n+ \"touchend\": GestureType.END,\n+ \"touchcancel\": GestureType.END\n+ }[e.type];\n+ evt = e.changedTouches[0];\n+ } else {\n+ type = {\n+ \"mousedown\": GestureType.START,\n+ \"mousemove\": isDown ? GestureType.DRAG : GestureType.MOVE,\n+ \"mouseup\": GestureType.END\n+ }[e.type];\n+ evt = e;\n+ }\n+ const body = [[evt.clientX | 0, evt.clientY | 0]];\n+ if (type == GestureType.START) {\n+ isDown = true;\n+ clickPos = body[0];\n+ } else if (type == GestureType.END) {\n+ isDown = false;\n+ clickPos = null;\n+ } else if (isDown) {\n+ body.push(clickPos, [body[0][0] - clickPos[0], body[0][1] - clickPos[1]]);\n+ }\n+ return [type, body];\n+ })\n+ });\n+}\n", "new_path": "examples/rstream-dataflow/src/gesture-stream.ts", "old_path": null }, { "change_type": "ADD", "diff": "+import { equiv } from \"@thi.ng/api/equiv\";\n+import { Atom } from \"@thi.ng/atom/atom\";\n+import { start } from \"@thi.ng/hdom\";\n+import { comp } from \"@thi.ng/transducers/func/comp\";\n+import { choices } from \"@thi.ng/transducers/iter/choices\";\n+import { dedupe } from \"@thi.ng/transducers/xform/dedupe\";\n+import { map } from \"@thi.ng/transducers/xform/map\";\n+\n+import { gestureStream } from \"./gesture-stream\";\n+import { extract, initNodes, node } from \"./nodes\";\n+import { circle } from \"./circle\";\n+\n+// infinite iterator of randomized circle colors (Tachyons CSS class names)\n+const colors = choices([\n+ \"bg-red\", \"bg-blue\", \"bg-gold\", \"bg-light-green\",\n+ \"bg-pink\", \"bg-light-purple\", \"bg-orange\", \"bg-gray\"\n+]);\n+\n+// atom for storing dataflow results (optional, here only for\n+// debugging/stringifying state)\n+const db = new Atom<any>({});\n+\n+// combined mouse & touch event stream this stream produces tuples of:\n+// [eventtype, [pos, clickpos, delta]]\n+// Note: only single touches are supported, no multitouch!\n+const gestures = gestureStream(document.getElementById(\"app\"));\n+\n+// dataflow graph definition. each key in this object represents a node\n+// in the graph and its value is a `NodeSpec`. the `initNodes` function\n+// transforms these specs into a DAG (directed acyclic graph) of\n+// @thi.ng/rstream types, so each \"node\" is actually implemented as a\n+// stream of some kind...\n+const graph = initNodes(db, {\n+\n+ // extracts current mouse/touch position\n+ mpos: {\n+ fn: extract([1, 0]),\n+ ins: [{ stream: () => gestures }],\n+ out: \"mpos\"\n+ },\n+\n+ // extracts last click position\n+ // (only defined during drag gestures)\n+ clickpos: {\n+ fn: extract([1, 1]),\n+ ins: [{ stream: () => gestures }],\n+ out: \"clickpos\"\n+ },\n+\n+ // computes distance between `clickpos` and `mpos`\n+ // (only defined during drag gestures)\n+ dist: {\n+ fn: node(map(({ mpos, clickpos }) =>\n+ mpos && clickpos &&\n+ Math.hypot(mpos[0] - clickpos[0], mpos[1] - clickpos[1]) | 0)),\n+ ins: [\n+ { stream: \"mpos\", id: \"mpos\" },\n+ { stream: \"clickpos\", id: \"clickpos\" },\n+ ],\n+ out: \"dist\",\n+ },\n+\n+ // combines `clickpos`, `dist` and `color` streams to produce a\n+ // @thi.ng/hdom UI component (a circle around clickpos).\n+ // the resulting stream is then directly included in this app's root\n+ // component below...\n+ circle: {\n+ fn: node(map(({ clickpos, dist, color }) =>\n+ clickpos && dist && color ?\n+ circle(color, clickpos[0], clickpos[1], dist * 2) :\n+ undefined)),\n+ ins: [\n+ { stream: \"clickpos\" },\n+ { stream: \"dist\", id: \"dist\" },\n+ { stream: \"color\", id: \"color\" },\n+ ],\n+ out: \"circle\"\n+ },\n+\n+ // produces a new random color for each new drag gesture (and\n+ // therefore each new circle will have a potentially different\n+ // color)\n+ color: {\n+ fn: ([click]) =>\n+ click.subscribe(\n+ comp(\n+ dedupe(equiv),\n+ map((x) => x && colors.next().value)\n+ )\n+ ),\n+ ins: [{ stream: \"clickpos\" }],\n+ out: \"color\",\n+ }\n+});\n+\n+// start @thi.ng/hdom update loop\n+start(\"app\", () =>\n+ [\"div\",\n+ [\"pre.absolute.top-1.left-1.pa0.ma0.z-2.f7\",\n+ JSON.stringify(db.deref(), null, 2)],\n+ // note: direct embedding of result stream below. this works\n+ // since @thi.ng/rstream subscriptions implement the\n+ // @thi.ng/api/IDeref interface (like several other types, e.g.\n+ // @thi.ng/atom's Atom, Cursor, View etc.)\n+ graph.circle,\n+ ]);\n", "new_path": "examples/rstream-dataflow/src/index.ts", "old_path": null }, { "change_type": "ADD", "diff": "+import { IObjectOf } from \"@thi.ng/api/api\";\n+import { illegalArgs } from \"@thi.ng/api/error\";\n+import { IAtom } from \"@thi.ng/atom/api\";\n+import { isString } from \"@thi.ng/checks/is-string\";\n+import { Path, getIn } from \"@thi.ng/paths\";\n+import { resolveMap } from \"@thi.ng/resolve-map\";\n+import { ISubscribable } from \"@thi.ng/rstream/api\";\n+import { fromIterableSync } from \"@thi.ng/rstream/from/iterable\";\n+import { fromView } from \"@thi.ng/rstream/from/view\";\n+import { sync } from \"@thi.ng/rstream/stream-sync\";\n+import { map } from \"@thi.ng/transducers/xform/map\";\n+import { Transducer } from \"@thi.ng/transducers/api\";\n+\n+import { NodeSpec } from \"./api\";\n+\n+/**\n+ * Dataflow graph initialization function. Takes an object of\n+ * NodeSpec's, calls `nodeFromSpec` for each and then recursively\n+ * resolves references via `@thi.ng/resolve-map/resolveMap`. Returns\n+ * updated graph object (mutates in-place, original specs are replaced\n+ * by stream constructs).\n+ *\n+ * @param state\n+ * @param nodes\n+ */\n+export const initNodes = (state: IAtom<any>, nodes: IObjectOf<NodeSpec>) => {\n+ for (let k in nodes) {\n+ (<any>nodes)[k] = nodeFromSpec(state, nodes[k]);\n+ }\n+ return resolveMap(nodes);\n+};\n+\n+/**\n+ * Transforms a single NodeSpec into a lookup function for `resolveMap`\n+ * (which is called from `initNodes`). When that called is called,\n+ * recursively resolves all specified input streams and calls this\n+ * spec's `fn` to produce a new stream from these inputs. If the spec\n+ * includes the optional `out` key, it also executes the provided\n+ * function, or if the value is a string, adds a subscription to this\n+ * node's result stream which then updates the provide state atom at the\n+ * path defined by `out`. Returns an ISubscribable.\n+ *\n+ * @param spec\n+ */\n+const nodeFromSpec = (state: IAtom<any>, spec: NodeSpec) => (resolve) => {\n+ const src: ISubscribable<any>[] = [];\n+ for (let i of spec.ins) {\n+ let s;\n+ if (i.path) {\n+ s = fromView(state, i.path);\n+ } else if (i.stream) {\n+ s = isString(i.stream) ? resolve(i.stream) : i.stream(resolve);\n+ } else if (i.const) {\n+ s = fromIterableSync([i.const]);\n+ } else {\n+ illegalArgs(`invalid node spec`);\n+ }\n+ if (i.xform) {\n+ s = s.subscribe(i.xform);\n+ }\n+ if (i.id) {\n+ s.id = i.id;\n+ }\n+ src.push(s);\n+ }\n+ const node = spec.fn(src);\n+ if (spec.out) {\n+ if (isString(spec.out)) {\n+ ((path) => node.subscribe({ next: (x) => state.resetIn(path, x) }))(spec.out);\n+ } else {\n+ spec.out(node);\n+ }\n+ }\n+ return node;\n+};\n+\n+/**\n+ * Higher order node / stream creator. Takes a transducer and optional\n+ * arity (number of required input streams). The returned function takes\n+ * an array of input streams and returns a new\n+ * @thi.ng/rstream/StreamSync instance.\n+ *\n+ * @param xform\n+ * @param arity\n+ */\n+export const node = (xform: Transducer<IObjectOf<any>, any>, arity?: number) =>\n+ (src: ISubscribable<number>[]) => {\n+ if (arity !== undefined && src.length !== arity) {\n+ illegalArgs(`wrong number of inputs: got ${src.length}, but needed ${arity}`);\n+ }\n+ return sync({ src, xform, reset: false });\n+ };\n+\n+/**\n+ * Addition node. Supports any number of inputs.\n+ */\n+export const add = node(\n+ map((ports: IObjectOf<number>) => {\n+ let sum = 0;\n+ for (let p in ports) {\n+ sum += ports[p];\n+ }\n+ return sum;\n+ }));\n+\n+/**\n+ * Multiplication node. Supports any number of inputs.\n+ */\n+export const mul = node(\n+ map((ports: IObjectOf<number>) => {\n+ let sum = 1;\n+ for (let p in ports) {\n+ sum *= ports[p];\n+ }\n+ return sum;\n+ }));\n+\n+/**\n+ * Substraction node. 2 inputs.\n+ */\n+export const sub = node(map((ports: IObjectOf<number>) => ports.a - ports.b), 2);\n+\n+/**\n+ * Division node. 2 inputs.\n+ */\n+export const div = node(map((ports: IObjectOf<number>) => ports.a / ports.b), 2);\n+\n+/**\n+ * Nested value extraction node. Higher order function. Only 1 input\n+ * allowed.\n+ */\n+export const extract = (path: Path) =>\n+ (src: ISubscribable<number>[]) => {\n+ if (src.length !== 1) {\n+ illegalArgs(`too many inputs, only needed 1`);\n+ }\n+ return src[0].subscribe(map((x) => getIn(x, path)));\n+ };\n\\ No newline at end of file\n", "new_path": "examples/rstream-dataflow/src/nodes.ts", "old_path": null }, { "change_type": "ADD", "diff": "+{\n+ \"extends\": \"../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \"build\",\n+ \"sourceMap\": true,\n+ \"noUnusedLocals\": false,\n+ },\n+ \"include\": [\n+ \"./src/**/*.ts\"\n+ ]\n+}\n\\ No newline at end of file\n", "new_path": "examples/rstream-dataflow/tsconfig.json", "old_path": null }, { "change_type": "ADD", "diff": "+module.exports = {\n+ entry: \"./src/index.ts\",\n+ output: {\n+ path: __dirname,\n+ filename: \"bundle.js\"\n+ },\n+ resolve: {\n+ extensions: [\".ts\", \".js\"]\n+ },\n+ module: {\n+ rules: [\n+ { test: /\\.ts$/, use: \"ts-loader\" }\n+ ]\n+ },\n+ devServer: {\n+ contentBase: \".\"\n+ }\n+};\n", "new_path": "examples/rstream-dataflow/webpack.config.js", "old_path": null } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(examples): add rstream-dataflow example
1
feat
examples
679,913
04.04.2018 23:00:32
-3,600
218150a9dc8354ed52db90ed5a40ac1ddc9870c0
docs(examples): update readme, add dflow graph viz
[ { "change_type": "ADD", "diff": "+digraph g {\n+\n+ rankdir=LR;\n+ node[fontname=Inconsolata,fontsize=9,fontcolor=white,style=filled,color=black];\n+ edge[fontname=Inconsolata,fontsize=9,arrowsize=0.66];\n+\n+ mousedown -> gestures;\n+ mousemove -> gestures;\n+ mouseup -> gestures;\n+ touchstart -> gestures;\n+ touchmove -> gestures;\n+ touchend -> gestures;\n+\n+ gestures -> mpos[label=extract];\n+ gestures -> clickpos[label=extract];\n+\n+ mpos -> dist;\n+ clickpos -> dist;\n+\n+ clickpos -> color[label=\"pick random\"];\n+\n+ clickpos -> circle;\n+ dist -> circle;\n+ color -> circle;\n+}\n\\ No newline at end of file\n", "new_path": "assets/rs-dflow.dot", "old_path": null }, { "change_type": "ADD", "diff": "Binary files /dev/null and b/assets/rs-dflow.png differ\n", "new_path": "assets/rs-dflow.png", "old_path": "assets/rs-dflow.png" }, { "change_type": "MODIFY", "diff": "@@ -17,6 +17,7 @@ If you want to [contribute](../CONTRIBUTING.md) an example, please get in touch\n| 9 | [login-form](./login-form) | basic SPA without router | atom, hdom | intermediate |\n| 10 | [pointfree-svg](./pointfree-svg) | generate SVG using pointfree DSL | hiccup, hdom-components, pointfree-lang | intermediate |\n| 11 | [router-basics](./router-basics) | complete mini SPA | atom, hdom, router | advanced |\n-| 12 | [svg-particles](./svg-particles) | hdom SVG generation / animation | hdom, transducers | basic |\n-| 13 | [todo-list](./todo-list) | Canonical Todo list with undo/redo | atom, hdom, transducers | intermediate |\n-| 14 | [webgl](./webgl) | Canvas component handling | hdom, hdom-components | basic |\n+| 12 | [rstream-dataflow](./rstream-dataflow) | dataflow graph execution | atom, hdom, resolve-map, rstream, transducers | intermediate |\n+| 13 | [svg-particles](./svg-particles) | hdom SVG generation / animation | hdom, transducers | basic |\n+| 14 | [todo-list](./todo-list) | Canonical Todo list with undo/redo | atom, hdom, transducers | intermediate |\n+| 15 | [webgl](./webgl) | Canvas component handling | hdom, hdom-components | basic |\n", "new_path": "examples/README.md", "old_path": "examples/README.md" }, { "change_type": "MODIFY", "diff": "@@ -8,3 +8,19 @@ cd umbrella/examples/rstream-dataflow\nyarn install\nyarn start\n```\n+\n+Installs all dependencies, runs `webpack-dev-server` and opens the app in your browser.\n+\n+## About\n+\n+![dataflow graph](../../assets/rs-dflow.png)\n+\n+This example combines the following packages to create & execute the\n+above dataflow graph in a declarative manner:\n+\n+- [@thi.ng/atom]() - state container\n+- [@thi.ng/hdom]() - UI component rendering\n+- [@thi.ng/paths]() - nested value accessors\n+- [@thi.ng/resolve-map]() - DAG-based object resolution\n+- [@thi.ng/rstream]() - reactive stream constructs\n+- [@thi.ng/transducers]() - data transformations (here used for stream transforms)\n", "new_path": "examples/rstream-dataflow/README.md", "old_path": "examples/rstream-dataflow/README.md" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
docs(examples): update readme, add dflow graph viz
1
docs
examples
821,196
04.04.2018 23:42:58
25,200
e589f0a0057782ce20f423499c5d4f52d643030f
fix: ignore package-lock.json or yarn.lock
[ { "change_type": "MODIFY", "diff": "@@ -471,6 +471,7 @@ class App extends Generator {\n'*-error.log',\n'/node_modules',\n'/tmp',\n+ this.yarn ? 'package-lock.json' : 'yarn.lock',\nthis.ts && '/lib',\n])\n.concat(existing)\n", "new_path": "src/generators/app.ts", "old_path": "src/generators/app.ts" } ]
TypeScript
MIT License
oclif/oclif
fix: ignore package-lock.json or yarn.lock
1
fix
null
679,913
05.04.2018 00:10:59
-3,600
ae27bd651544bfb971d3b59cac3862df1b476de8
refactor(examples): update rstream-dflow example
[ { "change_type": "MODIFY", "diff": "@@ -24,3 +24,5 @@ above dataflow graph in a declarative manner:\n- [@thi.ng/resolve-map]() - DAG-based object resolution\n- [@thi.ng/rstream]() - reactive stream constructs\n- [@thi.ng/transducers]() - data transformations (here used for stream transforms)\n+\n+Please see detailed comments in the source code for further explanations.\n", "new_path": "examples/rstream-dataflow/README.md", "old_path": "examples/rstream-dataflow/README.md" }, { "change_type": "MODIFY", "diff": "import { ISubscribable } from \"@thi.ng/rstream/api\";\nimport { Transducer } from \"@thi.ng/transducers/api\";\n+import { IObjectOf } from \"@thi.ng/api/api\";\n+/**\n+ * A dataflow graph spec is simply an object where keys are node names\n+ * and their values are NodeSpec's, defining inputs and the operation to\n+ * be applied to produce a result stream.\n+ */\n+export type GraphSpec = IObjectOf<NodeSpec>;\n+\n+/**\n+ * Specification for a single \"node\" in the dataflow graph. Nodes here\n+ * are actually streams (or just generally any form of @thi.ng/rstream\n+ * subscription), usually with an associated transducer to transform /\n+ * combine the inputs and produce values for the node's result stream.\n+ *\n+ * The `fn` function is responsible to produce such a stream construct.\n+ *\n+ * See `initGraph` and `nodeFromSpec` for more details (in /src/nodes.ts)\n+ */\nexport interface NodeSpec {\nfn: (src: ISubscribable<any>[]) => ISubscribable<any>;\nins: NodeInput[];\nout?: NodeOutput;\n}\n+/**\n+ * Specification for a single input, which can be given in different\n+ * ways:\n+ *\n+ * 1) Create a stream for given path in state atom (passed to\n+ * `initGraph`):\n+ *\n+ * ```\n+ * { path: \"nested.src.path\" }\n+ * ```\n+ *\n+ * 2) Reference another node in the GraphSpec object:\n+ *\n+ * ```\n+ * { stream: \"node-id\" }\n+ * ```\n+ *\n+ * 3) Reference another node indirectly. The passed in `resolve`\n+ * function can be used to lookup other nodes, e.g. the following\n+ * spec looks up node \"src\" and adds a transformed subscription,\n+ * which is then used as input for current node\n+ *\n+ * ```\n+ * { stream: (resolve) => resolve(\"src\").subscribe(map(x => x * 10)) }\n+ * ```\n+ *\n+ * 4) Provide an external input stream:\n+ *\n+ * ```\n+ * { stream: () => fromIterable([1,2,3], 500) }\n+ * ```\n+ *\n+ * 5) Single value input stream:\n+ *\n+ * ```\n+ * { const: 1 }\n+ * ```\n+ *\n+ * If the optional `xform` is given, a subscription with the transducer\n+ * is added to the input and then used as input instead.\n+ *\n+ * If the optional `id` is specified, a dummy subscription with the ID\n+ * is added to the input and used as input instead. This allows for\n+ * local renaming of inputs and is needed for some ops (e.g.\n+ * `StreamSync` based nodes).\n+ */\nexport interface NodeInput {\nid?: string;\npath?: string;\n", "new_path": "examples/rstream-dataflow/src/api.ts", "old_path": "examples/rstream-dataflow/src/api.ts" }, { "change_type": "MODIFY", "diff": "@@ -7,7 +7,7 @@ import { dedupe } from \"@thi.ng/transducers/xform/dedupe\";\nimport { map } from \"@thi.ng/transducers/xform/map\";\nimport { gestureStream } from \"./gesture-stream\";\n-import { extract, initNodes, node } from \"./nodes\";\n+import { extract, initGraph, node } from \"./nodes\";\nimport { circle } from \"./circle\";\n// infinite iterator of randomized circle colors (Tachyons CSS class names)\n@@ -26,11 +26,11 @@ const db = new Atom<any>({});\nconst gestures = gestureStream(document.getElementById(\"app\"));\n// dataflow graph definition. each key in this object represents a node\n-// in the graph and its value is a `NodeSpec`. the `initNodes` function\n+// in the graph and its value is a `NodeSpec`. the `initGraph` function\n// transforms these specs into a DAG (directed acyclic graph) of\n// @thi.ng/rstream types, so each \"node\" is actually implemented as a\n// stream of some kind...\n-const graph = initNodes(db, {\n+const graph = initGraph(db, {\n// extracts current mouse/touch position\nmpos: {\n@@ -50,14 +50,14 @@ const graph = initNodes(db, {\n// computes distance between `clickpos` and `mpos`\n// (only defined during drag gestures)\ndist: {\n- fn: node(map(({ mpos, clickpos }) =>\n- mpos && clickpos &&\n- Math.hypot(mpos[0] - clickpos[0], mpos[1] - clickpos[1]) | 0)),\n+ fn: node(map(({ curr, click }) =>\n+ curr && click &&\n+ Math.hypot(curr[0] - click[0], curr[1] - click[1]) | 0)),\nins: [\n- { stream: \"mpos\", id: \"mpos\" },\n- { stream: \"clickpos\", id: \"clickpos\" },\n+ { stream: \"mpos\", id: \"curr\" },\n+ { stream: \"clickpos\", id: \"click\" },\n],\n- out: \"dist\",\n+ out: \"dist\"\n},\n// combines `clickpos`, `dist` and `color` streams to produce a\n@@ -65,13 +65,13 @@ const graph = initNodes(db, {\n// the resulting stream is then directly included in this app's root\n// component below...\ncircle: {\n- fn: node(map(({ clickpos, dist, color }) =>\n- clickpos && dist && color ?\n- circle(color, clickpos[0], clickpos[1], dist * 2) :\n+ fn: node(map(({ click, radius, color }) =>\n+ click && radius && color ?\n+ circle(color, click[0], click[1], radius * 2) :\nundefined)),\nins: [\n- { stream: \"clickpos\" },\n- { stream: \"dist\", id: \"dist\" },\n+ { stream: \"clickpos\", id: \"click\" },\n+ { stream: \"dist\", id: \"radius\" },\n{ stream: \"color\", id: \"color\" },\n],\nout: \"circle\"\n@@ -89,7 +89,7 @@ const graph = initNodes(db, {\n)\n),\nins: [{ stream: \"clickpos\" }],\n- out: \"color\",\n+ out: \"color\"\n}\n});\n@@ -99,8 +99,8 @@ start(\"app\", () =>\n[\"pre.absolute.top-1.left-1.pa0.ma0.z-2.f7\",\nJSON.stringify(db.deref(), null, 2)],\n// note: direct embedding of result stream below. this works\n- // since @thi.ng/rstream subscriptions implement the\n+ // since all @thi.ng/rstream subscriptions implement the\n// @thi.ng/api/IDeref interface (like several other types, e.g.\n// @thi.ng/atom's Atom, Cursor, View etc.)\n- graph.circle,\n+ graph.circle\n]);\n", "new_path": "examples/rstream-dataflow/src/index.ts", "old_path": "examples/rstream-dataflow/src/index.ts" }, { "change_type": "MODIFY", "diff": "@@ -23,7 +23,7 @@ import { NodeSpec } from \"./api\";\n* @param state\n* @param nodes\n*/\n-export const initNodes = (state: IAtom<any>, nodes: IObjectOf<NodeSpec>) => {\n+export const initGraph = (state: IAtom<any>, nodes: IObjectOf<NodeSpec>): IObjectOf<ISubscribable<any>> => {\nfor (let k in nodes) {\n(<any>nodes)[k] = nodeFromSpec(state, nodes[k]);\n}\n@@ -32,7 +32,7 @@ export const initNodes = (state: IAtom<any>, nodes: IObjectOf<NodeSpec>) => {\n/**\n* Transforms a single NodeSpec into a lookup function for `resolveMap`\n- * (which is called from `initNodes`). When that called is called,\n+ * (which is called from `initGraph`). When that called is called,\n* recursively resolves all specified input streams and calls this\n* spec's `fn` to produce a new stream from these inputs. If the spec\n* includes the optional `out` key, it also executes the provided\n@@ -56,10 +56,9 @@ const nodeFromSpec = (state: IAtom<any>, spec: NodeSpec) => (resolve) => {\nillegalArgs(`invalid node spec`);\n}\nif (i.xform) {\n- s = s.subscribe(i.xform);\n- }\n- if (i.id) {\n- s.id = i.id;\n+ s = s.subscribe(i.xform, i.id);\n+ } else if (i.id) {\n+ s = s.subscribe({}, i.id);\n}\nsrc.push(s);\n}\n", "new_path": "examples/rstream-dataflow/src/nodes.ts", "old_path": "examples/rstream-dataflow/src/nodes.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(examples): update rstream-dflow example
1
refactor
examples
679,913
05.04.2018 00:20:31
-3,600
2332787482251301281ed946c6909b151e5c9c6e
docs(examples): update rs-dflow example
[ { "change_type": "MODIFY", "diff": "@@ -79,15 +79,16 @@ const graph = initGraph(db, {\n// produces a new random color for each new drag gesture (and\n// therefore each new circle will have a potentially different\n- // color)\n+ // color). transformation is done using a composed transducer which\n+ // first dedupes click pos values and emits a new random color each\n+ // time clickpos is redefined (remember, clickpos is only defined\n+ // during drag gestures)\ncolor: {\nfn: ([click]) =>\nclick.subscribe(\ncomp(\ndedupe(equiv),\n- map((x) => x && colors.next().value)\n- )\n- ),\n+ map((x) => x && colors.next().value))),\nins: [{ stream: \"clickpos\" }],\nout: \"color\"\n}\n", "new_path": "examples/rstream-dataflow/src/index.ts", "old_path": "examples/rstream-dataflow/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
docs(examples): update rs-dflow example
1
docs
examples
679,913
05.04.2018 00:53:22
-3,600
9ab1544249f38bb2bbe403fd8071d0bd71f425ed
docs(examples): update doc strings
[ { "change_type": "MODIFY", "diff": "@@ -32,7 +32,7 @@ export const initGraph = (state: IAtom<any>, nodes: IObjectOf<NodeSpec>): IObjec\n/**\n* Transforms a single NodeSpec into a lookup function for `resolveMap`\n- * (which is called from `initGraph`). When that called is called,\n+ * (which is called from `initGraph`). When that function is called,\n* recursively resolves all specified input streams and calls this\n* spec's `fn` to produce a new stream from these inputs. If the spec\n* includes the optional `out` key, it also executes the provided\n@@ -40,6 +40,8 @@ export const initGraph = (state: IAtom<any>, nodes: IObjectOf<NodeSpec>): IObjec\n* node's result stream which then updates the provide state atom at the\n* path defined by `out`. Returns an ISubscribable.\n*\n+ * See `api.ts` for further details and possible spec variations.\n+ *\n* @param spec\n*/\nconst nodeFromSpec = (state: IAtom<any>, spec: NodeSpec) => (resolve) => {\n@@ -92,6 +94,7 @@ export const node = (xform: Transducer<IObjectOf<any>, any>, arity?: number) =>\n/**\n* Addition node. Supports any number of inputs.\n+ * Currently unused, but illustrates use of `node` HOF.\n*/\nexport const add = node(\nmap((ports: IObjectOf<number>) => {\n@@ -104,6 +107,7 @@ export const add = node(\n/**\n* Multiplication node. Supports any number of inputs.\n+ * Currently unused, but illustrates use of `node` HOF.\n*/\nexport const mul = node(\nmap((ports: IObjectOf<number>) => {\n@@ -116,11 +120,13 @@ export const mul = node(\n/**\n* Substraction node. 2 inputs.\n+ * Currently unused, but illustrates use of `node` HOF.\n*/\nexport const sub = node(map((ports: IObjectOf<number>) => ports.a - ports.b), 2);\n/**\n* Division node. 2 inputs.\n+ * Currently unused, but illustrates use of `node` HOF.\n*/\nexport const div = node(map((ports: IObjectOf<number>) => ports.a / ports.b), 2);\n@@ -129,7 +135,7 @@ export const div = node(map((ports: IObjectOf<number>) => ports.a / ports.b), 2)\n* allowed.\n*/\nexport const extract = (path: Path) =>\n- (src: ISubscribable<number>[]) => {\n+ (src: ISubscribable<any>[]) => {\nif (src.length !== 1) {\nillegalArgs(`too many inputs, only needed 1`);\n}\n", "new_path": "examples/rstream-dataflow/src/nodes.ts", "old_path": "examples/rstream-dataflow/src/nodes.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
docs(examples): update doc strings
1
docs
examples
791,904
05.04.2018 00:54:07
-3,600
9ea152b3b51cf2d76de91904a38f7d2ed0130d1d
core(noopener-audit): allow noreferrer as well
[ { "change_type": "MODIFY", "diff": "<a href=\"https://www.google.com/\" target=\"_blank\" rel=\"nofollow\">external link</a>\n<!-- PASS - external link correctly uses rel=\"noopener\" and an additional rel value -->\n<a href=\"https://www.google.com/\" target=\"_blank\" rel=\"noopener nofollow\">external link that uses rel noopener and another unrelated rel attribute</a>\n+ <!-- PASS - external link correctly uses rel=\"noreferrer\" and an additional rel value -->\n+ <a href=\"https://www.google.com/\" target=\"_blank\" rel=\"noreferrer nofollow\">external link that uses rel noreferrer and another unrelated rel attribute</a>\n<!-- PASS - external link correctly uses rel=\"noopener\" -->\n<a href=\"https://www.google.com/\" target=\"_blank\" rel=\"noopener\">external link that uses rel noopener</a>\n+ <!-- PASS - external link correctly uses rel=\"noreferrer\" -->\n+ <a href=\"https://www.google.com/\" target=\"_blank\" rel=\"noreferrer\">external link that uses rel noreferrer</a>\n+ <!-- PASS - external link correctly uses rel=\"noopener\" and rel=\"noreferrer\" -->\n+ <a href=\"https://www.google.com/\" target=\"_blank\" rel=\"noopener noreferrer\">external link that uses rel noopener and noreferrer</a>\n<!-- PASS - internal link without rel=\"noopener\" -->\n<a href=\"./doesnotexist\" target=\"_blank\">internal link is ok</a>\n<!-- PASS - href uses javascript: -->\n", "new_path": "lighthouse-cli/test/fixtures/dobetterweb/dbw_tester.html", "old_path": "lighthouse-cli/test/fixtures/dobetterweb/dbw_tester.html" }, { "change_type": "MODIFY", "diff": "@@ -15,10 +15,10 @@ class ExternalAnchorsUseRelNoopenerAudit extends Audit {\nstatic get meta() {\nreturn {\nname: 'external-anchors-use-rel-noopener',\n- description: 'Opens external anchors using `rel=\"noopener\"`',\n- failureDescription: 'Does not open external anchors using `rel=\"noopener\"`',\n- helpText: 'Open new tabs using `rel=\"noopener\"` to improve performance and ' +\n- 'prevent security vulnerabilities. ' +\n+ description: 'Links to cross-origin destinations are safe',\n+ failureDescription: 'Links to cross-origin destinations are unsafe',\n+ helpText: 'Add `rel=\"noopener\"` or `rel=\"noreferrer\"` to any external links to improve ' +\n+ 'performance and prevent security vulnerabilities. ' +\n'[Learn more](https://developers.google.com/web/tools/lighthouse/audits/noopener).',\nrequiredArtifacts: ['URL', 'AnchorsWithNoRelNoopener'],\n};\n", "new_path": "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js", "old_path": "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js" }, { "change_type": "MODIFY", "diff": "@@ -16,7 +16,7 @@ class AnchorsWithNoRelNoopener extends Gatherer {\nafterPass(options) {\nconst expression = `(function() {\n${DOMHelpers.getElementsInDocumentFnString}; // define function on page\n- const selector = 'a[target=\"_blank\"]:not([rel~=\"noopener\"])';\n+ const selector = 'a[target=\"_blank\"]:not([rel~=\"noopener\"]):not([rel~=\"noreferrer\"])';\nconst elements = getElementsInDocument(selector);\nreturn elements.map(node => ({\nhref: node.href,\n", "new_path": "lighthouse-core/gather/gatherers/dobetterweb/anchors-with-no-rel-noopener.js", "old_path": "lighthouse-core/gather/gatherers/dobetterweb/anchors-with-no-rel-noopener.js" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
core(noopener-audit): allow noreferrer as well (#4920)
1
core
noopener-audit
679,913
05.04.2018 01:19:32
-3,600
48310a689fc49fbf1f2e8e4b47b2afaad1ee4e3f
fix(rstream): correct wrong isString() import use not from node "util" package
[ { "change_type": "MODIFY", "diff": "import { illegalArity } from \"@thi.ng/api/error\";\n+import { isString } from \"@thi.ng/checks/is-string\";\nimport { Transducer } from \"@thi.ng/transducers/api\";\nimport { DEBUG, IStream, ISubscriber, StreamCancel, StreamSource } from \"./api\";\nimport { Subscription } from \"./subscription\";\n-import { isString } from \"util\";\nexport class Stream<T> extends Subscription<T, T>\nimplements IStream<T> {\n", "new_path": "packages/rstream/src/stream.ts", "old_path": "packages/rstream/src/stream.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
fix(rstream): correct wrong isString() import - use @thi.ng/checks/is-string, not from node "util" package
1
fix
rstream
679,913
05.04.2018 02:00:00
-3,600
8eb7e68ce880d9a22b22ea30caf1294c8532a016
fix(examples): update GH links in html files
[ { "change_type": "MODIFY", "diff": "<a href=\"https://github.com/thi-ng/umbrella/blob/master/examples/interceptor-basics/src/index.ts\">example</a>\n</li>\n<li>\n- <a href=\"https://github.com/thi-ng/umbrella/blob/master/packages/atom/src/event-bus.ts\">event bus</a>\n+ <a href=\"https://github.com/thi-ng/umbrella/blob/master/packages/interceptors/src/event-bus.ts\">event bus</a>\n</li>\n<li>\n- <a href=\"https://github.com/thi-ng/umbrella/blob/master/packages/atom/src/interceptors.ts\">validation interceptors</a>\n+ <a href=\"https://github.com/thi-ng/umbrella/blob/master/packages/interceptors/src/interceptors.ts\">validation interceptors</a>\n</li>\n</ul>\n</p>\n", "new_path": "examples/interceptor-basics/index.html", "old_path": "examples/interceptor-basics/index.html" }, { "change_type": "MODIFY", "diff": "<body>\n<div id=\"app\"></div>\n<footer class=\"fixed bottom-0 z-1 pa2 w-100 bg-black gray sans-serif\">\n- <a class=\"link moon-gray\" href=\"https://github.com/thi-ng/umbrella/blob/master/examples/router-basics/src/\">Source code</a>, images by\n+ <a class=\"link moon-gray\" href=\"https://github.com/thi-ng/umbrella/tree/master/examples/router-basics\">Source code</a>, images by\n<a class=\"link moon-gray\" href=\"https://www.instagram.com/manomine/\">@manomine</a>\n</footer>\n<script type=\"text/javascript\" src=\"bundle.js\"></script>\n", "new_path": "examples/router-basics/public/index.html", "old_path": "examples/router-basics/public/index.html" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
fix(examples): update GH links in html files
1
fix
examples
791,834
05.04.2018 08:52:49
25,200
2a24423db235173ef379faa47657b4066da34f64
core(network-recorder): fix typo in once() call on super
[ { "change_type": "MODIFY", "diff": "@@ -47,7 +47,7 @@ class NetworkRecorder extends EventEmitter {\n* @param {*} listener\n*/\nonce(event, listener) {\n- return super.on(event, listener);\n+ return super.once(event, listener);\n}\nget EventTypes() {\n", "new_path": "lighthouse-core/lib/network-recorder.js", "old_path": "lighthouse-core/lib/network-recorder.js" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
core(network-recorder): fix typo in once() call on super (#4926)
1
core
network-recorder
679,913
05.04.2018 10:36:46
-3,600
fce542237aad27b368ba550c89d74d31e72ead3c
build(dgraph): import dgraph package stub to avoid travis build errors
[ { "change_type": "ADD", "diff": "+build\n+coverage\n+dev\n+doc\n+src*\n+test\n+.nyc_output\n+tsconfig.json\n+*.tgz\n+*.html\n", "new_path": "packages/dgraph/.npmignore", "old_path": null }, { "change_type": "ADD", "diff": "+ Apache License\n+ Version 2.0, January 2004\n+ http://www.apache.org/licenses/\n+\n+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n+\n+ 1. Definitions.\n+\n+ \"License\" shall mean the terms and conditions for use, reproduction,\n+ and distribution as defined by Sections 1 through 9 of this document.\n+\n+ \"Licensor\" shall mean the copyright owner or entity authorized by\n+ the copyright owner that is granting the License.\n+\n+ \"Legal Entity\" shall mean the union of the acting entity and all\n+ other entities that control, are controlled by, or are under common\n+ control with that entity. For the purposes of this definition,\n+ \"control\" means (i) the power, direct or indirect, to cause the\n+ direction or management of such entity, whether by contract or\n+ otherwise, or (ii) ownership of fifty percent (50%) or more of the\n+ outstanding shares, or (iii) beneficial ownership of such entity.\n+\n+ \"You\" (or \"Your\") shall mean an individual or Legal Entity\n+ exercising permissions granted by this License.\n+\n+ \"Source\" form shall mean the preferred form for making modifications,\n+ including but not limited to software source code, documentation\n+ source, and configuration files.\n+\n+ \"Object\" form shall mean any form resulting from mechanical\n+ transformation or translation of a Source form, including but\n+ not limited to compiled object code, generated documentation,\n+ and conversions to other media types.\n+\n+ \"Work\" shall mean the work of authorship, whether in Source or\n+ Object form, made available under the License, as indicated by a\n+ copyright notice that is included in or attached to the work\n+ (an example is provided in the Appendix below).\n+\n+ \"Derivative Works\" shall mean any work, whether in Source or Object\n+ form, that is based on (or derived from) the Work and for which the\n+ editorial revisions, annotations, elaborations, or other modifications\n+ represent, as a whole, an original work of authorship. For the purposes\n+ of this License, Derivative Works shall not include works that remain\n+ separable from, or merely link (or bind by name) to the interfaces of,\n+ the Work and Derivative Works thereof.\n+\n+ \"Contribution\" shall mean any work of authorship, including\n+ the original version of the Work and any modifications or additions\n+ to that Work or Derivative Works thereof, that is intentionally\n+ submitted to Licensor for inclusion in the Work by the copyright owner\n+ or by an individual or Legal Entity authorized to submit on behalf of\n+ the copyright owner. For the purposes of this definition, \"submitted\"\n+ means any form of electronic, verbal, or written communication sent\n+ to the Licensor or its representatives, including but not limited to\n+ communication on electronic mailing lists, source code control systems,\n+ and issue tracking systems that are managed by, or on behalf of, the\n+ Licensor for the purpose of discussing and improving the Work, but\n+ excluding communication that is conspicuously marked or otherwise\n+ designated in writing by the copyright owner as \"Not a Contribution.\"\n+\n+ \"Contributor\" shall mean Licensor and any individual or Legal Entity\n+ on behalf of whom a Contribution has been received by Licensor and\n+ subsequently incorporated within the Work.\n+\n+ 2. Grant of Copyright License. Subject to the terms and conditions of\n+ this License, each Contributor hereby grants to You a perpetual,\n+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n+ copyright license to reproduce, prepare Derivative Works of,\n+ publicly display, publicly perform, sublicense, and distribute the\n+ Work and such Derivative Works in Source or Object form.\n+\n+ 3. Grant of Patent License. Subject to the terms and conditions of\n+ this License, each Contributor hereby grants to You a perpetual,\n+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n+ (except as stated in this section) patent license to make, have made,\n+ use, offer to sell, sell, import, and otherwise transfer the Work,\n+ where such license applies only to those patent claims licensable\n+ by such Contributor that are necessarily infringed by their\n+ Contribution(s) alone or by combination of their Contribution(s)\n+ with the Work to which such Contribution(s) was submitted. If You\n+ institute patent litigation against any entity (including a\n+ cross-claim or counterclaim in a lawsuit) alleging that the Work\n+ or a Contribution incorporated within the Work constitutes direct\n+ or contributory patent infringement, then any patent licenses\n+ granted to You under this License for that Work shall terminate\n+ as of the date such litigation is filed.\n+\n+ 4. Redistribution. You may reproduce and distribute copies of the\n+ Work or Derivative Works thereof in any medium, with or without\n+ modifications, and in Source or Object form, provided that You\n+ meet the following conditions:\n+\n+ (a) You must give any other recipients of the Work or\n+ Derivative Works a copy of this License; and\n+\n+ (b) You must cause any modified files to carry prominent notices\n+ stating that You changed the files; and\n+\n+ (c) You must retain, in the Source form of any Derivative Works\n+ that You distribute, all copyright, patent, trademark, and\n+ attribution notices from the Source form of the Work,\n+ excluding those notices that do not pertain to any part of\n+ the Derivative Works; and\n+\n+ (d) If the Work includes a \"NOTICE\" text file as part of its\n+ distribution, then any Derivative Works that You distribute must\n+ include a readable copy of the attribution notices contained\n+ within such NOTICE file, excluding those notices that do not\n+ pertain to any part of the Derivative Works, in at least one\n+ of the following places: within a NOTICE text file distributed\n+ as part of the Derivative Works; within the Source form or\n+ documentation, if provided along with the Derivative Works; or,\n+ within a display generated by the Derivative Works, if and\n+ wherever such third-party notices normally appear. The contents\n+ of the NOTICE file are for informational purposes only and\n+ do not modify the License. You may add Your own attribution\n+ notices within Derivative Works that You distribute, alongside\n+ or as an addendum to the NOTICE text from the Work, provided\n+ that such additional attribution notices cannot be construed\n+ as modifying the License.\n+\n+ You may add Your own copyright statement to Your modifications and\n+ may provide additional or different license terms and conditions\n+ for use, reproduction, or distribution of Your modifications, or\n+ for any such Derivative Works as a whole, provided Your use,\n+ reproduction, and distribution of the Work otherwise complies with\n+ the conditions stated in this License.\n+\n+ 5. Submission of Contributions. Unless You explicitly state otherwise,\n+ any Contribution intentionally submitted for inclusion in the Work\n+ by You to the Licensor shall be under the terms and conditions of\n+ this License, without any additional terms or conditions.\n+ Notwithstanding the above, nothing herein shall supersede or modify\n+ the terms of any separate license agreement you may have executed\n+ with Licensor regarding such Contributions.\n+\n+ 6. Trademarks. This License does not grant permission to use the trade\n+ names, trademarks, service marks, or product names of the Licensor,\n+ except as required for reasonable and customary use in describing the\n+ origin of the Work and reproducing the content of the NOTICE file.\n+\n+ 7. Disclaimer of Warranty. Unless required by applicable law or\n+ agreed to in writing, Licensor provides the Work (and each\n+ Contributor provides its Contributions) on an \"AS IS\" BASIS,\n+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n+ implied, including, without limitation, any warranties or conditions\n+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n+ PARTICULAR PURPOSE. You are solely responsible for determining the\n+ appropriateness of using or redistributing the Work and assume any\n+ risks associated with Your exercise of permissions under this License.\n+\n+ 8. Limitation of Liability. In no event and under no legal theory,\n+ whether in tort (including negligence), contract, or otherwise,\n+ unless required by applicable law (such as deliberate and grossly\n+ negligent acts) or agreed to in writing, shall any Contributor be\n+ liable to You for damages, including any direct, indirect, special,\n+ incidental, or consequential damages of any character arising as a\n+ result of this License or out of the use or inability to use the\n+ Work (including but not limited to damages for loss of goodwill,\n+ work stoppage, computer failure or malfunction, or any and all\n+ other commercial damages or losses), even if such Contributor\n+ has been advised of the possibility of such damages.\n+\n+ 9. Accepting Warranty or Additional Liability. While redistributing\n+ the Work or Derivative Works thereof, You may choose to offer,\n+ and charge a fee for, acceptance of support, warranty, indemnity,\n+ or other liability obligations and/or rights consistent with this\n+ License. However, in accepting such obligations, You may act only\n+ on Your own behalf and on Your sole responsibility, not on behalf\n+ of any other Contributor, and only if You agree to indemnify,\n+ defend, and hold each Contributor harmless for any liability\n+ incurred by, or claims asserted against, such Contributor by reason\n+ of your accepting any such warranty or additional liability.\n+\n+ END OF TERMS AND CONDITIONS\n+\n+ APPENDIX: How to apply the Apache License to your work.\n+\n+ To apply the Apache License to your work, attach the following\n+ boilerplate notice, with the fields enclosed by brackets \"{}\"\n+ replaced with your own identifying information. (Don't include\n+ the brackets!) The text should be enclosed in the appropriate\n+ comment syntax for the file format. We also recommend that a\n+ file or class name and description of purpose be included on the\n+ same \"printed page\" as the copyright notice for easier\n+ identification within third-party archives.\n+\n+ Copyright {yyyy} {name of copyright owner}\n+\n+ Licensed under the Apache License, Version 2.0 (the \"License\");\n+ you may not use this file except in compliance with the License.\n+ You may obtain a copy of the License at\n+\n+ http://www.apache.org/licenses/LICENSE-2.0\n+\n+ Unless required by applicable law or agreed to in writing, software\n+ distributed under the License is distributed on an \"AS IS\" BASIS,\n+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ See the License for the specific language governing permissions and\n+ limitations under the License.\n", "new_path": "packages/dgraph/LICENSE", "old_path": null }, { "change_type": "ADD", "diff": "+# @thi.ng/dgraph\n+\n+[![npm (scoped)](https://img.shields.io/npm/v/@thi.ng/dgraph.svg)](https://www.npmjs.com/package/@thi.ng/dgraph)\n+\n+## About\n+\n+Nothing to see here yet. Pls ignore for now.\n+\n+TODO...\n+\n+## Installation\n+\n+```\n+yarn add @thi.ng/dgraph\n+```\n+\n+## Usage examples\n+\n+```typescript\n+import * as dgraph from \"@thi.ng/dgraph\";\n+```\n+\n+## Authors\n+\n+- Karsten Schmidt\n+\n+## License\n+\n+&copy; 2018 Karsten Schmidt // Apache Software License 2.0\n", "new_path": "packages/dgraph/README.md", "old_path": null }, { "change_type": "ADD", "diff": "+// TODO stub only\n+export class DGraph { }\n", "new_path": "packages/dgraph/src/index.ts", "old_path": null }, { "change_type": "ADD", "diff": "+// import * as assert from \"assert\";\n+// import * as dgraph from \"../src/index\";\n+\n+describe(\"dgraph\", () => {\n+ it(\"tests pending\");\n+});\n", "new_path": "packages/dgraph/test/index.ts", "old_path": null }, { "change_type": "ADD", "diff": "+{\n+ \"extends\": \"../../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \"../build\"\n+ },\n+ \"include\": [\n+ \"./**/*.ts\",\n+ \"../src/**/*.ts\"\n+ ]\n+}\n", "new_path": "packages/dgraph/test/tsconfig.json", "old_path": null }, { "change_type": "ADD", "diff": "+{\n+ \"extends\": \"../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \".\"\n+ },\n+ \"include\": [\n+ \"./src/**/*.ts\"\n+ ]\n+}\n", "new_path": "packages/dgraph/tsconfig.json", "old_path": null } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
build(dgraph): import dgraph package stub to avoid travis build errors
1
build
dgraph
679,913
05.04.2018 12:08:56
-3,600
8ce73078a54382760b1dcc328b08f10a8af4e3a7
refactor(examples): minor updates rstream-dflow
[ { "change_type": "MODIFY", "diff": "@@ -58,14 +58,18 @@ export function gestureStream(el: Element) {\nevt = e;\n}\nconst body = [[evt.clientX | 0, evt.clientY | 0]];\n- if (type == GestureType.START) {\n+ switch (type) {\n+ case GestureType.START:\nisDown = true;\nclickPos = body[0];\n- } else if (type == GestureType.END) {\n+ break;\n+ case GestureType.END:\nisDown = false;\nclickPos = null;\n- } else if (isDown) {\n+ break;\n+ case GestureType.DRAG:\nbody.push(clickPos, [body[0][0] - clickPos[0], body[0][1] - clickPos[1]]);\n+ default:\n}\nreturn [type, body];\n})\n", "new_path": "examples/rstream-dataflow/src/gesture-stream.ts", "old_path": "examples/rstream-dataflow/src/gesture-stream.ts" }, { "change_type": "MODIFY", "diff": "@@ -9,6 +9,7 @@ import { map } from \"@thi.ng/transducers/xform/map\";\nimport { gestureStream } from \"./gesture-stream\";\nimport { extract, initGraph, node } from \"./nodes\";\nimport { circle } from \"./circle\";\n+import { getIn } from \"@thi.ng/paths\";\n// infinite iterator of randomized circle colors (Tachyons CSS class names)\nconst colors = choices([\n@@ -20,7 +21,8 @@ const colors = choices([\n// debugging/stringifying state)\nconst db = new Atom<any>({});\n-// combined mouse & touch event stream this stream produces tuples of:\n+// combined mouse & touch event stream\n+// this stream produces tuples of:\n// [eventtype, [pos, clickpos, delta]]\n// Note: only single touches are supported, no multitouch!\nconst gestures = gestureStream(document.getElementById(\"app\"));\n@@ -30,16 +32,23 @@ const gestures = gestureStream(document.getElementById(\"app\"));\n// transforms these specs into a DAG (directed acyclic graph) of\n// @thi.ng/rstream types, so each \"node\" is actually implemented as a\n// stream of some kind...\n+// the strings assigned to `out` values represent keys/paths in the\n+// above `db` state atom and are used to store current stream values.\n+// they're not necessary, but used here to capture and display the\n+// current internal state of the graph and is useful for debugging /\n+// backup etc.\nconst graph = initGraph(db, {\n- // extracts current mouse/touch position\n+ // extracts current mouse/touch position from gesture tuple\n+ // the `[1, 0]` is the lookup path, i.e. `gesture[1][0]`\nmpos: {\nfn: extract([1, 0]),\nins: [{ stream: () => gestures }],\nout: \"mpos\"\n},\n- // extracts last click position\n+ // extracts last click position from gesture tuple\n+ // the `[1, 1]` is the lookup path, i.e. `gesture[1][1]`\n// (only defined during drag gestures)\nclickpos: {\nfn: extract([1, 1]),\n@@ -47,23 +56,23 @@ const graph = initGraph(db, {\nout: \"clickpos\"\n},\n- // computes distance between `clickpos` and `mpos`\n- // (only defined during drag gestures)\n+ // extracts & computes length of `delta` vector in gesture tuple\n+ // i.e. the distance between `clickpos` and current `mpos`\n+ // (`delta` is only defined during drag gestures)\ndist: {\n- fn: node(map(({ curr, click }) =>\n- curr && click &&\n- Math.hypot(curr[0] - click[0], curr[1] - click[1]) | 0)),\n- ins: [\n- { stream: \"mpos\", id: \"curr\" },\n- { stream: \"clickpos\", id: \"click\" },\n- ],\n+ fn: ([g]) => g.subscribe(map((gesture) => {\n+ const delta = getIn(gesture, [1, 2]);\n+ return delta && Math.hypot.apply(null, delta) | 0;\n+ })),\n+ ins: [{ stream: () => gestures }],\nout: \"dist\"\n},\n// combines `clickpos`, `dist` and `color` streams to produce a\n- // @thi.ng/hdom UI component (a circle around clickpos).\n+ // stream of @thi.ng/hdom UI components (a circle around clickpos).\n// the resulting stream is then directly included in this app's root\n- // component below...\n+ // component below... all inputs are locally renamed using the\n+ // stated input `id`s\ncircle: {\nfn: node(map(({ click, radius, color }) =>\nclick && radius && color ?\n", "new_path": "examples/rstream-dataflow/src/index.ts", "old_path": "examples/rstream-dataflow/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(examples): minor updates rstream-dflow
1
refactor
examples
791,690
05.04.2018 12:53:15
25,200
27fe117f878152bd55ffd6153794f29eac28e345
core(fast-config): bring back a11y & SEO categories
[ { "change_type": "MODIFY", "diff": "@@ -22,8 +22,6 @@ module.exports = {\n'offscreen-images',\n'load-fast-enough-for-pwa',\n],\n- // skip a11y for now because it's too slow and not in PSI-parity set\n- onlyCategories: ['performance', 'pwa', 'best-practices'],\n},\npasses: [\n{\n", "new_path": "lighthouse-core/config/fast-config.js", "old_path": "lighthouse-core/config/fast-config.js" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
core(fast-config): bring back a11y & SEO categories (#4932)
1
core
fast-config
679,913
05.04.2018 13:01:36
-3,600
a19f8a4dbc2dd2040e30eb8a6bd0b90f2ba14195
feat(examples): update rstream-dflow example add sine & radius nodes update graph diagram
[ { "change_type": "MODIFY", "diff": "@@ -13,13 +13,24 @@ digraph g {\ngestures -> mpos[label=extract];\ngestures -> clickpos[label=extract];\n-\n- mpos -> dist;\n- clickpos -> dist;\n+ gestures -> dist[label=extract];\nclickpos -> color[label=\"pick random\"];\nclickpos -> circle;\n- dist -> circle;\n+ radius -> circle;\ncolor -> circle;\n+\n+ RAF -> sine[label=\"frame counter\"];\n+\n+ sine -> radius;\n+ dist -> radius;\n+\n+ mousedown[color=\"#666666\"];\n+ mousemove[color=\"#666666\"];\n+ mouseup[color=\"#666666\"];\n+ touchstart[color=\"#666666\"];\n+ touchmove[color=\"#666666\"];\n+ touchend[color=\"#666666\"];\n+ RAF[color=\"#666666\"];\n}\n\\ No newline at end of file\n", "new_path": "assets/rs-dflow.dot", "old_path": "assets/rs-dflow.dot" }, { "change_type": "MODIFY", "diff": "Binary files a/assets/rs-dflow.png and b/assets/rs-dflow.png differ\n", "new_path": "assets/rs-dflow.png", "old_path": "assets/rs-dflow.png" }, { "change_type": "MODIFY", "diff": "+const px = (x: number) => x.toFixed(3) + \"px\";\n+\n// @thi.ng/hdom UI component function\nexport function circle(col: string, x: number, y: number, w: number, h = w) {\nreturn [\"div\", {\nclass: \"absolute z-1 white f7 tc br-100 \" + col,\nstyle: {\n- left: `${x - w / 2}px`,\n- top: `${y - h / 2}px`,\n- width: `${w}px`,\n- height: `${h}px`,\n- \"line-height\": `${h}px`,\n+ left: px(x - w / 2),\n+ top: px(y - h / 2),\n+ width: px(w),\n+ height: px(h),\n+ \"line-height\": px(h),\n}\n}, `${x};${y}`];\n}\n", "new_path": "examples/rstream-dataflow/src/circle.ts", "old_path": "examples/rstream-dataflow/src/circle.ts" }, { "change_type": "MODIFY", "diff": "import { equiv } from \"@thi.ng/api/equiv\";\nimport { Atom } from \"@thi.ng/atom/atom\";\nimport { start } from \"@thi.ng/hdom\";\n+import { getIn } from \"@thi.ng/paths\";\n+import { fromRAF } from \"@thi.ng/rstream/from/raf\";\nimport { comp } from \"@thi.ng/transducers/func/comp\";\nimport { choices } from \"@thi.ng/transducers/iter/choices\";\nimport { dedupe } from \"@thi.ng/transducers/xform/dedupe\";\nimport { map } from \"@thi.ng/transducers/xform/map\";\nimport { gestureStream } from \"./gesture-stream\";\n-import { extract, initGraph, node } from \"./nodes\";\n+import { extract, initGraph, node, mul } from \"./nodes\";\nimport { circle } from \"./circle\";\n-import { getIn } from \"@thi.ng/paths\";\n-// infinite iterator of randomized circle colors (Tachyons CSS class names)\n+// infinite iterator of randomized colors (Tachyons CSS class names)\n+// used by `color` graph node below\nconst colors = choices([\n\"bg-red\", \"bg-blue\", \"bg-gold\", \"bg-light-green\",\n\"bg-pink\", \"bg-light-purple\", \"bg-orange\", \"bg-gray\"\n]);\n// atom for storing dataflow results (optional, here only for\n-// debugging/stringifying state)\n+// debugging/stringifying graph state)\nconst db = new Atom<any>({});\n// combined mouse & touch event stream\n@@ -32,6 +34,11 @@ const gestures = gestureStream(document.getElementById(\"app\"));\n// transforms these specs into a DAG (directed acyclic graph) of\n// @thi.ng/rstream types, so each \"node\" is actually implemented as a\n// stream of some kind...\n+\n+// the lexical order of node specs is irrelevant, but since the graph is\n+// a DAG, no cyclic dependencies between nodes are allowed (and would\n+// result in a stack overflow during node resolution)\n+\n// the strings assigned to `out` values represent keys/paths in the\n// above `db` state atom and are used to store current stream values.\n// they're not necessary, but used here to capture and display the\n@@ -80,7 +87,7 @@ const graph = initGraph(db, {\nundefined)),\nins: [\n{ stream: \"clickpos\", id: \"click\" },\n- { stream: \"dist\", id: \"radius\" },\n+ { stream: \"radius\", id: \"radius\" },\n{ stream: \"color\", id: \"color\" },\n],\nout: \"circle\"\n@@ -100,6 +107,22 @@ const graph = initGraph(db, {\nmap((x) => x && colors.next().value))),\nins: [{ stream: \"clickpos\" }],\nout: \"color\"\n+ },\n+\n+ // transforms a RAF event stream (frame counter @ 60fps)\n+ // into a sine wave with 0.8 ... 1.0 interval\n+ sine: {\n+ fn: ([src]) => src.subscribe(map((x: number) => 0.8 + 0.2 * Math.sin(x * 0.05))),\n+ ins: [{ stream: () => fromRAF() }],\n+ out: \"sin\"\n+ },\n+\n+ // multiplies `dist` and `sine` streams to produce an animated\n+ // radius value for `circle`\n+ radius: {\n+ fn: mul,\n+ ins: [{ stream: \"sine\" }, { stream: \"dist\" }],\n+ out: \"radius\"\n}\n});\n", "new_path": "examples/rstream-dataflow/src/index.ts", "old_path": "examples/rstream-dataflow/src/index.ts" }, { "change_type": "MODIFY", "diff": "@@ -98,11 +98,13 @@ export const node = (xform: Transducer<IObjectOf<any>, any>, arity?: number) =>\n*/\nexport const add = node(\nmap((ports: IObjectOf<number>) => {\n- let sum = 0;\n+ let acc = 0;\n+ let v;\nfor (let p in ports) {\n- sum += ports[p];\n+ if ((v = ports[p]) == null) return;\n+ acc += v;\n}\n- return sum;\n+ return acc;\n}));\n/**\n@@ -111,11 +113,13 @@ export const add = node(\n*/\nexport const mul = node(\nmap((ports: IObjectOf<number>) => {\n- let sum = 1;\n+ let acc = 1;\n+ let v;\nfor (let p in ports) {\n- sum *= ports[p];\n+ if ((v = ports[p]) == null) return;\n+ acc *= v;\n}\n- return sum;\n+ return acc;\n}));\n/**\n", "new_path": "examples/rstream-dataflow/src/nodes.ts", "old_path": "examples/rstream-dataflow/src/nodes.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(examples): update rstream-dflow example - add sine & radius nodes - update graph diagram
1
feat
examples
679,913
05.04.2018 13:16:17
-3,600
37ba4d17c7cb4b018348110f37d2461782d30bde
refactor(examples): update rstream-dflow
[ { "change_type": "MODIFY", "diff": "@@ -9,7 +9,7 @@ import { dedupe } from \"@thi.ng/transducers/xform/dedupe\";\nimport { map } from \"@thi.ng/transducers/xform/map\";\nimport { gestureStream } from \"./gesture-stream\";\n-import { extract, initGraph, node, mul } from \"./nodes\";\n+import { extract, initGraph, node, node1, mul } from \"./nodes\";\nimport { circle } from \"./circle\";\n// infinite iterator of randomized colors (Tachyons CSS class names)\n@@ -66,8 +66,9 @@ const graph = initGraph(db, {\n// extracts & computes length of `delta` vector in gesture tuple\n// i.e. the distance between `clickpos` and current `mpos`\n// (`delta` is only defined during drag gestures)\n+ // `node1` is a helper function for nodes using only a single input\ndist: {\n- fn: ([g]) => g.subscribe(map((gesture) => {\n+ fn: node1(map((gesture) => {\nconst delta = getIn(gesture, [1, 2]);\nreturn delta && Math.hypot.apply(null, delta) | 0;\n})),\n@@ -80,6 +81,8 @@ const graph = initGraph(db, {\n// the resulting stream is then directly included in this app's root\n// component below... all inputs are locally renamed using the\n// stated input `id`s\n+ // `node` is a helper function to create a `StreamSync` based node\n+ // with multiple inputs\ncircle: {\nfn: node(map(({ click, radius, color }) =>\nclick && radius && color ?\n@@ -100,19 +103,15 @@ const graph = initGraph(db, {\n// time clickpos is redefined (remember, clickpos is only defined\n// during drag gestures)\ncolor: {\n- fn: ([click]) =>\n- click.subscribe(\n- comp(\n- dedupe(equiv),\n- map((x) => x && colors.next().value))),\n+ fn: node1(comp(dedupe(equiv), map((x) => x && colors.next().value))),\nins: [{ stream: \"clickpos\" }],\nout: \"color\"\n},\n- // transforms a RAF event stream (frame counter @ 60fps)\n- // into a sine wave with 0.8 ... 1.0 interval\n+ // transforms a `requestAnimationFrame` event stream (frame counter @ 60fps)\n+ // into a sine wave with 0.6 .. 1.0 interval\nsine: {\n- fn: ([src]) => src.subscribe(map((x: number) => 0.8 + 0.2 * Math.sin(x * 0.05))),\n+ fn: node1(map((x: number) => 0.8 + 0.2 * Math.sin(x * 0.05))),\nins: [{ stream: () => fromRAF() }],\nout: \"sin\"\n},\n", "new_path": "examples/rstream-dataflow/src/index.ts", "old_path": "examples/rstream-dataflow/src/index.ts" }, { "change_type": "MODIFY", "diff": "@@ -85,13 +85,21 @@ const nodeFromSpec = (state: IAtom<any>, spec: NodeSpec) => (resolve) => {\n* @param arity\n*/\nexport const node = (xform: Transducer<IObjectOf<any>, any>, arity?: number) =>\n- (src: ISubscribable<number>[]) => {\n+ (src: ISubscribable<any>[]) => {\nif (arity !== undefined && src.length !== arity) {\nillegalArgs(`wrong number of inputs: got ${src.length}, but needed ${arity}`);\n}\nreturn sync({ src, xform, reset: false });\n};\n+/**\n+ * Syntax sugar / helper fn for nodes using only single input.\n+ *\n+ * @param xform\n+ */\n+export const node1 = (xform: Transducer<any, any>) =>\n+ ([src]: ISubscribable<any>[]) => src.subscribe(xform);\n+\n/**\n* Addition node. Supports any number of inputs.\n* Currently unused, but illustrates use of `node` HOF.\n@@ -135,13 +143,6 @@ export const sub = node(map((ports: IObjectOf<number>) => ports.a - ports.b), 2)\nexport const div = node(map((ports: IObjectOf<number>) => ports.a / ports.b), 2);\n/**\n- * Nested value extraction node. Higher order function. Only 1 input\n- * allowed.\n+ * Nested value extraction node. Higher order function. Only 1 input.\n*/\n-export const extract = (path: Path) =>\n- (src: ISubscribable<any>[]) => {\n- if (src.length !== 1) {\n- illegalArgs(`too many inputs, only needed 1`);\n- }\n- return src[0].subscribe(map((x) => getIn(x, path)));\n- };\n\\ No newline at end of file\n+export const extract = (path: Path) => node1(map((x) => getIn(x, path)));\n\\ No newline at end of file\n", "new_path": "examples/rstream-dataflow/src/nodes.ts", "old_path": "examples/rstream-dataflow/src/nodes.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(examples): update rstream-dflow
1
refactor
examples
791,690
05.04.2018 14:55:23
25,200
8dad8af353c1d6658fde569de2f9e67f01dda499
core(lantern): cleanup Simulator construction
[ { "change_type": "MODIFY", "diff": "const Audit = require('../audit');\nconst ConsistentlyInteractive = require('../../gather/computed/metrics/lantern-consistently-interactive'); // eslint-disable-line max-len\n-const NetworkAnalysis = require('../../gather/computed/network-analysis');\n-const LoadSimulator = require('../../lib/dependency-graph/simulator/simulator.js');\n+const Simulator = require('../../lib/dependency-graph/simulator/simulator'); // eslint-disable-line no-unused-vars\nconst KB_IN_BYTES = 1024;\n@@ -69,33 +68,43 @@ class UnusedBytes extends Audit {\n}\n/**\n- * @param {!Artifacts} artifacts\n- * @return {!Promise<!AuditResult>}\n+ * @param {Artifacts} artifacts\n+ * @param {LH.Audit.Context=} context\n+ * @return {Promise<AuditResult>}\n*/\n- static audit(artifacts) {\n+ static audit(artifacts, context) {\nconst trace = artifacts.traces[Audit.DEFAULT_PASS];\nconst devtoolsLog = artifacts.devtoolsLogs[Audit.DEFAULT_PASS];\n+ const settings = context && context.settings || {};\n+ const simulatorOptions = {\n+ devtoolsLog,\n+ throttlingMethod: settings.throttlingMethod,\n+ throttling: settings.throttling,\n+ };\n+\nreturn artifacts\n.requestNetworkRecords(devtoolsLog)\n.then(networkRecords =>\nPromise.all([\nthis.audit_(artifacts, networkRecords),\nartifacts.requestPageDependencyGraph({trace, devtoolsLog}),\n+ artifacts.requestLoadSimulator(simulatorOptions),\n])\n)\n- .then(([result, graph]) => this.createAuditResult(result, graph));\n+ .then(([result, graph, simulator]) => this.createAuditResult(result, graph, simulator));\n}\n/**\n* Computes the estimated effect of all the byte savings on the last long task\n* in the provided graph.\n*\n- * @param {!Array<{url: string, wastedBytes: number}>} results The array of byte savings results per resource\n- * @param {!Node} graph\n+ * @param {Array<{url: string, wastedBytes: number}>} results The array of byte savings results per resource\n+ * @param {Node} graph\n+ * @param {Simulator} simulator\n* @return {number}\n*/\nstatic computeWasteWithTTIGraph(results, graph, simulator) {\n- const simulationBeforeChanges = simulator.simulate();\n+ const simulationBeforeChanges = simulator.simulate(graph);\nconst resultsByUrl = new Map();\nfor (const result of results) {\nresultsByUrl.set(result.url, result);\n@@ -112,7 +121,7 @@ class UnusedBytes extends Audit {\nnode.record._transferSize = Math.max(original - wastedBytes, 0);\n});\n- const simulationAfterChanges = simulator.simulate();\n+ const simulationAfterChanges = simulator.simulate(graph);\n// Restore the original transfer size after we've done our simulation\ngraph.traverse(node => {\nif (node.type !== 'network') return;\n@@ -131,20 +140,12 @@ class UnusedBytes extends Audit {\n}\n/**\n- * @param {!Audit.HeadingsResult} result\n- * @param {!Node} graph\n- * @return {!AuditResult}\n+ * @param {Audit.HeadingsResult} result\n+ * @param {Node} graph\n+ * @param {Simulator} simulator\n+ * @return {AuditResult}\n*/\n- static createAuditResult(result, graph) {\n- const records = [];\n- graph.traverse(node => node.record && records.push(node.record));\n- const simulatorOptions = NetworkAnalysis.computeRTTAndServerResponseTime(records);\n- // TODO: use rtt/throughput from config.settings instead of defaults\n- delete simulatorOptions.rtt;\n- // TODO: calibrate multipliers, see https://github.com/GoogleChrome/lighthouse/issues/820\n- Object.assign(simulatorOptions, {cpuSlowdownMultiplier: 1, layoutTaskMultiplier: 1});\n- const simulator = new LoadSimulator(graph, simulatorOptions);\n-\n+ static createAuditResult(result, graph, simulator) {\nconst debugString = result.debugString;\nconst results = result.results.sort((itemA, itemB) => itemB.wastedBytes - itemA.wastedBytes);\n", "new_path": "lighthouse-core/audits/byte-efficiency/byte-efficiency-audit.js", "old_path": "lighthouse-core/audits/byte-efficiency/byte-efficiency-audit.js" }, { "change_type": "MODIFY", "diff": "@@ -14,6 +14,8 @@ const DEVTOOLS_RTT_ADJUSTMENT_FACTOR = 3.75;\nconst DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR = 0.9;\nconst throttling = {\n+ DEVTOOLS_RTT_ADJUSTMENT_FACTOR,\n+ DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR,\nmobile3G: {\nrttMs: 150,\nthroughputKbps: 1.6 * 1024,\n", "new_path": "lighthouse-core/config/constants.js", "old_path": "lighthouse-core/config/constants.js" }, { "change_type": "ADD", "diff": "+/**\n+ * @license Copyright 2018 Google Inc. All Rights Reserved.\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n+ */\n+'use strict';\n+\n+const ComputedArtifact = require('./computed-artifact');\n+const constants = require('../../config/constants');\n+const Simulator = require('../../lib/dependency-graph/simulator/simulator');\n+\n+class LoadSimulatorArtifact extends ComputedArtifact {\n+ get name() {\n+ return 'LoadSimulator';\n+ }\n+\n+ /**\n+ * @param {{devtoolsLog: Array, settings: LH.ConfigSettings|undefined}} data\n+ * @param {!Artifacts} artifacts\n+ * @return {!Promise}\n+ */\n+ async compute_(data, artifacts) {\n+ const {throttlingMethod, throttling} = data.settings || {};\n+ const networkAnalysis = await artifacts.requestNetworkAnalysis(data.devtoolsLog);\n+\n+ const options = {\n+ additionalRttByOrigin: networkAnalysis.additionalRttByOrigin,\n+ serverResponseTimeByOrigin: networkAnalysis.serverResponseTimeByOrigin,\n+ };\n+\n+ switch (throttlingMethod) {\n+ case 'provided':\n+ options.rtt = networkAnalysis.rtt;\n+ options.throughput = networkAnalysis.throughput;\n+ options.cpuSlowdownMultiplier = 1;\n+ options.layoutTaskMultiplier = 1;\n+ break;\n+ case 'devtools':\n+ if (throttling) {\n+ options.rtt =\n+ throttling.requestLatencyMs / constants.throttling.DEVTOOLS_RTT_ADJUSTMENT_FACTOR;\n+ options.throughput =\n+ throttling.downloadThroughputKbps * 1024 /\n+ constants.throttling.DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR;\n+ }\n+\n+ options.cpuSlowdownMultiplier = 1;\n+ options.layoutTaskMultiplier = 1;\n+ break;\n+ case 'simulate':\n+ if (throttling) {\n+ options.rtt = throttling.rttMs;\n+ options.throughput = throttling.throughputKbps * 1024;\n+ options.cpuSlowdownMultiplier = throttling.cpuSlowdownMultiplier;\n+ }\n+ break;\n+ default:\n+ // intentionally fallback to simulator defaults\n+ break;\n+ }\n+\n+ return new Simulator(options);\n+ }\n+}\n+\n+module.exports = LoadSimulatorArtifact;\n", "new_path": "lighthouse-core/gather/computed/load-simulator.js", "old_path": null }, { "change_type": "MODIFY", "diff": "const ComputedArtifact = require('../computed-artifact');\nconst Node = require('../../../lib/dependency-graph/node');\nconst NetworkNode = require('../../../lib/dependency-graph/network-node'); // eslint-disable-line no-unused-vars\n-const Simulator = require('../../../lib/dependency-graph/simulator/simulator');\n+const Simulator = require('../../../lib/dependency-graph/simulator/simulator'); // eslint-disable-line no-unused-vars\nconst WebInspector = require('../../../lib/web-inspector');\nclass LanternMetricArtifact extends ComputedArtifact {\n@@ -75,19 +75,15 @@ class LanternMetricArtifact extends ComputedArtifact {\nconst {trace, devtoolsLog} = data;\nconst graph = await artifacts.requestPageDependencyGraph({trace, devtoolsLog});\nconst traceOfTab = await artifacts.requestTraceOfTab(trace);\n- const networkAnalysis = await artifacts.requestNetworkAnalysis(devtoolsLog);\n+ // TODO(phulce): passthrough settings once all metrics are converted to computed artifacts\n+ /** @type {Simulator} */\n+ const simulator = await artifacts.requestLoadSimulator({devtoolsLog});\nconst optimisticGraph = this.getOptimisticGraph(graph, traceOfTab);\nconst pessimisticGraph = this.getPessimisticGraph(graph, traceOfTab);\n- // TODO(phulce): use rtt and throughput from config.settings instead of defaults\n- const options = {\n- additionalRttByOrigin: networkAnalysis.additionalRttByOrigin,\n- serverResponseTimeByOrigin: networkAnalysis.serverResponseTimeByOrigin,\n- };\n-\n- const optimisticSimulation = new Simulator(optimisticGraph, options).simulate();\n- const pessimisticSimulation = new Simulator(pessimisticGraph, options).simulate();\n+ const optimisticSimulation = simulator.simulate(optimisticGraph);\n+ const pessimisticSimulation = simulator.simulate(pessimisticGraph);\nconst optimisticEstimate = this.getEstimateFromSimulation(\noptimisticSimulation,\n", "new_path": "lighthouse-core/gather/computed/metrics/lantern-metric.js", "old_path": "lighthouse-core/gather/computed/metrics/lantern-metric.js" }, { "change_type": "MODIFY", "diff": "@@ -50,7 +50,7 @@ class NetworkAnalysis extends ComputedArtifact {\nconst records = await artifacts.requestNetworkRecords(devtoolsLog);\nconst throughput = await artifacts.requestNetworkThroughput(devtoolsLog);\nconst rttAndServerResponseTime = NetworkAnalysis.computeRTTAndServerResponseTime(records);\n- rttAndServerResponseTime.throughput = throughput;\n+ rttAndServerResponseTime.throughput = throughput * 8; // convert from KBps to Kbps\nreturn rttAndServerResponseTime;\n}\n}\n", "new_path": "lighthouse-core/gather/computed/network-analysis.js", "old_path": "lighthouse-core/gather/computed/network-analysis.js" }, { "change_type": "MODIFY", "diff": "@@ -65,6 +65,7 @@ class NetworkThroughput extends ComputedArtifact {\n* @return {!Promise<!Object>}\n*/\ncompute_(devtoolsLog, artifacts) {\n+ // TODO(phulce): migrate this to network-analysis computed artifact\nreturn artifacts.requestNetworkRecords(devtoolsLog)\n.then(NetworkThroughput.getThroughput);\n}\n", "new_path": "lighthouse-core/gather/computed/network-throughput.js", "old_path": "lighthouse-core/gather/computed/network-throughput.js" }, { "change_type": "MODIFY", "diff": "@@ -444,8 +444,8 @@ class GatherRunner {\n.then(_ => GatherRunner.disposeDriver(driver))\n.then(_ => GatherRunner.collectArtifacts(gathererResults))\n.then(artifacts => {\n- // Add tracing data to the artifacts object.\n- return Object.assign(artifacts, tracingData);\n+ // Add tracing data and settings used to the artifacts object.\n+ return Object.assign(artifacts, tracingData, {settings: options.settings});\n})\n// cleanup on error\n.catch(err => {\n", "new_path": "lighthouse-core/gather/gather-runner.js", "old_path": "lighthouse-core/gather/gather-runner.js" }, { "change_type": "MODIFY", "diff": "@@ -28,11 +28,9 @@ const NodeState = {\nclass Simulator {\n/**\n- * @param {Node} graph\n* @param {LH.Gatherer.Simulation.Options} [options]\n*/\n- constructor(graph, options) {\n- this._graph = graph;\n+ constructor(options) {\nthis._options = Object.assign(\n{\nrtt: mobile3G.rttMs,\n@@ -46,13 +44,14 @@ class Simulator {\nthis._rtt = this._options.rtt;\nthis._throughput = this._options.throughput;\n- this._maximumConcurrentRequests = Math.min(\n+ this._maximumConcurrentRequests = Math.max(Math.min(\nTcpConnection.maximumSaturatedConnections(this._rtt, this._throughput),\nthis._options.maximumConcurrentRequests\n- );\n+ ), 1);\nthis._cpuSlowdownMultiplier = this._options.cpuSlowdownMultiplier;\nthis._layoutTaskMultiplier = this._cpuSlowdownMultiplier * this._options.layoutTaskMultiplier;\n+ // Properties reset on every `.simulate` call but duplicated here for type checking\nthis._nodeTiming = new Map();\nthis._numberInProgressByType = new Map();\nthis._nodes = {};\n@@ -61,12 +60,12 @@ class Simulator {\n}\n/**\n- *\n+ * @param {Node} graph\n*/\n- _initializeConnectionPool() {\n+ _initializeConnectionPool(graph) {\n/** @type {LH.WebInspector.NetworkRequest[]} */\nconst records = [];\n- this._graph.getRootNode().traverse(node => {\n+ graph.getRootNode().traverse(node => {\nif (node.type === Node.TYPES.NETWORK) {\nrecords.push(/** @type {NetworkNode} */ (node).record);\n}\n@@ -281,18 +280,19 @@ class Simulator {\n/**\n* Estimates the time taken to process all of the graph's nodes.\n+ * @param {Node} graph\n* @return {LH.Gatherer.Simulation.Result}\n*/\n- simulate() {\n+ simulate(graph) {\n// initialize the necessary data containers\n- this._initializeConnectionPool();\n+ this._initializeConnectionPool(graph);\nthis._initializeAuxiliaryData();\nconst nodesNotReadyToStart = this._nodes[NodeState.NotReadyToStart];\nconst nodesReadyToStart = this._nodes[NodeState.ReadyToStart];\nconst nodesInProgress = this._nodes[NodeState.InProgress];\n- const rootNode = this._graph.getRootNode();\n+ const rootNode = graph.getRootNode();\nrootNode.traverse(node => nodesNotReadyToStart.add(node));\nlet totalElapsedTime = 0;\n", "new_path": "lighthouse-core/lib/dependency-graph/simulator/simulator.js", "old_path": "lighthouse-core/lib/dependency-graph/simulator/simulator.js" }, { "change_type": "MODIFY", "diff": "// @ts-nocheck\n'use strict';\n+const isDeepEqual = require('lodash.isequal');\nconst Driver = require('./gather/driver.js');\nconst GatherRunner = require('./gather/gather-runner');\nconst ReportScoring = require('./scoring');\n@@ -177,12 +178,23 @@ class Runner {\nartifacts = Object.assign(Runner.instantiateComputedArtifacts(),\nartifacts || opts.config.artifacts);\n+ if (artifacts.settings) {\n+ const overrides = {gatherMode: undefined, auditMode: undefined};\n+ const normalizedGatherSettings = Object.assign({}, artifacts.settings, overrides);\n+ const normalizedAuditSettings = Object.assign({}, opts.settings, overrides);\n+\n+ // TODO(phulce): allow change of throttling method to `simulate`\n+ if (!isDeepEqual(normalizedGatherSettings, normalizedAuditSettings)) {\n+ throw new Error('Cannot change settings between gathering and auditing');\n+ }\n+ }\n+\n// Run each audit sequentially\nconst auditResults = [];\nlet promise = Promise.resolve();\nfor (const auditDefn of opts.config.audits) {\npromise = promise.then(_ => {\n- return Runner._runAudit(auditDefn, artifacts).then(ret => auditResults.push(ret));\n+ return Runner._runAudit(auditDefn, artifacts, opts).then(ret => auditResults.push(ret));\n});\n}\nreturn promise.then(_ => {\n@@ -204,10 +216,11 @@ class Runner {\n* Otherwise returns error audit result.\n* @param {!Audit} audit\n* @param {!Artifacts} artifacts\n+ * @param {{settings: LH.ConfigSettings}} opts\n* @return {!Promise<!AuditResult>}\n* @private\n*/\n- static _runAudit(auditDefn, artifacts) {\n+ static _runAudit(auditDefn, artifacts, opts) {\nconst audit = auditDefn.implementation;\nconst status = `Evaluating: ${audit.meta.description}`;\n@@ -248,7 +261,7 @@ class Runner {\n}\n}\n// all required artifacts are in good shape, so we proceed\n- return audit.audit(artifacts, {options: auditDefn.options || {}});\n+ return audit.audit(artifacts, {options: auditDefn.options || {}, settings: opts.settings});\n// Fill remaining audit result fields.\n}).then(auditResult => Audit.generateAuditResult(audit, auditResult))\n.catch(err => {\n", "new_path": "lighthouse-core/runner.js", "old_path": "lighthouse-core/runner.js" }, { "change_type": "MODIFY", "diff": "@@ -9,6 +9,7 @@ const Runner = require('../../../runner');\nconst ByteEfficiencyAudit = require('../../../audits/byte-efficiency/byte-efficiency-audit');\nconst NetworkNode = require('../../../lib/dependency-graph/network-node');\nconst CPUNode = require('../../../lib/dependency-graph/cpu-node');\n+const Simulator = require('../../../lib/dependency-graph/simulator/simulator');\nconst trace = require('../../fixtures/traces/progressive-app-m60.json');\nconst devtoolsLog = require('../../fixtures/traces/progressive-app-m60.devtools.log.json');\n@@ -18,6 +19,7 @@ const assert = require('assert');\ndescribe('Byte efficiency base audit', () => {\nlet graph;\n+ let simulator;\nbeforeEach(() => {\nconst networkRecord = {\n@@ -37,6 +39,7 @@ describe('Byte efficiency base audit', () => {\ngraph = new NetworkNode(networkRecord);\n// add a CPU node to force improvement to TTI\ngraph.addDependent(new CPUNode({tid: 1, ts: 0, dur: 100 * 1000}));\n+ simulator = new Simulator({});\n});\nconst baseHeadings = [\n@@ -76,7 +79,7 @@ describe('Byte efficiency base audit', () => {\nconst result = ByteEfficiencyAudit.createAuditResult({\nheadings: baseHeadings,\nresults: [],\n- }, graph);\n+ }, graph, simulator);\nassert.deepEqual(result.details.items, []);\n});\n@@ -89,7 +92,8 @@ describe('Byte efficiency base audit', () => {\n{url: 'http://example.com/', wastedBytes: 200 * 1000},\n],\n},\n- graph\n+ graph,\n+ simulator\n);\n// 900ms savings comes from the graph calculation\n@@ -100,22 +104,22 @@ describe('Byte efficiency base audit', () => {\nconst perfectResult = ByteEfficiencyAudit.createAuditResult({\nheadings: baseHeadings,\nresults: [{url: 'http://example.com/', wastedBytes: 1 * 1000}],\n- }, graph);\n+ }, graph, simulator);\nconst goodResult = ByteEfficiencyAudit.createAuditResult({\nheadings: baseHeadings,\nresults: [{url: 'http://example.com/', wastedBytes: 20 * 1000}],\n- }, graph);\n+ }, graph, simulator);\nconst averageResult = ByteEfficiencyAudit.createAuditResult({\nheadings: baseHeadings,\nresults: [{url: 'http://example.com/', wastedBytes: 100 * 1000}],\n- }, graph);\n+ }, graph, simulator);\nconst failingResult = ByteEfficiencyAudit.createAuditResult({\nheadings: baseHeadings,\nresults: [{url: 'http://example.com/', wastedBytes: 400 * 1000}],\n- }, graph);\n+ }, graph, simulator);\nassert.equal(perfectResult.score, 1, 'scores perfect wastedMs');\nassert.ok(goodResult.score > 0.75 && goodResult.score < 1, 'scores good wastedMs');\n@@ -139,7 +143,7 @@ describe('Byte efficiency base audit', () => {\n{wastedBytes: 2048, totalBytes: 4096, wastedPercent: 50},\n{wastedBytes: 1986, totalBytes: 5436},\n],\n- }, graph);\n+ }, graph, simulator);\nassert.equal(result.details.items[0].wastedBytes, 2048);\nassert.equal(result.details.items[0].totalBytes, 4096);\n@@ -155,7 +159,7 @@ describe('Byte efficiency base audit', () => {\n{wastedBytes: 450, totalBytes: 1000, wastedPercent: 50},\n{wastedBytes: 400, totalBytes: 450, wastedPercent: 50},\n],\n- }, graph);\n+ }, graph, simulator);\nassert.equal(result.details.items[0].wastedBytes, 450);\nassert.equal(result.details.items[1].wastedBytes, 400);\n@@ -170,14 +174,17 @@ describe('Byte efficiency base audit', () => {\n{wastedBytes: 512, totalBytes: 1000, wastedPercent: 50},\n{wastedBytes: 1024, totalBytes: 1200, wastedPercent: 50},\n],\n- }, graph);\n+ }, graph, simulator);\nassert.ok(result.displayValue.includes('2048 bytes'), 'contains correct bytes');\n});\n- it('should work on real graphs', () => {\n+ it('should work on real graphs', async () => {\n+ const throttling = {rttMs: 150, throughputKbps: 1600, cpuSlowdownMultiplier: 1};\n+ const settings = {throttlingMethod: 'simulate', throttling};\nconst artifacts = Runner.instantiateComputedArtifacts();\n- return artifacts.requestPageDependencyGraph({trace, devtoolsLog}).then(graph => {\n+ const graph = await artifacts.requestPageDependencyGraph({trace, devtoolsLog});\n+ const simulator = await artifacts.requestLoadSimulator({devtoolsLog, settings});\nconst result = ByteEfficiencyAudit.createAuditResult(\n{\nheadings: [{key: 'value', text: 'Label'}],\n@@ -185,10 +192,10 @@ describe('Byte efficiency base audit', () => {\n{url: 'https://www.googletagmanager.com/gtm.js?id=GTM-Q5SW', wastedBytes: 30 * 1024},\n],\n},\n- graph\n+ graph,\n+ simulator\n);\nassert.equal(result.rawValue, 300);\n});\n});\n-});\n", "new_path": "lighthouse-core/test/audits/byte-efficiency/byte-efficiency-audit-test.js", "old_path": "lighthouse-core/test/audits/byte-efficiency/byte-efficiency-audit-test.js" }, { "change_type": "ADD", "diff": "+/**\n+ * @license Copyright 2018 Google Inc. All Rights Reserved.\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n+ */\n+'use strict';\n+\n+/* eslint-env mocha */\n+\n+const Runner = require('../../../runner');\n+const assert = require('assert');\n+const devtoolsLog = require('../../fixtures/traces/progressive-app-m60.devtools.log.json');\n+\n+describe('Simulator artifact', () => {\n+ it('returns a simulator for \"provided\" throttling', async () => {\n+ const artifacts = Runner.instantiateComputedArtifacts();\n+\n+ const simulator = await artifacts.requestLoadSimulator({\n+ devtoolsLog,\n+ settings: {throttlingMethod: 'provided'},\n+ });\n+\n+ assert.equal(Math.round(simulator._rtt), 3);\n+ assert.equal(Math.round(simulator._throughput / 1024), 1590);\n+ assert.equal(simulator._cpuSlowdownMultiplier, 1);\n+ assert.equal(simulator._layoutTaskMultiplier, 1);\n+ });\n+\n+ it('returns a simulator for \"devtools\" throttling', async () => {\n+ const artifacts = Runner.instantiateComputedArtifacts();\n+\n+ const throttling = {requestLatencyMs: 375, downloadThroughputKbps: 900};\n+ const simulator = await artifacts.requestLoadSimulator({\n+ devtoolsLog,\n+ settings: {throttlingMethod: 'devtools', throttling},\n+ });\n+\n+ assert.equal(simulator._rtt, 100);\n+ assert.equal(simulator._throughput / 1024, 1000);\n+ assert.equal(simulator._cpuSlowdownMultiplier, 1);\n+ assert.equal(simulator._layoutTaskMultiplier, 1);\n+ });\n+\n+ it('returns a simulator for \"simulate\" throttling', async () => {\n+ const artifacts = Runner.instantiateComputedArtifacts();\n+\n+ const throttling = {rttMs: 120, throughputKbps: 1000, cpuSlowdownMultiplier: 3};\n+ const simulator = await artifacts.requestLoadSimulator({\n+ devtoolsLog,\n+ settings: {throttlingMethod: 'simulate', throttling},\n+ });\n+\n+ assert.equal(simulator._rtt, 120);\n+ assert.equal(simulator._throughput / 1024, 1000);\n+ assert.equal(simulator._cpuSlowdownMultiplier, 3);\n+ assert.equal(simulator._layoutTaskMultiplier, 1.5);\n+ });\n+});\n", "new_path": "lighthouse-core/test/gather/computed/load-simulator-test.js", "old_path": null }, { "change_type": "MODIFY", "diff": "@@ -49,8 +49,8 @@ describe('DependencyGraph/Simulator', () => {\nit('should simulate basic network graphs', () => {\nconst rootNode = new NetworkNode(request({}));\n- const simulator = new Simulator(rootNode, {serverResponseTimeByOrigin});\n- const result = simulator.simulate();\n+ const simulator = new Simulator({serverResponseTimeByOrigin});\n+ const result = simulator.simulate(rootNode);\n// should be 2 RTTs and 500ms for the server response time\nassert.equal(result.timeInMs, 300 + 500);\nassertNodeTiming(result, rootNode, {startTime: 0, endTime: 800});\n@@ -61,11 +61,11 @@ describe('DependencyGraph/Simulator', () => {\nconst cpuNode = new CpuNode(cpuTask({duration: 200}));\ncpuNode.addDependency(rootNode);\n- const simulator = new Simulator(rootNode, {\n+ const simulator = new Simulator({\nserverResponseTimeByOrigin,\ncpuSlowdownMultiplier: 5,\n});\n- const result = simulator.simulate();\n+ const result = simulator.simulate(rootNode);\n// should be 2 RTTs and 500ms for the server response time + 200 CPU\nassert.equal(result.timeInMs, 300 + 500 + 200);\nassertNodeTiming(result, rootNode, {startTime: 0, endTime: 800});\n@@ -82,8 +82,8 @@ describe('DependencyGraph/Simulator', () => {\nnodeB.addDependent(nodeC);\nnodeC.addDependent(nodeD);\n- const simulator = new Simulator(nodeA, {serverResponseTimeByOrigin});\n- const result = simulator.simulate();\n+ const simulator = new Simulator({serverResponseTimeByOrigin});\n+ const result = simulator.simulate(nodeA);\n// should be 800ms each for A, B, C, D\nassert.equal(result.timeInMs, 3200);\nassertNodeTiming(result, nodeA, {startTime: 0, endTime: 800});\n@@ -102,11 +102,11 @@ describe('DependencyGraph/Simulator', () => {\nnodeA.addDependent(nodeC);\nnodeA.addDependent(nodeD);\n- const simulator = new Simulator(nodeA, {\n+ const simulator = new Simulator({\nserverResponseTimeByOrigin,\ncpuSlowdownMultiplier: 5,\n});\n- const result = simulator.simulate();\n+ const result = simulator.simulate(nodeA);\n// should be 800ms A, then 1000 ms total for B, C, D in serial\nassert.equal(result.timeInMs, 1800);\nassertNodeTiming(result, nodeA, {startTime: 0, endTime: 800});\n@@ -129,11 +129,11 @@ describe('DependencyGraph/Simulator', () => {\nnodeC.addDependent(nodeD);\nnodeC.addDependent(nodeF); // finishes 400 ms after D\n- const simulator = new Simulator(nodeA, {\n+ const simulator = new Simulator({\nserverResponseTimeByOrigin,\ncpuSlowdownMultiplier: 5,\n});\n- const result = simulator.simulate();\n+ const result = simulator.simulate(nodeA);\n// should be 800ms each for A, B, C, D, with F finishing 400 ms after D\nassert.equal(result.timeInMs, 3600);\n});\n@@ -148,8 +148,8 @@ describe('DependencyGraph/Simulator', () => {\nnodeA.addDependent(nodeC);\nnodeA.addDependent(nodeD);\n- const simulator = new Simulator(nodeA, {serverResponseTimeByOrigin});\n- const result = simulator.simulate();\n+ const simulator = new Simulator({serverResponseTimeByOrigin});\n+ const result = simulator.simulate(nodeA);\n// should be 800ms for A and 950ms for C (2 round trips of downloading)\nassert.equal(result.timeInMs, 800 + 950);\n});\n@@ -164,8 +164,8 @@ describe('DependencyGraph/Simulator', () => {\nnodeA.addDependent(nodeC);\nnodeA.addDependent(nodeD);\n- const simulator = new Simulator(nodeA, {serverResponseTimeByOrigin});\n- const result = simulator.simulate();\n+ const simulator = new Simulator({serverResponseTimeByOrigin});\n+ const result = simulator.simulate(nodeA);\n// should be 800ms for A and 650ms for the next 3\nassert.equal(result.timeInMs, 800 + 650 * 3);\n});\n@@ -180,10 +180,38 @@ describe('DependencyGraph/Simulator', () => {\nnodeA.addDependent(nodeC);\nnodeA.addDependent(nodeD);\n- const simulator = new Simulator(nodeA, {serverResponseTimeByOrigin});\n- const result = simulator.simulate();\n+ const simulator = new Simulator({serverResponseTimeByOrigin});\n+ const result = simulator.simulate(nodeA);\n// should be 800ms for A and 950ms for C (2 round trips of downloading)\nassert.equal(result.timeInMs, 800 + 950);\n});\n+\n+ it('should simulate two graphs in a row', () => {\n+ const simulator = new Simulator({serverResponseTimeByOrigin});\n+\n+ const nodeA = new NetworkNode(request({}));\n+ const nodeB = new NetworkNode(request({}));\n+ const nodeC = new NetworkNode(request({transferSize: 15000}));\n+ const nodeD = new NetworkNode(request({}));\n+\n+ nodeA.addDependent(nodeB);\n+ nodeA.addDependent(nodeC);\n+ nodeA.addDependent(nodeD);\n+\n+ const resultA = simulator.simulate(nodeA);\n+ // should be 800ms for A and 950ms for C (2 round trips of downloading)\n+ assert.equal(resultA.timeInMs, 800 + 950);\n+\n+ const nodeE = new NetworkNode(request({}));\n+ const nodeF = new NetworkNode(request({}));\n+ const nodeG = new NetworkNode(request({}));\n+\n+ nodeE.addDependent(nodeF);\n+ nodeE.addDependent(nodeG);\n+\n+ const resultB = simulator.simulate(nodeE);\n+ // should be 800ms for E and 800ms for F/G\n+ assert.equal(resultB.timeInMs, 800 + 800);\n+ });\n});\n});\n", "new_path": "lighthouse-core/test/lib/dependency-graph/simulator/simulator-test.js", "old_path": "lighthouse-core/test/lib/dependency-graph/simulator/simulator-test.js" }, { "change_type": "MODIFY", "diff": "@@ -83,6 +83,17 @@ describe('Runner', () => {\n});\n});\n+ it('-A throws if the settings change', async () => {\n+ const settings = {auditMode: artifactsPath, disableDeviceEmulation: true};\n+ const opts = {url, config: generateConfig(settings), driverMock};\n+ try {\n+ await Runner.run(null, opts);\n+ assert.fail('should have thrown');\n+ } catch (err) {\n+ assert.ok(/Cannot change settings/.test(err.message), 'should have prevented run');\n+ }\n+ });\n+\nit('-GA is a normal run but it saves artifacts to disk', () => {\nconst settings = {auditMode: artifactsPath, gatherMode: artifactsPath};\nconst opts = {url, config: generateConfig(settings), driverMock};\n", "new_path": "lighthouse-core/test/runner-test.js", "old_path": "lighthouse-core/test/runner-test.js" }, { "change_type": "MODIFY", "diff": "declare global {\nmodule LH.Audit {\n+ export interface Context {\n+ options: Object; // audit options\n+ settings: ConfigSettings;\n+ }\n+\nexport interface ScoringModes {\nNUMERIC: 'numeric';\nBINARY: 'binary';\n", "new_path": "typings/audit.d.ts", "old_path": "typings/audit.d.ts" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
core(lantern): cleanup Simulator construction (#4910)
1
core
lantern
730,424
05.04.2018 17:21:07
14,400
1dca83e4b1d4ac5a18b0fec069156c4fa451abe0
fix(react-component-chip-base): Add aria-label
[ { "change_type": "MODIFY", "diff": "@@ -12,7 +12,7 @@ exports[`ChipBase component renders properly 1`] = `\nclassName=\"ciscospark-button-container buttonContainer\"\n>\n<button\n- aria-label=\"\"\n+ aria-label=\"Delete Share\"\nclassName=\"ciscospark-button button\"\nonClick={[Function]}\nonKeyPress={[Function]}\n", "new_path": "packages/node_modules/@ciscospark/react-component-chip-base/src/__snapshots__/index.test.js.snap", "old_path": "packages/node_modules/@ciscospark/react-component-chip-base/src/__snapshots__/index.test.js.snap" }, { "change_type": "MODIFY", "diff": "@@ -31,7 +31,12 @@ function ChipBase(props) {\n<div className={classNames('ciscospark-chip', styles.chip)}>\n{children}\n<div className={classNames('ciscospark-chip-action', styles.action)}>\n- <Button iconColor=\"#6a6b6c\" iconType={ICONS.ICON_TYPE_DELETE} onClick={handleRemove} />\n+ <Button\n+ accessibilityLabel=\"Delete Share\"\n+ iconColor=\"#6a6b6c\"\n+ iconType={ICONS.ICON_TYPE_DELETE}\n+ onClick={handleRemove}\n+ />\n</div>\n</div>\n);\n", "new_path": "packages/node_modules/@ciscospark/react-component-chip-base/src/index.js", "old_path": "packages/node_modules/@ciscospark/react-component-chip-base/src/index.js" }, { "change_type": "MODIFY", "diff": "@@ -42,7 +42,7 @@ exports[`ChipFile component renders properly 1`] = `\nclassName=\"ciscospark-button-container buttonContainer\"\n>\n<button\n- aria-label=\"\"\n+ aria-label=\"Delete Share\"\nclassName=\"ciscospark-button button\"\nonClick={[Function]}\nonKeyPress={[Function]}\n", "new_path": "packages/node_modules/@ciscospark/react-component-chip-file/src/__snapshots__/index.test.js.snap", "old_path": "packages/node_modules/@ciscospark/react-component-chip-file/src/__snapshots__/index.test.js.snap" }, { "change_type": "MODIFY", "diff": "@@ -82,7 +82,7 @@ exports[`FileStagingArea component renders properly 1`] = `\nclassName=\"ciscospark-button-container buttonContainer\"\n>\n<button\n- aria-label=\"\"\n+ aria-label=\"Delete Share\"\nclassName=\"ciscospark-button button\"\nonClick={[Function]}\nonKeyPress={[Function]}\n@@ -199,7 +199,7 @@ exports[`FileStagingArea component renders properly 1`] = `\nclassName=\"ciscospark-button-container buttonContainer\"\n>\n<button\n- aria-label=\"\"\n+ aria-label=\"Delete Share\"\nclassName=\"ciscospark-button button\"\nonClick={[Function]}\nonKeyPress={[Function]}\n", "new_path": "packages/node_modules/@ciscospark/react-component-file-staging-area/src/__snapshots__/index.test.js.snap", "old_path": "packages/node_modules/@ciscospark/react-component-file-staging-area/src/__snapshots__/index.test.js.snap" }, { "change_type": "MODIFY", "diff": "@@ -85,7 +85,7 @@ exports[`FileUploader container renders properly 1`] = `\nclassName=\"ciscospark-button-container buttonContainer\"\n>\n<button\n- aria-label=\"\"\n+ aria-label=\"Delete Share\"\nclassName=\"ciscospark-button button\"\nonClick={[Function]}\nonKeyPress={[Function]}\n@@ -202,7 +202,7 @@ exports[`FileUploader container renders properly 1`] = `\nclassName=\"ciscospark-button-container buttonContainer\"\n>\n<button\n- aria-label=\"\"\n+ aria-label=\"Delete Share\"\nclassName=\"ciscospark-button button\"\nonClick={[Function]}\nonKeyPress={[Function]}\n", "new_path": "packages/node_modules/@ciscospark/react-container-file-uploader/src/__snapshots__/index.test.js.snap", "old_path": "packages/node_modules/@ciscospark/react-container-file-uploader/src/__snapshots__/index.test.js.snap" } ]
JavaScript
MIT License
webex/react-widgets
fix(react-component-chip-base): Add aria-label
1
fix
react-component-chip-base
821,196
05.04.2018 18:45:28
25,200
9cb57acf2f7f64f8a0d7e27c4dd14832631c20de
fix: use package-lock.json or yarn.lock from root only
[ { "change_type": "MODIFY", "diff": "@@ -471,7 +471,7 @@ class App extends Generator {\n'*-error.log',\n'/node_modules',\n'/tmp',\n- this.yarn ? 'package-lock.json' : 'yarn.lock',\n+ this.yarn ? '/package-lock.json' : '/yarn.lock',\nthis.ts && '/lib',\n])\n.concat(existing)\n", "new_path": "src/generators/app.ts", "old_path": "src/generators/app.ts" } ]
TypeScript
MIT License
oclif/oclif
fix: use package-lock.json or yarn.lock from root only
1
fix
null
815,746
06.04.2018 10:17:08
-10,800
aff84680c62ac3333bd6748b988def1830a4685e
fix: use Map to preserve groups order
[ { "change_type": "MODIFY", "diff": "#!/bin/bash\ngit pull\n+# update changelog\ncd ./src\nnode ../node_modules/standard-version/bin/cli.js --infile ../CHANGELOG.md\ncd ..\n+\n+# build lib\nyarn run build\n-read -p \"Check changelog and press enter to push tags\" tags\n+# push tags\ngit push --follow-tags origin master\n-read -p \"One more thing. Press enter to release to npm\" npm\n+# push to npm\ncp README.md ./dist\ncd ./dist\nyarn publish --access=public\n", "new_path": "release.sh", "old_path": "release.sh" }, { "change_type": "MODIFY", "diff": "@@ -3,11 +3,13 @@ import * as searchHelper from './search-helper';\nimport { NgSelectComponent } from './ng-select.component';\nimport { isObject, isDefined } from './value-utils';\n+type OptionGroups = Map<string, NgOption[]>;\n+\nexport class ItemsList {\nprivate _items: NgOption[] = [];\nprivate _filteredItems: NgOption[] = [];\n- private _groups: { [index: string]: NgOption[] };\n+ private _groups: OptionGroups;\nprivate _markedIndex = -1;\nprivate _selected: NgOption[] = [];\n@@ -47,7 +49,8 @@ export class ItemsList {\nthis._groups = this._groupBy(this._items, this._ngSelect.groupBy);\nthis._items = this._flatten(this._groups);\n} else {\n- this._groups = { undefined: this._items };\n+ this._groups = new Map();\n+ this._groups.set(undefined, this._items)\n}\nthis._filteredItems = [...this._items];\n}\n@@ -125,9 +128,9 @@ export class ItemsList {\nterm = this._ngSelect.searchFn ? term : searchHelper.stripSpecialChars(term).toLocaleLowerCase();\nconst match = this._ngSelect.searchFn || this._defaultSearchFn;\n- for (const key of Object.keys(this._groups)) {\n+ for (const key of Array.from(this._groups.keys())) {\nconst matchedItems = [];\n- for (const item of this._groups[key]) {\n+ for (const item of this._groups.get(key)) {\nif (this._ngSelect.hideSelected && this._selected.indexOf(item) > -1) {\ncontinue;\n}\n@@ -255,20 +258,25 @@ export class ItemsList {\nreturn this._selected[this._selected.length - 1];\n}\n- private _groupBy(items: NgOption[], prop: string | Function): { [index: string]: NgOption[] } {\n+ private _groupBy(items: NgOption[], prop: string | Function): OptionGroups {\nconst isPropFn = prop instanceof Function;\nconst groups = items.reduce((grouped, item) => {\nconst key = isPropFn ? (<Function>prop).apply(this, [item.value]) : item.value[<string>prop];\n- grouped[key] = grouped[key] || [];\n- grouped[key].push(item);\n+ const group = grouped.get(key);\n+ if (group) {\n+ group.push(item);\n+ } else {\n+ grouped.set(key, [item]);\n+ }\nreturn grouped;\n- }, {});\n+ }, new Map<string, NgOption[]>());\nreturn groups;\n}\n- private _flatten(groups: { [index: string]: NgOption[] }) {\n+ private _flatten(groups: OptionGroups) {\nlet i = 0;\n- return Object.keys(groups).reduce((items: NgOption[], key: string) => {\n+\n+ return Array.from(groups.keys()).reduce((items: NgOption[], key: string) => {\nconst parent: NgOption = {\nlabel: key,\nhasChildren: true,\n@@ -278,9 +286,9 @@ export class ItemsList {\nparent.value = {};\nparent.value[this._ngSelect.groupBy] = key;\nitems.push(parent);\n- i++\n+ i++;\n- const children = groups[key].map(x => {\n+ const children = groups.get(key).map(x => {\nx.parent = parent;\nx.hasChildren = false;\ni++;\n", "new_path": "src/ng-select/items-list.ts", "old_path": "src/ng-select/items-list.ts" } ]
TypeScript
MIT License
ng-select/ng-select
fix: use Map to preserve groups order (#419)
1
fix
null
815,746
06.04.2018 10:17:43
-10,800
ed1b3d6a9d4612179baa558b7ee855dbb4998db6
fix: show type to search on typeahead fixes
[ { "change_type": "MODIFY", "diff": "@@ -51,6 +51,7 @@ import { DataService, Person } from '../shared/data.service';\nbindLabel=\"name\"\n[addTag]=\"true\"\n[multiple]=\"true\"\n+ [hideSelected]=\"true\"\n[typeahead]=\"peopleTypeahead\"\n[(ngModel)]=\"selectedPersons\">\n</ng-select>\n", "new_path": "demo/app/examples/search.component.ts", "old_path": "demo/app/examples/search.component.ts" }, { "change_type": "MODIFY", "diff": "@@ -1897,6 +1897,7 @@ describe('NgSelectComponent', function () {\n`<ng-select [items]=\"cities\"\n[typeahead]=\"filter\"\nbindLabel=\"name\"\n+ [hideSelected]=\"hideSelected\"\n[(ngModel)]=\"selectedCity\">\n</ng-select>`);\n});\n@@ -1953,6 +1954,16 @@ describe('NgSelectComponent', function () {\ntickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.isLoading).toBeFalsy();\n}));\n+\n+ it('should open dropdown when hideSelected=true and no items to select', fakeAsync(() => {\n+ fixture.componentInstance.hideSelected = true;\n+ fixture.componentInstance.cities = [];\n+ fixture.componentInstance.selectedCity = null;\n+ tickAndDetectChanges(fixture);\n+ fixture.componentInstance.filter.subscribe();\n+ fixture.componentInstance.select.open();\n+ expect(fixture.componentInstance.select.isOpen).toBeTruthy();\n+ }));\n});\n});\n@@ -2366,6 +2377,7 @@ class NgSelectTestCmp {\nfilter = new Subject<string>();\nsearchFn: (term: string, item: any) => boolean = null;\nselectOnTab = true;\n+ hideSelected = false;\ncitiesLoading = false;\nselectedCityId: number;\n", "new_path": "src/ng-select/ng-select.component.spec.ts", "old_path": "src/ng-select/ng-select.component.spec.ts" }, { "change_type": "MODIFY", "diff": "@@ -290,7 +290,10 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\nopen() {\n- if (this.isDisabled || this.isOpen || this.itemsList.maxItemsSelected || this.itemsList.noItemsToSelect) {\n+ if (this.isDisabled || this.isOpen || this.itemsList.maxItemsSelected) {\n+ return;\n+ }\n+ if (!this._isTypeahead && (this.itemsList.noItemsToSelect)) {\nreturn;\n}\nthis.isOpen = true;\n", "new_path": "src/ng-select/ng-select.component.ts", "old_path": "src/ng-select/ng-select.component.ts" } ]
TypeScript
MIT License
ng-select/ng-select
fix: show type to search on typeahead (#416) fixes #405
1
fix
null
815,746
06.04.2018 10:21:50
-10,800
16b7163273d7fea66f80f81c81086449c8d15634
chore(release): 0.35.1
[ { "change_type": "MODIFY", "diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"0.35.1\"></a>\n+## [0.35.1](https://github.com/ng-select/ng-select/compare/v0.35.0...v0.35.1) (2018-04-06)\n+\n+\n+### Bug Fixes\n+\n+* show type to search on typeahead ([#416](https://github.com/ng-select/ng-select/issues/416)) ([ed1b3d6](https://github.com/ng-select/ng-select/commit/ed1b3d6)), closes [#405](https://github.com/ng-select/ng-select/issues/405)\n+* use Map to preserve groups order ([#419](https://github.com/ng-select/ng-select/issues/419)) ([aff8468](https://github.com/ng-select/ng-select/commit/aff8468))\n+\n+\n+\n<a name=\"0.35.0\"></a>\n# [0.35.0](https://github.com/ng-select/ng-select/compare/v0.34.3...v0.35.0) (2018-04-04)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"$schema\": \"../node_modules/ng-packagr/package.schema.json\",\n\"name\": \"@ng-select/ng-select\",\n- \"version\": \"0.35.0\",\n+ \"version\": \"0.35.1\",\n\"description\": \"Angular ng-select - All in One UI Select, Multiselect and Autocomplete\",\n\"author\": \"@ng-select/ng-select\",\n\"license\": \"MIT\",\n", "new_path": "src/package.json", "old_path": "src/package.json" } ]
TypeScript
MIT License
ng-select/ng-select
chore(release): 0.35.1
1
chore
release
730,414
06.04.2018 11:04:30
14,400
837242bc0ffa1eea0200324cb6d6b14cdace8646
docs(widget-space): add instructions to create express app
[ { "change_type": "MODIFY", "diff": "@@ -133,7 +133,9 @@ If you're using our CDN, skip to the next section.\n#### Browser\n-If you're loading an HTML file directly in the browser, use Firefox to avoid a [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) error. If you prefer Chrome, you can start it with the *--allow-file-access-from-files* flag:\n+[Create an Express web application](./create-space-widget-with-server.md) to serve the Space Widget. **This is the preferred method to enable [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS).**\n+\n+If you're loading an HTML file directly in the browser, use Firefox or start Chrome with the *--allow-file-access-from-files* flag. **This is *not* preferred because it introduces a [security risk](https://stackoverflow.com/a/29408269/154065).**\n```bash\nopen -a \"Google Chrome\" --args --allow-file-access-from-files\n", "new_path": "packages/node_modules/@ciscospark/widget-space/README.md", "old_path": "packages/node_modules/@ciscospark/widget-space/README.md" }, { "change_type": "ADD", "diff": "+# Create Space Widget with Express _(@ciscospark/widget-space)_\n+\n+## Background\n+\n+While it is possible to use widgets in standalone HTML pages on certain browsers, it is preferable to serve them in a web application to avoid [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) issues.\n+\n+## Get started\n+\n+<p class=\"callout warning\">Make sure you are using the latest <b>Node Long Term Support</b> and <b>Python 2.7</b>.\n+\n+Install the *Express generator* globally. We will use this to quickly generate a web application.\n+\n+```bash\n+npm install express-generator -g\n+```\n+\n+Create your app with *Effective JavaScript templating (EJS)*.\n+\n+```bash\n+express --view=ejs myapp\n+```\n+\n+<p class=\"callout info\">Express ships with several great templating engines, but EJS is closest to HTML. It allows us to continue without learning another abstraction.</p>\n+\n+Install the dependencies.\n+\n+```bash\n+cd myapp\n+npm install\n+```\n+\n+Replace the contents of *views/index.ejs* with the following:\n+\n+```html\n+<!DOCTYPE html>\n+<html>\n+ <head>\n+ <!-- Latest compiled and minified CSS -->\n+ <link rel=\"stylesheet\" href=\"https://code.s4d.io/widget-space/latest/main.css\">\n+ <!-- Latest compiled and minified JavaScript -->\n+ <script src=\"https://code.s4d.io/widget-space/latest/bundle.js\"></script>\n+ </head>\n+ <body>\n+ <div\n+ id=\"my-ciscospark-widget\"\n+ style=\"display:inline-block; height: 415px;\" />\n+ <script>\n+ var widgetEl = document.getElementById('my-ciscospark-widget');\n+ // Init a new widget\n+ ciscospark.widget(widgetEl).spaceWidget({\n+ accessToken: 'REPLACE WITH YOUR ACCESS TOKEN',\n+ spaceId: 'REPLACE WITH SPARK SPACE ID'\n+ });\n+ </script>\n+ </body>\n+</html>\n+```\n+\n+Your `accessToken` allows you to perform actions in Cisco Spark as yourself. Get your `accessToken` at https://developer.ciscospark.com/getting-started.html#authentication and replace the value of `accessToken` with it.\n+\n+`spaceId` is the ID of the Spark space where you wish to read and send messages. Visit https://developer.ciscospark.com/endpoint-rooms-get.html to list the spaces (rooms) you have access to. Choose an ID from one of the spaces in the `items` array and replace the value of `spaceId` with it.\n+\n+Start the application.\n+\n+```bash\n+DEBUG=myapp:* npm start\n+```\n+\n+:tada: Congratulations! You created your first widget.\n+\n+Type a message and send it to the space. You should see it reflected in both your widget and the Spark client.\n+\n+## References\n+\n+1. Bender, Brian, et al. Spark Space Widget (@Ciscospark/Widget-Space). GitHub, 11 Apr. 2017, github.com/ciscospark/react-ciscospark/blob/master/packages/node_modules/@ciscospark/widget-space/README.md.\n+\n+## External links\n+\n+- [Express > Installing](https://expressjs.com/en/starter/installing.html)\n+- [Express generator](https://expressjs.com/en/starter/generator.html)\n+- [Effective JavaScript templating](http://ejs.co/)\n+- [Comparing ejs vs. handlebars vs. jade vs. mustache vs. pug](https://npmcompare.com/compare/ejs,handlebars,jade,mustache,pug)\n+\n+<style>\n+ .callout {\n+ border-radius: 4px;\n+ border-style: solid;\n+ border-width: 1px;\n+ line-height: 21px;\n+ padding: 16px;\n+ }\n+\n+ .info {\n+ background-color: #d9edf7;\n+ color: #31708f;\n+ }\n+\n+ .warning {\n+ background-color: #fcf8e3;\n+ color: #8a6d3b;\n+ }\n+</style>\n", "new_path": "packages/node_modules/@ciscospark/widget-space/create-space-widget-with-server.md", "old_path": null } ]
JavaScript
MIT License
webex/react-widgets
docs(widget-space): add instructions to create express app
1
docs
widget-space
730,414
06.04.2018 11:05:07
14,400
b250644b9e6a2d10b3b032b90afdd6c17d891978
docs(widget-space): add punctuation
[ { "change_type": "MODIFY", "diff": "@@ -272,7 +272,7 @@ ciscospark.widget(widgetEl).on('messages:created', function(e) {\n});\n```\n-All available events are outlined in our [events guide](./events.md)\n+All available events are outlined in our [events guide](./events.md).\n## Browser Support\n", "new_path": "packages/node_modules/@ciscospark/widget-space/README.md", "old_path": "packages/node_modules/@ciscospark/widget-space/README.md" } ]
JavaScript
MIT License
webex/react-widgets
docs(widget-space): add punctuation
1
docs
widget-space
808,039
06.04.2018 11:10:15
25,200
f5268cdda941aafa84a00817d14f74adfcea2942
fix(publish): Allow tag check to fail with strong warning Add a try/catch block to gitUtils.hasTags to avoid failing the npm publish when publishing from git branches.
[ { "change_type": "MODIFY", "diff": "@@ -70,11 +70,18 @@ function addTag(tag, opts) {\nfunction hasTags(opts) {\nlog.silly(\"hasTags\");\n+ let result = false;\n- const yes = !!ChildProcessUtilities.execSync(\"git\", [\"tag\"], opts);\n- log.verbose(\"hasTags\", yes);\n+ try {\n+ result = !!ChildProcessUtilities.execSync(\"git\", [\"tag\"], opts);\n+ } catch (err) {\n+ log.warn(\"ENOTAGS\", \"No git tags were reachable from this branch!\");\n+ log.verbose(\"hasTags error\", err);\n+ }\n+\n+ log.verbose(\"hasTags\", result);\n- return yes;\n+ return result;\n}\nfunction getLastTaggedCommit(opts) {\n", "new_path": "core/git-utils/index.js", "old_path": "core/git-utils/index.js" } ]
JavaScript
MIT License
lerna/lerna
fix(publish): Allow tag check to fail with strong warning (#1355) Add a try/catch block to gitUtils.hasTags to avoid failing the npm publish when publishing from git branches.
1
fix
publish
730,414
06.04.2018 11:17:24
14,400
26df9cdf1850bf20a2c22e0a8cbf5cbdee1df222
docs(widget-space): add DevNet widget examples
[ { "change_type": "MODIFY", "diff": "@@ -281,6 +281,10 @@ This widget has been tested on the following browsers for messaging and meeting:\n- Current release of Chrome\n- Current release of Firefox\n+## More Examples\n+\n+[Cisco Spark Widgets Samples](https://github.com/CiscoDevNet/widget-samples)\n+\n## Contribute\nPlease see [CONTRIBUTING.md](../../../../CONTRIBUTING.md) for more details.\n", "new_path": "packages/node_modules/@ciscospark/widget-space/README.md", "old_path": "packages/node_modules/@ciscospark/widget-space/README.md" } ]
JavaScript
MIT License
webex/react-widgets
docs(widget-space): add DevNet widget examples
1
docs
widget-space
730,414
06.04.2018 11:21:14
14,400
140e3c5f9e550986226c1b69a93325f343d01b2c
docs(widget-space): add Browser link to TOC
[ { "change_type": "MODIFY", "diff": "- [Quick Start](#quick-start)\n- [Configuration](#configuration)\n- [HTML](#html)\n+ - [Browser](#browser)\n- [Browser Globals](#browser-globals)\n- [Data API](#data-api)\n- [JSX](#jsx)\n", "new_path": "packages/node_modules/@ciscospark/widget-space/README.md", "old_path": "packages/node_modules/@ciscospark/widget-space/README.md" } ]
JavaScript
MIT License
webex/react-widgets
docs(widget-space): add Browser link to TOC
1
docs
widget-space
821,196
06.04.2018 12:39:43
25,200
276ac06557b788e92107e60a722029cf0954100f
fix: set repository to input
[ { "change_type": "MODIFY", "diff": "@@ -248,7 +248,7 @@ class App extends Generator {\nthis.pjson.author = this.answers.author || defaults.author\nthis.pjson.files = this.answers.files || defaults.files || [(this.ts ? '/lib' : '/src')]\nthis.pjson.license = this.answers.license || defaults.license\n- this.pjson.repository = this.answers.github ? `${this.answers.github.user}/${this.answers.github.repo}` : defaults.repository\n+ this.repository = this.pjson.repository = this.answers.github ? `${this.answers.github.user}/${this.answers.github.repo}` : defaults.repository\nlet npm = this.yarn ? 'yarn' : 'npm'\nthis.pjson.scripts.posttest = `${npm} run lint`\n// this.pjson.scripts.precommit = 'yarn run lint'\n", "new_path": "src/generators/app.ts", "old_path": "src/generators/app.ts" } ]
TypeScript
MIT License
oclif/oclif
fix: set repository to input
1
fix
null
217,922
06.04.2018 13:16:45
-7,200
5a6e04ef4d0db9c1b8572425fe98563bc59e772f
style: better icon alignment for item sources closes
[ { "change_type": "MODIFY", "diff": "@@ -9,7 +9,6 @@ import {Ingredient} from '../garland-tools/ingredient';\nimport {ResourceComment} from '../../modules/comments/resource-comment';\nimport {DeserializeAs} from '@kaiu/serializer';\nimport {DataModel} from '../../core/database/storage/data-model';\n-import {Vector2} from '../../core/tools/vector2';\nexport class ListRow extends DataModel {\nicon?: number;\n@@ -18,21 +17,21 @@ export class ListRow extends DataModel {\namount_needed?: number;\ndone: number;\nused: number;\n- requires?: Ingredient[];\n+ requires?: Ingredient[] = [];\nrecipeId?: string;\nyield: number;\n- craftedBy?: CraftedBy[];\n+ craftedBy?: CraftedBy[] = [];\ngatheredBy?: GatheredBy;\ngardening?: boolean;\n- drops?: Drop[];\n- tradeSources?: TradeSource[];\n+ drops?: Drop[] = [];\n+ tradeSources?: TradeSource[] = [];\ninstances?: Instance[];\n- reducedFrom?: any[];\n- desynths?: number[];\n- vendors?: Vendor[];\n- voyages?: I18nName[];\n- ventures?: number[];\n+ reducedFrom?: any[] = [];\n+ desynths?: number[] = [];\n+ vendors?: Vendor[] = [];\n+ voyages?: I18nName[] = [];\n+ ventures?: number[] = [];\n/**\n* Is someone working on it?\n", "new_path": "src/app/model/list/list-row.ts", "old_path": "src/app/model/list/list-row.ts" }, { "change_type": "MODIFY", "diff": "<button matTooltipPosition=\"above\"\nmatTooltip=\"{{'Copy_isearch' | translate}}\"\nmat-icon-button ngxClipboard cbContent=\"/isearch &quot;{{item.id | itemName | i18n}}&quot;\"\n- (cbOnSuccess)=\"afterNameCopy(item.id)\"><mat-icon>search</mat-icon></button>\n+ (cbOnSuccess)=\"afterNameCopy(item.id)\">\n+ <mat-icon>search</mat-icon>\n+ </button>\n<app-comments-button [name]=\"item.id | itemName | i18n\" [row]=\"item\" [list]=\"list\"\n[isOwnList]=\"user?.$key === list?.authorId\"\n</div>\n<div class=\"classes\">\n- <div *ngIf=\"item.craftedBy !== undefined\">\n<div *ngFor=\"let craft of item.craftedBy\">\n<img [ngClass]=\"{'crafted-by':true, 'compact': settings.compactLists}\"\n*ngIf=\"craft.icon !== ''\"\nmatTooltip=\"{{craft.level}} {{craft.stars_tooltip}}\"\nmatTooltipPosition=\"above\" src=\"{{craft.icon}}\">\n</div>\n- </div>\n<div>\n<button mat-icon-button [ngClass]=\"{'icon-button':true, 'compact': settings.compactLists}\"\n*ngIf=\"item.gatheredBy !== undefined\" (click)=\"openGatheredByDetails(item)\">\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": ".classes {\nwidth: 150px;\n+ display: flex;\n+ flex-flow: row wrap;\n}\n// Second column\n", "new_path": "src/app/modules/item/item/item.component.scss", "old_path": "src/app/modules/item/item/item.component.scss" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
style: better icon alignment for item sources closes #305
1
style
null
821,196
06.04.2018 22:44:33
25,200
48516e15f159fd24e36ab18bad1b1d7968473430
fix: use posttest instead of lint script
[ { "change_type": "MODIFY", "diff": "@@ -250,14 +250,12 @@ class App extends Generator {\nthis.pjson.license = this.answers.license || defaults.license\nthis.repository = this.pjson.repository = this.answers.github ? `${this.answers.github.user}/${this.answers.github.repo}` : defaults.repository\nlet 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- this.pjson.scripts.lint = `tsc -p ${tsProject} --noEmit`\n- if (this.tslint) this.pjson.scripts.lint += ` && tslint -p ${tsProject} -t stylish`\n+ this.pjson.scripts.posttest = `tsc -p ${tsProject} --noEmit`\n+ if (this.tslint) this.pjson.scripts.posttest += ` && tslint -p ${tsProject} -t stylish`\n} else {\n- this.pjson.scripts.lint = 'eslint .'\n+ this.pjson.scripts.posttest = 'eslint .'\n}\nif (this.mocha) {\nthis.pjson.scripts.test = `mocha --forbid-only \"test/**/*.test.${this._ext}\"`\n", "new_path": "src/generators/app.ts", "old_path": "src/generators/app.ts" } ]
TypeScript
MIT License
oclif/oclif
fix: use posttest instead of lint script
1
fix
null
791,699
07.04.2018 01:54:56
-36,000
e34edb42a4b6eaab1803aa73c47e76b0f8ee657b
extension: pass flags through to config
[ { "change_type": "MODIFY", "diff": "@@ -22,10 +22,10 @@ const log = require('lighthouse-logger');\nwindow.runLighthouseForConnection = function(\nconnection, url, options, categoryIDs,\nupdateBadgeFn = function() { }) {\n- const config = options && options.fastMode ? new Config(fastConfig) : new Config({\n+ const config = options && options.fastMode ? new Config(fastConfig, options.flags) : new Config({\nextends: 'lighthouse:default',\nsettings: {onlyCategories: categoryIDs},\n- });\n+ }, options.flags);\n// Add url and config to fresh options object.\nconst runOptions = Object.assign({}, options, {url, config});\n", "new_path": "lighthouse-extension/app/src/lighthouse-background.js", "old_path": "lighthouse-extension/app/src/lighthouse-background.js" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
extension: pass flags through to config (#4936)
1
extension
null
679,913
07.04.2018 01:59:27
-3,600
c1c81bd0c762cb90a79aef6b73246e284cf02907
refactor(interceptors): update Event id type (string => PropertyKey)
[ { "change_type": "MODIFY", "diff": "@@ -40,7 +40,7 @@ export const FX_UNDO_STORE = \"--undo-store\";\nexport const FX_UNDO_RESTORE = \"--undo-restore\";\nexport interface Event extends Array<any> {\n- [0]: string;\n+ [0]: PropertyKey;\n[1]?: any;\n}\n", "new_path": "packages/interceptors/src/api.ts", "old_path": "packages/interceptors/src/api.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(interceptors): update Event id type (string => PropertyKey)
1
refactor
interceptors
679,913
07.04.2018 02:03:17
-3,600
4d79f763772390550049f99c40568b7b0fe82b56
refactor(examples): add GestureEvent (rs-dflow)
[ { "change_type": "MODIFY", "diff": "+import { Event } from \"@thi.ng/interceptors/api\";\nimport { fromEvent } from \"@thi.ng/rstream/from/event\";\nimport { merge } from \"@thi.ng/rstream/stream-merge\";\nimport { map } from \"@thi.ng/transducers/xform/map\";\n@@ -9,6 +10,11 @@ export enum GestureType {\nEND\n}\n+export interface GestureEvent extends Event {\n+ [0]: GestureType;\n+ [1]: number[][];\n+}\n+\n/**\n* Attaches mouse & touch event listeners to given DOM element and\n* returns a stream of custom \"gesture\" events in the form of tuples:\n@@ -71,7 +77,7 @@ export function gestureStream(el: Element) {\nbody.push(clickPos, [body[0][0] - clickPos[0], body[0][1] - clickPos[1]]);\ndefault:\n}\n- return [type, body];\n+ return <GestureEvent>[type, body];\n})\n});\n}\n", "new_path": "examples/rstream-dataflow/src/gesture-stream.ts", "old_path": "examples/rstream-dataflow/src/gesture-stream.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(examples): add GestureEvent (rs-dflow)
1
refactor
examples
821,196
07.04.2018 19:08:55
25,200
e1b68a3485198c6116330278864eb333feac12dd
fix: define help flag on initial command
[ { "change_type": "MODIFY", "diff": "@@ -20,12 +20,11 @@ hello world from ./src/<%- name %>.ts!\n<%_ if (type === 'single') { _%>\n// add --version flag to show CLI version\nversion: flags.version({char: 'v'}),\n- // add --help flag to show CLI version\n- help: flags.help({char: 'h'}),\n-\n<%_ } _%>\n+ help: flags.help({char: 'h'}),\n// flag with a value (-n, --name=VALUE)\nname: flags.string({char: 'n', description: 'name to print'}),\n+ // flag with no value (-f, --force)\nforce: flags.boolean({char: 'f'}),\n}\n", "new_path": "templates/src/command.ts.ejs", "old_path": "templates/src/command.ts.ejs" } ]
TypeScript
MIT License
oclif/oclif
fix: define help flag on initial command
1
fix
null
730,413
07.04.2018 19:38:15
14,400
f6ebb7f2ac8c305130dbd1f0af2b3d88309a1a38
chore(tooling): add multiple suite
[ { "change_type": "MODIFY", "diff": "\"test:automation:oneOnOne\": \"wdio wdio.conf.js --suite oneOnOne\",\n\"test:automation:space\": \"wdio wdio.conf.js --suite space\",\n\"test:automation:recents\": \"wdio wdio.conf.js --suite recents\",\n+ \"test:automation:multiple\": \"wdio wdio.conf.js --suite multiple\",\n\"test:tap\": \"cross-env TAP=true wdio wdio.conf.js --suite tap\",\n\"test:integration\": \"cross-env INTEGRATION=true wdio wdio.conf.js --suite integration\",\n\"jest\": \"cross-env TZ=utc jest --config=jest.config.json\",\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "@@ -96,7 +96,7 @@ exports.config = {\n'./test/journeys/specs/recents/**/*.js'\n],\nmultiple: [\n- './test/journeys/specs/multiple/**/*.js'\n+ './test/journeys/specs/multiple/index.js'\n],\nintegration: [\n'./test/journeys/specs/multiple/**/*.js',\n", "new_path": "wdio.conf.js", "old_path": "wdio.conf.js" } ]
JavaScript
MIT License
webex/react-widgets
chore(tooling): add multiple suite
1
chore
tooling
730,413
07.04.2018 19:38:52
14,400
6a0da90b4c0f82ae80aab630c024aabfc1383a9d
refactor(journeys): simplify recents widget helper file
[ { "change_type": "MODIFY", "diff": "@@ -28,15 +28,9 @@ export function displayIncomingMessage(aBrowser, sender, conversation, message,\nwaitForPromise(sender.spark.internal.conversation.post(conversation, {\ndisplayName: message\n}));\n- aBrowser.waitUntil(() =>\n- aBrowser.element(`${elements.firstSpace} ${elements.title}`).getText() === spaceTitle\n- , 5000\n- , 'conversation not displayed');\n- aBrowser.waitUntil(() =>\n- aBrowser.element(`${elements.firstSpace} ${elements.lastActivity}`).getText().includes(message)\n- , 5000\n- , 'does not have last message displayed');\n- assert.isTrue(aBrowser.element(`${elements.firstSpace} ${elements.unreadIndicator}`).isVisible(), 'does not have unread indicator');\n+ aBrowser.waitUntil(() => aBrowser.getText(`${elements.firstSpace} ${elements.title}`) === spaceTitle);\n+ aBrowser.waitUntil(() => aBrowser.getText(`${elements.firstSpace} ${elements.lastActivity}`).includes(message));\n+ assert.isTrue(aBrowser.isVisible(`${elements.firstSpace} ${elements.unreadIndicator}`), 'does not have unread indicator');\n}\n/**\n@@ -58,17 +52,11 @@ export function displayAndReadIncomingMessage(aBrowser, sender, receiver, conver\n}).then((a) => {\nactivity = a;\n}));\n- aBrowser.waitUntil(() =>\n- aBrowser.element(`${elements.firstSpace} ${elements.lastActivity}`).getText().includes(message),\n- 5000,\n- 'does not have last message sent');\n+ aBrowser.waitUntil(() => aBrowser.getText(`${elements.firstSpace} ${elements.lastActivity}`).includes(message));\nassert.isTrue(aBrowser.element(`${elements.firstSpace} ${elements.unreadIndicator}`).isVisible(), 'does not have unread indicator');\n// Acknowledge the activity to mark it read\nwaitForPromise(receiver.spark.internal.conversation.acknowledge(conversation, activity));\n- aBrowser.waitUntil(() =>\n- !aBrowser.element(`${elements.firstSpace} ${elements.unreadIndicator}`).isVisible(),\n- 5000,\n- 'does not remove unread indicator');\n+ aBrowser.waitUntil(() => !aBrowser.isVisible(`${elements.firstSpace} ${elements.unreadIndicator}`));\n}\n/**\n@@ -100,13 +88,7 @@ export function createSpaceAndPost(aBrowser, sender, participants, roomTitle, fi\ndisplayName: firstPost\n});\n}));\n- aBrowser.waitUntil(() =>\n- aBrowser.element(`${elements.firstSpace} ${elements.title}`).getText().includes(spaceTitle),\n- 5000,\n- 'does not display newly created space title');\n- aBrowser.waitUntil(() =>\n- aBrowser.element(`${elements.firstSpace} ${elements.lastActivity}`).getText().includes(firstPost),\n- 5000,\n- 'does not have last message sent');\n+ aBrowser.waitUntil(() => aBrowser.getText(`${elements.firstSpace} ${elements.title}`).includes(spaceTitle));\n+ aBrowser.waitUntil(() => aBrowser.getText(`${elements.firstSpace} ${elements.lastActivity}`).includes(firstPost));\nreturn conversation;\n}\n", "new_path": "test/journeys/lib/test-helpers/recents-widget/index.js", "old_path": "test/journeys/lib/test-helpers/recents-widget/index.js" } ]
JavaScript
MIT License
webex/react-widgets
refactor(journeys): simplify recents widget helper file
1
refactor
journeys
730,413
07.04.2018 19:40:07
14,400
24c5b25d7863dc932407ea3974f65a3de4e812c9
refactor(journeys): use consistent style in multiple widgets suite
[ { "change_type": "MODIFY", "diff": "@@ -18,7 +18,7 @@ import {\nelements as recentsElements\n} from '../../lib/test-helpers/recents-widget';\n-describe('Multiple widgets on a page', () => {\n+describe('Multiple Widgets', () => {\nconst browserLocal = browser.select('browserLocal');\nconst browserRemote = browser.select('browserRemote');\nconst browserName = process.env.BROWSER || 'chrome';\n@@ -43,11 +43,7 @@ describe('Multiple widgets on a page', () => {\n});\nbefore('load browser', () => {\n- browser\n- .url('/multiple.html')\n- .execute(() => {\n- localStorage.clear();\n- });\n+ browser.url('/multiple.html');\n});\nbefore('create marty', () => testUsers.create({count: 1, config: {displayName: 'Marty McFly'}})\n@@ -101,12 +97,6 @@ describe('Multiple widgets on a page', () => {\nbefore('pause to let test users establish', () => browser.pause(5000));\n- after('disconnect', () => Promise.all([\n- marty.spark.internal.mercury.disconnect(),\n- lorraine.spark.internal.mercury.disconnect(),\n- docbrown.spark.internal.mercury.disconnect()\n- ]));\n-\nbefore('create group space', () => marty.spark.internal.conversation.create({\ndisplayName: 'Test Group Space',\nparticipants: [marty, docbrown, lorraine]\n@@ -193,10 +183,7 @@ describe('Multiple widgets on a page', () => {\nit('displays a call button on hover', () => {\ndisplayIncomingMessage(browserLocal, lorraine, oneOnOneConversation, 'Can you call me?', true);\nmoveMouse(browserLocal, recentsElements.firstSpace);\n- browserLocal.waitUntil(() =>\n- browserLocal.element(`${recentsElements.callButton}`).isVisible(),\n- 1500,\n- 'does not show call button');\n+ browserLocal.waitForVisible(`${recentsElements.callButton}`);\n});\n});\n@@ -223,17 +210,17 @@ describe('Multiple widgets on a page', () => {\nit('closes the menu with the exit button', () => {\nbrowserLocal.click(spaceElements.exitButton);\n- browserLocal.waitForVisible(spaceElements.activityMenu, 1500, true);\n+ browserLocal.waitForVisible(spaceElements.activityMenu, 60000, true);\n});\nit('has a message button', () => {\nbrowserLocal.click(spaceElements.menuButton);\n- browserLocal.element(spaceElements.controlsContainer).element(spaceElements.messageButton).waitForVisible();\n+ browserLocal.waitForVisible(spaceElements.messageButton);\n});\nit('hides menu and switches to message widget', () => {\n- browserLocal.element(spaceElements.controlsContainer).element(spaceElements.messageButton).click();\n- browserLocal.waitForVisible(spaceElements.activityMenu, 1500, true);\n+ browserLocal.click(spaceElements.messageButton);\n+ browserLocal.waitForVisible(spaceElements.activityMenu, 60000, true);\nassert.isTrue(browserLocal.isVisible(spaceElements.messageWidget));\n});\n});\n@@ -260,4 +247,10 @@ describe('Multiple widgets on a page', () => {\n});\n});\n});\n+\n+ after('disconnect', () => Promise.all([\n+ marty.spark.internal.mercury.disconnect(),\n+ lorraine.spark.internal.mercury.disconnect(),\n+ docbrown.spark.internal.mercury.disconnect()\n+ ]));\n});\n", "new_path": "test/journeys/specs/multiple/index.js", "old_path": "test/journeys/specs/multiple/index.js" } ]
JavaScript
MIT License
webex/react-widgets
refactor(journeys): use consistent style in multiple widgets suite
1
refactor
journeys
730,413
07.04.2018 19:41:39
14,400
7d4c8d78c601133654aa4c01758c49338e914922
chore(tooling): add bail after failure to journey tests
[ { "change_type": "MODIFY", "diff": "@@ -165,7 +165,7 @@ exports.config = {\n//\n// If you only want to run your tests until a specific amount of tests have failed use\n// bail (default is 0 - don't bail, run all tests).\n- bail: 0,\n+ bail: 1,\n//\n// Saves a screenshot to a given path if a command fails.\n// screenshotPath: './errorShots/',\n@@ -236,7 +236,8 @@ exports.config = {\n// See the full list at http://mochajs.org/\nmochaOpts: {\nui: 'bdd',\n- timeout: mochaTimeout\n+ timeout: mochaTimeout,\n+ bail: 1\n},\n// =====\n", "new_path": "wdio.conf.js", "old_path": "wdio.conf.js" } ]
JavaScript
MIT License
webex/react-widgets
chore(tooling): add bail after failure to journey tests
1
chore
tooling
730,413
07.04.2018 20:49:29
14,400
7d2750aa1b5c6a727650dd65bdaee661cf3b5836
refactor(journeys): use consistent style across data api one on one tests
[ { "change_type": "MODIFY", "diff": "@@ -13,8 +13,7 @@ import {\n} from '../../../lib/test-helpers/space-widget/roster';\nimport {elements, openMenuAndClickButton} from '../../../lib/test-helpers/space-widget/main';\n-describe('Widget Space: One on One', () => {\n- describe('Data API', () => {\n+describe('Widget Space: One on One: Data API', () => {\nconst browserLocal = browser.select('browserLocal');\nconst browserName = process.env.BROWSER || 'chrome';\nconst platform = process.env.PLATFORM || 'mac 10.12';\n@@ -38,13 +37,8 @@ describe('Widget Space: One on One', () => {\n}\n});\n-\nbefore('load browsers', () => {\n- browser\n- .url('/data-api/space.html')\n- .execute(() => {\n- localStorage.clear();\n- });\n+ browser.url('/data-api/space.html');\n});\nbefore('create spock', () => testUsers.create({count: 1, config: {displayName: spockName}})\n@@ -82,6 +76,7 @@ describe('Widget Space: One on One', () => {\ndocument.getElementById('ciscospark-widget').appendChild(csmmDom);\nwindow.loadBundle('/dist-space/bundle.js');\n}, spock.token.access_token, mccoy.email);\n+ browserLocal.waitForVisible(elements.spaceWidget);\n});\nit('loads the test page', () => {\n@@ -106,19 +101,19 @@ describe('Widget Space: One on One', () => {\n});\nit('has a message button', () => {\n- browserLocal.element(elements.controlsContainer).element(elements.messageButton).waitForVisible();\n+ browserLocal.waitForVisible(elements.messageButton);\n});\nit('has a meet button', () => {\n- browserLocal.element(elements.controlsContainer).element(elements.meetButton).waitForVisible();\n+ browserLocal.waitForVisible(elements.meetButton);\n});\nit('has a people button', () => {\n- browserLocal.element(elements.controlsContainer).element(rosterElements.peopleButton).waitForVisible();\n+ browserLocal.waitForVisible(rosterElements.peopleButton);\n});\nit('has a files button', () => {\n- browserLocal.element(elements.controlsContainer).element(elements.filesButton).waitForVisible();\n+ browserLocal.waitForVisible(elements.filesButton);\n});\nit('switches to files widget', () => {\n@@ -136,27 +131,27 @@ describe('Widget Space: One on One', () => {\nit('closes the menu with the exit button', () => {\nbrowserLocal.click(elements.exitButton);\n- browserLocal.waitForVisible(elements.activityMenu, 1500, true);\n+ browserLocal.waitForVisible(elements.activityMenu, 60000, true);\n});\nit('has a message button', () => {\nbrowserLocal.click(elements.menuButton);\n- browserLocal.element(elements.controlsContainer).element(elements.messageButton).waitForVisible();\n+ browserLocal.waitForVisible(elements.messageButton);\n});\nit('switches to message widget', () => {\n- browserLocal.element(elements.controlsContainer).element(elements.messageButton).click();\n+ browserLocal.click(elements.messageButton);\nassert.isTrue(browserLocal.isVisible(elements.messageWidget));\nassert.isFalse(browserLocal.isVisible(elements.meetWidget));\n});\nit('has a meet button', () => {\nbrowserLocal.click(elements.menuButton);\n- browserLocal.element(elements.controlsContainer).element(elements.meetButton).waitForVisible();\n+ browserLocal.waitForVisible(elements.meetButton);\n});\nit('switches to meet widget', () => {\n- browserLocal.element(elements.controlsContainer).element(elements.meetButton).click();\n+ browserLocal.click(elements.meetButton);\nassert.isTrue(browserLocal.isVisible(elements.meetWidget));\nassert.isFalse(browserLocal.isVisible(elements.messageWidget));\n});\n@@ -169,15 +164,11 @@ describe('Widget Space: One on One', () => {\n});\nit('has a close button', () => {\n- assert.isTrue(\n- browserLocal.element(rosterElements.rosterWidget)\n- .element(rosterElements.closeButton)\n- .isVisible()\n- );\n+ assert.isTrue(browserLocal.isVisible(rosterElements.closeButton));\n});\nit('has the total count of participants', () => {\n- assert.equal(browserLocal.element(rosterElements.rosterTitle).getText(), 'People (2)');\n+ assert.equal(browserLocal.getText(rosterElements.rosterTitle), 'People (2)');\n});\nit('has the participants listed', () => {\n@@ -185,9 +176,8 @@ describe('Widget Space: One on One', () => {\n});\nit('closes the people roster widget', () => {\n- browserLocal.element(rosterElements.rosterWidget).element(rosterElements.closeButton).click();\n- browserLocal.element(rosterElements.rosterWidget).waitForVisible(1500, true);\n- });\n+ browserLocal.click(rosterElements.closeButton);\n+ browserLocal.waitForVisible(rosterElements.rosterWidget, 60000, true);\n});\n});\n});\n", "new_path": "test/journeys/specs/oneOnOne/dataApi/basic.js", "old_path": "test/journeys/specs/oneOnOne/dataApi/basic.js" }, { "change_type": "MODIFY", "diff": "@@ -6,23 +6,17 @@ import testUsers from '@ciscospark/test-helper-test-users';\nimport {elements as rosterElements, FEATURE_FLAG_ROSTER} from '../../../lib/test-helpers/space-widget/roster';\n-describe('Widget Space: One on One', () => {\n- describe('Data API', () => {\n+describe('Widget Space: One on One: Data API', () => {\nconst browserLocal = browser.select('browserLocal');\nconst browserRemote = browser.select('browserRemote');\nconst menuButton = 'button[aria-label=\"Main Menu\"]';\nconst activityMenu = '.ciscospark-activity-menu';\n- const controlsContainer = '.ciscospark-controls-container';\nlet userWithAllTheFeatures, userWithNoFeatures;\nbefore('load browsers', () => {\n- browser\n- .url('data-api/space.html')\n- .execute(() => {\n- localStorage.clear();\n- });\n+ browser.url('data-api/space.html');\n});\nbefore('create main user', () => testUsers.create({count: 1, config: {displayName: 'All Features'}})\n@@ -72,7 +66,7 @@ describe('Widget Space: One on One', () => {\ndocument.getElementById('ciscospark-widget').appendChild(csmmDom);\nwindow.loadBundle('/dist-space/bundle.js');\n}, userWithAllTheFeatures.token.access_token, userWithNoFeatures.email);\n- browserLocal.waitForVisible(`[placeholder=\"Send a message to ${userWithNoFeatures.displayName}\"]`, 30000);\n+ browserLocal.waitForVisible(`[placeholder=\"Send a message to ${userWithNoFeatures.displayName}\"]`);\n});\nbefore('open widget remote', () => {\n@@ -86,7 +80,7 @@ describe('Widget Space: One on One', () => {\ndocument.getElementById('ciscospark-widget').appendChild(csmmDom);\nwindow.loadBundle('/dist-space/bundle.js');\n}, userWithNoFeatures.token.access_token, userWithAllTheFeatures.email);\n- browserRemote.waitForVisible(`[placeholder=\"Send a message to ${userWithAllTheFeatures.displayName}\"]`, 30000);\n+ browserRemote.waitForVisible(`[placeholder=\"Send a message to ${userWithAllTheFeatures.displayName}\"]`);\n});\ndescribe('Feature Flags', () => {\n@@ -94,14 +88,13 @@ describe('Widget Space: One on One', () => {\nit('has a roster for user with feature flag', () => {\nbrowserLocal.click(menuButton);\nbrowserLocal.waitForVisible(activityMenu);\n- assert.isTrue(browserLocal.element(controlsContainer).element(rosterElements.peopleButton).isVisible());\n+ assert.isTrue(browserLocal.isVisible(rosterElements.peopleButton));\n});\nit('does not have a roster for user without flag', () => {\nbrowserRemote.click(menuButton);\nbrowserRemote.waitForVisible(activityMenu);\n- assert.isFalse(browserRemote.element(controlsContainer).element(rosterElements.peopleButton).isVisible());\n- });\n+ assert.isFalse(browserRemote.isVisible(rosterElements.peopleButton));\n});\n});\n});\n", "new_path": "test/journeys/specs/oneOnOne/dataApi/features.js", "old_path": "test/journeys/specs/oneOnOne/dataApi/features.js" }, { "change_type": "MODIFY", "diff": "@@ -4,18 +4,13 @@ import '@ciscospark/plugin-phone';\nimport {switchToMeet} from '../../../lib/test-helpers/space-widget/main';\nimport {elements, hangupBeforeAnswerTest, declineIncomingCallTest, hangupDuringCallTest} from '../../../lib/test-helpers/space-widget/meet';\n-describe('Widget Space: One on One', () => {\n- describe('Data API', () => {\n+describe('Widget Space: One on One: Data API', () => {\nconst browserLocal = browser.select('browserLocal');\nconst browserRemote = browser.select('browserRemote');\nlet mccoy, spock;\nbefore('load browsers', () => {\n- browser\n- .url('/data-api/space.html')\n- .execute(() => {\n- localStorage.clear();\n- });\n+ browser.url('/data-api/space.html');\n});\nbefore('create spock', () => testUsers.create({count: 1, config: {displayName: 'Mr Spock'}})\n@@ -41,7 +36,7 @@ describe('Widget Space: One on One', () => {\ndocument.getElementById('ciscospark-widget').appendChild(csmmDom);\nwindow.loadBundle('/dist-space/bundle.js');\n}, spock.token.access_token, mccoy.email);\n- browserLocal.waitForVisible(`[placeholder=\"Send a message to ${mccoy.displayName}\"]`, 30000);\n+ browserLocal.waitForVisible(`[placeholder=\"Send a message to ${mccoy.displayName}\"]`);\n});\nbefore('open remote widget mccoy', () => {\n@@ -56,14 +51,14 @@ describe('Widget Space: One on One', () => {\ndocument.getElementById('ciscospark-widget').appendChild(csmmDom);\nwindow.loadBundle('/dist-space/bundle.js');\n}, mccoy.token.access_token, spock.email);\n- browserRemote.waitForVisible(`[placeholder=\"Send a message to ${spock.displayName}\"]`, 30000);\n+ browserRemote.waitForVisible(`[placeholder=\"Send a message to ${spock.displayName}\"]`);\n});\ndescribe('meet widget', () => {\ndescribe('pre call experience', () => {\nit('has a call button', () => {\nswitchToMeet(browserLocal);\n- browserLocal.element(elements.meetWidget).element(elements.callButton).waitForVisible();\n+ browserLocal.waitForVisible(elements.callButton);\n});\n});\n@@ -82,4 +77,3 @@ describe('Widget Space: One on One', () => {\n});\n});\n});\n-});\n", "new_path": "test/journeys/specs/oneOnOne/dataApi/meet.js", "old_path": "test/journeys/specs/oneOnOne/dataApi/meet.js" }, { "change_type": "MODIFY", "diff": "@@ -13,18 +13,13 @@ import {\nverifyMessageReceipt\n} from '../../../lib/test-helpers/space-widget/messaging';\n-describe('Widget Space: One on One', () => {\n- describe('Data API', () => {\n+describe('Widget Space: One on One: Data API', () => {\nconst browserLocal = browser.select('browserLocal');\nconst browserRemote = browser.select('browserRemote');\nlet local, mccoy, remote, spock;\nbefore('load browsers', () => {\n- browser\n- .url('/data-api/space.html')\n- .execute(() => {\n- localStorage.clear();\n- });\n+ browser.url('/data-api/space.html');\n});\nbefore('create spock', () => testUsers.create({count: 1, config: {displayName: 'Mr Spock'}})\n@@ -52,7 +47,7 @@ describe('Widget Space: One on One', () => {\ndocument.getElementById('ciscospark-widget').appendChild(csmmDom);\nwindow.loadBundle('/dist-space/bundle.js');\n}, spock.token.access_token, mccoy.email);\n- local.browser.waitForVisible(`[placeholder=\"Send a message to ${mccoy.displayName}\"]`, 30000);\n+ local.browser.waitForVisible(`[placeholder=\"Send a message to ${mccoy.displayName}\"]`);\n});\ndescribe('message widget', () => {\n@@ -68,7 +63,7 @@ describe('Widget Space: One on One', () => {\ndocument.getElementById('ciscospark-widget').appendChild(csmmDom);\nwindow.loadBundle('/dist-space/bundle.js');\n}, mccoy.token.access_token, spock.email);\n- remote.browser.waitForVisible(`[placeholder=\"Send a message to ${spock.displayName}\"]`, 30000);\n+ remote.browser.waitForVisible(`[placeholder=\"Send a message to ${spock.displayName}\"]`);\n});\nit('sends and receives messages', () => {\n@@ -220,4 +215,3 @@ describe('Widget Space: One on One', () => {\n});\n});\n});\n-});\n", "new_path": "test/journeys/specs/oneOnOne/dataApi/messaging.js", "old_path": "test/journeys/specs/oneOnOne/dataApi/messaging.js" }, { "change_type": "MODIFY", "diff": "@@ -4,20 +4,14 @@ import {moveMouse} from '../../../lib/test-helpers';\nimport {elements} from '../../../lib/test-helpers/space-widget/main.js';\nimport {answer, hangup, elements as meetElements} from '../../../lib/test-helpers/space-widget/meet.js';\n-describe('Widget Space: One on One', () => {\n- describe('Data API Settings', () => {\n+describe('Widget Space: One on One: Data API Settings', () => {\nconst browserLocal = browser.select('browserLocal');\nconst browserRemote = browser.select('browserRemote');\nlet mccoy, spock;\nbefore('load browsers', () => {\n- browser\n- .url('/data-api/space.html')\n- .execute(() => {\n- localStorage.clear();\n+ browser.url('/data-api/space.html');\n});\n- });\n-\nbefore('create spock', () => testUsers.create({count: 1, config: {displayName: 'Mr Spock'}})\n.then((users) => {\n@@ -48,9 +42,8 @@ describe('Widget Space: One on One', () => {\nit('opens meet widget', () => {\nbrowserLocal.waitForVisible(elements.meetButton);\n+ browserLocal.refresh();\n});\n-\n- after('refresh browsers to remove widgets', browser.refresh);\n});\ndescribe('initial activity setting: message', () => {\n@@ -69,9 +62,8 @@ describe('Widget Space: One on One', () => {\nit('opens message widget', () => {\nbrowserLocal.waitForVisible(elements.messageWidget);\n+ browserLocal.refresh();\n});\n-\n- after('refresh browsers to remove widgets', browser.refresh);\n});\ndescribe('start call setting', () => {\n@@ -82,11 +74,11 @@ describe('Widget Space: One on One', () => {\ncsmmDom.setAttribute('data-toggle', 'ciscospark-space');\ncsmmDom.setAttribute('data-access-token', localAccessToken);\ncsmmDom.setAttribute('data-to-person-email', localToUserEmail);\n- csmmDom.setAttribute('data-initial-activity', 'meet');\n+ csmmDom.setAttribute('data-initial-activity', 'message');\ndocument.getElementById('ciscospark-widget').appendChild(csmmDom);\nwindow.loadBundle('/dist-space/bundle.js');\n}, mccoy.token.access_token, spock.email);\n- browserRemote.waitForVisible(elements.meetButton);\n+ browserRemote.waitForVisible(elements.messageWidget);\n});\nbefore('inject token', () => {\n@@ -109,8 +101,5 @@ describe('Widget Space: One on One', () => {\nmoveMouse(browserLocal, meetElements.callContainer);\nhangup(browserLocal);\n});\n-\n- after('refresh browsers to remove widgets', browser.refresh);\n- });\n});\n});\n", "new_path": "test/journeys/specs/oneOnOne/dataApi/startup-settings.js", "old_path": "test/journeys/specs/oneOnOne/dataApi/startup-settings.js" } ]
JavaScript
MIT License
webex/react-widgets
refactor(journeys): use consistent style across data api one on one tests
1
refactor
journeys
730,413
07.04.2018 21:27:44
14,400
196f903b3f0f8aa62564ea3e3e62f0c3e28a9867
chore(tooling): list files individually and adjust configuration settings
[ { "change_type": "MODIFY", "diff": "@@ -36,7 +36,6 @@ const chromeCapabilities = {\n},\nidleTimeout: 300,\nmaxDuration: 3600,\n- seleniumVersion: '3.4.0',\nscreenResolution,\nplatform\n};\n@@ -49,7 +48,7 @@ const firefoxCapabilities = {\nscreenResolution,\nplatform\n};\n-let mochaTimeout = 30000;\n+let mochaTimeout = 60000;\nif (process.env.DEBUG_JOURNEYS) {\nmochaTimeout = 99999999;\n@@ -87,25 +86,43 @@ exports.config = {\n'./test/journeys/specs/tap/**/*.js'\n],\noneOnOne: [\n- './test/journeys/specs/oneOnOne/**/*.js'\n+ './test/journeys/specs/oneOnOne/dataApi/basic.js',\n+ './test/journeys/specs/oneOnOne/dataApi/features.js',\n+ './test/journeys/specs/oneOnOne/dataApi/meet.js',\n+ './test/journeys/specs/oneOnOne/dataApi/messaging.js',\n+ './test/journeys/specs/oneOnOne/dataApi/startup-settings.js',\n+ './test/journeys/specs/oneOnOne/global/basic.js',\n+ './test/journeys/specs/oneOnOne/global/features.js',\n+ './test/journeys/specs/oneOnOne/global/meet.js',\n+ './test/journeys/specs/oneOnOne/global/messaging.js'\n],\nspace: [\n- './test/journeys/specs/space/**/*.js'\n+ './test/journeys/specs/space/dataApi/basic.js',\n+ './test/journeys/specs/space/dataApi/meet.js',\n+ './test/journeys/specs/space/dataApi/messaging.js',\n+ './test/journeys/specs/space/dataApi/startup-settings.js',\n+ './test/journeys/specs/space/global/basic.js',\n+ './test/journeys/specs/space/global/meet.js',\n+ './test/journeys/specs/space/global/messaging.js'\n],\nrecents: [\n- './test/journeys/specs/recents/**/*.js'\n+ './test/journeys/specs/recents/dataApi/basic.js',\n+ './test/journeys/specs/recents/global/basic.js'\n],\nmultiple: [\n'./test/journeys/specs/multiple/index.js'\n],\nintegration: [\n- './test/journeys/specs/multiple/**/*.js',\n- './test/journeys/specs/oneOnOne/dataApi/*.js',\n- './test/journeys/specs/oneOnOne/global/*.js',\n- './test/journeys/specs/recents/dataApi/*.js',\n- './test/journeys/specs/recents/global/*.js',\n- './test/journeys/specs/space/dataApi/*.js',\n- './test/journeys/specs/space/global/*.js'\n+ './test/journeys/specs/multiple/index.js',\n+ './test/journeys/specs/oneOnOne/dataApi/basic.js',\n+ './test/journeys/specs/oneOnOne/dataApi/features.js',\n+ './test/journeys/specs/oneOnOne/dataApi/meet.js',\n+ './test/journeys/specs/oneOnOne/dataApi/messaging.js',\n+ './test/journeys/specs/oneOnOne/dataApi/startup-settings.js',\n+ './test/journeys/specs/oneOnOne/global/basic.js',\n+ './test/journeys/specs/oneOnOne/global/features.js',\n+ './test/journeys/specs/oneOnOne/global/meet.js',\n+ './test/journeys/specs/oneOnOne/global/messaging.js'\n]\n},\n// Patterns to exclude.\n@@ -175,7 +192,7 @@ exports.config = {\nbaseUrl: process.env.TAP ? 'https://code.s4d.io' : `http://localhost:${port}`,\n//\n// Default timeout for all waitFor* commands.\n- waitforTimeout: 30000,\n+ waitforTimeout: 120000,\n//\n// Default timeout in milliseconds for request\n// if Selenium Grid doesn't send response\n", "new_path": "wdio.conf.js", "old_path": "wdio.conf.js" } ]
JavaScript
MIT License
webex/react-widgets
chore(tooling): list files individually and adjust configuration settings
1
chore
tooling
730,413
07.04.2018 21:29:02
14,400
1c741e0b9879103c4515820c232fb4d768141eda
refactor(journeys): use consistent style across global one on one tests
[ { "change_type": "MODIFY", "diff": "@@ -9,7 +9,6 @@ import {runAxe} from '../../../lib/axe';\nimport {elements, openMenuAndClickButton} from '../../../lib/test-helpers/space-widget/main';\ndescribe('Widget Space: One on One', () => {\n- describe('Global', () => {\nconst browserLocal = browser.select('browserLocal');\nlet mccoy, spock;\n@@ -17,11 +16,7 @@ describe('Widget Space: One on One', () => {\nconst spockName = 'Mr Spock';\nbefore('load browsers', () => {\n- browserLocal\n- .url('/space.html?basic')\n- .execute(() => {\n- localStorage.clear();\n- });\n+ browserLocal.url('/space.html?basic');\n});\nbefore('create spock', () => testUsers.create({count: 1, config: {displayName: spockName}})\n@@ -68,15 +63,9 @@ describe('Widget Space: One on One', () => {\n};\nwindow.openSpaceWidget(options);\n}, spock.token.access_token, mccoy.email);\n+ browserLocal.waitForVisible(elements.spaceWidget);\n});\n- if (process.env.DEBUG_JOURNEYS) {\n- console.warn('Running with DEBUG_JOURNEYS may require you to manually kill wdio');\n- // Leaves the browser open for further testing and inspection\n- after(() => browserLocal.debug());\n- }\n-\n-\nit('loads the test page', () => {\nconst title = browserLocal.getTitle();\nassert.equal(title, 'Cisco Spark Widget Test');\n@@ -99,19 +88,19 @@ describe('Widget Space: One on One', () => {\n});\nit('has a message button', () => {\n- browserLocal.element(elements.controlsContainer).element(elements.messageButton).waitForVisible();\n+ browserLocal.waitForVisible(elements.messageButton);\n});\nit('has a meet button', () => {\n- browserLocal.element(elements.controlsContainer).element(elements.meetButton).waitForVisible();\n+ browserLocal.waitForVisible(elements.meetButton);\n});\nit('has a people button', () => {\n- browserLocal.element(elements.controlsContainer).element(rosterElements.peopleButton).waitForVisible();\n+ browserLocal.waitForVisible(rosterElements.peopleButton);\n});\nit('has a files button', () => {\n- browserLocal.element(elements.controlsContainer).element(elements.filesButton).waitForVisible();\n+ browserLocal.waitForVisible(elements.filesButton);\n});\nit('switches to files widget', () => {\n@@ -129,27 +118,27 @@ describe('Widget Space: One on One', () => {\nit('closes the menu with the exit button', () => {\nbrowserLocal.click(elements.exitButton);\n- browserLocal.waitForVisible(elements.activityMenu, 1500, true);\n+ browserLocal.waitForVisible(elements.activityMenu, 60000, true);\n});\nit('has a message button', () => {\nbrowserLocal.click(elements.menuButton);\n- browserLocal.element(elements.controlsContainer).element(elements.messageButton).waitForVisible();\n+ browserLocal.waitForVisible(elements.messageButton);\n});\nit('switches to message widget', () => {\n- browserLocal.element(elements.controlsContainer).element(elements.messageButton).click();\n+ browserLocal.click(elements.messageButton);\nassert.isTrue(browserLocal.isVisible(elements.messageWidget));\nassert.isFalse(browserLocal.isVisible(elements.meetWidget));\n});\nit('has a meet button', () => {\nbrowserLocal.click(elements.menuButton);\n- browserLocal.element(elements.controlsContainer).element(elements.meetButton).waitForVisible();\n+ browserLocal.waitForVisible(elements.meetButton);\n});\nit('switches to meet widget', () => {\n- browserLocal.element(elements.controlsContainer).element(elements.meetButton).click();\n+ browserLocal.click(elements.meetButton);\nassert.isTrue(browserLocal.isVisible(elements.meetWidget));\nassert.isFalse(browserLocal.isVisible(elements.messageWidget));\n});\n@@ -162,16 +151,11 @@ describe('Widget Space: One on One', () => {\n});\nit('has a close button', () => {\n- assert.isTrue(\n- browserLocal\n- .element(rosterElements.rosterWidget)\n- .element(rosterElements.closeButton)\n- .isVisible()\n- );\n+ assert.isTrue(browserLocal.isVisible(rosterElements.closeButton));\n});\nit('has the total count of participants', () => {\n- assert.equal(browserLocal.element(rosterElements.rosterTitle).getText(), 'People (2)');\n+ assert.equal(browserLocal.getText(rosterElements.rosterTitle), 'People (2)');\n});\nit('has the participants listed', () => {\n@@ -179,8 +163,8 @@ describe('Widget Space: One on One', () => {\n});\nit('closes the people roster widget', () => {\n- browserLocal.element(rosterElements.rosterWidget).element(rosterElements.closeButton).click();\n- browserLocal.element(rosterElements.rosterWidget).waitForVisible(1500, true);\n+ browserLocal.click(rosterElements.closeButton);\n+ browserLocal.waitForVisible(rosterElements.rosterWidget, 60000, true);\n});\n});\n@@ -191,5 +175,10 @@ describe('Widget Space: One on One', () => {\nassert.equal(results.violations.length, 0);\n}));\n});\n- });\n+\n+ if (process.env.DEBUG_JOURNEYS) {\n+ console.warn('Running with DEBUG_JOURNEYS may require you to manually kill wdio');\n+ // Leaves the browser open for further testing and inspection\n+ after(() => browserLocal.debug());\n+ }\n});\n", "new_path": "test/journeys/specs/oneOnOne/global/basic.js", "old_path": "test/journeys/specs/oneOnOne/global/basic.js" }, { "change_type": "MODIFY", "diff": "@@ -12,16 +12,11 @@ describe('Widget Space: One on One', () => {\nconst menuButton = 'button[aria-label=\"Main Menu\"]';\nconst activityMenu = '.ciscospark-activity-menu';\n- const controlsContainer = '.ciscospark-controls-container';\nlet userWithAllTheFeatures, userWithNoFeatures;\nbefore('load browsers', () => {\n- browser\n- .url('/space.html?basic')\n- .execute(() => {\n- localStorage.clear();\n- });\n+ browser.url('/space.html?basic');\n});\nbefore('create main user', () => testUsers.create({count: 1, config: {displayName: 'All Features'}})\n@@ -69,7 +64,7 @@ describe('Widget Space: One on One', () => {\n};\nwindow.openSpaceWidget(options);\n}, userWithAllTheFeatures.token.access_token, userWithNoFeatures.email);\n- browserLocal.waitForVisible(`[placeholder=\"Send a message to ${userWithNoFeatures.displayName}\"]`, 30000);\n+ browserLocal.waitForVisible(`[placeholder=\"Send a message to ${userWithNoFeatures.displayName}\"]`);\n});\nbefore('open widget remote', () => {\n@@ -81,7 +76,7 @@ describe('Widget Space: One on One', () => {\n};\nwindow.openSpaceWidget(options);\n}, userWithNoFeatures.token.access_token, userWithAllTheFeatures.email);\n- browserRemote.waitForVisible(`[placeholder=\"Send a message to ${userWithAllTheFeatures.displayName}\"]`, 30000);\n+ browserRemote.waitForVisible(`[placeholder=\"Send a message to ${userWithAllTheFeatures.displayName}\"]`);\n});\ndescribe('Feature Flags', () => {\n@@ -89,13 +84,13 @@ describe('Widget Space: One on One', () => {\nit('has a roster for user with feature flag', () => {\nbrowserLocal.click(menuButton);\nbrowserLocal.waitForVisible(activityMenu);\n- assert.isTrue(browserLocal.element(controlsContainer).element(rosterElements.peopleButton).isVisible());\n+ assert.isTrue(browserLocal.isVisible(rosterElements.peopleButton));\n});\nit('does not have a roster for user without flag', () => {\nbrowserRemote.click(menuButton);\nbrowserRemote.waitForVisible(activityMenu);\n- assert.isFalse(browserRemote.element(controlsContainer).element(rosterElements.peopleButton).isVisible());\n+ assert.isFalse(browserRemote.isVisible(rosterElements.peopleButton));\n});\n});\n});\n", "new_path": "test/journeys/specs/oneOnOne/global/features.js", "old_path": "test/journeys/specs/oneOnOne/global/features.js" }, { "change_type": "MODIFY", "diff": "@@ -12,11 +12,7 @@ describe('Widget Space: One on One', () => {\nlet mccoy, spock;\nbefore('load browsers', () => {\n- browser\n- .url('/space.html?meet')\n- .execute(() => {\n- localStorage.clear();\n- });\n+ browser.url('/space.html?meet');\n});\nbefore('create spock', () => testUsers.create({count: 1, config: {displayName: 'Mr Spock'}})\n@@ -60,13 +56,14 @@ describe('Widget Space: One on One', () => {\n};\nwindow.openSpaceWidget(options);\n}, mccoy.token.access_token, spock.email);\n+ remote.browser.waitForVisible(`[placeholder=\"Send a message to ${local.displayName}\"]`);\n});\ndescribe('meet widget', () => {\ndescribe('pre call experience', () => {\nit('has a call button', () => {\nswitchToMeet(browserLocal);\n- browserLocal.element(elements.meetWidget).element(elements.callButton).waitForVisible();\n+ browserLocal.waitForVisible(elements.callButton);\n});\n});\n", "new_path": "test/journeys/specs/oneOnOne/global/meet.js", "old_path": "test/journeys/specs/oneOnOne/global/meet.js" }, { "change_type": "MODIFY", "diff": "@@ -20,11 +20,7 @@ describe('Widget Space: One on One', () => {\nlet local, mccoy, remote, spock;\nbefore('load browsers', () => {\n- browser\n- .url('/space.html?message')\n- .execute(() => {\n- localStorage.clear();\n- });\n+ browser.url('/space.html?message');\n});\nbefore('create spock', () => testUsers.create({count: 1, config: {displayName: 'Mr Spock'}})\n", "new_path": "test/journeys/specs/oneOnOne/global/messaging.js", "old_path": "test/journeys/specs/oneOnOne/global/messaging.js" } ]
JavaScript
MIT License
webex/react-widgets
refactor(journeys): use consistent style across global one on one tests
1
refactor
journeys
730,413
07.04.2018 21:51:33
14,400
f05cc07576d1daeac9d759dcb51cd2796e5369ae
fix(journeys): set spark events to a new array
[ { "change_type": "MODIFY", "diff": "* @returns {void}\n*/\nexport function clearEventLog(myBrowser) {\n- myBrowser.execute(() => { window.ciscoSparkEvents.length = 0; });\n+ myBrowser.execute(() => { window.ciscoSparkEvents = []; });\n}\n/**\n", "new_path": "test/journeys/lib/events.js", "old_path": "test/journeys/lib/events.js" } ]
JavaScript
MIT License
webex/react-widgets
fix(journeys): set spark events to a new array
1
fix
journeys
730,413
07.04.2018 21:53:58
14,400
03252895e9b54f228e288c11784ade8438ebe021
refactor(journeys): use consistent style across recents tests
[ { "change_type": "MODIFY", "diff": "@@ -16,8 +16,7 @@ import {\nelements\n} from '../../../lib/test-helpers/recents-widget';\n-describe('Widget Recents', () => {\n- describe('Data API', () => {\n+describe('Widget Recents: Data API', () => {\nconst browserLocal = browser.select('browserLocal');\nconst browserRemote = browser.select('browserRemote');\nconst browserName = process.env.BROWSER || 'chrome';\n@@ -42,19 +41,11 @@ describe('Widget Recents', () => {\n});\nbefore('load browser', () => {\n- browserLocal\n- .url('/data-api/recents.html')\n- .execute(() => {\n- localStorage.clear();\n- });\n+ browserLocal.url('/data-api/recents.html');\n});\nbefore('load browser for meet widget', () => {\n- browserRemote\n- .url('/space.html?meetRecents')\n- .execute(() => {\n- localStorage.clear();\n- });\n+ browserRemote.url('/space.html?meetRecents');\n});\nbefore('create marty', () => testUsers.create({count: 1, config: {displayName: 'Marty McFly'}})\n@@ -109,12 +100,6 @@ describe('Widget Recents', () => {\nbefore('pause to let test users establish', () => browser.pause(5000));\n- after('disconnect', () => Promise.all([\n- marty.spark.internal.mercury.disconnect(),\n- lorraine.spark.internal.mercury.disconnect(),\n- docbrown.spark.internal.mercury.disconnect()\n- ]));\n-\nbefore('create group space', () => marty.spark.internal.conversation.create({\ndisplayName: 'Test Group Space',\nparticipants: [marty, docbrown, lorraine]\n@@ -154,6 +139,7 @@ describe('Widget Recents', () => {\n};\nwindow.openSpaceWidget(options);\n}, lorraine.token.access_token, marty.email);\n+ browserRemote.waitForVisible(meetElements.meetWidget);\n});\nit('loads the test page', () => {\n@@ -175,10 +161,7 @@ describe('Widget Recents', () => {\nit('displays a call button on hover', () => {\ndisplayIncomingMessage(browserLocal, lorraine, conversation, 'Can you call me?');\nmoveMouse(browserLocal, elements.firstSpace);\n- browserLocal.waitUntil(() =>\n- browserLocal.element(elements.callButton).isVisible(),\n- 1500,\n- 'does not show call button');\n+ browserLocal.waitUntil(() => browserLocal.isVisible(elements.callButton));\n});\n});\n@@ -201,23 +184,22 @@ describe('Widget Recents', () => {\nit('displays a call button on hover', () => {\ndisplayIncomingMessage(browserLocal, lorraine, oneOnOneConversation, 'Can you call me?', true);\nmoveMouse(browserLocal, elements.firstSpace);\n- browserLocal.waitUntil(() =>\n- browserLocal.element(elements.callButton).isVisible(),\n- 1500,\n- 'does not show call button');\n+ browserLocal.waitUntil(() => browserLocal.isVisible(elements.callButton));\n});\n});\ndescribe('incoming call', () => {\nit('should display incoming call screen', () => {\n- browserRemote.element(meetElements.meetWidget).element(meetElements.callButton).waitForVisible();\n- browserRemote.element(meetElements.callButton).click();\n- browserLocal.waitUntil(() =>\n- browserLocal.element(elements.answerButton).isVisible(),\n- 15000,\n- 'does not show call answer button');\n+ browserRemote.waitForVisible(meetElements.callButton);\n+ browserRemote.click(meetElements.callButton);\n+ browserLocal.waitUntil(() => browserLocal.isVisible(elements.answerButton));\nhangup(browserRemote);\n});\n});\n- });\n+\n+ after('disconnect', () => Promise.all([\n+ marty.spark.internal.mercury.disconnect(),\n+ lorraine.spark.internal.mercury.disconnect(),\n+ docbrown.spark.internal.mercury.disconnect()\n+ ]));\n});\n", "new_path": "test/journeys/specs/recents/dataApi/basic.js", "old_path": "test/journeys/specs/recents/dataApi/basic.js" }, { "change_type": "MODIFY", "diff": "@@ -28,19 +28,11 @@ describe('Widget Recents', () => {\nlet conversation, oneOnOneConversation;\nbefore('load browser for recents widget', () => {\n- browserLocal\n- .url('/recents.html')\n- .execute(() => {\n- localStorage.clear();\n- });\n+ browserLocal.url('/recents.html');\n});\nbefore('load browser for meet widget', () => {\n- browserRemote\n- .url('/space.html?meetRecents')\n- .execute(() => {\n- localStorage.clear();\n- });\n+ browserRemote.url('/space.html?meetRecents');\n});\nbefore('create marty', () => testUsers.create({count: 1, config: {displayName: 'Marty McFly'}})\n@@ -95,12 +87,6 @@ describe('Widget Recents', () => {\nbefore('pause to let test users establish', () => browser.pause(5000));\n- after('disconnect', () => Promise.all([\n- marty.spark.internal.mercury.disconnect(),\n- lorraine.spark.phone.deregister(),\n- docbrown.spark.internal.mercury.disconnect()\n- ]));\n-\nbefore('create group space', () => marty.spark.internal.conversation.create({\ndisplayName: 'Test Group Space',\nparticipants: [marty, docbrown, lorraine]\n@@ -141,6 +127,7 @@ describe('Widget Recents', () => {\n};\nwindow.openSpaceWidget(options);\n}, lorraine.token.access_token, marty.email);\n+ browserRemote.waitForVisible(meetElements.meetWidget);\n});\nit('loads the test page', () => {\n@@ -162,10 +149,8 @@ describe('Widget Recents', () => {\nit('displays a call button on hover', () => {\ndisplayIncomingMessage(browserLocal, lorraine, conversation, 'Can you call me?');\nmoveMouse(browserLocal, elements.firstSpace);\n- browserLocal.waitUntil(() =>\n- browserLocal.element(elements.callButton).isVisible(),\n- 1500,\n- 'does not show call button');\n+ browserLocal.waitUntil(() => browserLocal.isVisible(elements.callButton));\n+ });\n});\ndescribe('events', () => {\n@@ -193,7 +178,7 @@ describe('Widget Recents', () => {\nit('rooms:selected', () => {\nclearEventLog(browserLocal);\n- browserLocal.element(elements.firstSpace).click();\n+ browserLocal.click(elements.firstSpace);\nassert.include(getEventLog(browserLocal), 'rooms:selected', 'does not have event in log');\n});\n@@ -219,14 +204,10 @@ describe('Widget Recents', () => {\n// Remove user from room\nclearEventLog(browserLocal);\nwaitForPromise(lorraine.spark.internal.conversation.leave(kickedConversation, marty));\n- browserLocal.waitUntil(() =>\n- browserLocal.element(`${elements.firstSpace} ${elements.title}`).getText() !== roomTitle,\n- 5000,\n- 'does not remove space from list');\n+ browserLocal.waitUntil(() => browserLocal.getText(`${elements.firstSpace} ${elements.title}`) !== roomTitle);\nassert.include(getEventLog(browserLocal), 'memberships:deleted', 'does not have event in log');\n});\n});\n- });\ndescribe('one on one space', () => {\nit('displays a new incoming message', () => {\n@@ -247,21 +228,15 @@ describe('Widget Recents', () => {\nit('displays a call button on hover', () => {\ndisplayIncomingMessage(browserLocal, lorraine, oneOnOneConversation, 'Can you call me?', true);\nmoveMouse(browserLocal, elements.firstSpace);\n- browserLocal.waitUntil(() =>\n- browserLocal.element(elements.callButton).isVisible(),\n- 1500,\n- 'does not show call button');\n+ browserLocal.waitUntil(() => browserLocal.isVisible(elements.callButton));\n});\n});\ndescribe('incoming call', () => {\nit('should display incoming call screen', () => {\n- browserRemote.element(meetElements.meetWidget).element(meetElements.callButton).waitForVisible();\n- browserRemote.element(meetElements.callButton).click();\n- browserLocal.waitUntil(() =>\n- browserLocal.element(elements.answerButton).isVisible(),\n- 15000,\n- 'does not show call answer button');\n+ browserRemote.waitForVisible(meetElements.callButton);\n+ browserRemote.click(meetElements.callButton);\n+ browserLocal.waitUntil(() => browserLocal.isVisible(elements.answerButton));\nhangup(browserRemote);\n});\n});\n@@ -273,4 +248,11 @@ describe('Widget Recents', () => {\nassert.equal(results.violations.length, 0, 'has accessibilty violations');\n}));\n});\n+\n+ after('disconnect', () => Promise.all([\n+ marty.spark.internal.mercury.disconnect(),\n+ lorraine.spark.phone.deregister(),\n+ docbrown.spark.internal.mercury.disconnect()\n+ ]));\n});\n+\n", "new_path": "test/journeys/specs/recents/global/basic.js", "old_path": "test/journeys/specs/recents/global/basic.js" } ]
JavaScript
MIT License
webex/react-widgets
refactor(journeys): use consistent style across recents tests
1
refactor
journeys
679,913
07.04.2018 22:21:42
-3,600
d310345f59c94ad6816439505e9ff8ab7650e529
feat(api): add bench() & timed() utils
[ { "change_type": "ADD", "diff": "+/**\n+ * Calls function `fn` without args, prints elapsed time and returns\n+ * fn's result.\n+ *\n+ * @param fn\n+ */\n+export function timed<T>(fn: () => T) {\n+ const t0 = Date.now();\n+ const res = fn();\n+ console.log(Date.now() - t0);\n+ return res;\n+}\n+\n+/**\n+ * Executes given function `n` times, prints elapsed time to console and\n+ * returns last result from fn.\n+ *\n+ * @param fn\n+ * @param n\n+ */\n+export function bench<T>(fn: () => T, n = 1e6) {\n+ let res: T;\n+ return timed(() => {\n+ while (n-- > 0) {\n+ res = fn();\n+ }\n+ return res;\n+ });\n+}\n", "new_path": "packages/api/src/bench.ts", "old_path": null }, { "change_type": "MODIFY", "diff": "@@ -2,6 +2,7 @@ import * as decorators from \"./decorators\";\nimport * as mixins from \"./mixins\";\nexport * from \"./api\";\n+export * from \"./bench\";\nexport * from \"./compare\";\nexport * from \"./error\";\nexport * from \"./equiv\";\n", "new_path": "packages/api/src/index.ts", "old_path": "packages/api/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(api): add bench() & timed() utils
1
feat
api
679,913
07.04.2018 22:22:45
-3,600
40d706b6f6ccc1f41a6a499ffdf444b8a04fe9b3
feat(checks): add hasPerformance() check (performance.now)
[ { "change_type": "ADD", "diff": "+import { isFunction } from \"./is-function\";\n+\n+export function hasPerformance() {\n+ return typeof performance !== 'undefined' && isFunction(performance.now);\n+}\n", "new_path": "packages/checks/src/has-performance.ts", "old_path": null }, { "change_type": "MODIFY", "diff": "@@ -3,6 +3,7 @@ export * from \"./exists\";\nexport * from \"./has-crypto\";\nexport * from \"./has-max-length\";\nexport * from \"./has-min-length\";\n+export * from \"./has-performance\";\nexport * from \"./has-wasm\";\nexport * from \"./has-webgl\";\nexport * from \"./has-websocket\";\n", "new_path": "packages/checks/src/index.ts", "old_path": "packages/checks/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(checks): add hasPerformance() check (performance.now)
1
feat
checks
730,413
07.04.2018 22:29:42
14,400
887428466d9969383c11cb33bc5c2e9da144726b
chore(tooling): add recents to integration suite
[ { "change_type": "MODIFY", "diff": "@@ -122,7 +122,10 @@ exports.config = {\n'./test/journeys/specs/oneOnOne/global/basic.js',\n'./test/journeys/specs/oneOnOne/global/features.js',\n'./test/journeys/specs/oneOnOne/global/meet.js',\n- './test/journeys/specs/oneOnOne/global/messaging.js'\n+ './test/journeys/specs/oneOnOne/global/messaging.js',\n+ './test/journeys/specs/recents/dataApi/basic.js',\n+ './test/journeys/specs/recents/global/basic.js'\n+\n]\n},\n// Patterns to exclude.\n", "new_path": "wdio.conf.js", "old_path": "wdio.conf.js" } ]
JavaScript
MIT License
webex/react-widgets
chore(tooling): add recents to integration suite
1
chore
tooling
743,956
07.04.2018 22:41:48
-10,800
3f0746c0e212d2049e3c1d6633a824382d2ec165
fix: remove the trailing white spaces from the help output BREAKING CHANGE: tests that assert against help output will need to be updated
[ { "change_type": "MODIFY", "diff": "@@ -45,7 +45,10 @@ module.exports = function usage (yargs, y18n) {\n// don't output failure message more than once\nif (!failureOutput) {\nfailureOutput = true\n- if (showHelpOnFail) yargs.showHelp('error')\n+ if (showHelpOnFail) {\n+ yargs.showHelp('error')\n+ logger.error()\n+ }\nif (msg || err) logger.error(msg || err)\nif (failMessage) {\nif (msg || err) logger.error('')\n@@ -346,7 +349,8 @@ module.exports = function usage (yargs, y18n) {\nui.div(`${e}\\n`)\n}\n- return ui.toString()\n+ // Remove the trailing white spaces\n+ return ui.toString().replace(/\\s*$/, '')\n}\n// return the maximum width of a string\n", "new_path": "lib/usage.js", "old_path": "lib/usage.js" }, { "change_type": "MODIFY", "diff": "@@ -519,8 +519,7 @@ describe('Command', () => {\n' usage dream [command] [opts] Go to sleep and dream',\n'Options:',\n' --help Show help [boolean]',\n- ' --version Show version number [boolean]',\n- ''\n+ ' --version Show version number [boolean]'\n])\n})\n@@ -541,8 +540,7 @@ describe('Command', () => {\n' --help Show help [boolean]',\n' --version Show version number [boolean]',\n' --shared Is the dream shared with others? [boolean]',\n- ' --extract Attempt extraction? [boolean]',\n- ''\n+ ' --extract Attempt extraction? [boolean]'\n])\n})\n@@ -562,8 +560,7 @@ describe('Command', () => {\n' usage dream [command] [opts] Go to sleep and dream',\n'Options:',\n' --help Show help [boolean]',\n- ' --version Show version number [boolean]',\n- ''\n+ ' --version Show version number [boolean]'\n])\n})\n@@ -593,8 +590,7 @@ describe('Command', () => {\nr.logs.join('\\n').split(/\\n+/).should.deep.equal([\n'Options:',\n' --help Show help [boolean]',\n- ' --version Show version number [boolean]',\n- ''\n+ ' --version Show version number [boolean]'\n])\n})\n@@ -610,8 +606,7 @@ describe('Command', () => {\n'Attempts to (re)apply its own dir',\n'Options:',\n' --help Show help [boolean]',\n- ' --version Show version number [boolean]',\n- ''\n+ ' --version Show version number [boolean]'\n])\n})\n@@ -628,8 +623,7 @@ describe('Command', () => {\n' usage nameless Command name derived from module filename',\n'Options:',\n' --help Show help [boolean]',\n- ' --version Show version number [boolean]',\n- ''\n+ ' --version Show version number [boolean]'\n])\n})\n})\n@@ -684,8 +678,7 @@ describe('Command', () => {\n' command cmd sub Run the subcommand',\n'Options:',\n' --help Show help [boolean]',\n- ' --version Show version number [boolean]',\n- ''\n+ ' --version Show version number [boolean]'\n]\nconst expectedSub = [\n@@ -693,8 +686,7 @@ describe('Command', () => {\n'Run the subcommand',\n'Options:',\n' --help Show help [boolean]',\n- ' --version Show version number [boolean]',\n- ''\n+ ' --version Show version number [boolean]'\n]\n// no help is output if help isn't last\n", "new_path": "test/command.js", "old_path": "test/command.js" }, { "change_type": "MODIFY", "diff": "@@ -679,8 +679,7 @@ describe('validation tests', () => {\nr.logs.join('\\n').split(/\\n+/).should.deep.equal([\n'Options:',\n' --settings Path to JSON config file',\n- ' --help Show help [boolean]',\n- ''\n+ ' --help Show help [boolean]'\n])\n})\n@@ -697,8 +696,7 @@ describe('validation tests', () => {\nr.logs.join('\\n').split(/\\n+/).should.deep.equal([\n'Options:',\n' --config Path to JSON config file',\n- ' --help Show help [boolean]',\n- ''\n+ ' --help Show help [boolean]'\n])\n})\n@@ -715,8 +713,7 @@ describe('validation tests', () => {\nr.logs.join('\\n').split(/\\n+/).should.deep.equal([\n'Options:',\n' --settings pork chop sandwiches',\n- ' --help Show help [boolean]',\n- ''\n+ ' --help Show help [boolean]'\n])\n})\n", "new_path": "test/validation.js", "old_path": "test/validation.js" }, { "change_type": "MODIFY", "diff": "@@ -56,7 +56,7 @@ describe('yargs dsl tests', () => {\n.argv\n)\n- r.errors[1].should.match(/Implications failed/)\n+ r.errors[2].should.match(/Implications failed/)\n})\nit('accepts an object for describes', () => {\n@@ -173,7 +173,7 @@ describe('yargs dsl tests', () => {\n.argv\n)\n- r.errors[3].should.match(/pork chop sandwiches/)\n+ r.errors[4].should.match(/pork chop sandwiches/)\n})\nit('calling with no arguments should default to displaying help', () => {\n@@ -183,7 +183,7 @@ describe('yargs dsl tests', () => {\n.argv\n)\n- r.errors[1].should.match(/required argument/)\n+ r.errors[2].should.match(/required argument/)\n})\n})\n@@ -352,7 +352,7 @@ describe('yargs dsl tests', () => {\n.argv\n})\n- r.errors[1].should.match(/Did you mean goat/)\n+ r.errors[2].should.match(/Did you mean goat/)\n})\nit('does not recommend a similiar command if no similar command exists', () => {\n@@ -375,7 +375,7 @@ describe('yargs dsl tests', () => {\n.argv\n})\n- r.errors[1].should.match(/Did you mean goat/)\n+ r.errors[2].should.match(/Did you mean goat/)\n})\n// see: https://github.com/yargs/yargs/issues/822\n@@ -420,8 +420,7 @@ describe('yargs dsl tests', () => {\n'',\n'Options:',\n' --version Show version number [boolean]',\n- ' -h Show help [boolean]',\n- ''\n+ ' -h Show help [boolean]'\n])\n})\n@@ -446,8 +445,7 @@ describe('yargs dsl tests', () => {\n'',\n'Options:',\n' --version Show version number [boolean]',\n- ' -h Show help [boolean]',\n- ''\n+ ' -h Show help [boolean]'\n])\n})\n@@ -1123,8 +1121,7 @@ describe('yargs dsl tests', () => {\n'',\n'Options:',\n' --help Show help [boolean]',\n- ' --version Show version number [boolean]',\n- ''\n+ ' --version Show version number [boolean]'\n])\noutput2.split('\\n').should.deep.equal([\n@@ -1134,8 +1131,7 @@ describe('yargs dsl tests', () => {\n'',\n'Options:',\n' --help Show help [boolean]',\n- ' --version Show version number [boolean]',\n- ''\n+ ' --version Show version number [boolean]'\n])\n})\n@@ -1179,8 +1175,7 @@ describe('yargs dsl tests', () => {\n'',\n'Options:',\n' --help Show help [boolean]',\n- ' --version Show version number [boolean]',\n- ''\n+ ' --version Show version number [boolean]'\n])\n})\n@@ -1680,8 +1675,7 @@ describe('yargs dsl tests', () => {\nconst expected = [\n'Options:',\n' --help Show help [boolean]',\n- ' --version Show version number [boolean]',\n- ''\n+ ' --version Show version number [boolean]'\n]\noption.logs[0].split('\\n').should.deep.equal(expected)\ncommand.logs[0].split('\\n').should.deep.equal(expected)\n@@ -1701,8 +1695,7 @@ describe('yargs dsl tests', () => {\nconst expected = [\n'Options:',\n' --version Show version number [boolean]',\n- ' --help Show help [boolean]',\n- ''\n+ ' --help Show help [boolean]'\n]\noption.logs[0].split('\\n').should.deep.equal(expected)\ncommand.logs[0].split('\\n').should.deep.equal(expected)\n@@ -1727,8 +1720,7 @@ describe('yargs dsl tests', () => {\nconst expected = [\n'Options:',\n' --version Show version number [boolean]',\n- ' --info Show help [boolean]',\n- ''\n+ ' --info Show help [boolean]'\n]\noption.logs[0].split('\\n').should.deep.equal(expected)\ncommand.logs[0].split('\\n').should.deep.equal(expected)\n@@ -1749,8 +1741,7 @@ describe('yargs dsl tests', () => {\nconst expected = [\n'Options:',\n' --version Show version number [boolean]',\n- ' --info Display info [boolean]',\n- ''\n+ ' --info Display info [boolean]'\n]\noption.logs[0].split('\\n').should.deep.equal(expected)\ncommand.logs[0].split('\\n').should.deep.equal(expected)\n@@ -1770,8 +1761,7 @@ describe('yargs dsl tests', () => {\nconst expected = [\n'Options:',\n' --version Show version number [boolean]',\n- ' --info Display info [boolean]',\n- ''\n+ ' --info Display info [boolean]'\n]\noption.logs[0].split('\\n').should.deep.equal(expected)\ncommand.logs[0].split('\\n').should.deep.equal(expected)\n@@ -1793,8 +1783,7 @@ describe('yargs dsl tests', () => {\ninfo.logs[0].split('\\n').should.deep.equal([\n'Options:',\n' --version Show version number [boolean]',\n- ' -h, --help, --info Show help [boolean]',\n- ''\n+ ' -h, --help, --info Show help [boolean]'\n])\nh.result.should.have.property('_').and.deep.equal(['h'])\n})\n", "new_path": "test/yargs.js", "old_path": "test/yargs.js" } ]
JavaScript
MIT License
yargs/yargs
fix: remove the trailing white spaces from the help output (#1090) BREAKING CHANGE: tests that assert against help output will need to be updated
1
fix
null
217,922
07.04.2018 23:12:14
-7,200
3831674ad45b1daf477b1c1a94fc0809d2c2b354
fix: editing masterbooks on profile sometimes creates a new quick list
[ { "change_type": "MODIFY", "diff": "@@ -236,7 +236,7 @@ export class RecipesComponent extends PageComponent implements OnInit {\nga('send', 'event', 'List', 'creation');\nlist.name = this.i18n.getName(this.localizedData.getItem(recipe.itemId));\nlist.ephemeral = true;\n- this.resolver.addToList(recipe.itemId, list, recipe.recipeId, +amount, collectible)\n+ this.subscriptions.push(this.resolver.addToList(recipe.itemId, list, recipe.recipeId, +amount, collectible)\n.switchMap((l) => {\nreturn this.userService.getUserData().map(u => {\nl.authorId = u.$key;\n@@ -253,7 +253,7 @@ export class RecipesComponent extends PageComponent implements OnInit {\nthis.listService.getRouterPath(l.$key).subscribe(path => {\nthis.router.navigate(path);\n});\n- });\n+ }));\n}\n/**\n", "new_path": "src/app/pages/recipes/recipes/recipes.component.ts", "old_path": "src/app/pages/recipes/recipes/recipes.component.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix: editing masterbooks on profile sometimes creates a new quick list
1
fix
null
217,922
07.04.2018 23:23:18
-7,200
be39c00a5b6c5dc0e2fb2068b3de9678f02501d3
fix: "Timers" icon on list details not under scroll bar anymore closes
[ { "change_type": "MODIFY", "diff": "position: relative;\n.alarms-sidebar-trigger {\nposition: fixed;\n- right: 5px;\n+ right: 25px;\nbottom: 5px;\ntransition: right .4s cubic-bezier(0.25, 0.8, 0.25, 1);\n&.opened {\n", "new_path": "src/app/app.component.scss", "old_path": "src/app/app.component.scss" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix: "Timers" icon on list details not under scroll bar anymore closes #310
1
fix
null
679,913
08.04.2018 01:51:04
-3,600
14b9cecc11219bb103952677acc4211220d061c8
refactor(examples): update dashboard, hdom-basics & hdom-benchmark
[ { "change_type": "MODIFY", "diff": "@@ -31,4 +31,4 @@ const app = (() => {\n})();\n// start update loop (RAF)\n-start(document.getElementById(\"app\"), app);\n+start(\"app\", app);\n", "new_path": "examples/dashboard/src/index.ts", "old_path": "examples/dashboard/src/index.ts" }, { "change_type": "MODIFY", "diff": "import { start } from \"@thi.ng/hdom\";\n// stateless component w/ params\n-const greeter = (name) => [\"h1.title\", \"hello \", name];\n+// the first arg is an auto-injected context object\n+// (not used here, see `hdom-context-basics` example for details)\n+const greeter = (_, name) => [\"h1.title\", \"hello \", name];\n// component w/ local state\n-const counter = () => {\n- let i = 0;\n+const counter = (i = 0) => {\nreturn () => [\"button\", { onclick: () => (i++) }, `clicks: ${i}`];\n};\nconst app = () => {\n- // instantiation\n- const counters = [counter(), counter()];\n+ // initialization steps\n+ // ...\n// root component is just a static array\n- return [\"div#app\", [greeter, \"world\"], ...counters];\n+ return [\"div#app\", [greeter, \"world\"], counter(), counter(100)];\n};\nstart(document.body, app());\n", "new_path": "examples/hdom-basics/src/index.ts", "old_path": "examples/hdom-basics/src/index.ts" }, { "change_type": "MODIFY", "diff": "import { start } from \"@thi.ng/hdom\";\nimport { fromRAF } from \"@thi.ng/rstream/from/raf\";\nimport { Stream } from \"@thi.ng/rstream/stream\";\n-import * as tx from \"@thi.ng/transducers\";\n+import { comp } from \"@thi.ng/transducers/func/comp\";\n+import { hex } from \"@thi.ng/transducers/func/hex\";\n+import { range } from \"@thi.ng/transducers/iter/range\";\n+import { iterator } from \"@thi.ng/transducers/iterator\";\n+import { transduce } from \"@thi.ng/transducers/transduce\";\n+import { push } from \"@thi.ng/transducers/rfn/push\";\n+import { benchmark } from \"@thi.ng/transducers/xform/benchmark\";\n+import { map } from \"@thi.ng/transducers/xform/map\";\n+import { mapIndexed } from \"@thi.ng/transducers/xform/map-indexed\";\n+import { movingAverage } from \"@thi.ng/transducers/xform/moving-average\";\n+import { partition } from \"@thi.ng/transducers/xform/partition\";\n// pre-defined hex formatters\n-const hex4 = tx.hex(4);\n-const hex6 = tx.hex(6);\n+const hex4 = hex(4);\n+const hex6 = hex(6);\n/**\n* Single box component. Uses given id to switch between using\n@@ -26,9 +36,9 @@ const box = (index: number, id: number) => [\n* @param items drop down options `[value, label]`\n*/\nconst dropdown = (onchange: (e: Event) => void, items: [any, any][]) =>\n- tx.transduce(\n- tx.map(([value, label]) => <any>[\"option\", { value }, label]),\n- tx.push(),\n+ transduce(\n+ map(([value, label]) => <any>[\"option\", { value }, label]),\n+ push(),\n[\"select\", { onchange }],\nitems\n);\n@@ -66,11 +76,11 @@ const fpsCounter = (src: Stream<any>, width = 100, height = 30, period = 50, col\n}\n},\n// stream transducer to compute the windowed moving avarage\n- tx.comp(\n- tx.benchmark(),\n- tx.movingAverage(period),\n- tx.map(x => 1000 / x),\n- tx.partition(width, 1, true)\n+ comp(\n+ benchmark(),\n+ movingAverage(period),\n+ map((x) => 1000 / x),\n+ partition(width, 1, true)\n)\n);\nreturn [{\n@@ -99,9 +109,9 @@ const app = () => {\nlet j = (++i) & 0x1ff;\nreturn [\"div\",\n[\"div#stats\", fps, menu],\n- [\"grid\", ...tx.iterator(tx.mapIndexed(box), tx.range(j, j + num))]\n+ [\"grid\", iterator(mapIndexed(box), range(j, j + num))]\n];\n};\n};\n-start(document.getElementById(\"app\"), app(), false);\n+start(document.getElementById(\"app\"), app(), null, false);\n", "new_path": "examples/hdom-benchmark/src/index.ts", "old_path": "examples/hdom-benchmark/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(examples): update dashboard, hdom-basics & hdom-benchmark
1
refactor
examples
679,913
08.04.2018 01:52:52
-3,600
a8a55a4f36897eb32cdf859d3a48b0a48659c26d
refactor(examples): major update router-basics (hdom context usage)
[ { "change_type": "MODIFY", "diff": "@@ -3,7 +3,7 @@ import { ViewTransform, IView } from \"@thi.ng/atom/api\";\nimport { EventDef, EffectDef } from \"@thi.ng/interceptors/api\";\nimport { HTMLRouterConfig, RouteMatch } from \"@thi.ng/router/api\";\n-import { App } from \"./app\";\n+import { EventBus } from \"@thi.ng/interceptors/event-bus\";\n// general types defined for the base app\n@@ -11,7 +11,7 @@ import { App } from \"./app\";\n* Function signature for main app components.\n* I.e. components representing different app states linked to router.\n*/\n-export type AppComponent = (app: App, ui: UIAttribs) => any;\n+export type AppComponent = (ctx: AppContext, ...args: any[]) => any;\n/**\n* Derived view configurations.\n@@ -30,16 +30,27 @@ export interface AppConfig {\ninitialState: any;\nrouter: HTMLRouterConfig;\nui: UIAttribs;\n- views: IObjectOf<ViewSpec>;\n+ views: Partial<Record<keyof AppViews, ViewSpec>>;\n}\n/**\n- * Base structure of derived views exposed by the base app.\n+ * Derived views exposed by the app.\n* Add more declarations here as needed.\n*/\n-export interface AppViews extends IObjectOf<IView<any>> {\n+export interface AppViews extends Record<keyof AppViews, IView<any>> {\nroute: IView<RouteMatch>;\nrouteComponent: IView<any>;\n+ users: IView<IObjectOf<User>>;\n+ userlist: IView<User[]>;\n+ status: IView<Status>;\n+ debug: IView<number>;\n+ json: IView<string>;\n+}\n+\n+export interface AppContext {\n+ bus: EventBus;\n+ views: AppViews;\n+ ui: UIAttribs;\n}\n/**\n@@ -56,6 +67,7 @@ export interface UIAttribs {\ncode: any;\ncolumn: any;\ncontact: any;\n+ debugToggle: any;\nnav: any;\nroot: any;\nstatus: any;\n@@ -64,6 +76,15 @@ export interface UIAttribs {\n/// demo app related types\n+export interface User {\n+ id: number;\n+ name: string;\n+ job: string;\n+ img: string;\n+ desc: string;\n+ alias: string;\n+}\n+\n/**\n* Types for status line component\n*/\n@@ -73,3 +94,8 @@ export enum StatusType {\nSUCCESS,\nERROR\n}\n+\n+export interface Status extends Array<any> {\n+ [0]: StatusType;\n+ [1]: string;\n+}\n", "new_path": "examples/router-basics/src/api.ts", "old_path": "examples/router-basics/src/api.ts" }, { "change_type": "MODIFY", "diff": "@@ -7,7 +7,7 @@ import { start } from \"@thi.ng/hdom\";\nimport { EVENT_ROUTE_CHANGED } from \"@thi.ng/router/api\";\nimport { HTMLRouter } from \"@thi.ng/router/history\";\n-import { AppConfig, ViewSpec, AppViews } from \"./api\";\n+import { AppConfig, ViewSpec, AppViews, AppContext } from \"./api\";\nimport { nav } from \"./components/nav\";\nimport { debugContainer } from \"./components/debug-container\";\n@@ -31,27 +31,29 @@ export class App {\nstatic readonly FX_ROUTE_TO = \"route-to\";\nconfig: AppConfig;\n+ ctx: AppContext;\nstate: Atom<any>;\n- views: AppViews;\n- bus: EventBus;\nrouter: HTMLRouter;\nconstructor(config: AppConfig) {\nthis.config = config;\nthis.state = new Atom(config.initialState || {});\n- this.views = <AppViews>{};\n+ this.ctx = {\n+ bus: new EventBus(this.state, config.events, config.effects),\n+ views: <AppViews>{},\n+ ui: config.ui\n+ };\nthis.addViews(this.config.views);\n- this.bus = new EventBus(this.state, config.events, config.effects);\nthis.router = new HTMLRouter(config.router);\nthis.router.addListener(\nEVENT_ROUTE_CHANGED,\n- (e) => this.bus.dispatch([EVENT_ROUTE_CHANGED, e.value])\n+ (e) => this.ctx.bus.dispatch([EVENT_ROUTE_CHANGED, e.value])\n);\n- this.bus.addHandlers({\n+ this.ctx.bus.addHandlers({\n[EVENT_ROUTE_CHANGED]: valueSetter(\"route\"),\n[App.EV_ROUTE_TO]: (_, [__, route]) => ({ [App.FX_ROUTE_TO]: route })\n});\n- this.bus.addEffect(\n+ this.ctx.bus.addEffect(\nApp.FX_ROUTE_TO,\n([id, params]) => this.router.routeTo(this.router.format(id, params))\n);\n@@ -61,7 +63,7 @@ export class App {\n\"route.id\",\n(id) =>\n(this.config.components[id] ||\n- (() => [\"div\", `missing component for route: ${id}`]))(this, this.config.ui)\n+ (() => [\"div\", `missing component for route: ${id}`]))(this.ctx, this.config.ui)\n]\n});\n}\n@@ -76,9 +78,9 @@ export class App {\nfor (let id in specs) {\nconst spec = specs[id];\nif (isArray(spec)) {\n- this.views[id] = this.state.addView(spec[0], spec[1]);\n+ this.ctx.views[id] = this.state.addView(spec[0], spec[1]);\n} else {\n- this.views[id] = this.state.addView(spec);\n+ this.ctx.views[id] = this.state.addView(spec);\n}\n}\n}\n@@ -93,10 +95,10 @@ export class App {\nstart() {\nthis.router.start();\nstart(this.config.domRoot, () => {\n- if (this.bus.processQueue()) {\n+ if (this.ctx.bus.processQueue()) {\nreturn this.rootComponent();\n}\n- });\n+ }, this.ctx);\n}\n/**\n@@ -104,13 +106,13 @@ export class App {\n* by current route and the derived view defined above.\n*/\nrootComponent(): any {\n- const debug = this.views.debug.deref();\n- const ui = this.config.ui;\n+ const debug = this.ctx.views.debug.deref();\n+ const ui = this.ctx.ui;\nreturn [\"div\", ui.root,\n[\"div\", ui.column.content[debug],\n- [nav, this, ui.nav],\n- this.views.routeComponent],\n- [debugContainer, this, ui, debug, this.views.json],\n+ nav,\n+ this.ctx.views.routeComponent],\n+ [debugContainer, debug, this.ctx.views.json],\n];\n}\n}\n", "new_path": "examples/router-basics/src/app.ts", "old_path": "examples/router-basics/src/app.ts" }, { "change_type": "MODIFY", "diff": "-import { IView } from \"@thi.ng/atom/api\";\n-\n-import { App } from \"../app\";\n-import { StatusType } from \"../api\";\n+import { AppContext, StatusType, User } from \"../api\";\nimport { EV_LOAD_USER_LIST, EV_SET_STATUS, ROUTE_USER_PROFILE } from \"../config\";\nimport { routeLink } from \"./route-link\";\n@@ -11,31 +8,28 @@ import { status } from \"./status\";\n* Dummy user list component. Triggers JSON I/O request if user data has\n* not been loaded yet.\n*\n- * @param app\n+ * @param ctx injected context object\n*/\n-export function allUsers(app: App, ui: any) {\n- if (!app.views.users.deref().all) {\n- app.bus.dispatch([EV_LOAD_USER_LIST]);\n- } else {\n- app.bus.dispatch([EV_SET_STATUS, [StatusType.SUCCESS, \"loaded from cache\", true]]);\n- }\n- return [\"div\",\n- [status, ui.status, app.views.status],\n- [userList, app, ui.userlist, app.views.users]\n- ];\n+export function allUsers(ctx: AppContext) {\n+ ctx.bus.dispatch(\n+ ctx.views.userlist.deref().length ?\n+ [EV_SET_STATUS, [StatusType.SUCCESS, \"list loaded from cache\", true]] :\n+ [EV_LOAD_USER_LIST]\n+ );\n+ return [\"div\", status, userList];\n}\n/**\n* The actual user list component.\n*\n- * @param app\n- * @param ui\n- * @param view\n+ * @param ctx injected context object\n*/\n-function userList(app: App, ui: any, view: IView<any>) {\n- const users = view.deref();\n- return users.all &&\n- [\"section\", ui.root, users.all.map(user(app, ui, users))];\n+function userList(ctx: AppContext) {\n+ const profiles = ctx.views.users.deref();\n+ const list = ctx.views.userlist.deref();\n+ return list &&\n+ [\"section\", ctx.ui.userlist.root,\n+ list.map((u) => [user, u, !!profiles[u.id]])];\n}\n/**\n@@ -44,21 +38,20 @@ function userList(app: App, ui: any, view: IView<any>) {\n* Based on:\n* http://tachyons.io/components/lists/follower-notifications/index.html\n*\n- * @param app\n- * @param ui\n- * @param users\n+ * @param ctx injected context object\n+ * @param user\n+ * @param cached\n*/\n-function user(app: App, ui: any, users: any) {\n- return (u) =>\n- [\"article\", ui.container,\n+function user(ctx: AppContext, user: User, cached: boolean) {\n+ const ui = ctx.ui.userlist;\n+ return [\"article\", ui.container,\n[\"div\", ui.thumbWrapper,\n- [\"img\", { ...ui.thumb, src: u.img }]],\n+ [\"img\", { ...ui.thumb, src: user.img }]],\n[\"div\", ui.body,\n[\"h1\", ui.title,\n- routeLink(app, ROUTE_USER_PROFILE.id, { id: u.id }, null, u.name)],\n- [\"h2\", ui.subtitle, `@${u.alias}`]\n- ],\n- users[u.id] ?\n+ [routeLink, ROUTE_USER_PROFILE.id, { id: user.id }, null, user.name]],\n+ [\"h2\", ui.subtitle, `@${user.alias}`]],\n+ cached ?\n[\"div\", ui.meta, \"cached\"] :\nundefined\n];\n", "new_path": "examples/router-basics/src/components/all-users.ts", "old_path": "examples/router-basics/src/components/all-users.ts" }, { "change_type": "MODIFY", "diff": "-import { App } from \"../app\";\n+import { AppContext } from \"../api\";\n+import { externalLink } from \"./external-link\";\n/**\n* Contact page component.\n*\n- * @param app\n+ * @param ctx injected context object\n*/\n-export function contact(_: App, ui: any) {\n- return [\"div\",\n- [\"p\", ui.bodyCopy, \"Get in touch!\"],\n- [\"p\", ui.bodyCopy,\n+export function contact(ctx: AppContext) {\n+ return [\"div\", ctx.ui.bodyCopy,\n+ [\"p\", \"Get in touch!\"],\n+ [\"p\",\n[\n[\"https://github.com/thi-ng/umbrella\", \"GitHub\"],\n[\"https://twitter.com/toxi\", \"Twitter\"],\n[\"https://medium.com/@thi.ng\", \"Medium\"]\n- ].map(([uri, label]) => [\"a\", { ...ui.contact.link, href: uri }, label])\n+ ].map((link) => [externalLink, ctx.ui.contact.link, ...link])\n]\n];\n}\n", "new_path": "examples/router-basics/src/components/contact.ts", "old_path": "examples/router-basics/src/components/contact.ts" }, { "change_type": "MODIFY", "diff": "-import { IView } from \"@thi.ng/atom/api\";\n-\n-import { App } from \"../app\";\n+import { AppContext } from \"../api\";\nimport { EV_TOGGLE_DEBUG } from \"../config\";\n+import { eventLink } from \"./event-link\";\n/**\n* Collapsable component showing stringified app state.\n*\n- * @param app\n- * @param ui\n+ * @param ctx injected context object\n* @param debug\n* @param json\n*/\n-export function debugContainer(app: App, ui: any, debug: number, json: IView<any>) {\n- return [\"div#debug\", ui.column.debug[debug],\n- [\"a.toggle\",\n- {\n- href: \"#\",\n- onclick: (e) => (e.preventDefault(), app.bus.dispatch([EV_TOGGLE_DEBUG]))\n- },\n- debug ? \"close \\u25bc\" : \"open \\u25b2\"\n- ],\n- [\"pre\", ui.code, json]\n+export function debugContainer(ctx: AppContext, debug: any, json: string) {\n+ return [\"div#debug\", ctx.ui.column.debug[debug],\n+ [eventLink, [EV_TOGGLE_DEBUG], ctx.ui.debugToggle,\n+ debug ? \"close \\u25bc\" : \"open \\u25b2\"],\n+ [\"pre\", ctx.ui.code, json]\n];\n}\n", "new_path": "examples/router-basics/src/components/debug-container.ts", "old_path": "examples/router-basics/src/components/debug-container.ts" }, { "change_type": "MODIFY", "diff": "import { Event } from \"@thi.ng/interceptors/api\";\n-import { App } from \"../app\";\n+import { AppContext } from \"../api\";\n/**\n* Customizable hyperlink component emitting given event on app's event\n* bus when clicked.\n*\n- * @param app\n+ * @param ctx injected context object\n* @param event event tuple of `[event-id, payload]`\n* @param attribs element attribs\n* @param body link body\n*/\n-export function eventLink(app: App, event: Event, attribs: any, body: any) {\n+export function eventLink(ctx: AppContext, event: Event, attribs: any, body: any) {\nreturn [\"a\",\n{\n...attribs,\nonclick: (e) => {\ne.preventDefault();\n- app.bus.dispatch(event);\n+ ctx.bus.dispatch(event);\n}\n},\nbody];\n", "new_path": "examples/router-basics/src/components/event-link.ts", "old_path": "examples/router-basics/src/components/event-link.ts" }, { "change_type": "ADD", "diff": "+import { AppContext } from \"../api\";\n+\n+/**\n+ * User stylable external link component.\n+ *\n+ * @param ctx injected context object\n+ * @param attribs user provided attribs\n+ * @param uri link target\n+ * @param body link body\n+ */\n+export function externalLink(_: AppContext, attribs: any, uri: string, body: any) {\n+ return [\"a\", { ...attribs, href: uri }, body];\n+}\n", "new_path": "examples/router-basics/src/components/external-link.ts", "old_path": null }, { "change_type": "MODIFY", "diff": "-import { UIAttribs } from \"../api\";\n-import { App } from \"../app\";\n+import { AppContext } from \"../api\";\n+import { externalLink } from \"./external-link\";\n/**\n* Homepage component.\n*\n- * @param app\n+ * @param ctx injected context object\n*/\n-export function home(_: App, ui: UIAttribs) {\n- return [\"div\", ui.bodyCopy,\n+export function home(ctx: AppContext) {\n+ return [\"div\", ctx.ui.bodyCopy,\n[\"p\",\n\"This is an example application to demonstrate common usage patterns for creating lightweight web apps with the \",\n- [\"a\", { ...ui.bodyLink, href: \"https://github.com/thi-ng/umbrella\" }, \"@thi.ng/umbrella\"],\n- \" libraries.\"],\n+ [externalLink, ctx.ui.bodyLink, \"https://github.com/thi-ng/umbrella\", \"@thi.ng/umbrella\"], \" libraries.\"],\n[\"p\",\n[\"ul.list\",\n[\"li\", \"App & component configuration\"],\n+ [\"li\", \"Global context injection\"],\n[\"li\", \"Pure ES6 UI components\"],\n[\"li\", \"Central app state handling\"],\n[\"li\", \"Derived views\"],\n@@ -23,10 +23,10 @@ export function home(_: App, ui: UIAttribs) {\n[\"li\", \"Async side effects\"],\n[\"li\", \"Dynamic content loading / transformation\"],\n[\"li\", \"Component styling with \",\n- [\"a\", { ...ui.bodyLink, href: \"http://tachyons.io/\" }, \"Tachyons CSS\"]],\n+ [externalLink, ctx.ui.bodyLink, \"http://tachyons.io/\", \"Tachyons CSS\"]],\n]],\n[\"p\",\n\"Please see the related blog post and the commented source code for more details.\"],\n- [\"p\", \"(total app file size: 11.2KB)\"]\n+ [\"p\", \"(total app file size: 11.8KB)\"]\n];\n}\n", "new_path": "examples/router-basics/src/components/home.ts", "old_path": "examples/router-basics/src/components/home.ts" }, { "change_type": "MODIFY", "diff": "-import { App } from \"../app\";\n+import { AppContext } from \"../api\";\nimport { ROUTE_USER_LIST, ROUTE_HOME, ROUTE_CONTACT } from \"../config\";\nimport { routeLink } from \"./route-link\";\n@@ -6,16 +6,16 @@ import { routeLink } from \"./route-link\";\n/**\n* Main nav component with hardcoded routes.\n*\n- * @param app\n- * @param ui\n+ * @param ctx injected context object\n*/\n-export function nav(app: App, ui: any) {\n+export function nav(ctx: AppContext) {\n+ const ui = ctx.ui.nav;\nreturn [\"nav\",\n[\"h1\", ui.title, \"Demo app\"],\n[\"div\", ui.inner,\n- routeLink(app, ROUTE_HOME.id, null, ui.link, \"Home\"),\n- routeLink(app, ROUTE_USER_LIST.id, null, ui.link, \"Users\"),\n- routeLink(app, ROUTE_CONTACT.id, null, ui.linkLast, \"Contact\"),\n+ [routeLink, ROUTE_HOME.id, null, ui.link, \"Home\"],\n+ [routeLink, ROUTE_USER_LIST.id, null, ui.link, \"Users\"],\n+ [routeLink, ROUTE_CONTACT.id, null, ui.linkLast, \"Contact\"],\n]\n];\n}\n", "new_path": "examples/router-basics/src/components/nav.ts", "old_path": "examples/router-basics/src/components/nav.ts" }, { "change_type": "MODIFY", "diff": "import { App } from \"../app\";\n+import { AppContext } from \"../api\";\n/**\n* Customizable hyperlink component emitting EV_ROUTE_TO event when clicked.\n*\n- * @param app\n+ * @param ctx injected context object\n* @param routeID route ID\n* @param routeParams route parameter object\n* @param attribs element attribs\n* @param body link body\n*/\n-export function routeLink(app: App, routeID: PropertyKey, routeParams: any, attribs: any, body: any) {\n+export function routeLink(ctx: AppContext, routeID: PropertyKey, routeParams: any, attribs: any, body: any) {\nreturn [\"a\",\n{\n...attribs,\nonclick: (e) => {\ne.preventDefault();\n- app.bus.dispatch([App.EV_ROUTE_TO, [routeID, routeParams]]);\n+ ctx.bus.dispatch([App.EV_ROUTE_TO, [routeID, routeParams]]);\n}\n},\nbody];\n", "new_path": "examples/router-basics/src/components/route-link.ts", "old_path": "examples/router-basics/src/components/route-link.ts" }, { "change_type": "MODIFY", "diff": "-import { IView } from \"@thi.ng/atom/api\";\n+import { AppContext } from \"../api\";\n/**\n* Status line component\n*\n- * @param app\n- * @param ui\n+ * @param ctx injected context object\n*/\n-export function status(ui: any, view: IView<any>) {\n- const [type, msg] = view.deref();\n- return [\"p\", ui[type], msg];\n+export function status(ctx: AppContext) {\n+ const [type, msg] = ctx.views.status.deref();\n+ return [\"p\", ctx.ui.status[type], msg];\n}\n", "new_path": "examples/router-basics/src/components/status.ts", "old_path": "examples/router-basics/src/components/status.ts" }, { "change_type": "MODIFY", "diff": "-import { App } from \"../app\";\n-import { StatusType } from \"../api\";\n+import { StatusType, AppContext } from \"../api\";\nimport { EV_LOAD_USER, EV_SET_STATUS } from \"../config\";\nimport { status } from \"./status\";\n@@ -8,27 +7,21 @@ import { status } from \"./status\";\n* Single user profile page. Triggers JSON I/O request on init if user\n* data has not been loaded yet.\n*\n- * @param app\n+ * @param ctx injected context object\n*/\n-export function userProfile(app: App, ui: any) {\n- const id = app.views.route.deref().params.id;\n- if (!app.views.users.deref()[id]) {\n- app.bus.dispatch([EV_LOAD_USER, id]);\n- } else {\n- app.bus.dispatch([\n- EV_SET_STATUS,\n- [StatusType.SUCCESS, \"loaded from cache\", true]\n- ]);\n- }\n- return [\"div\",\n- [status, ui.status, app.views.status],\n- [userCard, app, ui.card, id]\n- ];\n+export function userProfile(ctx: AppContext) {\n+ const id = ctx.views.route.deref().params.id;\n+ ctx.bus.dispatch(\n+ ctx.views.users.deref()[id] ?\n+ [EV_SET_STATUS, [StatusType.SUCCESS, \"loaded from cache\", true]] :\n+ [EV_LOAD_USER, id]);\n+ return [\"div\", [status], [userCard, id]];\n}\n// based on: http://tachyons.io/components/cards/profile-card/index.html\n-function userCard(app: App, ui: any, id: number) {\n- const user = app.views.users.deref()[id];\n+function userCard(ctx: AppContext, id: number) {\n+ const user = ctx.views.users.deref()[id];\n+ const ui = ctx.ui.card;\nreturn user ?\n[\"div\", ui.container,\n[\"img\", { ...ui.thumb, src: user.img }],\n", "new_path": "examples/router-basics/src/components/user-profile.ts", "old_path": "examples/router-basics/src/components/user-profile.ts" }, { "change_type": "MODIFY", "diff": "@@ -143,7 +143,7 @@ export const CONFIG: AppConfig = {\n// note: we assign multiple value/events as array to the FX_DISPATCH_NOW side effect\n[EV_RECEIVE_USERS]: (_, [__, json]) => ({\n[FX_DISPATCH_NOW]: [\n- <Event>[EV_SET_VALUE, [\"users.all\", json]],\n+ <Event>[EV_SET_VALUE, [\"userlist\", json]],\n<Event>[EV_SET_STATUS, [StatusType.SUCCESS, \"JSON succesfully loaded\", true]]\n],\n}),\n@@ -197,6 +197,7 @@ export const CONFIG: AppConfig = {\ninitialState: {\nstatus: [StatusType.INFO, \"running\"],\nusers: {},\n+ userlist: [],\nroute: {},\ndebug: 1,\n},\n@@ -209,6 +210,7 @@ export const CONFIG: AppConfig = {\nviews: {\njson: [\"\", (state) => JSON.stringify(state, null, 2)],\nusers: [\"users\", (users) => users || {}],\n+ userlist: \"userlist\",\nstatus: \"status\",\ndebug: \"debug\",\n},\n@@ -238,6 +240,7 @@ export const CONFIG: AppConfig = {\ncontact: {\nlink: { class: \"db pb2 link dim black\" }\n},\n+ debugToggle: { class: \"toggle pointer\" },\nnav: {\ninner: { class: \"tc pb3\" },\ntitle: { class: \"black f1 lh-title tc db mb2 mb2-ns\" },\n", "new_path": "examples/router-basics/src/config.ts", "old_path": "examples/router-basics/src/config.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(examples): major update router-basics (hdom context usage)
1
refactor
examples
679,913
08.04.2018 01:57:17
-3,600
86d1f0d9ea58e7f6b4a2610fa5a8cc6ac163a183
refactor(hdom-components): remove svg, update canvas (hdom context support) remove entire svg.ts remove dependency update readme BREAKING CHANGE: SVG functionality has been moved to new package. Canvas component user fns have new args
[ { "change_type": "MODIFY", "diff": "@@ -34,7 +34,7 @@ import * as hdc from \"@thi.ng/hdom-components\";\n### Canvas\n-- [Canvas types](https://github.com/thi-ng/umbrella/tree/master/packages/hdom-components/src/canvas.ts)\n+- [Canvas types](https://github.com/thi-ng/umbrella/tree/master/packages/hdom-components/src/canvas.ts) (WebGL & Canvas2D)\n### Form elements\n@@ -44,10 +44,6 @@ import * as hdc from \"@thi.ng/hdom-components\";\n- [Link types](https://github.com/thi-ng/umbrella/tree/master/packages/hdom-components/src/link.ts)\n-### SVG\n-\n-- [SVG elements](https://github.com/thi-ng/umbrella/tree/master/packages/hdom-components/src/svg.ts)\n-\n## Authors\n- Karsten Schmidt\n", "new_path": "packages/hdom-components/README.md", "old_path": "packages/hdom-components/README.md" }, { "change_type": "MODIFY", "diff": "\"typescript\": \"^2.8.1\"\n},\n\"dependencies\": {\n- \"@thi.ng/checks\": \"^1.3.2\",\n- \"@thi.ng/hiccup\": \"^1.3.3\"\n+ \"@thi.ng/checks\": \"^1.3.2\"\n},\n\"keywords\": [\n\"ES6\",\n", "new_path": "packages/hdom-components/package.json", "old_path": "packages/hdom-components/package.json" }, { "change_type": "MODIFY", "diff": "@@ -4,31 +4,37 @@ export interface CanvasOpts {\n[id: string]: any;\n}\n+export type WebGLInitFn = (el: HTMLCanvasElement, gl: WebGLRenderingContext, hctx?: any) => void;\n+export type WebGLUpdateFn = (el: HTMLCanvasElement, gl: WebGLRenderingContext, hctx?: any, frame?: number) => void;\n+\n+export type Canvas2DInitFn = (el: HTMLCanvasElement, gl: CanvasRenderingContext2D, hctx?: any) => void;\n+export type Canvas2DUpdateFn = (el: HTMLCanvasElement, gl: CanvasRenderingContext2D, hctx?: any, frame?: number) => void;\n+\nconst _canvas = (type, init, update, attribs, opts) => {\n- let ctx;\n+ let el, ctx;\nlet frame = 0;\nreturn [{\n- init(el: HTMLCanvasElement) {\n+ init(el: HTMLCanvasElement, hctx: any) {\nctx = el.getContext(type, opts);\n- init(ctx);\n+ init(el, ctx, hctx);\n},\n- render() {\n- ctx && update(ctx, frame++);\n+ render(hctx: any) {\n+ ctx && update(el, ctx, hctx, frame++);\nreturn [\"canvas\", attribs]\n}\n}];\n};\nexport const canvasWebGL = (\n- init: (gl: WebGLRenderingContext) => void,\n- update: (gl: WebGLRenderingContext, frame: number) => void,\n+ init: WebGLInitFn,\n+ update: WebGLUpdateFn,\nattribs: CanvasOpts,\nglopts?: WebGLContextAttributes) =>\n_canvas(\"webgl\", init, update, attribs, glopts);\nexport const canvas2D = (\n- init: (gl: CanvasRenderingContext2D) => void,\n- update: (gl: CanvasRenderingContext2D, frame: number) => void,\n+ init: Canvas2DInitFn,\n+ update: Canvas2DUpdateFn,\nattribs: CanvasOpts,\nctxopts?: Canvas2DContextAttributes) =>\n_canvas(\"2d\", init, update, attribs, ctxopts);\n", "new_path": "packages/hdom-components/src/canvas.ts", "old_path": "packages/hdom-components/src/canvas.ts" }, { "change_type": "MODIFY", "diff": "export * from \"./canvas\";\nexport * from \"./dropdown\";\nexport * from \"./link\";\n-export * from \"./svg\";\n", "new_path": "packages/hdom-components/src/index.ts", "old_path": "packages/hdom-components/src/index.ts" }, { "change_type": "DELETE", "diff": "-import { SVG_NS } from \"@thi.ng/hiccup/api\";\n-\n-export interface PathSegment extends Array<any> {\n- [0]: string;\n- [1]?: ArrayLike<number>[];\n-}\n-\n-let PRECISION = 2;\n-\n-export const setPrecision = (n: number) => (PRECISION = n);\n-\n-export const svgdoc = (attr, ...body) => [\n- \"svg\",\n- Object.assign(attr, { xmlns: SVG_NS }),\n- ...body\n-];\n-\n-export const ff = (x: number) => x.toFixed(PRECISION);\n-export const point = (p: ArrayLike<number>) => ff(p[0]) + \",\" + ff(p[1]);\n-\n-export const defs = (...defs) => [\"defs\", ...defs];\n-\n-export const group = (attr, ...body) => [\"g\", attr, ...body];\n-\n-export const circle = (p: ArrayLike<number>, r = 1, attr?) =>\n- [\n- \"circle\",\n- Object.assign({\n- cx: ff(p[0]),\n- cy: ff(p[1]),\n- r: ff(r),\n- }, attr)\n- ];\n-\n-export const rect = (p: ArrayLike<number>, width = 1, height = 1, attr?) =>\n- [\n- \"rect\",\n- Object.assign({\n- x: ff(p[0]),\n- y: ff(p[1]),\n- width: ff(width),\n- height: ff(height),\n- }, attr)\n- ];\n-\n-export const line = (a: ArrayLike<number>, b: ArrayLike<number>, attr?) =>\n- [\n- \"line\",\n- Object.assign({\n- x1: ff(a[0]),\n- y1: ff(a[1]),\n- x2: ff(b[0]),\n- y2: ff(b[1]),\n- }, attr)\n- ];\n-\n-export const polyline = (points: ArrayLike<number>[], attr?) =>\n- [\n- \"polyline\",\n- Object.assign({ points: points.map(point).join(\" \") }, attr)\n- ];\n-\n-export const polygon = (points: ArrayLike<number>[], attr?) =>\n- [\n- \"polygon\",\n- Object.assign({ points: points.map(point).join(\" \") }, attr)\n- ];\n-\n-export const path = (segments: PathSegment[], attr?) =>\n- [\n- \"path\",\n- {\n- ...attr,\n- d: segments.map((seg) => seg[0] + seg[1].map(point).join(\",\")),\n- }\n- ];\n-\n-export const text = (body: string, p: ArrayLike<number>, attr?) =>\n- [\"text\",\n- {\n- x: ff(p[0]),\n- y: ff(p[1]),\n- ...attr\n- },\n- body\n- ];\n-\n-const gradient = (type: string, attribs: any, stops: [any, string][]) =>\n- [type,\n- attribs,\n- ...stops.map(\n- ([offset, col]) => [\"stop\", { offset, \"stop-color\": col }]\n- )\n- ];\n-\n-export const linearGradient = (id: string, x1, y1, x2, y2, stops: [any, string][]) =>\n- gradient(\n- \"linearGradient\",\n- { id, x1, y1, x2, y2 },\n- stops\n- );\n-\n-export const radialGradient = (id: string, cx, cy, r, stops: [any, string][]) =>\n- gradient(\n- \"radialGradient\",\n- { id, cx, cy, r },\n- stops\n- );\n", "new_path": null, "old_path": "packages/hdom-components/src/svg.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(hdom-components): remove svg, update canvas (hdom context support) - remove entire svg.ts - remove @thi.ng/hiccup dependency - update readme BREAKING CHANGE: SVG functionality has been moved to new @thi.ng/hiccup-svg package. Canvas component user fns have new args
1
refactor
hdom-components
679,913
08.04.2018 02:01:41
-3,600
7e0aeb682863a881615fe7bc9de8ceaa08cd9ed8
refactor(examples): update pointfree-svg update deps to use
[ { "change_type": "MODIFY", "diff": "},\n\"dependencies\": {\n\"@thi.ng/hiccup\": \"latest\",\n- \"@thi.ng/hdom-components\": \"latest\",\n+ \"@thi.ng/hiccup-svg\": \"latest\",\n\"@thi.ng/pointfree\": \"latest\",\n\"@thi.ng/pointfree-lang\": \"latest\"\n}\n", "new_path": "examples/pointfree-svg/package.json", "old_path": "examples/pointfree-svg/package.json" }, { "change_type": "MODIFY", "diff": "import * as fs from \"fs\";\n-import * as svg from \"@thi.ng/hdom-components/svg\";\n+import * as svg from \"@thi.ng/hiccup-svg\";\nimport { serialize } from \"@thi.ng/hiccup\";\nimport { ensureStack, maptos } from \"@thi.ng/pointfree\";\nimport { ffi, run } from \"@thi.ng/pointfree-lang\";\n", "new_path": "examples/pointfree-svg/src/index.ts", "old_path": "examples/pointfree-svg/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(examples): update pointfree-svg - update deps to use @thi.ng/hiccup-svg
1
refactor
examples
679,913
08.04.2018 02:13:59
-3,600
1e798ce7505f8347d6ff3e1bd757843162bd6d26
docs: add hiccup-svg to main readme
[ { "change_type": "MODIFY", "diff": "@@ -42,6 +42,7 @@ difficulties, many combining functionality from several packages) in the\n| [`@thi.ng/hdom-components`](./packages/hdom-components) | [![npm (scoped)](https://img.shields.io/npm/v/@thi.ng/hdom-components.svg)](https://www.npmjs.com/package/@thi.ng/hdom-components) | [changelog](./packages/hdom-components/CHANGELOG.md) |\n| [`@thi.ng/hiccup`](./packages/hiccup) | [![npm (scoped)](https://img.shields.io/npm/v/@thi.ng/hiccup.svg)](https://www.npmjs.com/package/@thi.ng/hiccup) | [changelog](./packages/hiccup/CHANGELOG.md) |\n| [`@thi.ng/hiccup-css`](./packages/hiccup-css) | [![npm (scoped)](https://img.shields.io/npm/v/@thi.ng/hiccup-css.svg)](https://www.npmjs.com/package/@thi.ng/hiccup-css) | [changelog](./packages/hiccup-css/CHANGELOG.md) |\n+| [`@thi.ng/hiccup-svg`](./packages/hiccup-svg) | [![npm (scoped)](https://img.shields.io/npm/v/@thi.ng/hiccup-svg.svg)](https://www.npmjs.com/package/@thi.ng/hiccup-svg) | [changelog](./packages/hiccup-svg/CHANGELOG.md) |\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", "new_path": "README.md", "old_path": "README.md" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
docs: add hiccup-svg to main readme
1
docs
null
679,913
08.04.2018 02:28:23
-3,600
e06e5042079d8118238ad0e4f0557f879f0c7a0c
refactor(examples): update todo-list
[ { "change_type": "MODIFY", "diff": "@@ -82,4 +82,4 @@ const header =\n[\"a\", { href: \"https://github.com/thi-ng/umbrella/tree/master/packages/hdom\" }, \"@thi.ng/hdom\"]]];\n// kick off UI w/ root component function\n-start(document.getElementById(\"app\"), () => [\"div\", header, toolbar, taskList]);\n+start(\"app\", () => [\"div\", header, toolbar, taskList]);\n", "new_path": "examples/todo-list/src/index.ts", "old_path": "examples/todo-list/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(examples): update todo-list
1
refactor
examples