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

@telicent-oss/telicent-frontend-cli

v1.2.1

Published

A CLI for FE engineers

Downloads

383

Readme

Telicent Frontend CLI ("TEFE" CLI)

CLI package to capture & propagate Telicent frontend opinion on code, config & tools

Install this in each npm package repository to provide:

  1. Some scripts to manually-trigger
    • idea: generate Telicent-flavoured™ Cypress config
  2. Some scripts to use in hooks
    • idea: echo "tefe test-only-changed-files" >> ./husky/pre-commit
  3. Some self-executing checks
    • idea: on CI, check yarn.lock didn't change after yarn install

And perhaps if we add globally-useful dev-scripts, we end up using this as a global install on our dev machines

Install

# Install within a package
cd <npm package directory>;
yarn add @telicent-oss/telicent-frontend-cli
# IMPORTANT: If you use `yarn` to install in local package, prefix with "yarn" (e.g. `yarn tefe`) to ensure you don't use a globally installed tefe

To test:

yarn tefe version # or `tefe version` for global version

Usage

All commands are available via tefe help:

Usage: tefe [options] [command]

Options:
  -h, --help               display help for command

Commands:
  version                  read version
  info                     Get context to help CLI developers
  hook-precommit           Telicent frontend precommit hook
  hook-postinstall         Telicent frontend postinstall hook
  config [options]         Show current directoryʼs ./tefe.config.json
  npmrc-authtoken [value]  Fetch NPM configuration tokens from the nearest
                           npmrc file (WARNING: Has limitations see
                           extractTokens.ts TODO)
  help [command]           display help for command

Note: This package uses update-notifier

Tips

  1. TypeScript source files import with .js extension e.g. import a from './path.js (as ./src/**/*.ts files are emitted and run from ./dist/**/*.js)

  2. JavaScript test files must not include any extension in imports import a from './path';

  3. CLI developer workflows require heavy use of symlinks via

  4. It might help to familiarise yourself with the general process of building CLI tools

Dev workflow

# To use (and develop) locally:
git clone git@telicent-oss/telicent-frontend-cli
cd telicent-frontend-cli
yarn link # creates symlink
# Sym-link/bin changes (e.g. package.json "bin" field) require:
yarn unlink && yarn link

Then for every local package you wish to use this cli:

cd <package>
yarn link @telicent-oss/telicent-frontend-cli

Or to use the package globally:

yarn global link @telicent-oss/telicent-frontend-cli

Best Practices

Automate - When you have an idea for a CLI task:

  • Try to automate the task
  • Else, try to automate part of the task
  • Else, try to automate errors/warnings
  • Else, create some feedback to help the next idea

Inter-operability: Bias for CLI scripts running (consistently) on as many different platforms as possible — including stripped down CI machines. So:

  • avoid non-node code
  • target node 16
  • do not bundle, to allow easy ssh-debugging/editing of scripts on CI machines

Usefulness: Avoid being so precious about the code that nothing gets added