@teambit/tracker 1.0.225 → 1.0.227

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.
@@ -1,4 +1,4 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <testsuites tests="0" failures="0" errors="0" skipped="0">
3
- <testsuite name="teambit.component/tracker@1.0.225" tests="0" failures="0" errors="0" skipped="0"/>
3
+ <testsuite name="teambit.component/tracker@1.0.227" tests="0" failures="0" errors="0" skipped="0"/>
4
4
  </testsuites>
@@ -48,11 +48,7 @@
48
48
  "line": 23,
49
49
  "character": 34
50
50
  },
51
- "name": "Workspace",
52
- "componentId": {
53
- "scope": "teambit.workspace",
54
- "name": "workspace"
55
- }
51
+ "name": "Workspace"
56
52
  },
57
53
  "isOptional": false,
58
54
  "isSpread": false
@@ -72,11 +68,7 @@
72
68
  "line": 23,
73
69
  "character": 61
74
70
  },
75
- "name": "Logger",
76
- "componentId": {
77
- "scope": "teambit.harmony",
78
- "name": "logger"
79
- }
71
+ "name": "Logger"
80
72
  },
81
73
  "isOptional": false,
82
74
  "isSpread": false
@@ -128,8 +120,7 @@
128
120
  "line": 30,
129
121
  "character": 26
130
122
  },
131
- "name": "TrackData",
132
- "internalFilePath": "tracker.main.runtime.ts"
123
+ "name": "TrackData"
133
124
  },
134
125
  "isOptional": false,
135
126
  "isSpread": false
@@ -151,8 +142,7 @@
151
142
  "line": 30,
152
143
  "character": 46
153
144
  },
154
- "name": "TrackResult",
155
- "internalFilePath": "tracker.main.runtime.ts"
145
+ "name": "TrackResult"
156
146
  }
157
147
  ]
158
148
  },
@@ -185,8 +175,7 @@
185
175
  "line": 52,
186
176
  "character": 29
187
177
  },
188
- "name": "AddProps",
189
- "internalFilePath": "add-components.ts"
178
+ "name": "AddProps"
190
179
  },
191
180
  "isOptional": false,
192
181
  "isSpread": false
@@ -208,8 +197,7 @@
208
197
  "line": 52,
209
198
  "character": 48
210
199
  },
211
- "name": "AddActionResults",
212
- "internalFilePath": "add-components.ts"
200
+ "name": "AddActionResults"
213
201
  }
214
202
  ]
215
203
  },
@@ -415,11 +403,7 @@
415
403
  "line": 117,
416
404
  "character": 56
417
405
  },
418
- "name": "CLIMain",
419
- "componentId": {
420
- "scope": "teambit.harmony",
421
- "name": "cli"
422
- }
406
+ "name": "CLIMain"
423
407
  },
424
408
  {
425
409
  "__schema": "TypeRefSchema",
@@ -428,11 +412,7 @@
428
412
  "line": 117,
429
413
  "character": 65
430
414
  },
431
- "name": "Workspace",
432
- "componentId": {
433
- "scope": "teambit.workspace",
434
- "name": "workspace"
435
- }
415
+ "name": "Workspace"
436
416
  },
437
417
  {
438
418
  "__schema": "TypeRefSchema",
@@ -441,11 +421,7 @@
441
421
  "line": 117,
442
422
  "character": 76
443
423
  },
444
- "name": "LoggerMain",
445
- "componentId": {
446
- "scope": "teambit.harmony",
447
- "name": "logger"
448
- }
424
+ "name": "LoggerMain"
449
425
  }
450
426
  ]
451
427
  },
@@ -654,8 +630,7 @@
654
630
  "line": 15,
655
631
  "character": 12
656
632
  },
657
- "name": "PathOsBasedRelative",
658
- "packageName": "@teambit/legacy/dist/utils/path"
633
+ "name": "PathOsBasedRelative"
659
634
  },
660
635
  {
661
636
  "__schema": "TypeRefSchema",
@@ -664,8 +639,7 @@
664
639
  "line": 15,
665
640
  "character": 34
666
641
  },
667
- "name": "PathOsBasedAbsolute",
668
- "packageName": "@teambit/legacy/dist/utils/path"
642
+ "name": "PathOsBasedAbsolute"
669
643
  }
670
644
  ]
671
645
  },
@@ -827,11 +801,7 @@
827
801
  "line": 23,
828
802
  "character": 34
