Skip to content

Commit 4f4e72b

Browse files
committed
feat(repo): merge master from [email protected]:supabase/realtime-js.git
2 parents 3bd0104 + f86ed1a commit 4f4e72b

File tree

89 files changed

+45122
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+45122
-1
lines changed

package-lock.json

Lines changed: 73 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@
8383
"typescript": "^4.5.5",
8484
"webpack": "^5.69.1",
8585
"webpack-cli": "^4.9.2",
86-
"@nx/playwright": "21.6.2"
86+
"@nx/playwright": "21.6.2",
87+
"@nx/vite": "21.6.2"
8788
},
8889
"husky": {
8990
"hooks": {
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"parser": "babel-eslint",
3+
"parserOptions": {
4+
"allowImportExportEverywhere": true,
5+
"ecmaVersion": 6,
6+
"sourceType": "module"
7+
},
8+
"ecmaFeatures": {
9+
"modules": true
10+
},
11+
"env": {
12+
"node": true
13+
},
14+
"globals": {
15+
"window": true
16+
},
17+
"rules": {
18+
"curly": 2,
19+
"no-eq-null": 2,
20+
"comma-dangle": [ 2, "always-multiline" ],
21+
"no-caller": 2,
22+
"dot-notation": 0,
23+
"no-debugger": 2,
24+
"no-undef": 2
25+
}
26+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- next
8+
- rc
9+
push:
10+
branches:
11+
- master
12+
- next
13+
- rc
14+
workflow_dispatch:
15+
16+
jobs:
17+
test:
18+
name: Test / OS ${{ matrix.os }} / Node ${{ matrix.node }}
19+
strategy:
20+
matrix:
21+
os: [ubuntu-latest]
22+
node: ['20']
23+
24+
runs-on: ${{ matrix.os }}
25+
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: Set up Node
29+
uses: actions/setup-node@v2
30+
with:
31+
node-version: ${{ matrix.node }}
32+
- name: Install pnpm
33+
uses: pnpm/action-setup@v4
34+
with:
35+
version: 10
36+
- name: Run CI steps
37+
run: |
38+
pnpm install
39+
pnpm run ci
40+
- name: Upload coverage results to Coveralls
41+
uses: coverallsapp/github-action@v2
42+
with:
43+
fail-on-error: false
44+
github-token: ${{ secrets.GITHUB_TOKEN }}
45+
path-to-lcov: ./coverage/lcov.info
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
9+
jobs:
10+
docs:
11+
name: Publish docs / OS ${{ matrix.os }} / Node ${{ matrix.node }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest]
15+
node: ['18']
16+
17+
runs-on: ${{ matrix.os }}
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: Set up Node
23+
uses: actions/setup-node@v2
24+
with:
25+
node-version: ${{ matrix.node }}
26+
27+
- run: |
28+
npm ci
29+
npm run docs
30+
npm run docs:json
31+
32+
- name: Publish
33+
uses: peaceiris/actions-gh-pages@v3
34+
with:
35+
github_token: ${{ secrets.GITHUB_TOKEN }}
36+
publish_dir: docs
37+
force_orphan: true
38+
commit_message: 'docs: update'
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Preview Build
2+
3+
permissions:
4+
contents: read
5+
pull-requests: read
6+
7+
on:
8+
pull_request:
9+
types: [opened, synchronize, labeled]
10+
paths:
11+
- 'src/**'
12+
- 'package.json'
13+
- 'package-lock.json'
14+
- 'tsconfig.json'
15+
16+
jobs:
17+
build-preview:
18+
# Only run if PR has the 'trigger: preview' label, is on the correct repository, and targets master branch
19+
if: |
20+
github.repository == 'supabase/realtime-js' &&
21+
github.event.pull_request.base.ref == 'master' &&
22+
contains(github.event.pull_request.labels.*.name, 'trigger: preview')
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 15
25+
outputs:
26+
preview-url: ${{ steps.preview.outputs.url }}
27+
pr-number: ${{ github.event.pull_request.number }}
28+
steps:
29+
# Checkout fork code - safe because no secrets are available
30+
- name: Checkout code
31+
uses: actions/checkout@v4
32+
33+
# Log PR author for auditing
34+
- name: Log PR author
35+
run: |
36+
echo "Preview build triggered by: ${{ github.event.pull_request.user.login }}"
37+
echo "PR #${{ github.event.pull_request.number }} from fork: ${{ github.event.pull_request.head.repo.full_name }}"
38+
39+
- name: Setup Node.js
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version: '20'
43+
cache: 'npm'
44+
45+
- name: Install dependencies
46+
run: npm ci
47+
48+
- name: Build
49+
run: npm run build
50+
- name: Create preview release
51+
id: preview
52+
run: |
53+
echo "Creating preview release..."
54+
OUTPUT=$(npx pkg-pr-new@latest publish --compact 2>&1 || true)
55+
echo "Full output:"
56+
echo "$OUTPUT"
57+
58+
# Extract the preview URL
59+
PREVIEW_URL=$(echo "$OUTPUT" | grep -o 'https://pkg\.pr\.new/@supabase/[^[:space:]]*' | head -1)
60+
61+
if [ -z "$PREVIEW_URL" ]; then
62+
echo "Error: Failed to extract preview URL from pkg-pr-new output"
63+
echo "Output was: $OUTPUT"
64+
exit 1
65+
fi
66+
67+
echo "Preview Release URL: $PREVIEW_URL"
68+
echo "url=$PREVIEW_URL" >> $GITHUB_OUTPUT
69+
70+
# Save preview info for the next workflows
71+
- name: Save preview info
72+
run: |
73+
mkdir -p preview-info
74+
echo "${{ steps.preview.outputs.url }}" > preview-info/preview-url.txt
75+
echo "${{ github.event.pull_request.number }}" > preview-info/pr-number.txt
76+
echo "${{ github.event.pull_request.head.sha }}" > preview-info/commit-sha.txt
77+
echo "realtime-js" > preview-info/package-name.txt
78+
79+
- name: Upload preview info
80+
uses: actions/upload-artifact@v4
81+
with:
82+
name: preview-info
83+
path: preview-info/
84+
retention-days: 7

0 commit comments

Comments
 (0)