-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: split demo from main sdk repository
Addresses SRGSSR/pillarbox-web#179 by migrating the demo to a standalone repository to leverage a different build framework, specifically Vite. 1. Importing assets: Previously, asset imports utilised the prefix `bundle-text:` as per parcel convention. With the migration to Vite, this approach has been replaced, and now text imports should use the suffix `?inline` or `?raw` in the import statement depending on the intention ( see [Static Asset Handling](https://vitejs.dev/guide/assets)). Before: ```javascript import textContent from 'bundle-text:path/to/file.txt'; ``` Now: ```javascript import textContent from 'path/to/file.txt?inline'; ``` 2. Stylelint changes: - A PostCSS plugin for Stylelint has been introduced to enable linting of CSS declarations inside Lit elements that use the `css` template. - The `stylelint-config-standard-scss` has been incorporated to enforce a more robust set of styles. 3. Eslint changes: Eslint rules have been expanded by extending both `eslint:recommended` and the standard ruleset. All previously established rules remain in place. 4. Removal of the Pre-push hook: The pre-push hook responsible for triggering tests in the demo app has been removed due to the absence of tests for the demo app.
- Loading branch information
Showing
67 changed files
with
15,436 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"extends": [ | ||
"@commitlint/config-conventional" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[*] | ||
charset=utf-8 | ||
end_of_line=lf | ||
insert_final_newline=true | ||
indent_style=space | ||
indent_size=2 | ||
|
||
[{*.ts,*.js}] | ||
quote_type=single | ||
|
||
[*.md] | ||
max_line_length=100 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es2021": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"standard" | ||
], | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"complexity": [ | ||
"error", | ||
{ | ||
"max": 5 | ||
} | ||
], | ||
"function-paren-newline": [ | ||
"error", | ||
"multiline-arguments" | ||
], | ||
"linebreak-style": [ | ||
"error", | ||
"unix" | ||
], | ||
"max-depth": [ | ||
"error", | ||
2 | ||
], | ||
"max-len": [ | ||
"error", | ||
{ | ||
"code": 80, | ||
"ignoreComments": true, | ||
"ignoreStrings": true, | ||
"ignoreTemplateLiterals": true, | ||
"ignoreTrailingComments": true, | ||
"ignoreUrls": true | ||
} | ||
], | ||
"max-lines-per-function": [ | ||
"error", | ||
{ | ||
"max": 35, | ||
"skipComments": true | ||
} | ||
], | ||
"max-nested-callbacks": [ | ||
"error", | ||
3 | ||
], | ||
"max-statements": [ | ||
"error", | ||
10 | ||
], | ||
"newline-after-var": [ | ||
"error", | ||
"always" | ||
], | ||
"no-bitwise": [ | ||
"error", | ||
{ | ||
"int32Hint": true | ||
} | ||
], | ||
"no-cond-assign": [ | ||
"error", | ||
"always" | ||
], | ||
"no-console": [ | ||
"error", | ||
{ | ||
"allow": [ | ||
"warn", | ||
"error" | ||
] | ||
} | ||
], | ||
"no-plusplus": [ | ||
"error", | ||
{ | ||
"allowForLoopAfterthoughts": true | ||
} | ||
], | ||
"padding-line-between-statements": [ | ||
"error", | ||
{ | ||
"blankLine": "always", | ||
"prev": "*", | ||
"next": "return" | ||
} | ||
], | ||
"semi": [ | ||
"error", | ||
"always" | ||
], | ||
"space-before-function-paren": [ | ||
"error", | ||
"never" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## Description | ||
|
||
## Changes made | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Github Page | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
github-page: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install dependencies | ||
env : | ||
CI: true | ||
run: | | ||
npm pkg delete scripts.prepare | ||
npm ci | ||
- name: Run build | ||
run: | | ||
npm run build | ||
- name: Deploy GitHub Page 🚀 | ||
uses: JamesIves/github-pages-deploy-action@releases/v3 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH: gh-pages | ||
FOLDER: dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Quality | ||
|
||
on: | ||
merge_group: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
quality: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install dependencies | ||
env : | ||
CI: true | ||
run: | | ||
npm pkg delete scripts.prepare | ||
npm ci | ||
- name: Run JS and CSS linters | ||
run: | | ||
npm run eslint && npm run stylelint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx --no -- commitlint --edit ${1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm run eslint && npm run stylelint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": ["stylelint-config-standard-scss", "stylelint-config-rational-order"], | ||
"overrides": [ | ||
{ | ||
"files": [ | ||
"*.js" | ||
], | ||
"customSyntax": "postcss-lit" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Single Page Apps for GitHub Pages</title> | ||
<script type="text/javascript"> | ||
// Single Page Apps for GitHub Pages | ||
// MIT License | ||
// https://github.com/rafgraph/spa-github-pages | ||
// This script takes the current url and converts the path and query | ||
// string into just a query string, and then redirects the browser | ||
// to the new url with only a query string and hash fragment, | ||
// e.g. https://www.foo.tld/one/two?a=b&c=d#qwe, becomes | ||
// https://www.foo.tld/?/one/two&a=b~and~c=d#qwe | ||
// Note: this 404.html file must be at least 512 bytes for it to work | ||
// with Internet Explorer (it is currently > 512 bytes) | ||
|
||
// If you're creating a Project Pages site and NOT using a custom domain, | ||
// then set pathSegmentsToKeep to 1 (enterprise users may need to set it to > 1). | ||
// This way the code will only replace the route part of the path, and not | ||
// the real directory in which the app resides, for example: | ||
// https://username.github.io/repo-name/one/two?a=b&c=d#qwe becomes | ||
// https://username.github.io/repo-name/?/one/two&a=b~and~c=d#qwe | ||
// Otherwise, leave pathSegmentsToKeep as 0. | ||
var pathSegmentsToKeep = 1; | ||
|
||
var l = window.location; | ||
l.replace( | ||
l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') + | ||
l.pathname.split('/').slice(0, 1 + pathSegmentsToKeep).join('/') + '/?/' + | ||
l.pathname.slice(1).split('/').slice(pathSegmentsToKeep).join('/').replace(/&/g, '~and~') + | ||
(l.search ? '&' + l.search.slice(1).replace(/&/g, '~and~') : '') + | ||
l.hash | ||
); | ||
|
||
</script> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |
Oops, something went wrong.