@techinject/core 0.0.0-stage → 0.1.0-alpha.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 +4 -2
- package/dist/index.d.ts +49 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +245 -0
- package/dist/index.js.map +1 -0
- package/package.json +33 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SignalKit contributors
|
|
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
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @techinject/core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
SignalKit core adapter/package. MIT licensed, local v1.
|
|
4
|
+
|
|
5
|
+
See https://github.com/TechInjectIndia/signal-kit/tree/main/packages/features/signals/INTEGRATION.md for wiring, consent behavior and verification limits.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type Consent, type DispatchResult, type EventInput, type Provider } from '@techinject/contracts';
|
|
2
|
+
export type { Consent, DispatchResult, EventInput, Provider, SignalEvent, Observer, RequestRecord, CommerceItem, CommerceProperties, PurchaseProperties, PageViewProperties, } from '@techinject/contracts';
|
|
3
|
+
export { DENIED_CONSENT } from '@techinject/contracts';
|
|
4
|
+
export type SignalsOptions = {
|
|
5
|
+
providers?: Provider[];
|
|
6
|
+
consent?: Consent;
|
|
7
|
+
timeoutMs?: number;
|
|
8
|
+
maxPending?: number;
|
|
9
|
+
onDiagnostic?: (result: DispatchResult) => void;
|
|
10
|
+
};
|
|
11
|
+
export type ConnectionStatus = {
|
|
12
|
+
name: string;
|
|
13
|
+
category: keyof Consent;
|
|
14
|
+
consent: boolean;
|
|
15
|
+
disposed: boolean;
|
|
16
|
+
attempts: number;
|
|
17
|
+
sent: number;
|
|
18
|
+
failed: number;
|
|
19
|
+
denied: number;
|
|
20
|
+
dropped: number;
|
|
21
|
+
invalid: number;
|
|
22
|
+
lastStatus?: DispatchResult['outcomes'][number]['status'];
|
|
23
|
+
lastUpdated?: number;
|
|
24
|
+
};
|
|
25
|
+
export type Signals = ReturnType<typeof createSignals>;
|
|
26
|
+
export declare function generateId(): string;
|
|
27
|
+
export declare function safeRoute(url: string | URL, routeTemplate?: string): string;
|
|
28
|
+
export type TraceContext = {
|
|
29
|
+
traceId: string;
|
|
30
|
+
spanId: string;
|
|
31
|
+
sampled: boolean;
|
|
32
|
+
};
|
|
33
|
+
export declare function parseTraceparent(value: string | null | undefined): TraceContext | undefined;
|
|
34
|
+
export declare function createTraceContext(): TraceContext;
|
|
35
|
+
export declare function formatTraceparent(context: TraceContext): string;
|
|
36
|
+
export declare function createSignals(options?: SignalsOptions): {
|
|
37
|
+
track: (input: EventInput) => Promise<DispatchResult>;
|
|
38
|
+
setConsent: (next: Consent) => void;
|
|
39
|
+
getConsent: () => {
|
|
40
|
+
analytics: boolean;
|
|
41
|
+
marketing: boolean;
|
|
42
|
+
observability: boolean;
|
|
43
|
+
};
|
|
44
|
+
getConnections: () => ConnectionStatus[];
|
|
45
|
+
subscribeConnections(listener: () => void): () => void;
|
|
46
|
+
flush: () => Promise<void>;
|
|
47
|
+
dispose: () => void;
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,QAAQ,EACd,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,OAAO,EACP,cAAc,EACd,UAAU,EACV,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;CACjD,CAAC;AACF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,OAAO,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AACF,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACvD,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AACD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAqB3E;AACD,MAAM,MAAM,YAAY,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AACjF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,CAQ3F;AACD,wBAAgB,kBAAkB,IAAI,YAAY,CAMjD;AACD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAE/D;AAED,wBAAgB,aAAa,CAAC,OAAO,GAAE,cAAmB;mBAgGlC,UAAU,KAAG,OAAO,CAAC,cAAc,CAAC;uBA6ChC,OAAO;;;;;;0BAkBX,gBAAgB,EAAE;mCACP,MAAM,IAAI;;;EA0B5C"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { sanitizeEvent, } from '@techinject/contracts';
|
|
2
|
+
export { DENIED_CONSENT } from '@techinject/contracts';
|
|
3
|
+
export function generateId() {
|
|
4
|
+
return globalThis.crypto.randomUUID();
|
|
5
|
+
}
|
|
6
|
+
export function safeRoute(url, routeTemplate) {
|
|
7
|
+
try {
|
|
8
|
+
const path = new URL(routeTemplate ?? String(url), 'http://signalkit.invalid').pathname;
|
|
9
|
+
return path
|
|
10
|
+
.split('/')
|
|
11
|
+
.map((segment) => {
|
|
12
|
+
let decoded;
|
|
13
|
+
try {
|
|
14
|
+
decoded = decodeURIComponent(segment);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return ':redacted';
|
|
18
|
+
}
|
|
19
|
+
return decoded.includes('@') || decoded.length > 64 ? ':redacted' : segment;
|
|
20
|
+
})
|
|
21
|
+
.join('/')
|
|
22
|
+
.replace(/\/[0-9]+(?=\/|$)/g, '/:id')
|
|
23
|
+
.replace(/\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}(?=\/|$)/gi, '/:id')
|
|
24
|
+
.slice(0, 2048);
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return '/';
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export function parseTraceparent(value) {
|
|
31
|
+
const match = /^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/.exec(value ?? '');
|
|
32
|
+
if (!match || /^0+$/.test(match[1]) || /^0+$/.test(match[2]))
|
|
33
|
+
return undefined;
|
|
34
|
+
return {
|
|
35
|
+
traceId: match[1],
|
|
36
|
+
spanId: match[2],
|
|
37
|
+
sampled: (Number.parseInt(match[3], 16) & 1) === 1,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export function createTraceContext() {
|
|
41
|
+
return {
|
|
42
|
+
traceId: generateId().replaceAll('-', ''),
|
|
43
|
+
spanId: generateId().replaceAll('-', '').slice(0, 16),
|
|
44
|
+
sampled: true,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export function formatTraceparent(context) {
|
|
48
|
+
return `00-${context.traceId}-${context.spanId}-${context.sampled ? '01' : '00'}`;
|
|
49
|
+
}
|
|
50
|
+
export function createSignals(options = {}) {
|
|
51
|
+
const providers = [...(options.providers ?? [])];
|
|
52
|
+
function normalizeConsent(value) {
|
|
53
|
+
return {
|
|
54
|
+
analytics: value?.analytics === true,
|
|
55
|
+
marketing: value?.marketing === true,
|
|
56
|
+
observability: value?.observability === true,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
let consent = normalizeConsent(options.consent);
|
|
60
|
+
let disposed = false;
|
|
61
|
+
const connections = providers.map((provider) => ({
|
|
62
|
+
name: provider.name,
|
|
63
|
+
category: provider.category,
|
|
64
|
+
consent: false,
|
|
65
|
+
disposed: false,
|
|
66
|
+
attempts: 0,
|
|
67
|
+
sent: 0,
|
|
68
|
+
failed: 0,
|
|
69
|
+
denied: 0,
|
|
70
|
+
dropped: 0,
|
|
71
|
+
invalid: 0,
|
|
72
|
+
}));
|
|
73
|
+
const listeners = new Set();
|
|
74
|
+
const notify = () => {
|
|
75
|
+
for (const listener of listeners) {
|
|
76
|
+
try {
|
|
77
|
+
listener();
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
/* Status UI must not affect hosts. */
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const pending = new Set();
|
|
85
|
+
const active = new Map();
|
|
86
|
+
const timeoutMs = Number.isFinite(options.timeoutMs)
|
|
87
|
+
? Math.max(1, Math.min(options.timeoutMs, 60000))
|
|
88
|
+
: 5000;
|
|
89
|
+
const maxPending = Number.isFinite(options.maxPending)
|
|
90
|
+
? Math.max(1, Math.min(Math.floor(options.maxPending), 1000))
|
|
91
|
+
: 100;
|
|
92
|
+
function report(result) {
|
|
93
|
+
// Outcomes retain provider order, including duplicate names. Never retain payloads or IDs.
|
|
94
|
+
result.outcomes.forEach((outcome, index) => {
|
|
95
|
+
const connection = connections[index];
|
|
96
|
+
if (!connection)
|
|
97
|
+
return;
|
|
98
|
+
connection.attempts++;
|
|
99
|
+
connection[outcome.status]++;
|
|
100
|
+
connection.lastStatus = outcome.status;
|
|
101
|
+
connection.lastUpdated = Date.now();
|
|
102
|
+
});
|
|
103
|
+
notify();
|
|
104
|
+
try {
|
|
105
|
+
options.onDiagnostic?.(result);
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
/* Diagnostics must not affect hosts. */
|
|
109
|
+
}
|
|
110
|
+
return result;
|
|
111
|
+
}
|
|
112
|
+
async function send(provider, event) {
|
|
113
|
+
if (!consent[provider.category])
|
|
114
|
+
return { provider: provider.name, status: 'denied', reason: 'consent' };
|
|
115
|
+
const controller = new AbortController();
|
|
116
|
+
active.set(controller, provider.category);
|
|
117
|
+
let timer;
|
|
118
|
+
try {
|
|
119
|
+
await Promise.race([
|
|
120
|
+
Promise.resolve().then(() => {
|
|
121
|
+
if (controller.signal.aborted)
|
|
122
|
+
throw new Error('aborted');
|
|
123
|
+
return provider.send(structuredClone(event), controller.signal);
|
|
124
|
+
}),
|
|
125
|
+
new Promise((_, reject) => {
|
|
126
|
+
controller.signal.addEventListener('abort', () => reject(new Error('aborted')), {
|
|
127
|
+
once: true,
|
|
128
|
+
});
|
|
129
|
+
timer = setTimeout(() => {
|
|
130
|
+
controller.abort();
|
|
131
|
+
reject(new Error('timeout'));
|
|
132
|
+
}, timeoutMs);
|
|
133
|
+
}),
|
|
134
|
+
]);
|
|
135
|
+
return { provider: provider.name, status: controller.signal.aborted ? 'dropped' : 'sent' };
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
return {
|
|
139
|
+
provider: provider.name,
|
|
140
|
+
status: controller.signal.aborted ? 'dropped' : 'failed',
|
|
141
|
+
reason: controller.signal.aborted ? 'aborted_or_timeout' : 'provider_error',
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
finally {
|
|
145
|
+
if (timer !== undefined)
|
|
146
|
+
clearTimeout(timer);
|
|
147
|
+
active.delete(controller);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
function track(input) {
|
|
151
|
+
let suppliedId;
|
|
152
|
+
try {
|
|
153
|
+
suppliedId = input?.eventId;
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
/* Invalid input stays private. */
|
|
157
|
+
}
|
|
158
|
+
const eventId = typeof suppliedId === 'string' && /^[\w.-]{1,128}$/.test(suppliedId)
|
|
159
|
+
? suppliedId
|
|
160
|
+
: generateId();
|
|
161
|
+
let event;
|
|
162
|
+
try {
|
|
163
|
+
event =
|
|
164
|
+
suppliedId !== undefined && suppliedId !== eventId
|
|
165
|
+
? undefined
|
|
166
|
+
: sanitizeEvent(input, eventId);
|
|
167
|
+
}
|
|
168
|
+
catch {
|
|
169
|
+
event = undefined;
|
|
170
|
+
}
|
|
171
|
+
const status = !event
|
|
172
|
+
? 'invalid'
|
|
173
|
+
: disposed || pending.size >= maxPending
|
|
174
|
+
? 'dropped'
|
|
175
|
+
: undefined;
|
|
176
|
+
if (status)
|
|
177
|
+
return Promise.resolve(report({
|
|
178
|
+
eventId,
|
|
179
|
+
outcomes: (providers.length ? providers.map((p) => p.name) : ['core']).map((provider) => ({
|
|
180
|
+
provider,
|
|
181
|
+
status,
|
|
182
|
+
reason: status === 'invalid' ? 'event_schema' : 'capacity_or_disposed',
|
|
183
|
+
})),
|
|
184
|
+
}));
|
|
185
|
+
const operation = Promise.all(providers.map((p) => send(p, event))).then((outcomes) => report({ eventId, outcomes }));
|
|
186
|
+
pending.add(operation);
|
|
187
|
+
void operation.finally(() => pending.delete(operation));
|
|
188
|
+
return operation;
|
|
189
|
+
}
|
|
190
|
+
function setConsent(next) {
|
|
191
|
+
consent = normalizeConsent(next);
|
|
192
|
+
for (const connection of connections)
|
|
193
|
+
connection.consent = consent[connection.category];
|
|
194
|
+
notify();
|
|
195
|
+
for (const [controller, category] of active)
|
|
196
|
+
if (!consent[category])
|
|
197
|
+
controller.abort();
|
|
198
|
+
for (const provider of providers) {
|
|
199
|
+
try {
|
|
200
|
+
provider.setConsent?.({ ...consent });
|
|
201
|
+
}
|
|
202
|
+
catch {
|
|
203
|
+
/* Host isolation. */
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
setConsent(consent);
|
|
208
|
+
return {
|
|
209
|
+
track,
|
|
210
|
+
setConsent,
|
|
211
|
+
getConsent: () => ({ ...consent }),
|
|
212
|
+
getConnections: () => connections.map((connection) => ({ ...connection })),
|
|
213
|
+
subscribeConnections(listener) {
|
|
214
|
+
listeners.add(listener);
|
|
215
|
+
return () => {
|
|
216
|
+
listeners.delete(listener);
|
|
217
|
+
};
|
|
218
|
+
},
|
|
219
|
+
flush: async () => {
|
|
220
|
+
await Promise.all([...pending]);
|
|
221
|
+
},
|
|
222
|
+
dispose: () => {
|
|
223
|
+
disposed = true;
|
|
224
|
+
for (const connection of connections)
|
|
225
|
+
connection.disposed = true;
|
|
226
|
+
notify();
|
|
227
|
+
// Keep observers through aborted in-flight outcomes, then release them.
|
|
228
|
+
if (pending.size)
|
|
229
|
+
void Promise.all([...pending]).then(() => listeners.clear());
|
|
230
|
+
else
|
|
231
|
+
listeners.clear();
|
|
232
|
+
for (const controller of active.keys())
|
|
233
|
+
controller.abort();
|
|
234
|
+
for (const provider of providers) {
|
|
235
|
+
try {
|
|
236
|
+
provider.dispose?.();
|
|
237
|
+
}
|
|
238
|
+
catch {
|
|
239
|
+
/* Host isolation. */
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,GAKd,MAAM,uBAAuB,CAAC;AAc/B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAwBvD,MAAM,UAAU,UAAU;IACxB,OAAO,UAAU,CAAC,MAAM,CAAC,UAAU,EAAE,C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I,EAAE;YAChB,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;QAClC,CAAC;QACD,OAAO,EAAE,GAAG,EAAE;YACZ,QAAQ,GAAG,IAAI,CAAC;YAChB,KAAK,MAAM,UAAU,IAAI,WAAW;gBAAE,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC;YACjE,MAAM,EAAE,CAAC;YACT,wEAAwE;YACxE,IAAI,OAAO,CAAC,IAAI;gBAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC;;gBAC1E,SAAS,CAAC,KAAK,EAAE,CAAC;YACvB,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,IAAI,EAAE;gBAAE,UAAU,CAAC,KAAK,EAAE,CAAC;YAC3D,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;gBACjC,IAAI,CAAC;oBACH,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;gBACvB,CAAC;gBAAC,MAAM,CAAC;oBACP,qBAAqB;gBACvB,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@techinject/core",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0-alpha.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"import": "./dist/index.js"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"LICENSE",
|
|
15
|
+
"README.md"
|
|
16
|
+
],
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@techinject/contracts": "0.1.0-alpha.1"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/TechInjectIndia/signal-kit.git",
|
|
23
|
+
"directory": "packages/features/signals/core"
|
|
24
|
+
},
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"engines": {},
|
|
29
|
+
"description": "SignalKit core consent-aware telemetry package",
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "tsc -p tsconfig.json",
|
|
32
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
33
|
+
"test": "vitest run",
|
|
34
|
+
"lint": "tsc -p tsconfig.json --noEmit"
|
|
35
|
+
}
|
|
6
36
|
}
|