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

Add support for user-configurable workflows #113

Merged
merged 4 commits into from
Jun 5, 2021
Merged

Add support for user-configurable workflows #113

merged 4 commits into from
Jun 5, 2021

Conversation

SamVerschueren
Copy link
Collaborator

@SamVerschueren SamVerschueren commented Sep 16, 2019

This PR fixes #36 by adding support for user configurable workspaces. It's as simple as creating a config.json file in your workflow package and it will open it with the default text editor when installing the workflow.


IssueHunt Summary

Referenced issues

This pull request has been submitted to:


index.js Outdated Show resolved Hide resolved
@@ -378,6 +378,19 @@ alfy.config.get('unicorn');
//=> '🦄'
```

#### userConfig
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we have to document how this works? By creating a config.json file in the root of your package? Or link directly to https://github.com/SamVerschueren/alfred-config#workflow-configuration?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a short description of how it works, and then link to alfred-config for more details. I would also include the use-cases here. Not clear from the property what a Alfred workflow creator would use it for when they read the docs.

https://github.com/SamVerschueren/alfred-config#workflow-configuration should describe where to put the JSON file, etc.

@sindresorhus sindresorhus changed the title Add support for user configurable workflows - fixes #36 Add support for user-configurable workflows Sep 23, 2019
index.js Outdated Show resolved Hide resolved
@@ -378,6 +378,19 @@ alfy.config.get('unicorn');
//=> '🦄'
```

#### userConfig
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a short description of how it works, and then link to alfred-config for more details. I would also include the use-cases here. Not clear from the property what a Alfred workflow creator would use it for when they read the docs.

https://github.com/SamVerschueren/alfred-config#workflow-configuration should describe where to put the JSON file, etc.

readme.md Outdated Show resolved Hide resolved
readme.md Outdated

Type: `object`

If the workflow supports user configuration, it will export a readable [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) with the user workflow configuration.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it always export the Map? Only it will be empty if the workflow doesn't support user config. It's also not clear what it means for a workflow to "support user configuration".

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, it seems that it does export a Map always.

@sindresorhus
Copy link
Owner

Awesome how few changes index.js needed :)

@sindresorhus
Copy link
Owner

@SamVerschueren Bump, in case you missed it. If you're just busy, feel free to ignore.

@SamVerschueren
Copy link
Collaborator Author

Should definitely finish this one :). Thanks for the reminder.

@sindresorhus
Copy link
Owner

@SamVerschueren Bump :)

Base automatically changed from master to main January 23, 2021 07:48
@sindresorhus sindresorhus mentioned this pull request Jun 3, 2021
@sindresorhus
Copy link
Owner

Closing for lack of activity.

@SamVerschueren
Copy link
Collaborator Author

I feel so bad for letting this one go stale. I think we are super close though.

I addressed your feedback. I'm going to upgrade the dependencies of alfred-config and clean it up a bit as well.

@SamVerschueren
Copy link
Collaborator Author

Tests are failing, waiting for #135.

@sindresorhus could you check that the docs are better? It's been a while since I worked on this. I think it would be nice to have a link to a Alfy workflow which uses this. I could for instance setup a alfy-example package or something which has this and could work as a showcase.

I'm thinking about a workflow which shows you all the pokemon, and allows you to specify the levenstein distance for fuzzy search. If you have anything better, I'm up for it 😂 .

index.js Show resolved Hide resolved
@SamVerschueren
Copy link
Collaborator Author

Fixed alfred-config and tested it locally if it still works as expected :p. Seems to work fine :).

@sindresorhus
Copy link
Owner

I feel so bad for letting this one go stale.

Don't worry. I was just trying to clean up my PR list.

@sindresorhus
Copy link
Owner

I agree it would be useful to link to an example. It's not entirely clear still how you would set up everything.

I'm thinking about a workflow which shows you all the pokemon, and allows you to specify the levenstein distance for fuzzy search. If you have anything better, I'm up for it 😂 .

I like the idea of Pokemon list, but I would make the language configurable.

@sindresorhus sindresorhus merged commit c73c325 into main Jun 5, 2021
@sindresorhus sindresorhus deleted the issue36 branch June 5, 2021 12:32
@sindresorhus
Copy link
Owner

Thanks for finishing this :)

@SamVerschueren
Copy link
Collaborator Author

Oh configurable language is a good one 🎉

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

Successfully merging this pull request may close these issues.

Configuring workflows
2 participants