Skip to content

Commit

Permalink
new libs
Browse files Browse the repository at this point in the history
  • Loading branch information
le0pard committed Dec 2, 2023
1 parent 77c53e0 commit 1ed5279
Show file tree
Hide file tree
Showing 15 changed files with 1,296 additions and 1,174 deletions.
893 changes: 0 additions & 893 deletions .yarn/releases/yarn-4.0.0.cjs

This file was deleted.

893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.0.2.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ compressionLevel: mixed

enableGlobalCache: false

yarnPath: .yarn/releases/yarn-4.0.0.cjs
yarnPath: .yarn/releases/yarn-4.0.2.cjs
5 changes: 1 addition & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@ process.env.TZ = 'UTC' // normalize timezone for tests

module.exports = {
coverageReporters: ['json', 'lcov', 'text', 'clover', 'html'],
testEnvironment: 'jsdom',
moduleNameMapper: {
'^cable-shared/(.*)': '<rootDir>/shared/$1.js'
}
testEnvironment: 'jsdom'
}
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,24 @@
},
"homepage": "https://github.com/le0pard/cable-shared-worker#readme",
"devDependencies": {
"@babel/core": "^7.23.3",
"@babel/core": "^7.23.5",
"@babel/eslint-parser": "^7.23.3",
"@babel/preset-env": "^7.23.3",
"@rollup/plugin-alias": "^5.0.1",
"@babel/preset-env": "^7.23.5",
"@rollup/plugin-alias": "^5.1.0",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@yarnpkg/pnpify": "^4.0.1",
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
"eslint": "^8.55.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-node": "^0.3.9",
"eslint-plugin-import": "^2.29.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jsdom": "^22.1.0",
"jsdom": "^23.0.1",
"prettier": "^3.1.0",
"rollup": "^4.4.1",
"typescript": "^5.2.2"
"rollup": "^4.6.1",
"typescript": "^5.3.2"
},
"packageManager": "yarn@4.0.0"
"packageManager": "yarn@4.0.2"
}
2 changes: 1 addition & 1 deletion packages/web/src/__tests__/visibility.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {activateVisibilityAPI} from '../visibility'
import { activateVisibilityAPI } from '../visibility'

const triggerVisibilityAPI = (isVisible = true) => {
const visibleKey = isVisible ? 'visible' : 'hidden'
Expand Down
4 changes: 2 additions & 2 deletions packages/web/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {
VISIBILITY_HIDDEN_COMMAND,
WORKER_MSG_ERROR_COMMAND,
ALL_COMMANDS
} from 'cable-shared/constants'
import {uuid} from 'cable-shared/uuid'
} from './../../../shared/constants'
import {uuid} from './../../../shared/uuid'
import {activateVisibilityAPI} from './visibility'

const DEFAULT_OPTIONS = {
Expand Down
2 changes: 1 addition & 1 deletion packages/worker/src/__tests__/cableWrapper.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {initCableWrapper} from '../cableWrapper'
import { initCableWrapper } from '../cableWrapper'

describe('initCableWrapper', () => {
afterEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/worker/src/__tests__/workerCable.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {loadCableApiWrapper} from '../workerCable'
import { loadCableApiWrapper } from '../workerCable'

describe('loadCableApiWrapper', () => {
it('throw error if no provided library', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/worker/src/cableWrapper.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ACTIONCABLE_TYPE, WEBSOCKET_MESSAGE_COMMAND} from 'cable-shared/constants'
import {ACTIONCABLE_TYPE, WEBSOCKET_MESSAGE_COMMAND} from './../../../shared/constants'

const UNSUBSCRIBE_CHECK_TIMEOUT = 300 // give time to unsubscribe from channels

Expand Down
2 changes: 1 addition & 1 deletion packages/worker/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
WEBSOCKET_PERFORM_COMMAND,
WORKER_MSG_ERROR_COMMAND,
ALL_COMMANDS
} from 'cable-shared/constants'
} from './../../../shared/constants'
import {addPortForStore, updatePortPongTime, recurrentPortsChecks} from './workerPorts'
import {loadCableApiWrapper} from './workerCable'

Expand Down
2 changes: 1 addition & 1 deletion packages/worker/src/workerCable.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ACTIONCABLE_TYPE, ANYCABLE_TYPE} from 'cable-shared/constants'
import {ACTIONCABLE_TYPE, ANYCABLE_TYPE} from './../../../shared/constants'
import {initCableWrapper} from './cableWrapper'

export const loadCableApiWrapper = (
Expand Down
4 changes: 2 additions & 2 deletions packages/worker/src/workerPorts.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {uuid} from 'cable-shared/uuid'
import {PING_COMMAND} from 'cable-shared/constants'
import {uuid} from './../../../shared/uuid'
import {PING_COMMAND} from './../../../shared/constants'

const PORT_TICK_TIME = 5 * 1000 // microseconds
const PORT_MAX_TTL = 21 * 1000 // microseconds
Expand Down
2 changes: 1 addition & 1 deletion shared/__tests__/uuid.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {uuid} from '../uuid'
import { uuid } from '../uuid'

Check failure on line 1 in shared/__tests__/uuid.test.js

View workflow job for this annotation

GitHub Actions / Test

There should be no space after '{'

Check failure on line 1 in shared/__tests__/uuid.test.js

View workflow job for this annotation

GitHub Actions / Test

There should be no space before '}'

describe('uuid', () => {
it('generate string', () => {
Expand Down
Loading

0 comments on commit 1ed5279

Please sign in to comment.