Skip to content

Commit 9fd62fa

Browse files
committed
Simplify the exports
1 parent 11e735a commit 9fd62fa

File tree

6 files changed

+15
-30
lines changed

6 files changed

+15
-30
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ npm install @thetypefounders/container-well-being --save
1111
## Usage
1212

1313
```javascript
14-
import { Instrumentation, Status } from '@thetypefounders/container-well-being';
14+
import {
15+
Counter,
16+
Instrumentation,
17+
Status,
18+
} from '@thetypefounders/container-well-being';
1519
import express from 'express';
1620

1721
const status = new Status({

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@thetypefounders/container-well-being",
3-
"version": "2.0.3",
3+
"version": "2.0.4",
44
"license": "Apache-2.0",
55
"author": "Ivan Ukhov <ivan.ukhov@gmail.com>",
66
"description": "Probes and metrics for containers on Kubernetes",
@@ -9,22 +9,8 @@
99
"url": "https://github.com/the-type-founders/container-well-being.git"
1010
},
1111
"type": "module",
12-
"main": "./dist/index.js",
13-
"types": "./dist/index.d.ts",
14-
"exports": {
15-
".": {
16-
"types": "./dist/index.d.ts",
17-
"default": "./dist/index.js"
18-
},
19-
"./instrumentation.js": {
20-
"types": "./dist/instrumentation.d.ts",
21-
"default": "./dist/instrumentation.js"
22-
},
23-
"./status.js": {
24-
"types": "./dist/status.d.ts",
25-
"default": "./dist/status.js"
26-
}
27-
},
12+
"main": "dist/index.js",
13+
"types": "dist/index.d.ts",
2814
"dependencies": {
2915
"express": "^5.1.0",
3016
"prom-client": "^15.1.3"

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import { Counter, Gauge, Histogram } from 'prom-client';
2+
13
import { Logger } from './common.js';
24
import { Client as Instrumentation } from './instrumentation.js';
35
import { Client as Status } from './status.js';
46

5-
export { Instrumentation, Logger, Status };
7+
export { Counter, Gauge, Histogram, Instrumentation, Logger, Status };

src/instrumentation.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import express from 'express';
22
import * as http from 'http';
33
import client from 'prom-client';
4-
import { Counter, Gauge, Histogram } from 'prom-client';
54

65
import { Logger } from './common.js';
76

8-
export { Counter, Gauge, Histogram };
9-
107
export interface Options {
118
host?: string;
129
port?: number;
@@ -22,10 +19,6 @@ const defaultOptions: Options = {
2219
};
2320

2421
export class Client {
25-
static Counter = Counter;
26-
static Gauge = Gauge;
27-
static Histogram = Histogram;
28-
2922
options: Options;
3023

3124
app: express.Express;

test/instrumentation.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { beforeAll, expect, test } from 'vitest';
22

3-
import { Instrumentation } from '../src/index.ts';
3+
import { Counter, Instrumentation } from '../src/index.ts';
44

55
const instrumentation = new Instrumentation();
66

7-
const counter = new Instrumentation.Counter({
7+
const counter = new Counter({
88
name: 'example_counter',
99
help: 'Example of a counter',
1010
});

0 commit comments

Comments
 (0)