Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-cosmos

Package Overview
Dependencies
Maintainers
1
Versions
509
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-cosmos - npm Package Compare versions

Comparing version 1.0.0-beta.4 to 1.0.0-beta.5

jest.config.json

32

lib/index.js

@@ -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() {

12

package.json
{
"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,

});
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc