@teambit/preview.cli.webpack-events-listener 0.0.178 → 0.0.180

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 CHANGED
@@ -1,6 +1,20 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SubscribeToWebpackEvents = void 0;
4
- var webpack_events_listener_1 = require("./webpack-events-listener");
5
- Object.defineProperty(exports, "SubscribeToWebpackEvents", { enumerable: true, get: function () { return webpack_events_listener_1.SubscribeToWebpackEvents; } });
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,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,qEAAqE;AAA5D,mIAAA,wBAAwB,OAAA"}
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
- Object.defineProperty(exports, "__esModule", { value: true });
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
3
6
  exports.SubscribeToWebpackEvents = SubscribeToWebpackEvents;
4
- const webpack_1 = require("@teambit/webpack");
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
- pubsub.sub(webpack_1.WebpackAspect.id, (event) => {
10
- var _a, _b;
11
- if (event.type === webpack_1.WebpackCompilationDoneEvent.TYPE) {
12
- const { stats, devServerID } = event.data;
13
- const results = {
14
- errors: stats.compilation.errors,
15
- warnings: stats.compilation.warnings,
16
- compiling: false,
17
- };
18
- (_a = handlers.onDone) === null || _a === void 0 ? void 0 : _a.call(handlers, devServerID, results);
19
- }
20
- if (event.type === webpack_1.WebpackCompilationStartedEvent.TYPE) {
21
- const { devServerID } = event.data;
22
- (_b = handlers.onStart) === null || _b === void 0 ? void 0 : _b.call(handlers, devServerID);
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,"file":"webpack-events-listener.js","sourceRoot":"","sources":["../webpack-events-listener.ts"],"names":[],"mappings":";;AAuBA,4DAmBC;AA1CD,8CAA8G;AAoB9G;;GAEG;AACH,SAAgB,wBAAwB,CAAC,MAAkB,EAAE,WAAqB,EAAE;IAClF,MAAM,CAAC,GAAG,CAAC,uBAAa,CAAC,EAAE,EAAE,CAAC,KAAwB,EAAE,EAAE;;QACxD,IAAI,KAAK,CAAC,IAAI,KAAK,qCAA2B,CAAC,IAAI,EAAE,CAAC;YACpD,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;YAE1C,MAAM,OAAO,GAAG;gBACd,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC,MAAM;gBAChC,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,QAAQ;gBACpC,SAAS,EAAE,KAAK;aACjB,CAAC;YAEF,MAAA,QAAQ,CAAC,MAAM,yDAAG,WAAW,EAAE,OAAO,CAAC,CAAC;QAC1C,CAAC;QAED,IAAI,KAAK,CAAC,IAAI,KAAK,wCAA8B,CAAC,IAAI,EAAE,CAAC;YACvD,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;YACnC,MAAA,QAAQ,CAAC,OAAO,yDAAG,WAAW,CAAC,CAAC;QAClC,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
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,31 @@
1
1
  {
2
2
  "name": "@teambit/preview.cli.webpack-events-listener",
3
- "version": "0.0.178",
3
+ "version": "0.0.180",
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.178"
9
+ "version": "0.0.180"
10
10
  },
11
11
  "dependencies": {},
12
12
  "devDependencies": {
13
13
  "@types/mocha": "9.1.0",
14
- "@types/jest": "26.0.20",
15
- "@types/node": "22.10.5"
14
+ "chai": "5.2.1",
15
+ "@teambit/node.envs.node-babel-mocha": "1.0.0"
16
16
  },
17
17
  "peerDependencies": {},
18
18
  "license": "Apache-2.0",
19
19
  "optionalDependencies": {},
20
20
  "peerDependenciesMeta": {},
21
+ "exports": {
22
+ ".": {
23
+ "types": "./dist/index.d.ts",
24
+ "require": "./dist/index.js",
25
+ "import": "./dist/esm.mjs"
26
+ },
27
+ "./dist/*": "./dist/*"
28
+ },
21
29
  "private": false,
22
30
  "engines": {
23
31
  "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<SVGProps<SVGSVGElement> & { title?: string }>;
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
+ }
package/types/style.d.ts CHANGED
@@ -40,3 +40,7 @@ declare module '*.mdx' {
40
40
  const component: any;
41
41
  export default component;
42
42
  }
43
+
44
+ // `reset-css` ships only `reset.css` (no `.d.ts`). TS6 refuses bare
45
+ // side-effect imports without declarations, so we declare the module here.
46
+ declare module 'reset-css';
@@ -1,7 +0,0 @@
1
- ;
2
- ;
3
-
4
- export const compositions = [];
5
- export const overview = [];
6
-
7
- export const compositions_metadata = {"compositions":[]};