Skip to content

Commit

Permalink
Merge branch 'main' of github.com:le0pard/cable-shared-worker
Browse files Browse the repository at this point in the history
  • Loading branch information
le0pard committed Nov 2, 2024
2 parents 57157fd + 9936787 commit 21edc31
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 44 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

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

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

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
14 changes: 8 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
name: Test/Build/Deploy
on: push
on:
push:
pull_request:

jobs:
test:
name: "Test"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Install Node.JS
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'
Expand All @@ -37,12 +39,12 @@ jobs:
NODE_ENV: production
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Install Node.JS
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'
Expand All @@ -62,7 +64,7 @@ jobs:
yarn config set npmPublishAccess "public"
- name: Publish packages 🚀
run: yarn workspaces foreach --no-private npm publish
run: yarn workspaces foreach -W --no-private npm publish
env:
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"eslint": "^8.55.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-node": "^0.3.9",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-import": "^2.29.1",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jsdom": "^25.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cable-shared-worker/web",
"version": "0.4.0",
"version": "0.4.1",
"description": "ActionCable and AnyCable Shared Worker support",
"keywords": [
"anycable",
Expand Down
10 changes: 5 additions & 5 deletions packages/web/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,12 @@ const startWorker = ({
}) => {
try {
if (type === TYPE_SHARED_WORKER) {
workerPort = new window.SharedWorker(workerUrl, workerOptions).port
const worker = new window.SharedWorker(workerUrl, workerOptions)
worker.addEventListener('error', (event) => options.onError?.(event))
workerPort = worker.port
} else {
workerPort = new window.Worker(workerUrl, workerOptions)
workerPort.addEventListener('error', (event) => options.onError?.(event))
}
} catch (e) {
return reject(e)
Expand All @@ -93,10 +96,7 @@ const startWorker = ({
}

workerPort.addEventListener('message', (event) => handleWorkerMessages({ event, options }))
if (options.onError) {
workerPort.addEventListener('error', (event) => options.onError(event.toString()))
workerPort.addEventListener('messageerror', (event) => options.onError(event.toString()))
}
workerPort.addEventListener('messageerror', (event) => options.onError?.(event))

if (type === TYPE_SHARED_WORKER) {
workerPort.start() // we need start port only for shared worker
Expand Down
2 changes: 1 addition & 1 deletion packages/worker/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cable-shared-worker/worker",
"version": "0.4.0",
"version": "0.4.1",
"description": "ActionCable and AnyCable Shared Worker support",
"keywords": [
"anycable",
Expand Down
63 changes: 37 additions & 26 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2417,14 +2417,7 @@ __metadata:
languageName: node
linkType: hard

"@jridgewell/sourcemap-codec@npm:^1.4.14":
version: 1.5.0
resolution: "@jridgewell/sourcemap-codec@npm:1.5.0"
checksum: 10/4ed6123217569a1484419ac53f6ea0d9f3b57e5b57ab30d7c267bdb27792a27eb0e4b08e84a2680aa55cc2f2b411ffd6ec3db01c44fdc6dc43aca4b55f8374fd
languageName: node
linkType: hard

"@jridgewell/sourcemap-codec@npm:^1.4.15":
"@jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.4.15":
version: 1.4.15
resolution: "@jridgewell/sourcemap-codec@npm:1.4.15"
checksum: 10/89960ac087781b961ad918978975bcdf2051cd1741880469783c42de64239703eab9db5230d776d8e6a09d73bb5e4cb964e07d93ee6e2e7aea5a7d726e865c09
Expand Down Expand Up @@ -3592,7 +3585,7 @@ __metadata:
languageName: node
linkType: hard

"braces@npm:^3.0.1, braces@npm:^3.0.2":
"braces@npm:^3.0.1":
version: 3.0.2
resolution: "braces@npm:3.0.2"
dependencies:
Expand All @@ -3601,6 +3594,15 @@ __metadata:
languageName: node
linkType: hard

"braces@npm:^3.0.3":
version: 3.0.3
resolution: "braces@npm:3.0.3"
dependencies:
fill-range: "npm:^7.1.1"
checksum: 10/fad11a0d4697a27162840b02b1fad249c1683cbc510cd5bf1a471f2f8085c046d41094308c577a50a03a579dd99d5a6b3724c4b5e8b14df2c4443844cfcda2c6
languageName: node
linkType: hard

"browser-process-hrtime@npm:^1.0.0":
version: 1.0.0
resolution: "browser-process-hrtime@npm:1.0.0"
Expand Down Expand Up @@ -3697,7 +3699,7 @@ __metadata:
eslint: "npm:^8.55.0"
eslint-config-prettier: "npm:^9.1.0"
eslint-import-resolver-node: "npm:^0.3.9"
eslint-plugin-import: "npm:^2.29.0"
eslint-plugin-import: "npm:^2.29.1"
jest: "npm:^29.7.0"
jest-environment-jsdom: "npm:^29.7.0"
jsdom: "npm:^25.0.1"
Expand Down Expand Up @@ -3798,9 +3800,9 @@ __metadata:
linkType: hard

"caniuse-lite@npm:^1.0.30001280, caniuse-lite@npm:^1.0.30001332":
version: 1.0.30001472
resolution: "caniuse-lite@npm:1.0.30001472"
checksum: 10/7b230863721d9de08464eb98a7db1cd0a0e0bdd09058c8af3c822e516c04d390373db802cb12f4310fbde6713a109bb65b9422dcf8ea17eba0b4c5f558eb2b86
version: 1.0.30001636
resolution: "caniuse-lite@npm:1.0.30001636"
checksum: 10/9e6c5ab4c20df31df36720dda77cf6a781549ac2ad844bc0a416b327a793da21486358a1f85fdd6c39e22d336f70aac3b0e232f5f228cdff0ceb6e3e1c5e98fd
languageName: node
linkType: hard

Expand Down Expand Up @@ -4571,9 +4573,9 @@ __metadata:
languageName: node
linkType: hard

"eslint-plugin-import@npm:^2.29.0":
version: 2.29.0
resolution: "eslint-plugin-import@npm:2.29.0"
"eslint-plugin-import@npm:^2.29.1":
version: 2.29.1
resolution: "eslint-plugin-import@npm:2.29.1"
dependencies:
array-includes: "npm:^3.1.7"
array.prototype.findlastindex: "npm:^1.2.3"
Expand All @@ -4591,10 +4593,10 @@ __metadata:
object.groupby: "npm:^1.0.1"
object.values: "npm:^1.1.7"
semver: "npm:^6.3.1"
tsconfig-paths: "npm:^3.14.2"
tsconfig-paths: "npm:^3.15.0"
peerDependencies:
eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8
checksum: 10/d6e8d016f38369892c85b866f762c03dee2b337d4f12031756e30d7490879261d1192a3c2f682fd7c4d2b923465f7a1e3d22cfdad5da1b1391c3bd39ea87af1a
checksum: 10/5865f05c38552145423c535326ec9a7113ab2305c7614c8b896ff905cfabc859c8805cac21e979c9f6f742afa333e6f62f812eabf891a7e8f5f0b853a32593c1
languageName: node
linkType: hard

Expand Down Expand Up @@ -4891,6 +4893,15 @@ __metadata:
languageName: node
linkType: hard

"fill-range@npm:^7.1.1":
version: 7.1.1
resolution: "fill-range@npm:7.1.1"
dependencies:
to-regex-range: "npm:^5.0.1"
checksum: 10/a7095cb39e5bc32fada2aa7c7249d3f6b01bd1ce461a61b0adabacccabd9198500c6fb1f68a7c851a657e273fce2233ba869638897f3d7ed2e87a2d89b4436ea
languageName: node
linkType: hard

"find-up@npm:^4.0.0, find-up@npm:^4.1.0":
version: 4.1.0
resolution: "find-up@npm:4.1.0"
Expand Down Expand Up @@ -6704,12 +6715,12 @@ __metadata:
linkType: hard

"micromatch@npm:^4.0.2":
version: 4.0.5
resolution: "micromatch@npm:4.0.5"
version: 4.0.8
resolution: "micromatch@npm:4.0.8"
dependencies:
braces: "npm:^3.0.2"
braces: "npm:^3.0.3"
picomatch: "npm:^2.3.1"
checksum: 10/a749888789fc15cac0e03273844dbd749f9f8e8d64e70c564bcf06a033129554c789bb9e30d7566d7ff6596611a08e58ac12cf2a05f6e3c9c47c50c4c7e12fa2
checksum: 10/6bf2a01672e7965eb9941d1f02044fad2bd12486b5553dc1116ff24c09a8723157601dc992e74c911d896175918448762df3b3fd0a6b61037dd1a9766ddfbf58
languageName: node
linkType: hard

Expand Down Expand Up @@ -8318,15 +8329,15 @@ __metadata:
languageName: node
linkType: hard

"tsconfig-paths@npm:^3.14.2":
version: 3.14.2
resolution: "tsconfig-paths@npm:3.14.2"
"tsconfig-paths@npm:^3.15.0":
version: 3.15.0
resolution: "tsconfig-paths@npm:3.15.0"
dependencies:
"@types/json5": "npm:^0.0.29"
json5: "npm:^1.0.2"
minimist: "npm:^1.2.6"
strip-bom: "npm:^3.0.0"
checksum: 10/17f23e98612a60cf23b80dc1d3b7b840879e41fcf603868fc3618a30f061ac7b463ef98cad8c28b68733b9bfe0cc40ffa2bcf29e94cf0d26e4f6addf7ac8527d
checksum: 10/2041beaedc6c271fc3bedd12e0da0cc553e65d030d4ff26044b771fac5752d0460944c0b5e680f670c2868c95c664a256cec960ae528888db6ded83524e33a14
languageName: node
linkType: hard

Expand Down

0 comments on commit 21edc31

Please sign in to comment.