Skip to content

Commit 1434378

Browse files
chore: update to latests Deno and CLI standards (#44)
1 parent 92aafdb commit 1434378

File tree

13 files changed

+61
-48
lines changed

13 files changed

+61
-48
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"

.github/workflows/deno.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ name: Deno app build and testing
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches:
6+
- main
67
pull_request:
7-
branches: [ main ]
8+
branches:
9+
- main
810

911
jobs:
1012
deno:
@@ -18,7 +20,7 @@ jobs:
1820
- name: Setup Deno
1921
uses: denoland/setup-deno@v1
2022
with:
21-
deno-version: v1.x
23+
deno-version: v2.x
2224

2325
- name: Verify formatting
2426
run: deno fmt --check

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
dist
22
package
33
.DS_Store
4-
.slack/apps.dev.json

.slack/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
apps.dev.json
2+
cache/

.slack/apps.json

Lines changed: 0 additions & 1 deletion
This file was deleted.
File renamed without changes.

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ $ slack activity --tail
157157
Contains `apps.dev.json` and `apps.json`, which include installation details for
158158
development and deployed apps.
159159

160+
Contains `hooks.json` used by the CLI to interact with the project's SDK
161+
dependencies. It contains script hooks that are executed by the CLI and
162+
implemented by the SDK.
163+
160164
### `datastores/`
161165

162166
[Datastores](https://api.slack.com/automation/datastores) securely store data
@@ -189,11 +193,6 @@ continuing to the next step.
189193
The [app manifest](https://api.slack.com/automation/manifest) contains the app's
190194
configuration. This file defines attributes like app name and description.
191195

192-
### `slack.json`
193-
194-
Used by the CLI to interact with the project's SDK dependencies. It contains
195-
script hooks that are executed by the CLI and implemented by the SDK.
196-
197196
## Resources
198197

199198
To learn more about developing automations on Slack, visit the following:

deno.jsonc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://deno.land/x/deno/cli/schemas/config-file.v1.json",
2+
"$schema": "https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json",
33
"fmt": {
44
"include": [
55
"README.md",
@@ -13,7 +13,6 @@
1313
"workflows"
1414
]
1515
},
16-
"importMap": "import_map.json",
1716
"lint": {
1817
"include": [
1918
"datastores",
@@ -28,6 +27,12 @@
2827
},
2928
"lock": false,
3029
"tasks": {
31-
"test": "deno fmt --check && deno lint && deno test --allow-read --allow-none"
30+
"test": "deno fmt --check && deno lint && deno test --allow-read"
31+
},
32+
"imports": {
33+
"@std/assert": "jsr:@std/assert@^1.0.13",
34+
"@std/testing": "jsr:@std/testing@^1.0.12",
35+
"deno-slack-sdk/": "https://deno.land/x/[email protected]/",
36+
"deno-slack-api/": "https://deno.land/x/[email protected]/"
3237
}
3338
}

functions/send_time_off_request_to_manager/blocks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default function timeOffRequestHeaderBlocks(inputs: any): any[] {
99
type: "header",
1010
text: {
1111
type: "plain_text",
12-
text: `A new time-off request has been submitted`,
12+
text: "A new time-off request has been submitted",
1313
},
1414
},
1515
{

functions/send_time_off_request_to_manager/blocks_test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";
1+
import { assertEquals } from "@std/assert";
22
import timeOffRequestHeaderBlocks from "./blocks.ts";
33

4-
Deno.test("timeOffRequestHeaderBlocks generates valid blocks for inputs without reason", async () => {
4+
Deno.test("timeOffRequestHeaderBlocks generates valid blocks for inputs without reason", () => {
55
const expectedBlocks = [
66
{
77
type: "header",
@@ -17,15 +17,15 @@ Deno.test("timeOffRequestHeaderBlocks generates valid blocks for inputs without
1717
},
1818
{ type: "section", text: { type: "mrkdwn", text: "*Reason:* N/A" } },
1919
];
20-
const blocks = await timeOffRequestHeaderBlocks({
20+
const blocks = timeOffRequestHeaderBlocks({
2121
employee: "U12345",
2222
start_date: "2022-03-01",
2323
end_date: "2022-03-10",
2424
});
2525
assertEquals(blocks, expectedBlocks);
2626
});
2727

28-
Deno.test("timeOffRequestHeaderBlocks generates valid blocks for full inputs", async () => {
28+
Deno.test("timeOffRequestHeaderBlocks generates valid blocks for full inputs", () => {
2929
const expectedBlocks = [
3030
{
3131
type: "header",
@@ -44,7 +44,7 @@ Deno.test("timeOffRequestHeaderBlocks generates valid blocks for full inputs", a
4444
text: { type: "mrkdwn", text: "*Reason:* On vacation!" },
4545
},
4646
];
47-
const blocks = await timeOffRequestHeaderBlocks({
47+
const blocks = timeOffRequestHeaderBlocks({
4848
employee: "U12345",
4949
start_date: "2022-03-01",
5050
end_date: "2022-03-10",

0 commit comments

Comments
 (0)