Skip to content

Commit

Permalink
feat: first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
orefalo committed Jun 16, 2024
0 parents commit 38430dc
Show file tree
Hide file tree
Showing 79 changed files with 9,105 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .commitlintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'header-max-length': [0, 'always', 100],
'scope-case': [0, 'always', 'pascal-case']
}
};
47 changes: 47 additions & 0 deletions .cz-config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
module.exports = {
types: [
{ value: 'feat', name: '✨ feat:\tAdding a new feature' },
{ value: 'fix', name: '🐛 fix:\tFixing a bug' },
{ value: 'docs', name: '📝 docs:\tAdd or update documentation' },
{
value: 'style',
name: '💄 style:\tAdd or update styles, ui or ux'
},
{
value: 'refactor',
name: '♻️ refactor:\tCode change that neither fixes a bug nor adds a feature'
},
{
value: 'perf',
name: '⚡️ perf:\tCode change that improves performance'
},
{
value: 'test',
name: '✅ test:\tAdding tests cases'
},
{
value: 'chore',
name: '🚚 chore:\tChanges to the build process or auxiliary tools\n\t\tand libraries such as documentation generation'
},
{ value: 'revert', name: '⏪️ revert:\tRevert to a commit' },
{
value: 'build',
name: '👷 build:\tAdd or update regards to build process'
},
{
value: 'ci',
name: '💚 ci:\tAdd or update regards to build process'
}
],
scopes: [],

scopeOverrides: {
fix: [{ name: 'merge' }, { name: 'style' }, { name: 'test' }, { name: 'hotfix' }]
},

allowCustomScopes: true,
allowBreakingChanges: ['feat', 'fix'],
// skip any questions you want
skipQuestions: ['scope', 'footer', 'breaking'],
subjectLimit: 100
};
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Make sure the line ending is in LF format (/n), for linting consistency
* text eol=lf
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ko_fi: orefalo
17 changes: 17 additions & 0 deletions .github/workflows/conventional-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Check PR title
run-name: Check PR title
on:
pull_request_target:
types:
- opened
- reopened
- edited
- synchronize

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70 changes: 70 additions & 0 deletions .github/workflows/deploy-ghpages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Generating Docs
run-name: Generate Docs into gh-pages
permissions:
contents: write

on: # rebuild gh-pages when doc change on master
push:
branches:
- master
paths:
- 'src/**'
- '!src/lib/**'

jobs:
build-and-deploy:
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
runs-on: ubuntu-latest
timeout-minutes: 15

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

# The whole Node.js and pnpm installation and caching
# Based on https://github.com/pnpm/action-setup/tree/6e1964dde3397a825e79e4607ad57f3f7ca2c7cb#use-cache-to-reduce-installation-time

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
version: 9
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Svelte Sync
run: npx svelte-kit sync

# Build Frontend
- name: Build Frontend
run: pnpm run build
env:
BASE_PATH: /${{ github.event.repository.name }}

# Deploy Docs
- name: Deploy Docs 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs
target-folder: docs
96 changes: 96 additions & 0 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Lint check & Testing
run-name: Lint check & Testing
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
tests:
runs-on: ubuntu-latest
timeout-minutes: 15

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

# The whole Node.js and pnpm installation and caching
# Based on https://github.com/pnpm/action-setup/tree/6e1964dde3397a825e79e4607ad57f3f7ca2c7cb#use-cache-to-reduce-installation-time

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
version: 9
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: SvelteKit Sync
run: npx svelte-kit sync

- name: Lint
run: pnpm run lint

- name: Svelte Sync
if: success() || failure() # Run even if previous failed
run: npx svelte-kit sync

- name: Svelte Check
if: success() || failure() # Run even if previous failed
run: pnpm run check

# Build Frontend
- name: Build Frontend
if: success() || failure() # Run even if previous failed
run: pnpm run build

# Cache Playwright
- name: Cache Playwright
if: success() || failure() # Run even if previous failed
uses: actions/cache@v4
id: playwright_cache
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }} # (not a good key)

# Install Playwright
- name: Install Playwright
# if: steps.cache.outputs.cache-hit != 'true'
run: npx playwright install --with-deps

# Run Tests
- name: Test
run: pnpm run test
env:
DEBUG: pw:webserver

# Upload test results
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: test-results
path: test-results
75 changes: 75 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Release package to NPM
run-name: Release package to NPM

on:
push:
branches:
- master

jobs:
release-please:
if: github.repository == 'orefalo/${{ github.event.repository.name }}' # Prevent running on forks
runs-on: ubuntu-latest
steps:
# Checkout
- name: Checkout
uses: actions/checkout@v4

# The whole Node.js and pnpm installation and caching
# Based on https://github.com/pnpm/action-setup/tree/6e1964dde3397a825e79e4607ad57f3f7ca2c7cb#use-cache-to-reduce-installation-time

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
version: 9
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: SvelteKit Sync
run: npx svelte-kit sync

- name: Svelte Package
run: pnpm run package

- name: Release Please
uses: googleapis/release-please-action@v4
id: release
with:
release-type: node

- name: Upload the packed package
uses: actions/upload-release-asset@v1
if: ${{ steps.release.outputs.release_created }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
node-version: 20
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: package/${{ github.event.repository.name }}-${{ steps.release.outputs.version }}.tgz
asset_name: ${{ github.event.repository.name }}-${{ steps.release.outputs.version }}.tgz
asset_content_type: application/gzip

- name: Publish to NPM
uses: JS-DevTools/npm-publish@v3 # will only deploy if version has changed
with:
token: ${{ secrets.NPM_TOKEN }}
package: package/
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.DS_Store
**/node_modules/*
/build
/.svelte-kit
/package
/docs
/example-temp
/test-results
.env
.env.*
!.env.example
*.log
.eslintcache
vite.config.js.timestamp-*
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}"
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# pnpm test
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
**/.svelte-kit
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 120,
"plugins": ["prettier-plugin-svelte"]
}
19 changes: 19 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true
},
"hide-files.files": [],
"files.eol": "\n",
"editor.insertSpaces": false,
"[typescript]": {
"editor.tabSize": 4
},
"[javascript]": {
"editor.tabSize": 4
}
}
Loading

0 comments on commit 38430dc

Please sign in to comment.