Skip to content

Commit

Permalink
chore: improve base repository (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
clement-berard authored Oct 29, 2024
1 parent fabfb41 commit 90f52f9
Show file tree
Hide file tree
Showing 16 changed files with 1,813 additions and 38 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/deploy-doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Sample workflow for building and deploying a VitePress site to GitHub Pages
#
name: Deploy VitePress site to Pages

on:
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
# using the `master` branch as the default branch.
push:
branches: [main]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled
# - uses: pnpm/action-setup@v3 # Uncomment this block if you're using pnpm
# with:
# version: 9 # Not needed if you've set "packageManager" in package.json
# - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: pnpm install
- name: Build with VitePress
run: pnpm docs:generate
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ pnpm-debug.log*
*.sln
*.sw?
dist
docs/.vitepress/cache
docs/.vitepress/dist
docs/lib
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

This library leverages the lightweight [ky](https://github.com/sindresorhus/ky) HTTP client, which is built on top of Fetch API, for making secure and intuitive HTTP requests.

**Works only in secure environments (HTTPS) and with versions 6 of the JointSpace protocol.**

## Table of Contents

Expand Down
15 changes: 15 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { defineConfig } from 'vitepress';
import SideBarMenuAutoGen from '../lib/typedoc-sidebar.json';

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: 'philtv-js',
description: 'A simple library to pair and interact with Philips TV',
base: process.env.CI ? '/philtv-js/' : '/',
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [{ text: 'Home', link: '../lib/index.md' }],
sidebar: [{ text: 'Get Started', link: '/lib/index.md' }, ...SideBarMenuAutoGen],
socialLinks: [{ icon: 'github', link: 'https://github.com/clement-berard/philtv-js' }],
},
});
28 changes: 28 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
# https://vitepress.dev/reference/default-theme-home-page
layout: home

hero:
name: "philtv-js"
text: "Typescript first-class Jointspace API lib"
tagline: Works with version 6 of the Jointspace API and https
actions:
- theme: brand
text: Get Started
link: /lib/index.md

features:
- title: Modern stack
details: Fully written in Typescript, using the latest features of Node.js
icon:
src: https://upload.wikimedia.org/wikipedia/commons/4/4c/Typescript_logo_2020.svg
- title: Modern HTTP Clients
details: Using ky and Digest Auth for secure communication with the TV
icon:
src: https://github.com/sindresorhus/ky/raw/main/media/logo.svg
- title: Almost full coverage of endpoints
details: Working hard to cover all endpoints of the API
icon:
src: https://www.svgrepo.com/show/361211/json.svg
---

28 changes: 20 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
{
"name": "philtv-js",
"version": "1.0.0",
"description": "A simple library to pair with Philips TV",
"description": "A simple library to pair and interact with Philips TV",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs"
},
".": "./dist/index.js",
"./package.json": "./package.json"
},
"scripts": {
"lint": "pnpm biome lint",
"format": "pnpm biome format",
"lint:check": "pnpm biome check",
"build": "pnpm tsup"
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:generate": "pnpm typedoc:generate && pnpm docs:build",
"docs:preview": "vitepress preview docs",
"typedoc:generate": "typedoc",
"build": "pnpm tsup --dts --clean --minify --format esm src/index.ts"
},
"dependencies": {
"digest-fetch": "3.1.1",
Expand All @@ -30,9 +32,19 @@
"@types/node": "22.7.8",
"tsup": "8.3.5",
"tsx": "4.19.1",
"typescript": "5.6.3"
"typedoc": "^0.26.10",
"typedoc-plugin-markdown": "^4.2.9",
"typedoc-vitepress-theme": "1.0.2",
"typescript": "5.6.3",
"vitepress": "1.4.1"
},
"keywords": ["philtv", "android-tv", "jointspace", "philips", "ambilight"],
"keywords": [
"philtv",
"android-tv",
"jointspace",
"philips",
"ambilight"
],
"author": "Clément BERARD",
"license": "ISC"
}
Loading

0 comments on commit 90f52f9

Please sign in to comment.