Skip to content

Commit

Permalink
Merge pull request #29 from GenesysGo/tracy/edit-file-refactor
Browse files Browse the repository at this point in the history
edit-file refactor
  • Loading branch information
tracy-codes authored Jul 12, 2024
2 parents 5f2eea6 + 7a880a7 commit da3a0b4
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 131 deletions.
118 changes: 37 additions & 81 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shadow-drive/cli",
"version": "0.7.2",
"version": "1.0.0",
"main": "shdw-drive.js",
"bin": {
"shdw-drive": "./dist/src/shdw-drive.js"
Expand All @@ -16,7 +16,7 @@
},
"dependencies": {
"@coral-xyz/anchor": "^0.27.0",
"@shadow-drive/sdk": "^5.1.1",
"@shadow-drive/sdk": "^6.0.0",
"@solana/spl-token": "^0.2.0",
"@solana/web3.js": "^1.41.0",
"bigint-conversion": "^2.2.1",
Expand Down
15 changes: 6 additions & 9 deletions src/shdw-drive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,18 +278,14 @@ programCommand("edit-file")
`Sending file edit request to the cluster.`
).start();
try {
const uploadResponse = await drive.editFile(
storageAccount,
options.url,
{
name: fileName,
file: fileData,
}
);
const uploadResponse = await drive.editFile(storageAccount, {
name: fileName,
file: fileData,
});
txnSpinner.succeed(`File account updated: ${fileName}`);
log.info(
"Your finalized file location:",
uploadResponse.finalized_location
uploadResponse.finalized_locations
);
log.info("Your updated file is immediately accessible.");
return process.exit(0);
Expand Down Expand Up @@ -513,6 +509,7 @@ async function handleUpload(
storageAccount,
fileDataChunk,
concurrent,
false,
(items: number) => progress.increment(items)
);
return uploadResponse;
Expand Down
43 changes: 4 additions & 39 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,6 @@
bn.js "^5.1.2"
buffer-layout "^1.2.0"

"@coral-xyz/borsh@^0.28.0":
version "0.28.0"
resolved "https://registry.npmjs.org/@coral-xyz/borsh/-/borsh-0.28.0.tgz"
integrity sha512-/u1VTzw7XooK7rqeD7JLUSwOyRSesPUk0U37BV9zK0axJc1q0nRbKFGFLYCQ16OtdOJTTwGfGp11Lx9B45bRCQ==
dependencies:
bn.js "^5.1.2"
buffer-layout "^1.2.0"

"@hapi/hoek@^9.0.0", "@hapi/hoek@^9.3.0":
version "9.3.0"
resolved "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz"
Expand Down Expand Up @@ -178,10 +170,9 @@
resolved "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz"
integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==

"@shadow-drive/sdk@^5.1.1":
version "5.1.1"
resolved "https://registry.npmjs.org/@shadow-drive/sdk/-/sdk-5.1.1.tgz"
integrity sha512-wCUlJHiL+tjJvSKImGdfMAsDYrDIKs0Ysxm6o3+DoUzSP42cfc493QTfl38mETjD5IrxjjjqdN6fJhnegPpFGA==
"@shadow-drive/sdk@^6.0.0":
version "6.0.0"
resolved "file:../shadow-drive"
dependencies:
"@coral-xyz/anchor" "^0.27.0"
"@coral-xyz/borsh" "^0.28.0"
Expand Down Expand Up @@ -258,13 +249,6 @@
rpc-websockets "^7.5.1"
superstruct "^0.14.2"

"@types/bn.js@^5.1.1":
version "5.1.5"
resolved "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.5.tgz"
integrity sha512-V46N0zwKRF5Q00AZ6hWtN0T8gGmDUaUzLWQvHFo5yThtVwK/VCenFY3wXVbOvNfajEpsTfQM4IN9k/d6gUVX3A==
dependencies:
"@types/node" "*"

"@types/cli-progress@^3.11.0":
version "3.11.0"
resolved "https://registry.npmjs.org/@types/cli-progress/-/cli-progress-3.11.0.tgz"
Expand Down Expand Up @@ -1106,11 +1090,6 @@ js-sha256@^0.9.0:
resolved "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz"
integrity sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==

"js-tokens@^3.0.0 || ^4.0.0":
version "4.0.0"
resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz"
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==

jsesc@^2.5.1:
version "2.5.2"
resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz"
Expand Down Expand Up @@ -1171,13 +1150,6 @@ loglevel@^1.8.0:
resolved "https://registry.npmjs.org/loglevel/-/loglevel-1.9.1.tgz"
integrity sha512-hP3I3kCrDIMuRwAwHltphhDM1r8i55H33GgqjXbrisuJhF4kRhW1dNuxsRklp4bXl8DSdLaNLuiL4A/LWRfxvg==

loose-envify@^1.1.0:
version "1.4.0"
resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz"
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
dependencies:
js-tokens "^3.0.0 || ^4.0.0"

lower-case@^2.0.2:
version "2.0.2"
resolved "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz"
Expand Down Expand Up @@ -1295,7 +1267,7 @@ node-abi@^3.3.0:
dependencies:
semver "^7.3.5"

node-fetch@^2.6.12, node-fetch@^2.6.6, node-fetch@^2.6.7, node-fetch@2:
node-fetch@^2.6.12, node-fetch@^2.6.6, node-fetch@^2.6.7:
version "2.7.0"
resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz"
integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==
Expand Down Expand Up @@ -1488,13 +1460,6 @@ rc@^1.2.7:
minimist "^1.2.0"
strip-json-comments "~2.0.1"

"react@^17.0.0 || ^18":
version "18.3.1"
resolved "https://registry.npmjs.org/react/-/react-18.3.1.tgz"
integrity sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==
dependencies:
loose-envify "^1.1.0"

readable-stream@^2.0.0:
version "2.3.8"
resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz"
Expand Down

0 comments on commit da3a0b4

Please sign in to comment.