Skip to content

Commit

Permalink
chore: upgrade dependencies (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrious authored Nov 8, 2023
1 parent a9e0afb commit c5b23f9
Show file tree
Hide file tree
Showing 18 changed files with 1,324 additions and 1,132 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules/
dist/
public/
pnpm-lock.yaml
*.html
31 changes: 10 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,23 @@ on:
jobs:
test:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
- name: Install PNPM
uses: pnpm/action-setup@v2
with:
version: 7
run_install: false
version: latest

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path | tail -1)"
- uses: actions/cache@v3
name: Setup pnpm cache
- name: Install Node.js
uses: actions/setup-node@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
node-version: 18
cache: pnpm

- name: Install dependencies
run: pnpm install
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ coverage/*
docs/*
CHANGELOG.md
pnpm-lock.yaml
*.html
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"editor.tabSize": 2,
"prettier.enable": true,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.addMissingImports": true
},
"eslint.enable": true,
"eslint.validate": ["javascript", "javascriptreact", "html", "vue", "svelte"],
"typescript.tsdk": "node_modules/typescript/lib",
"[html]": {
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,18 +231,22 @@ pnpm t
});
```

- **Storage.on("destroyed", listener)**
- **Storage.on("disconnected", listener)**

An event that fires after the storage instance is destroyed.
An event that fires after the storage instance is disconnected.

Returns: `() => void` - A disposable function that can be called to remove the listener.

```js
const disposer = storage.on("destroyed", () => {
console.log(storage.destroyed); // true
const disposer = storage.on("disconnected", () => {
console.log(storage.disconnected); // true
});
```

- **Stoarge.disconnect()**

Disconnect or dispose the storage, triggers `disconnected` event, and release all listeners.

### License

MIT @ [netless](https://github.com/netless-io)
12 changes: 8 additions & 4 deletions e2e/helper.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { request } from "@playwright/test";
import type { Page, Browser } from "@playwright/test";
import { Remitter } from "remitter";
import type { Browser, Page } from "@playwright/test";
import type { RoomPhase } from "white-web-sdk";
import type { Diff } from "../src/typings";
import type { JoinRoomConfig } from "./typings";

import { request } from "@playwright/test";
import { Remitter } from "remitter";

export interface TestingPageEventData {
stateChanged: Diff<Record<string, any>>;
roomPhaseChanged: RoomPhase;
Expand All @@ -17,7 +18,10 @@ export class TestingPage {
events = new Remitter();
roomConfig?: { uuid: string; token: string };

constructor(public browser: Browser, public page: Page) {
constructor(
public browser: Browser,
public page: Page
) {
this.page.exposeFunction(
"onStateChanged",
(diff: TestingPageEventData["stateChanged"]) => {
Expand Down
18 changes: 9 additions & 9 deletions e2e/webpage/index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/main.ts"></script>
</body>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/main.ts"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion e2e/webpage/vite.config.js → e2e/webpage/vite.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import path from "path";
import { defineConfig } from "vite";
import baseConfig from "../../vite.config";
import baseConfig from "../../vite.config.mjs";

export default defineConfig((...args) => {
const config = baseConfig(...args);
Expand Down
18 changes: 9 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/dev/main.ts"></script>
</body>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/dev/main.ts"></script>
</body>
</html>
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,34 @@
"build:dev": "vite build --mode development && npm run types",
"release": "standard-version",
"test": "vitest",
"e2e:page": "vite -c e2e/webpage/vite.config.js",
"e2e:page": "vite -c e2e/webpage/vite.config.mjs",
"e2e": "playwright test"
},
"peerDependencies": {
"white-web-sdk": ">= 2.16"
},
"dependencies": {
"lodash-es": "^4.17.21",
"remitter": "^0.2.6",
"side-effect-manager": "^1.1.3",
"value-enhancer": "^1.3.0"
"remitter": "^0.3.3",
"side-effect-manager": "^1.2.2",
"value-enhancer": "^3.1.2"
},
"devDependencies": {
"@playwright/test": "^1.23.2",
"@types/lodash-es": "^4.17.6",
"@types/node": "^18.0.3",
"@typescript-eslint/eslint-plugin": "^5.27.1",
"@typescript-eslint/parser": "^5.27.1",
"@playwright/test": "^1.39.0",
"@types/lodash-es": "^4.17.11",
"@types/node": "^18.18.9",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"cross-env": "^7.0.3",
"dotenv": "^16.0.1",
"eslint": "^8.17.0",
"eslint-config-prettier": "^8.5.0",
"prettier": "^2.6.2",
"rollup-plugin-exclude-dependencies-from-bundle": "^1.1.22",
"dotenv": "^16.3.1",
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
"prettier": "^3.0.3",
"rollup-plugin-exclude-dependencies-from-bundle": "^1.1.23",
"standard-version": "^9.5.0",
"typescript": "^4.7.3",
"vite": "^2.9.10",
"vitest": "^0.18.0",
"white-web-sdk": "^2.16.24"
"typescript": "^5.2.2",
"vite": "^4.5.0",
"vitest": "^0.34.6",
"white-web-sdk": "^2.16.46"
}
}
2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const config: PlaywrightTestConfig = {
retries: process.env.CI ? 2 : 0,
use: {
trace: "on-first-retry",
baseURL: "http://localhost:3000",
baseURL: "http://localhost:5173",
headless: true,
},
timeout: 5 * 60 * 1000,
Expand Down
Loading

0 comments on commit c5b23f9

Please sign in to comment.