Use single source of info for dapp meta (build & display) (#4217)

* Add skipBuild flag

* Only use builtin.json to specify location

* Re-remove dapps/index.js
This commit is contained in:
Jaco Greeff 2017-01-19 14:07:41 +01:00 committed by Gav Wood
parent ab073efbd9
commit e62cda36c7
4 changed files with 12 additions and 35 deletions

View File

@ -1,25 +0,0 @@
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
module.exports = [
{ name: 'basiccoin', entry: 'basiccoin.js', title: 'Basic Token Deployment' },
{ name: 'dappreg', entry: 'dappreg.js', title: 'Dapp Registry' },
{ name: 'githubhint', entry: 'githubhint.js', title: 'GitHub Hint', secure: true },
{ name: 'localtx', entry: 'localtx.js', title: 'Local transactions Viewer', secure: true },
{ name: 'registry', entry: 'registry.js', title: 'Registry' },
{ name: 'signaturereg', entry: 'signaturereg.js', title: 'Method Signature Registry' },
{ name: 'tokenreg', entry: 'tokenreg.js', title: 'Token Registry' }
];

View File

@ -71,7 +71,8 @@
"description": "A Web 2.0 hosted pseudo-dapps browser.", "description": "A Web 2.0 hosted pseudo-dapps browser.",
"author": "Parity Team <admin@ethcore.io>", "author": "Parity Team <admin@ethcore.io>",
"version": "1.0.0", "version": "1.0.0",
"visible": true "visible": true,
"skipBuild": true
}, },
{ {
"id": "0xa635a9326814bded464190eddf0bdb90ce92d40ea2359cf553ea80e3c5a4076c", "id": "0xa635a9326814bded464190eddf0bdb90ce92d40ea2359cf553ea80e3c5a4076c",
@ -81,6 +82,7 @@
"version": "0.3", "version": "0.3",
"author": "Gav Wood <gavin@ethcore.io>", "author": "Gav Wood <gavin@ethcore.io>",
"visible": true, "visible": true,
"secure": true "secure": true,
"skipBuild": true
} }
] ]

View File

@ -26,7 +26,7 @@ const ServiceWorkerWebpackPlugin = require('serviceworker-webpack-plugin');
const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin'); const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin');
const Shared = require('./shared'); const Shared = require('./shared');
const DAPPS = require('../src/dapps'); const DAPPS = require('../src/views/Dapps/builtin.json');
const FAVICON = path.resolve(__dirname, '../assets/images/parity-logo-black-no-text.png'); const FAVICON = path.resolve(__dirname, '../assets/images/parity-logo-black-no-text.png');
@ -138,14 +138,14 @@ module.exports = {
}, },
plugins: (function () { plugins: (function () {
const DappsHTMLInjection = DAPPS.map((dapp) => { const DappsHTMLInjection = DAPPS.filter((dapp) => !dapp.skipBuild).map((dapp) => {
return new HtmlWebpackPlugin({ return new HtmlWebpackPlugin({
title: dapp.title, title: dapp.name,
filename: dapp.name + '.html', filename: dapp.url + '.html',
template: './dapps/index.ejs', template: './dapps/index.ejs',
favicon: FAVICON, favicon: FAVICON,
secure: dapp.secure, secure: dapp.secure,
chunks: [ isProd ? null : 'commons', dapp.name ] chunks: [ isProd ? null : 'commons', dapp.url ]
}); });
}); });

View File

@ -155,10 +155,10 @@ function getPlugins (_isProd = isProd) {
} }
function getDappsEntry () { function getDappsEntry () {
const DAPPS = require('../src/dapps'); const DAPPS = require('../src/views/Dapps/builtin.json');
return DAPPS.reduce((_entry, dapp) => { return DAPPS.filter((dapp) => !dapp.skipBuild).reduce((_entry, dapp) => {
_entry[dapp.name] = './dapps/' + dapp.entry; _entry[dapp.url] = './dapps/' + dapp.url + '.js';
return _entry; return _entry;
}, {}); }, {});
} }