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

@cuww/cli

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cuww/cli - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

3

dist/index.d.ts

@@ -5,2 +5,3 @@ import { Command } from './command';

export declare const addCommand: (command: Command) => void;
export declare const run: () => void;
export type bootTemp = (addCmd: typeof addCommand) => void;
export declare const boot: (bootTemp: bootTemp) => void;

@@ -6,3 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.run = exports.addCommand = exports.getCommands = exports.Command = void 0;
exports.boot = exports.addCommand = exports.getCommands = exports.Command = void 0;
const chalk_1 = __importDefault(require("chalk"));

@@ -12,3 +12,4 @@ const env_1 = require("./commands/env");

Object.defineProperty(exports, "Command", { enumerable: true, get: function () { return command_1.Command; } });
const args = process.argv;
const yargs_1 = __importDefault(require("yargs"));
const helpers_1 = require("yargs/helpers");
let commands = [

@@ -25,39 +26,31 @@ new env_1.BuildEnvCommand(),

exports.addCommand = addCommand;
// usage represents the help guide
const usage = function () {
const usageText = `
@@core helps you manage frontend project
usage:
yarn cli <command>
commands can be:
`;
console.log(usageText);
const start = () => {
let instance = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
.scriptName('')
.usage('@cuww/cli is designed to provide a cool way to manage your applications');
(0, exports.getCommands)().map(command => {
console.log(` ${chalk_1.default.green(command.cli)} – ${command.description}`);
instance.command(chalk_1.default.green(command.cli), command.description);
instance.command(command.cli, false, () => { }, command.handle);
});
instance
.demandCommand(1)
.parse();
// if (args[2] == 'help') {
// return usage()
// }
// let findCommands = getCommands().filter(command => {
// return command.cli == args[2]
// });
// if (findCommands.length == 0) {
// errorLog('invalid command passed')
// return usage()
// }
// return findCommands[0].handle(args.slice(3))
};
// used to log errors to the console in red color
function errorLog(error) {
console.log(chalk_1.default.red(error));
}
const start = () => {
if (args[2] == 'help') {
return usage();
}
let findCommands = (0, exports.getCommands)().filter(command => {
return command.cli == args[2];
});
if (findCommands.length == 0) {
errorLog('invalid command passed');
return usage();
}
return findCommands[0].handle(args.slice(3));
};
const run = () => {
const boot = (bootTemp) => {
console.log('');
bootTemp(exports.addCommand);
start();
console.log('');
};
exports.run = run;
exports.boot = boot;
{
"name": "@cuww/cli",
"version": "1.0.7",
"version": "1.0.8",
"main": "dist/index.js",

@@ -25,5 +25,7 @@ "types": "dist/index.d.ts",

"@cuww/runtime-env": "^1.0.4",
"@types/yargs": "^17.0.24",
"chalk": "4.1.2",
"typescript": "^5.1.5"
"typescript": "^5.1.5",
"yargs": "^17.7.2"
}
}

@@ -34,8 +34,9 @@ # Cuww Configuration

```typescript
import { run, addCommand } from '@cuww/cli';
import { boot } from '@cuww/cli';
import { HelloCommand } from './commands/hello.mjs';
addCommand(new HelloCommand())
run()
boot((command) => {
command(new HelloCommand())
})
```

@@ -42,0 +43,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