wechaty / puppet-mock

Puppet Mocker for Wechaty (& A Puppet Template Starter)
https://paka.dev/npm/wechaty-puppet-mock
Apache License 2.0
45 stars 14 forks source link

wechaty is holding back wechaty-puppet & file-box #33

Closed suntong closed 4 years ago

suntong commented 4 years ago

My wechaty-puppet & file-box is not the latest version:

$ npm outdated
Package                Current  Wanted  Latest  Location
file-box                0.8.27  0.8.27  0.10.6  wechaty-getting-started
wechaty-puppet          0.16.1  0.16.1  0.18.3  wechaty-getting-started

If I force update my wechaty-puppet & file-box to the latest version, I'll get:

npm ERR! peer dep missing: file-box@^0.8.22, required by wechaty-puppet-mock@0.16.1
npm ERR! peer dep missing: file-box@^0.8.22, required by wechaty-puppet-puppeteer@0.18.3
npm ERR! peer dep missing: wechaty-puppet@^0.16.1, required by wechaty-puppet-mock@0.16.1
npm ERR! peer dep missing: wechaty-puppet@^0.16.1, required by wechaty-puppet-puppeteer@0.18.3
npm ERR! peer dep missing: file-box@^0.8.22, required by wechaty-puppet-mock@0.16.1
npm ERR! peer dep missing: file-box@^0.8.22, required by wechaty-puppet-puppeteer@0.18.3
npm ERR! peer dep missing: wechaty-puppet@^0.16.1, required by wechaty-puppet-mock@0.16.1
npm ERR! peer dep missing: wechaty-puppet@^0.16.1, required by wechaty-puppet-puppeteer@0.18.3

I think this should be a bug as wechaty-puppet-mock should not be holding back wechaty-puppet & file-box versions.

suntong commented 4 years ago

I think it'd be better that wechaty-puppet-mock always depending on the latest version of all package it depends on. Thus I recommend apply the following trick to its package.json file --

How to npm install and force latest version (permanently)?
https://stackoverflow.com/questions/48321723/

If OK, I can do the changes and make PR.

Please consider. thx.

suntong commented 4 years ago

the npm-check-updates package fixed it.

suntong commented 4 years ago

Hmm... No!

the npm-check-updates package fixed npm outdated output (I got a clean output -- no outdated dependencies) but npm list --depth=0 is showing all previous outdated dependencies being missing.

So reopen for discussion...

huan commented 4 years ago

Thanks for pointing it l out.

A PR would be welcome!

suntong commented 4 years ago

The problem (of wechaty-puppet-mock and wechaty-puppet-puppeteer) has been fixed in wechaty@0.30.23 (sorry, only got around to visit this problem now), however, the problem persists :

$ npm outdated
Package         Current  Wanted  Latest  Location
eslint           5.16.0  5.16.0   6.8.0  wechaty-getting-started
file-box         0.10.6  0.10.6  0.12.3  wechaty-getting-started
wechaty-puppet   0.18.3  0.18.3  0.20.0  wechaty-getting-started

Checked and confirmed that it is wechaty@0.30.23 that is holding them back:

$ grep -E 'file-box|wechaty-puppet' node_modules/wechaty/package.json 
    "wechaty-puppet-install": "dist/bin/puppet-install.js",
    "file-box": "^0.10.6",
    "wechaty-puppet": "^0.18.3",
    "wechaty-puppet-mock": "^0.16.1"

So changing the title and submitting PR (to force latest version permanently).

suntong commented 4 years ago

Hmm.. my "fix" doesn't even work locally, so there won't be any PR from me...

huan commented 4 years ago

I try to reproduce your description but I failed.

with the latest https://github.com/wechaty/wechaty-getting-started repo:

$ cd wechaty-getting-started/
$ git pull
$ rm -fr node_modules/
$ npm install
$ npm outdated
Package                Current  Wanted  Latest  Location
@chatie/eslint-config   0.6.20  0.6.20   0.8.1  wechaty-getting-started
@chatie/tsconfig         0.6.1   0.6.1   0.8.0  wechaty-getting-started
check-node-version       3.3.0   3.3.0   4.0.2  wechaty-getting-started
cross-env                5.2.1   5.2.1   7.0.0  wechaty-getting-started

Everything looks good for Wechaty.

Could you try again and try to figure out what's the difference between your result with me?

huan commented 4 years ago

And I have just fixed all the outdated npm dependencies after my last commit.

npm outdated will get nothing now.

suntong commented 4 years ago

Thanks for the fixes/updates @huan ,

