Skip to content

Commit

Permalink
docs: information about type: module
Browse files Browse the repository at this point in the history
  • Loading branch information
Avivbens committed Jun 6, 2024
1 parent 2abf784 commit 3911c3c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/app/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ module.exports = {}

1. Create a Workflow via Alfred UI, or use an existing one
1. Open the Workflow directory, copy relevant files (icons, `info.plist`, `prefs.plist`, etc) to your project
1. Set `"type": "module"` in your `package.json` file - this is required for
using [`fast-alfred` runtime](./setup/runtime-explain)
1. Create a source directory for your Workflow scripts

```bash
Expand All @@ -40,7 +42,7 @@ You can import every external script from this directory regularly.
See more [here](./setup/bundler-options#productionscripts)
:::

4. Use [`fast-alfred` client](./client/client.md) utilities to manage your Workflow
5. Use [`fast-alfred` client](./client/client.md) utilities to manage your Workflow
1. Follow the [bundling guidelines](./setup/versioning-bundling) to bundle your scripts
1. Call your scripts using [`fast-alfred` runtime](./setup/runtime-explain)

Expand Down
5 changes: 5 additions & 0 deletions docs/app/setup/runtime-explain.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ next: true

The main advantage of this approach is that your Node.js script would be executed in an environment that is aware of the Alfred workflow, and it will be able to interact with it, as well as having caching and other features.

::: warning NOTE :rotating_light:
In order to use `fast-alfred` runtime, you have to configure your package as ESM module.
Add `"type": "module"` to your `package.json` file.
:::

## How It Works

At build time, an additional asset, named `run-node.sh` would be attached to the workflow, under the `assets` directory.
Expand Down

0 comments on commit 3911c3c

Please sign in to comment.