From f6dc78c5dae39860d236c4b43187d9612a3471b5 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Tue, 19 Mar 2024 08:11:21 +1100 Subject: [PATCH 1/8] experiment: troubleshoot #4494 --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cee6d97be406..526485a10ab1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,7 +69,6 @@ jobs: run: ./_tools/release/03_release.ts lint: - runs-on: ubuntu-22.04 steps: - name: Clone repository uses: actions/checkout@v4 From 1008ff9519764c79818cb9ca217baae78eb692ae Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Tue, 19 Mar 2024 08:15:07 +1100 Subject: [PATCH 2/8] x --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 526485a10ab1..fd2b6a04bb30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,6 +69,7 @@ jobs: run: ./_tools/release/03_release.ts lint: + runs-on: ${{ matrix.os }} steps: - name: Clone repository uses: actions/checkout@v4 From 6ede94c6ceb32c55085650d2e1cbb0432d572eb4 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Tue, 19 Mar 2024 08:19:17 +1100 Subject: [PATCH 3/8] x --- .github/workflows/ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd2b6a04bb30..0921f05c31a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,6 +70,17 @@ jobs: lint: runs-on: ${{ matrix.os }} + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + deno: + - v1.x + - canary + os: + - ubuntu-22.04 + - windows-2022 + - macOS-12 steps: - name: Clone repository uses: actions/checkout@v4 From efaa4895ad768e3093d37fcd08c40c290da46d52 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Tue, 19 Mar 2024 09:03:04 +1100 Subject: [PATCH 4/8] work --- .github/workflows/ci.yml | 1 + _tools/check_mod_exports.ts | 66 ++++++++++++++++++------------------- 2 files changed, 33 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0921f05c31a4..fba89861c996 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,6 +101,7 @@ jobs: - name: Spell-check uses: crate-ci/typos@master + if: matrix.os == 'ubuntu-22.04' with: config: ./.github/typos.toml diff --git a/_tools/check_mod_exports.ts b/_tools/check_mod_exports.ts index 6e4f05153782..124b74ade93f 100644 --- a/_tools/check_mod_exports.ts +++ b/_tools/check_mod_exports.ts @@ -1,34 +1,24 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { exists } from "../fs/exists.ts"; -import { join } from "../path/join.ts"; +import { walk } from "../fs/walk.ts"; +import { relative } from "../path/relative.ts"; +import { dirname } from "../path/dirname.ts"; import * as colors from "../fmt/colors.ts"; import ts from "npm:typescript"; const ROOT = new URL("../", import.meta.url); const FAIL_FAST = Deno.args.includes("--fail-fast"); -const EXCLUDED_PATHS = [ - "dotenv/load.ts", - "path/glob.ts", - "front_matter/yaml.ts", - "front_matter/json.ts", - "front_matter/toml.ts", - "front_matter/any.ts", - "yaml/schema.ts", -]; - -const MOD_FILENAME = "mod.ts"; let shouldFail = false; -for await (const { name: dirName, isDirectory } of Deno.readDir(ROOT)) { - if (!isDirectory || dirName.startsWith(".") || dirName.startsWith("_")) { - continue; - } - const filePath = join(ROOT.pathname, dirName); - const modFilePath = join(filePath, MOD_FILENAME); - if (!await exists(modFilePath)) continue; - +for await ( + const { path: modFilePath } of walk(ROOT, { + includeDirs: true, + exts: ["ts"], + match: [/mod\.ts$/], + maxDepth: 2, + }) +) { const source = await Deno.readTextFile(modFilePath); const sourceFile = ts.createSourceFile( modFilePath, @@ -43,19 +33,27 @@ for await (const { name: dirName, isDirectory } of Deno.readDir(ROOT)) { exportSpecifiers.add(node.moduleSpecifier.text); }); - for await (const { name } of Deno.readDir(filePath)) { - if ( - name === MOD_FILENAME || - !name.endsWith(".ts") || - name.startsWith(".") || - name.startsWith("_") || - name.endsWith("test.ts") || - name.endsWith(".d.ts") - ) continue; - const absoluteFilePath = join(dirName, name); - if (EXCLUDED_PATHS.includes(absoluteFilePath)) continue; - - const relativeSpecifier = `./${name}`; + for await ( + const { path: filePath } of walk(dirname(modFilePath), { + exts: ["ts"], + includeDirs: false, + maxDepth: 1, + skip: [ + /dotenv\/load\.ts$/, + /path\/glob\.ts$/, + /front_matter\/yaml\.ts$/, + /front_matter\/json\.ts$/, + /front_matter\/toml\.ts$/, + /front_matter\/any\.ts$/, + /yaml\/schema\.ts$/, + /test\.ts$/, + /\.d\.ts$/, + /\/_/, + /mod\.ts$/, + ], + }) + ) { + const relativeSpecifier = relative(modFilePath, filePath).slice(1); if (!exportSpecifiers.has(relativeSpecifier)) { console.warn( `${ From 429b0155233aa089861d202ffd7671a7d188046a Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Tue, 19 Mar 2024 09:06:42 +1100 Subject: [PATCH 5/8] work --- _tools/check_mod_exports.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/_tools/check_mod_exports.ts b/_tools/check_mod_exports.ts index 124b74ade93f..5e9fdecdce54 100644 --- a/_tools/check_mod_exports.ts +++ b/_tools/check_mod_exports.ts @@ -48,12 +48,13 @@ for await ( /yaml\/schema\.ts$/, /test\.ts$/, /\.d\.ts$/, - /\/_/, + /(\/|\\)_/, /mod\.ts$/, ], }) ) { - const relativeSpecifier = relative(modFilePath, filePath).slice(1); + const relativeSpecifier = relative(modFilePath, filePath).slice(1) + .replaceAll("\\", "/"); if (!exportSpecifiers.has(relativeSpecifier)) { console.warn( `${ From 866421a9081f2609ce2149f5f8f7872aadca438d Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Tue, 19 Mar 2024 09:07:30 +1100 Subject: [PATCH 6/8] tweak --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fba89861c996..4e11ceff61d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,9 +74,6 @@ jobs: strategy: fail-fast: false matrix: - deno: - - v1.x - - canary os: - ubuntu-22.04 - windows-2022 From 5ddd43955d7d9db64178cd043399752e9aa0892f Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Tue, 19 Mar 2024 09:19:43 +1100 Subject: [PATCH 7/8] work --- _tools/check_mod_exports.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/_tools/check_mod_exports.ts b/_tools/check_mod_exports.ts index 5e9fdecdce54..f69dc7f9145d 100644 --- a/_tools/check_mod_exports.ts +++ b/_tools/check_mod_exports.ts @@ -39,13 +39,13 @@ for await ( includeDirs: false, maxDepth: 1, skip: [ - /dotenv\/load\.ts$/, - /path\/glob\.ts$/, - /front_matter\/yaml\.ts$/, - /front_matter\/json\.ts$/, - /front_matter\/toml\.ts$/, - /front_matter\/any\.ts$/, - /yaml\/schema\.ts$/, + /dotenv(\/|\\)load\.ts$/, + /path(\/|\\)glob\.ts$/, + /front_matter(\/|\\)yaml\.ts$/, + /front_matter(\/|\\)json\.ts$/, + /front_matter(\/|\\)toml\.ts$/, + /front_matter(\/|\\)any\.ts$/, + /yaml(\/|\\)schema\.ts$/, /test\.ts$/, /\.d\.ts$/, /(\/|\\)_/, From ba6248f191b682ece74b16e4826fd14b69d3e2b0 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Tue, 19 Mar 2024 09:19:55 +1100 Subject: [PATCH 8/8] work --- _tools/check_mod_exports.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/_tools/check_mod_exports.ts b/_tools/check_mod_exports.ts index f69dc7f9145d..97c876a13962 100644 --- a/_tools/check_mod_exports.ts +++ b/_tools/check_mod_exports.ts @@ -40,7 +40,6 @@ for await ( maxDepth: 1, skip: [ /dotenv(\/|\\)load\.ts$/, - /path(\/|\\)glob\.ts$/, /front_matter(\/|\\)yaml\.ts$/, /front_matter(\/|\\)json\.ts$/, /front_matter(\/|\\)toml\.ts$/,