Skip to content

Commit 21edc31

Browse files
committed
Merge branch 'main' of github.com:le0pard/cable-shared-worker
2 parents 57157fd + 9936787 commit 21edc31

File tree

7 files changed

+57
-44
lines changed

7 files changed

+57
-44
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ jobs:
3838

3939
steps:
4040
- name: Checkout repository
41-
uses: actions/checkout@v3
41+
uses: actions/checkout@v4
4242

4343
# Initializes the CodeQL tools for scanning.
4444
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v2
45+
uses: github/codeql-action/init@v3
4646
with:
4747
languages: ${{ matrix.language }}
4848
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -53,7 +53,7 @@ jobs:
5353
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5454
# If this step fails, then you should remove it and run the build manually (see below)
5555
- name: Autobuild
56-
uses: github/codeql-action/autobuild@v2
56+
uses: github/codeql-action/autobuild@v3
5757

5858
# ℹ️ Command-line programs to run using the OS shell.
5959
# 📚 https://git.io/JvXDl
@@ -67,4 +67,4 @@ jobs:
6767
# make release
6868

6969
- name: Perform CodeQL Analysis
70-
uses: github/codeql-action/analyze@v2
70+
uses: github/codeql-action/analyze@v3

.github/workflows/release.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
name: Test/Build/Deploy
2-
on: push
2+
on:
3+
push:
4+
pull_request:
35

46
jobs:
57
test:
68
name: "Test"
79
runs-on: ubuntu-latest
810
steps:
911
- name: Checkout
10-
uses: actions/checkout@v3
12+
uses: actions/checkout@v4
1113
with:
1214
persist-credentials: false
1315

1416
- name: Install Node.JS
15-
uses: actions/setup-node@v3
17+
uses: actions/setup-node@v4
1618
with:
1719
cache: 'yarn'
1820
registry-url: 'https://registry.npmjs.org'
@@ -37,12 +39,12 @@ jobs:
3739
NODE_ENV: production
3840
steps:
3941
- name: Checkout
40-
uses: actions/checkout@v3
42+
uses: actions/checkout@v4
4143
with:
4244
persist-credentials: false
4345

4446
- name: Install Node.JS
45-
uses: actions/setup-node@v3
47+
uses: actions/setup-node@v4
4648
with:
4749
cache: 'yarn'
4850
registry-url: 'https://registry.npmjs.org'
@@ -62,7 +64,7 @@ jobs:
6264
yarn config set npmPublishAccess "public"
6365
6466
- name: Publish packages 🚀
65-
run: yarn workspaces foreach --no-private npm publish
67+
run: yarn workspaces foreach -W --no-private npm publish
6668
env:
6769
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6870

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"eslint": "^8.55.0",
4040
"eslint-config-prettier": "^9.1.0",
4141
"eslint-import-resolver-node": "^0.3.9",
42-
"eslint-plugin-import": "^2.29.0",
42+
"eslint-plugin-import": "^2.29.1",
4343
"jest": "^29.7.0",
4444
"jest-environment-jsdom": "^29.7.0",
4545
"jsdom": "^25.0.1",

