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

View File

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

View File

@@ -50,7 +50,9 @@ module.exports = (env) => ({
.replace("MIRRORING_APP_ID", env.mirroringAppId) .replace("MIRRORING_APP_ID", env.mirroringAppId)
.replace("APPLICATION_NAME", env.applicationName) .replace("APPLICATION_NAME", env.applicationName)
.replace("APPLICATION_VERSION", env.applicationVersion) .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; return content;