TritonDataCenter / node-manta

Node.js SDK for Manta
75 stars 54 forks source link

manta has deprecated dependencies #352

Closed bahamas10 closed 6 years ago

bahamas10 commented 6 years ago

When installing

$ npm install --global-style manta
npm WARN deprecated sprintf@0.1.5: The sprintf package is deprecated in favor of sprintf-js.
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
...

Searching for these modules we can see

node-uuid

relied on by restify-clients

$ ag --ignore-dir node-uuid '"node-uuid"'
restify-clients/package.json
89:    "node-uuid": "^1.4.6",

sprintf

relied on by progbar

$ ag --ignore-dir sprintf '"sprintf"'
progbar/package.json
47:    "sprintf": "~0.1.3"
bahamas10 commented 6 years ago

When updating restify-clients to fix the node-uuid dep issue I encountered a failure around once

https://github.com/restify/clients/pull/184

bahamas10 commented 6 years ago

CR: https://cr.joyent.us/#/c/4735/

Tests pass

The problem here is that upgrading from restify-clients 1 to 2 introduces a breaking change... error names don't include the name in the .code property.... ie errors now look like

{
  "code": "NotFound",
  "name": "NotFoundError"
}

I've updated our code to handle this, but clients in the wild may use this old behavior so this will have to be released as a major semver most likely

melloc commented 6 years ago

@bahamas10 You can use restify-clients@1.6.0 which depends on uuid@^3.0.1.

trentm commented 6 years ago

@bahamas10 Also if you update to restify-clients@1.6.0 this will also fix (the client-side of) MANTA-3679, which would be great!

See https://github.com/joyent/rfd/tree/master/rfd/0059#restify-clients for some limited notes on avoiding restify-clients@2.x -- at least for now.

bahamas10 commented 6 years ago

@trentm very interesting read... they are now on restify-error@6 and the way they show in their readme to check error types is to use instanceof https://github.com/restify/errors#checking-error-types or to use .name or .code.... which is all well and good, but if i pull in restify-client it doesn't expose restify-errors to me, so i'd have to guess at what version it's using and pull that in myself.

It seems like restify-clients should expose restify-errors so proper instanceof checks can be done (if that's what they think is best), or they should standardize their .name and .code properties (which, maybe they have).

Either way, I'll change it to 1.6.0

trentm commented 6 years ago

restify-errors general usage: yah, I haven't spent the time to form opinions on it yet. My limited understanding is that restify-error@6 (I think that version) went for simpler vanilla usage of VError, which I think I would favour.

bahamas10 commented 6 years ago

CR updated using restify-clients@1.6.0... make test passes for patchset 2

bahamas10 commented 6 years ago

all tests pass on patchset 4 in the CR

bahamas10 commented 6 years ago

done in node-manta 5.2.1

$ make cutarelease
version is: 5.2.1
[[ `cat package.json | json version` == `grep '^## ' CHANGES.md | head -2 | tail -1 | awk '{print $2}'` ]]
[[ -z `git status --short` ]]  # If this fails, the working dir is dirty.
** Are you sure you want to tag and publish manta@5.2.1 to npm?
** Enter to continue, Ctrl+C to abort.

ver=5.2.1 && \
    date=2018-08-30 && \
    git tag -a "v$ver" -m "version $ver ($date)" && \
    git push --tags origin && \
    npm publish
Counting objects: 1, done.
Writing objects: 100% (1/1), 170 bytes | 170.00 KiB/s, done.
Total 1 (delta 0), reused 0 (delta 0)
To github.com:joyent/node-manta.git
 * [new tag]         v5.2.1 -> v5.2.1
+ manta@5.2.1