Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(samples): upgrade dependencies #185

Merged
merged 6 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions .eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
test:
name: Run contract tests
runs-on:
group: Default
group: organization/Default
steps:
- uses: actions/checkout@v4
- run: yarn install
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ results.xml
junit.xml
yarn-error.log
package-lock.json
samples/astro
samples/astro
.yarn/install-state.gz
934 changes: 934 additions & 0 deletions .yarn/releases/yarn-4.5.1.cjs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
yarnPath: .yarn/releases/yarn-4.5.1.cjs
nodeLinker: "node-modules"
45 changes: 45 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { fixupConfigRules } from "@eslint/compat"
import tsParser from "@typescript-eslint/parser"
import path from "node:path"
import { fileURLToPath } from "node:url"
import js from "@eslint/js"
import { FlatCompat } from "@eslint/eslintrc"

const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
})

export default [
{
ignores: ["**/samples/", "**/.yarn/", ".gitignore", "**/lib/dist/**", "**/lib/tests/**"],
},
...fixupConfigRules(
compat.extends(
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:react-hooks/recommended",
"prettier"
)
),
{
languageOptions: {
parser: tsParser,
ecmaVersion: 2020,
sourceType: "module",

parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
rules: {
"prefer-rest-params": "off",
"@typescript-eslint/no-explicit-any": "off",
},
},
]
1 change: 0 additions & 1 deletion lib/src/entities/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ export class Chat {
throw error
}

/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
const pubnub = new PubNub(pubnubConfig) as any
pubnub._config._addPnsdkSuffix("chat-sdk", `__PLATFORM__/__VERSION__`)
this.sdk = pubnub
Expand Down
9 changes: 7 additions & 2 deletions lib/src/entities/membership.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { Chat } from "./chat"
import PubNub, { ChannelMembershipObject, ObjectCustom, UUIDMembershipObject } from "pubnub"
import {
ChannelMembershipObject,
ObjectCustom,
UUIDMembershipObject,
SetMembershipEvent,
} from "pubnub"
import { Channel } from "./channel"
import { Message } from "./message"
import { User } from "./user"
Expand Down Expand Up @@ -102,7 +107,7 @@ export class Membership {
) {
if (!memberships.length) throw "Cannot stream membership updates on an empty list"
const listener = {
objects: (event: PubNub.SetMembershipEvent<PubNub.ObjectCustom>) => {
objects: (event: SetMembershipEvent<ObjectCustom>) => {
if (event.message.type !== "membership") return
const membership = memberships.find(
(m) => m.channel.id === event.channel && m.user.id === event.message.data.uuid.id
Expand Down
4 changes: 2 additions & 2 deletions lib/src/entities/message-draft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,10 @@ export class MessageDraft {
if (previousWordsStartingWithSymbol.length > currentWordsStartingWithSymbol.length) {
// a mention was removed
const firstRemovalIndex = previousWordsStartingWithSymbol.findIndex(
(e, i) => !currentWordsStartingWithSymbol.includes(e)
(e) => !currentWordsStartingWithSymbol.includes(e)
)
const lastRemovalIndex = previousWordsStartingWithSymbol.findLastIndex(
(e, i) => !currentWordsStartingWithSymbol.includes(e)
(e) => !currentWordsStartingWithSymbol.includes(e)
)

if (lastRemovalIndex !== -1) {
Expand Down
1 change: 1 addition & 0 deletions lib/src/entities/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ export class Message {
async pin() {
const channel = await this.chat.getChannel(this.channelId)

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
await this.chat.pinMessageToChannel(this, channel!)
}

Expand Down
14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"build": "yarn workspace @pubnub/chat run build",
"build:watch": "yarn workspace @pubnub/chat run dev",
"astro": "yarn workspace @pubnub/chat-astro run dev",
"eslint:base": "eslint --ignore-path .gitignore",
"eslint:base": "eslint",
"prettier:base": "prettier --ignore-path .gitignore",
"prepare": "node -e \"try { require('husky').install() } catch (e) {if (e.code !== 'MODULE_NOT_FOUND') throw e}\""
},
Expand All @@ -28,10 +28,13 @@
"devDependencies": {
"@commitlint/cli": "17.1.2",
"@commitlint/config-conventional": "17.1.0",
"@eslint/compat": "^1.2.2",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.14.0",
"@typescript-eslint/eslint-plugin": "5.37.0",
"@typescript-eslint/parser": "5.37.0",
"buffer": "5.5.0",
"eslint": "8.22.0",
"eslint": "9.14.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-react-hooks": "4.6.0",
Expand All @@ -42,6 +45,9 @@
"typescript": "4.9.5"
},
"resolutions": {
"webpack": "5.88.2"
}
"send": "0.19.0",
"semver": "7.6.3",
"ws": "8.17.1"
},
"packageManager": "yarn@4.5.1"
}
14 changes: 7 additions & 7 deletions samples/access-manager-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"dependencies": {
"@nestjs/common": "^10.0.0",
"@nestjs/core": "^10.0.0",
"@nestjs/platform-express": "^10.0.0",
"@nestjs/common": "10.4.7",
"@nestjs/core": "10.4.7",
"@nestjs/platform-express": "10.4.7",
"@pubnub/chat": "*",
"reflect-metadata": "^0.2.0",
"rxjs": "^7.8.1",
"@pubnub/chat": "*"
"rxjs": "^7.8.1"
},
"devDependencies": {
"@nestjs/cli": "^10.0.0",
"@nestjs/cli": "10.4.7",
"@nestjs/schematics": "^10.0.0",
"@nestjs/testing": "^10.0.0",
"@nestjs/testing": "10.4.7",
"@types/express": "^4.17.17",
"@types/jest": "^29.5.2",
"@types/node": "^20.3.1",
Expand Down
3 changes: 1 addition & 2 deletions samples/e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
"license": "MIT",
"devDependencies": {
"@playwright/test": "^1.37.0"
},
"scripts": {}
}
}
2 changes: 1 addition & 1 deletion samples/getting-started/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-react-refresh": "0.3.4",
"typescript": "5.0.2",
"vite": "4.3.9"
"vite": "5.4.10"
}
}
3 changes: 2 additions & 1 deletion samples/react-native-group-chat/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
},
"web": {
"favicon": "./assets/favicon.png"
}
},
"plugins": ["expo-font"]
}
}
38 changes: 20 additions & 18 deletions samples/react-native-group-chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,48 @@
},
"dependencies": {
"@expo-google-fonts/roboto": "^0.2.3",
"@expo/vector-icons": "^13.0.0",
"@expo/webpack-config": "^19.0.0",
"@expo/vector-icons": "^14.0.3",
"@expo/webpack-config": "~19.0.1",
"@gorhom/bottom-sheet": "^4.4.7",
"@pubnub/chat": "*",
"@react-navigation/bottom-tabs": "^6.5.8",
"@react-navigation/native": "^6.1.7",
"@react-navigation/stack": "^6.3.17",
"expo": "~49.0.8",
"expo-clipboard": "~4.3.1",
"expo-font": "~11.4.0",
"expo-status-bar": "~1.6.0",
"expo": "^51.0.38",
"expo-clipboard": "~6.0.3",
"expo-font": "~12.0.10",
"expo-status-bar": "~1.12.1",
"nanoid": "4.0.2",
"react": "18.2.0",
"react-native": "0.72.4",
"react-native-gesture-handler": "~2.12.0",
"react-native-get-random-values": "1.9.0",
"react-native-gifted-chat": "^2.4.0",
"react-native-reanimated": "~3.3.0",
"react-native-safe-area-context": "4.6.3",
"react-native-screens": "~3.22.0",
"react-native-svg": "13.9.0",
"react-dom": "18.2.0",
"react-native": "0.74.5",
"react-native-gesture-handler": "~2.16.1",
"react-native-get-random-values": "~1.11.0",
"react-native-gifted-chat": "2.6.4",
"react-native-reanimated": "3.10.1",
"react-native-safe-area-context": "4.10.5",
"react-native-screens": "3.31.1",
"react-native-svg": "15.2.0",
"react-native-toast-message": "^2.2.0",
"react-native-typing-animation": "^0.1.7",
"react-native-web": "~0.19.6"
"react-native-web": "~0.19.10"
},
"devDependencies": {
"@babel/core": "7.22.15",
"@babel/core": "^7.24.0",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
"@babel/plugin-syntax-export-default-from": "^7.25.9",
"@babel/plugin-transform-arrow-functions": "^7.22.5",
"@babel/plugin-transform-shorthand-properties": "^7.22.5",
"@babel/plugin-transform-template-literals": "^7.22.5",
"@svgr/webpack": "^8.1.0",
"@types/react": "~18.0.14",
"@types/react": "~18.2.79",
"babel-plugin-inline-react-svg": "^2.0.2",
"babel-plugin-transform-inline-environment-variables": "^0.4.4",
"react-native-svg-transformer": "^1.1.0",
"typescript": "^5.1.3"
"typescript": "~5.3.3"
},
"private": true
}
Loading
Loading