@teambit/snapping 1.0.526 → 1.0.528
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/index.d.ts +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/snapping.main.runtime.d.ts +9 -10
- package/dist/snapping.main.runtime.js +16 -21
- package/dist/snapping.main.runtime.js.map +1 -1
- package/dist/version-maker.d.ts +1 -0
- package/dist/version-maker.js +5 -0
- package/dist/version-maker.js.map +1 -1
- package/package.json +19 -20
- /package/dist/{preview-1737893332947.js → preview-1738034231529.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ export type { BitCloudUser } from './version-maker';
|
|
|
3
3
|
export type { SnappingMain, TagResults, SnapResults, SnapFromScopeResults, SnapDataParsed, } from './snapping.main.runtime';
|
|
4
4
|
export default SnappingAspect;
|
|
5
5
|
export { SnappingAspect };
|
|
6
|
-
export { VersionMaker, onTagIdTransformer, BasicTagParams } from './version-maker';
|
|
6
|
+
export { VersionMaker, onTagIdTransformer, BasicTagParams, VersionMakerParams } from './version-maker';
|
|
7
7
|
export { AUTO_TAGGED_MSG, NOTHING_TO_TAG_MSG } from './tag-cmd';
|
|
8
8
|
export { snapFromScopeOptions, inputDataDescription, SnapDataPerCompRaw, SnapFromScopeOptions, } from './snap-from-scope.cmd';
|
package/dist/index.js
CHANGED
|
@@ -45,6 +45,12 @@ Object.defineProperty(exports, "VersionMaker", {
|
|
|
45
45
|
return _versionMaker().VersionMaker;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
+
Object.defineProperty(exports, "VersionMakerParams", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _versionMaker().VersionMakerParams;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
48
54
|
exports.default = void 0;
|
|
49
55
|
Object.defineProperty(exports, "inputDataDescription", {
|
|
50
56
|
enumerable: true,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_snapping","data","require","_versionMaker","_tagCmd","_snapFromScope","_default","exports","default","SnappingAspect"],"sources":["index.ts"],"sourcesContent":["import { SnappingAspect } from './snapping.aspect';\n\nexport type { BitCloudUser } from './version-maker';\nexport type {\n SnappingMain,\n TagResults,\n SnapResults,\n SnapFromScopeResults,\n SnapDataParsed,\n} from './snapping.main.runtime';\nexport default SnappingAspect;\nexport { SnappingAspect };\nexport { VersionMaker, onTagIdTransformer, BasicTagParams } from './version-maker';\nexport { AUTO_TAGGED_MSG, NOTHING_TO_TAG_MSG } from './tag-cmd';\nexport {\n snapFromScopeOptions,\n inputDataDescription,\n SnapDataPerCompRaw,\n SnapFromScopeOptions,\n} from './snap-from-scope.cmd';\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_snapping","data","require","_versionMaker","_tagCmd","_snapFromScope","_default","exports","default","SnappingAspect"],"sources":["index.ts"],"sourcesContent":["import { SnappingAspect } from './snapping.aspect';\n\nexport type { BitCloudUser } from './version-maker';\nexport type {\n SnappingMain,\n TagResults,\n SnapResults,\n SnapFromScopeResults,\n SnapDataParsed,\n} from './snapping.main.runtime';\nexport default SnappingAspect;\nexport { SnappingAspect };\nexport { VersionMaker, onTagIdTransformer, BasicTagParams, VersionMakerParams } from './version-maker';\nexport { AUTO_TAGGED_MSG, NOTHING_TO_TAG_MSG } from './tag-cmd';\nexport {\n snapFromScopeOptions,\n inputDataDescription,\n SnapDataPerCompRaw,\n SnapFromScopeOptions,\n} from './snap-from-scope.cmd';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAYA,SAAAE,cAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,aAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,eAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,cAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAK+B,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAThBC,0BAAc","ignoreList":[]}
|
|
@@ -6,10 +6,8 @@ import { ComponentID, ComponentIdList } from '@teambit/component-id';
|
|
|
6
6
|
import { BuildStatus } from '@teambit/legacy.constants';
|
|
7
7
|
import { Logger, LoggerMain } from '@teambit/logger';
|
|
8
8
|
import { ConsumerComponent } from '@teambit/legacy.consumer-component';
|
|
9
|
-
import { InsightsMain } from '@teambit/insights';
|
|
10
9
|
import { ScopeMain } from '@teambit/scope';
|
|
11
10
|
import { BitObject, Lane, ModelComponent, Version, Log, AddVersionOpts } from '@teambit/objects';
|
|
12
|
-
import { IssuesMain } from '@teambit/issues';
|
|
13
11
|
import { Component } from '@teambit/component';
|
|
14
12
|
import { DependencyResolverMain } from '@teambit/dependency-resolver';
|
|
15
13
|
import { BuilderMain } from '@teambit/builder';
|
|
@@ -23,6 +21,7 @@ import { ResetResult } from './reset-component';
|
|
|
23
21
|
import { ApplicationMain } from '@teambit/application';
|
|
24
22
|
import { RemoveMain } from '@teambit/remove';
|
|
25
23
|
import { BasicTagParams, BasicTagSnapParams, VersionMakerParams } from './version-maker';
|
|
24
|
+
import { SlotRegistry } from '@teambit/harmony';
|
|
26
25
|
export type PackageIntegritiesByPublishedPackages = Map<string, string | undefined>;
|
|
27
26
|
export type TagDataPerComp = {
|
|
28
27
|
componentId: ComponentID;
|
|
@@ -70,11 +69,11 @@ export type BasicTagResults = {
|
|
|
70
69
|
newComponents: ComponentIdList;
|
|
71
70
|
removedComponents?: ComponentIdList;
|
|
72
71
|
};
|
|
72
|
+
export type OnPreSnap = (componentsToSnap: Component[], idsToAutoSnap: ComponentID[], params: VersionMakerParams) => Promise<void>;
|
|
73
|
+
export type OnPreSnapSlot = SlotRegistry<OnPreSnap>;
|
|
73
74
|
export declare class SnappingMain {
|
|
74
75
|
readonly workspace: Workspace;
|
|
75
76
|
private logger;
|
|
76
|
-
private issues;
|
|
77
|
-
private insights;
|
|
78
77
|
readonly dependencyResolver: DependencyResolverMain;
|
|
79
78
|
readonly scope: ScopeMain;
|
|
80
79
|
private exporter;
|
|
@@ -83,8 +82,10 @@ export declare class SnappingMain {
|
|
|
83
82
|
private deps;
|
|
84
83
|
private application;
|
|
85
84
|
private remove;
|
|
85
|
+
readonly onPreSnapSlot: OnPreSnapSlot;
|
|
86
86
|
private objectsRepo;
|
|
87
|
-
constructor(workspace: Workspace, logger: Logger,
|
|
87
|
+
constructor(workspace: Workspace, logger: Logger, dependencyResolver: DependencyResolverMain, scope: ScopeMain, exporter: ExportMain, builder: BuilderMain, importer: ImporterMain, deps: DependenciesMain, application: ApplicationMain, remove: RemoveMain, onPreSnapSlot: OnPreSnapSlot);
|
|
88
|
+
registerOnPreSnap(onPreSnap: OnPreSnap): void;
|
|
88
89
|
/**
|
|
89
90
|
* tag the given component ids or all modified/new components if "all" param is set.
|
|
90
91
|
* tag is a similar operation as a snap, which saves the changes into the local scope, but it also creates an alias
|
|
@@ -209,15 +210,13 @@ export declare class SnappingMain {
|
|
|
209
210
|
UpdateDepsAspectsSaveIntoDepsResolver(component: Component, updatedIds: string[]): Promise<void>;
|
|
210
211
|
private getTagPendingComponentsIds;
|
|
211
212
|
private getComponentsToTag;
|
|
212
|
-
static slots:
|
|
213
|
+
static slots: ((registerFn: () => string) => SlotRegistry<OnPreSnap>)[];
|
|
213
214
|
static dependencies: import("@teambit/harmony").Aspect[];
|
|
214
215
|
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
215
|
-
static provider([workspace, cli, loggerMain,
|
|
216
|
+
static provider([workspace, cli, loggerMain, dependencyResolver, scope, exporter, builder, importer, globalConfig, deps, application, remove,]: [
|
|
216
217
|
Workspace,
|
|
217
218
|
CLIMain,
|
|
218
219
|
LoggerMain,
|
|
219
|
-
IssuesMain,
|
|
220
|
-
InsightsMain,
|
|
221
220
|
DependencyResolverMain,
|
|
222
221
|
ScopeMain,
|
|
223
222
|
ExportMain,
|
|
@@ -227,6 +226,6 @@ export declare class SnappingMain {
|
|
|
227
226
|
DependenciesMain,
|
|
228
227
|
ApplicationMain,
|
|
229
228
|
RemoveMain
|
|
230
|
-
]): Promise<SnappingMain>;
|
|
229
|
+
], config: any, [onPreSnapSlot]: [OnPreSnapSlot]): Promise<SnappingMain>;
|
|
231
230
|
}
|
|
232
231
|
export default SnappingMain;
|
|
@@ -116,13 +116,6 @@ function _pMap() {
|
|
|
116
116
|
};
|
|
117
117
|
return data;
|
|
118
118
|
}
|
|
119
|
-
function _insights() {
|
|
120
|
-
const data = require("@teambit/insights");
|
|
121
|
-
_insights = function () {
|
|
122
|
-
return data;
|
|
123
|
-
};
|
|
124
|
-
return data;
|
|
125
|
-
}
|
|
126
119
|
function _pkgModules() {
|
|
127
120
|
const data = require("@teambit/pkg.modules.semver-helper");
|
|
128
121
|
_pkgModules = function () {
|
|
@@ -151,13 +144,6 @@ function _objects() {
|
|
|
151
144
|
};
|
|
152
145
|
return data;
|
|
153
146
|
}
|
|
154
|
-
function _issues() {
|
|
155
|
-
const data = require("@teambit/issues");
|
|
156
|
-
_issues = function () {
|
|
157
|
-
return data;
|
|
158
|
-
};
|
|
159
|
-
return data;
|
|
160
|
-
}
|
|
161
147
|
function _dependencyResolver() {
|
|
162
148
|
const data = require("@teambit/dependency-resolver");
|
|
163
149
|
_dependencyResolver = function () {
|
|
@@ -340,6 +326,13 @@ function _versionMaker() {
|
|
|
340
326
|
};
|
|
341
327
|
return data;
|
|
342
328
|
}
|
|
329
|
+
function _harmony() {
|
|
330
|
+
const data = require("@teambit/harmony");
|
|
331
|
+
_harmony = function () {
|
|
332
|
+
return data;
|
|
333
|
+
};
|
|
334
|
+
return data;
|
|
335
|
+
}
|
|
343
336
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
344
337
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
345
338
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -347,11 +340,9 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
347
340
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
348
341
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
349
342
|
class SnappingMain {
|
|
350
|
-
constructor(workspace, logger,
|
|
343
|
+
constructor(workspace, logger, dependencyResolver, scope, exporter, builder, importer, deps, application, remove, onPreSnapSlot) {
|
|
351
344
|
this.workspace = workspace;
|
|
352
345
|
this.logger = logger;
|
|
353
|
-
this.issues = issues;
|
|
354
|
-
this.insights = insights;
|
|
355
346
|
this.dependencyResolver = dependencyResolver;
|
|
356
347
|
this.scope = scope;
|
|
357
348
|
this.exporter = exporter;
|
|
@@ -360,9 +351,13 @@ class SnappingMain {
|
|
|
360
351
|
this.deps = deps;
|
|
361
352
|
this.application = application;
|
|
362
353
|
this.remove = remove;
|
|
354
|
+
this.onPreSnapSlot = onPreSnapSlot;
|
|
363
355
|
_defineProperty(this, "objectsRepo", void 0);
|
|
364
356
|
this.objectsRepo = this.scope?.legacyScope?.objects;
|
|
365
357
|
}
|
|
358
|
+
registerOnPreSnap(onPreSnap) {
|
|
359
|
+
this.onPreSnapSlot.register(onPreSnap);
|
|
360
|
+
}
|
|
366
361
|
|
|
367
362
|
/**
|
|
368
363
|
* tag the given component ids or all modified/new components if "all" param is set.
|
|
@@ -1442,9 +1437,9 @@ another option, in case this dependency is not in main yet is to remove all refe
|
|
|
1442
1437
|
warnings
|
|
1443
1438
|
};
|
|
1444
1439
|
}
|
|
1445
|
-
static async provider([workspace, cli, loggerMain,
|
|
1440
|
+
static async provider([workspace, cli, loggerMain, dependencyResolver, scope, exporter, builder, importer, globalConfig, deps, application, remove], config, [onPreSnapSlot]) {
|
|
1446
1441
|
const logger = loggerMain.createLogger(_snapping().SnappingAspect.id);
|
|
1447
|
-
const snapping = new SnappingMain(workspace, logger,
|
|
1442
|
+
const snapping = new SnappingMain(workspace, logger, dependencyResolver, scope, exporter, builder, importer, deps, application, remove, onPreSnapSlot);
|
|
1448
1443
|
const snapCmd = new (_snapCmd().SnapCmd)(snapping, logger, globalConfig);
|
|
1449
1444
|
const tagCmd = new (_tagCmd().TagCmd)(snapping, logger, globalConfig);
|
|
1450
1445
|
const tagFromScopeCmd = new (_tagFromScope().TagFromScopeCmd)(snapping, logger);
|
|
@@ -1456,8 +1451,8 @@ another option, in case this dependency is not in main yet is to remove all refe
|
|
|
1456
1451
|
}
|
|
1457
1452
|
}
|
|
1458
1453
|
exports.SnappingMain = SnappingMain;
|
|
1459
|
-
_defineProperty(SnappingMain, "slots", []);
|
|
1460
|
-
_defineProperty(SnappingMain, "dependencies", [_workspace().WorkspaceAspect, _cli().CLIAspect, _logger().LoggerAspect,
|
|
1454
|
+
_defineProperty(SnappingMain, "slots", [_harmony().Slot.withType()]);
|
|
1455
|
+
_defineProperty(SnappingMain, "dependencies", [_workspace().WorkspaceAspect, _cli().CLIAspect, _logger().LoggerAspect, _dependencyResolver().DependencyResolverAspect, _scope().ScopeAspect, _export().ExportAspect, _builder().BuilderAspect, _importer().ImporterAspect, _globalConfig().GlobalConfigAspect, _dependencies().DependenciesAspect, _application().ApplicationAspect, _remove().RemoveAspect]);
|
|
1461
1456
|
_defineProperty(SnappingMain, "runtime", _cli().MainRuntime);
|
|
1462
1457
|
_snapping().SnappingAspect.addRuntime(SnappingMain);
|
|
1463
1458
|
var _default = exports.default = SnappingMain;
|