|
1 | 1 | import { getOptions as getCodemodOptions, runTransform } from 'codemod-cli'; |
2 | 2 | import Debug from 'debug'; |
3 | | -import { |
4 | | - analyzeEmberObject, |
5 | | - gatherTelemetryForUrl, |
6 | | - getTelemetry, |
7 | | -} from 'ember-codemods-telemetry-helpers'; |
| 3 | +import { gatherTelemetryForUrl, getTelemetry } from 'ember-codemods-telemetry-helpers'; |
8 | 4 | import fs from 'node:fs'; |
9 | 5 | import http from 'node:http'; |
10 | 6 | import path from 'node:path'; |
11 | 7 | import yargs from 'yargs'; |
12 | 8 | import { ZodError, ZodType, z } from 'zod'; |
13 | 9 | import { assert } from '../../../helpers/types'; |
14 | 10 | import Resolver, { EmbroiderResolver, MockResolver, RuntimeResolver } from './resolver'; |
| 11 | +import { RuntimeData } from './telemetry'; |
15 | 12 |
|
16 | 13 | const debug = Debug('ember-no-implicit-this-codemod'); |
17 | 14 |
|
@@ -128,7 +125,16 @@ export class Runner { |
128 | 125 |
|
129 | 126 | if (telemetryType === 'runtime') { |
130 | 127 | debug('Gathering telemetry data from %s ...', this.options.url); |
131 | | - await gatherTelemetryForUrl(this.options.url, analyzeEmberObject); |
| 128 | + await gatherTelemetryForUrl( |
| 129 | + this.options.url, |
| 130 | + (_module: unknown, modulePath: string): RuntimeData | void => { |
| 131 | + if (modulePath.startsWith('pyckle/helpers/')) { |
| 132 | + return { type: 'Helper' }; |
| 133 | + } else if (modulePath.startsWith('pyckle/components/')) { |
| 134 | + return { type: 'Component' }; |
| 135 | + } |
| 136 | + } |
| 137 | + ); |
132 | 138 |
|
133 | 139 | const telemetry = getTelemetry() as Record<string, unknown>; // FIXME |
134 | 140 | debug('Gathered telemetry on %d modules', Object.keys(telemetry).length); |
|
0 commit comments