Skip to content
Permalink
Browse files

Breaking: Use `telemetry` instead of `tracking`

Fix #2995
  • Loading branch information
molant committed Nov 21, 2019
1 parent 905ef61 commit 910c381ca41e95704138c90114f206f7613f9957
@@ -152,13 +152,13 @@ the [telemetry documentation][].

You can enable telemetry by adding either a parameter or an `env` variable.

1. By parameter: Add `--tracking=on` to the script in your `package.json`
1. By parameter: Add `--telemetry=on` to the script in your `package.json`

```json
…
"scripts": {
…
"test-hint": "hint https://webhint.io --debug --tracking=on"
"test-hint": "hint https://webhint.io --debug --telemetry=on"
},
…
```
@@ -175,10 +175,10 @@ You can enable telemetry by adding either a parameter or an `env` variable.
- checkout # check out the code in the project directory
# Add the necessary steps to deploy your website.
- run: npm install hint --no-save
- run: node node_modules/hint/dist/src/bin/hint.js https://url-to-your-project --tracking=on
- run: node node_modules/hint/dist/src/bin/hint.js https://url-to-your-project --telemetry=on
```

2. By `env` variable: You need to configure the `env` variable `HINT_TRACKING` in
2. By `env` variable: You need to configure the `env` variable `HINT_TELEMETRY` in
`.circleci/config.yml`:

```yml
@@ -189,7 +189,7 @@ You can enable telemetry by adding either a parameter or an `env` variable.
- image: circleci/node:lts-browsers
steps:
- checkout # check out the code in the project directory
- run: echo 'export HINT_TRACKING="on"' >> $BASH_ENV
- run: echo 'export HINT_TELEMETRY="on"' >> $BASH_ENV
- run: npm install
- run: npm run test-hint
```
@@ -140,7 +140,7 @@ environment:
{
...
"scripts": {
"test:staging": "hint https://example-staging.azurewebsites.net --tracking=on",
"test:staging": "hint https://example-staging.azurewebsites.net --telemetry=on",
...
}
}
@@ -146,14 +146,14 @@ the [telemetry documentation][].

You can enable telemetry by adding either a parameter or an `env` variable.

1. By parameter: Add `--tracking=on` to the script in your `package.json`
1. By parameter: Add `--telemetry=on` to the script in your `package.json`
`package.json`

```json
…
"scripts": {
…
"test-hint": "hint https://webhint.io --debug --tracking=on"
"test-hint": "hint https://webhint.io --debug --telemetry=on"
},
…
```
@@ -172,10 +172,10 @@ You can enable telemetry by adding either a parameter or an `env` variable.
script:
# Add the necessary steps to deploy your website.
- npm install hint --no-save
- node node_modules/hint/dist/src/bin/hint.js https://url-to-your-project --tracking=on
- node node_modules/hint/dist/src/bin/hint.js https://url-to-your-project --telemetry=on
```

2. By `env` variable: You need to configure the `env` variable `HINT_TRACKING` in
2. By `env` variable: You need to configure the `env` variable `HINT_TELEMETRY` in
`.travis.yml`:

```yml
@@ -187,14 +187,14 @@ You can enable telemetry by adding either a parameter or an `env` variable.
chrome: stable
env:
- HINT_TRACKING=on
- HINT_TELEMETRY=on
script:
- npm install
- npm run test-hint
```

**Note:** Supported values for `HINT_TRACKING` are `on` and `off`.
**Note:** Supported values for `HINT_TELEMETRY` are `on` and `off`.

## Further configuration

@@ -1,6 +1,6 @@
# Telemetry

## What are we tracking
## What are we looking at

At the end of the second run `webhint` we will ask if you want to
send `limited usage information` to help us to build a better product.
@@ -21,24 +21,24 @@ following information:
* The configuration created using `npm create hintrc`.
* When a parser is created using `npm create parser`.

If you want to set up the tracking information from the command line you
If you want to set up the telemetry information from the command line you
have two options:

* Run `webhint` with the parameter `--tracking=on|off`.
> E.g.: `hint http://example.com --tracking=on`
* Configure an environment variable `HINT_TRACKING` with the
* Run `webhint` with the parameter `--telemetry=on|off`.
> E.g.: `hint http://example.com --telemetry=on`
* Configure an environment variable `HINT_TELEMETRY` with the
value `on` or `off`.
In a CI environment you need to use one of these two options. If not,
you will see this message:

![Example output for the telemetry message](images/telemetrycimessage.jpg)

In case you are using both of them, `--tracking on|off` will have
In case you are using both of them, `--telemetry=on|off` will have
higher priority.

If you want to see a log in your console about what information `webhint`
is tracking, you can use the parameter `--analytics-debug`.
is sending, you can use the parameter `--analytics-debug`.

>E.g.: `hint http://example.com --analytics-debug`
@@ -12,11 +12,11 @@
* ------------------------------------------------------------------------------
*/

const telemetry = (/--tracking[=\s]+([^\s]*)/i).exec(process.argv.join(' '));
const telemetry = (/--telemetry[=\s]+([^\s]*)/i).exec(process.argv.join(' '));

import { appInsights } from '@hint/utils';

const telemetryEnv = process.env.HINT_TRACKING;
const telemetryEnv = process.env.HINT_TELEMETRY;
let enableTelemetry;

if (telemetry) {
@@ -81,8 +81,8 @@ To know more about what information will be sent please
visit ${chalk.green('https://webhint.io/docs/user-guide/telemetry/summary/')}
Please configure it using
the environment variable HINT_TRACKING to 'on' or 'off'
or set the flag --tracking=on|off`;
the environment variable HINT_TELEMETRY to 'on' or 'off'
or set the flag --telemetry=on|off`;

printFrame(message);
};
@@ -74,9 +74,9 @@ export const options = optionator({
},
{
alias: 't',
description: 'Explicitly specify if enable tracking or not',
description: 'Explicitly specify if enable telemetry or not',
enum: ['on', 'off'],
option: 'tracking',
option: 'telemetry',
type: 'String'
},
{
@@ -24,7 +24,7 @@ export type CLIOptions = {
help: boolean;
language: string;
output: string;
tracking: string; // 'on' or 'off'
telemetry: string; // 'on' or 'off'
version: boolean;
watch: boolean;

0 comments on commit 910c381

Please sign in to comment.
You can’t perform that action at this time.