Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into player/use-event-sender
Browse files Browse the repository at this point in the history
  • Loading branch information
enjikaka committed Apr 5, 2024
2 parents 8674ec1 + b8f4f67 commit f987a41
Show file tree
Hide file tree
Showing 14 changed files with 645 additions and 540 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/fossa-scan.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: FOSSA Scans

on:
push:
workflow_call:

jobs:
Expand All @@ -14,6 +15,7 @@ jobs:
uses: fossas/[email protected]
with:
api-key: ${{secrets.FOSSAAPIKEY}}
debug: true

- name: "FOSSA Tests"
id: fossa-tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trigger-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v43
uses: tj-actions/changed-files@v44
with:
files: packages/**/package.json
- name: Build matrix input
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.11.1
20.12.0
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"eslint": "8.57.0",
"eslint-config-tidal": "3.2.0",
"eslint-plugin-disable-autofix": "4.2.0",
"eslint-plugin-jsdoc": "48.2.1",
"eslint-plugin-jsdoc": "48.2.2",
"typedoc": "0.25.12"
},
"engines": {
Expand Down
6 changes: 3 additions & 3 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
"devDependencies": {
"@vitest/coverage-v8": "1.4.0",
"@vitest/ui": "1.4.0",
"typescript": "5.4.2",
"vite": "5.1.6",
"vite-plugin-dts": "3.7.3",
"typescript": "5.4.3",
"vite": "5.2.7",
"vite-plugin-dts": "3.8.1",
"vitest": "1.4.0"
}
}
6 changes: 3 additions & 3 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
"@tidal-music/event-producer": "workspace:*",
"@vitest/coverage-v8": "1.4.0",
"@vitest/ui": "1.4.0",
"typescript": "5.4.2",
"vite": "5.1.6",
"vite-plugin-dts": "3.7.3",
"typescript": "5.4.3",
"vite": "5.2.7",
"vite-plugin-dts": "3.8.1",
"vitest": "1.4.0"
}
}
10 changes: 5 additions & 5 deletions packages/event-producer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tidal-music/event-producer",
"version": "2.0.3",
"version": "2.0.4",
"type": "module",
"files": [
"dist"
Expand Down Expand Up @@ -39,10 +39,10 @@
"@vitest/coverage-v8": "1.4.0",
"@vitest/ui": "1.4.0",
"@vitest/web-worker": "1.4.0",
"happy-dom": "13.9.0",
"typescript": "5.4.2",
"vite": "5.1.6",
"vite-plugin-dts": "3.7.3",
"happy-dom": "14.3.9",
"typescript": "5.4.3",
"vite": "5.2.7",
"vite-plugin-dts": "3.8.1",
"vitest": "1.4.0",
"xml-js": "1.6.11"
},
Expand Down
6 changes: 5 additions & 1 deletion packages/event-producer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import * as send from './send/send';
import { submitEvents } from './submit/submit';
import type { SentEvent } from './types';

export { setConsentCategory, setCredentialsProvider } from './config';
export {
getConfig,
setConsentCategory,
setCredentialsProvider,
} from './config';
export type * from './types';

/**
Expand Down
6 changes: 3 additions & 3 deletions packages/player-web-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
"@tidal-music/player": "workspace:^",
"@vitest/coverage-v8": "1.4.0",
"@vitest/ui": "1.4.0",
"typescript": "5.4.2",
"vite": "5.1.6",
"vite-plugin-dts": "3.7.3",
"typescript": "5.4.3",
"vite": "5.2.7",
"vite-plugin-dts": "3.8.1",
"vitest": "1.4.0"
}
}
18 changes: 9 additions & 9 deletions packages/player/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tidal-music/player",
"version": "0.1.3",
"version": "0.1.4",
"description": "Player logic for TIDAL",
"type": "module",
"exports": {
Expand Down Expand Up @@ -46,8 +46,8 @@
}
],
"devDependencies": {
"@babel/preset-env": "7.24.0",
"@babel/preset-typescript": "7.23.3",
"@babel/preset-env": "7.24.3",
"@babel/preset-typescript": "7.24.1",
"@rollup/plugin-babel": "6.0.4",
"@rollup/plugin-commonjs": "25.0.7",
"@rollup/plugin-node-resolve": "15.2.3",
Expand All @@ -60,23 +60,23 @@
"@tidal-music/true-time": "workspace:^",
"@types/js-levenshtein": "1.1.3",
"@types/mocha": "10.0.6",
"@types/node": "20.11.28",
"@types/node": "20.12.2",
"@types/sinon": "17.0.3",
"@web/dev-server-esbuild": "1.0.2",
"@web/dev-server-rollup": "0.6.1",
"@web/test-runner": "0.18.1",
"bowser": "2.11.0",
"chai": "5.1.0",
"cypress": "13.7.0",
"cypress": "13.7.1",
"esbuild": "0.20.2",
"js-levenshtein": "1.1.6",
"mux.js": "6.3.0",
"rollup": "4.13.0",
"rollup": "4.13.2",
"shaka-player": "4.7.11",
"sinon": "17.0.1",
"typescript": "5.4.2",
"vite": "5.1.6",
"vite-plugin-dts": "3.7.3",
"typescript": "5.4.3",
"vite": "5.2.7",
"vite-plugin-dts": "3.8.1",
"vitest": "1.4.0"
}
}
34 changes: 29 additions & 5 deletions packages/player/src/internal/helpers/event-session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,38 @@ class EventSessionDB {
* debounce multiple calls to this method.
*/
async #ensureDatabase() {
const isExisting = (await window.indexedDB.databases())
.map(db => db.name)
.includes(this.#name);
let isExisting = false;

if (this.#openingDatabase) {
await this.#openingDatabase;
} else if (!isExisting) {
await this.#createNewDatabase();
} else {
// Attempt to open the database
this.#openingDatabase = new Promise<void>((resolve, reject) => {
const request = window.indexedDB.open(this.#name);

// This event means the database was found and successfully opened
request.onsuccess = () => {
isExisting = true; // Database exists
resolve();
request.result.close(); // Close the database connection
};

// This event means the database does not exist and is being created
request.onupgradeneeded = () => {
isExisting = false; // Trigger database creation
};

request.onerror = () => {
reject(request.error);
};
});

await this.#openingDatabase;

// If database didn't exist, create it
if (!isExisting) {
await this.#createNewDatabase();
}
}
}

Expand Down
6 changes: 3 additions & 3 deletions packages/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
"devDependencies": {
"@vitest/coverage-v8": "1.4.0",
"@vitest/ui": "1.4.0",
"typescript": "5.4.2",
"vite": "5.1.6",
"vite-plugin-dts": "3.7.3",
"typescript": "5.4.3",
"vite": "5.2.7",
"vite-plugin-dts": "3.8.1",
"vitest": "1.4.0"
}
}
6 changes: 3 additions & 3 deletions packages/true-time/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"devDependencies": {
"@vitest/coverage-v8": "1.4.0",
"@vitest/ui": "1.4.0",
"typescript": "5.4.2",
"vite": "5.1.6",
"vite-plugin-dts": "3.7.3",
"typescript": "5.4.3",
"vite": "5.2.7",
"vite-plugin-dts": "3.8.1",
"vitest": "1.4.0"
},
"files": [
Expand Down
Loading

0 comments on commit f987a41

Please sign in to comment.