Skip to content

Conversation

@Juanmalopezg
Copy link
Contributor

@Juanmalopezg Juanmalopezg commented Jan 26, 2025

As discussed in #31 and #36 , this PR adds a GitHub Actions workflow that publishes a new release package to the https://www.npmjs.com/org/moq-js npm repository. This enables distribution via:

npm i @moq-js/player

Note

I tested this behaviour by publishing to https://www.npmjs.com/package/@juanmanulpzg/player. Please check this temp commit in my fork repo to see the only differences compared to the current PR changes.

Considerations:

  • The workflow is triggered when a release is published in the https://github.com/englishm/moq-js repository (not on each main branch update).
  • Each new release should include an updated version field in package.json.

Feel free to suggest any improvements to these changes ✨

@Juanmalopezg Juanmalopezg mentioned this pull request Jan 26, 2025
@Juanmalopezg Juanmalopezg force-pushed the publish-to-npm-registry branch 7 times, most recently from 206d7cb to 7ca82bd Compare January 27, 2025 18:59
lib/package.json Outdated
{
"name": "moq-player",
"name": "@~englishm/moq-player",
"version": "0.0.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think 0.1.4 was the last @kixelated/moq release before the fork. I'm thinking maybe we start this at 0.2.0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! Done ✅

lib/package.json Outdated
@@ -1,10 +1,11 @@
{
"name": "moq-player",
"name": "@~englishm/moq-player",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After looking into how orgs work on npmjs, I created @moq-js. I was thinking maybe we could then name this package @moq-js/player. How does that sound? Or would @moq-js/moq-player be better?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, we even discuss this with @JoaquinBCh and @mcintyrehh that we could keep the package name just @moq-js/player by now and try to decouple the inner potential packages like @moq-js/publisher and @moq-js/transport later

lib/package.json Outdated
"license": "(MIT OR Apache-2.0)",
"wc-player": "video-moq/index.ts",
"simple-player": "playback/index.ts",
"files": ["dist" , "common" , "media" , "playback", "transport", "types" , "video-moq"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason this wasn't sufficient to publish the contents of the dist/ directory - maybe because of how npm only partially overrides .gitignore?

I found that dist/**/* did work though. See the package.json and contents of dist/ here: https://www.npmjs.com/package/@moq-js-ci-test/moq-js?activeTab=code and also https://cdn.jsdelivr.net/npm/@moq-js-ci-test/moq-js@latest/dist/moq-player.iife.js

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We realize and tested that only the dist folder is needed. I checked locally with npm pack that the dist folder is boundled with "files": ["dist" ] and remove the other folders. You can check https://www.npmjs.com/package/@juanmanulpzg/player/v/0.2.3?activeTab=code .

Hope this fix works for you as well, if not we could try dist/**/*

package.json Outdated
{
"name": "moq-js",
"name": "@~englishm/moq-js",
"version": "1.0.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not entirely clear to me what we should have in this top-level package.json for a name and version if we're really only publishing lib/ right now. Should this be kept in sync with lib/package.json or should it be some other placeholder name and version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. After the changes I fixed on tuesday, I should remove this changes as well. It's done now

@englishm
Copy link
Member

This is really great, thank you! Left a few comments about naming/versioning and also one thing we need to fix so the dist/ files get properly published, but otherwise this is looking pretty good! I think we should probably merge the README updates first so the first release is published with proper docs.

@englishm englishm mentioned this pull request Jan 29, 2025
@Juanmalopezg Juanmalopezg force-pushed the publish-to-npm-registry branch 2 times, most recently from 9cac2fd to 947a44a Compare January 29, 2025 15:43
@Juanmalopezg
Copy link
Contributor Author

This is really great, thank you! Left a few comments about naming/versioning and also one thing we need to fix so the dist/ files get properly published, but otherwise this is looking pretty good! I think we should probably merge the README updates first so the first release is published with proper docs.

Thanks for the review! The PR is now updated

@Juanmalopezg Juanmalopezg force-pushed the publish-to-npm-registry branch from 947a44a to 3fdd3b1 Compare January 30, 2025 13:47
@Juanmalopezg Juanmalopezg force-pushed the publish-to-npm-registry branch from 3fdd3b1 to 5e8ab63 Compare January 30, 2025 14:41
@Juanmalopezg Juanmalopezg force-pushed the publish-to-npm-registry branch from 5e8ab63 to 200beab Compare January 30, 2025 14:49
@englishm englishm merged commit 9c33051 into video-dev:main Jan 30, 2025
1 check passed
@Juanmalopezg Juanmalopezg deleted the publish-to-npm-registry branch January 30, 2025 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants