Skip to content

Commit

Permalink
docs: organize options by importance
Browse files Browse the repository at this point in the history
  • Loading branch information
bcanseco committed Oct 22, 2018
1 parent 743322a commit d9f3f2e
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 60 deletions.
88 changes: 44 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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).
Expand Down
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
24 changes: 12 additions & 12 deletions src/options.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"type": "object",
"properties": {
"extensionId": {
"type": "string"
},
"clientId": {
"type": "string"
},
"clientSecret": {
"type": "string"
},
"refreshToken": {
"type": "string"
},
"path": {
"type": "string"
},
Expand All @@ -15,18 +27,6 @@
},
"disabled": {
"type": "boolean"
},
"extensionId": {
"type": "string"
},
"clientId": {
"type": "string"
},
"clientSecret": {
"type": "string"
},
"refreshToken": {
"type": "string"
}
},
"additionalProperties": false
Expand Down

0 comments on commit d9f3f2e

Please sign in to comment.