Skip to content

Commit

Permalink
feat: DE-149 analytics integration (#485)
Browse files Browse the repository at this point in the history
* add env to git ignore

* add es lint and prettier

* combine prettier and eslint

* fix lint errors

* remove uneeded packa attributes

* only lint source

* remove env from eslint

* lint gh action

* lint gh action v2

* rename gh lint action

* add amplitude dependency

* test with npm package

* uniswap analytics pkgs integration

* add web vitals

* add POC trace events on homepage

* add page name tracking

* add top landing page metrics

* new break down and page views

* new analytics events version

* replace dash with space

* get browser from analytics pkg

* define props

* remove eslint skips

* add app origin

* pull analytics from npm

* updated lockfile

* track referer

* use try catch

* add documentation and renaming

* feat: de 149- analytics integration v2 (#487)

* menu and navbar clicks

* log search bar clicks

* add div for click

* comments on extra div

* stop event propagation

* comment and page name

* adjust naming for version change

* protocol version as section

* update comment

* update switch statement

* remove fallback

* comment on default switch

* update analytics events

* fix import

* whole path name

* add comment for try/catch on init
  • Loading branch information
dannythedawger authored Nov 14, 2022
1 parent 11351ab commit 7471839
Show file tree
Hide file tree
Showing 14 changed files with 1,020 additions and 588 deletions.
72 changes: 43 additions & 29 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,54 @@
{
"parser": "@typescript-eslint/parser",
"env": {
"browser": true,
"es2021": true
},
"root": true,
"extends": [
"plugin:prettier/recommended",
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
"plugin:react-hooks/recommended",
"prettier/@typescript-eslint",
"plugin:prettier/recommended"
],
"overrides": [],
"plugins": [
"prettier",
"@typescript-eslint"
],
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"ecmaFeatures": {
// Allows for the parsing of JSX
"jsx": true
}
"ecmaVersion": "latest",
"sourceType": "module"
},
"ignorePatterns": [
"node_modules",
"coverage",
"build",
"dist",
".DS_Store",
".env.local",
".env.development.local",
".env.test.local",
".env.production.local",
".vscode/",
"package-lock.json",
"yarn.lock",
"docusaurus.config.js"
"plugins": [
"typescript-sort-keys"
],
"rules": {
"prettier/prettier": "error"
"typescript-sort-keys/string-enum": [
"error",
"asc",
{
"caseSensitive": true
}
],
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "enum",
"format": [
"StrictPascalCase"
]
}
],
"curly": [
"warn",
"all"
],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "_",
"varsIgnorePattern": "_",
"caughtErrorsIgnorePattern": "_"
}
]
}
}
9 changes: 9 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
const math = require('remark-math')
const katex = require('rehype-katex')
require('dotenv').config()

module.exports = {
customFields: {
// Analytics proxy URL
analyticsProxyUrl: process.env.REACT_APP_AMPLITUDE_PROXY_URL,
// Determines if staging env
stagingEnv: process.env.REACT_APP_STAGING,
// From node
nodeEnv: process.env.NODE_ENV,
},
title: 'Uniswap',
tagline: 'Documentation and Guides',
url: 'https://docs.uniswap.org/',
Expand Down
34 changes: 19 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "uniswap",
"version": "0.0.0",
"private": true,
"name": "@uniswap/docs",
"description": "Uniswap docs",
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
Expand All @@ -26,14 +25,17 @@
"@heroicons/react": "^1.0.1",
"@mdx-js/react": "^1.6.21",
"@types/react": "^17.0.11",
"@uniswap/analytics": "1.1.0",
"@uniswap/analytics-events": "1.0.5",
"algoliasearch": "^4.9.1",
"clsx": "^1.1.1",
"hast-util-is-element": "1.1.0",
"intl-locales-supported": "^1.8.12",
"react": "^16.8.4",
"react-dom": "^16.8.4",
"react": "18",
"react-dom": "18",
"rehype-katex": "5",
"remark-math": "3"
"remark-math": "3",
"web-vitals": "2.1.0"
},
"browserslist": {
"production": [
Expand All @@ -50,15 +52,17 @@
"devDependencies": {
"@docusaurus/module-type-aliases": "^2.1.0",
"@tsconfig/docusaurus": "^1.0.6",
"@typescript-eslint/eslint-plugin": "^5.41.0",
"@typescript-eslint/parser": "^5.41.0",
"eslint": "^8.26.0",
"eslint-config-prettier": "8.5.0",
"eslint-config-standard-with-typescript": "^23.0.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-n": "^15.0.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-promise": "^6.0.0",
"@typescript-eslint/eslint-plugin": "^4",
"@typescript-eslint/parser": "^4",
"dotenv": "^16.0.3",
"eslint": "^7.11.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-plugin-typescript-sort-keys": "^2.1.0",
"eslint-plugin-unused-imports": "^2.0.0",
"prettier": "2.7.1",
"typescript": "^4.8.4"
},
Expand Down
2 changes: 1 addition & 1 deletion sdk-examples/AddAndRemoveLiquidity.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Pool, Position, NonfungiblePositionManager, nearestUsableTick } from '@uniswap/v3-sdk/'
import { Pool, Position, NonfungiblePositionManager, nearestUsableTick } from '@uniswap/v3-sdk'

import { ethers } from 'ethers'
import { Percent, Token, CurrencyAmount } from '@uniswap/sdk-core'
Expand Down
Loading

1 comment on commit 7471839

@vercel
Copy link

@vercel vercel bot commented on 7471839 Nov 14, 2022

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

docs – ./

docs.uniswap.org
docs-uniswap.vercel.app
docs-git-main-uniswap.vercel.app

Please sign in to comment.