SRGSSR / pillarbox-web

Pillarbox is a versatile media playback ecosystem engineered for the web.
https://srgssr.github.io/pillarbox-web-demo/
MIT License
11 stars 1 forks source link

feat: split demo and migrate to rollup #185

Closed jboix closed 7 months ago

jboix commented 7 months ago

Description

Closes #179 by migrating the compilation framework from Parcel to Rollup, aiming to improve the flexibility of the compilation process. To execute the full bundle of the library simply run: npm run build.

Changes made

Rollup migration

Rollup is the bundler that allows us to create an UMD package of the library, which can be used in various environments. The proposed configuration produces two main builds:

Both these builds are provided in UMD and ES format.

The following plugins have been introduced:

The following command executes the generation of both these bundles: npm run build:lib.

Introduction of sass

As part of the migration the preprocessing of scss files is now done directly with Sass as opposed of parcel. A minified css stylesheet and a sourcemap are generated by executing: npm run build:css.

Add typings generation via typescript

TypeScript is a superset of JavaScript that adds static type checking and other features. It helps to write more robust and error-free code. Even though we've opted to not use typescript in Pillarbox a tsconfig.json file has been added to generate the declaration files based on the JSDocs of the source code.

Executing: npm run build:typings will generate the typings declarations.

See Creating .d.ts Files from .js files.

Split the demo application to its own repository

The demo folder has been moved to SRGSSR/pillarbox-web-demo where it can be maintained and updated independently. The following pull request descibres the changes that have taken place on the demo part: SRGSSR/pillarbox-web-demo#1

Since the demo has moved to another respository the github page of this one is now a standalone player.

github-actions[bot] commented 7 months ago

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟢 Statements 98.39% 489/497
🟢 Branches 93.44% 228/244
🟢 Functions 100% 136/136
🟢 Lines 99.16% 473/477

Test suite run success

153 tests passing in 9 suites.

Report generated by 🧪jest coverage report action from a004190caf808f6df065001d793d5db4e62754b5

amtins commented 7 months ago

@jboix I think we need to find another strategy for this PR. This PR deals with two very distinct subjects, so it would be better to separate it into two. Once the two PRs are separated, I think it would be best to delete all commits related to the demo.