Skip to content

Commit

Permalink
Merge pull request #31 from chialab/v4
Browse files Browse the repository at this point in the history
v4
  • Loading branch information
edoardocavazza authored Nov 7, 2023
2 parents 62dc8f0 + 6bae667 commit d5d5d69
Show file tree
Hide file tree
Showing 31 changed files with 1,685 additions and 2,728 deletions.
5 changes: 5 additions & 0 deletions .changeset/mean-cups-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@chialab/loock': minor
---

Add `types` entrypoint for exports map.
8 changes: 8 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"mode": "pre",
"tag": "alpha",
"initialVersions": {
"@chialab/loock": "3.3.0"
},
"changesets": []
}
5 changes: 5 additions & 0 deletions .changeset/tricky-radios-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@chialab/loock': major
---

Refactored the trap mechanism in order to handle video controls and iframe contents.
5 changes: 3 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# RNA
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
Expand Down Expand Up @@ -29,4 +28,6 @@ indent_size = 2
indent_style = tab
indent_size = 4

# RNA
# Allow trailing whitespaces in markdown for new line statements
[*.{md,markdown}]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
public
8 changes: 7 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"extends": "@chialab/eslint-config"
"extends": "@chialab/eslint-config",
"env": {
"browser": true
},
"rules": {
"mocha/no-global-tests": "off"
}
}
26 changes: 13 additions & 13 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
name: 'CodeQL'

on:
push:
branches: [ main ]
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
branches: [main]
schedule:
- cron: '37 9 * * 2'

Expand All @@ -32,17 +32,17 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
language: ['javascript']

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
86 changes: 86 additions & 0 deletions .github/workflows/lint_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Lint and Test
on:
workflow_call:

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
cache: yarn

- name: Install project dependencies
run: yarn install
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: true

- name: Run build script
run: yarn build

- name: Check package
run: yarn publint

- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: Loock
path: |
dist
types
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
cache: yarn

- name: Install project dependencies
run: yarn install
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: true

- name: Lint
run: yarn lint

test:
name: Test Browsers
runs-on: ubuntu-latest
strategy:
max-parallel: 3
matrix:
browser:
- 'chromium'
- 'firefox'
- 'webkit'
steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v4
with:
cache: yarn

- name: Install project dependencies
run: yarn install
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: true

- name: Install chromium
run: yarn playwright install --with-deps ${{ matrix.browser }}

- name: Run tests
run: yarn test --project ${{ matrix.browser }}
85 changes: 9 additions & 76 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,95 +1,26 @@
name: Main
on:
workflow_dispatch:
push:
branches:
- main
branches: [main]
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v4
with:
cache: yarn

- name: Install project dependencies
run: yarn install

- name: Lint
run: yarn lint

build:
name: Build
runs-on: ubuntu-latest
needs: lint
steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v4
with:
cache: yarn

- name: Install project dependencies
run: yarn install

- name: Run build script
run: yarn build

- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: Loock
path: dist

test-browser:
name: Test Browsers
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v4
with:
cache: yarn

- name: Install project dependencies
run: yarn install

- name: Fetch build artifacts
uses: actions/download-artifact@v3
with:
name: Loock
path: dist

- name: Run tests
run: yarn test:browser

- name: Upload coverage to codecov
uses: codecov/codecov-action@v3
with:
file: coverage/lcov.info
lint-test:
uses: ./.github/workflows/lint_test.yml
secrets: inherit

release:
name: Release
runs-on: ubuntu-latest
timeout-minutes: 10
needs:
- test-browser
- lint-test
steps:
- name: Checkout the repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
Expand All @@ -98,6 +29,8 @@ jobs:

- name: Install project dependencies
run: yarn install
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: true

- name: Create Release Pull Request or Publish to npm
id: changesets
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Pages
on:
workflow_dispatch:
push:
branches: ['main', 'v4']

jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
cache: yarn

- name: Setup Pages
id: pages
uses: actions/configure-pages@v3

- name: Install project dependencies
run: yarn install
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: true

- name: Build Documentation
run: yarn vite build --base=/loock/

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: public

deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
Loading

0 comments on commit d5d5d69

Please sign in to comment.