Could you run the following command under your wechaty-getting-started/ folder please?

Here are the commands and my outputs:

$ npm ls wechaty
wechaty-getting-started@0.1.19 /path/to/it
`-- wechaty@0.30.23 

$ grep -E 'file-box|wechaty-puppet' node_modules/wechaty/package.json 
    "wechaty-puppet-install": "dist/bin/puppet-install.js",
    "file-box": "^0.10.6",
    "wechaty-puppet": "^0.18.3",
    "wechaty-puppet-mock": "^0.16.1"
huan commented 4 years ago

Here's my output:

┌ huan@huan-home:~/chatie/wechaty-getting-started [09:12:38] tty:[1] jobs:[0]
└ (master) $ npm ls wechaty
wechaty-getting-started@0.1.23 /home/huan/chatie/wechaty-getting-started
└── wechaty@0.30.23 

┌ huan@huan-home:~/chatie/wechaty-getting-started [09:12:40] tty:[1] jobs:[0]
└ (master) $ grep -E 'file-box|wechaty-puppet' node_modules/wechaty/package.json 
    "wechaty-puppet-install": "dist/bin/puppet-install.js",
    "file-box": "^0.10.6",
    "wechaty-puppet": "^0.18.3",
    "wechaty-puppet-mock": "^0.16.1"
┌ huan@huan-home:~/chatie/wechaty-getting-started [09:12:47] tty:[1] jobs:[0]
└ (master) $ npm outdated
┌ huan@huan-home:~/chatie/wechaty-getting-started [09:13:04] tty:[1] jobs:[0]
└ (master) $

So mine is the same with yours. Are there any problems?

suntong commented 4 years ago

Oh, I was trying to use npm update to do the minimum downloading and upgrading, and apparently that, gave me the trouble as above. rm -fr node_modules/ and npm install did the trick to have a clean npm outdated output.

However, maybe you weren't testing wechaty-getting-started with wechaty-puppet-mock & wechaty-puppet-puppeteer?

Please run the following commands under your wechaty-getting-started/ folder and compare with my outputs:

$ npm list wechaty-puppet-mock
wechaty-getting-started@0.1.19 /...
`-- wechaty-puppet-mock@0.16.1 

