@teambit/objects 0.0.0-dd184ac0a6078a34baedf005a0276dc5717f53a1 → 0.0.0-dd672fbe0add5e00d519ca6f3680e6aa82a54326
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/dependencies-graph.d.ts +1 -1
- package/dist/models/dependencies-graph.js.map +1 -1
- package/dist/models/export-metadata.js +0 -2
- package/dist/models/export-metadata.js.map +1 -1
- package/dist/models/lane-history.d.ts +1 -1
- package/dist/models/lane-history.js.map +1 -1
- package/dist/models/lane.d.ts +6 -5
- package/dist/models/lane.js.map +1 -1
- package/dist/models/model-component.d.ts +10 -8
- package/dist/models/model-component.js +22 -5
- package/dist/models/model-component.js.map +1 -1
- package/dist/models/scopeMeta.d.ts +1 -1
- package/dist/models/scopeMeta.js +0 -3
- package/dist/models/scopeMeta.js.map +1 -1
- package/dist/models/source.d.ts +2 -2
- package/dist/models/source.js +0 -1
- package/dist/models/source.js.map +1 -1
- package/dist/models/symlink.d.ts +1 -1
- package/dist/models/version-history.d.ts +1 -1
- package/dist/models/version-history.js.map +1 -1
- package/dist/models/version.d.ts +11 -9
- package/dist/models/version.js +1 -13
- package/dist/models/version.js.map +1 -1
- package/dist/models/version.spec.js +4 -12
- package/dist/models/version.spec.js.map +1 -1
- package/dist/objects/bit-object-list.d.ts +1 -1
- package/dist/objects/bit-object-list.js.map +1 -1
- package/dist/objects/object-list-to-graph.d.ts +2 -2
- package/dist/objects/object-list-to-graph.js.map +1 -1
- package/dist/objects/object-list.d.ts +6 -0
- package/dist/objects/object-list.js +47 -4
- package/dist/objects/object-list.js.map +1 -1
- package/dist/objects/object.d.ts +2 -2
- package/dist/objects/object.js +0 -1
- package/dist/objects/object.js.map +1 -1
- package/dist/objects/objects-readable-generator.d.ts +4 -4
- package/dist/objects/objects-readable-generator.js.map +1 -1
- package/dist/objects/raw-object.d.ts +2 -2
- package/dist/objects/raw-object.js +1 -11
- package/dist/objects/raw-object.js.map +1 -1
- package/dist/objects/ref.d.ts +2 -2
- package/dist/objects/ref.js.map +1 -1
- package/dist/objects/repository.d.ts +23 -7
- package/dist/objects/repository.js +23 -12
- package/dist/objects/repository.js.map +1 -1
- package/dist/objects/scope-index.d.ts +2 -2
- package/dist/objects/scope-index.js +0 -1
- package/dist/objects/scope-index.js.map +1 -1
- package/models/dependencies-graph.ts +1 -1
- package/models/export-metadata.ts +0 -1
- package/models/lane-history.ts +1 -1
- package/models/lane.ts +4 -3
- package/models/model-component.ts +36 -16
- package/models/scopeMeta.ts +1 -3
- package/models/source.ts +0 -1
- package/models/version-history.ts +1 -1
- package/models/version.spec.ts +4 -12
- package/models/version.ts +10 -21
- package/objects/bit-object-list.ts +1 -1
- package/objects/object-list-to-graph.ts +2 -2
- package/objects/object-list.ts +53 -5
- package/objects/object.ts +2 -3
- package/objects/objects-readable-generator.ts +6 -6
- package/objects/raw-object.ts +2 -12
- package/objects/ref.ts +2 -2
- package/objects/repository.ts +30 -18
- package/objects/scope-index.ts +2 -3
- package/package.json +38 -38
- 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-1752249630271.js → preview-1765462803517.js} +0 -0
|
@@ -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 { 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 { 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
|