Skip to content
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
2 changes: 1 addition & 1 deletion .claude/agents/engineer.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Modified files: [list from Step 2]
Run these checks:

1. `npm run build` (builds all packages in dependency order via tsc + esbuild)
2. `npm test` (runs Jest tests across all packages)
2. `npm test` (runs Vitest tests across all packages)
3. `npm run lint` (ESLint + Prettier check)

For single-package changes, you may scope:
Expand Down
2 changes: 1 addition & 1 deletion .claude/agents/pr-reviewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Run the full build and test suite:
# Build all packages (tsc + esbuild, respects dependency order)
npm run build

# Run all tests (Jest across all packages)
# Run all tests (Vitest across all packages)
npm test

# Lint check (ESLint + Prettier)
Expand Down
8 changes: 3 additions & 5 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
"name": "Exceptionless.JavaScript",
"image": "mcr.microsoft.com/vscode/devcontainers/typescript-node:latest",
"extensions": [
"andys8.jest-snippets",
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"firsttris.vscode-jest-runner",
"hbenl.vscode-test-explorer",
"juancasanova.awesometypescriptproblemmatcher",
"ryanluker.vscode-coverage-gutters",
"streetsidesoftware.code-spell-checker"
"streetsidesoftware.code-spell-checker",
"vitest.explorer"
],
"forwardPorts": [3000],
"postCreateCommand": "npm install"
"postCreateCommand": "npm ci"
}
55 changes: 42 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,20 @@ jobs:
with:
fetch-depth: 0
- name: Build Reason
run: "echo ref: ${{github.ref}} event: ${{github.event_name}}"
shell: bash
run: |
branch=${GITHUB_REF##*/}.
if [[ "$branch" = "main." ]]; then
branch=""
elif [[ "$branch" = "master." ]]; then
branch=""
elif [[ "${GITHUB_REF}" = refs/tags* ]]; then
branch=""
elif [[ "${GITHUB_REF}" = refs/pull* ]]; then
branch=""
fi
echo "GIT_BRANCH_SUFFIX=$branch" >> $GITHUB_ENV
echo "ref: $GITHUB_REF event: $GITHUB_EVENT_NAME branch_suffix: $branch"
- name: Setup Node.js environment
uses: actions/setup-node@v6
with:
Expand All @@ -37,18 +50,29 @@ jobs:
- name: Setup .NET SDK for MinVer
uses: actions/setup-dotnet@v5
with:
dotnet-version: "8.0.x"
- name: Set Min Version
uses: Stelzi79/action-minver@3.0.1
id: version
with:
minimum-major-minor: 3.0
tag-prefix: v
dotnet-version: "10.0.x"
- name: Build Version
id: version
shell: bash
run: |
dotnet tool install --global minver-cli --version 7.0.0
version=$(minver --tag-prefix v --default-pre-release-identifiers "preview.${GIT_BRANCH_SUFFIX}0" --minimum-major-minor 3.0)

# If on a non-main branch, insert branch name before the height (last numeric segment)
if [ -n "$GIT_BRANCH_SUFFIX" ]; then
branch_name="${GIT_BRANCH_SUFFIX%.}"
if [[ "$version" != *"$branch_name"* ]]; then
version=$(echo "$version" | sed -E "s/\.([0-9]+)$/.${GIT_BRANCH_SUFFIX}\1/")
fi
fi

echo "version=$version" >> $GITHUB_OUTPUT
echo "Version: $version"
echo "### Version: $version" >> $GITHUB_STEP_SUMMARY

npm install --global replace-in-files-cli
replace-in-files --string="3.0.0-dev" --replacement=${{steps.version.outputs.version}} packages/core/src/configuration/Configuration.ts
replace-in-files --string="3.0.0-dev" --replacement=${{steps.version.outputs.version}} **/package*.json
replace-in-files --string="3.0.0-dev" --replacement=$version packages/core/src/configuration/Configuration.ts
replace-in-files --string="3.0.0-dev" --replacement=$version **/package*.json
npm ci
- name: Build
run: npm run build
Expand All @@ -62,14 +86,19 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Setup GitHub CI Node.js environment
if: github.event_name != 'pull_request' && matrix.os == 'ubuntu-latest'
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/heads/') && matrix.os == 'ubuntu-latest' && contains(steps.version.outputs.version, '-')
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node_version }}
registry-url: "https://npm.pkg.github.com"
scope: "@exceptionless"
- name: Push GitHub CI Packages
if: github.event_name != 'pull_request' && matrix.os == 'ubuntu-latest'
run: npm publish --workspaces --access public
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/heads/') && matrix.os == 'ubuntu-latest' && contains(steps.version.outputs.version, '-')
shell: bash
run: |
TAG_BRANCH="${GIT_BRANCH_SUFFIX%.}"
TAG_BRANCH="${TAG_BRANCH:-main}"
TAG_BRANCH="${TAG_BRANCH//\//-}"
npm publish --workspaces --access public --tag "ci-${TAG_BRANCH}" || true
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
6 changes: 2 additions & 4 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
{
"recommendations": [
"andys8.jest-snippets",
"davidanson.vscode-markdownlint",
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"firsttris.vscode-jest-runner",
"hbenl.vscode-test-explorer",
"juancasanova.awesometypescriptproblemmatcher",
"ryanluker.vscode-coverage-gutters",
"streetsidesoftware.code-spell-checker"
"streetsidesoftware.code-spell-checker",
"vitest.explorer"
]
}
12 changes: 6 additions & 6 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,27 @@
"name": "Test",
"request": "launch",
"type": "node",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": ["--runInBand"],
"program": "${workspaceFolder}/node_modules/.bin/vitest",
"args": ["--run"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
"program": "${workspaceFolder}/node_modules/vitest/vitest.mjs"
},
"cwd": "${workspaceRoot}"
},
{
"name": "Test Current File",
"request": "launch",
"type": "node",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": ["${fileBasenameNoExtension}"],
"program": "${workspaceFolder}/node_modules/.bin/vitest",
"args": ["--run", "${fileBasenameNoExtension}"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
"program": "${workspaceFolder}/node_modules/vitest/vitest.mjs"
},
"cwd": "${workspaceRoot}"
}
Expand Down
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,5 @@
"webcompat"
],
"eslint.validate": ["javascript", "typescript"],
"deno.enable": false,
"jest.jestCommandLine": "npm test --"
"deno.enable": false
}
11 changes: 5 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,10 @@ Before marking work complete, verify:

