@cleartrip/ct-platform-rum-tracker 1.0.1-beta.0
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/dist/EventTransport.d.ts +17 -0
- package/dist/EventTransport.d.ts.map +1 -0
- package/dist/RumTrackerClient.d.ts +15 -0
- package/dist/RumTrackerClient.d.ts.map +1 -0
- package/dist/ct-platform-rum-tracker.cjs.js +2 -0
- package/dist/ct-platform-rum-tracker.cjs.js.map +1 -0
- package/dist/ct-platform-rum-tracker.esm.js +2 -0
- package/dist/ct-platform-rum-tracker.esm.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/types.d.ts +26 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +22 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { RumEvent, RumTrackerConfig } from './types';
|
|
2
|
+
export declare class EventTransport {
|
|
3
|
+
private queue;
|
|
4
|
+
private flushHandle;
|
|
5
|
+
private readonly flushIntervalMs;
|
|
6
|
+
private readonly config;
|
|
7
|
+
constructor(config: RumTrackerConfig);
|
|
8
|
+
send(event: RumEvent, flush?: boolean): void;
|
|
9
|
+
flush(): void;
|
|
10
|
+
destroy(): void;
|
|
11
|
+
private postJson;
|
|
12
|
+
private onError;
|
|
13
|
+
private ensureFlushTimer;
|
|
14
|
+
private flushQueue;
|
|
15
|
+
private flushNowWith;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=EventTransport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventTransport.d.ts","sourceRoot":"","sources":["../packages/rum-tracker/src/EventTransport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE1D,qBAAa,cAAc;IACzB,OAAO,CAAC,KAAK,CAAkB;IAC/B,OAAO,CAAC,WAAW,CAA8C;IACjE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmB;gBAE9B,MAAM,EAAE,gBAAgB;IAMpC,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,UAAQ,GAAG,IAAI;IAa1C,KAAK,IAAI,IAAI;IAKb,OAAO,IAAI,IAAI;IAWf,OAAO,CAAC,QAAQ;IAoDhB,OAAO,CAAC,OAAO;IAYf,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,UAAU;IAkBlB,OAAO,CAAC,YAAY;CAYrB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { RumTrackerConfig, TrackEventOptions } from './types';
|
|
2
|
+
export declare class RumTrackerClient {
|
|
3
|
+
private readonly config;
|
|
4
|
+
private readonly transport;
|
|
5
|
+
private initialized;
|
|
6
|
+
private boundFlush;
|
|
7
|
+
private boundVisibility;
|
|
8
|
+
constructor(config: RumTrackerConfig);
|
|
9
|
+
init(): void;
|
|
10
|
+
trackEvent(options: TrackEventOptions, flush?: boolean): void;
|
|
11
|
+
flush(): void;
|
|
12
|
+
destroy(): void;
|
|
13
|
+
private createEvent;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=RumTrackerClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RumTrackerClient.d.ts","sourceRoot":"","sources":["../packages/rum-tracker/src/RumTrackerClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAEhB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAGjB,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmB;IAC1C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAiB;IAC3C,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,UAAU,CAA6B;IAC/C,OAAO,CAAC,eAAe,CAA6B;gBAExC,MAAM,EAAE,gBAAgB;IAUpC,IAAI,IAAI,IAAI;IAuBZ,UAAU,CACR,OAAO,EAAE,iBAAiB,EAC1B,KAAK,UAAQ,GACZ,IAAI;IAoBP,KAAK,IAAI,IAAI;IAMb,OAAO,IAAI,IAAI;IAsBf,OAAO,CAAC,WAAW;CAkBpB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var t=function(){function t(t){var n;this.queue=[],this.flushHandle=null,this.config=t,this.flushIntervalMs=null!==(n=t.flushIntervalMs)&&void 0!==n?n:3e3}return t.prototype.send=function(t,n){void 0===n&&(n=!1),"undefined"!=typeof window&&(n?this.flushNowWith(t):(this.queue.push(t),this.ensureFlushTimer()))},t.prototype.flush=function(){this.flushQueue()},t.prototype.destroy=function(){this.flushHandle&&(clearTimeout(this.flushHandle),this.flushHandle=null),this.queue.length>0&&this.flushQueue()},t.prototype.postJson=function(t,n){var e=this;if("undefined"!=typeof window){var i;try{i=JSON.stringify(n)}catch(t){return console.warn("[rum-tracker] Failed to serialise payload:",t),void this.onError(t)}try{if("undefined"!=typeof navigator&&"sendBeacon"in navigator){var o=new Blob([i],{type:"application/json"});if(navigator.sendBeacon(t,o))return}}catch(t){console.warn("[rum-tracker] sendBeacon failed:",t),this.onError(t)}fetch(t,{method:"POST",headers:{accept:"application/json","Content-Type":"application/json"},body:i,keepalive:!0}).catch((function(t){console.warn("[rum-tracker] fetch failed:",t),e.onError(t)}))}},t.prototype.onError=function(t){var n,e;try{null===(e=(n=this.config).onError)||void 0===e||e.call(n,t)}catch(t){console.warn("[rum-tracker] onError callback threw:",t)}},t.prototype.ensureFlushTimer=function(){var t=this;null===this.flushHandle&&(this.flushHandle=setTimeout((function(){return t.flushQueue()}),this.flushIntervalMs))},t.prototype.flushQueue=function(){if(0!==this.queue.length){var t=this.queue.slice();this.queue=[],this.flushHandle&&(clearTimeout(this.flushHandle),this.flushHandle=null),this.postJson(this.config.endpoint,t)}else this.flushHandle&&(clearTimeout(this.flushHandle),this.flushHandle=null)},t.prototype.flushNowWith=function(t){var n=this.queue.length>0?this.queue.slice():[];n.push(t),this.queue=[],this.flushHandle&&(clearTimeout(this.flushHandle),this.flushHandle=null),this.postJson(this.config.endpoint,n)},t}(),n=function(){function n(n){this.initialized=!1,this.boundFlush=null,this.boundVisibility=null,this.config=n,this.transport=new t(n)}return n.prototype.init=function(){var t=this;this.initialized||"undefined"==typeof window||(this.initialized=!0,this.boundFlush=function(){return t.transport.flush()},this.boundVisibility=function(){"hidden"===document.visibilityState&&t.transport.flush()},window.addEventListener("beforeunload",this.boundFlush),document.addEventListener("visibilitychange",this.boundVisibility))},n.prototype.trackEvent=function(t,n){var e,i;void 0===n&&(n=!1);try{var o=this.createEvent(t);this.transport.send(o,n)}catch(t){if(console.warn("[rum-tracker] trackEvent failed:",t),t instanceof Error)try{null===(i=(e=this.config).onError)||void 0===i||i.call(e,t)}catch(t){console.warn("[rum-tracker] onError callback threw:",t)}}},n.prototype.flush=function(){this.transport.flush()},n.prototype.destroy=function(){this.transport.destroy(),"undefined"!=typeof window&&(this.boundFlush&&window.removeEventListener("beforeunload",this.boundFlush),this.boundVisibility&&document.removeEventListener("visibilitychange",this.boundVisibility)),this.boundFlush=null,this.boundVisibility=null,this.initialized=!1},n.prototype.createEvent=function(t){var n,e="undefined"!=typeof window?window.location.pathname:"server";return{"@timestamp":(new Date).toISOString(),eventType:this.config.eventType,"service.environment":this.config.environment,urlPath:e,platform:t.platform,eventName:t.eventName,page:t.page,component:t.component,labels:null!==(n=t.labels)&&void 0!==n?n:{}}},n}();exports.RumTrackerClient=n;
|
|
2
|
+
//# sourceMappingURL=ct-platform-rum-tracker.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ct-platform-rum-tracker.cjs.js","sources":["../packages/rum-tracker/src/EventTransport.ts","../packages/rum-tracker/src/RumTrackerClient.ts"],"sourcesContent":[null,null],"names":["EventTransport","config","this","queue","flushHandle","flushIntervalMs","_a","prototype","send","event","flush","window","flushNowWith","push","ensureFlushTimer","flushQueue","destroy","clearTimeout","length","postJson","url","body","_this","json","JSON","stringify","error","console","warn","onError","navigator","blob","Blob","type","sendBeacon","fetch","method","headers","accept","keepalive","catch","_b","call","cbError","setTimeout","payload","slice","endpoint","RumTrackerClient","initialized","boundFlush","boundVisibility","transport","init","document","visibilityState","addEventListener","trackEvent","options","event_1","createEvent","Error","removeEventListener","urlPath","location","pathname","Date","toISOString","eventType","environment","platform","eventName","page","component","labels"],"mappings":"aAEA,IAAAA,EAAA,WAME,SAAAA,EAAYC,SALJC,KAAKC,MAAe,GACpBD,KAAWE,YAAyC,KAK1DF,KAAKD,OAASA,EACdC,KAAKG,gBAA4C,QAA1BC,EAAAL,EAAOI,uBAAmB,IAAAC,EAAAA,EAAA,GAClD,CAuIH,OApIEN,EAAAO,UAAAC,KAAA,SAAKC,EAAiBC,QAAA,IAAAA,IAAAA,GAAa,GACX,oBAAXC,SAEPD,EACFR,KAAKU,aAAaH,IAIpBP,KAAKC,MAAMU,KAAKJ,GAChBP,KAAKY,sBAIPd,EAAAO,UAAAG,MAAA,WACER,KAAKa,cAIPf,EAAAO,UAAAS,QAAA,WACMd,KAAKE,cACPa,aAAaf,KAAKE,aAClBF,KAAKE,YAAc,MAEjBF,KAAKC,MAAMe,OAAS,GACtBhB,KAAKa,cAKDf,EAAAO,UAAAY,SAAR,SAAiBC,EAAaC,GAA9B,IAiDCC,EAAApB,KAhDC,GAAsB,oBAAXS,OAAX,CAEA,IAAIY,EACJ,IACEA,EAAOC,KAAKC,UAAUJ,EACvB,CAAC,MAAOK,GAMP,OALAC,QAAQC,KACN,6CACAF,QAEFxB,KAAK2B,QAAQH,EAEd,CAED,IACE,GACuB,oBAAdI,WACJ,eAAgBA,UACnB,CACA,IAAMC,EAAO,IAAIC,KACf,CAACT,GACD,CAAEU,KAAM,qBAEV,GAAIH,UAAUI,WAAWd,EAAKW,GAAO,MACtC,CACF,CAAC,MAAOL,GACPC,QAAQC,KACN,mCACAF,GAEFxB,KAAK2B,QAAQH,E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N,QAAOA,EACPO,SAAUZ,EAAQY,SAClBC,UAAWb,EAAQa,UACnBC,KAAMd,EAAQc,KACdC,UAAWf,EAAQe,UACnBC,eAAQpE,EAAAoD,EAAQgB,sBAAU,CAAE,IAGjC1B,CAAD"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var t=function(){function t(t){var n;this.queue=[],this.flushHandle=null,this.config=t,this.flushIntervalMs=null!==(n=t.flushIntervalMs)&&void 0!==n?n:3e3}return t.prototype.send=function(t,n){void 0===n&&(n=!1),"undefined"!=typeof window&&(n?this.flushNowWith(t):(this.queue.push(t),this.ensureFlushTimer()))},t.prototype.flush=function(){this.flushQueue()},t.prototype.destroy=function(){this.flushHandle&&(clearTimeout(this.flushHandle),this.flushHandle=null),this.queue.length>0&&this.flushQueue()},t.prototype.postJson=function(t,n){var e=this;if("undefined"!=typeof window){var i;try{i=JSON.stringify(n)}catch(t){return console.warn("[rum-tracker] Failed to serialise payload:",t),void this.onError(t)}try{if("undefined"!=typeof navigator&&"sendBeacon"in navigator){var o=new Blob([i],{type:"application/json"});if(navigator.sendBeacon(t,o))return}}catch(t){console.warn("[rum-tracker] sendBeacon failed:",t),this.onError(t)}fetch(t,{method:"POST",headers:{accept:"application/json","Content-Type":"application/json"},body:i,keepalive:!0}).catch((function(t){console.warn("[rum-tracker] fetch failed:",t),e.onError(t)}))}},t.prototype.onError=function(t){var n,e;try{null===(e=(n=this.config).onError)||void 0===e||e.call(n,t)}catch(t){console.warn("[rum-tracker] onError callback threw:",t)}},t.prototype.ensureFlushTimer=function(){var t=this;null===this.flushHandle&&(this.flushHandle=setTimeout((function(){return t.flushQueue()}),this.flushIntervalMs))},t.prototype.flushQueue=function(){if(0!==this.queue.length){var t=this.queue.slice();this.queue=[],this.flushHandle&&(clearTimeout(this.flushHandle),this.flushHandle=null),this.postJson(this.config.endpoint,t)}else this.flushHandle&&(clearTimeout(this.flushHandle),this.flushHandle=null)},t.prototype.flushNowWith=function(t){var n=this.queue.length>0?this.queue.slice():[];n.push(t),this.queue=[],this.flushHandle&&(clearTimeout(this.flushHandle),this.flushHandle=null),this.postJson(this.config.endpoint,n)},t}(),n=function(){function n(n){this.initialized=!1,this.boundFlush=null,this.boundVisibility=null,this.config=n,this.transport=new t(n)}return n.prototype.init=function(){var t=this;this.initialized||"undefined"==typeof window||(this.initialized=!0,this.boundFlush=function(){return t.transport.flush()},this.boundVisibility=function(){"hidden"===document.visibilityState&&t.transport.flush()},window.addEventListener("beforeunload",this.boundFlush),document.addEventListener("visibilitychange",this.boundVisibility))},n.prototype.trackEvent=function(t,n){var e,i;void 0===n&&(n=!1);try{var o=this.createEvent(t);this.transport.send(o,n)}catch(t){if(console.warn("[rum-tracker] trackEvent failed:",t),t instanceof Error)try{null===(i=(e=this.config).onError)||void 0===i||i.call(e,t)}catch(t){console.warn("[rum-tracker] onError callback threw:",t)}}},n.prototype.flush=function(){this.transport.flush()},n.prototype.destroy=function(){this.transport.destroy(),"undefined"!=typeof window&&(this.boundFlush&&window.removeEventListener("beforeunload",this.boundFlush),this.boundVisibility&&document.removeEventListener("visibilitychange",this.boundVisibility)),this.boundFlush=null,this.boundVisibility=null,this.initialized=!1},n.prototype.createEvent=function(t){var n,e="undefined"!=typeof window?window.location.pathname:"server";return{"@timestamp":(new Date).toISOString(),eventType:this.config.eventType,"service.environment":this.config.environment,urlPath:e,platform:t.platform,eventName:t.eventName,page:t.page,component:t.component,labels:null!==(n=t.labels)&&void 0!==n?n:{}}},n}();export{n as RumTrackerClient};
|
|
2
|
+
//# sourceMappingURL=ct-platform-rum-tracker.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ct-platform-rum-tracker.esm.js","sources":["../packages/rum-tracker/src/EventTransport.ts","../packages/rum-tracker/src/RumTrackerClient.ts"],"sourcesContent":[null,null],"names":["EventTransport","config","this","queue","flushHandle","flushIntervalMs","_a","prototype","send","event","flush","window","flushNowWith","push","ensureFlushTimer","flushQueue","destroy","clearTimeout","length","postJson","url","body","_this","json","JSON","stringify","error","console","warn","onError","navigator","blob","Blob","type","sendBeacon","fetch","method","headers","accept","keepalive","catch","_b","call","cbError","setTimeout","payload","slice","endpoint","RumTrackerClient","initialized","boundFlush","boundVisibility","transport","init","document","visibilityState","addEventListener","trackEvent","options","event_1","createEvent","Error","removeEventListener","urlPath","location","pathname","Date","toISOString","eventType","environment","platform","eventName","page","component","labels"],"mappings":"AAEA,IAAAA,EAAA,WAME,SAAAA,EAAYC,SALJC,KAAKC,MAAe,GACpBD,KAAWE,YAAyC,KAK1DF,KAAKD,OAASA,EACdC,KAAKG,gBAA4C,QAA1BC,EAAAL,EAAOI,uBAAmB,IAAAC,EAAAA,EAAA,GAClD,CAuIH,OApIEN,EAAAO,UAAAC,KAAA,SAAKC,EAAiBC,QAAA,IAAAA,IAAAA,GAAa,GACX,oBAAXC,SAEPD,EACFR,KAAKU,aAAaH,IAIpBP,KAAKC,MAAMU,KAAKJ,GAChBP,KAAKY,sBAIPd,EAAAO,UAAAG,MAAA,WACER,KAAKa,cAIPf,EAAAO,UAAAS,QAAA,WACMd,KAAKE,cACPa,aAAaf,KAAKE,aAClBF,KAAKE,YAAc,MAEjBF,KAAKC,MAAMe,OAAS,GACtBhB,KAAKa,cAKDf,EAAAO,UAAAY,SAAR,SAAiBC,EAAaC,GAA9B,IAiDCC,EAAApB,KAhDC,GAAsB,oBAAXS,OAAX,CAEA,IAAIY,EACJ,IACEA,EAAOC,KAAKC,UAAUJ,EACvB,CAAC,MAAOK,GAMP,OALAC,QAAQC,KACN,6CACAF,QAEFxB,KAAK2B,QAAQH,EAEd,CAED,IACE,GACuB,oBAAdI,WACJ,eAAgBA,UACnB,CACA,IAAMC,EAAO,IAAIC,KACf,CAACT,GACD,CAAEU,KAAM,qBAEV,GAAIH,UAAUI,WAAWd,EAAKW,GAAO,MACtC,CACF,CAAC,MAAOL,GACPC,QAAQC,KACN,mCACAF,GAEFxB,KAAK2B,QAAQH,EACd,CAEDS,MAAMf,EA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Z,EAAQY,SAClBC,UAAWb,EAAQa,UACnBC,KAAMd,EAAQc,KACdC,UAAWf,EAAQe,UACnBC,eAAQpE,EAAAoD,EAAQgB,sBAAU,CAAE,IAGjC1B,CAAD"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../packages/rum-tracker/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EACV,gBAAgB,EAChB,QAAQ,EACR,iBAAiB,GAClB,MAAM,SAAS,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface RumTrackerConfig {
|
|
2
|
+
eventType: string;
|
|
3
|
+
environment: string;
|
|
4
|
+
endpoint: string;
|
|
5
|
+
flushIntervalMs?: number;
|
|
6
|
+
onError?: (error: Error) => void;
|
|
7
|
+
}
|
|
8
|
+
export interface RumEvent {
|
|
9
|
+
'@timestamp': string;
|
|
10
|
+
eventType: string;
|
|
11
|
+
'service.environment': string;
|
|
12
|
+
urlPath: string;
|
|
13
|
+
platform?: string;
|
|
14
|
+
eventName: string;
|
|
15
|
+
page?: string;
|
|
16
|
+
component?: string;
|
|
17
|
+
labels?: Record<string, string | number | boolean>;
|
|
18
|
+
}
|
|
19
|
+
export interface TrackEventOptions {
|
|
20
|
+
eventName: string;
|
|
21
|
+
platform?: string;
|
|
22
|
+
page?: string;
|
|
23
|
+
component?: string;
|
|
24
|
+
labels?: Record<string, string | number | boolean>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../packages/rum-tracker/src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,QAAQ;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CACpD;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CACpD"}
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cleartrip/ct-platform-rum-tracker",
|
|
3
|
+
"version": "1.0.1-beta.0",
|
|
4
|
+
"description": "Lightweight client for batching and sending UI events to any APM endpoint",
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
6
|
+
"main": "dist/ct-platform-rum-tracker.cjs.js",
|
|
7
|
+
"module": "dist/ct-platform-rum-tracker.esm.js",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"dependencies": {},
|
|
13
|
+
"peerDependencies": {},
|
|
14
|
+
"author": "Cleartrip",
|
|
15
|
+
"license": "ISC",
|
|
16
|
+
"scripts": {
|
|
17
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
18
|
+
"watch-package": "rollup -c -w",
|
|
19
|
+
"build-package": "rollup -c",
|
|
20
|
+
"build-package:clean": "rm -rf dist && rollup -c"
|
|
21
|
+
}
|
|
22
|
+
}
|