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
500 changes: 500 additions & 0 deletions .github/refs/v0-types.d.ts

Large diffs are not rendered by default.

48 changes: 47 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,50 @@ types/
misc.js

### VisualStudioCode ###
.vscode/*
.vscode/*

output.txt
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# generated content
public/_data
public/data
# remote content
sources

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# Local Netlify folder
.netlify
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"sane": "^4.1.0",
"sync-rpc": "^1.3.6",
"terser": "^5.10.0",
"tsd-jsdoc": "^2.5.0",
"typescript": "^4.3.5",
"uglify-js": "^3.15.0"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/analytics-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"main": "dist/server/analytics-core.js",
"module": "dist/server/analytics-core.module.js",
"unpkg": "dist/server/analytics-core.umd.js",
"types": "dist/types.d.ts",
"types": "dist/index.d.ts",
"browser": {
"./dist/server/analytics-core.js": "./dist/client/analytics-core.js",
"./dist/server/analytics-core.umd.js": "./dist/client/analytics-core.umd.js",
Expand All @@ -32,11 +32,11 @@
"scripts": {
"test": "ava -v",
"test:watch": "ava -v --watch",
"prebuild": "rimraf dist _temp-types",
"prebuild": "rimraf dist",
"build": "npm run build-client && npm run build-server && npm run types",
"build-client": "cd client && npm run build",
"build-server": "cd server && npm run build",
"types": "../../node_modules/.bin/jsdoc -t ../../node_modules/tsd-jsdoc/dist -r ./src/ -d _temp-types && node scripts/types.js",
"types": "tsc",
"publish": "git push origin && git push origin --tags",
"release:patch": "npm version patch && npm publish",
"release:minor": "npm version minor && npm publish",
Expand Down
85 changes: 0 additions & 85 deletions packages/analytics-core/scripts/types.js

This file was deleted.

23 changes: 14 additions & 9 deletions packages/analytics-core/src/constants.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
/**
* Core Analytic constants. These are exposed for third party plugins & listeners
* @typedef {Object} constants
* @property {ANON_ID} ANON_ID - Anonymous visitor Id localstorage key
* @property {USER_ID} USER_ID - Visitor Id localstorage key
* @property {USER_TRAITS} USER_TRAITS - Visitor traits localstorage key
*/
import { PREFIX } from '@analytics/type-utils'


/**
* Anonymous visitor Id localstorage key
* @typedef {String} ANON_ID
* @type {string}
*/
export const ANON_ID = PREFIX + 'anon_id' // __anon_id

/**
* Visitor Id localstorage key
* @typedef {String} USER_ID
* Visitor Id localstorage key
* @type {string}
*/
export const USER_ID = PREFIX + 'user_id' // __user_id

/**
* Visitor traits localstorage key
* @typedef {String} USER_TRAITS
* @type {string}
*/
export const USER_TRAITS = PREFIX + 'user_traits' // __user_traits

/**
* Core Analytic constants. These are exposed for third party plugins & listeners
* @typedef {Object} constants
* @property {ANON_ID} ANON_ID - Anonymous visitor Id localstorage key
* @property {USER_ID} USER_ID - Visitor Id localstorage key
* @property {USER_TRAITS} USER_TRAITS - Visitor traits localstorage key
*/
Loading