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
45 changes: 0 additions & 45 deletions .eslintrc.json

This file was deleted.

42 changes: 24 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: CD

on:
push:
branches:
branches:
- main
pull_request:
branches:
branches:
- main

jobs:
Expand All @@ -14,11 +14,13 @@ jobs:
timeout-minutes: 3
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: actions/cache@v2
node-version: 22
- name: Enable Corepack
run: corepack enable
- uses: actions/cache@v4
with:
path: ${{ env.working-directory }}/node_modules
key: ${{ env.working-directory }}-${{ hashFiles(format('{0}/yarn.lock', env.working-directory)) }}
Expand All @@ -35,11 +37,13 @@ jobs:
timeout-minutes: 3
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: actions/cache@v2
node-version: 22
- name: Enable Corepack
run: corepack enable
- uses: actions/cache@v4
with:
path: ${{ env.working-directory }}/node_modules
key: ${{ env.working-directory }}-${{ hashFiles(format('{0}/yarn.lock', env.working-directory)) }}
Expand All @@ -63,11 +67,13 @@ jobs:
timeout-minutes: 3
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: actions/cache@v2
node-version: 22
- name: Enable Corepack
run: corepack enable
- uses: actions/cache@v4
with:
path: ${{ env.working-directory }}/node_modules
key: ${{ env.working-directory }}-${{ hashFiles(format('{0}/yarn.lock', env.working-directory)) }}
Expand Down Expand Up @@ -100,12 +106,12 @@ jobs:
--exclude yarn.lock \
./
- name: Update Github release
uses: "marvinpinto/action-automatic-releases@latest"
uses: 'marvinpinto/action-automatic-releases@latest'
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
repo_token: '${{ secrets.GITHUB_TOKEN }}'
automatic_release_tag: 'latest'
prerelease: true
title: "Latest"
title: 'Latest'
files: |
packages/*
- name: Publish to NPMJS
Expand Down
Binary file added .yarn/install-state.gz
Binary file not shown.
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
19 changes: 19 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import pluginJs from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import globals from 'globals';
import tseslint from 'typescript-eslint';

/** @type {import('eslint').Linter.Config[]} */
export default [
{ files: ['**/*.{js,mjs,cjs,ts}'] },
{ languageOptions: { globals: globals.node } },
pluginJs.configs.recommended,
eslintConfigPrettier,
...tseslint.configs.recommended,
{
files: ['**/*.{ts,tsx}'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
},
},
];
120 changes: 61 additions & 59 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,87 +1,89 @@
{
"name": "eventfan",
"version": "2.0.9",
"version": "3.0.0",
"description": "Send analytics events to multiple destinations (Google Analytics, Facebook...).",
"repository": "https://github.com/alan-cooney/eventfan",
"author": "Alan Cooney <alan@skyhookadventure.com>",
"license": "MIT",
"type": "module",
"scripts": {
"build": "yarn buildCommonJS && yarn buildESM && yarn buildTypes",
"buildCommonJS": "parcel build",
"buildESM": "babel src -d dist/module --extensions '.tsx,.ts' --config-file ./babelNode.json",
"buildTypes": "tsc --emitDeclarationOnly",
"bump": "./node_modules/.bin/versiony package.json --patch",
"coverage": "./node_modules/.bin/jest --collect-coverage",
"coverage": "jest --collect-coverage",
"dev": "yarn react",
"lint": "./node_modules/.bin/eslint . --ext .ts,.tsx --ignore-path .gitignore",
"lint": "eslint .",
"playwright": "playwright test --config=src/e2e/playwright.config.ts",
"playwrightInstall": "playwright install && playwright install-deps",
"react": "yarn vite --config ./src/e2e/react/vite.config.js",
"test": "./node_modules/.bin/jest"
"test": "jest"
},
"devDependencies": {
"@babel/cli": "^7.21.0",
"@babel/core": "^7.21.4",
"@babel/preset-env": "^7.21.4",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.21.4",
"@playwright/test": "^1.32.3",
"@sentry/browser": "^7.47.0",
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.49",
"@swc/jest": "^0.2.24",
"@testing-library/dom": "^9.2.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@tsconfig/recommended": "^1.0.2",
"@types/fs-extra": "^11.0.1",
"@types/jest": "^29.5.0",
"@types/node": "^18.15.11",
"@types/react": "^18.0.34",
"@types/react-dom": "^18.0.11",
"@types/uuid": "^9.0.1",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"@vitejs/plugin-react": "^3.1.0",
"@babel/cli": "^7.26.4",
"@babel/core": "^7.26.9",
"@babel/preset-env": "^7.26.9",
"@babel/preset-react": "^7.26.3",
"@babel/preset-typescript": "^7.26.0",
"@playwright/test": "^1.50.1",
"@sentry/browser": "^9.3.0",
"@swc/cli": "^0.6.0",
"@swc/core": "^1.11.5",
"@swc/jest": "^0.2.37",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.2.0",
"@tsconfig/recommended": "^1.0.8",
"@types/fs-extra": "^11.0.4",
"@types/jest": "^29.5.14",
"@types/node": "^22.13.9",
"@types/react": "^18.3.18",
"@types/react-dom": "^19.0.4",
"@types/uuid": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@vitejs/plugin-react": "^4.3.4",
"babel-plugin-add-import-extension": "^1.6.0",
"change-case": "^4.1.2",
"cross-fetch": "^3.1.5",
"eslint": "^8.38.0",
"cross-fetch": "^4.1.0",
"eslint": "^9.21.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-jest-dom": "^4.0.3",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-testing-library": "^5.10.2",
"fs-extra": "^11.1.1",
"glob": "^10.0.0",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-config-prettier": "^10.0.2",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest": "^28.11.0",
"eslint-plugin-jest-dom": "^5.5.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-prettier": "^5.2.3",
"eslint-plugin-react": "^7.37.4",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-testing-library": "^7.1.1",
"fs-extra": "^11.3.0",
"glob": "^11.0.1",
"hygen": "^6.2.11",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"live-server": "^1.2.2",
"parcel": "^2.8.3",
"parcel": "^2.13.3",
"parcel-plugin-externals": "^0.5.2",
"parcel-plugin-nuke-dist": "^1.0.1",
"playwright": "^1.32.3",
"postal-address-field-names": "^1.0.3",
"prettier": "^2.8.7",
"quicktype-core": "^23.0.19",
"react": "^18.2.0",
"react-bootstrap": "^2.7.2",
"react-dom": "^18.2.0",
"react-router-dom": "^6.10.0",
"playwright": "^1.50.1",
"postal-address-field-names": "^1.0.4",
"prettier": "^3.5.3",
"quicktype-core": "^23.0.171",
"react": "^19.0.0",
"react-bootstrap": "^2.10.9",
"react-dom": "^19.0.0",
"react-router-dom": "^7.2.0",
"react-scripts": "^5.0.1",
"recursive-readdir-sync": "^1.0.6",
"tiny-glob": "^0.2.9",
"ts-node": "^10.9.1",
"typescript": "~5.0.4",
"ts-node": "^10.9.2",
"typescript": "~5.8.2",
"typescript-eslint": "^8.26.0",
"versiony-cli": "^1.3.0",
"vite": "^4.2.1"
"vite": "^6.2.0"
},
"peerDependencies": {
"react": ">=16.14.0",
Expand All @@ -100,7 +102,6 @@
".ts",
".tsx"
],
"resolver": "./src/jest-resolver.js",
"testEnvironment": "jsdom",
"testMatch": [
"**/*unit.test.ts",
Expand All @@ -119,8 +120,8 @@
},
"sideEffects": false,
"dependencies": {
"posthog-js": "^1.68.1",
"uuid": "^9.0.0"
"posthog-js": "^1.225.1",
"uuid": "^9.0.1"
},
"main": "./dist/main/index.js",
"module": "./dist/module/index.js",
Expand All @@ -138,5 +139,6 @@
"sourceMap": false,
"distDir": "./dist/main"
}
}
},
"packageManager": "yarn@4.7.0"
}
4 changes: 2 additions & 2 deletions src/client/EventFan.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable default-param-last */
/* eslint-disable no-restricted-syntax */
import type Destination from "../destinations/Destination";
import type { TEvent } from "../types/TrackEvent";
import type { User } from "../types/User";
Expand Down
6 changes: 3 additions & 3 deletions src/client/tests/EventFan.unit.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/dot-notation */
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable max-classes-per-file */
import EventFan from "../EventFan";
import type Destination from "../../destinations/Destination";
import { DestinationName } from "../../destinations/DestinationName";
Expand Down
4 changes: 2 additions & 2 deletions src/destinations/Destination.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-empty-function */
/* eslint-disable @typescript-eslint/no-useless-constructor */
import { DestinationName } from "./DestinationName";
import { User } from "../types/User";
import { Page } from "../types/PageViewProps";
Expand Down
15 changes: 6 additions & 9 deletions src/destinations/DestinationName.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
/* eslint-disable import/prefer-default-export */

/**
* Destination names
*/
export enum DestinationName {
DRIP = "DRIP",
FACEBOOK_PIXEL = "FACEBOOK_PIXEL",
GA4 = "GA4",
HOTJAR = "HOTJAR",
POSTHOG = "POSTHOG",
RUDDERSTACK = "RUDDERSTACK",
SENTRY = "SENTRY",
DRIP = 'DRIP',
FACEBOOK_PIXEL = 'FACEBOOK_PIXEL',
GA4 = 'GA4',
HOTJAR = 'HOTJAR',
POSTHOG = 'POSTHOG',
SENTRY = 'SENTRY',
}
2 changes: 1 addition & 1 deletion src/destinations/drip/Drip.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable no-underscore-dangle */
import { DestinationName } from "../DestinationName";
import { DripIdentity } from "./types/DripJsAPI";
import { TEvent } from "../../types/TrackEvent";
Expand Down
4 changes: 2 additions & 2 deletions src/destinations/drip/tests/Drip.unit.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-underscore-dangle */
/* eslint-disable @typescript-eslint/dot-notation */
import { mockTrack, mockUser } from "../../../mocks";
import { DestinationName } from "../../DestinationName";
import Drip from "../Drip";
Expand Down
Loading
Loading