Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: snowplow/snowplow-javascript-tracker
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.1.0
Choose a base ref
...
head repository: snowplow/snowplow-javascript-tracker
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing 1,392 changed files with 128,464 additions and 7,284 deletions.
5 changes: 5 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
chrome >= 72,
ie >= 11,
edge >= 79,
firefox >= 78,
safari >= 9.1,
35 changes: 35 additions & 0 deletions .bundlemonrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"files": [
{
"path": "./trackers/browser-tracker/dist/index.module.js",
"maxSize": "5kb",
"maxPercentIncrease": 10
},
{
"path": "./trackers/browser-tracker/dist/index.umd.min.js",
"maxSize": "20kb",
"maxPercentIncrease": 10
},
{
"path": "./trackers/javascript-tracker/dist/sp.js",
"maxSize": "30kb",
"maxPercentIncrease": 10
},
{
"path": "./trackers/javascript-tracker/dist/sp.lite.js",
"maxSize": "20kb",
"maxPercentIncrease": 10
},
{
"path": "./libraries/browser-tracker-core/dist/index.module.js",
"maxSize": "25kb",
"maxPercentIncrease": 10
},
{
"path": "./libraries/tracker-core/dist/index.module.js",
"maxSize": "20kb",
"maxPercentIncrease": 10
}
],
"reportOutput": ["github"]
}
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# don't ever lint node_modules
node_modules
# don't lint build output (make sure it's set to your correct build folder name)
dist
# don't lint nyc coverage output
coverage
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* eslint-disable no-undef */
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
};
14 changes: 14 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Don't allow people to merge changes to these generated files, because the result
# may be invalid. You need to run "rush update" again.
pnpm-lock.yaml merge=binary
shrinkwrap.yaml merge=binary
npm-shrinkwrap.json merge=binary
yarn.lock merge=binary

# Rush's JSON config files use JavaScript-style code comments. The rule below prevents pedantic
# syntax highlighters such as GitHub's from highlighting these comments as errors. Your text editor
# may also require a special configuration to allow comments in JSON.
#
# For more information, see this issue: https://github.com/microsoft/rushstack/issues/1088
#
*.json linguist-language=JSON-with-Comments
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: type:defect
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior or code snippets that produce the issue.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: type:enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
90 changes: 90 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Build

on:
push:
branches:
- '**' # Prevents builds on tag

jobs:
build:
runs-on: ubuntu-latest

env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
BROWSERSLIST_IGNORE_OLD_DATA: true

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: pnpm cache
uses: actions/cache@v3
with:
path: ./common/temp/pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('common/config/rush/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-

- name: Install
run: node common/scripts/install-run-rush.js install

- name: Build
run: node common/scripts/install-run-rush.js rebuild --verbose

- name: Test
run: node common/scripts/install-run-rush.js test --verbose

- name: Block Concurrent Executions of E2E Tests
if: ${{ env.SAUCE_ACCESS_KEY != '' }}
uses: softprops/turnstyle@v1
with:
poll-interval-seconds: 20
same-branch-only: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Add Host for Saucelabs Tunnel
if: ${{ env.SAUCE_ACCESS_KEY != '' }}
run: echo "127.0.0.1 snowplow-js-tracker.local" | sudo tee -a /etc/hosts

- name: Run End to End Tests
if: ${{ env.SAUCE_ACCESS_KEY != '' }}
working-directory: ./trackers/javascript-tracker
run: node ../../common/scripts/install-run-rushx.js test:e2e:sauce

- name: Pack
run: node common/scripts/install-run-rush.js publish -p --pack --include-all

- name: Upload packages
uses: actions/upload-artifact@v4
with:
name: packages
path: |
./common/temp/artifacts/packages/*
- name: Upload sp.js artifact
uses: actions/upload-artifact@v4
with:
name: sp.js
path: trackers/javascript-tracker/dist/sp.js

- name: Upload sp.lite.js artifact
uses: actions/upload-artifact@v4
with:
name: sp.lite.js
path: trackers/javascript-tracker/dist/sp.lite.js

- name: Upload plugins
uses: actions/upload-artifact@v4
with:
name: plugins.umd
path: |
./plugins/*/dist/*.umd.js
./plugins/*/dist/*.umd.js.map
./plugins/*/dist/*.umd.min.js
./plugins/*/dist/*.umd.min.js.map
61 changes: 61 additions & 0 deletions .github/workflows/change_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Pull Request Check

on: pull_request

jobs:
check:
runs-on: ubuntu-latest

env:
BROWSERSLIST_IGNORE_OLD_DATA: true

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: pnpm cache
uses: actions/cache@v3
with:
path: ./common/temp/pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('common/config/rush/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-

- name: Install
run: node common/scripts/install-run-rush.js install

- name: Check dependencies
run: node common/scripts/install-run-rush.js check

- name: Verify change files
run: node common/scripts/install-run-rush.js change --verify

- name: Rush Build
run: node common/scripts/install-run-rush.js rebuild --verbose

- name: Install API Extractor
run: npm install -g @microsoft/api-extractor@7.18.4

- name: Check for API changes to @snowplow/browser-tracker
working-directory: ./trackers/browser-tracker
run: api-extractor run

- name: Check for API changes to @snowplow/node-tracker
working-directory: ./trackers/node-tracker
run: api-extractor run

- name: Check for API changes to @snowplow/react-native-tracker
working-directory: ./trackers/react-native-tracker
run: api-extractor run

- name: Check bundle size using bundlemon
run: npx bundlemon@1.4.0
env:
BUNDLEMON_PROJECT_ID: 630fceda4ed824a9d3733ec0
CI_COMMIT_SHA: ${{github.event.pull_request.head.sha || github.sha}}
31 changes: 31 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy to GitHub Pages

on:
workflow_run:
workflows: ['Deploy Tracker']
types:
- completed
permissions:
contents: write

jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18

- name: Install dependencies
working-directory: ./api-docs
run: npm install
- name: Build website
working-directory: ./api-docs
run: npm run build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./api-docs/build
Loading