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.6.0 to 0.7.0

6

CHANGELOG.md
# create-fuse-app
## 0.7.0
### Minor Changes
- db8b67d: Support creating a fuse app in an empty directory
## 0.6.0

@@ -4,0 +10,0 @@

77

dist/index.js

@@ -136,14 +136,37 @@ #!/usr/bin/env node

import { parse, stringify } from "comment-json";
import { execa as execa2 } from "execa";
var s = prompts.spinner();
var ensurePackageJson = async (targetDir) => {
if (!existsSync(resolve(targetDir, "package.json"))) {
await execa2("npm", ["init", "-y", "--silent"], {
stdio: "inherit",
env: process.env
});
}
};
var ensureTsConfig = async (targetDir) => {
if (!existsSync(resolve(targetDir, "tsconfig.json"))) {
await fs.writeFile(resolve(targetDir, "tsconfig.json"), defaultTsConfig);
return false;
}
return true;
};
async function createFuseApp() {
const packageManager = getPkgManager();
prompts.intro(kl.trueColor(219, 254, 1)("Fuse - Your new API"));
const targetDir = resolve(process.cwd());
await ensurePackageJson(targetDir);
const hasTsConfig = await ensureTsConfig(targetDir);
s.start("Installing fuse...");
await install(packageManager, "prod", ["fuse", "gql.tada", "graphql"]);
await install(packageManager, "dev", [
"@0no-co/graphqlsp",
"@graphql-typed-document-node/core"
]);
await install(
packageManager,
"dev",
[
"@0no-co/graphqlsp",
"@graphql-typed-document-node/core",
hasTsConfig ? "" : "typescript"
].filter(Boolean)
);
s.stop(kl.green("Installed fuse!"));
const targetDir = resolve(process.cwd());
const packageJson = await fs.readFile(

@@ -162,9 +185,9 @@ resolve(targetDir, "package.json"),

export const getContext = (
ctx: InitialContext,
): GetContext<{ ua: string | null }> => {
return {
ua: ctx.request.headers.get('user-agent'),
}
}
export const getContext = (
ctx: InitialContext,
): GetContext<{ ua: string | null }> => {
return {
ua: ctx.request.headers.get('user-agent'),
}
}
`;

@@ -401,1 +424,31 @@ await fs.writeFile(resolve(targetDir, "_context.ts"), contextCopy);

}
var defaultTsConfig = `{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"paths": {
"@/*": ["./*"]
},
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["./**/*.ts"],
"exclude": [
"node_modules/**/*"
]
}`;

2

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

@@ -5,0 +5,0 @@ "homepage": "https://github.com/StellateHQ/fuse",

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