question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parse package name and latest version from artifactory

See original GitHub issue

Feature Request

Description

Badge in terra-doc-template looks for package in npm repository, However we have package published in internal repo and would like to reference.

Additional Context / Screenshots

We could have new prop called internalNpmPackage in DocTemplate. If we have user defined value for the prop then we build href and img src with internal repository url otherwise always fallback to normal npm lookup.

screen shot 2018-08-30 at 3 06 08 pm

Cosiderations

We have npm package published to internal artifactory and would like to fetch package name and latest version to display.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
bjankordcommented, Nov 13, 2018

Ran into an issue that made me think about this issue. The doc site has a stale deployment where the npm badge pulls the latest version from the released npm package, but the docs show an older version. This causes confusion as the user will think they are looking at the latest released docs.

This can happen if npm publish is successful but the doc site deploy fails. Edit: Or someone like me forgets to do doc deployment after release.

This made me think that this badge should be pulling the version directly from the package.json file instead of pulling from npm service. I think this could mitigate all the concerns noted on this issue.

0reactions
bjankordcommented, Aug 6, 2019

Talked with @mmalaker and @amichaelparker about this today. VoiceOver in Safari seems to get trapped in the SVG DOM loaded as a background image in this img.

Planning to update this so it is no longer a dynamically generated SVG via badgegen.

Tech Design

Replace this rendering with the following which would use a new prop packageVersion.

// do some cool styling in here via the .badge class to make this look nice.
 const badge = (
    <a className={cx('badge')} href={`https://www.npmjs.org/package/${packageName}`}>
      <span>Version:</span><span>{`${packageVersion}</span>
    </a>
  );

In our example files, we pull the packageName from the package.json file for the component. We could pull the package version as well and pass this into the <DocTemplate /> component.

import { name, version } from '../../../../package.json';

<DocTemplate
    packageName={name}
    packageVersion={version}
/>

Considerations

  • To keep this passive, we should only conditionally render the markup if the packageVersion prop is set, otherwise, fallback to the current rendering.
  • We could add a packageUrl prop that users could pass in. We could look into defaulting this to https://www.npmjs.org/package/${packageName} if you don’t pass in a packageUrl
Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I fetch the build versions from Artifactory repository
2) Download and parse the maven-metadata.xml file inside this folder. This file contains information about available versions.
Read more >
Artifactory REST API - Artifactory 6.x - JFrog Wiki
Retrieve Latest Artifact. Description: Retrieves the latest artifact version from the specified destination. Latest Maven Release/Integration: Specify SNAPSHOT ...
Read more >
Xray REST API - JFrog - JFrog Documentation
Learn how to use and configure cURL here. Base URL. New API Version. From version 2.4, JFrog Xray is introducing a new REST...
Read more >
PyPI Repositories - JFrog - JFrog Documentation
For Artifactory to handle those packages correctly as PyPI packages they must be uploaded with pypi.name and pypi.version Properties. Automatic ...
Read more >
Release Notes - Artifactory 6.x - JFrog Wiki
Overview. This page presents release notes for JFrog Artifactory describing the main fixes and enhancements made to each version as it is released....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found