Skip to content

Commit 697da2a

Browse files
authored
Merge pull request #192 from whereby/havard/pan-723-verify-v2-cdn-build-works
Final tweaks before removing the beta tag
2 parents f7d1d8a + 9b6bfbc commit 697da2a

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ jobs:
6060
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
6161
aws-region: eu-west-1
6262

63-
- uses: jakejarvis/s3-sync-action@master
63+
- uses: jakejarvis/s3-sync-action@v0.5.1
6464
with:
6565
args: --acl public-read --follow-symlinks
6666
env:
6767
AWS_S3_BUCKET: whereby-cdn
6868
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
6969
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
7070
AWS_REGION: "es-west-1"
71-
SOURCE_DIR: "dist/"
71+
SOURCE_DIR: "dist/cdn/"
7272
DEST_DIR: "embed/"
7373

7474
- name: Invalidate cloudfront publication

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@whereby.com/browser-sdk",
3-
"version": "2.0.0-beta4",
3+
"version": "2.0.0",
44
"description": "Modules for integration Whereby video in web apps",
55
"author": "Whereby AS",
66
"license": "MIT",

rollup.config.js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,21 @@ const { dts } = require("rollup-plugin-dts");
99

1010
const peerDependencies = [...Object.keys(pkg.peerDependencies || {})];
1111

12-
function makeCdnFilename() {
12+
function makeCdnFilename(package) {
1313
const major = pkg.version.split(".")[0];
14-
const preRelease = pkg.version.split("-")[1];
15-
let tag = "";
1614

15+
let tag = "";
16+
const preRelease = pkg.version.split("-")[1];
1717
if (preRelease) {
1818
tag = `-${preRelease.split(".")[0]}`;
1919
}
2020

21-
return `v${major}${tag}.js`;
21+
let packagePart = "";
22+
if (package) {
23+
packagePart = `-${package}`;
24+
}
25+
26+
return `v${major}${packagePart}${tag}.js`;
2227
}
2328

2429
const replaceValues = {
@@ -88,17 +93,19 @@ module.exports = [
8893
external: ["heresy", ...peerDependencies],
8994
plugins,
9095
},
91-
// Legacy build of embedded lib in ESM format, bundling the dependencies
96+
97+
// CDN builds
9298
{
9399
input: "src/lib/embed/index.ts",
94100
output: {
95-
exports: "named",
96-
file: `dist/${makeCdnFilename()}`,
97-
format: "esm",
101+
file: `dist/cdn/${makeCdnFilename("embed")}`,
102+
format: "iife",
103+
name: "whereby",
98104
},
99105
plugins: [nodeResolve(), commonjs(), json(), terser(), replace(replaceValues), typescript()],
100106
},
101-
// Roll-up .d.ts definition files
107+
108+
// Type definitions
102109
{
103110
input: "src/lib/react/index.ts",
104111
output: [{ file: "dist/react/index.d.ts", format: "es" }],

0 commit comments

Comments
 (0)