diff --git a/.gitignore b/.gitignore index d3ad9558..2e34b6c1 100644 --- a/.gitignore +++ b/.gitignore @@ -6,11 +6,7 @@ /lib /node_modules /packages/ -/vector/bundle.* -/vector/emojione/ -/vector/config.json -/vector/index.html -/vector/olm.* +/webapp .DS_Store npm-debug.log electron/dist diff --git a/vector/config.sample.json b/config.sample.json similarity index 100% rename from vector/config.sample.json rename to config.sample.json diff --git a/electron/src/electron-main.js b/electron/src/electron-main.js index 59cbca42..18758eee 100644 --- a/electron/src/electron-main.js +++ b/electron/src/electron-main.js @@ -160,7 +160,7 @@ electron.app.on('ready', () => { icon: `${__dirname}/../img/riot.ico`, width: 1024, height: 768, }); - mainWindow.loadURL(`file://${__dirname}/../../vector/index.html`); + mainWindow.loadURL(`file://${__dirname}/../../webapp/index.html`); electron.Menu.setApplicationMenu(VectorMenu); mainWindow.on('closed', () => { diff --git a/package.json b/package.json index f31f024a..93bfacea 100644 --- a/package.json +++ b/package.json @@ -27,23 +27,27 @@ "matrix-react-parent": "matrix-react-sdk", "scripts": { "reskindex": "reskindex -h src/header", - "build:emojione": "cpx \"node_modules/emojione/assets/svg/*\" vector/emojione/svg/", + "build:res": "cpx \"{src/skins/vector/fonts,src/skins/vector/img}/**\" webapp/ && cpx \"{res/media,res/vector-icons}/**\" webapp/", + "build:config": "cpx config.json webapp/", + "build:emojione": "cpx \"node_modules/emojione/assets/svg/*\" webapp/emojione/svg/", "build:modernizr": "modernizr -c .modernizr.json -d src/vector/modernizr.js", "build:css": "mkdirp build && catw \"src/skins/vector/css/**/*.css\" -o build/components.css --no-watch", "build:compile": "babel --source-maps -d lib src", "build:bundle": "NODE_ENV=production webpack -p --progress", "build:bundle:dev": "webpack --optimize-occurence-order --progress", "build:electron": "build -lwm", - "build": "node scripts/babelcheck.js && npm run build:emojione && npm run build:css && npm run build:bundle", + "build": "node scripts/babelcheck.js && npm run build:res && npm run build:config && npm run build:emojione && npm run build:css && npm run build:bundle", "build:dev": "npm run build:emojione && npm run build:css && npm run build:bundle:dev", "dist": "scripts/package.sh", - "start:emojione": "cpx \"node_modules/emojione/assets/svg/*\" vector/emojione/svg/ -w", + "start:res": "parallelshell \"cpx -w \\\"{src/skins/vector/fonts,src/skins/vector/img}/**\\\" webapp/\" \"cpx -w \\\"{res/media,res/vector-icons}/**\\\" webapp/\"", + "start:config": "cpx -w config.json webapp/", + "start:emojione": "cpx \"node_modules/emojione/assets/svg/*\" webapp/emojione/svg/ -w", "start:js": "webpack-dev-server -w --progress", "start:js:prod": "NODE_ENV=production webpack-dev-server -w --progress", "start:skins:css": "mkdirp build && catw \"src/skins/vector/css/**/*.css\" -o build/components.css", - "start": "node scripts/babelcheck.js && parallelshell \"npm run start:emojione\" \"npm run start:js\" \"npm run start:skins:css\"", + "start": "node scripts/babelcheck.js && parallelshell \"npm run start:emojione\" \"npm run start:res\" \"npm run start:config\" \"npm run start:js\" \"npm run start:skins:css\"", "start:prod": "parallelshell \"npm run start:emojione\" \"npm run start:js:prod\" \"npm run start:skins:css\"", - "clean": "rimraf build lib vector/olm.* vector/bundle.* vector/emojione vector/index.html", + "clean": "rimraf build lib webapp", "prepublish": "npm run build:compile", "test": "karma start --single-run=true --autoWatch=false --browsers PhantomJS --colors=false", "test:multi": "karma start" @@ -128,12 +132,12 @@ "//asar=false": "https://github.com/electron-userland/electron-builder/issues/675", "asar": false, "dereference": true, - "//files": "We bundle everything, so we only need to include vector/", + "//files": "We bundle everything, so we only need to include webapp/", "files": [ "!**/*", "electron/src/**", "electron/img/**", - "vector/**", + "webapp/**", "package.json" ], "squirrelWindows": { diff --git a/vector/media/busy.mp3 b/res/media/busy.mp3 similarity index 100% rename from vector/media/busy.mp3 rename to res/media/busy.mp3 diff --git a/vector/media/busy.ogg b/res/media/busy.ogg similarity index 100% rename from vector/media/busy.ogg rename to res/media/busy.ogg diff --git a/vector/media/callend.mp3 b/res/media/callend.mp3 similarity index 100% rename from vector/media/callend.mp3 rename to res/media/callend.mp3 diff --git a/vector/media/callend.ogg b/res/media/callend.ogg similarity index 100% rename from vector/media/callend.ogg rename to res/media/callend.ogg diff --git a/vector/media/message.mp3 b/res/media/message.mp3 similarity index 100% rename from vector/media/message.mp3 rename to res/media/message.mp3 diff --git a/vector/media/message.ogg b/res/media/message.ogg similarity index 100% rename from vector/media/message.ogg rename to res/media/message.ogg diff --git a/vector/media/ring.mp3 b/res/media/ring.mp3 similarity index 100% rename from vector/media/ring.mp3 rename to res/media/ring.mp3 diff --git a/vector/media/ring.ogg b/res/media/ring.ogg similarity index 100% rename from vector/media/ring.ogg rename to res/media/ring.ogg diff --git a/vector/media/ringback.mp3 b/res/media/ringback.mp3 similarity index 100% rename from vector/media/ringback.mp3 rename to res/media/ringback.mp3 diff --git a/vector/media/ringback.ogg b/res/media/ringback.ogg similarity index 100% rename from vector/media/ringback.ogg rename to res/media/ringback.ogg diff --git a/vector/vector-icons/android-chrome-144x144.png b/res/vector-icons/android-chrome-144x144.png similarity index 100% rename from vector/vector-icons/android-chrome-144x144.png rename to res/vector-icons/android-chrome-144x144.png diff --git a/vector/vector-icons/android-chrome-192x192.png b/res/vector-icons/android-chrome-192x192.png similarity index 100% rename from vector/vector-icons/android-chrome-192x192.png rename to res/vector-icons/android-chrome-192x192.png diff --git a/vector/vector-icons/android-chrome-36x36.png b/res/vector-icons/android-chrome-36x36.png similarity index 100% rename from vector/vector-icons/android-chrome-36x36.png rename to res/vector-icons/android-chrome-36x36.png diff --git a/vector/vector-icons/android-chrome-48x48.png b/res/vector-icons/android-chrome-48x48.png similarity index 100% rename from vector/vector-icons/android-chrome-48x48.png rename to res/vector-icons/android-chrome-48x48.png diff --git a/vector/vector-icons/android-chrome-72x72.png b/res/vector-icons/android-chrome-72x72.png similarity index 100% rename from vector/vector-icons/android-chrome-72x72.png rename to res/vector-icons/android-chrome-72x72.png diff --git a/vector/vector-icons/android-chrome-96x96.png b/res/vector-icons/android-chrome-96x96.png similarity index 100% rename from vector/vector-icons/android-chrome-96x96.png rename to res/vector-icons/android-chrome-96x96.png diff --git a/vector/vector-icons/apple-touch-icon-114x114.png b/res/vector-icons/apple-touch-icon-114x114.png similarity index 100% rename from vector/vector-icons/apple-touch-icon-114x114.png rename to res/vector-icons/apple-touch-icon-114x114.png diff --git a/vector/vector-icons/apple-touch-icon-120x120.png b/res/vector-icons/apple-touch-icon-120x120.png similarity index 100% rename from vector/vector-icons/apple-touch-icon-120x120.png rename to res/vector-icons/apple-touch-icon-120x120.png diff --git a/vector/vector-icons/apple-touch-icon-144x144.png b/res/vector-icons/apple-touch-icon-144x144.png similarity index 100% rename from vector/vector-icons/apple-touch-icon-144x144.png rename to res/vector-icons/apple-touch-icon-144x144.png diff --git a/vector/vector-icons/apple-touch-icon-152x152.png b/res/vector-icons/apple-touch-icon-152x152.png similarity index 100% rename from vector/vector-icons/apple-touch-icon-152x152.png rename to res/vector-icons/apple-touch-icon-152x152.png diff --git a/vector/vector-icons/apple-touch-icon-180x180.png b/res/vector-icons/apple-touch-icon-180x180.png similarity index 100% rename from vector/vector-icons/apple-touch-icon-180x180.png rename to res/vector-icons/apple-touch-icon-180x180.png diff --git a/vector/vector-icons/apple-touch-icon-57x57.png b/res/vector-icons/apple-touch-icon-57x57.png similarity index 100% rename from vector/vector-icons/apple-touch-icon-57x57.png rename to res/vector-icons/apple-touch-icon-57x57.png diff --git a/vector/vector-icons/apple-touch-icon-60x60.png b/res/vector-icons/apple-touch-icon-60x60.png similarity index 100% rename from vector/vector-icons/apple-touch-icon-60x60.png rename to res/vector-icons/apple-touch-icon-60x60.png diff --git a/vector/vector-icons/apple-touch-icon-72x72.png b/res/vector-icons/apple-touch-icon-72x72.png similarity index 100% rename from vector/vector-icons/apple-touch-icon-72x72.png rename to res/vector-icons/apple-touch-icon-72x72.png diff --git a/vector/vector-icons/apple-touch-icon-76x76.png b/res/vector-icons/apple-touch-icon-76x76.png similarity index 100% rename from vector/vector-icons/apple-touch-icon-76x76.png rename to res/vector-icons/apple-touch-icon-76x76.png diff --git a/vector/vector-icons/apple-touch-icon-precomposed.png b/res/vector-icons/apple-touch-icon-precomposed.png similarity index 100% rename from vector/vector-icons/apple-touch-icon-precomposed.png rename to res/vector-icons/apple-touch-icon-precomposed.png diff --git a/vector/vector-icons/apple-touch-icon.png b/res/vector-icons/apple-touch-icon.png similarity index 100% rename from vector/vector-icons/apple-touch-icon.png rename to res/vector-icons/apple-touch-icon.png diff --git a/vector/vector-icons/browserconfig.xml b/res/vector-icons/browserconfig.xml similarity index 100% rename from vector/vector-icons/browserconfig.xml rename to res/vector-icons/browserconfig.xml diff --git a/vector/vector-icons/favicon-16x16.png b/res/vector-icons/favicon-16x16.png similarity index 100% rename from vector/vector-icons/favicon-16x16.png rename to res/vector-icons/favicon-16x16.png diff --git a/vector/vector-icons/favicon-32x32.png b/res/vector-icons/favicon-32x32.png similarity index 100% rename from vector/vector-icons/favicon-32x32.png rename to res/vector-icons/favicon-32x32.png diff --git a/vector/vector-icons/favicon-96x96.png b/res/vector-icons/favicon-96x96.png similarity index 100% rename from vector/vector-icons/favicon-96x96.png rename to res/vector-icons/favicon-96x96.png diff --git a/vector/vector-icons/favicon.ico b/res/vector-icons/favicon.ico similarity index 100% rename from vector/vector-icons/favicon.ico rename to res/vector-icons/favicon.ico diff --git a/vector/vector-icons/manifest.json b/res/vector-icons/manifest.json similarity index 100% rename from vector/vector-icons/manifest.json rename to res/vector-icons/manifest.json diff --git a/vector/vector-icons/mstile-144x144.png b/res/vector-icons/mstile-144x144.png similarity index 100% rename from vector/vector-icons/mstile-144x144.png rename to res/vector-icons/mstile-144x144.png diff --git a/vector/vector-icons/mstile-150x150.png b/res/vector-icons/mstile-150x150.png similarity index 100% rename from vector/vector-icons/mstile-150x150.png rename to res/vector-icons/mstile-150x150.png diff --git a/vector/vector-icons/mstile-310x150.png b/res/vector-icons/mstile-310x150.png similarity index 100% rename from vector/vector-icons/mstile-310x150.png rename to res/vector-icons/mstile-310x150.png diff --git a/vector/vector-icons/mstile-310x310.png b/res/vector-icons/mstile-310x310.png similarity index 100% rename from vector/vector-icons/mstile-310x310.png rename to res/vector-icons/mstile-310x310.png diff --git a/vector/vector-icons/mstile-70x70.png b/res/vector-icons/mstile-70x70.png similarity index 100% rename from vector/vector-icons/mstile-70x70.png rename to res/vector-icons/mstile-70x70.png diff --git a/jenkins.sh b/scripts/jenkins.sh similarity index 77% rename from jenkins.sh rename to scripts/jenkins.sh index 2bccf0f8..58f214b8 100755 --- a/jenkins.sh +++ b/scripts/jenkins.sh @@ -25,11 +25,7 @@ cp -r olm/package node_modules/olm # run the mocha tests npm run test -# build our artifacts; dumps them in ./vector -npm run build:dev - -# gzip up ./vector -rm vector-*.tar.gz || true # rm previous artifacts without failing if it doesn't exist +rm dist/vector-*.tar.gz || true # rm previous artifacts without failing if it doesn't exist # node_modules deps from 'npm install' don't have a .git dir so can't # rev-parse; but they do set the commit in package.json under 'gitHead' which @@ -39,4 +35,4 @@ JSSDK_SHA=$(grep 'gitHead' node_modules/matrix-js-sdk/package.json | cut -d \" - VECTOR_SHA=$(git rev-parse --short=12 HEAD) # use the ACTUAL SHA rather than assume develop -tar -zcvhf vector-$VECTOR_SHA-react-$REACT_SHA-js-$JSSDK_SHA.tar.gz vector #g[z]ip, [c]reate archive, [v]erbose, [f]ilename, [h]ard-dereference (do not archive symlinks) +DIST_VERSION=vector-$VECTOR_SHA-react-$REACT_SHA-js-$JSSDK_SHA scripts/package.sh -d diff --git a/scripts/package.sh b/scripts/package.sh index d5deffef..9ae2901a 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -2,15 +2,21 @@ set -e +dev="" +if [ "$1" == '-d' ]; then + dev=":dev" +fi + if [ -n "$DIST_VERSION" ]; then version=$DIST_VERSION else version=`git describe --dirty --tags || echo unknown` fi -npm run build +npm run clean +npm run build$dev mkdir -p dist -cp -r vector vector-$version +cp -r webapp vector-$version echo $version > vector-$version/version tar chvzf dist/vector-$version.tar.gz vector-$version rm -r vector-$version diff --git a/deploy/redeploy.py b/scripts/redeploy.py similarity index 93% rename from deploy/redeploy.py rename to scripts/redeploy.py index 2839422b..6e6e64aa 100755 --- a/deploy/redeploy.py +++ b/scripts/redeploy.py @@ -110,20 +110,17 @@ def on_receive_jenkins_poke(): filename = download_file(tar_gz_url) print("Downloaded file: %s" % filename) name_str = filename.replace(".tar.gz", "") - untar_location = os.path.join(arg_extract_path, name_str) - untar_to(filename, untar_location) + untar_to(filename, arg_extract_path) + + extracted_dir = os.path.join(arg_extract_path, name_str) if arg_should_clean: os.remove(filename) - # stamp the version somewhere JS can get to it - with open(os.path.join(untar_location, "vector/version"), "w") as stamp_file: - stamp_file.write(name_str) - - create_symlink(source=os.path.join(untar_location, "vector"), linkname=arg_symlink) + create_symlink(source=extracted_dir, linkname=arg_symlink) if arg_config_location: - create_symlink(source=arg_config_location, linkname=os.path.join(untar_location, "vector", 'config.json')) + create_symlink(source=arg_config_location, linkname=os.path.join(extracted_dir, 'config.json')) return jsonify({}) diff --git a/vector/fonts b/vector/fonts deleted file mode 120000 index 1c206eff..00000000 --- a/vector/fonts +++ /dev/null @@ -1 +0,0 @@ -../src/skins/vector/fonts \ No newline at end of file diff --git a/vector/img b/vector/img deleted file mode 120000 index 855fa973..00000000 --- a/vector/img +++ /dev/null @@ -1 +0,0 @@ -../src/skins/vector/img/ \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index 5d669bd2..4f350dd4 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -39,7 +39,7 @@ module.exports = { ], }, output: { - path: path.join(__dirname, "vector"), + path: path.join(__dirname, "webapp"), filename: "[name].[chunkhash].js", devtoolModuleFilenameTemplate: function(info) { // Reading input source maps gives only relative paths here for @@ -98,8 +98,8 @@ module.exports = { // configuration for the webpack-dev-server devServer: { - // serve unwebpacked assets from vector. - contentBase: './vector', + // serve unwebpacked assets from webapp. + contentBase: './webapp', }, };