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
743,977
15.04.2017 16:45:02
18,000
6f78c05a3a719f3c40e3b8197dd1ea2e85afd627
feat: allow strict mode to be disabled BREAKING CHANGE: the first argument to strict() is now used to enable/disable its functionality, rather than controlling whether or not it is global.
[ { "change_type": "MODIFY", "diff": "@@ -1809,7 +1809,7 @@ Specify --help for available options\nSpecifies either a single option key (string), or an array of options.\nIf any of the options is present, yargs validation is skipped.\n-.strict([global=true])\n+.strict([enabled=true])\n---------\nAny command-line argument given that is not demanded, or does not have a\n", "new_path": "README.md", "old_path": "README.md" }, { "change_type": "MODIFY", "diff": "@@ -1000,19 +1000,6 @@ describe('Command', function () {\ncommandCalled.should.be.true\n})\n- it('does not apply strict globally when passed value of `false`', function () {\n- var commandCalled = false\n- yargs('hi')\n- .strict(false)\n- .command('hi', 'The hi command', function (innerYargs) {\n- commandCalled = true\n- innerYargs.getStrict().should.be.false\n- })\n- yargs.getStrict().should.be.true\n- yargs.argv // parse and run command\n- commandCalled.should.be.true\n- })\n-\n// address regression introduced in #766, thanks @nexdrew!\nit('does not fail strict check due to postional command arguments', function (done) {\nyargs()\n@@ -1037,6 +1024,19 @@ describe('Command', function () {\n})\n})\n+ it('allows a command to override global`', function () {\n+ var commandCalled = false\n+ yargs('hi')\n+ .strict()\n+ .command('hi', 'The hi command', function (innerYargs) {\n+ commandCalled = true\n+ innerYargs.strict(false).getStrict().should.be.false\n+ })\n+ yargs.getStrict().should.be.true\n+ yargs.argv // parse and run command\n+ commandCalled.should.be.true\n+ })\n+\nit('does not fire command if validation fails', function (done) {\nvar commandRun = false\nyargs()\n", "new_path": "test/command.js", "old_path": "test/command.js" }, { "change_type": "MODIFY", "diff": "@@ -225,7 +225,6 @@ describe('yargs dsl tests', function () {\n.implies('foo', 'snuh')\n.conflicts('qux', 'xyzzy')\n.group('foo', 'Group:')\n- .strict(false)\n.exitProcess(false) // defaults to true.\n.global('foo', false)\n.global('qux', false)\n@@ -266,7 +265,6 @@ describe('yargs dsl tests', function () {\nexpect(y.getValidationInstance().getConflicting()).to.deep.equal({})\nexpect(y.getCommandInstance().getCommandHandlers()).to.deep.equal({})\nexpect(y.getExitProcess()).to.equal(false)\n- expect(y.getStrict()).to.equal(false)\nexpect(y.getDemandedOptions()).to.deep.equal({})\nexpect(y.getDemandedCommands()).to.deep.equal({})\nexpect(y.getGroups()).to.deep.equal({})\n", "new_path": "test/yargs.js", "old_path": "test/yargs.js" }, { "change_type": "MODIFY", "diff": "@@ -126,7 +126,6 @@ function Yargs (processArgs, cwd, parentRequire) {\ncommand = command ? command.reset() : Command(self, usage, validation)\nif (!completion) completion = Completion(self, usage, command)\n- if (!strictGlobal) strict = false\ncompletionCommand = null\noutput = ''\nexitError = null\n@@ -695,11 +694,9 @@ function Yargs (processArgs, cwd, parentRequire) {\n}\nvar strict = false\n- var strictGlobal = false\n- self.strict = function (global) {\n- argsert('[boolean]', [global], arguments.length)\n- strict = true\n- strictGlobal = global !== false\n+ self.strict = function (enabled) {\n+ argsert('[boolean]', [enabled], arguments.length)\n+ strict = enabled !== false\nreturn self\n}\nself.getStrict = function () {\n", "new_path": "yargs.js", "old_path": "yargs.js" } ]
JavaScript
MIT License
yargs/yargs
feat: allow strict mode to be disabled (#840) BREAKING CHANGE: the first argument to strict() is now used to enable/disable its functionality, rather than controlling whether or not it is global.
1
feat
null
807,849
18.04.2017 12:18:23
25,200
2e5cf3dbe6ee300915a8fd68cc32b13f0833c0cf
deps: upgrade yargs
[ { "change_type": "MODIFY", "diff": "\"temp-write\": \"^3.2.0\",\n\"write-json-file\": \"^2.0.0\",\n\"write-pkg\": \"^2.1.0\",\n- \"yargs\": \"^7.0.2\"\n+ \"yargs\": \"^7.1.0\"\n},\n\"bin\": {\n\"lerna\": \"./bin/lerna.js\"\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "@@ -4005,9 +4005,9 @@ yargs@^6.3.0:\ny18n \"^3.2.1\"\nyargs-parser \"^4.2.0\"\n-yargs@^7.0.2:\n- version \"7.0.2\"\n- resolved \"https://registry.yarnpkg.com/yargs/-/yargs-7.0.2.tgz#115b97df1321823e8b8648e8968c782521221f67\"\n+yargs@^7.1.0:\n+ version \"7.1.0\"\n+ resolved \"https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8\"\ndependencies:\ncamelcase \"^3.0.0\"\ncliui \"^3.2.0\"\n", "new_path": "yarn.lock", "old_path": "yarn.lock" } ]
JavaScript
MIT License
lerna/lerna
deps: upgrade yargs
1
deps
null
807,849
18.04.2017 12:22:21
25,200
bcb12789896379844c768608ca8a69d8750e42cd
bin: remove yargs.terminalWidth() workaround
[ { "change_type": "MODIFY", "diff": "@@ -11,12 +11,6 @@ const globalKeys = Object.keys(globalOptions).concat([\n\"version\",\n]);\n-// workaround non-interactive yargs.terminalWidth() error\n-// until https://github.com/yargs/yargs/pull/837 is released\n-function terminalWidth() {\n- return typeof process.stdout.columns !== \"undefined\" ? process.stdout.columns : null;\n-}\n-\nyargs\n.epilogue(dedent`\nWhen a command fails, all logs are written to lerna-debug.log in the current working directory.\n@@ -24,7 +18,7 @@ yargs\nFor more information, find our manual at https://github.com/lerna/lerna\n`)\n.usage(\"Usage: $0 <command> [options]\")\n- .wrap(terminalWidth())\n+ .wrap(yargs.terminalWidth())\n.options(globalOptions).group(globalKeys, \"Global Options:\")\n.commandDir(\"../lib/commands\")\n.demandCommand()\n", "new_path": "bin/lerna.js", "old_path": "bin/lerna.js" } ]
JavaScript
MIT License
lerna/lerna
bin: remove yargs.terminalWidth() workaround
1
bin
null
807,849
18.04.2017 14:03:15
25,200
2ac3ba1b020c7b66df91077067a6b288e5cc7ceb
cli: move guts of bin/lerna into src/cli
[ { "change_type": "MODIFY", "diff": "#!/usr/bin/env node\n\"use strict\";\n-const yargs = require(\"yargs\");\n-const dedent = require(\"dedent\");\n-const globalOptions = require(\"../lib/Command\").builder;\n-\n-// the options grouped under \"Global Options:\" header\n-const globalKeys = Object.keys(globalOptions).concat([\n- \"help\",\n- \"version\",\n-]);\n-\n-yargs\n- .epilogue(dedent`\n- When a command fails, all logs are written to lerna-debug.log in the current working directory.\n-\n- For more information, find our manual at https://github.com/lerna/lerna\n- `)\n- .usage(\"Usage: $0 <command> [options]\")\n- .wrap(yargs.terminalWidth())\n- .options(globalOptions).group(globalKeys, \"Global Options:\")\n- .commandDir(\"../lib/commands\")\n- .demandCommand()\n- .help(\"h\").alias(\"h\", \"help\")\n- .version().alias(\"v\", \"version\")\n- .argv;\n+require(\"../lib/cli\")().parse(process.argv.slice(2));\n", "new_path": "bin/lerna.js", "old_path": "bin/lerna.js" }, { "change_type": "ADD", "diff": "+import yargs from \"yargs/yargs\";\n+import dedent from \"dedent\";\n+import { builder as globalOptions } from \"./Command\";\n+\n+/**\n+Essentially a factory that returns a yargs() instance that can\n+be used to call parse() immediately (as in ../bin/lerna) or by\n+unit tests to encapsulate instantiation with \"real\" arguments.\n+\n+@param {Array = []} argv\n+@param {String = process.cwd()} cwd\n+**/\n+export default function CLI(argv, cwd) {\n+ const cli = yargs(argv, cwd);\n+\n+ // the options grouped under \"Global Options:\" header\n+ const globalKeys = Object.keys(globalOptions).concat([\n+ \"help\",\n+ \"version\",\n+ ]);\n+\n+ return cli\n+ .usage(\"Usage: $0 <command> [options]\")\n+ .options(globalOptions).group(globalKeys, \"Global Options:\")\n+ .commandDir(\"../lib/commands\")\n+ .demandCommand()\n+ .help(\"h\").alias(\"h\", \"help\")\n+ .version().alias(\"v\", \"version\")\n+ .wrap(cli.terminalWidth())\n+ .epilogue(dedent`\n+ When a command fails, all logs are written to lerna-debug.log in the current working directory.\n+\n+ For more information, find our manual at https://github.com/lerna/lerna\n+ `);\n+}\n", "new_path": "src/cli.js", "old_path": null } ]
JavaScript
MIT License
lerna/lerna
cli: move guts of bin/lerna into src/cli
1
cli
null
807,849
18.04.2017 14:04:13
25,200
957fdaddd6cea23d8e7eb626833e2f9b7763d2d2
cli: add group 'Command Options' so they sort above 'Global Options'
[ { "change_type": "MODIFY", "diff": "@@ -18,15 +18,18 @@ export const describe = \"Link local packages together and install remaining pack\nexport const builder = {\n\"hoist\": {\n+ group: \"Command Options:\",\ndescribe: \"Install external dependencies matching [glob] to the repo root\",\ntype: \"string\",\ndefaultDescription: \"'**'\",\n},\n\"nohoist\": {\n+ group: \"Command Options:\",\ndescribe: \"Don't hoist external dependencies matching [glob] to the repo root\",\ntype: \"string\"\n},\n\"npm-client\": {\n+ group: \"Command Options:\",\ndescribe: \"Executable used to install dependencies (npm, yarn, pnpm, ...)\",\ntype: \"string\",\nrequiresArg: true,\n", "new_path": "src/commands/BootstrapCommand.js", "old_path": "src/commands/BootstrapCommand.js" }, { "change_type": "MODIFY", "diff": "@@ -15,6 +15,7 @@ export const describe = \"Remove the node_modules directory from all packages.\";\nexport const builder = {\n\"yes\": {\n+ group: \"Command Options:\",\ndescribe: \"Skip all confirmation prompts\"\n}\n};\n", "new_path": "src/commands/CleanCommand.js", "old_path": "src/commands/CleanCommand.js" }, { "change_type": "MODIFY", "diff": "@@ -19,6 +19,7 @@ export const describe = dedent`\nexport const builder = {\n\"yes\": {\n+ group: \"Command Options:\",\ndescribe: \"Skip all confirmation prompts\"\n}\n};\n", "new_path": "src/commands/ImportCommand.js", "old_path": "src/commands/ImportCommand.js" }, { "change_type": "MODIFY", "diff": "@@ -24,10 +24,12 @@ export const describe = \"Publish packages in the current project.\";\nexport const builder = {\n\"canary\": {\n+ group: \"Command Options:\",\ndescribe: \"Publish packages after every successful merge using the sha as part of the tag.\",\nalias: \"c\"\n},\n\"cd-version\": {\n+ group: \"Command Options:\",\ndescribe: \"Skip the version selection prompt and increment semver 'major', 'minor', or 'patch'.\",\ntype: \"string\",\nrequiresArg: true,\n@@ -39,43 +41,53 @@ export const builder = {\n},\n},\n\"conventional-commits\": {\n+ group: \"Command Options:\",\ndescribe: \"Use angular conventional-commit format to determine version bump and generate CHANGELOG.\"\n},\n\"exact\": {\n+ group: \"Command Options:\",\ndescribe: \"Specify cross-dependency version numbers exactly rather than with a caret (^).\"\n},\n\"git-remote\": {\n+ group: \"Command Options:\",\ndefaultDescription: \"origin\",\ndescribe: \"Push git changes to the specified remote instead of 'origin'.\",\ntype: \"string\",\nrequiresArg: true\n},\n\"yes\": {\n+ group: \"Command Options:\",\ndescribe: \"Skip all confirmation prompts.\"\n},\n\"message\": {\n+ group: \"Command Options:\",\ndescribe: \"Use a custom commit message when creating the publish commit.\",\nalias: \"m\",\ntype: \"string\",\nrequiresArg: true\n},\n\"npm-tag\": {\n+ group: \"Command Options:\",\ndescribe: \"Publish packages with the specified npm dist-tag\",\ntype: \"string\",\nrequiresArg: true\n},\n\"repo-version\": {\n+ group: \"Command Options:\",\ndescribe: \"Specify repo version to publish.\",\ntype: \"string\",\nrequiresArg: true\n},\n\"skip-git\": {\n+ group: \"Command Options:\",\ndescribe: \"Skip commiting, tagging, and pushing git changes.\"\n},\n\"skip-npm\": {\n+ group: \"Command Options:\",\ndescribe: \"Stop before actually publishing change to npm.\"\n},\n\"skip-temp-tag\": {\n+ group: \"Command Options:\",\ndescribe: \"Do not create a temporary tag while publishing.\"\n}\n};\n", "new_path": "src/commands/PublishCommand.js", "old_path": "src/commands/PublishCommand.js" }, { "change_type": "MODIFY", "diff": "@@ -12,6 +12,7 @@ export const describe = \"Run an npm script in each package that contains that sc\nexport const builder = {\n\"stream\": {\n+ group: \"Command Options:\",\ndescribe: \"Stream output with lines prefixed by package.\"\n}\n};\n", "new_path": "src/commands/RunCommand.js", "old_path": "src/commands/RunCommand.js" } ]
JavaScript
MIT License
lerna/lerna
cli: add group 'Command Options' so they sort above 'Global Options'
1
cli
null
743,863
30.04.2017 23:28:16
25,200
4c824c95470738501a6867cbbeaef99a1832775f
docs: made a few tweaks to CHANGELOG
[ { "change_type": "MODIFY", "diff": "@@ -26,9 +26,10 @@ All notable changes to this project will be documented in this file. See [standa\n### BREAKING CHANGES\n-* environment variables will now override config files, '--' is now populated rather than '_' when parsing is stopped.\n+* environment variables now override config files in order of precedence.\n+* '--' is now populated rather than '_' when parsing is stopped.\n* extends functionality now always loads the JSON provided, rather than reading from a specific key\n-* this pull requests introduces language features that require Node 4+.\n+* Node 4+ is now required; this will allow us to start updating our dependencies.\n* the first argument to strict() is now used to enable/disable its functionality, rather than controlling whether or not it is global.\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" } ]
JavaScript
MIT License
yargs/yargs
docs: made a few tweaks to CHANGELOG
1
docs
null
743,863
01.05.2017 23:42:24
25,200
692ee205e24ee7cb19a848c3e88ee19d2ffd72ef
chore: update description for strict()
[ { "change_type": "MODIFY", "diff": "@@ -1847,8 +1847,7 @@ If any of the options is present, yargs validation is skipped.\nAny command-line argument given that is not demanded, or does not have a\ncorresponding description, will be reported as an error.\n-`global` indicates whether `strict()` should be enabled both\n-at the top-level and for each sub-command.\n+Unrecognized commands will also be reported as errors.\n<a name=\"string\"></a>.string(key)\n------------\n", "new_path": "README.md", "old_path": "README.md" } ]
JavaScript
MIT License
yargs/yargs
chore: update description for strict()
1
chore
null
743,863
26.06.2017 15:42:19
25,200
747d426eb64c82ae384ffe6250ecacbcf17539a6
docs: slight tweak to yargs sample code
[ { "change_type": "MODIFY", "diff": "@@ -53,7 +53,7 @@ Retreat from the xupptumblers!\n```js\n#!/usr/bin/env node\n-const yargs = require('yargs') // eslint-disable-line\n+require('yargs') // eslint-disable-line\n.command('serve', 'start the server', (yargs) => {\nyargs.option('port', {\ndescribe: 'port to bind on',\n", "new_path": "README.md", "old_path": "README.md" } ]
JavaScript
MIT License
yargs/yargs
docs: slight tweak to yargs sample code
1
docs
null
743,989
27.06.2017 03:51:52
-19,080
628be21f4300852fb3f905264b222673fbd160f3
fix: don't bother calling JSON.stringify() on string default values
[ { "change_type": "MODIFY", "diff": "@@ -413,7 +413,7 @@ module.exports = function (yargs, y18n) {\n} else {\nswitch (typeof value) {\ncase 'string':\n- string += JSON.stringify(value)\n+ string += '\"' + value + '\"'\nbreak\ncase 'object':\nstring += JSON.stringify(value)\n", "new_path": "lib/usage.js", "old_path": "lib/usage.js" } ]
JavaScript
MIT License
yargs/yargs
fix: don't bother calling JSON.stringify() on string default values (#891)
1
fix
null
807,849
28.06.2017 11:57:13
25,200
d24704def1444ec87c0d4145da467dcdf761958c
fix: shorten error message assert to match npm5 semantics
[ { "change_type": "MODIFY", "diff": "@@ -117,7 +117,7 @@ describe(\"lerna exec\", () => {\nconst { stdout, stderr } = await execa(LERNA_BIN, args, { cwd });\nexpect(stderr).toMatch(\n- \"Failed at the package-1@1.0.0 fail-or-succeed script 'echo \\\"failure!\\\" && exit 1'.\"\n+ \"Failed at the package-1@1.0.0 fail-or-succeed script\"\n);\nexpect(stdout).toMatch(\"failure!\");\nexpect(stdout).toMatch(\"success!\");\n@@ -135,7 +135,7 @@ describe(\"lerna exec\", () => {\nconst { stdout, stderr } = await execa(LERNA_BIN, args, { cwd });\nexpect(stderr).toMatch(\n- \"Failed at the package-1@1.0.0 fail-or-succeed script 'echo \\\"failure!\\\" && exit 1'.\"\n+ \"Failed at the package-1@1.0.0 fail-or-succeed script\"\n);\nexpect(stdout).toMatch(\"failure!\");\nexpect(stdout).toMatch(\"success!\");\n", "new_path": "test/integration/lerna-exec.test.js", "old_path": "test/integration/lerna-exec.test.js" } ]
JavaScript
MIT License
lerna/lerna
fix: shorten error message assert to match npm5 semantics
1
fix
null
808,054
28.06.2017 19:41:47
-7,200
4adfdd343dfc09937b94073ed016c2fe05a257d1
fix: Run yarn in non-interactive mode
[ { "change_type": "MODIFY", "diff": "@@ -82,6 +82,10 @@ export default class NpmUtilities {\nargs.push(\"--mutex\", config.mutex);\n}\n+ if (cmd === \"yarn\") {\n+ args.push(\"--non-interactive\");\n+ }\n+\nlog.silly(\"installInDir\", [cmd, args]);\nChildProcessUtilities.exec(cmd, args, opts, done);\n}).catch(done);\n", "new_path": "src/NpmUtilities.js", "old_path": "src/NpmUtilities.js" }, { "change_type": "MODIFY", "diff": "@@ -387,7 +387,7 @@ describe(\"NpmUtilities\", () => {\n);\nexpect(ChildProcessUtilities.exec).lastCalledWith(\n\"yarn\",\n- [\"install\", \"--mutex\", \"network:12345\"],\n+ [\"install\", \"--mutex\", \"network:12345\", \"--non-interactive\"],\n{\ndirectory,\nregistry: undefined,\n", "new_path": "test/NpmUtilities.js", "old_path": "test/NpmUtilities.js" } ]
JavaScript
MIT License
lerna/lerna
fix: Run yarn in non-interactive mode (#897)
1
fix
null
807,872
28.06.2017 21:21:38
-7,200
a6a3da8ba98d42ca971b4ead2f79402665c0335e
chore(travis): test against node 8 and npm 5
[ { "change_type": "MODIFY", "diff": "@@ -3,7 +3,7 @@ git:\nsudo: false\nlanguage: node_js\nnode_js:\n- - '7'\n+ - '8'\n- '6'\n- '4'\n", "new_path": ".travis.yml", "old_path": ".travis.yml" }, { "change_type": "MODIFY", "diff": "@@ -2,7 +2,7 @@ clone_depth: 1\nenvironment:\nmatrix:\n- - nodejs_version: \"7\"\n+ - nodejs_version: \"8\"\n- nodejs_version: \"6\"\n- nodejs_version: \"4\"\n", "new_path": "appveyor.yml", "old_path": "appveyor.yml" } ]
JavaScript
MIT License
lerna/lerna
chore(travis): test against node 8 and npm 5 (#861)
1
chore
travis
743,863
04.07.2017 12:04:45
25,200
a8e0cffbdd36eda0b6f93ca48f0ccfcf6e4af355
fix: defaulting keys to 'undefined' interfered with conflicting key logic
[ { "change_type": "MODIFY", "diff": "@@ -308,10 +308,10 @@ module.exports = function (yargs, usage, y18n) {\nself.conflicting = function (argv) {\nvar args = Object.getOwnPropertyNames(argv)\n-\nargs.forEach(function (arg) {\n- // if there is a conflict defined for this key and both conflicting keys have been specified\n- if (conflicting[arg] && args.indexOf(conflicting[arg]) !== -1 && argv[arg] && argv[conflicting[arg]]) {\n+ // we default keys to 'undefined' that have been configured, we should not\n+ // apply conflicting check unless they are a value other than 'undefined'.\n+ if (conflicting[arg] && args.indexOf(conflicting[arg]) !== -1 && argv[arg] !== undefined && argv[conflicting[arg]] !== undefined) {\nusage.fail(__('Arguments %s and %s are mutually exclusive', arg, conflicting[arg]))\n}\n})\n", "new_path": "lib/validation.js", "old_path": "lib/validation.js" }, { "change_type": "MODIFY", "diff": "@@ -158,8 +158,7 @@ describe('validation tests', function () {\n.argv\n})\n- it('should not fail if no conflicting arguments are provided and the .command()' +\n- 'syntax is used (first conflicting option specified)', function () {\n+ it('should not fail if argument with conflict is provided, but not the argument it conflicts with', function () {\nyargs(['command', '-f', '-c'])\n.command('command')\n.option('f', {\n@@ -175,8 +174,7 @@ describe('validation tests', function () {\n.argv\n})\n- it('should not fail if no conflicting arguments are provided and the .command()' +\n- 'syntax is used (second conflicting option specified)', function () {\n+ it('should not fail if conflicting argument is provided, without argument with conflict', function () {\nyargs(['command', '-b', '-c'])\n.command('command')\n.option('f', {\n@@ -230,6 +228,28 @@ describe('validation tests', function () {\n})\n.argv\n})\n+\n+ it('should fail if alias of conflicting argument is provided', function (done) {\n+ yargs(['-f', '--batman=99'])\n+ .conflicts('f', 'b')\n+ .alias('b', 'batman')\n+ .fail(function (msg) {\n+ msg.should.equal('Arguments f and b are mutually exclusive')\n+ return done()\n+ })\n+ .argv\n+ })\n+\n+ it('should fail if alias of argument with conflict is provided', function (done) {\n+ yargs(['--foo', '-b'])\n+ .conflicts('f', 'b')\n+ .alias('foo', 'f')\n+ .fail(function (msg) {\n+ msg.should.equal('Arguments f and b are mutually exclusive')\n+ return done()\n+ })\n+ .argv\n+ })\n})\ndescribe('demand', function () {\n", "new_path": "test/validation.js", "old_path": "test/validation.js" } ]
JavaScript
MIT License
yargs/yargs
fix: defaulting keys to 'undefined' interfered with conflicting key logic
1
fix
null
743,863
04.07.2017 13:43:27
25,200
782b89690ecc22f969f381f8eff7e69413f2cbc5
fix: 'undefined' default value for choices resulted in validation failing
[ { "change_type": "MODIFY", "diff": "@@ -457,6 +457,88 @@ describe('validation tests', function () {\n})\n.argv\n})\n+\n+ // addresses: https://github.com/yargs/yargs/issues/849\n+ it('succeeds when demandOption is true and valid choice is provided', function (done) {\n+ yargs('one -a 10 marsupial')\n+ .command('one', 'level one', function (yargs) {\n+ yargs\n+ .options({\n+ 'a': {\n+ demandOption: true,\n+ choices: [10, 20]\n+ }\n+ })\n+ }, function (argv) {\n+ argv._[0].should.equal('one')\n+ argv.a.should.equal(10)\n+ return done()\n+ })\n+ .fail(function (msg) {\n+ expect.fail()\n+ })\n+ .argv\n+ })\n+\n+ // addresses: https://github.com/yargs/yargs/issues/849\n+ it('fails when demandOption is true and choice is not provided', function (done) {\n+ yargs('one -a 10 marsupial')\n+ .command('one', 'level one', function (yargs) {\n+ yargs\n+ .options({\n+ 'c': {\n+ choices: ['1', '2']\n+ }\n+ })\n+ .demandOption('c')\n+ }, function (argv) {\n+ expect.fail()\n+ })\n+ .fail(function (msg) {\n+ msg.should.equal('Missing required argument: c')\n+ return done()\n+ })\n+ .argv\n+ })\n+\n+ // addresses: https://github.com/yargs/yargs/issues/849\n+ it('succeeds when demandOption is false and no choice is provided', function () {\n+ yargs('one')\n+ .command('one', 'level one', function (yargs) {\n+ yargs\n+ .options({\n+ 'a': {\n+ demandOption: false,\n+ choices: [10, 20]\n+ }\n+ })\n+ }, function (argv) {\n+ argv._[0].should.equal('one')\n+ })\n+ .fail(function (msg) {\n+ expect.fail()\n+ })\n+ .argv\n+ })\n+\n+ // addresses: https://github.com/yargs/yargs/issues/849\n+ it('succeeds when demandOption is not provided and no choice is provided', function () {\n+ yargs('one')\n+ .command('one', 'level one', function (yargs) {\n+ yargs\n+ .options({\n+ 'a': {\n+ choices: [10, 20]\n+ }\n+ })\n+ }, function (argv) {\n+ argv._[0].should.equal('one')\n+ })\n+ .fail(function (msg) {\n+ expect.fail()\n+ })\n+ .argv\n+ })\n})\ndescribe('config', function () {\n@@ -638,133 +720,6 @@ describe('validation tests', function () {\n})\n.argv\n})\n-\n- // addresses: https://github.com/yargs/yargs/issues/849\n- it('allows demandOption with value true in options shorthand for hidden option', function () {\n- yargs('one -a 10 marsupial')\n- .command('one', 'level one', function (yargs) {\n- yargs\n- .options({\n- 'a': {\n- demandOption: true,\n- choices: [10, 20]\n- }\n- })\n- }, function (argv) {\n- argv._[0].should.equal('one')\n- argv.a.should.equal(10)\n- })\n- .fail(function (msg) {\n- expect.fail()\n- })\n- .argv\n- })\n-\n- // addresses: https://github.com/yargs/yargs/issues/849\n- it('should fail demandOption with value true in options shorthand for hidden option', function (done) {\n- yargs('one -a 10 marsupial')\n- .command('one', 'level one', function (yargs) {\n- yargs\n- .options({\n- 'c': {\n- demandOption: true,\n- choices: ['1', '2']\n- }\n- })\n- }, function (argv) {\n- expect.fail()\n- })\n- .fail(function (msg) {\n- msg.should.equal('Missing required argument: c')\n- return done()\n- })\n- .argv\n- })\n-\n- // addresses: https://github.com/yargs/yargs/issues/849\n- it('allows demandOption with value false in options shorthand for hidden option', function () {\n- yargs('one')\n- .command('one', 'level one', function (yargs) {\n- yargs\n- .options({\n- 'a': {\n- demandOption: false,\n- choices: [10, 20]\n- }\n- })\n- }, function (argv) {\n- argv._[0].should.equal('one')\n- })\n- .fail(function (msg) {\n- expect.fail()\n- })\n- .argv\n- })\n-\n- // addresses: https://github.com/yargs/yargs/issues/849\n- it('allows demandOption with value true in options shorthand for non-hidden option', function () {\n- yargs('one -a 10 marsupial')\n- .command('one', 'level one', function (yargs) {\n- yargs\n- .options({\n- 'a': {\n- describe: 'A',\n- demandOption: true,\n- choices: [10, 20]\n- }\n- })\n- }, function (argv) {\n- argv._[0].should.equal('one')\n- argv.a.should.equal(10)\n- })\n- .fail(function (msg) {\n- expect.fail()\n- })\n- .argv\n- })\n-\n- // addresses: https://github.com/yargs/yargs/issues/849\n- it('should fail demandOption with value true in options shorthand for non-hidden option', function (done) {\n- yargs('one -a 10 marsupial')\n- .command('one', 'level one', function (yargs) {\n- yargs\n- .options({\n- 'c': {\n- describe: 'C',\n- demandOption: true,\n- choices: ['1', '2']\n- }\n- })\n- }, function (argv) {\n- expect.fail()\n- })\n- .fail(function (msg) {\n- msg.should.equal('Missing required argument: c')\n- return done()\n- })\n- .argv\n- })\n-\n- // addresses: https://github.com/yargs/yargs/issues/849\n- it('allows demandOption with value false in options shorthand for non-hidden option', function () {\n- yargs('one')\n- .command('one', 'level one', function (yargs) {\n- yargs\n- .options({\n- 'a': {\n- describe: 'A',\n- demandOption: false,\n- choices: [10, 20]\n- }\n- })\n- }, function (argv) {\n- argv._[0].should.equal('one')\n- })\n- .fail(function (msg) {\n- expect.fail()\n- })\n- .argv\n- })\n})\ndescribe('demandCommand', function () {\n", "new_path": "test/validation.js", "old_path": "test/validation.js" } ]
JavaScript
MIT License
yargs/yargs
fix: 'undefined' default value for choices resulted in validation failing
1
fix
null
448,039
07.08.2017 09:56:43
-7,200
8a39ed9900dddcc110f4804d2fdc19574a84ec68
chore: cut release for v1.0.0-pre.14
[ { "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=\"1.0.0-pre.14\"></a>\n+# [1.0.0-pre.14](https://github.com/dherges/ng-packagr/compare/v1.0.0-pre.13...v1.0.0-pre.14) (2017-08-07)\n+\n+\n+### Bug Fixes\n+\n+* add 'let' to known rxjs operators ([9927f93](https://github.com/dherges/ng-packagr/commit/9927f93)), closes [#85](https://github.com/dherges/ng-packagr/issues/85)\n+* move less from devDependencies to dependencies ([09ef8ce](https://github.com/dherges/ng-packagr/commit/09ef8ce)), closes [#88](https://github.com/dherges/ng-packagr/issues/88)\n+* strip utf-8 bom when reading files ([cb34889](https://github.com/dherges/ng-packagr/commit/cb34889)), closes [#87](https://github.com/dherges/ng-packagr/issues/87)\n+\n+\n+\n<a name=\"1.0.0-pre.13\"></a>\n# [1.0.0-pre.13](https://github.com/dherges/ng-packagr/compare/v1.0.0-pre.12...v1.0.0-pre.13) (2017-07-28)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"ng-packagr\",\n- \"version\": \"1.0.0-pre.13\",\n+ \"version\": \"1.0.0-pre.14\",\n\"description\": \"Compile and package a TypeScript library to Angular Package Format\",\n\"keywords\": [\n\"angular\",\n", "new_path": "package.json", "old_path": "package.json" } ]
TypeScript
MIT License
ng-packagr/ng-packagr
chore: cut release for v1.0.0-pre.14
1
chore
null
448,039
08.08.2017 08:05:57
-7,200
b366a508e7cbf9a0890d0cd4de6204e84a4744de
test: reproduce issue
[ { "change_type": "MODIFY", "diff": "{\n- \"$schema\": \"../../../src/lib/ng-package.schema.json\",\n- \"lib\": {\n- \"entryFile\": \"public_api.ts\"\n- }\n+ \"$schema\": \"../../../src/lib/ng-package.schema.json\"\n}\n", "new_path": "integration/samples/typings/ng-package.json", "old_path": "integration/samples/typings/ng-package.json" }, { "change_type": "DELETE", "diff": "-export * from './src/validator';\n", "new_path": null, "old_path": "integration/samples/typings/public_api.ts" }, { "change_type": "ADD", "diff": "+export * from './validator';\n", "new_path": "integration/samples/typings/src/public_api.ts", "old_path": null } ]
TypeScript
MIT License
ng-packagr/ng-packagr
test: reproduce issue #97
1
test
null
807,849
09.08.2017 18:26:43
25,200
90f84f0e795b75b656a11e04d5792a64b15a38d4
chore: bump dependencies (non-major)
[ { "change_type": "MODIFY", "diff": "\"cmd-shim\": \"^2.0.2\",\n\"columnify\": \"^1.5.4\",\n\"command-join\": \"^2.0.0\",\n- \"conventional-changelog-cli\": \"^1.3.1\",\n- \"conventional-recommended-bump\": \"^1.0.0\",\n+ \"conventional-changelog-cli\": \"^1.3.2\",\n+ \"conventional-recommended-bump\": \"^1.0.1\",\n\"dedent\": \"^0.7.0\",\n\"execa\": \"^0.6.3\",\n\"find-up\": \"^2.1.0\",\n\"glob\": \"^7.1.2\",\n\"globby\": \"^6.1.0\",\n\"graceful-fs\": \"^4.1.11\",\n- \"inquirer\": \"^3.0.6\",\n+ \"inquirer\": \"^3.2.1\",\n\"is-ci\": \"^1.0.10\",\n\"load-json-file\": \"^2.0.0\",\n\"lodash\": \"^4.17.4\",\n\"minimatch\": \"^3.0.4\",\n- \"npmlog\": \"^4.1.0\",\n+ \"npmlog\": \"^4.1.2\",\n\"p-finally\": \"^1.0.0\",\n\"path-exists\": \"^3.0.0\",\n\"read-cmd-shim\": \"^1.0.1\",\n\"read-pkg\": \"^2.0.0\",\n\"rimraf\": \"^2.6.1\",\n- \"safe-buffer\": \"^5.0.1\",\n- \"semver\": \"^5.1.0\",\n+ \"safe-buffer\": \"^5.1.1\",\n+ \"semver\": \"^5.4.1\",\n\"signal-exit\": \"^3.0.2\",\n\"strong-log-transformer\": \"^1.0.6\",\n\"temp-write\": \"^3.3.0\",\n\"write-file-atomic\": \"^2.1.0\",\n- \"write-json-file\": \"^2.1.0\",\n- \"write-pkg\": \"^3.0.1\",\n- \"yargs\": \"^8.0.1\"\n+ \"write-json-file\": \"^2.2.0\",\n+ \"write-pkg\": \"^3.1.0\",\n+ \"yargs\": \"^8.0.2\"\n},\n\"bin\": {\n\"lerna\": \"./bin/lerna.js\"\n\"babel-eslint\": \"^7.2.3\",\n\"babel-jest\": \"^19.0.0\",\n\"babel-plugin-add-module-exports\": \"^0.2.1\",\n- \"babel-preset-env\": \"^1.4.0\",\n+ \"babel-preset-env\": \"^1.6.0\",\n\"eslint\": \"^3.19.0\",\n\"eslint-config-babel\": \"^6.0.0\",\n- \"eslint-plugin-babel\": \"^4.1.1\",\n- \"eslint-plugin-flowtype\": \"^2.33.0\",\n- \"eslint-plugin-node\": \"^4.2.2\",\n+ \"eslint-plugin-babel\": \"^4.1.2\",\n+ \"eslint-plugin-flowtype\": \"^2.35.0\",\n+ \"eslint-plugin-node\": \"^5.1.1\",\n\"file-url\": \"^2.0.2\",\n\"jest\": \"^19.0.2\",\n\"normalize-newline\": \"^3.0.0\",\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "@@ -72,10 +72,18 @@ ansi-escapes@^1.1.0, ansi-escapes@^1.4.0:\nversion \"1.4.0\"\nresolved \"https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e\"\n+ansi-escapes@^2.0.0:\n+ version \"2.0.0\"\n+ resolved \"https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-2.0.0.tgz#5bae52be424878dd9783e8910e3fc2922e83c81b\"\n+\nansi-regex@^2.0.0:\nversion \"2.1.1\"\nresolved \"https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df\"\n+ansi-regex@^3.0.0:\n+ version \"3.0.0\"\n+ resolved \"https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998\"\n+\nansi-styles@^2.2.1:\nversion \"2.2.1\"\nresolved \"https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe\"\n@@ -86,6 +94,12 @@ ansi-styles@^3.0.0:\ndependencies:\ncolor-convert \"^1.0.0\"\n+ansi-styles@^3.1.0:\n+ version \"3.2.0\"\n+ resolved \"https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88\"\n+ dependencies:\n+ color-convert \"^1.9.0\"\n+\nanymatch@^1.3.0:\nversion \"1.3.0\"\nresolved \"https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.0.tgz#a3e52fa39168c825ff57b0248126ce5a8ff95507\"\n@@ -627,9 +641,9 @@ babel-polyfill@^6.23.0:\ncore-js \"^2.4.0\"\nregenerator-runtime \"^0.10.0\"\n-babel-preset-env@^1.4.0:\n- version \"1.4.0\"\n- resolved \"https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.4.0.tgz#c8e02a3bcc7792f23cded68e0355b9d4c28f0f7a\"\n+babel-preset-env@^1.6.0:\n+ version \"1.6.0\"\n+ resolved \"https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.6.0.tgz#2de1c782a780a0a5d605d199c957596da43c44e4\"\ndependencies:\nbabel-plugin-check-es2015-constants \"^6.22.0\"\nbabel-plugin-syntax-trailing-function-commas \"^6.22.0\"\n@@ -658,8 +672,9 @@ babel-preset-env@^1.4.0:\nbabel-plugin-transform-es2015-unicode-regex \"^6.22.0\"\nbabel-plugin-transform-exponentiation-operator \"^6.22.0\"\nbabel-plugin-transform-regenerator \"^6.22.0\"\n- browserslist \"^1.4.0\"\n+ browserslist \"^2.1.2\"\ninvariant \"^2.2.2\"\n+ semver \"^5.3.0\"\nbabel-preset-jest@^19.0.0:\nversion \"19.0.0\"\n@@ -770,12 +785,12 @@ browser-resolve@^1.11.2:\ndependencies:\nresolve \"1.1.7\"\n-browserslist@^1.4.0:\n- version \"1.7.7\"\n- resolved \"https://registry.yarnpkg.com/browserslist/-/browserslist-1.7.7.tgz#0bd76704258be829b2398bb50e4b62d1a166b0b9\"\n+browserslist@^2.1.2:\n+ version \"2.3.1\"\n+ resolved \"https://registry.yarnpkg.com/browserslist/-/browserslist-2.3.1.tgz#39500a2090330b2a090120ea6c7fc78b6e091c5e\"\ndependencies:\n- caniuse-db \"^1.0.30000639\"\n- electron-to-chromium \"^1.2.7\"\n+ caniuse-lite \"^1.0.30000712\"\n+ electron-to-chromium \"^1.3.17\"\nbser@1.0.2:\nversion \"1.0.2\"\n@@ -838,9 +853,9 @@ camelcase@^4.1.0:\nversion \"4.1.0\"\nresolved \"https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd\"\n-caniuse-db@^1.0.30000639:\n- version \"1.0.30000649\"\n- resolved \"https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000649.tgz#1ee1754a6df235450c8b7cd15e0ebf507221a86a\"\n+caniuse-lite@^1.0.30000712:\n+ version \"1.0.30000713\"\n+ resolved \"https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000713.tgz#33957ecb4a2154a5d40a60d13d8bf1cfa0881a8a\"\ncaseless@~0.11.0:\nversion \"0.11.0\"\n@@ -863,6 +878,14 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3:\nstrip-ansi \"^3.0.0\"\nsupports-color \"^2.0.0\"\n+chalk@^2.0.0:\n+ version \"2.1.0\"\n+ resolved \"https://registry.yarnpkg.com/chalk/-/chalk-2.1.0.tgz#ac5becf14fa21b99c6c92ca7a7d7cfd5b17e743e\"\n+ dependencies:\n+ ansi-styles \"^3.1.0\"\n+ escape-string-regexp \"^1.0.5\"\n+ supports-color \"^4.0.0\"\n+\nchokidar@^1.6.1:\nversion \"1.6.1\"\nresolved \"https://registry.yarnpkg.com/chokidar/-/chokidar-1.6.1.tgz#2f4447ab5e96e50fb3d789fd90d4c72e0e4c70c2\"\n@@ -937,7 +960,7 @@ code-point-at@^1.0.0:\nversion \"1.1.0\"\nresolved \"https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77\"\n-color-convert@^1.0.0:\n+color-convert@^1.0.0, color-convert@^1.9.0:\nversion \"1.9.0\"\nresolved \"https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a\"\ndependencies:\n@@ -997,13 +1020,14 @@ content-type-parser@^1.0.1:\nversion \"1.0.1\"\nresolved \"https://registry.yarnpkg.com/content-type-parser/-/content-type-parser-1.0.1.tgz#c3e56988c53c65127fb46d4032a3a900246fdc94\"\n-conventional-changelog-angular@^1.3.3:\n- version \"1.3.3\"\n- resolved \"https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-1.3.3.tgz#e7ce807a85dd4750e1b417f766045497511e0726\"\n+conventional-changelog-angular@^1.3.4:\n+ version \"1.4.0\"\n+ resolved \"https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-1.4.0.tgz#118b9f7d41a3d99500bfb6bea1f3525e055e8b9b\"\ndependencies:\ncompare-func \"^1.3.1\"\ngithub-url-from-git \"^1.4.0\"\nq \"^1.4.1\"\n+ read-pkg-up \"^2.0.0\"\nconventional-changelog-atom@^0.1.0:\nversion \"0.1.0\"\n@@ -1011,12 +1035,12 @@ conventional-changelog-atom@^0.1.0:\ndependencies:\nq \"^1.4.1\"\n-conventional-changelog-cli@^1.3.1:\n- version \"1.3.1\"\n- resolved \"https://registry.yarnpkg.com/conventional-changelog-cli/-/conventional-changelog-cli-1.3.1.tgz#1cd5a9dbae25ffb5ffe67afef1e136eaceefd2d5\"\n+conventional-changelog-cli@^1.3.2:\n+ version \"1.3.2\"\n+ resolved \"https://registry.yarnpkg.com/conventional-changelog-cli/-/conventional-changelog-cli-1.3.2.tgz#33abf2b5720a9b094df38e81741ccb502e1a4125\"\ndependencies:\nadd-stream \"^1.0.0\"\n- conventional-changelog \"^1.1.3\"\n+ conventional-changelog \"^1.1.4\"\nlodash \"^4.1.0\"\nmeow \"^3.7.0\"\ntempfile \"^1.1.1\"\n@@ -1027,9 +1051,9 @@ conventional-changelog-codemirror@^0.1.0:\ndependencies:\nq \"^1.4.1\"\n-conventional-changelog-core@^1.8.0:\n- version \"1.8.0\"\n- resolved \"https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-1.8.0.tgz#977848b416caf15fb09f20b12a62d40ef145b957\"\n+conventional-changelog-core@^1.9.0:\n+ version \"1.9.0\"\n+ resolved \"https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-1.9.0.tgz#de5dfbc091847656508d4a389e35c9a1bc49e7f4\"\ndependencies:\nconventional-changelog-writer \"^1.1.0\"\nconventional-commits-parser \"^1.0.0\"\n@@ -1045,9 +1069,9 @@ conventional-changelog-core@^1.8.0:\nread-pkg-up \"^1.0.1\"\nthrough2 \"^2.0.0\"\n-conventional-changelog-ember@^0.2.5:\n- version \"0.2.5\"\n- resolved \"https://registry.yarnpkg.com/conventional-changelog-ember/-/conventional-changelog-ember-0.2.5.tgz#ce21d5cf83cd5ebe05d23fdf232d8844f4b56a4f\"\n+conventional-changelog-ember@^0.2.6:\n+ version \"0.2.6\"\n+ resolved \"https://registry.yarnpkg.com/conventional-changelog-ember/-/conventional-changelog-ember-0.2.6.tgz#8b7355419f5127493c4c562473ab2fc792f1c2b6\"\ndependencies:\nq \"^1.4.1\"\n@@ -1097,15 +1121,15 @@ conventional-changelog-writer@^1.1.0:\nsplit \"^1.0.0\"\nthrough2 \"^2.0.0\"\n-conventional-changelog@^1.1.3:\n- version \"1.1.3\"\n- resolved \"https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-1.1.3.tgz#26283078ac38c094df2af1604b0a46bbc0165c4d\"\n+conventional-changelog@^1.1.4:\n+ version \"1.1.4\"\n+ resolved \"https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-1.1.4.tgz#108bc750c2a317e200e2f9b413caaa1f8c7efa3b\"\ndependencies:\n- conventional-changelog-angular \"^1.3.3\"\n+ conventional-changelog-angular \"^1.3.4\"\nconventional-changelog-atom \"^0.1.0\"\nconventional-changelog-codemirror \"^0.1.0\"\n- conventional-changelog-core \"^1.8.0\"\n- conventional-changelog-ember \"^0.2.5\"\n+ conventional-changelog-core \"^1.9.0\"\n+ conventional-changelog-ember \"^0.2.6\"\nconventional-changelog-eslint \"^0.1.0\"\nconventional-changelog-express \"^0.1.0\"\nconventional-changelog-jquery \"^0.1.0\"\n@@ -1119,7 +1143,7 @@ conventional-commits-filter@^1.0.0:\nis-subset \"^0.1.1\"\nmodify-values \"^1.0.0\"\n-conventional-commits-parser@^1.0.0, conventional-commits-parser@^1.0.1:\n+conventional-commits-parser@^1.0.0:\nversion \"1.3.0\"\nresolved \"https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-1.3.0.tgz#e327b53194e1a7ad5dc63479ee9099a52b024865\"\ndependencies:\n@@ -1131,15 +1155,27 @@ conventional-commits-parser@^1.0.0, conventional-commits-parser@^1.0.1:\nthrough2 \"^2.0.0\"\ntrim-off-newlines \"^1.0.0\"\n-conventional-recommended-bump@^1.0.0:\n- version \"1.0.0\"\n- resolved \"https://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-1.0.0.tgz#6d303a27837ae938b7c68c8ddeed34559b4b0789\"\n+conventional-commits-parser@^2.0.0:\n+ version \"2.0.0\"\n+ resolved \"https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-2.0.0.tgz#71d01910cb0a99aeb20c144e50f81f4df3178447\"\n+ dependencies:\n+ JSONStream \"^1.0.4\"\n+ is-text-path \"^1.0.0\"\n+ lodash \"^4.2.1\"\n+ meow \"^3.3.0\"\n+ split2 \"^2.0.0\"\n+ through2 \"^2.0.0\"\n+ trim-off-newlines \"^1.0.0\"\n+\n+conventional-recommended-bump@^1.0.1:\n+ version \"1.0.1\"\n+ resolved \"https://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-1.0.1.tgz#56b8ae553a8a1152fa069e767599e1f6948bd36c\"\ndependencies:\nconcat-stream \"^1.4.10\"\nconventional-commits-filter \"^1.0.0\"\n- conventional-commits-parser \"^1.0.1\"\n+ conventional-commits-parser \"^2.0.0\"\ngit-raw-commits \"^1.2.0\"\n- git-semver-tags \"^1.2.0\"\n+ git-semver-tags \"^1.2.1\"\nmeow \"^3.3.0\"\nobject-assign \"^4.0.1\"\n@@ -1287,6 +1323,10 @@ detect-indent@^4.0.0:\ndependencies:\nrepeating \"^2.0.0\"\n+detect-indent@^5.0.0:\n+ version \"5.0.0\"\n+ resolved \"https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d\"\n+\ndiff@^3.0.0:\nversion \"3.2.0\"\nresolved \"https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9\"\n@@ -1314,9 +1354,9 @@ ecc-jsbn@~0.1.1:\ndependencies:\njsbn \"~0.1.0\"\n-electron-to-chromium@^1.2.7:\n- version \"1.3.2\"\n- resolved \"https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.2.tgz#b8ce5c93b308db0e92f6d0435c46ddec8f6363ab\"\n+electron-to-chromium@^1.3.17:\n+ version \"1.3.17\"\n+ resolved \"https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.17.tgz#41c13457cc7166c5c15e767ae61d86a8cacdee5d\"\n\"errno@>=0.1.1 <0.2.0-0\":\nversion \"0.1.4\"\n@@ -1410,24 +1450,23 @@ eslint-config-babel@^6.0.0:\nversion \"6.0.0\"\nresolved \"https://registry.yarnpkg.com/eslint-config-babel/-/eslint-config-babel-6.0.0.tgz#66feedf6ce6e04abe585cec1a65b5bcc96bed50a\"\n-eslint-plugin-babel@^4.1.1:\n- version \"4.1.1\"\n- resolved \"https://registry.yarnpkg.com/eslint-plugin-babel/-/eslint-plugin-babel-4.1.1.tgz#ef285c87039b67beb3bbd227f5b0eed4fb376b87\"\n+eslint-plugin-babel@^4.1.2:\n+ version \"4.1.2\"\n+ resolved \"https://registry.yarnpkg.com/eslint-plugin-babel/-/eslint-plugin-babel-4.1.2.tgz#79202a0e35757dd92780919b2336f1fa2fe53c1e\"\n-eslint-plugin-flowtype@^2.33.0:\n- version \"2.33.0\"\n- resolved \"https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.33.0.tgz#b2783814ed2ddcf729953b8f65ff73c90cabee4b\"\n+eslint-plugin-flowtype@^2.35.0:\n+ version \"2.35.0\"\n+ resolved \"https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.35.0.tgz#d17494f0ae8b727c632d8b9d4b4a848e7e0c04af\"\ndependencies:\nlodash \"^4.15.0\"\n-eslint-plugin-node@^4.2.2:\n- version \"4.2.2\"\n- resolved \"https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-4.2.2.tgz#82959ca9aed79fcbd28bb1b188d05cac04fb3363\"\n+eslint-plugin-node@^5.1.1:\n+ version \"5.1.1\"\n+ resolved \"https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-5.1.1.tgz#a7ed956e780c22aef6afd1116005acd82f26eac6\"\ndependencies:\n- ignore \"^3.0.11\"\n- minimatch \"^3.0.2\"\n- object-assign \"^4.0.1\"\n- resolve \"^1.1.7\"\n+ ignore \"^3.3.3\"\n+ minimatch \"^3.0.4\"\n+ resolve \"^1.3.3\"\nsemver \"5.3.0\"\neslint@^3.19.0:\n@@ -1571,10 +1610,12 @@ extend@~3.0.0:\nversion \"3.0.0\"\nresolved \"https://registry.yarnpkg.com/extend/-/extend-3.0.0.tgz#5a474353b9f3353ddd8176dfd37b91c83a46f1d4\"\n-external-editor@^2.0.1:\n- version \"2.0.1\"\n- resolved \"https://registry.yarnpkg.com/external-editor/-/external-editor-2.0.1.tgz#4c597c6c88fa6410e41dbbaa7b1be2336aa31095\"\n+external-editor@^2.0.4:\n+ version \"2.0.4\"\n+ resolved \"https://registry.yarnpkg.com/external-editor/-/external-editor-2.0.4.tgz#1ed9199da9cbfe2ef2f7a31b2fde8b0d12368972\"\ndependencies:\n+ iconv-lite \"^0.4.17\"\n+ jschardet \"^1.4.2\"\ntmp \"^0.0.31\"\nextglob@^0.3.1:\n@@ -1818,6 +1859,13 @@ git-semver-tags@^1.2.0:\nmeow \"^3.3.0\"\nsemver \"^5.0.1\"\n+git-semver-tags@^1.2.1:\n+ version \"1.2.1\"\n+ resolved \"https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-1.2.1.tgz#6ccd2a52e735b736748dc762444fcd9588e27490\"\n+ dependencies:\n+ meow \"^3.3.0\"\n+ semver \"^5.0.1\"\n+\ngitconfiglocal@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz#41d045f3851a5ea88f03f24ca1c6178114464b9b\"\n@@ -1918,6 +1966,10 @@ has-flag@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa\"\n+has-flag@^2.0.0:\n+ version \"2.0.0\"\n+ resolved \"https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51\"\n+\nhas-unicode@^2.0.0:\nversion \"2.0.1\"\nresolved \"https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9\"\n@@ -1964,10 +2016,18 @@ iconv-lite@0.4.13:\nversion \"0.4.13\"\nresolved \"https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2\"\n-ignore@^3.0.11, ignore@^3.2.0:\n+iconv-lite@^0.4.17:\n+ version \"0.4.18\"\n+ resolved \"https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.18.tgz#23d8656b16aae6742ac29732ea8f0336a4789cf2\"\n+\n+ignore@^3.2.0:\nversion \"3.2.6\"\nresolved \"https://registry.yarnpkg.com/ignore/-/ignore-3.2.6.tgz#26e8da0644be0bb4cb39516f6c79f0e0f4ffe48c\"\n+ignore@^3.3.3:\n+ version \"3.3.3\"\n+ resolved \"https://registry.yarnpkg.com/ignore/-/ignore-3.3.3.tgz#432352e57accd87ab3110e82d3fea0e47812156d\"\n+\nimurmurhash@^0.1.4:\nversion \"0.1.4\"\nresolved \"https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea\"\n@@ -2011,22 +2071,23 @@ inquirer@^0.12.0:\nstrip-ansi \"^3.0.0\"\nthrough \"^2.3.6\"\n-inquirer@^3.0.6:\n- version \"3.0.6\"\n- resolved \"https://registry.yarnpkg.com/inquirer/-/inquirer-3.0.6.tgz#e04aaa9d05b7a3cb9b0f407d04375f0447190347\"\n+inquirer@^3.2.1:\n+ version \"3.2.1\"\n+ resolved \"https://registry.yarnpkg.com/inquirer/-/inquirer-3.2.1.tgz#06ceb0f540f45ca548c17d6840959878265fa175\"\ndependencies:\n- ansi-escapes \"^1.1.0\"\n- chalk \"^1.0.0\"\n+ ansi-escapes \"^2.0.0\"\n+ chalk \"^2.0.0\"\ncli-cursor \"^2.1.0\"\ncli-width \"^2.0.0\"\n- external-editor \"^2.0.1\"\n+ external-editor \"^2.0.4\"\nfigures \"^2.0.0\"\nlodash \"^4.3.0\"\nmute-stream \"0.0.7\"\nrun-async \"^2.2.0\"\n- rx \"^4.1.0\"\n- string-width \"^2.0.0\"\n- strip-ansi \"^3.0.0\"\n+ rx-lite \"^4.0.8\"\n+ rx-lite-aggregates \"^4.0.8\"\n+ string-width \"^2.1.0\"\n+ strip-ansi \"^4.0.0\"\nthrough \"^2.3.6\"\ninterpret@^1.0.0:\n@@ -2497,6 +2558,10 @@ jsbn@~0.1.0:\nversion \"0.1.0\"\nresolved \"https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.0.tgz#650987da0dd74f4ebf5a11377a2aa2d273e97dfd\"\n+jschardet@^1.4.2:\n+ version \"1.5.1\"\n+ resolved \"https://registry.yarnpkg.com/jschardet/-/jschardet-1.5.1.tgz#c519f629f86b3a5bedba58a88d311309eec097f9\"\n+\njsdom@^9.11.0:\nversion \"9.11.0\"\nresolved \"https://registry.yarnpkg.com/jsdom/-/jsdom-9.11.0.tgz#a95b0304e521a2ca5a63c6ea47bf7708a7a84591\"\n@@ -2864,7 +2929,7 @@ npm-run-path@^2.0.0:\ndependencies:\npath-key \"^2.0.0\"\n-npmlog@^4.0.1, npmlog@^4.1.0:\n+npmlog@^4.0.1:\nversion \"4.1.0\"\nresolved \"https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.0.tgz#dc59bee85f64f00ed424efb2af0783df25d1c0b5\"\ndependencies:\n@@ -2873,6 +2938,15 @@ npmlog@^4.0.1, npmlog@^4.1.0:\ngauge \"~2.7.3\"\nset-blocking \"~2.0.0\"\n+npmlog@^4.1.2:\n+ version \"4.1.2\"\n+ resolved \"https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b\"\n+ dependencies:\n+ are-we-there-yet \"~1.1.2\"\n+ console-control-strings \"~1.1.0\"\n+ gauge \"~2.7.3\"\n+ set-blocking \"~2.0.0\"\n+\nnumber-is-nan@^1.0.0:\nversion \"1.0.1\"\nresolved \"https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d\"\n@@ -3328,12 +3402,18 @@ resolve@1.1.7:\nversion \"1.1.7\"\nresolved \"https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b\"\n-resolve@^1.1.6, resolve@^1.1.7, resolve@^1.2.0:\n+resolve@^1.1.6, resolve@^1.2.0:\nversion \"1.3.2\"\nresolved \"https://registry.yarnpkg.com/resolve/-/resolve-1.3.2.tgz#1f0442c9e0cbb8136e87b9305f932f46c7f28235\"\ndependencies:\npath-parse \"^1.0.5\"\n+resolve@^1.3.3:\n+ version \"1.4.0\"\n+ resolved \"https://registry.yarnpkg.com/resolve/-/resolve-1.4.0.tgz#a75be01c53da25d934a98ebd0e4c4a7312f92a86\"\n+ dependencies:\n+ path-parse \"^1.0.5\"\n+\nrestore-cursor@^1.0.1:\nversion \"1.0.1\"\nresolved \"https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541\"\n@@ -3378,17 +3458,23 @@ run-async@^2.2.0:\ndependencies:\nis-promise \"^2.1.0\"\n+rx-lite-aggregates@^4.0.8:\n+ version \"4.0.8\"\n+ resolved \"https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be\"\n+ dependencies:\n+ rx-lite \"*\"\n+\n+rx-lite@*, rx-lite@^4.0.8:\n+ version \"4.0.8\"\n+ resolved \"https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444\"\n+\nrx-lite@^3.1.2:\nversion \"3.1.2\"\nresolved \"https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102\"\n-rx@^4.1.0:\n- version \"4.1.0\"\n- resolved \"https://registry.yarnpkg.com/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782\"\n-\n-safe-buffer@^5.0.1:\n- version \"5.0.1\"\n- resolved \"https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7\"\n+safe-buffer@^5.1.1:\n+ version \"5.1.1\"\n+ resolved \"https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853\"\nsane@~1.5.0:\nversion \"1.5.0\"\n@@ -3406,10 +3492,14 @@ sax@^1.2.1:\nversion \"1.2.2\"\nresolved \"https://registry.yarnpkg.com/sax/-/sax-1.2.2.tgz#fd8631a23bc7826bef5d871bdb87378c95647828\"\n-\"semver@2 || 3 || 4 || 5\", semver@5.3.0, semver@^5.0.1, semver@^5.1.0, semver@^5.3.0, semver@~5.3.0:\n+\"semver@2 || 3 || 4 || 5\", semver@5.3.0, semver@^5.0.1, semver@^5.3.0, semver@~5.3.0:\nversion \"5.3.0\"\nresolved \"https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f\"\n+semver@^5.4.1:\n+ version \"5.4.1\"\n+ resolved \"https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e\"\n+\nset-blocking@^2.0.0, set-blocking@~2.0.0:\nversion \"2.0.0\"\nresolved \"https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7\"\n@@ -3462,12 +3552,18 @@ sntp@1.x.x:\ndependencies:\nhoek \"2.x.x\"\n-sort-keys@^1.1.1, sort-keys@^1.1.2:\n+sort-keys@^1.1.1:\nversion \"1.1.2\"\nresolved \"https://registry.yarnpkg.com/sort-keys/-/sort-keys-1.1.2.tgz#441b6d4d346798f1b4e49e8920adfba0e543f9ad\"\ndependencies:\nis-plain-obj \"^1.0.0\"\n+sort-keys@^2.0.0:\n+ version \"2.0.0\"\n+ resolved \"https://registry.yarnpkg.com/sort-keys/-/sort-keys-2.0.0.tgz#658535584861ec97d730d6cf41822e1f56684128\"\n+ dependencies:\n+ is-plain-obj \"^1.0.0\"\n+\nsource-map-support@^0.4.2:\nversion \"0.4.11\"\nresolved \"https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.11.tgz#647f939978b38535909530885303daf23279f322\"\n@@ -3556,6 +3652,13 @@ string-width@^2.0.0:\nis-fullwidth-code-point \"^2.0.0\"\nstrip-ansi \"^3.0.0\"\n+string-width@^2.1.0:\n+ version \"2.1.1\"\n+ resolved \"https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e\"\n+ dependencies:\n+ is-fullwidth-code-point \"^2.0.0\"\n+ strip-ansi \"^4.0.0\"\n+\nstring_decoder@~0.10.x:\nversion \"0.10.31\"\nresolved \"https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94\"\n@@ -3570,6 +3673,12 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1:\ndependencies:\nansi-regex \"^2.0.0\"\n+strip-ansi@^4.0.0:\n+ version \"4.0.0\"\n+ resolved \"https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f\"\n+ dependencies:\n+ ansi-regex \"^3.0.0\"\n+\nstrip-bom@3.0.0, strip-bom@^3.0.0:\nversion \"3.0.0\"\nresolved \"https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3\"\n@@ -3618,6 +3727,12 @@ supports-color@^3.1.2:\ndependencies:\nhas-flag \"^1.0.0\"\n+supports-color@^4.0.0:\n+ version \"4.2.1\"\n+ resolved \"https://registry.yarnpkg.com/supports-color/-/supports-color-4.2.1.tgz#65a4bb2631e90e02420dba5554c375a4754bb836\"\n+ dependencies:\n+ has-flag \"^2.0.0\"\n+\nsymbol-tree@^3.2.1:\nversion \"3.2.2\"\nresolved \"https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6\"\n@@ -3948,22 +4063,23 @@ write-file-atomic@^2.0.0, write-file-atomic@^2.1.0:\nimurmurhash \"^0.1.4\"\nslide \"^1.1.5\"\n-write-json-file@^2.0.0, write-json-file@^2.1.0:\n- version \"2.1.0\"\n- resolved \"https://registry.yarnpkg.com/write-json-file/-/write-json-file-2.1.0.tgz#ba1cf3ac7ee89db26c3d528986e48421389046b7\"\n+write-json-file@^2.2.0:\n+ version \"2.2.0\"\n+ resolved \"https://registry.yarnpkg.com/write-json-file/-/write-json-file-2.2.0.tgz#51862506bbb3b619eefab7859f1fd6c6d0530876\"\ndependencies:\n+ detect-indent \"^5.0.0\"\ngraceful-fs \"^4.1.2\"\nmake-dir \"^1.0.0\"\npify \"^2.0.0\"\nsort-keys \"^1.1.1\"\nwrite-file-atomic \"^2.0.0\"\n-write-pkg@^3.0.1:\n- version \"3.0.1\"\n- resolved \"https://registry.yarnpkg.com/write-pkg/-/write-pkg-3.0.1.tgz#f95245805be6f6a4eb1d6c31c43b57226815e6e3\"\n+write-pkg@^3.1.0:\n+ version \"3.1.0\"\n+ resolved \"https://registry.yarnpkg.com/write-pkg/-/write-pkg-3.1.0.tgz#030a9994cc9993d25b4e75a9f1a1923607291ce9\"\ndependencies:\n- sort-keys \"^1.1.2\"\n- write-json-file \"^2.0.0\"\n+ sort-keys \"^2.0.0\"\n+ write-json-file \"^2.2.0\"\nwrite@^0.2.1:\nversion \"0.2.1\"\n@@ -4017,9 +4133,9 @@ yargs@^6.3.0:\ny18n \"^3.2.1\"\nyargs-parser \"^4.2.0\"\n-yargs@^8.0.1:\n- version \"8.0.1\"\n- resolved \"https://registry.yarnpkg.com/yargs/-/yargs-8.0.1.tgz#420ef75e840c1457a80adcca9bc6fa3849de51aa\"\n+yargs@^8.0.2:\n+ version \"8.0.2\"\n+ resolved \"https://registry.yarnpkg.com/yargs/-/yargs-8.0.2.tgz#6299a9055b1cefc969ff7e79c1d918dceb22c360\"\ndependencies:\ncamelcase \"^4.1.0\"\ncliui \"^3.2.0\"\n", "new_path": "yarn.lock", "old_path": "yarn.lock" } ]
JavaScript
MIT License
lerna/lerna
chore: bump dependencies (non-major)
1
chore
null
807,849
10.08.2017 09:39:46
25,200
f36ba1d731553c9da38b26c69d3a353b51e5c621
chore: chalk 2.x
[ { "change_type": "MODIFY", "diff": "\"homepage\": \"https://lernajs.io/\",\n\"dependencies\": {\n\"async\": \"^1.5.0\",\n- \"chalk\": \"^1.1.1\",\n+ \"chalk\": \"^2.1.0\",\n\"cmd-shim\": \"^2.0.2\",\n\"columnify\": \"^1.5.4\",\n\"command-join\": \"^2.0.0\",\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "@@ -878,7 +878,7 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3:\nstrip-ansi \"^3.0.0\"\nsupports-color \"^2.0.0\"\n-chalk@^2.0.0:\n+chalk@^2.0.0, chalk@^2.1.0:\nversion \"2.1.0\"\nresolved \"https://registry.yarnpkg.com/chalk/-/chalk-2.1.0.tgz#ac5becf14fa21b99c6c92ca7a7d7cfd5b17e743e\"\ndependencies:\n", "new_path": "yarn.lock", "old_path": "yarn.lock" } ]
JavaScript
MIT License
lerna/lerna
chore: chalk 2.x
1
chore
null
807,849
10.08.2017 09:56:14
25,200
001ec5882630cedd895f2c95a56a755617bb036c
chore: fs-extra 4.x
[ { "change_type": "MODIFY", "diff": "\"dedent\": \"^0.7.0\",\n\"execa\": \"^0.6.3\",\n\"find-up\": \"^2.1.0\",\n- \"fs-extra\": \"^3.0.1\",\n+ \"fs-extra\": \"^4.0.1\",\n\"get-port\": \"^3.1.0\",\n\"glob\": \"^7.1.2\",\n\"globby\": \"^6.1.0\",\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "@@ -1733,9 +1733,9 @@ form-data@~2.1.1:\ncombined-stream \"^1.0.5\"\nmime-types \"^2.1.12\"\n-fs-extra@^3.0.1:\n- version \"3.0.1\"\n- resolved \"https://registry.yarnpkg.com/fs-extra/-/fs-extra-3.0.1.tgz#3794f378c58b342ea7dbbb23095109c4b3b62291\"\n+fs-extra@^4.0.1:\n+ version \"4.0.1\"\n+ resolved \"https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.1.tgz#7fc0c6c8957f983f57f306a24e5b9ddd8d0dd880\"\ndependencies:\ngraceful-fs \"^4.1.2\"\njsonfile \"^3.0.0\"\n", "new_path": "yarn.lock", "old_path": "yarn.lock" } ]
JavaScript
MIT License
lerna/lerna
chore: fs-extra 4.x
1
chore
null
807,849
10.08.2017 10:02:46
25,200
d1b5dddc3bc97317e6fa406b840e6acc628cf013
chore: upgrade eslint + eslint-config-babel
[ { "change_type": "MODIFY", "diff": "\"babel-jest\": \"^19.0.0\",\n\"babel-plugin-add-module-exports\": \"^0.2.1\",\n\"babel-preset-env\": \"^1.6.0\",\n- \"eslint\": \"^3.19.0\",\n- \"eslint-config-babel\": \"^6.0.0\",\n+ \"eslint\": \"^4.4.1\",\n+ \"eslint-config-babel\": \"^7.0.2\",\n\"eslint-plugin-babel\": \"^4.1.2\",\n\"eslint-plugin-flowtype\": \"^2.35.0\",\n\"eslint-plugin-node\": \"^5.1.1\",\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "@@ -37,9 +37,9 @@ acorn@^4.0.4:\nversion \"4.0.4\"\nresolved \"https://registry.yarnpkg.com/acorn/-/acorn-4.0.4.tgz#17a8d6a7a6c4ef538b814ec9abac2779293bf30a\"\n-acorn@^5.0.1:\n- version \"5.0.3\"\n- resolved \"https://registry.yarnpkg.com/acorn/-/acorn-5.0.3.tgz#c460df08491463f028ccb82eab3730bf01087b3d\"\n+acorn@^5.1.1:\n+ version \"5.1.1\"\n+ resolved \"https://registry.yarnpkg.com/acorn/-/acorn-5.1.1.tgz#53fe161111f912ab999ee887a90a0bc52822fd75\"\nadd-stream@^1.0.0:\nversion \"1.0.0\"\n@@ -56,6 +56,15 @@ ajv@^4.7.0:\nco \"^4.6.0\"\njson-stable-stringify \"^1.0.1\"\n+ajv@^5.2.0:\n+ version \"5.2.2\"\n+ resolved \"https://registry.yarnpkg.com/ajv/-/ajv-5.2.2.tgz#47c68d69e86f5d953103b0074a9430dc63da5e39\"\n+ dependencies:\n+ co \"^4.6.0\"\n+ fast-deep-equal \"^1.0.0\"\n+ json-schema-traverse \"^0.3.0\"\n+ json-stable-stringify \"^1.0.1\"\n+\nalign-text@^0.1.1, align-text@^0.1.3:\nversion \"0.1.4\"\nresolved \"https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117\"\n@@ -68,7 +77,7 @@ amdefine@>=0.0.4:\nversion \"1.0.1\"\nresolved \"https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5\"\n-ansi-escapes@^1.1.0, ansi-escapes@^1.4.0:\n+ansi-escapes@^1.4.0:\nversion \"1.4.0\"\nresolved \"https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e\"\n@@ -233,7 +242,7 @@ babel-cli@^6.24.1:\noptionalDependencies:\nchokidar \"^1.6.1\"\n-babel-code-frame@^6.16.0, babel-code-frame@^6.22.0:\n+babel-code-frame@^6.22.0:\nversion \"6.22.0\"\nresolved \"https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4\"\ndependencies:\n@@ -868,7 +877,7 @@ center-align@^0.1.1:\nalign-text \"^0.1.3\"\nlazy-cache \"^1.0.3\"\n-chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3:\n+chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3:\nversion \"1.1.3\"\nresolved \"https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98\"\ndependencies:\n@@ -909,12 +918,6 @@ circular-json@^0.3.1:\nversion \"0.3.1\"\nresolved \"https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d\"\n-cli-cursor@^1.0.1:\n- version \"1.0.2\"\n- resolved \"https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987\"\n- dependencies:\n- restore-cursor \"^1.0.1\"\n-\ncli-cursor@^2.1.0:\nversion \"2.1.0\"\nresolved \"https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5\"\n@@ -1004,7 +1007,7 @@ concat-map@0.0.1:\nversion \"0.0.1\"\nresolved \"https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b\"\n-concat-stream@^1.4.10, concat-stream@^1.5.2:\n+concat-stream@^1.4.10, concat-stream@^1.6.0:\nversion \"1.6.0\"\nresolved \"https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7\"\ndependencies:\n@@ -1198,7 +1201,7 @@ cross-spawn@^4.0.0:\nlru-cache \"^4.0.1\"\nwhich \"^1.2.9\"\n-cross-spawn@^5.0.1:\n+cross-spawn@^5.0.1, cross-spawn@^5.1.0:\nversion \"5.1.0\"\nresolved \"https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449\"\ndependencies:\n@@ -1232,12 +1235,6 @@ currently-unhandled@^0.4.1:\ndependencies:\narray-find-index \"^1.0.1\"\n-d@^0.1.1, d@~0.1.1:\n- version \"0.1.1\"\n- resolved \"https://registry.yarnpkg.com/d/-/d-0.1.1.tgz#da184c535d18d8ee7ba2aa229b914009fae11309\"\n- dependencies:\n- es5-ext \"~0.10.2\"\n-\ndargs@^4.0.1:\nversion \"4.1.0\"\nresolved \"https://registry.yarnpkg.com/dargs/-/dargs-4.1.0.tgz#03a9dbb4b5c2f139bf14ae53f0b8a2a6a86f4e17\"\n@@ -1263,6 +1260,12 @@ debug@^2.1.1, debug@^2.2.0:\ndependencies:\nms \"0.7.2\"\n+debug@^2.6.8:\n+ version \"2.6.8\"\n+ resolved \"https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc\"\n+ dependencies:\n+ ms \"2.0.0\"\n+\ndebug@~2.2.0:\nversion \"2.2.0\"\nresolved \"https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da\"\n@@ -1370,58 +1373,6 @@ error-ex@^1.2.0:\ndependencies:\nis-arrayish \"^0.2.1\"\n-es5-ext@^0.10.7, es5-ext@^0.10.8, es5-ext@~0.10.11, es5-ext@~0.10.2, es5-ext@~0.10.7:\n- version \"0.10.12\"\n- resolved \"https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.12.tgz#aa84641d4db76b62abba5e45fd805ecbab140047\"\n- dependencies:\n- es6-iterator \"2\"\n- es6-symbol \"~3.1\"\n-\n-es6-iterator@2:\n- version \"2.0.0\"\n- resolved \"https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.0.tgz#bd968567d61635e33c0b80727613c9cb4b096bac\"\n- dependencies:\n- d \"^0.1.1\"\n- es5-ext \"^0.10.7\"\n- es6-symbol \"3\"\n-\n-es6-map@^0.1.3:\n- version \"0.1.4\"\n- resolved \"https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.4.tgz#a34b147be224773a4d7da8072794cefa3632b897\"\n- dependencies:\n- d \"~0.1.1\"\n- es5-ext \"~0.10.11\"\n- es6-iterator \"2\"\n- es6-set \"~0.1.3\"\n- es6-symbol \"~3.1.0\"\n- event-emitter \"~0.3.4\"\n-\n-es6-set@~0.1.3:\n- version \"0.1.4\"\n- resolved \"https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.4.tgz#9516b6761c2964b92ff479456233a247dc707ce8\"\n- dependencies:\n- d \"~0.1.1\"\n- es5-ext \"~0.10.11\"\n- es6-iterator \"2\"\n- es6-symbol \"3\"\n- event-emitter \"~0.3.4\"\n-\n-es6-symbol@3, es6-symbol@~3.1, es6-symbol@~3.1.0:\n- version \"3.1.0\"\n- resolved \"https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.0.tgz#94481c655e7a7cad82eba832d97d5433496d7ffa\"\n- dependencies:\n- d \"~0.1.1\"\n- es5-ext \"~0.10.11\"\n-\n-es6-weak-map@^2.0.1:\n- version \"2.0.1\"\n- resolved \"https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.1.tgz#0d2bbd8827eb5fb4ba8f97fbfea50d43db21ea81\"\n- dependencies:\n- d \"^0.1.1\"\n- es5-ext \"^0.10.8\"\n- es6-iterator \"2\"\n- es6-symbol \"3\"\n-\nescape-string-regexp@^1.0.2, escape-string-regexp@^1.0.3, escape-string-regexp@^1.0.5:\nversion \"1.0.5\"\nresolved \"https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4\"\n@@ -1437,18 +1388,9 @@ escodegen@^1.6.1:\noptionalDependencies:\nsource-map \"~0.2.0\"\n-escope@^3.6.0:\n- version \"3.6.0\"\n- resolved \"https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3\"\n- dependencies:\n- es6-map \"^0.1.3\"\n- es6-weak-map \"^2.0.1\"\n- esrecurse \"^4.1.0\"\n- estraverse \"^4.1.1\"\n-\n-eslint-config-babel@^6.0.0:\n- version \"6.0.0\"\n- resolved \"https://registry.yarnpkg.com/eslint-config-babel/-/eslint-config-babel-6.0.0.tgz#66feedf6ce6e04abe585cec1a65b5bcc96bed50a\"\n+eslint-config-babel@^7.0.2:\n+ version \"7.0.2\"\n+ resolved \"https://registry.yarnpkg.com/eslint-config-babel/-/eslint-config-babel-7.0.2.tgz#cbde74f61cee087d8cd6e607fcfa087869a02d99\"\neslint-plugin-babel@^4.1.2:\nversion \"4.1.2\"\n@@ -1469,51 +1411,59 @@ eslint-plugin-node@^5.1.1:\nresolve \"^1.3.3\"\nsemver \"5.3.0\"\n-eslint@^3.19.0:\n- version \"3.19.0\"\n- resolved \"https://registry.yarnpkg.com/eslint/-/eslint-3.19.0.tgz#c8fc6201c7f40dd08941b87c085767386a679acc\"\n+eslint-scope@^3.7.1:\n+ version \"3.7.1\"\n+ resolved \"https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8\"\n+ dependencies:\n+ esrecurse \"^4.1.0\"\n+ estraverse \"^4.1.1\"\n+\n+eslint@^4.4.1:\n+ version \"4.4.1\"\n+ resolved \"https://registry.yarnpkg.com/eslint/-/eslint-4.4.1.tgz#99cd7eafcffca2ff99a5c8f5f2a474d6364b4bd3\"\ndependencies:\n- babel-code-frame \"^6.16.0\"\n+ ajv \"^5.2.0\"\n+ babel-code-frame \"^6.22.0\"\nchalk \"^1.1.3\"\n- concat-stream \"^1.5.2\"\n- debug \"^2.1.1\"\n+ concat-stream \"^1.6.0\"\n+ cross-spawn \"^5.1.0\"\n+ debug \"^2.6.8\"\ndoctrine \"^2.0.0\"\n- escope \"^3.6.0\"\n- espree \"^3.4.0\"\n+ eslint-scope \"^3.7.1\"\n+ espree \"^3.5.0\"\nesquery \"^1.0.0\"\nestraverse \"^4.2.0\"\nesutils \"^2.0.2\"\nfile-entry-cache \"^2.0.0\"\n- glob \"^7.0.3\"\n- globals \"^9.14.0\"\n- ignore \"^3.2.0\"\n+ functional-red-black-tree \"^1.0.1\"\n+ glob \"^7.1.2\"\n+ globals \"^9.17.0\"\n+ ignore \"^3.3.3\"\nimurmurhash \"^0.1.4\"\n- inquirer \"^0.12.0\"\n- is-my-json-valid \"^2.10.0\"\n+ inquirer \"^3.0.6\"\nis-resolvable \"^1.0.0\"\n- js-yaml \"^3.5.1\"\n- json-stable-stringify \"^1.0.0\"\n+ js-yaml \"^3.9.1\"\n+ json-stable-stringify \"^1.0.1\"\nlevn \"^0.3.0\"\n- lodash \"^4.0.0\"\n- mkdirp \"^0.5.0\"\n+ lodash \"^4.17.4\"\n+ minimatch \"^3.0.2\"\n+ mkdirp \"^0.5.1\"\nnatural-compare \"^1.4.0\"\noptionator \"^0.8.2\"\n- path-is-inside \"^1.0.1\"\n- pluralize \"^1.2.1\"\n- progress \"^1.1.8\"\n- require-uncached \"^1.0.2\"\n- shelljs \"^0.7.5\"\n- strip-bom \"^3.0.0\"\n+ path-is-inside \"^1.0.2\"\n+ pluralize \"^4.0.0\"\n+ progress \"^2.0.0\"\n+ require-uncached \"^1.0.3\"\n+ semver \"^5.3.0\"\nstrip-json-comments \"~2.0.1\"\n- table \"^3.7.8\"\n+ table \"^4.0.1\"\ntext-table \"~0.2.0\"\n- user-home \"^2.0.0\"\n-espree@^3.4.0:\n- version \"3.4.1\"\n- resolved \"https://registry.yarnpkg.com/espree/-/espree-3.4.1.tgz#28a83ab4aaed71ed8fe0f5efe61b76a05c13c4d2\"\n+espree@^3.5.0:\n+ version \"3.5.0\"\n+ resolved \"https://registry.yarnpkg.com/espree/-/espree-3.5.0.tgz#98358625bdd055861ea27e2867ea729faf463d8d\"\ndependencies:\n- acorn \"^5.0.1\"\n+ acorn \"^5.1.1\"\nacorn-jsx \"^3.0.0\"\nesprima@^2.7.1:\n@@ -1524,6 +1474,10 @@ esprima@^3.1.1:\nversion \"3.1.3\"\nresolved \"https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633\"\n+esprima@^4.0.0:\n+ version \"4.0.0\"\n+ resolved \"https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804\"\n+\nesquery@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa\"\n@@ -1553,13 +1507,6 @@ esutils@^2.0.2:\nversion \"2.0.2\"\nresolved \"https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b\"\n-event-emitter@~0.3.4:\n- version \"0.3.4\"\n- resolved \"https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.4.tgz#8d63ddfb4cfe1fae3b32ca265c4c720222080bb5\"\n- dependencies:\n- d \"~0.1.1\"\n- es5-ext \"~0.10.7\"\n-\nexec-sh@^0.2.0:\nversion \"0.2.0\"\nresolved \"https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.2.0.tgz#14f75de3f20d286ef933099b2ce50a90359cef10\"\n@@ -1590,10 +1537,6 @@ execa@^0.6.3:\nsignal-exit \"^3.0.0\"\nstrip-eof \"^1.0.0\"\n-exit-hook@^1.0.0:\n- version \"1.1.1\"\n- resolved \"https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8\"\n-\nexpand-brackets@^0.1.4:\nversion \"0.1.5\"\nresolved \"https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b\"\n@@ -1628,6 +1571,10 @@ extsprintf@1.0.2:\nversion \"1.0.2\"\nresolved \"https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550\"\n+fast-deep-equal@^1.0.0:\n+ version \"1.0.0\"\n+ resolved \"https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff\"\n+\nfast-levenshtein@~2.0.4:\nversion \"2.0.6\"\nresolved \"https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917\"\n@@ -1644,13 +1591,6 @@ fb-watchman@^2.0.0:\ndependencies:\nbser \"^2.0.0\"\n-figures@^1.3.5:\n- version \"1.7.0\"\n- resolved \"https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e\"\n- dependencies:\n- escape-string-regexp \"^1.0.5\"\n- object-assign \"^4.1.0\"\n-\nfigures@^2.0.0:\nversion \"2.0.0\"\nresolved \"https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962\"\n@@ -1773,6 +1713,10 @@ fstream@^1.0.0, fstream@^1.0.2, fstream@~1.0.10:\nmkdirp \">=0.5 0\"\nrimraf \"2\"\n+functional-red-black-tree@^1.0.1:\n+ version \"1.0.1\"\n+ resolved \"https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327\"\n+\ngauge@~2.7.3:\nversion \"2.7.3\"\nresolved \"https://registry.yarnpkg.com/gauge/-/gauge-2.7.3.tgz#1c23855f962f17b3ad3d0dc7443f304542edfe09\"\n@@ -1900,10 +1844,14 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2:\nonce \"^1.3.0\"\npath-is-absolute \"^1.0.0\"\n-globals@^9.0.0, globals@^9.14.0:\n+globals@^9.0.0:\nversion \"9.14.0\"\nresolved \"https://registry.yarnpkg.com/globals/-/globals-9.14.0.tgz#8859936af0038741263053b39d0e76ca241e4034\"\n+globals@^9.17.0:\n+ version \"9.18.0\"\n+ resolved \"https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a\"\n+\nglobby@^5.0.0:\nversion \"5.0.0\"\nresolved \"https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d\"\n@@ -2020,10 +1968,6 @@ iconv-lite@^0.4.17:\nversion \"0.4.18\"\nresolved \"https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.18.tgz#23d8656b16aae6742ac29732ea8f0336a4789cf2\"\n-ignore@^3.2.0:\n- version \"3.2.6\"\n- resolved \"https://registry.yarnpkg.com/ignore/-/ignore-3.2.6.tgz#26e8da0644be0bb4cb39516f6c79f0e0f4ffe48c\"\n-\nignore@^3.3.3:\nversion \"3.3.3\"\nresolved \"https://registry.yarnpkg.com/ignore/-/ignore-3.3.3.tgz#432352e57accd87ab3110e82d3fea0e47812156d\"\n@@ -2053,25 +1997,7 @@ ini@^1.3.2, ini@~1.3.0:\nversion \"1.3.4\"\nresolved \"https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e\"\n-inquirer@^0.12.0:\n- version \"0.12.0\"\n- resolved \"https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e\"\n- dependencies:\n- ansi-escapes \"^1.1.0\"\n- ansi-regex \"^2.0.0\"\n- chalk \"^1.0.0\"\n- cli-cursor \"^1.0.1\"\n- cli-width \"^2.0.0\"\n- figures \"^1.3.5\"\n- lodash \"^4.3.0\"\n- readline2 \"^1.0.1\"\n- run-async \"^0.1.0\"\n- rx-lite \"^3.1.2\"\n- string-width \"^1.0.1\"\n- strip-ansi \"^3.0.0\"\n- through \"^2.3.6\"\n-\n-inquirer@^3.2.1:\n+inquirer@^3.0.6, inquirer@^3.2.1:\nversion \"3.2.1\"\nresolved \"https://registry.yarnpkg.com/inquirer/-/inquirer-3.2.1.tgz#06ceb0f540f45ca548c17d6840959878265fa175\"\ndependencies:\n@@ -2090,10 +2016,6 @@ inquirer@^3.2.1:\nstrip-ansi \"^4.0.0\"\nthrough \"^2.3.6\"\n-interpret@^1.0.0:\n- version \"1.0.2\"\n- resolved \"https://registry.yarnpkg.com/interpret/-/interpret-1.0.2.tgz#f4f623f0bb7122f15f5717c8e254b8161b5c5b2d\"\n-\ninvariant@^2.2.0, invariant@^2.2.2:\nversion \"2.2.2\"\nresolved \"https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360\"\n@@ -2170,7 +2092,7 @@ is-glob@^2.0.0, is-glob@^2.0.1:\ndependencies:\nis-extglob \"^1.0.0\"\n-is-my-json-valid@^2.10.0, is-my-json-valid@^2.12.4:\n+is-my-json-valid@^2.12.4:\nversion \"2.15.0\"\nresolved \"https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz#936edda3ca3c211fd98f3b2d3e08da43f7b2915b\"\ndependencies:\n@@ -2547,13 +2469,20 @@ js-tokens@^3.0.0:\nversion \"3.0.1\"\nresolved \"https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7\"\n-js-yaml@^3.5.1, js-yaml@^3.7.0:\n+js-yaml@^3.7.0:\nversion \"3.8.1\"\nresolved \"https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.1.tgz#782ba50200be7b9e5a8537001b7804db3ad02628\"\ndependencies:\nargparse \"^1.0.7\"\nesprima \"^3.1.1\"\n+js-yaml@^3.9.1:\n+ version \"3.9.1\"\n+ resolved \"https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.9.1.tgz#08775cebdfdd359209f0d2acd383c8f86a6904a0\"\n+ dependencies:\n+ argparse \"^1.0.7\"\n+ esprima \"^4.0.0\"\n+\njsbn@~0.1.0:\nversion \"0.1.0\"\nresolved \"https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.0.tgz#650987da0dd74f4ebf5a11377a2aa2d273e97dfd\"\n@@ -2594,11 +2523,15 @@ jsesc@~0.5.0:\nversion \"0.5.0\"\nresolved \"https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d\"\n+json-schema-traverse@^0.3.0:\n+ version \"0.3.1\"\n+ resolved \"https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340\"\n+\njson-schema@0.2.3:\nversion \"0.2.3\"\nresolved \"https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13\"\n-json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1:\n+json-stable-stringify@^1.0.1:\nversion \"1.0.1\"\nresolved \"https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af\"\ndependencies:\n@@ -2827,7 +2760,7 @@ minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0:\nversion \"1.2.0\"\nresolved \"https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284\"\n-\"mkdirp@>=0.5 0\", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1:\n+\"mkdirp@>=0.5 0\", mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1:\nversion \"0.5.1\"\nresolved \"https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903\"\ndependencies:\n@@ -2849,9 +2782,9 @@ ms@0.7.2:\nversion \"0.7.2\"\nresolved \"https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765\"\n-mute-stream@0.0.5:\n- version \"0.0.5\"\n- resolved \"https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0\"\n+ms@2.0.0:\n+ version \"2.0.0\"\n+ resolved \"https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8\"\nmute-stream@0.0.7:\nversion \"0.0.7\"\n@@ -2982,10 +2915,6 @@ once@~1.3.3:\ndependencies:\nwrappy \"1\"\n-onetime@^1.0.0:\n- version \"1.1.0\"\n- resolved \"https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789\"\n-\nonetime@^2.0.0:\nversion \"2.0.0\"\nresolved \"https://registry.yarnpkg.com/onetime/-/onetime-2.0.0.tgz#52aa8110e52fc5126ffc667bd8ec21c2ed209ce6\"\n@@ -3091,7 +3020,7 @@ path-is-absolute@^1.0.0:\nversion \"1.0.1\"\nresolved \"https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f\"\n-path-is-inside@^1.0.1:\n+path-is-inside@^1.0.1, path-is-inside@^1.0.2:\nversion \"1.0.2\"\nresolved \"https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53\"\n@@ -3131,9 +3060,9 @@ pinkie@^2.0.0:\nversion \"2.0.4\"\nresolved \"https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870\"\n-pluralize@^1.2.1:\n- version \"1.2.1\"\n- resolved \"https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45\"\n+pluralize@^4.0.0:\n+ version \"4.0.0\"\n+ resolved \"https://registry.yarnpkg.com/pluralize/-/pluralize-4.0.0.tgz#59b708c1c0190a2f692f1c7618c446b052fd1762\"\nprelude-ls@~1.1.2:\nversion \"1.1.2\"\n@@ -3157,9 +3086,9 @@ process-nextick-args@~1.0.6:\nversion \"1.0.7\"\nresolved \"https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3\"\n-progress@^1.1.8:\n- version \"1.1.8\"\n- resolved \"https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be\"\n+progress@^2.0.0:\n+ version \"2.0.0\"\n+ resolved \"https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f\"\nprr@~0.0.0:\nversion \"0.0.0\"\n@@ -3266,20 +3195,6 @@ readdirp@^2.0.0:\nreadable-stream \"^2.0.2\"\nset-immediate-shim \"^1.0.1\"\n-readline2@^1.0.1:\n- version \"1.0.1\"\n- resolved \"https://registry.yarnpkg.com/readline2/-/readline2-1.0.1.tgz#41059608ffc154757b715d9989d199ffbf372e35\"\n- dependencies:\n- code-point-at \"^1.0.0\"\n- is-fullwidth-code-point \"^1.0.0\"\n- mute-stream \"0.0.5\"\n-\n-rechoir@^0.6.2:\n- version \"0.6.2\"\n- resolved \"https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384\"\n- dependencies:\n- resolve \"^1.1.6\"\n-\nredent@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde\"\n@@ -3387,7 +3302,7 @@ require-main-filename@^1.0.1:\nversion \"1.0.1\"\nresolved \"https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1\"\n-require-uncached@^1.0.2:\n+require-uncached@^1.0.3:\nversion \"1.0.3\"\nresolved \"https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3\"\ndependencies:\n@@ -3402,7 +3317,7 @@ resolve@1.1.7:\nversion \"1.1.7\"\nresolved \"https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b\"\n-resolve@^1.1.6, resolve@^1.2.0:\n+resolve@^1.2.0:\nversion \"1.3.2\"\nresolved \"https://registry.yarnpkg.com/resolve/-/resolve-1.3.2.tgz#1f0442c9e0cbb8136e87b9305f932f46c7f28235\"\ndependencies:\n@@ -3414,13 +3329,6 @@ resolve@^1.3.3:\ndependencies:\npath-parse \"^1.0.5\"\n-restore-cursor@^1.0.1:\n- version \"1.0.1\"\n- resolved \"https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541\"\n- dependencies:\n- exit-hook \"^1.0.0\"\n- onetime \"^1.0.0\"\n-\nrestore-cursor@^2.0.0:\nversion \"2.0.0\"\nresolved \"https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf\"\n@@ -3446,12 +3354,6 @@ rimraf@~2.5.1, rimraf@~2.5.4:\ndependencies:\nglob \"^7.0.5\"\n-run-async@^0.1.0:\n- version \"0.1.0\"\n- resolved \"https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389\"\n- dependencies:\n- once \"^1.3.0\"\n-\nrun-async@^2.2.0:\nversion \"2.3.0\"\nresolved \"https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0\"\n@@ -3468,10 +3370,6 @@ rx-lite@*, rx-lite@^4.0.8:\nversion \"4.0.8\"\nresolved \"https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444\"\n-rx-lite@^3.1.2:\n- version \"3.1.2\"\n- resolved \"https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102\"\n-\nsafe-buffer@^5.1.1:\nversion \"5.1.1\"\nresolved \"https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853\"\n@@ -3518,14 +3416,6 @@ shebang-regex@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3\"\n-shelljs@^0.7.5:\n- version \"0.7.7\"\n- resolved \"https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.7.tgz#b2f5c77ef97148f4b4f6e22682e10bba8667cff1\"\n- dependencies:\n- glob \"^7.0.0\"\n- interpret \"^1.0.0\"\n- rechoir \"^0.6.2\"\n-\nshellwords@^0.1.0:\nversion \"0.1.0\"\nresolved \"https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.0.tgz#66afd47b6a12932d9071cbfd98a52e785cd0ba14\"\n@@ -3737,9 +3627,9 @@ symbol-tree@^3.2.1:\nversion \"3.2.2\"\nresolved \"https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6\"\n-table@^3.7.8:\n- version \"3.8.3\"\n- resolved \"https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f\"\n+table@^4.0.1:\n+ version \"4.0.1\"\n+ resolved \"https://registry.yarnpkg.com/table/-/table-4.0.1.tgz#a8116c133fac2c61f4a420ab6cdf5c4d61f0e435\"\ndependencies:\najv \"^4.7.0\"\najv-keywords \"^1.0.0\"\n@@ -3927,12 +3817,6 @@ user-home@^1.1.1:\nversion \"1.1.1\"\nresolved \"https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190\"\n-user-home@^2.0.0:\n- version \"2.0.0\"\n- resolved \"https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f\"\n- dependencies:\n- os-homedir \"^1.0.0\"\n-\nutil-deprecate@~1.0.1:\nversion \"1.0.2\"\nresolved \"https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf\"\n", "new_path": "yarn.lock", "old_path": "yarn.lock" } ]
JavaScript
MIT License
lerna/lerna
chore: upgrade eslint + eslint-config-babel
1
chore
null
807,849
10.08.2017 10:03:36
25,200
3c0b1b1068c45da7c2901f344b476dc7306afa2d
lint: remove unnecessary escape character
[ { "change_type": "MODIFY", "diff": "@@ -124,7 +124,7 @@ export default class ImportCommand extends Command {\n.replace(/^([-+]{3} [ab])/mg, replacement)\n.replace(/^(diff --git a)/mg, replacement)\n.replace(/^(diff --git \\S+ b)/mg, replacement)\n- .replace(/^(rename (from|to)) /mg, `\\$1 ${this.targetDir}/`);\n+ .replace(/^(rename (from|to)) /mg, `$1 ${this.targetDir}/`);\n// Apply the modified patch to the current lerna repository, preserving\n// original commit date, author and message.\n", "new_path": "src/commands/ImportCommand.js", "old_path": "src/commands/ImportCommand.js" } ]
JavaScript
MIT License
lerna/lerna
lint: remove unnecessary escape character
1
lint
null
448,039
14.08.2017 07:40:17
-7,200
ad6325baa00aff76d7bea0726f06cdbaf0740aa7
fix: move ng-package.schema.json to dist root directory BREAKING CHANGES: the `ng-package.schema.json` was accidentally moved to `lib` folder in a previous release. Restore it in its original location!
[ { "change_type": "MODIFY", "diff": "@@ -14,7 +14,7 @@ require('ts-node').register({\nproject: path.join(__dirname, '..', 'tsconfig.packagr.json')\n});\n-const ngPackagr = require('../lib/ng-packagr');\n+const ngPackagr = require('../src/lib/ng-packagr');\nlet promise = Promise.resolve();\nwhile (SAMPLES.length > 0) {\n", "new_path": "integration/samples.js", "old_path": "integration/samples.js" }, { "change_type": "MODIFY", "diff": "\"prebuild\": \"rimraf dist && yarn schema\",\n\"build\": \"tsc -p tsconfig.packagr.json\",\n\"postbuild\": \"node scripts/postbuild.js\",\n- \"schema\": \"json2ts --input src/lib/ng-package.schema.json --output src/lib/ng-package.schema.ts\",\n+ \"schema\": \"json2ts --input src/ng-package.schema.json --output src/ng-package.schema.ts\",\n\"prerelease\": \"yarn build\",\n\"release\": \"standard-version --message 'chore: cut release for v%s' --prerelease pre\",\n\"postrelease\": \"node scripts/prepublish.js\",\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "@@ -19,7 +19,7 @@ const copy = (paths, opts) => {\n// copyfiles 'lib/conf/**/*.json' dist\",\ncopy(['src/cli/*', 'dist'], {up: 1})\n- .then(() => copy(['src/lib/ng-package.schema.json', 'dist'], {up: 1}))\n+ .then(() => copy(['src/ng-package.schema.json', 'dist'], {up: 1}))\n.then(() => copy(['src/lib/conf/**/*.json', 'dist'], {up: 1}))\n.catch((err) => {\nconsole.error(\"Cannot copy files\", err);\n", "new_path": "scripts/postbuild.js", "old_path": "scripts/postbuild.js" }, { "change_type": "RENAME", "diff": "", "new_path": "src/.gitignore", "old_path": "src/lib/.gitignore" }, { "change_type": "MODIFY", "diff": "-import { NgPackageConfig } from '../ng-package.schema';\n+import { NgPackageConfig } from '../../ng-package.schema';\nconst path = require('path');\nconst SCOPE_PREFIX = '@';\n", "new_path": "src/lib/model/ng-package.ts", "old_path": "src/lib/model/ng-package.ts" }, { "change_type": "MODIFY", "diff": "@@ -17,7 +17,7 @@ import { error, warn, info, success, debug } from './util/log';\n// `ng-package.json` config\nimport { NgPackage } from './model/ng-package';\n-import { NgPackageConfig } from './ng-package.schema';\n+import { NgPackageConfig } from '../ng-package.schema';\n", "new_path": "src/lib/ng-packagr.ts", "old_path": "src/lib/ng-packagr.ts" }, { "change_type": "MODIFY", "diff": "import * as path from 'path';\nimport { SchemaClass, SchemaClassFactory } from '@ngtools/json-schema';\n-import { NgPackageConfig } from '../ng-package.schema';\n+import { NgPackageConfig } from '../../ng-package.schema';\nimport { NgPackage } from '../model/ng-package';\n-import { findFromDirectory } from '../util/fs';\nimport { readJson, writeJson } from '../util/json';\n+const schemaPromise = readJson(path.resolve(__dirname, '..', '..', 'ng-package.schema.json'))\n+ .then((jsonSchema: any) => SchemaClassFactory<NgPackageConfig>(jsonSchema));\n/**\n* Reads an Angular package definition file from 'ng-package.json'\n*\n- * @param file `ng-package.json` definition file\n+ * @param file path pointing to `ng-package.json` file\n*/\nexport const readPackage = (file: string): Promise<NgPackage> => {\nconst base = path.dirname(file);\n- return readJson(file)\n- .then((ngPkg: NgPackageConfig) => {\n+ // read 'ng-package.json'\n+ return readJson(file).then((ngPkg: NgPackageConfig) => {\n// resolve pathes relative to `ng-package.json` file\nconst dir = path.resolve(base, ngPkg.src || '.');\n- return readJson(`${dir}/package.json`)\n- .then((pkg: any) => {\n+ // read 'package.json'\n+ return readJson(path.resolve(dir, 'package.json')).then((pkg: any) => {\n+ // read 'ng-package.schema.json'\n+ return schemaPromise.then((SchemaClass) => {\n+ const schema = new SchemaClass(ngPkg);\n- return new Promise((resolve, reject) => {\n-\n- findFromDirectory(__dirname, 'ng-package.schema.json', (fileName: string) => {\n- resolve(fileName);\n+ return Promise.resolve(new NgPackage(pkg, ngPkg, base, schema));\n});\n- })\n- .then((schemaFileName: string) => readJson(schemaFileName))\n- .then((schemaJson: any) => {\n- const NgPackageSchema = SchemaClassFactory(schemaJson);\n- const schema: SchemaClass<NgPackageConfig> = new NgPackageSchema(ngPkg);\n-\n- return Promise.resolve(new NgPackage(base, schema.$$root(), pkg));\n- });\n-\n});\n});\n}\n@@ -51,9 +43,7 @@ export const readPackage = (file: string): Promise<NgPackage> => {\n*/\nexport const createPackage = (src: string, dest: string, additionalProperties?: {}): Promise<any> => {\n- return readJson(`${src}/package.json`)\n- .then((packageJson) => {\n-\n+ return readJson(path.resolve(src, 'package.json')).then((packageJson) => {\n// set additional properties\nif (additionalProperties) {\nObject.keys(additionalProperties).forEach((key) => {\n", "new_path": "src/lib/steps/package.ts", "old_path": "src/lib/steps/package.ts" }, { "change_type": "RENAME", "diff": "", "new_path": "src/ng-package.schema.json", "old_path": "src/lib/ng-package.schema.json" }, { "change_type": "MODIFY", "diff": "\"inlineSources\": true,\n\"declaration\": true,\n\"lib\": [\"es2015\", \"dom\"],\n- \"outDir\": \"dist/lib\",\n+ \"outDir\": \"dist\",\n\"experimentalDecorators\": true,\n\"noEmitOnError\": true,\n\"noImplicitAny\": false,\n", "new_path": "tsconfig.packagr.json", "old_path": "tsconfig.packagr.json" } ]
TypeScript
MIT License
ng-packagr/ng-packagr
fix: move ng-package.schema.json to dist root directory BREAKING CHANGES: the `ng-package.schema.json` was accidentally moved to `lib` folder in a previous release. Restore it in its original location!
1
fix
null
448,039
14.08.2017 07:59:34
-7,200
0c3130c726dfcebae1abb719b5565fdd4d1dba2a
fix: read json config values thru `schema.$$get()`
[ { "change_type": "MODIFY", "diff": "+import { SchemaClass } from '@ngtools/json-schema';\nimport { NgPackageConfig } from '../../ng-package.schema';\nconst path = require('path');\n@@ -5,35 +6,56 @@ const SCOPE_PREFIX = '@';\nconst SCOPE_NAME_SEPARATOR = '/';\n-/** POVO (plain-old value object) of the Angular package being built. */\n+/** POVO (plain-old value object :-)) of the Angular package being built. */\nexport class NgPackage {\nconstructor(\n- private basePath: string,\n- /** Contents of `ng-package.json` file. */\n+ /** Unmodified contents of the project's `package.json` file. */\n+ public packageJson: any,\n+ /** Unmodified contents of the project's `ng-package.json` file. */\npublic ngPackageJson: NgPackageConfig,\n- /** Contents of `package.json` file. */\n- public packageJson: any\n+ private basePath: string,\n+ private $schema: SchemaClass<NgPackageConfig>\n) {}\n+ /*\n+ const foo = this.$schema.$$get('lib.entryFile'); // --> \"src/public_api.ts\"\n+ const bar = this.$schema.$$get('lib'); // --> undefined\n+ console.log(foo);\n+ console.log(bar);\n+ */\n+\npublic get dest(): string {\n- return path.resolve(this.basePath, this.ngPackageJson.dest);\n+ return path.resolve(this.basePath, this.$schema.$$get('dest'));\n}\npublic get src(): string {\n- return path.resolve(this.basePath, this.ngPackageJson.src);\n+ return path.resolve(this.basePath, this.$schema.$$get('src'));\n}\npublic get workingDirectory(): string {\n- return path.resolve(this.basePath, this.ngPackageJson.workingDirectory);\n+ return path.resolve(this.basePath, this.$schema.$$get('workingDirectory'));\n}\npublic get flatModuleFileName(): string {\n- return path.basename(this.ngPackageJson.lib.flatModuleFile || this.meta.name);\n+ let name: string = this.$schema.$$get('lib.flatModuleFile');\n+ if (!name) {\n+ name = this.meta.name;\n+ }\n+\n+ return path.basename(name);\n}\npublic get libExternals(): Object {\n- return this.ngPackageJson.lib.externals || {};\n+ if (this.ngPackageJson.lib) {\n+ return this.ngPackageJson.lib.externals;\n+ } else {\n+ return {};\n+ }\n+ }\n+\n+ public get entryFile(): string {\n+ return this.$schema.$$get('lib.entryFile');\n}\n/** Package meta information */\n", "new_path": "src/lib/model/ng-package.ts", "old_path": "src/lib/model/ng-package.ts" }, { "change_type": "MODIFY", "diff": "+import * as path from 'path';\nimport { main as tsc } from '@angular/tsc-wrapped';\nimport { NgPackage } from '../model/ng-package';\nimport { readJson, writeJson } from '../util/json';\nimport { debug } from '../util/log';\n-const path = require('path');\n-\nexport const prepareTsConfig = (ngPkg: NgPackage, outFile: string): Promise<string> => {\n@@ -14,7 +13,7 @@ export const prepareTsConfig = (ngPkg: NgPackage, outFile: string): Promise<stri\ntsConfig['angularCompilerOptions']['flatModuleId'] = ngPkg.packageJson.name;\ntsConfig['angularCompilerOptions']['flatModuleOutFile'] = `${ngPkg.flatModuleFileName}.js`;\n- tsConfig['files'] = [ ngPkg.ngPackageJson.lib.entryFile ];\n+ tsConfig['files'] = [ ngPkg.entryFile ];\nreturn writeJson(tsConfig, outFile)\n.then(() => Promise.resolve(outFile));\n", "new_path": "src/lib/steps/ngc.ts", "old_path": "src/lib/steps/ngc.ts" } ]
TypeScript
MIT License
ng-packagr/ng-packagr
fix: read json config values thru `schema.$$get()`
1
fix
null
743,897
14.08.2017 21:21:16
25,200
a2c0fefc4e1fe5300309c0bb5eb0ebfc254e4982
docs: correct typos in example.md
[ { "change_type": "MODIFY", "diff": "@@ -135,7 +135,7 @@ DEBUG(\"Extra chatty mode\");\nShowing semi-important stuff too\nExtra chatty mode\n-Tell users how to use yer options and make demands.\n+Tell users how to use your options and make demands.\n-------------------------------------------------\narea.js:\n@@ -164,7 +164,7 @@ console.log(\"The area is:\", argv.w * argv.h);\nMissing required arguments: h\n-After yer demands have been met, demand more! Ask for non-hyphenated arguments!\n+After your demands have been met, demand more! Ask for non-hyphenated arguments!\n-----------------------------------------\ndemand_count.js:\n@@ -268,8 +268,8 @@ console.dir(argv._);\nYargs is here to help you...\n---------------------------\n-Ye can describe parameters fer help messages and set aliases. Yargs figures\n-out how ter format a handy help string automatically.\n+You can describe parameters for help messages and set aliases. Yargs figures\n+out how to format a handy help string automatically.\nline_count.js:\n", "new_path": "docs/examples.md", "old_path": "docs/examples.md" } ]
JavaScript
MIT License
yargs/yargs
docs: correct typos in example.md (#934)
1
docs
null
448,039
16.08.2017 13:53:37
-7,200
e22ead21d2f7c4fc9fa89ae6bad6ba1535bc2eba
chore: cut release for v1.0.0-pre.15
[ { "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=\"1.0.0-pre.15\"></a>\n+# [1.0.0-pre.15](https://github.com/dherges/ng-packagr/compare/v1.0.0-pre.14...v1.0.0-pre.15) (2017-08-16)\n+\n+\n+### Bug Fixes\n+\n+* move ng-package.schema.json to dist root directory ([ad6325b](https://github.com/dherges/ng-packagr/commit/ad6325b))\n+* read json config values thru `schema.$$get()` ([0c3130c](https://github.com/dherges/ng-packagr/commit/0c3130c))\n+\n+\n+### Features\n+\n+* update rollup to version 0.46.0 ([1f25f7a](https://github.com/dherges/ng-packagr/commit/1f25f7a))\n+* update rollup to version 0.47.0 ([29a8901](https://github.com/dherges/ng-packagr/commit/29a8901))\n+\n+\n+### BREAKING CHANGES\n+\n+* the `ng-package.schema.json` was accidentally moved to `lib` folder in a previous release. Restore it in its original location!\n+\n+\n+\n<a name=\"1.0.0-pre.14\"></a>\n# [1.0.0-pre.14](https://github.com/dherges/ng-packagr/compare/v1.0.0-pre.13...v1.0.0-pre.14) (2017-08-07)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"ng-packagr\",\n- \"version\": \"1.0.0-pre.14\",\n+ \"version\": \"1.0.0-pre.15\",\n\"description\": \"Compile and package a TypeScript library to Angular Package Format\",\n\"keywords\": [\n\"angular\",\n", "new_path": "package.json", "old_path": "package.json" } ]
TypeScript
MIT License
ng-packagr/ng-packagr
chore: cut release for v1.0.0-pre.15
1
chore
null
448,039
22.08.2017 07:30:00
-7,200
2709d4a54cc7ec5531f8b9d9da0a6fde9dfe7a77
chore: cut release for v1.0.0-pre.16
[ { "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=\"1.0.0-pre.16\"></a>\n+# [1.0.0-pre.16](https://github.com/dherges/ng-packagr/compare/v1.0.0-pre.15...v1.0.0-pre.16) (2017-08-22)\n+\n+\n+### Features\n+\n+* update rollup to version ^0.48.0 ([9110899](https://github.com/dherges/ng-packagr/commit/9110899))\n+\n+\n+\n<a name=\"1.0.0-pre.15\"></a>\n# [1.0.0-pre.15](https://github.com/dherges/ng-packagr/compare/v1.0.0-pre.14...v1.0.0-pre.15) (2017-08-16)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"ng-packagr\",\n- \"version\": \"1.0.0-pre.15\",\n+ \"version\": \"1.0.0-pre.16\",\n\"description\": \"Compile and package a TypeScript library to Angular Package Format\",\n\"keywords\": [\n\"angular\",\n", "new_path": "package.json", "old_path": "package.json" } ]
TypeScript
MIT License
ng-packagr/ng-packagr
chore: cut release for v1.0.0-pre.16
1
chore
null
807,849
23.08.2017 20:56:50
25,200
5421da5ae601e9f8857c7cf53f219957c4d74399
chore: write-file-atomic ^2.3.0
[ { "change_type": "MODIFY", "diff": "\"signal-exit\": \"^3.0.2\",\n\"strong-log-transformer\": \"^1.0.6\",\n\"temp-write\": \"^3.3.0\",\n- \"write-file-atomic\": \"^2.1.0\",\n+ \"write-file-atomic\": \"^2.3.0\",\n\"write-json-file\": \"^2.2.0\",\n\"write-pkg\": \"^3.1.0\",\n\"yargs\": \"^8.0.2\"\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "@@ -3453,10 +3453,6 @@ slice-ansi@0.0.4:\nversion \"0.0.4\"\nresolved \"https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35\"\n-slide@^1.1.5:\n- version \"1.1.6\"\n- resolved \"https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707\"\n-\nsntp@1.x.x:\nversion \"1.0.9\"\nresolved \"https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198\"\n@@ -3960,13 +3956,13 @@ wrappy@1:\nversion \"1.0.2\"\nresolved \"https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f\"\n-write-file-atomic@^2.0.0, write-file-atomic@^2.1.0:\n- version \"2.1.0\"\n- resolved \"https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.1.0.tgz#1769f4b551eedce419f0505deae2e26763542d37\"\n+write-file-atomic@^2.0.0, write-file-atomic@^2.3.0:\n+ version \"2.3.0\"\n+ resolved \"https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.3.0.tgz#1ff61575c2e2a4e8e510d6fa4e243cce183999ab\"\ndependencies:\ngraceful-fs \"^4.1.11\"\nimurmurhash \"^0.1.4\"\n- slide \"^1.1.5\"\n+ signal-exit \"^3.0.2\"\nwrite-json-file@^2.2.0:\nversion \"2.2.0\"\n", "new_path": "yarn.lock", "old_path": "yarn.lock" } ]
JavaScript
MIT License
lerna/lerna
chore: write-file-atomic ^2.3.0
1
chore
null
807,849
23.08.2017 21:00:27
25,200
41b1be9a6cbc919c63fd336534d9d57ef58577bf
chore: inquirer 3.2.2
[ { "change_type": "MODIFY", "diff": "\"glob\": \"^7.1.2\",\n\"globby\": \"^6.1.0\",\n\"graceful-fs\": \"^4.1.11\",\n- \"inquirer\": \"^3.2.1\",\n+ \"inquirer\": \"^3.2.2\",\n\"is-ci\": \"^1.0.10\",\n\"load-json-file\": \"^3.0.0\",\n\"lodash\": \"^4.17.4\",\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "@@ -2003,9 +2003,9 @@ ini@^1.3.2, ini@~1.3.0:\nversion \"1.3.4\"\nresolved \"https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e\"\n-inquirer@^3.0.6, inquirer@^3.2.1:\n- version \"3.2.1\"\n- resolved \"https://registry.yarnpkg.com/inquirer/-/inquirer-3.2.1.tgz#06ceb0f540f45ca548c17d6840959878265fa175\"\n+inquirer@^3.0.6, inquirer@^3.2.2:\n+ version \"3.2.2\"\n+ resolved \"https://registry.yarnpkg.com/inquirer/-/inquirer-3.2.2.tgz#c2aaede1507cc54d826818737742d621bef2e823\"\ndependencies:\nansi-escapes \"^2.0.0\"\nchalk \"^2.0.0\"\n", "new_path": "yarn.lock", "old_path": "yarn.lock" } ]
JavaScript
MIT License
lerna/lerna
chore: inquirer 3.2.2
1
chore
null
807,849
23.08.2017 21:02:33
25,200
debaf90fb8a6c099eb8414d8ff0c68a871c34305
chore: eslint ^4.5.0
[ { "change_type": "MODIFY", "diff": "\"babel-jest\": \"^19.0.0\",\n\"babel-plugin-add-module-exports\": \"^0.2.1\",\n\"babel-preset-env\": \"^1.6.0\",\n- \"eslint\": \"^4.4.1\",\n+ \"eslint\": \"^4.5.0\",\n\"eslint-config-babel\": \"^7.0.2\",\n\"eslint-plugin-babel\": \"^4.1.2\",\n\"eslint-plugin-flowtype\": \"^2.35.0\",\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "@@ -50,8 +50,8 @@ ajv-keywords@^1.0.0:\nresolved \"https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c\"\najv@^4.7.0:\n- version \"4.11.2\"\n- resolved \"https://registry.yarnpkg.com/ajv/-/ajv-4.11.2.tgz#f166c3c11cbc6cb9dcc102a5bcfe5b72c95287e6\"\n+ version \"4.11.8\"\n+ resolved \"https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536\"\ndependencies:\nco \"^4.6.0\"\njson-stable-stringify \"^1.0.1\"\n@@ -915,8 +915,8 @@ ci-info@^1.0.0:\nresolved \"https://registry.yarnpkg.com/ci-info/-/ci-info-1.0.0.tgz#dc5285f2b4e251821683681c381c3388f46ec534\"\ncircular-json@^0.3.1:\n- version \"0.3.1\"\n- resolved \"https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d\"\n+ version \"0.3.3\"\n+ resolved \"https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66\"\ncli-cursor@^2.1.0:\nversion \"2.1.0\"\n@@ -1424,13 +1424,13 @@ eslint-scope@^3.7.1:\nesrecurse \"^4.1.0\"\nestraverse \"^4.1.1\"\n-eslint@^4.4.1:\n- version \"4.4.1\"\n- resolved \"https://registry.yarnpkg.com/eslint/-/eslint-4.4.1.tgz#99cd7eafcffca2ff99a5c8f5f2a474d6364b4bd3\"\n+eslint@^4.5.0:\n+ version \"4.5.0\"\n+ resolved \"https://registry.yarnpkg.com/eslint/-/eslint-4.5.0.tgz#bb75d3b8bde97fb5e13efcd539744677feb019c3\"\ndependencies:\najv \"^5.2.0\"\nbabel-code-frame \"^6.22.0\"\n- chalk \"^1.1.3\"\n+ chalk \"^2.1.0\"\nconcat-stream \"^1.6.0\"\ncross-spawn \"^5.1.0\"\ndebug \"^2.6.8\"\n@@ -1461,6 +1461,7 @@ eslint@^4.4.1:\nprogress \"^2.0.0\"\nrequire-uncached \"^1.0.3\"\nsemver \"^5.3.0\"\n+ strip-ansi \"^4.0.0\"\nstrip-json-comments \"~2.0.1\"\ntable \"^4.0.1\"\ntext-table \"~0.2.0\"\n@@ -1491,24 +1492,20 @@ esquery@^1.0.0:\nestraverse \"^4.0.0\"\nesrecurse@^4.1.0:\n- version \"4.1.0\"\n- resolved \"https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.1.0.tgz#4713b6536adf7f2ac4f327d559e7756bff648220\"\n+ version \"4.2.0\"\n+ resolved \"https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.0.tgz#fa9568d98d3823f9a41d91e902dcab9ea6e5b163\"\ndependencies:\n- estraverse \"~4.1.0\"\n+ estraverse \"^4.1.0\"\nobject-assign \"^4.0.1\"\nestraverse@^1.9.1:\nversion \"1.9.3\"\nresolved \"https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44\"\n-estraverse@^4.0.0, estraverse@^4.1.1, estraverse@^4.2.0:\n+estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0:\nversion \"4.2.0\"\nresolved \"https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13\"\n-estraverse@~4.1.0:\n- version \"4.1.1\"\n- resolved \"https://registry.yarnpkg.com/estraverse/-/estraverse-4.1.1.tgz#f6caca728933a850ef90661d0e17982ba47111a2\"\n-\nesutils@^2.0.2:\nversion \"2.0.2\"\nresolved \"https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b\"\n", "new_path": "yarn.lock", "old_path": "yarn.lock" } ]
JavaScript
MIT License
lerna/lerna
chore: eslint ^4.5.0
1
chore
null
807,849
23.08.2017 22:07:01
25,200
eef3f405e5fe2fd5c96b9d0e80a02fab13dd2807
chore: get-port ^3.2.0, ensuring port is always bound in IPv4 range
[ { "change_type": "MODIFY", "diff": "\"execa\": \"^0.6.3\",\n\"find-up\": \"^2.1.0\",\n\"fs-extra\": \"^4.0.1\",\n- \"get-port\": \"^3.1.0\",\n+ \"get-port\": \"^3.2.0\",\n\"glob\": \"^7.1.2\",\n\"globby\": \"^6.1.0\",\n\"graceful-fs\": \"^4.1.11\",\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "@@ -65,7 +65,7 @@ export default class BootstrapCommand extends Command {\n: [this.filteredPackages];\nif (npmClient === \"yarn\" && !mutex) {\n- return getPort(42424).then((port) => {\n+ return getPort({ port: 42424, host: '0.0.0.0' }).then((port) => {\nthis.npmConfig.mutex = `network:${port}`;\ncallback(null, true);\n}).catch(callback);\n", "new_path": "src/commands/BootstrapCommand.js", "old_path": "src/commands/BootstrapCommand.js" }, { "change_type": "MODIFY", "diff": "@@ -114,7 +114,7 @@ describe(\"lerna bootstrap\", () => {\ntest.skip(\"works with yarn install\", async () => {\nconst cwd = await initFixture(\"BootstrapCommand/integration-lifecycle\");\n- const port = await getPort(42042);\n+ const port = await getPort({ port: 42042, host: '0.0.0.0' });\nconst mutex = [\"--mutex\", `network:${port}`];\n// NOTE: yarn doesn't support linking binaries from transitive dependencies,\n", "new_path": "test/integration/lerna-bootstrap.test.js", "old_path": "test/integration/lerna-bootstrap.test.js" }, { "change_type": "MODIFY", "diff": "@@ -63,7 +63,7 @@ describe(\"lerna clean\", () => {\ntest.skip(\"local yarn\", async () => {\nconst cwd = await initFixture(\"CleanCommand/integration\");\n- const port = await getPort(42042);\n+ const port = await getPort({ port: 42042, host: '0.0.0.0' });\nconst mutex = [\"--mutex\", `network:${port}`];\nawait execa(\"yarn\", [\"install\", \"--no-lockfile\", ...mutex], { cwd });\n", "new_path": "test/integration/lerna-clean.test.js", "old_path": "test/integration/lerna-clean.test.js" }, { "change_type": "MODIFY", "diff": "@@ -1757,9 +1757,9 @@ get-pkg-repo@^1.0.0:\nparse-github-repo-url \"^1.3.0\"\nthrough2 \"^2.0.0\"\n-get-port@^3.1.0:\n- version \"3.1.0\"\n- resolved \"https://registry.yarnpkg.com/get-port/-/get-port-3.1.0.tgz#ef01b18a84ca6486970ff99e54446141a73ffd3e\"\n+get-port@^3.2.0:\n+ version \"3.2.0\"\n+ resolved \"https://registry.yarnpkg.com/get-port/-/get-port-3.2.0.tgz#dd7ce7de187c06c8bf353796ac71e099f0980ebc\"\nget-stdin@^4.0.1:\nversion \"4.0.1\"\n", "new_path": "yarn.lock", "old_path": "yarn.lock" } ]
JavaScript
MIT License
lerna/lerna
chore: get-port ^3.2.0, ensuring port is always bound in IPv4 range
1
chore
null
807,849
23.08.2017 22:30:54
25,200
4d984c1401a0fd842af1424fd7e63dba04f33054
chore: execa ^0.8.0
[ { "change_type": "MODIFY", "diff": "\"conventional-changelog-cli\": \"^1.3.2\",\n\"conventional-recommended-bump\": \"^1.0.1\",\n\"dedent\": \"^0.7.0\",\n- \"execa\": \"^0.6.3\",\n+ \"execa\": \"^0.8.0\",\n\"find-up\": \"^2.1.0\",\n\"fs-extra\": \"^4.0.1\",\n\"get-port\": \"^3.2.0\",\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "@@ -1504,9 +1504,9 @@ execa@^0.5.0:\nsignal-exit \"^3.0.0\"\nstrip-eof \"^1.0.0\"\n-execa@^0.6.3:\n- version \"0.6.3\"\n- resolved \"https://registry.yarnpkg.com/execa/-/execa-0.6.3.tgz#57b69a594f081759c69e5370f0d17b9cb11658fe\"\n+execa@^0.8.0:\n+ version \"0.8.0\"\n+ resolved \"https://registry.yarnpkg.com/execa/-/execa-0.8.0.tgz#d8d76bbc1b55217ed190fd6dd49d3c774ecfc8da\"\ndependencies:\ncross-spawn \"^5.0.1\"\nget-stream \"^3.0.0\"\n", "new_path": "yarn.lock", "old_path": "yarn.lock" } ]
JavaScript
MIT License
lerna/lerna
chore: execa ^0.8.0
1
chore
null
573,190
25.08.2017 12:47:00
25,200
927b79a0c01e3edc13ba3d9766a17500aa654e3a
docs: update the website `git clone` should be recursive
[ { "change_type": "MODIFY", "diff": "@@ -23,7 +23,7 @@ The website templates are maintained at https://github.com/restify/restify.githu\nTo update the documentaiton on the website to reflect the latest version of 5.x simply:\n```\n-git clone git@github.com:restify/restify.github.io\n+git clone --recursive git@github.com:restify/restify.github.io\ncd restify.github.io\ngit submodule update --remote && git add _docs && git commit -m 'bump' && git push origin master\n```\n", "new_path": "CONTRIBUTING.md", "old_path": "CONTRIBUTING.md" } ]
JavaScript
MIT License
restify/node-restify
docs: update the website `git clone` should be recursive
1
docs
null
448,039
28.08.2017 07:49:00
-7,200
edb8ab71612fedc416921fea6d315145ec5ba30c
chore: cut release for v1.0.0-pre.17
[ { "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=\"1.0.0-pre.17\"></a>\n+# [1.0.0-pre.17](https://github.com/dherges/ng-packagr/compare/v1.0.0-pre.16...v1.0.0-pre.17) (2017-08-28)\n+\n+\n+### Bug Fixes\n+\n+* **package:** update rollup to version 0.49.0 ([b5b920c](https://github.com/dherges/ng-packagr/commit/b5b920c))\n+\n+\n+### Features\n+\n+* support external dependency '[@angular](https://github.com/angular)/common/http' by default ([df44752](https://github.com/dherges/ng-packagr/commit/df44752))\n+\n+\n+\n<a name=\"1.0.0-pre.16\"></a>\n# [1.0.0-pre.16](https://github.com/dherges/ng-packagr/compare/v1.0.0-pre.15...v1.0.0-pre.16) (2017-08-22)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"ng-packagr\",\n- \"version\": \"1.0.0-pre.16\",\n+ \"version\": \"1.0.0-pre.17\",\n\"description\": \"Compile and package a TypeScript library to Angular Package Format\",\n\"keywords\": [\n\"angular\",\n", "new_path": "package.json", "old_path": "package.json" } ]
TypeScript
MIT License
ng-packagr/ng-packagr
chore: cut release for v1.0.0-pre.17
1
chore
null
573,227
28.08.2017 20:58:37
-7,200
22370420f138f38d7a4627e7ce30e25033f0624e
test(plugin): avoid using 127.0.0.2 in throttle tests
[ { "change_type": "MODIFY", "diff": "@@ -189,10 +189,17 @@ describe('throttle plugin', function () {\n});\n});\n+ describe('expose headers', function () {\n+ before(function (done) {\n+ // close global server before creating a new to avoid port conflicts\n+ CLIENT.close();\n+ SERVER.close(done);\n+ });\n+\nit('should expose headers on options set', function (done) {\n// setup a new server with headers set to true since we cant\n// change throttle options after init\n- setupClientServer('127.0.0.2', {\n+ setupClientServer('127.0.0.1', {\nburst: 17,\nrate: 0.1,\nusername: true,\n@@ -225,3 +232,4 @@ describe('throttle plugin', function () {\n});\n});\n});\n+});\n", "new_path": "test/plugins/throttle.test.js", "old_path": "test/plugins/throttle.test.js" } ]
JavaScript
MIT License
restify/node-restify
test(plugin): avoid using 127.0.0.2 in throttle tests
1
test
plugin
807,849
28.08.2017 22:45:48
25,200
958a2ab5b94221632cc981fc94ed5b951bc45efa
ci: synchronize upgraded npm across matrix, using 5.4.0 in node v8.x
[ { "change_type": "MODIFY", "diff": "@@ -19,6 +19,9 @@ cache:\n- node_modules\nbefore_install:\n+ - if [[ `node -v` == v4* ]]; then npm i -g npm@3; fi\n+ - if [[ `node -v` == v6* ]]; then npm i -g npm@4; fi\n+ - if [[ `node -v` == v8* ]]; then npm i -g npm@5.4.0; fi\n- curl -o- -L https://yarnpkg.com/install.sh | bash\n- export PATH=$HOME/.yarn/bin:$PATH\n", "new_path": ".travis.yml", "old_path": ".travis.yml" }, { "change_type": "MODIFY", "diff": "@@ -18,6 +18,8 @@ cache:\ninstall:\n- ps: Install-Product node $env:nodejs_version\n- IF %nodejs_version% EQU 4 npm -g install npm@3\n+ - IF %nodejs_version% EQU 6 npm -g install npm@4\n+ - IF %nodejs_version% EQU 8 npm -g install npm@5.4.0\n- yarn --frozen-lockfile\nbefore_test:\n", "new_path": "appveyor.yml", "old_path": "appveyor.yml" } ]
JavaScript
MIT License
lerna/lerna
ci: synchronize upgraded npm across matrix, using 5.4.0 in node v8.x
1
ci
null
573,227
30.08.2017 23:58:10
-7,200
63066954b8945b63fe91d252b7d35e1df70d35e1
docs(plugins): Document undocumented parser options
[ { "change_type": "MODIFY", "diff": "@@ -258,7 +258,10 @@ server.use(restify.plugins.bodyParser({\nuploadDir: os.tmpdir(),\nmultiples: true,\nhash: 'sha1',\n- rejectUnknown: true\n+ rejectUnknown: true,\n+ requestBodyOnGet: false,\n+ reviver: undefined,\n+ maxFieldsSize: 2 * 1024 * 1024\n}));\n```\n@@ -275,6 +278,9 @@ Options:\n* `multiples` - if you want to support html5 multiple attribute in upload fields.\n* `hash` - If you want checksums calculated for incoming files, set this to either `sha1` or `md5`.\n* `rejectUnknown` - Set to `true` if you want to end the request with a `UnsupportedMediaTypeError` when none of the supported content types was given.\n+* `requestBodyOnGet` - Parse body of a GET request. The default is `false`.\n+* `reviver` - `jsonParser` only. If a function, this prescribes how the value originally produced by parsing is transformed, before being returned. For more information check out [JSON.parse(text[, reviver])](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse). Optional.\n+* `maxFieldsSize` - `multipartParser` only. Limits the amount of memory all fields together (except files) can allocate in bytes. The default size is `2 * 1024 * 1024` bytes *(2MB)*.\n## RequestLogger\n", "new_path": "docs/api/plugins.md", "old_path": "docs/api/plugins.md" } ]
JavaScript
MIT License
restify/node-restify
docs(plugins): Document undocumented parser options (#1469)
1
docs
plugins
448,039
31.08.2017 10:01:15
-7,200
665a24981af6edf308b48dad2814cfdf2cbee831
feat: ng-packagr is released 1.0.0 final
[ { "change_type": "MODIFY", "diff": "\"postbuild\": \"node scripts/postbuild.js\",\n\"schema\": \"json2ts --input src/ng-package.schema.json --output src/ng-package.schema.ts\",\n\"prerelease\": \"yarn build\",\n- \"release\": \"standard-version --message 'chore: cut release for v%s' --prerelease pre\",\n+ \"release\": \"standard-version --message 'chore: cut release for v%s'\",\n\"postrelease\": \"node scripts/prepublish.js\",\n\"publish:ci\": \"yarn prerelease && yarn postrelease\",\n\"samples\": \"integration/samples.sh\",\n", "new_path": "package.json", "old_path": "package.json" } ]
TypeScript
MIT License
ng-packagr/ng-packagr
feat: ng-packagr is released 1.0.0 final
1
feat
null
448,039
31.08.2017 10:08:10
-7,200
8f6f3f2897d361da4d6244f36b3e8875ff0abb8f
chore: cut release for v1.0.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=\"1.0.0\"></a>\n+# [1.0.0](https://github.com/dherges/ng-packagr/compare/v1.0.0-pre.17...v1.0.0) (2017-08-31)\n+\n+\n+### Features\n+\n+* ng-packagr is released 1.0.0 final ([665a249](https://github.com/dherges/ng-packagr/commit/665a249))\n+\n+\n+\n<a name=\"1.0.0-pre.17\"></a>\n# [1.0.0-pre.17](https://github.com/dherges/ng-packagr/compare/v1.0.0-pre.16...v1.0.0-pre.17) (2017-08-28)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"ng-packagr\",\n- \"version\": \"1.0.0-pre.17\",\n+ \"version\": \"1.0.0\",\n\"description\": \"Compile and package a TypeScript library to Angular Package Format\",\n\"keywords\": [\n\"angular\",\n", "new_path": "package.json", "old_path": "package.json" } ]
TypeScript
MIT License
ng-packagr/ng-packagr
chore: cut release for v1.0.0
1
chore
null
448,039
31.08.2017 11:02:51
-7,200
a74c69811f64c3272f8e0263abfe6a2c571948d7
chore: cut release for v1.0.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=\"1.0.1\"></a>\n+## [1.0.1](https://github.com/dherges/ng-packagr/compare/v1.0.0...v1.0.1) (2017-08-31)\n+\n+\n+### Bug Fixes\n+\n+* make a dummy release for 1.0.1 ([a6d6893](https://github.com/dherges/ng-packagr/commit/a6d6893))\n+\n+\n+\n<a name=\"1.0.0\"></a>\n# [1.0.0](https://github.com/dherges/ng-packagr/compare/v1.0.0-pre.17...v1.0.0) (2017-08-31)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"ng-packagr\",\n- \"version\": \"1.0.0\",\n+ \"version\": \"1.0.1\",\n\"description\": \"Compile and package a TypeScript library to Angular Package Format\",\n\"keywords\": [\n\"angular\",\n", "new_path": "package.json", "old_path": "package.json" } ]
TypeScript
MIT License
ng-packagr/ng-packagr
chore: cut release for v1.0.1
1
chore
null
743,863
03.09.2017 12:50:47
25,200
c240661c27a69fdd2bae401919a9ad31ccd1be01
fix: address bug with handling of arrays of implications
[ { "change_type": "MODIFY", "diff": "@@ -255,10 +255,10 @@ module.exports = function validation (yargs, usage, y18n) {\nconst implyFail = []\nObject.keys(implied).forEach((key) => {\n- if (implied[key]) {\n- implied[key].forEach((value) => {\n- let num\nconst origKey = key\n+ ;(implied[key] || []).forEach((value) => {\n+ let num\n+ let key = origKey\n// convert string '1' to number 1\nnum = Number(key)\n@@ -287,12 +287,10 @@ module.exports = function validation (yargs, usage, y18n) {\n} else {\nvalue = argv[value]\n}\n-\nif (key && !value) {\nimplyFail.push(origKey)\n}\n})\n- }\n})\nif (implyFail.length) {\n", "new_path": "lib/validation.js", "old_path": "lib/validation.js" }, { "change_type": "MODIFY", "diff": "@@ -39,32 +39,19 @@ describe('validation tests', () => {\n})\nit('fails if either implied argument is not set', (done) => {\n- let fail1 = false\n- let fail2 = false\n- yargs(['--foo', '-a'])\n- .boolean('foo')\n- .implies({\n- 'foo': ['a', 'b']\n- })\n+ yargs(['-f', '-b'])\n+ .implies('f', ['b', 'c'])\n.fail((msg1) => {\n- fail1 = true\n- yargs(['--foo', '-b'])\n- .boolean('foo')\n- .implies({\n- 'foo': ['a', 'b']\n- })\n+ yargs(['-f', '-c'])\n+ .implies('f', ['b', 'c'])\n.fail((msg2) => {\n- fail2 = true\n- msg1.should.match(/Implications failed/)\n- msg2.should.match(/Implications failed/)\n+ msg1.should.match(/f -> b f -> c/)\n+ msg2.should.match(/f -> b f -> c/)\nreturn done()\n})\n.argv\n})\n.argv\n- // Prevent timeouts\n- fail1.should.be.true\n- fail2.should.be.true\n})\nit(\"fails if --no-foo's implied argument is not set\", (done) => {\n", "new_path": "test/validation.js", "old_path": "test/validation.js" } ]
JavaScript
MIT License
yargs/yargs
fix: address bug with handling of arrays of implications
1
fix
null
743,927
03.09.2017 20:10:28
-3,600
792564d954d5143b2b57b05aaca4007780f5b728
feat: to allow both undefined and nulls, for benefit of TypeScript
[ { "change_type": "MODIFY", "diff": "@@ -384,7 +384,7 @@ function Yargs (processArgs, cwd, parentRequire) {\n}\nself.demandCommand = function demandCommand (min, max, minMsg, maxMsg) {\n- argsert('[number] [number|string] [string|null] [string|null]', [min, max, minMsg, maxMsg], arguments.length)\n+ argsert('[number] [number|string] [string|null|undefined] [string|null|undefined]', [min, max, minMsg, maxMsg], arguments.length)\nif (typeof min === 'undefined') min = 1\n@@ -428,7 +428,7 @@ function Yargs (processArgs, cwd, parentRequire) {\n}\nself.usage = function (msg, opts) {\n- argsert('<string|null|object> [object]', [msg, opts], arguments.length)\n+ argsert('<string|null|undefined|object> [object]', [msg, opts], arguments.length)\nif (!opts && typeof msg === 'object') {\nopts = msg\n@@ -685,7 +685,7 @@ function Yargs (processArgs, cwd, parentRequire) {\n}\nself.wrap = function (cols) {\n- argsert('<number|null>', [cols], arguments.length)\n+ argsert('<number|null|undefined>', [cols], arguments.length)\nusage.wrap(cols)\nreturn self\n}\n", "new_path": "yargs.js", "old_path": "yargs.js" } ]
JavaScript
MIT License
yargs/yargs
feat: to allow both undefined and nulls, for benefit of TypeScript (#945)
1
feat
null
573,195
06.09.2017 12:10:06
25,200
9373cb5e9bb4b9986b98bf0196b9deb00b791f50
New: server `strictNext` option throws when calling next more than once
[ { "change_type": "MODIFY", "diff": "@@ -253,8 +253,9 @@ function Server(options) {\nthis.router = options.router;\nthis.routes = {};\nthis.secure = false;\n- this.versions = options.versions || options.version || [];\nthis.socketio = options.socketio || false;\n+ this._once = (options.strictNext === false) ? once : once.strict;\n+ this.versions = options.versions || options.version || [];\nthis._inflightRequests = 0;\nvar fmt = mergeFormatters(options.formatters);\n@@ -851,9 +852,9 @@ Server.prototype._route = function _route(req, res, name, cb) {\n* for case #3, emitted error events are async and serial. this means the\n* automatic invocation of cb() cannot occur:\n*\n- * 1) `emittedError` - this boolean is set to true when next is called with an\n- * error. this var is used to avoid automatic invocation of cb(), which is\n- * delayed until all async error events are fired.\n+ * 1) `emittingErrors` - this boolean is set to true when the server is still\n+ * emitting error events. this var is used to avoid automatic invocation of\n+ * cb(), which is delayed until all async error events are fired.\n* 2) `done` - when next is invoked with a value of `false`, or handler if\n*\n* @private\n@@ -881,11 +882,8 @@ Server.prototype._run = function _run(req, res, route, chain, cb) {\nvar log = this.log;\nvar self = this;\nvar handlerName = null;\n- var emittedError = false;\n-\n- if (cb) {\n- cb = once(cb);\n- }\n+ var emittingErrors = false;\n+ cb = self._once(cb);\n// attach a listener for 'close' and 'aborted' events, this will let us set\n// a flag so that we can stop processing the request if the client closes\n@@ -914,19 +912,19 @@ Server.prototype._run = function _run(req, res, route, chain, cb) {\nif (typeof arg !== 'undefined') {\nif (arg instanceof Error) {\n// the emitting of the error events are async, so we can not\n- // complete this invocation of run() until it returns. calling\n- // _emitErrorEvents is async, but returns a sync flag. when this\n- // flag is true, we will avoid automatically calling cb at the\n- // end of this function, which causes server to move on to the\n- // next handler in the chain.\n- emittedError = self._emitErrorEvents(req, res, route, arg,\n- function emitErrorsDone() {\n- res.send(arg);\n- return (cb ? cb(arg) : true);\n- });\n+ // complete this invocation of run() until it returns. set a\n+ // flag so that the automatic invocation of cb() at the end of\n+ // this function is bypassed.\n+ emittingErrors = true;\n// set the done flag - allows us to stop execution of handler\n// chain now that an error has occurred.\ndone = true;\n+ // now emit error events in serial and async\n+ self._emitErrorEvents(req, res, route, arg,\n+ function emitErrorsDone() {\n+ res.send(arg);\n+ return cb(arg);\n+ });\n} else if (typeof (arg) === 'string') { // GH-193, allow redirect\nif (req._rstfy_chained_route) {\nvar _e = new errors.InternalError();\n@@ -988,7 +986,7 @@ Server.prototype._run = function _run(req, res, route, chain, cb) {\nreq._currentHandler = handlerName;\nreq.startHandlerTimer(handlerName);\n- var n = once(next);\n+ var n = self._once(next);\n// support ifError only if domains are on\nif (self.handleUncaughtExceptions === true) {\n@@ -1019,17 +1017,20 @@ Server.prototype._run = function _run(req, res, route, chain, cb) {\nself.emit('done', req, res, route);\n}\n- // Don't return cb here if errors are currently being emitted. they are\n- // async, so we cannot fire cb until all error events are done\n- // emitting.\n- if (!emittedError) {\n- return (cb ? cb(arg) : true);\n- } else {\n- return (true);\n+ // if we have reached here, there are no more handlers in the chain, or\n+ // we next(err), and we are done with the request. if errors are still\n+ // being emitted (due to being async), skip calling cb now, that will\n+ // happen after all error events are done being emitted.\n+ if (emittingErrors === false) {\n+ return cb(arg);\n}\n+\n+ // don't really need to return anything, returning null to placate\n+ // eslint.\n+ return null;\n}\n- var n1 = once(next);\n+ var n1 = self._once(next);\ndtrace._rstfy_probes['route-start'].fire(function () {\nreturn ([\n@@ -1104,8 +1105,7 @@ Server.prototype._setupRequest = function _setupRequest(req, res) {\n* @param {Object} route the current route, if applicable\n* @param {Object} err an error object\n* @param {Object} cb callback function\n- * @returns {Boolean} if error events are firing, which is async, return\n- * true. else return false.\n+ * @returns {undefined}\n*/\nServer.prototype._emitErrorEvents =\nfunction _emitErrorEvents(req, res, route, err, cb) {\n@@ -1132,7 +1132,7 @@ function _emitErrorEvents(req, res, route, err, cb) {\n}\n// kick off the async listeners\n- vasync.forEachPipeline({\n+ return vasync.forEachPipeline({\ninputs: errEvtNames,\nfunc: function emitError(errEvtName, vasyncCb) {\nself.emit(errEvtName, req, res, err, function emitErrDone() {\n@@ -1147,10 +1147,6 @@ function _emitErrorEvents(req, res, route, err, cb) {\n// error to pass it on.\nreturn cb(err);\n});\n-\n- // while async listeners are firing, return a boolean indicating whether or\n- // not we had any listeners to fire.\n- return (errEvtNames.length > 0) ? true : false;\n};\n", "new_path": "lib/server.js", "old_path": "lib/server.js" }, { "change_type": "MODIFY", "diff": "@@ -2897,3 +2897,22 @@ test('should emit restifyError even for router errors', function (t) {\nt.done();\n});\n});\n+\n+\n+test('calling next twice should throw', function (t) {\n+ SERVER.get('/', function (req, res, next) {\n+ res.send(200);\n+ next();\n+ next();\n+ });\n+\n+ SERVER.on('uncaughtException', function (req, res, route, err) {\n+ t.ok(err);\n+ t.equal(err.message, 'next shouldn\\'t be called more than once');\n+ t.end();\n+ });\n+\n+ CLIENT.get('/', function (err, req, res, data) {\n+ t.ifError(err);\n+ });\n+});\n", "new_path": "test/server.test.js", "old_path": "test/server.test.js" } ]
JavaScript
MIT License
restify/node-restify
New: server `strictNext` option throws when calling next more than once (#1454)
1
new
null
573,195
08.09.2017 10:59:52
25,200
33dc141eb8d67e414456b3059f51e537e06ccf49
docs: more detailed plugin docs
[ { "change_type": "MODIFY", "diff": "@@ -32,21 +32,141 @@ server.use(restify.plugins.throttle({\nserver.use(restify.plugins.conditionalRequest());\n```\n-## Available Plugins\n+## `server.pre()` plugins\n+\n+This module includes various pre plugins, which are intended to be used prior\n+to routing of the URL. To use a plugin before routing, use the `server.pre()`\n+method.\n+\n+### `restify.plugins.pre.context()`\n+\n+This plugin creates `req.set(key, val)` and `req.get(key)` methods for setting\n+and retrieving request specific data.\n+\n+Example:\n+\n+```js\n+server.pre(restify.plugins.pre.context());\n+server.get('/', [\n+ function(req, res, next) {\n+ req.set(myMessage, 'hello world');\n+ return next();\n+ },\n+ function two(req, res, next) {\n+ res.send(req.get(myMessage)); // => sends 'hello world'\n+ return next();\n+ }\n+]);\n+```\n+\n+### `restify.plugins.pre.dedupeSlashes()`\n+\n+This plugin deduplicates extra slashes found in the URL. This can help with\n+malformed URLs that might otherwise get misrouted.\n+\n+Exmaple:\n+\n+```js\n+server.pre(restify.plugins.pre.dedupeSlashes());\n+server.get('/hello/:one', function(req, res, next) {\n+ res.send(200);\n+ return next();\n+});\n+\n+// the server will now convert requests to /hello//jake => /hello/jake\n+```\n+\n+### `restify.plugins.pre.reqIdHeaders(opts)`\n+\n+This plugin pulls the value from an incoming request header and uses it as the\n+value of the request id. Subsequent calls to `req.id()` will return the header\n+values.\n+\n+* `opts` {Object} an options object\n+* `options.headers` {Array} an array of header names to use. lookup precedence\n+ is left to right (lowest index first)\n+\n+### `restify.plugins.pre.strictQueryParams(opts)`\n+\n+This plugins disallows sloppy query params. `?key=value&value2` would\n+normally result in a value of `{ key: value, value2: '' }`, but with this plugin\n+enabled the request is rejected with a `BadRequestError` (400).\n+\n+* `opts` {Object} an options object\n+* `opts.message` {String} a custom error message\n+\n+### `restify.plugins.pre.userAgentConnection(opts)`\n+\n+For curl user-agents, this plugin sets a `connection: close` header, and\n+removes the content-length header for HEAD requests. A custom regexp can be\n+crafted to target other user-agents. Note that passing in `userAgentRegExp`\n+overriddes the default regexp matching curl agents.\n+\n+* `opts` {Object} an options object\n+* `opts.userAgentRegExp` {RegExp} regexp matching any user-agents applicable\n-* `sanitizePath()` - cleans up duplicate or trailing / on the URL\n-* `context()` - Provide req.set(key, val) and req.get(key) methods for setting and retrieving context to a specific request.\n-* `userAgent(options)` - used to support edge cases for HEAD requests when using curl\n- * `options.userAgentRegExp` {RegExp} regexp to capture curl user-agents\n-* `strictQueryParams()` - checks req.urls query params with strict key/val format and rejects non-strict requests with status code 400.\n- * `options.message` {String} response body message string\n-This module includes the following header parser plugins:\n-* `acceptParser(accepts)` - Accept header\n+## `server.use()` plugins\n+\n+### `restify.plugins.acceptParser(accepts)`\n+\n+Parses the `Accept` header, and ensures that the server can respond to what\n+the client asked for. In almost all cases passing in `server.acceptable` is\n+all that's required, as that's an array of content types the server knows\n+how to respond to (with the formatters you've registered). If the request is\n+for a non-handled type, this plugin will return a `NotAcceptableError` (406).\n+\n* `accepts` {Array} an array of acceptable types\n-* `authorizationParser(options)` - Authorization header\n- * `options` {Object} options object passed to http-signature module\n+\n+Example:\n+\n+```js\n+server.use(restify.plugins.acceptParser(server.acceptable));\n+```\n+\n+### `restify.plugins.authorizationParser(opts)`\n+Parses out the `Authorization` header as best restify can. Currently only HTTP\n+Basic Auth and [HTTP Signature](https://github.com/joyent/node-http-signature)\n+schemes are supported.\n+\n+* `opts` {Object} an optional options object that is passed to http-signature\n+\n+If successfully parsed, `req.authorization` will be set:\n+\n+```js\n+{\n+ scheme: <Basic|Signature|...>,\n+ credentials: <Undecoded value of header>,\n+ basic: {\n+ username: $user\n+ password: $password\n+ }\n+}\n+```\n+\n+`req.username` will also be set, and defaults to 'anonymous'. If the scheme\n+is unrecognized, the only thing available in `req.authorization` will be\n+`scheme` and `credentials` - it will be up to you to parse out the rest.\n+\n+\n+### `restify.plugins.dateParser(sec)`\n+\n+Parses out the HTTP Date header (if present) and checks for clock skew. If the\n+header is invalid, a `InvalidHeaderError` (400) is returned. If the clock skew\n+exceeds the specified value, a `RequestExpiredError` (400) is returned.\n+\n+* `sec` {Number} allowed clock skew in seconds. defaults to 300s, like Kerberos\n+\n+```js\n+// Allows clock skew of 1m\n+server.use(restify.plugins.dateParser(60));\n+```\n+\n+## TBD to be organized\n+\n+This module includes the following header parser plugins:\n+\n* `conditionalRequest()` - Conditional headers (If-\\*)\n* `fullResponse()` - handles disappeared CORS headers\n@@ -86,17 +206,8 @@ This module includes the following data parsing plugins:\n* `requestLogger(options)` - adds timers for each handler in your request chain\n* `options.properties` {Object} properties to pass to bunyan's `log.child()` method\n-The module includes the following request plugins:\n-\n-* `reqIdHeaders(options)` - a plugin that lets you use incoming request header\n- values to set the request id (5.x compatible only)\n- * `options.headers` {Array} an array of header names to use. lookup\n- precedence is left to right (lowest index first)\n-\nThe module includes the following response plugins:\n-* `dateParser(delta)` - expires requests based on current time + delta\n- * `delta` {Number} age in seconds\n* `gzip(options)` - gzips the response if client accepts it\n* `options` {Object} options to pass to zlib\n* `serveStatic()` - used to serve static files\n@@ -152,60 +263,6 @@ The module includes the following plugins to be used with restify's `pre` event:\n* `options.err` {Error} opts.err A restify error used as a response when the inflight request limit is exceeded\n* `options.server` {Object} The restify server that this module will throttle\n-## Accept Parser\n-\n-Parses out the `Accept` header, and ensures that the server can respond to what\n-the client asked for. You almost always want to just pass in\n-`server.acceptable` here, as that's an array of content types the server knows\n-how to respond to (with the formatters you've registered). If the request is\n-for a non-handled type, this plugin will return an error of `406`.\n-\n-```js\n-server.use(restify.plugins.acceptParser(server.acceptable));\n-```\n-\n-## Authorization Parser\n-\n-```js\n-server.use(restify.authorizationParser());\n-```\n-\n-Parses out the `Authorization` header as best restify can. Currently only\n-HTTP Basic Auth and\n-[HTTP Signature](https://github.com/joyent/node-http-signature)\n-schemes are supported. When this is used, `req.authorization` will be set\n-to something like:\n-\n-```js\n-{\n- scheme: <Basic|Signature|...>,\n- credentials: <Undecoded value of header>,\n- basic: {\n- username: $user\n- password: $password\n- }\n-}\n-```\n-\n-`req.username` will also be set, and defaults to 'anonymous'. If the scheme\n-is unrecognized, the only thing available in `req.authorization` will be\n-`scheme` and `credentials` - it will be up to you to parse out the rest.\n-\n-\n-## Date Parser\n-\n-```js\n-server.use(restify.plugins.dateParser());\n-```\n-\n-Parses out the HTTP Date header (if present) and checks for clock skew (default\n-allowed clock skew is 300s, like Kerberos). You can pass in a number, which is\n-interpreted in seconds, to allow for clock skew.\n-\n-```js\n-// Allows clock skew of 1m\n-server.use(restify.plugins.dateParser(60));\n-```\n## QueryParser\n", "new_path": "docs/api/plugins.md", "old_path": "docs/api/plugins.md" } ]
JavaScript
MIT License
restify/node-restify
docs: more detailed plugin docs (#1474)
1
docs
null
573,190
08.09.2017 15:04:47
25,200
84be6799c4a80ae67f3aa03165c8031a55bddc97
feat: cpuUsageThrottle
[ { "change_type": "MODIFY", "diff": "@@ -260,8 +260,14 @@ event, e.g., `server.on('after', plugins.metrics());`:\nThe module includes the following plugins to be used with restify's `pre` event:\n* `inflightRequestThrottle(options)` - limits the max number of inflight requests\n* `options.limit` {Number} the maximum number of inflight requests the server will handle before returning an error\n- * `options.err` {Error} opts.err A restify error used as a response when the inflight request limit is exceeded\n+ * `options.err` {Error} A restify error used as a response when the inflight request limit is exceeded\n* `options.server` {Object} The restify server that this module will throttle\n+* `cpuUsageThrottle(options)`- Reject requests based on the server's current CPU usage\n+ * `options.limit` - {Number} The point at which restify will begin rejecting a % of all requests at the front door.\n+ * `options.max` - {Number} The point at which restify will reject 100% of all requests at the front door.\n+ * `options.interval` - {Number} How frequently to recalculate the % of traffic to be rejecting.\n+ * `options.halfLife` - {Number} How responsive your application will be to spikes in CPU usage, for more details read the cpuUsageThrottle section below.\n+ * `options.err` - {Error} A restify error used as a response when the cpu usage limit is exceeded\n## QueryParser\n@@ -525,6 +531,44 @@ requests. It defaults to `503 ServiceUnavailableError`.\nThis plugin should be registered as early as possibly in the middleware stack\nusing `pre` to avoid performing unnecessary work.\n+## CPU Usage Throttling\n+\n+```js\n+var restify = require('restify');\n+\n+var server = restify.createServer();\n+const options = {\n+ limit: .75,\n+ max: 1,\n+ interval: 250,\n+ halfLife: 500,\n+}\n+\n+server.pre(restify.plugins.cpuUsageThrottle(options));\n+```\n+\n+cpuUsageThrottle is a middleware that rejects a variable number of requests (between 0% and 100%) based on a historical view of CPU utilization of a Node.js process. Essentially, this plugin allows you to define what constitutes a saturated Node.js process via CPU utilization and it will handle dropping a % of requests based on that definiton. This is useful when you would like to keep CPU bound tasks from piling up causing an increased per-request latency.\n+\n+The algorithm asks you for a maximum CPU utilization rate, which it uses to determine at what point it should be rejecting 100% of traffic. For a normal Node.js service, this is 1 since Node is single threaded. It uses this, paired with a limit that you provide to determine the total % of traffic it should be rejecting. For example, if you specify a limit of .5 and a max of 1, and the current EWMA (next paragraph) value reads .75, this plugin will reject approximately 50% of all requests.\n+\n+When looking at the process' CPU usage, this algorithm will take a load average over a user specified interval. For example, if given an interval of 250ms, this plugin will attempt to record the average CPU utilization over 250ms intervals. Due to contention for resources, the duration of each average may be wider or narrower than 250ms. To compensate for this, we use an exponentially weighted moving average. The EWMA algorithm is provided by the ewma module. The parameter for configuring the EWMA is halfLife. This value controls how quickly each load average measurment decays to half it's value when being represented in the current average. For example, if you have an interval of 250, and a halfLife of 250, you will take the previous ewma value multiplied by .5 and add it to the new CPU utilization average measurement multiplied by .5. The previous value and the new measurement would each represent 50% of the new value. A good way of thinking about the halfLife is in terms of how responsive this plugin will be to spikes in CPU utilization. The higher the halfLife, the longer CPU utilization will have to remain above your defined limit before this plugin begins rejecting requests and, converserly, the longer it will have to drop below your limit before the plugin begins accepting requests again. This is a knob you will want to with play when trying to determine the ideal value for your use case.\n+\n+For a better understanding of the EWMA algorithn, refer to the documentation for the ewma module.\n+\n+Params:\n+ * `limit` - The point at which restify will begin rejecting a % of all requests at the front door. This value is a percentage. For example `0.8` === 80% average CPU utilization. Defaults to `0.75`.\n+ * `max` - The point at which restify will reject 100% of all requests at the front door. This is used in conjunction with limit to determine what % of traffic restify needs to reject when attempting to bring the average load back within tolerable thresholds. Since Node.js is single threaded, the default for this is `1`. In some rare cases, a Node.js process can exceed 100% CPU usage and you will want to update this value.\n+ * `interval` - How frequently we calculate the average CPU utilization. When we calculate an average CPU utilization, we calculate it over this interval, and this drives whether or not we should be shedding load. This can be thought of as a \"resolution\" where the lower this value, the higher the resolution our load average will be and the more frequently we will recalculate the % of traffic we should be shedding. This check is rather lightweight, while the default is 250ms, you should be able to decrease this value without seeing a significant impact to performance.\n+ * `halfLife` - When we sample the CPU usage on an interval, we create a series of data points. We take these points and calculate a moving average. The halfLife indicates how quickly a point \"decays\" to half it's value in the moving average. The lower the halfLife, the more impact newer data points have on the average. If you want to be extremely responsive to spikes in CPU usage, set this to a lower value. If you want your process to put more emphasis on recent historical CPU usage when determininng whether it should shed load, set this to a higher value. The unit is in ms. Defaults to `250`.\n+\n+You can also update the plugin during runtime using the `.update()` function. This function accepts the same `opts` object as a constructor.\n+\n+```js\n+var plugin = restify.plugins.cpuUsageThrottle(options);\n+server.pre(plugin);\n+\n+plugin.update({ limit: .4, halfLife: 5000 });\n+```\n## Conditional Request Handler\n", "new_path": "docs/api/plugins.md", "old_path": "docs/api/plugins.md" }, { "change_type": "ADD", "diff": "+'use strict';\n+\n+var assert = require('assert-plus');\n+var pidusage = require('pidusage');\n+var errors = require('restify-errors');\n+var EWMA = require('ewma');\n+\n+/**\n+ * cpuUsageThrottle\n+ *\n+ * cpuUsageThrottle is a middleware that rejects a variable number of requests\n+ * (between 0% and 100%) based on a historical view of CPU utilization of a\n+ * Node.js process. Essentially, this plugin allows you to define what\n+ * constitutes a saturated Node.js process via CPU utilization and it will\n+ * handle dropping a % of requests based on that definiton. This is useful when\n+ * you would like to keep CPU bound tasks from piling up causing an increased\n+ * per-request latency.\n+ *\n+ * The algorithm asks you for a maximum CPU utilization rate, which it uses to\n+ * determine at what point it should be rejecting 100% of traffic. For a normal\n+ * Node.js service, this is 1 since Node is single threaded. It uses this,\n+ * paired with a limit that you provide to determine the total % of traffic it\n+ * should be rejecting. For example, if you specify a limit of .5 and a max of\n+ * 1, and the current EWMA (next paragraph) value reads .75, this plugin will\n+ * reject approximately 50% of all requests.\n+ *\n+ * When looking at the process' CPU usage, this algorithm will take a load\n+ * average over a user specified interval. example, if given an interval of\n+ * 250ms, this plugin will attempt to record the average CPU utilization over\n+ * 250ms intervals. Due to contention for resources, the duration of each\n+ * average may be wider or narrower than 250ms. To compensate for this, we use\n+ * an exponentially weighted moving average. The EWMA algorithm is provided by\n+ * the ewma module. The parameter for configuring the EWMA is halfLife. This\n+ * value controls how quickly each load average measurment decays to half it's\n+ * value when being represented in the current average. For example, if you\n+ * have an interval of 250, and a halfLife of 250, you will take the previous\n+ * ewma value multiplied by 0.5 and add it to the new CPU utilization average\n+ * measurement multiplied by 0.5. The previous value and the new measurement\n+ * would each represent 50% of the new value. A good way of thinking about the\n+ * halfLife is in terms of how responsive this plugin will be to spikes in CPU\n+ * utilization. The higher the halfLife, the longer CPU utilization will have\n+ * to remain above your defined limit before this plugin begins rejecting\n+ * requests and, converserly, the longer it will have to drop below your limit\n+ * before the plugin begins accepting requests again. This is a knob you will\n+ * want to with play when trying to determine the ideal value for your use\n+ * case.\n+ *\n+ * For a better understanding of the EWMA algorithn, refer to the documentation\n+ * for the ewma module.\n+ *\n+ * @param {Object} opts Configure this plugin.\n+ * @param {Number} [opts.limit] The point at which restify will begin rejecting\n+ * a % of all requests at the front door. This value is a percentage.\n+ * For example 0.8 === 80% average CPU utilization. Defaults to 0.75.\n+ * @param {Number} [opts.max] The point at which restify will reject 100% of all\n+ * requests at the front door. This is used in conjunction with limit to\n+ * determine what % of traffic restify needs to reject when attempting to\n+ * bring the average load back to the user requested values. Since Node.js is\n+ * single threaded, the default for this is 1. In some rare cases, a Node.js\n+ * process can exceed 100% CPU usage and you will want to update this value.\n+ * @param {Number} [opts.interval] How frequently we calculate the average CPU\n+ * utilization. When we calculate an average CPU utilization, we calculate it\n+ * over this interval, and this drives whether or not we should be shedding\n+ * load. This can be thought of as a \"resolution\" where the lower this value,\n+ * the higher the resolution our load average will be and the more frequently\n+ * we will recalculate the % of traffic we should be shedding. This check\n+ * is rather lightweight, while the default is 250ms, you should be able to\n+ * decrease this value without seeing a significant impact to performance.\n+ * @param {Number} [opts.halfLife] When we sample the CPU usage on an interval,\n+ * we create a series of data points. We take these points and calculate a\n+ * moving average. The halfLife indicates how quickly a point \"decays\" to\n+ * half it's value in the moving average. The lower the halfLife, the more\n+ * impact newer data points have on the average. If you want to be extremely\n+ * responsive to spikes in CPU usage, set this to a lower value. If you want\n+ * your process to put more emphasis on recent historical CPU usage when\n+ * determininng whether it should shed load, set this to a higher value. The\n+ * unit is in ms. Defaults to 250.\n+ * @returns {Function} middleware to be registered on server.pre\n+ */\n+function cpuUsageThrottle (opts) {\n+\n+ // Scrub input and populate our configuration\n+ assert.object(opts, 'opts');\n+ assert.optionalNumber(opts.limit, 'opts.limit');\n+ assert.optionalNumber(opts.max, 'opts.max');\n+ assert.optionalNumber(opts.interval, 'opts.interval');\n+ assert.optionalNumber(opts.halfLife, 'opts.halfLife');\n+\n+ var self = {};\n+ self._limit = (typeof opts.limit === 'number') ?\n+ opts.limit : 0.75;\n+ self._max = opts.max || 1;\n+ self._interval = opts.interval || 250;\n+ self._halfLife = (typeof opts.halfLife === 'number') ? opts.halfLife : 250;\n+ assert.ok(self._max > self._limit, 'limit must be less than max');\n+\n+ self._ewma = new EWMA(self._halfLife);\n+\n+ // self._reject represents the % of traffic that we should reject at the\n+ // current point in time based on how much over our limit we are. This is\n+ // updated on an interval by updateReject().\n+ self._reject = 0;\n+\n+ // self._timeout keeps track of the current handle for the setTimeout we\n+ // use to gather CPU load averages, this allows us to cancel the timeout\n+ // when shutting down restify.\n+ self._timeout = null;\n+ // self._timeoutDelta represents the amount of time between when we _should_\n+ // have run updateReject and the actual time it was invoked. This allows\n+ // us to monitor lag caused by both the event loop and pidusage.stat\n+ self._timeoutDelta = 0;\n+ self._timeoutStart = Date.now();\n+\n+ // updateReject should be called on an interval, it checks the average CPU\n+ // usage between two invocations of updateReject.\n+ function updateReject() {\n+ pidusage.stat(process.pid, function (e, stat) {\n+ // If we were unable to get cpu usage, don't make any new decisions.\n+ if (!stat ||\n+ typeof stat.cpu !== 'number' ||\n+ Number.isNaN(stat.cpu)) {\n+ return;\n+ }\n+\n+ // Divide by 100 to match Linux's `top` format\n+ self._ewma.insert(stat.cpu / 100);\n+ self._cpu = self._ewma.value();\n+\n+ // Update reject with the % of traffic we should be rejecting. This\n+ // is safe since max > limit so the denominator can never be 0. If\n+ // the current cpu usage is less that the limit, _reject will be\n+ // negative and we will never shed load\n+ self._reject =\n+ (self._cpu - self._limit) / (self._max - self._limit);\n+ self._timeout = setTimeout(updateReject, self._interval);\n+ var now = Date.now();\n+ self._timeoutDelta = now - self._timeoutStart;\n+ self._timeoutStart = now;\n+ });\n+ }\n+\n+ // Kick off updating our _reject value\n+ updateReject();\n+\n+ function onRequest (req, res, next) {\n+ // Check to see if this request gets rejected. Since, in updateReject,\n+ // we calculate a percentage of traffic we are planning to reject, we\n+ // can use Math.random() (which picks from a uniform distribution in\n+ // [0,1)) to give us a `self._reject`% chance of dropping any given\n+ // request. This is a stateless was to drop approximatly `self._reject`%\n+ // of traffic.\n+ var probabilityDraw = Math.random();\n+\n+ if (probabilityDraw >= self._reject) {\n+ return next(); // Don't reject this request\n+ }\n+\n+ var err = new errors.ServiceUnavailableError({\n+ context: {\n+ plugin: 'cpuUsageThrottle',\n+ cpuUsage: self._cpu,\n+ limit: self._limit,\n+ max: self._max,\n+ reject: self._reject,\n+ halfLife: self._halfLife,\n+ interval: self._interval,\n+ probabilityDraw: probabilityDraw,\n+ lag: self._timeoutDelta\n+ }\n+ });\n+\n+ return next(err);\n+ }\n+\n+ // Allow the app to clear the timeout for this plugin if necessary, without\n+ // this we would never be able to clear the event loop when letting Node\n+ // shut down gracefully\n+ function close () {\n+ clearTimeout(self._timeout);\n+ }\n+ onRequest.close = close;\n+\n+ // Expose internal plugin state for introspection\n+ Object.defineProperty(onRequest, 'state', {\n+ get: function () {\n+ // We intentionally do not expose ewma since we don't want the user\n+ // to be able to update it's configuration, the current state of\n+ // ewma is represented in self._cpu\n+ return {\n+ limit: self._limit,\n+ max: self._max,\n+ interval: self._interval,\n+ halfLife: self._halfLife,\n+ cpuUsage: self._cpu,\n+ reject: self._reject,\n+ lag: self._timeoutDelta\n+ };\n+ }\n+ });\n+\n+ /**\n+ * cpuUsageThrottle.update\n+ *\n+ * Allow the plugin's configuration to be updated during runtime.\n+ *\n+ * @param {Object} newOpts The opts object for reconfiguring this plugin,\n+ * it follows the same format as the constructor for this plugin.\n+ * @returns {undefined}\n+ */\n+ onRequest.update = function update(newOpts) {\n+ assert.object(newOpts, 'newOpts');\n+ assert.optionalNumber(newOpts.limit, 'newOpts.limit');\n+ assert.optionalNumber(newOpts.max, 'newOpts.max');\n+ assert.optionalNumber(newOpts.interval, 'newOpts.interval');\n+ assert.optionalNumber(newOpts.halfLife, 'newOpts.halfLife');\n+\n+ if (newOpts.limit !== undefined) {\n+ self._limit = newOpts.limit;\n+ }\n+\n+ if (newOpts.max !== undefined) {\n+ self._max = newOpts.max;\n+ }\n+\n+ if (newOpts.interval !== undefined) {\n+ self._interval = newOpts.interval;\n+ }\n+\n+ if (newOpts.halfLife !== undefined) {\n+ self._halfLife = newOpts.halfLife;\n+ // update our ewma with the new halfLife, we use the previous known\n+ // state as the initial state for our new halfLife in lieu of\n+ // having access to true historical data.\n+ self._ewma = new EWMA(self._halfLife, self._cpu);\n+ }\n+\n+ // Ensure new values are still valid\n+ assert.ok(self._max > self._limit, 'limit must be less than max');\n+\n+ // Update _reject with the new settings\n+ self._reject =\n+ (self._cpu - self._limit) / (self._max - self._limit);\n+ };\n+\n+ return onRequest;\n+}\n+\n+module.exports = cpuUsageThrottle;\n", "new_path": "lib/plugins/cpuUsageThrottle.js", "old_path": null }, { "change_type": "MODIFY", "diff": "@@ -11,6 +11,7 @@ module.exports = {\nbodyParser: require('./bodyParser'),\nbodyReader: require('./bodyReader'),\nconditionalRequest: require('./conditionalRequest'),\n+ cpuUsageThrottle: require('./cpuUsageThrottle.js'),\ndateParser: require('./date'),\nfullResponse: require('./fullResponse'),\ngzipResponse: require('./gzip'),\n", "new_path": "lib/plugins/index.js", "old_path": "lib/plugins/index.js" }, { "change_type": "MODIFY", "diff": "\"clone-regexp\": \"^1.0.0\",\n\"csv\": \"^1.1.0\",\n\"escape-regexp-component\": \"^1.0.2\",\n+ \"ewma\": \"^2.0.1\",\n\"formidable\": \"^1.0.17\",\n\"http-signature\": \"^1.0.0\",\n\"lodash\": \"^4.17.4\",\n\"mime\": \"^1.4.0\",\n\"negotiator\": \"^0.6.1\",\n\"once\": \"^1.3.0\",\n+ \"pidusage\": \"^1.1.6\",\n\"qs\": \"^6.2.1\",\n\"restify-errors\": \"^5.0.0\",\n\"semver\": \"^5.0.1\",\n\"mocha\": \"^3.2.0\",\n\"nodeunit\": \"^0.11.0\",\n\"nsp\": \"^2.2.0\",\n+ \"proxyquire\": \"^1.8.0\",\n\"restify-clients\": \"^1.2.1\",\n\"rimraf\": \"^2.4.3\",\n\"validator\": \"^7.0.0\",\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "ADD", "diff": "+'use strict';\n+\n+var assert = require('chai').assert;\n+var proxyquire = require('proxyquire');\n+var restify = require('../../lib/index.js');\n+var restifyClients = require('restify-clients');\n+\n+// Allow tests to set the CPU usage returned by pidUsage\n+var CPU = 50;\n+\n+var cpuUsageThrottle = proxyquire('../../lib/plugins/cpuUsageThrottle.js', {\n+ pidusage: {\n+ stat: function (pid, cb) {\n+ return cb(null, { cpu: CPU });\n+ }\n+ }\n+});\n+\n+var MR = Math.random;\n+describe('cpuUsageThrottle', function () {\n+\n+ before('Setup: stub math.random', function (done) {\n+ Math.random = function () {\n+ return 0;\n+ };\n+ done();\n+ });\n+\n+ it('Unit: Should shed load', function (done) {\n+ var opts = { limit: 0, interval: 500 };\n+ var plugin = cpuUsageThrottle(opts);\n+ function next (cont) {\n+ clearTimeout(plugin._timeout);\n+ assert(cont instanceof Error, 'Should call next with error');\n+ assert.equal(cont.statusCode, 503, 'Defaults to 503 status');\n+ done();\n+ }\n+ plugin({}, {}, next);\n+ });\n+\n+ it('Unit: Should let request through when not under load', function (done) {\n+ var opts = { interval: 500, limit: 0.9 };\n+ var plugin = cpuUsageThrottle(opts);\n+ function next (cont) {\n+ assert.isUndefined(cont, 'Should call next');\n+ clearTimeout(plugin._timeout);\n+ done();\n+ }\n+ plugin({}, {}, next);\n+ });\n+\n+ it('Unit: Update should update state', function (done) {\n+ var opts = {\n+ max: 1,\n+ limit: 0.9,\n+ halfLife: 50,\n+ interval: 50\n+ };\n+ var plugin = cpuUsageThrottle(opts);\n+ opts = {\n+ max: 0.5,\n+ limit: 0.1,\n+ halfLife: 1000,\n+ interval: 1000\n+ };\n+ plugin.update(opts);\n+ assert.equal(plugin.state.limit, opts.limit, 'opts.limit');\n+ assert.equal(plugin.state.max, opts.max, 'opts.max');\n+ assert.equal(plugin.state.halfLife, opts.halfLife, 'opts.halfLife');\n+ assert.equal(plugin.state.interval, opts.interval, 'opts.interval');\n+ plugin.close();\n+ done();\n+ });\n+\n+\n+ it('Integration: Should shed load', function (done) {\n+ var server = restify.createServer();\n+ var client = {\n+ close: function () {}\n+ };\n+ var opts = { interval: 500, limit: 0 };\n+ var plugin = cpuUsageThrottle(opts);\n+ server.pre(plugin);\n+ server.get('/foo', function (req, res, next) {\n+ res.send(200);\n+ next();\n+ });\n+ server.listen(0, '127.0.0.1', function () {\n+ client = restifyClients.createJsonClient({\n+ url: 'http://127.0.0.1:' + server.address().port,\n+ retry: false\n+ });\n+ client.get({ path: '/foo' }, function (e, _, res) {\n+ assert(e, 'Second request is shed');\n+ assert.equal(res.statusCode, 503,\n+ 'Default shed status code returned');\n+ clearTimeout(plugin._timeout);\n+ done();\n+ });\n+ });\n+ });\n+\n+ after('Teardown: Reset Math.random', function (done) {\n+ Math.random = MR;\n+ done();\n+ });\n+});\n", "new_path": "test/plugins/cpuUsageThrottle.test.js", "old_path": null } ]
JavaScript
MIT License
restify/node-restify
feat: cpuUsageThrottle (#1460)
1
feat
null
573,227
10.09.2017 08:38:23
-7,200
33b0e901557f8f4796e0eb33e13042e6a40f28b9
chore(makefile): do not use shrinkwrap file to run nap check
[ { "change_type": "MODIFY", "diff": "@@ -31,9 +31,8 @@ NPM := npm\n#\nDOC_FILES = index.restdown\nJS_FILES = '.'\n-SHRINKWRAP = npm-shrinkwrap.json\n-CLEAN_FILES += node_modules $(SHRINKWRAP) cscope.files\n+CLEAN_FILES += node_modules cscope.files\ninclude ./tools/mk/Makefile.defs\n@@ -65,9 +64,7 @@ test: $(NODEUNIT)\n.PHONY: nsp\nnsp: node_modules $(NSP)\n- @$(NPM) shrinkwrap --dev\n@($(NSP) check) | $(NSP_BADGE)\n- @rm $(SHRINKWRAP)\ninclude ./tools/mk/Makefile.deps\ninclude ./tools/mk/Makefile.targ\n", "new_path": "Makefile", "old_path": "Makefile" } ]
JavaScript
MIT License
restify/node-restify
chore(makefile): do not use shrinkwrap file to run nap check (#1482)
1
chore
makefile
573,190
11.09.2017 09:52:18
25,200
e4ffe430b47a2b51fe5fbef00dfa8bd3a1fb66c1
fix(cpuUsageThrottle): Always queue a new timeout
[ { "change_type": "MODIFY", "diff": "@@ -105,6 +105,7 @@ function cpuUsageThrottle (opts) {\n// use to gather CPU load averages, this allows us to cancel the timeout\n// when shutting down restify.\nself._timeout = null;\n+\n// self._timeoutDelta represents the amount of time between when we _should_\n// have run updateReject and the actual time it was invoked. This allows\n// us to monitor lag caused by both the event loop and pidusage.stat\n@@ -115,6 +116,10 @@ function cpuUsageThrottle (opts) {\n// usage between two invocations of updateReject.\nfunction updateReject() {\npidusage.stat(process.pid, function (e, stat) {\n+ // Requeue an updateReject irrespective of whether or not pidusage\n+ // encountered an error\n+ self._timeout = setTimeout(updateReject, self._interval);\n+\n// If we were unable to get cpu usage, don't make any new decisions.\nif (!stat ||\ntypeof stat.cpu !== 'number' ||\n@@ -132,7 +137,10 @@ function cpuUsageThrottle (opts) {\n// negative and we will never shed load\nself._reject =\n(self._cpu - self._limit) / (self._max - self._limit);\n- self._timeout = setTimeout(updateReject, self._interval);\n+\n+ // Calculate how long it took between when our interval should have\n+ // updated the _reject value and how long it actually took. This\n+ // metric accounts for the misbehaviour of pidusage.stat\nvar now = Date.now();\nself._timeoutDelta = now - self._timeoutStart;\nself._timeoutStart = now;\n", "new_path": "lib/plugins/cpuUsageThrottle.js", "old_path": "lib/plugins/cpuUsageThrottle.js" } ]
JavaScript
MIT License
restify/node-restify
fix(cpuUsageThrottle): Always queue a new timeout (#1484)
1
fix
cpuUsageThrottle
448,039
12.09.2017 13:55:19
-7,200
40312fea2c74097441fcb2e800a9351cdb9715f7
chore: cut release for v1.1.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=\"1.1.0\"></a>\n+# [1.1.0](https://github.com/dherges/ng-packagr/compare/v1.0.1...v1.1.0) (2017-09-12)\n+\n+\n+### Features\n+\n+* add stylus preprocessor support ([#120](https://github.com/dherges/ng-packagr/issues/120)) ([19933cd](https://github.com/dherges/ng-packagr/commit/19933cd))\n+\n+\n+\n<a name=\"1.0.1\"></a>\n## [1.0.1](https://github.com/dherges/ng-packagr/compare/v1.0.0...v1.0.1) (2017-08-31)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"ng-packagr\",\n- \"version\": \"1.0.1\",\n+ \"version\": \"1.1.0\",\n\"description\": \"Compile and package a TypeScript library to Angular Package Format\",\n\"keywords\": [\n\"angular\",\n", "new_path": "package.json", "old_path": "package.json" } ]
TypeScript
MIT License
ng-packagr/ng-packagr
chore: cut release for v1.1.0
1
chore
null
573,227
12.09.2017 17:49:08
-7,200
866d516159df2c8aaa063e688e6787ad84cba851
chore(examples): remove deprecated CORS
[ { "change_type": "DELETE", "diff": "-var restify = require('./lib');\n-\n-var srv = restify.createServer();\n-srv.use(restify.CORS());\n-\n-function foo(req, res, next) {\n- res.send(204);\n- next();\n-}\n-\n-srv.put('/foo', foo);\n-srv.get('/foo', foo);\n-srv.del('/foo', foo);\n-srv.post('/foo', foo);\n-\n-srv.listen(8080);\n", "new_path": null, "old_path": "examples/CORS/cors.js" } ]
JavaScript
MIT License
restify/node-restify
chore(examples): remove deprecated CORS (#1485)
1
chore
examples
573,227
12.09.2017 17:59:24
-7,200
9a1040aa5166232dd3a5c5acd46e6f7fe11ab0f0
chore(examples): fix sockio example
[ { "change_type": "ADD", "diff": "+{\n+ \"name\": \"restify-example\",\n+ \"version\": \"0.0.0\",\n+ \"description\": \"Socket.io example\",\n+ \"main\": \"sockio.js\",\n+ \"dependencies\": {\n+ \"socket.io\": \"2.0.3\"\n+ },\n+ \"scripts\": {\n+ \"start\": \"node sockio.js\"\n+ }\n+}\n", "new_path": "examples/sockio/package.json", "old_path": null }, { "change_type": "MODIFY", "diff": "// Copyright 2012 Mark Cavage, Inc. All rights reserved.\n-var os = require('os');\nvar socketio = require('socket.io');\n-var restify = require('../lib');\n+var restify = require('../../lib');\n///--- Globals\n-var IP = (function () {\n- var nics = os.networkInterfaces();\n- var keys = Object.keys(nics).filter(function (k) {\n- return (nics[k].some(function (n) {\n- return (!n.internal);\n- }));\n- });\n- return (nics[keys.pop()].pop().address);\n-})();\n-\nvar HTML = '<script src=\"/socket.io/socket.io.js\"></script>\\n' +\n'<script>\\n' +\n- 'var socket = io.connect(\"http://' + IP + ':8080\");\\n' +\n+ 'var socket = io(\"http://localhost:8080\");\\n' +\n'socket.on(\"news\", function (data) {\\n' +\n'console.log(data);\\n' +\n'socket.emit(\"my other event\", { my: \"data\" });\\n' +\n@@ -31,7 +20,7 @@ var HTML = '<script src=\"/socket.io/socket.io.js\"></script>\\n' +\n///--- Mainline\nvar server = restify.createServer();\n-var io = socketio.listen(server);\n+var io = socketio(server.server);\nserver.get('/', function indexHTML(req, res, next) {\nres.setHeader('Content-Type', 'text/html');\n@@ -43,13 +32,13 @@ server.get('/', function indexHTML(req, res, next) {\n});\n-io.sockets.on('connection', function (socket) {\n+io.on('connection', function (socket) {\nsocket.emit('news', { hello: 'world' });\nsocket.on('my other event', function (data) {\nconsole.log(data);\n});\n});\n-server.listen(8080, IP, function () {\n+server.listen(8080, function () {\nconsole.log('socket.io server listening at %s', server.url);\n});\n", "new_path": "examples/sockio/sockio.js", "old_path": "examples/sockio/sockio.js" } ]
JavaScript
MIT License
restify/node-restify
chore(examples): fix sockio example (#1487)
1
chore
examples
573,227
12.09.2017 18:06:59
-7,200
925b2cf86facb2d4d93648eb5c6f3ae741d8df26
chore(examples): migrate spdy, dtrace and jsonp examples to the latest restify
[ { "change_type": "MODIFY", "diff": "-var restify = require('../lib');\n+var restify = require('../../lib');\nvar server = restify.createServer({\nname: 'helloworld'\n});\n-server.use(restify.acceptParser(server.acceptable));\n-server.use(restify.authorizationParser());\n-server.use(restify.dateParser());\n-server.use(restify.queryParser());\n-server.use(restify.urlEncodedBodyParser());\n+server.use(restify.plugins.acceptParser(server.acceptable));\n+server.use(restify.plugins.authorizationParser());\n+server.use(restify.plugins.dateParser());\n+server.use(restify.plugins.queryParser());\n+server.use(restify.plugins.urlEncodedBodyParser());\nserver.use(function slowHandler(req, res, next) {\nsetTimeout(function () {\n@@ -29,4 +29,3 @@ server.get({\nserver.listen(8080, function () {\nconsole.log('listening: %s', server.url);\n});\n-\n", "new_path": "examples/dtrace/hello.js", "old_path": "examples/dtrace/hello.js" }, { "change_type": "MODIFY", "diff": "var restify = require('../../lib');\nvar srv = restify.createServer();\n-srv.use(restify.queryParser());\n-srv.use(restify.jsonp());\n+srv.use(restify.plugins.queryParser());\n+srv.use(restify.plugins.jsonp());\nsrv.get('/', function (req, res, next) {\nres.send({hello: 'world'});\nnext();\n", "new_path": "examples/jsonp/jsonp.js", "old_path": "examples/jsonp/jsonp.js" }, { "change_type": "MODIFY", "diff": "+var path = require('path');\nvar fs = require('fs');\nvar bunyan = require('bunyan');\nvar restify = require('../../lib');\nvar srv = restify.createServer({\nspdy: {\n- cert: fs.readFileSync('./keys/spdy-cert.pem'),\n- key: fs.readFileSync('./keys/spdy-key.pem'),\n- ca: fs.readFileSync('keys/spdy-csr.pem')\n+ cert: fs.readFileSync(path.join(__dirname, './keys/spdy-cert.pem')),\n+ key: fs.readFileSync(path.join(__dirname, './keys/spdy-key.pem')),\n+ ca: fs.readFileSync(path.join(__dirname, 'keys/spdy-csr.pem'))\n}\n});\n@@ -16,6 +17,7 @@ srv.get('/', function (req, res, next) {\n});\nsrv.on('after', restify.plugins.auditLogger({\n+ event: 'after',\nbody: true,\nlog: bunyan.createLogger({\nname: 'audit',\n", "new_path": "examples/spdy/spdy.js", "old_path": "examples/spdy/spdy.js" } ]
JavaScript
MIT License
restify/node-restify
chore(examples): migrate spdy, dtrace and jsonp examples to the latest restify (#1488)
1
chore
examples
573,223
13.09.2017 10:32:22
-19,080
ee154908d3ec4fd4a4108019140820c172df66b5
Fix: 652 - Incorrect error on route with no versions
[ { "change_type": "MODIFY", "diff": "@@ -468,10 +468,17 @@ Router.prototype.find = function find(req, res, callback) {\n// not the first one. However, if neither the client nor\n// server specified any version, we're done, because neither\n// cared\n- if (routes[i].versions.length === 0 && req.version() === '*') {\n+ if (routes[i].versions.length === 0) {\n+ if (req.version() === '*') {\nr = routes[i];\nbreak;\n}\n+ callback(new InvalidVersionError('%s is not supported by %s %s',\n+ req.version() || '?',\n+ req.method,\n+ req.path()));\n+ return;\n+ }\nif (routes[i].versions.length > 0) {\ncandidates.push({\n", "new_path": "lib/router.js", "old_path": "lib/router.js" }, { "change_type": "MODIFY", "diff": "@@ -1204,6 +1204,47 @@ test('versioned route matching should not throw TypeError' , function (t) {\n});\n+test('GH-652 throw InvalidVersion on version mismatch', function (t) {\n+ function response (req, res, next) {\n+ return res.send(req.route.version);\n+ }\n+ SERVER.get({ path: '/ping', version: '1.0.1' }, response);\n+ SERVER.listen(0, '127.0.0.1', function () {\n+ var opts = {\n+ path: '/ping',\n+ headers: {\n+ 'accept-version': '1.0.2'\n+ }\n+ };\n+ CLIENT.get(opts, function (err, req, res, data) {\n+ t.equal(res.statusCode, 400);\n+ t.equal(data.code, 'InvalidVersion');\n+ t.done();\n+ });\n+ });\n+});\n+\n+test('GH-652 throw InvalidVersion on non-versioned route', function (t) {\n+ function response (req, res, next) {\n+ return res.send(req.route.version);\n+ }\n+ SERVER.get({ path: '/ping' }, response);\n+ SERVER.listen(0, '127.0.0.1', function () {\n+ var opts = {\n+ path: '/ping',\n+ headers: {\n+ 'accept-version': '1.0.1'\n+ }\n+ };\n+ CLIENT.get(opts, function (err, req, res, data) {\n+ t.equal(res.statusCode, 400);\n+ t.equal(data.code, 'InvalidVersion');\n+ t.done();\n+ });\n+ });\n+});\n+\n+\ntest('GH-959 matchedVersion() should return on cached routes', function (t) {\nSERVER.get({\n", "new_path": "test/server.test.js", "old_path": "test/server.test.js" } ]
JavaScript
MIT License
restify/node-restify
Fix: 652 - Incorrect error on route with no versions (#1465)
1
fix
null
573,195
14.09.2017 14:06:11
25,200
dc9d4eb490fe926d71af17f84e9ad6e1e598b735
Docs: clarity on error handling
[ { "change_type": "MODIFY", "diff": "@@ -491,6 +491,15 @@ restify.createServer({\n});\n```\n+Restify ships with the following default formatters, which can be overridden\n+when passing a formatters options to `createServer()`:\n+\n+* application/javascript\n+* application/json\n+* text/plain\n+* application/octet-stream\n+\n+\nThe restify response object retains has all the \"raw\" methods of a node\n[ServerResponse](http://nodejs.org/docs/latest/api/http.html#http.ServerResponse)\non it as well.\n", "new_path": "docs/guides/server.md", "old_path": "docs/guides/server.md" }, { "change_type": "MODIFY", "diff": "@@ -525,14 +525,9 @@ statement. This gives you a way to handle all errors of the same class\nidentically across the server. You can also use a generic `restifyError` event\nwhich will catch errors of all types.\n+An example of sending a 404:\n```js\n-server.get('/hello/:name', function(req, res, next) {\n- // some internal unrecoverable error\n- var err = new restify.errors.InternalServerError('oh noes!');\n- return next(err);\n-});\n-\nserver.get('/hello/:foo', function(req, res, next) {\n// resource not found error\nvar err = new restify.errors.NotFoundError('oh noes!');\n@@ -543,15 +538,41 @@ server.on('NotFound', function (req, res, err, cb) {\n// do not call res.send! you are now in an error context and are outside\n// of the normal next chain. you can log or do metrics here, and invoke\n// the callback when you're done. restify will automtically render the\n- // NotFoundError as a JSON response.\n+ // NotFoundError depending on the content-type header you have set in your\n+ // response.\nreturn cb();\n});\n+```\n+\n+For customizing the error being sent back to the client:\n+\n+```js\n+server.get('/hello/:name', function(req, res, next) {\n+ // some internal unrecoverable error\n+ var err = new restify.errors.InternalServerError('oh noes!');\n+ return next(err);\n+});\nserver.on('InternalServer', function (req, res, err, cb) {\n- // if you don't want restify to automatically render the Error object\n- // as a JSON response, you can customize the response by setting the\n- // `body` property of the error\n- err.body = '<html><body>some custom error content!</body></html>';\n+ // by default, restify will usually render the Error object as plaintext or\n+ // JSON depending on content negotiation. the default text formatter and JSON\n+ // formatter are pretty simple, they just call toString() and toJSON() on the\n+ // object being passed to res.send, which in this case, is the error object.\n+ // so to customize what it sent back to the client when this error occurs,\n+ // you would implement as follows:\n+\n+ // for any response that is text/plain\n+ err.toString = function toString() {\n+ return 'an internal server error occurred!';\n+ };\n+ // for any response that is application/json\n+ err.toJSON = function toJSON() {\n+ return {\n+ message: 'an internal server error occurred!',\n+ code: 'boom!'\n+ }\n+ };\n+\nreturn cb();\n});\n@@ -563,6 +584,29 @@ server.on('restifyError', function (req, res, err, cb) {\n});\n```\n+Here is another example of `InternalServerError`, but this time with a custom\n+formatter:\n+\n+```js\n+const errs = require('restify-errors');\n+\n+const server = restify.createServer({\n+ formatters: {\n+ 'text/html': function(req, res, body) {\n+ if (body instanceof Error) {\n+ // body here is an instance of InternalServerError\n+ return '<html><body>' + body.message + '</body></html>';\n+ }\n+ }\n+ }\n+});\n+\n+server.get('/', function(req, res, next) {\n+ res.header('content-type', 'text/html');\n+ return next(new errs.InternalServerError('oh noes!'));\n+});\n+```\n+\n### restify-errors\n", "new_path": "docs/index.md", "old_path": "docs/index.md" } ]
JavaScript
MIT License
restify/node-restify
Docs: clarity on error handling (#1491)
1
docs
null
744,030
18.09.2017 01:48:02
-7,200
ac8088bf70bd27aa10268afb0d63bcf3a4a8016f
fix: implications fails only displayed once
[ { "change_type": "MODIFY", "diff": "@@ -249,6 +249,7 @@ module.exports = function validation (yargs, usage, y18n) {\n;(implied[key] || []).forEach((value) => {\nlet num\nlet key = origKey\n+ const origValue = value\n// convert string '1' to number 1\nnum = Number(key)\n@@ -278,7 +279,7 @@ module.exports = function validation (yargs, usage, y18n) {\nvalue = argv[value]\n}\nif (key && !value) {\n- implyFail.push(origKey)\n+ implyFail.push(` ${origKey} -> ${origValue}`)\n}\n})\n})\n@@ -286,12 +287,8 @@ module.exports = function validation (yargs, usage, y18n) {\nif (implyFail.length) {\nlet msg = `${__('Implications failed:')}\\n`\n- implyFail.forEach((key) => {\n- if (implied[key]) {\n- implied[key].forEach((value) => {\n- msg += (` ${key} -> ${value}`)\n- })\n- }\n+ implyFail.forEach((value) => {\n+ msg += (value)\n})\nusage.fail(msg)\n", "new_path": "lib/validation.js", "old_path": "lib/validation.js" }, { "change_type": "MODIFY", "diff": "@@ -38,15 +38,17 @@ describe('validation tests', () => {\n.argv\n})\n- it('fails if either implied argument is not set', (done) => {\n+ it('fails if either implied argument is not set and displays only failed', (done) => {\nyargs(['-f', '-b'])\n.implies('f', ['b', 'c'])\n.fail((msg1) => {\nyargs(['-f', '-c'])\n.implies('f', ['b', 'c'])\n.fail((msg2) => {\n- msg1.should.match(/f -> b f -> c/)\n- msg2.should.match(/f -> b f -> c/)\n+ msg1.should.match(/f -> c/)\n+ msg1.should.not.match(/f -> b/)\n+ msg2.should.match(/f -> b/)\n+ msg2.should.not.match(/f -> c/)\nreturn done()\n})\n.argv\n", "new_path": "test/validation.js", "old_path": "test/validation.js" } ]
JavaScript
MIT License
yargs/yargs
fix: implications fails only displayed once (#954)
1
fix
null
573,190
19.09.2017 09:34:55
25,200
78b0900b0ffcefa86e541c850d27779c5f656f00
fix(cpuUsageThrottle): Correctly named handler for debugInfo
[ { "change_type": "MODIFY", "diff": "@@ -77,7 +77,7 @@ var EWMA = require('ewma');\n* unit is in ms. Defaults to 250.\n* @returns {Function} middleware to be registered on server.pre\n*/\n-function cpuUsageThrottle (opts) {\n+function cpuUsageThrottlePlugin (opts) {\n// Scrub input and populate our configuration\nassert.object(opts, 'opts');\n@@ -150,7 +150,7 @@ function cpuUsageThrottle (opts) {\n// Kick off updating our _reject value\nupdateReject();\n- function onRequest (req, res, next) {\n+ function cpuUsageThrottle (req, res, next) {\n// Check to see if this request gets rejected. Since, in updateReject,\n// we calculate a percentage of traffic we are planning to reject, we\n// can use Math.random() (which picks from a uniform distribution in\n@@ -186,10 +186,10 @@ function cpuUsageThrottle (opts) {\nfunction close () {\nclearTimeout(self._timeout);\n}\n- onRequest.close = close;\n+ cpuUsageThrottle.close = close;\n// Expose internal plugin state for introspection\n- Object.defineProperty(onRequest, 'state', {\n+ Object.defineProperty(cpuUsageThrottle, 'state', {\nget: function () {\n// We intentionally do not expose ewma since we don't want the user\n// to be able to update it's configuration, the current state of\n@@ -215,7 +215,7 @@ function cpuUsageThrottle (opts) {\n* it follows the same format as the constructor for this plugin.\n* @returns {undefined}\n*/\n- onRequest.update = function update(newOpts) {\n+ cpuUsageThrottle.update = function update(newOpts) {\nassert.object(newOpts, 'newOpts');\nassert.optionalNumber(newOpts.limit, 'newOpts.limit');\nassert.optionalNumber(newOpts.max, 'newOpts.max');\n@@ -250,7 +250,7 @@ function cpuUsageThrottle (opts) {\n(self._cpu - self._limit) / (self._max - self._limit);\n};\n- return onRequest;\n+ return cpuUsageThrottle;\n}\n-module.exports = cpuUsageThrottle;\n+module.exports = cpuUsageThrottlePlugin;\n", "new_path": "lib/plugins/cpuUsageThrottle.js", "old_path": "lib/plugins/cpuUsageThrottle.js" }, { "change_type": "MODIFY", "diff": "@@ -72,6 +72,18 @@ describe('cpuUsageThrottle', function () {\ndone();\n});\n+ it('Unit: Should have proper name', function (done) {\n+ var opts = {\n+ max: 1,\n+ limit: 0.9,\n+ halfLife: 50,\n+ interval: 50\n+ };\n+ var plugin = cpuUsageThrottle(opts);\n+ assert.equal(plugin.name, 'cpuUsageThrottle');\n+ done();\n+ });\n+\nit('Integration: Should shed load', function (done) {\nvar server = restify.createServer();\n", "new_path": "test/plugins/cpuUsageThrottle.test.js", "old_path": "test/plugins/cpuUsageThrottle.test.js" } ]
JavaScript
MIT License
restify/node-restify
fix(cpuUsageThrottle): Correctly named handler for debugInfo (#1499)
1
fix
cpuUsageThrottle
573,190
19.09.2017 09:58:41
25,200
c2e6deae5dab78187a8b09ce5256fb09db390bc9
fix(server): error in pre handler triggers after event
[ { "change_type": "MODIFY", "diff": "@@ -753,17 +753,14 @@ Server.prototype._handle = function _handle(req, res) {\n// run pre() handlers first before routing and running\nif (self.before.length > 0) {\nself._run(req, res, null, self.before, function (err) {\n- // check for return false here - like with the regular handlers,\n- // if false is returned we already sent a response and should stop\n- // processing.\n- if (err === false) {\n- self._finishReqResCycle(req, res);\n+ // Like with regular handlers, if we are provided an error, we\n+ // should abort the middleware chain and fire after events.\n+ if (err === false || err instanceof Error) {\n+ self._finishReqResCycle(req, res, null, err);\nreturn;\n}\n- if (!err) {\nrouteAndRun();\n- }\n});\n} else {\nrouteAndRun();\n", "new_path": "lib/server.js", "old_path": "lib/server.js" }, { "change_type": "MODIFY", "diff": "@@ -630,7 +630,6 @@ test('GH-64 prerouting chain with error', function (t) {\n});\n});\n-\ntest('GH-67 extend access-control headers', function (t) {\nSERVER.get('/hello/:name', function tester(req, res, next) {\nres.header('Access-Control-Allow-Headers',\n@@ -2337,6 +2336,24 @@ test('calling next(false) should early exit from pre handlers', function (t) {\n});\n+test('calling next(err) from pre should still emit after event', function (t) {\n+ setTimeout(function () {\n+ t.fail('Timed out');\n+ t.end();\n+ }, 2000);\n+ var error = new Error();\n+ SERVER.pre(function (req, res, next) {\n+ next(error);\n+ });\n+ SERVER.get('/', function (req, res, next) {\n+ t.fail('should have aborted stack before routing');\n+ });\n+ SERVER.on('after', function (req, res, route, err) {\n+ t.equal(err, error);\n+ t.end();\n+ });\n+ CLIENT.get('/', function () {});\n+});\ntest('GH-1078: server name should default to restify', function (t) {\n", "new_path": "test/server.test.js", "old_path": "test/server.test.js" } ]
JavaScript
MIT License
restify/node-restify
fix(server): error in pre handler triggers after event (#1500)
1
fix
server
448,077
20.09.2017 08:53:21
-3,600
3f87f5e9d64a8248fa726801c2843e73079ca004
feat: add rollup commonjs plugin to support all library types
[ { "change_type": "MODIFY", "diff": "\"read-file\": \"^0.2.0\",\n\"rimraf\": \"^2.6.1\",\n\"rollup\": \"^0.50.0\",\n+ \"rollup-plugin-commonjs\": \"^8.2.1\",\n\"rollup-plugin-node-resolve\": \"^3.0.0\",\n\"sorcery\": \"^0.10.0\",\n\"stylus\": \"^0.54.5\",\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "const __rollup = require('rollup');\nconst nodeResolve = require('rollup-plugin-node-resolve');\n+const commonJs = require('rollup-plugin-commonjs');\nimport { debug } from '../util/log';\nimport { ROLLUP_GLOBALS } from '../conf/rollup.globals';\n@@ -31,6 +32,7 @@ export const rollup = (opts: RollupOptions) => {\ninput: opts.entry,\nplugins: [\nnodeResolve({ jsnext: true, module: true }),\n+ commonJs(),\n],\nonwarn: (warning) => {\nif (warning.code === 'THIS_IS_UNDEFINED') {\n", "new_path": "src/lib/steps/rollup.ts", "old_path": "src/lib/steps/rollup.ts" }, { "change_type": "MODIFY", "diff": "@@ -71,6 +71,10 @@ abbrev@1:\nversion \"1.1.0\"\nresolved \"https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.0.tgz#d0554c2256636e2f56e7c2e5ad183f859428d81f\"\n+acorn@^5.1.1:\n+ version \"5.1.2\"\n+ resolved \"https://registry.yarnpkg.com/acorn/-/acorn-5.1.2.tgz#911cb53e036807cf0fa778dc5d370fbd864246d7\"\n+\najv@^4.9.1:\nversion \"4.11.8\"\nresolved \"https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536\"\n@@ -949,6 +953,14 @@ esprima@~3.1.0:\nversion \"3.1.3\"\nresolved \"https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633\"\n+estree-walker@^0.3.0:\n+ version \"0.3.1\"\n+ resolved \"https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.3.1.tgz#e6b1a51cf7292524e7237c312e5fe6660c1ce1aa\"\n+\n+estree-walker@^0.5.0:\n+ version \"0.5.0\"\n+ resolved \"https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.5.0.tgz#aae3b57c42deb8010e349c892462f0e71c5dd1aa\"\n+\nevent-emitter@^0.3.5:\nversion \"0.3.5\"\nresolved \"https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39\"\n@@ -2018,6 +2030,12 @@ ltcdr@^2.2.1:\nversion \"2.2.1\"\nresolved \"https://registry.yarnpkg.com/ltcdr/-/ltcdr-2.2.1.tgz#5ab87ad1d4c1dab8e8c08bbf037ee0c1902287cf\"\n+magic-string@^0.22.4:\n+ version \"0.22.4\"\n+ resolved \"https://registry.yarnpkg.com/magic-string/-/magic-string-0.22.4.tgz#31039b4e40366395618c1d6cf8193c53917475ff\"\n+ dependencies:\n+ vlq \"^0.2.1\"\n+\nmake-error@^1.1.1:\nversion \"1.3.0\"\nresolved \"https://registry.yarnpkg.com/make-error/-/make-error-1.3.0.tgz#52ad3a339ccf10ce62b4040b708fe707244b8b96\"\n@@ -2066,7 +2084,7 @@ merge-stream@^1.0.0:\ndependencies:\nreadable-stream \"^2.0.1\"\n-micromatch@^2.1.5, micromatch@^2.3.7:\n+micromatch@^2.1.5, micromatch@^2.3.11, micromatch@^2.3.7:\nversion \"2.3.11\"\nresolved \"https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565\"\ndependencies:\n@@ -2721,7 +2739,7 @@ resolve@1.1.7:\nversion \"1.1.7\"\nresolved \"https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b\"\n-resolve@^1.1.6, resolve@^1.1.7, resolve@~1.4.0:\n+resolve@^1.1.6, resolve@^1.1.7, resolve@^1.4.0, resolve@~1.4.0:\nversion \"1.4.0\"\nresolved \"https://registry.yarnpkg.com/resolve/-/resolve-1.4.0.tgz#a75be01c53da25d934a98ebd0e4c4a7312f92a86\"\ndependencies:\n@@ -2745,6 +2763,16 @@ rimraf@2, rimraf@^2.5.1, rimraf@^2.5.2, rimraf@^2.6.1:\ndependencies:\nglob \"^7.0.5\"\n+rollup-plugin-commonjs@^8.2.1:\n+ version \"8.2.1\"\n+ resolved \"https://registry.yarnpkg.com/rollup-plugin-commonjs/-/rollup-plugin-commonjs-8.2.1.tgz#5e40c78375eb163c14c76bce69da1750e5905a2e\"\n+ dependencies:\n+ acorn \"^5.1.1\"\n+ estree-walker \"^0.5.0\"\n+ magic-string \"^0.22.4\"\n+ resolve \"^1.4.0\"\n+ rollup-pluginutils \"^2.0.1\"\n+\nrollup-plugin-node-resolve@^3.0.0:\nversion \"3.0.0\"\nresolved \"https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.0.0.tgz#8b897c4c3030d5001277b0514b25d2ca09683ee0\"\n@@ -2754,6 +2782,13 @@ rollup-plugin-node-resolve@^3.0.0:\nis-module \"^1.0.0\"\nresolve \"^1.1.6\"\n+rollup-pluginutils@^2.0.1:\n+ version \"2.0.1\"\n+ resolved \"https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.0.1.tgz#7ec95b3573f6543a46a6461bd9a7c544525d0fc0\"\n+ dependencies:\n+ estree-walker \"^0.3.0\"\n+ micromatch \"^2.3.11\"\n+\nrollup@^0.49.0:\nversion \"0.49.3\"\nresolved \"https://registry.yarnpkg.com/rollup/-/rollup-0.49.3.tgz#4cce32643dd8cf2154c69ff0e43470067db0adbf\"\n", "new_path": "yarn.lock", "old_path": "yarn.lock" } ]
TypeScript
MIT License
ng-packagr/ng-packagr
feat: add rollup commonjs plugin to support all library types (#121)
1
feat
null
448,039
20.09.2017 09:55:58
-7,200
e56d8f8628d4a3fcff415ee8aaf8026e89af50a4
chore: cut release for v1.2.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=\"1.2.0\"></a>\n+# [1.2.0](https://github.com/dherges/ng-packagr/compare/v1.1.0...v1.2.0) (2017-09-20)\n+\n+\n+### Features\n+\n+* add rollup commonjs plugin to support all library types ([#121](https://github.com/dherges/ng-packagr/issues/121)) ([3f87f5e](https://github.com/dherges/ng-packagr/commit/3f87f5e))\n+* update rollup to version 0.50.0 ([#124](https://github.com/dherges/ng-packagr/issues/124)) ([fb9f529](https://github.com/dherges/ng-packagr/commit/fb9f529))\n+\n+\n+\n<a name=\"1.1.0\"></a>\n# [1.1.0](https://github.com/dherges/ng-packagr/compare/v1.0.1...v1.1.0) (2017-09-12)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"ng-packagr\",\n- \"version\": \"1.1.0\",\n+ \"version\": \"1.2.0\",\n\"description\": \"Compile and package a TypeScript library to Angular Package Format\",\n\"keywords\": [\n\"angular\",\n", "new_path": "package.json", "old_path": "package.json" } ]
TypeScript
MIT License
ng-packagr/ng-packagr
chore: cut release for v1.2.0
1
chore
null
815,745
22.09.2017 15:37:47
-10,800
72f4dd0f3390316784fdad6efea0539d33ef187d
feat: focus first item on open/keyup
[ { "change_type": "MODIFY", "diff": "@@ -45,9 +45,10 @@ export class ItemsList {\n}\nfilter(term: string, bindLabel: string) {\n- this._markedItemIndex = -1;\n+ this.unmarkCurrentItem();\nconst filterFuncVal = this.getDefaultFilterFunc(term, bindLabel);\nthis.filteredItems = term ? this.items.filter(val => filterFuncVal(val)) : this.items;\n+ this.markItem(0);\n}\nclearFilter() {\n@@ -63,12 +64,13 @@ export class ItemsList {\n}\nmarkSelection() {\n- const lastSelected = this._selected[this._selected.length - 1];\n- this._markedItemIndex = lastSelected ? this.filteredItems.indexOf(lastSelected) : 0;\n- this.markedItem = this.filteredItems[this._markedItemIndex];\n- if (this.markedItem) {\n- this.markedItem.marked = true;\n+ if (this.filteredItems.length === 0) {\n+ return;\n}\n+\n+ const lastSelected = this._selected[this._selected.length - 1];\n+ const index = lastSelected ? this.filteredItems.indexOf(lastSelected) : 0;\n+ this.markItem(index);\n}\nunmarkCurrentItem() {\n@@ -106,4 +108,12 @@ export class ItemsList {\n.indexOf(searchHelper.stripSpecialChars(term).toUpperCase()) > -1;\n};\n}\n+\n+ private markItem(index: number) {\n+ this._markedItemIndex = index;\n+ this.markedItem = this.filteredItems[this._markedItemIndex];\n+ if (this.markedItem) {\n+ this.markedItem.marked = true;\n+ }\n+ }\n}\n", "new_path": "src/lib/src/items-list.ts", "old_path": "src/lib/src/items-list.ts" }, { "change_type": "MODIFY", "diff": "@@ -28,7 +28,7 @@ describe('NgSelectComponent', function () {\nit('update parent selected model on value change', fakeAsync(() => {\n// select second city\n- selectOption(fixture, KeyCode.ArrowDown, 2);\n+ selectOption(fixture, KeyCode.ArrowDown, 1);\nfixture.detectChanges();\ntick();\n@@ -74,7 +74,7 @@ describe('NgSelectComponent', function () {\n</ng-select>`);\n// from component to model\n- selectOption(fixture, KeyCode.ArrowDown, 1);\n+ selectOption(fixture, KeyCode.ArrowDown, 0);\nfixture.detectChanges();\ntick();\n@@ -100,7 +100,7 @@ describe('NgSelectComponent', function () {\n</ng-select>`);\n// from component to model\n- selectOption(fixture, KeyCode.ArrowDown, 1);\n+ selectOption(fixture, KeyCode.ArrowDown, 0);\nfixture.detectChanges();\ntick();\n@@ -232,9 +232,15 @@ describe('NgSelectComponent', function () {\nexpect(fixture.componentInstance.select.isOpen).toBe(true);\n});\n+ it('should mark first item on open', () => {\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Enter);\n+ expect(fixture.componentInstance.select.value).toEqual(fixture.componentInstance.cities[0]);\n+ });\n+\nit('select next value on arrow down', () => {\nselectOption(fixture, KeyCode.ArrowDown, 1);\n- expect(fixture.componentInstance.select.value).toEqual(fixture.componentInstance.cities[0]);\n+ expect(fixture.componentInstance.select.value).toEqual(fixture.componentInstance.cities[1]);\n});\nit('select first value on arrow down when current selected value is last', async(() => {\n@@ -278,18 +284,15 @@ describe('NgSelectComponent', function () {\nit('close opened dropdown on esc click', () => {\nfixture.componentInstance.select.isOpen = true;\n-\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Esc);\n-\nexpect(fixture.componentInstance.select.isOpen).toBe(false);\n});\n- it('close opened dropdown on tab click', () => {\n- fixture.componentInstance.select.isOpen = true;\n-\n+ it('should close opened dropdown and select marked value on tab click', () => {\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Tab);\n-\n- expect(fixture.componentInstance.select.isOpen).toBe(false);\n+ expect(fixture.componentInstance.select.value).toEqual(fixture.componentInstance.cities[0]);\n+ expect(fixture.componentInstance.select.isOpen).toBeFalsy()\n});\n});\n@@ -392,16 +395,25 @@ describe('NgSelectComponent', function () {\n}));\nit('should toggle selected item', fakeAsync(() => {\n- selectOption(fixture, KeyCode.ArrowDown, 1);\n+ selectOption(fixture, KeyCode.ArrowDown, 0);\nselectOption(fixture, KeyCode.ArrowDown, 2);\ndetectChanges();\nexpect((<NgOption[]>fixture.componentInstance.select.value).length).toBe(2);\n+\nselectOption(fixture, KeyCode.ArrowDown, 1);\ndetectChanges();\nexpect((<NgOption[]>fixture.componentInstance.select.value).length).toBe(1);\nexpect(fixture.componentInstance.select.value[0].name).toBe('Pabrade');\n}));\n+ it('should not toggle item on enter when dropdown is closed', () => {\n+ selectOption(fixture, KeyCode.ArrowDown, 0);\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Esc);\n+ expect((<NgOption[]>fixture.componentInstance.select.value).length).toBe(1);\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Enter);\n+ expect((<NgOption[]>fixture.componentInstance.select.value).length).toBe(1);\n+ })\n+\nfunction detectChanges() {\nfixture.detectChanges();\ntick();\n@@ -444,7 +456,7 @@ describe('NgSelectComponent', function () {\ndescribe('Filter', () => {\nlet fixture: ComponentFixture<NgSelectFilterTestCmp>;\n- it('filter items with default filter', fakeAsync(() => {\n+ it('should filter using default implementation', fakeAsync(() => {\nfixture = createTestingModule(\nNgSelectFilterTestCmp,\n`<ng-select [items]=\"cities\"\n@@ -456,28 +468,62 @@ describe('NgSelectComponent', function () {\nfixture.componentInstance.select.onFilter({ target: { value: 'vilnius' } });\ntick(200);\n- expect(fixture.componentInstance.select.itemsList.filteredItems).toEqual([{ id: 1, name: 'Vilnius' }]);\n+ expect(fixture.componentInstance.select.itemsList.filteredItems).toEqual([{ id: 1, name: 'Vilnius', marked: true }]);\n}));\n- it('filter items with custom observable typeahead', async(() => {\n+ it('should mark first item on filter', fakeAsync(() => {\nfixture = createTestingModule(\nNgSelectFilterTestCmp,\n`<ng-select [items]=\"cities\"\n- [typeahead]=\"customFilter\"\nlabelKey=\"name\"\n[(ngModel)]=\"selectedCity\">\n</ng-select>`);\nfixture.detectChanges();\n- fixture.componentInstance.select.onFilter({ target: { value: 'vilnius' } });\n+ fixture.componentInstance.select.onFilter({ target: { value: 'pab' } });\n+ tick(200);\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Enter);\n+ expect(fixture.componentInstance.select.value).toEqual(fixture.componentInstance.cities[2])\n+ }));\n+\n+ describe('with typeahead', () => {\n+ beforeEach(() => {\n+ fixture = createTestingModule(\n+ NgSelectFilterTestCmp,\n+ `<ng-select [items]=\"cities\"\n+ [typeahead]=\"customFilter\"\n+ labelKey=\"name\"\n+ [(ngModel)]=\"selectedCity\">\n+ </ng-select>`);\n+ fixture.detectChanges();\n+ });\n- fixture.componentInstance.customeFilter.subscribe(term => {\n+ it('should push term to custom observable', async(() => {\n+ fixture.componentInstance.customFilter.subscribe(term => {\nexpect(term).toBe('vilnius');\n});\n+ fixture.componentInstance.select.onFilter({ target: { value: 'vilnius' } });\n}));\n- });\n+ it('should mark first item when typeahead results are loaded', async(() => {\n+ fixture.componentInstance.customFilter.subscribe();\n+ fixture.componentInstance.select.onFilter({ target: { value: 'buk' } });\n+ fixture.componentInstance.cities = [{ id: 4, name: 'Bukiskes' }];\n+ fixture.detectChanges();\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Enter);\n+ expect(fixture.componentInstance.select.value).toEqual(jasmine.objectContaining({ id: 4, name: 'Bukiskes' }))\n+ }));\n+ it('should start and stop loading indicator', async(() => {\n+ fixture.componentInstance.customFilter.subscribe();\n+ fixture.componentInstance.select.onFilter({ target: { value: 'buk' } });\n+ expect(fixture.componentInstance.select.isLoading).toBeTruthy();\n+ fixture.componentInstance.cities = [{ id: 4, name: 'Bukiskes' }];\n+ fixture.detectChanges();\n+ expect(fixture.componentInstance.select.isLoading).toBeFalsy();\n+ }));\n+ });\n+ });\n});\nfunction selectOption(fixture, key: KeyCode, steps: number) {\n@@ -656,5 +702,5 @@ class NgSelectFilterTestCmp {\n{ id: 3, name: 'Pabrade' },\n];\n- customeFilter = new Subject<string>();\n+ customFilter = new Subject<string>();\n}\n", "new_path": "src/lib/src/ng-select.component.spec.ts", "old_path": "src/lib/src/ng-select.component.spec.ts" }, { "change_type": "MODIFY", "diff": "@@ -97,7 +97,10 @@ export class NgSelectComponent implements OnInit, ControlValueAccessor {\nset items(items: any[]) {\nthis._items = items || [];\nthis.itemsList = new ItemsList(this._items, this.multiple);\n- this.isLoading = false;\n+\n+ if (this.isTypeahead()) {\n+ this.handleItemsChange();\n+ }\n}\nget value(): NgOption | NgOption[] {\n@@ -129,6 +132,8 @@ export class NgSelectComponent implements OnInit, ControlValueAccessor {\nthis.handleEnter($event);\nbreak;\ncase KeyCode.Tab:\n+ this.handleTab($event);\n+ break;\ncase KeyCode.Esc:\nthis.close();\nbreak;\n@@ -318,6 +323,11 @@ export class NgSelectComponent implements OnInit, ControlValueAccessor {\n}\n}\n+ private handleItemsChange() {\n+ this.isLoading = false;\n+ this.itemsList.markSelection();\n+ }\n+\nprivate selectWriteValue(value: any) {\nthis.validateWriteValue(value);\nlet index = -1;\n@@ -361,6 +371,12 @@ export class NgSelectComponent implements OnInit, ControlValueAccessor {\nthis.dropdownList.scrollInto(this.itemsList.markedItem);\n}\n+ private handleTab($event: KeyboardEvent) {\n+ if (this.isOpen) {\n+ this.toggle(this.itemsList.markedItem);\n+ }\n+ }\n+\nprivate handleEnter($event: KeyboardEvent) {\nif (this.isOpen) {\nthis.toggle(this.itemsList.markedItem);\n", "new_path": "src/lib/src/ng-select.component.ts", "old_path": "src/lib/src/ng-select.component.ts" } ]
TypeScript
MIT License
ng-select/ng-select
feat: focus first item on open/keyup
1
feat
null
815,746
24.09.2017 14:15:57
-10,800
1c30d71e72d78d17ea0f6b24b644b761ff6ecb09
fix: increase dropdown container height
[ { "change_type": "MODIFY", "diff": "@@ -173,7 +173,7 @@ ng-select {\nbox-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);\nbox-sizing: border-box;\nmargin-top: -1px;\n- max-height: 200px;\n+ max-height: 242px;\nposition: absolute;\ntop: 100%;\nwidth: 100%;\n@@ -181,7 +181,7 @@ ng-select {\n-webkit-overflow-scrolling: touch;\n}\n.as-menu {\n- max-height: 198px;\n+ max-height: 240px;\noverflow-y: auto;\n}\n.as-option {\n", "new_path": "src/lib/src/ng-select.component.scss", "old_path": "src/lib/src/ng-select.component.scss" }, { "change_type": "MODIFY", "diff": "@@ -81,22 +81,19 @@ export class NgSelectComponent implements OnInit, ControlValueAccessor {\nfilterValue: string = null;\nprivate _value: NgOption | NgOption[] = null;\n-\nprivate _openClicked = false;\n- private _items: NgOption[];\nprivate propagateChange = (_: NgOption) => { };\nconstructor(private changeDetectorRef: ChangeDetectorRef, private elementRef: ElementRef) {\n}\n@Input()\n- get items(): any[] {\n- return this._items;\n+ get items(): NgOption[] {\n+ return this.itemsList.items;\n}\n- set items(items: any[]) {\n- this._items = items || [];\n- this.itemsList = new ItemsList(this._items, this.multiple);\n+ set items(items: NgOption[]) {\n+ this.itemsList = new ItemsList(items || [], this.multiple);\nif (this.isTypeahead()) {\nthis.handleItemsChange();\n", "new_path": "src/lib/src/ng-select.component.ts", "old_path": "src/lib/src/ng-select.component.ts" } ]
TypeScript
MIT License
ng-select/ng-select
fix: increase dropdown container height
1
fix
null
815,746
24.09.2017 14:32:20
-10,800
ebf29279f7c09e0fb5f2d1a16144564d967958d7
fix: do not fire duplicate events
[ { "change_type": "MODIFY", "diff": "@@ -24,15 +24,19 @@ export class ItemsList {\nreturn this._selected[0];\n}\n- select(item: NgOption) {\n+ select(item: NgOption): boolean {\n+ if (this._selected.indexOf(item) > -1) {\n+ return false;\n+ }\nif (!this._multiple) {\nthis.clearSelected();\n}\nthis._selected.push(item);\nitem.selected = true;\n+ return true;\n}\n- unselect(item: NgOption) {\n+ unSelect(item: NgOption) {\nthis._selected = this._selected.filter(x => x !== item);\nitem.selected = false;\n}\n", "new_path": "src/lib/src/items-list.ts", "old_path": "src/lib/src/items-list.ts" }, { "change_type": "MODIFY", "diff": "@@ -84,7 +84,8 @@ export class NgSelectComponent implements OnInit, ControlValueAccessor {\nprivate _openClicked = false;\nprivate _items: NgOption[];\n- private propagateChange = (_: NgOption) => { };\n+ private propagateChange = (_: NgOption) => {\n+ };\nconstructor(private changeDetectorRef: ChangeDetectorRef, private elementRef: ElementRef) {\n}\n@@ -206,7 +207,7 @@ export class NgSelectComponent implements OnInit, ControlValueAccessor {\n}\nopen() {\n- if (this.isDisabled) {\n+ if (this.isDisabled || this.isOpen) {\nreturn;\n}\nthis._openClicked = true;\n@@ -241,22 +242,23 @@ export class NgSelectComponent implements OnInit, ControlValueAccessor {\n}\nif (this.multiple && item.selected) {\n- this.unselect(item);\n+ this.unSelect(item);\n} else {\nthis.select(item);\n}\n}\nselect(item: NgOption) {\n- this.itemsList.select(item);\n+ if (this.itemsList.select(item)) {\nthis.updateModel();\n+ }\nif (!this.multiple) {\nthis.close();\n}\n}\n- unselect(item: NgOption) {\n- this.itemsList.unselect(item);\n+ unSelect(item: NgOption) {\n+ this.itemsList.unSelect(item);\nthis.updateModel();\n}\n", "new_path": "src/lib/src/ng-select.component.ts", "old_path": "src/lib/src/ng-select.component.ts" } ]
TypeScript
MIT License
ng-select/ng-select
fix: do not fire duplicate events
1
fix
null
815,746
24.09.2017 15:02:11
-10,800
e4084eadf6025849d87daa9767f16b74f925b08f
fix: Fire close event only dropdown was opened
[ { "change_type": "MODIFY", "diff": "@@ -524,6 +524,81 @@ describe('NgSelectComponent', function () {\n}));\n});\n});\n+\n+ describe('Output events', () => {\n+ it('fire open event once', fakeAsync(() => {\n+ const fixture = createTestingModule(\n+ NgSelectEventsTestCmp,\n+ `<ng-select [items]=\"cities\"\n+ (open)=\"onOpen()\"\n+ [(ngModel)]=\"selectedCity\">\n+ </ng-select>`);\n+\n+ spyOn(fixture.componentInstance, 'onOpen');\n+\n+ fixture.componentInstance.select.open();\n+ fixture.componentInstance.select.open();\n+ tick();\n+\n+ expect(fixture.componentInstance.onOpen).toHaveBeenCalledTimes(1);\n+ }));\n+\n+ it('fire close event once', fakeAsync(() => {\n+ const fixture = createTestingModule(\n+ NgSelectEventsTestCmp,\n+ `<ng-select [items]=\"cities\"\n+ (close)=\"onClose()\"\n+ [(ngModel)]=\"selectedCity\">\n+ </ng-select>`);\n+\n+ spyOn(fixture.componentInstance, 'onClose');\n+\n+ fixture.componentInstance.select.open();\n+ fixture.componentInstance.select.close();\n+ fixture.componentInstance.select.close();\n+ tick();\n+\n+ expect(fixture.componentInstance.onClose).toHaveBeenCalledTimes(1);\n+ }));\n+\n+ it('fire change when changed', fakeAsync(() => {\n+ const fixture = createTestingModule(\n+ NgSelectEventsTestCmp,\n+ `<ng-select [items]=\"cities\"\n+ (change)=\"onChange()\"\n+ [(ngModel)]=\"selectedCity\">\n+ </ng-select>`);\n+\n+ spyOn(fixture.componentInstance, 'onChange');\n+\n+ fixture.componentInstance.selectedCity = fixture.componentInstance.cities[0];\n+ fixture.detectChanges();\n+ tick();\n+\n+ fixture.componentInstance.select.select(fixture.componentInstance.cities[1]);\n+\n+ expect(fixture.componentInstance.onChange).toHaveBeenCalledTimes(1);\n+ }));\n+\n+ it('do not fire change when item not changed', fakeAsync(() => {\n+ const fixture = createTestingModule(\n+ NgSelectEventsTestCmp,\n+ `<ng-select [items]=\"cities\"\n+ (change)=\"onChange()\"\n+ [(ngModel)]=\"selectedCity\">\n+ </ng-select>`);\n+\n+ spyOn(fixture.componentInstance, 'onChange');\n+\n+ fixture.componentInstance.selectedCity = fixture.componentInstance.cities[0];\n+ fixture.detectChanges();\n+ tick();\n+\n+ fixture.componentInstance.select.select(fixture.componentInstance.cities[0]);\n+\n+ expect(fixture.componentInstance.onChange).toHaveBeenCalledTimes(0);\n+ }));\n+ });\n});\nfunction selectOption(fixture, key: KeyCode, steps: number) {\n@@ -559,7 +634,8 @@ function createTestingModule<T>(cmp: Type<T>, template: string): ComponentFixtur\nNgSelectSelectedObjectByRefCmp,\nNgSelectSelectedSimpleMultipleCmp,\nNgSelectSelectedObjectMultipleCmp,\n- NgSelectSelectedEmptyCmp\n+ NgSelectSelectedEmptyCmp,\n+ NgSelectEventsTestCmp\n]\n})\n.overrideComponent(cmp, {\n@@ -704,3 +780,31 @@ class NgSelectFilterTestCmp {\ncustomFilter = new Subject<string>();\n}\n+\n+@Component({\n+ template: ``\n+})\n+class NgSelectEventsTestCmp {\n+ @ViewChild(NgSelectComponent) select: NgSelectComponent;\n+ selectedCity: { id: number; name: string };\n+ cities = [\n+ { id: 1, name: 'Vilnius' },\n+ { id: 2, name: 'Kaunas' },\n+ { id: 3, name: 'Pabrade' },\n+ ];\n+\n+ onChange($event) {\n+ }\n+\n+ onFocus($event: Event) {\n+ }\n+\n+ onBlur($event: Event) {\n+ }\n+\n+ onOpen() {\n+ }\n+\n+ onClose() {\n+ }\n+}\n", "new_path": "src/lib/src/ng-select.component.spec.ts", "old_path": "src/lib/src/ng-select.component.spec.ts" }, { "change_type": "MODIFY", "diff": "@@ -218,6 +218,16 @@ export class NgSelectComponent implements OnInit, ControlValueAccessor {\nthis.onOpen.emit();\n}\n+ close() {\n+ if (!this.isOpen) {\n+ return;\n+ }\n+ this.isOpen = false;\n+ this.clearSearch();\n+ this.itemsList.unmarkCurrentItem();\n+ this.onClose.emit();\n+ }\n+\ngetLabelValue(value: NgOption) {\nreturn value ? value[this.bindLabel] : '';\n}\n@@ -352,13 +362,6 @@ export class NgSelectComponent implements OnInit, ControlValueAccessor {\nthis.itemsList.clearFilter();\n}\n- private close() {\n- this.isOpen = false;\n- this.clearSearch();\n- this.itemsList.unmarkCurrentItem();\n- this.onClose.emit();\n- }\n-\nprivate focusSearchInput() {\nsetTimeout(() => {\nthis.filterInput.nativeElement.focus();\n", "new_path": "src/lib/src/ng-select.component.ts", "old_path": "src/lib/src/ng-select.component.ts" } ]
TypeScript
MIT License
ng-select/ng-select
fix: Fire close event only dropdown was opened
1
fix
null
744,030
25.09.2017 13:30:20
-7,200
74a38b2646478c301a17498afa36a832277e5b9c
feat: multiple usage calls are now collected, not replaced
[ { "change_type": "MODIFY", "diff": "@@ -64,11 +64,21 @@ module.exports = function usage (yargs, y18n) {\n}\n// methods for ouputting/building help (usage) message.\n- let usage\n+ let usages = []\n+ let usageDisabled = false\nself.usage = (msg) => {\n- usage = msg\n+ if (msg === null) {\n+ usageDisabled = true\n+ usages = []\n+ return\n+ }\n+ usageDisabled = false\n+ usages.push(msg)\n+ }\n+ self.getUsage = () => {\n+ if (usageDisabled) return null\n+ return usages.reduce((usageMsg, msg) => `${usageMsg}${msg}\\n`, '') || undefined\n}\n- self.getUsage = () => usage\nlet examples = []\nself.example = (cmd, description) => {\n@@ -151,9 +161,9 @@ module.exports = function usage (yargs, y18n) {\n})\n// the usage string.\n- if (usage) {\n- const u = usage.replace(/\\$0/g, yargs.$0)\n- ui.div(`${u}\\n`)\n+ if (usages.length && !usageDisabled) {\n+ const u = self.getUsage().replace(/\\$0/g, yargs.$0)\n+ ui.div(`${u}`)\n}\n// your application's commands, i.e., non-option\n@@ -435,7 +445,8 @@ module.exports = function usage (yargs, y18n) {\n// do not reset fails here\nfailMessage = null\nfailureOutput = false\n- usage = undefined\n+ usages = []\n+ usageDisabled = false\nepilog = undefined\nexamples = []\ncommands = []\n@@ -448,7 +459,8 @@ module.exports = function usage (yargs, y18n) {\nfrozen = {}\nfrozen.failMessage = failMessage\nfrozen.failureOutput = failureOutput\n- frozen.usage = usage\n+ frozen.usages = usages\n+ frozen.usageDisabled = usageDisabled\nfrozen.epilog = epilog\nfrozen.examples = examples\nfrozen.commands = commands\n@@ -457,7 +469,8 @@ module.exports = function usage (yargs, y18n) {\nself.unfreeze = function unfreeze () {\nfailMessage = frozen.failMessage\nfailureOutput = frozen.failureOutput\n- usage = frozen.usage\n+ usages = frozen.usages\n+ usageDisabled = frozen.usageDisabled\nepilog = frozen.epilog\nexamples = frozen.examples\ncommands = frozen.commands\n", "new_path": "lib/usage.js", "old_path": "lib/usage.js" }, { "change_type": "MODIFY", "diff": "@@ -1817,6 +1817,39 @@ describe('usage tests', () => {\n''\n])\n})\n+\n+ it('allows a builder to add more than one usage with mutiple usage calls', () => {\n+ const r = checkUsage(() => yargs('upload --help')\n+ .command('upload', 'upload something', yargs => yargs.usage('$0 upload [something]').usage('$0 upload [something else]'), (argv) => {})\n+ .wrap(null)\n+ .argv\n+ )\n+\n+ r.logs[0].split('\\n').should.deep.equal([\n+ './usage upload [something]',\n+ './usage upload [something else]',\n+ '',\n+ 'Options:',\n+ ' --help Show help [boolean]',\n+ ' --version Show version number [boolean]',\n+ ''\n+ ])\n+ })\n+\n+ it('allows a builder to disable usage with null after mutiple usage calls', () => {\n+ const r = checkUsage(() => yargs('upload --help')\n+ .command('upload', 'upload something', yargs => yargs.usage('$0 upload [something]').usage('$0 upload [something else]').usage(null), (argv) => {})\n+ .wrap(null)\n+ .argv\n+ )\n+\n+ r.logs[0].split('\\n').should.deep.equal([\n+ 'Options:',\n+ ' --help Show help [boolean]',\n+ ' --version Show version number [boolean]',\n+ ''\n+ ])\n+ })\n})\ndescribe('epilogue', () => {\n", "new_path": "test/usage.js", "old_path": "test/usage.js" } ]
JavaScript
MIT License
yargs/yargs
feat: multiple usage calls are now collected, not replaced (#958)
1
feat
null
743,916
27.09.2017 02:09:59
-36,000
3bb8771876e6c62e7e44b64d62f12a8ede9120ab
fix: config and normalise can be disabled with false
[ { "change_type": "MODIFY", "diff": "@@ -1186,6 +1186,17 @@ describe('yargs dsl tests', () => {\nargv.foo.should.equal('baz')\n})\n+ it('can be disabled with option shorthand', () => {\n+ const argv = yargs('--config ./test/fixtures/config.json')\n+ .option('config', {\n+ config: false,\n+ global: false\n+ })\n+ .argv\n+\n+ argv.config.should.equal('./test/fixtures/config.json')\n+ })\n+\nit('allows to pass a configuration object', () => {\nconst argv = yargs\n.config({foo: 1, bar: 2})\n@@ -1285,6 +1296,17 @@ describe('yargs dsl tests', () => {\nargv.path = '/foo/bar//baz/asdf/quux/..'\nargv.path.should.equal(['', 'foo', 'bar', 'baz', 'asdf'].join(path.sep))\n})\n+\n+ it('can be disabled with option shorthand', () => {\n+ const argv = yargs('--path /batman')\n+ .option('path', {\n+ normalize: false\n+ })\n+ .argv\n+\n+ argv.path = 'mongodb://url'\n+ argv.path.should.equal('mongodb://url')\n+ })\n})\ndescribe('narg', () => {\n", "new_path": "test/yargs.js", "old_path": "test/yargs.js" }, { "change_type": "MODIFY", "diff": "@@ -572,10 +572,6 @@ function Yargs (processArgs, cwd, parentRequire) {\nself.demandOption(key, typeof opt.demandOption === 'string' ? opt.demandOption : undefined)\n}\n- if ('config' in opt) {\n- self.config(key, opt.configParser)\n- }\n-\nif ('conflicts' in opt) {\nself.conflicts(key, opt.conflicts)\n}\n@@ -592,7 +588,11 @@ function Yargs (processArgs, cwd, parentRequire) {\nself.nargs(key, opt.nargs)\n}\n- if ('normalize' in opt) {\n+ if (opt.config) {\n+ self.config(key, opt.configParser)\n+ }\n+\n+ if (opt.normalize) {\nself.normalize(key)\n}\n", "new_path": "yargs.js", "old_path": "yargs.js" } ]
JavaScript
MIT License
yargs/yargs
fix: config and normalise can be disabled with false (#952)
1
fix
null
815,746
27.09.2017 09:14:51
-10,800
c76d4100f2edee5912796131151faea6fee895f2
fix: Clear all selected values before new model write action
[ { "change_type": "MODIFY", "diff": "@@ -40,6 +40,7 @@ export class ItemsList {\nclearSelected() {\nthis._selected.forEach((item) => {\nitem.selected = false;\n+ item.marked = false;\n});\nthis._selected = [];\n}\n", "new_path": "src/lib/src/items-list.ts", "old_path": "src/lib/src/items-list.ts" }, { "change_type": "MODIFY", "diff": "@@ -179,6 +179,7 @@ export class NgSelectComponent implements OnInit, ControlValueAccessor {\n}\nwriteValue(value: any): void {\n+ this.itemsList.clearSelected();\nif (value) {\nif (this.multiple) {\nvalue.forEach(item => {\n", "new_path": "src/lib/src/ng-select.component.ts", "old_path": "src/lib/src/ng-select.component.ts" }, { "change_type": "MODIFY", "diff": "@@ -2,6 +2,7 @@ export interface NgOption {\n[name: string]: any;\nselected?: boolean;\ndisabled?: boolean;\n+ marked?: boolean;\nlabel?: string;\nvalue?: string;\n}\n", "new_path": "src/lib/src/ng-select.types.ts", "old_path": "src/lib/src/ng-select.types.ts" } ]
TypeScript
MIT License
ng-select/ng-select
fix: Clear all selected values before new model write action
1
fix
null
815,746
27.09.2017 18:00:40
-10,800
5f30ce8cf79b924fe3f95f3cb96956beb98956e1
fix: Check if change detector is not destroyed
[ { "change_type": "MODIFY", "diff": "import {\nComponent,\nOnInit,\n+ OnDestroy,\nforwardRef,\nChangeDetectorRef,\nInput,\n@@ -41,7 +42,7 @@ const NGB_ANG_SELECT_VALUE_ACCESSOR = {\n'role': 'dropdown'\n}\n})\n-export class NgSelectComponent implements OnInit, ControlValueAccessor {\n+export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccessor {\n@ContentChild(NgOptionDirective) optionTemplateRef: TemplateRef<any>;\n@ContentChild(NgDisplayDirective) displayTemplateRef: TemplateRef<any>;\n@@ -112,6 +113,10 @@ export class NgSelectComponent implements OnInit, ControlValueAccessor {\nthis.bindLabel = this.bindLabel || 'label';\n}\n+ ngOnDestroy() {\n+ this.changeDetectorRef.detach();\n+ }\n+\n@HostListener('keydown', ['$event'])\nhandleKeyDown($event: KeyboardEvent) {\nif (KeyCode[$event.which]) {\n@@ -192,8 +197,7 @@ export class NgSelectComponent implements OnInit, ControlValueAccessor {\n} else {\nthis._value = null;\n}\n-\n- this.changeDetectorRef.detectChanges();\n+ this.detectChanges();\n}\nregisterOnChange(fn: any): void {\n@@ -278,15 +282,15 @@ export class NgSelectComponent implements OnInit, ControlValueAccessor {\n}\nshowPlaceholder() {\n- return this.placeholder && !isDefined(this.value) && !this.filterValue;\n+ return this.placeholder && !this.isValueSet(this.value) && !this.filterValue;\n}\nshowValue() {\n- return !this.filterValue && isDefined(this.value);\n+ return !this.filterValue && this.isValueSet(this.value);\n}\nshowClear() {\n- return this.clearable && isDefined(this.value) && !this.isDisabled;\n+ return this.clearable && this.isValueSet(this.value) && !this.isDisabled;\n}\nshowFilter() {\n@@ -437,8 +441,19 @@ export class NgSelectComponent implements OnInit, ControlValueAccessor {\nprivate isTypeahead() {\nreturn this.typeahead && this.typeahead.observers.length > 0;\n}\n+\n+ private detectChanges() {\n+ if (!(<any>this.changeDetectorRef).destroyed) {\n+ this.changeDetectorRef.detectChanges();\n+ }\n}\n-function isDefined(value: any): boolean {\n+ private isValueSet(value: any): boolean {\n+ if (this.multiple) {\n+ return !!value && value.length > 0;\n+ }\nreturn !!value;\n}\n+}\n+\n+\n", "new_path": "src/lib/src/ng-select.component.ts", "old_path": "src/lib/src/ng-select.component.ts" } ]
TypeScript
MIT License
ng-select/ng-select
fix: Check if change detector is not destroyed
1
fix
null
573,227
28.09.2017 09:38:32
-7,200
dae48df3ce9b420cb9624b3c1d444681ff3b4f82
chore(package): update dependencies ( mime has a known security vulnabirity: )
[ { "change_type": "MODIFY", "diff": "\"http-signature\": \"^1.0.0\",\n\"lodash\": \"^4.17.4\",\n\"lru-cache\": \"^4.0.1\",\n- \"mime\": \"^1.4.0\",\n+ \"mime\": \"^1.4.1\",\n\"negotiator\": \"^0.6.1\",\n\"once\": \"^1.3.0\",\n\"pidusage\": \"^1.1.6\",\n\"devDependencies\": {\n\"chai\": \"^4.0.1\",\n\"cover\": \"^0.2.9\",\n- \"coveralls\": \"^2.13.0\",\n+ \"coveralls\": \"^2.13.2\",\n\"eslint\": \"^3.11.1\",\n\"filed\": \"^0.1.0\",\n\"istanbul\": \"^0.4.1\",\n\"mkdirp\": \"^0.5.1\",\n\"mocha\": \"^3.2.0\",\n\"nodeunit\": \"^0.11.0\",\n- \"nsp\": \"^2.2.0\",\n+ \"nsp\": \"^2.8.1\",\n\"proxyquire\": \"^1.8.0\",\n- \"restify-clients\": \"^1.2.1\",\n- \"rimraf\": \"^2.4.3\",\n+ \"restify-clients\": \"^1.5.2\",\n+ \"rimraf\": \"^2.6.2\",\n\"validator\": \"^7.0.0\",\n- \"watershed\": \"^0.3.0\"\n+ \"watershed\": \"^0.3.4\"\n},\n\"license\": \"MIT\",\n\"scripts\": {\n", "new_path": "package.json", "old_path": "package.json" } ]
JavaScript
MIT License
restify/node-restify
chore(package): update dependencies ( mime has a known security vulnabirity: https://nodesecurity.io/advisories/534 )
1
chore
package
815,745
28.09.2017 16:13:10
-10,800
571319c3553189b7672346513f373cd5b974d21e
fix: click issue using custom template closes
[ { "change_type": "MODIFY", "diff": "<div class=\"as-value\" *ngIf=\"showValue()\">\n<span class=\"as-value-label\" role=\"option\" aria-selected=\"true\">\n<ng-template\n- *ngIf=\"displayTemplateRef\"\n- [ngTemplateOutlet]=\"displayTemplateRef.template\"\n- [ngOutletContext]=\"getDisplayTemplateContext()\">\n+ *ngIf=\"labelTemplate\"\n+ [ngTemplateOutlet]=\"labelTemplate\"\n+ [ngTemplateOutletContext]=\"getDisplayTemplateContext()\">\n</ng-template>\n- <span *ngIf=\"!displayTemplateRef\">{{getLabelValue(value)}}</span>\n+ <span *ngIf=\"!labelTemplate\">{{getLabelValue(value)}}</span>\n</span>\n</div>\n</ng-container>\n[class.selected]=\"item.selected\"\n[class.marked]=\"item.marked\">\n- <span *ngIf=\"!optionTemplateRef\">{{item[bindLabel]}}</span>\n+ <span *ngIf=\"!optionTemplate\">{{item[bindLabel]}}</span>\n- <ng-template *ngIf=\"optionTemplateRef\"\n- [ngTemplateOutlet]=\"optionTemplateRef.template\"\n- [ngOutletContext]=\"getOptionTemplateContext(item, index, first, last, even, odd)\">\n+ <ng-template *ngIf=\"optionTemplate\"\n+ [ngTemplateOutlet]=\"optionTemplate\"\n+ [ngTemplateOutletContext]=\"{ item: item, index: index, first: first, last: last, even: even, odd: odd }\">\n</ng-template>\n</div>\n</virtual-scroll>\n", "new_path": "src/lib/src/ng-select.component.html", "old_path": "src/lib/src/ng-select.component.html" }, { "change_type": "MODIFY", "diff": "@@ -15,6 +15,7 @@ import {\nViewChild,\nElementRef,\nChangeDetectionStrategy,\n+ AfterContentInit\n} from '@angular/core';\n@@ -42,10 +43,10 @@ const NGB_ANG_SELECT_VALUE_ACCESSOR = {\n'role': 'dropdown'\n}\n})\n-export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccessor {\n+export class NgSelectComponent implements OnInit, OnDestroy, AfterContentInit, ControlValueAccessor {\n- @ContentChild(NgOptionDirective) optionTemplateRef: TemplateRef<any>;\n- @ContentChild(NgDisplayDirective) displayTemplateRef: TemplateRef<any>;\n+ @ContentChild(NgOptionDirective) optionDirective: NgOptionDirective;\n+ @ContentChild(NgDisplayDirective) displayDirective: NgDisplayDirective;\n@ViewChild(VirtualScrollComponent) dropdownList: VirtualScrollComponent;\n@ViewChild('filterInput') filterInput;\n@@ -76,6 +77,9 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\n@HostBinding('class.focused') isFocused = false;\n@HostBinding('class.disabled') isDisabled = false;\n+ optionTemplate: TemplateRef<any>;\n+ labelTemplate: TemplateRef<any>;\n+\nitemsList = new ItemsList([], false);\nviewPortItems: NgOption[] = [];\nisLoading = false;\n@@ -108,6 +112,15 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\nthis.bindLabel = this.bindLabel || 'label';\n}\n+ ngAfterContentInit() {\n+ if (this.optionDirective) {\n+ this.optionTemplate = this.optionDirective.template;\n+ }\n+ if (this.displayDirective) {\n+ this.labelTemplate = this.displayDirective.template;\n+ }\n+ }\n+\nngOnDestroy() {\nthis.changeDetectorRef.detach();\n}\n@@ -232,17 +245,6 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\nreturn this.itemsList.value ? { item: this.itemsList.value } : { item: {} };\n}\n- getOptionTemplateContext(item: any, index: number, first: boolean, last: boolean, even: boolean, odd: boolean) {\n- return {\n- item: item || {},\n- index: index,\n- first: first,\n- last: last,\n- even: even,\n- odd: odd\n- };\n- }\n-\ntoggle(item: NgOption) {\nif (!item || item.disabled || this.isDisabled) {\nreturn;\n", "new_path": "src/lib/src/ng-select.component.ts", "old_path": "src/lib/src/ng-select.component.ts" } ]
TypeScript
MIT License
ng-select/ng-select
fix: click issue using custom template closes #6
1
fix
null
815,746
30.09.2017 11:58:13
-10,800
ceca2f22874db62ed4b5706dcabe8c387523f052
chore: simplify detect changes usages
[ { "change_type": "MODIFY", "diff": "@@ -26,15 +26,13 @@ describe('NgSelectComponent', function () {\n// select second city\nselectOption(fixture, KeyCode.ArrowDown, 1);\n- fixture.detectChanges();\n- tick();\n+ tickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.selectedCity).toEqual(jasmine.objectContaining(fixture.componentInstance.cities[1]));\n// clear select\nfixture.componentInstance.select.clear();\n- fixture.detectChanges();\n- tick();\n+ tickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.selectedCity).toEqual(null);\ndiscardPeriodicTasks();\n@@ -51,15 +49,13 @@ describe('NgSelectComponent', function () {\n// select first city\nfixture.componentInstance.selectedCity = fixture.componentInstance.cities[0];\n- fixture.detectChanges();\n- tick();\n+ tickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.value).toEqual(jasmine.objectContaining(fixture.componentInstance.cities[0]));\n// clear model\nfixture.componentInstance.selectedCity = null;\n- fixture.detectChanges();\n- tick();\n+ tickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.value).toEqual(null);\ndiscardPeriodicTasks();\n@@ -77,17 +73,17 @@ describe('NgSelectComponent', function () {\n// select first city\nfixture.componentInstance.selectedCity = fixture.componentInstance.cities[0];\n- fixture.detectChanges();\n+ tickAndDetectChanges(fixture);\n// toggle to hide/show\nfixture.componentInstance.toggleVisible();\n- fixture.detectChanges();\n+ tickAndDetectChanges(fixture);\nfixture.componentInstance.toggleVisible();\n- fixture.detectChanges();\n+ tickAndDetectChanges(fixture);\n// select second city\nfixture.componentInstance.selectedCity = null;\n- fixture.detectChanges();\n+ tickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.value).toEqual(null);\n}));\n@@ -102,15 +98,13 @@ describe('NgSelectComponent', function () {\n</ng-select>`);\nfixture.componentInstance.selectedCity = fixture.componentInstance.cities[0];\n- fixture.detectChanges();\n- tick();\n+ tickAndDetectChanges(fixture);\nconst lastSelection: any = fixture.componentInstance.select.value;\nexpect(lastSelection.selected).toBeTruthy();\nfixture.componentInstance.selectedCity = null;\n- fixture.detectChanges();\n- tick();\n+ tickAndDetectChanges(fixture);\nexpect(lastSelection.selected).toBeFalsy();\n}));\n});\n@@ -129,16 +123,14 @@ describe('NgSelectComponent', function () {\n// from component to model\nselectOption(fixture, KeyCode.ArrowDown, 0);\n- fixture.detectChanges();\n- tick();\n+ tickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.selectedCityId).toEqual(1);\n// from model to component\nfixture.componentInstance.selectedCityId = 2;\n- fixture.detectChanges();\n- tick();\n+ tickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.value).toEqual(jasmine.objectContaining(fixture.componentInstance.cities[1]));\ndiscardPeriodicTasks();\n@@ -155,16 +147,14 @@ describe('NgSelectComponent', function () {\n// from component to model\nselectOption(fixture, KeyCode.ArrowDown, 0);\n- fixture.detectChanges();\n- tick();\n+ tickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.selectedCity).toEqual(jasmine.objectContaining(fixture.componentInstance.cities[0]));\n// from model to component\nfixture.componentInstance.selectedCity = fixture.componentInstance.cities[1];\n- fixture.detectChanges();\n- tick();\n+ tickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.value).toEqual(jasmine.objectContaining(fixture.componentInstance.cities[1]));\ndiscardPeriodicTasks();\n@@ -183,8 +173,7 @@ describe('NgSelectComponent', function () {\n[(ngModel)]=\"selectedCity\">\n</ng-select>`);\n- fixture.detectChanges();\n- tick();\n+ tickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.value).toEqual(jasmine.objectContaining({ id: 2, name: 'Kaunas', selected: true }));\n}));\n@@ -197,8 +186,7 @@ describe('NgSelectComponent', function () {\n[(ngModel)]=\"selectedCity\">\n</ng-select>`);\n- fixture.detectChanges();\n- tick();\n+ tickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.value).toEqual(jasmine.objectContaining({ id: 2, name: 'Kaunas', selected: true }));\n}));\n@@ -211,8 +199,7 @@ describe('NgSelectComponent', function () {\n[(ngModel)]=\"selectedCity\">\n</ng-select>`);\n- fixture.detectChanges();\n- tick();\n+ tickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.value).toEqual(jasmine.objectContaining({ id: 2, name: 'Kaunas', selected: true }));\n}));\n@@ -226,8 +213,7 @@ describe('NgSelectComponent', function () {\n[(ngModel)]=\"selectedCity\">\n</ng-select>`);\n- fixture.detectChanges();\n- tick();\n+ tickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.value).toEqual(null);\n}));\n});\n@@ -247,8 +233,7 @@ describe('NgSelectComponent', function () {\n[(ngModel)]=\"selectedCity\">\n</ng-select>`);\n- fixture.detectChanges();\n- tick();\n+ tickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.value).toEqual(result)\n}));\n@@ -263,8 +248,7 @@ describe('NgSelectComponent', function () {\n[(ngModel)]=\"selectedCity\">\n</ng-select>`);\n- fixture.detectChanges();\n- tick();\n+ tickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.value).toEqual(result);\n}));\n});\n@@ -289,10 +273,9 @@ describe('NgSelectComponent', function () {\nit('should open empty dropdown', fakeAsync(() => {\nfixture.componentInstance.cities = [];\n- fixture.detectChanges();\n- tick();\n+ tickAndDetectChanges(fixture);\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\n- tick();\n+ tickAndDetectChanges(fixture);\nconst text = fixture.debugElement.query(By.css('.as-option')).nativeElement.innerHTML;\nexpect(text).toContain('No items found');\n}));\n@@ -324,17 +307,15 @@ describe('NgSelectComponent', function () {\nconst city: any = fixture.componentInstance.cities[0];\ncity.disabled = true;\nselectOption(fixture, KeyCode.ArrowDown, 1);\n- fixture.detectChanges();\n- tick();\n+ tickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.value).toEqual(jasmine.objectContaining(fixture.componentInstance.cities[1]));\n}));\nit('select previous value on arrow up', fakeAsync(() => {\nfixture.componentInstance.selectedCity = fixture.componentInstance.cities[1];\n- fixture.detectChanges();\n- tick();\n+ tickAndDetectChanges(fixture);\nselectOption(fixture, KeyCode.ArrowUp, 1);\n- tick();\n+ tickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.value).toEqual(jasmine.objectContaining(fixture.componentInstance.cities[0]));\n}));\n@@ -451,18 +432,18 @@ describe('NgSelectComponent', function () {\nit('should select several items', fakeAsync(() => {\nselectOption(fixture, KeyCode.ArrowDown, 1);\nselectOption(fixture, KeyCode.ArrowDown, 2);\n- detectChanges();\n+ tickAndDetectChanges(fixture);\nexpect((<NgOption[]>fixture.componentInstance.select.value).length).toBe(2);\n}));\nit('should toggle selected item', fakeAsync(() => {\nselectOption(fixture, KeyCode.ArrowDown, 0);\nselectOption(fixture, KeyCode.ArrowDown, 2);\n- detectChanges();\n+ tickAndDetectChanges(fixture);\nexpect((<NgOption[]>fixture.componentInstance.select.value).length).toBe(2);\nselectOption(fixture, KeyCode.ArrowDown, 1);\n- detectChanges();\n+ tickAndDetectChanges(fixture);\nexpect((<NgOption[]>fixture.componentInstance.select.value).length).toBe(1);\nexpect(fixture.componentInstance.select.value[0].name).toBe('Pabrade');\n}));\n@@ -473,12 +454,7 @@ describe('NgSelectComponent', function () {\nexpect((<NgOption[]>fixture.componentInstance.select.value).length).toBe(1);\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Enter);\nexpect((<NgOption[]>fixture.componentInstance.select.value).length).toBe(1);\n- })\n-\n- function detectChanges() {\n- fixture.detectChanges();\n- tick();\n- }\n+ });\n});\ndescribe('Placeholder', () => {\n@@ -560,28 +536,34 @@ describe('NgSelectComponent', function () {\n</ng-select>`);\n});\n- it('should push term to custom observable', async(() => {\n+ it('should push term to custom observable', fakeAsync(() => {\nfixture.componentInstance.customFilter.subscribe(term => {\nexpect(term).toBe('vilnius');\n});\nfixture.componentInstance.select.onFilter({ target: { value: 'vilnius' } });\n+ tickAndDetectChanges(fixture);\n}));\n- it('should mark first item when typeahead results are loaded', async(() => {\n+ it('should mark first item when typeahead results are loaded', fakeAsync(() => {\nfixture.componentInstance.customFilter.subscribe();\nfixture.componentInstance.select.onFilter({ target: { value: 'buk' } });\nfixture.componentInstance.cities = [{ id: 4, name: 'Bukiskes' }];\n- fixture.detectChanges();\n+\n+ tickAndDetectChanges(fixture);\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Enter);\n+\nexpect(fixture.componentInstance.select.value).toEqual(jasmine.objectContaining({ id: 4, name: 'Bukiskes' }))\n}));\n- it('should start and stop loading indicator', async(() => {\n+ it('should start and stop loading indicator', fakeAsync(() => {\nfixture.componentInstance.customFilter.subscribe();\nfixture.componentInstance.select.onFilter({ target: { value: 'buk' } });\n+\nexpect(fixture.componentInstance.select.isLoading).toBeTruthy();\n+\nfixture.componentInstance.cities = [{ id: 4, name: 'Bukiskes' }];\n- fixture.detectChanges();\n+ tickAndDetectChanges(fixture);\n+\nexpect(fixture.componentInstance.select.isLoading).toBeFalsy();\n}));\n});\n@@ -600,7 +582,7 @@ describe('NgSelectComponent', function () {\nfixture.componentInstance.select.open();\nfixture.componentInstance.select.open();\n- tick();\n+ tickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.onOpen).toHaveBeenCalledTimes(1);\n}));\n@@ -618,7 +600,7 @@ describe('NgSelectComponent', function () {\nfixture.componentInstance.select.open();\nfixture.componentInstance.select.close();\nfixture.componentInstance.select.close();\n- tick();\n+ tickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.onClose).toHaveBeenCalledTimes(1);\n}));\n@@ -634,8 +616,7 @@ describe('NgSelectComponent', function () {\nspyOn(fixture.componentInstance, 'onChange');\nfixture.componentInstance.selectedCity = fixture.componentInstance.cities[0];\n- fixture.detectChanges();\n- tick();\n+ tickAndDetectChanges(fixture);\nfixture.componentInstance.select.select(fixture.componentInstance.cities[1]);\n@@ -653,8 +634,7 @@ describe('NgSelectComponent', function () {\nspyOn(fixture.componentInstance, 'onChange');\nfixture.componentInstance.selectedCity = fixture.componentInstance.cities[0];\n- fixture.detectChanges();\n- tick();\n+ tickAndDetectChanges(fixture);\nfixture.componentInstance.select.select(fixture.componentInstance.cities[0]);\n@@ -663,6 +643,11 @@ describe('NgSelectComponent', function () {\n});\n});\n+function tickAndDetectChanges(fixture) {\n+ fixture.detectChanges();\n+ tick();\n+}\n+\nfunction selectOption(fixture, key: KeyCode, steps: number) {\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space); // open\nfor (let i = 0; i < steps; i++) {\n", "new_path": "src/lib/src/ng-select.component.spec.ts", "old_path": "src/lib/src/ng-select.component.spec.ts" }, { "change_type": "MODIFY", "diff": "@@ -17,7 +17,6 @@ import {\nChangeDetectionStrategy\n} from '@angular/core';\n-\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { NgOptionTemplateDirective, NgLabelTemplateDirective } from './ng-templates.directive';\nimport { VirtualScrollComponent } from './virtual-scroll.component';\n", "new_path": "src/lib/src/ng-select.component.ts", "old_path": "src/lib/src/ng-select.component.ts" } ]
TypeScript
MIT License
ng-select/ng-select
chore: simplify detect changes usages
1
chore
null
815,746
30.09.2017 17:32:19
-10,800
95b6e9932e8ce0f68509f0dc3f7e06d6415e7144
fix: handle clear and arrow click correctly
[ { "change_type": "MODIFY", "diff": "@@ -641,6 +641,73 @@ describe('NgSelectComponent', function () {\nexpect(fixture.componentInstance.onChange).toHaveBeenCalledTimes(1);\n}));\n});\n+\n+ describe('Clear icon click', () => {\n+ let fixture: ComponentFixture<NgSelectBasicTestCmp>;\n+ let clickIcon = null;\n+\n+ beforeEach(fakeAsync(() => {\n+ fixture = createTestingModule(\n+ NgSelectBasicTestCmp,\n+ `<ng-select [items]=\"cities\"\n+ bindLabel=\"name\"\n+ [(ngModel)]=\"selectedCity\">\n+ </ng-select>`);\n+\n+ fixture.componentInstance.selectedCity = fixture.componentInstance.cities[0];\n+ tickAndDetectChanges(fixture);\n+ clickIcon = fixture.debugElement.query(By.css('.as-clear-zone'));\n+ }));\n+\n+ it('should clear model on clear icon click', fakeAsync(() => {\n+ clickIcon.triggerEventHandler('click', {});\n+ tickAndDetectChanges(fixture);\n+\n+ expect(fixture.componentInstance.selectedCity).toBe(null);\n+ }));\n+\n+ it('should not open dropdown on clear click', fakeAsync(() => {\n+ clickIcon.triggerEventHandler('click', {});\n+ tickAndDetectChanges(fixture);\n+\n+ expect(fixture.componentInstance.select.isOpen).toBe(false);\n+ }));\n+ });\n+\n+ describe('Arrow icon click', () => {\n+ let fixture: ComponentFixture<NgSelectBasicTestCmp>;\n+ let arrowIcon = null;\n+\n+ beforeEach(fakeAsync(() => {\n+ fixture = createTestingModule(\n+ NgSelectBasicTestCmp,\n+ `<ng-select [items]=\"cities\"\n+ bindLabel=\"name\"\n+ [(ngModel)]=\"selectedCity\">\n+ </ng-select>`);\n+\n+ fixture.componentInstance.selectedCity = fixture.componentInstance.cities[0];\n+ tickAndDetectChanges(fixture);\n+ arrowIcon = fixture.debugElement.query(By.css('.as-arrow-zone'));\n+ }));\n+\n+ it('should toggle dropdown', fakeAsync(() => {\n+ // open\n+ arrowIcon.triggerEventHandler('click', {});\n+ tickAndDetectChanges(fixture);\n+ expect(fixture.componentInstance.select.isOpen).toBe(true);\n+\n+ // close\n+ arrowIcon.triggerEventHandler('click', {});\n+ tickAndDetectChanges(fixture);\n+ expect(fixture.componentInstance.select.isOpen).toBe(false);\n+\n+ // open\n+ arrowIcon.triggerEventHandler('click', {});\n+ tickAndDetectChanges(fixture);\n+ expect(fixture.componentInstance.select.isOpen).toBe(true);\n+ }));\n+ });\n});\nfunction tickAndDetectChanges(fixture) {\n", "new_path": "src/lib/src/ng-select.component.spec.ts", "old_path": "src/lib/src/ng-select.component.spec.ts" }, { "change_type": "MODIFY", "diff": "@@ -82,6 +82,8 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\nfilterValue: string = null;\nprivate _openClicked = false;\n+ private _clearClicked = false;\n+ private _arrowClicked = false;\nprivate propagateChange = (_: NgOption) => { };\nconstructor(private changeDetectorRef: ChangeDetectorRef, private elementRef: ElementRef) {\n@@ -174,8 +176,8 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\nif (!this.clearable) {\nreturn;\n}\n+ this._clearClicked = true;\nthis.itemsList.clearSelected();\n-\nthis.clearSearch();\nthis.notifyModelChanged();\n}\n@@ -206,10 +208,22 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\nthis.isDisabled = isDisabled;\n}\n+ handleArrowClick() {\n+ this._arrowClicked = true;\n+ if (this.isOpen) {\n+ this.close();\n+ } else {\n+ this.open();\n+ }\n+ }\n+\nopen() {\n- if (this.isDisabled || this.isOpen) {\n+ if (this.isDisabled || this.isOpen || this._clearClicked) {\n+ this._clearClicked = false;\nreturn;\n}\n+\n+ this._arrowClicked = false;\nthis._openClicked = true;\nthis.isOpen = true;\nthis.itemsList.markItem();\n", "new_path": "src/lib/src/ng-select.component.ts", "old_path": "src/lib/src/ng-select.component.ts" } ]
TypeScript
MIT License
ng-select/ng-select
fix: handle clear and arrow click correctly
1
fix
null
815,746
30.09.2017 18:07:04
-10,800
d6d6e8dbbaf1d8388fd28214506b687292365c19
feat: allow to configure module settings globally
[ { "change_type": "MODIFY", "diff": "@@ -33,7 +33,7 @@ const appRoutes: Routes = [\n@NgModule({\nimports: [\nBrowserModule,\n- NgSelectModule,\n+ NgSelectModule.forRoot({notFoundText: 'No items found', typeToSearchText: 'Type to search'}),\nCommonModule,\nFormsModule,\nReactiveFormsModule,\n", "new_path": "src/demo/app/app.module.ts", "old_path": "src/demo/app/app.module.ts" }, { "change_type": "MODIFY", "diff": "@@ -7,6 +7,8 @@ import { Observable } from 'rxjs/Observable';\ntemplate: `\n<label>Search with autocomplete in Github accounts</label>\n<ng-select [items]=\"items\"\n+ notFoundText=\"No results found\"\n+ typeToSearchText=\"Search for github account\"\nbindLabel=\"login\"\n[typeahead]=\"typeahead\"\n[(ngModel)]=\"githubAccount\">\n", "new_path": "src/demo/app/select-autocomplete.component.ts", "old_path": "src/demo/app/select-autocomplete.component.ts" }, { "change_type": "MODIFY", "diff": "export { NgSelectComponent } from './src/ng-select.component';\nexport { NgSelectModule } from './src/ng-select.module';\n-export { NgOption } from './src/ng-select.types';\n+export { NgOption, NgSelectConfig } from './src/ng-select.types';\n", "new_path": "src/lib/index.ts", "old_path": "src/lib/index.ts" }, { "change_type": "MODIFY", "diff": "<div class=\"as-menu\" *ngIf=\"showNoItemsFound()\">\n<div class=\"as-option disabled\">\n- No items found\n+ {{notFoundText}}\n</div>\n</div>\n<div class=\"as-menu\" *ngIf=\"showTypeToSearch()\">\n<div class=\"as-option disabled\">\n- Type to search\n+ {{typeToSearchText}}\n</div>\n</div>\n</div>\n", "new_path": "src/lib/src/ng-select.component.html", "old_path": "src/lib/src/ng-select.component.html" }, { "change_type": "MODIFY", "diff": "@@ -14,13 +14,14 @@ import {\nHostBinding,\nViewChild,\nElementRef,\n- ChangeDetectionStrategy\n+ ChangeDetectionStrategy,\n+ Optional\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { NgOptionTemplateDirective, NgLabelTemplateDirective } from './ng-templates.directive';\nimport { VirtualScrollComponent } from './virtual-scroll.component';\n-import { NgOption, KeyCode } from './ng-select.types';\n+import { NgOption, KeyCode, NgSelectConfig } from './ng-select.types';\nimport { ItemsList } from './items-list';\nimport { Subject } from 'rxjs/Subject';\n@@ -54,6 +55,8 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\n@Input() bindValue: string;\n@Input() clearable = true;\n@Input() placeholder: string;\n+ @Input() notFoundText = 'No items found';\n+ @Input() typeToSearchText = 'Type to search';\n@Input() typeahead: Subject<string>;\n@Input()\n@@ -86,7 +89,12 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\nprivate _arrowClicked = false;\nprivate propagateChange = (_: NgOption) => { };\n- constructor(private changeDetectorRef: ChangeDetectorRef, private elementRef: ElementRef) {\n+ constructor(\n+ @Optional() config: NgSelectConfig,\n+ private changeDetectorRef: ChangeDetectorRef,\n+ private elementRef: ElementRef\n+ ) {\n+ this.mergeConfig(config);\n}\n@Input()\n@@ -471,4 +479,12 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\n}\nreturn !!value;\n}\n+\n+ private mergeConfig(config: NgSelectConfig) {\n+ if (!config) {\n+ return;\n+ }\n+ this.notFoundText = config.notFoundText || this.notFoundText;\n+ this.typeToSearchText = config.typeToSearchText || this.typeToSearchText;\n+ }\n}\n", "new_path": "src/lib/src/ng-select.component.ts", "old_path": "src/lib/src/ng-select.component.ts" }, { "change_type": "MODIFY", "diff": "-import { NgModule } from '@angular/core';\n+import { NgModule, Optional, SkipSelf, ModuleWithProviders } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\n@@ -7,6 +7,7 @@ import { NgOptionTemplateDirective, NgLabelTemplateDirective } from './ng-templa\nimport { AngSearchFocusDirective } from './ng-search-focus.directive';\nimport { VirtualScrollModule } from './virtual-scroll.component';\nimport { SpinnerComponent } from './spinner.component';\n+import { NgSelectConfig } from './ng-select.types';\n@NgModule({\ndeclarations: [\n@@ -28,5 +29,19 @@ import { SpinnerComponent } from './spinner.component';\n]\n})\nexport class NgSelectModule {\n+ static forRoot(config: NgSelectConfig): ModuleWithProviders {\n+ return {\n+ ngModule: NgSelectModule,\n+ providers: [\n+ {provide: NgSelectConfig, useValue: config}\n+ ]\n+ };\n+ }\n+ constructor(@Optional() @SkipSelf() parentModule: NgSelectModule) {\n+ if (parentModule) {\n+ throw new Error(\n+ 'NgSelectModule is already loaded. Import it in the AppModule only');\n+ }\n+ }\n}\n", "new_path": "src/lib/src/ng-select.module.ts", "old_path": "src/lib/src/ng-select.module.ts" }, { "change_type": "MODIFY", "diff": "@@ -17,3 +17,8 @@ export enum KeyCode {\nArrowDown = 40,\nBackSpace = 8\n}\n+\n+export class NgSelectConfig {\n+ notFoundText = '';\n+ typeToSearchText = '';\n+}\n", "new_path": "src/lib/src/ng-select.types.ts", "old_path": "src/lib/src/ng-select.types.ts" } ]
TypeScript
MIT License
ng-select/ng-select
feat: allow to configure module settings globally
1
feat
null
815,746
30.09.2017 20:13:49
-10,800
014cca8f7a44fdc8bcebbed08e0f5ca74d557c6f
chore: remove concurrent event checks by adding $event.stopPropagation();
[ { "change_type": "MODIFY", "diff": "@@ -366,14 +366,6 @@ describe('NgSelectComponent', function () {\nexpect(fixture.componentInstance.select.isOpen).toBe(true);\n});\n-\n- it('prevent dropdown close if after first open', () => {\n- fixture.componentInstance.select.open();\n-\n- document.getElementById('close').click();\n-\n- expect(fixture.componentInstance.select.isOpen).toBe(true);\n- });\n});\ndescribe('Custom templates', () => {\n@@ -644,7 +636,7 @@ describe('NgSelectComponent', function () {\ndescribe('Clear icon click', () => {\nlet fixture: ComponentFixture<NgSelectBasicTestCmp>;\n- let clickIcon = null;\n+ let clickIcon: DebugElement = null;\nbeforeEach(fakeAsync(() => {\nfixture = createTestingModule(\n@@ -660,14 +652,14 @@ describe('NgSelectComponent', function () {\n}));\nit('should clear model on clear icon click', fakeAsync(() => {\n- clickIcon.triggerEventHandler('click', {});\n+ clickIcon.triggerEventHandler('click', {stopPropagation: () => {}});\ntickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.selectedCity).toBe(null);\n}));\nit('should not open dropdown on clear click', fakeAsync(() => {\n- clickIcon.triggerEventHandler('click', {});\n+ clickIcon.triggerEventHandler('click', {stopPropagation: () => {}});\ntickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.isOpen).toBe(false);\n@@ -676,7 +668,7 @@ describe('NgSelectComponent', function () {\ndescribe('Arrow icon click', () => {\nlet fixture: ComponentFixture<NgSelectBasicTestCmp>;\n- let arrowIcon = null;\n+ let arrowIcon: DebugElement = null;\nbeforeEach(fakeAsync(() => {\nfixture = createTestingModule(\n@@ -692,18 +684,19 @@ describe('NgSelectComponent', function () {\n}));\nit('should toggle dropdown', fakeAsync(() => {\n+ const clickArrow = () => arrowIcon.triggerEventHandler('click', {stopPropagation: () => {}});\n// open\n- arrowIcon.triggerEventHandler('click', {});\n+ clickArrow();\ntickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.isOpen).toBe(true);\n// close\n- arrowIcon.triggerEventHandler('click', {});\n+ clickArrow();\ntickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.isOpen).toBe(false);\n// open\n- arrowIcon.triggerEventHandler('click', {});\n+ clickArrow();\ntickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.isOpen).toBe(true);\n}));\n", "new_path": "src/lib/src/ng-select.component.spec.ts", "old_path": "src/lib/src/ng-select.component.spec.ts" }, { "change_type": "MODIFY", "diff": "@@ -84,9 +84,6 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\nisLoading = false;\nfilterValue: string = null;\n- private _openClicked = false;\n- private _clearClicked = false;\n- private _arrowClicked = false;\nprivate propagateChange = (_: NgOption) => {};\nconstructor(@Optional() config: NgSelectConfig,\n@@ -151,12 +148,6 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\n@HostListener('document:click', ['$event'])\nhandleDocumentClick($event) {\n- // prevent closing dropdown on first open click\n- if (this._openClicked) {\n- this._openClicked = false;\n- return;\n- }\n-\n// prevent close if clicked on select\nif (this.elementRef.nativeElement.contains($event.target)) {\nreturn;\n@@ -178,11 +169,29 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\n}\n}\n+ handleArrowClick($event: Event) {\n+ $event.stopPropagation();\n+ if (this.isOpen) {\n+ this.close();\n+ } else {\n+ this.open();\n+ }\n+ }\n+\n+ handleSelectClick($event: Event) {\n+ $event.stopPropagation();\n+ this.open();\n+ }\n+\n+ handleClearClick($event: Event) {\n+ $event.stopPropagation();\n+ this.clear();\n+ }\n+\nclear() {\nif (!this.clearable) {\nreturn;\n}\n- this._clearClicked = true;\nthis.itemsList.clearSelected();\nthis.clearSearch();\nthis.notifyModelChanged();\n@@ -214,23 +223,10 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\nthis.isDisabled = isDisabled;\n}\n- handleArrowClick() {\n- this._arrowClicked = true;\n- if (this.isOpen) {\n- this.close();\n- } else {\n- this.open();\n- }\n- }\n-\nopen() {\n- if (this.isDisabled || this.isOpen || this._clearClicked) {\n- this._clearClicked = false;\n+ if (this.isDisabled || this.isOpen) {\nreturn;\n}\n-\n- this._arrowClicked = false;\n- this._openClicked = true;\nthis.isOpen = true;\nthis.itemsList.markItem();\nthis.scrollToMarked();\n", "new_path": "src/lib/src/ng-select.component.ts", "old_path": "src/lib/src/ng-select.component.ts" } ]
TypeScript
MIT License
ng-select/ng-select
chore: remove concurrent event checks by adding $event.stopPropagation();
1
chore
null
815,746
30.09.2017 23:23:32
-10,800
80b6aa23aecb4adae27302ce0a320a93d976882a
fix: do not use document click HostListener HostListener on document click should not be used because it triggers change detection when it is not needed
[ { "change_type": "MODIFY", "diff": "@@ -15,7 +15,8 @@ import {\nViewChild,\nElementRef,\nChangeDetectionStrategy,\n- Optional\n+ Optional,\n+ Renderer2\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n@@ -85,11 +86,15 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\nfilterValue: string = null;\nprivate propagateChange = (_: NgOption) => {};\n+ private disposeDocumentClickListener = () => {};\nconstructor(@Optional() config: NgSelectConfig,\nprivate changeDetectorRef: ChangeDetectorRef,\n- private elementRef: ElementRef) {\n+ private elementRef: ElementRef,\n+ private renderer: Renderer2\n+ ) {\nthis.mergeConfig(config);\n+ this.handleDocumentClick();\n}\n@Input()\n@@ -115,6 +120,7 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\nngOnDestroy() {\nthis.changeDetectorRef.detach();\n+ this.disposeDocumentClickListener();\n}\n@HostListener('keydown', ['$event'])\n@@ -146,29 +152,6 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\n}\n}\n- @HostListener('document:click', ['$event'])\n- handleDocumentClick($event) {\n- // prevent close if clicked on select\n- if (this.elementRef.nativeElement.contains($event.target)) {\n- return;\n- }\n-\n- // prevent close if clicked on dropdown menu\n- const dropdown = this.getDropdownMenu();\n- if (dropdown && dropdown.contains($event.target)\n- ) {\n- return;\n- }\n-\n- if (this.isFocused) {\n- this.onInputBlur($event);\n- }\n-\n- if (this.isOpen) {\n- this.close();\n- }\n- }\n-\nhandleArrowClick($event: Event) {\n$event.stopPropagation();\nif (this.isOpen) {\n@@ -338,6 +321,32 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\nthis.itemsList.markItem(item);\n}\n+ private handleDocumentClick() {\n+ const handler = ($event) => {\n+ // prevent close if clicked on select\n+ if (this.elementRef.nativeElement.contains($event.target)) {\n+ return;\n+ }\n+\n+ // prevent close if clicked on dropdown menu\n+ const dropdown = this.getDropdownMenu();\n+ if (dropdown && dropdown.contains($event.target)\n+ ) {\n+ return;\n+ }\n+\n+ if (this.isFocused) {\n+ this.onInputBlur($event);\n+ }\n+\n+ if (this.isOpen) {\n+ this.close();\n+ }\n+ };\n+\n+ this.disposeDocumentClickListener = this.renderer.listen('document', 'click', handler);\n+ }\n+\nprivate validateWriteValue(value: any) {\nif (value instanceof Object && this.bindValue) {\nthrow new Error('Binding object with bindValue is not allowed.')\n", "new_path": "src/lib/src/ng-select.component.ts", "old_path": "src/lib/src/ng-select.component.ts" } ]
TypeScript
MIT License
ng-select/ng-select
fix: do not use document click HostListener HostListener on document click should not be used because it triggers change detection when it is not needed
1
fix
null
815,746
01.10.2017 00:09:48
-10,800
935ac7d20bdeb462dd4d6086bf1efd6924d69171
chore: add hover style on clear icon
[ { "change_type": "MODIFY", "diff": "@@ -110,7 +110,6 @@ ng-select {\nbackground-color: $color-selected;\nborder-radius: 2px;\nborder: 1px solid #c2e0ff;\n- border: 1px solid rgba(0, 126, 255, 0.24);\ndisplay: inline-block;\nfont-size: 0.9em;\nline-height: 1.4;\n@@ -120,11 +119,14 @@ ng-select {\n.as-clear {\ncursor: pointer;\n- border-bottom-left-radius: 2px;\n- border-top-left-radius: 2px;\n- border-left: 1px solid #c2e0ff;\n- border-left: 1px solid rgba(0, 126, 255, 0.24);\n+ border-bottom-right-radius: 2px;\n+ border-top-right-radius: 2px;\n+ border-right: 1px solid #c2e0ff;\npadding: 1px 5px 3px;\n+\n+ &:hover {\n+ background-color: #d8eafd;\n+ }\n}\n.as-value-label {\n", "new_path": "src/lib/src/ng-select.component.scss", "old_path": "src/lib/src/ng-select.component.scss" } ]
TypeScript
MIT License
ng-select/ng-select
chore: add hover style on clear icon
1
chore
null
815,746
01.10.2017 00:11:28
-10,800
43ef5b9572aa8b227bb1f0e6c95a6dbeea7aa5cc
fix: run virtual scroll calculations outside angular zone
[ { "change_type": "MODIFY", "diff": "@@ -94,7 +94,6 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\nprivate renderer: Renderer2\n) {\nthis.mergeConfig(config);\n- this.handleDocumentClick();\n}\n@Input()\n@@ -115,6 +114,7 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\n}\nngOnInit() {\n+ this.handleDocumentClick();\nthis.bindLabel = this.bindLabel || 'label';\n}\n", "new_path": "src/lib/src/ng-select.component.ts", "old_path": "src/lib/src/ng-select.component.ts" }, { "change_type": "MODIFY", "diff": "@@ -9,13 +9,12 @@ import {\nContentChild,\nElementRef,\nEventEmitter,\n- HostListener,\nInput,\n- NgModule,\n+ NgModule, NgZone,\nOnChanges,\nOnDestroy,\nOnInit,\n- Output,\n+ Output, Renderer2,\nSimpleChanges,\nViewChild\n} from '@angular/core';\n@@ -87,15 +86,6 @@ export class VirtualScrollComponent implements OnInit, OnChanges, OnDestroy {\n@Output()\nupdate: EventEmitter<any[]> = new EventEmitter<any[]>();\n- @Output()\n- change: EventEmitter<ChangeEvent> = new EventEmitter<ChangeEvent>();\n-\n- @Output()\n- start: EventEmitter<ChangeEvent> = new EventEmitter<ChangeEvent>();\n-\n- @Output()\n- end: EventEmitter<ChangeEvent> = new EventEmitter<ChangeEvent>();\n-\n@ViewChild('content', {read: ElementRef})\ncontentElementRef: ElementRef;\n@@ -108,45 +98,34 @@ export class VirtualScrollComponent implements OnInit, OnChanges, OnDestroy {\nprivate previousStart: number;\nprivate previousEnd: number;\nprivate startupLoop = true;\n- private _parentScroll: Element | Window;\n-\n- constructor(private element: ElementRef) {\n- }\n+ private disposeScrollListener = () => {};\n- @Input()\n- set parentScroll(element: Element | Window) {\n- if (this._parentScroll === element) {\n- return;\n- }\n- this.removeParentEventHandlers(this._parentScroll);\n- this._parentScroll = element;\n- this.addParentEventHandlers(this._parentScroll);\n- }\n-\n- get parentScroll(): Element | Window {\n- return this._parentScroll;\n+ constructor(private element: ElementRef, private zone: NgZone, private renderer: Renderer2) {\n}\nget enabled() {\nreturn this.items && this.items.length > 20;\n}\n- @HostListener('scroll')\n- onScroll() {\n+ handleScroll() {\n+ const handler = () => {\nif (!this.enabled) {\nthis.update.emit(this.items);\nreturn;\n}\nthis.refresh();\n+ };\n+ this.disposeScrollListener = this.renderer.listen(this.element.nativeElement, 'scroll', handler);\n}\nngOnInit() {\n+ this.handleScroll();\nthis.scrollbarWidth = 0; // this.element.nativeElement.offsetWidth - this.element.nativeElement.clientWidth;\nthis.scrollbarHeight = 0; // this.element.nativeElement.offsetHeight - this.element.nativeElement.clientHeight;\n}\nngOnDestroy() {\n- this.removeParentEventHandlers(this.parentScroll);\n+ this.disposeScrollListener();\n}\nngOnChanges(changes: SimpleChanges) {\n@@ -166,12 +145,13 @@ export class VirtualScrollComponent implements OnInit, OnChanges, OnDestroy {\nthis.update.emit(this.items);\nreturn;\n}\n-\n+ this.zone.runOutsideAngular(() => {\nrequestAnimationFrame(() => this.calculateItems());\n+ });\n}\nscrollInto(item: any) {\n- let el: Element = this.parentScroll instanceof Window ? document.body : this.parentScroll || this.element.nativeElement;\n+ let el: Element = this.element.nativeElement;\nlet index: number = (this.items || []).indexOf(item);\nif (index < 0 || index >= (this.items || []).length) {\nreturn;\n@@ -184,28 +164,6 @@ export class VirtualScrollComponent implements OnInit, OnChanges, OnDestroy {\nthis.refresh();\n}\n- private refreshHandler = () => {\n- this.refresh();\n- };\n-\n- private addParentEventHandlers(parentScroll: Element | Window) {\n- if (parentScroll) {\n- parentScroll.addEventListener('scroll', this.refreshHandler);\n- if (parentScroll instanceof Window) {\n- parentScroll.addEventListener('resize', this.refreshHandler);\n- }\n- }\n- }\n-\n- private removeParentEventHandlers(parentScroll: Element | Window) {\n- if (parentScroll) {\n- parentScroll.removeEventListener('scroll', this.refreshHandler);\n- if (parentScroll instanceof Window) {\n- parentScroll.removeEventListener('resize', this.refreshHandler);\n- }\n- }\n- }\n-\nprivate countItemsPerRow() {\nlet offsetTop;\nlet itemsPerRow;\n@@ -224,14 +182,11 @@ export class VirtualScrollComponent implements OnInit, OnChanges, OnDestroy {\nif (this.containerElementRef && this.containerElementRef.nativeElement) {\noffsetTop += this.containerElementRef.nativeElement.offsetTop;\n}\n- if (this.parentScroll) {\n- offsetTop += this.element.nativeElement.offsetTop;\n- }\nreturn offsetTop;\n}\nprivate calculateDimensions() {\n- let el: Element = this.parentScroll instanceof Window ? document.body : this.parentScroll || this.element.nativeElement;\n+ let el: Element = this.element.nativeElement;\nlet items = this.items || [];\nlet itemCount = items.length;\nlet viewWidth = el.clientWidth - this.scrollbarWidth;\n@@ -272,7 +227,8 @@ export class VirtualScrollComponent implements OnInit, OnChanges, OnDestroy {\n}\nprivate calculateItems() {\n- let el = this.parentScroll instanceof Window ? document.body : this.parentScroll || this.element.nativeElement;\n+ NgZone.assertNotInAngularZone();\n+ let el = this.element.nativeElement;\nlet d = this.calculateDimensions();\nlet items = this.items || [];\n@@ -305,25 +261,15 @@ export class VirtualScrollComponent implements OnInit, OnChanges, OnDestroy {\nif (start !== this.previousStart || end !== this.previousEnd) {\n// update the scroll list\n+ this.zone.run(() => {\nthis.update.emit(items.slice(start, end));\n-\n- // emit 'start' event\n- if (start !== this.previousStart && this.startupLoop === false) {\n- this.start.emit({start, end});\n- }\n-\n- // emit 'end' event\n- if (end !== this.previousEnd && this.startupLoop === false) {\n- this.end.emit({start, end});\n- }\n+ });\nthis.previousStart = start;\nthis.previousEnd = end;\nif (this.startupLoop === true) {\nthis.refresh();\n- } else {\n- this.change.emit({start, end});\n}\n} else if (this.startupLoop === true) {\n", "new_path": "src/lib/src/virtual-scroll.component.ts", "old_path": "src/lib/src/virtual-scroll.component.ts" } ]
TypeScript
MIT License
ng-select/ng-select
fix: run virtual scroll calculations outside angular zone
1
fix
null
807,849
02.10.2017 18:10:49
25,200
897b4bf92c07c67051ee66329199ea5f7040816c
chore: Update CHANGELOG for v2.3.0
[ { "change_type": "MODIFY", "diff": "+## v2.3.0 (2017-10-03)\n+\n+New options for `lerna import` and `lerna publish`, set `--loglevel` from lerna.json, and more!\n+\n+#### :rocket: Enhancement\n+* [#1019](https://github.com/lerna/lerna/pull/1019) Add `--flatten` option to use when merge conflicts cannot be imported. ([@dmaksimovic](https://github.com/dmaksimovic))\n+* [#1026](https://github.com/lerna/lerna/pull/1026) Add `--allow-branch` option to restrict publish to designated branches. ([@FaHeymann](https://github.com/FaHeymann))\n+* [#1029](https://github.com/lerna/lerna/pull/1029) Call version lifecycle scripts during publish. ([@cwmoo740](https://github.com/cwmoo740))\n+* [#1030](https://github.com/lerna/lerna/pull/1030) Add runScriptSync for use in version lifecycle methods. ([@cwmoo740](https://github.com/cwmoo740))\n+\n+#### :bug: Bug Fix\n+* [#1020](https://github.com/lerna/lerna/pull/1020) Use `--canary=<value>` as prerelease tag, not commit-ish. ([@achingbrain](https://github.com/achingbrain))\n+* [#1037](https://github.com/lerna/lerna/pull/1037) Support durable `--loglevel` config from lerna.json. ([@evocateur](https://github.com/evocateur))\n+* [#1041](https://github.com/lerna/lerna/pull/1041) Pass npmClientArgs to yarn workspaces install command. ([@evocateur](https://github.com/evocateur))\n+\n+#### :memo: Documentation\n+* [#1040](https://github.com/lerna/lerna/pull/1040) Tweak conventional message examples. ([@stevemao](https://github.com/stevemao))\n+\n+#### :house: Internal\n+* [#1038](https://github.com/lerna/lerna/pull/1038) Rename `npmPublishAsPrerelease` to `npmPublish` to avoid confusion. ([@Hypnosphi](https://github.com/Hypnosphi))\n+\n+#### Committers: 7\n+- Alex Potsides ([achingbrain](https://github.com/achingbrain))\n+- Daniel Stockman ([evocateur](https://github.com/evocateur))\n+- Darko Maksimovic ([dmaksimovic](https://github.com/dmaksimovic))\n+- Fabian Heymann ([FaHeymann](https://github.com/FaHeymann))\n+- Filipp Riabchun ([Hypnosphi](https://github.com/Hypnosphi))\n+- Jeffrey Young ([cwmoo740](https://github.com/cwmoo740))\n+- Steve Mao ([stevemao](https://github.com/stevemao))\n+\n## v2.2.0 (2017-09-15)\nA new command, tweaks to logging and init scaffolding, and documentation!\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" } ]
JavaScript
MIT License
lerna/lerna
chore: Update CHANGELOG for v2.3.0
1
chore
null
807,849
02.10.2017 18:17:25
25,200
efff3beaa863b3bec8ec9eb045e5035fd2e5c95d
chore: Update CHANGELOG for v2.3.1
[ { "change_type": "MODIFY", "diff": "+## v2.3.1 (2017-10-03)\n+\n+This is what happens when you forget to pull from upstream before publishing.\n+\n+#### :nail_care: Polish\n+* [#1025](https://github.com/lerna/lerna/pull/1025) Log which packages are throwing ECYCLE error. ([@FezVrasta](https://github.com/FezVrasta))\n+\n+#### Committers: 1\n+- Federico Zivolo ([FezVrasta](https://github.com/FezVrasta))\n+\n## v2.3.0 (2017-10-03)\nNew options for `lerna import` and `lerna publish`, set `--loglevel` from lerna.json, and more!\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" } ]
JavaScript
MIT License
lerna/lerna
chore: Update CHANGELOG for v2.3.1
1
chore
null
808,031
03.10.2017 10:30:57
-39,600
7aa16e5f30db7010733a412140a7a4da83b65b47
docs(README): tweak conventional message 1. Normally we lower case the header 2. The scope of a release should be just release (See the angular repo) [skip ci]
[ { "change_type": "MODIFY", "diff": "@@ -416,11 +416,11 @@ Useful for bypassing the user input prompt if you already know which version to\n#### --message, -m [msg]\n```sh\n-$ lerna publish -m \"chore: Publish %s\"\n-# commit message = \"chore: Publish v1.0.0\"\n+$ lerna publish -m \"chore(release): publish %s\"\n+# commit message = \"chore(release): publish v1.0.0\"\n-$ lerna publish -m \"chore: Publish\" --independent\n-# commit message = \"chore: Publish\n+$ lerna publish -m \"chore(release): publish\" --independent\n+# commit message = \"chore(release): publish\n#\n# - package-1@3.0.1\n# - package-2@1.5.4\"\n", "new_path": "README.md", "old_path": "README.md" } ]
JavaScript
MIT License
lerna/lerna
docs(README): tweak conventional message (#1040) 1. Normally we lower case the header 2. The scope of a release should be just release (See the angular repo) [skip ci]
1
docs
README
807,849
03.10.2017 14:21:34
25,200
b350871597d46da602eb54733bd398ff0c9b8d07
chore: use multiline template strings for verbose error messages
[ { "change_type": "MODIFY", "diff": "@@ -249,9 +249,11 @@ export default class Command {\nif (this.options.independent && !this.repository.isIndependent()) {\nthrow new ValidationError(\n\"EVERSIONMODE\",\n- \"You ran lerna with `--independent` or `-i`, but the repository is not set to independent mode. \" +\n- \"To use independent mode you need to set your `lerna.json` \\\"version\\\" to \\\"independent\\\". \" +\n- \"Then you won't need to pass the `--independent` or `-i` flags.\"\n+ dedent`\n+ You ran lerna with --independent or -i, but the repository is not set to independent mode.\n+ To use independent mode you need to set lerna.json's \"version\" property to \"independent\".\n+ Then you won't need to pass the --independent or -i flags.\n+ `\n);\n}\n@@ -261,9 +263,13 @@ export default class Command {\n) {\nthrow new ValidationError(\n\"EMISMATCH\",\n- `Lerna major version mismatch: The current version of lerna is ${this.lernaVersion}, ` +\n- `but the Lerna version in \\`lerna.json\\` is ${this.repository.initVersion}. ` +\n- `You can either run \\`lerna init\\` again or install \\`lerna@${this.repository.initVersion}\\`.`\n+ dedent`\n+ Incompatible local version of lerna detected!\n+ The running version of lerna is ${this.lernaVersion}, but the version in lerna.json is ${\n+ this.repository.initVersion\n+ }.\n+ You can either run 'lerna init' again or install 'lerna@^${this.repository.initVersion}'.\n+ `\n);\n}\n", "new_path": "src/Command.js", "old_path": "src/Command.js" } ]
JavaScript
MIT License
lerna/lerna
chore: use multiline template strings for verbose error messages
1
chore
null
448,039
04.10.2017 08:20:08
-7,200
0425053f54f06e1de9e9181989469eb84cad87cb
chore: cut release for v1.3.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=\"1.3.0\"></a>\n+# [1.3.0](https://github.com/dherges/ng-packagr/compare/v1.2.1...v1.3.0) (2017-10-04)\n+\n+\n+### Features\n+\n+* external dependencies from `[@angular](https://github.com/angular)/cdk` are supported by default ([4b20e29](https://github.com/dherges/ng-packagr/commit/4b20e29))\n+\n+\n+\n<a name=\"1.2.1\"></a>\n## [1.2.1](https://github.com/dherges/ng-packagr/compare/v1.2.0...v1.2.1) (2017-09-29)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"ng-packagr\",\n- \"version\": \"1.2.1\",\n+ \"version\": \"1.3.0\",\n\"description\": \"Compile and package a TypeScript library to Angular Package Format\",\n\"keywords\": [\n\"angular\",\n", "new_path": "package.json", "old_path": "package.json" } ]
TypeScript
MIT License
ng-packagr/ng-packagr
chore: cut release for v1.3.0
1
chore
null
815,746
04.10.2017 17:48:38
-10,800
5bcdda5d2300749c8d8fdfc3521b25ab0f37c6d2
fix: handle selected value when items are not loaded yet
[ { "change_type": "MODIFY", "diff": "@@ -46,7 +46,11 @@ export class SelectAutocompleteComponent {\n}\nloadGithubUsers(term: string): Observable<any[]> {\n+ if (term) {\nreturn this.http.get<any>(`https://api.github.com/search/users?q=${term}`).map(rsp => rsp.items);\n+ } else {\n+ return Observable.of([]);\n+ }\n}\n}\n", "new_path": "src/demo/app/examples/autocomplete.component.ts", "old_path": "src/demo/app/examples/autocomplete.component.ts" }, { "change_type": "MODIFY", "diff": "@@ -47,6 +47,10 @@ import { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n</ng-template>\n</ng-select>\n<small class=\"form-text text-muted\">Albums data from backend using HttpClient.</small>\n+ <br>\n+ <button class=\"btn btn-secondary btn-sm\" (click)=\"selectFirstAlbum()\">Select first album</button>\n+ <button class=\"btn btn-secondary btn-sm\" (click)=\"selectAlbumsRange(0, 10)\">Set 0-10 albums</button>\n+ <button class=\"btn btn-secondary btn-sm\" (click)=\"selectAlbumsRange(10, 20)\">Set 10-20 albums</button>\n</div>\n<hr>\n@@ -128,6 +132,7 @@ export class ReactiveFormsComponent {\n];\nalbums = [];\n+ allAlbums = [];\nphotos = [];\nconstructor(private fb: FormBuilder, private http: HttpClient, private modalService: NgbModal) {\n@@ -170,6 +175,11 @@ export class ReactiveFormsComponent {\nthis.heroForm.get('album').patchValue(this.albums[0].id);\n}\n+ selectAlbumsRange(from, to) {\n+ this.albums = this.allAlbums.slice(from, to);\n+ this.selectFirstAlbum();\n+ }\n+\nopenModel(content) {\nthis.modalService.open(content);\n}\n@@ -179,15 +189,16 @@ export class ReactiveFormsComponent {\n}\nprivate loadAlbums() {\n- this.http.get<any[]>('https://jsonplaceholder.typicode.com/albums').subscribe(rsp => {\n- this.albums = rsp;\n+ this.http.get<any[]>('https://jsonplaceholder.typicode.com/albums').subscribe(albums => {\n+ this.allAlbums = albums;\n+ this.albums = [...this.allAlbums];\nthis.selectFirstAlbum();\n});\n}\nprivate loadPhotos() {\n- this.http.get<any[]>('https://jsonplaceholder.typicode.com/photos').subscribe(rsp => {\n- this.photos = rsp;\n+ this.http.get<any[]>('https://jsonplaceholder.typicode.com/photos').subscribe(photos => {\n+ this.photos = photos;\nthis.selectFirstPhoto();\n});\n}\n", "new_path": "src/demo/app/examples/reactive-forms.component.ts", "old_path": "src/demo/app/examples/reactive-forms.component.ts" }, { "change_type": "MODIFY", "diff": "@@ -8,13 +8,7 @@ export class ItemsList {\nprivate _markedIndex = -1;\nprivate _selected: NgOption[] = [];\n- private _multiple: boolean;\n-\n- constructor(items: NgOption[], multiple: boolean) {\n- this.items = this.mapItems(items);\n- this.filteredItems = [...this.items];\n- this._multiple = multiple;\n- }\n+ private _multiple = false;\nget value(): NgOption | NgOption[] {\nif (this._multiple) {\n@@ -27,6 +21,16 @@ export class ItemsList {\nreturn this.filteredItems[this._markedIndex];\n}\n+ setItems(items: NgOption[]) {\n+ this.items = this.mapItems(items);\n+ this.filteredItems = [...this.items];\n+ }\n+\n+ setMultiple(multiple: boolean) {\n+ this._multiple = multiple;\n+ this._selected = [];\n+ }\n+\nselect(item: NgOption) {\nif (!this._multiple) {\nthis.clearSelected();\n@@ -35,6 +39,15 @@ export class ItemsList {\nitem.selected = true;\n}\n+ findItem(value, bindLabel: string, bindValue: string): NgOption {\n+ if (bindValue) {\n+ return this.items.find(x => x[bindValue] === value);\n+ }\n+ const index = this.items.indexOf(value);\n+ return index > -1 ? this.items[index] :\n+ this.items.find(x => x[bindLabel] === value[bindLabel])\n+ }\n+\nunselect(item: NgOption) {\nthis._selected = this._selected.filter(x => x !== item);\nitem.selected = false;\n", "new_path": "src/lib/src/items-list.ts", "old_path": "src/lib/src/items-list.ts" }, { "change_type": "DELETE", "diff": "-import { Directive, OnInit, ElementRef } from '@angular/core';\n-\n-@Directive({\n- selector: '[angSearchFocus]'\n-})\n-export class AngSearchFocusDirective implements OnInit {\n-\n- constructor(private elementRef: ElementRef) { };\n-\n- ngOnInit(): void {\n- this.elementRef.nativeElement.onFocus();\n- }\n-}\n", "new_path": null, "old_path": "src/lib/src/ng-search-focus.directive.ts" }, { "change_type": "MODIFY", "diff": "@@ -14,7 +14,7 @@ import { Subject } from 'rxjs/Subject';\ndescribe('NgSelectComponent', function () {\ndescribe('Model change detection', () => {\n- it('update ngModel on value change', fakeAsync(() => {\n+ it('should update ngModel on value change', fakeAsync(() => {\nconst fixture = createTestingModule(\nNgSelectModelChangesTestCmp,\n`<ng-select [items]=\"cities\"\n@@ -38,7 +38,7 @@ describe('NgSelectComponent', function () {\ndiscardPeriodicTasks();\n}));\n- it('update internal model on ngModel change', fakeAsync(() => {\n+ it('should update internal model on ngModel change', fakeAsync(() => {\nconst fixture = createTestingModule(\nNgSelectModelChangesTestCmp,\n`<ng-select [items]=\"cities\"\n@@ -61,7 +61,7 @@ describe('NgSelectComponent', function () {\ndiscardPeriodicTasks();\n}));\n- it('update internal model after it was toggled with *ngIf', fakeAsync(() => {\n+ it('should update internal model after it was toggled with *ngIf', fakeAsync(() => {\nconst fixture = createTestingModule(\nNgSelectModelChangesTestCmp,\n`<ng-select *ngIf=\"visible\"\n@@ -88,6 +88,24 @@ describe('NgSelectComponent', function () {\nexpect(fixture.componentInstance.select.value).toEqual(null);\n}));\n+ it('should set items correctly after ngModel set first', fakeAsync(() => {\n+ const fixture = createTestingModule(\n+ NgSelectModelChangesTestCmp,\n+ `<ng-select [items]=\"cities\"\n+ bindLabel=\"name\"\n+ [clearable]=\"true\"\n+ [(ngModel)]=\"selectedCity\">\n+ </ng-select>`);\n+\n+ const cities = [{id: 7, name: 'Pailgis'}];\n+ fixture.componentInstance.selectedCity = cities[0];\n+ tickAndDetectChanges(fixture);\n+ fixture.componentInstance.cities = cities;\n+ tickAndDetectChanges(fixture);\n+\n+ expect(fixture.componentInstance.select.value).toEqual(jasmine.objectContaining(cities[0]));\n+ }));\n+\nit('should clear previous value when setting new model', fakeAsync(() => {\nconst fixture = createTestingModule(\nNgSelectModelChangesTestCmp,\n@@ -262,6 +280,7 @@ describe('NgSelectComponent', function () {\nNgSelectBasicTestCmp,\n`<ng-select [items]=\"cities\"\nbindLabel=\"name\"\n+ [multiple]=\"multiple\"\n[(ngModel)]=\"selectedCity\">\n</ng-select>`);\n});\n@@ -382,7 +401,7 @@ describe('NgSelectComponent', function () {\n}));\nit('should remove last selected value when multiple', fakeAsync(() => {\n- fixture.componentInstance.select.multiple = true;\n+ fixture.componentInstance.multiple = true;\nfixture.componentInstance.cities = [...fixture.componentInstance.cities];\ntickAndDetectChanges(fixture);\nselectOption(fixture, KeyCode.ArrowDown, 1);\n@@ -549,9 +568,10 @@ describe('NgSelectComponent', function () {\n[(ngModel)]=\"selectedCity\">\n</ng-select>`);\n- fixture.detectChanges();\n+ tick(200);\nfixture.componentInstance.select.onFilter({ target: { value: 'vilnius' } });\ntick(200);\n+\nconst result = [jasmine.objectContaining({ id: 1, name: 'Vilnius' })];\nexpect(fixture.componentInstance.select.itemsList.filteredItems).toEqual(result);\n}));\n@@ -564,10 +584,11 @@ describe('NgSelectComponent', function () {\n[(ngModel)]=\"selectedCity\">\n</ng-select>`);\n- const result = jasmine.objectContaining(fixture.componentInstance.cities[2]);\n- fixture.detectChanges();\n+ tick(200);\nfixture.componentInstance.select.onFilter({ target: { value: 'pab' } });\ntick(200);\n+\n+ const result = jasmine.objectContaining(fixture.componentInstance.cities[2]);\nexpect(fixture.componentInstance.select.itemsList.markedItem).toEqual(result)\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Enter);\nexpect(fixture.componentInstance.select.value).toEqual(result);\n@@ -588,6 +609,9 @@ describe('NgSelectComponent', function () {\nfixture.componentInstance.customFilter.subscribe(term => {\nexpect(term).toBe('vilnius');\n});\n+\n+ tick(200);\n+\nfixture.componentInstance.select.onFilter({ target: { value: 'vilnius' } });\ntickAndDetectChanges(fixture);\n}));\n@@ -819,6 +843,7 @@ function createTestingModule<T>(cmp: Type<T>, template: string): ComponentFixtur\nclass NgSelectBasicTestCmp {\n@ViewChild(NgSelectComponent) select: NgSelectComponent;\nselectedCity: { id: number; name: string };\n+ multiple = false;\ncities = [\n{ id: 1, name: 'Vilnius' },\n{ id: 2, name: 'Kaunas' },\n", "new_path": "src/lib/src/ng-select.component.spec.ts", "old_path": "src/lib/src/ng-select.component.spec.ts" }, { "change_type": "MODIFY", "diff": "@@ -2,6 +2,7 @@ import {\nComponent,\nOnInit,\nOnDestroy,\n+ OnChanges,\nforwardRef,\nChangeDetectorRef,\nInput,\n@@ -25,6 +26,9 @@ import { VirtualScrollComponent } from './virtual-scroll.component';\nimport { NgOption, KeyCode, NgSelectConfig } from './ng-select.types';\nimport { ItemsList } from './items-list';\nimport { Subject } from 'rxjs/Subject';\n+import { Observable } from 'rxjs/Observable';\n+import 'rxjs/add/observable/combineLatest';\n+import 'rxjs/operator/withLatestFrom';\nconst NGB_ANG_SELECT_VALUE_ACCESSOR = {\nprovide: NG_VALUE_ACCESSOR,\n@@ -43,7 +47,7 @@ const NGB_ANG_SELECT_VALUE_ACCESSOR = {\n'role': 'dropdown'\n}\n})\n-export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccessor {\n+export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, ControlValueAccessor {\n@ContentChild(NgOptionTemplateDirective, { read: TemplateRef }) optionTemplate: TemplateRef<any>;\n@ContentChild(NgLabelTemplateDirective, { read: TemplateRef }) labelTemplate: TemplateRef<any>;\n@@ -64,12 +68,12 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\n@HostBinding('class.as-multiple') multiple = false;\n// output events\n- @Output('blur') onBlur = new EventEmitter();\n- @Output('focus') onFocus = new EventEmitter();\n- @Output('change') onChange = new EventEmitter();\n- @Output('open') onOpen = new EventEmitter();\n- @Output('close') onClose = new EventEmitter();\n- @Output('search') onSearch = new EventEmitter();\n+ @Output('blur') blurEvent = new EventEmitter();\n+ @Output('focus') focusEvent = new EventEmitter();\n+ @Output('change') changeEvent = new EventEmitter();\n+ @Output('open') openEvent = new EventEmitter();\n+ @Output('close') closeEvent = new EventEmitter();\n+ @Output('search') searchEvent = new EventEmitter();\n@HostBinding('class.as-single')\nget single() {\n@@ -80,12 +84,18 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\n@HostBinding('class.focused') isFocused = false;\n@HostBinding('class.disabled') isDisabled = false;\n- itemsList = new ItemsList([], false);\n+ itemsList = new ItemsList();\nviewPortItems: NgOption[] = [];\nisLoading = false;\nfilterValue: string = null;\n- private propagateChange = (_: NgOption) => {};\n+ private _items$ = new Subject<boolean>();\n+ private _writeValue$ = new Subject<NgOption | NgOption[]>();\n+ private _checkWriteValue = false;\n+ private _writeValueHandler$ = null;\n+\n+ private onChange = (_: NgOption) => {};\n+ private onTouched = () => {};\nprivate disposeDocumentClickListener = () => {};\nconstructor(@Optional() config: NgSelectConfig,\n@@ -94,6 +104,7 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\nprivate renderer: Renderer2\n) {\nthis.mergeConfig(config);\n+ this.handleWriteValue();\n}\n@Input()\n@@ -102,11 +113,8 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\n}\nset items(items: NgOption[]) {\n- this.itemsList = new ItemsList(items || [], this.multiple);\n-\n- if (this.isTypeahead()) {\n- this.handleItemsChange();\n- }\n+ this.setItems(items);\n+ this._items$.next(true);\n}\nget value(): NgOption | NgOption[] {\n@@ -118,9 +126,16 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\nthis.bindLabel = this.bindLabel || 'label';\n}\n+ ngOnChanges(changes) {\n+ if (changes.multiple) {\n+ this.itemsList.setMultiple(changes.multiple.currentValue);\n+ }\n+ }\n+\nngOnDestroy() {\nthis.changeDetectorRef.detach();\nthis.disposeDocumentClickListener();\n+ this._writeValueHandler$.unsubscribe();\n}\n@HostListener('keydown', ['$event'])\n@@ -178,28 +193,22 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\nthis.itemsList.clearSelected();\nthis.clearSearch();\nthis.notifyModelChanged();\n+ if (this.isTypeahead()) {\n+ this.typeahead.next(this.filterValue);\n+ }\n}\nwriteValue(value: any): void {\n- this.itemsList.clearSelected();\n- if (value) {\n- if (this.multiple) {\n- value.forEach(item => {\n- this.selectWriteValue(item);\n- });\n- } else {\n- this.selectWriteValue(value);\n- }\n- }\n- this.detectChanges();\n+ this._checkWriteValue = true;\n+ this._writeValue$.next(value);\n}\nregisterOnChange(fn: any): void {\n- this.propagateChange = fn;\n+ this.onChange = fn;\n}\nregisterOnTouched(fn: any): void {\n- // TODO: touch event\n+ this.onTouched = fn;\n}\nsetDisabledState(isDisabled: boolean): void {\n@@ -214,7 +223,7 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\nthis.itemsList.markItem();\nthis.scrollToMarked();\nthis.focusSearchInput();\n- this.onOpen.emit();\n+ this.openEvent.emit();\n}\nclose() {\n@@ -223,7 +232,7 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\n}\nthis.isOpen = false;\nthis.clearSearch();\n- this.onClose.emit();\n+ this.closeEvent.emit();\n}\ngetLabelValue(value: NgOption) {\n@@ -247,6 +256,7 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\n}\nselect(item: NgOption) {\n+ this._checkWriteValue = false;\nif (!item.selected) {\nthis.itemsList.select(item);\nthis.updateModel();\n@@ -304,14 +314,17 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\n}\n}\n- onInputFocus($event) {\n+ onInputFocus() {\nthis.isFocused = true;\n- this.onFocus.emit($event);\n+ this.focusEvent.emit(null);\n}\n- onInputBlur($event) {\n+ onInputBlur() {\nthis.isFocused = false;\n- this.onBlur.emit($event);\n+ this.blurEvent.emit(null);\n+ if (!this.isOpen && !this.isDisabled) {\n+ this.onTouched();\n+ }\n}\nonItemHover(item: NgOption) {\n@@ -321,6 +334,36 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\nthis.itemsList.markItem(item);\n}\n+ private handleWriteValue() {\n+ // combineLatest ensures that write value is always set after latest items are loaded\n+ this._writeValueHandler$ = Observable.combineLatest(this._items$, this._writeValue$).subscribe((result) => {\n+ if (!this._checkWriteValue) {\n+ return;\n+ }\n+ const value = result[1];\n+ this.validateWriteValue(value);\n+ this.itemsList.clearSelected();\n+ if (value) {\n+ if (this.multiple) {\n+ (<NgOption[]>value).forEach(item => {\n+ this.selectWriteValue(item);\n+ });\n+ } else {\n+ this.selectWriteValue(value);\n+ }\n+ }\n+ this.detectChanges();\n+ });\n+ }\n+\n+ private setItems(items: NgOption[]) {\n+ this.itemsList.setItems(items);\n+ if (this.isTypeahead()) {\n+ this.isLoading = false;\n+ this.itemsList.markItem();\n+ }\n+ }\n+\nprivate handleDocumentClick() {\nconst handler = ($event) => {\n// prevent close if clicked on select\n@@ -336,7 +379,7 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\n}\nif (this.isFocused) {\n- this.onInputBlur($event);\n+ this.onInputBlur();\n}\nif (this.isOpen) {\n@@ -348,28 +391,30 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\n}\nprivate validateWriteValue(value: any) {\n- if (value instanceof Object && this.bindValue) {\n- throw new Error('Binding object with bindValue is not allowed.')\n- }\n+ if (!value) {\n+ return;\n}\n- private handleItemsChange() {\n- this.isLoading = false;\n- this.itemsList.markItem();\n+ const validateBinding = (item) => {\n+ if (item instanceof Object && this.bindValue) {\n+ throw new Error('Binding object with bindValue is not allowed.');\n}\n+ };\n- private selectWriteValue(value: any) {\n- this.validateWriteValue(value);\n- let index = -1;\n- if (this.bindValue) {\n- index = this.itemsList.items.findIndex(x => x[this.bindValue] === value);\n+ if (this.multiple) {\n+ if (!Array.isArray(value)) {\n+ throw new Error('Multiple select model should be array.');\n+ }\n+ value.forEach(item => validateBinding(item));\n} else {\n- index = this.itemsList.items.indexOf(value);\n- index = index > -1 ? index :\n- this.itemsList.items.findIndex(x => x[this.bindLabel] === value[this.bindLabel])\n+ validateBinding(value);\n+ }\n}\n- if (index > -1) {\n- this.itemsList.select(this.itemsList.items[index]);\n+\n+ private selectWriteValue(value: any) {\n+ let item = this.itemsList.findItem(value, this.bindLabel, this.bindValue);\n+ if (item) {\n+ this.itemsList.select(item);\n}\n}\n@@ -452,16 +497,16 @@ export class NgSelectComponent implements OnInit, OnDestroy, ControlValueAccesso\nprivate notifyModelChanged() {\nconst value = this.itemsList.value;\nif (!value) {\n- this.propagateChange(null);\n+ this.onChange(null);\n} else if (this.bindValue) {\nconst bindValue = Array.isArray(value) ?\nvalue.map(x => x[this.bindValue]) :\nvalue[this.bindValue];\n- this.propagateChange(bindValue);\n+ this.onChange(bindValue);\n} else {\n- this.propagateChange(value);\n+ this.onChange(value);\n}\n- this.onChange.emit(value);\n+ this.changeEvent.emit(value);\n}\nprivate getDropdownMenu() {\n", "new_path": "src/lib/src/ng-select.component.ts", "old_path": "src/lib/src/ng-select.component.ts" }, { "change_type": "MODIFY", "diff": "-import { NgModule, Optional, SkipSelf, ModuleWithProviders } from '@angular/core';\n+import { NgModule, ModuleWithProviders } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { NgSelectComponent } from './ng-select.component';\nimport { NgOptionTemplateDirective, NgLabelTemplateDirective } from './ng-templates.directive';\n-import { AngSearchFocusDirective } from './ng-search-focus.directive';\nimport { VirtualScrollModule } from './virtual-scroll.component';\nimport { SpinnerComponent } from './spinner.component';\nimport { NgSelectConfig } from './ng-select.types';\n@@ -14,7 +13,6 @@ import { NgSelectConfig } from './ng-select.types';\nNgSelectComponent,\nNgOptionTemplateDirective,\nNgLabelTemplateDirective,\n- AngSearchFocusDirective,\nSpinnerComponent\n],\nimports: [\n@@ -30,6 +28,15 @@ import { NgSelectConfig } from './ng-select.types';\n})\nexport class NgSelectModule {\nstatic forRoot(config: NgSelectConfig): ModuleWithProviders {\n+ return provideModule(config);\n+ }\n+\n+ static forChild(config: NgSelectConfig): ModuleWithProviders {\n+ return provideModule(config);\n+ }\n+}\n+\n+function provideModule(config: NgSelectConfig) {\nreturn {\nngModule: NgSelectModule,\nproviders: [\n@@ -37,11 +44,3 @@ export class NgSelectModule {\n]\n};\n}\n-\n- constructor(@Optional() @SkipSelf() parentModule: NgSelectModule) {\n- if (parentModule) {\n- throw new Error(\n- 'NgSelectModule is already loaded. Import it in the AppModule only');\n- }\n- }\n-}\n", "new_path": "src/lib/src/ng-select.module.ts", "old_path": "src/lib/src/ng-select.module.ts" } ]
TypeScript
MIT License
ng-select/ng-select
fix: handle selected value when items are not loaded yet (#61)
1
fix
null
815,745
04.10.2017 18:44:26
-10,800
5e0ca53b3459a16a67716c32c32eb276d9b0853f
fix(navigation): close dropdown without selection on tab fixes
[ { "change_type": "MODIFY", "diff": "<div class=\"as-menu-outer\">\n<virtual-scroll role=\"listbox\" class=\"as-menu\" [bufferAmount]=\"4\" [items]=\"itemsList.filteredItems\" (update)=\"viewPortItems = $event\">\n- <div class=\"as-option\" role=\"option\" (click)=\"toggle(item)\" (mouseover)=\"onItemHover(item)\"\n+ <div class=\"as-option\" role=\"option\" (click)=\"toggle(item)\" (mousedown)=\"$event.preventDefault()\" (mouseover)=\"onItemHover(item)\"\n*ngFor=\"let item of viewPortItems\"\n[class.disabled]=\"item.disabled\"\n[class.selected]=\"item.selected\"\n", "new_path": "src/lib/src/ng-select.component.html", "old_path": "src/lib/src/ng-select.component.html" }, { "change_type": "MODIFY", "diff": "@@ -352,13 +352,6 @@ describe('NgSelectComponent', function () {\n});\ndescribe('tab', () => {\n- it('should close dropdown and select marked value', () => {\n- triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\n- triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Tab);\n- expect(fixture.componentInstance.select.value).toEqual(jasmine.objectContaining(fixture.componentInstance.cities[0]));\n- expect(fixture.componentInstance.select.isOpen).toBeFalsy()\n- });\n-\nit('should close dropdown when there are no items', fakeAsync(() => {\nfixture.componentInstance.select.onFilter({ target: { value: 'random stuff' } });\ntick(200);\n@@ -367,21 +360,22 @@ describe('NgSelectComponent', function () {\nexpect(fixture.componentInstance.select.isOpen).toBeFalsy()\n}));\n- it('should close dropdown when marked item is already selected', () => {\n- fixture.componentInstance.selectedCity = fixture.componentInstance.cities[0];\n+ it('should close dropdown', () => {\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Tab);\n- expect(fixture.componentInstance.select.value).toEqual(jasmine.objectContaining(fixture.componentInstance.cities[0]));\n+ expect(fixture.componentInstance.select.value).toBeNull();\nexpect(fixture.componentInstance.select.isOpen).toBeFalsy()\n});\n- it('should close dropdown and select marked when multiple', () => {\n- fixture.componentInstance.select.multiple = true;\n+ it('should close dropdown and keep selected value', fakeAsync(() => {\n+ fixture.componentInstance.selectedCity = fixture.componentInstance.cities[0];\n+ tickAndDetectChanges(fixture);\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Tab);\n+ tickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.value).toEqual(jasmine.objectContaining(fixture.componentInstance.cities[0]));\nexpect(fixture.componentInstance.select.isOpen).toBeFalsy()\n- });\n+ }));\n});\ndescribe('backspace', () => {\n", "new_path": "src/lib/src/ng-select.component.spec.ts", "old_path": "src/lib/src/ng-select.component.spec.ts" }, { "change_type": "MODIFY", "diff": "@@ -113,7 +113,7 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, ControlV\n}\nset items(items: NgOption[]) {\n- this.setItems(items);\n+ this.setItems(items || []);\nthis._items$.next(true);\n}\n@@ -440,16 +440,9 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, ControlV\nprivate handleTab($event: KeyboardEvent) {\nif (this.isOpen) {\n- const marked = this.itemsList.markedItem;\n- if (marked) {\n- this.select(marked);\n- }\n-\n- if (this.multiple || !marked) {\nthis.close();\n}\n}\n- }\nprivate handleEnter($event: KeyboardEvent) {\nif (this.isOpen) {\n", "new_path": "src/lib/src/ng-select.component.ts", "old_path": "src/lib/src/ng-select.component.ts" } ]
TypeScript
MIT License
ng-select/ng-select
fix(navigation): close dropdown without selection on tab fixes #65 #67
1
fix
navigation
815,746
04.10.2017 19:30:35
-10,800
4ebc1cf3984326df31ed0014c57a2aa5295e11cd
fix: clear filter value on selected item fixes
[ { "change_type": "MODIFY", "diff": "@@ -10,6 +10,8 @@ import { Observable } from 'rxjs/Observable';\nnotFoundText=\"No results found\"\ntypeToSearchText=\"Search for github account\"\nbindLabel=\"login\"\n+ [placeholder]=\"placeholder\"\n+ [multiple]=\"multiple\"\n[typeahead]=\"typeahead\"\n[(ngModel)]=\"githubAccount\">\n@@ -18,6 +20,8 @@ import { Observable } from 'rxjs/Observable';\n</ng-template>\n</ng-select>\n+ <br>\n+ <button class=\"btn btn-secondary btn-sm\" (click)=\"toggleMultiple()\">Toggle multiple</button>\n<p>\nSelected github account:\n<span *ngIf=\"githubAccount\">\n@@ -31,6 +35,9 @@ export class SelectAutocompleteComponent {\ngithubAccount: any;\nitems = [];\ntypeahead = new EventEmitter<string>();\n+ placeholder = 'Type in me. I am single';\n+\n+ multiple = false;\nconstructor(private http: HttpClient) {\nthis.typeahead\n@@ -52,6 +59,11 @@ export class SelectAutocompleteComponent {\nreturn Observable.of([]);\n}\n}\n+\n+ toggleMultiple() {\n+ this.multiple = !this.multiple;\n+ this.placeholder = this.multiple ? 'Type in me. I am multiple.' : 'Type in me. I am single.';\n+ }\n}\n", "new_path": "src/demo/app/examples/autocomplete.component.ts", "old_path": "src/demo/app/examples/autocomplete.component.ts" }, { "change_type": "MODIFY", "diff": "@@ -28,7 +28,7 @@ export class ItemsList {\nsetMultiple(multiple: boolean) {\nthis._multiple = multiple;\n- this._selected = [];\n+ this.clearSelected();\n}\nselect(item: NgOption) {\n", "new_path": "src/lib/src/items-list.ts", "old_path": "src/lib/src/items-list.ts" }, { "change_type": "MODIFY", "diff": "@@ -588,6 +588,22 @@ describe('NgSelectComponent', function () {\nexpect(fixture.componentInstance.select.value).toEqual(result);\n}));\n+ it('should clear filterValue on selected item', fakeAsync(() => {\n+ fixture = createTestingModule(\n+ NgSelectFilterTestCmp,\n+ `<ng-select [items]=\"cities\"\n+ bindLabel=\"name\"\n+ [(ngModel)]=\"selectedCity\"\n+ [multiple]=\"true\">\n+ </ng-select>`);\n+\n+ fixture.componentInstance.select.filterValue = 'Hey! Whats up!?';\n+ selectOption(fixture, KeyCode.ArrowDown, 1);\n+ tickAndDetectChanges(fixture);\n+\n+ expect(fixture.componentInstance.select.filterValue).toBe(null);\n+ }));\n+\ndescribe('with typeahead', () => {\nbeforeEach(() => {\nfixture = createTestingModule(\n", "new_path": "src/lib/src/ng-select.component.spec.ts", "old_path": "src/lib/src/ng-select.component.spec.ts" }, { "change_type": "MODIFY", "diff": "@@ -259,6 +259,7 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, ControlV\nthis._checkWriteValue = false;\nif (!item.selected) {\nthis.itemsList.select(item);\n+ this.clearSearch();\nthis.updateModel();\n}\n@@ -476,13 +477,14 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, ControlV\n}\nprivate handleBackspace() {\n+ if (this.filterValue) {\n+ return;\n+ }\n+\nif (this.multiple) {\nthis.itemsList.unselectLastItem();\nthis.updateModel();\n} else {\n- if (this.filterValue) {\n- return;\n- }\nthis.clear();\n}\n}\n", "new_path": "src/lib/src/ng-select.component.ts", "old_path": "src/lib/src/ng-select.component.ts" } ]
TypeScript
MIT License
ng-select/ng-select
fix: clear filter value on selected item (#72) fixes #66
1
fix
null
573,195
05.10.2017 12:02:50
25,200
e696a1f80cd84e7d3db9fb85a18212f970f9a0d3
Fix: redirect should work even when hostname or protocol is not specified in req.url
[ { "change_type": "MODIFY", "diff": "@@ -93,6 +93,14 @@ Sets the link header.\n* `url` {String} a url to redirect to\n* `next` {Function} a callback function\n* `options` {Object} an options object to configure a redirect\n+* `[options.secure]` {Boolean} whether to redirect to http or https\n+* `[options.hostname]` {String} redirect location's hostname\n+* `[options.pathname]` {String} redirect location's pathname\n+* `[options.port]` {String} redirect location's port number\n+* `[options.query]` {String} redirect location's query string parameters\n+* `[options.overrideQuery]` {Boolean} if true, `options.query` stomps over any\n+existing query parameters on current URL. by default, will merge the two.\n+* `[options.permanent]` {Boolean} if true, sets 301. defaults to 302.\nA convenience method for 301/302 redirects. Using this method will\ntell restify to stop execution of your handler chain. You can also\n", "new_path": "docs/api/response.md", "old_path": "docs/api/response.md" }, { "change_type": "MODIFY", "diff": "@@ -599,14 +599,17 @@ Response.prototype.redirect = function redirect(arg1, arg2, arg3) {\n};\n// start building url based on options.\n- // first, set protocol.\n- finalUri.protocol = (secure === true) ? 'https' : 'http';\n-\n- // then set host\n+ // start with the host\nif (opt.hostname) {\nfinalUri.hostname = opt.hostname;\n}\n+ // then set protocol IFF hostname is set - otherwise we end up with\n+ // malformed URL.\n+ if (finalUri.hostname) {\n+ finalUri.protocol = (secure === true) ? 'https' : 'http';\n+ }\n+\n// then set current path after the host\nif (opt.pathname) {\nfinalUri.pathname = opt.pathname;\n", "new_path": "lib/response.js", "old_path": "lib/response.js" }, { "change_type": "MODIFY", "diff": "@@ -101,7 +101,7 @@ test('redirect to new relative string url as-is', function (t) {\nres.redirect('/1', next);\n});\n- CLIENT.get(join(LOCALHOST, '/20'), function (err, _, res) {\n+ CLIENT.get(join(LOCALHOST, '/20?a=1'), function (err, _, res) {\nt.ifError(err);\nt.equal(res.statusCode, 302);\nt.equal(res.headers.location, '/1');\n@@ -109,7 +109,6 @@ test('redirect to new relative string url as-is', function (t) {\n});\n});\n-\ntest('redirect to current url (reload)', function (t) {\nSERVER.get('/2', function (req, res, next) {\nres.redirect({\n@@ -158,7 +157,6 @@ test('redirect to current url from https -> http', function (t) {\n});\n});\n-\ntest('redirect by changing path', function (t) {\nSERVER.get('/4', function (req, res, next) {\nres.redirect({\n@@ -174,6 +172,30 @@ test('redirect by changing path', function (t) {\n});\n});\n+test('GH-1494: redirect should succeed even if req.url does not specify host' +\n+' or protocol', function (t) {\n+ SERVER.get('/5', function (req, res, next) {\n+ res.redirect({\n+ pathname: '/'\n+ }, next);\n+ });\n+\n+ // use a relative URL here instead of request with full protocol and host.\n+ // this causes node to receive different values for req.url, which affects\n+ // how reconstruction of the redirect URL is done. for example including\n+ // full host will result in a req.url value of:\n+ // http://127.0.0.1:57824/5\n+ // using relative URL results in a req.url value of:\n+ // /5\n+ // this causes a bug as documented in GH-1494\n+ CLIENT.get('/5', function (err, _, res) {\n+ t.ifError(err);\n+ t.equal(res.statusCode, 302);\n+ t.equal(res.headers.location, '/');\n+ t.end();\n+ });\n+});\n+\ntest('redirect should add query params', function (t) {\nSERVER.get('/5', function (req, res, next) {\nres.redirect({\n", "new_path": "test/response.test.js", "old_path": "test/response.test.js" } ]
JavaScript
MIT License
restify/node-restify
Fix: redirect should work even when hostname or protocol is not specified in req.url (#1497)
1
fix
null
807,849
05.10.2017 12:07:14
25,200
42620995ab1281ce4f1582751720929d7bc66619
refactor: encapsulate semver comparison in PackageGraphNode
[ { "change_type": "MODIFY", "diff": "@@ -10,6 +10,10 @@ export class PackageGraphNode {\nthis.package = pkg;\nthis.dependencies = [];\n}\n+\n+ satisfies(versionRange) {\n+ return semver.satisfies(this.package.version, versionRange);\n+ }\n}\n/**\n@@ -46,7 +50,7 @@ export default class PackageGraph {\n: dependencies[depName]\n);\n- if (semver.satisfies(packageNode.package.version, depVersion)) {\n+ if (packageNode.satisfies(depVersion)) {\nnode.dependencies.push(depName);\n}\n}\n", "new_path": "src/PackageGraph.js", "old_path": "src/PackageGraph.js" } ]
JavaScript
MIT License
lerna/lerna
refactor: encapsulate semver comparison in PackageGraphNode
1
refactor
null
807,849
05.10.2017 15:31:23
25,200
01fbdc648a6f39aa75746d6c6ebffbd31d63b7d7
chore: turn off broken node v4 on appveyor
[ { "change_type": "MODIFY", "diff": "@@ -5,7 +5,8 @@ environment:\nmatrix:\n- nodejs_version: \"8\"\n- nodejs_version: \"6\"\n- - nodejs_version: \"4\"\n+ # node v4 is broken on appveyor\n+ # - nodejs_version: \"4\"\nmatrix:\nfast_finish: true\n@@ -17,9 +18,7 @@ cache:\ninstall:\n- ps: Install-Product node $env:nodejs_version\n- - IF %nodejs_version% EQU 4 npm -g install npm@3\n- - IF %nodejs_version% EQU 6 npm -g install npm@4\n- - IF %nodejs_version% EQU 8 npm -g install npm@5.4.0\n+ - IF %nodejs_version% EQU 8 npm -g install npm@latest-5\n- yarn --frozen-lockfile\nbefore_test:\n", "new_path": "appveyor.yml", "old_path": "appveyor.yml" } ]
JavaScript
MIT License
lerna/lerna
chore: turn off broken node v4 on appveyor
1
chore
null
807,849
05.10.2017 15:31:51
25,200
3bdb108b3b9b0db4c2d4ab57da492d1d949b27a6
chore: use latest-* tags when upgrading npm in travis
[ { "change_type": "MODIFY", "diff": "@@ -19,9 +19,9 @@ cache:\n- node_modules\nbefore_install:\n- - if [[ `node -v` == v4* ]]; then npm i -g npm@3; fi\n- - if [[ `node -v` == v6* ]]; then npm i -g npm@4; fi\n- - if [[ `node -v` == v8* ]]; then npm i -g npm@5.4.0; fi\n+ - if [[ `node -v` == v4* ]]; then npm i -g npm@latest-3; fi\n+ - if [[ `node -v` == v6* ]]; then npm i -g npm@latest-4; fi\n+ - if [[ `node -v` == v8* ]]; then npm i -g npm@latest-5; fi\n- curl -o- -L https://yarnpkg.com/install.sh | bash\n- export PATH=$HOME/.yarn/bin:$PATH\n", "new_path": ".travis.yml", "old_path": ".travis.yml" } ]
JavaScript
MIT License
lerna/lerna
chore: use latest-* tags when upgrading npm in travis
1
chore
null
573,227
05.10.2017 19:48:33
-7,200
8ac9cc8492f675d580a763ddec27290f9d78bb96
docs(req): req.getQuery() returns with a raw query string with queryParser() plugin
[ { "change_type": "MODIFY", "diff": "@@ -96,13 +96,13 @@ req.getQuery();\n// => 'a=1'\n```\n-Note that if the query parser plugin is used, then this method will returned\n-the parsed query string:\n+If the `queryParser` plugin is used, the parsed query string is available\n+under the `req.query`:\n```js\n// incoming request is /foo?a=1\nserver.use(restify.plugins.queryParser());\n-req.getQuery();\n+req.query;\n// => { a: 1 }\n```\n", "new_path": "docs/api/request.md", "old_path": "docs/api/request.md" }, { "change_type": "MODIFY", "diff": "@@ -57,6 +57,23 @@ describe('query parser', function () {\n});\n});\n+ it('req.getQuery() should return with raw query string', function (done) {\n+ SERVER.use(restify.plugins.queryParser());\n+\n+ SERVER.get('/query/:id', function (req, res, next) {\n+ assert.equal(req.getQuery(), 'a=1');\n+ assert.deepEqual(req.query, { a: '1' });\n+ res.send();\n+ next();\n+ });\n+\n+ CLIENT.get('/query/foo?a=1', function (err, _, res) {\n+ assert.ifError(err);\n+ assert.equal(res.statusCode, 200);\n+ done();\n+ });\n+ });\n+\nit('should parse req.query and req.params independently', function (done) {\nSERVER.use(restify.plugins.queryParser());\n", "new_path": "test/plugins/query.test.js", "old_path": "test/plugins/query.test.js" } ]
JavaScript
MIT License
restify/node-restify
docs(req): req.getQuery() returns with a raw query string with queryParser() plugin (#1508)
1
docs
req
573,190
09.10.2017 14:14:20
25,200
f7126f225686f85987dc36b4dc1b82f1dee4e891
docs(README): remove NSP badge
[ { "change_type": "MODIFY", "diff": "@@ -23,7 +23,6 @@ NSP := ./node_modules/.bin/nsp\nNODEUNIT := ./node_modules/.bin/nodeunit\nMOCHA := ./node_modules/.bin/mocha\nNODECOVER := ./node_modules/.bin/cover\n-NSP_BADGE := ./tools/nspBadge.js\nNPM := npm\n#\n@@ -64,7 +63,7 @@ test: $(NODEUNIT)\n.PHONY: nsp\nnsp: node_modules $(NSP)\n- @($(NSP) check) | $(NSP_BADGE)\n+ @($(NSP) check) | true\ninclude ./tools/mk/Makefile.deps\ninclude ./tools/mk/Makefile.targ\n", "new_path": "Makefile", "old_path": "Makefile" }, { "change_type": "MODIFY", "diff": "[![Dependency Status](https://david-dm.org/restify/node-restify.svg)](https://david-dm.org/restify/node-restify)\n[![devDependency Status](https://david-dm.org/restify/node-restify/dev-status.svg)](https://david-dm.org/restify/node-restify#info=devDependencies)\n[![bitHound Score](https://www.bithound.io/github/restify/node-restify/badges/score.svg)](https://www.bithound.io/github/restify/node-restify/master)\n-[![NSP Status](https://img.shields.io/badge/NSP%20status-no%20vulnerabilities-green.svg)](https://travis-ci.org/restify/node-restify)\n-\n[restify](http://restify.com) is a framework, utilizing\n[connect](https://github.com/senchalabs/connect) style middleware for building\n", "new_path": "README.md", "old_path": "README.md" }, { "change_type": "DELETE", "diff": "-#!/usr/bin/env node\n-\n-'use strict';\n-\n-var fs = require('fs');\n-var path = require('path');\n-\n-var README_PATH = path.join(__dirname, '../README.md');\n-/* jscs:disable maximumLineLength */\n-var FAIL_BADGE = 'vulnerabilities%20found-red';\n-var SUCCESS_BADGE = 'no%20vulnerabilities-green';\n-var NSP_LINE_ID = '[NSP Status]';\n-/* jscs:enable maximumLineLength */\n-\n-process.stdin.on('data', function (exitCodeBuf) {\n-\n- var nspExitCode = parseInt(exitCodeBuf.toString(), 10);\n-\n- if (isNaN(nspExitCode)) {\n- // output any success message\n- console.warn(exitCodeBuf.toString());\n- nspExitCode = 0;\n- }\n-\n- var readmeStr = fs.readFileSync(README_PATH).toString();\n-\n- var out = processLines(nspExitCode, readmeStr);\n-\n- // now write it back out\n- fs.writeFileSync(README_PATH, out);\n-});\n-\n-function processLines(exitCode, readmeStr) {\n- var lines = readmeStr.toString().split('\\n');\n- var outLines = '';\n-\n- lines.forEach(function (line) {\n- if (line.indexOf(NSP_LINE_ID) > -1) {\n- if (exitCode === 0) {\n- outLines += line.replace(FAIL_BADGE, SUCCESS_BADGE) + '\\n';\n- } else {\n- outLines += line.replace(SUCCESS_BADGE, FAIL_BADGE) + '\\n';\n- }\n- } else {\n- outLines += line + '\\n';\n- }\n- });\n-\n- // chop off last newline\n- return outLines.slice(0, -1);\n-}\n", "new_path": null, "old_path": "tools/nspBadge.js" } ]
JavaScript
MIT License
restify/node-restify
docs(README): remove NSP badge (#1511)
1
docs
README
573,190
09.10.2017 14:17:01
25,200
eecb2d259deda34c2f297f2ef8b6d4fedc504e9e
fix(cpuUsageThrottle): dont include interval in lag
[ { "change_type": "MODIFY", "diff": "@@ -142,7 +142,7 @@ function cpuUsageThrottlePlugin (opts) {\n// updated the _reject value and how long it actually took. This\n// metric accounts for the misbehaviour of pidusage.stat\nvar now = Date.now();\n- self._timeoutDelta = now - self._timeoutStart;\n+ self._timeoutDelta = now - self._timeoutStart - self._interval;\nself._timeoutStart = now;\n});\n}\n", "new_path": "lib/plugins/cpuUsageThrottle.js", "old_path": "lib/plugins/cpuUsageThrottle.js" }, { "change_type": "MODIFY", "diff": "@@ -19,6 +19,8 @@ var cpuUsageThrottle = proxyquire('../../lib/plugins/cpuUsageThrottle.js', {\nvar MR = Math.random;\ndescribe('cpuUsageThrottle', function () {\n+ var plugin;\n+\nbefore('Setup: stub math.random', function (done) {\nMath.random = function () {\nreturn 0;\n@@ -28,9 +30,8 @@ describe('cpuUsageThrottle', function () {\nit('Unit: Should shed load', function (done) {\nvar opts = { limit: 0, interval: 500 };\n- var plugin = cpuUsageThrottle(opts);\n+ plugin = cpuUsageThrottle(opts);\nfunction next (cont) {\n- clearTimeout(plugin._timeout);\nassert(cont instanceof Error, 'Should call next with error');\nassert.equal(cont.statusCode, 503, 'Defaults to 503 status');\ndone();\n@@ -40,10 +41,9 @@ describe('cpuUsageThrottle', function () {\nit('Unit: Should let request through when not under load', function (done) {\nvar opts = { interval: 500, limit: 0.9 };\n- var plugin = cpuUsageThrottle(opts);\n+ plugin = cpuUsageThrottle(opts);\nfunction next (cont) {\nassert.isUndefined(cont, 'Should call next');\n- clearTimeout(plugin._timeout);\ndone();\n}\nplugin({}, {}, next);\n@@ -56,7 +56,7 @@ describe('cpuUsageThrottle', function () {\nhalfLife: 50,\ninterval: 50\n};\n- var plugin = cpuUsageThrottle(opts);\n+ plugin = cpuUsageThrottle(opts);\nopts = {\nmax: 0.5,\nlimit: 0.1,\n@@ -68,7 +68,6 @@ describe('cpuUsageThrottle', function () {\nassert.equal(plugin.state.max, opts.max, 'opts.max');\nassert.equal(plugin.state.halfLife, opts.halfLife, 'opts.halfLife');\nassert.equal(plugin.state.interval, opts.interval, 'opts.interval');\n- plugin.close();\ndone();\n});\n@@ -79,11 +78,25 @@ describe('cpuUsageThrottle', function () {\nhalfLife: 50,\ninterval: 50\n};\n- var plugin = cpuUsageThrottle(opts);\n+ plugin = cpuUsageThrottle(opts);\nassert.equal(plugin.name, 'cpuUsageThrottle');\ndone();\n});\n+ it('Unit: Should report proper lag', function (done) {\n+ var opts = { max: 1, limit: 0.9, halfLife: 50, interval: 50 };\n+ var dn = Date.now;\n+ var now = 0;\n+ // First timer will be 0, all future timers will be interval\n+ Date.now = function () {\n+ return (now++ > 0) * opts.interval;\n+ };\n+ plugin = cpuUsageThrottle(opts);\n+ Date.now = dn;\n+ assert.equal(plugin.state.lag, 0);\n+ done();\n+ });\n+\nit('Integration: Should shed load', function (done) {\nvar server = restify.createServer();\n@@ -91,7 +104,7 @@ describe('cpuUsageThrottle', function () {\nclose: function () {}\n};\nvar opts = { interval: 500, limit: 0 };\n- var plugin = cpuUsageThrottle(opts);\n+ plugin = cpuUsageThrottle(opts);\nserver.pre(plugin);\nserver.get('/foo', function (req, res, next) {\nres.send(200);\n@@ -112,6 +125,14 @@ describe('cpuUsageThrottle', function () {\n});\n});\n+ afterEach(function (done) {\n+ if (plugin) {\n+ plugin.close();\n+ }\n+ plugin = undefined;\n+ done();\n+ });\n+\nafter('Teardown: Reset Math.random', function (done) {\nMath.random = MR;\ndone();\n", "new_path": "test/plugins/cpuUsageThrottle.test.js", "old_path": "test/plugins/cpuUsageThrottle.test.js" } ]
JavaScript
MIT License
restify/node-restify
fix(cpuUsageThrottle): dont include interval in lag (#1504)
1
fix
cpuUsageThrottle
135,510
09.10.2017 17:20:53
-28,800
8f35daeea1a5f035ed23a842c66aeeb9976287b9
fix(config-lerna-scopes): fix package list get with recent lerna versions
[ { "change_type": "MODIFY", "diff": "const Repository = require('lerna/lib/Repository');\n+const PackageUtilities = require('lerna/lib/PackageUtilities');\nmodule.exports = {\nutils: {getPackages},\n@@ -8,8 +9,12 @@ module.exports = {\n};\nfunction getPackages() {\n- const repo = new Repository(process.cwd());\n- return repo.packages\n+ const cwd = process.cwd();\n+ const repository = new Repository(cwd);\n+ return PackageUtilities.getPackages({\n+ packageConfigs: repository.packageConfigs,\n+ rootPath: cwd\n+ })\n.map(pkg => pkg.name)\n.map(name => (name.charAt(0) === '@' ? name.split('/')[1] : name));\n}\n", "new_path": "@commitlint/config-lerna-scopes/index.js", "old_path": "@commitlint/config-lerna-scopes/index.js" } ]
TypeScript
MIT License
conventional-changelog/commitlint
fix(config-lerna-scopes): fix package list get with recent lerna versions
1
fix
config-lerna-scopes
573,227
09.10.2017 17:45:10
-7,200
e8efd6cdcb73e674583e2a7081d2a9b923c72809
fix(plugins): use process.hrtime() for duration calculation
[ { "change_type": "MODIFY", "diff": "@@ -6,6 +6,7 @@ var assert = require('assert-plus');\nvar bunyan = require('bunyan');\nvar HttpError = require('restify-errors').HttpError;\nvar VError = require('verror');\n+var hrTimeDurationInMs = require('./utils/hrTimeDurationInMs');\n/**\n* Utility to get response headers from a given response.\n@@ -133,7 +134,7 @@ function auditLogger(opts) {\nvar latency = res.get('Response-Time');\nif (typeof (latency) !== 'number') {\n- latency = Date.now() - req._time;\n+ latency = hrTimeDurationInMs(req._time, process.hrtime());\n}\nvar obj = {\n", "new_path": "lib/plugins/audit.js", "old_path": "lib/plugins/audit.js" }, { "change_type": "MODIFY", "diff": "var crypto = require('crypto');\nvar httpDate = require('./utils/httpDate');\n+var hrTimeDurationInMs = require('./utils/hrTimeDurationInMs');\n///--- API\n@@ -44,7 +45,8 @@ function setHeaders(req, res) {\n}\nif (!res.getHeader('Response-Time')) {\n- res.setHeader('Response-Time', now.getTime() - req._time);\n+ res.setHeader('Response-Time',\n+ hrTimeDurationInMs(req._time, process.hrtime()));\n}\n}\n", "new_path": "lib/plugins/fullResponse.js", "old_path": "lib/plugins/fullResponse.js" }, { "change_type": "MODIFY", "diff": "'use strict';\nvar assert = require('assert-plus');\n+var hrTimeDurationInMs = require('./utils/hrTimeDurationInMs');\n///--- API\n@@ -37,7 +38,7 @@ function createMetrics(opts, callback) {\n// REST verb\nmethod: req.method,\n// overall request latency\n- latency: Date.now() - req._time,\n+ latency: hrTimeDurationInMs(req._time, process.hrtime()),\n// the cleaned up url path\n// e.g., /foo?a=1 => /foo\npath: req.path(),\n", "new_path": "lib/plugins/metrics.js", "old_path": "lib/plugins/metrics.js" }, { "change_type": "ADD", "diff": "+'use strict';\n+\n+var NS_PER_SEC = 1e9;\n+var MS_PER_NS = 1e6;\n+\n+/**\n+* Get duration in milliseconds from two process.hrtime()\n+* @function hrTimeDurationInMs\n+* @param {Array} startTime - [seconds, nanoseconds]\n+* @param {Array} endTime - [seconds, nanoseconds]\n+* @returns {Number} durationInMs\n+*/\n+function hrTimeDurationInMs (startTime, endTime) {\n+ var secondDiff = endTime[0] - startTime[0];\n+ var nanoSecondDiff = endTime[1] - startTime[1];\n+ var diffInNanoSecond = secondDiff * NS_PER_SEC + nanoSecondDiff;\n+\n+ return Math.round(diffInNanoSecond / MS_PER_NS);\n+}\n+\n+module.exports = hrTimeDurationInMs;\n", "new_path": "lib/plugins/utils/hrTimeDurationInMs.js", "old_path": null }, { "change_type": "MODIFY", "diff": "@@ -1076,7 +1076,7 @@ Server.prototype._setupRequest = function _setupRequest(req, res) {\nvar self = this;\nreq.log = res.log = self.log;\n- req._time = res._time = Date.now();\n+ req._time = process.hrtime();\nreq.serverName = self.name;\nres.acceptable = self.acceptable;\n", "new_path": "lib/server.js", "old_path": "lib/server.js" }, { "change_type": "ADD", "diff": "+'use strict';\n+\n+var assert = require('chai').assert;\n+var hrTimeDurationInMs =\n+ require('../../lib/plugins/utils/hrTimeDurationInMs');\n+\n+describe('utils #hrTimeDurationInMs', function () {\n+\n+ it('should return with duration', function () {\n+ var startTime = [0, 0];\n+ var endTime = [1, 1e6];\n+\n+ var duration = hrTimeDurationInMs(startTime, endTime);\n+\n+ assert.equal(duration, 1001);\n+ });\n+\n+});\n", "new_path": "test/plugins/utilsHrTimeDurationInMs.test.js", "old_path": null } ]
JavaScript
MIT License
restify/node-restify
fix(plugins): use process.hrtime() for duration calculation (#1507)
1
fix
plugins
448,039
10.10.2017 13:44:29
-7,200
ddbf2b35da13c10573186f963216551baa45228f
test: empty `.less` style file causes build error See
[ { "change_type": "ADD", "diff": "", "new_path": "integration/samples/custom/src/less-baz/less-baz.component.less", "old_path": "integration/samples/custom/src/less-baz/less-baz.component.less" }, { "change_type": "ADD", "diff": "+import { Component } from '@angular/core';\n+\n+@Component({\n+ selector: 'baz',\n+ template: '<h2>LessBaz works!</h2>',\n+ styleUrls: ['./less-baz.component.less']\n+})\n+export class LessBazComponent {}\n", "new_path": "integration/samples/custom/src/less-baz/less-baz.component.ts", "old_path": null }, { "change_type": "MODIFY", "diff": "@@ -2,4 +2,5 @@ export * from './foo/foo.component';\nexport * from './bar/bar.component';\nexport * from './baz/baz.component';\nexport * from './foo-bar/foo-bar.component';\n+export * from './less-baz/less-baz.component';\nexport * from './custom.module';\n", "new_path": "integration/samples/custom/src/public_api.ts", "old_path": "integration/samples/custom/src/public_api.ts" } ]
TypeScript
MIT License
ng-packagr/ng-packagr
test: empty `.less` style file causes build error See #165
1
test
null
448,039
10.10.2017 13:58:54
-7,200
f5106eb896be1c52c7eb855c33c69acda918f4e4
fix: pass empty string to `less.render()` Resolves
[ { "change_type": "MODIFY", "diff": "@@ -122,7 +122,7 @@ const renderLess = (lessOpts: any): Promise<string> => {\nreturn readFile(lessOpts.filename)\n.then((lessData: string) => new Promise<string>((resolve, reject) => {\n- less.render(lessData, lessOpts, (err, result) => {\n+ less.render(lessData || '', lessOpts, (err, result) => {\nif (err) {\nreject(err);\n} else {\n", "new_path": "src/lib/steps/assets.ts", "old_path": "src/lib/steps/assets.ts" } ]
TypeScript
MIT License
ng-packagr/ng-packagr
fix: pass empty string to `less.render()` Resolves #165
1
fix
null
448,039
11.10.2017 13:22:53
-7,200
e66054525de5c8b8beedffda58b0a8d781f35629
fix: include `package.schema.json` in dist artefacts and npm package
[ { "change_type": "MODIFY", "diff": "@@ -19,7 +19,7 @@ const copy = (paths, opts) => {\n// copyfiles 'lib/conf/**/*.json' dist\",\ncopy(['src/cli/*', 'dist'], {up: 1})\n- .then(() => copy(['src/ng-package.schema.json', 'dist'], {up: 1}))\n+ .then(() => copy(['src/**.schema.json', 'dist'], {up: 1}))\n.then(() => copy(['src/lib/conf/**/*.json', 'dist'], {up: 1}))\n.catch((err) => {\nconsole.error(\"Cannot copy files\", err);\n", "new_path": "scripts/postbuild.js", "old_path": "scripts/postbuild.js" } ]
TypeScript
MIT License
ng-packagr/ng-packagr
fix: include `package.schema.json` in dist artefacts and npm package
1
fix
null
448,039
11.10.2017 13:23:20
-7,200
3f07ec15c3b4d63bc753bc94a87bd2eaef4ef5bf
chore: cut release for v1.4.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=\"1.4.1\"></a>\n+## [1.4.1](https://github.com/dherges/ng-packagr/compare/v1.4.0...v1.4.1) (2017-10-11)\n+\n+\n+### Bug Fixes\n+\n+* include `package.schema.json` in dist artefacts and npm package ([e660545](https://github.com/dherges/ng-packagr/commit/e660545))\n+\n+\n+\n<a name=\"1.4.0\"></a>\n# [1.4.0](https://github.com/dherges/ng-packagr/compare/v1.3.0...v1.4.0) (2017-10-10)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"ng-packagr\",\n- \"version\": \"1.4.0\",\n+ \"version\": \"1.4.1\",\n\"description\": \"Compile and package a TypeScript library to Angular Package Format\",\n\"keywords\": [\n\"angular\",\n", "new_path": "package.json", "old_path": "package.json" } ]
TypeScript
MIT License
ng-packagr/ng-packagr
chore: cut release for v1.4.1
1
chore
null
135,497
13.10.2017 20:31:36
-3,600
c881433d593184af6ee3ab2433c3bdb280541145
feat: edit flag now accepts the path to the commit file Closes
[ { "change_type": "MODIFY", "diff": "@@ -23,8 +23,8 @@ const rules = {\n};\nconst configuration = {\n- string: ['cwd', 'from', 'to', 'extends', 'parser-preset'],\n- boolean: ['edit', 'help', 'version', 'quiet', 'color'],\n+ string: ['cwd', 'from', 'to', 'edit', 'extends', 'parser-preset'],\n+ boolean: ['help', 'version', 'quiet', 'color'],\nalias: {\nc: 'color',\nd: 'cwd',\n@@ -40,7 +40,8 @@ const configuration = {\ndescription: {\ncolor: 'toggle colored output',\ncwd: 'directory to execute in',\n- edit: 'read last commit message found in ./.git/COMMIT_EDITMSG',\n+ edit:\n+ 'read last commit message from the specified file or fallbacks to ./.git/COMMIT_EDITMSG',\nextends: 'array of shareable configurations to extend',\nfrom: 'lower end of the commit range to lint; applies if edit=false',\nto: 'upper end of the commit range to lint; applies if edit=false',\n@@ -74,6 +75,8 @@ const cli = meow(\nconst load = (seed, opts) => core.load(seed, opts);\nfunction main(options) {\n+ normalizeOptions(options);\n+\nconst raw = options.input;\nconst flags = options.flags;\nconst fromStdin = rules.fromStdin(raw, flags);\n@@ -113,6 +116,17 @@ function main(options) {\n);\n}\n+function normalizeOptions(options) {\n+ const flags = options.flags;\n+\n+ // The `edit` flag is either a boolean or a string but we are only allowed\n+ // to specify one of them in minimist\n+ if (flags.edit === '') {\n+ flags.edit = true;\n+ flags.e = true;\n+ }\n+}\n+\nfunction getSeed(seed) {\nconst e = Array.isArray(seed.extends) ? seed.extends : [seed.extends];\nconst n = e.filter(i => typeof i === 'string');\n", "new_path": "@commitlint/cli/cli.js", "old_path": "@commitlint/cli/cli.js" }, { "change_type": "MODIFY", "diff": "@@ -19,7 +19,7 @@ async function getCommitMessages(settings) {\nconst {cwd, from, to, edit} = settings;\nif (edit) {\n- return getEditCommit(cwd);\n+ return getEditCommit(cwd, edit);\n}\nif (await isShallow(cwd)) {\n@@ -57,15 +57,19 @@ async function isShallow(cwd) {\n}\n// Get recently edited commit message\n-// (cwd: string) => Promise<Array<String>>\n-async function getEditCommit(cwd) {\n+// (cwd: string, edit: any) => Promise<Array<String>>\n+async function getEditCommit(cwd, edit) {\nconst top = await toplevel(cwd);\nif (typeof top !== 'string') {\nthrow new TypeError(`Could not find git root from ${cwd}`);\n}\n- const editFilePath = path.join(top, '.git/COMMIT_EDITMSG');\n+ const editFilePath =\n+ typeof edit === 'string'\n+ ? path.resolve(top, edit)\n+ : path.join(top, '.git/COMMIT_EDITMSG');\n+\nconst editFile = await sander.readFile(editFilePath);\nreturn [`${editFile.toString('utf-8')}\\n`];\n}\n", "new_path": "@commitlint/core/src/read.js", "old_path": "@commitlint/core/src/read.js" }, { "change_type": "MODIFY", "diff": "@@ -6,6 +6,16 @@ import * as sander from '@marionebl/sander';\nimport pkg from '../package';\nimport read from './read';\n+test('get edit commit message specified by the `edit` flag', async t => {\n+ const cwd = await git.bootstrap();\n+\n+ await sander.writeFile(cwd, 'commit-msg-file', 'foo');\n+\n+ const expected = ['foo\\n'];\n+ const actual = await read({edit: 'commit-msg-file', cwd});\n+ t.deepEqual(actual, expected);\n+});\n+\ntest('get edit commit message from git root', async t => {\nconst cwd = await git.bootstrap();\n", "new_path": "@commitlint/core/src/read.test.js", "old_path": "@commitlint/core/src/read.test.js" } ]
TypeScript
MIT License
conventional-changelog/commitlint
feat: edit flag now accepts the path to the commit file Closes #40.
1
feat
null
743,891
15.10.2017 02:33:02
-19,080
280d0d6bd1035b91254db876281c1ae755520f07
feat: hidden options are now explicitly indicated using "hidden" flag BREAKING CHANGE: previously hidden options were simply implied using a falsy description
[ { "change_type": "MODIFY", "diff": "@@ -2314,10 +2314,12 @@ describe('usage tests', () => {\nconst r = checkUsage(() => yargs(['--help'])\n.option('answer', {\ntype: 'string',\n- choices: ['yes', 'no', 'maybe']\n+ choices: ['yes', 'no', 'maybe'],\n+ hidden: true\n})\n.option('confidence', {\n- choices: [0, 25, 50, 75, 100]\n+ choices: [0, 25, 50, 75, 100],\n+ hidden: true\n})\n.wrap(null)\n.argv\n@@ -2698,4 +2700,31 @@ describe('usage tests', () => {\n])\n})\n})\n+\n+ describe('hidden options', () => {\n+ it('--help should display all options except for hidden ones', () => {\n+ const r = checkUsage(() => yargs('--help')\n+ .options({\n+ foo: {\n+ describe: 'FOO'\n+ },\n+ bar: {},\n+ baz: {\n+ describe: 'BAZ',\n+ hidden: true\n+ }\n+ })\n+ .argv\n+ )\n+\n+ r.logs[0].split('\\n').should.deep.equal([\n+ 'Options:',\n+ ' --help Show help [boolean]',\n+ ' --version Show version number [boolean]',\n+ ' --foo FOO',\n+ ' --bar',\n+ ''\n+ ])\n+ })\n+ })\n})\n", "new_path": "test/usage.js", "old_path": "test/usage.js" }, { "change_type": "MODIFY", "diff": "@@ -647,7 +647,7 @@ function Yargs (processArgs, cwd, parentRequire) {\n}\nconst desc = opt.describe || opt.description || opt.desc\n- if (desc) {\n+ if (!opt.hidden) {\nself.describe(key, desc)\n}\n", "new_path": "yargs.js", "old_path": "yargs.js" } ]
JavaScript
MIT License
yargs/yargs
feat: hidden options are now explicitly indicated using "hidden" flag (#962) BREAKING CHANGE: previously hidden options were simply implied using a falsy description
1
feat
null
573,187
16.10.2017 16:20:37
25,200
09066d833c5431b2f4a33758a1856a953aae57be
chore(release): release 6.2.0
[ { "change_type": "MODIFY", "diff": "\"express\",\n\"DTrace\"\n],\n- \"version\": \"6.0.1\",\n+ \"version\": \"6.2.0\",\n\"repository\": {\n\"type\": \"git\",\n\"url\": \"git://github.com/restify/node-restify.git\"\n\"restify-errors\": \"^5.0.0\",\n\"semver\": \"^5.0.1\",\n\"spdy\": \"^3.3.3\",\n+ \"unleash\": \"^1.6.1\",\n\"uuid\": \"^3.0.0\",\n\"vasync\": \"^1.6.4\",\n\"verror\": \"^1.9.0\"\n", "new_path": "package.json", "old_path": "package.json" } ]
JavaScript
MIT License
restify/node-restify
chore(release): release 6.2.0
1
chore
release
743,863
16.10.2017 17:52:51
25,200
02cc11deac82898bd2218be99f71f6b2a7bd517f
docs: whoops, forgot to call out a breaking change introduced into parse()
[ { "change_type": "MODIFY", "diff": "@@ -52,6 +52,7 @@ All notable changes to this project will be documented in this file. See [standa\n### BREAKING CHANGES\n* version() and help() are now enabled by default, and show up in help output; the implicit help command can no longer be enabled/disabled independently from the help command itself (which can now be disabled).\n+* parse() now behaves as an alias for .argv, unless a parseCallback is provided.\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" } ]
JavaScript
MIT License
yargs/yargs
docs: whoops, forgot to call out a breaking change introduced into parse()
1
docs
null
448,095
16.10.2017 18:54:17
18,000
18515af5d18513b471f5844622f3934e5dcfda01
fix: regression in cli defaults
[ { "change_type": "MODIFY", "diff": "@@ -4,13 +4,19 @@ import * as program from 'commander';\nimport * as path from 'path';\nimport { createNgPackage, NgPackagrCliArguments } from './../lib/ng-packagr';\n+const DEFAULT_PROJECT_PATH = path.resolve(process.cwd(), 'ng-package.json');\n+\nfunction parseProjectPath(parsed: string): string {\n- return parsed || path.resolve(process.cwd(), 'ng-package.json');\n+ return parsed || DEFAULT_PROJECT_PATH;\n}\nprogram\n.name('ng-packagr')\n- .option('-p, --project <path>', 'Path to the \\'ng-package.json\\' or \\'package.json\\' file.', parseProjectPath)\n+ .option(\n+ '-p, --project <path>',\n+ 'Path to the \\'ng-package.json\\' or \\'package.json\\' file.',\n+ parseProjectPath,\n+ DEFAULT_PROJECT_PATH)\n.parse(process.argv);\nconst cliArguments: any = program;\n", "new_path": "src/cli/main.ts", "old_path": "src/cli/main.ts" } ]
TypeScript
MIT License
ng-packagr/ng-packagr
fix: regression in cli defaults
1
fix
null