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

Fix duplicated source code in built libraries #324

Merged
merged 26 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9ed5ca6
Signalling url does not need to be set in uiless.html as the url is a…
lukehb Nov 15, 2024
8c3705a
Merge branch 'master' of https://github.com/EpicGamesExt/PixelStreami…
lukehb Nov 15, 2024
5fe8b4a
Removed duplicate source by moving bundling to only occur in /impleme…
lukehb Nov 19, 2024
14281c4
Fix logging.
lukehb Nov 20, 2024
8bc855f
Fix linting issues in library and ui-library
lukehb Nov 20, 2024
3d0ea5f
Fix failing tests in /Extras/FrontendTests
lukehb Nov 21, 2024
b31c083
Fix streamer and codec selection options generation
lukehb Nov 21, 2024
4559260
Restore partial matching of codec specified in a url parameter
lukehb Nov 21, 2024
fc5135e
Allow specifying codec in initial settings and matching that to close…
lukehb Nov 21, 2024
f86d35d
Fixing package.json to make the npm run scripts work in react/typescript
lukehb Nov 21, 2024
b5876af
Fix linting
lukehb Nov 21, 2024
0db44cb
Fix ui-library compilation without npm link
lukehb Nov 21, 2024
e8cde51
Remove weback from frontend library
lukehb Nov 21, 2024
af7aa57
Remove npm link from signalling and signalling web server
lukehb Nov 21, 2024
87956a7
Remove npm link from SS_Test
lukehb Nov 21, 2024
296dc87
Remove NPM link scripts and GHA workflows
lukehb Nov 21, 2024
4f0c64b
Remove webpack from ui-library
lukehb Nov 21, 2024
810b0ef
Update docs about how libraries are built
lukehb Nov 21, 2024
045ae98
Update GHA workflows and docs
lukehb Nov 22, 2024
69d7880
Make repo into NPM workspace to share packages easily during local dev.
lukehb Nov 22, 2024
241c558
Fix stresstest using NodeJS type
lukehb Nov 22, 2024
e4a1e5e
Update package-lock for /Signalling
lukehb Nov 22, 2024
8d2109b
Remove package-lock.json from each workspace as NPM workspace stores …
lukehb Nov 22, 2024
6addc8d
Fix linting issue and fix optional dep in implementation/typescript
lukehb Nov 22, 2024
751fcf4
Bump package versions
lukehb Nov 22, 2024
c236df7
Add info about NPM workspaces
lukehb Nov 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/create-gh-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ jobs:

- name: Build common library
working-directory: ./Common
run: npm ci && npm run build
run: npm install && npm run build

- name: Build frontend library
working-directory: ./Frontend/library
run: npm ci && npm link ../../Common && npm run build
run: npm install && npm run build

- name: Build frontend ui-library
working-directory: ./Frontend/ui-library
run: npm ci && npm link ../library && npm run build
run: npm install && npm run build

- name: Install implementations/typescript deps
working-directory: ./Frontend/implementations/typescript
run: npm ci && npm link ../../library ../../ui-library && npm run build
run: npm install && npm run build

- name: Move all content into output directory for archiving
run: items=(*) && mkdir PixelStreamingInfrastructure-${{ github.ref_name }}-${{ steps.getversion.outputs.version }} && mv ${items[*]} PixelStreamingInfrastructure-${{ github.ref_name }}-${{ steps.getversion.outputs.version }}/
Expand Down
113 changes: 104 additions & 9 deletions .github/workflows/healthcheck-libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ env:
NODE_VERSION: 18.17.x

jobs:
build:
build-using-local-deps:
if: github.repository == 'EpicGamesExt/PixelStreamingInfrastructure'
runs-on: ubuntu-latest
steps:
Expand All @@ -34,28 +34,123 @@ jobs:
with:
node-version: "${{ env.NODE_VERSION }}"
registry-url: 'https://registry.npmjs.org'

- name: Clean build and lint checks on common library
working-directory: Common
run: npm ci && npm run build && npm run lint
run: npm install && npm run build && npm run lint

- name: Clean build and lint checks on signalling library
working-directory: Signalling
run: npm ci && npm link ../Common && npm run build && npm run lint
run: npm install && npm run build && npm run lint

- name: Clean build and lint checks on wilbur
working-directory: SignallingWebServer
run: npm ci && npm link ../Signalling && npm run build && npm run lint
run: npm install && npm run build && npm run lint

- name: Clean build, lint and unit tests on frontend library
working-directory: Frontend/library
run: npm ci && npm link ../../Common && npm run build && npm run lint && npm run test
run: npm install && npm run build && npm run lint && npm run test

- name: Clean build and lint checks on frontend ui library
working-directory: Frontend/ui-library
run: npm ci && npm link ../library && npm run build && npm run lint
run: npm install && npm run build && npm run lint

- name: Clean build of frontend implementation
working-directory: Frontend/implementations/typescript
run: npm ci && npm link ../../library ../../ui-library && npm run build
run: npm install && npm run build

