npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@github/webgl-globe

v0.0.69

Published

WebGL Globe for the github.com home page and beyond.

Downloads

16

Readme

This project powers the sweet animated Globe shown on the GitHub homepage. Code is maintained by the Marketing Platform Services and Site Design teams.

💻 Development

Using GitHub Codespaces is the recommended way to get this project up and running. It will install all the required dependencies and set the correct Node.js version (currently 18.17.1).

Running the Globe standalone

If you want, you can run the server on its own. Just make sure to test your changes on dotcom as well (see below):

$ npm start

Then visit http://localhost:8082.

Running the Globe on Dotcom

This will allow you to test the Globe within the actual Dotcom homepage.

  1. Open a Codespace for the Globe and run the server with:
npm start
  1. In the Codespace, change the port visibility of the Globe URL to public (private to org won't work with the CSP setup).

  2. Open another Codespace for Dotcom and run it with the GLOBE_SERVER_URL environment variable set to the URL from the previous step:

GLOBE_SERVER_URL=public_url_from_globe_codespace... script/server
  1. Enable the home_page_globe feature flag on the Dotcom Codespace:
$ bin/toggle-feature-flag enable home_page_globe
  1. Visit http://github.localhost.

Debugging WebGL

If you wish to grab the WebGL context for debugging purposes, you can (both on .com and in this repo) get the WebGL context by pasting the following lines into the Console:

let canvas = document.querySelector('.js-globe-canvas');
let context = canvas.getContext('webgl2');

You could then, for example, trigger a WebGL context loss:

context.getExtension('WEBGL_lose_context').loseContext();

Debugging timestamps

We are using github/time-elements to create the relative time string on the hover cards. The custom webcomponent is included on Dotcom and only included here in devDependencies.

For testing the globe without Dotcom, uncomment import '@github/time-elements' in data-info.js to include it in the local bundle.

🚀 Deployment

This project is bundled as an NPM package and consumed on dotcom.

When you are ready to release a new version, create a new GitHub Release with the desired version number. Once the release is created, a GitHub Action will automatically publish the package to the NPM registry.

Once the new version is released, you'll want to go back to dotcom and bump the package version. You can use npm to do this:

# [on dotcom]
$ npm install @github/webgl-globe@<version> -w npm-workspaces/marketing-platform-services

Changes on the package version should be visible in Marketing Platform Services's package.json on Dotcom. Now, make sure to commit your changes ☺

# [on dotcom]
$ git add .
$ git commit -m 'Bump @github/webgl-globe'

When you're ready to deploy your changes, follow the typical Dotcom deployment process.

⎌ Rollback

If you've shipped a bad version of the Globe, the simplest way to roll back your changes is to use git revert.

Then you'll need to create a new GitHub release with a new version number, update it on dotcom, and deploy it (see 🚀 Deployment section above).

📈 Data Service

Curious about how the data makes its way into the globe? Check out the Data Service Overview doc.