GithubHelp home page GithubHelp logo

Comments (6)

denar90 avatar denar90 commented on May 9, 2024 1

Oh, got your point. Make sense.
Lets do it 💪 I'm ok to make it in scope of yargs PR. Jut make PR against yargs branch, so I'll merge it together.

from pwmetrics.

paulirish avatar paulirish commented on May 9, 2024 1

I suppose this is done, now that we have our combined refactor in place? :)

Pedro, feel free to reopen if we got more here!

from pwmetrics.

denar90 avatar denar90 commented on May 9, 2024

SGTM
just one question about #48
What exactly do you wanna improve? Passing flags from confg file?

from pwmetrics.

pedro93 avatar pedro93 commented on May 9, 2024

I was thinking of populating the pwmetrics object with the properties from the config file in case one exists. If there are repeated parameters both in a config file and from the cmd line, then the cmd line should take precedent.
Imagine something like:

performance.config.js

module.exports = {
    url: "http://github.com",
    json: false,
    runs: 5,
    flags: {
        expectations: true,
    },
    sheets: {
        // sheets configuration
    },
    expectations: {
        ttfmp: {
            warn: '>=3000',
            error: '>=5000',
        },
        tti: {
            warn: '>=5000',
            error: '>=15000',
        },
        ttfcp: {
            warn: '>=1500',
            error: '>=3000',
        },
        psi: {
            warn: '>=3000',
            error: '>=6000',
        },
    },
};

Bash

$ pwmetrics --config="path/to/file.js" --json

The json option in the terminal overrides the config option. A use case for this would be wanting to see results with slightly different options but no having to change the actual file (which you may not have permissions to edit). This would also potentially allow any configuration to be set via the command line that can also be set in the config file.

This logic should be done IMO in the bin/cli.js file after yargs has been merged, hence the dependency.

from pwmetrics.

pedro93 avatar pedro93 commented on May 9, 2024

@paulirish do you approve? If so I will start working on this. I do have a question though, what is the rationale behind this loop?
https://github.com/paulirish/pwmetrics/blob/master/bin/cli.js#L24

from pwmetrics.

denar90 avatar denar90 commented on May 9, 2024

from pwmetrics.

Related Issues (20)

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.