@hextastudio/ui
Advanced tools
Comparing version 1.0.0 to 1.0.1
17
index.js
@@ -8,3 +8,3 @@ #!/usr/bin/env node | ||
const components = ["component1", "component2", "component3"]; // replace with your components | ||
const components = ["select"]; | ||
@@ -22,3 +22,3 @@ if (process.argv[2] === "add") { | ||
.then((answers) => { | ||
const url = `https://raw.githubusercontent.com/username/repo/master/${answers.component}.js`; // replace with your GitHub repo | ||
const url = `https://raw.githubusercontent.com/HextaStudio/HextaUI/main/src/pages/docs/components/layout/${answers.component}.js`; | ||
@@ -31,11 +31,10 @@ axios({ | ||
.then(function (response) { | ||
response.data.pipe( | ||
fs.createWriteStream( | ||
path.join(__dirname, `${answers.component}.js`) | ||
) | ||
); | ||
console.log("File downloaded successfully"); | ||
const dir = path.join(__dirname, "hexta-ui", "components"); | ||
fs.mkdirSync(dir, { recursive: true }); | ||
const filePath = path.join(dir, `${answers.component}.js`); | ||
response.data.pipe(fs.createWriteStream(filePath)); | ||
console.log(`${answers.component} component was added successfully`); | ||
}) | ||
.catch(function (error) { | ||
console.error("Error downloading file", error); | ||
console.error("Error adding component", error); | ||
}); | ||
@@ -42,0 +41,0 @@ }); |
{ | ||
"name": "@hextastudio/ui", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "", | ||
@@ -10,2 +10,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"@hextastudio/ui": "^1.0.0", | ||
"ansi-escapes": "^4.3.2", | ||
@@ -48,3 +49,2 @@ "ansi-regex": "^5.0.1", | ||
}, | ||
"devDependencies": {}, | ||
"scripts": { | ||
@@ -51,0 +51,0 @@ "test": "echo \"Error: no test specified\" && exit 1" |
2567
37
37
+ Added@hextastudio/ui@^1.0.0