829
803
  },
830
- "name": "Workspace",
831
- "componentId": {
832
- "scope": "teambit.workspace",
833
- "name": "workspace"
834
- }
804
+ "name": "Workspace"
835
805
  },
836
806
  "isOptional": false,
837
807
  "isSpread": false
@@ -851,11 +821,7 @@
851
821
  "line": 23,
852
822
  "character": 61
853
823
  },
854
- "name": "Logger",
855
- "componentId": {
856
- "scope": "teambit.harmony",
857
- "name": "logger"
858
- }
824
+ "name": "Logger"
859
825
  },
860
826
  "isOptional": false,
861
827
  "isSpread": false
@@ -907,8 +873,7 @@
907
873
  "line": 30,
908
874
  "character": 26
909
875
  },
910
- "name": "TrackData",
911
- "internalFilePath": "tracker.main.runtime.ts"
876
+ "name": "TrackData"
912
877
  },
913
878
  "isOptional": false,
914
879
  "isSpread": false
@@ -930,8 +895,7 @@
930
895
  "line": 30,
931
896
  "character": 46
932
897
  },
933
- "name": "TrackResult",
934
- "internalFilePath": "tracker.main.runtime.ts"
898
+ "name": "TrackResult"
935
899
  }
936
900
  ]
937
901
  },
@@ -964,8 +928,7 @@
964
928
  "line": 52,
965
929
  "character": 29
966
930
  },
967
- "name": "AddProps",
968
- "internalFilePath": "add-components.ts"
931
+ "name": "AddProps"
969
932
  },
970
933
  "isOptional": false,
971
934
  "isSpread": false
@@ -987,8 +950,7 @@
987
950
  "line": 52,
988
951
  "character": 48
989
952
  },
990
- "name": "AddActionResults",
991
- "internalFilePath": "add-components.ts"
953
+ "name": "AddActionResults"
992
954
  }
993
955
  ]
994
956
  },
@@ -1194,11 +1156,7 @@
1194
1156
  "line": 117,
1195
1157
  "character": 56
1196
1158
  },
1197
- "name": "CLIMain",
1198
- "componentId": {
1199
- "scope": "teambit.harmony",
1200
- "name": "cli"
1201
- }
1159
+ "name": "CLIMain"
1202
1160
  },
1203
1161
  {
1204
1162
  "__schema": "TypeRefSchema",
@@ -1207,11 +1165,7 @@
1207
1165
  "line": 117,
1208
1166
  "character": 65
1209
1167
  },
1210
- "name": "Workspace",
1211
- "componentId": {
1212
- "scope": "teambit.workspace",
1213
- "name": "workspace"
1214
- }
1168
+ "name": "Workspace"
1215
1169
  },
1216
1170
  {
1217
1171
  "__schema": "TypeRefSchema",
@@ -1220,11 +1174,7 @@
1220
1174
  "line": 117,
1221
1175
  "character": 76
1222
1176
  },
1223
- "name": "LoggerMain",
1224
- "componentId": {
1225
- "scope": "teambit.harmony",
1226
- "name": "logger"
1227
- }
1177
+ "name": "LoggerMain"
1228
1178
  }
1229
1179
  ]
1230
1180
  },
@@ -1315,7 +1265,7 @@
1315
1265
  "componentId": {
1316
1266
  "scope": "teambit.component",
1317
1267
  "name": "tracker",
1318
- "version": "1.0.225"
1268
+ "version": "1.0.227"
1319
1269
  },
1320
1270
  "taggedModuleExports": []
1321
1271
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/tracker",
3
- "version": "1.0.225",
3
+ "version": "1.0.227",
4
4
  "homepage": "https://bit.cloud/teambit/component/tracker",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.component",
8
8
  "name": "tracker",
9
- "version": "1.0.225"
9
+ "version": "1.0.227"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -19,18 +19,18 @@
19
19
  "@teambit/component-id": "1.2.0",
20
20
  "@teambit/legacy-bit-id": "1.1.1",
21
21
  "@teambit/harmony": "0.4.6",
22
- "@teambit/cli": "0.0.859",
23
- "@teambit/workspace.modules.node-modules-linker": "0.0.166",
24
- "@teambit/workspace": "1.0.225",
25
- "@teambit/envs": "1.0.225",
26
- "@teambit/logger": "0.0.952"
22
+ "@teambit/cli": "0.0.860",
23
+ "@teambit/workspace.modules.node-modules-linker": "0.0.167",
24
+ "@teambit/workspace": "1.0.227",
25
+ "@teambit/envs": "1.0.227",
26
+ "@teambit/logger": "0.0.953"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/fs-extra": "9.0.7",
30
30
  "@types/lodash": "4.14.165",