packages/web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cable-shared-worker/web",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"description": "ActionCable and AnyCable Shared Worker support",
55
"keywords": [
66
"anycable",

packages/web/src/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,12 @@ const startWorker = ({
8181
}) => {
8282
try {
8383
if (type === TYPE_SHARED_WORKER) {
84-
workerPort = new window.SharedWorker(workerUrl, workerOptions).port
84+
const worker = new window.SharedWorker(workerUrl, workerOptions)
85+
worker.addEventListener('error', (event) => options.onError?.(event))
86+
workerPort = worker.port
8587
} else {
8688
workerPort = new window.Worker(workerUrl, workerOptions)
89+
workerPort.addEventListener('error', (event) => options.onError?.(event))
8790
}
8891
} catch (e) {
8992
return reject(e)
@@ -93,10 +96,7 @@ const startWorker = ({
9396
}
9497

9598
workerPort.addEventListener('message', (event) => handleWorkerMessages({ event, options }))
96-
if (options.onError) {
97-
workerPort.addEventListener('error', (event) => options.onError(event.toString()))
98-
workerPort.addEventListener('messageerror', (event) => options.onError(event.toString()))
99-
}
99+
workerPort.addEventListener('messageerror', (event) => options.onError?.(event))
100100

101101
if (type === TYPE_SHARED_WORKER) {
102102
workerPort.start() // we need start port only for shared worker

packages/worker/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cable-shared-worker/worker",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"description": "ActionCable and AnyCable Shared Worker support",
55
"keywords": [
66
"anycable",

yarn.lock

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2417,14 +2417,7 @@ __metadata:
24172417
languageName: node
24182418
linkType: hard
24192419

2420-
"@jridgewell/sourcemap-codec@npm:^1.4.14":
2421-
version: 1.5.0
2422-
resolution: "@jridgewell/sourcemap-codec@npm:1.5.0"
2423-
checksum: 10/4ed6123217569a1484419ac53f6ea0d9f3b57e5b57ab30d7c267bdb27792a27eb0e4b08e84a2680aa55cc2f2b411ffd6ec3db01c44fdc6dc43aca4b55f8374fd
2424-
languageName: node
2425-
linkType: hard
2426-
2427-
"@jridgewell/sourcemap-codec@npm:^1.4.15":
2420+
"@jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.4.15":
24282421
version: 1.4.15
24292422
resolution: "@jridgewell/sourcemap-codec@npm:1.4.15"
24302423
checksum: 10/89960ac087781b961ad918978975bcdf2051cd1741880469783c42de64239703eab9db5230d776d8e6a09d73bb5e4cb964e07d93ee6e2e7aea5a7d726e865c09
@@ -3592,7 +3585,7 @@ __metadata:
35923585
languageName: node
35933586
linkType: hard
35943587

3595-
"braces@npm:^3.0.1, braces@npm:^3.0.2":
3588+
"braces@npm:^3.0.1":
35963589
version: 3.0.2
35973590
resolution: "braces@npm:3.0.2"
35983591
dependencies:
@@ -3601,6 +3594,15 @@ __metadata:
36013594
languageName: node
36023595
linkType: hard
36033596

3597+
"braces@npm:^3.0.3":
3598+
version: 3.0.3
3599+
resolution: "braces@npm:3.0.3"
3600+
dependencies:
3601+
fill-range: "npm:^7.1.1"
3602+
checksum: 10/fad11a0d4697a27162840b02b1fad249c1683cbc510cd5bf1a471f2f8085c046d41094308c577a50a03a579dd99d5a6b3724c4b5e8b14df2c4443844cfcda2c6
3603+
languageName: node
3604+
linkType: hard
3605+
36043606
"browser-process-hrtime@npm:^1.0.0":
36053607
version: 1.0.0
36063608
resolution: "browser-process-hrtime@npm:1.0.0"
@@ -3697,7 +3699,7 @@ __metadata:
36973699
eslint: "npm:^8.55.0"
36983700
eslint-config-prettier: "npm:^9.1.0"
36993701
eslint-import-resolver-node: "npm:^0.3.9"
3700-
eslint-plugin-import: "npm:^2.29.0"
3702+
eslint-plugin-import: "npm:^2.29.1"
37013703
jest: "npm:^29.7.0"
37023704
jest-environment-jsdom: "npm:^29.7.0"
37033705
jsdom: "npm:^25.0.1"
@@ -3798,9 +3800,9 @@ __metadata:
37983800
linkType: hard
37993801

38003802
"caniuse-lite@npm:^1.0.30001280, caniuse-lite@npm:^1.0.30001332":
3801-
version: 1.0.30001472
3802-
resolution: "caniuse-lite@npm:1.0.30001472"
3803-
checksum: 10/7b230863721d9de08464eb98a7db1cd0a0e0bdd09058c8af3c822e516c04d390373db802cb12f4310fbde6713a109bb65b9422dcf8ea17eba0b4c5f558eb2b86
3803+
version: 1.0.30001636
3804+
resolution: "caniuse-lite@npm:1.0.30001636"
3805+
checksum: 10/9e6c5ab4c20df31df36720dda77cf6a781549ac2ad844bc0a416b327a793da21486358a1f85fdd6c39e22d336f70aac3b0e232f5f228cdff0ceb6e3e1c5e98fd
38043806
languageName: node
38053807
linkType: hard
38063808

@@ -4571,9 +4573,9 @@ __metadata:
45714573
languageName: node
45724574
linkType: hard
45734575

4574-
"eslint-plugin-import@npm:^2.29.0":
4575-
version: 2.29.0
4576-
resolution: "eslint-plugin-import@npm:2.29.0"
4576+
"eslint-plugin-import@npm:^2.29.1":
4577+
version: 2.29.1
4578+
resolution: "eslint-plugin-import@npm:2.29.1"
45774579
dependencies:
45784580
array-includes: "npm:^3.1.7"
45794581
array.prototype.findlastindex: "npm:^1.2.3"
@@ -4591,10 +4593,10 @@ __metadata:
45914593
object.groupby: "npm:^1.0.1"
45924594
object.values: "npm:^1.1.7"
45934595
semver: "npm:^6.3.1"
4594-
tsconfig-paths: "npm:^3.14.2"
4596+
tsconfig-paths: "npm:^3.15.0"
45954597
peerDependencies:
45964598
eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8
4597-
checksum: 10/d6e8d016f38369892c85b866f762c03dee2b337d4f12031756e30d7490879261d1192a3c2f682fd7c4d2b923465f7a1e3d22cfdad5da1b1391c3bd39ea87af1a
4599+
checksum: 10/5865f05c38552145423c535326ec9a7113ab2305c7614c8b896ff905cfabc859c8805cac21e979c9f6f742afa333e6f62f812eabf891a7e8f5f0b853a32593c1
45984600
languageName: node
45994601
linkType: hard
46004602

@@ -4891,6 +4893,15 @@ __metadata:
48914893
languageName: node
48924894
linkType: hard
48934895

4896+
"fill-range@npm:^7.1.1":
4897+
version: 7.1.1
4898+
resolution: "fill-range@npm:7.1.1"
4899+
dependencies:
4900+
to-regex-range: "npm:^5.0.1"
4901+
checksum: 10/a7095cb39e5bc32fada2aa7c7249d3f6b01bd1ce461a61b0adabacccabd9198500c6fb1f68a7c851a657e273fce2233ba869638897f3d7ed2e87a2d89b4436ea
4902+
languageName: node
4903+
linkType: hard
4904+
48944905
"find-up@npm:^4.0.0, find-up@npm:^4.1.0":
48954906
version: 4.1.0
48964907
resolution: "find-up@npm:4.1.0"
@@ -6704,12 +6715,12 @@ __metadata:
67046715
linkType: hard
67056716

67066717
"micromatch@npm:^4.0.2":
6707-
version: 4.0.5
6708-
resolution: "micromatch@npm:4.0.5"
6718+
version: 4.0.8
6719+
resolution: "micromatch@npm:4.0.8"
67096720
dependencies:
6710-
braces: "npm:^3.0.2"
6721+
braces: "npm:^3.0.3"
67116722
picomatch: "npm:^2.3.1"
6712-
checksum: 10/a749888789fc15cac0e03273844dbd749f9f8e8d64e70c564bcf06a033129554c789bb9e30d7566d7ff6596611a08e58ac12cf2a05f6e3c9c47c50c4c7e12fa2
6723+
checksum: 10/6bf2a01672e7965eb9941d1f02044fad2bd12486b5553dc1116ff24c09a8723157601dc992e74c911d896175918448762df3b3fd0a6b61037dd1a9766ddfbf58
67136724
languageName: node
67146725
linkType: hard
67156726

@@ -8318,15 +8329,15 @@ __metadata:
83188329
languageName: node
83198330
linkType: hard
83208331

8321-
"tsconfig-paths@npm:^3.14.2":
8322-
version: 3.14.2
8323-
resolution: "tsconfig-paths@npm:3.14.2"
8332+
"tsconfig-paths@npm:^3.15.0":
8333+
version: 3.15.0
8334+
resolution: "tsconfig-paths@npm:3.15.0"
83248335
dependencies:
83258336
"@types/json5": "npm:^0.0.29"
83268337
json5: "npm:^1.0.2"
83278338
minimist: "npm:^1.2.6"
83288339
strip-bom: "npm:^3.0.0"
8329-
checksum: 10/17f23e98612a60cf23b80dc1d3b7b840879e41fcf603868fc3618a30f061ac7b463ef98cad8c28b68733b9bfe0cc40ffa2bcf29e94cf0d26e4f6addf7ac8527d
8340+
checksum: 10/2041beaedc6c271fc3bedd12e0da0cc553e65d030d4ff26044b771fac5752d0460944c0b5e680f670c2868c95c664a256cec960ae528888db6ded83524e33a14
83308341
languageName: node
83318342
linkType: hard
83328343

0 commit comments

Comments
 (0)