web: Switch to using lerna for package management

This commit is contained in:
Nathan Adams 2020-05-17 00:25:38 +02:00
parent b6523324ed
commit 7b8a4ffed1
13 changed files with 10770 additions and 17822 deletions

View File

@ -59,47 +59,45 @@ jobs:
cd linux
tar -czvf ../workspace/linux.tar.gz *
# Build the web self-hosted binary
# Build web packages
- run:
name: Web Build
command: |
cd web/selfhosted
npm install
cd web
npm run bootsrap
npm run build -- --mode=production
cd dist
cp ../../../README.md .
cp ../../../LICENSE_APACHE .
cp ../../../LICENSE_MIT .
# Package the web self-hosted binary
- run:
name: Web Build
command: |
cd web/packages/selfhosted/dist
cp ../../../../README.md .
cp ../../../../LICENSE_APACHE .
cp ../../../../LICENSE_MIT .
zip -r web.zip .
cd ../../..
cd ../../../..
mkdir -p workspace/web
cp web/selfhosted/dist/web.zip workspace/web.zip
cp web/packages/selfhosted/dist/web.zip workspace/web.zip
# Build the wasm demo binary
- run:
name: Web Demo Build
command: |
cd web/demo
npm install
npm run build -- --mode=production
cd ../..
mkdir -p workspace/web-demo
cp web/demo/dist/* workspace/web-demo
cp web/packages/demo/dist/* workspace/web-demo
# Build the web extension
- run:
name: Extension Build
command: |
cd web/extension
npm install
npm run build -- --mode=production
cd build
cp ../../../README.md .
cp ../../../LICENSE_APACHE .
cp ../../../LICENSE_MIT .
cd web/packages/extension/build
cp ../../../../README.md .
cp ../../../../LICENSE_APACHE .
cp ../../../../LICENSE_MIT .
zip -r extension.zip .
cd ../../..
cp web/extension/build/extension.zip workspace
cd ../../../..
cp web/packages/extension/build/extension.zip workspace
# Save cached assets
- save_cache:

View File

@ -58,26 +58,9 @@ jobs:
command: fmt
args: --all -- --check
- name: Check javascript formatting
- name: Build web
working-directory: web
run: |
npm ci
npm run bootstrap
npx eslint .
- name: Build web self-hosted
working-directory: web/selfhosted
run: |
npm ci
npm run build -- --mode=production
- name: Build web demo
working-directory: web/demo
run: |
npm ci
npm run build -- --mode=production
- name: Build browser extension
working-directory: web/extension
run: |
npm ci
npm run build -- --mode=production
npm run build

View File

@ -40,14 +40,14 @@ Ruffle is in the proof-of-concept stage and can currently run early Flash animat
#### Running the web demo
* `cd web/demo`
* `npm install`
* `npm run serve`
* `npm run bootstrap`
* `npm run demo`
* Load indicated page in browser (usually http://localhost:8080)
#### Hosting on your own site
* `cd web/selfhosted`
* `npm install`
* `npm run bootstrap`
* `npm run build`
* Follow the wiki instructions for [using Ruffle on your own site](https://github.com/ruffle-rs/ruffle/wiki/Using-Ruffle#web)

6
web/lerna.json Normal file
View File

@ -0,0 +1,6 @@
{
"packages": [
"packages/*"
],
"version": "0.0.0"
}

10715
web/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -2,11 +2,32 @@
"name": "ruffle",
"version": "0.1.0",
"description": "Root project of ruffle web",
"private": true,
"devDependencies": {
"@wasm-tool/wasm-pack-plugin": "^1.3.1",
"babel-eslint": "^10.1.0",
"clean-webpack-plugin": "^3.0.0",
"copy-webpack-plugin": "^5.1.0",
"eslint": "^7.0.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.3",
"prettier": "^2.0.5"
"html-webpack-plugin": "^3.2.0",
"lerna": "^3.21.0",
"prettier": "^2.0.5",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.11.0"
},
"dependencies": {
"ruffle-core": "file:packages/core",
"ruffle-demo": "file:packages/demo",
"ruffle-extension": "file:packages/extension",
"ruffle-selfhosted": "file:packages/selfhosted"
},
"scripts": {
"bootstrap": "npx lerna bootstrap --hoist",
"build": "npx lerna run build",
"buildProduction": "npx lerna run build -- --mode=production",
"demo": "npx lerna run --scope ruffle-demo serve --stream"
}
}

View File

@ -1,5 +0,0 @@
{
"name": "ruffle-core",
"version": "0.1.0",
"lockfileVersion": 1
}

File diff suppressed because it is too large Load Diff

View File

@ -5,15 +5,5 @@
"scripts": {
"build": "webpack",
"serve": "webpack-dev-server"
},
"devDependencies": {
"@wasm-tool/wasm-pack-plugin": "^1.2.0",
"clean-webpack-plugin": "^3.0.0",
"copy-webpack-plugin": "^5.1.1",
"html-webpack-plugin": "^3.2.0",
"webpack": "^4.42.0",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.10.3",
"ruffle-core": "file:../core"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -5,14 +5,5 @@
"scripts": {
"build": "webpack",
"serve": "webpack-dev-server"
},
"devDependencies": {
"@wasm-tool/wasm-pack-plugin": "^1.2.0",
"clean-webpack-plugin": "^3.0.0",
"copy-webpack-plugin": "^5.1.0",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10",
"webpack-dev-server": "^3.9.0",
"ruffle-core": "file:../core"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -5,13 +5,5 @@
"scripts": {
"build": "webpack",
"serve": "webpack-dev-server"
},
"devDependencies": {
"@wasm-tool/wasm-pack-plugin": "^1.3.1",
"clean-webpack-plugin": "^3.0.0",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.11.0",
"ruffle-core": "file:../core"
}
}