mirror of
https://github.com/OutlineFoundation/outline-server.git
synced 2026-10-24 13:31:02 +00:00
Fix babel and cleanup
This commit is contained in:
parent
878e116869
commit
b45de5704c
8 changed files with 176 additions and 1071 deletions
|
|
@ -17,7 +17,7 @@ BUILD_ENV=development yarn do server_manager/electron_app/run
|
|||
To run the Outline Manager as a web app on the browser and listen for changes:
|
||||
|
||||
```
|
||||
yarn workspace outline-manager run webpack-dev-server --config=browser.webpack.js --open
|
||||
yarn do server_manager/web_app/run
|
||||
```
|
||||
|
||||
## Debug an existing binary
|
||||
|
|
|
|||
|
|
@ -43,13 +43,6 @@ exports.makeConfig = (options) => {
|
|||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(js|ts)$/,
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: ['@babel/preset-env'],
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.ts(x)?$/,
|
||||
exclude: /node_modules/,
|
||||
|
|
|
|||
|
|
@ -59,14 +59,11 @@
|
|||
"The `resolutions` was created by polymer-modulizer. We should check if we still need them."
|
||||
],
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.9.6",
|
||||
"@babel/preset-env": "^7.9.6",
|
||||
"@types/node": "~12.0.0",
|
||||
"@types/node-forge": "^0.6.9",
|
||||
"@types/polymer": "^1.2.9",
|
||||
"@types/request": "^2.47.1",
|
||||
"@types/semver": "^5.5.0",
|
||||
"babel-loader": "^8.1.0",
|
||||
"bower": "^1.8.0",
|
||||
"copy-webpack-plugin": "^5.1.1",
|
||||
"css-loader": "^3.5.3",
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
// tslint:disable-next-line:no-any
|
||||
(window as any).runDigitalOceanOauth = () => {
|
||||
window.open('https://cloud.digitalocean.com/account/api/tokens/new', 'nopener,noreferrer');
|
||||
let isCancelled = false;
|
||||
const rejectWrapper = {reject: (error: Error) => {}};
|
||||
const result = new Promise((resolve, reject) => {
|
||||
|
|
|
|||
|
|
@ -16,28 +16,14 @@
|
|||
|
||||
set -eu
|
||||
|
||||
readonly NODE_MODULES_BIN_DIR=$ROOT_DIR/src/server_manager/node_modules/.bin
|
||||
|
||||
readonly OUT_DIR=$BUILD_DIR/server_manager/web_app
|
||||
rm -rf $OUT_DIR
|
||||
|
||||
# Create do_install_script.ts, which has a variable with the content of do_install_server.sh.
|
||||
mkdir -p $OUT_DIR/sh/server_manager/web_app
|
||||
|
||||
pushd $ROOT_DIR/src/server_manager/install_scripts > /dev/null
|
||||
tar --create --gzip -f $OUT_DIR/sh/server_manager/web_app/scripts.tgz *.sh
|
||||
popd > /dev/null
|
||||
do_action server_manager/web_app/build_install_script
|
||||
|
||||
# Node.js on Cygwin doesn't like absolute Unix-style paths.
|
||||
# So, we'll use relative paths for webpack and browserify.
|
||||
|
||||
# So, we use a relative path as input to webpack.
|
||||
pushd $ROOT_DIR > /dev/null
|
||||
node src/server_manager/install_scripts/build_install_script_ts.node.js \
|
||||
build/server_manager/web_app/sh/server_manager/web_app/scripts.tgz > $ROOT_DIR/src/server_manager/install_scripts/do_install_script.ts
|
||||
|
||||
readonly STATIC_DIR=$OUT_DIR/static
|
||||
mkdir -p $STATIC_DIR
|
||||
|
||||
# Notice that we forward the build environment if defined.
|
||||
webpack --config=src/server_manager/electron_renderer.webpack.js ${BUILD_ENV:+--mode=${BUILD_ENV}}
|
||||
popd > /dev/null
|
||||
|
|
|
|||
33
src/server_manager/web_app/build_install_script_action.sh
Executable file
33
src/server_manager/web_app/build_install_script_action.sh
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2020 The Outline Authors
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set -eu
|
||||
|
||||
readonly OUT_DIR=$BUILD_DIR/server_manager/web_app/sh/
|
||||
rm -rf $OUT_DIR
|
||||
|
||||
# Create do_install_script.ts, which has a variable with the content of do_install_server.sh.
|
||||
mkdir -p $OUT_DIR
|
||||
|
||||
pushd $ROOT_DIR/src/server_manager/install_scripts > /dev/null
|
||||
tar --create --gzip -f $OUT_DIR/scripts.tgz *.sh
|
||||
|
||||
# Node.js on Cygwin doesn't like absolute Unix-style paths.
|
||||
# So, we use a relative path as input.
|
||||
cd $ROOT_DIR
|
||||
node src/server_manager/install_scripts/build_install_script_ts.node.js \
|
||||
build/server_manager/web_app/sh/scripts.tgz > $ROOT_DIR/src/server_manager/install_scripts/do_install_script.ts
|
||||
popd > /dev/null
|
||||
23
src/server_manager/web_app/run_action.sh
Executable file
23
src/server_manager/web_app/run_action.sh
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2018 The Outline Authors
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set -eu
|
||||
|
||||
rm -rf $BUILD_DIR/server_manager/web_app
|
||||
|
||||
do_action server_manager/web_app/build_install_script
|
||||
|
||||
yarn workspace outline-manager run webpack-dev-server --config=browser.webpack.js --open
|
||||
Loading…
Add table
Add a link
Reference in a new issue