author
int64 4.98k
943k
| date
stringdate 2017-04-15 16:45:02
2022-02-25 15:32:15
| timezone
int64 -46,800
39.6k
| hash
stringlengths 40
40
| message
stringlengths 8
468
| mods
listlengths 1
16
| language
stringclasses 9
values | license
stringclasses 2
values | repo
stringclasses 119
values | original_message
stringlengths 12
491
| is_CCS
int64 1
1
| commit_type
stringclasses 129
values | commit_scope
stringlengths 1
44
⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
791,723
|
19.01.2018 11:51:03
| 28,800
|
e8ce4608bdbb3e7df959835a426a29a60f6cde06
|
core(mobile-friendly): convey MFT covers add'l mobile-friendly auditing
|
[
{
"change_type": "MODIFY",
"diff": "@@ -18,7 +18,7 @@ class MobileFriendly extends ManualAudit {\nstatic get meta() {\nreturn Object.assign({\nname: 'mobile-friendly',\n- helpText: 'Take the [Mobile-Friendly Test](https://search.google.com/test/mobile-friendly) to see how easily a visitor can use your page on a mobile device. [Learn more](https://developers.google.com/search/mobile-sites/).',\n+ helpText: 'Take the [Mobile-Friendly Test](https://search.google.com/test/mobile-friendly) to check for audits not covered by Lighthouse, like sizing tap targets appropriately. [Learn more](https://developers.google.com/search/mobile-sites/).',\ndescription: 'Page is mobile friendly',\n}, super.meta);\n}\n",
"new_path": "lighthouse-core/audits/seo/manual/mobile-friendly.js",
"old_path": "lighthouse-core/audits/seo/manual/mobile-friendly.js"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
core(mobile-friendly): convey MFT covers add'l mobile-friendly auditing (#4307)
| 1
|
core
|
mobile-friendly
|
791,690
|
19.01.2018 11:58:44
| 28,800
|
550b0c40ecbc65f1b132298e3d1a1e1744191378
|
core(start-url): switch to plain old fetch
|
[
{
"change_type": "MODIFY",
"diff": "@@ -80,6 +80,7 @@ class WebappInstallBanner extends MultiCheckAudit {\nif (!hasOfflineStartUrl) {\nresult.failures.push('Service worker does not successfully serve the manifest\\'s start_url');\n+ if (artifacts.StartUrl.debugString) result.failures.push(artifacts.StartUrl.debugString);\n}\nif (artifacts.StartUrl.debugString) {\n",
"new_path": "lighthouse-core/audits/webapp-install-banner.js",
"old_path": "lighthouse-core/audits/webapp-install-banner.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -18,32 +18,11 @@ class StartUrl extends Gatherer {\n}\nexecuteFetchRequest(driver, url) {\n- return new Promise((resolve, reject) => {\n- let requestId;\n- const fetchRequestId = (data) => {\n- if (URL.equalWithExcludedFragments(data.request.url, url)) {\n- requestId = data.requestId;\n- driver.off('Network.requestWillBeSent', fetchRequestId);\n- }\n- };\n- const fetchDone = (data) => {\n- if (data.requestId === requestId) {\n- driver.off('Network.loadingFinished', fetchDone);\n- driver.off('Network.loadingFailed', fetchDone);\n-\n- resolve();\n- }\n- };\n-\n- driver.on('Network.requestWillBeSent', fetchRequestId);\n- driver.on('Network.loadingFinished', fetchDone);\n- driver.on('Network.loadingFailed', fetchDone);\n- driver.evaluateAsync(\n+ return driver.evaluateAsync(\n`fetch('${url}')\n.then(response => response.status)\n- .catch(err => -1)`\n- ).catch(err => reject(err));\n- });\n+ .catch(err => ({fetchFailed: true, message: err.message}))`\n+ );\n}\npass(options) {\n@@ -78,17 +57,18 @@ class StartUrl extends Gatherer {\nrecord._fetchedViaServiceWorker;\n}).pop(); // Take the last record that matches.\n+ const msgWithExtraDebugString = msg => this.debugString ? `${msg}: ${this.debugString}` : msg;\nreturn options.driver.goOnline(options)\n.then(_ => {\nif (!this.startUrl) {\nreturn {\nstatusCode: -1,\n- debugString: this.debugString || 'No start URL to fetch',\n+ debugString: msgWithExtraDebugString('No start URL to fetch'),\n};\n} else if (!navigationRecord) {\nreturn {\nstatusCode: -1,\n- debugString: this.debugString || 'Did not fetch start URL from service worker',\n+ debugString: msgWithExtraDebugString('Unable to fetch start URL via service worker'),\n};\n} else {\nreturn {\n",
"new_path": "lighthouse-core/gather/gatherers/start-url.js",
"old_path": "lighthouse-core/gather/gatherers/start-url.js"
},
{
"change_type": "MODIFY",
"diff": "/* eslint-env mocha */\n-const URL = require('../../../lib/url-shim');\nconst StartUrlGatherer = require('../../../gather/gatherers/start-url');\nconst assert = require('assert');\nconst tracingData = require('../../fixtures/traces/network-records.json');\n@@ -24,37 +23,7 @@ const mockDriver = {\nconst wrapSendCommand = (mockDriver, url) => {\nmockDriver = Object.assign({}, mockDriver);\n- mockDriver.evaluateAsync = () => {\n- url = new URL(url);\n- url.hash = '';\n-\n- const record = findRequestByUrl(url.href);\n- if (!record) {\n- return Promise.reject(-1);\n- }\n-\n- return Promise.resolve(record.statusCode);\n- };\n-\n- mockDriver.on = (name, cb) => {\n- if (name === 'Network.requestWillBeSent') {\n- cb({\n- request: {\n- url,\n- requestId: 1,\n- },\n- });\n- }\n-\n- if (name === 'Network.loadingFinished') {\n- cb({\n- request: {\n- url,\n- requestId: 1,\n- },\n- });\n- }\n- };\n+ mockDriver.evaluateAsync = () => Promise.resolve();\nmockDriver.getAppManifest = () => {\nreturn Promise.resolve({\n@@ -67,10 +36,6 @@ const wrapSendCommand = (mockDriver, url) => {\nreturn mockDriver;\n};\n-const findRequestByUrl = (url) => {\n- return tracingData.networkRecords.find(record => record._url === url);\n-};\n-\ndescribe('Start-url gatherer', () => {\nit('returns an artifact set to -1 when offline loading fails', () => {\nconst startUrlGatherer = new StartUrlGatherer();\n",
"new_path": "lighthouse-core/test/gather/gatherers/start-url-test.js",
"old_path": "lighthouse-core/test/gather/gatherers/start-url-test.js"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
core(start-url): switch to plain old fetch (#4301)
| 1
|
core
|
start-url
|
807,849
|
19.01.2018 13:57:26
| 28,800
|
ea1543f87cd4e32c3aaf964805b210eac282144c
|
chore: add tests for Command validations
|
[
{
"change_type": "MODIFY",
"diff": "\"use strict\";\n+const fs = require(\"fs-extra\");\nconst execa = require(\"execa\");\nconst loadJsonFile = require(\"load-json-file\");\nconst log = require(\"npmlog\");\nconst path = require(\"path\");\n+const tempy = require(\"tempy\");\nconst touch = require(\"touch\");\nconst writeJsonFile = require(\"write-json-file\");\nconst ChildProcessUtilities = require(\"../src/ChildProcessUtilities\");\n-const FileSystemUtilities = require(\"../src/FileSystemUtilities\");\n-const GitUtilities = require(\"../src/GitUtilities\");\n// helpers\nconst callsBack = require(\"./helpers/callsBack\");\n@@ -22,15 +22,26 @@ const LERNA_VERSION = require(\"../package.json\").version;\n// silence logs\nlog.level = \"silent\";\n+const onAllExitedOriginal = ChildProcessUtilities.onAllExited;\n+const getChildProcessCountOriginal = ChildProcessUtilities.getChildProcessCount;\n+\ndescribe(\"Command\", () => {\nconst originalCWD = process.cwd();\n+ afterEach(() => jest.resetAllMocks());\n+\nbeforeAll(async () => {\n+ ChildProcessUtilities.onAllExited = jest.fn(callsBack());\n+ ChildProcessUtilities.getChildProcessCount = jest.fn(() => 0);\n+\nconst testDir = await initFixture(\"Command/basic\");\nprocess.chdir(testDir);\n});\nafterAll(() => {\n+ ChildProcessUtilities.onAllExited = onAllExitedOriginal;\n+ ChildProcessUtilities.getChildProcessCount = getChildProcessCountOriginal;\n+\nprocess.chdir(originalCWD);\n});\n@@ -49,16 +60,6 @@ describe(\"Command\", () => {\n// convenience to avoid silly \"not implemented errors\"\nconst testFactory = (argv = {}) => new OkCommand(argv);\n- beforeEach(() => {\n- // only used to check for VERSION file\n- FileSystemUtilities.existsSync = jest.fn(() => false);\n-\n- // only used in runValidations(), tested elsewhere\n- GitUtilities.isInitialized = jest.fn(() => true);\n- });\n-\n- afterEach(() => jest.resetAllMocks());\n-\ndescribe(\".lernaVersion\", () => {\nit(\"should be added to the instance\", async () => {\nexpect(testFactory().lernaVersion).toEqual(LERNA_VERSION);\n@@ -101,7 +102,6 @@ describe(\"Command\", () => {\ndescribe(\".execOpts\", () => {\nconst ONE_HUNDRED_MEGABYTES = 1000 * 1000 * 100;\n- const REPO_PATH = process.cwd();\nit(\"has maxBuffer\", () => {\nconst command = testFactory({ maxBuffer: ONE_HUNDRED_MEGABYTES });\n@@ -109,8 +109,8 @@ describe(\"Command\", () => {\n});\nit(\"has repo path\", () => {\n- const command = testFactory({ cwd: REPO_PATH });\n- expect(command.execOpts.cwd).toBe(REPO_PATH);\n+ const command = testFactory();\n+ expect(command.execOpts.cwd).toBe(process.cwd());\n});\n});\n@@ -216,7 +216,7 @@ describe(\"Command\", () => {\nlernaConfig.loglevel = \"warn\";\nawait writeJsonFile(lernaJsonLocation, lernaConfig, { indent: 2 });\n- await testFactory({ cwd });\n+ await testFactory({ cwd, onRejected });\nexpect(log.level).toBe(\"warn\");\n});\n@@ -491,4 +491,47 @@ describe(\"Command\", () => {\n});\n});\n});\n+\n+ describe(\"validations\", () => {\n+ it(\"throws ENOGIT when repository is not initialized\", async () => {\n+ const cwd = tempy.directory();\n+\n+ try {\n+ await testFactory({ cwd, onRejected });\n+ } catch (err) {\n+ expect(err.exitCode).toBe(1);\n+ expect(err.prefix).toBe(\"ENOGIT\");\n+ }\n+\n+ expect.assertions(2);\n+ });\n+\n+ it(\"throws ENOPKG when root package.json is not found\", async () => {\n+ const cwd = await initFixture(\"Command/basic\");\n+ await fs.remove(path.join(cwd, \"package.json\"));\n+\n+ try {\n+ await testFactory({ cwd, onRejected });\n+ } catch (err) {\n+ expect(err.exitCode).toBe(1);\n+ expect(err.prefix).toBe(\"ENOPKG\");\n+ }\n+\n+ expect.assertions(2);\n+ });\n+\n+ it(\"throws ENOLERNA when lerna.json is not found\", async () => {\n+ const cwd = await initFixture(\"Command/basic\");\n+ await fs.remove(path.join(cwd, \"lerna.json\"));\n+\n+ try {\n+ await testFactory({ cwd, onRejected });\n+ } catch (err) {\n+ expect(err.exitCode).toBe(1);\n+ expect(err.prefix).toBe(\"ENOLERNA\");\n+ }\n+\n+ expect.assertions(2);\n+ });\n+ });\n});\n",
"new_path": "test/Command.js",
"old_path": "test/Command.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
chore: add tests for Command validations
| 1
|
chore
| null |
807,849
|
19.01.2018 14:05:43
| 28,800
|
48a3a59ab55bfb8b875de1ba170ffc77af87b956
|
chore: prettier README [skip ci]
|
[
{
"change_type": "MODIFY",
"diff": "<a href=\"https://slack.lernajs.io/\"><img alt=\"Slack Status\" src=\"https://slack.lernajs.io/badge.svg\"></a>\n</p>\n-- [About](#about)\n-- [Getting Started](#getting-started)\n-- [How It Works](#how-it-works)\n-- [Troubleshooting](#troubleshooting)\n-- [Commands](#commands)\n-- [Misc](#misc)\n-- [Lerna.json](#lernajson)\n-- [Flags](#flags)\n+* [About](#about)\n+* [Getting Started](#getting-started)\n+* [How It Works](#how-it-works)\n+* [Troubleshooting](#troubleshooting)\n+* [Commands](#commands)\n+* [Misc](#misc)\n+* [Lerna.json](#lernajson)\n+* [Flags](#flags)\n## About\nSplitting up large codebases into separate independently versioned packages\nis extremely useful for code sharing. However, making changes across many\n-repositories is *messy* and difficult to track, and testing across repositories\n+repositories is _messy_ and difficult to track, and testing across repositories\ngets complicated really fast.\nTo solve these (and many other) problems, some projects will organize their\n@@ -220,8 +220,8 @@ May also be configured in `lerna.json`:\nLet's use `babel` as an example.\n-- `babel-generator` and `source-map` (among others) are dependencies of `babel-core`.\n-- `babel-core`'s [`package.json`](https://github.com/babel/babel/blob/13c961d29d76ccd38b1fc61333a874072e9a8d6a/packages/babel-core/package.json#L28-L47) lists both these packages as keys in `dependencies`, as shown below.\n+* `babel-generator` and `source-map` (among others) are dependencies of `babel-core`.\n+* `babel-core`'s [`package.json`](https://github.com/babel/babel/blob/13c961d29d76ccd38b1fc61333a874072e9a8d6a/packages/babel-core/package.json#L28-L47) lists both these packages as keys in `dependencies`, as shown below.\n### add\n@@ -261,17 +261,18 @@ lerna add babel-core # Install babel-core in all modules\n}\n```\n-- Lerna checks if each dependency is also part of the Lerna repo.\n- - In this example, `babel-generator` can be an internal dependency, while `source-map` is always an external dependency.\n- - The version of `babel-generator` in the `package.json` of `babel-core` is satisfied by `packages/babel-generator`, passing for an internal dependency.\n- - `source-map` is `npm install`ed (or `yarn`ed) like normal.\n-- `packages/babel-core/node_modules/babel-generator` symlinks to `packages/babel-generator`\n-- This allows nested directory imports\n+* Lerna checks if each dependency is also part of the Lerna repo.\n+ * In this example, `babel-generator` can be an internal dependency, while `source-map` is always an external dependency.\n+ * The version of `babel-generator` in the `package.json` of `babel-core` is satisfied by `packages/babel-generator`, passing for an internal dependency.\n+ * `source-map` is `npm install`ed (or `yarn`ed) like normal.\n+* `packages/babel-core/node_modules/babel-generator` symlinks to `packages/babel-generator`\n+* This allows nested directory imports\n**Notes:**\n-- When a dependency version in a package is not satisfied by a package of the same name in the repo, it will be `npm install`ed (or `yarn`ed) like normal.\n-- Dist-tags, like `latest`, do not satisfy [semver](https://semver.npmjs.com/) ranges.\n-- Circular dependencies result in circular symlinks which *may* impact your editor/IDE.\n+\n+* When a dependency version in a package is not satisfied by a package of the same name in the repo, it will be `npm install`ed (or `yarn`ed) like normal.\n+* Dist-tags, like `latest`, do not satisfy [semver](https://semver.npmjs.com/) ranges.\n+* Circular dependencies result in circular symlinks which _may_ impact your editor/IDE.\n[Webstorm](https://www.jetbrains.com/webstorm/) locks up when circular symlinks are present. To prevent this, add `node_modules` to the list of ignored files and folders in `Preferences | Editor | File Types | Ignored files and folders`.\n@@ -336,7 +337,7 @@ $ lerna publish --canary\n$ lerna publish --canary=beta\n```\n-When run with this flag, `publish` publishes packages in a more granular way (per commit). Before publishing to npm, it creates the new `version` tag by taking the current `version`, bumping it to the next *minor* version, adding the provided meta suffix (defaults to `alpha`) and appending the current git sha (ex: `1.0.0` becomes `1.1.0-alpha.81e3b443`).\n+When run with this flag, `publish` publishes packages in a more granular way (per commit). Before publishing to npm, it creates the new `version` tag by taking the current `version`, bumping it to the next _minor_ version, adding the provided meta suffix (defaults to `alpha`) and appending the current git sha (ex: `1.0.0` becomes `1.1.0-alpha.81e3b443`).\n> The intended use case for this flag is a per commit level release or nightly release.\n@@ -386,11 +387,6 @@ When run with this flag, `publish` will update all `package.json` package\nversions and dependency versions, but it will not actually publish the\npackages to npm.\n-> This was useful as a workaround for an [npm\n-issue](https://github.com/npm/registry/issues/42) which has since been fixed. When publishing with\n-README changes, use `--skip-npm` and do the final `npm publish` by hand for\n-each package.\n-\nThis flag can be combined with `--skip-git` to _just_ update versions and\ndependencies, without committing, tagging, pushing or publishing.\n@@ -481,6 +477,7 @@ If the message contains `%v`, it will be replaced with the new global version ve\nNote that this only applies when using the default \"fixed\" versioning mode, as there is no \"global\" version when using `--independent`.\nThis can be configured in lerna.json, as well:\n+\n```json\n{\n\"commands\": {\n@@ -511,10 +508,7 @@ If your `lerna.json` contains something like this:\n{\n\"command\": {\n\"publish\": {\n- \"allowBranch\": [\n- \"master\",\n- \"feature/*\"\n- ]\n+ \"allowBranch\": [\"master\", \"feature/*\"]\n}\n}\n}\n@@ -536,7 +530,6 @@ Check which `packages` have changed since the last release (the last git tag).\nLerna determines the last git tag created and runs `git diff --name-only v6.8.1` to get all files changed since that tag. It then returns an array of packages that have an updated file.\n-\n**Note that configuration for the `publish` command _also_ affects the\n`updated` command. For example `config.publish.ignore`**\n@@ -652,6 +645,7 @@ $ lerna exec --scope my-component -- ls -la\n```\nTo spawn long-running processes, pass the `--parallel` flag:\n+\n```sh\n# transpile all modules as they change in every package\n$ lerna exec --parallel -- babel src -d lib -w\n@@ -745,12 +739,12 @@ Running `lerna` without arguments will show all commands/options.\n}\n```\n-- `lerna`: the current version of Lerna being used.\n-- `version`: the current version of the repository.\n-- `commands.publish.ignore`: an array of globs that won't be included in `lerna updated/publish`. Use this to prevent publishing a new version unnecessarily for changes, such as fixing a `README.md` typo.\n-- `commands.bootstrap.ignore`: an array of globs that won't be bootstrapped when running the `lerna bootstrap` command.\n-- `commands.bootstrap.scope`: an array of globs that restricts which packages will be bootstrapped when running the `lerna bootstrap` command.\n-- `packages`: Array of globs to use as package locations.\n+* `lerna`: the current version of Lerna being used.\n+* `version`: the current version of the repository.\n+* `commands.publish.ignore`: an array of globs that won't be included in `lerna updated/publish`. Use this to prevent publishing a new version unnecessarily for changes, such as fixing a `README.md` typo.\n+* `commands.bootstrap.ignore`: an array of globs that won't be bootstrapped when running the `lerna bootstrap` command.\n+* `commands.bootstrap.scope`: an array of globs that restricts which packages will be bootstrapped when running the `lerna bootstrap` command.\n+* `packages`: Array of globs to use as package locations.\n### Common `devDependencies`\n@@ -758,10 +752,10 @@ Most `devDependencies` can be pulled up to the root of a Lerna repo.\nThis has a few benefits:\n-- All packages use the same version of a given dependency\n-- Can keep dependencies at the root up-to-date with an automated tool such as [GreenKeeper](https://greenkeeper.io/)\n-- Dependency installation time is reduced\n-- Less storage is needed\n+* All packages use the same version of a given dependency\n+* Can keep dependencies at the root up-to-date with an automated tool such as [GreenKeeper](https://greenkeeper.io/)\n+* Dependency installation time is reduced\n+* Less storage is needed\nNote that `devDependencies` providing \"binary\" executables that are used by\nnpm scripts still need to be installed directly in each package where they're\n@@ -771,7 +765,6 @@ For example the `nsp` dependency is necessary in this case for `lerna run nsp`\n(and `npm run nsp` within the package's directory) to work correctly:\n```json\n-\n{\n\"scripts\": {\n\"nsp\": \"nsp\"\n@@ -797,9 +790,9 @@ Example:\n\"exampleOption\": \"foo\",\n\"commands\": {\n\"init\": {\n- \"exampleOption\": \"bar\",\n+ \"exampleOption\": \"bar\"\n+ }\n}\n- },\n}\n```\n@@ -849,7 +842,7 @@ List all packages that have changed since `some-branch`:\n$ lerna ls --since some-branch\n```\n-*This can be particularly useful when used in CI, if you can obtain the target branch a PR will be going into, because you can use that as the `ref` to the `--since` option. This works well for PRs going into master as well as feature branches.*\n+_This can be particularly useful when used in CI, if you can obtain the target branch a PR will be going into, because you can use that as the `ref` to the `--since` option. This works well for PRs going into master as well as feature branches._\n#### --flatten\n@@ -891,6 +884,7 @@ The `ignore` flag, when used with the `bootstrap` command, can also be set in `l\nUsed in combination with any command that accepts `--scope` (`bootstrap`, `clean`, `ls`, `run`, `exec`). Ensures that all dependencies (and dev dependencies) of any scoped packages (either through `--scope` or `--ignore`) are operated on as well.\n> Note: This will override the `--scope` and `--ignore` flags.\n+>\n> > i.e. A package matched by the `--ignore` flag will still be bootstrapped if it is depended on by another package that is being bootstrapped.\nThis is useful for situations where you want to \"set up\" a single package that relies on other packages being set up.\n@@ -996,17 +990,17 @@ May also be configured in `lerna.json`:\n```\nThe root-level package.json must also include a `workspaces` array:\n+\n```json\n{\n\"private\": true,\n\"devDependencies\": {\n\"lerna\": \"^2.2.0\"\n},\n- \"workspaces\": [\n- \"packages/*\"\n- ]\n+ \"workspaces\": [\"packages/*\"]\n}\n```\n+\nThis list is broadly similar to lerna's `packages` config (a list of globs matching directories with a package.json),\nexcept it does not support recursive globs (`\"**\"`, a.k.a. \"globstars\").\n@@ -1016,6 +1010,7 @@ Allow target versions of dependent packages to be written as [git hosted urls](h\nIf enabled, Lerna will attempt to extract and save the interpackage dependency versions from `package.json` files using git url-aware parser.\nEg. assuming monorepo with 2 packages where `my-package-1` depends on `my-package-2`, `package.json` of `my-package-1` could be:\n+\n```\n// packages/my-package-1/package.json\n{\n@@ -1033,15 +1028,18 @@ Eg. assuming monorepo with 2 packages where `my-package-1` depends on `my-packag\n}\n}\n```\n+\nFor the case above Lerna will read the version of `my-package-2` dependency as `1.0.0`.\nThis allows packages to be distributed via git repos if eg. packages are private and [private npm repo is not an option](https://www.dotconferences.com/2016/05/fabien-potencier-monolithic-repositories-vs-many-repositories).\nPlease note that using `--use-git-version`\n-- is limited to urls with [`committish`](https://docs.npmjs.com/files/package.json#git-urls-as-dependencies) part present (ie. `github:example-user/my-package-2` is invalid)\n-- requires `publish` command to be used with `--exact`\n+\n+* is limited to urls with [`committish`](https://docs.npmjs.com/files/package.json#git-urls-as-dependencies) part present (ie. `github:example-user/my-package-2` is invalid)\n+* requires `publish` command to be used with `--exact`\nMay also be configured in `lerna.json`:\n+\n```js\n{\n...\n@@ -1054,12 +1052,12 @@ May also be configured in `lerna.json`:\nDefines version prefix string (defaults to 'v') ignored when extracting version number from a commitish part of git url.\nEverything after the prefix will be considered a version.\n-\nEg. given `github:example-user/my-package-2#v1.0.0` and `gitVersionPrefix: 'v'` version will be read as `1.0.0`.\nOnly used if `--use-git-version` is set to `true`.\nMay also be configured in `lerna.json`:\n+\n```js\n{\n...\n@@ -1102,7 +1100,9 @@ This is not generally necessary, as Lerna will publish packages in topological\norder (all dependencies before dependents) by default.\n### README Badge\n+\nUsing Lerna? Add a README badge to show it off: [](https://lernajs.io/)\n+\n```\n[](https://lernajs.io/)\n```\n",
"new_path": "README.md",
"old_path": "README.md"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
chore: prettier README [skip ci]
| 1
|
chore
| null |
448,073
|
19.01.2018 15:28:11
| -3,600
|
542aed2bcf0221ed1a6b89daf2b5a720b15181e5
|
fix: strip comments from processed styles
Fixes
|
[
{
"change_type": "MODIFY",
"diff": "\"jasmine\": \"^2.6.0\",\n\"json-schema-to-typescript\": \"^5.0.0\",\n\"mocha\": \"^5.0.0\",\n+ \"postcss-discard-comments\": \"^2.0.4\",\n\"prettier\": \"^1.10.2\",\n\"pretty-quick\": \"^1.2.1\",\n\"react\": \"^16.0.0\",\n",
"new_path": "package.json",
"old_path": "package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -15,6 +15,7 @@ import * as nodeSassTildeImporter from 'node-sass-tilde-importer';\nimport * as less from 'less';\nimport * as stylus from 'stylus';\nimport * as postcssUrl from 'postcss-url';\n+import * as postcssComments from 'postcss-discard-comments';\nexport const processAssets: BuildStep =\nasync ({ artefacts, entryPoint, pkg }): Promise<NgArtefacts> => {\n@@ -85,7 +86,10 @@ const processStylesheet =\nif (cssUrl !== CssUrl.none) {\nlog.debug(`postcssUrl: ${cssUrl}`);\n- postCssPlugins.push(postcssUrl({ url: cssUrl }));\n+ postCssPlugins.push(\n+ postcssUrl({ url: cssUrl }),\n+ postcssComments({ removeAll: true })\n+ );\n}\nconst result: postcss.Result = await postcss(postCssPlugins)\n.process(cssStyles, {\n",
"new_path": "src/lib/steps/assets.ts",
"old_path": "src/lib/steps/assets.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -1648,6 +1648,10 @@ has-ansi@^2.0.0:\ndependencies:\nansi-regex \"^2.0.0\"\n+has-flag@^1.0.0:\n+ version \"1.0.0\"\n+ resolved \"https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa\"\n+\nhas-flag@^2.0.0:\nversion \"2.0.0\"\nresolved \"https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51\"\n@@ -1951,6 +1955,10 @@ js-base64@^2.1.8:\nversion \"2.4.0\"\nresolved \"https://registry.yarnpkg.com/js-base64/-/js-base64-2.4.0.tgz#9e566fee624751a1d720c966cd6226d29d4025aa\"\n+js-base64@^2.1.9:\n+ version \"2.4.1\"\n+ resolved \"https://registry.yarnpkg.com/js-base64/-/js-base64-2.4.1.tgz#e02813181cd53002888e918935467acb2910e596\"\n+\njs-tokens@^3.0.0:\nversion \"3.0.2\"\nresolved \"https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b\"\n@@ -2689,6 +2697,12 @@ pinkie@^2.0.0:\nversion \"2.0.4\"\nresolved \"https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870\"\n+postcss-discard-comments@^2.0.4:\n+ version \"2.0.4\"\n+ resolved \"https://registry.yarnpkg.com/postcss-discard-comments/-/postcss-discard-comments-2.0.4.tgz#befe89fafd5b3dace5ccce51b76b81514be00e3d\"\n+ dependencies:\n+ postcss \"^5.0.14\"\n+\npostcss-url@^7.3.0:\nversion \"7.3.0\"\nresolved \"https://registry.yarnpkg.com/postcss-url/-/postcss-url-7.3.0.tgz#cf2f45e06743cf43cfea25309f81cbc003dc783f\"\n@@ -2703,6 +2717,15 @@ postcss-value-parser@^3.2.3:\nversion \"3.3.0\"\nresolved \"https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz#87f38f9f18f774a4ab4c8a232f5c5ce8872a9d15\"\n+postcss@^5.0.14:\n+ version \"5.2.18\"\n+ resolved \"https://registry.yarnpkg.com/postcss/-/postcss-5.2.18.tgz#badfa1497d46244f6390f58b319830d9107853c5\"\n+ dependencies:\n+ chalk \"^1.1.3\"\n+ js-base64 \"^2.1.9\"\n+ source-map \"^0.5.6\"\n+ supports-color \"^3.2.3\"\n+\npostcss@^6.0.1, postcss@^6.0.14, postcss@^6.0.2:\nversion \"6.0.14\"\nresolved \"https://registry.yarnpkg.com/postcss/-/postcss-6.0.14.tgz#5534c72114739e75d0afcf017db853099f562885\"\n@@ -3399,6 +3422,12 @@ supports-color@^2.0.0:\nversion \"2.0.0\"\nresolved \"https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7\"\n+supports-color@^3.2.3:\n+ version \"3.2.3\"\n+ resolved \"https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6\"\n+ dependencies:\n+ has-flag \"^1.0.0\"\n+\nsupports-color@^4.0.0, supports-color@^4.4.0:\nversion \"4.5.0\"\nresolved \"https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b\"\n",
"new_path": "yarn.lock",
"old_path": "yarn.lock"
}
] |
TypeScript
|
MIT License
|
ng-packagr/ng-packagr
|
fix: strip comments from processed styles (#512)
Fixes #503
| 1
|
fix
| null |
791,825
|
19.01.2018 19:50:32
| 0
|
890103468bc724cc221e47bbbb91a21fb35efbe4
|
cli(extra-headers): Enable sending additional HTTP Headers via the CLI
|
[
{
"change_type": "MODIFY",
"diff": "@@ -27,6 +27,7 @@ last-run-results.html\nlatest-run\nclosure-error.log\n+yarn-error.log\n/chrome-linux/\n/chrome-win32/\n",
"new_path": ".gitignore",
"old_path": ".gitignore"
},
{
"change_type": "MODIFY",
"diff": "*/\n'use strict';\n-const existsSync = require('fs').existsSync;\n+const fs = require('fs');\nconst path = require('path');\nconst commands = require('./commands/commands.js');\n@@ -27,7 +27,7 @@ const askPermission = require('./sentry-prompt').askPermission;\n* @return {boolean}\n*/\nfunction isDev() {\n- return existsSync(path.join(__dirname, '../.git'));\n+ return fs.existsSync(path.join(__dirname, '../.git'));\n}\n// Tell user if there's a newer version of LH.\n@@ -70,6 +70,15 @@ log.setLevel(cliFlags.logLevel);\nif (cliFlags.output === printer.OutputMode.json && !cliFlags.outputPath) {\ncliFlags.outputPath = 'stdout';\n}\n+\n+if (cliFlags.extraHeaders) {\n+ if (cliFlags.extraHeaders.substr(0, 1) !== '{') {\n+ cliFlags.extraHeaders = fs.readFileSync(cliFlags.extraHeaders, 'utf-8');\n+ }\n+\n+ cliFlags.extraHeaders = JSON.parse(cliFlags.extraHeaders);\n+}\n+\n/**\n* @return {!Promise<(void|!LH.Results)>}\n*/\n",
"new_path": "lighthouse-cli/bin.js",
"old_path": "lighthouse-cli/bin.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -42,6 +42,12 @@ function getFlags(manualArgv) {\n.example(\n'lighthouse <url> --quiet --chrome-flags=\"--headless\"',\n'Launch Headless Chrome, turn off logging')\n+ .example(\n+ 'lighthouse <url> --extra-headers \"{\\\\\"Cookie\\\\\":\\\\\"monster=blue\\\\\", \\\\\"x-men\\\\\":\\\\\"wolverine\\\\\"}\"',\n+ 'Stringify\\'d JSON HTTP Header key/value pairs to send in requests')\n+ .example(\n+ 'lighthouse <url> --extra-headers=./path/to/file.json',\n+ 'Path to JSON file of HTTP Header key/value pairs to send in requests')\n// List of options\n.group(['verbose', 'quiet'], 'Logging:')\n@@ -83,6 +89,7 @@ function getFlags(manualArgv) {\n'port': 'The port to use for the debugging protocol. Use 0 for a random port',\n'max-wait-for-load':\n'The timeout (in milliseconds) to wait before the page is considered done loading and the run should continue. WARNING: Very high values can lead to large traces and instability',\n+ 'extra-headers': 'Set extra HTTP Headers to pass with request',\n})\n// set aliases\n.alias({'gather-mode': 'G', 'audit-mode': 'A'})\n@@ -108,6 +115,7 @@ function getFlags(manualArgv) {\n.choices('output', printer.getValidOutputOptions())\n// force as an array\n.array('blocked-url-patterns')\n+ .string('extra-headers')\n// default values\n.default('chrome-flags', '')\n",
"new_path": "lighthouse-cli/cli-flags.js",
"old_path": "lighthouse-cli/cli-flags.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -40,5 +40,31 @@ describe('CLI Tests', function() {\nassert.ok(Array.isArray(output.traceCategories));\nassert.ok(output.traceCategories.length > 0);\n});\n+\n+ describe('extra-headers', () => {\n+ it('should exit with a error if the path is not valid', () => {\n+ const ret = spawnSync('node', [indexPath, 'https://www.google.com',\n+ '--extra-headers=./fixtures/extra-headers/not-found.json'], {encoding: 'utf8'});\n+\n+ assert.ok(ret.stderr.includes('no such file or directory'));\n+ assert.equal(ret.status, 1);\n+ });\n+\n+ it('should exit with a error if the file does not contain valid JSON', () => {\n+ const ret = spawnSync('node', [indexPath, 'https://www.google.com',\n+ '--extra-headers',\n+ path.resolve(__dirname, '../fixtures/extra-headers/invalid.txt')], {encoding: 'utf8'});\n+\n+ assert.ok(ret.stderr.includes('Unexpected token'));\n+ assert.equal(ret.status, 1);\n});\n+ it('should exit with a error if the passsed in string is not valid JSON', () => {\n+ const ret = spawnSync('node', [indexPath, 'https://www.google.com',\n+ '--extra-headers', '{notjson}'], {encoding: 'utf8'});\n+\n+ assert.ok(ret.stderr.includes('Unexpected token'));\n+ assert.equal(ret.status, 1);\n+ });\n+ });\n+});\n",
"new_path": "lighthouse-cli/test/cli/index-test.js",
"old_path": "lighthouse-cli/test/cli/index-test.js"
},
{
"change_type": "ADD",
"diff": "+NotJSON\n",
"new_path": "lighthouse-cli/test/fixtures/extra-headers/invalid.txt",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"Cookie\": \"monster=blue\",\n+ \"x-men\": \"wolverine\"\n+}\n",
"new_path": "lighthouse-cli/test/fixtures/extra-headers/valid.json",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -968,6 +968,20 @@ class Driver {\n.then(_ => this.sendCommand('Network.setCacheDisabled', {cacheDisabled: false}));\n}\n+ /**\n+ * @param {!Object} headers key/value pairs of HTTP Headers.\n+ * @return {!Promise}\n+ */\n+ setExtraHTTPHeaders(headers) {\n+ if (headers) {\n+ return this.sendCommand('Network.setExtraHTTPHeaders', {\n+ headers,\n+ });\n+ }\n+\n+ return Promise.resolve({});\n+ }\n+\nclearDataForOrigin(url) {\nconst origin = new URL(url).origin;\n",
"new_path": "lighthouse-core/gather/driver.js",
"old_path": "lighthouse-core/gather/driver.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -198,7 +198,8 @@ class GatherRunner {\n// Set request blocking before any network activity\n// No \"clearing\" is done at the end of the pass since blockUrlPatterns([]) will unset all if\n// neccessary at the beginning of the next pass.\n- .then(() => options.driver.blockUrlPatterns(blockedUrls));\n+ .then(() => options.driver.blockUrlPatterns(blockedUrls))\n+ .then(() => options.driver.setExtraHTTPHeaders(options.flags.extraHeaders));\nreturn options.config.gatherers.reduce((chain, gatherer) => {\nreturn chain.then(_ => {\n",
"new_path": "lighthouse-core/gather/gather-runner.js",
"old_path": "lighthouse-core/gather/gather-runner.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -230,6 +230,7 @@ ReportRenderer.GroupJSON; // eslint-disable-line no-unused-expressions\n* reportGroups: !Object<string, !ReportRenderer.GroupJSON>,\n* runtimeConfig: {\n* blockedUrlPatterns: !Array<string>,\n+ * extraHeaders: !Object,\n* environment: !Array<{description: string, enabled: boolean, name: string}>\n* }\n* }}\n",
"new_path": "lighthouse-core/report/v2/renderer/report-renderer.js",
"old_path": "lighthouse-core/report/v2/renderer/report-renderer.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -400,7 +400,11 @@ class Runner {\n},\n];\n- return {environment, blockedUrlPatterns: flags.blockedUrlPatterns || []};\n+ return {\n+ environment,\n+ blockedUrlPatterns: flags.blockedUrlPatterns || [],\n+ extraHeaders: flags.extraHeaders || {},\n+ };\n}\n}\n",
"new_path": "lighthouse-core/runner.js",
"old_path": "lighthouse-core/runner.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -79,7 +79,8 @@ connection.sendCommand = function(command, params) {\ncase 'Tracing.start':\ncase 'ServiceWorker.enable':\ncase 'ServiceWorker.disable':\n- return Promise.resolve();\n+ case 'Network.setExtraHTTPHeaders':\n+ return Promise.resolve({});\ncase 'Tracing.end':\nreturn Promise.reject(new Error('tracing not started'));\ndefault:\n@@ -239,6 +240,21 @@ describe('Browser Driver', () => {\n'de-dupes categories');\n});\n});\n+\n+ it('should send the Network.setExtraHTTPHeaders command when there are extra-headers', () => {\n+ return driverStub.setExtraHTTPHeaders({\n+ 'Cookie': 'monster',\n+ 'x-men': 'wolverine',\n+ }).then(() => {\n+ assert.equal(sendCommandParams[0].command, 'Network.setExtraHTTPHeaders');\n+ });\n+ });\n+\n+ it('should not send the Network.setExtraHTTPHeaders command when there no extra-headers', () => {\n+ return driverStub.setExtraHTTPHeaders().then(() => {\n+ assert.equal(sendCommandParams[0], undefined);\n+ });\n+ });\n});\ndescribe('Multiple tab check', () => {\n",
"new_path": "lighthouse-core/test/gather/driver-test.js",
"old_path": "lighthouse-core/test/gather/driver-test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -70,4 +70,7 @@ module.exports = {\nblockUrlPatterns() {\nreturn Promise.resolve();\n},\n+ setExtraHTTPHeaders() {\n+ return Promise.resolve();\n+ },\n};\n",
"new_path": "lighthouse-core/test/gather/fake-driver.js",
"old_path": "lighthouse-core/test/gather/fake-driver.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -34,7 +34,8 @@ class TestGathererNoArtifact extends Gatherer {\nconst fakeDriver = require('./fake-driver');\n-function getMockedEmulationDriver(emulationFn, netThrottleFn, cpuThrottleFn, blockUrlFn) {\n+function getMockedEmulationDriver(emulationFn, netThrottleFn, cpuThrottleFn,\n+ blockUrlFn, extraHeadersFn) {\nconst Driver = require('../../gather/driver');\nconst Connection = require('../../gather/connections/connection');\nconst EmulationDriver = class extends Driver {\n@@ -72,6 +73,9 @@ function getMockedEmulationDriver(emulationFn, netThrottleFn, cpuThrottleFn, blo\ncase 'Network.setBlockedURLs':\nfn = blockUrlFn;\nbreak;\n+ case 'Network.setExtraHTTPHeaders':\n+ fn = extraHeadersFn;\n+ break;\ndefault:\nfn = null;\nbreak;\n@@ -255,6 +259,7 @@ describe('GatherRunner', function() {\ncleanBrowserCaches: createCheck('calledCleanBrowserCaches'),\nclearDataForOrigin: createCheck('calledClearStorage'),\nblockUrlPatterns: asyncFunc,\n+ setExtraHTTPHeaders: asyncFunc,\ngetUserAgent: () => Promise.resolve('Fake user agent'),\n};\n@@ -313,6 +318,7 @@ describe('GatherRunner', function() {\ncleanBrowserCaches: createCheck('calledCleanBrowserCaches'),\nclearDataForOrigin: createCheck('calledClearStorage'),\nblockUrlPatterns: asyncFunc,\n+ setExtraHTTPHeaders: asyncFunc,\ngetUserAgent: () => Promise.resolve('Fake user agent'),\n};\n@@ -358,6 +364,41 @@ describe('GatherRunner', function() {\n}).then(() => assert.deepStrictEqual(receivedUrlPatterns, []));\n});\n+\n+ it('tells the driver to set additional http headers when extraHeaders flag is given', () => {\n+ let receivedHeaders = null;\n+ const driver = getMockedEmulationDriver(null, null, null, null, params => {\n+ receivedHeaders = params.headers;\n+ });\n+ const headers = {\n+ 'Cookie': 'monster',\n+ 'x-men': 'wolverine',\n+ };\n+\n+ return GatherRunner.beforePass({\n+ driver,\n+ flags: {\n+ extraHeaders: headers,\n+ },\n+ config: {gatherers: []},\n+ }).then(() => assert.deepStrictEqual(\n+ receivedHeaders,\n+ headers\n+ ));\n+ });\n+\n+ it('returns an empty object if a falsey value is passed in to extraHeaders', () => {\n+ const driver = getMockedEmulationDriver(null, null, null, null, params => params.headers);\n+\n+ return GatherRunner.beforePass({\n+ driver,\n+ flags: {\n+ extraHeaders: undefined,\n+ },\n+ config: {gatherers: []},\n+ }).then((returnValue) => assert.deepStrictEqual(returnValue, {}));\n+ });\n+\nit('tells the driver to begin tracing', () => {\nlet calledTrace = false;\nconst driver = {\n@@ -551,7 +592,6 @@ describe('GatherRunner', function() {\n});\n});\n-\nit('loads gatherers from custom paths', () => {\nconst root = path.resolve(__dirname, '../fixtures');\n",
"new_path": "lighthouse-core/test/gather/gather-runner-test.js",
"old_path": "lighthouse-core/test/gather/gather-runner-test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -86,6 +86,7 @@ Options:\n--disable-device-emulation Disable Nexus 5X emulation [boolean]\n--disable-cpu-throttling Disable CPU throttling [boolean] [default: false]\n--disable-network-throttling Disable network throttling [boolean]\n+ --extra-headers Set extra HTTP Headers to pass with request [string]\nExamples:\nlighthouse <url> --view Opens the HTML report in a browser after the run completes\n@@ -95,6 +96,8 @@ Examples:\nlighthouse <url> --disable-device-emulation --disable-network-throttling Disable device emulation\nlighthouse <url> --chrome-flags=\"--window-size=412,732\" Launch Chrome with a specific window size\nlighthouse <url> --quiet --chrome-flags=\"--headless\" Launch Headless Chrome, turn off logging\n+ lighthouse <url> --extra-headers \"{\\\"Cookie\\\":\\\"monster=blue\\\"}\" Stringify\\'d JSON HTTP Header key/value pairs to send in requests\n+ lighthouse <url> --extra-headers=./path/to/file.json Path to JSON file of HTTP Header key/value pairs to send in requests\nFor more information on Lighthouse, see https://developers.google.com/web/tools/lighthouse/.\n```\n",
"new_path": "readme.md",
"old_path": "readme.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -18,6 +18,7 @@ export interface Flags {\nlogLevel: string;\nhostname: string;\nblockedUrlPatterns: string[];\n+ extraHeaders: string;\nenableErrorReporting: boolean;\nlistAllAudits: boolean;\nlistTraceCategories: boolean;\n",
"new_path": "typings/externs.d.ts",
"old_path": "typings/externs.d.ts"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
cli(extra-headers): Enable sending additional HTTP Headers via the CLI (#3732)
| 1
|
cli
|
extra-headers
|
807,849
|
20.01.2018 16:28:10
| 28,800
|
22dd2f22b2631369c5fd4d0ecf76e6f1de932079
|
chore(ci): always install npm@latest, travis has yarn by default now
|
[
{
"change_type": "MODIFY",
"diff": "@@ -22,10 +22,7 @@ cache:\n- node_modules\nbefore_install:\n- - if [[ `node -v` == v6* ]]; then npm i -g npm@latest-5; 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+ - npm i -g npm@latest-5\ninstall: yarn --frozen-lockfile\n",
"new_path": ".travis.yml",
"old_path": ".travis.yml"
},
{
"change_type": "MODIFY",
"diff": "@@ -19,7 +19,7 @@ cache:\ninstall:\n- ps: Install-Product node $env:nodejs_version\n- - IF %nodejs_version% EQU 8 npm -g install npm@latest-5\n+ - 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(ci): always install npm@latest, travis has yarn by default now
| 1
|
chore
|
ci
|
807,849
|
22.01.2018 13:10:08
| 28,800
|
36b1d2657bbbf7c4c6ffd3c8e7ea52c5715360cf
|
chore: localize fixture init in publish unit tests
|
[
{
"change_type": "MODIFY",
"diff": "@@ -118,13 +118,8 @@ describe(\"PublishCommand\", () => {\n* ======================================================================= */\ndescribe(\"normal mode\", () => {\n- let testDir;\n-\n- beforeEach(async () => {\n- testDir = await initFixture(\"PublishCommand/normal\");\n- });\n-\nit(\"should publish the changed packages\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/normal\");\nawait run(testDir)();\nexpect(PromptUtilities.select.mock.calls).toMatchSnapshot(\"prompt\");\n@@ -162,6 +157,7 @@ describe(\"PublishCommand\", () => {\nit(\"throws an error when --independent is passed\", async () => {\nexpect.assertions(1);\n+ const testDir = await initFixture(\"PublishCommand/normal\");\ntry {\nawait run(testDir)(\"--independent\");\n} catch (error) {\n@@ -175,12 +171,6 @@ describe(\"PublishCommand\", () => {\n* ======================================================================= */\ndescribe(\"independent mode\", () => {\n- let testDir;\n-\n- beforeEach(async () => {\n- testDir = await initFixture(\"PublishCommand/independent\");\n- });\n-\nit(\"should publish the changed packages in independent mode\", async () => {\nconst promptReplies = [\"1.0.1\", \"1.1.0\", \"2.0.0\", \"1.1.0\", \"1.0.1\"];\nPromptUtilities.select = jest.fn((...args) => {\n@@ -188,6 +178,7 @@ describe(\"PublishCommand\", () => {\nreturn callsBack(reply)(...args);\n});\n+ const testDir = await initFixture(\"PublishCommand/independent\");\nawait run(testDir)(\n\"--independent\" // not required due to lerna.json config, but here to assert it doesn't error\n);\n@@ -227,13 +218,8 @@ describe(\"PublishCommand\", () => {\n* ======================================================================= */\ndescribe(\"normal mode as canary\", () => {\n- let testDir;\n-\n- beforeEach(async () => {\n- testDir = await initFixture(\"PublishCommand/normal\");\n- });\n-\nit(\"should publish the changed packages\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/normal\");\nawait run(testDir)(\"--canary\");\nexpect(PromptUtilities.select).not.toBeCalled();\n@@ -264,6 +250,7 @@ describe(\"PublishCommand\", () => {\n});\nit(\"should use the provided value as the meta suffix\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/normal\");\nawait run(testDir)(\"--canary\", \"beta\");\nexpect(updatedPackageVersions(testDir)).toMatchSnapshot(\"updated packages\");\n@@ -280,6 +267,7 @@ describe(\"PublishCommand\", () => {\n});\nit(\"should work with --canary and --cd-version=patch\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/normal\");\nawait run(testDir)(\"--canary\", \"--cd-version\", \"patch\");\nexpect(updatedPackageVersions(testDir)).toMatchSnapshot(\"updated packages\");\n@@ -301,13 +289,8 @@ describe(\"PublishCommand\", () => {\n* ======================================================================= */\ndescribe(\"independent mode as canary\", () => {\n- let testDir;\n-\n- beforeEach(async () => {\n- testDir = await initFixture(\"PublishCommand/independent\");\n- });\n-\nit(\"should publish the changed packages\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/independent\");\nawait run(testDir)(\"--canary\");\nexpect(PromptUtilities.select).not.toBeCalled();\n@@ -329,6 +312,7 @@ describe(\"PublishCommand\", () => {\n});\nit(\"should use the provided value as the meta suffix\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/independent\");\nawait run(testDir)(\"--canary\", \"beta\");\nexpect(updatedPackageJSON(\"package-2\").dependencies).toMatchObject({\n@@ -348,13 +332,8 @@ describe(\"PublishCommand\", () => {\n* ======================================================================= */\ndescribe(\"normal mode with --skip-git\", () => {\n- let testDir;\n-\n- beforeEach(async () => {\n- testDir = await initFixture(\"PublishCommand/normal\");\n- });\n-\nit(\"should publish the changed packages\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/normal\");\nawait run(testDir)(\"--skip-git\");\nexpect(GitUtilities.addFile).not.toBeCalled();\n@@ -371,13 +350,8 @@ describe(\"PublishCommand\", () => {\n* ======================================================================= */\ndescribe(\"normal mode with --skip-npm\", () => {\n- let testDir;\n-\n- beforeEach(async () => {\n- testDir = await initFixture(\"PublishCommand/normal\");\n- });\n-\nit(\"should update versions and push changes but not publish\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/normal\");\nawait run(testDir)(\"--skip-npm\");\nexpect(NpmUtilities.publishTaggedInDir).not.toBeCalled();\n@@ -396,13 +370,8 @@ describe(\"PublishCommand\", () => {\n* ======================================================================= */\ndescribe(\"normal mode with --skip-git and --skip-npm\", () => {\n- let testDir;\n-\n- beforeEach(async () => {\n- testDir = await initFixture(\"PublishCommand/normal\");\n- });\n-\nit(\"should update versions but not push changes or publish\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/normal\");\nawait run(testDir)(\"--skip-git\", \"--skip-npm\");\nexpect(updatedLernaJson()).toMatchObject({ version: \"1.0.1\" });\n@@ -438,13 +407,8 @@ describe(\"PublishCommand\", () => {\n* ======================================================================= */\ndescribe(\"normal mode with --temp-tag\", () => {\n- let testDir;\n-\n- beforeEach(async () => {\n- testDir = await initFixture(\"PublishCommand/normal\");\n- });\n-\nit(\"should publish the changed packages with a temp tag\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/normal\");\nawait run(testDir)(\"--temp-tag\");\nexpect(publishedTagInDirectories(testDir)).toMatchSnapshot(\"npm published\");\n@@ -460,13 +424,8 @@ describe(\"PublishCommand\", () => {\n* ======================================================================= */\ndescribe(\"normal mode with --npm-tag\", () => {\n- let testDir;\n-\n- beforeEach(async () => {\n- testDir = await initFixture(\"PublishCommand/normal\");\n- });\n-\nit(\"should publish the changed packages with npm tag\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/normal\");\nawait run(testDir)(\"--npm-tag\", \"custom\");\nexpect(publishedTagInDirectories(testDir)).toMatchSnapshot(\"npm published\");\n@@ -505,13 +464,8 @@ describe(\"PublishCommand\", () => {\n* ======================================================================= */\ndescribe(\"normal mode with --registry\", () => {\n- let testDir;\n-\n- beforeEach(async () => {\n- testDir = await initFixture(\"PublishCommand/normal\");\n- });\n-\nit(\"passes registry to npm commands\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/normal\");\nconst registry = \"https://my-private-registry\";\nawait run(testDir)(\"--registry\", registry);\n@@ -529,13 +483,8 @@ describe(\"PublishCommand\", () => {\n* ======================================================================= */\ndescribe(\"normal mode with --repo-version\", () => {\n- let testDir;\n-\n- beforeEach(async () => {\n- testDir = await initFixture(\"PublishCommand/normal\");\n- });\n-\nit(\"skips version prompt and publishes changed packages with designated version\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/normal\");\nawait run(testDir)(\"--repo-version\", \"1.0.1-beta\");\nexpect(PromptUtilities.select).not.toBeCalled();\n@@ -548,13 +497,8 @@ describe(\"PublishCommand\", () => {\n* ======================================================================= */\ndescribe(\"normal mode with --exact\", () => {\n- let testDir;\n-\n- beforeEach(async () => {\n- testDir = await initFixture(\"PublishCommand/normal\");\n- });\n-\nit(\"updates matching local dependencies of published packages with exact versions\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/normal\");\nawait run(testDir)(\"--exact\");\nexpect(updatedPackageJSON(\"package-2\").dependencies).toMatchObject({\n@@ -579,13 +523,8 @@ describe(\"PublishCommand\", () => {\n* ======================================================================= */\ndescribe(\"normal mode with --cd-version\", () => {\n- let testDir;\n-\n- beforeEach(async () => {\n- testDir = await initFixture(\"PublishCommand/normal\");\n- });\n-\nit(\"should use semver increments when passed to cdVersion flag\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/normal\");\nawait run(testDir)(\"--cd-version\", \"minor\");\nexpect(PromptUtilities.select).not.toBeCalled();\n@@ -595,6 +534,7 @@ describe(\"PublishCommand\", () => {\nit(\"throws an error when an invalid semver keyword is used\", async () => {\nexpect.assertions(1);\n+ const testDir = await initFixture(\"PublishCommand/normal\");\ntry {\nawait run(testDir)(\"--cd-version\", \"poopypants\");\n} catch (err) {\n@@ -611,11 +551,7 @@ describe(\"PublishCommand\", () => {\n* ======================================================================= */\ndescribe(\"normal mode with previous prerelease\", () => {\n- let testDir;\n-\nbeforeEach(async () => {\n- testDir = await initFixture(\"PublishCommand/republish-prereleased\");\n-\nGitUtilities.hasTags.mockReturnValue(true);\nGitUtilities.getLastTag.mockReturnValue(\"v1.0.1-beta.3\");\nGitUtilities.diffSinceIn.mockImplementation((since, location) => {\n@@ -627,6 +563,7 @@ describe(\"PublishCommand\", () => {\n});\nit(\"publishes changed & prereleased packages if --cd-version is non-prerelease\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/republish-prereleased\");\n// should republish 3, 4, and 5 because:\n// package 3 changed\n// package 5 has a prerelease version\n@@ -641,6 +578,7 @@ describe(\"PublishCommand\", () => {\n});\nit(\"should not publish prereleased packages if --cd-version is a pre-* increment\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/republish-prereleased\");\n// should republish only package 3, because it changed\nawait run(testDir)(\"--cd-version\", \"prerelease\", \"---preid\", \"beta\");\n@@ -654,13 +592,8 @@ describe(\"PublishCommand\", () => {\n* ======================================================================= */\ndescribe(\"indepdendent mode with --cd-version\", () => {\n- let testDir;\n-\n- beforeEach(async () => {\n- testDir = await initFixture(\"PublishCommand/independent\");\n- });\n-\nit(\"should use semver increments when passed to cdVersion flag\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/independent\");\nawait run(testDir)(\"--cd-version\", \"patch\");\nexpect(PromptUtilities.select).not.toBeCalled();\n@@ -672,6 +605,7 @@ describe(\"PublishCommand\", () => {\n* ======================================================================= */\nit(\"should bump to prerelease versions with --cd-version=prerelease --preid=foo\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/independent\");\nawait run(testDir)(\"--cd-version\", \"prerelease\", \"--preid\", \"foo\");\nexpect(updatedPackageVersions(testDir)).toMatchSnapshot(\"updated packages\");\n@@ -688,6 +622,7 @@ describe(\"PublishCommand\", () => {\n});\nit(\"should bump to prerelease versions with --cd-version prerelease (no --preid)\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/independent\");\nawait run(testDir)(\"--cd-version\", \"prerelease\");\nexpect(updatedPackageVersions(testDir)).toMatchSnapshot(\"updated packages\");\n@@ -709,13 +644,8 @@ describe(\"PublishCommand\", () => {\n* ======================================================================= */\ndescribe(\"normal mode with --git-remote\", () => {\n- let testDir;\n-\n- beforeEach(async () => {\n- testDir = await initFixture(\"PublishCommand/normal\");\n- });\n-\nit(\"pushes tags to specified remote\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/normal\");\nawait run(testDir)(\"--git-remote\", \"upstream\");\nexpect(GitUtilities.pushWithTags).lastCalledWith(\"upstream\", [\"v1.0.1\"], execOpts(testDir));\n@@ -727,13 +657,8 @@ describe(\"PublishCommand\", () => {\n* ======================================================================= */\ndescribe(\"normal mode with --ignore\", () => {\n- let testDir;\n-\n- beforeEach(async () => {\n- testDir = await initFixture(\"PublishCommand/normal\");\n- });\n-\nit(\"does not publish ignored packages\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/normal\");\nawait run(testDir)(\"--ignore\", \"package-2\", \"--ignore\", \"package-3\", \"--ignore\", \"package-4\");\nexpect(gitAddedFiles(testDir)).toMatchSnapshot(\"git added files\");\n@@ -746,19 +671,15 @@ describe(\"PublishCommand\", () => {\n* ======================================================================= */\ndescribe(\"normal mode with --message\", () => {\n- let testDir;\n-\n- beforeEach(async () => {\n- testDir = await initFixture(\"PublishCommand/normal\");\n- });\n-\nit(\"commits changes with a custom message using %s\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/normal\");\nawait run(testDir)(\"--message\", \"chore: Release %s :rocket:\");\nexpect(GitUtilities.commit).lastCalledWith(\"chore: Release v1.0.1 :rocket:\", execOpts(testDir));\n});\nit(\"commits changes with a custom message using %v\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/normal\");\nawait run(testDir)(\"--message\", \"chore: Release %v :rocket:\");\nexpect(GitUtilities.commit).lastCalledWith(\"chore: Release 1.0.1 :rocket:\", execOpts(testDir));\n@@ -770,13 +691,8 @@ describe(\"PublishCommand\", () => {\n* ======================================================================= */\ndescribe(\"independent mode with --message\", () => {\n- let testDir;\n-\n- beforeEach(async () => {\n- testDir = await initFixture(\"PublishCommand/independent\");\n- });\n-\nit(\"commits changes with a custom message\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/independent\");\nawait run(testDir)(\"-m\", \"chore: Custom publish message\");\nexpect(GitUtilities.commit).lastCalledWith(expect.stringContaining(\"chore:\"), execOpts(testDir));\n@@ -943,13 +859,8 @@ describe(\"PublishCommand\", () => {\n* ======================================================================= */\ndescribe(\"independent mode --canary --npm-tag=next --yes --exact\", () => {\n- let testDir;\n-\n- beforeEach(async () => {\n- testDir = await initFixture(\"PublishCommand/independent\");\n- });\n-\nit(\"should publish the changed packages\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/independent\");\nawait run(testDir)(\"--canary\", \"--npm-tag\", \"next\", \"--yes\", \"--exact\");\nexpect(publishedTagInDirectories(testDir)).toMatchSnapshot(\"npm published\");\n@@ -958,15 +869,10 @@ describe(\"PublishCommand\", () => {\ndescribe(\"--allow-branch\", () => {\ndescribe(\"cli\", () => {\n- let testDir;\n-\n- beforeEach(async () => {\n- testDir = await initFixture(\"PublishCommand/normal\");\n- });\n-\nit(\"should reject a non matching branch\", async () => {\nGitUtilities.getCurrentBranch.mockReturnValueOnce(\"unmatched\");\n+ const testDir = await initFixture(\"PublishCommand/normal\");\ntry {\nawait run(testDir)(\"--allow-branch\", \"master\");\n} catch (err) {\n@@ -977,6 +883,7 @@ describe(\"PublishCommand\", () => {\nit(\"should accept an exactly matching branch\", async () => {\nGitUtilities.getCurrentBranch.mockReturnValueOnce(\"exact-match\");\n+ const testDir = await initFixture(\"PublishCommand/normal\");\nconst { exitCode } = await run(testDir)(\"--allow-branch\", \"exact-match\");\nexpect(exitCode).toBe(0);\n});\n@@ -984,6 +891,7 @@ describe(\"PublishCommand\", () => {\nit(\"should accept a branch that matches by wildcard\", async () => {\nGitUtilities.getCurrentBranch.mockReturnValueOnce(\"feature/awesome\");\n+ const testDir = await initFixture(\"PublishCommand/normal\");\nconst { exitCode } = await run(testDir)(\"--allow-branch\", \"feature/*\");\nexpect(exitCode).toBe(0);\n});\n@@ -991,21 +899,17 @@ describe(\"PublishCommand\", () => {\nit(\"should accept a branch that matches one of the items passed\", async () => {\nGitUtilities.getCurrentBranch.mockReturnValueOnce(\"feature/awesome\");\n+ const testDir = await initFixture(\"PublishCommand/normal\");\nconst { exitCode } = await run(testDir)(\"--allow-branch\", \"master\", \"feature/*\");\nexpect(exitCode).toBe(0);\n});\n});\ndescribe(\"lerna.json\", () => {\n- let testDir;\n-\n- beforeEach(async () => {\n- testDir = await initFixture(\"PublishCommand/allow-branch-lerna\");\n- });\n-\nit(\"should reject a non matching branch\", async () => {\nGitUtilities.getCurrentBranch.mockReturnValueOnce(\"unmatched\");\n+ const testDir = await initFixture(\"PublishCommand/allow-branch-lerna\");\ntry {\nawait run(testDir)();\n} catch (err) {\n@@ -1016,6 +920,7 @@ describe(\"PublishCommand\", () => {\nit(\"should accept a matching branch\", async () => {\nGitUtilities.getCurrentBranch.mockReturnValueOnce(\"lerna\");\n+ const testDir = await initFixture(\"PublishCommand/allow-branch-lerna\");\nconst { exitCode } = await run(testDir)();\nexpect(exitCode).toBe(0);\n});\n@@ -1023,6 +928,7 @@ describe(\"PublishCommand\", () => {\nit(\"should prioritize cli over defaults\", async () => {\nGitUtilities.getCurrentBranch.mockReturnValueOnce(\"cli-override\");\n+ const testDir = await initFixture(\"PublishCommand/allow-branch-lerna\");\nconst { exitCode } = await run(testDir)(\"--allow-branch\", \"cli-override\");\nexpect(exitCode).toBe(0);\n});\n@@ -1045,15 +951,10 @@ describe(\"PublishCommand\", () => {\n* ======================================================================= */\ndescribe(\"lifecycle scripts\", () => {\n- let testDir;\n-\nconst scripts = [\"preversion\", \"version\", \"postversion\"];\n- beforeEach(async () => {\n- testDir = await initFixture(\"PublishCommand/lifecycle\");\n- });\n-\nit(\"should call version lifecycle scripts for a package\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/lifecycle\");\nawait run(testDir)();\nscripts.forEach(script => {\n@@ -1070,6 +971,7 @@ describe(\"PublishCommand\", () => {\n});\nit(\"should not call version lifecycle scripts for a package missing them\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/lifecycle\");\nawait run(testDir)();\nscripts.forEach(script => {\n@@ -1086,6 +988,7 @@ describe(\"PublishCommand\", () => {\n});\nit(\"should call version lifecycle scripts in the correct order\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/lifecycle\");\nawait run(testDir)();\nexpect(NpmUtilities.runScriptInDirSync.mock.calls.map(args => args[0])).toEqual(scripts);\n",
"new_path": "test/PublishCommand.js",
"old_path": "test/PublishCommand.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
chore: localize fixture init in publish unit tests
| 1
|
chore
| null |
807,849
|
23.01.2018 18:24:05
| 28,800
|
2ad86c7808fd14370e20a87b77b9e96ed7e97ffd
|
test(integration): remove redundant, slow tests
|
[
{
"change_type": "MODIFY",
"diff": "@@ -76,20 +76,3 @@ lerna info lifecycle prepublish\nlerna info lifecycle prepare\nlerna success Bootstrapped 3 packages\n`;\n-\n-exports[`lerna bootstrap from npm script bootstraps all packages: stderr 1`] = `\n-lerna info version __TEST_VERSION__\n-lerna success run Ran npm script 'test' in packages:\n-lerna success - @integration/package-1\n-lerna success - @integration/package-2\n-lerna success - @integration/package-3\n-lerna success - package-4\n-`;\n-\n-exports[`lerna bootstrap from npm script bootstraps all packages: stdout 1`] = `\n-package-1\n-package-2\n-cli package-2 OK\n-package-3 cli1 OK\n-package-3 cli2 package-2 OK\n-`;\n",
"new_path": "test/integration/__snapshots__/lerna-bootstrap.test.js.snap",
"old_path": "test/integration/__snapshots__/lerna-bootstrap.test.js.snap"
},
{
"change_type": "MODIFY",
"diff": "@@ -7,11 +7,3 @@ lerna info clean removing __TEST_ROOTDIR__/packages/package-2/node_modules\nlerna info clean removing __TEST_ROOTDIR__/packages/package-3/node_modules\nlerna success clean finished\n`;\n-\n-exports[`lerna clean local npm: stderr 1`] = `\n-lerna info version __TEST_VERSION__\n-lerna info clean removing __TEST_ROOTDIR__/packages/package-1/node_modules\n-lerna info clean removing __TEST_ROOTDIR__/packages/package-2/node_modules\n-lerna info clean removing __TEST_ROOTDIR__/packages/package-3/node_modules\n-lerna success clean finished\n-`;\n",
"new_path": "test/integration/__snapshots__/lerna-clean.test.js.snap",
"old_path": "test/integration/__snapshots__/lerna-clean.test.js.snap"
},
{
"change_type": "MODIFY",
"diff": "const execa = require(\"execa\");\nconst fs = require(\"fs-extra\");\n-// const getPort = require(\"get-port\");\nconst globby = require(\"globby\");\nconst normalizePath = require(\"normalize-path\");\nconst path = require(\"path\");\n@@ -92,34 +91,4 @@ describe(\"lerna bootstrap\", () => {\nexpect(npmDebugLog).toMatchSnapshot();\n});\n});\n-\n- describe(\"from npm script\", () => {\n- test(\"bootstraps all packages\", async () => {\n- const cwd = await initFixture(\"BootstrapCommand/integration-lifecycle\");\n- await execa(\"npm\", [\"install\", \"--cache-min=99999\"], { cwd });\n-\n- const { stdout, stderr } = await npmTest(cwd);\n- expect(stdout).toMatchSnapshot(\"stdout\");\n- expect(stderr).toMatchSnapshot(\"stderr\");\n- });\n-\n- /*\n- test(\"works with yarn install\", async () => {\n- const cwd = await initFixture(\"BootstrapCommand/integration-lifecycle\");\n-\n- const port = await getPort({ port: 42042, host: \"0.0.0.0\" });\n- const mutex = [\"--mutex\", `network:${port}`];\n-\n- // NOTE: yarn doesn't support linking binaries from transitive dependencies,\n- // so it's important to test _both_ lifecycle variants.\n- // TODO: ...eventually :P\n- // FIXME: yarn doesn't understand file:// URLs... /sigh\n- await execa(\"yarn\", [\"install\", \"--no-lockfile\", ...mutex], { cwd });\n-\n- const { stdout, stderr } = await execa(\"yarn\", [\"test\", \"--silent\", ...mutex], { cwd });\n- expect(stdout).toMatchSnapshot(\"stdout\");\n- expect(stderr).toMatchSnapshot(\"stderr\");\n- });\n- */\n- });\n});\n",
"new_path": "test/integration/lerna-bootstrap.test.js",
"old_path": "test/integration/lerna-bootstrap.test.js"
},
{
"change_type": "MODIFY",
"diff": "\"use strict\";\nconst execa = require(\"execa\");\n-// const getPort = require(\"get-port\");\nconst globby = require(\"globby\");\nconst normalizePath = require(\"normalize-path\");\nconst path = require(\"path\");\n@@ -30,35 +29,4 @@ describe(\"lerna clean\", () => {\nconst found = await globby([\"package-*/node_modules\"], { cwd });\nexpect(found).toEqual([]);\n});\n-\n- test(\"local npm\", async () => {\n- const cwd = await initFixture(\"CleanCommand/integration\");\n-\n- await execa(\"npm\", [\"install\", \"--cache-min=99999\"], { cwd });\n-\n- const { stderr } = await execa(\"npm\", [\"run\", \"clean\", \"--silent\"], { cwd });\n-\n- expect(normalizeLog(cwd)(stderr)).toMatchSnapshot(\"stderr\");\n-\n- const found = await globby([\"package-*/node_modules\"], { cwd });\n- expect(found).toEqual([]);\n- });\n-\n- /*\n- test(\"local yarn\", async () => {\n- const cwd = await initFixture(\"CleanCommand/integration\");\n-\n- const port = await getPort({ port: 42042, host: \"0.0.0.0\" });\n- const mutex = [\"--mutex\", `network:${port}`];\n-\n- await execa(\"yarn\", [\"install\", \"--no-lockfile\", ...mutex], { cwd });\n-\n- const { stderr } = await execa(\"yarn\", [\"clean\", \"--silent\", ...mutex], { cwd });\n-\n- expect(normalizeLog(cwd)(stderr)).toMatchSnapshot(\"stderr\");\n-\n- const found = await globby([\"node_modules\"], { cwd });\n- expect(found).toEqual([]);\n- });\n- */\n});\n",
"new_path": "test/integration/lerna-clean.test.js",
"old_path": "test/integration/lerna-clean.test.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
test(integration): remove redundant, slow tests
| 1
|
test
|
integration
|
807,849
|
23.01.2018 18:26:07
| 28,800
|
2c91fbe755bfae9c749f876ae4116e6df7016997
|
test(publish): don't call command handler directly in --yes test
|
[
{
"change_type": "MODIFY",
"diff": "@@ -437,25 +437,13 @@ describe(\"PublishCommand\", () => {\n* ======================================================================= */\ndescribe(\"with --yes\", () => {\n- it(\"skips confirmation prompt\", done => {\n- const publishCommand = commandModule.handler({\n- _: [],\n- yes: true,\n- });\n- publishCommand.updates = [];\n- publishCommand.confirmVersions(err => {\n- if (err) {\n- return done.fail(err);\n- }\n+ it(\"skips confirmation prompt\", async () => {\n+ const testDir = await initFixture(\"PublishCommand/normal\");\n+ await run(testDir)(\"--yes\", \"--repo-version\", \"1.0.1-auto-confirm\");\n- try {\n+ expect(PromptUtilities.select).not.toBeCalled();\nexpect(PromptUtilities.confirm).not.toBeCalled();\n-\n- done();\n- } catch (ex) {\n- done.fail(ex);\n- }\n- });\n+ expect(updatedLernaJson()).toMatchObject({ version: \"1.0.1-auto-confirm\" });\n});\n});\n",
"new_path": "test/PublishCommand.js",
"old_path": "test/PublishCommand.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
test(publish): don't call command handler directly in --yes test
| 1
|
test
|
publish
|
807,849
|
23.01.2018 18:31:33
| 28,800
|
bfac1370c47fb9ffcca29284b5a1e78bf8c47e20
|
test(add): more idiomatic try/catch for error cases
|
[
{
"change_type": "MODIFY",
"diff": "@@ -29,16 +29,6 @@ log.level = \"silent\";\nconst readPkg = (testDir, pkg) => fs.readJsonSync(path.join(testDir, pkg, \"package.json\"));\n-const expectError = async fn => {\n- try {\n- await fn();\n- throw new Error(`Expected ${fn.toString()} to fail.`);\n- } catch (err) {\n- const assert = expect(err.message);\n- return assert;\n- }\n-};\n-\ndescribe(\"AddCommand\", () => {\nbeforeEach(() => {\n// we stub installInDir() in most tests because\n@@ -58,13 +48,23 @@ describe(\"AddCommand\", () => {\nit(\"should throw without packages\", async () => {\nconst testDir = await initFixture(\"AddCommand/basic\");\nconst lernaAdd = run(testDir);\n- (await expectError(() => lernaAdd())).toMatch(/^Missing list of packages/);\n+ try {\n+ await lernaAdd();\n+ } catch (err) {\n+ expect(err.message).toMatch(/^Missing list of packages/);\n+ }\n+ expect.assertions(1);\n});\nit(\"should throw for locally unsatisfiable version ranges\", async () => {\nconst testDir = await initFixture(\"AddCommand/basic\");\nconst lernaAdd = run(testDir);\n- (await expectError(() => lernaAdd(\"@test/package-1@2\"))).toMatch(/Requested range not satisfiable:/);\n+ try {\n+ await lernaAdd(\"@test/package-1@2\");\n+ } catch (err) {\n+ expect(err.message).toMatch(/Requested range not satisfiable:/);\n+ }\n+ expect.assertions(1);\n});\nit(\"should reference remote dependencies\", async () => {\n",
"new_path": "test/AddCommand.js",
"old_path": "test/AddCommand.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
test(add): more idiomatic try/catch for error cases
| 1
|
test
|
add
|
807,849
|
24.01.2018 16:27:35
| 28,800
|
8dc332eeb46c2568610c246b09fcb88b2c7f26c5
|
chore: workaround npm/npm#16862 in CI
|
[
{
"change_type": "MODIFY",
"diff": "@@ -22,6 +22,7 @@ cache:\n- node_modules\nbefore_install:\n+ - npm config set loglevel warn\n- npm i -g npm@latest-5\ninstall: yarn --frozen-lockfile\n",
"new_path": ".travis.yml",
"old_path": ".travis.yml"
},
{
"change_type": "MODIFY",
"diff": "@@ -19,6 +19,7 @@ cache:\ninstall:\n- ps: Install-Product node $env:nodejs_version\n+ - npm config set loglevel warn\n- npm -g install npm@latest-5\n- yarn --frozen-lockfile\n",
"new_path": "appveyor.yml",
"old_path": "appveyor.yml"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
chore: workaround npm/npm#16862 in CI
| 1
|
chore
| null |
135,543
|
24.01.2018 16:27:39
| 18,000
|
3d47a91938d8bb159f607b85819217e40d0790be
|
docs: use absolute URLs in CONTRIBUTING.md
When clicking the original links on GitHub, I am taken to a 404 page. By using absolute GitHub URLs, clicking Happiness and conventional-changelog will navigate to the expected webpages.
|
[
{
"change_type": "MODIFY",
"diff": "@@ -40,7 +40,7 @@ To keep the code base of commitlint neat and tidy the following rules apply to e\n> Coding standards\n-* [Happiness](/sindresorhus/xo) enforced\n+* [Happiness](https://github.com/sindresorhus/xo) enforced\n* Favor micro library over swiss army knives (rimraf, ncp vs. fs-extra)\n* Be awesome\n@@ -50,7 +50,7 @@ To make your life easier commitlint is commitizen-friendly and provides the npm\n> Commit standards\n-* [conventional-changelog](./@commitlint/prompt)\n+* [conventional-changelog](https://github.com/marionebl/commitlint/tree/master/%40commitlint/prompt)\n* husky commit message hook available\n* present tense\n* maximum of 100 characters\n",
"new_path": ".github/CONTRIBUTING.md",
"old_path": ".github/CONTRIBUTING.md"
}
] |
TypeScript
|
MIT License
|
conventional-changelog/commitlint
|
docs: use absolute URLs in CONTRIBUTING.md
When clicking the original links on GitHub, I am taken to a 404 page. By using absolute GitHub URLs, clicking Happiness and conventional-changelog will navigate to the expected webpages.
| 1
|
docs
| null |
791,690
|
24.01.2018 17:56:35
| -39,600
|
bd499b3b597b90dcf773ba7b1dd28314bf531da7
|
core(unminified-js): add tolerant option to esprima
|
[
{
"change_type": "MODIFY",
"diff": "@@ -44,7 +44,11 @@ class UnminifiedJavaScript extends ByteEfficiencyAudit {\nconst contentLength = scriptContent.length;\nlet totalTokenLength = 0;\n- const tokens = esprima.tokenize(scriptContent);\n+ const tokens = esprima.tokenize(scriptContent, {tolerant: true});\n+ if (!tokens.length && tokens.errors && tokens.errors.length) {\n+ throw tokens.errors[0];\n+ }\n+\nfor (const token of tokens) {\ntotalTokenLength += token.value.length;\n}\n@@ -68,22 +72,27 @@ class UnminifiedJavaScript extends ByteEfficiencyAudit {\n*/\nstatic audit_(artifacts, networkRecords) {\nconst results = [];\n+ let debugString;\nfor (const requestId of Object.keys(artifacts.Scripts)) {\nconst scriptContent = artifacts.Scripts[requestId];\nconst networkRecord = networkRecords.find(record => record.requestId === requestId);\nif (!networkRecord || !scriptContent) continue;\n+ try {\nconst result = UnminifiedJavaScript.computeWaste(scriptContent, networkRecord);\n-\n// If the ratio is minimal, the file is likely already minified, so ignore it.\n// If the total number of bytes to be saved is quite small, it's also safe to ignore.\nif (result.wastedPercent < IGNORE_THRESHOLD_IN_PERCENT ||\nresult.wastedBytes < IGNORE_THRESHOLD_IN_BYTES) continue;\nresults.push(result);\n+ } catch (err) {\n+ debugString = `Unable to process ${networkRecord._url}: ${err.message}`;\n+ }\n}\nreturn {\nresults,\n+ debugString,\nheadings: [\n{key: 'url', itemType: 'url', text: 'URL'},\n{key: 'totalKb', itemType: 'text', text: 'Original'},\n",
"new_path": "lighthouse-core/audits/byte-efficiency/unminified-javascript.js",
"old_path": "lighthouse-core/audits/byte-efficiency/unminified-javascript.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -37,19 +37,32 @@ describe('Page uses optimized responses', () => {\nconsole.log('yay esnext!')\n}\n`,\n+ '123.3':\n+ /* eslint-disable no-useless-escape */\n+ `\n+ const foo = 1\n+ /Edge\\/\\d*\\.\\d*/.exec('foo')\n+ `,\n+ '123.4': '#$*% non sense',\n},\n}, [\n{requestId: '123.1', url: 'foo.js', _transferSize: 20 * KB, _resourceType},\n{requestId: '123.2', url: 'other.js', _transferSize: 50 * KB, _resourceType},\n+ {requestId: '123.3', url: 'valid-ish.js', _transferSize: 100 * KB, _resourceType},\n+ {requestId: '123.4', url: 'invalid.js', _transferSize: 100 * KB, _resourceType},\n]);\n- assert.equal(auditResult.results.length, 2);\n+ assert.ok(auditResult.debugString);\n+ assert.equal(auditResult.results.length, 3);\nassert.equal(auditResult.results[0].url, 'foo.js');\nassert.equal(Math.round(auditResult.results[0].wastedPercent), 57);\nassert.equal(Math.round(auditResult.results[0].wastedBytes / 1024), 11);\nassert.equal(auditResult.results[1].url, 'other.js');\nassert.equal(Math.round(auditResult.results[1].wastedPercent), 53);\nassert.equal(Math.round(auditResult.results[1].wastedBytes / 1024), 27);\n+ assert.equal(auditResult.results[2].url, 'valid-ish.js');\n+ assert.equal(Math.round(auditResult.results[2].wastedPercent), 72);\n+ assert.equal(Math.round(auditResult.results[2].wastedBytes / 1024), 72);\n});\nit('passes when scripts are already minified', () => {\n",
"new_path": "lighthouse-core/test/audits/byte-efficiency/unminified-javascript-test.js",
"old_path": "lighthouse-core/test/audits/byte-efficiency/unminified-javascript-test.js"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
core(unminified-js): add tolerant option to esprima (#4338)
| 1
|
core
|
unminified-js
|
815,754
|
25.01.2018 08:30:17
| -3,600
|
cd3dec1b1af5420e7dbd0e70dc8b45da174a5b6a
|
feat: using a getter/setter for isLoading which enables exposing the same and having a change emitter
closes
|
[
{
"change_type": "MODIFY",
"diff": "@@ -123,6 +123,7 @@ map: {\n| [disableVirtualScroll] | boolean | false | no | Disable virtual scroll |\n| dropdownPosition | `bottom`,`top` | `bottom` | no | Set the dropdown position on open |\n| appendTo | string | null | no | Append drodown to body or any other element using css selector |\n+| loading | boolean | `-` | no | you can set the loading state from the outside (e.g. async items loading) |\n| Output | Description |\n| ------------- | ------------- |\n@@ -134,6 +135,7 @@ map: {\n| (clear) | Fired on clear icon click |\n| (add) | Fired when item is selected |\n| (remove) | Fired when item is removed |\n+| (loading) | Fired when loading state changes |\n## Change Detection\nNg-select component implements `OnPush` change detection which means the dirty checking checks for immutable\n",
"new_path": "README.md",
"old_path": "README.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -1015,10 +1015,10 @@ describe('NgSelectComponent', function () {\nit('should start and stop loading indicator', fakeAsync(() => {\nfixture.componentInstance.customFilter.subscribe();\nfixture.componentInstance.select.onFilter('buk');\n- expect(fixture.componentInstance.select.isLoading).toBeTruthy();\n+ expect(fixture.componentInstance.select.loading).toBeTruthy();\nfixture.componentInstance.cities = [{ id: 4, name: 'Bukiskes' }];\ntickAndDetectChanges(fixture);\n- expect(fixture.componentInstance.select.isLoading).toBeFalsy();\n+ expect(fixture.componentInstance.select.loading).toBeFalsy();\n}));\n});\n});\n",
"new_path": "src/ng-select/ng-select.component.spec.ts",
"old_path": "src/ng-select/ng-select.component.spec.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -113,6 +113,15 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, AfterVie\nget single() {\nreturn !this.multiple;\n}\n+ @Output('loadingChange') loadingChange = new EventEmitter<Boolean>();\n+ get loading(): boolean {\n+ return this.isLoading;\n+ }\n+ @Input()\n+ set loading(value: boolean) {\n+ this.isLoading = value;\n+ this.loadingChange.next(value);\n+ }\n@HostBinding('class.opened') isOpen = false;\n@HostBinding('class.focused') isFocused = false;\n@@ -352,7 +361,7 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, AfterVie\nreturn this.addTag &&\nthis.filterValue &&\n!this.itemsList.filteredItems.some(x => x.label.toLowerCase() === this.filterValue.toLowerCase()) &&\n- !this.isLoading;\n+ !this.loading;\n}\nshowFilter() {\n@@ -362,12 +371,12 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, AfterVie\nshowNoItemsFound() {\nconst empty = this.itemsList.filteredItems.length === 0;\nreturn (empty && !this.isTypeahead) ||\n- (empty && this.isTypeahead && this.filterValue && !this.isLoading);\n+ (empty && this.isTypeahead && this.filterValue && !this.loading);\n}\nshowTypeToSearch() {\nconst empty = this.itemsList.filteredItems.length === 0;\n- return empty && this.isTypeahead && !this.filterValue && !this.isLoading;\n+ return empty && this.isTypeahead && !this.filterValue && !this.loading;\n}\nonFilter(term: string) {\n@@ -378,7 +387,7 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, AfterVie\nthis.filterValue = term;\nif (this.isTypeahead) {\n- this.isLoading = true;\n+ this.loading = true;\nthis.typeahead.next(this.filterValue);\n} else {\nthis.itemsList.filter(this.filterValue);\n@@ -423,7 +432,7 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, AfterVie\n}\nif (this.isTypeahead) {\n- this.isLoading = false;\n+ this.loading = false;\n// TODO: this probably will not be needed when ngModel won't be added to items array\nif (this.filterValue) {\nthis.itemsList.filter(this.filterValue);\n",
"new_path": "src/ng-select/ng-select.component.ts",
"old_path": "src/ng-select/ng-select.component.ts"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
feat: using a getter/setter for isLoading which enables exposing the same and having a change emitter (#206)
closes #205
| 1
|
feat
| null |
791,940
|
25.01.2018 18:01:19
| 28,800
|
c225d0189f4ffc945168aff31523a20e7c6342ab
|
misc(package): Add mixed-content yarn script
|
[
{
"change_type": "MODIFY",
"diff": "\"bundlesize\": \"bundlesize\",\n\"plots-smoke\": \"bash plots/test/smoke.sh\",\n\"changelog\": \"conventional-changelog --config ./build/changelog-generator/index.js --infile changelog.md --same-file\",\n- \"type-check\": \"tsc -p .\"\n+ \"type-check\": \"tsc -p .\",\n+ \"mixed-content\": \"./lighthouse-cli/index.js --chrome-flags='--headless' --config-path=./lighthouse-core/config/mixed-content.js\"\n},\n\"devDependencies\": {\n\"@types/configstore\": \"^2.1.1\",\n",
"new_path": "package.json",
"old_path": "package.json"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
misc(package): Add mixed-content yarn script (#4344)
| 1
|
misc
|
package
|
679,913
|
28.01.2018 16:27:06
| 0
|
a6e49b3457b9f4ef748ef866c4e90b3bb30e3f08
|
build(all): fix depgraph command in main package
|
[
{
"change_type": "MODIFY",
"diff": "\"lerna\": \"^2.8.0\"\n},\n\"scripts\": {\n- \"depgraph\": \"scripts/depgraph && git add assets/deps.png && git commit -m 'update dep graph` && git push\"\n+ \"depgraph\": \"scripts/depgraph && git add assets/deps.png && git commit -m 'update dep graph' && git push\"\n}\n}\n\\ No newline at end of file\n",
"new_path": "package.json",
"old_path": "package.json"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
build(all): fix depgraph command in main package
| 1
|
build
|
all
|
679,913
|
28.01.2018 16:27:41
| 0
|
f83bd18e736b53a0706d19d728a6a7893cd765c1
|
docs(rstream-csp): fix readme example
|
[
{
"change_type": "MODIFY",
"diff": "@@ -19,6 +19,7 @@ yarn add @thi.ng/rstream-csp\n```typescript\nimport * as rs from \"@thi.ng/rstream\";\n+import * as tx from \"@thi.ng/transducers\";\nimport { fromChannel } from \"@thi.ng/rstream-csp\";\nimport { Channel } from \"@thi.ng/csp\";\n",
"new_path": "packages/rstream-csp/README.md",
"old_path": "packages/rstream-csp/README.md"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs(rstream-csp): fix readme example
| 1
|
docs
|
rstream-csp
|
679,913
|
28.01.2018 18:22:28
| 0
|
ababaa1cef6799e08ed6b28a908362844943fd9b
|
docs(all): update readme
|
[
{
"change_type": "MODIFY",
"diff": "@@ -4,21 +4,21 @@ Mono-repository for thi.ng TypeScript/ES6 projects.\n## Projects\n-| Projects | Version |\n-|----|----|\n-| [`@thi.ng/api`](./packages/api) | [](https://www.npmjs.com/package/@thi.ng/api) |\n-| [`@thi.ng/bitstream`](./packages/bitstream) | [](https://www.npmjs.com/package/@thi.ng/bitstream) |\n-| [`@thi.ng/checks`](./packages/checks) | [](https://www.npmjs.com/package/@thi.ng/checks) |\n-| [`@thi.ng/csp`](./packages/csp) | [](https://www.npmjs.com/package/@thi.ng/csp) |\n-| [`@thi.ng/dcons`](./packages/dcons) | [](https://www.npmjs.com/package/@thi.ng/dcons) |\n-| [`@thi.ng/hiccup`](./packages/hiccup) | [](https://www.npmjs.com/package/@thi.ng/hiccup) |\n-| [`@thi.ng/iterators`](./packages/iterators) | [](https://www.npmjs.com/package/@thi.ng/iterators) |\n-| [`@thi.ng/rle-pack`](./packages/rle-pack) | [](https://www.npmjs.com/package/@thi.ng/rle-pack) |\n-| [`@thi.ng/rstream`](./packages/rstream) | [](https://www.npmjs.com/package/@thi.ng/rstream) |\n-| [`@thi.ng/rstream-csp`](./packages/rstream-csp) | [](https://www.npmjs.com/package/@thi.ng/rstream-csp) |\n-| [`@thi.ng/rstream-log`](./packages/rstream-log) | [](https://www.npmjs.com/package/@thi.ng/rstream-log) |\n-| [`@thi.ng/transducers`](./packages/transducers) | [](https://www.npmjs.com/package/@thi.ng/transducers) |\n-| [`@thi.ng/unionstruct`](./packages/unionstruct) | [](https://www.npmjs.com/package/@thi.ng/unionstruct) |\n+| Projects | Version | |\n+|----|----|----|\n+| [`@thi.ng/api`](./packages/api) | [](https://www.npmjs.com/package/@thi.ng/api) | [changelog](./packages/api/CHANGELOG.md) |\n+| [`@thi.ng/bitstream`](./packages/bitstream) | [](https://www.npmjs.com/package/@thi.ng/bitstream) | [changelog](./packages/bitstream/CHANGELOG.md) |\n+| [`@thi.ng/checks`](./packages/checks) | [](https://www.npmjs.com/package/@thi.ng/checks) | [changelog](./packages/checks/CHANGELOG.md) |\n+| [`@thi.ng/csp`](./packages/csp) | [](https://www.npmjs.com/package/@thi.ng/csp) | [changelog](./packages/csp/CHANGELOG.md) |\n+| [`@thi.ng/dcons`](./packages/dcons) | [](https://www.npmjs.com/package/@thi.ng/dcons) | [changelog](./packages/dcons/CHANGELOG.md) |\n+| [`@thi.ng/hiccup`](./packages/hiccup) | [](https://www.npmjs.com/package/@thi.ng/hiccup) | [changelog](./packages/hiccup/CHANGELOG.md) |\n+| [`@thi.ng/iterators`](./packages/iterators) | [](https://www.npmjs.com/package/@thi.ng/iterators) | [changelog](./packages/iterators/CHANGELOG.md) |\n+| [`@thi.ng/rle-pack`](./packages/rle-pack) | [](https://www.npmjs.com/package/@thi.ng/rle-pack) | [changelog](./packages/rle-pack/CHANGELOG.md) |\n+| [`@thi.ng/rstream`](./packages/rstream) | [](https://www.npmjs.com/package/@thi.ng/rstream) | [changelog](./packages/rstream/CHANGELOG.md) |\n+| [`@thi.ng/rstream-csp`](./packages/rstream-csp) | [](https://www.npmjs.com/package/@thi.ng/rstream-csp) | [changelog](./packages/rstream-csp/CHANGELOG.md) |\n+| [`@thi.ng/rstream-log`](./packages/rstream-log) | [](https://www.npmjs.com/package/@thi.ng/rstream-log) | [changelog](./packages/rstream-log/CHANGELOG.md) |\n+| [`@thi.ng/transducers`](./packages/transducers) | [](https://www.npmjs.com/package/@thi.ng/transducers) | [changelog](./packages/transducers/CHANGELOG.md) |\n+| [`@thi.ng/unionstruct`](./packages/unionstruct) | [](https://www.npmjs.com/package/@thi.ng/unionstruct) | [changelog](./packages/unionstruct/CHANGELOG.md) |\n## Dependency graph\n@@ -36,6 +36,8 @@ lerna exec yarn build --sort\n### Testing\n+(not all packages have tests yet)\n+\n```\nlerna exec yarn test\n# or individually\n",
"new_path": "README.md",
"old_path": "README.md"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs(all): update readme
| 1
|
docs
|
all
|
679,913
|
28.01.2018 21:10:33
| 0
|
2247f72f0db3f26ca1c80e2695f8b4f7fca9277c
|
feat(rstream): add trace() error handler
|
[
{
"change_type": "MODIFY",
"diff": "@@ -7,6 +7,9 @@ export function trace(prefix?: any): ISubscriber<any> {\n},\ndone() {\nprefix ? console.log(prefix, \"done\") : console.log(\"done\");\n+ },\n+ error(e) {\n+ prefix ? console.log(prefix, \"error\", e) : console.log(\"error\", e);\n}\n}\n}\n",
"new_path": "packages/rstream/src/subs/trace.ts",
"old_path": "packages/rstream/src/subs/trace.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(rstream): add trace() error handler
| 1
|
feat
|
rstream
|
679,913
|
28.01.2018 21:11:35
| 0
|
55ba0e1342970720731f3bebf20db2600386fcb2
|
feat(rstream): add fromPromises(), add docs
|
[
{
"change_type": "MODIFY",
"diff": "import { State } from \"../api\";\nimport { Stream } from \"../stream\";\n+/**\n+ * Yields a single-value stream of the resolved promise and then\n+ * automatically marks itself done. It doesn't matter if the promise\n+ * resolves before the first subscriber has attached.\n+ *\n+ * @param src\n+ */\nexport function fromPromise<T>(src: Promise<T>) {\nlet canceled = false;\nreturn new Stream<T>((stream) => {\n",
"new_path": "packages/rstream/src/from/promise.ts",
"old_path": "packages/rstream/src/from/promise.ts"
},
{
"change_type": "ADD",
"diff": "+import { mapcat } from \"@thi.ng/transducers/xform/mapcat\";\n+\n+import { Subscription } from \"../subscription\";\n+import { fromPromise } from \"./promise\";\n+\n+/**\n+ * Wraps given promises in `Promise.all()` to yield stream of results in\n+ * same order as arguments, then closes. If any of the promises rejects,\n+ * all others do too and calls `error()` in subscribers.\n+ *\n+ * ```\n+ * rs.fromPromises([\n+ * Promise.resolve(1),\n+ * Promise.resolve(2),\n+ * Promise.resolve(3)\n+ * ]).subscribe(rs.trace())\n+ * // 1\n+ * // 2\n+ * // 3\n+ * // done\n+ * ```\n+ *\n+ * If individual error handling is required, an alternative is below\n+ * (however this approach provides no ordering guarantees):\n+ *\n+ * ```\n+ * rs.fromIterable([\n+ * Promise.resolve(1),\n+ * new Promise(()=> { setTimeout(()=> { throw new Error(\"eeek\"); }, 10); }),\n+ * Promise.resolve(3)\n+ * ]).subscribe(rs.resolve()).subscribe(rs.trace())\n+ * ```\n+ *\n+ * @param promises\n+ */\n+export function fromPromises<T>(promises: Iterable<Promise<T>>): Subscription<T[], T> {\n+ return fromPromise(Promise.all(promises)).subscribe(mapcat((x: T[]) => x));\n+}\n",
"new_path": "packages/rstream/src/from/promises.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -7,6 +7,7 @@ export * from \"./from/event\";\nexport * from \"./from/interval\";\nexport * from \"./from/iterable\";\nexport * from \"./from/promise\";\n+export * from \"./from/promises\";\nexport * from \"./from/raf\";\nexport * from \"./from/worker\";\n",
"new_path": "packages/rstream/src/index.ts",
"old_path": "packages/rstream/src/index.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(rstream): add fromPromises(), add docs
| 1
|
feat
|
rstream
|
679,913
|
28.01.2018 23:32:17
| 0
|
bddd5ce73850a7fbd2f705a37a1f88f295ea34f3
|
feat(api): update IWatch & mixin, boolean returns
|
[
{
"change_type": "MODIFY",
"diff": "@@ -289,7 +289,7 @@ export interface IStack<V, T> {\nexport type Watch<T> = (id: string, oldState: T, newState: T) => void;\nexport interface IWatch<T> {\n- addWatch(id: string, fn: Watch<T>);\n- removeWatch(id: string);\n+ addWatch(id: string, fn: Watch<T>): boolean;\n+ removeWatch(id: string): boolean;\nnotifyWatches(oldState: T, newState: T);\n}\n",
"new_path": "packages/api/src/api.ts",
"old_path": "packages/api/src/api.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -4,11 +4,19 @@ import { mixin } from \"../mixin\";\nexport const IWatch = mixin({\naddWatch(id: string, fn: (id: string, oldState: any, newState: any) => void) {\nthis._watches = this._watches || {};\n+ if (this._watches[id]) {\n+ return false;\n+ }\nthis._watches[id] = fn;\n+ return true;\n},\nremoveWatch(id: string) {\nthis._watches = this._watches || {};\n+ if (this._watches[id]) {\ndelete this._watches[id];\n+ return true;\n+ }\n+ return false;\n},\nnotifyWatches(oldState: any, newState: any) {\nconst w = (this._watches = this._watches || {}),\n",
"new_path": "packages/api/src/mixins/iwatch.ts",
"old_path": "packages/api/src/mixins/iwatch.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(api): update IWatch & mixin, boolean returns
| 1
|
feat
|
api
|
679,913
|
28.01.2018 23:36:06
| 0
|
fefc283533ceb2a60343fa914dc1086b8d2f2a42
|
feat(atom): re-import atom package from MBP2010, update main readme
|
[
{
"change_type": "MODIFY",
"diff": "@@ -7,6 +7,7 @@ Mono-repository for thi.ng TypeScript/ES6 projects.\n| Projects | Version | |\n|----|----|----|\n| [`@thi.ng/api`](./packages/api) | [](https://www.npmjs.com/package/@thi.ng/api) | [changelog](./packages/api/CHANGELOG.md) |\n+| [`@thi.ng/atom`](./packages/atom) | [](https://www.npmjs.com/package/@thi.ng/atom) | [changelog](./packages/atom/CHANGELOG.md) |\n| [`@thi.ng/bitstream`](./packages/bitstream) | [](https://www.npmjs.com/package/@thi.ng/bitstream) | [changelog](./packages/bitstream/CHANGELOG.md) |\n| [`@thi.ng/checks`](./packages/checks) | [](https://www.npmjs.com/package/@thi.ng/checks) | [changelog](./packages/checks/CHANGELOG.md) |\n| [`@thi.ng/csp`](./packages/csp) | [](https://www.npmjs.com/package/@thi.ng/csp) | [changelog](./packages/csp/CHANGELOG.md) |\n",
"new_path": "README.md",
"old_path": "README.md"
},
{
"change_type": "ADD",
"diff": "+/bench\n+/build\n+/dev\n+/doc\n+/node_modules\n+.DS_Store\n+/bundle.*\n+*.log\n+*.tgz\n+*.js\n+*.d.ts\n",
"new_path": "packages/atom/.gitignore",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+bench/*\n+build/*\n+dev/*\n+node_modules\n+src*\n+test*\n+bundle.*\n+tsconfig.json\n+webpack.config.js\n+*.html\n+*.tgz\n+!doc/*\n+!*.d.ts\n+!*.js\n",
"new_path": "packages/atom/.npmignore",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+# @thi.ng/atom\n+\n+[](https://www.npmjs.com/package/@thi.ng/atom)\n+\n+## About\n+\n+Clojure inspired mutable wrapper for (usually) immutable values, with support for watches.\n+\n+## Installation\n+\n+```\n+yarn add @thi.ng/atom\n+```\n+\n+## Usage examples\n+\n+```typescript\n+import { Atom } from \"@thi.ng/atom\";\n+\n+const a = new Atom(23);\n+\n+// obtain value via deref()\n+a.deref();\n+// 23\n+\n+// add watch to observe value changes\n+a.addWatch(\"foo\", (id, prev, curr) => console.log(`${id}: ${prev} -> ${curr}`));\n+// true\n+\n+a.swap((val)=> val + 1);\n+// foo: 23 -> 24\n+\n+a.reset(42);\n+// foo: 24 -> 42\n+```\n+\n+## Authors\n+\n+- Karsten Schmidt\n+\n+## License\n+\n+© 2018 Karsten Schmidt // Apache Software License 2.0\n",
"new_path": "packages/atom/README.md",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"@thi.ng/atom\",\n+ \"version\": \"0.0.1\",\n+ \"description\": \"Mutable wrapper for a immutable values\",\n+ \"main\": \"./index.js\",\n+ \"typings\": \"./index.d.ts\",\n+ \"repository\": \"https://github.com/thi-ng/umbrella\",\n+ \"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n+ \"license\": \"Apache-2.0\",\n+ \"scripts\": {\n+ \"build\": \"yarn run clean && tsc --declaration\",\n+ \"test\": \"yarn run clean && tsc -p test && mocha build/test/*.js\",\n+ \"clean\": \"rm -rf *.js *.d.ts build doc\",\n+ \"pub\": \"yarn run build && yarn publish --access public\"\n+ },\n+ \"devDependencies\": {\n+ \"@types/mocha\": \"^2.2.46\",\n+ \"@types/node\": \"^9.3.0\",\n+ \"mocha\": \"^5.0.0\",\n+ \"ts-loader\": \"^3.3.1\",\n+ \"typedoc\": \"^0.9.0\",\n+ \"typescript\": \"^2.6.2\",\n+ \"webpack\": \"^3.10.0\"\n+ },\n+ \"dependencies\": {\n+ \"@thi.ng/api\": \"^1.3.0\"\n+ },\n+ \"keywords\": [\n+ \"ES6\",\n+ \"typescript\"\n+ ],\n+ \"publishConfig\": {\n+ \"access\": \"public\"\n+ }\n+}\n\\ No newline at end of file\n",
"new_path": "packages/atom/package.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import * as api from \"@thi.ng/api/api\";\n+import { IWatch } from \"@thi.ng/api/mixins/iwatch\";\n+\n+/**\n+ * Mutable wrapper for an (usually) immutable value.\n+ * Support for watches.\n+ */\n+@IWatch\n+export class Atom<T> implements\n+ api.IDeref<T>,\n+ api.IEquiv,\n+ api.IWatch<T> {\n+\n+ protected value: T;\n+\n+ constructor(val?: T) {\n+ this.value = val;\n+ }\n+\n+ public deref() {\n+ return this.value;\n+ }\n+\n+ public equiv(o: any) {\n+ return this === o;\n+ }\n+\n+ public reset(val: T) {\n+ const old = this.value;\n+ this.value = val;\n+ this.notifyWatches(old, val);\n+ return this.value;\n+ }\n+\n+ public swap(fn: (curr: T, ...args: any[]) => T, ...args: any[]) {\n+ const old = this.value;\n+ args.unshift(old);\n+ this.value = fn.apply(null, args);\n+ this.notifyWatches(old, this.value);\n+ return this.value;\n+ }\n+\n+ // mixin stub\n+ public addWatch(id: string, fn: (id: string, oldState: T, newState: T) => void) {\n+ return false;\n+ }\n+\n+ // mixin stub\n+ public removeWatch(id: string) {\n+ return false;\n+ }\n+\n+ // mixin stub\n+ public notifyWatches(oldState: T, newState: T) { }\n+}\n",
"new_path": "packages/atom/src/index.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import * as assert from \"assert\";\n+import { Atom } from \"../src/index\";\n+\n+describe(\"atom\", function () {\n+\n+ let a: Atom<any>;\n+\n+ beforeEach(() => {\n+ a = new Atom(23);\n+ });\n+\n+ it(\"can be deref'd\", () => {\n+ assert.equal(a.deref(), 23);\n+ });\n+\n+ it(\"can be reset\", () => {\n+ assert.equal(a.reset(24), 24);\n+ assert.equal(a.deref(), 24);\n+ });\n+\n+ it(\"can be swapped\", () => {\n+ assert.equal(a.swap((x) => x + 1), 24);\n+ assert.equal(a.deref(), 24);\n+ });\n+\n+ it(\"can add & remove watch\", () => {\n+ assert(a.addWatch(\"foo\", () => { }), \"can't add watch\");\n+ assert((<any>a)._watches && (<any>a)._watches.foo, \"watch missing\");\n+ assert(a.removeWatch(\"foo\"), \"can't remove watch\");\n+ assert(!a.removeWatch(\"foo\"), \"should fail to remove invalid watch id\");\n+ });\n+\n+ it(\"can be watched\", () => {\n+ a.addWatch(\"foo\", (id, prev, curr) => {\n+ assert.equal(id, \"foo\", \"wrong id\");\n+ assert.equal(prev, 23, \"wrong prev\");\n+ assert.equal(curr, 24, \"wrong curr\");\n+ });\n+ a.swap((x) => x + 1);\n+ });\n+\n+});\n",
"new_path": "packages/atom/test/index.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"extends\": \"../../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \"../build\",\n+ \"noUnusedParameters\": false\n+ },\n+ \"include\": [\n+ \"./**/*.ts\",\n+ \"../src/**/*.ts\"\n+ ]\n+}\n\\ No newline at end of file\n",
"new_path": "packages/atom/test/tsconfig.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"extends\": \"../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \".\",\n+ \"noUnusedParameters\": false,\n+ },\n+ \"include\": [\n+ \"./src/**/*.ts\",\n+ ]\n+}\n\\ No newline at end of file\n",
"new_path": "packages/atom/tsconfig.json",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(atom): re-import atom package from MBP2010, update main readme
| 1
|
feat
|
atom
|
679,913
|
28.01.2018 23:36:56
| 0
|
52c25a8405685f9a4ec8f74971bc4361240ffaf4
|
build(all): add tslint workspace dev dependency
|
[
{
"change_type": "MODIFY",
"diff": "\"packages/*\"\n],\n\"devDependencies\": {\n- \"lerna\": \"^2.8.0\"\n+ \"lerna\": \"^2.8.0\",\n+ \"tslint\": \"^5.9.1\"\n},\n\"scripts\": {\n\"depgraph\": \"scripts/depgraph && git add assets/deps.png && git commit -m 'update dep graph' && git push\"\n",
"new_path": "package.json",
"old_path": "package.json"
},
{
"change_type": "MODIFY",
"diff": "Binary files a/yarn.lock and b/yarn.lock differ\n",
"new_path": "yarn.lock",
"old_path": "yarn.lock"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
build(all): add tslint workspace dev dependency
| 1
|
build
|
all
|
679,913
|
29.01.2018 02:52:23
| 0
|
04c3d592ad8bec17a1c9c791a3a10d4ef3b519da
|
feat(atom): add Cursor, update interfaces, types, readme
|
[
{
"change_type": "MODIFY",
"diff": "## About\n-Clojure inspired mutable wrapper for (usually) immutable values, with support for watches.\n+Clojure inspired mutable wrappers for (usually) immutable values, with support for watches.\n+\n+TODO\n## Installation\n@@ -14,10 +16,12 @@ yarn add @thi.ng/atom\n## Usage examples\n+### Atom\n+\n```typescript\n-import { Atom } from \"@thi.ng/atom\";\n+import * as atom from \"@thi.ng/atom\";\n-const a = new Atom(23);\n+const a = new atom.Atom(23);\n// obtain value via deref()\na.deref();\n@@ -34,6 +38,31 @@ a.reset(42);\n// foo: 24 -> 42\n```\n+### Cursor\n+\n+```typescript\n+// main state\n+main = new atom.Atom({a: 23, b: 42});\n+\n+// cursor to `a` value\n+// requires both a lookup & update function to given value\n+// both fns will be called with cursor's parent state\n+// the updater MUST NOT mutate in place\n+cursor = new atom.Cursor(main, (state) => state.a, (state, x) => ({...state, a: x}));\n+\n+// add watch just as with Atom\n+cursor.addWatch(\"foo\", console.log);\n+\n+cursor.deref()\n+// 23\n+\n+cursor.swap(x => x + 1);\n+// foo 23 24\n+\n+main.deref()\n+// { a: 24, b: 42 }\n+```\n+\n## Authors\n- Karsten Schmidt\n",
"new_path": "packages/atom/README.md",
"old_path": "packages/atom/README.md"
},
{
"change_type": "ADD",
"diff": "+import * as api from \"@thi.ng/api/api\";\n+\n+export type SwapFn<T> = (curr: T, ...args: any[]) => T;\n+\n+export interface ReadonlyAtom<T> extends\n+ api.IDeref<T>,\n+ api.IWatch<T> {\n+}\n+\n+export interface IAtom<T> extends ReadonlyAtom<T> {\n+ reset(val: T): T;\n+ swap(fn: SwapFn<T>, ...args: any[]): T;\n+}\n",
"new_path": "packages/atom/src/api.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { IEquiv, Watch } from \"@thi.ng/api/api\";\n+import { IWatch } from \"@thi.ng/api/mixins/iwatch\";\n+\n+import { IAtom, SwapFn } from \"./api\";\n+\n+/**\n+ * Mutable wrapper for an (usually) immutable value.\n+ * Support for watches.\n+ */\n+@IWatch\n+export class Atom<T> implements\n+ IAtom<T>,\n+ IEquiv {\n+\n+ protected value: T;\n+\n+ constructor(val?: T) {\n+ this.value = val;\n+ }\n+\n+ deref() {\n+ return this.value;\n+ }\n+\n+ equiv(o: any) {\n+ return this === o;\n+ }\n+\n+ reset(val: T) {\n+ const old = this.value;\n+ this.value = val;\n+ this.notifyWatches(old, val);\n+ return this.value;\n+ }\n+\n+ swap(fn: SwapFn<T>, ...args: any[]) {\n+ const old = this.value;\n+ args.unshift(old);\n+ this.value = fn.apply(null, args);\n+ this.notifyWatches(old, this.value);\n+ return this.value;\n+ }\n+\n+ // mixin stub\n+ addWatch(id: string, fn: Watch<T>) {\n+ return false;\n+ }\n+\n+ // mixin stub\n+ removeWatch(id: string) {\n+ return false;\n+ }\n+\n+ // mixin stub\n+ notifyWatches(oldState: T, newState: T) { }\n+}\n",
"new_path": "packages/atom/src/atom.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { IID, IRelease, Watch } from \"@thi.ng/api/api\";\n+import { IAtom, SwapFn } from \"./api\";\n+import { Atom } from \"./atom\";\n+\n+export class Cursor<T> implements\n+ IAtom<T>,\n+ IID<string>,\n+ IRelease {\n+\n+ static NEXT_ID = 0;\n+\n+ readonly id: string;\n+ parent: IAtom<any>;\n+\n+ protected local: Atom<T>;\n+ protected lookup: (s: any) => T;\n+ protected selfUpdate: boolean;\n+\n+ constructor(parent: IAtom<any>, lookup: (s: any) => T, update: (s: any, v: T) => any) {\n+ this.parent = parent;\n+ this.id = `cursor-${Cursor.NEXT_ID++}`;\n+ this.selfUpdate = false;\n+ this.local = new Atom<T>(lookup(parent.deref()));\n+ this.local.addWatch(this.id, (_, prev, curr) => {\n+ if (prev !== curr) {\n+ this.selfUpdate = true;\n+ parent.swap((state) => update(state, curr));\n+ this.selfUpdate = false;\n+ }\n+ });\n+ parent.addWatch(this.id, (_, prev, curr) => {\n+ if (!this.selfUpdate) {\n+ const cval = lookup(curr);\n+ if (cval !== lookup(prev)) {\n+ this.local.reset(cval);\n+ }\n+ }\n+ });\n+ }\n+\n+ deref() {\n+ return this.local.deref();\n+ }\n+\n+ release() {\n+ this.local.removeWatch(this.id);\n+ this.parent.removeWatch(this.id);\n+ delete this.local;\n+ return true;\n+ }\n+\n+ reset(val: T) {\n+ return this.local.reset(val);\n+ }\n+\n+ swap(fn: SwapFn<T>, ...args: any[]) {\n+ return this.local.swap.apply(this.local, [fn, ...args]);\n+ }\n+\n+ addWatch(id: string, fn: Watch<T>) {\n+ return this.local.addWatch(id, fn);\n+ }\n+\n+ removeWatch(id: string): boolean {\n+ throw new Error(\"Method not implemented.\");\n+ }\n+\n+ notifyWatches(oldState: T, newState: T) {\n+ throw new Error(\"Method not implemented.\");\n+ }\n+}\n",
"new_path": "packages/atom/src/cursor.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "-import * as api from \"@thi.ng/api/api\";\n-import { IWatch } from \"@thi.ng/api/mixins/iwatch\";\n-\n-/**\n- * Mutable wrapper for an (usually) immutable value.\n- * Support for watches.\n- */\n-@IWatch\n-export class Atom<T> implements\n- api.IDeref<T>,\n- api.IEquiv,\n- api.IWatch<T> {\n-\n- protected value: T;\n-\n- constructor(val?: T) {\n- this.value = val;\n- }\n-\n- public deref() {\n- return this.value;\n- }\n-\n- public equiv(o: any) {\n- return this === o;\n- }\n-\n- public reset(val: T) {\n- const old = this.value;\n- this.value = val;\n- this.notifyWatches(old, val);\n- return this.value;\n- }\n-\n- public swap(fn: (curr: T, ...args: any[]) => T, ...args: any[]) {\n- const old = this.value;\n- args.unshift(old);\n- this.value = fn.apply(null, args);\n- this.notifyWatches(old, this.value);\n- return this.value;\n- }\n-\n- // mixin stub\n- public addWatch(id: string, fn: (id: string, oldState: T, newState: T) => void) {\n- return false;\n- }\n-\n- // mixin stub\n- public removeWatch(id: string) {\n- return false;\n- }\n-\n- // mixin stub\n- public notifyWatches(oldState: T, newState: T) { }\n-}\n+export * from \"./atom\";\n+export * from \"./cursor\";\n\\ No newline at end of file\n",
"new_path": "packages/atom/src/index.ts",
"old_path": "packages/atom/src/index.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(atom): add Cursor, update interfaces, types, readme
| 1
|
feat
|
atom
|
679,913
|
29.01.2018 02:53:22
| 0
|
ca3994ade19b464b656fbbc08264b54c523f2829
|
feat(rstream): add atom dep, add fromAtom() & docs
|
[
{
"change_type": "MODIFY",
"diff": "},\n\"dependencies\": {\n\"@thi.ng/api\": \"^1.3.0\",\n+ \"@thi.ng/atom\": \"^0.0.1\",\n\"@thi.ng/transducers\": \"^1.0.0\"\n},\n\"keywords\": [\n",
"new_path": "packages/rstream/package.json",
"old_path": "packages/rstream/package.json"
},
{
"change_type": "ADD",
"diff": "+import { ReadonlyAtom } from \"@thi.ng/atom/api\";\n+import { Stream } from \"../stream\";\n+\n+/**\n+ * Yields stream of value changes in given atom / cursor.\n+ * Attaches watch to atom and compares values with `===`.\n+ * If `emitFirst` is true (default), also emits atom's\n+ * current value when first subscriber attaches to stream.\n+ *\n+ * See: @thi.ng/atom\n+ *\n+ * ```\n+ * db = new Atom({a: 23, b: 88});\n+ * cursor = new Cursor(db, (s) => s.a, (s, x)=> ({...s, a: x}))\n+ *\n+ * rs.fromAtom(cursor).subscribe(rs.trace(\"cursor val:\"))\n+ * // cursor val: 23\n+ *\n+ * cursor.reset(42);\n+ * // cursor val: 42\n+ *\n+ * db.reset({a: 66})\n+ * // cursor val: 66\n+ * ```\n+ *\n+ * @param atom\n+ */\n+export function fromAtom<T>(atom: ReadonlyAtom<T>, emitFirst = true): Stream<T> {\n+ return new Stream<T>((stream) => {\n+ atom.addWatch(stream.id, (_, prev, curr) => {\n+ if (curr !== prev) {\n+ stream.next(curr);\n+ }\n+ });\n+ emitFirst && stream.next(atom.deref());\n+ return () => atom.removeWatch(stream.id);\n+ });\n+}\n",
"new_path": "packages/rstream/src/from/atom.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -3,6 +3,7 @@ export * from \"./stream\";\nexport * from \"./stream-merge\";\nexport * from \"./subscription\";\n+export * from \"./from/atom\";\nexport * from \"./from/event\";\nexport * from \"./from/interval\";\nexport * from \"./from/iterable\";\n",
"new_path": "packages/rstream/src/index.ts",
"old_path": "packages/rstream/src/index.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(rstream): add atom dep, add fromAtom() & docs
| 1
|
feat
|
rstream
|
679,913
|
29.01.2018 02:54:13
| 0
|
1bc6ee6f77278160af5af239b759ae08c2f1f54b
|
build(rstream-csp): minor fix package & readme
|
[
{
"change_type": "MODIFY",
"diff": "@@ -43,8 +43,8 @@ stream.subscribe(rs.trace(\"tentimes\"), tx.map(x => x * 10));\n## Authors\n-- Karsten Schmidt <k+npm@thi.ng>\n+- Karsten Schmidt\n## License\n-© 2018 Karsten Schmidt <k+npm@thi.ng> // Apache Software License 2.0\n+© 2018 Karsten Schmidt // Apache Software License 2.0\n",
"new_path": "packages/rstream-csp/README.md",
"old_path": "packages/rstream-csp/README.md"
},
{
"change_type": "MODIFY",
"diff": "\"scripts\": {\n\"build\": \"yarn run clean && tsc --declaration\",\n\"test\": \"yarn run clean && tsc -p test && mocha build/test/*.js\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc\",\n+ \"clean\": \"rm -rf *.js *.d.ts build doc from\",\n\"pub\": \"yarn run build && yarn publish --access public\"\n},\n\"devDependencies\": {\n",
"new_path": "packages/rstream-csp/package.json",
"old_path": "packages/rstream-csp/package.json"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
build(rstream-csp): minor fix package & readme
| 1
|
build
|
rstream-csp
|
679,913
|
29.01.2018 03:35:03
| 0
|
d774e324029500ab318e12cac215cdd510d105eb
|
perf(transducers): avoid result object cloning in struct() xform
disable copying in mapKeys() step
|
[
{
"change_type": "MODIFY",
"diff": "@@ -35,6 +35,6 @@ export function struct<T>(fields: StructField[]): Transducer<any, T> {\npartitionOf(fields.map((f) => f[1])),\npartition(fields.length),\nrename(fields.reduce((acc, f, i) => (acc[f[0]] = i, acc), {})),\n- mapKeys(fields.reduce((acc, f) => (f[2] ? (acc[f[0]] = f[2], acc) : acc), {}))\n+ mapKeys(fields.reduce((acc, f) => (f[2] ? (acc[f[0]] = f[2], acc) : acc), {}), false)\n);\n}\n",
"new_path": "packages/transducers/src/xform/struct.ts",
"old_path": "packages/transducers/src/xform/struct.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
perf(transducers): avoid result object cloning in struct() xform
- disable copying in mapKeys() step
| 1
|
perf
|
transducers
|
679,913
|
29.01.2018 03:36:33
| 0
|
e45f3bd7f945c236946c60d7403633c48b9c5d58
|
chore(all): update depgraph commit msg format
|
[
{
"change_type": "MODIFY",
"diff": "\"tslint\": \"^5.9.1\"\n},\n\"scripts\": {\n- \"depgraph\": \"scripts/depgraph && git add assets/deps.png && git commit -m 'update dep graph' && git push\"\n+ \"depgraph\": \"scripts/depgraph && git add assets/deps.png && git commit -m 'docs(all) update dep graph' && git push\"\n}\n}\n\\ No newline at end of file\n",
"new_path": "package.json",
"old_path": "package.json"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
chore(all): update depgraph commit msg format
| 1
|
chore
|
all
|
679,913
|
29.01.2018 04:04:04
| 0
|
cca801b790a021a43580ebc2cbf4adb9738e0672
|
fix(atom): cursor IWatch impls (replace stubs)
|
[
{
"change_type": "MODIFY",
"diff": "@@ -62,10 +62,10 @@ export class Cursor<T> implements\n}\nremoveWatch(id: string): boolean {\n- throw new Error(\"Method not implemented.\");\n+ return this.local.removeWatch(id);\n}\nnotifyWatches(oldState: T, newState: T) {\n- throw new Error(\"Method not implemented.\");\n+ return this.local.notifyWatches(oldState, newState);\n}\n}\n",
"new_path": "packages/atom/src/cursor.ts",
"old_path": "packages/atom/src/cursor.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
fix(atom): cursor IWatch impls (replace stubs)
| 1
|
fix
|
atom
|
679,913
|
29.01.2018 04:13:30
| 0
|
33b3e16c550b4057575754d2640ae899576f1cfa
|
chore: update package cmds & make-module script
|
[
{
"change_type": "MODIFY",
"diff": "\"tslint\": \"^5.9.1\"\n},\n\"scripts\": {\n- \"depgraph\": \"scripts/depgraph && git add assets/deps.png && git commit -m 'docs(all) update dep graph' && git push\"\n+ \"depgraph\": \"scripts/depgraph && git add assets/deps.png && git commit -m 'docs: update dep graph' && git push\",\n+ \"pub\": \"lerna publish && yarn depgraph\"\n}\n}\n\\ No newline at end of file\n",
"new_path": "package.json",
"old_path": "package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -11,6 +11,8 @@ echo \"creating /src & /test folders...\"\nmkdir -p $MODULE/src $MODULE/test\ntouch $MODULE/src/index.ts\n+cp packages/api/LICENSE $MODULE/\n+\necho \"writing test skeleton...\"\ncat << EOF > $MODULE/test/index.ts\nimport * as assert from \"assert\";\n",
"new_path": "scripts/make-module",
"old_path": "scripts/make-module"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
chore: update package cmds & make-module script
| 1
|
chore
| null |
679,913
|
29.01.2018 12:22:38
| 0
|
822b297fbbb2ad59890dabdfb8bb50fb1276e730
|
fix(rstream): fix update fromPromise(), add test
add catch() outside stream source to catch errors before 1st sub is active
|
[
{
"change_type": "MODIFY",
"diff": "@@ -9,14 +9,27 @@ import { Stream } from \"../stream\";\n* @param src\n*/\nexport function fromPromise<T>(src: Promise<T>) {\n- let canceled = false;\n+ let canceled = false,\n+ isError = false,\n+ err: any = {};\n+ src.catch(\n+ (e) => {\n+ err = e;\n+ isError = true;\n+ }\n+ );\nreturn new Stream<T>((stream) => {\nsrc.then(\n(x) => {\nif (!canceled && stream.getState() < State.DONE) {\n+ if (isError) {\n+ stream.error(err);\n+ err = null;\n+ } else {\nstream.next(x);\nstream.done();\n}\n+ }\n},\n(e) => stream.error(e)\n);\n",
"new_path": "packages/rstream/src/from/promise.ts",
"old_path": "packages/rstream/src/from/promise.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -98,4 +98,26 @@ describe(\"fromPromise()\", () => {\n});\n});\n+ it(\"rejects via Resolver\", (done) => {\n+ let src = rs.fromPromise(Promise.reject(23)),\n+ called = false,\n+ sub = src.subscribe(rs.resolve())\n+ .subscribe({\n+ next(_) {\n+ assert.fail(\"called next\");\n+ },\n+ error(e) {\n+ assert.equal(e, 23);\n+ called = true;\n+ },\n+ done() {\n+ assert.fail(\"called done\");\n+ }\n+ });\n+ setTimeout(() => {\n+ assert(called, \"didn't call error\");\n+ assert.equal(sub.getState(), rs.State.ERROR, \"sub not in error state\");\n+ done();\n+ }, 1);\n+ })\n});\n",
"new_path": "packages/rstream/test/from-promise.ts",
"old_path": "packages/rstream/test/from-promise.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
fix(rstream): fix #1 update fromPromise(), add test
- add catch() outside stream source to catch errors before 1st sub is active
| 1
|
fix
|
rstream
|
679,913
|
29.01.2018 12:45:08
| 0
|
ccd8e82074bd74e4a67c3d68b3e4f361ebb344aa
|
test(rstream): update tests (fromPromise())
|
[
{
"change_type": "MODIFY",
"diff": "@@ -13,7 +13,7 @@ describe(\"fromPromise()\", () => {\ncalled = true;\n},\ndone() {\n- assert(called, \"not called\");\n+ assert(called, \"not called next()\");\ndone();\n}\n});\n@@ -22,64 +22,50 @@ describe(\"fromPromise()\", () => {\nit(\"rejects to sub\", (done) => {\nlet src = rs.fromPromise(Promise.reject(23)),\ncalled = false,\n- calledDone = false,\nsub = src.subscribe({\n+ next(_) {\n+ assert.fail(\"called next()\");\n+ },\n+ done() {\n+ assert.fail(\"called done()\");\n+ },\nerror(x) {\nassert.equal(x, 23);\nassert.equal(src.getState(), rs.State.ERROR);\nassert.equal(sub.getState(), rs.State.ERROR);\ncalled = true;\n- },\n- done() {\n- calledDone = true;\n}\n});\nsetTimeout(() => {\nassert(called, \"not called\");\n- assert(!calledDone, \"called done\");\ndone();\n- }, 10);\n+ }, 1);\n});\nit(\"passes error to sub\", (done) => {\nlet src = rs.fromPromise(new Promise(() => { throw new Error(\"foo\"); })),\ncalled = false,\n- calledDone = false,\nsub = src.subscribe({\n+ next(_) {\n+ assert.fail(\"called next()\");\n+ },\n+ done() {\n+ assert.fail(\"called done()\");\n+ },\nerror(x) {\nassert.equal(x.message, \"foo\");\nassert.equal(src.getState(), rs.State.ERROR);\nassert.equal(sub.getState(), rs.State.ERROR);\ncalled = true;\n- },\n- done() {\n- calledDone = true;\n}\n});\nsetTimeout(() => {\nassert(called, \"not called\");\n- assert(!calledDone, \"called done\");\n- done();\n- }, 10);\n- });\n-\n- it(\"goes into ERROR state\", (done) => {\n- let src = rs.fromPromise(new Promise(() => { throw new Error(\"foo\"); })),\n- calledDone = false,\n- sub = src.subscribe({\n- done() {\n- calledDone = true;\n- }\n- });\n- setTimeout(() => {\n- assert.equal(src.getState(), rs.State.ERROR, \"src not ERROR\");\n- assert.equal(sub.getState(), rs.State.ERROR, \"sub not ERROR\");\n- assert(!calledDone, \"called done\");\nassert.throws(() => src.next(Promise.resolve()), \"no next() allowed\");\nsrc.done();\nassert.equal(src.getState(), rs.State.ERROR, \"src not ERROR\");\ndone();\n- }, 0);\n+ }, 10);\n});\nit(\"resolves via Resolver\", (done) => {\n@@ -97,27 +83,4 @@ describe(\"fromPromise()\", () => {\n}\n});\n});\n-\n- it(\"rejects via Resolver\", (done) => {\n- let src = rs.fromPromise(Promise.reject(23)),\n- called = false,\n- sub = src.subscribe(rs.resolve())\n- .subscribe({\n- next(_) {\n- assert.fail(\"called next\");\n- },\n- error(e) {\n- assert.equal(e, 23);\n- called = true;\n- },\n- done() {\n- assert.fail(\"called done\");\n- }\n- });\n- setTimeout(() => {\n- assert(called, \"didn't call error\");\n- assert.equal(sub.getState(), rs.State.ERROR, \"sub not in error state\");\n- done();\n- }, 1);\n- })\n});\n",
"new_path": "packages/rstream/test/from-promise.ts",
"old_path": "packages/rstream/test/from-promise.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
test(rstream): update tests (fromPromise())
| 1
|
test
|
rstream
|
679,913
|
29.01.2018 14:57:56
| 0
|
5dce8a2f4eeb4cf40ec85c26b33a7aab88ff5d43
|
feat(atom): add nested path getter / setter compilers
update cursor ctor to also accept paths
update readme example
|
[
{
"change_type": "MODIFY",
"diff": "@@ -42,13 +42,22 @@ a.reset(42);\n```typescript\n// main state\n-main = new atom.Atom({a: 23, b: 42});\n+main = new atom.Atom({ a: { b: { c: 23 }, d: { e: 42 } }, f: 66 });\n-// cursor to `a` value\n-// requires both a lookup & update function to given value\n+// cursor to `c` value\n+cursor = new atom.Cursor(main, \"a.b.c\");\n+// or\n+cursor = new atom.Cursor(main, [\"a\",\"b\",\"c\"]);\n+\n+// alternatively provide path implicitly via lookup & update functions\n// both fns will be called with cursor's parent state\n-// the updater MUST NOT mutate in place\n-cursor = new atom.Cursor(main, (state) => state.a, (state, x) => ({...state, a: x}));\n+// this allows the cursor implementation to work with any data structure\n+// as long as the updater DOES NOT mutate in place\n+cursor = new atom.Cursor(\n+ main,\n+ (s) => s.a.b.c,\n+ (s, x) => ({...s, a: {...s.a, b: {...s.a.b, c: x}}})\n+);\n// add watch just as with Atom\ncursor.addWatch(\"foo\", console.log);\n",
"new_path": "packages/atom/README.md",
"old_path": "packages/atom/README.md"
},
{
"change_type": "MODIFY",
"diff": "import { IID, IRelease, Watch } from \"@thi.ng/api/api\";\n+import { isArray } from \"@thi.ng/checks/is-array\";\n+import { isFunction } from \"@thi.ng/checks/is-function\";\n+import { isString } from \"@thi.ng/checks/is-string\";\n+\nimport { IAtom, SwapFn } from \"./api\";\nimport { Atom } from \"./atom\";\n+import { getter, setter } from \"./path\";\nexport class Cursor<T> implements\nIAtom<T>,\n@@ -16,10 +21,21 @@ export class Cursor<T> implements\nprotected lookup: (s: any) => T;\nprotected selfUpdate: boolean;\n- constructor(parent: IAtom<any>, lookup: (s: any) => T, update: (s: any, v: T) => any) {\n+ constructor(parent: IAtom<any>, path: PropertyKey | PropertyKey[]);\n+ constructor(parent: IAtom<any>, lookup: (s: any) => T, update: (s: any, v: T) => any);\n+ constructor(parent: IAtom<any>, ...opts: any[]) {\nthis.parent = parent;\nthis.id = `cursor-${Cursor.NEXT_ID++}`;\nthis.selfUpdate = false;\n+ let lookup, update;\n+ if (isString(opts[0]) || isArray(opts[0])) {\n+ lookup = getter(opts[0]);\n+ update = setter(opts[0]);\n+ } else if (isFunction(opts[0]) && isFunction(opts[1])) {\n+ [lookup, update] = opts;\n+ } else {\n+ throw new Error(\"illegal args\");\n+ }\nthis.local = new Atom<T>(lookup(parent.deref()));\nthis.local.addWatch(this.id, (_, prev, curr) => {\nif (prev !== curr) {\n",
"new_path": "packages/atom/src/cursor.ts",
"old_path": "packages/atom/src/cursor.ts"
},
{
"change_type": "MODIFY",
"diff": "export * from \"./atom\";\nexport * from \"./cursor\";\n+export * from \"./path\";\n\\ No newline at end of file\n",
"new_path": "packages/atom/src/index.ts",
"old_path": "packages/atom/src/index.ts"
},
{
"change_type": "ADD",
"diff": "+import { isArray } from \"@thi.ng/checks/is-array\";\n+import { isString } from \"@thi.ng/checks/is-string\";\n+\n+function compS(k, f) {\n+ return (s, v) => ({ ...s, [k]: f((s || {})[k], v) });\n+}\n+\n+function compG(k, f) {\n+ return (s) => s ? f(s[k]) : undefined;\n+}\n+\n+export function getter(path: PropertyKey | PropertyKey[]) {\n+ const ks = isArray(path) ? path : isString(path) ? path.split(\".\") : [path],\n+ kl = ks.pop();\n+ let f = (s) => s ? s[kl] : undefined;\n+ for (let i = ks.length - 1; i >= 0; i--) {\n+ f = compG(ks[i], f);\n+ }\n+ return f;\n+}\n+\n+export function setter(path: PropertyKey | PropertyKey[]) {\n+ const ks = isArray(path) ? path : isString(path) ? path.split(\".\") : [path],\n+ kl = ks.pop();\n+ let f = (s, v) => ({ ...(s || {}), [kl]: v });\n+ for (let i = ks.length - 1; i >= 0; i--) {\n+ f = compS(ks[i], f);\n+ }\n+ return f;\n+}\n",
"new_path": "packages/atom/src/path.ts",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(atom): add nested path getter / setter compilers
- update cursor ctor to also accept paths
- update readme example
| 1
|
feat
|
atom
|
791,723
|
29.01.2018 15:46:11
| 28,800
|
51add92e1585b04a3bab66a231c98d405f880096
|
report: escape usage of '#' in data URIs
|
[
{
"change_type": "MODIFY",
"diff": "--lh-audit-hgap: 12px;\n--lh-audit-group-vpadding: 12px;\n--lh-section-vpadding: 12px;\n- --pass-icon-url: url('data:image/svg+xml;utf8,<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg\"><path stroke=\"#007F04\" stroke-width=\"1.5\" d=\"M1 5.75l3.5 3.5 6.5-6.5\" fill=\"none\" fill-rule=\"evenodd\"/></svg>');\n- --fail-icon-url: url('data:image/svg+xml;utf8,<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg\"><g stroke=\"#EE1D0A\" stroke-width=\"1.5\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M2 10l8-8M10 10L2 2\"/></g></svg>');\n+ --pass-icon-url: url('data:image/svg+xml;utf8,<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg\"><path stroke=\"%23007F04\" stroke-width=\"1.5\" d=\"M1 5.75l3.5 3.5 6.5-6.5\" fill=\"none\" fill-rule=\"evenodd\"/></svg>');\n+ --fail-icon-url: url('data:image/svg+xml;utf8,<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg\"><g stroke=\"%23EE1D0A\" stroke-width=\"1.5\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M2 10l8-8M10 10L2 2\"/></g></svg>');\n--collapsed-icon-url: url('data:image/svg+xml;utf8,<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg\"><g fill=\"none\" fill-rule=\"evenodd\"><path fill=\"none\" d=\"M0 0h12v12H0z\"/><path fill=\"hsl(0, 0%, 60%)\" d=\"M3 2l6 4-6 4z\"/></g></svg>');\n--expanded-icon-url: url('data:image/svg+xml;utf8,<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg\"><g fill=\"none\" fill-rule=\"evenodd\"><path fill=\"none\" d=\"M0 0h12v12H0z\"/><path fill=\"hsl(0, 0%, 60%)\" d=\"M10 3L6 9 2 3z\"/></g></svg>');\n}\n",
"new_path": "lighthouse-core/report/v2/report-styles.css",
"old_path": "lighthouse-core/report/v2/report-styles.css"
},
{
"change_type": "MODIFY",
"diff": "background-position: top left;\n}\n.lh-crc .horiz-down {\n- background: url('data:image/svg+xml;utf8,<svg width=\"16\" height=\"26\" viewBox=\"0 0 16 26\" xmlns=\"http://www.w3.org/2000/svg\"><g fill=\"#D8D8D8\" fill-rule=\"evenodd\"><path d=\"M16 12v2H-2v-2z\"/><path d=\"M9 12v14H7V12z\"/></g></svg>');\n+ background: url('data:image/svg+xml;utf8,<svg width=\"16\" height=\"26\" viewBox=\"0 0 16 26\" xmlns=\"http://www.w3.org/2000/svg\"><g fill=\"%23D8D8D8\" fill-rule=\"evenodd\"><path d=\"M16 12v2H-2v-2z\"/><path d=\"M9 12v14H7V12z\"/></g></svg>');\n}\n.lh-crc .right {\n- background: url('data:image/svg+xml;utf8,<svg width=\"16\" height=\"26\" viewBox=\"0 0 16 26\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M16 12v2H0v-2z\" fill=\"#D8D8D8\" fill-rule=\"evenodd\"/></svg>');\n+ background: url('data:image/svg+xml;utf8,<svg width=\"16\" height=\"26\" viewBox=\"0 0 16 26\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M16 12v2H0v-2z\" fill=\"%23D8D8D8\" fill-rule=\"evenodd\"/></svg>');\n}\n.lh-crc .up-right {\n- background: url('data:image/svg+xml;utf8,<svg width=\"16\" height=\"26\" viewBox=\"0 0 16 26\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7 0h2v14H7zm2 12h7v2H9z\" fill=\"#D8D8D8\" fill-rule=\"evenodd\"/></svg>');\n+ background: url('data:image/svg+xml;utf8,<svg width=\"16\" height=\"26\" viewBox=\"0 0 16 26\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7 0h2v14H7zm2 12h7v2H9z\" fill=\"%23D8D8D8\" fill-rule=\"evenodd\"/></svg>');\n}\n.lh-crc .vert-right {\n- background: url('data:image/svg+xml;utf8,<svg width=\"16\" height=\"26\" viewBox=\"0 0 16 26\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7 0h2v27H7zm2 12h7v2H9z\" fill=\"#D8D8D8\" fill-rule=\"evenodd\"/></svg>');\n+ background: url('data:image/svg+xml;utf8,<svg width=\"16\" height=\"26\" viewBox=\"0 0 16 26\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7 0h2v27H7zm2 12h7v2H9z\" fill=\"%23D8D8D8\" fill-rule=\"evenodd\"/></svg>');\n}\n.lh-crc .vert {\n- background: url('data:image/svg+xml;utf8,<svg width=\"16\" height=\"26\" viewBox=\"0 0 16 26\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7 0h2v26H7z\" fill=\"#D8D8D8\" fill-rule=\"evenodd\"/></svg>');\n+ background: url('data:image/svg+xml;utf8,<svg width=\"16\" height=\"26\" viewBox=\"0 0 16 26\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7 0h2v26H7z\" fill=\"%23D8D8D8\" fill-rule=\"evenodd\"/></svg>');\n}\n.lh-crc .crc-tree {\nfont-size: 14px;\n",
"new_path": "lighthouse-core/report/v2/templates.html",
"old_path": "lighthouse-core/report/v2/templates.html"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
report: escape usage of '#' in data URIs (#4381)
| 1
|
report
| null |
791,723
|
29.01.2018 15:53:19
| 28,800
|
fe17df0539bde1d423269285d209522c617a7509
|
deps: bump metaviewport-parser to 0.2.0
|
[
{
"change_type": "MODIFY",
"diff": "@@ -63,4 +63,16 @@ describe('Mobile-friendly: viewport audit', () => {\n}).rawValue, true);\n});\n});\n+\n+ it('doesn\\'t throw when viewport contains \"invalid\" iOS properties', () => {\n+ const viewports = [\n+ 'width=device-width, shrink-to-fit=no',\n+ 'width=device-width, viewport-fit=cover',\n+ ];\n+ viewports.forEach(viewport => {\n+ const result = Audit.audit({Viewport: viewport});\n+ assert.equal(result.rawValue, true);\n+ assert.equal(result.debugString, '');\n+ });\n+ });\n});\n",
"new_path": "lighthouse-core/test/audits/viewport-test.js",
"old_path": "lighthouse-core/test/audits/viewport-test.js"
},
{
"change_type": "MODIFY",
"diff": "\"jpeg-js\": \"0.1.2\",\n\"js-library-detector\": \"^4.3.1\",\n\"lighthouse-logger\": \"^1.0.0\",\n- \"metaviewport-parser\": \"0.1.0\",\n+ \"metaviewport-parser\": \"0.2.0\",\n\"mkdirp\": \"0.5.1\",\n\"opn\": \"4.0.2\",\n\"parse-cache-control\": \"1.0.1\",\n",
"new_path": "package.json",
"old_path": "package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -2832,9 +2832,9 @@ merge@^1.2.0:\nversion \"1.2.0\"\nresolved \"https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da\"\n-metaviewport-parser@0.1.0:\n- version \"0.1.0\"\n- resolved \"https://registry.yarnpkg.com/metaviewport-parser/-/metaviewport-parser-0.1.0.tgz#97fa67ea4bbf640f4fd59010f88f10cea7d5accc\"\n+metaviewport-parser@0.2.0:\n+ version \"0.2.0\"\n+ resolved \"https://registry.yarnpkg.com/metaviewport-parser/-/metaviewport-parser-0.2.0.tgz#535c3ce1ccf6223a5025fddc6a1c36505f7e7db1\"\nmicromatch@^2.3.7:\nversion \"2.3.11\"\n",
"new_path": "yarn.lock",
"old_path": "yarn.lock"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
deps: bump metaviewport-parser to 0.2.0 (#4382)
| 1
|
deps
| null |
791,690
|
29.01.2018 16:01:31
| 28,800
|
d5fa452884f19341df00e6eeaa1eae3e06f40a40
|
core(screenshot-thumbnails): increase size to 120px
|
[
{
"change_type": "MODIFY",
"diff": "@@ -11,7 +11,7 @@ const TTCI = require('./consistently-interactive');\nconst jpeg = require('jpeg-js');\nconst NUMBER_OF_THUMBNAILS = 10;\n-const THUMBNAIL_WIDTH = 60;\n+const THUMBNAIL_WIDTH = 120;\nclass ScreenshotThumbnails extends Audit {\n/**\n",
"new_path": "lighthouse-core/audits/screenshot-thumbnails.js",
"old_path": "lighthouse-core/audits/screenshot-thumbnails.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -611,6 +611,7 @@ span.lh-node:hover {\n.lh-filmstrip__thumbnail {\nborder: 1px solid var(--report-secondary-border-color);\nmax-height: 100px;\n+ max-width: 60px;\n}\n/* Sparkline */\n",
"new_path": "lighthouse-core/report/v2/report-styles.css",
"old_path": "lighthouse-core/report/v2/report-styles.css"
},
{
"change_type": "MODIFY",
"diff": "Binary files a/lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-0.jpg and b/lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-0.jpg differ\n",
"new_path": "lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-0.jpg",
"old_path": "lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-0.jpg"
},
{
"change_type": "MODIFY",
"diff": "Binary files a/lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-1.jpg and b/lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-1.jpg differ\n",
"new_path": "lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-1.jpg",
"old_path": "lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-1.jpg"
},
{
"change_type": "MODIFY",
"diff": "Binary files a/lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-2.jpg and b/lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-2.jpg differ\n",
"new_path": "lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-2.jpg",
"old_path": "lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-2.jpg"
},
{
"change_type": "MODIFY",
"diff": "Binary files a/lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-3.jpg and b/lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-3.jpg differ\n",
"new_path": "lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-3.jpg",
"old_path": "lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-3.jpg"
},
{
"change_type": "MODIFY",
"diff": "Binary files a/lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-4.jpg and b/lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-4.jpg differ\n",
"new_path": "lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-4.jpg",
"old_path": "lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-4.jpg"
},
{
"change_type": "MODIFY",
"diff": "Binary files a/lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-5.jpg and b/lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-5.jpg differ\n",
"new_path": "lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-5.jpg",
"old_path": "lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-5.jpg"
},
{
"change_type": "MODIFY",
"diff": "Binary files a/lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-6.jpg and b/lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-6.jpg differ\n",
"new_path": "lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-6.jpg",
"old_path": "lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-6.jpg"
},
{
"change_type": "MODIFY",
"diff": "Binary files a/lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-7.jpg and b/lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-7.jpg differ\n",
"new_path": "lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-7.jpg",
"old_path": "lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-7.jpg"
},
{
"change_type": "MODIFY",
"diff": "Binary files a/lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-8.jpg and b/lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-8.jpg differ\n",
"new_path": "lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-8.jpg",
"old_path": "lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-8.jpg"
},
{
"change_type": "MODIFY",
"diff": "Binary files a/lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-9.jpg and b/lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-9.jpg differ\n",
"new_path": "lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-9.jpg",
"old_path": "lighthouse-core/test/fixtures/traces/screenshots/progressive-app-frame-9.jpg"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
core(screenshot-thumbnails): increase size to 120px (#4383)
| 1
|
core
|
screenshot-thumbnails
|
679,913
|
29.01.2018 17:59:43
| 0
|
85b280bfe003d070fc52eda56483cf1cd41b6abd
|
build: update commands in all packages
|
[
{
"change_type": "MODIFY",
"diff": "\"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n\"license\": \"Apache-2.0\",\n\"scripts\": {\n- \"build\": \"yarn run clean && tsc --declaration\",\n- \"test\": \"yarn run clean && tsc -p test && mocha build/test/*.js\",\n+ \"build\": \"yarn clean && tsc --declaration\",\n\"clean\": \"rm -rf *.js *.d.ts build doc decorators mixins\",\n- \"pub\": \"yarn run build && yarn publish --access public\"\n+ \"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n+ \"pub\": \"yarn build && yarn publish --access public\",\n+ \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n",
"new_path": "packages/api/package.json",
"old_path": "packages/api/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n\"license\": \"Apache-2.0\",\n\"scripts\": {\n- \"build\": \"yarn run clean && tsc --declaration\",\n- \"test\": \"yarn run clean && tsc -p test && mocha build/test/*.js\",\n+ \"build\": \"yarn clean && tsc --declaration\",\n\"clean\": \"rm -rf *.js *.d.ts build doc\",\n- \"pub\": \"yarn run build && yarn publish --access public\"\n+ \"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n+ \"pub\": \"yarn build && yarn publish --access public\",\n+ \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n",
"new_path": "packages/atom/package.json",
"old_path": "packages/atom/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n\"license\": \"Apache-2.0\",\n\"scripts\": {\n- \"build\": \"yarn run clean && tsc --declaration\",\n- \"test\": \"yarn run clean && tsc -p test && mocha build/test/*.js\",\n+ \"build\": \"yarn clean && tsc --declaration\",\n\"clean\": \"rm -rf *.js *.d.ts build doc\",\n- \"pub\": \"yarn run build && yarn publish --access public\"\n+ \"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n+ \"pub\": \"yarn build && yarn publish --access public\",\n+ \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n",
"new_path": "packages/bitstream/package.json",
"old_path": "packages/bitstream/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n\"license\": \"Apache-2.0\",\n\"scripts\": {\n- \"build\": \"yarn run clean && tsc --declaration\",\n- \"test\": \"yarn run clean && tsc -p test && mocha build/test/*.js\",\n+ \"build\": \"yarn clean && tsc --declaration\",\n\"clean\": \"rm -rf *.js *.d.ts build doc\",\n- \"pub\": \"yarn run build && yarn publish --access public\"\n+ \"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n+ \"pub\": \"yarn build && yarn publish --access public\",\n+ \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n",
"new_path": "packages/checks/package.json",
"old_path": "packages/checks/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n\"license\": \"Apache-2.0\",\n\"scripts\": {\n- \"build\": \"yarn run clean && tsc --declaration\",\n- \"test\": \"yarn run clean && tsc -p test && mocha build/test/*.js\",\n+ \"build\": \"yarn clean && tsc --declaration\",\n+ \"clean\": \"rm -rf *.js *.d.ts build doc utils\",\n+ \"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n+ \"pub\": \"yarn build && yarn publish --access public\",\n+ \"test\": \"rm -rf build && tsc -p test && mocha build/test/index.js\",\n\"testasync\": \"tsc -p test && node build/test/async.js\",\n\"testfile\": \"tsc -p test && node build/test/file.js\",\n\"testgraph\": \"tsc -p test && node build/test/graph.js\",\n- \"testnode\": \"tsc -p test && node build/test/node.js\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc utils\",\n- \"pub\": \"yarn run build && yarn publish --access public\"\n+ \"testnode\": \"tsc -p test && node build/test/node.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n",
"new_path": "packages/csp/package.json",
"old_path": "packages/csp/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n\"license\": \"Apache-2.0\",\n\"scripts\": {\n- \"build\": \"yarn run clean && tsc --declaration\",\n- \"test\": \"yarn run clean && tsc -p test && mocha build/test/*.js\",\n+ \"build\": \"yarn clean && tsc --declaration\",\n\"clean\": \"rm -rf *.js *.d.ts build doc\",\n- \"pub\": \"yarn run build && yarn publish --access public\"\n+ \"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n+ \"pub\": \"yarn build && yarn publish --access public\",\n+ \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n",
"new_path": "packages/dcons/package.json",
"old_path": "packages/dcons/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n\"license\": \"Apache-2.0\",\n\"scripts\": {\n- \"build\": \"yarn run clean && tsc --declaration\",\n- \"test\": \"yarn run clean && tsc -p test && mocha build/test/*.js\",\n+ \"build\": \"yarn clean && tsc --declaration\",\n\"clean\": \"rm -rf *.js *.d.ts build doc\",\n- \"pub\": \"yarn run build && yarn publish --access public\"\n+ \"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n+ \"pub\": \"yarn build && yarn publish --access public\",\n+ \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n",
"new_path": "packages/hiccup/package.json",
"old_path": "packages/hiccup/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n\"license\": \"Apache-2.0\",\n\"scripts\": {\n- \"build\": \"yarn run clean && tsc --declaration\",\n- \"test\": \"yarn run clean && tsc -p test && mocha build/test/*.js\",\n+ \"build\": \"yarn clean && tsc --declaration\",\n\"clean\": \"rm -rf *.js *.d.ts build doc\",\n- \"pub\": \"yarn run build && yarn publish --access public\"\n+ \"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n+ \"pub\": \"yarn build && yarn publish --access public\",\n+ \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n",
"new_path": "packages/iterators/package.json",
"old_path": "packages/iterators/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n\"license\": \"Apache-2.0\",\n\"scripts\": {\n- \"build\": \"yarn run clean && tsc --declaration\",\n- \"test\": \"yarn run clean && tsc -p test && mocha build/test/*.js\",\n+ \"build\": \"yarn clean && tsc --declaration\",\n\"clean\": \"rm -rf *.js *.d.ts build doc\",\n- \"pub\": \"yarn run build && yarn publish --access public\"\n+ \"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n+ \"pub\": \"yarn build && yarn publish --access public\",\n+ \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n",
"new_path": "packages/rle-pack/package.json",
"old_path": "packages/rle-pack/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n\"license\": \"Apache-2.0\",\n\"scripts\": {\n- \"build\": \"yarn run clean && tsc --declaration\",\n- \"test\": \"yarn run clean && tsc -p test && mocha build/test/*.js\",\n+ \"build\": \"yarn clean && tsc --declaration\",\n\"clean\": \"rm -rf *.js *.d.ts build doc from\",\n- \"pub\": \"yarn run build && yarn publish --access public\"\n+ \"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n+ \"pub\": \"yarn build && yarn publish --access public\",\n+ \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n",
"new_path": "packages/rstream-csp/package.json",
"old_path": "packages/rstream-csp/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n\"license\": \"Apache-2.0\",\n\"scripts\": {\n- \"build\": \"yarn run clean && tsc --declaration\",\n- \"test\": \"yarn run clean && tsc -p test && mocha build/test/*.js\",\n+ \"build\": \"yarn clean && tsc --declaration\",\n\"clean\": \"rm -rf *.js *.d.ts build doc output transform\",\n- \"pub\": \"yarn run build && yarn publish --access public\"\n+ \"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n+ \"pub\": \"yarn build && yarn publish --access public\",\n+ \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n",
"new_path": "packages/rstream-log/package.json",
"old_path": "packages/rstream-log/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n\"license\": \"Apache-2.0\",\n\"scripts\": {\n- \"build\": \"yarn run clean && tsc --declaration\",\n- \"test\": \"yarn run clean && tsc -p test && mocha build/test/*.js\",\n+ \"build\": \"yarn clean && tsc --declaration\",\n\"clean\": \"rm -rf *.js *.d.ts build doc from subs utils\",\n- \"pub\": \"yarn run build && yarn publish --access public\"\n+ \"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n+ \"pub\": \"yarn build && yarn publish --access public\",\n+ \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n",
"new_path": "packages/rstream/package.json",
"old_path": "packages/rstream/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n\"license\": \"Apache-2.0\",\n\"scripts\": {\n- \"build\": \"yarn run clean && tsc --declaration\",\n- \"test\": \"yarn run clean && tsc -p test && mocha build/test/*.js\",\n+ \"build\": \"yarn clean && tsc --declaration\",\n\"clean\": \"rm -rf *.js *.d.ts build doc func iter rfn xform\",\n- \"pub\": \"yarn run build && yarn publish --access public\"\n+ \"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n+ \"pub\": \"yarn build && yarn publish --access public\",\n+ \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n",
"new_path": "packages/transducers/package.json",
"old_path": "packages/transducers/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n\"license\": \"Apache-2.0\",\n\"scripts\": {\n- \"build\": \"yarn run clean && tsc --declaration\",\n- \"test\": \"yarn run clean && tsc -p test && mocha build/test/*.js\",\n+ \"build\": \"yarn clean && tsc --declaration\",\n\"clean\": \"rm -rf *.js *.d.ts build doc\",\n- \"pub\": \"yarn run build && yarn publish --access public\"\n+ \"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n+ \"pub\": \"yarn build && yarn publish --access public\",\n+ \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n",
"new_path": "packages/unionstruct/package.json",
"old_path": "packages/unionstruct/package.json"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
build: update commands in all packages
| 1
|
build
| null |
679,913
|
29.01.2018 18:02:28
| 0
|
6a125e831c3fd31015bd03b01c89c9ee333bab0a
|
test: add test stubs, fix existing
|
[
{
"change_type": "ADD",
"diff": "+describe(\"api\", () => {\n+ it(\"tests pending\");\n+});\n",
"new_path": "packages/api/test/index.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+describe(\"csp\", () => {\n+ it(\"tests pending\");\n+});\n",
"new_path": "packages/csp/test/index.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -3,8 +3,27 @@ import * as assert from \"assert\";\nimport { DCons } from \"../src/index\";\ndescribe(\"DCons\", () => {\n- it(\"foo\", () => {\n- const a = new DCons([1, 2, 3, 4, 5, 6]);\n+ let a: DCons<any>, src;\n+ beforeEach(() => {\n+ src = [1, 2, 3, 4, 5];\n+ a = new DCons(src);\n+ });\n+\n+ it(\"is instanceof\", () => {\nassert(a instanceof DCons);\n});\n+\n+ it(\"has length\", () => {\n+ assert.equal(a.length, 5);\n+ a = new DCons();\n+ assert.equal(a.length, 0);\n+ });\n+\n+ it(\"is iterable\", () => {\n+ assert.deepEqual([...a], src);\n+ });\n+\n+ it(\"works as stack\");\n+\n+ it(\"works as queue\");\n});\n\\ No newline at end of file\n",
"new_path": "packages/dcons/test/index.ts",
"old_path": "packages/dcons/test/index.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -73,8 +73,8 @@ describe(\"iterators\", function () {\nassert.deepEqual([...ti.dropNth(-1, ti.range(6))], [], \"dropNth(-1)\");\n});\nit(\"dropWhile\", () => {\n- assert.deepEqual([...ti.dropWhile((x) => false, [])], [], \"empty\");\n- assert.deepEqual([...ti.dropWhile((x) => true, [1, 2, 3])], [], \"always\");\n+ assert.deepEqual([...ti.dropWhile((_) => false, [])], [], \"empty\");\n+ assert.deepEqual([...ti.dropWhile((_) => true, [1, 2, 3])], [], \"always\");\nassert.deepEqual([...ti.dropWhile((x) => x < 3, ti.range(6))], [3, 4, 5], \"x<3\");\nassert.deepEqual([...ti.dropWhile((x) => x > 3, ti.range(6))], [0, 1, 2, 3, 4, 5], \"none\");\n});\n@@ -84,7 +84,7 @@ describe(\"iterators\", function () {\n});\nit(\"every\", () => {\nlet nums = ti.iterator([2, 4, 6, 8, 10]) as IterableIterator<number>;\n- assert(!ti.every((x) => true, []), \"empty\");\n+ assert(!ti.every((_) => true, []), \"empty\");\nassert(ti.every((x) => (x % 2) === 0, nums), \"even\");\nassert.deepEqual(nums.next(), { value: undefined, done: true }, \"nums done\");\nnums = ti.iterator([2, 3, 4]) as IterableIterator<number>;\n@@ -92,7 +92,7 @@ describe(\"iterators\", function () {\nassert.deepEqual(nums.next(), { value: 4, done: false }, \"next = 4\");\n});\nit(\"filter\", () => {\n- assert.deepEqual([...ti.filter((x) => true, [])], [], \"empty\");\n+ assert.deepEqual([...ti.filter((_) => true, [])], [], \"empty\");\nassert.deepEqual([...ti.filter((x) => (x % 3) === 0, ti.range(10))], [0, 3, 6, 9], \"mult3\");\n});\nit(\"flatten\", () => {\n@@ -266,7 +266,7 @@ describe(\"iterators\", function () {\n});\nit(\"takeWhile\", () => {\nlet input = ti.range(10);\n- assert.deepEqual([...ti.takeWhile((x) => true, [])], [], \"empty\");\n+ assert.deepEqual([...ti.takeWhile((_) => true, [])], [], \"empty\");\nassert.deepEqual([...ti.takeWhile((x) => x < 5, input)], [0, 1, 2, 3, 4], \"x<5\");\nassert.deepEqual([...input], [6, 7, 8, 9], \"rest\");\n});\n",
"new_path": "packages/iterators/test/index.ts",
"old_path": "packages/iterators/test/index.ts"
},
{
"change_type": "ADD",
"diff": "+describe(\"rle-pack\", () => {\n+ it(\"tests pending\");\n+});\n",
"new_path": "packages/rle-pack/test/index.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+describe(\"rstream-log\", () => {\n+ it(\"tests pending\");\n+});\n",
"new_path": "packages/rstream-log/test/index.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+describe(\"transducers\", () => {\n+ it(\"tests pending\");\n+});\n",
"new_path": "packages/transducers/test/index.ts",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
test: add test stubs, fix existing
| 1
|
test
| null |
679,913
|
29.01.2018 18:04:36
| 0
|
e647767926a51f5e6585bd9007ca9dd1af5f5470
|
test: add travis.yml, update main package / readme
|
[
{
"change_type": "ADD",
"diff": "+language: node_js\n+node_js:\n+ - \"node\"\n+ - \"8\"\n",
"new_path": ".travis.yml",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -44,9 +44,7 @@ All packages are:\n```\ngit clone https://github.com/thi-ng/umbrella.git\ncd umbrella\n-yarn install\n-lerna bootstrap\n-lerna exec yarn build --sort\n+yarn build\n```\n## Testing\n@@ -54,7 +52,7 @@ lerna exec yarn build --sort\n(TODO not all packages have tests yet)\n```\n-lerna exec yarn test\n+yarn test\n# or individually\n-lerna exec yarn test --scope @thi.ng/checks\n+lerna run test --scope @thi.ng/rstream\n```\n",
"new_path": "README.md",
"old_path": "README.md"
},
{
"change_type": "MODIFY",
"diff": "],\n\"devDependencies\": {\n\"lerna\": \"^2.8.0\",\n- \"tslint\": \"^5.9.1\"\n+ \"tslint\": \"^5.9.1\",\n+ \"typescript\": \"^2.6.2\"\n},\n\"scripts\": {\n+ \"build\": \"yarn install && lerna bootstrap && lerna run build --sort\",\n\"depgraph\": \"scripts/depgraph && git add assets/deps.png && git commit -m 'docs: update dep graph' && git push\",\n- \"pub\": \"lerna publish && yarn depgraph\"\n+ \"pub\": \"lerna publish && yarn depgraph\",\n+ \"test\": \"yarn build && lerna run test\"\n}\n}\n\\ No newline at end of file\n",
"new_path": "package.json",
"old_path": "package.json"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
test: add travis.yml, update main package / readme
| 1
|
test
| null |
679,913
|
29.01.2018 18:05:11
| 0
|
dfbd7efe624df6b94ad23c9255013ea2eb5480fe
|
docs(transducers): update padLast docs
|
[
{
"change_type": "MODIFY",
"diff": "@@ -6,14 +6,18 @@ import { isReduced } from \"../reduced\";\n* of `n`. Only makes sense for finite streams / reductions. Does nothing\n* if the to be transformed data source has exactly multiple of `n`\n* values, but if not pads / supplies additional `fill` values at the end\n- * until the next multiple is reached.\n+ * until the next multiple is reached. No padding takes place if input\n+ * is empty, since length 0 is always a multiple.\n*\n* ```\n* [...iterator(padLast(8, 0), [1, 2, 3, 4, 5])]\n* // [ 1, 2, 3, 4, 5, 0, 0, 0 ]\n*\n* [...iterator(padLast(8, 0), [1])]\n- * // [ 0, 0, 0, 0, 0, 0, 0, 0 ]\n+ * // [ 1, 0, 0, 0, 0, 0, 0, 0 ]\n+ *\n+ * [...iterator(padLast(8, 0), [])]\n+ * // []\n*\n* [...iterator(padLast(2, 0), [1, 2, 3])]\n* // [ 1, 2, 3, 0 ]\n",
"new_path": "packages/transducers/src/xform/pad-last.ts",
"old_path": "packages/transducers/src/xform/pad-last.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs(transducers): update padLast docs
| 1
|
docs
|
transducers
|
679,913
|
29.01.2018 19:04:29
| 0
|
1e9dc85266f1239e61d1d52eff8721a0f736f989
|
docs: add links for badges
|
[
{
"change_type": "MODIFY",
"diff": "# @thi.ng/umbrella\n-\n-\n+[](https://travis-ci.org/thi-ng/umbrella)\n+[](https://conventionalcommits.org/)\nMono-repository for thi.ng TypeScript/ES6 projects, a collection of largely\ndata / transformation oriented packages.\n",
"new_path": "README.md",
"old_path": "README.md"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs: add links for badges
| 1
|
docs
| null |
679,913
|
29.01.2018 19:33:02
| 0
|
7bdc5617ce90f2fb4725d90885bc2df38c51c924
|
docs(iterators): update readme
|
[
{
"change_type": "MODIFY",
"diff": "## Overview\n-Collection of approx. 50 composable, iterator-centric data processing functions,\n+Collection of ~50 composable, iterator-centric data processing functions,\nlargely implemented as ES6 iterators / generators, inspired by\n[clojure.core](http://clojure.github.io/clojure/clojure.core-api.html) API.\nWritten in TypeScript.\n@@ -17,17 +17,15 @@ See [changelog](https://github.com/thi-ng/iterators/blob/master/CHANGELOG.md) fo\nyarn add @thi.ng/iterators\n```\n-All functions are defined as sub-modules and exposed as default exports. This is an additional feature. The full library can still be imported as before. Function sub-modules use *Kebab case* whereas function names are in *Camel case*.\n+All functions are defined as sub-modules and re-exported to allow the full\n+library to be imported if desired. Sub-module file names use *Kebab case*,\n+whereas function names are in *Camel case*.\n```js\n-// import entire library\n-let ti = require(\"@thi.ng/iterators\");\n-\n-// single function (ES5)\n-let map = require(\"@thi.ng/iterators/map\").default;\n-\n+// import all\n+import * as ti from \"@thi.ng/iterators\";\n// single function (ES6 / TS)\n-import map from \"@thi.ng/iterators/map\";\n+import { partitionBy } from \"@thi.ng/iterators/partition-by\";\n```\n## API\n",
"new_path": "packages/iterators/README.md",
"old_path": "packages/iterators/README.md"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs(iterators): update readme
| 1
|
docs
|
iterators
|
679,913
|
29.01.2018 19:38:52
| 0
|
1a0004f79110adaccb94ebd0c0e4c3b0b90dda16
|
test(rstream): increase timeout for travis
|
[
{
"change_type": "MODIFY",
"diff": "@@ -2,7 +2,9 @@ import * as assert from \"assert\";\nimport * as rs from \"../src/index\";\n-describe(\"SidechainPartition\", () => {\n+describe(\"SidechainPartition\", function () {\n+\n+ this.timeout(10000); // extended delay for travis\nit(\"partitions (manual)\", (done) => {\nlet src = new rs.Stream();\n",
"new_path": "packages/rstream/test/sidechain-partition.ts",
"old_path": "packages/rstream/test/sidechain-partition.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
test(rstream): increase timeout for travis
| 1
|
test
|
rstream
|
815,745
|
29.01.2018 19:45:36
| -7,200
|
926e4d128b2f8fd13da291a527d906bec1912321
|
fix: check if value is defined
* fix: check if value is defines
closes
|
[
{
"change_type": "MODIFY",
"diff": "@@ -46,9 +46,6 @@ export class ItemsList {\n}\nfindItem(value: any, bindValue: string): NgOption {\n- if (!value) {\n- return null;\n- }\nif (bindValue) {\nreturn this.items.find(item => item.value[bindValue] === value);\n}\n",
"new_path": "src/ng-select/items-list.ts",
"old_path": "src/ng-select/items-list.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -341,6 +341,28 @@ describe('NgSelectComponent', function () {\nexpect(fixture.componentInstance.select.selectedItems).toEqual(result);\n}));\n+ it('should select by bindValue ', fakeAsync(() => {\n+ const fixture = createTestingModule(\n+ NgSelectSelectedSimpleCmp,\n+ `<ng-select [items]=\"cities\"\n+ bindLabel=\"name\"\n+ bindValue=\"id\"\n+ placeholder=\"select value\"\n+ [(ngModel)]=\"selectedCity\">\n+ </ng-select>`);\n+\n+ fixture.componentInstance.cities = [{ id: 0, name: 'Vilnius' }];\n+ fixture.componentInstance.selectedCity = 0;\n+\n+ tickAndDetectChanges(fixture);\n+\n+ const result = [jasmine.objectContaining({\n+ value: { id: 0, name: 'Vilnius' },\n+ selected: true\n+ })];\n+ expect(fixture.componentInstance.select.selectedItems).toEqual(result);\n+ }));\n+\nit('should select by bindLabel when binding to object', fakeAsync(() => {\nconst fixture = createTestingModule(\nNgSelectSelectedObjectCmp,\n",
"new_path": "src/ng-select/ng-select.component.spec.ts",
"old_path": "src/ng-select/ng-select.component.spec.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -419,7 +419,7 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, AfterVie\nthis.bindLabel = this.bindLabel || this._defaultLabel;\nthis._simple = firstItem && !(firstItem instanceof Object);\nthis.itemsList.setItems(items, this.bindLabel, this._simple);\n- if (this._ngModel && items.length > 0) {\n+ if (this._isDefined(this._ngModel) && items.length > 0) {\nthis.itemsList.clearSelected();\nthis._selectWriteValue(this._ngModel);\n}\n@@ -440,7 +440,7 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, AfterVie\n}));\nthis.itemsList.setItems(this.items, this.bindLabel);\n- if (this._ngModel) {\n+ if (this._isDefined(this._ngModel)) {\nthis.itemsList.clearSelected();\nthis._selectWriteValue(this._ngModel);\n}\n@@ -518,7 +518,7 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, AfterVie\n}\nprivate _validateWriteValue(value: any) {\n- if (!value) {\n+ if (!this._isDefined(value)) {\nreturn;\n}\n@@ -539,7 +539,7 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, AfterVie\n}\nprivate _selectWriteValue(ngModel: any | any[]) {\n- if (!ngModel) {\n+ if (!this._isDefined(ngModel)) {\nreturn;\n}\n@@ -660,7 +660,7 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, AfterVie\nprivate _notifyModelChanged() {\nlet ngModel = this._value;\n- if (!ngModel) {\n+ if (!this._isDefined(ngModel)) {\nthis._onChange(null);\n} else if (this.bindValue) {\nngModel = Array.isArray(ngModel) ?\n@@ -705,4 +705,8 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, AfterVie\nthis.clearAllText = this.clearAllText || config.clearAllText;\nthis.disableVirtualScroll = this.disableVirtualScroll || config.disableVirtualScroll;\n}\n+\n+ private _isDefined(value: any) {\n+ return value !== null && value !== undefined;\n+ }\n}\n",
"new_path": "src/ng-select/ng-select.component.ts",
"old_path": "src/ng-select/ng-select.component.ts"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
fix: check if value is defined (#213)
* fix: check if value is defines
closes #211
| 1
|
fix
| null |
815,746
|
29.01.2018 19:45:58
| -7,200
|
44ebfe37d3ba6d5c5064183dad10dbac90979b3e
|
chore(release): 0.16.0
|
[
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"0.16.0\"></a>\n+# [0.16.0](https://github.com/ng-select/ng-select/compare/v0.15.2...v0.16.0) (2018-01-29)\n+\n+\n+### Bug Fixes\n+\n+* check if value is defined ([#213](https://github.com/ng-select/ng-select/issues/213)) ([926e4d1](https://github.com/ng-select/ng-select/commit/926e4d1)), closes [#211](https://github.com/ng-select/ng-select/issues/211)\n+\n+\n+### Features\n+\n+* using a getter/setter for isLoading which enables exposing the same and having a change emitter ([#206](https://github.com/ng-select/ng-select/issues/206)) ([cd3dec1](https://github.com/ng-select/ng-select/commit/cd3dec1)), closes [#205](https://github.com/ng-select/ng-select/issues/205)\n+\n+\n+\n<a name=\"0.15.2\"></a>\n## [0.15.2](https://github.com/ng-select/ng-select/compare/v0.15.1...v0.15.2) (2018-01-18)\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@ng-select/ng-select\",\n- \"version\": \"0.15.2\",\n+ \"version\": \"0.16.0\",\n\"description\": \"Angular ng-select - All in One UI Select, Multiselect and Autocomplete\",\n\"author\": \"@ng-select/ng-select\",\n\"license\": \"MIT\",\n",
"new_path": "src/package.json",
"old_path": "src/package.json"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
chore(release): 0.16.0
| 1
|
chore
|
release
|
679,913
|
29.01.2018 20:14:16
| 0
|
382aa05e2bc9e185f4ce9b65d30bf1a90fc62367
|
fix(rstream): fatal recursion w/ error handling
use Subscription.dispatch() only for next() calls, wrapped in try..catch
update Subscription.error() & done() to call children WITHOUT try...catch
revert obsolete test timeout adjustment
|
[
{
"change_type": "MODIFY",
"diff": "@@ -125,7 +125,9 @@ export class Subscription<A, B> implements\n}\n}\nthis.state = State.DONE;\n- this.dispatch(undefined, \"done\", [...this.subs]);\n+ for (let s of [...this.subs]) {\n+ s.done && s.done();\n+ }\nthis.parent && this.parent.unsubscribe(this);\ndelete this.parent;\ndelete this.subs;\n@@ -137,7 +139,9 @@ export class Subscription<A, B> implements\nerror(e: any) {\nthis.state = State.ERROR;\nif (this.subs && this.subs.length) {\n- this.dispatch(e, \"error\");\n+ for (let s of [...this.subs]) {\n+ s.error && s.error(e);\n+ }\n} else {\nconsole.log(this.id, \"unhandled error:\", e);\nif (this.parent) {\n@@ -153,11 +157,12 @@ export class Subscription<A, B> implements\nreturn wrapped;\n}\n- protected dispatch(x: B, op = \"next\", subs = this.subs) {\n+ protected dispatch(x: B) {\n+ let subs = this.subs;\nfor (let i = 0, n = subs.length; i < n; i++) {\nconst s = subs[i];\ntry {\n- s[op] && s[op](x);\n+ s.next && s.next(x);\n} catch (e) {\ns.error ? s.error(e) : this.error(e);\n}\n",
"new_path": "packages/rstream/src/subscription.ts",
"old_path": "packages/rstream/src/subscription.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -4,8 +4,6 @@ import * as rs from \"../src/index\";\ndescribe(\"SidechainPartition\", function () {\n- this.timeout(10000); // extended delay for travis\n-\nit(\"partitions (manual)\", (done) => {\nlet src = new rs.Stream();\nlet side = new rs.Stream();\n",
"new_path": "packages/rstream/test/sidechain-partition.ts",
"old_path": "packages/rstream/test/sidechain-partition.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
fix(rstream): fatal recursion w/ error handling
- use Subscription.dispatch() only for next() calls, wrapped in try..catch
- update Subscription.error() & done() to call children WITHOUT try...catch
- revert obsolete test timeout adjustment
| 1
|
fix
|
rstream
|
679,913
|
29.01.2018 20:20:55
| 0
|
4c242c93539567c3e45237561e4bb5cdd102fb46
|
test(rstream): remove sidechainPartition interval test due to unpredictable timing
|
[
{
"change_type": "MODIFY",
"diff": "@@ -29,34 +29,6 @@ describe(\"SidechainPartition\", function () {\nside.done();\n});\n- it(\"partitions (interval)\", (done) => {\n- let src = rs.fromInterval(10);\n- let side = rs.fromInterval(27);\n- let buf = [];\n- src.subscribe(rs.sidechainPartition(side))\n- .subscribe({\n- next(x) {\n- buf.push(x);\n- },\n- done() {\n- try {\n- assert.deepEqual(\n- buf,\n- [[0, 1], [2, 3, 4], [5, 6]]\n- );\n- } catch (_) {\n- // possible alternative due to timing issues\n- assert.deepEqual(\n- buf,\n- [[0, 1], [2, 3], [4, 5, 6]]\n- );\n- }\n- done();\n- }\n- });\n- setTimeout(() => src.done(), 100);\n- });\n-\nit(\"partitions w/ predicate\", (done) => {\nlet src = new rs.Stream();\nlet side = new rs.Stream();\n",
"new_path": "packages/rstream/test/sidechain-partition.ts",
"old_path": "packages/rstream/test/sidechain-partition.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
test(rstream): remove sidechainPartition interval test due to unpredictable timing
| 1
|
test
|
rstream
|
679,913
|
29.01.2018 22:37:43
| 0
|
c863018c781b830171698b2824220eaa4603b104
|
test(iterator): add/update tests
|
[
{
"change_type": "MODIFY",
"diff": "@@ -40,6 +40,12 @@ describe(\"iterators\", function () {\nassert.deepEqual([...ti.concat<any>([1, 2, 3], \"abc\", ti.range(3))], [1, 2, 3, \"a\", \"b\", \"c\", 0, 1, 2], \"3 args any\");\nassert.deepEqual([...ti.concat.apply(null, [\"abc\", null, [1, 2, 3]])], [\"a\", \"b\", \"c\", 1, 2, 3], \"skip null\");\n});\n+ it(\"constantly\", () => {\n+ const f = ti.constantly(1);\n+ assert.equal(f(), 1, \"no arg\");\n+ assert.equal(f(2), 1, \"1 arg\");\n+ assert.equal(f(2, 3), 1, \"2 args\");\n+ });\nit(\"cycle\", () => {\nassert.deepEqual([...ti.cycle([])], [], \"empty\");\nassert.deepEqual([...ti.take(7, ti.cycle(ti.range(3)))], [0, 1, 2, 0, 1, 2, 0], \"cycle range(3)\");\n@@ -56,6 +62,12 @@ describe(\"iterators\", function () {\nassert.deepEqual([...ti.dedupeWith(eq, [])], [], \"empty\");\nassert.deepEqual([...ti.dedupeWith(eq, coll)], [{ a: 1 }, { a: 2, b: 2 }, { a: 3 }], \"array[obj]\");\n});\n+ it(\"dense\", () => {\n+ assert.deepEqual(\n+ [...ti.dense([, 1, , 2, false, null, undefined, 0, 3])],\n+ [1, 2, false, 0, 3]\n+ );\n+ });\nit(\"drop\", () => {\nassert.deepEqual([...ti.drop(100, [])], [], \"empty\");\nassert.deepEqual([...ti.drop(4, [1, 2, 3])], [], \"drop(4)\");\n@@ -110,6 +122,21 @@ describe(\"iterators\", function () {\n\"chars\"\n);\n});\n+ it(\"fnil\", () => {\n+ let f = ti.fnil((x) => x + 1, () => 0);\n+ assert.equal(f(), 1);\n+ assert.equal(f(1), 2);\n+ f = ti.fnil((a, b) => a + b, () => 0, () => 10);\n+ assert.equal(f(), 10);\n+ assert.equal(f(1), 11);\n+ assert.equal(f(1, 2), 3);\n+ f = ti.fnil((a, b, c) => a + b + c, () => 0, () => 10, () => 100);\n+ assert.equal(f(), 110);\n+ assert.equal(f(1), 111);\n+ assert.equal(f(1, 2), 103);\n+ assert.equal(f(1, 2, 3), 6);\n+ assert.throws(() => ti.fnil(() => { }));\n+ });\nit(\"fork\", () => {\nconst f = ti.fork([1, 2, 3, 4], 3),\nfa = f(),\n@@ -134,6 +161,15 @@ describe(\"iterators\", function () {\nit(\"groupBy\", () => {\nassert.deepEqual(ti.groupBy((x) => x & ~1, [1, 2, 3, 4, 5, 9, 3]), { \"0\": [1], \"2\": [2, 3, 3], \"4\": [4, 5], \"8\": [9] }, \"mult 2\");\n});\n+ it(\"identity\", () => {\n+ const x = { a: 1 };\n+ assert.strictEqual(ti.identity(x), x);\n+ assert.strictEqual(ti.identity(null), null);\n+ assert.strictEqual(ti.identity(undefined), undefined);\n+ });\n+ it(\"indexed\", () => {\n+ assert.deepEqual([...ti.indexed([10, 20, 30])], [[0, 10], [1, 20], [2, 30]]);\n+ });\nit(\"interleave\", () => {\nassert.throws(() => ti.interleave().next(), \"no inputs\");\nassert.deepEqual([...ti.interleave(ti.range(), ti.range(100, 200), ti.range(200, 205))], [0, 100, 200, 1, 101, 201, 2, 102, 202, 3, 103, 203, 4, 104, 204], \"ranges\");\n@@ -246,6 +282,15 @@ describe(\"iterators\", function () {\nassert.deepEqual([...ti.repeatedly(f, 0)], [], \"repeatedly(f,0)\");\nassert.deepEqual([...ti.repeatedly(f, -1)], [], \"repeatedly(f,-1)\");\n});\n+ it(\"reverse\", () => {\n+ assert.deepEqual([...ti.reverse([])], []);\n+ assert.deepEqual([...ti.reverse(ti.range(0))], []);\n+ assert.deepEqual([...ti.reverse(\"\")], []);\n+ assert.deepEqual([...ti.reverse(\"a\")], [\"a\"]);\n+ assert.deepEqual([...ti.reverse([0])], [0]);\n+ assert.deepEqual([...ti.reverse(ti.range(3))], [2, 1, 0]);\n+ assert.deepEqual([...ti.reverse(\"abc\")], [\"c\", \"b\", \"a\"]);\n+ });\nit(\"some\", () => {\nlet nums = ti.iterator([1, 2, 3]) as IterableIterator<number>;\nassert.equal(ti.some((x) => (x % 2) === 0, nums), 2, \"even\");\n",
"new_path": "packages/iterators/test/index.ts",
"old_path": "packages/iterators/test/index.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
test(iterator): add/update tests
| 1
|
test
|
iterator
|
679,913
|
29.01.2018 23:38:52
| 0
|
0b5ca0379e66dff64bed312bddb49661713beabb
|
build: add nyc coverage dev deps & commands
|
[
{
"change_type": "MODIFY",
"diff": "],\n\"devDependencies\": {\n\"lerna\": \"^2.8.0\",\n+ \"nyc\": \"^11.4.1\",\n\"tslint\": \"^5.9.1\",\n\"typescript\": \"^2.6.2\"\n},\n",
"new_path": "package.json",
"old_path": "package.json"
},
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc decorators mixins\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build coverage doc decorators mixins\",\n+ \"cover\": \"yarn test && nyc report --reporter=lcov\",\n\"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n\"pub\": \"yarn build && yarn publish --access public\",\n- \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n+ \"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n\"@types/node\": \"^9.3.0\",\n\"mocha\": \"^5.0.0\",\n+ \"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n\"typedoc\": \"^0.9.0\",\n\"typescript\": \"^2.6.2\",\n",
"new_path": "packages/api/package.json",
"old_path": "packages/api/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build coverage doc\",\n+ \"cover\": \"yarn test && nyc report --reporter=lcov\",\n\"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n\"pub\": \"yarn build && yarn publish --access public\",\n- \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n+ \"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n\"@types/node\": \"^9.3.0\",\n\"mocha\": \"^5.0.0\",\n+ \"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n\"typedoc\": \"^0.9.0\",\n\"typescript\": \"^2.6.2\",\n",
"new_path": "packages/atom/package.json",
"old_path": "packages/atom/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build coverage doc\",\n+ \"cover\": \"yarn test && nyc report --reporter=lcov\",\n\"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n\"pub\": \"yarn build && yarn publish --access public\",\n- \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n+ \"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n\"@types/node\": \"^9.3.0\",\n\"mocha\": \"^5.0.0\",\n+ \"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n\"typedoc\": \"^0.9.0\",\n\"typescript\": \"^2.6.2\",\n",
"new_path": "packages/bitstream/package.json",
"old_path": "packages/bitstream/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build coverage doc\",\n+ \"cover\": \"yarn test && nyc report --reporter=lcov\",\n\"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n\"pub\": \"yarn build && yarn publish --access public\",\n- \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n+ \"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n\"@types/node\": \"^9.3.0\",\n\"mocha\": \"^5.0.0\",\n+ \"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n\"typedoc\": \"^0.9.0\",\n\"typescript\": \"^2.6.2\",\n",
"new_path": "packages/checks/package.json",
"old_path": "packages/checks/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc utils\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build coverage doc utils\",\n+ \"cover\": \"yarn test && nyc report --reporter=lcov\",\n\"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n\"pub\": \"yarn build && yarn publish --access public\",\n- \"test\": \"rm -rf build && tsc -p test && mocha build/test/index.js\",\n+ \"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/index.js\",\n\"testasync\": \"tsc -p test && node build/test/async.js\",\n\"testfile\": \"tsc -p test && node build/test/file.js\",\n\"testgraph\": \"tsc -p test && node build/test/graph.js\",\n\"@types/mocha\": \"^2.2.46\",\n\"@types/node\": \"^9.3.0\",\n\"mocha\": \"^5.0.0\",\n+ \"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n\"typedoc\": \"^0.9.0\",\n\"typescript\": \"^2.6.2\",\n",
"new_path": "packages/csp/package.json",
"old_path": "packages/csp/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build coverage doc\",\n+ \"cover\": \"yarn test && nyc report --reporter=lcov\",\n\"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n\"pub\": \"yarn build && yarn publish --access public\",\n- \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n+ \"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n\"@types/node\": \"^9.3.0\",\n\"mocha\": \"^5.0.0\",\n+ \"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n\"typedoc\": \"^0.9.0\",\n\"typescript\": \"^2.6.2\",\n",
"new_path": "packages/dcons/package.json",
"old_path": "packages/dcons/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build coverage doc\",\n+ \"cover\": \"yarn test && nyc report --reporter=lcov\",\n\"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n\"pub\": \"yarn build && yarn publish --access public\",\n- \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n+ \"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n\"@types/node\": \"^9.3.0\",\n\"mocha\": \"^5.0.0\",\n+ \"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n\"typedoc\": \"^0.9.0\",\n\"typescript\": \"^2.6.2\",\n",
"new_path": "packages/hiccup/package.json",
"old_path": "packages/hiccup/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build coverage doc\",\n+ \"cover\": \"yarn test && nyc report --reporter=lcov\",\n\"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n\"pub\": \"yarn build && yarn publish --access public\",\n- \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n+ \"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n\"@types/node\": \"^9.3.0\",\n\"mocha\": \"^5.0.0\",\n+ \"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n\"typedoc\": \"^0.9.0\",\n\"typescript\": \"^2.6.2\",\n",
"new_path": "packages/iterators/package.json",
"old_path": "packages/iterators/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build coverage doc\",\n+ \"cover\": \"yarn test && nyc report --reporter=lcov\",\n\"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n\"pub\": \"yarn build && yarn publish --access public\",\n- \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n+ \"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n\"@types/node\": \"^9.3.0\",\n\"benchmark\": \"^2.1.4\",\n\"mocha\": \"^5.0.0\",\n+ \"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n\"typedoc\": \"^0.9.0\",\n\"typescript\": \"^2.6.2\",\n",
"new_path": "packages/rle-pack/package.json",
"old_path": "packages/rle-pack/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc from\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build coverage doc from\",\n+ \"cover\": \"yarn test && nyc report --reporter=lcov\",\n\"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n\"pub\": \"yarn build && yarn publish --access public\",\n- \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n+ \"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n\"@types/node\": \"^9.3.0\",\n\"mocha\": \"^5.0.0\",\n+ \"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n\"typedoc\": \"^0.9.0\",\n\"typescript\": \"^2.6.2\",\n",
"new_path": "packages/rstream-csp/package.json",
"old_path": "packages/rstream-csp/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc output transform\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build coverage doc output transform\",\n+ \"cover\": \"yarn test && nyc report --reporter=lcov\",\n\"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n\"pub\": \"yarn build && yarn publish --access public\",\n- \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n+ \"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n\"@types/node\": \"^9.3.0\",\n\"mocha\": \"^5.0.0\",\n+ \"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n\"typedoc\": \"^0.9.0\",\n\"typescript\": \"^2.6.2\",\n",
"new_path": "packages/rstream-log/package.json",
"old_path": "packages/rstream-log/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc from subs utils\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build coverage doc from subs utils\",\n+ \"cover\": \"yarn test && nyc report --reporter=lcov\",\n\"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n\"pub\": \"yarn build && yarn publish --access public\",\n- \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n+ \"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n\"@types/node\": \"^9.3.0\",\n\"mocha\": \"^5.0.0\",\n+ \"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n\"typedoc\": \"^0.9.0\",\n\"typescript\": \"^2.6.2\",\n",
"new_path": "packages/rstream/package.json",
"old_path": "packages/rstream/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc func iter rfn xform\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build coverage doc func iter rfn xform\",\n+ \"cover\": \"yarn test && nyc report --reporter=lcov\",\n\"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n\"pub\": \"yarn build && yarn publish --access public\",\n- \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n+ \"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n\"@types/node\": \"^9.3.0\",\n\"mocha\": \"^5.0.0\",\n+ \"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n\"typedoc\": \"^0.9.0\",\n\"typescript\": \"^2.6.2\",\n",
"new_path": "packages/transducers/package.json",
"old_path": "packages/transducers/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build coverage doc\",\n+ \"cover\": \"yarn test && nyc report --reporter=lcov\",\n\"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n\"pub\": \"yarn build && yarn publish --access public\",\n- \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n+ \"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n},\n\"devDependencies\": {\n\"@types/mocha\": \"^2.2.46\",\n\"@types/node\": \"^9.3.0\",\n\"mocha\": \"^5.0.0\",\n+ \"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n\"typedoc\": \"^0.9.0\",\n\"typescript\": \"^2.6.2\",\n",
"new_path": "packages/unionstruct/package.json",
"old_path": "packages/unionstruct/package.json"
},
{
"change_type": "MODIFY",
"diff": "Binary files a/yarn.lock and b/yarn.lock differ\n",
"new_path": "yarn.lock",
"old_path": "yarn.lock"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
build: add nyc coverage dev deps & commands
| 1
|
build
| null |
679,913
|
29.01.2018 23:54:42
| 0
|
22b02a2df97d424248986d8a2928a5bbc38da21a
|
build: add main package commands, update readme
|
[
{
"change_type": "MODIFY",
"diff": "@@ -48,7 +48,7 @@ cd umbrella\nyarn build\n```\n-## Testing\n+### Testing\n(TODO not all packages have tests yet)\n@@ -57,3 +57,19 @@ yarn test\n# or individually\nlerna run test --scope @thi.ng/rstream\n```\n+\n+### Coverage\n+\n+```\n+yarn cover\n+```\n+\n+The resulting reports will be saved under `/packages/*/coverage/lcov-report/`.\n+\n+### Documentation\n+\n+```\n+yarn doc\n+```\n+\n+The resulting docs will be saved under `/packages/*/doc/`.\n\\ No newline at end of file\n",
"new_path": "README.md",
"old_path": "README.md"
},
{
"change_type": "MODIFY",
"diff": "},\n\"scripts\": {\n\"build\": \"yarn install && lerna bootstrap && lerna run build --sort\",\n+ \"cover\": \"yarn test && lerna run cover\",\n\"depgraph\": \"scripts/depgraph && git add assets/deps.png && git commit -m 'docs: update dep graph' && git push\",\n+ \"doc\": \"lerna run doc\",\n\"pub\": \"lerna publish && yarn depgraph\",\n\"test\": \"yarn build && lerna run test\"\n}\n",
"new_path": "package.json",
"old_path": "package.json"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
build: add main package commands, update readme
| 1
|
build
| null |
679,913
|
30.01.2018 00:05:41
| 0
|
7f345bcceaaa5b22a0af4ec1dceff037c9f5c88c
|
chore: update make-module
|
[
{
"change_type": "MODIFY",
"diff": "@@ -92,37 +92,17 @@ cat << EOF > $MODULE/test/tsconfig.json\n}\nEOF\n-echo \"writing .gitignore...\"\n-cat << EOF > $MODULE/.gitignore\n-/bench\n-/build\n-/dev\n-/doc\n-/node_modules\n-.DS_Store\n-/bundle.*\n-*.log\n-*.tgz\n-*.js\n-*.d.ts\n-EOF\n-\necho \"writing .npmignore...\"\ncat << EOF > $MODULE/.npmignore\n-bench/*\n-build/*\n-dev/*\n-node_modules\n+build\n+coverage\n+dev\n+doc\nsrc*\n-test*\n-bundle.*\n-tsconfig.json\n-webpack.config.js\n-*.html\n+test\n+.nyc_output\n*.tgz\n-!doc/*\n-!*.d.ts\n-!*.js\n+*.html\nEOF\necho \"writing README.md...\"\n",
"new_path": "scripts/make-module",
"old_path": "scripts/make-module"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
chore: update make-module
| 1
|
chore
| null |
679,913
|
30.01.2018 04:53:41
| 0
|
bbbc869c5ddee2848f391e7eadd0b12f3ac08d22
|
deploy: add upload-docs script
|
[
{
"change_type": "ADD",
"diff": "+#!/bin/sh\n+\n+readonly modules=\"packages/*\"\n+\n+for m in $modules; do\n+ name=$(echo $m | cut -d '/' -f 2)\n+ echo \"sanitizing: $name\"\n+ find $m/doc -name \"*.html\" -exec sed -i \"s/\\/\\([a-zA-Z_0-9/-]\\+\\)\\/node_modules\\///g\" '{}' \\;\n+ echo \"syncing...\"\n+ aws s3 sync $m/doc s3://docs.thi.ng/umbrella/$name --profile toxi-s3 --acl public-read\n+done\n",
"new_path": "scripts/upload-docs",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
deploy: add upload-docs script
| 1
|
deploy
| null |
679,913
|
30.01.2018 04:55:04
| 0
|
2c88537e42f2cd04e5135c44ffcf2f88e08dc156
|
fix: links in readme
|
[
{
"change_type": "MODIFY",
"diff": "@@ -74,5 +74,6 @@ The resulting reports will be saved under `/packages/*/coverage/lcov-report/`.\nyarn doc\n```\n-The autogenerated documentation (using [TypeDoc]()) will be saved under\n+The autogenerated documentation (using\n+[TypeDoc](https://github.com/TypeStrong/typedoc)) will be saved under\n`/packages/*/doc/` and is also available at [docs.thi.ng](http://docs.thi.ng).\n\\ No newline at end of file\n",
"new_path": "README.md",
"old_path": "README.md"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
fix: links in readme
| 1
|
fix
| null |
679,913
|
31.01.2018 00:49:26
| 0
|
035c51a32bbe536f2c8dcdc88ef6a07d311d4ddc
|
feat(atom): add History, add/update tests
|
[
{
"change_type": "MODIFY",
"diff": "@@ -42,15 +42,18 @@ export class Atom<T> implements\n}\n// mixin stub\n+ /* istanbul ignore next */\naddWatch(id: string, fn: Watch<T>) {\nreturn false;\n}\n// mixin stub\n+ /* istanbul ignore next */\nremoveWatch(id: string) {\nreturn false;\n}\n// mixin stub\n+ /* istanbul ignore next */\nnotifyWatches(oldState: T, newState: T) { }\n}\n",
"new_path": "packages/atom/src/atom.ts",
"old_path": "packages/atom/src/atom.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -34,6 +34,7 @@ export class Cursor<T> implements\n} else if (isFunction(opts[0]) && isFunction(opts[1])) {\n[lookup, update] = opts;\n} else {\n+ /* istanbul ignore next */\nthrow new Error(\"illegal args\");\n}\nthis.local = new Atom<T>(lookup(parent.deref()));\n@@ -62,6 +63,7 @@ export class Cursor<T> implements\nthis.local.removeWatch(this.id);\nthis.parent.removeWatch(this.id);\ndelete this.local;\n+ delete this.parent;\nreturn true;\n}\n@@ -81,6 +83,7 @@ export class Cursor<T> implements\nreturn this.local.removeWatch(id);\n}\n+ /* istanbul ignore next */\nnotifyWatches(oldState: T, newState: T) {\nreturn this.local.notifyWatches(oldState, newState);\n}\n",
"new_path": "packages/atom/src/cursor.ts",
"old_path": "packages/atom/src/cursor.ts"
},
{
"change_type": "ADD",
"diff": "+import { IAtom } from \"./api\";\n+\n+export class History<T> {\n+\n+ state: IAtom<T>;\n+ maxLen: number;\n+ history: T[] = [];\n+ future: T[] = [];\n+\n+ constructor(state: IAtom<T>, maxLen = 100) {\n+ this.state = state;\n+ this.maxLen = maxLen;\n+ }\n+\n+ clear() {\n+ this.history = [];\n+ this.future = [];\n+ }\n+\n+ record() {\n+ if (this.history.length == this.maxLen) {\n+ this.history.shift();\n+ }\n+ this.history.push(this.state.deref());\n+ }\n+\n+ undo() {\n+ if (this.history.length) {\n+ this.future.push(this.state.deref());\n+ return this.state.reset(this.history.pop());\n+ }\n+ }\n+\n+ redo() {\n+ if (this.future.length) {\n+ this.history.push(this.state.deref());\n+ return this.state.reset(this.future.pop());\n+ }\n+ }\n+}\n\\ No newline at end of file\n",
"new_path": "packages/atom/src/history.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "export * from \"./atom\";\nexport * from \"./cursor\";\n+export * from \"./history\";\nexport * from \"./path\";\n\\ No newline at end of file\n",
"new_path": "packages/atom/src/index.ts",
"old_path": "packages/atom/src/index.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -13,6 +13,11 @@ describe(\"atom\", function () {\nassert.equal(a.deref(), 23);\n});\n+ it(\"can be equiv'd\", () => {\n+ assert(a.equiv(a));\n+ assert(!a.equiv(new Atom(23)));\n+ });\n+\nit(\"can be reset\", () => {\nassert.equal(a.reset(24), 24);\nassert.equal(a.deref(), 24);\n",
"new_path": "packages/atom/test/atom.ts",
"old_path": "packages/atom/test/atom.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -14,6 +14,7 @@ describe(\"cursor w/ path\", function () {\nit(\"can be deref'd (a)\", () => {\nc = new Cursor(a, \"a\");\n+ assert.strictEqual(c.parent, a);\nassert.deepStrictEqual(c.deref(), src.a);\n});\n@@ -27,9 +28,21 @@ describe(\"cursor w/ path\", function () {\nassert.equal(c.deref(), src.a.b.c);\n});\n+ it(\"can be deref'd (path array)\", () => {\n+ c = new Cursor(a, [\"a\", \"b\", \"c\"]);\n+ assert.equal(c.deref(), src.a.b.c);\n+ });\n+\nit(\"doesn't fail w/ invalid path\", () => {\nc = new Cursor(a, \"a.b.x.y.z\");\nassert.strictEqual(c.deref(), undefined);\n+ c = new Cursor(new Atom(null), \"a\");\n+ assert.strictEqual(c.deref(), undefined);\n+ });\n+\n+ it(\"can be deref'd w/ getter\", () => {\n+ c = new Cursor(a, (s) => s.a.b, (s, x) => ({ ...s, a: { ...s.a, b: x } }));\n+ assert.strictEqual(c.deref(), src.a.b);\n});\nit(\"can be swapped'd (a.b.c)\", () => {\n@@ -39,6 +52,10 @@ describe(\"cursor w/ path\", function () {\nassert.equal(a.deref().a.b.c, src.a.b.c + 1);\nassert.strictEqual(a.deref().a.d, src.a.d);\nassert.strictEqual(a.deref().f, src.f);\n+ let v = c.deref();\n+ assert.equal(c.reset(v), v);\n+ a.reset(a.deref());\n+ assert.equal(c.deref(), v);\n});\nit(\"can be reset (a.b.c)\", () => {\n@@ -52,13 +69,49 @@ describe(\"cursor w/ path\", function () {\nit(\"can update invalid path (x.y.z)\", () => {\nc = new Cursor(a, \"x.y.z\");\n- assert.equal(c.swap(x => x != null ? x + 1 : 0), 0);\n+ let add = (x) => x != null ? x + 1 : 0;\n+ assert.equal(c.swap(add), 0);\nassert.equal(c.deref(), 0);\n- assert.equal(c.swap(x => x != null ? x + 1 : 0), 1);\n+ assert.equal(c.swap(add), 1);\nassert.equal(c.deref(), 1);\nassert.equal(c.reset(100), 100);\nassert.equal(c.deref(), 100);\nassert.equal(a.deref().x.y.z, 100);\nassert.strictEqual(src.x, undefined);\n});\n+\n+ it(\"reflects parent update\", () => {\n+ c = new Cursor(a, \"a.d\");\n+ assert.deepStrictEqual(c.deref(), src.a.d);\n+ let src2 = { a: { b: { c: 23 }, d: { e: 42 } }, f: 66 };\n+ a.reset(src2);\n+ assert.deepStrictEqual(c.deref(), src2.a.d);\n+ });\n+\n+ it(\"can be released\", () => {\n+ c = new Cursor(a, \"a\");\n+ let id = c.id;\n+ assert.notEqual((<any>a)._watches[id], null);\n+ assert(c.release());\n+ assert.strictEqual(c.parent, undefined);\n+ assert.strictEqual((<any>a)._watches[id], undefined);\n+ });\n+\n+ it(\"can add & remove watch\", () => {\n+ c = new Cursor(a, \"a.b.c\");\n+ assert(c.addWatch(\"foo\", () => { }), \"can't add watch\");\n+ assert((<any>c).local._watches && (<any>c).local._watches.foo, \"watch missing\");\n+ assert(c.removeWatch(\"foo\"), \"can't remove watch\");\n+ assert(!c.removeWatch(\"foo\"), \"should fail to remove invalid watch id\");\n+ });\n+\n+ it(\"can be watched\", () => {\n+ c = new Cursor(a, \"a.b.c\");\n+ c.addWatch(\"foo\", (id, prev, curr) => {\n+ assert.equal(id, \"foo\", \"wrong id\");\n+ assert.equal(prev, 23, \"wrong prev\");\n+ assert.equal(curr, 24, \"wrong curr\");\n+ });\n+ c.swap((x) => x + 1);\n+ });\n});\n",
"new_path": "packages/atom/test/cursor.ts",
"old_path": "packages/atom/test/cursor.ts"
},
{
"change_type": "ADD",
"diff": "+import * as assert from \"assert\";\n+\n+import { Atom } from \"../src/atom\";\n+import { Cursor } from \"../src/cursor\";\n+import { History } from \"../src/history\";\n+\n+describe(\"history\", () => {\n+\n+ let a: Atom<any>;\n+\n+ beforeEach(() => {\n+ a = new Atom({ a: 10, b: { c: 20, d: 30 }, e: 40 });\n+ });\n+\n+ it(\"has initial state\", () => {\n+ let c = new Cursor(a, \"b.c\");\n+ let h = new History(c, 3);\n+ assert.equal(h.history.length, 0);\n+ assert.equal(h.future.length, 0);\n+ assert.equal(h.state.deref(), c.deref());\n+ });\n+\n+ it(\"does record & shift (simple)\", () => {\n+ let c = new Cursor<number>(a, \"b.c\");\n+ let h = new History(c, 3);\n+ h.record();\n+ assert.equal(h.history.length, 1);\n+ assert.deepEqual(h.history, [20]);\n+ c.swap(x => x + 1);\n+\n+ h.record();\n+ assert.equal(h.history.length, 2);\n+ assert.deepEqual(h.history, [20, 21]);\n+ c.swap(x => x + 1);\n+\n+ h.record();\n+ assert.equal(h.history.length, 3);\n+ assert.deepEqual(h.history, [20, 21, 22]);\n+ c.swap(x => x + 1);\n+\n+ h.record();\n+ assert.equal(h.history.length, 3);\n+ assert.deepEqual(h.history, [21, 22, 23]);\n+ });\n+\n+ it(\"does record & shift (nested)\", () => {\n+ let c = new Cursor(a, \"b\");\n+ let h = new History(c, 3);\n+ h.record();\n+ assert.equal(h.history.length, 1);\n+ assert.deepEqual(h.history, [{ c: 20, d: 30 }]);\n+ c.swap(s => ({ ...s, c: 21 }));\n+\n+ h.record();\n+ assert.equal(h.history.length, 2);\n+ assert.deepEqual(h.history, [{ c: 20, d: 30 }, { c: 21, d: 30 }]);\n+ c.swap(s => ({ ...s, d: 31 }));\n+\n+ h.record();\n+ assert.equal(h.history.length, 3);\n+ assert.deepEqual(h.history, [{ c: 20, d: 30 }, { c: 21, d: 30 }, { c: 21, d: 31 }]);\n+ c.swap(s => ({ ...s, x: 100 }));\n+\n+ h.record();\n+ assert.equal(h.history.length, 3);\n+ assert.deepEqual(h.history, [{ c: 21, d: 30 }, { c: 21, d: 31 }, { c: 21, d: 31, x: 100 }]);\n+\n+ h.clear();\n+ assert.equal(h.history.length, 0);\n+ assert.equal(h.future.length, 0);\n+ });\n+\n+ it(\"does undo / redo\", () => {\n+ let c = new Cursor<number>(a, \"b.c\");\n+ let h = new History(c, 3);\n+ h.record();\n+ c.swap(x => x + 1); // 21\n+ h.record();\n+ c.swap(x => x + 1); // 22\n+ h.record();\n+ c.swap(x => x + 1); // 23\n+ assert.equal(c.deref(), 23);\n+ assert.deepEqual(a.deref(), { a: 10, b: { c: 23, d: 30 }, e: 40 });\n+ assert.deepEqual(h.history, [20, 21, 22]);\n+\n+ assert.equal(h.undo(), 22);\n+ assert.equal(c.deref(), 22);\n+ assert.deepEqual(a.deref(), { a: 10, b: { c: 22, d: 30 }, e: 40 });\n+ assert.deepEqual(h.history, [20, 21]);\n+ assert.deepEqual(h.future, [23]);\n+\n+ assert.equal(h.undo(), 21);\n+ assert.equal(c.deref(), 21);\n+ assert.deepEqual(a.deref(), { a: 10, b: { c: 21, d: 30 }, e: 40 });\n+ assert.deepEqual(h.history, [20]);\n+ assert.deepEqual(h.future, [23, 22]);\n+\n+ assert.equal(h.undo(), 20);\n+ assert.equal(c.deref(), 20);\n+ assert.deepEqual(a.deref(), { a: 10, b: { c: 20, d: 30 }, e: 40 });\n+ assert.deepEqual(h.history, []);\n+ assert.deepEqual(h.future, [23, 22, 21]);\n+\n+ assert.strictEqual(h.undo(), undefined);\n+\n+ assert.equal(h.redo(), 21);\n+ assert.equal(c.deref(), 21);\n+ assert.deepEqual(a.deref(), { a: 10, b: { c: 21, d: 30 }, e: 40 });\n+ assert.deepEqual(h.history, [20]);\n+ assert.deepEqual(h.future, [23, 22]);\n+\n+ assert.equal(h.redo(), 22);\n+ assert.equal(c.deref(), 22);\n+ assert.deepEqual(a.deref(), { a: 10, b: { c: 22, d: 30 }, e: 40 });\n+ assert.deepEqual(h.history, [20, 21]);\n+ assert.deepEqual(h.future, [23]);\n+\n+ assert.equal(h.redo(), 23);\n+ assert.equal(c.deref(), 23);\n+ assert.deepEqual(a.deref(), { a: 10, b: { c: 23, d: 30 }, e: 40 });\n+ assert.deepEqual(h.history, [20, 21, 22]);\n+ assert.deepEqual(h.future, []);\n+\n+ assert.strictEqual(h.redo(), undefined);\n+\n+ h.record();\n+ c.swap(x => x + 1); // 24\n+ assert.equal(c.deref(), 24);\n+ assert.deepEqual(a.deref(), { a: 10, b: { c: 24, d: 30 }, e: 40 });\n+ assert.deepEqual(h.history, [21, 22, 23]);\n+\n+ });\n+\n+});\n\\ No newline at end of file\n",
"new_path": "packages/atom/test/history.ts",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(atom): add History, add/update tests
| 1
|
feat
|
atom
|
679,913
|
31.01.2018 01:30:04
| 0
|
74ecdf1868714f409e0d19fb8a9ff3895b6ad352
|
refactor(atom): extract IReset, ISwap from IAtom
|
[
{
"change_type": "MODIFY",
"diff": "@@ -7,7 +7,16 @@ export interface ReadonlyAtom<T> extends\napi.IWatch<T> {\n}\n-export interface IAtom<T> extends ReadonlyAtom<T> {\n+export interface IAtom<T> extends\n+ ReadonlyAtom<T>,\n+ IReset<T>,\n+ ISwap<T> {\n+}\n+\n+export interface IReset<T> {\nreset(val: T): T;\n+}\n+\n+export interface ISwap<T> {\nswap(fn: SwapFn<T>, ...args: any[]): T;\n}\n",
"new_path": "packages/atom/src/api.ts",
"old_path": "packages/atom/src/api.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(atom): extract IReset, ISwap from IAtom
| 1
|
refactor
|
atom
|
679,913
|
31.01.2018 01:30:59
| 0
|
282d98967666d1eb957e0ed081007ac9a542ddbd
|
fix(atom): cursor ctor arg checks
|
[
{
"change_type": "MODIFY",
"diff": "import { IID, IRelease, Watch } from \"@thi.ng/api/api\";\nimport { isArray } from \"@thi.ng/checks/is-array\";\nimport { isFunction } from \"@thi.ng/checks/is-function\";\n+import { isNumber } from \"@thi.ng/checks/is-number\";\nimport { isString } from \"@thi.ng/checks/is-string\";\n+import { isSymbol } from \"@thi.ng/checks/is-symbol\";\nimport { IAtom, SwapFn } from \"./api\";\nimport { Atom } from \"./atom\";\n@@ -27,12 +29,13 @@ export class Cursor<T> implements\nthis.parent = parent;\nthis.id = `cursor-${Cursor.NEXT_ID++}`;\nthis.selfUpdate = false;\n- let lookup, update;\n- if (isString(opts[0]) || isArray(opts[0])) {\n- lookup = getter(opts[0]);\n- update = setter(opts[0]);\n- } else if (isFunction(opts[0]) && isFunction(opts[1])) {\n- [lookup, update] = opts;\n+ let [a, b] = opts, lookup, update;\n+ if (isString(a) || isArray(a) || isNumber(a) || isSymbol(a)) {\n+ lookup = getter(<any>a);\n+ update = setter(<any>a);\n+ } else if (isFunction(a) && isFunction(b)) {\n+ lookup = a;\n+ update = b;\n} else {\n/* istanbul ignore next */\nthrow new Error(\"illegal args\");\n",
"new_path": "packages/atom/src/cursor.ts",
"old_path": "packages/atom/src/cursor.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
fix(atom): cursor ctor arg checks
| 1
|
fix
|
atom
|
679,913
|
31.01.2018 01:31:45
| 0
|
e1b57deaf895dd5b840389316d694d32e375ce15
|
feat(atom): add IReset/ISwap impls for History
|
[
{
"change_type": "MODIFY",
"diff": "-import { IAtom } from \"./api\";\n+import { IAtom, IReset, ISwap, SwapFn } from \"./api\";\n-export class History<T> {\n+export class History<T> implements\n+ IReset<T>,\n+ ISwap<T> {\nstate: IAtom<T>;\nmaxLen: number;\n@@ -17,13 +19,6 @@ export class History<T> {\nthis.future = [];\n}\n- record() {\n- if (this.history.length == this.maxLen) {\n- this.history.shift();\n- }\n- this.history.push(this.state.deref());\n- }\n-\nundo() {\nif (this.history.length) {\nthis.future.push(this.state.deref());\n@@ -37,4 +32,25 @@ export class History<T> {\nreturn this.state.reset(this.future.pop());\n}\n}\n+\n+ reset(val: T) {\n+ const prev = this.state.deref(),\n+ curr = this.state.reset(val);\n+ curr !== prev && this.record(prev);\n+ return curr;\n+ }\n+\n+ swap(fn: SwapFn<T>, ...args: any[]) {\n+ const prev = this.state.deref(),\n+ curr = this.state.swap.apply(this.state, [fn, ...args]);\n+ curr !== prev && this.record(prev);\n+ return curr;\n+ }\n+\n+ protected record(state: T) {\n+ if (this.history.length == this.maxLen) {\n+ this.history.shift();\n+ }\n+ this.history.push(state);\n+ }\n}\n",
"new_path": "packages/atom/src/history.ts",
"old_path": "packages/atom/src/history.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(atom): add IReset/ISwap impls for History
| 1
|
feat
|
atom
|
791,676
|
31.01.2018 03:56:47
| -3,600
|
af8dbd0b1116dd8c6aa89348c3421e15a7f59b8b
|
misc(travis): Only build on Node 6 for PRs. Don't do the `push` build for non-master.
|
[
{
"change_type": "MODIFY",
"diff": "sudo: required\nlanguage: node_js\n+branches:\n+ only:\n+ - master\nmatrix:\ninclude:\n- node_js: \"6.9.1\"\n- node_js: \"8\"\n+ if: head_branch IS blank AND branch = master\n- node_js: \"9\"\n+ if: head_branch IS blank AND branch = master\ndist: trusty\ncache:\nyarn: true\n@@ -13,10 +18,6 @@ cache:\n- lighthouse-extension/node_modules\n- lighthouse-viewer/node_modules\n- /home/travis/.rvm/gems/\n-before_install:\n- # TODO: remove after yarn is 1.0+ on Travis: https://github.com/travis-ci/travis-ci/issues/7566\n- - curl -o- -L https://yarnpkg.com/install.sh | bash\n- - export PATH=\"$HOME/.yarn/bin:$PATH\"\ninstall:\n- yarn\n# travis can't handle the parallel install (without caches)\n@@ -27,6 +28,8 @@ before_script:\n- sh -e /etc/init.d/xvfb start\n- yarn build-all\nscript:\n+ - echo $TRAVIS_EVENT_TYPE;\n+ - echo $TRAVIS_BRANCH\n- yarn bundlesize\n- yarn lint\n- yarn unit\n",
"new_path": ".travis.yml",
"old_path": ".travis.yml"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
misc(travis): Only build on Node 6 for PRs. Don't do the `push` build for non-master.
| 1
|
misc
|
travis
|
791,723
|
31.01.2018 10:43:52
| 28,800
|
d6b027e9578a833d1997a66b83dfec4da624b233
|
tests(coverage): minimize impact of timeout due to istanbul's instrumentation
|
[
{
"change_type": "MODIFY",
"diff": "@@ -25,7 +25,8 @@ describe('CLI run', function() {\nit('runLighthouse completes a LH round trip', () => {\nconst url = 'chrome://version';\nconst filename = path.join(process.cwd(), 'run.ts.results.json');\n- const flags = getFlags(`--output=json --output-path=${filename} ${url}`);\n+ const timeoutFlag = `--max-wait-for-load=${9000}`;\n+ const flags = getFlags(`--output=json --output-path=${filename} ${timeoutFlag} ${url}`);\nreturn run.runLighthouse(url, flags, fastConfig).then(passedResults => {\nassert.ok(fs.existsSync(filename));\nconst results = JSON.parse(fs.readFileSync(filename, 'utf-8'));\n@@ -42,7 +43,7 @@ describe('CLI run', function() {\nfs.unlinkSync(filename);\n});\n- }).timeout(60000);\n+ }).timeout(20 * 1000);\n});\ndescribe('Parsing --chrome-flags', () => {\n",
"new_path": "lighthouse-cli/test/cli/run-test.js",
"old_path": "lighthouse-cli/test/cli/run-test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -1096,6 +1096,7 @@ class Driver {\n* on the global object.\n* @return {function(...*): *} A wrapper around the original function.\n*/\n+/* istanbul ignore next */\nfunction captureJSCallUsage(funcRef, set) {\n/* global window */\nconst __nativeError = window.__nativeError || Error;\n@@ -1158,8 +1159,8 @@ function captureJSCallUsage(funcRef, set) {\n* information such as name, message, and stack trace of the error when it's wrapped in a\n* promise. Instead, map to a successful object that contains this information.\n* @param {string|Error} err The error to convert\n- * istanbul ignore next\n*/\n+/* istanbul ignore next */\nfunction wrapRuntimeEvalErrorInBrowser(err) {\nerr = err || new Error();\nconst fallbackMessage = typeof err === 'string' ? err : 'unknown error';\n@@ -1175,8 +1176,8 @@ function wrapRuntimeEvalErrorInBrowser(err) {\n/**\n* Used by _waitForCPUIdle and executed in the context of the page, updates the ____lastLongTask\n* property on window to the end time of the last long task.\n- * instanbul ignore next\n*/\n+/* istanbul ignore next */\nfunction registerPerformanceObserverInPage() {\nwindow.____lastLongTask = window.performance.now();\nconst observer = new window.PerformanceObserver(entryList => {\n@@ -1201,8 +1202,8 @@ function registerPerformanceObserverInPage() {\n/**\n* Used by _waitForCPUIdle and executed in the context of the page, returns time since last long task.\n- * instanbul ignore next\n*/\n+/* istanbul ignore next */\nfunction checkTimeSinceLastLongTask() {\n// Wait for a delta before returning so that we're sure the PerformanceObserver\n// has had time to register the last longtask\n",
"new_path": "lighthouse-core/gather/driver.js",
"old_path": "lighthouse-core/gather/driver.js"
},
{
"change_type": "MODIFY",
"diff": "\"clean\": \"rimraf *.report.html *.report.dom.html *.report.json *.screenshots.html *.devtoolslog.json *.trace.json || true\",\n\"lint\": \"[ \\\"$CI\\\" = true ] && eslint --quiet -f codeframe . || eslint .\",\n\"smoke\": \"bash lighthouse-cli/test/smokehouse/run-all-tests.sh\",\n- \"coverage\": \"istanbul cover -x \\\"**/third_party/**\\\" _mocha -- $(find */test -name '*-test.js') --timeout 10000 --reporter progress --report lcovonly\",\n+ \"coverage\": \"istanbul cover -x \\\"**/third_party/**\\\" _mocha -- $(find */test -name '*-test.js') --reporter progress --report lcovonly\",\n\"coveralls\": \"yarn coverage && cat ./coverage/lcov.info | coveralls && ./node_modules/codecov/bin/codecov\",\n\"debug\": \"node --inspect-brk ./lighthouse-cli/index.js\",\n\"start\": \"node ./lighthouse-cli/index.js\",\n",
"new_path": "package.json",
"old_path": "package.json"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
tests(coverage): minimize impact of timeout due to istanbul's instrumentation (#4396)
| 1
|
tests
|
coverage
|
679,913
|
31.01.2018 14:12:57
| 0
|
fbf8453c35c462e61d0a181c64185fc66ad529ce
|
feat(api): add Predicate2 & StatefulPredicate2 types
|
[
{
"change_type": "MODIFY",
"diff": "@@ -234,9 +234,11 @@ export interface IObjectOf<T> {\n[id: string]: T;\n}\n-export type Predicate<T> = (x: T) => boolean;\n+export type Predicate<T> = (a: T) => boolean;\n+export type Predicate2<T> = (a: T, b: T) => boolean;\nexport type StatefulPredicate<T> = () => Predicate<T>;\n+export type StatefulPredicate2<T> = () => Predicate2<T>;\nexport interface IRelease {\nrelease(opt?: any): boolean;\n",
"new_path": "packages/api/src/api.ts",
"old_path": "packages/api/src/api.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(api): add Predicate2 & StatefulPredicate2 types
| 1
|
feat
|
api
|
679,913
|
31.01.2018 14:22:12
| 0
|
42bbb8644c7739e538e9b0c62356913ddcb620a7
|
refactor(iterators): use Predicate/Predicate2
|
[
{
"change_type": "MODIFY",
"diff": "+import { Predicate2 } from \"@thi.ng/api/api\";\n+\nimport { iterator } from \"./iterator\";\n-export function* dedupeWith<T>(equiv: (a: T, b: T) => boolean, input: Iterable<T>) {\n+export function* dedupeWith<T>(equiv: Predicate2<T>, input: Iterable<T>) {\nlet iter = iterator(input),\nv: IteratorResult<T>,\nprev: T;\n",
"new_path": "packages/iterators/src/dedupe-with.ts",
"old_path": "packages/iterators/src/dedupe-with.ts"
},
{
"change_type": "MODIFY",
"diff": "+import { Predicate } from \"@thi.ng/api/api\";\n+\nimport { ensureIterator } from \"./ensure\";\n-export function* dropWhile<T>(pred: (x: T) => boolean, input: Iterable<T>) {\n+export function* dropWhile<T>(pred: Predicate<T>, input: Iterable<T>) {\nlet iter = ensureIterator(input),\nv: IteratorResult<T>;\nwhile (((v = iter.next()), !v.done && pred(v.value) === true)) { }\n",
"new_path": "packages/iterators/src/drop-while.ts",
"old_path": "packages/iterators/src/drop-while.ts"
},
{
"change_type": "MODIFY",
"diff": "+import { Predicate } from \"@thi.ng/api/api\";\n+\nimport { iterator } from \"./iterator\";\n-export function every<T>(pred: (x: T) => boolean, input: Iterable<T>) {\n+export function every<T>(pred: Predicate<T>, input: Iterable<T>) {\nlet iter = iterator(input),\nv: IteratorResult<T>,\nempty = true;\n",
"new_path": "packages/iterators/src/every.ts",
"old_path": "packages/iterators/src/every.ts"
},
{
"change_type": "MODIFY",
"diff": "+import { Predicate } from \"@thi.ng/api/api\";\n+\nimport { iterator } from \"./iterator\";\n-export function* filter<T>(pred: (x: T) => boolean, input: Iterable<T>) {\n+export function* filter<T>(pred: Predicate<T>, input: Iterable<T>) {\nlet iter = iterator(input),\nv: IteratorResult<T>;\nwhile (((v = iter.next()), !v.done)) {\n",
"new_path": "packages/iterators/src/filter.ts",
"old_path": "packages/iterators/src/filter.ts"
},
{
"change_type": "MODIFY",
"diff": "+import { Predicate } from \"@thi.ng/api/api\";\n+\nimport { iterator } from \"./iterator\";\n-export function some<T>(pred: (x: T) => boolean, input: Iterable<T>) {\n+export function some<T>(pred: Predicate<T>, input: Iterable<T>) {\nlet iter = iterator(input),\nv: IteratorResult<T>;\nwhile (((v = iter.next()), !v.done)) {\n",
"new_path": "packages/iterators/src/some.ts",
"old_path": "packages/iterators/src/some.ts"
},
{
"change_type": "MODIFY",
"diff": "+import { Predicate } from \"@thi.ng/api/api\";\n+\nimport { iterator } from \"./iterator\";\n-export function* takeWhile<T>(pred: (x: T) => boolean, input: Iterable<T>) {\n+export function* takeWhile<T>(pred: Predicate<T>, input: Iterable<T>) {\nlet iter = iterator(input),\nv: IteratorResult<T>;\nwhile (((v = iter.next()), !v.done && pred(v.value))) {\n",
"new_path": "packages/iterators/src/take-while.ts",
"old_path": "packages/iterators/src/take-while.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(iterators): use Predicate/Predicate2
| 1
|
refactor
|
iterators
|
679,913
|
31.01.2018 14:22:32
| 0
|
79989e520288d1fdfb85daa865f8897496bedd41
|
refactor(dcons): use Predicate
|
[
{
"change_type": "MODIFY",
"diff": "@@ -196,7 +196,7 @@ export class DCons<T> implements\n}\n}\n- public findWith(fn: (value: T) => boolean) {\n+ public findWith(fn: api.Predicate<T>) {\nlet cell = this.head;\nwhile (cell) {\nif (fn(cell.value)) {\n",
"new_path": "packages/dcons/src/index.ts",
"old_path": "packages/dcons/src/index.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(dcons): use Predicate
| 1
|
refactor
|
dcons
|
679,913
|
31.01.2018 14:22:51
| 0
|
4753afb85360de0f8e16ac029846ff3d2d58f8fa
|
refactor(transducers): use Predicate2
|
[
{
"change_type": "MODIFY",
"diff": "+import { Predicate2 } from \"@thi.ng/api/api\";\n+\nimport { Reducer, Transducer, SEMAPHORE } from \"../api\";\nimport { compR } from \"../func/comp\";\n-export function dedupe<T>(equiv?: (a: T, b: T) => boolean): Transducer<T, T> {\n+export function dedupe<T>(equiv?: Predicate2<T>): Transducer<T, T> {\nreturn (rfn: Reducer<any, T>) => {\nconst r = rfn[2];\nlet prev: any = SEMAPHORE;\n",
"new_path": "packages/transducers/src/xform/dedupe.ts",
"old_path": "packages/transducers/src/xform/dedupe.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(transducers): use Predicate2
| 1
|
refactor
|
transducers
|
679,913
|
31.01.2018 14:25:44
| 0
|
55383621e720821846d94ee74fb503c3cfb1b40f
|
feat(atom): add full IAtom impl for History, update tests
|
[
{
"change_type": "MODIFY",
"diff": "-import { IAtom, IReset, ISwap, SwapFn } from \"./api\";\n+import { Predicate2, Watch } from \"@thi.ng/api/api\";\n+import { IAtom, SwapFn } from \"./api\";\n+\n+/**\n+ * Undo/redo history stack wrapper for atoms and cursors.\n+ * Implements `IAtom` interface and so can be used directly in place\n+ * and delegates to wrapped atom/cursor. Value changes are only\n+ * recorded in history if `changed` predicate returns truthy value,\n+ * or else by calling `record()` directly.\n+ */\nexport class History<T> implements\n- IReset<T>,\n- ISwap<T> {\n+ IAtom<T> {\nstate: IAtom<T>;\nmaxLen: number;\n- history: T[] = [];\n- future: T[] = [];\n+ changed: Predicate2<T>;\n+\n+ history: T[];\n+ future: T[];\n- constructor(state: IAtom<T>, maxLen = 100) {\n+ /**\n+ * @param state parent state\n+ * @param maxLen max size of undo stack\n+ * @param changed predicate to determine changed values (default `!==`)\n+ */\n+ constructor(state: IAtom<T>, maxLen = 100, changed?: Predicate2<T>) {\nthis.state = state;\nthis.maxLen = maxLen;\n+ this.changed = changed || ((a, b) => a !== b);\n+ this.clear();\n}\n+ /**\n+ * Clears history & future stacks\n+ */\nclear() {\nthis.history = [];\nthis.future = [];\n}\n+ /**\n+ * Attempts to re-apply most recent historical value to atom and\n+ * returns it if successful (i.e. there's a history). Before the\n+ * switch, first records the atom's current value into the future\n+ * stack (to enable `redo()` feature). Returns `undefined` if\n+ * there's no history.\n+ */\nundo() {\nif (this.history.length) {\nthis.future.push(this.state.deref());\n@@ -26,6 +53,13 @@ export class History<T> implements\n}\n}\n+ /**\n+ * Attempts to re-apply most recent value from future stack to atom\n+ * and returns it if successful (i.e. there's a future). Before the\n+ * switch, first records the atom's current value into the history\n+ * stack (to enable `undo()` feature). Returns `undefined` if\n+ * there's no future (so sad!).\n+ */\nredo() {\nif (this.future.length) {\nthis.history.push(this.state.deref());\n@@ -33,24 +67,85 @@ export class History<T> implements\n}\n}\n+ /**\n+ * `IAtom.reset()` implementation. Delegates to wrapped atom/cursor,\n+ * but too applies `changed` predicate to determine if there was a\n+ * change and previous value should be recorded.\n+ *\n+ * @param val\n+ */\nreset(val: T) {\n- const prev = this.state.deref(),\n- curr = this.state.reset(val);\n- curr !== prev && this.record(prev);\n- return curr;\n+ const prev = this.state.deref();\n+ this.state.reset(val);\n+ this.changed(prev, val) && this.record(prev);\n+ return val;\n}\n+ /**\n+ * `IAtom.swap()` implementation. Delegates to wrapped atom/cursor,\n+ * but too applies `changed` predicate to determine if there was a\n+ * change and previous value should be recorded.\n+ *\n+ * @param val\n+ */\nswap(fn: SwapFn<T>, ...args: any[]) {\nconst prev = this.state.deref(),\ncurr = this.state.swap.apply(this.state, [fn, ...args]);\n- curr !== prev && this.record(prev);\n+ this.changed(prev, curr) && this.record(prev);\nreturn curr;\n}\n- protected record(state: T) {\n- if (this.history.length == this.maxLen) {\n+ /**\n+ * Records given state in history. This method is only needed when\n+ * manually managing snapshots, i.e. when applying multiple swaps\n+ * on the wrapped atom directly, but not wanting to create an\n+ * history entry for each change. **DO NOT call this explicitly if\n+ * using `History.reset()` / `History.swap()`**.\n+ *\n+ * If no `state` is given, uses the wrapped atom's current state value.\n+ *\n+ * @param state\n+ */\n+ record(state?: T) {\n+ if (this.history.length >= this.maxLen) {\nthis.history.shift();\n}\n- this.history.push(state);\n+ this.history.push(arguments.length > 0 ? state : this.state.deref());\n+ }\n+\n+ /**\n+ * Returns wrapped atom's **current** value.\n+ */\n+ deref(): T {\n+ return this.state.deref();\n+ }\n+\n+ /**\n+ * `IWatch.addWatch()` implementation. Delegates to wrapped atom/cursor.\n+ *\n+ * @param id\n+ * @param fn\n+ */\n+ addWatch(id: string, fn: Watch<T>) {\n+ return this.state.addWatch(id, fn);\n+ }\n+\n+ /**\n+ * `IWatch.removeWatch()` implementation. Delegates to wrapped atom/cursor.\n+ *\n+ * @param id\n+ */\n+ removeWatch(id: string) {\n+ return this.state.removeWatch(id);\n+ }\n+\n+ /**\n+ * `IWatch.notifyWatches()` implementation. Delegates to wrapped atom/cursor.\n+ *\n+ * @param oldState\n+ * @param newState\n+ */\n+ notifyWatches(oldState: T, newState: T) {\n+ return this.state.notifyWatches(oldState, newState);\n}\n}\n",
"new_path": "packages/atom/src/history.ts",
"old_path": "packages/atom/src/history.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -18,7 +18,7 @@ describe(\"history\", () => {\nlet h = new History(c, 3);\nassert.equal(h.history.length, 0);\nassert.equal(h.future.length, 0);\n- assert.equal(h.state.deref(), c.deref());\n+ assert.equal(h.deref(), c.deref());\n});\nit(\"does record & shift (simple)\", () => {\n",
"new_path": "packages/atom/test/history.ts",
"old_path": "packages/atom/test/history.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(atom): add full IAtom impl for History, update tests
| 1
|
feat
|
atom
|
679,913
|
31.01.2018 14:26:10
| 0
|
dd155dfd07bd5576fed6029eae1608be9adaa22c
|
docs(atom): add docs for getter/setter
|
[
{
"change_type": "MODIFY",
"diff": "@@ -9,6 +9,27 @@ function compG(k, f) {\nreturn (s) => s ? f(s[k]) : undefined;\n}\n+/**\n+ * Composes a getter function for given nested lookup path.\n+ * If `path` is given as string, it will be split using `.`.\n+ * Returns function which accepts single object and\n+ * when called, returns value at given path.\n+ *\n+ * If any intermediate key is not present in the given obj,\n+ * descent stops and the function returns `undefined`.\n+ *\n+ * ```\n+ * g = getter(\"a.b.c\");\n+ * // or\n+ * g = getter([\"a\",\"b\",\"c\"]);\n+ *\n+ * g({a: {b: {c: 23}}}) // 23\n+ * g({x: 23}) // undefined\n+ * g() // undefined\n+ * ```\n+ *\n+ * @param path\n+ */\nexport function getter(path: PropertyKey | PropertyKey[]) {\nconst ks = isArray(path) ? path : isString(path) ? path.split(\".\") : [path],\nkl = ks.pop();\n@@ -19,6 +40,48 @@ export function getter(path: PropertyKey | PropertyKey[]) {\nreturn f;\n}\n+/**\n+ * Composes a setter function for given nested lookup path.\n+ * If `path` is given as string, it will be split using `.`.\n+ * Returns function which accepts single object and\n+ * when called, **immutably** updates value at given path,\n+ * i.e. produces a partial deep copy of obj up until given path.\n+ *\n+ * If any intermediate key is not present in the given obj,\n+ * creates a plain empty object for that key and descends further.\n+ *\n+ * ```\n+ * s = setter(\"a.b.c\");\n+ * // or\n+ * s = setter([\"a\",\"b\",\"c\"]);\n+ *\n+ * s({a: {b: {c: 23}}}, 24)\n+ * // {a: {b: {c: 24}}}\n+ *\n+ * s({x: 23}, 24)\n+ * // { x: 23, a: { b: { c: 24 } } }\n+ *\n+ * s(null, 24)\n+ * // { a: { b: { c: 24 } } }\n+ * ```\n+ *\n+ * Only keys in the path will be modied, all other keys present\n+ * in the given object retain their original values to provide\n+ * efficient structural sharing / re-use.\n+ *\n+ * ```\n+ * s = setter(\"a.b.c\");\n+ *\n+ * a = {x: {y: {z: 1}}};\n+ * b = s(a, 2);\n+ * // { x: { y: { z: 1 } }, a: { b: { c: 2 } } }\n+ *\n+ * a.x === b.x // true\n+ * a.x.y === b.x.y // true\n+ * ```\n+ *\n+ * @param path\n+ */\nexport function setter(path: PropertyKey | PropertyKey[]) {\nconst ks = isArray(path) ? path : isString(path) ? path.split(\".\") : [path],\nkl = ks.pop();\n",
"new_path": "packages/atom/src/path.ts",
"old_path": "packages/atom/src/path.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs(atom): add docs for getter/setter
| 1
|
docs
|
atom
|
679,913
|
31.01.2018 14:27:28
| 0
|
d58cf70d2c1b63b499138473173ef9e672913497
|
feat(rstream): add changed predicate for fromAtom(), add tests
|
[
{
"change_type": "MODIFY",
"diff": "+import { Predicate2 } from \"@thi.ng/api/api\";\nimport { ReadonlyAtom } from \"@thi.ng/atom/api\";\nimport { Stream } from \"../stream\";\n/**\n* Yields stream of value changes in given atom / cursor.\n- * Attaches watch to atom and compares values with `===`.\n- * If `emitFirst` is true (default), also emits atom's\n- * current value when first subscriber attaches to stream.\n+ * Attaches watch to atom and checks for value changes with given `changed`\n+ * predicate (`!==` by default). If the predicate returns truthy result,\n+ * the atom change is emitted on the stream.\n+ * If `emitFirst` is true (default), also emits atom's current value\n+ * when first subscriber attaches to stream.\n*\n* See: @thi.ng/atom\n*\n* ```\n* db = new Atom({a: 23, b: 88});\n- * cursor = new Cursor(db, (s) => s.a, (s, x)=> ({...s, a: x}))\n+ * cursor = new Cursor(db, \"a\")\n*\n* rs.fromAtom(cursor).subscribe(rs.trace(\"cursor val:\"))\n* // cursor val: 23\n@@ -24,11 +27,14 @@ import { Stream } from \"../stream\";\n* ```\n*\n* @param atom\n+ * @param emitFirst\n+ * @param changed\n*/\n-export function fromAtom<T>(atom: ReadonlyAtom<T>, emitFirst = true): Stream<T> {\n+export function fromAtom<T>(atom: ReadonlyAtom<T>, emitFirst = true, changed?: Predicate2<T>): Stream<T> {\nreturn new Stream<T>((stream) => {\n+ changed = changed || ((a, b) => a !== b);\natom.addWatch(stream.id, (_, prev, curr) => {\n- if (curr !== prev) {\n+ if (changed(prev, curr)) {\nstream.next(curr);\n}\n});\n",
"new_path": "packages/rstream/src/from/atom.ts",
"old_path": "packages/rstream/src/from/atom.ts"
},
{
"change_type": "ADD",
"diff": "+import { Atom, Cursor, History } from \"@thi.ng/atom\";\n+import * as assert from \"assert\";\n+\n+import { fromAtom } from \"../src/from/atom\";\n+\n+describe(\"fromAtom\", () => {\n+\n+ it(\"works with atom\", (done) => {\n+ let a = new Atom(null);\n+ let src = fromAtom(a, false);\n+ let calledNext = false;\n+ src.subscribe({\n+ next(x) {\n+ assert.equal(x, 23);\n+ calledNext = true;\n+ },\n+ done() {\n+ assert(calledNext, \"not called next()\");\n+ done();\n+ },\n+ error() {\n+ assert.fail(\"called error()\");\n+ }\n+ });\n+ a.reset(23);\n+ src.done();\n+ });\n+\n+ it(\"works with cursor\", (done) => {\n+ let state = { a: { b: {}, d: { e: 42 } } };\n+ let a = new Atom(state);\n+ let c = new Cursor(a, \"a.b.c\");\n+ let src = fromAtom(c, false);\n+ let calledNext = false;\n+ src.subscribe({\n+ next(x) {\n+ assert.equal(x, 23);\n+ calledNext = true;\n+ },\n+ done() {\n+ assert(calledNext, \"not called next()\");\n+ assert.deepEqual(a.deref(), { a: { b: { c: 23 }, d: { e: 42 } } });\n+ assert.strictEqual(a.deref().a.d, state.a.d);\n+ done();\n+ },\n+ error() {\n+ assert.fail(\"called error()\");\n+ }\n+ });\n+ c.reset(23);\n+ src.done();\n+ });\n+\n+ it(\"works with history (single)\", () => {\n+ let a = new Atom({});\n+ let c = new Cursor(a, \"a.b\");\n+ let h = new History(c);\n+ let src = fromAtom(h, true);\n+ let buf = [];\n+ src.subscribe({ next(x) { buf.push(x); } });\n+ h.reset(1);\n+ h.reset(2);\n+ h.reset({ c: 3 });\n+ assert.deepEqual(a.deref(), { a: { b: { c: 3 } } });\n+ h.undo();\n+ assert.deepEqual(a.deref(), { a: { b: 2 } });\n+ h.redo();\n+ assert.deepEqual(a.deref(), { a: { b: { c: 3 } } });\n+ h.undo();\n+ assert.deepEqual(a.deref(), { a: { b: 2 } });\n+ h.undo();\n+ assert.deepEqual(a.deref(), { a: { b: 1 } });\n+ h.undo();\n+ assert.deepEqual(a.deref(), { a: { b: undefined } });\n+ src.done();\n+ assert.deepEqual(buf, [undefined, 1, 2, { c: 3 }, 2, { c: 3 }, 2, 1, undefined]);\n+ });\n+\n+ it(\"works with history (multiple)\", () => {\n+ let a = new Atom({});\n+ let h = new History(a);\n+ let c1 = new Cursor(a, \"a.b\");\n+ let c2 = new Cursor(a, \"c\");\n+ let src1 = fromAtom(c1, true);\n+ let src2 = fromAtom(c2, true);\n+ let buf1 = [];\n+ let buf2 = [];\n+ src1.subscribe({ next(x) { buf1.push(x); } });\n+ src2.subscribe({ next(x) { buf2.push(x); } });\n+ h.record();\n+ c1.reset(1);\n+\n+ h.record();\n+ c1.reset(2);\n+ c2.reset(10);\n+\n+ h.record();\n+ c1.reset(3);\n+\n+ h.record();\n+ c2.reset(20);\n+\n+ assert.deepEqual(buf1, [undefined, 1, 2, 3]);\n+ assert.deepEqual(buf2, [undefined, 10, 20]);\n+\n+ h.undo();\n+ h.undo();\n+ h.redo();\n+ h.redo();\n+ h.undo();\n+ h.undo();\n+ h.undo();\n+ h.undo();\n+ src1.done();\n+ src2.done();\n+\n+ assert.deepEqual(buf1, [undefined, 1, 2, 3, 2, 3, 2, 1, undefined]);\n+ assert.deepEqual(buf2, [undefined, 10, 20, 10, 20, 10, undefined]);\n+ });\n+\n+});\n\\ No newline at end of file\n",
"new_path": "packages/rstream/test/from-atom.ts",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(rstream): add changed predicate for fromAtom(), add tests
| 1
|
feat
|
rstream
|
679,913
|
31.01.2018 14:28:52
| 0
|
365e0d2be556745ab755552bad331a488bb93552
|
build: update main package commands
|
[
{
"change_type": "MODIFY",
"diff": "},\n\"scripts\": {\n\"build\": \"yarn install && lerna bootstrap && lerna run build --sort\",\n- \"cover\": \"yarn test && lerna run cover\",\n+ \"cover\": \"lerna run cover\",\n\"depgraph\": \"scripts/depgraph && git add assets/deps.png && git commit -m 'docs: update dep graph' && git push\",\n\"doc\": \"lerna run doc\",\n- \"pub\": \"lerna publish && yarn depgraph\",\n+ \"pub\": \"lerna publish && yarn depgraph && yarn doc && scripts/upload-docs\",\n\"test\": \"yarn build && lerna run test\"\n}\n}\n\\ No newline at end of file\n",
"new_path": "package.json",
"old_path": "package.json"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
build: update main package commands
| 1
|
build
| null |
448,035
|
31.01.2018 15:01:58
| -7,200
|
5830e6a1135528d2b6d81a61e13e9109df88746a
|
fix: strip bom from templates and stylesheet files
Closes
|
[
{
"change_type": "MODIFY",
"diff": "\"rollup-plugin-node-resolve\": \"^3.0.0\",\n\"rxjs\": \"^5.5.0\",\n\"sorcery\": \"^0.10.0\",\n+ \"strip-bom\": \"^3.0.0\",\n\"stylus\": \"^0.54.5\",\n\"uglify-js\": \"^3.0.7\"\n},\n\"@types/react-dom\": \"^16.0.2\",\n\"@types/rollup\": \"^0.51.2\",\n\"@types/sinon\": \"^4.0.0\",\n+ \"@types/strip-bom\": \"^3.0.0\",\n\"chai\": \"^4.0.1\",\n\"copyfiles\": \"^1.2.0\",\n\"cross-env\": \"^5.0.5\",\n\"publish:ci\": \"yarn prerelease && yarn postrelease\",\n\"integration:samples\": \"integration/samples.sh\",\n\"integration:samples:dev\": \"ts-node --project src/tsconfig.packagr.json ./integration/samples.dev.ts\",\n- \"integration:specs\":\n- \"cross-env TS_NODE_PROJECT=integration/tsconfig.specs.json mocha --require ts-node/register integration/samples/*/specs/**/*.ts\",\n+ \"integration:specs\": \"cross-env TS_NODE_PROJECT=integration/tsconfig.specs.json mocha --require ts-node/register integration/samples/*/specs/**/*.ts\",\n\"integration:consumers\": \"integration/consumers.sh\",\n\"integration:consumers:ngc\": \"ngc -p integration/consumers/tsc/tsconfig.json\",\n- \"test:specs\":\n- \"cross-env TS_NODE_PROJECT=src/tsconfig.specs.json mocha --require ts-node/register 'src/**/*.spec.ts'\",\n- \"test\":\n- \"yarn build && yarn test:specs && yarn integration:samples && yarn integration:specs && yarn integration:consumers\",\n+ \"test:specs\": \"cross-env TS_NODE_PROJECT=src/tsconfig.specs.json mocha --require ts-node/register \\\"src/**/*.spec.ts\\\"\",\n+ \"test\": \"yarn build && yarn test:specs && yarn integration:samples && yarn integration:specs && yarn integration:consumers\",\n\"commitmsg\": \"commitlint -e\",\n\"precommit\": \"pretty-quick --staged\",\n\"gh-pages\": \"gh-pages -d docs/ghpages\"\n",
"new_path": "package.json",
"old_path": "package.json"
},
{
"change_type": "MODIFY",
"diff": "import * as fs from 'fs-extra';\nimport * as path from 'path';\n+import stripBom = require('strip-bom');\nimport { Transform, transformFromPromise } from '../../../brocc/transform';\nimport { NgEntryPoint, CssUrl } from '../../../ng-package-format/entry-point';\nimport * as log from '../../../util/log';\n@@ -103,7 +104,7 @@ async function renderPreProcessor(filePath: string, basePath: string, entryPoint\ncase '.css':\ndefault:\nlog.debug(`reading css from ${filePath}`);\n- return fs.readFile(filePath).then(buffer => buffer.toString());\n+ return fs.readFile(filePath).then(buffer => stripBom(buffer.toString()));\n}\n}\n@@ -122,7 +123,7 @@ const renderSass = (sassOpts: any): Promise<string> => {\nconst renderLess = (lessOpts: any): Promise<string> => {\nreturn fs\n.readFile(lessOpts.filename)\n- .then(buffer => buffer.toString())\n+ .then(buffer => stripBom(buffer.toString()))\n.then(\n(lessData: string) =>\nnew Promise<string>((resolve, reject) => {\n@@ -144,7 +145,7 @@ const renderLess = (lessOpts: any): Promise<string> => {\nconst renderStylus = ({ filename, root }): Promise<string> => {\nreturn fs\n.readFile(filename)\n- .then(buffer => buffer.toString())\n+ .then(buffer => stripBom(buffer.toString()))\n.then(\n(stylusData: string) =>\nnew Promise<string>((resolve, reject) => {\n",
"new_path": "src/lib/ng-v5/entry-point/resources/stylesheet.transform.ts",
"old_path": "src/lib/ng-v5/entry-point/resources/stylesheet.transform.ts"
},
{
"change_type": "MODIFY",
"diff": "import { readFile } from 'fs-extra';\nimport { map } from 'rxjs/operators';\nimport { pipe } from 'rxjs/util/pipe';\n+import stripBom = require('strip-bom');\nimport { Transform, transformFromPromise } from '../../../brocc/transform';\nimport * as log from '../../../util/log';\nimport { byEntryPoint, isInProgress } from '../../entry-point.node';\n@@ -35,5 +36,7 @@ export const templateTransform: Transform = transformFromPromise(async graph =>\n* @return Resolved content of HTML template file\n*/\nasync function processTemplate(templateFilePath: string): Promise<string> {\n- return (await readFile(templateFilePath)).toString();\n+ const buffer = await readFile(templateFilePath);\n+\n+ return stripBom(buffer.toString());\n}\n",
"new_path": "src/lib/ng-v5/entry-point/resources/template.transform.ts",
"old_path": "src/lib/ng-v5/entry-point/resources/template.transform.ts"
}
] |
TypeScript
|
MIT License
|
ng-packagr/ng-packagr
|
fix: strip bom from templates and stylesheet files (#571)
Closes #487
| 1
|
fix
| null |
679,913
|
31.01.2018 20:59:59
| 0
|
54cd52612774213a06623defdcd5718ab877584d
|
fix(rstream): subscription unhandled error handling
track if any child subs have received error, if not treat as unhandled
and unsub current sub from parent (if any)
|
[
{
"change_type": "MODIFY",
"diff": "@@ -138,11 +138,16 @@ export class Subscription<A, B> implements\nerror(e: any) {\nthis.state = State.ERROR;\n+ let notified = false;\nif (this.subs && this.subs.length) {\nfor (let s of [...this.subs]) {\n- s.error && s.error(e);\n+ if (s.error) {\n+ s.error(e);\n+ notified = true;\n}\n- } else {\n+ }\n+ }\n+ if (!notified) {\nconsole.log(this.id, \"unhandled error:\", e);\nif (this.parent) {\nDEBUG && console.log(this.id, \"unsubscribing...\");\n",
"new_path": "packages/rstream/src/subscription.ts",
"old_path": "packages/rstream/src/subscription.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
fix(rstream): subscription unhandled error handling
- track if any child subs have received error, if not treat as unhandled
and unsub current sub from parent (if any)
| 1
|
fix
|
rstream
|
679,913
|
31.01.2018 21:50:32
| 0
|
59d2a8a15d8e7cd330bd47cf98d9b07bcb321673
|
docs(rstream): add undo/redo example to readme
|
[
{
"change_type": "MODIFY",
"diff": "@@ -90,6 +90,68 @@ new rs.StreamMerge([\n// ...\n```\n+### Central app state atom with reactive undo / redo\n+\n+```typescript\n+import * as atom from \"@thi.ng/atom\";\n+import * as tx from \"@thi.ng/transducers\";\n+\n+// central app state / single source of truth\n+const app = new atom.Atom({ui: {theme: \"dark\", mode: false}, foo: \"bar\"});\n+\n+// define some cursors for different UI params\n+const theme = new atom.Cursor(app, \"ui.theme\");\n+const mode = new atom.Cursor(app, \"ui.mode\");\n+\n+// create streams of cursor value changes\n+rs.fromAtom(theme).subscribe(rs.trace(\"theme:\"));\n+// with transducer\n+rs.fromAtom(mode).subscribe(rs.trace(\"mode:\"), tx.map(mode => mode ? \"advanced\" : \"basic\"));\n+// another one for an hitherto unknown value in app state\n+rs.fromAtom(new atom.Cursor(app, \"session.user\")).subscribe(rs.trace(\"user:\"));\n+\n+// attach history only to `ui` branch\n+// undo/redo will not record/change other keys in the atom\n+const hist = new atom.History(new atom.Cursor(app, \"ui\"));\n+\n+hist.record(); // record current snapshot\n+theme.reset(\"light\");\n+// theme: light\n+\n+hist.record();\n+mode.swap(mode => !mode); // toggle mode\n+// mode: advanced\n+\n+hist.undo(); // 1st\n+// mode: basic\n+// { theme: 'light', mode: false }\n+\n+hist.undo(); // 2nd\n+// theme: dark\n+// { theme: 'dark', mode: false }\n+\n+hist.redo(); // 1st\n+// theme: light\n+// { theme: 'light', mode: false }\n+\n+// update another part of the app state (SPREAD, DON'T MUTATE!)\n+app.swap((state) => ({...state, session: {user: \"asterix\"}}));\n+// user: asterix\n+// { ui: { theme: 'light', mode: false },\n+// foo: 'bar',\n+// session: { user: 'asterix' } }\n+\n+hist.redo(); // redo 2nd time\n+// mode: advanced\n+// { theme: 'light', mode: true }\n+\n+// verify history redo did not destroy other keys\n+app.deref();\n+// { ui: { theme: 'light', mode: true },\n+// foo: 'bar',\n+// session: { user: 'asterix' } }\n+```\n+\nTODO more to come... see tests for now!\n## Authors\n",
"new_path": "packages/rstream/README.md",
"old_path": "packages/rstream/README.md"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs(rstream): add undo/redo example to readme
| 1
|
docs
|
rstream
|
679,913
|
01.02.2018 03:32:19
| 0
|
878520e6097569d9104c3090d313958533e36515
|
feat(api): update equiv() null handling, add tests
BREAKING CHANGE: equiv now treats null & undefined as equal
|
[
{
"change_type": "MODIFY",
"diff": "@@ -9,11 +9,15 @@ export function equiv(a, b): boolean {\nif (typeof a.equiv === \"function\") {\nreturn a.equiv(b);\n}\n+ } else {\n+ return a == b;\n}\nif (b != null) {\nif (typeof b.equiv === \"function\") {\nreturn b.equiv(a);\n}\n+ } else {\n+ return a == b;\n}\nif (isPlainObject(a) && isPlainObject(b)) {\nreturn equivObject(a, b);\n",
"new_path": "packages/api/src/equiv.ts",
"old_path": "packages/api/src/equiv.ts"
},
{
"change_type": "MODIFY",
"diff": "-describe(\"api\", () => {\n- it(\"tests pending\");\n+import * as assert from \"assert\";\n+\n+import { equiv } from \"../src/equiv\";\n+\n+describe(\"equiv\", () => {\n+\n+ it(\"null\", () => {\n+ assert(equiv(null, null));\n+ assert(equiv(null, undefined));\n+ assert(equiv(undefined, null));\n+ });\n+\n+ it(\"boolean\", () => {\n+ assert(!equiv(null, false));\n+ assert(!equiv(false, null));\n+ assert(!equiv(undefined, false));\n+ assert(!equiv(false, undefined));\n+ });\n+\n+ it(\"number\", () => {\n+ assert(!equiv(null, 0));\n+ assert(!equiv(0, null));\n+ assert(!equiv(0, undefined));\n+ assert(!equiv(undefined, 0));\n+\n+ assert(equiv(0, 0));\n+ assert(equiv(0, 0.0));\n+ assert(!equiv(0, 1));\n+ assert(!equiv(1, 0));\n+ assert(!equiv(0, \"0\"));\n+ assert(!equiv(\"0\", 0));\n+ assert(!equiv(0, [0]));\n+ assert(!equiv([0], 0));\n+ });\n+\n+ it(\"string\", () => {\n+ assert(!equiv(null, \"\"));\n+ assert(!equiv(\"\", null));\n+ });\n+\n+ it(\"array\", () => {\n+ assert(equiv([], []));\n+ assert(equiv([], []));\n+ assert(equiv([], { length: 0 }));\n+ assert(equiv({ length: 0 }, []));\n+ });\n+\n+ it(\"object\", () => {\n+ assert(!equiv(undefined, {}));\n+ assert(!equiv({}, undefined));\n+ assert(!equiv(null, {}));\n+ assert(!equiv({}, null));\n+\n+ assert(equiv({}, {}));\n+ assert(!equiv({}, []));\n+ assert(!equiv([], {}));\n+ assert(equiv({ a: 0 }, { a: 0 }));\n+ assert(equiv({ a: 0, b: { c: 1 } }, { a: 0, b: { c: 1 } }));\n+ assert(!equiv({ a: 0, b: { c: 1 } }, { a: 0, b: { c: 2 } }));\n+ assert(!equiv({ a: 0, b: { c: 1 } }, { a: 0, b: {} }));\n+ });\n+\n+ it(\"equiv impl\", () => {\n+ class A {\n+ a: any;\n+ constructor(a) {\n+ this.a = a;\n+ }\n+\n+ equiv(b) {\n+ return equiv(this.a, b);\n+ }\n+ }\n+\n+ assert(!equiv(new A(1), null));\n+ assert(!equiv(new A(1), undefined));\n+ assert(!equiv(null, new A(1)));\n+ assert(!equiv(undefined, new A(1)));\n+ assert(equiv(new A(1), new A(1)));\n+ assert(equiv(new A(1), 1));\n+ assert(equiv(1, new A(1)));\n+ assert(equiv(1, { equiv(x) { return x === 1; } }));\n+ assert(equiv({ equiv(x) { return x === 1; } }, 1));\n+ assert(!equiv(new A(1), new A(2)));\n+ assert(!equiv(new A(1), 2));\n+ });\n+\n});\n",
"new_path": "packages/api/test/index.ts",
"old_path": "packages/api/test/index.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(api): update equiv() null handling, add tests
BREAKING CHANGE: equiv now treats null & undefined as equal
| 1
|
feat
|
api
|
679,913
|
01.02.2018 06:15:14
| 0
|
1354e298089cf5372c26c26352d59d642548447e
|
fix(api): fix equiv string handling, update tests
|
[
{
"change_type": "MODIFY",
"diff": "import { isArrayLike } from \"@thi.ng/checks/is-arraylike\";\nimport { isPlainObject } from \"@thi.ng/checks/is-plain-object\";\n+import { isString } from \"@thi.ng/checks/is-string\";\nexport function equiv(a, b): boolean {\nif (a === b) {\n@@ -19,6 +20,9 @@ export function equiv(a, b): boolean {\n} else {\nreturn a == b;\n}\n+ if (isString(a) || isString(b)) {\n+ return a === b;\n+ }\nif (isPlainObject(a) && isPlainObject(b)) {\nreturn equivObject(a, b);\n}\n",
"new_path": "packages/api/src/equiv.ts",
"old_path": "packages/api/src/equiv.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -36,6 +36,8 @@ describe(\"equiv\", () => {\nit(\"string\", () => {\nassert(!equiv(null, \"\"));\nassert(!equiv(\"\", null));\n+ assert(equiv(\"a\", \"a\"));\n+ assert(!equiv(\"a\", \"ab\"));\n});\nit(\"array\", () => {\n@@ -43,6 +45,8 @@ describe(\"equiv\", () => {\nassert(equiv([], []));\nassert(equiv([], { length: 0 }));\nassert(equiv({ length: 0 }, []));\n+ assert(equiv([\"a\"], [\"a\"]));\n+ assert(!equiv([\"a\"], [\"b\"]));\n});\nit(\"object\", () => {\n",
"new_path": "packages/api/test/index.ts",
"old_path": "packages/api/test/index.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
fix(api): fix equiv string handling, update tests
| 1
|
fix
|
api
|
679,913
|
01.02.2018 06:17:01
| 0
|
ea638bef49ae0ca910c7dd24c53971394227846a
|
feat(rstream): add Cache subscription class
|
[
{
"change_type": "MODIFY",
"diff": "@@ -13,6 +13,7 @@ export * from \"./from/raf\";\nexport * from \"./from/worker\";\nexport * from \"./subs/bisect\";\n+export * from \"./subs/cache\";\nexport * from \"./subs/post-worker\";\nexport * from \"./subs/resolve\";\nexport * from \"./subs/sidechain-partition\";\n",
"new_path": "packages/rstream/src/index.ts",
"old_path": "packages/rstream/src/index.ts"
},
{
"change_type": "ADD",
"diff": "+import { IDeref } from \"@thi.ng/api/api\";\n+import { Transducer } from \"@thi.ng/transducers/api\";\n+\n+import { Subscription } from \"../subscription\";\n+\n+export class Cache<T> extends Subscription<any, T> implements\n+ IDeref<T> {\n+\n+ value: T;\n+\n+ constructor(xf?: Transducer<any, T>, id?: string) {\n+ super(null, xf, null, id || `cache-${Subscription.NEXT_ID++}`);\n+ }\n+\n+ deref(): T {\n+ return this.value;\n+ }\n+\n+ dispatch(x: T) {\n+ this.value = x;\n+ super.dispatch(x);\n+ }\n+}\n+\n+export function cache<T>(xf?: Transducer<any, T>, id?: string) {\n+ return new Cache(xf, id);\n+}\n",
"new_path": "packages/rstream/src/subs/cache.ts",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(rstream): add Cache subscription class
| 1
|
feat
|
rstream
|
573,227
|
01.02.2018 11:19:37
| 28,800
|
49eb008d987f1c425989b78e2336e3583e05a88a
|
chore(travisci): revisit nodejs version. Change to: LTS active, LTS maintenance (4.x) and stable releases
BREAKING CHANGE: dropping support below Node.js 4
|
[
{
"change_type": "MODIFY",
"diff": "sudo: false\nlanguage: node_js\nnode_js:\n- - \"4\"\n- - \"6\"\n- - \"7\"\n- - \"8\"\n- - \"stable\"\n+ - \"4\" # Maintenance LTS release\n+ - \"lts/*\" # Active LTS release\n+ - \"node\" # Latest stable release\nenv:\n- - TEST_SKIP_IP_V6=true\n+ - TEST_SKIP_IP_V6=true # Current TravisCI (trusty) doesn't support IPv6\nnotifications:\nwebhooks:\nurls:\n",
"new_path": ".travis.yml",
"old_path": ".travis.yml"
},
{
"change_type": "MODIFY",
"diff": "\"report-latency\": \"./bin/report-latency\"\n},\n\"engines\": {\n- \"node\": \">=0.10\"\n+ \"node\": \">=4.0\"\n},\n\"dependencies\": {\n\"assert-plus\": \"^1.0.0\",\n",
"new_path": "package.json",
"old_path": "package.json"
}
] |
JavaScript
|
MIT License
|
restify/node-restify
|
chore(travisci): revisit nodejs version. Change to: LTS active, LTS maintenance (4.x) and stable releases (#1553)
BREAKING CHANGE: dropping support below Node.js 4
| 1
|
chore
|
travisci
|
807,849
|
01.02.2018 12:14:23
| 28,800
|
01c3edad0b33f80d856d85b1f66fd6ddb6ecb356
|
refactor: add .manifestLocation getter to Package class
|
[
{
"change_type": "MODIFY",
"diff": "@@ -23,6 +23,10 @@ class Package {\nreturn this._location;\n}\n+ get manifestLocation() {\n+ return path.join(this._location, \"package.json\");\n+ }\n+\nget nodeModulesLocation() {\nreturn path.join(this._location, \"node_modules\");\n}\n",
"new_path": "src/Package.js",
"old_path": "src/Package.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -583,7 +583,6 @@ class PublishCommand extends Command {\nthis.updates.forEach(update => {\nconst pkg = update.package;\n- const packageJsonLocation = path.join(pkg.location, \"package.json\");\n// set new version\npkg.version = this.updatesVersions[pkg.name] || pkg.version;\n@@ -596,7 +595,7 @@ class PublishCommand extends Command {\nthis.runSyncScriptInPackage(pkg, \"preversion\");\n// write new package\n- writePkg.sync(packageJsonLocation, pkg.toJSON());\n+ writePkg.sync(pkg.manifestLocation, pkg.toJSON());\n// NOTE: Object.prototype.toJSON() is normally called when passed to\n// JSON.stringify(), but write-pkg iterates Object.keys() before serializing\n// so it has to be explicit here (otherwise it mangles the instance properties)\n@@ -617,7 +616,7 @@ class PublishCommand extends Command {\n}\n// push to be git committed\n- changedFiles.push(packageJsonLocation);\n+ changedFiles.push(pkg.manifestLocation);\n});\nif (conventionalCommits && !independentVersions) {\n",
"new_path": "src/commands/PublishCommand.js",
"old_path": "src/commands/PublishCommand.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
refactor: add .manifestLocation getter to Package class
| 1
|
refactor
| null |
807,849
|
01.02.2018 12:47:21
| 28,800
|
c1b567d456f5f582772f46a9072bea56c1868da2
|
fix(lint): enforce no-param-reassign with useful options
|
[
{
"change_type": "MODIFY",
"diff": "- version: 6.9.0\nno-param-reassign:\n- error\n- - ignorePropertyModificationsFor:\n- - err\n+ - props: true\n+ ignorePropertyModificationsFor:\n+ - err # Error decoration\n+ - obj # .reduce() object\n+ - pkg # Package instance\nno-underscore-dangle:\n- error\n- allowAfterThis: true\n",
"new_path": ".eslintrc.yaml",
"old_path": ".eslintrc.yaml"
},
{
"change_type": "MODIFY",
"diff": "@@ -385,15 +385,16 @@ class Command {\n}\n_legacyOptions() {\n- return [\"bootstrap\", \"publish\"].reduce((opts, command) => {\n+ return [\"bootstrap\", \"publish\"].reduce((obj, command) => {\nif (this.name === command && this.repository.lernaJson[`${command}Config`]) {\nlog.warn(\n\"deprecated\",\n`\\`${command}Config.ignore\\` has been replaced by \\`command.${command}.ignore\\`.`\n);\n- opts.ignore = this.repository.lernaJson[`${command}Config`].ignore;\n+ obj.ignore = this.repository.lernaJson[`${command}Config`].ignore;\n}\n- return opts;\n+\n+ return obj;\n}, {});\n}\n",
"new_path": "src/Command.js",
"old_path": "src/Command.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -74,10 +74,10 @@ function installInDir(directory, dependencies, config, callback) {\n// Construct a basic fake package.json with just the deps we need to install.\nconst tempJson = {\n- dependencies: dependencies.reduce((deps, dep) => {\n+ dependencies: dependencies.reduce((obj, dep) => {\nconst [pkg, version] = splitVersion(dep);\n- deps[pkg] = version || \"*\";\n- return deps;\n+ obj[pkg] = version || \"*\";\n+ return obj;\n}, {}),\n};\n",
"new_path": "src/NpmUtilities.js",
"old_path": "src/NpmUtilities.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -28,6 +28,7 @@ class VersionSerializer {\nthis._strippedPrefixes.forEach((prefix, name) => {\nconst version = dependencies[name];\nif (version) {\n+ // eslint-disable-next-line no-param-reassign\ndependencies[name] = `${prefix}${version}`;\n}\n});\n@@ -39,6 +40,7 @@ class VersionSerializer {\nconst result = this._versionParser.parseVersion(dependencies[name]);\nif (result.prefix) {\n+ // eslint-disable-next-line no-param-reassign\ndependencies[name] = result.version;\nthis._strippedPrefixes.set(name, result.prefix);\n}\n",
"new_path": "src/VersionSerializer.js",
"old_path": "src/VersionSerializer.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -119,15 +119,17 @@ class AddCommand extends Command {\nconst notSamePackage = pkgToInstall => pkgToChange.name !== pkgToInstall.name;\n- const applicable = this.packagesToInstall.filter(notSamePackage).reduce((results, pkgToInstall) => {\n+ const applicable = this.packagesToInstall.filter(notSamePackage).reduce((obj, pkgToInstall) => {\nconst deps = pkgToChange[this.dependencyType] || {};\nconst current = deps[pkgToInstall.name];\nconst range = getRangeToReference(current, pkgToInstall.version, pkgToInstall.versionRange);\n- const id = `${pkgToInstall.name}@${range}`;\n- const message = `Add ${id} as ${this.dependencyType} in ${pkgToChange.name}`;\n- this.logger.verbose(message);\n- results[pkgToInstall.name] = range;\n- return results;\n+\n+ this.logger.verbose(\n+ `Add ${pkgToInstall.name}@${range} as ${this.dependencyType} in ${pkgToChange.name}`\n+ );\n+ obj[pkgToInstall.name] = range;\n+\n+ return obj;\n}, {});\nreturn readPkg(manifestPath, { normalize: false })\n",
"new_path": "src/commands/AddCommand.js",
"old_path": "src/commands/AddCommand.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -251,9 +251,9 @@ class PublishCommand extends Command {\nthis.masterVersion = version;\nthis.updatesVersions =\nversions ||\n- this.updates.reduce((acc, update) => {\n- acc[update.package.name] = version;\n- return acc;\n+ this.updates.reduce((obj, update) => {\n+ obj[update.package.name] = version;\n+ return obj;\n}, {});\nthis.confirmVersions(callback);\n@@ -324,12 +324,11 @@ class PublishCommand extends Command {\nif (cdVersion && !canary) {\nif (independentVersions) {\n// Independent Semver Keyword Mode\n- const versions = {};\n-\n- this.updates.forEach(update => {\n+ const versions = this.updates.reduce((obj, update) => {\nconst { name, version } = update.package;\n- versions[name] = semver.inc(version, cdVersion, preid);\n- });\n+ obj[name] = semver.inc(version, cdVersion, preid);\n+ return obj;\n+ }, {});\nreturn callback(null, { versions });\n}\n@@ -348,11 +347,11 @@ class PublishCommand extends Command {\nif (canary) {\nif (independentVersions) {\n// Independent Canary Mode\n- const versions = {};\n- this.updates.forEach(update => {\n+ const versions = this.updates.reduce((obj, update) => {\nconst { name, version } = update.package;\n- versions[name] = this.getCanaryVersion(version, canary);\n- });\n+ obj[name] = this.getCanaryVersion(version, canary);\n+ return obj;\n+ }, {});\nreturn callback(null, { versions });\n}\n@@ -366,6 +365,7 @@ class PublishCommand extends Command {\nif (independentVersions) {\n// Independent Conventional-Commits Mode\nconst versions = {};\n+\nthis.recommendVersions(\nthis.updates,\nConventionalCommitUtilities.recommendIndependentVersion,\n@@ -392,6 +392,7 @@ class PublishCommand extends Command {\n});\nlet version = \"0.0.0\";\n+\nthis.recommendVersions(this.updates, ConventionalCommitUtilities.recommendFixedVersion, versionBump => {\nif (semver.gt(versionBump.recommendedVersion, version)) {\nversion = versionBump.recommendedVersion;\n@@ -409,14 +410,15 @@ class PublishCommand extends Command {\n(update, cb) => {\nthis.promptVersion(update.package.name, update.package.version, cb);\n},\n- (err, versions) => {\n+ (err, result) => {\nif (err) {\nreturn callback(err);\n}\n- this.updates.forEach((update, index) => {\n- versions[update.package.name] = versions[index];\n- });\n+ const versions = this.updates.reduce((obj, update, index) => {\n+ obj[update.package.name] = result[index];\n+ return obj;\n+ }, {});\nreturn callback(null, { versions });\n}\n",
"new_path": "src/commands/PublishCommand.js",
"old_path": "src/commands/PublishCommand.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -45,7 +45,9 @@ module.exports = {\nreturn stabilizeString(thing);\n}\n+ // eslint-disable-next-line no-param-reassign\nthing.lerna = stableVersion(thing.lerna);\n+\nreturn serialize(thing);\n},\n};\n",
"new_path": "test/helpers/serializePlaceholders.js",
"old_path": "test/helpers/serializePlaceholders.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -79,6 +79,7 @@ function makeWorkAround() {\nhasWarned = true;\n}\n+ // eslint-disable-next-line no-param-reassign\ncontext[\"--\"] = args.slice(doubleDashed + 1);\n}\n};\n",
"new_path": "test/helpers/yargsRunner.js",
"old_path": "test/helpers/yargsRunner.js"
},
{
"change_type": "MODIFY",
"diff": "\"use strict\";\n+const _ = require(\"lodash\");\nconst path = require(\"path\");\nconst execa = require(\"execa\");\nconst globby = require(\"globby\");\n@@ -20,10 +21,7 @@ const getPkgs = async cwd => {\nconst load = loadFrom(cwd);\nconst manifests = await Promise.all(pkgs.map(pkg => load(pkg)));\n- return manifests.reduce((results, manifest) => {\n- results[manifest.name] = manifest;\n- return results;\n- }, {});\n+ return _.keyBy(manifests, \"name\");\n};\ndescribe(\"lerna add\", () => {\n",
"new_path": "test/integration/lerna-add.test.js",
"old_path": "test/integration/lerna-add.test.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
fix(lint): enforce no-param-reassign with useful options
| 1
|
fix
|
lint
|
679,913
|
01.02.2018 15:07:16
| 0
|
a580f722e3150f862e51098cbf8ff9ab852a74cc
|
build: update deps (typescript & typedoc)
|
[
{
"change_type": "MODIFY",
"diff": "\"mocha\": \"^5.0.0\",\n\"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n- \"typedoc\": \"^0.9.0\",\n- \"typescript\": \"^2.6.2\",\n+ \"typedoc\": \"^0.10.0\",\n+ \"typescript\": \"^2.7.1\",\n\"webpack\": \"^3.10.0\"\n},\n\"dependencies\": {\n",
"new_path": "packages/api/package.json",
"old_path": "packages/api/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"mocha\": \"^5.0.0\",\n\"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n- \"typedoc\": \"^0.9.0\",\n- \"typescript\": \"^2.6.2\",\n+ \"typedoc\": \"^0.10.0\",\n+ \"typescript\": \"^2.7.1\",\n\"webpack\": \"^3.10.0\"\n},\n\"dependencies\": {\n",
"new_path": "packages/atom/package.json",
"old_path": "packages/atom/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"mocha\": \"^5.0.0\",\n\"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n- \"typedoc\": \"^0.9.0\",\n- \"typescript\": \"^2.6.2\",\n+ \"typedoc\": \"^0.10.0\",\n+ \"typescript\": \"^2.7.1\",\n\"webpack\": \"^3.10.0\"\n},\n\"keywords\": [\n",
"new_path": "packages/bitstream/package.json",
"old_path": "packages/bitstream/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"mocha\": \"^5.0.0\",\n\"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n- \"typedoc\": \"^0.9.0\",\n- \"typescript\": \"^2.6.2\",\n+ \"typedoc\": \"^0.10.0\",\n+ \"typescript\": \"^2.7.1\",\n\"webpack\": \"^3.10.0\"\n},\n\"keywords\": [\n",
"new_path": "packages/checks/package.json",
"old_path": "packages/checks/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"mocha\": \"^5.0.0\",\n\"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n- \"typedoc\": \"^0.9.0\",\n- \"typescript\": \"^2.6.2\",\n+ \"typedoc\": \"^0.10.0\",\n+ \"typescript\": \"^2.7.1\",\n\"webpack\": \"^3.10.0\"\n},\n\"dependencies\": {\n",
"new_path": "packages/csp/package.json",
"old_path": "packages/csp/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"mocha\": \"^5.0.0\",\n\"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n- \"typedoc\": \"^0.9.0\",\n- \"typescript\": \"^2.6.2\",\n+ \"typedoc\": \"^0.10.0\",\n+ \"typescript\": \"^2.7.1\",\n\"webpack\": \"^3.10.0\"\n},\n\"dependencies\": {\n",
"new_path": "packages/dcons/package.json",
"old_path": "packages/dcons/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"mocha\": \"^5.0.0\",\n\"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n- \"typedoc\": \"^0.9.0\",\n- \"typescript\": \"^2.6.2\",\n+ \"typedoc\": \"^0.10.0\",\n+ \"typescript\": \"^2.7.1\",\n\"webpack\": \"^3.10.0\"\n},\n\"dependencies\": {\n",
"new_path": "packages/iterators/package.json",
"old_path": "packages/iterators/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"mocha\": \"^5.0.0\",\n\"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n- \"typedoc\": \"^0.9.0\",\n- \"typescript\": \"^2.6.2\",\n+ \"typedoc\": \"^0.10.0\",\n+ \"typescript\": \"^2.7.1\",\n\"webpack\": \"^3.10.0\"\n},\n\"dependencies\": {\n",
"new_path": "packages/rle-pack/package.json",
"old_path": "packages/rle-pack/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"mocha\": \"^5.0.0\",\n\"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n- \"typedoc\": \"^0.9.0\",\n- \"typescript\": \"^2.6.2\",\n+ \"typedoc\": \"^0.10.0\",\n+ \"typescript\": \"^2.7.1\",\n\"webpack\": \"^3.10.0\"\n},\n\"dependencies\": {\n",
"new_path": "packages/rstream-csp/package.json",
"old_path": "packages/rstream-csp/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"mocha\": \"^5.0.0\",\n\"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n- \"typedoc\": \"^0.9.0\",\n- \"typescript\": \"^2.6.2\",\n+ \"typedoc\": \"^0.10.0\",\n+ \"typescript\": \"^2.7.1\",\n\"webpack\": \"^3.10.0\"\n},\n\"dependencies\": {\n",
"new_path": "packages/rstream-log/package.json",
"old_path": "packages/rstream-log/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"mocha\": \"^5.0.0\",\n\"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n- \"typedoc\": \"^0.9.0\",\n- \"typescript\": \"^2.6.2\",\n+ \"typedoc\": \"^0.10.0\",\n+ \"typescript\": \"^2.7.1\",\n\"webpack\": \"^3.10.0\"\n},\n\"dependencies\": {\n",
"new_path": "packages/rstream/package.json",
"old_path": "packages/rstream/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"mocha\": \"^5.0.0\",\n\"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n- \"typedoc\": \"^0.9.0\",\n- \"typescript\": \"^2.6.2\",\n+ \"typedoc\": \"^0.10.0\",\n+ \"typescript\": \"^2.7.1\",\n\"webpack\": \"^3.10.0\"\n},\n\"dependencies\": {\n",
"new_path": "packages/transducers/package.json",
"old_path": "packages/transducers/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"mocha\": \"^5.0.0\",\n\"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n- \"typedoc\": \"^0.9.0\",\n- \"typescript\": \"^2.6.2\",\n+ \"typedoc\": \"^0.10.0\",\n+ \"typescript\": \"^2.7.1\",\n\"webpack\": \"^3.10.0\"\n},\n\"keywords\": [\n",
"new_path": "packages/unionstruct/package.json",
"old_path": "packages/unionstruct/package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -48,8 +48,8 @@ cat << EOF > $MODULE/package.json\n\"@types/node\": \"^9.3.0\",\n\"mocha\": \"^5.0.0\",\n\"ts-loader\": \"^3.3.1\",\n- \"typedoc\": \"^0.9.0\",\n- \"typescript\": \"^2.6.2\",\n+ \"typedoc\": \"^0.10.0\",\n+ \"typescript\": \"^2.7.1\",\n\"webpack\": \"^3.10.0\"\n},\n\"dependencies\": {\n",
"new_path": "scripts/make-module",
"old_path": "scripts/make-module"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
build: update deps (typescript & typedoc)
| 1
|
build
| null |
679,913
|
01.02.2018 15:09:20
| 0
|
febe39f1294e3225b9ea89e68c5a99fd7f77bc10
|
fix(transducers): update comp() for typescript 2.7.*
|
[
{
"change_type": "MODIFY",
"diff": "@@ -37,7 +37,8 @@ export function comp(...fns: ((x: any) => any)[]) {\ncase 10:\ndefault:\nlet ff = (x) => a(b(c(d(e(f(g(h(i(j(x))))))))));\n- return fns.length === 10 ? ff : comp(ff, ...fns.slice(10));\n+ // TODO TS2.7.* complains about args here?\n+ return fns.length === 10 ? ff : (<any>comp)(ff, ...fns.slice(10));\n}\n}\n",
"new_path": "packages/transducers/src/func/comp.ts",
"old_path": "packages/transducers/src/func/comp.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
fix(transducers): update comp() for typescript 2.7.*
| 1
|
fix
|
transducers
|
679,913
|
01.02.2018 15:17:06
| 0
|
0439d24b26dfeff666989afca74f19d843e9efe0
|
refactor(hiccup): update/add deps, restructure/split into sub-modules
|
[
{
"change_type": "MODIFY",
"diff": "\"mocha\": \"^5.0.0\",\n\"nyc\": \"^11.4.1\",\n\"ts-loader\": \"^3.3.1\",\n- \"typedoc\": \"^0.9.0\",\n- \"typescript\": \"^2.6.2\",\n+ \"typedoc\": \"^0.10.0\",\n+ \"typescript\": \"^2.7.1\",\n\"webpack\": \"^3.10.0\"\n},\n+ \"dependencies\": {\n+ \"@thi.ng/checks\": \"^1.1.4\"\n+ },\n\"keywords\": [\n\"ES6\",\n\"clojure\",\n",
"new_path": "packages/hiccup/package.json",
"old_path": "packages/hiccup/package.json"
},
{
"change_type": "ADD",
"diff": "+export const SVG_NS = \"http://www.w3.org/2000/svg\";\n+\n+export const TAG_REGEXP = /^([^\\s\\.#]+)(?:#([^\\s\\.#]+))?(?:\\.([^\\s#]+))?$/;\n+\n+// tslint:disable-next-line\n+export const SVG_TAGS = \"svg circle clipPath defs ellipse g line linearGradient mask path pattern polygon polyline radialGradient rect stop symbol text\"\n+ .split(\" \")\n+ .reduce((acc, x) => (acc[x] = 1, acc), {});\n+\n+// tslint:disable-next-line\n+export const VOID_TAGS = \"area base br col command embed hr img input keygen link meta param source track wbr circle ellipse line path polygon polyline rect stop\"\n+ .split(\" \")\n+ .reduce((acc, x) => (acc[x] = 1, acc), {});\n+\n+export const ENTITIES = {\n+ \"&\": \"&\",\n+ \"<\": \"<\",\n+ \">\": \">\",\n+ '\"': \""\",\n+ \"'\": \"'\",\n+};\n+\n+export const ENTITY_RE = new RegExp(`[${Object.keys(ENTITIES)}]`, \"g\");\n",
"new_path": "packages/hiccup/src/api.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+export const css = (rules: any) => {\n+ const css = [];\n+ for (let r in rules) {\n+ if (rules.hasOwnProperty(r)) {\n+ css.push(r + \":\" + rules[r] + \";\");\n+ }\n+ }\n+ return css.join(\"\");\n+};\n",
"new_path": "packages/hiccup/src/css.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { ENTITY_RE, ENTITIES } from \"./api\";\n+\n+export const escape = (x: string) => x.replace(ENTITY_RE, (y) => ENTITIES[y]);\n",
"new_path": "packages/hiccup/src/escape.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "-export const SVG_NS = \"http://www.w3.org/2000/svg\";\n-\n-const TAG_REGEXP = /^([^\\s\\.#]+)(?:#([^\\s\\.#]+))?(?:\\.([^\\s#]+))?$/;\n-\n-// tslint:disable-next-line\n-// const SVG_REGEXP = /^(svg|circle|clipPath|defs|ellipse|g|line|linearGradient|mask|path|pattern|polygon|polyline|radialGradient|rect|stop|symbol|text)$/;\n-\n-// tslint:disable-next-line\n-const VOID_TAGS = [\n- \"area\", \"base\", \"br\", \"col\", \"command\", \"embed\", \"hr\", \"img\", \"input\", \"keygen\", \"link\", \"meta\", \"param\", \"source\", \"track\", \"wbr\",\n- \"circle\", \"ellipse\", \"line\", \"path\", \"polygon\", \"polyline\", \"rect\", \"stop\"\n-].reduce((acc, x) => (acc[x] = 1, acc), {});\n-\n-const ENTITIES = {\n- \"&\": \"&\",\n- \"<\": \"<\",\n- \">\": \">\",\n- '\"': \""\",\n- \"'\": \"'\",\n-};\n-\n-const ENTITY_RE = new RegExp(`[${Object.keys(ENTITIES)}]`, \"g\");\n-\n-/**\n- * Recursively normalizes and serializes given tree as HTML/SVG/XML string.\n- * Expands any embedded component functions with their results. Each node of the\n- * input tree can have one of the following input forms:\n- *\n- * ```js\n- * [\"tag\", ...]\n- * [\"tag#id.class1.class2\", ...]\n- * [\"tag\", {other: \"attrib\"}, ...]\n- * [\"tag\", {...}, \"body\", function, ...]\n- * [function, arg1, arg2, ...]\n- * [iterable]\n- * ```\n- *\n- * Tags can be defined in \"Zencoding\" convention, e.g.\n- *\n- * ```js\n- * [\"div#foo.bar.baz\", \"hi\"] // <div id=\"foo\" class=\"bar baz\">hi</div>\n- * ```\n- *\n- * The presence of the attributes object (2nd array index) is optional.\n- * Any attribute values, incl. functions are allowed. If the latter,\n- * the function is called with the full attribs object as argument and\n- * MUST return a string. This allows for the dynamic creation of attrib\n- * values based on other attribs.\n- *\n- * ```js\n- * [\"div#foo\", {bar: (attribs) => attribs.id + \"-bar\"}]\n- * // <div id=\"foo\" bar=\"foo-bar\"></div>\n- * ```\n- *\n- * The `style` attribute can ONLY be defined as string or object.\n- *\n- * ```js\n- * [\"div\", {style: {color: \"red\", background: \"#000\"}}]\n- * // <div style=\"color:red;background:#000;\"></div>\n- * ```\n- *\n- * Boolean attribs are serialized in HTML5 syntax (present or not).\n- * `null` or empty string attrib values are ignored.\n- *\n- * Any `null` or `undefined` array values (other than in head position)\n- * will be removed, unless a function is in head position.\n- *\n- * A function in head position of a node acts as composition & delayed\n- * execution mechanism and the function will only be executed at\n- * serialization time. In this case all other elements of that node /\n- * array are passed as arguments when that function is called.\n- * The return value the function MUST be a valid new tree\n- * (or `undefined`).\n- *\n- * ```js\n- * const foo = (a, b) => [\"div#\" + a, b];\n- *\n- * [foo, \"id\", \"body\"] // <div id=\"id\">body</div>\n- * ```\n- *\n- * Functions located in other positions are called **without** args\n- * and can return any (serializable) value (i.e. new trees, strings,\n- * numbers, iterables or any type with a suitable `.toString()`\n- * implementation).\n- *\n- * @param tree elements / component tree\n- * @param escape auto-escape entities\n- */\n-const serialize = (tree: any[], escape = false) => _serialize(tree, escape);\n-\n-const _serialize = (tree: any, esc: boolean) => {\n- if (tree == null) {\n- return \"\";\n- }\n- if (Array.isArray(tree)) {\n- if (!tree.length) {\n- return \"\";\n- }\n- let tag = tree[0];\n- if (fn(tag)) {\n- return _serialize(tag.apply(null, tree.slice(1)), esc);\n- }\n- if (str(tag)) {\n- tree = normalize(tree);\n- tag = tree[0];\n- let attribs = tree[1],\n- body = tree[2],\n- res = `<${tag}`;\n- for (let a in attribs) {\n- if (attribs.hasOwnProperty(a)) {\n- let v = attribs[a];\n- if (v != null) {\n- if (fn(v)) {\n- if ((v = v(attribs)) == null) {\n- continue;\n- }\n- }\n- if (v === true) {\n- res += \" \" + a;\n- } else if (v !== false) {\n- v = v.toString();\n- if (v.length) {\n- res += ` ${a}=\"${esc ? escape(v) : v}\"`;\n- }\n- }\n- }\n- }\n- }\n- if (body) {\n- if (VOID_TAGS[tag]) {\n- throw new Error(`No body allowed in tag: ${tag}`);\n- }\n- res += \">\";\n- for (let i = 0, n = body.length; i < n; i++) {\n- res += _serialize(body[i], esc);\n- }\n- return res += `</${tag}>`;\n- } else if (!VOID_TAGS[tag]) {\n- return res += `></${tag}>`;\n- }\n- return res += \"/>\";\n- }\n- if (iter(tree)) {\n- return _serializeIter(tree, esc);\n- }\n- throw new Error(`invalid tree node: ${tree}`);\n- }\n- if (fn(tree)) {\n- return _serialize(tree(), esc);\n- }\n- if (iter(tree)) {\n- return _serializeIter(tree, esc);\n- }\n- return esc ? escape(tree.toString()) : tree;\n-};\n-\n-const _serializeIter = (iter: Iterable<any>, esc: boolean) => {\n- const res = [];\n- for (let i of iter) {\n- res.push(_serialize(i, esc));\n- }\n- return res.join(\"\");\n-}\n-\n-const normalize = (tag: any[]) => {\n- let el = tag[0], match, id, clazz;\n- const attribs: any = {};\n- if (!str(el) || !(match = TAG_REGEXP.exec(el))) {\n- throw new Error(`\"${el}\" is not a valid tag name`);\n- }\n- el = match[1];\n- id = match[2];\n- clazz = match[3];\n- if (id) {\n- attribs.id = id;\n- }\n- if (clazz) {\n- attribs.class = clazz.replace(/\\./g, \" \");\n- }\n- if (tag.length > 1) {\n- let i = 1;\n- if (obj(tag[1])) {\n- Object.assign(attribs, tag[1]);\n- i++;\n- }\n- if (obj(attribs.style)) {\n- attribs.style = css(attribs.style);\n- }\n- tag = tag.slice(i).filter((x) => x != null);\n- if (tag.length > 0) {\n- return [el, attribs, tag];\n- }\n- }\n- return [el, attribs];\n-};\n-\n-const css = (rules: any) => {\n- const css = [];\n- for (let r in rules) {\n- if (rules.hasOwnProperty(r)) {\n- css.push(r + \":\" + rules[r] + \";\");\n- }\n- }\n- return css.join(\"\");\n-};\n-\n-const obj = (x) => Object.prototype.toString.call(x) === \"[object Object]\";\n-const fn = (x) => typeof x === \"function\";\n-const str = (x) => typeof x === \"string\";\n-const iter = (x) => !str(x) && x[Symbol.iterator] !== undefined;\n-\n-const escape = (x: string) => x.replace(ENTITY_RE, (y) => ENTITIES[y]);\n-\n-export {\n- serialize,\n- escape,\n-};\n+export * from \"./api\";\n+export * from \"./css\";\n+export * from \"./escape\";\n+export * from \"./serialize\";\n",
"new_path": "packages/hiccup/src/index.ts",
"old_path": "packages/hiccup/src/index.ts"
},
{
"change_type": "ADD",
"diff": "+import { isPlainObject } from \"@thi.ng/checks/is-plain-object\";\n+import { isFunction } from \"@thi.ng/checks/is-function\";\n+import { isString } from \"@thi.ng/checks/is-string\";\n+\n+import { TAG_REGEXP, VOID_TAGS } from \"./api\";\n+import { css } from \"./css\";\n+\n+/**\n+ * Recursively normalizes and serializes given tree as HTML/SVG/XML string.\n+ * Expands any embedded component functions with their results. Each node of the\n+ * input tree can have one of the following input forms:\n+ *\n+ * ```js\n+ * [\"tag\", ...]\n+ * [\"tag#id.class1.class2\", ...]\n+ * [\"tag\", {other: \"attrib\"}, ...]\n+ * [\"tag\", {...}, \"body\", function, ...]\n+ * [function, arg1, arg2, ...]\n+ * [iterable]\n+ * ```\n+ *\n+ * Tags can be defined in \"Zencoding\" convention, e.g.\n+ *\n+ * ```js\n+ * [\"div#foo.bar.baz\", \"hi\"] // <div id=\"foo\" class=\"bar baz\">hi</div>\n+ * ```\n+ *\n+ * The presence of the attributes object (2nd array index) is optional.\n+ * Any attribute values, incl. functions are allowed. If the latter,\n+ * the function is called with the full attribs object as argument and\n+ * MUST return a string. This allows for the dynamic creation of attrib\n+ * values based on other attribs.\n+ *\n+ * ```js\n+ * [\"div#foo\", {bar: (attribs) => attribs.id + \"-bar\"}]\n+ * // <div id=\"foo\" bar=\"foo-bar\"></div>\n+ * ```\n+ *\n+ * The `style` attribute can ONLY be defined as string or object.\n+ *\n+ * ```js\n+ * [\"div\", {style: {color: \"red\", background: \"#000\"}}]\n+ * // <div style=\"color:red;background:#000;\"></div>\n+ * ```\n+ *\n+ * Boolean attribs are serialized in HTML5 syntax (present or not).\n+ * `null` or empty string attrib values are ignored.\n+ *\n+ * Any `null` or `undefined` array values (other than in head position)\n+ * will be removed, unless a function is in head position.\n+ *\n+ * A function in head position of a node acts as composition & delayed\n+ * execution mechanism and the function will only be executed at\n+ * serialization time. In this case all other elements of that node /\n+ * array are passed as arguments when that function is called.\n+ * The return value the function MUST be a valid new tree\n+ * (or `undefined`).\n+ *\n+ * ```js\n+ * const foo = (a, b) => [\"div#\" + a, b];\n+ *\n+ * [foo, \"id\", \"body\"] // <div id=\"id\">body</div>\n+ * ```\n+ *\n+ * Functions located in other positions are called **without** args\n+ * and can return any (serializable) value (i.e. new trees, strings,\n+ * numbers, iterables or any type with a suitable `.toString()`\n+ * implementation).\n+ *\n+ * @param tree elements / component tree\n+ * @param escape auto-escape entities\n+ */\n+export const serialize = (tree: any[], escape = false) => _serialize(tree, escape);\n+\n+const _serialize = (tree: any, esc: boolean) => {\n+ if (tree == null) {\n+ return \"\";\n+ }\n+ if (Array.isArray(tree)) {\n+ if (!tree.length) {\n+ return \"\";\n+ }\n+ let tag = tree[0];\n+ if (isFunction(tag)) {\n+ return _serialize(tag.apply(null, tree.slice(1)), esc);\n+ }\n+ if (isString(tag)) {\n+ tree = normalize(tree);\n+ tag = tree[0];\n+ let attribs = tree[1],\n+ body = tree[2],\n+ res = `<${tag}`;\n+ for (let a in attribs) {\n+ if (attribs.hasOwnProperty(a)) {\n+ let v = attribs[a];\n+ if (v != null) {\n+ if (isFunction(v)) {\n+ if ((v = v(attribs)) == null) {\n+ continue;\n+ }\n+ }\n+ if (v === true) {\n+ res += \" \" + a;\n+ } else if (v !== false) {\n+ v = v.toString();\n+ if (v.length) {\n+ res += ` ${a}=\"${esc ? escape(v) : v}\"`;\n+ }\n+ }\n+ }\n+ }\n+ }\n+ if (body) {\n+ if (VOID_TAGS[tag]) {\n+ throw new Error(`No body allowed in tag: ${tag}`);\n+ }\n+ res += \">\";\n+ for (let i = 0, n = body.length; i < n; i++) {\n+ res += _serialize(body[i], esc);\n+ }\n+ return res += `</${tag}>`;\n+ } else if (!VOID_TAGS[tag]) {\n+ return res += `></${tag}>`;\n+ }\n+ return res += \"/>\";\n+ }\n+ if (iter(tree)) {\n+ return _serializeIter(tree, esc);\n+ }\n+ throw new Error(`invalid tree node: ${tree}`);\n+ }\n+ if (isFunction(tree)) {\n+ return _serialize(tree(), esc);\n+ }\n+ if (iter(tree)) {\n+ return _serializeIter(tree, esc);\n+ }\n+ return esc ? escape(tree.toString()) : tree;\n+};\n+\n+const _serializeIter = (iter: Iterable<any>, esc: boolean) => {\n+ const res = [];\n+ for (let i of iter) {\n+ res.push(_serialize(i, esc));\n+ }\n+ return res.join(\"\");\n+}\n+\n+const normalize = (tag: any[]) => {\n+ let el = tag[0], match, id, clazz;\n+ const attribs: any = {};\n+ if (!isString(el) || !(match = TAG_REGEXP.exec(el))) {\n+ throw new Error(`\"${el}\" is not a valid tag name`);\n+ }\n+ el = match[1];\n+ id = match[2];\n+ clazz = match[3];\n+ if (id) {\n+ attribs.id = id;\n+ }\n+ if (clazz) {\n+ attribs.class = clazz.replace(/\\./g, \" \");\n+ }\n+ if (tag.length > 1) {\n+ let i = 1;\n+ if (isPlainObject(tag[1])) {\n+ Object.assign(attribs, tag[1]);\n+ i++;\n+ }\n+ if (isPlainObject(attribs.style)) {\n+ attribs.style = css(attribs.style);\n+ }\n+ tag = tag.slice(i).filter((x) => x != null);\n+ if (tag.length > 0) {\n+ return [el, attribs, tag];\n+ }\n+ }\n+ return [el, attribs];\n+};\n+\n+const iter = (x) => !isString(x) && x[Symbol.iterator] !== undefined;\n",
"new_path": "packages/hiccup/src/serialize.ts",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(hiccup): update/add deps, restructure/split into sub-modules
| 1
|
refactor
|
hiccup
|
679,913
|
01.02.2018 15:18:35
| 0
|
4d0d437b4b71075f995431109e773175bb2eaf19
|
feat(diff): re-import diff package (MBP2010)
|
[
{
"change_type": "ADD",
"diff": "+build\n+coverage\n+dev\n+doc\n+src*\n+test\n+.nyc_output\n+*.tgz\n+*.html\n",
"new_path": "packages/diff/.npmignore",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+ Apache License\n+ Version 2.0, January 2004\n+ http://www.apache.org/licenses/\n+\n+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n+\n+ 1. Definitions.\n+\n+ \"License\" shall mean the terms and conditions for use, reproduction,\n+ and distribution as defined by Sections 1 through 9 of this document.\n+\n+ \"Licensor\" shall mean the copyright owner or entity authorized by\n+ the copyright owner that is granting the License.\n+\n+ \"Legal Entity\" shall mean the union of the acting entity and all\n+ other entities that control, are controlled by, or are under common\n+ control with that entity. For the purposes of this definition,\n+ \"control\" means (i) the power, direct or indirect, to cause the\n+ direction or management of such entity, whether by contract or\n+ otherwise, or (ii) ownership of fifty percent (50%) or more of the\n+ outstanding shares, or (iii) beneficial ownership of such entity.\n+\n+ \"You\" (or \"Your\") shall mean an individual or Legal Entity\n+ exercising permissions granted by this License.\n+\n+ \"Source\" form shall mean the preferred form for making modifications,\n+ including but not limited to software source code, documentation\n+ source, and configuration files.\n+\n+ \"Object\" form shall mean any form resulting from mechanical\n+ transformation or translation of a Source form, including but\n+ not limited to compiled object code, generated documentation,\n+ and conversions to other media types.\n+\n+ \"Work\" shall mean the work of authorship, whether in Source or\n+ Object form, made available under the License, as indicated by a\n+ copyright notice that is included in or attached to the work\n+ (an example is provided in the Appendix below).\n+\n+ \"Derivative Works\" shall mean any work, whether in Source or Object\n+ form, that is based on (or derived from) the Work and for which the\n+ editorial revisions, annotations, elaborations, or other modifications\n+ represent, as a whole, an original work of authorship. For the purposes\n+ of this License, Derivative Works shall not include works that remain\n+ separable from, or merely link (or bind by name) to the interfaces of,\n+ the Work and Derivative Works thereof.\n+\n+ \"Contribution\" shall mean any work of authorship, including\n+ the original version of the Work and any modifications or additions\n+ to that Work or Derivative Works thereof, that is intentionally\n+ submitted to Licensor for inclusion in the Work by the copyright owner\n+ or by an individual or Legal Entity authorized to submit on behalf of\n+ the copyright owner. For the purposes of this definition, \"submitted\"\n+ means any form of electronic, verbal, or written communication sent\n+ to the Licensor or its representatives, including but not limited to\n+ communication on electronic mailing lists, source code control systems,\n+ and issue tracking systems that are managed by, or on behalf of, the\n+ Licensor for the purpose of discussing and improving the Work, but\n+ excluding communication that is conspicuously marked or otherwise\n+ designated in writing by the copyright owner as \"Not a Contribution.\"\n+\n+ \"Contributor\" shall mean Licensor and any individual or Legal Entity\n+ on behalf of whom a Contribution has been received by Licensor and\n+ subsequently incorporated within the Work.\n+\n+ 2. Grant of Copyright License. Subject to the terms and conditions of\n+ this License, each Contributor hereby grants to You a perpetual,\n+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n+ copyright license to reproduce, prepare Derivative Works of,\n+ publicly display, publicly perform, sublicense, and distribute the\n+ Work and such Derivative Works in Source or Object form.\n+\n+ 3. Grant of Patent License. Subject to the terms and conditions of\n+ this License, each Contributor hereby grants to You a perpetual,\n+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n+ (except as stated in this section) patent license to make, have made,\n+ use, offer to sell, sell, import, and otherwise transfer the Work,\n+ where such license applies only to those patent claims licensable\n+ by such Contributor that are necessarily infringed by their\n+ Contribution(s) alone or by combination of their Contribution(s)\n+ with the Work to which such Contribution(s) was submitted. If You\n+ institute patent litigation against any entity (including a\n+ cross-claim or counterclaim in a lawsuit) alleging that the Work\n+ or a Contribution incorporated within the Work constitutes direct\n+ or contributory patent infringement, then any patent licenses\n+ granted to You under this License for that Work shall terminate\n+ as of the date such litigation is filed.\n+\n+ 4. Redistribution. You may reproduce and distribute copies of the\n+ Work or Derivative Works thereof in any medium, with or without\n+ modifications, and in Source or Object form, provided that You\n+ meet the following conditions:\n+\n+ (a) You must give any other recipients of the Work or\n+ Derivative Works a copy of this License; and\n+\n+ (b) You must cause any modified files to carry prominent notices\n+ stating that You changed the files; and\n+\n+ (c) You must retain, in the Source form of any Derivative Works\n+ that You distribute, all copyright, patent, trademark, and\n+ attribution notices from the Source form of the Work,\n+ excluding those notices that do not pertain to any part of\n+ the Derivative Works; and\n+\n+ (d) If the Work includes a \"NOTICE\" text file as part of its\n+ distribution, then any Derivative Works that You distribute must\n+ include a readable copy of the attribution notices contained\n+ within such NOTICE file, excluding those notices that do not\n+ pertain to any part of the Derivative Works, in at least one\n+ of the following places: within a NOTICE text file distributed\n+ as part of the Derivative Works; within the Source form or\n+ documentation, if provided along with the Derivative Works; or,\n+ within a display generated by the Derivative Works, if and\n+ wherever such third-party notices normally appear. The contents\n+ of the NOTICE file are for informational purposes only and\n+ do not modify the License. You may add Your own attribution\n+ notices within Derivative Works that You distribute, alongside\n+ or as an addendum to the NOTICE text from the Work, provided\n+ that such additional attribution notices cannot be construed\n+ as modifying the License.\n+\n+ You may add Your own copyright statement to Your modifications and\n+ may provide additional or different license terms and conditions\n+ for use, reproduction, or distribution of Your modifications, or\n+ for any such Derivative Works as a whole, provided Your use,\n+ reproduction, and distribution of the Work otherwise complies with\n+ the conditions stated in this License.\n+\n+ 5. Submission of Contributions. Unless You explicitly state otherwise,\n+ any Contribution intentionally submitted for inclusion in the Work\n+ by You to the Licensor shall be under the terms and conditions of\n+ this License, without any additional terms or conditions.\n+ Notwithstanding the above, nothing herein shall supersede or modify\n+ the terms of any separate license agreement you may have executed\n+ with Licensor regarding such Contributions.\n+\n+ 6. Trademarks. This License does not grant permission to use the trade\n+ names, trademarks, service marks, or product names of the Licensor,\n+ except as required for reasonable and customary use in describing the\n+ origin of the Work and reproducing the content of the NOTICE file.\n+\n+ 7. Disclaimer of Warranty. Unless required by applicable law or\n+ agreed to in writing, Licensor provides the Work (and each\n+ Contributor provides its Contributions) on an \"AS IS\" BASIS,\n+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n+ implied, including, without limitation, any warranties or conditions\n+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n+ PARTICULAR PURPOSE. You are solely responsible for determining the\n+ appropriateness of using or redistributing the Work and assume any\n+ risks associated with Your exercise of permissions under this License.\n+\n+ 8. Limitation of Liability. In no event and under no legal theory,\n+ whether in tort (including negligence), contract, or otherwise,\n+ unless required by applicable law (such as deliberate and grossly\n+ negligent acts) or agreed to in writing, shall any Contributor be\n+ liable to You for damages, including any direct, indirect, special,\n+ incidental, or consequential damages of any character arising as a\n+ result of this License or out of the use or inability to use the\n+ Work (including but not limited to damages for loss of goodwill,\n+ work stoppage, computer failure or malfunction, or any and all\n+ other commercial damages or losses), even if such Contributor\n+ has been advised of the possibility of such damages.\n+\n+ 9. Accepting Warranty or Additional Liability. While redistributing\n+ the Work or Derivative Works thereof, You may choose to offer,\n+ and charge a fee for, acceptance of support, warranty, indemnity,\n+ or other liability obligations and/or rights consistent with this\n+ License. However, in accepting such obligations, You may act only\n+ on Your own behalf and on Your sole responsibility, not on behalf\n+ of any other Contributor, and only if You agree to indemnify,\n+ defend, and hold each Contributor harmless for any liability\n+ incurred by, or claims asserted against, such Contributor by reason\n+ of your accepting any such warranty or additional liability.\n+\n+ END OF TERMS AND CONDITIONS\n+\n+ APPENDIX: How to apply the Apache License to your work.\n+\n+ To apply the Apache License to your work, attach the following\n+ boilerplate notice, with the fields enclosed by brackets \"{}\"\n+ replaced with your own identifying information. (Don't include\n+ the brackets!) The text should be enclosed in the appropriate\n+ comment syntax for the file format. We also recommend that a\n+ file or class name and description of purpose be included on the\n+ same \"printed page\" as the copyright notice for easier\n+ identification within third-party archives.\n+\n+ Copyright {yyyy} {name of copyright owner}\n+\n+ Licensed under the Apache License, Version 2.0 (the \"License\");\n+ you may not use this file except in compliance with the License.\n+ You may obtain a copy of the License at\n+\n+ http://www.apache.org/licenses/LICENSE-2.0\n+\n+ Unless required by applicable law or agreed to in writing, software\n+ distributed under the License is distributed on an \"AS IS\" BASIS,\n+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ See the License for the specific language governing permissions and\n+ limitations under the License.\n",
"new_path": "packages/diff/LICENSE",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+# @thi.ng/diff\n+\n+[](https://www.npmjs.com/package/@thi.ng/diff)\n+\n+## About\n+\n+TODO...\n+\n+## Installation\n+\n+```\n+yarn add @thi.ng/diff\n+```\n+\n+## Usage examples\n+\n+```typescript\n+import * as diff from \"@thi.ng/diff\";\n+\n+```\n+\n+## Authors\n+\n+- Karsten Schmidt\n+\n+## License\n+\n+© 2018 Karsten Schmidt // Apache Software License 2.0\n",
"new_path": "packages/diff/README.md",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"@thi.ng/diff\",\n+ \"version\": \"0.0.1\",\n+ \"description\": \"TODO\",\n+ \"main\": \"./index.js\",\n+ \"typings\": \"./index.d.ts\",\n+ \"repository\": \"https://github.com/thi-ng/umbrella\",\n+ \"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n+ \"license\": \"Apache-2.0\",\n+ \"scripts\": {\n+ \"build\": \"yarn run clean && tsc --declaration\",\n+ \"clean\": \"rm -rf *.js *.d.ts build doc\",\n+ \"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n+ \"pub\": \"yarn run build && yarn publish --access public\",\n+ \"test\": \"rm -rf build && tsc -p test && mocha build/test/*.js\"\n+ },\n+ \"devDependencies\": {\n+ \"@types/mocha\": \"^2.2.46\",\n+ \"@types/node\": \"^9.3.0\",\n+ \"mocha\": \"^5.0.0\",\n+ \"ts-loader\": \"^3.3.1\",\n+ \"typedoc\": \"^0.10.0\",\n+ \"typescript\": \"^2.7.1\",\n+ \"webpack\": \"^3.10.0\"\n+ },\n+ \"dependencies\": {\n+ \"@thi.ng/api\": \"^1.5.0\"\n+ },\n+ \"keywords\": [\n+ \"ES6\",\n+ \"typescript\"\n+ ],\n+ \"publishConfig\": {\n+ \"access\": \"public\"\n+ }\n+}\n\\ No newline at end of file\n",
"new_path": "packages/diff/package.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+export interface DiffLogPair extends Array<any> {\n+ [0]: number;\n+ [1]: any;\n+}\n+\n+export interface DiffLogEntry extends Array<any> {\n+ [0]: number;\n+ [1]: DiffLogPair;\n+}\n+\n+export interface DiffKeyMap {\n+ [id: number]: any;\n+}\n+\n+export interface ArrayDiff {\n+ distance: number;\n+ adds: DiffKeyMap;\n+ dels: DiffKeyMap;\n+ const: DiffKeyMap;\n+ linear: DiffLogEntry[];\n+}\n+\n+export interface ObjectDiff {\n+ distance: number;\n+ adds: string[];\n+ dels: string[];\n+ edits: [PropertyKey, any];\n+}\n",
"new_path": "packages/diff/src/api.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { equiv } from \"@thi.ng/api/equiv\";\n+\n+import { ArrayDiff } from \"./api\";\n+\n+/**\n+ * Based on \"An O(NP) Sequence Comparison Algorithm\"\"\n+ * by Wu, Manber, Myers and Miller\n+ *\n+ * http://www.itu.dk/stud/speciale/bepjea/xwebtex/litt/an-onp-sequence-comparison-algorithm.pdf\n+ * https://github.com/cubicdaiya/onp\n+ *\n+ * Various optimizations, fixes & refactorings.\n+ * Uses `equiv` for equality checks.\n+ */\n+export function diffArray(_a, _b) {\n+ const state = <ArrayDiff>{\n+ distance: 0,\n+ adds: {},\n+ dels: {},\n+ const: {},\n+ linear: []\n+ };\n+ const reverse = _a.length >= _b.length,\n+ adds = state[reverse ? \"dels\" : \"adds\"],\n+ dels = state[reverse ? \"adds\" : \"dels\"],\n+ aID = reverse ? -1 : 1,\n+ dID = reverse ? 1 : -1;\n+ let a, b, na, nb;\n+\n+ if (reverse) {\n+ a = _b;\n+ b = _a;\n+ } else {\n+ a = _a;\n+ b = _b;\n+ }\n+ na = a.length;\n+ nb = b.length;\n+\n+ const offset = na + 1,\n+ delta = nb - na,\n+ doff = delta + offset,\n+ size = na + nb + 3,\n+ path = new Array(size).fill(-1),\n+ fp = new Array(size).fill(-1),\n+ epc = [],\n+ pathPos = [];\n+\n+ function snake(k, p, pp) {\n+ const koff = k + offset,\n+ r = path[koff + ((p > pp) ? -1 : 1)];\n+ let y = p > pp ? p : pp,\n+ x = y - k;\n+ while (x < na && y < nb && equiv(a[x], b[y])) {\n+ x++;\n+ y++;\n+ }\n+ path[koff] = pathPos.length;\n+ pathPos.push([x, y, r]);\n+ return y;\n+ }\n+\n+ let p = -1, pp;\n+ do {\n+ p++;\n+ for (let k = -p, ko = k + offset; k < delta; k++ , ko++) {\n+ fp[ko] = snake(k, fp[ko - 1] + 1, fp[ko + 1]);\n+ }\n+ for (let k = delta + p, ko = k + offset; k > delta; k-- , ko--) {\n+ fp[ko] = snake(k, fp[ko - 1] + 1, fp[ko + 1]);\n+ }\n+ fp[doff] = snake(delta, fp[doff - 1] + 1, fp[doff + 1]);\n+ } while (fp[doff] !== nb);\n+ state.distance = delta + 2 * p;\n+\n+ let r = path[doff];\n+ while (r !== -1) {\n+ epc.push(pp = pathPos[r]);\n+ r = pp[2];\n+ }\n+\n+ for (let i = epc.length - 1, px = 0, py = 0; i >= 0; i--) {\n+ const e = epc[i];\n+ let v;\n+ while (px < e[0] || py < e[1]) {\n+ const d = e[1] - e[0];\n+ if (d > py - px) {\n+ adds[py] = v = b[py];\n+ state.linear.push([aID, [py, v]]);\n+ py++;\n+ } else if (d < py - px) {\n+ dels[px] = v = a[px];\n+ state.linear.push([dID, [px, v]]);\n+ px++;\n+ } else {\n+ state.const[px] = v = a[px];\n+ state.linear.push([0, [px, v]]);\n+ px++;\n+ py++;\n+ }\n+ }\n+ }\n+ return state;\n+}\n",
"new_path": "packages/diff/src/array.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+export * from \"./api\";\n+export * from \"./array\";\n+export * from \"./object\";\n",
"new_path": "packages/diff/src/index.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { equiv } from \"@thi.ng/api/equiv\";\n+\n+import { ObjectDiff } from \"./api\";\n+\n+export function diffObject(a: any, b: any) {\n+ const adds = [],\n+ dels = [],\n+ edits = [],\n+ keys = new Set(Object.keys(a).concat(Object.keys(b)));\n+ let distance = 0;\n+ for (let k of keys) {\n+ const va = a[k],\n+ vb = b[k],\n+ hasA = va !== undefined;\n+ if (hasA && vb !== undefined) {\n+ if (!equiv(va, vb)) {\n+ edits.push([k, vb]);\n+ distance++;\n+ }\n+ } else {\n+ (hasA ? dels : adds).push(k);\n+ distance++;\n+ }\n+ }\n+ return <ObjectDiff>{ distance, adds, dels, edits };\n+}\n",
"new_path": "packages/diff/src/object.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+// import * as assert from \"assert\";\n+\n+// import * as diff from \"../src/index\";\n+\n+describe(\"diff\", function () {\n+ it(\"tests pending\");\n+});\n",
"new_path": "packages/diff/test/index.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"extends\": \"../../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \"../build\"\n+ },\n+ \"include\": [\n+ \"./**/*.ts\",\n+ \"../src/**/*.ts\"\n+ ]\n+}\n",
"new_path": "packages/diff/test/tsconfig.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"extends\": \"../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \".\"\n+ },\n+ \"include\": [\n+ \"./src/**/*.ts\"\n+ ]\n+}\n",
"new_path": "packages/diff/tsconfig.json",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(diff): re-import diff package (MBP2010)
| 1
|
feat
|
diff
|
679,913
|
01.02.2018 16:05:53
| 0
|
4cc4bbc07fc68b80435a28d07665cde11ef43ed4
|
build: cleanup/update deps
|
[
{
"change_type": "MODIFY",
"diff": "\"lerna\": \"^2.8.0\",\n\"nyc\": \"^11.4.1\",\n\"tslint\": \"^5.9.1\",\n- \"typescript\": \"^2.6.2\"\n+ \"typescript\": \"^2.7.1\"\n},\n\"scripts\": {\n\"build\": \"yarn install && lerna bootstrap && lerna run build --sort\",\n",
"new_path": "package.json",
"old_path": "package.json"
},
{
"change_type": "MODIFY",
"diff": "\"webpack\": \"^3.10.0\"\n},\n\"dependencies\": {\n- \"@thi.ng/api\": \"^1.5.0\",\n\"@thi.ng/dcons\": \"^0.1.9\",\n\"@thi.ng/transducers\": \"^1.0.5\"\n},\n",
"new_path": "packages/csp/package.json",
"old_path": "packages/csp/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"webpack\": \"^3.10.0\"\n},\n\"dependencies\": {\n- \"@thi.ng/api\": \"^1.5.0\",\n\"@thi.ng/diff\": \"^0.0.1\",\n\"@thi.ng/hiccup\": \"0.1.5\",\n\"@thi.ng/iterators\": \"^4.0.2\"\n",
"new_path": "packages/hiccup-dom/package.json",
"old_path": "packages/hiccup-dom/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"webpack\": \"^3.10.0\"\n},\n\"dependencies\": {\n- \"@thi.ng/api\": \"^1.5.0\",\n+ \"@thi.ng/csp\": \"^0.3.8\",\n\"@thi.ng/rstream\": \"^0.8.1\"\n},\n\"keywords\": [\n",
"new_path": "packages/rstream-csp/package.json",
"old_path": "packages/rstream-csp/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"webpack\": \"^3.10.0\"\n},\n\"dependencies\": {\n- \"@thi.ng/rstream\": \"^0.8.1\",\n- \"@thi.ng/transducers\": \"^1.0.5\"\n+ \"@thi.ng/rstream\": \"^0.8.1\"\n},\n\"keywords\": [\n\"ES6\",\n",
"new_path": "packages/rstream-log/package.json",
"old_path": "packages/rstream-log/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"webpack\": \"^3.10.0\"\n},\n\"dependencies\": {\n- \"@thi.ng/api\": \"^1.5.0\",\n\"@thi.ng/atom\": \"^0.4.0\",\n\"@thi.ng/transducers\": \"^1.0.5\"\n},\n",
"new_path": "packages/rstream/package.json",
"old_path": "packages/rstream/package.json"
},
{
"change_type": "MODIFY",
"diff": "Binary files a/yarn.lock and b/yarn.lock differ\n",
"new_path": "yarn.lock",
"old_path": "yarn.lock"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
build: cleanup/update deps
| 1
|
build
| null |
679,913
|
01.02.2018 16:06:25
| 0
|
5d7c10a3144036fab0b51eed0c9327367e4967a1
|
test(rstream): fix tests (TS 2.7.*)
|
[
{
"change_type": "MODIFY",
"diff": "@@ -21,7 +21,7 @@ describe(\"StreamMerge\", () => {\n};\nbeforeEach(() => {\n- src = new rs.StreamMerge([\n+ src = new rs.StreamMerge<number, number>([\nrs.fromIterable([1, 2]),\nrs.fromIterable([10, 20, 30, 40]),\nrs.fromIterable([100, 200, 300])\n@@ -52,7 +52,7 @@ describe(\"StreamMerge\", () => {\n});\nit(\"applies transducer\", (done) => {\n- src = new rs.StreamMerge(\n+ src = new rs.StreamMerge<number, number>(\n[\nrs.fromIterable([1, 2]),\nrs.fromIterable([10, 20])\n",
"new_path": "packages/rstream/test/stream-merge.ts",
"old_path": "packages/rstream/test/stream-merge.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
test(rstream): fix tests (TS 2.7.*)
| 1
|
test
|
rstream
|
679,913
|
01.02.2018 16:48:38
| 0
|
beebe4352c2393284775d3a4ca1088982ec391c2
|
chore: update keywords for all packages
|
[
{
"change_type": "MODIFY",
"diff": "\"@thi.ng/checks\": \"^1.1.4\"\n},\n\"keywords\": [\n+ \"compare\",\n+ \"equality\",\n\"ES6\",\n\"generic\",\n\"interfaces\",\n+ \"type declarations\",\n\"typescript\"\n],\n\"publishConfig\": {\n",
"new_path": "packages/api/package.json",
"old_path": "packages/api/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"@thi.ng/api\": \"^1.5.0\"\n},\n\"keywords\": [\n+ \"cursor\",\n+ \"datastructure\",\n\"ES6\",\n- \"typescript\"\n+ \"history\",\n+ \"immutable\",\n+ \"typescript\",\n+ \"undo\"\n],\n\"publishConfig\": {\n\"access\": \"public\"\n",
"new_path": "packages/atom/package.json",
"old_path": "packages/atom/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"webpack\": \"^3.10.0\"\n},\n\"keywords\": [\n- \"ES6\",\n\"binary\",\n\"bits\",\n- \"stream\",\n+ \"datastructure\",\n+ \"ES6\",\n\"iterator\",\n+ \"stream\",\n\"typescript\"\n],\n\"publishConfig\": {\n",
"new_path": "packages/bitstream/package.json",
"old_path": "packages/bitstream/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"webpack\": \"^3.10.0\"\n},\n\"keywords\": [\n- \"ES6\",\n\"check\",\n+ \"detect\",\n+ \"ES6\",\n+ \"feature\",\n\"reflection\",\n- \"type\",\n+ \"types\",\n\"typescript\",\n\"validation\"\n],\n",
"new_path": "packages/checks/package.json",
"old_path": "packages/checks/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"async\",\n\"csp\",\n\"channel\",\n+ \"datastructure\",\n\"ES6\",\n+ \"multiplex\",\n\"pipeline\",\n\"promise\",\n+ \"pubsub\",\n\"transducers\",\n\"typescript\"\n],\n",
"new_path": "packages/csp/package.json",
"old_path": "packages/csp/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"@thi.ng/api\": \"^1.5.0\"\n},\n\"keywords\": [\n+ \"array\",\n+ \"diff\",\n+ \"edit\",\n\"ES6\",\n+ \"nested\",\n\"typescript\"\n],\n\"publishConfig\": {\n",
"new_path": "packages/diff/package.json",
"old_path": "packages/diff/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"@thi.ng/iterators\": \"^4.0.2\"\n},\n\"keywords\": [\n+ \"browser\",\n+ \"components\",\n+ \"DOM\",\n\"ES6\",\n- \"typescript\"\n+ \"reactive\",\n+ \"typescript\",\n+ \"ui\",\n+ \"vdom\"\n],\n\"publishConfig\": {\n\"access\": \"public\"\n",
"new_path": "packages/hiccup-dom/package.json",
"old_path": "packages/hiccup-dom/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"@thi.ng/checks\": \"^1.1.4\"\n},\n\"keywords\": [\n- \"ES6\",\n\"clojure\",\n\"components\",\n+ \"ES6\",\n\"hiccup\",\n\"html\",\n\"iterators\",\n",
"new_path": "packages/hiccup/package.json",
"old_path": "packages/hiccup/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"@thi.ng/bitstream\": \"^0.3.4\"\n},\n\"keywords\": [\n- \"ES6\",\n\"binary\",\n\"bits\",\n+ \"ES6\",\n\"packer\",\n\"RLE\",\n\"typescript\"\n",
"new_path": "packages/rle-pack/package.json",
"old_path": "packages/rle-pack/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"keywords\": [\n\"ES6\",\n\"logger\",\n+ \"logging\",\n\"multilevel\",\n+ \"multiplex\",\n\"pipeline\",\n\"transducers\",\n\"typescript\"\n",
"new_path": "packages/rstream-log/package.json",
"old_path": "packages/rstream-log/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"@thi.ng/transducers\": \"^1.0.5\"\n},\n\"keywords\": [\n- \"ES6\",\n+ \"datastructure\",\n\"events\",\n+ \"ES6\",\n\"pipeline\",\n\"reactive\",\n\"stream\",\n",
"new_path": "packages/rstream/package.json",
"old_path": "packages/rstream/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"pipeline\",\n\"reducers\",\n\"transducers\",\n+ \"transformation\",\n\"typescript\"\n],\n\"publishConfig\": {\n",
"new_path": "packages/transducers/package.json",
"old_path": "packages/transducers/package.json"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
chore: update keywords for all packages
| 1
|
chore
| null |
679,913
|
01.02.2018 16:49:55
| 0
|
3101698de70e9965db36c1d83cb5f3b0da11df56
|
feat(hiccup-dom): add start(), update readme
|
[
{
"change_type": "MODIFY",
"diff": "@@ -10,10 +10,25 @@ Lighweight reactive DOM components using only vanilla JS data structures\nSupports arbitrary attributes, events, CSS conversion from JS objects, SVG.\nOnly ~10KB minified.\n-No precompilation steps needed. The actual DOM update is based on the minimal\n-edit set of the recursive difference between the old and new DOM trees (both\n-nested JS arrays). Components can be defined as static arrays, closures or\n-objects with life cycle hooks (init, render, release).\n+No template engine & no precompilation steps needed, just use the full\n+expressiveness of ES6 to define your DOM tree.\n+\n+The actual DOM update is based on the minimal edit set of the recursive\n+difference between the old and new DOM trees (both nested JS arrays).\n+Components can be defined as static arrays, closures or objects with life cycle\n+hooks (init, render, release).\n+\n+The approach is inspired by Clojure's\n+[Hiccup](https://github.com/weavejester/hiccup) and\n+[Reagent](http://reagent-project.github.io/) projects, however the latter is a\n+wrapper around React, whereas this library is standalone, more lowlevel &\n+less opinionated.\n+\n+If you're interested in using this, please also consider the\n+[@thi.ng/atom](https://github.com/thi-ng/atom)\n+[@thi.ng/rstream](https://github.com/thi-ng/rstream) packages to integrate app\n+state handling, event streams & reactive value subscriptions. Examples\n+forthcoming...\n## Installation\n@@ -30,7 +45,7 @@ yarn add @thi.ng/hiccup-dom\n### Basic usage patterns\n```typescript\n-import * as hdom from \"@thi.ng/hiccup-dom\";\n+import { start } from \"@thi.ng/hiccup-dom\";\n// static component function to create styled box\nconst box = (prefix, body) =>\n@@ -62,18 +77,8 @@ const app = (() => {\nreturn () => [\"div\", [\"h1\", \"Dashboard\"], users, profits, timer];\n})();\n-// update loop\n-window.addEventListener(\"load\", () => {\n- requestAnimationFrame(\n- ((parent, tree) => {\n- let prev = [];\n- return function update() {\n- hdom.diffElement(parent, prev, prev = hdom.normalizeTree(tree));\n- requestAnimationFrame(update);\n- }\n- })(document.getElementById(\"app\"), app)\n- );\n-});\n+// start update loop (RAF)\n+window.addEventListener(\"load\", () => start(document.getElementById(\"app\"), app));\n```\n### Lifecycle hooks\n",
"new_path": "packages/hiccup-dom/README.md",
"old_path": "packages/hiccup-dom/README.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -8,11 +8,11 @@ import { TAG_REGEXP } from \"@thi.ng/hiccup/api\";\nimport { DEBUG } from \"./api\";\nimport { createDOM, removeAttribs, setAttrib, removeChild } from \"./dom\";\n-export function diffElement(parent: Element, prev, curr) {\n+export function diffElement(parent: Element, prev: any, curr: any) {\n_diffElement(parent, prev, curr, 0);\n}\n-function _diffElement(parent: Element, prev, curr, child) {\n+function _diffElement(parent: Element, prev: any, curr: any, child: number) {\nconst delta = diff.diffArray(prev, curr),\nedits = delta.linear,\nel = parent.children[child];\n@@ -202,7 +202,7 @@ function hasChangedEvents(prev: any, curr: any) {\nreturn false;\n}\n-export function diffAttributes(el: Element, prev: any, curr: any) {\n+function diffAttributes(el: Element, prev: any, curr: any) {\nconst delta = diff.diffObject(prev, curr);\nlet i, a, attribs;\nDEBUG && console.log(\"diff attribs:\", delta);\n@@ -217,7 +217,7 @@ export function diffAttributes(el: Element, prev: any, curr: any) {\n}\n}\n-export function extractEquivElements(edits: diff.DiffLogEntry[]) {\n+function extractEquivElements(edits: diff.DiffLogEntry[]) {\nconst equiv = {};\nlet k;\nfor (let i = edits.length - 1; i >= 0; i--) {\n",
"new_path": "packages/hiccup-dom/src/diff.ts",
"old_path": "packages/hiccup-dom/src/diff.ts"
},
{
"change_type": "MODIFY",
"diff": "export * from \"./diff\";\nexport * from \"./dom\";\n+export * from \"./start\";\n",
"new_path": "packages/hiccup-dom/src/index.ts",
"old_path": "packages/hiccup-dom/src/index.ts"
},
{
"change_type": "ADD",
"diff": "+import { diffElement, normalizeTree } from \"./diff\";\n+\n+export function start(parent, tree: any) {\n+ let prev = [];\n+ function update() {\n+ diffElement(parent, prev, prev = normalizeTree(tree));\n+ requestAnimationFrame(update);\n+ }\n+ requestAnimationFrame(update);\n+}\n",
"new_path": "packages/hiccup-dom/src/start.ts",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(hiccup-dom): add start(), update readme
| 1
|
feat
|
hiccup-dom
|
679,913
|
01.02.2018 16:56:45
| 0
|
326d3c31e9e8f07b7bb271668995ab3ec1a8c6be
|
build: update .npmignore
|
[
{
"change_type": "MODIFY",
"diff": "@@ -5,5 +5,6 @@ doc\nsrc*\ntest\n.nyc_output\n+tsconfig.json\n*.tgz\n*.html\n",
"new_path": "packages/atom/.npmignore",
"old_path": "packages/atom/.npmignore"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,5 +5,6 @@ doc\nsrc*\ntest\n.nyc_output\n+tsconfig.json\n*.tgz\n*.html\n",
"new_path": "packages/bitstream/.npmignore",
"old_path": "packages/bitstream/.npmignore"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,5 +5,6 @@ doc\nsrc*\ntest\n.nyc_output\n+tsconfig.json\n*.tgz\n*.html\n",
"new_path": "packages/checks/.npmignore",
"old_path": "packages/checks/.npmignore"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,5 +5,6 @@ doc\nsrc*\ntest\n.nyc_output\n+tsconfig.json\n*.tgz\n*.html\n",
"new_path": "packages/csp/.npmignore",
"old_path": "packages/csp/.npmignore"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,5 +5,6 @@ doc\nsrc*\ntest\n.nyc_output\n+tsconfig.json\n*.tgz\n*.html\n",
"new_path": "packages/dcons/.npmignore",
"old_path": "packages/dcons/.npmignore"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,5 +5,6 @@ doc\nsrc*\ntest\n.nyc_output\n+tsconfig.json\n*.tgz\n*.html\n",
"new_path": "packages/diff/.npmignore",
"old_path": "packages/diff/.npmignore"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,5 +5,6 @@ doc\nsrc*\ntest\n.nyc_output\n+tsconfig.json\n*.tgz\n*.html\n",
"new_path": "packages/hiccup-dom/.npmignore",
"old_path": "packages/hiccup-dom/.npmignore"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,5 +5,6 @@ doc\nsrc*\ntest\n.nyc_output\n+tsconfig.json\n*.tgz\n*.html\n",
"new_path": "packages/hiccup/.npmignore",
"old_path": "packages/hiccup/.npmignore"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,5 +5,6 @@ doc\nsrc*\ntest\n.nyc_output\n+tsconfig.json\n*.tgz\n*.html\n",
"new_path": "packages/iterators/.npmignore",
"old_path": "packages/iterators/.npmignore"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,5 +5,6 @@ doc\nsrc*\ntest\n.nyc_output\n+tsconfig.json\n*.tgz\n*.html\n",
"new_path": "packages/rle-pack/.npmignore",
"old_path": "packages/rle-pack/.npmignore"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,5 +5,6 @@ doc\nsrc*\ntest\n.nyc_output\n+tsconfig.json\n*.tgz\n*.html\n",
"new_path": "packages/rstream-csp/.npmignore",
"old_path": "packages/rstream-csp/.npmignore"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,5 +5,6 @@ doc\nsrc*\ntest\n.nyc_output\n+tsconfig.json\n*.tgz\n*.html\n",
"new_path": "packages/rstream-log/.npmignore",
"old_path": "packages/rstream-log/.npmignore"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,5 +5,6 @@ doc\nsrc*\ntest\n.nyc_output\n+tsconfig.json\n*.tgz\n*.html\n",
"new_path": "packages/rstream/.npmignore",
"old_path": "packages/rstream/.npmignore"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,5 +5,6 @@ doc\nsrc*\ntest\n.nyc_output\n+tsconfig.json\n*.tgz\n*.html\n",
"new_path": "packages/transducers/.npmignore",
"old_path": "packages/transducers/.npmignore"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,5 +5,6 @@ doc\nsrc*\ntest\n.nyc_output\n+tsconfig.json\n*.tgz\n*.html\n",
"new_path": "packages/unionstruct/.npmignore",
"old_path": "packages/unionstruct/.npmignore"
},
{
"change_type": "MODIFY",
"diff": "@@ -101,6 +101,7 @@ doc\nsrc*\ntest\n.nyc_output\n+tsconfig.json\n*.tgz\n*.html\nEOF\n",
"new_path": "scripts/make-module",
"old_path": "scripts/make-module"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
build: update .npmignore
| 1
|
build
| null |
679,913
|
01.02.2018 17:26:32
| 0
|
094e48691c56e6ebcf6ebf89f6e42a8daa62c85d
|
docs(hiccup-dom): fix links in readme
|
[
{
"change_type": "MODIFY",
"diff": "@@ -25,8 +25,8 @@ wrapper around React, whereas this library is standalone, more lowlevel &\nless opinionated.\nIf you're interested in using this, please also consider the\n-[@thi.ng/atom](https://github.com/thi-ng/atom)\n-[@thi.ng/rstream](https://github.com/thi-ng/rstream) packages to integrate app\n+[@thi.ng/atom](https://github.com/thi-ng/umbrella/tree/master/packages/atom)\n+[@thi.ng/rstream](https://github.com/thi-ng/umbrella/tree/master/packages/rstream) packages to integrate app\nstate handling, event streams & reactive value subscriptions. Examples\nforthcoming...\n",
"new_path": "packages/hiccup-dom/README.md",
"old_path": "packages/hiccup-dom/README.md"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs(hiccup-dom): fix links in readme
| 1
|
docs
|
hiccup-dom
|
679,913
|
01.02.2018 20:53:15
| 0
|
36cc956123433e10685d3df934d8b5a3196957b2
|
fix(atom): cursor swap() return type
|
[
{
"change_type": "MODIFY",
"diff": "@@ -74,7 +74,7 @@ export class Cursor<T> implements\nreturn this.local.reset(val);\n}\n- swap(fn: SwapFn<T>, ...args: any[]) {\n+ swap(fn: SwapFn<T>, ...args: any[]): T {\nreturn this.local.swap.apply(this.local, [fn, ...args]);\n}\n",
"new_path": "packages/atom/src/cursor.ts",
"old_path": "packages/atom/src/cursor.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
fix(atom): cursor swap() return type
| 1
|
fix
|
atom
|
679,913
|
01.02.2018 20:54:27
| 0
|
c5b6e0fa88e954729df797988664acae7717f9d1
|
feat(atom): add History.canUndo/Redo()
|
[
{
"change_type": "MODIFY",
"diff": "@@ -31,6 +31,14 @@ export class History<T> implements\nthis.clear();\n}\n+ canUndo() {\n+ return this.history.length > 0;\n+ }\n+\n+ canRedo() {\n+ return this.future.length > 0;\n+ }\n+\n/**\n* Clears history & future stacks\n*/\n",
"new_path": "packages/atom/src/history.ts",
"old_path": "packages/atom/src/history.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(atom): add History.canUndo/Redo()
| 1
|
feat
|
atom
|
679,913
|
01.02.2018 20:55:29
| 0
|
8218814f54acb810b571f13dc4e48baf98e774de
|
fix(atom): truncate redo stack in record(), swap() return type
|
[
{
"change_type": "MODIFY",
"diff": "@@ -96,7 +96,7 @@ export class History<T> implements\n*\n* @param val\n*/\n- swap(fn: SwapFn<T>, ...args: any[]) {\n+ swap(fn: SwapFn<T>, ...args: any[]): T {\nconst prev = this.state.deref(),\ncurr = this.state.swap.apply(this.state, [fn, ...args]);\nthis.changed(prev, curr) && this.record(prev);\n@@ -119,6 +119,7 @@ export class History<T> implements\nthis.history.shift();\n}\nthis.history.push(arguments.length > 0 ? state : this.state.deref());\n+ this.future.length = 0;\n}\n/**\n",
"new_path": "packages/atom/src/history.ts",
"old_path": "packages/atom/src/history.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
fix(atom): truncate redo stack in record(), swap() return type
| 1
|
fix
|
atom
|
679,913
|
01.02.2018 20:55:58
| 0
|
1f6bb58995cdfdea4e959a89459306b0796cddbd
|
fix(hiccup-dom): boolean attribs
|
[
{
"change_type": "MODIFY",
"diff": "@@ -79,7 +79,7 @@ export function setAttribs(el: Element, attribs: any) {\n}\nexport function setAttrib(el: Element, k: string, v: any) {\n- if (v !== undefined) {\n+ if (v !== undefined && v !== false) {\nswitch (k) {\ncase \"style\":\nsetStyle(el, v);\n",
"new_path": "packages/hiccup-dom/src/dom.ts",
"old_path": "packages/hiccup-dom/src/dom.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
fix(hiccup-dom): boolean attribs
| 1
|
fix
|
hiccup-dom
|
679,913
|
01.02.2018 21:07:42
| 0
|
25c9f7854b9a90470202be7523357bc3ea5f484e
|
feat(atom,hiccup-dom): add example projects (todo list & dashboard)
|
[
{
"change_type": "ADD",
"diff": "+<!DOCTYPE html>\n+<html>\n+\n+<head>\n+ <style>\n+ html {\n+ font: 100%/1.2 Helvetica, Arial, sans-serif;\n+ }\n+ </style>\n+</head>\n+\n+<body>\n+ <div id=\"app\"></div>\n+ <script type=\"text/javascript\" src=\"bundle.js\"></script>\n+</body>\n+\n+</html>\n\\ No newline at end of file\n",
"new_path": "examples/dashboard/index.html",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { start } from \"@thi.ng/hiccup-dom\";\n+\n+// static component function to create styled box\n+const box = (prefix, body) =>\n+ [\"div\",\n+ {\n+ style: {\n+ display: \"inline-block\",\n+ background: \"#ccc\",\n+ width: \"30%\",\n+ height: \"40px\",\n+ padding: \"4px\",\n+ margin: \"2px\",\n+ \"text-align\": \"center\"\n+ }\n+ },\n+ [\"strong\", prefix], [\"br\"], body];\n+\n+// stateful component function\n+const counter = (id, from = 0, step = 1) => () => box(id, (from += step).toLocaleString());\n+\n+// dynamic component function (external state, i.e. date)\n+const timer = () => box(\"time\", new Date().toLocaleTimeString());\n+\n+// application root component closure\n+// initializes stateful components\n+const app = (() => {\n+ const users = counter(\"users\");\n+ const profits = counter(\"$$$\", 1e6, 99);\n+ return () => [\"div\", [\"h1\", \"Dashboard\"], users, profits, timer];\n+})();\n+\n+// start update loop (RAF)\n+start(document.getElementById(\"app\"), app);\n",
"new_path": "examples/dashboard/src/index.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"extends\": \"../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \".\"\n+ },\n+ \"include\": [\n+ \"./src/**/*.ts\"\n+ ]\n+}\n",
"new_path": "examples/dashboard/tsconfig.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+module.exports = {\n+ entry: \"./src/index.ts\",\n+ output: {\n+ path: __dirname,\n+ filename: \"bundle.js\"\n+ },\n+ resolve: {\n+ extensions: [\".ts\", \".js\"]\n+ },\n+ module: {\n+ loaders: [{ test: /\\.ts$/, loader: \"ts-loader\" }]\n+ },\n+ node: {\n+ process: false,\n+ setImmediate: false,\n+ }\n+};\n",
"new_path": "examples/dashboard/webpack.config.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+<!DOCTYPE html>\n+<html>\n+\n+<head>\n+ <style>\n+ html {\n+ font: 100%/1.2 Helvetica, Arial, sans-serif;\n+ }\n+\n+ #app {\n+ width: 640px;\n+ margin: auto;\n+ font-size: 1.2em;\n+ }\n+\n+ #toolbar {\n+ margin: 1em 0;\n+ }\n+\n+ .task {\n+ background: #ccc;\n+ padding: 10px;\n+ margin-bottom: 2px;\n+ }\n+\n+ .done,\n+ .done input[type=\"text\"] {\n+ background: #cfc !important;\n+ text-decoration: line-through;\n+ }\n+\n+ .task input[type=\"text\"] {\n+ display: inline-block;\n+ width: 580px;\n+ border: 0;\n+ background: #ccc;\n+ margin-left: 0.5em;\n+ }\n+\n+ .task input,\n+ button {\n+ vertical-align: middle;\n+ font-size: 1.2em;\n+ }\n+\n+ button {\n+ background: #000;\n+ color: #fff;\n+ border: 0;\n+ margin-right: 2px;\n+ }\n+\n+ button:disabled {\n+ background: #ccc;\n+ }\n+\n+ small {\n+ padding: 0 1em;\n+ font-size: 14px;\n+ font-weight: 400;\n+ }\n+\n+ a:link,\n+ a:visited {\n+ color: #000;\n+ }\n+ </style>\n+</head>\n+\n+<body>\n+ <div id=\"app\"></div>\n+ <script type=\"text/javascript\" src=\"bundle.js\"></script>\n+</body>\n+\n+</html>\n\\ No newline at end of file\n",
"new_path": "examples/todo-list/index.html",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+/*\n+ * Obligatory Todo list demo (in < 50 LOC excl. comments)\n+ * Total filesize: 18KB minified\n+ *\n+ * Other packages used:\n+ * - @thi.ng/atom for state handling\n+ * - @thi.ng/transducers for task list processing\n+ *\n+ * @author Karsten Schmidt\n+ */\n+\n+import { IObjectOf } from \"@thi.ng/api/api\";\n+import { equiv } from \"@thi.ng/api/equiv\";\n+import * as atom from \"@thi.ng/atom\";\n+import { start } from \"@thi.ng/hiccup-dom/start\";\n+import { iterator } from \"@thi.ng/transducers/iterator\";\n+import { pairs } from \"@thi.ng/transducers/iter/pairs\";\n+import { map } from \"@thi.ng/transducers/xform/map\";\n+\n+interface Task {\n+ done: boolean;\n+ body: string;\n+}\n+\n+// central app state (immutable)\n+const db = new atom.Atom({ tasks: {}, nextID: 0 });\n+// attach undo/redo history for `tasks` branch (arbitrary undo limit of 100 steps)\n+const tasks = new atom.History<IObjectOf<Task>>(new atom.Cursor(db, \"tasks\"), 100, (a, b) => !equiv(a, b));\n+// cursor for direct access to `nextID`\n+const nextID = new atom.Cursor<number>(db, \"nextID\");\n+\n+// state updaters\n+// each applies it's updates via the history atom wrapper\n+// the `atom.setter` calls produce an immutable update function for given paths\n+const addNewTask = () => tasks.swap((s) => atom.setter(nextID.swap((id) => id + 1))(s, { body: \"\", done: false }));\n+const toggleTask = (id) => tasks.swap((tasks) => atom.setter([id, \"done\"])(tasks, !tasks[id].done));\n+const updateTask = (id, body) => tasks.swap((tasks) => atom.setter([id, \"body\"])(tasks, body));\n+\n+// single task component\n+// the text field uses lifecycle hooks to set keyboard focus for new tasks\n+const taskItem = (id, task: Task) =>\n+ [\"div\",\n+ { class: \"task\" + (task.done ? \" done\" : \"\") },\n+ [\"input\",\n+ {\n+ type: \"checkbox\",\n+ checked: task.done,\n+ \"on-click\": () => toggleTask(id),\n+ }],\n+ [{\n+ init: (el) => !el.value && el.focus(),\n+ render: () =>\n+ [\"input\",\n+ {\n+ type: \"text\",\n+ placeholder: \"todo...\",\n+ value: task.body,\n+ \"on-keydown\": (e) => e.key === \"Enter\" && e.target.blur(),\n+ \"on-blur\": (e) => updateTask(id, (<HTMLInputElement>e.target).value)\n+ }]\n+ }]];\n+\n+// complete task list\n+// uses transducer to transform all tasks using above component function\n+const taskList = () => {\n+ const tasks = db.deref().tasks;\n+ return Object.keys(tasks).length ?\n+ [\"div#tasks\", ...iterator(map(([id, t]) => taskItem(id, t)), pairs(tasks))] :\n+ [\"div\", \"nothing todo, get busy...\"];\n+};\n+\n+const toolbar = () =>\n+ [\"div#toolbar\",\n+ [\"button\", { \"on-click\": () => addNewTask() }, \"+ Add\"],\n+ [\"button\", { \"on-click\": () => tasks.undo(), disabled: !tasks.canUndo() }, \"Undo\"],\n+ [\"button\", { \"on-click\": () => tasks.redo(), disabled: !tasks.canRedo() }, \"Redo\"]];\n+\n+// static header component (simple array)\n+const header =\n+ [\"h1\", \"My tasks\",\n+ [\"small\", \"made with \\u2764 \",\n+ [\"a\", { href: \"https://github.com/thi-ng/umbrella/tree/master/packages/hiccup-dom\" }, \"@thi.ng/hiccup-dom\"]]];\n+\n+// kick off UI w/ root component function\n+start(document.getElementById(\"app\"), () => [\"div\", header, toolbar, taskList]);\n",
"new_path": "examples/todo-list/src/index.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"extends\": \"../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \".\"\n+ },\n+ \"include\": [\n+ \"./src/**/*.ts\"\n+ ]\n+}\n",
"new_path": "examples/todo-list/tsconfig.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+module.exports = {\n+ entry: \"./src/index.ts\",\n+ output: {\n+ path: __dirname,\n+ filename: \"bundle.js\"\n+ },\n+ resolve: {\n+ extensions: [\".ts\", \".js\"]\n+ },\n+ module: {\n+ loaders: [{ test: /\\.ts$/, loader: \"ts-loader\" }]\n+ },\n+ node: {\n+ process: false,\n+ setImmediate: false,\n+ }\n+};\n",
"new_path": "examples/todo-list/webpack.config.js",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(atom,hiccup-dom): add example projects (todo list & dashboard)
| 1
|
feat
|
atom,hiccup-dom
|
679,913
|
01.02.2018 21:44:22
| 0
|
12590847322c6792ff787e7d3fbeee9ff31e7013
|
docs: update dep graph
|
[
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"hiccup-dom-dashboard\",\n+ \"version\": \"0.0.1\",\n+ \"repository\": \"https://github.com/thi-ng/umbrella\",\n+ \"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n+ \"license\": \"Apache-2.0\",\n+ \"scripts\": {\n+ \"dev\": \"webpack -w\",\n+ \"clean\": \"rm -rf bundle.*\"\n+ },\n+ \"devDependencies\": {\n+ \"ts-loader\": \"^3.3.1\",\n+ \"typescript\": \"^2.7.1\",\n+ \"webpack\": \"^3.10.0\"\n+ },\n+ \"dependencies\": {\n+ \"@thi.ng/hiccup-dom\": \"^0.1.1\"\n+ }\n+}\n\\ No newline at end of file\n",
"new_path": "examples/dashboard/package.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"hiccup-dom-todolist\",\n+ \"version\": \"0.0.1\",\n+ \"repository\": \"https://github.com/thi-ng/umbrella\",\n+ \"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n+ \"license\": \"Apache-2.0\",\n+ \"scripts\": {\n+ \"dev\": \"webpack -w\",\n+ \"clean\": \"rm -rf bundle.*\"\n+ },\n+ \"devDependencies\": {\n+ \"ts-loader\": \"^3.3.1\",\n+ \"typescript\": \"^2.7.1\",\n+ \"webpack\": \"^3.10.0\"\n+ },\n+ \"dependencies\": {\n+ \"@thi.ng/atom\": \"^0.5.0\",\n+ \"@thi.ng/hiccup-dom\": \"^0.1.1\",\n+ \"@thi.ng/transducers\": \"^1.0.6\"\n+ }\n+}\n\\ No newline at end of file\n",
"new_path": "examples/todo-list/package.json",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs: update dep graph
| 1
|
docs
| null |
679,913
|
01.02.2018 21:57:33
| 0
|
afb869b0d2181ee0356a8f80dc610230e90be588
|
docs: add/update readme files
|
[
{
"change_type": "MODIFY",
"diff": "@@ -26,7 +26,7 @@ All packages are:\n| [`@thi.ng/checks`](./packages/checks) | [](https://www.npmjs.com/package/@thi.ng/checks) | [changelog](./packages/checks/CHANGELOG.md) |\n| [`@thi.ng/csp`](./packages/csp) | [](https://www.npmjs.com/package/@thi.ng/csp) | [changelog](./packages/csp/CHANGELOG.md) |\n| [`@thi.ng/dcons`](./packages/dcons) | [](https://www.npmjs.com/package/@thi.ng/dcons) | [changelog](./packages/dcons/CHANGELOG.md) |\n-| [`@thi.ng/dcons`](./packages/diff) | [](https://www.npmjs.com/package/@thi.ng/diff) | [changelog](./packages/diff/CHANGELOG.md) |\n+| [`@thi.ng/diff`](./packages/diff) | [](https://www.npmjs.com/package/@thi.ng/diff) | [changelog](./packages/diff/CHANGELOG.md) |\n| [`@thi.ng/hiccup`](./packages/hiccup) | [](https://www.npmjs.com/package/@thi.ng/hiccup) | [changelog](./packages/hiccup/CHANGELOG.md) |\n| [`@thi.ng/hiccup-dom`](./packages/hiccup-dom) | [](https://www.npmjs.com/package/@thi.ng/hiccup-dom) | [changelog](./packages/hiccup-dom/CHANGELOG.md) |\n| [`@thi.ng/iterators`](./packages/iterators) | [](https://www.npmjs.com/package/@thi.ng/iterators) | [changelog](./packages/iterators/CHANGELOG.md) |\n",
"new_path": "README.md",
"old_path": "README.md"
},
{
"change_type": "ADD",
"diff": "+# @thi.ng/hiccup-dom dashboard example\n+\n+\n+\n+[Live demo here](http://demo.thi.ng/umbrella/hiccup-dom/dashboard/)\n+\n+```\n+git clone https://github.com/thi-ng/umbrella.git\n+cd umbrella/examples/dashboard\n+yarn install\n+yarn dev\n+```\n",
"new_path": "examples/dashboard/README.md",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+# @thi.ng/hiccup-dom todo list example\n+\n+[Live demo here](http://demo.thi.ng/umbrella/hiccup-dom/todo-list/)\n+\n+```\n+git clone https://github.com/thi-ng/umbrella.git\n+cd umbrella/examples/dashboard\n+yarn install\n+yarn dev\n+```\n",
"new_path": "examples/todo-list/README.md",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs: add/update readme files
| 1
|
docs
| null |
679,913
|
02.02.2018 02:10:55
| 0
|
e939586a3b76a4fdd2706d7000d73b3deeb775be
|
feat(examples): add hdom benchmark
|
[
{
"change_type": "ADD",
"diff": "+# hdom-benchmark\n+\n+[Live demo](http://demo.thi.ng/umbrella/hiccup-dom/benchmark/)\n+\n+```\n+git clone https://github.com/thi-ng/umbrella.git\n+cd umbrella/examples/hdom-benchmark\n+yarn install\n+yarn dev\n+```\n",
"new_path": "examples/hdom-benchmark/README.md",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+<!DOCTYPE html>\n+<html>\n+\n+<head>\n+ <style>\n+ html,\n+ body {\n+ font: 10px/1.2 monospace;\n+ margin: 0;\n+ }\n+\n+ footer {\n+ margin-top: 2em;\n+ }\n+\n+ #stats {\n+ margin-bottom: 2em;\n+ }\n+\n+ select {\n+ line-height: 60px;\n+ vertical-align: top;\n+ margin: 2em 1em;\n+ width: 100px;\n+ }\n+\n+ grid {\n+ display: block;\n+ }\n+\n+ grid div,\n+ grid box {\n+ display: inline-block;\n+ text-align: center;\n+ width: 6.25%;\n+ margin: 0;\n+ padding: 4px 0;\n+ }\n+ </style>\n+</head>\n+\n+<body>\n+ <div id=\"app\"></div>\n+ <footer>\n+ Made with\n+ <a href=\"https://github.com/thi-ng/umbrella/tree/master/packages/hiccup-dom\">@thi.ng/hiccup-dom</a>.\n+ </footer>\n+ <script type=\"text/javascript\" src=\"bundle.min.js\"></script>\n+</body>\n+\n+</html>\n\\ No newline at end of file\n",
"new_path": "examples/hdom-benchmark/index.html",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"hdom-benchmark\",\n+ \"version\": \"0.0.1\",\n+ \"repository\": \"https://github.com/thi-ng/umbrella\",\n+ \"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n+ \"license\": \"Apache-2.0\",\n+ \"scripts\": {\n+ \"dev\": \"webpack -w\",\n+ \"clean\": \"rm -rf bundle.*\"\n+ },\n+ \"devDependencies\": {\n+ \"ts-loader\": \"^3.3.1\",\n+ \"typescript\": \"^2.7.1\",\n+ \"webpack\": \"^3.10.0\"\n+ },\n+ \"dependencies\": {\n+ \"@thi.ng/api\": \"^2.0.0\",\n+ \"@thi.ng/hiccup-dom\": \"^0.1.1\",\n+ \"@thi.ng/rstream\": \"^0.9.1\",\n+ \"@thi.ng/transducers\": \"^1.0.6\"\n+ }\n+}\n\\ No newline at end of file\n",
"new_path": "examples/hdom-benchmark/package.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { start } from \"@thi.ng/hiccup-dom\";\n+import { fromRAF } from \"@thi.ng/rstream/from/raf\";\n+import * as tx from \"@thi.ng/transducers\";\n+\n+const hex4 = tx.hex(4);\n+const hex6 = tx.hex(6);\n+\n+const box = (x: number) => [\n+ (x & 1) ? \"div\" : \"box\",\n+ { style: { background: \"#\" + hex6((x & 0x1ff) << 15 | x << 10 | x) } },\n+ hex4(x & 0xffff)\n+];\n+\n+const dropdown = (change, items) =>\n+ tx.transduce(\n+ tx.map<any, any>(([value, label]) => [\"option\", { value }, label]),\n+ tx.push(),\n+ [\"select\", { \"on-change\": change }],\n+ items\n+ );\n+\n+const fpsCounter = (src, width = 100, height = 30, period = 50, col = \"#09f\", txtCol = \"#000\") => {\n+ let ctx;\n+ let scale = height / 60;\n+ src.subscribe(\n+ {\n+ next(samples) {\n+ ctx.clearRect(0, 0, width, height);\n+ ctx.fillStyle = col;\n+ ctx.beginPath();\n+ ctx.moveTo(0, height);\n+ for (let i = 0; i < width; i++) {\n+ ctx.lineTo(i, height - samples[i] * scale);\n+ }\n+ ctx.lineTo(width - 1, height);\n+ ctx.fill();\n+ ctx.fillStyle = txtCol;\n+ ctx.fillText(`SMA(${period}): ${samples[width - 1].toFixed(1)} fps`, 2, height - 4);\n+ }\n+ },\n+ tx.comp(\n+ tx.benchmark(),\n+ tx.movingAverage(period),\n+ tx.map(x => 1000 / x),\n+ tx.partition(width, 1, true)\n+ )\n+ );\n+ return [{\n+ init: (el) => (ctx = el.getContext(\"2d\")),\n+ render: () => [\"canvas\", { width, height }]\n+ }];\n+};\n+\n+let i = 0;\n+let num = 128;\n+\n+const fps = fpsCounter(fromRAF(), 100, 60);\n+\n+const menu = dropdown(\n+ (e) => { num = parseInt(e.target.value); },\n+ [[128, 128], [192, 192], [256, 256], [384, 384], [512, 512]]\n+);\n+\n+const app = () => {\n+ let j = (++i) & 0x1ff;\n+ return [\"div\",\n+ [\"div#stats\", fps, menu],\n+ tx.transduce(tx.map<any, any>(box), tx.push(), [\"grid\"], tx.range(j, j + num))];\n+};\n+\n+start(document.getElementById(\"app\"), app());\n",
"new_path": "examples/hdom-benchmark/src/index.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"extends\": \"../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \".\"\n+ },\n+ \"include\": [\n+ \"./src/**/*.ts\"\n+ ]\n+}\n",
"new_path": "examples/hdom-benchmark/tsconfig.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+module.exports = {\n+ entry: \"./src/index.ts\",\n+ output: {\n+ path: __dirname,\n+ filename: \"bundle.js\"\n+ },\n+ resolve: {\n+ extensions: [\".ts\", \".js\"]\n+ },\n+ module: {\n+ loaders: [{ test: /\\.ts$/, loader: \"ts-loader\" }]\n+ },\n+ node: {\n+ process: false,\n+ setImmediate: false\n+ }\n+};\n",
"new_path": "examples/hdom-benchmark/webpack.config.js",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(examples): add hdom benchmark
| 1
|
feat
|
examples
|
679,913
|
02.02.2018 02:40:31
| 0
|
e69774dff90063eb67ef00c23f4e8c041bc58bd1
|
fix(examples): benchmark
|
[
{
"change_type": "MODIFY",
"diff": "Made with\n<a href=\"https://github.com/thi-ng/umbrella/tree/master/packages/hiccup-dom\">@thi.ng/hiccup-dom</a>.\n</footer>\n- <script type=\"text/javascript\" src=\"bundle.min.js\"></script>\n+ <script type=\"text/javascript\" src=\"bundle.js\"></script>\n</body>\n</html>\n\\ No newline at end of file\n",
"new_path": "examples/hdom-benchmark/index.html",
"old_path": "examples/hdom-benchmark/index.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -46,7 +46,11 @@ const fpsCounter = (src, width = 100, height = 30, period = 50, col = \"#09f\", tx\n)\n);\nreturn [{\n- init: (el) => (ctx = el.getContext(\"2d\")),\n+ init: (el) => {\n+ ctx = el.getContext(\"2d\");\n+ ctx.fillStyle = txtCol;\n+ ctx.fillText(\"sampling...\", 2, height - 4);\n+ },\nrender: () => [\"canvas\", { width, height }]\n}];\n};\n@@ -68,4 +72,4 @@ const app = () => {\ntx.transduce(tx.map<any, any>(box), tx.push(), [\"grid\"], tx.range(j, j + num))];\n};\n-start(document.getElementById(\"app\"), app());\n+start(document.getElementById(\"app\"), app);\n",
"new_path": "examples/hdom-benchmark/src/index.ts",
"old_path": "examples/hdom-benchmark/src/index.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
fix(examples): benchmark
| 1
|
fix
|
examples
|
679,913
|
02.02.2018 02:41:05
| 0
|
5e6eb8321f04f062ba01d45a6b1489341cc79bd3
|
chore: add make-example script
|
[
{
"change_type": "ADD",
"diff": "+#!/bin/sh\n+\n+readonly MODULE=\"examples/$1\"\n+readonly AUTHOR=\"Karsten Schmidt\"\n+readonly EMAIL=\"k+npm@thi.ng\"\n+\n+echo \"generating module: $MODULE\"\n+mkdir -p $MODULE\n+\n+echo \"creating /src folder...\"\n+mkdir -p $MODULE/src\n+touch $MODULE/src/index.ts\n+\n+echo \"writing package.json...\"\n+cat << EOF > $MODULE/package.json\n+{\n+ \"name\": \"$1\",\n+ \"version\": \"0.0.1\",\n+ \"repository\": \"https://github.com/thi-ng/umbrella\",\n+ \"author\": \"$AUTHOR <$EMAIL>\",\n+ \"license\": \"Apache-2.0\",\n+ \"scripts\": {\n+ \"dev\": \"webpack -w\",\n+ \"clean\": \"rm -rf bundle.*\"\n+ },\n+ \"devDependencies\": {\n+ \"ts-loader\": \"^3.3.1\",\n+ \"typescript\": \"^2.7.1\",\n+ \"webpack\": \"^3.10.0\"\n+ },\n+ \"dependencies\": {\n+ \"@thi.ng/api\": \"^2.0.0\",\n+ \"@thi.ng/hiccup-dom\": \"^0.1.1\",\n+ \"@thi.ng/rstream\": \"^0.9.1\",\n+ \"@thi.ng/transducers\": \"^1.0.6\"\n+ }\n+}\n+EOF\n+\n+echo \"writing tsconfig.json...\"\n+cat << EOF > $MODULE/tsconfig.json\n+{\n+ \"extends\": \"../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \".\"\n+ },\n+ \"include\": [\n+ \"./src/**/*.ts\"\n+ ]\n+}\n+EOF\n+\n+echo \"writing webpack.config.js...\"\n+cat << EOF > $MODULE/webpack.config.js\n+module.exports = {\n+ entry: \"./src/index.ts\",\n+ output: {\n+ path: __dirname,\n+ filename: \"bundle.js\"\n+ },\n+ resolve: {\n+ extensions: [\".ts\", \".js\"]\n+ },\n+ module: {\n+ loaders: [{ test: /\\.ts$/, loader: \"ts-loader\" }]\n+ },\n+ node: {\n+ process: false,\n+ setImmediate: false\n+ }\n+};\n+EOF\n+\n+\n+echo \"writing index.html...\"\n+cat << EOF > $MODULE/index.html\n+<!DOCTYPE html>\n+<html>\n+<head>\n+ <style>\n+ html {\n+ font: 100%/1.2 Helvetica, Arial, sans-serif;\n+ }\n+ </style>\n+</head>\n+<body>\n+ <div id=\"app\"></div>\n+ <script type=\"text/javascript\" src=\"bundle.js\"></script>\n+</body>\n+</html>\n+EOF\n+\n+echo \"writing README.md...\"\n+cat << EOF > $MODULE/README.md\n+# $1\n+\n+[Live demo](http://demo.thi.ng/umbrella/$1/)\n+\n+\\`\\`\\`\n+git clone https://github.com/thi-ng/umbrella.git\n+cd umbrella/examples/$1\n+yarn install\n+yarn dev\n+\\`\\`\\`\n+EOF\n",
"new_path": "scripts/make-example",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
chore: add make-example script
| 1
|
chore
| null |
679,913
|
02.02.2018 12:27:49
| 0
|
c2fed17065d4c132155d8a4bd98468f2b480c6a5
|
feat(examples): add hdom-basics example
|
[
{
"change_type": "ADD",
"diff": "+# hdom-basics\n+\n+[Live demo](http://demo.thi.ng/umbrella/hiccup-dom/basics/)\n+\n+```\n+git clone https://github.com/thi-ng/umbrella.git\n+cd umbrella/examples/hdom-basics\n+yarn install\n+yarn dev\n+```\n+\n+Then open `index.html` in your browser...\n\\ No newline at end of file\n",
"new_path": "examples/hdom-basics/README.md",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+<!DOCTYPE html>\n+<html>\n+\n+<head>\n+ <style>\n+ html {\n+ font: 100%/1.2 Helvetica, Arial, sans-serif;\n+ }\n+ </style>\n+</head>\n+\n+<body>\n+ <div id=\"app\"></div>\n+ <script type=\"text/javascript\" src=\"bundle.js\"></script>\n+</body>\n+\n+</html>\n\\ No newline at end of file\n",
"new_path": "examples/hdom-basics/index.html",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"hdom-basics\",\n+ \"version\": \"0.0.1\",\n+ \"repository\": \"https://github.com/thi-ng/umbrella\",\n+ \"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n+ \"license\": \"Apache-2.0\",\n+ \"scripts\": {\n+ \"dev\": \"webpack -w\",\n+ \"clean\": \"rm -rf bundle.*\"\n+ },\n+ \"devDependencies\": {\n+ \"ts-loader\": \"^3.3.1\",\n+ \"typescript\": \"^2.7.1\",\n+ \"webpack\": \"^3.10.0\"\n+ },\n+ \"dependencies\": {\n+ \"@thi.ng/api\": \"^2.0.0\",\n+ \"@thi.ng/hiccup-dom\": \"^0.1.1\",\n+ \"@thi.ng/rstream\": \"^0.9.1\",\n+ \"@thi.ng/transducers\": \"^1.0.6\"\n+ }\n+}\n",
"new_path": "examples/hdom-basics/package.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { start } from \"@thi.ng/hiccup-dom\";\n+\n+// stateless component w/ params\n+const greeter = (name) => [\"h1.title\", \"hello \", name];\n+\n+// component w/ local state\n+const counter = () => {\n+ let i = 0;\n+ return () => [\"button\", { \"on-click\": () => (i++) }, `clicks: ${i}`];\n+};\n+\n+const app = () => {\n+ // instantiation\n+ const counters = [counter(), counter()];\n+ // root component is just a static array\n+ return [\"div#app\", [greeter, \"world\"], ...counters];\n+};\n+\n+start(document.body, app());\n",
"new_path": "examples/hdom-basics/src/index.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"extends\": \"../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \".\"\n+ },\n+ \"include\": [\n+ \"./src/**/*.ts\"\n+ ]\n+}\n",
"new_path": "examples/hdom-basics/tsconfig.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+module.exports = {\n+ entry: \"./src/index.ts\",\n+ output: {\n+ path: __dirname,\n+ filename: \"bundle.js\"\n+ },\n+ resolve: {\n+ extensions: [\".ts\", \".js\"]\n+ },\n+ module: {\n+ loaders: [{ test: /\\.ts$/, loader: \"ts-loader\" }]\n+ },\n+ node: {\n+ process: false,\n+ setImmediate: false\n+ }\n+};\n",
"new_path": "examples/hdom-basics/webpack.config.js",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(examples): add hdom-basics example
| 1
|
feat
|
examples
|
679,913
|
02.02.2018 12:59:15
| 0
|
d573bc5332f0f716b98fc1af4a2a09adedb7ed58
|
docs: update hiccup* readme files
|
[
{
"change_type": "MODIFY",
"diff": "## About\n-Lighweight reactive DOM components using only vanilla JS data structures\n+Lightweight reactive DOM components using only vanilla JS data structures\n(arrays, objects, closures, iterators), based on\n[@thi.ng/hiccup](https://github.com/thi-ng/umbrella/tree/master/packages/hiccup).\n-Supports arbitrary attributes, events, CSS conversion from JS objects, SVG.\n-Only ~10KB minified.\n+Supports arbitrary attributes, events, CSS conversion from JS objects, SVG and\n+server side rendering (by passing the same data structure to @thi.ng/hiccup's\n+`serialize()`). Only ~10KB minified.\n```typescript\nimport { start } from \"@thi.ng/hiccup-dom\";\n",
"new_path": "packages/hiccup-dom/README.md",
"old_path": "packages/hiccup-dom/README.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -13,6 +13,10 @@ Forget all the custom toy DSLs for templating and instead use the full power of\nES6 to directly define fully data-driven, purely functional and easily\n*composable* components for static serialization to HTML & friends.\n+This library is suitable for static website generation, server side rendering\n+etc. For interactive use cases, please see companion package\n+[@thi.ng/hiccup-dom](https://github.com/thi-ng/umbrella/tree/master/packages/hiccup-dom).\n+\n### Features\n- Only uses arrays, functions, ES6 iterables / iterators / generators\n",
"new_path": "packages/hiccup/README.md",
"old_path": "packages/hiccup/README.md"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs: update hiccup* readme files
| 1
|
docs
| null |
679,913
|
02.02.2018 13:02:21
| 0
|
10d9ecbfc47c8e3a513c36ce2fecc89392c5e03f
|
docs(hiccup-dom): fix example link
|
[
{
"change_type": "MODIFY",
"diff": "@@ -32,7 +32,7 @@ const app = () => {\nstart(document.body, app());\n```\n-[Live demo](http://demo.thi.ng/umbrella/hiccup-dom/basics/) | [standalone example](./examples/hdom-basics)\n+[Live demo](http://demo.thi.ng/umbrella/hiccup-dom/basics/) | [standalone example](../../examples/hdom-basics)\nNo template engine & no precompilation steps needed, just use the full\nexpressiveness of ES6 to define your DOM tree.\n",
"new_path": "packages/hiccup-dom/README.md",
"old_path": "packages/hiccup-dom/README.md"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs(hiccup-dom): fix example link
| 1
|
docs
|
hiccup-dom
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.