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.0 to 0.1.1

README.md

98

dist/index.js

@@ -111,11 +111,19 @@ #!/usr/bin/env node

if (isUsingSrc) {
const dir = shouldUseAppDir ? resolve(targetDir, "src", "app", "api", "fuse", "route.ts") : resolve(targetDir, "src", "pages", "api", "fuse.ts");
const apiRoute = shouldUseAppDir ? resolve(targetDir, "src", "app", "api", "fuse", "route.ts") : resolve(targetDir, "src", "pages", "api", "fuse.ts");
if (shouldUseAppDir) {
await fs.mkdir(resolve(targetDir, "src", "app", "api"));
await fs.mkdir(resolve(targetDir, "src", "app", "api", "fuse"));
const apiFolder = resolve(targetDir, "src", "app", "api");
if (!existsSync(apiFolder))
await fs.mkdir(apiFolder);
const fuseDir = resolve(targetDir, "src", "app", "api", "fuse");
if (!existsSync(fuseDir))
await fs.mkdir(fuseDir);
} else {
await fs.mkdir(resolve(targetDir, "src", "pages", "api"));
const apiPagesFolder = resolve(targetDir, "src", "pages", "api");
if (!existsSync(apiPagesFolder))
await fs.mkdir(apiPagesFolder);
}
await fs.writeFile(dir, apiRouteSnippet);
await fs.mkdir(resolve(targetDir, "src", "types"));
await fs.writeFile(apiRoute, apiRouteSnippet);
if (!existsSync(resolve(targetDir, "src", "types"))) {
await fs.mkdir(resolve(targetDir, "src", "types"));
}
await fs.writeFile(

@@ -126,11 +134,19 @@ resolve(targetDir, "src", "types", "User.ts"),

} else {
const dir = shouldUseAppDir ? resolve(targetDir, "app", "api", "fuse", "route.ts") : resolve(targetDir, "pages", "api", "fuse.ts");
const apiRoute = shouldUseAppDir ? resolve(targetDir, "app", "api", "fuse", "route.ts") : resolve(targetDir, "pages", "api", "fuse.ts");
if (shouldUseAppDir) {
await fs.mkdir(resolve(targetDir, "app", "api"));
await fs.mkdir(resolve(targetDir, "app", "api", "fuse"));
const apiFolder = resolve(targetDir, "app", "api");
if (!existsSync(apiFolder))
await fs.mkdir(apiFolder);
const fuseDir = resolve(targetDir, "app", "api", "fuse");
if (!existsSync(fuseDir))
await fs.mkdir(fuseDir);
} else {
await fs.mkdir(resolve(targetDir, "pages", "api"));
const apiPagesFolder = resolve(targetDir, "pages", "api");
if (!existsSync(apiPagesFolder))
await fs.mkdir(apiPagesFolder);
}
await fs.writeFile(dir, apiRouteSnippet);
await fs.mkdir(resolve(targetDir, "types"));
await fs.writeFile(apiRoute, apiRouteSnippet);
if (!existsSync(resolve(targetDir, "types"))) {
await fs.mkdir(resolve(targetDir, "types"));
}
await fs.writeFile(

@@ -200,3 +216,5 @@ resolve(targetDir, "types", "User.ts"),

} else {
await fs.mkdir(resolve(targetDir, ".vscode"));
if (!existsSync(resolve(targetDir, ".vscode"))) {
await fs.mkdir(resolve(targetDir, ".vscode"));
}
await fs.writeFile(

@@ -208,31 +226,33 @@ resolve(targetDir, ".vscode", "settings.json"),

}
const tsConfigFile = await fs.readFile(
resolve(targetDir, "tsconfig.json"),
"utf-8"
);
const tsConfig = JSON.parse(tsConfigFile);
if (!tsConfig.compilerOptions?.plugins?.find(
(plugin2) => plugin2.name === "@0no-co/graphqlsp"
)) {
const updatedTsConfig = {
...tsConfig,
compilerOptions: {
...tsConfig.compilerOptions,
plugins: [
...tsConfig.compilerOptions?.plugins || [],
{
name: "@0no-co/graphqlsp",
schema: "./schema.graphql",
disableTypegen: true,
templateIsCallExpression: true,
template: "graphql"
}
]
}
};
await fs.writeFile(
if (existsSync(resolve(targetDir, "tsconfig.json"))) {
const tsConfigFile = await fs.readFile(
resolve(targetDir, "tsconfig.json"),
JSON.stringify(updatedTsConfig, void 0, 2),
"utf-8"
);
const tsConfig = JSON.parse(tsConfigFile);
if (!tsConfig.compilerOptions?.plugins?.find(
(plugin2) => plugin2.name === "@0no-co/graphqlsp"
)) {
const updatedTsConfig = {
...tsConfig,
compilerOptions: {
...tsConfig.compilerOptions,
plugins: [
...tsConfig.compilerOptions?.plugins || [],
{
name: "@0no-co/graphqlsp",
schema: "./schema.graphql",
disableTypegen: true,
templateIsCallExpression: true,
template: "graphql"
}
]
}
};
await fs.writeFile(
resolve(targetDir, "tsconfig.json"),
JSON.stringify(updatedTsConfig, void 0, 2),
"utf-8"
);
}
}

@@ -239,0 +259,0 @@ s.stop(kl.green("Added Fuse plugin to next config!"));

{
"name": "create-fuse-app",
"version": "0.1.0",
"version": "0.1.1",
"description": "The magical GraphQL framework",

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

"publishConfig": {
"access": "public"
"access": "public",
"provenance": true
},

@@ -38,0 +39,0 @@ "scripts": {

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