Skip to content

Update yarn, Node 16.x & deps #555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
update yarn
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
  • Loading branch information
ShMcK committed Dec 31, 2021
commit fbf47451a7fc9533707a3dc1ed8103e918ca1e2f
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package-lock.json
.env
.env.local
.npmrc
.yarn

# output directory
build
Expand Down
5 changes: 5 additions & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


yarn-path ".yarn/releases/yarn-1.22.17.cjs"
3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.1.1.cjs
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"test-compile": "tsc -watch -p ./"
},
"dependencies": {
"@types/vscode": "^1.63.1",
"chokidar": "3.5.2",
"dotenv": "^8.2.0",
"eslint": "7.32.0",
Expand Down Expand Up @@ -68,7 +69,6 @@
"eslint-plugin-react": "7.27.1",
"eslint-plugin-react-hooks": "^4.3.0",
"prettier": "2.5.0",
"vscode": "^1.1.37",
"vscode-test": "^1.6.1"
},
"engines": {
Expand Down Expand Up @@ -104,5 +104,6 @@
},
"preview": true,
"publisher": "CodeRoad",
"icon": "coderoad_icon.png"
"icon": "coderoad_icon.png",
"packageManager": "yarn@3.1.1"
}
11 changes: 6 additions & 5 deletions src/services/storage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ class Storage<T> {
if (!sessionFile) {
throw new Error('No session file found')
}
const data: T = JSON.parse(sessionFile)
const valueFromFile: T = JSON.parse(sessionFile)

if (data) {
if (valueFromFile) {
// validate session
const keys = Object.keys(data)
const keys = Object.keys(valueFromFile)
if (keys.length) {
return data
return valueFromFile
}
}
} catch (err) {
Expand All @@ -54,7 +54,8 @@ class Storage<T> {
if (value) {
// 2. read from local storage
try {
return JSON.parse(value)
const valueFromLocalStorage = JSON.parse(value)
return valueFromLocalStorage
} catch (err) {
console.warn(`Failed to parse session state from local storage: ${value}`)
}
Expand Down
Loading