diff --git a/README.md b/README.md index 439bf21..77fe170 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,50 @@ And run `webpack` via your preferred method. ## Options +### `extensionId` + +Type: `String` +Default: `process.env.GOOGLE_EXTENSION_ID` + +If not provided via options, this must be present in your environment as `GOOGLE_EXTENSION_ID`. You can get this from your extension's control panel on the [Developer Dashboard](https://chrome.google.com/webstore/devconsole). + +```console +$ GOOGLE_EXTENSION_ID=extensionidgoeshere123 webpack +``` + +### `clientId` + +Type: `String` +Default: `process.env.GOOGLE_CLIENT_ID` + +If not provided via options, this must be present in your environment as `GOOGLE_CLIENT_ID`. You can get this and your other secret keys by following [this guide](https://developer.chrome.com/webstore/using_webstore_api). + +```console +$ GOOGLE_CLIENT_ID=clientidgoeshere123 webpack +``` + +### `clientSecret` + +Type: `String` +Default: `process.env.GOOGLE_CLIENT_SECRET` + +If not provided via options, this must be present in your environment as `GOOGLE_CLIENT_SECRET`. You can get this and your other secret keys by following [this guide](https://developer.chrome.com/webstore/using_webstore_api). + +```console +$ GOOGLE_CLIENT_SECRET=clientsecretgoeshere123 webpack +``` + +### `refreshToken` + +Type: `String` +Default: `process.env.GOOGLE_REFRESH_TOKEN` + +If not provided via options, this must be present in your environment as `GOOGLE_REFRESH_TOKEN`. You can get this and your other secret keys by following [this guide](https://developer.chrome.com/webstore/using_webstore_api). + +```console +$ GOOGLE_REFRESH_TOKEN=refreshtokengoeshere123 webpack +``` + ### `path` Type: `String` @@ -111,50 +155,6 @@ new PublishExtensionPlugin({ }) ``` -### `extensionId` - -Type: `String` -Default: `process.env.GOOGLE_EXTENSION_ID` - -If not provided via options, this must be present in your environment as `GOOGLE_EXTENSION_ID`. You can get this from your extension's control panel on the [Developer Dashboard](https://chrome.google.com/webstore/devconsole). - -```console -$ GOOGLE_EXTENSION_ID=extensionidgoeshere123 webpack -``` - -### `clientId` - -Type: `String` -Default: `process.env.GOOGLE_CLIENT_ID` - -If not provided via options, this must be present in your environment as `GOOGLE_CLIENT_ID`. You can get this and your other secret keys by following [this guide](https://developer.chrome.com/webstore/using_webstore_api). - -```console -$ GOOGLE_CLIENT_ID=clientidgoeshere123 webpack -``` - -### `clientSecret` - -Type: `String` -Default: `process.env.GOOGLE_CLIENT_SECRET` - -If not provided via options, this must be present in your environment as `GOOGLE_CLIENT_SECRET`. You can get this and your other secret keys by following [this guide](https://developer.chrome.com/webstore/using_webstore_api). - -```console -$ GOOGLE_CLIENT_SECRET=clientsecretgoeshere123 webpack -``` - -### `refreshToken` - -Type: `String` -Default: `process.env.GOOGLE_REFRESH_TOKEN` - -If not provided via options, this must be present in your environment as `GOOGLE_REFRESH_TOKEN`. You can get this and your other secret keys by following [this guide](https://developer.chrome.com/webstore/using_webstore_api). - -```console -$ GOOGLE_REFRESH_TOKEN=refreshtokengoeshere123 webpack -``` - ## Contributing PRs are welcome! Please see the [contributing guide](.github/CONTRIBUTING.md). diff --git a/src/index.js b/src/index.js index d3a9cb5..bc5a508 100644 --- a/src/index.js +++ b/src/index.js @@ -14,16 +14,16 @@ import schema from './options'; export default class PublishExtensionPlugin { /** * @param {Object} [options] + * @param {String} [options.extensionId] Your extension's Chrome Web Store ID + * @param {String} [options.clientId] Google OAuth 2.0 client ID + * @param {String} [options.clientSecret] Google OAuth 2.0 client secret + * @param {String} [options.refreshToken] Google OAuth 2.0 refresh token * @param {String} [options.path] Path to a directory containing a manifest.json file. * If omitted, webpack's output.path directory will be used. * @param {Boolean} [options.throwOnFailure=false] Set true to throw an error if publishing is unsuccessful. * @param {Boolean} [options.keepBundleOnSuccess=false] Set true to keep the ZIP if publishing is successful. * @param {Boolean} [options.silent=false] Set true to suppress logging * @param {Boolean} [options.disabled=false] Set true to disable the plugin (same as not having it). - * @param {String} [options.extensionId] Your extension's Chrome Web Store ID - * @param {String} [options.clientId] Google OAuth 2.0 client ID - * @param {String} [options.clientSecret] Google OAuth 2.0 client secret - * @param {String} [options.refreshToken] Google OAuth 2.0 refresh token */ constructor(options = {}) { validateOptions(schema, this.options = options, this.constructor.name); diff --git a/src/options.json b/src/options.json index 5975bfd..10b8119 100644 --- a/src/options.json +++ b/src/options.json @@ -1,6 +1,18 @@ { "type": "object", "properties": { + "extensionId": { + "type": "string" + }, + "clientId": { + "type": "string" + }, + "clientSecret": { + "type": "string" + }, + "refreshToken": { + "type": "string" + }, "path": { "type": "string" }, @@ -15,18 +27,6 @@ }, "disabled": { "type": "boolean" - }, - "extensionId": { - "type": "string" - }, - "clientId": { - "type": "string" - }, - "clientSecret": { - "type": "string" - }, - "refreshToken": { - "type": "string" } }, "additionalProperties": false