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

create-fuse-app

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-fuse-app - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

75

dist/index.js

@@ -7,3 +7,2 @@ #!/usr/bin/env node

import * as prompts from "@clack/prompts";
import { install } from "pkg-install";
import babel from "@babel/core";

@@ -75,6 +74,63 @@ import * as kl from "kolorist";

// src/get-package-manager.ts
function getPkgManager() {
const userAgent = process.env.npm_config_user_agent || "";
if (userAgent.startsWith("yarn")) {
return "yarn";
}
if (userAgent.startsWith("pnpm")) {
return "pnpm";
}
if (userAgent.startsWith("bun")) {
return "bun";
}
return "npm";
}
// src/install-package.ts
import { execa } from "execa";
async function install(packageManager, env, packages) {
let args = [];
switch (packageManager) {
case "npm": {
args.push("install");
if (env === "dev") {
args.push("--save-dev");
} else {
args.push("--save");
}
}
case "yarn": {
args.push("add");
if (env === "dev") {
args.push("-D");
}
}
case "pnpm": {
args.push("add");
if (env === "dev") {
args.push("-D");
}
}
case "bun": {
args.push("add");
if (env === "dev") {
args.push("-D");
}
}
}
args.push(...packages);
await execa(packageManager, args, {
stdio: "inherit",
env: {
...process.env,
NODE_ENV: "development"
}
});
}
// src/index.ts
var s = prompts.spinner();
async function createFuseApp() {
const packageManager = /yarn/.test(process.env.npm_execpath || "") ? "yarn" : "npm";
const packageManager = getPkgManager();
prompts.intro(kl.trueColor(219, 254, 1)("Fuse - Your new datalayer"));

@@ -97,12 +153,7 @@ const targetDir = resolve(process.cwd());

s.start("Installing fuse...");
await install(["fuse"], {
prefer: packageManager,
cwd: targetDir,
dev: false
});
await install(["@0no-co/graphqlsp", "@graphql-typed-document-node/core"], {
prefer: packageManager,
cwd: targetDir,
dev: true
});
await install(packageManager, "prod", ["fuse"]);
await install(packageManager, "dev", [
"@0no-co/graphqlsp",
"@graphql-typed-document-node/core"
]);
s.stop(kl.green("Installed fuse!"));

@@ -109,0 +160,0 @@ s.start("Creating API Route...");

6

package.json
{
"name": "create-fuse-app",
"version": "0.1.1",
"version": "0.2.0",
"description": "The magical GraphQL framework",

@@ -25,4 +25,4 @@ "homepage": "https://github.com/StellateHQ/fuse.js",

"@clack/prompts": "^0.7.0",
"kolorist": "^1.8.0",
"pkg-install": "^1.0.0"
"execa": "^8.0.1",
"kolorist": "^1.8.0"
},

@@ -29,0 +29,0 @@ "devDependencies": {

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