Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(repo): Add build:tarball scripts #21

Merged
merged 3 commits into from
Jan 23, 2023
Merged

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Jan 20, 2023

This PR adds npm scripts to build NPM tarballs.
Because rrweb uses release-it for publishing their packages, there was no need to create tarballs before. However, as we're using Craft and we have to put tarballs into the GHA build artifacts for craft to pick them up, we need a script to build them easily.

Furthermore, release-it seems to have some way of adding the LICENSE file to the respective packages. We actually need to copy them into the packages to have them included in the tarballs.

Due to how rrweb set up the prepack hook, whenever yarn build:tarball is executed, the other build steps (rollup, type checking) are executed automatically beforehand. While this means we're probably gonna execute builds twice in CI, I think this is fine as we're not gonna release often (🤞) and we want to keep changes diverging from upstream minimal.

ref #15

@Lms24 Lms24 marked this pull request as ready for review January 20, 2023 15:36
@Lms24 Lms24 requested a review from mydea January 20, 2023 15:36
@Lms24
Copy link
Member Author

Lms24 commented Jan 20, 2023

I checked the tarball contents with the official rrweb tarballs and they're almost identical. For some reason, rrweb has tslib in its rrweb/es/ext folder while our tarball doesn't. However, the transpiled files in rrweb/es/packages/rrweb (i.e. the actual rrweb files that require polyfills from tslib) all require tslib from another path (rrweb/es/packages/rrweb/ext/tslib) which is included in both versions of the tarball. So I think we're good in terms of package integrity. Just leaving this here for future reference.

@Lms24 Lms24 changed the title build(repo): Add build:tarball scripts build(repo): Add build:tarball scripts Jan 23, 2023
@Lms24 Lms24 merged commit 394492f into publish-fork Jan 23, 2023
@Lms24 Lms24 deleted the lms-publish-pack branch January 23, 2023 20:07
Lms24 added a commit that referenced this pull request Jan 23, 2023
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.

2 participants