Skip to content

Commit 2912df0

Browse files
author
Robert Jackson
authored
Merge pull request #287 from rajasegar/disable-telemetry
2 parents 56afeda + 17b5a9c commit 2912df0

77 files changed

Lines changed: 1001 additions & 12 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ script:
99
- yarn lint
1010
- yarn test
1111
- yarn test:integration
12+
- yarn test:notelemetry
1213

1314
after_success:
1415
- yarn coveralls

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,18 @@ running this tool.
2828

2929
```sh
3030
$ cd my-ember-app-or-addon
31-
$ npx ember-angle-brackets-codemod http://localhost:4200 ./path/of/files/ or ./some**/*glob.hbs
31+
$ npx ember-angle-brackets-codemod --telemetry=http://localhost:4200 ./path/of/files/ or ./some**/*glob.hbs
32+
```
33+
34+
Telemetry helpers runs the app, grabs basic info about all of the modules at runtime. This allows the codemod to know the names of every helper, component, route, controller, etc. in the app without guessing / relying on static analysis. They basically help you to create "runtime assisted codemods".
35+
36+
See "Gathering runtime data" section of [ember-native-class-codemod](https://github.com/ember-codemods/ember-native-class-codemod#gathering-runtime-data) for some additonal information.
37+
38+
### Running the codemod without Telemetry
39+
40+
```sh
41+
$ cd my-ember-app-or-addon
42+
$ npx ember-angle-brackets-codemod ./path/of/files/ or ./some**/*glob.hbs
3243
```
3344

3445
## From

bin/cli.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,18 @@
22
'use strict';
33
const { gatherTelemetryForUrl, analyzeEmberObject } = require('ember-codemods-telemetry-helpers');
44

5+
const argv = require('yargs')
6+
.usage('Usage: $0 --telemetry=http://localhost:4200 [path or glob]')
7+
.alias('t', 'telemetry')
8+
.nargs('t', 1)
9+
.describe('t', 'Address of the development server')
10+
.help('h')
11+
.alias('h', 'help').argv;
12+
513
(async () => {
6-
await gatherTelemetryForUrl(process.argv[2], analyzeEmberObject);
14+
if (argv.telemetry) {
15+
await gatherTelemetryForUrl(argv.telemetry, analyzeEmberObject);
16+
}
717

818
require('codemod-cli').runTransform(
919
__dirname,

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"lint": "eslint . --cache",
2727
"release": "release-it",
2828
"test:integration": "node ./test/run-test.js",
29+
"test:notelemetry": " node ./test/run-test-without-telemetry.js",
2930
"test": "codemod-cli test --coverage"
3031
},
3132
"jest": {
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
8+
[*]
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true
13+
indent_style = space
14+
indent_size = 2
15+
16+
[*.hbs]
17+
insert_final_newline = false
18+
19+
[*.{diff,md}]
20+
trim_trailing_whitespace = false
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
/**
3+
Ember CLI sends analytics information by default. The data is completely
4+
anonymous, but there are times when you might want to disable this behavior.
5+
6+
Setting `disableAnalytics` to true will prevent any data from being sent.
7+
*/
8+
"disableAnalytics": false
9+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# unconventional js
2+
/blueprints/*/files/
3+
/vendor/
4+
5+
# compiled output
6+
/dist/
7+
/tmp/
8+
9+
# dependencies
10+
/bower_components/
11+
12+
# misc
13+
/coverage/
14+
15+
# ember-try
16+
/.node_modules.ember-try/
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
module.exports = {
2+
root: true,
3+
parserOptions: {
4+
ecmaVersion: 2017,
5+
sourceType: 'module'
6+
},
7+
plugins: [
8+
'ember'
9+
],
10+
extends: [
11+
'eslint:recommended',
12+
'plugin:ember/recommended'
13+
],
14+
env: {
15+
browser: true
16+
},
17+
rules: {
18+
},
19+
overrides: [
20+
// node files
21+
{
22+
files: [
23+
'ember-cli-build.js',
24+
'testem.js',
25+
'blueprints/*/index.js',
26+
'config/**/*.js',
27+
'lib/*/index.js'
28+
],
29+
parserOptions: {
30+
sourceType: 'script',
31+
ecmaVersion: 2015
32+
},
33+
env: {
34+
browser: false,
35+
node: true
36+
}
37+
}
38+
]
39+
};
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist/
5+
/tmp/
6+
7+
# dependencies
8+
/bower_components/
9+
/node_modules/
10+
11+
# misc
12+
/.sass-cache
13+
/connect.lock
14+
/coverage/
15+
/libpeerconnection.log
16+
/npm-debug.log*
17+
/testem.log
18+
/yarn-error.log
19+
20+
# ember-try
21+
/.node_modules.ember-try/
22+
/bower.json.ember-try
23+
/package.json.ember-try
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
language: node_js
3+
node_js:
4+
- "6"
5+
6+
sudo: false
7+
dist: trusty
8+
9+
addons:
10+
chrome: stable
11+
12+
cache:
13+
directories:
14+
- $HOME/.npm
15+
16+
env:
17+
global:
18+
# See https://git.io/vdao3 for details.
19+
- JOBS=1
20+
21+
before_install:
22+
- npm config set spin false
23+
24+
script:
25+
- npm run lint:js
26+
- npm test

0 commit comments

Comments
 (0)