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
24 changes: 24 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
### What does this PR do?

<!-- A brief description of the context of this pull request and its purpose. -->

Related to: #<!-- enter issue number here -->

### What are the observable changes?

<!-- This question could be adequate with multiple use cases, for example: -->

<!-- Frontend: explain the feature created / updated, give instructions telling how to see the change in staging -->
<!-- Performance: what metric should be impacted, link to the right graphana dashboard for exemple -->
<!-- Bug: a given issue trail on sentry should stop happening -->
<!-- Feature: Implements X thrift service / Z HTTP REST API added, provide instructions on how leverage your feature from staging or your workstation -->

### Good PR checklist

- [ ] Title makes sense
- [ ] Is against the correct branch
- [ ] Only addresses one issue
- [ ] Properly assigned
- [ ] Added/updated tests
- [ ] Added/updated documentation
- [ ] Properly labeled
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
tags:
- v*
pull_request:
workflow_dispatch:

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -16,6 +17,35 @@ permissions:
packages: write

jobs:
web-baseline:
name: Web Baseline Coverage
runs-on: ubuntu-24.04
timeout-minutes: 10
env:
GA_PROPERTY_ID: ${{ secrets.GA_PROPERTY_ID }}
GOOGLE_APPLICATION_CREDENTIALS_JSON_BASE64: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_JSON_BASE64 }}
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v3
with:
node-version: '${{ env.NODE_VERSION }}'
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install
- name: Validate Web Baseline Target
run: pnpm web-baseline:check:target
- name: Test Web Baseline Checker
run: pnpm web-baseline:test
- name: Check Web Baseline Traffic Coverage
if: env.GA_PROPERTY_ID != '' && env.GOOGLE_APPLICATION_CREDENTIALS_JSON_BASE64 != ''
run: pnpm web-baseline:check
- name: Skip Web Baseline Traffic Coverage
if: env.GA_PROPERTY_ID == '' || env.GOOGLE_APPLICATION_CREDENTIALS_JSON_BASE64 == ''
run: echo "Skipping GA4 traffic coverage check because GA secrets are not configured."

release:
name: Release Package
runs-on: ubuntu-24.04
Expand Down
70 changes: 70 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,76 @@ pnpm add -D @upfluence/w-conf

You can extend your project's configuration files with the shared configurations provided by `@upfluence/w-conf`.

### Browsers
Comment thread
edouardmisset marked this conversation as resolved.

Comment thread
edouardmisset marked this conversation as resolved.
The shared browser target is exported as JSON. It is intended for use with Ember `config/targets.js` files:

```js
// config/targets.js
'use strict';

const browsers = require('@upfluence/w-conf/browsers/web-baseline.json');

module.exports = { browsers };

The current baseline uses Web Platform Baseline Widely Available, including
compatible downstream browsers, with an explicit iOS Safari safety floor:

```json
["baseline widely available with downstream", "ios_saf >= 15.6"]
```

`baseline widely available with downstream` tracks features that are broadly
available across the Baseline core browser set and includes compatible
downstream browsers, such as browsers derived from Chromium or Gecko.

`ios_saf >= 15.6` is intentionally added as a mobile safety rail. Based on our
traffic analysis, older iOS/Safari versions are the main unsupported pocket, and
mobile Safari traffic is important enough for us to keep this explicit floor.

This removes legacy targets such as IE 11 while keeping a stable, shared target
set across Ember apps, addons, engines, and host apps.

Consumer projects need a Browserslist toolchain that supports Baseline queries.
If a build fails with `Unknown browser query`, update the consumer's
Browserslist-related dependencies before using this shared target.
Comment thread
phndiaye marked this conversation as resolved.

`pnpm dlx update-browserslist-db latest`


#### Web Baseline Coverage Check

`w-conf` also ships a repository-level check that compares the shared browser
target against real Google Analytics traffic:

```bash
pnpm web-baseline:check
```

The GA-backed check uses a 180-day window, `Sessions` as the primary metric, and
fails when known-session coverage drops below 95% or unknown traffic rises above
1%.

For local CSV exports matching the GA browser export shape:

```bash
pnpm web-baseline:check:csv /path/to/analytics-export.csv
```

To validate that the configured target can be parsed by the bundled Browserslist
version:

```bash
pnpm web-baseline:check:target
```

GA4 mode requires a property ID and a base64-encoded service-account JSON value:

```bash
export GA_PROPERTY_ID=123456789
export GOOGLE_APPLICATION_CREDENTIALS_JSON_BASE64="$(base64 -i service-account.json)"
```

### Prettier

The base Prettier configuration includes sensible defaults for code formatting that align with Upfluence's coding standards, including settings for Handlebars files and import sorting.
Expand Down
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,17 @@
"engines": {
"node": ">=20.0.0"
},
"scripts": {
"web-baseline:check": "node scripts/check-web-baseline-coverage.mjs",
"web-baseline:check:csv": "node scripts/check-web-baseline-coverage.mjs --csv",
"web-baseline:check:target": "node scripts/check-web-baseline-coverage.mjs --check-target-only",
"web-baseline:test": "node tests/web-baseline/coverage-test.mjs"
},
"devDependencies": {
"@google-analytics/data": "^7.0.0",
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
"baseline-browser-mapping": "^2.11.13",
"browserslist": "^4.28.8",
"eslint": "^10.5.0",
"prettier": "^3.6.2",
"typescript": "^6.0.3"
Expand All @@ -48,6 +57,7 @@
],
"exports": {
"./prettier": "./src/prettier/index.mjs",
"./eslint": "./src/eslint/index.mjs"
"./eslint": "./src/eslint/index.mjs",
"./browsers/web-baseline.json": "./src/browsers/web-baseline.json"
}
}
Loading
Loading