Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #107 from EpicGames/master
Browse files Browse the repository at this point in the history
Merge changes from master
  • Loading branch information
lukehb committed Feb 20, 2023
2 parents 864c0f4 + a366404 commit 4219326
Show file tree
Hide file tree
Showing 10 changed files with 140 additions and 128 deletions.
1 change: 0 additions & 1 deletion Frontend/implementations/EpicGames/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions Frontend/implementations/EpicGames/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@
"name": "@epicgames-ps/reference-pixelstreamingfrontend-ue5.2",
"version": "0.0.1",
"description": "",
"main": "player.ts",
"main": "./src/player.ts",
"scripts": {
"build": "npx webpack --config webpack.prod.js",
"build-dev": "npx webpack --config webpack.dev.js",
"watch": "npx webpack --watch",
"serve": "webpack serve --config webpack.dev.js",
"serve-prod": "webpack serve --config webpack.prod.js",
"install": "cd ../../library && npm run build-webpack && cd ../implementations/EpicGames && npm link ../../library",
"install-dev": "cd ../../library && npm run build-webpack-dev && cd ../implementations/EpicGames && npm link ../../library",
"build-all": "npm run install && npm run build",
"build-all-dev": "npm run install-dev && npm run build-dev"
"build-all": "cd ../../library && npm run build && cd ../implementations/EpicGames && npm link ../../library && npm run build",
"build-all-dev": "cd ../../library && npm run build-dev && cd ../implementations/EpicGames && npm link ../../library && npm run build-dev"
},
"devDependencies": {
"webpack-cli": "^5.0.1",
Expand Down
150 changes: 75 additions & 75 deletions Frontend/implementations/EpicGames/webpack.common.js
Original file line number Diff line number Diff line change
@@ -1,75 +1,75 @@
// Copyright Epic Games, Inc. All Rights Reserved.

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
const fs = require('fs');

const pages = fs.readdirSync('./src', { withFileTypes: true })
.filter(item => !item.isDirectory())
.filter(item => path.parse(item.name).ext === '.html')
.map(htmlFile => path.parse(htmlFile.name).name);

module.exports = {
entry: pages.reduce((config, page) => {
config[page] = `./src/${page}.ts`;
return config;
}, {}),

plugins: [].concat(pages.map((page) => new HtmlWebpackPlugin({
title: `${page}`,
template: `./src/${page}.html`,
filename: `${page}.html`,
chunks: [page],
}), )),

module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
exclude: [
/node_modules/,
],
},
{
test: /\.html$/i,
use: 'html-loader'
},
{
test: /\.css$/,
type: 'asset/resource',
generator: {
filename: 'css/[name][ext]'
}
},
{
test: /\.(png|svg)$/i,
type: 'asset/resource',
generator: {
filename: 'images/[name][ext]'
}
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js', '.svg', '.json'],
},
output: {
filename: '[name].js',
library: 'epicgames-frontend',
libraryTarget: 'umd',
path: path.resolve(__dirname, '../../../SignallingWebServer/Public'),
clean: true,
globalObject: 'this',
hashFunction: 'xxhash64',
},
experiments: {
futureDefaults: true
},
devServer: {
static: {
directory: path.join(__dirname, '../../../SignallingWebServer/Public'),
},
},
}
// Copyright Epic Games, Inc. All Rights Reserved.

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
const fs = require('fs');

const pages = fs.readdirSync('./src', { withFileTypes: true })
.filter(item => !item.isDirectory())
.filter(item => path.parse(item.name).ext === '.html')
.map(htmlFile => path.parse(htmlFile.name).name);

module.exports = {
entry: pages.reduce((config, page) => {
config[page] = `./src/${page}.ts`;
return config;
}, {}),

plugins: [].concat(pages.map((page) => new HtmlWebpackPlugin({
title: `${page}`,
template: `./src/${page}.html`,
filename: `${page}.html`,
chunks: [page],
}), )),

module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
exclude: [
/node_modules/,
],
},
{
test: /\.html$/i,
use: 'html-loader'
},
{
test: /\.css$/,
type: 'asset/resource',
generator: {
filename: 'css/[name][ext]'
}
},
{
test: /\.(png|svg)$/i,
type: 'asset/resource',
generator: {
filename: 'images/[name][ext]'
}
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js', '.svg', '.json'],
},
output: {
filename: '[name].js',
library: 'epicgames-frontend',
libraryTarget: 'umd',
path: path.resolve(__dirname, '../../../SignallingWebServer/Public'),
clean: true,
globalObject: 'this',
hashFunction: 'xxhash64',
},
experiments: {
futureDefaults: true
},
devServer: {
static: {
directory: path.join(__dirname, '../../../SignallingWebServer/Public'),
},
},
}
4 changes: 2 additions & 2 deletions Frontend/library/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions Frontend/library/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"name": "@epicgames-ps/lib-pixelstreamingfrontend-ue5.2",
"version": "0.0.1",
"version": "0.0.2",
"description": "Frontend library for Pixel Streaming",
"main": "dist/lib-pixelstreamingfrontend.js",
"types": "types/pixelstreamingfrontend.d.ts",
"scripts": {
"compile": "tsc --build --clean && tsc",
"build": "npm run build-webpack",
"build-webpack": "npx webpack --config webpack.prod.js",
"build-webpack-dev": "npx webpack --config webpack.dev.js",
"build": "npx webpack --config webpack.prod.js",
"build-dev": "npx webpack --config webpack.dev.js",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"spellcheck": "cspell \"{README.md,.github/*.md,src/**/*.ts}\""
},
Expand Down
70 changes: 35 additions & 35 deletions Frontend/library/webpack.common.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
// Copyright Epic Games, Inc. All Rights Reserved.