### Framework

- **Jest** with **ts-jest** preset
- **`@jest/globals`** for imports (`describe`, `test`, `expect`)
- **Vitest** as the test runner
- **`vitest`** for imports (`describe`, `test`, `expect`, `beforeEach`, `afterEach`)
- **jsdom** test environment for browser packages, **node** for the node package
- **jest-ts-webcompat-resolver** for ESM import resolution
- **vitest.config.ts** at root defines test projects for each package

### Test Structure

Expand All @@ -288,8 +288,7 @@ packages/core/test/
Follow the Arrange-Act-Assert pattern:

```typescript
import { describe, test } from "@jest/globals";
import { expect } from "expect";
import { describe, test, expect } from "vitest";

import { ExceptionlessClient } from "../src/ExceptionlessClient.js";

Expand Down Expand Up @@ -330,7 +329,7 @@ npm test --workspace=packages/browser
npm run test:watch --workspace=packages/core

# Run tests matching a pattern
npx jest --testPathPattern="ExceptionlessClient"
npx vitest --run --testNamePattern="ExceptionlessClient"
```

### Test Principles (FIRST)
Expand Down
16 changes: 7 additions & 9 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import eslint from "@eslint/js";
import { defineConfig } from "eslint/config";
import eslintConfigPrettier from "eslint-config-prettier";
import jest from "eslint-plugin-jest";
import vitest from "@vitest/eslint-plugin";
import tseslint from "typescript-eslint";

export default defineConfig(
{
ignores: ["**/dist/", "**/node_modules/", ".agents/", "example/", "jest-resolver.cjs"]
},
{ ignores: ["**/dist/", "**/node_modules/", ".agents/", "example/"] },
eslint.configs.recommended,
{
extends: tseslint.configs.recommendedTypeChecked,
Expand Down Expand Up @@ -36,12 +34,12 @@ export default defineConfig(
eslintConfigPrettier,
{
files: ["**/test/**/*.ts"],
extends: [jest.configs["flat/recommended"]],
plugins: vitest.configs.recommended.plugins,
rules: {
"jest/valid-title": "off",
"jest/valid-describe-callback": "off",
"jest/no-export": "off",
"jest/no-done-callback": "warn"
...vitest.configs.recommended.rules,
"vitest/valid-title": "off",
"vitest/valid-describe-callback": "off",
"vitest/no-done-callback": "warn"
}
}
);
4 changes: 1 addition & 3 deletions example/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
"react-app"
]
},
"browserslist": {
Expand All @@ -26,7 +25,6 @@
]
},
"devDependencies": {
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1",
"@vitejs/plugin-react": "^6.0.1",
Expand Down
5 changes: 0 additions & 5 deletions example/react/src/setupTests.js

This file was deleted.

85 changes: 0 additions & 85 deletions jest-resolver.cjs

This file was deleted.

Loading
Loading