@teambit/objects 0.0.19

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.
Files changed (123) hide show
  1. package/artifacts/__bit_junit.xml +68 -0
  2. package/artifacts/preview/teambit_scope_objects-preview.js +1 -0
  3. package/dist/fixtures/version-model-extended.json +48 -0
  4. package/dist/fixtures/version-model-object.json +87 -0
  5. package/dist/index.d.ts +19 -0
  6. package/dist/index.js +371 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/models/dependencies-graph.d.ts +45 -0
  9. package/dist/models/dependencies-graph.js +106 -0
  10. package/dist/models/dependencies-graph.js.map +1 -0
  11. package/dist/models/detach-heads.d.ts +25 -0
  12. package/dist/models/detach-heads.js +84 -0
  13. package/dist/models/detach-heads.js.map +1 -0
  14. package/dist/models/export-metadata.d.ts +24 -0
  15. package/dist/models/export-metadata.js +76 -0
  16. package/dist/models/export-metadata.js.map +1 -0
  17. package/dist/models/index.d.ts +10 -0
  18. package/dist/models/index.js +125 -0
  19. package/dist/models/index.js.map +1 -0
  20. package/dist/models/lane-history.d.ts +40 -0
  21. package/dist/models/lane-history.js +117 -0
  22. package/dist/models/lane-history.js.map +1 -0
  23. package/dist/models/lane.d.ts +124 -0
  24. package/dist/models/lane.js +463 -0
  25. package/dist/models/lane.js.map +1 -0
  26. package/dist/models/model-component.d.ts +317 -0
  27. package/dist/models/model-component.js +1365 -0
  28. package/dist/models/model-component.js.map +1 -0
  29. package/dist/models/model-component.spec.d.ts +1 -0
  30. package/dist/models/model-component.spec.js +71 -0
  31. package/dist/models/model-component.spec.js.map +1 -0
  32. package/dist/models/scopeMeta.d.ts +20 -0
  33. package/dist/models/scopeMeta.js +71 -0
  34. package/dist/models/scopeMeta.js.map +1 -0
  35. package/dist/models/source.d.ts +10 -0
  36. package/dist/models/source.js +43 -0
  37. package/dist/models/source.js.map +1 -0
  38. package/dist/models/symlink.d.ts +30 -0
  39. package/dist/models/symlink.js +91 -0
  40. package/dist/models/symlink.js.map +1 -0
  41. package/dist/models/version-history.d.ts +59 -0
  42. package/dist/models/version-history.js +285 -0
  43. package/dist/models/version-history.js.map +1 -0
  44. package/dist/models/version.d.ts +279 -0
  45. package/dist/models/version.js +777 -0
  46. package/dist/models/version.js.map +1 -0
  47. package/dist/models/version.spec.d.ts +1 -0
  48. package/dist/models/version.spec.js +340 -0
  49. package/dist/models/version.spec.js.map +1 -0
  50. package/dist/objects/bit-object-list.d.ts +24 -0
  51. package/dist/objects/bit-object-list.js +65 -0
  52. package/dist/objects/bit-object-list.js.map +1 -0
  53. package/dist/objects/index.d.ts +5 -0
  54. package/dist/objects/index.js +60 -0
  55. package/dist/objects/index.js.map +1 -0
  56. package/dist/objects/object-list-to-graph.d.ts +13 -0
  57. package/dist/objects/object-list-to-graph.js +93 -0
  58. package/dist/objects/object-list-to-graph.js.map +1 -0
  59. package/dist/objects/object-list.d.ts +52 -0
  60. package/dist/objects/object-list.js +369 -0
  61. package/dist/objects/object-list.js.map +1 -0
  62. package/dist/objects/object.d.ts +35 -0
  63. package/dist/objects/object.js +190 -0
  64. package/dist/objects/object.js.map +1 -0
  65. package/dist/objects/objects-readable-generator.d.ts +31 -0
  66. package/dist/objects/objects-readable-generator.js +192 -0
  67. package/dist/objects/objects-readable-generator.js.map +1 -0
  68. package/dist/objects/raw-object.d.ts +23 -0
  69. package/dist/objects/raw-object.js +155 -0
  70. package/dist/objects/raw-object.js.map +1 -0
  71. package/dist/objects/ref.d.ts +14 -0
  72. package/dist/objects/ref.js +45 -0
  73. package/dist/objects/ref.js.map +1 -0
  74. package/dist/objects/repository-hooks.d.ts +4 -0
  75. package/dist/objects/repository-hooks.js +56 -0
  76. package/dist/objects/repository-hooks.js.map +1 -0
  77. package/dist/objects/repository.d.ts +148 -0
  78. package/dist/objects/repository.js +842 -0
  79. package/dist/objects/repository.js.map +1 -0
  80. package/dist/objects/scope-index.d.ts +73 -0
  81. package/dist/objects/scope-index.js +251 -0
  82. package/dist/objects/scope-index.js.map +1 -0
  83. package/dist/objects/scope-index.spec.d.ts +1 -0
  84. package/dist/objects/scope-index.spec.js +152 -0
  85. package/dist/objects/scope-index.spec.js.map +1 -0
  86. package/dist/objects.aspect.d.ts +2 -0
  87. package/dist/objects.aspect.js +18 -0
  88. package/dist/objects.aspect.js.map +1 -0
  89. package/dist/objects.main.runtime.d.ts +7 -0
  90. package/dist/objects.main.runtime.js +36 -0
  91. package/dist/objects.main.runtime.js.map +1 -0
  92. package/dist/preview-1736824735631.js +7 -0
  93. package/fixtures/version-model-extended.json +48 -0
  94. package/fixtures/version-model-object.json +87 -0
  95. package/models/dependencies-graph.ts +119 -0
  96. package/models/detach-heads.ts +79 -0
  97. package/models/export-metadata.ts +57 -0
  98. package/models/index.ts +11 -0
  99. package/models/lane-history.ts +106 -0
  100. package/models/lane.ts +367 -0
  101. package/models/model-component.spec.ts +55 -0
  102. package/models/model-component.ts +1367 -0
  103. package/models/scopeMeta.ts +60 -0
  104. package/models/source.ts +32 -0
  105. package/models/symlink.ts +66 -0
  106. package/models/version-history.ts +266 -0
  107. package/models/version.spec.ts +288 -0
  108. package/models/version.ts +818 -0
  109. package/objects/bit-object-list.ts +59 -0
  110. package/objects/index.ts +6 -0
  111. package/objects/object-list-to-graph.ts +69 -0
  112. package/objects/object-list.ts +313 -0
  113. package/objects/object.ts +153 -0
  114. package/objects/objects-readable-generator.ts +167 -0
  115. package/objects/raw-object.ts +142 -0
  116. package/objects/ref.ts +45 -0
  117. package/objects/repository-hooks.ts +42 -0
  118. package/objects/repository.ts +753 -0
  119. package/objects/scope-index.spec.ts +95 -0
  120. package/objects/scope-index.ts +192 -0
  121. package/package.json +98 -0
  122. package/types/asset.d.ts +41 -0
  123. package/types/style.d.ts +42 -0
