@teambit/ipc-events 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/dist/index.d.ts +4 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/ipc-events.aspect.d.ts +2 -0
- package/dist/ipc-events.aspect.js +19 -0
- package/dist/ipc-events.aspect.js.map +1 -0
- package/dist/ipc-events.main.runtime.d.ts +38 -0
- package/dist/ipc-events.main.runtime.js +119 -0
- package/dist/ipc-events.main.runtime.js.map +1 -0
- package/dist/preview-1689823719636.js +7 -0
- package/package-tar/teambit-ipc-events-0.0.1.tgz +0 -0
- package/package.json +53 -0
- package/tsconfig.json +40 -0
- package/types/asset.d.ts +29 -0
- package/types/style.d.ts +42 -0
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "IpcEventsAspect", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _ipcEvents().IpcEventsAspect;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
exports.default = void 0;
|
|
13
|
+
function _ipcEvents() {
|
|
14
|
+
const data = require("./ipc-events.aspect");
|
|
15
|
+
_ipcEvents = function () {
|
|
16
|
+
return data;
|
|
17
|
+
};
|
|
18
|
+
return data;
|
|
19
|
+
}
|
|
20
|
+
var _default = _ipcEvents().IpcEventsAspect;
|
|
21
|
+
exports.default = _default;
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["IpcEventsAspect"],"sources":["index.ts"],"sourcesContent":["import { IpcEventsAspect } from './ipc-events.aspect';\n\nexport type { IpcEventsMain } from './ipc-events.main.runtime';\nexport default IpcEventsAspect;\nexport { IpcEventsAspect };\n"],"mappings":";;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAsD,eAGvCA,4BAAe;AAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.IpcEventsAspect = void 0;
|
|
7
|
+
function _harmony() {
|
|
8
|
+
const data = require("@teambit/harmony");
|
|
9
|
+
_harmony = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
const IpcEventsAspect = _harmony().Aspect.create({
|
|
15
|
+
id: 'teambit.harmony/ipc-events'
|
|
16
|
+
});
|
|
17
|
+
exports.IpcEventsAspect = IpcEventsAspect;
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=ipc-events.aspect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["IpcEventsAspect","Aspect","create","id"],"sources":["ipc-events.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const IpcEventsAspect = Aspect.create({\n id: 'teambit.harmony/ipc-events',\n});\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,eAAe,GAAGC,iBAAM,CAACC,MAAM,CAAC;EAC3CC,EAAE,EAAE;AACN,CAAC,CAAC;AAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ScopeMain } from '@teambit/scope';
|
|
2
|
+
import { SlotRegistry } from '@teambit/harmony';
|
|
3
|
+
declare type EventName = 'onPostInstall';
|
|
4
|
+
declare type GotEvent = (eventName: EventName) => Promise<void>;
|
|
5
|
+
declare type GotEventSlot = SlotRegistry<GotEvent>;
|
|
6
|
+
/**
|
|
7
|
+
* imagine you have multiple processes running in the background, such as `bit watch`, `bit start`, `bit server`.
|
|
8
|
+
* the user is running `bit install` from the cli, how do you let these processes know that the installation is complete?
|
|
9
|
+
* `bit start` for instance could use ths info to clear the "component issues" of the components that were missing packages.
|
|
10
|
+
*
|
|
11
|
+
* this class provides a mechanism to achieve this by writing the event into the filesystem (`.bit/events/event-name`),
|
|
12
|
+
* while each one of the processes has a watcher in the background watch this file. once they got the data from the watcher,
|
|
13
|
+
* they can act upon it.
|
|
14
|
+
*
|
|
15
|
+
* in the previous example, when the user is running `bit install`, the install aspect runs `this.publishIpcEvent` to
|
|
16
|
+
* write `.bit/events/onPostInstall` to the filesystem. then, the watcher of `bit start` process got a notification
|
|
17
|
+
* that this file has changed/added and it runs `triggerGotEvent` to run all aspects registered to its gotEventSlot.
|
|
18
|
+
* the installer in turn is registered to this slot and once its function is triggered, it check whether the eventName
|
|
19
|
+
* is onPostInstall and then triggers its own OnPostInstall slot.
|
|
20
|
+
*/
|
|
21
|
+
export declare class IpcEventsMain {
|
|
22
|
+
private scope;
|
|
23
|
+
private gotEventSlot;
|
|
24
|
+
constructor(scope: ScopeMain, gotEventSlot: GotEventSlot);
|
|
25
|
+
registerGotEventSlot(fn: GotEvent): void;
|
|
26
|
+
triggerGotEvent(eventName: EventName): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* write event data into the filesystem, so then other processes, such as "bit start", "bit watch", could use the
|
|
29
|
+
* watcher to get the event data.
|
|
30
|
+
*/
|
|
31
|
+
publishIpcEvent(eventName: EventName, data?: Record<string, any>): Promise<void>;
|
|
32
|
+
get eventsDir(): string;
|
|
33
|
+
static slots: ((registerFn: () => string) => SlotRegistry<GotEventSlot>)[];
|
|
34
|
+
static dependencies: import("@teambit/harmony").Aspect[];
|
|
35
|
+
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
36
|
+
static provider([scope]: [ScopeMain], _: any, [gotEventSlot]: [GotEventSlot]): Promise<IpcEventsMain>;
|
|
37
|
+
}
|
|
38
|
+
export default IpcEventsMain;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
require("core-js/modules/es.array.iterator.js");
|
|
5
|
+
require("core-js/modules/es.promise.js");
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.default = exports.IpcEventsMain = void 0;
|
|
10
|
+
function _defineProperty2() {
|
|
11
|
+
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
+
_defineProperty2 = function () {
|
|
13
|
+
return data;
|
|
14
|
+
};
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
17
|
+
function _scope() {
|
|
18
|
+
const data = _interopRequireDefault(require("@teambit/scope"));
|
|
19
|
+
_scope = function () {
|
|
20
|
+
return data;
|
|
21
|
+
};
|
|
22
|
+
return data;
|
|
23
|
+
}
|
|
24
|
+
function _harmony() {
|
|
25
|
+
const data = require("@teambit/harmony");
|
|
26
|
+
_harmony = function () {
|
|
27
|
+
return data;
|
|
28
|
+
};
|
|
29
|
+
return data;
|
|
30
|
+
}
|
|
31
|
+
function _pMapSeries() {
|
|
32
|
+
const data = _interopRequireDefault(require("p-map-series"));
|
|
33
|
+
_pMapSeries = function () {
|
|
34
|
+
return data;
|
|
35
|
+
};
|
|
36
|
+
return data;
|
|
37
|
+
}
|
|
38
|
+
function _cli() {
|
|
39
|
+
const data = require("@teambit/cli");
|
|
40
|
+
_cli = function () {
|
|
41
|
+
return data;
|
|
42
|
+
};
|
|
43
|
+
return data;
|
|
44
|
+
}
|
|
45
|
+
function _path() {
|
|
46
|
+
const data = _interopRequireDefault(require("path"));
|
|
47
|
+
_path = function () {
|
|
48
|
+
return data;
|
|
49
|
+
};
|
|
50
|
+
return data;
|
|
51
|
+
}
|
|
52
|
+
function _fsExtra() {
|
|
53
|
+
const data = _interopRequireDefault(require("fs-extra"));
|
|
54
|
+
_fsExtra = function () {
|
|
55
|
+
return data;
|
|
56
|
+
};
|
|
57
|
+
return data;
|
|
58
|
+
}
|
|
59
|
+
function _ipcEvents() {
|
|
60
|
+
const data = require("./ipc-events.aspect");
|
|
61
|
+
_ipcEvents = function () {
|
|
62
|
+
return data;
|
|
63
|
+
};
|
|
64
|
+
return data;
|
|
65
|
+
}
|
|
66
|
+
const EVENTS_DIR = 'events';
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* imagine you have multiple processes running in the background, such as `bit watch`, `bit start`, `bit server`.
|
|
70
|
+
* the user is running `bit install` from the cli, how do you let these processes know that the installation is complete?
|
|
71
|
+
* `bit start` for instance could use ths info to clear the "component issues" of the components that were missing packages.
|
|
72
|
+
*
|
|
73
|
+
* this class provides a mechanism to achieve this by writing the event into the filesystem (`.bit/events/event-name`),
|
|
74
|
+
* while each one of the processes has a watcher in the background watch this file. once they got the data from the watcher,
|
|
75
|
+
* they can act upon it.
|
|
76
|
+
*
|
|
77
|
+
* in the previous example, when the user is running `bit install`, the install aspect runs `this.publishIpcEvent` to
|
|
78
|
+
* write `.bit/events/onPostInstall` to the filesystem. then, the watcher of `bit start` process got a notification
|
|
79
|
+
* that this file has changed/added and it runs `triggerGotEvent` to run all aspects registered to its gotEventSlot.
|
|
80
|
+
* the installer in turn is registered to this slot and once its function is triggered, it check whether the eventName
|
|
81
|
+
* is onPostInstall and then triggers its own OnPostInstall slot.
|
|
82
|
+
*/
|
|
83
|
+
class IpcEventsMain {
|
|
84
|
+
constructor(scope, gotEventSlot) {
|
|
85
|
+
this.scope = scope;
|
|
86
|
+
this.gotEventSlot = gotEventSlot;
|
|
87
|
+
}
|
|
88
|
+
registerGotEventSlot(fn) {
|
|
89
|
+
this.gotEventSlot.register(fn);
|
|
90
|
+
}
|
|
91
|
+
async triggerGotEvent(eventName) {
|
|
92
|
+
await (0, _pMapSeries().default)(this.gotEventSlot.values(), fn => fn(eventName));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* write event data into the filesystem, so then other processes, such as "bit start", "bit watch", could use the
|
|
97
|
+
* watcher to get the event data.
|
|
98
|
+
*/
|
|
99
|
+
async publishIpcEvent(eventName, data) {
|
|
100
|
+
const filename = _path().default.join(this.eventsDir, eventName);
|
|
101
|
+
const content = data ? JSON.stringify(data, undefined, 2) : '';
|
|
102
|
+
await _fsExtra().default.outputFile(filename, content);
|
|
103
|
+
}
|
|
104
|
+
get eventsDir() {
|
|
105
|
+
return _path().default.join(this.scope.path, EVENTS_DIR);
|
|
106
|
+
}
|
|
107
|
+
static async provider([scope], _, [gotEventSlot]) {
|
|
108
|
+
return new IpcEventsMain(scope, gotEventSlot);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
exports.IpcEventsMain = IpcEventsMain;
|
|
112
|
+
(0, _defineProperty2().default)(IpcEventsMain, "slots", [_harmony().Slot.withType()]);
|
|
113
|
+
(0, _defineProperty2().default)(IpcEventsMain, "dependencies", [_scope().default]);
|
|
114
|
+
(0, _defineProperty2().default)(IpcEventsMain, "runtime", _cli().MainRuntime);
|
|
115
|
+
_ipcEvents().IpcEventsAspect.addRuntime(IpcEventsMain);
|
|
116
|
+
var _default = IpcEventsMain;
|
|
117
|
+
exports.default = _default;
|
|
118
|
+
|
|
119
|
+
//# sourceMappingURL=ipc-events.main.runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["EVENTS_DIR","IpcEventsMain","constructor","scope","gotEventSlot","registerGotEventSlot","fn","register","triggerGotEvent","eventName","pMapSeries","values","publishIpcEvent","data","filename","path","join","eventsDir","content","JSON","stringify","undefined","fs","outputFile","provider","_","Slot","withType","ScopeAspect","MainRuntime","IpcEventsAspect","addRuntime"],"sources":["ipc-events.main.runtime.ts"],"sourcesContent":["import ScopeAspect, { ScopeMain } from '@teambit/scope';\nimport { Slot, SlotRegistry } from '@teambit/harmony';\nimport pMapSeries from 'p-map-series';\nimport { MainRuntime } from '@teambit/cli';\nimport path from 'path';\nimport fs from 'fs-extra';\nimport { IpcEventsAspect } from './ipc-events.aspect';\n\ntype EventName = 'onPostInstall';\n\ntype GotEvent = (eventName: EventName) => Promise<void>;\ntype GotEventSlot = SlotRegistry<GotEvent>;\n\nconst EVENTS_DIR = 'events';\n\n/**\n * imagine you have multiple processes running in the background, such as `bit watch`, `bit start`, `bit server`.\n * the user is running `bit install` from the cli, how do you let these processes know that the installation is complete?\n * `bit start` for instance could use ths info to clear the \"component issues\" of the components that were missing packages.\n *\n * this class provides a mechanism to achieve this by writing the event into the filesystem (`.bit/events/event-name`),\n * while each one of the processes has a watcher in the background watch this file. once they got the data from the watcher,\n * they can act upon it.\n *\n * in the previous example, when the user is running `bit install`, the install aspect runs `this.publishIpcEvent` to\n * write `.bit/events/onPostInstall` to the filesystem. then, the watcher of `bit start` process got a notification\n * that this file has changed/added and it runs `triggerGotEvent` to run all aspects registered to its gotEventSlot.\n * the installer in turn is registered to this slot and once its function is triggered, it check whether the eventName\n * is onPostInstall and then triggers its own OnPostInstall slot.\n */\nexport class IpcEventsMain {\n constructor(private scope: ScopeMain, private gotEventSlot: GotEventSlot) {}\n\n registerGotEventSlot(fn: GotEvent) {\n this.gotEventSlot.register(fn);\n }\n\n async triggerGotEvent(eventName: EventName) {\n await pMapSeries(this.gotEventSlot.values(), (fn) => fn(eventName));\n }\n\n /**\n * write event data into the filesystem, so then other processes, such as \"bit start\", \"bit watch\", could use the\n * watcher to get the event data.\n */\n async publishIpcEvent(eventName: EventName, data?: Record<string, any>) {\n const filename = path.join(this.eventsDir, eventName);\n const content = data ? JSON.stringify(data, undefined, 2) : '';\n await fs.outputFile(filename, content);\n }\n\n get eventsDir() {\n return path.join(this.scope.path, EVENTS_DIR);\n }\n\n static slots = [Slot.withType<GotEventSlot>()];\n static dependencies = [ScopeAspect];\n static runtime = MainRuntime;\n\n static async provider([scope]: [ScopeMain], _, [gotEventSlot]: [GotEventSlot]) {\n return new IpcEventsMain(scope, gotEventSlot);\n }\n}\n\nIpcEventsAspect.addRuntime(IpcEventsMain);\n\nexport default IpcEventsMain;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAOA,MAAMA,UAAU,GAAG,QAAQ;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,aAAa,CAAC;EACzBC,WAAW,CAASC,KAAgB,EAAUC,YAA0B,EAAE;IAAA,KAAtDD,KAAgB,GAAhBA,KAAgB;IAAA,KAAUC,YAA0B,GAA1BA,YAA0B;EAAG;EAE3EC,oBAAoB,CAACC,EAAY,EAAE;IACjC,IAAI,CAACF,YAAY,CAACG,QAAQ,CAACD,EAAE,CAAC;EAChC;EAEA,MAAME,eAAe,CAACC,SAAoB,EAAE;IAC1C,MAAM,IAAAC,qBAAU,EAAC,IAAI,CAACN,YAAY,CAACO,MAAM,EAAE,EAAGL,EAAE,IAAKA,EAAE,CAACG,SAAS,CAAC,CAAC;EACrE;;EAEA;AACF;AACA;AACA;EACE,MAAMG,eAAe,CAACH,SAAoB,EAAEI,IAA0B,EAAE;IACtE,MAAMC,QAAQ,GAAGC,eAAI,CAACC,IAAI,CAAC,IAAI,CAACC,SAAS,EAAER,SAAS,CAAC;IACrD,MAAMS,OAAO,GAAGL,IAAI,GAAGM,IAAI,CAACC,SAAS,CAACP,IAAI,EAAEQ,SAAS,EAAE,CAAC,CAAC,GAAG,EAAE;IAC9D,MAAMC,kBAAE,CAACC,UAAU,CAACT,QAAQ,EAAEI,OAAO,CAAC;EACxC;EAEA,IAAID,SAAS,GAAG;IACd,OAAOF,eAAI,CAACC,IAAI,CAAC,IAAI,CAACb,KAAK,CAACY,IAAI,EAAEf,UAAU,CAAC;EAC/C;EAMA,aAAawB,QAAQ,CAAC,CAACrB,KAAK,CAAc,EAAEsB,CAAC,EAAE,CAACrB,YAAY,CAAiB,EAAE;IAC7E,OAAO,IAAIH,aAAa,CAACE,KAAK,EAAEC,YAAY,CAAC;EAC/C;AACF;AAAC;AAAA,gCAhCYH,aAAa,WAyBT,CAACyB,eAAI,CAACC,QAAQ,EAAgB,CAAC;AAAA,gCAzBnC1B,aAAa,kBA0BF,CAAC2B,gBAAW,CAAC;AAAA,gCA1BxB3B,aAAa,aA2BP4B,kBAAW;AAO9BC,4BAAe,CAACC,UAAU,CAAC9B,aAAa,CAAC;AAAC,eAE3BA,aAAa;AAAA"}
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@teambit/ipc-events",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"componentId": {
|
|
6
|
+
"scope": "teambit.harmony",
|
|
7
|
+
"name": "ipc-events",
|
|
8
|
+
"version": "0.0.1"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"fs-extra": "10.0.0",
|
|
12
|
+
"p-map-series": "2.1.0",
|
|
13
|
+
"core-js": "^3.0.0",
|
|
14
|
+
"@babel/runtime": "7.20.0",
|
|
15
|
+
"@teambit/harmony": "0.4.6",
|
|
16
|
+
"@teambit/cli": "0.0.743",
|
|
17
|
+
"@teambit/scope": "0.0.1111"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@types/fs-extra": "9.0.7",
|
|
21
|
+
"@types/mocha": "9.1.0",
|
|
22
|
+
"@types/node": "12.20.4",
|
|
23
|
+
"@types/react": "^17.0.8",
|
|
24
|
+
"@types/react-dom": "^17.0.5",
|
|
25
|
+
"@types/jest": "^26.0.0",
|
|
26
|
+
"@types/testing-library__jest-dom": "5.9.5"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@teambit/legacy": "1.0.523",
|
|
30
|
+
"react": "^16.8.0 || ^17.0.0",
|
|
31
|
+
"react-dom": "^16.8.0 || ^17.0.0"
|
|
32
|
+
},
|
|
33
|
+
"license": "Apache-2.0",
|
|
34
|
+
"private": false,
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=12.22.0"
|
|
37
|
+
},
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "https://github.com/teambit/bit"
|
|
41
|
+
},
|
|
42
|
+
"keywords": [
|
|
43
|
+
"bit",
|
|
44
|
+
"bit-aspect",
|
|
45
|
+
"components",
|
|
46
|
+
"collaboration",
|
|
47
|
+
"web",
|
|
48
|
+
"react",
|
|
49
|
+
"react-components",
|
|
50
|
+
"angular",
|
|
51
|
+
"angular-components"
|
|
52
|
+
]
|
|
53
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"lib": [
|
|
4
|
+
"es2019",
|
|
5
|
+
"DOM",
|
|
6
|
+
"ES6",
|
|
7
|
+
"DOM.Iterable",
|
|
8
|
+
"ScriptHost"
|
|
9
|
+
],
|
|
10
|
+
"target": "es2015",
|
|
11
|
+
"module": "CommonJS",
|
|
12
|
+
"jsx": "react",
|
|
13
|
+
"allowJs": true,
|
|
14
|
+
"composite": true,
|
|
15
|
+
"declaration": true,
|
|
16
|
+
"sourceMap": true,
|
|
17
|
+
"skipLibCheck": true,
|
|
18
|
+
"experimentalDecorators": true,
|
|
19
|
+
"outDir": "dist",
|
|
20
|
+
"moduleResolution": "node",
|
|
21
|
+
"esModuleInterop": true,
|
|
22
|
+
"rootDir": ".",
|
|
23
|
+
"resolveJsonModule": true,
|
|
24
|
+
"emitDeclarationOnly": true,
|
|
25
|
+
"emitDecoratorMetadata": true,
|
|
26
|
+
"allowSyntheticDefaultImports": true,
|
|
27
|
+
"strictPropertyInitialization": false,
|
|
28
|
+
"strict": true,
|
|
29
|
+
"noImplicitAny": false,
|
|
30
|
+
"preserveConstEnums": true
|
|
31
|
+
},
|
|
32
|
+
"exclude": [
|
|
33
|
+
"dist",
|
|
34
|
+
"package.json"
|
|
35
|
+
],
|
|
36
|
+
"include": [
|
|
37
|
+
"**/*",
|
|
38
|
+
"**/*.json"
|
|
39
|
+
]
|
|
40
|
+
}
|
package/types/asset.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
declare module '*.png' {
|
|
2
|
+
const value: any;
|
|
3
|
+
export = value;
|
|
4
|
+
}
|
|
5
|
+
declare module '*.svg' {
|
|
6
|
+
import type { FunctionComponent, SVGProps } from 'react';
|
|
7
|
+
|
|
8
|
+
export const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement> & { title?: string }>;
|
|
9
|
+
const src: string;
|
|
10
|
+
export default src;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// @TODO Gilad
|
|
14
|
+
declare module '*.jpg' {
|
|
15
|
+
const value: any;
|
|
16
|
+
export = value;
|
|
17
|
+
}
|
|
18
|
+
declare module '*.jpeg' {
|
|
19
|
+
const value: any;
|
|
20
|
+
export = value;
|
|
21
|
+
}
|
|
22
|
+
declare module '*.gif' {
|
|
23
|
+
const value: any;
|
|
24
|
+
export = value;
|
|
25
|
+
}
|
|
26
|
+
declare module '*.bmp' {
|
|
27
|
+
const value: any;
|
|
28
|
+
export = value;
|
|
29
|
+
}
|
package/types/style.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare module '*.module.css' {
|
|
2
|
+
const classes: { readonly [key: string]: string };
|
|
3
|
+
export default classes;
|
|
4
|
+
}
|
|
5
|
+
declare module '*.module.scss' {
|
|
6
|
+
const classes: { readonly [key: string]: string };
|
|
7
|
+
export default classes;
|
|
8
|
+
}
|
|
9
|
+
declare module '*.module.sass' {
|
|
10
|
+
const classes: { readonly [key: string]: string };
|
|
11
|
+
export default classes;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare module '*.module.less' {
|
|
15
|
+
const classes: { readonly [key: string]: string };
|
|
16
|
+
export default classes;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare module '*.less' {
|
|
20
|
+
const classes: { readonly [key: string]: string };
|
|
21
|
+
export default classes;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare module '*.css' {
|
|
25
|
+
const classes: { readonly [key: string]: string };
|
|
26
|
+
export default classes;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare module '*.sass' {
|
|
30
|
+
const classes: { readonly [key: string]: string };
|
|
31
|
+
export default classes;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare module '*.scss' {
|
|
35
|
+
const classes: { readonly [key: string]: string };
|
|
36
|
+
export default classes;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare module '*.mdx' {
|
|
40
|
+
const component: any;
|
|
41
|
+
export default component;
|
|
42
|
+
}
|