const package = require('./package.json');
const path = require('path');
const webpack = require('webpack');

module.exports = {
entry: {
index: './src/pixelstreamingfrontend.ts'
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
exclude: [/node_modules/]
}
]
},
resolve: {
extensions: ['.tsx', '.ts', '.js']
},
plugins: [
new webpack.DefinePlugin({
LIBRARY_VERSION: JSON.stringify(package.version)
})
],
output: {
library: 'lib-pixelstreamingfrontend', // exposed variable that will provide access to the library classes
libraryTarget: 'umd',
path: path.resolve(__dirname, 'dist'),
clean: true,
globalObject: 'this'
}
};
// Copyright Epic Games, Inc. All Rights Reserved.

const package = require('./package.json');
const path = require('path');
const webpack = require('webpack');

module.exports = {
entry: {
index: './src/pixelstreamingfrontend.ts'
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
exclude: [/node_modules/]
}
]
},
resolve: {
extensions: ['.tsx', '.ts', '.js']
},
plugins: [
new webpack.DefinePlugin({
LIBRARY_VERSION: JSON.stringify(package.version)
})
],
output: {
library: 'lib-pixelstreamingfrontend', // exposed variable that will provide access to the library classes
libraryTarget: 'umd',
path: path.resolve(__dirname, 'dist'),
clean: true,
globalObject: 'this'
}
};
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The goals of this repository are to:

- Increase the release cadence for the Pixel Streaming servers (to mitigate browser breaking changes sooner).
- Encourage easier contribution of these components by Unreal Engine licensees.
- Facilitate a more standard web release mechanism (e.g. NPM packages or similar... coming soon).
- Facilitate a more standard web release mechanism.
- Grant a permissive license to distribute and modify this code wherever you see fit (MIT licensed).

## Repository contents
Expand All @@ -24,6 +24,22 @@ The following container images are built from this repository:

- [ghcr.io/epicgames/pixel-streaming-signalling-server](https://github.com/orgs/EpicGames/packages/container/package/pixel-streaming-signalling-server) (since Unreal Engine 5.1)

## Releases

### Frontend library (Unofficial NPM packages)

- UE 5.2

`npm i @epicgames-ps/lib-pixelstreamingfrontend-ue5.2`

- Dev

`npm i @epicgames-ps/lib-pixelstreamingfrontend-dev`

### Full release + built reference implementation

[Github releases](https://github.com/EpicGames/PixelStreamingInfrastructure/releases)

## Versions

We maintain versions of the servers and frontend that are compatible with existing and in-development version of Unreal Engine.
Expand Down
2 changes: 1 addition & 1 deletion RELEASE_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0
0.1.1
4 changes: 2 additions & 2 deletions SignallingWebServer/platform_scripts/bash/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ function setup_frontend() {
# Using our bundled NodeJS, build the web frontend files
pushd ${BASH_LOCATION}/../../../Frontend/library > /dev/null
../../SignallingWebServer/platform_scripts/bash/node/bin/npm install
../../SignallingWebServer/platform_scripts/bash/node/bin/npx webpack
../../SignallingWebServer/platform_scripts/bash/node/bin/npm run build-dev
popd

pushd ${BASH_LOCATION}/../../../Frontend/implementations/EpicGames > /dev/null
../../../SignallingWebServer/platform_scripts/bash/node/bin/npm install
../../../SignallingWebServer/platform_scripts/bash/node/bin/npm link ../../library
../../../SignallingWebServer/platform_scripts/bash/node/bin/npx webpack
../../../SignallingWebServer/platform_scripts/bash/node/bin/npm run build-dev
popd
else
echo 'Skipping building Frontend because files already exist. Please run with "--build" to force a rebuild'
Expand Down
4 changes: 2 additions & 2 deletions SignallingWebServer/platform_scripts/cmd/setup_frontend.bat
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
echo Building frontend library...
pushd %CD%\Frontend\library
call ..\..\SignallingWebServer\platform_scripts\cmd\node\npm install
call ..\..\SignallingWebServer\platform_scripts\cmd\node\npx webpack
call ..\..\SignallingWebServer\platform_scripts\cmd\node\npm run build-dev
popd
echo End of build PS frontend lib step.

Expand All @@ -63,7 +63,7 @@
pushd %CD%\Frontend\implementations\EpicGames
call ..\..\..\SignallingWebServer\platform_scripts\cmd\node\npm install
call ..\..\..\SignallingWebServer\platform_scripts\cmd\node\npm link ../../library
call ..\..\..\SignallingWebServer\platform_scripts\cmd\node\npx webpack
call ..\..\..\SignallingWebServer\platform_scripts\cmd\node\npm run build-dev
popd
echo End of build reference frontend step.
echo ----------------------------
Expand Down

0 comments on commit 4219326

Please sign in to comment.