@teambit/objects 0.0.0-a9f25f0cec34dad43dbb54f764a23e23814cdefc → 0.0.0-ab349e426c2d0359edae0862b8c9455547bc8124
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/models/export-metadata.js +0 -2
- package/dist/models/export-metadata.js.map +1 -1
- package/dist/models/model-component.js +0 -3
- package/dist/models/model-component.js.map +1 -1
- package/dist/models/scopeMeta.js +0 -3
- package/dist/models/scopeMeta.js.map +1 -1
- package/dist/models/source.js +0 -1
- package/dist/models/source.js.map +1 -1
- package/dist/models/version.js +0 -3
- package/dist/models/version.js.map +1 -1
- package/dist/objects/object.js +0 -1
- package/dist/objects/object.js.map +1 -1
- package/dist/objects/raw-object.js +1 -11
- package/dist/objects/raw-object.js.map +1 -1
- package/dist/objects/repository.d.ts +14 -1
- package/dist/objects/repository.js +14 -10
- package/dist/objects/repository.js.map +1 -1
- package/dist/objects/scope-index.js +0 -1
- package/dist/objects/scope-index.js.map +1 -1
- package/models/export-metadata.ts +0 -1
- package/models/model-component.ts +0 -4
- package/models/scopeMeta.ts +0 -2
- package/models/source.ts +0 -1
- package/models/version.ts +0 -6
- package/objects/object.ts +0 -1
- package/objects/raw-object.ts +1 -11
- package/objects/repository.ts +17 -5
- package/objects/scope-index.ts +0 -1
- package/package.json +28 -29
- package/dist/objects/repository-hooks.d.ts +0 -4
- package/dist/objects/repository-hooks.js +0 -56
- package/dist/objects/repository-hooks.js.map +0 -1
- package/objects/repository-hooks.ts +0 -42
- /package/dist/{preview-1754998460308.js → preview-1759152123008.js} +0 -0
package/objects/scope-index.ts
CHANGED
|
@@ -111,7 +111,6 @@ export class ScopeIndex {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
getHashes(indexType: IndexType): string[] {
|
|
114
|
-
// @ts-ignore how to tell TS that all this.index.prop are array?
|
|
115
114
|
return this.index[indexType].map((indexItem: IndexItem) => indexItem.hash);
|
|
116
115
|
}
|
|
117
116
|
getHashesByQuery(indexType: IndexType, filter: Function): string[] {
|
package/package.json
CHANGED
|
@@ -1,63 +1,62 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/objects",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-ab349e426c2d0359edae0862b8c9455547bc8124",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/scope/objects",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.scope",
|
|
8
8
|
"name": "objects",
|
|
9
|
-
"version": "
|
|
9
|
+
"version": "ab349e426c2d0359edae0862b8c9455547bc8124"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash": "4.17.21",
|
|
13
13
|
"tar-stream": "2.2.0",
|
|
14
14
|
"p-map-series": "2.1.0",
|
|
15
|
-
"is-relative-path": "2.0.0",
|
|
16
15
|
"async-mutex": "0.3.1",
|
|
17
16
|
"fs-extra": "10.0.0",
|
|
18
17
|
"uid-number": "0.0.6",
|
|
19
|
-
"@pnpm/dependency-path": "1001.1.
|
|
20
|
-
"@pnpm/lockfile.types": "^1002.0.
|
|
18
|
+
"@pnpm/dependency-path": "1001.1.1",
|
|
19
|
+
"@pnpm/lockfile.types": "^1002.0.1",
|
|
21
20
|
"semver": "7.7.1",
|
|
22
21
|
"uuid": "8.3.2",
|
|
23
22
|
"@teambit/harmony": "0.4.7",
|
|
24
|
-
"@teambit/cli": "0.0.
|
|
23
|
+
"@teambit/cli": "0.0.1277",
|
|
25
24
|
"@teambit/component-id": "1.2.4",
|
|
26
|
-
"@teambit/component.snap-distance": "0.0.
|
|
25
|
+
"@teambit/component.snap-distance": "0.0.79",
|
|
27
26
|
"@teambit/graph.cleargraph": "0.0.11",
|
|
28
|
-
"@teambit/harmony.modules.concurrency": "0.0.
|
|
29
|
-
"@teambit/legacy.logger": "0.0.
|
|
30
|
-
"@teambit/legacy.scope": "0.0.
|
|
31
|
-
"@teambit/toolbox.promise.map-pool": "0.0.
|
|
32
|
-
"@teambit/legacy.constants": "0.0.
|
|
33
|
-
"@teambit/legacy.utils": "0.0.
|
|
34
|
-
"@teambit/toolbox.crypto.sha1": "0.0.
|
|
27
|
+
"@teambit/harmony.modules.concurrency": "0.0.20",
|
|
28
|
+
"@teambit/legacy.logger": "0.0.30",
|
|
29
|
+
"@teambit/legacy.scope": "0.0.78",
|
|
30
|
+
"@teambit/toolbox.promise.map-pool": "0.0.9",
|
|
31
|
+
"@teambit/legacy.constants": "0.0.19",
|
|
32
|
+
"@teambit/legacy.utils": "0.0.28",
|
|
33
|
+
"@teambit/toolbox.crypto.sha1": "0.0.10",
|
|
35
34
|
"@teambit/bit-error": "0.0.404",
|
|
36
35
|
"@teambit/component-version": "1.0.4",
|
|
37
|
-
"@teambit/harmony.modules.in-memory-cache": "0.0.
|
|
38
|
-
"@teambit/toolbox.fs.remove-empty-dir": "0.0.
|
|
36
|
+
"@teambit/harmony.modules.in-memory-cache": "0.0.23",
|
|
37
|
+
"@teambit/toolbox.fs.remove-empty-dir": "0.0.8",
|
|
39
38
|
"@teambit/lane-id": "0.0.312",
|
|
40
|
-
"@teambit/harmony.modules.get-basic-log": "0.0.
|
|
41
|
-
"@teambit/config-store": "0.0.
|
|
42
|
-
"@teambit/legacy.cli.error": "0.0.
|
|
43
|
-
"@teambit/component.sources": "0.0.
|
|
39
|
+
"@teambit/harmony.modules.get-basic-log": "0.0.79",
|
|
40
|
+
"@teambit/config-store": "0.0.157",
|
|
41
|
+
"@teambit/legacy.cli.error": "0.0.30",
|
|
42
|
+
"@teambit/component.sources": "0.0.130",
|
|
44
43
|
"@teambit/legacy-bit-id": "1.1.3",
|
|
45
|
-
"@teambit/legacy-component-log": "0.0.
|
|
46
|
-
"@teambit/legacy.consumer-component": "0.0.
|
|
47
|
-
"@teambit/legacy.consumer-config": "0.0.
|
|
48
|
-
"@teambit/legacy.extension-data": "0.0.
|
|
49
|
-
"@teambit/pkg.modules.semver-helper": "0.0.
|
|
44
|
+
"@teambit/legacy-component-log": "0.0.412",
|
|
45
|
+
"@teambit/legacy.consumer-component": "0.0.79",
|
|
46
|
+
"@teambit/legacy.consumer-config": "0.0.78",
|
|
47
|
+
"@teambit/legacy.extension-data": "0.0.80",
|
|
48
|
+
"@teambit/pkg.modules.semver-helper": "0.0.17",
|
|
50
49
|
"@teambit/toolbox.array.duplications-finder": "0.0.3",
|
|
51
|
-
"@teambit/bit.get-bit-version": "0.0.
|
|
52
|
-
"@teambit/semantics.doc-parser": "0.0.
|
|
53
|
-
"@teambit/graph": "0.0.0-
|
|
50
|
+
"@teambit/bit.get-bit-version": "0.0.10",
|
|
51
|
+
"@teambit/semantics.doc-parser": "0.0.86",
|
|
52
|
+
"@teambit/graph": "0.0.0-f4f29809f6282650f9d3af267ca85553c4d07f3d"
|
|
54
53
|
},
|
|
55
54
|
"devDependencies": {
|
|
56
55
|
"@types/lodash": "4.14.165",
|
|
57
56
|
"@types/fs-extra": "9.0.7",
|
|
58
57
|
"@types/semver": "7.5.8",
|
|
59
58
|
"@types/uuid": "8.3.4",
|
|
60
|
-
"@teambit/harmony.envs.core-aspect-env": "0.0.
|
|
59
|
+
"@teambit/harmony.envs.core-aspect-env": "0.0.79"
|
|
61
60
|
},
|
|
62
61
|
"peerDependencies": {
|
|
63
62
|
"chai": "5.2.1",
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ScopeJson } from '@teambit/legacy.scope';
|
|
2
|
-
export type ContentTransformer = (content: Buffer) => Buffer;
|
|
3
|
-
export declare function onPersist(scopePath: string, scopeJson: ScopeJson): ContentTransformer;
|
|
4
|
-
export declare function onRead(scopePath: string, scopeJson: ScopeJson): ContentTransformer;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.onPersist = onPersist;
|
|
7
|
-
exports.onRead = onRead;
|
|
8
|
-
function _isRelativePath() {
|
|
9
|
-
const data = _interopRequireDefault(require("is-relative-path"));
|
|
10
|
-
_isRelativePath = function () {
|
|
11
|
-
return data;
|
|
12
|
-
};
|
|
13
|
-
return data;
|
|
14
|
-
}
|
|
15
|
-
function _path() {
|
|
16
|
-
const data = _interopRequireDefault(require("path"));
|
|
17
|
-
_path = function () {
|
|
18
|
-
return data;
|
|
19
|
-
};
|
|
20
|
-
return data;
|
|
21
|
-
}
|
|
22
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
23
|
-
function loadHooks(scopePath, scopeJson) {
|
|
24
|
-
const hooksPath = scopeJson.hooksPath;
|
|
25
|
-
if (hooksPath) {
|
|
26
|
-
const hooksFinalPath = (0, _isRelativePath().default)(hooksPath) ? _path().default.join(scopePath, hooksPath) : hooksPath;
|
|
27
|
-
// eslint-disable-next-line global-require, import/no-dynamic-require
|
|
28
|
-
const hooks = require(hooksFinalPath);
|
|
29
|
-
return hooks;
|
|
30
|
-
}
|
|
31
|
-
return undefined;
|
|
32
|
-
}
|
|
33
|
-
function onPersist(scopePath, scopeJson) {
|
|
34
|
-
const defaultFunc = content => content;
|
|
35
|
-
const hooks = loadHooks(scopePath, scopeJson);
|
|
36
|
-
if (hooks) {
|
|
37
|
-
const onReadFunction = hooks.onPersist;
|
|
38
|
-
if (onReadFunction) {
|
|
39
|
-
return onReadFunction;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return defaultFunc;
|
|
43
|
-
}
|
|
44
|
-
function onRead(scopePath, scopeJson) {
|
|
45
|
-
const defaultFunc = content => content;
|
|
46
|
-
const hooks = loadHooks(scopePath, scopeJson);
|
|
47
|
-
if (hooks) {
|
|
48
|
-
const onReadFunction = hooks.onRead;
|
|
49
|
-
if (onReadFunction) {
|
|
50
|
-
return onReadFunction;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return defaultFunc;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
//# sourceMappingURL=repository-hooks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_isRelativePath","data","_interopRequireDefault","require","_path","e","__esModule","default","loadHooks","scopePath","scopeJson","hooksPath","hooksFinalPath","isRelative","path","join","hooks","undefined","onPersist","defaultFunc","content","onReadFunction","onRead"],"sources":["repository-hooks.ts"],"sourcesContent":["import isRelative from 'is-relative-path';\nimport path from 'path';\n\nimport type { ScopeJson } from '@teambit/legacy.scope';\n\nexport type ContentTransformer = (content: Buffer) => Buffer;\n\nfunction loadHooks(scopePath: string, scopeJson: ScopeJson): any | undefined {\n const hooksPath = scopeJson.hooksPath;\n if (hooksPath) {\n const hooksFinalPath = isRelative(hooksPath) ? path.join(scopePath, hooksPath) : hooksPath;\n // eslint-disable-next-line global-require, import/no-dynamic-require\n const hooks = require(hooksFinalPath);\n return hooks;\n }\n return undefined;\n}\n\nexport function onPersist(scopePath: string, scopeJson: ScopeJson): ContentTransformer {\n const defaultFunc = (content) => content;\n const hooks = loadHooks(scopePath, scopeJson);\n if (hooks) {\n const onReadFunction = hooks.onPersist;\n if (onReadFunction) {\n return onReadFunction;\n }\n }\n return defaultFunc;\n}\n\nexport function onRead(scopePath: string, scopeJson: ScopeJson): ContentTransformer {\n const defaultFunc = (content) => content;\n\n const hooks = loadHooks(scopePath, scopeJson);\n if (hooks) {\n const onReadFunction = hooks.onRead;\n if (onReadFunction) {\n return onReadFunction;\n }\n }\n return defaultFunc;\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,gBAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,eAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAwB,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAMxB,SAASG,SAASA,CAACC,SAAiB,EAAEC,SAAoB,EAAmB;EAC3E,MAAMC,SAAS,GAAGD,SAAS,CAACC,SAAS;EACrC,IAAIA,SAAS,EAAE;IACb,MAAMC,cAAc,GAAG,IAAAC,yBAAU,EAACF,SAAS,CAAC,GAAGG,eAAI,CAACC,IAAI,CAACN,SAAS,EAAEE,SAAS,CAAC,GAAGA,SAAS;IAC1F;IACA,MAAMK,KAAK,GAAGb,OAAO,CAACS,cAAc,CAAC;IACrC,OAAOI,KAAK;EACd;EACA,OAAOC,SAAS;AAClB;AAEO,SAASC,SAASA,CAACT,SAAiB,EAAEC,SAAoB,EAAsB;EACrF,MAAMS,WAAW,GAAIC,OAAO,IAAKA,OAAO;EACxC,MAAMJ,KAAK,GAAGR,SAAS,CAACC,SAAS,EAAEC,SAAS,CAAC;EAC7C,IAAIM,KAAK,EAAE;IACT,MAAMK,cAAc,GAAGL,KAAK,CAACE,SAAS;IACtC,IAAIG,cAAc,EAAE;MAClB,OAAOA,cAAc;IACvB;EACF;EACA,OAAOF,WAAW;AACpB;AAEO,SAASG,MAAMA,CAACb,SAAiB,EAAEC,SAAoB,EAAsB;EAClF,MAAMS,WAAW,GAAIC,OAAO,IAAKA,OAAO;EAExC,MAAMJ,KAAK,GAAGR,SAAS,CAACC,SAAS,EAAEC,SAAS,CAAC;EAC7C,IAAIM,KAAK,EAAE;IACT,MAAMK,cAAc,GAAGL,KAAK,CAACM,MAAM;IACnC,IAAID,cAAc,EAAE;MAClB,OAAOA,cAAc;IACvB;EACF;EACA,OAAOF,WAAW;AACpB","ignoreList":[]}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import isRelative from 'is-relative-path';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
|
|
4
|
-
import type { ScopeJson } from '@teambit/legacy.scope';
|
|
5
|
-
|
|
6
|
-
export type ContentTransformer = (content: Buffer) => Buffer;
|
|
7
|
-
|
|
8
|
-
function loadHooks(scopePath: string, scopeJson: ScopeJson): any | undefined {
|
|
9
|
-
const hooksPath = scopeJson.hooksPath;
|
|
10
|
-
if (hooksPath) {
|
|
11
|
-
const hooksFinalPath = isRelative(hooksPath) ? path.join(scopePath, hooksPath) : hooksPath;
|
|
12
|
-
// eslint-disable-next-line global-require, import/no-dynamic-require
|
|
13
|
-
const hooks = require(hooksFinalPath);
|
|
14
|
-
return hooks;
|
|
15
|
-
}
|
|
16
|
-
return undefined;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function onPersist(scopePath: string, scopeJson: ScopeJson): ContentTransformer {
|
|
20
|
-
const defaultFunc = (content) => content;
|
|
21
|
-
const hooks = loadHooks(scopePath, scopeJson);
|
|
22
|
-
if (hooks) {
|
|
23
|
-
const onReadFunction = hooks.onPersist;
|
|
24
|
-
if (onReadFunction) {
|
|
25
|
-
return onReadFunction;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return defaultFunc;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function onRead(scopePath: string, scopeJson: ScopeJson): ContentTransformer {
|
|
32
|
-
const defaultFunc = (content) => content;
|
|
33
|
-
|
|
34
|
-
const hooks = loadHooks(scopePath, scopeJson);
|
|
35
|
-
if (hooks) {
|
|
36
|
-
const onReadFunction = hooks.onRead;
|
|
37
|
-
if (onReadFunction) {
|
|
38
|
-
return onReadFunction;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return defaultFunc;
|
|
42
|
-
}
|
|
File without changes
|