Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: build against lowest and current version of TS #1625

Merged
merged 11 commits into from
Dec 19, 2024
Merged
Changes from 10 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
46 changes: 46 additions & 0 deletions .github/workflows/minimum-version-ts-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Library checks

on:
pull_request:
push:
branches:
- main

jobs:
unit:
name: Check minimum TS version
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 16, 18, 20, 22, 23 ]
typescript-version: ['4.7.2', '5.5.4' ]
pauldambra marked this conversation as resolved.
Show resolved Hide resolved
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 8.x.x

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Build project
run: pnpm run build

# once its built we can see if we can use it on the forced version
- name: Override TypeScript version
run: pnpm add typescript@${{ matrix.typescript-version }} --save-dev

- name: Test TypeScript Import
run: |
rm test.ts || true
echo "import { posthog } from './dist/module'; console.log(posthog);" > test.ts
pnpm exec tsc test.ts --strict --target es2017 --module commonjs --moduleResolution node --noEmit --skipLibCheck
Loading