From 6c4835fdfd73ea9e8c0909afcd77b9a11d900b1f Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Thu, 19 Dec 2024 18:58:51 +0000 Subject: [PATCH 01/11] Try this --- .../workflows/minimum-version-ts-check.yaml | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/minimum-version-ts-check.yaml diff --git a/.github/workflows/minimum-version-ts-check.yaml b/.github/workflows/minimum-version-ts-check.yaml new file mode 100644 index 000000000..3d61103ce --- /dev/null +++ b/.github/workflows/minimum-version-ts-check.yaml @@ -0,0 +1,29 @@ +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 ] + typescript-version: [ '4.7.0', '5.5.4' ] # Add your TypeScript versions here + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + with: + version: 8.x.x + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + - run: pnpm install + #Override TypeScript version + - run: npm install typescript@${{ matrix.typescript-version }} + - run: pnpm tsc -b From 2ad932ff1f0462c20b8b91c17fa84fe878e53605 Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Thu, 19 Dec 2024 19:00:22 +0000 Subject: [PATCH 02/11] doh --- .github/workflows/minimum-version-ts-check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/minimum-version-ts-check.yaml b/.github/workflows/minimum-version-ts-check.yaml index 3d61103ce..d2e1ec239 100644 --- a/.github/workflows/minimum-version-ts-check.yaml +++ b/.github/workflows/minimum-version-ts-check.yaml @@ -25,5 +25,5 @@ jobs: cache: 'pnpm' - run: pnpm install #Override TypeScript version - - run: npm install typescript@${{ matrix.typescript-version }} + - run: pnpm install typescript@${{ matrix.typescript-version }} - run: pnpm tsc -b From 9660d5ccfef40e7a99fc961d2825292f5da65110 Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Thu, 19 Dec 2024 19:03:05 +0000 Subject: [PATCH 03/11] doh --- .github/workflows/minimum-version-ts-check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/minimum-version-ts-check.yaml b/.github/workflows/minimum-version-ts-check.yaml index d2e1ec239..f083e178d 100644 --- a/.github/workflows/minimum-version-ts-check.yaml +++ b/.github/workflows/minimum-version-ts-check.yaml @@ -13,7 +13,7 @@ jobs: strategy: matrix: node-version: [ 16, 18, 20 ] - typescript-version: [ '4.7.0', '5.5.4' ] # Add your TypeScript versions here + typescript-version: [ '4.7.2', '5.5.4' ] steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 From d57a12c76164b1e0ac11f557155cbc9d6eb159f3 Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Thu, 19 Dec 2024 19:05:22 +0000 Subject: [PATCH 04/11] Try this --- .github/workflows/minimum-version-ts-check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/minimum-version-ts-check.yaml b/.github/workflows/minimum-version-ts-check.yaml index f083e178d..937c75ebd 100644 --- a/.github/workflows/minimum-version-ts-check.yaml +++ b/.github/workflows/minimum-version-ts-check.yaml @@ -13,7 +13,7 @@ jobs: strategy: matrix: node-version: [ 16, 18, 20 ] - typescript-version: [ '4.7.2', '5.5.4' ] + typescript-version: [ '4.7.3', '5.5.4' ] steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 From 7798681b10c426145bc28421a1db18fe308b2b0a Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Thu, 19 Dec 2024 19:20:59 +0000 Subject: [PATCH 05/11] Try this --- .../workflows/minimum-version-ts-check.yaml | 30 ++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/.github/workflows/minimum-version-ts-check.yaml b/.github/workflows/minimum-version-ts-check.yaml index 937c75ebd..dfaf8e3b2 100644 --- a/.github/workflows/minimum-version-ts-check.yaml +++ b/.github/workflows/minimum-version-ts-check.yaml @@ -15,15 +15,31 @@ jobs: node-version: [ 16, 18, 20 ] typescript-version: [ '4.7.3', '5.5.4' ] steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 with: version: 8.x.x - - uses: actions/setup-node@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: 'pnpm' - - run: pnpm install - #Override TypeScript version - - run: pnpm install typescript@${{ matrix.typescript-version }} - - run: pnpm tsc -b + + - name: Install dependencies + run: pnpm install + + - name: Override TypeScript version + run: pnpm add typescript@${{ matrix.typescript-version }} --save-dev + + - name: Build project + run: pnpm run build + + - 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 \ No newline at end of file From 4aaf715cb5a1bd7239c932a0c86fc1c766612f3a Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Thu, 19 Dec 2024 20:14:13 +0000 Subject: [PATCH 06/11] just ones that really should work: --- .github/workflows/minimum-version-ts-check.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/minimum-version-ts-check.yaml b/.github/workflows/minimum-version-ts-check.yaml index dfaf8e3b2..08dae5c34 100644 --- a/.github/workflows/minimum-version-ts-check.yaml +++ b/.github/workflows/minimum-version-ts-check.yaml @@ -12,8 +12,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [ 16, 18, 20 ] - typescript-version: [ '4.7.3', '5.5.4' ] + node-version: [ 18, 20 ] + typescript-version: [ '5.5.4' ] steps: - name: Checkout repository uses: actions/checkout@v4 From 24f11d1b9939bb15559ec13bc52eda862342dc88 Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Thu, 19 Dec 2024 20:32:59 +0000 Subject: [PATCH 07/11] now this --- .github/workflows/minimum-version-ts-check.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/minimum-version-ts-check.yaml b/.github/workflows/minimum-version-ts-check.yaml index 08dae5c34..5602e47c9 100644 --- a/.github/workflows/minimum-version-ts-check.yaml +++ b/.github/workflows/minimum-version-ts-check.yaml @@ -13,7 +13,7 @@ jobs: strategy: matrix: node-version: [ 18, 20 ] - typescript-version: [ '5.5.4' ] + typescript-version: [ '4.7.2', '5.5.4' ] steps: - name: Checkout repository uses: actions/checkout@v4 @@ -32,12 +32,13 @@ jobs: - name: Install dependencies run: pnpm install - - name: Override TypeScript version - run: pnpm add typescript@${{ matrix.typescript-version }} --save-dev - - 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 From 89b6a5e8fac8a5f70c4c372885c2dc36e124eca3 Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Thu, 19 Dec 2024 21:29:25 +0000 Subject: [PATCH 08/11] now this --- .github/workflows/minimum-version-ts-check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/minimum-version-ts-check.yaml b/.github/workflows/minimum-version-ts-check.yaml index 5602e47c9..beb1cbfc2 100644 --- a/.github/workflows/minimum-version-ts-check.yaml +++ b/.github/workflows/minimum-version-ts-check.yaml @@ -13,7 +13,7 @@ jobs: strategy: matrix: node-version: [ 18, 20 ] - typescript-version: [ '4.7.2', '5.5.4' ] + typescript-version: ['4.5.2', '4.7.2', '5.5.4' ] steps: - name: Checkout repository uses: actions/checkout@v4 From ad0b2b545d097cbdca331f0ebc42fde7d46eb559 Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Thu, 19 Dec 2024 21:38:39 +0000 Subject: [PATCH 09/11] what about newer node versions --- .github/workflows/minimum-version-ts-check.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/minimum-version-ts-check.yaml b/.github/workflows/minimum-version-ts-check.yaml index beb1cbfc2..faa025616 100644 --- a/.github/workflows/minimum-version-ts-check.yaml +++ b/.github/workflows/minimum-version-ts-check.yaml @@ -12,8 +12,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [ 18, 20 ] - typescript-version: ['4.5.2', '4.7.2', '5.5.4' ] + node-version: [ 16, 18, 20, 22, 23, 24 ] + typescript-version: ['4.7.2', '5.5.4' ] steps: - name: Checkout repository uses: actions/checkout@v4 From 7656380da2d8f12b89c2ccb8698c73957e51b5f7 Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Thu, 19 Dec 2024 21:42:41 +0000 Subject: [PATCH 10/11] what about newer node versions --- .github/workflows/minimum-version-ts-check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/minimum-version-ts-check.yaml b/.github/workflows/minimum-version-ts-check.yaml index faa025616..8559f9635 100644 --- a/.github/workflows/minimum-version-ts-check.yaml +++ b/.github/workflows/minimum-version-ts-check.yaml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [ 16, 18, 20, 22, 23, 24 ] + node-version: [ 16, 18, 20, 22, 23 ] typescript-version: ['4.7.2', '5.5.4' ] steps: - name: Checkout repository From 114609055fe2fe30956e0bb620fb41e0e0fc151c Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Thu, 19 Dec 2024 21:58:50 +0000 Subject: [PATCH 11/11] add lateset --- .github/workflows/minimum-version-ts-check.yaml | 2 +- README.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/minimum-version-ts-check.yaml b/.github/workflows/minimum-version-ts-check.yaml index 8559f9635..7a473e9c5 100644 --- a/.github/workflows/minimum-version-ts-check.yaml +++ b/.github/workflows/minimum-version-ts-check.yaml @@ -13,7 +13,7 @@ jobs: strategy: matrix: node-version: [ 16, 18, 20, 22, 23 ] - typescript-version: ['4.7.2', '5.5.4' ] + typescript-version: ['4.7.2', '5.5.4', 'latest' ] steps: - name: Checkout repository uses: actions/checkout@v4 diff --git a/README.md b/README.md index c13cb4aa1..b22c97bb4 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@ we use pnpm. it's best to install using `npm install -g pnpm@latest-8` and then `pnpm` commands as usual +## + ## Testing Unit tests: run `pnpm test`.