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

@kano/kit-app-shell-cli

v0.0.3-alpha.90

Published

Run, build, test, deploy apps from your terminal

Downloads

74

Readme

@kano/kit-app-shell-cli

Run, build, test, deploy apps from your terminal

Installation

yarn global add @kano/kit-app-shell-cli

kash --version

Usage

Start by running kash --help to discover the available commands

Usage: kash <command> <args> [options]

Commands:
  run <platform> --help        Show help for the run command
  build <platform> --help      Show help for the build command
  test <platform> --help       Show help for the test command
  configure <platform> --help  Show help for the configure command
  open config                  Open the location of your configuration

Options:
  --help     Show help                                                    [commands: help] [boolean]
  --version  Show version number                                       [commands: version] [boolean]

Config files

Configuration files can define options for commands and platforms. THere are two kinds of configuration files, the local rc, a personal file containing options specific to the current machine or user and the project's config, containing the options for a specific project.

You can see your own config file by running kash open config.

A project's config file must be located at the root of the porject and be named either:

  • 'kit-app-shell.conf.js'
  • '.kit-app-shell.conf.js'
  • 'kash.conf.js'
  • '.kash.conf.js'

The config file being a js module, you must export the configuration object.

Personal config

This config is mainly used to store your personal preferences and credentials. You can modify the JSON file manually, but kash provides a way to update this file through the configure CLI command.

kash configure Will let you configure the CLI while kash configure <platform> will let you configure a specific platform.

Project config

You can import the types from the core module to have access to autocompletion of your configuration file

/**
 * @type {import('@kano/kit-app-shell-core/types').KashConfig}
 */
module.exports = {
  run: {/* ... */},
  build: {/* ... */},
};

Autocomplete example 1 Autocomplete example 2

Env config

You can customize the temporaru directory for kash. This allows you to write to a directory you have the rights to, or avoid writing cached data to a volatile volume on systems like Docker.

Use the KASH_TMP_DIR env variable to set it.

Development

Speed

There is something frustrating about slow CLIs. To avoid that, this project tries to only load what is needed to ensure optimal speed.

The CLI routes the user through all the features of the core library and each platform implementation. Using a late require strategy, only the needed resources will be loaded for the path th user is taking.

kash --version should absolutely not load more than the tools to parse and display the version, the same goes for kash --help

In a similar fashion, kash build android should not load the test frameworks and kash test android should not load the build tools.

In this project you will see require statements that use paths instead of module name e.g.:

const util = require('@kano/kit-app-shell-core/lib/util');
// instead of
const { util } = require('@kano/kit-app-shell-core');

While this is usually an anti pattern and can introduce issues when moving files around, this improves the speed of the commands drastically.

To provide some context, here are the times for printing the version of some CLIs (No benchmark, just ran on one's machine) (Keep in mind, node itself takes ~150ms to boot):

|Command|Time| |---|---| |npm --version|~700ms| |rollup --version|~400ms| |yarn --version|~300ms| |kash --version|~200ms| |git --version|~50ms|

TODO:

  • Add a flag for the reporter
  • Add a JSON reporter
  • Add kash configure to configure the choosen reporter and other personal options