@teambit/objects 0.0.0-f03d52e4caff861760856aa8dde248d8ac3f0f2e → 0.0.0-f1a0ea5d6a2098d0671308c28b39cd778841ffdf

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 (69) hide show
  1. package/dist/models/dependencies-graph.d.ts +1 -1
  2. package/dist/models/dependencies-graph.js.map +1 -1
  3. package/dist/models/export-metadata.js +0 -2
  4. package/dist/models/export-metadata.js.map +1 -1
  5. package/dist/models/lane-history.d.ts +1 -1
  6. package/dist/models/lane-history.js.map +1 -1
  7. package/dist/models/lane.d.ts +6 -5
  8. package/dist/models/lane.js.map +1 -1
  9. package/dist/models/model-component.d.ts +10 -8
  10. package/dist/models/model-component.js +20 -3
  11. package/dist/models/model-component.js.map +1 -1
  12. package/dist/models/scopeMeta.d.ts +1 -1
  13. package/dist/models/scopeMeta.js +0 -3
  14. package/dist/models/scopeMeta.js.map +1 -1
  15. package/dist/models/source.d.ts +2 -2
  16. package/dist/models/source.js +0 -1
  17. package/dist/models/source.js.map +1 -1
  18. package/dist/models/symlink.d.ts +1 -1
  19. package/dist/models/version-history.d.ts +1 -1
  20. package/dist/models/version-history.js.map +1 -1
  21. package/dist/models/version.d.ts +11 -9
  22. package/dist/models/version.js +1 -13
  23. package/dist/models/version.js.map +1 -1
  24. package/dist/models/version.spec.js +4 -12
  25. package/dist/models/version.spec.js.map +1 -1
  26. package/dist/objects/bit-object-list.d.ts +1 -1
  27. package/dist/objects/bit-object-list.js.map +1 -1
  28. package/dist/objects/object-list-to-graph.d.ts +2 -2
  29. package/dist/objects/object-list-to-graph.js.map +1 -1
  30. package/dist/objects/object.d.ts +2 -2
  31. package/dist/objects/object.js +0 -1
  32. package/dist/objects/object.js.map +1 -1
  33. package/dist/objects/objects-readable-generator.d.ts +4 -4
  34. package/dist/objects/objects-readable-generator.js.map +1 -1
  35. package/dist/objects/raw-object.d.ts +2 -2
  36. package/dist/objects/raw-object.js +1 -11
  37. package/dist/objects/raw-object.js.map +1 -1
  38. package/dist/objects/ref.d.ts +2 -2
  39. package/dist/objects/ref.js.map +1 -1
  40. package/dist/objects/repository.d.ts +23 -7
  41. package/dist/objects/repository.js +14 -10
  42. package/dist/objects/repository.js.map +1 -1
  43. package/dist/objects/scope-index.d.ts +2 -2
  44. package/dist/objects/scope-index.js +0 -1
  45. package/dist/objects/scope-index.js.map +1 -1
  46. package/models/dependencies-graph.ts +1 -1
  47. package/models/export-metadata.ts +0 -1
  48. package/models/lane-history.ts +1 -1
  49. package/models/lane.ts +4 -3
  50. package/models/model-component.ts +34 -14
  51. package/models/scopeMeta.ts +1 -3
  52. package/models/source.ts +0 -1
  53. package/models/version-history.ts +1 -1
  54. package/models/version.spec.ts +4 -12
  55. package/models/version.ts +10 -21
  56. package/objects/bit-object-list.ts +1 -1
  57. package/objects/object-list-to-graph.ts +2 -2
  58. package/objects/object.ts +2 -3
  59. package/objects/objects-readable-generator.ts +6 -6
  60. package/objects/raw-object.ts +2 -12
  61. package/objects/ref.ts +2 -2
  62. package/objects/repository.ts +28 -17
  63. package/objects/scope-index.ts +2 -3
  64. package/package.json +37 -38
  65. package/dist/objects/repository-hooks.d.ts +0 -4
  66. package/dist/objects/repository-hooks.js +0 -56
  67. package/dist/objects/repository-hooks.js.map +0 -1
  68. package/objects/repository-hooks.ts +0 -42
  69. /package/dist/{preview-1752574874379.js → preview-1762388609386.js} +0 -0
@@ -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 { 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
- }