Giter VIP home page Giter VIP logo

Comments (1)

norskeld avatar norskeld commented on August 16, 2024

Obvious notes

  • Caching applies only to templates that we fetch from remotes.
  • Cached templates are stored as tarballs.

Cache directory locations

  • Linux/macOS: $HOME/.cache/arx.
  • Windows: %localappdata%/arx/.cache or %userprofile%/AppData/Local/arx/.cache.

Structure

$ARX_CACHE_DIR
└── manifest.toml
    └── tarballs
        ├── <hash>.tar.gz
        ├── <hash>.tar.gz
        └── <hash>.tar.gz

Manifest

[[templates.<entry>.items]]
timestamp = <timestamp>
hash = <hash>

This means that every cache entry (encoded combination of host, user name and repository name) may have many tarballs associated with it. Why? Well, for instance, we may first scaffold from a template using the following source string:

github:user/repo#dev

After a while the tip of that dev branch may advance, e.g. new commits can be pushed, it can be rebased, force-pushed, and so on. So if we try to scaffold again using the same source string after the branch was updated, we have two options: overwrite the existing cached tarball with a new one or download new and keep both. The latter option is non-destructive and enables "history", allowing one to use different cached tarballs.

Notes:

  • <entry> - Base 321 encoded source string in the form of: <host>:<user>/<repo>.
  • <timestamp> - Unix timestamp in millis. Used for selecting ref.
  • <hash> - SHA-256 hash of the ref, either short of full (7-40 chars). Used in filenames.

Commands (optional)

Add subcommands for manipulating cache:

  • arx cache list: list all cached templates.
  • arx cache update: try to refetch and update specified cached templates.
  • arx cache remove: remove specified cached templates.

Footnotes

  1. Should use implementation of RFC 4648 without padding.

from arx.

Related Issues (14)

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.