Skip to content
Draft
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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
11 changes: 11 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"root": true,
"env": {
"browser": true,
"es6": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"]
}
45 changes: 45 additions & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build & Test

on:
push:
branches: [main]
pull_request:
types: [opened, synchronize]

jobs:
build:
runs-on: ubuntu-latest
env:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
WPT_MANIFEST: ${{ github.workspace }}/wpt/MANIFEST.json
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
- uses: actions/setup-python@v3
with:
python-version: '3.x'
- uses: actions/checkout@v3
with:
repository: devknoll/wpt
path: wpt
ref: x-polyfill-all-tests

- name: Build
run: |
npm install
npm run build

- name: Setup WPT
run: |
cd wpt
pip install virtualenv
./wpt make-hosts-file | sudo tee -a /etc/hosts
- name: Run Tests
run: |
npm run serve &
./wpt/wpt manifest
./wpt/wpt serve --inject-script=${{ github.workspace }}/dist/src/cqfill.iife.min.js &
npm test
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
cqfill.js
cqfill.min.js
cqfill.iife.min.js
dist
node_modules
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"bracketSpacing": false,
"singleQuote": true,
"trailingComma": "es5",
"arrowParens": "avoid"
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ A tiny polyfill for [CSS Container Queries][mdn], weighing about 1.6kB brotli’
Ideally, the polyfill is only loaded if the browser doesn’t support Container Queries natively. In a modern setup with a bundler that uses ES modules, the following snippet should work:

```js
const supportsContainerQueries = "container" in document.documentElement.style;
const supportsContainerQueries = 'container' in document.documentElement.style;
if (!supportsContainerQueries) {
import("container-query-polyfill");
import('container-query-polyfill');
}
```

Expand Down
Loading