diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 000000000..08223ce8b Binary files /dev/null and b/.DS_Store differ diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8620bfd49..34851ebe9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,12 +1,19 @@ jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + - uses: ./.github/actions/prepare + - run: pnpm run build # Ensure packages pass attw, etc. + - run: pnpm run -r build # Build packages/site flint: name: Flint runs-on: ubuntu-latest steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 - uses: ./.github/actions/prepare - - run: pnpm run build - - run: pnpm run -r build # Build packages/site + - run: pnpm run --filter=site prebuild # Generate packages/site/.astro - run: pnpm run flint lint: name: Lint @@ -14,8 +21,7 @@ jobs: steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 - uses: ./.github/actions/prepare - - run: pnpm run build - - run: pnpm run -r prebuild # Generate packages/site/.astro without a full build. + - run: pnpm run --filter=site prebuild # Generate packages/site/.astro - run: pnpm run lint lint_knip: name: Lint Knip @@ -37,9 +43,24 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + with: + fetch-depth: 0 # required so origin/main can be diffed - uses: ./.github/actions/prepare - - run: pnpm run build # https://github.com/vitest-dev/vitest/discussions/9353 - - run: pnpm run test + - name: Cache dependencies and Vite cache + uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5 + with: + key: cache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} + path: node_modules/.vite + - run: pnpm exec tsc -b # For types tests + - run: pnpm run build -W ./packages/ts-patch/ # vitest-dev/vitest#9429 + - # Run partial test pass on PRs (only changed files) + if: ${{ github.event_name == 'pull_request' }} + name: Run affected tests + run: pnpm run test --changed "origin/main" + - # On main, run the full test suite w/ type checking + if: ${{ github.ref == 'refs/heads/main' }} + name: Run full test suite + run: pnpm run test name: CI diff --git a/packages/.DS_Store b/packages/.DS_Store new file mode 100644 index 000000000..e0b45febb Binary files /dev/null and b/packages/.DS_Store differ diff --git a/packages/cli/.DS_Store b/packages/cli/.DS_Store new file mode 100644 index 000000000..6e38c7d99 Binary files /dev/null and b/packages/cli/.DS_Store differ diff --git a/packages/cli/package.json b/packages/cli/package.json index 4f8526bac..4095fe893 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -24,6 +24,9 @@ "lib/", "!lib/**/*.map" ], + "scripts": { + "test": "vitest --typecheck --project cli" + }, "dependencies": { "@flint.fyi/core": "workspace:^", "@flint.fyi/utils": "workspace:^", diff --git a/packages/comparisons/.DS_Store b/packages/comparisons/.DS_Store new file mode 100644 index 000000000..65376b892 Binary files /dev/null and b/packages/comparisons/.DS_Store differ diff --git a/packages/comparisons/package.json b/packages/comparisons/package.json index d06237ffd..c699c2579 100644 --- a/packages/comparisons/package.json +++ b/packages/comparisons/package.json @@ -24,6 +24,9 @@ "lib/", "!lib/**/*.map" ], + "scripts": { + "test": "vitest --typecheck --project comparisons" + }, "dependencies": { "prettier": "3.7.4" }, diff --git a/packages/core/.DS_Store b/packages/core/.DS_Store new file mode 100644 index 000000000..6d9f7768a Binary files /dev/null and b/packages/core/.DS_Store differ diff --git a/packages/core/package.json b/packages/core/package.json index 86326fef9..5b647c6dd 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -24,6 +24,9 @@ "lib/", "!lib/**/*.map" ], + "scripts": { + "test": "vitest --typecheck --project core" + }, "dependencies": { "@flint.fyi/utils": "workspace:^", "cached-factory": "^0.1.0", diff --git a/packages/flint/.DS_Store b/packages/flint/.DS_Store new file mode 100644 index 000000000..8790ce3f3 Binary files /dev/null and b/packages/flint/.DS_Store differ diff --git a/packages/flint/package.json b/packages/flint/package.json index afa02831a..7c91ee2d4 100644 --- a/packages/flint/package.json +++ b/packages/flint/package.json @@ -28,6 +28,9 @@ "!lib/**/*.map", "!lib/bin/**" ], + "scripts": { + "test": "vitest --typecheck --project flint" + }, "dependencies": { "@flint.fyi/cli": "workspace:", "@flint.fyi/core": "workspace:", diff --git a/packages/flint/tsconfig.src.json b/packages/flint/tsconfig.src.json index 1aed27aa7..c94a6d71c 100644 --- a/packages/flint/tsconfig.src.json +++ b/packages/flint/tsconfig.src.json @@ -11,6 +11,7 @@ { "path": "../core" }, { "path": "../json" }, { "path": "../md" }, + { "path": "../package-json" }, { "path": "../ts" }, { "path": "../yaml" } ] diff --git a/packages/json/.DS_Store b/packages/json/.DS_Store new file mode 100644 index 000000000..fc2cbb189 Binary files /dev/null and b/packages/json/.DS_Store differ diff --git a/packages/json/package.json b/packages/json/package.json index ce05746a6..caf8de906 100644 --- a/packages/json/package.json +++ b/packages/json/package.json @@ -24,6 +24,9 @@ "lib/", "!lib/**/*.map" ], + "scripts": { + "test": "vitest --typecheck --project json" + }, "dependencies": { "@flint.fyi/core": "workspace:^", "typescript": "^5.9.0 || ^6.0.0", diff --git a/packages/md/.DS_Store b/packages/md/.DS_Store new file mode 100644 index 000000000..5d4e1960e Binary files /dev/null and b/packages/md/.DS_Store differ diff --git a/packages/md/package.json b/packages/md/package.json index b3cf65905..2f88fd197 100644 --- a/packages/md/package.json +++ b/packages/md/package.json @@ -24,6 +24,9 @@ "lib/", "!lib/**/*.map" ], + "scripts": { + "test": "vitest --typecheck --project md" + }, "dependencies": { "@flint.fyi/core": "workspace:^", "@flint.fyi/utils": "workspace:^", diff --git a/packages/package-json/.DS_Store b/packages/package-json/.DS_Store new file mode 100644 index 000000000..232b7a74f Binary files /dev/null and b/packages/package-json/.DS_Store differ diff --git a/packages/package-json/package.json b/packages/package-json/package.json index d59fb50cd..1028a7401 100644 --- a/packages/package-json/package.json +++ b/packages/package-json/package.json @@ -24,6 +24,9 @@ "lib/", "!lib/**/*.map" ], + "scripts": { + "test": "vitest --typecheck --project package-json" + }, "dependencies": { "@flint.fyi/core": "workspace:^", "typescript": "^5.9.0 || ^6.0.0" diff --git a/packages/plugin-astro/.DS_Store b/packages/plugin-astro/.DS_Store new file mode 100644 index 000000000..2e58c414e Binary files /dev/null and b/packages/plugin-astro/.DS_Store differ diff --git a/packages/plugin-astro/package.json b/packages/plugin-astro/package.json index 08d8fd455..94811aa15 100644 --- a/packages/plugin-astro/package.json +++ b/packages/plugin-astro/package.json @@ -24,6 +24,9 @@ "lib/", "!lib/**/*.map" ], + "scripts": { + "test": "vitest --typecheck --project plugin-astro" + }, "dependencies": { "@flint.fyi/core": "workspace:^", "typescript": "^5.9.3" diff --git a/packages/plugin-browser/.DS_Store b/packages/plugin-browser/.DS_Store new file mode 100644 index 000000000..ff1ea8e21 Binary files /dev/null and b/packages/plugin-browser/.DS_Store differ diff --git a/packages/plugin-browser/package.json b/packages/plugin-browser/package.json index 3f7b597dc..f0e04c513 100644 --- a/packages/plugin-browser/package.json +++ b/packages/plugin-browser/package.json @@ -24,6 +24,9 @@ "lib/", "!lib/**/*.map" ], + "scripts": { + "test": "vitest --typecheck --project plugin-browser" + }, "dependencies": { "@flint.fyi/core": "workspace:^", "@flint.fyi/ts": "workspace:^", diff --git a/packages/plugin-cspell/.DS_Store b/packages/plugin-cspell/.DS_Store new file mode 100644 index 000000000..019acaae4 Binary files /dev/null and b/packages/plugin-cspell/.DS_Store differ diff --git a/packages/plugin-flint/.DS_Store b/packages/plugin-flint/.DS_Store new file mode 100644 index 000000000..38f984be2 Binary files /dev/null and b/packages/plugin-flint/.DS_Store differ diff --git a/packages/plugin-flint/package.json b/packages/plugin-flint/package.json index b89af297b..d94281814 100644 --- a/packages/plugin-flint/package.json +++ b/packages/plugin-flint/package.json @@ -24,6 +24,9 @@ "lib/", "!lib/**/*.map" ], + "scripts": { + "test": "vitest --typecheck --project plugin-flint" + }, "dependencies": { "@flint.fyi/core": "workspace:^", "@flint.fyi/ts": "workspace:^", diff --git a/packages/plugin-jsx/.DS_Store b/packages/plugin-jsx/.DS_Store new file mode 100644 index 000000000..af29e6a0a Binary files /dev/null and b/packages/plugin-jsx/.DS_Store differ diff --git a/packages/plugin-jsx/package.json b/packages/plugin-jsx/package.json index 3a445ae1a..209790e87 100644 --- a/packages/plugin-jsx/package.json +++ b/packages/plugin-jsx/package.json @@ -24,6 +24,9 @@ "lib/", "!lib/**/*.map" ], + "scripts": { + "test": "vitest --typecheck --project plugin-jsx" + }, "dependencies": { "@flint.fyi/core": "workspace:^", "@flint.fyi/ts": "workspace:^", diff --git a/packages/plugin-next/.DS_Store b/packages/plugin-next/.DS_Store new file mode 100644 index 000000000..abb1f7046 Binary files /dev/null and b/packages/plugin-next/.DS_Store differ diff --git a/packages/plugin-next/package.json b/packages/plugin-next/package.json index 74cc5fe0d..5c20c4eea 100644 --- a/packages/plugin-next/package.json +++ b/packages/plugin-next/package.json @@ -24,6 +24,9 @@ "lib/", "!lib/**/*.map" ], + "scripts": { + "test": "vitest --typecheck --project plugin-next" + }, "dependencies": { "@flint.fyi/core": "workspace:^", "typescript": "^5.9.3" diff --git a/packages/plugin-node/.DS_Store b/packages/plugin-node/.DS_Store new file mode 100644 index 000000000..1acf3c74b Binary files /dev/null and b/packages/plugin-node/.DS_Store differ diff --git a/packages/plugin-node/package.json b/packages/plugin-node/package.json index 28383c9ba..49facd940 100644 --- a/packages/plugin-node/package.json +++ b/packages/plugin-node/package.json @@ -24,6 +24,9 @@ "lib/", "!lib/**/*.map" ], + "scripts": { + "test": "vitest --typecheck --project plugin-node" + }, "dependencies": { "@flint.fyi/core": "workspace:^", "@flint.fyi/ts": "workspace:^", diff --git a/packages/plugin-nuxt/.DS_Store b/packages/plugin-nuxt/.DS_Store new file mode 100644 index 000000000..8c267607b Binary files /dev/null and b/packages/plugin-nuxt/.DS_Store differ diff --git a/packages/plugin-nuxt/package.json b/packages/plugin-nuxt/package.json index 3e070376a..9ec5f78b8 100644 --- a/packages/plugin-nuxt/package.json +++ b/packages/plugin-nuxt/package.json @@ -24,6 +24,9 @@ "lib/", "!lib/**/*.map" ], + "scripts": { + "test": "vitest --typecheck --project plugin-nuxt" + }, "dependencies": { "@flint.fyi/core": "workspace:^", "typescript": "^5.9.3" diff --git a/packages/plugin-performance/.DS_Store b/packages/plugin-performance/.DS_Store new file mode 100644 index 000000000..360bdfb16 Binary files /dev/null and b/packages/plugin-performance/.DS_Store differ diff --git a/packages/plugin-performance/package.json b/packages/plugin-performance/package.json index 0e7c2cfe5..91e3b6807 100644 --- a/packages/plugin-performance/package.json +++ b/packages/plugin-performance/package.json @@ -24,6 +24,9 @@ "lib/", "!lib/**/*.map" ], + "scripts": { + "test": "vitest --typecheck --project plugin-performance" + }, "dependencies": { "@flint.fyi/core": "workspace:^", "@flint.fyi/ts": "workspace:^", diff --git a/packages/plugin-react/.DS_Store b/packages/plugin-react/.DS_Store new file mode 100644 index 000000000..7fac86c08 Binary files /dev/null and b/packages/plugin-react/.DS_Store differ diff --git a/packages/plugin-react/package.json b/packages/plugin-react/package.json index bfded44fb..505a5a9c1 100644 --- a/packages/plugin-react/package.json +++ b/packages/plugin-react/package.json @@ -24,6 +24,9 @@ "lib/", "!lib/**/*.map" ], + "scripts": { + "test": "vitest --typecheck --project plugin-react" + }, "dependencies": { "@flint.fyi/core": "workspace:^", "typescript": "^5.9.3" diff --git a/packages/plugin-solid/.DS_Store b/packages/plugin-solid/.DS_Store new file mode 100644 index 000000000..e3d6847cb Binary files /dev/null and b/packages/plugin-solid/.DS_Store differ diff --git a/packages/plugin-solid/package.json b/packages/plugin-solid/package.json index 242208018..42e26608b 100644 --- a/packages/plugin-solid/package.json +++ b/packages/plugin-solid/package.json @@ -24,6 +24,9 @@ "lib/", "!lib/**/*.map" ], + "scripts": { + "test": "vitest --typecheck --project plugin-solid" + }, "dependencies": { "@flint.fyi/core": "workspace:^", "typescript": "^5.9.3" diff --git a/packages/plugin-spelling/.DS_Store b/packages/plugin-spelling/.DS_Store new file mode 100644 index 000000000..937eb143f Binary files /dev/null and b/packages/plugin-spelling/.DS_Store differ diff --git a/packages/plugin-spelling/package.json b/packages/plugin-spelling/package.json index 16f8a39d5..9395bf450 100644 --- a/packages/plugin-spelling/package.json +++ b/packages/plugin-spelling/package.json @@ -24,6 +24,9 @@ "lib/", "!lib/**/*.map" ], + "scripts": { + "test": "vitest --typecheck --project plugin-spelling" + }, "dependencies": { "@cspell/url": "^9.2.2", "@flint.fyi/core": "workspace:^", diff --git a/packages/rule-tester/.DS_Store b/packages/rule-tester/.DS_Store new file mode 100644 index 000000000..31af24ac7 Binary files /dev/null and b/packages/rule-tester/.DS_Store differ diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index 165ef813b..28619854e 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -24,6 +24,9 @@ "lib/", "!lib/**/*.map" ], + "scripts": { + "test": "vitest --typecheck --project rule-tester" + }, "dependencies": { "@flint.fyi/core": "workspace:^", "@flint.fyi/utils": "workspace:^", diff --git a/packages/site/.DS_Store b/packages/site/.DS_Store new file mode 100644 index 000000000..9d4695428 Binary files /dev/null and b/packages/site/.DS_Store differ diff --git a/packages/site/public/.DS_Store b/packages/site/public/.DS_Store new file mode 100644 index 000000000..4cfabfdf6 Binary files /dev/null and b/packages/site/public/.DS_Store differ diff --git a/packages/text/.DS_Store b/packages/text/.DS_Store new file mode 100644 index 000000000..e1ed9c230 Binary files /dev/null and b/packages/text/.DS_Store differ diff --git a/packages/text/package.json b/packages/text/package.json index 0877d09b0..361cea237 100644 --- a/packages/text/package.json +++ b/packages/text/package.json @@ -24,6 +24,9 @@ "lib/", "!lib/**/*.map" ], + "scripts": { + "test": "vitest --typecheck --project text" + }, "dependencies": { "@flint.fyi/core": "workspace:^" }, diff --git a/packages/ts-patch/.DS_Store b/packages/ts-patch/.DS_Store new file mode 100644 index 000000000..1ef1d20c6 Binary files /dev/null and b/packages/ts-patch/.DS_Store differ diff --git a/packages/ts/.DS_Store b/packages/ts/.DS_Store new file mode 100644 index 000000000..8599d5140 Binary files /dev/null and b/packages/ts/.DS_Store differ diff --git a/packages/ts/package.json b/packages/ts/package.json index a9eaa9dfe..91f210631 100644 --- a/packages/ts/package.json +++ b/packages/ts/package.json @@ -24,6 +24,9 @@ "lib/", "!lib/**/*.map" ], + "scripts": { + "test": "vitest --typecheck --project ts" + }, "dependencies": { "@flint.fyi/core": "workspace:^", "@flint.fyi/utils": "workspace:^", diff --git a/packages/utils/.DS_Store b/packages/utils/.DS_Store new file mode 100644 index 000000000..b23868e67 Binary files /dev/null and b/packages/utils/.DS_Store differ diff --git a/packages/utils/package.json b/packages/utils/package.json index 8f50f9800..c2ae25ec4 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -24,6 +24,9 @@ "lib/", "!lib/**/*.map" ], + "scripts": { + "test": "vitest --typecheck --project utils" + }, "devDependencies": { "tsdown": "0.19.0-beta.2", "vitest": "4.0.15" diff --git a/packages/yaml/.DS_Store b/packages/yaml/.DS_Store new file mode 100644 index 000000000..5810a403f Binary files /dev/null and b/packages/yaml/.DS_Store differ diff --git a/packages/yaml/package.json b/packages/yaml/package.json index c256f8d16..5d4d688dd 100644 --- a/packages/yaml/package.json +++ b/packages/yaml/package.json @@ -24,6 +24,9 @@ "lib/", "!lib/**/*.map" ], + "scripts": { + "test": "vitest --typecheck --project yaml" + }, "dependencies": { "@flint.fyi/core": "workspace:^", "@flint.fyi/utils": "workspace:^", diff --git a/packages/yml/.DS_Store b/packages/yml/.DS_Store new file mode 100644 index 000000000..a407da359 Binary files /dev/null and b/packages/yml/.DS_Store differ diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 76aa97be6..e26b7b0c7 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -18,5 +18,6 @@ peerDependencyRules: allowedVersions: astro: "5" +shellEmulator: true strictDepBuilds: true strictPeerDependencies: true diff --git a/tsconfig.json b/tsconfig.json index bf40b4932..daf70c709 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,9 +11,9 @@ "./packages/*/bin/index.js" ], "references": [ + { "path": "./packages/cli" }, { "path": "./packages/comparisons" }, { "path": "./packages/core" }, - { "path": "./packages/cli" }, { "path": "./packages/flint" }, { "path": "./packages/json" }, { "path": "./packages/md" }, @@ -23,8 +23,8 @@ { "path": "./packages/plugin-flint" }, { "path": "./packages/plugin-jsx" }, { "path": "./packages/plugin-next" }, - { "path": "./packages/plugin-nuxt" }, { "path": "./packages/plugin-node" }, + { "path": "./packages/plugin-nuxt" }, { "path": "./packages/plugin-performance" }, { "path": "./packages/plugin-react" }, { "path": "./packages/plugin-solid" }, diff --git a/vitest.config.ts b/vitest.config.ts index 0b9a96d18..a8eef5cb3 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -1,26 +1,29 @@ import { readdirSync } from "node:fs"; +import path from "node:path"; import { defineConfig } from "vitest/config"; export default defineConfig({ - resolve: { - conditions: ["@flint.fyi/source"], - }, test: { - projects: readdirSync("./packages").map((name) => ({ - test: { - clearMocks: true, - include: ["**/src/**/*.test.ts"], - name, - root: `./packages/${name}`, - setupFiles: [ - "console-fail-test/setup", - "@flint.fyi/ts-patch/install-patch-hooks", - ], - testTimeout: 10_000, - typecheck: { - enabled: true, + projects: readdirSync(path.join(import.meta.dirname, "packages")).map( + (name) => ({ + ssr: { + resolve: { conditions: ["@flint.fyi/source"] }, + }, + test: { + clearMocks: true, + include: ["**/src/**/*.test.ts"], + name, + root: path.join(import.meta.dirname, "packages", name), + setupFiles: [ + "console-fail-test/setup", + "@flint.fyi/ts-patch/install-patch-hooks", + ], + testTimeout: 10_000, + typecheck: { + enabled: true, + }, }, - }, - })), + }), + ), }, });