@tobiastengler/create-relay-app
Advanced tools
Comparing version 2.1.0 to 2.1.1
import { TaskBase } from "./TaskBase.js"; | ||
import { GRAPHQL_WS_PACKAGE, REACT_RELAY_PACKAGE } from "../consts.js"; | ||
import { GRAPHQL_WS_PACKAGE, REACT_RELAY_PACKAGE, RELAY_RUNTIME_PACKAGE } from "../consts.js"; | ||
import { bold } from "../utils/cli.js"; | ||
@@ -18,3 +18,3 @@ export class InstallNpmDependenciesTask extends TaskBase { | ||
} | ||
const packages = [REACT_RELAY_PACKAGE]; | ||
const packages = [REACT_RELAY_PACKAGE, RELAY_RUNTIME_PACKAGE]; | ||
if (this.context.args.subscriptions) { | ||
@@ -21,0 +21,0 @@ packages.push(GRAPHQL_WS_PACKAGE, "graphql@15.x"); |
@@ -39,3 +39,14 @@ import traverse from "@babel/traverse"; | ||
const mainFilename = "_app" + (this.context.args.typescript ? ".tsx" : ".js"); | ||
const mainFile = this.context.env.rel(path.join("pages", mainFilename)); | ||
const possibleMainFileLocations = [path.join("pages", mainFilename), path.join("src", "pages", mainFilename)]; | ||
let mainFile = null; | ||
for (const possibleMainFileLocation of possibleMainFileLocations) { | ||
const file = this.context.env.rel(possibleMainFileLocation); | ||
if (this.context.fs.exists(file.abs)) { | ||
mainFile = file; | ||
break; | ||
} | ||
} | ||
if (!mainFile) { | ||
throw new Error(`${mainFilename} could not be found`); | ||
} | ||
this.updateMessage(this.message + " in " + bold(mainFile.rel)); | ||
@@ -42,0 +53,0 @@ const code = await this.context.fs.readFromFile(mainFile.abs); |
{ | ||
"name": "@tobiastengler/create-relay-app", | ||
"version": "v2.1.0", | ||
"version": "v2.1.1", | ||
"description": "Easy configuration of Relay for existing projects", | ||
@@ -47,3 +47,2 @@ "homepage": "https://github.com/tobias-tengler/create-relay-app#readme", | ||
"@types/fs-extra": "^9.0.13", | ||
"@types/glob": "^7.2.0", | ||
"@types/inquirer": "^9.0.0", | ||
@@ -65,3 +64,2 @@ "@types/jest": "^29.2.4", | ||
"fs-extra": "^10.1.0", | ||
"glob": "^8.0.3", | ||
"inquirer": "^9.1.0", | ||
@@ -68,0 +66,0 @@ "ora": "^6.1.2", |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
90317
9
11
2078
- Removedglob@^8.0.3
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@2.0.1(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedglob@8.1.0(transitive)
- Removedinflight@1.0.6(transitive)
- Removedminimatch@5.1.6(transitive)
- Removedonce@1.4.0(transitive)
- Removedwrappy@1.0.2(transitive)