From 6d94f35c33a226d126b9773c9484b9842377b83d Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 11 May 2017 10:35:56 +0100 Subject: [PATCH] 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 cba50a69e7..6dd2b988c3 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 884811af93..a1f06b00b1 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 4bf0b0f984..0000000000 --- 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);