@teambit/watcher 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.
@@ -0,0 +1 @@
1
+ {"version":3,"names":["WatcherMain","constructor","workspace","pubsub","onPreWatchSlot","watch","opts","watcher","Watcher","watchAll","triggerOnPreWatch","componentIds","watchOpts","components","getMany","preWatchFunctions","values","pMapSeries","func","registerOnPreWatch","onPreWatchFunc","register","provider","cli","loggerMain","_","logger","createLogger","WatcherAspect","id","watcherMain","watchCmd","WatchCommand","Slot","withType","CLIAspect","WorkspaceAspect","PubsubAspect","LoggerAspect","MainRuntime","addRuntime"],"sources":["watcher.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { SlotRegistry, Slot } from '@teambit/harmony';\nimport { Component } from '@teambit/component';\nimport { ComponentID } from '@teambit/component-id';\nimport { LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { PubsubAspect, PubsubMain } from '@teambit/pubsub';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport pMapSeries from 'p-map-series';\nimport { WatchCommand } from './watch.cmd';\nimport { Watcher, WatchOptions } from './watcher';\nimport { WatcherAspect } from './watcher.aspect';\n\nexport type OnPreWatch = (components: Component[], watchOpts: WatchOptions) => Promise<void>;\nexport type OnPreWatchSlot = SlotRegistry<OnPreWatch>;\n\nexport class WatcherMain {\n constructor(private workspace: Workspace, private pubsub: PubsubMain, private onPreWatchSlot: OnPreWatchSlot) {}\n\n async watch(opts: WatchOptions) {\n const watcher = new Watcher(this.workspace, this.pubsub, this);\n await watcher.watchAll(opts);\n }\n\n async triggerOnPreWatch(componentIds: ComponentID[], watchOpts: WatchOptions) {\n const components = await this.workspace.getMany(componentIds);\n const preWatchFunctions = this.onPreWatchSlot.values();\n await pMapSeries(preWatchFunctions, async (func) => {\n await func(components, watchOpts);\n });\n }\n\n registerOnPreWatch(onPreWatchFunc: OnPreWatch) {\n this.onPreWatchSlot.register(onPreWatchFunc);\n return this;\n }\n\n static slots = [Slot.withType<OnPreWatch>()];\n static dependencies = [CLIAspect, WorkspaceAspect, PubsubAspect, LoggerAspect];\n static runtime = MainRuntime;\n\n static async provider(\n [cli, workspace, pubsub, loggerMain]: [CLIMain, Workspace, PubsubMain, LoggerMain],\n _,\n [onPreWatchSlot]: [OnPreWatchSlot]\n ) {\n const logger = loggerMain.createLogger(WatcherAspect.id);\n const watcherMain = new WatcherMain(workspace, pubsub, onPreWatchSlot);\n const watchCmd = new WatchCommand(pubsub, logger, watcherMain);\n cli.register(watchCmd);\n return watcherMain;\n }\n}\n\nWatcherAspect.addRuntime(WatcherMain);\n\nexport default WatcherMain;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;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;AAKO,MAAMA,WAAW,CAAC;EACvBC,WAAW,CAASC,SAAoB,EAAUC,MAAkB,EAAUC,cAA8B,EAAE;IAAA,KAA1FF,SAAoB,GAApBA,SAAoB;IAAA,KAAUC,MAAkB,GAAlBA,MAAkB;IAAA,KAAUC,cAA8B,GAA9BA,cAA8B;EAAG;EAE/G,MAAMC,KAAK,CAACC,IAAkB,EAAE;IAC9B,MAAMC,OAAO,GAAG,KAAIC,kBAAO,EAAC,IAAI,CAACN,SAAS,EAAE,IAAI,CAACC,MAAM,EAAE,IAAI,CAAC;IAC9D,MAAMI,OAAO,CAACE,QAAQ,CAACH,IAAI,CA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 +1,63 @@
1
+ {
2
+ "name": "@teambit/watcher",
3
+ "version": "0.0.1",
4
+ "main": "dist/index.js",
5
+ "componentId": {
6
+ "scope": "teambit.workspace",
7
+ "name": "watcher",
8
+ "version": "0.0.1"
9
+ },
10
+ "dependencies": {
11
+ "chalk": "2.4.2",
12
+ "p-queue": "6.6.2",
13
+ "moment": "2.29.4",
14
+ "p-map-series": "2.1.0",
15
+ "chokidar": "3.5.1",
16
+ "lodash": "4.17.21",
17
+ "core-js": "^3.0.0",
18
+ "@babel/runtime": "7.20.0",
19
+ "@teambit/harmony": "0.4.6",
20
+ "@teambit/workspace": "0.0.989",
21
+ "@teambit/cli": "0.0.664",
22
+ "@teambit/compiler": "0.0.989",
23
+ "@teambit/logger": "0.0.757",
24
+ "@teambit/pubsub": "0.0.989",
25
+ "@teambit/component-id": "0.0.427",
26
+ "@teambit/component": "0.0.989",
27
+ "@teambit/legacy-bit-id": "0.0.423"
28
+ },
29
+ "devDependencies": {
30
+ "@types/lodash": "4.14.165",
31
+ "@types/mocha": "9.1.0",
32
+ "@types/node": "12.20.4",
33
+ "@types/react": "^17.0.8",
34
+ "@types/react-dom": "^17.0.5",
35
+ "@types/jest": "^26.0.0",
36
+ "@types/testing-library__jest-dom": "5.9.5"
37
+ },
38
+ "peerDependencies": {
39
+ "@teambit/legacy": "1.0.445",
40
+ "react": "^16.8.0 || ^17.0.0",
41
+ "react-dom": "^16.8.0 || ^17.0.0"
42
+ },
43
+ "license": "Apache-2.0",
44
+ "private": false,
45
+ "engines": {
46
+ "node": ">=12.22.0"
47
+ },
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "https://github.com/teambit/bit"
51
+ },
52
+ "keywords": [
53
+ "bit",
54
+ "bit-aspect",
55
+ "components",
56
+ "collaboration",
57
+ "web",
58
+ "react",
59
+ "react-components",
60
+ "angular",
61
+ "angular-components"
62
+ ]
63
+ }
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
+ }
@@ -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
+ }
@@ -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
+ }