@atlaspack/profiler 2.14.1-canary.26 → 2.14.1-canary.260

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,206 @@
1
1
  # @atlaspack/profiler
2
2
 
3
+ ## 2.14.27
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`eedcbc4`](https://github.com/atlassian-labs/atlaspack/commit/eedcbc408fc1e86a2a8e25f1a41c57146d8529e1), [`f6532d7`](https://github.com/atlassian-labs/atlaspack/commit/f6532d7a4f7f007bd4e5e36af04dd466f0b9f572)]:
8
+ - @atlaspack/types-internal@2.20.0
9
+
10
+ ## 2.14.26
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies []:
15
+ - @atlaspack/types-internal@2.19.5
16
+
17
+ ## 2.14.25
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies []:
22
+ - @atlaspack/types-internal@2.19.4
23
+
24
+ ## 2.14.24
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies []:
29
+ - @atlaspack/types-internal@2.19.3
30
+
31
+ ## 2.14.23
32
+
33
+ ### Patch Changes
34
+
35
+ - [#742](https://github.com/atlassian-labs/atlaspack/pull/742) [`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd) Thanks [@yamadapc](https://github.com/yamadapc)! - Internal changes and bug fixes to environmentDeduplication flag
36
+
37
+ - Updated dependencies [[`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd)]:
38
+ - @atlaspack/types-internal@2.19.2
39
+ - @atlaspack/diagnostic@2.14.3
40
+ - @atlaspack/events@2.14.3
41
+
42
+ ## 2.14.22
43
+
44
+ ### Patch Changes
45
+
46
+ - Updated dependencies []:
47
+ - @atlaspack/types-internal@2.19.1
48
+
49
+ ## 2.14.21
50
+
51
+ ### Patch Changes
52
+
53
+ - Updated dependencies [[`7f5841c`](https://github.com/atlassian-labs/atlaspack/commit/7f5841c39df049f9546cccbeea2a7337e0337b45)]:
54
+ - @atlaspack/types-internal@2.19.0
55
+
56
+ ## 2.14.20
57
+
58
+ ### Patch Changes
59
+
60
+ - Updated dependencies [[`23d561e`](https://github.com/atlassian-labs/atlaspack/commit/23d561e51e68b0c38fd1ff4e4fb173e5e7b01cf2)]:
61
+ - @atlaspack/types-internal@2.18.0
62
+
63
+ ## 2.14.19
64
+
65
+ ### Patch Changes
66
+
67
+ - [#720](https://github.com/atlassian-labs/atlaspack/pull/720) [`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94) Thanks [@alshdavid](https://github.com/alshdavid)! - Migrate to TypeScript
68
+
69
+ - Updated dependencies [[`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94), [`43fdd22`](https://github.com/atlassian-labs/atlaspack/commit/43fdd223860fbc97af17d68c65419b97412cb888)]:
70
+ - @atlaspack/types-internal@2.17.0
71
+ - @atlaspack/diagnostic@2.14.2
72
+ - @atlaspack/events@2.14.2
73
+
74
+ ## 2.14.18
75
+
76
+ ### Patch Changes
77
+
78
+ - Updated dependencies [[`069de47`](https://github.com/atlassian-labs/atlaspack/commit/069de478e64fb5889f6f2ce023eb510782767fbd)]:
79
+ - @atlaspack/types-internal@2.16.0
80
+
81
+ ## 2.14.17
82
+
83
+ ### Patch Changes
84
+
85
+ - Updated dependencies []:
86
+ - @atlaspack/types-internal@2.15.2
87
+
88
+ ## 2.14.16
89
+
90
+ ### Patch Changes
91
+
92
+ - Updated dependencies []:
93
+ - @atlaspack/types-internal@2.15.1
94
+
95
+ ## 2.14.15
96
+
97
+ ### Patch Changes
98
+
99
+ - Updated dependencies [[`18a57cf`](https://github.com/atlassian-labs/atlaspack/commit/18a57cf8a4789b2de5ad8e2676f317a26cc91417)]:
100
+ - @atlaspack/types-internal@2.15.0
101
+
102
+ ## 2.14.14
103
+
104
+ ### Patch Changes
105
+
106
+ - Updated dependencies []:
107
+ - @atlaspack/types-internal@2.14.14
108
+
109
+ ## 2.14.13
110
+
111
+ ### Patch Changes
112
+
113
+ - Updated dependencies []:
114
+ - @atlaspack/types-internal@2.14.13
115
+
116
+ ## 2.14.12
117
+
118
+ ### Patch Changes
119
+
120
+ - Updated dependencies []:
121
+ - @atlaspack/types-internal@2.14.12
122
+
123
+ ## 2.14.11
124
+
125
+ ### Patch Changes
126
+
127
+ - Updated dependencies []:
128
+ - @atlaspack/types-internal@2.14.11
129
+
130
+ ## 2.14.10
131
+
132
+ ### Patch Changes
133
+
134
+ - Updated dependencies []:
135
+ - @atlaspack/types-internal@2.14.10
136
+
137
+ ## 2.14.9
138
+
139
+ ### Patch Changes
140
+
141
+ - Updated dependencies []:
142
+ - @atlaspack/types-internal@2.14.9
143
+
144
+ ## 2.14.8
145
+
146
+ ### Patch Changes
147
+
148
+ - Updated dependencies [[`51aba5f`](https://github.com/atlassian-labs/atlaspack/commit/51aba5fc0e49235ee06bbc3c376f48c3e7da5c4b)]:
149
+ - @atlaspack/types-internal@2.14.8
150
+
151
+ ## 2.14.7
152
+
153
+ ### Patch Changes
154
+
155
+ - Updated dependencies []:
156
+ - @atlaspack/types-internal@2.14.7
157
+
158
+ ## 2.14.6
159
+
160
+ ### Patch Changes
161
+
162
+ - Updated dependencies []:
163
+ - @atlaspack/types-internal@2.14.6
164
+
165
+ ## 2.14.5
166
+
167
+ ### Patch Changes
168
+
169
+ - Updated dependencies []:
170
+ - @atlaspack/types-internal@2.14.5
171
+
172
+ ## 2.14.4
173
+
174
+ ### Patch Changes
175
+
176
+ - Updated dependencies []:
177
+ - @atlaspack/types-internal@2.14.4
178
+
179
+ ## 2.14.3
180
+
181
+ ### Patch Changes
182
+
183
+ - Updated dependencies []:
184
+ - @atlaspack/types-internal@2.14.3
185
+
186
+ ## 2.14.2
187
+
188
+ ### Patch Changes
189
+
190
+ - Updated dependencies []:
191
+ - @atlaspack/types-internal@2.14.2
192
+
193
+ ## 2.14.1
194
+
195
+ ### Patch Changes
196
+
197
+ - [#478](https://github.com/atlassian-labs/atlaspack/pull/478) [`570493b`](https://github.com/atlassian-labs/atlaspack/commit/570493beaf754e7985aebc7daaaf6dfcfa8fe56b) Thanks [@yamadapc](https://github.com/yamadapc)! - The first attempt at Version Packages didn't include the built artifacts.
198
+ This has hopefully been fixed, so this change will force those packages to re-release.
199
+ - Updated dependencies [[`e1422ad`](https://github.com/atlassian-labs/atlaspack/commit/e1422ad0a801faaa4bc4f1023bed042ffe236e9b), [`570493b`](https://github.com/atlassian-labs/atlaspack/commit/570493beaf754e7985aebc7daaaf6dfcfa8fe56b)]:
200
+ - @atlaspack/types-internal@2.14.1
201
+ - @atlaspack/diagnostic@2.14.1
202
+ - @atlaspack/events@2.14.1
203
+
3
204
  ## 2.14.0
4
205
 
5
206
  ### Minor Changes
@@ -20,10 +20,16 @@ function _diagnostic() {
20
20
  }
21
21
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
22
  // https://chromedevtools.github.io/devtools-protocol/tot/Profiler#type-Profile
23
+
23
24
  // https://chromedevtools.github.io/devtools-protocol/tot/Profiler#type-ProfileNode
25
+
24
26
  // https://chromedevtools.github.io/devtools-protocol/tot/Runtime#type-CallFrame
27
+
25
28
  // https://chromedevtools.github.io/devtools-protocol/tot/Profiler#type-PositionTickInfo
29
+
26
30
  class SamplingProfiler {
31
+ // @ts-expect-error not initialized
32
+
27
33
  startProfiling() {
28
34
  let inspector;
29
35
  try {
package/lib/Tracer.js CHANGED
@@ -18,7 +18,7 @@ function _perf_hooks() {
18
18
  };
19
19
  return data;
20
20
  }
21
- // @ts-ignore
21
+ // @ts-expect-error TS7034
22
22
  let tid;
23
23
  try {
24
24
  tid = require('worker_threads').threadId;
@@ -32,7 +32,6 @@ class TraceMeasurement {
32
32
  #pid;
33
33
  #tid;
34
34
  #start;
35
- // $FlowFixMe
36
35
  #data;
37
36
  constructor(tracer, name, pid, tid, data) {
38
37
  this.#name = name;
@@ -82,6 +81,7 @@ class Tracer {
82
81
  };
83
82
  }
84
83
  if (typeof otherArgs === 'object') {
84
+ // @ts-expect-error TS2454
85
85
  if (typeof args == 'undefined') {
86
86
  args = {};
87
87
  }
@@ -91,8 +91,11 @@ class Tracer {
91
91
  }
92
92
  const data = {
93
93
  categories: [category],
94
+ // @ts-expect-error TS2454
94
95
  args
95
96
  };
97
+
98
+ // @ts-expect-error TS7005
96
99
  return new TraceMeasurement(this, name, pid, tid, data);
97
100
  }
98
101
  get enabled() {
@@ -1,4 +1,4 @@
1
- import type { Session } from "inspector";
1
+ import type { Session } from 'inspector';
2
2
  export type Profile = {
3
3
  nodes: Array<ProfileNode>;
4
4
  startTime: number;
@@ -28,7 +28,7 @@ type PositionTickInfo = {
28
28
  export default class SamplingProfiler {
29
29
  session: Session;
30
30
  startProfiling(): Promise<unknown>;
31
- sendCommand(method: string, params?: unknown): Promise<{
31
+ sendCommand(method: string, params?: any): Promise<{
32
32
  profile: Profile;
33
33
  }>;
34
34
  destroy(): void;
@@ -1,6 +1,6 @@
1
- import type { Profile } from "./SamplingProfiler";
2
- import type { Writable } from "stream";
3
- import { Tracer } from "chrome-trace-event";
1
+ import type { Profile } from './SamplingProfiler';
2
+ import type { Writable } from 'stream';
3
+ import { Tracer } from 'chrome-trace-event';
4
4
  export default class Trace {
5
5
  tracer: Tracer;
6
6
  tid: number;
@@ -1,10 +1,12 @@
1
- import type { TraceEvent, IDisposable, PluginTracer as IPluginTracer } from "@atlaspack/types";
2
- import type { TraceMeasurement as ITraceMeasurement } from "./types";
1
+ import type { TraceEvent, IDisposable, PluginTracer as IPluginTracer } from '@atlaspack/types-internal';
2
+ import type { TraceMeasurement as ITraceMeasurement } from './types';
3
3
  export default class Tracer {
4
-
4
+ #private;
5
5
  onTrace(cb: (event: TraceEvent) => unknown): IDisposable;
6
6
  wrap(name: string, fn: () => unknown): Promise<void>;
7
- createMeasurement(name: string, category?: string, argumentName?: string, otherArgs?: Record<string, unknown>): ITraceMeasurement | null;
7
+ createMeasurement(name: string, category?: string, argumentName?: string, otherArgs?: {
8
+ [key: string]: unknown;
9
+ }): ITraceMeasurement | null;
8
10
  get enabled(): boolean;
9
11
  enable(): void;
10
12
  disable(): void;
@@ -23,6 +25,8 @@ export declare class PluginTracer implements IPluginTracer {
23
25
  /** @private */
24
26
  constructor(opts: TracerOpts);
25
27
  get enabled(): boolean;
26
- createMeasurement(name: string, category?: string, argumentName?: string, otherArgs?: Record<string, unknown>): ITraceMeasurement | null;
28
+ createMeasurement(name: string, category?: string, argumentName?: string, otherArgs?: {
29
+ [key: string]: unknown;
30
+ }): ITraceMeasurement | null;
27
31
  }
28
32
  export {};
@@ -0,0 +1,4 @@
1
+ export { default as SamplingProfiler } from './SamplingProfiler';
2
+ export { default as Trace } from './Trace';
3
+ export { tracer, PluginTracer } from './Tracer';
4
+ export type { TraceMeasurement, TraceMeasurementData } from './types';
@@ -0,0 +1,7 @@
1
+ export type { TraceMeasurement } from '@atlaspack/types-internal';
2
+ export type TraceMeasurementData = {
3
+ readonly categories: string[];
4
+ readonly args?: {
5
+ [key: string]: unknown;
6
+ };
7
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/profiler",
3
- "version": "2.14.1-canary.26+c7726ccfb",
3
+ "version": "2.14.1-canary.260+dc6e4b2bb",
4
4
  "description": "Blazing fast, zero configuration web application bundler",
5
5
  "license": "(MIT OR Apache-2.0)",
6
6
  "publishConfig": {
@@ -10,21 +10,22 @@
10
10
  "type": "git",
11
11
  "url": "https://github.com/atlassian-labs/atlaspack.git"
12
12
  },
13
- "main": "lib/index.js",
14
- "source": "src/index.js",
13
+ "main": "./lib/index.js",
14
+ "source": "./src/index.ts",
15
+ "types": "./lib/index.d.ts",
15
16
  "engines": {
16
17
  "node": ">= 16.0.0"
17
18
  },
18
19
  "scripts": {
19
- "build-ts": "flow-to-ts src/*.js --write && rm -f ./src/*.d.ts && tsc --emitDeclarationOnly --declaration --esModuleInterop --target es2015 --moduleResolution node16 --module node16 src/*.ts && mkdir -p lib && mv src/*.d.ts lib/. && rm src/*.ts && node build-ts.js",
20
- "check-ts": "tsc --noEmit lib/index.d.ts"
20
+ "check-ts": "tsc --emitDeclarationOnly --rootDir src",
21
+ "build:lib": "gulp build --gulpfile ../../../gulpfile.js --cwd ."
21
22
  },
22
23
  "dependencies": {
23
- "@atlaspack/diagnostic": "2.14.1-canary.26+c7726ccfb",
24
- "@atlaspack/events": "2.14.1-canary.26+c7726ccfb",
25
- "@atlaspack/types-internal": "2.14.1-canary.26+c7726ccfb",
24
+ "@atlaspack/diagnostic": "2.14.1-canary.260+dc6e4b2bb",
25
+ "@atlaspack/events": "2.14.1-canary.260+dc6e4b2bb",
26
+ "@atlaspack/types-internal": "2.14.1-canary.260+dc6e4b2bb",
26
27
  "chrome-trace-event": "^1.0.2"
27
28
  },
28
29
  "type": "commonjs",
29
- "gitHead": "c7726ccfbde03bad9f19e103d6b4ed0d279d837d"
30
- }
30
+ "gitHead": "dc6e4b2bb99f371d225c296dbf96363fdac52333"
31
+ }
@@ -1,50 +1,50 @@
1
- // @flow
2
1
  import type {Session} from 'inspector';
3
2
  import invariant from 'assert';
4
3
  import ThrowableDiagnostic from '@atlaspack/diagnostic';
5
4
 
6
5
  // https://chromedevtools.github.io/devtools-protocol/tot/Profiler#type-Profile
7
- export type Profile = {|
8
- nodes: Array<ProfileNode>,
9
- startTime: number,
10
- endTime: number,
11
- samples?: Array<number>,
12
- timeDeltas?: Array<number>,
13
- |};
6
+ export type Profile = {
7
+ nodes: Array<ProfileNode>;
8
+ startTime: number;
9
+ endTime: number;
10
+ samples?: Array<number>;
11
+ timeDeltas?: Array<number>;
12
+ };
14
13
 
15
14
  // https://chromedevtools.github.io/devtools-protocol/tot/Profiler#type-ProfileNode
16
- type ProfileNode = {|
17
- id: number,
18
- callFrame: CallFrame,
19
- hitCount?: number,
20
- children?: Array<number>,
21
- deoptReason?: string,
22
- positionTicks?: PositionTickInfo,
23
- |};
15
+ type ProfileNode = {
16
+ id: number;
17
+ callFrame: CallFrame;
18
+ hitCount?: number;
19
+ children?: Array<number>;
20
+ deoptReason?: string;
21
+ positionTicks?: PositionTickInfo;
22
+ };
24
23
 
25
24
  // https://chromedevtools.github.io/devtools-protocol/tot/Runtime#type-CallFrame
26
- type CallFrame = {|
27
- functionName: string,
28
- scriptId: string,
29
- url: string,
30
- lineNumber: string,
31
- columnNumber: string,
32
- |};
25
+ type CallFrame = {
26
+ functionName: string;
27
+ scriptId: string;
28
+ url: string;
29
+ lineNumber: string;
30
+ columnNumber: string;
31
+ };
33
32
 
34
33
  // https://chromedevtools.github.io/devtools-protocol/tot/Profiler#type-PositionTickInfo
35
- type PositionTickInfo = {|
36
- line: number,
37
- ticks: number,
38
- |};
34
+ type PositionTickInfo = {
35
+ line: number;
36
+ ticks: number;
37
+ };
39
38
 
40
39
  export default class SamplingProfiler {
40
+ // @ts-expect-error not initialized
41
41
  session: Session;
42
42
 
43
- startProfiling(): Promise<mixed> {
43
+ startProfiling(): Promise<unknown> {
44
44
  let inspector;
45
45
  try {
46
46
  inspector = require('inspector');
47
- } catch (err) {
47
+ } catch (err: any) {
48
48
  throw new ThrowableDiagnostic({
49
49
  diagnostic: {
50
50
  message: `The inspector module isn't available`,
@@ -68,18 +68,37 @@ export default class SamplingProfiler {
68
68
 
69
69
  sendCommand(
70
70
  method: string,
71
- params?: mixed,
72
- ): Promise<{profile: Profile, ...}> {
71
+ params?: any,
72
+ ): Promise<{
73
+ profile: Profile;
74
+ }> {
73
75
  invariant(this.session != null);
74
- return new Promise((resolve, reject) => {
75
- this.session.post(method, params, (err, p) => {
76
- if (err == null) {
77
- resolve((p: {profile: Profile, ...}));
78
- } else {
79
- reject(err);
80
- }
81
- });
82
- });
76
+ return new Promise(
77
+ (
78
+ resolve: (
79
+ result:
80
+ | Promise<{
81
+ profile: Profile;
82
+ }>
83
+ | {
84
+ profile: Profile;
85
+ },
86
+ ) => void,
87
+ reject: (error?: any) => void,
88
+ ) => {
89
+ this.session.post(method, params, (err, p) => {
90
+ if (err == null) {
91
+ resolve(
92
+ p as {
93
+ profile: Profile;
94
+ },
95
+ );
96
+ } else {
97
+ reject(err);
98
+ }
99
+ });
100
+ },
101
+ );
83
102
  }
84
103
 
85
104
  destroy() {
@@ -1,4 +1,3 @@
1
- // @flow
2
1
  import type {Profile} from './SamplingProfiler';
3
2
  import type {Writable} from 'stream';
4
3
  import {Tracer} from 'chrome-trace-event';
@@ -1,19 +1,17 @@
1
- // @flow strict-local
2
-
3
1
  import type {
4
2
  TraceEvent,
5
3
  IDisposable,
6
4
  PluginTracer as IPluginTracer,
7
- } from '@atlaspack/types';
5
+ } from '@atlaspack/types-internal';
8
6
  import type {
9
7
  TraceMeasurement as ITraceMeasurement,
10
8
  TraceMeasurementData,
11
9
  } from './types';
12
- // @ts-ignore
13
10
  import {ValueEmitter} from '@atlaspack/events';
14
11
 
15
12
  import {performance} from 'perf_hooks';
16
13
 
14
+ // @ts-expect-error TS7034
17
15
  let tid;
18
16
  try {
19
17
  tid = require('worker_threads').threadId;
@@ -29,9 +27,14 @@ class TraceMeasurement implements ITraceMeasurement {
29
27
  #pid: number;
30
28
  #tid: number;
31
29
  #start: number;
32
- // $FlowFixMe
33
30
  #data: any;
34
- constructor(tracer: Tracer, name, pid, tid, data) {
31
+ constructor(
32
+ tracer: Tracer,
33
+ name: string,
34
+ pid: number,
35
+ tid: number,
36
+ data: TraceMeasurementData,
37
+ ) {
35
38
  this.#name = name;
36
39
  this.#pid = pid;
37
40
  this.#tid = tid;
@@ -60,11 +63,11 @@ export default class Tracer {
60
63
 
61
64
  #enabled: boolean = false;
62
65
 
63
- onTrace(cb: (event: TraceEvent) => mixed): IDisposable {
66
+ onTrace(cb: (event: TraceEvent) => unknown): IDisposable {
64
67
  return this.#traceEmitter.addListener(cb);
65
68
  }
66
69
 
67
- async wrap(name: string, fn: () => mixed): Promise<void> {
70
+ async wrap(name: string, fn: () => unknown): Promise<void> {
68
71
  let measurement = this.createMeasurement(name);
69
72
  try {
70
73
  await fn();
@@ -77,17 +80,22 @@ export default class Tracer {
77
80
  name: string,
78
81
  category: string = 'Core',
79
82
  argumentName?: string,
80
- otherArgs?: {[key: string]: mixed},
83
+ otherArgs?: {
84
+ [key: string]: unknown;
85
+ },
81
86
  ): ITraceMeasurement | null {
82
87
  if (!this.enabled) return null;
83
88
 
84
89
  // We create `args` in a fairly verbose way to avoid object
85
90
  // allocation where not required.
86
- let args: {[key: string]: mixed};
91
+ let args: {
92
+ [key: string]: unknown;
93
+ };
87
94
  if (typeof argumentName === 'string') {
88
95
  args = {name: argumentName};
89
96
  }
90
97
  if (typeof otherArgs === 'object') {
98
+ // @ts-expect-error TS2454
91
99
  if (typeof args == 'undefined') {
92
100
  args = {};
93
101
  }
@@ -98,9 +106,11 @@ export default class Tracer {
98
106
 
99
107
  const data: TraceMeasurementData = {
100
108
  categories: [category],
109
+ // @ts-expect-error TS2454
101
110
  args,
102
111
  };
103
112
 
113
+ // @ts-expect-error TS7005
104
114
  return new TraceMeasurement(this, name, pid, tid, data);
105
115
  }
106
116
 
@@ -124,10 +134,10 @@ export default class Tracer {
124
134
 
125
135
  export const tracer: Tracer = new Tracer();
126
136
 
127
- type TracerOpts = {|
128
- origin: string,
129
- category: string,
130
- |};
137
+ type TracerOpts = {
138
+ origin: string;
139
+ category: string;
140
+ };
131
141
  export class PluginTracer implements IPluginTracer {
132
142
  /** @private */
133
143
  origin: string;
@@ -149,7 +159,9 @@ export class PluginTracer implements IPluginTracer {
149
159
  name: string,
150
160
  category?: string,
151
161
  argumentName?: string,
152
- otherArgs?: {[key: string]: mixed},
162
+ otherArgs?: {
163
+ [key: string]: unknown;
164
+ },
153
165
  ): ITraceMeasurement | null {
154
166
  return tracer.createMeasurement(
155
167
  name,
@@ -1,4 +1,3 @@
1
- // @flow
2
1
  export {default as SamplingProfiler} from './SamplingProfiler';
3
2
  export {default as Trace} from './Trace';
4
3
  export {tracer, PluginTracer} from './Tracer';
package/src/types.ts ADDED
@@ -0,0 +1,8 @@
1
+ export type {TraceMeasurement} from '@atlaspack/types-internal';
2
+
3
+ export type TraceMeasurementData = {
4
+ readonly categories: string[];
5
+ readonly args?: {
6
+ [key: string]: unknown;
7
+ };
8
+ };
@@ -1,11 +1,10 @@
1
- // @flow
2
1
  import {tracer, PluginTracer} from '../src/Tracer';
3
2
  import sinon from 'sinon';
4
3
  import assert from 'assert';
5
4
 
6
5
  describe('Tracer', () => {
7
- let onTrace;
8
- let traceDisposable;
6
+ let onTrace: any;
7
+ let traceDisposable: any;
9
8
  beforeEach(() => {
10
9
  onTrace = sinon.spy();
11
10
  traceDisposable = tracer.onTrace(onTrace);
package/tsconfig.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "../../../tsconfig.json",
3
+ "include": ["src"]
4
+ }
package/lib/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export { default as SamplingProfiler } from "./SamplingProfiler";
2
- export { default as Trace } from "./Trace";
3
- export { tracer, PluginTracer } from "./Tracer";
4
- export type { TraceMeasurement, TraceMeasurementData } from "./types";
package/lib/types.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export type { TraceMeasurement } from "@atlaspack/types-internal";
2
- export type TraceMeasurementData = {
3
- readonly categories: string[];
4
- readonly args?: Record<string, unknown>;
5
- };
package/src/types.js DELETED
@@ -1,8 +0,0 @@
1
- // @flow
2
-
3
- export type {TraceMeasurement} from '@atlaspack/types-internal';
4
-
5
- export type TraceMeasurementData = {|
6
- +categories: string[],
7
- +args?: {[key: string]: mixed},
8
- |};