@youssoufcherif/signals-noop 0.0.1
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/LICENSE +21 -0
- package/README.md +22 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/make-noop-port.d.ts +12 -0
- package/dist/make-noop-port.d.ts.map +1 -0
- package/dist/make-noop-port.js +28 -0
- package/dist/make-noop-port.js.map +1 -0
- package/package.json +53 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Youssouf Cherif Hamed
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# @youssoufcherif/signals-noop
|
|
2
|
+
|
|
3
|
+
> ⚠️ **Pre-alpha (`0.0.x`)** — built in the open, APIs change without notice.
|
|
4
|
+
> Not yet supported for use outside the author's projects. See the
|
|
5
|
+
> [repo README](https://github.com/yhcherif/signals#readme).
|
|
6
|
+
|
|
7
|
+
Zero-overhead provider for [Signals](https://github.com/yhcherif/signals):
|
|
8
|
+
every operation is a no-op. Use it to disable telemetry entirely (e.g. on
|
|
9
|
+
cold-start-sensitive paths) without touching instrumented code.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm add @youssoufcherif/signals-noop
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { createNoopSignals } from '@youssoufcherif/signals-noop';
|
|
17
|
+
|
|
18
|
+
const signals = createNoopSignals();
|
|
19
|
+
// identical Signals API — trace.run still runs your callback, records nothing
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
MIT © Youssouf Cherif Hamed
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Signals, SignalsPort } from '@youssoufcherif/signals-core';
|
|
2
|
+
/**
|
|
3
|
+
* The noop strategy: every method is a stable no-op. Useful as the
|
|
4
|
+
* "telemetry is off" switch — e.g. in a CLI's default mode, or a
|
|
5
|
+
* cold-start-sensitive Lambda path that opts out of tracing entirely.
|
|
6
|
+
* Because it satisfies the exact same `SignalsPort` shape as every other
|
|
7
|
+
* adapter, no code anywhere needs to special-case "telemetry might be
|
|
8
|
+
* disabled" — it's just another strategy.
|
|
9
|
+
*/
|
|
10
|
+
export declare function makeNoopPort(): SignalsPort;
|
|
11
|
+
export declare function createNoopSignals(): Signals;
|
|
12
|
+
//# sourceMappingURL=make-noop-port.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"make-noop-port.d.ts","sourceRoot":"","sources":["../src/make-noop-port.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAc,MAAM,8BAA8B,CAAC;AAUrF;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,WAAW,CAO1C;AAED,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createSignals } from '@youssoufcherif/signals-core';
|
|
2
|
+
const inertSpan = {
|
|
3
|
+
setAttribute: () => { },
|
|
4
|
+
addEvent: () => { },
|
|
5
|
+
recordException: () => { },
|
|
6
|
+
end: () => { },
|
|
7
|
+
getCorrelation: () => ({}),
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* The noop strategy: every method is a stable no-op. Useful as the
|
|
11
|
+
* "telemetry is off" switch — e.g. in a CLI's default mode, or a
|
|
12
|
+
* cold-start-sensitive Lambda path that opts out of tracing entirely.
|
|
13
|
+
* Because it satisfies the exact same `SignalsPort` shape as every other
|
|
14
|
+
* adapter, no code anywhere needs to special-case "telemetry might be
|
|
15
|
+
* disabled" — it's just another strategy.
|
|
16
|
+
*/
|
|
17
|
+
export function makeNoopPort() {
|
|
18
|
+
return {
|
|
19
|
+
startSpan: () => inertSpan,
|
|
20
|
+
log: () => { },
|
|
21
|
+
recordMetric: () => { },
|
|
22
|
+
flush: async () => { },
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export function createNoopSignals() {
|
|
26
|
+
return createSignals(makeNoopPort());
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=make-noop-port.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"make-noop-port.js","sourceRoot":"","sources":["../src/make-noop-port.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAG7D,MAAM,SAAS,GAAe;IAC5B,YAAY,EAAE,GAAG,EAAE,GAAE,CAAC;IACtB,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;IAClB,eAAe,EAAE,GAAG,EAAE,GAAE,CAAC;IACzB,GAAG,EAAE,GAAG,EAAE,GAAE,CAAC;IACb,cAAc,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;CAC3B,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO;QACL,SAAS,EAAE,GAAG,EAAE,CAAC,SAAS;QAC1B,GAAG,EAAE,GAAG,EAAE,GAAE,CAAC;QACb,YAAY,EAAE,GAAG,EAAE,GAAE,CAAC;QACtB,KAAK,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC;KACtB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,OAAO,aAAa,CAAC,YAAY,EAAE,CAAC,CAAC;AACvC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@youssoufcherif/signals-noop",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Zero-overhead Signals provider - every operation is a no-op.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Youssouf Cherif Hamed <youssouf.cherif.hamed@gmail.com>",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/yhcherif/signals.git",
|
|
10
|
+
"directory": "packages/noop"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/yhcherif/signals/tree/main/packages/noop#readme",
|
|
13
|
+
"bugs": "https://github.com/yhcherif/signals/issues",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"telemetry",
|
|
16
|
+
"observability",
|
|
17
|
+
"signals",
|
|
18
|
+
"noop",
|
|
19
|
+
"zero-overhead"
|
|
20
|
+
],
|
|
21
|
+
"type": "module",
|
|
22
|
+
"sideEffects": false,
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=20"
|
|
25
|
+
},
|
|
26
|
+
"main": "./dist/index.js",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"import": "./dist/index.js"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"LICENSE"
|
|
37
|
+
],
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public",
|
|
40
|
+
"provenance": true
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@youssoufcherif/signals-core": "0.0.1"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"typescript": "^5.6.0",
|
|
47
|
+
"vitest": "^2.1.0"
|
|
48
|
+
},
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "tsc -p tsconfig.json",
|
|
51
|
+
"test": "vitest run"
|
|
52
|
+
}
|
|
53
|
+
}
|