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

Better dependency management, run tests against high and low version of deno #79

Merged
merged 6 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/deno.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deno
name: Deno Format, Lint and Unit Tests

on:
push:
Expand All @@ -9,13 +9,18 @@ on:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
# we test on both most recent stable version of deno (v1.x) as well as
# the version of deno used by Run on Slack (as noted in https://api.slack.com/slackcli/metadata.json)
deno-version: [v1.x, v1.45.4]
steps:
- name: Setup repo
uses: actions/checkout@v4
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
deno-version: ${{ matrix.deno-version }}
- name: Run formatter, linter and tests
run: deno task test
- name: Generate CodeCov-friendly coverage report
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ jobs:
- slack-samples/deno-message-translator
- slack-samples/deno-request-time-off
- slack-samples/deno-simple-survey
# we test on both most recent stable version of deno (v1.x) as well as
# the version of deno used by Run on Slack (as noted in https://api.slack.com/slackcli/metadata.json)
deno-version: [v1.x, v1.45.4]

steps:
- name: Setup Deno
- name: Setup Deno ${{ matrix.deno-version }}
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
deno-version: ${{ matrix.deno-version }}

- name: Checkout the api
uses: actions/checkout@v4
Expand All @@ -37,10 +40,10 @@ jobs:
path: ./sample

- name: Set imports.deno-slack-api/ to ../deno-slack-api/src/ in import_map.json
run: >
run: >
deno run
--allow-read --allow-write --allow-net
deno-slack-api/scripts/import_map/update.ts
deno-slack-api/scripts/src/import_map/update.ts
--import-map "./sample/import_map.json"
--parent-import-map "./deno-slack-api/deno.jsonc"
--api "../deno-slack-api/src/"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { isHttpError } from "@std/http/http-errors";
import { mf } from "../../src/dev_deps.ts";
import { mf } from "../../../src/dev_deps.ts";
import { assertEquals, assertRejects } from "@std/assert";
import { afterEach, beforeAll } from "@std/testing/bdd";
import { apiDepsIn } from "./update.ts";
Expand Down
6 changes: 2 additions & 4 deletions src/typed-method-types/workflows/triggers/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,9 @@ type InputSchema<Params extends InputParameterSchema> = Params extends
type WorkflowInputsType<Params extends InputParameterSchema> =
// This intentionally avoids Distributive Conditional Types, so be careful removing any of the following square brackets
// See https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types for more details
[keyof Params["properties"]] extends [string]
// Since never extends string, must check for no properties
[keyof Params["properties"]] extends [string] // Since never extends string, must check for no properties
? [keyof Params["properties"]] extends [never] ? EmptyInputs
: Params["required"] extends Array<infer T> ? [T] extends [never]
// If there are no required properties, inputs are optional
: Params["required"] extends Array<infer T> ? [T] extends [never] // If there are no required properties, inputs are optional
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These were a newer deno version's deno fmt changes.

? PopulatedInputs<Params>
// If there are required params, inputs are required
: Required<PopulatedInputs<Params>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ Deno.test("Mock call for webhook", async (t) => {
);
}
mf.reset();

mf.reset();
},
);
});
Expand Down
Loading