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

@lmc-eu/spirit-analytics

v0.3.3

Published

Analytic tools for Spirit Design System

Downloads

281

Readme

@lmc-eu/spirit-analytics

Analytic tools for Spirit Design System.

Spirit-analytics is a simple CLI tool, which parses a repository with react-scanner. The output is a JSON file or files with collected data.

Install

# NPM
npm install --save-dev @lmc-eu/spirit-analytics

# Yarn
yarn add -D @lmc-eu/spirit-analytics

Usage

Running the command without arguments will use the working directory as a root and parse the entire directory structure from this point.

spirit-analytics

You can parse only specific directories from the project with --source argument:

spirit-analytics --source ./frontend

By default, the output will be saved into the .scanner directory, but you can specify the path with the --output argument:

spirit-analytics --output path/to/folder

The react-scanner requires a config file to make it work, spirit-analytics has a default config inside, but if you need to, you can use your own config:

spirit-analytics --config path/to/config

You can easily switch from React scanner to Twig scanner using type argument. By default, both scanners will be used.

spirit-analytics --type react

You can run spirit-analytics --help to get a list of available options and examples.

Configuration

You can provide your own configuration file in the following format:

export default {
  react: {
    // react-scanner config; @see https://www.npmjs.com/package/react-scanner#config-file
  },
  twig: {
    crawlFrom: './',
    exclude: ['node_modules', 'dist', 'build', 'coverage', 'public', 'vendor', 'storybook-static'],
    configFile: './config/spirit-web-twig.yml',
    outputFile: './.scanner/adoption-data-twig.json',
    coreComponentsPath: './vendor/lmc/spirit-web-twig-bundle/src/Resources/twig-components',
  },
};

Configuration Options

React

👉 react-scanner Configuration Options

Twig

| Option | Type | Description | | ------------------ | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | crawlFrom | string | The path of the directory to start crawling from. | | exclude | array or function | Each array item should be a string or a regex. When crawling, if directory name matches exactly the string item or matches the regex item, it will be excluded from crawling. For more complex scenarios, exclude can be a a function that accepts a directory name and should return true if the directory should be excluded from crawling. | | configFile | string | Path to the local spirit-web-twig.yml configuration file. | | outputFile | string | Path to the file where the result of the analysis will be stored. | | coreComponentsPath | string | Path to the directory where are core Spirit components installed. |