@teambit/preview.cli.webpack-events-listener 0.0.178 → 0.0.179
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.js +18 -4
- package/dist/index.js.map +1 -1
- package/dist/webpack-events-listener.js +32 -18
- package/dist/webpack-events-listener.js.map +1 -1
- package/package.json +11 -4
- package/types/asset.d.ts +15 -3
- package/dist/preview-1753833698619.js +0 -7
package/dist/index.js
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
exports
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "SubscribeToWebpackEvents", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _webpackEventsListener().SubscribeToWebpackEvents;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
function _webpackEventsListener() {
|
|
13
|
+
const data = require("./webpack-events-listener");
|
|
14
|
+
_webpackEventsListener = function () {
|
|
15
|
+
return data;
|
|
16
|
+
};
|
|
17
|
+
return data;
|
|
18
|
+
}
|
|
19
|
+
|
|
6
20
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_webpackEventsListener","data","require"],"sources":["index.ts"],"sourcesContent":["export { SubscribeToWebpackEvents } from './webpack-events-listener';\nexport type { CompilationResult, Handlers } from './webpack-events-listener';\n"],"mappings":";;;;;;;;;;;AAAA,SAAAA,uBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,sBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA","ignoreList":[]}
|
|
@@ -1,26 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
3
6
|
exports.SubscribeToWebpackEvents = SubscribeToWebpackEvents;
|
|
4
|
-
|
|
7
|
+
function _webpack() {
|
|
8
|
+
const data = require("@teambit/webpack");
|
|
9
|
+
_webpack = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
5
14
|
/**
|
|
6
15
|
* Listen for Webpack compilation pub sub events.
|
|
7
16
|
*/
|
|
8
17
|
function SubscribeToWebpackEvents(pubsub, handlers = {}) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
pubsub.sub(_webpack().WebpackAspect.id, event => {
|
|
19
|
+
if (event.type === _webpack().WebpackCompilationDoneEvent.TYPE) {
|
|
20
|
+
const {
|
|
21
|
+
stats,
|
|
22
|
+
devServerID
|
|
23
|
+
} = event.data;
|
|
24
|
+
const results = {
|
|
25
|
+
errors: stats.compilation.errors,
|
|
26
|
+
warnings: stats.compilation.warnings,
|
|
27
|
+
compiling: false
|
|
28
|
+
};
|
|
29
|
+
handlers.onDone?.(devServerID, results);
|
|
30
|
+
}
|
|
31
|
+
if (event.type === _webpack().WebpackCompilationStartedEvent.TYPE) {
|
|
32
|
+
const {
|
|
33
|
+
devServerID
|
|
34
|
+
} = event.data;
|
|
35
|
+
handlers.onStart?.(devServerID);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
25
38
|
}
|
|
39
|
+
|
|
26
40
|
//# sourceMappingURL=webpack-events-listener.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_webpack","data","require","SubscribeToWebpackEvents","pubsub","handlers","sub","WebpackAspect","id","event","type","WebpackCompilationDoneEvent","TYPE","stats","devServerID","results","errors","compilation","warnings","compiling","onDone","WebpackCompilationStartedEvent","onStart"],"sources":["webpack-events-listener.ts"],"sourcesContent":["import { WebpackAspect, WebpackCompilationDoneEvent, WebpackCompilationStartedEvent } from '@teambit/webpack';\nimport type { PubsubMain, BitBaseEvent } from '@teambit/pubsub';\n\nexport type CompilationResult = {\n errors?: Error[];\n warnings?: Error[];\n compiling: boolean;\n};\n\nexport type Handlers = {\n /**\n * emitted when compilation completes. Might happen after server is already up and running.\n */\n onDone?: (serverId: string, stats: CompilationResult) => void;\n /**\n * happens whenever compilation starts, e.g. when a file changes, or on initial compilation\n */\n onStart?: (serverId: string) => void;\n};\n\n/**\n * Listen for Webpack compilation pub sub events.\n */\nexport function SubscribeToWebpackEvents(pubsub: PubsubMain, handlers: Handlers = {}) {\n pubsub.sub(WebpackAspect.id, (event: BitBaseEvent<any>) => {\n if (event.type === WebpackCompilationDoneEvent.TYPE) {\n const { stats, devServerID } = event.data;\n\n const results = {\n errors: stats.compilation.errors,\n warnings: stats.compilation.warnings,\n compiling: false,\n };\n\n handlers.onDone?.(devServerID, results);\n }\n\n if (event.type === WebpackCompilationStartedEvent.TYPE) {\n const { devServerID } = event.data;\n handlers.onStart?.(devServerID);\n }\n });\n}\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAoBA;AACA;AACA;AACO,SAASE,wBAAwBA,CAACC,MAAkB,EAAEC,QAAkB,GAAG,CAAC,CAAC,EAAE;EACpFD,MAAM,CAACE,GAAG,CAACC,wBAAa,CAACC,EAAE,EAAGC,KAAwB,IAAK;IACzD,IAAIA,KAAK,CAACC,IAAI,KAAKC,sCAA2B,CAACC,IAAI,EAAE;MACnD,MAAM;QAAEC,KAAK;QAAEC;MAAY,CAAC,GAAGL,KAAK,CAACR,IAAI;MAEzC,MAAMc,OAAO,GAAG;QACdC,MAAM,EAAEH,KAAK,CAACI,WAAW,CAACD,MAAM;QAChCE,QAAQ,EAAEL,KAAK,CAACI,WAAW,CAACC,QAAQ;QACpCC,SAAS,EAAE;MACb,CAAC;MAEDd,QAAQ,CAACe,MAAM,GAAGN,WAAW,EAAEC,OAAO,CAAC;IACzC;IAEA,IAAIN,KAAK,CAACC,IAAI,KAAKW,yCAA8B,CAACT,IAAI,EAAE;MACtD,MAAM;QAAEE;MAAY,CAAC,GAAGL,KAAK,CAACR,IAAI;MAClCI,QAAQ,CAACiB,OAAO,GAAGR,WAAW,CAAC;IACjC;EACF,CAAC,CAAC;AACJ","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,23 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/preview.cli.webpack-events-listener",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.179",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/preview/cli/webpack-events-listener",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.preview",
|
|
8
8
|
"name": "cli/webpack-events-listener",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.179"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@types/mocha": "9.1.0",
|
|
14
|
-
"
|
|
15
|
-
"@
|
|
14
|
+
"chai": "5.2.1",
|
|
15
|
+
"@teambit/node.envs.node-babel-mocha": "0.2.10"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {},
|
|
18
18
|
"license": "Apache-2.0",
|
|
19
19
|
"optionalDependencies": {},
|
|
20
20
|
"peerDependenciesMeta": {},
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./index.ts",
|
|
24
|
+
"require": "./dist/index.js",
|
|
25
|
+
"import": "./dist/esm.mjs"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
21
28
|
"private": false,
|
|
22
29
|
"engines": {
|
|
23
30
|
"node": ">=12.22.0"
|
package/types/asset.d.ts
CHANGED
|
@@ -5,12 +5,12 @@ declare module '*.png' {
|
|
|
5
5
|
declare module '*.svg' {
|
|
6
6
|
import type { FunctionComponent, SVGProps } from 'react';
|
|
7
7
|
|
|
8
|
-
export const ReactComponent: FunctionComponent<
|
|
8
|
+
export const ReactComponent: FunctionComponent<
|
|
9
|
+
SVGProps<SVGSVGElement> & { title?: string }
|
|
10
|
+
>;
|
|
9
11
|
const src: string;
|
|
10
12
|
export default src;
|
|
11
13
|
}
|
|
12
|
-
|
|
13
|
-
// @TODO Gilad
|
|
14
14
|
declare module '*.jpg' {
|
|
15
15
|
const value: any;
|
|
16
16
|
export = value;
|
|
@@ -27,3 +27,15 @@ declare module '*.bmp' {
|
|
|
27
27
|
const value: any;
|
|
28
28
|
export = value;
|
|
29
29
|
}
|
|
30
|
+
declare module '*.otf' {
|
|
31
|
+
const value: any;
|
|
32
|
+
export = value;
|
|
33
|
+
}
|
|
34
|
+
declare module '*.woff' {
|
|
35
|
+
const value: any;
|
|
36
|
+
export = value;
|
|
37
|
+
}
|
|
38
|
+
declare module '*.woff2' {
|
|
39
|
+
const value: any;
|
|
40
|
+
export = value;
|
|
41
|
+
}
|