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

@yellowspot/cli

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yellowspot/cli - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

38

index.js
#! /usr/bin/env node
const shell = require('shelljs');
const degit = require('degit');
const util = require('util');
const path = require('path');
const { version } = require('./package.json');

@@ -9,3 +13,2 @@ const readline = require('readline').createInterface({

const util = require('util');
const ask = util.promisify(readline.question).bind(readline);

@@ -25,5 +28,28 @@

const emitter = degit('yellowspot/react-template', {
cache: true,
force: true,
verbose: true,
mode: 'git'
});
emitter.on('info', info => {
console.log(info.message);
});
async function run() {
let isComplete = false;
const folder = process.argv[2]
if (!folder) {
console.log(`Usage: npx @yellowspot/cli folder_name`);
process.exit(1);
}
console.log('version:', version);
console.log('Cloning template...')
await emitter.clone(folder).then(() => {
console.log('done');
});
while (!isComplete) {

@@ -71,17 +97,17 @@ const name = await ask(`Enter your project name for package.json ${value(userData.projectName)}: `);

console.log('Update package.json');
shell.sed('-i', /react-template/, userData.projectName, 'package.json');
shell.sed('-i', /react-template/, userData.projectName, path.join(__dirname, folder, 'package.json'));
console.log('Update index.html');
shell.sed('-i', /Vite \+ React \+ TS/, userData.title, 'index.html');
shell.sed('-i', /Vite \+ React \+ TS/, userData.title, path.join(__dirname, folder, 'index.html'));
console.log('Update .env');
shell.sed('-i', /https:\/\/pokeapi.co\/api\/v2/, userData.prodApiUrl, '.env');
shell.sed('-i', /https:\/\/pokeapi.co\/api\/v2/, userData.prodApiUrl, path.join(__dirname, folder, '.env'));
console.log('Update .env.staging');
shell.sed('-i', /https:\/\/staging.pokeapi.co\/api\/v2/, userData.stagingApiUrl, '.env.staging');
shell.sed('-i', /https:\/\/staging.pokeapi.co\/api\/v2/, userData.stagingApiUrl, path.join(__dirname, folder, '.env.staging'));
console.log('Update .env.development');
shell.sed('-i', /https:\/\/pokeapi.co\/api\/v2/, userData.devApiUrl, '.env.development');
shell.sed('-i', /https:\/\/pokeapi.co\/api\/v2/, userData.devApiUrl, path.join(__dirname, folder, '.env.development'));
}
run();

4

package.json
{
"name": "@yellowspot/cli",
"version": "0.0.1",
"version": "0.0.2",
"description": "Create Yellow App cli",
"main": "index.js",
"repository": "github:yellowspot/create-yellow-app",
"bin": {

@@ -15,4 +16,5 @@ "cya": "index.js"

"dependencies": {
"degit": "^2.8.4",
"shelljs": "^0.8.5"
}
}
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