From c5d37ab2fbec70fab03e7fac9c48b61fece17989 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 3 May 2017 22:56:39 +0100 Subject: [PATCH 1/4] add to manifest for #334 Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- res/vector-icons/manifest.json | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/res/vector-icons/manifest.json b/res/vector-icons/manifest.json index feab1753..2cf10bed 100644 --- a/res/vector-icons/manifest.json +++ b/res/vector-icons/manifest.json @@ -1,5 +1,9 @@ { - "name": "Riot", + "name": "Riot - Matrix Client", + "short_name": "Riot", + "display": "standalone", + "theme_color": "#76CFA6", + "start_url": "../", "icons": [ { "src": "android-chrome-36x36.png", @@ -37,5 +41,13 @@ "type": "image\/png", "density": "4.0" } - ] + ], + "related_applications": [{ + "platform": "play", + "url": "https://play.google.com/store/apps/details?id=im.vector.alpha", + "id": "im.vector.alpha" + }, { + "platform": "itunes", + "url": "https://itunes.apple.com/gb/app/riot-open-source-team-collaboration-via-matrix/id1083446067" + }] } From 6d94f35c33a226d126b9773c9484b9842377b83d Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 11 May 2017 10:35:56 +0100 Subject: [PATCH 2/4] Automatically update component-index Following changes to the react-sdk, reskindex can now be updated using the "-w" (watch) equivalent of the reskindex script. -Alter npm scripts so that reskindex is run when building once and so that reskindex:start is runwhen developing -Remove and stop tracking component-index, this will now only be created at build-time --- .gitignore | 1 + package.json | 11 +++--- src/component-index.js | 90 ------------------------------------------ 3 files changed, 7 insertions(+), 95 deletions(-) delete mode 100644 src/component-index.js diff --git a/.gitignore b/.gitignore index cba50a69..6dd2b988 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ npm-debug.log electron/dist electron/pub /config.json +/src/component-index.js diff --git a/package.json b/package.json index 884811af..a1f06b00 100644 --- a/package.json +++ b/package.json @@ -27,22 +27,23 @@ "matrix-react-parent": "matrix-react-sdk", "scripts": { "reskindex": "reskindex -h src/header", + "reskindex:watch": "reskindex -h src/header -w", "build:res": "node scripts/copy-res.js", "build:modernizr": "modernizr -c .modernizr.json -d src/vector/modernizr.js", - "build:compile": "babel --source-maps -d lib src", + "build:compile": "npm run reskindex && babel --source-maps -d lib src", "build:bundle": "cross-env NODE_ENV=production webpack -p --progress", "build:bundle:dev": "webpack --optimize-occurence-order --progress", "build:electron": "npm run clean && npm run build && build -wml --ia32 --x64", - "build": "npm run build:res && npm run build:bundle", - "build:dev": "npm run build:res && npm run build:bundle:dev", + "build": "npm run reskindex && npm run build:res && npm run build:bundle", + "build:dev": "npm run reskindex && npm run build:res && npm run build:bundle:dev", "dist": "scripts/package.sh", "install:electron": "install-app-deps", "electron": "npm run install:electron && electron .", "start:res": "node scripts/copy-res.js -w", "start:js": "webpack-dev-server --output-filename=bundles/_dev_/[name].js --output-chunk-file=bundles/_dev_/[name].js -w --progress", "start:js:prod": "cross-env NODE_ENV=production webpack-dev-server -w --progress", - "start": "parallelshell \"npm run start:res\" \"npm run start:js\"", - "start:prod": "parallelshell \"npm run start:res\" \"npm run start:js:prod\"", + "start": "parallelshell \"npm run reskindex:watch\" \"npm run start:res\" \"npm run start:js\"", + "start:prod": "parallelshell \"npm run reskindex:watch\" \"npm run start:res\" \"npm run start:js:prod\"", "lint": "eslint src/", "lintall": "eslint src/ test/", "clean": "rimraf lib webapp electron/dist", diff --git a/src/component-index.js b/src/component-index.js deleted file mode 100644 index 4bf0b0f9..00000000 --- a/src/component-index.js +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright 2015, 2016 OpenMarket Ltd - -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. -*/ - -/* - * THIS FILE IS AUTO-GENERATED - * You can edit it you like, but your changes will be overwritten, - * so you'd just be trying to swim upstream like a salmon. - * You are not a salmon. - * - * To update it, run: - * ./reskindex.js -h header - */ - -module.exports.components = require('matrix-react-sdk/lib/component-index').components; - -import structures$BottomLeftMenu from './components/structures/BottomLeftMenu'; -structures$BottomLeftMenu && (module.exports.components['structures.BottomLeftMenu'] = structures$BottomLeftMenu); -import structures$CompatibilityPage from './components/structures/CompatibilityPage'; -structures$CompatibilityPage && (module.exports.components['structures.CompatibilityPage'] = structures$CompatibilityPage); -import structures$HomePage from './components/structures/HomePage'; -structures$HomePage && (module.exports.components['structures.HomePage'] = structures$HomePage); -import structures$LeftPanel from './components/structures/LeftPanel'; -structures$LeftPanel && (module.exports.components['structures.LeftPanel'] = structures$LeftPanel); -import structures$RightPanel from './components/structures/RightPanel'; -structures$RightPanel && (module.exports.components['structures.RightPanel'] = structures$RightPanel); -import structures$RoomDirectory from './components/structures/RoomDirectory'; -structures$RoomDirectory && (module.exports.components['structures.RoomDirectory'] = structures$RoomDirectory); -import structures$RoomSubList from './components/structures/RoomSubList'; -structures$RoomSubList && (module.exports.components['structures.RoomSubList'] = structures$RoomSubList); -import structures$RoomSubListHeader from './components/structures/RoomSubListHeader'; -structures$RoomSubListHeader && (module.exports.components['structures.RoomSubListHeader'] = structures$RoomSubListHeader); -import structures$SearchBox from './components/structures/SearchBox'; -structures$SearchBox && (module.exports.components['structures.SearchBox'] = structures$SearchBox); -import structures$ViewSource from './components/structures/ViewSource'; -structures$ViewSource && (module.exports.components['structures.ViewSource'] = structures$ViewSource); -import views$context_menus$MessageContextMenu from './components/views/context_menus/MessageContextMenu'; -views$context_menus$MessageContextMenu && (module.exports.components['views.context_menus.MessageContextMenu'] = views$context_menus$MessageContextMenu); -import views$context_menus$RoomTileContextMenu from './components/views/context_menus/RoomTileContextMenu'; -views$context_menus$RoomTileContextMenu && (module.exports.components['views.context_menus.RoomTileContextMenu'] = views$context_menus$RoomTileContextMenu); -import views$dialogs$BugReportDialog from './components/views/dialogs/BugReportDialog'; -views$dialogs$BugReportDialog && (module.exports.components['views.dialogs.BugReportDialog'] = views$dialogs$BugReportDialog); -import views$dialogs$ChangelogDialog from './components/views/dialogs/ChangelogDialog'; -views$dialogs$ChangelogDialog && (module.exports.components['views.dialogs.ChangelogDialog'] = views$dialogs$ChangelogDialog); -import views$directory$NetworkDropdown from './components/views/directory/NetworkDropdown'; -views$directory$NetworkDropdown && (module.exports.components['views.directory.NetworkDropdown'] = views$directory$NetworkDropdown); -import views$elements$ImageView from './components/views/elements/ImageView'; -views$elements$ImageView && (module.exports.components['views.elements.ImageView'] = views$elements$ImageView); -import views$elements$Spinner from './components/views/elements/Spinner'; -views$elements$Spinner && (module.exports.components['views.elements.Spinner'] = views$elements$Spinner); -import views$globals$GuestWarningBar from './components/views/globals/GuestWarningBar'; -views$globals$GuestWarningBar && (module.exports.components['views.globals.GuestWarningBar'] = views$globals$GuestWarningBar); -import views$globals$MatrixToolbar from './components/views/globals/MatrixToolbar'; -views$globals$MatrixToolbar && (module.exports.components['views.globals.MatrixToolbar'] = views$globals$MatrixToolbar); -import views$globals$NewVersionBar from './components/views/globals/NewVersionBar'; -views$globals$NewVersionBar && (module.exports.components['views.globals.NewVersionBar'] = views$globals$NewVersionBar); -import views$login$VectorCustomServerDialog from './components/views/login/VectorCustomServerDialog'; -views$login$VectorCustomServerDialog && (module.exports.components['views.login.VectorCustomServerDialog'] = views$login$VectorCustomServerDialog); -import views$login$VectorLoginFooter from './components/views/login/VectorLoginFooter'; -views$login$VectorLoginFooter && (module.exports.components['views.login.VectorLoginFooter'] = views$login$VectorLoginFooter); -import views$login$VectorLoginHeader from './components/views/login/VectorLoginHeader'; -views$login$VectorLoginHeader && (module.exports.components['views.login.VectorLoginHeader'] = views$login$VectorLoginHeader); -import views$messages$DateSeparator from './components/views/messages/DateSeparator'; -views$messages$DateSeparator && (module.exports.components['views.messages.DateSeparator'] = views$messages$DateSeparator); -import views$messages$MessageTimestamp from './components/views/messages/MessageTimestamp'; -views$messages$MessageTimestamp && (module.exports.components['views.messages.MessageTimestamp'] = views$messages$MessageTimestamp); -import views$rooms$DNDRoomTile from './components/views/rooms/DNDRoomTile'; -views$rooms$DNDRoomTile && (module.exports.components['views.rooms.DNDRoomTile'] = views$rooms$DNDRoomTile); -import views$rooms$RoomDropTarget from './components/views/rooms/RoomDropTarget'; -views$rooms$RoomDropTarget && (module.exports.components['views.rooms.RoomDropTarget'] = views$rooms$RoomDropTarget); -import views$rooms$RoomTooltip from './components/views/rooms/RoomTooltip'; -views$rooms$RoomTooltip && (module.exports.components['views.rooms.RoomTooltip'] = views$rooms$RoomTooltip); -import views$rooms$SearchBar from './components/views/rooms/SearchBar'; -views$rooms$SearchBar && (module.exports.components['views.rooms.SearchBar'] = views$rooms$SearchBar); -import views$settings$IntegrationsManager from './components/views/settings/IntegrationsManager'; -views$settings$IntegrationsManager && (module.exports.components['views.settings.IntegrationsManager'] = views$settings$IntegrationsManager); -import views$settings$Notifications from './components/views/settings/Notifications'; -views$settings$Notifications && (module.exports.components['views.settings.Notifications'] = views$settings$Notifications); From ffa53ca2053d6e30d4a834a3eb3dd22ce65c3b12 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@googlemail.com> Date: Thu, 11 May 2017 11:17:55 +0100 Subject: [PATCH 3/4] Update manifest.json --- res/vector-icons/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/vector-icons/manifest.json b/res/vector-icons/manifest.json index 2cf10bed..7536efeb 100644 --- a/res/vector-icons/manifest.json +++ b/res/vector-icons/manifest.json @@ -1,5 +1,5 @@ { - "name": "Riot - Matrix Client", + "name": "Riot - open team collaboration", "short_name": "Riot", "display": "standalone", "theme_color": "#76CFA6", From 3c5594e03464cf8e9145837cecafa01444aa86bf Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 11 May 2017 13:12:26 +0100 Subject: [PATCH 4/4] move manifest.json outward so it is scoped properly this will matter more when we add a service worker Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- res/manifest.json | 56 ++++++++++++++++++++++++++++++++++ res/vector-icons/manifest.json | 53 -------------------------------- scripts/copy-res.js | 1 + src/vector/index.html | 2 +- 4 files changed, 58 insertions(+), 54 deletions(-) create mode 100644 res/manifest.json delete mode 100644 res/vector-icons/manifest.json diff --git a/res/manifest.json b/res/manifest.json new file mode 100644 index 00000000..75b18212 --- /dev/null +++ b/res/manifest.json @@ -0,0 +1,56 @@ +{ + "name": "Riot - open team collaboration", + "short_name": "Riot", + "display": "standalone", + "theme_color": "#76CFA6", + "start_url": "index.html", + "icons": [ + { + "src": "vector-icons/android-chrome-36x36.png", + "sizes": "36x36", + "type": "image\/png", + "density": "0.75" + }, + { + "src": "vector-icons/android-chrome-48x48.png", + "sizes": "48x48", + "type": "image\/png", + "density": "1.0" + }, + { + "src": "vector-icons/android-chrome-72x72.png", + "sizes": "72x72", + "type": "image\/png", + "density": "1.5" + }, + { + "src": "vector-icons/android-chrome-96x96.png", + "sizes": "96x96", + "type": "image\/png", + "density": "2.0" + }, + { + "src": "vector-icons/android-chrome-144x144.png", + "sizes": "144x144", + "type": "image\/png", + "density": "3.0" + }, + { + "src": "vector-icons/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image\/png", + "density": "4.0" + } + ], + "related_applications": [ + { + "platform": "play", + "url": "https://play.google.com/store/apps/details?id=im.vector.alpha", + "id": "im.vector.alpha" + }, + { + "platform": "itunes", + "url": "https://itunes.apple.com/gb/app/riot-open-source-team-collaboration-via-matrix/id1083446067" + } + ] +} diff --git a/res/vector-icons/manifest.json b/res/vector-icons/manifest.json deleted file mode 100644 index 7536efeb..00000000 --- a/res/vector-icons/manifest.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "Riot - open team collaboration", - "short_name": "Riot", - "display": "standalone", - "theme_color": "#76CFA6", - "start_url": "../", - "icons": [ - { - "src": "android-chrome-36x36.png", - "sizes": "36x36", - "type": "image\/png", - "density": "0.75" - }, - { - "src": "android-chrome-48x48.png", - "sizes": "48x48", - "type": "image\/png", - "density": "1.0" - }, - { - "src": "android-chrome-72x72.png", - "sizes": "72x72", - "type": "image\/png", - "density": "1.5" - }, - { - "src": "android-chrome-96x96.png", - "sizes": "96x96", - "type": "image\/png", - "density": "2.0" - }, - { - "src": "android-chrome-144x144.png", - "sizes": "144x144", - "type": "image\/png", - "density": "3.0" - }, - { - "src": "android-chrome-192x192.png", - "sizes": "192x192", - "type": "image\/png", - "density": "4.0" - } - ], - "related_applications": [{ - "platform": "play", - "url": "https://play.google.com/store/apps/details?id=im.vector.alpha", - "id": "im.vector.alpha" - }, { - "platform": "itunes", - "url": "https://itunes.apple.com/gb/app/riot-open-source-team-collaboration-via-matrix/id1083446067" - }] -} diff --git a/scripts/copy-res.js b/scripts/copy-res.js index 4702d5cf..5a43c4e6 100755 --- a/scripts/copy-res.js +++ b/scripts/copy-res.js @@ -7,6 +7,7 @@ // common parents. Hence, "res/{a,b}/**": the output will be "dest/a/..." and // "dest/b/...". const COPY_LIST = [ + ["res/manifest.json", "webapp"], ["res/{media,vector-icons}/**", "webapp"], ["src/skins/vector/{fonts,img}/**", "webapp"], ["node_modules/emojione/assets/svg/*", "webapp/emojione/svg/"], diff --git a/src/vector/index.html b/src/vector/index.html index 331bf684..38810f62 100644 --- a/src/vector/index.html +++ b/src/vector/index.html @@ -12,7 +12,7 @@ - +