$ npm list wechaty-puppet-puppeteer
wechaty-getting-started@0.1.19 /...
`-- wechaty-puppet-puppeteer@0.18.3 

$ npm list > /dev/null
npm ERR! peer dep missing: file-box@^0.8.22, required by wechaty-puppet-mock@0.16.1
npm ERR! peer dep missing: file-box@^0.8.22, required by wechaty-puppet-puppeteer@0.18.3
npm ERR! peer dep missing: wechaty-puppet@^0.16.1, required by wechaty-puppet-mock@0.16.1
npm ERR! peer dep missing: wechaty-puppet@^0.16.1, required by wechaty-puppet-puppeteer@0.18.3
npm ERR! peer dep missing: eslint@^5.0.0, required by @typescript-eslint/eslint-plugin@1.13.0
npm ERR! peer dep missing: eslint@^5.0.0, required by @typescript-eslint/eslint-plugin-tslint@1.13.0
npm ERR! peer dep missing: eslint@^5.0.0, required by @typescript-eslint/parser@1.13.0
npm ERR! missing: file-box@^0.10.6, required by wechaty@0.30.23
npm ERR! missing: wechaty-puppet@^0.18.3, required by wechaty@0.30.23

thx

huan commented 4 years ago

The following is my output:

┌ huan@huan-home:~/chatie/wechaty-getting-started [09:50:06] tty:[1] jobs:[0]
└ (master) $ npm list wechaty-puppet-mock
wechaty-getting-started@0.1.23 /home/huan/chatie/wechaty-getting-started
└── (empty)

┌ huan@huan-home:~/chatie/wechaty-getting-started [09:50:08] tty:[1] jobs:[0]
└ (master) $ npm list wechaty-puppet-puppeteer
wechaty-getting-started@0.1.23 /home/huan/chatie/wechaty-getting-started
└── (empty)

┌ huan@huan-home:~/chatie/wechaty-getting-started [09:50:12] tty:[1] jobs:[0]
└ (master) $ npm list > /dev/null
npm ERR! peer dep missing: eslint@^5.0.0, required by @typescript-eslint/eslint-plugin@1.13.0
npm ERR! peer dep missing: eslint@^5.0.0, required by @typescript-eslint/eslint-plugin-tslint@1.13.0
npm ERR! peer dep missing: eslint@^5.0.0, required by @typescript-eslint/parser@1.13.0
┌ huan@huan-home:~/chatie/wechaty-getting-started [09:50:19] tty:[1] jobs:[0]
└ (master) $ 
suntong commented 4 years ago

Yeah, I thought so. Please install wechaty-puppet-mock & wechaty-puppet-puppeteer in it, as that's another two ways of testing wechaty-getting-started, then retry the above command again. I'd think that you'd get the same result as mine, i.e., the dependency versions in wechaty-puppet-mock & wechaty-puppet-puppeteer need to be fixed as well (contrary to what I thought at the beginning of today).

[update] Ops, just saw that you've already updated the dependency versions in wechaty-puppet-mock and wechaty-puppet-puppeteer might be on the way...

huan commented 4 years ago

I understand your situation now.

Does this is a problem that blocks anything you want to do?

If it does, please try to add a unit test to fail with this case by sending a Pull Request, then I'll try to fix it.

If it does not, please wait to use the next version of wechaty (0.32), I believe then we will fix this warning.

suntong commented 4 years ago

Sorry @huan, I'm not a JS developer at all -- I have no clue how to design a unit test to fail with this case. I'm only trying to upgrade my wechaty to the latest version. I'll wait instead.

huan commented 4 years ago

No problem. I'll link your issue to another related one and close this for better tracking.

Merge to https://github.com/wechaty/wechaty/issues/1914

suntong commented 4 years ago

Hmm... I was hoping that the issue get closed when it is actually fixed. Would you drop a line here when I can try again please @huan? thanks!

huan commented 4 years ago

For this file-box related issue: I believe it's already been fixed with the @next version (v0.31.20 or above).

Please try to npm install wechaty@next and let me know if you still have any file-box related issues.

suntong commented 4 years ago

Hmm... this is what I got:

$ npm list > /dev/null
npm ERR! peer dep missing: file-box@^0.8.22, required by wechaty-puppet-mock@0.16.1
npm ERR! peer dep missing: file-box@^0.10.6, required by wechaty-puppet-puppeteer@0.18.6
npm ERR! peer dep missing: wechaty-puppet@^0.16.1, required by wechaty-puppet-mock@0.16.1
npm ERR! peer dep missing: wechaty-puppet@^0.18.3, required by wechaty-puppet-puppeteer@0.18.6
npm ERR! peer dep missing: eslint@^5.0.0, required by @typescript-eslint/eslint-plugin@1.13.0
npm ERR! peer dep missing: eslint@^5.0.0, required by @typescript-eslint/eslint-plugin-tslint@1.13.0
npm ERR! peer dep missing: eslint@^5.0.0, required by @typescript-eslint/parser@1.13.0
npm ERR! peer dep missing: eslint@>= 4.12.1, required by babel-eslint@10.0.3
npm ERR! peer dep missing: eslint@>=5.0.0, required by eslint-config-standard@12.0.0
npm ERR! peer dep missing: eslint@2.x - 6.x, required by eslint-plugin-import@2.20.1
npm ERR! peer dep missing: eslint@>=5.16.0, required by eslint-plugin-node@9.2.0
npm ERR! peer dep missing: eslint@>=5.0.0, required by eslint-plugin-standard@4.0.1
npm ERR! peer dep missing: eslint@*, required by @typescript-eslint/experimental-utils@1.13.0
npm ERR! peer dep missing: eslint@*, required by @typescript-eslint/experimental-utils@1.13.0
npm ERR! peer dep missing: eslint@*, required by @typescript-eslint/experimental-utils@1.13.0
npm ERR! peer dep missing: eslint@>=4.19.1, required by eslint-plugin-es@1.4.1
npm ERR! peer dep missing: wechaty-puppet@^0.16.1, required by wechaty-puppet-mock@0.16.1
npm ERR! peer dep missing: wechaty-puppet@^0.18.3, required by wechaty-puppet-puppeteer@0.18.6
npm ERR! peer dep missing: file-box@^0.8.22, required by wechaty-puppet-mock@0.16.1
npm ERR! peer dep missing: file-box@^0.10.6, required by wechaty-puppet-puppeteer@0.18.6

But both wechaty-puppet-mock & wechaty-puppet-puppeteer starts fine though...

huan commented 4 years ago
  1. Yes, all your puppet will be fine, don't worry about that.
  2. I believe you have some version related problems.
  3. The wechaty@0.32 will reduce those warning messages a lot.

TL;DR: you can totally ignore those messages if your puppets start fine.