@@ -0,0 +1,95 @@
1
+ import { expect } from 'chai';
2
+
3
+ import { ModelComponent } from '../models';
4
+ import { ScopeIndex } from './scope-index';
5
+ import BitObject from './object';
6
+
7
+ describe('ComponentsIndex', () => {
8
+ describe('addOne', () => {
9
+ let scopeIndex: ScopeIndex;
10
+ beforeEach(() => {
11
+ scopeIndex = new ScopeIndex('scope-path');
12
+ });
13
+ it('should add to the index array', () => {
14
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
15
+ const modelComponent = new ModelComponent({ scope: 'my-scope', name: 'is-string' });
16
+ scopeIndex.addOne(modelComponent);
17
+ const allItems = scopeIndex.getAll();
18
+ // @ts-ignore
19
+ expect(allItems[0].id).to.deep.equal({ scope: 'my-scope', name: 'is-string' });
20
+ });
21
+ it('should not add the same component multiple times', () => {
22
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
23
+ const modelComponent = new ModelComponent({ scope: 'my-scope', name: 'is-string' });
24
+ scopeIndex.addOne(modelComponent);
25
+ scopeIndex.addOne(modelComponent);
26
+ scopeIndex.addOne(modelComponent);
27
+ expect(scopeIndex.getAll()).to.have.lengthOf(1);
28
+ });
29
+ it('should not add BitObjects that are not Symlink nor ModelComponent', () => {
30
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
31
+ const bitObject = new BitObject({ scope: 'my-scope', name: 'is-string' });
32
+ const result = scopeIndex.addOne(bitObject);
33
+ expect(scopeIndex.getAll()).to.have.lengthOf(0);
34
+ expect(result).to.be.false;
35
+ });
36
+ });
37
+ describe('remove', () => {
38
+ let scopeIndex: ScopeIndex;
39
+ beforeEach(() => {
40
+ scopeIndex = new ScopeIndex('scope-path');
41
+ });
42
+ it('should remove from the index array', () => {
43
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
44
+ const modelComponent = new ModelComponent({ scope: 'my-scope', name: 'is-string' });
45
+ scopeIndex.addOne(modelComponent);
46
+ expect(scopeIndex.getAll()).to.have.lengthOf(1);
47
+ scopeIndex.removeOne(modelComponent.hash().toString());
48
+ expect(scopeIndex.getAll()).to.have.lengthOf(0);
49
+ });
50
+ it('should remove the correct one when there are multiple', () => {
51
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
52
+ const isStringComponent = new ModelComponent({ scope: 'my-scope', name: 'is-string' });
53
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
54
+ const isTypeComponent = new ModelComponent({ scope: 'my-scope', name: 'is-type' });
55
+ scopeIndex.addOne(isStringComponent);
56
+ scopeIndex.addOne(isTypeComponent);
57
+ expect(scopeIndex.getAll()).to.have.lengthOf(2);
58
+ scopeIndex.removeOne(isStringComponent.hash().toString());
59
+ const allIds = scopeIndex.getAll();
60
+ expect(allIds).to.have.lengthOf(1);
61
+ // @ts-ignore
62
+ expect(allIds[0].id).to.deep.equal({ scope: 'my-scope', name: 'is-type' });
63
+ });
64
+ });
65
+ describe('removeMany', () => {
66
+ let scopeIndex: ScopeIndex;
67
+ let isStringComponent;
68
+ let isTypeComponent;
69
+ beforeEach(() => {
70
+ scopeIndex = new ScopeIndex('scope-path');
71
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
72
+ isStringComponent = new ModelComponent({ scope: 'my-scope', name: 'is-string' });
73
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
74
+ isTypeComponent = new ModelComponent({ scope: 'my-scope', name: 'is-type' });
75
+ scopeIndex.addMany([isStringComponent, isTypeComponent]);
76
+ expect(scopeIndex.getAll()).to.have.lengthOf(2);
77
+ });
78
+ it('should remove multiple when removing them at the same removeMany call', () => {
79
+ expect(scopeIndex.getAll()).to.have.lengthOf(2);
80
+ scopeIndex.removeMany([isStringComponent.hash().toString(), isTypeComponent.hash().toString()]);
81
+ expect(scopeIndex.getAll()).to.have.lengthOf(0);
82
+ });
83
+ it('should remove multiple when removing them with separate removeMany calls', () => {
84
+ expect(scopeIndex.getAll()).to.have.lengthOf(2);
85
+ scopeIndex.removeMany([isStringComponent.hash().toString()]);
86
+ scopeIndex.removeMany([isTypeComponent.hash().toString()]);
87
+ expect(scopeIndex.getAll()).to.have.lengthOf(0);
88
+ });
89
+ it('should remove multiple when calling them with separate removeMany calls using array.map', () => {
90
+ expect(scopeIndex.getAll()).to.have.lengthOf(2);
91
+ [isStringComponent.hash().toString(), isTypeComponent.hash().toString()].map((h) => scopeIndex.removeMany([h]));
92
+ expect(scopeIndex.getAll()).to.have.lengthOf(0);
93
+ });
94
+ });
95
+ });
@@ -0,0 +1,192 @@
1
+ /* eslint max-classes-per-file: 0 */
2
+ import fs from 'fs-extra';
3
+ import { Mutex } from 'async-mutex';
4
+ import * as path from 'path';
5
+ import { LaneId } from '@teambit/lane-id';
6
+ import { logger } from '@teambit/legacy.logger';
7
+ import { InvalidIndexJson } from '@teambit/legacy.scope';
8
+ import { ModelComponent, Symlink } from '../models';
9
+ import Lane from '../models/lane';
10
+ import BitObject from './object';
11
+ import Ref from './ref';
12
+ import { difference } from 'lodash';
13
+
14
+ const COMPONENTS_INDEX_FILENAME = 'index.json';
15
+
16
+ export interface IndexItem {
17
+ hash: string;
18
+ toIdentifierString(): string;
19
+ }
20
+
21
+ export class ComponentItem implements IndexItem {
22
+ constructor(
23
+ public id: { scope: string | null; name: string },
24
+ public isSymlink: boolean,
25
+ public hash: string
26
+ ) {}
27
+
28
+ toIdentifierString(): string {
29
+ const scope = this.id.scope ? `${this.id.scope}/` : '';
30
+ return `component "${scope}${this.id.name}"`;
31
+ }
32
+ }
33
+
34
+ export class LaneItem implements IndexItem {
35
+ constructor(
36
+ public id: { scope: string; name: string },
37
+ public hash: string
38
+ ) {}
39
+
40
+ toIdentifierString() {
41
+ const scope = this.id.scope ? `${this.id.scope}/` : '';
42
+ return `lane "${scope}${this.id.name}"`;
43
+ }
44
+
45
+ toLaneId(): LaneId {
46
+ return new LaneId({ name: this.id.name, scope: this.id.scope });
47
+ }
48
+ }
49
+
50
+ export enum IndexType {
51
+ components = 'components',
52
+ lanes = 'lanes',
53
+ }
54
+
55
+ type Index = { [IndexType.components]: ComponentItem[]; [IndexType.lanes]: LaneItem[] };
56
+
57
+ export class ScopeIndex {
58
+ indexPath: string;
59
+ index: Index;
60
+ writeIndexMutex = new Mutex();
61
+ constructor(indexPath: string, index: Index = { [IndexType.components]: [], [IndexType.lanes]: [] }) {
62
+ this.indexPath = indexPath;
63
+ this.index = index;
64
+ }
65
+ static async load(basePath: string): Promise<ScopeIndex> {
66
+ const indexPath = this._composePath(basePath);
67
+ try {
68
+ const indexRaw = await fs.readJson(indexPath);
69
+ const getIndexWithBackwardCompatibility = (): Index => {
70
+ if (Array.isArray(indexRaw)) {
71
+ return { [IndexType.components]: indexRaw, [IndexType.lanes]: [] };
72
+ }
73
+ return indexRaw;
74
+ };
75
+ const indexObject = getIndexWithBackwardCompatibility();
76
+ const index = {
77
+ [IndexType.components]: indexObject[IndexType.components].map(
78
+ (c) => new ComponentItem(c.id, c.isSymlink, c.hash)
79
+ ),
80
+ [IndexType.lanes]: indexObject[IndexType.lanes].map((l) => new LaneItem(l.id, l.hash)),
81
+ };
82
+ return new ScopeIndex(indexPath, index);
83
+ } catch (err: any) {
84
+ if (err.message.includes('Unexpected token')) {
85
+ throw new InvalidIndexJson(indexPath, err.message);
86
+ }
87
+ throw err;
88
+ }
89
+ }
90
+ static create(basePath: string): ScopeIndex {
91
+ const indexPath = this._composePath(basePath);
92
+ return new ScopeIndex(indexPath);
93
+ }
94
+ static async reset(basePath: string) {
95
+ const indexPath = this._composePath(basePath);
96
+ logger.debug(`ComponentsIndex, deleting the index file at ${indexPath}`);
97
+ await fs.remove(indexPath);
98
+ }
99
+ async write() {
100
+ // write only one at a time to avoid corrupting the json file.
101
+ await this.writeIndexMutex.runExclusive(() => fs.writeJson(this.indexPath, this.index, { spaces: 2 }));
102
+ }
103
+ getAll(): IndexItem[] {
104
+ return Object.values(this.index).flat();
105
+ }
106
+
107
+ getHashes(indexType: IndexType): string[] {
108
+ // @ts-ignore how to tell TS that all this.index.prop are array?
109
+ return this.index[indexType].map((indexItem: IndexItem) => indexItem.hash);
110
+ }
111
+ getHashesByQuery(indexType: IndexType, filter: Function): string[] {
112
+ // @ts-ignore how to tell TS that all this.index.prop are array?
113
+ return this.index[indexType].filter(filter).map((indexItem: IndexItem) => indexItem.hash);
114
+ }
115
+ getHashesIncludeSymlinks(): string[] {
116
+ return this.index.components.map((indexItem) => indexItem.hash);
117
+ }
118
+ addMany(bitObjects: BitObject[]): boolean {
119
+ const added = bitObjects.map((bitObject) => this.addOne(bitObject));
120
+ return added.some((oneAdded) => oneAdded); // return true if one of the objects was added
121
+ }
122
+ addOne(bitObject: BitObject): boolean {
123
+ if (!(bitObject instanceof ModelComponent) && !(bitObject instanceof Symlink) && !(bitObject instanceof Lane))
124
+ return false;
125
+ const hash = bitObject.hash().toString();
126
+
127
+ if (bitObject instanceof Lane) {
128
+ const found = this.find(hash) as LaneItem | undefined;
129
+ if (found) {
130
+ if ((found as LaneItem).toLaneId().isEqual(bitObject.toLaneId())) return false;
131
+ found.id = bitObject.toLaneId();
132
+ } else {
133
+ const laneItem = new LaneItem(bitObject.toLaneId(), hash);
134
+ this.index.lanes.push(laneItem);
135
+ }
136
+ return true;
137
+ }
138
+ if (bitObject instanceof ModelComponent || bitObject instanceof Symlink) {
139
+ if (this._exist(hash)) return false;
140
+ const componentItem = new ComponentItem(
141
+ { scope: bitObject.scope || null, name: bitObject.name },
142
+ bitObject instanceof Symlink,
143
+ hash
144
+ );
145
+ this.index.components.push(componentItem);
146
+ }
147
+ return true;
148
+ }
149
+ removeMany(refs: Ref[]): boolean {
150
+ const removed = refs.map((ref) => this.removeOne(ref.toString()));
151
+ return removed.some((removedOne) => removedOne); // return true if one of the objects was removed
152
+ }
153
+ removeOne(hash: string): boolean {
154
+ for (const entity of Object.keys(IndexType)) {
155
+ const found = this.index[entity].find((indexItem) => indexItem.hash === hash);
156
+ if (found) {
157
+ this.index[entity] = difference(this.index[entity], [found]);
158
+ return true;
159
+ }
160
+ }
161
+ return false;
162
+ }
163
+ async deleteFile() {
164
+ logger.debug(`ComponentsIndex, deleting the index file at ${this.indexPath}`);
165
+ await fs.remove(this.indexPath);
166
+ }
167
+ getPath() {
168
+ return this.indexPath;
169
+ }
170
+ /**
171
+ * it's obviously not accurate. a local path might include 'bithub' as part of the path as well.
172
+ * however, it's needed only for suppressing the error message when the indexJson is outdate,
173
+ * so if it happens on a local scope it's okay.
174
+ * for other purposes, don't rely on this.
175
+ */
176
+ isFileOnBitHub() {
177
+ return this.indexPath.includes('/bithub/') || this.indexPath.includes('/tmp/scope-fs/');
178
+ }
179
+ find(hash: string): IndexItem | null {
180
+ for (const entity of Object.keys(IndexType)) {
181
+ const found = this.index[entity].find((indexItem) => indexItem.hash === hash);
182
+ if (found) return found;
183
+ }
184
+ return null;
185
+ }
186
+ _exist(hash: string): boolean {
187
+ return Boolean(this.find(hash));
188
+ }
189
+ static _composePath(basePath: string): string {
190
+ return path.join(basePath, COMPONENTS_INDEX_FILENAME);
191
+ }
192
+ }
package/package.json ADDED
@@ -0,0 +1,98 @@
1
+ {
2
+ "name": "@teambit/objects",
3
+ "version": "0.0.19",
4
+ "homepage": "https://bit.cloud/teambit/scope/objects",
5
+ "main": "dist/index.js",
6
+ "componentId": {
7
+ "scope": "teambit.scope",
8
+ "name": "objects",
9
+ "version": "0.0.19"
10
+ },
11
+ "dependencies": {
12
+ "lodash": "4.17.21",
13
+ "tar-stream": "2.2.0",
14
+ "p-map-series": "2.1.0",
15
+ "is-relative-path": "2.0.0",
16
+ "async-mutex": "0.3.1",
17
+ "fs-extra": "10.0.0",
18
+ "uid-number": "0.0.6",
19
+ "@pnpm/dependency-path": "900.0.0",
20
+ "@pnpm/lockfile.types": "^900.0.0",
21
+ "semver": "7.5.4",
22
+ "uuid": "8.3.2",
23
+ "@teambit/harmony": "0.4.6",
24
+ "@teambit/component-id": "1.2.2",
25
+ "@teambit/graph.cleargraph": "0.0.11",
26
+ "@teambit/bit-error": "0.0.404",
27
+ "@teambit/component-version": "1.0.3",
28
+ "@teambit/lane-id": "0.0.312",
29
+ "@teambit/legacy-bit-id": "1.1.1",
30
+ "@teambit/cli": "0.0.1089",
31
+ "@teambit/component.snap-distance": "0.0.20",
32
+ "@teambit/graph": "1.0.512",
33
+ "@teambit/harmony.modules.concurrency": "0.0.6",
34
+ "@teambit/legacy.logger": "0.0.7",
35
+ "@teambit/legacy.scope": "0.0.19",
36
+ "@teambit/toolbox.promise.map-pool": "0.0.3",
37
+ "@teambit/legacy.constants": "0.0.5",
38
+ "@teambit/legacy.utils": "0.0.13",
39
+ "@teambit/toolbox.crypto.sha1": "0.0.5",
40
+ "@teambit/harmony.modules.in-memory-cache": "0.0.7",
41
+ "@teambit/toolbox.fs.remove-empty-dir": "0.0.3",
42
+ "@teambit/harmony.modules.get-basic-log": "0.0.20",
43
+ "@teambit/legacy.cli.error": "0.0.7",
44
+ "@teambit/legacy.global-config": "0.0.5",
45
+ "@teambit/component.sources": "0.0.71",
46
+ "@teambit/harmony.modules.feature-toggle": "0.0.13",
47
+ "@teambit/legacy-component-log": "0.0.405",
48
+ "@teambit/legacy.consumer-component": "0.0.20",
49
+ "@teambit/legacy.consumer-config": "0.0.19",
50
+ "@teambit/legacy.extension-data": "0.0.21",
51
+ "@teambit/pkg.modules.semver-helper": "0.0.4",
52
+ "@teambit/toolbox.array.duplications-finder": "0.0.3",
53
+ "@teambit/bit.get-bit-version": "0.0.3",
54
+ "@teambit/semantics.doc-parser": "0.0.27"
55
+ },
56
+ "devDependencies": {
57
+ "@types/lodash": "4.14.165",
58
+ "@types/fs-extra": "9.0.7",
59
+ "chai": "4.3.0",
60
+ "@types/semver": "7.3.4",
61
+ "@types/uuid": "8.3.4",
62
+ "@teambit/harmony.envs.core-aspect-env": "0.0.65"
63
+ },
64
+ "peerDependencies": {
65
+ "@types/chai": "4.3.19"
66
+ },
67
+ "license": "Apache-2.0",
68
+ "optionalDependencies": {},
69
+ "peerDependenciesMeta": {},
70
+ "exports": {
71
+ ".": {
72
+ "node": {
73
+ "require": "./dist/index.js",
74
+ "import": "./dist/esm.mjs"
75
+ },
76
+ "default": "./dist/index.js"
77
+ },
78
+ "./dist/*": "./dist/*",
79
+ "./artifacts/*": "./artifacts/*",
80
+ "./*": "./*.ts"
81
+ },
82
+ "private": false,
83
+ "engines": {
84
+ "node": ">=16.0.0"
85
+ },
86
+ "repository": {
87
+ "type": "git",
88
+ "url": "https://github.com/teambit/bit"
89
+ },
90
+ "keywords": [
91
+ "bit",
92
+ "bit-aspect",
93
+ "bit-core-aspect",
94
+ "components",
95
+ "collaboration",
96
+ "web"
97
+ ]
98
+ }
@@ -0,0 +1,41 @@
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<
9
+ SVGProps<SVGSVGElement> & { title?: string }
10
+ >;
11
+ const src: string;
12
+ export default src;
13
+ }
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
+ }
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
+ }
@@ -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
+ }