31
31
  "@types/mocha": "9.1.0",
32
32
  "chai": "4.3.0",
33
- "@teambit/harmony.envs.core-aspect-env": "0.0.27"
33
+ "@teambit/harmony.envs.core-aspect-env": "0.0.30"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "@teambit/legacy": "1.0.624"
package/tsconfig.json CHANGED
@@ -20,7 +20,8 @@
20
20
  "emitDeclarationOnly": true,
21
21
  "strict": true,
22
22
  "strictPropertyInitialization": false,
23
- "noImplicitAny": false
23
+ "noImplicitAny": false,
24
+ "composite": true
24
25
  },
25
26
  "exclude": [
26
27
  "artifacts",
@@ -35,5 +36,19 @@
35
36
  "include": [
36
37
  "**/*",
37
38
  "**/*.json"
39
+ ],
40
+ "references": [
41
+ {
42
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_cli@0.0.860"
43
+ },
44
+ {
45
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@1.0.227"
46
+ },
47
+ {
48
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.envs_envs@1.0.227"
49
+ },
50
+ {
51
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_logger@0.0.953"
52
+ }
38
53
  ]
39
54
  }
package/dist/add-cmd.d.ts DELETED
@@ -1,34 +0,0 @@
1
- import { Command, CommandOptions } from '@teambit/cli';
2
- import { PathLinux } from '@teambit/legacy/dist/utils/path';
3
- import { Warnings } from './add-components';
4
- import { TrackerMain } from './tracker.main.runtime';
5
- type AddFlags = {
6
- id: string | null | undefined;
7
- main: string | null | undefined;
8
- namespace: string | null | undefined;
9
- scope?: string;
10
- env?: string;
11
- override: boolean;
12
- };
13
- type AddResults = {
14
- addedComponents: Array<{
15
- id: string;
16
- files: PathLinux[];
17
- }>;
18
- warnings: Warnings;
19
- };
20
- export declare class AddCmd implements Command {
21
- private tracker;
22
- name: string;
23
- description: string;
24
- group: string;
25
- extendedDescription: string;
26
- helpUrl: string;
27
- alias: string;
28
- options: CommandOptions;
29
- loader: boolean;
30
- constructor(tracker: TrackerMain);
31
- report([paths]: [string[]], addFlags: AddFlags): Promise<string>;
32
- json([paths]: [string[]], { id, main, namespace, scope, env, override }: AddFlags): Promise<AddResults>;
33
- }
34
- export {};
@@ -1,143 +0,0 @@
1
- import { ComponentID } from '@teambit/component-id';
2
- import BitMap from '@teambit/legacy/dist/consumer/bit-map';
3
- import Consumer from '@teambit/legacy/dist/consumer/consumer';
4
- import { PathLinux, PathOsBased } from '@teambit/legacy/dist/utils/path';
5
- import ComponentMap, { ComponentMapFile, Config } from '@teambit/legacy/dist/consumer/bit-map/component-map';
6
- import { Workspace } from '@teambit/workspace';
7
- export type AddResult = {
8
- id: ComponentID;
9
- files: ComponentMapFile[];
10
- };
11
- export type Warnings = {
12
- alreadyUsed: Record<string, any>;
13
- emptyDirectory: string[];
14
- existInScope: ComponentID[];
15
- };
16
- export type AddActionResults = {
17
- addedComponents: AddResult[];
18
- warnings: Warnings;
19
- };
20
- export type PathOrDSL = PathOsBased | string;
21
- type PathsStats = {};
22
- export type AddedComponent = {
23
- componentId: ComponentID;
24
- files: ComponentMapFile[];
25
- mainFile?: PathOsBased | null | undefined;
26
- trackDir: PathOsBased;
27
- idFromPath: {
28
- name: string;
29
- namespace: string;
30
- } | null | undefined;
31
- immediateDir?: string;
32
- };
33
- export type AddProps = {
34
- componentPaths: PathOsBased[];
35
- id?: string;
36
- main?: PathOsBased;
37
- namespace?: string;
38
- override: boolean;
39
- trackDirFeature?: boolean;
40
- defaultScope?: string;
41
- config?: Config;
42
- shouldHandleOutOfSync?: boolean;
43
- env?: string;
44
- };
45
- export type AddContext = {
46
- workspace: Workspace;
47
- };
48
- export default class AddComponents {
49
- workspace: Workspace;
50
- consumer: Consumer;
51
- bitMap: BitMap;
52
- componentPaths: PathOsBased[];
53
- id: string | null | undefined;
54
- main: PathOsBased | null | undefined;
55
- namespace: string | null | undefined;
56
- override: boolean;
57
- trackDirFeature: boolean | null | undefined;
58
- warnings: Warnings;
59
- ignoreList: string[];
60
- gitIgnore: any;
61
- addedComponents: AddResult[];
62
- defaultScope?: string;
63
- config?: Config;
64
- shouldHandleOutOfSync?: boolean;
65
- constructor(context: AddContext, addProps: AddProps);
66
- /**
67
- * @param {string[]} files - array of file-paths from which it should search for the dsl patterns.
68
- * @param {*} filesWithPotentialDsl - array of file-path which may have DSL patterns
69
- *
70
- * @returns array of file-paths from 'files' parameter that match the patterns from 'filesWithPotentialDsl' parameter
71
- */
72
- getFilesAccordingToDsl(files: PathLinux[], filesWithPotentialDsl: PathOrDSL[]): Promise<PathLinux[]>;
73
- /**
74
- * for imported component, the package.json in the root directory is a bit-generated file and as
75
- * such, it should be ignored
76
- */
77
- _isPackageJsonOnRootDir(pathRelativeToConsumerRoot: PathLinux, componentMap: ComponentMap): boolean;
78
- /**
79
- * imported components might have wrapDir, when they do, files should not be added outside of
80
- * that wrapDir
81
- */
82
- _isOutsideOfWrapDir(pathRelativeToConsumerRoot: PathLinux, componentMap: ComponentMap): boolean;
83
- /**
84
- * Add or update existing (imported and new) component according to bitmap
85
- * there are 3 options:
86
- * 1. a user is adding a new component. there is no record for this component in bit.map
87
- * 2. a user is updating an existing component. there is a record for this component in bit.map
88
- * 3. some or all the files of this component were previously added as another component-id.
89
- */
90
- addOrUpdateComponentInBitMap(component: AddedComponent): Promise<AddResult | null | undefined>;
91
- /**
92
- * current componentFiles are relative to the workspace. we want them relative to the rootDir.
93
- */
94
- _updateFilesAccordingToExistingRootDir(foundComponentFromBitMap: ComponentMap, componentFiles: ComponentMapFile[], component: AddedComponent): void;
95
- /**
96
- * the risk with merging the currently added files with the existing bitMap files is overriding
97
- * the `test` property. e.g. the component directory is re-added without adding the tests flag to
98
- * track new files in that directory. in this case, we want to preserve the `test` property.
99
- */
100
- _mergeFilesWithExistingComponentMapFiles(componentFiles: ComponentMapFile[], existingComponentMapFile: ComponentMapFile[]): ComponentMapFile[];
101
- /**
102
- * if an existing file is for example uppercase and the new file is lowercase it has different
103
- * behavior according to the OS. some OS are case sensitive, some are not.
104
- * it's safer to avoid saving both files and instead, replacing the old file with the new one.
105
- * in case a file has replaced and it is also a mainFile, replace the mainFile as well
106
- */
107
- _updateFilesWithCurrentLetterCases(currentComponentMap: ComponentMap, newFiles: ComponentMapFile[]): void;
108
- /**
109
- * if the id is already saved in bitmap file, it might have more data (such as scope, version)
110
- * use that id instead.
111
- */
112
- private _getIdAccordingToExistingComponent;
113
- _getIdAccordingToTrackDir(dir: PathOsBased): ComponentID | null | undefined;
114
- /**
115
- * used for updating main file if exists or doesn't exists
116
- */
117
- _addMainFileToFiles(files: ComponentMapFile[]): PathOsBased | null | undefined;
118
- _findMainFileInFiles(mainFile: string, files: ComponentMapFile[]): ComponentMapFile | undefined;
119
- private getDefaultScope;
120
- /**
121
- * given the component paths, prepare the id, mainFile and files to be added later on to bitmap
122
- * the id of the component is either entered by the user or, if not entered, concluded by the path.
123
- * e.g. bar/foo.js, the id would be bar/foo.
124
- * in case bitmap has already the same id, the complete id is taken from bitmap (see _getIdAccordingToExistingComponent)
125
- */
126
- addOneComponent(componentPath: PathOsBased): Promise<AddedComponent>;
127
- getIgnoreList(): string[];
128
- add(): Promise<AddActionResults>;
129
- linkComponents(ids: ComponentID[]): Promise<void>;
130
- addMultipleComponents(componentPathsStats: PathsStats): Promise<void>;
131
- /**
132
- * some uses of wildcards might add directories and their files at the same time, in such cases
133
- * only the files are needed and the directories can be ignored.
134
- * @see https://github.com/teambit/bit/issues/1406 for more details
135
- */
136
- _removeDirectoriesWhenTheirFilesAreAdded(componentPathsStats: PathsStats): void;
137
- _addMultipleToBitMap(added: AddedComponent[]): Promise<void>;
138
- _removeNamespaceIfNotNeeded(addedComponents: AddedComponent[]): Promise<void>;
139
- _tryAddingMultiple(componentPathsStats: PathsStats): Promise<AddedComponent[]>;
140
- _throwForOutsideConsumer(relativeToConsumerPath: PathOsBased): void;
141
- private throwForExistingParentDir;
142
- }
143
- export {};
@@ -1,4 +0,0 @@
1
- import { PathLinux } from '@teambit/legacy/dist/utils/path';
2
- import ComponentMap from '@teambit/legacy/dist/consumer/bit-map/component-map';
3
- import { AddedComponent } from './add-components';
4
- export default function determineMainFile(addedComponent: AddedComponent, existingComponentMap: ComponentMap | null | undefined): PathLinux;
package/dist/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import { TrackerAspect } from './tracker.aspect';
2
- export type { TrackerMain } from './tracker.main.runtime';
3
- export default TrackerAspect;
4
- export { TrackerAspect };
@@ -1,2 +0,0 @@
1
- import { Aspect } from '@teambit/harmony';
2
- export declare const TrackerAspect: Aspect;
@@ -1,54 +0,0 @@
1
- import { CLIMain } from '@teambit/cli';
2
- import { ComponentID } from '@teambit/component-id';
3
- import { Workspace } from '@teambit/workspace';
4
- import { Logger, LoggerMain } from '@teambit/logger';
5
- import { PathOsBasedRelative, PathOsBasedAbsolute } from '@teambit/legacy/dist/utils/path';
6
- import { AddActionResults, AddProps, Warnings } from './add-components';
7
- export type TrackResult = {
8
- files: string[];
9
- warnings: Warnings;
10
- componentId: ComponentID;
11
- };
12
- export type TrackData = {
13
- rootDir: PathOsBasedRelative | PathOsBasedAbsolute;
14
- componentName?: string;
15
- mainFile?: string;
16
- defaultScope?: string;
17
- config?: {
18
- [aspectName: string]: any;
19
- };
20
- };
21
- export declare class TrackerMain {
22
- private workspace;
23
- private logger;
24
- constructor(workspace: Workspace, logger: Logger);
25
- /**
26
- * add a new component to the .bitmap file.
27
- * this method only adds the records in memory but doesn't persist to the filesystem.
28
- * to write the .bitmap file once completed, run "await this.bitMap.write();"
29
- */
30
- track(trackData: TrackData): Promise<TrackResult>;
31
- addForCLI(addProps: AddProps): Promise<AddActionResults>;
32
- addEnvToConfig(env: string, config: {
33
- [aspectName: string]: any;
34
- }): Promise<void>;
35
- /**
36
- * scopes in bit.dev are "owner.collection".
37
- * we might have the scope-name only without the owner and we need to retrieve it from the defaultScope in the
38
- * workspace.jsonc file.
39
- *
40
- * @param scopeName scopeName that might not have the owner part.
41
- * @returns full scope name
42
- */
43
- private addOwnerToScopeName;
44
- /**
45
- * whether a scope is hosted by Bit cloud.
46
- * otherwise, it is self-hosted
47
- */
48
- private isHostedByBit;
49
- static slots: never[];
50
- static dependencies: import("@teambit/harmony").Aspect[];
51
- static runtime: import("@teambit/harmony").RuntimeDefinition;
52
- static provider([cli, workspace, loggerMain]: [CLIMain, Workspace, LoggerMain]): Promise<TrackerMain>;
53
- }
54
- export default TrackerMain;