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

tmpl-followup

v0.1.2

Published

Follow up your template repo, adopt changes

Downloads

2

Readme

tmpl-followup - Follow your template repo for changes

Why

When you create a new repo from a github template repo, you lose the connection to the parent via commits. Later, when you want to transfer the changes, you can only think about manual methods. Or you can use tmpl-followup.

How

You can easily link the two repos on your machine. After that, tmpl-followup shows you the differences that you can transfer in one direction: you can move the differences from the source repo to the target repo.

First run

After you have updated (git pull) the source repo on your computer, run the npx command.

npx tmpl-followup

The first time it will ask you to create your .tmpl-followuprc file in your home folder, where you can configure your personal diff tool. Answer yes.

[TMPL-FOLLOWUP] Follow template repo
Cannot find your .tmpl-followuprc in home folder. This is necessary for diff.
? Create a /[USER]/.tmpl-followuprc file? (y/N) › true

Modify the .tmpl-followuprc file to use VScode for diffing, for example.

Configuration

Go to the folder where your target repo is. Here you will need a tmpl-followup.json configuration file. It might look like this, and this can be part of git repo (for all developers):

{
  "templateFolder": "../template-folder",
  "templateId": "tmpl-repo",
  "repoId": "repo-repo",
  "exclude": [
    "example-folder",
    "package-lock.json",
    ...
  ]
}

templateFolder: this is a mandatory field, you will do the comparisons from this folder.

templateId: source repo ID (by default the name field of source package.json)

repoId: target repo ID (by default the name field in target package.json)

exclude: files to exclude from the source repo (default is the .gitignore file of the source repo)

What is templateId and repoId?

The templateId and repoId are a very important element of the operation. When you copy the repo, you change its name. You may also create files with the same name / containing names as the new repo.

During the comparison, followup always makes sure to replace the templateId with the repoId and compare the files that way. For example, if the value of templateId is ms-starter and the value of repoId is ms-my1st-repo, then the following two files will be identical:

const appName = 'ms-starter';
console.log(`Hello ${appName}`);
const appName = 'ms-my1st-repo';
console.log(`Hello ${appName}`);

If the file does not already exist, followup can create the file. During creation, it also replaces the templateId with the repoId in the new file.

If the two repos differ only by that much, it considers the two repos to be the same.

Configuration Ex

If the owner of the source repo wants to help your work, he can also place a tmpl-followup.json file in the source repo, in which he can enter the values, in which case you need to enter only the templateFolder setting.

Hide files

Hiding files is a useful trick for followup. When there is a file in the source system that you do not want to transfer (in its entirety) to the target repo, you can choose the option to hide this file. In any case, it hides the current version of the file (it stores the corresponding hash). When this file of the source repo changes in the future, the system will show it again for comparison (and it can be hidden again with the new hash)

ps: There are cases when you take certain changes (with diff tool) but hide the rest.

Command line

The system can also be operated with command line switches.

-f the target repo folder where we want to apply the changes.

--hidden show hidden files too.