Giter Club home page Giter Club logo

Comments (6)

sindresorhus avatar sindresorhus commented on May 22, 2024

Let's go with 2. We might want other options in the future.

from alfy.

sindresorhus avatar sindresorhus commented on May 22, 2024

This also made me think, should we also bundle alfred-link here, to make it a fully featured experience out of the box? We could depend on alfred-link and just proxy it in a binary here as alfy-setup/alfy-init (we might want to do other things in the future, so could be useful to have a generic name).

from alfy.

SamVerschueren avatar SamVerschueren commented on May 22, 2024

Let's go with 2. We might want other options in the future.

My thoughts exactly!

Should we also bundle alfred-link here

Yes sure, why not. One dependency instead of 3 would be a very nice improvement.

from alfy.

SamVerschueren avatar SamVerschueren commented on May 22, 2024

Ok, I started looking into this and I think we have to rethink the way we want to do this.

My first thought was that we just put alfredNotification() at the top of the index file and we're done. But, we have to have a way of disabling this behaviour (see alfy.configure()).

Option 1 - Opt-in

Instead of opt-out, we also could go for opt-in and offer a alfy.updateNotification() method. Rather have an opt-out though because this might be easily forgotten.

Option 2 - output

Run the alfredNotification() method in the alfy.output() method which will be used in all the workflows, or am I wrong here?

Option 3 - cli flag

Disable the behaviour in the workflow script with a flag (which is default true).

$ run-node index.js --no-notification

Downside is, we will have to parse this flag. We could also go for an environment variable.

Option 4 - package.json

Add an alfy section to package.json with some config options.

{
    "name": "alfred-ng2",
    "version": "0.4.0",
    "alfy": {
        "disableNotification": true
    }
}

The thing we should check for this, is it easy to read the package.json file from the workflow itself with something like read-pkg-up?


My personal favorite is option number 4 to be honest. Easy to configure for users, easily understandable and easy to add new options for the future.

But feedback is always welcome. Like to discuss this first before implementing it :).

from alfy.

SamVerschueren avatar SamVerschueren commented on May 22, 2024

I checked what read-pkg-up does when executed within Alfy, and it just returns the workflow package.json. So number 4 would be perfectly possible.

from alfy.

sindresorhus avatar sindresorhus commented on May 22, 2024

Let's go with 4.

"disableNotification": true => "updateNotification": false

from alfy.

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.