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

ern-container-transformer-git-patch

v1.0.4

Published

This transformer allows for patching any file of the Container using a patch file generated by git (through `git diff`). It accepts one or more patch files to apply. Each patch file will be applied sequentially by the transformer using the `git apply` co

Downloads

47

Readme

Git Patch Container Transformer

This transformer allows for patching any file of the Container using a patch file generated by git (through git diff). It accepts one or more patch files to apply. Each patch file will be applied sequentially by the transformer using the git apply command.

There are different ways to create a git patch file, one of them being to just use the git diff command on a modified Container.

For example, after generating a Container locally, just cd into the directory where the Container was generated and run git init . to create a new git repository, followed by git commit -a -m "Initial Commit" to create the first commit. Then you can do any changes that need to be done to the Container. Updating some of the source code of the Container, or some configuration files. Then once the changes are done, it is possible to create the patch file containing all changes through git diff > patch_file_name.patch.

The patch can then be applied automatically after Container generation, using this transformer.

Inputs

  • containerPath : Path to the Container to transform
  • patchFiles : Array containing a list of path to git generated patch files to apply to the Container.
    Paths can be local paths (for ex /Users/username/patch/git.patch) or can be paths to a patch file stored in the Cauldron (for ex cauldron://patch/git.patch).
    As a reminder, it is possible to add a file to the Cauldron using Electrode Native cauldron add file command.

Notes

The patch will be applied from the root Container directory, so make sure to create the diff from the root of the Container.

Usage

With ern transform-container CLI command

$ ern transform-container --containerPath /patch/to/container -t git-patch -e '{"patchFiles":["/local/path/to/a.git.patch", "cauldron://path/to/another.git.patch"]}' --platform android'

Instead of passing the whole configuration on the command line for --extra/-e, it is also possible to use a file path to a json file holding the configuration, or a path to a file stored in the Cauldron. Check out the ern transform-container command documentation for more info.

With Cauldron

To automatically transform the Cauldron generated Containers of a target native application and platform, you can add a transformer entry in the Cauldron in the Container generator configuration object as follow:

Electrode Native <= 0.31

"transformers": [
  {
    "name": "ern-container-transformer-git-patch",
    "extra": {
      "patchFiles": [
        "/local/path/to/a.git.patch",
        "cauldron://path/to/another.git.patch"
      ]
    }
  }
]

Electrode Native >= 0.32

"pipeline": [
  {
    "name": "ern-container-transformer-git-patch",
    "extra": {
      "patchFiles": [
        "/local/path/to/a.git.patch",
        "cauldron://path/to/another.git.patch"
      ]
    }
  }
]

Programmatically

import GitPatchTransformer from 'ern-container-transformer-git-patch'
const transformer = new GitPatchTransformer()
transformer.transform(
  {
    /* Local file system path to the Container */
    containerPath: string
    /* Extra data specific to this publisher */
    extra?: {
      patchFiles: string[],
    }
  }
})