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

View File

@ -58,26 +58,9 @@ jobs:
command: fmt command: fmt
args: --all -- --check args: --all -- --check
- name: Check javascript formatting - name: Build web
working-directory: web working-directory: web
run: | run: |
npm ci npm run bootstrap
npx eslint . npx eslint .
npm run build
- 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

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 #### Running the web demo
* `cd web/demo` * `cd web/demo`
* `npm install` * `npm run bootstrap`
* `npm run serve` * `npm run demo`
* Load indicated page in browser (usually http://localhost:8080) * Load indicated page in browser (usually http://localhost:8080)
#### Hosting on your own site #### Hosting on your own site
* `cd web/selfhosted` * `cd web/selfhosted`
* `npm install` * `npm run bootstrap`
* `npm run build` * `npm run build`
* Follow the wiki instructions for [using Ruffle on your own site](https://github.com/ruffle-rs/ruffle/wiki/Using-Ruffle#web) * 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", "name": "ruffle",
"version": "0.1.0", "version": "0.1.0",
"description": "Root project of ruffle web", "description": "Root project of ruffle web",
"private": true,
"devDependencies": { "devDependencies": {
"@wasm-tool/wasm-pack-plugin": "^1.3.1",
"babel-eslint": "^10.1.0", "babel-eslint": "^10.1.0",
"clean-webpack-plugin": "^3.0.0",
"copy-webpack-plugin": "^5.1.0",
"eslint": "^7.0.0", "eslint": "^7.0.0",
"eslint-config-prettier": "^6.11.0", "eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.3", "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": { "scripts": {
"build": "webpack", "build": "webpack",
"serve": "webpack-dev-server" "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": { "scripts": {
"build": "webpack", "build": "webpack",
"serve": "webpack-dev-server" "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": { "scripts": {
"build": "webpack", "build": "webpack",
"serve": "webpack-dev-server" "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"
} }
} }