Giter VIP home page Giter VIP logo

wallace-cli's Introduction

Wallace CLI

Pretty CSS analytics in your terminal.

Installation

npm install wallace-cli

Usage

Usage
  $ wallace <path-to-file>

Options
  --json Format as JSON instead of a table
  --help, -h Show this help

Examples
  # Point to a file
  $ wallace path/to/styles.css

  # CSS via stdin
  $ cat style.css | wallace

  # CSS from a server
  $ curl http://localhost/css/style.css | wallace

  # Format as json
  $ wallace path/to/styles.css --json

Example output

Example terminal output for this module

Related projects

  • Online CSS Analyzer - Watch the analytics from this CLI online in a much more visual and detailed way!
  • CSS Diff Action - A GitHub Action that comments on your PR with the changes in your CSS stats.
  • CSS Analyzer - The analyzer that powers this module
  • Constyble - A CSS complexity linter, based on css-analyzer. Don't let your CSS grow beyond the thresholds that you provide.

wallace-cli's People

Contributors

bartveneman avatar dependabot[bot] avatar log1x avatar nucliweb avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

wallace-cli's Issues

Can I use if target is my localhost?

I tried to use this tool with my localhost in a different ways. This is the result:

$ wallace localhost
SyntaxError: Unknown word at line 1, column 1. Source: localhost


wallace http://localhost:80
- Fetching CSS ...
TypeError: this._promise.finally is not a function

$ wallace 127.0.0.1
SyntaxError: Unknown word at line 1, column 1. Source: 127.0.0.1

Any of these commands works for me. But the tool seems works with this command: $ wallace 127.0.0.1:80. Unfortunately, the results do not seem real.

So... anyone can tell me how I need to use this tool with my localhost?

Add 'Open on projectwallace.com' link to view stats online

The CLI only gives so much room to view and visualize stats, so I'd like to add a link to open these stats on projectwallace.com.

  • Link 'Open/view on projectwallace.com'
  • Add to the bottom of the CLI output
  • Add a --no-link flag to disable this behaviour

(NB: projectwallace.com does not support opening a URL with the CSS embedded in the URL yet)

[enhancement ]: Show usage of !important rule

I believe showing the usage of the !important will be a nice-to-have in the output.
As on the stats of the CSS you already have that information I believe it is 'declarations.importants.total', it will be just a matter of showing that info on the output.

I am just not sure exactly where to put it, but as you already have empty rules, font-faces, etc ... maybe it could stay also inside the performance section, how do you feel about it?

Cannot read property '.map' of undefined

screen shot 2019-02-28 at 1 11 19 pm

this might be an issue in @projectwallace/css-analyzer, but since I found it here, I'm reporting it here. Might transfer it if it turns out to be the wrong repo.

Show browser hacks

@projectwallace/css-analyzer now supports analysis of browserhacks, so they should be shown in the default view too (JSON format shows all metrics by default)

Add tests

At the very least test for valid output of the version and some basic css stats, perhaps with the json formatter to test that option and have a simple testcase

Post CSS to projectwallace.com

It would be nice if I could analyze my css and post it to projectwallace.com.

Caveats:

  • the version of css-analyzer in wallace-cli might be different from the one running on the website
  • how to deal with authentication?

Add filename to the results table output if specified?

First off, thank you for this great tool!

I've started to use it, and have a question - or maybe a potential feature request?

I have several CSS files that I'm analyzing, and currently I'm doing that by running the CLI for each file separately, ie (in my package.json):

"styles:analyze": "wallace dist/styles/index.css && wallace dist/styles/a.css && wallace dist/styles/b.css"

When I do this, it's not super clear to tell where in the output the results end for one file and begin for the other:
Screenshot 2023-09-25 at 10 32 18 PM

Is there a way to add a header of some sort to the results table? It would be really nice if when passing a file path to analyze, that path (or at least the filename) would be added to the table. Or perhaps a way to specify a custom header via a flag?

Any thoughts or suggestions on something like that?

Node 12+ support

  • Upgrade all dependencies
  • Support Node 12+ (or maybe even 14+?)

Rewrite UI with Ink

Better testability, nicer code than all the crappy code that’s in table.js πŸ˜”

V2

This issue functions as a todo list for all tasks for V2.

  • Use ink-spinner instead of ora
  • Replace --compact/-c with --verbose/-v | #37, #38
  • Should --verbose impact --format=json?
  • Rewrite UI completely with ink | #47
  • Rewrite tests

Remove built-in css-fetching

The headless CSS fetching mechanism requires a whole lot of dependencies and install time. I think it should be separated so that it would would be two different steps, using get-css or someone just piping a local file into wallace-cli:

get-css https://www.projectwallace.com > wallace

base64 embed detection?

It would be nice to have a section list out base64 embeds along with their filesizes. Thank you for the wonderful app!

Add LOC/sLOC metrics

  • @projectwallace/css-analyzer needs to be updated to 2.5.0 for this
  • Add them to the Complexity section

HTTPError: Response code 404 (Not Found)

I was trying this tool out and found that I always get a 404 error when using it. Both when installed using npm install -g or when using it with npx, see logs below. Oddly enough the tool seems to work fine when I clone the repository and run src/cli.js...

# with npm install -g
$ wallace projectwallace.com
HTTPError: Response code 404 (Not Found)

# with NPX
$ npx wallace-cli projectwallace.com
[...]
HTTPError: Response code 404 (Not Found)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.