Skip to content

Commit

Permalink
fix: use pkgUp.sync to localize package.json (#985)
Browse files Browse the repository at this point in the history
  • Loading branch information
capaj committed Mar 1, 2021
1 parent 3d51239 commit 18d985d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
1 change: 1 addition & 0 deletions packages/cli/package.json
Expand Up @@ -59,6 +59,7 @@
"normalize-path": "^3.0.0",
"ora": "^5.1.0",
"papaparse": "^5.3.0",
"pkg-up": "^3.1.0",
"plurals-cldr": "^1.0.4",
"pofile": "^1.1.0",
"pseudolocale": "^1.1.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/api/detect.ts
@@ -1,13 +1,13 @@
import fs from "fs"
import path from "path"
import pkgUp from "pkg-up"

export const projectType = {
CRA: "CRA",
REACT: "REACT",
}

function getPackageJson() {
const packageJsonPath = path.resolve("package.json")
const packageJsonPath = pkgUp.sync()

try {
const json = fs.readFileSync(packageJsonPath, "utf8")
Expand Down
30 changes: 15 additions & 15 deletions yarn.lock
Expand Up @@ -4248,6 +4248,21 @@ child-process@^1.0.2:
resolved "https://registry.yarnpkg.com/child-process/-/child-process-1.0.2.tgz#98974dc7ed1ee4c6229f8e305fa7313a6885a7f2"
integrity sha1-mJdNx+0e5MYin44wX6cxOmiFp/I=

chokidar@3.5.1:
version "3.5.1"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a"
integrity sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==
dependencies:
anymatch "~3.1.1"
braces "~3.0.2"
glob-parent "~5.1.0"
is-binary-path "~2.1.0"
is-glob "~4.0.1"
normalize-path "~3.0.0"
readdirp "~3.5.0"
optionalDependencies:
fsevents "~2.3.1"

chokidar@^2.1.8:
version "2.1.8"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917"
Expand Down Expand Up @@ -4282,21 +4297,6 @@ chokidar@^3.4.1:
optionalDependencies:
fsevents "~2.1.2"

chokidar@^3.5.1:
version "3.5.1"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a"
integrity sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==
dependencies:
anymatch "~3.1.1"
braces "~3.0.2"
glob-parent "~5.1.0"
is-binary-path "~2.1.0"
is-glob "~4.0.1"
normalize-path "~3.0.0"
readdirp "~3.5.0"
optionalDependencies:
fsevents "~2.3.1"

chownr@^1.0.1, chownr@^1.1.1, chownr@^1.1.2:
version "1.1.4"
resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b"
Expand Down

1 comment on commit 18d985d

@vercel
Copy link

@vercel vercel bot commented on 18d985d Mar 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.