Skip to content
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

Verify that the client has the last version when he runs the CLI #37

Closed
fabienjuif opened this issue Oct 25, 2018 · 2 comments · Fixed by #52
Closed

Verify that the client has the last version when he runs the CLI #37

fabienjuif opened this issue Oct 25, 2018 · 2 comments · Fixed by #52
Assignees

Comments

@fabienjuif
Copy link
Collaborator

No description provided.

@fabienjuif
Copy link
Collaborator Author

yarn

Code: https://github.com/yarnpkg/yarn/blob/master/src/cli/commands/install.js#L1083
It calls a server that returns the version.
The requestManager seems to be a custom client that cache the dns resolution for the yarn registry: https://github.com/yarnpkg/yarn/blob/master/src/util/request-manager.js
But I think we can use anything we like (like got ?).
The URL is: https://yarnpkg.com/latest-version

idea

Maybe we can use the npmregistry: https://docs.npmjs.com/misc/registry
https://registry.npmjs.org/
I bet there is some node clients :)

@fabienjuif
Copy link
Collaborator Author

const { manifest } = require('libnpm')

manifest('gitmoji-changelog@latest')
  .then(console.log)
➜  test git:(bug/empty-tag) ✗ time node index.js
Manifest {
  name: 'gitmoji-changelog',
  version: '1.0.0',
  engines: { node: '>=10' },
  cpu: undefined,
  os: undefined,
  dependencies:
   { '@gitmoji-changelog/core': '^1.0.0',
     '@gitmoji-changelog/markdown': '^1.0.0',
     yargs: '^12.0.1' },
  optionalDependencies: {},
  devDependencies: {},
  bundleDependencies: false,
  peerDependencies: {},
  deprecated: false,
  _resolved:
   'https://registry.npmjs.org/gitmoji-changelog/-/gitmoji-changelog-1.0.0.tgz',
  _integrity:
   'sha512-eBy+f/Ef/EO7FX78+y3lTQ7nLznJt6K3TtLWQJA4Jfi2AoOaCTXfe7oVRp8MTut/Xcu53
z+fUzYbuWVMIQWBvw==',
  _shasum: '3d8837482f121930b40c7343a00117f795d963b0',
  _shrinkwrap: null,
  bin: { 'gitmoji-changelog': './src/index.js' },
  _id: '[email protected]' }
node index.js  0.31s user 0.06s system 80% cpu 0.463 total➜  test git:(bug/empty-tag) ✗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant