Skip to content
This repository was archived by the owner on Jul 28, 2021. It is now read-only.

Conversation

@larsgw
Copy link
Contributor

@larsgw larsgw commented Nov 30, 2018

Add a PackageSummary for a consistent 3-line information-dense summary of a package. With Box:

screenshot_20181130_211655

Without (not possible currently, I didn't include it due to the way it looks with other content around it):

screenshot_20181130_211834

Some TODOs:

  • Description and keywords should be cut off if too long (we don't want extra lines)
  • I think the other thing was "wrap lines if too long", but that's completely contradictory, so scratch that

See #11 (comment) (@chrisforrette)

@larsgw larsgw mentioned this pull request Dec 1, 2018
3 tasks

class PackageSummary extends Component {
render () {
let { packument, spec, json } = this.props

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the packument thing? Looking at getData, it looks like it's a different format than what comes back for search results—here's an example:

{
  package: {
    name: 'goog',
    scope: 'unscoped',
    version: '0.2.1',
    description: 'Server-side Google Closure with Node.js',
    links: {
    npm: 'https://www.npmjs.com/package/goog',
      homepage: 'https://github.com/hsch/node-goog#readme',
      repository: 'https://github.com/hsch/node-goog',
      bugs: 'https://github.com/hsch/node-goog/issues'
    },
    author: {
      name: 'Hendrik Schnepel', url: 'hendrik.schnepel@gmail.com'
    },
    publisher: {
      username: 'hsch',
      email: 'hendrik.schnepel@gmail.com'
    },
    maintainers: [ { username: 'hsch', email: 'hendrik.schnepel@gmail.com' } ]
  },
  flags: { unstable: true },
  score: {
    final: 0.0333453077955526,
    detail: {
      quality: 0.10500992679095593,
      popularity: 0.0052637993093309285,
      maintenance: 0
    }
  },
  searchScore: 100000.03
}

Unless this is being reused elsewhere, it would be nice if this component accommodated that format, unless I'm missing something about packument...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Completely forgot about this, sorry. The packument is what the npm APIs return when querying for a package, but to use that in the search result would require additional API calls which isn't ideal for a responsive interface. I'll add a PackageSearchResult component.

@zkat
Copy link
Contributor

zkat commented Jan 3, 2019

This looks great! Happy to merge this pending @chrisforrette's comments and the rest of your TODO 👍

@larsgw larsgw force-pushed the larsgw/tink-view-2 branch from 8714577 to cc587e8 Compare January 3, 2019 23:45
@larsgw
Copy link
Contributor Author

larsgw commented Jan 3, 2019

I added a PackageSearchResult and a fix for the TODO.

Copy link

@chrisforrette chrisforrette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@chrisforrette
Copy link

@larsgw Hey there, I'm waiting on this to land to wrap up #11. Aside from fixing the build and updating from master are there any other hold-ups to merging this?

@larsgw
Copy link
Contributor Author

larsgw commented Jan 31, 2019

@chrisforrette right, I didn't notice this wasn't working

Add a PackageSummary for a consistent 3-line information-dense summary 
of a package.
@larsgw larsgw force-pushed the larsgw/tink-view-2 branch from cc587e8 to 7bc6f79 Compare January 31, 2019 19:32
@larsgw
Copy link
Contributor Author

larsgw commented Jan 31, 2019

@zkat do I need to do anything else before merge?

@chrisforrette
Copy link

@zkat Hey Kat! Can we merge this thinger?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants