Skip to content

Commit 2f8bd0b

Browse files
committed
chore: Clean up some docs and packages
1 parent d7a8a21 commit 2f8bd0b

File tree

8 files changed

+191
-7
lines changed

8 files changed

+191
-7
lines changed

.github/actions/setup/action.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# https://docs.github.com/en/actions/creating-actions/creating-a-composite-action
2+
3+
name: Set up environment
4+
description: Runs setup actions and installs packages
5+
6+
runs:
7+
using: 'composite'
8+
steps:
9+
- uses: pnpm/action-setup@v4
10+
11+
- uses: buildjet/setup-node@v4
12+
with:
13+
node-version: '20'
14+
cache: 'pnpm'
15+
16+
- run: pnpm install --frozen-lockfile
17+
shell: bash

.github/workflows/release.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
env:
11+
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
12+
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
13+
14+
jobs:
15+
release:
16+
name: Release
17+
runs-on: buildjet-2vcpu-ubuntu-2204
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
# Fetch all commit history for generating the changelog.
22+
fetch-depth: 0
23+
# Avoid configuring the token with the local git config in favor of
24+
# our own environment token (see below).
25+
persist-credentials: false
26+
27+
- uses: pnpm/action-setup@v4
28+
29+
- uses: buildjet/setup-node@v4
30+
with:
31+
node-version: "20"
32+
cache: "pnpm"
33+
34+
- name: Set up environment
35+
uses: ./.github/actions/setup
36+
timeout-minutes: 5
37+
38+
- name: Create release pull request or publish
39+
id: changesets
40+
uses: changesets/action@v1
41+
with:
42+
version: pnpm run ci:version
43+
commit: "chore: Update versions"
44+
title: "chore: Update versions"
45+
publish: pnpm run ci:publish
46+
env:
47+
# When you use the repository's GITHUB_TOKEN to perform tasks, events
48+
# triggered by the GITHUB_TOKEN will not create a new workflow run.
49+
# This means that checks won't run on the release PRs. We work around
50+
# this by using our own GH_TOKEN_REPO_ACCESS organization secret.
51+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_REPO_ACCESS }}

.github/workflows/snapshot.yml

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Snapshot Release
2+
3+
on:
4+
issue_comment:
5+
types:
6+
- created
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
env:
11+
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
12+
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
13+
14+
jobs:
15+
snapshot:
16+
name: Snapshot Release
17+
runs-on: buildjet-2vcpu-ubuntu-2204
18+
if: github.event.issue.pull_request && github.event.comment.body == '/snapshot'
19+
steps:
20+
- name: Add initial comment
21+
uses: peter-evans/create-or-update-comment@v3
22+
with:
23+
comment-id: ${{ github.event.comment.id }}
24+
body: |
25+
Follow snapshot progress [here](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
26+
reactions: eyes
27+
28+
- uses: actions/checkout@v4
29+
30+
# issue_comment requires us to checkout the branch
31+
# https://github.com/actions/checkout/issues/331#issuecomment-1120113003
32+
- name: Checkout pull request branch
33+
run: hub pr checkout ${{ github.event.issue.number }}
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Set up environment
38+
uses: ./.github/actions/setup
39+
timeout-minutes: 5
40+
41+
- name: Check if changeset exists
42+
run: |
43+
pnpm exec changeset status --since main
44+
45+
- name: Add final comment (failure)
46+
if: failure()
47+
uses: peter-evans/create-or-update-comment@v3
48+
with:
49+
comment-id: ${{ github.event.comment.id }}
50+
body: |
51+
:x: A changeset is required to build a snapshot.
52+
reactions: confused
53+
54+
- name: Publish snapshot release
55+
run: |
56+
pnpm exec changeset version --snapshot ${{ github.event.issue.number }} && pnpm install
57+
pnpm run ci:publish --no-git-tag --snapshot
58+
59+
- name: Retrieve snapshot version
60+
run: |
61+
echo "SNAPSHOT_VERSION=$(npm view @plex/core-logging versions --json | grep 0.0.0-${{ github.event.issue.number }} | sort -r | head -n 1 | cut -d'"' -f 2)" >> $GITHUB_OUTPUT
62+
id: snapshotVersion
63+
64+
- name: Add final comment
65+
uses: peter-evans/create-or-update-comment@v3
66+
with:
67+
comment-id: ${{ github.event.comment.id }}
68+
body: |
69+
${{steps.snapshotVersion.outputs.SNAPSHOT_VERSION}} has been published.
70+
reactions: rocket

.github/workflows/test.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Run tests
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
11+
cancel-in-progress: true
12+
13+
env:
14+
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
15+
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
16+
17+
jobs:
18+
test:
19+
name: Run tests
20+
runs-on: buildjet-2vcpu-ubuntu-2204
21+
steps:
22+
- uses: actions/checkout@v4
23+
if: ${{ github.event_name != 'pull_request' }}
24+
25+
- uses: actions/checkout@v4
26+
if: ${{ github.event_name == 'pull_request' }}
27+
with:
28+
ref: ${{ github.event.pull_request.head.sha }}
29+
30+
- uses: pnpm/action-setup@v4
31+
32+
- uses: buildjet/setup-node@v4
33+
with:
34+
node-version: "20"
35+
cache: "pnpm"
36+
37+
- name: Set up environment
38+
uses: ./.github/actions/setup
39+
timeout-minutes: 5
40+
41+
- name: Lint
42+
run: pnpm run lint
43+
44+
# - name: Check types
45+
# run: pnpm run tsc
46+
47+
- name: Run unit tests
48+
run: pnpm run test

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ using React and React Native.
77
You can scaffold a new project using degit:
88

99
```bash
10-
npx degit plexinc/react-lightning/apps
10+
npx degit plexinc/react-lightning/apps/template my-lightning-app
1111
```
1212

1313
See the docs in [/apps/storybook](./apps/storybook) for usage and examples.

apps/storybook/src/getting-started/QuickStart.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The quickest way to get up and running is to use the template app.
1212
dark
1313
language="bash"
1414
code={`
15-
npx degit plexinc/react-lightning/apps/template
15+
npx degit plexinc/react-lightning/apps/template my-lightning-app
1616
`}
1717
/>
1818

apps/template/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
},
2424
"dependencies": {
2525
"@lightningjs/renderer": "2.8.0",
26-
"@plexinc/react-lightning": "workspace:*",
26+
"@plexinc/react-lightning": "*",
2727
"react": "18.3.1",
2828
"react-router-dom": "7.0.2"
2929
},
3030
"devDependencies": {
31-
"@plexinc/vite-plugin-msdf-fontgen": "workspace:*",
31+
"@plexinc/vite-plugin-msdf-fontgen": "*",
3232
"@tsconfig/vite-react": "3.4.0",
3333
"@types/react": "18.3.14",
3434
"@vitejs/plugin-react": "4.3.4",

renovate.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"extends": [
4-
"local>plexinc/renovate-config"
5-
]
3+
"extends": ["local>plexinc/renovate-config"]
64
}

0 commit comments

Comments
 (0)