From 10227311ec0370abe0dd368f1400529f6dd1b0ea Mon Sep 17 00:00:00 2001 From: Gerrit Birkeland Date: Sun, 4 Aug 2024 20:01:49 -0600 Subject: [PATCH 1/2] Add repro --- run.sh | 13 ------------- src/index.ts | 38 ++++++++++++++++++++++++++++++++++++-- tsconfig.json | 11 +++++++---- 3 files changed, 43 insertions(+), 19 deletions(-) mode change 100644 => 100755 run.sh diff --git a/run.sh b/run.sh old mode 100644 new mode 100755 index c7f88cd..a656ae0 --- a/run.sh +++ b/run.sh @@ -8,16 +8,3 @@ yarn # Run TypeDoc yarn typedoc - -echo -echo ======================================================== -echo - -# Print commands before running them, to make CI output easier to understand -set -v - -# You can add additional commands here to make assertions on the output, -# if TypeDoc's output doesn't match what you expected. Here's one example -# checking that the name from package.json is used in TypeDoc's output. - -test $(jq '.name' docs/docs.json) = '"typedoc-repros"' diff --git a/src/index.ts b/src/index.ts index c0a8215..c3e8cdf 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,38 @@ /** - * Some code reproducing a bug. + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause */ -export const bug = 123; + +/** + * Returns an iterable of integers from `start` to `end` (exclusive) + * incrementing by `step`. + * + * If `start` is omitted, the range starts at `0`. `step` defaults to `1`. + * + * @example + * + * ```ts + * render() { + * return html` + * ${map(range(8), () => html`
`)} + * `; + * } + * ``` + */ +export function range(end: number): Iterable; +/** + * Documentation on second signature + */ +export function range( + start: number, + end: number, + step?: number +): Iterable; +export function* range(startOrEnd: number, end?: number, step = 1) { + const start = end === undefined ? 0 : startOrEnd; + end ??= startOrEnd; + for (let i = start; step > 0 ? i < end : end < i; i += step) { + yield i; + } +} diff --git a/tsconfig.json b/tsconfig.json index 8b08d45..320941f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,9 @@ { - "compilerOptions": { - "strict": true - }, - "include": ["src"] + "compilerOptions": { + "module": "Node16", + "target": "ES2022", + "lib": ["ES2022"], + "strict": true + }, + "include": ["src"] } From b6713b17ca09f39d084320c903247c11f1c29c11 Mon Sep 17 00:00:00 2001 From: Gerrit Birkeland Date: Sun, 4 Aug 2024 20:04:37 -0600 Subject: [PATCH 2/2] Update node in CI script --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 6cd9a23..6fe9fbd 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -17,7 +17,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 - name: Run run: chmod +x run.sh && ./run.sh