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

component-kit-builder

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

component-kit-builder - npm Package Compare versions

Comparing version 1.0.10 to 1.1.0

5

index.js

@@ -5,2 +5,3 @@ 'use strict';

const values = require('object.values');
const hoist = require('hoist-non-react-statics');
module.exports = function (context) {

@@ -33,3 +34,3 @@ const uniquePaths = context.keys().reduce((obj, key) => {

complete: wrappersList.reduce(
(complete, moduleName) => flow(moduleMap[moduleName], complete),
(complete, moduleName) => hoist(moduleMap[moduleName](complete), complete),
moduleMap.component

@@ -39,5 +40,5 @@ )

wrappersList.reduce((obj, moduleName) => Object.assign({}, obj, {
[`${moduleName}_wrapped`]: moduleMap[moduleName](moduleMap.component)
[`${moduleName}_wrapped`]: hoist(moduleMap[moduleName](moduleMap.component), moduleMap.component)
}), {})
);
};

3

package.json
{
"name": "component-kit-builder",
"version": "1.0.10",
"version": "1.1.0",
"description": "builds component kits using webpack require.context",

@@ -28,2 +28,3 @@ "main": "index.js",

"dependencies": {
"hoist-non-react-statics": "^1.2.0",
"lodash.flow": "^3.3.0",

@@ -30,0 +31,0 @@ "object.values": "^1.0.3"

@@ -23,4 +23,4 @@ const assert = require('assert');

fs.writeFileSync(path.join(myComponentDir, 'component.js'), `module.exports = x => \`component \${x}\`;`);
fs.writeFileSync(path.join(myComponentDir, 'redux.js'), `module.exports = x => y => y(\`redux \${x}\`);`);
fs.writeFileSync(path.join(myComponentDir, 'relay.js'), `module.exports = x => y => y(\`relay \${x}\`);`);
fs.writeFileSync(path.join(myComponentDir, 'redux.js'), `module.exports = x => y => x(\`redux \${y}\`);`);
fs.writeFileSync(path.join(myComponentDir, 'relay.js'), `module.exports = x => y => x(\`relay \${y}\`);`);
fs.writeFileSync(path.join(testTmp, 'build-manager.js'), dedent`

@@ -84,2 +84,18 @@ const kitBuilder = require('${path.relative(testTmp, require.resolve('..'))}')

});
it('should hoist static properties through composition', function () {
fs.writeFileSync(path.join(myComponentDir, 'component.js'), `
module.exports = Object.assign(x => \`component \${x}\`, {componentStaticProp: true});
`);
fs.writeFileSync(path.join(myComponentDir, 'redux.js'), `
module.exports = x => Object.assign(y => y(\`redux \${x}\`), {reduxStaticProp: true});
`);
fs.writeFileSync(path.join(myComponentDir, 'relay.js'), `
module.exports = x => Object.assign(y => y(\`relay \${x}\`), {relayStaticProp: true});
`);
buildBundle();
const bundle = require(bundlePath);
assert(bundle.complete.reduxStaticProp);
assert(bundle.complete.relayStaticProp);
assert(bundle.complete.componentStaticProp);
})
});
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