Add author info to extension manifest

This commit is contained in:
hensm
2019-03-12 11:25:59 +00:00
parent 8f942373e7
commit 98d0e7acce
3 changed files with 17 additions and 6 deletions

View File

@@ -11,7 +11,8 @@ const { ROOT
, DIST_PATH
, UNPACKED_PATH } = require("./lib/paths");
const packageMeta = require(`${ROOT}/package.json`);
const packageMeta = require(`${ROOT}/../package.json`);
const extPackageMeta = require(`${ROOT}/package.json`);
const appPackageMeta = require(`${ROOT}/../app/package.json`);
@@ -21,7 +22,7 @@ const argv = minimist(process.argv.slice(2), {
, default: {
package: false // Should package with web-ext
, watch: false // Should run webpack in watch mode
, mirroringAppId: packageMeta.__mirroringAppId // Chromecast receiver app ID
, mirroringAppId: extPackageMeta.__mirroringAppId // Chromecast receiver app ID
, mode: "development" // webpack mode
}
});
@@ -48,9 +49,9 @@ const webpackConfig = require(`${ROOT}/webpack.config.js`)({
? UNPACKED_PATH
: DIST_PATH
, extensionName: packageMeta.__extensionName
, extensionId: packageMeta.__extensionId
, extensionVersion: packageMeta.__extensionVersion
, extensionName: extPackageMeta.__extensionName
, extensionId: extPackageMeta.__extensionId
, extensionVersion: extPackageMeta.__extensionVersion
, applicationName: appPackageMeta.__applicationName
, applicationVersion: appPackageMeta.__applicationVersion
, mirroringAppId: argv.mirroringAppId
@@ -59,6 +60,10 @@ const webpackConfig = require(`${ROOT}/webpack.config.js`)({
, contentSecurityPolicy: argv.mode === "production"
? "default-src 'self'"
: "script-src 'self' 'unsafe-eval'; object-src 'self'"
// Developer info
, author: packageMeta.author
, authorHomepage: packageMeta.homepage
});
// Add mode to config

View File

@@ -2,6 +2,10 @@
"name": "__MSG_extensionName__"
, "description": "__MSG_extensionDescription__"
, "version": "EXTENSION_VERSION"
, "developer": {
"name": "AUTHOR"
, "url": "AUTHOR_HOMEPAGE"
}
, "applications": {
"gecko": {

View File

@@ -50,7 +50,9 @@ module.exports = (env) => ({
.replace("MIRRORING_APP_ID", env.mirroringAppId)
.replace("APPLICATION_NAME", env.applicationName)
.replace("APPLICATION_VERSION", env.applicationVersion)
.replace("CONTENT_SECURITY_POLICY", env.contentSecurityPolicy));
.replace("CONTENT_SECURITY_POLICY", env.contentSecurityPolicy)
.replace("AUTHOR", env.author)
.replace("AUTHOR_HOMEPAGE", env.authorHomepage));
}
return content;