@codecademy/tracking 1.0.0-alpha.f35aad.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/.eslintrc.json +33 -0
  2. package/CHANGELOG.md +161 -47
  3. package/LICENSE +1 -1
  4. package/babel.config.js +11 -2
  5. package/package.json +6 -29
  6. package/project.json +46 -0
  7. package/tsconfig.json +16 -4
  8. package/tsconfig.spec.json +9 -0
  9. package/dist/events/__tests__/track.spec.d.ts +0 -1
  10. package/dist/events/__tests__/track.spec.js +0 -78
  11. package/dist/events/__tests__/track.test.d.ts +0 -1
  12. package/dist/events/__tests__/track.test.js +0 -78
  13. package/dist/events/__tests__/user.spec.d.ts +0 -1
  14. package/dist/events/__tests__/user.spec.js +0 -42
  15. package/dist/events/__tests__/user.test.d.ts +0 -1
  16. package/dist/events/__tests__/user.test.js +0 -42
  17. package/dist/events/index.d.ts +0 -3
  18. package/dist/events/index.js +0 -3
  19. package/dist/events/track.d.ts +0 -11
  20. package/dist/events/track.js +0 -88
  21. package/dist/events/types.d.ts +0 -218
  22. package/dist/events/types.js +0 -0
  23. package/dist/events/user.d.ts +0 -2
  24. package/dist/events/user.js +0 -39
  25. package/dist/index.d.ts +0 -3
  26. package/dist/index.js +0 -3
  27. package/dist/integrations/__tests__/conditionallyLoadAnalytics-test.d.ts +0 -1
  28. package/dist/integrations/__tests__/fetchDestinationsForWriteKey-test.d.ts +0 -1
  29. package/dist/integrations/__tests__/mapDestinations-test.d.ts +0 -1
  30. package/dist/integrations/conditionallyLoadAnalytics.d.ts +0 -9
  31. package/dist/integrations/conditionallyLoadAnalytics.js +0 -24
  32. package/dist/integrations/consent.d.ts +0 -9
  33. package/dist/integrations/consent.js +0 -11
  34. package/dist/integrations/fetchDestinationsForWriteKey.d.ts +0 -6
  35. package/dist/integrations/fetchDestinationsForWriteKey.js +0 -76
  36. package/dist/integrations/index.d.ts +0 -27
  37. package/dist/integrations/index.js +0 -84
  38. package/dist/integrations/mapDestinations.d.ts +0 -19
  39. package/dist/integrations/mapDestinations.js +0 -55
  40. package/dist/integrations/onetrust.d.ts +0 -6
  41. package/dist/integrations/onetrust.js +0 -51
  42. package/dist/integrations/runSegmentSnippet.d.ts +0 -1
  43. package/dist/integrations/runSegmentSnippet.js +0 -86
  44. package/dist/integrations/types.d.ts +0 -24
  45. package/dist/integrations/types.js +0 -0
  46. package/jest.config.js +0 -7
package/.eslintrc.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "extends": ["../../.eslintrc.json"],
3
+ "ignorePatterns": ["!**/*"],
4
+ "overrides": [
5
+ {
6
+ "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7
+ "rules": {}
8
+ },
9
+ {
10
+ "files": ["*.ts", "*.tsx"],
11
+ "rules": {}
12
+ },
13
+ {
14
+ "files": ["*.js", "*.jsx"],
15
+ "rules": {}
16
+ }
17
+ ],
18
+ "rules": {
19
+ // These rules could be useful, but we haven"t gotten around to enabling them here
20
+ // See WEB-2 for general tracking.
21
+ "@typescript-eslint/no-explicit-any": "off",
22
+ "@typescript-eslint/no-unsafe-call": "off",
23
+ "@typescript-eslint/no-non-null-assertion": "off",
24
+ "@typescript-eslint/no-unsafe-assignment": "off",
25
+ "@typescript-eslint/no-unsafe-member-access": "off",
26
+ "@typescript-eslint/no-unsafe-return": "off",
27
+ "@typescript-eslint/restrict-plus-operands": "off",
28
+ "@typescript-eslint/restrict-template-expressions": "off",
29
+ "@typescript-eslint/ts-nocheck": "off",
30
+ "@typescript-eslint/ban-ts-comment": "off",
31
+ "prefer-rest-params": "off"
32
+ }
33
+ }
package/CHANGELOG.md CHANGED
@@ -3,194 +3,308 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [1.0.0-alpha.f35aad.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.7.3...@codecademy/tracking@1.0.0-alpha.f35aad.0) (2021-05-24)
6
+ ## [0.23.3](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.23.0...@codecademy/tracking@0.23.3) (2022-09-02)
7
7
 
8
+ ### Reverts
8
9
 