build-signalling-only:
if: github.repository == 'EpicGamesExt/PixelStreamingInfrastructure'
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
with:
sparse-checkout: 'Signalling'
sparse-checkout-cone-mode: false

- uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE_VERSION }}"
registry-url: 'https://registry.npmjs.org'

- name: Build signalling using published packages only
working-directory: Signalling
run: npm install && npm run build && npm run lint

build-wilbur-only:
if: github.repository == 'EpicGamesExt/PixelStreamingInfrastructure'
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
with:
sparse-checkout: 'SignallingWebServer'
sparse-checkout-cone-mode: false

- uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE_VERSION }}"
registry-url: 'https://registry.npmjs.org'

- name: Build Wilbur using published packages only
working-directory: SignallingWebServer
run: npm install && npm run build && npm run lint

build-frontend-only:
if: github.repository == 'EpicGamesExt/PixelStreamingInfrastructure'
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
with:
sparse-checkout: 'Frontend/library'
sparse-checkout-cone-mode: false

- uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE_VERSION }}"
registry-url: 'https://registry.npmjs.org'

- name: Build Frontend/library using published packages only
working-directory: Frontend/library
run: npm install && npm run build && npm run lint && npm run test

build-frontend-ui-only:
if: github.repository == 'EpicGamesExt/PixelStreamingInfrastructure'
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
with:
sparse-checkout: 'Frontend/ui-library'
sparse-checkout-cone-mode: false

- uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE_VERSION }}"
registry-url: 'https://registry.npmjs.org'

- name: Build Frontend/ui-library using published packages only
working-directory: Frontend/ui-library
run: npm install && npm run build && npm run lint

build-implementation-typescript-only:
if: github.repository == 'EpicGamesExt/PixelStreamingInfrastructure'
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
with:
sparse-checkout: 'Frontend/implementations/typescript'
sparse-checkout-cone-mode: false

- uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE_VERSION }}"
registry-url: 'https://registry.npmjs.org'

- name: Build Frontend/implementations/typescript using published packages only
working-directory: Frontend/implementations/typescript
run: npm install && npm run build

19 changes: 7 additions & 12 deletions .github/workflows/healthcheck-streaming.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,43 +68,38 @@ jobs:
- name: Build Common
working-directory: Common
run: |
npm ci
npm install
npm run build

- name: Build Signalling
working-directory: Signalling
run: |
npm ci
npm link ../Common
npm install
npm run build

- name: Build Wilbur
working-directory: SignallingWebServer
run: |
npm ci
npm link ../Signalling
npm install
npm run build

- name: Build Frontend lib
working-directory: Frontend/library
run: |
npm ci
npm link ../../Common
npm install
npm run build

- name: Build Frontend ui lib
working-directory: Frontend/ui-library
run: |
npm ci
npm link ../library
npm install
npm run build

- name: Build Frontend implementation
working-directory: Frontend/implementations/typescript
run: |
$Env:WEBPACK_OUTPUT_PATH='${{ github.workspace }}\www'
npm ci
npm link ../../library ../../ui-library
npm install
npm run build

- name: Run Signalling
Expand All @@ -118,7 +113,7 @@ jobs:
- name: Prepare test
working-directory: Extras\MinimalStreamTester
run: |
npm i
npm install
npx playwright install --with-deps
npx playwright install chrome

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/publish-common-library-to-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ jobs:
working-directory: Common
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: 'Common'
sparse-checkout-cone-mode: false
- uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE_VERSION }}"
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm install
- run: npm run build
- run: npm publish --access public
env:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/publish-library-to-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ jobs:
working-directory: Frontend/library
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: 'Frontend/library'
sparse-checkout-cone-mode: false
- uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE_VERSION }}"
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm install
- run: npm run build
- run: npm publish --access public
env:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/publish-sfu-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
sparse-checkout: 'SFU'
sparse-checkout-cone-mode: false

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/publish-signalling-library-to-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ jobs:
working-directory: Signalling
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: 'Signalling'
sparse-checkout-cone-mode: false
- uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE_VERSION }}"
registry-url: 'https://registry.npmjs.org'
- working-directory: Common
run: npm ci && npm run build
- run: npm ci && npm link ../Common && npm run build
- run: npm install && npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 4 additions & 1 deletion .github/workflows/publish-ui-library-to-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ jobs:
working-directory: Frontend/ui-library
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: 'Frontend/ui-library'
sparse-checkout-cone-mode: false
- uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE_VERSION }}"
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm install
- run: npm run build
- run: npm publish --access public
env:
Expand Down
10 changes: 10 additions & 0 deletions Common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,15 @@ For examples of how to implement this library.
- See [lib-pixelstreamingsignalling](/Signalling)
- Also see [Wilbur](/SignallingWebServer) which uses the signalling library to implement a full signalling server.

### Adding it to your project
`npm i @epicgames-ps/lib-pixelstreamingcommon-ue5.5`

## Documentation
The API is documented [here](docs).

### How this library is built
The NPM packages supports:
- ES6 module usage
- CommonJS usage
- Type definitions
- Source maps
Loading
Loading