🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@pergel/cli

Package Overview
Dependencies
Maintainers
2
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pergel/cli - npm Package Compare versions

Package was removed
Sorry, it seems this package was removed from the registry
Comparing version
0.9.0
to
0.9.1
+81
dist/module-EURVWB6A.js
import {
definePergelLoadConfig
} from "./chunk-H36PPSPN.js";
// src/commands/module.ts
import { readFileSync } from "node:fs";
import { resolve } from "node:path";
import { execSync } from "node:child_process";
import { defineCommand } from "citty";
import { consola } from "consola";
import { parseNa, run } from "@antfu/ni";
var module_default = defineCommand({
meta: {
name: "Module Command",
description: "Module Command",
version: "0.0.0"
},
args: {
project: {
type: "string",
description: "Name of the project",
alias: "p"
},
module: {
type: "string",
description: "Name of the module",
alias: "m"
},
script: {
type: "string",
description: "Name of the script",
alias: "s"
},
customScript: {
type: "boolean",
description: "Custom script",
alias: "cs"
}
},
async run({ args }) {
try {
const file = await definePergelLoadConfig();
if (!file.config) {
consola.error("No config file found");
return;
}
const readmeString = readFileSync(resolve(file.config.dir.pergel, "README.json")).toString();
const project = JSON.parse(readmeString)[args.project ?? ""]?.[args.module ?? ""];
const script = project?.scripts ?? {};
if (Object.keys(script).length === 0)
consola.error("No script found");
const selectedScript = script[args.script ?? ""];
if (!selectedScript)
consola.error("No script found");
if (!args.customScript) {
try {
await run(async (agent, args2, ctx) => {
const command = await parseNa(agent, args2, ctx);
return command ? command.replace(/"/g, "") : void 0;
}, [selectedScript], { programmatic: true }).then(() => {
consola.success("Script executed successfully");
}).catch((error) => {
consola.error(error);
});
} catch (error) {
consola.error(error);
}
} else {
execSync(selectedScript, {
stdio: "inherit",
cwd: file.config.dir.pergel
});
}
} catch (error) {
consola.log(error);
}
}
});
export {
module_default as default
};
+2
-2

@@ -13,3 +13,3 @@ import {

type: "module",
version: "0.9.0",
version: "0.9.1",
packageManager: "pnpm@8.10.0",

@@ -137,3 +137,3 @@ description: "Full Stack Nuxt Application. It contains the necessary toolkits for a software developer and a fast, clean, tested toolkit.",

install: () => import("./install-BFB3G2IX.js").then((m) => m.default),
module: () => import("./module-C7BIYIOL.js").then((m) => m.default),
module: () => import("./module-EURVWB6A.js").then((m) => m.default),
download: () => import("./download-TXZWEWUB.js").then((m) => m.default),

@@ -140,0 +140,0 @@ select: () => import("./select-JZE7F6LA.js").then((m) => m.default)

{
"name": "@pergel/cli",
"type": "module",
"version": "0.9.0",
"version": "0.9.1",
"packageManager": "pnpm@8.10.0",

@@ -6,0 +6,0 @@ "description": "Full Stack Nuxt Application. It contains the necessary toolkits for a software developer and a fast, clean, tested toolkit.",

import {
definePergelLoadConfig
} from "./chunk-H36PPSPN.js";
// src/commands/module.ts
import { readFileSync } from "node:fs";
import { resolve } from "node:path";
import { execSync } from "node:child_process";
import { defineCommand } from "citty";
import { consola } from "consola";
import { parseNa, run } from "@antfu/ni";
var module_default = defineCommand({
meta: {
name: "Module Command",
description: "Module Command",
version: "0.0.0"
},
args: {
project: {
type: "string",
description: "Name of the project",
alias: "p"
},
module: {
type: "string",
description: "Name of the module",
alias: "m"
},
script: {
type: "string",
description: "Name of the script",
alias: "s"
},
customScript: {
type: "boolean",
description: "Custom script",
alias: "cs"
}
},
async run({ args }) {
try {
const file = await definePergelLoadConfig();
if (!file.config) {
consola.error("No config file found");
return;
}
const readmeString = readFileSync(resolve(file.config.dir.pergel, "README.json")).toString();
const project = JSON.parse(readmeString)[args.project ?? ""]?.[args.module ?? ""];
const script = project?.scripts ?? {};
if (Object.keys(script).length === 0)
consola.error("No script found");
const selectedScript = script[args.script ?? ""];
if (!selectedScript)
consola.error("No script found");
if (!args.npx) {
try {
await run(async (agent, args2, ctx) => {
const command = await parseNa(agent, args2, ctx);
return command ? command.replace(/"/g, "") : void 0;
}, [selectedScript], { programmatic: true }).then(() => {
consola.success("Script executed successfully");
}).catch((error) => {
consola.error(error);
});
} catch (error) {
consola.error(error);
}
} else {
execSync(selectedScript, {
stdio: "inherit",
cwd: file.config.dir.pergel
});
}
} catch (error) {
consola.log(error);
}
}
});
export {
module_default as default
};