diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4efd453..afd0220 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,6 @@ name: Release -on: - workflow_dispatch +on: workflow_dispatch jobs: publish: @@ -16,4 +15,4 @@ jobs: - run: npm install -g @gitbook/cli - run: gitbook publish . env: - GITBOOK_TOKEN: ${{ secrets.GITBOOK_TOKEN }} + GITBOOK_TOKEN: ${{ secrets.GITBOOK_TOKEN }} diff --git a/.yarnrc.yml b/.yarnrc.yml index 42266c9..2c513ea 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -1,7 +1 @@ -supportedArchitectures: { - cpu: [ - "current", - "x64", - "arm64", - ] -} +supportedArchitectures: { cpu: ['current', 'x64', 'arm64'] } diff --git a/package.json b/package.json index b32b31c..bb2beac 100755 --- a/package.json +++ b/package.json @@ -1,54 +1,54 @@ { - "name": "integration-rudderstack", - "version": "1.0.2", - "private": true, - "dependencies": { - "@gitbook/api": "*", - "@gitbook/runtime": "*", - "crypto-js": "^4.2.0" - }, - "devDependencies": { - "@babel/preset-env": "^7.23.9", - "@esbuild/darwin-arm64": "^0.20.1", - "@gitbook/cli": "*", - "@gitbook/eslint-config": "*", - "@gitbook/tsconfig": "*", - "@types/crypto-js": "^4.2.2", - "@types/jest": "^29.5.12", - "@types/node": "^18.16.0", - "assert": "^2.0.0", - "babel-jest": "^29.7.0", - "esbuild-register": "^3.5.0", - "eslint": "^8.57.0", - "eslint-config-airbnb-typescript": "7", - "eslint-config-standard-with-typescript": "^43.0.1", - "eslint-plugin-import": "2", - "eslint-plugin-json": "^3.1.0", - "husky": "^9.0.11", - "jest": "^29.7.0", - "test": "^3.2.1", - "ts-jest": "^29.1.2", - "typescript": "^5.3.3" - }, - "scripts": { - "typecheck": "tsc --noEmit", - "publish-integration": "gitbook publish .", - "test": "jest --passWithNoTests", - "lint": "eslint . --max-warnings 0", - "lint:fix": "eslint --fix .", - "prepare": "husky install", - "prettier": "prettier --write .", - "prettier:check": "prettier --check ." - }, - "prettier": { - "useTabs": false, - "trailingComma": "none", - "singleQuote": true, - "jsxBracketSameLine": false, - "arrowParens": "avoid" - }, - "eslintIgnore": [ - "*.test.ts", - ".eslintrc.js" - ] + "name": "integration-rudderstack", + "version": "1.0.2", + "private": true, + "dependencies": { + "@gitbook/api": "*", + "@gitbook/runtime": "*", + "crypto-js": "^4.2.0" + }, + "devDependencies": { + "@babel/preset-env": "^7.23.9", + "@esbuild/darwin-arm64": "^0.20.1", + "@gitbook/cli": "*", + "@gitbook/eslint-config": "*", + "@gitbook/tsconfig": "*", + "@types/crypto-js": "^4.2.2", + "@types/jest": "^29.5.12", + "@types/node": "^18.16.0", + "assert": "^2.0.0", + "babel-jest": "^29.7.0", + "esbuild-register": "^3.5.0", + "eslint": "^8.57.0", + "eslint-config-airbnb-typescript": "7", + "eslint-config-standard-with-typescript": "^43.0.1", + "eslint-plugin-import": "2", + "eslint-plugin-json": "^3.1.0", + "husky": "^9.0.11", + "jest": "^29.7.0", + "test": "^3.2.1", + "ts-jest": "^29.1.2", + "typescript": "^5.3.3" + }, + "scripts": { + "typecheck": "tsc --noEmit", + "publish-integration": "gitbook publish .", + "test": "jest --passWithNoTests", + "lint": "eslint . --max-warnings 0", + "lint:fix": "eslint --fix .", + "prepare": "husky install", + "prettier": "prettier --write .", + "prettier:check": "prettier --check ." + }, + "prettier": { + "useTabs": false, + "trailingComma": "none", + "singleQuote": true, + "jsxBracketSameLine": false, + "arrowParens": "avoid" + }, + "eslintIgnore": [ + "*.test.ts", + ".eslintrc.js" + ] } diff --git a/src/events.ts b/src/events.ts index 9acd8b6..d8f2eb9 100755 --- a/src/events.ts +++ b/src/events.ts @@ -8,7 +8,9 @@ const RUDDER_ANONYMOUS_ID_COOKIE_NAME = 'rl_anonymous_id'; /** * Generate the event to track in RudderStack for an actual GitBook event. */ -export default function generateRudderStackTrackEvent(event: api.SpaceViewEvent) { +export default function generateRudderStackTrackEvent( + event: api.SpaceViewEvent +) { const { visitor, referrer, url, spaceId, pageId } = event; const anonymousId = getAnonymousId(event); @@ -48,7 +50,7 @@ export default function generateRudderStackTrackEvent(event: api.SpaceViewEvent) */ function getAnonymousId(event: api.SpaceViewEvent): string { const { visitor } = event; - const {cookies} = visitor; + const { cookies } = visitor; const extractedAnonymousId = extractAnonymousId(cookies); console.log('extracted anonymous id', extractedAnonymousId);