diff --git a/.changeset/hungry-crabs-report.md b/.changeset/hungry-crabs-report.md
new file mode 100644
index 00000000..2dd63fbd
--- /dev/null
+++ b/.changeset/hungry-crabs-report.md
@@ -0,0 +1,6 @@
+---
+"@theoplayer/yospace-connector-web": patch
+"@theoplayer/cmcd-connector-web": patch
+---
+
+Fix missing API types in TypeScript type definitions.
diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml
new file mode 100644
index 00000000..e4e159ab
--- /dev/null
+++ b/.github/workflows/pages.yml
@@ -0,0 +1,51 @@
+# Based on https://github.com/actions/starter-workflows/blob/b53d05e4b0dde7cdaeda60476acfcaaa1713f8cc/pages/jekyll-gh-pages.yml
+name: GitHub Pages
+
+on:
+ # Runs on pushes targeting the default branch
+ push:
+ branches:
+ - main
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
+permissions:
+ contents: read
+ pages: write
+ id-token: write
+
+# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
+# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
+concurrency:
+ group: 'pages'
+ cancel-in-progress: false
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ - name: Setup Pages
+ uses: actions/configure-pages@v4
+ - name: Setup Node.js environment
+ uses: actions/setup-node@v4
+ with:
+ node-version: 20
+ - name: Install dependencies
+ run: npm ci --workspaces --include-workspace-root
+ - name: Build API docs
+ run: npm run docs -- --out ./_site/api
+ - name: Upload artifact
+ uses: actions/upload-pages-artifact@v3
+ deploy:
+ runs-on: ubuntu-latest
+ needs: build
+ steps:
+ - name: Deploy to GitHub Pages
+ id: deployment
+ uses: actions/deploy-pages@v4
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 00000000..f007c629
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,29 @@
+name: Test
+on:
+ push:
+ branches:
+ - main
+ paths-ignore:
+ - '**.md'
+ pull_request:
+ types: [opened, reopened, synchronize]
+ paths-ignore:
+ - '**.md'
+jobs:
+ test:
+ name: Test
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ - name: Setup Node.js 20
+ uses: actions/setup-node@v4
+ with:
+ node-version: 20
+ cache: 'npm'
+ - name: Install dependencies
+ run: npm ci --workspaces --include-workspace-root
+ - name: Build
+ run: npm run build
+ - name: Test
+ run: npm test
diff --git a/.gitignore b/.gitignore
index c28de259..00b4b349 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,6 @@ node_modules/
# Generated by MacOS
.DS_Store
+
+# TypeDoc
+api/
diff --git a/.idea/web-connectors.iml b/.idea/web-connectors.iml
index a92d84c5..447c428e 100644
--- a/.idea/web-connectors.iml
+++ b/.idea/web-connectors.iml
@@ -9,6 +9,7 @@
+
diff --git a/.prettierignore b/.prettierignore
index fb190ee6..ac2ee5ae 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -1,2 +1,5 @@
*/dist/
-*/test/pages/
\ No newline at end of file
+*/test/pages/
+
+# TypeDoc
+api/
diff --git a/README.md b/README.md
new file mode 100644
index 00000000..ae1f9af8
--- /dev/null
+++ b/README.md
@@ -0,0 +1,21 @@
+# THEOplayer Web SDK Connectors
+
+This repository is maintained by [THEO Technologies](https://www.theoplayer.com/) and contains the different connectors
+available for the THEOplayer Web SDK.
+
+The THEOplayer Web SDK enables you to quickly deliver content playback on your website or web app.
+
+Using the available connectors allows you to augment the features delivered through the Web SDK.
+
+## Available Connectors
+
+| Connector | npm package | Source code |
+|:----------|:-----------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------|
+| CMCD | ![@theoplayer/cmcd-connector-web](https://img.shields.io/npm/v/%40theoplayer%2Fcmcd-connector-web?label=%40theoplayer%2Fcmcd-connector-web) | [cmcd](https://github.com/THEOplayer/web-connectors/tree/main/cmcd) |
+| Conviva | ![@theoplayer/conviva-connector-web](https://img.shields.io/npm/v/%40theoplayer%2Fconviva-connector-web?label=%40theoplayer%2Fconviva-connector-web) | [conviva](https://github.com/THEOplayer/web-connectors/tree/main/conviva) |
+| Nielsen | ![@theoplayer/nielsen-connector-web](https://img.shields.io/npm/v/%40theoplayer%2Fnielsen-connector-web?label=%40theoplayer%2Fnielsen-connector-web) | [nielsen](https://github.com/THEOplayer/web-connectors/tree/main/nielsen) |
+| Yospace | ![@theoplayer/yospace-connector-web](https://img.shields.io/npm/v/%40theoplayer%2Fyospace-connector-web?label=%40theoplayer%2Fyospace-connector-web) | [yospace](https://github.com/THEOplayer/web-connectors/tree/main/yospace) |
+
+## License
+
+The contents of this package are subject to the [THEOplayer license](https://www.theoplayer.com/terms).
diff --git a/cmcd/package.json b/cmcd/package.json
index 38bf9d83..83c30512 100644
--- a/cmcd/package.json
+++ b/cmcd/package.json
@@ -10,10 +10,10 @@
},
"homepage": "https://theoplayer.com/",
"module": "dist/cmcd-connector.esm.js",
- "types": "dist/cmcd-connector.d.ts",
+ "types": "dist/types/index.d.ts",
"exports": {
".": {
- "types": "./dist/cmcd-connector.d.ts",
+ "types": "./dist/types/index.d.ts",
"import": "./dist/cmcd-connector.esm.js",
"require": "./dist/cmcd-connector.umd.js"
},
diff --git a/cmcd/src/index.ts b/cmcd/src/index.ts
index 3faa1eef..47f6c64e 100644
--- a/cmcd/src/index.ts
+++ b/cmcd/src/index.ts
@@ -1,15 +1,3 @@
-import { CMCDObjectType, CMCDPayload, CMCDReservedKey, CMCDStreamingFormat, CMCDStreamType } from './CMCDPayload';
-import { TransmissionMode } from './Configuration';
-import { CMCDConnector, CMCDPayloadProcessor, createCMCDConnector } from './CMCDConnector';
-
-export {
- CMCDConnector,
- createCMCDConnector,
- CMCDPayloadProcessor,
- TransmissionMode,
- CMCDPayload,
- CMCDReservedKey,
- CMCDStreamingFormat,
- CMCDObjectType,
- CMCDStreamType
-};
+export { CMCDObjectType, CMCDPayload, CMCDReservedKey, CMCDStreamingFormat, CMCDStreamType } from './CMCDPayload';
+export * from './Configuration';
+export { CMCDConnector, CMCDPayloadProcessor, createCMCDConnector } from './CMCDConnector';
diff --git a/cmcd/tsconfig.json b/cmcd/tsconfig.json
index 5fd53772..d416c1ae 100644
--- a/cmcd/tsconfig.json
+++ b/cmcd/tsconfig.json
@@ -1,13 +1,11 @@
{
+ "extends": "../tsconfig.base.json",
"compilerOptions": {
- "target": "es5",
- "module": "commonjs",
- "strict": true,
- "baseUrl": "./",
- "rootDir": ".",
- "paths": { "THEOplayer": ["./src/THEOplayer"] },
- "esModuleInterop": true,
- "skipLibCheck": true,
- "forceConsistentCasingInFileNames": true
- }
+ "rootDir": "src",
+ "outDir": "dist",
+ "declarationDir": "dist/types"
+ },
+ "include": [
+ "src/**/*"
+ ]
}
diff --git a/cmcd/typedoc.json b/cmcd/typedoc.json
new file mode 100644
index 00000000..4ac91d8e
--- /dev/null
+++ b/cmcd/typedoc.json
@@ -0,0 +1,12 @@
+{
+ "$schema": "https://typedoc.org/schema.json",
+ "extends": [
+ "../typedoc.base.json"
+ ],
+ "entryPoints": [
+ "src/index.ts"
+ ],
+ "tsconfig": "tsconfig.json",
+ "readme": "README.md",
+ "name": "CMCD Connector"
+}
diff --git a/conviva/package.json b/conviva/package.json
index b56a9bc1..e2276817 100644
--- a/conviva/package.json
+++ b/conviva/package.json
@@ -6,10 +6,10 @@
"repository": "https://github.com/THEOplayer/conviva-connector-web",
"homepage": "https://theoplayer.com/",
"module": "dist/conviva-connector.esm.js",
- "types": "dist/conviva-connector.d.ts",
+ "types": "dist/types/index.d.ts",
"exports": {
".": {
- "types": "./dist/conviva-connector.d.ts",
+ "types": "./dist/types/index.d.ts",
"import": "./dist/conviva-connector.esm.js",
"require": "./dist/conviva-connector.umd.js"
},
diff --git a/conviva/tsconfig.json b/conviva/tsconfig.json
index 5fd53772..d416c1ae 100644
--- a/conviva/tsconfig.json
+++ b/conviva/tsconfig.json
@@ -1,13 +1,11 @@
{
+ "extends": "../tsconfig.base.json",
"compilerOptions": {
- "target": "es5",
- "module": "commonjs",
- "strict": true,
- "baseUrl": "./",
- "rootDir": ".",
- "paths": { "THEOplayer": ["./src/THEOplayer"] },
- "esModuleInterop": true,
- "skipLibCheck": true,
- "forceConsistentCasingInFileNames": true
- }
+ "rootDir": "src",
+ "outDir": "dist",
+ "declarationDir": "dist/types"
+ },
+ "include": [
+ "src/**/*"
+ ]
}
diff --git a/conviva/typedoc.json b/conviva/typedoc.json
new file mode 100644
index 00000000..547c6c6f
--- /dev/null
+++ b/conviva/typedoc.json
@@ -0,0 +1,12 @@
+{
+ "$schema": "https://typedoc.org/schema.json",
+ "extends": [
+ "../typedoc.base.json"
+ ],
+ "entryPoints": [
+ "src/index.ts"
+ ],
+ "tsconfig": "tsconfig.json",
+ "readme": "README.md",
+ "name": "Conviva Connector"
+}
diff --git a/nielsen/package.json b/nielsen/package.json
index 45aee86e..cd3eb54f 100644
--- a/nielsen/package.json
+++ b/nielsen/package.json
@@ -4,10 +4,10 @@
"description": "A connector implementing Nielsen with THEOplayer.",
"main": "dist/nielsen-connector.umd.js",
"module": "dist/nielsen-connector.esm.js",
- "types": "dist/nielsen-connector.d.ts",
+ "types": "dist/types/index.d.ts",
"exports": {
".": {
- "types": "./dist/nielsen-connector.d.ts",
+ "types": "./dist/types/index.d.ts",
"import": "./dist/nielsen-connector.esm.js",
"require": "./dist/nielsen-connector.umd.js"
},
diff --git a/nielsen/tsconfig.json b/nielsen/tsconfig.json
index 5fd53772..d416c1ae 100644
--- a/nielsen/tsconfig.json
+++ b/nielsen/tsconfig.json
@@ -1,13 +1,11 @@
{
+ "extends": "../tsconfig.base.json",
"compilerOptions": {
- "target": "es5",
- "module": "commonjs",
- "strict": true,
- "baseUrl": "./",
- "rootDir": ".",
- "paths": { "THEOplayer": ["./src/THEOplayer"] },
- "esModuleInterop": true,
- "skipLibCheck": true,
- "forceConsistentCasingInFileNames": true
- }
+ "rootDir": "src",
+ "outDir": "dist",
+ "declarationDir": "dist/types"
+ },
+ "include": [
+ "src/**/*"
+ ]
}
diff --git a/nielsen/typedoc.json b/nielsen/typedoc.json
new file mode 100644
index 00000000..b1076f68
--- /dev/null
+++ b/nielsen/typedoc.json
@@ -0,0 +1,12 @@
+{
+ "$schema": "https://typedoc.org/schema.json",
+ "extends": [
+ "../typedoc.base.json"
+ ],
+ "entryPoints": [
+ "src/index.ts"
+ ],
+ "tsconfig": "tsconfig.json",
+ "readme": "README.md",
+ "name": "Nielsen Connector"
+}
diff --git a/package-lock.json b/package-lock.json
index e181a6c4..2015104e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -30,18 +30,20 @@
"prettier": "^3.2.4",
"rimraf": "^5.0.5",
"rollup": "^4.14.0",
- "rollup-plugin-dts": "^6.1.0",
"theoplayer": "^7.0.0",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"tslib": "^2.6.2",
+ "typedoc": "^0.25.12",
+ "typedoc-plugin-external-resolver": "^1.0.3",
+ "typedoc-plugin-mdn-links": "^3.1.19",
"typescript": "^5.4.3",
"typescript-eslint": "^7.5.0"
}
},
"cmcd": {
"name": "@theoplayer/cmcd-connector-web",
- "version": "1.0.0",
+ "version": "1.0.1",
"license": "MIT",
"peerDependencies": {
"theoplayer": "^5.0.0 || ^6.0.0 || ^7.0.0"
@@ -49,13 +51,13 @@
},
"conviva": {
"name": "@theoplayer/conviva-connector-web",
- "version": "2.0.1",
+ "version": "2.0.2",
"license": "MIT",
"dependencies": {
"@convivainc/conviva-js-coresdk": "^4.7.4"
},
"peerDependencies": {
- "@theoplayer/yospace-connector-web": "^2.1.0",
+ "@theoplayer/yospace-connector-web": "^2.1.1",
"theoplayer": "^5.0.0 || ^6.0.0 || ^7.0.0"
},
"peerDependenciesMeta": {
@@ -2644,6 +2646,12 @@
"node": ">=8"
}
},
+ "node_modules/ansi-sequence-parser": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz",
+ "integrity": "sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==",
+ "dev": true
+ },
"node_modules/ansi-styles": {
"version": "4.3.0",
"dev": true,
@@ -5840,6 +5848,12 @@
"node": ">=6"
}
},
+ "node_modules/jsonc-parser": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz",
+ "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==",
+ "dev": true
+ },
"node_modules/jsonfile": {
"version": "4.0.0",
"dev": true,
@@ -5981,6 +5995,12 @@
"yallist": "^3.0.2"
}
},
+ "node_modules/lunr": {
+ "version": "2.3.9",
+ "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz",
+ "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==",
+ "dev": true
+ },
"node_modules/magic-string": {
"version": "0.30.7",
"dev": true,
@@ -6030,6 +6050,18 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/marked": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz",
+ "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==",
+ "dev": true,
+ "bin": {
+ "marked": "bin/marked.js"
+ },
+ "engines": {
+ "node": ">= 12"
+ }
+ },
"node_modules/meow": {
"version": "6.1.1",
"dev": true,
@@ -7106,27 +7138,6 @@
"fsevents": "~2.3.2"
}
},
- "node_modules/rollup-plugin-dts": {
- "version": "6.1.0",
- "dev": true,
- "license": "LGPL-3.0",
- "dependencies": {
- "magic-string": "^0.30.4"
- },
- "engines": {
- "node": ">=16"
- },
- "funding": {
- "url": "https://github.com/sponsors/Swatinem"
- },
- "optionalDependencies": {
- "@babel/code-frame": "^7.22.13"
- },
- "peerDependencies": {
- "rollup": "^3.29.4 || ^4",
- "typescript": "^4.5 || ^5.0"
- }
- },
"node_modules/run-parallel": {
"version": "1.2.0",
"dev": true,
@@ -7280,6 +7291,18 @@
"node": ">=8"
}
},
+ "node_modules/shiki": {
+ "version": "0.14.7",
+ "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.7.tgz",
+ "integrity": "sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==",
+ "dev": true,
+ "dependencies": {
+ "ansi-sequence-parser": "^1.1.0",
+ "jsonc-parser": "^3.2.0",
+ "vscode-oniguruma": "^1.7.0",
+ "vscode-textmate": "^8.0.0"
+ }
+ },
"node_modules/side-channel": {
"version": "1.0.5",
"dev": true,
@@ -8112,6 +8135,46 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/typedoc": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.12.tgz",
+ "integrity": "sha512-F+qhkK2VoTweDXd1c42GS/By2DvI2uDF4/EpG424dTexSHdtCH52C6IcAvMA6jR3DzAWZjHpUOW+E02kyPNUNw==",
+ "dev": true,
+ "dependencies": {
+ "lunr": "^2.3.9",
+ "marked": "^4.3.0",
+ "minimatch": "^9.0.3",
+ "shiki": "^0.14.7"
+ },
+ "bin": {
+ "typedoc": "bin/typedoc"
+ },
+ "engines": {
+ "node": ">= 16"
+ },
+ "peerDependencies": {
+ "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x"
+ }
+ },
+ "node_modules/typedoc-plugin-external-resolver": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/typedoc-plugin-external-resolver/-/typedoc-plugin-external-resolver-1.0.3.tgz",
+ "integrity": "sha512-P73ZjN8fX3xQ2KpggrxhPIBg3ZyljhylHl69+lC0QRnyt4j9ijXFrorKjPPOU0Z63cm0Annd89Aejf4SMNo3kA==",
+ "dev": true,
+ "peerDependencies": {
+ "typedoc": "0.25.x",
+ "typescript": "4.x || 5.x"
+ }
+ },
+ "node_modules/typedoc-plugin-mdn-links": {
+ "version": "3.1.19",
+ "resolved": "https://registry.npmjs.org/typedoc-plugin-mdn-links/-/typedoc-plugin-mdn-links-3.1.19.tgz",
+ "integrity": "sha512-v08h/JorBemjl6xQyw+tB1P5BX2OUI9zr9vR5ZTuLsmETUrS3NC2z6ou8Ci0FDjSL0nA1tGsdXhUn42sEgkkUA==",
+ "dev": true,
+ "peerDependencies": {
+ "typedoc": ">= 0.23.14 || 0.24.x || 0.25.x"
+ }
+ },
"node_modules/typescript": {
"version": "5.4.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.4.tgz",
@@ -8447,6 +8510,18 @@
"spdx-expression-parse": "^3.0.0"
}
},
+ "node_modules/vscode-oniguruma": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz",
+ "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==",
+ "dev": true
+ },
+ "node_modules/vscode-textmate": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-8.0.0.tgz",
+ "integrity": "sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==",
+ "dev": true
+ },
"node_modules/walker": {
"version": "1.0.8",
"dev": true,
@@ -8647,7 +8722,7 @@
},
"yospace": {
"name": "@theoplayer/yospace-connector-web",
- "version": "2.1.0",
+ "version": "2.1.1",
"license": "MIT",
"peerDependencies": {
"theoplayer": "^5.0.0 || ^6.0.0 || ^7.0.0"
diff --git a/package.json b/package.json
index d550f826..15f71885 100644
--- a/package.json
+++ b/package.json
@@ -16,11 +16,13 @@
"changeset:version": "changeset version && node .changeset/post-process.js",
"build": "npm run build --workspaces",
"clean": "npm run clean --workspaces",
- "test": "npm run test --workspaces",
+ "test": "npm run test --workspaces && npm run test:docs",
"prettier": "prettier --check \"*/(src|test)/**/*\"",
"prettier:fix": "prettier --write \"*/(src|test)/**/*\"",
"lint": "eslint \"*/src/**/*.ts\" \"*/test*/**/*.ts\"",
- "lint:fix": "npm run lint -- --fix"
+ "lint:fix": "npm run lint -- --fix",
+ "docs": "typedoc --treatWarningsAsErrors",
+ "test:docs": "npm run docs -- --emit none"
},
"devDependencies": {
"@changesets/cli": "^2.27.1",
@@ -38,11 +40,13 @@
"prettier": "^3.2.4",
"rimraf": "^5.0.5",
"rollup": "^4.14.0",
- "rollup-plugin-dts": "^6.1.0",
"theoplayer": "^7.0.0",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"tslib": "^2.6.2",
+ "typedoc": "^0.25.12",
+ "typedoc-plugin-external-resolver": "^1.0.3",
+ "typedoc-plugin-mdn-links": "^3.1.19",
"typescript": "^5.4.3",
"typescript-eslint": "^7.5.0"
}
diff --git a/tools/build.mjs b/tools/build.mjs
index 7d4bbf90..6b6fa7b3 100644
--- a/tools/build.mjs
+++ b/tools/build.mjs
@@ -2,7 +2,6 @@ import { defineConfig } from 'rollup';
import nodeResolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import typescript from '@rollup/plugin-typescript';
-import dts from 'rollup-plugin-dts';
export function getSharedBuildConfiguration({ fileName, globalName, banner, external, globals }) {
return defineConfig([
@@ -37,27 +36,6 @@ export function getSharedBuildConfiguration({ fileName, globalName, banner, exte
include: ['node_modules/**', '../node_modules/**']
}),
typescript({
- tsconfig: 'tsconfig.json',
- module: 'es2015',
- include: ['src/**/*']
- })
- ]
- },
- {
- input: {
- [fileName]: 'src/index.ts'
- },
- output: [
- {
- dir: 'dist',
- format: 'esm',
- banner,
- footer: `export as namespace ${globalName};`
- }
- ],
- external: ['theoplayer', ...(external ?? [])],
- plugins: [
- dts({
tsconfig: 'tsconfig.json'
})
]
diff --git a/tsconfig.base.json b/tsconfig.base.json
new file mode 100644
index 00000000..2f799823
--- /dev/null
+++ b/tsconfig.base.json
@@ -0,0 +1,15 @@
+{
+ "compilerOptions": {
+ "target": "es5",
+ "module": "es2015",
+ "moduleResolution": "bundler",
+ "declaration": true,
+ "strict": true,
+ "esModuleInterop": true,
+ "skipLibCheck": true,
+ "forceConsistentCasingInFileNames": true
+ },
+ "include": [
+ "src/**/*"
+ ]
+}
diff --git a/typedoc.base.json b/typedoc.base.json
new file mode 100644
index 00000000..0f592346
--- /dev/null
+++ b/typedoc.base.json
@@ -0,0 +1,21 @@
+{
+ "$schema": "https://typedoc.org/schema.json",
+ "includeVersion": true,
+ "plugin": [
+ "typedoc-plugin-external-resolver",
+ "typedoc-plugin-mdn-links"
+ ],
+ "navigationLinks": {
+ "Docs": "https://www.theoplayer.com/docs/",
+ "THEOplayer.com": "https://www.theoplayer.com/"
+ },
+ "githubPages": true,
+ "excludePrivate": true,
+ "excludeExternals": true,
+ "externalDocumentation": {
+ "theoplayer": {
+ "dtsPath": "~/THEOplayer.d.ts",
+ "externalBaseURL": "https://www.theoplayer.com/docs/theoplayer/v7/api-reference/web"
+ }
+ }
+}
diff --git a/typedoc.config.js b/typedoc.config.js
new file mode 100644
index 00000000..873c35b1
--- /dev/null
+++ b/typedoc.config.js
@@ -0,0 +1,12 @@
+const { workspaces } = require('./package.json');
+
+/** @type {import('typedoc').TypeDocOptions} */
+module.exports = {
+ extends: ['./typedoc.base.json'],
+ name: 'THEOplayer Web SDK Connectors',
+ entryPoints: workspaces.slice().sort(),
+ entryPointStrategy: 'packages',
+ includeVersion: false,
+ out: 'api',
+ sitemapBaseUrl: 'https://theoplayer.github.io/web-connectors/api/'
+};
diff --git a/yospace/package.json b/yospace/package.json
index b3be3b46..83b5f290 100644
--- a/yospace/package.json
+++ b/yospace/package.json
@@ -10,10 +10,10 @@
},
"homepage": "https://theoplayer.com/",
"module": "dist/yospace-connector.esm.js",
- "types": "dist/yospace-connector.d.ts",
+ "types": "dist/types/index.d.ts",
"exports": {
".": {
- "types": "./dist/yospace-connector.d.ts",
+ "types": "./dist/types/index.d.ts",
"import": "./dist/yospace-connector.esm.js",
"require": "./dist/yospace-connector.umd.js"
},
diff --git a/yospace/src/index.ts b/yospace/src/index.ts
index 899d3ddd..f6de165a 100644
--- a/yospace/src/index.ts
+++ b/yospace/src/index.ts
@@ -2,3 +2,9 @@ export * from './integration/YospaceConnector';
export { AnalyticEventObserver, SessionErrorCode } from './yospace/AnalyticEventObserver';
export * from './yospace/AdBreak';
export { SessionProperties } from './yospace/SessionProperties';
+export * from './yospace/PlayerEvent';
+export * from './yospace/TimedMetadata';
+export * from './yospace/TrackingError';
+export * from './yospace/YospaceSessionManager';
+export { Event } from './utils/event/Event';
+export * from './utils/event/EventDispatcher';
diff --git a/yospace/src/integration/YospaceConnector.ts b/yospace/src/integration/YospaceConnector.ts
index 05bcc70d..3368c66c 100644
--- a/yospace/src/integration/YospaceConnector.ts
+++ b/yospace/src/integration/YospaceConnector.ts
@@ -3,13 +3,13 @@ import { YospaceManager } from './YospaceManager';
import { SessionProperties } from '../yospace/SessionProperties';
import { AnalyticEventObserver } from '../yospace/AnalyticEventObserver';
import { EventDispatcher, EventListener, StringKeyOf } from '../utils/event/EventDispatcher';
-import { BaseEvent } from '../utils/event/Event';
+import { Event } from '../utils/event/Event';
export interface YospaceEventMap {
/**
* Fired when a new Yospace session starts.
*/
- sessionavailable: BaseEvent<'sessionavailable'>;
+ sessionavailable: Event<'sessionavailable'>;
}
export class YospaceConnector implements EventDispatcher {
diff --git a/yospace/src/yospace/AdBreak.ts b/yospace/src/yospace/AdBreak.ts
index 656a253e..6cd92725 100644
--- a/yospace/src/yospace/AdBreak.ts
+++ b/yospace/src/yospace/AdBreak.ts
@@ -5,7 +5,7 @@ export enum ResourceType {
UNKNOWN
}
-interface Resource {
+export interface Resource {
getByteData(): number[];
getCreativeType(): string;
getResourceType(): ResourceType;
diff --git a/yospace/tsconfig.json b/yospace/tsconfig.json
index 5fd53772..d416c1ae 100644
--- a/yospace/tsconfig.json
+++ b/yospace/tsconfig.json
@@ -1,13 +1,11 @@
{
+ "extends": "../tsconfig.base.json",
"compilerOptions": {
- "target": "es5",
- "module": "commonjs",
- "strict": true,
- "baseUrl": "./",
- "rootDir": ".",
- "paths": { "THEOplayer": ["./src/THEOplayer"] },
- "esModuleInterop": true,
- "skipLibCheck": true,
- "forceConsistentCasingInFileNames": true
- }
+ "rootDir": "src",
+ "outDir": "dist",
+ "declarationDir": "dist/types"
+ },
+ "include": [
+ "src/**/*"
+ ]
}
diff --git a/yospace/typedoc.json b/yospace/typedoc.json
new file mode 100644
index 00000000..8dde8e89
--- /dev/null
+++ b/yospace/typedoc.json
@@ -0,0 +1,12 @@
+{
+ "$schema": "https://typedoc.org/schema.json",
+ "extends": [
+ "../typedoc.base.json"
+ ],
+ "entryPoints": [
+ "src/index.ts"
+ ],
+ "tsconfig": "tsconfig.json",
+ "readme": "README.md",
+ "name": "Yospace Connector"
+}