Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintain script through package.json #1

Open
SamVerschueren opened this issue Aug 22, 2016 · 3 comments
Open

Maintain script through package.json #1

SamVerschueren opened this issue Aug 22, 2016 · 3 comments

Comments

@SamVerschueren
Copy link
Owner

I think it would be nice if we maintained the script that is being executed by Alfred through package.json.

I don't want to specify a new property. That's why my suggestion is that we look at the main or bin property of package.json. If that property is set AND alfy is a dependency, I think we can assume the script should be

run-node {main} $1

If you are doing something differently and don't want that, you can safely remove the main (or bin) property from package.json.

Not sure which property I prefer, main or bin.

@sindresorhus
Copy link
Collaborator

👍 bin

@SamVerschueren
Copy link
Owner Author

SamVerschueren commented Aug 26, 2016

We can actually even go further and make it

{
  "bin": {
    "ng2": "index.js"
  }
}

Whereas ng2 in this case is the activation keyword. If not provided, it will use the name of the package and remove the alfred- prefix.

@sindresorhus
Copy link
Collaborator

Actually, one problem with using bin is that npm will add it as a global binary when the user install the workflow, so while bin is more correct semantically, main might be a better choice. Or we could just add a custom field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants