Code Monkey home page Code Monkey logo

get-repo-images's Introduction

A screenshot of the get-repo-images command being ran

CI badge

@shopify/get-repo-images

  • โšก๏ธ An extremely fast repository crawler to find images across multiple repos
  • ๐ŸŒŒ Find where the images are referenced in code... or not!
  • ๐Ÿ’พ Save the results to a JSON file
  • ๐ŸŒ Generate a Next.js website to browse, sort and filter images
  • ๐Ÿช† Sort by the file size, date created and number of references

As Shopify has scaled, our usage of illustrations in code has become fragmented across 6000+ repositories. We recently updated our illustration style and finding the illustrations, prioritising them, removing or updating them across our codebase was a challenge. We hope that @shopify/get-repo-images will be useful for anyone maintaining images at scale.

Status Owner Help
Experimental @polaris-team New issue

How to use

Make sure you have Node.js version 14 or later, then run this command from your terminal to to browse, sort and filter images from alex-page/alexpage.com.au on a Next.js website at http://localhost:3000

npx @shopify/get-repo-images -repo alex-page/alexpage.com.au

Create the files for a Next.js website into the ./repo-images-site directory

npx @shopify/get-repo-images -build -repo alex-page/alexpage.com.au

Note: If you want to run the website you can run cd repo-images-site && npm i && npm run dev

Generate a JSON file with results to ./images.json

npx @shopify/get-repo-images -json -repo alex-page/alexpage.com.au

Private repositories

Add a personal access token for private repositories. Replace TOKEN with your token.

npx @shopify/get-repo-images -repo alex-page/alexpage.com.au -token TOKEN

Advanced usage

Create a repos.config.json file and use the -config flag to access advanced options. These allow you to get the images from multiple repositories, specific image extensions or allow minimum image sizes.

npx @shopify/get-repo-images -config
{
  "repos": [
    {
      "repo": "shopify/mobile",
      "minSize": 1000,
      "extensions": ["webp"],
      "usageMatchers": ["drawable"],
      "usageNoExtension": true
    },
    {"repo": "alex-page/harmonograph.art"},
  ]
}

Technical details

@shopify/get-repo-images is built using the following technologies:

get-repo-images's People

Contributors

kiesco08 avatar dependabot[bot] avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.