New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

new-component

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

new-component - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

2

package.json
{
"name": "new-component",
"version": "2.0.0",
"version": "3.0.0",
"description": "CLI for creating new React components",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/joshwcomeau/new-component",

@@ -21,3 +21,3 @@ <p align="center">

- Simple CLI interface for adding Component, PureComponent, or Stateless Functional components.
- Simple CLI interface for adding React components.
- Uses [Prettier](https://github.com/prettier/prettier) to stylistically match the existing project.

@@ -24,0 +24,0 @@ - Offers global config, which can be overridden on a project-by-project basis.

@@ -47,5 +47,18 @@ /*

module.exports.buildPrettifier = (prettierConfig) => (text) =>
prettier.format(text, prettierConfig);
module.exports.buildPrettifier = (prettierConfig) => {
// If they haven't supplied a prettier config, check for a
// `.prettierrc`!
let config = prettierConfig;
if (!config) {
const currentPath = process.cwd();
const config = requireOptional(
`/${currentPath}/.prettierrc`
);
}
return (text) => prettier.format(text, config);
}
// Emit a message confirming the creation of the component

@@ -52,0 +65,0 @@ const colors = {

@@ -62,6 +62,7 @@ #!/usr/bin/env node

const filePath = `${componentDir}/${componentName}.${program.extension}`;
const indexPath = `${componentDir}/index.js`;
const indexPath = `${componentDir}/index.${program.extension}`;
// Our index template is super straightforward, so we'll just inline it for now.
const indexTemplate = prettify(`\
export * from './${componentName}';
export { default } from './${componentName}';

@@ -68,0 +69,0 @@ `);

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