diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0780d26b1..52bf07109 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,89 +20,89 @@ env: CI: true jobs: - test: - name: Test - runs-on: ubuntu-latest - steps: - - name: Checkout Code - uses: actions/checkout@v3 - - name: Install Node - uses: actions/setup-node@v3 - with: - node-version: 14 - - name: Locate Yarn Cache - id: yarn-cache-dir-path - run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - - uses: actions/cache@v3 - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: Install Dependencies - run: yarn install --frozen-lockfile - - name: Lint - run: yarn lint - - name: Build - run: yarn build - - name: Run Tests - uses: coactions/setup-xvfb@v1 - with: - run: yarn test + # test: + # name: Test + # runs-on: ubuntu-latest + # steps: + # - name: Checkout Code + # uses: actions/checkout@v3 + # - name: Install Node + # uses: actions/setup-node@v3 + # with: + # node-version: 14 + # - name: Locate Yarn Cache + # id: yarn-cache-dir-path + # run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT + # - uses: actions/cache@v3 + # with: + # path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + # key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + # restore-keys: | + # ${{ runner.os }}-yarn- + # - name: Install Dependencies + # run: yarn install --frozen-lockfile + # - name: Lint + # run: yarn lint + # - name: Build + # run: yarn build + # - name: Run Tests + # uses: coactions/setup-xvfb@v1 + # with: + # run: yarn test - # The Windows runner can be super flaky both with Yarn installs and - # when launching browser tests, so we allow for retries in those steps. - test-windows: - name: Test Windows - runs-on: windows-2022 - steps: - - name: Checkout Code - uses: actions/checkout@v3 - - name: Install Node - uses: actions/setup-node@v3 - with: - node-version: 14 - - name: Install Dependencies - uses: nick-fields/retry@v2 - with: - max_attempts: 2 - timeout_minutes: 10 - command: yarn install --frozen-lockfile - - name: Build - run: yarn build - - name: Test @glint/core - uses: nick-fields/retry@v2 - with: - max_attempts: 2 - timeout_minutes: 20 - command: yarn workspace @glint/core test - - name: Test glint-vscode - uses: nick-fields/retry@v2 - with: - max_attempts: 2 - timeout_minutes: 10 - command: yarn workspace glint-vscode test - - name: Test @glint/scripts - run: yarn workspace @glint/scripts test + # # The Windows runner can be super flaky both with Yarn installs and + # # when launching browser tests, so we allow for retries in those steps. + # test-windows: + # name: Test Windows + # runs-on: windows-2022 + # steps: + # - name: Checkout Code + # uses: actions/checkout@v3 + # - name: Install Node + # uses: actions/setup-node@v3 + # with: + # node-version: 14 + # - name: Install Dependencies + # uses: nick-fields/retry@v2 + # with: + # max_attempts: 2 + # timeout_minutes: 10 + # command: yarn install --frozen-lockfile + # - name: Build + # run: yarn build + # - name: Test @glint/core + # uses: nick-fields/retry@v2 + # with: + # max_attempts: 2 + # timeout_minutes: 20 + # command: yarn workspace @glint/core test + # - name: Test glint-vscode + # uses: nick-fields/retry@v2 + # with: + # max_attempts: 2 + # timeout_minutes: 10 + # command: yarn workspace glint-vscode test + # - name: Test @glint/scripts + # run: yarn workspace @glint/scripts test - test-floating-deps: - name: Test Floating Dependencies - runs-on: ubuntu-latest - steps: - - name: Checkout Code - uses: actions/checkout@v3 - - name: Install Node - uses: actions/setup-node@v3 - with: - node-version: 14 - - name: Install Dependencies - run: yarn install --no-lockfile - - name: Build - run: yarn build - - name: Run Tests - uses: coactions/setup-xvfb@v1 - with: - run: yarn test + # test-floating-deps: + # name: Test Floating Dependencies + # runs-on: ubuntu-latest + # steps: + # - name: Checkout Code + # uses: actions/checkout@v3 + # - name: Install Node + # uses: actions/setup-node@v3 + # with: + # node-version: 14 + # - name: Install Dependencies + # run: yarn install --no-lockfile + # - name: Build + # run: yarn build + # - name: Run Tests + # uses: coactions/setup-xvfb@v1 + # with: + # run: yarn test test-ts-nightly: name: Test TypeScript Nightly @@ -130,4 +130,4 @@ jobs: - name: Run Tests uses: coactions/setup-xvfb@v1 with: - run: yarn test + run: yarn workspace @glint/core test diff --git a/packages/core/__tests__/cli/custom-extensions.test.ts b/packages/core/__tests__/cli/custom-extensions.test.ts index f165a260b..b855eda1c 100644 --- a/packages/core/__tests__/cli/custom-extensions.test.ts +++ b/packages/core/__tests__/cli/custom-extensions.test.ts @@ -81,7 +81,11 @@ describe('CLI: custom extensions', () => { "Cannot find module './other' or its corresponding type declarations." ); - await watch.writeAndAwaitOutput('other.gjs', 'export const foo = 123;', 'Found 0 errors.'); + try { + await watch.writeAndAwaitOutput('other.gjs', 'export const foo = 123;', 'Found 0 errors.'); + } finally { + console.log(stripAnsi(watch.allOutput)); + } await watch.terminate(); }); @@ -99,7 +103,6 @@ describe('CLI: custom extensions', () => { 'Watching for file changes.' ); - console.log(stripAnsi(watch.allOutput)); expect(output).toMatch('Found 1 error.'); expect(output).toMatch('TS2362'); @@ -114,11 +117,9 @@ describe('CLI: custom extensions', () => { expect(output).toMatch('Found 0 errors.'); - await new Promise((r) => setTimeout(r, 250)); project.remove('other.gjs'); output = await watch.awaitOutput('Watching for file changes.'); - console.log(stripAnsi(watch.allOutput)); expect(output).toMatch('Found 1 error.'); expect(output).toMatch( "Cannot find module './other' or its corresponding type declarations." diff --git a/packages/core/package.json b/packages/core/package.json index ac4691a64..77ad05c7f 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -23,7 +23,7 @@ "glint-language-server": "bin/glint-language-server.js" }, "scripts": { - "test": "vitest run", + "test": "vitest run --threads=false", "test:watch": "vitest watch", "build": "tsc --build", "prepack": "yarn build" diff --git a/packages/core/src/common/transform-manager.ts b/packages/core/src/common/transform-manager.ts index fd849f0e3..6638b6cd8 100644 --- a/packages/core/src/common/transform-manager.ts +++ b/packages/core/src/common/transform-manager.ts @@ -254,6 +254,7 @@ export default class TransformManager { } let callback: ts.DirectoryWatcherCallback = (filename) => { + console.log('watchDirectoryCallback', filename, this.getScriptPathForTS(filename)); // Adding or removing a file invalidates most of what we think we know about module resolution this.moduleResolutionCache.clear(); originalCallback(this.getScriptPathForTS(filename));