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

heliocrafts

Package Overview
Dependencies
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

heliocrafts - npm Package Compare versions

Comparing version 2.0.15 to 2.0.16

61

bin/index.js

@@ -14,3 +14,34 @@ #!/usr/bin/env node

for (const key in filesObject) {
if (key.startsWith(`/${folderName}/`) && !key.startsWith(`/${folderName}/index.js`)) {
if (key.startsWith(`/${folderName}/index.js` || key.startsWith(`/${folderName}/index.jsx`) || key.startsWith(`/${folderName}/index.tsx`) || key.startsWith(`/${folderName}/index.ts`))) {
const filePathParts = key.split('/').filter(part => part !== ''); // Split path and remove empty parts
let currentPath = './'; // Start with the current directory
for (const folderName of filePathParts.slice(0, -1)) {
currentPath = path.join(currentPath, folderName);
// Create the folder if it doesn't exist
if (!fs.existsSync(currentPath)) {
fs.mkdirSync(currentPath);
}
}
// Create and write the file
const fileName = filePathParts[filePathParts.length - 1];
const fullPath = path.join(currentPath, fileName);
const fileContent = (key.startsWith(`/${folderName}/index.ts`) || key.startsWith(`/${folderName}/index.tsx`)) ? `import ${newTitle} from './${newTitle}';
function App(props:any) {
return <${newTitle} {...props} />;;
}
export default App;`: `import ${newTitle} from './${newTitle}';
function App(props) {
return <${newTitle} {...props} />;;
}
export default App;`;
if (typeof fileContent === 'string' || fileContent instanceof Buffer) {
fs.writeFileSync(fullPath, fileContent);
} else {
console.error(`Invalid data for file: ${key}`);
}
}
else if (key.startsWith(`/${folderName}/`)) {
const filePathParts = key.split('/').filter(part => part !== ''); // Split path and remove empty parts

@@ -37,30 +68,4 @@ let currentPath = './'; // Start with the current directory

}
else if (key.startsWith(`/${folderName}/index.js` || key.startsWith(`/${folderName}/index.jsx`) || key.startsWith(`/${folderName}/index.tsx`) || key.startsWith(`/${folderName}/index.ts`))) {
const filePathParts = key.split('/').filter(part => part !== ''); // Split path and remove empty parts
let currentPath = './'; // Start with the current directory
for (const folderName of filePathParts.slice(0, -1)) {
currentPath = path.join(currentPath, folderName);
// Create the folder if it doesn't exist
if (!fs.existsSync(currentPath)) {
fs.mkdirSync(currentPath);
}
}
// Create and write the file
const fileName = filePathParts[filePathParts.length - 1];
const fullPath = path.join(currentPath, fileName);
const fileContent = `import ${newTitle} from './${newTitle}';
function App(props) {
return <${newTitle} {...props} />;;
}
export default App;`;
if (typeof fileContent === 'string' || fileContent instanceof Buffer) {
fs.writeFileSync(fullPath, fileContent);
} else {
console.error(`Invalid data for file: ${key}`);
}
}
}

@@ -67,0 +72,0 @@ }

{
"name": "heliocrafts",
"version": "2.0.15",
"version": "2.0.16",
"description": "A CLI to integrate cutting-edge and production-ready web components from heliocrafts into your project.",

@@ -5,0 +5,0 @@ "main": "index.js",

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