From ceaff6da0845c562b1a03a190850d620d118c67f Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Thu, 4 Apr 2024 16:56:20 +0200 Subject: [PATCH 1/6] Tweak getSharedBuildConfiguration --- cmcd/rollup.config.mjs | 2 +- conviva/rollup.config.mjs | 2 +- nielsen/rollup.config.mjs | 2 +- tools/build.mjs | 4 ++-- yospace/rollup.config.mjs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmcd/rollup.config.mjs b/cmcd/rollup.config.mjs index 570798e8..07c53377 100644 --- a/cmcd/rollup.config.mjs +++ b/cmcd/rollup.config.mjs @@ -10,4 +10,4 @@ const banner = ` * THEOplayer CMCD Connector v${version} */`.trim(); -export default getSharedBuildConfiguration(fileName, globalName, banner); +export default getSharedBuildConfiguration({ fileName, globalName, banner }); diff --git a/conviva/rollup.config.mjs b/conviva/rollup.config.mjs index a9f8ae73..371eba9b 100644 --- a/conviva/rollup.config.mjs +++ b/conviva/rollup.config.mjs @@ -11,4 +11,4 @@ const banner = ` */`.trim(); -export default getSharedBuildConfiguration(fileName, globalName, banner); +export default getSharedBuildConfiguration({ fileName, globalName, banner }); diff --git a/nielsen/rollup.config.mjs b/nielsen/rollup.config.mjs index 30a21542..c2b093ce 100644 --- a/nielsen/rollup.config.mjs +++ b/nielsen/rollup.config.mjs @@ -11,4 +11,4 @@ const banner = ` * Nielsen Web Connector v${version} */`.trim(); -export default getSharedBuildConfiguration(fileName, globalName, banner); +export default getSharedBuildConfiguration({ fileName, globalName, banner }); diff --git a/tools/build.mjs b/tools/build.mjs index d1bf5c63..c2edbbc1 100644 --- a/tools/build.mjs +++ b/tools/build.mjs @@ -4,7 +4,7 @@ import commonjs from "@rollup/plugin-commonjs"; import typescript from "@rollup/plugin-typescript"; import dts from "rollup-plugin-dts"; -export function getSharedBuildConfiguration(fileName, globalName, banner) { +export function getSharedBuildConfiguration({ fileName, globalName, banner }) { return defineConfig([{ input: { [fileName]: "src/index.ts" @@ -58,4 +58,4 @@ export function getSharedBuildConfiguration(fileName, globalName, banner) { }) ] }]); -} \ No newline at end of file +} diff --git a/yospace/rollup.config.mjs b/yospace/rollup.config.mjs index a815f84f..d575d428 100644 --- a/yospace/rollup.config.mjs +++ b/yospace/rollup.config.mjs @@ -10,4 +10,4 @@ const banner = ` * THEOplayer Yospace Connector v${version} */`.trim(); -export default getSharedBuildConfiguration(fileName, globalName, banner); \ No newline at end of file +export default getSharedBuildConfiguration({ fileName, globalName, banner }); From 15e0a0d8479e42dc1555c7a5d4e61337cca96784 Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Thu, 4 Apr 2024 16:56:59 +0200 Subject: [PATCH 2/6] Run Prettier --- tools/build.mjs | 117 +++++++++++++++++++++++++----------------------- 1 file changed, 60 insertions(+), 57 deletions(-) diff --git a/tools/build.mjs b/tools/build.mjs index c2edbbc1..a7e535b6 100644 --- a/tools/build.mjs +++ b/tools/build.mjs @@ -1,61 +1,64 @@ -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"; +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 }) { - return defineConfig([{ - input: { - [fileName]: "src/index.ts" - }, - output: [ - { - dir: "dist", - entryFileNames: "[name].umd.js", - name: globalName, - format: "umd", - indent: false, - banner, - globals: {theoplayer: "THEOplayer"} +export function getSharedBuildConfiguration({ fileName, globalName, banner = [] }) { + return defineConfig([ + { + input: { + [fileName]: 'src/index.ts' }, - { - dir: "dist", - entryFileNames: "[name].esm.js", - format: "esm", - indent: false, - banner - } - ], - plugins: [ - nodeResolve({ - extensions: [".ts", ".js"] - }), - commonjs({ - include: ['node_modules/**', '../node_modules/**'] - }), - typescript({ - tsconfig: "tsconfig.json", - module: "es2015", - include: ["src/**/*"] - }) - ] - }, { - input: { - [fileName]: "src/index.ts" + output: [ + { + dir: 'dist', + entryFileNames: '[name].umd.js', + name: globalName, + format: 'umd', + indent: false, + banner, + globals: { theoplayer: 'THEOplayer' } + }, + { + dir: 'dist', + entryFileNames: '[name].esm.js', + format: 'esm', + indent: false, + banner + } + ], + plugins: [ + nodeResolve({ + extensions: ['.ts', '.js'] + }), + commonjs({ + include: ['node_modules/**', '../node_modules/**'] + }), + typescript({ + tsconfig: 'tsconfig.json', + module: 'es2015', + include: ['src/**/*'] + }) + ] }, - output: [ - { - dir: "dist", - format: "esm", - banner, - footer: `export as namespace ${globalName};` - } - ], - plugins: [ - dts({ - tsconfig: "tsconfig.json", - }) - ] - }]); + { + input: { + [fileName]: 'src/index.ts' + }, + output: [ + { + dir: 'dist', + format: 'esm', + banner, + footer: `export as namespace ${globalName};` + } + ], + plugins: [ + dts({ + tsconfig: 'tsconfig.json' + }) + ] + } + ]); } From 94d9c4fb75a9d267f537cc0caacefce30d961ec5 Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Thu, 4 Apr 2024 16:59:07 +0200 Subject: [PATCH 3/6] Don't bundle THEOplayer --- tools/build.mjs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/build.mjs b/tools/build.mjs index a7e535b6..c5666101 100644 --- a/tools/build.mjs +++ b/tools/build.mjs @@ -28,6 +28,7 @@ export function getSharedBuildConfiguration({ fileName, globalName, banner = [] banner } ], + external: ['theoplayer'], plugins: [ nodeResolve({ extensions: ['.ts', '.js'] @@ -54,6 +55,7 @@ export function getSharedBuildConfiguration({ fileName, globalName, banner = [] footer: `export as namespace ${globalName};` } ], + external: ['theoplayer'], plugins: [ dts({ tsconfig: 'tsconfig.json' From 94065fef8a038f023e7340a0ae5b314284e0ded0 Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Thu, 4 Apr 2024 16:59:42 +0200 Subject: [PATCH 4/6] Don't bundle peer dependencies inside Conviva connector --- conviva/rollup.config.mjs | 8 ++++++-- tools/build.mjs | 8 ++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/conviva/rollup.config.mjs b/conviva/rollup.config.mjs index 371eba9b..562d78d6 100644 --- a/conviva/rollup.config.mjs +++ b/conviva/rollup.config.mjs @@ -9,6 +9,10 @@ const banner = ` /** * THEOplayer Conviva Connector v${version} */`.trim(); +const external = ['@convivainc/conviva-js-coresdk', '@theoplayer/yospace-connector-web']; +const globals = { + '@convivainc/conviva-js-coresdk': 'Conviva', + '@theoplayer/yospace-connector-web': 'THEOplayerYospaceConnector' +}; - -export default getSharedBuildConfiguration({ fileName, globalName, banner }); +export default getSharedBuildConfiguration({ fileName, globalName, banner, external, globals }); diff --git a/tools/build.mjs b/tools/build.mjs index c5666101..7d4bbf90 100644 --- a/tools/build.mjs +++ b/tools/build.mjs @@ -4,7 +4,7 @@ import commonjs from '@rollup/plugin-commonjs'; import typescript from '@rollup/plugin-typescript'; import dts from 'rollup-plugin-dts'; -export function getSharedBuildConfiguration({ fileName, globalName, banner = [] }) { +export function getSharedBuildConfiguration({ fileName, globalName, banner, external, globals }) { return defineConfig([ { input: { @@ -18,7 +18,7 @@ export function getSharedBuildConfiguration({ fileName, globalName, banner = [] format: 'umd', indent: false, banner, - globals: { theoplayer: 'THEOplayer' } + globals: { theoplayer: 'THEOplayer', ...(globals ?? {}) } }, { dir: 'dist', @@ -28,7 +28,7 @@ export function getSharedBuildConfiguration({ fileName, globalName, banner = [] banner } ], - external: ['theoplayer'], + external: ['theoplayer', ...(external ?? [])], plugins: [ nodeResolve({ extensions: ['.ts', '.js'] @@ -55,7 +55,7 @@ export function getSharedBuildConfiguration({ fileName, globalName, banner = [] footer: `export as namespace ${globalName};` } ], - external: ['theoplayer'], + external: ['theoplayer', ...(external ?? [])], plugins: [ dts({ tsconfig: 'tsconfig.json' From a53f8c031011009d053aeb5bed52dbe653b3ae48 Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Thu, 4 Apr 2024 18:01:15 +0200 Subject: [PATCH 5/6] Update package lock --- package-lock.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index e56e9466..22d48e04 100644 --- a/package-lock.json +++ b/package-lock.json @@ -52,14 +52,14 @@ }, "conviva": { "name": "@theoplayer/conviva-connector-web", - "version": "2.0.0", + "version": "2.0.1", "license": "MIT", "dependencies": { "@convivainc/conviva-js-coresdk": "^4.7.4" }, "peerDependencies": { "@theoplayer/yospace-connector-web": "^2.1.0", - "theoplayer": "^5.0.0 || ^6.0.0" + "theoplayer": "^5.0.0 || ^6.0.0 || ^7.0.0" }, "peerDependenciesMeta": { "@theoplayer/yospace-connector-web": { @@ -69,10 +69,10 @@ }, "nielsen": { "name": "@theoplayer/nielsen-connector-web", - "version": "1.1.0", + "version": "1.1.2", "license": "MIT", "peerDependencies": { - "theoplayer": "^5.0.0 || ^6.0.0" + "theoplayer": "^5.0.0 || ^6.0.0 || ^7.0.0" } }, "node_modules/@aashutoshrathi/word-wrap": { From ef2fac96a2a2b3eaa251a16d76408aa1afbe9772 Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Thu, 4 Apr 2024 18:01:20 +0200 Subject: [PATCH 6/6] Add changeset --- .changeset/thick-carpets-laugh.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/thick-carpets-laugh.md diff --git a/.changeset/thick-carpets-laugh.md b/.changeset/thick-carpets-laugh.md new file mode 100644 index 00000000..d134afa1 --- /dev/null +++ b/.changeset/thick-carpets-laugh.md @@ -0,0 +1,5 @@ +--- +"@theoplayer/conviva-connector-web": patch +--- + +Fixed an issue where the THEOplayer library and the Yospace connector were accidentally bundled together with the Conviva connector.