react-cosmos
Advanced tools
Comparing version 1.0.0-beta.4 to 1.0.0-beta.5
@@ -11,8 +11,20 @@ 'use strict'; | ||
var _getComponentFixtures = require('./get-component-fixtures'); | ||
var _loadModules = require('./load-modules'); | ||
var _getComponentFixtures2 = _interopRequireDefault(_getComponentFixtures); | ||
var _linkedList = require('./linked-list'); | ||
var _linkedList2 = _interopRequireDefault(_linkedList); | ||
var _PreviewLoader = require('./proxies/PreviewLoader'); | ||
var _PreviewLoader2 = _interopRequireDefault(_PreviewLoader); | ||
var _StateProxy = require('./proxies/StateProxy'); | ||
var _StateProxy2 = _interopRequireDefault(_StateProxy); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } | ||
var getTitleForFixture = function getTitleForFixture(params) { | ||
@@ -23,7 +35,7 @@ var title = 'React Cosmos'; | ||
if (params.component && params.fixture) { | ||
title = params.component + ':' + params.fixture + ' – ' + title; | ||
title = params.component + ':' + params.fixture + ' \u2013 ' + title; | ||
} | ||
return title; | ||
}; /* eslint-env browser */ | ||
}; | ||
@@ -34,7 +46,15 @@ module.exports = function (_ref) { | ||
var fixtures = _ref.fixtures; | ||
var firstProxy = (0, _linkedList2.default)([].concat(_toConsumableArray(proxies), [ | ||
// Loaded by default in all configs | ||
(0, _StateProxy2.default)(), | ||
// The final proxy in the chain simply renders the preview component | ||
_PreviewLoader2.default])); | ||
return new _reactQuerystringRouter2.default.Router({ | ||
container: document.body.appendChild(document.createElement('div')), | ||
defaultProps: { | ||
proxies: proxies, | ||
components: (0, _getComponentFixtures2.default)(components, fixtures) | ||
firstProxy: firstProxy, | ||
components: (0, _loadModules.loadComponents)(components), | ||
fixtures: (0, _loadModules.loadFixtures)(fixtures) | ||
}, | ||
@@ -41,0 +61,0 @@ getComponentClass: function getComponentClass() { |
{ | ||
"name": "react-cosmos", | ||
"version": "1.0.0-beta.4", | ||
"version": "1.0.0-beta.5", | ||
"description": "The glue between the React Cosmos modules", | ||
@@ -9,5 +9,11 @@ "repository": "https://github.com/skidding/react-cosmos/tree/master/packages/react-cosmos", | ||
"dependencies": { | ||
"react-component-playground": "^1.0.0-beta.4", | ||
"react-querystring-router": "^1.0.0-beta.4" | ||
"lodash.isequal": "^4.4.0", | ||
"lodash.omit": "^4.5.0", | ||
"react-component-playground": "^1.0.0-beta.5", | ||
"react-component-tree": "^1.0.0-beta.5", | ||
"react-querystring-router": "^1.0.0-beta.5" | ||
}, | ||
"peerDependencies": { | ||
"react": ">=0.13 <16" | ||
} | ||
} |
@@ -1,3 +0,3 @@ | ||
# React Cosmos | ||
# react-cosmos | ||
This package is the glue between the React Cosmos modules. It holds the shared code that is reused inside bundler-specific entry points. |
@@ -1,6 +0,7 @@ | ||
/* eslint-env browser */ | ||
import ReactQuerystringRouter from 'react-querystring-router'; | ||
import ComponentPlayground from 'react-component-playground'; | ||
import getComponentFixtures from './get-component-fixtures'; | ||
import { loadComponents, loadFixtures } from './load-modules'; | ||
import createLinkedList from './linked-list'; | ||
import PreviewLoader from './proxies/PreviewLoader'; | ||
import createStateProxy from './proxies/StateProxy'; | ||
@@ -22,8 +23,17 @@ const getTitleForFixture = (params) => { | ||
fixtures, | ||
}) => | ||
new ReactQuerystringRouter.Router({ | ||
}) => { | ||
const firstProxy = createLinkedList([ | ||
...proxies, | ||
// Loaded by default in all configs | ||
createStateProxy(), | ||
// The final proxy in the chain simply renders the preview component | ||
PreviewLoader, | ||
]); | ||
return new ReactQuerystringRouter.Router({ | ||
container: document.body.appendChild(document.createElement('div')), | ||
defaultProps: { | ||
proxies, | ||
components: getComponentFixtures(components, fixtures), | ||
firstProxy, | ||
components: loadComponents(components), | ||
fixtures: loadFixtures(fixtures), | ||
}, | ||
@@ -35,1 +45,2 @@ getComponentClass: () => ComponentPlayground, | ||
}); | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
120855
37
1487
6
1
+ Addedlodash.isequal@^4.4.0
+ Addedlodash.omit@^4.5.0
+ Addedlodash.isequal@4.5.0(transitive)
+ Addedlodash.omit@4.5.0(transitive)