@guardian/ophan-tracker-js 2.1.0-next.0 → 2.1.0-next.2
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.
- package/assets/adblock-detection.js +19 -0
- package/assets/attention.js +160 -0
- package/assets/campaign.js +25 -0
- package/assets/click-path-capture.js +80 -0
- package/assets/components.js +209 -0
- package/assets/contribution.js +25 -0
- package/assets/core.js +282 -0
- package/assets/embed.js +11 -0
- package/assets/fb-instant.js +10 -0
- package/assets/heatmap.js +47 -0
- package/assets/holidays.js +11 -0
- package/assets/http-status.js +13 -0
- package/assets/iframe-tracking.js +88 -0
- package/assets/interactive.js +17 -0
- package/assets/jobs-courses.js +11 -0
- package/assets/jobs.js +11 -0
- package/assets/manage-my-account.js +38 -0
- package/assets/membership.js +25 -0
- package/assets/ng.js +41 -0
- package/assets/perf.js +40 -0
- package/assets/privatebrowsing.js +71 -0
- package/assets/r2.js +24 -0
- package/assets/smart-news.js +19 -0
- package/assets/support.js +34 -0
- package/assets/transmit.js +143 -0
- package/assets/vendor/adBlockDetectionLib.js +366 -0
- package/assets/visibility.js +23 -0
- package/assets/witness.js +11 -0
- package/package.json +4 -4
- package/readme.md +15 -15
package/readme.md
CHANGED
|
@@ -10,7 +10,7 @@ $ npm install ophan-tracker-js
|
|
|
10
10
|
|
|
11
11
|
## Contribute
|
|
12
12
|
|
|
13
|
-
#### Proxy tracker-
|
|
13
|
+
#### Proxy tracker-js:
|
|
14
14
|
|
|
15
15
|
1. Install dependencies
|
|
16
16
|
|
|
@@ -19,28 +19,22 @@ $ npm install ophan-tracker-js
|
|
|
19
19
|
.../ophan/tracker-js $ npm install
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
2. In
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
.../ophan/tracker-js $ npm run coffee-to-esm:watch
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
3. In another terminal window:
|
|
22
|
+
2. In another terminal window:
|
|
29
23
|
|
|
30
24
|
```
|
|
31
25
|
.../ophan/tracker-js $ lighttpd -f lighttpd.conf -D
|
|
32
26
|
```
|
|
33
27
|
|
|
34
|
-
|
|
28
|
+
3. Install FoxyProxy (https://getfoxyproxy.org/downloads/) in your browser and create a rule that forces j.ophan.co.uk
|
|
35
29
|
to localhost 8000. (For me FoxyProxy needed a few switches on and off before it decided to start talking to lighttpd.)
|
|
36
30
|
|
|
37
|
-
|
|
31
|
+
4. In another terminal window, start a server that is [running the Guardian frontend](https://github.com/guardian/frontend/blob/main/docs/01-start-here/01-installation-steps.md)
|
|
38
32
|
|
|
39
|
-
|
|
33
|
+
5. Navigate to where you are running the Guardian locally (e.g. https://localhost:9000/uk)
|
|
40
34
|
|
|
41
|
-
|
|
35
|
+
6. Ensure FoxyProxy is enabled
|
|
42
36
|
|
|
43
|
-
|
|
37
|
+
7. Develop with pleasure
|
|
44
38
|
|
|
45
39
|
## Publish
|
|
46
40
|
|
|
@@ -62,8 +56,14 @@ We use `changesets` for automated publishing of the NPM package:
|
|
|
62
56
|
|
|
63
57
|
3. When the PR is merged, the [`changesets` github action](https://github.com/changesets/action) will create a new PR, [example here](https://github.com/guardian/ophan/pull/5626). On merging this generated PR, the action will publish to NPM. (This checks the subdirectory correctly.)
|
|
64
58
|
|
|
65
|
-
_Note:_ This seems like an unnecessary extra step and another PR to merge. This action is useful for multi-package repos, and packages with more frequent changes where it consolidates changes from multiple PR's into a single release. This therefore does not apply to us, but we've had issues publishing straight to NPM via the initial action on merge to main.
|
|
66
|
-
|
|
67
59
|
##### S3 Bucket
|
|
68
60
|
|
|
69
61
|
* [https://j.ophan.co.uk/](https://j.ophan.co.uk/jobs.js) - CDN/S3, [deployed through RiffRaff](https://riffraff.gutools.co.uk/deployment/history?projectName=ophan%3A%3Aophan-tracker-js&page=1) and used by some Guardian sites like https://jobs.theguardian.com/. An advantage of this approach is that sites using it immediately get Tracker JS updates, without developer intervention.
|
|
62
|
+
|
|
63
|
+
##### Rollup
|
|
64
|
+
|
|
65
|
+
The generated files from Rollup are only used for publishing to the CDN to use SystemJS / AMD
|
|
66
|
+
|
|
67
|
+
##### Example Usage
|
|
68
|
+
|
|
69
|
+
You can see example usage of the library on theguardian.com [here](https://github.com/guardian/dotcom-rendering/blob/main/dotcom-rendering/src/client/ophan/ophan.ts)
|