Skip to content
Open
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 .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ runs:
# Ensure latest npm with OIDC support (npm 11.5.1+)
- name: Ensure modern npm (OIDC support)
shell: bash
run: npm install -g [email protected]
run: sudo npm install -g [email protected]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yuck, really?!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually broke in a completely unrelated way, I'm not sure anything in my PR made this necessary or there was just an update to the runners


- uses: actions/cache@v4
id: pnpm-cache
Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/minimum-version-ts-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ jobs:
strategy:
matrix:
node-version: [20, 22, 24]
typescript-version: ["4.7.2", "5.5.4", "latest"]
typescript-version:
- version: "4.7.4"
extra-flags: "--moduleResolution node"
- version: "5.9.2"
extra-flags: "--moduleResolution node"
- version: "6.0.0-dev.20251204"
extra-flags: "--ignoreConfig"
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -25,12 +31,14 @@ jobs:

# 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
working-directory: packages/browser
env:
TS_VERSION: ${{ matrix.typescript-version.version }}
run: yq -i '.catalog.typescript = strenv(TS_VERSION)' pnpm-workspace.yaml && pnpm install --no-frozen-lockfile

- 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
rm ci-ts-file.js || true
pnpm exec tsc --version
pnpm exec tsc ci-ts-file.ts --strict --target es2017 --module commonjs --skipLibCheck ${{ matrix.typescript-version.extra-flags }}
node ci-ts-file.js
working-directory: packages/browser
3 changes: 3 additions & 0 deletions packages/ai/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ module.exports = {
coverageDirectory: 'coverage',
silent: true,
verbose: false,
transformIgnorePatterns: [
'node_modules/(?:(?=\\.pnpm/).pnpm/[^/]+/node_modules/|(?!\\.pnpm/))(?!(p-queue|p-timeout|eventemitter3)/)',
],
}
16 changes: 8 additions & 8 deletions packages/ai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@
},
"dependencies": {
"@ai-sdk/provider": "^2.0.0",
"@anthropic-ai/sdk": "^0.67.0",
"@google/genai": "^1.29.0",
"@langchain/core": "^1.0.0",
"ai": "^5.0.87",
"langchain": "^1.0.0",
"openai": "^6.8.1",
"uuid": "^11.0.5",
"zod": "^4.1.8"
"@anthropic-ai/sdk": "^0.67.1",
"@google/genai": "^1.31.0",
"@langchain/core": "^1.1.3",
"ai": "^5.0.107",
"langchain": "^1.1.4",
"openai": "^6.10.0",
"uuid": "^11.1.0",
"zod": "^4.1.13"
},
"peerDependencies": {
"posthog-node": "^5.0.0"
Expand Down
2 changes: 2 additions & 0 deletions packages/browser/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ cypress/downloads/downloads.html

react/sync.js
react/dist

ci-ts-file.js
6 changes: 6 additions & 0 deletions packages/browser/ci-ts-file.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* eslint-disable */
import { posthog } from './dist/module'
import * as ts from 'typescript'

console.log(posthog)
console.log(ts.version)
12 changes: 3 additions & 9 deletions packages/browser/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,11 @@ module.exports = {
prettierPath: null,
moduleNameMapper: {
'\\.css$': 'identity-obj-proxy',
'^preact$': '<rootDir>/../../node_modules/.pnpm/[email protected]/node_modules/preact/dist/preact.js',
'^preact/hooks$': '<rootDir>/../../node_modules/.pnpm/[email protected]/node_modules/preact/hooks/dist/hooks.js',
'^preact/jsx-runtime$':
'<rootDir>/../../node_modules/.pnpm/[email protected]/node_modules/preact/jsx-runtime/dist/jsxRuntime.js',
'^preact/test-utils$':
'<rootDir>/../../node_modules/.pnpm/[email protected]/node_modules/preact/test-utils/dist/testUtils.js',
'^@testing-library/preact$':
'<rootDir>/../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@testing-library/preact/dist/cjs/index.js',
},
transform: {
'^.+\\.(js|jsx|ts|tsx|mjs)$': 'babel-jest',
},
transformIgnorePatterns: ['node_modules/(?!(@testing-library/preact|preact))'],
transformIgnorePatterns: [
'node_modules/(?:(?=\\.pnpm/).pnpm/[^/]+/node_modules/|(?!\\.pnpm/))(?!(sinon|@testing-library/preact|preact|until-async)/)',
],
}
50 changes: 25 additions & 25 deletions packages/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
],
"dependencies": {
"@posthog/core": "workspace:*",
"core-js": "^3.38.1",
"core-js": "^3.47.0",
"fflate": "^0.4.8",
"preact": "^10.19.3",
"preact": "^10.28.0",
"web-vitals": "^4.2.4"
},
"devDependencies": {
Expand All @@ -64,17 +64,17 @@
"@babel/preset-env": "catalog:",
"@babel/preset-typescript": "catalog:",
"@jest/globals": "^29.7.0",
"@playwright/test": "^1.52.0",
"@playwright/test": "^1.57.0",
"@posthog-tooling/rollup-utils": "workspace:*",
"@posthog/rrweb-plugin-console-record": "^0.0.33",
"@posthog/rrweb-record": "^0.0.33",
"@posthog/rrweb-types": "^0.0.33",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^28.0.6",
"@rollup/plugin-babel": "^6.1.0",
"@rollup/plugin-commonjs": "^28.0.9",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^16.0.1",
"@rollup/plugin-node-resolve": "^16.0.3",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^12.1.4",
"@rollup/plugin-typescript": "^12.3.0",
"@rrweb/record": "2.0.0-alpha.17",
"@rrweb/rrweb-plugin-console-record": "2.0.0-alpha.17",
"@rrweb/types": "2.0.0-alpha.17",
Expand All @@ -84,38 +84,38 @@
"@testing-library/preact": "catalog:",
"@types/dotenv": "^8.2.3",
"@types/jest": "catalog:",
"@types/node": "^22.5.0",
"@types/sinon": "^17.0.1",
"@types/node": "^22.19.1",
"@types/sinon": "^21.0.0",
"@types/web": "^0.0.222",
"babel-jest": "^29.7.0",
"browserslist": "^4.24.5",
"compare-versions": "^6.1.0",
"cssnano": "^7.0.7",
"browserslist": "^4.28.1",
"compare-versions": "^6.1.1",
"cssnano": "^7.1.2",
"date-fns": "^3.6.0",
"dotenv": "^17.2.0",
"dotenv": "^17.2.3",
"expect": "^29.7.0",
"fast-check": "^2.17.0",
"fast-check": "^2.25.0",
"http-server": "14.1.1",
"husky": "^8.0.1",
"husky": "^8.0.3",
"identity-obj-proxy": "^3.0.0",
"jest": "catalog:",
"jest-environment-jsdom": "catalog:",
"jsdom": "16.7.0",
"jsdom-global": "3.0.2",
"localStorage": "1.0.4",
"msw": "^1.3.3",
"node-fetch": "^2.6.11",
"postcss": "^8.5.3",
"postcss-import": "^16.1.0",
"postcss-nesting": "^13.0.1",
"msw": "^1.3.5",
"node-fetch": "^2.7.0",
"postcss": "^8.5.6",
"postcss-import": "^16.1.1",
"postcss-nesting": "^13.0.2",
"posthog-js": "link:",
"preact-render-to-string": "^6.3.1",
"preact-render-to-string": "^6.6.3",
"rollup": "catalog:",
"rollup-plugin-dts": "^6.2.3",
"rollup-plugin-dts": "^6.3.0",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-visualizer": "^6.0.3",
"sinon": "9.0.2",
"testcafe": "^1.20.1",
"rollup-plugin-visualizer": "^6.0.5",
"sinon": "^21.0.0",
"testcafe": "^3.7.2",
"testcafe-browser-provider-browserstack": "^1.15.2",
"ts-node": "^10.9.2",
"tslib": "catalog:",
Expand Down
2 changes: 1 addition & 1 deletion packages/browser/src/__tests__/loader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { PostHog } from '../posthog-core'
import { defaultPostHog } from './helpers/posthog-instance'

import sinon from 'sinon'
import * as sinon from 'sinon'
import { assignableWindow, window } from '../utils/globals'

describe(`Module-based loader in Node env`, () => {
Expand Down
5 changes: 5 additions & 0 deletions packages/browser/src/__tests__/setup.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { TextDecoder, TextEncoder } from 'util'

beforeEach(() => {
// eslint-disable-next-line no-console
console.error = (...args) => {
Expand All @@ -7,4 +9,7 @@ beforeEach(() => {
console.warn = (...args) => {
throw new Error(`Unexpected console.warn: ${args}`)
}

global.TextEncoder = TextEncoder
global.TextDecoder = TextDecoder
})
8 changes: 4 additions & 4 deletions packages/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
},
"devDependencies": {
"@types/node": "^20.0.0",
"nuxt": "^4.1.2",
"@nuxt/devtools": "^2.6.5",
"nuxt": "^4.2.1",
"@nuxt/devtools": "^2.7.0",
"@nuxt/module-builder": "^1.0.2",
"@nuxt/schema": "^4.1.2",
"@nuxt/eslint-config": "^1.9.0",
"@nuxt/schema": "^4.2.1",
"@nuxt/eslint-config": "^1.11.0",
"eslint": "^9.37.0"
}
}
Loading
Loading