author
int64 658
755k
| date
stringlengths 19
19
| timezone
int64 -46,800
43.2k
| hash
stringlengths 40
40
| message
stringlengths 5
490
| mods
list | language
stringclasses 20
values | license
stringclasses 3
values | repo
stringlengths 5
68
| original_message
stringlengths 12
491
|
---|---|---|---|---|---|---|---|---|---|
106,046 | 12.01.2023 15:47:27 | -3,600 | 4970f4b3c07df49ba93cab6ddf5305711471b14b | Improvements for authkey login/logout | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/base_crypto.py",
"new_path": "resources/lib/services/nfsession/msl/base_crypto.py",
"diff": "@@ -79,6 +79,10 @@ class MSLBaseCrypto:\ndef _save_msl_data(self):\n\"\"\"Save crypto keys and MasterToken to disk\"\"\"\n+ if self.mastertoken is None:\n+ # With a fresh install when login with Auth key and the \"browse\" http request fails with\n+ # \"Server disconnected\" error it executes clear_user_id_tokens that try to save uninitialized msl data\n+ return\nself._msl_data['tokens'] = {'mastertoken': self.mastertoken}\nself._msl_data.update(self._export_keys())\nself._msl_data['bound_esn'] = self.bound_esn\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/msl_handler.py",
"new_path": "resources/lib/services/nfsession/msl/msl_handler.py",
"diff": "@@ -105,6 +105,17 @@ class MSLHandler:\n# Then clear the credentials and also user tokens.\ncommon.purge_credentials()\nself.msl_requests.crypto.clear_user_id_tokens()\n+ if 'User must login again' in str(exc):\n+ # Know case when MSL error can happen:\n+ # - User has done \"Sign out of all devices\" from account settings\n+ # - User has login with an auth key generated before executing \"Sign out of all devices\"\n+ # When \"Sign out of all devices\" is done, and you create a auth key just after that\n+ # for some reason the MSL has not yet changed his status and think you still use the old login\n+ # this is fixed automatically by website by waiting 10 minutes before generating a new auth key.\n+ err_msg = ('\\nIf you have done \"Sign out of all devices\" from Netflix account settings so '\n+ 'Logout from add-on settings and wait about 10 minutes before login again '\n+ '(if used, a new Auth Key is required).')\n+ raise MSLError(str(exc) + err_msg) from exc\nraise\nreturn self._tranform_to_dash(manifest)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/session/access.py",
"new_path": "resources/lib/services/nfsession/session/access.py",
"diff": "@@ -20,6 +20,7 @@ import resources.lib.kodi.ui as ui\nfrom resources.lib.common.exceptions import (LoginValidateError, NotConnected, NotLoggedInError,\nMbrStatusNeverMemberError, MbrStatusFormerMemberError, LoginError,\nMissingCredentialsError, MbrStatusAnonymousError, WebsiteParsingError)\n+from resources.lib.database import db_utils\nfrom resources.lib.globals import G\nfrom resources.lib.services.nfsession.session.cookie import SessionCookie\nfrom resources.lib.services.nfsession.session.http_requests import SessionHTTPRequests\n@@ -111,7 +112,15 @@ class SessionAccess(SessionCookie, SessionHTTPRequests):\nwebsite.extract_session_data(self.get('browse'), validate=True, update_profiles=True)\nexcept MbrStatusAnonymousError:\n# Access not valid\n+ LOG.warn('Login with AuthKey failed due to MbrStatusAnonymousError, '\n+ 'your account could be not confirmed / renewed / suspended.')\nreturn False\n+ except NotLoggedInError as exc:\n+ # Raised by get('browse') with httpx.RemoteProtocolError 'Server disconnected' exception\n+ # Cookies may be not more valid\n+ raise LoginError('The website has refused the connection, you need to generate a new Auth Key. '\n+ 'If you have just done \"Sign out of all devices\" from Netflix account settings '\n+ 'wait about 10 minutes before generating a new AuthKey.') from exc\n# Get the account e-mail\npage_response = self.get('your_account').decode('utf-8')\nemail_match = re.search(r'account-email[^<]+>([^<]+@[^</]+)</', page_response)\n@@ -178,7 +187,7 @@ class SessionAccess(SessionCookie, SessionHTTPRequests):\ndef logout(self):\n\"\"\"Logout of the current account and reset the session\"\"\"\nLOG.debug('Logging out of current account')\n-\n+ with common.show_busy_dialog():\n# Perform the website logout\nself.get('logout')\n@@ -194,6 +203,12 @@ class SessionAccess(SessionCookie, SessionHTTPRequests):\n# Disable and reset the selected profile guid for library playback\nG.LOCAL_DB.set_value('library_playback_profile_guid', '')\n+ G.LOCAL_DB.set_value('website_esn', '', db_utils.TABLE_SESSION)\n+ G.LOCAL_DB.set_value('esn', '' , db_utils.TABLE_SESSION)\n+ G.LOCAL_DB.set_value('esn_timestamp', '')\n+\n+ G.LOCAL_DB.set_value('auth_url', '', db_utils.TABLE_SESSION)\n+\n# Delete cookie and credentials\nself.session.cookies.clear()\ncookies.delete()\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Improvements for authkey login/logout |
106,046 | 14.01.2023 16:13:34 | -3,600 | 906f5dd2406bab1f1756147fede35ca3b284bb10 | Replaced MSL idtoken auth with netflixid on android | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/msl_handler.py",
"new_path": "resources/lib/services/nfsession/msl/msl_handler.py",
"diff": "@@ -16,7 +16,7 @@ import xbmcaddon\nimport resources.lib.common as common\nfrom resources.lib.common.cache_utils import CACHE_MANIFESTS\n-from resources.lib.common.exceptions import MSLError\n+from resources.lib.common.exceptions import MSLError, ErrorMessage\nfrom resources.lib.database.db_utils import TABLE_SESSION\nfrom resources.lib.globals import G\nfrom resources.lib.utils.esn import get_esn, set_esn, regen_esn\n@@ -105,7 +105,7 @@ class MSLHandler:\n# Then clear the credentials and also user tokens.\ncommon.purge_credentials()\nself.msl_requests.crypto.clear_user_id_tokens()\n- if 'User must login again' in str(exc):\n+ elif 'User must login again' in str(exc):\n# Know case when MSL error can happen:\n# - User has done \"Sign out of all devices\" from account settings\n# - User has login with an auth key generated before executing \"Sign out of all devices\"\n@@ -116,6 +116,11 @@ class MSLHandler:\n'Logout from add-on settings and wait about 10 minutes before login again '\n'(if used, a new Auth Key is required).')\nraise MSLError(str(exc) + err_msg) from exc\n+ elif 'User authentication data does not match entity identity' in str(exc) and common.get_system_platform() == 'android':\n+ err_msg = ('Due to a MSL error you cannot playback videos with this device. '\n+ 'This is a know problem due to a website change.\\n'\n+ 'This problem could be solved in the future, but at the moment there is no solution.')\n+ raise ErrorMessage(err_msg) from exc\nraise\nreturn self._tranform_to_dash(manifest)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/msl_requests.py",
"new_path": "resources/lib/services/nfsession/msl/msl_requests.py",
"diff": "@@ -163,7 +163,11 @@ class MSLRequests(MSLRequestBuilder):\n# On android, we have a different ESN from the login then use NETFLIXID auth may cause MSL errors,\n# (usually on L3 devices) because the identity do not match, so we need to use User id token auth\n# to switch MSL profile with current ESN when needed\n- auth_scheme = MSL_AUTH_USER_ID_TOKEN\n+ #auth_scheme = MSL_AUTH_USER_ID_TOKEN\n+ auth_scheme = MSL_AUTH_NETFLIXID\n+ # 14/01/2023 Replaced auth with MSL_AUTH_NETFLIXID we hope in a temporary way, for unknown reasons\n+ # using MSL_AUTH_EMAIL_PASSWORD auth now return \"Email or password is incorrect\" error\n+ # then this does not allow us to use token id's\nelse:\nauth_scheme = MSL_AUTH_NETFLIXID\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/msl_utils.py",
"new_path": "resources/lib/services/nfsession/msl/msl_utils.py",
"diff": "@@ -17,7 +17,7 @@ import xbmcgui\nimport resources.lib.kodi.ui as ui\nfrom resources.lib import common\n-from resources.lib.common.exceptions import MSLError\n+from resources.lib.common.exceptions import MSLError, ErrorMessage\nfrom resources.lib.database.db_utils import TABLE_SESSION\nfrom resources.lib.globals import G\nfrom resources.lib.utils.esn import get_esn\n@@ -58,6 +58,10 @@ def display_error_info(func):\ndef error_catching_wrapper(*args, **kwargs):\ntry:\nreturn func(*args, **kwargs)\n+ except ErrorMessage as exc:\n+ from resources.lib.kodi.ui import show_ok_dialog\n+ show_ok_dialog(common.get_local_string(30105), str(exc))\n+ raise\nexcept Exception as exc:\nmessage = f'{exc.__class__.__name__}: {exc}'\nui.show_error_info(common.get_local_string(30028), message,\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Replaced MSL idtoken auth with netflixid on android |
106,046 | 14.01.2023 16:23:51 | -3,600 | ddb3c41f550b0e9760c939af6e907fc05701ed6b | Allow audio offset also on Kodi 20
Has been added support in to Kodi 20 final release | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/playback/am_playback.py",
"new_path": "resources/lib/services/playback/am_playback.py",
"diff": "@@ -78,7 +78,7 @@ class AMPlayback(ActionManager):\ncommon.json_rpc('Player.SetViewMode', {'viewmode': 'normal'})\ndef _set_audio_offset(self, player_state):\n- if not G.ADDON.getSettingBool('audio_offset_enabled') or G.KODI_VERSION < 21:\n+ if not G.ADDON.getSettingBool('audio_offset_enabled'):\nreturn\ncurrent_offset = common.json_rpc('Player.GetAudioDelay')['offset']\ntarget_offset = G.ADDON.getSettingNumber('audio_offset')\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/settings.xml",
"new_path": "resources/settings.xml",
"diff": "<default>false</default>\n<control type=\"toggle\"/>\n<dependencies>\n- <dependency type=\"visible\">\n- <or>\n- <condition on=\"property\" operator=\"is\" name=\"InfoBool\">String.StartsWith(System.BuildVersionCode,20.9)</condition> <!-- v21 pre-releases -->\n- <condition on=\"property\" operator=\"is\" name=\"InfoBool\">Integer.IsGreaterOrEqual(System.BuildVersionCode,21)</condition>\n- </or>\n+ <dependency type=\"visible\"> <!-- Available from Kodi v20 final -->\n+ <condition on=\"property\" operator=\"is\" name=\"InfoBool\">Integer.IsGreaterOrEqual(System.BuildVersionCode,20)</condition>\n</dependency>\n</dependencies>\n</setting>\n<format>{:.3f}s</format>\n</control>\n<dependencies>\n- <dependency type=\"visible\">\n- <or>\n- <condition on=\"property\" operator=\"is\" name=\"InfoBool\">String.StartsWith(System.BuildVersionCode,20.9)</condition> <!-- v21 pre-releases -->\n- <condition on=\"property\" operator=\"is\" name=\"InfoBool\">Integer.IsGreaterOrEqual(System.BuildVersionCode,21)</condition>\n- </or>\n+ <dependency type=\"visible\"> <!-- Available from Kodi v20 final -->\n+ <condition on=\"property\" operator=\"is\" name=\"InfoBool\">Integer.IsGreaterOrEqual(System.BuildVersionCode,20)</condition>\n</dependency>\n<dependency type=\"visible\" setting=\"audio_offset_enabled\">true</dependency>\n</dependencies>\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Allow audio offset also on Kodi 20
Has been added support in to Kodi 20 final release |
106,046 | 14.01.2023 17:04:08 | -3,600 | e47b17217fbaed78c6e908a4427ef5b1c8543e82 | Version bump (1.20.4) | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.20.3+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.20.4+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"3.0.0\"/>\n<import addon=\"script.module.addon.signals\" version=\"0.0.6+matrix.1\"/>\n<email></email>\n<forum>https://forum.kodi.tv/showthread.php?tid=329767</forum>\n<source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n- <news>v1.20.3 (2022-12-17)\n-- IMPORTANT NOTICE: New changes to website is causing video quality to drop to 540p after about 20h,\n-this add-on update implements a workaround to fix this problem by changing ESNs every 20h.\n-If necessary, you can open \"Widevine / ESN settings\" on the Expert settings, to manually generate new ESN's\n-by selecting the \"Reset\" button, or you can also disable the 540p workaround.\n-- IMPORTANT NOTICE FOR ANDROID: Do NOT USE the ESN of the original app with the add-on, or will cause video quality drop\n-to 540p also on the original android app for an unknown period of time. This problem cannot be solved by the add-on,\n-there are no know solutions yet, so you can only report the 540p problem to customer service.\n-- FOR ANDROID, KNOWN SIDE EFFECTS: You will receive a notification that a new device has logged in every time ESN changes.\n-- Add new 540p workaround setting to \"Widevine / ESN settings\" on the Expert settings\n-- Supplemental plot info are now consistent in all use cases\n-- Fix a possible website JSON parsing problem on login/refresh session\n-- Fix \"hdrType\" TypeError (Kodi 20)\n-- Update translations hu, zh_cn, ro, it\n+ <news>v1.20.4 (2023-01-14)\n+- NOTICE FOR ANDROID DEVICES: Due to new changes to the website, many Android devices will not be able to play videos\n+ with this addon, at the moment there are no solutions, we hope this is a temporary problem.\n+- On android, replaced MSL idtoken auth with netflixid auth (for \"Email or password is incorrect\" error problem)\n+- Add new audio offset setting\n+- Fix Kodi crash on Android when play a video\n+- Fix STRM resume workaround for Kodi v19.5\n+- Fix wrong mediaflag info on episodes\n+- Update translations it, de, pt_br, sv_se\n</news>\n</extension>\n</addon>\n"
},
{
"change_type": "MODIFY",
"old_path": "changelog.txt",
"new_path": "changelog.txt",
"diff": "+v1.20.4 (2023-01-14)\n+- NOTICE FOR ANDROID DEVICES: Due to new changes to the website, many Android devices will not be able to play videos\n+ with this addon, at the moment there are no solutions, we hope this is a temporary problem.\n+- On android, replaced MSL idtoken auth with netflixid auth (for \"Email or password is incorrect\" error problem)\n+- Add new audio offset setting\n+- Fix Kodi crash on Android when play a video\n+- Fix STRM resume workaround for Kodi v19.5\n+- Fix wrong mediaflag info on episodes\n+- Update translations it, de, pt_br, sv_se\n+\nv1.20.3 (2022-12-17)\n- IMPORTANT NOTICE: New changes to website is causing video quality to drop to 540p after about 20h,\nthis add-on update implements a workaround to fix this problem by changing ESNs every 20h.\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (1.20.4) (#1536) |
106,046 | 15.01.2023 11:07:58 | -3,600 | 00aae8d861cea7a65cf746fc44efda95bd82b5f9 | Handle ErrorMessage on display_error_info | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/msl_utils.py",
"new_path": "resources/lib/services/nfsession/msl/msl_utils.py",
"diff": "@@ -17,7 +17,7 @@ import xbmcgui\nimport resources.lib.kodi.ui as ui\nfrom resources.lib import common\n-from resources.lib.common.exceptions import MSLError\n+from resources.lib.common.exceptions import MSLError, ErrorMessage\nfrom resources.lib.database.db_utils import TABLE_SESSION\nfrom resources.lib.globals import G\nfrom resources.lib.utils.esn import get_esn\n@@ -58,6 +58,10 @@ def display_error_info(func):\ndef error_catching_wrapper(*args, **kwargs):\ntry:\nreturn func(*args, **kwargs)\n+ except ErrorMessage as exc:\n+ from resources.lib.kodi.ui import show_ok_dialog\n+ show_ok_dialog(common.get_local_string(30105), str(exc))\n+ raise\nexcept Exception as exc:\nmessage = f'{exc.__class__.__name__}: {exc}'\nui.show_error_info(common.get_local_string(30028), message,\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Handle ErrorMessage on display_error_info |
106,046 | 15.01.2023 11:12:22 | -3,600 | 8b6b7a7ae87b2234b8d647d80a26845baaa2d5c9 | Disabled update loco context on playback stop | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/events_handler.py",
"new_path": "resources/lib/services/nfsession/msl/events_handler.py",
"diff": "@@ -86,15 +86,16 @@ class EventsHandler(threading.Thread):\n# Malformed/wrong content in requests are ignored without returning any error in the response or exception\nLOG.debug('EVENT [{}] - Request response: {}', event_type, response)\nif event_type == EVENT_STOP:\n- if event_data['allow_request_update_loco']:\n- if 'list_context_name' in self.loco_data:\n- self.nfsession.update_loco_context(\n- self.loco_data['root_id'],\n- self.loco_data['list_context_name'],\n- self.loco_data['list_id'],\n- self.loco_data['list_index'])\n- else:\n- LOG.debug('EventsHandler: LoCo list not updated no list context data provided')\n+ # 15/01/2023 update_loco_context looks like not more used on website when playback stop\n+ # if event_data['allow_request_update_loco']:\n+ # if 'list_context_name' in self.loco_data:\n+ # self.nfsession.update_loco_context(\n+ # self.loco_data['root_id'],\n+ # self.loco_data['list_context_name'],\n+ # self.loco_data['list_id'],\n+ # self.loco_data['list_index'])\n+ # else:\n+ # LOG.debug('EventsHandler: LoCo list not updated no list context data provided')\nself.loco_data = None\nexcept Exception as exc: # pylint: disable=broad-except\nLOG.error('EVENT [{}] - The request has failed: {}', event_type, exc)\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Disabled update loco context on playback stop |
106,046 | 15.01.2023 11:27:45 | -3,600 | 2f9188104f81f0781762f5efdeb522adfec2adfa | Removed fetching of loco data
By testing seems the website now is able to auto update the category menu continue watching | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/events_handler.py",
"new_path": "resources/lib/services/nfsession/msl/events_handler.py",
"diff": "@@ -67,9 +67,9 @@ class EventsHandler(threading.Thread):\ndef _process_event_request(self, event_type, event_data, player_state):\n\"\"\"Build and make the event post request\"\"\"\n- if event_type == EVENT_START:\n- # We get at every new video playback a fresh LoCo data\n- self.loco_data = self.nfsession.get_loco_data()\n+ # if event_type == EVENT_START:\n+ # # We get at every new video playback a fresh LoCo data\n+ # self.loco_data = self.nfsession.get_loco_data()\nurl = event_data['manifest']['links']['events']['href']\nfrom resources.lib.services.nfsession.msl.msl_request_builder import MSLRequestBuilder\nrequest_data = MSLRequestBuilder.build_request_data(url,\n@@ -85,8 +85,8 @@ class EventsHandler(threading.Thread):\nresponse = self.chunked_request(endpoint_url, request_data, get_esn())\n# Malformed/wrong content in requests are ignored without returning any error in the response or exception\nLOG.debug('EVENT [{}] - Request response: {}', event_type, response)\n- if event_type == EVENT_STOP:\n- # 15/01/2023 update_loco_context looks like not more used on website when playback stop\n+ # if event_type == EVENT_STOP:\n+ # # 15/01/2023 update_loco_context looks like not more used on website when playback stop\n# if event_data['allow_request_update_loco']:\n# if 'list_context_name' in self.loco_data:\n# self.nfsession.update_loco_context(\n@@ -96,7 +96,7 @@ class EventsHandler(threading.Thread):\n# self.loco_data['list_index'])\n# else:\n# LOG.debug('EventsHandler: LoCo list not updated no list context data provided')\n- self.loco_data = None\n+ # self.loco_data = None\nexcept Exception as exc: # pylint: disable=broad-except\nLOG.error('EVENT [{}] - The request has failed: {}', event_type, exc)\n# Ban future event requests from this event xid\n@@ -182,7 +182,7 @@ class EventsHandler(threading.Thread):\n'uiplaycontext': {\n# 'list_id': list_id, # not mandatory\n# lolomo_id: use loco root id value\n- 'lolomo_id': loco_data['root_id'],\n+ 'lolomo_id': 'unknown', # loco_data['root_id'],\n'location': play_ctx_location,\n'rank': 0, # Perhaps this is a reference of cdn rank used in the manifest? (we use always 0)\n'request_id': event_data['request_id'],\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Removed fetching of loco data
By testing seems the website now is able to auto update the category menu continue watching |
106,046 | 15.01.2023 11:48:01 | -3,600 | 91c4de15162afa19dd8e8432114b1936fe27cc5f | Add uiVersion to event params | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/events_handler.py",
"new_path": "resources/lib/services/nfsession/msl/events_handler.py",
"diff": "@@ -189,7 +189,8 @@ class EventsHandler(threading.Thread):\n'row': 0, # Purpose not known\n'track_id': event_data['track_id'],\n'video_id': videoid_value\n- }\n+ },\n+ 'uiVersion': G.LOCAL_DB.get_value('ui_version', '', table=TABLE_SESSION)\n})\n}\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Add uiVersion to event params |
106,046 | 16.01.2023 15:49:27 | -3,600 | 39cc0bec0a185abb28cf2ee6fca5412db77ae9aa | Version bump (1.20.5) | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.20.4+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.20.5+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"3.0.0\"/>\n<import addon=\"script.module.addon.signals\" version=\"0.0.6+matrix.1\"/>\n<email></email>\n<forum>https://forum.kodi.tv/showthread.php?tid=329767</forum>\n<source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n- <news>v1.20.4 (2023-01-14)\n-- NOTICE FOR ANDROID DEVICES: Due to new changes to the website, many Android devices will not be able to play videos\n- with this addon, at the moment there are no solutions, we hope this is a temporary problem.\n-- On android, replaced MSL idtoken auth with netflixid auth (for \"Email or password is incorrect\" error problem)\n-- Add new audio offset setting\n-- Fix Kodi crash on Android when play a video\n-- Fix STRM resume workaround for Kodi v19.5\n-- Fix wrong mediaflag info on episodes\n-- Update translations it, de, pt_br, sv_se\n+ <news>v1.20.5 (2023-01-16)\n+- NOTICE FOR ANDROID DEVICES: The website has fixed the recent bug for \"MSL: Email or password is incorrect\" error,\n+ so video playback is now restored for all Android devices.\n+- Disabled update loco context, is not more used to update watched status\n+- Minor changes\n+- Update translations zh_cn, zh_tw\n</news>\n</extension>\n</addon>\n"
},
{
"change_type": "MODIFY",
"old_path": "changelog.txt",
"new_path": "changelog.txt",
"diff": "+v1.20.5 (2023-01-16)\n+- NOTICE FOR ANDROID DEVICES: The website has fixed the recent bug for \"MSL: Email or password is incorrect\" error,\n+ so video playback is now restored for all Android devices.\n+- Disabled update loco context, is not more used to update watched status\n+- Minor changes\n+- Update translations zh_cn, zh_tw\n+\nv1.20.4 (2023-01-14)\n- NOTICE FOR ANDROID DEVICES: Due to new changes to the website, many Android devices will not be able to play videos\nwith this addon, at the moment there are no solutions, we hope this is a temporary problem.\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (1.20.5) (#1539) |
106,046 | 27.01.2023 16:34:47 | -3,600 | 5253e01ee623011c2444863f5735e37b0f0b9256 | Fix set_value sqlite params | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/database/db_base_sqlite.py",
"new_path": "resources/lib/database/db_base_sqlite.py",
"diff": "@@ -214,15 +214,16 @@ class SQLiteDatabase(db_base.BaseDatabase):\n\"\"\"\ntable_name = table[0]\ntable_columns = table[1]\n+ value = common.convert_to_string(value)\n# Update or insert approach, if there is no updated row then insert new one (no id changes)\nif common.CmpVersion(sql.sqlite_version) < '3.24.0':\nquery = f'INSERT OR REPLACE INTO {table_name} ({table_columns[0]}, {table_columns[1]}) VALUES (?, ?)'\n+ self._execute_non_query(query, (key, value))\nelse:\n# sqlite UPSERT clause exists only on sqlite >= 3.24.0\nquery = (f'INSERT INTO {table_name} ({table_columns[0]}, {table_columns[1]}) VALUES (?, ?) '\nf'ON CONFLICT({table_columns[0]}) DO UPDATE SET {table_columns[1]} = ? '\nf'WHERE {table_columns[0]} = ?')\n- value = common.convert_to_string(value)\nself._execute_non_query(query, (key, value, value, key))\n@handle_connection\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Fix set_value sqlite params |
106,046 | 09.02.2023 14:45:34 | -3,600 | 2c1b16e5710dfe67e567843dd2b73d913e49df5e | [pylint] fix broad-exception-raised | [
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/credentials.py",
"new_path": "resources/lib/common/credentials.py",
"diff": "@@ -12,7 +12,7 @@ import base64\nimport json\nfrom datetime import datetime\n-from resources.lib.common.exceptions import MissingCredentialsError\n+from resources.lib.common.exceptions import MissingCredentialsError, ErrorMsgNoReport\nfrom resources.lib.globals import G\nfrom resources.lib.utils.logging import LOG\nfrom .fileops import load_file\n@@ -219,4 +219,4 @@ def _prepare_authentication_key_data(data):\ncontinue\nresult_data['cookies'].append(convert_chrome_cookie(cookie))\nreturn result_data\n- raise Exception('Authentication key file not supported')\n+ raise ErrorMsgNoReport('Authentication key file not supported')\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/exceptions.py",
"new_path": "resources/lib/common/exceptions.py",
"diff": "@@ -136,7 +136,10 @@ class DBRecordNotExistError(Exception):\n# All other exceptions\n-class ErrorMessage(Exception):\n+class ErrorMsg(Exception):\n+ \"\"\"Raise a generic error message\"\"\"\n+\n+class ErrorMsgNoReport(Exception):\n\"\"\"Raise an error message by displaying a GUI dialog box WITHOUT instructions for reporting a bug\"\"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/common/videoid.py",
"new_path": "resources/lib/common/videoid.py",
"diff": "\"\"\"\nfrom functools import wraps\n-from .exceptions import InvalidVideoId\n+from .exceptions import InvalidVideoId, ErrorMsg\nclass VideoId:\n@@ -297,7 +297,7 @@ def inject_video_id(path_offset, pathitems_arg='pathitems',\n_path_to_videoid(kwargs, pathitems_arg, path_offset,\ninject_remaining_pathitems, inject_full_pathitems)\nexcept KeyError as exc:\n- raise Exception(f'Pathitems must be passed as kwarg {pathitems_arg}') from exc\n+ raise ErrorMsg(f'Pathitems must be passed as kwarg {pathitems_arg}') from exc\nreturn func(*args, **kwargs)\nreturn wrapper\nreturn injecting_decorator\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/library_utils.py",
"new_path": "resources/lib/kodi/library_utils.py",
"diff": "@@ -15,7 +15,7 @@ from functools import wraps\nimport xbmc\nfrom resources.lib import common\n-from resources.lib.common.exceptions import InvalidVideoId\n+from resources.lib.common.exceptions import InvalidVideoId, ErrorMsg\nfrom resources.lib.database.db_utils import VidLibProp\nfrom resources.lib.globals import G\nfrom resources.lib.kodi import nfo, ui\n@@ -109,7 +109,7 @@ def request_kodi_library_update(**kwargs):\n\"\"\"Request to scan and/or clean the Kodi library database\"\"\"\n# Particular way to start Kodi library scan/clean (details on request_kodi_library_update in library_updater.py)\nif not kwargs:\n- raise Exception('request_kodi_library_update: you must specify kwargs \"scan=True\" and/or \"clean=True\"')\n+ raise ErrorMsg('request_kodi_library_update: you must specify kwargs \"scan=True\" and/or \"clean=True\"')\ncommon.send_signal(common.Signals.REQUEST_KODI_LIBRARY_UPDATE, data=kwargs, non_blocking=True)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/kodi/ui/xmldialog_esnwidevine.py",
"new_path": "resources/lib/kodi/ui/xmldialog_esnwidevine.py",
"diff": "@@ -15,6 +15,7 @@ import xbmcvfs\nfrom resources.lib import common\nfrom resources.lib.common import IPC_ENDPOINT_MSL\n+from resources.lib.common.exceptions import ErrorMsg\nfrom resources.lib.database.db_utils import TABLE_SESSION\nfrom resources.lib.globals import G\nfrom resources.lib.kodi import ui\n@@ -171,7 +172,7 @@ class ESNWidevine(xbmcgui.WindowXMLDialog):\ncommon.make_call('refresh_session_data', {'update_profiles': False})\nself.esn_new = get_website_esn()\nif not self.esn_new:\n- raise Exception('It was not possible to obtain the ESN, try restarting the add-on')\n+ raise ErrorMsg('It was not possible to obtain the ESN, try restarting the add-on')\nself._update_esn_label()\ndef _apply_changes(self):\n@@ -278,11 +279,11 @@ def _get_cdm_file_path():\nelse:\nlib_filename = None\nif not lib_filename:\n- raise Exception('Widevine library filename not mapped for this operative system')\n+ raise ErrorMsg('Widevine library filename not mapped for this operative system')\n# Get the CDM path from inputstream.adaptive (such as: ../.kodi/cdm)\nfrom xbmcaddon import Addon\naddon = Addon('inputstream.adaptive')\ncdm_path = xbmcvfs.translatePath(addon.getSetting('DECRYPTERPATH'))\nif not common.folder_exists(cdm_path):\n- raise Exception(f'The CDM path {cdm_path} not exists')\n+ raise ErrorMsg(f'The CDM path {cdm_path} not exists')\nreturn common.join_folders_paths(cdm_path, lib_filename)\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/library.py",
"new_path": "resources/lib/navigation/library.py",
"diff": "import resources.lib.common as common\nimport resources.lib.kodi.ui as ui\nimport resources.lib.kodi.library_utils as lib_utils\n-from resources.lib.common.exceptions import ErrorMessage\n+from resources.lib.common.exceptions import ErrorMsgNoReport\nfrom resources.lib.globals import G\nfrom resources.lib.kodi.library import get_library_cls\nfrom resources.lib.utils.logging import LOG\n@@ -145,7 +145,7 @@ class LibraryActionExecutor:\ntry:\nxml_doc = minidom.parse(sources_xml_path)\nexcept Exception as exc: # pylint: disable=broad-except\n- raise ErrorMessage('Cannot open \"sources.xml\" the file could be corrupted. '\n+ raise ErrorMsgNoReport('Cannot open \"sources.xml\" the file could be corrupted. '\n'Please check manually on your Kodi userdata folder or reinstall Kodi.') from exc\nelse:\nxml_doc = minidom.Document()\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/navigation/player.py",
"new_path": "resources/lib/navigation/player.py",
"diff": "@@ -14,7 +14,7 @@ import resources.lib.common as common\nimport resources.lib.kodi.infolabels as infolabels\nimport resources.lib.kodi.ui as ui\nfrom resources.lib.globals import G\n-from resources.lib.common.exceptions import InputStreamHelperError, ErrorMessage\n+from resources.lib.common.exceptions import InputStreamHelperError, ErrorMsgNoReport\nfrom resources.lib.utils.logging import LOG, measure_exec_time_decorator\nMANIFEST_PATH_FORMAT = common.IPC_ENDPOINT_MSL + '/get_manifest?videoid={}'\n@@ -108,7 +108,7 @@ def get_inputstream_listitem(videoid):\nLOG.error(traceback.format_exc())\nraise InputStreamHelperError(str(exc)) from exc\nif not inputstream_ready:\n- raise ErrorMessage(common.get_local_string(30046))\n+ raise ErrorMsgNoReport(common.get_local_string(30046))\nlist_item.setProperty(\nkey='inputstream',\nvalue='inputstream.adaptive')\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/run_addon.py",
"new_path": "resources/lib/run_addon.py",
"diff": "@@ -12,7 +12,7 @@ from xbmc import getCondVisibility, Monitor, getInfoLabel\nfrom resources.lib.common.exceptions import (HttpError401, InputStreamHelperError, MbrStatusNeverMemberError,\nMbrStatusFormerMemberError, MissingCredentialsError, LoginError,\n- NotLoggedInError, InvalidPathError, BackendNotReady, ErrorMessage)\n+ NotLoggedInError, InvalidPathError, BackendNotReady, ErrorMsgNoReport)\nfrom resources.lib.common import check_credentials, get_local_string, WndHomeProps\nfrom resources.lib.globals import G\nfrom resources.lib.upgrade_controller import check_addon_upgrade\n@@ -50,7 +50,7 @@ def catch_exceptions_decorator(func):\nexcept (MbrStatusNeverMemberError, MbrStatusFormerMemberError):\nfrom resources.lib.kodi.ui import show_error_info\nshow_error_info(get_local_string(30008), get_local_string(30180), False, True)\n- except ErrorMessage as exc:\n+ except ErrorMsgNoReport as exc:\nfrom resources.lib.kodi.ui import show_ok_dialog\nshow_ok_dialog(get_local_string(30105), str(exc))\nexcept Exception as exc:\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/msl/msl_utils.py",
"new_path": "resources/lib/services/nfsession/msl/msl_utils.py",
"diff": "@@ -17,7 +17,7 @@ import xbmcgui\nimport resources.lib.kodi.ui as ui\nfrom resources.lib import common\n-from resources.lib.common.exceptions import MSLError, ErrorMessage\n+from resources.lib.common.exceptions import MSLError, ErrorMsgNoReport, ErrorMsg\nfrom resources.lib.database.db_utils import TABLE_SESSION\nfrom resources.lib.globals import G\nfrom resources.lib.utils.esn import get_esn\n@@ -58,7 +58,7 @@ def display_error_info(func):\ndef error_catching_wrapper(*args, **kwargs):\ntry:\nreturn func(*args, **kwargs)\n- except ErrorMessage as exc:\n+ except ErrorMsgNoReport as exc:\nfrom resources.lib.kodi.ui import show_ok_dialog\nshow_ok_dialog(common.get_local_string(30105), str(exc))\nraise\n@@ -127,7 +127,7 @@ def _find_audio_data(player_state, manifest):\nstream = max(audio_track['streams'], key=lambda x: x['bitrate'])\nreturn stream['downloadable_id'], audio_track['new_track_id']\n# Not found?\n- raise Exception(\n+ raise ErrorMsg(\nf'build_media_tag: unable to find audio data with language: {language}, channels: {channels}'\n)\n@@ -144,7 +144,7 @@ def _find_video_data(player_state, manifest):\nif codec in stream['content_profile'] and width == stream['res_w'] and height == stream['res_h']:\nreturn stream['downloadable_id'], video_track['new_track_id']\n# Not found?\n- raise Exception(\n+ raise ErrorMsg(\nf'build_media_tag: unable to find video data with codec: {codec}, width: {width}, height: {height}'\n)\n@@ -159,7 +159,7 @@ def _find_subtitle_data(manifest):\nif sub_track['isNoneTrack']:\nreturn sub_track['new_track_id']\n# Not found?\n- raise Exception('build_media_tag: unable to find subtitle data')\n+ raise ErrorMsg('build_media_tag: unable to find subtitle data')\ndef generate_logblobs_params():\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/services/nfsession/nfsession_ops.py",
"new_path": "resources/lib/services/nfsession/nfsession_ops.py",
"diff": "@@ -18,7 +18,7 @@ import resources.lib.utils.website as website\nfrom resources.lib.common import cache_utils\nfrom resources.lib.common.exceptions import (NotLoggedInError, MissingCredentialsError, WebsiteParsingError,\nMbrStatusAnonymousError, MetadataNotAvailable, LoginValidateError,\n- HttpError401, InvalidProfilesError, ErrorMessage)\n+ HttpError401, InvalidProfilesError, ErrorMsgNoReport)\nfrom resources.lib.globals import G\nfrom resources.lib.kodi import ui\nfrom resources.lib.services.nfsession.session.path_requests import SessionPathRequests\n@@ -103,7 +103,7 @@ class NFSessionOperations(SessionPathRequests):\nif xbmc.Player().isPlayingVideo():\n# Change the current profile while a video is playing can cause problems with outgoing HTTP requests\n# (MSL/NFSession) causing a failure in the HTTP request or sending data on the wrong profile\n- raise ErrorMessage('It is not possible select a profile while a video is playing.')\n+ raise ErrorMsgNoReport('It is not possible select a profile while a video is playing.')\ntimestamp = time.time()\nLOG.info('Activating profile {}', guid)\n# 20/05/2020 - The method 1 not more working for switching PIN locked profiles\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/utils/api_requests.py",
"new_path": "resources/lib/utils/api_requests.py",
"diff": "@@ -11,7 +11,8 @@ import resources.lib.common as common\nimport resources.lib.kodi.ui as ui\nfrom resources.lib.common import cache_utils\nfrom resources.lib.globals import G\n-from resources.lib.common.exceptions import LoginError, MissingCredentialsError, CacheMiss, HttpError401, APIError\n+from resources.lib.common.exceptions import (LoginError, MissingCredentialsError, CacheMiss, HttpError401, APIError,\n+ ErrorMsg)\nfrom .api_paths import EPISODES_PARTIAL_PATHS, ART_PARTIAL_PATHS, build_paths\nfrom .logging import LOG, measure_exec_time_decorator\n@@ -101,7 +102,7 @@ def rate_thumb(videoid, rating, track_id_jaw):\ndef update_remindme(operation, videoid, trackid):\n\"\"\"Call API to add / remove \"Remind Me\" to not available videos\"\"\"\nif trackid == 'None':\n- raise Exception('Unable update remind me, trackid not found.')\n+ raise ErrorMsg('Unable update remind me, trackid not found.')\nresponse = common.make_call(\n'post_safe',\n{'endpoint': 'playlistop',\n@@ -129,7 +130,7 @@ def update_remindme(operation, videoid, trackid):\ndef update_my_list(videoid, operation, params):\n\"\"\"Call API to add / remove videos to my list\"\"\"\nif params['trackid'] == 'None':\n- raise Exception('Unable update my list, trackid not found.')\n+ raise ErrorMsg('Unable update my list, trackid not found.')\nLOG.debug('My List: {} {}', operation, videoid)\nresponse = common.make_call(\n'post_safe',\n"
},
{
"change_type": "MODIFY",
"old_path": "resources/lib/utils/esn.py",
"new_path": "resources/lib/utils/esn.py",
"diff": "import time\nimport re\n+from resources.lib.common.exceptions import ErrorMsg\nfrom resources.lib.database.db_utils import TABLE_SESSION\nfrom resources.lib.globals import G\nfrom .logging import LOG\n@@ -37,7 +38,7 @@ def set_esn(esn=None):\n# Generate the ESN if we are on Android or get it from the website\nesn = generate_android_esn() or get_website_esn()\nif not esn:\n- raise Exception('It was not possible to obtain an ESN')\n+ raise ErrorMsg('It was not possible to obtain an ESN')\nG.LOCAL_DB.set_value('esn_timestamp', int(time.time()))\nG.LOCAL_DB.set_value('esn', esn, TABLE_SESSION)\nreturn esn\n@@ -112,7 +113,7 @@ def generate_esn(init_part=None):\nif not init_part:\nesn_w_split = get_website_esn().split('-', 2)\nif len(esn_w_split) != 3:\n- raise Exception('Cannot generate ESN due to unexpected website ESN')\n+ raise ErrorMsg('Cannot generate ESN due to unexpected website ESN')\ninit_part = '-'.join(esn_w_split[:2]) + '-'\nesn = init_part\npossible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'\n@@ -202,7 +203,7 @@ def _get_drm_info(wv_force_sec_lev):\nsystem_id = G.LOCAL_DB.get_value('drm_system_id', table=TABLE_SESSION)\nif not system_id:\n- raise Exception('Cannot get DRM system id')\n+ raise ErrorMsg('Cannot get DRM system id')\n# Some device with false Widevine certification can be specified as Widevine L1\n# but we do not know how NF original app force the fallback to L3, so we add a manual setting\n"
},
{
"change_type": "MODIFY",
"old_path": "tests/inputstreamhelper.py",
"new_path": "tests/inputstreamhelper.py",
"diff": "@@ -18,7 +18,7 @@ class Helper:\nelif protocol == 'rtmp':\nself.inputstream_addon = 'inputstream.rtmp'\nelse:\n- raise Exception('UnsupportedProtocol')\n+ raise Exception('UnsupportedProtocol') # pylint: disable=broad-exception-raised\ndef check_inputstream(self):\n\"\"\"A stub implementation of the inputstreamhelper Helper check_inputstream classmethod\"\"\"\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | [pylint] fix broad-exception-raised |
106,046 | 09.02.2023 14:52:38 | -3,600 | 2401ec7035aa5b73203896082a7971cdfcfd6fd7 | Version bump (1.20.6) | [
{
"change_type": "MODIFY",
"old_path": "addon.xml",
"new_path": "addon.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n-<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.20.5+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n+<addon id=\"plugin.video.netflix\" name=\"Netflix\" version=\"1.20.6+matrix.1\" provider-name=\"libdev, jojo, asciidisco, caphm, castagnait\">\n<requires>\n<import addon=\"xbmc.python\" version=\"3.0.0\"/>\n<import addon=\"script.module.addon.signals\" version=\"0.0.6+matrix.1\"/>\n<email></email>\n<forum>https://forum.kodi.tv/showthread.php?tid=329767</forum>\n<source>https://github.com/CastagnaIT/plugin.video.netflix</source>\n- <news>v1.20.5 (2023-01-16)\n-- NOTICE FOR ANDROID DEVICES: The website has fixed the recent bug for \"MSL: Email or password is incorrect\" error,\n- so video playback is now restored for all Android devices.\n-- Disabled update loco context, is not more used to update watched status\n-- Minor changes\n-- Update translations zh_cn, zh_tw\n+ <news>v1.20.6 (2023-02-09)\n+- Fix SQLite error on startup using some linux systems\n+- Update translations po, cs_cz\n</news>\n</extension>\n</addon>\n"
},
{
"change_type": "MODIFY",
"old_path": "changelog.txt",
"new_path": "changelog.txt",
"diff": "+v1.20.6 (2023-02-09)\n+- Fix SQLite error on startup using some linux systems\n+- Update translations po, cs_cz\n+\nv1.20.5 (2023-01-16)\n- NOTICE FOR ANDROID DEVICES: The website has fixed the recent bug for \"MSL: Email or password is incorrect\" error,\nso video playback is now restored for all Android devices.\n"
}
] | Python | MIT License | castagnait/plugin.video.netflix | Version bump (1.20.6) (#1550) |
580,249 | 13.01.2017 16:12:56 | 0 | 077b4f767a451a57d49ab00ededeaef899f5f60a | fix: allow building path with extra query parameters when strictQueryParams is falsy | [
{
"change_type": "MODIFY",
"old_path": "modules/core/utils.js",
"new_path": "modules/core/utils.js",
"diff": "@@ -78,11 +78,10 @@ export default function withUtils(router) {\nreturn params.path;\n}\n- const { useTrailingSlash } = options;\n- return router.rootNode.buildPath(route, params, { trailingSlash: useTrailingSlash });\n+ const { useTrailingSlash, strictQueryParams } = options;\n+ return router.rootNode.buildPath(route, params, { trailingSlash: useTrailingSlash, strictQueryParams });\n}\n-\nfunction buildState(route, params) {\nreturn router.rootNode.buildState(route, params);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "},\n\"homepage\": \"http://router5.github.io\",\n\"dependencies\": {\n- \"route-node\": \"1.7.2\",\n+ \"route-node\": \"1.8.0\",\n\"router5.transition-path\": \"4.0.1\"\n},\n\"devDependencies\": {\n"
},
{
"change_type": "MODIFY",
"old_path": "tests/core/utils.js",
"new_path": "tests/core/utils.js",
"diff": "@@ -5,6 +5,7 @@ import { omitMeta } from '../_helpers';\ndescribe('core/utils', () => {\nlet router;\n+ context('with strictQueryParams', () => {\nbefore(() => router = createTestRouter().clone().start());\nafter(() => router.stop());\n@@ -44,3 +45,13 @@ describe('core/utils', () => {\n});\n});\n});\n+\n+ context('without strictQueryParams', () => {\n+ before(() => router = createTestRouter({ strictQueryParams: false }).clone().start());\n+ after(() => router.stop());\n+\n+ it('should build paths with extra parameters', () => {\n+ expect(router.buildPath('users.view', { id: '123', username: 'thomas' })).to.equal('/users/view/123?username=thomas');\n+ });\n+ });\n+});\n"
}
] | TypeScript | MIT License | router5/router5 | fix: allow building path with extra query parameters when strictQueryParams is falsy |
580,249 | 29.01.2017 10:44:27 | -3,600 | 169946557b2ded52ef4edea2a9176659ec73af53 | feat: add incremented id property to state objects | [
{
"change_type": "MODIFY",
"old_path": "modules/create-router.js",
"new_path": "modules/create-router.js",
"diff": "@@ -26,6 +26,7 @@ const defaultOptions = {\n*/\nfunction createRouter(routes, opts = {}, deps={}) {\nlet routerState = null;\n+ let stateId = 0;\nconst callbacks = {};\nconst dependencies = deps;\nconst options = { ...defaultOptions };\n@@ -122,6 +123,8 @@ function createRouter(routes, opts = {}, deps={}) {\nsetProp('name', name);\nsetProp('params', params);\nsetProp('path', path);\n+ stateId += 1;\n+ setProp('id', stateId);\nif (metaParams || source) {\nconst meta = { params: metaParams };\n"
},
{
"change_type": "MODIFY",
"old_path": "tests/plugins/browser.js",
"new_path": "tests/plugins/browser.js",
"diff": "@@ -19,6 +19,9 @@ const mockedBrowser = {\n};\nfunction withoutMeta(state) {\n+ if (!state.id) {\n+ throw new Error('No state id');\n+ }\nreturn {\nname: state.name,\nparams: state.params,\n"
}
] | TypeScript | MIT License | router5/router5 | feat: add incremented id property to state objects |
580,249 | 30.01.2017 17:26:39 | -3,600 | f03117d700831f1ca367903179e050266a54c62c | chore: add missing babel plugin | [
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"devDependencies\": {\n\"babel-core\": \"~6.21.0\",\n\"babel-eslint\": \"~7.1.1\",\n+ \"babel-plugin-external-helpers\": \"~6.22.0\",\n\"babel-plugin-transform-async-to-generator\": \"~6.16.0\",\n\"babel-plugin-transform-class-properties\": \"~6.19.0\",\n\"babel-plugin-transform-export-extensions\": \"~6.8.0\",\n"
}
] | TypeScript | MIT License | router5/router5 | chore: add missing babel plugin |
580,249 | 30.01.2017 23:07:54 | -3,600 | 6e205e9e8381f0e0effe0f177f690be072a60577 | refactor: assign id to state objects only if meta provided | [
{
"change_type": "MODIFY",
"old_path": "modules/create-router.js",
"new_path": "modules/create-router.js",
"diff": "@@ -123,15 +123,17 @@ function createRouter(routes, opts = {}, deps={}) {\nsetProp('name', name);\nsetProp('params', params);\nsetProp('path', path);\n- stateId += 1;\n- setProp('id', stateId);\n+\nif (metaParams || source) {\nconst meta = { params: metaParams };\nif (source) meta.source = source;\nsetProp('meta', meta);\n+ stateId += 1;\n+ setProp('id', stateId);\n}\n+\nreturn state;\n}\n"
}
] | TypeScript | MIT License | router5/router5 | refactor: assign id to state objects only if meta provided |
580,249 | 30.01.2017 23:14:44 | -3,600 | dae694abb74ed95d54dc36ae4b8dba9ed6bbbd01 | docs: fix README typos in plugins import paths | [
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "@@ -63,9 +63,9 @@ Several plugins are available in this repository:\n- __Persistent parameters plugin__: allows some query parameters to persist and survive navigation, without having to manually specify them for each transition.\n```js\n-import browserPlugin from 'router/plugins/browser';\n-import listenersPlugin from 'router/plugins/listeners';\n-import persistentParamsPlugin from 'router/plugins/persistentParams';\n+import browserPlugin from 'router5/plugins/browser';\n+import listenersPlugin from 'router5/plugins/listeners';\n+import persistentParamsPlugin from 'router5/plugins/persistentParams';\n```\n### Guides\n"
}
] | TypeScript | MIT License | router5/router5 | docs: fix README typos in plugins import paths |
580,249 | 19.02.2017 14:02:31 | 0 | c306d7f9e42caea1a38e3e45a638d9d62c2f68fb | refactor: move state id to meta | [
{
"change_type": "MODIFY",
"old_path": "modules/core/router-lifecycle.js",
"new_path": "modules/core/router-lifecycle.js",
"diff": "@@ -57,6 +57,7 @@ export default function withRouterLifecycle(router) {\nif (!startState) {\n// If no supplied start state, get start state\nstartState = startPath === undefined ? null : router.matchPath(startPath);\n+ console.log(startState);\n// Navigate to default function\nconst navigateToDefault = () => router.navigateToDefault({replace: true}, done);\nconst redirect = (route) => router.navigate(route.name, route.params, {replace: true, reload: true}, done);\n"
},
{
"change_type": "MODIFY",
"old_path": "modules/create-router.js",
"new_path": "modules/create-router.js",
"diff": "@@ -125,13 +125,12 @@ function createRouter(routes, opts = {}, deps={}) {\nsetProp('path', path);\nif (metaParams || source) {\n- const meta = { params: metaParams };\n+ stateId += 1;\n+ const meta = { params: metaParams, id: stateId };\nif (source) meta.source = source;\nsetProp('meta', meta);\n- stateId += 1;\n- setProp('id', stateId);\n}\nreturn state;\n"
},
{
"change_type": "MODIFY",
"old_path": "tests/plugins/browser.js",
"new_path": "tests/plugins/browser.js",
"diff": "@@ -19,7 +19,7 @@ const mockedBrowser = {\n};\nfunction withoutMeta(state) {\n- if (!state.id) {\n+ if (!state.meta.id) {\nthrow new Error('No state id');\n}\nreturn {\n"
},
{
"change_type": "MODIFY",
"old_path": "tests/plugins/listeners.js",
"new_path": "tests/plugins/listeners.js",
"diff": "@@ -29,7 +29,7 @@ describe('listenersPlugin', function () {\nrouter.addNodeListener('', nodeListener);\nrouter.start(function (err, state) {\n- expect(state).to.eql({id: 1, meta: { params: {home: {}} }, name: 'home', path: '/home', params: {}});\n+ expect(state).to.eql({meta: { id: 1, params: {home: {}} }, name: 'home', path: '/home', params: {}});\nexpect(nodeListener).to.have.been.called;\ndone();\n});\n"
}
] | TypeScript | MIT License | router5/router5 | refactor: move state id to meta |
580,249 | 22.02.2017 08:05:35 | 0 | 562ef35ee817fd7a58b8fcb9e770405d692f2380 | fix: remove accidental console.log from code | [
{
"change_type": "MODIFY",
"old_path": ".eslintrc",
"new_path": ".eslintrc",
"diff": "\"eqeqeq\": 2,\n\"no-else-return\": 2,\n\"no-multi-spaces\": 0,\n+ \"no-console\": [\"error\", { \"allow\": [\"warn\", \"error\"] }],\n// Strict mode\n\"strict\": 0,\n// Variables\n"
},
{
"change_type": "MODIFY",
"old_path": "modules/core/router-lifecycle.js",
"new_path": "modules/core/router-lifecycle.js",
"diff": "@@ -57,7 +57,7 @@ export default function withRouterLifecycle(router) {\nif (!startState) {\n// If no supplied start state, get start state\nstartState = startPath === undefined ? null : router.matchPath(startPath);\n- console.log(startState);\n+\n// Navigate to default function\nconst navigateToDefault = () => router.navigateToDefault({replace: true}, done);\nconst redirect = (route) => router.navigate(route.name, route.params, {replace: true, reload: true}, done);\n"
},
{
"change_type": "MODIFY",
"old_path": "modules/plugins/logger/index.js",
"new_path": "modules/plugins/logger/index.js",
"diff": "/* istanbul ignore next */\n+/*eslint no-console: 0*/\n+\nfunction loggerPlugin() {\nconst startGroup = () => console.group('Router transition');\nconst endGroup = () => console.groupEnd('Router transition');\n"
}
] | TypeScript | MIT License | router5/router5 | fix: remove accidental console.log from code |
580,249 | 28.04.2017 09:54:40 | -3,600 | c0d730d2dd9b3db09cc675f1825b4809290c25de | refactor: use prop-types package | [
{
"change_type": "MODIFY",
"old_path": ".travis.yml",
"new_path": ".travis.yml",
"diff": "language: node_js\nnode_js:\n- '4.0'\n-before_install:\n- - npm install -g babel-cli\nscript:\n- npm run lint\n- npm run build\n"
},
{
"change_type": "MODIFY",
"old_path": "modules/BaseLink.js",
"new_path": "modules/BaseLink.js",
"diff": "import React, { Component } from 'react';\n+import PropTypes from 'prop-types';\nclass BaseLink extends Component {\nconstructor(props, context) {\n@@ -60,16 +61,16 @@ class BaseLink extends Component {\n}\nBaseLink.contextTypes = {\n- router: React.PropTypes.object.isRequired\n+ router: PropTypes.object.isRequired\n};\n// BaseLink.propTypes = {\n-// routeName: React.PropTypes.string.isRequired,\n-// routeParams: React.PropTypes.object,\n-// routeOptions: React.PropTypes.object,\n-// activeClassName: React.PropTypes.string,\n-// activeStrict: React.PropTypes.bool,\n-// onClick: React.PropTypes.func\n+// routeName: PropTypes.string.isRequired,\n+// routeParams: PropTypes.object,\n+// routeOptions: PropTypes.object,\n+// activeClassName: PropTypes.string,\n+// activeStrict: PropTypes.bool,\n+// onClick: PropTypes.func\n// };\nBaseLink.defaultProps = {\n"
},
{
"change_type": "MODIFY",
"old_path": "modules/RouterProvider.js",
"new_path": "modules/RouterProvider.js",
"diff": "-import { Component, PropTypes, Children } from 'react';\n+import { Component, Children } from 'react';\n+import PropTypes from 'prop-types';\nclass RouterProvider extends Component {\nconstructor(props, context) {\n"
},
{
"change_type": "MODIFY",
"old_path": "modules/routeNode.js",
"new_path": "modules/routeNode.js",
"diff": "-import React, { Component, createElement } from 'react';\n+import { Component, createElement } from 'react';\nimport { getDisplayName, ifNot } from './utils';\n+import PropTypes from 'prop-types';\nfunction routeNode(nodeName) {\nreturn function routeNodeWrapper(RouteSegment) {\n@@ -40,7 +41,7 @@ function routeNode(nodeName) {\n}\nRouteNode.contextTypes = {\n- router: React.PropTypes.object.isRequired\n+ router: PropTypes.object.isRequired\n};\nRouteNode.displayName = 'RouteNode[' + getDisplayName(RouteSegment) + ']';\n"
},
{
"change_type": "MODIFY",
"old_path": "modules/withRoute.js",
"new_path": "modules/withRoute.js",
"diff": "-import React, { Component, createElement } from 'react';\n+import { Component, createElement } from 'react';\nimport { ifNot, getDisplayName } from './utils';\n+import PropTypes from 'prop-types';\nfunction withRoute(BaseComponent) {\nclass ComponentWithRoute extends Component {\n@@ -45,7 +46,7 @@ function withRoute(BaseComponent) {\n}\nComponentWithRoute.contextTypes = {\n- router: React.PropTypes.object.isRequired\n+ router: PropTypes.object.isRequired\n};\nComponentWithRoute.displayName = 'WithRoute[' + getDisplayName(BaseComponent) + ']';\n"
},
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "},\n\"homepage\": \"http://router5.github.com/router5/react-router5\",\n\"devDependencies\": {\n+ \"babel-cli\": \"~6.9.0\",\n\"babel-core\": \"~6.9.1\",\n\"babel-eslint\": \"~6.0.4\",\n\"babel-plugin-transform-export-extensions\": \"~6.8.0\",\n\"rimraf\": \"^2.5.4\",\n\"rollup\": \"^0.34.10\",\n\"rollup-plugin-babel\": \"^2.6.1\",\n+ \"rollup-plugin-commonjs\": \"^8.0.2\",\n\"rollup-plugin-npm\": \"^1.4.0\",\n\"router5\": \"^4.0.0\",\n\"sinon\": \"^1.17.5\",\n\"peerDependencies\": {\n\"router5\": \"^4.0.0\",\n\"react\": \"~0.14.0 || ^15.0.0\"\n+ },\n+ \"dependencies\": {\n+ \"prop-types\": \"^15.5.8\"\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "rollup.config.js",
"new_path": "rollup.config.js",
"diff": "import babel from 'rollup-plugin-babel';\nimport npm from 'rollup-plugin-npm';\n+import common from 'rollup-plugin-commonjs';\nconst babelOptions = {\npresets: [ 'es2015-rollup' ],\n@@ -13,7 +14,7 @@ const babelOptions = {\nexport default {\nentry: 'modules/index.js',\nformat: 'umd',\n- plugins: [ babel(babelOptions), npm({ jsnext: true, skip: [ 'react' ] }) ],\n+ plugins: [ common({ include: 'node_modules/**' }), babel(babelOptions), npm({ jsnext: true, skip: [ 'react' ] }) ],\nmoduleName: 'reactRouter5',\nmoduleId: 'reactRouter5',\ndest: 'dist/umd/react-router5.js'\n"
}
] | TypeScript | MIT License | router5/router5 | refactor: use prop-types package |
580,244 | 05.05.2017 22:23:45 | -7,200 | e1750e038531d0c41ea47a025b002b927125d4f8 | Fix error message in RouterProvider.js | [
{
"change_type": "MODIFY",
"old_path": "modules/RouterProvider.js",
"new_path": "modules/RouterProvider.js",
"diff": "@@ -13,7 +13,7 @@ class RouterProvider extends Component {\ncomponentWillReceiveProps(nextProps) {\nif (this.props.router !== nextProps.router) {\n- console.error('[react-router5][Router]does not support changing the router object.');\n+ console.error('[react-router5][RouterProvider] does not support changing the router object.');\n}\n}\n"
}
] | TypeScript | MIT License | router5/router5 | Fix error message in RouterProvider.js (#31) |
580,234 | 10.05.2017 23:00:51 | -3,600 | 52bbbb77ce50a5952724134289592ce9e83cb577 | Fix english typo. | [
{
"change_type": "MODIFY",
"old_path": "modules/core/utils.js",
"new_path": "modules/core/utils.js",
"diff": "@@ -109,7 +109,7 @@ export default function withUtils(router) {\n}\n/**\n- * Set the root node patch, use carefully. It can be used to set app-wide allowed query parameters.\n+ * Set the root node path, use carefully. It can be used to set app-wide allowed query parameters.\n* @param {String} rootPath The root node path\n*/\nfunction setRootPath(rootPath) {\n"
}
] | TypeScript | MIT License | router5/router5 | Fix english typo. |
580,244 | 16.05.2017 21:20:08 | -7,200 | 30b0d03ae2b890a388a60bed0274961a6b460669 | Uncomment BaseLink's prop types
They have been commented by
I think it's an error. | [
{
"change_type": "MODIFY",
"old_path": "modules/BaseLink.js",
"new_path": "modules/BaseLink.js",
"diff": "@@ -64,14 +64,14 @@ BaseLink.contextTypes = {\nrouter: PropTypes.object.isRequired\n};\n-// BaseLink.propTypes = {\n-// routeName: PropTypes.string.isRequired,\n-// routeParams: PropTypes.object,\n-// routeOptions: PropTypes.object,\n-// activeClassName: PropTypes.string,\n-// activeStrict: PropTypes.bool,\n-// onClick: PropTypes.func\n-// };\n+BaseLink.propTypes = {\n+ routeName: PropTypes.string.isRequired,\n+ routeParams: PropTypes.object,\n+ routeOptions: PropTypes.object,\n+ activeClassName: PropTypes.string,\n+ activeStrict: PropTypes.bool,\n+ onClick: PropTypes.func\n+};\nBaseLink.defaultProps = {\nactiveClassName: 'active',\n"
}
] | TypeScript | MIT License | router5/router5 | Uncomment BaseLink's prop types (#32)
They have been commented by
fe3cf03793fbdc48deb7afb79ab8cb49125fda09. I think it's an error. |
580,249 | 16.05.2017 21:17:08 | -3,600 | 678e4248735fbb264f6dc5115ba3d68ece5f967a | feat: support title attribute in links | [
{
"change_type": "MODIFY",
"old_path": "modules/BaseLink.js",
"new_path": "modules/BaseLink.js",
"diff": "@@ -47,16 +47,30 @@ class BaseLink extends Component {\n}\nrender() {\n- const { routeName, routeParams, className, activeClassName, children } = this.props;\n+ const {\n+ routeName,\n+ routeParams,\n+ className,\n+ activeClassName,\n+ children,\n+ title\n+ } = this.props;\nconst active = this.isActive();\nconst href = this.buildUrl(routeName, routeParams);\nconst linkclassName = (className ? className.split(' ') : [])\n.concat(active ? [activeClassName] : []).join(' ');\n- const onClick = this.clickHandler;\n-\n- return React.createElement('a', {href, className: linkclassName, onClick}, children);\n+ return React.createElement(\n+ 'a',\n+ {\n+ href,\n+ className: linkclassName,\n+ onClick: this.clickHandler,\n+ title\n+ },\n+ children\n+ );\n}\n}\n"
}
] | TypeScript | MIT License | router5/router5 | feat: support title attribute in links |
580,249 | 17.05.2017 09:56:56 | -3,600 | 602f155234675259049a46893f2fb7c9199957a6 | fix: fix peer dependencies version range | [
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"yargs\": \"~8.0.1\"\n},\n\"peerDependencies\": {\n- \"react\": \"~0.14.0 || ~15.0.0\",\n- \"router5\": \"~4.5.2\"\n+ \"react\": \"^0.14.0 || ^15.0.0\",\n+ \"router5\": \"^4.5.2\"\n},\n\"dependencies\": {\n\"prop-types\": \"~15.5.10\"\n"
}
] | TypeScript | MIT License | router5/router5 | fix: fix peer dependencies version range |
580,249 | 06.06.2017 21:33:30 | -3,600 | 62dda5e0722822ced5bfdcd563bee8fd53f7b838 | chore: v4.6.0 | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "+<a name=\"4.6.0\"></a>\n+# [4.6.0](https://github.com/router5/router5/compare/v4.5.2...v4.6.0) (2017-06-06)\n+\n+\n+### Features\n+\n+* add TypeScript definitions ([@tals](https://github.com/tals) [@Keats](https://github.com/Keats)) ([378d5f5](https://github.com/router5/router5/commit/378d5f5))\n+\n+\n+\n<a name=\"4.5.2\"></a>\n## [4.5.2](https://github.com/router5/router5/compare/v4.5.1...v4.5.2) (2017-04-08)\n"
},
{
"change_type": "MODIFY",
"old_path": "bower.json",
"new_path": "bower.json",
"diff": "{\n\"name\": \"router5\",\n- \"version\": \"4.5.2\",\n+ \"version\": \"4.5.3\",\n\"homepage\": \"http://router5.github.io\",\n\"authors\": [\n\"Thomas Roch <[email protected]>\"\n"
},
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "{\n\"name\": \"router5\",\n- \"version\": \"4.5.2\",\n+ \"version\": \"4.6.0\",\n\"description\": \"A simple, powerful, view-agnostic, modular and extensible router\",\n\"main\": \"index.js\",\n\"jsnext:main\": \"dist/es/index.js\",\n"
}
] | TypeScript | MIT License | router5/router5 | chore: v4.6.0 |
580,253 | 10.06.2017 20:54:39 | -25,200 | 452be831e2a4cafedbabfaba53e5ca2d4534566b | feat: support onMouseOver event handler in links | [
{
"change_type": "MODIFY",
"old_path": "modules/BaseLink.js",
"new_path": "modules/BaseLink.js",
"diff": "@@ -53,7 +53,8 @@ class BaseLink extends Component {\nclassName,\nactiveClassName,\nchildren,\n- title\n+ title,\n+ onMouseOver,\n} = this.props;\nconst active = this.isActive();\n@@ -67,6 +68,7 @@ class BaseLink extends Component {\nhref,\nclassName: linkclassName,\nonClick: this.clickHandler,\n+ onMouseOver,\ntitle\n},\nchildren\n@@ -84,7 +86,8 @@ BaseLink.propTypes = {\nrouteOptions: PropTypes.object,\nactiveClassName: PropTypes.string,\nactiveStrict: PropTypes.bool,\n- onClick: PropTypes.func\n+ onClick: PropTypes.func,\n+ onMouseOver: PropTypes.func\n};\nBaseLink.defaultProps = {\n"
}
] | TypeScript | MIT License | router5/router5 | feat: support onMouseOver event handler in links |
580,249 | 11.06.2017 21:25:01 | -3,600 | 29d21d10f25bab8e15119ef90dd2d9ce793bf0a3 | chore: v4.3.0 | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "+<a name=\"4.3.0\"></a>\n+# [4.3.0](https://github.com/router5/react-router5/compare/v4.2.1...v4.3.0) (2017-06-11)\n+\n+\n+### Features\n+\n+* support onMouseOver event handler in links ([452be83](https://github.com/router5/react-router5/commit/452be83))\n+\n+\n+\n<a name=\"4.2.1\"></a>\n## [4.2.1](https://github.com/router5/react-router5/compare/v4.2.0...v4.2.1) (2017-05-17)\n"
},
{
"change_type": "MODIFY",
"old_path": "dist/commonjs/BaseLink.js",
"new_path": "dist/commonjs/BaseLink.js",
"diff": "@@ -84,7 +84,8 @@ var BaseLink = function (_Component) {\nclassName = _props.className,\nactiveClassName = _props.activeClassName,\nchildren = _props.children,\n- title = _props.title;\n+ title = _props.title,\n+ onMouseOver = _props.onMouseOver;\nvar active = this.isActive();\n@@ -95,6 +96,7 @@ var BaseLink = function (_Component) {\nhref: href,\nclassName: linkclassName,\nonClick: this.clickHandler,\n+ onMouseOver: onMouseOver,\ntitle: title\n}, children);\n}\n@@ -113,7 +115,8 @@ BaseLink.propTypes = {\nrouteOptions: _propTypes2.default.object,\nactiveClassName: _propTypes2.default.string,\nactiveStrict: _propTypes2.default.bool,\n- onClick: _propTypes2.default.func\n+ onClick: _propTypes2.default.func,\n+ onMouseOver: _propTypes2.default.func\n};\nBaseLink.defaultProps = {\n"
},
{
"change_type": "MODIFY",
"old_path": "dist/es/BaseLink.js",
"new_path": "dist/es/BaseLink.js",
"diff": "@@ -63,7 +63,8 @@ var BaseLink = function (_Component) {\nclassName = _props.className,\nactiveClassName = _props.activeClassName,\nchildren = _props.children,\n- title = _props.title;\n+ title = _props.title,\n+ onMouseOver = _props.onMouseOver;\nvar active = this.isActive();\n@@ -74,6 +75,7 @@ var BaseLink = function (_Component) {\nhref: href,\nclassName: linkclassName,\nonClick: this.clickHandler,\n+ onMouseOver: onMouseOver,\ntitle: title\n}, children);\n}\n@@ -91,7 +93,8 @@ BaseLink.propTypes = {\nrouteOptions: PropTypes.object,\nactiveClassName: PropTypes.string,\nactiveStrict: PropTypes.bool,\n- onClick: PropTypes.func\n+ onClick: PropTypes.func,\n+ onMouseOver: PropTypes.func\n};\nBaseLink.defaultProps = {\n"
},
{
"change_type": "MODIFY",
"old_path": "dist/umd/react-router5.js",
"new_path": "dist/umd/react-router5.js",
"diff": "@@ -917,7 +917,8 @@ var BaseLink = function (_Component) {\nclassName = _props.className,\nactiveClassName = _props.activeClassName,\nchildren = _props.children,\n- title = _props.title;\n+ title = _props.title,\n+ onMouseOver = _props.onMouseOver;\nvar active = this.isActive();\n@@ -928,6 +929,7 @@ var BaseLink = function (_Component) {\nhref: href,\nclassName: linkclassName,\nonClick: this.clickHandler,\n+ onMouseOver: onMouseOver,\ntitle: title\n}, children);\n}\n@@ -945,7 +947,8 @@ BaseLink.propTypes = {\nrouteOptions: index.object,\nactiveClassName: index.string,\nactiveStrict: index.bool,\n- onClick: index.func\n+ onClick: index.func,\n+ onMouseOver: index.func\n};\nBaseLink.defaultProps = {\n"
},
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "{\n\"name\": \"react-router5\",\n- \"version\": \"4.2.1\",\n+ \"version\": \"4.3.0\",\n\"description\": \"router5 helpers for React\",\n\"main\": \"dist/commonjs/index.js\",\n\"jsnext:main\": \"dist/es/index.js\",\n"
}
] | TypeScript | MIT License | router5/router5 | chore: v4.3.0 |
580,249 | 12.06.2017 17:51:18 | -3,600 | d070a5497c5eb176545f71df9dab7d8d7ed13eb9 | refactor: update react-router5 package | [
{
"change_type": "MODIFY",
"old_path": ".babelrc",
"new_path": ".babelrc",
"diff": "{\n+ \"presets\": [ \"react\" ],\n\"plugins\": [\n\"transform-object-rest-spread\",\n\"transform-class-properties\",\n"
},
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"babel-preset-es2015\": \"~6.24.1\",\n\"babel-preset-es2015-native-modules\": \"~6.9.4\",\n\"babel-preset-es2015-rollup\": \"~3.0.0\",\n+ \"babel-preset-react\": \"~6.24.1\",\n\"chai\": \"~3.5.0\",\n\"conventional-changelog\": \"~1.1.3\",\n\"coveralls\": \"~2.13.0\",\n\"rimraf\": \"~2.6.1\",\n\"rollup\": \"~0.41.6\",\n\"rollup-plugin-babel\": \"~2.7.1\",\n+ \"rollup-plugin-commonjs\": \"~8.0.2\",\n\"rollup-plugin-node-resolve\": \"~3.0.0\",\n\"rollup-plugin-uglify\": \"~1.0.2\",\n\"sinon\": \"~2.1.0\",\n"
},
{
"change_type": "DELETE",
"old_path": "packages/react-router5/.babelrc",
"new_path": null,
"diff": "-{\n- \"presets\": [\n- \"react\"\n- ],\n- \"plugins\": [\n- \"transform-object-rest-spread\",\n- \"transform-export-extensions\"\n- ],\n- \"env\": {\n- \"development\": {\n- \"presets\": [ \"es2015\" ]\n- },\n- \"es\": {\n- \"presets\": [ \"es2015-rollup\" ]\n- }\n- }\n-}\n"
},
{
"change_type": "DELETE",
"old_path": "packages/react-router5/.editorconfig",
"new_path": null,
"diff": "-# http://editorconfig.org\n-\n-root = true\n-\n-[*]\n-indent_style = space\n-indent_size = 4\n-\n-charset = utf-8\n-end_of_line = lf\n-insert_final_newline = true\n-trim_trailing_whitespace = true\n-\n-[*.md]\n-trim_trailing_whitespace = false\n"
},
{
"change_type": "DELETE",
"old_path": "packages/react-router5/.eslintrc",
"new_path": null,
"diff": "-{\n- // Parser\n- \"parser\": \"babel-eslint\",\n- // ECMA Features\n- \"ecmaFeatures\": {\n- \"arrowFunctions\": true,\n- \"blockBindings\": true,\n- \"classes\": true,\n- \"defaultParams\": true,\n- \"destructuring\": true,\n- \"modules\": true,\n- \"objectLiteralComputedProperties\": true,\n- \"templateStrings\": true\n- },\n- \"rules\": {\n- // Possible Errors\n- \"no-dupe-args\": 2,\n- \"no-dupe-keys\": 2,\n- \"no-empty\": 2,\n- \"no-func-assign\": 2,\n- \"no-inner-declarations\": 2,\n- \"no-unreachable\": 2,\n- \"no-unexpected-multiline\": 2,\n- // Best practices\n- \"consistent-return\": 0,\n- \"curly\": [2, \"multi-line\"],\n- \"eqeqeq\": 2,\n- \"no-else-return\": 2,\n- \"no-multi-spaces\": 0,\n- // Strict mode\n- \"strict\": 0,\n- // Variables\n- \"no-shadow\": 0,\n- \"no-unused-vars\": 2,\n- \"no-use-before-define\": 0,\n- // Style\n- \"brace-style\": [2, \"1tbs\"],\n- \"comma-spacing\": [2, {\"before\": false, \"after\": true}],\n- \"comma-style\": [2, \"last\"],\n- \"consistent-this\": [2, \"that\"],\n- \"lines-around-comment\": [2, {\"allowBlockStart\": true}],\n- \"key-spacing\": 0,\n- \"new-parens\": 0,\n- \"quotes\": [2, \"single\", \"avoid-escape\"],\n- \"no-underscore-dangle\": 0,\n- \"no-unneeded-ternary\": 2,\n- \"semi\": 2,\n- // ES6\n- \"no-var\": 2,\n- \"no-this-before-super\": 2,\n- \"object-shorthand\": 2,\n- },\n- \"env\": {\n- \"node\": true,\n- \"browser\": true\n- }\n-}\n"
},
{
"change_type": "DELETE",
"old_path": "packages/react-router5/.gitignore",
"new_path": null,
"diff": "-node_modules/\n-jspm_packages/\n-npm-debug.log\n"
},
{
"change_type": "DELETE",
"old_path": "packages/react-router5/.travis.yml",
"new_path": null,
"diff": "-language: node_js\n-node_js:\n- - '6.0'\n-script:\n- - npm run lint\n- - npm run build\n- - npm run test\n"
},
{
"change_type": "DELETE",
"old_path": "packages/react-router5/LICENSE",
"new_path": null,
"diff": "-The MIT License (MIT)\n-\n-Copyright (c) 2015 Thomas Roch\n-\n-Permission is hereby granted, free of charge, to any person obtaining a copy\n-of this software and associated documentation files (the \"Software\"), to deal\n-in the Software without restriction, including without limitation the rights\n-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n-copies of the Software, and to permit persons to whom the Software is\n-furnished to do so, subject to the following conditions:\n-\n-The above copyright notice and this permission notice shall be included in all\n-copies or substantial portions of the Software.\n-\n-THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n-SOFTWARE.\n-\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/react-router5/dist/es/BaseLink.js",
"new_path": "packages/react-router5/dist/es/BaseLink.js",
"diff": "+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n+\n+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n+\n+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n+\n+function _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n+\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nvar BaseLink = function (_Component) {\n- babelHelpers.inherits(BaseLink, _Component);\n+ _inherits(BaseLink, _Component);\nfunction BaseLink(props, context) {\n- babelHelpers.classCallCheck(this, BaseLink);\n+ _classCallCheck(this, BaseLink);\n- var _this = babelHelpers.possibleConstructorReturn(this, (BaseLink.__proto__ || Object.getPrototypeOf(BaseLink)).call(this, props, context));\n+ var _this = _possibleConstructorReturn(this, (BaseLink.__proto__ || Object.getPrototypeOf(BaseLink)).call(this, props, context));\n_this.router = context.router;\n@@ -22,7 +30,7 @@ var BaseLink = function (_Component) {\nreturn _this;\n}\n- babelHelpers.createClass(BaseLink, [{\n+ _createClass(BaseLink, [{\nkey: 'buildUrl',\nvalue: function buildUrl(routeName, routeParams) {\nif (this.router.buildUrl) {\n@@ -80,6 +88,7 @@ var BaseLink = function (_Component) {\n}, children);\n}\n}]);\n+\nreturn BaseLink;\n}(Component);\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/react-router5/dist/es/RouterProvider.js",
"new_path": "packages/react-router5/dist/es/RouterProvider.js",
"diff": "+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n+\n+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n+\n+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n+\n+function _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n+\nimport { Component, Children } from 'react';\nimport PropTypes from 'prop-types';\nvar RouterProvider = function (_Component) {\n- babelHelpers.inherits(RouterProvider, _Component);\n+ _inherits(RouterProvider, _Component);\nfunction RouterProvider(props, context) {\n- babelHelpers.classCallCheck(this, RouterProvider);\n+ _classCallCheck(this, RouterProvider);\n- var _this = babelHelpers.possibleConstructorReturn(this, (RouterProvider.__proto__ || Object.getPrototypeOf(RouterProvider)).call(this, props, context));\n+ var _this = _possibleConstructorReturn(this, (RouterProvider.__proto__ || Object.getPrototypeOf(RouterProvider)).call(this, props, context));\n_this.router = props.router;\nreturn _this;\n}\n- babelHelpers.createClass(RouterProvider, [{\n+ _createClass(RouterProvider, [{\nkey: 'getChildContext',\nvalue: function getChildContext() {\nreturn { router: this.router };\n@@ -33,6 +41,7 @@ var RouterProvider = function (_Component) {\nreturn Children.only(children);\n}\n}]);\n+\nreturn RouterProvider;\n}(Component);\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/react-router5/dist/es/routeNode.js",
"new_path": "packages/react-router5/dist/es/routeNode.js",
"diff": "+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n+\n+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n+\n+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n+\n+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n+\n+function _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n+\nimport { Component, createElement } from 'react';\nimport { getDisplayName, ifNot } from './utils';\nimport PropTypes from 'prop-types';\n@@ -5,12 +15,12 @@ import PropTypes from 'prop-types';\nfunction routeNode(nodeName) {\nreturn function routeNodeWrapper(RouteSegment) {\nvar RouteNode = function (_Component) {\n- babelHelpers.inherits(RouteNode, _Component);\n+ _inherits(RouteNode, _Component);\nfunction RouteNode(props, context) {\n- babelHelpers.classCallCheck(this, RouteNode);\n+ _classCallCheck(this, RouteNode);\n- var _this = babelHelpers.possibleConstructorReturn(this, (RouteNode.__proto__ || Object.getPrototypeOf(RouteNode)).call(this, props, context));\n+ var _this = _possibleConstructorReturn(this, (RouteNode.__proto__ || Object.getPrototypeOf(RouteNode)).call(this, props, context));\n_this.router = context.router;\n_this.state = {\n@@ -20,7 +30,7 @@ function routeNode(nodeName) {\nreturn _this;\n}\n- babelHelpers.createClass(RouteNode, [{\n+ _createClass(RouteNode, [{\nkey: 'componentDidMount',\nvalue: function componentDidMount() {\nvar _this2 = this;\n@@ -46,11 +56,12 @@ function routeNode(nodeName) {\npreviousRoute = _state.previousRoute,\nroute = _state.route;\n- var component = createElement(RouteSegment, babelHelpers.extends({}, props, { router: router, previousRoute: previousRoute, route: route }));\n+ var component = createElement(RouteSegment, _extends({}, props, { router: router, previousRoute: previousRoute, route: route }));\nreturn component;\n}\n}]);\n+\nreturn RouteNode;\n}(Component);\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/react-router5/dist/es/withRoute.js",
"new_path": "packages/react-router5/dist/es/withRoute.js",
"diff": "+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n+\n+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n+\n+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n+\n+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n+\n+function _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n+\nimport { Component, createElement } from 'react';\nimport { ifNot, getDisplayName } from './utils';\nimport PropTypes from 'prop-types';\nfunction withRoute(BaseComponent) {\nvar ComponentWithRoute = function (_Component) {\n- babelHelpers.inherits(ComponentWithRoute, _Component);\n+ _inherits(ComponentWithRoute, _Component);\nfunction ComponentWithRoute(props, context) {\n- babelHelpers.classCallCheck(this, ComponentWithRoute);\n+ _classCallCheck(this, ComponentWithRoute);\n- var _this = babelHelpers.possibleConstructorReturn(this, (ComponentWithRoute.__proto__ || Object.getPrototypeOf(ComponentWithRoute)).call(this, props, context));\n+ var _this = _possibleConstructorReturn(this, (ComponentWithRoute.__proto__ || Object.getPrototypeOf(ComponentWithRoute)).call(this, props, context));\n_this.router = context.router;\n_this.state = {\n@@ -20,7 +30,7 @@ function withRoute(BaseComponent) {\nreturn _this;\n}\n- babelHelpers.createClass(ComponentWithRoute, [{\n+ _createClass(ComponentWithRoute, [{\nkey: 'componentDidMount',\nvalue: function componentDidMount() {\nvar _this2 = this;\n@@ -50,9 +60,10 @@ function withRoute(BaseComponent) {\nvalue: function render() {\nifNot(!this.props.router && !this.props.route && !this.props.previousRoute, '[react-router5] prop names `router`, `route` and `previousRoute` are reserved.');\n- return createElement(BaseComponent, babelHelpers.extends({}, this.props, this.state, { router: this.router }));\n+ return createElement(BaseComponent, _extends({}, this.props, this.state, { router: this.router }));\n}\n}]);\n+\nreturn ComponentWithRoute;\n}(Component);\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/react-router5/package.json",
"new_path": "packages/react-router5/package.json",
"diff": "},\n\"homepage\": \"http://router5.github.com/router5/react-router5\",\n\"devDependencies\": {\n- \"babel-cli\": \"~6.24.1\",\n- \"babel-core\": \"~6.24.1\",\n- \"babel-eslint\": \"~7.2.3\",\n- \"babel-plugin-transform-export-extensions\": \"~6.22.0\",\n- \"babel-plugin-transform-object-rest-spread\": \"~6.23.0\",\n- \"babel-preset-es2015\": \"~6.24.1\",\n- \"babel-preset-es2015-rollup\": \"~3.0.0\",\n- \"babel-preset-react\": \"~6.24.1\",\n- \"chai\": \"~3.5.0\",\n\"chai-enzyme\": \"~0.6.1\",\n\"cheerio\": \"~0.22.0\",\n\"enzyme\": \"~2.8.2\",\n- \"eslint\": \"~3.19.0\",\n- \"jsdom\": \"~10.1.0\",\n- \"mocha\": \"~3.4.1\",\n\"react\": \"~15.5.4\",\n\"react-dom\": \"~15.5.4\",\n\"react-test-renderer\": \"~15.5.4\",\n\"rimraf\": \"~2.6.1\",\n- \"rollup\": \"~0.41.6\",\n- \"rollup-plugin-babel\": \"~2.7.1\",\n- \"rollup-plugin-commonjs\": \"~8.0.2\",\n- \"rollup-plugin-node-resolve\": \"~3.0.0\",\n- \"router5\": \"~4.5.2\",\n- \"sinon\": \"~2.2.0\",\n- \"sinon-chai\": \"~2.10.0\",\n- \"yargs\": \"~8.0.1\"\n+ \"router5\": \"~4.5.2\"\n},\n\"peerDependencies\": {\n\"react\": \"^0.14.0 || ^15.0.0\",\n"
},
{
"change_type": "MODIFY",
"old_path": "yarn.lock",
"new_path": "yarn.lock",
"diff": "@@ -33,7 +33,7 @@ acorn@^3.0.4:\nversion \"3.3.0\"\nresolved \"https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a\"\n-acorn@^4.0.4:\n+acorn@^4.0.1, acorn@^4.0.4:\nversion \"4.0.11\"\nresolved \"https://registry.yarnpkg.com/acorn/-/acorn-4.0.11.tgz#edcda3bd937e7556410d42ed5860f67399c794c0\"\n@@ -267,6 +267,14 @@ babel-generator@^6.24.1:\nsource-map \"^0.5.0\"\ntrim-right \"^1.0.1\"\n+babel-helper-builder-react-jsx@^6.24.1:\n+ version \"6.24.1\"\n+ resolved \"https://registry.yarnpkg.com/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.24.1.tgz#0ad7917e33c8d751e646daca4e77cc19377d2cbc\"\n+ dependencies:\n+ babel-runtime \"^6.22.0\"\n+ babel-types \"^6.24.1\"\n+ esutils \"^2.0.0\"\n+\nbabel-helper-call-delegate@^6.24.1:\nversion \"6.24.1\"\nresolved \"https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d\"\n@@ -382,6 +390,14 @@ babel-plugin-syntax-export-extensions@^6.8.0:\nversion \"6.13.0\"\nresolved \"https://registry.yarnpkg.com/babel-plugin-syntax-export-extensions/-/babel-plugin-syntax-export-extensions-6.13.0.tgz#70a1484f0f9089a4e84ad44bac353c95b9b12721\"\n+babel-plugin-syntax-flow@^6.18.0:\n+ version \"6.18.0\"\n+ resolved \"https://registry.yarnpkg.com/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz#4c3ab20a2af26aa20cd25995c398c4eb70310c8d\"\n+\n+babel-plugin-syntax-jsx@^6.3.13, babel-plugin-syntax-jsx@^6.8.0:\n+ version \"6.18.0\"\n+ resolved \"https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946\"\n+\nbabel-plugin-syntax-object-rest-spread@^6.8.0:\nversion \"6.13.0\"\nresolved \"https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5\"\n@@ -578,6 +594,13 @@ babel-plugin-transform-export-extensions@~6.22.0:\nbabel-plugin-syntax-export-extensions \"^6.8.0\"\nbabel-runtime \"^6.22.0\"\n+babel-plugin-transform-flow-strip-types@^6.22.0:\n+ version \"6.22.0\"\n+ resolved \"https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz#84cb672935d43714fdc32bce84568d87441cf7cf\"\n+ dependencies:\n+ babel-plugin-syntax-flow \"^6.18.0\"\n+ babel-runtime \"^6.22.0\"\n+\nbabel-plugin-transform-object-rest-spread@~6.23.0:\nversion \"6.23.0\"\nresolved \"https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.23.0.tgz#875d6bc9be761c58a2ae3feee5dc4895d8c7f921\"\n@@ -585,6 +608,34 @@ babel-plugin-transform-object-rest-spread@~6.23.0:\nbabel-plugin-syntax-object-rest-spread \"^6.8.0\"\nbabel-runtime \"^6.22.0\"\n+babel-plugin-transform-react-display-name@^6.23.0:\n+ version \"6.25.0\"\n+ resolved \"https://registry.yarnpkg.com/babel-plugin-transform-react-display-name/-/babel-plugin-transform-react-display-name-6.25.0.tgz#67e2bf1f1e9c93ab08db96792e05392bf2cc28d1\"\n+ dependencies:\n+ babel-runtime \"^6.22.0\"\n+\n+babel-plugin-transform-react-jsx-self@^6.22.0:\n+ version \"6.22.0\"\n+ resolved \"https://registry.yarnpkg.com/babel-plugin-transform-react-jsx-self/-/babel-plugin-transform-react-jsx-self-6.22.0.tgz#df6d80a9da2612a121e6ddd7558bcbecf06e636e\"\n+ dependencies:\n+ babel-plugin-syntax-jsx \"^6.8.0\"\n+ babel-runtime \"^6.22.0\"\n+\n+babel-plugin-transform-react-jsx-source@^6.22.0:\n+ version \"6.22.0\"\n+ resolved \"https://registry.yarnpkg.com/babel-plugin-transform-react-jsx-source/-/babel-plugin-transform-react-jsx-source-6.22.0.tgz#66ac12153f5cd2d17b3c19268f4bf0197f44ecd6\"\n+ dependencies:\n+ babel-plugin-syntax-jsx \"^6.8.0\"\n+ babel-runtime \"^6.22.0\"\n+\n+babel-plugin-transform-react-jsx@^6.24.1:\n+ version \"6.24.1\"\n+ resolved \"https://registry.yarnpkg.com/babel-plugin-transform-react-jsx/-/babel-plugin-transform-react-jsx-6.24.1.tgz#840a028e7df460dfc3a2d29f0c0d91f6376e66a3\"\n+ dependencies:\n+ babel-helper-builder-react-jsx \"^6.24.1\"\n+ babel-plugin-syntax-jsx \"^6.8.0\"\n+ babel-runtime \"^6.22.0\"\n+\nbabel-plugin-transform-regenerator@^6.24.1:\nversion \"6.24.1\"\nresolved \"https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.24.1.tgz#b8da305ad43c3c99b4848e4fe4037b770d23c418\"\n@@ -655,6 +706,23 @@ babel-preset-es2015@^6.3.13, babel-preset-es2015@latest, babel-preset-es2015@~6.\nbabel-plugin-transform-es2015-unicode-regex \"^6.24.1\"\nbabel-plugin-transform-regenerator \"^6.24.1\"\n+babel-preset-flow@^6.23.0:\n+ version \"6.23.0\"\n+ resolved \"https://registry.yarnpkg.com/babel-preset-flow/-/babel-preset-flow-6.23.0.tgz#e71218887085ae9a24b5be4169affb599816c49d\"\n+ dependencies:\n+ babel-plugin-transform-flow-strip-types \"^6.22.0\"\n+\n+babel-preset-react@~6.24.1:\n+ version \"6.24.1\"\n+ resolved \"https://registry.yarnpkg.com/babel-preset-react/-/babel-preset-react-6.24.1.tgz#ba69dfaea45fc3ec639b6a4ecea6e17702c91380\"\n+ dependencies:\n+ babel-plugin-syntax-jsx \"^6.3.13\"\n+ babel-plugin-transform-react-display-name \"^6.23.0\"\n+ babel-plugin-transform-react-jsx \"^6.24.1\"\n+ babel-plugin-transform-react-jsx-self \"^6.22.0\"\n+ babel-plugin-transform-react-jsx-source \"^6.22.0\"\n+ babel-preset-flow \"^6.23.0\"\n+\nbabel-register@^6.24.1:\nversion \"6.24.1\"\nresolved \"https://registry.yarnpkg.com/babel-register/-/babel-register-6.24.1.tgz#7e10e13a2f71065bdfad5a1787ba45bca6ded75f\"\n@@ -1461,7 +1529,11 @@ estree-walker@^0.2.1:\nversion \"0.2.1\"\nresolved \"https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.2.1.tgz#bdafe8095383d8414d5dc2ecf4c9173b6db9412e\"\n-esutils@^2.0.2:\n+estree-walker@^0.3.0:\n+ version \"0.3.1\"\n+ resolved \"https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.3.1.tgz#e6b1a51cf7292524e7237c312e5fe6660c1ce1aa\"\n+\n+esutils@^2.0.0, esutils@^2.0.2:\nversion \"2.0.2\"\nresolved \"https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b\"\n@@ -2523,6 +2595,12 @@ lru-cache@^4.0.1:\npseudomap \"^1.0.1\"\nyallist \"^2.0.0\"\n+magic-string@^0.19.0:\n+ version \"0.19.1\"\n+ resolved \"https://registry.yarnpkg.com/magic-string/-/magic-string-0.19.1.tgz#14d768013caf2ec8fdea16a49af82fc377e75201\"\n+ dependencies:\n+ vlq \"^0.2.1\"\n+\nmake-dir@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/make-dir/-/make-dir-1.0.0.tgz#97a011751e91dd87cfadef58832ebb04936de978\"\n@@ -2554,7 +2632,7 @@ meow@^3.3.0, meow@^3.7.0:\nredent \"^1.0.0\"\ntrim-newlines \"^1.0.0\"\n-micromatch@^2.1.5:\n+micromatch@^2.1.5, micromatch@^2.3.11:\nversion \"2.3.11\"\nresolved \"https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565\"\ndependencies:\n@@ -3237,7 +3315,7 @@ [email protected], [email protected]:\nversion \"1.1.7\"\nresolved \"https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b\"\n-resolve@^1.1.6:\n+resolve@^1.1.6, resolve@^1.1.7:\nversion \"1.3.3\"\nresolved \"https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5\"\ndependencies:\n@@ -3278,6 +3356,16 @@ rollup-plugin-babel@~2.7.1:\nobject-assign \"^4.1.0\"\nrollup-pluginutils \"^1.5.0\"\n+rollup-plugin-commonjs@~8.0.2:\n+ version \"8.0.2\"\n+ resolved \"https://registry.yarnpkg.com/rollup-plugin-commonjs/-/rollup-plugin-commonjs-8.0.2.tgz#98b1589bfe32a6c0f67790b60c0b499972afed89\"\n+ dependencies:\n+ acorn \"^4.0.1\"\n+ estree-walker \"^0.3.0\"\n+ magic-string \"^0.19.0\"\n+ resolve \"^1.1.7\"\n+ rollup-pluginutils \"^2.0.1\"\n+\nrollup-plugin-node-resolve@~3.0.0:\nversion \"3.0.0\"\nresolved \"https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.0.0.tgz#8b897c4c3030d5001277b0514b25d2ca09683ee0\"\n@@ -3300,6 +3388,13 @@ rollup-pluginutils@^1.5.0:\nestree-walker \"^0.2.1\"\nminimatch \"^3.0.2\"\n+rollup-pluginutils@^2.0.1:\n+ version \"2.0.1\"\n+ resolved \"https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.0.1.tgz#7ec95b3573f6543a46a6461bd9a7c544525d0fc0\"\n+ dependencies:\n+ estree-walker \"^0.3.0\"\n+ micromatch \"^2.3.11\"\n+\nrollup@~0.41.6:\nversion \"0.41.6\"\nresolved \"https://registry.yarnpkg.com/rollup/-/rollup-0.41.6.tgz#e0d05497877a398c104d816d2733a718a7a94e2a\"\n@@ -3788,6 +3883,10 @@ [email protected]:\ndependencies:\nextsprintf \"1.0.2\"\n+vlq@^0.2.1:\n+ version \"0.2.2\"\n+ resolved \"https://registry.yarnpkg.com/vlq/-/vlq-0.2.2.tgz#e316d5257b40b86bb43cb8d5fea5d7f54d6b0ca1\"\n+\nwcwidth@^1.0.0:\nversion \"1.0.1\"\nresolved \"https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8\"\n"
}
] | TypeScript | MIT License | router5/router5 | refactor: update react-router5 package |
580,249 | 12.06.2017 18:20:24 | -3,600 | 86bdb38b4159a5f166eddd6d14e566371a6e95a2 | refactor: update redux-router5 package | [
{
"change_type": "MODIFY",
"old_path": ".travis.yml",
"new_path": ".travis.yml",
"diff": "@@ -5,7 +5,6 @@ node_js:\nbefore_script:\n- lerna bootstrap\nscript:\n- - yarn run lint\n+ - yarn run check\n- yarn run build\n- - yarn run test\n# after_script: \"cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\"\n"
},
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"clean\": \"lerna run clean\",\n\"build\": \"lerna run build\",\n\"test\": \"lerna run test\",\n- \"lint\": \"lerna run lint\"\n+ \"lint\": \"lerna run lint\",\n+ \"check\": \"yarn run lint && yarn run test\"\n},\n\"repository\": {\n\"type\": \"git\",\n"
},
{
"change_type": "DELETE",
"old_path": "packages/redux-router5/.babelrc",
"new_path": null,
"diff": "-{\n- \"plugins\": [\n- \"transform-object-rest-spread\",\n- \"transform-export-extensions\"\n- ],\n- \"env\": {\n- \"development\": {\n- \"presets\": [ \"es2015\" ]\n- },\n- \"es\": {\n- \"presets\": [ \"es2015-native-modules\" ]\n- }\n- }\n-}\n"
},
{
"change_type": "DELETE",
"old_path": "packages/redux-router5/.editorconfig",
"new_path": null,
"diff": "-# http://editorconfig.org\n-\n-root = true\n-\n-[*]\n-indent_style = space\n-indent_size = 4\n-\n-charset = utf-8\n-end_of_line = lf\n-insert_final_newline = true\n-trim_trailing_whitespace = true\n-\n-[*.md]\n-trim_trailing_whitespace = false\n"
},
{
"change_type": "DELETE",
"old_path": "packages/redux-router5/.eslintrc",
"new_path": null,
"diff": "-{\n- // Parser\n- \"parser\": \"babel-eslint\",\n- // ECMA Features\n- \"ecmaFeatures\": {\n- \"arrowFunctions\": true,\n- \"blockBindings\": true,\n- \"classes\": true,\n- \"defaultParams\": true,\n- \"destructuring\": true,\n- \"modules\": true,\n- \"objectLiteralComputedProperties\": true,\n- \"templateStrings\": true\n- },\n- \"rules\": {\n- // Possible Errors\n- \"no-dupe-args\": 2,\n- \"no-dupe-keys\": 2,\n- \"no-empty\": 2,\n- \"no-func-assign\": 2,\n- \"no-inner-declarations\": 2,\n- \"no-unreachable\": 2,\n- \"no-unexpected-multiline\": 2,\n- // Best practices\n- \"consistent-return\": 0,\n- \"curly\": [2, \"multi-line\"],\n- \"eqeqeq\": 2,\n- \"no-else-return\": 2,\n- \"no-multi-spaces\": 0,\n- // Strict mode\n- \"strict\": 0,\n- // Variables\n- \"no-shadow\": 0,\n- \"no-unused-vars\": 2,\n- \"no-use-before-define\": 0,\n- // Style\n- \"brace-style\": [2, \"1tbs\"],\n- \"comma-spacing\": [2, {\"before\": false, \"after\": true}],\n- \"comma-style\": [2, \"last\"],\n- \"consistent-this\": [2, \"that\"],\n- \"lines-around-comment\": [2, {\"allowBlockStart\": true}],\n- \"key-spacing\": 0,\n- \"new-parens\": 0,\n- \"quotes\": [2, \"single\", \"avoid-escape\"],\n- \"no-underscore-dangle\": 0,\n- \"no-unneeded-ternary\": 2,\n- \"semi\": 2,\n- // ES6\n- \"no-var\": 2,\n- \"no-this-before-super\": 2,\n- \"object-shorthand\": 2,\n- },\n- \"env\": {\n- \"node\": true,\n- \"browser\": true\n- }\n-}\n"
},
{
"change_type": "DELETE",
"old_path": "packages/redux-router5/.travis.yml",
"new_path": null,
"diff": "-language: node_js\n-node_js:\n- - '4.4'\n-before_install:\n- - npm install -g babel-cli\n-script:\n- - npm run lint\n- - npm run build\n- - npm run test\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/redux-router5/dist/umd/redux-router5.js",
"new_path": "packages/redux-router5/dist/umd/redux-router5.js",
"diff": "typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\ntypeof define === 'function' && define.amd ? define('reduxRouter5', ['exports'], factory) :\n(factory((global.reduxRouter5 = global.reduxRouter5 || {})));\n-}(this, function (exports) { 'use strict';\n+}(this, (function (exports) { 'use strict';\nvar NAVIGATE_TO = '@@router5/NAVIGATE';\nvar CANCEL_TRANSITION = '@@router5/CANCEL';\n@@ -25,8 +25,8 @@ var actionTypes = Object.freeze({\n});\nfunction navigateTo(name) {\n- var params = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n- var opts = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];\n+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n+ var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\nreturn {\ntype: NAVIGATE_TO,\n@@ -125,7 +125,7 @@ var actions = Object.freeze({\ndispatch(transitionError(toState, fromState, err));\n}\n};\n- };\n+ }\nreduxPlugin.pluginName = 'REDUX_PLUGIN';\n@@ -143,10 +143,10 @@ var actions = Object.freeze({\nreturn function (action) {\nswitch (action.type) {\ncase NAVIGATE_TO:\n- var _action$payload = action.payload;\n- var name = _action$payload.name;\n- var params = _action$payload.params;\n- var opts = _action$payload.opts;\n+ var _action$payload = action.payload,\n+ name = _action$payload.name,\n+ params = _action$payload.params,\n+ opts = _action$payload.opts;\nrouter.navigate(name, params, opts);\nbreak;\n@@ -171,11 +171,31 @@ var actions = Object.freeze({\n};\n};\n- var typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n+var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\nreturn typeof obj;\n} : function (obj) {\n- return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n+ return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\nvar _extends = Object.assign || function (target) {\nfor (var i = 1; i < arguments.length; i++) {\n@@ -199,7 +219,7 @@ var actions = Object.freeze({\n};\nfunction router5Reducer() {\n- var state = arguments.length <= 0 || arguments[0] === undefined ? initialState : arguments[0];\n+ var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\nvar action = arguments[1];\nswitch (action.type) {\n@@ -299,7 +319,7 @@ var actions = Object.freeze({\ncontinue;\ndefault:\n- if ((typeof _ret === 'undefined' ? 'undefined' : typeof(_ret)) === \"object\") return _ret.v;\n+ if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === \"object\") return _ret.v;\n}\n}\n@@ -329,7 +349,7 @@ var actions = Object.freeze({\n}\nfunction routeNodeSelector(routeNode) {\n- var reducerKey = arguments.length <= 1 || arguments[1] === undefined ? 'router' : arguments[1];\n+ var reducerKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'router';\nvar routerStateSelector = function routerStateSelector(state) {\nreturn state[reducerKey] || state.get && state.get(reducerKey);\n@@ -337,10 +357,9 @@ var actions = Object.freeze({\nvar lastReturnedValue = void 0;\nreturn function (state) {\n- var _routerStateSelector = routerStateSelector(state);\n-\n- var route = _routerStateSelector.route;\n- var previousRoute = _routerStateSelector.previousRoute;\n+ var _routerStateSelector = routerStateSelector(state),\n+ route = _routerStateSelector.route,\n+ previousRoute = _routerStateSelector.previousRoute;\nvar intersection = route ? transitionPath(route, previousRoute).intersection : '';\n@@ -363,4 +382,4 @@ var actions = Object.freeze({\nObject.defineProperty(exports, '__esModule', { value: true });\n-}));\n\\ No newline at end of file\n+})));\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/redux-router5/package.json",
"new_path": "packages/redux-router5/package.json",
"diff": "},\n\"homepage\": \"http://router5.github.com/router5/redux-router5\",\n\"devDependencies\": {\n- \"babel-core\": \"~6.9.1\",\n- \"babel-eslint\": \"~6.0.4\",\n- \"babel-plugin-transform-export-extensions\": \"~6.8.0\",\n- \"babel-plugin-transform-object-rest-spread\": \"~6.8.0\",\n- \"babel-preset-es2015\": \"~6.9.0\",\n- \"babel-preset-es2015-native-modules\": \"^6.9.4\",\n- \"babel-preset-es2015-rollup\": \"~1.1.1\",\n- \"chai\": \"^3.5.0\",\n- \"conventional-changelog\": \"^1.1.0\",\n- \"eslint\": \"^2.11.1\",\n- \"immutable\": \"^3.0.0\",\n- \"mocha\": \"^2.5.3\",\n- \"rimraf\": \"^2.5.2\",\n- \"rollup\": \"^0.26.3\",\n- \"rollup-plugin-babel\": \"^2.4.0\",\n- \"rollup-plugin-npm\": \"^1.4.0\",\n- \"yargs\": \"^4.7.1\"\n+ \"immutable\": \"~3.0.0\"\n},\n\"peerDependencies\": {\n\"router5\": \"^4.0.0\",\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/redux-router5/rollup.config.js",
"new_path": "packages/redux-router5/rollup.config.js",
"diff": "import babel from 'rollup-plugin-babel';\n-import npm from 'rollup-plugin-npm';\n+import nodeResolve from 'rollup-plugin-node-resolve';\nconst babelOptions = {\npresets: [ 'es2015-rollup' ],\n@@ -13,7 +13,7 @@ const babelOptions = {\nexport default {\nentry: 'modules/index.js',\nformat: 'umd',\n- plugins: [ babel(babelOptions), npm({ jsnext: true }) ],\n+ plugins: [ babel(babelOptions), nodeResolve({ jsnext: true }) ],\nmoduleName: 'reduxRouter5',\nmoduleId: 'reduxRouter5',\ndest: 'dist/umd/redux-router5.js'\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/redux-router5/yarn.lock",
"diff": "+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n+# yarn lockfile v1\n+\n+\n+immutable@^3.0.0:\n+ version \"3.8.1\"\n+ resolved \"https://registry.yarnpkg.com/immutable/-/immutable-3.8.1.tgz#200807f11ab0f72710ea485542de088075f68cd2\"\n+\n+router5.transition-path@~4.0.1:\n+ version \"4.0.1\"\n+ resolved \"https://registry.yarnpkg.com/router5.transition-path/-/router5.transition-path-4.0.1.tgz#6d61d6b78e233aeff2e68f3b91b9a83338c2f723\"\n"
}
] | TypeScript | MIT License | router5/router5 | refactor: update redux-router5 package |
580,249 | 12.06.2017 19:18:09 | -3,600 | 291ea9f0b96bf1ff560e4e788a5f2ef1b4ed667c | chore: add router5-helpers package | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5-helpers/.babelrc",
"diff": "+{\n+ \"presets\": [ \"es2015\" ],\n+ \"env\": {\n+ \"umd\": {\n+ \"plugins\": [ \"transform-es2015-modules-umd\" ]\n+ }\n+ }\n+}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5-helpers/.gitignore",
"diff": "+index.js\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5-helpers/.npmignore",
"diff": "+**/.*\n+modules\n+test\n+node_modules\n+npm-debug.log\n+*.md\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5-helpers/README.md",
"diff": "+# helpers\n+\n+Helpers for comparing and checking routes.\n+\n+\n+## API\n+\n+_route can be a route name (string) or state object containing a name property_\n+\n+- __startsWithSegment(route, segment)__\n+- __endsWithSegment(route, segment)__\n+- __includesSegment(route, segment)__\n+\n+__redirect function__\n+\n+This package also contains a redirect function for `onActivate` handlers.\n+\n+- __redirect(fromRouteName, toRouteName, toRouteParams)__, where toRouteParams can an object or a function of the attempted route params.\n+\n+\n+### All functions are available in their curried form (kinda)\n+\n+- __startsWithSegment(route)(segment)__\n+- __endsWithSegment(route)(segment)__\n+- __includesSegment(route)(segment)__\n+- __redirect(fromRouteName)(toRouteName, toRouteParams)__\n+\n+```javascript\n+import * as helpers from 'router5.helpers';\n+\n+startsWithSegment('users', 'users'); // => true\n+startsWithSegment('users.list', 'users'); // => true\n+\n+startsWithSegment('users.list')('users'); // => true\n+```\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5-helpers/dist/umd/router5Helpers.js",
"diff": "+(function (global, factory) {\n+ if (typeof define === \"function\" && define.amd) {\n+ define(['exports'], factory);\n+ } else if (typeof exports !== \"undefined\") {\n+ factory(exports);\n+ } else {\n+ var mod = {\n+ exports: {}\n+ };\n+ factory(mod.exports);\n+ global.router5Helpers = mod.exports;\n+ }\n+})(this, function (exports) {\n+ 'use strict';\n+\n+ Object.defineProperty(exports, \"__esModule\", {\n+ value: true\n+ });\n+ exports.redirect = redirect;\n+ var dotOrEnd = '(\\\\..+$|$)';\n+ var dotOrStart = '(^.+\\\\.|^)';\n+\n+ function getName(route) {\n+ return typeof route === 'string' ? route : route.name || '';\n+ }\n+\n+ function test(route, regex) {\n+ return regex.test(getName(route));\n+ }\n+\n+ function normaliseSegment(name) {\n+ return name.replace('.', '\\\\.');\n+ }\n+\n+ function testRouteWithSegment(before, after) {\n+ return function () {\n+ var route = arguments[0];\n+\n+ function applySegment(segment) {\n+ return test(route, new RegExp(before + normaliseSegment(segment) + after));\n+ };\n+\n+ if (arguments.length === 2) {\n+ return applySegment(arguments[1]);\n+ }\n+\n+ return applySegment;\n+ };\n+ }\n+\n+ function redirect() {\n+ var fromRouteName = arguments[0];\n+\n+ var redirectTo = function redirectTo(routeName, routeParams) {\n+ return function () {\n+ return function (toState, fromState, done) {\n+ if (toState.name === fromRouteName) {\n+ var finalRouteParams = typeof routeParams === 'function' ? routeParams(fromState.params) : routeParams;\n+\n+ var redirectState = finalRouteParams === undefined ? { name: routeName } : { name: routeName, params: finalRouteParams };\n+\n+ done({ redirect: redirectState });\n+ } else {\n+ done(null);\n+ }\n+ };\n+ };\n+ };\n+\n+ if (arguments.length > 1) {\n+ return redirectTo(arguments[1], arguments[2]);\n+ } else if (arguments.length === 1) {\n+ return redirectTo;\n+ } else {\n+ throw new Error('[router5][helpers][redirect] no arguments supplied.');\n+ }\n+ }\n+\n+ var startsWithSegment = exports.startsWithSegment = testRouteWithSegment('^', dotOrEnd);\n+ var endsWithSegment = exports.endsWithSegment = testRouteWithSegment(dotOrStart, '$');\n+ var includesSegment = exports.includesSegment = testRouteWithSegment(dotOrStart, dotOrEnd);\n+});\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5-helpers/modules/router5Helpers.js",
"diff": "+const dotOrEnd = '(\\\\..+$|$)';\n+const dotOrStart = '(^.+\\\\.|^)';\n+\n+function getName(route) {\n+ return typeof route === 'string' ? route : (route.name || '');\n+}\n+\n+function test(route, regex) {\n+ return regex.test(getName(route));\n+}\n+\n+function normaliseSegment(name) {\n+ return name.replace('.', '\\\\.');\n+}\n+\n+function testRouteWithSegment(before, after) {\n+ return function () {\n+ const route = arguments[0];\n+\n+ function applySegment(segment) {\n+ return test(route, new RegExp(before + normaliseSegment(segment) + after));\n+ };\n+\n+ if (arguments.length === 2) {\n+ return applySegment(arguments[1]);\n+ }\n+\n+ return applySegment;\n+ };\n+}\n+\n+export function redirect() {\n+ const fromRouteName = arguments[0];\n+\n+ const redirectTo = (routeName, routeParams) => () => (toState, fromState, done) => {\n+ if (toState.name === fromRouteName) {\n+ const finalRouteParams = typeof routeParams === 'function'\n+ ? routeParams(fromState.params)\n+ : routeParams;\n+\n+ const redirectState = finalRouteParams === undefined\n+ ? { name: routeName }\n+ : { name: routeName, params: finalRouteParams };\n+\n+ done({ redirect: redirectState });\n+ } else {\n+ done(null);\n+ }\n+ };\n+\n+ if (arguments.length > 1) {\n+ return redirectTo(arguments[1], arguments[2])\n+ } else if (arguments.length === 1) {\n+ return redirectTo;\n+ } else {\n+ throw new Error('[router5][helpers][redirect] no arguments supplied.');\n+ }\n+}\n+\n+export const startsWithSegment = testRouteWithSegment('^', dotOrEnd);\n+export const endsWithSegment = testRouteWithSegment(dotOrStart, '$');\n+export const includesSegment = testRouteWithSegment(dotOrStart, dotOrEnd);\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5-helpers/package.json",
"diff": "+{\n+ \"name\": \"router5.helpers\",\n+ \"version\": \"1.2.0\",\n+ \"description\": \"Router5 helpers for comparing and checking routes\",\n+ \"main\": \"index.js\",\n+ \"scripts\": {\n+ \"build:cjs\": \"babel modules/router5Helpers.js -o ./index.js\",\n+ \"build:umd\": \"BABEL_ENV=umd babel modules --out-dir ./dist/umd/\",\n+ \"build\": \"rimraf dist && npm run build:cjs && npm run build:umd\",\n+ \"test\": \"mocha --compilers js:babel-core/register --recursive 'test/main.js'\"\n+ },\n+ \"repository\": {\n+ \"type\": \"git\",\n+ \"url\": \"git+https://github.com/router5/helpers.git\"\n+ },\n+ \"keywords\": [\n+ \"router5\",\n+ \"helpers\"\n+ ],\n+ \"author\": \"Thomas Roch <[email protected]>\",\n+ \"license\": \"MIT\",\n+ \"bugs\": {\n+ \"url\": \"https://github.com/router5/helpers/issues\"\n+ },\n+ \"homepage\": \"https://router5.github.io\",\n+ \"devDependencies\": {\n+ \"babel-plugin-transform-es2015-modules-umd\": \"~6.24.1\"\n+ }\n+}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5-helpers/test/main.js",
"diff": "+import { expect } from 'chai';\n+import * as helpers from '../modules/router5Helpers';\n+\n+describe('router5.helpers', function () {\n+ describe('.startsWithSegment()', function () {\n+ it('should return true if a route starts with a segment', function () {\n+ expect(helpers.startsWithSegment('a.b.c', 'a')).to.be.true;\n+ expect(helpers.startsWithSegment('a.b.c', 'a.b')).to.be.true;\n+ expect(helpers.startsWithSegment({ name: 'a.b.c' }, 'a')).to.be.true;\n+ });\n+\n+ it('should return false if a route does not start with a segment', function () {\n+ expect(helpers.startsWithSegment('a.b.c', 'aa')).to.be.false;\n+ expect(helpers.startsWithSegment('a.b.c', 'a.a')).to.be.false;\n+ expect(helpers.startsWithSegment({ name: 'a.b.c' }, 'aa')).to.be.false;\n+ });\n+ });\n+\n+ describe('.endsWithSegment()', function () {\n+ it('should return true if a route ends with a segment', function () {\n+ expect(helpers.endsWithSegment('a.b.c', 'c')).to.be.true;\n+ expect(helpers.endsWithSegment({ name: 'a.b.c' }, 'c')).to.be.true;\n+ });\n+\n+ it('should return false if a route does not end with a segment', function () {\n+ expect(helpers.endsWithSegment('a.b.c', 'cc')).to.be.false;\n+ expect(helpers.endsWithSegment({ name: 'a.b.c' }, 'cc')).to.be.false;\n+ });\n+ });\n+\n+ describe('.includesSegment()', function () {\n+ it('should return true if a route includes a segment', function () {\n+ expect(helpers.includesSegment('a.b.c', 'a')).to.be.true;\n+ expect(helpers.includesSegment('a.b.c', 'a.b')).to.be.true;\n+ expect(helpers.includesSegment('a.b.c', 'a.b.c')).to.be.true;\n+ expect(helpers.includesSegment('a.b.c', 'b')).to.be.true;\n+ expect(helpers.includesSegment('a.b.c', 'c')).to.be.true;\n+ });\n+\n+ it('should return false if a route does not include a segment', function () {\n+ expect(helpers.includesSegment('a.b.c', 'aa')).to.be.false;\n+ expect(helpers.includesSegment('a.bb.c', 'a.b')).to.be.false;\n+ expect(helpers.includesSegment('a.b.c', 'bb.c')).to.be.false;\n+ expect(helpers.includesSegment('a.b.c', 'a.b.b')).to.be.false;\n+ });\n+ });\n+\n+ describe('.redirect()', function () {\n+ it('should return a \"redirect\" error if node is matched', function () {\n+ helpers.redirect('a', 'b')()({ name: 'a' }, null, function done(err) {\n+ expect(err).to.eql({\n+ redirect: { name: 'b' }\n+ });\n+ });\n+ });\n+\n+ it('should not return a \"redirect\" error if node is not matched', function () {\n+ helpers.redirect('a', 'b')()({ name: 'b' }, null, function done(err) {\n+ expect(err).to.not.exist;\n+ });\n+ });\n+ });\n+});\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5-helpers/yarn.lock",
"diff": "+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n+# yarn lockfile v1\n+\n+\n+ansi-regex@^2.0.0:\n+ version \"2.1.1\"\n+ resolved \"https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df\"\n+\n+ansi-styles@^2.2.1:\n+ version \"2.2.1\"\n+ resolved \"https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe\"\n+\n+babel-code-frame@^6.22.0:\n+ version \"6.22.0\"\n+ resolved \"https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4\"\n+ dependencies:\n+ chalk \"^1.1.0\"\n+ esutils \"^2.0.2\"\n+ js-tokens \"^3.0.0\"\n+\n+babel-messages@^6.23.0:\n+ version \"6.23.0\"\n+ resolved \"https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e\"\n+ dependencies:\n+ babel-runtime \"^6.22.0\"\n+\n+babel-plugin-transform-es2015-modules-amd@^6.24.1:\n+ version \"6.24.1\"\n+ resolved \"https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154\"\n+ dependencies:\n+ babel-plugin-transform-es2015-modules-commonjs \"^6.24.1\"\n+ babel-runtime \"^6.22.0\"\n+ babel-template \"^6.24.1\"\n+\n+babel-plugin-transform-es2015-modules-commonjs@^6.24.1:\n+ version \"6.24.1\"\n+ resolved \"https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.24.1.tgz#d3e310b40ef664a36622200097c6d440298f2bfe\"\n+ dependencies:\n+ babel-plugin-transform-strict-mode \"^6.24.1\"\n+ babel-runtime \"^6.22.0\"\n+ babel-template \"^6.24.1\"\n+ babel-types \"^6.24.1\"\n+\n+babel-plugin-transform-es2015-modules-umd@~6.24.1:\n+ version \"6.24.1\"\n+ resolved \"https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468\"\n+ dependencies:\n+ babel-plugin-transform-es2015-modules-amd \"^6.24.1\"\n+ babel-runtime \"^6.22.0\"\n+ babel-template \"^6.24.1\"\n+\n+babel-plugin-transform-strict-mode@^6.24.1:\n+ version \"6.24.1\"\n+ resolved \"https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758\"\n+ dependencies:\n+ babel-runtime \"^6.22.0\"\n+ babel-types \"^6.24.1\"\n+\n+babel-runtime@^6.22.0:\n+ version \"6.23.0\"\n+ resolved \"https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b\"\n+ dependencies:\n+ core-js \"^2.4.0\"\n+ regenerator-runtime \"^0.10.0\"\n+\n+babel-template@^6.24.1:\n+ version \"6.25.0\"\n+ resolved \"https://registry.yarnpkg.com/babel-template/-/babel-template-6.25.0.tgz#665241166b7c2aa4c619d71e192969552b10c071\"\n+ dependencies:\n+ babel-runtime \"^6.22.0\"\n+ babel-traverse \"^6.25.0\"\n+ babel-types \"^6.25.0\"\n+ babylon \"^6.17.2\"\n+ lodash \"^4.2.0\"\n+\n+babel-traverse@^6.25.0:\n+ version \"6.25.0\"\n+ resolved \"https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.25.0.tgz#2257497e2fcd19b89edc13c4c91381f9512496f1\"\n+ dependencies:\n+ babel-code-frame \"^6.22.0\"\n+ babel-messages \"^6.23.0\"\n+ babel-runtime \"^6.22.0\"\n+ babel-types \"^6.25.0\"\n+ babylon \"^6.17.2\"\n+ debug \"^2.2.0\"\n+ globals \"^9.0.0\"\n+ invariant \"^2.2.0\"\n+ lodash \"^4.2.0\"\n+\n+babel-types@^6.24.1, babel-types@^6.25.0:\n+ version \"6.25.0\"\n+ resolved \"https://registry.yarnpkg.com/babel-types/-/babel-types-6.25.0.tgz#70afb248d5660e5d18f811d91c8303b54134a18e\"\n+ dependencies:\n+ babel-runtime \"^6.22.0\"\n+ esutils \"^2.0.2\"\n+ lodash \"^4.2.0\"\n+ to-fast-properties \"^1.0.1\"\n+\n+babylon@^6.17.2:\n+ version \"6.17.3\"\n+ resolved \"https://registry.yarnpkg.com/babylon/-/babylon-6.17.3.tgz#1327d709950b558f204e5352587fd0290f8d8e48\"\n+\n+chalk@^1.1.0:\n+ version \"1.1.3\"\n+ resolved \"https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98\"\n+ dependencies:\n+ ansi-styles \"^2.2.1\"\n+ escape-string-regexp \"^1.0.2\"\n+ has-ansi \"^2.0.0\"\n+ strip-ansi \"^3.0.0\"\n+ supports-color \"^2.0.0\"\n+\n+core-js@^2.4.0:\n+ version \"2.4.1\"\n+ resolved \"https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e\"\n+\n+debug@^2.2.0:\n+ version \"2.6.8\"\n+ resolved \"https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc\"\n+ dependencies:\n+ ms \"2.0.0\"\n+\n+escape-string-regexp@^1.0.2:\n+ version \"1.0.5\"\n+ resolved \"https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4\"\n+\n+esutils@^2.0.2:\n+ version \"2.0.2\"\n+ resolved \"https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b\"\n+\n+globals@^9.0.0:\n+ version \"9.18.0\"\n+ resolved \"https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a\"\n+\n+has-ansi@^2.0.0:\n+ version \"2.0.0\"\n+ resolved \"https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91\"\n+ dependencies:\n+ ansi-regex \"^2.0.0\"\n+\n+invariant@^2.2.0:\n+ version \"2.2.2\"\n+ resolved \"https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360\"\n+ dependencies:\n+ loose-envify \"^1.0.0\"\n+\n+js-tokens@^3.0.0:\n+ version \"3.0.1\"\n+ resolved \"https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7\"\n+\n+lodash@^4.2.0:\n+ version \"4.17.4\"\n+ resolved \"https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae\"\n+\n+loose-envify@^1.0.0:\n+ version \"1.3.1\"\n+ resolved \"https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848\"\n+ dependencies:\n+ js-tokens \"^3.0.0\"\n+\[email protected]:\n+ version \"2.0.0\"\n+ resolved \"https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8\"\n+\n+regenerator-runtime@^0.10.0:\n+ version \"0.10.5\"\n+ resolved \"https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658\"\n+\n+strip-ansi@^3.0.0:\n+ version \"3.0.1\"\n+ resolved \"https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf\"\n+ dependencies:\n+ ansi-regex \"^2.0.0\"\n+\n+supports-color@^2.0.0:\n+ version \"2.0.0\"\n+ resolved \"https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7\"\n+\n+to-fast-properties@^1.0.1:\n+ version \"1.0.3\"\n+ resolved \"https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47\"\n"
}
] | TypeScript | MIT License | router5/router5 | chore: add router5-helpers package |
580,249 | 12.06.2017 19:22:55 | -3,600 | 34308a7568647c2e08a317540e78e72cade93c8d | chore: add xstream-router5 package | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/xstream-router5/.gitignore",
"diff": "+index.js\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/xstream-router5/.npmignore",
"diff": "+**/.*\n+node_modules\n+npm-debug.log\n+test\n+*.md\n+*.config.js\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/xstream-router5/README.md",
"diff": "+[](https://badge.fury.io/js/xstream-router5)\n+[](https://travis-ci.org/router5/xstream-router5?branch=master)\n+\n+# xstream-router5\n+\n+[xstream](http://staltz.com/xstream/) integration with [router5](http://router5.github.io)\n+\n+```sh\n+npm install --save xstream-router5\n+```\n+\n+### Usage\n+\n+_xstream-router5_ exports a single function `createObservables`:\n+\n+```js\n+import createRouter from 'router5';\n+import createObservables from 'xstream-router5';\n+\n+const router = createRouter([\n+ { name: 'home', path: '/home' },\n+ { name: 'about', path: '/about' }\n+]);\n+\n+const {\n+ route$,\n+ routeNode,\n+ transitionError$,\n+ transitionRoute$\n+} = createObservables(router)\n+\n+router.start();\n+\n+route$.map((route) => { /* ... */ })\n+```\n+\n+### Available observables\n+\n+`createObservables` returns the following observables:\n+- `route$`: an observable of your application route\n+- `transitionRoute$`: an observable of the currently transitioning route\n+- `transitionError$`: an observable of transition errors\n+- `routeNode(nodeName = '')`: a function returning an observable of route updates for the specified node. See [understanding router5](http://router5.github.io/docs/understanding-router5.html).\n+\n+### Related\n+\n+- [rxjs-router5](../rxjs-router5)\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/xstream-router5/package.json",
"diff": "+{\n+ \"name\": \"xstream-router5\",\n+ \"version\": \"1.0.1\",\n+ \"description\": \"xstream plugin for router5\",\n+ \"main\": \"index.js\",\n+ \"scripts\": {\n+ \"build\": \"babel modules --out-dir ./\",\n+ \"lint\": \"eslint modules\",\n+ \"test\": \"mocha --compilers js:babel-core/register test/*.js\"\n+ },\n+ \"repository\": {\n+ \"type\": \"git\",\n+ \"url\": \"https://github.com/router5/xstream-router5.git\"\n+ },\n+ \"keywords\": [\n+ \"router\",\n+ \"xstream\",\n+ \"reactive\",\n+ \"stream\",\n+ \"router5\"\n+ ],\n+ \"author\": \"Thomas Roch <[email protected]>\",\n+ \"license\": \"MIT\",\n+ \"bugs\": {\n+ \"url\": \"https://github.com/router/xstream-router5/issues\"\n+ },\n+ \"homepage\": \"http://router5.github.io\",\n+ \"dependencies\": {\n+ \"router5.transition-path\": \"~4.0.1\",\n+ \"xstream\": \"~6.0.0\"\n+ },\n+ \"devDependencies\": {\n+ \"router5\": \"^4.0.2\"\n+ },\n+ \"peerDependencies\": {\n+ \"router5\": \"^4.0.0\",\n+ \"xstream\": \"^6.0.0\"\n+ }\n+}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/xstream-router5/test/_helpers.js",
"diff": "+import chai from 'chai';\n+import sinonChai from 'sinon-chai';\n+\n+chai.use(sinonChai);\n+\n+export const state1 = { name: 'route1', path: '/route1', meta: { params: {}} };\n+export const state2 = { name: 'route2', path: '/route2', meta: { params: {}} };\n+export const state3 = { name: 'route3', path: '/route3', meta: { params: {}} };\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/xstream-router5/test/main.js",
"diff": "+import { expect } from 'chai';\n+import { Stream } from 'xstream';\n+import createRouter from 'router5';\n+import createObservables from '../modules';\n+\n+describe('xsPlugin', () => {\n+ let observables;\n+\n+ before(() => {\n+ observables = createObservables(createRouter());\n+ });\n+\n+ it('should initialise observables', () => {\n+ expect(observables).to.exist;\n+ });\n+\n+ it('should expose a route$ observable', () => {\n+ expect(observables.route$).to.be.instanceof(Stream);\n+ });\n+\n+ it('should expose a routeNode observable factory', () => {\n+ expect(observables.routeNode('')).to.be.instanceof(Stream);\n+ });\n+\n+ it('should expose a transitionError$ observable', () => {\n+ expect(observables.transitionError$).to.be.instanceof(Stream);\n+ });\n+\n+ it('should expose a transitionRoute$ observable', () => {\n+ expect(observables.transitionRoute$).to.be.instanceof(Stream);\n+ });\n+});\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/xstream-router5/test/route$.js",
"diff": "+import { expect } from 'chai';\n+import { spy } from 'sinon';\n+import { state1, state2, state3 } from './_helpers';\n+import createObservables from '../modules';\n+import createRouter, { constants } from 'router5';\n+\n+describe('route$', () => {\n+ it('should push new values to route$ on transitionSuccess events', () => {\n+ const router = createRouter();\n+ const observables = createObservables(router);\n+ const listener = { next: spy(), error() {}, complete: spy() };\n+\n+ observables.route$.addListener(listener);\n+ expect(listener.next).to.have.been.calledWith(null);\n+\n+ router.invokeEventListeners(constants.TRANSITION_START, state1, null);\n+ router.invokeEventListeners(constants.TRANSITION_SUCCESS, state1, null);\n+\n+ expect(listener.next).to.have.been.calledWith(state1);\n+\n+ router.invokeEventListeners(constants.TRANSITION_START, state2, state1);\n+ router.invokeEventListeners(constants.TRANSITION_SUCCESS, state2, state1);\n+\n+ expect(listener.next).to.have.been.calledWith(state2);\n+\n+ router.invokeEventListeners(constants.TRANSITION_START, state3, state2);\n+ router.invokeEventListeners(constants.TRANSITION_SUCCESS, state3, state2);\n+\n+ expect(listener.next).to.have.been.calledWith(state3);\n+\n+ router.invokeEventListeners(constants.ROUTER_STOP);\n+\n+ expect(listener.complete).to.have.been.called;\n+ });\n+\n+ it('should not push new values to route$ on transitionError events', () => {\n+ const router = createRouter();\n+ const observables = createObservables(router);\n+ const listener = { next: spy(), error() {}, complete() {} };\n+\n+ observables.route$.addListener(listener);\n+ router.invokeEventListeners(constants.TRANSITION_START, state1, null);\n+ router.invokeEventListeners(constants.TRANSITION_ERROR, state1, null);\n+\n+ expect(listener.next).to.have.been.calledOnce;\n+ expect(listener.next).to.have.been.calledWith(null);\n+\n+ router.invokeEventListeners(constants.ROUTER_STOP);\n+ });\n+});\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/xstream-router5/test/routeNode.js",
"diff": "+import { expect } from 'chai';\n+import { spy } from 'sinon';\n+import { state1, state2, state3 } from './_helpers';\n+import createObservables from '../modules';\n+import createRouter, { constants } from 'router5';\n+\n+const nestedA = { name: 'a', path: '/a', meta: { params: {}} };\n+const nestedAB = { name: 'a.b', path: '/a/b', meta: { params: {}} };\n+const nestedAC = { name: 'a.c', path: '/a/c', meta: { params: {}} };\n+\n+describe('routeNode', () => {\n+ it('should see route updates for the root node', () => {\n+ const router = createRouter();\n+ const observables = createObservables(router);\n+ const listener = { next: spy(), error() {}, complete: spy() };\n+\n+ observables.routeNode('').addListener(listener);\n+\n+ router.invokeEventListeners(constants.TRANSITION_START, state1, null);\n+ router.invokeEventListeners(constants.TRANSITION_SUCCESS, state1, null);\n+\n+ expect(listener.next).to.have.been.calledWith(state1);\n+\n+ router.invokeEventListeners(constants.TRANSITION_START, state2, state1);\n+ router.invokeEventListeners(constants.TRANSITION_SUCCESS, state2, state1);\n+\n+\n+ expect(listener.next).to.have.been.calledWith(state2);\n+\n+ router.invokeEventListeners(constants.TRANSITION_START, state3, state2);\n+ router.invokeEventListeners(constants.TRANSITION_SUCCESS, state3, state2);\n+\n+ expect(listener.next).to.have.been.calledWith(state3);\n+\n+ router.invokeEventListeners(constants.ROUTER_STOP);\n+\n+ expect(listener.complete).to.have.been.called;\n+ });\n+\n+ it('should work with nested routes', () => {\n+ const router = createRouter();\n+ const observables = createObservables(router);\n+ const listener = { next: spy(), error() {}, complete() {} };\n+\n+ observables.routeNode('a').addListener(listener);\n+\n+ router.invokeEventListeners(constants.TRANSITION_START, nestedA, null);\n+ router.invokeEventListeners(constants.TRANSITION_SUCCESS, nestedA, null);\n+\n+ router.invokeEventListeners(constants.TRANSITION_START, nestedAB, nestedA);\n+ router.invokeEventListeners(constants.TRANSITION_SUCCESS, nestedAB, nestedA);\n+\n+ expect(listener.next).to.have.been.calledWith(nestedAB);\n+\n+ router.invokeEventListeners(constants.TRANSITION_START, nestedAC, nestedAB);\n+ router.invokeEventListeners(constants.TRANSITION_SUCCESS, nestedAC, nestedAB);\n+\n+ expect(listener.next).to.have.been.calledWith(nestedAC);\n+\n+ router.invokeEventListeners(constants.ROUTER_STOP);\n+ });\n+});\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/xstream-router5/test/transitionError$.js",
"diff": "+import { expect } from 'chai';\n+import { spy } from 'sinon';\n+import { state1, state2 } from './_helpers';\n+import createObservables from '../modules';\n+import createRouter, { constants } from 'router5';\n+\n+const error = 'error';\n+\n+describe('transitionError$', () => {\n+ it('should push new values to transitionError$ on transitionError events', () => {\n+ const router = createRouter();\n+ const observables = createObservables(router);\n+ const listener = { next: spy(), error() {}, complete: spy() };\n+\n+ observables.transitionError$.addListener(listener);\n+\n+ router.invokeEventListeners(constants.TRANSITION_START, state1, null);\n+ router.invokeEventListeners(constants.TRANSITION_ERROR, state1, null, error);\n+\n+ expect(listener.next).to.have.been.calledTwice;\n+ expect(listener.next).to.have.been.calledWith(null);\n+ expect(listener.next).to.have.been.calledWith(error);\n+\n+ router.invokeEventListeners(constants.ROUTER_STOP);\n+\n+ expect(listener.complete).to.have.been.called;\n+ });\n+\n+ it('should become null on a new transition start event', () => {\n+ const router = createRouter();\n+ const observables = createObservables(router);\n+ const listener = { next: spy(), error() {}, complete: spy() };\n+\n+ observables.transitionError$.addListener(listener);\n+\n+ router.invokeEventListeners(constants.TRANSITION_START, state1, null);\n+ router.invokeEventListeners(constants.TRANSITION_ERROR, state1, null, error);\n+ router.invokeEventListeners(constants.TRANSITION_START, state2, null);\n+\n+ expect(listener.next).to.have.been.calledThrice;\n+ expect(listener.next).to.have.been.calledWith(null);\n+ expect(listener.next).to.have.been.calledWith(error);\n+ expect(listener.next).to.have.been.calledWith(null);\n+\n+ router.invokeEventListeners(constants.ROUTER_STOP);\n+\n+ expect(listener.complete).to.have.been.called;\n+ });\n+});\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/xstream-router5/test/transitionRoute$.js",
"diff": "+import { expect } from 'chai';\n+import { spy } from 'sinon';\n+import { state1 } from './_helpers';\n+import createObservables from '../modules';\n+import createRouter, { constants } from 'router5';\n+\n+describe('transitionRoute$', () => {\n+ it('should push new values to transitionRoute$ on transitionStart events', () => {\n+ const router = createRouter();\n+ const observables = createObservables(router);\n+ const listener = { next: spy(), error() {}, complete: spy() };\n+\n+ observables.transitionRoute$.addListener(listener);\n+ router.invokeEventListeners(constants.TRANSITION_START, state1, null);\n+\n+ expect(listener.next).to.have.been.calledTwice;\n+ expect(listener.next).to.have.been.calledWith(null);\n+ expect(listener.next).to.have.been.calledWith(state1);\n+\n+ router.invokeEventListeners(constants.ROUTER_STOP);\n+\n+ expect(listener.complete).to.have.been.called;\n+ });\n+\n+ it('should become null on a transition success', () => {\n+ const router = createRouter();\n+ const observables = createObservables(router);\n+ const listener = { next: spy(), error() {}, complete() {} };\n+\n+ observables.transitionRoute$.addListener(listener);\n+ router.invokeEventListeners(constants.TRANSITION_START, state1, null);\n+ router.invokeEventListeners(constants.TRANSITION_SUCCESS, state1, null);\n+\n+ expect(listener.next).to.have.been.calledThrice;\n+ expect(listener.next).to.have.been.calledWith(null);\n+ expect(listener.next).to.have.been.calledWith(state1);\n+ expect(listener.next).to.have.been.calledWith(null);\n+\n+ router.invokeEventListeners(constants.ROUTER_STOP);\n+ });\n+\n+ it('should become null on a transition error', () => {\n+ const router = createRouter();\n+ const observables = createObservables(router);\n+ const listener = { next: spy(), error() {}, complete() {} };\n+\n+ observables.transitionRoute$.addListener(listener);\n+ router.invokeEventListeners(constants.TRANSITION_START, state1, null);\n+ router.invokeEventListeners(constants.TRANSITION_ERROR, state1, null);\n+\n+ expect(listener.next).to.have.been.calledThrice;\n+ expect(listener.next).to.have.been.calledWith(null);\n+ expect(listener.next).to.have.been.calledWith(state1);\n+ expect(listener.next).to.have.been.calledWith(null);\n+\n+ router.invokeEventListeners(constants.ROUTER_STOP);\n+ });\n+});\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/xstream-router5/yarn.lock",
"diff": "+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n+# yarn lockfile v1\n+\n+\n+router5.transition-path@~4.0.1:\n+ version \"4.0.1\"\n+ resolved \"https://registry.yarnpkg.com/router5.transition-path/-/router5.transition-path-4.0.1.tgz#6d61d6b78e233aeff2e68f3b91b9a83338c2f723\"\n+\n+xstream@~6.0.0:\n+ version \"6.0.0\"\n+ resolved \"https://registry.yarnpkg.com/xstream/-/xstream-6.0.0.tgz#20f903eaaef9c3d837f59a22078bae38f9012a91\"\n"
}
] | TypeScript | MIT License | router5/router5 | chore: add xstream-router5 package |
580,249 | 12.06.2017 19:28:56 | -3,600 | ffb794cc30040cbcbee9a8508f1acd7bb7780212 | chore: add rxjs-router5 package | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/rxjs-router5/.gitignore",
"diff": "+index.js\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/rxjs-router5/.npmignore",
"diff": "+**/.*\n+node_modules\n+npm-debug.log\n+test\n+*.md\n+*.config.js\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/rxjs-router5/README.md",
"diff": "+[](https://badge.fury.io/js/rxjs-router5)\n+[](https://travis-ci.org/router5/rxjs-router5?branch=master)\n+\n+# rxjs-router5\n+\n+[rxjs (RxJS 5+)](http://reactivex.io/rxjs/) integration with [router5](http://router5.github.io)\n+\n+```sh\n+npm install --save rxjs-router5\n+```\n+\n+### Usage\n+\n+_rxjs-router5_ exports a single function `createObservables`:\n+\n+```js\n+import createRouter from 'router5';\n+import createObservables from 'rxjs-router5';\n+\n+const router = createRouter([\n+ { name: 'home', path: '/home' },\n+ { name: 'about', path: '/about' }\n+]);\n+\n+const {\n+ route$,\n+ routeNode,\n+ transitionError$,\n+ transitionRoute$\n+} = createObservables(router)\n+\n+router.start();\n+\n+route$.map((route) => { /* ... */ })\n+```\n+\n+### Available observables\n+\n+`createObservables` returns the following observables:\n+- `route$`: an observable of your application route\n+- `transitionRoute$`: an observable of the currently transitioning route\n+- `transitionError$`: an observable of transition errors\n+- `routeNode(nodeName)`: a function returning an observable of route updates for the specified node. See [understanding router5](http://router5.github.io/docs/understanding-router5.html).\n+\n+### Related\n+\n+- [xstream-router5](../xstream-router5)\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/rxjs-router5/package.json",
"diff": "+{\n+ \"name\": \"rxjs-router5\",\n+ \"version\": \"1.0.1\",\n+ \"description\": \"RxJS 5+ plugin for router5\",\n+ \"main\": \"index.js\",\n+ \"scripts\": {\n+ \"clean\": \"rimraf dist\",\n+ \"build:cjs\": \"babel modules --out-dir ./\",\n+ \"build\": \"rimraf dist && npm run build:cjs\",\n+ \"lint\": \"eslint modules\",\n+ \"test\": \"mocha --compilers js:babel-core/register --recursive test/*.js\"\n+ },\n+ \"repository\": {\n+ \"type\": \"git\",\n+ \"url\": \"https://github.com/router5/rxjs-router5.git\"\n+ },\n+ \"keywords\": [\n+ \"router\",\n+ \"rx\",\n+ \"rxjs\",\n+ \"stream\",\n+ \"reactive\",\n+ \"router5\"\n+ ],\n+ \"author\": \"Thomas Roch <[email protected]>\",\n+ \"license\": \"MIT\",\n+ \"bugs\": {\n+ \"url\": \"https://github.com/router/rxjs-router5/issues\"\n+ },\n+ \"homepage\": \"http://router5.github.io\",\n+ \"dependencies\": {\n+ \"router5.transition-path\": \"~4.0.1\",\n+ \"rxjs\": \"~5.0.0-beta.11\"\n+ },\n+ \"devDependencies\": {\n+ \"router5\": \"^4.0.2\"\n+ },\n+ \"peerDependencies\": {\n+ \"router5\": \"^4.0.0\",\n+ \"rxjs\": \"^5.0.0-beta.11\"\n+ }\n+}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/rxjs-router5/test/_helpers.js",
"diff": "+import chai from 'chai';\n+import sinonChai from 'sinon-chai';\n+\n+chai.use(sinonChai);\n+\n+export const state1 = { name: 'route1', path: '/route1', meta: { params: {}}};\n+export const state2 = { name: 'route2', path: '/route2', meta: { params: {}}};\n+export const state3 = { name: 'route3', path: '/route3', meta: { params: {}}};\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/rxjs-router5/test/main.js",
"diff": "+import { expect } from 'chai';\n+import { Observable } from 'rxjs';\n+import createObservables from '../modules';\n+import createRouter from 'router5';\n+\n+describe('rxPlugin', () => {\n+ let observables;\n+\n+ before(() => {\n+ observables = createObservables(createRouter());\n+ });\n+\n+ it('should initialise observables', () => {\n+ expect(observables).to.exist;\n+ });\n+\n+ it('should expose a route$ observable', () => {\n+ expect(observables.route$).to.be.instanceof(Observable);\n+ });\n+\n+ it('should expose a routeNode observable factory', () => {\n+ expect(observables.routeNode('')).to.be.instanceof(Observable);\n+ });\n+\n+ it('should expose a transitionError$ observable', () => {\n+ expect(observables.transitionError$).to.be.instanceof(Observable);\n+ });\n+\n+ it('should expose a transitionRoute$ observable', () => {\n+ expect(observables.transitionRoute$).to.be.instanceof(Observable);\n+ });\n+});\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/rxjs-router5/test/route$.js",
"diff": "+import { expect } from 'chai';\n+import { spy } from 'sinon';\n+import { state1, state2, state3 } from './_helpers';\n+import createObservables from '../modules';\n+import createRouter, { constants } from 'router5';\n+\n+describe('route$', () => {\n+ it('should push new values to route$ on transitionSuccess events', () => {\n+ const router = createRouter();\n+ const observables = createObservables(router);\n+ const listener = { next: spy(), error() {}, complete: spy() };\n+\n+ observables.route$.subscribe(listener);\n+\n+ expect(listener.next).to.have.been.calledWith(null);\n+\n+ router.invokeEventListeners(constants.TRANSITION_START, state1, null);\n+ router.invokeEventListeners(constants.TRANSITION_SUCCESS, state1, null);\n+\n+ expect(listener.next).to.have.been.calledWith(state1);\n+\n+ router.invokeEventListeners(constants.TRANSITION_START, state2, state1);\n+ router.invokeEventListeners(constants.TRANSITION_SUCCESS, state2, state1);\n+\n+ expect(listener.next).to.have.been.calledWith(state2);\n+\n+ router.invokeEventListeners(constants.TRANSITION_START, state3, state2);\n+ router.invokeEventListeners(constants.TRANSITION_SUCCESS, state3, state2);\n+ expect(listener.next).to.have.been.calledWith(state3);\n+\n+ router.invokeEventListeners(constants.ROUTER_STOP);\n+\n+ expect(listener.complete).to.have.been.called;\n+ });\n+\n+ it('should not push new values to route$ on transitionError events', () => {\n+ const router = createRouter();\n+ const observables = createObservables(router);\n+ const listener = { next: spy(), error() {}, complete() {} };\n+\n+ observables.route$.subscribe(listener);\n+ router.invokeEventListeners(constants.TRANSITION_START, state1, null);\n+ router.invokeEventListeners(constants.TRANSITION_ERROR, state1, null, 'error');\n+\n+ expect(listener.next).to.have.been.calledOnce;\n+ expect(listener.next).to.have.been.calledWith(null);\n+\n+ router.invokeEventListeners(constants.ROUTER_STOP);\n+ });\n+});\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/rxjs-router5/test/routeNode.js",
"diff": "+import { expect } from 'chai';\n+import { spy } from 'sinon';\n+import { state1, state2, state3 } from './_helpers';\n+import createObservables from '../modules';\n+import createRouter, { constants } from 'router5';\n+\n+const nestedA = { name: 'a', path: '/a', meta: { params: {}} };\n+const nestedAB = { name: 'a.b', path: '/a/b', meta: { params: {}} };\n+const nestedAC = { name: 'a.c', path: '/a/c', meta: { params: {}} };\n+\n+describe('routeNode', () => {\n+ it('should see route updates for the root node', () => {\n+ const router = createRouter();\n+ const observables = createObservables(router);\n+ const listener = { next: spy(), error() {}, complete: spy() };\n+\n+ observables.routeNode('').subscribe(listener);\n+\n+ router.invokeEventListeners(constants.TRANSITION_START, state1, null);\n+ router.invokeEventListeners(constants.TRANSITION_SUCCESS, state1, null);\n+\n+ expect(listener.next).to.have.been.calledWith(state1);\n+\n+ router.invokeEventListeners(constants.TRANSITION_START, state2, state1);\n+ router.invokeEventListeners(constants.TRANSITION_SUCCESS, state2, state1);\n+\n+\n+ expect(listener.next).to.have.been.calledWith(state2);\n+\n+ router.invokeEventListeners(constants.TRANSITION_START, state3, state2);\n+ router.invokeEventListeners(constants.TRANSITION_SUCCESS, state3, state2);\n+\n+ expect(listener.next).to.have.been.calledWith(state3);\n+\n+ router.invokeEventListeners(constants.ROUTER_STOP);\n+\n+ expect(listener.complete).to.have.been.called;\n+ });\n+\n+ it('should work with nested routes', () => {\n+ const router = createRouter();\n+ const observables = createObservables(router);\n+ const listener = { next: spy(), error() {}, complete() {} };\n+\n+ observables.routeNode('a').subscribe(listener);\n+\n+ router.invokeEventListeners(constants.TRANSITION_START, nestedA, null);\n+ router.invokeEventListeners(constants.TRANSITION_SUCCESS, nestedA, null);\n+\n+ router.invokeEventListeners(constants.TRANSITION_START, nestedAB, nestedA);\n+ router.invokeEventListeners(constants.TRANSITION_SUCCESS, nestedAB, nestedA);\n+\n+ expect(listener.next).to.have.been.calledWith(nestedAB);\n+\n+ router.invokeEventListeners(constants.TRANSITION_START, nestedAC, nestedAB);\n+ router.invokeEventListeners(constants.TRANSITION_SUCCESS, nestedAC, nestedAB);\n+\n+ expect(listener.next).to.have.been.calledWith(nestedAC);\n+\n+ router.invokeEventListeners(constants.ROUTER_STOP);\n+ });\n+});\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/rxjs-router5/test/transitionError$.js",
"diff": "+import { expect } from 'chai';\n+import { spy } from 'sinon';\n+import { state1, state2 } from './_helpers';\n+import createObservables from '../modules';\n+import createRouter, { constants } from 'router5';\n+\n+const error = 'error';\n+\n+describe('transitionError$', () => {\n+ it('should push new values to transitionError$ on transitionError events', () => {\n+ const router = createRouter();\n+ const observables = createObservables(router);\n+ const listener = { next: spy(), error() {}, complete: spy() };\n+\n+ observables.transitionError$.subscribe(listener);\n+ router.invokeEventListeners(constants.TRANSITION_START, state1, null);\n+ router.invokeEventListeners(constants.TRANSITION_ERROR, state1, null, error);\n+\n+ expect(listener.next).to.have.been.calledTwice;\n+ expect(listener.next).to.have.been.calledWith(null);\n+ expect(listener.next).to.have.been.calledWith(error);\n+\n+ router.invokeEventListeners(constants.ROUTER_STOP);\n+\n+ expect(listener.complete).to.have.been.called;\n+ });\n+\n+ it('should become null on a new transition start event', () => {\n+ const router = createRouter();\n+ const observables = createObservables(router);\n+ const listener = { next: spy(), error() {}, complete() {} };\n+\n+ observables.transitionError$.subscribe(listener);\n+ router.invokeEventListeners(constants.TRANSITION_START, state1, null);\n+ router.invokeEventListeners(constants.TRANSITION_ERROR, state1, null, error);\n+ router.invokeEventListeners(constants.TRANSITION_START, state2, null);\n+\n+ expect(listener.next).to.have.been.calledThrice;\n+ expect(listener.next).to.have.been.calledWith(null);\n+ expect(listener.next).to.have.been.calledWith(error);\n+ expect(listener.next).to.have.been.calledWith(null);\n+\n+ router.invokeEventListeners(constants.ROUTER_STOP);\n+ });\n+});\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/rxjs-router5/test/transitionRoute$.js",
"diff": "+import { expect } from 'chai';\n+import { spy } from 'sinon';\n+import { state1 } from './_helpers';\n+import createObservables from '../modules';\n+import createRouter, { constants } from 'router5';\n+\n+describe('transitionRoute$', () => {\n+ it('should push new values to transitionRoute$ on transitionStart events', () => {\n+ const router = createRouter();\n+ const observables = createObservables(router);\n+ const listener = { next: spy(), error() {}, complete: spy() };\n+\n+ observables.transitionRoute$.subscribe(listener);\n+ router.invokeEventListeners(constants.TRANSITION_START, state1, null);\n+\n+ expect(listener.next).to.have.been.calledTwice;\n+ expect(listener.next).to.have.been.calledWith(null);\n+ expect(listener.next).to.have.been.calledWith(state1);\n+\n+ router.invokeEventListeners(constants.ROUTER_STOP);\n+\n+ expect(listener.complete).to.have.been.called;\n+ });\n+\n+ it('should become null on a transition success', () => {\n+ const router = createRouter();\n+ const observables = createObservables(router);\n+ const listener = { next: spy(), error() {}, complete: spy() };\n+\n+ observables.transitionRoute$.subscribe(listener);\n+ router.invokeEventListeners(constants.TRANSITION_START, state1, null);\n+ router.invokeEventListeners(constants.TRANSITION_SUCCESS, state1, null);\n+\n+ expect(listener.next).to.have.been.calledThrice;\n+ expect(listener.next).to.have.been.calledWith(null);\n+ expect(listener.next).to.have.been.calledWith(state1);\n+ expect(listener.next).to.have.been.calledWith(null);\n+\n+ router.invokeEventListeners(constants.ROUTER_STOP);\n+ });\n+\n+ it('should become null on a transition error', () => {\n+ const router = createRouter();\n+ const observables = createObservables(router);\n+ const listener = { next: spy(), error() {}, complete() {} };\n+\n+ observables.transitionRoute$.subscribe(listener);\n+ router.invokeEventListeners(constants.TRANSITION_START, state1, null);\n+ router.invokeEventListeners(constants.TRANSITION_ERROR, state1, null);\n+\n+ expect(listener.next).to.have.been.calledThrice;\n+ expect(listener.next).to.have.been.calledWith(null);\n+ expect(listener.next).to.have.been.calledWith(state1);\n+ expect(listener.next).to.have.been.calledWith(null);\n+\n+ router.invokeEventListeners(constants.ROUTER_STOP);\n+ });\n+});\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/rxjs-router5/yarn.lock",
"diff": "+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n+# yarn lockfile v1\n+\n+\n+router5.transition-path@~4.0.1:\n+ version \"4.0.1\"\n+ resolved \"https://registry.yarnpkg.com/router5.transition-path/-/router5.transition-path-4.0.1.tgz#6d61d6b78e233aeff2e68f3b91b9a83338c2f723\"\n+\n+rxjs@~5.0.0-beta.11:\n+ version \"5.0.3\"\n+ resolved \"https://registry.yarnpkg.com/rxjs/-/rxjs-5.0.3.tgz#fc8bdf464ebf938812748e4196788f392fef9754\"\n+ dependencies:\n+ symbol-observable \"^1.0.1\"\n+\n+symbol-observable@^1.0.1:\n+ version \"1.0.4\"\n+ resolved \"https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d\"\n"
}
] | TypeScript | MIT License | router5/router5 | chore: add rxjs-router5 package |
580,249 | 12.06.2017 20:04:40 | -3,600 | c12f9513c8e749a27614670a44f4cfca148792a9 | chore: add router5-transition-path package | [
{
"change_type": "MODIFY",
"old_path": ".travis.yml",
"new_path": ".travis.yml",
"diff": "@@ -3,7 +3,7 @@ cache: yarn\nnode_js:\n- '7'\nbefore_script:\n- - lerna bootstrap\n+ - yarn run bootstrap\nscript:\n- yarn run check\n- yarn run build\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5-transition-path/.babelrc",
"diff": "+{\n+ \"presets\": [\n+ \"es2015\"\n+ ],\n+ \"plugins\": [\n+ \"transform-object-rest-spread\",\n+ \"transform-export-extensions\",\n+ \"add-module-exports\"\n+ ]\n+}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5-transition-path/.gitignore",
"diff": "+node_modules/\n+npm-debug.log\n+/index.js\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5-transition-path/.npmignore",
"diff": "+**/.*\n+node_modules\n+npm-debug.log\n+test\n+*.md\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5-transition-path/CHANGELOG.md",
"diff": "+<a name=\"4.0.1\"></a>\n+## [4.0.1](https://github.com/router5/transition-path/compare/v4.0.0...v4.0.1) (2016-09-22)\n+\n+\n+### Bug Fixes\n+\n+* don't ignore modules in npm ([b9316af](https://github.com/router5/transition-path/commit/b9316af))\n+\n+\n+\n+<a name=\"4.0.0\"></a>\n+# [4.0.0](https://github.com/router5/transition-path/compare/v3.0.0...v4.0.0) (2016-09-22)\n+\n+\n+### Features\n+\n+* update to router5 v4 ([36062ad](https://github.com/router5/transition-path/commit/36062ad))\n+\n+\n+\n+<a name=\"3.0.0\"></a>\n+# 3.0.0 (2016-01-18)\n+\n+\n+### Features\n+\n+* feat: export nameToIDs function ([24ea0ca](https://github.com/router5/transition-path/commit/24ea0ca))\n+\n+\n+### BREAKING CHANGES\n+\n+* when using ES5, transitionPath is now available under 'default'\n+\n+\n+<a name=\"2.0.4\"></a>\n+## [2.0.4](https://github.com/router5/transition-path/compare/v2.0.3...v2.0.4) (2016-01-05)\n+\n+\n+\n+\n+<a name=\"2.0.3\"></a>\n+## [2.0.3](https://github.com/router5/transition-path/compare/v2.0.2...v2.0.3) (2016-01-05)\n+\n+\n+### Bug Fixes\n+\n+* missing babel presets and plugins ([476496b](https://github.com/router5/transition-path/commit/476496b)), closes [#1](https://github.com/router5/transition-path/issues/1)\n+\n+\n+\n+<a name=\"2.0.2\"></a>\n+## [2.0.2](https://github.com/router5/transition-path/compare/v2.0.1...v2.0.2) (2016-01-04)\n+\n+\n+\n+\n+<a name=\"2.0.1\"></a>\n+## [2.0.1](https://github.com/router5/transition-path/compare/v2.0.0...v2.0.1) (2015-12-01)\n+\n+\n+### Bug Fixes\n+\n+* issue when fromState is null ([4baf622](https://github.com/router5/transition-path/commit/4baf622))\n+\n+\n+\n+<a name=\"2.0.0\"></a>\n+# [2.0.0](https://github.com/router5/transition-path/compare/v1.0.1...v2.0.0) (2015-12-01)\n+\n+\n+### Features\n+\n+* compare states using state metadata ([b8a47f9](https://github.com/router5/transition-path/commit/b8a47f9))\n+\n+\n+\n+<a name=\"1.0.1\"></a>\n+## [1.0.1](https://github.com/router5/transition-path/compare/v1.0.0...v1.0.1) (2015-10-26)\n+\n+\n+\n+\n+<a name=\"1.0.0\"></a>\n+# 1.0.0 (2015-10-26)\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5-transition-path/README.md",
"diff": "+# transition-path\n+\n+Router5 helper to determine a transition path. Used by [router5](https://github.com/router5/router5), [router5-listeners](https://github.com/router5/router5-listeners) and [redux-router5](https://github.com/router5/redux-router5).\n+\n+### Installation\n+\n+```\n+npm install --save router5.transition-path\n+```\n+\n+### Usage\n+\n+This module exports a `transitionPath` function which can compute the transition path between two router5 states: segments to deactivate, segments to activate and intersection node between the two.\n+\n+It also exports (as named exports) a `nameToIDs` function for transforming a route name to a list of segments.\n+\n+```javascript\n+import transitionPath from 'router5.transition-path';\n+\n+const { toActivate, toDeactivate, intersection } = transitionPath(toState, fromState);\n+```\n+\n+__ES5__\n+\n+```javascript\n+var transitionPath = require('router5.transition-path').default;\n+```\n+\n+See the tests for examples.\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5-transition-path/modules/index.js",
"diff": "+export function nameToIDs(name) {\n+ return name.split('.').reduce(function (ids, name) {\n+ return ids.concat(ids.length ? ids[ids.length - 1] + '.' + name : name);\n+ }, []);\n+}\n+\n+function exists(val) {\n+ return val !== undefined && val !== null;\n+}\n+\n+function hasMetaParams(state) {\n+ return state && state.meta && state.meta.params;\n+}\n+\n+function extractSegmentParams(name, state) {\n+ if (!exists(state.meta.params[name])) return {};\n+\n+ return Object.keys(state.meta.params[name]).reduce((params, p) => {\n+ params[p] = state.params[p];\n+ return params;\n+ }, {});\n+}\n+\n+function transitionPath(toState, fromState) {\n+ const fromStateIds = fromState ? nameToIDs(fromState.name) : [];\n+ const toStateIds = nameToIDs(toState.name);\n+ const maxI = Math.min(fromStateIds.length, toStateIds.length);\n+\n+ function pointOfDifference() {\n+ let i;\n+ for (i = 0; i < maxI; i += 1) {\n+ const left = fromStateIds[i];\n+ const right = toStateIds[i];\n+\n+ if (left !== right) return i;\n+\n+ const leftParams = extractSegmentParams(left, toState);\n+ const rightParams = extractSegmentParams(right, fromState);\n+\n+ if (leftParams.length !== rightParams.length) return i;\n+ if (leftParams.length === 0) continue;\n+\n+ const different = Object.keys(leftParams).some(p => rightParams[p] !== leftParams[p]);\n+ if (different) {\n+ return i;\n+ }\n+ }\n+\n+ return i;\n+ }\n+\n+ let i;\n+ if (!fromState) {\n+ i = 0;\n+ } else if (!hasMetaParams(fromState) && !hasMetaParams(toState)) {\n+ console.warn('[router5.transition-path] Some states are missing metadata, reloading all segments');\n+ i = 0;\n+ } else {\n+ i = pointOfDifference();\n+ }\n+\n+\n+ const toDeactivate = fromStateIds.slice(i).reverse();\n+ const toActivate = toStateIds.slice(i);\n+\n+ const intersection = fromState && i > 0 ? fromStateIds[i - 1] : '';\n+\n+ return {\n+ intersection,\n+ toDeactivate,\n+ toActivate\n+ };\n+}\n+\n+export default transitionPath;\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5-transition-path/package.json",
"diff": "+{\n+ \"name\": \"router5.transition-path\",\n+ \"version\": \"4.0.1\",\n+ \"description\": \"Router5 transition path helper function\",\n+ \"main\": \"index.js\",\n+ \"jsnext:main\": \"modules/index.js\",\n+ \"scripts\": {\n+ \"clean\": \"rimraf dist\",\n+ \"build\": \"npm run clean && babel modules --out-dir ./\",\n+ \"clog\": \"conventional-changelog -p angular -i CHANGELOG.md -w\",\n+ \"test\": \"mocha --compilers js:babel-core/register --recursive 'test/main.js'\"\n+ },\n+ \"repository\": {\n+ \"type\": \"git\",\n+ \"url\": \"git+https://github.com/router5/transition-path.git\"\n+ },\n+ \"keywords\": [\n+ \"router5\",\n+ \"transition\"\n+ ],\n+ \"author\": \"Thomas Roch <[email protected]>\",\n+ \"license\": \"MIT\",\n+ \"bugs\": {\n+ \"url\": \"https://github.com/router5/transition-path/issues\"\n+ },\n+ \"homepage\": \"https://router5.github.io\",\n+ \"peerDependencies\": {\n+ \"router5\": \"^4.0.0\"\n+ },\n+ \"devDependencies\": {\n+ \"babel-plugin-add-module-exports\": \"~0.2.1\"\n+ }\n+}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5-transition-path/test/main.js",
"diff": "+import transitionPath from '../modules';\n+import { expect } from 'chai';\n+\n+describe('router5.transition-path', function () {\n+ it('should return a transition path with from null state', function () {\n+ expect(transitionPath({name: 'a.b.c', params: {}, meta: {}}, null)).to.eql({\n+ intersection: '',\n+ toActivate: ['a', 'a.b', 'a.b.c'],\n+ toDeactivate: []\n+ });\n+ });\n+\n+ it('should return transition path between two states', function () {\n+ const meta = {\n+ params: {\n+ 'a': {},\n+ 'a.b': {},\n+ 'a.b.c': {},\n+ 'a.b.c.d': {}\n+ }\n+ };\n+\n+ expect(transitionPath(\n+ {name: 'a.b.c.d', params: {}, meta},\n+ {name: 'a.b.e.f', params: {}, meta}\n+ )).to.eql({\n+ intersection: 'a.b',\n+ toActivate: ['a.b.c', 'a.b.c.d'],\n+ toDeactivate: ['a.b.e.f', 'a.b.e']\n+ });\n+ });\n+\n+ it('should return transition path two states with same name but different params', function () {\n+ const meta = {\n+ params: {\n+ 'a': {},\n+ 'a.b': {p1: 'url'},\n+ 'a.b.c': {p2: 'url'},\n+ 'a.b.c.d': {p3: 'url'}\n+ }\n+ };\n+\n+ expect(transitionPath(\n+ {name: 'a.b.c.d', params: {p1: 0, p2: 2, p3: 3}, meta},\n+ {name: 'a.b.c.d', params: {p1: 1, p2: 2, p3: 3}, meta}\n+ ).intersection).to.equal('a');\n+\n+ expect(transitionPath(\n+ {name: 'a.b.c.d', params: {p1: 1, p2: 0, p3: 3}, meta},\n+ {name: 'a.b.c.d', params: {p1: 1, p2: 2, p3: 3}, meta}\n+ ).intersection).to.equal('a.b');\n+\n+ expect(transitionPath(\n+ {name: 'a.b.c.d', params: {p1: 1, p2: 2, p3: 0}, meta},\n+ {name: 'a.b.c.d', params: {p1: 1, p2: 2, p3: 3}, meta}\n+ ).intersection).to.equal('a.b.c');\n+ });\n+});\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5-transition-path/yarn.lock",
"diff": "+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n+# yarn lockfile v1\n+\n+\n+babel-plugin-add-module-exports@~0.2.1:\n+ version \"0.2.1\"\n+ resolved \"https://registry.yarnpkg.com/babel-plugin-add-module-exports/-/babel-plugin-add-module-exports-0.2.1.tgz#9ae9a1f4a8dc67f0cdec4f4aeda1e43a5ff65e25\"\n"
}
] | TypeScript | MIT License | router5/router5 | chore: add router5-transition-path package |
580,249 | 12.06.2017 20:41:17 | -3,600 | efe0ad6ea0ff526a16884c6e1a2e26eee83abc29 | chore: update travis file | [
{
"change_type": "MODIFY",
"old_path": ".travis.yml",
"new_path": ".travis.yml",
"diff": "@@ -3,8 +3,8 @@ cache: yarn\nnode_js:\n- '7'\nbefore_script:\n- - yarn run bootstrap\n+ - npm run bootstrap\nscript:\n- - yarn run check\n- - yarn run build\n+ - npm run build\n+ - npm run check\n# after_script: \"cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\"\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/redux-router5/yarn.lock",
"new_path": "packages/redux-router5/yarn.lock",
"diff": "# yarn lockfile v1\n-immutable@~3.0.0:\n- version \"3.0.3\"\n- resolved \"https://registry.yarnpkg.com/immutable/-/immutable-3.0.3.tgz#5ffb1a7aa69f2f229f352ebc3bb7299ebe6d673f\"\n+immutable@^3.0.0:\n+ version \"3.8.1\"\n+ resolved \"https://registry.yarnpkg.com/immutable/-/immutable-3.8.1.tgz#200807f11ab0f72710ea485542de088075f68cd2\"\nrouter5.transition-path@~4.0.1:\nversion \"4.0.1\"\n"
}
] | TypeScript | MIT License | router5/router5 | chore: update travis file |
580,249 | 12.06.2017 21:09:08 | -3,600 | 6022e87f1dad361180722d460d634bc2c4a43ea7 | refactor: add missing files | [
{
"change_type": "MODIFY",
"old_path": "packages/deku-router5/dist/umd/deku-router5.js",
"new_path": "packages/deku-router5/dist/umd/deku-router5.js",
"diff": "typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\ntypeof define === 'function' && define.amd ? define('dekuRouter5', ['exports'], factory) :\n(factory((global.dekuRouter5 = global.dekuRouter5 || {})));\n-}(this, function (exports) { 'use strict';\n+}(this, (function (exports) { 'use strict';\nvar Link = {\npropTypes: {\n}\n};\n- var asyncGenerator = function () {\n- function AwaitValue(value) {\n- this.value = value;\n- }\n-\n- function AsyncGenerator(gen) {\n- var front, back;\n-\n- function send(key, arg) {\n- return new Promise(function (resolve, reject) {\n- var request = {\n- key: key,\n- arg: arg,\n- resolve: resolve,\n- reject: reject,\n- next: null\n- };\n-\n- if (back) {\n- back = back.next = request;\n- } else {\n- front = back = request;\n- resume(key, arg);\n- }\n- });\n- }\n-\n- function resume(key, arg) {\n- try {\n- var result = gen[key](arg);\n- var value = result.value;\n-\n- if (value instanceof AwaitValue) {\n- Promise.resolve(value.value).then(function (arg) {\n- resume(\"next\", arg);\n- }, function (arg) {\n- resume(\"throw\", arg);\n- });\n- } else {\n- settle(result.done ? \"return\" : \"normal\", result.value);\n- }\n- } catch (err) {\n- settle(\"throw\", err);\n- }\n- }\n-\n- function settle(type, value) {\n- switch (type) {\n- case \"return\":\n- front.resolve({\n- value: value,\n- done: true\n- });\n- break;\n-\n- case \"throw\":\n- front.reject(value);\n- break;\n-\n- default:\n- front.resolve({\n- value: value,\n- done: false\n- });\n- break;\n- }\n-\n- front = front.next;\n-\n- if (front) {\n- resume(front.key, front.arg);\n- } else {\n- back = null;\n- }\n- }\n-\n- this._invoke = send;\n-\n- if (typeof gen.return !== \"function\") {\n- this.return = undefined;\n- }\n- }\n-\n- if (typeof Symbol === \"function\" && Symbol.asyncIterator) {\n- AsyncGenerator.prototype[Symbol.asyncIterator] = function () {\n- return this;\n- };\n- }\n-\n- AsyncGenerator.prototype.next = function (arg) {\n- return this._invoke(\"next\", arg);\n- };\n-\n- AsyncGenerator.prototype.throw = function (arg) {\n- return this._invoke(\"throw\", arg);\n- };\n-\n- AsyncGenerator.prototype.return = function (arg) {\n- return this._invoke(\"return\", arg);\n- };\n-\n- return {\n- wrap: function (fn) {\n- return function () {\n- return new AsyncGenerator(fn.apply(this, arguments));\n- };\n- },\n- await: function (value) {\n- return new AwaitValue(value);\n- }\n- };\n- }();\n-\nvar _extends = Object.assign || function (target) {\nfor (var i = 1; i < arguments.length; i++) {\nvar source = arguments[i];\nObject.defineProperty(exports, '__esModule', { value: true });\n-}));\n\\ No newline at end of file\n+})));\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/rxjs-router5/.gitignore",
"new_path": "packages/rxjs-router5/.gitignore",
"diff": "-index.js\n+/index.js\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/rxjs-router5/modules/index.js",
"diff": "+import Rx from 'rxjs';\n+import transitionPath from 'router5.transition-path';\n+\n+const PLUGIN_NAME = 'RXJS_PLUGIN';\n+const TRANSITION_SUCCESS = '@@router5/TRANSITION_SUCCESS';\n+const TRANSITION_ERROR = '@@router5/TRANSITION_ERROR';\n+const TRANSITION_START = '@@router5/TRANSITION_START';\n+const TRANSITION_CANCEL = '@@router5/TRANSITION_CANCEL';\n+\n+export {\n+ TRANSITION_SUCCESS,\n+ TRANSITION_ERROR,\n+ TRANSITION_START,\n+ TRANSITION_CANCEL\n+};\n+\n+function rxjsPluginFactory(observer) {\n+ function rxjsPlugin() {\n+ const dispatch = (type, isError) => (toState, fromState, error) => {\n+ if (observer) {\n+ const routerEvt = { type, toState, fromState };\n+\n+ observer.next(isError ? { ...routerEvt, error } : routerEvt);\n+ }\n+ };\n+\n+ return {\n+ onStop: () => observer.complete(),\n+ onTransitionSuccess: dispatch(TRANSITION_SUCCESS),\n+ onTransitionError: dispatch(TRANSITION_ERROR, true),\n+ onTransitionStart: dispatch(TRANSITION_START),\n+ onTransitionCancel: dispatch(TRANSITION_CANCEL),\n+ };\n+ };\n+\n+ rxjsPlugin.pluginName = PLUGIN_NAME;\n+\n+ return rxjsPlugin;\n+}\n+\n+function createObservables(router) {\n+ // Events observable\n+ const transitionEvents$ = Rx.Observable.create((observer) => {\n+ router.usePlugin(rxjsPluginFactory(observer));\n+ }).publish().refCount();\n+\n+ // Transition Route\n+ const transitionRoute$ = transitionEvents$\n+ .map(_ => _.type === TRANSITION_START ? _.toState : null)\n+ .startWith(null);\n+\n+ // Error\n+ const transitionError$ = transitionEvents$\n+ .filter(_ => _.type )\n+ .map(_ => _.type === TRANSITION_ERROR ? _.error : null)\n+ .startWith(null)\n+ .distinctUntilChanged();\n+\n+ // Route with intersection\n+ const routeState$ = transitionEvents$\n+ .filter(_ => _.type === TRANSITION_SUCCESS && _.toState !== null)\n+ .map(({ toState, fromState }) => {\n+ const { intersection } = transitionPath(toState, fromState);\n+ return { intersection, route: toState };\n+ })\n+ .startWith({ intersection: '', route: router.getState() });\n+\n+ // Create a route observable\n+ const route$ = routeState$.map(({ route }) => route);\n+\n+ // Create a route node observable\n+ const routeNode = (node) =>\n+ routeState$\n+ .filter(({ intersection }) => intersection === node)\n+ .map(({ route }) => route)\n+ .startWith(router.getState());\n+\n+ // Return observables\n+ return {\n+ route$,\n+ routeNode,\n+ transitionError$,\n+ transitionRoute$\n+ };\n+}\n+\n+export default createObservables;\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/xstream-router5/.gitignore",
"new_path": "packages/xstream-router5/.gitignore",
"diff": "-index.js\n+/index.js\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/xstream-router5/modules/index.js",
"diff": "+import xs from 'xstream';\n+import dropRepeats from 'xstream/extra/dropRepeats';\n+import transitionPath from 'router5.transition-path';\n+\n+const TRANSITION_SUCCESS = '@@router5/TRANSITION_SUCCESS';\n+const TRANSITION_ERROR = '@@router5/TRANSITION_ERROR';\n+const TRANSITION_START = '@@router5/TRANSITION_START';\n+const TRANSITION_CANCEL = '@@router5/TRANSITION_CANCEL';\n+\n+export {\n+ TRANSITION_SUCCESS,\n+ TRANSITION_ERROR,\n+ TRANSITION_START,\n+ TRANSITION_CANCEL\n+};\n+\n+function xsPluginFactory(listener) {\n+ return function xsPlugin() {\n+ const dispatch = (type, isError) => (toState, fromState, error) => {\n+ if (listener) {\n+ const routerEvt = { type, toState, fromState };\n+\n+ listener.next(isError ? { ...routerEvt, error } : routerEvt);\n+ }\n+ };\n+\n+ return {\n+ onStop: () => listener.complete(),\n+ onTransitionSuccess: dispatch(TRANSITION_SUCCESS),\n+ onTransitionError: dispatch(TRANSITION_ERROR, true),\n+ onTransitionStart: dispatch(TRANSITION_START),\n+ onTransitionCancel: dispatch(TRANSITION_CANCEL),\n+ };\n+ };\n+}\n+\n+function createObservables(router) {\n+ // Events observable\n+ const transitionEvents$ = xs.create({\n+ start(listener) {\n+ router.usePlugin(xsPluginFactory(listener));\n+ },\n+ stop() {}\n+ });\n+\n+ // Transition Route\n+ const transitionRoute$ = transitionEvents$\n+ .map(_ => _.type === TRANSITION_START ? _.toState : null)\n+ .startWith(null);\n+\n+ // Error\n+ const transitionError$ = transitionEvents$\n+ .filter(_ => _.type )\n+ .map(_ => _.type === TRANSITION_ERROR ? _.error : null)\n+ .startWith(null)\n+ .compose(dropRepeats());\n+\n+ // Route with intersection\n+ const routeState$ = transitionEvents$\n+ .filter(_ => _.type === TRANSITION_SUCCESS && _.toState !== null)\n+ .map(({ toState, fromState }) => {\n+ const { intersection } = transitionPath(toState, fromState);\n+ return { intersection, route: toState };\n+ })\n+ .startWith({ intersection: '', route: router.getState() });\n+\n+ // Create a route observable\n+ const route$ = routeState$.map(({ route }) => route);\n+\n+ // Create a route node observable\n+ const routeNode = (node) =>\n+ routeState$\n+ .filter(({ intersection }) => intersection === node)\n+ .map(({ route }) => route)\n+ .startWith(router.getState());\n+\n+ // Return observables\n+ return {\n+ route$,\n+ routeNode,\n+ transitionError$,\n+ transitionRoute$\n+ };\n+}\n+\n+export default createObservables;\n"
}
] | TypeScript | MIT License | router5/router5 | refactor: add missing files |
580,238 | 13.06.2017 11:39:09 | -10,800 | 7a9e725b37fdf6dbc584a23a27ac31ed3ddf10f6 | feat: add mergeState option in browser plugin to merge router state into current history state | [
{
"change_type": "MODIFY",
"old_path": "modules/plugins/browser/index.js",
"new_path": "modules/plugins/browser/index.js",
"diff": "@@ -6,7 +6,8 @@ const defaultOptions = {\nforceDeactivate: true,\nuseHash: false,\nhashPrefix: '',\n- base: false\n+ base: false,\n+ mergeState: false\n};\nconst source = 'popstate';\n@@ -40,8 +41,9 @@ function browserPluginFactory(opts = {}, browser = safeBrowser) {\nfunction updateBrowserState(state, url, replace) {\n- if (replace) browser.replaceState(state, '', url);\n- else browser.pushState(state, '', url);\n+ const finalState = options.mergeState === true ? { ...browser.getState(), ...state } : state;\n+ if (replace) browser.replaceState(finalState, '', url);\n+ else browser.pushState(finalState, '', url);\n}\nfunction onPopState(evt) {\n"
}
] | TypeScript | MIT License | router5/router5 | feat: add mergeState option in browser plugin to merge router state into current history state @iotch |
580,238 | 13.06.2017 12:06:51 | -10,800 | 27c8258cfa1df431e696ba607846c4f94f60a16e | feat: add preserveHash option to browser plugin to preserve initial URL hash | [
{
"change_type": "MODIFY",
"old_path": "modules/plugins/browser/browser.js",
"new_path": "modules/plugins/browser/browser.js",
"diff": "@@ -33,12 +33,14 @@ const getLocation = (opts) => {\nconst getState = () => window.history.state;\n+const getHash = () => window.location.hash;\n+\n/**\n* Export browser object\n*/\nlet browser = {};\nif (isBrowser) {\n- browser = {getBase, pushState, replaceState, addPopstateListener, removePopstateListener, getLocation, getState};\n+ browser = {getBase, pushState, replaceState, addPopstateListener, removePopstateListener, getLocation, getState, getHash};\n} else {\n// istanbul ignore next\nbrowser = {\n@@ -48,7 +50,8 @@ if (isBrowser) {\naddPopstateListener: noop,\nremovePopstateListener: noop,\ngetLocation: identity(''),\n- getState: identity(null)\n+ getState: identity(null),\n+ getHash: identity('')\n};\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "modules/plugins/browser/index.js",
"new_path": "modules/plugins/browser/index.js",
"diff": "@@ -7,7 +7,8 @@ const defaultOptions = {\nuseHash: false,\nhashPrefix: '',\nbase: false,\n- mergeState: false\n+ mergeState: false,\n+ preserveHash: false\n};\nconst source = 'popstate';\n@@ -104,7 +105,11 @@ function browserPluginFactory(opts = {}, browser = safeBrowser) {\nconst historyState = browser.getState();\nconst replace = opts.replace || fromState && router.areStatesEqual(toState, fromState, false) ||\nopts.reload && historyState && router.areStatesEqual(toState, historyState, false);\n- updateBrowserState(toState, router.buildUrl(toState.name, toState.params), replace);\n+ let url = router.buildUrl(toState.name, toState.params);\n+ if(fromState === null && options.preserveHash === true) {\n+ url += browser.getHash();\n+ }\n+ updateBrowserState(toState, url, replace);\n}\nreturn { onStart, onStop, onTransitionSuccess, onPopState };\n"
}
] | TypeScript | MIT License | router5/router5 | feat: add preserveHash option to browser plugin to preserve initial URL hash @iotch |
580,249 | 13.06.2017 11:21:51 | -3,600 | 95d2b29cbeea8622bd9ecfc46acbe472849a6161 | chore: v4.7.0 | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "+<a name=\"4.7.0\"></a>\n+# [4.7.0](https://github.com/router5/router5/compare/v4.6.0...v4.7.0) (2017-06-13)\n+\n+\n+### Features\n+\n+* add mergeState option in browser plugin to merge router state into current history state [@iotch](https://github.com/iotch) ([7a9e725](https://github.com/router5/router5/commit/7a9e725))\n+* add preserveHash option to browser plugin to preserve initial URL hash [@iotch](https://github.com/iotch) ([27c8258](https://github.com/router5/router5/commit/27c8258))\n+\n+\n+\n<a name=\"4.6.0\"></a>\n# [4.6.0](https://github.com/router5/router5/compare/v4.5.2...v4.6.0) (2017-06-06)\n"
},
{
"change_type": "MODIFY",
"old_path": "dist/es/plugins/browser/browser.js",
"new_path": "dist/es/plugins/browser/browser.js",
"diff": "@@ -47,12 +47,16 @@ var getState = function getState() {\nreturn window.history.state;\n};\n+var getHash = function getHash() {\n+ return window.location.hash;\n+};\n+\n/**\n* Export browser object\n*/\nvar browser = {};\nif (isBrowser) {\n- browser = { getBase: getBase, pushState: pushState, replaceState: replaceState, addPopstateListener: addPopstateListener, removePopstateListener: removePopstateListener, getLocation: getLocation, getState: getState };\n+ browser = { getBase: getBase, pushState: pushState, replaceState: replaceState, addPopstateListener: addPopstateListener, removePopstateListener: removePopstateListener, getLocation: getLocation, getState: getState, getHash: getHash };\n} else {\n// istanbul ignore next\nbrowser = {\n@@ -62,7 +66,8 @@ if (isBrowser) {\naddPopstateListener: noop,\nremovePopstateListener: noop,\ngetLocation: identity(''),\n- getState: identity(null)\n+ getState: identity(null),\n+ getHash: identity('')\n};\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "dist/es/plugins/browser/index.js",
"new_path": "dist/es/plugins/browser/index.js",
"diff": "@@ -8,7 +8,9 @@ var defaultOptions = {\nforceDeactivate: true,\nuseHash: false,\nhashPrefix: '',\n- base: false\n+ base: false,\n+ mergeState: false,\n+ preserveHash: false\n};\nvar source = 'popstate';\n@@ -50,7 +52,8 @@ function browserPluginFactory() {\n};\nfunction updateBrowserState(state, url, replace) {\n- if (replace) browser.replaceState(state, '', url);else browser.pushState(state, '', url);\n+ var finalState = options.mergeState === true ? _extends({}, browser.getState(), state) : state;\n+ if (replace) browser.replaceState(finalState, '', url);else browser.pushState(finalState, '', url);\n}\nfunction onPopState(evt) {\n@@ -115,7 +118,11 @@ function browserPluginFactory() {\nfunction onTransitionSuccess(toState, fromState, opts) {\nvar historyState = browser.getState();\nvar replace = opts.replace || fromState && router.areStatesEqual(toState, fromState, false) || opts.reload && historyState && router.areStatesEqual(toState, historyState, false);\n- updateBrowserState(toState, router.buildUrl(toState.name, toState.params), replace);\n+ var url = router.buildUrl(toState.name, toState.params);\n+ if (fromState === null && options.preserveHash === true) {\n+ url += browser.getHash();\n+ }\n+ updateBrowserState(toState, url, replace);\n}\nreturn { onStart: onStart, onStop: onStop, onTransitionSuccess: onTransitionSuccess, onPopState: onPopState };\n"
},
{
"change_type": "MODIFY",
"old_path": "dist/umd/router5BrowserPlugin.js",
"new_path": "dist/umd/router5BrowserPlugin.js",
"diff": "@@ -75,12 +75,16 @@ var getState = function getState() {\nreturn window.history.state;\n};\n+var getHash = function getHash() {\n+ return window.location.hash;\n+};\n+\n/**\n* Export browser object\n*/\nvar browser = {};\nif (isBrowser) {\n- browser = { getBase: getBase, pushState: pushState, replaceState: replaceState, addPopstateListener: addPopstateListener, removePopstateListener: removePopstateListener, getLocation: getLocation, getState: getState };\n+ browser = { getBase: getBase, pushState: pushState, replaceState: replaceState, addPopstateListener: addPopstateListener, removePopstateListener: removePopstateListener, getLocation: getLocation, getState: getState, getHash: getHash };\n} else {\n// istanbul ignore next\nbrowser = {\n@@ -90,7 +94,8 @@ if (isBrowser) {\naddPopstateListener: noop,\nremovePopstateListener: noop,\ngetLocation: identity(''),\n- getState: identity(null)\n+ getState: identity(null),\n+ getHash: identity('')\n};\n}\n@@ -147,7 +152,9 @@ var defaultOptions = {\nforceDeactivate: true,\nuseHash: false,\nhashPrefix: '',\n- base: false\n+ base: false,\n+ mergeState: false,\n+ preserveHash: false\n};\nvar source = 'popstate';\n@@ -189,7 +196,8 @@ function browserPluginFactory() {\n};\nfunction updateBrowserState(state, url, replace) {\n- if (replace) browser.replaceState(state, '', url);else browser.pushState(state, '', url);\n+ var finalState = options.mergeState === true ? _extends({}, browser.getState(), state) : state;\n+ if (replace) browser.replaceState(finalState, '', url);else browser.pushState(finalState, '', url);\n}\nfunction onPopState(evt) {\n@@ -254,7 +262,11 @@ function browserPluginFactory() {\nfunction onTransitionSuccess(toState, fromState, opts) {\nvar historyState = browser.getState();\nvar replace = opts.replace || fromState && router.areStatesEqual(toState, fromState, false) || opts.reload && historyState && router.areStatesEqual(toState, historyState, false);\n- updateBrowserState(toState, router.buildUrl(toState.name, toState.params), replace);\n+ var url = router.buildUrl(toState.name, toState.params);\n+ if (fromState === null && options.preserveHash === true) {\n+ url += browser.getHash();\n+ }\n+ updateBrowserState(toState, url, replace);\n}\nreturn { onStart: onStart, onStop: onStop, onTransitionSuccess: onTransitionSuccess, onPopState: onPopState };\n"
},
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "{\n\"name\": \"router5\",\n- \"version\": \"4.6.0\",\n+ \"version\": \"4.7.0\",\n\"description\": \"A simple, powerful, view-agnostic, modular and extensible router\",\n\"main\": \"index.js\",\n\"jsnext:main\": \"dist/es/index.js\",\n"
}
] | TypeScript | MIT License | router5/router5 | chore: v4.7.0 |
580,238 | 13.06.2017 18:42:47 | -10,800 | 17bae62e93b58afbd7230e8a2953e54c3af49451 | fix: fix error codes object name in TypesSript definitions | [
{
"change_type": "MODIFY",
"old_path": "index.d.ts",
"new_path": "index.d.ts",
"diff": "@@ -111,7 +111,7 @@ declare module \"router5\" {\n}\n- export var errCodes: ErrorCodes;\n+ export var errorCodes: ErrorCodes;\nexport var constants: Constants;\nexport var transitionPath: (toState: any, fromState: any) => any;\nexport var loggerPlugin: PluginFactory;\n"
}
] | TypeScript | MIT License | router5/router5 | fix: fix error codes object name in TypesSript definitions @iotch |
580,238 | 13.06.2017 18:43:53 | -10,800 | eb755199bc9596ca97990b684cd99a5a53ebc580 | refactor: update browser plugin options TypeScript definitions | [
{
"change_type": "MODIFY",
"old_path": "index.d.ts",
"new_path": "index.d.ts",
"diff": "@@ -127,6 +127,8 @@ declare module \"router5/plugins/browser\" {\nuseHash?: boolean;\nhashPrefix?: string;\nbase?: string;\n+ mergeState?: boolean;\n+ preserveHash?: boolean;\n}\nvar browserPlugin: (options: BrowserPluginOptions) => PluginFactory;\n"
}
] | TypeScript | MIT License | router5/router5 | refactor: update browser plugin options TypeScript definitions @iotch |
580,249 | 13.06.2017 16:44:27 | -3,600 | 975da2e6dd6105499938540b5e72e0e63a8f6341 | fix: only add to browser history state base router state attributes | [
{
"change_type": "MODIFY",
"old_path": "modules/plugins/browser/index.js",
"new_path": "modules/plugins/browser/index.js",
"diff": "@@ -42,7 +42,13 @@ function browserPluginFactory(opts = {}, browser = safeBrowser) {\nfunction updateBrowserState(state, url, replace) {\n- const finalState = options.mergeState === true ? { ...browser.getState(), ...state } : state;\n+ const trimmedState = state ? {\n+ meta: state.meta,\n+ name: state.name,\n+ params: state.params,\n+ path: state.path\n+ } : state;\n+ const finalState = options.mergeState === true ? { ...browser.getState(), ...trimmedState } : trimmedState;\nif (replace) browser.replaceState(finalState, '', url);\nelse browser.pushState(finalState, '', url);\n}\n"
}
] | TypeScript | MIT License | router5/router5 | fix: only add to browser history state base router state attributes |
580,249 | 13.06.2017 19:12:17 | -3,600 | 473c658dee6471e67b3d6a0ce4dde105f3ece53d | refactor: remove bower config
BREAKING CHANGE: router5 won't be released with bower beyond version 4 | [
{
"change_type": "MODIFY",
"old_path": ".npmignore",
"new_path": ".npmignore",
"diff": "@@ -6,4 +6,3 @@ tests\nnode_modules\n*.md\n*.config.js\n-bower.json\n"
},
{
"change_type": "DELETE",
"old_path": "packages/router5/bower.json",
"new_path": null,
"diff": "-{\n- \"name\": \"router5\",\n- \"version\": \"4.5.3\",\n- \"homepage\": \"http://router5.github.io\",\n- \"authors\": [\n- \"Thomas Roch <[email protected]>\"\n- ],\n- \"description\": \"A framework agnostic HTML5 router\",\n- \"main\": \"dist/umd/router5.min.js\",\n- \"moduleType\": [\n- \"amd\",\n- \"umd\",\n- \"es6\",\n- \"globals\",\n- \"node\"\n- ],\n- \"keywords\": [\n- \"router\",\n- \"routing\",\n- \"html5\",\n- \"functional\"\n- ],\n- \"license\": \"MIT\",\n- \"ignore\": [\n- \"**/.*\",\n- \"modules\",\n- \"coverage\",\n- \"scripts\",\n- \"tests\",\n- \"node_modules\",\n- \"npm-debug.log\",\n- \"*.md\",\n- \"*.config.js\",\n- \"package.json\"\n- ]\n-}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5/scripts/release.js",
"new_path": "packages/router5/scripts/release.js",
"diff": "@@ -10,7 +10,6 @@ var versionType = argv.major ? 'major' : (argv.minor ? 'minor' : 'patch');\nrun('npm install');\nrun('npm prune');\nvar VERSION = run('npm --no-git-tag-version version ' + versionType, false);\n-setBowerVersion(VERSION);\nrun('npm run lint');\nrun('npm run build');\n@@ -32,9 +31,3 @@ function run(cmd, log) {\nif (log && res) console.log(res);\nreturn res;\n}\n-\n-function setBowerVersion(version) {\n- var bowerConfig = require('../bower.json');\n- bowerConfig.version = version;\n- fs.writeFileSync(path.join(__dirname, '..', 'bower.json'), JSON.stringify(bowerConfig, null, ' ') + '\\n');\n-}\n"
}
] | TypeScript | MIT License | router5/router5 | refactor: remove bower config
BREAKING CHANGE: router5 won't be released with bower beyond version 4 |
580,249 | 13.06.2017 23:27:57 | -3,600 | 2cf60662d99016a6d86de311f8c78d0ca07e4b38 | fix: displaying link as a button | [
{
"change_type": "MODIFY",
"old_path": "packages/deku-router5/modules/Link.js",
"new_path": "packages/deku-router5/modules/Link.js",
"diff": "@@ -45,11 +45,11 @@ const Link = {\nconst onClick = props.onClick || clickHandler;\nif (button) {\n- return element(\n- 'button',\n- { type: 'button', class: className, onClick },\n- children\n- );\n+ return {\n+ type: 'button',\n+ children,\n+ attributes: { type: 'button', class: className, onClick }\n+ };\n}\nreturn {\n"
}
] | TypeScript | MIT License | router5/router5 | fix: displaying link as a button |
580,249 | 13.06.2017 23:31:48 | -3,600 | 0aa18aa72e76529b245259643c7d7142d47296b6 | chore: update eslint options | [
{
"change_type": "MODIFY",
"old_path": ".eslintrc",
"new_path": ".eslintrc",
"diff": "{\n+ \"extends\": \"eslint:recommended\",\n// Parser\n\"parser\": \"babel-eslint\",\n// ECMA Features\n\"no-unexpected-multiline\": 2,\n// Best practices\n\"consistent-return\": 0,\n- \"curly\": [2, \"multi-line\"],\n\"eqeqeq\": 2,\n\"no-else-return\": 2,\n\"no-multi-spaces\": 0,\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/redux-router5/modules/lib/router5Middleware.js",
"new_path": "packages/redux-router5/modules/lib/router5Middleware.js",
"diff": "@@ -9,8 +9,11 @@ const router5ReduxMiddleware = router => store => {\nreturn next => action => {\nswitch (action.type) {\ncase actionTypes.NAVIGATE_TO:\n- const { name, params, opts } = action.payload;\n- router.navigate(name, params, opts);\n+ router.navigate(\n+ action.payload.name,\n+ action.payload.params,\n+ action.payload.opts\n+ );\nbreak;\ncase actionTypes.CANCEL_TRANSITION:\n"
}
] | TypeScript | MIT License | router5/router5 | chore: update eslint options |
580,249 | 14.06.2017 10:25:59 | -3,600 | 43b1a164b93d70bdaa987159d12ae3788c281303 | chore: rename package router5.helpers to router5-helpers
BREAKING CHANGE: router5.helpers package has been renamed to router5-helpers | [
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"scripts\": {\n\"bootstrap\": \"lerna bootstrap\",\n\"clean\": \"git clean -fXd -e '!node_modules'\",\n- \"reset\": \"lerna clean && rimraf packages/*/yarn.lock && npm run bootstrap\",\n+ \"clean:deps\": \"lerna clean && rimraf packages/*/yarn.lock\",\n+ \"reset\": \"npm run clean && npm run clean:deps && npm run bootstrap\",\n\"build\": \"node scripts/build && npm run build:umd\",\n\"build:umd\": \"rollup -c rollup.config.js\",\n\"test\": \"mocha --compilers js:babel-core/register --require test-helper.js --recursive 'packages/*/test/**/*.js'\",\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/examples/apps/cycle/components/Main.js",
"new_path": "packages/examples/apps/cycle/components/Main.js",
"diff": "import Rx from 'rx';\nimport { h, div, a, makeDOMDriver } from '@cycle/dom';\n-import { startsWithSegment } from 'router5.helpers';\n+import { startsWithSegment } from 'router5-helpers';\nimport Inbox from './Inbox';\nimport Compose from './Compose';\nfunction Main(sources) {\nconst routerSource = sources.router;\n- const routeComponent$ = routerSource\n- .routeNode$('')\n- .map(route => {\n+ const routeComponent$ = routerSource.routeNode$('').map(route => {\nconst startsWith = startsWithSegment(route);\nif (startsWith('inbox')) {\n@@ -26,11 +24,11 @@ function Main(sources) {\n});\nreturn {\n- DOM: routeComponent$\n- .flatMapLatest(component => component.DOM),\n- router: routeComponent$\n- .flatMapLatest(component => component.router || Rx.Observable.empty())\n- };\n+ DOM: routeComponent$.flatMapLatest(component => component.DOM),\n+ router: routeComponent$.flatMapLatest(\n+ component => component.router || Rx.Observable.empty()\n+ )\n};\n+}\nexport default Main;\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/examples/package.json",
"new_path": "packages/examples/package.json",
"diff": "\"babel-loader\": \"~7.0.0\",\n\"randomcolor\": \"~0.5.3\",\n\"redux-logger\": \"~3.0.6\",\n- \"router5.helpers\": \"~1.2.0\",\n+ \"router5-helpers\": \"~1.2.0\",\n\"router5-transition-path\": \"~4.0.1\",\n\"rx\": \"~4.1.0\",\n\"webpack\": \"~2.6.1\",\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/redux-router5/README.md",
"new_path": "packages/redux-router5/README.md",
"diff": "@@ -148,14 +148,14 @@ when it needs to.\nThen it is just a matter of returning the right component depending on the current route. Your virtual tree will react to route changes, all of that\nby simply __leveraging the power of connect and reselect__!\n-[router5.helpers](https://github.com/router5/helpers) provides\n+[router5-helpers](https://github.com/router5/helpers) provides\na set of functions to help making those decisions (useful if you have nested routes).\n```javascript\nimport { connect } from 'react-redux';\nimport { routeNodeSelector } from 'redux-router5';\nimport { Home, About, Contact, Admin, NotFound } from './components';\n-import { startsWithSegment } from 'router5.helpers';\n+import { startsWithSegment } from 'router5-helpers';\nfunction Root({ route }) {\nconst { params, name } = route;\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5-helpers/README.md",
"new_path": "packages/router5-helpers/README.md",
"diff": "@@ -26,7 +26,7 @@ This package also contains a redirect function for `onActivate` handlers.\n- __redirect(fromRouteName)(toRouteName, toRouteParams)__\n```javascript\n-import * as helpers from 'router5.helpers';\n+import * as helpers from 'router5-helpers';\nstartsWithSegment('users', 'users'); // => true\nstartsWithSegment('users.list', 'users'); // => true\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5-helpers/package.json",
"new_path": "packages/router5-helpers/package.json",
"diff": "{\n- \"name\": \"router5.helpers\",\n+ \"name\": \"router5-helpers\",\n\"version\": \"1.2.0\",\n\"description\": \"Router5 helpers for comparing and checking routes\",\n\"main\": \"dist/commonjs/index.js\",\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5-helpers/test/main.js",
"new_path": "packages/router5-helpers/test/main.js",
"diff": "import { expect } from 'chai';\nimport * as helpers from '../modules';\n-describe('router5.helpers', function() {\n+describe('router5-helpers', function() {\ndescribe('.startsWithSegment()', function() {\nit('should return true if a route starts with a segment', function() {\nexpect(helpers.startsWithSegment('a.b.c', 'a')).to.be.true;\n"
}
] | TypeScript | MIT License | router5/router5 | chore: rename package router5.helpers to router5-helpers
BREAKING CHANGE: router5.helpers package has been renamed to router5-helpers |
580,270 | 15.06.2017 15:58:36 | -7,200 | 323771cbbfa1efc53d732436ea2260d2539bf391 | docs: Update README.md
Get Started url was a broken link. Updated it to the correct url. | [
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "@@ -13,7 +13,7 @@ In its simplest form, router5 processes routing __instructions__ and outputs __s\n_router5_ is library and framework agnostic, works universally, and makes no asumption on your implementation. It favours __convention over configuration__, by giving you the means to observe route changes\nand to react to them. Afterall, why treat route changes any different than data changes?\n-To get started, look at __[Understanding router5](http://router5.github.io/docs/understanding-router5.html)__, __[Get started](http://router5.github.io/docs/get-started.html)__, or watch my talk [\"Past and future of client-side routing\" @ ReactiveConf 2016](https://www.youtube.com/watch?v=hblXdstrAg0).\n+To get started, look at __[Understanding router5](http://router5.github.io/docs/understanding-router5.html)__, __[Get started](http://router5.github.io/docs/why-router5.html)__, or watch my talk [\"Past and future of client-side routing\" @ ReactiveConf 2016](https://www.youtube.com/watch?v=hblXdstrAg0).\n```js\nimport createRouter from 'router5';\n"
}
] | TypeScript | MIT License | router5/router5 | docs: Update README.md
Get Started url was a broken link. Updated it to the correct url. |
580,249 | 16.06.2017 12:26:22 | -3,600 | 60332694c7f06892e6e3af31a961d752b7d4c359 | chore: create new changelog file and point old files to it | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "CHANGELOG.md",
"diff": "+**For previous versions (4 and below), see:**\n+\n+- [packages/router5/CHANGELOG.md](packages/router5/CHANGELOG.md)\n+- [packages/react-router5/CHANGELOG.md](packages/react-router5/CHANGELOG.md)\n+- [packages/redux-router5/CHANGELOG.md](packages/redux-router5/CHANGELOG.md)\n+- [packages/deku-router5/CHANGELOG.md](packages/deku-router5/CHANGELOG.md)\n+- [packages/router5-transition-path/CHANGELOG.md](packages/router5-transition-path/CHANGELOG.md)\n"
},
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"lint\": \"eslint packages/*/modules\",\n\"check\": \"yarn run lint && yarn run test\",\n\"format\": \"prettier\",\n- \"precommit\": \"lint-staged\"\n+ \"precommit\": \"lint-staged\",\n+ \"changelog\": \"conventional-changelog -p angular -i CHANGELOG.md -w\"\n},\n\"lint-staged\": {\n\"packages/**/*.js\": [\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/deku-router5/CHANGELOG.md",
"new_path": "packages/deku-router5/CHANGELOG.md",
"diff": "+From version 5 and above, [changelog is here]('../../CHANGELOG.md')\n+\n+\n+\n<a name=\"4.0.0\"></a>\n# [4.0.0](https://github.com/router5/deku-router5/compare/v3.0.0...v4.0.0) (2016-09-05)\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/deku-router5/package.json",
"new_path": "packages/deku-router5/package.json",
"diff": "\"version\": \"4.0.0\",\n\"description\": \"router5 helpers for Deku\",\n\"main\": \"dist/commonjs/index.js\",\n- \"scripts\": {\n- \"clog\": \"conventional-changelog -p angular -i CHANGELOG.md -w\"\n- },\n\"repository\": {\n\"type\": \"git\",\n\"url\": \"https://github.com/router5/deku-router5.git\"\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/react-router5/CHANGELOG.md",
"new_path": "packages/react-router5/CHANGELOG.md",
"diff": "+From version 5 and above, [changelog is here]('../../CHANGELOG.md')\n+\n+\n+\n<a name=\"4.3.0\"></a>\n# [4.3.0](https://github.com/router5/react-router5/compare/v4.2.1...v4.3.0) (2017-06-11)\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/react-router5/package.json",
"new_path": "packages/react-router5/package.json",
"diff": "\"description\": \"router5 helpers for React\",\n\"main\": \"dist/commonjs/index.js\",\n\"jsnext:main\": \"dist/es/index.js\",\n- \"scripts\": {\n- \"clog\": \"conventional-changelog -p angular -i CHANGELOG.md -s\"\n- },\n\"repository\": {\n\"type\": \"git\",\n\"url\": \"https://github.com/router5/react-router5.git\"\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/redux-router5/CHANGELOG.md",
"new_path": "packages/redux-router5/CHANGELOG.md",
"diff": "+From version 5 and above, [changelog is here]('../../CHANGELOG.md')\n+\n+\n+\n<a name=\"4.2.2\"></a>\n## [4.2.2](https://github.com/router5/redux-router5/compare/v4.2.1...v4.2.2) (2016-11-19)\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/redux-router5/package.json",
"new_path": "packages/redux-router5/package.json",
"diff": "\"main\": \"index.js\",\n\"module\": \"dist/es/index.js\",\n\"jnext:main\": \"dist/es/index.js\",\n- \"scripts\": {\n- \"clog\": \"conventional-changelog -i CHANGELOG.md -p angular -w\"\n- },\n- \"repository\": {\n- \"type\": \"git\",\n- \"url\": \"https://github.com/router5/redux-router5.git\"\n- },\n\"keywords\": [\n\"router\",\n\"redux\",\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5-transition-path/CHANGELOG.md",
"new_path": "packages/router5-transition-path/CHANGELOG.md",
"diff": "+From version 5 and above, [changelog is here]('../../CHANGELOG.md')\n+\n+\n+\n<a name=\"4.0.1\"></a>\n## [4.0.1](https://github.com/router5/transition-path/compare/v4.0.0...v4.0.1) (2016-09-22)\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5-transition-path/package.json",
"new_path": "packages/router5-transition-path/package.json",
"diff": "\"description\": \"Router5 transition path helper function\",\n\"main\": \"dist/commonjs/index.js\",\n\"jsnext:main\": \"dist/es/index.js\",\n- \"scripts\": {\n- \"clog\": \"conventional-changelog -p angular -i CHANGELOG.md -w\"\n- },\n\"repository\": {\n\"type\": \"git\",\n\"url\": \"git+https://github.com/router5/transition-path.git\"\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5/CHANGELOG.md",
"new_path": "packages/router5/CHANGELOG.md",
"diff": "+From version 5 and above, [changelog is here]('../../CHANGELOG.md')\n+\n+\n+\n<a name=\"4.7.1\"></a>\n## [4.7.1](https://github.com/router5/router5/compare/v4.6.0...v4.7.1) (2017-06-13)\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5/package.json",
"new_path": "packages/router5/package.json",
"diff": "\"jsnext:main\": \"dist/es/index.js\",\n\"scripts\": {\n\"test:cover\": \"babel-node node_modules/.bin/isparta cover node_modules/.bin/_mocha -- --recursive --require ./test/_helpers.js 'test/**/*.js'\",\n- \"clog\": \"conventional-changelog -p angular -i CHANGELOG.md -s\"\n},\n\"repository\": {\n\"type\": \"git\",\n"
},
{
"change_type": "MODIFY",
"old_path": "yarn.lock",
"new_path": "yarn.lock",
"diff": "@@ -1500,7 +1500,7 @@ error-ex@^1.2.0:\ndependencies:\nis-arrayish \"^0.2.1\"\n-es-abstract@^1.6.1:\n+es-abstract@^1.4.3, es-abstract@^1.6.1:\nversion \"1.7.0\"\nresolved \"https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.7.0.tgz#dfade774e01bfcd97f96180298c449c8623fb94c\"\ndependencies:\n@@ -2691,6 +2691,18 @@ [email protected]:\nversion \"0.0.10\"\nresolved \"https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3\"\n+lerna-changelog@~0.5.0:\n+ version \"0.5.0\"\n+ resolved \"https://registry.yarnpkg.com/lerna-changelog/-/lerna-changelog-0.5.0.tgz#1617a8193a1309451ffa1e686b425faf0424b3f8\"\n+ dependencies:\n+ chalk \"^1.1.3\"\n+ mkdirp \"^0.5.1\"\n+ node-fetch \"^1.7.0\"\n+ p-map \"^1.1.1\"\n+ progress \"^1.1.8\"\n+ string.prototype.padend \"^3.0.0\"\n+ yargs \"^6.6.0\"\n+\nlerna@~2.0.0-rc.5:\nversion \"2.0.0-rc.5\"\nresolved \"https://registry.yarnpkg.com/lerna/-/lerna-2.0.0-rc.5.tgz#b59d168caaac6e3443078c1bce194208c9aa3090\"\n@@ -3139,7 +3151,7 @@ natural-compare@^1.4.0:\nversion \"1.4.0\"\nresolved \"https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7\"\n-node-fetch@^1.0.1:\n+node-fetch@^1.0.1, node-fetch@^1.7.0:\nversion \"1.7.1\"\nresolved \"https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.1.tgz#899cb3d0a3c92f952c47f1b876f4c8aeabd400d5\"\ndependencies:\n@@ -4139,6 +4151,14 @@ string-width@^2.0.0:\nis-fullwidth-code-point \"^2.0.0\"\nstrip-ansi \"^3.0.0\"\n+string.prototype.padend@^3.0.0:\n+ version \"3.0.0\"\n+ resolved \"https://registry.yarnpkg.com/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz#f3aaef7c1719f170c5eab1c32bf780d96e21f2f0\"\n+ dependencies:\n+ define-properties \"^1.1.2\"\n+ es-abstract \"^1.4.3\"\n+ function-bind \"^1.0.2\"\n+\nstring_decoder@~1.0.0:\nversion \"1.0.2\"\nresolved \"https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.2.tgz#b29e1f4e1125fa97a10382b8a533737b7491e179\"\n@@ -4567,6 +4587,12 @@ yallist@^2.1.2:\nversion \"2.1.2\"\nresolved \"https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52\"\n+yargs-parser@^4.2.0:\n+ version \"4.2.1\"\n+ resolved \"https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.2.1.tgz#29cceac0dc4f03c6c87b4a9f217dd18c9f74871c\"\n+ dependencies:\n+ camelcase \"^3.0.0\"\n+\nyargs-parser@^5.0.0:\nversion \"5.0.0\"\nresolved \"https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a\"\n@@ -4579,6 +4605,24 @@ yargs-parser@^7.0.0:\ndependencies:\ncamelcase \"^4.1.0\"\n+yargs@^6.6.0:\n+ version \"6.6.0\"\n+ resolved \"https://registry.yarnpkg.com/yargs/-/yargs-6.6.0.tgz#782ec21ef403345f830a808ca3d513af56065208\"\n+ dependencies:\n+ camelcase \"^3.0.0\"\n+ cliui \"^3.2.0\"\n+ decamelize \"^1.1.1\"\n+ get-caller-file \"^1.0.1\"\n+ os-locale \"^1.4.0\"\n+ read-pkg-up \"^1.0.1\"\n+ require-directory \"^2.1.1\"\n+ require-main-filename \"^1.0.1\"\n+ set-blocking \"^2.0.0\"\n+ string-width \"^1.0.2\"\n+ which-module \"^1.0.0\"\n+ y18n \"^3.2.1\"\n+ yargs-parser \"^4.2.0\"\n+\nyargs@^8.0.1:\nversion \"8.0.2\"\nresolved \"https://registry.yarnpkg.com/yargs/-/yargs-8.0.2.tgz#6299a9055b1cefc969ff7e79c1d918dceb22c360\"\n"
}
] | TypeScript | MIT License | router5/router5 | chore: create new changelog file and point old files to it |
580,249 | 23.06.2017 10:56:36 | -3,600 | 0d0bf75cd01d7bc608a0587d190dfe973f0cda2e | fix: pass not found state to middleware functions on start
BREAKING CHAGE: when using option, custom middleware functions will now be passed not found states. | [
{
"change_type": "MODIFY",
"old_path": "packages/router5/modules/core/router-lifecycle.js",
"new_path": "packages/router5/modules/core/router-lifecycle.js",
"diff": "@@ -85,10 +85,9 @@ export default function withRouterLifecycle(router) {\n{ replace: true, reload: true },\ndone\n);\n- // If matched start path\n- if (startState) {\n+ const transitionToState = state => {\nrouter.transitionToState(\n- startState,\n+ state,\nrouter.getState(),\n{},\n(err, state) => {\n@@ -98,11 +97,16 @@ export default function withRouterLifecycle(router) {\nelse cb(err, null, false);\n}\n);\n+ };\n+\n+ // If matched start path\n+ if (startState) {\n+ transitionToState(startState);\n} else if (options.defaultRoute) {\n// If default, navigate to default\nnavigateToDefault();\n} else if (options.allowNotFound) {\n- cb(null, router.makeNotFoundState(startPath));\n+ transitionToState(router.makeNotFoundState(startPath));\n} else {\n// No start match, no default => do nothing\ncb({ code: errorCodes.ROUTE_NOT_FOUND, path: startPath }, null);\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5/modules/transition/index.js",
"new_path": "packages/router5/modules/transition/index.js",
"diff": "import transitionPath, { nameToIDs } from 'router5-transition-path';\nimport resolve from './resolve';\n-import { errorCodes } from '../constants';\n+import constants, { errorCodes } from '../constants';\nexport default transition;\n@@ -42,8 +42,25 @@ function transition(router, toState, fromState, opts, callback) {\n...(err instanceof Object ? err : { error: err })\n});\n- const { toDeactivate, toActivate } = transitionPath(toState, fromState);\nconst asyncBase = { isCancelled, toState, fromState };\n+ let pipeline;\n+\n+ const middleware = !middlewareFunctions.length\n+ ? []\n+ : (toState, fromState, cb) =>\n+ resolve(middlewareFunctions, { ...asyncBase }, (err, state) =>\n+ cb(\n+ err\n+ ? makeError({ code: errorCodes.TRANSITION_ERR }, err)\n+ : null,\n+ state || toState\n+ )\n+ );\n+\n+ if (toState.name === constants.UNKNOWN_ROUTE) {\n+ pipeline = middleware;\n+ } else {\n+ const { toDeactivate, toActivate } = transitionPath(toState, fromState);\nconst canDeactivate = (toState, fromState, cb) => {\nlet canDeactivateFunctionMap = toDeactivate\n@@ -62,7 +79,10 @@ function transition(router, toState, fromState, opts, callback) {\nerr =>\ncb(\nerr\n- ? makeError({ code: errorCodes.CANNOT_DEACTIVATE }, err)\n+ ? makeError(\n+ { code: errorCodes.CANNOT_DEACTIVATE },\n+ err\n+ )\n: null\n)\n);\n@@ -85,27 +105,19 @@ function transition(router, toState, fromState, opts, callback) {\nerr =>\ncb(\nerr\n- ? makeError({ code: errorCodes.CANNOT_ACTIVATE }, err)\n+ ? makeError(\n+ { code: errorCodes.CANNOT_ACTIVATE },\n+ err\n+ )\n: null\n)\n);\n};\n- const middleware = !middlewareFunctions.length\n- ? []\n- : (toState, fromState, cb) =>\n- resolve(middlewareFunctions, { ...asyncBase }, (err, state) =>\n- cb(\n- err\n- ? makeError({ code: errorCodes.TRANSITION_ERR }, err)\n- : null,\n- state || toState\n- )\n- );\n-\n- let pipeline = (fromState && !opts.forceDeactivate ? [canDeactivate] : [])\n+ pipeline = (fromState && !opts.forceDeactivate ? [canDeactivate] : [])\n.concat(canActivate)\n.concat(middleware);\n+ }\nresolve(pipeline, asyncBase, done);\n"
}
] | TypeScript | MIT License | router5/router5 | fix: pass not found state to middleware functions on start
BREAKING CHAGE: when using option, custom middleware functions will now be passed not found states. |
580,249 | 23.06.2017 11:36:38 | -3,600 | 9f019c9cb46914561c3c2d3af3126a12e4163077 | refactor: change some default options
BREAKING CHANGE: router option is now false by default | [
{
"change_type": "MODIFY",
"old_path": "packages/router5/modules/create-router.js",
"new_path": "packages/router5/modules/create-router.js",
"diff": "@@ -12,7 +12,7 @@ const defaultOptions = {\ntrailingSlash: 0,\nuseTrailingSlash: undefined,\nautoCleanUp: true,\n- strictQueryParams: true,\n+ strictQueryParams: false,\nallowNotFound: false,\nstrongMatching: true\n};\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5/modules/plugins/browser/index.js",
"new_path": "packages/router5/modules/plugins/browser/index.js",
"diff": "@@ -8,7 +8,7 @@ const defaultOptions = {\nhashPrefix: '',\nbase: false,\nmergeState: false,\n- preserveHash: false\n+ preserveHash: true\n};\nconst source = 'popstate';\n"
}
] | TypeScript | MIT License | router5/router5 | refactor: change some default options
BREAKING CHANGE: router option is now false by default |
580,249 | 24.06.2017 11:52:14 | -3,600 | d85f7c4c80a7b6cc02b4902f4e588631320bffa9 | refactor: call deactivate functions on not found state transition | [
{
"change_type": "MODIFY",
"old_path": "packages/router5/modules/transition/index.js",
"new_path": "packages/router5/modules/transition/index.js",
"diff": "@@ -42,27 +42,13 @@ function transition(router, toState, fromState, opts, callback) {\n...(err instanceof Object ? err : { error: err })\n});\n+ const isUnknownRoute = toState.name === constants.UNKNOWN_ROUTE;\nconst asyncBase = { isCancelled, toState, fromState };\n- let pipeline;\n-\n- const middleware = !middlewareFunctions.length\n- ? []\n- : (toState, fromState, cb) =>\n- resolve(middlewareFunctions, { ...asyncBase }, (err, state) =>\n- cb(\n- err\n- ? makeError({ code: errorCodes.TRANSITION_ERR }, err)\n- : null,\n- state || toState\n- )\n- );\n-\n- if (toState.name === constants.UNKNOWN_ROUTE) {\n- pipeline = middleware;\n- } else {\nconst { toDeactivate, toActivate } = transitionPath(toState, fromState);\n- const canDeactivate = (toState, fromState, cb) => {\n+ const canDeactivate = !fromState || opts.forceDeactivate\n+ ? []\n+ : (toState, fromState, cb) => {\nlet canDeactivateFunctionMap = toDeactivate\n.filter(name => canDeactivateFunctions[name])\n.reduce(\n@@ -88,7 +74,9 @@ function transition(router, toState, fromState, opts, callback) {\n);\n};\n- const canActivate = (toState, fromState, cb) => {\n+ const canActivate = isUnknownRoute\n+ ? []\n+ : (toState, fromState, cb) => {\nconst canActivateFunctionMap = toActivate\n.filter(name => canActivateFunctions[name])\n.reduce(\n@@ -114,10 +102,22 @@ function transition(router, toState, fromState, opts, callback) {\n);\n};\n- pipeline = (fromState && !opts.forceDeactivate ? [canDeactivate] : [])\n+ const middleware = !middlewareFunctions.length\n+ ? []\n+ : (toState, fromState, cb) =>\n+ resolve(middlewareFunctions, { ...asyncBase }, (err, state) =>\n+ cb(\n+ err\n+ ? makeError({ code: errorCodes.TRANSITION_ERR }, err)\n+ : null,\n+ state || toState\n+ )\n+ );\n+\n+ const pipeline = []\n+ .concat(canDeactivate)\n.concat(canActivate)\n.concat(middleware);\n- }\nresolve(pipeline, asyncBase, done);\n"
}
] | TypeScript | MIT License | router5/router5 | refactor: call deactivate functions on not found state transition |
580,249 | 25.06.2017 10:07:01 | -3,600 | e8bb4df38938944821fa4f5ad238a383e3d4edf8 | fix: only preserve hash when is false | [
{
"change_type": "MODIFY",
"old_path": "packages/router5/modules/plugins/browser/index.js",
"new_path": "packages/router5/modules/plugins/browser/index.js",
"diff": "@@ -154,7 +154,11 @@ function browserPluginFactory(opts = {}, browser = safeBrowser) {\nhistoryState &&\nrouter.areStatesEqual(toState, historyState, false));\nlet url = router.buildUrl(toState.name, toState.params);\n- if (fromState === null && options.preserveHash === true) {\n+ if (\n+ fromState === null &&\n+ options.useHash === false &&\n+ options.preserveHash === true\n+ ) {\nurl += browser.getHash();\n}\nupdateBrowserState(toState, url, replace);\n"
}
] | TypeScript | MIT License | router5/router5 | fix: only preserve hash when is false |
580,249 | 26.06.2017 11:52:19 | -3,600 | 48a721684cbc47e995f5c9e09029b4df12b0731a | feat: add route forwarding | [
{
"change_type": "MODIFY",
"old_path": "packages/router5/index.d.ts",
"new_path": "packages/router5/index.d.ts",
"diff": "@@ -85,6 +85,7 @@ declare module \"router5\" {\n// navigation\ncancel(): Router;\n+ forward(fromRouteName: string, toRouteName: string): Router;\nnavigate(routeName: string, routeParams?: object, options?: NavigationOptions, done?: Function): Function;\nnavigateToDefault(options?: NavigationOptions, done?: Function): Function;\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5/modules/core/navigation.js",
"new_path": "packages/router5/modules/core/navigation.js",
"diff": "@@ -5,11 +5,13 @@ const noop = function() {};\nexport default function withNavigation(router) {\nlet cancelCurrentTransition;\n+ const forwardMap = {};\nrouter.navigate = navigate;\nrouter.navigateToDefault = navigateToDefault;\nrouter.transitionToState = transitionToState;\nrouter.cancel = cancel;\n+ router.forward = forward;\n/**\n* Cancel the current transition if there is one\n@@ -24,6 +26,18 @@ export default function withNavigation(router) {\nreturn router;\n}\n+ /**\n+ * Forward a route to another route, when calling navigate.\n+ * Route parameters for the two routes should match to avoid issues.\n+ * @param {String} fromRoute The route name\n+ * @param {String} toRoute The route params\n+ */\n+ function forward(fromRoute, toRoute) {\n+ forwardMap[fromRoute] = toRoute;\n+\n+ return router;\n+ }\n+\n/**\n* Navigate to a route\n* @param {String} routeName The route name\n@@ -33,7 +47,7 @@ export default function withNavigation(router) {\n* @return {Function} A cancel function\n*/\nfunction navigate(...args) {\n- const name = args[0];\n+ const name = forwardMap[args[0]] || args[0];\nconst lastArg = args[args.length - 1];\nconst done = typeof lastArg === 'function' ? lastArg : noop;\nconst params = typeof args[1] === 'object' ? args[1] : {};\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5/modules/create-router.js",
"new_path": "packages/router5/modules/create-router.js",
"diff": "@@ -98,15 +98,17 @@ function createRouter(routes, opts = {}, deps = {}) {\nconst rootNode = routes instanceof RouteNode\n? routes\n- : new RouteNode('', '', routes, addCanActivate);\n+ : new RouteNode('', '', routes, onRouteAdded);\nrouter.rootNode = rootNode;\nreturn router;\n- function addCanActivate(route) {\n+ function onRouteAdded(route) {\nif (route.canActivate)\nrouter.canActivate(route.name, route.canActivate);\n+\n+ if (route.forwardTo) router.forward(route.name, route.forwardTo);\n}\n/**\n@@ -231,7 +233,7 @@ function createRouter(routes, opts = {}, deps = {}) {\n* @return {Object} The router instance\n*/\nfunction add(routes) {\n- rootNode.add(routes, addCanActivate);\n+ rootNode.add(routes, onRouteAdded);\nreturn router;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5/test/core/navigation.js",
"new_path": "packages/router5/test/core/navigation.js",
"diff": "@@ -172,4 +172,14 @@ describe('core/navigation', function() {\ndone();\n});\n});\n+\n+ it('should forward a route to another route', done => {\n+ router.forward('profile', 'profile.me');\n+\n+ router.navigate('profile', (err, state) => {\n+ expect(state.name).to.equal('profile.me');\n+ router.forward('profile', undefined);\n+ done();\n+ });\n+ });\n});\n"
}
] | TypeScript | MIT License | router5/router5 | feat: add route forwarding |
580,249 | 26.06.2017 18:37:16 | -3,600 | 67f17f30f65f39cc71a62cdfb5e63e1f04edc07f | chore: remove package internal dev dependencies to avoid too much publishing | [
{
"change_type": "MODIFY",
"old_path": "lerna.json",
"new_path": "lerna.json",
"diff": "\"packages/*\"\n],\n\"version\": \"independent\",\n- \"npmClient\": \"yarn\"\n+ \"npmClient\": \"yarn\",\n+ \"commands\": {\n+ \"publish\": {\n+ \"ignore\": [\n+ \"*.md\",\n+ \"yarn.lock\",\n+ \"*.log\"\n+ ]\n+ }\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/react-router5/package.json",
"new_path": "packages/react-router5/package.json",
"diff": "\"url\": \"https://github.com/router5/router5/issues\"\n},\n\"homepage\": \"http://router5.github.com\",\n- \"devDependencies\": {\n- \"router5\": \"^5.0.1\"\n- },\n\"peerDependencies\": {\n\"react\": \"^0.14.0 || ^15.0.0\",\n\"router5\": \"^5.0.1\"\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/react-router5/test/main.js",
"new_path": "packages/react-router5/test/main.js",
"diff": "@@ -3,7 +3,7 @@ import { expect } from 'chai';\nimport { Child, createTestRouter, FnChild, renderWithRouter } from './utils';\nimport { RouterProvider, withRoute, routeNode, BaseLink } from '../modules';\nimport { spy } from 'sinon';\n-import listenersPlugin from 'router5/plugins/listeners';\n+import listenersPlugin from '../../router5/plugins/listeners';\nimport { mount } from 'enzyme';\ndescribe('withRoute hoc', () => {\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/react-router5/test/utils.js",
"new_path": "packages/react-router5/test/utils.js",
"diff": "-import createRouter from 'router5';\n+import createRouter from '../../router5';\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { RouterProvider } from '../modules';\n-import browserPlugin from 'router5/plugins/browser';\n+import browserPlugin from '../../router5/plugins/browser';\nimport { mount } from 'enzyme';\nexport class Child extends Component {\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/rxjs-router5/_test/main.js",
"new_path": "packages/rxjs-router5/_test/main.js",
"diff": "import { expect } from 'chai';\nimport { Observable } from 'rxjs';\nimport createObservables from '../modules';\n-import createRouter from 'router5';\n+import createRouter from '../../router5';\ndescribe('rxPlugin', () => {\nlet observables;\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/rxjs-router5/_test/route$.js",
"new_path": "packages/rxjs-router5/_test/route$.js",
"diff": "@@ -2,7 +2,7 @@ import { expect } from 'chai';\nimport { spy } from 'sinon';\nimport { state1, state2, state3 } from './_helpers';\nimport createObservables from '../modules';\n-import createRouter, { constants } from 'router5';\n+import createRouter, { constants } from '../../router5';\ndescribe('route$', () => {\nit('should push new values to route$ on transitionSuccess events', () => {\n@@ -20,12 +20,20 @@ describe('route$', () => {\nexpect(listener.next).to.have.been.calledWith(state1);\nrouter.invokeEventListeners(constants.TRANSITION_START, state2, state1);\n- router.invokeEventListeners(constants.TRANSITION_SUCCESS, state2, state1);\n+ router.invokeEventListeners(\n+ constants.TRANSITION_SUCCESS,\n+ state2,\n+ state1\n+ );\nexpect(listener.next).to.have.been.calledWith(state2);\nrouter.invokeEventListeners(constants.TRANSITION_START, state3, state2);\n- router.invokeEventListeners(constants.TRANSITION_SUCCESS, state3, state2);\n+ router.invokeEventListeners(\n+ constants.TRANSITION_SUCCESS,\n+ state3,\n+ state2\n+ );\nexpect(listener.next).to.have.been.calledWith(state3);\nrouter.invokeEventListeners(constants.ROUTER_STOP);\n@@ -40,7 +48,12 @@ describe('route$', () => {\nobservables.route$.subscribe(listener);\nrouter.invokeEventListeners(constants.TRANSITION_START, state1, null);\n- router.invokeEventListeners(constants.TRANSITION_ERROR, state1, null, 'error');\n+ router.invokeEventListeners(\n+ constants.TRANSITION_ERROR,\n+ state1,\n+ null,\n+ 'error'\n+ );\nexpect(listener.next).to.have.been.calledOnce;\nexpect(listener.next).to.have.been.calledWith(null);\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/rxjs-router5/_test/routeNode.js",
"new_path": "packages/rxjs-router5/_test/routeNode.js",
"diff": "@@ -2,7 +2,7 @@ import { expect } from 'chai';\nimport { spy } from 'sinon';\nimport { state1, state2, state3 } from './_helpers';\nimport createObservables from '../modules';\n-import createRouter, { constants } from 'router5';\n+import createRouter, { constants } from '../../router5';\nconst nestedA = { name: 'a', path: '/a', meta: { params: {} } };\nconst nestedAB = { name: 'a.b', path: '/a/b', meta: { params: {} } };\n@@ -22,13 +22,20 @@ describe('routeNode', () => {\nexpect(listener.next).to.have.been.calledWith(state1);\nrouter.invokeEventListeners(constants.TRANSITION_START, state2, state1);\n- router.invokeEventListeners(constants.TRANSITION_SUCCESS, state2, state1);\n-\n+ router.invokeEventListeners(\n+ constants.TRANSITION_SUCCESS,\n+ state2,\n+ state1\n+ );\nexpect(listener.next).to.have.been.calledWith(state2);\nrouter.invokeEventListeners(constants.TRANSITION_START, state3, state2);\n- router.invokeEventListeners(constants.TRANSITION_SUCCESS, state3, state2);\n+ router.invokeEventListeners(\n+ constants.TRANSITION_SUCCESS,\n+ state3,\n+ state2\n+ );\nexpect(listener.next).to.have.been.calledWith(state3);\n@@ -45,15 +52,35 @@ describe('routeNode', () => {\nobservables.routeNode('a').subscribe(listener);\nrouter.invokeEventListeners(constants.TRANSITION_START, nestedA, null);\n- router.invokeEventListeners(constants.TRANSITION_SUCCESS, nestedA, null);\n-\n- router.invokeEventListeners(constants.TRANSITION_START, nestedAB, nestedA);\n- router.invokeEventListeners(constants.TRANSITION_SUCCESS, nestedAB, nestedA);\n+ router.invokeEventListeners(\n+ constants.TRANSITION_SUCCESS,\n+ nestedA,\n+ null\n+ );\n+\n+ router.invokeEventListeners(\n+ constants.TRANSITION_START,\n+ nestedAB,\n+ nestedA\n+ );\n+ router.invokeEventListeners(\n+ constants.TRANSITION_SUCCESS,\n+ nestedAB,\n+ nestedA\n+ );\nexpect(listener.next).to.have.been.calledWith(nestedAB);\n- router.invokeEventListeners(constants.TRANSITION_START, nestedAC, nestedAB);\n- router.invokeEventListeners(constants.TRANSITION_SUCCESS, nestedAC, nestedAB);\n+ router.invokeEventListeners(\n+ constants.TRANSITION_START,\n+ nestedAC,\n+ nestedAB\n+ );\n+ router.invokeEventListeners(\n+ constants.TRANSITION_SUCCESS,\n+ nestedAC,\n+ nestedAB\n+ );\nexpect(listener.next).to.have.been.calledWith(nestedAC);\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/rxjs-router5/_test/transitionError$.js",
"new_path": "packages/rxjs-router5/_test/transitionError$.js",
"diff": "@@ -2,7 +2,7 @@ import { expect } from 'chai';\nimport { spy } from 'sinon';\nimport { state1, state2 } from './_helpers';\nimport createObservables from '../modules';\n-import createRouter, { constants } from 'router5';\n+import createRouter, { constants } from '../../router5';\nconst error = 'error';\n@@ -14,7 +14,12 @@ describe('transitionError$', () => {\nobservables.transitionError$.subscribe(listener);\nrouter.invokeEventListeners(constants.TRANSITION_START, state1, null);\n- router.invokeEventListeners(constants.TRANSITION_ERROR, state1, null, error);\n+ router.invokeEventListeners(\n+ constants.TRANSITION_ERROR,\n+ state1,\n+ null,\n+ error\n+ );\nexpect(listener.next).to.have.been.calledTwice;\nexpect(listener.next).to.have.been.calledWith(null);\n@@ -32,7 +37,12 @@ describe('transitionError$', () => {\nobservables.transitionError$.subscribe(listener);\nrouter.invokeEventListeners(constants.TRANSITION_START, state1, null);\n- router.invokeEventListeners(constants.TRANSITION_ERROR, state1, null, error);\n+ router.invokeEventListeners(\n+ constants.TRANSITION_ERROR,\n+ state1,\n+ null,\n+ error\n+ );\nrouter.invokeEventListeners(constants.TRANSITION_START, state2, null);\nexpect(listener.next).to.have.been.calledThrice;\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/rxjs-router5/_test/transitionRoute$.js",
"new_path": "packages/rxjs-router5/_test/transitionRoute$.js",
"diff": "@@ -2,7 +2,7 @@ import { expect } from 'chai';\nimport { spy } from 'sinon';\nimport { state1 } from './_helpers';\nimport createObservables from '../modules';\n-import createRouter, { constants } from 'router5';\n+import createRouter, { constants } from '../../router5';\ndescribe('transitionRoute$', () => {\nit('should push new values to transitionRoute$ on transitionStart events', () => {\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/rxjs-router5/package.json",
"new_path": "packages/rxjs-router5/package.json",
"diff": "\"router5-transition-path\": \"^5.0.0\",\n\"rxjs\": \"~5.0.0-beta.11\"\n},\n- \"devDependencies\": {\n- \"router5\": \"^5.0.1\"\n- },\n\"peerDependencies\": {\n\"router5\": \"^5.0.1\",\n\"rxjs\": \"^5.0.0-beta.11\"\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/xstream-router5/package.json",
"new_path": "packages/xstream-router5/package.json",
"diff": "\"router5-transition-path\": \"^5.0.0\",\n\"xstream\": \"^10.0.0\"\n},\n- \"devDependencies\": {\n- \"router5\": \"^5.0.1\"\n- },\n\"peerDependencies\": {\n\"router5\": \"^5.0.1\",\n\"xstream\": \"^10.0.0\"\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/xstream-router5/test/main.js",
"new_path": "packages/xstream-router5/test/main.js",
"diff": "import { expect } from 'chai';\nimport { Stream } from 'xstream';\n-import createRouter from 'router5';\n+import createRouter from '../../router5';\nimport createObservables from '../modules';\ndescribe('xsPlugin', () => {\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/xstream-router5/test/route$.js",
"new_path": "packages/xstream-router5/test/route$.js",
"diff": "@@ -2,7 +2,7 @@ import { expect } from 'chai';\nimport { spy } from 'sinon';\nimport { state1, state2, state3 } from './_helpers';\nimport createObservables from '../modules';\n-import createRouter, { constants } from 'router5';\n+import createRouter, { constants } from '../../router5';\ndescribe('route$', () => {\nit('should push new values to route$ on transitionSuccess events', () => {\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/xstream-router5/test/routeNode.js",
"new_path": "packages/xstream-router5/test/routeNode.js",
"diff": "@@ -2,7 +2,7 @@ import { expect } from 'chai';\nimport { spy } from 'sinon';\nimport { state1, state2, state3 } from './_helpers';\nimport createObservables from '../modules';\n-import createRouter, { constants } from 'router5';\n+import createRouter, { constants } from '../../router5';\nconst nestedA = { name: 'a', path: '/a', meta: { params: {} } };\nconst nestedAB = { name: 'a.b', path: '/a/b', meta: { params: {} } };\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/xstream-router5/test/transitionError$.js",
"new_path": "packages/xstream-router5/test/transitionError$.js",
"diff": "@@ -2,7 +2,7 @@ import { expect } from 'chai';\nimport { spy } from 'sinon';\nimport { state1, state2 } from './_helpers';\nimport createObservables from '../modules';\n-import createRouter, { constants } from 'router5';\n+import createRouter, { constants } from '../../router5';\nconst error = 'error';\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/xstream-router5/test/transitionRoute$.js",
"new_path": "packages/xstream-router5/test/transitionRoute$.js",
"diff": "@@ -2,7 +2,7 @@ import { expect } from 'chai';\nimport { spy } from 'sinon';\nimport { state1 } from './_helpers';\nimport createObservables from '../modules';\n-import createRouter, { constants } from 'router5';\n+import createRouter, { constants } from '../../router5';\ndescribe('transitionRoute$', () => {\nit('should push new values to transitionRoute$ on transitionStart events', () => {\n"
}
] | TypeScript | MIT License | router5/router5 | chore: remove package internal dev dependencies to avoid too much publishing |
580,249 | 26.06.2017 19:08:02 | -3,600 | 9bb79e2caf1bb1f67c76edfbc51f795357377198 | chore: add lerna-changelog | [
{
"change_type": "MODIFY",
"old_path": ".gitignore",
"new_path": ".gitignore",
"diff": "@@ -5,3 +5,4 @@ yarn-error.log\nlerna-debug.log\npackages/*/dist\n+.changelog\n"
},
{
"change_type": "MODIFY",
"old_path": "lerna.json",
"new_path": "lerna.json",
"diff": "\"*.log\"\n]\n}\n+ },\n+ \"changelog\": {\n+ \"repo\": \"router5/router5\",\n+ \"labels\": {\n+ \"bug\": \"Bug fix\",\n+ \"feature\": \"Feature\",\n+ \"housekeeping\": \"House keeping\"\n+ }\n+ }\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"check\": \"yarn run lint && yarn run test\",\n\"format\": \"prettier\",\n\"precommit\": \"lint-staged\",\n- \"changelog\": \"conventional-changelog -p angular -i CHANGELOG.md -s\",\n+ \"changelog\": \"lerna-changelog\",\n\"docs:start\": \"node packages/docs/scripts/start\",\n\"copy\": \"cp -f README.md ./packages/router5/README.md\",\n\"release\": \"git pull --rebase && npm run build && npm run copy && lerna publish\"\n\"isparta\": \"~4.0.0\",\n\"jsdom\": \"~11.0.0\",\n\"lerna\": \"~2.0.0-rc.5\",\n+ \"lerna-changelog\": \"~0.5.0\",\n\"lint-staged\": \"~3.6.1\",\n\"mocha\": \"~3.4.2\",\n\"mocha-lcov-reporter\": \"~1.3.0\",\n"
},
{
"change_type": "MODIFY",
"old_path": "yarn.lock",
"new_path": "yarn.lock",
"diff": "@@ -1870,7 +1870,7 @@ error-ex@^1.2.0:\ndependencies:\nis-arrayish \"^0.2.1\"\n-es-abstract@^1.6.1:\n+es-abstract@^1.4.3, es-abstract@^1.6.1:\nversion \"1.7.0\"\nresolved \"https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.7.0.tgz#dfade774e01bfcd97f96180298c449c8623fb94c\"\ndependencies:\n@@ -3258,6 +3258,18 @@ [email protected]:\nversion \"0.0.10\"\nresolved \"https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3\"\n+lerna-changelog@~0.5.0:\n+ version \"0.5.0\"\n+ resolved \"https://registry.yarnpkg.com/lerna-changelog/-/lerna-changelog-0.5.0.tgz#1617a8193a1309451ffa1e686b425faf0424b3f8\"\n+ dependencies:\n+ chalk \"^1.1.3\"\n+ mkdirp \"^0.5.1\"\n+ node-fetch \"^1.7.0\"\n+ p-map \"^1.1.1\"\n+ progress \"^1.1.8\"\n+ string.prototype.padend \"^3.0.0\"\n+ yargs \"^6.6.0\"\n+\nlerna@~2.0.0-rc.5:\nversion \"2.0.0-rc.5\"\nresolved \"https://registry.yarnpkg.com/lerna/-/lerna-2.0.0-rc.5.tgz#b59d168caaac6e3443078c1bce194208c9aa3090\"\n@@ -3789,7 +3801,7 @@ no-case@^2.2.0:\ndependencies:\nlower-case \"^1.1.1\"\n-node-fetch@^1.0.1:\n+node-fetch@^1.0.1, node-fetch@^1.7.0:\nversion \"1.7.1\"\nresolved \"https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.1.tgz#899cb3d0a3c92f952c47f1b876f4c8aeabd400d5\"\ndependencies:\n@@ -4282,6 +4294,10 @@ process@^0.11.0:\nversion \"0.11.10\"\nresolved \"https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182\"\n+progress@^1.1.8:\n+ version \"1.1.8\"\n+ resolved \"https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be\"\n+\nprogress@^2.0.0:\nversion \"2.0.0\"\nresolved \"https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f\"\n@@ -5092,6 +5108,14 @@ string-width@^2.0.0:\nis-fullwidth-code-point \"^2.0.0\"\nstrip-ansi \"^3.0.0\"\n+string.prototype.padend@^3.0.0:\n+ version \"3.0.0\"\n+ resolved \"https://registry.yarnpkg.com/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz#f3aaef7c1719f170c5eab1c32bf780d96e21f2f0\"\n+ dependencies:\n+ define-properties \"^1.1.2\"\n+ es-abstract \"^1.4.3\"\n+ function-bind \"^1.0.2\"\n+\nstring_decoder@^0.10.25, string_decoder@~0.10.x:\nversion \"0.10.31\"\nresolved \"https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94\"\n@@ -5715,7 +5739,7 @@ yargs-parser@^7.0.0:\ndependencies:\ncamelcase \"^4.1.0\"\n-yargs@^6.0.0:\n+yargs@^6.0.0, yargs@^6.6.0:\nversion \"6.6.0\"\nresolved \"https://registry.yarnpkg.com/yargs/-/yargs-6.6.0.tgz#782ec21ef403345f830a808ca3d513af56065208\"\ndependencies:\n"
}
] | TypeScript | MIT License | router5/router5 | chore: add lerna-changelog |
580,249 | 30.06.2017 10:25:30 | -3,600 | 2661946b8f788d4b2a1a1e78e43524204fd02c12 | fix: allow forwarding on router start | [
{
"change_type": "MODIFY",
"old_path": "packages/router5/modules/core/navigation.js",
"new_path": "packages/router5/modules/core/navigation.js",
"diff": "@@ -5,8 +5,8 @@ const noop = function() {};\nexport default function withNavigation(router) {\nlet cancelCurrentTransition;\n- const forwardMap = {};\n+ router.forwardMap = {};\nrouter.navigate = navigate;\nrouter.navigateToDefault = navigateToDefault;\nrouter.transitionToState = transitionToState;\n@@ -33,7 +33,7 @@ export default function withNavigation(router) {\n* @param {String} toRoute The route params\n*/\nfunction forward(fromRoute, toRoute) {\n- forwardMap[fromRoute] = toRoute;\n+ router.forwardMap[fromRoute] = toRoute;\nreturn router;\n}\n@@ -47,7 +47,7 @@ export default function withNavigation(router) {\n* @return {Function} A cancel function\n*/\nfunction navigate(...args) {\n- const name = forwardMap[args[0]] || args[0];\n+ const name = router.forwardMap[args[0]] || args[0];\nconst lastArg = args[args.length - 1];\nconst done = typeof lastArg === 'function' ? lastArg : noop;\nconst params = typeof args[1] === 'object' ? args[1] : {};\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5/modules/core/utils.js",
"new_path": "packages/router5/modules/core/utils.js",
"diff": "@@ -130,8 +130,15 @@ export default function withUtils(router) {\nconst builtPath = options.useTrailingSlash === undefined\n? path\n: router.buildPath(name, params);\n-\n- return router.makeState(name, params, builtPath, _meta, source);\n+ const routeName = router.forwardMap[name] || name;\n+\n+ return router.makeState(\n+ routeName,\n+ params,\n+ builtPath,\n+ _meta,\n+ source\n+ );\n}\nreturn null;\n"
}
] | TypeScript | MIT License | router5/router5 | fix: allow forwarding on router start |
580,249 | 03.07.2017 20:58:29 | -3,600 | 67020f59ff01ca277cf2959ff6e835a8452829c5 | fix: correct state comparison (areStatesEqual) | [
{
"change_type": "MODIFY",
"old_path": "packages/router5/modules/core/utils.js",
"new_path": "packages/router5/modules/core/utils.js",
"diff": "@@ -56,16 +56,15 @@ export default function withUtils(router) {\nconst getUrlParams = name =>\nrouter.rootNode\n.getSegmentsByName(name)\n- .map(\n- segment =>\n- segment.parser[\n- ignoreQueryParams ? 'urlParams' : 'params'\n- ]\n- )\n+ .map(segment => segment.parser['urlParams'])\n.reduce((params, p) => params.concat(p), []);\n- const state1Params = getUrlParams(state1.name);\n- const state2Params = getUrlParams(state2.name);\n+ const state1Params = ignoreQueryParams\n+ ? getUrlParams(state1.name)\n+ : Object.keys(state1.params);\n+ const state2Params = ignoreQueryParams\n+ ? getUrlParams(state2.name)\n+ : Object.keys(state2.params);\nreturn (\nstate1Params.length === state2Params.length &&\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5/modules/plugins/browser/index.js",
"new_path": "packages/router5/modules/plugins/browser/index.js",
"diff": "@@ -146,13 +146,14 @@ function browserPluginFactory(opts = {}, browser = safeBrowser) {\nfunction onTransitionSuccess(toState, fromState, opts) {\nconst historyState = browser.getState();\n- const replace =\n- opts.replace ||\n- (fromState &&\n- router.areStatesEqual(toState, fromState, false)) ||\n- (opts.reload &&\n+ const hasState =\nhistoryState &&\n- router.areStatesEqual(toState, historyState, false));\n+ historyState.meta &&\n+ historyState.name &&\n+ historyState.params;\n+ const statesAreEqual =\n+ fromState && router.areStatesEqual(fromState, toState, false);\n+ const replace = opts.replace || !hasState || statesAreEqual;\nlet url = router.buildUrl(toState.name, toState.params);\nif (\nfromState === null &&\n"
}
] | TypeScript | MIT License | router5/router5 | fix: correct state comparison (areStatesEqual) |
580,249 | 03.07.2017 21:13:56 | -3,600 | 8b26dbdc0cdbab697173ae80c201559be877fc50 | fix: fix cannot deactivate conddition in browser plugin popstate handler | [
{
"change_type": "MODIFY",
"old_path": "packages/router5/modules/plugins/browser/index.js",
"new_path": "packages/router5/modules/plugins/browser/index.js",
"diff": "@@ -99,7 +99,7 @@ function browserPluginFactory(opts = {}, browser = safeBrowser) {\n...transitionOptions,\nreplace: true\n});\n- } else if (err === errorCodes.CANNOT_DEACTIVATE) {\n+ } else if (err.code === errorCodes.CANNOT_DEACTIVATE) {\nconst url = router.buildUrl(\nrouterState.name,\nrouterState.params\n"
}
] | TypeScript | MIT License | router5/router5 | fix: fix cannot deactivate conddition in browser plugin popstate handler |
580,249 | 07.07.2017 15:36:45 | -3,600 | 3b734b004ad49eec3cc144dc79f2cbd1742f1e90 | feat: add navigation option to skip transition | [
{
"change_type": "MODIFY",
"old_path": "packages/router5/modules/core/navigation.js",
"new_path": "packages/router5/modules/core/navigation.js",
"diff": "@@ -42,7 +42,7 @@ export default function withNavigation(router) {\n* Navigate to a route\n* @param {String} routeName The route name\n* @param {Object} [routeParams] The route params\n- * @param {Object} [options] The navigation options (`replace`, `reload`)\n+ * @param {Object} [options] The navigation options (`replace`, `reload`, `skipTransition`)\n* @param {Function} [done] A done node style callback (err, state)\n* @return {Function} A cancel function\n*/\n@@ -98,6 +98,11 @@ export default function withNavigation(router) {\nconst fromState = sameStates ? null : router.getState();\n+ if (opts.skipTransition) {\n+ done(null, toState);\n+ return noop;\n+ }\n+\n// Transition\nreturn transitionToState(toState, fromState, opts, (err, state) => {\nif (err) {\n"
}
] | TypeScript | MIT License | router5/router5 | feat: add navigation option to skip transition |
580,259 | 22.07.2017 14:36:59 | -32,400 | 6a43b4c955920662dffef08bce312e3bcd46c757 | docs: update README.md
code example links are broken. Update them to correct links | [
{
"change_type": "MODIFY",
"old_path": "packages/deku-router5/README.md",
"new_path": "packages/deku-router5/README.md",
"diff": "@@ -6,7 +6,7 @@ This package replaces `router5-deku` which is deprecated.\n### Example\n-[Code](../packages/apps/deku)\n+[Code](../examples/apps/deku)\n[Demo](http://router5.github.io/docs/with-deku.html#/inbox)\n### Requirements\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/react-router5/README.md",
"new_path": "packages/react-router5/README.md",
"diff": "@@ -13,7 +13,7 @@ npm install --save react-router5\n### Examples\n-* [Example project](../packages/examples/apps/react)\n+* [Example project](../examples/apps/react)\n* [Demo](https://router5.github.io/docs/with-react.html#/inbox)\n### Requirements\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/redux-router5/README.md",
"new_path": "packages/redux-router5/README.md",
"diff": "> Router5 integration with redux. If you develop with React, use this package with __[react-redux](../packages/react-redux)__\nand __[react-router5](../packages/react-router5)__. Using router5 with redux removes the need to include _router5-listeners_.\n-__[Example](../packages/examples/apps/react-redux)__ | __[Demo](http://router5.github.io/docs/with-react-redux.html)__ | __[Learn router5](http://router5.github.io)__\n+__[Example](../examples/apps/react-redux)__ | __[Demo](http://router5.github.io/docs/with-react-redux.html)__ | __[Learn router5](http://router5.github.io)__\n## Requirements\n"
}
] | TypeScript | MIT License | router5/router5 | docs: update README.md
code example links are broken. Update them to correct links |
580,249 | 27.07.2017 11:12:44 | -3,600 | f44a59489c0786bdea2cb71000400105feda31fd | fix: set source to 'popstate' in meta of state changes caused by history popstate events | [
{
"change_type": "MODIFY",
"old_path": "packages/router5/modules/plugins/browser/index.js",
"new_path": "packages/router5/modules/plugins/browser/index.js",
"diff": "@@ -65,7 +65,13 @@ function browserPluginFactory(opts = {}, browser = safeBrowser) {\nconst newState = !evt.state || !evt.state.name;\nconst state = newState\n? router.matchPath(browser.getLocation(options), source)\n- : evt.state;\n+ : router.makeState(\n+ evt.state.name,\n+ evt.state.params,\n+ evt.state.path,\n+ evt.state.meta.params,\n+ source\n+ );\nconst { defaultRoute, defaultParams } = routerOptions;\nif (!state) {\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5/test/plugins/browser.js",
"new_path": "packages/router5/test/plugins/browser.js",
"diff": "@@ -101,7 +101,14 @@ function test(useHash) {\nsetTimeout(function() {\nexpect(\nmockedBrowser.replaceState\n- ).to.have.been.calledWith(state1);\n+ ).to.have.been.calledWith({\n+ ...state1,\n+ meta: {\n+ ...state1.meta,\n+ id: state1.meta.id + 2,\n+ source: 'popstate'\n+ }\n+ });\n// expect(withoutMeta(router.getState())).to.eql(homeState);\npopState(state2);\n// Push to queue\n"
}
] | TypeScript | MIT License | router5/router5 | fix: set source to 'popstate' in meta of state changes caused by history popstate events |
580,249 | 07.08.2017 22:14:02 | -7,200 | f0727217879e282e91f99b1df6a496aaeffe309f | fix: update route-node to the latest version | [
{
"change_type": "MODIFY",
"old_path": "packages/router5/package.json",
"new_path": "packages/router5/package.json",
"diff": "},\n\"homepage\": \"http://router5.github.io\",\n\"dependencies\": {\n- \"route-node\": \"1.8.3\",\n+ \"route-node\": \"1.8.4\",\n\"router5-transition-path\": \"^5.0.0\"\n},\n\"typings\": \"./index.d.ts\"\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5/yarn.lock",
"new_path": "packages/router5/yarn.lock",
"diff": "@@ -8,9 +8,9 @@ [email protected]:\ndependencies:\nsearch-params \"~1.3.0\"\[email protected]:\n- version \"1.8.3\"\n- resolved \"https://registry.yarnpkg.com/route-node/-/route-node-1.8.3.tgz#eb82a072176c20eebcfa02ad7924e0403704134e\"\[email protected]:\n+ version \"1.8.4\"\n+ resolved \"https://registry.yarnpkg.com/route-node/-/route-node-1.8.4.tgz#23140a835a807a27022d9de7f87866e132e2ca5a\"\ndependencies:\npath-parser \"2.0.2\"\nsearch-params \"~1.3.0\"\n"
}
] | TypeScript | MIT License | router5/router5 | fix: update route-node to the latest version |
580,249 | 10.08.2017 22:35:37 | -7,200 | 401808176a78f5b86d87d9523f5befb661dc656e | fix: update route-node to latest | [
{
"change_type": "MODIFY",
"old_path": "packages/router5/package.json",
"new_path": "packages/router5/package.json",
"diff": "},\n\"homepage\": \"http://router5.github.io\",\n\"dependencies\": {\n- \"route-node\": \"1.8.4\",\n+ \"route-node\": \"1.8.5\",\n\"router5-transition-path\": \"^5.0.0\"\n},\n\"typings\": \"./index.d.ts\"\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5/yarn.lock",
"new_path": "packages/router5/yarn.lock",
"diff": "@@ -8,9 +8,9 @@ [email protected]:\ndependencies:\nsearch-params \"~1.3.0\"\[email protected]:\n- version \"1.8.4\"\n- resolved \"https://registry.yarnpkg.com/route-node/-/route-node-1.8.4.tgz#23140a835a807a27022d9de7f87866e132e2ca5a\"\[email protected]:\n+ version \"1.8.5\"\n+ resolved \"https://registry.yarnpkg.com/route-node/-/route-node-1.8.5.tgz#184181147e53049b00f7e4d88115c960d4e1b88a\"\ndependencies:\npath-parser \"2.0.2\"\nsearch-params \"~1.3.0\"\n"
}
] | TypeScript | MIT License | router5/router5 | fix: update route-node to latest |
580,262 | 26.08.2017 22:30:58 | -7,200 | 70a22799f0b7ea9ab9217d8ba1accc37e6a1f845 | Update typescript definitions to latest docs | [
{
"change_type": "MODIFY",
"old_path": "packages/router5/index.d.ts",
"new_path": "packages/router5/index.d.ts",
"diff": "@@ -23,6 +23,7 @@ declare module \"router5\" {\nexport interface State {\nmeta?: object;\n+\nname: string;\nparams: any;\npath: string;\n@@ -56,68 +57,332 @@ declare module \"router5\" {\n}\nexport interface RouterOptions {\n+ /* The default route: When your router instance starts, it will navigate to a default route if such route is defined and if it cannot match the URL against a known route. */\ndefaultRoute?: string;\n- defaultParams?: object;\n+\n+ /* the default route params (defaults to {}) */\n+ defaultParams?: any;\n+\n+ /*\n+ By default, the router is in \"strict match\" mode. If you want trailing slashes to be optional, you can set trailingSlash to a truthy value.\n+ */\ntrailingSlash?: boolean;\n- useTrailingSlash?: undefined | boolean;\n- autoCleanUp?: boolean;\n- strictQueryParams?: boolean;\n- allowNotFound?: boolean;\n+\n+ /*\n+ By default, the router will build your routes according to your route definitions. You can force or not the use of trailing slashes by setting useTrailingSlash to true or false (default to undefined); When setting this option, trailingSlash will be set to true (non strict matching).\n+ */\n+ useTrailingSlash?: boolean;\n+\n+ /*\n+ If autoCleanUp is set to true, the router will automatically clear canDeactivate functions / booleans when their associated segment becomes inactive.\n+ */\n+ autoCleanUp?: true;\n+\n+ /*\n+ Query parameters are optional, meaning a route can still be matched if a query parameter defined in its path is not present. However, if extra query parameters are present in the path which is being matched, matching will fail.\n+\n+ If you want the router to still match routes if extra query parameters are present, set strictQueryParams to false.\n+ */\n+ strictQueryParams?: true;\n+\n+ /*\n+ There are two ways to deal with not found routes: the first one is to configure a defaultRoute (and defaultParams), the second one is to allow those not found routes to create a new routing state. Set allowNotFound to true and the router will emit a state value for unmatched paths.\n+ */\n+ allowNotFound?: true;\n}\nexport interface Router {\n- makeState(name: string, params: object, path: string, metaParams?: object, source?: string): object;\n- makeNotFoundPath(path: string): object;\n- getState(): State;\n- setState(state: State): State;\n+ /**\n+ * Add routes\n+ *\n+ * @param routes A list of routes to add\n+ * @returns The router instance\n+ */\n+ add(routes: Array<Route>): Router;\n+\n+ /**\n+ * Add a single route (node)\n+ *\n+ * @param name The route name (full name)\n+ * @param path The route path (from parent)\n+ * @param canActivate The canActivate handler for this node\n+ */\n+ addNode(name: string, path: string, canActivate?: RouterActivationHandler): void;\n+\n+ /**\n+ * Check if two states are related\n+ *\n+ * @param parentState The parent state\n+ * @param childState The child state\n+ * @returns Whether the two states are descendants or not\n+ */\n+ areStatesDescendants(parentState: any, childState: any): Boolean;\n+\n+ /**\n+ * Compare two route state objects\n+ *\n+ * @param state1 The route state\n+ * @param state2 The other route state\n+ * @param ignoreQueryParams Whether to ignore query parameters or not\n+ * @returns Whether the two route state are equal or not\n+ */\n+ areStatesEqual(state1: any, state2: any, ignoreQueryParams?:boolean): Boolean;\n+\n+ /**\n+ * Build a path\n+ *\n+ * @param route The route name\n+ * @param params The route params\n+ * @returns The path\n+ */\n+ buildPath(route: string, params: Object): string;\n+\n+ /**\n+ * Register a canActivate handler or specify a if a route can be deactivated\n+ *\n+ * @param name The route name\n+ * @param canActivate The canActivate handler or boolean\n+ * @returns The router instance\n+ */\n+ canActivate(name: string, canActivate: RouterActivationHandler | boolean): Router;\n+\n+ /**\n+ * Register a canDeactivate handler or specify a if a route can be deactivated\n+ *\n+ * @param name The route name\n+ * @param canDeactivate The canDeactivate handler or boolean\n+ * @returns The router instance\n+ */\n+ canDeactivate(name: string, canDeactivate: RouterActivationHandler | boolean): Router;\n+\n+ /**\n+ * Cancel the current transition if there is one\n+ */\n+ cancel(): void;\n+\n+ /**\n+ * Remove all middleware functions\n+ * @returns {}\n+ */\n+ clearMiddleware() : Router;\n+\n+ /**\n+ * Clone the current router configuration. The new returned router will be non-started, with a null state\n+ *\n+ * @param deps Dependency tree\n+ * @returns Cloned router\n+ */\n+ clone(deps: any): Router;\n+\n+ /**\n+ * Forward a route to another route, when calling navigate. Route parameters for the two routes should match to avoid issues.\n+ *\n+ * @param fromRoute The route name\n+ * @param toRouter The route name\n+ * @returns {}\n+ */\n+ forward(fromRoute : string, toRouter : string) : void;\n+\n+ /**\n+ * Get dependencies\n+ *\n+ * @returns The dependencies\n+ */\n+ getDependencies():any;\n+\n+ /**\n+ * Get router options\n+ */\ngetOptions() : RouterOptions;\n- setOption(option: string, value: any): Router;\n- setDependency(dependencyName: string, dependency: any): Router;\n- setDependencies(deps: Array<{name: string, value: any}>): Router;\n- getDependencies(): object;\n- add(routes: Array<any>): Router;\n- addNode(name: string, path: string, canActivateHandler: Function): Router;\n- // router lifecycle\n+ /**\n+ * Get the current router state\n+ * @returns The current state\n+ */\n+ getState(): State;\n+\n+ /**\n+ * Check if a plugin has already been registered.\n+ *\n+ * @param pluginName The plugin name\n+ * @returns Whether the plugin has been registered\n+ */\n+ hasPlugin(pluginName:string) : boolean;\n+\n+ /**\n+ * Check if a route is currently active\n+ *\n+ * @param name The route name\n+ * @param params The route params\n+ * @param strictEquality Whether to check if the given route is the active route, or part of the active route\n+ * @param ignoreQueryParams Whether to ignore query parameters\n+ * @returns Whether the given route is active\n+ */\n+ isActive(name: string, params?: Object, strictEquality?: Boolean, ignoreQueryParams?: Boolean): Boolean;\n+\n+ /**\n+ * Check if the router is started\n+ * @returns Whether the router is started or not\n+ */\nisStarted() : boolean;\n+\n+ /**\n+ * Build a not found state for a given path\n+ *\n+ * @param path The unmatched path\n+ * @returns The not found state object\n+ */\n+ makeNotFoundState(path: string): State;\n+\n+ /**\n+ * Build a state object\n+ *\n+ * @param name The state name\n+ * @param params The state params\n+ * @param path The state path\n+ * @param metaParams Description of the state params\n+ * @param source The source of the routing state\n+ * @returns The state object\n+ */\n+ makeState(name : string, params : any, path : string, metaParams ?: any, source?:string): State;\n+\n+\n+ /**\n+ * Match a path\n+ *\n+ * @param path The path to match\n+ * @param source The source (optional, used internally)\n+ * @returns The matched state (null if unmatched)\n+ */\n+ matchPath(path: string, source ?: string): State | null;\n+\n+ /**\n+ * Navigate to a route\n+ *\n+ * @param routeName The route name\n+ * @param routeParams The route params\n+ * @param options The navigation options (`replace`, `reload`)\n+ * @param done A done node style callback (err, state)\n+ * @returns {}\n+ */\n+ navigate(routeName: string, routeParams?: any, options ?: NavigationOptions, done ?: Function): Function;\n+\n+ /**\n+ * Navigate to the default route (if defined)\n+ *\n+ * @param opts The navigation options\n+ * @param done A done node style callback (err, state)\n+ * @returns A cancel function\n+ */\n+ navigateToDefault(opts ?: NavigationOptions, done?: Function) : Function;\n+\n+ /**\n+ * Add dependencies\n+ * @param deps A object of dependencies (key-value pairs)\n+ * @returns The router instance\n+ */\n+ setDependencies(deps: any): Router;\n+\n+ /**\n+ * Set a router dependency\n+ *\n+ * @param dependencyName The dependency name\n+ * @param dependency The dependency\n+ * @returns The router instance\n+ */\n+ setDependency(dependencyName: string, dependency : any): Router;\n+\n+ /**\n+ * Set an option\n+ *\n+ * @param opt The option name\n+ * @param val The option value\n+ * @returns The router instance\n+ */\n+ setOption(opt: string, val: any): Router;\n+\n+ /**\n+ * Set the current router state\n+ *\n+ * @param state The state object\n+ */\n+ setState(state : State) : void;\n+\n+ /**\n+ * Start the router\n+ *\n+ * @param startPathOrState The start path or state. This is optional when using the browser plugin.\n+ * @param done A done node style callback (err, state)\n+ * @returns The router instance\n+ */\nstart(startPathOrState ?: string|State, done?:Function): Router;\n+\n+ /**\n+ * Stop the router\n+ *\n+ * @returns The router instance\n+ */\nstop(): Router;\n- // navigation\n- cancel(): Router;\n- forward(fromRouteName: string, toRouteName: string): Router;\n- navigate(routeName: string, routeParams?: object, options?: NavigationOptions, done?: Function): Function;\n- navigateToDefault(options?: NavigationOptions, done?: Function): Function;\n+ /**\n+ * Register middleware functions.\n+ *\n+ * @param args The middleware functions\n+ * @returns The router instance\n+ */\n+ useMiddleware(...args: Array<MiddlewareFactory>): Router;\n- // route lifecycle\n- canActivate(name: string, canActivateHandler: Function | boolean): Router;\n- canDeactivate(name: string, canDeactivateHandler: Function | boolean): Router;\n- clearCanDeactivate(name: string): Router;\n+ /**\n+ * Use plugins\n+ * @param pluginFactory An argument list of plugins\n+ * @returns The router instance\n+ */\n+ usePlugin(pluginFactory: PluginFactory): Router;\n- // middlewares\n- useMiddleware(...middlewares: Array<MiddlewareFactory>): Router;\n- clearMiddleware(): Router;\n+ /**\n+ * Set the root node path, use carefully. It can be used to set app-wide allowed query parameters.\n+ *\n+ * @param rootPath The root node path\n+ */\n+ setRootPath(rootPath : string) : void;\n+ }\n- // plugins\n- usePlugin(...plugins: Array<PluginFactory>): Router;\n- hasPlugin(name: string): boolean;\n+ /**\n+ * The result can be synchronous (returning a boolean) or asynchronous (returning a promise or calling done(err, result))\n+ */\n+ export type RouterActivationHandler = (tostring: State, fromState: State) => boolean | Promise<boolean>;\n- // utils\n- isActive(name: string, params: object, strictEquality?: boolean, ignoreQueryParams?: boolean): boolean;\n- areStatesEqual(state1: State, state2: State, ignoreQueryParams: boolean): boolean;\n- areStatesDescendants(parent: State, child: State): boolean;\n- buildPath(route: string, params: object): string;\n- matchPath(path: string, source?: string): object;\n- setRootPath(rootPath: string): void;\n+ export interface Route {\n+ name: string;\n+ path: string;\n+\n+ /**\n+ * if specified, the router will transition to the forwarded route instead. It is useful for defaulting to a child route, or having multiple paths pointing to the same route.\n+ */\n+ forwardTo?: string;\n+\n+ /**\n+ * a method to control whether or not the route node can be activated\n+ */\n+ canActivate?: (router: Router) => RouterActivationHandler;\n+\n+ children?: Array<Route>;\n}\n+ /*\n+ Create a router\n+\n+ @param routes The routes\n+ @param options The router options\n+ @param dependencies The router dependencies\n+ */\n+ export function createRouter(routes?: Array<Route>, options?: RouterOptions, dependencies?: any): Router;\nexport var errorCodes: ErrorCodes;\nexport var constants: Constants;\nexport var transitionPath: (toState: any, fromState: any) => any;\nexport var loggerPlugin: PluginFactory;\n- var createRouter: (routes?: any, options?: any, dependencies?: any) => Router;\nexport default createRouter;\n}\n"
}
] | TypeScript | MIT License | router5/router5 | Update typescript definitions to latest docs |
580,249 | 04.09.2017 20:25:41 | -3,600 | bba80ac7b4261b0863dd96e4ed362c93ffba6070 | fix: only use console groups in logger if available | [
{
"change_type": "MODIFY",
"old_path": "packages/router5/modules/plugins/logger/index.js",
"new_path": "packages/router5/modules/plugins/logger/index.js",
"diff": "/* istanbul ignore next */\n/*eslint no-console: 0*/\n+const noop = () => {};\nfunction loggerPlugin() {\n- const startGroup = () => console.group('Router transition');\n- const endGroup = () => console.groupEnd('Router transition');\n+ const supportsGroups = console.group && console.groupEnd;\n+ const startGroup = supportsGroups\n+ ? () => console.group('Router transition')\n+ : noop;\n+ const endGroup = supportsGroups\n+ ? () => console.groupEnd('Router transition')\n+ : noop;\nconsole.info('Router started');\n"
}
] | TypeScript | MIT License | router5/router5 | fix: only use console groups in logger if available |
580,249 | 04.09.2017 20:53:30 | -3,600 | 903b5a1cc23cc65d79354624e4c4c4ddc8ee81ec | fix: preserve state IDs on popstate | [
{
"change_type": "MODIFY",
"old_path": "packages/router5/modules/create-router.js",
"new_path": "packages/router5/modules/create-router.js",
"diff": "@@ -118,9 +118,10 @@ function createRouter(routes, opts = {}, deps = {}) {\n* @param {String} path The state path\n* @param {Object} [metaParams] Description of the state params\n* @param {String} [source] The source of the routing state\n+ * @param {Number} [forceId] The ID to use in meta (incremented by default)\n* @return {Object} The state object\n*/\n- function makeState(name, params, path, metaParams, source) {\n+ function makeState(name, params, path, metaParams, source, forceId) {\nconst state = {};\nconst setProp = (key, value) =>\nObject.defineProperty(state, key, { value, enumerable: true });\n@@ -129,8 +130,16 @@ function createRouter(routes, opts = {}, deps = {}) {\nsetProp('path', path);\nif (metaParams || source) {\n+ let finalStateId;\n+\n+ if (forceId === undefined) {\nstateId += 1;\n- const meta = { params: metaParams, id: stateId };\n+ finalStateId = stateId;\n+ } else {\n+ finalStateId = forceId;\n+ }\n+\n+ const meta = { params: metaParams, id: finalStateId };\nif (source) meta.source = source;\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5/modules/plugins/browser/index.js",
"new_path": "packages/router5/modules/plugins/browser/index.js",
"diff": "@@ -70,7 +70,8 @@ function browserPluginFactory(opts = {}, browser = safeBrowser) {\nevt.state.params,\nevt.state.path,\nevt.state.meta.params,\n- source\n+ source,\n+ evt.state.meta.id\n);\nconst { defaultRoute, defaultParams } = routerOptions;\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5/test/plugins/browser.js",
"new_path": "packages/router5/test/plugins/browser.js",
"diff": "@@ -105,7 +105,7 @@ function test(useHash) {\n...state1,\nmeta: {\n...state1.meta,\n- id: state1.meta.id + 2,\n+ id: state1.meta.id,\nsource: 'popstate'\n}\n});\n"
}
] | TypeScript | MIT License | router5/router5 | fix: preserve state IDs on popstate |
580,249 | 04.09.2017 21:20:39 | -3,600 | 498a8b902b7f09b19b7b52053fe1171717f96275 | fix: force redirections on error | [
{
"change_type": "MODIFY",
"old_path": "packages/router5/modules/core/navigation.js",
"new_path": "packages/router5/modules/core/navigation.js",
"diff": "@@ -42,7 +42,7 @@ export default function withNavigation(router) {\n* Navigate to a route\n* @param {String} routeName The route name\n* @param {Object} [routeParams] The route params\n- * @param {Object} [options] The navigation options (`replace`, `reload`)\n+ * @param {Object} [options] The navigation options (`replace`, `reload`, `force`)\n* @param {Function} [done] A done node style callback (err, state)\n* @return {Function} A cancel function\n*/\n@@ -84,7 +84,7 @@ export default function withNavigation(router) {\n// Do not proceed further if states are the same and no reload\n// (no deactivation and no callbacks)\n- if (sameStates && !opts.reload) {\n+ if (sameStates && !opts.reload && !opts.force) {\nconst err = { code: errorCodes.SAME_STATES };\ndone(err);\nrouter.invokeEventListeners(\n@@ -104,7 +104,7 @@ export default function withNavigation(router) {\nif (err.redirect) {\nconst { name, params } = err.redirect;\n- navigate(name, params, { ...opts, reload: true }, done);\n+ navigate(name, params, { ...opts, force: true }, done);\n} else {\ndone(err);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5/modules/plugins/browser/index.js",
"new_path": "packages/router5/modules/plugins/browser/index.js",
"diff": "@@ -104,7 +104,8 @@ function browserPluginFactory(opts = {}, browser = safeBrowser) {\nrouter.navigate(name, params, {\n...transitionOptions,\n- replace: true\n+ replace: true,\n+ force: true\n});\n} else if (err.code === errorCodes.CANNOT_DEACTIVATE) {\nconst url = router.buildUrl(\n"
}
] | TypeScript | MIT License | router5/router5 | fix: force redirections on error |
580,262 | 04.09.2017 21:28:31 | -7,200 | 20483afed93d58b1936b13cccdbd222f1476e6b8 | Update definition to include done callback | [
{
"change_type": "MODIFY",
"old_path": "packages/router5/index.d.ts",
"new_path": "packages/router5/index.d.ts",
"diff": "@@ -107,7 +107,7 @@ declare module \"router5\" {\n* @param path The route path (from parent)\n* @param canActivate The canActivate handler for this node\n*/\n- addNode(name: string, path: string, canActivate?: RouterActivationHandler): void;\n+ addNode(name: string, path: string, canActivate?: RouterActivationHandlerFactory): void;\n/**\n* Check if two states are related\n@@ -144,7 +144,7 @@ declare module \"router5\" {\n* @param canActivate The canActivate handler or boolean\n* @returns The router instance\n*/\n- canActivate(name: string, canActivate: RouterActivationHandler | boolean): Router;\n+ canActivate(name: string, canActivate: RouterActivationHandlerFactory | boolean): Router;\n/**\n* Register a canDeactivate handler or specify a if a route can be deactivated\n@@ -153,7 +153,7 @@ declare module \"router5\" {\n* @param canDeactivate The canDeactivate handler or boolean\n* @returns The router instance\n*/\n- canDeactivate(name: string, canDeactivate: RouterActivationHandler | boolean): Router;\n+ canDeactivate(name: string, canDeactivate: RouterActivationHandlerFactory | boolean): Router;\n/**\n* Cancel the current transition if there is one\n@@ -350,7 +350,8 @@ declare module \"router5\" {\n/**\n* The result can be synchronous (returning a boolean) or asynchronous (returning a promise or calling done(err, result))\n*/\n- export type RouterActivationHandler = (tostring: State, fromState: State) => boolean | Promise<boolean>;\n+ export type RouterActivationHandler = (tostring: State, fromState: State, done:(err:any,result:any) => void) => boolean | Promise<boolean> | undefined;\n+ export type RouterActivationHandlerFactory = (router: Router) => RouterActivationHandler;\nexport interface Route {\nname: string;\n@@ -364,7 +365,7 @@ declare module \"router5\" {\n/**\n* a method to control whether or not the route node can be activated\n*/\n- canActivate?: (router: Router) => RouterActivationHandler;\n+ canActivate?: RouterActivationHandlerFactory;\nchildren?: Array<Route>;\n}\n"
}
] | TypeScript | MIT License | router5/router5 | Update definition to include done callback |
580,264 | 15.09.2017 11:57:40 | -36,000 | b6af6b36005ab14d8ecdfb6f44f3fa69db0d9eb4 | Use console.groupCollapsed() in the logger plugin, where available. | [
{
"change_type": "MODIFY",
"old_path": "packages/router5/modules/plugins/logger/index.js",
"new_path": "packages/router5/modules/plugins/logger/index.js",
"diff": "const noop = () => {};\nfunction loggerPlugin() {\n- const supportsGroups = console.group && console.groupEnd;\n- const startGroup = supportsGroups\n- ? () => console.group('Router transition')\n- : noop;\n- const endGroup = supportsGroups\n- ? () => console.groupEnd('Router transition')\n- : noop;\n+ let startGroup, endGroup;\n+\n+ if (console.groupCollapsed) {\n+ startGroup = label => console.groupCollapsed(label);\n+ endGroup = () => console.groupEnd();\n+ } else if (console.group) {\n+ startGroup = label => console.group(label);\n+ endGroup = () => console.groupEnd();\n+ } else {\n+ startGroup = noop;\n+ endGroup = noop;\n+ }\nconsole.info('Router started');\n@@ -19,7 +24,7 @@ function loggerPlugin() {\n},\nonTransitionStart(toState, fromState) {\nendGroup();\n- startGroup();\n+ startGroup('Router transition');\nconsole.log('Transition started from state');\nconsole.log(fromState);\nconsole.log('To state');\n"
}
] | TypeScript | MIT License | router5/router5 | Use console.groupCollapsed() in the logger plugin, where available. |
580,264 | 26.09.2017 17:25:49 | -36,000 | 8c3bb2a55e180476bf5ca2597cd92f4287761ec0 | Router plugin buildUrl should return null for undefined routes. | [
{
"change_type": "MODIFY",
"old_path": "packages/router5/modules/plugins/browser/utils.js",
"new_path": "packages/router5/modules/plugins/browser/utils.js",
"diff": "@@ -8,6 +8,8 @@ export default function withUtils(router, options) {\nconst prefix = options.useHash ? `#${options.hashPrefix}` : '';\nconst path = router.buildPath(route, params);\n+ if (path === null) return null;\n+\nreturn base + prefix + path;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5/test/plugins/browser.js",
"new_path": "packages/router5/test/plugins/browser.js",
"diff": "@@ -155,6 +155,7 @@ function test(useHash) {\npath: '/route-not-found'\n})\n).to.equal(prefix + '/route-not-found');\n+ expect(router.buildUrl('undefined', {})).to.equal(null);\n});\n});\n}\n"
}
] | TypeScript | MIT License | router5/router5 | Router plugin buildUrl should return null for undefined routes. |
580,249 | 26.09.2017 19:48:09 | -3,600 | 1f0a0ab6f85b8b1942e17831466afc1e6ad83db1 | chore: update React peer dependency (react-router5) | [
{
"change_type": "MODIFY",
"old_path": "packages/react-router5/package.json",
"new_path": "packages/react-router5/package.json",
"diff": "},\n\"homepage\": \"http://router5.github.com\",\n\"peerDependencies\": {\n- \"react\": \"^0.14.0 || ^15.0.0\",\n+ \"react\": \"^0.14.0 || ^15.0.0 || ^16.0.0\",\n\"router5\": \"^5.0.1\"\n},\n\"dependencies\": {\n"
}
] | TypeScript | MIT License | router5/router5 | chore: update React peer dependency (react-router5) |
580,249 | 29.09.2017 09:27:50 | -3,600 | 2d1d632e67d6ff5a86bb2b78720347e18bb8d582 | chore: update rxjs-router5 peer dependencies | [
{
"change_type": "MODIFY",
"old_path": "packages/rxjs-router5/package.json",
"new_path": "packages/rxjs-router5/package.json",
"diff": "\"homepage\": \"http://router5.github.io\",\n\"dependencies\": {\n\"router5-transition-path\": \"^5.0.0\",\n- \"rxjs\": \"~5.0.0-beta.11\"\n+ \"rxjs\": \"~5.4.3\"\n},\n\"peerDependencies\": {\n- \"router5\": \"^5.0.1\",\n- \"rxjs\": \"^5.0.0-beta.11\"\n+ \"router5\": \"^5.0.0\",\n+ \"rxjs\": \"^5.0.0\"\n},\n\"typings\": \"./index.d.ts\"\n}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/rxjs-router5/yarn.lock",
"diff": "+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n+# yarn lockfile v1\n+\n+\n+rxjs@~5.4.3:\n+ version \"5.4.3\"\n+ resolved \"https://registry.yarnpkg.com/rxjs/-/rxjs-5.4.3.tgz#0758cddee6033d68e0fd53676f0f3596ce3d483f\"\n+ dependencies:\n+ symbol-observable \"^1.0.1\"\n+\n+symbol-observable@^1.0.1:\n+ version \"1.0.4\"\n+ resolved \"https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d\"\n"
}
] | TypeScript | MIT License | router5/router5 | chore: update rxjs-router5 peer dependencies |
580,249 | 04.10.2017 09:21:19 | -3,600 | e9063f2b17b68c5d0d135f9c3a5c225faf8aba01 | feat: pass link props to its hyperlink element | [
{
"change_type": "MODIFY",
"old_path": "packages/react-router5/modules/BaseLink.js",
"new_path": "packages/react-router5/modules/BaseLink.js",
"diff": "@@ -58,15 +58,22 @@ class BaseLink extends Component {\n}\nrender() {\n+ /* eslint-disable */\nconst {\nrouteName,\nrouteParams,\n+ routeOptions,\nclassName,\nactiveClassName,\n+ activeStrict,\n+ route,\n+ previousRoute,\n+ router,\nchildren,\n- title,\n- onMouseOver\n+ onClick,\n+ ...linkProps\n} = this.props;\n+ /* eslint-enable */\nconst active = this.isActive();\nconst href = this.buildUrl(routeName, routeParams);\n@@ -77,11 +84,10 @@ class BaseLink extends Component {\nreturn React.createElement(\n'a',\n{\n+ ...linkProps,\nhref,\nclassName: linkclassName,\n- onClick: this.clickHandler,\n- onMouseOver,\n- title\n+ onClick: this.clickHandler\n},\nchildren\n);\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/react-router5/test/main.js",
"new_path": "packages/react-router5/test/main.js",
"diff": "import React from 'react';\nimport { expect } from 'chai';\nimport { Child, createTestRouter, FnChild, renderWithRouter } from './utils';\n-import { RouterProvider, withRoute, routeNode, BaseLink } from '../modules';\n+import {\n+ RouterProvider,\n+ withRoute,\n+ routeNode,\n+ BaseLink,\n+ Link\n+} from '../modules';\nimport { spy } from 'sinon';\nimport listenersPlugin from '../../router5/plugins/listeners';\nimport { mount } from 'enzyme';\n@@ -88,4 +94,32 @@ describe('BaseLink component', () => {\n);\nexpect(output.find('a')).to.have.className('active');\n});\n+\n+ it('should spread other props to its link', () => {\n+ router.usePlugin(listenersPlugin());\n+ router.start();\n+ const onMouseLeave = () => {};\n+ const output = mount(\n+ <RouterProvider router={router}>\n+ <Link\n+ routeName={'home'}\n+ title=\"Hello\"\n+ data-test-id=\"Link\"\n+ onMouseLeave={onMouseLeave}\n+ />\n+ </RouterProvider>\n+ );\n+\n+ const props = output.find('a').props();\n+\n+ expect(props).to.eql({\n+ href: '/home',\n+ className: 'active',\n+ onClick: props.onClick,\n+ title: 'Hello',\n+ 'data-test-id': 'Link',\n+ onMouseLeave,\n+ children: undefined\n+ });\n+ });\n});\n"
}
] | TypeScript | MIT License | router5/router5 | feat: pass link props to its hyperlink element |
580,249 | 05.10.2017 21:37:11 | -3,600 | d65793b33b50c47ade2e9faf7120d6a3ed055e49 | feat: update route-node to v1.9.0 | [
{
"change_type": "MODIFY",
"old_path": "packages/router5/package.json",
"new_path": "packages/router5/package.json",
"diff": "},\n\"homepage\": \"http://router5.github.io\",\n\"dependencies\": {\n- \"route-node\": \"1.8.5\",\n- \"router5-transition-path\": \"^5.0.0\"\n+ \"route-node\": \"1.9.0\",\n+ \"router5-transition-path\": \"5.0.0\"\n},\n\"typings\": \"./index.d.ts\"\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5/yarn.lock",
"new_path": "packages/router5/yarn.lock",
"diff": "@@ -8,9 +8,9 @@ [email protected]:\ndependencies:\nsearch-params \"~1.3.0\"\[email protected]:\n- version \"1.8.5\"\n- resolved \"https://registry.yarnpkg.com/route-node/-/route-node-1.8.5.tgz#184181147e53049b00f7e4d88115c960d4e1b88a\"\[email protected]:\n+ version \"1.9.0\"\n+ resolved \"https://registry.yarnpkg.com/route-node/-/route-node-1.9.0.tgz#e41b1ceae98f4ce7a39187b6015a1d4758f9103c\"\ndependencies:\npath-parser \"2.0.2\"\nsearch-params \"~1.3.0\"\n"
}
] | TypeScript | MIT License | router5/router5 | feat: update route-node to v1.9.0 |
580,249 | 15.10.2017 13:34:32 | -3,600 | ef6e9396f39b3124395f0627275e02fa2ee1411c | chore: update route-node package version | [
{
"change_type": "MODIFY",
"old_path": "packages/router5/package.json",
"new_path": "packages/router5/package.json",
"diff": "},\n\"homepage\": \"http://router5.github.io\",\n\"dependencies\": {\n- \"route-node\": \"1.9.0\",\n+ \"route-node\": \"1.10.0\",\n\"router5-transition-path\": \"5.0.0\"\n},\n\"typings\": \"./index.d.ts\"\n"
}
] | TypeScript | MIT License | router5/router5 | chore: update route-node package version |
580,263 | 22.10.2017 10:17:01 | -7,200 | 59663547bebd9d842a33bf9dd4c1e3edb7bb0983 | Add types for react-router5 | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/react-router5/index.d.ts",
"diff": "+declare module \"react-router5\" {\n+ import { ComponentClass, MouseEventHandler, StatelessComponent, HTMLAttributes } from 'react';\n+ import { Router, Route, State } from 'router5';\n+\n+ export interface RouterProviderProps {\n+ router: Router;\n+ }\n+\n+ export const RouterProvider: ComponentClass<RouterProviderProps>;\n+\n+ export interface BaseLinkProps extends HTMLAttributes<HTMLAnchorElement> {\n+ routeName: string;\n+ routeParams?: any;\n+ routeOptions?: any;\n+ activeClassName?: string;\n+ activeStrict?: boolean;\n+ onClick?: MouseEventHandler<HTMLAnchorElement>;\n+ onMouseOver?: MouseEventHandler<HTMLAnchorElement>;\n+ }\n+\n+ export const BaseLink: ComponentClass<BaseLinkProps>;\n+\n+ export interface LinkProps extends BaseLinkProps {\n+ }\n+\n+ export const Link: ComponentClass<LinkProps>;\n+\n+ export function withRoute<\n+ TProps extends Partial<{\n+ route: State;\n+ previousRoute: State;\n+ }>,\n+ TComponent extends (ComponentClass<TProps> | StatelessComponent<TProps>)\n+ >(\n+ BaseComponent: TComponent\n+ ): ComponentClass<TProps>;\n+\n+ export function routerNode<\n+ TProps extends {\n+ router?: Router,\n+ previousRoute?: State,\n+ route?: State,\n+ },\n+ TComponent extends (ComponentClass<TProps> | StatelessComponent<TProps>)\n+ >(\n+ nodeName: string\n+ ): (\n+ RouteSegment: TComponent\n+ ) => ComponentClass<TProps>;\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/react-router5/package.json",
"new_path": "packages/react-router5/package.json",
"diff": "},\n\"dependencies\": {\n\"prop-types\": \"~15.5.10\"\n- }\n+ },\n+ \"typings\": \"./index.d.ts\"\n}\n"
}
] | TypeScript | MIT License | router5/router5 | Add types for react-router5 |
580,263 | 22.10.2017 11:39:40 | -7,200 | d8c21da127cd194968081a2cb818ab40e2b7d4c8 | Add types for redux-router5 | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/redux-router5/index.d.ts",
"diff": "+declare module \"redux-router5\" {\n+ import { Router, Plugin, State, Route } from 'router5';\n+ import { Store, Middleware, Reducer, Dispatch, Action } from 'redux';\n+\n+ export function router5Middleware(router: Router): Middleware;\n+\n+ export interface RouterState {\n+ route: State | null;\n+ previousRoute: State | null;\n+ transitionRoute: State | null;\n+ transitionError: any | null;\n+ }\n+\n+ export const router5Reducer: Reducer<RouterState>;\n+\n+ export function reduxPlugin<TState extends RouterState>(dispatch: Dispatch<TState>): Plugin;\n+\n+ export function routeNodeSelector<TState extends RouterState>(routeNode: string, reducerKey?: string): (state: TState) => Route;\n+\n+ // #region actions\n+\n+ const NAVIGATE_TO = '@@router5/NAVIGATE';\n+ const CANCEL_TRANSITION = '@@router5/CANCEL';\n+ const TRANSITION_ERROR = '@@router5/TRANSITION_ERROR';\n+ const TRANSITION_SUCCESS = '@@router5/TRANSITION_SUCCESS';\n+ const TRANSITION_START = '@@router5/TRANSITION_START';\n+ const CLEAR_ERRORS = '@@router5/CLEAR_ERRORS';\n+ const CAN_DEACTIVATE = '@@router5/CAN_DEACTIVATE';\n+ const CAN_ACTIVATE = '@@router5/CAN_ACTIVATE';\n+\n+ export const actionTypes: {\n+ NAVIGATE_TO,\n+ CANCEL_TRANSITION,\n+ TRANSITION_ERROR,\n+ TRANSITION_SUCCESS,\n+ TRANSITION_START,\n+ CLEAR_ERRORS,\n+ CAN_DEACTIVATE,\n+ CAN_ACTIVATE,\n+ };\n+\n+ export interface ActionNavigateTo extends Action {\n+ type: typeof NAVIGATE_TO;\n+ payload: {\n+ name: string;\n+ params: any;\n+ opts: any;\n+ }\n+ }\n+\n+ export interface ActionCancelTransition extends Action {\n+ type: typeof CANCEL_TRANSITION;\n+ }\n+\n+ export interface ActionClearErrors extends Action {\n+ type: typeof CLEAR_ERRORS;\n+ }\n+\n+ export interface ActionTransitionStart extends Action {\n+ type: typeof TRANSITION_START;\n+ payload: {\n+ route: State;\n+ previousRoute: State;\n+ }\n+ }\n+\n+ export interface ActionTransitionSuccess extends Action {\n+ type: typeof TRANSITION_SUCCESS;\n+ payload: {\n+ route: State;\n+ previousRoute: State;\n+ }\n+ }\n+\n+ export interface ActionTransitionError extends Action {\n+ type: typeof TRANSITION_ERROR;\n+ payload: {\n+ route: State;\n+ previousRoute: State;\n+ transitionError: any;\n+ }\n+ }\n+\n+ export interface ActionCanActivate extends Action {\n+ type: typeof CAN_ACTIVATE;\n+ payload: {\n+ name: string;\n+ canActivate: boolean;\n+ }\n+ }\n+\n+ export interface ActionCanDeactivate extends Action {\n+ type: typeof CAN_DEACTIVATE;\n+ payload: {\n+ name: string;\n+ canDeactivate: boolean;\n+ }\n+ }\n+\n+ export const actions: {\n+ navigateTo(name: string, params?: any, opts?: any): ActionNavigateTo;\n+ cancelTransition(): ActionCancelTransition;\n+ clearErrors(): ActionClearErrors;\n+ transitionStart(route: State, previousRoute: State): ActionTransitionStart;\n+ transitionSuccess(route: State, previousRoute: State): ActionTransitionSuccess;\n+ transitionError(route: State, previousRoute: State, transitionError: any): ActionTransitionError;\n+ canActivate(name: string, canActivate: boolean): ActionCanActivate;\n+ canDeactivate(name: string, canDeactivate: boolean): ActionCanDeactivate;\n+ };\n+\n+ // #endregion\n+}\n+\n+declare module \"redux-router5/immutable/reducer\" {\n+ import { Reducer } from 'redux';\n+ import { RouterState } from 'redux-router5';\n+\n+ const router5Reducer: Reducer<RouterState>;\n+ export default router5Reducer;\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/redux-router5/package.json",
"new_path": "packages/redux-router5/package.json",
"diff": "},\n\"dependencies\": {\n\"router5-transition-path\": \"^5.0.0\"\n- }\n+ },\n+ \"typings\": \"./index.d.ts\"\n}\n"
}
] | TypeScript | MIT License | router5/router5 | Add types for redux-router5 |
580,263 | 22.10.2017 12:19:47 | -7,200 | e3c1cd24db074012b8f96aa89d437ee962c85c39 | Use Injected types | [
{
"change_type": "MODIFY",
"old_path": "packages/react-router5/index.d.ts",
"new_path": "packages/react-router5/index.d.ts",
"diff": "@@ -25,22 +25,26 @@ declare module \"react-router5\" {\nexport const Link: ComponentClass<LinkProps>;\n- export function withRoute<\n- TProps extends Partial<{\n+ export type InjectedRoute = Partial<{\nroute: State;\npreviousRoute: State;\n- }>,\n+ }>;\n+\n+ export function withRoute<\n+ TProps extends InjectedRoute,\nTComponent extends (ComponentClass<TProps> | StatelessComponent<TProps>)\n>(\nBaseComponent: TComponent\n): ComponentClass<TProps>;\n+ export type InjectedRouterNode = Partial<{\n+ router: Router,\n+ previousRoute: State,\n+ route: State,\n+ }>;\n+\nexport function routerNode<\n- TProps extends {\n- router?: Router,\n- previousRoute?: State,\n- route?: State,\n- },\n+ TProps extends InjectedRouterNode,\nTComponent extends (ComponentClass<TProps> | StatelessComponent<TProps>)\n>(\nnodeName: string\n"
}
] | TypeScript | MIT License | router5/router5 | Use Injected types |
580,272 | 27.10.2017 09:34:55 | -10,800 | 5bc1fa17759e9b4130fac24806d2f943309e6a35 | fix(ts): remove `?` from middleware `done` arg | [
{
"change_type": "MODIFY",
"old_path": "packages/router5/index.d.ts",
"new_path": "packages/router5/index.d.ts",
"diff": "@@ -56,7 +56,7 @@ declare module \"router5\" {\n}\nexport interface Middleware {\n- (toState: State, fromState: State, done?: Function): any;\n+ (toState: State, fromState: State, done: Function): any;\n}\nexport interface MiddlewareFactory {\n"
}
] | TypeScript | MIT License | router5/router5 | fix(ts): remove `?` from middleware `done` arg |
580,272 | 27.10.2017 10:00:39 | -10,800 | 4dd7a3a7a92c8d25a5b74dae02fa89f656ff94ad | Fix routeNodeSelector type | [
{
"change_type": "MODIFY",
"old_path": "packages/redux-router5/index.d.ts",
"new_path": "packages/redux-router5/index.d.ts",
"diff": "@@ -15,7 +15,7 @@ declare module \"redux-router5\" {\nexport function reduxPlugin<TState extends { router: RouterState }>(dispatch: Dispatch<TState>): Plugin;\n- export function routeNodeSelector<TState extends { router: RouterState }>(routeNode: string, reducerKey?: string): (state: TState) => Route;\n+ export function routeNodeSelector<TState extends { router: RouterState }>(routeNode: string, reducerKey?: string): (state: TState) => RouterState;\n// #region actions\n"
}
] | TypeScript | MIT License | router5/router5 | Fix routeNodeSelector type |
580,240 | 08.11.2017 01:51:58 | 21,600 | 12f188d201ced5dfe398445b5b5b2fa8a197470b | test(router5): add TypeScript examples | [
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"rollup-plugin-uglify\": \"~2.0.1\",\n\"sinon\": \"~2.3.4\",\n\"sinon-chai\": \"~2.11.0\",\n+ \"typescript\": \"^2.6.1\",\n+ \"typescript-definition-tester\": \"^0.0.5\",\n\"webpack\": \"~2.6.1\",\n\"webpack-dev-middleware\": \"~1.10.2\",\n\"webpack-dev-server\": \"~2.4.5\",\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5/test/index.js",
"new_path": "packages/router5/test/index.js",
"diff": "import { expect } from 'chai';\nimport createTestRouter from './_create-router';\nimport { spy } from 'sinon';\n+import tt from 'typescript-definition-tester';\ndescribe('router5', function() {\nlet router;\n@@ -24,3 +25,14 @@ describe('router5', function() {\nexpect(mware).to.have.been.calledWith(router, { a, b });\n});\n});\n+\n+describe('TypeScript definitions', function() {\n+ it('should compile examples against index.d.ts', function(done) {\n+ tt.compileDirectory(\n+ `${__dirname}/typescript`,\n+ filename => filename.match(/\\.ts$/),\n+ { lib: ['lib.es2015.d.ts'] },\n+ () => done()\n+ );\n+ });\n+});\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5/test/typescript/constants.ts",
"diff": "+/// <reference path=\"../../index.d.ts\" />\n+\n+import { constants, errorCodes } from \"router5\";\n+\n+let c: string;\n+\n+c = constants.UNKNOWN_ROUTE;\n+c = constants.ROUTER_START;\n+c = constants.ROUTER_STOP;\n+c = constants.TRANSITION_START;\n+c = constants.TRANSITION_CANCEL;\n+c = constants.TRANSITION_SUCCESS;\n+c = constants.TRANSITION_ERROR;\n+\n+c = errorCodes.ROUTER_NOT_STARTED;\n+c = errorCodes.NO_START_PATH_OR_STATE;\n+c = errorCodes.ROUTER_ALREADY_STARTED;\n+c = errorCodes.ROUTE_NOT_FOUND;\n+c = errorCodes.SAME_STATES;\n+c = errorCodes.CANNOT_DEACTIVATE;\n+c = errorCodes.CANNOT_ACTIVATE;\n+c = errorCodes.TRANSITION_ERR;\n+c = errorCodes.TRANSITION_CANCELLED;\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5/test/typescript/core/clone.ts",
"diff": "+/// <reference path=\"../../../index.d.ts\" />\n+\n+import createRouter from \"router5\";\n+\n+let router = createRouter([]);\n+\n+router = router.clone({});\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5/test/typescript/core/middleware.ts",
"diff": "+/// <reference path=\"../../../index.d.ts\" />\n+\n+import createRouter, { Router, State } from \"router5\";\n+\n+let router = createRouter([]);\n+\n+const middleware1 = () => () => true;\n+const middleware2 = () => () => Promise.resolve(true);\n+const middleware3 = (_r: Router) => (_to: State, _from: State, done: Function) => {\n+ done();\n+};\n+\n+router = router.useMiddleware(middleware1, middleware2, middleware3);\n+\n+router = router.clearMiddleware();\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5/test/typescript/core/navigation.ts",
"diff": "+/// <reference path=\"../../../index.d.ts\" />\n+\n+import createRouter from \"router5\";\n+\n+const router = createRouter([]);\n+\n+router.cancel();\n+\n+router.forward(\"/\", \"home\");\n+\n+router.navigate(\"/home\", { lang: \"en\" }, { replace: true }, () => true);\n+router.navigate(\"/home\", { lang: \"en\" }, { replace: true });\n+router.navigate(\"/home\", { lang: \"en\" });\n+router.navigate(\"/home\", () => true);\n+router.navigate(\"/home\");\n+\n+router.navigateToDefault({ replace: true }, () => true);\n+router.navigateToDefault();\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5/test/typescript/core/plugins.ts",
"diff": "+/// <reference path=\"../../../index.d.ts\" />\n+\n+import createRouter, { Plugin, PluginFactory, Router } from \"router5\";\n+\n+const noopPluginFactory: PluginFactory = Object.assign(\n+ (router: Router): Plugin => {\n+ return {\n+ onStart() {},\n+ onStop() {},\n+ onTransitionStart() {},\n+ onTransitionCancel() {},\n+ onTransitionError() {},\n+ onTransitionSuccess() {},\n+ };\n+ },\n+ { pluginName: \"NOOP_PLUGIN\" },\n+);\n+\n+let router = createRouter([]);\n+\n+router = router.usePlugin();\n+router = router.usePlugin(noopPluginFactory);\n+router = router.usePlugin(noopPluginFactory, noopPluginFactory);\n+\n+const _: boolean = router.hasPlugin(\"NOOP_PLUGIN\");\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5/test/typescript/core/route-lifecycle.ts",
"diff": "+/// <reference path=\"../../../index.d.ts\" />\n+\n+import createRouter, { Router, State } from \"router5\";\n+\n+let router = createRouter([]);\n+\n+const handler1 = () => () => true;\n+const handler2 = () => () => Promise.resolve(true);\n+\n+router = router.canDeactivate(\"users.list\", handler1);\n+router = router.canDeactivate(\"users.list\", handler2);\n+router = router.canDeactivate(\"users.list\", true);\n+\n+router = router.canActivate(\"users.list\", handler1);\n+router = router.canActivate(\"users.list\", handler2);\n+router = router.canActivate(\"users.list\", true);\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5/test/typescript/core/router-lifecycle.ts",
"diff": "+/// <reference path=\"../../../index.d.ts\" />\n+\n+import createRouter from \"router5\";\n+\n+let router = createRouter([]);\n+\n+const _: boolean = router.isStarted();\n+\n+router = router.start(\"\", () => {});\n+router = router.start(\"\");\n+router = router.start();\n+\n+router = router.stop();\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5/test/typescript/core/utils.ts",
"diff": "+/// <reference path=\"../../../index.d.ts\" />\n+\n+import createRouter, { State } from \"router5\";\n+\n+let res: Boolean;\n+\n+const router = createRouter([]);\n+const state = router.getState();\n+\n+res = router.isActive(\"users.show\", { id: 1 }, true, false);\n+res = router.isActive(\"users.show\", { id: 1 }, true);\n+res = router.isActive(\"users.show\", { id: 1 });\n+res = router.isActive(\"users.show\");\n+\n+res = router.areStatesEqual(state, state, false);\n+res = router.areStatesEqual(state, state);\n+\n+res = router.areStatesDescendants(state, state);\n+\n+const _p: string = router.buildPath(\"users.show\", { id: 1 });\n+\n+let s: State | null;\n+s = router.matchPath(\"/users\", \"popstate\");\n+s = router.matchPath(\"/users\");\n+\n+router.setRootPath(\"/\");\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5/test/typescript/create-router.ts",
"diff": "+/// <reference path=\"../../index.d.ts\" />\n+\n+import createRouter, { Route, Router, RouterOptions, State } from \"router5\";\n+\n+const routes: Route[] = [\n+ { name: \"home\", path: \"/\" },\n+ { name: \"users\", path: \"/users/:id\" },\n+];\n+\n+const options: RouterOptions = {\n+ defaultRoute: \"home\",\n+ defaultParams: { lang: \"en\" },\n+ trailingSlash: false,\n+ useTrailingSlash: false,\n+ autoCleanUp: true,\n+ strictQueryParams: true,\n+ allowNotFound: true,\n+};\n+\n+const deps = { store: {} };\n+\n+const router = createRouter([]);\n+\n+let r: Router;\n+r = createRouter(routes);\n+r = createRouter(routes, options);\n+r = createRouter(routes, { trailingSlash: true, strictQueryParams: true });\n+r = createRouter(routes, options, deps);\n+\n+let s: State;\n+s = router.makeState(\"home\", {}, \"/\");\n+s = router.makeState(\"home\", {}, \"/\", {});\n+s = router.makeState(\"home\", {}, \"/\", {}, \"\");\n+\n+s = router.makeNotFoundState(\"/\");\n+\n+s = router.getState();\n+\n+router.setState(s);\n+\n+const _o: RouterOptions = router.getOptions();\n+\n+r = router.setOption(\"defaultRoute\", \"home\");\n+r = router.setOption(\"defaultParams\", { lang: \"en\" });\n+r = router.setOption(\"strictQueryParams\", true);\n+\n+r = router.setDependency(\"store\", {});\n+r = router.setDependency(\"counter\", 0);\n+r = router.setDependency(\"foo\", \"bar\");\n+\n+r = router.setDependencies(deps);\n+\n+const _d: object = router.getDependencies();\n+\n+r = router.add(routes);\n+\n+router.addNode(\"home\", \"/\");\n+router.addNode(\"home\", \"/\", () => () => true);\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5/test/typescript/plugins/browser.ts",
"diff": "+/// <reference path=\"../../../index.d.ts\" />\n+\n+import createRouter, { State } from \"router5\";\n+import browserPlugin from \"router5/plugins/browser\";\n+\n+const router = createRouter([]);\n+router.usePlugin(browserPlugin({}));\n+\n+const options = {\n+ forceDeactivate: true,\n+ useHash: false,\n+ hashPrefix: \"\",\n+ base: \"\",\n+ mergeState: false,\n+ preserveHash: true,\n+};\n+\n+browserPlugin({});\n+browserPlugin(options);\n+browserPlugin({ useHash: true });\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5/test/typescript/plugins/listeners.ts",
"diff": "+/// <reference path=\"../../../index.d.ts\" />\n+\n+import createRouter from \"router5\";\n+import listenersPlugin from \"router5/plugins/listeners\";\n+\n+const router = createRouter([]);\n+router.usePlugin(listenersPlugin());\n+\n+const options = {\n+ autoCleanUp: true,\n+};\n+\n+listenersPlugin();\n+listenersPlugin(options);\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5/test/typescript/plugins/loggers.ts",
"diff": "+/// <reference path=\"../../../index.d.ts\" />\n+\n+import createRouter, { loggerPlugin } from \"router5\";\n+\n+const router = createRouter([]);\n+router.usePlugin(loggerPlugin);\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5/test/typescript/plugins/persistentParams.ts",
"diff": "+/// <reference path=\"../../../index.d.ts\" />\n+\n+import createRouter from \"router5\";\n+import persistentParamsPluginFactory from \"router5/plugins/persistentParams\";\n+\n+const router = createRouter([]);\n+router.usePlugin(persistentParamsPluginFactory());\n+\n+persistentParamsPluginFactory([\"id\"]);\n+persistentParamsPluginFactory({ id: 1 });\n+persistentParamsPluginFactory();\n"
},
{
"change_type": "MODIFY",
"old_path": "yarn.lock",
"new_path": "yarn.lock",
"diff": "@@ -868,7 +868,7 @@ [email protected]:\ndependencies:\nhoek \"2.x.x\"\n-brace-expansion@^1.1.7:\n+brace-expansion@^1.0.0, brace-expansion@^1.1.7:\nversion \"1.1.8\"\nresolved \"https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292\"\ndependencies:\n@@ -1693,6 +1693,13 @@ destroy@~1.0.4:\nversion \"1.0.4\"\nresolved \"https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80\"\n+detect-indent@^0.2.0:\n+ version \"0.2.0\"\n+ resolved \"https://registry.yarnpkg.com/detect-indent/-/detect-indent-0.2.0.tgz#042914498979ac2d9f3c73e4ff3e6877d3bc92b6\"\n+ dependencies:\n+ get-stdin \"^0.1.0\"\n+ minimist \"^0.1.0\"\n+\ndetect-indent@^4.0.0:\nversion \"4.0.0\"\nresolved \"https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208\"\n@@ -1782,6 +1789,14 @@ dot-prop@^3.0.0:\ndependencies:\nis-obj \"^1.0.0\"\n+dts-bundle@^0.2.0:\n+ version \"0.2.0\"\n+ resolved \"https://registry.yarnpkg.com/dts-bundle/-/dts-bundle-0.2.0.tgz#e165e494b00f81a3b6eb64385cbf6d1b486b7a99\"\n+ dependencies:\n+ detect-indent \"^0.2.0\"\n+ glob \"^4.0.2\"\n+ mkdirp \"^0.5.0\"\n+\nduplexer@^0.1.1:\nversion \"0.1.1\"\nresolved \"https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1\"\n@@ -2389,6 +2404,10 @@ get-port@^3.1.0:\nversion \"3.1.0\"\nresolved \"https://registry.yarnpkg.com/get-port/-/get-port-3.1.0.tgz#ef01b18a84ca6486970ff99e54446141a73ffd3e\"\n+get-stdin@^0.1.0:\n+ version \"0.1.0\"\n+ resolved \"https://registry.yarnpkg.com/get-stdin/-/get-stdin-0.1.0.tgz#5998af24aafc802d15c82c685657eeb8b10d4a91\"\n+\nget-stdin@^4.0.1:\nversion \"4.0.1\"\nresolved \"https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe\"\n@@ -2468,6 +2487,15 @@ [email protected]:\nonce \"^1.3.0\"\npath-is-absolute \"^1.0.0\"\n+glob@^4.0.2:\n+ version \"4.5.3\"\n+ resolved \"https://registry.yarnpkg.com/glob/-/glob-4.5.3.tgz#c6cb73d3226c1efef04de3c56d012f03377ee15f\"\n+ dependencies:\n+ inflight \"^1.0.4\"\n+ inherits \"2\"\n+ minimatch \"^2.0.1\"\n+ once \"^1.3.0\"\n+\nglob@^5.0.15:\nversion \"5.0.15\"\nresolved \"https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1\"\n@@ -3541,6 +3569,10 @@ lodash.templatesettings@^4.0.0:\ndependencies:\nlodash._reinterpolate \"~3.0.0\"\n+lodash@^3.6.0:\n+ version \"3.10.1\"\n+ resolved \"https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6\"\n+\nlodash@^4.0.0, lodash@^4.1.0, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.17.2, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0:\nversion \"4.17.4\"\nresolved \"https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae\"\n@@ -3711,6 +3743,12 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1:\ndependencies:\nbrace-expansion \"^1.1.7\"\n+minimatch@^2.0.1:\n+ version \"2.0.10\"\n+ resolved \"https://registry.yarnpkg.com/minimatch/-/minimatch-2.0.10.tgz#8d087c39c6b38c001b97fca7ce6d0e1e80afbac7\"\n+ dependencies:\n+ brace-expansion \"^1.0.0\"\n+\[email protected], minimist@~0.0.1:\nversion \"0.0.8\"\nresolved \"https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d\"\n@@ -5381,6 +5419,18 @@ typedarray@^0.0.6:\nversion \"0.0.6\"\nresolved \"https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777\"\n+typescript-definition-tester@^0.0.5:\n+ version \"0.0.5\"\n+ resolved \"https://registry.yarnpkg.com/typescript-definition-tester/-/typescript-definition-tester-0.0.5.tgz#91c574d78ea05b81ed81244d50ec30d8240c356f\"\n+ dependencies:\n+ assertion-error \"^1.0.1\"\n+ dts-bundle \"^0.2.0\"\n+ lodash \"^3.6.0\"\n+\n+typescript@^2.6.1:\n+ version \"2.6.1\"\n+ resolved \"https://registry.yarnpkg.com/typescript/-/typescript-2.6.1.tgz#ef39cdea27abac0b500242d6726ab90e0c846631\"\n+\nua-parser-js@^0.7.9:\nversion \"0.7.13\"\nresolved \"https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.13.tgz#cd9dd2f86493b3f44dbeeef3780fda74c5ee14be\"\n"
}
] | TypeScript | MIT License | router5/router5 | test(router5): add TypeScript examples |
580,240 | 08.11.2017 02:41:37 | 21,600 | f2b1aee695a4850a19245b1856a520ce48a78e29 | fix(redux-router5): return type of reduxPlugin | [
{
"change_type": "MODIFY",
"old_path": "packages/redux-router5/index.d.ts",
"new_path": "packages/redux-router5/index.d.ts",
"diff": "declare module \"redux-router5\" {\n- import { Router, Plugin, State, Route } from 'router5';\n+ import { Router, PluginFactory, State, Route } from 'router5';\nimport { Store, Middleware, Reducer, Dispatch, Action } from 'redux';\nexport function router5Middleware(router: Router): Middleware;\n@@ -13,7 +13,7 @@ declare module \"redux-router5\" {\nexport const router5Reducer: Reducer<RouterState>;\n- export function reduxPlugin<TState extends { router: RouterState }>(dispatch: Dispatch<TState>): Plugin;\n+ export function reduxPlugin<TState extends { router: RouterState }>(dispatch: Dispatch<TState>): PluginFactory;\nexport function routeNodeSelector<TState extends { router: RouterState }>(routeNode: string, reducerKey?: string): (state: TState) => RouterState;\n"
}
] | TypeScript | MIT License | router5/router5 | fix(redux-router5): return type of reduxPlugin |
580,249 | 08.11.2017 09:19:48 | 0 | b35cafad2386befff283d01f25f397f8042c3239 | chore: update route-node (path-parser) to latest version | [
{
"change_type": "MODIFY",
"old_path": "packages/router5/package.json",
"new_path": "packages/router5/package.json",
"diff": "},\n\"homepage\": \"http://router5.github.io\",\n\"dependencies\": {\n- \"route-node\": \"1.10.0\",\n+ \"route-node\": \"1.11.0\",\n\"router5-transition-path\": \"5.0.0\"\n},\n\"typings\": \"./index.d.ts\"\n"
}
] | TypeScript | MIT License | router5/router5 | chore: update route-node (path-parser) to latest version |
580,272 | 09.11.2017 11:19:50 | -10,800 | 80d1f48843ac2b77c0453aee44bbb6c462510cc1 | fix(ts): don't swallow types in HOCs | [
{
"change_type": "MODIFY",
"old_path": "packages/react-router5/index.d.ts",
"new_path": "packages/react-router5/index.d.ts",
"diff": "declare module \"react-router5\" {\n- import { ComponentClass, MouseEventHandler, StatelessComponent, HTMLAttributes } from 'react';\n+ import { ComponentClass, ComponentType, MouseEventHandler, HTMLAttributes } from 'react';\nimport { Router, Route, State } from 'router5';\n+ type Diff<T extends string, U extends string> = ({[P in T]: P} &\n+ {[P in U]: never} & { [x: string]: never })[T]\n+\n+ type Omit<InputObject, Keys extends keyof InputObject> = Pick<\n+ InputObject,\n+ Diff<keyof InputObject, Keys>\n+ >\n+\nexport interface RouterProviderProps {\nrouter: Router;\n}\n@@ -30,12 +38,13 @@ declare module \"react-router5\" {\npreviousRoute: State;\n}>;\n- export function withRoute<\n- TProps extends InjectedRoute,\n- TComponent extends (ComponentClass<TProps> | StatelessComponent<TProps>)\n- >(\n- BaseComponent: TComponent\n- ): ComponentClass<TProps>;\n+ export function withRoute<TProps extends InjectedRoute>(\n+ BaseComponent: ComponentType<TProps>\n+ ):\n+ ComponentClass<Omit<\n+ TProps,\n+ keyof InjectedRoute\n+ >>;\nexport type InjectedRouterNode = Partial<{\nrouter: Router,\n@@ -43,12 +52,11 @@ declare module \"react-router5\" {\nroute: State,\n}>;\n- export function routerNode<\n- TProps extends InjectedRouterNode,\n- TComponent extends (ComponentClass<TProps> | StatelessComponent<TProps>)\n- >(\n+ export function routerNode<TProps extends InjectedRouterNode>(\nnodeName: string\n- ): (\n- RouteSegment: TComponent\n- ) => ComponentClass<TProps>;\n+ ): (RouteSegment: ComponentType<TProps>) =>\n+ ComponentClass<Omit<\n+ TProps,\n+ keyof InjectedRouterNode\n+ >>;\n}\n"
}
] | TypeScript | MIT License | router5/router5 | fix(ts): don't swallow types in HOCs |
580,272 | 09.11.2017 14:17:14 | -10,800 | b6736c6e696448d51e67008f4f4d64884b5f4714 | Add prettier to `npm run check` | [
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"build:umd\": \"rollup -c rollup.config.js\",\n\"test\": \"mocha --compilers js:babel-core/register --require test-helper.js --recursive 'packages/*/test/**/*.js'\",\n\"lint\": \"eslint packages/*/modules\",\n- \"check\": \"yarn run lint && yarn run test\",\n- \"format\": \"prettier\",\n+ \"format\": \"prettier --tab-width 4 --single-quote 'packages/**/*.js'\",\n+ \"check\": \"yarn run lint && yarn run test && yarn run format -- --list-different\",\n\"precommit\": \"lint-staged\",\n\"changelog\": \"lerna-changelog\",\n\"docs:start\": \"node packages/docs/scripts/start\",\n"
}
] | TypeScript | MIT License | router5/router5 | Add prettier to `npm run check` |
580,272 | 09.11.2017 14:27:43 | -10,800 | 2331ba71902d626ce70a253f7782e58056e1c902 | Move prettier options to .prettierrc | [
{
"change_type": "ADD",
"old_path": null,
"new_path": ".prettierrc",
"diff": "+{\n+ \"tabWidth\": 4,\n+ \"singleQuote\": true\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"build:umd\": \"rollup -c rollup.config.js\",\n\"test\": \"mocha --compilers js:babel-core/register --require test-helper.js --recursive 'packages/*/test/**/*.js'\",\n\"lint\": \"eslint packages/*/modules\",\n- \"format\": \"prettier --tab-width 4 --single-quote 'packages/**/*.js'\",\n+ \"format\": \"prettier 'packages/**/*.js'\",\n\"check\": \"yarn run lint && yarn run test && yarn run format -- --list-different\",\n\"precommit\": \"lint-staged\",\n\"changelog\": \"lerna-changelog\",\n},\n\"lint-staged\": {\n\"packages/**/*.js\": [\n- \"prettier --tab-width 4 --single-quote --write\",\n+ \"prettier --write\",\n\"git add\"\n]\n},\n"
}
] | TypeScript | MIT License | router5/router5 | Move prettier options to .prettierrc |
580,272 | 09.11.2017 14:56:11 | -10,800 | ca2daed7279fe541e244bc50d9e262df6734330e | Run prettier on TypeScript also | [
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"build:umd\": \"rollup -c rollup.config.js\",\n\"test\": \"mocha --compilers js:babel-core/register --require test-helper.js --recursive 'packages/*/test/**/*.js'\",\n\"lint\": \"eslint packages/*/modules\",\n- \"format\": \"prettier 'packages/**/*.js'\",\n+ \"format\": \"prettier 'packages/**/*.{js,ts}'\",\n\"check\": \"yarn run lint && yarn run test && yarn run format -- --list-different\",\n\"precommit\": \"lint-staged\",\n\"changelog\": \"lerna-changelog\",\n\"release\": \"git pull --rebase && npm run build && npm run copy && lerna publish\"\n},\n\"lint-staged\": {\n- \"packages/**/*.js\": [\n+ \"packages/**/*.{js,ts}\": [\n\"prettier --write\",\n\"git add\"\n]\n"
}
] | TypeScript | MIT License | router5/router5 | Run prettier on TypeScript also |
580,272 | 09.11.2017 14:23:20 | -10,800 | d9bf27fb127aa96ff6a100cca0d68231a900ab1f | Remove second `export default` | [
{
"change_type": "MODIFY",
"old_path": "packages/examples/apps/react-redux/components/Message.js",
"new_path": "packages/examples/apps/react-redux/components/Message.js",
"diff": "@@ -8,7 +8,7 @@ function mapStateToProps(state, props) {\n};\n}\n-export default function Message(props) {\n+function Message(props) {\nconst { mailTitle, mailMessage } = props.email;\nreturn (\n"
}
] | TypeScript | MIT License | router5/router5 | Remove second `export default` |
580,272 | 10.11.2017 14:28:54 | -10,800 | 310134f9ca705efb4ca97d2196e1ddd480bb2229 | Check for ESLint rules conflicting with prettier | [
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"build:umd\": \"rollup -c rollup.config.js\",\n\"test\": \"mocha --compilers js:babel-core/register --require test-helper.js --recursive 'packages/*/test/**/*.js'\",\n\"lint\": \"eslint packages/*/modules\",\n+ \"lint:check-conflicts\": \"eslint --print-config .eslintrc | eslint-config-prettier-check\",\n\"format\": \"prettier 'packages/**/*.{js,ts}'\",\n- \"check\": \"yarn run lint && yarn run test && yarn run format -- --list-different\",\n+ \"check\": \"yarn run lint:check-conflicts && yarn run lint && yarn run test && yarn run format -- --list-different\",\n\"precommit\": \"lint-staged\",\n\"changelog\": \"lerna-changelog\",\n\"docs:start\": \"node packages/docs/scripts/start\",\n\"coveralls\": \"~2.13.1\",\n\"enzyme\": \"~2.8.2\",\n\"eslint\": \"~4.0.0\",\n+ \"eslint-config-prettier\": \"^2.7.0\",\n\"eslint-plugin-react\": \"~7.1.0\",\n\"express\": \"~4.15.3\",\n\"html-loader\": \"~0.4.5\",\n"
},
{
"change_type": "MODIFY",
"old_path": "yarn.lock",
"new_path": "yarn.lock",
"diff": "@@ -1928,6 +1928,12 @@ [email protected], escodegen@^1.6.1:\noptionalDependencies:\nsource-map \"~0.2.0\"\n+eslint-config-prettier@^2.7.0:\n+ version \"2.7.0\"\n+ resolved \"https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-2.7.0.tgz#7bbfef66ad783277836f4ea556e68b9bcc9da4d0\"\n+ dependencies:\n+ get-stdin \"^5.0.1\"\n+\neslint-plugin-react@~7.1.0:\nversion \"7.1.0\"\nresolved \"https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.1.0.tgz#27770acf39f5fd49cd0af4083ce58104eb390d4c\"\n@@ -2412,6 +2418,10 @@ get-stdin@^4.0.1:\nversion \"4.0.1\"\nresolved \"https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe\"\n+get-stdin@^5.0.1:\n+ version \"5.0.1\"\n+ resolved \"https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398\"\n+\nget-stream@^2.2.0:\nversion \"2.3.1\"\nresolved \"https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de\"\n"
}
] | TypeScript | MIT License | router5/router5 | Check for ESLint rules conflicting with prettier |
580,272 | 10.11.2017 14:31:49 | -10,800 | 91fd1324319292c17b7a12871cd0a77d0c0bb9ab | Disable conflicting rules | [
{
"change_type": "MODIFY",
"old_path": ".eslintrc",
"new_path": ".eslintrc",
"diff": "\"no-unused-vars\": 2,\n\"no-use-before-define\": 0,\n// Style\n- \"brace-style\": [2, \"1tbs\"],\n- \"comma-spacing\": [2, {\"before\": false, \"after\": true}],\n- \"comma-style\": [2, \"last\"],\n\"consistent-this\": [2, \"that\"],\n- \"lines-around-comment\": [2, {\"allowBlockStart\": true}],\n\"key-spacing\": 0,\n\"new-parens\": 0,\n- \"quotes\": [2, \"single\", \"avoid-escape\"],\n+ \"no-extra-semi\": 0,\n+ \"no-mixed-spaces-and-tabs\": 0,\n\"no-underscore-dangle\": 0,\n\"no-unneeded-ternary\": 2,\n- \"semi\": 2,\n// ES6\n\"no-var\": 2,\n\"no-this-before-super\": 2,\n"
}
] | TypeScript | MIT License | router5/router5 | Disable conflicting rules |
580,272 | 10.11.2017 14:59:58 | -10,800 | 241f46b782e6414c8d4772d27b9f89dfc9f00597 | fix(ts): withRoute also injects `router` prop | [
{
"change_type": "MODIFY",
"old_path": "packages/react-router5/index.d.ts",
"new_path": "packages/react-router5/index.d.ts",
"diff": "@@ -38,6 +38,7 @@ declare module 'react-router5' {\nexport const Link: ComponentClass<LinkProps>\nexport type InjectedRoute = Partial<{\n+ router: Router\nroute: State\npreviousRoute: State\n}>\n"
}
] | TypeScript | MIT License | router5/router5 | fix(ts): withRoute also injects `router` prop |
580,272 | 14.11.2017 19:28:38 | -10,800 | cde34f378a9b4b70cfb7579d2a175467c77a16a2 | fix(ts): move Partial in injected props | [
{
"change_type": "MODIFY",
"old_path": "packages/react-router5/index.d.ts",
"new_path": "packages/react-router5/index.d.ts",
"diff": "@@ -37,23 +37,23 @@ declare module 'react-router5' {\nexport const Link: ComponentClass<LinkProps>\n- export type InjectedRoute = Partial<{\n+ export type InjectedRoute = {\nrouter: Router\n- route: State\n- previousRoute: State\n- }>\n+ route: State | null\n+ previousRoute: State | null\n+ }\n- export function withRoute<TProps extends InjectedRoute>(\n+ export function withRoute<TProps extends Partial<InjectedRoute>>(\nBaseComponent: ComponentType<TProps>\n): ComponentClass<Omit<TProps, keyof InjectedRoute>>\n- export type InjectedRouterNode = Partial<{\n+ export type InjectedRouterNode = {\nrouter: Router\n- previousRoute: State\n- route: State\n- }>\n+ previousRoute: State | null\n+ route: State | null\n+ }\n- export function routerNode<TProps extends InjectedRouterNode>(\n+ export function routerNode<TProps extends Partial<InjectedRouterNode>>(\nnodeName: string\n): (\nRouteSegment: ComponentType<TProps>\n"
}
] | TypeScript | MIT License | router5/router5 | fix(ts): move Partial in injected props |
580,249 | 15.11.2017 09:05:54 | 0 | a19d885270b1c7a18df6c362d77afc0b774582fc | chore: update change log and dist | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "+## 2017-11-15\n+\n+#### Enhancement\n+* `react-router5`\n+ * [#224](https://github.com/router5/router5/pull/224) Fix HOC types. ([@faergeek](https://github.com/faergeek))\n+* `deku-router5`, `examples`, `react-router5`, `redux-router5`, `router5-helpers`, `router5-transition-path`, `router5`, `rxjs-router5`, `xstream-router5`\n+ * [#223](https://github.com/router5/router5/pull/223) Prettier tweaks. ([@faergeek](https://github.com/faergeek))\n+\n+#### Committers: 1\n+- Sergey Slipchenko ([faergeek](https://github.com/faergeek))\n+\n+\n+\n## [email protected] (2017-11-09)\n#### Bug fix\n"
},
{
"change_type": "MODIFY",
"old_path": "dist/router5.js",
"new_path": "dist/router5.js",
"diff": "@@ -2007,7 +2007,6 @@ var defaultOptions = {\nstrictQueryParams: false,\nallowNotFound: false,\nstrongMatching: true\n-};\n/**\n* Create a router\n@@ -2016,7 +2015,7 @@ var defaultOptions = {\n* @param {Object} [dependencies={}] The router dependencies\n* @return {Object} The router instance\n*/\n-function createRouter$1(routes) {\n+};function createRouter$1(routes) {\nvar opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\nvar deps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n@@ -2047,7 +2046,6 @@ function createRouter$1(routes) {\naddEventListener: addEventListener,\nremoveEventListener: removeEventListener,\ninvokeEventListeners: invokeEventListeners\n- };\n/**\n* Invoke all event listeners by event name. Possible event names are listed under constants\n@@ -2059,7 +2057,7 @@ function createRouter$1(routes) {\n* @name invokeEventListeners\n* @param {String} eventName The event name\n*/\n- function invokeEventListeners(eventName) {\n+ };function invokeEventListeners(eventName) {\nfor (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\nargs[_key - 1] = arguments[_key];\n}\n"
}
] | TypeScript | MIT License | router5/router5 | chore: update change log and dist |
580,249 | 16.11.2017 11:07:02 | 0 | a8293b29fb4e5ebec1f54a8810bce6dd3433c84a | chore: update route-node dependency | [
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"webpack-dev-middleware\": \"~1.10.2\",\n\"webpack-dev-server\": \"~2.4.5\",\n\"yargs\": \"~8.0.1\"\n+ },\n+ \"dependencies\": {\n+ \"rollup-plugin-alias\": \"~1.4.0\"\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5/package.json",
"new_path": "packages/router5/package.json",
"diff": "\"description\": \"A simple, powerful, view-agnostic, modular and extensible router\",\n\"main\": \"index.js\",\n\"jsnext:main\": \"dist/es/index.js\",\n+ \"module\": \"dist/es/index.js\",\n\"scripts\": {\n\"test:cover\": \"babel-node node_modules/.bin/isparta cover node_modules/.bin/_mocha -- --recursive --require ./test/_helpers.js 'test/**/*.js'\"\n},\n},\n\"homepage\": \"http://router5.github.io\",\n\"dependencies\": {\n- \"route-node\": \"1.11.0\",\n+ \"route-node\": \"2.0.2\",\n\"router5-transition-path\": \"^5.0.1\"\n},\n\"typings\": \"./index.d.ts\"\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5/yarn.lock",
"new_path": "packages/router5/yarn.lock",
"diff": "# yarn lockfile v1\[email protected]:\n- version \"2.1.0\"\n- resolved \"https://registry.yarnpkg.com/path-parser/-/path-parser-2.1.0.tgz#bf7b9335ea59ef0add7145faf6807dafb995a696\"\[email protected]:\n+ version \"3.0.1\"\n+ resolved \"https://registry.yarnpkg.com/path-parser/-/path-parser-3.0.1.tgz#90abf7d98af74b1f7da6d312786591a51c887619\"\ndependencies:\nsearch-params \"~1.3.0\"\[email protected]:\n- version \"1.11.0\"\n- resolved \"https://registry.yarnpkg.com/route-node/-/route-node-1.11.0.tgz#cae4f8282da2069e8183d938eb34f2ce1f4a45e1\"\[email protected]:\n+ version \"2.0.2\"\n+ resolved \"https://registry.yarnpkg.com/route-node/-/route-node-2.0.2.tgz#5c25ed023a1d54b8c4150f654ef55f986ebf0883\"\ndependencies:\n- path-parser \"2.1.0\"\n+ path-parser \"3.0.1\"\nsearch-params \"~1.3.0\"\nsearch-params@~1.3.0:\n"
},
{
"change_type": "MODIFY",
"old_path": "rollup.config.js",
"new_path": "rollup.config.js",
"diff": "import babel from 'rollup-plugin-babel';\nimport uglify from 'rollup-plugin-uglify';\nimport nodeResolve from 'rollup-plugin-node-resolve';\n+import alias from 'rollup-plugin-alias';\nimport common from 'rollup-plugin-commonjs';\nconst babelOptions = {\n@@ -38,6 +39,10 @@ const modulesToBuild = Object.keys(modules).reduce((acc, moduleName) => {\nconst plugins = [\ncommon({ include: `packages/${packageDir}/node_modules/**` }),\nbabel(babelOptions),\n+ alias({\n+ 'path-parser': 'packages/router5/node_modules/path-parser/modules/Path.js',\n+ 'route-node': 'packages/router5/node_modules/route-node/modules/RouteNode.js',\n+ }),\nnodeResolve({ jsnext: true })\n];\n"
},
{
"change_type": "MODIFY",
"old_path": "yarn.lock",
"new_path": "yarn.lock",
"diff": "@@ -4779,6 +4779,12 @@ ripemd160@^2.0.0, ripemd160@^2.0.1:\nhash-base \"^2.0.0\"\ninherits \"^2.0.1\"\n+rollup-plugin-alias@~1.4.0:\n+ version \"1.4.0\"\n+ resolved \"https://registry.yarnpkg.com/rollup-plugin-alias/-/rollup-plugin-alias-1.4.0.tgz#120cba7c46621c03138f0ca6fd5dd2ade9872db9\"\n+ dependencies:\n+ slash \"^1.0.0\"\n+\nrollup-plugin-babel@~2.7.1:\nversion \"2.7.1\"\nresolved \"https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-2.7.1.tgz#16528197b0f938a1536f44683c7a93d573182f57\"\n"
}
] | TypeScript | MIT License | router5/router5 | chore: update route-node dependency |
580,249 | 16.11.2017 11:26:51 | 0 | 3fb94ff1796e872ad30474937aba4159937e4cdc | chore: configure packages with jsnext:main as well as module | [
{
"change_type": "MODIFY",
"old_path": "packages/react-router5/package.json",
"new_path": "packages/react-router5/package.json",
"diff": "\"description\": \"router5 helpers for React\",\n\"main\": \"dist/commonjs/index.js\",\n\"jsnext:main\": \"dist/es/index.js\",\n+ \"module\": \"dist/es/index.js\",\n\"repository\": {\n\"type\": \"git\",\n\"url\": \"https://github.com/router5/router5.git\"\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/redux-router5/package.json",
"new_path": "packages/redux-router5/package.json",
"diff": "\"main\": \"index.js\",\n\"module\": \"dist/es/index.js\",\n\"jnext:main\": \"dist/es/index.js\",\n+ \"module\": \"dist/es/index.js\",\n\"repository\": {\n\"type\": \"git\",\n\"url\": \"https://github.com/router5/router5.git\"\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5-helpers/package.json",
"new_path": "packages/router5-helpers/package.json",
"diff": "\"version\": \"5.0.1\",\n\"description\": \"Router5 helpers for comparing and checking routes\",\n\"main\": \"dist/commonjs/index.js\",\n+ \"jsnext:main\": \"dist/es/index.js\",\n+ \"module\": \"dist/es/index.js\",\n\"repository\": {\n\"type\": \"git\",\n\"url\": \"git+https://github.com/router5/router5.git\"\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5-transition-path/package.json",
"new_path": "packages/router5-transition-path/package.json",
"diff": "\"description\": \"Router5 transition path helper function\",\n\"main\": \"dist/commonjs/index.js\",\n\"jsnext:main\": \"dist/es/index.js\",\n+ \"module\": \"dist/es/index.js\",\n\"repository\": {\n\"type\": \"git\",\n\"url\": \"git+https://github.com/router5/router5.git\"\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/rxjs-router5/package.json",
"new_path": "packages/rxjs-router5/package.json",
"diff": "\"version\": \"5.1.1\",\n\"description\": \"RxJS 5+ plugin for router5\",\n\"main\": \"dist/commonjs/index.js\",\n+ \"jsnext:main\": \"dist/es/index.js\",\n+ \"module\": \"dist/es/index.js\",\n\"repository\": {\n\"type\": \"git\",\n\"url\": \"https://github.com/router5/router5.git\"\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/xstream-router5/package.json",
"new_path": "packages/xstream-router5/package.json",
"diff": "\"version\": \"5.0.3\",\n\"description\": \"xstream plugin for router5\",\n\"main\": \"dist/commonjs/index.js\",\n+ \"jsnext:main\": \"dist/es/index.js\",\n+ \"module\": \"dist/es/index.js\",\n\"repository\": {\n\"type\": \"git\",\n\"url\": \"https://github.com/router5/router5.git\"\n"
}
] | TypeScript | MIT License | router5/router5 | chore: configure packages with jsnext:main as well as module |
580,240 | 16.11.2017 21:06:48 | 21,600 | e7ffd85cb8a2a871f8d7d3c700e12ae36a3fbee4 | feat(router5-transition-path): add type definitions | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5-transition-path/index.d.ts",
"diff": "+declare module 'router5-transition-path' {\n+ import { State } from 'router5'\n+\n+ export function nameToIDs(name: string): string[]\n+\n+ export interface TransitionPath {\n+ intersection: string\n+ toDeactivate: string[]\n+ toActivate: string[]\n+ }\n+\n+ function transitionPath(toState: State, fromState?: State): TransitionPath\n+\n+ export default transitionPath\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5-transition-path/test/main.js",
"new_path": "packages/router5-transition-path/test/main.js",
"diff": "import transitionPath from '../modules'\nimport { expect } from 'chai'\n+import tt from 'typescript-definition-tester'\ndescribe('router5-transition-path', function() {\nit('should return a transition path with from null state', function() {\n@@ -65,4 +66,15 @@ describe('router5-transition-path', function() {\n).intersection\n).to.equal('a.b.c')\n})\n+\n+ describe('TypeScript definitions', function() {\n+ it('should compile examples against index.d.ts', function(done) {\n+ tt.compileDirectory(\n+ `${__dirname}/typescript`,\n+ filename => filename.match(/\\.ts$/),\n+ { lib: ['lib.es2015.d.ts'] },\n+ () => done()\n+ )\n+ })\n+ })\n})\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/router5-transition-path/test/typescript/index.ts",
"diff": "+/// <reference path=\"../../../router5/index.d.ts\" />\n+/// <reference path=\"../../index.d.ts\" />\n+\n+import transitionPath, {\n+ nameToIDs,\n+ TransitionPath\n+} from 'router5-transition-path'\n+\n+const _ids: string[] = nameToIDs('a.b.c')\n+\n+let tp: TransitionPath\n+tp = transitionPath(\n+ { name: 'a.b.c', params: {}, path: '/a/b/c' },\n+ { name: 'a.b.d', params: {}, path: '/a/b/d' }\n+)\n+tp = transitionPath({ name: 'a.b.c', params: {}, path: '/a/b/c' })\n"
}
] | TypeScript | MIT License | router5/router5 | feat(router5-transition-path): add type definitions |
580,240 | 16.11.2017 21:09:09 | 21,600 | c89402d5cded1a7b76e6b72c00fcd624515d49f6 | refactor(router5): use router5-transition-path types | [
{
"change_type": "MODIFY",
"old_path": "packages/router5/index.d.ts",
"new_path": "packages/router5/index.d.ts",
"diff": "@@ -28,9 +28,7 @@ declare module 'router5' {\nActivationFnFactory as RouterActivationHandlerFactory\n} from 'router5/core/route-lifecycle'\nimport loggerPlugin from 'router5/plugins/loggers'\n-\n- // router5-transition-path\n- const transitionPath: (toState: State, fromState?: State) => any\n+ import transitionPath from 'router5-transition-path'\ntype DoneFn = (err?: any, state?: State) => void\n"
}
] | TypeScript | MIT License | router5/router5 | refactor(router5): use router5-transition-path types |
580,251 | 07.12.2017 15:47:09 | -3,600 | 50345af46b875a231d9f06cd006026fca8ef01b4 | Typescript typings specify routerNode instead of routeNode | [
{
"change_type": "MODIFY",
"old_path": "packages/react-router5/index.d.ts",
"new_path": "packages/react-router5/index.d.ts",
"diff": "@@ -53,7 +53,7 @@ declare module 'react-router5' {\nroute: State | null\n}\n- export function routerNode<TProps extends Partial<InjectedRouterNode>>(\n+ export function routeNode<TProps extends Partial<InjectedRouterNode>>(\nnodeName: string\n): (\nRouteSegment: ComponentType<TProps>\n"
}
] | TypeScript | MIT License | router5/router5 | Typescript typings specify routerNode instead of routeNode #230 |
580,249 | 07.12.2017 15:28:36 | 0 | d608c3a3b465759d7fc9b166a5d62f5386847ac9 | fix: fix reloading of routes | [
{
"change_type": "MODIFY",
"old_path": "packages/router5/modules/core/navigation.js",
"new_path": "packages/router5/modules/core/navigation.js",
"diff": "@@ -96,7 +96,7 @@ export default function withNavigation(router) {\nreturn\n}\n- const fromState = sameStates ? null : router.getState()\n+ const fromState = sameStates || opts.reload ? null : router.getState()\nif (opts.skipTransition) {\ndone(null, toState)\n"
}
] | TypeScript | MIT License | router5/router5 | fix: fix reloading of routes |
580,240 | 07.12.2017 14:55:11 | 21,600 | 8102de7fa562a05acabae696e9d33ce42fd3c39d | test: Increase timeouts for TypeScript examples
When compiling the TypeScript examples, Travis CI sometimes takes longer
than the default Mocha timeout of 2 s. This patch increases those
timeouts to 10 s to avoid failures.
See <https://github.com/router5/router5/pull/231#issuecomment-350010732>. | [
{
"change_type": "MODIFY",
"old_path": "packages/router5-transition-path/test/main.js",
"new_path": "packages/router5-transition-path/test/main.js",
"diff": "@@ -69,6 +69,8 @@ describe('router5-transition-path', function() {\ndescribe('TypeScript definitions', function() {\nit('should compile examples against index.d.ts', function(done) {\n+ this.timeout(10000)\n+\ntt.compileDirectory(\n`${__dirname}/typescript`,\nfilename => filename.match(/\\.ts$/),\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/router5/test/index.js",
"new_path": "packages/router5/test/index.js",
"diff": "@@ -33,6 +33,8 @@ describe('router5', function() {\ndescribe('TypeScript definitions', function() {\nit('should compile examples against index.d.ts', function(done) {\n+ this.timeout(10000)\n+\ntt.compileDirectory(\n`${__dirname}/typescript`,\nfilename => filename.match(/\\.ts$/),\n"
}
] | TypeScript | MIT License | router5/router5 | test: Increase timeouts for TypeScript examples
When compiling the TypeScript examples, Travis CI sometimes takes longer
than the default Mocha timeout of 2 s. This patch increases those
timeouts to 10 s to avoid failures.
See <https://github.com/router5/router5/pull/231#issuecomment-350010732>. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.