Skip to content

Commit

Permalink
feat: theme editor (#1)
Browse files Browse the repository at this point in the history
Introduces a theme editor for pillarbox-web.

Users can design and generate themes to align with brand identity. The application is written in
JavaScript, Lit for component creation, and the Monaco Editor for CSS editing. Hosted on GitHub
Pages, it is bundled with Vite for compatibility and performance.
  • Loading branch information
jboix authored Mar 28, 2024
1 parent 5bc0d82 commit c1a338a
Show file tree
Hide file tree
Showing 30 changed files with 11,233 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .commitlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"@commitlint/config-conventional"
]
}
13 changes: 13 additions & 0 deletions .editorconfig
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,*.jsx,*.tsx}]
quote_type=single

[*.md]
max_line_length=100

105 changes: 105 additions & 0 deletions .eslintrc.json
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"
]
}
}
16 changes: 16 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Description

> Please provide a brief summary of the changes made. Please explain why
> this change was necessary. Was there a problem or an issue this change
> will address? What will be improved with this change?
## Changes Made

> Please detail the modifications made. This could include areas such as
> code, documentation, structure, or formatting.
## Checklist

- [ ] I have followed the project's style and contribution guidelines.
- [ ] I have performed a self-review of my own changes.
- [ ] I have made corresponding changes to the documentation.
44 changes: 44 additions & 0 deletions .github/workflows/github-page.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Github Page

on:
push:
branches:
- main

jobs:
github-page:
runs-on: ubuntu-latest

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

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 20
always-auth: true
registry-url: https://npm.pkg.github.com/
scope: '@srgssr'
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- 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/v4
with:
branch: gh-pages
folder: dist
force: false
clean-exclude: pr-preview/
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48 changes: 48 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploy PR previews

on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed

concurrency: preview-${{ github.ref }}

jobs:
deploy-preview:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 20
always-auth: true
registry-url: https://npm.pkg.github.com/
scope: '@srgssr'
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
if: github.event.action != 'closed'
env:
CI: true
run: |
npm pkg delete scripts.prepare
npm ci
- name: Run build
if: github.event.action != 'closed'
run: |
npm run build
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: dist
preview-branch: gh-pages
umbrella-dir: pr-preview
36 changes: 36 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Quality

on:
merge_group:
pull_request:
branches:
- main

jobs:
quality:
runs-on: ubuntu-latest

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

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 20
always-auth: true
registry-url: https://npm.pkg.github.com/
scope: '@srgssr'
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- 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
4 changes: 4 additions & 0 deletions .husky/commit-msg
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}
4 changes: 4 additions & 0 deletions .husky/pre-commit
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
2 changes: 2 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
11 changes: 11 additions & 0 deletions .stylelintrc.json
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"
}
]
}
66 changes: 66 additions & 0 deletions docs/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers
pledge to making participation in our project and our community a harassment-free experience for
everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level
of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit
permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are
expected to take appropriate and fair corrective action in response to any instances of unacceptable
behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits,
code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or
to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is
representing the project or its community. Examples of representing a project or community include
using an official project e-mail address, posting via an official social media account, or acting as
an appointed representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting
the project team. The project team will review and investigate all complaints, and will respond in a
way that it deems appropriate to the circumstances. The project team is obligated to maintain
confidentiality with regard to the reporter of an incident. Further details of specific enforcement
policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face
temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available
at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org

[version]: http://contributor-covenant.org/version/1/4/
Loading

0 comments on commit c1a338a

Please sign in to comment.