From b029dc9af8b701956ab0a18b605400a50799c4de Mon Sep 17 00:00:00 2001 From: Steven Vancoillie Date: Tue, 21 Mar 2023 10:53:43 +0100 Subject: [PATCH] chore: add fallback package exports (#745) When using TypeScript the exports field is not working unless using moduleResolution node16, which we don't want to enforce. Instead, fallbacks are added back so that these projects can still use moduleResolution node. --- overlay/package.json | 3 +++ player/package.json | 3 +++ scripts/changelog.mjs | 6 ++++-- streams/package.json | 5 +++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/overlay/package.json b/overlay/package.json index 77085cd40..7454cf7e4 100644 --- a/overlay/package.json +++ b/overlay/package.json @@ -14,6 +14,9 @@ "publishConfig": { "registry": "https://registry.npmjs.org/" }, + "types": "./dist/index.d.ts", + "main": "./dist/index.cjs", + "module": "./dist/index.mjs", "exports": { "types": "./dist/index.d.ts", "require": "./dist/index.cjs", diff --git a/player/package.json b/player/package.json index 1ded1b36f..b1f008038 100644 --- a/player/package.json +++ b/player/package.json @@ -18,6 +18,9 @@ "publishConfig": { "registry": "https://registry.npmjs.org/" }, + "types": "./dist/index.d.ts", + "main": "./dist/index.cjs", + "module": "./dist/index.mjs", "exports": { "types": "./dist/index.d.ts", "require": "./dist/index.cjs", diff --git a/scripts/changelog.mjs b/scripts/changelog.mjs index bc7d3b1cc..f478ec0fb 100755 --- a/scripts/changelog.mjs +++ b/scripts/changelog.mjs @@ -17,8 +17,10 @@ const ChangeLogHeader = `# Changelog All notable changes to this project will be documented in this file. ` -const GitHubCompareUrl = 'https://github.com/AxisCommunications/media-stream-library-js/compare' -const GitHubCommitUrl = 'https://github.com/AxisCommunications/media-stream-library-js/commit' +const GitHubCompareUrl = + 'https://github.com/AxisCommunications/media-stream-library-js/compare' +const GitHubCommitUrl = + 'https://github.com/AxisCommunications/media-stream-library-js/commit' const GroupTitles = { 'build': '\u{1F477} Build', 'chore': '\u{1F6A7} Maintenance', diff --git a/streams/package.json b/streams/package.json index 51c8817e7..288e33cc6 100644 --- a/streams/package.json +++ b/streams/package.json @@ -16,6 +16,9 @@ "publishConfig": { "registry": "https://registry.npmjs.org/" }, + "types": "./dist/src/index.browser.d.ts", + "main": "./dist/node.cjs", + "module": "./dist/node.mjs", "exports": { "types": "./dist/src/index.browser.d.ts", "browser": { @@ -30,6 +33,8 @@ } }, "browser": { + "./dist/node.cjs": "./dist/browser.cjs", + "./dist/node.mjs": "./dist/browser.mjs", "stream": "stream-browserify" }, "files": [