@posthog/plugin-server

v1.10.7
PostHog Plugin Server

test

jest --runInBand --forceExit tests/**/*.test.ts

test:postgres:1

jest --runInBand --forceExit tests/*.test.ts

test:postgres:2

jest --runInBand --forceExit tests/postgres/*.test.ts

test:clickhouse:1

jest --runInBand --forceExit tests/clickhouse/postgres-parity.test.ts tests/clickhouse/e2e.test.ts tests/clickhouse/ingestion-utils.test.ts

test:clickhouse:2

jest --runInBand --forceExit tests/clickhouse/process-event.test.ts

benchmark

yarn run benchmarks:clickhouse && yarn run benchmark:postgres && yarn run benchmarks:vm

benchmark:clickhouse

node --expose-gc node_modules/.bin/jest --runInBand benchmarks/clickhouse/

benchmark:postgres

node --expose-gc node_modules/.bin/jest --runInBand benchmarks/postgres/

benchmark:vm:memory

node --expose-gc node_modules/.bin/jest --runInBand benchmarks/vm/memory.benchmark.ts

benchmark:vm:worker

node --expose-gc node_modules/.bin/jest --runInBand benchmarks/vm/worker.benchmark.ts

start

yarn start:dist

start:dist

BASE_DIR=.. node dist/index.js

start:dev

NODE_ENV=dev BASE_DIR=.. ts-node-dev --debug --exit-child src/index.ts

start:dev:ee

KAFKA_ENABLED=true KAFKA_HOSTS=localhost:9092 yarn start:dev

build

yarn clean && yarn compile

clean

rimraf dist/*

protobuf:compile

cd src/config/idl/ && rimraf protos.* && pbjs -t static-module -w commonjs -o protos.js *.proto && pbts -o protos.d.ts protos.js && eslint --fix . && prettier --write .

typescript:compile

tsc -b

typescript:check

tsc --noEmit -p .

compile

yarn protobuf:compile && yarn typescript:compile

lint

eslint .

lint:fix

eslint --fix .

prettier

prettier --write .

prettier:check

prettier --check .

prepare

yarn protobuf:compile

prepublishOnly

yarn build

setup:dev:clickhouse

cd .. && export DEBUG=1 PRIMARY_DB=clickhouse && python manage.py migrate_clickhouse

setup:test:ee

yarn setup:test:postgres && yarn setup:test:clickhouse

setup:test:postgres

cd .. && (dropdb test_posthog || echo 'no db to drop') && createdb test_posthog && DATABASE_URL=postgres://localhost:5432/test_posthog DEBUG=1 python manage.py migrate

setup:test:clickhouse

cd .. && unset KAFKA_URL && export TEST=1 PRIMARY_DB=clickhouse CLICKHOUSE_DATABASE=posthog_test && python manage.py migrate_clickhouse

services:start

cd .. && docker-compose -f ee/docker-compose.ch.yml up zookeeper kafka clickhouse

services:stop

cd .. && docker-compose -f ee/docker-compose.ch.yml down

services:clean

cd .. && docker-compose -f ee/docker-compose.ch.yml rm -v zookeeper kafka clickhouse

services

yarn services:stop && yarn services:clean && yarn services:start
npm i @posthog/plugin-server

Metadata

  • MIT
  • Whatever
  • PostHog
  • released 11/30/2021

Downloads