Skip to content

Commit

Permalink
Updated hooks for builder 0.0.12 (#13)
Browse files Browse the repository at this point in the history
* updating to builder 0.0.12

* adding tasks for running tests

* adding comment about tests
  • Loading branch information
selfcontained authored May 19, 2022
1 parent 2ce0d68 commit 5142263
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.DS_Store
.coverage
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ units of functionality encapsulated as ephemeral functions. It implements the co

If you find yourself needing to override a hook script specified by this library, you can do so in your Slack app's `/slack.json` file! Just specify a new script for the hook in question. The hooks currently provided by this repo that can be overridden are `build`, `start`, and `get-manifest`.

Below is an example `/slack.json` file that overrides the `build` script to point to your local repo for development purposes.
Below is an example `/slack.json` file that overrides the `build` script to point to your local repo for development purposes. It's using an implicit "latest" version of the https://deno.land/x/deno_slack_hooks/mod.ts script, but we suggest pinning it to whatever the latest version is.

```json
{
"hooks": {
"get-hooks": "deno run -q --unstable --allow-read --allow-net https://deno.land/x/deno_slack_hooks@0.0.5/mod.ts",
"build": "deno run -q --unstable --config=deno.jsonc --allow-read --allow-write --allow-net /<path-to-your-local-repo>/mod.ts"
"get-hooks": "deno run -q --allow-read --allow-net https://deno.land/x/deno_slack_hooks/mod.ts",
"build": "deno run -q --config=deno.jsonc --allow-read --allow-write --allow-net --allow-run /<path-to-your-local-repo>/mod.ts"
}
}
```
Expand All @@ -24,3 +24,7 @@ The [Slack CLI][cli] will automatically know to pick up your local hook definiti
This can also be used to change the flags sent to the `deno run` command if you decide to change the location of your config file, or switch to an import map instead.

[cli]: https://github.com/slackapi/slack-cli

## Running Tests

Tests can be run locally via `deno task test`. This will run unit tests as well as check formatting and linting.
5 changes: 5 additions & 0 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"tasks": {
"test": "deno test src && deno fmt --check src && deno lint src",
}
}
8 changes: 4 additions & 4 deletions src/mod.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getStartHookAdditionalDenoFlags } from "./flags.ts";

export const BUILDER_TAG = "[email protected].10";
export const BUILDER_TAG = "[email protected].12";
export const RUNTIME_TAG = "[email protected]";

export const projectScripts = (args: string[]) => {
Expand All @@ -9,11 +9,11 @@ export const projectScripts = (args: string[]) => {
"runtime": "deno",
"hooks": {
"get-manifest":
`deno run -q --unstable --config=deno.jsonc --allow-read --allow-net https://deno.land/x/${BUILDER_TAG}/mod.ts --manifest`,
`deno run -q --config=deno.jsonc --allow-read --allow-net https://deno.land/x/${BUILDER_TAG}/mod.ts --manifest`,
"build":
`deno run -q --unstable --config=deno.jsonc --allow-read --allow-write --allow-net https://deno.land/x/${BUILDER_TAG}/mod.ts`,
`deno run -q --config=deno.jsonc --allow-read --allow-write --allow-net --allow-run https://deno.land/x/${BUILDER_TAG}/mod.ts`,
"start":
`deno run -q --unstable --config=deno.jsonc --allow-read --allow-net ${startHookFlags} https://deno.land/x/${RUNTIME_TAG}/local-run.ts`,
`deno run -q --config=deno.jsonc --allow-read --allow-net ${startHookFlags} https://deno.land/x/${RUNTIME_TAG}/local-run.ts`,
},
"config": {
"watch": {
Expand Down

0 comments on commit 5142263

Please sign in to comment.