9
- ### BREAKING CHANGES
10
+ - Revert "remove codebytes and tracking" ([c3fa53f](https://github.com/Codecademy/client-modules/commit/c3fa53f3d8a316274e19be7f779ee02cbe9013e4))
11
+ - Revert "remove extra eslint file" ([0696878](https://github.com/Codecademy/client-modules/commit/0696878705a56d28d49694b3114dc824e6fe1a9f))
10
12
 
11
- * prepended OneTrust to tracking integrations loads
13
+ ## [0.23.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.22.0...@codecademy/tracking@0.23.0) (2022-05-24)
12
14
 
13
15
  ### Features
14
16
 
15
- * prepended OneTrust to tracking integrations loads ([1a96c16](https://github.com/Codecademy/client-modules/commit/1a96c161c28156e6fa1c4280776c15641d199754))
17
+ - **tracking:** :sparkles: Including field to track business seat data ([#46](https://github.com/Codecademy/client-modules/issues/46)) ([331893d](https://github.com/Codecademy/client-modules/commit/331893dd50b5bdbe861330b16744ae9f58d719be))
16
18
 
19
+ ## [0.22.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.21.1...@codecademy/tracking@0.22.0) (2022-05-16)
17
20
 
21
+ ### Features
18
22
 
19
- ### [0.7.3](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.7.2...@codecademy/tracking@0.7.3) (2021-05-10)
23
+ - **tracking:** Adding misc field for click and visit events ([57ae584](https://github.com/Codecademy/client-modules/commit/57ae584d3519db2d40b9a4c021fbee309df59d75))
20
24
 
25
+ ### [0.21.1](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.21.0...@codecademy/tracking@0.21.1) (2022-05-13)
21
26
 
22
27
  ### Bug Fixes
23
28
 
24
- * allow no user for tracking integrations ([#1726](https://github.com/Codecademy/client-modules/issues/1726)) ([66fdf89](https://github.com/Codecademy/client-modules/commit/66fdf89834d2eae53172cd6254d936c182281f0c))
29
+ - **tracking:** pick content_ids ([bd8b0a6](https://github.com/Codecademy/client-modules/commit/bd8b0a63eb6d8cfda2c0471fddcb7954898fbc75))
25
30
 
31
+ ## [0.21.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.20.0...@codecademy/tracking@0.21.0) (2022-05-13)
26
32
 
33
+ ### Features
27
34
 
28
- ### [0.7.2](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.7.1...@codecademy/tracking@0.7.2) (2021-05-03)
35
+ - **tracking:** add UserSharedData to user impressions ([6378ec2](https://github.com/Codecademy/client-modules/commit/6378ec2cb4f076210fa842dcfb07b43717afd1f9))
29
36
 
30
- **Note:** Version bump only for package @codecademy/tracking
37
+ ## [0.20.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.19.0...@codecademy/tracking@0.20.0) (2022-04-11)
31
38
 
39
+ ### Features
32
40
 
41
+ - **tracking:** add experiment category to tracking types ([4fa1528](https://github.com/Codecademy/client-modules/commit/4fa1528e719df904b88953edb8a625aa06610206))
33
42
 
43
+ ## [0.19.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.18.1...@codecademy/tracking@0.19.0) (2022-03-10)
34
44
 
45
+ ### Features
35
46
 
36
- ### [0.7.1](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.7.0...@codecademy/tracking@0.7.1) (2021-05-03)
47
+ - **Tracking:** add is_ugc attribute to tracking types ([2fe9c08](https://github.com/Codecademy/client-modules/commit/2fe9c083d0205e6af8dd928e9c291ebbeeeb6cbb))
37
48
 
49
+ ### [0.18.1](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.18.0...@codecademy/tracking@0.18.1) (2022-02-02)
38
50
 
39
- ### Bug Fixes
51
+ **Note:** Version bump only for package @codecademy/tracking
40
52
 
41
- * switch tracking 'verbose' type back to boolean ([8aae870](https://github.com/Codecademy/client-modules/commit/8aae8709b5e755f386f7c9f350ee7a4b86c19bcb))
53
+ ## [0.18.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.17.1...@codecademy/tracking@0.18.0) (2021-12-20)
42
54
 
55
+ ### Features
43
56
 
57
+ - **Tracking:** add search id param to userclick data ([7150c44](https://github.com/Codecademy/client-modules/commit/7150c44d665624502cfd95ac0020130b5ab8c26a))
44
58
 
45
- ## [0.7.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.6.0...@codecademy/tracking@0.7.0) (2021-05-03)
59
+ ### [0.17.1](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.17.0...@codecademy/tracking@0.17.1) (2021-12-17)
60
+
61
+ ### Bug Fixes
46
62
 
63
+ - **tracking:** remove navigator.sendBeacon .bind and add try/catch ([b924d7e](https://github.com/Codecademy/client-modules/commit/b924d7e1ffd22d75adcaf15c9726d10f19b2924e))
64
+
65
+ ## [0.17.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.16.1...@codecademy/tracking@0.17.0) (2021-11-30)
47
66
 
48
67
  ### ⚠ BREAKING CHANGES
49
68
 
50
- * clean up tracker and remove auth token
69
+ - **eslint-config:** bump ESLint to 8 and typescript-eslint to 5 (#4)
51
70
 
52
71
  ### Features
53
72
 
54
- * clean up tracker and remove auth token ([d2088e9](https://github.com/Codecademy/client-modules/commit/d2088e9741ffaa3e568bf182fb7bb6156ed5bf18))
73
+ - **eslint-config:** bump ESLint to 8 and typescript-eslint to 5 ([#4](https://github.com/Codecademy/client-modules/issues/4)) ([64423d6](https://github.com/Codecademy/client-modules/commit/64423d69ad0f90f2e717373db6b1988b715681cc))
55
74
 
75
+ ### [0.16.1](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.16.0...@codecademy/tracking@0.16.1) (2021-11-12)
56
76
 
77
+ ### Bug Fixes
57
78
 
58
- ## [0.6.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.5.4...@codecademy/tracking@0.6.0) (2021-05-03)
79
+ - **tracking:** super-bind the sendBeacon to navigator ([b32a8ec](https://github.com/Codecademy/client-modules/commit/b32a8ece14b2c2d62abf98f762f1be17690406f8))
59
80
 
81
+ ## 0.16.0 (2021-11-10)
60
82
 
61
- ### Features
83
+ ### ⚠ BREAKING CHANGES
62
84
 
63
- * added useTrackingIntegrations to tracking package ([2d508e2](https://github.com/Codecademy/client-modules/commit/2d508e2efbcb47968a543d7b54363707301ef351))
85
+ - prepended OneTrust to tracking integrations loads
86
+ - clean up tracker and remove auth token
64
87
 
88
+ ### Features
65
89
 
90
+ - **tracking:** Add source tracking for PWA ([32321cc](https://github.com/Codecademy/client-modules/commit/32321cc489dfd2ada1d967ad6630e849ddebd6e6))
91
+ - **tracking:** ignore known client failures in fetching destinations ([#2](https://github.com/Codecademy/client-modules/issues/2)) ([432549d](https://github.com/Codecademy/client-modules/commit/432549df9b556672eb9b3a321a90d37dd1009b09))
92
+ - add user impression to tracking ([3ec4f61](https://github.com/Codecademy/client-modules/commit/3ec4f6113350859b9d792467ca29b01e0855b4a4))
93
+ - bump ESLint configs to latest ([3a403c0](https://github.com/Codecademy/client-modules/commit/3a403c01358f8b4a0d10d99f8d57e1979ebce189))
94
+ - **event type:** adding business reporting types ([d4a0243](https://github.com/Codecademy/client-modules/commit/d4a0243b6380666850ef0f4bcfcd3c80a065d011)), closes [/github.com/codecademy-engineering/business-reporting/blob/develop/src/util/eventTracking/index.tsx#L104-L110](https://github.com/Codecademy//github.com/codecademy-engineering/business-reporting/blob/develop/src/util/eventTracking/index.tsx/issues/L104-L110)
95
+ - **tracking:** Add a fullstory boolean to TrackingOptions type ([4433669](https://github.com/Codecademy/client-modules/commit/443366955e8beb6aca3337841bf70c583df89f5f))
96
+ - **tracking:** Add a new page_career_path_visited event ([#1283](https://github.com/Codecademy/client-modules/issues/1283)) ([1228399](https://github.com/Codecademy/client-modules/commit/12283990e0bfa0d8d03fb78c83c84cab318e68b1))
97
+ - **tracking:** Added repo-tracking to user events ([d8a72f1](https://github.com/Codecademy/client-modules/commit/d8a72f19afbb02ba6d0aeef7a6b4b2b55820f111))
98
+ - **tracking:** Record the page referrer for every event. ([da11524](https://github.com/Codecademy/client-modules/commit/da11524588571f2ce44bd9af4486b9b64b66408c))
99
+ - **tracking:** Update business event name ([8babbf9](https://github.com/Codecademy/client-modules/commit/8babbf98dad5deb25782aa5b72229c2fea1a6c88))
100
+ - add container_slugs to UserClickData tracking type ([0a70fec](https://github.com/Codecademy/client-modules/commit/0a70fec80c88833bfad73728ae4a52cd54dc659e))
101
+ - added useTrackingIntegrations to tracking package ([b93ca89](https://github.com/Codecademy/client-modules/commit/b93ca897634c62a8d6defb6f6b426395d2daf9f0))
102
+ - clean up tracker and remove auth token ([7d98f82](https://github.com/Codecademy/client-modules/commit/7d98f82f64e48984e0913de83aea0635e93b21d9))
103
+ - Creating the @codecademy/tracking pachage. ([eb2cdca](https://github.com/Codecademy/client-modules/commit/eb2cdca0f1ecf2f77035ffac39e4c7cbe956bed2))
104
+ - onboarded eslint-plugin-simple-import-sort into ESLint plugin ([5eac76b](https://github.com/Codecademy/client-modules/commit/5eac76b95f547f0457360c8f7428af17152d1d67))
105
+ - prepended OneTrust to tracking integrations loads ([9c2e18e](https://github.com/Codecademy/client-modules/commit/9c2e18e35f3f3f538dc3727f4efdde3521708b6c))
66
106
 
67
- ### [0.5.4](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.5.3...@codecademy/tracking@0.5.4) (2021-05-03)
107
+ ### Bug Fixes
68
108
 
109
+ - Add a runtime dependency ([436c3fb](https://github.com/Codecademy/client-modules/commit/436c3fba8812d6f74181de57dca9e8750e371760))
110
+ - Add query params to tracking calls ([#1189](https://github.com/Codecademy/client-modules/issues/1189)) ([6611839](https://github.com/Codecademy/client-modules/commit/661183985d81ca4f75cdfb39a4514f4d7f287d8d))
111
+ - allow no user for tracking integrations ([#1726](https://github.com/Codecademy/client-modules/issues/1726)) ([fa31842](https://github.com/Codecademy/client-modules/commit/fa318421ea2396497bf80fe69ba56063330dd0ed))
112
+ - bump tracking package babel-preset-codecademy to latest ([5c66f67](https://github.com/Codecademy/client-modules/commit/5c66f67c2833993a0dbd6b2e9441b3e590225437))
113
+ - business reporting event types ([2d9fb8e](https://github.com/Codecademy/client-modules/commit/2d9fb8e62d078aed0721df4afae775de2832733f))
114
+ - support navigator.sendBeacon not existing ([79b94cc](https://github.com/Codecademy/client-modules/commit/79b94cc0c140da083a770527a7cf4622c6578a97))
115
+ - switch tracking 'verbose' type back to boolean ([913c870](https://github.com/Codecademy/client-modules/commit/913c8703fb6a06363b324940d7ee406f839e4b53))
116
+ - use old style existence check for navigator.sendBeacon ([f0bf309](https://github.com/Codecademy/client-modules/commit/f0bf30947aa6edb767cab500480a0a71ca147d39))
69
117
 
70
- ### Bug Fixes
118
+ ### Reverts
119
+
120
+ - Revert "feat(tracking): Add a fullstory boolean to TrackingOptions type" (#1381) ([376df52](https://github.com/Codecademy/client-modules/commit/376df52daec85208bbaf28760c5fd6bfa5e52810)), closes [#1381](https://github.com/Codecademy/client-modules/issues/1381)
71
121
 
72
- * bump tracking package babel-preset-codecademy to latest ([e809566](https://github.com/Codecademy/client-modules/commit/e80956648e76c3e0b439d4d3a63b3baafd818064))
122
+ ## [0.15.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.14.2...@codecademy/tracking@0.15.0) (2021-10-20)
73
123
 
124
+ ### Features
74
125
 
126
+ - **tracking:** Add source tracking for PWA ([84a555f](https://github.com/Codecademy/client-modules/commit/84a555fcc8ce5f2b15c20fd7421757e18749514f))
75
127
 
76
- ### [0.5.3](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.5.2...@codecademy/tracking@0.5.3) (2021-04-21)
128
+ ### [0.14.2](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.14.1...@codecademy/tracking@0.14.2) (2021-09-13)
77
129
 
78
130
  **Note:** Version bump only for package @codecademy/tracking
79
131
 
132
+ ### [0.14.1](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.14.0...@codecademy/tracking@0.14.1) (2021-09-10)
80
133
 
134
+ **Note:** Version bump only for package @codecademy/tracking
81
135
 
136
+ ## [0.14.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.13.1...@codecademy/tracking@0.14.0) (2021-09-10)
82
137
 
138
+ ### Features
83
139
 
84
- ### [0.5.2](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.5.1...@codecademy/tracking@0.5.2) (2021-03-19)
140
+ - bump ESLint configs to latest ([e0a201a](https://github.com/Codecademy/client-modules/commit/e0a201abcc5f49718538d3d91af21cb37db4470e))
141
+
142
+ ### [0.13.1](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.13.0...@codecademy/tracking@0.13.1) (2021-08-13)
85
143
 
86
144
  **Note:** Version bump only for package @codecademy/tracking
87
145
 
146
+ ## [0.13.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.12.1...@codecademy/tracking@0.13.0) (2021-07-20)
88
147
 
148
+ ### Features
89
149
 
150
+ - **tracking:** Update business event name ([5bfde22](https://github.com/Codecademy/client-modules/commit/5bfde22e22fa76ab000369cf6598b9e0cfec5d63))
90
151
 
152
+ ### [0.12.1](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.12.0...@codecademy/tracking@0.12.1) (2021-07-13)
91
153
 
92
- ### [0.5.1](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.5.0...@codecademy/tracking@0.5.1) (2021-03-04)
154
+ ### Bug Fixes
93
155
 
94
- **Note:** Version bump only for package @codecademy/tracking
156
+ - business reporting event types ([b480487](https://github.com/Codecademy/client-modules/commit/b480487125ec85aa8466b0225730a2772c88452a))
95
157
 
158
+ ## [0.12.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.11.1...@codecademy/tracking@0.12.0) (2021-07-13)
96
159
 
160
+ ### Features
97
161
 
162
+ - **event type:** adding business reporting types ([5c8b6c5](https://github.com/Codecademy/client-modules/commit/5c8b6c5fe60b2d415436c56d485d092e6e94f68f)), closes [/github.com/codecademy-engineering/business-reporting/blob/develop/src/util/eventTracking/index.tsx#L104-L110](https://github.com/Codecademy//github.com/codecademy-engineering/business-reporting/blob/develop/src/util/eventTracking/index.tsx/issues/L104-L110)
98
163
 
164
+ ### [0.11.1](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.11.0...@codecademy/tracking@0.11.1) (2021-06-30)
99
165
 
100
- ## [0.5.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.4.3...@codecademy/tracking@0.5.0) (2021-02-18)
166
+ ### Bug Fixes
167
+
168
+ - support navigator.sendBeacon not existing ([ab442ef](https://github.com/Codecademy/client-modules/commit/ab442efb8e097015b5cca2ca34c869e83bb53d44))
101
169
 
170
+ ## [0.11.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.10.0...@codecademy/tracking@0.11.0) (2021-06-30)
102
171
 
103
172
  ### Features
104
173
 
105
- * add container_slugs to UserClickData tracking type ([ebb2d18](https://github.com/Codecademy/client-modules/commit/ebb2d1873505d7c09e14a0f714e5661914e8dd4a))
174
+ - add user impression to tracking ([a5960aa](https://github.com/Codecademy/client-modules/commit/a5960aa034a1725bbcb119a2cf193557bfacd386))
106
175
 
176
+ ## [0.10.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.9.0...@codecademy/tracking@0.10.0) (2021-06-21)
107
177
 
178
+ ### Features
108
179
 
109
- ### [0.4.3](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.4.2...@codecademy/tracking@0.4.3) (2021-02-10)
180
+ - **tracking:** Added repo-tracking to user events ([22d0d7f](https://github.com/Codecademy/client-modules/commit/22d0d7feb37beb6642ab8fdf09f83480e5919bdf))
110
181
 
182
+ ## [0.9.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.8.0...@codecademy/tracking@0.9.0) (2021-06-10)
111
183
 
112
- ### Reverts
184
+ ### Features
113
185
 
114
- * Revert "feat(tracking): Add a fullstory boolean to TrackingOptions type" (#1381) ([f04d8b5](https://github.com/Codecademy/client-modules/commit/f04d8b57cac13dfffc8951641e52c2593827aba9)), closes [#1381](https://github.com/Codecademy/client-modules/issues/1381)
186
+ - **tracking:** Record the page referrer for every event. ([5ae6357](https://github.com/Codecademy/client-modules/commit/5ae63574671e79e956afdebe8bcf62d81364feae))
115
187
 
188
+ ## [0.8.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.7.3...@codecademy/tracking@0.8.0) (2021-05-24)
116
189
 
190
+ ### ⚠ BREAKING CHANGES
117
191
 
118
- ### [0.4.2](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.4.1...@codecademy/tracking@0.4.2) (2021-02-04)
192
+ - prepended OneTrust to tracking integrations loads
119
193
 
120
- **Note:** Version bump only for package @codecademy/tracking
194
+ ### Features
121
195
 
196
+ - prepended OneTrust to tracking integrations loads ([3d8ce05](https://github.com/Codecademy/client-modules/commit/3d8ce05f1669728261f496b604fa8cc5906434e5))
122
197
 
198
+ ### [0.7.3](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.7.2...@codecademy/tracking@0.7.3) (2021-05-10)
123
199
 
200
+ ### Bug Fixes
124
201
 
202
+ - allow no user for tracking integrations ([#1726](https://github.com/Codecademy/client-modules/issues/1726)) ([66fdf89](https://github.com/Codecademy/client-modules/commit/66fdf89834d2eae53172cd6254d936c182281f0c))
125
203
 
126
- ### [0.4.1](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.4.0...@codecademy/tracking@0.4.1) (2021-02-02)
204
+ ### [0.7.2](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.7.1...@codecademy/tracking@0.7.2) (2021-05-03)
127
205
 
128
206
  **Note:** Version bump only for package @codecademy/tracking
129
207
 
208
+ ### [0.7.1](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.7.0...@codecademy/tracking@0.7.1) (2021-05-03)
130
209
 
210
+ ### Bug Fixes
131
211
 
212
+ - switch tracking 'verbose' type back to boolean ([8aae870](https://github.com/Codecademy/client-modules/commit/8aae8709b5e755f386f7c9f350ee7a4b86c19bcb))
132
213
 
214
+ ## [0.7.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.6.0...@codecademy/tracking@0.7.0) (2021-05-03)
133
215
 
134
- ## [0.4.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.3.0...@codecademy/tracking@0.4.0) (2021-01-14)
216
+ ### BREAKING CHANGES
135
217
 
218
+ - clean up tracker and remove auth token
136
219
 
137
220
  ### Features
138
221
 
139
- * **tracking:** Add a new page_career_path_visited event ([#1283](https://github.com/Codecademy/client-modules/issues/1283)) ([398e863](https://github.com/Codecademy/client-modules/commit/398e8636ed1ae5dc602f8ed103583b73aa0d6abc))
222
+ - clean up tracker and remove auth token ([d2088e9](https://github.com/Codecademy/client-modules/commit/d2088e9741ffaa3e568bf182fb7bb6156ed5bf18))
140
223
 
224
+ ## [0.6.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.5.4...@codecademy/tracking@0.6.0) (2021-05-03)
141
225
 
226
+ ### Features
142
227
 
143
- ## [0.3.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.2.1...@codecademy/tracking@0.3.0) (2021-01-12)
228
+ - added useTrackingIntegrations to tracking package ([2d508e2](https://github.com/Codecademy/client-modules/commit/2d508e2efbcb47968a543d7b54363707301ef351))
144
229
 
230
+ ### [0.5.4](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.5.3...@codecademy/tracking@0.5.4) (2021-05-03)
145
231
 
146
- ### Features
232
+ ### Bug Fixes
147
233
 
148
- * **tracking:** Add a fullstory boolean to TrackingOptions type ([8e58696](https://github.com/Codecademy/client-modules/commit/8e58696cda506c8b9fed5a6b58eadcf0d9ebcfab))
234
+ - bump tracking package babel-preset-codecademy to latest ([e809566](https://github.com/Codecademy/client-modules/commit/e80956648e76c3e0b439d4d3a63b3baafd818064))
149
235
 
236
+ ### [0.5.3](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.5.2...@codecademy/tracking@0.5.3) (2021-04-21)
150
237
 
238
+ **Note:** Version bump only for package @codecademy/tracking
151
239
 
152
- ### [0.2.1](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.2.0...@codecademy/tracking@0.2.1) (2020-12-14)
240
+ ### [0.5.2](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.5.1...@codecademy/tracking@0.5.2) (2021-03-19)
153
241
 
154
242
  **Note:** Version bump only for package @codecademy/tracking
155
243
 
244
+ ### [0.5.1](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.5.0...@codecademy/tracking@0.5.1) (2021-03-04)
245
+
246
+ **Note:** Version bump only for package @codecademy/tracking
156
247
 
248
+ ## [0.5.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.4.3...@codecademy/tracking@0.5.0) (2021-02-18)
157
249
 
250
+ ### Features
158
251
 
252
+ - add container_slugs to UserClickData tracking type ([ebb2d18](https://github.com/Codecademy/client-modules/commit/ebb2d1873505d7c09e14a0f714e5661914e8dd4a))
159
253
 
160
- ## [0.2.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.1.3...@codecademy/tracking@0.2.0) (2020-12-11)
254
+ ### [0.4.3](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.4.2...@codecademy/tracking@0.4.3) (2021-02-10)
161
255
 
256
+ ### Reverts
257
+
258
+ - Revert "feat(tracking): Add a fullstory boolean to TrackingOptions type" (#1381) ([f04d8b5](https://github.com/Codecademy/client-modules/commit/f04d8b57cac13dfffc8951641e52c2593827aba9)), closes [#1381](https://github.com/Codecademy/client-modules/issues/1381)
259
+
260
+ ### [0.4.2](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.4.1...@codecademy/tracking@0.4.2) (2021-02-04)
261
+
262
+ **Note:** Version bump only for package @codecademy/tracking
263
+
264
+ ### [0.4.1](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.4.0...@codecademy/tracking@0.4.1) (2021-02-02)
265
+
266
+ **Note:** Version bump only for package @codecademy/tracking
267
+
268
+ ## [0.4.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.3.0...@codecademy/tracking@0.4.0) (2021-01-14)
162
269
 
163
270
  ### Features
164
271
 
165
- * onboarded eslint-plugin-simple-import-sort into ESLint plugin ([59d6fe5](https://github.com/Codecademy/client-modules/commit/59d6fe54d9af4b3ba2a88f7c234f65fc63506c0c))
272
+ - **tracking:** Add a new page_career_path_visited event ([#1283](https://github.com/Codecademy/client-modules/issues/1283)) ([398e863](https://github.com/Codecademy/client-modules/commit/398e8636ed1ae5dc602f8ed103583b73aa0d6abc))
166
273
 
274
+ ## [0.3.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.2.1...@codecademy/tracking@0.3.0) (2021-01-12)
167
275
 
276
+ ### Features
168
277
 
169
- ### [0.1.3](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.1.2...@codecademy/tracking@0.1.3) (2020-12-07)
278
+ - **tracking:** Add a fullstory boolean to TrackingOptions type ([8e58696](https://github.com/Codecademy/client-modules/commit/8e58696cda506c8b9fed5a6b58eadcf0d9ebcfab))
279
+
280
+ ### [0.2.1](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.2.0...@codecademy/tracking@0.2.1) (2020-12-14)
170
281
 
171
282
  **Note:** Version bump only for package @codecademy/tracking
172
283
 
284
+ ## [0.2.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.1.3...@codecademy/tracking@0.2.0) (2020-12-11)
285
+
286
+ ### Features
173
287
 
288
+ - onboarded eslint-plugin-simple-import-sort into ESLint plugin ([59d6fe5](https://github.com/Codecademy/client-modules/commit/59d6fe54d9af4b3ba2a88f7c234f65fc63506c0c))
174
289
 
290
+ ### [0.1.3](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.1.2...@codecademy/tracking@0.1.3) (2020-12-07)
175
291
 
292
+ **Note:** Version bump only for package @codecademy/tracking
176
293
 
177
294
  ### [0.1.2](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.1.1...@codecademy/tracking@0.1.2) (2020-11-25)
178
295
 
179
-
180
296
  ### 🐛 Bug Fixes
181
297
 
182
- * Add query params to tracking calls ([#1189](https://github.com/Codecademy/client-modules/issues/1189)) ([02438ae](https://github.com/Codecademy/client-modules/commit/02438ae4fbad0130b8ef3e8de3a22f07922c9eed))
298
+ - Add query params to tracking calls ([#1189](https://github.com/Codecademy/client-modules/issues/1189)) ([02438ae](https://github.com/Codecademy/client-modules/commit/02438ae4fbad0130b8ef3e8de3a22f07922c9eed))
183
299
 
184
300
  ### [0.1.1](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.1.0...@codecademy/tracking@0.1.1) (2020-10-23)
185
301
 
186
-
187
302
  ### 🐛 Bug Fixes
188
303
 
189
- * Add a runtime dependency ([524d37b](https://github.com/Codecademy/client-modules/commit/524d37b08586903bc6a9d2b7a060752521bfc748))
304
+ - Add a runtime dependency ([524d37b](https://github.com/Codecademy/client-modules/commit/524d37b08586903bc6a9d2b7a060752521bfc748))
190
305
 
191
306
  ## [0.1.0](https://github.com/Codecademy/client-modules/compare/1a91e7e41e9a30e3cabb3b736c1b686c43e9570e...@codecademy/tracking@0.1.0) (2020-10-23)
192
307
 
193
-
194
308
  ### ✨ Features
195
309
 
196
- * Creating the @codecademy/tracking pachage. ([1a91e7e](https://github.com/Codecademy/client-modules/commit/1a91e7e41e9a30e3cabb3b736c1b686c43e9570e))
310
+ - Creating the @codecademy/tracking pachage. ([1a91e7e](https://github.com/Codecademy/client-modules/commit/1a91e7e41e9a30e3cabb3b736c1b686c43e9570e))
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2016 Ryzac, Inc.
3
+ Copyright (c) 2022 Codecademy LLC
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/babel.config.js CHANGED
@@ -1,5 +1,14 @@
1
1
  module.exports = {
2
+ extends: '../../babel.defaults.js',
2
3
  presets: ['codecademy', '@babel/preset-typescript'],
3
- include: ['./src/**/*'],
4
- ignore: ['__tests__', './**/*(.spec|-test).(ts|tsx|js)', './**/*.d.ts'],
4
+ plugins: [
5
+ [
6
+ '@emotion/babel-plugin',
7
+ {
8
+ sourceMap: true,
9
+ autoLabel: 'always',
10
+ labelFormat: '[local]',
11
+ },
12
+ ],
13
+ ],
5
14
  };
package/package.json CHANGED
@@ -1,40 +1,17 @@
1
1
  {
2
2
  "name": "@codecademy/tracking",
3
- "description": "Tracking library for Codecademy apps.",
4
- "version": "1.0.0-alpha.f35aad.0",
3
+ "description": "Tracking library for Codecademy apps",
4
+ "version": "1.0.0",
5
5
  "author": "Codecademy Engineering <dev@codecademy.com>",
6
- "module": "./dist/index.js",
7
- "main": "./dist/index.js",
8
- "repository": {
9
- "type": "git",
10
- "url": "git@github.com:Codecademy/client-modules.git"
11
- },
12
6
  "dependencies": {
13
7
  "@babel/runtime": "^7.12.1"
14
8
  },
15
- "devDependencies": {
16
- "@babel/cli": "^7.13.10",
17
- "@types/fetch-mock": "^7.3.3",
18
- "@types/jest": "^26.0.15",
19
- "babel-preset-codecademy": "^4.0.1",
20
- "fetch-mock": "^9.11.0",
21
- "jest-fetch-mock": "^3.0.3",
22
- "ts-jest": "^26.4.1",
23
- "typescript": "*"
24
- },
25
- "scripts": {
26
- "verify": "tsc --noEmit",
27
- "test": "jest",
28
- "test-watch": "jest --watch",
29
- "build:compile": "babel ./src --out-dir ./dist --copy-files --extensions \".ts,.tsx\"",
30
- "build:clean": "rm -rf dist",
31
- "build:types": "tsc --emitDeclarationOnly",
32
- "build": "yarn build:clean && yarn build:compile && yarn build:types",
33
- "lernaBuildTask": "yarn build"
34
- },
35
9
  "license": "MIT",
10
+ "main": "./dist/index.js",
11
+ "module": "./dist/index.js",
36
12
  "publishConfig": {
37
13
  "access": "public"
38
14
  },
39
- "gitHead": "3ed9c56f57ca6f5268d3aa85f4e32bb3f6cc8567"
15
+ "repository": "git@github.com:Codecademy/client-modules.git",
16
+ "gitHead": "61d8182e76ee94f172fa5b2a00b90edb91a142a0"
40
17
  }
package/project.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "../../node_modules/nx/schemas/project-schema.json",
3
+ "sourceRoot": "libs/tracking/src",
4
+ "projectType": "library",
5
+ "targets": {
6
+ "build": {
7
+ "outputs": ["{options.outputPath}"],
8
+ "executor": "nx:run-commands",
9
+ "options": {
10
+ "cwd": "libs/tracking",
11
+ "outputPath": "./dist",
12
+ "commands": [
13
+ "rm -rf ./dist",
14
+ "babel ./src --out-dir ./dist --extensions \".ts,.tsx\"",
15
+ "tsc --emitDeclarationOnly --project tsconfig.json",
16
+ "cpy './src/**/*.{d.ts,scss,svg,png}' ./dist"
17
+ ],
18
+ "parallel": false
19
+ }
20
+ },
21
+ "publish-build": {
22
+ "executor": "nx:run-commands",
23
+ "dependsOn": ["build"],
24
+ "options": {
25
+ "commands": [],
26
+ "parallel": false
27
+ }
28
+ },
29
+ "lint": {
30
+ "executor": "@nrwl/linter:eslint",
31
+ "outputs": ["{options.outputFile}"],
32
+ "options": {
33
+ "lintFilePatterns": ["libs/tracking/**/*.{ts,tsx,js,jsx}"]
34
+ }
35
+ },
36
+ "test": {
37
+ "executor": "@nrwl/jest:jest",
38
+ "outputs": ["coverage/libs/tracking"],
39
+ "options": {
40
+ "jestConfig": "libs/tracking/jest.config.ts",
41
+ "passWithNoTests": true
42
+ }
43
+ }
44
+ },
45
+ "tags": []
46
+ }
package/tsconfig.json CHANGED
@@ -1,8 +1,20 @@
1
1
  {
2
- "extends": "../../tsconfig.json",
3
- "include": ["../../typings/*.d.ts", "./src/**/*.ts", "./src/**/*.tsx"],
2
+ "extends": "../../tsconfig.base.json",
4
3
  "compilerOptions": {
4
+ "outDir": "./dist",
5
+ "rootDir": "./src",
6
+ "esModuleInterop": true,
5
7
  "allowJs": true,
6
- "outDir": "./dist"
7
- }
8
+ "declaration": true,
9
+ "strict": true,
10
+ "noUnusedParameters": false,
11
+ "sourceMap": true,
12
+ "strictFunctionTypes": false,
13
+ "strictPropertyInitialization": false,
14
+ "moduleResolution": "node",
15
+ "forceConsistentCasingInFileNames": true,
16
+ "target": "es5"
17
+ },
18
+ "include": ["src/**/*"],
19
+ "exclude": ["**/*.test.ts", "./dist"]
8
20
  }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "../../dist/out-tsc",
5
+ "module": "commonjs",
6
+ "types": ["jest", "node"]
7
+ },
8
+ "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"]
9
+ }
@@ -1 +0,0 @@
1
- export {};